[dpdk-dev] [PATCH] vhost: add back support for concurrent enqueue

2016-08-23 Thread Rich Lane
On Mon, Aug 22, 2016 at 7:16 AM, Yuanhan Liu wrote: > On Thu, Aug 18, 2016 at 11:27:06AM -0700, Rich Lane wrote: > > On Mon, Aug 15, 2016 at 7:37 PM, Yuanhan Liu < > yuanhan.liu at linux.intel.com> > > wrote: > > > > On Mon, Aug 15, 2016

[dpdk-dev] [PATCH] vhost: add back support for concurrent enqueue

2016-08-18 Thread Rich Lane
On Mon, Aug 15, 2016 at 7:37 PM, Yuanhan Liu wrote: > On Mon, Aug 15, 2016 at 01:00:24PM -0700, Rich Lane wrote: > > Concurrent enqueue is an important performance optimization when the > number > > of cores used for switching is different than the number of vhost queues. >

[dpdk-dev] [PATCH] vhost: add back support for concurrent enqueue

2016-08-15 Thread Rich Lane
rom "vhost: avoid reordering of used->idx and last_used_idx updating". Signed-off-by: Rich Lane --- lib/librte_vhost/rte_vhost_version.map | 6 +++ lib/librte_vhost/rte_virtio_net.h | 19 + lib/librte_vhost/vhost-net.h | 2 + lib/librte_vhost/vho

[dpdk-dev] [PATCH] net/i40e: fix null pointer dereferences when using VMDQ+RSS

2016-08-02 Thread Rich Lane
4537128394 ("i40e: free queue memory when closing") Fixes: 8e109464c022 ("i40e: allow vector Rx and Tx usage") Signed-off-by: Rich Lane --- drivers/net/i40e/i40e_rxtx.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/net/i40e/

[dpdk-dev] [PATCH] doc: deprecate vhost-cuse

2016-07-27 Thread Rich Lane
t; > The remove would also result to a much cleaner code base, allowing us > > > to do all kinds of extending easier. > > > > > > So here to mark vhost-cuse as deprecated in this release and will be > > > removed in the next release (v16.11). > > > > > > Signed-off-by: Yuanhan Liu > > > > Acked-by: Ciara Loftus > > Acked-by: Thomas Monjalon > Acked-by: Rich Lane

[dpdk-dev] [PATCH] vhost: fix segfault on bad descriptor address.

2016-07-13 Thread Rich Lane
On Wednesday, July 13, 2016, Yuanhan Liu wrote: > On Wed, Jul 13, 2016 at 10:34:07AM +0300, Ilya Maximets wrote: > > This scenario fixed somehow, I agree. But this patch still needed to > protect > > vhost from untrusted VM, from malicious or buggy virtio application. > > Maybe we could change

[dpdk-dev] [PATCH] vhost: reset queue state in destroy_device

2016-07-01 Thread Rich Lane
Fixes a bug where rte_eth_vhost_get_queue_event would not return enabled queues after a guest application restart. Fixes: ee584e9710b9 ("vhost: add driver on top of the library") Signed-off-by: Rich Lane --- drivers/net/vhost/rte_eth_vhost.c | 10 ++ 1 file changed, 10

[dpdk-dev] [PATCH v3 08/20] vhost: introduce new API to export numa node

2016-06-08 Thread Rich Lane
On Mon, Jun 6, 2016 at 8:51 PM, Yuanhan Liu wrote: > > @@ -248,14 +248,9 @@ new_device(struct virtio_net *dev) > internal = eth_dev->data->dev_private; > > #ifdef RTE_LIBRTE_VHOST_NUMA > - ret = get_mempolicy(, NULL, 0, dev, > - MPOL_F_NODE | MPOL_F_ADDR); >

[dpdk-dev] [PATCH] vhost: fix segfault on bad descriptor address.

2016-06-02 Thread Rich Lane
On Thu, Jun 2, 2016 at 3:46 AM, Ilya Maximets wrote: > Hi, Rich. > Thank you for testing and analysing. > > On 01.06.2016 01:06, Rich Lane wrote: > > On Fri, May 20, 2016 at 5:50 AM, Ilya Maximets <mailto:i.maximets at samsung.com>> wrote: > > > > In c

[dpdk-dev] [PATCH] vhost: fix segfault on bad descriptor address.

2016-05-31 Thread Rich Lane
On Fri, May 20, 2016 at 5:50 AM, Ilya Maximets wrote: > In current implementation guest application can reinitialize vrings > by executing start after stop. In the same time host application > can still poll virtqueue while device stopped in guest and it will > crash with segmentation fault

[dpdk-dev] [PATCH v2 00/19] vhost ABI/API refactoring

2016-05-26 Thread Rich Lane
pdated version.map > Tested-by: Rich Lane Acked-by: Rich Lane

[dpdk-dev] [PATCH] af_packet: add byte counters

2016-05-26 Thread Rich Lane
On Thu, May 26, 2016 at 7:47 AM, Ferruh Yigit wrote: > On 5/25/2016 10:03 PM, Rich Lane wrote: > > Signed-off-by: Rich Lane > > Reviewed-by: Ferruh Yigit > > > While testing this, independent from patch applied or not , I am getting > following assertion after rand

[dpdk-dev] [PATCH] af_packet: add byte counters

2016-05-25 Thread Rich Lane
Signed-off-by: Rich Lane --- drivers/net/af_packet/rte_eth_af_packet.c | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c index f17bd7e..2d7f344 100644 --- a/drivers/net

[dpdk-dev] [PATCH v2 6/6] vhost: add pmd client and reconnect option

2016-05-25 Thread Rich Lane
> > @@ -817,6 +821,9 @@ rte_pmd_vhost_devinit(const char *name, const char > *params) > int ret = 0; > char *iface_name; > uint16_t queues; > + uint64_t flags = 0; > + int client_mode; > + int reconnect; > client_mode and reconnect are not initialized if

[dpdk-dev] [PATCH 0/3] [RFC] vhost: micro vhost optimization

2016-05-10 Thread Rich Lane
I see a significant performance improvement with these patches, around 5% at 64 bytes. The one patch that didn't give any performance boost for me was "vhost: arrange virtio_net fields for better cache sharing". Tested-by: Rich Lane On Mon, May 2, 2016 at 5:46 PM, Yuanhan Liu wrot

[dpdk-dev] [PATCH 10/16] vhost: export vid as the only interface to applications

2016-05-10 Thread Rich Lane
On Tue, May 10, 2016 at 9:39 AM, Yuanhan Liu wrote: > > Rich, would you help try by adding following line there and > do a test? It would be great if this patch has your Tested-by :) > > internal->vid = vid; > The problem is new_device has already returned before that point because

[dpdk-dev] [PATCH 10/16] vhost: export vid as the only interface to applications

2016-05-10 Thread Rich Lane
On Mon, May 2, 2016 at 3:25 PM, Yuanhan Liu wrote: > With all the previous prepare works, we are just one step away from > the final ABI refactoring. That is, to change current API to let them > stick to vid instead of the old virtio_net dev. > This patch removes the only assignment to

[dpdk-dev] [PATCH] vhost: call rte_vhost_enable_guest_notification only on enabled queues

2016-04-06 Thread Rich Lane
If the vhost PMD were configured with more queues than the guest, the old code would segfault in rte_vhost_enable_guest_notification due to a NULL virtqueue pointer. Fixes: ee584e9710b9 ("vhost: add driver on top of the library") Signed-off-by: Rich Lane --- drivers/net/vhost/rte_e

[dpdk-dev] [PATCH v2] virtio: use zeroed memory for simple TX header

2016-04-04 Thread Rich Lane
ch. Fixes: 6dc5de3a (virtio: use indirect ring elements) Signed-off-by: Rich Lane --- v1-v2: - Use offsetof to get address of tx_hdr drivers/net/virtio/virtio_rxtx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rx

[dpdk-dev] [PATCH] virtio: use zeroed memory for simple TX header

2016-04-04 Thread Rich Lane
On Mon, Apr 4, 2016 at 1:05 PM, Yuanhan Liu wrote: > On Mon, Apr 04, 2016 at 03:13:37PM +0200, Thomas Monjalon wrote: > > Huawei, Yuanhan, any comment? > > > > 2016-03-31 13:01, Rich Lane: > > > vq->v

[dpdk-dev] [PATCH] virtio: use zeroed memory for simple TX header

2016-03-31 Thread Rich Lane
Signed-off-by: Rich Lane --- drivers/net/virtio/virtio_rxtx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c index 2b88efd..1df2df6 100644 --- a/drivers/net/virtio/virtio_rxtx.c +++ b/drivers/net/virtio/vir

[dpdk-dev] [PATCH v6] cfgfile: support looking up sections by index

2016-02-25 Thread Rich Lane
This is useful when sections have duplicate names. Signed-off-by: Rich Lane --- v5->v6: - Reordered sectionname argument in comment. v4->v5: - Reordered sectionname argument. v3->v4: - Added section name return value. - Updated API docs for other functions. v2->v3 - Added check for i

[dpdk-dev] [PATCH v5] cfgfile: support looking up sections by index

2016-02-22 Thread Rich Lane
This is useful when sections have duplicate names. Signed-off-by: Rich Lane --- v4->v5: - Reordered sectionname argument. v3->v4: - Added section name return value. - Updated API docs for other functions. v2->v3 - Added check for index < 0. v1->v2: - Added new symbol to versio

[dpdk-dev] [PATCH v3] vhost: remove vhost_net_device_ops

2016-02-19 Thread Rich Lane
The indirection is unnecessary because there is only one implementation of the vhost common code. Removing it makes the code more readable. Signed-off-by: Rich Lane Acked-by: Yuanhan Liu --- v2->v3: - Rebased. v1->v2: - Fix long lines. examples/vhost_xen/virtio-net.h | 2

[dpdk-dev] [PATCH v2] vhost: remove vhost_net_device_ops

2016-02-16 Thread Rich Lane
The indirection is unnecessary because there is only one implementation of the vhost common code. Removing it makes the code more readable. Signed-off-by: Rich Lane --- v1->v2: - Fix long lines. examples/vhost_xen/virtio-net.h | 2 - lib/librte_vhost/vhost-ne

[dpdk-dev] [PATCH] vhost: remove vhost_net_device_ops

2016-02-10 Thread Rich Lane
The indirection is unnecessary because there is only one implementation of the vhost common code. Removing it makes the code more readable. Signed-off-by: Rich Lane --- examples/vhost_xen/virtio-net.h | 2 - lib/librte_vhost/vhost-net.h | 40 +--- lib

[dpdk-dev] [PATCH v2] cfgfile: support looking up sections by index

2016-02-10 Thread Rich Lane
On Tue, Feb 2, 2016 at 7:10 AM, Dumitrescu, Cristian < cristian.dumitrescu at intel.com> wrote: > > > > -Original Message----- > > From: Rich Lane [mailto:rich.lane at bigswitch.com] > > Sent: Tuesday, January 19, 2016 4:42 AM > > To: dev at dpdk.org

[dpdk-dev] [PATCH v3] cfgfile: support looking up sections by index

2016-02-10 Thread Rich Lane
This is useful when sections have duplicate names. Signed-off-by: Rich Lane --- v2->v3 - Added check for index < 0. v1->v2: - Added new symbol to version script. lib/librte_cfgfile/rte_cfgfile.c | 16 lib/librte_cfgfile/rte_cfgfile.h

[dpdk-dev] [PATCH v3] vhost: fix leak of fds and mmaps

2016-02-10 Thread Rich Lane
e only compile tested. Signed-off-by: Rich Lane Acked-by: Yuanhan Liu --- v2->v3: - Rename "impl" to "backend". v1->v2: - Call into vhost-user/vhost-cuse to free mmaps. lib/librte_vhost/vhost-net.h | 6 ++ lib/librte_vhost/vhost_cuse/virtio-n

[dpdk-dev] [PATCH v6 0/2] Add VHOST PMD

2016-02-02 Thread Rich Lane
Looks good. I tested the queue state change code in particular and didn't find any problems. Reviewed-by: Rich Lane Tested-by: Rich Lane

[dpdk-dev] [PATCH v2 1/1] vhost: fix leak of fds and mmaps

2016-01-19 Thread Rich Lane
On Sun, Jan 17, 2016 at 11:58 PM, Yuanhan Liu wrote: > On Sun, Jan 17, 2016 at 11:57:18AM -0800, Rich Lane wrote: > > The common vhost code only supported a single mmap per device. vhost-user > > worked around this by saving the address/length/fd of each mmap

[dpdk-dev] [PATCH v2] cfgfile: support looking up sections by index

2016-01-18 Thread Rich Lane
This is useful when sections have duplicate names. Signed-off-by: Rich Lane --- v1->v2: - Added new symbol to version script. lib/librte_cfgfile/rte_cfgfile.c | 16 lib/librte_cfgfile/rte_cfgfile.h | 23 +++ lib/librte_cfgf

[dpdk-dev] [PATCH v2 1/1] vhost: fix leak of fds and mmaps

2016-01-17 Thread Rich Lane
e only compile tested. Signed-off-by: Rich Lane --- v1->v2: - Call into vhost-user/vhost-cuse to free mmaps. lib/librte_vhost/vhost-net.h | 6 ++ lib/librte_vhost/vhost_cuse/virtio-net-cdev.c | 12 lib/librte_vhost/vhost_user/vhost-net-user.c | 1 - lib/lib

[dpdk-dev] [PATCH] cfgfile: support looking up sections by index

2016-01-16 Thread Rich Lane
This is useful when sections have duplicate names. Signed-off-by: Rich Lane --- lib/librte_cfgfile/rte_cfgfile.c | 16 lib/librte_cfgfile/rte_cfgfile.h | 23 +++ 2 files changed, 39 insertions(+) diff --git a/lib/librte_cfgfile/rte_cfgfile.c b/lib

[dpdk-dev] [PATCH 0/4] virtio support for container

2016-01-12 Thread Rich Lane
See my reply to "mem: add API to obstain memory-backed file info" for a workaround. With fixes for that and the TUNSETVNETHDRSZ issue I was able to get traffic running over vhost-user.

[dpdk-dev] [PATCH 2/4] mem: add API to obstain memory-backed file info

2016-01-11 Thread Rich Lane
On Sun, Jan 10, 2016 at 3:43 AM, Jianfeng Tan wrote: > @@ -1157,6 +1180,20 @@ rte_eal_hugepage_init(void) > mcfg->memseg[0].len = internal_config.memory; > mcfg->memseg[0].socket_id = socket_id; > > + hugepage =

[dpdk-dev] [PATCH] vhost: fix leak of fds and mmaps

2016-01-05 Thread Rich Lane
s read by the common code. The vhost-cuse changes are only compile tested. Signed-off-by: Rich Lane --- lib/librte_vhost/rte_virtio_net.h | 14 +++-- lib/librte_vhost/vhost_cuse/virtio-net-cdev.c | 24 --- lib/librte_vhost/vhost_user/virtio-net-user.

[dpdk-dev] [PATCH v5 1/3] vhost: Add callback and private data for vhost PMD

2015-12-28 Thread Rich Lane
On Wed, Dec 23, 2015 at 11:58 PM, Tetsuya Mukawa wrote: > > Hi Rich and Yuanhan, > > I guess we have 2 implementations here. > > 1. rte_eth_vhost_get_queue_event() returns each event. > 2. rte_eth_vhost_get_queue_status() returns current status of the queues. > > I guess option "2" is more

[dpdk-dev] [PATCH v5 1/3] vhost: Add callback and private data for vhost PMD

2015-12-23 Thread Rich Lane
On Wed, Dec 23, 2015 at 7:09 PM, Tetsuya Mukawa wrote: > On 2015/12/22 13:47, Rich Lane wrote: > > On Mon, Dec 21, 2015 at 7:41 PM, Yuanhan Liu < > yuanhan.liu at linux.intel.com> > > wrote: > > > >> On Fri, Dec 18, 2015 at 10:01:25AM -0800, Rich Lane wro

[dpdk-dev] [PATCH] i40e: fix inverted check for ETH_TXQ_FLAGS_NOREFCOUNT

2015-12-23 Thread Rich Lane
The no-refcount path was being taken without the application opting in to it. Reported-by: Mike Stolarchuk Signed-off-by: Rich Lane --- drivers/net/i40e/i40e_rxtx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c

[dpdk-dev] [PATCH v5 1/3] vhost: Add callback and private data for vhost PMD

2015-12-22 Thread Rich Lane
On Mon, Dec 21, 2015 at 9:47 PM, Yuanhan Liu wrote: > On Mon, Dec 21, 2015 at 08:47:28PM -0800, Rich Lane wrote: > > The queue state change callback is the one new API that needs to be > > added because > > normal NICs don't have this behavior. > > Again I'd as

[dpdk-dev] [PATCH v5 1/3] vhost: Add callback and private data for vhost PMD

2015-12-21 Thread Rich Lane
On Mon, Dec 21, 2015 at 7:41 PM, Yuanhan Liu wrote: > On Fri, Dec 18, 2015 at 10:01:25AM -0800, Rich Lane wrote: > > I'm using the vhost callbacks and struct virtio_net with the vhost PMD > in a few > > ways: > > Rich, thanks for the info! > > > > > 1

[dpdk-dev] [PATCH v5 1/3] vhost: Add callback and private data for vhost PMD

2015-12-18 Thread Rich Lane
I'm using the vhost callbacks and struct virtio_net with the vhost PMD in a few ways: 1. new_device/destroy_device: Link state change (will be covered by the link status interrupt). 2. new_device: Add first queue to datapath. 3. vring_state_changed: Add/remove queue to datapath. 4.

[dpdk-dev] [PATCH 1/5] vhost: refactor rte_vhost_dequeue_burst

2015-12-11 Thread Rich Lane
On Wed, Dec 2, 2015 at 10:06 PM, Yuanhan Liu wrote: > > +static inline struct rte_mbuf * > +copy_desc_to_mbuf(struct virtio_net *dev, struct vhost_virtqueue *vq, > + uint16_t desc_idx, struct rte_mempool *mbuf_pool) > +{ > ... > + > + desc = >desc[desc_idx]; > +

[dpdk-dev] [PATCH 2/5] vhost: refactor virtio_dev_rx

2015-12-11 Thread Rich Lane
On Wed, Dec 2, 2015 at 10:06 PM, Yuanhan Liu wrote: > +static inline int __attribute__((always_inline)) > +copy_mbuf_to_desc(struct virtio_net *dev, struct vhost_virtqueue *vq, > + struct rte_mbuf *m, uint16_t desc_idx, uint32_t *copied) > +{ > ... > + while (1) { > +

[dpdk-dev] [PATCH v4 2/2] vhost: Add VHOST PMD

2015-11-20 Thread Rich Lane
On Thu, Nov 12, 2015 at 9:20 PM, Tetsuya Mukawa wrote: > +static uint16_t > +eth_vhost_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) > +{ > ... > + > + /* Enqueue packets to guest RX queue */ > + nb_tx = rte_vhost_enqueue_burst(r->device, > +

[dpdk-dev] [RFC PATCH 0/2] Virtio-net PMD Extension to work on host.

2015-11-19 Thread Rich Lane
What's the reason for using qemu as a middleman? Couldn't the new PMD itself open /dev/vhost-net or the vhost-user socket and send the commands to set up virtqueues? That was the approach taken by Jianfeng's earlier RFC. On Thu, Nov 19, 2015 at 2:57 AM, Tetsuya Mukawa wrote: > THIS IS A PoC

[dpdk-dev] [PATCH] vhost: avoid buffer overflow in update_secure_len

2015-11-17 Thread Rich Lane
On Tue, Nov 17, 2015 at 6:56 PM, Yuanhan Liu wrote: > @@ -519,6 +526,8 @@ virtio_dev_merge_rx(struct virtio_net *dev, uint16_t > queue_id, > goto merge_rx_exit; > } else { >

[dpdk-dev] [PATCH] vhost: avoid buffer overflow in update_secure_len

2015-11-17 Thread Rich Lane
On Tue, Nov 17, 2015 at 5:23 AM, Yuanhan Liu wrote: > On Thu, Nov 12, 2015 at 01:46:03PM -0800, Rich Lane wrote: > > You can reproduce this with l2fwd and the vhost PMD. > > > > You'll need this patch on top of the vhost PMD patches: > > --- a/lib/librte_vhost

[dpdk-dev] [PATCH v3 2/2] vhost: Add VHOST PMD

2015-11-12 Thread Rich Lane
> > + if (rte_kvargs_count(kvlist, ETH_VHOST_IFACE_ARG) == 1) { > + ret = rte_kvargs_process(kvlist, ETH_VHOST_IFACE_ARG, > +_iface, _name); > + if (ret < 0) > + goto out_free; > + } > I noticed

[dpdk-dev] [PATCH] vhost: avoid buffer overflow in update_secure_len

2015-11-12 Thread Rich Lane
: watch -l rte_eth_devices[1].data->rx_queues On Thu, Nov 12, 2015 at 1:23 AM, Yuanhan Liu wrote: > On Thu, Nov 12, 2015 at 12:02:33AM -0800, Rich Lane wrote: > > The guest could trigger this buffer overflow by creating a cycle of > descriptors > > (which would also cause an infin

[dpdk-dev] [PATCH] vhost: reset device properly

2015-11-12 Thread Rich Lane
I had a patch that just saved the ifname but this is much better. Acked-by: Rich Lane

[dpdk-dev] [PATCH] vhost: avoid buffer overflow in update_secure_len

2015-11-12 Thread Rich Lane
e a VM connected to a vhost-user vswitch because the virtqueue memory allocated by the previous run is zeroed. Signed-off-by: Rich Lane --- lib/librte_vhost/vhost_rxtx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_vhost/vhost_rxtx.c b/lib/librte_vhost/vhost_rxtx.c

[dpdk-dev] [PATCH] vhost: make destroy callback on VHOST_USER_RESET_OWNER

2015-11-09 Thread Rich Lane
QEMU sends this message first when shutting down. There was previously no way for the dataplane to know that the virtio_net instance had become unusable and it would segfault when trying to do RX/TX. Signed-off-by: Rich Lane --- lib/librte_vhost/virtio-net.c | 3 +++ 1 file changed, 3

[dpdk-dev] [PATCH] default to using all cores if no -c, -l, or --lcores options given

2015-09-25 Thread Rich Lane
This is a useful default for simple applications where the assignment of lcores to CPUs doesn't matter. It's also useful for more complex applications that automatically assign tasks to cores based on the NUMA topology. Signed-off-by: Rich Lane --- app/test/test_eal_flags.c