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 4463A41CA4; Wed, 15 Feb 2023 10:45:30 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2CDAD40EE3; Wed, 15 Feb 2023 10:45:30 +0100 (CET) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2067.outbound.protection.outlook.com [40.107.102.67]) by mails.dpdk.org (Postfix) with ESMTP id 9D06840A8B for ; Wed, 15 Feb 2023 10:45:28 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J2E5Xy5EgtmrRgZG5yG1fmo/1DO9Az95ax80U/1YhD7bc5tuqyKGKOpLSd1vewPyMahTNCFTqudgep2c2IrExwQKr6ptDzGcmK680OnXt2nJ62diu5ojvX0iCaPhFwsZfYt7jlwKq/h1KzM6qzxZaKsxn4SQaICKKCHvVtmPaSaZanlqVNzVc/yzvSAuMtjRPXqy17b+9rdqpMj+XcjdgDkRARBSilbQMgg+aIv8HiDc9iyfyB7rpwFxX0xrrN+BJkXUjJk8S85GPhwxen2gxDvfXfbYKz6Qk1A3oWjYkwHSL77DtPlCeRIEPxqPeK2pSymm//B+Ff9gD7vhti8ikw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ti9SrUI/V7jV2qM3pucXVwrlGdLamlwthsn5p09B4u0=; b=Jaij+Kr5rzktw1RH3BJh4/FTz5EZswqlGMFto91R23C1di7iszbCbIQg6MZP2AS8ppD49Ku7nLNyXTHRVAEoKcCCtjjEd4uILcX7WpL5mY5z026b9jMA3EYaYXEcumGozzKoe7ei1skY2bBMhcyhSTxL2G1A/pMibHGexqgqlvl5h72pOsh1z1tmRpQ1YrJ0AGIV93cBKts5rR6Bi3WNmcrBhdVilv6hbF7SqiExJGNA13hIeKz9+HQvQ35+9cqsDsq4JTgxdNkk03m6amSsjlEc9qcDxQ2gO9+HZRGUnniQR5/QZ+MtYVSUk2/uxXSaak9L5El3kBxNhutx9pOEow== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ti9SrUI/V7jV2qM3pucXVwrlGdLamlwthsn5p09B4u0=; b=ByXWPMVwPawTVfnPyEjN/u0CMIWdzrIXvBC7N+UFvA1GoL9tc/kkbqHHsHXEL0dCfMCW2i+IM9rFMwUkYpm8YscWy/S7rjA+4J8IdJPUcjzAAgHJWvmT8qIvjptVceGW5cAOGK6jgebpm8qd5pSzmX3sN1c05em1UsDgdSwA+lU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by MN2PR12MB4048.namprd12.prod.outlook.com (2603:10b6:208:1d5::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.26; Wed, 15 Feb 2023 09:45:26 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3614:22ed:ed5:5b48]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3614:22ed:ed5:5b48%8]) with mapi id 15.20.6086.026; Wed, 15 Feb 2023 09:45:26 +0000 Message-ID: <6708bf9e-368a-6eae-b22d-3ba2698c1ba3@amd.com> Date: Wed, 15 Feb 2023 09:45:21 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Subject: Re: [PATCH v9 3/3] net/cnxk: skip red drop for ingress policer Content-Language: en-US To: Rakesh Kudurumalla , Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao Cc: jerinj@marvell.com, dev@dpdk.org References: <20230214130458.1114765-1-rkudurumalla@marvell.com> <20230215062532.1169860-1-rkudurumalla@marvell.com> <20230215062532.1169860-3-rkudurumalla@marvell.com> From: Ferruh Yigit In-Reply-To: <20230215062532.1169860-3-rkudurumalla@marvell.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0270.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a1::18) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|MN2PR12MB4048:EE_ X-MS-Office365-Filtering-Correlation-Id: 760cef00-299a-485d-e77b-08db0f395dd4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 38tGlrssbl7b/z5vcXulwV8TCgskx28Dqlmz7R5H7z37AQfp/RInF3NdEdCzSl6VrjtwqLRo4L/ZkOgg84kaU4dji+WFZZwO/z7lwh0lyz2Ddr0Ow1QJGpqTlOmjVJOEYaPaDAjpY4DXXaawuzlnyXbPULlu9eAwTl/0SYSFAGSgMKlvxnLj34qj4GGdS99Vzz7S7XHMZEMqZfFLCcTjmbjE8Xx6nzm4GIBSvhUu/mJbba0K69rbRnLX7lHThU3r1XNPOCcG9W8+0D03MxYqFIkiV2VULWdYUfRNOojK2S+Jl7xeJR7VwIfk8QAs591mG0WkiTpMKWGBZT43JjKRRE1fWGFSXCQW3MxWCXWFK4+pqQtKg0IwUdpFfIArF/fjW392cMMccfn5qi7SRomwgLe8s/QMSPPHyOVYmtw1nJOjbueCIRGTS8iqLjafHtUhoW+K9h0kKi8UPkU0W3kBf8M2rFifTWAGAVz8FBumqDSAZbvh8rfZ1erxbJ1e2Qq07q8H06VIdtFQJ/EnA9p7CNOC1CGh2RpySTRIGopHe3EvFHk+FS7DrGloXaDqqY90T3F/886b09sE5e3JIZDhXRJaX5EY0COOLCwN/dowb8KBkAinM3H6cFvEnjr8aq7Y3J2gTPtURZl0bX7FQ3b295QAnQbsugtQgL6doTz0YDk7Ogp5EJjsWhuiF1b/NXgwcEvbf/hDH/AK9tOsGI3FPJwXwjZYRYjPdyIqCElgIIQ= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(39860400002)(346002)(366004)(396003)(136003)(376002)(451199018)(8936002)(36756003)(44832011)(41300700001)(5660300002)(2906002)(4326008)(110136005)(478600001)(66556008)(8676002)(66476007)(66946007)(316002)(6486002)(38100700002)(31686004)(26005)(2616005)(53546011)(6506007)(6666004)(6512007)(186003)(86362001)(31696002)(83380400001)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NEZlMk9zN3hJQkhqS3FDQVhlMHg0N1JXUTIrYVdhZ2dqWUFDdUlQL1Fac0Zo?= =?utf-8?B?ZnhYaWV0aHVxOEZ3cmFPMDhLMGhkUXg2b25IeDV3elRzZ0pRMHczdTlNd1Jq?= =?utf-8?B?b1VBVzZvTmdyRkMwSUx3ZE9McWFYZWRJT0FNUmozVWRyc2ZxbGxMMTR3MGp1?= =?utf-8?B?VzBxR2k3eVFGNzZ1am11Y0ZUV1pveWEwSCtzdXpnZ1RrQ1NkWEx5Z3pjT3l6?= =?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RmkzbU5yc1hWbnp6?= =?utf-8?B?MmU0WTl3dnRDQ1JaUUI4ZVJ5dk5sbGdDSXpzRkV0V2VPMlgzQmF0Wml3QmQ5?= =?utf-8?Q?V2rOQvnEkXGBzsr2pDp4dLSoV?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 760cef00-299a-485d-e77b-08db0f395dd4 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2023 09:45:26.7343 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: e+orxKfPv331skrg+P2c8TDbpOvkl9zY2IuYvrlG3TfnSMAhaBX87NKpjc/RsEsA X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4048 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 2/15/2023 6:25 AM, 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 Ack from driver maintainers required to proceed. > --- > doc/guides/nics/features/cnxk.ini | 1 + > doc/guides/nics/features/cnxk_vf.ini | 1 + > doc/guides/rel_notes/release_23_03.rst | 4 +++ > drivers/net/cnxk/cnxk_ethdev.h | 1 + > drivers/net/cnxk/cnxk_ethdev_mtr.c | 50 ++++++++++++++++++++++++++ > 5 files changed, 57 insertions(+) > > diff --git a/doc/guides/nics/features/cnxk.ini b/doc/guides/nics/features/cnxk.ini > index f81628da77..7947c044bb 100644 > --- a/doc/guides/nics/features/cnxk.ini > +++ b/doc/guides/nics/features/cnxk.ini > @@ -94,4 +94,5 @@ queue = Y > represented_port = Y > rss = Y > security = Y > +skip_cman = Y > vf = Y > diff --git a/doc/guides/nics/features/cnxk_vf.ini b/doc/guides/nics/features/cnxk_vf.ini > index c4ee32a9ad..873e1dcc0a 100644 > --- a/doc/guides/nics/features/cnxk_vf.ini > +++ b/doc/guides/nics/features/cnxk_vf.ini > @@ -83,4 +83,5 @@ pf = Y > queue = Y > rss = Y > security = Y > +skip_cman = Y > vf = Y > diff --git a/doc/guides/rel_notes/release_23_03.rst b/doc/guides/rel_notes/release_23_03.rst > index 1dd10e26db..9f53ded5fb 100644 > --- a/doc/guides/rel_notes/release_23_03.rst > +++ b/doc/guides/rel_notes/release_23_03.rst > @@ -98,6 +98,10 @@ New Features > ``rte_event_dev_config::nb_single_link_event_port_queues`` parameter > required for eth_rx, eth_tx, crypto and timer eventdev adapters. > > +* **Updated Marvell cnxk ethdev PMD.** > + > + Added support to skip RED using new action > + ``RTE_FLOW_ACTION_TYPE_SKIP_CMAN`` > Can you please move this entry alphabetically ordered by vendor to the block where has ethdev drivers, a little above in this section. > Removed Items > ------------- > 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);