pci: fix configure device fail issue
Subsystems (2)
PATCH 1/1 pci: fix configure device fail issue
If assign the "data->dev_flags" after run function "rte_eth_copy_pci_info", the flag would be miss the “RTE_ETH_DEV_INTR_LSC” value, that will result the device configuration fail, when rte check the flag if device support link state interrupt. So the assignment must be modified to "|=" to fix the issue.
--- drivers/net/bnxt/bnxt_ethdev.c | 3 ++- drivers/net/e1000/em_ethdev.c | 2 +- drivers/net/e1000/igb_ethdev.c | 4 ++-- drivers/net/fm10k/fm10k_ethdev.c | 2 +- drivers/net/i40e/i40e_ethdev.c | 2 +- drivers/net/i40e/i40e_ethdev_vf.c | 2 +- drivers/net/ixgbe/ixgbe_ethdev.c | 4 ++-- drivers/net/nfp/nfp_net.c | 2 +- drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +- 9 files changed, 12 insertions(+), 11 deletions(-)
drivers/net/bnxt/bnxt_ethdev.c +2 -1
@@ -1087,7 +1087,8 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)RTE_LOG (INFO ,PMD ,"%s" , bnxt_version);rte_eth_copy_pci_info (eth_dev, pci_dev); - eth_dev->data->dev_flags =RTE_ETH_DEV_DETACHABLE ; + eth_dev->data->dev_flags |=RTE_ETH_DEV_DETACHABLE ; + bp = eth_dev->data->dev_private;if (bnxt_vf_pciid (pci_dev->id.device_id))
drivers/net/e1000/em_ethdev.c +1 -1
@@ -339,7 +339,7 @@ eth_em_dev_init(struct rte_eth_dev *eth_dev) }rte_eth_copy_pci_info (eth_dev, pci_dev); - eth_dev->data->dev_flags =RTE_ETH_DEV_DETACHABLE ; + eth_dev->data->dev_flags |=RTE_ETH_DEV_DETACHABLE ; hw->hw_addr = (void *)pci_dev->mem_resource[0 ].addr; hw->device_id = pci_dev->id.device_id;
drivers/net/e1000/igb_ethdev.c +2 -2
@@ -777,7 +777,7 @@ eth_igb_dev_init(struct rte_eth_dev *eth_dev) }rte_eth_copy_pci_info (eth_dev, pci_dev); - eth_dev->data->dev_flags =RTE_ETH_DEV_DETACHABLE ; + eth_dev->data->dev_flags |=RTE_ETH_DEV_DETACHABLE ; hw->hw_addr= (void *)pci_dev->mem_resource[0 ].addr;
@@ -986,7 +986,7 @@ eth_igbvf_dev_init(struct rte_eth_dev *eth_dev) pci_dev =E1000_DEV_TO_PCI (eth_dev);rte_eth_copy_pci_info (eth_dev, pci_dev); - eth_dev->data->dev_flags =RTE_ETH_DEV_DETACHABLE ; + eth_dev->data->dev_flags |=RTE_ETH_DEV_DETACHABLE ; hw->device_id = pci_dev->id.device_id; hw->vendor_id = pci_dev->id.vendor_id;
drivers/net/fm10k/fm10k_ethdev.c +1 -1
@@ -2858,7 +2858,7 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev)return 0 ;rte_eth_copy_pci_info (dev, pdev); - dev->data->dev_flags =RTE_ETH_DEV_DETACHABLE ; + dev->data->dev_flags |=RTE_ETH_DEV_DETACHABLE ; macvlan =FM10K_DEV_PRIVATE_TO_MACVLAN (dev->data->dev_private);memset (macvlan,0 ,sizeof (*macvlan));
drivers/net/i40e/i40e_ethdev.c +1 -1
@@ -1045,7 +1045,7 @@ eth_i40e_dev_init(struct rte_eth_dev *dev) intr_handle = &pci_dev->intr_handle;rte_eth_copy_pci_info (dev, pci_dev); - dev->data->dev_flags =RTE_ETH_DEV_DETACHABLE ; + dev->data->dev_flags |=RTE_ETH_DEV_DETACHABLE ; pf->adapter =I40E_DEV_PRIVATE_TO_ADAPTER (dev->data->dev_private); pf->adapter->eth_dev = dev;
drivers/net/i40e/i40e_ethdev_vf.c +1 -1
@@ -1478,7 +1478,7 @@ i40evf_dev_init(struct rte_eth_dev *eth_dev) }rte_eth_copy_pci_info (eth_dev, pci_dev); - eth_dev->data->dev_flags =RTE_ETH_DEV_DETACHABLE ; + eth_dev->data->dev_flags |=RTE_ETH_DEV_DETACHABLE ; hw->vendor_id = pci_dev->id.vendor_id; hw->device_id = pci_dev->id.device_id;
drivers/net/ixgbe/ixgbe_ethdev.c +2 -2
@@ -1172,7 +1172,7 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev) }rte_eth_copy_pci_info (eth_dev, pci_dev); - eth_dev->data->dev_flags =RTE_ETH_DEV_DETACHABLE ; + eth_dev->data->dev_flags |=RTE_ETH_DEV_DETACHABLE ;/* Vendor and Device ID need to be set before init of shared code */ hw->device_id = pci_dev->id.device_id;
@@ -1626,7 +1626,7 @@ eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev) }rte_eth_copy_pci_info (eth_dev, pci_dev); - eth_dev->data->dev_flags =RTE_ETH_DEV_DETACHABLE ; + eth_dev->data->dev_flags |=RTE_ETH_DEV_DETACHABLE ; hw->device_id = pci_dev->id.device_id; hw->vendor_id = pci_dev->id.vendor_id;
drivers/net/nfp/nfp_net.c +1 -1
@@ -2465,7 +2465,7 @@ nfp_net_init(struct rte_eth_dev *eth_dev) pci_dev =RTE_DEV_TO_PCI (eth_dev->device);rte_eth_copy_pci_info (eth_dev, pci_dev); - eth_dev->data->dev_flags =RTE_ETH_DEV_DETACHABLE ; + eth_dev->data->dev_flags |=RTE_ETH_DEV_DETACHABLE ; hw->device_id = pci_dev->id.device_id; hw->vendor_id = pci_dev->id.vendor_id;
drivers/net/vmxnet3/vmxnet3_ethdev.c +1 -1
@@ -250,7 +250,7 @@ eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev)return 0 ;rte_eth_copy_pci_info (eth_dev, pci_dev); - eth_dev->data->dev_flags =RTE_ETH_DEV_DETACHABLE ; + eth_dev->data->dev_flags |=RTE_ETH_DEV_DETACHABLE ;/* Vendor and Device ID need to be set before init of shared code */ hw->device_id = pci_dev->id.device_id;
Signature · 1 line
2.7.4
Quoted 8 lines · Jeff Guo
If assign the "
data->dev_flags" after run function "rte_eth_copy_pci_info", the flag would be miss the “RTE_ETH_DEV_INTR_LSC” value, that will result the device configuration fail, when rte check the flag if device support link state interrupt. So the assignment must be modified to "|=" to fix the issue.Fixes 22dda618c00c ("pci: separate detaching ethernet ports from PCI devices")Signed-off-by Jeff Guo <[email protected]>
This is same as Qi's patch:
http://dpdk.org/dev/patchwork/patch/20163/
That one is earlier, but missing em driver, so I will use this patch with sign-off from both of you. Please shout if you disagree.
Thanks,
ferruh
Ferruh Yigit
AppliedQuoted 8 lines · Jeff Guo
If assign the "
data->dev_flags" after run function "rte_eth_copy_pci_info", the flag would be miss the “RTE_ETH_DEV_INTR_LSC” value, that will result the device configuration fail, when rte check the flag if device support link state interrupt. So the assignment must be modified to "|=" to fix the issue.Fixes 22dda618c00c ("pci: separate detaching ethernet ports from PCI devices")Signed-off-by Jeff Guo <[email protected]>
drivers/net: fix eth device configuration
PCI devices")
Applied to dpdk-next-net/master, thanks.