From patchwork Thu May 27 15:25:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Rybchenko X-Patchwork-Id: 93509 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 16874A0546; Thu, 27 May 2021 17:27:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6404C4113A; Thu, 27 May 2021 17:26:06 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 3243C41105 for ; Thu, 27 May 2021 17:26:02 +0200 (CEST) Received: by shelob.oktetlabs.ru (Postfix, from userid 122) id 058687F5FC; Thu, 27 May 2021 18:26:02 +0300 (MSK) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shelob.oktetlabs.ru X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=ALL_TRUSTED, DKIM_ADSP_DISCARD, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from aros.oktetlabs.ru (aros.oktetlabs.ru [192.168.38.17]) by shelob.oktetlabs.ru (Postfix) with ESMTP id A50BF7F603; Thu, 27 May 2021 18:25:42 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru A50BF7F603 Authentication-Results: shelob.oktetlabs.ru/A50BF7F603; dkim=none; dkim-atps=neutral From: Andrew Rybchenko To: dev@dpdk.org Cc: Igor Romanov , Andy Moreton Date: Thu, 27 May 2021 18:25:00 +0300 Message-Id: <20210527152510.1551026-11-andrew.rybchenko@oktetlabs.ru> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210527152510.1551026-1-andrew.rybchenko@oktetlabs.ru> References: <20210527152510.1551026-1-andrew.rybchenko@oktetlabs.ru> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 10/20] net/sfc: add support for initialising different RxQ types X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" From: Igor Romanov Add extra EFX flags to RxQ info initialization API to support choosing different RxQ types and make the API public to use it in for counter queues. Signed-off-by: Igor Romanov Signed-off-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- drivers/net/sfc/sfc_rx.c | 10 ++++++---- drivers/net/sfc/sfc_rx.h | 2 ++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c index 597785ae02..c7a7bd66ef 100644 --- a/drivers/net/sfc/sfc_rx.c +++ b/drivers/net/sfc/sfc_rx.c @@ -1155,7 +1155,7 @@ sfc_rx_qinit(struct sfc_adapter *sa, sfc_sw_index_t sw_index, else rxq_info->type = EFX_RXQ_TYPE_DEFAULT; - rxq_info->type_flags = + rxq_info->type_flags |= (offloads & DEV_RX_OFFLOAD_SCATTER) ? EFX_RXQ_FLAG_SCATTER : EFX_RXQ_FLAG_NONE; @@ -1594,8 +1594,9 @@ sfc_rx_stop(struct sfc_adapter *sa) efx_rx_fini(sa->nic); } -static int -sfc_rx_qinit_info(struct sfc_adapter *sa, sfc_sw_index_t sw_index) +int +sfc_rx_qinit_info(struct sfc_adapter *sa, sfc_sw_index_t sw_index, + unsigned int extra_efx_type_flags) { struct sfc_adapter_shared * const sas = sfc_sa2shared(sa); struct sfc_rxq_info *rxq_info = &sas->rxq_info[sw_index]; @@ -1606,6 +1607,7 @@ sfc_rx_qinit_info(struct sfc_adapter *sa, sfc_sw_index_t sw_index) SFC_ASSERT(rte_is_power_of_2(max_entries)); rxq_info->max_entries = max_entries; + rxq_info->type_flags = extra_efx_type_flags; return 0; } @@ -1770,7 +1772,7 @@ sfc_rx_configure(struct sfc_adapter *sa) sw_index = sfc_rxq_sw_index_by_ethdev_rx_qid(sas, sas->ethdev_rxq_count); - rc = sfc_rx_qinit_info(sa, sw_index); + rc = sfc_rx_qinit_info(sa, sw_index, 0); if (rc != 0) goto fail_rx_qinit_info; diff --git a/drivers/net/sfc/sfc_rx.h b/drivers/net/sfc/sfc_rx.h index 96c7dc415d..e5a6fde79b 100644 --- a/drivers/net/sfc/sfc_rx.h +++ b/drivers/net/sfc/sfc_rx.h @@ -129,6 +129,8 @@ void sfc_rx_close(struct sfc_adapter *sa); int sfc_rx_start(struct sfc_adapter *sa); void sfc_rx_stop(struct sfc_adapter *sa); +int sfc_rx_qinit_info(struct sfc_adapter *sa, sfc_sw_index_t sw_index, + unsigned int extra_efx_type_flags); int sfc_rx_qinit(struct sfc_adapter *sa, unsigned int rx_queue_id, uint16_t nb_rx_desc, unsigned int socket_id, const struct rte_eth_rxconf *rx_conf,