ethtool: ice: Support for RSS settings to GTP from ethtool
Subsystems (5)
PATCH v6 1/1 ethtool: ice: Support for RSS settings to GTP from ethtool
This is a patch that enables RSS functionality for GTP packets using ethtool.
A user can include TEID and make RSS work for GTP-U over IPv4 by doing the following:ethtool -N ens3 rx-flow-hash gtpu4 sde
In addition to gtpu(4|6), we now support gtpc(4|6),gtpc(4|6)t,gtpu(4|6)e, gtpu(4|6)u, and gtpu(4|6)d.
gtpc(4|6): Used for GTP-C in IPv4 and IPv6, where the GTP header format does not include a TEID.
gtpc(4|6)t: Used for GTP-C in IPv4 and IPv6, with a GTP header format that includes a TEID.
gtpu(4|6): Used for GTP-U in both IPv4 and IPv6 scenarios. gtpu(4|6)e: Used for GTP-U with extended headers in both IPv4 and IPv6. gtpu(4|6)u: Used when the PSC (PDU session container) in the GTP-U extended
header includes Uplink, applicable to both IPv4 and IPv6. gtpu(4|6)d: Used when the PSC in the GTP-U extended header includes Downlink, for both IPv4 and IPv6.
GTP generates a flow that includes an ID called TEID to identify the tunnel. This tunnel is created for each UE (User Equipment).By performing RSS based on this flow, it is possible to apply RSS for each communication unit from the UE. Without this, RSS would only be effective within the range of IP addresses. For instance, the PGW can only perform RSS within the IP range of the SGW. Problematic from a load distribution perspective, especially if there's a bias in the terminals connected to a particular base station.This case can be solved by using this patch.
---v2->v3: Based on Harald-san's review, I added documentation and comments to ethtool.h and ice.rst.v3->v4: Based on Marcin-san's review, I added the missing code for GTPC and GTPC_TEID, and revised the documentation and comments.v4->v5: Based on Marcin-san's review, I fixed rename and wrong code regarding GTPCv5->v6: Based on Marcin-san's review, Undoing the addition of unnecessary blank lines.Minor fixes.
.../device_drivers/ethernet/intel/ice.rst | 21 ++++- drivers/net/ethernet/intel/ice/ice_ethtool.c | 82 +++++++++++++++++++ drivers/net/ethernet/intel/ice/ice_flow.h | 31 +++++-- drivers/net/ethernet/intel/ice/ice_lib.c | 37 +++++++++ include/uapi/linux/ethtool.h | 48 +++++++++++ 5 files changed, 210 insertions(+), 9 deletions(-)
Documentation/networking/device_drivers/ethernet/intel/ice.rst +17 -4
@@ -368,15 +368,28 @@ more options for Receive Side Scaling (RSS) hash byte configuration. # ethtool -N <ethX> rx-flow-hash <type> <option> Where <type> is: - tcp4 signifying TCP over IPv4 - udp4 signifying UDP over IPv4 - tcp6 signifying TCP over IPv6 - udp6 signifying UDP over IPv6 + tcp4 signifying TCP over IPv4 + udp4 signifying UDP over IPv4 + gtpc4 signifying GTP-C over IPv4 + gtpc4t signifying GTP-C (include TEID) over IPv4 + gtpu4 signifying GTP-U over IPV4 + gtpu4e signifying GTP-U and Extension Header over IPV4 + gtpu4u signifying GTP-U PSC Uplink over IPV4 + gtpu4d signifying GTP-U PSC Downlink over IPV4 + tcp6 signifying TCP over IPv6 + udp6 signifying UDP over IPv6 + gtpc6 signifying GTP-C over IPv6 + gtpc6t signifying GTP-C (include TEID) over IPv6 + gtpu6 signifying GTP-U over IPV6 + gtpu6e signifying GTP-U and Extension Header over IPV6 + gtpu6u signifying GTP-U PSC Uplink over IPV6 + gtpu6d signifying GTP-U PSC Downlink over IPV6 And <option> is one or more of: s Hash on the IP source address of the Rx packet. d Hash on the IP destination address of the Rx packet. f Hash on bytes 0 and 1 of the Layer 4 header of the Rx packet. n Hash on bytes 2 and 3 of the Layer 4 header of the Rx packet. + e Hash on GTP Packet on TEID (4bytes) of the Rx packet. Accelerated Receive Flow Steering (aRFS)
drivers/net/ethernet/intel/ice/ice_ethtool.c +82 -0
118 lines not on this page · raw message
drivers/net/ethernet/intel/ice/ice_flow.h +26 -5
@@ -37,13 +37,13 @@#define ICE_HASH_SCTP_IPV4 (ICE_FLOW_HASH_IPV4 | ICE_FLOW_HASH_SCTP_PORT)#define ICE_HASH_SCTP_IPV6 (ICE_FLOW_HASH_IPV6 | ICE_FLOW_HASH_SCTP_PORT) -#define ICE_FLOW_HASH_GTP_TEID \ +#define ICE_FLOW_HASH_GTP_C_TEID \ (BIT_ULL(ICE_FLOW_FIELD_IDX_GTPC_TEID)) -#define ICE_FLOW_HASH_GTP_IPV4_TEID \ - (ICE_FLOW_HASH_IPV4 | ICE_FLOW_HASH_GTP_TEID) -#define ICE_FLOW_HASH_GTP_IPV6_TEID \ - (ICE_FLOW_HASH_IPV6 | ICE_FLOW_HASH_GTP_TEID) +#define ICE_FLOW_HASH_GTP_C_IPV4_TEID \ + (ICE_FLOW_HASH_IPV4 | ICE_FLOW_HASH_GTP_C_TEID) +#define ICE_FLOW_HASH_GTP_C_IPV6_TEID \ + (ICE_FLOW_HASH_IPV6 | ICE_FLOW_HASH_GTP_C_TEID)#define ICE_FLOW_HASH_GTP_U_TEID \ (BIT_ULL(ICE_FLOW_FIELD_IDX_GTPU_IP_TEID))
@@ -66,6 +66,20 @@ (ICE_FLOW_HASH_IPV6 |ICE_FLOW_HASH_GTP_U_EH_TEID | \ ICE_FLOW_HASH_GTP_U_EH_QFI) +#define ICE_FLOW_HASH_GTP_U_UP \ + (BIT_ULL(ICE_FLOW_FIELD_IDX_GTPU_UP_TEID)) +#define ICE_FLOW_HASH_GTP_U_DWN \ + (BIT_ULL(ICE_FLOW_FIELD_IDX_GTPU_DWN_TEID)) + +#define ICE_FLOW_HASH_GTP_U_IPV4_UP \ + (ICE_FLOW_HASH_IPV4 | ICE_FLOW_HASH_GTP_U_UP) +#define ICE_FLOW_HASH_GTP_U_IPV6_UP \ + (ICE_FLOW_HASH_IPV6 | ICE_FLOW_HASH_GTP_U_UP) +#define ICE_FLOW_HASH_GTP_U_IPV4_DWN \ + (ICE_FLOW_HASH_IPV4 | ICE_FLOW_HASH_GTP_U_DWN) +#define ICE_FLOW_HASH_GTP_U_IPV6_DWN \ + (ICE_FLOW_HASH_IPV6 | ICE_FLOW_HASH_GTP_U_DWN) +#define ICE_FLOW_HASH_PPPOE_SESS_ID \ (BIT_ULL(ICE_FLOW_FIELD_IDX_PPPOE_SESS_ID))
@@ -242,6 +256,13 @@ enum ice_flow_field {#define ICE_FLOW_HASH_FLD_SCTP_DST_PORT \ BIT_ULL(ICE_FLOW_FIELD_IDX_SCTP_DST_PORT) +#define ICE_FLOW_HASH_FLD_GTPC_TEID BIT_ULL(ICE_FLOW_FIELD_IDX_GTPC_TEID) +#define ICE_FLOW_HASH_FLD_GTPU_IP_TEID BIT_ULL(ICE_FLOW_FIELD_IDX_GTPU_IP_TEID) +#define ICE_FLOW_HASH_FLD_GTPU_EH_TEID BIT_ULL(ICE_FLOW_FIELD_IDX_GTPU_EH_TEID) +#define ICE_FLOW_HASH_FLD_GTPU_UP_TEID BIT_ULL(ICE_FLOW_FIELD_IDX_GTPU_UP_TEID) +#define ICE_FLOW_HASH_FLD_GTPU_DWN_TEID \ + BIT_ULL(ICE_FLOW_FIELD_IDX_GTPU_DWN_TEID) +/* Flow headers and fields for AVF support */ enum ice_flow_avf_hdr_field {/* Values 0 - 28 are reserved for future use */
drivers/net/ethernet/intel/ice/ice_lib.c +37 -0
@@ -1618,6 +1618,25 @@ static const struct ice_rss_hash_cfg default_rss_cfgs[] = {*/ {ICE_FLOW_SEG_HDR_SCTP |ICE_FLOW_SEG_HDR_IPV4 , ICE_HASH_SCTP_IPV4, ICE_RSS_OUTER_HEADERS, false}, +/* configure RSS for gtpc4 with input set IPv4 src/dst */ + {ICE_FLOW_SEG_HDR_GTPC | ICE_FLOW_SEG_HDR_IPV4, + ICE_FLOW_HASH_IPV4, ICE_RSS_OUTER_HEADERS, false}, +/* configure RSS for gtpc4t with input set IPv4 src/dst */ + {ICE_FLOW_SEG_HDR_GTPC_TEID | ICE_FLOW_SEG_HDR_IPV4, + ICE_FLOW_HASH_GTP_C_IPV4_TEID, ICE_RSS_OUTER_HEADERS, false}, +/* configure RSS for gtpu4 with input set IPv4 src/dst */ + {ICE_FLOW_SEG_HDR_GTPU_IP | ICE_FLOW_SEG_HDR_IPV4, + ICE_FLOW_HASH_GTP_U_IPV4_TEID, ICE_RSS_OUTER_HEADERS, false}, +/* configure RSS for gtpu4e with input set IPv4 src/dst */ + {ICE_FLOW_SEG_HDR_GTPU_EH | ICE_FLOW_SEG_HDR_IPV4, + ICE_FLOW_HASH_GTP_U_IPV4_EH, ICE_RSS_OUTER_HEADERS, false}, +/* configure RSS for gtpu4u with input set IPv4 src/dst */ + { ICE_FLOW_SEG_HDR_GTPU_UP | ICE_FLOW_SEG_HDR_IPV4, + ICE_FLOW_HASH_GTP_U_IPV4_UP, ICE_RSS_OUTER_HEADERS, false}, +/* configure RSS for gtpu4d with input set IPv4 src/dst */ + {ICE_FLOW_SEG_HDR_GTPU_DWN | ICE_FLOW_SEG_HDR_IPV4, + ICE_FLOW_HASH_GTP_U_IPV4_DWN, ICE_RSS_OUTER_HEADERS, false}, +/* configure RSS for tcp6 with input set IPv6 src/dst, TCP src/dst */ {ICE_FLOW_SEG_HDR_TCP | ICE_FLOW_SEG_HDR_IPV6, ICE_HASH_TCP_IPV6, ICE_RSS_ANY_HEADERS, false},
@@ -1632,6 +1651,24 @@ static const struct ice_rss_hash_cfg default_rss_cfgs[] = {/* configure RSS for IPSEC ESP SPI with input set MAC_IPV4_SPI */ {ICE_FLOW_SEG_HDR_ESP , ICE_FLOW_HASH_ESP_SPI, ICE_RSS_OUTER_HEADERS, false}, +/* configure RSS for gtpc6 with input set IPv6 src/dst */ + {ICE_FLOW_SEG_HDR_GTPC | ICE_FLOW_SEG_HDR_IPV6, + ICE_FLOW_HASH_IPV6, ICE_RSS_OUTER_HEADERS, false}, +/* configure RSS for gtpc6t with input set IPv6 src/dst */ + {ICE_FLOW_SEG_HDR_GTPC_TEID | ICE_FLOW_SEG_HDR_IPV6, + ICE_FLOW_HASH_GTP_C_IPV6_TEID, ICE_RSS_OUTER_HEADERS, false}, +/* configure RSS for gtpu6 with input set IPv6 src/dst */ + {ICE_FLOW_SEG_HDR_GTPU_IP | ICE_FLOW_SEG_HDR_IPV6, + ICE_FLOW_HASH_GTP_U_IPV6_TEID, ICE_RSS_OUTER_HEADERS, false}, +/* configure RSS for gtpu6e with input set IPv6 src/dst */ + {ICE_FLOW_SEG_HDR_GTPU_EH | ICE_FLOW_SEG_HDR_IPV6, + ICE_FLOW_HASH_GTP_U_IPV6_EH, ICE_RSS_OUTER_HEADERS, false}, +/* configure RSS for gtpu6u with input set IPv6 src/dst */ + { ICE_FLOW_SEG_HDR_GTPU_UP | ICE_FLOW_SEG_HDR_IPV6, + ICE_FLOW_HASH_GTP_U_IPV6_UP, ICE_RSS_OUTER_HEADERS, false}, +/* configure RSS for gtpu6d with input set IPv6 src/dst */ + {ICE_FLOW_SEG_HDR_GTPU_DWN | ICE_FLOW_SEG_HDR_IPV6, + ICE_FLOW_HASH_GTP_U_IPV6_DWN, ICE_RSS_OUTER_HEADERS, false}, };/**
include/uapi/linux/ethtool.h +48 -0
60 lines not on this page · raw message
Signature · 1 line
2.34.1
Jakub Kicinski
maintainerQuoted 5 lines · On Wed, 31 Jan 2024 13:46:22 +0000 Takeru Hayasaka wrote:
.../device_drivers/ethernet/intel/ice.rst | 21 ++++- drivers/net/ethernet/intel/ice/ice_ethtool.c | 82 +++++++++++++++++++ drivers/net/ethernet/intel/ice/ice_flow.h | 31 +++++-- drivers/net/ethernet/intel/ice/ice_lib.c | 37 +++++++++ include/uapi/linux/ethtool.h | 48 +++++++++++
Could you split the uAPI changes and the driver changes to two separate commits? You should post them as a patch series, but combining them into a single commit makes the uAPI addition to easy to miss.
Signature · 1 line
pw-bot: cr
Hi Jakub-san
Thank you for your review.
I apologize for the delay in resubmitting the patch.
Quoted 3 lines
Could you split the uAPI changes and the driver changes to two separate commits? You should post them as a patch series, but combining them into a single commit makes the uAPI addition to easy to miss.
Understood. I will split the patches and submit them separately in v7.
Thanks
Takeru
2024年2月1日(木) 6:13 Jakub Kicinski <[email protected]>:
Quoted 13 lines · On Wed, 31 Jan 2024 13:46:22 +0000 Takeru Hayasaka wrote:
Quoted 5 lines
.../device_drivers/ethernet/intel/ice.rst | 21 ++++- drivers/net/ethernet/intel/ice/ice_ethtool.c | 82 +++++++++++++++++++ drivers/net/ethernet/intel/ice/ice_flow.h | 31 +++++-- drivers/net/ethernet/intel/ice/ice_lib.c | 37 +++++++++ include/uapi/linux/ethtool.h | 48 +++++++++++Could you split the uAPI changes and the driver changes to two separate commits? You should post them as a patch series, but combining them into a single commit makes the uAPI addition to easy to miss. --
pw-bot: cr
Hello Jakub-san, and all reviewers and maintainers,
It has been a week since I last received any feedback on this patch. I apologize for the inconvenience during this busy period, but I would greatly appreciate it if you could continue the review.
Sincerely,
Takeru
2024年2月1日(木) 9:59 takeru hayasaka <[email protected]>:
Quoted 28 lines
Hi Jakub-san
Thank you for your review.
I apologize for the delay in resubmitting the patch.Quoted 3 lines
Could you split the uAPI changes and the driver changes to two separate commits? You should post them as a patch series, but combining them into a single commit makes the uAPI addition to easy to miss.
Understood. I will split the patches and submit them separately in v7.
Thanks
Takeru2024年2月1日(木) 6:13 Jakub Kicinski <[email protected]>:
Quoted 13 lines · On Wed, 31 Jan 2024 13:46:22 +0000 Takeru Hayasaka wrote:
Quoted 5 lines
.../device_drivers/ethernet/intel/ice.rst | 21 ++++- drivers/net/ethernet/intel/ice/ice_ethtool.c | 82 +++++++++++++++++++ drivers/net/ethernet/intel/ice/ice_flow.h | 31 +++++-- drivers/net/ethernet/intel/ice/ice_lib.c | 37 +++++++++ include/uapi/linux/ethtool.h | 48 +++++++++++Could you split the uAPI changes and the driver changes to two separate commits? You should post them as a patch series, but combining them into a single commit makes the uAPI addition to easy to miss. --
pw-bot: cr
Jakub Kicinski
maintainerQuoted 5 lines · On Thu, 8 Feb 2024 16:34:49 +0900 Takeru Hayasaka wrote:
Hello Jakub-san, and all reviewers and maintainers,
It has been a week since I last received any feedback on this patch. I apologize for the inconvenience during this busy period, but I would greatly appreciate it if you could continue the review.
We're expecting a v7 with the patch split into two.
Hi Jakub-san
Thank you for your reply.
Quoted 1 line
We're expecting a v7 with the patch split into two.
I see, I had not informed you that we have released v7. My apologies. The split patch for v7 has already been submitted. Could you please check this link?
https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/
https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/
2024年2月9日(金) 0:23 Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Thu, 8 Feb 2024 16:34:49 +0900 Takeru Hayasaka wrote:
Quoted 5 lines
Hello Jakub-san, and all reviewers and maintainers,
It has been a week since I last received any feedback on this patch. I apologize for the inconvenience during this busy period, but I would greatly appreciate it if you could continue the review.
We're expecting a v7 with the patch split into two.
Simon Horman
reviewerQuoted 11 lines · Takeru Hayasaka
Hi Jakub-san
Thank you for your reply.
Quoted 1 line
We're expecting a v7 with the patch split into two.
I see, I had not informed you that we have released v7. My apologies. The split patch for v7 has already been submitted. Could you please check this link?
https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/
https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/
Hi Hayasaka-san,
It appears that the series at the link above has been marked as "Changes Requested" in patchwork. Although I am unsure why.
I would suggest reposting it, say with the tags supplied by Marcin Szycik as [PATCH net-next v8].
Also, please don't top-post on the Kernel MLs [1]
Hi Simon-san.
Thank you for your reply!
Quoted 5 lines
It appears that the series at the link above has been marked as "Changes Requested" in patchwork. Although I am unsure why.
I would suggest reposting it, say with the tags supplied by Marcin Szycik as [PATCH net-next v8].
I have resent it earlier with version 8, including Marcin-san's Reviewed-by tag.
Quoted 1 line
Also, please don't top-post on the Kernel MLs [1]
My apologies. I wasn't aware of the proper etiquette. I appreciate your guidance.
I was not aware of many things, so please do let me know if there is anything else. Thank you for your advice!
Takeru