diff options
author | Subbaraya Sundeep <sbhatta@marvell.com> | 2022-05-26 16:48:45 +0530 |
---|---|---|
committer | Michal Kubecek <mkubecek@suse.cz> | 2022-06-13 23:55:26 +0200 |
commit | 6b320b804fb96363f1412057c908f0ec1c97f4ef (patch) | |
tree | f3d56e0f2dd96d437d6a6ca73047aff7a2fed6df | |
parent | 41fddc0eb01fcd8c5a47b415d3faecd714652513 (diff) | |
download | ethtool-6b320b804fb96363f1412057c908f0ec1c97f4ef.tar.gz |
rings: add support to set/get cqe size
After a packet is sent or received by NIC then NIC posts
a completion queue event which consists of transmission status
(like send success or error) and received status(like
pointers to packet fragments). These completion events may
also use a ring similar to rx and tx rings. This patch
introduces cqe-size ethtool parameter to modify the size
of the completion queue event if NIC hardware has that capability.
With this patch in place, cqe size can be set via
"ethtool -G <dev> cqe-size xxx" and get via "ethtool -g <dev>".
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
-rw-r--r-- | ethtool.8.in | 4 | ||||
-rw-r--r-- | ethtool.c | 1 | ||||
-rw-r--r-- | netlink/rings.c | 7 |
3 files changed, 12 insertions, 0 deletions
diff --git a/ethtool.8.in b/ethtool.8.in index e157776..2e2f756 100644 --- a/ethtool.8.in +++ b/ethtool.8.in @@ -199,6 +199,7 @@ ethtool \- query or control network driver and hardware settings .BN rx\-jumbo .BN tx .BN rx\-buf\-len +.BN cqe\-size .HP .B ethtool \-i|\-\-driver .I devname @@ -573,6 +574,9 @@ Changes the number of ring entries for the Tx ring. .TP .BI rx\-buf\-len \ N Changes the size of a buffer in the Rx ring. +.TP +.BI cqe\-size \ N +Changes the size of completion queue event. .RE .TP .B \-i \-\-driver @@ -5733,6 +5733,7 @@ static const struct option args[] = { " [ rx-jumbo N ]\n" " [ tx N ]\n" " [ rx-buf-len N]\n" + " [ cqe-size N]\n" }, { .opts = "-k|--show-features|--show-offload", diff --git a/netlink/rings.c b/netlink/rings.c index 119178e..becb1cd 100644 --- a/netlink/rings.c +++ b/netlink/rings.c @@ -47,6 +47,7 @@ int rings_reply_cb(const struct nlmsghdr *nlhdr, void *data) show_u32(tb[ETHTOOL_A_RINGS_RX_JUMBO], "RX Jumbo:\t"); show_u32(tb[ETHTOOL_A_RINGS_TX], "TX:\t\t"); show_u32(tb[ETHTOOL_A_RINGS_RX_BUF_LEN], "RX Buf Len:\t\t"); + show_u32(tb[ETHTOOL_A_RINGS_CQE_SIZE], "CQE Size:\t\t"); return MNL_CB_OK; } @@ -105,6 +106,12 @@ static const struct param_parser sring_params[] = { .handler = nl_parse_direct_u32, .min_argc = 1, }, + { + .arg = "cqe-size", + .type = ETHTOOL_A_RINGS_CQE_SIZE, + .handler = nl_parse_direct_u32, + .min_argc = 1, + }, {} }; |