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 0AE5BA04DD; Thu, 2 Jan 2020 11:18:57 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D696F1C022; Thu, 2 Jan 2020 11:18:56 +0100 (CET) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10057.outbound.protection.outlook.com [40.107.1.57]) by dpdk.org (Postfix) with ESMTP id 70E251C01B for ; Thu, 2 Jan 2020 11:18:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=StFUltp9iDXw95kUv7p0iOiDBelsiK+vahGd/v5h1UY=; b=hK6cUQPnb/uJhHDNQfxLrZ/jDUgBco1ZeY4mPxj46IulIBbfosN7LkY3kKwHzWHvGVuVmp0rpuKlP3GZmsFaMKUCFz0iyP51N5yBdKh+7YMplHn6J4E5LPfoe3MOq6czcoenr81vgP8jmsDFRZaY1WLUu+9c4zn6AuEj6BqSrPc= Received: from VI1PR08CA0206.eurprd08.prod.outlook.com (2603:10a6:802:15::15) by VI1PR08MB3357.eurprd08.prod.outlook.com (2603:10a6:803:45::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.12; Thu, 2 Jan 2020 10:18:53 +0000 Received: from AM5EUR03FT035.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::208) by VI1PR08CA0206.outlook.office365.com (2603:10a6:802:15::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.12 via Frontend Transport; Thu, 2 Jan 2020 10:18:53 +0000 Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dpdk.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dpdk.org; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT035.mail.protection.outlook.com (10.152.16.119) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.11 via Frontend Transport; Thu, 2 Jan 2020 10:18:53 +0000 Received: ("Tessian outbound ba41a0333779:v40"); Thu, 02 Jan 2020 10:18:53 +0000 X-CR-MTA-TID: 64aa7808 Received: from 2a7d530958db.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id DACA35A0-527B-4D59-8CF3-BEF163F513FB.1; Thu, 02 Jan 2020 10:18:48 +0000 Received: from EUR03-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 2a7d530958db.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 02 Jan 2020 10:18:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eMx/NS2TqljH803PqTZv7WbZskt0rzrsXLtN2nH0jEm59ZfgEB3Z0uLwfTXf294Dh+rP/2cpqupWCwkoRLQgeWMBgwjolfW1Cop5udt10okGHyFH0YpDtC4FbQSz+KM95M++493IW9rKQcPrhGBAPH44cvgoIdX2wgjWSsSb9YrwSmNUabJuDN0wo3xAikT7jiW+0yTtyWno44G+6HlBEhiUIbHzV1kks+FbUMyQYQIJsvS3Rx6yLAfEOfbdGumOKhXblBZiQBqT8XYW6sy7lc8+Ku6x6tealdjvNDsyXus8qrOm2V1uYyHwmrNnXa3SB2DzUByX7uP/82MjG5hprA== 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=StFUltp9iDXw95kUv7p0iOiDBelsiK+vahGd/v5h1UY=; b=A5P9KSelZVbbrqWZ1/nb30jlOQ16MgVP+BgdfDsiyqsALCMJbn6Pfpmn0UkiJ+LLnHOD5WlcIKl+Vf5uNwzC+44S0Oz76R8K79jyMelMmTV8HZNcYFQD9bmxfZ59j8Co6a10EwtwUb190DvLeEcbtzuqXl3V1KWBQa+ovGbKQo50htgRcuCGt7GEnKDwFd5mRzCC1rnHUVW+ZivW2Npu7VDvb2bRivbPT0wk9QkS+MbXt5exsxbr1uHodhV+0x92DnAD815svBNV7h+5hy5lqW64PtGq147T5RLZ/epHfCBDn4H1wCq5I41iubZHRMO1ahuL0yMqOpfxPTViVYGhBA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=StFUltp9iDXw95kUv7p0iOiDBelsiK+vahGd/v5h1UY=; b=hK6cUQPnb/uJhHDNQfxLrZ/jDUgBco1ZeY4mPxj46IulIBbfosN7LkY3kKwHzWHvGVuVmp0rpuKlP3GZmsFaMKUCFz0iyP51N5yBdKh+7YMplHn6J4E5LPfoe3MOq6czcoenr81vgP8jmsDFRZaY1WLUu+9c4zn6AuEj6BqSrPc= Received: from VI1PR08MB5376.eurprd08.prod.outlook.com (10.255.196.79) by VI1PR08MB2672.eurprd08.prod.outlook.com (10.170.238.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2581.12; Thu, 2 Jan 2020 10:18:47 +0000 Received: from VI1PR08MB5376.eurprd08.prod.outlook.com ([fe80::e080:9698:5896:6837]) by VI1PR08MB5376.eurprd08.prod.outlook.com ([fe80::e080:9698:5896:6837%5]) with mapi id 15.20.2602.012; Thu, 2 Jan 2020 10:18:47 +0000 From: Gavin Hu To: Mahipal Challa , "dev@dpdk.org" CC: "jerinj@marvell.com" , "pathreya@marvell.com" , "snilla@marvell.com" , "venkatn@marvell.com" , nd Thread-Topic: [dpdk-dev] [dpdk-dev PATCH v2 6/6] raw/octeontx2_ep: add driver self test Thread-Index: AQHVvLLoq7zE9mj4jUWcv/DuOzM8UqfXMmtQ Date: Thu, 2 Jan 2020 10:18:46 +0000 Message-ID: References: <1577450386-16966-1-git-send-email-mchalla@marvell.com> <1577450386-16966-7-git-send-email-mchalla@marvell.com> In-Reply-To: <1577450386-16966-7-git-send-email-mchalla@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: ebee07d5-7668-4c5e-9fbb-6b390e8984aa.0 x-checkrecipientchecked: true Authentication-Results-Original: spf=none (sender IP is ) smtp.mailfrom=Gavin.Hu@arm.com; x-originating-ip: [113.29.88.7] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 49155775-40c7-4795-abc8-08d78f6d2b4b X-MS-TrafficTypeDiagnostic: VI1PR08MB2672:|VI1PR08MB3357: x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true x-ms-oob-tlc-oobclassifiers: OLM:6430;OLM:6430; x-forefront-prvs: 0270ED2845 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM; SFS:(10009020)(4636009)(366004)(39850400004)(346002)(376002)(396003)(136003)(199004)(189003)(13464003)(55016002)(54906003)(186003)(316002)(66556008)(64756008)(33656002)(66946007)(66476007)(66446008)(9686003)(71200400001)(2906002)(86362001)(110136005)(76116006)(26005)(4326008)(5660300002)(81156014)(53546011)(52536014)(8936002)(6506007)(81166006)(7696005)(478600001)(55236004); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR08MB2672; H:VI1PR08MB5376.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: gg+RZuZrnn3hewK5smZyBVE7G1osMhHJt2YmRHo1qhfHcKxhzpBbnm9CnZHE//yL8gRAXSbQmE3p+LVcYvUrOYumOs3MF9naWr3IhwKrXdGBA6Tt1dPg8PJ1v4s438Pw/vpsyoLy5jPz/C2a1ljsdKHRHa7Wfo/3GgfGfHISX2c3iwgebBsMxM5tB7FC14s2fPpzKsBvY7APG90868Txn0+9zMaw4QJJn1GA4ybyne8GAshNPLv8ECeGmVcEvAW1eowNpolud0IemahKeiZqZkz0/YDVxffZHUiReEdrrkuEoExkk1dFSLia8Na33lsO7WgG9aN0DfeSH7H7bjrseuGcABbXEVV5uz8pRZNJwwTl2EOK20PlN5X3s0gyBokwUhfJ1vz0q87P9D6VV54OU0Q29gig1S1m9xqMrY/KJ7nX9p6gXLsIzqjYCu55yqYl2NDpzS6Z2qplgbOhW3okHEupXKyXU9LyKIaz5h4qSYs+v6iLB0KTtJ7nqe4Y1XTl 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-Transport-CrossTenantHeadersStamped: VI1PR08MB2672 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Gavin.Hu@arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT035.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123; IPV:CAL; SCL:-1; CTRY:IE; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(396003)(346002)(376002)(39860400002)(136003)(13464003)(189003)(199004)(33656002)(53546011)(54906003)(4326008)(6506007)(186003)(26005)(81156014)(8936002)(81166006)(336012)(5660300002)(356004)(70586007)(70206006)(26826003)(478600001)(76130400001)(2906002)(316002)(110136005)(52536014)(9686003)(7696005)(36906005)(55016002)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR08MB3357; H:64aa7808-outbound-1.mta.getcheckrecipient.com; FPR:; SPF:Pass; LANG:en; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; MX:1; A:1; X-MS-Office365-Filtering-Correlation-Id-Prvs: 5c188860-bef9-4812-cd76-08d78f6d2762 NoDisclaimer: True X-Forefront-PRVS: 0270ED2845 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0Jax/lawn9gxXrqsz9+nuKWm+xDoJdsdN2eKu6UNqSnnZLTs5oOvXjoRtEgRNkQ7F8KHj2zTK961B5IFaUgDsNg7MNMz5PNE3YIusSe4d6plbyOFHGhKV4jturnIsX2r/VjNsJuUCVpUInp0aX8mOHCBUI95XY7+dJUHDJui+FxGeIZnhMaJ8KbXOVcDxD8Uw+N15xuT9JpW1xDXBAgHJGWnl61FPpOPtQjIiTTNLY/y1CpRXagwzzEJUUFBz141p3mJ5dfi5CFgJ8515+lCOkZe7AlhgFZ7XC9/ntikCJGYhK57uz7tvYLOIbTjxnoIYvpOMK4PJZ8e06QuhwNytLzwWyP9u3QZa63U84oGk2tyyem20V5umfjSv1DMwEMiModv3nKkoDl1XpjvDTTwMBCvFAgJXJUhrqLxMMg3DJjPz/x7hBYKbKeqejYm0YsrdX/v1UbTSINDdbEyycoiE8vkzIuCHERnjihfB2bAgTz+DV4NKglcQJjl5VEVkNWE X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jan 2020 10:18:53.6160 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 49155775-40c7-4795-abc8-08d78f6d2b4b X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3357 Subject: Re: [dpdk-dev] [dpdk-dev PATCH v2 6/6] raw/octeontx2_ep: add driver self test 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 Mahipal, > -----Original Message----- > From: dev On Behalf Of Mahipal Challa > Sent: Friday, December 27, 2019 8:40 PM > To: dev@dpdk.org > Cc: jerinj@marvell.com; pathreya@marvell.com; snilla@marvell.com; > venkatn@marvell.com > Subject: [dpdk-dev] [dpdk-dev PATCH v2 6/6] raw/octeontx2_ep: add driver > self test >=20 > Add rawdev's selftest feature in SDP VF driver, which > verifies the EP mode functionality test. >=20 > Signed-off-by: Mahipal Challa > --- > doc/guides/rawdevs/octeontx2_ep.rst | 13 +++ > drivers/raw/octeontx2_ep/Makefile | 1 + > drivers/raw/octeontx2_ep/meson.build | 1 + > drivers/raw/octeontx2_ep/otx2_ep_rawdev.c | 1 + > drivers/raw/octeontx2_ep/otx2_ep_rawdev.h | 2 + > drivers/raw/octeontx2_ep/otx2_ep_test.c | 164 > ++++++++++++++++++++++++++++++ > 6 files changed, 182 insertions(+) >=20 > diff --git a/doc/guides/rawdevs/octeontx2_ep.rst > b/doc/guides/rawdevs/octeontx2_ep.rst > index 39a7c29..bbcf530 100644 > --- a/doc/guides/rawdevs/octeontx2_ep.rst > +++ b/doc/guides/rawdevs/octeontx2_ep.rst > @@ -74,3 +74,16 @@ Performing Data Transfer > To perform data transfer using SDP VF EP rawdev devices use standard > ``rte_rawdev_enqueue_buffers()`` and ``rte_rawdev_dequeue_buffers()`` > APIs. >=20 > +Self test > +--------- > + > +On EAL initialization, SDP VF devices will be probed and populated into = the > +raw devices. The rawdev ID of the device can be obtained using > + > +* Invoke ``rte_rawdev_get_dev_id("SDPEP:x")`` from the test application > + where x is the VF device's bus id specified in "bus:device.func"(BDF) > + format. Use this index for further rawdev function calls. > + > +* The driver's selftest rawdev API can be used to verify the SDP EP mode > + functional tests which can send/receive the raw data packets to/from t= he > + EP device. > diff --git a/drivers/raw/octeontx2_ep/Makefile > b/drivers/raw/octeontx2_ep/Makefile > index 02853fb..44fdf89 100644 > --- a/drivers/raw/octeontx2_ep/Makefile > +++ b/drivers/raw/octeontx2_ep/Makefile > @@ -37,6 +37,7 @@ LIBABIVER :=3D 1 > # > SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX2_EP_RAWDEV) +=3D > otx2_ep_rawdev.c > SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX2_EP_RAWDEV) +=3D > otx2_ep_enqdeq.c > +SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX2_EP_RAWDEV) +=3D > otx2_ep_test.c > SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX2_EP_RAWDEV) +=3D > otx2_ep_vf.c >=20 >=20 > diff --git a/drivers/raw/octeontx2_ep/meson.build > b/drivers/raw/octeontx2_ep/meson.build > index 99e6c6d..0e6338f 100644 > --- a/drivers/raw/octeontx2_ep/meson.build > +++ b/drivers/raw/octeontx2_ep/meson.build > @@ -5,4 +5,5 @@ > deps +=3D ['bus_pci', 'common_octeontx2', 'rawdev'] > sources =3D files('otx2_ep_rawdev.c', > 'otx2_ep_enqdeq.c', > + 'otx2_ep_test.c', > 'otx2_ep_vf.c') > diff --git a/drivers/raw/octeontx2_ep/otx2_ep_rawdev.c > b/drivers/raw/octeontx2_ep/otx2_ep_rawdev.c > index 7158b97..0778603 100644 > --- a/drivers/raw/octeontx2_ep/otx2_ep_rawdev.c > +++ b/drivers/raw/octeontx2_ep/otx2_ep_rawdev.c > @@ -253,6 +253,7 @@ > .dev_close =3D sdp_rawdev_close, > .enqueue_bufs =3D sdp_rawdev_enqueue, > .dequeue_bufs =3D sdp_rawdev_dequeue, > + .dev_selftest =3D sdp_rawdev_selftest, > }; >=20 > static int > diff --git a/drivers/raw/octeontx2_ep/otx2_ep_rawdev.h > b/drivers/raw/octeontx2_ep/otx2_ep_rawdev.h > index a77cbab..dab2fb7 100644 > --- a/drivers/raw/octeontx2_ep/otx2_ep_rawdev.h > +++ b/drivers/raw/octeontx2_ep/otx2_ep_rawdev.h > @@ -494,4 +494,6 @@ int sdp_rawdev_enqueue(struct rte_rawdev *dev, > struct rte_rawdev_buf **buffers, > int sdp_rawdev_dequeue(struct rte_rawdev *dev, struct rte_rawdev_buf > **buffers, > unsigned int count, rte_rawdev_obj_t context); >=20 > +int sdp_rawdev_selftest(uint16_t dev_id); > + > #endif /* _OTX2_EP_RAWDEV_H_ */ > diff --git a/drivers/raw/octeontx2_ep/otx2_ep_test.c > b/drivers/raw/octeontx2_ep/otx2_ep_test.c > new file mode 100644 > index 0000000..96fedb5 > --- /dev/null > +++ b/drivers/raw/octeontx2_ep/otx2_ep_test.c > @@ -0,0 +1,164 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(C) 2019 Marvell International Ltd. > + */ > + > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > + > +#include > +#include > + > +#include "otx2_common.h" > +#include "otx2_ep_rawdev.h" > + > +#define SDP_IOQ_NUM_BUFS (4 * 1024) > +#define SDP_IOQ_BUF_SIZE (2 * 1024) > + > +#define SDP_TEST_PKT_FSZ (0) > +#define SDP_TEST_PKT_SIZE (1024) > + > +static int > +sdp_validate_data(struct sdp_droq_pkt *oq_pkt, uint8_t *iq_pkt, > + uint32_t pkt_len) > +{ > + if (!oq_pkt) > + return -EINVAL; > + > + if (pkt_len !=3D oq_pkt->len) { > + otx2_err("Invalid packet length"); > + return -EINVAL; > + } > + > + if (memcmp(oq_pkt->data, iq_pkt, pkt_len) !=3D 0) { > + otx2_err("Data validation failed"); > + return -EINVAL; > + } > + otx2_sdp_dbg("Data validation successful"); > + > + return 0; > +} > + > +static void > +sdp_ioq_buffer_fill(uint8_t *addr, uint32_t len) > +{ > + uint32_t idx; > + > + memset(addr, 0, len); > + > + for (idx =3D 0; idx < len; idx++) > + addr[idx] =3D idx; > +} > + > +static struct rte_mempool* > +sdp_ioq_mempool_create(void) > +{ > + struct rte_mempool *mpool; > + > + mpool =3D rte_mempool_create("ioqbuf_pool", > + SDP_IOQ_NUM_BUFS /*num elt*/, > + SDP_IOQ_BUF_SIZE /*elt size*/, > + 0 /*cache_size*/, > + 0 /*private_data_size*/, > + NULL /*mp_init*/, > + NULL /*mp_init arg*/, > + NULL /*obj_init*/, > + NULL /*obj_init arg*/, > + rte_socket_id() /*socket id*/, > + (MEMPOOL_F_SP_PUT | > MEMPOOL_F_SC_GET)); > + > + return mpool; > +} > + > + > +int > +sdp_rawdev_selftest(uint16_t dev_id) > +{ > + struct sdp_rawdev_info app_info =3D {0}; > + struct rte_rawdev_info dev_info =3D {0}; > + > + struct rte_rawdev_buf *d_buf[1]; > + struct sdp_droq_pkt oq_pkt; > + struct sdp_soft_instr si; > + struct sdp_device sdpvf; > + > + uint32_t buf_size; > + int ret =3D 0; > + void *buf; > + > + otx2_info("SDP RAWDEV Self Test: Started"); > + > + memset(&oq_pkt, 0x00, sizeof(oq_pkt)); > + d_buf[0] =3D (struct rte_rawdev_buf *)&oq_pkt; > + > + struct rte_mempool *ioq_mpool =3D sdp_ioq_mempool_create(); > + if (!ioq_mpool) { > + otx2_err("IOQ mpool creation failed"); > + return -ENOMEM; > + } > + > + app_info.enqdeq_mpool =3D ioq_mpool; > + app_info.app_conf =3D NULL; /* Use default conf */ > + > + dev_info.dev_private =3D &app_info; > + > + ret =3D rte_rawdev_configure(dev_id, &dev_info); > + if (ret) { > + otx2_err("Unable to configure SDP_VF %d", dev_id); > + return -ENOMEM; > + } > + otx2_info("SDP VF rawdev[%d] configured successfully", dev_id); > + > + memset(&si, 0x00, sizeof(si)); > + memset(&sdpvf, 0x00, sizeof(sdpvf)); > + > + buf_size =3D SDP_TEST_PKT_SIZE; > + > + si.q_no =3D 0; > + si.reqtype =3D SDP_REQTYPE_NORESP; > + si.rptr =3D NULL; > + > + si.ih.fsz =3D SDP_TEST_PKT_FSZ; > + si.ih.tlen =3D buf_size; > + si.ih.gather =3D 0; > + > + /* Enqueue raw pkt data */ > + rte_mempool_get(ioq_mpool, &buf); > + if (!buf) { > + otx2_err("Buffer allocation failed"); > + return -ENOMEM; > + } > + > + sdp_ioq_buffer_fill(buf, buf_size); > + si.dptr =3D (uint8_t *)buf; > + > + rte_rawdev_enqueue_buffers(dev_id, NULL, 1, &si); > + usleep(10000); > + > + /* Dequeue raw pkt data */ > + ret =3D 0; > + while (ret < 1) { > + ret =3D rte_rawdev_dequeue_buffers(dev_id, &d_buf[0], 1, &si); > + rte_pause(); > + } > + > + /* Validate the dequeued raw pkt data */ > + if (sdp_validate_data((struct sdp_droq_pkt *)d_buf[0], > + buf, buf_size) !=3D 0) { > + otx2_err("Data invalid"); > + return -EINVAL; > + } > + > + rte_mempool_put(ioq_mpool, ((struct sdp_droq_pkt *)d_buf[0])- > >data); Should the mempool be freed after use? > + otx2_info("SDP RAWDEV Self Test: Successful"); > + > + return 0; > +} > + > -- > 1.8.3.1