Skip to content

Commit

Permalink
IB/core: Use rdma_read_gid_l2_fields to compare GID L2 fields
Browse files Browse the repository at this point in the history
Current code tries to derive VLAN ID and compares it with GID
attribute for matching entry. This raw search fails on macvlan
netdevice as its not a VLAN device, but its an upper device of a VLAN
netdevice.

Due to this limitation, incoming QP1 packets fail to match in the
GID table. Such packets are dropped.

Hence, to support it, use the existing rdma_read_gid_l2_fields()
that takes care of diffferent device types.

Fixes: dbf727d ("IB/core: Use GID table in AH creation and dmac resolution")
Signed-off-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Link: https://lore.kernel.org/r/20191002121750.17313-1-leon@kernel.org
Signed-off-by: Doug Ledford <dledford@redhat.com>
  • Loading branch information
Parav Pandit authored and Doug Ledford committed Oct 18, 2019
1 parent b806c94 commit 777a8b3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/infiniband/core/verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -662,16 +662,17 @@ static bool find_gid_index(const union ib_gid *gid,
void *context)
{
struct find_gid_index_context *ctx = context;
u16 vlan_id = 0xffff;
int ret;

if (ctx->gid_type != gid_attr->gid_type)
return false;

if ((!!(ctx->vlan_id != 0xffff) == !is_vlan_dev(gid_attr->ndev)) ||
(is_vlan_dev(gid_attr->ndev) &&
vlan_dev_vlan_id(gid_attr->ndev) != ctx->vlan_id))
ret = rdma_read_gid_l2_fields(gid_attr, &vlan_id, NULL);
if (ret)
return false;

return true;
return ctx->vlan_id == vlan_id;
}

static const struct ib_gid_attr *
Expand Down

0 comments on commit 777a8b3

Please sign in to comment.