From patchwork Tue Jul 24 21:08:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 43325 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0C09032A5; Tue, 24 Jul 2018 23:09:13 +0200 (CEST) Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by dpdk.org (Postfix) with ESMTP id ED44631FC for ; Tue, 24 Jul 2018 23:09:06 +0200 (CEST) Received: by mail-pf1-f194.google.com with SMTP id d14-v6so1141252pfo.3 for ; Tue, 24 Jul 2018 14:09:06 -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=rrvI4y3U1rTTOuIajwJn3kWG2v77GiX3rWBplI+e650=; b=JzfAkB3dBDSY24pbHIpEPdrjMHxrLFl81nI7w0ysFH+EyIB/n1+s6Ee+a8RIgun0UO teNkm9HEpE1HikRDaw6CCwOcVHp8ZQ45oQvlDQdySlVqsaH2Xkfqkgf5zze5klAtpW44 p88e5YTyN3SwV74HYdZRRC48fcpDlPBroi8BeLI1aS29ENXjJ59Qya9s9YvLArpGEKnC ve6M07O2zv06MssU1hV3HmtJBJ0aXm2Uca4y8XfeI1BtOZrsDHZl5GiXWJglcS3H3Xh5 v9qijAtyO9kDKDFBqYwmj+0IrQ5G/TPxEqGgo7latSn5HhhuJ26UA29rMvj47nQZIR53 PFCA== 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=rrvI4y3U1rTTOuIajwJn3kWG2v77GiX3rWBplI+e650=; b=erts21hX3a8ZHkGecWS3TwfNocwgcwSPd+ZweZruwxHPkOnN7gx821XmSVevYkK22x C3UtqjNtGhSmSTGpJrm8a85UPtxvDip54p2WX/QbxuzAy/n++fHXN7HMY3ECqHdzqL+1 ZbPsur32zMT8l5bnfZDNQN03miLTnZYpE+C80xXEDmpUWZLveuYpBybq5TIyYyLiDEFH 361sVFBE8PS/O/kFFptmj2XfrTr7OKFNqDaDnHC1RAAVWqK2ahm+R5SRzrwvwfAlbIld pGSQCjDs3L38hWVmPzJiXrg1baEKjbYF7G5VgVrxJNgYNZmOFt8XyMp4Th4RzDw/VC0q cqYg== X-Gm-Message-State: AOUpUlHD05EqlJcuyfMBIPKTClQDzyinAGz9qKtXfsSlEhWuCLBfIb1A 9xMfrEYfKZAAikRYG/5ey7Y98lsa30c= X-Google-Smtp-Source: AAOMgpctB/sTRouCqiu2Aj/NnGPADOFsEz7Wr+3Sq/16U2ObwJssfKjXyNkxH+f5IDl7AFDEVlJeuw== X-Received: by 2002:a63:9802:: with SMTP id q2-v6mr17698605pgd.70.1532466545822; Tue, 24 Jul 2018 14:09:05 -0700 (PDT) Received: from xeon-e3.wavecable.com (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id d11-v6sm16921161pfo.135.2018.07.24.14.09.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jul 2018 14:09:04 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Stephen Hemminger Date: Tue, 24 Jul 2018 14:08:52 -0700 Message-Id: <20180724210853.22767-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180724210853.22767-1-stephen@networkplumber.org> References: <20180724210853.22767-1-stephen@networkplumber.org> Subject: [dpdk-dev] [PATCH 3/4] netvsc: implement queue info get handles 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" This helps when diagnosing ring issues in testpmd. Signed-off-by: Stephen Hemminger --- drivers/net/netvsc/hn_ethdev.c | 2 ++ drivers/net/netvsc/hn_rxtx.c | 22 ++++++++++++++++++++++ drivers/net/netvsc/hn_var.h | 4 ++++ 3 files changed, 28 insertions(+) diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c index 47ed760b825d..78b842ba2d68 100644 --- a/drivers/net/netvsc/hn_ethdev.c +++ b/drivers/net/netvsc/hn_ethdev.c @@ -536,6 +536,8 @@ static const struct eth_dev_ops hn_eth_dev_ops = { .dev_stop = hn_dev_stop, .dev_close = hn_dev_close, .dev_infos_get = hn_dev_info_get, + .txq_info_get = hn_dev_tx_queue_info, + .rxq_info_get = hn_dev_rx_queue_info, .promiscuous_enable = hn_dev_promiscuous_enable, .promiscuous_disable = hn_dev_promiscuous_disable, .allmulticast_enable = hn_dev_allmulticast_enable, diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c index 1aff64ee3ae5..17cebeb74456 100644 --- a/drivers/net/netvsc/hn_rxtx.c +++ b/drivers/net/netvsc/hn_rxtx.c @@ -268,6 +268,17 @@ hn_dev_tx_queue_release(void *arg) rte_free(txq); } +void +hn_dev_tx_queue_info(struct rte_eth_dev *dev, uint16_t queue_idx, + struct rte_eth_txq_info *qinfo) +{ + struct hn_data *hv = dev->data->dev_private; + struct hn_tx_queue *txq = dev->data->rx_queues[queue_idx]; + + qinfo->conf.tx_free_thresh = txq->free_thresh; + qinfo->nb_desc = hv->tx_pool->size; +} + static void hn_nvs_send_completed(struct rte_eth_dev *dev, uint16_t queue_id, unsigned long xactid, const struct hn_nvs_rndis_ack *ack) @@ -790,6 +801,17 @@ hn_dev_rx_queue_release(void *arg) } } +void +hn_dev_rx_queue_info(struct rte_eth_dev *dev, uint16_t queue_idx, + struct rte_eth_rxq_info *qinfo) +{ + struct hn_rx_queue *rxq = dev->data->rx_queues[queue_idx]; + + qinfo->mp = rxq->mb_pool; + qinfo->scattered_rx = 1; + qinfo->nb_desc = rte_ring_get_capacity(rxq->rx_ring); +} + static void hn_nvs_handle_notify(const struct vmbus_chanpkt_hdr *pkthdr, const void *data) diff --git a/drivers/net/netvsc/hn_var.h b/drivers/net/netvsc/hn_var.h index f0358c58226a..3f3b442697af 100644 --- a/drivers/net/netvsc/hn_var.h +++ b/drivers/net/netvsc/hn_var.h @@ -141,6 +141,8 @@ int hn_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, uint16_t nb_desc, unsigned int socket_id, const struct rte_eth_txconf *tx_conf); void hn_dev_tx_queue_release(void *arg); +void hn_dev_tx_queue_info(struct rte_eth_dev *dev, uint16_t queue_idx, + struct rte_eth_txq_info *qinfo); struct hn_rx_queue *hn_rx_queue_alloc(struct hn_data *hv, uint16_t queue_id, @@ -151,3 +153,5 @@ int hn_dev_rx_queue_setup(struct rte_eth_dev *dev, const struct rte_eth_rxconf *rx_conf, struct rte_mempool *mp); void hn_dev_rx_queue_release(void *arg); +void hn_dev_rx_queue_info(struct rte_eth_dev *dev, uint16_t queue_idx, + struct rte_eth_rxq_info *qinfo);