@@ -555,7 +555,8 @@ static int vxlan_fdb_append(struct vxlan_fdb *f,
555555static struct vxlanhdr * vxlan_gro_remcsum (struct sk_buff * skb ,
556556 unsigned int off ,
557557 struct vxlanhdr * vh , size_t hdrlen ,
558- u32 data , struct gro_remcsum * grc )
558+ u32 data , struct gro_remcsum * grc ,
559+ bool nopartial )
559560{
560561 size_t start , offset , plen ;
561562
@@ -580,7 +581,7 @@ static struct vxlanhdr *vxlan_gro_remcsum(struct sk_buff *skb,
580581 }
581582
582583 skb_gro_remcsum_process (skb , (void * )vh + hdrlen ,
583- start , offset , grc , true );
584+ start , offset , grc , nopartial );
584585
585586 skb -> remcsum_offload = 1 ;
586587
@@ -618,7 +619,9 @@ static struct sk_buff **vxlan_gro_receive(struct sk_buff **head,
618619
619620 if ((flags & VXLAN_HF_RCO ) && (vs -> flags & VXLAN_F_REMCSUM_RX )) {
620621 vh = vxlan_gro_remcsum (skb , off_vx , vh , sizeof (struct vxlanhdr ),
621- ntohl (vh -> vx_vni ), & grc );
622+ ntohl (vh -> vx_vni ), & grc ,
623+ !!(vs -> flags &
624+ VXLAN_F_REMCSUM_NOPARTIAL ));
622625
623626 if (!vh )
624627 goto out ;
@@ -1155,7 +1158,7 @@ static void vxlan_igmp_leave(struct work_struct *work)
11551158}
11561159
11571160static struct vxlanhdr * vxlan_remcsum (struct sk_buff * skb , struct vxlanhdr * vh ,
1158- size_t hdrlen , u32 data )
1161+ size_t hdrlen , u32 data , bool nopartial )
11591162{
11601163 size_t start , offset , plen ;
11611164
@@ -1171,7 +1174,8 @@ static struct vxlanhdr *vxlan_remcsum(struct sk_buff *skb, struct vxlanhdr *vh,
11711174
11721175 vh = (struct vxlanhdr * )(udp_hdr (skb ) + 1 );
11731176
1174- skb_remcsum_process (skb , (void * )vh + hdrlen , start , offset , true);
1177+ skb_remcsum_process (skb , (void * )vh + hdrlen , start , offset ,
1178+ nopartial );
11751179
11761180 return vh ;
11771181}
@@ -1208,7 +1212,8 @@ static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
12081212 goto drop ;
12091213
12101214 if ((flags & VXLAN_HF_RCO ) && (vs -> flags & VXLAN_F_REMCSUM_RX )) {
1211- vxh = vxlan_remcsum (skb , vxh , sizeof (struct vxlanhdr ), vni );
1215+ vxh = vxlan_remcsum (skb , vxh , sizeof (struct vxlanhdr ), vni ,
1216+ !!(vs -> flags & VXLAN_F_REMCSUM_NOPARTIAL ));
12121217 if (!vxh )
12131218 goto drop ;
12141219
@@ -2437,6 +2442,7 @@ static const struct nla_policy vxlan_policy[IFLA_VXLAN_MAX + 1] = {
24372442 [IFLA_VXLAN_REMCSUM_TX ] = { .type = NLA_U8 },
24382443 [IFLA_VXLAN_REMCSUM_RX ] = { .type = NLA_U8 },
24392444 [IFLA_VXLAN_GBP ] = { .type = NLA_FLAG , },
2445+ [IFLA_VXLAN_REMCSUM_NOPARTIAL ] = { .type = NLA_FLAG },
24402446};
24412447
24422448static int vxlan_validate (struct nlattr * tb [], struct nlattr * data [])
@@ -2760,6 +2766,9 @@ static int vxlan_newlink(struct net *src_net, struct net_device *dev,
27602766 if (data [IFLA_VXLAN_GBP ])
27612767 vxlan -> flags |= VXLAN_F_GBP ;
27622768
2769+ if (data [IFLA_VXLAN_REMCSUM_NOPARTIAL ])
2770+ vxlan -> flags |= VXLAN_F_REMCSUM_NOPARTIAL ;
2771+
27632772 if (vxlan_find_vni (src_net , vni , use_ipv6 ? AF_INET6 : AF_INET ,
27642773 vxlan -> dst_port , vxlan -> flags )) {
27652774 pr_info ("duplicate VNI %u\n" , vni );
@@ -2909,6 +2918,10 @@ static int vxlan_fill_info(struct sk_buff *skb, const struct net_device *dev)
29092918 nla_put_flag (skb , IFLA_VXLAN_GBP ))
29102919 goto nla_put_failure ;
29112920
2921+ if (vxlan -> flags & VXLAN_F_REMCSUM_NOPARTIAL &&
2922+ nla_put_flag (skb , IFLA_VXLAN_REMCSUM_NOPARTIAL ))
2923+ goto nla_put_failure ;
2924+
29122925 return 0 ;
29132926
29142927nla_put_failure :
0 commit comments