summaryrefslogtreecommitdiff
path: root/drivers/net/enic
diff options
context:
space:
mode:
authorHyong Youb Kim <hyonkim@cisco.com>2018-07-31 14:26:13 -0700
committerThomas Monjalon <thomas@monjalon.net>2018-08-02 10:34:04 +0200
commit0caa07034a3f23c9134e7aae5d5f077814b5825a (patch)
treefbc75f788de064fcaf9ffc39942c2d82c6362e45 /drivers/net/enic
parentd16623dd393de3788abd619b80c20d2bbfffb4d4 (diff)
downloaddpdk-next-eventdev-0caa07034a3f23c9134e7aae5d5f077814b5825a.zip
dpdk-next-eventdev-0caa07034a3f23c9134e7aae5d5f077814b5825a.tar.gz
dpdk-next-eventdev-0caa07034a3f23c9134e7aae5d5f077814b5825a.tar.xz
net/enic: reset VXLAN port during initialization
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>
Diffstat (limited to 'drivers/net/enic')
-rw-r--r--drivers/net/enic/enic_main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index d9ce602..fd940c5 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -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;