From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0064.outbound.protection.outlook.com [104.47.38.64]) by dpdk.org (Postfix) with ESMTP id 209501B47C; Thu, 2 Aug 2018 14:43:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+JBd70fPjZGAbVIQA+1JrPTCACLoSUlUIlDFnyBkrEM=; b=AUnaMMamwwh9s5CrOFcdLzlPter6vq5Xr3SpqPPJ10mcuoQBOQY218JQlVG08zi4qgu3cimw3IYxXalXF+bkWNdFOiKBcjUuq2CN6K65dArVpLBFPhf4l6ryPad+E3wrdkNuoYDoI1nv5oa6XW27kqpGysGZQ7eVuYf+PUbxgSI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin (50.233.148.155) by BYAPR07MB4997.namprd07.prod.outlook.com (2603:10b6:a03:5b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Thu, 2 Aug 2018 12:43:31 +0000 Date: Thu, 2 Aug 2018 18:13:22 +0530 From: Jerin Jacob To: Harry van Haaren Cc: dev@dpdk.org, bruce.richardson@intel.com, stable@dpdk.org, thomas@monjalon.net Message-ID: <20180802124321.GA9220@jerin> References: <1533198964-30218-1-git-send-email-harry.van.haaren@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1533198964-30218-1-git-send-email-harry.van.haaren@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Originating-IP: [50.233.148.155] X-ClientProxiedBy: BYAPR04CA0004.namprd04.prod.outlook.com (2603:10b6:a03:40::17) To BYAPR07MB4997.namprd07.prod.outlook.com (2603:10b6:a03:5b::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0de7184a-e7d2-40b9-39a4-08d5f8758f1c X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BYAPR07MB4997; X-Microsoft-Exchange-Diagnostics: 1; BYAPR07MB4997; 3:FQtkN/FVKGnykR2alRMtQhFLSJBXIaQ3E0qoENsVQOyMbHSMvqvgthrADpfbenYiSYgXuFeIdBpEYlfle53D2wzK2q5e7i1X6/rMFagbDd1gm2CltUVq8g5pXePn3bIkNCSyp6atZq5PsOItJZ+EpeWkhQxg9v140JygDMKuL7NXM6vNY/xLB2Y44zlw2u3+pmxVHHWVV4D2LaQuUD1ZBaFzbxhpUGDVEJq6ym29PFrgrEeF9vXXiaJNem6Wtvtw; 25:IQ1GPnCf/YGOMhZqZxwQ+b7fBYLwZbsbh3t34lZahCMsQ+75QvCgtCnpzd5hYqmIWDcwudEQkFwn1VFaio9CbGKAfod4QfyHlvq9yeFaQT2NX+6s6QvZbRf/FI8dXxP6G53TvqA/rdMbf0My8QcO67a30tm/bhVy6YJxcsdvQnUb3etOIgNLfrpYUrdT361Ds1pCx9pGRohrUawwLLKCjrAbCbvWMfURNvxoLj21pB5oIe+crA47yiYmeUbbKmHWUhsiqookurH1O2Gh4hCtukhHJI6Uhc7xO8/tm3uV2P2mSC9K+S7kyPXI3UV8JekGnsB4ht/SRAKP67nTZv/m0A==; 31:dcqMbso+ZFGFj0iPFhyowMg6+JgGUXi7hLhcKse0I+P8lOnnKVZ6+TbJBnqT+VzMNyW26Yqvxb86VvzG6253WhtMcH2m2jRJGaUwnGMKdDYEvy85gZOnqPhMJfdaSlKhmrpRtCmG9dKuRUm04dnfQJmdqbUTfhVv38vbhB1eiYg3tru8Un6Z9q0GWCPjR1qG1327EeLq+9JgV2coWvc3qaJnmkPS3Oc8NhRjoCg6HNI= X-MS-TrafficTypeDiagnostic: BYAPR07MB4997: X-Microsoft-Exchange-Diagnostics: 1; BYAPR07MB4997; 20:HlDGI6unIhSjcSlBZyrNhI8Elv0s+hgSPwgbavSCYjJ5h5g3gKg/aaRnfpdQv2TITXVS744XEYCphFQynCFQYdBzRtKzRruBHj+TC2hcWknTRNYaDX6Lp8QUKGoTPpDPcyNWRtcoBlKp9tBfg/aM94d5r7wX624KUUCj5j0J8QVNpBM4c3Pn+O6opWhPk4tLl7mYSwjcAZQxRK87cHSTyY6B0000yfkamAzV03VPoQSbl9SJZRd1E9+s7ISuDHMvujfeaVznpY6KivhSfghzH7Sb/f/RvmWeoNkMDOvZFSefW8e8Z9RKC+CKDmx0ctjGRzJV4FOwtnGXoEEg8K+1E/ygbkt9KbOV9rD/z/TphVD95ZI14K/Hd6XAjH0rRYEtvANEdhujzxVV2vyrh0/Crh9VUIl24ZLTGnRkwDw9jwqibS6M3MJMk0Y1JXigEVI8EjUsbQQIVXGJphwfTHxiqfr3wrTvo0TvjJv3p7RRYeueTERQ4lh0rLl7P+jCFPfVHSqqnrDsZmdo844RQIT02QaLvYFBSXDxsLPcSptx5UCtBmaj6sVvE3Wmm3hTJTuBNvDyuEsidTwTDIbePGPYabsKqtOqNEdDpNaUat78fDw=; 4:2ucnIIQLdj1FTWJ/zwweJXUIECzGupYxR5/cbjhmYzg1nJbWYWbPutu9AN2htqX11C6hI2cZaKpsQivQUl6a7oML/3pVOnkY4pWJbDwibq6ocYQHu3kJB2GCy+WerQHA9T/u9QrFtBbYBlmIIWNaj86YxfXgmUTwXTE414xpoqg7W4WleHZFaK+e3H0JEno6TRR75CF4B683MF1QQSTz8Z3G57076lkSMPsKrZCXkJpywW0K+WYVG+p/bzhityERkEte3Vub7cJyLrINfA22ZwVz7hOr691iJq8FeCTAF1acOO2dJUuNPCgCsHEawpuW X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:BYAPR07MB4997; BCL:0; PCL:0; RULEID:; SRVR:BYAPR07MB4997; X-Forefront-PRVS: 07521929C1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(39860400002)(366004)(346002)(376002)(136003)(13464003)(199004)(189003)(68736007)(8676002)(8936002)(66066001)(47776003)(33716001)(106356001)(25786009)(23726003)(3846002)(1076002)(7736002)(305945005)(6116002)(105586002)(6916009)(229853002)(6666003)(16586007)(956004)(58126008)(6496006)(52116002)(476003)(446003)(11346002)(478600001)(386003)(53936002)(9686003)(81166006)(55016002)(2906002)(42882007)(44832011)(97736004)(5660300001)(81156014)(486006)(4326008)(50466002)(16526019)(6246003)(316002)(76176011)(26005)(33896004)(33656002)(186003)(72206003)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR07MB4997; H:jerin; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BYAPR07MB4997; 23:Rn+BcZq3ys81OKnrJ/Uk5Q8xv9un07vLCj9QEaz5H?= =?us-ascii?Q?b2MtQ4jW3y2HM/Y06zcTWzenjMxLpMCBvY59TQ6cGypSpy/kr/XzLIZ1j2Hj?= =?us-ascii?Q?i/K0E39YJFxc6IGAF8omhM1Q+BOOaFY0e50DphV50OefrTL33jpcaO9nIieA?= =?us-ascii?Q?Y8dynXQiYP5xwOTdIhV2f2V31FtHZ8xXSINB0YktT7c9l0dE20SZyTeieLD2?= =?us-ascii?Q?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O8a95Plw7Cws4/oyDXbCYivW+dzmXnboop++dwsjZXncxdzDPgZDQrhjNGstSFlak1SEB5D7utmAw7p0tDOaigGuMxf6aZZXsVSZKTFMcezw==; 5:WkEgbIEZrrdRyHa8jsU8oQuZG5ugo1ajgCvWwVfE8UTSrax/SyW5Orct4FeQl36+Kq2GArlLWqosWkVBYcxc7wjhDWkYuU64AkBkwUpfWepL9T0ngzfBMEJPR/nrG/BmCtcNfK1Cl+yGWzkVmqvhFC7Pze9friSzedkzsxIAvhU=; 7:/m9R6TlVONqxZ6F4cpG/CntmU7TjkRiz4m3eOrhCfM4vivpUj2OkDfizMq+4oSJvWZcDBBnOeLQ8HtM0VPlbEwe24xXl7bei4yRN57AuT4/Dj/gmsMNULqjeSR6Bj98pZ8e/NFYtTMyhRL5F04Ei+tWFIiE2AL7SaWHkHakNL8TtRw0zfeDcjYfcrEiMx36P8Gay5Fhs4nytQuKlP+e03UegB5TGYXEYfcu5Kvmfu6HiI8RF56e3npsYRQRh50P9 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2018 12:43:31.2928 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0de7184a-e7d2-40b9-39a4-08d5f8758f1c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR07MB4997 Subject: Re: [dpdk-stable] [PATCH] event: fix check in ring_init() in event ring code X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Aug 2018 12:43:36 -0000 -----Original Message----- > Date: Thu, 2 Aug 2018 09:36:04 +0100 > From: Harry van Haaren > To: dev@dpdk.org > CC: Harry van Haaren , > bruce.richardson@intel.com, stable@dpdk.org, thomas@monjalon.net, > jerin.jacob@caviumnetworks.com > Subject: [PATCH] event: fix check in ring_init() in event ring code > X-Mailer: git-send-email 2.7.4 > > External Email > > This commit fixes a bug in a 32-bit environment where the > generic ring_init() would fail, but given the interaction > with memzones the next iteration of the event_ring_autotest > would actually *pass* because the ring in question would > exist already an be looked-up. > > This commit rightly error checks the result of ring_init(), > and calls rte_free() on the memory as required. > > Fixes: dc39e2f359b5 ("eventdev: add ring structure for events") > Cc: bruce.richardson@intel.com > Cc: stable@dpdk.org > > Signed-off-by: Harry van Haaren There is one check-git-log.sh issue Wrong headline format: event: fix check in ring_init() in event ring code > > --- > > Cc: thomas@monjalon.net > Cc: jerin.jacob@caviumnetworks.com > > Please consider this for RC3, as it fixes the unit tests > on 32-bit systems. > --- > lib/librte_eventdev/rte_event_ring.c | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) > > diff --git a/lib/librte_eventdev/rte_event_ring.c b/lib/librte_eventdev/rte_event_ring.c > index eb67751..5791928 100644 > --- a/lib/librte_eventdev/rte_event_ring.c > +++ b/lib/librte_eventdev/rte_event_ring.c > @@ -82,11 +82,14 @@ rte_event_ring_create(const char *name, unsigned int count, int socket_id, > mz = rte_memzone_reserve(mz_name, ring_size, socket_id, mz_flags); > if (mz != NULL) { > r = mz->addr; > - /* > - * no need to check return value here, we already checked the > - * arguments above > - */ > - rte_event_ring_init(r, name, requested_count, flags); > + /* Check return value in case rte_ring_init() fails on size */ > + int err = rte_event_ring_init(r, name, requested_count, flags); > + if (err) { > + RTE_LOG(ERR, RING, "Ring init failed\n"); shouldn't we do rte_memzone_free(mz); > + rte_free(te); > + rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK); > + return 0; It should be return NULL? > + } > With above changes: Acked-by: Jerin Jacob > te->data = (void *) r; > r->r.memzone = mz; > -- > 2.7.4 >