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

Yang, Yi yi.y.yang at intel.com
Fri Oct 20 11:34:40 UTC 2017


On Fri, Oct 20, 2017 at 04:05:35PM +0800, Jiri Benc wrote:
> On Fri, 20 Oct 2017 05:53:12 +0800, Yang, Yi wrote:
> > For push_nsh, my typical use scinario is push_nsh then set then output
> > to vxlangpe port.
> 
> Okay.

Then I just need to do the below change against v12.

diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
index 1ab3c51..a3a663c 100644
--- a/net/openvswitch/actions.c
+++ b/net/openvswitch/actions.c
@@ -658,10 +658,8 @@ static int set_nsh(struct sk_buff *skb, struct
sw_flow_key *flow_key,
                return err;

        /* Make sure the NSH base header is there */
-       err = skb_ensure_writable(skb, skb_network_offset(skb) +
-                                      NSH_BASE_HDR_LEN);
-       if (unlikely(err))
-               return err;
+       if (!pskb_may_pull(skb, NSH_BASE_HDR_LEN))
+               return -ENOMEM;

        nh = nsh_hdr(skb);
        length = nsh_hdr_len(nh);

I'll send out v13 with this if you're ok.

> 
>  Jiri


More information about the dev mailing list