diff mbox series

[ovs-dev] netdev-dpdk: Fix set MAC error.

Message ID 20230423070836.1105044-1-wanghanlin@corp.netease.com
State Changes Requested
Headers show
Series [ovs-dev] netdev-dpdk: Fix set MAC error. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test fail github build: failed
ovsrobot/intel-ovs-compilation success test: success

Commit Message

汪翰林 April 23, 2023, 7:08 a.m. UTC
If requested_hwaddr is not set, then MAC will be resumed
after netdev_dpdk_reconfigure is called, such as we set
options of dpdk-vlan-start.

Signed-off-by: wanghanlin <wanghanlin@corp.netease.com>
---
 lib/netdev-dpdk.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Ilya Maximets April 24, 2023, 7:34 p.m. UTC | #1
On 4/23/23 09:08, wanghanlin wrote:
> If requested_hwaddr is not set, then MAC will be resumed
> after netdev_dpdk_reconfigure is called, such as we set
> options of dpdk-vlan-start.
> 
> Signed-off-by: wanghanlin <wanghanlin@corp.netease.com>
> ---
>  lib/netdev-dpdk.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
> index fb0dd43f7..a67be06ab 100644
> --- a/lib/netdev-dpdk.c
> +++ b/lib/netdev-dpdk.c
> @@ -2830,6 +2830,7 @@ netdev_dpdk_set_etheraddr__(struct netdev_dpdk *dev, const struct eth_addr mac)
>      }
>      if (!err) {
>          dev->hwaddr = mac;
> +        dev->requested_hwaddr = mac;
>      } else {
>          VLOG_WARN("%s: Failed to set requested mac("ETH_ADDR_FMT"): %s",
>                    netdev_get_name(&dev->up), ETH_ADDR_ARGS(mac),

Hi.  The 'requested_hwaddr' configuration is only supposed to be used for
'dpdk-vf-mac' configuration.  And the netdev_dpdk_reconfigure() already
sets it to dev->hwaddr on success of netdev_dpdk_set_etheraddr__().

The only issue might be if you managed to get netdev_dpdk_set_etheraddr()
called.  And that should not happen because netdev_set_ereraddr() is only
used for 'internal' ports.

I'm assuming you're running OVS with some custom changes?

In any case, 'requested_hwaddr' field should not be re-used for normal
MAC address configuration for the port.  It's only for the VF MAC address.

Best regards, Ilya Maximets.
diff mbox series

Patch

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index fb0dd43f7..a67be06ab 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -2830,6 +2830,7 @@  netdev_dpdk_set_etheraddr__(struct netdev_dpdk *dev, const struct eth_addr mac)
     }
     if (!err) {
         dev->hwaddr = mac;
+        dev->requested_hwaddr = mac;
     } else {
         VLOG_WARN("%s: Failed to set requested mac("ETH_ADDR_FMT"): %s",
                   netdev_get_name(&dev->up), ETH_ADDR_ARGS(mac),