Commit 8b7b59d0 authored by Zhu Yanjun's avatar Zhu Yanjun Committed by Doug Ledford

IB/rxe: remove redudant qpn check

In the commit 536ca245 ("IB/rxe: Drop QP0 silently"), if qpn is
zero, the function directly returns. So in the following function,
it is not necessary to check qpn. The qpn check in the function
check_keys is removed.

Fixes: 536ca245 ("IB/rxe: Drop QP0 silently")
CC: Srinivas Eeda <srinivas.eeda@oracle.com>
CC: Junxiao Bi <junxiao.bi@oracle.com>
Signed-off-by: default avatarZhu Yanjun <yanjun.zhu@oracle.com>
Reviewed-by: default avatarYuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent d3c04a3a
...@@ -122,7 +122,7 @@ static int check_keys(struct rxe_dev *rxe, struct rxe_pkt_info *pkt, ...@@ -122,7 +122,7 @@ static int check_keys(struct rxe_dev *rxe, struct rxe_pkt_info *pkt,
set_bad_pkey_cntr(port); set_bad_pkey_cntr(port);
goto err1; goto err1;
} }
} else if (qpn != 0) { } else {
if (unlikely(!pkey_match(pkey, if (unlikely(!pkey_match(pkey,
port->pkey_tbl[qp->attr.pkey_index] port->pkey_tbl[qp->attr.pkey_index]
))) { ))) {
...@@ -134,7 +134,7 @@ static int check_keys(struct rxe_dev *rxe, struct rxe_pkt_info *pkt, ...@@ -134,7 +134,7 @@ static int check_keys(struct rxe_dev *rxe, struct rxe_pkt_info *pkt,
} }
if ((qp_type(qp) == IB_QPT_UD || qp_type(qp) == IB_QPT_GSI) && if ((qp_type(qp) == IB_QPT_UD || qp_type(qp) == IB_QPT_GSI) &&
qpn != 0 && pkt->mask) { pkt->mask) {
u32 qkey = (qpn == 1) ? GSI_QKEY : qp->attr.qkey; u32 qkey = (qpn == 1) ? GSI_QKEY : qp->attr.qkey;
if (unlikely(deth_qkey(pkt) != qkey)) { if (unlikely(deth_qkey(pkt) != qkey)) {
......
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