From patchwork Fri Jan 22 19:19:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liron Himi X-Patchwork-Id: 87148 X-Patchwork-Delegate: jerinj@marvell.com 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 66510A0A0A; Fri, 22 Jan 2021 20:24:36 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B7159141199; Fri, 22 Jan 2021 20:21:03 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 7A9C4141195 for ; Fri, 22 Jan 2021 20:21:02 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 10MJBKwC016567 for ; Fri, 22 Jan 2021 11:21:01 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=S6zqVZytA2HBop6GHaJEF0r3A8cw0fum3Av4SGHbbfA=; b=L/WgbyE37KobWS2o2mzqgnsXy6YT8OVYLFxhRfMOF/8MrnV6lLk1BjSOtSGWbgB4tdMD CkMIv2vUDsvSXXXvLGed4LSYzQreI4BSh83jvDtUgL7lUfW1nsV7C1MvDpw07EGGjeoQ IGBi5aoEwFdpi/aU0PpgDB8I9USushHaZ0Gr7NESRAznXS4ZrrPrLvbVryKBKb7n6xdu hSN8w193o5Dy6DpcycjQG7VIK4YD4JO9bB6pMklTe2HL2MnDY30cdqNi/3psPzgEkoWv Gcu+7qusIfwv0Mr/ZJznEbJpS0dB5NurBXkSp/hB6mt384ElSLJAXwC9CpKpiAIMZevx 3Q== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com with ESMTP id 3668p7tphn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Fri, 22 Jan 2021 11:21:01 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 22 Jan 2021 11:20:57 -0800 Received: from pt-lxl0023.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 22 Jan 2021 11:20:56 -0800 From: To: CC: , Dana Vardi , Liron Himi Date: Fri, 22 Jan 2021 21:19:25 +0200 Message-ID: <20210122191925.24308-38-lironh@marvell.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210122191925.24308-1-lironh@marvell.com> References: <20201202101212.4717-1-lironh@marvell.com> <20210122191925.24308-1-lironh@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.343, 18.0.737 definitions=2021-01-22_14:2021-01-22, 2021-01-22 signatures=0 Subject: [dpdk-dev] [PATCH v2 37/37] net/mvpp2: add fill buffs to configuration file 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: Dana Vardi Extend config file with 'fill_bpool_buffs' which control the amount of refill buffers Signed-off-by: Dana Vardi Reviewed-by: Liron Himi --- drivers/net/mvpp2/mrvl_ethdev.c | 7 ++++--- drivers/net/mvpp2/mrvl_ethdev.h | 3 +++ drivers/net/mvpp2/mrvl_qos.c | 21 +++++++++++++++++++++ drivers/net/mvpp2/mrvl_qos.h | 1 + 4 files changed, 29 insertions(+), 3 deletions(-) diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c index 878868b30..68e7bd7d0 100644 --- a/drivers/net/mvpp2/mrvl_ethdev.c +++ b/drivers/net/mvpp2/mrvl_ethdev.c @@ -52,8 +52,6 @@ #define MRVL_IFACE_NAME_ARG "iface" #define MRVL_CFG_ARG "cfg" -#define MRVL_BURST_SIZE 64 - #define MRVL_ARP_LENGTH 28 #define MRVL_COOKIE_ADDR_INVALID ~0ULL @@ -821,12 +819,15 @@ mrvl_dev_start(struct rte_eth_dev *dev) priv->ppio_params.match = match; priv->ppio_params.eth_start_hdr = PP2_PPIO_HDR_ETH; priv->forward_bad_frames = 0; + priv->fill_bpool_buffs = MRVL_BURST_SIZE; if (mrvl_cfg) { priv->ppio_params.eth_start_hdr = mrvl_cfg->port[dev->data->port_id].eth_start_hdr; priv->forward_bad_frames = mrvl_cfg->port[dev->data->port_id].forward_bad_frames; + priv->fill_bpool_buffs = + mrvl_cfg->port[dev->data->port_id].fill_bpool_buffs; } /* @@ -2763,7 +2764,7 @@ mrvl_rx_pkt_burst(void *rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) if (unlikely(num <= q->priv->bpool_min_size || (!rx_done && num < q->priv->bpool_init_size))) { - mrvl_fill_bpool(q, MRVL_BURST_SIZE); + mrvl_fill_bpool(q, q->priv->fill_bpool_buffs); } else if (unlikely(num > q->priv->bpool_max_size)) { int i; int pkt_to_remove = num - q->priv->bpool_init_size; diff --git a/drivers/net/mvpp2/mrvl_ethdev.h b/drivers/net/mvpp2/mrvl_ethdev.h index 8d5469c9d..fda239a53 100644 --- a/drivers/net/mvpp2/mrvl_ethdev.h +++ b/drivers/net/mvpp2/mrvl_ethdev.h @@ -82,6 +82,8 @@ /** Maximum length of a match string */ #define MRVL_MATCH_LEN 16 +#define MRVL_BURST_SIZE 64 + /** PMD-specific definition of a flow rule handle. */ struct mrvl_mtr; struct rte_flow { @@ -183,6 +185,7 @@ struct mrvl_priv { uint64_t rate_max; uint8_t forward_bad_frames; + uint32_t fill_bpool_buffs; }; /** Flow operations forward declaration. */ diff --git a/drivers/net/mvpp2/mrvl_qos.c b/drivers/net/mvpp2/mrvl_qos.c index a41558488..dbfc3b5d2 100644 --- a/drivers/net/mvpp2/mrvl_qos.c +++ b/drivers/net/mvpp2/mrvl_qos.c @@ -79,6 +79,9 @@ /* parser forward bad frames tokens */ #define MRVL_TOK_FWD_BAD_FRAMES "forward_bad_frames" +/* parse fill bpool buffers tokens */ +#define MRVL_TOK_FILL_BPOOL_BUFFS "fill_bpool_buffs" + /** Number of tokens in range a-b = 2. */ #define MAX_RNG_TOKENS 2 @@ -720,6 +723,11 @@ mrvl_get_cfg(const char *key __rte_unused, const char *path, void *extra_args) /* Use global defaults, unless an override occurs */ (*cfg)->port[n].use_qos_global_defaults = 1; + /* Set non-zero defaults before the decision to continue to next + * port or to parse the port section in config file + */ + (*cfg)->port[n].fill_bpool_buffs = MRVL_BURST_SIZE; + /* Skip ports non-existing in configuration. */ if (rte_cfgfile_num_sections(file, sec_name, strlen(sec_name)) <= 0) { @@ -889,6 +897,19 @@ mrvl_get_cfg(const char *key __rte_unused, const char *path, void *extra_args) } else { (*cfg)->port[n].forward_bad_frames = 0; } + + /* Parse fill bpool buffs option */ + entry = rte_cfgfile_get_entry(file, sec_name, + MRVL_TOK_FILL_BPOOL_BUFFS); + if (entry) { + if (get_val_securely(entry, &val) < 0) { + MRVL_LOG(ERR, + "Error in parsing %s value (%s)!\n", + MRVL_TOK_FILL_BPOOL_BUFFS, entry); + return -1; + } + (*cfg)->port[n].fill_bpool_buffs = val; + } } return 0; diff --git a/drivers/net/mvpp2/mrvl_qos.h b/drivers/net/mvpp2/mrvl_qos.h index 763130bf1..38ea309ca 100644 --- a/drivers/net/mvpp2/mrvl_qos.h +++ b/drivers/net/mvpp2/mrvl_qos.h @@ -49,6 +49,7 @@ struct mrvl_cfg { struct pp2_cls_plcr_params policer_params; uint8_t setup_policer; uint8_t forward_bad_frames; + uint32_t fill_bpool_buffs; } port[RTE_MAX_ETHPORTS]; };