From: Haiyang Zhang Add support to get/set RX CQE Coalescing parameters, including the max frames and time out value in nanoseconds. (Headers: dc3d720e12f6 "net: ethtool: add ethtool COALESCE_RX_CQE_FRAMES/NSECS") Signed-off-by: Haiyang Zhang --- ethtool.8.in | 2 ++ ethtool.c | 2 ++ netlink/coalesce.c | 17 +++++++++++++++++ netlink/desc-ethtool.c | 2 ++ shell-completion/bash/ethtool | 2 ++ 5 files changed, 25 insertions(+) diff --git a/ethtool.8.in b/ethtool.8.in index e10a252..fe3c0ec 100644 --- a/ethtool.8.in +++ b/ethtool.8.in @@ -198,6 +198,8 @@ ethtool \- query or control network driver and hardware settings .BN tx\-aggr\-max\-bytes .BN tx\-aggr\-max\-frames .BN tx\-aggr\-time\-usecs +.BN rx\-cqe\-frames +.BN rx\-cqe\-nsecs .HP .B ethtool \-g|\-\-show\-ring .I devname diff --git a/ethtool.c b/ethtool.c index c9c1502..2444d85 100644 --- a/ethtool.c +++ b/ethtool.c @@ -5925,6 +5925,8 @@ static const struct option args[] = { " [tx-aggr-max-bytes N]\n" " [tx-aggr-max-frames N]\n" " [tx-aggr-time-usecs N]\n" + " [rx-cqe-frames N]\n" + " [rx-cqe-nsecs N]\n" }, { .opts = "-g|--show-ring", diff --git a/netlink/coalesce.c b/netlink/coalesce.c index bc8b57b..f36b8e8 100644 --- a/netlink/coalesce.c +++ b/netlink/coalesce.c @@ -96,6 +96,11 @@ int coalesce_reply_cb(const struct nlmsghdr *nlhdr, void *data) show_u32("tx-aggr-time-usecs", "tx-aggr-time-usecs:\t", tb[ETHTOOL_A_COALESCE_TX_AGGR_TIME_USECS]); show_cr(); + show_u32("rx-cqe-frames", "rx-cqe-frames:\t\t", + tb[ETHTOOL_A_COALESCE_RX_CQE_FRAMES]); + show_u32("rx-cqe-nsecs", "rx-cqe-nsecs:\t\t", + tb[ETHTOOL_A_COALESCE_RX_CQE_NSECS]); + show_cr(); close_json_object(); @@ -292,6 +297,18 @@ static const struct param_parser scoalesce_params[] = { .handler = nl_parse_direct_u32, .min_argc = 1, }, + { + .arg = "rx-cqe-frames", + .type = ETHTOOL_A_COALESCE_RX_CQE_FRAMES, + .handler = nl_parse_direct_u32, + .min_argc = 1, + }, + { + .arg = "rx-cqe-nsecs", + .type = ETHTOOL_A_COALESCE_RX_CQE_NSECS, + .handler = nl_parse_direct_u32, + .min_argc = 1, + }, {} }; diff --git a/netlink/desc-ethtool.c b/netlink/desc-ethtool.c index 8289190..08d94de 100644 --- a/netlink/desc-ethtool.c +++ b/netlink/desc-ethtool.c @@ -249,6 +249,8 @@ static const struct pretty_nla_desc __coalesce_desc[] = { NLATTR_DESC_U32(ETHTOOL_A_COALESCE_TX_AGGR_TIME_USECS), NLATTR_DESC_NESTED(ETHTOOL_A_COALESCE_RX_PROFILE, profile), NLATTR_DESC_NESTED(ETHTOOL_A_COALESCE_TX_PROFILE, profile), + NLATTR_DESC_U32(ETHTOOL_A_COALESCE_RX_CQE_FRAMES), + NLATTR_DESC_U32(ETHTOOL_A_COALESCE_RX_CQE_NSECS), }; static const struct pretty_nla_desc __pause_stats_desc[] = { diff --git a/shell-completion/bash/ethtool b/shell-completion/bash/ethtool index 3c775a1..57c39c4 100644 --- a/shell-completion/bash/ethtool +++ b/shell-completion/bash/ethtool @@ -259,6 +259,8 @@ _ethtool_coalesce() [tx-aggr-max-bytes]=1 [tx-aggr-max-frames]=1 [tx-aggr-time-usecs]=1 + [rx-cqe-frames]=1 + [rx-cqe-nsecs]=1 ) case "$prev" in -- 2.34.1