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 6622641C44; Thu, 9 Feb 2023 00:19:48 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F3C0E40DDA; Thu, 9 Feb 2023 00:19:47 +0100 (CET) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2047.outbound.protection.outlook.com [40.107.212.47]) by mails.dpdk.org (Postfix) with ESMTP id 9DAF94067B for ; Thu, 9 Feb 2023 00:19:46 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BREcJz6Iv6GYQHgHf6wYLykTCPxcSeqHK84zDZodlfa8xKTQYJ9u6H2AuEn2nzgZl6OQnZ3j85SjmyRHB0qCQJTocx6ISH5jnScWkrcIJ5PhCl0wmawljQezKebU9zZZBZd0pdD/QSMS0gTFDvncPKlrBE+xJKmXmjzgOmXVvTTL032s1i2M/Y83Ezuu4MMWT375GaGWxAK0kTxnWm2VFGhk3iFRGTLOyyh7MBb73q6a3Iyf+AUe3WCc2mOOtNMmCz5fvu9uI0ZdOSXrGIkcP2bi/HjlDNczetsAY0za+nGylGTZXWXHQTae3JEBvlAbs+Z1c2MpPi2b5HghF2r27A== 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=vaj8tkOoHZg+/ChMtx6+0F43T7rvsSl/RpDluWjgKXY=; b=lsu9e12B+JK86+mSuqeC6KOFTRfwhRPI+Jd66DJEl80eRNE7pbiyUFtGw3/zzg6wUxeDcrcDTKvJoyojrs8fLGjaKksOJ2wvJsK9jqmxjMhV6k1Gg6DDPxaOjvt68PkcWwC3e8Mznwm1NPt3QsuBk0kI3VqUiAAT1Ea0QN/No356h1i5kttqKjKYLCgMxkVbEX7GjBlF2oXM0DDJDgwsO6TcXsR/6bnwI1W9ZynsbXxlPH+9lXHQnxYjf+NqWS+Uz4R/r4uzsQDkUPUnTPN6CGBHfay8rIlqGN4nB/hTIhyyO/XUfVuZMXB+CJo/tQ/Vu9x0+Tmqp8SPyaAH9L7bag== 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=vaj8tkOoHZg+/ChMtx6+0F43T7rvsSl/RpDluWjgKXY=; b=QBxJl/hTu7HyVhUbtmUIUv8DruXrzAKY9Cn2BedU7NQCj5kgex012CmFLjaEcTl9HkWQ5a76kyzEMTBRucY2qKSWkAyJ/V9CucMEyCp+UVkuMmc2p8x5RVkUfiNuDaEIMSYYfRzn1QlmzYh0xWTqgkZnbI1rnS3a0klaHzFATss= 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 BY5PR12MB4999.namprd12.prod.outlook.com (2603:10b6:a03:1da::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.34; Wed, 8 Feb 2023 23:19:41 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3614:22ed:ed5:5b48]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3614:22ed:ed5:5b48%6]) with mapi id 15.20.6086.017; Wed, 8 Feb 2023 23:19:41 +0000 Message-ID: <75dc0e54-2f4f-f8c9-bf27-b6ad8ae01652@amd.com> Date: Wed, 8 Feb 2023 23:19:35 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH v8] ethdev: add optimization hints in flow template table Content-Language: en-US To: Thomas Monjalon , Rongwei Liu Cc: dev@dpdk.org, matan@nvidia.com, viacheslavo@nvidia.com, orika@nvidia.com, rasland@nvidia.com, Aman Singh , Yuying Zhang , Andrew Rybchenko References: <20221114115946.1074787-1-rongweil@nvidia.com> <20230202111927.2450863-1-rongweil@nvidia.com> <5085921.31r3eYUQgx@thomas> From: Ferruh Yigit In-Reply-To: <5085921.31r3eYUQgx@thomas> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P265CA0060.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2af::6) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|BY5PR12MB4999:EE_ X-MS-Office365-Filtering-Correlation-Id: ce7213d3-a5fd-4946-11c3-08db0a2af4b7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EpBhmVkAPWnnBx0/5d+vR09eonQPlTlFY3IIXjw2ppFPtu5PblzOyJToBj81hCAYSdIoIoDSofTE3QbvAATzMHBG8xvGFzG70wcdWkpxmb/NjkNdf9Hsn0JL+la/UPp/1sMj0TiZKpTYi2NUak5A3XbC3aa4gZO5hkBwHB4QNMT8J8w/tYtCmOV/Ruk6vC9bhDJ+GHyx94U39sn8H5gu6kNiPxiEP4g8ZKb0E6gP1Agh3Em+fgk9wCukSvk11K3hKMdUEDAf6TKGg6ilSaI9yABJZ+vpAoelHy9Sm46d3K4LD27Z4jWngjyk+ibkVQ2M12IuPvSyD3ufHpPEP8h34yeaFhXsIEV50pFLwfvfBFRTpic22iHpOVTeBmu4nKfR5W6zhRAs2Vz7t9jP/bOMNqYKEWwx0l5UlnoKtAXDNWKJELSXQvm9Q6E/bOmUakyQK8yplxeQYajxmUL/U4mmvkrknet3Fw3ykYKDPIjCMckvRJZaMBLnGN8eN0sAI+Jkpgy/yMWzBG3W1jVmubQB2Lg34Gtot93FZF+WikaykcYYCD3DKHIW6Q9V23/x6d3pcXFkM4G635zcMUMDUAln5oDKnu9T8YIGIzPvXNCxz4QjJHY0aWvZr5HIB9VpqZUt8aSWZwxqoc+tPbTl1mZya4dacOr3qTdM2zDS8lhhBd1iOaxpAdXnp9Jg5HTX5WGSK+FTJ1AAxzgkpAmMP9eu0pLbIpJx+FcU8qaqQfGSu/8= 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)(366004)(396003)(346002)(39860400002)(376002)(136003)(451199018)(8676002)(66899018)(66946007)(4326008)(66556008)(66476007)(6666004)(26005)(6486002)(53546011)(6506007)(6512007)(478600001)(186003)(110136005)(2616005)(54906003)(316002)(31686004)(31696002)(86362001)(36756003)(44832011)(7416002)(5660300002)(8936002)(2906002)(41300700001)(38100700002)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Vk5FOHozSlIrSWpsdmFVWDlVcDdJbkk3MVZPcFhEa05YbGZzY2pzUVJRdk1l?= =?utf-8?B?RzNRK3BBVW9XRlo0SGpOTzJrdUZaTlVrLzdhQjcxUXJRcjlXM1gwRkxGTDF3?= =?utf-8?B?cCtxWnZkN2FpQ1pNSTk2blR0L0dZVVdseG45bGoyMjAwQUNHaWJqZFZZMW1I?= =?utf-8?B?aUFjQU0zM3VYbFBVbFI4dHZ1QmplQnk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?R1BRVEZiL2pialdFZGx2YmwxcWg4emwxcGh2a2JjbGVVa2pHaFpPVVFBdUlH?= =?utf-8?B?N2lTZUdvckNJcHdKcVlja1dXc3YzSVl2UjlhRVFQczNQcnhiaWxiam1yNWI5?= =?utf-8?Q?qHQ6FuPixipdnJOy/YUix6GTR?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: ce7213d3-a5fd-4946-11c3-08db0a2af4b7 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2023 23:19:41.6724 (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: FsK5hJzFny7M0MqF1J5p0z1h+4jMAuNdZ85DO2xvyt7gMNpt/BXzn9zDitUR8x7g X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4999 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/2/2023 11:33 AM, Thomas Monjalon wrote: > 02/02/2023 12:19, Rongwei Liu: >> In case flow rules match only one kind of traffic in a flow table, >> then optimization can be done via allocation of this table. >> Such optimization is possible only if the application gives a hint >> about its usage of the table during initial configuration. >> >> The transfer domain rules may process traffic from wire or vport, >> which may correspond to two kinds of underlayer resources. >> That's why the first two hints introduced in this patch are about >> wire and vport traffic specialization. >> Wire means traffic arrives from the uplink port while vport means >> traffic initiated from VF/SF. >> >> There are two possible approaches for providing the hints. >> Using IPv4 as an example: >> 1. Use pattern item in both flow template table and rules. >> >> template table 3 = >> transfer pattern ANY_VPORT / eth / ipv4 src is 255.255.255.255 / end >> flow rule = >> template_table 3 pattern ANY_VPORT / eth / ipv4 src is 1.1.1.1 / end >> >> The pattern template 3 will be used only to match flows coming from >> vports. >> ANY_VPORT needs to be present in each flow rule. >> ANY_VPORT matching is redundant with IP src 1.1.1.1 because >> the user knows 1.1.1.1 is the IP of a vport. >> >> 2. Add specialization flag into flow template table attribute: >> >> template table 3 = >> transfer VPORT_ORIG pattern eth / ipv4 src is 255.255.255.255 / end >> flow rule = >> template_table 3 pattern eth / ipv4 src is 1.1.1.1 / end >> >> The pattern template 3 can be used only to match flows coming >> from vports. >> >> Approach 1 needs to specify the hint in each flow rule that wastes >> memory and is not user friendly. >> This patch takes the 2nd approach and introduces one new member >> "specialize" into rte_flow_table_attr to indicate possible flow table >> optimization. >> >> By default, there is no hint, so nothing change. >> There is no guarantee that the hints will be effective in the driver. >> The application functionality must not rely on the hints. >> >> Signed-off-by: Rongwei Liu >> Acked-by: Ori Kam > > Andrew gave this recent comment on v7: > " > Anyway, hint itself is OK and makes sense. Hopefully > documentation highlights that pattern match is required. > If so, > > Acked-by: Andrew Rybchenko > " > > Given the lines below, I assume the documentation is OK. > >> +This attribute is not mandatory for driver to implement. >> +If a hint is not supported, it will be silently ignored, >> +and no special optimization is done. >> + >> +If a table is specialized, the application should make sure the rules >> +comply with the table attribute. >> +The application functionality must not rely on the hints, >> +they are not replacing the matching criteria of flow rules. > [...] >> +/**@{@name Flags for template table attribute. >> + * Each bit is an optional hint for table specialization, >> + * offering a potential optimization at driver layer. >> + * The driver can ignore the hints silently. >> + * The hints do not replace any matching criteria. >> + */ >> +/** >> + * Specialize table for transfer flows which come only from wire. >> + * It allows PMD not to allocate resources for non-wire originated traffic. >> + * This bit is not a matching criteria, just an optimization hint. >> + * Flow rules which match non-wire originated traffic will be missed >> + * if the hint is supported. >> + */ >> +#define RTE_FLOW_TABLE_SPECIALIZE_TRANSFER_WIRE_ORIG RTE_BIT32(0) >> +/** >> + * Specialize table for transfer flows which come only from vport (e.g. VF, SF). >> + * It allows PMD not to allocate resources for non-vport originated traffic. >> + * This bit is not a matching criteria, just an optimization hint. >> + * Flow rules which match non-vport originated traffic will be missed >> + * if the hint is supported. >> + */ >> +#define RTE_FLOW_TABLE_SPECIALIZE_TRANSFER_VPORT_ORIG RTE_BIT32(1) >> +/**@}*/ > [...] >> + /** >> + * Optional hint flags for driver optimization. >> + * The effect may vary in the different drivers. >> + * The functionality must not rely on the hints. >> + * Value is composed with RTE_FLOW_TABLE_SPECIALIZE_* based on application >> + * design choices. >> + * Misused hints may mislead the driver, it may result in an undefined behavior. >> + */ >> + uint32_t specialize; > > Acked-by: Thomas Monjalon > Applied to dpdk-next-net/main, thanks.