[dpdk-dev] [PATCH] net/sfc: add device state check to reta update operation
Andrew Rybchenko
arybchenko at solarflare.com
Tue Oct 3 09:43:54 CEST 2017
From: Ivan Malov <ivan.malov at oktetlabs.ru>
The callback must not attempt to program RSS table to the HW
in non-started state; the new table must be remembered and
applied on the next start
Fixes: 32bcfb0a50b1 ("net/sfc: update RSS redirection table")
Cc: stable at dpdk.org
Signed-off-by: Ivan Malov <ivan.malov at oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko at solarflare.com>
Reviewed-by: Andy Moreton <amoreton at solarflare.com>
---
drivers/net/sfc/sfc_ethdev.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index 9e65b6a..8650f87 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -1399,11 +1399,16 @@ sfc_dev_rss_reta_update(struct rte_eth_dev *dev,
}
}
- rc = efx_rx_scale_tbl_set(sa->nic, EFX_RSS_CONTEXT_DEFAULT,
- rss_tbl_new, EFX_RSS_TBL_SIZE);
- if (rc == 0)
- rte_memcpy(sa->rss_tbl, rss_tbl_new, sizeof(sa->rss_tbl));
+ if (sa->state == SFC_ADAPTER_STARTED) {
+ rc = efx_rx_scale_tbl_set(sa->nic, EFX_RSS_CONTEXT_DEFAULT,
+ rss_tbl_new, EFX_RSS_TBL_SIZE);
+ if (rc != 0)
+ goto fail_scale_tbl_set;
+ }
+
+ rte_memcpy(sa->rss_tbl, rss_tbl_new, sizeof(sa->rss_tbl));
+fail_scale_tbl_set:
bad_reta_entry:
sfc_adapter_unlock(sa);
--
2.7.4
More information about the dev
mailing list