[7/9] librte_ethdev: add ESP and AH flow types to RSS

Message ID 1575982632-23059-8-git-send-email-bernard.iremonger@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series net/i40e: ESP support |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Iremonger, Bernard Dec. 10, 2019, 12:57 p.m. UTC
  Add flow types for the following PCTYPE's in the DDP ipsec profile:
14: IPV6 ESP
15: IPV4 ESP
16: IPV6 AH
17: IPV4 AH
18: IPV6 UDP ESP
19: IPV4 UDP ESP

Add the following RSS macros for IPsec:
ETH_RSS_ESP
ETH_RSS_AH
ETH_RSS_IPSEC

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 lib/librte_ethdev/rte_ethdev.h | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)
  

Comments

Stephen Hemminger Dec. 10, 2019, 6:27 p.m. UTC | #1
On Tue, 10 Dec 2019 12:57:10 +0000
Bernard Iremonger <bernard.iremonger@intel.com> wrote:

> Add flow types for the following PCTYPE's in the DDP ipsec profile:
> 14: IPV6 ESP
> 15: IPV4 ESP
> 16: IPV6 AH
> 17: IPV4 AH
> 18: IPV6 UDP ESP
> 19: IPV4 UDP ESP
> 
> Add the following RSS macros for IPsec:
> ETH_RSS_ESP
> ETH_RSS_AH
> ETH_RSS_IPSEC
> 
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
>

The addition of additional flow matching is good but rte_flow still has problems.
1. There is little to know documentation about the semantics. What happens with the N*M combinations of
   possible flow rules, what is accepted and what does hardware do?
2. Mellanox, Intel, and Broadcom keep adding hardware match rules but there is no corresponding
   baseline in software. The SW flow classifier now is a trivial exercise that only matches tuples;
   it does not have any of the complex semantics of the rest of rte_flow.

If this were a standards body, it would be rejected.

Sorry to pick on this patch, but at some point the base infrastructure needs fixing
before allowing more dog piling on of features.
  

Patch

diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 18a9def..39c89cb 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -484,7 +484,13 @@  struct rte_eth_rss_conf {
 #define RTE_ETH_FLOW_NVGRE              21 /**< NVGRE protocol based flow */
 #define RTE_ETH_FLOW_VXLAN_GPE          22 /**< VXLAN-GPE protocol based flow */
 #define RTE_ETH_FLOW_GTPU               23 /**< GTPU protocol based flow */
-#define RTE_ETH_FLOW_MAX                24
+#define RTE_ETH_FLOW_IPV4_AH            24 /**< IPv4 AH protocol based flow */
+#define RTE_ETH_FLOW_IPV4_ESP           25 /**< IPv4 ESP protocol based flow */
+#define RTE_ETH_FLOW_IPV4_UDP_ESP       26 /**< IPv4 UDP ESP proto based flow */
+#define RTE_ETH_FLOW_IPV6_AH            27 /**< IPv6 AH protocol based flow */
+#define RTE_ETH_FLOW_IPV6_ESP           28 /**< IPv6 ESP protocol based flow */
+#define RTE_ETH_FLOW_IPV6_UDP_ESP       29 /**< IPv6 UDP ESP proto based flow */
+#define RTE_ETH_FLOW_MAX                30
 
 /*
  * Below macros are defined for RSS offload types, they can be used to
@@ -511,6 +517,13 @@  struct rte_eth_rss_conf {
 #define ETH_RSS_GENEVE             (1ULL << 20)
 #define ETH_RSS_NVGRE              (1ULL << 21)
 #define ETH_RSS_GTPU               (1ULL << 23)
+#define ETH_RSS_IPV4_AH            (1ULL << 24)
+#define ETH_RSS_IPV4_ESP           (1ULL << 25)
+#define ETH_RSS_IPV4_UDP_ESP       (1ULL << 26)
+#define ETH_RSS_IPV6_AH            (1ULL << 27)
+#define ETH_RSS_IPV6_ESP           (1ULL << 28)
+#define ETH_RSS_IPV6_UDP_ESP       (1ULL << 29)
+
 
 /*
  * We use the following macros to combine with above ETH_RSS_* for
@@ -571,6 +584,20 @@  rte_eth_rss_hf_refine(uint64_t rss_hf)
 	ETH_RSS_NONFRAG_IPV4_SCTP | \
 	ETH_RSS_NONFRAG_IPV6_SCTP)
 
+#define ETH_RSS_AH ( \
+	ETH_RSS_IPV4_AH | \
+	ETH_RSS_IPV6_AH)
+
+#define ETH_RSS_ESP ( \
+	ETH_RSS_IPV4_ESP | \
+	ETH_RSS_IPV6_ESP | \
+	ETH_RSS_IPV4_UDP_ESP | \
+	ETH_RSS_IPV6_UDP_ESP)
+
+#define ETH_RSS_IPSEC ( \
+	ETH_RSS_AH | \
+	ETH_RSS_ESP)
+
 #define ETH_RSS_TUNNEL ( \
 	ETH_RSS_VXLAN  | \
 	ETH_RSS_GENEVE | \