Skip to content

Commit 2eade67

Browse files
oulijunjgunthorpe
authored andcommitted
RDMA/hns: Update the verbs of polling for completion
If the port is a RoCEv2 port, the remote port address and QP information which returned for UD will be modified. Signed-off-by: Lijun Ou <[email protected]> Signed-off-by: Yixian Liu <[email protected]> Signed-off-by: Wei Hu (Xavier) <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 6c1f08b commit 2eade67

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

drivers/infiniband/hw/hns/hns_roce_hw_v2.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1913,6 +1913,18 @@ static int hns_roce_v2_poll_one(struct hns_roce_cq *hr_cq,
19131913
wc->port_num = roce_get_field(cqe->byte_32,
19141914
V2_CQE_BYTE_32_PORTN_M, V2_CQE_BYTE_32_PORTN_S);
19151915
wc->pkey_index = 0;
1916+
memcpy(wc->smac, cqe->smac, 4);
1917+
wc->smac[4] = roce_get_field(cqe->byte_28,
1918+
V2_CQE_BYTE_28_SMAC_4_M,
1919+
V2_CQE_BYTE_28_SMAC_4_S);
1920+
wc->smac[5] = roce_get_field(cqe->byte_28,
1921+
V2_CQE_BYTE_28_SMAC_5_M,
1922+
V2_CQE_BYTE_28_SMAC_5_S);
1923+
wc->vlan_id = 0xffff;
1924+
wc->wc_flags |= (IB_WC_WITH_VLAN | IB_WC_WITH_SMAC);
1925+
wc->network_hdr_type = roce_get_field(cqe->byte_28,
1926+
V2_CQE_BYTE_28_PORT_TYPE_M,
1927+
V2_CQE_BYTE_28_PORT_TYPE_S);
19161928
}
19171929

19181930
return 0;

drivers/infiniband/hw/hns/hns_roce_hw_v2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ struct hns_roce_v2_cqe {
769769
u32 byte_12;
770770
u32 byte_16;
771771
u32 byte_cnt;
772-
u32 smac;
772+
u8 smac[4];
773773
u32 byte_28;
774774
u32 byte_32;
775775
};

0 commit comments

Comments
 (0)