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 68F3BA04A5; Thu, 18 Jun 2020 16:35:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E98261BF86; Thu, 18 Jun 2020 16:35:43 +0200 (CEST) Received: from rnd-relay.smtp.broadcom.com (rnd-relay.smtp.broadcom.com [192.19.229.170]) by dpdk.org (Postfix) with ESMTP id EF7121BF83 for ; Thu, 18 Jun 2020 16:35:41 +0200 (CEST) Received: from mail-irv-17.broadcom.com (mail-irv-17.lvn.broadcom.net [10.75.242.48]) by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id EBF4630D85D; Thu, 18 Jun 2020 07:35:40 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com EBF4630D85D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1592490941; bh=s0v4RVnueD6sIVyysL9h/nenT7+vAO+6J8a7czrt7ww=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xw32ziZvsCDCChZOeRosJ4DbCnxyMotSbgQDxaimDUlbSaDdbfWm/rxFfX0Gw1bhr PXbQ601TOkUGOcj3pVAqqpaP2UGSfZBfxE5+BkcX7+uDkFSOglTH2qCIB2ZrKskpp3 HEwpzwvUD5iIMYrVZQyvF5NObf3qtYvIWt7CdM48= Received: from localhost.localdomain (unknown [10.230.150.244]) by mail-irv-17.broadcom.com (Postfix) with ESMTP id 25DE0140069; Thu, 18 Jun 2020 07:35:40 -0700 (PDT) From: Lance Richardson To: dev@dpdk.org, ajit.khaparde@broadcom.com, Ruifeng.Wang@arm.com Cc: Somnath Kotur Date: Thu, 18 Jun 2020 10:35:31 -0400 Message-Id: <20200618143532.258537-3-lance.richardson@broadcom.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200618143532.258537-1-lance.richardson@broadcom.com> References: <20200618143532.258537-1-lance.richardson@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 2/3] net/bnxt: support Rx/Tx burst mode info 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" Retrieve burst mode options according to the selected Rx/Tx burst function name. Signed-off-by: Lance Richardson Reviewed-by: Somnath Kotur Reviewed-by: Ajit Kumar Khaparde --- v2: no change doc/guides/nics/features/bnxt.ini | 1 + drivers/net/bnxt/bnxt_ethdev.c | 46 +++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/doc/guides/nics/features/bnxt.ini b/doc/guides/nics/features/bnxt.ini index 37a99e336..f1f300c8b 100644 --- a/doc/guides/nics/features/bnxt.ini +++ b/doc/guides/nics/features/bnxt.ini @@ -9,6 +9,7 @@ Link status = Y Link status event = Y Rx interrupt = Y Queue start/stop = Y +Burst mode info = Y MTU update = Y Jumbo frame = Y Scattered Rx = Y diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index e8b4c058a..edb650bbc 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -2582,6 +2582,50 @@ bnxt_txq_info_get_op(struct rte_eth_dev *dev, uint16_t queue_id, qinfo->conf.tx_deferred_start = txq->tx_deferred_start; } +static int +bnxt_rx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id, + struct rte_eth_burst_mode *mode) +{ + eth_rx_burst_t pkt_burst = dev->rx_pkt_burst; + + if (pkt_burst == bnxt_recv_pkts) { + snprintf(mode->info, sizeof(mode->info), "%s", + "Scalar"); + return 0; + } +#ifdef RTE_ARCH_X86 + if (pkt_burst == bnxt_recv_pkts_vec) { + snprintf(mode->info, sizeof(mode->info), "%s", + "Vector SSE"); + return 0; + } +#endif + + return -EINVAL; +} + +static int +bnxt_tx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id, + struct rte_eth_burst_mode *mode) +{ + eth_tx_burst_t pkt_burst = dev->tx_pkt_burst; + + if (pkt_burst == bnxt_xmit_pkts) { + snprintf(mode->info, sizeof(mode->info), "%s", + "Scalar"); + return 0; + } +#ifdef RTE_ARCH_X86 + if (pkt_burst == bnxt_xmit_pkts_vec) { + snprintf(mode->info, sizeof(mode->info), "%s", + "Vector SSE"); + return 0; + } +#endif + + return -EINVAL; +} + int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu) { struct bnxt *bp = eth_dev->data->dev_private; @@ -4158,6 +4202,8 @@ static const struct eth_dev_ops bnxt_dev_ops = { .set_mc_addr_list = bnxt_dev_set_mc_addr_list_op, .rxq_info_get = bnxt_rxq_info_get_op, .txq_info_get = bnxt_txq_info_get_op, + .rx_burst_mode_get = bnxt_rx_burst_mode_get, + .tx_burst_mode_get = bnxt_tx_burst_mode_get, .dev_led_on = bnxt_dev_led_on_op, .dev_led_off = bnxt_dev_led_off_op, .xstats_get_by_id = bnxt_dev_xstats_get_by_id_op, -- 2.25.1