From: Andrew Rybchenko <arybchenko@solarflare.com>
To: <dev@dpdk.org>
Cc: Ferruh Yigit <ferruh.yigit@intel.com>, Wei Dai <wei.dai@intel.com>
Subject: [dpdk-dev] [PATCH 1/3] net/sfc: avoid Rx/Tx queue init prototype changes
Date: Tue, 8 May 2018 16:04:22 +0100 [thread overview]
Message-ID: <1525791864-25269-2-git-send-email-arybchenko@solarflare.com> (raw)
In-Reply-To: <1525791864-25269-1-git-send-email-arybchenko@solarflare.com>
Fixes: 0a8c8a0b8ccc ("ethdev: check Rx/Tx offloads")
Signed-off-by: Andrew Rybchenko <arybchenko@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
next prev parent reply other threads:[~2018-05-08 15:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-08 15:04 [dpdk-dev] [PATCH 0/3] net/sfc: fix Rx/Tx offload checks Andrew Rybchenko
2018-05-08 15:04 ` Andrew Rybchenko [this message]
2018-05-08 15:04 ` [dpdk-dev] [PATCH 2/3] net/sfc: rely on supported device Tx offload check in ethdev Andrew Rybchenko
2018-05-08 15:04 ` [dpdk-dev] [PATCH 3/3] net/sfc: rely on supported device Rx " Andrew Rybchenko
2018-05-10 1:36 ` [dpdk-dev] [PATCH 0/3] net/sfc: fix Rx/Tx offload checks Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1525791864-25269-2-git-send-email-arybchenko@solarflare.com \
--to=arybchenko@solarflare.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=wei.dai@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).