Commit 0a8a8000 authored by Stefan Chulski's avatar Stefan Chulski Committed by Jakub Kicinski

net: mvpp2: skip RSS configurations on loopback port

PPv2 loopback port doesn't support RSS, so we should
skip RSS configurations for this port.
Signed-off-by: default avatarStefan Chulski <stefanc@marvell.com>
Reviewed-by: default avatarMarcin Wojtas <mw@semihalf.com>
Link: https://lore.kernel.org/r/1613652123-19021-1-git-send-email-stefanc@marvell.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 433dfc99
...@@ -4699,9 +4699,10 @@ static void mvpp2_irqs_deinit(struct mvpp2_port *port) ...@@ -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) static int mvpp2_open(struct net_device *dev)
...@@ -5513,7 +5514,7 @@ static int mvpp2_ethtool_get_rxnfc(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); struct mvpp2_port *port = netdev_priv(dev);
int ret = 0, i, loc = 0; int ret = 0, i, loc = 0;
if (!mvpp22_rss_is_supported()) if (!mvpp22_rss_is_supported(port))
return -EOPNOTSUPP; return -EOPNOTSUPP;
switch (info->cmd) { switch (info->cmd) {
...@@ -5548,7 +5549,7 @@ static int mvpp2_ethtool_set_rxnfc(struct net_device *dev, ...@@ -5548,7 +5549,7 @@ static int mvpp2_ethtool_set_rxnfc(struct net_device *dev,
struct mvpp2_port *port = netdev_priv(dev); struct mvpp2_port *port = netdev_priv(dev);
int ret = 0; int ret = 0;
if (!mvpp22_rss_is_supported()) if (!mvpp22_rss_is_supported(port))
return -EOPNOTSUPP; return -EOPNOTSUPP;
switch (info->cmd) { switch (info->cmd) {
...@@ -5569,7 +5570,9 @@ static int mvpp2_ethtool_set_rxnfc(struct net_device *dev, ...@@ -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) 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, 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, ...@@ -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); struct mvpp2_port *port = netdev_priv(dev);
int ret = 0; int ret = 0;
if (!mvpp22_rss_is_supported()) if (!mvpp22_rss_is_supported(port))
return -EOPNOTSUPP; return -EOPNOTSUPP;
if (indir) if (indir)
...@@ -5596,7 +5599,7 @@ static int mvpp2_ethtool_set_rxfh(struct net_device *dev, const u32 *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); struct mvpp2_port *port = netdev_priv(dev);
int ret = 0; int ret = 0;
if (!mvpp22_rss_is_supported()) if (!mvpp22_rss_is_supported(port))
return -EOPNOTSUPP; return -EOPNOTSUPP;
if (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != ETH_RSS_HASH_CRC32) 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, ...@@ -5617,7 +5620,7 @@ static int mvpp2_ethtool_get_rxfh_context(struct net_device *dev, u32 *indir,
struct mvpp2_port *port = netdev_priv(dev); struct mvpp2_port *port = netdev_priv(dev);
int ret = 0; int ret = 0;
if (!mvpp22_rss_is_supported()) if (!mvpp22_rss_is_supported(port))
return -EOPNOTSUPP; return -EOPNOTSUPP;
if (rss_context >= MVPP22_N_RSS_TABLES) if (rss_context >= MVPP22_N_RSS_TABLES)
return -EINVAL; return -EINVAL;
...@@ -5639,7 +5642,7 @@ static int mvpp2_ethtool_set_rxfh_context(struct net_device *dev, ...@@ -5639,7 +5642,7 @@ static int mvpp2_ethtool_set_rxfh_context(struct net_device *dev,
struct mvpp2_port *port = netdev_priv(dev); struct mvpp2_port *port = netdev_priv(dev);
int ret; int ret;
if (!mvpp22_rss_is_supported()) if (!mvpp22_rss_is_supported(port))
return -EOPNOTSUPP; return -EOPNOTSUPP;
if (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != ETH_RSS_HASH_CRC32) 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) ...@@ -5956,7 +5959,7 @@ static int mvpp2_port_init(struct mvpp2_port *port)
mvpp2_cls_oversize_rxq_set(port); mvpp2_cls_oversize_rxq_set(port);
mvpp2_cls_port_config(port); mvpp2_cls_port_config(port);
if (mvpp22_rss_is_supported()) if (mvpp22_rss_is_supported(port))
mvpp22_port_rss_init(port); mvpp22_port_rss_init(port);
/* Provide an initial Rx packet size */ /* Provide an initial Rx packet size */
...@@ -6861,7 +6864,7 @@ static int mvpp2_port_probe(struct platform_device *pdev, ...@@ -6861,7 +6864,7 @@ static int mvpp2_port_probe(struct platform_device *pdev,
dev->hw_features |= features | NETIF_F_RXCSUM | NETIF_F_GRO | dev->hw_features |= features | NETIF_F_RXCSUM | NETIF_F_GRO |
NETIF_F_HW_VLAN_CTAG_FILTER; NETIF_F_HW_VLAN_CTAG_FILTER;
if (mvpp22_rss_is_supported()) { if (mvpp22_rss_is_supported(port)) {
dev->hw_features |= NETIF_F_RXHASH; dev->hw_features |= NETIF_F_RXHASH;
dev->features |= NETIF_F_NTUPLE; dev->features |= NETIF_F_NTUPLE;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment