[ovs-dev] [PATCH net-next v15] openvswitch: enable NSH support

Yang, Yi yi.y.yang at intel.com
Thu Nov 2 02:50:38 UTC 2017


On Thu, Nov 02, 2017 at 08:52:40AM +0800, Pravin Shelar wrote:
> On Tue, Oct 31, 2017 at 9:03 PM, Yi Yang <yi.y.yang at intel.com> wrote:
> >
> > OVS master and 2.8 branch has merged NSH userspace
> > patch series, this patch is to enable NSH support
> > in kernel data path in order that OVS can support
> > NSH in compat mode by porting this.
> >
> > Signed-off-by: Yi Yang <yi.y.yang at intel.com>
> > ---
> I have comment related to checksum, otherwise patch looks good to me.

Pravin, thank you for your comments, the below part is incremental patch
for checksum, please help check it, I'll send out v16 with this after
you confirm.

diff --git a/net/nsh/nsh.c b/net/nsh/nsh.c
index 2764682..d7da99a 100644
--- a/net/nsh/nsh.c
+++ b/net/nsh/nsh.c
@@ -36,6 +36,7 @@ int nsh_push(struct sk_buff *skb, const struct nshhdr *pushed_nh)
 	nh = (struct nshhdr *)(skb->data);
 	memcpy(nh, pushed_nh, length);
 	nh->np = next_proto;
+	skb_postpush_rcsum(skb, nh, length);
 
 	skb->protocol = htons(ETH_P_NSH);
 	skb_reset_mac_header(skb);
@@ -63,7 +64,7 @@ int nsh_pop(struct sk_buff *skb)
 	if (!inner_proto)
 		return -EAFNOSUPPORT;
 
-	skb_pull(skb, length);
+	skb_pull_rcsum(skb, length);
 	skb_reset_mac_header(skb);
 	skb_reset_network_header(skb);
 	skb_reset_mac_len(skb);
diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
index dd1449d..5ba0e35 100644
--- a/net/openvswitch/actions.c
+++ b/net/openvswitch/actions.c
@@ -671,6 +671,7 @@ static int set_nsh(struct sk_buff *skb, struct sw_flow_key *flow_key,
 		return err;
 
 	nh = nsh_hdr(skb);
+	skb_postpull_rcsum(skb, nh, length);
 	flags = nsh_get_flags(nh);
 	flags = OVS_MASKED(flags, key.base.flags, mask.base.flags);
 	flow_key->nsh.base.flags = flags;
@@ -698,6 +699,7 @@ static int set_nsh(struct sk_buff *skb, struct sw_flow_key *flow_key,
 	default:
 		return -EINVAL;
 	}
+	skb_postpush_rcsum(skb, nh, length);
 	return 0;
 }
 


More information about the dev mailing list