From: Saeed Mahameed <saeedm@mellanox.com>
To: Leon Romanovsky <leonro@mellanox.com>, saeedm@mellanox.com
Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
Jason Gunthorpe <jgg@mellanox.com>,
Michael Guralnik <michaelgur@mellanox.com>,
Majd Dibbiny <majd@mellanox.com>
Subject: [PATCH mlx5-next 2/4] net/mlx5: Add pci AtomicOps request
Date: Fri, 18 Jan 2019 16:33:11 -0800 [thread overview]
Message-ID: <20190119003313.16711-3-saeedm@mellanox.com> (raw)
In-Reply-To: <20190119003313.16711-1-saeedm@mellanox.com>
From: Michael Guralnik <michaelgur@mellanox.com>
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>
---
drivers/net/ethernet/mellanox/mlx5/core/main.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index be81b319b0dc..085e1133b8d5 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -693,6 +693,11 @@ static int mlx5_pci_init(struct mlx5_core_dev *dev, struct mlx5_priv *priv)
goto err_clr_master;
}
+ if (pci_enable_atomic_ops_to_root(pdev, PCI_EXP_DEVCAP2_ATOMIC_COMP32) &&
+ pci_enable_atomic_ops_to_root(pdev, PCI_EXP_DEVCAP2_ATOMIC_COMP64) &&
+ pci_enable_atomic_ops_to_root(pdev, PCI_EXP_DEVCAP2_ATOMIC_COMP128))
+ mlx5_core_dbg(dev, "Enabling pci atomics failed\n");
+
dev->iseg_base = pci_resource_start(dev->pdev, 0);
dev->iseg = ioremap(dev->iseg_base, sizeof(*dev->iseg));
if (!dev->iseg) {
--
2.20.1
next prev parent reply other threads:[~2019-01-19 0:33 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-19 0:33 [PATCH mlx5-next 0/4] mlx5 next misc updates Saeed Mahameed
2019-01-19 0:33 ` [PATCH mlx5-next 1/4] net/mlx5: Make mlx5_cmd_exec_cb() a safe API Saeed Mahameed
2019-01-19 0:33 ` Saeed Mahameed [this message]
2019-01-19 0:33 ` [PATCH mlx5-next 3/4] net/mlx5: Remove unused MLX5_*_DOORBELL_LOCK macros Saeed Mahameed
2019-01-19 0:33 ` [PATCH mlx5-next 4/4] net/mlx5: Remove spinlock support from mlx5_write64 Saeed Mahameed
2019-01-19 7:43 ` Leon Romanovsky
2019-01-21 16:45 ` Jason Gunthorpe
2019-01-21 18:12 ` Saeed Mahameed
2019-01-21 18:22 ` Jason Gunthorpe
2019-01-25 18:16 ` Saeed Mahameed
2019-01-21 18:12 ` Saeed Mahameed
2019-01-24 12:30 ` [PATCH mlx5-next 0/4] mlx5 next misc updates Leon Romanovsky
2019-01-25 18:08 ` Saeed Mahameed
2019-01-27 7:51 ` Leon Romanovsky
2019-01-28 19:11 ` Saeed Mahameed
2019-01-29 7:58 ` Leon Romanovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190119003313.16711-3-saeedm@mellanox.com \
--to=saeedm@mellanox.com \
--cc=jgg@mellanox.com \
--cc=leonro@mellanox.com \
--cc=linux-rdma@vger.kernel.org \
--cc=majd@mellanox.com \
--cc=michaelgur@mellanox.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox