i40e: Add flow director support for IPv6
Subsystems (2)
PATCH v4 1/2 i40e: Add flow director support for IPv6
From: Przemyslaw Patynowski <[email protected]>
Flow director for IPv6 is not supported.
1) Implementation of support for IPv6 flow director.
2) Added handlers for addition of TCP6, UDP6, SCTP6, IPv6.
3) Refactored legacy code to make it more generic.
4) Added packet templates for TCP6, UDP6, SCTP6, IPv6.
5) Added handling of IPv6 source and destination address for flow director.
6) Improved argument passing for source and destination portin TCP6, UDP6 and SCTP6.
7) Added handling of ethtool -n for IPv6, TCP6,UDP6, SCTP6.
8) Used correct bit flag regarding FLEXOFF field of flow director data descriptor.
Without this patch, there would be no support for flow director on IPv6, TCP6, UDP6, SCTP6.
Tested based on x710 datasheet by using:
ethtool -N enp133s0f0 flow-type tcp4 src-port 13 dst-port 37 user-def 0x44142 action 1
ethtool -N enp133s0f0 flow-type tcp6 src-port 13 dst-port 40 user-def 0x44142 action 2
ethtool -N enp133s0f0 flow-type udp4 src-port 20 dst-port 40 user-def 0x44142 action 3
ethtool -N enp133s0f0 flow-type udp6 src-port 25 dst-port 40 user-def 0x44142 action 4
ethtool -N enp133s0f0 flow-type sctp4 src-port 55 dst-port 65 user-def 0x44142 action 5
ethtool -N enp133s0f0 flow-type sctp6 src-port 60 dst-port 40 user-def 0x44142 action 6
ethtool -N enp133s0f0 flow-type ip4 src-ip 1.1.1.1 dst-ip 1.1.1.4 user-def 0x44142 action 7
ethtool -N enp133s0f0 flow-type ip6 src-ip fe80::3efd:feff:fe6f:bbbb dst-ip fe80::3efd:feff:fe6f:aaaa user-def 0x44142 action 8 Then send traffic from client which matches the criteria provided to ethtool.
Observe that packets are redirected to user set queues with ethtool -S <interface>
v2: Fixed sparse warnings
Quoted 3 lines
Quoted 3 lines
drivers/net/ethernet/intel/i40e/i40e_ethtool.c:4117:50: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted__be32@@ got unsigned int @@drivers/net/ethernet/intel/i40e/i40e_ethtool.c:4117:50: sparse: expected restricted__be32drivers/net/ethernet/intel/i40e/i40e_ethtool.c:4117:50: sparse: got unsigned int
--- drivers/net/ethernet/intel/i40e/i40e.h | 9 +- .../net/ethernet/intel/i40e/i40e_ethtool.c | 211 +++++++++- drivers/net/ethernet/intel/i40e/i40e_main.c | 79 +++- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 371 +++++++++++++----- 4 files changed, 551 insertions(+), 119 deletions(-)
drivers/net/ethernet/intel/i40e/i40e.h +8 -1
@@ -209,10 +209,12 @@ struct i40e_fdir_filter {struct hlist_node fdir_node;/* filter ipnut set */ u8 flow_type; -u8 ip4_proto; +u8 ipl4_proto;/* TX packet view of src and dst */ __be32 dst_ip;__be32 src_ip; +__be32 dst_ip6[4 ]; +__be32 src_ip6[4 ];__be16 src_port;__be16 dst_port;__be32 sctp_v_tag;
@@ -470,6 +472,11 @@ struct i40e_pf {u16 fd_sctp4_filter_cnt;u16 fd_ip4_filter_cnt; +u16 fd_tcp6_filter_cnt; +u16 fd_udp6_filter_cnt; +u16 fd_sctp6_filter_cnt; +u16 fd_ip6_filter_cnt; +/* Flexible filter table values that need to be programmed into * hardware, which expects L3 and L4 to be programmed separately. We * need to ensure that the values are in ascended order and don't have
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +194 -17
282 lines not on this page · raw message
drivers/net/ethernet/intel/i40e/i40e_main.c +69 -10
138 lines not on this page · raw message
drivers/net/ethernet/intel/i40e/i40e_txrx.c +280 -91
568 lines not on this page · raw message
Signature · 7 lines
2.17.1 --------------------------------------------------------------------- Intel Technology Poland sp. z o.o. ul. Sowackiego 173 | 80-298 Gdask | Sd Rejonowy Gdask Pnoc | VII Wydzia Gospodarczy Krajowego Rejestru Sdowego - KRS 101882 | NIP 957-07-52-316 | Kapita zakadowy 200.000 PLN. Ta wiadomo wraz z zacznikami jest przeznaczona dla okrelonego adresata i moe zawiera informacje poufne. W razie przypadkowego otrzymania tej wiadomoci, prosimy o powiadomienie nadawcy oraz trwae jej usunicie; jakiekolwiek przegldanie lub rozpowszechnianie jest zabronione. This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.