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 BD010A04FD; Fri, 7 Oct 2022 19:46:45 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 06EF442BA0; Fri, 7 Oct 2022 19:44:58 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2081.outbound.protection.outlook.com [40.107.223.81]) by mails.dpdk.org (Postfix) with ESMTP id 4635042BC3 for ; Fri, 7 Oct 2022 19:44:56 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fiIKm+AZqH7ywv45iFcu9sIfIb3eox/r7Vmc32RBzv/RL+6aoQeaBpgL9UqjYGMKXmdC/irWiruEe0AaftakTtyVuIcQImukGekZAt+8qvfHLo9j77WcP7xFUSV4ZgwVombCiB9hspmjLDV3DltiGDDukJrQAIqzjNYrNh2IanhA/APgSbeDDdiWyA2tkcqWmm3Bgo7c14fa2qahRPOAswfUZvd7PWDrv6GV5Cc3MaFpb3iy9LtPKuldPokbjsGrghJkXsogfiolGZTAkY5EdJV7hBtE+Gg7xNBtSZM31ot1T6w8gPkVz8UCrr3FIFySEvo4AOK0J5SddA9DRi2Ovg== 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=+b1E+uDUsWGI/Q6G2fa4WQmHCcxh6U2YHL0jzWNhS4Y=; b=DXNLmAxlqYKFND7UCocfWbg/kwT7uME1hrwcuYGoEptqqEV9w5IOP+ZFSjO8G0V60DBgC10L9/FwDPvmFbjG2RxQQs8nWSYc8qJ3dbFVh8fp4jY52+YbnyBcTwJX+8HIfvgUIhLLkGS+AJSMeT/xDDr5bxMru+ubzNTUChKxN+lsDOJIkugD/zKmtChtwH+8hd+NM0dLwPiI+BBLBljxHD0ygGKcbm/BHoPI5bN3VieDQvN1FA/nHuuOw0bCfvdJ8vOZ7/02Skb5i+9egtQ7BJQS6+ro7QD2+MZCHbnBGk+I4YuAXO5/EkmsaX56As12t53vTCwooYaHYPOFdW/6EQ== 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=+b1E+uDUsWGI/Q6G2fa4WQmHCcxh6U2YHL0jzWNhS4Y=; b=uW+EacYzIxDqiNu2gmBS9mMivLUDcluQDxBFuAmItMMBqLaMkUAI9AMmLu8YYc0G/P2q0LDIu1GHJXVmqVsk+66GRPaahSFiU5UcfdUsDFGfhUyY4OPuIEsQ9+KjEjMZTIqKQAzP7CBvEfljoVdzCJKfg5qpJHFFr5BWdiJfezY= Received: from MW4PR03CA0339.namprd03.prod.outlook.com (2603:10b6:303:dc::14) by MN0PR12MB6318.namprd12.prod.outlook.com (2603:10b6:208:3c1::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.28; Fri, 7 Oct 2022 17:44:54 +0000 Received: from CO1NAM11FT068.eop-nam11.prod.protection.outlook.com (2603:10b6:303:dc:cafe::46) by MW4PR03CA0339.outlook.office365.com (2603:10b6:303:dc::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.28 via Frontend Transport; Fri, 7 Oct 2022 17:44:53 +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 CO1NAM11FT068.mail.protection.outlook.com (10.13.175.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5709.10 via Frontend Transport; Fri, 7 Oct 2022 17:44:53 +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; Fri, 7 Oct 2022 12:44:51 -0500 From: Andrew Boyer To: CC: Andrew Boyer Subject: [PATCH 21/35] net/ionic: add support for mbuf fast free Date: Fri, 7 Oct 2022 10:43:22 -0700 Message-ID: <20221007174336.54354-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: CO1NAM11FT068:EE_|MN0PR12MB6318:EE_ X-MS-Office365-Filtering-Correlation-Id: fb5a63c0-6ec1-44aa-8912-08daa88ba411 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wXEDeuO/6auzLnCCfdq9TpvsLsrp/yEIZ6nxhEqW224ANz7bWrZIMdQKqr445miFCe6R+Og6bkN1KgHGfFur1cBPPbgDl6GFVH3I2jQq3CvAo8y+SP/OtAzjsI0Jj2x8Bedo5cc5epUvxjZ8B+ITcq0dPoZWdHcvU/GQ5tGOoMqIneqM20gyEIPIYRtSyAAZfCda1yFTaGMXH4vtj5fdjf5U5eFUL1p6dFul21VTA9mMyWKjgSQ6FCtHS0F4TDW4s67njMpZpqS2+wH9KqRzFZ6i0+tqvyPDoH2zGTiKq5KW/TI/VWDEzYaRlPZD83xhdkmCOc5DHGvQBwSFXCanT7X1b0tyMAiZnHxrlScPhV7NSR3QHcJbMmGjfS4q7Ej3/4zT4m3N+9mSzzd8ckm85cEjtmR9c80/CwRit1WgL+Gs946mHwF/sghpVb9eyCq0thyIeMFiFSiGZe2hpbcNdV65x2Y8v1qRNKVZRdamor3GOOZ7VwXjWXbRLO0GakgV1NIceXEEcQBpzSvz+UCrPBRqhJxmFNbKvS5+GBkyQHJfrUIy1OOM8Ue84IbkL7KO4GsMkW8bb1m+/tB4jxBuwfc4esNczRNAyLPbppFPF0kKcjh59wvkioLxUuIlOJVHY5jqSbRQwuWiU1yuW6DVuvgCjW7tLSF4dUV/8hDBLdUvAsUHuZSh8gr07TMg4/IyKPkX4Gq1aTfVqaaewbQvzUXf21sBCBRRI/g2vPR/o0emN6A6FYyM+Z1+9HmA5NCA8A60wS0lwrmGFfwsO9gu22bwVTNF04jRt0SlSb71Z3040xUEWFskajX1nymw4W5I 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)(396003)(376002)(136003)(39860400002)(346002)(451199015)(40470700004)(46966006)(36840700001)(186003)(40480700001)(36860700001)(356005)(40460700003)(36756003)(70206006)(83380400001)(86362001)(82740400003)(8676002)(6916009)(4326008)(82310400005)(2906002)(26005)(41300700001)(44832011)(316002)(2616005)(8936002)(16526019)(478600001)(426003)(47076005)(81166007)(1076003)(336012)(6666004)(70586007)(5660300002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Oct 2022 17:44:53.1161 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fb5a63c0-6ec1-44aa-8912-08daa88ba411 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: CO1NAM11FT068.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6318 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 d7eced510e..0c962f9637 100644 --- a/doc/guides/rel_notes/release_22_11.rst +++ b/doc/guides/rel_notes/release_22_11.rst @@ -84,6 +84,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. Removed Items ------------- 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