From patchwork Tue Jul 31 21:26:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "John Daley (johndale)" X-Patchwork-Id: 43485 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1DA034C8C; Tue, 31 Jul 2018 23:26:18 +0200 (CEST) Received: from alln-iport-4.cisco.com (alln-iport-4.cisco.com [173.37.142.91]) by dpdk.org (Postfix) with ESMTP id 5F53D493D for ; Tue, 31 Jul 2018 23:26:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1286; q=dns/txt; s=iport; t=1533072377; x=1534281977; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=OuToJiRivspmQ7ijUIySrbMWjq3R08VlsZTyVr8c3js=; b=T11SLhHn1rlhN0/VkeyPVxS2PYP/gxXR6WR3t6916TuuJF6uHG/mom0T /w+1tKiwbyg2wJPQs6XqQs1hTB4z9DVVXBPYn8Rp0CirkUvSpnky5KmZt /aHvzxxXxSDJ71aqfhWhnZCmcnyVYxr5eMPRDCJVIJa27Dn3RycKqKQFz g=; X-IronPort-AV: E=Sophos;i="5.51,429,1526342400"; d="scan'208";a="151072940" Received: from rcdn-core-12.cisco.com ([173.37.93.148]) by alln-iport-4.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Jul 2018 21:26:16 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by rcdn-core-12.cisco.com (8.15.2/8.15.2) with ESMTP id w6VLQGx2004191; Tue, 31 Jul 2018 21:26:16 GMT Received: by cisco.com (Postfix, from userid 392789) id 1DA3120F2001; Tue, 31 Jul 2018 14:26:16 -0700 (PDT) From: John Daley To: ferruh.yigit@intel.com Cc: dev@dpdk.org, Hyong Youb Kim Date: Tue, 31 Jul 2018 14:26:13 -0700 Message-Id: <20180731212613.27109-1-johndale@cisco.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180731211312.7299-1-johndale@cisco.com> References: <20180731211312.7299-1-johndale@cisco.com> X-Outbound-SMTP-Client: 10.193.184.48, savbu-usnic-a.cisco.com X-Outbound-Node: rcdn-core-12.cisco.com Subject: [dpdk-dev] [PATCH v2] 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- v2: fix signoff 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;