OSDN Git Service

RDMA/hns: Avoid setting loopback indicator when smac is same as dmac
authorWeihang Li <liweihang@huawei.com>
Mon, 16 Nov 2020 11:33:24 +0000 (19:33 +0800)
committerJason Gunthorpe <jgg@nvidia.com>
Thu, 26 Nov 2020 19:24:48 +0000 (15:24 -0400)
The loopback flag will be set to 1 by the hardware when the source mac
address is same as the destination mac address. So the driver don't need
to compare them.

Fixes: d6a3627e311c ("RDMA/hns: Optimize wqe buffer set flow for post send")
Link: https://lore.kernel.org/r/1605526408-6936-4-git-send-email-liweihang@huawei.com
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/hns/hns_roce_hw_v2.c

index f79c97e..4386628 100644 (file)
@@ -433,8 +433,6 @@ static inline int set_ud_wqe(struct hns_roce_qp *qp,
        unsigned int curr_idx = *sge_idx;
        int valid_num_sge;
        u32 msg_len = 0;
-       bool loopback;
-       u8 *smac;
        int ret;
 
        valid_num_sge = calc_wr_sge_num(wr, &msg_len);
@@ -457,13 +455,6 @@ static inline int set_ud_wqe(struct hns_roce_qp *qp,
        roce_set_field(ud_sq_wqe->byte_48, V2_UD_SEND_WQE_BYTE_48_DMAC_5_M,
                       V2_UD_SEND_WQE_BYTE_48_DMAC_5_S, ah->av.mac[5]);
 
-       /* MAC loopback */
-       smac = (u8 *)hr_dev->dev_addr[qp->port];
-       loopback = ether_addr_equal_unaligned(ah->av.mac, smac) ? 1 : 0;
-
-       roce_set_bit(ud_sq_wqe->byte_40,
-                    V2_UD_SEND_WQE_BYTE_40_LBI_S, loopback);
-
        ud_sq_wqe->msg_len = cpu_to_le32(msg_len);
 
        /* Set sig attr */