aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Kubecek <mkubecek@suse.cz>2024-05-20 02:07:15 +0200
committerMichal Kubecek <mkubecek@suse.cz>2024-05-20 02:08:41 +0200
commita10a96a2ca2899884e8f767bd64a23f464dbe1ae (patch)
tree53c3c7e8102eb6020ace1fa9cf85e0b3416bcf41
parente94cbe5286e3649959a5e1e42604712d8586e84b (diff)
parente7700bcc192c1a184f9fc3a5eee02939392a8f08 (diff)
downloadethtool-upstream-master.tar.gz
Merge branch 'next' into masterupstream-master
- preserve uapi/
-rw-r--r--ethtool.c71
-rw-r--r--shell-completion/bash/ethtool6
2 files changed, 73 insertions, 4 deletions
diff --git a/ethtool.c b/ethtool.c
index 82919f8..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:
@@ -5849,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"
},
{
@@ -5857,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"
diff --git a/shell-completion/bash/ethtool b/shell-completion/bash/ethtool
index 99c5f6f..f7d6aed 100644
--- a/shell-completion/bash/ethtool
+++ b/shell-completion/bash/ethtool
@@ -79,6 +79,8 @@ _ethtool_flow_type()
local types='ah4 ah6 esp4 esp6 ether sctp4 sctp6 tcp4 tcp6 udp4 udp6'
if [ "${1-}" != --hash ]; then
types="$types ip4 ip6"
+ else
+ types="gtpc4 gtpc6 gtpc4t gtpc6t gtpu4 gtpu6 gtpu4e gtpu6e gtpu4u gtpu6u gtpu4d gtpu6d $types"
fi
COMPREPLY=( $( compgen -W "$types" -- "$cur" ) )
}
@@ -171,7 +173,7 @@ _ethtool_change()
return ;;
wol)
# $cur is a set of wol type characters.
- _ethtool_compgen_letterset p u m b a g s f d
+ _ethtool_compgen_letterset p u m b a g s f d e
return ;;
xcvr)
COMPREPLY=( $( compgen -W 'internal external' -- "$cur" ) )
@@ -483,7 +485,7 @@ _ethtool_config_nfc()
_ethtool_flow_type --hash
return ;;
5)
- _ethtool_compgen_letterset m v t s d f n r
+ _ethtool_compgen_letterset m v t s d f n r e
return ;;
6)
COMPREPLY=( $( compgen -W context -- "$cur" ) )