* [dpdk-dev] [dpdk-dev 0/1] add new rss configuration for ice
@ 2020-03-18 17:12 Jeff Guo
2020-03-18 17:12 ` [dpdk-dev] [dpdk-dev 1/1] net/ice: Support for GTPU down/up rss configure Jeff Guo
0 siblings, 1 reply; 4+ messages in thread
From: Jeff Guo @ 2020-03-18 17:12 UTC (permalink / raw)
To: xiaolong.ye, qi.z.zhang; +Cc: dev, jingjing.wu, yahui.cao, simei.su, jia.guo
add some new protocol rss input set configuration for ice driver,
the protocol input set such as below:
l3-src for gtpu uplink
l3-dst for gtpu downlink
This patchset depends on below patch set.
(1)http://patches.dpdk.org/project/dpdk/list/?series=8962
add RSS configuration for iavf
Jeff Guo (1):
net/ice: Support for GTPU down/up rss configure
drivers/net/ice/ice_hash.c | 59 ++++++++++++++++++++++++++++++++------
1 file changed, 51 insertions(+), 8 deletions(-)
--
2.20.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-dev] [dpdk-dev 1/1] net/ice: Support for GTPU down/up rss configure
2020-03-18 17:12 [dpdk-dev] [dpdk-dev 0/1] add new rss configuration for ice Jeff Guo
@ 2020-03-18 17:12 ` Jeff Guo
2020-04-11 0:18 ` [dpdk-dev] [dpdk-dev v2 0/1] add new rss configuration for ice Jeff Guo
0 siblings, 1 reply; 4+ messages in thread
From: Jeff Guo @ 2020-03-18 17:12 UTC (permalink / raw)
To: xiaolong.ye, qi.z.zhang; +Cc: dev, jingjing.wu, yahui.cao, simei.su, jia.guo
Add GTP PDU uplink/donwlink checking in RSS inpust set configuration,
in order to support l3 src hash for GTPU uplink, while l3 dst hash
for GTPU downlink.
Change-Id: I0cfa92d8bebcfe9ed95444b14549044a01a511d1
Signed-off-by: Jeff Guo <jia.guo@intel.com>
---
drivers/net/ice/ice_hash.c | 59 ++++++++++++++++++++++++++++++++------
1 file changed, 51 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c
index 69d805248..ea73d2501 100644
--- a/drivers/net/ice/ice_hash.c
+++ b/drivers/net/ice/ice_hash.c
@@ -25,6 +25,9 @@
#include "ice_ethdev.h"
#include "ice_generic_flow.h"
+#define GTP_EH_PDU_LINK_UP 1
+#define GTP_EH_PDU_LINK_DWN 0
+
struct rss_type_match_hdr {
uint32_t hdr_mask;
uint64_t eth_rss_hint;
@@ -145,6 +148,10 @@ static struct ice_pattern_match_item ice_hash_pattern_list_comms[] = {
struct ice_hash_match_type ice_hash_type_list[] = {
{ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY, BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_SA)},
{ETH_RSS_IPV4 | ETH_RSS_L3_DST_ONLY, BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_DA)},
+ {ETH_RSS_IPV4 | ETH_RSS_L3_SRC_ONLY | ETH_RSS_GTPU_UP,
+ BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_SA)},
+ {ETH_RSS_IPV4 | ETH_RSS_L3_DST_ONLY | ETH_RSS_GTPU_DWN,
+ BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_DA)},
{ETH_RSS_IPV4, ICE_FLOW_HASH_IPV4},
{ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY, BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_SA) | BIT_ULL(ICE_FLOW_FIELD_IDX_UDP_SRC_PORT)},
{ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY, BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_SA) | BIT_ULL(ICE_FLOW_FIELD_IDX_UDP_DST_PORT)},
@@ -175,6 +182,10 @@ struct ice_hash_match_type ice_hash_type_list[] = {
{ETH_RSS_NONFRAG_IPV4_SCTP, ICE_HASH_SCTP_IPV4},
{ETH_RSS_IPV6 | ETH_RSS_L3_SRC_ONLY, BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_SA)},
{ETH_RSS_IPV6 | ETH_RSS_L3_DST_ONLY, BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_DA)},
+ {ETH_RSS_IPV6 | ETH_RSS_L3_SRC_ONLY | ETH_RSS_GTPU_UP,
+ BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_SA)},
+ {ETH_RSS_IPV6 | ETH_RSS_L3_DST_ONLY | ETH_RSS_GTPU_DWN,
+ BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_DA)},
{ETH_RSS_IPV6, ICE_FLOW_HASH_IPV6},
{ETH_RSS_NONFRAG_IPV6_UDP | ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY, BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_SA) | BIT_ULL(ICE_FLOW_FIELD_IDX_UDP_SRC_PORT)},
{ETH_RSS_NONFRAG_IPV6_UDP | ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY, BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_SA) | BIT_ULL(ICE_FLOW_FIELD_IDX_UDP_DST_PORT)},
@@ -269,21 +280,45 @@ ice_hash_check_inset(const struct rte_flow_item pattern[],
"Not support range");
return -rte_errno;
}
+ }
- /* Ignore spec and mask. */
- if (item->spec || item->mask) {
- rte_flow_error_set(error, EINVAL,
- RTE_FLOW_ERROR_TYPE_ITEM, item,
- "Invalid spec/mask.");
- return -rte_errno;
+ return 0;
+}
+
+static uint64_t
+ice_rss_hf_refine(uint64_t rss_hf, const struct rte_flow_item pattern[],
+ const struct rte_flow_action *action,
+ struct rte_flow_error *error)
+{
+ const struct rte_flow_item *item;
+
+ for (item = pattern; item->type != RTE_FLOW_ITEM_TYPE_END; item++) {
+ if (item->type == RTE_FLOW_ITEM_TYPE_GTP_PSC) {
+ const struct rte_flow_action_rss *rss = action->conf;
+ const struct rte_flow_item_gtp_psc *psc = item->spec;
+
+ if (psc && ((psc->pdu_type == GTP_EH_PDU_LINK_UP &&
+ (rss->types & ETH_RSS_L3_SRC_ONLY)) ||
+ (!psc->pdu_type &&
+ (rss->types & ETH_RSS_L3_DST_ONLY)))) {
+ rss_hf |= psc->pdu_type ? ETH_RSS_GTPU_UP :
+ ETH_RSS_GTPU_DWN;
+ } else {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ITEM_SPEC,
+ pattern,
+ "Invalid input set");
+ return -rte_errno;
+ }
}
}
- return 0;
+ return rss_hf;
}
static int
ice_hash_parse_action(struct ice_pattern_match_item *pattern_match_item,
+ const struct rte_flow_item pattern[],
const struct rte_flow_action actions[],
void **meta,
struct rte_flow_error *error)
@@ -313,6 +348,13 @@ ice_hash_parse_action(struct ice_pattern_match_item *pattern_match_item,
*/
rss_hf = rte_eth_rss_hf_refine(rss_hf);
+ /**
+ * Check the item spec with the rss action and
+ * refine rss hash field.
+ */
+ rss_hf = ice_rss_hf_refine(rss_hf, pattern, action,
+ error);
+
/* Check if pattern is empty. */
if (pattern_match_item->pattern_list !=
pattern_empty && rss->func ==
@@ -440,7 +482,8 @@ ice_hash_parse_pattern_action(__rte_unused struct ice_adapter *ad,
(pattern_match_item->meta))->hdr_mask;
/* Check rss action. */
- ret = ice_hash_parse_action(pattern_match_item, actions, meta, error);
+ ret = ice_hash_parse_action(pattern_match_item, pattern, actions, meta,
+ error);
error:
if (ret)
rte_free(rss_meta_ptr);
--
2.20.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-dev] [dpdk-dev v2 0/1] add new rss configuration for ice
2020-03-18 17:12 ` [dpdk-dev] [dpdk-dev 1/1] net/ice: Support for GTPU down/up rss configure Jeff Guo
@ 2020-04-11 0:18 ` Jeff Guo
2020-04-11 0:18 ` [dpdk-dev] [dpdk-dev v2 1/1] net/ice: Support for GTPU down/up rss configure Jeff Guo
0 siblings, 1 reply; 4+ messages in thread
From: Jeff Guo @ 2020-04-11 0:18 UTC (permalink / raw)
To: xiaolong.ye, qi.z.zhang; +Cc: dev, jingjing.wu, yahui.cao, simei.su, jia.guo
add some new protocol rss input set configuration for ice driver,
the protocol input set such as below:
l3-src for gtpu uplink
l3-dst for gtpu downlink
This patchset depends on below patch set.
(1)http://patches.dpdk.org/project/dpdk/list/?series=8962
add RSS configuration for iavf
v2->v1:
refine rss offload types
Jeff Guo (1):
net/ice: Support for GTPU down/up rss configure
drivers/net/ice/ice_hash.c | 55 +++++++++++++++++++++++++++++++-------
1 file changed, 46 insertions(+), 9 deletions(-)
--
2.20.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-dev] [dpdk-dev v2 1/1] net/ice: Support for GTPU down/up rss configure
2020-04-11 0:18 ` [dpdk-dev] [dpdk-dev v2 0/1] add new rss configuration for ice Jeff Guo
@ 2020-04-11 0:18 ` Jeff Guo
0 siblings, 0 replies; 4+ messages in thread
From: Jeff Guo @ 2020-04-11 0:18 UTC (permalink / raw)
To: xiaolong.ye, qi.z.zhang; +Cc: dev, jingjing.wu, yahui.cao, simei.su, jia.guo
Add GTP PDU uplink/donwlink checking in RSS inpust set configuration,
in order to support l3 src hash for GTPU uplink, while l3 dst hash
for GTPU downlink.
Signed-off-by: Jeff Guo <jia.guo@intel.com>
---
v2->v1:
refine rss offload types
---
drivers/net/ice/ice_hash.c | 55 +++++++++++++++++++++++++++++++-------
1 file changed, 46 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c
index 72c8ddc9a..18fa29302 100644
--- a/drivers/net/ice/ice_hash.c
+++ b/drivers/net/ice/ice_hash.c
@@ -25,6 +25,9 @@
#include "ice_ethdev.h"
#include "ice_generic_flow.h"
+#define GTP_EH_PDU_LINK_UP 1
+#define GTP_EH_PDU_LINK_DWN 0
+
struct rss_type_match_hdr {
uint32_t hdr_mask;
uint64_t eth_rss_hint;
@@ -95,7 +98,7 @@ struct rss_type_match_hdr hint_7 = {
struct rss_type_match_hdr hint_8 = {
ICE_FLOW_SEG_HDR_IPV6 | ICE_FLOW_SEG_HDR_SCTP, ETH_RSS_NONFRAG_IPV6_SCTP};
struct rss_type_match_hdr hint_9 = {
- ICE_FLOW_SEG_HDR_GTPU_IP, ETH_RSS_IPV4};
+ ICE_FLOW_SEG_HDR_GTPU_IP, ETH_RSS_NONFRAG_IPV4_UDP};
struct rss_type_match_hdr hint_10 = {
ICE_FLOW_SEG_HDR_PPPOE, ETH_RSS_IPV4};
struct rss_type_match_hdr hint_11 = {
@@ -148,9 +151,13 @@ struct ice_hash_match_type ice_hash_type_list[] = {
{ETH_RSS_IPV4, ICE_FLOW_HASH_IPV4},
{ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY, BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_SA) | BIT_ULL(ICE_FLOW_FIELD_IDX_UDP_SRC_PORT)},
{ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_DST_ONLY, BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_SA) | BIT_ULL(ICE_FLOW_FIELD_IDX_UDP_DST_PORT)},
+ {ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_L3_SRC_ONLY | ETH_RSS_GTPU,
+ BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_SA)},
{ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_L3_SRC_ONLY, BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_SA)},
{ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_SRC_ONLY, BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_DA) | BIT_ULL(ICE_FLOW_FIELD_IDX_UDP_SRC_PORT)},
{ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_L3_DST_ONLY | ETH_RSS_L4_DST_ONLY, BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_DA) | BIT_ULL(ICE_FLOW_FIELD_IDX_UDP_DST_PORT)},
+ {ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_L3_DST_ONLY | ETH_RSS_GTPU,
+ BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_DA)},
{ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_L3_DST_ONLY, BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_DA)},
{ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_L4_SRC_ONLY, BIT_ULL(ICE_FLOW_FIELD_IDX_UDP_SRC_PORT)},
{ETH_RSS_NONFRAG_IPV4_UDP | ETH_RSS_L4_DST_ONLY, BIT_ULL(ICE_FLOW_FIELD_IDX_UDP_DST_PORT)},
@@ -269,21 +276,44 @@ ice_hash_check_inset(const struct rte_flow_item pattern[],
"Not support range");
return -rte_errno;
}
+ }
- /* Ignore spec and mask. */
- if (item->spec || item->mask) {
- rte_flow_error_set(error, EINVAL,
- RTE_FLOW_ERROR_TYPE_ITEM, item,
- "Invalid spec/mask.");
- return -rte_errno;
+ return 0;
+}
+
+static uint64_t
+ice_rss_hf_refine(uint64_t rss_hf, const struct rte_flow_item pattern[],
+ const struct rte_flow_action *action,
+ struct rte_flow_error *error)
+{
+ const struct rte_flow_item *item;
+
+ for (item = pattern; item->type != RTE_FLOW_ITEM_TYPE_END; item++) {
+ if (item->type == RTE_FLOW_ITEM_TYPE_GTP_PSC) {
+ const struct rte_flow_action_rss *rss = action->conf;
+ const struct rte_flow_item_gtp_psc *psc = item->spec;
+
+ if (psc && ((psc->pdu_type == GTP_EH_PDU_LINK_UP &&
+ (rss->types & ETH_RSS_L3_SRC_ONLY)) ||
+ (!psc->pdu_type &&
+ (rss->types & ETH_RSS_L3_DST_ONLY)))) {
+ rss_hf |= ETH_RSS_GTPU;
+ } else {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ITEM_SPEC,
+ pattern,
+ "Invalid input set");
+ return -rte_errno;
+ }
}
}
- return 0;
+ return rss_hf;
}
static int
ice_hash_parse_action(struct ice_pattern_match_item *pattern_match_item,
+ const struct rte_flow_item pattern[],
const struct rte_flow_action actions[],
void **meta,
struct rte_flow_error *error)
@@ -313,6 +343,13 @@ ice_hash_parse_action(struct ice_pattern_match_item *pattern_match_item,
*/
rss_hf = rte_eth_rss_hf_refine(rss_hf);
+ /**
+ * Check the item spec with the rss action and
+ * refine rss hash field.
+ */
+ rss_hf = ice_rss_hf_refine(rss_hf, pattern, action,
+ error);
+
/* Check if pattern is empty. */
if (pattern_match_item->pattern_list !=
pattern_empty && rss->func ==
@@ -441,7 +478,7 @@ ice_hash_parse_pattern_action(__rte_unused struct ice_adapter *ad,
(pattern_match_item->meta))->hdr_mask;
/* Check rss action. */
- ret = ice_hash_parse_action(pattern_match_item, actions,
+ ret = ice_hash_parse_action(pattern_match_item, pattern, actions,
(void **)&rss_meta_ptr, error);
error:
--
2.20.1
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-04-10 15:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-18 17:12 [dpdk-dev] [dpdk-dev 0/1] add new rss configuration for ice Jeff Guo
2020-03-18 17:12 ` [dpdk-dev] [dpdk-dev 1/1] net/ice: Support for GTPU down/up rss configure Jeff Guo
2020-04-11 0:18 ` [dpdk-dev] [dpdk-dev v2 0/1] add new rss configuration for ice Jeff Guo
2020-04-11 0:18 ` [dpdk-dev] [dpdk-dev v2 1/1] net/ice: Support for GTPU down/up rss configure Jeff Guo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).