summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViacheslav Ovsiienko <viacheslavo@mellanox.com>2019-09-25 07:53:24 +0000
committerFerruh Yigit <ferruh.yigit@intel.com>2019-10-07 15:00:58 +0200
commit46e10a4c1b87f08316702d2a43301199858f0597 (patch)
tree4d41d37edded49be24439796090028ac5bd7e8af
parentfd88e7401230a4eb6208c9a07540bf9d13c76691 (diff)
downloaddpdk-next-eventdev-46e10a4c1b87f08316702d2a43301199858f0597.zip
dpdk-next-eventdev-46e10a4c1b87f08316702d2a43301199858f0597.tar.gz
dpdk-next-eventdev-46e10a4c1b87f08316702d2a43301199858f0597.tar.xz
net/mlx5: move backing PCI device to private context
Now all devices created over the same multiport IB device have shared context containing the backing PCI device field. For the VF LAG configurations it becomes possible the representors might be connected to VF created over different PFs. In this case representors have the different backing PCI devices and mentioned field should be moved to device private area. Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com> Acked-by: Matan Azrad <matan@mellanox.com>
-rw-r--r--drivers/net/mlx5/mlx5.c4
-rw-r--r--drivers/net/mlx5/mlx5.h2
-rw-r--r--drivers/net/mlx5/mlx5_txq.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 4599cd9..c33e49d 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -372,7 +372,6 @@ mlx5_alloc_shared_ibctx(const struct mlx5_dev_spawn_data *spawn)
sizeof(sh->ibdev_name));
strncpy(sh->ibdev_path, sh->ctx->device->ibdev_path,
sizeof(sh->ibdev_path));
- sh->pci_dev = spawn->pci_dev;
pthread_mutex_init(&sh->intr_mutex, NULL);
/*
* Setting port_id to max unallowed value means
@@ -405,7 +404,7 @@ mlx5_alloc_shared_ibctx(const struct mlx5_dev_spawn_data *spawn)
*/
err = mlx5_mr_btree_init(&sh->mr.cache,
MLX5_MR_BTREE_CACHE_N * 2,
- sh->pci_dev->device.numa_node);
+ spawn->pci_dev->device.numa_node);
if (err) {
err = rte_errno;
goto error;
@@ -1755,6 +1754,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
}
priv->sh = sh;
priv->ibv_port = spawn->ibv_port;
+ priv->pci_dev = spawn->pci_dev;
priv->mtu = RTE_ETHER_MTU;
#ifndef RTE_ARCH_64
/* Initialize UAR access locks for 32bit implementations. */
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index acd43f8..ba27421 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -547,7 +547,6 @@ struct mlx5_ibv_shared {
char ibdev_name[IBV_SYSFS_NAME_MAX]; /* IB device name. */
char ibdev_path[IBV_SYSFS_PATH_MAX]; /* IB device path for secondary */
struct ibv_device_attr_ex device_attr; /* Device properties. */
- struct rte_pci_device *pci_dev; /* Backend PCI device. */
LIST_ENTRY(mlx5_ibv_shared) mem_event_cb;
/**< Called by memory event callback. */
struct {
@@ -606,6 +605,7 @@ struct mlx5_priv {
struct rte_eth_dev_data *dev_data; /* Pointer to device data. */
struct mlx5_ibv_shared *sh; /* Shared IB device context. */
uint32_t ibv_port; /* IB device port number. */
+ struct rte_pci_device *pci_dev; /* Backend PCI device. */
struct rte_ether_addr mac[MLX5_MAX_MAC_ADDRESSES]; /* MAC addresses. */
BITFIELD_DECLARE(mac_own, uint64_t, MLX5_MAX_MAC_ADDRESSES);
/* Bit-field of MAC addresses owned by the PMD. */
diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
index 2b7d6c0..d9fd143 100644
--- a/drivers/net/mlx5/mlx5_txq.c
+++ b/drivers/net/mlx5/mlx5_txq.c
@@ -728,7 +728,7 @@ txq_set_params(struct mlx5_txq_ctrl *txq_ctrl)
if (config->txqs_inline == MLX5_ARG_UNSET)
txqs_inline =
#if defined(RTE_ARCH_ARM64)
- (priv->sh->pci_dev->id.device_id ==
+ (priv->pci_dev->id.device_id ==
PCI_DEVICE_ID_MELLANOX_CONNECTX5BF) ?
MLX5_INLINE_MAX_TXQS_BLUEFIELD :
#endif