aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ethtool.h
diff options
context:
space:
mode:
authorAnanda Raju <ananda.raju@neterion.com>2005-10-18 18:46:41 -0400
committerArnaldo Carvalho de Melo <acme@mandriva.com>2005-10-28 14:30:00 -0400
commite89e9cf539a28df7d0eb1d0a545368e9920b34ac (patch)
treeaae6a825f351ce931fcd30f1a865ebe65227c4b8 /include/linux/ethtool.h
parentde5144164f6242ccfa8c9b64eec570564f5eaf14 (diff)
[IPv4/IPv6]: UFO Scatter-gather approach
Attached is kernel patch for UDP Fragmentation Offload (UFO) feature. 1. This patch incorporate the review comments by Jeff Garzik. 2. Renamed USO as UFO (UDP Fragmentation Offload) 3. udp sendfile support with UFO This patches uses scatter-gather feature of skb to generate large UDP datagram. Below is a "how-to" on changes required in network device driver to use the UFO interface. UDP Fragmentation Offload (UFO) Interface: ------------------------------------------- UFO is a feature wherein the Linux kernel network stack will offload the IP fragmentation functionality of large UDP datagram to hardware. This will reduce the overhead of stack in fragmenting the large UDP datagram to MTU sized packets 1) Drivers indicate their capability of UFO using dev->features |= NETIF_F_UFO | NETIF_F_HW_CSUM | NETIF_F_SG NETIF_F_HW_CSUM is required for UFO over ipv6. 2) UFO packet will be submitted for transmission using driver xmit routine. UFO packet will have a non-zero value for "skb_shinfo(skb)->ufo_size" skb_shinfo(skb)->ufo_size will indicate the length of data part in each IP fragment going out of the adapter after IP fragmentation by hardware. skb->data will contain MAC/IP/UDP header and skb_shinfo(skb)->frags[] contains the data payload. The skb->ip_summed will be set to CHECKSUM_HW indicating that hardware has to do checksum calculation. Hardware should compute the UDP checksum of complete datagram and also ip header checksum of each fragmented IP packet. For IPV6 the UFO provides the fragment identification-id in skb_shinfo(skb)->ip6_frag_id. The adapter should use this ID for generating IPv6 fragments. Signed-off-by: Ananda Raju <ananda.raju@neterion.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (forwarded) Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Diffstat (limited to 'include/linux/ethtool.h')
-rw-r--r--include/linux/ethtool.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index ed1440ea4c91..d2c390eff1b2 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -269,6 +269,8 @@ u32 ethtool_op_get_tso(struct net_device *dev);
269int ethtool_op_set_tso(struct net_device *dev, u32 data); 269int ethtool_op_set_tso(struct net_device *dev, u32 data);
270int ethtool_op_get_perm_addr(struct net_device *dev, 270int ethtool_op_get_perm_addr(struct net_device *dev,
271 struct ethtool_perm_addr *addr, u8 *data); 271 struct ethtool_perm_addr *addr, u8 *data);
272u32 ethtool_op_get_ufo(struct net_device *dev);
273int ethtool_op_set_ufo(struct net_device *dev, u32 data);
272 274
273/** 275/**
274 * &ethtool_ops - Alter and report network device settings 276 * &ethtool_ops - Alter and report network device settings
@@ -298,6 +300,8 @@ int ethtool_op_get_perm_addr(struct net_device *dev,
298 * set_sg: Turn scatter-gather on or off 300 * set_sg: Turn scatter-gather on or off
299 * get_tso: Report whether TCP segmentation offload is enabled 301 * get_tso: Report whether TCP segmentation offload is enabled
300 * set_tso: Turn TCP segmentation offload on or off 302 * set_tso: Turn TCP segmentation offload on or off
303 * get_ufo: Report whether UDP fragmentation offload is enabled
304 * set_ufo: Turn UDP fragmentation offload on or off
301 * self_test: Run specified self-tests 305 * self_test: Run specified self-tests
302 * get_strings: Return a set of strings that describe the requested objects 306 * get_strings: Return a set of strings that describe the requested objects
303 * phys_id: Identify the device 307 * phys_id: Identify the device
@@ -364,6 +368,8 @@ struct ethtool_ops {
364 int (*get_perm_addr)(struct net_device *, struct ethtool_perm_addr *, u8 *); 368 int (*get_perm_addr)(struct net_device *, struct ethtool_perm_addr *, u8 *);
365 int (*begin)(struct net_device *); 369 int (*begin)(struct net_device *);
366 void (*complete)(struct net_device *); 370 void (*complete)(struct net_device *);
371 u32 (*get_ufo)(struct net_device *);
372 int (*set_ufo)(struct net_device *, u32);
367}; 373};
368 374
369/* CMDs currently supported */ 375/* CMDs currently supported */
@@ -400,6 +406,8 @@ struct ethtool_ops {
400#define ETHTOOL_GTSO 0x0000001e /* Get TSO enable (ethtool_value) */ 406#define ETHTOOL_GTSO 0x0000001e /* Get TSO enable (ethtool_value) */
401#define ETHTOOL_STSO 0x0000001f /* Set TSO enable (ethtool_value) */ 407#define ETHTOOL_STSO 0x0000001f /* Set TSO enable (ethtool_value) */
402#define ETHTOOL_GPERMADDR 0x00000020 /* Get permanent hardware address */ 408#define ETHTOOL_GPERMADDR 0x00000020 /* Get permanent hardware address */
409#define ETHTOOL_GUFO 0x00000021 /* Get UFO enable (ethtool_value) */
410#define ETHTOOL_SUFO 0x00000022 /* Set UFO enable (ethtool_value) */
403 411
404/* compatibility with older code */ 412/* compatibility with older code */
405#define SPARC_ETH_GSET ETHTOOL_GSET 413#define SPARC_ETH_GSET ETHTOOL_GSET