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 1B2E641C54; Thu, 9 Feb 2023 18:15:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 08B47410EA; Thu, 9 Feb 2023 18:15:09 +0100 (CET) Received: from mail-vs1-f51.google.com (mail-vs1-f51.google.com [209.85.217.51]) by mails.dpdk.org (Postfix) with ESMTP id 8642B40EDC for ; Thu, 9 Feb 2023 18:15:08 +0100 (CET) Received: by mail-vs1-f51.google.com with SMTP id g3so2826254vsr.10 for ; Thu, 09 Feb 2023 09:15:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Zb8N4HQT6EqtuCGUeajmzdKQfnz89OVx3e1Shr8vYdc=; b=jZQ5GAzGN4Jm62L1dO6+WDLn9gSC+q1OcUBd+FzsL/b2ojKiAG2t98TG67nclKtjbe 0disQxVvnJ2WBYnjiN1o+MeQ2KzvmvfIh4VRPC3eYASTOQbQ4YEmsjPwU+ZpmN+LESsH HGZj2Xopf7Bk/9elh0Ep8csZMdnlTufbMd5RPzEiHMXf/r1OdjGYyTzD7zEgpAqubI3y 8SL8YGIh/WkrM+Ou140JooqDpkYVYLCHqzDS8hfzhyuw2FKzCft+TuIJOw45Q2A+1Qta Y6pDhwqr+wtoZsj+E2vX7gmNXACDevYKNgnrVaAnzHLpkxa4vkFTgUXLJHxJufV8hgKQ zgpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Zb8N4HQT6EqtuCGUeajmzdKQfnz89OVx3e1Shr8vYdc=; b=D7yxF15CKZvUDbtTqOywuvyMYcGSjKwozeThfgKJWQ7yYbAlDhz7A60+yb8SfHeGei j6JJUZyl4r2+uVW3Md1F/eG//OGVJnzNXzOUGonpJTtYA07LFwVC9rnR+x0wzY2bX0hB 0XvVFLLQDQDDZiUVhuARqCHVuIMdIPuoezjB7J3Wu5LvMHltLwgnOCqT81Eq+B7BcxfC EffNBRHzu/W/FKZ2o/LsNFG9UcjI0dl17tk5n8cZ/oLbchmk6BMpep8zbshYyuARTSK5 j78BD5qxGg7woQ7Qq5d0za0+7Q1bYVm0RJBjB4XJLaGtzlnkKJImKFkMJM3j/0PjCHjN IQfg== X-Gm-Message-State: AO0yUKU8fd6zcng+DVaUL3DKg+46dqSBK3tf0aAlJ71MmZ5EHEWlDZ5J PTahmY8eIaDv3zkvzaOrDQWJMwLJjpQcFRAi/OU= X-Google-Smtp-Source: AK7set9lcCe93b/hOVefQZCmTjPNEGzao5sbkM6s0tX6Z19YR5rwyKrBC6XyKGy31yfbMHzRGRZdZAPb/IASXU1/x8o= X-Received: by 2002:a05:6102:5c1a:b0:3fe:3011:1976 with SMTP id ds26-20020a0561025c1a00b003fe30111976mr2740810vsb.52.1675962907803; Thu, 09 Feb 2023 09:15:07 -0800 (PST) MIME-Version: 1.0 References: <20230209072402.957747-1-rkudurumalla@marvell.com> <20230209083558.958566-1-rkudurumalla@marvell.com> <20230209083558.958566-3-rkudurumalla@marvell.com> In-Reply-To: <20230209083558.958566-3-rkudurumalla@marvell.com> From: Jerin Jacob Date: Thu, 9 Feb 2023 22:44:41 +0530 Message-ID: Subject: Re: [PATCH v4 3/3] net/cnxk: skip red drop for ingress policer To: Rakesh Kudurumalla Cc: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , jerinj@marvell.com, dev@dpdk.org 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, Feb 9, 2023 at 2:06 PM Rakesh Kudurumalla wrote: > > Dropping of packets is based on action configured > to meter.If both skip_red and drop actions are configured > then tail dropping in invoked else if only drop action is > configured then RED drop is invoked.This action is supported > only when RED is configured using rte_eth_cman_config_set() > > Signed-off-by: Rakesh Kudurumalla Fix CI reported issue at http://mails.dpdk.org/archives/test-report/2023-February/350229.html https://patches.dpdk.org/project/dpdk/patch/20230209083558.958566-3-rkudurumalla@marvell.com/ > --- > doc/guides/nics/features/cnxk.ini | 1 + > drivers/net/cnxk/cnxk_ethdev.h | 1 + > drivers/net/cnxk/cnxk_ethdev_mtr.c | 50 ++++++++++++++++++++++++++++++ > 3 files changed, 52 insertions(+) > > diff --git a/doc/guides/nics/features/cnxk.ini b/doc/guides/nics/features/cnxk.ini > index f81628da77..753da67c5a 100644 > --- a/doc/guides/nics/features/cnxk.ini > +++ b/doc/guides/nics/features/cnxk.ini > @@ -80,6 +80,7 @@ vxlan_gpe = Y > > [rte_flow actions] > count = Y > +skip_cman = Y > drop = Y > flag = Y > mark = Y > diff --git a/drivers/net/cnxk/cnxk_ethdev.h b/drivers/net/cnxk/cnxk_ethdev.h > index f0eab4244c..ba35873124 100644 > --- a/drivers/net/cnxk/cnxk_ethdev.h > +++ b/drivers/net/cnxk/cnxk_ethdev.h > @@ -168,6 +168,7 @@ struct policy_actions { > uint16_t queue; > uint32_t mtr_id; > struct action_rss *rss_desc; > + bool skip_red; > }; > }; > > diff --git a/drivers/net/cnxk/cnxk_ethdev_mtr.c b/drivers/net/cnxk/cnxk_ethdev_mtr.c > index dcfa4223d5..27a6e4ef3d 100644 > --- a/drivers/net/cnxk/cnxk_ethdev_mtr.c > +++ b/drivers/net/cnxk/cnxk_ethdev_mtr.c > @@ -358,6 +358,9 @@ cnxk_nix_mtr_policy_validate(struct rte_eth_dev *dev, > if (action->type == RTE_FLOW_ACTION_TYPE_VOID) > supported[i] = true; > > + if (action->type == RTE_FLOW_ACTION_TYPE_SKIP_CMAN) > + supported[i] = true; > + > if (!supported[i]) > return update_mtr_err(i, error, true); > } > @@ -397,6 +400,10 @@ cnxk_fill_policy_actions(struct cnxk_mtr_policy_node *fmp, > fmp->actions[i].action_fate = > action->type; > } > + > + if (action->type == > + RTE_FLOW_ACTION_TYPE_SKIP_CMAN) > + fmp->actions[i].skip_red = true; > } > } > } > @@ -1306,6 +1313,45 @@ nix_mtr_config_map(struct cnxk_meter_node *mtr, struct roc_nix_bpf_cfg *cfg) > cfg->action[ROC_NIX_BPF_COLOR_RED] = ROC_NIX_BPF_ACTION_DROP; > } > > +static void > +nix_mtr_config_red(struct cnxk_meter_node *mtr, struct roc_nix_rq *rq, > + struct roc_nix_bpf_cfg *cfg) > +{ > + struct cnxk_mtr_policy_node *policy = mtr->policy; > + > + if ((rq->red_pass && rq->red_pass >= rq->red_drop) || > + (rq->spb_red_pass && rq->spb_red_pass >= rq->spb_red_drop) || > + (rq->xqe_red_pass && rq->xqe_red_pass >= rq->xqe_red_drop)) { > + if (policy->actions[RTE_COLOR_GREEN].action_fate == > + RTE_FLOW_ACTION_TYPE_DROP) { > + if (policy->actions[RTE_COLOR_GREEN].skip_red) > + cfg->action[ROC_NIX_BPF_COLOR_GREEN] = > + ROC_NIX_BPF_ACTION_DROP; > + else > + cfg->action[ROC_NIX_BPF_COLOR_GREEN] = > + ROC_NIX_BPF_ACTION_RED; > + } > + if (policy->actions[RTE_COLOR_YELLOW].action_fate == > + RTE_FLOW_ACTION_TYPE_DROP) { > + if (policy->actions[RTE_COLOR_YELLOW].skip_red) > + cfg->action[ROC_NIX_BPF_COLOR_YELLOW] = > + ROC_NIX_BPF_ACTION_DROP; > + else > + cfg->action[ROC_NIX_BPF_COLOR_YELLOW] = > + ROC_NIX_BPF_ACTION_RED; > + } > + if (policy->actions[RTE_COLOR_RED].action_fate == > + RTE_FLOW_ACTION_TYPE_DROP) { > + if (policy->actions[RTE_COLOR_RED].skip_red) > + cfg->action[ROC_NIX_BPF_COLOR_RED] = > + ROC_NIX_BPF_ACTION_DROP; > + else > + cfg->action[ROC_NIX_BPF_COLOR_RED] = > + ROC_NIX_BPF_ACTION_RED; > + } > + } > +} > + > static void > nix_precolor_table_map(struct cnxk_meter_node *mtr, > struct roc_nix_bpf_precolor *tbl, > @@ -1483,6 +1529,10 @@ nix_mtr_configure(struct rte_eth_dev *eth_dev, uint32_t id) > if (!mtr[i]->is_used) { > memset(&cfg, 0, sizeof(struct roc_nix_bpf_cfg)); > nix_mtr_config_map(mtr[i], &cfg); > + for (j = 0; j < mtr[i]->rq_num; j++) { > + rq = &dev->rqs[mtr[i]->rq_id[j]]; > + nix_mtr_config_red(mtr[i], rq, &cfg); > + } > rc = roc_nix_bpf_config(nix, mtr[i]->bpf_id, > lvl_map[mtr[i]->level], > &cfg); > -- > 2.25.1 >