Netdev Archive on lore.kernel.org
 help / color / Atom feed
* [net-next] net: mvpp2: skip RSS configurations on loopback port
@ 2021-02-18 12:42 stefanc
  2021-02-18 15:08 ` Marcin Wojtas
  2021-02-23  2:50 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: stefanc @ 2021-02-18 12:42 UTC (permalink / raw)
  To: netdev
  Cc: thomas.petazzoni, davem, nadavh, ymarkman, linux-kernel, stefanc,
	kuba, linux, mw, andrew, rmk+kernel, atenart

From: Stefan Chulski <stefanc@marvell.com>

PPv2 loopback port doesn't support RSS, so we should
skip RSS configurations for this port.

Signed-off-by: Stefan Chulski <stefanc@marvell.com>
---
 drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 25 +++++++++++---------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
index 10c17d1..d415447 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
@@ -4699,9 +4699,10 @@ static void mvpp2_irqs_deinit(struct mvpp2_port *port)
 	}
 }
 
-static bool mvpp22_rss_is_supported(void)
+static bool mvpp22_rss_is_supported(struct mvpp2_port *port)
 {
-	return queue_mode == MVPP2_QDIST_MULTI_MODE;
+	return (queue_mode == MVPP2_QDIST_MULTI_MODE) &&
+		!(port->flags & MVPP2_F_LOOPBACK);
 }
 
 static int mvpp2_open(struct net_device *dev)
@@ -5513,7 +5514,7 @@ static int mvpp2_ethtool_get_rxnfc(struct net_device *dev,
 	struct mvpp2_port *port = netdev_priv(dev);
 	int ret = 0, i, loc = 0;
 
-	if (!mvpp22_rss_is_supported())
+	if (!mvpp22_rss_is_supported(port))
 		return -EOPNOTSUPP;
 
 	switch (info->cmd) {
@@ -5548,7 +5549,7 @@ static int mvpp2_ethtool_set_rxnfc(struct net_device *dev,
 	struct mvpp2_port *port = netdev_priv(dev);
 	int ret = 0;
 
-	if (!mvpp22_rss_is_supported())
+	if (!mvpp22_rss_is_supported(port))
 		return -EOPNOTSUPP;
 
 	switch (info->cmd) {
@@ -5569,7 +5570,9 @@ static int mvpp2_ethtool_set_rxnfc(struct net_device *dev,
 
 static u32 mvpp2_ethtool_get_rxfh_indir_size(struct net_device *dev)
 {
-	return mvpp22_rss_is_supported() ? MVPP22_RSS_TABLE_ENTRIES : 0;
+	struct mvpp2_port *port = netdev_priv(dev);
+
+	return mvpp22_rss_is_supported(port) ? MVPP22_RSS_TABLE_ENTRIES : 0;
 }
 
 static int mvpp2_ethtool_get_rxfh(struct net_device *dev, u32 *indir, u8 *key,
@@ -5578,7 +5581,7 @@ static int mvpp2_ethtool_get_rxfh(struct net_device *dev, u32 *indir, u8 *key,
 	struct mvpp2_port *port = netdev_priv(dev);
 	int ret = 0;
 
-	if (!mvpp22_rss_is_supported())
+	if (!mvpp22_rss_is_supported(port))
 		return -EOPNOTSUPP;
 
 	if (indir)
@@ -5596,7 +5599,7 @@ static int mvpp2_ethtool_set_rxfh(struct net_device *dev, const u32 *indir,
 	struct mvpp2_port *port = netdev_priv(dev);
 	int ret = 0;
 
-	if (!mvpp22_rss_is_supported())
+	if (!mvpp22_rss_is_supported(port))
 		return -EOPNOTSUPP;
 
 	if (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != ETH_RSS_HASH_CRC32)
@@ -5617,7 +5620,7 @@ static int mvpp2_ethtool_get_rxfh_context(struct net_device *dev, u32 *indir,
 	struct mvpp2_port *port = netdev_priv(dev);
 	int ret = 0;
 
-	if (!mvpp22_rss_is_supported())
+	if (!mvpp22_rss_is_supported(port))
 		return -EOPNOTSUPP;
 	if (rss_context >= MVPP22_N_RSS_TABLES)
 		return -EINVAL;
@@ -5639,7 +5642,7 @@ static int mvpp2_ethtool_set_rxfh_context(struct net_device *dev,
 	struct mvpp2_port *port = netdev_priv(dev);
 	int ret;
 
-	if (!mvpp22_rss_is_supported())
+	if (!mvpp22_rss_is_supported(port))
 		return -EOPNOTSUPP;
 
 	if (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != ETH_RSS_HASH_CRC32)
@@ -5956,7 +5959,7 @@ static int mvpp2_port_init(struct mvpp2_port *port)
 	mvpp2_cls_oversize_rxq_set(port);
 	mvpp2_cls_port_config(port);
 
-	if (mvpp22_rss_is_supported())
+	if (mvpp22_rss_is_supported(port))
 		mvpp22_port_rss_init(port);
 
 	/* Provide an initial Rx packet size */
@@ -6861,7 +6864,7 @@ static int mvpp2_port_probe(struct platform_device *pdev,
 	dev->hw_features |= features | NETIF_F_RXCSUM | NETIF_F_GRO |
 			    NETIF_F_HW_VLAN_CTAG_FILTER;
 
-	if (mvpp22_rss_is_supported()) {
+	if (mvpp22_rss_is_supported(port)) {
 		dev->hw_features |= NETIF_F_RXHASH;
 		dev->features |= NETIF_F_NTUPLE;
 	}
-- 
1.9.1


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

* Re: [net-next] net: mvpp2: skip RSS configurations on loopback port
  2021-02-18 12:42 [net-next] net: mvpp2: skip RSS configurations on loopback port stefanc
@ 2021-02-18 15:08 ` Marcin Wojtas
  2021-02-23  2:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Marcin Wojtas @ 2021-02-18 15:08 UTC (permalink / raw)
  To: Stefan Chulski
  Cc: netdev, Thomas Petazzoni, David S. Miller, nadavh, Yan Markman,
	Linux Kernel Mailing List, Jakub Kicinski,
	Russell King - ARM Linux, Andrew Lunn, Russell King, atenart

Hi,


czw., 18 lut 2021 o 13:42 <stefanc@marvell.com> napisał(a):
>
> From: Stefan Chulski <stefanc@marvell.com>
>
> PPv2 loopback port doesn't support RSS, so we should
> skip RSS configurations for this port.
>
> Signed-off-by: Stefan Chulski <stefanc@marvell.com>
> ---
>  drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 25 +++++++++++---------
>  1 file changed, 14 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> index 10c17d1..d415447 100644
> --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> @@ -4699,9 +4699,10 @@ static void mvpp2_irqs_deinit(struct mvpp2_port *port)
>         }
>  }
>
> -static bool mvpp22_rss_is_supported(void)
> +static bool mvpp22_rss_is_supported(struct mvpp2_port *port)
>  {
> -       return queue_mode == MVPP2_QDIST_MULTI_MODE;
> +       return (queue_mode == MVPP2_QDIST_MULTI_MODE) &&
> +               !(port->flags & MVPP2_F_LOOPBACK);
>  }
>
>  static int mvpp2_open(struct net_device *dev)
> @@ -5513,7 +5514,7 @@ static int mvpp2_ethtool_get_rxnfc(struct net_device *dev,
>         struct mvpp2_port *port = netdev_priv(dev);
>         int ret = 0, i, loc = 0;
>
> -       if (!mvpp22_rss_is_supported())
> +       if (!mvpp22_rss_is_supported(port))
>                 return -EOPNOTSUPP;
>
>         switch (info->cmd) {
> @@ -5548,7 +5549,7 @@ static int mvpp2_ethtool_set_rxnfc(struct net_device *dev,
>         struct mvpp2_port *port = netdev_priv(dev);
>         int ret = 0;
>
> -       if (!mvpp22_rss_is_supported())
> +       if (!mvpp22_rss_is_supported(port))
>                 return -EOPNOTSUPP;
>
>         switch (info->cmd) {
> @@ -5569,7 +5570,9 @@ static int mvpp2_ethtool_set_rxnfc(struct net_device *dev,
>
>  static u32 mvpp2_ethtool_get_rxfh_indir_size(struct net_device *dev)
>  {
> -       return mvpp22_rss_is_supported() ? MVPP22_RSS_TABLE_ENTRIES : 0;
> +       struct mvpp2_port *port = netdev_priv(dev);
> +
> +       return mvpp22_rss_is_supported(port) ? MVPP22_RSS_TABLE_ENTRIES : 0;
>  }
>
>  static int mvpp2_ethtool_get_rxfh(struct net_device *dev, u32 *indir, u8 *key,
> @@ -5578,7 +5581,7 @@ static int mvpp2_ethtool_get_rxfh(struct net_device *dev, u32 *indir, u8 *key,
>         struct mvpp2_port *port = netdev_priv(dev);
>         int ret = 0;
>
> -       if (!mvpp22_rss_is_supported())
> +       if (!mvpp22_rss_is_supported(port))
>                 return -EOPNOTSUPP;
>
>         if (indir)
> @@ -5596,7 +5599,7 @@ static int mvpp2_ethtool_set_rxfh(struct net_device *dev, const u32 *indir,
>         struct mvpp2_port *port = netdev_priv(dev);
>         int ret = 0;
>
> -       if (!mvpp22_rss_is_supported())
> +       if (!mvpp22_rss_is_supported(port))
>                 return -EOPNOTSUPP;
>
>         if (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != ETH_RSS_HASH_CRC32)
> @@ -5617,7 +5620,7 @@ static int mvpp2_ethtool_get_rxfh_context(struct net_device *dev, u32 *indir,
>         struct mvpp2_port *port = netdev_priv(dev);
>         int ret = 0;
>
> -       if (!mvpp22_rss_is_supported())
> +       if (!mvpp22_rss_is_supported(port))
>                 return -EOPNOTSUPP;
>         if (rss_context >= MVPP22_N_RSS_TABLES)
>                 return -EINVAL;
> @@ -5639,7 +5642,7 @@ static int mvpp2_ethtool_set_rxfh_context(struct net_device *dev,
>         struct mvpp2_port *port = netdev_priv(dev);
>         int ret;
>
> -       if (!mvpp22_rss_is_supported())
> +       if (!mvpp22_rss_is_supported(port))
>                 return -EOPNOTSUPP;
>
>         if (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != ETH_RSS_HASH_CRC32)
> @@ -5956,7 +5959,7 @@ static int mvpp2_port_init(struct mvpp2_port *port)
>         mvpp2_cls_oversize_rxq_set(port);
>         mvpp2_cls_port_config(port);
>
> -       if (mvpp22_rss_is_supported())
> +       if (mvpp22_rss_is_supported(port))
>                 mvpp22_port_rss_init(port);
>
>         /* Provide an initial Rx packet size */
> @@ -6861,7 +6864,7 @@ static int mvpp2_port_probe(struct platform_device *pdev,
>         dev->hw_features |= features | NETIF_F_RXCSUM | NETIF_F_GRO |
>                             NETIF_F_HW_VLAN_CTAG_FILTER;
>
> -       if (mvpp22_rss_is_supported()) {
> +       if (mvpp22_rss_is_supported(port)) {
>                 dev->hw_features |= NETIF_F_RXHASH;
>                 dev->features |= NETIF_F_NTUPLE;
>         }
> --
> 1.9.1
>

Reviewed-by: Marcin Wojtas <mw@semihalf.com>

Thanks!

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

* Re: [net-next] net: mvpp2: skip RSS configurations on loopback port
  2021-02-18 12:42 [net-next] net: mvpp2: skip RSS configurations on loopback port stefanc
  2021-02-18 15:08 ` Marcin Wojtas
@ 2021-02-23  2:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-02-23  2:50 UTC (permalink / raw)
  To: Stefan Chulski
  Cc: netdev, thomas.petazzoni, davem, nadavh, ymarkman, linux-kernel,
	kuba, linux, mw, andrew, rmk+kernel, atenart

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Thu, 18 Feb 2021 14:42:03 +0200 you wrote:
> From: Stefan Chulski <stefanc@marvell.com>
> 
> PPv2 loopback port doesn't support RSS, so we should
> skip RSS configurations for this port.
> 
> Signed-off-by: Stefan Chulski <stefanc@marvell.com>
> 
> [...]

Here is the summary with links:
  - [net-next] net: mvpp2: skip RSS configurations on loopback port
    https://git.kernel.org/netdev/net/c/0a8a800027f1

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-18 12:42 [net-next] net: mvpp2: skip RSS configurations on loopback port stefanc
2021-02-18 15:08 ` Marcin Wojtas
2021-02-23  2:50 ` patchwork-bot+netdevbpf

Netdev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/netdev/0 netdev/git/0.git
	git clone --mirror https://lore.kernel.org/netdev/1 netdev/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netdev netdev/ https://lore.kernel.org/netdev \
		netdev@vger.kernel.org
	public-inbox-index netdev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.netdev


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