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 E736AA0573; Thu, 5 Mar 2020 07:45:12 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 76D171BE7D; Thu, 5 Mar 2020 07:45:12 +0100 (CET) Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by dpdk.org (Postfix) with ESMTP id E96D02BB8 for ; Thu, 5 Mar 2020 07:45:10 +0100 (CET) Received: by mail-pl1-f196.google.com with SMTP id t14so2197600plr.8 for ; Wed, 04 Mar 2020 22:45:10 -0800 (PST) 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:mime-version :content-transfer-encoding; bh=PXHzSt+jLbGIWfoIXE7a3VzecrfLN3l7EO7G5hsl6tA=; b=VALXVcuBUVeLAOP4HohWsHZ8GwURgzMireTQQQSr5+tuKW+J+9oEpKnOESll9ldY2+ pqhuPm9kXQvA8HWzmsMoNzGAkc2Pt6GMhYek1Yb0eODS6kT+4KB+LRQDFA8hhcRliXdY k5maC0QDSRXBMXqZe5f8EwvCFhOWUVO/fy8Si4gn98XUrDU3bJUSG+Yk5VUMi7nPkfdx ejy8Srtjo/DhJBAuo/S8RB+9bPD5Mdt9baO//bnjr5DpA8pwjpd2koXrfEtuOtQde5aM F8WIWwim7vrzcz5jV2FIQOdAquQM90F5sC0t4nRsQy8cIB7oZaakHKrDsrwtqCkR7VDM VGxA== 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:mime-version :content-transfer-encoding; bh=PXHzSt+jLbGIWfoIXE7a3VzecrfLN3l7EO7G5hsl6tA=; b=ueY6/qVdgkMe/YhkHANCooEipvnQqlAgT3dXdZg2RcZYtUzQp4tCyVcwwwJIH0b6Yf RV1MZpCfRPHD9qyvaLBK0AmnvjK/RZJKiMyf8txVQhkihFY7rSqnd/O2VNURDZ5DHqyH 8TxaNKMKf+LFZShVPUDzgom/9bDNMQbQeDq0KOS1+hNP2kZit03/b8dEL3HEKdO0/1AK S9tYyAv/WCZP6UFOk9LKkJ5VouBW6Fha52X43+mA/JL+ijeFBL9zQhL5i8OIW0SOjp/9 tgtiO/dPCq1f/GnLtmUoDS/vZfQa8a8VPF4rIzLMpuR/rQmTQ0k8gawuakl57YScrvu4 eVfQ== X-Gm-Message-State: ANhLgQ2Etubu68Iq6teD9nlt2mi6hMPeLntUMTw77Yl+1IXZWLhWgxOq O6cuJUVVX3rcvPL1W21hDUzg4xlofLk= X-Google-Smtp-Source: ADFU+vsRfNG18ABfIHwvZxEU3bjNnZT+Lr24bElb22vcnon57SRo32ijgEgMk6badiUwMs+6Qh7bcw== X-Received: by 2002:a17:902:b187:: with SMTP id s7mr6867853plr.84.1583390709564; Wed, 04 Mar 2020 22:45:09 -0800 (PST) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id l13sm4722550pjq.23.2020.03.04.22.45.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Mar 2020 22:45:08 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , lance.richardson@broadcom.com, stable@dpdk.org Date: Wed, 4 Mar 2020 22:45:00 -0800 Message-Id: <20200305064500.5634-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] net/bnxt: allow configuring vector mode 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 bnxt driver has vector mode but it has limitations. For example, rte_flow mark won't work in vector mode. For this reason the user should be able to disable vector mode as part of the config. Make the configuration use the same as other drivers with vector mode: ixge, i40e, ... This will also make future support of vector mode on other architectures possible. Fixes: bc4a000f2f53 ("net/bnxt: implement SSE vector mode") Cc: lance.richardson@broadcom.com Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger --- config/common_base | 1 + drivers/net/bnxt/Makefile | 2 +- drivers/net/bnxt/bnxt_ethdev.c | 10 +++------- drivers/net/bnxt/bnxt_ring.c | 4 ++-- drivers/net/bnxt/bnxt_rxr.c | 3 +++ 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/config/common_base b/config/common_base index 7ca2f28b19c8..3c719c7cbfc3 100644 --- a/config/common_base +++ b/config/common_base @@ -219,6 +219,7 @@ CONFIG_RTE_LIBRTE_BNX2X_DEBUG_PERIODIC=n # Compile burst-oriented Broadcom BNXT PMD driver # CONFIG_RTE_LIBRTE_BNXT_PMD=y +CONFIG_RTE_LIBRTE_BNXT_INC_VECTOR=y # # Compile burst-oriented Chelsio Terminator (CXGBE) PMD diff --git a/drivers/net/bnxt/Makefile b/drivers/net/bnxt/Makefile index b77532b8179b..85d6df6b5aa0 100644 --- a/drivers/net/bnxt/Makefile +++ b/drivers/net/bnxt/Makefile @@ -40,7 +40,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_irq.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_util.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += rte_pmd_bnxt.c ifeq ($(CONFIG_RTE_ARCH_X86), y) -SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_rxtx_vec_sse.c +SRCS-$(CONFIG_RTE_LIBRTE_BNXT_INC_VECTOR) += bnxt_rxtx_vec_sse.c endif # diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 18aa313fd8c1..701de33784b2 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -757,8 +757,7 @@ bnxt_receive_function(struct rte_eth_dev *eth_dev) { struct bnxt *bp = eth_dev->data->dev_private; -#ifdef RTE_ARCH_X86 -#ifndef RTE_LIBRTE_IEEE1588 +#ifdef RTE_BNXT_INC_VECTOR /* * Vector mode receive can be enabled only if scatter rx is not * in use and rx offloads are limited to VLAN stripping and @@ -787,7 +786,6 @@ bnxt_receive_function(struct rte_eth_dev *eth_dev) eth_dev->data->port_id, eth_dev->data->scattered_rx, eth_dev->data->dev_conf.rxmode.offloads); -#endif #endif bp->flags &= ~BNXT_FLAG_RX_VECTOR_PKT_MODE; return bnxt_recv_pkts; @@ -796,8 +794,7 @@ bnxt_receive_function(struct rte_eth_dev *eth_dev) static eth_tx_burst_t bnxt_transmit_function(__rte_unused struct rte_eth_dev *eth_dev) { -#ifdef RTE_ARCH_X86 -#ifndef RTE_LIBRTE_IEEE1588 +#ifdef RTE_BNXT_INC_VECTOR /* * Vector mode transmit can be enabled only if not using scatter rx * or tx offloads. @@ -815,7 +812,6 @@ bnxt_transmit_function(__rte_unused struct rte_eth_dev *eth_dev) eth_dev->data->port_id, eth_dev->data->scattered_rx, eth_dev->data->dev_conf.txmode.offloads); -#endif #endif return bnxt_xmit_pkts; } @@ -2234,7 +2230,7 @@ int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu) new_pkt_size = new_mtu + RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + VLAN_TAG_SIZE * BNXT_NUM_VLANS; -#ifdef RTE_ARCH_X86 +#ifdef RTE_BNXT_INC_VECTOR /* * If vector-mode tx/rx is active, disallow any MTU change that would * require scattered receive support. diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c index d6e4e8a28138..9a4a0f21418d 100644 --- a/drivers/net/bnxt/bnxt_ring.c +++ b/drivers/net/bnxt/bnxt_ring.c @@ -608,7 +608,7 @@ int bnxt_alloc_hwrm_rx_ring(struct bnxt *bp, int queue_index) bnxt_db_write(&rxr->ag_db, rxr->ag_prod); } rxq->index = queue_index; -#ifdef RTE_ARCH_X86 +#ifdef RTE_BNXT_INC_VECTOR bnxt_rxq_vec_setup(rxq); #endif @@ -713,7 +713,7 @@ int bnxt_alloc_hwrm_rings(struct bnxt *bp) bnxt_db_write(&rxr->rx_db, rxr->rx_prod); bnxt_db_write(&rxr->ag_db, rxr->ag_prod); rxq->index = i; -#ifdef RTE_ARCH_X86 +#ifdef RTE_BNXT_INC_VECTOR bnxt_rxq_vec_setup(rxq); #endif } diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c index bef9720f590c..f9087bea89b9 100644 --- a/drivers/net/bnxt/bnxt_rxr.c +++ b/drivers/net/bnxt/bnxt_rxr.c @@ -18,6 +18,9 @@ #include "hsi_struct_def_dpdk.h" #ifdef RTE_LIBRTE_IEEE1588 #include "bnxt_hwrm.h" +#ifdef RTE_BNXT_INC_VECTOR +#error "bnxt: IEEE1588 is incompatiable with vector mode" +#endif #endif /* -- 2.20.1