Skip to content

Commit

Permalink
net: stmmac: selftests: Update status when disabling RSS
Browse files Browse the repository at this point in the history
We are disabling RSS on HW but not updating the internal private status
to the 'disabled' state. This is needed for next tc commit that will
check if RSS is disabled before trying to apply filters.

Fixes: 4647e02 ("net: stmmac: selftests: Add selftest for L3/L4 Filters")
Signed-off-by: Jose Abreu <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
joabreu authored and davem330 committed Jan 10, 2020
1 parent db885e6 commit e715d74
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
Original file line number Diff line number Diff line change
Expand Up @@ -1323,16 +1323,19 @@ static int __stmmac_test_l3filt(struct stmmac_priv *priv, u32 dst, u32 src,
struct stmmac_packet_attrs attr = { };
struct flow_dissector *dissector;
struct flow_cls_offload *cls;
int ret, old_enable = 0;
struct flow_rule *rule;
int ret;

if (!tc_can_offload(priv->dev))
return -EOPNOTSUPP;
if (!priv->dma_cap.l3l4fnum)
return -EOPNOTSUPP;
if (priv->rss.enable)
if (priv->rss.enable) {
old_enable = priv->rss.enable;
priv->rss.enable = false;
stmmac_rss_configure(priv, priv->hw, NULL,
priv->plat->rx_queues_to_use);
}

dissector = kzalloc(sizeof(*dissector), GFP_KERNEL);
if (!dissector) {
Expand Down Expand Up @@ -1399,7 +1402,8 @@ static int __stmmac_test_l3filt(struct stmmac_priv *priv, u32 dst, u32 src,
cleanup_dissector:
kfree(dissector);
cleanup_rss:
if (priv->rss.enable) {
if (old_enable) {
priv->rss.enable = old_enable;
stmmac_rss_configure(priv, priv->hw, &priv->rss,
priv->plat->rx_queues_to_use);
}
Expand Down Expand Up @@ -1444,16 +1448,19 @@ static int __stmmac_test_l4filt(struct stmmac_priv *priv, u32 dst, u32 src,
struct stmmac_packet_attrs attr = { };
struct flow_dissector *dissector;
struct flow_cls_offload *cls;
int ret, old_enable = 0;
struct flow_rule *rule;
int ret;

if (!tc_can_offload(priv->dev))
return -EOPNOTSUPP;
if (!priv->dma_cap.l3l4fnum)
return -EOPNOTSUPP;
if (priv->rss.enable)
if (priv->rss.enable) {
old_enable = priv->rss.enable;
priv->rss.enable = false;
stmmac_rss_configure(priv, priv->hw, NULL,
priv->plat->rx_queues_to_use);
}

dissector = kzalloc(sizeof(*dissector), GFP_KERNEL);
if (!dissector) {
Expand Down Expand Up @@ -1525,7 +1532,8 @@ static int __stmmac_test_l4filt(struct stmmac_priv *priv, u32 dst, u32 src,
cleanup_dissector:
kfree(dissector);
cleanup_rss:
if (priv->rss.enable) {
if (old_enable) {
priv->rss.enable = old_enable;
stmmac_rss_configure(priv, priv->hw, &priv->rss,
priv->plat->rx_queues_to_use);
}
Expand Down

0 comments on commit e715d74

Please sign in to comment.