Skip to content

Commit 2493a57

Browse files
paravmellanoxjgunthorpe
authored andcommitted
RDMA/cma: Refactor to access multiple fields of rdma_dev_addr
Pass the rdma_cm_id so that multiple fields of the rdma_dev_addr structure can be accessed, instead of passing each individual fields. This is needed to access some additional fields in followup patches. Signed-off-by: Parav Pandit <[email protected]> Reviewed-by: Mark Bloch <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 00db63c commit 2493a57

File tree

1 file changed

+8
-7
lines changed
  • drivers/infiniband/core

1 file changed

+8
-7
lines changed

drivers/infiniband/core/cma.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -612,11 +612,14 @@ static int cma_translate_addr(struct sockaddr *addr, struct rdma_dev_addr *dev_a
612612

613613
static inline int cma_validate_port(struct ib_device *device, u8 port,
614614
enum ib_gid_type gid_type,
615-
union ib_gid *gid, int dev_type,
616-
int bound_if_index)
615+
union ib_gid *gid,
616+
struct rdma_id_private *id_priv)
617617
{
618-
int ret = -ENODEV;
618+
struct rdma_dev_addr *dev_addr = &id_priv->id.route.addr.dev_addr;
619+
int bound_if_index = dev_addr->bound_dev_if;
620+
int dev_type = dev_addr->dev_type;
619621
struct net_device *ndev = NULL;
622+
int ret = -ENODEV;
620623

621624
if ((dev_type == ARPHRD_INFINIBAND) && !rdma_protocol_ib(device, port))
622625
return ret;
@@ -671,8 +674,7 @@ static int cma_acquire_dev(struct rdma_id_private *id_priv,
671674
rdma_protocol_ib(cma_dev->device, port) ?
672675
IB_GID_TYPE_IB :
673676
listen_id_priv->gid_type, gidp,
674-
dev_addr->dev_type,
675-
dev_addr->bound_dev_if);
677+
id_priv);
676678
if (!ret) {
677679
id_priv->id.port_num = port;
678680
goto out;
@@ -693,8 +695,7 @@ static int cma_acquire_dev(struct rdma_id_private *id_priv,
693695
rdma_protocol_ib(cma_dev->device, port) ?
694696
IB_GID_TYPE_IB :
695697
cma_dev->default_gid_type[port - 1],
696-
gidp, dev_addr->dev_type,
697-
dev_addr->bound_dev_if);
698+
gidp, id_priv);
698699
if (!ret) {
699700
id_priv->id.port_num = port;
700701
goto out;

0 commit comments

Comments
 (0)