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

2019-05-05 Thread Li Lin
From: Li Lin 

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: Li Lin 
Signed-off-by: Ni Xun 
Signed-off-by: Zhang Yu 
---
v2 - add set&clr inflight desc functions
v3 - simplified some functions implementation
v4 - rework some data structures according to qemu doc

 lib/librte_vhost/rte_vhost.h   |  83 ++
 lib/librte_vhost/rte_vhost_version.map |   3 +
 lib/librte_vhost/vhost.c   | 105 
 lib/librte_vhost/vhost.h   |  12 ++
 lib/librte_vhost/vhost_user.c  | 292 +
 lib/librte_vhost/vhost_user.h  |  13 +-
 6 files changed, 507 insertions(+), 1 deletion(-)

diff --git a/lib/librte_vhost/rte_vhost.h b/lib/librte_vhost/rte_vhost.h
index d2c0c93f4..d4d709717 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,41 @@ struct rte_vhost_memory {
struct rte_vhost_mem_region regions[];
 };
 
+struct inflight_desc {
+   uint8_t inflight;
+   uint8_t padding[5];
+   uint16_t next;
+   uint64_t counter;
+};
+
+struct inflight_info {
+   uint64_t features;
+   uint16_t version;
+   uint16_t desc_num;
+   uint16_t last_inflight_io;
+   uint16_t used_idx;
+   struct inflight_desc desc[0];
+};
+
+struct resubmit_desc {
+   uint16_t index;
+   uint64_t counter;
+};
+
+struct resubmit_info {
+   struct resubmit_desc *resubmit_list;
+   uint16_t resubmit_num;
+};
+
 struct rte_vhost_vring {
struct vring_desc   *desc;
struct vring_avail  *avail;
struct vring_used   *used;
uint64_tlog_guest_addr;
 
+   struct inflight_info*inflight;
+   struct resubmit_info*resubmit;
+
/** Deprecated, use rte_vhost_vring_call() instead. */
int callfd;
 
@@ -632,6 +665,56 @@ 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 desc.
+ *
+ * @param vid
+ *  vhost device ID
+ * @param vring_idx
+ *  vring index
+ * @param idx
+ *  inflight entry index
+ * @return
+ *  0 on success, -1 on failure
+ */
+int __rte_experimental
+rte_vhost_set_inflight_desc(int vid, uint16_t vring_idx,
+   uint16_t idx);
+
+/**
+ * clear inflight flag for a desc.
+ *
+ * @param vid
+ *  vhost device ID
+ * @param vring_idx
+ *  vring index
+ * @param last_used_idx
+ *  next free used_idx
+ * @param idx
+ *  inflight entry index
+ * @return
+ *  0 on success, -1 on failure
+ */
+int __rte_experimental
+rte_vhost_clr_inflight_desc(int vid, uint16_t vring_idx,
+   uint16_t last_used_idx, uint16_t idx);
+
+/**
+ * set last inflight io index.
+ *
+ * @param vid
+ *  vhost device ID
+ * @param vring_idx
+ *  vring index
+ * @param idx
+ *  inflight entry index
+ * @return
+ *  0 on success, -1 on failure
+ */
+int __rte_experimental
+rte_vhost_set_last_inflight_io(int vid, uint16_t vring_idx,
+   uint16_t idx);
+
+/**
  * Get vhost RX queue avail count.
  *
  * @param vid
diff --git a/lib/librte_vhost/rte_vhost_version.map 
b/lib/librte_vhost/rte_vhost_version.map
index 5f1d4a75c..a992b3935 100644
--- a/lib/librte_vhost/rte_vhost_version.map
+++ b/lib/librte_vhost/rte_vhost_version.map
@@ -87,4 +87,7 @@ EXPERIMENTAL {
rte_vdpa_relay_vring_used;
rte_vhost_extern_callback_register;
rte_vhost_driver_set_protocol_features;
+   rte_vhost_set_inflight_desc;
+   rte_vhost_clr_inflight_desc;
+   rte_vhost_set_last_inflight_io;
 };
diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c
index 163f4595e..03eab3551 100644
--- a/lib/librte_vhost/vhost.c
+++ b/lib/librte_vhost/vhost.c
@@ -76,6 +76,16 @@ cleanup_vq(struct vhost_virtqueue *vq, int destroy)
close(vq->callfd);
if (vq->kickfd >= 0)
close(vq->kickfd);
+   if (vq->inflight)
+   vq->inflight = NULL;
+   if (vq->resubmit->resubmit_list) {
+   free(vq->resubmit->resubmit_list);
+   vq->resubmit->resubmit_list = NULL;
+   }
+   if (vq->resubmit) {
+   free(vq->resubmit);
+   vq->resubmit = NULL;
+   }
 }
 
 /*
@

Re: [dpdk-dev] [PATCH v8] app/pdump: add pudmp exits with primary support

2019-05-05 Thread Thomas Monjalon
05/05/2019 03:20, Suanming. Mou:
> On 2019/5/5 5:17, Thomas Monjalon wrote:
> > Hi,
> >
> > 03/05/2019 07:48, Suanming. Mou:
> >> When primary app exits, the residual running pdump will stop the
> >> primary app to restart. Add pdump exits with primary support.
> > Sorry I fail to parse this sentence.
> > Maybe it should be longer to be more explicit about
> > what it the current issue and how it is solved.
> Thanks for the suggestion. It's fine to add more contents.
> > Some comments in the code may also be improved.
> 
> Could you please help to show the detail? Or it will be hard to do the 
> improvement.
> 
> ` There are a thousand Hamlets in a thousand people's eyes.`

Yes, you're right :)

[..]
> >> V8:
> >> * reword the print info in monitor_primary.
> >> * add release_19_05.rst update.
> > As it is not a fix, it will slip in 19.08.
> 
> It seems 19.08 is still not started yet.
> 
> Does that mean the patch should be hung till 19.08 be started?

Yes, either to wait one week, or fake the 19.08 release notes template
to do your patch on top.




Re: [dpdk-dev] [PATCH v8] app/pdump: add pudmp exits with primary support

2019-05-05 Thread Suanming . Mou



On 2019/5/5 17:42, Thomas Monjalon wrote:

Yes, either to wait one week, or fake the 19.08 release notes template
to do your patch on top.

Thanks.  I think it will be updated when 19.08 started.



[dpdk-dev] [PATCH v3] net/mlx5: fix init with zero Rx queues

2019-05-05 Thread Dekel Peled
Recent patch [1] added, at the end of mlx5_dev_configure(), a call to
mlx5_proc_priv_init(), initializing process_private data of eth_dev.
This call is not reached if PMD is started with zero Rx queues.
In this case mlx5_dev_configure() returns earlier due to the check:
if (rxqs_n == priv->rxqs_n)
return 0;
In such a scenario, later references to uninitialized process_private
data will result in segmentation fault.
For example see in function txq_uar_init().

This patch changes the check logic. The following code is executed
if (rxqs_n != priv->rxqs_n), and skipped otherwise.
Function mlx5_proc_priv_init() is always invoked, to ensure
process_private data is initialized.

[1] http://patches.dpdk.org/patch/52629/

Fixes: 120dc4a7dcd3 ("net/mlx5: remove device register remap")
Cc: sta...@dpdk.org

Signed-off-by: Dekel Peled 
Acked-by: Yongseok Koh 

---
v2: Update logic after code review.
v3: Remove unrelated code that was wrongly added in v2.
---
---
 drivers/net/mlx5/mlx5_ethdev.c | 46 +++---
 1 file changed, 25 insertions(+), 21 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index d1a70fc..80ee98f 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -428,27 +428,31 @@ struct ethtool_link_settings {
rte_errno = EINVAL;
return -rte_errno;
}
-   if (rxqs_n == priv->rxqs_n)
-   return 0;
-   DRV_LOG(INFO, "port %u Rx queues number update: %u -> %u",
-   dev->data->port_id, priv->rxqs_n, rxqs_n);
-   priv->rxqs_n = rxqs_n;
-   /* If the requested number of RX queues is not a power of two, use the
-* maximum indirection table size for better balancing.
-* The result is always rounded to the next power of two. */
-   reta_idx_n = (1 << log2above((rxqs_n & (rxqs_n - 1)) ?
-priv->config.ind_table_max_size :
-rxqs_n));
-   ret = mlx5_rss_reta_index_resize(dev, reta_idx_n);
-   if (ret)
-   return ret;
-   /* When the number of RX queues is not a power of two, the remaining
-* table entries are padded with reused WQs and hashes are not spread
-* uniformly. */
-   for (i = 0, j = 0; (i != reta_idx_n); ++i) {
-   (*priv->reta_idx)[i] = j;
-   if (++j == rxqs_n)
-   j = 0;
+   if (rxqs_n != priv->rxqs_n) {
+   DRV_LOG(INFO, "port %u Rx queues number update: %u -> %u",
+   dev->data->port_id, priv->rxqs_n, rxqs_n);
+   priv->rxqs_n = rxqs_n;
+   /*
+* If the requested number of RX queues is not a power of two,
+* use the maximum indirection table size for better balancing.
+* The result is always rounded to the next power of two.
+*/
+   reta_idx_n = (1 << log2above((rxqs_n & (rxqs_n - 1)) ?
+priv->config.ind_table_max_size :
+rxqs_n));
+   ret = mlx5_rss_reta_index_resize(dev, reta_idx_n);
+   if (ret)
+   return ret;
+   /*
+* When the number of RX queues is not a power of two,
+* the remaining table entries are padded with reused WQs
+* and hashes are not spread uniformly.
+*/
+   for (i = 0, j = 0; (i != reta_idx_n); ++i) {
+   (*priv->reta_idx)[i] = j;
+   if (++j == rxqs_n)
+   j = 0;
+   }
}
ret = mlx5_proc_priv_init(dev);
if (ret)
-- 
1.8.3.1



[dpdk-dev] [PATCH v3 3/4] net/mlx5: fix description of function return value

2019-05-05 Thread Dekel Peled
Return value of function mlx5_rxq_releasable() was not described
correctly in function description.

This patch updates the description to correctly describe the optional
return values.

Fixes: a6d83b6a9209 ("net/mlx5: standardize on negative errno values")
cc: sta...@dpdk.org

Signed-off-by: Dekel Peled 
Acked-by: Shahaf Shuler 
Acked-by: Yongseok Koh 
---
 drivers/net/mlx5/mlx5_rxq.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 0054096..a22ed91 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -1526,8 +1526,9 @@ struct mlx5_rxq_ctrl *
  *   RX queue index.
  *
  * @return
- *   1 if the queue can be released, negative errno otherwise and rte_errno is
- *   set.
+ *   1 if the queue can be released
+ *   0 if the queue can not be released, there are references to it.
+ *   Negative errno and rte_errno is set if queue doesn't exist.
  */
 int
 mlx5_rxq_releasable(struct rte_eth_dev *dev, uint16_t idx)
-- 
1.8.3.1



[dpdk-dev] [PATCH v3 2/4] net/mlx5: fix missing validation of null pointer

2019-05-05 Thread Dekel Peled
Function mlx5_rxq_ibv_release() is called in several places.
Before each call except one, the input parameter is validated to make
sure it is not null.

This patch adds the validation where it is missing.
It also changes a priv_ prefix, left in a comment, to mlx5_ prefix.

Fixes: af4f09f28294 ("net/mlx5: prefix all functions with mlx5")
Cc: sta...@dpdk.org

Signed-off-by: Dekel Peled 
Acked-by: Shahaf Shuler 
Acked-by: Yongseok Koh 
---
 drivers/net/mlx5/mlx5_rxq.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 222fe95..0054096 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -593,11 +593,12 @@
continue;
/**
 * Need to access directly the queue to release the reference
-* kept in priv_rx_intr_vec_enable().
+* kept in mlx5_rx_intr_vec_enable().
 */
rxq_data = (*priv->rxqs)[i];
rxq_ctrl = container_of(rxq_data, struct mlx5_rxq_ctrl, rxq);
-   mlx5_rxq_ibv_release(rxq_ctrl->ibv);
+   if (rxq_ctrl->ibv)
+   mlx5_rxq_ibv_release(rxq_ctrl->ibv);
}
 free:
rte_intr_free_epoll_fd(intr_handle);
-- 
1.8.3.1



[dpdk-dev] [PATCH v3 1/4] net/mlx5: remove unused functions

2019-05-05 Thread Dekel Peled
Functions implemented but never called:
mlx5_rxq_ibv_releasable()
mlx5_rxq_cleanup()
mlx5_txq_ibv_releasable()

Function declared but not implemented:
rxq_alloc_mprq_buf()

This patch removes these functions from code and header file.

Signed-off-by: Dekel Peled 
Acked-by: Shahaf Shuler 
Acked-by: Yongseok Koh 
---
 drivers/net/mlx5/mlx5_rxq.c  | 31 ---
 drivers/net/mlx5/mlx5_rxtx.h |  4 
 drivers/net/mlx5/mlx5_txq.c  | 13 -
 3 files changed, 48 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 0a4c02e..222fe95 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -353,24 +353,6 @@
 }
 
 /**
- * Clean up a RX queue.
- *
- * Destroy objects, free allocated memory and reset the structure for reuse.
- *
- * @param rxq_ctrl
- *   Pointer to RX queue structure.
- */
-void
-mlx5_rxq_cleanup(struct mlx5_rxq_ctrl *rxq_ctrl)
-{
-   DRV_LOG(DEBUG, "port %u cleaning up Rx queue %u",
-   PORT_ID(rxq_ctrl->priv), rxq_ctrl->rxq.idx);
-   if (rxq_ctrl->ibv)
-   mlx5_rxq_ibv_release(rxq_ctrl->ibv);
-   memset(rxq_ctrl, 0, sizeof(*rxq_ctrl));
-}
-
-/**
  * Returns the per-queue supported offloads.
  *
  * @param dev
@@ -,19 +1093,6 @@ struct mlx5_rxq_ibv *
 }
 
 /**
- * Return true if a single reference exists on the object.
- *
- * @param rxq_ibv
- *   Verbs Rx queue object.
- */
-int
-mlx5_rxq_ibv_releasable(struct mlx5_rxq_ibv *rxq_ibv)
-{
-   assert(rxq_ibv);
-   return (rte_atomic32_read(&rxq_ibv->refcnt) == 1);
-}
-
-/**
  * Callback function to initialize mbufs for Multi-Packet RQ.
  */
 static inline void
diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h
index 4339aaf..104ba7c 100644
--- a/drivers/net/mlx5/mlx5_rxtx.h
+++ b/drivers/net/mlx5/mlx5_rxtx.h
@@ -249,7 +249,6 @@ struct mlx5_txq_ctrl {
 int mlx5_mprq_enabled(struct rte_eth_dev *dev);
 int mlx5_mprq_free_mp(struct rte_eth_dev *dev);
 int mlx5_mprq_alloc_mp(struct rte_eth_dev *dev);
-void mlx5_rxq_cleanup(struct mlx5_rxq_ctrl *rxq_ctrl);
 int mlx5_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,
unsigned int socket, const struct rte_eth_rxconf *conf,
struct rte_mempool *mp);
@@ -261,7 +260,6 @@ int mlx5_rx_queue_setup(struct rte_eth_dev *dev, uint16_t 
idx, uint16_t desc,
 struct mlx5_rxq_ibv *mlx5_rxq_ibv_new(struct rte_eth_dev *dev, uint16_t idx);
 struct mlx5_rxq_ibv *mlx5_rxq_ibv_get(struct rte_eth_dev *dev, uint16_t idx);
 int mlx5_rxq_ibv_release(struct mlx5_rxq_ibv *rxq_ibv);
-int mlx5_rxq_ibv_releasable(struct mlx5_rxq_ibv *rxq_ibv);
 struct mlx5_rxq_ibv *mlx5_rxq_ibv_drop_new(struct rte_eth_dev *dev);
 void mlx5_rxq_ibv_drop_release(struct rte_eth_dev *dev);
 int mlx5_rxq_ibv_verify(struct rte_eth_dev *dev);
@@ -274,7 +272,6 @@ struct mlx5_rxq_ctrl *mlx5_rxq_new(struct rte_eth_dev *dev, 
uint16_t idx,
 int mlx5_rxq_releasable(struct rte_eth_dev *dev, uint16_t idx);
 int mlx5_rxq_verify(struct rte_eth_dev *dev);
 int rxq_alloc_elts(struct mlx5_rxq_ctrl *rxq_ctrl);
-int rxq_alloc_mprq_buf(struct mlx5_rxq_ctrl *rxq_ctrl);
 struct mlx5_ind_table_ibv *mlx5_ind_table_ibv_new(struct rte_eth_dev *dev,
  const uint16_t *queues,
  uint32_t queues_n);
@@ -311,7 +308,6 @@ int mlx5_tx_queue_setup(struct rte_eth_dev *dev, uint16_t 
idx, uint16_t desc,
 struct mlx5_txq_ibv *mlx5_txq_ibv_new(struct rte_eth_dev *dev, uint16_t idx);
 struct mlx5_txq_ibv *mlx5_txq_ibv_get(struct rte_eth_dev *dev, uint16_t idx);
 int mlx5_txq_ibv_release(struct mlx5_txq_ibv *txq_ibv);
-int mlx5_txq_ibv_releasable(struct mlx5_txq_ibv *txq_ibv);
 int mlx5_txq_ibv_verify(struct rte_eth_dev *dev);
 struct mlx5_txq_ctrl *mlx5_txq_new(struct rte_eth_dev *dev, uint16_t idx,
   uint16_t desc, unsigned int socket,
diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
index b281c45..50b1f81 100644
--- a/drivers/net/mlx5/mlx5_txq.c
+++ b/drivers/net/mlx5/mlx5_txq.c
@@ -642,19 +642,6 @@ struct mlx5_txq_ibv *
 }
 
 /**
- * Return true if a single reference exists on the object.
- *
- * @param txq_ibv
- *   Verbs Tx queue object.
- */
-int
-mlx5_txq_ibv_releasable(struct mlx5_txq_ibv *txq_ibv)
-{
-   assert(txq_ibv);
-   return (rte_atomic32_read(&txq_ibv->refcnt) == 1);
-}
-
-/**
  * Verify the Verbs Tx queue list is empty
  *
  * @param dev
-- 
1.8.3.1



[dpdk-dev] [PATCH v3 4/4] net/mlx5: move locally used functions to static

2019-05-05 Thread Dekel Peled
Multiple functions were declared in header file mlx5_rxtx.h,
inplemented in mlx5_rxq.c, and called only in mlx5_rxq.c.

This patch moves all these functions declarations into mlx5_rxq.c,
as static functions.
Some functions implementation was copied higher in the file to
precede the functions calls.

Signed-off-by: Dekel Peled 
Acked-by: Shahaf Shuler 
Acked-by: Yongseok Koh 
---
 drivers/net/mlx5/mlx5_rxq.c  | 185 +--
 drivers/net/mlx5/mlx5_rxtx.h |  16 
 2 files changed, 92 insertions(+), 109 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index a22ed91..e0ae068 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -65,7 +65,7 @@
  * @return
  *   1 if supported, negative errno value if not.
  */
-inline int
+static inline int
 mlx5_check_mprq_support(struct rte_eth_dev *dev)
 {
struct mlx5_priv *priv = dev->data->dev_private;
@@ -398,6 +398,33 @@
 }
 
 /**
+ * Verify if the queue can be released.
+ *
+ * @param dev
+ *   Pointer to Ethernet device.
+ * @param idx
+ *   RX queue index.
+ *
+ * @return
+ *   1 if the queue can be released
+ *   0 if the queue can not be released, there are references to it.
+ *   Negative errno and rte_errno is set if queue doesn't exist.
+ */
+static int
+mlx5_rxq_releasable(struct rte_eth_dev *dev, uint16_t idx)
+{
+   struct mlx5_priv *priv = dev->data->dev_private;
+   struct mlx5_rxq_ctrl *rxq_ctrl;
+
+   if (!(*priv->rxqs)[idx]) {
+   rte_errno = EINVAL;
+   return -rte_errno;
+   }
+   rxq_ctrl = container_of((*priv->rxqs)[idx], struct mlx5_rxq_ctrl, rxq);
+   return (rte_atomic32_read(&rxq_ctrl->refcnt) == 1);
+}
+
+/**
  *
  * @param dev
  *   Pointer to Ethernet device structure.
@@ -485,6 +512,63 @@
 }
 
 /**
+ * Get an Rx queue Verbs object.
+ *
+ * @param dev
+ *   Pointer to Ethernet device.
+ * @param idx
+ *   Queue index in DPDK Rx queue array
+ *
+ * @return
+ *   The Verbs object if it exists.
+ */
+static struct mlx5_rxq_ibv *
+mlx5_rxq_ibv_get(struct rte_eth_dev *dev, uint16_t idx)
+{
+   struct mlx5_priv *priv = dev->data->dev_private;
+   struct mlx5_rxq_data *rxq_data = (*priv->rxqs)[idx];
+   struct mlx5_rxq_ctrl *rxq_ctrl;
+
+   if (idx >= priv->rxqs_n)
+   return NULL;
+   if (!rxq_data)
+   return NULL;
+   rxq_ctrl = container_of(rxq_data, struct mlx5_rxq_ctrl, rxq);
+   if (rxq_ctrl->ibv)
+   rte_atomic32_inc(&rxq_ctrl->ibv->refcnt);
+   return rxq_ctrl->ibv;
+}
+
+/**
+ * Release an Rx verbs queue object.
+ *
+ * @param rxq_ibv
+ *   Verbs Rx queue object.
+ *
+ * @return
+ *   1 while a reference on it exists, 0 when freed.
+ */
+static int
+mlx5_rxq_ibv_release(struct mlx5_rxq_ibv *rxq_ibv)
+{
+   assert(rxq_ibv);
+   assert(rxq_ibv->wq);
+   assert(rxq_ibv->cq);
+   if (rte_atomic32_dec_and_test(&rxq_ibv->refcnt)) {
+   rxq_free_elts(rxq_ibv->rxq_ctrl);
+   claim_zero(mlx5_glue->destroy_wq(rxq_ibv->wq));
+   claim_zero(mlx5_glue->destroy_cq(rxq_ibv->cq));
+   if (rxq_ibv->channel)
+   claim_zero(mlx5_glue->destroy_comp_channel
+  (rxq_ibv->channel));
+   LIST_REMOVE(rxq_ibv, next);
+   rte_free(rxq_ibv);
+   return 0;
+   }
+   return 1;
+}
+
+/**
  * Allocate queue vector and fill epoll fd list for Rx interrupts.
  *
  * @param dev
@@ -1012,64 +1096,6 @@ struct mlx5_rxq_ibv *
 }
 
 /**
- * Get an Rx queue Verbs object.
- *
- * @param dev
- *   Pointer to Ethernet device.
- * @param idx
- *   Queue index in DPDK Rx queue array
- *
- * @return
- *   The Verbs object if it exists.
- */
-struct mlx5_rxq_ibv *
-mlx5_rxq_ibv_get(struct rte_eth_dev *dev, uint16_t idx)
-{
-   struct mlx5_priv *priv = dev->data->dev_private;
-   struct mlx5_rxq_data *rxq_data = (*priv->rxqs)[idx];
-   struct mlx5_rxq_ctrl *rxq_ctrl;
-
-   if (idx >= priv->rxqs_n)
-   return NULL;
-   if (!rxq_data)
-   return NULL;
-   rxq_ctrl = container_of(rxq_data, struct mlx5_rxq_ctrl, rxq);
-   if (rxq_ctrl->ibv) {
-   rte_atomic32_inc(&rxq_ctrl->ibv->refcnt);
-   }
-   return rxq_ctrl->ibv;
-}
-
-/**
- * Release an Rx verbs queue object.
- *
- * @param rxq_ibv
- *   Verbs Rx queue object.
- *
- * @return
- *   1 while a reference on it exists, 0 when freed.
- */
-int
-mlx5_rxq_ibv_release(struct mlx5_rxq_ibv *rxq_ibv)
-{
-   assert(rxq_ibv);
-   assert(rxq_ibv->wq);
-   assert(rxq_ibv->cq);
-   if (rte_atomic32_dec_and_test(&rxq_ibv->refcnt)) {
-   rxq_free_elts(rxq_ibv->rxq_ctrl);
-   claim_zero(mlx5_glue->destroy_wq(rxq_ibv->wq));
-   claim_zero(mlx5_glue->destroy_cq(rxq_ibv->cq));
-   if (rxq_ibv->channel)
-   claim_zero(mlx5_glue->dest

[dpdk-dev] [PATCH v3 0/4] net/mlx5: code cleanup in rx and tx files

2019-05-05 Thread Dekel Peled
During work on Rx feature I did some cleanup actions.
This series includes those changes divided by their type.

---
v2: Change 2nd patch type to "fix".
v3: Apply minor code-review comment on 2nd patch.
Add Acked-by in all patches.
---

Dekel Peled (4):
  net/mlx5: remove unused functions
  net/mlx5: fix missing validation of null pointer
  net/mlx5: fix description of function return value
  net/mlx5: move locally used functions to static

 drivers/net/mlx5/mlx5_rxq.c  | 220 +++
 drivers/net/mlx5/mlx5_rxtx.h |  20 
 drivers/net/mlx5/mlx5_txq.c  |  13 ---
 3 files changed, 95 insertions(+), 158 deletions(-)

-- 
1.8.3.1



[dpdk-dev] [PATCH] power: fix struct cache line-alignment issues

2019-05-05 Thread Mattias Rönnblom
The ACPI and PState CPU frequency scaling drivers used the
__rte_cache_aligned attribute without including rte_memory.h, which
turns what looks as the declaration of a cache line-aligned struct
into a non-aligned struct declaration and the definition of an
instance of the struct.

Fixes: e6c6dc0f96 ("power: add p-state driver compatibility")
Fixes: 445c6528b5 ("power: common interface for guest and host")

Signed-off-by: Mattias Rönnblom 
---
 lib/librte_power/power_acpi_cpufreq.c   | 5 +++--
 lib/librte_power/power_pstate_cpufreq.c | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/lib/librte_power/power_acpi_cpufreq.c 
b/lib/librte_power/power_acpi_cpufreq.c
index 5672c594e..7c386f891 100644
--- a/lib/librte_power/power_acpi_cpufreq.c
+++ b/lib/librte_power/power_acpi_cpufreq.c
@@ -12,9 +12,10 @@
 #include 
 #include 
 
-#include 
-#include 
 #include 
+#include 
+#include 
+#include 
 
 #include "power_acpi_cpufreq.h"
 #include "power_common.h"
diff --git a/lib/librte_power/power_pstate_cpufreq.c 
b/lib/librte_power/power_pstate_cpufreq.c
index c2c4e8e14..30727f04b 100644
--- a/lib/librte_power/power_pstate_cpufreq.c
+++ b/lib/librte_power/power_pstate_cpufreq.c
@@ -14,9 +14,10 @@
 #include 
 #include 
 
-#include 
-#include 
 #include 
+#include 
+#include 
+#include 
 
 #include "power_pstate_cpufreq.h"
 #include "power_common.h"
-- 
2.17.1



Re: [dpdk-dev] [PATCH] net/i40e: add new device id for X710/XXV710 of IPN3KE

2019-05-05 Thread Zhang, Qi Z



> -Original Message-
> From: Xu, Rosen
> Sent: Sunday, May 5, 2019 11:27 AM
> To: dev@dpdk.org
> Cc: Yigit, Ferruh ; Zhang, Qi Z 
> ;
> Xing, Beilei ; Wu, Jingjing ;
> Zhang, Tianfei ; Wei, Dan ; Xu,
> Rosen ; Pei, Andy ; Yang, Qiming
> ; Chen, Santos 
> Subject: [PATCH] net/i40e: add new device id for X710/XXV710 of IPN3KE
> 
> New pci device ids are created to support X710/XXV710 of Intel FPGA
> Programmable Acceleration card N3000, also called ipn3ke.
> 
> Signed-off-by: Rosen Xu 

Acked-by: Qi Zhang 

Applied to dpdk-next-net-intel.

Thanks
Qi


Re: [dpdk-dev] [PATCH] net/ice: minor code cleanups

2019-05-05 Thread Zhang, Qi Z



> -Original Message-
> From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Xiao Wang
> Sent: Sunday, May 5, 2019 1:45 PM
> To: Lu, Wenzhuo 
> Cc: dev@dpdk.org; Yang, Qiming ; Wang, Xiao W
> 
> Subject: [dpdk-dev] [PATCH] net/ice: minor code cleanups
> 
> This patch is a cleanup on comment, variable modifier, coding style.
> 
> Signed-off-by: Xiao Wang 

Acked-by: Qi Zhang 

Applied to dpdk-next-net-intel.

Thanks
Qi


Re: [dpdk-dev] [PATCH] net/ice: fix EEPROM range check

2019-05-05 Thread Zhang, Qi Z



> -Original Message-
> From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Xiao Wang
> Sent: Sunday, May 5, 2019 1:48 PM
> To: Lu, Wenzhuo 
> Cc: dev@dpdk.org; Yang, Qiming ; Rong, Leyi
> ; Wang, Xiao W ;
> sta...@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/ice: fix EEPROM range check
> 
> The last word should not cross shadow RAM boundary.
> 
> Fixes: 68a1ab82ad74 ("net/ice: speed up to retrieve EEPROM")
> Cc: sta...@dpdk.org
> 
> Signed-off-by: Xiao Wang 

Acked-by: Qi Zhang 

Applied to dpdk-next-net-intel.

Thanks
Qi


Re: [dpdk-dev] [PATCH] net/fm10k: support Rx queue count API

2019-05-05 Thread Zhang, Qi Z



> -Original Message-
> From: Wang, Xiao W
> Sent: Wednesday, April 24, 2019 3:52 PM
> To: Zhang, Qi Z 
> Cc: dev@dpdk.org; Yigit, Ferruh ; Wang, Xiao W
> 
> Subject: [PATCH] net/fm10k: support Rx queue count API
> 
> Some application, e.g. the l3fwd-power sample uses rte_eth_rx_queue_count()
> API to get the get the number of used descriptors of a Rx queue. This patch
> adds fm10k implementation for this API.
> 
> Signed-off-by: Xiao Wang 

Acked-by: Qi Zhang 

Applied to dpdk-next-net-intel.

Thanks
Qi


Re: [dpdk-dev] [PATCH] net/iavf: enable more link speed

2019-05-05 Thread Zhang, Qi Z



> -Original Message-
> From: Zhao1, Wei
> Sent: Sunday, May 5, 2019 10:50 AM
> To: Zhang, Qi Z ; Lu, Wenzhuo 
> Cc: Stillwell Jr, Paul M ; dev@dpdk.org;
> sta...@dpdk.org
> Subject: RE: [PATCH] net/iavf: enable more link speed
> 
> Acked-by: Wei Zhao 
> 
> 
> > -Original Message-
> > From: Zhang, Qi Z
> > Sent: Saturday, May 4, 2019 10:09 PM
> > To: Lu, Wenzhuo ; Zhao1, Wei
> > 
> > Cc: Stillwell Jr, Paul M ;
> > dev@dpdk.org; Zhang, Qi Z ; sta...@dpdk.org
> > Subject: [PATCH] net/iavf: enable more link speed
> >
> > Enable advanced link speed mode (VIRTCHNL_VF_CAP_ADV_LINK_SPEED) so
> > iavf PMD can identify more link speed that reported by pf.
> >
> > Cc: sta...@dpdk.org
> >
> > Signed-off-by: Qi Zhang 

Applied to dpdk-next-net-intel.

Thanks
Qi


[dpdk-dev] [PATCH] doc: remove redudant information from guide

2019-05-05 Thread Vipin Varghese
Remove redudant information from section 'Performance issue isolation'.
Reword for packet capture header.

Signed-off-by: Vipin Varghese 
---
 doc/guides/howto/debug_troubleshoot.rst | 8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/doc/guides/howto/debug_troubleshoot.rst 
b/doc/guides/howto/debug_troubleshoot.rst
index 6abddcd32..cef016b2f 100644
--- a/doc/guides/howto/debug_troubleshoot.rst
+++ b/doc/guides/howto/debug_troubleshoot.rst
@@ -298,10 +298,6 @@ Custom worker function :numref:`dtg_distributor_worker`.
 
 #. Performance issue isolation
 
-   * The functions running on CPU cores without context switches are the
- performing scenarios. Identify lcore with ``rte_lcore`` and lcore index
- mapping with CPU using ``rte_lcore_index``.
-
* The functions running on CPU cores without context switches are the
  performing scenarios. Identify lcore with ``rte_lcore`` and lcore index
  mapping with CPU using ``rte_lcore_index``.
@@ -404,8 +400,8 @@ Traffic Manager on TX interface :numref:`dtg_qos_tx`.
for drops for hierarchy, schedulers and WRED configurations.
 
 
-Is the packet not in the unexpected format?
-~~~
+Is the packet in the unexpected format?
+~~~
 
 Packet capture before and after processing :numref:`dtg_pdump`.
 
-- 
2.17.1



[dpdk-dev] [Bug 182] make doc-guides-pdf fails with error 'make[3]: latexmk: Command not found'

2019-05-05 Thread bugzilla
https://bugs.dpdk.org/show_bug.cgi?id=182

Vipin Varghese (vipin.vargh...@intel.com) changed:

   What|Removed |Added

 Status|CONFIRMED   |RESOLVED
 Resolution|--- |FIXED

--- Comment #6 from Vipin Varghese (vipin.vargh...@intel.com) ---
marking resolved

-- 
You are receiving this mail because:
You are the assignee for the bug.

[dpdk-dev] [Bug 178] l2fwd application does not work with option '-q'

2019-05-05 Thread bugzilla
https://bugs.dpdk.org/show_bug.cgi?id=178

Vipin Varghese (vipin.vargh...@intel.com) changed:

   What|Removed |Added

 Status|CONFIRMED   |RESOLVED
 Resolution|--- |WONTFIX

--- Comment #4 from Vipin Varghese (vipin.vargh...@intel.com) ---
l2fwd application design limitation

-- 
You are receiving this mail because:
You are the assignee for the bug.