]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - include/linux/netdevice.h
gro: Avoid copying headers of unmerged packets
[net-next-2.6.git] / include / linux / netdevice.h
index 20419508eec150c1e2420762e6c4d5b54da55043..7a5057fbb7cda79323996439848005a86a284606 100644 (file)
@@ -984,6 +984,9 @@ void netif_napi_add(struct net_device *dev, struct napi_struct *napi,
 void netif_napi_del(struct napi_struct *napi);
 
 struct napi_gro_cb {
+       /* This indicates where we are processing relative to skb->data. */
+       int data_offset;
+
        /* This is non-zero if the packet may be of the same flow. */
        int same_flow;
 
@@ -1087,6 +1090,29 @@ extern int               dev_restart(struct net_device *dev);
 #ifdef CONFIG_NETPOLL_TRAP
 extern int             netpoll_trap(void);
 #endif
+extern void          *skb_gro_header(struct sk_buff *skb, unsigned int hlen);
+extern int            skb_gro_receive(struct sk_buff **head,
+                                      struct sk_buff *skb);
+
+static inline unsigned int skb_gro_offset(const struct sk_buff *skb)
+{
+       return NAPI_GRO_CB(skb)->data_offset;
+}
+
+static inline unsigned int skb_gro_len(const struct sk_buff *skb)
+{
+       return skb->len - NAPI_GRO_CB(skb)->data_offset;
+}
+
+static inline void skb_gro_pull(struct sk_buff *skb, unsigned int len)
+{
+       NAPI_GRO_CB(skb)->data_offset += len;
+}
+
+static inline void skb_gro_reset_offset(struct sk_buff *skb)
+{
+       NAPI_GRO_CB(skb)->data_offset = 0;
+}
 
 static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev,
                                  unsigned short type,