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 31852A0544; Mon, 10 Oct 2022 16:49:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 21D064021E; Mon, 10 Oct 2022 16:49:54 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2058.outbound.protection.outlook.com [40.107.243.58]) by mails.dpdk.org (Postfix) with ESMTP id 1B7D940146 for ; Mon, 10 Oct 2022 16:49:53 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LSChs/BO1ZhXnxrNrJrE5ExPrTDUlawCCfIRnHkEyzSdbTMRz5m8V6OgfeTSd5enetmAnZ1BHbHusiy91u7CZWT/uUlUxsKzQ5F8mZHARTTNnjx/64E9lVaJA0iDzW3l5q3gdzfdkUsbhnMIQlFfdKEa67W8CDJ0i/9cHK1XT/tg/6ITvE119rTT9z8vlsrZFsOha2ZMIN4yw6WT/ErELyDLxe+O4uYj5aFLFUe2FQtoAtnmusEQREXefS2obQoet/l+1gizktqV5KoeU6HU+G23XW+zSbQiHPdT4Jhuw4qT7U7qMqqIDaKMfwFFtQRGEHR05zp4WeYeDuKXm32/gw== 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=hEEnJYyXrbcg+I22meYql8j485NLew6zeCmF799Y21I=; b=mNuGQ/gNyphxNd8usADudN+9Brxbe9Zvgh2hlOkLN/gwM9EgA26uzEFyPN2JGWFWsdFw5X2aJzHR2mYhFRde/vHJ2u4R3XR3cfMRzVHXde9R6lBhajNU4BgLfb52ftRXJhCrdJDVWYnU4YOfiX3u4cWOm1IXUVpgul9Z5y9ZdqxOXNdUz7qLX1kiiP5GLOevWNX1KF+s2yVFmHdeucrz30WfdTnDGlvHQP+UklCkYH5LkdZPShPwtJ53G3liau+VWdYQu2MobwXAwMIV4iXJWymeXfNYZMIRy5wHndVEmZujVeZdUiXnP7tbOihaRV2yq9mW4BySBAEisE2nYGVbBA== 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=hEEnJYyXrbcg+I22meYql8j485NLew6zeCmF799Y21I=; b=KnElL92NkYIodGPdzTfZSn6jsw1I+yaxc7vPMr5mcpXymAhXrpkTqc/JBikGkg1M7oTvoubjGPebO+5sQ45F7MycW5kD5hYNff0GeIjb4uogrHuaPrjMGDtlCFIHR3dusL7e3l6+v6b+810NSYbF25X+QaFF1DtPAKhhMkdiYHQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from MN2PR12MB4301.namprd12.prod.outlook.com (2603:10b6:208:1d4::22) by MW4PR12MB5644.namprd12.prod.outlook.com (2603:10b6:303:189::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.32; Mon, 10 Oct 2022 14:49:51 +0000 Received: from MN2PR12MB4301.namprd12.prod.outlook.com ([fe80::7900:1b25:bc:104c]) by MN2PR12MB4301.namprd12.prod.outlook.com ([fe80::7900:1b25:bc:104c%7]) with mapi id 15.20.5709.015; Mon, 10 Oct 2022 14:49:50 +0000 Message-ID: <39e84172-6c6a-06a1-523c-607a7cb4c25e@amd.com> Date: Mon, 10 Oct 2022 15:49:45 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.2 Subject: Re: [PATCH v2 02/24] net/nfp: add the structures and functions for flow offload Content-Language: en-US To: Chaoyong He , dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com References: <1665382142-21684-1-git-send-email-chaoyong.he@corigine.com> <1665382142-21684-3-git-send-email-chaoyong.he@corigine.com> From: Ferruh Yigit In-Reply-To: <1665382142-21684-3-git-send-email-chaoyong.he@corigine.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0176.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18a::19) To MN2PR12MB4301.namprd12.prod.outlook.com (2603:10b6:208:1d4::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN2PR12MB4301:EE_|MW4PR12MB5644:EE_ X-MS-Office365-Filtering-Correlation-Id: c402b17a-3449-419f-7519-08daaaceaf3c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0CHdm+0C9SW4vuRMwzq5SlSLsRdX6mdqQRqG+CPn9TpS7PyNUj/j78Dycidok5+TS3/M16qiAGlmZlNhUmtBZ3xHToTJRJkU2rmxe+J/az48N4xxYM7AYCl9dqFBKOEdaFxiyyLCY2qUTSaMawC/cU3cneyhfM/4D0PI0kOye9c25N4rGnTJFm2FfolfowiVoXFEL+INOSBGCT2ClssCVGoVrBKbVqtxBZyJkNK7U5fMs80AgyBZeSgV0C7FnkRRjPMLENxipC1CNoldN1ZtaJ0q4cmnXJJyG2lCfy3PrONKjONXIlZ0eLsTCIh81IJKuto0P4udXffzHS+bvCUgqZTIoHMtc44arrDfLLRXBhNfK5sCuuAfJ5tZwIeI28cvkL7x2Zp/odx4DgmhQUBiT717Xv+gHTngh455WWQywspfF+sz54/P/h41fdI71Ph5szeoFGszR2FE8AIXZLMaFVG9y2TvQiDAoUHETASWKJtwF9fB+y9qzJjkq2hJ5nM+JEPGeXMFLzS2Xev1A4F65IvKE2JizM+hq0pgee0lD5FXMH93kXIueEu5TmDH4hF2Bur8HTb+jaeqDOag6kGq2SqMikDjNvVdqt51+IrEZ2wwemJYatQxToV7lj1PXC/XuhhM2XKg2beDSSJRZ4qh+20FThxz48xUfY5iFJUgAiXES3zpmihDQ4qTwSX4KSN0tD/ITlGMKwWxURpQcN5R39hCms7OqBT0EbN7sk4uun33ARWL7a8UXuGlRtlYWnXUUqEmKJcauOj+Pg3RWYk7ZyhYDAmqz6SnSHAGiDaVmII= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR12MB4301.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(396003)(346002)(366004)(136003)(39860400002)(376002)(451199015)(6512007)(31686004)(316002)(6486002)(478600001)(38100700002)(36756003)(86362001)(31696002)(66476007)(6506007)(83380400001)(53546011)(2616005)(26005)(186003)(66574015)(6666004)(44832011)(66556008)(4326008)(8676002)(8936002)(5660300002)(41300700001)(66946007)(2906002)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UitLYXBscjJBZExONGpiaFdmamxVVXdJeStpaU4vWG1tK29YU3BEQ1AxclJY?= =?utf-8?B?VVRuc3JXd0haSTlCRk04aDVwb0hGNVFXZy92bEJkcDZnbmdnYkxSN0NKNWhH?= =?utf-8?B?UG5QRlZRQVdBaTFzTU14Mlp4OG8zZnN4R29UZWovQmJYVXN2NXhpZ3N1c2lu?= =?utf-8?B?Y3hzay9hTDc4OG5LK1BkTTlKYWVwaTJnSW1WcStPRWt3WTRiYnFOdEVYN3VU?= =?utf-8?B?ZUY3UEdGRWlNVEVrSGVvY0R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VDNyYzZZSWZT?= =?utf-8?B?Z2FTSHY0ekhiVDd4QUJCYWhKYnJhWlBiQXM0cmVJd3Y4WEhrTERPaEtKY2Zi?= =?utf-8?Q?TLI8=3D?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: c402b17a-3449-419f-7519-08daaaceaf3c X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB4301.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2022 14:49:50.8336 (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: 3H6rC4uBh7JWg4StiY3lsN3W6kb0dZIDwhXGFAqHWmyKeLksPPO0gCvMfYjy9KbE X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB5644 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 10/10/2022 7:08 AM, Chaoyong He wrote: > Add the structures and functions to process mask table, flow > table, and flow stats id, which are used in the rte_flow > offload logics. > > Signed-off-by: Chaoyong He > Reviewed-by: Niklas Söderlund <...> > +__rte_unused static int > +nfp_flow_table_delete(struct nfp_flow_priv *priv, > + struct rte_flow *nfp_flow) > +{ > + int ret; > + char *hash_data; > + uint32_t hash_key; > + > + hash_data = (char *)(nfp_flow->payload.unmasked_data); > + hash_key = rte_jhash(hash_data, nfp_flow->length, priv->hash_seed); It can be an option to store hash information in 'struct rte_flow', instead of keep calculating it. <...> > + /* flow stats */ > + rte_spinlock_init(&priv->stats_lock); > + stats_size = (ctx_count & NFP_FL_STAT_ID_STAT) | > + ((ctx_split - 1) & NFP_FL_STAT_ID_MU_NUM); > + PMD_INIT_LOG(INFO, "ctx_count:%0lx, ctx_split:%0lx, stats_size:%0lx ", > + ctx_count, ctx_split, stats_size); > + priv->stats = rte_zmalloc("nfp_flow_stats", > + stats_size * sizeof(struct nfp_fl_stats), 0); Is this allocates 'stats' for max possible flow rule count? Isn't this a too big number to allocate in advance?