diff mbox series

[ovs-dev,1/3] netdev: Allow storing dpif type into netdev structure.

Message ID 1594224636-42337-2-git-send-email-u9012063@gmail.com
State Accepted
Commit 48c1ab5d74ece8d2e6dd332bfebd3a7adce9414b
Headers show
Series Add VxLAN encap support for tc offload. | expand

Commit Message

William Tu July 8, 2020, 4:10 p.m. UTC
From: Ilya Maximets <i.maximets@ovn.org>

Storing of the dpif type of the owning datapath interface will allow
us to easily distinguish, for example, userspace tunneling ports from
the system ones.  This is required in terms of HW offloading to avoid
offloading of userspace flows to kernel interfaces that doesn't belong
to userspace datapath, but have same dpif_port names.

Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Acked-by: Eli Britstein <elibr@mellanox.com>
Acked-by: Roni Bar Yanai <roniba@mellanox.com>
Acked-by: Ophir Munk <ophirmu@mellanox.com>
Signed-off-by: Eli Britstein <elibr@mellanox.com>
Signed-off-by: William Tu <u9012063@gmail.com>
 lib/netdev-provider.h |  3 ++-
 lib/netdev.c          | 16 ++++++++++++++++
 lib/netdev.h          |  2 ++
 3 files changed, 20 insertions(+), 1 deletion(-)


0-day Robot July 8, 2020, 4:59 p.m. UTC | #1
Bleep bloop.  Greetings William Tu, I am a robot and I have tried out your patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.

WARNING: Unexpected sign-offs from developers who are not authors or co-authors or committers: Eli Britstein <elibr@mellanox.com>, William Tu <u9012063@gmail.com>
Lines checked: 80, Warnings: 1, Errors: 0

Please check this out.  If you feel there has been an error, please email aconole@redhat.com

0-day Robot
diff mbox series


diff --git a/lib/netdev-provider.h b/lib/netdev-provider.h
index d9503adb0fb6..73dce2fcab8d 100644
--- a/lib/netdev-provider.h
+++ b/lib/netdev-provider.h
@@ -96,7 +96,8 @@  struct netdev {
     /* Functions to control flow offloading. */
     OVSRCU_TYPE(const struct netdev_flow_api *) flow_api;
-    struct netdev_hw_info hw_info;	/* offload-capable netdev info */
+    const char *dpif_type;          /* Type of dpif this netdev belongs to. */
+    struct netdev_hw_info hw_info;  /* Offload-capable netdev info. */
 static inline void
diff --git a/lib/netdev.c b/lib/netdev.c
index 90962eec66cf..91e91955c09b 100644
--- a/lib/netdev.c
+++ b/lib/netdev.c
@@ -1984,6 +1984,22 @@  netdev_get_class(const struct netdev *netdev)
     return netdev->netdev_class;
+/* Set the type of 'dpif' this 'netdev' belongs to. */
+netdev_set_dpif_type(struct netdev *netdev, const char *type)
+    netdev->dpif_type = type;
+/* Returns the type of 'dpif' this 'netdev' belongs to.
+ *
+ * The caller must not free the returned value. */
+const char *
+netdev_get_dpif_type(const struct netdev *netdev)
+    return netdev->dpif_type;
 /* Returns the netdev with 'name' or NULL if there is none.
  * The caller must free the returned netdev with netdev_close(). */
diff --git a/lib/netdev.h b/lib/netdev.h
index fdbe0e1f58c5..fb50730569ea 100644
--- a/lib/netdev.h
+++ b/lib/netdev.h
@@ -179,6 +179,8 @@  bool netdev_mtu_is_user_config(struct netdev *);
 int netdev_get_ifindex(const struct netdev *);
 int netdev_set_tx_multiq(struct netdev *, unsigned int n_txq);
 enum netdev_pt_mode netdev_get_pt_mode(const struct netdev *);
+void netdev_set_dpif_type(struct netdev *, const char *);
+const char *netdev_get_dpif_type(const struct netdev *);
 /* Packet reception. */
 int netdev_rxq_open(struct netdev *, struct netdev_rxq **, int id);