Skip to content

Commit 0305b44

Browse files
321lipengdavem330
authored andcommitted
net: hns3: Fixes ring-to-vector map-and-unmap command
This patch fixes the vector-to-ring map and unmap command and adds INT_GL(for, Gap Limiting Interrupts) and VF id to it as required by the hardware interface. Fixes: 6427264ef330 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Signed-off-by: Lipeng <lipeng321@huawei.com> Signed-off-by: Mingguang Qu <qumingguang@huawei.com> Signed-off-by: Salil Mehta <salil.mehta@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent c5b1b97 commit 0305b44

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ struct hclge_tqp_map {
238238
u8 rsv[18];
239239
};
240240

241-
#define HCLGE_VECTOR_ELEMENTS_PER_CMD 11
241+
#define HCLGE_VECTOR_ELEMENTS_PER_CMD 10
242242

243243
enum hclge_int_type {
244244
HCLGE_INT_TX,
@@ -252,8 +252,12 @@ struct hclge_ctrl_vector_chain {
252252
#define HCLGE_INT_TYPE_S 0
253253
#define HCLGE_INT_TYPE_M 0x3
254254
#define HCLGE_TQP_ID_S 2
255-
#define HCLGE_TQP_ID_M (0x3fff << HCLGE_TQP_ID_S)
255+
#define HCLGE_TQP_ID_M (0x7ff << HCLGE_TQP_ID_S)
256+
#define HCLGE_INT_GL_IDX_S 13
257+
#define HCLGE_INT_GL_IDX_M (0x3 << HCLGE_INT_GL_IDX_S)
256258
__le16 tqp_type_and_id[HCLGE_VECTOR_ELEMENTS_PER_CMD];
259+
u8 vfid;
260+
u8 rsv;
257261
};
258262

259263
#define HCLGE_TC_NUM 8

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2680,7 +2680,11 @@ int hclge_map_vport_ring_to_vector(struct hclge_vport *vport, int vector_id,
26802680
hnae_get_bit(node->flag, HNAE3_RING_TYPE_B));
26812681
hnae_set_field(req->tqp_type_and_id[i], HCLGE_TQP_ID_M,
26822682
HCLGE_TQP_ID_S, node->tqp_index);
2683+
hnae_set_field(req->tqp_type_and_id[i], HCLGE_INT_GL_IDX_M,
2684+
HCLGE_INT_GL_IDX_S,
2685+
hnae_get_bit(node->flag, HNAE3_RING_TYPE_B));
26832686
req->tqp_type_and_id[i] = cpu_to_le16(req->tqp_type_and_id[i]);
2687+
req->vfid = vport->vport_id;
26842688

26852689
if (++i >= HCLGE_VECTOR_ELEMENTS_PER_CMD) {
26862690
req->int_cause_num = HCLGE_VECTOR_ELEMENTS_PER_CMD;
@@ -2764,8 +2768,12 @@ static int hclge_unmap_ring_from_vector(
27642768
hnae_get_bit(node->flag, HNAE3_RING_TYPE_B));
27652769
hnae_set_field(req->tqp_type_and_id[i], HCLGE_TQP_ID_M,
27662770
HCLGE_TQP_ID_S, node->tqp_index);
2771+
hnae_set_field(req->tqp_type_and_id[i], HCLGE_INT_GL_IDX_M,
2772+
HCLGE_INT_GL_IDX_S,
2773+
hnae_get_bit(node->flag, HNAE3_RING_TYPE_B));
27672774

27682775
req->tqp_type_and_id[i] = cpu_to_le16(req->tqp_type_and_id[i]);
2776+
req->vfid = vport->vport_id;
27692777

27702778
if (++i >= HCLGE_VECTOR_ELEMENTS_PER_CMD) {
27712779
req->int_cause_num = HCLGE_VECTOR_ELEMENTS_PER_CMD;

0 commit comments

Comments
 (0)