Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH S35 01/15] ice: Support UDP segmentation offload
@ 2019-12-12 11:12 Tony Nguyen
  2019-12-12 11:12 ` [Intel-wired-lan] [PATCH S35 02/15] ice: Fix VF spoofchk Tony Nguyen
                   ` (14 more replies)
  0 siblings, 15 replies; 30+ messages in thread
From: Tony Nguyen @ 2019-12-12 11:12 UTC (permalink / raw)
  To: intel-wired-lan

From: Brett Creeley <brett.creeley@intel.com>

Based on the work done by Alex Duyck on other Intel drivers, add code to
support UDP segmentation offload (USO) for the ice driver.

Signed-off-by: Brett Creeley <brett.creeley@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_main.c |  3 ++-
 drivers/net/ethernet/intel/ice/ice_txrx.c | 15 ++++++++++++---
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index d8809a5c07d6..31cd816e7cfb 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -2336,7 +2336,8 @@ static void ice_set_netdev_features(struct net_device *netdev)
 			 NETIF_F_HW_VLAN_CTAG_TX     |
 			 NETIF_F_HW_VLAN_CTAG_RX;
 
-	tso_features = NETIF_F_TSO;
+	tso_features = NETIF_F_TSO		|
+		       NETIF_F_GSO_UDP_L4;
 
 	/* set features that user can change */
 	netdev->hw_features = dflt_features | csumo_features |
diff --git a/drivers/net/ethernet/intel/ice/ice_txrx.c b/drivers/net/ethernet/intel/ice/ice_txrx.c
index 2c212f64d99f..b77514bbd7ba 100644
--- a/drivers/net/ethernet/intel/ice/ice_txrx.c
+++ b/drivers/net/ethernet/intel/ice/ice_txrx.c
@@ -1925,6 +1925,7 @@ int ice_tso(struct ice_tx_buf *first, struct ice_tx_offload_params *off)
 	} ip;
 	union {
 		struct tcphdr *tcp;
+		struct udphdr *udp;
 		unsigned char *hdr;
 	} l4;
 	u64 cd_mss, cd_tso_len;
@@ -1958,10 +1959,18 @@ int ice_tso(struct ice_tx_buf *first, struct ice_tx_offload_params *off)
 
 	/* remove payload length from checksum */
 	paylen = skb->len - l4_start;
-	csum_replace_by_diff(&l4.tcp->check, (__force __wsum)htonl(paylen));
 
-	/* compute length of segmentation header */
-	off->header_len = (l4.tcp->doff * 4) + l4_start;
+	if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4) {
+		csum_replace_by_diff(&l4.udp->check,
+				     (__force __wsum)htonl(paylen));
+		/* compute length of UDP segmentation header */
+		off->header_len = sizeof(l4.udp) + l4_start;
+	} else {
+		csum_replace_by_diff(&l4.tcp->check,
+				     (__force __wsum)htonl(paylen));
+		/* compute length of TCP segmentation header */
+		off->header_len = (l4.tcp->doff * 4) + l4_start;
+	}
 
 	/* update gso_segs and bytecount */
 	first->gso_segs = skb_shinfo(skb)->gso_segs;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2019-12-18 22:34 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-12 11:12 [Intel-wired-lan] [PATCH S35 01/15] ice: Support UDP segmentation offload Tony Nguyen
2019-12-12 11:12 ` [Intel-wired-lan] [PATCH S35 02/15] ice: Fix VF spoofchk Tony Nguyen
2019-12-18 22:15   ` Bowers, AndrewX
2019-12-12 11:12 ` [Intel-wired-lan] [PATCH S35 03/15] ice: Add code to keep track of current dflt_vsi Tony Nguyen
2019-12-18 22:16   ` Bowers, AndrewX
2019-12-12 11:12 ` [Intel-wired-lan] [PATCH S35 04/15] ice: Add ice_for_each_vf() macro Tony Nguyen
2019-12-18 22:18   ` Bowers, AndrewX
2019-12-12 11:12 ` [Intel-wired-lan] [PATCH S35 05/15] ice: Set default value for ITR in alloc function Tony Nguyen
2019-12-18 22:20   ` Bowers, AndrewX
2019-12-12 11:12 ` [Intel-wired-lan] [PATCH S35 06/15] ice: Restore interrupt throttle settings after VSI rebuild Tony Nguyen
2019-12-18 22:20   ` Bowers, AndrewX
2019-12-12 11:12 ` [Intel-wired-lan] [PATCH S35 07/15] ice: Return error on not supported ethtool -C parameters Tony Nguyen
2019-12-18 22:23   ` Bowers, AndrewX
2019-12-12 11:13 ` [Intel-wired-lan] [PATCH S35 08/15] ice: Remove Rx flex descriptor programming Tony Nguyen
2019-12-18 22:25   ` Bowers, AndrewX
2019-12-12 11:13 ` [Intel-wired-lan] [PATCH S35 09/15] ice: Fix VF link state when it's IFLA_VF_LINK_STATE_AUTO Tony Nguyen
2019-12-18 22:26   ` Bowers, AndrewX
2019-12-12 11:13 ` [Intel-wired-lan] [PATCH S35 10/15] ice: Enable ip link show on the PF to display VF unicast MAC(s) Tony Nguyen
2019-12-18 22:29   ` Bowers, AndrewX
2019-12-12 11:13 ` [Intel-wired-lan] [PATCH S35 11/15] ice: Demote MTU change print to debug Tony Nguyen
2019-12-18 22:31   ` Bowers, AndrewX
2019-12-12 11:13 ` [Intel-wired-lan] [PATCH S35 12/15] ice: suppress checked_return error Tony Nguyen
2019-12-18 22:32   ` Bowers, AndrewX
2019-12-12 11:13 ` [Intel-wired-lan] [PATCH S35 13/15] ice: add extra check for null rx descriptor Tony Nguyen
2019-12-18 22:32   ` Bowers, AndrewX
2019-12-12 11:13 ` [Intel-wired-lan] [PATCH S35 14/15] ice: Add a boundary check in ice_xsk_umem() Tony Nguyen
2019-12-18 22:34   ` Bowers, AndrewX
2019-12-12 11:13 ` [Intel-wired-lan] [PATCH S35 15/15] ice: Suppress Coverity warnings for xdp_rxq_info_reg Tony Nguyen
2019-12-18 22:34   ` Bowers, AndrewX
2019-12-18 22:11 ` [Intel-wired-lan] [PATCH S35 01/15] ice: Support UDP segmentation offload Bowers, AndrewX

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox