]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
RDMA/bnxt_re: Report udp source port for flow_label in bnxt_re_query_qp
authorAbhishek Mohapatra <abhishek.mohapatra@broadcom.com>
Thu, 14 Aug 2025 11:25:53 +0000 (16:55 +0530)
committerLeon Romanovsky <leon@kernel.org>
Mon, 8 Sep 2025 07:08:35 +0000 (03:08 -0400)
The firmware doesn't capture the flow_label. Therefore the value
that's always returned by qplib_qp->ah.flow_label is 0 whenever
a qp is created. And as per IB spec, udp source port can be reported
for flow_label. Hence reported udp source port for flow_label in
bnxt_re_query_qp by populating the value of qplib_qp->udp_sport
into qp_attr->ah_attr.grh.flow_label.

Signed-off-by: Abhishek Mohapatra <abhishek.mohapatra@broadcom.com>
Signed-off-by: Saravanan Vajravel <saravanan.vajravel@broadcom.com>
Link: https://patch.msgid.link/20250814112555.221665-8-kalesh-anakkur.purayil@broadcom.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/bnxt_re/ib_verbs.c
drivers/infiniband/hw/bnxt_re/qplib_fp.c
drivers/infiniband/hw/bnxt_re/qplib_fp.h
drivers/infiniband/hw/bnxt_re/roce_hsi.h

index 37c2bc3bdba5e1fc5f5d60688968175514d832b1..98bc8b6290f1896dd865324a1c5a07fbba3036e8 100644 (file)
@@ -2305,7 +2305,7 @@ int bnxt_re_query_qp(struct ib_qp *ib_qp, struct ib_qp_attr *qp_attr,
        qp_attr->pkey_index = qplib_qp->pkey_index;
        qp_attr->qkey = qplib_qp->qkey;
        qp_attr->ah_attr.type = RDMA_AH_ATTR_TYPE_ROCE;
-       rdma_ah_set_grh(&qp_attr->ah_attr, NULL, qplib_qp->ah.flow_label,
+       rdma_ah_set_grh(&qp_attr->ah_attr, NULL, qplib_qp->udp_sport,
                        qplib_qp->ah.host_sgid_index,
                        qplib_qp->ah.hop_limit,
                        qplib_qp->ah.traffic_class);
index dfe3177123e545fd67cb0e1bdb43e8a2508faf7e..092310571dcc4adcb878496ad13aad70affbaaa2 100644 (file)
@@ -1492,6 +1492,7 @@ int bnxt_qplib_query_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp)
        qp->access = sb->access;
        qp->pkey_index = le16_to_cpu(sb->pkey);
        qp->qkey = le32_to_cpu(sb->qkey);
+       qp->udp_sport = le16_to_cpu(sb->udp_src_port);
 
        temp32[0] = le32_to_cpu(sb->dgid[0]);
        temp32[1] = le32_to_cpu(sb->dgid[1]);
index ab125f1d949eed8ee21f76198b7620bc515359cc..074c539c69c13d3b59b19681202176c3e700e84f 100644 (file)
@@ -299,6 +299,7 @@ struct bnxt_qplib_qp {
        u8                              smac[6];
        u16                             vlan_id;
        u16                             port_id;
+       u16                             udp_sport;
        u8                              nw_type;
        struct bnxt_qplib_ah            ah;
 
index 024845f945ff5a23a2fc14e2b84220ff43dd9778..f9ac37335a1d5b5638b2ac642756fe8738163bd7 100644 (file)
@@ -788,7 +788,8 @@ struct creq_query_qp_resp_sb {
        #define CREQ_QUERY_QP_RESP_SB_ACCESS_REMOTE_ATOMIC 0x8UL
        __le16  pkey;
        __le32  qkey;
-       __le32  reserved32;
+       __le16  udp_src_port;
+       __le16  reserved16;
        __le32  dgid[4];
        __le32  flow_label;
        __le16  sgid_index;