From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by dpdk.org (Postfix) with ESMTP id 371335F13 for ; Fri, 31 Aug 2018 00:35:24 +0200 (CEST) Received: by mail-pg1-f195.google.com with SMTP id m4-v6so4510553pgv.12 for ; Thu, 30 Aug 2018 15:35:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=L4ktxJPjB/Y1XpT72mehhDh8nDvh+zTinSBNqVlq2Rg=; b=OmMx7oc8BgXvpKe5ucCJYbgb5d+ASpvKqVJxejed3Awm4KEhyte8zGKNEviRr0eSaK eG14qWdJDxPGRQ0bj8nWYnlGk2l7D74phZ0qJCcygXgvi9KUUSFu4ByiKYlUo7GfqyXm PAQEPOtlAm9qSMadmeCXy+uGlmS2JIer0H2JzVDPuWOAoWqRm0Tp0g3yyBelNx2/wQvG eyDSb3Vn/SYQN4RojardwzBkX/9bAuKHsPmRcg8npjaLT2g9kBwoqmhAP2z4vm9z7BHH yoDt4ZvsQn4ssFZh4IDWnfC11UGwnDKno5vFY6khP1k+FZ3+IjysdYM2qMPhaMYIL1eo KVQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=L4ktxJPjB/Y1XpT72mehhDh8nDvh+zTinSBNqVlq2Rg=; b=mp0wywCqm9I6MQyg36kGkxIi42sjFbos/f2QzcDePlKxJQRBuM9DCHyCSjyKMqUyIW dCJ0kZUdGGKUo1UnffuEEhMJFSD9bm+jCtBSHci91ZAJ7FTDJOVeaVcIDJjdtniJs5qR MC9DZsCHvq8W/invaJReWK2zkt1Bf39OwJt2n1U9fmFZ/VOVs2ybEpfzYZ+ODtQPdQ5q PvDal8etV2AQeY3Yd73+1g5lBlzxdWe8+QTZiyxIDMFpN81nUJhXHjaQj1Swgr6Ybh3v Bv/E1U3yP1zCvWaReKPAfiS6MjKWE20kab+xpLmY/3JrSiL4RdhjFwRZbltgLWRbQ6c4 ECgQ== X-Gm-Message-State: APzg51C3yoNm29OqooE2s4hmMKe0JZRkaMhj3n7TY0xLueL2F4+1Ealt WHk03f9hEbndSwe+1hQB7BP78vLnWHMFkA== X-Google-Smtp-Source: ANB0Vdb+Tc9Kyers1MPKG+6GbR5vfqYeaFD0u9KHyaZ327lHw+FyBRzPI379rzi3bs27apDaVsRiYA== X-Received: by 2002:a63:f344:: with SMTP id t4-v6mr11794302pgj.428.1535668523074; Thu, 30 Aug 2018 15:35:23 -0700 (PDT) Received: from xeon-e3.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id r19-v6sm11746033pgg.39.2018.08.30.15.35.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 15:35:21 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Thu, 30 Aug 2018 15:35:10 -0700 Message-Id: <20180830223512.21297-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180830223512.21297-1-stephen@networkplumber.org> References: <20180830223512.21297-1-stephen@networkplumber.org> Subject: [dpdk-dev] [PATCH 3/5] net/netvsc: exhausting transmit descriptors is not an error X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2018 22:35:24 -0000 From: Stephen Hemminger If application sends faster than vswitch can keep up, then the transmit descriptor pool will be exhausted. This is not a failure so change the name statistic and don't include it in oerrors. Signed-off-by: Stephen Hemminger --- drivers/net/netvsc/hn_ethdev.c | 7 +++---- drivers/net/netvsc/hn_rxtx.c | 4 ++-- drivers/net/netvsc/hn_var.h | 3 +-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c index 97e4b0da4410..8643e0b3c057 100644 --- a/drivers/net/netvsc/hn_ethdev.c +++ b/drivers/net/netvsc/hn_ethdev.c @@ -57,7 +57,7 @@ static const struct hn_xstats_name_off hn_stat_strings[] = { { "good_packets", offsetof(struct hn_stats, packets) }, { "good_bytes", offsetof(struct hn_stats, bytes) }, { "errors", offsetof(struct hn_stats, errors) }, - { "allocation_failed", offsetof(struct hn_stats, nomemory) }, + { "ring full", offsetof(struct hn_stats, ring_full) }, { "multicast_packets", offsetof(struct hn_stats, multicast) }, { "broadcast_packets", offsetof(struct hn_stats, broadcast) }, { "undersize_packets", offsetof(struct hn_stats, size_bins[0]) }, @@ -407,7 +407,7 @@ static int hn_dev_stats_get(struct rte_eth_dev *dev, stats->opackets += txq->stats.packets; stats->obytes += txq->stats.bytes; - stats->oerrors += txq->stats.errors + txq->stats.nomemory; + stats->oerrors += txq->stats.errors; if (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) { stats->q_opackets[i] = txq->stats.packets; @@ -424,7 +424,7 @@ static int hn_dev_stats_get(struct rte_eth_dev *dev, stats->ipackets += rxq->stats.packets; stats->ibytes += rxq->stats.bytes; stats->ierrors += rxq->stats.errors; - stats->imissed += rxq->ring_full; + stats->imissed += rxq->stats.ring_full; if (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) { stats->q_ipackets[i] = rxq->stats.packets; @@ -458,7 +458,6 @@ hn_dev_stats_reset(struct rte_eth_dev *dev) continue; memset(&rxq->stats, 0, sizeof(struct hn_stats)); - rxq->ring_full = 0; } } diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c index cb5bc6029ce7..92de5d09e442 100644 --- a/drivers/net/netvsc/hn_rxtx.c +++ b/drivers/net/netvsc/hn_rxtx.c @@ -534,7 +534,7 @@ static void hn_rxpkt(struct hn_rx_queue *rxq, struct hn_rx_bufinfo *rxb, hn_update_packet_stats(&rxq->stats, m); if (unlikely(rte_ring_sp_enqueue(rxq->rx_ring, m) != 0)) { - ++rxq->ring_full; + ++rxq->stats.ring_full; rte_pktmbuf_free(m); } } @@ -1007,7 +1007,7 @@ static struct hn_txdesc *hn_new_txd(struct hn_data *hv, struct hn_txdesc *txd; if (rte_mempool_get(hv->tx_pool, (void **)&txd)) { - ++txq->stats.nomemory; + ++txq->stats.ring_full; PMD_TX_LOG(DEBUG, "tx pool exhausted!"); return NULL; } diff --git a/drivers/net/netvsc/hn_var.h b/drivers/net/netvsc/hn_var.h index f188f6360f79..ff722560d9d9 100644 --- a/drivers/net/netvsc/hn_var.h +++ b/drivers/net/netvsc/hn_var.h @@ -39,7 +39,7 @@ struct hn_stats { uint64_t packets; uint64_t bytes; uint64_t errors; - uint64_t nomemory; + uint64_t ring_full; uint64_t multicast; uint64_t broadcast; /* Size bins in array as RFC 2819, undersized [0], 64 [1], etc */ @@ -78,7 +78,6 @@ struct hn_rx_queue { uint16_t port_id; uint16_t queue_id; struct hn_stats stats; - uint64_t ring_full; void *event_buf; }; -- 2.18.0