net/dpaa2: add more RSS distributions
authorVanshika Shukla <vanshika.shukla@nxp.com>
Wed, 6 Oct 2021 17:01:27 +0000 (22:31 +0530)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 7 Oct 2021 12:47:35 +0000 (14:47 +0200)
This patch updates the RSS support to support following additional
distributions:
- VLAN
- ESP
- AH
- PPPOE

Signed-off-by: Vanshika Shukla <vanshika.shukla@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
drivers/net/dpaa2/base/dpaa2_hw_dpni.c
drivers/net/dpaa2/dpaa2_ethdev.h

index 641e702..08f49af 100644 (file)
@@ -210,6 +210,10 @@ dpaa2_distset_to_dpkg_profile_cfg(
        int l2_configured = 0, l3_configured = 0;
        int l4_configured = 0, sctp_configured = 0;
        int mpls_configured = 0;
+       int vlan_configured = 0;
+       int esp_configured = 0;
+       int ah_configured = 0;
+       int pppoe_configured = 0;
 
        memset(kg_cfg, 0, sizeof(struct dpkg_profile_cfg));
        while (req_dist_set) {
@@ -217,6 +221,7 @@ dpaa2_distset_to_dpkg_profile_cfg(
                        dist_field = 1ULL << loop;
                        switch (dist_field) {
                        case ETH_RSS_L2_PAYLOAD:
+                       case ETH_RSS_ETH:
 
                                if (l2_configured)
                                        break;
@@ -231,7 +236,70 @@ dpaa2_distset_to_dpkg_profile_cfg(
                                kg_cfg->extracts[i].extract.from_hdr.type =
                                        DPKG_FULL_FIELD;
                                i++;
-                       break;
+                               break;
+
+                       case ETH_RSS_PPPOE:
+                               if (pppoe_configured)
+                                       break;
+                               kg_cfg->extracts[i].extract.from_hdr.prot =
+                                       NET_PROT_PPPOE;
+                               kg_cfg->extracts[i].extract.from_hdr.field =
+                                       NH_FLD_PPPOE_SID;
+                               kg_cfg->extracts[i].type =
+                                       DPKG_EXTRACT_FROM_HDR;
+                               kg_cfg->extracts[i].extract.from_hdr.type =
+                                       DPKG_FULL_FIELD;
+                               i++;
+                               break;
+
+                       case ETH_RSS_ESP:
+                               if (esp_configured)
+                                       break;
+                               esp_configured = 1;
+
+                               kg_cfg->extracts[i].extract.from_hdr.prot =
+                                       NET_PROT_IPSEC_ESP;
+                               kg_cfg->extracts[i].extract.from_hdr.field =
+                                       NH_FLD_IPSEC_ESP_SPI;
+                               kg_cfg->extracts[i].type =
+                                       DPKG_EXTRACT_FROM_HDR;
+                               kg_cfg->extracts[i].extract.from_hdr.type =
+                                       DPKG_FULL_FIELD;
+                               i++;
+                               break;
+
+                       case ETH_RSS_AH:
+                               if (ah_configured)
+                                       break;
+                               ah_configured = 1;
+
+                               kg_cfg->extracts[i].extract.from_hdr.prot =
+                                       NET_PROT_IPSEC_AH;
+                               kg_cfg->extracts[i].extract.from_hdr.field =
+                                       NH_FLD_IPSEC_AH_SPI;
+                               kg_cfg->extracts[i].type =
+                                       DPKG_EXTRACT_FROM_HDR;
+                               kg_cfg->extracts[i].extract.from_hdr.type =
+                                       DPKG_FULL_FIELD;
+                               i++;
+                               break;
+
+                       case ETH_RSS_C_VLAN:
+                       case ETH_RSS_S_VLAN:
+                               if (vlan_configured)
+                                       break;
+                               vlan_configured = 1;
+
+                               kg_cfg->extracts[i].extract.from_hdr.prot =
+                                       NET_PROT_VLAN;
+                               kg_cfg->extracts[i].extract.from_hdr.field =
+                                       NH_FLD_VLAN_TCI;
+                               kg_cfg->extracts[i].type =
+                                       DPKG_EXTRACT_FROM_HDR;
+                               kg_cfg->extracts[i].extract.from_hdr.type =
+                                       DPKG_FULL_FIELD;
+                               i++;
+                               break;
 
                        case ETH_RSS_MPLS:
 
index 3f34d7e..fdc62ec 100644 (file)
        ETH_RSS_UDP | \
        ETH_RSS_TCP | \
        ETH_RSS_SCTP | \
-       ETH_RSS_MPLS)
+       ETH_RSS_MPLS | \
+       ETH_RSS_C_VLAN | \
+       ETH_RSS_S_VLAN | \
+       ETH_RSS_ESP | \
+       ETH_RSS_AH | \
+       ETH_RSS_PPPOE)
 
 /* LX2 FRC Parsed values (Little Endian) */
 #define DPAA2_PKT_TYPE_ETHER           0x0060