* [dpdk-stable] [PATCH RFC v1 1/7] net/ena: remove duplicate barrier
[not found] <20200313091835.58039-1-gavin.hu@arm.com>
@ 2020-03-13 9:18 ` Gavin Hu
2020-03-13 9:18 ` [dpdk-stable] [PATCH RFC v1 2/7] net/ena: relax the barrier for doorbell ring Gavin Hu
` (2 subsequent siblings)
3 siblings, 0 replies; 4+ messages in thread
From: Gavin Hu @ 2020-03-13 9:18 UTC (permalink / raw)
To: dev
Cc: nd, david.marchand, thomas, mk, gtzalik, evgenys, igorch, mw,
Honnappa.Nagarahalli, ruifeng.wang, phil.yang, joyce.kong,
stable
As there is necessary barriers before calling the function everywhere,
then using the relaxed write function ENA_REG_WRITE32_RELAXED is ok.
Fixes: 99ecfbf845b3 ("ena: import communication layer")
Cc: stable@dpdk.org
Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
drivers/net/ena/base/ena_eth_com.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ena/base/ena_eth_com.h b/drivers/net/ena/base/ena_eth_com.h
index e37b642d4..e56c33a64 100644
--- a/drivers/net/ena/base/ena_eth_com.h
+++ b/drivers/net/ena/base/ena_eth_com.h
@@ -156,7 +156,7 @@ static inline int ena_com_write_sq_doorbell(struct ena_com_io_sq *io_sq)
ena_trc_dbg("write submission queue doorbell for queue: %d tail: %d\n",
io_sq->qid, tail);
- ENA_REG_WRITE32(io_sq->bus, tail, io_sq->db_addr);
+ ENA_REG_WRITE32_RELAXED(io_sq->bus, tail, io_sq->db_addr);
if (is_llq_max_tx_burst_exists(io_sq)) {
ena_trc_dbg("reset available entries in tx burst for queue %d to %d\n",
--
2.17.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-stable] [PATCH RFC v1 2/7] net/ena: relax the barrier for doorbell ring
[not found] <20200313091835.58039-1-gavin.hu@arm.com>
2020-03-13 9:18 ` [dpdk-stable] [PATCH RFC v1 1/7] net/ena: remove duplicate barrier Gavin Hu
@ 2020-03-13 9:18 ` Gavin Hu
2020-03-13 9:18 ` [dpdk-stable] [PATCH RFC v1 3/7] net/ena: relax the rmb for DMA Gavin Hu
2020-03-13 9:18 ` [dpdk-stable] [PATCH RFC v1 7/7] net/ena: remove duplicate memset Gavin Hu
3 siblings, 0 replies; 4+ messages in thread
From: Gavin Hu @ 2020-03-13 9:18 UTC (permalink / raw)
To: dev
Cc: nd, david.marchand, thomas, mk, gtzalik, evgenys, igorch, mw,
Honnappa.Nagarahalli, ruifeng.wang, phil.yang, joyce.kong,
stable
rte_cio_wmb is a light weight version of IO memory barrier that
guarantees that the stores to the coherent memory prior to the
the rte_cio_rmb() call are visible to the NIC HW before the doorbell
ring(or any other stores to the MMIO registers) that follows it.[1]
Fixes: 5e02e19eb14e ("net/ena: fix unneeded doorbell submission")
Cc: stable@dpdk.org
[1] http://code.dpdk.org/dpdk/v20.02/source/lib/librte_eal/common/
include/generic/rte_atomic.h#L137
Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
drivers/net/ena/ena_ethdev.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 665afee4f..c268788fd 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -1425,7 +1425,7 @@ static int ena_populate_rx_queue(struct ena_ring *rxq, unsigned int count)
* Add memory barrier to make sure the desc were written before
* issue a doorbell
*/
- rte_wmb();
+ rte_cio_wmb();
ena_com_write_sq_doorbell(rxq->ena_com_io_sq);
rxq->next_to_use = next_to_use;
@@ -2344,7 +2344,7 @@ static uint16_t eth_ena_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
PMD_DRV_LOG(DEBUG, "llq tx max burst size of queue %d"
" achieved, writing doorbell to send burst\n",
tx_ring->id);
- rte_wmb();
+ rte_cio_wmb();
ena_com_write_sq_doorbell(tx_ring->ena_com_io_sq);
}
@@ -2367,7 +2367,7 @@ static uint16_t eth_ena_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
/* If there are ready packets to be xmitted... */
if (sent_idx > 0) {
/* ...let HW do its best :-) */
- rte_wmb();
+ rte_cio_wmb();
ena_com_write_sq_doorbell(tx_ring->ena_com_io_sq);
tx_ring->tx_stats.doorbells++;
tx_ring->next_to_use = next_to_use;
--
2.17.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-stable] [PATCH RFC v1 3/7] net/ena: relax the rmb for DMA
[not found] <20200313091835.58039-1-gavin.hu@arm.com>
2020-03-13 9:18 ` [dpdk-stable] [PATCH RFC v1 1/7] net/ena: remove duplicate barrier Gavin Hu
2020-03-13 9:18 ` [dpdk-stable] [PATCH RFC v1 2/7] net/ena: relax the barrier for doorbell ring Gavin Hu
@ 2020-03-13 9:18 ` Gavin Hu
2020-03-13 9:18 ` [dpdk-stable] [PATCH RFC v1 7/7] net/ena: remove duplicate memset Gavin Hu
3 siblings, 0 replies; 4+ messages in thread
From: Gavin Hu @ 2020-03-13 9:18 UTC (permalink / raw)
To: dev
Cc: nd, david.marchand, thomas, mk, gtzalik, evgenys, igorch, mw,
Honnappa.Nagarahalli, ruifeng.wang, phil.yang, joyce.kong,
stable
The user space DPDK rte_cio_rmb barrier in definition corresponds to the
kernel dma_rmb barrier on all supported architectures[1][2][3].
As it is called in the data path[4], redefine it to relax the barrier and
uplift the performance.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/
linux.git/tree/arch/x86/include/asm/barrier.h?h=v5.5#n54
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/
linux.git/tree/arch/powerpc/include/asm/barrier.h?h=v5.5#n46
[3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/
linux.git/tree/arch/arm64/include/asm/barrier.h?h=v5.5#n48
[4] http://code.dpdk.org/dpdk/v20.02/source/drivers/net/ena/
ena_ethdev.c#L2021
Fixes: b68309be44c0 ("net/ena/base: update communication layer for the ENAv2")
Cc: stable@dpdk.org
Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
drivers/net/ena/base/ena_plat_dpdk.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ena/base/ena_plat_dpdk.h b/drivers/net/ena/base/ena_plat_dpdk.h
index b611fb204..60327a726 100644
--- a/drivers/net/ena/base/ena_plat_dpdk.h
+++ b/drivers/net/ena/base/ena_plat_dpdk.h
@@ -254,7 +254,7 @@ extern uint32_t ena_alloc_cnt;
#define msleep(x) rte_delay_us(x * 1000)
#define udelay(x) rte_delay_us(x)
-#define dma_rmb() rmb()
+#define dma_rmb() rte_cio_rmb()
#define MAX_ERRNO 4095
#define IS_ERR(x) (((unsigned long)x) >= (unsigned long)-MAX_ERRNO)
--
2.17.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-stable] [PATCH RFC v1 7/7] net/ena: remove duplicate memset
[not found] <20200313091835.58039-1-gavin.hu@arm.com>
` (2 preceding siblings ...)
2020-03-13 9:18 ` [dpdk-stable] [PATCH RFC v1 3/7] net/ena: relax the rmb for DMA Gavin Hu
@ 2020-03-13 9:18 ` Gavin Hu
3 siblings, 0 replies; 4+ messages in thread
From: Gavin Hu @ 2020-03-13 9:18 UTC (permalink / raw)
To: dev
Cc: nd, david.marchand, thomas, mk, gtzalik, evgenys, igorch, mw,
Honnappa.Nagarahalli, ruifeng.wang, phil.yang, joyce.kong,
stable
There is a memset operation for the whole structure so no need
to memset the sub fields in it.
Fixes: 1173fca25af9 ("ena: add polling-mode driver")
Cc: stable@dpdk.org
Suggested-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
drivers/net/ena/ena_ethdev.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 8b566aecd..ab28cfc42 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -2280,8 +2280,6 @@ static uint16_t eth_ena_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
/* Prepare TX context */
memset(&ena_tx_ctx, 0x0, sizeof(struct ena_com_tx_ctx));
- memset(&ena_tx_ctx.ena_meta, 0x0,
- sizeof(struct ena_com_tx_meta));
ena_tx_ctx.ena_bufs = ebuf;
ena_tx_ctx.req_id = req_id;
--
2.17.1
^ permalink raw reply [flat|nested] 4+ messages in thread