A future patch will make use of this during flow xlate
processing to create new flows for forwarding directly
to sockets.  For now, this configuration option does
nothing.

Signed-off-by: Aaron Conole <[email protected]>
---
 NEWS              |  3 +++
 vswitchd/bridge.c | 14 ++++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/NEWS b/NEWS
index 219c4a9161..4eae154345 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,9 @@ Post-v3.6.0
    - Netlink:
      * Introduce a new appctl command 'netdev/lookup-v4-sock' that will
        attempt to look up a socket inode and netns details.
+   - Linux datapath:
+     * Add the 'socket-offload' option to interfaces to enable lookups
+       of sockets for direct packet forwarding in the netlink datapath.
 
 
 v3.6.0 - 18 Aug 2025
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index 456b784c01..6a80b9751c 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -1068,6 +1068,18 @@ iface_set_netdev_mtu(const struct ovsrec_interface 
*iface_cfg,
     return 0;
 }
 
+/* Configures the socket-offload of 'netdev' based on the
+ * "other_config:socket-offload" column in 'iface_cfg'. */
+static int
+iface_set_netdev_socket_offload(const struct ovsrec_interface *iface_cfg,
+                                struct netdev *netdev)
+{
+    bool s = smap_get_bool(&iface_cfg->other_config, "socket-offload",
+                           false);
+    int error = netdev_set_socket_lookup_enabled(netdev, s);
+    return error;
+}
+
 static void
 bridge_delete_or_reconfigure_ports(struct bridge *br)
 {
@@ -1125,6 +1137,7 @@ bridge_delete_or_reconfigure_ports(struct bridge *br)
         }
 
         iface_set_netdev_mtu(iface->cfg, iface->netdev);
+        iface_set_netdev_socket_offload(iface->cfg, iface->netdev);
 
         /* If the requested OpenFlow port for 'iface' changed, and it's not
          * already the correct port, then we might want to temporarily delete
@@ -2198,6 +2211,7 @@ iface_do_create(const struct bridge *br,
     }
 
     iface_set_netdev_mtu(iface_cfg, netdev);
+    iface_set_netdev_socket_offload(iface_cfg, netdev);
 
     *ofp_portp = iface_pick_ofport(iface_cfg);
     error = ofproto_port_add(br->ofproto, netdev, ofp_portp);
-- 
2.51.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to