* [dpdk-dev] [PATCH 0/3] net/sfc: fix Rx/Tx offload checks
@ 2018-05-08 15:04 Andrew Rybchenko
2018-05-08 15:04 ` [dpdk-dev] [PATCH 1/3] net/sfc: avoid Rx/Tx queue init prototype changes Andrew Rybchenko
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Andrew Rybchenko @ 2018-05-08 15:04 UTC (permalink / raw)
To: dev; +Cc: Ferruh Yigit, Wei Dai
The patch series applies net/sfc review notes in [1].
Feel free to sqaush these fixes into [1] on apply.
Fixes reference is incorrect (since [1] is not applied yet) and
provided just as a hint.
[1] https://dpdk.org/ml/archives/dev/2018-May/100465.html
Andrew Rybchenko (3):
net/sfc: avoid Rx/Tx queue init prototype changes
net/sfc: rely on supported device Tx offload check in ethdev
net/sfc: rely on supported device Rx offload check in ethdev
drivers/net/sfc/sfc_ethdev.c | 9 ++-------
drivers/net/sfc/sfc_rx.c | 31 ++++---------------------------
drivers/net/sfc/sfc_rx.h | 3 +--
drivers/net/sfc/sfc_tx.c | 31 ++++---------------------------
drivers/net/sfc/sfc_tx.h | 3 +--
5 files changed, 12 insertions(+), 65 deletions(-)
--
2.17.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [PATCH 1/3] net/sfc: avoid Rx/Tx queue init prototype changes
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
2018-05-08 15:04 ` [dpdk-dev] [PATCH 2/3] net/sfc: rely on supported device Tx offload check in ethdev Andrew Rybchenko
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Andrew Rybchenko @ 2018-05-08 15:04 UTC (permalink / raw)
To: dev; +Cc: Ferruh Yigit, Wei Dai
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [PATCH 2/3] net/sfc: rely on supported device Tx offload check in ethdev
2018-05-08 15:04 [dpdk-dev] [PATCH 0/3] net/sfc: fix Rx/Tx offload checks Andrew Rybchenko
2018-05-08 15:04 ` [dpdk-dev] [PATCH 1/3] net/sfc: avoid Rx/Tx queue init prototype changes Andrew Rybchenko
@ 2018-05-08 15:04 ` 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
3 siblings, 0 replies; 5+ messages in thread
From: Andrew Rybchenko @ 2018-05-08 15:04 UTC (permalink / raw)
To: dev; +Cc: Ferruh Yigit, Wei Dai
Fixes: 0a8c8a0b8ccc ("ethdev: check Rx/Tx offloads")
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
drivers/net/sfc/sfc_tx.c | 25 -------------------------
1 file changed, 25 deletions(-)
diff --git a/drivers/net/sfc/sfc_tx.c b/drivers/net/sfc/sfc_tx.c
index 9836600f9..579bfab7e 100644
--- a/drivers/net/sfc/sfc_tx.c
+++ b/drivers/net/sfc/sfc_tx.c
@@ -73,22 +73,6 @@ sfc_tx_get_queue_offload_caps(struct sfc_adapter *sa)
return caps;
}
-static void
-sfc_tx_log_offloads(struct sfc_adapter *sa, const char *offload_group,
- const char *verdict, uint64_t offloads)
-{
- unsigned long long bit;
-
- while ((bit = __builtin_ffsll(offloads)) != 0) {
- uint64_t flag = (1ULL << --bit);
-
- sfc_err(sa, "Tx %s offload %s %s", offload_group,
- rte_eth_dev_tx_offload_name(flag), verdict);
-
- offloads &= ~flag;
- }
-}
-
static int
sfc_tx_qcheck_conf(struct sfc_adapter *sa, unsigned int txq_max_fill_level,
const struct rte_eth_txconf *tx_conf,
@@ -282,9 +266,6 @@ sfc_tx_qinit_info(struct sfc_adapter *sa, unsigned int sw_index)
static int
sfc_tx_check_mode(struct sfc_adapter *sa, const struct rte_eth_txmode *txmode)
{
- uint64_t offloads_supported = sfc_tx_get_dev_offload_caps(sa) |
- sfc_tx_get_queue_offload_caps(sa);
- uint64_t offloads_rejected = txmode->offloads & ~offloads_supported;
int rc = 0;
switch (txmode->mq_mode) {
@@ -315,12 +296,6 @@ sfc_tx_check_mode(struct sfc_adapter *sa, const struct rte_eth_txmode *txmode)
rc = EINVAL;
}
- if (offloads_rejected) {
- sfc_tx_log_offloads(sa, "device", "is unsupported",
- offloads_rejected);
- rc = EINVAL;
- }
-
return rc;
}
--
2.17.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [PATCH 3/3] net/sfc: rely on supported device Rx offload check in ethdev
2018-05-08 15:04 [dpdk-dev] [PATCH 0/3] net/sfc: fix Rx/Tx offload checks Andrew Rybchenko
2018-05-08 15:04 ` [dpdk-dev] [PATCH 1/3] net/sfc: avoid Rx/Tx queue init prototype changes Andrew Rybchenko
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 ` Andrew Rybchenko
2018-05-10 1:36 ` [dpdk-dev] [PATCH 0/3] net/sfc: fix Rx/Tx offload checks Ferruh Yigit
3 siblings, 0 replies; 5+ messages in thread
From: Andrew Rybchenko @ 2018-05-08 15:04 UTC (permalink / raw)
To: dev; +Cc: Ferruh Yigit, Wei Dai
Fixes: 0a8c8a0b8ccc ("ethdev: check Rx/Tx offloads")
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
drivers/net/sfc/sfc_rx.c | 25 -------------------------
1 file changed, 25 deletions(-)
diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index 1e533b551..cc76a5b15 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -814,22 +814,6 @@ sfc_rx_get_queue_offload_caps(struct sfc_adapter *sa)
return caps;
}
-static void
-sfc_rx_log_offloads(struct sfc_adapter *sa, const char *offload_group,
- const char *verdict, uint64_t offloads)
-{
- unsigned long long bit;
-
- while ((bit = __builtin_ffsll(offloads)) != 0) {
- uint64_t flag = (1ULL << --bit);
-
- sfc_err(sa, "Rx %s offload %s %s", offload_group,
- rte_eth_dev_rx_offload_name(flag), verdict);
-
- offloads &= ~flag;
- }
-}
-
static int
sfc_rx_qcheck_conf(struct sfc_adapter *sa, unsigned int rxq_max_fill_level,
const struct rte_eth_rxconf *rx_conf,
@@ -1441,9 +1425,6 @@ static int
sfc_rx_check_mode(struct sfc_adapter *sa, struct rte_eth_rxmode *rxmode)
{
struct sfc_rss *rss = &sa->rss;
- uint64_t offloads_supported = sfc_rx_get_dev_offload_caps(sa) |
- sfc_rx_get_queue_offload_caps(sa);
- uint64_t offloads_rejected = rxmode->offloads & ~offloads_supported;
int rc = 0;
switch (rxmode->mq_mode) {
@@ -1462,12 +1443,6 @@ sfc_rx_check_mode(struct sfc_adapter *sa, struct rte_eth_rxmode *rxmode)
rc = EINVAL;
}
- if (offloads_rejected) {
- sfc_rx_log_offloads(sa, "device", "is unsupported",
- offloads_rejected);
- rc = EINVAL;
- }
-
if (~rxmode->offloads & DEV_RX_OFFLOAD_CRC_STRIP) {
sfc_warn(sa, "FCS stripping cannot be disabled - always on");
rxmode->offloads |= DEV_RX_OFFLOAD_CRC_STRIP;
--
2.17.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH 0/3] net/sfc: fix Rx/Tx offload checks
2018-05-08 15:04 [dpdk-dev] [PATCH 0/3] net/sfc: fix Rx/Tx offload checks Andrew Rybchenko
` (2 preceding siblings ...)
2018-05-08 15:04 ` [dpdk-dev] [PATCH 3/3] net/sfc: rely on supported device Rx " Andrew Rybchenko
@ 2018-05-10 1:36 ` Ferruh Yigit
3 siblings, 0 replies; 5+ messages in thread
From: Ferruh Yigit @ 2018-05-10 1:36 UTC (permalink / raw)
To: Andrew Rybchenko, dev; +Cc: Wei Dai
On 5/8/2018 4:04 PM, Andrew Rybchenko wrote:
> The patch series applies net/sfc review notes in [1].
> Feel free to sqaush these fixes into [1] on apply.
>
> Fixes reference is incorrect (since [1] is not applied yet) and
> provided just as a hint.
>
> [1] https://dpdk.org/ml/archives/dev/2018-May/100465.html
>
> Andrew Rybchenko (3):
> net/sfc: avoid Rx/Tx queue init prototype changes
> net/sfc: rely on supported device Tx offload check in ethdev
> net/sfc: rely on supported device Rx offload check in ethdev
Series applied to dpdk-next-net/master, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-05-10 1:36 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-08 15:04 [dpdk-dev] [PATCH 0/3] net/sfc: fix Rx/Tx offload checks Andrew Rybchenko
2018-05-08 15:04 ` [dpdk-dev] [PATCH 1/3] net/sfc: avoid Rx/Tx queue init prototype changes Andrew Rybchenko
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
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).