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 78F3C45E05; Mon, 2 Dec 2024 14:24:44 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0C88040270; Mon, 2 Dec 2024 14:24:44 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) by mails.dpdk.org (Postfix) with ESMTP id CF598400D6 for ; Mon, 2 Dec 2024 14:24:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1733145882; x=1764681882; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=CTnSF8JuKAF4QO9OUEt3KD/rGSNV8kMLBpmEnaYAdkA=; b=IXUCjywH8ZATrjK4/9+i4kLsmGdFk6y0RFZqvq9Zb2LABj90WXyNar5b 8OVAOR/5hBo/4Lasr6S7CcOEMX4qmH+bHY6a+SsscuUNxSbIGsGY+8DIo 8HmObTLWs8jDOzd6XYoE+ofGgwRimsNyMSppSO1JV02bbt+g0viQ5B9dJ +ynFAcO3AEG4keIGmCskdYlSor02AFehaernPe/UnqioVk/Wq29y8JJTI OxyWxiMEscGxyobTUB72JtaUDFRZJoUmzUzEwBEXJSp723xpo3LpW7uFi S1Q5uNUP2NJFCsAIaO+XnaiqaJ5TZWoCSqc9gAGN8r24JlYkA9OH9ZEHG g==; X-CSE-ConnectionGUID: wDbnMfxnSK6DZgiFq04SZQ== X-CSE-MsgGUID: jeP48qavS4W3C1tBkX08wA== X-IronPort-AV: E=McAfee;i="6700,10204,11274"; a="44349032" X-IronPort-AV: E=Sophos;i="6.12,202,1728975600"; d="scan'208";a="44349032" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2024 05:24:41 -0800 X-CSE-ConnectionGUID: cBycvY4hRxuech1sN2cIGg== X-CSE-MsgGUID: BptSfQ6gTQCaMeAgfIj8BA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,202,1728975600"; d="scan'208";a="93417349" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmviesa010.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 02 Dec 2024 05:24:40 -0800 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) 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; Mon, 2 Dec 2024 05:24:40 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Mon, 2 Dec 2024 05:24:40 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.174) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Mon, 2 Dec 2024 05:24:40 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=o9g42VyNivp8BTk3QviIuJo+zzKO7AR/KstiZ9/nDukSYLue4+VISa6kTaDtm41Mtz/XQkqoYkDx/JOXyPQyfT5gfDLJUiQEOoVb+zZxcIoPgoLqK3t9BQXlXJRYpkaFiy9FuKo7zKeZCfOzJbTS74/p5f2wuJqJbfRGdtzGEobNRwoex4XfybefrJhcQgymmPvJONwFVSI8c8TuA1zdG1n22ZsF1udi8a+Se06NZx7yTV+b2CJKKGo64Dq03T3QaCa1tb3ajtgf0XMeIwbjb8F3OcYAlLy+ZInMSKBZRpiXxVoxRl/N74AhbUXg3HFz8M3FwJFUnNUjB4pa6ISK/w== 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=Q/2VwmYSQISm18GYGT5qpVF4DZ/lxsR9O+BDVaz1UOI=; b=jVQU2ZvaxcDFe2hvKYf3CC28BB9kzLiTfd6Cz25zC//7boBnNDL5y/VThQcm5d8RTPSIKH7FCOhyXBEe6tyXarne4g0M96+DRpsTep6RK7UvoNeEl+JHnKAJKGq0mAflMQWr9XF5pReTlmONfmzmtlzH6nZwVtIuCoeOts9GeKeKboOaXGj2yRxBJQ850lzDP5NFjcZe7llOqJcIEcJaZB2M8MpyFgi0bPKEJE2kYjDzsvhoi8PtEN7QpdFpDlo9u9CzGkaLTABw39zeFiGJ8s8HB/frSpWxPhs3C2DAJ1S774TIV5fuYEEvJW1zzoy14Y6bV5ugF0RwU56pX5yvkw== 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 DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by MW6PR11MB8311.namprd11.prod.outlook.com (2603:10b6:303:241::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.19; Mon, 2 Dec 2024 13:24:31 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::f120:cc1f:d78d:ae9b]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::f120:cc1f:d78d:ae9b%4]) with mapi id 15.20.8093.018; Mon, 2 Dec 2024 13:24:31 +0000 Date: Mon, 2 Dec 2024 13:24:26 +0000 From: Bruce Richardson To: David Marchand CC: , Ian Stokes , Vladimir Medvedkin , Anatoly Burakov Subject: Re: [PATCH v1 11/21] net/_common_intel: add post-Tx buffer free function Message-ID: References: <20241122125418.2857301-1-bruce.richardson@intel.com> <20241202112444.1517416-1-bruce.richardson@intel.com> <20241202112444.1517416-12-bruce.richardson@intel.com> Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-ClientProxiedBy: ZR2P278CA0081.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:65::17) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|MW6PR11MB8311:EE_ X-MS-Office365-Filtering-Correlation-Id: 0cc1ef1b-df31-45fe-16a6-08dd12d4a7c2 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?NkVuQk5hcEc1TEtzSjFjbVE1ZS9GUUtCc3pjQ3FVNkZVYVhsZEttdk0yRG11?= =?utf-8?B?amwyWjRxTTVibHAyLzNvTXFLRnRSd3Q1bjMrZVJBZGJTUGoyeWNPb2tVNkM1?= =?utf-8?B?N0JmMksydGJZRFNlWUwzV3B2eStEZTd4Z2RHQWhHdnoxc3V2MDlJNDlwSFhL?= =?utf-8?B?THdldGsrTGdoN2VkSGpxaEFzbzFYM0p5T0J4Z21sMTNnTkliM3QrYmQ3ZW8x?= =?utf-8?B?SWNOV0IzNVlVbXZrQ1RhSE1yR0ZhNDBXNGdRV215Wkk3VTkyVVNCeGpqZGJV?= =?utf-8?B?MldRYzB2WUZSK3BuVXR2UX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hZzJtVHlyWC9leStIbWgrd1N2NmY5WFh2QXViRUdwU2ZP?= =?utf-8?B?MmpCUE8xSW5pTkk3elZIc2ZYM0RKWXh0THVBeHZXOGEvVTVETGZ0cEt5RWwr?= =?utf-8?B?bGVVWTA3VWRXcEJuUnNZVXZxVUVCYmJiRndUS2pwQWxkblh4bWZFZG1ncEtj?= =?utf-8?B?QVltcW82Rmd2azJOU0pLejdRc0kzSlNpT2JJOFdzL0x5TTVYK0VzZ1V5SWxQ?= =?utf-8?B?TXZld01rUk8wRDJqcmErckpsWnNhMGhmSWtsMkpFeUp5YUE5VzhCQ2wwV2hT?= =?utf-8?B?M2pEK1NRckxNTlpXTEg3azZ4ZUhTUVRac2svSERVWUlRZzV6NXdsazFzU0lT?= =?utf-8?B?SmM5RGUwTEdWdDJTQzkrQkFmektmRHNETy9HdnhuK3k4UFRBN0MxSU9OS1Bl?= =?utf-8?B?anlIOHFnQTNrQXMrUTdCNDVkNW9VUVUrT0Z5TWJxQzc3SWo4SVBFSTduakxj?= =?utf-8?B?SXZmQ3N2RWFtQ0lYbzN2Y2dyYzVzbUszMHNOWXcxNGZ3SytlQTcrNkowaG0w?= =?utf-8?B?dTJBd2VXZkNHUzcwbFpCbzBwNVVtZVByUmN6NGU1QkJKS2IrWHF4RUgvTjNU?= =?utf-8?B?cVFscUZXUTNpYmxLdkVHdz09?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.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?aDBUWUFHT01SWWRFUUE3ajdmODQzUG92eDN4VTZOWEl4RWtYVEI3Wk8wMmpl?= =?utf-8?B?VTlXcGdhZkVEOHNJWTRTTzdrL0tXMEVuRndiVTBTS29TZ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HpsRm9oVTFBb1VRTzFlUG43N3g5?= =?utf-8?B?R1Jlc1dvZnpJSWhFNU9Tem9SS25icTVzVG5FL1BLZ2cyRk5GdjhMaDRSVkFM?= =?utf-8?B?SVBjbVg1cDJuZnNTRG1rc2s4ZTJtRmxtdGNHWUdoUXhCazFJN3Z6QWFLVjVa?= =?utf-8?B?MytUejRGZkMwaU9kNmovc3kzWlhweGhic3ZRZHZMUjg4ZnlabURheGZKWDhv?= =?utf-8?B?RjJ0ZnlWR2VhaEtkYVlFOHhIYkZxZC80WEx5L3lkc1crWDFjSG5kWUJiZXVk?= =?utf-8?B?Y3c9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: 0cc1ef1b-df31-45fe-16a6-08dd12d4a7c2 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2024 13:24:31.4906 (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: 0WNAZasxY0U6of2oxwHDLTkjy1RF/VOc32VobsC7FCibrEJpVS+00Rfdd4ZzuqxZxnQrqJg24CpTdeV1D12turQKUFqGFjTBp/LINgsBnhk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR11MB8311 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 On Mon, Dec 02, 2024 at 01:59:37PM +0100, David Marchand wrote: > On Mon, Dec 2, 2024 at 12:27 PM Bruce Richardson > wrote: > > > > The actions taken for post-Tx buffer free for the SSE and AVX drivers > > for i40e, iavf and ice drivers are all common, so centralize those in > > common/intel_eth driver. > > > > Signed-off-by: Bruce Richardson > > --- > > drivers/net/_common_intel/tx.h | 71 ++++++++++++++++++++++++ > > drivers/net/i40e/i40e_rxtx_vec_common.h | 72 ++++--------------------- > > drivers/net/iavf/iavf_rxtx_vec_common.h | 61 ++++----------------- > > drivers/net/ice/ice_rxtx_vec_common.h | 61 ++++----------------- > > 4 files changed, 98 insertions(+), 167 deletions(-) > > > > diff --git a/drivers/net/_common_intel/tx.h b/drivers/net/_common_intel/tx.h > > index c372d2838b..a930309c05 100644 > > --- a/drivers/net/_common_intel/tx.h > > +++ b/drivers/net/_common_intel/tx.h > > @@ -7,6 +7,7 @@ > > > > #include > > #include > > +#include > > > > /* forward declaration of the common intel (ci) queue structure */ > > struct ci_tx_queue; > > @@ -107,4 +108,74 @@ ci_tx_backlog_entry(struct ci_tx_entry *txep, struct rte_mbuf **tx_pkts, uint16_ > > txep[i].mbuf = tx_pkts[i]; > > } > > > > +#define IETH_VPMD_TX_MAX_FREE_BUF 64 > > + > > +typedef int (*ci_desc_done_fn)(struct ci_tx_queue *txq, uint16_t idx); > > + > > +static __rte_always_inline int > > +ci_tx_free_bufs(struct ci_tx_queue *txq, ci_desc_done_fn desc_done) > > +{ > > + struct ci_tx_entry *txep; > > + uint32_t n; > > + uint32_t i; > > + int nb_free = 0; > > + struct rte_mbuf *m, *free[IETH_VPMD_TX_MAX_FREE_BUF]; > > + > > + /* check DD bits on threshold descriptor */ > > + if (!desc_done(txq, txq->tx_next_dd)) > > + return 0; > > + > > + n = txq->tx_rs_thresh; > > + > > + /* first buffer to free from S/W ring is at index > > + * tx_next_dd - (tx_rs_thresh-1) > > + */ > > + txep = &txq->sw_ring[txq->tx_next_dd - (n - 1)]; > > + > > + if (txq->offloads & RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE) { > > + for (i = 0; i < n; i++) { > > + free[i] = txep[i].mbuf; > > + /* no need to reset txep[i].mbuf in vector path */ > > + } > > + rte_mempool_put_bulk(free[0]->pool, (void **)free, n); > > + goto done; > > + } > > + > > + m = rte_pktmbuf_prefree_seg(txep[0].mbuf); > > + if (likely(m != NULL)) { > > + free[0] = m; > > + nb_free = 1; > > + for (i = 1; i < n; i++) { > > + m = rte_pktmbuf_prefree_seg(txep[i].mbuf); > > + if (likely(m != NULL)) { > > + if (likely(m->pool == free[0]->pool)) { > > + free[nb_free++] = m; > > + } else { > > + rte_mempool_put_bulk(free[0]->pool, > > + (void *)free, > > + nb_free); > > + free[0] = m; > > + nb_free = 1; > > + } > > + } > > + } > > + rte_mempool_put_bulk(free[0]->pool, (void **)free, nb_free); > > + } else { > > + for (i = 1; i < n; i++) { > > + m = rte_pktmbuf_prefree_seg(txep[i].mbuf); > > + if (m != NULL) > > + rte_mempool_put(m->pool, m); > > + } > > + } > > Is it possible to take an extra step and convert to rte_pktmbuf_free_bulk? > Right now that's not possible without some more severe refactoring - and even then I'm not convinced that it should be done. The code here is working off the buffers in the shadow ring directly, where they should be flattened out to avoid having mbuf chains. Therefore, we are freeing segment by segment as each buffer has been transmitted. /Bruce