Re: [dpdk-dev] [PATCH] ipc: fix send error handling

2019-04-28 Thread Rami Rosen
Acked-by: Rami Rosen 


Re: [dpdk-dev] [PATCH v3] vhost: support inflight share memory protocol feature

2019-04-28 Thread Tiwei Bie
On Fri, Apr 26, 2019 at 05:40:21AM -0400, Li Lin wrote:
> From: lilin24 
> 
> This patch introduces two new messages VHOST_USER_GET_INFLIGHT_FD
> and VHOST_USER_SET_INFLIGHT_FD to support transferring a shared
> buffer between qemu and backend.
> 
> Firstly, qemu uses VHOST_USER_GET_INFLIGHT_FD to get the
> shared buffer from backend. Then qemu should send it back
> through VHOST_USER_SET_INFLIGHT_FD each time we start vhost-user.
> 
> This shared buffer is used to process inflight I/O when backend
> reconnect.
> 
> Signed-off-by: lilin24 

You need to use your real name here.

> Signed-off-by: Ni Xun 
> Signed-off-by: Zhang Yu 
> 
> v2:
> - add set&clr inflight entry function
> v3:
> - simplified some function implementations
> 
> ---

You can put change logs here (i.e. after ---).

>  lib/librte_vhost/rte_vhost.h  |  53 ++
>  lib/librte_vhost/vhost.c  |  42 
>  lib/librte_vhost/vhost.h  |  11 ++
>  lib/librte_vhost/vhost_user.c | 231 
> ++
>  lib/librte_vhost/vhost_user.h |  16 ++-
>  5 files changed, 351 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/librte_vhost/rte_vhost.h b/lib/librte_vhost/rte_vhost.h
> index d2c0c93f4..bc25591a8 100644
> --- a/lib/librte_vhost/rte_vhost.h
> +++ b/lib/librte_vhost/rte_vhost.h
> @@ -71,6 +71,10 @@ extern "C" {
>  #define VHOST_USER_PROTOCOL_F_HOST_NOTIFIER 11
>  #endif
>  
> +#ifndef VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD
> +#define VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD 12
> +#endif
> +
>  /** Indicate whether protocol features negotiation is supported. */
>  #ifndef VHOST_USER_F_PROTOCOL_FEATURES
>  #define VHOST_USER_F_PROTOCOL_FEATURES   30
> @@ -98,12 +102,26 @@ struct rte_vhost_memory {
>   struct rte_vhost_mem_region regions[];
>  };
>  
> +typedef struct VhostUserInflightEntry {
> + uint8_t inflight;
> +} VhostUserInflightEntry;
> +
> +typedef struct VhostInflightInfo {
> + uint16_t version;
> + uint16_t last_inflight_io;
> + uint16_t used_idx;
> + VhostUserInflightEntry desc[0];
> +} VhostInflightInfo;

Is there any details on above structure? Why does it not match
QueueRegionSplit or QueueRegionPacked structures described in
qemu/docs/interop/vhost-user.txt?

> +
>  struct rte_vhost_vring {
>   struct vring_desc   *desc;
>   struct vring_avail  *avail;
>   struct vring_used   *used;
>   uint64_tlog_guest_addr;
>  
> + VhostInflightInfo   *inflight;
> + intinflight_flag;
> +
>   /** Deprecated, use rte_vhost_vring_call() instead. */
>   int callfd;
>  
> @@ -632,6 +650,41 @@ int rte_vhost_get_vhost_vring(int vid, uint16_t 
> vring_idx,
>  int rte_vhost_vring_call(int vid, uint16_t vring_idx);
>  
>  /**
> + * set inflight flag for a entry.
> + *
> + * @param vring
> + *  the structure to hold the requested vring info
> + * @param idx
> + *  inflight entry index
> + */
> +void rte_vhost_set_inflight(struct rte_vhost_vring *vring,
> + uint16_t idx);
> +
> +/**
> + * clear inflight flag for a entry.
> + *
> + * @param vring
> + *  the structure to hold the requested vring info
> + * @param last_used_idx
> + *  next free used_idx
> + * @param idx
> + *  inflight entry index
> + */
> +void rte_vhost_clr_inflight(struct rte_vhost_vring *vring,
> + uint16_t last_used_idx, uint16_t idx);
> +
> +/**
> + * set last inflight io index.
> + *
> + * @param vring
> + *  the structure to hold the requested vring info
> + * @param idx
> + *  inflight entry index
> + */
> +void rte_vhost_set_last_inflight_io(struct rte_vhost_vring *vring,
> + uint16_t idx);

New APIs should be experimental and also need to be
added in rte_vhost_version.map file.

> +
> +/**
>   * Get vhost RX queue avail count.
>   *
>   * @param vid
> diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c
> index 163f4595e..9ba692935 100644
> --- a/lib/librte_vhost/vhost.c
> +++ b/lib/librte_vhost/vhost.c
> @@ -76,6 +76,8 @@ cleanup_vq(struct vhost_virtqueue *vq, int destroy)
>   close(vq->callfd);
>   if (vq->kickfd >= 0)
>   close(vq->kickfd);
> + if (vq->inflight)
> + vq->inflight = NULL;
>  }
>  
>  /*
> @@ -589,6 +591,11 @@ rte_vhost_get_vhost_vring(int vid, uint16_t vring_idx,
>   vring->kickfd  = vq->kickfd;
>   vring->size= vq->size;
>  
> + vring->inflight = vq->inflight;
> +
> + vring->inflight_flag = vq->inflight_flag;
> + vq->inflight_flag = 0;

This will break the ABI. Better to introduce a new API to do this.

> +
>   return 0;
>  }
>  
> @@ -617,6 +624,41 @@ rte_vhost_vring_call(int vid, uint16_t vring_idx)
>   return 0;
>  }
>  
> +void
> +rte_vhost_set_inflight(struct rte_vhost_vring *vring, uint16_t idx)
> +{
> + VhostInflightInfo *inflight = vring->inflight;
> + if (unlikely(!inflight))
> + return;
> + inflight->desc[idx].inflight = 1;
> +}
> +
> +void
> +r

Re: [dpdk-dev] [PATCH v6 1/3] rcu: add RCU library supporting QSBR mechanism

2019-04-28 Thread Paul E. McKenney
On Tue, Apr 16, 2019 at 11:13:57PM -0500, Honnappa Nagarahalli wrote:
> Add RCU library supporting quiescent state based memory reclamation method.
> This library helps identify the quiescent state of the reader threads so
> that the writers can free the memory associated with the lock less data
> structures.
> 
> Signed-off-by: Honnappa Nagarahalli 
> Reviewed-by: Steve Capper 
> Reviewed-by: Gavin Hu 
> Reviewed-by: Ola Liljedahl 
> Acked-by: Konstantin Ananyev 

Looks much better!

One more suggestion below, on rte_rcu_qsbr_thread_offline().

Thanx, Paul

> ---
>  MAINTAINERS|   5 +
>  config/common_base |   6 +
>  lib/Makefile   |   2 +
>  lib/librte_rcu/Makefile|  23 ++
>  lib/librte_rcu/meson.build |   7 +
>  lib/librte_rcu/rte_rcu_qsbr.c  | 257 
>  lib/librte_rcu/rte_rcu_qsbr.h  | 629 +
>  lib/librte_rcu/rte_rcu_version.map |  12 +
>  lib/meson.build|   2 +-
>  mk/rte.app.mk  |   1 +
>  10 files changed, 943 insertions(+), 1 deletion(-)
>  create mode 100644 lib/librte_rcu/Makefile
>  create mode 100644 lib/librte_rcu/meson.build
>  create mode 100644 lib/librte_rcu/rte_rcu_qsbr.c
>  create mode 100644 lib/librte_rcu/rte_rcu_qsbr.h
>  create mode 100644 lib/librte_rcu/rte_rcu_version.map
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index a08583471..ae54f37db 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -1274,6 +1274,11 @@ F: examples/bpf/
>  F: app/test/test_bpf.c
>  F: doc/guides/prog_guide/bpf_lib.rst
>  
> +RCU - EXPERIMENTAL
> +M: Honnappa Nagarahalli 
> +F: lib/librte_rcu/
> +F: doc/guides/prog_guide/rcu_lib.rst
> +
>  
>  Test Applications
>  -
> diff --git a/config/common_base b/config/common_base
> index 7fb0dedb6..f50d26c30 100644
> --- a/config/common_base
> +++ b/config/common_base
> @@ -834,6 +834,12 @@ CONFIG_RTE_LIBRTE_LATENCY_STATS=y
>  #
>  CONFIG_RTE_LIBRTE_TELEMETRY=n
>  
> +#
> +# Compile librte_rcu
> +#
> +CONFIG_RTE_LIBRTE_RCU=y
> +CONFIG_RTE_LIBRTE_RCU_DEBUG=n
> +
>  #
>  # Compile librte_lpm
>  #
> diff --git a/lib/Makefile b/lib/Makefile
> index 26021d0c0..791e0d991 100644
> --- a/lib/Makefile
> +++ b/lib/Makefile
> @@ -111,6 +111,8 @@ DIRS-$(CONFIG_RTE_LIBRTE_IPSEC) += librte_ipsec
>  DEPDIRS-librte_ipsec := librte_eal librte_mbuf librte_cryptodev 
> librte_security
>  DIRS-$(CONFIG_RTE_LIBRTE_TELEMETRY) += librte_telemetry
>  DEPDIRS-librte_telemetry := librte_eal librte_metrics librte_ethdev
> +DIRS-$(CONFIG_RTE_LIBRTE_RCU) += librte_rcu
> +DEPDIRS-librte_rcu := librte_eal
>  
>  ifeq ($(CONFIG_RTE_EXEC_ENV_LINUX),y)
>  DIRS-$(CONFIG_RTE_LIBRTE_KNI) += librte_kni
> diff --git a/lib/librte_rcu/Makefile b/lib/librte_rcu/Makefile
> new file mode 100644
> index 0..6aa677bd1
> --- /dev/null
> +++ b/lib/librte_rcu/Makefile
> @@ -0,0 +1,23 @@
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright(c) 2018 Arm Limited
> +
> +include $(RTE_SDK)/mk/rte.vars.mk
> +
> +# library name
> +LIB = librte_rcu.a
> +
> +CFLAGS += -DALLOW_EXPERIMENTAL_API
> +CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
> +LDLIBS += -lrte_eal
> +
> +EXPORT_MAP := rte_rcu_version.map
> +
> +LIBABIVER := 1
> +
> +# all source are stored in SRCS-y
> +SRCS-$(CONFIG_RTE_LIBRTE_RCU) := rte_rcu_qsbr.c
> +
> +# install includes
> +SYMLINK-$(CONFIG_RTE_LIBRTE_RCU)-include := rte_rcu_qsbr.h
> +
> +include $(RTE_SDK)/mk/rte.lib.mk
> diff --git a/lib/librte_rcu/meson.build b/lib/librte_rcu/meson.build
> new file mode 100644
> index 0..0c2d5a2e0
> --- /dev/null
> +++ b/lib/librte_rcu/meson.build
> @@ -0,0 +1,7 @@
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright(c) 2018 Arm Limited
> +
> +allow_experimental_apis = true
> +
> +sources = files('rte_rcu_qsbr.c')
> +headers = files('rte_rcu_qsbr.h')
> diff --git a/lib/librte_rcu/rte_rcu_qsbr.c b/lib/librte_rcu/rte_rcu_qsbr.c
> new file mode 100644
> index 0..466592a42
> --- /dev/null
> +++ b/lib/librte_rcu/rte_rcu_qsbr.c
> @@ -0,0 +1,257 @@
> +/* SPDX-License-Identifier: BSD-3-Clause
> + *
> + * Copyright (c) 2018 Arm Limited
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include "rte_rcu_qsbr.h"
> +
> +/* Get the memory size of QSBR variable */
> +size_t __rte_experimental
> +rte_rcu_qsbr_get_memsize(uint32_t max_threads)
> +{
> + size_t sz;
> +
> + if (max_threads == 0) {
> + rte_log(RTE_LOG_ERR, rcu_log_type,
> + "%s(): Invalid max_threads %u\n",
> + __func__, max_threads);
> + rte_errno = EINVAL;
> +
> + return 1;
> + }
> +
> + sz = sizeof(struct rte_rcu_qsbr);
> +
> + /* Add the size of quiescent state counter array */
> + sz += sizeof(struct rte_rcu_qsb

Re: [dpdk-dev] [PATCH] net/i40e: remove useless check for queue number

2019-04-28 Thread Xiao, QimaiX
Tested-by: Xiao, QimaiX 

-Original Message-
From: Zhao1, Wei 
Sent: Sunday, April 28, 2019 2:13 PM
To: dev@dpdk.org
Cc: sta...@dpdk.org; Zhang, Qi Z ; Xiao, QimaiX 
; Peng, Yuan ; Zhao1, Wei 

Subject: [PATCH] net/i40e: remove useless check for queue number

There is no need to do such a check of queue number, so remove it.

Fixes: ac8d22de2394 ("ethdev: flatten RSS configuration in flow API")

Signed-off-by: Wei Zhao 
---
 drivers/net/i40e/i40e_ethdev.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c 
index dca61f0..5059bad 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -12699,9 +12699,6 @@ i40e_config_rss_filter(struct i40e_pf *pf,
return -EINVAL;
}
 
-   if (rss_info->conf.queue_num)
-   return -EINVAL;
-
/* If both VMDQ and RSS enabled, not all of PF queues are configured.
 * It's necessary to calculate the actual PF queues that are configured.
 */
--
2.7.5



Re: [dpdk-dev] [RFC 00/12] introduce s390x architecture

2019-04-28 Thread Pradeep Satyanarayana



Pradeep Satyanarayana/Beaverton/IBM wrote on 04/11/2019 08:57:05 AM:

> From: Pradeep Satyanarayana/Beaverton/IBM
> To: Thomas Monjalon 
> Cc: dev@dpdk.org, David Christensen , Vivian
> Kong , David Wilder 
> Date: 04/11/2019 08:57 AM
> Subject: Re: [dpdk-dev] [RFC 00/12] introduce s390x architecture
>
>
> > > > We are still seeing some compilation issues regularly on Power.
> > > > Before going to DTS, I think you should extend your compilation
testing,
> > > > and basic feature testing with builtin unit tests.
> > >
> > > We have not observed any compilation issues since we started the CI.
The
> > > last issue reported
> > > was during 18.11-rc1 that Mellanox fixed. Hopefully, we should catch
any
> > > such regressions
> > > quickly in the future, since we now have a CI that runs periodically.
> >
> > There are some failure when compiling with big endian toolchain.
> > It seems you are not testing big endian.
>
> Correct, we have been doing all our work on little endian only.
>
> > If you don't support big endian, please mention it in the doc.
>
> Thank you for alerting us about this. Good point that you bring up.
> I will need some time to consult and figure out how we approach this.
> Let me get back to you on this.

On the Linux on Power front going forward, there are currently no plans to
support BE,
just LE.

The doc you mention above, is that this one?

https://doc.dpdk.org/guides/platform/index.html

Thanks
Pradeep
prad...@us.ibm.com


Re: [dpdk-dev] [PATCH v7 1/3] rcu: add RCU library supporting QSBR mechanism

2019-04-28 Thread Paul E. McKenney
On Mon, Apr 22, 2019 at 11:31:28PM -0500, Honnappa Nagarahalli wrote:
> Add RCU library supporting quiescent state based memory reclamation method.
> This library helps identify the quiescent state of the reader threads so
> that the writers can free the memory associated with the lock less data
> structures.
> 
> Signed-off-by: Honnappa Nagarahalli 
> Reviewed-by: Steve Capper 
> Reviewed-by: Gavin Hu 
> Reviewed-by: Ola Liljedahl 
> Acked-by: Konstantin Ananyev 

Much better!

Acked-by: Paul E. McKenney 

> ---
>  MAINTAINERS|   5 +
>  config/common_base |   6 +
>  lib/Makefile   |   2 +
>  lib/librte_rcu/Makefile|  23 ++
>  lib/librte_rcu/meson.build |   7 +
>  lib/librte_rcu/rte_rcu_qsbr.c  | 268 
>  lib/librte_rcu/rte_rcu_qsbr.h  | 639 +
>  lib/librte_rcu/rte_rcu_version.map |  12 +
>  lib/meson.build|   2 +-
>  mk/rte.app.mk  |   1 +
>  10 files changed, 964 insertions(+), 1 deletion(-)
>  create mode 100644 lib/librte_rcu/Makefile
>  create mode 100644 lib/librte_rcu/meson.build
>  create mode 100644 lib/librte_rcu/rte_rcu_qsbr.c
>  create mode 100644 lib/librte_rcu/rte_rcu_qsbr.h
>  create mode 100644 lib/librte_rcu/rte_rcu_version.map
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index a08583471..ae54f37db 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -1274,6 +1274,11 @@ F: examples/bpf/
>  F: app/test/test_bpf.c
>  F: doc/guides/prog_guide/bpf_lib.rst
>  
> +RCU - EXPERIMENTAL
> +M: Honnappa Nagarahalli 
> +F: lib/librte_rcu/
> +F: doc/guides/prog_guide/rcu_lib.rst
> +
>  
>  Test Applications
>  -
> diff --git a/config/common_base b/config/common_base
> index 7fb0dedb6..f50d26c30 100644
> --- a/config/common_base
> +++ b/config/common_base
> @@ -834,6 +834,12 @@ CONFIG_RTE_LIBRTE_LATENCY_STATS=y
>  #
>  CONFIG_RTE_LIBRTE_TELEMETRY=n
>  
> +#
> +# Compile librte_rcu
> +#
> +CONFIG_RTE_LIBRTE_RCU=y
> +CONFIG_RTE_LIBRTE_RCU_DEBUG=n
> +
>  #
>  # Compile librte_lpm
>  #
> diff --git a/lib/Makefile b/lib/Makefile
> index 26021d0c0..791e0d991 100644
> --- a/lib/Makefile
> +++ b/lib/Makefile
> @@ -111,6 +111,8 @@ DIRS-$(CONFIG_RTE_LIBRTE_IPSEC) += librte_ipsec
>  DEPDIRS-librte_ipsec := librte_eal librte_mbuf librte_cryptodev 
> librte_security
>  DIRS-$(CONFIG_RTE_LIBRTE_TELEMETRY) += librte_telemetry
>  DEPDIRS-librte_telemetry := librte_eal librte_metrics librte_ethdev
> +DIRS-$(CONFIG_RTE_LIBRTE_RCU) += librte_rcu
> +DEPDIRS-librte_rcu := librte_eal
>  
>  ifeq ($(CONFIG_RTE_EXEC_ENV_LINUX),y)
>  DIRS-$(CONFIG_RTE_LIBRTE_KNI) += librte_kni
> diff --git a/lib/librte_rcu/Makefile b/lib/librte_rcu/Makefile
> new file mode 100644
> index 0..6aa677bd1
> --- /dev/null
> +++ b/lib/librte_rcu/Makefile
> @@ -0,0 +1,23 @@
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright(c) 2018 Arm Limited
> +
> +include $(RTE_SDK)/mk/rte.vars.mk
> +
> +# library name
> +LIB = librte_rcu.a
> +
> +CFLAGS += -DALLOW_EXPERIMENTAL_API
> +CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
> +LDLIBS += -lrte_eal
> +
> +EXPORT_MAP := rte_rcu_version.map
> +
> +LIBABIVER := 1
> +
> +# all source are stored in SRCS-y
> +SRCS-$(CONFIG_RTE_LIBRTE_RCU) := rte_rcu_qsbr.c
> +
> +# install includes
> +SYMLINK-$(CONFIG_RTE_LIBRTE_RCU)-include := rte_rcu_qsbr.h
> +
> +include $(RTE_SDK)/mk/rte.lib.mk
> diff --git a/lib/librte_rcu/meson.build b/lib/librte_rcu/meson.build
> new file mode 100644
> index 0..0c2d5a2e0
> --- /dev/null
> +++ b/lib/librte_rcu/meson.build
> @@ -0,0 +1,7 @@
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright(c) 2018 Arm Limited
> +
> +allow_experimental_apis = true
> +
> +sources = files('rte_rcu_qsbr.c')
> +headers = files('rte_rcu_qsbr.h')
> diff --git a/lib/librte_rcu/rte_rcu_qsbr.c b/lib/librte_rcu/rte_rcu_qsbr.c
> new file mode 100644
> index 0..50ef0ba9a
> --- /dev/null
> +++ b/lib/librte_rcu/rte_rcu_qsbr.c
> @@ -0,0 +1,268 @@
> +/* SPDX-License-Identifier: BSD-3-Clause
> + *
> + * Copyright (c) 2018 Arm Limited
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include "rte_rcu_qsbr.h"
> +
> +/* Get the memory size of QSBR variable */
> +size_t __rte_experimental
> +rte_rcu_qsbr_get_memsize(uint32_t max_threads)
> +{
> + size_t sz;
> +
> + if (max_threads == 0) {
> + rte_log(RTE_LOG_ERR, rcu_log_type,
> + "%s(): Invalid max_threads %u\n",
> + __func__, max_threads);
> + rte_errno = EINVAL;
> +
> + return 1;
> + }
> +
> + sz = sizeof(struct rte_rcu_qsbr);
> +
> + /* Add the size of quiescent state counter array */
> + sz += sizeof(struct rte_rcu_qsbr_cnt) * max_threads;
> +
> + /* Add the size of the registered thread ID bitmap array */
> +   

[dpdk-dev] [PATCH] doc: announce ABI change on eal and kni

2019-04-28 Thread Arnon Warshavsky
For the purpose of removing instances of rte_panic
from the init sequence, some void functions need to change
to return an error code.The planned modifications of 19.08
require to change one eal function and one kni function.

Signed-off-by: Arnon Warshavsky 
---
 doc/guides/rel_notes/deprecation.rst | 12 
 1 file changed, 12 insertions(+)

diff --git a/doc/guides/rel_notes/deprecation.rst 
b/doc/guides/rel_notes/deprecation.rst
index b47c8c2..c4ab9a2 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -31,6 +31,12 @@ Deprecation Notices
 
 + ``rte_eal_devargs_type_count``
 
+* eal: Modify function return value for the sake of removing rte_panic
+   from the init sequence in version 19.08.
+  - In ``lib/librte_eal/common/eal_thread.h`` replace
+``void eal_thread_init_master(unsigned lcore_id)``
+to return ``int``
+
 * vfio: removal of ``rte_vfio_dma_map`` and ``rte_vfio_dma_unmap`` APIs which
   have been replaced with ``rte_dev_dma_map`` and ``rte_dev_dma_unmap``
   functions.  The due date for the removal targets DPDK 20.02.
@@ -65,6 +71,12 @@ Deprecation Notices
   kernel modules in DPDK. As a result users won't be able to use ``ethtool``
   via ``igb`` & ``ixgbe`` anymore.
 
+* kni: Modify function return value for the sake of removing rte_panic
+   from the init sequence in version 19.08.
+  - In ``lib/librte_kni/rte_kni_fifo.h`` replace
+``static void kni_fifo_init(struct rte_kni_fifo *fifo, unsigned size)``
+to return ``int``
+
 * cryptodev: New member in ``rte_cryptodev_config`` to allow applications to
   disable features supported by the crypto device. Only the following features
   would be allowed to be disabled this way,
-- 
1.8.3.1



Re: [dpdk-dev] CALL to eth PMD maintainers: complete closing of port

2019-04-28 Thread Stephen Hemminger
On Sun, 28 Apr 2019 06:57:59 +
Matan Azrad  wrote:

> Hi Thomas
> 
> vdev_netvsc has no close API - should I change something there?
> 
> > From: Thomas Monjalon 
> > Hi all,
> > 
> > Since DPDK 18.11, the behaviour of the close operation is changed if
> > RTE_ETH_DEV_CLOSE_REMOVE is enabled in the driver:
> > port is released (i.e. totally freed and data erased) on close.
> > This new behaviour is enabled per driver for a migration period.
> > 
> > Looking at the code, you can see these comments:
> > /* old behaviour: only free queue arrays */ RTE_ETHDEV_LOG(DEBUG, "Port
> > closing is using an old behaviour.\n"
> > "The driver %s should migrate to the new behaviour.\n",
> > /* new behaviour: send event + reset state + free all data */
> > 
> > You can find an advice in the commit:
> > https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2
> > Fgit.dpdk.org%2Fdpdk%2Fcommit%2F%3Fid%3D23ea57a2a&data=02%7
> > C01%7Cmatan%40mellanox.com%7C3fea370ec31f4d22be8708d6c3ecf74b%7
> > Ca652971c7d2e4d9ba6a4d149256f461b%7C0%7C0%7C636911819926371170&a
> > mp;sdata=%2BHLHG6VK2gNLejSHRKLYtS4Qelqg%2FOD%2FUQbZwOIT9%2BA
> > %3D&reserved=0
> > "
> > When enabling RTE_ETH_DEV_CLOSE_REMOVE,
> > the PMD must free all its private resources for the port, in its dev_close
> > function.
> > It is advised to call the dev_close function in the remove function in 
> > order to
> > support removing a device without closing its ports.
> > "
> > 
> > It would be great to complete this migration for the next LTS version, which
> > will be 19.11.
> > It means the work should be ideally finished during the summer.
> > 
> > The migration to the new behaviour is done in 4 drivers:
> > git grep -l RTE_ETH_DEV_CLOSE_REMOVE drivers | cut -d/ -f3
> > ena
> > enic
> > mlx5
> > vmxnet3
> > 
> > Following drivers should be migrated:
> > ( find drivers/net -mindepth 1 -maxdepth 1 -type d | cut -d/ -f3 ; git grep 
> > -l
> > RTE_ETH_DEV_CLOSE_REMOVE drivers | cut -d/ -f3 ) | sort | uniq -u
> > af_packet
> > af_xdp
> > ark
> > atlantic
> > avp
> > axgbe
> > bnx2x
> > bnxt
> > bonding
> > cxgbe
> > dpaa
> > dpaa2
> > e1000
> > enetc
> > failsafe
> > fm10k
> > i40e
> > iavf
> > ice
> > ifc
> > ixgbe
> > kni
> > liquidio
> > mlx4
> > mvneta
> > mvpp2
> > netvsc
> > nfb
> > nfp
> > null
> > octeontx
> > pcap
> > qede
> > ring
> > sfc
> > softnic
> > szedata2
> > tap
> > thunderx
> > vdev_netvsc
> > vhost
> > virtio
> > 
> > Please let's progress smoothly on this topic, thanks.
> > 
> > The concerned maintainers (Cc) can be found with the following command:
> > devtools/get-maintainer.sh $(( find drivers/net -mindepth 1 -maxdepth 1 -
> > type d | cut -d/ -f-3 ; git grep -l RTE_ETH_DEV_CLOSE_REMOVE drivers ) |
> > sort | uniq -u)
> >   
> 

I have a version still testing


Re: [dpdk-dev] [PATCH] doc: announce ABI change on eal and kni

2019-04-28 Thread Stephen Hemminger
On Sun, 28 Apr 2019 17:58:48 +0300
Arnon Warshavsky  wrote:

These deprecation notices are unnecessary. These are not public API's.

> +* eal: Modify function return value for the sake of removing rte_panic
> +   from the init sequence in version 19.08.
> +  - In ``lib/librte_eal/common/eal_thread.h`` replace
> +``void eal_thread_init_master(unsigned lcore_id)``
> +to return ``int``

This function is never exported (see rte_eal_version.map) and therefore be 
marked private to the EAL, and not a public API.


> +* kni: Modify function return value for the sake of removing rte_panic
> +   from the init sequence in version 19.08.
> +  - In ``lib/librte_kni/rte_kni_fifo.h`` replace
> +``static void kni_fifo_init(struct rte_kni_fifo *fifo, unsigned size)``
> +to return ``int``

This is not a public API really so no deprecation needed.
It is just an include file used internally by library and the driver.


Re: [dpdk-dev] [PATCH v4] eventdev: add experimental tag back

2019-04-28 Thread Jerin Jacob Kollanukkaran



> -Original Message-
> From: Nikhil Rao 
> Sent: Friday, April 26, 2019 10:04 PM
> To: tho...@monjalon.net
> Cc: dev@dpdk.org; Nikhil Rao ; Jerin Jacob Kollanukkaran
> 
> Subject: [EXT] [PATCH v4] eventdev: add experimental tag back
> Add the experimental tag back to the Rx event adapter callback, the Rx event
> callback register and the Rx event adapter statistics retrieval functions due 
> to an
> API change to be proposed in a future patch.
> 
> This patch also adds the experimental tag to these function definitions and 
> adds
> the functions to the EXPERIMENTAL section of the map file, these were missing
> previously.
> 
> Fixes: 80bdf91dc8ee ("eventdev: promote adapter functions as stable")
> Cc: jer...@marvell.com
> 
> Signed-off-by: Nikhil Rao 

Acked-by: Jerin Jacob 


Re: [dpdk-dev] [PATCH] doc: update references to removed function

2019-04-28 Thread Jerin Jacob Kollanukkaran


> -Original Message-
> From: Erik Gabriel Carrillo 
> Sent: Friday, April 26, 2019 10:23 PM
> To: jerin.ja...@caviumnetworks.com
> Cc: harry.van.haa...@intel.com; dev@dpdk.org
> Subject: [PATCH] doc: update references to removed function
> 
> Remove references to the (deleted) rte_event_port_enqueue_depth() function
> in the Doxygen comments for rte_event_enqueue_burst() and friends, and
> replace with references to rte_event_port_attr_get().
> 
> Fixes: 78ffab961155 ("eventdev: add port attribute function")

Cc: sta...@dpdk.org

> Signed-off-by: Erik Gabriel Carrillo 
> ---
>  lib/librte_eventdev/rte_eventdev.h | 17 +++--

One more instance is pending after applying the patch. 

[master] [dpdk.org] $ grep -ri "rte_event_port_enqueue_depth" *
lib/librte_eventdev/rte_event_eth_tx_adapter.h: *  
rte_event_port_enqueue_depth() available for this port.

With above fix and adding Fixes: for the new entry:

Acked-by: Jerin Jacob 


Re: [dpdk-dev] [PATCH v3] vhost: support inflight share memory protocol feature

2019-04-28 Thread lin li
Tiwei Bie  于2019年4月28日周日 下午7:18写道:
>
> On Fri, Apr 26, 2019 at 05:40:21AM -0400, Li Lin wrote:
> > From: lilin24 
> >
> > This patch introduces two new messages VHOST_USER_GET_INFLIGHT_FD
> > and VHOST_USER_SET_INFLIGHT_FD to support transferring a shared
> > buffer between qemu and backend.
> >
> > Firstly, qemu uses VHOST_USER_GET_INFLIGHT_FD to get the
> > shared buffer from backend. Then qemu should send it back
> > through VHOST_USER_SET_INFLIGHT_FD each time we start vhost-user.
> >
> > This shared buffer is used to process inflight I/O when backend
> > reconnect.
> >
> > Signed-off-by: lilin24 
>
> You need to use your real name here.
>
> > Signed-off-by: Ni Xun 
> > Signed-off-by: Zhang Yu 
> >
> > v2:
> > - add set&clr inflight entry function
> > v3:
> > - simplified some function implementations
> >
> > ---
>
> You can put change logs here (i.e. after ---).
>
> >  lib/librte_vhost/rte_vhost.h  |  53 ++
> >  lib/librte_vhost/vhost.c  |  42 
> >  lib/librte_vhost/vhost.h  |  11 ++
> >  lib/librte_vhost/vhost_user.c | 231 
> > ++
> >  lib/librte_vhost/vhost_user.h |  16 ++-
> >  5 files changed, 351 insertions(+), 2 deletions(-)
> >
> > diff --git a/lib/librte_vhost/rte_vhost.h b/lib/librte_vhost/rte_vhost.h
> > index d2c0c93f4..bc25591a8 100644
> > --- a/lib/librte_vhost/rte_vhost.h
> > +++ b/lib/librte_vhost/rte_vhost.h
> > @@ -71,6 +71,10 @@ extern "C" {
> >  #define VHOST_USER_PROTOCOL_F_HOST_NOTIFIER 11
> >  #endif
> >
> > +#ifndef VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD
> > +#define VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD 12
> > +#endif
> > +
> >  /** Indicate whether protocol features negotiation is supported. */
> >  #ifndef VHOST_USER_F_PROTOCOL_FEATURES
> >  #define VHOST_USER_F_PROTOCOL_FEATURES   30
> > @@ -98,12 +102,26 @@ struct rte_vhost_memory {
> >   struct rte_vhost_mem_region regions[];
> >  };
> >
> > +typedef struct VhostUserInflightEntry {
> > + uint8_t inflight;
> > +} VhostUserInflightEntry;
> > +
> > +typedef struct VhostInflightInfo {
> > + uint16_t version;
> > + uint16_t last_inflight_io;
> > + uint16_t used_idx;
> > + VhostUserInflightEntry desc[0];
> > +} VhostInflightInfo;
>
> Is there any details on above structure? Why does it not match
> QueueRegionSplit or QueueRegionPacked structures described in
> qemu/docs/interop/vhost-user.txt?

Qemu have its vhost-user backend,qemu did the submission of IO in it.
The implementation of dpdk is more general. It is just to mark inflight entry.
The submission of inflight entry is handle over to different backends.
They have their own ways to handle it, such as spdk.
So there are some differences in data structure.

>
> > +
> >  struct rte_vhost_vring {
> >   struct vring_desc   *desc;
> >   struct vring_avail  *avail;
> >   struct vring_used   *used;
> >   uint64_tlog_guest_addr;
> >
> > + VhostInflightInfo   *inflight;
> > + intinflight_flag;
> > +
> >   /** Deprecated, use rte_vhost_vring_call() instead. */
> >   int callfd;
> >
> > @@ -632,6 +650,41 @@ int rte_vhost_get_vhost_vring(int vid, uint16_t 
> > vring_idx,
> >  int rte_vhost_vring_call(int vid, uint16_t vring_idx);
> >
> >  /**
> > + * set inflight flag for a entry.
> > + *
> > + * @param vring
> > + *  the structure to hold the requested vring info
> > + * @param idx
> > + *  inflight entry index
> > + */
> > +void rte_vhost_set_inflight(struct rte_vhost_vring *vring,
> > + uint16_t idx);
> > +
> > +/**
> > + * clear inflight flag for a entry.
> > + *
> > + * @param vring
> > + *  the structure to hold the requested vring info
> > + * @param last_used_idx
> > + *  next free used_idx
> > + * @param idx
> > + *  inflight entry index
> > + */
> > +void rte_vhost_clr_inflight(struct rte_vhost_vring *vring,
> > + uint16_t last_used_idx, uint16_t idx);
> > +
> > +/**
> > + * set last inflight io index.
> > + *
> > + * @param vring
> > + *  the structure to hold the requested vring info
> > + * @param idx
> > + *  inflight entry index
> > + */
> > +void rte_vhost_set_last_inflight_io(struct rte_vhost_vring *vring,
> > + uint16_t idx);
>
> New APIs should be experimental and also need to be
> added in rte_vhost_version.map file.
>
> > +
> > +/**
> >   * Get vhost RX queue avail count.
> >   *
> >   * @param vid
> > diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c
> > index 163f4595e..9ba692935 100644
> > --- a/lib/librte_vhost/vhost.c
> > +++ b/lib/librte_vhost/vhost.c
> > @@ -76,6 +76,8 @@ cleanup_vq(struct vhost_virtqueue *vq, int destroy)
> >   close(vq->callfd);
> >   if (vq->kickfd >= 0)
> >   close(vq->kickfd);
> > + if (vq->inflight)
> > + vq->inflight = NULL;
> >  }
> >
> >  /*
> > @@ -589,6 +591,11 @@ rte_vhost_get_vhost_vring(int vid, uint16_t vring_idx,
> >   vring->kickfd  = vq->kic