]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
ethtool: add support to set/get tx copybreak buf size via ethtool
authorHao Chen <chenhao288@hisilicon.com>
Thu, 18 Nov 2021 12:12:40 +0000 (20:12 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 22 Nov 2021 12:31:47 +0000 (12:31 +0000)
Add support for ethtool to set/get tx copybreak buf size.

Signed-off-by: Hao Chen <chenhao288@hisilicon.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/uapi/linux/ethtool.h
net/ethtool/common.c
net/ethtool/ioctl.c

index a2223b68545193c4a5000d420a75d63a44df96b3..7bc4b8def12c928c249239aa8037e2ad976641fb 100644 (file)
@@ -231,6 +231,7 @@ enum tunable_id {
        ETHTOOL_RX_COPYBREAK,
        ETHTOOL_TX_COPYBREAK,
        ETHTOOL_PFC_PREVENTION_TOUT, /* timeout in msecs */
+       ETHTOOL_TX_COPYBREAK_BUF_SIZE,
        /*
         * Add your fresh new tunable attribute above and remember to update
         * tunable_strings[] in net/ethtool/common.c
index c63e0739dc6acd59d599c157a5eb14740372eb1f..0c52100159111fc6c777ea8cdc9e9195ee0c68e6 100644 (file)
@@ -89,6 +89,7 @@ tunable_strings[__ETHTOOL_TUNABLE_COUNT][ETH_GSTRING_LEN] = {
        [ETHTOOL_RX_COPYBREAK]  = "rx-copybreak",
        [ETHTOOL_TX_COPYBREAK]  = "tx-copybreak",
        [ETHTOOL_PFC_PREVENTION_TOUT] = "pfc-prevention-tout",
+       [ETHTOOL_TX_COPYBREAK_BUF_SIZE] = "tx-copybreak-buf-size",
 };
 
 const char
index 65e9bc1058b57c5238e3fccf9316bc8d7b6268d3..5c5f170a98512bf9f29f66b20c0cecd1b949a4ec 100644 (file)
@@ -2396,6 +2396,7 @@ static int ethtool_tunable_valid(const struct ethtool_tunable *tuna)
        switch (tuna->id) {
        case ETHTOOL_RX_COPYBREAK:
        case ETHTOOL_TX_COPYBREAK:
+       case ETHTOOL_TX_COPYBREAK_BUF_SIZE:
                if (tuna->len != sizeof(u32) ||
                    tuna->type_id != ETHTOOL_TUNABLE_U32)
                        return -EINVAL;