]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
hinic: remove unused ethtool RSS user configuration buffers
authorChenguang Zhao <zhaochenguang@kylinos.cn>
Wed, 22 Jul 2026 02:53:53 +0000 (10:53 +0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 23 Jul 2026 14:10:10 +0000 (07:10 -0700)
rss_indir_user and rss_hkey_user are allocated and filled in
__set_rss_rxfh() when the user configures RSS via ethtool, but
nothing ever reads them. hinic_get_rxfh() fetches the state from
the device, and the hardware is programmed from the original
indir/key arguments. These buffers only leaked on driver unload.

Drop the unused allocations, memcpys, and struct fields.

Fixes: 4fdc51bb4e92 ("hinic: add support for rss parameters with ethtool")
Signed-off-by: Chenguang Zhao <zhaochenguang@kylinos.cn>
Reviewed-by: Joe Damato <joe@dama.to>
Link: https://patch.msgid.link/20260722025353.328179-1-chenguang.zhao@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/huawei/hinic/hinic_dev.h
drivers/net/ethernet/huawei/hinic/hinic_ethtool.c

index 52ea97c818b8ec0190c1b2bf6a8259cf382645ab..d9ab94910a2a790f3fb3ccabc1613ddec0240717 100644 (file)
@@ -104,8 +104,6 @@ struct hinic_dev {
        u16                             num_rss;
        u16                             rss_limit;
        struct hinic_rss_type           rss_type;
-       u8                              *rss_hkey_user;
-       s32                             *rss_indir_user;
        struct hinic_intr_coal_info     *rx_intr_coalesce;
        struct hinic_intr_coal_info     *tx_intr_coalesce;
        struct hinic_sriov_info sriov_info;
index a8b129ce1b7e9f82f488b7992c144f09e6d0a04b..f75e8563f23aee573d19986327035f688c5310a2 100644 (file)
@@ -1064,17 +1064,6 @@ static int __set_rss_rxfh(struct net_device *netdev,
        int err;
 
        if (indir) {
-               if (!nic_dev->rss_indir_user) {
-                       nic_dev->rss_indir_user =
-                               kzalloc(sizeof(u32) * HINIC_RSS_INDIR_SIZE,
-                                       GFP_KERNEL);
-                       if (!nic_dev->rss_indir_user)
-                               return -ENOMEM;
-               }
-
-               memcpy(nic_dev->rss_indir_user, indir,
-                      sizeof(u32) * HINIC_RSS_INDIR_SIZE);
-
                err = hinic_rss_set_indir_tbl(nic_dev,
                                              nic_dev->rss_tmpl_idx, indir);
                if (err)
@@ -1082,16 +1071,6 @@ static int __set_rss_rxfh(struct net_device *netdev,
        }
 
        if (key) {
-               if (!nic_dev->rss_hkey_user) {
-                       nic_dev->rss_hkey_user =
-                               kzalloc(HINIC_RSS_KEY_SIZE * 2, GFP_KERNEL);
-
-                       if (!nic_dev->rss_hkey_user)
-                               return -ENOMEM;
-               }
-
-               memcpy(nic_dev->rss_hkey_user, key, HINIC_RSS_KEY_SIZE);
-
                err = hinic_rss_set_template_tbl(nic_dev,
                                                 nic_dev->rss_tmpl_idx, key);
                if (err)