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 290B3A04B5; Tue, 27 Oct 2020 10:20:32 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0DD9B2BF9; Tue, 27 Oct 2020 10:20:31 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id DAAE12BD5 for ; Tue, 27 Oct 2020 10:20:29 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 09R9Euv6028052; Tue, 27 Oct 2020 02:20:28 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0220; bh=eKuuilHxv5FX3+a+hx8NS6sOz4W2mR00vIDy9FnBKnw=; b=MiRcmQCf0CaD2q8ySt4diQGHBF0PqUVidRdK0EnSbybAvSm+xDrFA6TZUu9HFKkM2830 SOchGQujSS6KFK2EI4LjQ8P3KCDLQxizmrVD7EbOgB1Nj+0hZok7LUOf606FQ8rt5cgv THBPtLKjf0d5dDT4YjS8jYtBAKHWSI2m2FNWtrpr8vj64qotX0Xoub9jUMgUZw6nP6/a AttP6MK+T1MDYd3jCppuIQ/UnuVwsmIJZ3bKh9Nf6p4SVt4aVbycHZTrch0Hn1znRqe2 /bOqz++SyZBLVAI1DzzaXV6cwadpUNm8aFzMRwdmiHQYynSg1aC91DFLnwteshoA867y vA== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0b-0016f401.pphosted.com with ESMTP id 34cksm96kk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 27 Oct 2020 02:20:28 -0700 Received: from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 27 Oct 2020 02:20:26 -0700 Received: from SC-EXCH02.marvell.com (10.93.176.82) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 27 Oct 2020 02:20:26 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.48) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Tue, 27 Oct 2020 02:20:25 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MJEGqdSoTN+wmG43b/0/9tXt14RffrbDyH5hnlaYPCLYOOT7zfpLTmicabP5w+t5Q62Ntwv71O5hvTylN7lnbnfPsugYQKMjRpfn4GBhBg5s/z4sB+tTU4Z1S58Y52eMu5AzHjAFMDmqgRhdgEaMIZCsIvKfRzBd7DK/0vWFemv69cyVf6/dMcH9ilpgcvYL0ofd6DHMul7FtVoIVUTwGpt1IqZM9tDb+/fyr47e+Gta6aZYVtOsaTCN6px653N6a3QGBxUtWu1sycwdbiuYSbTvD6hKVTfe4FXH4LbIR6L3hM3c2KCul/c2CQHH/LZG47VJ2hrMMcOJgICxoOaUkg== 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=eKuuilHxv5FX3+a+hx8NS6sOz4W2mR00vIDy9FnBKnw=; b=HCHlZMu1HgY30tyTcnDDmmkXYqivdhVt84d8rPvWfz1T3D7H/5Qvi7mkWkzhtyaS+R8ou+6MXn87OzF8lWcbNXqW/8cqlbE5mECQvrFdCSA5ybHjsC6Qq8A2yB+eVfMgvJ0zGPrp/FkoB1usf3sk9O3Nfh86Ko5guDDQg/HPJLtQkXpwtJRmb+ft8Oh8SybILWNYpFUmahrTZWMf2KwDy5yuOWpKEi1HewjMxw6Xx1gxus1IGKKMrzQe+cYBB6yi6TI6ve4eO0PE0mgx/C/3590S19mksoVQrslmhSiRbXSEmrlFZL2TbIZKu9Ezo8jHUU3XNjZHXBEcKsZPyL0VEw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eKuuilHxv5FX3+a+hx8NS6sOz4W2mR00vIDy9FnBKnw=; b=tCmSmNQIBOc/mfAGGaO0r0NRfltSZyKT+LMqB/WrNg3dFUfG210ihsAiBgfPf4kBtFLqGZpVEaPxqjiMdVpiuOaybEEOoqXA17TJy+VIOUf7hfFLpqleHsC0HquGsX2NmfVt/agyDLC8Q9e19DaNYJMF4TalqaDf3mR/3PeWEjg= Received: from DM6PR18MB2410.namprd18.prod.outlook.com (2603:10b6:5:187::16) by DM5PR18MB1115.namprd18.prod.outlook.com (2603:10b6:3:31::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18; Tue, 27 Oct 2020 09:20:25 +0000 Received: from DM6PR18MB2410.namprd18.prod.outlook.com ([fe80::e184:1839:91a0:cd59]) by DM6PR18MB2410.namprd18.prod.outlook.com ([fe80::e184:1839:91a0:cd59%7]) with mapi id 15.20.3477.028; Tue, 27 Oct 2020 09:20:25 +0000 From: Guy Kaneti To: "orika@nvidia.com" CC: "thomas@monjalon.net" , Smadar Fuks , Dovrat Zifroni , "dev@dpdk.org" , Guy Kaneti Thread-Topic: [PATCH v1] app/regex: add job context Thread-Index: AQHWqEK8HoPKnLXoYkSeqraE2AsNz6mrM/oQ Date: Tue, 27 Oct 2020 09:20:25 +0000 Message-ID: References: <20201022071111.2933-1-guyk@marvell.com> In-Reply-To: <20201022071111.2933-1-guyk@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: nvidia.com; dkim=none (message not signed) header.d=none;nvidia.com; dmarc=none action=none header.from=marvell.com; x-originating-ip: [176.231.67.98] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5e04defd-207c-4243-949e-08d87a5989b2 x-ms-traffictypediagnostic: DM5PR18MB1115: x-ms-exchange-transport-forked: True 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: iqaityoWBwnQBXG89mn/4eGcozq0cAm6h61aNwrtHPgzJFNTz8OsChzCmTkmZMGF2OIvuBK5N98G2WNZmnEzNR2qK+GwfCGuHfyJ65BU12UXS8U/RZ5GW6/Q3aJqPJlHrakdAozF/I7f/psO4Zkf6PRzov5M6hMMhtACotLPmLn00Qye/B+PT/mc3NZ/9iztim+FwW6Nj4ezk+yIjHPIW+3U9dGxSn23/e3A+FkASoQ02JID/FBzPqH7EvwllLFmyvhG2+ZAhB9edqKx5wIGi4S4J/CFrCgoa/IX+jbeAGcsOSnrfUsp9ak68secBafQc8ilWnOFAWj5uueySjzIlg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR18MB2410.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(376002)(366004)(39860400002)(346002)(136003)(478600001)(66476007)(26005)(186003)(66556008)(4326008)(66446008)(9686003)(2906002)(107886003)(7696005)(6916009)(6506007)(8936002)(55016002)(53546011)(71200400001)(66946007)(76116006)(8676002)(316002)(5660300002)(52536014)(54906003)(33656002)(83380400001)(86362001)(64756008); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: 46+ABW4sdns5QZLKURU1+e2wph9fmEBA2D0I57mgWVmP3XOqWvS42+Pxi5ieBEPpp594c58WImDo5YHcRTubSn4Aa++RGQq7gJ4wUefg5E5YAlVGBNnsyFccdBeEMIC7ngYOto+dixznStdVtDm/N8z5ITusLzAaqnNUUu0bxm/1uQzZpDbB5Y/7hjAZ6LMEOg9o9nCY+KUjKv4fkGZN/LAACHKlMelDVQQPLTB/9uGjxKIJuIRclhS2daiUc76h7Mz3e9DaiE7mPzEfg1nSiseR/w2tmVnu/Ofpl68Vh3Z5dj6ouhKdX/lwIMcGO/h4ARxJYatV9UvtbRZwvYPjs+JHYiUcsz/c7bCNGcLaRj6IR4eSw2SQT6jnybSmWjj5p6vlek47x2dMkYOrG73wr8wDmYSplpbzaDPK+Qru4G8qm8wCkUyStp7bURjzAwtQUA6A3Xlv67NiN77cFjcRu8BWyeQ8TC7/LdDxeSmmxdtR263wQguxT+nPiZmu+QBoK3eyj+63suwvOcRq1d2E+UoTl23EFhiIpsf9g4GR1evBrm6iFdjGn2SaHyfNPjW+Y1pbQAYo9b/+ajpFPLIJ4GNZaUwjn2PcirQkZlSHpXkPiPy1+EmgBtiEFxWv27hloUw2bxE6bm5k8vFUPlFviA== 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: DM6PR18MB2410.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5e04defd-207c-4243-949e-08d87a5989b2 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Oct 2020 09:20:25.2895 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: RPt15hOQQUiZhAMWq/XoLtYT74XQrp2Tb4W0KRhK5qkIYIh5XGFoWHLBzOzNi44AlSXAKXvorbpTVEFuAPWsWg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR18MB1115 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.737 definitions=2020-10-27_05:2020-10-26, 2020-10-27 signatures=0 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: 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 >=20 > From: Guy Kaneti >=20 > Store mbuf pointer associated with that job. >=20 > Signed-off-by: Guy Kaneti > --- > app/test-regex/main.c | 20 ++++++++++++++++---- > 1 file changed, 16 insertions(+), 4 deletions(-) >=20 > 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, > }; >=20 > +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; >=20 > shinfo.free_cb =3D extbuf_free_cb; >=20 > @@ -275,6 +280,12 @@ run_regex(struct rte_mempool *mbuf_mp, uint32_t > nb_jobs, > return -ENOMEM; > } >=20 > + 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 Kind reminder to all maintainers, please review and ack/comment.