DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/memif: implement promisc enable/disable
@ 2020-04-14  6:16 Jakub Grajciar
  2020-04-15 15:26 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Grajciar @ 2020-04-14  6:16 UTC (permalink / raw)
  To: dev; +Cc: Jakub Grajciar

implement promisc enable/disable for memif PMD

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
---
 drivers/net/memif/rte_eth_memif.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c
index 81d71c53a..d138ec89e 100644
--- a/drivers/net/memif/rte_eth_memif.c
+++ b/drivers/net/memif/rte_eth_memif.c
@@ -1418,6 +1418,20 @@ memif_rx_queue_intr_disable(struct rte_eth_dev *dev, uint16_t qid __rte_unused)
 	return 0;
 }
 
+static int
+memif_promisc_enable(struct rte_eth_dev *dev __rte_unused)
+{
+	/* memif works in promisc mode only */
+	return 0;
+}
+
+static int
+memif_promisc_disable(struct rte_eth_dev *dev __rte_unused)
+{
+	/* memif works in promisc mode only */
+	return 0;
+}
+
 static const struct eth_dev_ops ops = {
 	.dev_start = memif_dev_start,
 	.dev_close = memif_dev_close,
@@ -1432,6 +1446,8 @@ static const struct eth_dev_ops ops = {
 	.link_update = memif_link_update,
 	.stats_get = memif_stats_get,
 	.stats_reset = memif_stats_reset,
+	.promiscuous_enable = memif_promisc_enable,
+	.promiscuous_disable = memif_promisc_disable,
 };
 
 static int
-- 
2.17.1


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

* Re: [dpdk-dev] [PATCH] net/memif: implement promisc enable/disable
  2020-04-14  6:16 [dpdk-dev] [PATCH] net/memif: implement promisc enable/disable Jakub Grajciar
@ 2020-04-15 15:26 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2020-04-15 15:26 UTC (permalink / raw)
  To: Jakub Grajciar, dev

On 4/14/2020 7:16 AM, Jakub Grajciar wrote:
> implement promisc enable/disable for memif PMD
> 
> Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
> ---
>  drivers/net/memif/rte_eth_memif.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c
> index 81d71c53a..d138ec89e 100644
> --- a/drivers/net/memif/rte_eth_memif.c
> +++ b/drivers/net/memif/rte_eth_memif.c
> @@ -1418,6 +1418,20 @@ memif_rx_queue_intr_disable(struct rte_eth_dev *dev, uint16_t qid __rte_unused)
>  	return 0;
>  }
>  
> +static int
> +memif_promisc_enable(struct rte_eth_dev *dev __rte_unused)
> +{
> +	/* memif works in promisc mode only */
> +	return 0;
> +}
> +
> +static int
> +memif_promisc_disable(struct rte_eth_dev *dev __rte_unused)
> +{
> +	/* memif works in promisc mode only */
> +	return 0;
> +}
> +
>  static const struct eth_dev_ops ops = {
>  	.dev_start = memif_dev_start,
>  	.dev_close = memif_dev_close,
> @@ -1432,6 +1446,8 @@ static const struct eth_dev_ops ops = {
>  	.link_update = memif_link_update,
>  	.stats_get = memif_stats_get,
>  	.stats_reset = memif_stats_reset,
> +	.promiscuous_enable = memif_promisc_enable,
> +	.promiscuous_disable = memif_promisc_disable,
>  };
>  
>  static int
> 

Hi Jakub,

For this, instead of providing empty dev_ops, we suggest setting the
'eth_dev->data->promiscuous = 1' during PMD initialization.

This will show that PMD promiscuous mode enabled, and because of the how ethdev
APIs implemented, when application request to enable the promiscuous mode, it
will return success, when application request to disable the promiscuous mode it
will return error which is correct since " memif works in promisc mode only".

Sample: http://lxr.dpdk.org/dpdk/v20.02/source/drivers/net/null/rte_eth_null.c#L517

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

end of thread, other threads:[~2020-04-15 15:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-14  6:16 [dpdk-dev] [PATCH] net/memif: implement promisc enable/disable Jakub Grajciar
2020-04-15 15:26 ` Ferruh Yigit

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