[ovs-dev] [PATCH 1/1] vswitchd: Allow setting MAC on DPDK interfaces

Eveline Raine eveliner at mellanox.com
Mon Dec 23 21:34:33 UTC 2019


When setting mac address for an interface using ovs-vsctl command:

    ovs-vsctl set interface <iface> mac=XX:XX:XX:XX:XX:XX

iface_set_mac() is responsible to delegate a request to set MAC to a
netdev-specific set_etheraddr().

At the moment iface_set_mac() skips all interfaces except those with
type = "internal", making it impossible to change MAC on any DPDK port.
Since DPDK ports are owned by the OVS process, OVSDB can be considered
the source of truth for them. In particular, the source of truth for
their MAC addresses - so, OVS can take responsibility for setting them.

Therefore this check is extended to "dpdk" type.

Acked-by: Roni Bar Yanai <roniba at mellanox.com>
Tested-by: Adrian Chiris <adrianc at mellanox.com>
Signed-off-by: Eveline Raine <eveliner at mellanox.com>
---
 vswitchd/bridge.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index 5de0a264a..355364afd 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -4696,7 +4696,7 @@ iface_set_mac(const struct bridge *br, const struct port *port, struct iface *if
     struct eth_addr ea, *mac = NULL;
     struct iface *hw_addr_iface;
 
-    if (strcmp(iface->type, "internal")) {
+    if (strcmp(iface->type, "internal") && strcmp(iface->type, "dpdk")) {
         return;
     }
 
-- 
2.23.0



More information about the dev mailing list