patches for DPDK stable branches
 help / color / Atom feed
* [dpdk-stable] [PATCH] net/qede: fix multicast pkts drop in promisc mode
@ 2020-06-18  8:15 Devendra Singh Rawat
  2020-06-26  3:42 ` [dpdk-stable] [dpdk-dev] " Jerin Jacob
  0 siblings, 1 reply; 2+ messages in thread
From: Devendra Singh Rawat @ 2020-06-18  8:15 UTC (permalink / raw)
  To: dev, jerinj, ferruh.yigit
  Cc: GR-Everest-DPDK-Dev, Devendra Singh Rawat, stable, Igor Russkikh,
	Rasesh Mody

After enabling promiscuous mode all packets whose destination MAC address
is a multicast address were being dropped. This fix configures H/W to
receive all traffic in promiscuous mode. Promiscuous mode also overrides
allmulticast mode on/off status.

Fixes: 40e9f6fc1558 ("net/qede: enable VF-VF traffic with unmatched dest address")
Cc: stable@dpdk.org

Signed-off-by: Devendra Singh Rawat <dsinghrawat@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Signed-off-by: Rasesh Mody <rmody@marvell.com>
---
 drivers/net/qede/qede_ethdev.c | 25 +++++++++----------------
 1 file changed, 9 insertions(+), 16 deletions(-)

diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index c4f8f12..84d2d2c 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -625,17 +625,16 @@ int qede_enable_tpa(struct rte_eth_dev *eth_dev, bool flg)
 		ECORE_ACCEPT_BCAST;
 
 	if (type == QED_FILTER_RX_MODE_TYPE_PROMISC) {
-		flags.rx_accept_filter |= ECORE_ACCEPT_UCAST_UNMATCHED;
+		flags.rx_accept_filter |= (ECORE_ACCEPT_UCAST_UNMATCHED |
+					   ECORE_ACCEPT_MCAST_UNMATCHED);
 		if (IS_VF(edev)) {
-			flags.tx_accept_filter |= ECORE_ACCEPT_UCAST_UNMATCHED;
-			DP_INFO(edev, "Enabling Tx unmatched flag for VF\n");
+			flags.tx_accept_filter |=
+						(ECORE_ACCEPT_UCAST_UNMATCHED |
+						 ECORE_ACCEPT_MCAST_UNMATCHED);
+			DP_INFO(edev, "Enabling Tx unmatched flags for VF\n");
 		}
 	} else if (type == QED_FILTER_RX_MODE_TYPE_MULTI_PROMISC) {
 		flags.rx_accept_filter |= ECORE_ACCEPT_MCAST_UNMATCHED;
-	} else if (type == (QED_FILTER_RX_MODE_TYPE_MULTI_PROMISC |
-				QED_FILTER_RX_MODE_TYPE_PROMISC)) {
-		flags.rx_accept_filter |= ECORE_ACCEPT_UCAST_UNMATCHED |
-			ECORE_ACCEPT_MCAST_UNMATCHED;
 	}
 
 	return ecore_filter_accept_cmd(edev, 0, flags, false, false,
@@ -1502,16 +1501,13 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev)
 
 static int qede_promiscuous_enable(struct rte_eth_dev *eth_dev)
 {
-	struct qede_dev *qdev = eth_dev->data->dev_private;
-	struct ecore_dev *edev = &qdev->edev;
-	enum qed_filter_rx_mode_type type = QED_FILTER_RX_MODE_TYPE_PROMISC;
 	enum _ecore_status_t ecore_status;
+	struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev);
+	struct ecore_dev *edev = QEDE_INIT_EDEV(qdev);
+	enum qed_filter_rx_mode_type type = QED_FILTER_RX_MODE_TYPE_PROMISC;
 
 	PMD_INIT_FUNC_TRACE(edev);
 
-	if (rte_eth_allmulticast_get(eth_dev->data->port_id) == 1)
-		type |= QED_FILTER_RX_MODE_TYPE_MULTI_PROMISC;
-
 	ecore_status = qed_configure_filter_rx_mode(eth_dev, type);
 
 	return ecore_status >= ECORE_SUCCESS ? 0 : -EAGAIN;
@@ -1885,9 +1881,6 @@ static int qede_allmulticast_enable(struct rte_eth_dev *eth_dev)
 	    QED_FILTER_RX_MODE_TYPE_MULTI_PROMISC;
 	enum _ecore_status_t ecore_status;
 
-	if (rte_eth_promiscuous_get(eth_dev->data->port_id) == 1)
-		type |= QED_FILTER_RX_MODE_TYPE_PROMISC;
-
 	ecore_status = qed_configure_filter_rx_mode(eth_dev, type);
 
 	return ecore_status >= ECORE_SUCCESS ? 0 : -EAGAIN;
-- 
1.8.3.1


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

* Re: [dpdk-stable] [dpdk-dev] [PATCH] net/qede: fix multicast pkts drop in promisc mode
  2020-06-18  8:15 [dpdk-stable] [PATCH] net/qede: fix multicast pkts drop in promisc mode Devendra Singh Rawat
@ 2020-06-26  3:42 ` " Jerin Jacob
  0 siblings, 0 replies; 2+ messages in thread
From: Jerin Jacob @ 2020-06-26  3:42 UTC (permalink / raw)
  To: Devendra Singh Rawat
  Cc: dpdk-dev, Jerin Jacob, Ferruh Yigit, GR-Everest-DPDK-Dev,
	dpdk stable, Igor Russkikh, Rasesh Mody

On Thu, Jun 18, 2020 at 1:40 PM Devendra Singh Rawat
<dsinghrawat@marvell.com> wrote:
>
> After enabling promiscuous mode all packets whose destination MAC address
> is a multicast address were being dropped. This fix configures H/W to
> receive all traffic in promiscuous mode. Promiscuous mode also overrides
> allmulticast mode on/off status.
>
> Fixes: 40e9f6fc1558 ("net/qede: enable VF-VF traffic with unmatched dest address")
> Cc: stable@dpdk.org
>
> Signed-off-by: Devendra Singh Rawat <dsinghrawat@marvell.com>
> Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
> Signed-off-by: Rasesh Mody <rmody@marvell.com>


Applied to dpdk-next-net-mrvl/master. Thanks


> ---
>  drivers/net/qede/qede_ethdev.c | 25 +++++++++----------------
>  1 file changed, 9 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
> index c4f8f12..84d2d2c 100644
> --- a/drivers/net/qede/qede_ethdev.c
> +++ b/drivers/net/qede/qede_ethdev.c
> @@ -625,17 +625,16 @@ int qede_enable_tpa(struct rte_eth_dev *eth_dev, bool flg)
>                 ECORE_ACCEPT_BCAST;
>
>         if (type == QED_FILTER_RX_MODE_TYPE_PROMISC) {
> -               flags.rx_accept_filter |= ECORE_ACCEPT_UCAST_UNMATCHED;
> +               flags.rx_accept_filter |= (ECORE_ACCEPT_UCAST_UNMATCHED |
> +                                          ECORE_ACCEPT_MCAST_UNMATCHED);
>                 if (IS_VF(edev)) {
> -                       flags.tx_accept_filter |= ECORE_ACCEPT_UCAST_UNMATCHED;
> -                       DP_INFO(edev, "Enabling Tx unmatched flag for VF\n");
> +                       flags.tx_accept_filter |=
> +                                               (ECORE_ACCEPT_UCAST_UNMATCHED |
> +                                                ECORE_ACCEPT_MCAST_UNMATCHED);
> +                       DP_INFO(edev, "Enabling Tx unmatched flags for VF\n");
>                 }
>         } else if (type == QED_FILTER_RX_MODE_TYPE_MULTI_PROMISC) {
>                 flags.rx_accept_filter |= ECORE_ACCEPT_MCAST_UNMATCHED;
> -       } else if (type == (QED_FILTER_RX_MODE_TYPE_MULTI_PROMISC |
> -                               QED_FILTER_RX_MODE_TYPE_PROMISC)) {
> -               flags.rx_accept_filter |= ECORE_ACCEPT_UCAST_UNMATCHED |
> -                       ECORE_ACCEPT_MCAST_UNMATCHED;
>         }
>
>         return ecore_filter_accept_cmd(edev, 0, flags, false, false,
> @@ -1502,16 +1501,13 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev)
>
>  static int qede_promiscuous_enable(struct rte_eth_dev *eth_dev)
>  {
> -       struct qede_dev *qdev = eth_dev->data->dev_private;
> -       struct ecore_dev *edev = &qdev->edev;
> -       enum qed_filter_rx_mode_type type = QED_FILTER_RX_MODE_TYPE_PROMISC;
>         enum _ecore_status_t ecore_status;
> +       struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev);
> +       struct ecore_dev *edev = QEDE_INIT_EDEV(qdev);
> +       enum qed_filter_rx_mode_type type = QED_FILTER_RX_MODE_TYPE_PROMISC;
>
>         PMD_INIT_FUNC_TRACE(edev);
>
> -       if (rte_eth_allmulticast_get(eth_dev->data->port_id) == 1)
> -               type |= QED_FILTER_RX_MODE_TYPE_MULTI_PROMISC;
> -
>         ecore_status = qed_configure_filter_rx_mode(eth_dev, type);
>
>         return ecore_status >= ECORE_SUCCESS ? 0 : -EAGAIN;
> @@ -1885,9 +1881,6 @@ static int qede_allmulticast_enable(struct rte_eth_dev *eth_dev)
>             QED_FILTER_RX_MODE_TYPE_MULTI_PROMISC;
>         enum _ecore_status_t ecore_status;
>
> -       if (rte_eth_promiscuous_get(eth_dev->data->port_id) == 1)
> -               type |= QED_FILTER_RX_MODE_TYPE_PROMISC;
> -
>         ecore_status = qed_configure_filter_rx_mode(eth_dev, type);
>
>         return ecore_status >= ECORE_SUCCESS ? 0 : -EAGAIN;
> --
> 1.8.3.1
>

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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-18  8:15 [dpdk-stable] [PATCH] net/qede: fix multicast pkts drop in promisc mode Devendra Singh Rawat
2020-06-26  3:42 ` [dpdk-stable] [dpdk-dev] " Jerin Jacob

patches for DPDK stable branches

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/ public-inbox