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 5A2B8A0577; Wed, 15 Apr 2020 00:24:46 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C04681D16C; Wed, 15 Apr 2020 00:24:45 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id ABD911D16B for ; Wed, 15 Apr 2020 00:24:44 +0200 (CEST) IronPort-SDR: 0a/PIy0eu1Al+CplQ8UjF3k+lFqeDyGVPtx20ArrBeA4DcOHWLVFpB6pLwsvg73kZEODa8wymb LjVpG7OYP0Sw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2020 15:24:41 -0700 IronPort-SDR: mZnLDWNq6CTBqP1b4uN2JB57O5k3KwRnqw97rsdXLiCNLzjgXAjG3CIERRZ4DBgLansUE+OZjV DKq9Pex4QzLQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,384,1580803200"; d="scan'208";a="271423760" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga008.jf.intel.com with ESMTP; 14 Apr 2020 15:24:41 -0700 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 14 Apr 2020 15:24:40 -0700 Received: from FMSEDG001.ED.cps.intel.com (10.1.192.133) by fmsmsx124.amr.corp.intel.com (10.18.125.39) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 14 Apr 2020 15:24:39 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.105) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 14 Apr 2020 15:24:25 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hOWuEZ2PsFXkV/zKWxvhhl3lPseBuKSy7WkPw0GT7v2owemXlflBJsMT9lE6ad3xBLj4r8jt3rjsrbbLrWhHogHMMpEjibnfBD97ppgim42/ORY7BZPhbUaXEK+mI2yIABkAFKpSIoprBbJZI9tn+ygcirPs+p4tBBds4MNyA1wOkXn/5ubscEm4gv+JBEA9rsxeKGk1Wslo1xL8UaU80X9XcF8o1sysOiKtDFWUCfm8eDTVK4UB4dPW6HnN+QRvr38NYgnOLUSQ/CU6s101C6gruWrO+eMo7KUdCQWwvNb3/NWeWSwBx2cKvChtREVrdAMsqVvyHOO35XA9n8j3Cw== 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=BDAoCgTe1i//p2pKLOALqqjdk1ePYlhaZlsiT8BF5zY=; b=Ko4wJegzzfC+FSLKiPT9YB0i5d4euXx6rf6e8dGlUXmUVSsN+EarmHBJy5klS+kjydylmcdvzY7tk1Z4GrrrPpuhokOVz2pZdu5z13qHIGEqn8FXhz6GZ+fMMr+wf6TpPLPrsVw3Qu1U99djfdpqaJLJ2EoXYr0RM11zlwTJ9+gP3lg67bp5YwKOibQ2rqg7SXIXY+kwAvL57R1WnHH/tw/ipezkFjVWSFOMRWo2uRcRvCs+iKUCWAOVNQYJfNemN4dPf3lRW8/0HPS62jZ5PvwSxd4CQb0EfvCB9AcJA+zDJig4W4PyLCWZpRM1wS3NulEbL8M+SfUeqAc2aIyBMg== 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=BDAoCgTe1i//p2pKLOALqqjdk1ePYlhaZlsiT8BF5zY=; b=kBjNFElTs5OTg8cw/4qCQoETQ/9xvF8+N9NjGiCjCww/rhqTO5lYa8d9vRzgxV3e5m2kbFK3Dr18bJix3/RoqpJMjnnVFOjCQqeolyYM9XZu3p4/GDI8L/7vHs9fUZqFrPUyQX7R2LPPUA1qrePyI96eKOWDazMw5C/PJpvLNHs= Received: from BYAPR11MB3301.namprd11.prod.outlook.com (2603:10b6:a03:7f::26) by BYAPR11MB3576.namprd11.prod.outlook.com (2603:10b6:a03:b4::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.17; Tue, 14 Apr 2020 22:24:23 +0000 Received: from BYAPR11MB3301.namprd11.prod.outlook.com ([fe80::f8cb:58cd:e958:fff4]) by BYAPR11MB3301.namprd11.prod.outlook.com ([fe80::f8cb:58cd:e958:fff4%6]) with mapi id 15.20.2900.028; Tue, 14 Apr 2020 22:24:23 +0000 From: "Ananyev, Konstantin" To: Honnappa Nagarahalli , "dev@dpdk.org" CC: "david.marchand@redhat.com" , "jielong.zjl@antfin.com" , nd , nd Thread-Topic: [PATCH v3 7/9] ring: introduce peek style API Thread-Index: AQHWCd91Q1vKyBUGI0er7xmp0OLAnah4CnYAgADVnZCAABECgIAABqWQ Date: Tue, 14 Apr 2020 22:24:23 +0000 Message-ID: References: <20200402220959.29885-1-konstantin.ananyev@intel.com> <20200403174235.23308-1-konstantin.ananyev@intel.com> <20200403174235.23308-8-konstantin.ananyev@intel.com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.2.0.6 authentication-results: spf=none (sender IP is ) smtp.mailfrom=konstantin.ananyev@intel.com; x-originating-ip: [192.198.151.190] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 69673101-d561-48b6-7b12-08d7e0c295c0 x-ms-traffictypediagnostic: BYAPR11MB3576: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 0373D94D15 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3301.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10019020)(396003)(136003)(39860400002)(366004)(346002)(376002)(9686003)(64756008)(66446008)(86362001)(66946007)(316002)(478600001)(5660300002)(66476007)(76116006)(8936002)(81156014)(8676002)(110136005)(66556008)(54906003)(52536014)(33656002)(4326008)(186003)(26005)(7696005)(6506007)(55016002)(2906002)(71200400001); DIR:OUT; SFP:1102; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: K+hCVzQNhwY+JQIAye3es753TwiwjpbQSXRKJpZ3eguePmswsY6MDpzO06YLS6j5zdAFbWJfBsDPhgf3Cs6ciS8+GZJXtXsy6N05nOYVr37AU4cC8eK5suS3NVNmJ8vN2RVDPxtSXGYn8XLheFISAjsanoIk3tyMdtHPvzP9fyEg0PrSEgC9zL9LgNlIVd+57KxJYSwjrz9R+Lk+UjvHwyVIyStvJ2+n6LUudgOAYPkL2bQcu5C7Qv7/lvgXiJR/NX7Vz5XooeKAmrTJU5UxTJ3r9Of4GWRh93Pva+/5rqupIHhHW+6MovJlEP5hvFzln65elE7GHf4HqjVAD0K3csLPTB/NnCqgVyWDhegmZ+wYN9jVAzrQCx3zdYE/SlZceY0eS+vDEHTXSy064/Blyrb8TDDD8NjocXIID3Xh6hb5VDxQfR4YqfJW9bJO+H4I x-ms-exchange-antispam-messagedata: 6QluZ5/EfmRL23+g4Uu9Z/r3EQGXBfspzoxpO+64QOJmuu53/1DqmF7FU0Tl781DByAEn4dJfhKB3GAd01v+XB004/ZWjoZnPDEgYr6AZiDZoVFgflitci/DrcVZXVqd16fqmQMiAncyz3z67PNZLA== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 69673101-d561-48b6-7b12-08d7e0c295c0 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Apr 2020 22:24:23.5772 (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: WEhZMrzHbVrMaSgXfV9EEzzExVgBC40odCW45ZNm3SWbO8pYMEDKcQ6E2XKbgFZnxwHjTBL2fiDUE+VavTrf2kuroYhTT+HbBXKK0wcmkaY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3576 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v3 7/9] ring: introduce peek style API 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" > > > > > > > + > > > > +/** > > > > + * Start to enqueue several objects on the ring. > > > > + * Note that no actual objects are put in the queue by this > > > > +function, > > > > + * it just reserves for user such ability. > > > > + * User has to call appropriate enqueue_finish() to copy objects > > > > +into the > > > > + * queue and complete given enqueue operation. > > > > + * > > > > + * @param r > > > > + * A pointer to the ring structure. > > > > + * @param n > > > > + * The number of objects to add in the ring from the obj_table. > > > > + * @param free_space > > > > + * if non-NULL, returns the amount of space in the ring after th= e > > > > + * enqueue operation has finished. > > > > + * @return > > > > + * The number of objects that can be enqueued, either 0 or n > > > > + */ > > > > +__rte_experimental > > > > +static __rte_always_inline unsigned int > > > > +rte_ring_enqueue_bulk_start(struct rte_ring *r, unsigned int n, > > > > + unsigned int *free_space) > > > If one wants to use _elem_ APIs for ring peek, a combination of legac= y API > > (format) and a _elem_ API is required. > > > For ex: > > > rte_ring_enqueue_bulk_start > > > rte_ring_enqueue_elem_finish > > > > > > I understand why you have done this. I think this is getting somewhat= too > > inconsistent. > > > > > > > Agree, there could be some confusion. > > Don't know what would be a better approach here.... > > 2 similar functions with exactly same parameter list (one wrapper for > > another): > > rte_ring_enqueue_elem_bulk_start() and > > rte_ring_enqueue_elem_bulk_start(). > > ? > We should go with 2 functions 'rte_ring_enqueue_bulk_start' and 'rte_ring= _enqueue_bulk_elem_start'. > There is a slight variation in the way > obj_table is provided. > 'rte_ring_enqueue_bulk_start' can be the wrapper. For enqueue_start() there is no need to have obj_table parameter. That's why enqueue_start and enqueue_elem_start parameter list will be iden= tical. But sure, if that helps to avoid confusion - let's have 2 functions here. >=20 > > > > > > +{ > > > > + return __rte_ring_do_enqueue_start(r, n, RTE_RING_QUEUE_FIXED, > > > > + free_space); > > > > +} > > > > + > > >