Skip to content

Commit

Permalink
net: usb: aqc111: Add support for TSO
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Bezrukov <dmitry.bezrukov@aquantia.com>
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Dmitry Bezrukov authored and David S. Miller committed Nov 27, 2018
1 parent 6649d2a commit de074e7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions drivers/net/usb/aqc111.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,8 @@ static int aqc111_bind(struct usbnet *dev, struct usb_interface *intf)
dev->net->hw_features |= AQ_SUPPORT_HW_FEATURE;
dev->net->features |= AQ_SUPPORT_FEATURE;

netif_set_gso_max_size(dev->net, 65535);

aqc111_read_fw_version(dev, aqc111_data);
aqc111_data->autoneg = AUTONEG_ENABLE;
aqc111_data->advertised_speed = (usb_speed == USB_SPEED_SUPER) ?
Expand Down Expand Up @@ -832,6 +834,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;
Expand Down
8 changes: 6 additions & 2 deletions drivers/net/usb/aqc111.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. ********************************************/

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit de074e7

Please sign in to comment.