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 BFD59A0544; Tue, 11 Oct 2022 02:53:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9063242C0F; Tue, 11 Oct 2022 02:52:16 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2072.outbound.protection.outlook.com [40.107.92.72]) by mails.dpdk.org (Postfix) with ESMTP id D7A3E42BC0 for ; Tue, 11 Oct 2022 02:52:10 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cO8roj/dUVUbhvxARmF1QHtSHFi0DoBD/R5lFdMACB2zRNEomwG5aW8t+uG8VOGfJIjCba9EIGDn9tYtb7sZft+hQCVlhe77CzpjB09Jjq3GPx3LU+7NF9NxH2uUx4eu5mYDPMg3fm6bce2DQ2hS6InUDJn2h8IyIL5St18wvtZGhPt/0wsTvnU6nYFiiTBuiJPRMZzBKfRXr+ImDOBXVSQhl4Vqa+tpgDZieHJgKQkmh0rwKLKLyrzxyxC5XNAlruVLSLyiTPJ9Sfo9xgGGyEyvVM3H7r+Ckjo+WOlEJaH697C6ELPo6pK3U1AroCYeTCk/l59phtl86GffoMvnaA== 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=S+ODeChs7665U2BSNR6HZwxuimbSprUOjDZM5BYdXfU=; b=HHeYg5nByzFNuGrWG9XI+rib9Ju8n8vSphPd8kKqWfcQVVoNWdvn3cpWM9qCgHoGr+LFlHZBgVdCIXNrnwKP6bYbddbv7JjbW9LHhi/tZaGPrv6fdFaamONy43geVqKCvDPTBRQ6Qh8EOD37fEZYGCw2iXjIlmh3k+SbZu310gl8vnkJ0KAcqeeE4C4ziUqtkK3XTpDf3/XD36fT7FzH3uRoeBQIQ3P4bCJCAfgGOag6BN6ez+w31WKfTCh///btqU9MsctHE8cf0eZ9mC0ZZqjWmQ3FzLHUzrVRQHrlQjg/Q7FI1lzbl9fJpMDFebfxk2iIFX5VJNoATDaKyedEdg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=dpdk.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=S+ODeChs7665U2BSNR6HZwxuimbSprUOjDZM5BYdXfU=; b=AxyqAZ/inMHDcRr3MMJDdo2CQQMzE27UDjwSg1x2YwSdjfRmL1NI7SteJ/ognTGHT10pCB2Th89/dcBvN0LXrJU233CcmHtla6J9O8uwR6T3MAKOj9BWlNP+cYGOovB2VTuEbhaWyAIUd6LIHawm3R92gYpEbzOTlEEY731SoOY= Received: from BN1PR12CA0007.namprd12.prod.outlook.com (2603:10b6:408:e1::12) by DM6PR12MB4912.namprd12.prod.outlook.com (2603:10b6:5:20b::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Tue, 11 Oct 2022 00:52:08 +0000 Received: from BN8NAM11FT110.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e1:cafe::13) by BN1PR12CA0007.outlook.office365.com (2603:10b6:408:e1::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.15 via Frontend Transport; Tue, 11 Oct 2022 00:52:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT110.mail.protection.outlook.com (10.13.176.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5709.10 via Frontend Transport; Tue, 11 Oct 2022 00:52:08 +0000 Received: from driver-dev1.pensando.io (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Mon, 10 Oct 2022 19:52:07 -0500 From: Andrew Boyer To: CC: Andrew Boyer Subject: [PATCH v1 21/35] net/ionic: add support for mbuf fast free Date: Mon, 10 Oct 2022 17:50:18 -0700 Message-ID: <20221011005032.47584-22-andrew.boyer@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221007174336.54354-1-andrew.boyer@amd.com> References: <20221007174336.54354-1-andrew.boyer@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT110:EE_|DM6PR12MB4912:EE_ X-MS-Office365-Filtering-Correlation-Id: dfbfc237-15d4-474f-2805-08daab22d2db X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 73no7Xba7Ndtw7bSH4ZckcBru0i6EF6EKHJyyFOxgtyZLjEenBOSko/JqR28lggUOPREYuYNk+mKgEee3fD74qBo7mX1rD7ZpXgqb3P0Q+aDkJktyqcEc0avO0rVVY0flEisV2mAQzoRxnPIqI5qEvafbYjuTxfBMYSCVhvi6hV/MIfa655D48zLEE/rhNZJm1rrgqU3UP8C9kQQwyB7Vy/OmHzbUrRSsrHZUAHJweGctgzh0iXMzGy0kVSaVizyCaJssaPjMxGXMDqAC27/sC9Iwtf1dLwjM6nLobXMYS+1M7DA1Z1lIj9Ni3f+FKzRG4ktSiJhW7yF+gO4hVbifCOb39JtxnaKhzJCDKbDyJ2XhoZ+MhNzUWNWlaQ+Fx7uMCMbIaaU2vrk+bWLZeRy+JhhwKRXpOZJY/aH1owBDTk0kDLkRenSsDCQJmmd3lXfJEPAhbEYvI5zShNI50EaijMU2AOlzBqGoPNpn36CtPU5axh/Lprc+1vP6xASSswz2BdONqA3EgYWCGcMbVvn1VEWFqAOW+4i4dYd00/n8azoI7D0+jArpgoUjhpNIi0vaCuR3vxzuEbCEjnTcIeBMEYQvreGdb2lxCj14NVTROHihQuzvyzfA0OnVrZ5sUoKZxwOc3zpJScJetXNxlk0IXnKORLTf+0shg6UubFSFs3GfYoF0lXImiuWxC/zqemrhj6hI/jgtNOfTRWg6Y9KDjvjXdKuVSfW6UG9EHbQvSnallU6m0mOkV5DlOC1Fl+VMRfNUcQesTE8p8z8TaAeMab3tKjeXrhq9B0WfDdD2Fa4wg2p7iXfXPIGVX6g3Rzb X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(39860400002)(136003)(346002)(396003)(376002)(451199015)(46966006)(36840700001)(40470700004)(6666004)(26005)(5660300002)(356005)(316002)(82740400003)(6916009)(81166007)(44832011)(478600001)(186003)(36860700001)(40460700003)(86362001)(4326008)(36756003)(426003)(8936002)(70206006)(2616005)(8676002)(70586007)(41300700001)(16526019)(83380400001)(82310400005)(1076003)(336012)(40480700001)(2906002)(47076005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2022 00:52:08.0693 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dfbfc237-15d4-474f-2805-08daab22d2db X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT110.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4912 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 Use a put() rather than a free() in the optimized case. Signed-off-by: Andrew Boyer --- doc/guides/nics/features/ionic.ini | 1 + doc/guides/rel_notes/release_22_11.rst | 1 + drivers/net/ionic/ionic_ethdev.c | 2 +- drivers/net/ionic/ionic_lif.h | 1 + drivers/net/ionic/ionic_rxtx.c | 9 ++++++++- 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/doc/guides/nics/features/ionic.ini b/doc/guides/nics/features/ionic.ini index 5bd18e39e9..77947bfd22 100644 --- a/doc/guides/nics/features/ionic.ini +++ b/doc/guides/nics/features/ionic.ini @@ -7,6 +7,7 @@ Speed capabilities = Y Link status = Y Link status event = Y +Fast mbuf free = Y Queue start/stop = Y MTU update = Y Scattered Rx = Y diff --git a/doc/guides/rel_notes/release_22_11.rst b/doc/guides/rel_notes/release_22_11.rst index 6c8a8d5bdb..2fdc82b673 100644 --- a/doc/guides/rel_notes/release_22_11.rst +++ b/doc/guides/rel_notes/release_22_11.rst @@ -165,6 +165,7 @@ New Features * Updated to reflect that Pensando has been acquired by AMD. * Enhanced data path to provide substantial performance improvements. + * Added support for mbuf fast free. * **Added support for MACsec in rte_security.** diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c index 186cde8330..38241d41ec 100644 --- a/drivers/net/ionic/ionic_ethdev.c +++ b/drivers/net/ionic/ionic_ethdev.c @@ -396,7 +396,7 @@ ionic_dev_info_get(struct rte_eth_dev *eth_dev, */ dev_info->rx_queue_offload_capa = 0; - dev_info->tx_queue_offload_capa = 0; + dev_info->tx_queue_offload_capa = RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE; /* * Per-port capabilities diff --git a/drivers/net/ionic/ionic_lif.h b/drivers/net/ionic/ionic_lif.h index b0bd721b06..4fb1f213ff 100644 --- a/drivers/net/ionic/ionic_lif.h +++ b/drivers/net/ionic/ionic_lif.h @@ -50,6 +50,7 @@ struct ionic_rx_stats { #define IONIC_QCQ_F_CSUM_L3 BIT(7) #define IONIC_QCQ_F_CSUM_UDP BIT(8) #define IONIC_QCQ_F_CSUM_TCP BIT(9) +#define IONIC_QCQ_F_FAST_FREE BIT(10) /* Queue / Completion Queue */ struct ionic_qcq { diff --git a/drivers/net/ionic/ionic_rxtx.c b/drivers/net/ionic/ionic_rxtx.c index 53b0add228..30f7ce9fc6 100644 --- a/drivers/net/ionic/ionic_rxtx.c +++ b/drivers/net/ionic/ionic_rxtx.c @@ -94,6 +94,8 @@ ionic_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, qinfo->nb_desc = q->num_descs; qinfo->conf.offloads = dev->data->dev_conf.txmode.offloads; + if (txq->flags & IONIC_QCQ_F_FAST_FREE) + qinfo->conf.offloads |= RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE; qinfo->conf.tx_deferred_start = txq->flags & IONIC_QCQ_F_DEFERRED; } @@ -136,7 +138,10 @@ ionic_tx_flush(struct ionic_tx_qcq *txq) if (!txm) break; - rte_pktmbuf_free_seg(txm); + if (txq->flags & IONIC_QCQ_F_FAST_FREE) + rte_mempool_put(txm->pool, txm); + else + rte_pktmbuf_free_seg(txm); info[i] = NULL; } @@ -240,6 +245,8 @@ ionic_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t tx_queue_id, txq->flags |= IONIC_QCQ_F_CSUM_TCP; if (offloads & RTE_ETH_TX_OFFLOAD_UDP_CKSUM) txq->flags |= IONIC_QCQ_F_CSUM_UDP; + if (offloads & RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE) + txq->flags |= IONIC_QCQ_F_FAST_FREE; eth_dev->data->tx_queues[tx_queue_id] = txq; -- 2.17.1