Fixes: 0a8c8a0b8ccc ("ethdev: check Rx/Tx offloads") Signed-off-by: Andrew Rybchenko <arybche...@solarflare.com> --- drivers/net/sfc/sfc_ethdev.c | 9 ++------- drivers/net/sfc/sfc_rx.c | 6 ++++-- drivers/net/sfc/sfc_rx.h | 3 +-- drivers/net/sfc/sfc_tx.c | 6 ++++-- drivers/net/sfc/sfc_tx.h | 3 +-- 5 files changed, 12 insertions(+), 15 deletions(-)
diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c index a77592fb9..578af5489 100644 --- a/drivers/net/sfc/sfc_ethdev.c +++ b/drivers/net/sfc/sfc_ethdev.c @@ -398,16 +398,14 @@ sfc_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id, { struct sfc_adapter *sa = dev->data->dev_private; int rc; - uint64_t offloads; sfc_log_init(sa, "RxQ=%u nb_rx_desc=%u socket_id=%u", rx_queue_id, nb_rx_desc, socket_id); sfc_adapter_lock(sa); - offloads = rx_conf->offloads | dev->data->dev_conf.rxmode.offloads; rc = sfc_rx_qinit(sa, rx_queue_id, nb_rx_desc, socket_id, - rx_conf, mb_pool, offloads); + rx_conf, mb_pool); if (rc != 0) goto fail_rx_qinit; @@ -456,16 +454,13 @@ sfc_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id, { struct sfc_adapter *sa = dev->data->dev_private; int rc; - uint64_t offloads; sfc_log_init(sa, "TxQ = %u, nb_tx_desc = %u, socket_id = %u", tx_queue_id, nb_tx_desc, socket_id); sfc_adapter_lock(sa); - offloads = tx_conf->offloads | dev->data->dev_conf.txmode.offloads; - rc = sfc_tx_qinit(sa, tx_queue_id, nb_tx_desc, socket_id, - tx_conf, offloads); + rc = sfc_tx_qinit(sa, tx_queue_id, nb_tx_desc, socket_id, tx_conf); if (rc != 0) goto fail_tx_qinit; diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c index dbdd000ad..1e533b551 100644 --- a/drivers/net/sfc/sfc_rx.c +++ b/drivers/net/sfc/sfc_rx.c @@ -973,8 +973,7 @@ int sfc_rx_qinit(struct sfc_adapter *sa, unsigned int sw_index, uint16_t nb_rx_desc, unsigned int socket_id, const struct rte_eth_rxconf *rx_conf, - struct rte_mempool *mb_pool, - uint64_t offloads) + struct rte_mempool *mb_pool) { const efx_nic_cfg_t *encp = efx_nic_cfg_get(sa->nic); struct sfc_rss *rss = &sa->rss; @@ -982,6 +981,7 @@ sfc_rx_qinit(struct sfc_adapter *sa, unsigned int sw_index, unsigned int rxq_entries; unsigned int evq_entries; unsigned int rxq_max_fill_level; + uint64_t offloads; uint16_t buf_size; struct sfc_rxq_info *rxq_info; struct sfc_evq *evq; @@ -996,6 +996,8 @@ sfc_rx_qinit(struct sfc_adapter *sa, unsigned int sw_index, SFC_ASSERT(rxq_entries <= EFX_RXQ_MAXNDESCS); SFC_ASSERT(rxq_max_fill_level <= nb_rx_desc); + offloads = rx_conf->offloads | + sa->eth_dev->data->dev_conf.rxmode.offloads; rc = sfc_rx_qcheck_conf(sa, rxq_max_fill_level, rx_conf, offloads); if (rc != 0) goto fail_bad_conf; diff --git a/drivers/net/sfc/sfc_rx.h b/drivers/net/sfc/sfc_rx.h index 2898fe514..3fba7d8ac 100644 --- a/drivers/net/sfc/sfc_rx.h +++ b/drivers/net/sfc/sfc_rx.h @@ -138,8 +138,7 @@ void sfc_rx_stop(struct sfc_adapter *sa); int sfc_rx_qinit(struct sfc_adapter *sa, unsigned int rx_queue_id, uint16_t nb_rx_desc, unsigned int socket_id, const struct rte_eth_rxconf *rx_conf, - struct rte_mempool *mb_pool, - uint64_t offloads); + struct rte_mempool *mb_pool); void sfc_rx_qfini(struct sfc_adapter *sa, unsigned int sw_index); int sfc_rx_qstart(struct sfc_adapter *sa, unsigned int sw_index); void sfc_rx_qstop(struct sfc_adapter *sa, unsigned int sw_index); diff --git a/drivers/net/sfc/sfc_tx.c b/drivers/net/sfc/sfc_tx.c index a4a21fa8e..9836600f9 100644 --- a/drivers/net/sfc/sfc_tx.c +++ b/drivers/net/sfc/sfc_tx.c @@ -135,8 +135,7 @@ sfc_tx_qflush_done(struct sfc_txq *txq) int sfc_tx_qinit(struct sfc_adapter *sa, unsigned int sw_index, uint16_t nb_tx_desc, unsigned int socket_id, - const struct rte_eth_txconf *tx_conf, - uint64_t offloads) + const struct rte_eth_txconf *tx_conf) { const efx_nic_cfg_t *encp = efx_nic_cfg_get(sa->nic); unsigned int txq_entries; @@ -147,6 +146,7 @@ sfc_tx_qinit(struct sfc_adapter *sa, unsigned int sw_index, struct sfc_txq *txq; int rc = 0; struct sfc_dp_tx_qcreate_info info; + uint64_t offloads; sfc_log_init(sa, "TxQ = %u", sw_index); @@ -159,6 +159,8 @@ sfc_tx_qinit(struct sfc_adapter *sa, unsigned int sw_index, SFC_ASSERT(txq_entries >= nb_tx_desc); SFC_ASSERT(txq_max_fill_level <= nb_tx_desc); + offloads = tx_conf->offloads | + sa->eth_dev->data->dev_conf.txmode.offloads; rc = sfc_tx_qcheck_conf(sa, txq_max_fill_level, tx_conf, offloads); if (rc != 0) goto fail_bad_conf; diff --git a/drivers/net/sfc/sfc_tx.h b/drivers/net/sfc/sfc_tx.h index d2b2c4dea..c2e5f13e9 100644 --- a/drivers/net/sfc/sfc_tx.h +++ b/drivers/net/sfc/sfc_tx.h @@ -121,8 +121,7 @@ void sfc_tx_close(struct sfc_adapter *sa); int sfc_tx_qinit(struct sfc_adapter *sa, unsigned int sw_index, uint16_t nb_tx_desc, unsigned int socket_id, - const struct rte_eth_txconf *tx_conf, - uint64_t offloads); + const struct rte_eth_txconf *tx_conf); void sfc_tx_qfini(struct sfc_adapter *sa, unsigned int sw_index); void sfc_tx_qflush_done(struct sfc_txq *txq); -- 2.17.0