Commit 02e35244 authored by Bob Pearson's avatar Bob Pearson Committed by Jason Gunthorpe

RDMA/rxe: Rename rxe_mc_grp and rxe_mc_elem

Rename rxe_mc_grp to rxe_mcg. Rename rxe_mc_elem to rxe_mca.
These can be read 'multicast group' and 'multicast attachment'.
'elem' collided with the use of elem in rxe pools and was a little
confusing.

Link: https://lore.kernel.org/r/20220127213755.31697-4-rpearsonhpe@gmail.comSigned-off-by: default avatarBob Pearson <rpearsonhpe@gmail.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
parent 758c7f1e
...@@ -26,12 +26,12 @@ static int rxe_mcast_delete(struct rxe_dev *rxe, union ib_gid *mgid) ...@@ -26,12 +26,12 @@ static int rxe_mcast_delete(struct rxe_dev *rxe, union ib_gid *mgid)
} }
/* caller should hold mc_grp_pool->pool_lock */ /* caller should hold mc_grp_pool->pool_lock */
static struct rxe_mc_grp *create_grp(struct rxe_dev *rxe, static struct rxe_mcg *create_grp(struct rxe_dev *rxe,
struct rxe_pool *pool, struct rxe_pool *pool,
union ib_gid *mgid) union ib_gid *mgid)
{ {
int err; int err;
struct rxe_mc_grp *grp; struct rxe_mcg *grp;
grp = rxe_alloc_locked(&rxe->mc_grp_pool); grp = rxe_alloc_locked(&rxe->mc_grp_pool);
if (!grp) if (!grp)
...@@ -53,10 +53,10 @@ static struct rxe_mc_grp *create_grp(struct rxe_dev *rxe, ...@@ -53,10 +53,10 @@ static struct rxe_mc_grp *create_grp(struct rxe_dev *rxe,
} }
static int rxe_mcast_get_grp(struct rxe_dev *rxe, union ib_gid *mgid, static int rxe_mcast_get_grp(struct rxe_dev *rxe, union ib_gid *mgid,
struct rxe_mc_grp **grp_p) struct rxe_mcg **grp_p)
{ {
int err; int err;
struct rxe_mc_grp *grp; struct rxe_mcg *grp;
struct rxe_pool *pool = &rxe->mc_grp_pool; struct rxe_pool *pool = &rxe->mc_grp_pool;
if (rxe->attr.max_mcast_qp_attach == 0) if (rxe->attr.max_mcast_qp_attach == 0)
...@@ -82,10 +82,10 @@ static int rxe_mcast_get_grp(struct rxe_dev *rxe, union ib_gid *mgid, ...@@ -82,10 +82,10 @@ static int rxe_mcast_get_grp(struct rxe_dev *rxe, union ib_gid *mgid,
} }
static int rxe_mcast_add_grp_elem(struct rxe_dev *rxe, struct rxe_qp *qp, static int rxe_mcast_add_grp_elem(struct rxe_dev *rxe, struct rxe_qp *qp,
struct rxe_mc_grp *grp) struct rxe_mcg *grp)
{ {
int err; int err;
struct rxe_mc_elem *elem; struct rxe_mca *elem;
/* check to see of the qp is already a member of the group */ /* check to see of the qp is already a member of the group */
spin_lock_bh(&qp->grp_lock); spin_lock_bh(&qp->grp_lock);
...@@ -128,8 +128,8 @@ static int rxe_mcast_add_grp_elem(struct rxe_dev *rxe, struct rxe_qp *qp, ...@@ -128,8 +128,8 @@ static int rxe_mcast_add_grp_elem(struct rxe_dev *rxe, struct rxe_qp *qp,
static int rxe_mcast_drop_grp_elem(struct rxe_dev *rxe, struct rxe_qp *qp, static int rxe_mcast_drop_grp_elem(struct rxe_dev *rxe, struct rxe_qp *qp,
union ib_gid *mgid) union ib_gid *mgid)
{ {
struct rxe_mc_grp *grp; struct rxe_mcg *grp;
struct rxe_mc_elem *elem, *tmp; struct rxe_mca *elem, *tmp;
grp = rxe_pool_get_key(&rxe->mc_grp_pool, mgid); grp = rxe_pool_get_key(&rxe->mc_grp_pool, mgid);
if (!grp) if (!grp)
...@@ -162,8 +162,8 @@ static int rxe_mcast_drop_grp_elem(struct rxe_dev *rxe, struct rxe_qp *qp, ...@@ -162,8 +162,8 @@ static int rxe_mcast_drop_grp_elem(struct rxe_dev *rxe, struct rxe_qp *qp,
void rxe_drop_all_mcast_groups(struct rxe_qp *qp) void rxe_drop_all_mcast_groups(struct rxe_qp *qp)
{ {
struct rxe_mc_grp *grp; struct rxe_mcg *grp;
struct rxe_mc_elem *elem; struct rxe_mca *elem;
while (1) { while (1) {
spin_lock_bh(&qp->grp_lock); spin_lock_bh(&qp->grp_lock);
...@@ -171,7 +171,7 @@ void rxe_drop_all_mcast_groups(struct rxe_qp *qp) ...@@ -171,7 +171,7 @@ void rxe_drop_all_mcast_groups(struct rxe_qp *qp)
spin_unlock_bh(&qp->grp_lock); spin_unlock_bh(&qp->grp_lock);
break; break;
} }
elem = list_first_entry(&qp->grp_list, struct rxe_mc_elem, elem = list_first_entry(&qp->grp_list, struct rxe_mca,
grp_list); grp_list);
list_del(&elem->grp_list); list_del(&elem->grp_list);
spin_unlock_bh(&qp->grp_lock); spin_unlock_bh(&qp->grp_lock);
...@@ -188,7 +188,7 @@ void rxe_drop_all_mcast_groups(struct rxe_qp *qp) ...@@ -188,7 +188,7 @@ void rxe_drop_all_mcast_groups(struct rxe_qp *qp)
void rxe_mc_cleanup(struct rxe_pool_elem *elem) void rxe_mc_cleanup(struct rxe_pool_elem *elem)
{ {
struct rxe_mc_grp *grp = container_of(elem, typeof(*grp), elem); struct rxe_mcg *grp = container_of(elem, typeof(*grp), elem);
struct rxe_dev *rxe = grp->rxe; struct rxe_dev *rxe = grp->rxe;
rxe_drop_key(grp); rxe_drop_key(grp);
...@@ -200,7 +200,7 @@ int rxe_attach_mcast(struct ib_qp *ibqp, union ib_gid *mgid, u16 mlid) ...@@ -200,7 +200,7 @@ int rxe_attach_mcast(struct ib_qp *ibqp, union ib_gid *mgid, u16 mlid)
int err; int err;
struct rxe_dev *rxe = to_rdev(ibqp->device); struct rxe_dev *rxe = to_rdev(ibqp->device);
struct rxe_qp *qp = to_rqp(ibqp); struct rxe_qp *qp = to_rqp(ibqp);
struct rxe_mc_grp *grp; struct rxe_mcg *grp;
/* takes a ref on grp if successful */ /* takes a ref on grp if successful */
err = rxe_mcast_get_grp(rxe, mgid, &grp); err = rxe_mcast_get_grp(rxe, mgid, &grp);
......
...@@ -83,17 +83,17 @@ static const struct rxe_type_info { ...@@ -83,17 +83,17 @@ static const struct rxe_type_info {
}, },
[RXE_TYPE_MC_GRP] = { [RXE_TYPE_MC_GRP] = {
.name = "rxe-mc_grp", .name = "rxe-mc_grp",
.size = sizeof(struct rxe_mc_grp), .size = sizeof(struct rxe_mcg),
.elem_offset = offsetof(struct rxe_mc_grp, elem), .elem_offset = offsetof(struct rxe_mcg, elem),
.cleanup = rxe_mc_cleanup, .cleanup = rxe_mc_cleanup,
.flags = RXE_POOL_KEY, .flags = RXE_POOL_KEY,
.key_offset = offsetof(struct rxe_mc_grp, mgid), .key_offset = offsetof(struct rxe_mcg, mgid),
.key_size = sizeof(union ib_gid), .key_size = sizeof(union ib_gid),
}, },
[RXE_TYPE_MC_ELEM] = { [RXE_TYPE_MC_ELEM] = {
.name = "rxe-mc_elem", .name = "rxe-mc_elem",
.size = sizeof(struct rxe_mc_elem), .size = sizeof(struct rxe_mca),
.elem_offset = offsetof(struct rxe_mc_elem, elem), .elem_offset = offsetof(struct rxe_mca, elem),
}, },
}; };
......
...@@ -233,8 +233,8 @@ static inline void rxe_rcv_pkt(struct rxe_pkt_info *pkt, struct sk_buff *skb) ...@@ -233,8 +233,8 @@ static inline void rxe_rcv_pkt(struct rxe_pkt_info *pkt, struct sk_buff *skb)
static void rxe_rcv_mcast_pkt(struct rxe_dev *rxe, struct sk_buff *skb) static void rxe_rcv_mcast_pkt(struct rxe_dev *rxe, struct sk_buff *skb)
{ {
struct rxe_pkt_info *pkt = SKB_TO_PKT(skb); struct rxe_pkt_info *pkt = SKB_TO_PKT(skb);
struct rxe_mc_grp *mcg; struct rxe_mcg *mcg;
struct rxe_mc_elem *mce; struct rxe_mca *mce;
struct rxe_qp *qp; struct rxe_qp *qp;
union ib_gid dgid; union ib_gid dgid;
int err; int err;
......
...@@ -353,7 +353,7 @@ struct rxe_mw { ...@@ -353,7 +353,7 @@ struct rxe_mw {
u64 length; u64 length;
}; };
struct rxe_mc_grp { struct rxe_mcg {
struct rxe_pool_elem elem; struct rxe_pool_elem elem;
spinlock_t mcg_lock; /* guard group */ spinlock_t mcg_lock; /* guard group */
struct rxe_dev *rxe; struct rxe_dev *rxe;
...@@ -364,12 +364,12 @@ struct rxe_mc_grp { ...@@ -364,12 +364,12 @@ struct rxe_mc_grp {
u16 pkey; u16 pkey;
}; };
struct rxe_mc_elem { struct rxe_mca {
struct rxe_pool_elem elem; struct rxe_pool_elem elem;
struct list_head qp_list; struct list_head qp_list;
struct list_head grp_list; struct list_head grp_list;
struct rxe_qp *qp; struct rxe_qp *qp;
struct rxe_mc_grp *grp; struct rxe_mcg *grp;
}; };
struct rxe_port { struct rxe_port {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment