[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <913d4885a93b10a9ff4d8f1de318cefa54c803e6.1542794577.git.igor.russkikh@aquantia.com>
Date: Wed, 21 Nov 2018 10:13:48 +0000
From: Igor Russkikh <Igor.Russkikh@...antia.com>
To: "linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
"davem@...emloft.net" <davem@...emloft.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC: "andrew@...n.ch" <andrew@...n.ch>,
Dmitry Bezrukov <Dmitry.Bezrukov@...antia.com>,
Igor Russkikh <Igor.Russkikh@...antia.com>
Subject: [PATCH v3 net-next 13/21] net: usb: aqc111: Add support for TSO
From: Dmitry Bezrukov <dmitry.bezrukov@...antia.com>
Signed-off-by: Dmitry Bezrukov <dmitry.bezrukov@...antia.com>
Signed-off-by: Igor Russkikh <igor.russkikh@...antia.com>
---
drivers/net/usb/aqc111.c | 4 ++++
drivers/net/usb/aqc111.h | 8 ++++++--
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/net/usb/aqc111.c b/drivers/net/usb/aqc111.c
index 36d0da6efbed..4bb493c7224f 100644
--- a/drivers/net/usb/aqc111.c
+++ b/drivers/net/usb/aqc111.c
@@ -832,6 +832,10 @@ static struct sk_buff *aqc111_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
/*Length of actual data*/
tx_desc |= skb->len & AQ_TX_DESC_LEN_MASK;
+ /* TSO MSS */
+ tx_desc |= ((u64)(skb_shinfo(skb)->gso_size & AQ_TX_DESC_MSS_MASK)) <<
+ AQ_TX_DESC_MSS_SHIFT;
+
headroom = (skb->len + sizeof(tx_desc)) % 8;
if (headroom != 0)
padding_size = 8 - headroom;
diff --git a/drivers/net/usb/aqc111.h b/drivers/net/usb/aqc111.h
index 165cdb8b022c..a7a333914461 100644
--- a/drivers/net/usb/aqc111.h
+++ b/drivers/net/usb/aqc111.h
@@ -22,10 +22,12 @@
/* Feature. ********************************************/
#define AQ_SUPPORT_FEATURE (NETIF_F_SG | NETIF_F_IP_CSUM |\
- NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM)
+ NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM |\
+ NETIF_F_TSO)
#define AQ_SUPPORT_HW_FEATURE (NETIF_F_SG | NETIF_F_IP_CSUM |\
- NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM)
+ NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM |\
+ NETIF_F_TSO)
/* SFR Reg. ********************************************/
@@ -162,6 +164,8 @@ struct aqc111_data {
/* TX Descriptor */
#define AQ_TX_DESC_LEN_MASK 0x1FFFFF
#define AQ_TX_DESC_DROP_PADD BIT(28)
+#define AQ_TX_DESC_MSS_MASK 0x7FFF
+#define AQ_TX_DESC_MSS_SHIFT 0x20
#define AQ_RX_HW_PAD 0x02
--
2.17.1
Powered by blists - more mailing lists