[dpdk-dev,v2,1/8] net/qede: fix to get vendor/device id info

Message ID 1482454204-21707-1-git-send-email-Rasesh.Mody@cavium.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel compilation success Compilation OK

Commit Message

Mody, Rasesh Dec. 23, 2016, 12:49 a.m. UTC
  The vendor_id and device_id are used to determine device type. If you
don't have them, then check for determining device type fails and is
always set to default device type.

Fixes: ec94dbc57362 ("qede: add base driver")

Signed-off-by: Rasesh Mody <Rasesh.Mody@cavium.com>
---
 drivers/net/qede/qede_ethdev.c |    4 ++++
 1 file changed, 4 insertions(+)
  

Comments

Ferruh Yigit Dec. 23, 2016, 3:26 p.m. UTC | #1
On 12/23/2016 12:49 AM, Rasesh Mody wrote:
> The vendor_id and device_id are used to determine device type. If you
> don't have them, then check for determining device type fails and is
> always set to default device type.
> 
> Fixes: ec94dbc57362 ("qede: add base driver")
> 
> Signed-off-by: Rasesh Mody <Rasesh.Mody@cavium.com>

Series applied to dpdk-next-net/master, thanks.
  

Patch

diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index 2c600c1..4943358 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -1422,6 +1422,10 @@  static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
 
 	rte_eth_copy_pci_info(eth_dev, pci_dev);
 
+	/* @DPDK */
+	edev->vendor_id = pci_dev->id.vendor_id;
+	edev->device_id = pci_dev->id.device_id;
+
 	qed_ops = qed_get_eth_ops();
 	if (!qed_ops) {
 		DP_ERR(edev, "Failed to get qed_eth_ops_pass\n");