From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00080.outbound.protection.outlook.com [40.107.0.80]) by dpdk.org (Postfix) with ESMTP id 984F0AABB for ; Thu, 26 Apr 2018 00:54:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=ooSmNQa2fFhX2wh7YOQnlOakwdjdWTaE2joWyh07s2A=; b=EQbLvX9Xp3rbe3N8Orp+mVhUEJu9KsMna0ts6l/tcxCO/LYr7ER4U5mVtA8CYc+Zmc6B8RpUZf9cjFPONppVDDYvQJEnrDvwNCtid/t5Zy600R0cw6uUOFebOCg3UA41KrhycxvsR/3JCW/gsFF8nsojm4IIiQVMm3rSUi83fzc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; Received: from yongseok-MBP.local (209.116.155.178) by VI1PR0501MB2045.eurprd05.prod.outlook.com (2603:10a6:800:36::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.13; Wed, 25 Apr 2018 22:54:47 +0000 Date: Wed, 25 Apr 2018 15:54:34 -0700 From: Yongseok Koh To: Olivier Matz Cc: Andrew Rybchenko , Wenzhuo Lu , Jingjing Wu , "dev@dpdk.org" , Konstantin Ananyev , Adrien Mazarguil , =?iso-8859-1?Q?N=E9lio?= Laranjeiro Message-ID: <20180425225432.GA6216@yongseok-MBP.local> References: <20180310012532.15809-1-yskoh@mellanox.com> <20180424013854.33749-1-yskoh@mellanox.com> <934e714e-3cba-7f5d-9fcf-4f96611d758f@solarflare.com> <20180424160244.bggifhilvadxcjb2@neon> <20180425082821.ktbzjrnxbo4nhqgg@neon> <915EB643-1009-4016-9E18-7DAB43FFDC9F@mellanox.com> <22EF1A3B-ECFF-4A4F-955D-43F992B4F135@mellanox.com> <20180425200010.beqchgnm4lboqdp5@neon> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180425200010.beqchgnm4lboqdp5@neon> User-Agent: Mutt/1.9.3 (2018-01-21) X-Originating-IP: [209.116.155.178] X-ClientProxiedBy: CY1PR07CA0001.namprd07.prod.outlook.com (2a01:111:e400:c60a::11) To VI1PR0501MB2045.eurprd05.prod.outlook.com (2603:10a6:800:36::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0501MB2045; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2045; 3:h8i598PmAJPVEM6SIvBqWxDYp6EEpoW7rzzZH7vlv7YccC22q63EDXhLCypfDLTdYue/oLXi0UahY987wqeLrxCG4yFjyruqg0blQWBk2P0A/gkZlh59cTYOdTRMOKHsn16lMK1+rwyY3qeGJR3EdzynvWZmgYd3rYAj5FLoVsRSHLfZ4AynoOboKGwJ5FvaOdPy6izXozLnjayQqN6ajzDQ9rtwgqyOgGAfhc8GZVDlay7sTZln/UgcBpmZb2v6; 25:0Y0eequhya10stfTWfQtcIQIKQOHJJ2DUTYMOVdPI2lPWo02VZiNJFtPlJ7pZ8dQVdIM2pZvFQe525wsx6jonWfsvgGMP9A8wAu5bEOMRhrM3RuHXHOEC+UDOjfxajNDPS4a0k0RHiZmibYaMGAqEUFNdL0w6PDfXjIo2p446hURQnTFIiNWhIhQmptR/2e0NuEjV49kA2jWY9MlTAlABumAnmp2iblme1JZNNiTexa7d/9nt6LMxhY/tJ063HaiactsIniSNUirf2LHov/aH8U2IJ3Hp6nWQFhpH7iIC9T0e0wlgkUDybd0fbVD0SG6DsPxQPgBJL6P7RvURz0qLw==; 31:7FzjCzU/eeikdoT+LO71n3e/yiz641JDsO46EEvBn1hnCXSXhDp0vAaLXHX9Lrg0PqjLwCo6u/xKJuLHNNUGrMCEmx1A8Xw/CWjSz66aoKpAojUmKZL0z+gm7v4Ti7+MkSM8t9iqn+ihIQC605SpmZG8kqHSNpxJpQYrx3MPLQh64wxWuKOCxVdjXbzq0vF30UFpVmIUA4qc3vIuYd6zCHItxUgZzqALh4IieXSFFEc= X-MS-TrafficTypeDiagnostic: VI1PR0501MB2045: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2045; 20:OHNi/YHRZ+3qNR+l69dBo5bU3veKp2L1a3894TNllkpW06ldGefAWwjSVWoURJ5fTGcsiwP3t1k1yPT3wxy97S5hEbgwPgSZpkBqRMmVqPePqfHE5omlAkeDbx2XH3d8DaNGVA/uYV77+4jSj3znwqKvbB6pweIDct9b4QYeFAYghX0BYpgxLbEMIkYuod1VS37vyElqfWRs2gWfqU/rSG2965sSm4uHQGqQBwf9AyISAuI+WJNIEpwWSUJukqvR9BwMH1+piBc6y7IhpixF/UugVvdH9HKYKMBXurNe11fH+ULxAY0oVYwpw4yFbudoY+yqiOr3utUz8VscO5qC3ExL7AzWF7xnQZVuLzwYLK/wlcQLrKeUK4/2r0z587x0lrvOFqr8MDIbZLpLii9aQlajN32Jhcd1BDsSeeOY9VeoFa8lwclHYoYsvzEyezJpVJRxTrZpvNEYzcM1GQFe1M0YHppIKgb3HUHnaGME1bAU8nFcrCNQHE1scTjR7j9l; 4:IDP/3i82qEJFAXTHXwhhhDIFNaRQD5NJJr8A1LkqQkAbdGFOoaYYNzwUxk1Ukn89nyD51XEV4x7AtcG7P8yEbhcu5pcZ91Wm2h0FZoIA5X6uqF0CwnrByP43bb+XqH57EuF0PEfH4NfafzvVXRsUjPMhxbAkxOlVCvk93RuqBHPTFVoKRPA/dRvd8CkpXVnCeY5SkdpOWDIVgarWWc+3WE7nRSrGZuEeZlw8gN/A57Fb0JtCdcgtFn/efvKEZueikHs/FrIu3nIynhwx4wUp9w== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(3231232)(944501410)(52105095)(10201501046)(93006095)(93001095)(6055026)(6041310)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:VI1PR0501MB2045; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0501MB2045; X-Forefront-PRVS: 06530126A4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(346002)(39860400002)(396003)(376002)(39380400002)(189003)(199004)(11346002)(316002)(68736007)(97736004)(33896004)(6506007)(5890100001)(8936002)(6116002)(3846002)(98436002)(6246003)(386003)(4326008)(33656002)(23726003)(1076002)(81156014)(7736002)(53546011)(105586002)(106356001)(50466002)(7696005)(52116002)(76176011)(16526019)(229853002)(53936002)(86362001)(9686003)(956004)(26005)(81166006)(478600001)(8676002)(25786009)(186003)(93886005)(55016002)(2906002)(58126008)(446003)(6916009)(6666003)(476003)(486006)(47776003)(16586007)(5660300001)(305945005)(54906003)(66066001)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0501MB2045; H:yongseok-MBP.local; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0501MB2045; 23:kvvsjhIyqGDu36tMrSW6K4vXtSHzO2+adUTNmGq?= =?us-ascii?Q?9dXJLrTCS8w7M0/s7STuYSufyYew/oBsLIbiFNQCkKeqlG1LMQ5DRI5JD4Zk?= =?us-ascii?Q?bKCiNugoIS52jd3IR3TRXfpM1fsaehMDGzyojyXUu8kNW04ONa+yrUIm4XeP?= =?us-ascii?Q?q07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jei1zIR5kLwaH+7b4flsuetMSjw1FqkC9i/okzHS17JXxC9tXiHIV69T20zfdi51NtAgA==; 5:97vpqpIz19xSqwCWOUxpPR1MPAkVQqKHxuMn5AOk3U8/MR2q6146cBKG/d7IM46R8W5XY8DG7AQ69Q+AOsBrR/9/ajh03ZyPSV5zyQhhCmiEuHa3LxsRlLexAAUzM3AhLGt26mrZ6SQq5747ajK2Iy6iFdfbvwOA9f9t9mPu2DM=; 24:JNI5Q7UvJSokCuY677FUiAq4pFZZG9+T7RyqB5QU6a+C69kTS/c9WdxTssCb0X9HJGMxafVv7VffnOHJkQfqyhGGTchCx64TcJlgKFJWXZE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2045; 7:ovpSl2Wf+dnqVMMfU+c1Ah/iclKXbWu02BhIO2dJj5krIfjXzjEvBGk+Yl8qeACpbsbKbdINVYdh6GKeX+V/GkNgCILrkauDIrVIanPfUA5xcrmCOf4kWvszXAg8O8CwuhsjkYrbchvNjwnDc9Yrmw3OMU3j8bpG1FOuBPiHkXgrnIoSa9hDRk9i5SduYItpkwM7Ex+Il6mlKqiBHDR+2nuaSeGsZCa8ONBhWwucaiOJZ0JwQ9s0H8HENJCbF+gL X-MS-Office365-Filtering-Correlation-Id: 70f14ef7-dcb7-4684-aaa3-08d5aaff8c47 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2018 22:54:47.0307 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 70f14ef7-dcb7-4684-aaa3-08d5aaff8c47 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0501MB2045 Subject: Re: [dpdk-dev] [PATCH v4 1/2] mbuf: support attaching external buffer to mbuf 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: Wed, 25 Apr 2018 22:54:52 -0000 On Wed, Apr 25, 2018 at 10:00:10PM +0200, Olivier Matz wrote: > On Wed, Apr 25, 2018 at 09:19:32AM +0000, Yongseok Koh wrote: > > > On Apr 25, 2018, at 2:08 AM, Yongseok Koh wrote: > > >> On Apr 25, 2018, at 1:28 AM, Olivier Matz wrote: > > >> > > >> Hi Yongseok, > > >> > > >> On Tue, Apr 24, 2018 at 06:02:44PM +0200, Olivier Matz wrote: > > >>>>> @@ -688,14 +704,33 @@ rte_mbuf_to_baddr(struct rte_mbuf *md) > > >>>>> } > > >>>>> /** > > >>>>> + * Returns TRUE if given mbuf is cloned by mbuf indirection, or FALSE > > >>>>> + * otherwise. > > >>>>> + * > > >>>>> + * If a mbuf has its data in another mbuf and references it by mbuf > > >>>>> + * indirection, this mbuf can be defined as a cloned mbuf. > > >>>>> + */ > > >>>>> +#define RTE_MBUF_CLONED(mb) ((mb)->ol_flags & IND_ATTACHED_MBUF) > > >>>>> + > > >>>>> +/** > > >>>>> * Returns TRUE if given mbuf is indirect, or FALSE otherwise. > > >>>>> */ > > >>>>> -#define RTE_MBUF_INDIRECT(mb) ((mb)->ol_flags & IND_ATTACHED_MBUF) > > >>>>> +#define RTE_MBUF_INDIRECT(mb) RTE_MBUF_CLONED(mb) > > >>>> > > >>>> It is still confusing that INDIRECT != !DIRECT. > > >>>> May be we have no good options right now, but I'd suggest to at least > > >>>> deprecate > > >>>> RTE_MBUF_INDIRECT() and completely remove it in the next release. > > >>> > > >>> Agree. I may have missed something, but is my previous suggestion > > >>> not doable? > > >>> > > >>> - direct = embeds its own data (and indirect = !direct) > > >>> - clone (or another name) = data is another mbuf > > >>> - extbuf = data is in an external buffer > > >> > > >> Any comment about this option? > > > > > > I liked your idea, so I defined RTE_MBUF_CLONED() and wanted to deprecate > > > RTE_MBUF_INDIRECT() in the coming release. But RTE_MBUF_DIRECT() can't be > > > (!RTE_MBUF_INDIRECT()) because it will logically include RTE_MBUF_HAS_EXTBUF(). > > > I'm not sure I understand you correctly. > > > > > > Can you please give me more guidelines so that I can take you idea? > > > > Maybe, did you mean the following? Looks like doable but RTE_MBUF_DIRECT() > > can't logically mean 'mbuf embeds its own data', right? > > > > #define RTE_MBUF_INDIRECT(mb) ((mb)->ol_flags & IND_ATTACHED_MBUF) > > #define RTE_MBUF_DIRECT(mb) (!RTE_MBUF_INDIRECT(mb)) > > > > #define RTE_MBUF_HAS_EXTBUF(mb) ((mb)->ol_flags & EXT_ATTACHED_MBUF) > > #define RTE_MBUF_CLONED(mb) ((mb)->ol_flags & IND_ATTACHED_MBUF) > > I was thinking about something like this: > > #define RTE_MBUF_HAS_EXTBUF(mb) ((mb)->ol_flags & EXT_ATTACHED_MBUF) > #define RTE_MBUF_CLONED(mb) ((mb)->ol_flags & IND_ATTACHED_MBUF) > > #define RTE_MBUF_DIRECT(mb) (!RTE_MBUF_HAS_EXTBUF(mb) && !RTE_MBUF_CLONED(mb)) > #define RTE_MBUF_INDIRECT(mb) (!RTE_MBUF_DIRECT(mb)) Then, indirect should mean either having IND_ATTACHED_MBUF or having EXT_ATTACHED_MBUF and it sounds weird. In a situation where EXT_ATTACHED_MBUF (experimental) is never set, your definition of indirect will be same as now. No breakage either. Although your idea is logically same as the current patch, there seems to be semantic conflict. Thanks, Yongseok