]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: hns3: extend HCLGE_FD_AD_QID to 11 bits
authorJijie Shao <shaojijie@huawei.com>
Fri, 23 Jan 2026 09:47:55 +0000 (17:47 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 27 Jan 2026 12:32:32 +0000 (13:32 +0100)
Currently, HCLGE_FD_AD_QID has only 10 bits and supports a
maximum of 1023 queues. However, there are actually scenarios
where the queue_id exceeds 1023.

This patch adds an additional bit to HCLGE_FD_AD_QID to ensure
that queue_id greater than 1023 are supported.

Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Link: https://patch.msgid.link/20260123094756.3718516-2-shaojijie@huawei.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

index 416e02e7b995fc16ce767fa50bee237fcef4fdf6..bc333d8710ac1ad012195856bf3a596ceec1a5e3 100644 (file)
@@ -727,8 +727,8 @@ struct hclge_fd_tcam_config_3_cmd {
 
 #define HCLGE_FD_AD_DROP_B             0
 #define HCLGE_FD_AD_DIRECT_QID_B       1
-#define HCLGE_FD_AD_QID_S              2
-#define HCLGE_FD_AD_QID_M              GENMASK(11, 2)
+#define HCLGE_FD_AD_QID_L_S            2
+#define HCLGE_FD_AD_QID_L_M            GENMASK(11, 2)
 #define HCLGE_FD_AD_USE_COUNTER_B      12
 #define HCLGE_FD_AD_COUNTER_NUM_S      13
 #define HCLGE_FD_AD_COUNTER_NUM_M      GENMASK(19, 13)
@@ -741,6 +741,7 @@ struct hclge_fd_tcam_config_3_cmd {
 #define HCLGE_FD_AD_TC_OVRD_B          16
 #define HCLGE_FD_AD_TC_SIZE_S          17
 #define HCLGE_FD_AD_TC_SIZE_M          GENMASK(20, 17)
+#define HCLGE_FD_AD_QID_H_B            21
 
 struct hclge_fd_ad_config_cmd {
        u8 stage;
index b8e2aa19f9e61458969d9d256e81b814c1d6558f..a90f1a91f9973fc3848bbc3fe494f1a850346bf0 100644 (file)
@@ -5679,11 +5679,13 @@ static int hclge_fd_ad_config(struct hclge_dev *hdev, u8 stage, int loc,
                hnae3_set_field(ad_data, HCLGE_FD_AD_TC_SIZE_M,
                                HCLGE_FD_AD_TC_SIZE_S, (u32)action->tc_size);
        }
+       hnae3_set_bit(ad_data, HCLGE_FD_AD_QID_H_B,
+                     action->queue_id >= HCLGE_TQP_MAX_SIZE_DEV_V2 ? 1 : 0);
        ad_data <<= 32;
        hnae3_set_bit(ad_data, HCLGE_FD_AD_DROP_B, action->drop_packet);
        hnae3_set_bit(ad_data, HCLGE_FD_AD_DIRECT_QID_B,
                      action->forward_to_direct_queue);
-       hnae3_set_field(ad_data, HCLGE_FD_AD_QID_M, HCLGE_FD_AD_QID_S,
+       hnae3_set_field(ad_data, HCLGE_FD_AD_QID_L_M, HCLGE_FD_AD_QID_L_S,
                        action->queue_id);
        hnae3_set_bit(ad_data, HCLGE_FD_AD_USE_COUNTER_B, action->use_counter);
        hnae3_set_field(ad_data, HCLGE_FD_AD_COUNTER_NUM_M,