summaryrefslogtreecommitdiffstats
path: root/ethtool.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 02:54:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 02:54:50 +0000
commit9823c0f68c19d7394590bfbbe435d4a5e71303f3 (patch)
treed1e03052b07658f4bf5238fdbdca82c67545e8a1 /ethtool.c
parentAdding upstream version 1:6.7. (diff)
downloadethtool-9823c0f68c19d7394590bfbbe435d4a5e71303f3.tar.xz
ethtool-9823c0f68c19d7394590bfbbe435d4a5e71303f3.zip
Adding upstream version 1:6.9.upstream/1%6.9
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ethtool.c')
-rw-r--r--ethtool.c87
1 files changed, 85 insertions, 2 deletions
diff --git a/ethtool.c b/ethtool.c
index 3ac15a7..e587597 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -360,6 +360,18 @@ static int rxflow_str_to_type(const char *str)
flow_type = AH_ESP_V4_FLOW;
else if (!strcmp(str, "sctp4"))
flow_type = SCTP_V4_FLOW;
+ else if (!strcmp(str, "gtpc4"))
+ flow_type = GTPC_V4_FLOW;
+ else if (!strcmp(str, "gtpc4t"))
+ flow_type = GTPC_TEID_V4_FLOW;
+ else if (!strcmp(str, "gtpu4"))
+ flow_type = GTPU_V4_FLOW;
+ else if (!strcmp(str, "gtpu4e"))
+ flow_type = GTPU_EH_V4_FLOW;
+ else if (!strcmp(str, "gtpu4u"))
+ flow_type = GTPU_UL_V4_FLOW;
+ else if (!strcmp(str, "gtpu4d"))
+ flow_type = GTPU_DL_V4_FLOW;
else if (!strcmp(str, "tcp6"))
flow_type = TCP_V6_FLOW;
else if (!strcmp(str, "udp6"))
@@ -370,6 +382,18 @@ static int rxflow_str_to_type(const char *str)
flow_type = SCTP_V6_FLOW;
else if (!strcmp(str, "ether"))
flow_type = ETHER_FLOW;
+ else if (!strcmp(str, "gtpc6"))
+ flow_type = GTPC_V6_FLOW;
+ else if (!strcmp(str, "gtpc6t"))
+ flow_type = GTPC_TEID_V6_FLOW;
+ else if (!strcmp(str, "gtpu6"))
+ flow_type = GTPU_V6_FLOW;
+ else if (!strcmp(str, "gtpu6e"))
+ flow_type = GTPU_EH_V6_FLOW;
+ else if (!strcmp(str, "gtpu6u"))
+ flow_type = GTPU_UL_V6_FLOW;
+ else if (!strcmp(str, "gtpu6d"))
+ flow_type = GTPU_DL_V6_FLOW;
return flow_type;
}
@@ -1010,6 +1034,9 @@ static int parse_rxfhashopts(char *optstr, u32 *data)
case 'n':
*data |= RXH_L4_B_2_3;
break;
+ case 'e':
+ *data |= RXH_GTP_TEID;
+ break;
case 'r':
*data |= RXH_DISCARD;
break;
@@ -1042,6 +1069,8 @@ static char *unparse_rxfhashopts(u64 opts)
strcat(buf, "L4 bytes 0 & 1 [TCP/UDP src port]\n");
if (opts & RXH_L4_B_2_3)
strcat(buf, "L4 bytes 2 & 3 [TCP/UDP dst port]\n");
+ if (opts & RXH_GTP_TEID)
+ strcat(buf, "GTP TEID\n");
} else {
sprintf(buf, "None");
}
@@ -1559,6 +1588,24 @@ static int dump_rxfhash(int fhash, u64 val)
case SCTP_V4_FLOW:
fprintf(stdout, "SCTP over IPV4 flows");
break;
+ case GTPC_V4_FLOW:
+ fprintf(stdout, "GTP-C over IPV4 flows");
+ break;
+ case GTPC_TEID_V4_FLOW:
+ fprintf(stdout, "GTP-C (include TEID) over IPV4 flows");
+ break;
+ case GTPU_V4_FLOW:
+ fprintf(stdout, "GTP-U over IPV4 flows");
+ break;
+ case GTPU_EH_V4_FLOW:
+ fprintf(stdout, "GTP-U and Extension Header over IPV4 flows");
+ break;
+ case GTPU_UL_V4_FLOW:
+ fprintf(stdout, "GTP-U PSC Uplink over IPV4 flows");
+ break;
+ case GTPU_DL_V4_FLOW:
+ fprintf(stdout, "GTP-U PSC Downlink over IPV4 flows");
+ break;
case AH_ESP_V4_FLOW:
case AH_V4_FLOW:
case ESP_V4_FLOW:
@@ -1573,6 +1620,24 @@ static int dump_rxfhash(int fhash, u64 val)
case SCTP_V6_FLOW:
fprintf(stdout, "SCTP over IPV6 flows");
break;
+ case GTPC_V6_FLOW:
+ fprintf(stdout, "GTP-C over IPV6 flows");
+ break;
+ case GTPC_TEID_V6_FLOW:
+ fprintf(stdout, "GTP-C (include TEID) over IPV6 flows");
+ break;
+ case GTPU_V6_FLOW:
+ fprintf(stdout, "GTP-U over IPV6 flows");
+ break;
+ case GTPU_EH_V6_FLOW:
+ fprintf(stdout, "GTP-U and Extension Header over IPV6 flows");
+ break;
+ case GTPU_UL_V6_FLOW:
+ fprintf(stdout, "GTP-U PSC Uplink over IPV6 flows");
+ break;
+ case GTPU_DL_V6_FLOW:
+ fprintf(stdout, "GTP-U PSC Downlink over IPV6 flows");
+ break;
case AH_ESP_V6_FLOW:
case AH_V6_FLOW:
case ESP_V6_FLOW:
@@ -4029,6 +4094,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 +4215,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 +4259,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 +4412,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 {
@@ -5834,7 +5914,8 @@ static const struct option args[] = {
.func = do_grxclass,
.help = "Show Rx network flow classification options or rules",
.xhelp = " [ rx-flow-hash tcp4|udp4|ah4|esp4|sctp4|"
- "tcp6|udp6|ah6|esp6|sctp6 [context %d] |\n"
+ "gtpc4|gtpc4t|gtpu4|gtpu4e|gtpu4u|gtpu4d|tcp6|udp6|ah6|esp6|sctp6|"
+ "gtpc6|gtpc6t|gtpu6|gtpu6e|gtpu6u|gtpu6d [context %d] |\n"
" rule %d ]\n"
},
{
@@ -5842,7 +5923,8 @@ static const struct option args[] = {
.func = do_srxclass,
.help = "Configure Rx network flow classification options or rules",
.xhelp = " rx-flow-hash tcp4|udp4|ah4|esp4|sctp4|"
- "tcp6|udp6|ah6|esp6|sctp6 m|v|t|s|d|f|n|r... [context %d] |\n"
+ "gtpc4|gtpc4t|gtpu4|gtpu4e|gtpu4u|gtpu4d|tcp6|udp6|ah6|esp6|sctp6"
+ "|gtpc6|gtpc6t|gtpu6|gtpu6e|gtpu6u|gtpu6d m|v|t|s|d|f|n|r|e... [context %d] |\n"
" flow-type ether|ip4|tcp4|udp4|sctp4|ah4|esp4|"
"ip6|tcp6|udp6|ah6|esp6|sctp6\n"
" [ src %x:%x:%x:%x:%x:%x [m %x:%x:%x:%x:%x:%x] ]\n"
@@ -5887,6 +5969,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"
},
{