From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0062.outbound.protection.outlook.com [104.47.38.62]) by dpdk.org (Postfix) with ESMTP id 9E7842C55 for ; Thu, 30 Mar 2017 17:12:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=7J+06ya84dVXncHsjPFbphhOxlA+2dYcJy5GXVmEHas=; b=KKYOFNcpUVOfgS+dMA3eW0HWOwMNlSFRXpFKcClCHsbmHux0TJKBGyrjTSanjhaPBLYf++AYjdv69yi9XSePUXk0ZKX6IVZVUXoyph2GeTUL1i4SpWWHcwEX038zCQyYu9iv8fB589FKbGNP6+aoZeJyIV5iJ7bdx7gWHf3FcQo= Authentication-Results: 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost.localdomain (111.93.218.67) by CY1PR0701MB1726.namprd07.prod.outlook.com (10.163.21.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.991.14; Thu, 30 Mar 2017 15:12:39 +0000 Date: Thu, 30 Mar 2017 20:42:18 +0530 From: Jerin Jacob To: Olivier Matz Cc: dev@dpdk.org, bruce.richardson@intel.com, konstantin.ananyev@intel.com, mb@smartsharesystems.com, andrey.chilikin@intel.com, jblunck@infradead.org, nelio.laranjeiro@6wind.com, arybchenko@solarflare.com Message-ID: <20170330151217.jugzwkhfm6jijzzc@localhost.localdomain> References: <1485271173-13408-1-git-send-email-olivier.matz@6wind.com> <1488966121-22853-1-git-send-email-olivier.matz@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1488966121-22853-1-git-send-email-olivier.matz@6wind.com> User-Agent: NeoMutt/20170306 (1.8.0) X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: PN1PR01CA0116.INDPRD01.PROD.OUTLOOK.COM (10.174.144.32) To CY1PR0701MB1726.namprd07.prod.outlook.com (10.163.21.140) X-MS-Office365-Filtering-Correlation-Id: 37f0aaad-1322-4f28-37b2-08d4777f36d0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:CY1PR0701MB1726; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 3:wA8pbIkJfiuFvSLYV6nc6sEJPMT2XCl8LDz7KBBxFs+y3T4U2nyjL2RHu14g5ooEqxzm7SUwcLYpY3bLld5nVvrEWalS5e/N+RcPtc59bMQymbug+qApA5rotjv4lKxKa411bcsBLxy+wGz8FQXsS0O4OoLygcChUhaVMgjxCCLlwMQee8Buui7CgdXM9R8S83rxYQ78ZhNVHp5MzdDyzSm5SBfcdSzIjuAH1ql+6l+qkHYdgw7sVxqd9AwzXCFlhGQUYFwT58NRCpfuHLDmxW/zQRY12WJ+NX1PoQu0zReCE8dTM9zP2H7UpHW3wJzofSb8OmrpgGvQL1GZIceTWg==; 25:Gs6j0iCgjE+3kytHaxYQhjuMtFoddFEd2q4sorYexGJr7zBef8j68UnNXqNr8znC5g52DHBAp5+7tb4sHwRrv2n7gBUIrYG3pHLQvqBUTK2tMKmwZeIodwpn6bI9TkdJn73yZrV3uXT+u5S61mS3alwaoDF8kQsO9BpWRCWl1bl/P4oW3gurMDDtgxDPKGYoaFnH8n1DVJa2eN2axMfyUuEF9ZivFyPrGvpxYiQGJwM8J431ZVoLLnEeidJi3oTJexRt93676YOSUtfxiL+VJLBM9BU/qKoz1iDNgpHBiWN8MTdlgVbrKbhcMQuOVBrivwrZFLvjVkGFMTQCnFuzeweD7inrz3dHufPpd5A4bwRJUSBxK6Xg8uUEeLt9wK7D0DRSdotxSDfi/tFcgLcPIJy0PQRIdBtu+xmaMFgDHCGohQFSqp7gWV2wgUy9VnCS1JBvRq2GB6hQyIgiZpcvIA== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 31:zw3U9kEx69z/UZBzbQCBKWBuip+In3lqL8q5pR83HKxIEJzu3RFDYjV1ARd4f02O4IYBvUzcTYar9N6eCucC7VKwKLDAB7ttirPDtijT6lojsvf6qnFWhFdMPsigOAzTVpnoYR3+RtFF01c0nzr8n+nJHSkPkv+Nn8k+yxwh84rJ/ETXKwSFCcGNyBqFFF622rLjvtcPZ0ekURNN5YYdnQqjrStcvcw9F3QsldyLJlUoO7FYnnuaQC1YWPj/XJoQ93OYDxo6vQB40Hsc1srRYud89f9wdAfHouAEwmqyIvs=; 20:1FLWH1YaaQDoyvwiRA4svbu8IL3Rkz5c71BpOiL0H/Jrg//aH0bCX311hRZ5qOzuOTwRAtuZwGZTjhRO5x4WSFNbcw3VCMo6iri7SvwPfv1QFds2gbnpb9R3NfMt+BEXipirnck8WkNtVkvQpXnzxZNe3fX6823VeETJHP26Il6R1Xv++Nx1RVQrAlNrRlhg+NIvv0U3/+eO6Q4zOXE8mJLpPVlgU2p7OJnAP0hFGdbhwcBjGNKYWVcRUE+XX7zs/9Y15ez6MY8207UPwPo2gbsaRjxhRXhU0fIKoSFYuJY+MbMmpUg3i9oEixEd6Oq2QqE9ZwVnL8U4Fj+NpiBAoYay0orH2B3ld7y41yUrXsL8gEiuC0JrsJRoGUrzAnFjJqv5ikOlldaAgbDhCBd2qeczvYw36HuUUrgrexNYcMRN8qTas3ryDTpS9tKfX3HNoIqfwNMRSTUvb5t00OAECfRKfvAe/7aAqEuOc3dmpNwHwMU384S7+QRBkI90LfLDDBPveAJl+2pwmTTQFzQ8nqNIMjuvj9dpXU/DhvudcbLGtPCoCe0xYVPMwXqf1rMFraiPQ/K7IDCy2Hi13VqQimpENODjs+fa1P6klGDYEYk= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(20161123562025)(20161123560025)(20161123555025)(20161123564025)(6072148); SRVR:CY1PR0701MB1726; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0701MB1726; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 4:9Ry000MW035lJQe/vWdQJFg+vNUNovox1+qJqyircJZBAFfYDBAdEBNsTbxn3XIto6BBqTaP2oI0bfkEuHthMhXC3VTxJIIvBjH6QttveKBp07+Nnp4Ul1SqmdifZ3p5+kMEUQmAPinmFul60CzYkEgZRSHG4bHQZ7TWBM9yOwo8OTQAb+5uSqgvVVo8Lj9CRjpspGREqn+lpXF9KqNZIR3msRrVkipSSM9+nwUsrPuHXycuLBQMzegUrOADwzRDihegUaTECW6knksSOdJzrJjkmqhAMd8ZbnrF3FLtsnqdOeAupVjdBRy2i0tITldKdsZQ74JQBky9tL44pXOF27bewAcnXM1IrGDT97PX9ye+vlciIO1770mPizJ5s3dou0U8F+UKG5osxHTDXWzn0LmL+5PYHXl+WUWHxJqvN7aHUvo8vSqYjYEzlQCrq7e4xfPgomFHcHjLfmSjV6g2mTjzk517CInRPEbCnANkIMp2wndMI5L1dMUkIcbODo02pMBH5T7C31SNiCUF6NRtAIvWzSjF7I8WO6Cw+uVlvxL4VL7uxf0T3QjVh/HIXPyjZ5YpKN6svIh4bDG1+YFOIqvgLEfWxmkX2esvGzzzz0D54O8YitjN5e07h1qQDI4Iw3ENndCFGWx8mcWwBAHmF3OKw+pKfySvoJBjzqPaa/kqY1tmsUGs05fTdcdUDJJ9 X-Forefront-PRVS: 02622CEF0A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(39840400002)(39400400002)(39410400002)(39450400003)(24454002)(305945005)(3846002)(6116002)(23726003)(42186005)(53936002)(9686003)(1076002)(189998001)(6306002)(66066001)(4001350100001)(7736002)(2906002)(47776003)(229853002)(42882006)(2950100002)(81166006)(8676002)(33646002)(4326008)(6666003)(6506006)(5009440100003)(110136004)(38730400002)(53376002)(50466002)(6246003)(83506001)(55016002)(61506002)(5660300001)(50986999)(54356999)(76176999)(6916009)(966004)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1726; H:localhost.localdomain; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0701MB1726; 23:1T7GkrrWQp44U1OLHVY4eL1IJTzalIQeNPLUKIz?= =?us-ascii?Q?h4F5mFu44a3mtYSeAG8QL09538TdS/g1ctyBOx9NwGLtieSnm87H9tA+OIEw?= =?us-ascii?Q?iiFjH2IbWby3gdq2WJ/ZNG5lzm0tsjTbuOALR+Ft3pVAX9WtqVN4lrfI3dbE?= =?us-ascii?Q?oXn4I80FtXSqHHo/rxlUMw5MROljS2qI0/IyT5IFk4LCYahYGJTk1QBg+jLt?= =?us-ascii?Q?gEG2ZrnTIyhoIfJnkTBTcVC06a1lir16OiKBJl6KmYOJYjcS7HjSd+rltYyb?= =?us-ascii?Q?Ds+Twq02V0ps/c7tsWqj8k8viAmoDZIh6E49hJByFfSvu+J+3+er0zdcMHuU?= =?us-ascii?Q?8prgXL8zoXAUvHvW+CQf5apjmHhjMNCU22TMv1fiaPOrEN6PhJGHGA/+4oB3?= =?us-ascii?Q?8NdPc2+VEDi2wAVbxlNGKY/vbIF8SvLcE0riX7u3RLhfN79u7n4cKn2SRlkA?= =?us-ascii?Q?9JpJN1sTPq0uhrMShL3LskpbmphiFCC4fLLQ6JDwriwBwI7BCcexTMSLrTs7?= =?us-ascii?Q?KOVHd/k8A/JnqZP28hk4YZ31zb4FrOof+6UGuJj3m8ltyKOiTcdgF2Kq80XR?= =?us-ascii?Q?m7SR+cPKUbao0O4HBoUBhROJrSTeZR5jfDyZVLAIueiz78PBxsmr4nS2HffE?= =?us-ascii?Q?Hnnc4++SJMdCRSoqWWFJPhb68dbCHOwa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N0MP+rgFaMHmWa1SlUnxGSMw==; 5:RNbFz7+4yGpjDp/9Sf0mLYjuvlXP8LjKfqmKWpoQKCH1LlQsoILdd4Sc2QENHPbjhCLErYk8GpLgyDHhxkoHy6T993fVnXSHrK4J1KOJ8+gqUHM5VcZuS5iDgGp0//6HETWNXubDr4cuCpkVEPCEw/A+avO1USMyP4mxtkAGG/M=; 24:vLzRnio0bFlKu/BoEgd5aJsbQPJi8y21B84f8bvCG6qkgtX9S9IoJTHSGKSkrY++hLaKe2w4KRKy9iLZWDLAItDCdUpNIXPWjuZJzvfFol0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 7:ZCyAqZ6IAwoMd+Oto7B/Y5m4iSr2Yce45WR5y5av/3YAT20PJbsCtI+Rsh0KbNDBUVaBeyuTl9TvdTm10nKwMj9e3E5W4XgCbLMCCAvX2x0THRNhdP3MoCOJkrbOLXCG1ty5Nnj9RZUJuQN7mAi8LJOSanTZKozH3KAyMTZ5qtG0mXrb3eHA5YouxYIc77V1uT6M1MatstRPoitN1PyBUbfGtul1dV9BgX6KJFpM3LYLk+1eKX+zGkLsH258qPhNZEbZRtjyiXK3FNTK7B8hVrpzDI5xa/KGpFc+CwGxvMVjh01ykET/SsxDNW3C5e0trEFhLFsNxd8lg9mLQNPUew== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2017 15:12:39.8529 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1726 Subject: Re: [dpdk-dev] [PATCH 0/9] mbuf: structure reorganization X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 15:12:48 -0000 On Wed, Mar 08, 2017 at 10:41:52AM +0100, Olivier Matz wrote: > Based on discussions done in [1] and in this thread, this patchset reorganizes > the mbuf. > > The main changes are: > - reorder structure to increase vector performance on some non-ia > platforms. > - add a 64bits timestamp field in the 1st cache line. This timestamp > is not normalized, i.e. no unit or time reference is enforced. A > library may be added to do this job in the future. > - m->next, m->nb_segs, and m->refcnt are always initialized for mbufs > in the pool, avoiding the need of setting m->next (located in the > 2nd cache line) in the Rx path for mono-segment packets. > - change port and nb_segs to 16 bits > - move seqn in the 2nd cache line > > Things discussed but not done in the patchset: > - move refcnt and nb_segs to the 2nd cache line: many drivers sets > them in the Rx path, so it could introduce a performance regression, or > it would require to change all the drivers, which is not an easy task. > - remove the m->port field: too much impact on many examples and libraries, > and some people highlighted they are using it. > - moving m->next in the 1st cache line: there is not enough room, and having > it set to NULL for unused mbuf should remove the need for it. > - merge seqn and timestamp together in a union: we could imagine use cases > were both are activated. There is no flag indicating the presence of seqn, > so it looks preferable to keep them separated for now. > > I made some basic performance tests (ixgbe) and see no regression. > Other tests from NIC vendors are welcome. > > Once this patchset is pushed, the Rx path of drivers could be optimized a bit, > by removing writes to m->next, m->nb_segs and m->refcnt. The patch 4/8 gives an > idea of what could be done. > > [1] http://dpdk.org/ml/archives/dev/2016-October/049338.html > > rfc->v1: > - fix reset of mbuf fields in case of indirect mbuf in rte_pktmbuf_prefree_seg() > - do not enforce a unit or time reference for m->timestamp > - reorganize fields to make vlan and outer vlan consecutive > - enhance documentation of m->refcnt and m->port to explain why they are 16bits > > Jerin Jacob (1): > mbuf: make rearm data address naturally aligned > > Olivier Matz (8): > mbuf: make segment prefree function public > mbuf: make raw free function public > mbuf: set mbuf fields while in pool > drivers/net: don't touch mbuf next or nb segs on Rx > mbuf: use 2 bytes for port and nb segments > mbuf: move sequence number in second cache line > mbuf: add a timestamp field > mbuf: reorder VLAN tci and buffer len fields > > app/test-pmd/csumonly.c | 4 +- > drivers/net/ena/ena_ethdev.c | 2 +- > drivers/net/enic/enic_rxtx.c | 2 +- > drivers/net/fm10k/fm10k_rxtx.c | 6 +- > drivers/net/fm10k/fm10k_rxtx_vec.c | 9 +- > drivers/net/i40e/i40e_rxtx_vec_common.h | 6 +- > drivers/net/i40e/i40e_rxtx_vec_sse.c | 11 +- > drivers/net/ixgbe/ixgbe_rxtx.c | 10 +- > drivers/net/ixgbe/ixgbe_rxtx_vec_common.h | 6 +- > drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c | 9 -- > drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 9 -- > drivers/net/mlx5/mlx5_rxtx.c | 11 +- > drivers/net/mpipe/mpipe_tilegx.c | 3 +- > drivers/net/null/rte_eth_null.c | 2 - > drivers/net/virtio/virtio_rxtx.c | 4 - > drivers/net/virtio/virtio_rxtx_simple.h | 6 +- > .../linuxapp/eal/include/exec-env/rte_kni_common.h | 5 +- > lib/librte_mbuf/rte_mbuf.c | 4 + > lib/librte_mbuf/rte_mbuf.h | 123 ++++++++++++++++----- > 19 files changed, 130 insertions(+), 102 deletions(-) No performance regression on this series on arm64 + thunderx PMD combo. Tested-by: Jerin Jacob > > -- > 2.8.1 >