Skip to content

Commit caf3e40

Browse files
oulijunjgunthorpe
authored andcommitted
RDMA/hns: Add vlan enable bit for hip08
In order to extend vlan device range, the design add two field of qp context for checking vlan packet in sender and in recevicer. Signed-off-by: Lijun Ou <oulijun@huawei.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
1 parent e93df01 commit caf3e40

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

drivers/infiniband/hw/hns/hns_roce_hw_v2.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3608,6 +3608,17 @@ static int hns_roce_v2_modify_qp(struct ib_qp *ibqp,
36083608
memcpy(src_mac, gid_attr->ndev->dev_addr, ETH_ALEN);
36093609
}
36103610

3611+
if (is_vlan_dev(gid_attr->ndev)) {
3612+
roce_set_bit(context->byte_76_srqn_op_en,
3613+
V2_QPC_BYTE_76_RQ_VLAN_EN_S, 1);
3614+
roce_set_bit(qpc_mask->byte_76_srqn_op_en,
3615+
V2_QPC_BYTE_76_RQ_VLAN_EN_S, 0);
3616+
roce_set_bit(context->byte_168_irrl_idx,
3617+
V2_QPC_BYTE_168_SQ_VLAN_EN_S, 1);
3618+
roce_set_bit(qpc_mask->byte_168_irrl_idx,
3619+
V2_QPC_BYTE_168_SQ_VLAN_EN_S, 0);
3620+
}
3621+
36113622
roce_set_field(context->byte_24_mtu_tc,
36123623
V2_QPC_BYTE_24_VLAN_ID_M,
36133624
V2_QPC_BYTE_24_VLAN_ID_S, vlan);

drivers/infiniband/hw/hns/hns_roce_hw_v2.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,7 @@ struct hns_roce_v2_qp_context {
527527

528528
#define V2_QPC_BYTE_76_RQIE_S 28
529529

530+
#define V2_QPC_BYTE_76_RQ_VLAN_EN_S 30
530531
#define V2_QPC_BYTE_80_RX_CQN_S 0
531532
#define V2_QPC_BYTE_80_RX_CQN_M GENMASK(23, 0)
532533

@@ -628,6 +629,7 @@ struct hns_roce_v2_qp_context {
628629
#define V2_QPC_BYTE_168_LP_SGEN_INI_S 22
629630
#define V2_QPC_BYTE_168_LP_SGEN_INI_M GENMASK(23, 22)
630631

632+
#define V2_QPC_BYTE_168_SQ_VLAN_EN_S 24
631633
#define V2_QPC_BYTE_168_POLL_DB_WAIT_DO_S 25
632634
#define V2_QPC_BYTE_168_SCC_TOKEN_FORBID_SQ_DEQ_S 26
633635
#define V2_QPC_BYTE_168_WAIT_ACK_TIMEOUT_S 27

0 commit comments

Comments
 (0)