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] Question on mlx5 PMD txq memory registration

2017-07-24 Thread Bruce Richardson
On Sun, Jul 23, 2017 at 12:03:41PM +0300, Sagi Grimberg wrote: > > > > 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. >

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] Question on mlx5 PMD txq memory registration

2017-07-23 Thread Shahaf Shuler
Thursday, July 20, 2017 7:22 PM, 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

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 Shahaf Shuler
Hi Sagi, Thursday, July 20, 2017 5:06 PM, 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-arou

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-20 Thread Nélio Laranjeiro
On Wed, Jul 19, 2017 at 09:21:39AM +0300, Sagi Grimberg wrote: > > > 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

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

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

2017-07-17 Thread Nélio Laranjeiro
Hello Sagi, On Mon, Jul 17, 2017 at 04:29:34PM +0300, Sagi Grimberg wrote: > 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 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