DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/sfc: export pick transfer proxy callback to representors
@ 2023-01-31  7:24 Ivan Malov
  2023-01-31  7:52 ` Andrew Rybchenko
  2023-01-31 11:08 ` [PATCH v2] " Ivan Malov
  0 siblings, 2 replies; 6+ messages in thread
From: Ivan Malov @ 2023-01-31  7:24 UTC (permalink / raw)
  To: dev; +Cc: Andrew Rybchenko, stable, Andy Moreton, Viacheslav Galaktionov

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>
---
 drivers/net/sfc/sfc_flow.c |  4 ++++
 drivers/net/sfc/sfc_flow.h |  2 ++
 drivers/net/sfc/sfc_repr.c | 10 ++++++++++
 3 files changed, 16 insertions(+)

diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c
index fb59abd0b5..2937953959 100644
--- a/drivers/net/sfc/sfc_flow.c
+++ b/drivers/net/sfc/sfc_flow.c
@@ -2806,6 +2806,10 @@ const struct rte_flow_ops sfc_flow_ops = {
 	.pick_transfer_proxy = sfc_flow_pick_transfer_proxy,
 };
 
+const struct rte_flow_ops sfc_repr_flow_ops = {
+	.pick_transfer_proxy = sfc_flow_pick_transfer_proxy,
+};
+
 void
 sfc_flow_init(struct sfc_adapter *sa)
 {
diff --git a/drivers/net/sfc/sfc_flow.h b/drivers/net/sfc/sfc_flow.h
index 12875344b5..2b1e5a2ff6 100644
--- a/drivers/net/sfc/sfc_flow.h
+++ b/drivers/net/sfc/sfc_flow.h
@@ -107,6 +107,8 @@ TAILQ_HEAD(sfc_flow_list, rte_flow);
 
 extern const struct rte_flow_ops sfc_flow_ops;
 
+extern const struct rte_flow_ops sfc_repr_flow_ops;
+
 enum sfc_flow_item_layers {
 	SFC_FLOW_ITEM_ANY_LAYER,
 	SFC_FLOW_ITEM_START_LAYER,
diff --git a/drivers/net/sfc/sfc_repr.c b/drivers/net/sfc/sfc_repr.c
index 417d0073cb..6b1d5492a9 100644
--- a/drivers/net/sfc/sfc_repr.c
+++ b/drivers/net/sfc/sfc_repr.c
@@ -18,6 +18,7 @@
 
 #include "sfc_log.h"
 #include "sfc_debug.h"
+#include "sfc_flow.h"
 #include "sfc_repr.h"
 #include "sfc_ethdev_state.h"
 #include "sfc_repr_proxy_api.h"
@@ -888,6 +889,14 @@ sfc_repr_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 	return 0;
 }
 
+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 +910,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.30.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] net/sfc: export pick transfer proxy callback to representors
  2023-01-31  7:24 [PATCH] net/sfc: export pick transfer proxy callback to representors Ivan Malov
@ 2023-01-31  7:52 ` Andrew Rybchenko
  2023-01-31 11:08 ` [PATCH v2] " Ivan Malov
  1 sibling, 0 replies; 6+ messages in thread
From: Andrew Rybchenko @ 2023-01-31  7:52 UTC (permalink / raw)
  To: Ivan Malov, dev; +Cc: stable, Andy Moreton, Viacheslav Galaktionov

On 1/31/23 10:24, Ivan Malov wrote:
> 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>
> ---
>   drivers/net/sfc/sfc_flow.c |  4 ++++
>   drivers/net/sfc/sfc_flow.h |  2 ++
>   drivers/net/sfc/sfc_repr.c | 10 ++++++++++
>   3 files changed, 16 insertions(+)
> 
> diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c
> index fb59abd0b5..2937953959 100644
> --- a/drivers/net/sfc/sfc_flow.c
> +++ b/drivers/net/sfc/sfc_flow.c
> @@ -2806,6 +2806,10 @@ const struct rte_flow_ops sfc_flow_ops = {
>   	.pick_transfer_proxy = sfc_flow_pick_transfer_proxy,
>   };
>   
> +const struct rte_flow_ops sfc_repr_flow_ops = {
> +	.pick_transfer_proxy = sfc_flow_pick_transfer_proxy,
> +};
> +

It would be nice to know it is tested in some way.
As far as I can see it can't work since
sfc_flow_pick_transfer_proxy() treats eth_dev->process_private
as struct sfc_adapter_priv, but it is sfc_repr in the case
of sfc representor ethdev. Am I missing something?


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2] net/sfc: export pick transfer proxy callback to representors
  2023-01-31  7:24 [PATCH] net/sfc: export pick transfer proxy callback to representors Ivan Malov
  2023-01-31  7:52 ` Andrew Rybchenko
@ 2023-01-31 11:08 ` Ivan Malov
  2023-01-31 11:13   ` Andrew Rybchenko
  1 sibling, 1 reply; 6+ messages in thread
From: Ivan Malov @ 2023-01-31 11:08 UTC (permalink / raw)
  To: dev; +Cc: Andrew Rybchenko, stable, Andy Moreton, Viacheslav Galaktionov

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] net/sfc: export pick transfer proxy callback to representors
  2023-01-31 11:08 ` [PATCH v2] " Ivan Malov
@ 2023-01-31 11:13   ` Andrew Rybchenko
  2023-02-08 22:06     ` Ferruh Yigit
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Rybchenko @ 2023-01-31 11:13 UTC (permalink / raw)
  To: Ivan Malov, dev; +Cc: stable, Andy Moreton, Viacheslav Galaktionov

On 1/31/23 14:08, Ivan Malov wrote:
> 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>

No capital letters in E-mail address, please.

Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] net/sfc: export pick transfer proxy callback to representors
  2023-01-31 11:13   ` Andrew Rybchenko
@ 2023-02-08 22:06     ` Ferruh Yigit
  2023-02-09  7:49       ` Ivan Malov
  0 siblings, 1 reply; 6+ messages in thread
From: Ferruh Yigit @ 2023-02-08 22:06 UTC (permalink / raw)
  To: Andrew Rybchenko, Ivan Malov, dev
  Cc: stable, Andy Moreton, Viacheslav Galaktionov

On 1/31/2023 11:13 AM, Andrew Rybchenko wrote:
> On 1/31/23 14:08, Ivan Malov wrote:
>> 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>
> 
> No capital letters in E-mail address, please.
> 

fixed while merging

> Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> 

Applied to dpdk-next-net/main, thanks.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] net/sfc: export pick transfer proxy callback to representors
  2023-02-08 22:06     ` Ferruh Yigit
@ 2023-02-09  7:49       ` Ivan Malov
  0 siblings, 0 replies; 6+ messages in thread
From: Ivan Malov @ 2023-02-09  7:49 UTC (permalink / raw)
  To: Ferruh Yigit
  Cc: Andrew Rybchenko, dev, stable, Andy Moreton, Viacheslav Galaktionov

On Wed, 8 Feb 2023, Ferruh Yigit wrote:

> On 1/31/2023 11:13 AM, Andrew Rybchenko wrote:
>> On 1/31/23 14:08, Ivan Malov wrote:
>>> 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>
>>
>> No capital letters in E-mail address, please.
>>
>
> fixed while merging

Thank you Ferruh. You have been most helpful.

>
>> Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
>>
>
> Applied to dpdk-next-net/main, thanks.
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-02-09  7:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-31  7:24 [PATCH] net/sfc: export pick transfer proxy callback to representors Ivan Malov
2023-01-31  7:52 ` Andrew Rybchenko
2023-01-31 11:08 ` [PATCH v2] " Ivan Malov
2023-01-31 11:13   ` Andrew Rybchenko
2023-02-08 22:06     ` Ferruh Yigit
2023-02-09  7:49       ` Ivan Malov

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).