summaryrefslogtreecommitdiff
path: root/lib/netdev.c
diff options
context:
space:
mode:
authorIlya Maximets <i.maximets@ovn.org>2020-07-08 06:38:28 +0000
committerIlya Maximets <i.maximets@ovn.org>2020-07-08 19:07:21 +0200
commit48c1ab5d74ece8d2e6dd332bfebd3a7adce9414b (patch)
treee74cbbfc1afc0df898190515a965291143b6279d /lib/netdev.c
parentb6207b1d2711933cb4c4f03d6ac91f4a7da71912 (diff)
downloadopenvswitch-48c1ab5d74ece8d2e6dd332bfebd3a7adce9414b.tar.gz
netdev: Allow storing dpif type into netdev structure.
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. 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: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'lib/netdev.c')
-rw-r--r--lib/netdev.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/netdev.c b/lib/netdev.c
index 90962eec6..91e91955c 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. */
+void
+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(). */