diff options
author | Ahmed Zaki <ahmed.zaki@intel.com> | 2024-02-02 13:25:20 -0700 |
---|---|---|
committer | Michal Kubecek <mkubecek@suse.cz> | 2024-04-17 22:51:46 +0200 |
commit | a6050b18ba73d76678af5f8df5a7213006231e68 (patch) | |
tree | 525c16fc457a71756f437945dd97193285ea6ef2 /ethtool.c | |
parent | 376e439c92377d317c7fe05876dc7ac7ac47f387 (diff) | |
download | ethtool-a6050b18ba73d76678af5f8df5a7213006231e68.tar.gz |
ethtool: add support for RSS input transformation
Add support for RSS input transformation [1]. Currently, only symmetric-xor
is supported. The user can set the RSS input transformation via:
# ethtool -X <dev> xfrm symmetric-xor
and sets it off (default) by:
# ethtool -X <dev> xfrm none
The status of the transformation is reported by a new section at the end
of "ethtool -x":
# ethtool -x <dev>
.
.
.
.
RSS hash function:
toeplitz: on
xor: off
crc32: off
RSS input transformation:
symmetric-xor: on
Link: https://lore.kernel.org/netdev/20231213003321.605376-1-ahmed.zaki@intel.com/
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Signed-off-by: Ahmed Zaki <ahmed.zaki@intel.com>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'ethtool.c')
-rw-r--r-- | ethtool.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -4029,6 +4029,10 @@ static int do_grxfh(struct cmd_context *ctx) (const char *)hfuncs->data + i * ETH_GSTRING_LEN, (rss->hfunc & (1 << i)) ? "on" : "off"); + printf("RSS input transformation:\n"); + printf(" symmetric-xor: %s\n", + (rss->input_xfrm & RXH_XFRM_SYM_XOR) ? "on" : "off"); + out: free(hfuncs); free(rss); @@ -4146,6 +4150,7 @@ static int do_srxfh(struct cmd_context *ctx) u32 arg_num = 0, indir_bytes = 0; u32 req_hfunc = 0; u32 entry_size = sizeof(rss_head.rss_config[0]); + u32 req_input_xfrm = 0xff; u32 num_weights = 0; u32 rss_context = 0; int delete = 0; @@ -4189,6 +4194,15 @@ static int do_srxfh(struct cmd_context *ctx) if (!req_hfunc_name) exit_bad_args(); ++arg_num; + } else if (!strcmp(ctx->argp[arg_num], "xfrm")) { + ++arg_num; + if (!strcmp(ctx->argp[arg_num], "symmetric-xor")) + req_input_xfrm = RXH_XFRM_SYM_XOR; + else if (!strcmp(ctx->argp[arg_num], "none")) + req_input_xfrm = 0; + else + exit_bad_args(); + ++arg_num; } else if (!strcmp(ctx->argp[arg_num], "context")) { ++arg_num; if(!strcmp(ctx->argp[arg_num], "new")) @@ -4333,6 +4347,7 @@ static int do_srxfh(struct cmd_context *ctx) rss->cmd = ETHTOOL_SRSSH; rss->rss_context = rss_context; rss->hfunc = req_hfunc; + rss->input_xfrm = req_input_xfrm; if (delete) { rss->indir_size = rss->key_size = 0; } else { @@ -5887,6 +5902,7 @@ static const struct option args[] = { " [ equal N | weight W0 W1 ... | default ]\n" " [ hkey %x:%x:%x:%x:%x:.... ]\n" " [ hfunc FUNC ]\n" + " [ xfrm symmetric-xor|none ]\n" " [ delete ]\n" }, { |