DPDK patches and discussions
 help / color / mirror / Atom feed
From: Matan Azrad <matan@mellanox.com>
To: Pascal Mazon <pascal.mazon@6wind.com>
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 2/2] net/tap: allow RSS flow action
Date: Tue,  3 Oct 2017 14:55:56 +0000	[thread overview]
Message-ID: <1507042556-9839-2-git-send-email-matan@mellanox.com> (raw)
In-Reply-To: <1507042556-9839-1-git-send-email-matan@mellanox.com>

One of the main identified use cases for the tap PMD is to be used in
combination with the fail-safe PMD as a fallback for a physical device.

Fail-safe is very strict about making sure its current configuration is
properly applied to all slave devices, they get rejected otherwise in
order to maintain a consistent state.

The problem is that tap's RSS support is currently limited to the
default (non-Toeplitz) balancing performed by the kernel on all Rx
queues. While proper RSS support emulation in the tap PMD is a work in
progress, the lack of rte_flow counterpart prevents validation of the
above use case in the meantime.

Given that unlike most PMDs, tap is more about convenience than
performance, support for the RSS action can be temporarily faked with
a minimum amount of code and mostly correct behavior by treating it
like a QUEUE action. Traffic is directed to the first queue of the set.

Signed-off-by: Matan Azrad <matan@mellanox.com>
---
 drivers/net/tap/tap_flow.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/net/tap/tap_flow.c b/drivers/net/tap/tap_flow.c
index aa33960..28d793f 100644
--- a/drivers/net/tap/tap_flow.c
+++ b/drivers/net/tap/tap_flow.c
@@ -1089,6 +1089,7 @@ struct tap_flow_items {
 			const struct rte_flow_action_queue *queue =
 				(const struct rte_flow_action_queue *)
 				actions->conf;
+
 			if (action)
 				goto exit_action_not_supported;
 			action = 1;
@@ -1097,6 +1098,20 @@ struct tap_flow_items {
 				goto exit_action_not_supported;
 			if (flow)
 				err = add_action_skbedit(flow, queue->index);
+		} else if (actions->type == RTE_FLOW_ACTION_TYPE_RSS) {
+			/* Fake RSS support. */
+			const struct rte_flow_action_rss *rss =
+				(const struct rte_flow_action_rss *)
+				actions->conf;
+
+			if (action)
+				goto exit_action_not_supported;
+			action = 1;
+			if (!rss || rss->num < 1 ||
+			    (rss->queue[0] > pmd->dev->data->nb_rx_queues - 1))
+				goto exit_action_not_supported;
+			if (flow)
+				err = add_action_skbedit(flow, rss->queue[0]);
 		} else {
 			goto exit_action_not_supported;
 		}
-- 
1.8.3.1

  reply	other threads:[~2017-10-03 14:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-03 14:55 [dpdk-dev] [PATCH 1/2] net/tap: fix indentation in flow file Matan Azrad
2017-10-03 14:55 ` Matan Azrad [this message]
2017-10-04  8:19   ` [dpdk-dev] [PATCH 2/2] net/tap: allow RSS flow action Pascal Mazon
2017-10-04  8:37     ` Pascal Mazon
2017-10-05 21:34       ` Ferruh Yigit
2017-10-03 22:07 ` [dpdk-dev] [PATCH 1/2] net/tap: fix indentation in flow file Ferruh Yigit
2017-10-04  8:15   ` Pascal Mazon
2017-10-04 17:26     ` Ferruh Yigit
2017-10-05 21:33       ` Ferruh Yigit
2017-10-16  8:04         ` Pascal Mazon
     [not found] <1507042327-9501-1-git-send-email-root@pegasus12.mtr.labs.mlnx>
     [not found] ` <1507042327-9501-2-git-send-email-root@pegasus12.mtr.labs.mlnx>
2017-10-03 15:07   ` [dpdk-dev] [PATCH 2/2] net/tap: allow RSS flow action Matan Azrad

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1507042556-9839-2-git-send-email-matan@mellanox.com \
    --to=matan@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=pascal.mazon@6wind.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).