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 810E4A04DD; Wed, 28 Oct 2020 08:37:55 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F0D069B04; Wed, 28 Oct 2020 08:37:52 +0100 (CET) Received: from nat-hk.nvidia.com (nat-hk.nvidia.com [203.18.50.4]) by dpdk.org (Postfix) with ESMTP id 8708C72EE for ; Wed, 28 Oct 2020 08:37:50 +0100 (CET) Received: from HKMAIL102.nvidia.com (Not Verified[10.18.92.77]) by nat-hk.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Wed, 28 Oct 2020 15:37:48 +0800 Received: from HKMAIL102.nvidia.com (10.18.16.11) by HKMAIL102.nvidia.com (10.18.16.11) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 28 Oct 2020 07:37:46 +0000 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.106) by HKMAIL102.nvidia.com (10.18.16.11) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Wed, 28 Oct 2020 07:37:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mtznSkTFxfMuFdPrHLtym3/HBI77oabQmk/JPPtrFem16q6sfK84NRHrWcC/DDyyjfP2QW4TuH2KjHFPjhpKLsluwr7wKlQn84mdL4JkCHb21V9NY4nB9VA40JI4vgbDcpu81yGjnc/PkRg1GdUc0nyCkRXLuLL8L0UsrdsP4B3wq1nrYePpsCuB6aqOvHiev7Rg59BcgOn6Jfzyy1ek+QSYl4RGMgkIaxXtyb71kvtlAvoV92FvdfxQ0WPX1wvqYzl5l+ZXP+JfazpSRj0U+2L2KeAJRHO7crZhZcAa+d17HF9hU5XSBtMW3xtEIkwjH9UseFJJGaW63E2/WZJu8A== 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=LRKzJmvjQx18r0/CJn9ezpRKhTnnG2c0a0jedQdzzoM=; b=G488qaThVtsFKh6bQsZ/AnBup3KyJhknpd99DEsy6hQ1w4epbadBsTzFlODzWi3gA/pxQqYQwpFHV0ve5OuyLPx5Y8wN8S3FM2bQ7QS2ZyP/f5dGGZUIZVuu+zK7lC1E95zbf9ZjosFT8daViy6hEcNUJXXPqn94945kgmN0sjkRhtRgyxpiD4nFe6B1ELnk0DOGGKKQnGHTuVYGT5CY0Hytye0r4upyjpMGfCcrXN4CDvZJHNiDHwT1tlYZJl5BoALjHU0PKvN+NTRfPy7m9c7JU6IOT2D0PHQl4vWA8/EULKfekDozwMFSpxPwOZm4vGKBSJiNdFzZGqT8r9EvyA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none Received: from DM6PR12MB4987.namprd12.prod.outlook.com (2603:10b6:5:163::31) by DM6PR12MB4217.namprd12.prod.outlook.com (2603:10b6:5:219::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.19; Wed, 28 Oct 2020 07:37:44 +0000 Received: from DM6PR12MB4987.namprd12.prod.outlook.com ([fe80::cf2:dfd0:1877:bf3a]) by DM6PR12MB4987.namprd12.prod.outlook.com ([fe80::cf2:dfd0:1877:bf3a%3]) with mapi id 15.20.3477.028; Wed, 28 Oct 2020 07:37:44 +0000 From: Ori Kam To: Guy Kaneti CC: NBU-Contact-Thomas Monjalon , Smadar Fuks , Dovrat Zifroni , "dev@dpdk.org" Thread-Topic: [PATCH v1] app/regex: add job context Thread-Index: AQHWqELIDw+QA7SrQU+D/sXANiA4xamrNEiAgAF1alA= Date: Wed, 28 Oct 2020 07:37:44 +0000 Message-ID: References: <20201022071111.2933-1-guyk@marvell.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: marvell.com; dkim=none (message not signed) header.d=none;marvell.com; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [147.236.152.129] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8e54bbda-b374-4945-1503-08d87b145bf2 x-ms-traffictypediagnostic: DM6PR12MB4217: x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:506; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: l+Qx3OIbRikW0UJe+pSCcG9RYZmQlXlZ2KSY0NurUBRo21Rnq8Oa//Nu0kLPWbMv386zWSiqQsfBW6rzA8zUyEvTDd+6l1PGvLUas+r0aoPNoydJGcPiazsiXZYTDHCdg1OcUlgc2N1t6yk1XjkT4kPWlcyj6GZX7kHB8ROGO6y83uPBtPlASiUFH3SOuDwPQtBJIP6ve8SpAvAjrbkpD8amr0JQlLlNNjbwjBpZjWdCVa4mj55+88t0ss5nF6mbn1eeunGUhFejHhb573xLmh2eSN7yUwfE85PlcONwSPEJ70RDH6W2OLXyv7u3wZZy2hL10Z/RRZC0DCHHigPWzQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR12MB4987.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(396003)(346002)(136003)(366004)(39860400002)(54906003)(9686003)(7696005)(316002)(83380400001)(186003)(86362001)(2906002)(55016002)(66946007)(76116006)(66446008)(64756008)(66556008)(66476007)(6916009)(33656002)(71200400001)(8936002)(53546011)(478600001)(6506007)(8676002)(5660300002)(52536014)(4326008)(26005); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: PXvILdNU1T7fLg06e0bEXN1FhXd+5NjUqSmVqP/8R4+rSRw5qttl3SuLT2ElJ+su0ZGUOHGeGUFCymA9kahf2EyqNF7P4pmAtp9X2UiGKptdD1ZTUpFL3Kwn7fUhw46NsMwAsS7cQgcksQgZWY9aSKfmlukaiWCHXDfc/k+wh8y9eOBHqzvvWwYlTI4jzsadWHacgEXTiOdyS0pkmoLHK5b8+IYFRXVv2eD07+ImeUXAWsWeb9anop8rG+kfUCl8OjA3E/Up6sAbTD0z1nlvlhDOG1Vqvr2nDwbpwyM07w9ZREZNnydE+bQwiRiNtbyVu4X8HRusoZuQrCFLt9aHPkJpyhzJ04aFP2uKV8T5dxnSXczChnGj2hJ9W4NBmQNpDw/QSkGchiQ9HXXa34yliAjLS0rjwxObuD6hPJ490IM/uDZ2w0AsFMt6C6FI3eFEnjn7ThB+Z/YU235g3R+Q6Ykbt+ECTiIMPRIdU+P0vXP6HD8Q3X7wA4z0NQL6aaImoxPsKm0E/Y+qIhtuw309YkykDwzgeDMKd7zwyzwgwGJLDkP6WbCev3IJFu8SWx4Jxw2amlTK7lFNRhoqiuPmxcWcOTkqVQsZEUy3X5GONAUyhfZYF+zD7E/oDnDs4UMU3+t91YQUStxheoFjeZ1iOQ== 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-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4987.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8e54bbda-b374-4945-1503-08d87b145bf2 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Oct 2020 07:37:44.4009 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: DATVHFShKm5Lger9ZNC2B60g90xKtYBkX2Fbk29aiv0iI/oaWoSv7UinrRGPOm6d9knNRJx9Ayg1ltqm8njE/A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4217 X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1603870668; bh=LRKzJmvjQx18r0/CJn9ezpRKhTnnG2c0a0jedQdzzoM=; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To: CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References: In-Reply-To:Accept-Language:Content-Language:X-MS-Has-Attach: X-MS-TNEF-Correlator:authentication-results:x-originating-ip: x-ms-publictraffictype:x-ms-office365-filtering-correlation-id: x-ms-traffictypediagnostic:x-ld-processed: x-microsoft-antispam-prvs:x-ms-oob-tlc-oobclassifiers: x-ms-exchange-senderadcheck:x-microsoft-antispam: x-microsoft-antispam-message-info:x-forefront-antispam-report: x-ms-exchange-antispam-messagedata:x-ms-exchange-transport-forked: Content-Type:Content-Transfer-Encoding:MIME-Version: X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-AuthSource: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-originalarrivaltime: X-MS-Exchange-CrossTenant-fromentityheader: X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype: X-MS-Exchange-CrossTenant-userprincipalname: X-MS-Exchange-Transport-CrossTenantHeadersStamped:X-OriginatorOrg; b=NKuSVWpCQyog3QYUs/D1u4qAjnbHCrdrWWRdIgL50CenklW4nM+P9Qom+zHnzaFa8 AwFaM0TlC19A+T0uyqxWfAuWyPd//Uf0aphg6828rmUi43mAP6NZVZmYi5If4LU27a IfrEatFLtcKyNTx8QCUGpvpxuN8qMdxjjtgT9vxLsGC/sUG+q3N/GsNHsxwLTzCeY3 Q1nBfkB3KO2rYg1p0XcEmLtuuyOerfsSRWYLNob44vZ6skfTaez2E9EA3cvXbXQm5M hzeLMtGKCXfo0FzFJnuROqJ5HKbpZuuMa2etr49709ky8bd/dnl3I6kY0h68h5+Oy0 twLEWJApQetPw== Subject: Re: [dpdk-dev] [PATCH v1] app/regex: add job context 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" Hi > -----Original Message----- > From: Guy Kaneti > Sent: Tuesday, October 27, 2020 11:20 AM > Subject: RE: [PATCH v1] app/regex: add job context >=20 > Hi, >=20 > > -----Original Message----- > > From: guyk@marvell.com > > Sent: Thursday, October 22, 2020 10:11 AM > > To: orika@nvidia.com > > Cc: thomas@monjalon.net; Guy Kaneti ; Smadar Fuks > > ; Dovrat Zifroni ; > > dev@dpdk.org > > Subject: [PATCH v1] app/regex: add job context > > > > From: Guy Kaneti > > > > Store mbuf pointer associated with that job. > > > > Signed-off-by: Guy Kaneti > > --- > > app/test-regex/main.c | 20 ++++++++++++++++---- > > 1 file changed, 16 insertions(+), 4 deletions(-) > > > > diff --git a/app/test-regex/main.c b/app/test-regex/main.c index > > e6080b44b..f869d754b 100644 > > --- a/app/test-regex/main.c > > +++ b/app/test-regex/main.c > > @@ -35,6 +35,10 @@ enum app_args { > > ARG_NUM_OF_ITERATIONS, > > }; > > > > +struct job_ctx { > > + struct rte_mbuf *mbuf; > > +}; > > + > > static void > > usage(const char *prog_name) > > { > > @@ -266,6 +270,7 @@ run_regex(struct rte_mempool *mbuf_mp, uint32_t > > nb_jobs, > > time_t start; > > time_t end; > > double time; > > + struct job_ctx *jobs_ctx; > > > > shinfo.free_cb =3D extbuf_free_cb; > > > > @@ -275,6 +280,12 @@ run_regex(struct rte_mempool *mbuf_mp, uint32_t > > nb_jobs, > > return -ENOMEM; > > } > > > > + jobs_ctx =3D rte_malloc(NULL, sizeof(struct job_ctx)*nb_jobs, 0); > > + if (!jobs_ctx) { > > + printf("Error, can't allocate memory for jobs_ctx.\n"); > > + return -ENOMEM; > > + } > > + > > /* Allocate the jobs and assign each job with an mbuf. */ > > for (i =3D 0; i < nb_jobs; i++) { > > ops[i] =3D rte_malloc(NULL, sizeof(*ops[0]) + > > nb_max_matches * @@ -317,6 +328,7 @@ run_regex(struct rte_mempool > > *mbuf_mp, uint32_t nb_jobs, > > long act_job_len =3D RTE_MIN(job_len, buf_len - pos); > > rte_pktmbuf_attach_extbuf(ops[i]->mbuf, &buf[pos], 0, > > act_job_len, &shinfo); > > + jobs_ctx[i].mbuf =3D ops[i]->mbuf; > > ops[i]->mbuf->data_len =3D job_len; > > ops[i]->mbuf->pkt_len =3D act_job_len; > > ops[i]->user_id =3D i; > > @@ -386,13 +398,13 @@ run_regex(struct rte_mempool *mbuf_mp, > > uint32_t nb_jobs, > > } > > end: > > for (i =3D 0; i < actual_jobs; i++) { > > - if (ops[i]) { > > - if (ops[i]->mbuf) > > - rte_pktmbuf_free(ops[i]->mbuf); > > + if (ops[i]) > > rte_free(ops[i]); > > - } > > + if (jobs_ctx[i].mbuf) > > + rte_pktmbuf_free(jobs_ctx[i].mbuf); > > } > > rte_free(ops); > > + rte_free(jobs_ctx); > > if (buf) > > rte_free(buf); > > return res; > > -- > > 2.28.0 >=20 > Kind reminder to all maintainers, please review and ack/comment. Acked-by: Ori Kam Best, Ori