From: Xin Long <lucien.xin@gmail.com> Date: 2021-01-16 06:14:48
This patch is to define a inline function skb_csum_is_sctp(), and
also replace all places where it checks if it's a SCTP CSUM skb.
This function would be used later in many networking drivers in
the following patches.
Suggested-by: Alexander Duyck <redacted>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
drivers/net/ethernet/pensando/ionic/ionic_txrx.c | 2 +-
include/linux/skbuff.h | 5 +++++
net/core/dev.c | 2 +-
3 files changed, 7 insertions(+), 2 deletions(-)
From: Xin Long <lucien.xin@gmail.com> Date: 2021-01-16 06:15:04
Using skb_csum_is_sctp is a easier way to validate it's a SCTP
CRC checksum offload packet, and there is no need to parse the
packet to check its proto field, especially when it's a UDP or
GRE encapped packet.
So this patch also makes igb support SCTP CRC checksum offload
for UDP and GRE encapped packets.
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
drivers/net/ethernet/intel/igb/igb_main.c | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
From: Xin Long <lucien.xin@gmail.com> Date: 2021-01-16 06:15:05
Using skb_csum_is_sctp is a easier way to validate it's a SCTP CRC
checksum offload packet, and yet it also makes igbvf support SCTP
CRC checksum offload for UDP and GRE encapped packets, just as it
does in igb driver.
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
drivers/net/ethernet/intel/igbvf/netdev.c | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
From: Xin Long <lucien.xin@gmail.com> Date: 2021-01-16 06:15:05
Using skb_csum_is_sctp is a easier way to validate it's a SCTP CRC
checksum offload packet, and yet it also makes igc support SCTP
CRC checksum offload for UDP and GRE encapped packets, just as it
does in igb driver.
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
drivers/net/ethernet/intel/igc/igc_main.c | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
From: Xin Long <lucien.xin@gmail.com> Date: 2021-01-16 06:15:29
Using skb_csum_is_sctp is a easier way to validate it's a SCTP CRC
checksum offload packet, and yet it also makes ixgbe support SCTP
CRC checksum offload for UDP and GRE encapped packets, just as it
does in igb driver.
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
@@ -8040,15 +8040,6 @@ static int ixgbe_tso(struct ixgbe_ring *tx_ring,return1;}-staticinlineboolixgbe_ipv6_csum_is_sctp(structsk_buff*skb)-{-unsignedintoffset=0;--ipv6_find_hdr(skb,&offset,IPPROTO_SCTP,NULL,NULL);--returnoffset==skb_checksum_start_offset(skb);-}-staticvoidixgbe_tx_csum(structixgbe_ring*tx_ring,structixgbe_tx_buffer*first,structixgbe_ipsec_tx_data*itd)
@@ -8074,10 +8065,7 @@ static void ixgbe_tx_csum(struct ixgbe_ring *tx_ring,break;caseoffsetof(structsctphdr,checksum):/* validate that this is actually an SCTP request */-if(((first->protocol==htons(ETH_P_IP))&&-(ip_hdr(skb)->protocol==IPPROTO_SCTP))||-((first->protocol==htons(ETH_P_IPV6))&&-ixgbe_ipv6_csum_is_sctp(skb))){+if(skb_csum_is_sctp(skb)){type_tucmd=IXGBE_ADVTXD_TUCMD_L4T_SCTP;break;}
From: Xin Long <lucien.xin@gmail.com> Date: 2021-01-16 06:15:29
Using skb_csum_is_sctp is a easier way to validate it's a SCTP CRC
checksum offload packet, and yet it also makes ixgbevf support SCTP
CRC checksum offload for UDP and GRE encapped packets, just as it
does in igb driver.
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
@@ -3844,15 +3844,6 @@ static int ixgbevf_tso(struct ixgbevf_ring *tx_ring,return1;}-staticinlineboolixgbevf_ipv6_csum_is_sctp(structsk_buff*skb)-{-unsignedintoffset=0;--ipv6_find_hdr(skb,&offset,IPPROTO_SCTP,NULL,NULL);--returnoffset==skb_checksum_start_offset(skb);-}-staticvoidixgbevf_tx_csum(structixgbevf_ring*tx_ring,structixgbevf_tx_buffer*first,structixgbevf_ipsec_tx_data*itd)
@@ -3873,10 +3864,7 @@ static void ixgbevf_tx_csum(struct ixgbevf_ring *tx_ring,break;caseoffsetof(structsctphdr,checksum):/* validate that this is actually an SCTP request */-if(((first->protocol==htons(ETH_P_IP))&&-(ip_hdr(skb)->protocol==IPPROTO_SCTP))||-((first->protocol==htons(ETH_P_IPV6))&&-ixgbevf_ipv6_csum_is_sctp(skb))){+if(skb_csum_is_sctp(skb)){type_tucmd=IXGBE_ADVTXD_TUCMD_L4T_SCTP;break;}
From: Alexander Duyck <hidden> Date: 2021-01-19 22:24:49
On Fri, Jan 15, 2021 at 10:13 PM Xin Long [off-list ref] wrote:
This patch is to define a inline function skb_csum_is_sctp(), and
also replace all places where it checks if it's a SCTP CSUM skb.
This function would be used later in many networking drivers in
the following patches.
Suggested-by: Alexander Duyck <redacted>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
One minor nit. If you had to resubmit this I might move the ionic
driver code into a separate patch. However It can probably be accepted
as is.
Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
From: Alexander Duyck <hidden> Date: 2021-01-19 22:25:22
On Fri, Jan 15, 2021 at 10:14 PM Xin Long [off-list ref] wrote:
Using skb_csum_is_sctp is a easier way to validate it's a SCTP
CRC checksum offload packet, and there is no need to parse the
packet to check its proto field, especially when it's a UDP or
GRE encapped packet.
So this patch also makes igb support SCTP CRC checksum offload
for UDP and GRE encapped packets.
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
From: Alexander Duyck <hidden> Date: 2021-01-19 22:25:36
On Fri, Jan 15, 2021 at 10:14 PM Xin Long [off-list ref] wrote:
Using skb_csum_is_sctp is a easier way to validate it's a SCTP CRC
checksum offload packet, and yet it also makes igbvf support SCTP
CRC checksum offload for UDP and GRE encapped packets, just as it
does in igb driver.
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
From: Alexander Duyck <hidden> Date: 2021-01-19 22:26:43
On Fri, Jan 15, 2021 at 10:14 PM Xin Long [off-list ref] wrote:
Using skb_csum_is_sctp is a easier way to validate it's a SCTP CRC
checksum offload packet, and yet it also makes igc support SCTP
CRC checksum offload for UDP and GRE encapped packets, just as it
does in igb driver.
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
From: Alexander Duyck <hidden> Date: 2021-01-19 22:27:14
On Fri, Jan 15, 2021 at 10:14 PM Xin Long [off-list ref] wrote:
Using skb_csum_is_sctp is a easier way to validate it's a SCTP CRC
checksum offload packet, and yet it also makes ixgbevf support SCTP
CRC checksum offload for UDP and GRE encapped packets, just as it
does in igb driver.
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
From: Alexander Duyck <hidden> Date: 2021-01-19 22:27:15
On Fri, Jan 15, 2021 at 10:14 PM Xin Long [off-list ref] wrote:
Using skb_csum_is_sctp is a easier way to validate it's a SCTP CRC
checksum offload packet, and yet it also makes ixgbe support SCTP
CRC checksum offload for UDP and GRE encapped packets, just as it
does in igb driver.
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
From: Shannon Nelson <hidden> Date: 2021-01-19 23:39:51
On 1/19/21 2:23 PM, Alexander Duyck wrote:
On Fri, Jan 15, 2021 at 10:13 PM Xin Long [off-list ref] wrote:
quoted
This patch is to define a inline function skb_csum_is_sctp(), and
also replace all places where it checks if it's a SCTP CSUM skb.
This function would be used later in many networking drivers in
the following patches.
Suggested-by: Alexander Duyck <redacted>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
One minor nit. If you had to resubmit this I might move the ionic
driver code into a separate patch. However It can probably be accepted
as is.
Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
Alex has a good point - if you repost, please split out the ionic bits
to a separate patch.
Either way, for ionic:
Acked-by: Shannon Nelson <redacted>
Hello:
This series was applied to netdev/net-next.git (refs/heads/master):
On Sat, 16 Jan 2021 14:13:36 +0800 you wrote:
This patchset introduces inline function skb_csum_is_sctp(), and uses it
to validate it's a sctp CRC csum offload packet, to make SCTP CRC csum
offload for tunneling packets supported in some HW drivers.
Xin Long (6):
net: add inline function skb_csum_is_sctp
net: igb: use skb_csum_is_sctp instead of protocol check
net: igbvf: use skb_csum_is_sctp instead of protocol check
net: igc: use skb_csum_is_sctp instead of protocol check
net: ixgbe: use skb_csum_is_sctp instead of protocol check
net: ixgbevf: use skb_csum_is_sctp instead of protocol check
[...]