mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-19 03:46:09 +07:00
RDMA/hns: Modify variable/field name from vlan to vlan_id
The name of vlan and vlan_tag is not clear enough, it's actually means vlan id. Signed-off-by: Weihang Li <liweihang@hisilicon.com> Link: https://lore.kernel.org/r/1567566885-23088-4-git-send-email-liweihang@hisilicon.com Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
parent
e8a07de57e
commit
32883228b9
@ -46,32 +46,32 @@ int hns_roce_create_ah(struct ib_ah *ibah, struct rdma_ah_attr *ah_attr,
|
||||
const struct ib_gid_attr *gid_attr;
|
||||
struct device *dev = hr_dev->dev;
|
||||
struct hns_roce_ah *ah = to_hr_ah(ibah);
|
||||
u16 vlan_tag = 0xffff;
|
||||
const struct ib_global_route *grh = rdma_ah_read_grh(ah_attr);
|
||||
u16 vlan_id = 0xffff;
|
||||
bool vlan_en = false;
|
||||
int ret;
|
||||
|
||||
gid_attr = ah_attr->grh.sgid_attr;
|
||||
ret = rdma_read_gid_l2_fields(gid_attr, &vlan_tag, NULL);
|
||||
ret = rdma_read_gid_l2_fields(gid_attr, &vlan_id, NULL);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* Get mac address */
|
||||
memcpy(ah->av.mac, ah_attr->roce.dmac, ETH_ALEN);
|
||||
|
||||
if (vlan_tag < VLAN_CFI_MASK) {
|
||||
if (vlan_id < VLAN_N_VID) {
|
||||
vlan_en = true;
|
||||
vlan_tag |= (rdma_ah_get_sl(ah_attr) &
|
||||
vlan_id |= (rdma_ah_get_sl(ah_attr) &
|
||||
HNS_ROCE_VLAN_SL_BIT_MASK) <<
|
||||
HNS_ROCE_VLAN_SL_SHIFT;
|
||||
}
|
||||
|
||||
ah->av.port = rdma_ah_get_port_num(ah_attr);
|
||||
ah->av.gid_index = grh->sgid_index;
|
||||
ah->av.vlan = vlan_tag;
|
||||
ah->av.vlan_id = vlan_id;
|
||||
ah->av.vlan_en = vlan_en;
|
||||
dev_dbg(dev, "gid_index = 0x%x,vlan = 0x%x\n", ah->av.gid_index,
|
||||
ah->av.vlan);
|
||||
dev_dbg(dev, "gid_index = 0x%x,vlan_id = 0x%x\n", ah->av.gid_index,
|
||||
ah->av.vlan_id);
|
||||
|
||||
if (rdma_ah_get_static_rate(ah_attr))
|
||||
ah->av.stat_rate = IB_RATE_10_GBPS;
|
||||
|
@ -582,7 +582,7 @@ struct hns_roce_av {
|
||||
u8 tclass;
|
||||
u8 dgid[HNS_ROCE_GID_SIZE];
|
||||
u8 mac[ETH_ALEN];
|
||||
u16 vlan;
|
||||
u16 vlan_id;
|
||||
bool vlan_en;
|
||||
};
|
||||
|
||||
|
@ -389,7 +389,7 @@ static int hns_roce_v2_post_send(struct ib_qp *ibqp,
|
||||
roce_set_field(ud_sq_wqe->byte_36,
|
||||
V2_UD_SEND_WQE_BYTE_36_VLAN_M,
|
||||
V2_UD_SEND_WQE_BYTE_36_VLAN_S,
|
||||
ah->av.vlan);
|
||||
ah->av.vlan_id);
|
||||
roce_set_field(ud_sq_wqe->byte_36,
|
||||
V2_UD_SEND_WQE_BYTE_36_HOPLIMIT_M,
|
||||
V2_UD_SEND_WQE_BYTE_36_HOPLIMIT_S,
|
||||
@ -4061,8 +4061,8 @@ static int hns_roce_v2_set_path(struct ib_qp *ibqp,
|
||||
struct hns_roce_qp *hr_qp = to_hr_qp(ibqp);
|
||||
const struct ib_gid_attr *gid_attr = NULL;
|
||||
int is_roce_protocol;
|
||||
u16 vlan_id = 0xffff;
|
||||
bool is_udp = false;
|
||||
u16 vlan = 0xffff;
|
||||
u8 ib_port;
|
||||
u8 hr_port;
|
||||
int ret;
|
||||
@ -4074,7 +4074,7 @@ static int hns_roce_v2_set_path(struct ib_qp *ibqp,
|
||||
|
||||
if (is_roce_protocol) {
|
||||
gid_attr = attr->ah_attr.grh.sgid_attr;
|
||||
ret = rdma_read_gid_l2_fields(gid_attr, &vlan, NULL);
|
||||
ret = rdma_read_gid_l2_fields(gid_attr, &vlan_id, NULL);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@ -4083,7 +4083,7 @@ static int hns_roce_v2_set_path(struct ib_qp *ibqp,
|
||||
IB_GID_TYPE_ROCE_UDP_ENCAP);
|
||||
}
|
||||
|
||||
if (vlan < VLAN_CFI_MASK) {
|
||||
if (vlan_id < VLAN_N_VID) {
|
||||
roce_set_bit(context->byte_76_srqn_op_en,
|
||||
V2_QPC_BYTE_76_RQ_VLAN_EN_S, 1);
|
||||
roce_set_bit(qpc_mask->byte_76_srqn_op_en,
|
||||
@ -4095,7 +4095,7 @@ static int hns_roce_v2_set_path(struct ib_qp *ibqp,
|
||||
}
|
||||
|
||||
roce_set_field(context->byte_24_mtu_tc, V2_QPC_BYTE_24_VLAN_ID_M,
|
||||
V2_QPC_BYTE_24_VLAN_ID_S, vlan);
|
||||
V2_QPC_BYTE_24_VLAN_ID_S, vlan_id);
|
||||
roce_set_field(qpc_mask->byte_24_mtu_tc, V2_QPC_BYTE_24_VLAN_ID_M,
|
||||
V2_QPC_BYTE_24_VLAN_ID_S, 0);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user