patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Yuanhan Liu <yuanhan.liu@linux.intel.com>
To: Matt Peters <matt.peters@windriver.com>
Cc: Yuanhan Liu <yuanhan.liu@linux.intel.com>,
	Allain Legacy <allain.legacy@windriver.com>,
	Helin Zhang <helin.zhang@intel.com>,
	dpdk stable <stable@dpdk.org>
Subject: [dpdk-stable] patch 'net/i40e: fix mbuf alloc failed counter' has been queued to LTS release 16.11.2
Date: Tue,  2 May 2017 17:32:08 +0800	[thread overview]
Message-ID: <1493717548-12434-7-git-send-email-yuanhan.liu@linux.intel.com> (raw)
In-Reply-To: <1493717548-12434-1-git-send-email-yuanhan.liu@linux.intel.com>

Hi,

FYI, your patch has been queued to LTS release 16.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable
yet. It will be pushed if I get no objections before 05/07/17.
So please shout if anyone has objections.

Thanks.

	--yliu

---
>From 326c17459bcd3dfa1c5bf224908ed4488376caab Mon Sep 17 00:00:00 2001
From: Matt Peters <matt.peters@windriver.com>
Date: Tue, 25 Apr 2017 08:28:45 -0400
Subject: [PATCH] net/i40e: fix mbuf alloc failed counter

[ upstream commit 09c04fbc8d1580b49095f6113ff3b140d699278e ]

When an mbuf alloc fails during the mempool get operation for the
i40e bulk alloc receive function, the rx_mbuf_alloc_failed counter
is not incremented to record the error.

This fix ensures consistency with the other i40e receive procedures and
other net drivers.

Signed-off-by: Matt Peters <matt.peters@windriver.com>
Signed-off-by: Allain Legacy <allain.legacy@windriver.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
---
 drivers/net/i40e/i40e_rxtx.c | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 9cc9808..1a007d6 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -598,6 +598,7 @@ static inline uint16_t
 rx_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 {
 	struct i40e_rx_queue *rxq = (struct i40e_rx_queue *)rx_queue;
+	struct rte_eth_dev *dev;
 	uint16_t nb_rx = 0;
 
 	if (!nb_pkts)
@@ -615,9 +616,10 @@ rx_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 		if (i40e_rx_alloc_bufs(rxq) != 0) {
 			uint16_t i, j;
 
-			PMD_RX_LOG(DEBUG, "Rx mbuf alloc failed for "
-				   "port_id=%u, queue_id=%u",
-				   rxq->port_id, rxq->queue_id);
+			dev = I40E_VSI_TO_ETH_DEV(rxq->vsi);
+			dev->data->rx_mbuf_alloc_failed +=
+				rxq->rx_free_thresh;
+
 			rxq->rx_nb_avail = 0;
 			rxq->rx_tail = (uint16_t)(rxq->rx_tail - nb_rx);
 			for (i = 0, j = rxq->rx_tail; i < nb_rx; i++, j++)
@@ -679,6 +681,7 @@ i40e_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 	union i40e_rx_desc rxd;
 	struct i40e_rx_entry *sw_ring;
 	struct i40e_rx_entry *rxe;
+	struct rte_eth_dev *dev;
 	struct rte_mbuf *rxm;
 	struct rte_mbuf *nmb;
 	uint16_t nb_rx;
@@ -707,10 +710,13 @@ i40e_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 			break;
 
 		nmb = rte_mbuf_raw_alloc(rxq->mp);
-		if (unlikely(!nmb))
+		if (unlikely(!nmb)) {
+			dev = I40E_VSI_TO_ETH_DEV(rxq->vsi);
+			dev->data->rx_mbuf_alloc_failed++;
 			break;
-		rxd = *rxdp;
+		}
 
+		rxd = *rxdp;
 		nb_hold++;
 		rxe = &sw_ring[rx_id];
 		rx_id++;
@@ -802,6 +808,7 @@ i40e_recv_scattered_pkts(void *rx_queue,
 	struct rte_mbuf *nmb, *rxm;
 	uint16_t rx_id = rxq->rx_tail;
 	uint16_t nb_rx = 0, nb_hold = 0, rx_packet_len;
+	struct rte_eth_dev *dev;
 	uint32_t rx_status;
 	uint64_t qword1;
 	uint64_t dma_addr;
@@ -818,8 +825,12 @@ i40e_recv_scattered_pkts(void *rx_queue,
 			break;
 
 		nmb = rte_mbuf_raw_alloc(rxq->mp);
-		if (unlikely(!nmb))
+		if (unlikely(!nmb)) {
+			dev = I40E_VSI_TO_ETH_DEV(rxq->vsi);
+			dev->data->rx_mbuf_alloc_failed++;
 			break;
+		}
+
 		rxd = *rxdp;
 		nb_hold++;
 		rxe = &sw_ring[rx_id];
-- 
1.9.0

  parent reply	other threads:[~2017-05-02  9:36 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-02  9:32 [dpdk-stable] patch 'examples: fix build clean on FreeBSD' " Yuanhan Liu
2017-05-02  9:32 ` [dpdk-stable] patch 'examples/performance-thread: fix compilation on Suse 11 SP2' " Yuanhan Liu
2017-05-02  9:32 ` [dpdk-stable] patch 'mbuf: fix missing includes in exported header' " Yuanhan Liu
2017-05-02  9:32 ` [dpdk-stable] patch 'net/qede: fix default MAC address handling' " Yuanhan Liu
2017-05-06 15:07   ` Patil, Harish
2017-05-02  9:32 ` [dpdk-stable] patch 'net/qede: fix fastpath rings reset phase' " Yuanhan Liu
2017-05-06 15:06   ` Patil, Harish
2017-05-02  9:32 ` [dpdk-stable] patch 'net/qede/base: fix find zero bit macro' " Yuanhan Liu
2017-05-02  9:32 ` Yuanhan Liu [this message]
2017-05-02  9:32 ` [dpdk-stable] patch 'net/bonding: fix updating slave link status' " Yuanhan Liu
2017-05-02  9:32 ` [dpdk-stable] patch 'net/virtio: fix MSI-X for modern devices' " Yuanhan Liu
2017-05-02  9:32 ` [dpdk-stable] patch 'net/virtio: fix link status always down' " Yuanhan Liu
2017-05-02  9:32 ` [dpdk-stable] patch 'net/virtio: fix crash when closing twice' " Yuanhan Liu
2017-05-02  9:32 ` [dpdk-stable] patch 'crypto/openssl: fix AAD capabilities for AES-GCM' " Yuanhan Liu
2017-05-02  9:32 ` [dpdk-stable] patch 'crypto/openssl: fix AES-GCM capability' " Yuanhan Liu
2017-05-02  9:32 ` [dpdk-stable] patch 'examples/l2fwd-crypto: fix packets array index' " Yuanhan Liu
2017-05-02  9:32 ` [dpdk-stable] patch 'crypto/qat: fix dequeue statistics' " Yuanhan Liu
2017-05-02  9:32 ` [dpdk-stable] patch 'cryptodev: fix API digest length comments' " Yuanhan Liu
2017-05-02  9:32 ` [dpdk-stable] patch 'app/testpmd: fix crash at mbuf pool creation' " Yuanhan Liu
2017-05-02  9:32 ` [dpdk-stable] patch 'app/testpmd: fix exit without freeing resources' " Yuanhan Liu
2017-05-02  9:32 ` [dpdk-stable] patch 'examples/performance-thread: fix build on FreeBSD 10.0' " Yuanhan Liu
2017-05-02  9:32 ` [dpdk-stable] patch 'examples/multi_process: fix timer update' " Yuanhan Liu
2017-05-02  9:32 ` [dpdk-stable] patch 'examples/l3fwd-power: fix handling no Rx queue' " Yuanhan Liu
2017-05-02  9:32 ` [dpdk-stable] patch 'examples/l3fwd-power: fix Rx descriptor size' " Yuanhan Liu
2017-05-02  9:32 ` [dpdk-stable] patch 'examples/load_balancer: fix Tx flush' " Yuanhan Liu
2017-05-02  9:32 ` [dpdk-stable] patch 'net/thunderx: fix deadlock in Rx path' " Yuanhan Liu
2017-05-02  9:32 ` [dpdk-stable] patch 'doc: add limitation of AAD size to QAT guide' " Yuanhan Liu
2017-05-02  9:32 ` [dpdk-stable] patch 'net/qede: fix FW version string for VF' " Yuanhan Liu
2017-05-02  9:32 ` [dpdk-stable] patch 'examples/performance-thread: fix build on FreeBSD' " Yuanhan Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1493717548-12434-7-git-send-email-yuanhan.liu@linux.intel.com \
    --to=yuanhan.liu@linux.intel.com \
    --cc=allain.legacy@windriver.com \
    --cc=helin.zhang@intel.com \
    --cc=matt.peters@windriver.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).