From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 90B58A055A; Thu, 27 Feb 2020 00:21:05 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8825C1BFAB; Thu, 27 Feb 2020 00:21:04 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id EFCB41BF8D for ; Thu, 27 Feb 2020 00:21:02 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Feb 2020 15:21:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,489,1574150400"; d="scan'208";a="261235306" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga004.fm.intel.com with ESMTP; 26 Feb 2020 15:21:01 -0800 Received: from fmsmsx152.amr.corp.intel.com (10.18.125.5) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 26 Feb 2020 15:21:01 -0800 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by FMSMSX152.amr.corp.intel.com (10.18.125.5) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 26 Feb 2020 15:21:01 -0800 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.170) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 26 Feb 2020 15:21:01 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eUatM+cB4oRgZJekLul8/T5TfAbU0V+sVa4GrKihmwy8SdGBZUjK+EpPaRhbsFuGC93POQ240xJ8L2Kuzivo8ZGWGEl8GIKTph3FUFBzx+UO4FI2EirEXLT6ZQ8aS8fW8XQCmt2Dwc15cNDPkdtJxDk9kfsyekj/CroXWldm3C/jCxWyfboAEjf21+KZaqNMqXaFn7s5UWFGbnQzywsFFG8fGmjBYdzGz7Ov4cvGQugPQiv3plH3NjEOzMWVScOpKjFWt7BC3ZZxrmEK4vVxveiRdL2GpYrE1+xoeKc185d09ICqSCdSyqSWdrGiasA1XNPnu5sXZitYbFRj2goKzQ== 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-SenderADCheck; bh=ieypcXPrIHZjUfISp/lGcuKeHy4qgh9RKCNZd6MZxmY=; b=QoIqiHsg9gnvy+uNbwhgydcAnLwU2iSloBh47V+40MPAhHUwwvOAM6Anm9v5ZPBZZgQWhzPnX0QS2fEaJazMdZnPzLzgKfHzXWeqJXoJMS8x3Qd8dZUOBcOSd0NKEEC3BhvZn//3+GvYnS/CmzZJL4RQ5UefNUqy6qFWdzeBMJ8Yz1F+IgnBdmCpV/sGItVqxiBtliTKxLciMuxhEmH5pq5eeM3GKDHWsTj4q33KLu/GhdF51wCy8xI1Sp/hP3S15N26Uvba+ewS5NZJG4QXwAzRDfV86bgncE8lKruRxOl1nSeTdgT++Rti0TxiK87wpA+nrqWMMf3mVHT9UlT7WA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ieypcXPrIHZjUfISp/lGcuKeHy4qgh9RKCNZd6MZxmY=; b=u6fJUmjixS5OPTRlw0/b6Q+U1rSzhGt7Ci18gNdZUB1ajrF8CaMZyowPOWdDWnBkID7C9oYw1cmEM1j34g5J/YwnccDED+65ZkeDu9ReowrAIythtUrT35/zIE8lt8Tre7yr2MlhdkL+S7dnrH+vvr3LHM2qTSmaebeambgllZ0= Received: from SN6PR11MB2558.namprd11.prod.outlook.com (2603:10b6:805:5d::19) by SN6PR11MB3358.namprd11.prod.outlook.com (2603:10b6:805:c0::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2750.22; Wed, 26 Feb 2020 23:21:00 +0000 Received: from SN6PR11MB2558.namprd11.prod.outlook.com ([fe80::395e:eb75:6ab7:2ba5]) by SN6PR11MB2558.namprd11.prod.outlook.com ([fe80::395e:eb75:6ab7:2ba5%3]) with mapi id 15.20.2772.012; Wed, 26 Feb 2020 23:21:00 +0000 From: "Ananyev, Konstantin" To: "Ananyev, Konstantin" , Honnappa Nagarahalli , "olivier.matz@6wind.com" CC: "gavin.hu@arm.com" , "dev@dpdk.org" , "nd@arm.com" Thread-Topic: [dpdk-dev] [RFC 1/1] lib/ring: add scatter gather and serial dequeue APIs Thread-Index: AQHV7PtnIAeh438WBEWpCAC5zi0+Mw== Date: Wed, 26 Feb 2020 23:21:00 +0000 Message-ID: References: <20200224203931.21256-1-honnappa.nagarahalli@arm.com> <20200224203931.21256-2-honnappa.nagarahalli@arm.com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNjMxOTlmMGMtNGFjYS00YTUzLTgxYWEtZTRhMjdmNjc3N2YwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiajlSQ0prTUpydFRMUkVwUzg3Z2NiVEl0RE5cL0JBOTdEd29TSGFnTTVzcTBOaFRYeVwvSUZzYnRpSld2Q25ERTM3In0= dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.2.0.6 x-ctpclassification: CTP_NT authentication-results: spf=none (sender IP is ) smtp.mailfrom=konstantin.ananyev@intel.com; x-originating-ip: [192.198.151.165] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: acbe0c7d-bece-4614-0bc3-08d7bb128a6c x-ms-traffictypediagnostic: SN6PR11MB3358: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 0325F6C77B x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(136003)(39860400002)(376002)(346002)(396003)(366004)(189003)(199004)(26005)(66556008)(186003)(2906002)(52536014)(7696005)(2940100002)(81156014)(5660300002)(71200400001)(81166006)(86362001)(6506007)(8936002)(9686003)(316002)(478600001)(110136005)(66946007)(55016002)(76116006)(66476007)(64756008)(66446008)(33656002)(4326008)(54906003); DIR:OUT; SFP:1102; SCL:1; SRVR:SN6PR11MB3358; H:SN6PR11MB2558.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: QwNhe4pXnvsc8gUccHNIYvC1OP0t2v9Bgb0WfYcVZlRPkXtBmeFOYpTdE5SKkvjzokO30eeTCHd42myftZehFmC43uFMIjEOfjzQgVymR490j/R8o+eeaMkPrKxLQMyVxkZsO0IN+Ak4A6yFPcx0GUd2pQ64X0516SJycfCjR7XUCKp4/N4RV2TyZUUMKEx1dwH0qMAsN+p5WzEw5JmbVtXbLjCEiJTANU6OZyklP8VZIVtUbyZKse7Q12PNK/xzRF32ekk/csAOzNFEpsjNM0UHJhHviMVvUWwDHYXhwmD0rs8bb4fSK5IJbpq3tVZX7t5Td2wQCrfkQR6rrP8UoC3dS91GckuN7WGi8Ns7OIP0efHD48a4Q5ZoVaFpGZ6A5flw3xxPOCVEyZcxj8cRRh+F5VFPs/NSnIUcjyTuFSsHdhcDx/5+tS3FGoB1bEET x-ms-exchange-antispam-messagedata: Jimtcziju28zd67BREnLfk2Rko15vCwl06djRselRxzIx85u14oHOvjxGFi6KGhKkIMfB7uUQKKTRPyvaY1LyAkl3QRs9IslC9WYCd11sPmBwWKPwP+FhF0zkbB6U9FXILLco4Lw++bhieHlG3Jpww== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: acbe0c7d-bece-4614-0bc3-08d7bb128a6c X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Feb 2020 23:21:00.0677 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: AVrw+ziyIyJgVGSiefrpPgVTTFtB9/LLEMY1EasX/wVUgYusfES0chzem+N4Y2RaWICjtl7okX7yAe3k5P7qzTtv/tCLLVM1OVYZFhRX2uw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3358 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [RFC 1/1] lib/ring: add scatter gather and serial dequeue APIs 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > > +/** > > + * @internal Reserve ring elements to enqueue several objects on the r= ing > > + * > > + * @param r > > + * A pointer to the ring structure. > > + * @param esize > > + * The size of ring element, in bytes. It must be a multiple of 4. > > + * This must be the same value used while creating the ring. Otherwi= se > > + * the results are undefined. > > + * @param n > > + * The number of elements to reserve in the ring. > > + * @param behavior > > + * RTE_RING_QUEUE_FIXED: Reserve a fixed number of elements from = a ring > > + * RTE_RING_QUEUE_VARIABLE: Reserve as many elements as possible fro= m ring > > + * @param is_sp > > + * Indicates whether to use single producer or multi-producer reserv= e > > + * @param old_head > > + * Producer's head index before reservation. > > + * @param new_head > > + * Producer's head index after reservation. > > + * @param free_space > > + * returns the amount of space after the reserve operation has finis= hed. > > + * It is not updated if the number of reserved elements is zero. > > + * @param dst1 > > + * Pointer to location in the ring to copy the data. > > + * @param n1 > > + * Number of elements to copy at dst1 > > + * @param dst2 > > + * In case of ring wrap around, this pointer provides the location t= o > > + * copy the remaining elements. The number of elements to copy at th= is > > + * location is equal to (number of elements reserved - n1) > > + * @return > > + * Actual number of elements reserved. > > + * If behavior =3D=3D RTE_RING_QUEUE_FIXED, this will be 0 or n only= . > > + */ > > +static __rte_always_inline unsigned int > > +__rte_ring_do_enqueue_elem_reserve(struct rte_ring *r, unsigned int es= ize, >=20 >=20 > I do understand the purpose of reserve, then either commit/abort for seri= al sync mode, > but what is the purpose of non-serial version of reserve/commit? > In serial MP/MC case, after _reserve_(n) you always have to do Typo, meant 'in on-serial MP/MP case' of course.=20 > _commit_(n) - you can't reduce number of elements, or do _abort_. > Again you cannot avoid memcpy(n) here anyhow. > So what is the point of these functions for non-serial case? >=20 > BTW, I think it would be good to have serial version of _enqueue_ too.