From: Andrew Rybchenko <arybchenko@solarflare.com>
To: <dev@dpdk.org>
Cc: Ivan Malov <ivan.malov@oktetlabs.ru>
Subject: [dpdk-dev] [PATCH 2/7] net/sfc: make the flow list engine-agnostic
Date: Thu, 5 Mar 2020 10:47:48 +0000 [thread overview]
Message-ID: <1583405273-14176-3-git-send-email-arybchenko@solarflare.com> (raw)
In-Reply-To: <1583405273-14176-1-git-send-email-arybchenko@solarflare.com>
From: Ivan Malov <ivan.malov@oktetlabs.ru>
A backend which a driver employs to handle flow rules of a given
type depends on the underlying NIC flow engine. The driver in
question in its current state is tailored to support the only
flow engine, VNIC filtering. As the need arises to add support
for transfer rules, the driver has to be reworked so that it
becomes possible to introduce yet another backend.
As a preparation step, make the flow list shared
between different engines.
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
drivers/net/sfc/sfc.h | 2 ++
drivers/net/sfc/sfc_filter.h | 2 --
drivers/net/sfc/sfc_flow.c | 20 ++++++++++----------
3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/net/sfc/sfc.h b/drivers/net/sfc/sfc.h
index cc5222877..2520cf2b7 100644
--- a/drivers/net/sfc/sfc.h
+++ b/drivers/net/sfc/sfc.h
@@ -242,6 +242,8 @@ struct sfc_adapter {
struct sfc_port port;
struct sfc_filter filter;
+ struct sfc_flow_list flow_list;
+
unsigned int rxq_max;
unsigned int txq_max;
diff --git a/drivers/net/sfc/sfc_filter.h b/drivers/net/sfc/sfc_filter.h
index 64ab114e0..6a0254813 100644
--- a/drivers/net/sfc/sfc_filter.h
+++ b/drivers/net/sfc/sfc_filter.h
@@ -23,8 +23,6 @@ struct sfc_filter {
size_t supported_match_num;
/** Driver cache of supported filter match masks */
uint32_t *supported_match;
- /** List of flow rules */
- struct sfc_flow_list flow_list;
/**
* Supports any of ip_proto, remote host or local host
* filters. This flag is used for filter match exceptions
diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c
index f285ba552..0826032e0 100644
--- a/drivers/net/sfc/sfc_flow.c
+++ b/drivers/net/sfc/sfc_flow.c
@@ -2317,7 +2317,7 @@ sfc_flow_create(struct rte_eth_dev *dev,
sfc_adapter_lock(sa);
- TAILQ_INSERT_TAIL(&sa->filter.flow_list, flow, entries);
+ TAILQ_INSERT_TAIL(&sa->flow_list, flow, entries);
if (sa->state == SFC_ADAPTER_STARTED) {
rc = sfc_flow_filter_insert(sa, flow);
@@ -2334,7 +2334,7 @@ sfc_flow_create(struct rte_eth_dev *dev,
return flow;
fail_filter_insert:
- TAILQ_REMOVE(&sa->filter.flow_list, flow, entries);
+ TAILQ_REMOVE(&sa->flow_list, flow, entries);
fail_bad_value:
rte_free(flow);
@@ -2361,7 +2361,7 @@ sfc_flow_remove(struct sfc_adapter *sa,
"Failed to destroy flow rule");
}
- TAILQ_REMOVE(&sa->filter.flow_list, flow, entries);
+ TAILQ_REMOVE(&sa->flow_list, flow, entries);
rte_free(flow);
return rc;
@@ -2378,7 +2378,7 @@ sfc_flow_destroy(struct rte_eth_dev *dev,
sfc_adapter_lock(sa);
- TAILQ_FOREACH(flow_ptr, &sa->filter.flow_list, entries) {
+ TAILQ_FOREACH(flow_ptr, &sa->flow_list, entries) {
if (flow_ptr == flow)
rc = 0;
}
@@ -2408,7 +2408,7 @@ sfc_flow_flush(struct rte_eth_dev *dev,
sfc_adapter_lock(sa);
- while ((flow = TAILQ_FIRST(&sa->filter.flow_list)) != NULL) {
+ while ((flow = TAILQ_FIRST(&sa->flow_list)) != NULL) {
rc = sfc_flow_remove(sa, flow, error);
if (rc != 0)
ret = rc;
@@ -2454,7 +2454,7 @@ sfc_flow_init(struct sfc_adapter *sa)
{
SFC_ASSERT(sfc_adapter_is_locked(sa));
- TAILQ_INIT(&sa->filter.flow_list);
+ TAILQ_INIT(&sa->flow_list);
}
void
@@ -2464,8 +2464,8 @@ sfc_flow_fini(struct sfc_adapter *sa)
SFC_ASSERT(sfc_adapter_is_locked(sa));
- while ((flow = TAILQ_FIRST(&sa->filter.flow_list)) != NULL) {
- TAILQ_REMOVE(&sa->filter.flow_list, flow, entries);
+ while ((flow = TAILQ_FIRST(&sa->flow_list)) != NULL) {
+ TAILQ_REMOVE(&sa->flow_list, flow, entries);
rte_free(flow);
}
}
@@ -2477,7 +2477,7 @@ sfc_flow_stop(struct sfc_adapter *sa)
SFC_ASSERT(sfc_adapter_is_locked(sa));
- TAILQ_FOREACH(flow, &sa->filter.flow_list, entries)
+ TAILQ_FOREACH(flow, &sa->flow_list, entries)
sfc_flow_filter_remove(sa, flow);
}
@@ -2491,7 +2491,7 @@ sfc_flow_start(struct sfc_adapter *sa)
SFC_ASSERT(sfc_adapter_is_locked(sa));
- TAILQ_FOREACH(flow, &sa->filter.flow_list, entries) {
+ TAILQ_FOREACH(flow, &sa->flow_list, entries) {
rc = sfc_flow_filter_insert(sa, flow);
if (rc != 0)
goto fail_bad_flow;
--
2.17.1
next prev parent reply other threads:[~2020-03-05 10:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-05 10:47 [dpdk-dev] [PATCH 0/7] net/sfc: prepare rte_flow to have one more backend Andrew Rybchenko
2020-03-05 10:47 ` [dpdk-dev] [PATCH 1/7] net/sfc: make flow RSS details VNIC-specific Andrew Rybchenko
2020-03-05 10:47 ` Andrew Rybchenko [this message]
2020-03-05 10:47 ` [dpdk-dev] [PATCH 3/7] net/sfc: generalise the flow specification structure Andrew Rybchenko
2020-03-05 10:47 ` [dpdk-dev] [PATCH 4/7] net/sfc: introduce flow allocation and free path Andrew Rybchenko
2020-03-05 10:47 ` [dpdk-dev] [PATCH 5/7] net/sfc: generalise flow parsing Andrew Rybchenko
2020-03-05 10:47 ` [dpdk-dev] [PATCH 6/7] net/sfc: generalise flow start and stop path Andrew Rybchenko
2020-03-05 10:47 ` [dpdk-dev] [PATCH 7/7] net/sfc: generalise flow pattern item processing Andrew Rybchenko
2020-03-06 16:51 ` [dpdk-dev] [PATCH 0/7] net/sfc: prepare rte_flow to have one more backend Ferruh Yigit
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=1583405273-14176-3-git-send-email-arybchenko@solarflare.com \
--to=arybchenko@solarflare.com \
--cc=dev@dpdk.org \
--cc=ivan.malov@oktetlabs.ru \
/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).