net/enic: reset VXLAN port during initialization
authorHyong Youb Kim <hyonkim@cisco.com>
Tue, 31 Jul 2018 21:26:13 +0000 (14:26 -0700)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 2 Aug 2018 08:34:04 +0000 (10:34 +0200)
The NIC persists the vxlan port number across vNIC init/de-init
(e.g. restart testpmd). So, explicitly reset the setting to the
default value (4789) as part of the initialization.

Fixes: 8a4efd17410c ("net/enic: add handlers to add/delete vxlan port number")

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
drivers/net/enic/enic_main.c

index d9ce602..fd940c5 100644 (file)
@@ -1663,6 +1663,16 @@ static int enic_dev_init(struct enic *enic)
                enic->overlay_offload = true;
                enic->vxlan_port = ENIC_DEFAULT_VXLAN_PORT;
                dev_info(enic, "Overlay offload is enabled\n");
+               /*
+                * Reset the vxlan port to the default, as the NIC firmware
+                * does not reset it automatically and keeps the old setting.
+                */
+               if (vnic_dev_overlay_offload_cfg(enic->vdev,
+                                                OVERLAY_CFG_VXLAN_PORT_UPDATE,
+                                                ENIC_DEFAULT_VXLAN_PORT)) {
+                       dev_err(enic, "failed to update vxlan port\n");
+                       return -EINVAL;
+               }
        }
 
        return 0;