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 E99D645B03; Thu, 10 Oct 2024 13:21:15 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D54484029C; Thu, 10 Oct 2024 13:21:15 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) by mails.dpdk.org (Postfix) with ESMTP id 676AE40279 for ; Thu, 10 Oct 2024 13:21:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728559274; x=1760095274; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=pc69P66lETMb0ReSiTRRtJ9XKBZ6AprX2Y4lIlUtObw=; b=Ued5OCq8xOhJXFvVYRxOwXnvesF0zajgrFeP968smGiilNAFFWO2Bg/3 HfT8LUGP6bMbj8d8DvEj4JV6aB7npFWDs2XBfkFJ0j0rm/NIWeWKhXv3e IEhQu0xwHfHymSuj4/Izu5vgIaVL80RPwGc3jl+2k2SS2y/6zwYM7ZEb5 wQu2J6l5n6h9k15TBCNA5TKglRtxx70H6lxWZZRiJqRKgQM0//yUjVBng hb01zTaOPr9uiJ14AhweTOH1rc/Ows2xFgWWBq6tave6jG0nMjM74kt0N jPo8Mftz9lr0yUGM7mTFnYTXHijg06QVTdITh45OTrRlIJxE/aI0hZzZZ Q==; X-CSE-ConnectionGUID: 2oymMZfRTr+/gFOYo5mKzQ== X-CSE-MsgGUID: i4uxeXiEQJCE9QHCAZQplw== X-IronPort-AV: E=McAfee;i="6700,10204,11220"; a="27995927" X-IronPort-AV: E=Sophos;i="6.11,192,1725346800"; d="scan'208";a="27995927" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2024 04:21:13 -0700 X-CSE-ConnectionGUID: usvpcvE/SNSPb14bEbNL/g== X-CSE-MsgGUID: HVUjBTmkTnGaBm6hKahXIw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,192,1725346800"; d="scan'208";a="81563553" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orviesa004.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 10 Oct 2024 04:21:14 -0700 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 10 Oct 2024 04:21:12 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Thu, 10 Oct 2024 04:21:12 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.44) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 10 Oct 2024 04:21:12 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=B3c0J/pIUo9NSnaVqYRUwXc+dRTmt4rNVAFDzy+7vpx/wBhQZCp/GuOb9amG93Tbyp/kI6w1QP2FZH6Mfij3AIXQsOfNXKt2HV33E+rUv2jpdchNsXd8U6K3X75PAMqhEhnDmI6AoIgHUH+M2/oGrh0Ex36UVczBbrheFUgTxcCcnRLxMD1G3QIhe4nsOBEXvaQJz9ajACyVRkA+YR3yGedZG5AfcfVMCGhod7iuUuJKEOeDVdv1asixvUVbQKZCvG8wA/TecyuNpr+/yVkpQVuE9jBDU+CxkbAQ8qyamO0AkdVnRvsv3b71OksUDkMmbk4XZ+N/BlJO5T0c043PsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=6u7vZfwX0kXSrf4TV7GnBXWedwJLZ9JIe8EHHxzUjCI=; b=pX6ZZAUSjcom3F3yv+IgYDlsSdElmgLJw+kTUMQjaFrdY8vzA+zz9fDwnFNwCOiuvBKxeKtWx7zBO/ivbUedn3G9W+RwKUkPDQLrl6W5a9OEu/bTDbhTcT+egpOvG7mpuT5qly4uSyRAq5/ruq6MdS4Dw9wJ7Zr9a84HmBosd86ktK8I4crik/Gyha3t3S3v8isbMq6tBAhdS5aEVkNCe48d+5CJcbAwi41weIGuv41GSIJNtYMHfdVk1iHD/m+0uIPmvP89XBjQWy6VrUSpPRTK72lKT3rkUMCn8cOqrphkYz30no30Ju4USChJYNAIqJ1xsF3WD3WjtM3Xwf4ooQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from PH7PR11MB5765.namprd11.prod.outlook.com (2603:10b6:510:139::7) by CYYPR11MB8432.namprd11.prod.outlook.com (2603:10b6:930:be::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.24; Thu, 10 Oct 2024 11:21:09 +0000 Received: from PH7PR11MB5765.namprd11.prod.outlook.com ([fe80::fcf5:d65c:4fdd:4a2a]) by PH7PR11MB5765.namprd11.prod.outlook.com ([fe80::fcf5:d65c:4fdd:4a2a%3]) with mapi id 15.20.8005.026; Thu, 10 Oct 2024 11:21:09 +0000 Message-ID: <86a9b3b8-bf6c-4518-960b-bbbabd53ab16@intel.com> Date: Thu, 10 Oct 2024 12:21:05 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/2] fib: implement RCU rule reclamation To: Stephen Hemminger CC: , , , , References: <20240906170907.1325808-1-vladimir.medvedkin@intel.com> <20241008175524.450829-1-vladimir.medvedkin@intel.com> <20241008112802.48bdd858@hermes.local> Content-Language: en-US From: "Medvedkin, Vladimir" In-Reply-To: <20241008112802.48bdd858@hermes.local> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DB7PR05CA0042.eurprd05.prod.outlook.com (2603:10a6:10:2e::19) To PH7PR11MB5765.namprd11.prod.outlook.com (2603:10b6:510:139::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR11MB5765:EE_|CYYPR11MB8432:EE_ X-MS-Office365-Filtering-Correlation-Id: d200a5b5-4057-485a-59a7-08dce91da408 X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|1800799024; X-Microsoft-Antispam-Message-Info: =?utf-8?B?cUN4em1LUmJrbnlKUmJ6aTVvMGhndkNiWHBacGcyYTdqb2J6K0VvSXIzSmpk?= =?utf-8?B?YWRsZDdvWmR3RkhNeGpRVjE0eVN0dGxLQUxkcFk4QkxvUzBucDRiVGJOL095?= =?utf-8?B?VTJ3UHozQkl6d1Uxb0Y5aU5XU014bElNSnZ5NEIxZzZjcTV0NjFhdjhaSzA1?= =?utf-8?B?b3k1Sm9tRVhqS1Fud00xNS9QQ0YxT3ZIL1dDbFBxN1lSWjZwSG12dkpONW10?= =?utf-8?B?RERqTVExd09XSzkrK3JySmVvM2xPL1ZqSzZHZm1SRFJhdHJLZF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VUpBZEFna3p6VjBxLzBoZENuVHRJVHdv?= =?utf-8?B?bXUyS0tIOHhoQlh3WmdLVGVHYk1OWmhlQTdNM0ZQSUdwbkRTaEMwVUcwcFpw?= =?utf-8?B?MUtXUWtLSTBleDRPK0hxZ25EQkRMbTMzTVM3clp0LzVjbGNCVDdwNnducjhn?= =?utf-8?B?MFhPeHA0dzhQcVd6ZTNzL2RHV3ZpcEJjUmU4SE16UmplY20xaUgxWGpuSU9M?= =?utf-8?B?cHZnNjlBUVNFWnFwQUsxN0xuWE8valpKZlh3QmdZODBwdTBueEVOcm9ET1hM?= =?utf-8?B?Z1EvV2lseGVPWmJMRTNRQW1WRGZyTVJuY2ZwbDJvL3BwUFl2ck9ZVjlabHl3?= =?utf-8?B?MnRWNm0xd2x4bFhQWENyc29ZM3hwUml3LzJ4ZXJVdGdSSUhKYkJYSExmVkNI?= =?utf-8?B?Y1lJWWNIdXA0TjZKenkraEp6WDloS0h4T0ZCOXFBSUR1L0luZTR0UFZCYVd0?= =?utf-8?B?bEY3Rm5vb2JCc2hFSjdPM2lQcnNwUzZ6MitVRGtLQ0gxelZkQlo1eVN0dkRF?= =?utf-8?B?K2ZGOENiVDV1c1Y0OU9HMEJtQUNIKzhBZHBNaDNJMi85U2ZxRWRuTE13PT0=?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH7PR11MB5765.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(1800799024); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?WXJBQW84cFBhT3EyK2ZFRUw3Q1JoRUZmMEhwWGpSbXZFd2pIbkFXZ1VaN1Ux?= =?utf-8?B?RVlGT1RxZGtmR0ZhU040NDVWRzMzdmN0bnB5YWR3U3lTZ0d2S1Z1VE84cGlQ?= =?utf-8?B?cEFyM1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DB4Rm1IWi96T2Rr?= =?utf-8?B?cTNtZCtzcDZ0d0RYMWpIbkxJajlDZTJ3bExCZVdPN3VaNHdQMlhxYWJHbFMv?= =?utf-8?B?cXpHV1pCdG4zcEZ5OFozcVZsRnAzZGpiM3o3VHlYOEtZQ3Jyb1dNN2lSbGpV?= =?utf-8?B?WElFdStCaDhWa29KdjUrSGVXZEtNYW8wT1Nvdk5wYVFkVDZCSjRXR25seDBq?= =?utf-8?B?b08vaEtHTndYWlp1Q0dkQ2dWU0RmQk16MjY2d1VmcFhoN09La21LaUVTc3Vm?= =?utf-8?B?Unc9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: d200a5b5-4057-485a-59a7-08dce91da408 X-MS-Exchange-CrossTenant-AuthSource: PH7PR11MB5765.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2024 11:21:09.7275 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: I1qz6pXCByxxXP/aQ24y40ythff5ai1KBtYztRxIokcg09NoecPydpcb/kuHqQnDLbTy8MZ5/9VuXQjljXZqrt9FX/2y3jpJW8aRrCvqbK4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR11MB8432 X-OriginatorOrg: intel.com 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 Hi Stephen, Thanks for the review, I'll address your comments in v3 On 08/10/2024 19:28, Stephen Hemminger wrote: > On Tue, 8 Oct 2024 17:55:23 +0000 > Vladimir Medvedkin wrote: >> + if ((tbl8_idx == -ENOSPC) && dp->dq != NULL) { > Better to either drop the parenthesis here, or put it on both conditions. > >> + /* If there are no tbl8 groups try to reclaim one. */ >> + if (rte_rcu_qsbr_dq_reclaim(dp->dq, 1, >> + NULL, NULL, NULL) == 0) >> + tbl8_idx = tbl8_get_idx(dp); >> + } > Could add unlikely() to this expression. > > /* If there are no tbl8 groups try to reclaim one. */ > if (unlikely(tbl8_idx == -ENOSPC && dp->dq && > !rte_rcu_qsbr_dq_reclaim(dp->dq, 1, NULL, NULL, NULL))) > tbl8_idx = tbl8_get_idx(dp); > > >> +static void >> +__rcu_qsbr_free_resource(void *p, void *data, unsigned int n) >> +{ >> + struct dir24_8_tbl *dp = p; >> + uint64_t tbl8_idx = *(uint64_t *)data; >> + RTE_SET_USED(n); >> + >> + tbl8_cleanup_and_free(dp, tbl8_idx); >> +} > My preference (not a requirement) is to use __rte_unused attribute > instead of RTE_SET_USED > >> + if (dp->v == NULL) >> + tbl8_cleanup_and_free(dp, tbl8_idx); >> + else if (dp->rcu_mode == RTE_FIB_QSBR_MODE_SYNC) { >> + rte_rcu_qsbr_synchronize(dp->v, >> + RTE_QSBR_THRID_INVALID); >> + tbl8_cleanup_and_free(dp, tbl8_idx); >> + } else { /* RTE_FIB_QSBR_MODE_DQ */ >> + if (rte_rcu_qsbr_dq_enqueue(dp->dq, >> + (void *)&tbl8_idx)) > Minor nit: cast to void * is not necessary in C (only in C++). > And can fit on one line; max line length now for DPDK is 100 characters. > > Overall, looks good. > > Acked-by: Stephen Hemminger -- Regards, Vladimir