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 2EC82A0C45; Wed, 6 Oct 2021 08:19:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DDE91413BC; Wed, 6 Oct 2021 08:19:26 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id EC4F0410EA for ; Wed, 6 Oct 2021 08:19:24 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10128"; a="223324221" X-IronPort-AV: E=Sophos;i="5.85,350,1624345200"; d="scan'208";a="223324221" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2021 23:19:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,350,1624345200"; d="scan'208";a="656873418" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga005.jf.intel.com with ESMTP; 05 Oct 2021 23:19:23 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 5 Oct 2021 23:19:22 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 5 Oct 2021 23:19:22 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Tue, 5 Oct 2021 23:19:22 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.40) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Tue, 5 Oct 2021 23:19:22 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZN9nHVy6ObOEuiTqSgRkT4B6qbsn1zEIT0INcdGn/84Jn6ZpR3QQy9zyytT/n8jhradN8s0JWn/zsWnMAlGAE33M5/wAA+ar2yLab1f4KCwpUlf7XL1abh+/b77iQPCa64rznY0j0uU5VX0YnLzvhs/fy2ubsOxe6ijvUvyNfwegEiWsogRPXUVG9uPNOWB13ewZqpLby4LVOoTH+0TDb6O7UvW/6hGva+FaqyyjQHO0e0D+vYqZZT96J3mVsn9PnxvgewrYERFPHpNvwYFrfOw0/Ek29Ds2AfvSCN3pvffMfcUtoFkslDsSEH0uazWBUbSMSWd39UCwzUplx5GQAw== 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=D7VcNL9sN6OEoWCvlEgD94eWM5E2JopE0T7JhI1m6UE=; b=S1NETP3jp4uv+GNxjnQx7zbTKSRStCKByf3p/BSHGs0PE/FzMs699Q3jghjZIJg0yGHRHUiE28quo6r7cKu92GHV236dXoqnN3rY06dtLVrbtMEkEbvtyaQopf7tZUqVs9f6UHG32z772aIIttkR2WaG3uJc2NLm4aR19YVxQuFKZksiqQzSOoZJQIWl/MGofGNrQzRddpE86vYd/he1NUbzc88b6Mq83qSWHA8xvfy3ZQ7B6UOH/UnwvCthqIdTM959GP5wtH5DzhHrmXRDV4GIo4xfDLUqlWXh2Ip8ZD1+h4aNYEpHtwQ+HK1unJWaxLewfRTNVyQIrHcxTyDQYQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=D7VcNL9sN6OEoWCvlEgD94eWM5E2JopE0T7JhI1m6UE=; b=rTqn5k9wWL7OguUCa9B9tspamfhWLmrIraGBTpZR5M8rKEhMZRGOApCDDglRO+5jJaoKZ3osF0ePy4JCqtzeBLHsePp10oaVw38fegiSKf3Ueq1UnYia9j7pP5Pxx8ODV9bdYENbmweDYIx9D/sTLZv0fG57s7n4Uc3zJvEpato= Received: from MWHPR1101MB2253.namprd11.prod.outlook.com (2603:10b6:301:52::17) by MWHPR11MB1758.namprd11.prod.outlook.com (2603:10b6:300:10f::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18; Wed, 6 Oct 2021 06:19:21 +0000 Received: from MWHPR1101MB2253.namprd11.prod.outlook.com ([fe80::d56:f55:5cb9:1b28]) by MWHPR1101MB2253.namprd11.prod.outlook.com ([fe80::d56:f55:5cb9:1b28%3]) with mapi id 15.20.4587.018; Wed, 6 Oct 2021 06:19:21 +0000 From: "Jayatheerthan, Jay" To: "Naga Harish K, S V" , "jerinj@marvell.com" CC: "dev@dpdk.org" , "Kundapura, Ganapati" Thread-Topic: [PATCH v7 1/5] eventdev/rx_adapter: add event buffer size configurability Thread-Index: AQHXumcVDqqbgS3aRUm4zieKfUaimKvFfw+Q Date: Wed, 6 Oct 2021 06:19:21 +0000 Message-ID: References: <20211005143846.1058491-1-s.v.naga.harish.k@intel.com> <20211006040256.1443140-1-s.v.naga.harish.k@intel.com> In-Reply-To: <20211006040256.1443140-1-s.v.naga.harish.k@intel.com> 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: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 94cce4ae-8db8-490b-26f2-08d988913c6c x-ms-traffictypediagnostic: MWHPR11MB1758: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:268; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: laiWHb4cAFUO6ZLj2IkpX0KB0FyY2x3nzn77ShV76Wz59zlum1IRSHtdY0lj5WiVLaAU3c/JOu0KZVv0LBWPCB1zfHLlAQuCzRnHODTD+YWz82nuRf6edlz6JG5BvjXt21ObhiM3qBgveYfau8r0o/InG27qCwj+p68NyDW0FaJd305axO6kmJVpfEFPUBUUcIxgj54BcPcItK3Z0sey8E1laa9jSXd9Crz+mnOS5t3JD+2/VHgBe72Lm34DnYlwG0SllL+IR0LCOlm6MNnlSf6oS9vfo5/VTFUG0V21fstSYcZi8gO035HQkkt3TOMMw/i7kJyJ/CHT6ePMrq2GhFJWpmFoTJKn38SzYmE7qBHG8gY3nA0lERnfge5tCQBJyLNLFK30koPpbQ9ZQim5Lo7jhcrHorEviRy4uh3EQFBHBLdnk9IDola/tPuR0RRyoBsTDoxQBr3+rwmaPNop4n/EGhONJTJP9P0+QJGIA3FL9ZuYaYZpsputFWbsaxgghaCWrZTW6CmKbg9FPEHjSJWmVMZxO9KE/qbx92qCUAWF+W88xguyYx2fykI6w1PqzIo4PfHWATWvFaiRtYiGcKU3cm9E8/iRR76xM7O24TVLNCjviXl5psePRY6G3p7OvBTVaVyTiw8RKljybJEixhMI2zPEi8hN0SoxV5Du8JFN0J9X0vn9SbkWRJdxddfNHnOQgP0nxdlv/GoWSOP3cg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR1101MB2253.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(8676002)(508600001)(86362001)(33656002)(52536014)(66946007)(66476007)(66446008)(64756008)(66556008)(107886003)(5660300002)(53546011)(6506007)(83380400001)(38070700005)(2906002)(54906003)(110136005)(9686003)(30864003)(76116006)(38100700002)(71200400001)(122000001)(55016002)(26005)(8936002)(7696005)(316002)(4326008)(186003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?SElVVFEqvPJv79ri8uspo83fUStfhaCRS6xjnoq13gT6S1fXtdYOpMpQkhZC?= =?us-ascii?Q?iJCXHz2eoHU14nbcmK/1UEVuIEBa25H1VEi7WPI+zo2cyluHSZiNj//5Kh3q?= =?us-ascii?Q?THuQ+zKeQpDOGVTjC9mMKnpwMzqBtn8HMMz5cToglYUDJhThZ/AUwwOpHEpj?= =?us-ascii?Q?Kkszb1vFnSE3z67n9bHNLcn28LXaEw2vq8v0X67vNcSdoZA/q+HAe2aGD7uY?= =?us-ascii?Q?NCxWLF0iXJPYJU1PhNjW2erDOt1ACMFgfhdBXywGyA0/lK5zhA+VveLTqtD7?= =?us-ascii?Q?SHtyjyXY2NfTfIGh7VIBjpC6UjDQKTm1MlAw4AXrLGbELGO7ozsx8hYqvNvo?= =?us-ascii?Q?27yQ4/UR0Rk9ZET+jow8dicQ0N9F2nDJkK7wFT2socNKvBBLRi974qnxPT+v?= =?us-ascii?Q?oot5k80ZJ+9vD9ZuDt13P/FxxpjAeNNrUQXpgSf50gfrvR1gMQY/USdAvrp+?= =?us-ascii?Q?Gnyq2BpArVaWgqrUb3wgNyvXS3DMyMt/J+oecSfT/DM65jos93JTO1mL+WHh?= =?us-ascii?Q?LkkoW7xAMtzGe5R1Om0Yae0kSbrpP039Kh5zO0Uv7uRvA8q0O2KX7kSpJjzd?= =?us-ascii?Q?L/YWsKx1JD+Mo3+BGj0iFEOzcAfaIcDu562xLPAimvwbM5bs0QtOgBASnqS6?= =?us-ascii?Q?GUv23VLOkN+dJWFoNiDuZRWqdT7WnPqr57PzF/8JBYwgIc78+SiL1GUrkzzS?= =?us-ascii?Q?145UGDL4+ZtHUpIi+WfC9RkRUilkViNyuQOkV8HRxkzulDmDTk1T1TRLtszI?= =?us-ascii?Q?/w2VjECV9Nm1hpyd1QNV8YMbnxKpaBQsxQodBSjKfgUFUe8Vci8L2h75KhBm?= =?us-ascii?Q?maJwBHuBNENZMiPJyBjfLMJ7YZD2jAJJpTiHJizc2lbj0Nuz5SiMXrhpREnQ?= =?us-ascii?Q?vB+5iadqM+gG9NVrHK74ZhSql4NXf4EgayQU7pqcPjHE8+hMOpyIqTbP8hfC?= =?us-ascii?Q?GjM7EqMNdOW6ct17rJp6leKyyLueS67zw7ZlQcGbLFn0dQR5tuHFDJ950DS3?= =?us-ascii?Q?KfvCGmDqMC0D+UlDLnLJEhhGyvpEW3OjOuaBrDxlAxpIFaVJ3RNwdKmpinH7?= =?us-ascii?Q?BAbaJJZqHGojU/ELiOlCCTEknFZ8b0lg71w412TVxzNDjfRY6ZPt3gbBq/Tr?= =?us-ascii?Q?Pr8uCXR790uX+K1H+Df/pvL9Hz7ffoX7Fkx0z9Y19g8EzEUvY1EYXWUAh0Vc?= =?us-ascii?Q?9DKHOXPHuJjMZCxv86NS07fvrehm7YZfGxUH23BNX6LAW/skhB67vzytA8Kq?= =?us-ascii?Q?djZjJCxPOdBM93a78Vq8iKUGyBYDUPjasgatM+VHNO63pUZ9STBge0RPkfjh?= =?us-ascii?Q?81NVlEM2Y4Sfu+0qbld/C7Cm?= 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: MWHPR1101MB2253.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 94cce4ae-8db8-490b-26f2-08d988913c6c X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Oct 2021 06:19:21.3712 (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: CsMjiKu6JT4y0LYQMvnX/vptKLf8bPfQbo9VSHvze8fxCTWdJELnd9UqhraQKFXuASgZgGSIY/ZhRp1JmICfMro6fr7DPuobVcwp+oTogpc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1758 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v7 1/5] eventdev/rx_adapter: add event buffer size configurability 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 Sender: "dev" Acked-by: Jay Jayatheerthan > -----Original Message----- > From: Naga Harish K, S V > Sent: Wednesday, October 6, 2021 9:33 AM > To: jerinj@marvell.com; Jayatheerthan, Jay > Cc: dev@dpdk.org; Kundapura, Ganapati > Subject: [PATCH v7 1/5] eventdev/rx_adapter: add event buffer size config= urability >=20 > Currently event buffer is static array with a default size defined > internally. >=20 > To configure event buffer size from application, > ``rte_event_eth_rx_adapter_create_with_params`` api is added which > takes ``struct rte_event_eth_rx_adapter_params`` to configure event > buffer size in addition other params . The event buffer size is > rounded up for better buffer utilization and performance . In case > of NULL params argument, default event buffer size is used. >=20 > Signed-off-by: Naga Harish K S V > Signed-off-by: Ganapati Kundapura >=20 > --- > v7: > * added additional validation check in adapter_create_with_params > API as per review comments >=20 > v6: > * address code style related review comments >=20 > v5: > * reverted queue conf get unit test change >=20 > v4: > * rebased with latest dpdk-next-eventdev branch > * changed queue conf get unit test >=20 > v3: > * updated documentation and code comments as per review comments. > * updated new create api test case name with suitable one. >=20 > v2: > * Updated header file and rx adapter documentation as per review comments= . > * new api name is modified as rte_event_eth_rx_adapter_create_with_params > as per review comments. > * rxa_params pointer argument Value NULL is allowed to represent the > default values >=20 > v1: > * Initial implementation with documentation and unit tests. > --- > --- > .../prog_guide/event_ethernet_rx_adapter.rst | 7 ++ > lib/eventdev/rte_event_eth_rx_adapter.c | 98 +++++++++++++++++-- > lib/eventdev/rte_event_eth_rx_adapter.h | 41 +++++++- > lib/eventdev/version.map | 2 + > 4 files changed, 140 insertions(+), 8 deletions(-) >=20 > diff --git a/doc/guides/prog_guide/event_ethernet_rx_adapter.rst b/doc/gu= ides/prog_guide/event_ethernet_rx_adapter.rst > index ce23d8a474..8526aecf57 100644 > --- a/doc/guides/prog_guide/event_ethernet_rx_adapter.rst > +++ b/doc/guides/prog_guide/event_ethernet_rx_adapter.rst > @@ -62,6 +62,13 @@ service function and needs to create an event port for= it. The callback is > expected to fill the ``struct rte_event_eth_rx_adapter_conf structure`` > passed to it. >=20 > +If the application desires to control the event buffer size, it can use = the > +``rte_event_eth_rx_adapter_create_with_params()`` api. The event buffer = size is > +specified using ``struct rte_event_eth_rx_adapter_params::event_buf_size= ``. > +The function is passed the event device to be associated with the adapte= r > +and port configuration for the adapter to setup an event port if the > +adapter needs to use a service function. > + > Adding Rx Queues to the Adapter Instance > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >=20 > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_e= vent_eth_rx_adapter.c > index 10491ca07b..5ccea168ea 100644 > --- a/lib/eventdev/rte_event_eth_rx_adapter.c > +++ b/lib/eventdev/rte_event_eth_rx_adapter.c > @@ -85,7 +85,9 @@ struct rte_eth_event_enqueue_buffer { > /* Count of events in this buffer */ > uint16_t count; > /* Array of events in this buffer */ > - struct rte_event events[ETH_EVENT_BUFFER_SIZE]; > + struct rte_event *events; > + /* size of event buffer */ > + uint16_t events_size; > /* Event enqueue happens from head */ > uint16_t head; > /* New packets from rte_eth_rx_burst is enqued from tail */ > @@ -946,7 +948,7 @@ rxa_buffer_mbufs(struct rte_event_eth_rx_adapter *rx_= adapter, > dropped =3D 0; > nb_cb =3D dev_info->cb_fn(eth_dev_id, rx_queue_id, > buf->last | > - (RTE_DIM(buf->events) & ~buf->last_mask), > + (buf->events_size & ~buf->last_mask), > buf->count >=3D BATCH_SIZE ? > buf->count - BATCH_SIZE : 0, > &buf->events[buf->tail], > @@ -972,7 +974,7 @@ rxa_pkt_buf_available(struct rte_eth_event_enqueue_bu= ffer *buf) > uint32_t nb_req =3D buf->tail + BATCH_SIZE; >=20 > if (!buf->last) { > - if (nb_req <=3D RTE_DIM(buf->events)) > + if (nb_req <=3D buf->events_size) > return true; >=20 > if (buf->head >=3D BATCH_SIZE) { > @@ -2206,12 +2208,15 @@ rxa_ctrl(uint8_t id, int start) > return 0; > } >=20 > -int > -rte_event_eth_rx_adapter_create_ext(uint8_t id, uint8_t dev_id, > - rte_event_eth_rx_adapter_conf_cb conf_cb, > - void *conf_arg) > +static int > +rxa_create(uint8_t id, uint8_t dev_id, > + struct rte_event_eth_rx_adapter_params *rxa_params, > + rte_event_eth_rx_adapter_conf_cb conf_cb, > + void *conf_arg) > { > struct rte_event_eth_rx_adapter *rx_adapter; > + struct rte_eth_event_enqueue_buffer *buf; > + struct rte_event *events; > int ret; > int socket_id; > uint16_t i; > @@ -2226,6 +2231,7 @@ rte_event_eth_rx_adapter_create_ext(uint8_t id, uin= t8_t dev_id, >=20 > RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL); > RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL); > + > if (conf_cb =3D=3D NULL) > return -EINVAL; >=20 > @@ -2273,11 +2279,30 @@ rte_event_eth_rx_adapter_create_ext(uint8_t id, u= int8_t dev_id, > rte_free(rx_adapter); > return -ENOMEM; > } > + > rte_spinlock_init(&rx_adapter->rx_lock); > + > for (i =3D 0; i < RTE_MAX_ETHPORTS; i++) > rx_adapter->eth_devices[i].dev =3D &rte_eth_devices[i]; >=20 > + /* Rx adapter event buffer allocation */ > + buf =3D &rx_adapter->event_enqueue_buffer; > + buf->events_size =3D rxa_params->event_buf_size; > + > + events =3D rte_zmalloc_socket(rx_adapter->mem_name, > + buf->events_size * sizeof(*events), > + 0, socket_id); > + if (events =3D=3D NULL) { > + RTE_EDEV_LOG_ERR("Failed to allocate mem for event buffer\n"); > + rte_free(rx_adapter->eth_devices); > + rte_free(rx_adapter); > + return -ENOMEM; > + } > + > + rx_adapter->event_enqueue_buffer.events =3D events; > + > event_eth_rx_adapter[id] =3D rx_adapter; > + > if (conf_cb =3D=3D rxa_default_conf_cb) > rx_adapter->default_cb_arg =3D 1; >=20 > @@ -2293,6 +2318,61 @@ rte_event_eth_rx_adapter_create_ext(uint8_t id, ui= nt8_t dev_id, > return 0; > } >=20 > +int > +rte_event_eth_rx_adapter_create_ext(uint8_t id, uint8_t dev_id, > + rte_event_eth_rx_adapter_conf_cb conf_cb, > + void *conf_arg) > +{ > + struct rte_event_eth_rx_adapter_params rxa_params =3D {0}; > + > + /* use default values for adapter params */ > + rxa_params.event_buf_size =3D ETH_EVENT_BUFFER_SIZE; > + > + return rxa_create(id, dev_id, &rxa_params, conf_cb, conf_arg); > +} > + > +int > +rte_event_eth_rx_adapter_create_with_params(uint8_t id, uint8_t dev_id, > + struct rte_event_port_conf *port_config, > + struct rte_event_eth_rx_adapter_params *rxa_params) > +{ > + struct rte_event_port_conf *pc; > + int ret; > + struct rte_event_eth_rx_adapter_params temp_params =3D {0}; > + > + if (port_config =3D=3D NULL) > + return -EINVAL; > + > + /* use default values if rxa_params is NULL */ > + if (rxa_params =3D=3D NULL) { > + rxa_params =3D &temp_params; > + rxa_params->event_buf_size =3D ETH_EVENT_BUFFER_SIZE; > + } > + > + if (rxa_params->event_buf_size =3D=3D 0) > + return -EINVAL; > + > + pc =3D rte_malloc(NULL, sizeof(*pc), 0); > + if (pc =3D=3D NULL) > + return -ENOMEM; > + > + *pc =3D *port_config; > + > + /* adjust event buff size with BATCH_SIZE used for fetching packets > + * from NIC rx queues to get full buffer utilization and prevent > + * unnecessary rollovers. > + */ > + rxa_params->event_buf_size =3D RTE_ALIGN(rxa_params->event_buf_size, > + BATCH_SIZE); > + rxa_params->event_buf_size +=3D (BATCH_SIZE + BATCH_SIZE); > + > + ret =3D rxa_create(id, dev_id, rxa_params, rxa_default_conf_cb, pc); > + if (ret) > + rte_free(pc); > + > + return ret; > +} > + > int > rte_event_eth_rx_adapter_create(uint8_t id, uint8_t dev_id, > struct rte_event_port_conf *port_config) > @@ -2302,12 +2382,14 @@ rte_event_eth_rx_adapter_create(uint8_t id, uint8= _t dev_id, >=20 > if (port_config =3D=3D NULL) > return -EINVAL; > + > RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL); >=20 > pc =3D rte_malloc(NULL, sizeof(*pc), 0); > if (pc =3D=3D NULL) > return -ENOMEM; > *pc =3D *port_config; > + > ret =3D rte_event_eth_rx_adapter_create_ext(id, dev_id, > rxa_default_conf_cb, > pc); > @@ -2336,6 +2418,7 @@ rte_event_eth_rx_adapter_free(uint8_t id) > if (rx_adapter->default_cb_arg) > rte_free(rx_adapter->conf_arg); > rte_free(rx_adapter->eth_devices); > + rte_free(rx_adapter->event_enqueue_buffer.events); > rte_free(rx_adapter); > event_eth_rx_adapter[id] =3D NULL; >=20 > @@ -2711,6 +2794,7 @@ rte_event_eth_rx_adapter_stats_get(uint8_t id, >=20 > stats->rx_packets +=3D dev_stats_sum.rx_packets; > stats->rx_enq_count +=3D dev_stats_sum.rx_enq_count; > + > return 0; > } >=20 > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.h b/lib/eventdev/rte_e= vent_eth_rx_adapter.h > index 470543e434..846ca569e9 100644 > --- a/lib/eventdev/rte_event_eth_rx_adapter.h > +++ b/lib/eventdev/rte_event_eth_rx_adapter.h > @@ -26,6 +26,7 @@ > * The ethernet Rx event adapter's functions are: > * - rte_event_eth_rx_adapter_create_ext() > * - rte_event_eth_rx_adapter_create() > + * - rte_event_eth_rx_adapter_create_with_params() > * - rte_event_eth_rx_adapter_free() > * - rte_event_eth_rx_adapter_queue_add() > * - rte_event_eth_rx_adapter_queue_del() > @@ -37,7 +38,7 @@ > * > * The application creates an ethernet to event adapter using > * rte_event_eth_rx_adapter_create_ext() or rte_event_eth_rx_adapter_cre= ate() > - * functions. > + * or rte_event_eth_rx_adapter_create_with_params() functions. > * The adapter needs to know which ethernet rx queues to poll for mbufs = as well > * as event device parameters such as the event queue identifier, event > * priority and scheduling type that the adapter should use when constru= cting > @@ -257,6 +258,17 @@ struct rte_event_eth_rx_adapter_vector_limits { > */ > }; >=20 > +/** > + * A structure to hold adapter config params > + */ > +struct rte_event_eth_rx_adapter_params { > + uint16_t event_buf_size; > + /**< size of event buffer for the adapter. > + * This value is rounded up for better buffer utilization > + * and performance. > + */ > +}; > + > /** > * > * Callback function invoked by the SW adapter before it continues > @@ -357,6 +369,33 @@ int rte_event_eth_rx_adapter_create_ext(uint8_t id, = uint8_t dev_id, > int rte_event_eth_rx_adapter_create(uint8_t id, uint8_t dev_id, > struct rte_event_port_conf *port_config); >=20 > +/** > + * This is a variant of rte_event_eth_rx_adapter_create() with additiona= l > + * adapter params specified in ``struct rte_event_eth_rx_adapter_params`= `. > + * > + * @param id > + * The identifier of the ethernet Rx event adapter. > + * > + * @param dev_id > + * The identifier of the event device to configure. > + * > + * @param port_config > + * Argument of type *rte_event_port_conf* that is passed to the conf_cb > + * function. > + * > + * @param rxa_params > + * Pointer to struct rte_event_eth_rx_adapter_params. > + * In case of NULL, default values are used. > + * > + * @return > + * - 0: Success > + * - <0: Error code on failure > + */ > +__rte_experimental > +int rte_event_eth_rx_adapter_create_with_params(uint8_t id, uint8_t dev_= id, > + struct rte_event_port_conf *port_config, > + struct rte_event_eth_rx_adapter_params *rxa_params); > + > /** > * Free an event adapter > * > diff --git a/lib/eventdev/version.map b/lib/eventdev/version.map > index 9f280160fa..7de18497a6 100644 > --- a/lib/eventdev/version.map > +++ b/lib/eventdev/version.map > @@ -138,6 +138,8 @@ EXPERIMENTAL { > __rte_eventdev_trace_port_setup; > # added in 20.11 > rte_event_pmd_pci_probe_named; > + # added in 21.11 > + rte_event_eth_rx_adapter_create_with_params; >=20 > #added in 21.05 > rte_event_vector_pool_create; > -- > 2.25.1