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 1A412A0577; Tue, 14 Apr 2020 19:30:51 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EB63F1D417; Tue, 14 Apr 2020 19:30:50 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2058.outbound.protection.outlook.com [40.107.20.58]) by dpdk.org (Postfix) with ESMTP id 27B5D1D410 for ; Tue, 14 Apr 2020 19:30:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EWSGWyzeVY94WNxihWK0pEiXYajkc82v/Fx5hIWBVDw=; b=a2Qe4V11Lvdhpci0KRiD8fzfHnMYO0U+BsYlP4L5Nt7/Pm3ZJPqo17NTWpbooqH3mOaflH7e30+qjWuLx26yiMM2ImMNDdKPIcl1SzJ+Pv5skiSVhSz5KO1nm3P3u6O6btGU8IwF/f9LrNQo4moN+qtQ1tkqnqufWFHgqBGH384= Received: from DB6PR0601CA0045.eurprd06.prod.outlook.com (2603:10a6:4:17::31) by AM0PR08MB3121.eurprd08.prod.outlook.com (2603:10a6:208:60::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.15; Tue, 14 Apr 2020 17:30:47 +0000 Received: from DB5EUR03FT056.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:17:cafe::ee) by DB6PR0601CA0045.outlook.office365.com (2603:10a6:4:17::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.17 via Frontend Transport; Tue, 14 Apr 2020 17:30:47 +0000 Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dpdk.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dpdk.org; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT056.mail.protection.outlook.com (10.152.21.124) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.18 via Frontend Transport; Tue, 14 Apr 2020 17:30:47 +0000 Received: ("Tessian outbound 4b84da486446:v50"); Tue, 14 Apr 2020 17:30:47 +0000 X-CR-MTA-TID: 64aa7808 Received: from d79a19d6c248.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 98786748-F1E7-4BD2-891E-F1C0DA600C67.1; Tue, 14 Apr 2020 17:30:41 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d79a19d6c248.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 14 Apr 2020 17:30:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JJGGuGFSjtl3hZBrnBFIH/8+/VTi3WRWcymj9c8HUdGkdCQenheghX98geN6k3QBl43NsuglPcecJQ+wotxIJuKStEJa5/evDOtH6yn9ZDZyXMBjCm5U8V9xoIrXbLpfifXhWZEiyiHirAqE0g/T11ZcrLA17Zc+zhKpz1LBe4ME/4Wt0diz+4NiiyN0urkgWpEW+Jhcct82ntLRM4MmkfwhOpd14Wf/sY+/iejbVxwNE1QjUCD7P56Swr20qsGDQonAIRa1x3lSJc9XAlZp6zmJLEjHgTuCaqVRYO1EYcWP8SvidENtPwxi6EGX5xm+6Ab0A1PyC49/qj4wHaE/Kg== 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=EWSGWyzeVY94WNxihWK0pEiXYajkc82v/Fx5hIWBVDw=; b=DC1ld6RL1XdsTR3ApCDkuIbnP+Cs1yoycTa0wkh/D/AuUnv/6wVTnoZyN2I5RtbgCDBDB6IUcAmpt+SVH1fkVG7GoDXdUpYqC7mpTFujpNlRx+avtYiB5FqjcNLhvPYQEBVJR9bsCPNfv6794nyX9q+Ig7SfFSXzjohSI5BWDkUSpBJIxTBz8fuyt1gMLZcN49lF/dqg8FDcnVrKxmL3gdrTewpChfffcopO0OGdvvdsW6jnStEtyPaOR3Qf7QXQ/oW3hqFKeQiitnuxUdFWPTzLkMh2rPs3iZ658vBA2Et/q5bgZTo2KnYGXYEdnX1seMljzYGOH+EgNwV0/rt6Tw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EWSGWyzeVY94WNxihWK0pEiXYajkc82v/Fx5hIWBVDw=; b=a2Qe4V11Lvdhpci0KRiD8fzfHnMYO0U+BsYlP4L5Nt7/Pm3ZJPqo17NTWpbooqH3mOaflH7e30+qjWuLx26yiMM2ImMNDdKPIcl1SzJ+Pv5skiSVhSz5KO1nm3P3u6O6btGU8IwF/f9LrNQo4moN+qtQ1tkqnqufWFHgqBGH384= Received: from DBBPR08MB4646.eurprd08.prod.outlook.com (2603:10a6:10:f5::16) by DBBPR08MB4282.eurprd08.prod.outlook.com (2603:10a6:10:ce::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.15; Tue, 14 Apr 2020 17:30:39 +0000 Received: from DBBPR08MB4646.eurprd08.prod.outlook.com ([fe80::1870:afc4:b90f:609d]) by DBBPR08MB4646.eurprd08.prod.outlook.com ([fe80::1870:afc4:b90f:609d%5]) with mapi id 15.20.2900.028; Tue, 14 Apr 2020 17:30:39 +0000 From: Honnappa Nagarahalli To: "Ananyev, Konstantin" , "dev@dpdk.org" CC: "david.marchand@redhat.com" , "jielong.zjl@antfin.com" , nd , Honnappa Nagarahalli , nd Thread-Topic: [PATCH v3 7/9] ring: introduce peek style API Thread-Index: AQHWCd9cfoGjgBmDwE6GtYzbMvcpp6h3xDiAgAEgqwCAAAk9EA== Date: Tue, 14 Apr 2020 17:30:39 +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-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 68d5503d-97f9-4ddd-a54c-cd9ad51ddf95.0 x-checkrecipientchecked: true Authentication-Results-Original: spf=none (sender IP is ) smtp.mailfrom=Honnappa.Nagarahalli@arm.com; x-originating-ip: [70.113.25.165] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 6c181f80-bbcc-4f93-f773-08d7e0999198 x-ms-traffictypediagnostic: DBBPR08MB4282:|DBBPR08MB4282:|AM0PR08MB3121: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:9508;OLM:9508; x-forefront-prvs: 0373D94D15 X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBBPR08MB4646.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(376002)(136003)(396003)(366004)(346002)(39850400004)(66476007)(64756008)(66556008)(9686003)(66946007)(66446008)(86362001)(8676002)(478600001)(81156014)(55016002)(71200400001)(6506007)(7696005)(186003)(76116006)(33656002)(8936002)(5660300002)(26005)(316002)(54906003)(52536014)(110136005)(2906002)(4326008); DIR:OUT; SFP:1101; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: ENLXU652HvQxDjQDv7H0lUsZHivDwDvRmikQoBBZ124YOMSBV9lWDpOZRwaFlmrDARXZfPWSHe4uFgMNwcfejRCFr/bjCy4aIqblX0/p86KVz8QeFAmZuppChfkwyg3XGk/bGkd3u49HFG/v9fKPWhRogNeKyaysettrgytkot7bYFcmI7Y/NJ2ExmguCAJh8lyF1miG3+FShG3Sl0888fH1QUmgVUsCp7bR6w0z225mm70YvXMGr3nUepEnS2HAgQDCma5f2t2cwUPph8sG9xFgrSyL7QsPOlN4ngHm/6Wub/ZwlryvQbCvq7l7LnhkttB8lGNVllMRM2B5m0U3QkjmbN630iMIOKa+p7xbJaIsKgXkow9R2egylGlOwZJly4QydLbZxqCDbJgw59i2ffDCOY/MQOYydXUHZQmO8j3I0gb2XNUAu6Mi4O1meSqh x-ms-exchange-antispam-messagedata: 1XhIMNxjY3mlLbSAFAkqWNt8nboiDqZgh9qUnL1blzRqEU33/vU2AYLLI9GVmbO1NgcNw7AmrhaxA5qRpHPXQjcmYdFa6jSy4Mzh+/1fbBfhfdM0CdZi/LmPDkgo/fFIjjmTEhrFjuqGdc+n4/Avhg== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB4282 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Honnappa.Nagarahalli@arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT056.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(396003)(39850400004)(376002)(136003)(346002)(46966005)(356005)(81166007)(26826003)(316002)(70206006)(336012)(86362001)(478600001)(33656002)(9686003)(52536014)(4326008)(5660300002)(110136005)(8676002)(54906003)(81156014)(6506007)(70586007)(2906002)(47076004)(7696005)(55016002)(186003)(8936002)(82740400003)(26005); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 0ae31592-9f6e-4190-d87f-08d7e0998cb5 X-Forefront-PRVS: 0373D94D15 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9j+jwJfxEGr523DkT05UPRqad62hBLmyCptVmoxQW8uowlktARtmm2ZV7qrNd5rLZ0iRD5jJQizKUWNN8XmXjiRfmRHyXTFbK4RY5Da+xgbUMyKiQH5mRfh+xk5SkoE4NiM51f8pX2u9tX8k4uY3UKQsncxh54xvTro9yUHLB3x7Hp8nuklq9kS8XOZKYoqcaR0JsKcuJAl3qByGL94f8YznQzsNglqFtOL92mLKkHOJRJfa0eS4+9Pv4tWpOVzEFV3gJtSq8tU7aOeF9t0uNy6DhM7h1gLwxqivCt/bnFDx967l7ifNbmeZeZUeFLCdJkXctsdEmn16tTT/r2nM6LIdSIrg7Il6FmUBTZxpmNSBnC293CFrqtkFuQuPKKDKzDzDGpSwXcvGUFsAtcMXqTM/w8QosR16zZ5hs40gHxvyhOpamZIFL+ZdKAZb9FrZI//MotF2SDCFAE/7UDNNMyCRlk0vJA0YpfCuufsNOukIqKufLvirAq8VUazcJ9NE+oPyi+3mG8nnSdU3ltuF9A== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Apr 2020 17:30:47.3483 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6c181f80-bbcc-4f93-f773-08d7e0999198 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3121 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 the > > > + * 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 legacy = 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 t= oo > inconsistent. > > >=20 > 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_e= nqueue_bulk_elem_start'. There is a slight variation in the way obj_table i= s provided. 'rte_ring_enqueue_bulk_start' can be the wrapper. >=20 > > > +{ > > > + return __rte_ring_do_enqueue_start(r, n, RTE_RING_QUEUE_FIXED, > > > + free_space); > > > +} > > > + > >