diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2009-04-16 05:02:07 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-04-16 05:02:07 -0400 |
commit | 76620aafd66f0004829764940c5466144969cffc (patch) | |
tree | 38041e6938121b5611546c582cd23f289db047b0 /include | |
parent | 861ab44059350e5cab350238606cf8814abab93b (diff) |
gro: New frags interface to avoid copying shinfo
It turns out that copying a 16-byte area at ~800k times a second
can be really expensive :) This patch redesigns the frags GRO
interface to avoid copying that area twice.
The two disciples of the frags interface have been converted.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/if_vlan.h | 6 | ||||
-rw-r--r-- | include/linux/netdevice.h | 22 |
2 files changed, 12 insertions, 16 deletions
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index e1ff5b14310e..7ff9af1d0f05 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
@@ -118,8 +118,7 @@ extern int vlan_hwaccel_do_receive(struct sk_buff *skb); | |||
118 | extern int vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp, | 118 | extern int vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp, |
119 | unsigned int vlan_tci, struct sk_buff *skb); | 119 | unsigned int vlan_tci, struct sk_buff *skb); |
120 | extern int vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp, | 120 | extern int vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp, |
121 | unsigned int vlan_tci, | 121 | unsigned int vlan_tci); |
122 | struct napi_gro_fraginfo *info); | ||
123 | 122 | ||
124 | #else | 123 | #else |
125 | static inline struct net_device *vlan_dev_real_dev(const struct net_device *dev) | 124 | static inline struct net_device *vlan_dev_real_dev(const struct net_device *dev) |
@@ -154,8 +153,7 @@ static inline int vlan_gro_receive(struct napi_struct *napi, | |||
154 | } | 153 | } |
155 | 154 | ||
156 | static inline int vlan_gro_frags(struct napi_struct *napi, | 155 | static inline int vlan_gro_frags(struct napi_struct *napi, |
157 | struct vlan_group *grp, unsigned int vlan_tci, | 156 | struct vlan_group *grp, unsigned int vlan_tci) |
158 | struct napi_gro_fraginfo *info) | ||
159 | { | 157 | { |
160 | return NET_RX_DROP; | 158 | return NET_RX_DROP; |
161 | } | 159 | } |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 2e7783f4a755..54db3ebf2193 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -1047,14 +1047,6 @@ struct packet_type { | |||
1047 | struct list_head list; | 1047 | struct list_head list; |
1048 | }; | 1048 | }; |
1049 | 1049 | ||
1050 | struct napi_gro_fraginfo { | ||
1051 | skb_frag_t frags[MAX_SKB_FRAGS]; | ||
1052 | unsigned int nr_frags; | ||
1053 | unsigned int ip_summed; | ||
1054 | unsigned int len; | ||
1055 | __wsum csum; | ||
1056 | }; | ||
1057 | |||
1058 | #include <linux/interrupt.h> | 1050 | #include <linux/interrupt.h> |
1059 | #include <linux/notifier.h> | 1051 | #include <linux/notifier.h> |
1060 | 1052 | ||
@@ -1442,12 +1434,18 @@ extern int napi_gro_receive(struct napi_struct *napi, | |||
1442 | struct sk_buff *skb); | 1434 | struct sk_buff *skb); |
1443 | extern void napi_reuse_skb(struct napi_struct *napi, | 1435 | extern void napi_reuse_skb(struct napi_struct *napi, |
1444 | struct sk_buff *skb); | 1436 | struct sk_buff *skb); |
1445 | extern struct sk_buff * napi_fraginfo_skb(struct napi_struct *napi, | 1437 | extern struct sk_buff * napi_get_frags(struct napi_struct *napi); |
1446 | struct napi_gro_fraginfo *info); | ||
1447 | extern int napi_frags_finish(struct napi_struct *napi, | 1438 | extern int napi_frags_finish(struct napi_struct *napi, |
1448 | struct sk_buff *skb, int ret); | 1439 | struct sk_buff *skb, int ret); |
1449 | extern int napi_gro_frags(struct napi_struct *napi, | 1440 | extern struct sk_buff * napi_frags_skb(struct napi_struct *napi); |
1450 | struct napi_gro_fraginfo *info); | 1441 | extern int napi_gro_frags(struct napi_struct *napi); |
1442 | |||
1443 | static inline void napi_free_frags(struct napi_struct *napi) | ||
1444 | { | ||
1445 | kfree_skb(napi->skb); | ||
1446 | napi->skb = NULL; | ||
1447 | } | ||
1448 | |||
1451 | extern void netif_nit_deliver(struct sk_buff *skb); | 1449 | extern void netif_nit_deliver(struct sk_buff *skb); |
1452 | extern int dev_valid_name(const char *name); | 1450 | extern int dev_valid_name(const char *name); |
1453 | extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); | 1451 | extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); |