Skip to content

Commit ce4eee5

Browse files
gurmichaelLeon Romanovsky
authored andcommitted
net/mlx5: Add pci AtomicOps request
Calling pci_enable_atomic_ops_to_root enables AtomicOp requests to pci root port. AtomicOp requests will be enabled only if the completer and all intermediate pci bridges support PCI atomic operations. This, together with appropriate settings in the NVCONFIG should enable PCI atomic operations on the device. PCI atomic operations were first introduced in PCI Express Base Specification 2.1. The Supported operations are Swap (Unconditional Swap), CAS (Compare and Swap) and FetchAdd (Fetch and Add). Unlike other atomic operation modes PCI atomic operations gives the user the option to do atomic operations on local memory, without involving verbs api, without it compromising the operation's atomicity. Signed-off-by: Michael Guralnik <michaelgur@mellanox.com> Reviewed-by: Majd Dibbiny <majd@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
1 parent e355477 commit ce4eee5

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • drivers/net/ethernet/mellanox/mlx5/core

‎drivers/net/ethernet/mellanox/mlx5/core/main.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,11 @@ static int mlx5_pci_init(struct mlx5_core_dev *dev, struct mlx5_priv *priv)
693693
goto err_clr_master;
694694
}
695695

696+
if (pci_enable_atomic_ops_to_root(pdev, PCI_EXP_DEVCAP2_ATOMIC_COMP32) &&
697+
pci_enable_atomic_ops_to_root(pdev, PCI_EXP_DEVCAP2_ATOMIC_COMP64) &&
698+
pci_enable_atomic_ops_to_root(pdev, PCI_EXP_DEVCAP2_ATOMIC_COMP128))
699+
mlx5_core_dbg(dev, "Enabling pci atomics failed\n");
700+
696701
dev->iseg_base = pci_resource_start(dev->pdev, 0);
697702
dev->iseg = ioremap(dev->iseg_base, sizeof(*dev->iseg));
698703
if (!dev->iseg) {

0 commit comments

Comments
 (0)