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 9D699A0560; Tue, 18 Oct 2022 21:46:22 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E1CA742B6C; Tue, 18 Oct 2022 21:46:05 +0200 (CEST) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2073.outbound.protection.outlook.com [40.107.102.73]) by mails.dpdk.org (Postfix) with ESMTP id 596D440395 for ; Tue, 18 Oct 2022 21:46:03 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UNpfkzQ7VHNuthIF8IjQXkHrLGxnODGz9A0dBYEBkFP8obZjY0ewGPZxDl46zRh/Tp6MhZp88I4J3qglz+4obaAkRGGm/aGJgFLscRo1x4pPeb5eKPu4Pf5EGh46VPbG0sk4pcL/OQkAJGb2djIvpj/kuA/o/nBij+92n7ySF958Hub1JbqNguQB4ly9x0fJRGwjUS+XYfeZlc8dSdsW59pL/EOn0P8EPBaEV4EB/PKaA2DsBpWQK0tk2+X4XbpLcFeeCPibTS0oZFT/hTnMJ8bwgSOUQxEMo0Sdfyc1slIJ4H5IbVCsifMiQWmY96CDwW2TPJe6gPRIBoDiWqL6qg== 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=lAyDPG64GYEdfusXEI9C+32iTguxhOi3hdQ0bFwMP08=; b=i5y56uOuPpX/jv+HGye8ohxQAZkEtxjWmQC2zncBt/2HImumkNsFZlUxxRBq8a7wXJf0v2qOG5Q7QRoSlKmUj3XJwnFwDWz4Q8d7Ljz4PNvBNrxuBLRzrUFq1AvcDPFEgj3C8voB5dXoZ74DPKrQjR//AcrPRDdxZQboWxmTZMWhlt2LzJpyw5sKWX2U4s0l+n0hjMVgkdm/4FDQx6meeCfAoxoBohMmAlWEL7WdEUL4P78h719XeYUDO1c8j0hGqOUaGyw+kTJrbhyqvIVDCWF0Bq2sD59R651kXNknjpd+kLcCdBixRq6jbTeoMj37HDFaBycrPSgBHrzp41uRkg== 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=lAyDPG64GYEdfusXEI9C+32iTguxhOi3hdQ0bFwMP08=; b=uOCAVP/6YjZ9YurO0kKcHEzo3zeMCNbTHgk2UF17q/8jZ1M0zu/QdRUWRUbeXTjdCnkQYzhIdBiWA1r/NvuoqpoyDhMMnY+k3A9HLBdrip67TidPgKzNLbp/NB4CLIn9AYt9jdSqi+SFtbUOu82qiahIDsG+d2pE7GM/6dMg5KA= Received: from DS7PR05CA0105.namprd05.prod.outlook.com (2603:10b6:8:56::19) by CH0PR12MB5267.namprd12.prod.outlook.com (2603:10b6:610:d2::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.33; Tue, 18 Oct 2022 19:46:01 +0000 Received: from DM6NAM11FT108.eop-nam11.prod.protection.outlook.com (2603:10b6:8:56:cafe::63) by DS7PR05CA0105.outlook.office365.com (2603:10b6:8:56::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.6 via Frontend Transport; Tue, 18 Oct 2022 19:46:01 +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 DM6NAM11FT108.mail.protection.outlook.com (10.13.172.95) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5746.16 via Frontend Transport; Tue, 18 Oct 2022 19:46:01 +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.31; Tue, 18 Oct 2022 14:46:00 -0500 From: Andrew Boyer To: CC: Andrew Boyer Subject: [PATCH v2 22/36] net/ionic: add support for mbuf fast free Date: Tue, 18 Oct 2022 12:41:17 -0700 Message-ID: <20221018194131.23006-23-andrew.boyer@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221011005032.47584-1-andrew.boyer@amd.com> References: <20221011005032.47584-1-andrew.boyer@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT108:EE_|CH0PR12MB5267:EE_ X-MS-Office365-Filtering-Correlation-Id: 9ca71a71-0c50-4547-aea7-08dab14162ed X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 92lhXCifoTmO3FkaK2aeSi0FsPqV60Y8zmkPkIBvG2H5wahhkW7kRlMpUZfipgQLiJUbHALFMzS65Yo25bqnMDDX91y2Hxn0cN96MVsjFYGEbufYcsL/WU65uVdUCs2XiLAb1KFt2fqf9jlnXpirwAsmwKWC9jsoLbt3W3BjuP8IFlDI1/c8H0CiWtEaJtHNwX8Ajixkxl0cLMEuzhIdmK/ukdScvT/hYouiL1SIhchm7xK2L5IHsJMEjxz4EC8rGEywM1421DEvYhUKJd+1FDIYK8kEiN8j7B0Zu81HT/u+QCVYHDiiWrjMup8+1HD4im8WydODJlg2yV0xKF8tUH7ERPwgWmVQfZ/77VXWeansn2Qfes444l+4uxRcL8WykJ3taEdIdN13E5XZneIEFGqVMhnnRX1YCLzCM9ja2703CaLY/mqL9njLbdoIA5hwsjLOlKr8fL0zP0nLunkfaiKH+Mt5DqcpBmZCo/i8qhdOG+VT3uKRYJ35h+Js67+ANJTq3tx3EREXvklQVIlyzOY6ktNR6JxWKRgz/BD+ApAkV7MwXrElkhMmgdjYtLLCJw8j8j8hOjrwL5k9YAljboK9hcvvM3kd58rxQKiKpNeWK7g00QA5ZhaNfy2kxtN+K7Hu5WE5uTgOerDYNGfVB4rEk5ek2Rtk7s/KsNlRF9zUQBEVKgO9OGUIx75qXyvRL+5G4200H2be9IuYE1XS4NfpL4AXM56q2XyWu0PDnQqECgsIc18Fz87Y0NpAYQNfdUTrSTUL6yemF2x8+ZFVfJKVRphn7RJDftDcNkQME8cURoLKIml2zvjj1bRJMMqJ 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)(346002)(376002)(396003)(136003)(39860400002)(451199015)(36840700001)(40470700004)(46966006)(86362001)(36756003)(81166007)(356005)(82740400003)(2906002)(336012)(40460700003)(5660300002)(40480700001)(44832011)(6666004)(26005)(1076003)(186003)(16526019)(2616005)(47076005)(426003)(83380400001)(36860700001)(316002)(478600001)(82310400005)(6916009)(41300700001)(70586007)(70206006)(8676002)(4326008)(8936002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2022 19:46:01.6456 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9ca71a71-0c50-4547-aea7-08dab14162ed 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: DM6NAM11FT108.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5267 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 72ddb43f51..4ad525375f 100644 --- a/doc/guides/rel_notes/release_22_11.rst +++ b/doc/guides/rel_notes/release_22_11.rst @@ -146,6 +146,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. * **Updated Intel iavf driver.** diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c index 7d95e52346..7d21bc0a9b 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 ce31b66a1e..547d4873be 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 56701e90d4..64766f2652 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