All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Jason Gunthorpe <jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Daniel Jurgens <danielj-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Parav Pandit <parav-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: [PATCH rdma-next 11/15] {net,IB}/mlx5: Change set_roce_gid to take a port number
Date: Sun, 24 Dec 2017 14:57:37 +0200	[thread overview]
Message-ID: <20171224125741.25464-12-leon@kernel.org> (raw)
In-Reply-To: <20171224125741.25464-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

From: Daniel Jurgens <danielj-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

When in dual port mode setting a RoCE GID for any port flows through the
master ports mlx5_core_dev. Provide an interface to set the port when
sending this command.

Signed-off-by: Daniel Jurgens <danielj-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Reviewed-by: Parav Pandit <parav-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
 drivers/infiniband/hw/mlx5/main.c                   | 2 +-
 drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c | 7 ++++---
 drivers/net/ethernet/mellanox/mlx5/core/lib/gid.c   | 5 ++++-
 include/linux/mlx5/driver.h                         | 2 +-
 4 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index e61c0b2f29ba..261c2a8db6b3 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -477,7 +477,7 @@ static int set_roce_addr(struct mlx5_ib_dev *dev, u8 port_num,
 
 	return mlx5_core_roce_gid_set(dev->mdev, index, roce_version,
 				      roce_l3_type, gid->raw, mac, vlan,
-				      vlan_id);
+				      vlan_id, port_num);
 }
 
 static int mlx5_ib_add_gid(struct ib_device *device, u8 port_num,
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c b/drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c
index c841b03c3e48..e6175f8ac0e4 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c
@@ -888,7 +888,8 @@ struct mlx5_fpga_conn *mlx5_fpga_conn_create(struct mlx5_fpga_device *fdev,
 	err = mlx5_core_roce_gid_set(fdev->mdev, conn->qp.sgid_index,
 				     MLX5_ROCE_VERSION_2,
 				     MLX5_ROCE_L3_TYPE_IPV6,
-				     remote_ip, remote_mac, true, 0);
+				     remote_ip, remote_mac, true, 0,
+				     MLX5_FPGA_PORT_NUM);
 	if (err) {
 		mlx5_fpga_err(fdev, "Failed to set SGID: %d\n", err);
 		ret = ERR_PTR(err);
@@ -954,7 +955,7 @@ struct mlx5_fpga_conn *mlx5_fpga_conn_create(struct mlx5_fpga_device *fdev,
 	mlx5_fpga_conn_destroy_cq(conn);
 err_gid:
 	mlx5_core_roce_gid_set(fdev->mdev, conn->qp.sgid_index, 0, 0, NULL,
-			       NULL, false, 0);
+			       NULL, false, 0, MLX5_FPGA_PORT_NUM);
 err_rsvd_gid:
 	mlx5_core_reserved_gid_free(fdev->mdev, conn->qp.sgid_index);
 err:
@@ -982,7 +983,7 @@ void mlx5_fpga_conn_destroy(struct mlx5_fpga_conn *conn)
 	mlx5_fpga_conn_destroy_cq(conn);
 
 	mlx5_core_roce_gid_set(conn->fdev->mdev, conn->qp.sgid_index, 0, 0,
-			       NULL, NULL, false, 0);
+			       NULL, NULL, false, 0, MLX5_FPGA_PORT_NUM);
 	mlx5_core_reserved_gid_free(conn->fdev->mdev, conn->qp.sgid_index);
 	kfree(conn);
 }
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/gid.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/gid.c
index 573f59f46d41..7722a3f9bb68 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/gid.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/gid.c
@@ -121,7 +121,7 @@ EXPORT_SYMBOL_GPL(mlx5_core_reserved_gids_count);
 
 int mlx5_core_roce_gid_set(struct mlx5_core_dev *dev, unsigned int index,
 			   u8 roce_version, u8 roce_l3_type, const u8 *gid,
-			   const u8 *mac, bool vlan, u16 vlan_id)
+			   const u8 *mac, bool vlan, u16 vlan_id, u8 port_num)
 {
 #define MLX5_SET_RA(p, f, v) MLX5_SET(roce_addr_layout, p, f, v)
 	u32  in[MLX5_ST_SZ_DW(set_roce_address_in)] = {0};
@@ -148,6 +148,9 @@ int mlx5_core_roce_gid_set(struct mlx5_core_dev *dev, unsigned int index,
 		memcpy(addr_l3_addr, gid, gidsz);
 	}
 
+	if (MLX5_CAP_GEN(dev, num_vhca_ports) > 0)
+		MLX5_SET(set_roce_address_in, in, vhca_port_num, port_num);
+
 	MLX5_SET(set_roce_address_in, in, roce_address_index, index);
 	MLX5_SET(set_roce_address_in, in, opcode, MLX5_CMD_OP_SET_ROCE_ADDRESS);
 	return mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out));
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index c2c78bc42432..bc494ddefcf8 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -1101,7 +1101,7 @@ void mlx5_free_bfreg(struct mlx5_core_dev *mdev, struct mlx5_sq_bfreg *bfreg);
 unsigned int mlx5_core_reserved_gids_count(struct mlx5_core_dev *dev);
 int mlx5_core_roce_gid_set(struct mlx5_core_dev *dev, unsigned int index,
 			   u8 roce_version, u8 roce_l3_type, const u8 *gid,
-			   const u8 *mac, bool vlan, u16 vlan_id);
+			   const u8 *mac, bool vlan, u16 vlan_id, u8 port_num);
 
 static inline int fw_initializing(struct mlx5_core_dev *dev)
 {
-- 
2.15.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2017-12-24 12:57 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-24 12:57 [PATCH rdma-next 00/15] Dual Port mlx5 IB Device for RoCE Leon Romanovsky
     [not found] ` <20171224125741.25464-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-12-24 12:57   ` [PATCH rdma-next 01/15] net/mlx5: Fix race for multiple RoCE enable Leon Romanovsky
     [not found]     ` <20171224125741.25464-2-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-12-24 21:53       ` Or Gerlitz
     [not found]         ` <CAJ3xEMg8U_4DpYEWa8t1QpccNzjU6f0shEtQ7fRWg-EtGupy+w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-12-25  5:59           ` Leon Romanovsky
     [not found]             ` <20171225055916.GU2942-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-12-25  9:21               ` Or Gerlitz
2017-12-24 12:57   ` [PATCH rdma-next 02/15] net/mlx5: Set software owner ID during init HCA Leon Romanovsky
     [not found]     ` <20171224125741.25464-3-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-12-24 22:00       ` Or Gerlitz
     [not found]         ` <CAJ3xEMiq-4DGFW-Z3hX3NfsSGXD6bm_uarGF_cm6K7+YuutJBQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-12-25  5:35           ` Leon Romanovsky
     [not found]             ` <20171225053534.GT2942-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-12-27 21:28               ` Or Gerlitz
2017-12-27 15:27           ` Daniel Jurgens
     [not found]             ` <b329f348-2462-2bf4-ee06-064e798c9b86-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-12-27 17:52               ` Jason Gunthorpe
     [not found]                 ` <20171227175208.GD31310-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-12-27 18:06                   ` Daniel Jurgens
     [not found]                     ` <37588052-e7cd-b2ad-b2e0-91e03a9401d1-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-12-27 18:10                       ` Jason Gunthorpe
2018-01-02  9:34               ` Or Gerlitz
     [not found]                 ` <CAJ3xEMixQ-Tw9gUYYPhNLvrEbntNTQBvLcVUe+x130hkEq15Bg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-02 10:10                   ` Leon Romanovsky
2017-12-24 12:57   ` [PATCH rdma-next 03/15] IB/core: Change roce_rescan_device to return void Leon Romanovsky
2017-12-24 12:57   ` [PATCH rdma-next 04/15] IB/mlx5: Reduce the use of num_port capability Leon Romanovsky
2017-12-24 12:57   ` [PATCH rdma-next 05/15] IB/mlx5: Make netdev notifications multiport capable Leon Romanovsky
2017-12-24 12:57   ` [PATCH rdma-next 06/15] {net,IB}/mlx5: Manage port association for multiport RoCE Leon Romanovsky
2017-12-24 12:57   ` [PATCH rdma-next 07/15] IB/mlx5: Move IB event processing onto a workqueue Leon Romanovsky
2017-12-24 12:57   ` [PATCH rdma-next 08/15] IB/mlx5: Implement dual port functionality in query routines Leon Romanovsky
2017-12-24 12:57   ` [PATCH rdma-next 09/15] IB/mlx5: Change debugfs to have per port contents Leon Romanovsky
2017-12-24 12:57   ` [PATCH rdma-next 10/15] IB/mlx5: Update counter implementation for dual port RoCE Leon Romanovsky
2017-12-24 12:57   ` Leon Romanovsky [this message]
2017-12-24 12:57   ` [PATCH rdma-next 12/15] IB/mlx5: Route MADs " Leon Romanovsky
2017-12-24 12:57   ` [PATCH rdma-next 13/15] IB/mlx5: Use correct mdev for vport queries in ib_virt Leon Romanovsky
     [not found]     ` <20171224125741.25464-14-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-12-24 22:14       ` Or Gerlitz
     [not found]         ` <CAJ3xEMgyD693JPtu_vag-q3kVP=Nyag=dPEp15AZcyX62FwkPw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-12-25  7:25           ` Leon Romanovsky
2017-12-24 12:57   ` [PATCH rdma-next 14/15] IB/mlx5: Don't advertise RAW QP support in dual port mode Leon Romanovsky
     [not found]     ` <20171224125741.25464-15-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-12-24 22:16       ` Or Gerlitz
     [not found]         ` <CAJ3xEMgAtd1PKN2h1NFj=Mt72msuU5bpFy0jO4KFXxXxGRf7hA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-12-25  7:16           ` Leon Romanovsky
     [not found]             ` <20171225071613.GW2942-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-12-25  9:17               ` Or Gerlitz
     [not found]                 ` <CAJ3xEMhtssDWuu8JAB_jhyofKbkeo4vYTLixLeta6vPzKQOp+A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-03 20:35                   ` Daniel Jurgens
     [not found]                     ` <ab3fb697-7b2c-685c-2151-5f48d5d7270a-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2018-01-03 20:39                       ` Or Gerlitz
     [not found]                         ` <CAJ3xEMimYj8=USqjHEF_uiwJCNoeT5qpbNMYTWUX7EgTVSeuuw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-03 20:43                           ` Daniel Jurgens
     [not found]                             ` <6f114e3c-2e16-f7ce-2e60-d06113afc9b8-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2018-01-03 20:47                               ` Or Gerlitz
     [not found]                                 ` <CAJ3xEMjZfTJP1fi=VosXL_v=AUueWZc54iOsXz1ynikYm-jcjA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-04  5:21                                   ` Leon Romanovsky
2017-12-24 12:57   ` [PATCH rdma-next 15/15] net/mlx5: Set num_vhca_ports capability Leon Romanovsky
2017-12-24 21:48   ` [PATCH rdma-next 00/15] Dual Port mlx5 IB Device for RoCE Or Gerlitz
     [not found] ` <CAJ3xEMhZgEee+VLpV4bV150siOdXwpcp64AGqeqr5Y2o--WRdw@mail.gmail.com>
     [not found]   ` <CAJ3xEMhZgEee+VLpV4bV150siOdXwpcp64AGqeqr5Y2o--WRdw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-12-25  9:24     ` Or Gerlitz
     [not found]       ` <CAJ3xEMgpP0Sbj4vY3_pJDjrDqHLHmkaTSGLyVuBY+aoC6VUnHA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-03 18:58         ` Daniel Jurgens
2017-12-27 15:22     ` Daniel Jurgens
     [not found]       ` <382ba516-bf7b-0a0b-7a9f-604cbf805c80-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-12-27 21:22         ` Or Gerlitz
     [not found]           ` <CAJ3xEMi3CvATj-vpfy8E89=ZoPL1mmoiu8HWea_NEwfV2++ZpQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-12-27 23:20             ` Daniel Jurgens
     [not found]               ` <a3cf271c-f66c-074a-88bd-b48b39959e6b-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-12-29 18:03                 ` Jason Gunthorpe
     [not found]                   ` <20171229180313.GD6513-uk2M96/98Pc@public.gmane.org>
2017-12-29 20:52                     ` Daniel Jurgens
     [not found]                       ` <9d102fb2-122c-d7e9-2521-cf61b708d8c0-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-12-29 21:27                         ` Jason Gunthorpe

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=20171224125741.25464-12-leon@kernel.org \
    --to=leon-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=danielj-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=parav-VPRAkNaXOzVWk0Htik3J/w@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.