[dpdk-dev] [PATCH] mempool: fix calculating address of object trailers

2015-07-22 Thread Yuichi Nakai
__mempool_get_trailer() calculated header's address.
The address of trailer should set after element area.
This patch fixes this calculating.

This issue was mixed with the following commit:
 Fixes: 97e7e685bfcd ("mempool: add structure for object trailers")

Signed-off-by: Yuichi Nakai 
---
 lib/librte_mempool/rte_mempool.h | 13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h
index ee67ce7..075bcdf 100644
--- a/lib/librte_mempool/rte_mempool.h
+++ b/lib/librte_mempool/rte_mempool.h
@@ -271,12 +271,6 @@ static inline struct rte_mempool_objhdr 
*__mempool_get_header(void *obj)
return RTE_PTR_SUB(obj, sizeof(struct rte_mempool_objhdr));
 }

-/* return the trailer of a mempool object (internal) */
-static inline struct rte_mempool_objtlr *__mempool_get_trailer(void *obj)
-{
-   return RTE_PTR_SUB(obj, sizeof(struct rte_mempool_objtlr));
-}
-
 /**
  * Return a pointer to the mempool owning this object.
  *
@@ -292,6 +286,13 @@ static inline struct rte_mempool 
*rte_mempool_from_obj(void *obj)
return hdr->mp;
 }

+/* return the trailer of a mempool object (internal) */
+static inline struct rte_mempool_objtlr *__mempool_get_trailer(void *obj)
+{
+   struct rte_mempool *mp = rte_mempool_from_obj(obj);
+   return RTE_PTR_ADD(obj, mp->elt_size);
+}
+
 /**
  * @internal Check and update cookies or panic.
  *
-- 
1.9.1



[dpdk-dev] [PATCHv3 1/5] ethdev: add new API to retrieve RX/TX queue information

2015-07-22 Thread Thomas Monjalon
2015-07-22 17:00, Ananyev, Konstantin:
> From: Zhang, Helin
> > > -#ifdef __cplusplus
> > > -}
> > > -#endif
> > > -
> > >  /**
> > >   * Set the list of multicast addresses to filter on an Ethernet device.
> > >   *
> > > @@ -3882,4 +3952,9 @@ extern int
> > > rte_eth_timesync_read_rx_timestamp(uint8_t port_id,
> > >   */
> > >  extern int rte_eth_timesync_read_tx_timestamp(uint8_t port_id,
> > > struct timespec *timestamp);
> > > +
> > > +#ifdef __cplusplus
> > > +}
> > > +#endif
> > This is fix for the issue introduced by new ieee1588. It must be added in 
> > R2.1 no matter
> > these patches can be applied or not.

Yes you're totally right Helin.
It's a fix and should be in a separate patch.
This feature is not planned in 2.1.


[dpdk-dev] [PATCH] The VMXNET3 PMD can't receive packet suddenly after a lot of traffic coming in. The root cause is due to mbuf allocation fail in vmxnet3_post_rx_bufs() and there is no error handlin

2015-07-22 Thread Stephen Hemminger
On Thu, 23 Jul 2015 09:48:55 +0800
mac_leehk at yahoo.com.hk wrote:

> From: marco 

Thank you for addressing a real bug. 

But there are several issues with the patch as submitted:

 * the standard way to handle allocation failure in network drivers is to drop 
the
   received packet and reuse the available data buffer (mbuf) for the next 
packet.
   It looks like your code would just stop receiving which could cause deadlock.

 * the mail is formatted in a manner than is incompatible with merging into git.
   All submissions should have a short < 60 character Subject with a summary
   followed by a description.  I don't know what mail client you used but 
everything
   is smashed into the Subject.

 * all patches require a Signed-off-by with a real name for Developer's 
Certificate Of Origin

 * the style is wrong, indentation is a mess please indent with tabs not spaces.

 * avoid extra comments, often in code too many comments are worse than too few


Please rework your patch and resubmit it.

>  drivers/net/vmxnet3/vmxnet3_rxtx.c |   54 
> +++-
>  1 file changed, 53 insertions(+), 1 deletion(-)
>  mode change 100644 => 100755 drivers/net/vmxnet3/vmxnet3_rxtx.c
> 
> diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c 
> b/drivers/net/vmxnet3/vmxnet3_rxtx.c
> old mode 100644
> new mode 100755
> index 39ad6ef..d560bbb
> --- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
> +++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
> @@ -421,6 +421,51 @@ vmxnet3_xmit_pkts(void *tx_queue, struct rte_mbuf 
> **tx_pkts,
>   return nb_tx;
>  }
>  
> +static inline void
> +vmxnet3_renew_desc(vmxnet3_rx_queue_t *rxq, uint8_t ring_id,struct rte_mbuf 
> *mbuf)
> +{
> + uint32_t  val = 0;
> + struct vmxnet3_cmd_ring *ring = &rxq->cmd_ring[ring_id];
> +
> + struct Vmxnet3_RxDesc *rxd;
> + vmxnet3_buf_info_t *buf_info = &ring->buf_info[ring->next2fill];
> +
> + rxd = (struct Vmxnet3_RxDesc *)(ring->base + ring->next2fill);
> +
> + if (ring->rid == 0) {
> + /* Usually: One HEAD type buf per packet
> +  * val = (ring->next2fill % rxq->hw->bufs_per_pkt) ?
> +  * VMXNET3_RXD_BTYPE_BODY : VMXNET3_RXD_BTYPE_HEAD;
> +  */
> +
> + /* We use single packet buffer so all heads here */
> + val = VMXNET3_RXD_BTYPE_HEAD;
> + } else {
> + /* All BODY type buffers for 2nd ring; which won't be used at all by 
> ESXi */
> + val = VMXNET3_RXD_BTYPE_BODY;
> + }
> +
> + /*
> +  * Load mbuf pointer into buf_info[ring_size]
> +  * buf_info structure is equivalent to cookie for virtio-virtqueue
> +  */
> + buf_info->m = mbuf;
> + buf_info->len = (uint16_t)(mbuf->buf_len -
> +RTE_PKTMBUF_HEADROOM);
> + buf_info->bufPA = RTE_MBUF_DATA_DMA_ADDR_DEFAULT(mbuf);
> +
> + /* Load Rx Descriptor with the buffer's GPA */
> + rxd->addr = buf_info->bufPA;
> +
> + /* After this point rxd->addr MUST not be NULL */
> + rxd->btype = val;
> + rxd->len = buf_info->len;
> + /* Flip gen bit at the end to change ownership */
> + rxd->gen = ring->gen;
> +
> + vmxnet3_cmd_ring_adv_next2fill(ring);
> +
> +}
>  /*
>   *  Allocates mbufs and clusters. Post rx descriptors with buffer details
>   *  so that device can receive packets in those buffers.
> @@ -575,8 +620,15 @@ vmxnet3_recv_pkts(void *rx_queue, struct rte_mbuf 
> **rx_pkts, uint16_t nb_pkts)
>   }
>  
>   while (rcd->gen == rxq->comp_ring.gen) {
> + struct rte_mbuf *rep;
>   if (nb_rx >= nb_pkts)
>   break;
> + 
> + rep = rte_rxmbuf_alloc(rxq->mp);
> + if (rep == NULL) {
> + rxq->stats.rx_buf_alloc_failure++;
> + break;
> + }
>  
>   idx = rcd->rxdIdx;
>   ring_idx = (uint8_t)((rcd->rqID == rxq->qid1) ? 0 : 1);
> @@ -657,7 +709,7 @@ rcd_done:
>   VMXNET3_INC_RING_IDX_ONLY(rxq->cmd_ring[ring_idx].next2comp, 
> rxq->cmd_ring[ring_idx].size);
>  
>   /* It's time to allocate some new buf and renew descriptors */
> - vmxnet3_post_rx_bufs(rxq, ring_idx);
> + vmxnet3_renew_desc(rxq, ring_idx,rep);
>   if (unlikely(rxq->shared->ctrl.updateRxProd)) {
>   VMXNET3_WRITE_BAR0_REG(hw, rxprod_reg[ring_idx] + 
> (rxq->queue_id * VMXNET3_REG_ALIGN),
>  
> rxq->cmd_ring[ring_idx].next2fill);



[dpdk-dev] [PATCHv4 5/5] testpmd: add new command to display RX/TX queue information

2015-07-22 Thread Konstantin Ananyev
Signed-off-by: Konstantin Ananyev 
---
 app/test-pmd/cmdline.c | 48 
 app/test-pmd/config.c  | 67 ++
 app/test-pmd/testpmd.h |  2 ++
 3 files changed, 117 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 8ab4687..29180de 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -5304,6 +5304,53 @@ cmdline_parse_inst_t cmd_showport = {
},
 };

+/* *** SHOW QUEUE INFO *** */
+struct cmd_showqueue_result {
+   cmdline_fixed_string_t show;
+   cmdline_fixed_string_t type;
+   cmdline_fixed_string_t what;
+   uint8_t portnum;
+   uint16_t queuenum;
+};
+
+static void
+cmd_showqueue_parsed(void *parsed_result,
+   __attribute__((unused)) struct cmdline *cl,
+   __attribute__((unused)) void *data)
+{
+   struct cmd_showqueue_result *res = parsed_result;
+
+   if (!strcmp(res->type, "rxq"))
+   rx_queue_infos_display(res->portnum, res->queuenum);
+   else if (!strcmp(res->type, "txq"))
+   tx_queue_infos_display(res->portnum, res->queuenum);
+}
+
+cmdline_parse_token_string_t cmd_showqueue_show =
+   TOKEN_STRING_INITIALIZER(struct cmd_showqueue_result, show, "show");
+cmdline_parse_token_string_t cmd_showqueue_type =
+   TOKEN_STRING_INITIALIZER(struct cmd_showqueue_result, type, "rxq#txq");
+cmdline_parse_token_string_t cmd_showqueue_what =
+   TOKEN_STRING_INITIALIZER(struct cmd_showqueue_result, what, "info");
+cmdline_parse_token_num_t cmd_showqueue_portnum =
+   TOKEN_NUM_INITIALIZER(struct cmd_showqueue_result, portnum, UINT8);
+cmdline_parse_token_num_t cmd_showqueue_queuenum =
+   TOKEN_NUM_INITIALIZER(struct cmd_showqueue_result, queuenum, UINT16);
+
+cmdline_parse_inst_t cmd_showqueue = {
+   .f = cmd_showqueue_parsed,
+   .data = NULL,
+   .help_str = "show rxq|txq info  ",
+   .tokens = {
+   (void *)&cmd_showqueue_show,
+   (void *)&cmd_showqueue_type,
+   (void *)&cmd_showqueue_what,
+   (void *)&cmd_showqueue_portnum,
+   (void *)&cmd_showqueue_queuenum,
+   NULL,
+   },
+};
+
 /* *** READ PORT REGISTER *** */
 struct cmd_read_reg_result {
cmdline_fixed_string_t read;
@@ -8913,6 +8960,7 @@ cmdline_parse_ctx_t main_ctx[] = {
(cmdline_parse_inst_t *)&cmd_help_long,
(cmdline_parse_inst_t *)&cmd_quit,
(cmdline_parse_inst_t *)&cmd_showport,
+   (cmdline_parse_inst_t *)&cmd_showqueue,
(cmdline_parse_inst_t *)&cmd_showportall,
(cmdline_parse_inst_t *)&cmd_showcfg,
(cmdline_parse_inst_t *)&cmd_start,
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 1d29146..f1fd6b1 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -293,6 +293,73 @@ nic_stats_mapping_display(portid_t port_id)
 }

 void
+rx_queue_infos_display(portid_t port_id, uint16_t queue_id)
+{
+   struct rte_eth_rxq_info qinfo;
+   int32_t rc;
+   static const char *info_border = "*";
+
+   rc = rte_eth_rx_queue_info_get(port_id, queue_id, &qinfo);
+   if (rc != 0) {
+   printf("Failed to retrieve inforamtion for port: %hhu, "
+   "RX queue: %hu\nerror desc: %s(%d)\n",
+   port_id, queue_id, strerror(-rc), rc);
+   return;
+   }
+
+   printf("\n%s Infos for port %-2u, RX queue %-2u %s",
+  info_border, port_id, queue_id, info_border);
+
+   printf("\nMempool: %s", (qinfo.mp == NULL) ? "NULL" : qinfo.mp->name);
+   printf("\nRX prefetch threshold: %hhu", qinfo.conf.rx_thresh.pthresh);
+   printf("\nRX host threshold: %hhu", qinfo.conf.rx_thresh.hthresh);
+   printf("\nRX writeback threshold: %hhu", qinfo.conf.rx_thresh.wthresh);
+   printf("\nRX free threshold: %hu", qinfo.conf.rx_free_thresh);
+   printf("\nRX drop packets: %s",
+   (qinfo.conf.rx_drop_en != 0) ? "on" : "off");
+   printf("\nRX deferred start: %s",
+   (qinfo.conf.rx_deferred_start != 0) ? "on" : "off");
+   printf("\nRX scattered packets: %s",
+   (qinfo.scattered_rx != 0) ? "on" : "off");
+   printf("\nNumber of RXDs: %hu", qinfo.nb_desc);
+   printf("\nMax possible number of RXDs: %hu", qinfo.max_desc);
+   printf("\nMin possible number of RXDs: %hu", qinfo.min_desc);
+   printf("\n");
+}
+
+void
+tx_queue_infos_display(portid_t port_id, uint16_t queue_id)
+{
+   struct rte_eth_txq_info qinfo;
+   int32_t rc;
+   static const char *info_border = "*";
+
+   rc = rte_eth_tx_queue_info_get(port_id, queue_id, &qinfo);
+   if (rc != 0) {
+   printf("Failed to retrieve inforamtion for port: %hhu, "
+   "TX queue: %hu\nerror desc: %s(%d)\n",
+   port_id, queue_id, strerror(-rc), rc);
+   

[dpdk-dev] [PATCHv4 4/5] e1000: add support for eth_(rxq|txq)_info_get

2015-07-22 Thread Konstantin Ananyev
Signed-off-by: Konstantin Ananyev 
---
 drivers/net/e1000/e1000_ethdev.h | 12 
 drivers/net/e1000/em_ethdev.c|  2 ++
 drivers/net/e1000/em_rxtx.c  | 38 ++
 drivers/net/e1000/igb_ethdev.c   |  4 
 drivers/net/e1000/igb_rxtx.c | 36 
 5 files changed, 92 insertions(+)

diff --git a/drivers/net/e1000/e1000_ethdev.h b/drivers/net/e1000/e1000_ethdev.h
index 4e69e44..7ee013a 100644
--- a/drivers/net/e1000/e1000_ethdev.h
+++ b/drivers/net/e1000/e1000_ethdev.h
@@ -307,6 +307,12 @@ void igb_pf_mbx_process(struct rte_eth_dev *eth_dev);

 int igb_pf_host_configure(struct rte_eth_dev *eth_dev);

+void igb_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+   struct rte_eth_rxq_info *qinfo);
+
+void igb_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+   struct rte_eth_txq_info *qinfo);
+
 /*
  * RX/TX EM function prototypes
  */
@@ -343,6 +349,12 @@ uint16_t eth_em_recv_pkts(void *rx_queue, struct rte_mbuf 
**rx_pkts,
 uint16_t eth_em_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
uint16_t nb_pkts);

+void em_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+   struct rte_eth_rxq_info *qinfo);
+
+void em_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+   struct rte_eth_txq_info *qinfo);
+
 void igb_pf_host_uninit(struct rte_eth_dev *dev);

 #endif /* _E1000_ETHDEV_H_ */
diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index d8c04e7..7cb8b0e 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -166,6 +166,8 @@ static const struct eth_dev_ops eth_em_ops = {
.mac_addr_add = eth_em_rar_set,
.mac_addr_remove  = eth_em_rar_clear,
.set_mc_addr_list = eth_em_set_mc_addr_list,
+   .rxq_info_get = em_rxq_info_get,
+   .txq_info_get = em_txq_info_get,
 };

 /**
diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c
index 3b8776d..5778723 100644
--- a/drivers/net/e1000/em_rxtx.c
+++ b/drivers/net/e1000/em_rxtx.c
@@ -1881,3 +1881,41 @@ eth_em_tx_init(struct rte_eth_dev *dev)
/* This write will effectively turn on the transmit unit. */
E1000_WRITE_REG(hw, E1000_TCTL, tctl);
 }
+
+void
+em_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+   struct rte_eth_rxq_info *qinfo)
+{
+   struct em_rx_queue *rxq;
+
+   rxq = dev->data->rx_queues[queue_id];
+
+   qinfo->mp = rxq->mb_pool;
+   qinfo->scattered_rx = dev->data->scattered_rx;
+
+   qinfo->nb_desc = rxq->nb_rx_desc;
+   qinfo->max_desc = EM_MAX_RING_DESC;
+   qinfo->min_desc = EM_MIN_RING_DESC;
+
+   qinfo->conf.rx_free_thresh = rxq->rx_free_thresh;
+}
+
+void
+em_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+   struct rte_eth_txq_info *qinfo)
+{
+   struct em_tx_queue *txq;
+
+   txq = dev->data->tx_queues[queue_id];
+
+   qinfo->nb_desc = txq->nb_tx_desc;
+   qinfo->max_desc = EM_MAX_RING_DESC;
+   qinfo->min_desc = EM_MIN_RING_DESC;
+
+   qinfo->conf.tx_thresh.pthresh = txq->pthresh;
+   qinfo->conf.tx_thresh.hthresh = txq->hthresh;
+   qinfo->conf.tx_thresh.wthresh = txq->wthresh;
+
+   qinfo->conf.tx_free_thresh = txq->tx_free_thresh;
+   qinfo->conf.tx_rs_thresh = txq->tx_rs_thresh;
+}
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index ddc7186..436405c 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -307,6 +307,8 @@ static const struct eth_dev_ops eth_igb_ops = {
.rss_hash_conf_get= eth_igb_rss_hash_conf_get,
.filter_ctrl  = eth_igb_filter_ctrl,
.set_mc_addr_list = eth_igb_set_mc_addr_list,
+   .rxq_info_get = igb_rxq_info_get,
+   .txq_info_get = igb_txq_info_get,
.timesync_enable  = igb_timesync_enable,
.timesync_disable = igb_timesync_disable,
.timesync_read_rx_timestamp = igb_timesync_read_rx_timestamp,
@@ -337,6 +339,8 @@ static const struct eth_dev_ops igbvf_eth_dev_ops = {
.tx_queue_setup   = eth_igb_tx_queue_setup,
.tx_queue_release = eth_igb_tx_queue_release,
.set_mc_addr_list = eth_igb_set_mc_addr_list,
+   .rxq_info_get = igb_rxq_info_get,
+   .txq_info_get = igb_txq_info_get,
.mac_addr_set = igbvf_default_mac_addr_set,
.get_reg_length   = igbvf_get_reg_length,
.get_reg  = igbvf_get_regs,
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index 3a31b21..5f047ca 100644
--- a/drivers/net/e1000/igb_rxtx.c
+++ b/drivers/net/e1000/igb_rxtx.c
@@ -2516,3 +2516,39 @@ eth_igbvf_tx_init(struct rte_eth_dev *dev)
}

 }
+
+void
+igb_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+   struct rte_eth_rxq_info *qinfo)
+{
+   struct igb_rx_queu

[dpdk-dev] [PATCHv4 3/5] ixgbe: add support for eth_(rxq|txq)_info_get

2015-07-22 Thread Konstantin Ananyev
Signed-off-by: Konstantin Ananyev 
---
 drivers/net/ixgbe/ixgbe_ethdev.c |  4 
 drivers/net/ixgbe/ixgbe_ethdev.h |  6 ++
 drivers/net/ixgbe/ixgbe_rxtx.c   | 42 
 3 files changed, 52 insertions(+)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 3a8cff0..053279e 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -431,6 +431,8 @@ static const struct eth_dev_ops ixgbe_eth_dev_ops = {
.rss_hash_conf_get= ixgbe_dev_rss_hash_conf_get,
.filter_ctrl  = ixgbe_dev_filter_ctrl,
.set_mc_addr_list = ixgbe_dev_set_mc_addr_list,
+   .rxq_info_get = ixgbe_rxq_info_get,
+   .txq_info_get = ixgbe_txq_info_get,
.timesync_enable  = ixgbe_timesync_enable,
.timesync_disable = ixgbe_timesync_disable,
.timesync_read_rx_timestamp = ixgbe_timesync_read_rx_timestamp,
@@ -466,6 +468,8 @@ static const struct eth_dev_ops ixgbevf_eth_dev_ops = {
.mac_addr_add = ixgbevf_add_mac_addr,
.mac_addr_remove  = ixgbevf_remove_mac_addr,
.set_mc_addr_list = ixgbe_dev_set_mc_addr_list,
+   .rxq_info_get = ixgbe_rxq_info_get,
+   .txq_info_get = ixgbe_txq_info_get,
.mac_addr_set = ixgbevf_set_default_mac_addr,
.get_reg_length   = ixgbevf_get_reg_length,
.get_reg  = ixgbevf_get_regs,
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_ethdev.h
index c16c11d..190c34a 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.h
+++ b/drivers/net/ixgbe/ixgbe_ethdev.h
@@ -347,6 +347,12 @@ int ixgbe_dev_tx_queue_start(struct rte_eth_dev *dev, 
uint16_t tx_queue_id);

 int ixgbe_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id);

+void ixgbe_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+   struct rte_eth_rxq_info *qinfo);
+
+void ixgbe_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+   struct rte_eth_txq_info *qinfo);
+
 int ixgbevf_dev_rx_init(struct rte_eth_dev *dev);

 void ixgbevf_dev_tx_init(struct rte_eth_dev *dev);
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 9b2d637..f910fb8 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -4689,6 +4689,48 @@ ixgbe_dev_tx_queue_stop(struct rte_eth_dev *dev, 
uint16_t tx_queue_id)
return 0;
 }

+void
+ixgbe_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+   struct rte_eth_rxq_info *qinfo)
+{
+   struct ixgbe_rx_queue *rxq;
+
+   rxq = dev->data->rx_queues[queue_id];
+
+   qinfo->mp = rxq->mb_pool;
+   qinfo->scattered_rx = dev->data->scattered_rx;
+
+   qinfo->nb_desc = rxq->nb_rx_desc;
+   qinfo->max_desc = IXGBE_MAX_RING_DESC;
+   qinfo->min_desc = IXGBE_MIN_RING_DESC;
+
+   qinfo->conf.rx_free_thresh = rxq->rx_free_thresh;
+   qinfo->conf.rx_drop_en = rxq->drop_en;
+   qinfo->conf.rx_deferred_start = rxq->rx_deferred_start;
+}
+
+void
+ixgbe_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+   struct rte_eth_txq_info *qinfo)
+{
+   struct ixgbe_tx_queue *txq;
+
+   txq = dev->data->tx_queues[queue_id];
+
+   qinfo->nb_desc = txq->nb_tx_desc;
+   qinfo->max_desc = IXGBE_MAX_RING_DESC;
+   qinfo->min_desc = IXGBE_MIN_RING_DESC;
+
+   qinfo->conf.tx_thresh.pthresh = txq->pthresh;
+   qinfo->conf.tx_thresh.hthresh = txq->hthresh;
+   qinfo->conf.tx_thresh.wthresh = txq->wthresh;
+
+   qinfo->conf.tx_free_thresh = txq->tx_free_thresh;
+   qinfo->conf.tx_rs_thresh = txq->tx_rs_thresh;
+   qinfo->conf.txq_flags = txq->txq_flags;
+   qinfo->conf.tx_deferred_start = txq->tx_deferred_start;
+}
+
 /*
  * [VF] Initializes Receive Unit.
  */
-- 
1.8.3.1



[dpdk-dev] [PATCHv4 2/5] i40e: add support for eth_(rxq|txq)_info_get

2015-07-22 Thread Konstantin Ananyev
Signed-off-by: Konstantin Ananyev 
---
 drivers/net/i40e/i40e_ethdev.c |  2 ++
 drivers/net/i40e/i40e_ethdev.h |  5 +
 drivers/net/i40e/i40e_rxtx.c   | 42 ++
 3 files changed, 49 insertions(+)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 40b0526..6815b6c 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -283,6 +283,8 @@ static const struct eth_dev_ops i40e_eth_dev_ops = {
.udp_tunnel_add   = i40e_dev_udp_tunnel_add,
.udp_tunnel_del   = i40e_dev_udp_tunnel_del,
.filter_ctrl  = i40e_dev_filter_ctrl,
+   .rxq_info_get = i40e_rxq_info_get,
+   .txq_info_get = i40e_txq_info_get,
.mirror_rule_set  = i40e_mirror_rule_set,
.mirror_rule_reset= i40e_mirror_rule_reset,
.timesync_enable  = i40e_timesync_enable,
diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
index 6185657..4748392 100644
--- a/drivers/net/i40e/i40e_ethdev.h
+++ b/drivers/net/i40e/i40e_ethdev.h
@@ -502,6 +502,11 @@ int i40e_fdir_ctrl_func(struct rte_eth_dev *dev,
  enum rte_filter_op filter_op,
  void *arg);

+void i40e_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+   struct rte_eth_rxq_info *qinfo);
+void i40e_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+   struct rte_eth_txq_info *qinfo);
+
 /* I40E_DEV_PRIVATE_TO */
 #define I40E_DEV_PRIVATE_TO_PF(adapter) \
(&((struct i40e_adapter *)adapter)->pf)
diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 891a221..fadf3e8 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -3352,3 +3352,45 @@ i40e_fdir_setup_rx_resources(struct i40e_pf *pf)

return I40E_SUCCESS;
 }
+
+void
+i40e_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+   struct rte_eth_rxq_info *qinfo)
+{
+   struct i40e_rx_queue *rxq;
+
+   rxq = dev->data->rx_queues[queue_id];
+
+   qinfo->mp = rxq->mp;
+   qinfo->scattered_rx = dev->data->scattered_rx;
+
+   qinfo->nb_desc = rxq->nb_rx_desc;
+   qinfo->max_desc = I40E_MAX_RING_DESC;
+   qinfo->min_desc = I40E_MIN_RING_DESC;
+
+   qinfo->conf.rx_free_thresh = rxq->rx_free_thresh;
+   qinfo->conf.rx_drop_en = rxq->drop_en;
+   qinfo->conf.rx_deferred_start = rxq->rx_deferred_start;
+}
+
+void
+i40e_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+   struct rte_eth_txq_info *qinfo)
+{
+   struct i40e_tx_queue *txq;
+
+   txq = dev->data->tx_queues[queue_id];
+
+   qinfo->nb_desc = txq->nb_tx_desc;
+   qinfo->max_desc = I40E_MAX_RING_DESC;
+   qinfo->min_desc = I40E_MIN_RING_DESC;
+
+   qinfo->conf.tx_thresh.pthresh = txq->pthresh;
+   qinfo->conf.tx_thresh.hthresh = txq->hthresh;
+   qinfo->conf.tx_thresh.wthresh = txq->wthresh;
+
+   qinfo->conf.tx_free_thresh = txq->tx_free_thresh;
+   qinfo->conf.tx_rs_thresh = txq->tx_rs_thresh;
+   qinfo->conf.txq_flags = txq->txq_flags;
+   qinfo->conf.tx_deferred_start = txq->tx_deferred_start;
+}
-- 
1.8.3.1



[dpdk-dev] [PATCHv4 1/5] ethdev: add new API to retrieve RX/TX queue information

2015-07-22 Thread Konstantin Ananyev
Add the ability for the upper layer to query RX/TX queue information.

Add new structures:
struct rte_eth_rxq_info
struct rte_eth_txq_info

new functions:
rte_eth_rx_queue_info_get
rte_eth_tx_queue_info_get

into rte_etdev API.

Left extra free space in the queue info structures,
so extra fields could be added later without ABI breakage.

v2 changes:
- Add formal check for the qinfo input parameter.
- As suggested rename 'rx_qinfo/tx_qinfo' to 'rxq_info/txq_info'

v3 changes:
- Updated rte_ether_version.map
- Merged with latest changes

v4 changes:
- rte_ether_version.map: move new functions into DPDK_2.1 sub-space.

Signed-off-by: Konstantin Ananyev 
---
 lib/librte_ether/rte_ethdev.c  | 54 +
 lib/librte_ether/rte_ethdev.h  | 87 +++---
 lib/librte_ether/rte_ether_version.map |  2 +
 3 files changed, 137 insertions(+), 6 deletions(-)

diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 94104ce..a94c119 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -3341,6 +3341,60 @@ rte_eth_remove_tx_callback(uint8_t port_id, uint16_t 
queue_id,
 }

 int
+rte_eth_rx_queue_info_get(uint8_t port_id, uint16_t queue_id,
+   struct rte_eth_rxq_info *qinfo)
+{
+   struct rte_eth_dev *dev;
+
+   if (qinfo == NULL)
+   return -EINVAL;
+
+   if (!rte_eth_dev_is_valid_port(port_id)) {
+   PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
+   return -EINVAL;
+   }
+
+   dev = &rte_eth_devices[port_id];
+   if (queue_id >= dev->data->nb_rx_queues) {
+   PMD_DEBUG_TRACE("Invalid RX queue_id=%d\n", queue_id);
+   return -EINVAL;
+   }
+
+   FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rxq_info_get, -ENOTSUP);
+
+   memset(qinfo, 0, sizeof(*qinfo));
+   dev->dev_ops->rxq_info_get(dev, queue_id, qinfo);
+   return 0;
+}
+
+int
+rte_eth_tx_queue_info_get(uint8_t port_id, uint16_t queue_id,
+   struct rte_eth_txq_info *qinfo)
+{
+   struct rte_eth_dev *dev;
+
+   if (qinfo == NULL)
+   return -EINVAL;
+
+   if (!rte_eth_dev_is_valid_port(port_id)) {
+   PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
+   return -EINVAL;
+   }
+
+   dev = &rte_eth_devices[port_id];
+   if (queue_id >= dev->data->nb_tx_queues) {
+   PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
+   return -EINVAL;
+   }
+
+   FUNC_PTR_OR_ERR_RET(*dev->dev_ops->txq_info_get, -ENOTSUP);
+
+   memset(qinfo, 0, sizeof(*qinfo));
+   dev->dev_ops->txq_info_get(dev, queue_id, qinfo);
+   return 0;
+}
+
+int
 rte_eth_dev_set_mc_addr_list(uint8_t port_id,
 struct ether_addr *mc_addr_set,
 uint32_t nb_mc_addr)
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index c901a2c..0c6705e 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -960,6 +960,30 @@ struct rte_eth_xstats {
uint64_t value;
 };

+/**
+ * Ethernet device RX queue information strcuture.
+ * Used to retieve information about configured queue.
+ */
+struct rte_eth_rxq_info {
+   struct rte_mempool *mp; /**< mempool used by that queue. */
+   struct rte_eth_rxconf conf; /**< queue config parameters. */
+   uint8_t scattered_rx;   /**< scattered packets RX supported. */
+   uint16_t nb_desc;   /**< configured number of RXDs. */
+   uint16_t max_desc;  /**< max allowed number of RXDs. */
+   uint16_t min_desc;  /**< min allowed number of RXDs. */
+} __rte_cache_aligned;
+
+/**
+ * Ethernet device TX queue information strcuture.
+ * Used to retieve information about configured queue.
+ */
+struct rte_eth_txq_info {
+   struct rte_eth_txconf conf; /**< queue config parameters. */
+   uint16_t nb_desc;   /**< configured number of TXDs. */
+   uint16_t max_desc;  /**< max allowed number of TXDs. */
+   uint16_t min_desc;  /**< min allowed number of TXDs. */
+} __rte_cache_aligned;
+
 struct rte_eth_dev;

 struct rte_eth_dev_callback;
@@ -1063,6 +1087,12 @@ typedef uint32_t (*eth_rx_queue_count_t)(struct 
rte_eth_dev *dev,
 typedef int (*eth_rx_descriptor_done_t)(void *rxq, uint16_t offset);
 /**< @internal Check DD bit of specific RX descriptor */

+typedef void (*eth_rxq_info_get_t)(struct rte_eth_dev *dev,
+   uint16_t rx_queue_id, struct rte_eth_rxq_info *qinfo);
+
+typedef void (*eth_txq_info_get_t)(struct rte_eth_dev *dev,
+   uint16_t tx_queue_id, struct rte_eth_txq_info *qinfo);
+
 typedef int (*mtu_set_t)(struct rte_eth_dev *dev, uint16_t mtu);
 /**< @internal Set MTU. */

@@ -1451,9 +1481,13 @@ struct eth_dev_ops {
rss_hash_update_t rss_hash_update;
/** Get current RSS hash configuration. */
rss_hash_conf_get_t rss_hash_conf_get;
-   e

[dpdk-dev] [PATCHv4 0/5] ethdev: add new API to retrieve RX/TX queue information

2015-07-22 Thread Konstantin Ananyev
Add the ability for the upper layer to query RX/TX queue information.
Right now supported for:
ixgbe, i40e, e1000 PMDs.

Konstantin Ananyev (5):
  ethdev: add new API to retrieve RX/TX queue information
  i40e: add support for eth_(rxq|txq)_info_get
  ixgbe: add support for eth_(rxq|txq)_info_get
  e1000: add support for eth_(rxq|txq)_info_get
  testpmd: add new command to display RX/TX queue information

 app/test-pmd/cmdline.c | 48 +++
 app/test-pmd/config.c  | 67 ++
 app/test-pmd/testpmd.h |  2 +
 drivers/net/e1000/e1000_ethdev.h   | 12 +
 drivers/net/e1000/em_ethdev.c  |  2 +
 drivers/net/e1000/em_rxtx.c| 38 +++
 drivers/net/e1000/igb_ethdev.c |  4 ++
 drivers/net/e1000/igb_rxtx.c   | 36 ++
 drivers/net/i40e/i40e_ethdev.c |  2 +
 drivers/net/i40e/i40e_ethdev.h |  5 ++
 drivers/net/i40e/i40e_rxtx.c   | 42 
 drivers/net/ixgbe/ixgbe_ethdev.c   |  4 ++
 drivers/net/ixgbe/ixgbe_ethdev.h   |  6 +++
 drivers/net/ixgbe/ixgbe_rxtx.c | 42 
 lib/librte_ether/rte_ethdev.c  | 54 +
 lib/librte_ether/rte_ethdev.h  | 87 +++---
 lib/librte_ether/rte_ether_version.map |  2 +
 17 files changed, 447 insertions(+), 6 deletions(-)

-- 
1.8.3.1



[dpdk-dev] [PATCHv3 5/5] testpmd: add new command to display RX/TX queue information

2015-07-22 Thread Zhang, Helin


> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Konstantin Ananyev
> Sent: Monday, July 20, 2015 5:19 AM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCHv3 5/5] testpmd: add new command to display RX/TX
> queue information
> 
> Signed-off-by: Konstantin Ananyev 
Acked-by: Helin Zhang 

Was the commit log missed?


[dpdk-dev] [PATCHv3 4/5] e1000: add support for eth_(rxq|txq)_info_get

2015-07-22 Thread Zhang, Helin


> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Konstantin Ananyev
> Sent: Monday, July 20, 2015 5:19 AM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCHv3 4/5] e1000: add support for
> eth_(rxq|txq)_info_get
> 
> Signed-off-by: Konstantin Ananyev 
Acked-by: Helin Zhang 


[dpdk-dev] [PATCHv3 3/5] ixgbe: add support for eth_(rxq|txq)_info_get

2015-07-22 Thread Zhang, Helin


> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Konstantin Ananyev
> Sent: Monday, July 20, 2015 5:19 AM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCHv3 3/5] ixgbe: add support for
> eth_(rxq|txq)_info_get
> 
> Signed-off-by: Konstantin Ananyev 
Acked-by: Helin Zhang 


[dpdk-dev] [PATCHv3 2/5] i40e: add support for eth_(rxq|txq)_info_get

2015-07-22 Thread Zhang, Helin


> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Konstantin Ananyev
> Sent: Monday, July 20, 2015 5:19 AM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCHv3 2/5] i40e: add support for eth_(rxq|txq)_info_get
> 
> Signed-off-by: Konstantin Ananyev 
Acked-by: Helin Zhang 


[dpdk-dev] [PATCHv3 1/5] ethdev: add new API to retrieve RX/TX queue information

2015-07-22 Thread Ananyev, Konstantin


> -Original Message-
> From: Zhang, Helin
> Sent: Wednesday, July 22, 2015 5:51 PM
> To: Ananyev, Konstantin
> Cc: dev at dpdk.org
> Subject: RE: [dpdk-dev] [PATCHv3 1/5] ethdev: add new API to retrieve RX/TX 
> queue information
> 
> 
> 
> > -Original Message-
> > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Konstantin Ananyev
> > Sent: Monday, July 20, 2015 5:19 AM
> > To: dev at dpdk.org
> > Subject: [dpdk-dev] [PATCHv3 1/5] ethdev: add new API to retrieve RX/TX 
> > queue
> > information
> >
> > Add the ability for the upper layer to query RX/TX queue information.
> >
> > Add new structures:
> > struct rte_eth_rxq_info
> > struct rte_eth_txq_info
> >
> > new functions:
> > rte_eth_rx_queue_info_get
> > rte_eth_tx_queue_info_get
> >
> > into rte_etdev API.
> >
> > Left extra free space in the queue info structures, so extra fields could 
> > be added
> > later without ABI breakage.
> >
> > v2 changes:
> > - Add formal check for the qinfo input parameter.
> > - As suggested rename 'rx_qinfo/tx_qinfo' to 'rxq_info/txq_info'
> >
> > v3 changes:
> > - Updated rte_ether_version.map
> > - Merged with latest changes
> >
> > Signed-off-by: Konstantin Ananyev 
> > ---
> >  lib/librte_ether/rte_ethdev.c  | 54 +
> >  lib/librte_ether/rte_ethdev.h  | 87
> > +++---
> >  lib/librte_ether/rte_ether_version.map |  2 +
> >  3 files changed, 137 insertions(+), 6 deletions(-)
> >
> > diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c 
> > index
> > 94104ce..a94c119 100644
> > --- a/lib/librte_ether/rte_ethdev.c
> > +++ b/lib/librte_ether/rte_ethdev.c
> > @@ -3341,6 +3341,60 @@ rte_eth_remove_tx_callback(uint8_t port_id, uint16_t
> > queue_id,  }
> >
> >  int
> > +rte_eth_rx_queue_info_get(uint8_t port_id, uint16_t queue_id,
> > +   struct rte_eth_rxq_info *qinfo)
> > +{
> > +   struct rte_eth_dev *dev;
> > +
> > +   if (qinfo == NULL)
> > +   return -EINVAL;
> > +
> > +   if (!rte_eth_dev_is_valid_port(port_id)) {
> > +   PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
> > +   return -EINVAL;
> > +   }
> > +
> > +   dev = &rte_eth_devices[port_id];
> > +   if (queue_id >= dev->data->nb_rx_queues) {
> > +   PMD_DEBUG_TRACE("Invalid RX queue_id=%d\n", queue_id);
> > +   return -EINVAL;
> > +   }
> > +
> > +   FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rxq_info_get, -ENOTSUP);
> > +
> > +   memset(qinfo, 0, sizeof(*qinfo));
> > +   dev->dev_ops->rxq_info_get(dev, queue_id, qinfo);
> > +   return 0;
> > +}
> > +
> > +int
> > +rte_eth_tx_queue_info_get(uint8_t port_id, uint16_t queue_id,
> > +   struct rte_eth_txq_info *qinfo)
> > +{
> > +   struct rte_eth_dev *dev;
> > +
> > +   if (qinfo == NULL)
> > +   return -EINVAL;
> > +
> > +   if (!rte_eth_dev_is_valid_port(port_id)) {
> > +   PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
> > +   return -EINVAL;
> > +   }
> > +
> > +   dev = &rte_eth_devices[port_id];
> > +   if (queue_id >= dev->data->nb_tx_queues) {
> > +   PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
> > +   return -EINVAL;
> > +   }
> > +
> > +   FUNC_PTR_OR_ERR_RET(*dev->dev_ops->txq_info_get, -ENOTSUP);
> > +
> > +   memset(qinfo, 0, sizeof(*qinfo));
> > +   dev->dev_ops->txq_info_get(dev, queue_id, qinfo);
> > +   return 0;
> > +}
> > +
> > +int
> >  rte_eth_dev_set_mc_addr_list(uint8_t port_id,
> >  struct ether_addr *mc_addr_set,
> >  uint32_t nb_mc_addr)
> > diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h 
> > index
> > c901a2c..0c6705e 100644
> > --- a/lib/librte_ether/rte_ethdev.h
> > +++ b/lib/librte_ether/rte_ethdev.h
> > @@ -960,6 +960,30 @@ struct rte_eth_xstats {
> > uint64_t value;
> >  };
> >
> > +/**
> > + * Ethernet device RX queue information strcuture.
> > + * Used to retieve information about configured queue.
> > + */
> > +struct rte_eth_rxq_info {
> > +   struct rte_mempool *mp; /**< mempool used by that queue. */
> > +   struct rte_eth_rxconf conf; /**< queue config parameters. */
> > +   uint8_t scattered_rx;   /**< scattered packets RX supported. */
> > +   uint16_t nb_desc;   /**< configured number of RXDs. */
> > +   uint16_t max_desc;  /**< max allowed number of RXDs. */
> > +   uint16_t min_desc;  /**< min allowed number of RXDs. */
> > +} __rte_cache_aligned;
> > +
> > +/**
> > + * Ethernet device TX queue information strcuture.
> > + * Used to retieve information about configured queue.
> > + */
> > +struct rte_eth_txq_info {
> > +   struct rte_eth_txconf conf; /**< queue config parameters. */
> > +   uint16_t nb_desc;   /**< configured number of TXDs. */
> > +   uint16_t max_desc;  /**< max allowed number of TXDs. */
> > +   uint16_t min_desc;  /**< min allowed number of TXDs. */
> > +} __rte_cache_aligned;
> > +
> >  struct rte_eth_dev;
> >
> >  st

[dpdk-dev] [PATCHv3 1/5] ethdev: add new API to retrieve RX/TX queue information

2015-07-22 Thread Zhang, Helin


> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Konstantin Ananyev
> Sent: Monday, July 20, 2015 5:19 AM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCHv3 1/5] ethdev: add new API to retrieve RX/TX queue
> information
> 
> Add the ability for the upper layer to query RX/TX queue information.
> 
> Add new structures:
> struct rte_eth_rxq_info
> struct rte_eth_txq_info
> 
> new functions:
> rte_eth_rx_queue_info_get
> rte_eth_tx_queue_info_get
> 
> into rte_etdev API.
> 
> Left extra free space in the queue info structures, so extra fields could be 
> added
> later without ABI breakage.
> 
> v2 changes:
> - Add formal check for the qinfo input parameter.
> - As suggested rename 'rx_qinfo/tx_qinfo' to 'rxq_info/txq_info'
> 
> v3 changes:
> - Updated rte_ether_version.map
> - Merged with latest changes
> 
> Signed-off-by: Konstantin Ananyev 
> ---
>  lib/librte_ether/rte_ethdev.c  | 54 +
>  lib/librte_ether/rte_ethdev.h  | 87
> +++---
>  lib/librte_ether/rte_ether_version.map |  2 +
>  3 files changed, 137 insertions(+), 6 deletions(-)
> 
> diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c 
> index
> 94104ce..a94c119 100644
> --- a/lib/librte_ether/rte_ethdev.c
> +++ b/lib/librte_ether/rte_ethdev.c
> @@ -3341,6 +3341,60 @@ rte_eth_remove_tx_callback(uint8_t port_id, uint16_t
> queue_id,  }
> 
>  int
> +rte_eth_rx_queue_info_get(uint8_t port_id, uint16_t queue_id,
> + struct rte_eth_rxq_info *qinfo)
> +{
> + struct rte_eth_dev *dev;
> +
> + if (qinfo == NULL)
> + return -EINVAL;
> +
> + if (!rte_eth_dev_is_valid_port(port_id)) {
> + PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
> + return -EINVAL;
> + }
> +
> + dev = &rte_eth_devices[port_id];
> + if (queue_id >= dev->data->nb_rx_queues) {
> + PMD_DEBUG_TRACE("Invalid RX queue_id=%d\n", queue_id);
> + return -EINVAL;
> + }
> +
> + FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rxq_info_get, -ENOTSUP);
> +
> + memset(qinfo, 0, sizeof(*qinfo));
> + dev->dev_ops->rxq_info_get(dev, queue_id, qinfo);
> + return 0;
> +}
> +
> +int
> +rte_eth_tx_queue_info_get(uint8_t port_id, uint16_t queue_id,
> + struct rte_eth_txq_info *qinfo)
> +{
> + struct rte_eth_dev *dev;
> +
> + if (qinfo == NULL)
> + return -EINVAL;
> +
> + if (!rte_eth_dev_is_valid_port(port_id)) {
> + PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
> + return -EINVAL;
> + }
> +
> + dev = &rte_eth_devices[port_id];
> + if (queue_id >= dev->data->nb_tx_queues) {
> + PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
> + return -EINVAL;
> + }
> +
> + FUNC_PTR_OR_ERR_RET(*dev->dev_ops->txq_info_get, -ENOTSUP);
> +
> + memset(qinfo, 0, sizeof(*qinfo));
> + dev->dev_ops->txq_info_get(dev, queue_id, qinfo);
> + return 0;
> +}
> +
> +int
>  rte_eth_dev_set_mc_addr_list(uint8_t port_id,
>struct ether_addr *mc_addr_set,
>uint32_t nb_mc_addr)
> diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h 
> index
> c901a2c..0c6705e 100644
> --- a/lib/librte_ether/rte_ethdev.h
> +++ b/lib/librte_ether/rte_ethdev.h
> @@ -960,6 +960,30 @@ struct rte_eth_xstats {
>   uint64_t value;
>  };
> 
> +/**
> + * Ethernet device RX queue information strcuture.
> + * Used to retieve information about configured queue.
> + */
> +struct rte_eth_rxq_info {
> + struct rte_mempool *mp; /**< mempool used by that queue. */
> + struct rte_eth_rxconf conf; /**< queue config parameters. */
> + uint8_t scattered_rx;   /**< scattered packets RX supported. */
> + uint16_t nb_desc;   /**< configured number of RXDs. */
> + uint16_t max_desc;  /**< max allowed number of RXDs. */
> + uint16_t min_desc;  /**< min allowed number of RXDs. */
> +} __rte_cache_aligned;
> +
> +/**
> + * Ethernet device TX queue information strcuture.
> + * Used to retieve information about configured queue.
> + */
> +struct rte_eth_txq_info {
> + struct rte_eth_txconf conf; /**< queue config parameters. */
> + uint16_t nb_desc;   /**< configured number of TXDs. */
> + uint16_t max_desc;  /**< max allowed number of TXDs. */
> + uint16_t min_desc;  /**< min allowed number of TXDs. */
> +} __rte_cache_aligned;
> +
>  struct rte_eth_dev;
> 
>  struct rte_eth_dev_callback;
> @@ -1063,6 +1087,12 @@ typedef uint32_t (*eth_rx_queue_count_t)(struct
> rte_eth_dev *dev,  typedef int (*eth_rx_descriptor_done_t)(void *rxq,
> uint16_t offset);  /**< @internal Check DD bit of specific RX descriptor */
> 
> +typedef void (*eth_rxq_info_get_t)(struct rte_eth_dev *dev,
> + uint16_t rx_queue_id, struct rte_eth_rxq_info *qinfo);
> +
> +typedef void (*eth_txq_info_get_t)(struct 

[dpdk-dev] [PATCH 0/2] static matcher cleanups

2015-07-22 Thread Thomas Monjalon
2015-07-16 16:47, Stephen Hemminger:
> These were found by running the Linux kernel coccinelle scripts
> on the DPDK source.
> 
> Stephen Hemminger (2):
>   rte_ethdev: fix crash if malloc fails in rte_eth_dev_callback_register
>   kni: fix coccinelle warnings

Applied, thanks


[dpdk-dev] [PATCH v6] Add toeplitz hash algorithm used by RSS

2015-07-22 Thread Tony Lu
Hi, Vladimir

When compiling thash for no-X86 arches, it fails with the following errors.
I wonder if
it is possible to make the thash library arch-independent?

== Build app/test
  CC test_thash.o
In file included from /u/zlu.bjg/git/dpdk.org/app/test/test_thash.c:40:
/u/zlu.bjg/git/dpdk.org/tile-tilegx-linuxapp-gcc/include/rte_thash.h:56:22:
error: rte_vect.h: No such file or directory
In file included from /u/zlu.bjg/git/dpdk.org/app/test/test_thash.c:40:
/u/zlu.bjg/git/dpdk.org/tile-tilegx-linuxapp-gcc/include/rte_thash.h:62:
error: expected '=', ',', ';', 'asm' or '__attribute__' before
'rte_thash_ipv6_bswap_mask'
/u/zlu.bjg/git/dpdk.org/tile-tilegx-linuxapp-gcc/include/rte_thash.h:129:
error: requested alignment is not a constant
/u/zlu.bjg/git/dpdk.org/tile-tilegx-linuxapp-gcc/include/rte_thash.h: In
function 'rte_thash_load_v6_addrs':
/u/zlu.bjg/git/dpdk.org/tile-tilegx-linuxapp-gcc/include/rte_thash.h:160:
error: '__m128i' undeclared (first use in this function)
/u/zlu.bjg/git/dpdk.org/tile-tilegx-linuxapp-gcc/include/rte_thash.h:160:
error: (Each undeclared identifier is reported only once
/u/zlu.bjg/git/dpdk.org/tile-tilegx-linuxapp-gcc/include/rte_thash.h:160:
error: for each function it appears in.)
/u/zlu.bjg/git/dpdk.org/tile-tilegx-linuxapp-gcc/include/rte_thash.h:160:
error: expected ';' before 'ipv6'
/u/zlu.bjg/git/dpdk.org/tile-tilegx-linuxapp-gcc/include/rte_thash.h:161:
error: expected expression before ')' token
/u/zlu.bjg/git/dpdk.org/tile-tilegx-linuxapp-gcc/include/rte_thash.h:163:
error: 'ipv6' undeclared (first use in this function)
/u/zlu.bjg/git/dpdk.org/tile-tilegx-linuxapp-gcc/include/rte_thash.h:163:
warning: implicit declaration of function '_mm_loadu_si128'
/u/zlu.bjg/git/dpdk.org/tile-tilegx-linuxapp-gcc/include/rte_thash.h:163:
warning: nested extern declaration of '_mm_loadu_si128'
/u/zlu.bjg/git/dpdk.org/tile-tilegx-linuxapp-gcc/include/rte_thash.h:163:
error: expected ')' before '__m128i'
/u/zlu.bjg/git/dpdk.org/tile-tilegx-linuxapp-gcc/include/rte_thash.h:163:
warning: type defaults to 'int' in declaration of 'type name'
/u/zlu.bjg/git/dpdk.org/tile-tilegx-linuxapp-gcc/include/rte_thash.h:163:
warning: cast from pointer to integer of different size
/u/zlu.bjg/git/dpdk.org/tile-tilegx-linuxapp-gcc/include/rte_thash.h:164:
error: expected expression before ')' token
/u/zlu.bjg/git/dpdk.org/tile-tilegx-linuxapp-gcc/include/rte_thash.h:158:
warning: unused parameter 'targ'
make[3]: *** [test_thash.o] Error 1
make[2]: *** [test] Error 2
make[1]: *** [app] Error 2
make: *** [all] Error 2

Thanks
-Zhigang Lu

>-Original Message-
>From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Vladimir Medvedkin
>Sent: Wednesday, July 01, 2015 7:40 AM
>To: dev at dpdk.org
>Subject: [dpdk-dev] [PATCH v6] Add toeplitz hash algorithm used by RSS
>
>Software implementation of the Toeplitz hash function used by RSS.
>Can be used either for packet distribution on single queue NIC or for
simulating
>of RSS computation on specific NIC (for example after GRE header
>decapsulating).
>
>v6 changes
>- Fix compilation error
>- Rename some defines and function
>
>v5 changes
>- Fix errors reported by checkpatch.pl
>
>v4 changes
>- Fix copyright
>- rename bswap_mask constant, add rte_ prefix
>- change rte_ipv[46]_tuple struct
>- change rte_thash_load_v6_addr prototype
>
>v3 changes
>- Rework API to be more generic
>- Add sctp_tag into tuple
>
>v2 changes
>- Add ipv6 support
>- Various style fixes
>
>Signed-off-by: Vladimir Medvedkin 
>---
> lib/librte_hash/Makefile|   1 +
> lib/librte_hash/rte_thash.h | 231
>
> 2 files changed, 232 insertions(+)
> create mode 100644 lib/librte_hash/rte_thash.h
>
>diff --git a/lib/librte_hash/Makefile b/lib/librte_hash/Makefile index
>3696cb1..981230b 100644
>--- a/lib/librte_hash/Makefile
>+++ b/lib/librte_hash/Makefile
>@@ -49,6 +49,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_HASH) += rte_fbk_hash.c
>SYMLINK-$(CONFIG_RTE_LIBRTE_HASH)-include := rte_hash.h
>SYMLINK-$(CONFIG_RTE_LIBRTE_HASH)-include += rte_hash_crc.h
>SYMLINK-$(CONFIG_RTE_LIBRTE_HASH)-include += rte_jhash.h
>+SYMLINK-$(CONFIG_RTE_LIBRTE_HASH)-include += rte_thash.h
> SYMLINK-$(CONFIG_RTE_LIBRTE_HASH)-include += rte_fbk_hash.h
>
> # this lib needs eal
>diff --git a/lib/librte_hash/rte_thash.h b/lib/librte_hash/rte_thash.h new
file
>mode 100644 index 000..1808f47
>--- /dev/null
>+++ b/lib/librte_hash/rte_thash.h
>@@ -0,0 +1,231 @@
>+/*-
>+ *   BSD LICENSE
>+ *
>+ *   Copyright(c) 2015 Vladimir Medvedkin 
>+ *   All rights reserved.
>+ *
>+ *   Redistribution and use in source and binary forms, with or without
>+ *   modification, are permitted provided that the following conditions
>+ *   are met:
>+ *
>+ * * Redistributions of source code must retain the above copyright
>+ *   notice, this list of conditions and the following disclaimer.
>+ * * Redistributions in binary form must reproduce the above copyright
>+ *   notice, this list of co

[dpdk-dev] [PATCH 1/2] rte_ethdev: fix crash if malloc fails in rte_eth_dev_callback_register

2015-07-22 Thread Thomas Monjalon
2015-07-17 09:16, Bruce Richardson:
> On Thu, Jul 16, 2015 at 04:47:23PM -0700, Stephen Hemminger wrote:
> > -   if (user_cb == NULL &&
> > -   (user_cb = rte_zmalloc("INTR_USER_CALLBACK",
> > -  sizeof(struct rte_eth_dev_callback), 0))) {
> > +   if (!user_cb)
> 
> Minor style issue. Since user_cb is a pointer, not a boolean, the condition
> should use "== NULL" rather than "!".

Fixed before pushing.


[dpdk-dev] [PATCH v2] ixgbe: fix check for split packets

2015-07-22 Thread Thomas Monjalon
2015-07-22 13:35, Richardson, Bruce:
> From: Zoltan Kiss [mailto:zoltan.kiss at linaro.org]
> > On 22/07/15 10:59, Bruce Richardson wrote:
> > > The vector PMD always works off a fixed 32 burst size. Any change to
> > > that will lead to many changes in the code, so I don't believe a loop is
> > necessary.
> > 
> > Ok, then I suggest to make a comment around RTE_IXGBE_VPMD_RX_BURST that
> > changing it needs a lot of other changes in the code elsewhere, e.g in
> > this split_flags check.
> > Btw. vPMD was a bit misleading abbreviation for me, it took me a while
> > until I realized 'v' stands for 'vector', not 'virtualization' as in most
> > cases nowadays.
> 
> Good idea. I'll try to submit a patch to add a comment if I get the chance
> - otherwise feel free to do so yourself.

Why not do it in this patch?
Is it not enough related?

> As for the naming, yes, I suppose it can be confusing. :-) We possibly need
> to start calling these pieces of code SSE or AVX rather than just vector,
> since for some we may end up with multiple vector versions.

+1 for SSE/AVX naming



[dpdk-dev] [PATCH v3 0/3] cxgbe: Fix compilation and enable FreeBSD support for CXGBE PMD

2015-07-22 Thread Thomas Monjalon
2015-07-21 10:40, Bruce Richardson:
> On Mon, Jul 20, 2015 at 11:01:34PM +0530, Rahul Lakkireddy wrote:
> > This series of patches fix compilation and enable CXGBE poll mode driver for
> > FreeBSD.  The first patch fixes a limitation of nic_uio that only binds to
> > devices present in rte_pci_dev_ids.h.  The second patch does the actual
> > compilation fix and enabling of CXGBE PMD for FreeBSD.  The last patch 
> > updates
> > cxgbe documentation to reflect the FreeBSD support for CXGBE PMD.
> > 
> > v3:
> > - Use checks for bus, slot, and function info instead of vendor and device
> >   during nic_uio probe for better consistency.
> > 
> > v2:
> > - Replace "Intel(R) DPDK" with just "DPDK" in device description for 
> > nic_uio.
> > 
> > Rahul Lakkireddy (3):
> >   nic_uio: Fix to allow any device to be bound to nic_uio
> >   cxgbe: Enable and fix FreeBSD compilation for CXGBE PMD
> >   doc: Update documentation to reflect FreeBSD support for CXGBE PMD
> >
> 
> Compilation testing with the patches on my FreeBSD system is all ok, and 
> unbinding
> of Intel 10G NICs works ok as before for me.
> 
> Thanks for the patches and the new FreeBSD hardware support!
> 
> Series Acked-by: Bruce Richardson 

Applied, thanks


[dpdk-dev] [RFC] examples: remove l3fwd-vf example

2015-07-22 Thread Ananyev, Konstantin
As I remember, the problem is that inside l3fwd each I/O lcore tries to claim a 
TX queue on each port in use for itself
(to avoid any synchronisation overhead).
Obviously on some legacy (and virtual) devices this is not possible.
On l3fwd-vf, several lcores share the same TX queue.
(synchronisation is done on port basis right now, i.e. only one tx queue per 
port is always used). 
Konstantin

> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Zhang, Helin
> Sent: Wednesday, July 22, 2015 3:51 PM
> To: Thomas Monjalon; Liu, Yong; Cao, Waterman
> Cc: dev at dpdk.org
> Subject: Re: [dpdk-dev] [RFC] examples: remove l3fwd-vf example
> 
> Marvin/Waterman
> 
> Could you help to check if l3fwd is good enough for all cases (1g/10/40g, PF 
> and VF, single queue/multiple queue)?
> We aim to remove l3fwd-vf to reduce an example application which is not so 
> necessary.
> Thank you!
> 
> Regards,
> Helin
> 
> > -Original Message-
> > From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
> > Sent: Wednesday, July 22, 2015 3:30 AM
> > To: Zhang, Helin
> > Cc: dev at dpdk.org; Wu, Jingjing
> > Subject: Re: [dpdk-dev] [RFC] examples: remove l3fwd-vf example
> >
> > 2015-07-14 14:50, Zhang, Helin:
> > > From: Wu, Jingjing
> > > > Because VF multi-queues can be supported, l3fwd can run on vf.
> > > > Suggest to remove the l3fwd-vf example.
> > > Totally agree with this!
> > > But we need the confirmation from validation guys of that l3fwd works
> > > quite well on VF with all NICs (e.g. i350, 82599, x550, xl710, and fm10k).
> >
> > Helin, any new from validation?


[dpdk-dev] [RFC] examples: remove l3fwd-vf example

2015-07-22 Thread Zhang, Helin
Marvin/Waterman

Could you help to check if l3fwd is good enough for all cases (1g/10/40g, PF 
and VF, single queue/multiple queue)?
We aim to remove l3fwd-vf to reduce an example application which is not so 
necessary.
Thank you!

Regards,
Helin

> -Original Message-
> From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
> Sent: Wednesday, July 22, 2015 3:30 AM
> To: Zhang, Helin
> Cc: dev at dpdk.org; Wu, Jingjing
> Subject: Re: [dpdk-dev] [RFC] examples: remove l3fwd-vf example
> 
> 2015-07-14 14:50, Zhang, Helin:
> > From: Wu, Jingjing
> > > Because VF multi-queues can be supported, l3fwd can run on vf.
> > > Suggest to remove the l3fwd-vf example.
> > Totally agree with this!
> > But we need the confirmation from validation guys of that l3fwd works
> > quite well on VF with all NICs (e.g. i350, 82599, x550, xl710, and fm10k).
> 
> Helin, any new from validation?


[dpdk-dev] [PATCH v2] ixgbe: fix check for split packets

2015-07-22 Thread Zoltan Kiss


On 22/07/15 14:19, Zoltan Kiss wrote:
> Btw. vPMD was a bit misleading abbreviation for me, it took me a while
> until I realized 'v' stands for 'vector', not 'virtualization' as in
> most cases nowadays.
>

Though that's mostly my fault to not to check the documentation :)


[dpdk-dev] [PATCH v2] ixgbe: fix check for split packets

2015-07-22 Thread Zoltan Kiss


On 22/07/15 10:59, Bruce Richardson wrote:
> On Wed, Jul 22, 2015 at 10:47:34AM +0100, Zoltan Kiss wrote:
>> Hi,
>>
>> And what happens if someone changes RTE_IXGBE_VPMD_RX_BURST to something
>> else than 32? I guess this bug were introduced when someone raised it from
>> 16 to 32
>
> Actually, no, this bug is purely due to me getting my maths wrong when I
> wrote this function. The vector PMD has always worked in bursts of 32 at a
> time.
>
>> I think you are better off with a for loop which uses this value. Or at
>> least make a comment around RTE_IXGBE_VPMD_RX_BURST that if you change that
>> value this check should be modified as well.
>
> The vector PMD always works off a fixed 32 burst size. Any change to that will
> lead to many changes in the code, so I don't believe a loop is necessary.

Ok, then I suggest to make a comment around RTE_IXGBE_VPMD_RX_BURST that 
changing it needs a lot of other changes in the code elsewhere, e.g in 
this split_flags check.
Btw. vPMD was a bit misleading abbreviation for me, it took me a while 
until I realized 'v' stands for 'vector', not 'virtualization' as in 
most cases nowadays.

>
> Regards,
> /Bruce
>
>>
>> Regards,
>>
>> Zoltan
>>
>> On 22/07/15 10:13, Bruce Richardson wrote:
>>> The check for split packets to be reassembled in the vector ixgbe PMD
>>> was incorrectly only checking the first 16 elements of the array instead
>>> of all 32. This is fixed by changing the uint32_t values to be uint64_t
>>> instead.
>>>
>>> Fixes: cf4b4708a88a ("ixgbe: improve slow-path perf with vector scattered 
>>> Rx")
>>>
>>> Reported-by: Zoltan Kiss 
>>> Signed-off-by: Bruce Richardson 
>>>
>>> ---
>>> V2: Rename variable from split_fl32 to split_fl64 to match type change.
>>> ---
>>>   drivers/net/ixgbe/ixgbe_rxtx_vec.c | 6 +++---
>>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec.c 
>>> b/drivers/net/ixgbe/ixgbe_rxtx_vec.c
>>> index d3ac74a..f2052c6 100644
>>> --- a/drivers/net/ixgbe/ixgbe_rxtx_vec.c
>>> +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec.c
>>> @@ -549,10 +549,10 @@ ixgbe_recv_scattered_pkts_vec(void *rx_queue, struct 
>>> rte_mbuf **rx_pkts,
>>> return 0;
>>>
>>> /* happy day case, full burst + no packets to be joined */
>>> -   const uint32_t *split_fl32 = (uint32_t *)split_flags;
>>> +   const uint64_t *split_fl64 = (uint64_t *)split_flags;
>>> if (rxq->pkt_first_seg == NULL &&
>>> -   split_fl32[0] == 0 && split_fl32[1] == 0 &&
>>> -   split_fl32[2] == 0 && split_fl32[3] == 0)
>>> +   split_fl64[0] == 0 && split_fl64[1] == 0 &&
>>> +   split_fl64[2] == 0 && split_fl64[3] == 0)
>>> return nb_bufs;
>>>
>>> /* reassemble any packets that need reassembly*/
>>>


[dpdk-dev] [PATCH v2] ixgbe: fix check for split packets

2015-07-22 Thread Richardson, Bruce


> -Original Message-
> From: Zoltan Kiss [mailto:zoltan.kiss at linaro.org]
> Sent: Wednesday, July 22, 2015 2:20 PM
> To: Richardson, Bruce
> Cc: dev at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2] ixgbe: fix check for split packets
> 
> 
> 
> On 22/07/15 10:59, Bruce Richardson wrote:
> > On Wed, Jul 22, 2015 at 10:47:34AM +0100, Zoltan Kiss wrote:
> >> Hi,
> >>
> >> And what happens if someone changes RTE_IXGBE_VPMD_RX_BURST to
> >> something else than 32? I guess this bug were introduced when someone
> >> raised it from
> >> 16 to 32
> >
> > Actually, no, this bug is purely due to me getting my maths wrong when
> > I wrote this function. The vector PMD has always worked in bursts of
> > 32 at a time.
> >
> >> I think you are better off with a for loop which uses this value. Or
> >> at least make a comment around RTE_IXGBE_VPMD_RX_BURST that if you
> >> change that value this check should be modified as well.
> >
> > The vector PMD always works off a fixed 32 burst size. Any change to
> > that will lead to many changes in the code, so I don't believe a loop is
> necessary.
> 
> Ok, then I suggest to make a comment around RTE_IXGBE_VPMD_RX_BURST that
> changing it needs a lot of other changes in the code elsewhere, e.g in
> this split_flags check.
> Btw. vPMD was a bit misleading abbreviation for me, it took me a while
> until I realized 'v' stands for 'vector', not 'virtualization' as in most
> cases nowadays.

Good idea. I'll try to submit a patch to add a comment if I get the chance - 
otherwise feel free to do so yourself.

As for the naming, yes, I suppose it can be confusing. :-) We possibly need to 
start calling these pieces of code SSE or AVX rather than just vector, since 
for some we may end up with multiple vector versions.

/Bruce

> 
> >
> > Regards,
> > /Bruce
> >
> >>
> >> Regards,
> >>
> >> Zoltan
> >>
> >> On 22/07/15 10:13, Bruce Richardson wrote:
> >>> The check for split packets to be reassembled in the vector ixgbe
> >>> PMD was incorrectly only checking the first 16 elements of the array
> >>> instead of all 32. This is fixed by changing the uint32_t values to
> >>> be uint64_t instead.
> >>>
> >>> Fixes: cf4b4708a88a ("ixgbe: improve slow-path perf with vector
> >>> scattered Rx")
> >>>
> >>> Reported-by: Zoltan Kiss 
> >>> Signed-off-by: Bruce Richardson 
> >>>
> >>> ---
> >>> V2: Rename variable from split_fl32 to split_fl64 to match type
> change.
> >>> ---
> >>>   drivers/net/ixgbe/ixgbe_rxtx_vec.c | 6 +++---
> >>>   1 file changed, 3 insertions(+), 3 deletions(-)
> >>>
> >>> diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec.c
> >>> b/drivers/net/ixgbe/ixgbe_rxtx_vec.c
> >>> index d3ac74a..f2052c6 100644
> >>> --- a/drivers/net/ixgbe/ixgbe_rxtx_vec.c
> >>> +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec.c
> >>> @@ -549,10 +549,10 @@ ixgbe_recv_scattered_pkts_vec(void *rx_queue,
> struct rte_mbuf **rx_pkts,
> >>>   return 0;
> >>>
> >>>   /* happy day case, full burst + no packets to be joined */
> >>> - const uint32_t *split_fl32 = (uint32_t *)split_flags;
> >>> + const uint64_t *split_fl64 = (uint64_t *)split_flags;
> >>>   if (rxq->pkt_first_seg == NULL &&
> >>> - split_fl32[0] == 0 && split_fl32[1] == 0 &&
> >>> - split_fl32[2] == 0 && split_fl32[3] == 0)
> >>> + split_fl64[0] == 0 && split_fl64[1] == 0 &&
> >>> + split_fl64[2] == 0 && split_fl64[3] == 0)
> >>>   return nb_bufs;
> >>>
> >>>   /* reassemble any packets that need reassembly*/
> >>>


[dpdk-dev] [PATCHv4 1/5] ethdev: add new API to retrieve RX/TX queue information

2015-07-22 Thread Stephen Hemminger
On Wed, 22 Jul 2015 19:28:51 +0100
Konstantin Ananyev  wrote:

> Add the ability for the upper layer to query RX/TX queue information.
> 
> Add new structures:
> struct rte_eth_rxq_info
> struct rte_eth_txq_info
> 
> new functions:
> rte_eth_rx_queue_info_get
> rte_eth_tx_queue_info_get
> 
> into rte_etdev API.
> 
> Left extra free space in the queue info structures,
> so extra fields could be added later without ABI breakage.
> 
> v2 changes:
> - Add formal check for the qinfo input parameter.
> - As suggested rename 'rx_qinfo/tx_qinfo' to 'rxq_info/txq_info'
> 
> v3 changes:
> - Updated rte_ether_version.map
> - Merged with latest changes
> 
> v4 changes:
> - rte_ether_version.map: move new functions into DPDK_2.1 sub-space.
> 
> Signed-off-by: Konstantin Ananyev 

Since all this data should be rxconf already, Is it possible
to do a generic version of this and not have to change every driver.

You only handled the Intel hardware drivers. But there also
all the virtual drivers, other vendors etc.



[dpdk-dev] [PATCH] fm10K: fix interrupt fault handling

2015-07-22 Thread Thomas Monjalon
> > The fm10k driver was reading the interrupt cause register but then
> > using the interrupt mask register defines to look at the bits.
> > The result is that if a fault happens, the driver would never clear
> > the fault and would get into an infinite cycle of interrupts.
> > 
> > Note: I don't work for Intel or have the hardware manuals (probably
> > requires NDA anyway), but this looks logical and matches how the
> > known working Linux driver handles these bits.
> > 
> > Signed-off-by: Stephen Hemminger 
> 
> Good catch! Thanks!
> 
> Acked-by: Jing Chen 

Applied, thanks


[dpdk-dev] [PATCH] fm10k: remove useless code

2015-07-22 Thread Thomas Monjalon
> > The return in fm10k_dev_handle_fault has useless conditional
> > since it always returns 0 here.
> > 
> > Signed-off-by: Stephen Hemminger 
> 
> Acked-by: Jing Chen 

Applied, thanks


[dpdk-dev] [PATCH v2] fm10k: add missing newline to debug log

2015-07-22 Thread Thomas Monjalon
> > If FM10K_DEBUG_DRIVER is enabled, then the log messages about
> > function entry are missing newline causing extremely long lines.
> > 
> > Signed-off-by: Stephen Hemminger 
> 
> Acked-by : Jing Chen 

Applied, thanks


[dpdk-dev] libhugetlbfs

2015-07-22 Thread Thomas Monjalon
Sergio,

As the maintainer of memory allocation, would you consider using
libhugetlbfs in DPDK for Linux?
It may simplify a part of our memory allocator and avoid some potential
bugs which would be already fixed in the dedicated lib.


[dpdk-dev] [RFC] examples: remove l3fwd-vf example

2015-07-22 Thread Thomas Monjalon
2015-07-14 14:50, Zhang, Helin:
> From: Wu, Jingjing
> > Because VF multi-queues can be supported, l3fwd can run on vf.
> > Suggest to remove the l3fwd-vf example.
> Totally agree with this!
> But we need the confirmation from validation guys of that l3fwd works
> quite well on VF with all NICs (e.g. i350, 82599, x550, xl710, and fm10k).

Helin, any new from validation?


[dpdk-dev] [PATCH v2] testpmd: fix wrong variable type in ieee1588fwd for 32 bits

2015-07-22 Thread Thomas Monjalon
> > In ieee1588fwd.c, timestamp.tv_sec is a time_t variable, which is a long 
> > int, but
> > it was being printed with PRIu64, causing an issue on 32 bits.
> > 
> > Signed-off-by: Pablo de Lara 
> Acked-by: Wenzhuo Lu 

Applied, thanks


[dpdk-dev] [PATCH] ixgbe: fix compilation issue when IXGBE_RX_ALLOW_BULK_ALLOC is disabled

2015-07-22 Thread Thomas Monjalon
2015-07-22 10:50, Pablo de Lara:
> ixgbe_recv_pkts_lro uses field rx_free_trigger
> in structure ixgbe_rx_queue, but that field is only defined
> if IXGBE_RX_ALLOW_BULK_ALLOC is enabled, so even though
> that field is not used when it is disabled,
> compiler complains about it.
> Therefore, the lines of code that use that field
> have been ifdef.
> 
> Fixes: 8eecb329 ("ixgbe: add LRO support")
> 
> Signed-off-by: Pablo de Lara 

Applied, thanks


[dpdk-dev] [PATCH] ixgbe: fix compilation issue when IXGBE_RX_ALLOW_BULK_ALLOC is disabled

2015-07-22 Thread Thomas Monjalon
2015-07-22 10:50, Pablo de Lara:
> ixgbe_recv_pkts_lro uses field rx_free_trigger
> in structure ixgbe_rx_queue, but that field is only defined
> if IXGBE_RX_ALLOW_BULK_ALLOC is enabled, so even though
> that field is not used when it is disabled,
> compiler complains about it.

Why this option is still needed?


[dpdk-dev] [PATCH] hash: move field hash_func_init_val in rte_hash struct

2015-07-22 Thread Thomas Monjalon
> In order to keep the ABI consistent with the old hash library,
> hash_func_init_val field has been moved, so it remains
> at the same offset as previously, since hash_func and
> hash_func_init_val are fields accesed by the public function
> rte_hash_hash and must keep the same offset as older versions.
> 
> Signed-off-by: Pablo de Lara 

Applied, thanks


[dpdk-dev] [PATCH] e1000: enable jumbo frame support for Intel 82583V

2015-07-22 Thread Klaus Degner
This patch enables jumbo frame support for the 82583V.
It has been tested ( rx and tx ) with real HW.

Signed-off-by: Klaus Degner 
---
 drivers/net/e1000/em_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index d8c04e7..07c75bb 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -893,11 +893,11 @@ em_get_max_pktlen(const struct e1000_hw *hw)
case e1000_pch2lan:
case e1000_82574:
case e1000_80003es2lan: /* 9K Jumbo Frame size */
+   case e1000_82583:
return (0x2412);
case e1000_pchlan:
return (0x1000);
/* Adapters that do not support jumbo frames */
-   case e1000_82583:
case e1000_ich8lan:
return (ETHER_MAX_LEN);
default:
-- 
2.4.5



[dpdk-dev] [PATCH v2] ixgbe: fix check for split packets

2015-07-22 Thread Bruce Richardson
On Wed, Jul 22, 2015 at 10:47:34AM +0100, Zoltan Kiss wrote:
> Hi,
> 
> And what happens if someone changes RTE_IXGBE_VPMD_RX_BURST to something
> else than 32? I guess this bug were introduced when someone raised it from
> 16 to 32

Actually, no, this bug is purely due to me getting my maths wrong when I 
wrote this function. The vector PMD has always worked in bursts of 32 at a
time.

> I think you are better off with a for loop which uses this value. Or at
> least make a comment around RTE_IXGBE_VPMD_RX_BURST that if you change that
> value this check should be modified as well.

The vector PMD always works off a fixed 32 burst size. Any change to that will
lead to many changes in the code, so I don't believe a loop is necessary.

Regards,
/Bruce

> 
> Regards,
> 
> Zoltan
> 
> On 22/07/15 10:13, Bruce Richardson wrote:
> >The check for split packets to be reassembled in the vector ixgbe PMD
> >was incorrectly only checking the first 16 elements of the array instead
> >of all 32. This is fixed by changing the uint32_t values to be uint64_t
> >instead.
> >
> >Fixes: cf4b4708a88a ("ixgbe: improve slow-path perf with vector scattered 
> >Rx")
> >
> >Reported-by: Zoltan Kiss 
> >Signed-off-by: Bruce Richardson 
> >
> >---
> >V2: Rename variable from split_fl32 to split_fl64 to match type change.
> >---
> >  drivers/net/ixgbe/ixgbe_rxtx_vec.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> >diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec.c 
> >b/drivers/net/ixgbe/ixgbe_rxtx_vec.c
> >index d3ac74a..f2052c6 100644
> >--- a/drivers/net/ixgbe/ixgbe_rxtx_vec.c
> >+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec.c
> >@@ -549,10 +549,10 @@ ixgbe_recv_scattered_pkts_vec(void *rx_queue, struct 
> >rte_mbuf **rx_pkts,
> > return 0;
> >
> > /* happy day case, full burst + no packets to be joined */
> >-const uint32_t *split_fl32 = (uint32_t *)split_flags;
> >+const uint64_t *split_fl64 = (uint64_t *)split_flags;
> > if (rxq->pkt_first_seg == NULL &&
> >-split_fl32[0] == 0 && split_fl32[1] == 0 &&
> >-split_fl32[2] == 0 && split_fl32[3] == 0)
> >+split_fl64[0] == 0 && split_fl64[1] == 0 &&
> >+split_fl64[2] == 0 && split_fl64[3] == 0)
> > return nb_bufs;
> >
> > /* reassemble any packets that need reassembly*/
> >


[dpdk-dev] [PATCH v2 0/2] virtio: fixes for 2.1-rc1

2015-07-22 Thread Thomas Monjalon
> This integrates my change and earlier change by Ouyang Changchun
> into one fix. And second patch is minor stuff found while reviewing.
> 
> Stephen Hemminger (2):
>   virtio: fix queue size and number of descriptors
>   virtio: small cleanups

Applied, thanks

Please take care of patch numbering to ease patch management.


[dpdk-dev] [PATCH v2 1/2] virtio: fix queue size and number of descriptors

2015-07-22 Thread Thomas Monjalon
2015-07-20 11:40, Stephen Hemminger:
> The number of descriptors can be either zero to use the whole
> available ring, or some value smaller. This is used to limit
> the number of mbufs allocated for the receive ring. If more
> descriptors are requested than available the size is silently
> truncated.
[...]
> + if (nb_desc == 0 || nb_desc > vq_size)
> + nb_desc = vq_size;

This behaviour should be common to every drivers and explained in the API 
doxygen:
http://dpdk.org/browse/dpdk/tree/lib/librte_ether/rte_ethdev.h?id=v2.1.0-rc1#n1843


[dpdk-dev] [PATCH] ixgbe: fix compilation issue when IXGBE_RX_ALLOW_BULK_ALLOC is disabled

2015-07-22 Thread Pablo de Lara
ixgbe_recv_pkts_lro uses field rx_free_trigger
in structure ixgbe_rx_queue, but that field is only defined
if IXGBE_RX_ALLOW_BULK_ALLOC is enabled, so even though
that field is not used when it is disabled,
compiler complains about it.
Therefore, the lines of code that use that field
have been ifdef.

Fixes: 8eecb329 ("ixgbe: add LRO support")

Signed-off-by: Pablo de Lara 
---
 drivers/net/ixgbe/ixgbe_rxtx.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 9b2d637..af7e222 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -1707,7 +1707,9 @@ next_desc:
rx_mbuf_alloc_failed++;
break;
}
-   } else if (nb_hold > rxq->rx_free_thresh) {
+   }
+#ifdef RTE_LIBRTE_IXGBE_RX_ALLOW_BULK_ALLOC
+   else if (nb_hold > rxq->rx_free_thresh) {
uint16_t next_rdt = rxq->rx_free_trigger;

if (!ixgbe_rx_alloc_bufs(rxq, false)) {
@@ -1725,6 +1727,7 @@ next_desc:
break;
}
}
+#endif

nb_hold++;
rxe = &sw_ring[rx_id];
-- 
2.4.2



[dpdk-dev] [PATCH v2] ixgbe: fix check for split packets

2015-07-22 Thread Zoltan Kiss
Hi,

And what happens if someone changes RTE_IXGBE_VPMD_RX_BURST to something 
else than 32? I guess this bug were introduced when someone raised it 
from 16 to 32
I think you are better off with a for loop which uses this value. Or at 
least make a comment around RTE_IXGBE_VPMD_RX_BURST that if you change 
that value this check should be modified as well.

Regards,

Zoltan

On 22/07/15 10:13, Bruce Richardson wrote:
> The check for split packets to be reassembled in the vector ixgbe PMD
> was incorrectly only checking the first 16 elements of the array instead
> of all 32. This is fixed by changing the uint32_t values to be uint64_t
> instead.
>
> Fixes: cf4b4708a88a ("ixgbe: improve slow-path perf with vector scattered Rx")
>
> Reported-by: Zoltan Kiss 
> Signed-off-by: Bruce Richardson 
>
> ---
> V2: Rename variable from split_fl32 to split_fl64 to match type change.
> ---
>   drivers/net/ixgbe/ixgbe_rxtx_vec.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec.c 
> b/drivers/net/ixgbe/ixgbe_rxtx_vec.c
> index d3ac74a..f2052c6 100644
> --- a/drivers/net/ixgbe/ixgbe_rxtx_vec.c
> +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec.c
> @@ -549,10 +549,10 @@ ixgbe_recv_scattered_pkts_vec(void *rx_queue, struct 
> rte_mbuf **rx_pkts,
>   return 0;
>
>   /* happy day case, full burst + no packets to be joined */
> - const uint32_t *split_fl32 = (uint32_t *)split_flags;
> + const uint64_t *split_fl64 = (uint64_t *)split_flags;
>   if (rxq->pkt_first_seg == NULL &&
> - split_fl32[0] == 0 && split_fl32[1] == 0 &&
> - split_fl32[2] == 0 && split_fl32[3] == 0)
> + split_fl64[0] == 0 && split_fl64[1] == 0 &&
> + split_fl64[2] == 0 && split_fl64[3] == 0)
>   return nb_bufs;
>
>   /* reassemble any packets that need reassembly*/
>


[dpdk-dev] [PATCH v2] malloc: fix combined lib build

2015-07-22 Thread Thomas Monjalon
> Malloc was moved to the EAL and dummy malloc library was left
> to not break apps that had a librte_malloc.so dependency.
> Note that the dummy library will be removed in the next release.
> 
> When building a combined library, all objects are copied to the same
> directory before creating the library itself.
> 
> There are a few issues:
>  - CONFIG_RTE_LIBRTE_MALLOC is not a valid option anymore resulting
>  in wrong syntax and a compilation failure. Fix it by replacing it
>  with CONFIG_RTE_LIBRTE_EAL.
>  - As we kept a dummy library, there are now two objects with the
>  same name. This means that the proper rte_malloc.o object in eal gets
>  overwritten by an empty rte_malloc.o object from the dummy malloc lib.
>  Fix it by changing the name of rte_malloc.o object in the dummy
>  library.
>  - Update the copyright year.
> 
> Fixes: 2f9d47013e4dbb738 ("mem: move librte_malloc to eal/common")
> 
> Reported-by: Alin Rauta 
> Signed-off-by: Sergio Gonzalez Monroy 

Applied, thanks



[dpdk-dev] [PATCH v2] ixgbe: fix check for split packets

2015-07-22 Thread Bruce Richardson
The check for split packets to be reassembled in the vector ixgbe PMD
was incorrectly only checking the first 16 elements of the array instead
of all 32. This is fixed by changing the uint32_t values to be uint64_t
instead.

Fixes: cf4b4708a88a ("ixgbe: improve slow-path perf with vector scattered Rx")

Reported-by: Zoltan Kiss 
Signed-off-by: Bruce Richardson 

---
V2: Rename variable from split_fl32 to split_fl64 to match type change.
---
 drivers/net/ixgbe/ixgbe_rxtx_vec.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec.c 
b/drivers/net/ixgbe/ixgbe_rxtx_vec.c
index d3ac74a..f2052c6 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec.c
@@ -549,10 +549,10 @@ ixgbe_recv_scattered_pkts_vec(void *rx_queue, struct 
rte_mbuf **rx_pkts,
return 0;

/* happy day case, full burst + no packets to be joined */
-   const uint32_t *split_fl32 = (uint32_t *)split_flags;
+   const uint64_t *split_fl64 = (uint64_t *)split_flags;
if (rxq->pkt_first_seg == NULL &&
-   split_fl32[0] == 0 && split_fl32[1] == 0 &&
-   split_fl32[2] == 0 && split_fl32[3] == 0)
+   split_fl64[0] == 0 && split_fl64[1] == 0 &&
+   split_fl64[2] == 0 && split_fl64[3] == 0)
return nb_bufs;

/* reassemble any packets that need reassembly*/
-- 
2.4.3



[dpdk-dev] [PATCH] ixgbe: fix check for split packets

2015-07-22 Thread Bruce Richardson
On Wed, Jul 22, 2015 at 01:44:14AM +0100, Lu, Wenzhuo wrote:
> Hi Bruce,
> 
> > -Original Message-
> > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Bruce Richardson
> > Sent: Tuesday, July 21, 2015 11:25 PM
> > To: dev at dpdk.org
> > Subject: [dpdk-dev] [PATCH] ixgbe: fix check for split packets
> > 
> > The check for split packets to be reassembled in the vector ixgbe PMD was
> > incorrectly only checking the first 16 elements of the array instead of all 
> > 32. This
> > is fixed by changing the uint32_t values to be uint64_t instead.
> > 
> > Fixes: cf4b4708a88a ("ixgbe: improve slow-path perf with vector scattered 
> > Rx")
> > 
> > Reported-by: Zoltan Kiss 
> > Signed-off-by: Bruce Richardson 
> > ---
> >  drivers/net/ixgbe/ixgbe_rxtx_vec.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec.c
> > b/drivers/net/ixgbe/ixgbe_rxtx_vec.c
> > index 9f24849..cdad3e0 100644
> > --- a/drivers/net/ixgbe/ixgbe_rxtx_vec.c
> > +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec.c
> > @@ -549,7 +549,7 @@ ixgbe_recv_scattered_pkts_vec(void *rx_queue, struct
> > rte_mbuf **rx_pkts,
> > return 0;
> > 
> > /* happy day case, full burst + no packets to be joined */
> > -   const uint32_t *split_fl32 = (uint32_t *)split_flags;
> > +   const uint64_t *split_fl32 = (uint64_t *)split_flags;
> Why not change the name to split_fl64? I don't think it's appropriate to keep 
> it be split_fl32.
> Thanks.
> 
Quite right, that's the obvious change! I'll do a V2.

/Bruce


[dpdk-dev] [PATCH v2] testpmd: fix wrong variable type in ieee1588fwd for 32 bits

2015-07-22 Thread Pablo de Lara
In ieee1588fwd.c, timestamp.tv_sec is a time_t variable,
which is a long int, but it was being printed with PRIu64,
causing an issue on 32 bits.

Signed-off-by: Pablo de Lara 
---
Changes in v2:

- Corrected wrong commit message

 app/test-pmd/ieee1588fwd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/ieee1588fwd.c b/app/test-pmd/ieee1588fwd.c
index 069ee2e..b1a301b 100644
--- a/app/test-pmd/ieee1588fwd.c
+++ b/app/test-pmd/ieee1588fwd.c
@@ -89,7 +89,7 @@ port_ieee1588_rx_timestamp_check(portid_t pi, uint32_t index)
   (unsigned) pi);
return;
}
-   printf("Port %u RX timestamp value %"PRIu64"\n",
+   printf("Port %u RX timestamp value %lu\n",
   (unsigned) pi, timestamp.tv_sec);
 }

@@ -112,7 +112,7 @@ port_ieee1588_tx_timestamp_check(portid_t pi)
   (unsigned) pi, (unsigned) MAX_TX_TMST_WAIT_MICROSECS);
return;
}
-   printf("Port %u TX timestamp value %"PRIu64" validated after "
+   printf("Port %u TX timestamp value %lu validated after "
   "%u micro-second%s\n",
   (unsigned) pi, timestamp.tv_sec, wait_us,
   (wait_us == 1) ? "" : "s");
-- 
2.4.2



[dpdk-dev] [PATCH v2] testpmd: fix wrong variable type in ieee1588fwd for 32 bits

2015-07-22 Thread Lu, Wenzhuo
Hi,

> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Pablo de Lara
> Sent: Wednesday, July 22, 2015 4:07 PM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH v2] testpmd: fix wrong variable type in ieee1588fwd
> for 32 bits
> 
> In ieee1588fwd.c, timestamp.tv_sec is a time_t variable, which is a long int, 
> but
> it was being printed with PRIu64, causing an issue on 32 bits.
> 
> Signed-off-by: Pablo de Lara 
Acked-by: Wenzhuo Lu 



[dpdk-dev] vswitches performance comparison

2015-07-22 Thread Gray, Mark D
> "Jun Xiao"  wrote:
> 
> > After CloudNetEngine vswitch technical preview is launched, we
> > received quite a few queries on vswitches performance comparison, but
> > we cannot simply give a  test result on our platform because
> > performance varies on different H/Ws and different workloads, and
> > that's why we encourage you to try the evaluation package to get real data
> on your setup.
> >
> > Anyway, we share a little more performance data on our H/W which is a
> > comparison  among native kernel OVS/OVS-DPDK/CNE vswitch under the
> most common workload:
> > concurrent bi-directional TCP traffics cross hosts, and hope you can have a
> rough idea.
> > http://www.cloudnetengine.com/weblog/2015/07/22/vswitches-
> performance-
> > comparison/
> >
> > Thanks,
> > Jun
> 
> Since the real bottleneck in most vswitches is per-packet overhead.
> I would recommend running RFC-2544 tests for better data.
> 
> You probably need to use something like pktgen to get enough packets-per-
> second.

Yeah this is the methodology that we use aswell.


[dpdk-dev] [ovs-discuss] vswitches performance comparison

2015-07-22 Thread Gray, Mark D
> >>
> >> I'd like to hope that's my methodology problem, but I just follow the
> >> installation guide without any customization.
> >>
> >> Hi Mark, do you have any performance data share with us? Maybe we are
> >> using different type of workloads, like I mentioned I am using
> >> typical data center workload, I guess you are talking about NFV type of
> workload?
> >
> > The number getting floated around on the mailing list recently is
> > 16.5Mpps for phy-phy. However, I don't think we have any iperf data
> > off-hand for your usecase. When we test throughput into the vm we
> > usually generate the traffic externally and send NIC->OVS->VM->OVS-
> >NIC. This is a little different to your setup.
> >
> 
> I guess pmd driver is used inside VM in that case, right?

Yes, but even when we use virtio-net we see the same if not *slightly* better
performance.

> > I do know, however, that ovs-dpdk typically has a much larger
> > throughput than the kernel space datapath.
> >
> 
> I'd like to say it depends on workloads, for small/medium packet size
> workload, that's definitely true, while for TSO size workload, it's not that
> obvious (or worse) as data path overheads are amortized and H/W can be
> leveraged.

For large packets the switch will eventually saturate the NIC at line rate but 
the
total aggregate throughput of the switch should be faster (you could
add more interfaces for example to take advantage of that). 

TSO is missing from the DPDK ports at the moment but it is something
we plan to look at. We are currently enabling Jumbo frames (which don't
work at the moment).

> > Have you seen this?
> > https://wiki.opnfv.org/characterize_vswitch_performance_for_telco_nfv_
> > use_cases
> >
> 
> Thanks for the pointer, I'll try later.
> >>
> >> Thanks,
> >> Jun


[dpdk-dev] [PATCH] testpmd: fix wrong variable type in ieee1588fwd for 32 bits

2015-07-22 Thread De Lara Guarch, Pablo
Hi,

> -Original Message-
> From: Lu, Wenzhuo
> Sent: Wednesday, July 22, 2015 8:26 AM
> To: De Lara Guarch, Pablo; dev at dpdk.org
> Subject: RE: [dpdk-dev] [PATCH] testpmd: fix wrong variable type in
> ieee1588fwd for 32 bits
> 
> Hi Pablo,
> 
> > -Original Message-
> > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Pablo de Lara
> > Sent: Wednesday, July 22, 2015 2:39 PM
> > To: dev at dpdk.org
> > Subject: [dpdk-dev] [PATCH] testpmd: fix wrong variable type in
> ieee1588fwd for
> > 32 bits
> >
> > In ieee1588fwd.c, timestamp.tv_sec is a size_t variable, which is a long 
> > int,
> but it
> I think you mean time_t :)

Yes, sorry! Will send a v2.

Thanks!
Pablo
> 
> > was being printed with PRIu64, causing an issue on 32 bits.
> >
> > Signed-off-by: Pablo de Lara 
> > ---
> >  app/test-pmd/ieee1588fwd.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/app/test-pmd/ieee1588fwd.c b/app/test-pmd/ieee1588fwd.c
> index
> > 069ee2e..b1a301b 100644
> > --- a/app/test-pmd/ieee1588fwd.c
> > +++ b/app/test-pmd/ieee1588fwd.c
> > @@ -89,7 +89,7 @@ port_ieee1588_rx_timestamp_check(portid_t pi,
> uint32_t
> > index)
> >(unsigned) pi);
> > return;
> > }
> > -   printf("Port %u RX timestamp value %"PRIu64"\n",
> > +   printf("Port %u RX timestamp value %lu\n",
> >(unsigned) pi, timestamp.tv_sec);  }
> >
> > @@ -112,7 +112,7 @@ port_ieee1588_tx_timestamp_check(portid_t pi)
> >(unsigned) pi, (unsigned)
> > MAX_TX_TMST_WAIT_MICROSECS);
> > return;
> > }
> > -   printf("Port %u TX timestamp value %"PRIu64" validated after "
> > +   printf("Port %u TX timestamp value %lu validated after "
> >"%u micro-second%s\n",
> >(unsigned) pi, timestamp.tv_sec, wait_us,
> >(wait_us == 1) ? "" : "s");
> > --
> > 2.4.2



[dpdk-dev] [PATCH] testpmd: fix wrong variable type in ieee1588fwd for 32 bits

2015-07-22 Thread Pablo de Lara
In ieee1588fwd.c, timestamp.tv_sec is a size_t variable,
which is a long int, but it was being printed with PRIu64,
causing an issue on 32 bits.

Signed-off-by: Pablo de Lara 
---
 app/test-pmd/ieee1588fwd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/ieee1588fwd.c b/app/test-pmd/ieee1588fwd.c
index 069ee2e..b1a301b 100644
--- a/app/test-pmd/ieee1588fwd.c
+++ b/app/test-pmd/ieee1588fwd.c
@@ -89,7 +89,7 @@ port_ieee1588_rx_timestamp_check(portid_t pi, uint32_t index)
   (unsigned) pi);
return;
}
-   printf("Port %u RX timestamp value %"PRIu64"\n",
+   printf("Port %u RX timestamp value %lu\n",
   (unsigned) pi, timestamp.tv_sec);
 }

@@ -112,7 +112,7 @@ port_ieee1588_tx_timestamp_check(portid_t pi)
   (unsigned) pi, (unsigned) MAX_TX_TMST_WAIT_MICROSECS);
return;
}
-   printf("Port %u TX timestamp value %"PRIu64" validated after "
+   printf("Port %u TX timestamp value %lu validated after "
   "%u micro-second%s\n",
   (unsigned) pi, timestamp.tv_sec, wait_us,
   (wait_us == 1) ? "" : "s");
-- 
2.4.2



[dpdk-dev] [PATCH] testpmd: fix wrong variable type in ieee1588fwd for 32 bits

2015-07-22 Thread Lu, Wenzhuo
Hi Pablo,

> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Pablo de Lara
> Sent: Wednesday, July 22, 2015 2:39 PM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH] testpmd: fix wrong variable type in ieee1588fwd 
> for
> 32 bits
> 
> In ieee1588fwd.c, timestamp.tv_sec is a size_t variable, which is a long int, 
> but it
I think you mean time_t :)

> was being printed with PRIu64, causing an issue on 32 bits.
> 
> Signed-off-by: Pablo de Lara 
> ---
>  app/test-pmd/ieee1588fwd.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/app/test-pmd/ieee1588fwd.c b/app/test-pmd/ieee1588fwd.c index
> 069ee2e..b1a301b 100644
> --- a/app/test-pmd/ieee1588fwd.c
> +++ b/app/test-pmd/ieee1588fwd.c
> @@ -89,7 +89,7 @@ port_ieee1588_rx_timestamp_check(portid_t pi, uint32_t
> index)
>  (unsigned) pi);
>   return;
>   }
> - printf("Port %u RX timestamp value %"PRIu64"\n",
> + printf("Port %u RX timestamp value %lu\n",
>  (unsigned) pi, timestamp.tv_sec);  }
> 
> @@ -112,7 +112,7 @@ port_ieee1588_tx_timestamp_check(portid_t pi)
>  (unsigned) pi, (unsigned)
> MAX_TX_TMST_WAIT_MICROSECS);
>   return;
>   }
> - printf("Port %u TX timestamp value %"PRIu64" validated after "
> + printf("Port %u TX timestamp value %lu validated after "
>  "%u micro-second%s\n",
>  (unsigned) pi, timestamp.tv_sec, wait_us,
>  (wait_us == 1) ? "" : "s");
> --
> 2.4.2



[dpdk-dev] [ovs-discuss] vswitches performance comparison

2015-07-22 Thread Jun Xiao


> On Jul 22, 2015, at 2:36 AM, Gray, Mark D  wrote:
> 
> 
>> 
>> I'd like to hope that's my methodology problem, but I just follow the
>> installation guide without any customization.
>> 
>> Hi Mark, do you have any performance data share with us? Maybe we are
>> using different type of workloads, like I mentioned I am using typical data
>> center workload, I guess you are talking about NFV type of workload?
> 
> The number getting floated around on the mailing list recently is 16.5Mpps
> for phy-phy. However, I don't think we have any iperf data off-hand for your
> usecase. When we test throughput into the vm we usually generate the traffic 
> externally
> and send NIC->OVS->VM->OVS->NIC. This is a little different to your setup.
> 

I guess pmd driver is used inside VM in that case, right?
> I do know, however, that ovs-dpdk typically has a much larger throughput than
> the kernel space datapath.
> 

I'd like to say it depends on workloads, for small/medium packet size workload, 
that's definitely true, while for TSO size workload, it's not that obvious (or 
worse) as data path overheads are amortized and H/W can be leveraged.
> Have you seen this? 
> https://wiki.opnfv.org/characterize_vswitch_performance_for_telco_nfv_use_cases
> 

Thanks for the pointer, I'll try later.
>> 
>> Thanks,
>> Jun


[dpdk-dev] [ovs-discuss] vswitches performance comparison

2015-07-22 Thread Jun Xiao
I'd like to hope that's my methodology problem, but I just follow the 
installation guide without any customization.

Hi Mark, do you have any performance data share with us? Maybe we are using 
different type of workloads, like I mentioned I am using typical data center 
workload, I guess you are talking about NFV type of workload?

Thanks,
Jun
Sent from my iPhone

> On Jul 22, 2015, at 2:14 AM, Gray, Mark D  wrote:
> 
> 
> 
>> -Original Message-
>> From: discuss [mailto:discuss-bounces at openvswitch.org] On Behalf Of Jun
>> Xiao
>> Sent: Tuesday, July 21, 2015 7:01 PM
>> To: discuss; dev
>> Subject: [ovs-discuss] vswitches performance comparison
>> 
>> After CloudNetEngine vswitch technical preview is launched, we received
>> quite a few queries on vswitches performance comparison, but we cannot
>> simply give a  test result on our platform because performance varies on
>> different H/Ws and different workloads, and that's why we encourage you to
>> try the evaluation package to get real data on your setup.
>> 
>> Anyway, we share a little more performance data on our H/W which is a
>> comparison  among native kernel OVS/OVS-DPDK/CNE vswitch under the
>> most common workload:
>> concurrent bi-directional TCP traffics cross hosts, and hope you can have a
>> rough idea.
>> http://www.cloudnetengine.com/weblog/2015/07/22/vswitches-
>> performance-comparison/
> 
> I think there is an issue with you methodology. ovs-dpdk performance should be
> significantly higher than kernel ovs.
> 
>> 
>> Thanks,
>> Jun
>> ___
>> discuss mailing list
>> discuss at openvswitch.org
>> http://openvswitch.org/mailman/listinfo/discuss


[dpdk-dev] vswitches performance comparison

2015-07-22 Thread Jun Xiao
After CloudNetEngine vswitch technical preview is launched, we received quite
a few queries on vswitches performance comparison, but we cannot simply give a
 test result on our platform because performance varies on different H/Ws and
different workloads, and that's why we encourage you to try the evaluation 
package to get real data on your setup.

Anyway, we share a little more performance data on our H/W which is a comparison
 among native kernel OVS/OVS-DPDK/CNE vswitch under the most common workload:
concurrent bi-directional TCP traffics cross hosts, and hope you can have a 
rough idea.
http://www.cloudnetengine.com/weblog/2015/07/22/vswitches-performance-comparison/

Thanks,
Jun


[dpdk-dev] [PATCH] ixgbe: fix check for split packets

2015-07-22 Thread Lu, Wenzhuo
Hi Bruce,

> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Bruce Richardson
> Sent: Tuesday, July 21, 2015 11:25 PM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH] ixgbe: fix check for split packets
> 
> The check for split packets to be reassembled in the vector ixgbe PMD was
> incorrectly only checking the first 16 elements of the array instead of all 
> 32. This
> is fixed by changing the uint32_t values to be uint64_t instead.
> 
> Fixes: cf4b4708a88a ("ixgbe: improve slow-path perf with vector scattered Rx")
> 
> Reported-by: Zoltan Kiss 
> Signed-off-by: Bruce Richardson 
> ---
>  drivers/net/ixgbe/ixgbe_rxtx_vec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec.c
> b/drivers/net/ixgbe/ixgbe_rxtx_vec.c
> index 9f24849..cdad3e0 100644
> --- a/drivers/net/ixgbe/ixgbe_rxtx_vec.c
> +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec.c
> @@ -549,7 +549,7 @@ ixgbe_recv_scattered_pkts_vec(void *rx_queue, struct
> rte_mbuf **rx_pkts,
>   return 0;
> 
>   /* happy day case, full burst + no packets to be joined */
> - const uint32_t *split_fl32 = (uint32_t *)split_flags;
> + const uint64_t *split_fl32 = (uint64_t *)split_flags;
Why not change the name to split_fl64? I don't think it's appropriate to keep 
it be split_fl32.
Thanks.

>   if (rxq->pkt_first_seg == NULL &&
>   split_fl32[0] == 0 && split_fl32[1] == 0 &&
>   split_fl32[2] == 0 && split_fl32[3] == 0)
> --
> 1.8.3.1