From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0055.outbound.protection.outlook.com [104.47.0.55]) by dpdk.org (Postfix) with ESMTP id 9A0F01DBE for ; Wed, 25 Apr 2018 11:08:07 +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=s/jJ1W+w6lnWQ6RaXGMQdxGhCIeokAehKyl445yseCs=; b=qh5bNzVIurYiuAq7St+9qSj1P+2og/7mngddKowXOVNhZiKHZnH/U5A8aT9FgzHjCxgHZdE1X6hPDt6icg+XdLWrnjZ2mekHz12xU37XFw67anyBbJD2KaXFxqJUywhFuJjwpI2J1dKb2KcKY8k12oJ9+zMXDwxhTU9V5InJBFo= Received: from VI1PR0501MB2045.eurprd05.prod.outlook.com (10.167.195.147) by VI1PR0501MB2560.eurprd05.prod.outlook.com (10.168.137.8) 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 09:08:05 +0000 Received: from VI1PR0501MB2045.eurprd05.prod.outlook.com ([fe80::5453:e317:6563:11b3]) by VI1PR0501MB2045.eurprd05.prod.outlook.com ([fe80::5453:e317:6563:11b3%13]) with mapi id 15.20.0696.019; Wed, 25 Apr 2018 09:08:05 +0000 From: Yongseok Koh To: Olivier Matz CC: Andrew Rybchenko , "wenzhuo.lu@intel.com" , "jingjing.wu@intel.com" , "dev@dpdk.org" , "konstantin.ananyev@intel.com" , Adrien Mazarguil , =?iso-8859-1?Q?N=E9lio_Laranjeiro?= Thread-Topic: [dpdk-dev] [PATCH v4 1/2] mbuf: support attaching external buffer to mbuf Thread-Index: AQHT220LyCCpNI7frk+eJHPBYtp6AaQP2KqAgAA72ACAARNhgIAACzMA Date: Wed, 25 Apr 2018 09:08:05 +0000 Message-ID: <915EB643-1009-4016-9E18-7DAB43FFDC9F@mellanox.com> 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> In-Reply-To: <20180425082821.ktbzjrnxbo4nhqgg@neon> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; x-originating-ip: [73.222.116.174] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0501MB2560; 7:VYoh50UQB35lJosQxGxT6BM0t9UTEINcEhnWH+EZrjEH7QIy89kuMsUt0gt5LLfH8VgNSnsPb8GduuAwffLDeATHvsaV5q535dYi5sHWgYGc/e8FJRtjaLnCunn4nINgXdpFj+PQGEq5/kLvaY63xCkKGGF2jNNllHH4BNgmPmG1GiMs+mdC+nV2j4XXPsByKP9sb1PmtTKJkL6843SZu5+2f3GfNjGPe4t9skPOdY3lYW9/7wjm7FqxyJ5T+YaI x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0501MB2560; x-ms-traffictypediagnostic: VI1PR0501MB2560: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr 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)(3231232)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(6055026)(6041310)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(6072148)(201708071742011); SRVR:VI1PR0501MB2560; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0501MB2560; x-forefront-prvs: 06530126A4 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(39860400002)(376002)(346002)(39380400002)(396003)(199004)(189003)(5250100002)(14454004)(99286004)(97736004)(5890100001)(229853002)(53546011)(6116002)(68736007)(81156014)(4326008)(3280700002)(25786009)(86362001)(3846002)(36756003)(316002)(76176011)(106356001)(105586002)(33656002)(82746002)(6246003)(3660700001)(8676002)(81166006)(54906003)(8936002)(6512007)(7736002)(186003)(6436002)(446003)(2900100001)(66066001)(478600001)(6916009)(6486002)(53936002)(305945005)(486006)(26005)(102836004)(476003)(83716003)(2906002)(2616005)(5660300001)(93886005)(11346002)(6506007); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0501MB2560; H:VI1PR0501MB2045.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: u2YVCvKF8QOM0FbzzVd29JejG5/QoPSO60KrgVJmGEedVxRF+8uVkgqilKfPCxSk0jSWAe/2RAen4Zyaom0X/vcQvuXx4mhjns8Bn31g4Y2OtkUxI40omU9vp6tac0Us1L/dH4TTvJjUT/PgUiItiCHdnQBTypPNVj6yLqEqY6NICrwSNejFczcaokL9Ye5b spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: c09d6ce1-8312-42b2-8325-08d5aa8c0e56 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: c09d6ce1-8312-42b2-8325-08d5aa8c0e56 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Apr 2018 09:08:05.4862 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0501MB2560 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 09:08:07 -0000 > On Apr 25, 2018, at 1:28 AM, Olivier Matz wrote: >=20 > Hi Yongseok, >=20 > 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) >>>=20 >>> It is still confusing that INDIRECT !=3D !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. >>=20 >> Agree. I may have missed something, but is my previous suggestion >> not doable? >>=20 >> - direct =3D embeds its own data (and indirect =3D !direct) >> - clone (or another name) =3D data is another mbuf >> - extbuf =3D data is in an external buffer >=20 > 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_EXTBU= F(). I'm not sure I understand you correctly. Can you please give me more guidelines so that I can take you idea? Thanks, Yongseok=