From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6EA5BA034E; Wed, 6 May 2020 21:52:54 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 57D801DAED; Wed, 6 May 2020 21:52:37 +0200 (CEST) Received: from mail-pj1-f67.google.com (mail-pj1-f67.google.com [209.85.216.67]) by dpdk.org (Postfix) with ESMTP id 797371DAE3 for ; Wed, 6 May 2020 21:52:35 +0200 (CEST) Received: by mail-pj1-f67.google.com with SMTP id a5so1450576pjh.2 for ; Wed, 06 May 2020 12:52:35 -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 :mime-version:content-transfer-encoding; bh=hQjmC4PTmOfcnNpr9QsC2/u/M5OFUoqgBcNnT9V9sEI=; b=lPbeA0ID/ENN5xFy3mmOsycuLKrdobM4HNZo1p3dCcffJtcWsQ7ZmADxqPpRZYe90W lCmSQhHw1+eSYI131O99vbXGtUDH6Gw4orU6rBoELM81QwsDtCFH1Mp683e7Sn0jS+gI E1eTs2CBHzEYvhSuy3OgwwS5OzObh902shhNBEroBtgHAskhYlFJuykeedw/MjDDdVhs 3ezsXYrX3Qx6C+SN6QMSsPOrmoeQhD9c/V1WxuxCdV7BGYBbiE2VuuHi3hlFU7jMHmwb LfgKzyZA52sTXR2CI/2PTVVORjTnQ/5/OqVaL16da/i9ZW+nzs6s/USYFTnO/fsHqE4/ Radw== 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:mime-version:content-transfer-encoding; bh=hQjmC4PTmOfcnNpr9QsC2/u/M5OFUoqgBcNnT9V9sEI=; b=PyhPXzlxujokxao2wdYdl7VO4iiki3XeFeBGmwpnO+PZ6n+t9R4BVhUGbJzMdD2zze HlqJkDze32sRD57ML/jIUvyJp8kkNStjk/vO/1E2xB0tjp5R7Uq49gcBOMye4G3Q1Zj7 wXJm8fhPWMN26xMoryGU4MWGSjdZHLHnSFg9Fc88l1xlGDjIRtNxaCnlxv0CQQwEzFE8 SqVMYlDRgUW07d+jrQw1F2hokmh4u7pC4zUPbnShi2uzNza1jR+kln+ZjWH9lBB6meAW b+l1ICqlpNBQdLn8OlPLLaz+mPCs8KFHwgdCSX1jGHWNv1B8CwYbmkKdqGw8nmg/VJWM Pfgw== X-Gm-Message-State: AGi0PuarQ/ObARyG0AWHyf3evhmqBEC2xAPE5sO62nClWxrcjyNUkZn8 mVSYSs9LqAYQ7lXCfwTif+timi6h5q5Wfw== X-Google-Smtp-Source: APiQypKfMMHE5mUeT98aNHWXqMIaHtZlpngBUf2Q2kUuPfgvaOe647gIhRA7mfukZ+PO99rIkGvOTw== X-Received: by 2002:a17:90b:4d10:: with SMTP id mw16mr10650364pjb.19.1588794754057; Wed, 06 May 2020 12:52:34 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id w69sm2655604pff.168.2020.05.06.12.52.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2020 12:52:33 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Wed, 6 May 2020 12:52:20 -0700 Message-Id: <20200506195221.26306-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200506195221.26306-1-stephen@networkplumber.org> References: <20200506192730.21613-1-stephen@networkplumber.org> <20200506195221.26306-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 3/4] net/netvsc: change tx/rx error handling 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The PMD_TX_LOG and PMD_RX_LOG can hide errors since the debug log is typically disabled. Change the code to use PMD_DRV_LOG for errors. Under load, the ring buffer to the host can fill. Add some statistics to estimate the impact and see other errors. Signed-off-by: Stephen Hemminger --- drivers/net/netvsc/hn_ethdev.c | 1 + drivers/net/netvsc/hn_rxtx.c | 29 ++++++++++++++++++++--------- drivers/net/netvsc/hn_var.h | 1 + 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c index 675a49e66a57..0f4827c54be4 100644 --- a/drivers/net/netvsc/hn_ethdev.c +++ b/drivers/net/netvsc/hn_ethdev.c @@ -58,6 +58,7 @@ static const struct hn_xstats_name_off hn_stat_strings[] = { { "good_bytes", offsetof(struct hn_stats, bytes) }, { "errors", offsetof(struct hn_stats, errors) }, { "ring full", offsetof(struct hn_stats, ring_full) }, + { "channel full", offsetof(struct hn_stats, channel_full) }, { "multicast_packets", offsetof(struct hn_stats, multicast) }, { "broadcast_packets", offsetof(struct hn_stats, broadcast) }, { "undersize_packets", offsetof(struct hn_stats, size_bins[0]) }, diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c index 537fd0125687..fa53c7becc12 100644 --- a/drivers/net/netvsc/hn_rxtx.c +++ b/drivers/net/netvsc/hn_rxtx.c @@ -403,8 +403,8 @@ hn_nvs_send_completed(struct rte_eth_dev *dev, uint16_t queue_id, txq->stats.bytes += txd->data_size; txq->stats.packets += txd->packets; } else { - PMD_TX_LOG(NOTICE, "port %u:%u complete tx %u failed status %u", - txq->port_id, txq->queue_id, txd->chim_index, ack->status); + PMD_DRV_LOG(NOTICE, "port %u:%u complete tx %u failed status %u", + txq->port_id, txq->queue_id, txd->chim_index, ack->status); ++txq->stats.errors; } @@ -429,8 +429,7 @@ hn_nvs_handle_comp(struct rte_eth_dev *dev, uint16_t queue_id, break; default: - PMD_TX_LOG(NOTICE, - "unexpected send completion type %u", + PMD_DRV_LOG(NOTICE, "unexpected send completion type %u", hdr->type); } } @@ -648,6 +647,7 @@ static void hn_rxpkt(struct hn_rx_queue *rxq, struct hn_rx_bufinfo *rxb, if (unlikely(rte_ring_sp_enqueue(rxq->rx_ring, m) != 0)) { ++rxq->stats.ring_full; + PMD_RX_LOG(DEBUG, "rx ring full"); rte_pktmbuf_free(m); } } @@ -1156,10 +1156,16 @@ static int hn_flush_txagg(struct hn_tx_queue *txq, bool *need_sig) if (likely(ret == 0)) hn_reset_txagg(txq); - else - PMD_TX_LOG(NOTICE, "port %u:%u send failed: %d", - txq->port_id, txq->queue_id, ret); + else if (ret == -EAGAIN) { + PMD_TX_LOG(DEBUG, "port %u:%u channel full", + txq->port_id, txq->queue_id); + ++txq->stats.channel_full; + } else { + ++txq->stats.errors; + PMD_DRV_LOG(NOTICE, "port %u:%u send failed: %d", + txq->port_id, txq->queue_id, ret); + } return ret; } @@ -1505,8 +1511,13 @@ hn_xmit_pkts(void *ptxq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) ret = hn_xmit_sg(txq, txd, m, &need_sig); if (unlikely(ret != 0)) { - PMD_TX_LOG(NOTICE, "sg send failed: %d", ret); - ++txq->stats.errors; + if (ret == -EAGAIN) { + PMD_TX_LOG(DEBUG, "sg channel full"); + ++txq->stats.channel_full; + } else { + PMD_DRV_LOG(NOTICE, "sg send failed: %d", ret); + ++txq->stats.errors; + } hn_txd_put(txq, txd); goto fail; } diff --git a/drivers/net/netvsc/hn_var.h b/drivers/net/netvsc/hn_var.h index ded0d4c60a04..20363389a0d6 100644 --- a/drivers/net/netvsc/hn_var.h +++ b/drivers/net/netvsc/hn_var.h @@ -40,6 +40,7 @@ struct hn_stats { uint64_t bytes; uint64_t errors; uint64_t ring_full; + uint64_t channel_full; uint64_t multicast; uint64_t broadcast; /* Size bins in array as RFC 2819, undersized [0], 64 [1], etc */ -- 2.20.1