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 F01CFA0542; Thu, 13 Feb 2020 12:12:28 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 69DC31BC25; Thu, 13 Feb 2020 12:12:28 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 41B8E2BF4 for ; Thu, 13 Feb 2020 12:12:26 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Feb 2020 03:12:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,436,1574150400"; d="scan'208";a="238007269" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga006.jf.intel.com with ESMTP; 13 Feb 2020 03:12:24 -0800 Received: from fmsmsx163.amr.corp.intel.com (10.18.125.72) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 13 Feb 2020 03:12:24 -0800 Received: from FMSEDG001.ED.cps.intel.com (10.1.192.133) by fmsmsx163.amr.corp.intel.com (10.18.125.72) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 13 Feb 2020 03:12:24 -0800 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.172) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 13 Feb 2020 03:12:23 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j+dw6PaJWfoxz8hCs6Lgdo0bfliaeCzF8PjSpXjkzzBjz98NyhYhAxmai3vYwM9Dp9l+ApT75dDITQ4DHNqGd2g621HHxZj0NArFyEAXLHT89wdfXeDObACkb92XooFImKbAHnkKZsklMXnFvxjSgC72ihhC2bpRQrXd/wvwXmcVOwzk5VhhRmh3fb5BZ5Ps7j1uepdb5YsR2a6LjpXrKyrBGXJVyGQ/GxnFr5uzPfWT+U5xe/hzgA7uCUwzn9IzHj8bHlQDgpZ/yBpfnbIBpVh5H3TL85/QXRvGeibjeGsixARiZBlN+eHSgcvicFcu0S1Y3O2mRS5OVuqLijmFFA== 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=VJJ0hH9rBaDRpjm9y3Y4fOnihnoKERug3ewRBF0NPls=; b=kKNUOOJJWLGURMzRwMRtuN272LwwIL6BMNoZKZNcBJjBORvjSSryQtBYy8UavxdpFMXK/d69fHVn3Rcw4K9kunRcZ6uc26L10DYgeoEv3VelxXEaIwMaKAqChixwUKRncx/emxJsJk8CVQjYeXUp15fP6zJowsQRLdXnkbLR67mHfUUMBnOGKqpHYl8smMRri0yerxevYrTimJholFkiFHHek5GdcQxtlLkNiAd614PvbuZ3f4h0ts855AoO78jYKGweDnkQss24ymntHpLY1eHmjHn0veIliI5v1Y918dYX9EdHYT+yKGXBHvXayVSTjJDXfiaGFiOArl0WvdLoYA== 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=VJJ0hH9rBaDRpjm9y3Y4fOnihnoKERug3ewRBF0NPls=; b=a5ZcFRiCjLg7xrjRpCDVjbSUww2MKxRw1ZkRhTA8pjNumAqycxqtDRC28rxrwxz2CjhiEZWltgPwMIHS4tOb6yMQhCGabW2MK+ihpyTgv0xW77TMY0Hu/sZiHCR0gneDQN+umzeElEBZ6Fuk3PvEnyrc+RVnBaxU0eWhMW1Pj+8= Received: from SN6PR11MB2558.namprd11.prod.outlook.com (52.135.94.19) by SN6PR11MB2557.namprd11.prod.outlook.com (52.135.90.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2707.21; Thu, 13 Feb 2020 11:12:23 +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.2707.030; Thu, 13 Feb 2020 11:12:23 +0000 From: "Ananyev, Konstantin" To: Stephen Hemminger , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [RFC 1/4] ring: future proof flag settings Thread-Index: AQHV4fl3RZsYQ3VPKkuDsz9w4M/t2KgY+MnA Date: Thu, 13 Feb 2020 11:12:22 +0000 Message-ID: References: <20200212230810.2837-1-stephen@networkplumber.org> <20200212230810.2837-2-stephen@networkplumber.org> In-Reply-To: <20200212230810.2837-2-stephen@networkplumber.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzA5NWVjYzYtZDE3Mi00MzQ5LTgzZGItY2E4NTdkZjhlZGY4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiQmw1aWdTTEdmTEQ0RDYyMDM5bnlLS1RzZlc1UFZEMlVlZ3R0a0o2VlJWbzR2U0hmbmxkWEd2NnVpaGkycjJUbCJ9 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.180] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c3b076ca-84e5-4b55-92cf-08d7b075998d x-ms-traffictypediagnostic: SN6PR11MB2557: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-forefront-prvs: 031257FE13 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39860400002)(366004)(376002)(346002)(396003)(136003)(199004)(189003)(81166006)(8676002)(8936002)(71200400001)(81156014)(5660300002)(86362001)(66946007)(66446008)(64756008)(66556008)(66476007)(52536014)(76116006)(33656002)(26005)(7696005)(55016002)(186003)(316002)(9686003)(6506007)(110136005)(53546011)(2906002)(478600001); DIR:OUT; SFP:1102; SCL:1; SRVR:SN6PR11MB2557; H:SN6PR11MB2558.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: EwrjzlfYgGc5Vk9obxh9qlKxN/EAvMtZ8xYoAVZhp6zJWFYooj+oOKQckpYP4nyIv5LXwwAKUWhbrQeGlK5svkp1EMRGvAMDOv9J6EqJx6ZYjw7NANJD//Q6QmQXxnckG5f9FK+Ijq5ydrtPE5kYyKK15j50gRkd4UQcPuQzLMZX4+Dv2XWXXGT8pWMxGabDm00RT4QIlLLlEmfFVWlI4srdrNVgGmu3z+q8Zmqz+AKA2DGHrCF2ySXfOWjR5KQq6SS4KlvlUZp3ubfVSe67oir0hfKFbUfavb9cGigHxbqrW7W7zBlzNLCpzaqLyjNG39n1l4bxKhcgkhc+4e9yXqiqP6zSe2LmLFCryzinvkAOMTa/qYOB6vV4qtWmAGKIQNZG9ERHOkwLohhTMC7eM+gkjCW2DuJZs3YDlRQQXKmNOFsiIk41WocMOcne2Oik x-ms-exchange-antispam-messagedata: Y/TvmnZnSBKYV7yb0dosqEkCbpcZWxlLiUQpCJhNQypam3xiMjlebdX22OLoCdnS5Ni+DnNedHifT+TWTyZilUhwDgyUZX7UeNaNMYQNAN91bfjxRTKPs2aJ0a33i2V1J2qNjGZ0CZsv6y4panqaZA== 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: c3b076ca-84e5-4b55-92cf-08d7b075998d X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Feb 2020 11:12:22.8299 (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: FQaZlHzbcA7tlQaehdzmrFffSNSXYSB3RblxKodJrOqqJGagv5doKSgP2rEY651Ij2YrYu8f0MYeQrUSAaLJnhy2jmdqUZeHcl7n7kawwVg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2557 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [RFC 1/4] ring: future proof flag settings 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" > -----Original Message----- > From: dev On Behalf Of Stephen Hemminger > Sent: Wednesday, February 12, 2020 11:08 PM > To: dev@dpdk.org > Cc: Stephen Hemminger > Subject: [dpdk-dev] [RFC 1/4] ring: future proof flag settings >=20 > All API's should check that they support the flag values > passed. If an application passes an invalid flag it could > cause problems in later ABI. >=20 > Signed-off-by: Stephen Hemminger > --- > lib/librte_ring/rte_ring.c | 7 +++++++ > 1 file changed, 7 insertions(+) >=20 > diff --git a/lib/librte_ring/rte_ring.c b/lib/librte_ring/rte_ring.c > index 77e5de099b81..6cd8831649ea 100644 > --- a/lib/librte_ring/rte_ring.c > +++ b/lib/librte_ring/rte_ring.c > @@ -100,6 +100,13 @@ rte_ring_init(struct rte_ring *r, const char *name, = unsigned count, > RTE_BUILD_BUG_ON((offsetof(struct rte_ring, prod) & > RTE_CACHE_LINE_MASK) !=3D 0); >=20 > + /* future proof flags, only allow supported values */ > + if (flags & ~(RING_F_SP_ENQ | RING_F_SC_DEQ)) { > + RTE_LOG(ERR, RING, > + "Unsupported flags requested %d\n", flags); > + return -EINVAL; > + } > + Good idea, I think, but seems you forgot RING_F_EXACT_SZ. > /* init the ring structure */ > memset(r, 0, sizeof(*r)); > ret =3D strlcpy(r->name, name, sizeof(r->name)); > -- > 2.20.1