From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from alln-iport-4.cisco.com (alln-iport-4.cisco.com [173.37.142.91]) by dpdk.org (Postfix) with ESMTP id 42BBB44C3 for ; Tue, 31 Jul 2018 23:13:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1264; q=dns/txt; s=iport; t=1533071597; x=1534281197; h=from:to:cc:subject:date:message-id; bh=jzwig8xOcw7PRyivxqQXsoeUQcTTqgKbDa8cBY3owzw=; b=ieyPq/tapIor31EmTpbDvJnVAtbTIu3L58657+iAJcMvFCHLAiXIeH8x 8G5qAsssKkRzetyq3HGy2lraTIanaaS/RO3p7Pijz6uOagmF0v2L5u3SB Dwg5A/zirj/Cllie8ifM17VLNHmdX1gQ4jkoZASi4PMfIncu1AeBa9LzQ s=; X-IronPort-AV: E=Sophos;i="5.51,429,1526342400"; d="scan'208";a="151068717" Received: from rcdn-core-7.cisco.com ([173.37.93.143]) by alln-iport-4.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Jul 2018 21:13:16 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by rcdn-core-7.cisco.com (8.15.2/8.15.2) with ESMTP id w6VLDFOo005979; Tue, 31 Jul 2018 21:13:15 GMT Received: by cisco.com (Postfix, from userid 392789) id B6F9E20F2001; Tue, 31 Jul 2018 14:13:15 -0700 (PDT) From: John Daley To: ferruh.yigit@intel.com Cc: dev@dpdk.org, Hyong Youb Kim Date: Tue, 31 Jul 2018 14:13:12 -0700 Message-Id: <20180731211312.7299-1-johndale@cisco.com> X-Mailer: git-send-email 2.16.2 X-Outbound-SMTP-Client: 10.193.184.48, savbu-usnic-a.cisco.com X-Outbound-Node: rcdn-core-7.cisco.com Subject: [dpdk-dev] [PATCH] net/enic: reset the vxlan port during vNIC initialization X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jul 2018 21:13:17 -0000 From: Hyong Youb Kim 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 Reviewed-by: John Daley johndale@cisco.com> --- drivers/net/enic/enic_main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index f04dc0878..03bde76b2 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -1664,6 +1664,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; -- 2.16.2