diff options
author | Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> | 2008-03-21 06:43:19 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-03-21 06:43:19 -0400 |
commit | 82cc1a7a56872056af0ead6c7d695aa223f36695 (patch) | |
tree | 0891cf854a40cac90fc4fec3bd6b5ecb213d4452 /include/linux/netdevice.h | |
parent | a25606c845856e5ca5ed54d23cab077e3a49bf10 (diff) |
[NET]: Add per-connection option to set max TSO frame size
Update: My mailer ate one of Jarek's feedback mails... Fixed the
parameter in netif_set_gso_max_size() to be u32, not u16. Fixed the
whitespace issue due to a patch import botch. Changed the types from
u32 to unsigned int to be more consistent with other variables in the
area. Also brought the patch up to the latest net-2.6.26 tree.
Update: Made gso_max_size container 32 bits, not 16. Moved the
location of gso_max_size within netdev to be less hotpath. Made more
consistent names between the sock and netdev layers, and added a
define for the max GSO size.
Update: Respun for net-2.6.26 tree.
Update: changed max_gso_frame_size and sk_gso_max_size from signed to
unsigned - thanks Stephen!
This patch adds the ability for device drivers to control the size of
the TSO frames being sent to them, per TCP connection. By setting the
netdevice's gso_max_size value, the socket layer will set the GSO
frame size based on that value. This will propogate into the TCP
layer, and send TSO's of that size to the hardware.
This can be desirable to help tune the bursty nature of TSO on a
per-adapter basis, where one may have 1 GbE and 10 GbE devices
coexisting in a system, one running multiqueue and the other not, etc.
This can also be desirable for devices that cannot support full 64 KB
TSO's, but still want to benefit from some level of segmentation
offloading.
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index a2f003239c85..ced61f87660e 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -724,6 +724,10 @@ struct net_device | |||
724 | /* rtnetlink link ops */ | 724 | /* rtnetlink link ops */ |
725 | const struct rtnl_link_ops *rtnl_link_ops; | 725 | const struct rtnl_link_ops *rtnl_link_ops; |
726 | 726 | ||
727 | /* for setting kernel sock attribute on TCP connection setup */ | ||
728 | #define GSO_MAX_SIZE 65536 | ||
729 | unsigned int gso_max_size; | ||
730 | |||
727 | /* The TX queue control structures */ | 731 | /* The TX queue control structures */ |
728 | unsigned int egress_subqueue_count; | 732 | unsigned int egress_subqueue_count; |
729 | struct net_device_subqueue egress_subqueue[1]; | 733 | struct net_device_subqueue egress_subqueue[1]; |
@@ -1475,6 +1479,12 @@ static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb) | |||
1475 | unlikely(skb->ip_summed != CHECKSUM_PARTIAL)); | 1479 | unlikely(skb->ip_summed != CHECKSUM_PARTIAL)); |
1476 | } | 1480 | } |
1477 | 1481 | ||
1482 | static inline void netif_set_gso_max_size(struct net_device *dev, | ||
1483 | unsigned int size) | ||
1484 | { | ||
1485 | dev->gso_max_size = size; | ||
1486 | } | ||
1487 | |||
1478 | /* On bonding slaves other than the currently active slave, suppress | 1488 | /* On bonding slaves other than the currently active slave, suppress |
1479 | * duplicates except for 802.3ad ETH_P_SLOW, alb non-mcast/bcast, and | 1489 | * duplicates except for 802.3ad ETH_P_SLOW, alb non-mcast/bcast, and |
1480 | * ARP on active-backup slaves with arp_validate enabled. | 1490 | * ARP on active-backup slaves with arp_validate enabled. |