]> git.proxmox.com Git - ovs.git/commitdiff
datapath: nsh: add GSO support
authorYi Yang <yi.y.yang@intel.com>
Wed, 31 Jan 2018 13:53:05 +0000 (21:53 +0800)
committerBen Pfaff <blp@ovn.org>
Thu, 8 Feb 2018 16:49:28 +0000 (08:49 -0800)
Upstream commit:
  commit c411ed854584a71b0e86ac3019b60e4789d88086
  Author: Jiri Benc <jbenc@redhat.com>
  Date:   Mon Aug 28 21:43:24 2017 +0200

    nsh: add GSO support

    Add a new nsh/ directory. It currently holds only GSO functions but more
    will come: in particular, code shared by openvswitch and tc to manipulate
    NSH headers.

    For now, assume there's no hardware support for NSH segmentation. We can
    always introduce netdev->nsh_features later.

Signed-off-by: Jiri Benc <jbenc@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Yi Yang <yi.y.yang@intel.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
datapath/Modules.mk
datapath/datapath.c
datapath/linux/compat/include/net/nsh.h

index 21f04a0ea82dc872423312ed902a63c88c81d109..3643da4aee72a414666a4c0685502bff5d7af167 100644 (file)
@@ -26,13 +26,15 @@ openvswitch_sources = \
        flow_table.c \
        vport.c \
        vport-internal_dev.c \
-       vport-netdev.c
+       vport-netdev.c \
+       nsh.c
 
 vport_geneve_sources = vport-geneve.c
 vport_vxlan_sources = vport-vxlan.c
 vport_gre_sources = vport-gre.c
 vport_lisp_sources = vport-lisp.c
 vport_stt_sources = vport-stt.c
+nsh_sources = nsh.c
 
 openvswitch_headers = \
        compat.h \
index 178081993b42877a5d6927c8bac89d78e89c13d9..4272227d16079b7bd1543bb504c5f85dc49e5d93 100644 (file)
@@ -51,6 +51,7 @@
 #include <net/genetlink.h>
 #include <net/net_namespace.h>
 #include <net/netns/generic.h>
+#include <net/nsh.h>
 
 #include "datapath.h"
 #include "conntrack.h"
@@ -2408,6 +2409,7 @@ static int __init dp_init(void)
 
        pr_info("Open vSwitch switching datapath %s\n", VERSION);
 
+       ovs_nsh_init();
        err = action_fifos_init();
        if (err)
                goto error;
@@ -2463,6 +2465,7 @@ error_unreg_rtnl_link:
 error_action_fifos_exit:
        action_fifos_exit();
 error:
+       ovs_nsh_cleanup();
        return err;
 }
 
@@ -2478,6 +2481,7 @@ static void dp_cleanup(void)
        ovs_flow_exit();
        ovs_internal_dev_rtnl_link_unregister();
        action_fifos_exit();
+       ovs_nsh_cleanup();
 }
 
 module_init(dp_init);
index a1eaea20be966bc30cd4aa778b905fef7a9dac1a..c9c30e09c4ccad695827345f7396b1cb9bd52d33 100644 (file)
@@ -304,4 +304,7 @@ static inline void nsh_set_flags_ttl_len(struct nshhdr *nsh, u8 flags,
                        NSH_FLAGS_MASK | NSH_TTL_MASK | NSH_LEN_MASK);
 }
 
+int ovs_nsh_init(void);
+void ovs_nsh_cleanup(void);
+
 #endif /* __NET_NSH_H */