DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ivan Malov <ivan.malov@arknetworks.am>
To: dev@dpdk.org
Cc: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
	stable@dpdk.org, Andy Moreton <amoreton@xilinx.com>,
	Viacheslav Galaktionov <Viacheslav.Galaktionov@arknetworks.am>
Subject: [PATCH v2] net/sfc: export pick transfer proxy callback to representors
Date: Tue, 31 Jan 2023 15:08:39 +0400	[thread overview]
Message-ID: <20230131110839.7453-1-ivan.malov@arknetworks.am> (raw)
In-Reply-To: <20230131072444.6925-1-ivan.malov@arknetworks.am>

Currently, the "pick transfer proxy ethdev" callback is only
advertised for non-representor (in example, main PF) ethdevs.
That does not sit well with the original idea of this method,
which is to let applications discover the privileged port to
use for transfer flow management instead of any given ethdev.
Applications trying to leverage this API on sfc representors
receive an error and cannot configure transfer flow offloads.

Fix the problem by exporting the method to representor ports.

Fixes: 26706314d418 ("net/sfc: implement transfer proxy port callback")
Cc: stable@dpdk.org

Signed-off-by: Ivan Malov <ivan.malov@arknetworks.am>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Viacheslav Galaktionov <Viacheslav.Galaktionov@arknetworks.am>
---
 v2: address community review notes

 drivers/net/sfc/sfc_repr.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/drivers/net/sfc/sfc_repr.c b/drivers/net/sfc/sfc_repr.c
index 417d0073cb..4b03b101d8 100644
--- a/drivers/net/sfc/sfc_repr.c
+++ b/drivers/net/sfc/sfc_repr.c
@@ -9,6 +9,8 @@
 
 #include <stdint.h>
 
+#include <rte_flow_driver.h>
+#include <rte_flow.h>
 #include <rte_mbuf.h>
 #include <rte_ethdev.h>
 #include <rte_malloc.h>
@@ -888,6 +890,29 @@ sfc_repr_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 	return 0;
 }
 
+static int
+sfc_repr_flow_pick_transfer_proxy(struct rte_eth_dev *dev,
+				  uint16_t *transfer_proxy_port,
+				  struct rte_flow_error *error)
+{
+	struct sfc_repr_shared *srs = sfc_repr_shared_by_eth_dev(dev);
+
+	return rte_flow_pick_transfer_proxy(srs->pf_port_id,
+					    transfer_proxy_port, error);
+}
+
+const struct rte_flow_ops sfc_repr_flow_ops = {
+	.pick_transfer_proxy = sfc_repr_flow_pick_transfer_proxy,
+};
+
+static int
+sfc_repr_dev_flow_ops_get(struct rte_eth_dev *dev __rte_unused,
+			  const struct rte_flow_ops **ops)
+{
+	*ops = &sfc_repr_flow_ops;
+	return 0;
+}
+
 static const struct eth_dev_ops sfc_repr_dev_ops = {
 	.dev_configure			= sfc_repr_dev_configure,
 	.dev_start			= sfc_repr_dev_start,
@@ -901,6 +926,7 @@ static const struct eth_dev_ops sfc_repr_dev_ops = {
 	.rx_queue_release		= sfc_repr_rx_queue_release,
 	.tx_queue_setup			= sfc_repr_tx_queue_setup,
 	.tx_queue_release		= sfc_repr_tx_queue_release,
+	.flow_ops_get			= sfc_repr_dev_flow_ops_get,
 };
 
 
-- 
2.17.1


  parent reply	other threads:[~2023-01-31 11:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-31  7:24 [PATCH] " Ivan Malov
2023-01-31  7:52 ` Andrew Rybchenko
2023-01-31 11:08 ` Ivan Malov [this message]
2023-01-31 11:13   ` [PATCH v2] " Andrew Rybchenko
2023-02-08 22:06     ` Ferruh Yigit
2023-02-09  7:49       ` Ivan Malov

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=20230131110839.7453-1-ivan.malov@arknetworks.am \
    --to=ivan.malov@arknetworks.am \
    --cc=Viacheslav.Galaktionov@arknetworks.am \
    --cc=amoreton@xilinx.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /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).