Re: [dpdk-dev] [PATCH] net/mlx5: fix Tx doorbell memory barrier

2017-10-22 Thread Sagi Grimberg
Configuring UAR as IO-mapped makes maximum throughput decline by noticeable amount. If UAR is configured as write-combining register, a write memory barrier is needed on ringing a doorbell. rte_wmb() is mostly effective when the size of a burst is comparatively small. Personally I don't think

[dpdk-dev] [PATCH 1/2] net/mlx5: replace memory barrier type

2017-08-21 Thread Sagi Grimberg
ff-by: Yongseok Koh Signed-off-by: Alexander Solganik Signed-off-by: Sagi Grimberg --- drivers/net/mlx5/mlx5_rxtx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h index 7de1d10863e5..59b9ff24fb82 100644 --- a/drivers/net

[dpdk-dev] [PATCH 0/2] mlx5 high latency observed on send operations

2017-08-21 Thread Sagi Grimberg
When measuring latency when running a latency critical workload on mlx5 pmd drivers we noticed high latency can occur due to delayed doorbell record update flush. This can be reproduced using the simple program [1] against testpmd macswap fwd mode. This utility sends a raw ethernet frame to the dp

[dpdk-dev] [PATCH 2/2] net/mlx5: don't map doorbell register to write combining

2017-08-21 Thread Sagi Grimberg
doorbell after its write, setting the mapping to un-cached by default. Such change is reduces the max and average round trip latency significantly. Reported-by: Alexander Solganik Signed-off-by: Shahaf Shuler Signed-off-by: Yongseok Koh Signed-off-by: Alexander Solganik Signed-off-by: Sagi Grimberg

Re: [dpdk-dev] [PATCH 1/2] net/mlx5: fix missing packet type calculation

2017-07-30 Thread Sagi Grimberg
Looks good, Reviewed-by: Sagi Grimberg

Re: [dpdk-dev] [PATCH 2/2] net/mlx5: fix L4 packet type support

2017-07-30 Thread Sagi Grimberg
Looks good, Reviewed-by: Sagi Grimberg

Re: [dpdk-dev] [PATCH] net/mlx5: poll completion queue once per a call

2017-07-27 Thread Sagi Grimberg
er small. Yea, I don't mind merging it in given that I don't have time to come up with anything better (or worse :)) Reviewed-by: Sagi Grimberg

Re: [dpdk-dev] Question on mlx5 PMD txq memory registration

2017-07-27 Thread Sagi Grimberg
Well, this is a fair argument, but without a *complete* solution for all of dpdk peripherals, it has very little merit (if at all). A badly written code can just as easily crash a server by passing a mbuf to a crypto device or another network device that co-exists with mlx5. So, while I underst

Re: [dpdk-dev] [PATCH] net/mlx5: poll completion queue once per a call

2017-07-23 Thread Sagi Grimberg
mlx5_tx_complete() polls completion queue multiple times until it encounters an invalid entry. As Tx completions are suppressed by MLX5_TX_COMP_THRESH, it is waste of cycles to expect multiple completions in a poll. And freeing too many buffers in a call can cause high jitter. This patch improves

Re: [dpdk-dev] Question on mlx5 PMD txq memory registration

2017-07-23 Thread Sagi Grimberg
I don't understand the security argument. Its completely private to the driver. anything under librte is equivalent to an OS wrt networking, so I fail to see what is the security feature your talking about. You are correct that as a root you are able to do whatever you want on the server. Th

Re: [dpdk-dev] [PATCH] net/mlx5: poll completion queue once per a call

2017-07-20 Thread Sagi Grimberg
mlx5_tx_complete() polls completion queue multiple times until it encounters an invalid entry. As Tx completions are suppressed by MLX5_TX_COMP_THRESH, it is waste of cycles to expect multiple completions in a poll. And freeing too many buffers in a call can cause high jitter. This patch improve

Re: [dpdk-dev] Question on mlx5 PMD txq memory registration

2017-07-20 Thread Sagi Grimberg
As I said, there are primitives which are designed to handle frequent reads and rare mutations. Even with such primitives, rarely lock is more than never lock. You do realize that the cache mutation involves ibv_dereg_mr() right? Any locking scheme for mutation is negligible compared to that

Re: [dpdk-dev] Question on mlx5 PMD txq memory registration

2017-07-20 Thread Sagi Grimberg
Its worse than just a drop, without debug enabled the error completion is ignored, and the wqe_pi is taken from an invalid field, which leads to bogus mbufs free (elts_tail is not valid). Right A simple work-around would be to simply fill a correct tail so that error completions will still h

Re: [dpdk-dev] Question on mlx5 PMD txq memory registration

2017-07-18 Thread Sagi Grimberg
There is none, if you send a burst of 9 packets each one coming from a different mempool the first one will be dropped. Its worse than just a drop, without debug enabled the error completion is ignored, and the wqe_pi is taken from an invalid field, which leads to bogus mbufs free (elts_tail i

[dpdk-dev] Question on mlx5 PMD txq memory registration

2017-07-17 Thread Sagi Grimberg
Hi, Looking at the code, it looks like mlx5 keeps a MR cache per TX queue (each MR registers a rte_mempool). Once a TX queue is created, mlx5 scans existing mempools and pre-registers a MR for each mempool it meets (using rte_mempool_walk). For each MR registration that exceeds the TX queue cach

[dpdk-dev] [PATCH v3] net/mlx5: fix possible NULL deref in Rx path

2016-08-02 Thread Sagi Grimberg
eeing it. Fixes: a1bdb71a32da ("net/mlx5: fix crash in Rx") Signed-off-by: Sagi Grimberg Acked-by: Adrien Mazarguil --- Changes from v2: - fix check-git-log.sh complaints - collected acked-by tag Changes from v1: - check pkt only once in case we failed to allocate a buffer drivers/ne

[dpdk-dev] [PATCH v2] net/mlx5: Fix possible NULL deref in RX path

2016-08-02 Thread Sagi Grimberg
eeing it. Fixes: a1bdb71a32da ("net/mlx5: fix crash in Rx") Signed-off-by: Sagi Grimberg --- Changes from v1: - check pkt only once in case we failed to allocate a buffer drivers/net/mlx5/mlx5_rxtx.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/

[dpdk-dev] [PATCH] net/mlx5: Fix possible NULL deref in RX path

2016-08-02 Thread Sagi Grimberg
On 02/08/16 12:58, Adrien Mazarguil wrote: > On Tue, Aug 02, 2016 at 12:31:35PM +0300, Sagi Grimberg wrote: >> >> >> On 01/08/16 19:43, Adrien Mazarguil wrote: >>> Hi Sagi, >>> >>> On Mon, Aug 01, 2016 at 11:44:21AM +0300, Sagi Grimberg wrote:

[dpdk-dev] [PATCH] net/mlx5: Fix possible NULL deref in RX path

2016-08-02 Thread Sagi Grimberg
On 01/08/16 19:43, Adrien Mazarguil wrote: > Hi Sagi, > > On Mon, Aug 01, 2016 at 11:44:21AM +0300, Sagi Grimberg wrote: >> The user is allowed to call ->rx_pkt_burst() even without free >> mbufs in the pool. In this scenario we'll fail allocating a rep mbuf >>

[dpdk-dev] [PATCH] net/mlx5: Fix possible NULL deref in RX path

2016-08-01 Thread Sagi Grimberg
eeing it. Signed-off-by: Sagi Grimberg --- drivers/net/mlx5/mlx5_rxtx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index fce3381ae87a..a07cc4794023 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/