From patchwork Thu Oct 31 05:36:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hyong Youb Kim (hyonkim)" X-Patchwork-Id: 62273 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9F6A2A00BE; Thu, 31 Oct 2019 06:36:59 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 758581C134; Thu, 31 Oct 2019 06:36:59 +0100 (CET) Received: from alln-iport-3.cisco.com (alln-iport-3.cisco.com [173.37.142.90]) by dpdk.org (Postfix) with ESMTP id B103B1BFF5 for ; Thu, 31 Oct 2019 06:36:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1031; q=dns/txt; s=iport; t=1572500218; x=1573709818; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JE0b3lxbXEDFUOtdV6aJd1oanWsc/IlPJUrqowixP84=; b=mFovR9ffZyjWzS4m+KfHciT7ikEstP9nNPyQ4ipezFxjIUACY81tzEJl 2nM/9uDwhwY/FpDqmlwenXZKi4Ys6vHehj0IGK4AMdJryhKbJ1r4GscE0 SX9Pl0QLmxmfMqBT8FJ7R5A1x6jYQ5MWBzsiCEjJqCoMefb3nWbGPWN/+ E=; X-IronPort-AV: E=Sophos;i="5.68,250,1569283200"; d="scan'208";a="368953552" Received: from alln-core-8.cisco.com ([173.36.13.141]) by alln-iport-3.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 31 Oct 2019 05:36:57 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by alln-core-8.cisco.com (8.15.2/8.15.2) with ESMTP id x9V5auns001731; Thu, 31 Oct 2019 05:36:56 GMT Received: by cisco.com (Postfix, from userid 508933) id A96B220F2003; Wed, 30 Oct 2019 22:36:56 -0700 (PDT) From: Hyong Youb Kim To: Ferruh Yigit Cc: dev@dpdk.org, John Daley , Hyong Youb Kim Date: Wed, 30 Oct 2019 22:36:22 -0700 Message-Id: <20191031053623.16185-3-hyonkim@cisco.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20191031053623.16185-1-hyonkim@cisco.com> References: <20191031053623.16185-1-hyonkim@cisco.com> MIME-Version: 1.0 X-Outbound-SMTP-Client: 10.193.184.48, savbu-usnic-a.cisco.com X-Outbound-Node: alln-core-8.cisco.com Subject: [dpdk-dev] [PATCH 2/3] net/enic: fix speed capabilities for the new VF 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" VFs all have subsystem ID 0. VIC models with the latest VF are at least 40G, so report that as a more reasonable speed than 10G. Fixes: 57bb45b37bdf ("net/enic: add PCI id for new virtual function") Signed-off-by: Hyong Youb Kim Reviewed-by: John Daley --- drivers/net/enic/enic_ethdev.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c index 12c59a3c5..8ad976d3c 100644 --- a/drivers/net/enic/enic_ethdev.c +++ b/drivers/net/enic/enic_ethdev.c @@ -507,6 +507,12 @@ static uint32_t speed_capa_from_pci_id(struct rte_eth_dev *eth_dev) /* 1300 and later models are at least 40G */ if (id >= 0x0100) return ETH_LINK_SPEED_40G; + /* VFs have subsystem id 0, check device id */ + if (id == 0) { + /* Newer VF implies at least 40G model */ + if (pdev->id.device_id == PCI_DEVICE_ID_CISCO_VIC_ENET_SN) + return ETH_LINK_SPEED_40G; + } return ETH_LINK_SPEED_10G; }