From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0E034A00C3; Thu, 20 Jan 2022 09:43:49 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EF14C41C2E; Thu, 20 Jan 2022 09:43:48 +0100 (CET) Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) by mails.dpdk.org (Postfix) with ESMTP id B67A240042 for ; Thu, 20 Jan 2022 09:43:47 +0100 (CET) Received: by mail-io1-f54.google.com with SMTP id w7so6095629ioj.5 for ; Thu, 20 Jan 2022 00:43:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ZG2M9/L5W7xs1VsLLDtVyKpwMage/3k/AhSBYnlMrYc=; b=eU4GM/Ac2jckdLV3o9XN9x9vPsjn1emxQo+GGNw99/V4ZZRevlinDslf3pi1H8FExE 6Xq8Hz7EFIgGhClPNf7aOHDyp+OAc8sJzSnH65YSPefYl++RWP5iv6S7rqQ6rmZ7v/rJ YOnM0Co81aizov5ZqOhz99GUbcy4F6agbhPxrWAWoRjNq/eOe6na4mPnEBqBuoGxoyyP qJq6fanxH05A0ralw8yQUWGcGjHHlRZohBYkYCTFyIGJ1WThcMCMrjVYi3EMyFoA9bwO 3ORs8WjWfzlnqGeS1AWVeknxEyHqOho1aDpBjZRqq6krpE40lUatHa7mlV5UHEC3zZ3L XXrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ZG2M9/L5W7xs1VsLLDtVyKpwMage/3k/AhSBYnlMrYc=; b=dCX0yKH8uUcCQG67CUzSiS4W3ZUqgyFQXqDw39eW2ALopqN6ZS8ssVTlzimRh9QGau JPHG+SkwVECdhvbWg+ohaJ/BILKLtNU3+xWcJ0JXpPtjtgmTwpUxw+oss+L/oO9yMXoD azhgl/TsaGXQZa2CMyV+1ycUegVczihTZJQ18qnDxNIz0FxBGgGEiH2+jAK+HAhUUXCl i58Uae4RaQv5l7gFXSchnIjI0XSBv4qEwEu6LJXOHkXkbO4CemCF8x7t0EhtzOqZMYtP jsqNvsPAHKZB8SM+EfyGSEqqfAPDEtopwrOTAkugwCI3BHTvSWCJ9y7qOJebgxpVzNkJ zacA== X-Gm-Message-State: AOAM530ZpkLUKYcS/npgno1D9NKOyzMghbvSDyhw8KVqc+QSz5/I3K3x ttVESxGqlqEb3ityfOewh89mwgSAWqcbdt051uI= X-Google-Smtp-Source: ABdhPJyqoQy7WrdQUxHOkQ+i5cJieqjhp1Zd+prlNq9cpRhLTLJCBytY2FidX2IXSzro3BOTppxfkiRA0fbsLslgx0M= X-Received: by 2002:a05:6602:200b:: with SMTP id y11mr17925913iod.121.1642668226008; Thu, 20 Jan 2022 00:43:46 -0800 (PST) MIME-Version: 1.0 References: <20211130064147.1023321-1-rkudurumalla@marvell.com> <20220113122807.1570511-1-rkudurumalla@marvell.com> In-Reply-To: <20220113122807.1570511-1-rkudurumalla@marvell.com> From: Jerin Jacob Date: Thu, 20 Jan 2022 14:13:19 +0530 Message-ID: Subject: Re: [PATCH v3 1/2] net/cnxk: update meter bpf ID in Receive Queue To: Rakesh Kudurumalla , Ferruh Yigit Cc: Jerin Jacob , Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , dpdk-dev , Sunil Kumar Kori Content-Type: text/plain; charset="UTF-8" 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 On Thu, Jan 13, 2022 at 5:58 PM Rakesh Kudurumalla wrote: > > Patch updates configured meter bpf is in receive queue > context during meter creation > > Signed-off-by: Rakesh Kudurumalla > Acked-by: Sunil Kumar Kori Series Acked-by: Jerin Jacob Series applied to dpdk-next-net-mrvl/for-next-net with following git log update. Thanks. Author: Rakesh Kudurumalla Date: Thu Jan 13 17:58:07 2022 +0530 common/cnxk: update meter algorithm in band profile Update meter algorithm in NIX's band profile structure. Signed-off-by: Rakesh Kudurumalla Acked-by: Sunil Kumar Kori Acked-by: Jerin Jacob Author: Rakesh Kudurumalla Date: Thu Jan 13 17:58:06 2022 +0530 net/cnxk: update meter BPF ID in Receive Queue Patch updates configured meter BPF(Bandwidth profile) ID is in receive queue context during meter creation. Signed-off-by: Rakesh Kudurumalla Acked-by: Sunil Kumar Kori Acked-by: Jerin Jacob > --- > v3: Fix commit message spelling > drivers/net/cnxk/cn10k_rte_flow.c | 7 +++---- > drivers/net/cnxk/cnxk_ethdev_mtr.c | 21 ++++++++++++++++----- > 2 files changed, 19 insertions(+), 9 deletions(-) > > diff --git a/drivers/net/cnxk/cn10k_rte_flow.c b/drivers/net/cnxk/cn10k_rte_flow.c > index b830abe63e..529fb0e4b7 100644 > --- a/drivers/net/cnxk/cn10k_rte_flow.c > +++ b/drivers/net/cnxk/cn10k_rte_flow.c > @@ -36,20 +36,20 @@ cn10k_mtr_configure(struct rte_eth_dev *eth_dev, > for (i = 0; actions[i].type != RTE_FLOW_ACTION_TYPE_END; i++) { > if (actions[i].type == RTE_FLOW_ACTION_TYPE_METER) { > mtr_conf = (const struct rte_flow_action_meter > - *)(actions->conf); > + *)(actions[i].conf); > mtr_id = mtr_conf->mtr_id; > is_mtr_act = true; > } > if (actions[i].type == RTE_FLOW_ACTION_TYPE_QUEUE) { > q_conf = (const struct rte_flow_action_queue > - *)(actions->conf); > + *)(actions[i].conf); > if (is_mtr_act) > nix_mtr_rq_update(eth_dev, mtr_id, 1, > &q_conf->index); > } > if (actions[i].type == RTE_FLOW_ACTION_TYPE_RSS) { > rss_conf = (const struct rte_flow_action_rss > - *)(actions->conf); > + *)(actions[i].conf); > if (is_mtr_act) > nix_mtr_rq_update(eth_dev, mtr_id, > rss_conf->queue_num, > @@ -171,7 +171,6 @@ cn10k_flow_create(struct rte_eth_dev *eth_dev, const struct rte_flow_attr *attr, > return NULL; > } > } > - > for (i = 0; actions[i].type != RTE_FLOW_ACTION_TYPE_END; i++) { > if (actions[i].type == RTE_FLOW_ACTION_TYPE_METER) { > mtr = (const struct rte_flow_action_meter *)actions[i] > diff --git a/drivers/net/cnxk/cnxk_ethdev_mtr.c b/drivers/net/cnxk/cnxk_ethdev_mtr.c > index 39d8563826..cc783e5f86 100644 > --- a/drivers/net/cnxk/cnxk_ethdev_mtr.c > +++ b/drivers/net/cnxk/cnxk_ethdev_mtr.c > @@ -35,7 +35,6 @@ static struct rte_mtr_capabilities mtr_capa = { > .chaining_n_mtrs_per_flow_max = NIX_MTR_COUNT_PER_FLOW, > .chaining_use_prev_mtr_color_supported = true, > .chaining_use_prev_mtr_color_enforced = true, > - .meter_rate_max = NIX_BPF_RATE_MAX / 8, /* Bytes per second */ > .color_aware_srtcm_rfc2697_supported = true, > .color_aware_trtcm_rfc2698_supported = true, > .color_aware_trtcm_rfc4115_supported = true, > @@ -180,13 +179,13 @@ cnxk_nix_mtr_capabilities_get(struct rte_eth_dev *dev, > struct rte_mtr_capabilities *capa, > struct rte_mtr_error *error) > { > - struct cnxk_eth_dev *eth_dev = cnxk_eth_pmd_priv(dev); > - uint16_t count[ROC_NIX_BPF_LEVEL_MAX] = {0}; > uint8_t lvl_mask = ROC_NIX_BPF_LEVEL_F_LEAF | ROC_NIX_BPF_LEVEL_F_MID | > ROC_NIX_BPF_LEVEL_F_TOP; > + struct cnxk_eth_dev *eth_dev = cnxk_eth_pmd_priv(dev); > + uint16_t count[ROC_NIX_BPF_LEVEL_MAX] = {0}; > struct roc_nix *nix = ð_dev->nix; > - int rc; > - int i; > + uint32_t time_unit; > + int rc, i; > > RTE_SET_USED(dev); > > @@ -207,6 +206,15 @@ cnxk_nix_mtr_capabilities_get(struct rte_eth_dev *dev, > mtr_capa.meter_trtcm_rfc4115_n_max = mtr_capa.n_max; > mtr_capa.meter_policy_n_max = mtr_capa.n_max; > > + rc = roc_nix_bpf_timeunit_get(nix, &time_unit); > + if (rc) > + return rc; > + > + mtr_capa.meter_rate_max = > + NIX_BPF_RATE(time_unit, NIX_BPF_MAX_RATE_EXPONENT, > + NIX_BPF_MAX_RATE_MANTISSA, 0) / > + 8; > + > *capa = mtr_capa; > return 0; > } > @@ -304,6 +312,9 @@ cnxk_nix_mtr_policy_validate(struct rte_eth_dev *dev, > if (action->type == RTE_FLOW_ACTION_TYPE_DROP) > supported[i] = true; > > + if (action->type == RTE_FLOW_ACTION_TYPE_VOID) > + supported[i] = true; > + > if (!supported[i]) { > sprintf(message, > "%s action is not valid", > -- > 2.25.1 >