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 3AFDFA0543; Thu, 22 Sep 2022 11:12:44 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3035840E28; Thu, 22 Sep 2022 11:12:44 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on2051.outbound.protection.outlook.com [40.107.96.51]) by mails.dpdk.org (Postfix) with ESMTP id 5C6B2400D7 for ; Thu, 22 Sep 2022 11:12:43 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GfJFEr7JM5i94mrjyB8FNL3rRcWOEoAZY9CbVP7T8NWZQI2OdvYto+CAPrZnskoOiDx7/Mf84ji7UCiMx6HEVWC0TNcfF/dB9VaP2G/Ijis4kC3vQZRRyFccUUW4E+rht49A3rPq8sCyfat0R0jYqA1Qskr5WGUEYC1mIDhO/d1mbEdUAcpDd56ZERTqMlJyeOE++SkGg8zfVjQxPjL8rmS8zUm6pUVb99nvqTavsAiwr9/NPgBXr/DTtibuh3CJmsEvIA1Izef0JbE16Frb4svseV7zF5RGnu1rpcG2A4ghPYkbvlTQs7Dfh9jLbSvvmjsXuGwiUEha3Dx84BOgfg== 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=Lo4mnYXJdx9KDZj9q4xAw2O3rBWs0ao87LTl5cH8yLk=; b=BYwNRSV0bPuw8utSFM77pfuJMVJZZpDgWLG0CkaJrEaXzrFCBEFuyEFMRbwIRXaaeDBwE7NOeuEfixfDiI2qTPTA2oHXZR8QoZkbJbBH7IjelHyuhNgtNntzJh8qODTCWaFwhr0oPwh54ryE0FgdNvxg2axUybGH1FagvaAywAmYsiugmdYNBM+iZSL+Qf+IGEGFvmGM+7Ywu+fp9Ek5JeWHhGHUxvkwxsQkZgQwM7Cj4wuO/xbOB/dXUd316uq1DclauvZP6o/wHRVm9VjJ7l4Ww44sVSMPi1O2ZWA7PgO6CkHe6nxGfFFtceM+Hl83HAlduSN/AK7i9gnAK0wnsw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 149.199.80.198) smtp.rcpttodomain=arm.com smtp.mailfrom=amd.com; dmarc=fail (p=quarantine sp=quarantine pct=100) action=quarantine header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Lo4mnYXJdx9KDZj9q4xAw2O3rBWs0ao87LTl5cH8yLk=; b=NYfH9O4KDpg1lo+PT4m6USjoyhHfkBSrK+T3yZm186mkqlsQekfIwQJa/2JXfapHuAdCHPaI8nL7S/QiqOAuG66hFqNkJ/6+cTsVf25GFnnlsnmL7yMBispbFSyQK2CD0ABkG51sQW2D+8IepFXi22nNSgmGWtQatAu7RylyvD0= Received: from SN4PR0501CA0109.namprd05.prod.outlook.com (2603:10b6:803:42::26) by SJ0PR02MB8848.namprd02.prod.outlook.com (2603:10b6:a03:3dc::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.18; Thu, 22 Sep 2022 09:12:41 +0000 Received: from SN1NAM02FT0045.eop-nam02.prod.protection.outlook.com (2603:10b6:803:42:cafe::c0) by SN4PR0501CA0109.outlook.office365.com (2603:10b6:803:42::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.7 via Frontend Transport; Thu, 22 Sep 2022 09:12:41 +0000 X-MS-Exchange-Authentication-Results: spf=softfail (sender IP is 149.199.80.198) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=fail action=quarantine header.from=amd.com; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning amd.com discourages use of 149.199.80.198 as permitted sender) Received: from xir-pvapexch01.xlnx.xilinx.com (149.199.80.198) by SN1NAM02FT0045.mail.protection.outlook.com (10.97.5.234) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5654.14 via Frontend Transport; Thu, 22 Sep 2022 09:12:41 +0000 Received: from xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) by xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 22 Sep 2022 10:12:40 +0100 Received: from smtp.xilinx.com (172.21.105.197) by xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) with Microsoft SMTP Server id 15.1.2375.24 via Frontend Transport; Thu, 22 Sep 2022 10:12:39 +0100 Envelope-to: joyce.kong@arm.com, jgrajcia@cisco.com, stephen@networkplumber.org, dev@dpdk.org, nd@arm.com, ruifeng.wang@arm.com Received: from [10.71.194.74] (port=8628) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1obIG7-0006Bn-TL; Thu, 22 Sep 2022 10:12:39 +0100 Message-ID: <28278beb-5a21-5ec3-1fdf-d2eb7db72f87@amd.com> Date: Thu, 22 Sep 2022 10:12:39 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Subject: Re: [PATCH v4 0/2] add a fast path for memif Rx/Tx Content-Language: en-US To: Joyce Kong , , CC: , , Ruifeng Wang References: <20220412093243.3670187-1-joyce.kong@arm.com> <20220915065825.26169-1-joyce.kong@arm.com> From: Ferruh Yigit In-Reply-To: <20220915065825.26169-1-joyce.kong@arm.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1NAM02FT0045:EE_|SJ0PR02MB8848:EE_ X-MS-Office365-Filtering-Correlation-Id: 6fbc0421-fb64-408e-a480-08da9c7a9a2f X-MS-Exchange-SenderADCheck: 2 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: v6laFt+RwTMWuNsfvRv1ptkWB+pEZ4UIfcfgaqUH1wJHRynd+D1DNOu1SWEhpkdYJvBPaUtyk+Y5gIJBoGXJGJAJRgltiiAjBq2T7In0FuM0rCTY+xuEkdCW63l3ieUgt8BxeOxhSJJde9uLowTs+GfJLEiJi7lSdTEh5FESp2DXoRpnFX9WwTnp96bStT7+tqI1RW8PzxGGVnQaJrPcVX5hhHg442ywJpDSmq0AE/2wS60OLSdN+Mxbndzpgys8YcZ00eVvr6SsGaPkD1wJH9WTGgf1Aiei6yLTL+QoQpGZ2gsVvrRtB+jEkhsuWEJLJVnyFPpG/OiJQTOv7fLOZt0HIyEabXmxiqPBcpvr0K3T5NLT4GguNlV2VIx29h71SdWX88qGi/ZSNWXSWb4zrixbnzRV8HHjOa0JKJw0PqNsXOw4fhbhOF9CQ+1ufnqFH9Uf0pFuGOGzqWfAgD/I9B3S4pR7ygjcfx4RC0v0MTG4jvOinwT2hUl2vkLXeWZYx/tTgl2p5ejRO9V5fpHqTGCQSihp0mDpbUbGsCcs8+WtvQHEV+Njhi0MYlA6ObFOyR/DFAqrN5uB+s6CMvyaGCq8X2xZHBeAgIFR/gUTfvElskA2XnT27SUbH7lZ6GPgQMHDOoo8dj+wqnkXh9O7iWiileFZ49XCO661tEtUYQfy0J8YPs4jVvRQUT01lojKWQgya9w0VPP2cPpTDPaO0ho6ZZGQxtyiqwAfynfeA26MHFEcyd5S3HSdqE5NZ3+zFqbDM5pk4oaRQZr3uS0rWhiHQrlhShAwh6U+/B+MjI8LWEQlTpY+XtxTG/oMpFP2qqa1KdzesTyFyLoEWY7mU1HIRGfg0/9+npExmUkJLbw= X-Forefront-Antispam-Report: CIP:149.199.80.198; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:xir-pvapexch01.xlnx.xilinx.com; PTR:unknown-80-198.xilinx.com; CAT:NONE; SFS:(13230022)(4636009)(376002)(39860400002)(396003)(346002)(136003)(451199015)(46966006)(40470700004)(356005)(7636003)(82740400003)(36756003)(31686004)(31696002)(86362001)(35950700001)(44832011)(40460700003)(82310400005)(2906002)(40480700001)(498600001)(53546011)(26005)(2616005)(83380400001)(336012)(54906003)(110136005)(8676002)(70586007)(70206006)(316002)(47076005)(41300700001)(9786002)(8936002)(5660300002)(4326008)(50156003)(2101003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Sep 2022 09:12:41.0759 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6fbc0421-fb64-408e-a480-08da9c7a9a2f X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.80.198]; Helo=[xir-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: SN1NAM02FT0045.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR02MB8848 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 9/15/2022 7:58 AM, Joyce Kong wrote: > For memif non-zero-copy mode, there is a branch to compare > the mbuf and memif buffer size during memory copy. Add a > fast memcpy path by removing this branch with mbuf and memif > buffer size defined at compile time. For Rx fast path, bulk > allocating mbufs to get additional speedup. For Tx fast path, > bulk free mbufs which come from the same mempool. > > When mbuf == memif buffer size, both Rx/Tx would choose the > fast memcpy path. When mbuf < memif buffer size, the Rx > chooses previous memcpy path while Tx chooses fast memcpy > path. When mbuf > memif buffer size, the Rx chooses fast > memcpy path while Tx chooses previous memcpy path. > > Test with 1p1q on N1SDP AArch64 server, > --------------------------------------------------------- > buf size | memif = mbuf | memif < mbuf | memif > mbuf > --------------------------------------------------------- > non-zc gain | 47.16% | 24.67% | 12.47% > --------------------------------------------------------- > zc gain | 20.96% | 9.16% | 10.66% > --------------------------------------------------------- > > Test with 1p1q on Cascade Lake Xeon X86 server, > --------------------------------------------------------- > buf size | memif = mbuf | memif < mbuf | memif > mbuf > --------------------------------------------------------- > non-zc gain | 23.52% | 14.20% | 5.10% > --------------------------------------------------------- > zc gain | 17.49% | 10.62% | 12.42% > --------------------------------------------------------- > > v4: > 1.Fix incorrect indentation. > 2.Fix the mbuf array length to avoid additional overhead if > stack-protector strong is enabled. > > v3: > Add bulk allocation to get additional speedup for memif Rx > fast path. > > v2: > Rebase v1 and update commit message. > > Joyce Kong (2): > net/memif: add a Rx fast path > net/memif: add a Tx fast path > Hi Jakub, Reminder of this set waiting for your review. Thanks, ferruh