]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - include/linux/netdevice.h
udp: Set SKB_GSO_UDP_TUNNEL* in UDP GRO path
[mirror_ubuntu-artful-kernel.git] / include / linux / netdevice.h
index d115256ed5a209fe28ce971bdbde7ca421d048aa..9e9be221e4bfde6532ac1c0f15ac5d32a52e5912 100644 (file)
@@ -2246,7 +2246,9 @@ static inline bool __skb_gro_checksum_validate_needed(struct sk_buff *skb,
                                                      bool zero_okay,
                                                      __sum16 check)
 {
-       return (skb->ip_summed != CHECKSUM_PARTIAL &&
+       return ((skb->ip_summed != CHECKSUM_PARTIAL ||
+               skb_checksum_start_offset(skb) <
+                skb_gro_offset(skb)) &&
                NAPI_GRO_CB(skb)->csum_cnt == 0 &&
                (!zero_okay || check));
 }
@@ -2321,8 +2323,19 @@ do {                                                                     \
                                           compute_pseudo(skb, proto)); \
 } while (0)
 
+struct gro_remcsum {
+       int offset;
+       __wsum delta;
+};
+
+static inline void skb_gro_remcsum_init(struct gro_remcsum *grc)
+{
+       grc->delta = 0;
+}
+
 static inline void skb_gro_remcsum_process(struct sk_buff *skb, void *ptr,
-                                          int start, int offset)
+                                          int start, int offset,
+                                          struct gro_remcsum *grc)
 {
        __wsum delta;
 
@@ -2331,10 +2344,20 @@ static inline void skb_gro_remcsum_process(struct sk_buff *skb, void *ptr,
        delta = remcsum_adjust(ptr, NAPI_GRO_CB(skb)->csum, start, offset);
 
        /* Adjust skb->csum since we changed the packet */
-       skb->csum = csum_add(skb->csum, delta);
        NAPI_GRO_CB(skb)->csum = csum_add(NAPI_GRO_CB(skb)->csum, delta);
+
+       grc->offset = (ptr + offset) - (void *)skb->head;
+       grc->delta = delta;
 }
 
+static inline void skb_gro_remcsum_cleanup(struct sk_buff *skb,
+                                          struct gro_remcsum *grc)
+{
+       if (!grc->delta)
+               return;
+
+       remcsum_unadjust((__sum16 *)(skb->head + grc->offset), grc->delta);
+}
 
 static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev,
                                  unsigned short type,