diff options
author | Ananda Raju <ananda.raju@neterion.com> | 2005-10-18 18:46:41 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@mandriva.com> | 2005-10-28 14:30:00 -0400 |
commit | e89e9cf539a28df7d0eb1d0a545368e9920b34ac (patch) | |
tree | aae6a825f351ce931fcd30f1a865ebe65227c4b8 /include/linux/skbuff.h | |
parent | de5144164f6242ccfa8c9b64eec570564f5eaf14 (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/skbuff.h')
-rw-r--r-- | include/linux/skbuff.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index b756935da9c8..4286d832166f 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -137,6 +137,8 @@ struct skb_shared_info { | |||
137 | unsigned int nr_frags; | 137 | unsigned int nr_frags; |
138 | unsigned short tso_size; | 138 | unsigned short tso_size; |
139 | unsigned short tso_segs; | 139 | unsigned short tso_segs; |
140 | unsigned short ufo_size; | ||
141 | unsigned int ip6_frag_id; | ||
140 | struct sk_buff *frag_list; | 142 | struct sk_buff *frag_list; |
141 | skb_frag_t frags[MAX_SKB_FRAGS]; | 143 | skb_frag_t frags[MAX_SKB_FRAGS]; |
142 | }; | 144 | }; |
@@ -341,6 +343,11 @@ extern void skb_over_panic(struct sk_buff *skb, int len, | |||
341 | extern void skb_under_panic(struct sk_buff *skb, int len, | 343 | extern void skb_under_panic(struct sk_buff *skb, int len, |
342 | void *here); | 344 | void *here); |
343 | 345 | ||
346 | extern int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb, | ||
347 | int getfrag(void *from, char *to, int offset, | ||
348 | int len,int odd, struct sk_buff *skb), | ||
349 | void *from, int length); | ||
350 | |||
344 | struct skb_seq_state | 351 | struct skb_seq_state |
345 | { | 352 | { |
346 | __u32 lower_offset; | 353 | __u32 lower_offset; |