net/bonding: fix PCI address comparison on non-PCI ports
authorGaetan Rivet <grive@u256.net>
Fri, 17 Apr 2020 16:42:07 +0000 (18:42 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 8 Jan 2021 15:03:05 +0000 (16:03 +0100)
commit3b37cc0c28f3d01ced424e72641aa63f494899b1
tree56514a252f64e016e22d151edacb8a5cc72b0358
parentddb0384346be3e1a0f0f478831b3c5f4adc20be9
net/bonding: fix PCI address comparison on non-PCI ports

The bonding PMD will iterate over all available ETH ports and for each,
compare a chunk of bytes at an offset that would correspond to the PCI
address in an rte_pci_device.

This is incorrect and unsafe. Also, the rte_device using this PCI
address is already found, no need to compare again the PCI address of
all eth devices.

Refactoring the code to fix this, the initial check to find the PCI bus
is out of scope.

Fixes: c848b518bbc7 ("net/bonding: support bifurcated driver in eal")
Cc: stable@dpdk.org
Signed-off-by: Gaetan Rivet <grive@u256.net>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
drivers/net/bonding/rte_eth_bond_args.c