From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 58C48A00C2; Thu, 3 Feb 2022 06:44:12 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D202A41199; Thu, 3 Feb 2022 06:44:11 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id D597840151 for ; Thu, 3 Feb 2022 06:44:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643867050; x=1675403050; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=JE3KU6aIi5yNnXdUimM0G9OBbnQy9Pj62+SVHmxrjnc=; b=YSDPCZrGavuPz3Qdc04/tCIPr5NfbqFY+d+zISQcw2AXD5bsN2OBkJAw c7dexoAlZhi/GsAzmc6QQm/HecQ7Q7zgQtBBxrLGd4uiTnuzPwCCwnXhi +q44CKl3YeJPbGzhnbt8xKATuTxcs4Jtjp4hDPhFt/VF6JXLTBwAogRXs XtQuZ8yW+0gEqqsT3uhoEsgm2baDNG6QvK7LTEaat2we95zWDfC3ravj8 +NYmhLldWHorG3SOOhEJGFcP0hLk9TVFLtHHgbggrgRB2nzffWb7vkxos QTb1Fzl0Q+OUUEo3kLjn+9jPhWIiD7V2l3vXeThNk76/CpoDgwscwxfmc w==; X-IronPort-AV: E=McAfee;i="6200,9189,10246"; a="248032102" X-IronPort-AV: E=Sophos;i="5.88,339,1635231600"; d="scan'208";a="248032102" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Feb 2022 21:44:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,339,1635231600"; d="scan'208";a="769516873" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga006.fm.intel.com with ESMTP; 02 Feb 2022 21:44:08 -0800 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Wed, 2 Feb 2022 21:44:08 -0800 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Wed, 2 Feb 2022 21:44:07 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Wed, 2 Feb 2022 21:44:07 -0800 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (104.47.56.47) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Wed, 2 Feb 2022 21:44:07 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j3RBn04H0mOVs1W/Qb1AoMg0v7QsdiDBJfm2OTPRono5lOFnwq1QwzUCm98aE0+5n0+TsovatPJrW9rzGBVgdfYFt1JZ3uD9nL5W6ujuSmPYfBUKadiThdotpNOlRq2VVXz4+BkQ0codhDhfLOWb2Hl9xRJEya0JX+36oKWjedKLpJf3i5CgZ9LDj+bWN/9rFjzP+KOlBoKkun6Spl1b2yXatNiKXMnoUfIUpamfEievV44ZSwHEm0yIHhurk6GLzatv7Pr0DP0rehka1zFrZxa8Tr4UIiizkFQtjhVVAF4jIIgIPSbf9ftuWzDL44MnPuBdsSAYdad6DScBNdt9Rw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YeGnCOJFUE+SplawVpayh4laj6Ntg+dmgbxvDF1oU4c=; b=IRS7Mi2UjSV2INMEzU8VJn7wCXyzFnIz8ZM8K/sydPDU7T6GdDC3mvgyAv4EPNj9YfXC5X2SejPyv61ov7rOVKXBZV5vtSYUlagPW746g3afXDaTdS2ycKVPgKafgDFLo4jQhCdifJhxTBbYx2rTFbPH1d+KXM18NlZxAz+d/peZEBhc6bP7to/JuVZi/19l8NmJeVsC0j7IA6W06Lwx5/2hA0qKVvQhIzZ4DC6a0DBMFCm5+23AEEM9mMnWs1w23B1h+b7DwJXy8u0y2W6sHdw0qIMGQy/yn2K2ifDGCyowPaIUndRUvk0sglV0ZNbIuxdZjwyrhbEnMr1DmzFKeQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from MW4PR11MB5911.namprd11.prod.outlook.com (2603:10b6:303:16b::16) by MN2PR11MB3711.namprd11.prod.outlook.com (2603:10b6:208:fa::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.12; Thu, 3 Feb 2022 05:44:05 +0000 Received: from MW4PR11MB5911.namprd11.prod.outlook.com ([fe80::e00c:1274:42e2:8355]) by MW4PR11MB5911.namprd11.prod.outlook.com ([fe80::e00c:1274:42e2:8355%7]) with mapi id 15.20.4930.021; Thu, 3 Feb 2022 05:44:05 +0000 From: "Kundapura, Ganapati" To: Weiguo Li CC: "Jayatheerthan, Jay" , "Naga Harish K, S V" , "dev@dpdk.org" Subject: RE: RE:[PATCH v2] eventdev/eth_rx: fix memory leak when token parsing finished Thread-Topic: RE:[PATCH v2] eventdev/eth_rx: fix memory leak when token parsing finished Thread-Index: AQHYGAg/1XAe+kVUJUiapfICqeBpRKyBLtmAgAAiyMA= Date: Thu, 3 Feb 2022 05:44:05 +0000 Message-ID: References: In-Reply-To: Accept-Language: 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.6.200.16 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0039305b-cfee-4efb-94cd-08d9e6d830f1 x-ms-traffictypediagnostic: MN2PR11MB3711:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:174; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: OShY+33OsAhTfQWsrBGotdUQeQYUc1Pj0uEWLVmqCA/S2hqA9a1FXuRIRPOwLW7Q216G1ep8ee/bni5jHBTPrs7xGgAL1mBKNZnIrsc3+gNr4cIPL1li831DePGDCdGtY+eMMpxt3iZNPzp/JsgaPQof8hbJb8gyQg+lc/G6+bKTr9tNjN42GbVL33KEFbfAkKNjd8CC5oFLUD6zhog+3C1dAmGhjqQfvNRQzJ3PFZ7nmk0bhj3Bz8nXu3M8OVTqwtzmTf6nfjPZyH4peaiVDC2amSCDjNQ2ZJTkjoA/apwvp3fc6AaguvixBMxQ8iTFRW2NoBrFIwfeFLXbPpaZmH/+oBeudII8KjfYyqPDc4faBqg+u9duZG/qHRsON2k2ZmChYLx0BKxKod48VBrymRlmC6MGo/jD9YPhZEyK2MUBS63Q38AyVpUvCu859alkgpGYXZ0fLX5MYJ4KEviUsql/gpLpHdXiSGFYs6KaDgJlp0PHfRnxkk8L5xJXRqKUOWBjB6Cbl3B9QJawqh7Y4KdL+d+w4C7OM5WTSnsorluYZFhUYqF+zrE7CexN1HPD+6Lw2DqBG+HrgcYyJWylUdoW9LMEiPvY5fxQS72X9dfZo7nTGYdtCpx4cEJloHh04QitcfUaUb++PJYLfw2WXHSIUbbk7GeqY1HBD1fBIe1JKEj9OjmfANK659IMGVFoOo1gwv/W1BIPKi3uoRfhGw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW4PR11MB5911.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(8676002)(71200400001)(53546011)(66446008)(6916009)(83380400001)(7696005)(6506007)(64756008)(8936002)(76116006)(4326008)(54906003)(55236004)(66476007)(2906002)(66556008)(26005)(66946007)(52536014)(508600001)(186003)(38100700002)(122000001)(316002)(86362001)(33656002)(82960400001)(9686003)(5660300002)(55016003)(38070700005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?vj4+FxcleoWgrDFtJWHoXeCRSrHxMtfdkNu8TUqByHKaWn+08r6mZYTmOnhq?= =?us-ascii?Q?I6FasT33gF2U+u9mPARm2fhWvusHHlc5k7jRCZiO1J1I8CGz/lC3iKU0BOO1?= =?us-ascii?Q?LaOT7tl/yjkNqDi7aK9E+qo7Z5jc2IvMya/Y1v2T6RDjcoRKdpoAsVWVc/3o?= =?us-ascii?Q?J3CKAJu6p2CJloJZZWKozjUf5MukxS3JJh1l4STZcj0At3d2nwnrts4dYErB?= =?us-ascii?Q?aKqHLdpgIJKO2Wnjifi7bWPGJCTBPraWa84F0nGle39ojO9C0XCF6MWGV7bZ?= =?us-ascii?Q?rtAH6MIMNmzY8pARZikGDyzQMmx7kwYt0p/PTFVV2s6d10NFVw+21JRp0HgS?= =?us-ascii?Q?iXdHTnjtpooqBdL4/7z48nxrnEMvNBY4AzGIzcq5URGAX9AzDWLQolGxnNhW?= =?us-ascii?Q?AKPFbTqKbJ70DiErwMT6cefMzhh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iC43skS4q8r7TKQgZCX3rqlTpKrEsXHq0Nypn8vlpZFATrceJcMU9MyQG?= =?us-ascii?Q?CxbNN6LXyn3tffoovW08pf5lYlHR4S3x6aiV4K5G70Rqt3FeT90eLsCOQEZ/?= =?us-ascii?Q?RkFZc2d76a3PQINcOLxIbpY4S2H++mqBkQ+MZItmEgnOKosIEi+PlEGJ3AI9?= =?us-ascii?Q?B7OZ+IWrQd+MqX/t3wJqGPRtH9EemVyRN8Z+uq0VJcfgr1JUko/oWmuZx0QH?= =?us-ascii?Q?8IrL4tewcYXJMKDKcEeGuUqQ2PhpOWfDr7UqmeYN5AyjjvsBOFIAgqxvvhk5?= =?us-ascii?Q?/je4W39Wo+DRWrOc1xPyYMY6NtVmGyoyeN6OZ6CylsItgThUAzn1jLjtEkPJ?= =?us-ascii?Q?e2bX8A=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR11MB5911.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0039305b-cfee-4efb-94cd-08d9e6d830f1 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Feb 2022 05:44:05.7005 (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: tbNxHH2n3+p86wQ8Y6s5oOTiNJaaT7oGutuvmHJ8nHYprFbBL47KfYFFztfMsXCB21TisvjEGRYluO9yJkNDxzZI9HCrv41jasC3a7YJImA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3711 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hi Weighuo, > -----Original Message----- > From: Weiguo Li > Sent: 03 February 2022 09:08 > To: Kundapura, Ganapati > Cc: Jayatheerthan, Jay ; Naga Harish K, S V > ; dev@dpdk.org > Subject: RE:[PATCH v2] eventdev/eth_rx: fix memory leak when token > parsing finished >=20 > Hi Ganapati, >=20 > Thanks for your reminding. >=20 > I'm a bit confused by "eth_dev_id validate" you metiond below. > I'll post a new patch for your review if this make clear. >=20 > Thanks, > -Weiguo >=20 > > ------------------ Original ------------------ > > From: "Kundapura, Ganapati" ; > > Date: Thu, Feb 3, 2022 00:47 AM > > To: "Weiguo Li";"Jayatheerthan, > > Jay"; > > Cc: "Naga Harish K, S > > V";"dev@dpdk.org"; > > Subject: RE: [PATCH v2] eventdev/eth_rx: fix memory leak when token > > parsing finished > > > > Hi Weiguo, > > Also noticed that usage of macros like > > RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET and > > RTE_ETH_VALID_PORTID_OR_ERR_RET to validate rx_adapter_id and > eth_dev_id returns error bypassing the freeing of memory get from strdup(= ) > in error case. > > > > Thanks, > > Ganapati > > > > > token =3D strtok(l_params, ","); > > > Validate token > > > > > > > /* Get device ID from parameter string */ > > > > > eth_dev_id =3D strtoul(token, NULL, 10); > > > > > RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(eth_dev_id, -EINVAL); > > > Use RTE_ETH_VALID_PORTID_OR_ERR_RET to validate eth_dev_id >=20 > I looked up the macro defines: > RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET -- use > rte_event_pmd_is_valid_dev() > RTE_ETH_VALID_PORTID_OR_ERR_RET -- use rte_eth_dev_is_valid_port() >=20 > If you mean the validate of "eth_dev_id" here be replaced by > rte_eth_dev_is_valid_port() ? > or both rte_event_pmd_is_valid_dev() and rte_eth_dev_is_valid_port() used > to do the validation? >=20 >=20 rxa_validate_id() for validating rx_adapter_id and rte_eth_dev_is_valid_por= t() for validating eth_dev_id.=20