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 A6D98A0A02; Thu, 25 Mar 2021 09:16:01 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8BCB940693; Thu, 25 Mar 2021 09:16:01 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id C840B40147 for ; Thu, 25 Mar 2021 09:15:59 +0100 (CET) IronPort-SDR: 1wh1FBrJzStly61Tmqe6sJklqVT1XxlB2sqpUXByg78tIsk8B7anNaiBvpNPFgNGd4b3RYm2Kn o8MpBpRFqRnQ== X-IronPort-AV: E=McAfee;i="6000,8403,9933"; a="190906169" X-IronPort-AV: E=Sophos;i="5.81,277,1610438400"; d="scan'208";a="190906169" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2021 01:15:58 -0700 IronPort-SDR: Wl5O/TKieYWKTE4B/3irWS/eo9NR8/Ck98+EU/1T9v+papd+QWk6TEZjZgifH3DW22G2WRJB0s krPlZNhv912g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,277,1610438400"; d="scan'208";a="525558429" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga004.jf.intel.com with ESMTP; 25 Mar 2021 01:15:58 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Thu, 25 Mar 2021 01:15:57 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Thu, 25 Mar 2021 01:15:57 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.102) 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.2106.2; Thu, 25 Mar 2021 01:15:57 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Wzv0RZpjDAvTt+mNJSSDoWvLmQv0cgM/ehC2Z5kdElQFXoa3c63g55Y8VJHnN28exdvIxQ4YFNtpkar0DuuNWKui+EAp//7057kpc4Rd9u8hV5gVo/yHTen7Y7XJG2aip4BRxJ6K56d4zLpXLf31D+wgKm/ASWHLlO23/F2vy5PAIZv7fgEr4Ic2kRe9w0eTShr5VPZ7kcRFP5AOqw9BMo/pWVJpwmnCVliSYSPVnNTkCjd63//WPOkKtS6559FCn0j2omYbhz2TxvR2kYsUWfAeH4PGOj5MDQ2hbW4KgxnT2I/A52dxiVNs6d3o/uNsU3j27Mm+M0sBzRYGj4OZ0g== 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=utjZPjnTUgK7qItWUiUuhBDUp3QtffSMGP6etoLPRvM=; b=OIazHqxr0E0pZMHbvoYpsXkoU0sHvLBQiJCp5EE1VWFHg5A3IljM6hUIvEAmQtKXLs7bmfB4ehveELGzaqGtYhyp9x33Hv9YQdx6FMVtjFsHWzYhh/IGJ9rtrj0OI6wZt6SJ+omAYLyKlOUY5Eud7DGlOj9sT5ExNi6sOHbCRz/wNNcaIHY5kVv4rXvo+39rUljl93QSDA8gxTgfubr9U5L36rsLLGweq8uAhydnNz84RkY5fyBxaHXg0fE/RHepS1RtZGdBLa7Ku2qmFKdt83mtKhTrQDwT/C6Szbp8WhAv9B0t+dwX3vg1SP3wLMUbVBcrvkg8L/13PKwtmJ731A== 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=utjZPjnTUgK7qItWUiUuhBDUp3QtffSMGP6etoLPRvM=; b=Ix6odD8YR1iJq/Dp2GalWFyrXLHsc/XfcfM/Rvpso1MfTsC0wX8LioXIAgqWfpt5EfJ8YXmeYAg9Q3DB6J2t+RJTTJz9HixwAgxy7l3cGgFv37DcySJbBtX0/lgidHhgMDEzfKgHdCG+wOUj6PqlEjel8vhqAKq6lKz27ykONkE= Received: from SN6PR11MB3117.namprd11.prod.outlook.com (2603:10b6:805:d7::32) by SA2PR11MB4987.namprd11.prod.outlook.com (2603:10b6:806:113::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.24; Thu, 25 Mar 2021 08:15:55 +0000 Received: from SN6PR11MB3117.namprd11.prod.outlook.com ([fe80::4579:2bc0:3dc8:8b37]) by SN6PR11MB3117.namprd11.prod.outlook.com ([fe80::4579:2bc0:3dc8:8b37%5]) with mapi id 15.20.3977.026; Thu, 25 Mar 2021 08:15:55 +0000 From: "Jayatheerthan, Jay" To: "pbhagavatula@marvell.com" , "jerinj@marvell.com" , "Carrillo, Erik G" , "Gujjar, Abhinandan S" , "McDaniel, Timothy" , "hemant.agrawal@nxp.com" , "Van Haaren, Harry" , mattias.ronnblom , "Ma, Liang J" , Ray Kinsella , Neil Horman CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v5 2/8] eventdev: introduce event vector Rx capability Thread-Index: AQHXIGtsvT811S10QE+bomkBYnneq6qS4ZKw Date: Thu, 25 Mar 2021 08:15:55 +0000 Message-ID: References: <20210319205718.1436-1-pbhagavatula@marvell.com> <20210324050525.4489-1-pbhagavatula@marvell.com> <20210324050525.4489-3-pbhagavatula@marvell.com> In-Reply-To: <20210324050525.4489-3-pbhagavatula@marvell.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.5.1.3 authentication-results: marvell.com; dkim=none (message not signed) header.d=none;marvell.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [136.185.187.198] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 41b2ab8a-5f27-4cdd-69d0-08d8ef663695 x-ms-traffictypediagnostic: SA2PR11MB4987: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2887; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: sGHN96iwTMI5jdQcKqzj97/nI27CMFG3Giej7xQsfuOkxo+EEjcil3p0FJIhsZKlALzwRjRvTH+Y8tMeciPPXXvV7A65tQJOvyJ+2Vo8WI5NrrlGGz1XLvtnQ9me8a+XiHU0u8rOTvtcNaVwUiSLVi+4UPq+FF4qVvvXiCvlMbE2vtVa1NRTwfWUt0edIH43HmgOzsvkIwMHFRrA8Pv16zy1foKXjWVaX1OAHNhJoG+JJuk2aQ/Bz1PCAeeq0oaNvQ9KB3E+w0qiDaQiWPHJFCeqooxF7vCAyTSuuSvR7gZGiKxNz78oS4MHtz4v3ttSlnyVk9W231XVyf9ZKIoM8/570Z5hO0U48/oQoWc+139oAwEuBJW0ghwjKPLEVVcX00RejnAFaKXpj8eXvAM2CnNy9JDmOCc3aOs44WxJsCpINbwuCwKIc0JUxpWni2IbkbuDpw4osqd8k8HJss5EppD7gXMCGiKPAMBoV6axBuM+nYzXDpVnKy4Mk9AeQBEnUXpVyGIn+HhY0kGE7Kbbei56oLyQHbQqlDiGHMzZmJteL5n2tXVG9TS/R5s4id+KTZucBCJwSxbzVGR1NdHUrFhETiBXP+lXAql9V/AZUSrVTVN8ztAtmpyS8IRTa9lRTv3428eShxfgbrWC4YzuEToS49j4RYumtXXJBsNJqmhLkdUtltCZHmMEVBMtdPVP x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB3117.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(376002)(39860400002)(346002)(396003)(136003)(186003)(8676002)(478600001)(316002)(26005)(5660300002)(921005)(30864003)(8936002)(6506007)(38100700001)(7696005)(52536014)(71200400001)(4326008)(9686003)(64756008)(66446008)(55016002)(53546011)(66476007)(33656002)(86362001)(83380400001)(110136005)(2906002)(76116006)(66946007)(66556008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?u5KrTxrwGln7OvroDR5lY87AlMXFSb65n9CndHSWIop38KddPXdf23cIngT9?= =?us-ascii?Q?RIYaf/zti5XpZBq7InX1N7ePHhyoxqY4R8N27zSeimYfONlwZ9MGL/tEp3qH?= =?us-ascii?Q?trFi5SBry36fz3YBy/W9+xksVAwQNyccH8Qlg5Rko3rAD5XoaB5WP0uzziDd?= =?us-ascii?Q?59atzkm0NUMemieYEmWx3DTspgSQfPm5WIPeSJlvvbwsWQ8iQ9yHJydzvOys?= =?us-ascii?Q?tBl9yZ2ARczFHAKpvE6dDaAo6GipO0nvE92vA0koG7aYbyjapRgYGs5H28wo?= =?us-ascii?Q?sOdOQOKbtX3zG70l5fGsXf9lTXu8J+LXm25gaZkMswf/hslgI1YCkXhbV2wU?= =?us-ascii?Q?5xKMJWRv/sFmw9+Er2jgFyTfNs61UZMSZdJcpiuYT9jG91Shi0cD3ZJASLHV?= =?us-ascii?Q?ysA/AkniwRK5WmMGllSRbGMhFGxFLifH/aodTtOV5cYVsUcUt+FMnQ6pLe5Z?= =?us-ascii?Q?nSiloD6IOE3iMixAb2Qn5YX7Ie8b7hLukTBfDsZ0fRvEjigW9ni/Er+BmcZS?= =?us-ascii?Q?FvlQLtGOzmUzf3JcMCrtHsaFnPWTMt/KAQh5wYdL47l2480vfSddOJvJyfNk?= =?us-ascii?Q?YAL3hrvcq0jp0PbkZBxGjg5xaAeAqyMXwtIaOR03EwlwfW8rxtWnxspXLJqt?= =?us-ascii?Q?dXyZA+9oiyKIb8ot+CW1nCSuRm8j/77Q0cOkuYbyOtHTiSTJkSamfAKb+PlC?= =?us-ascii?Q?rAB1IRnKcyX4HQl+0TzWWqkZ5HmY6pyfyHcxZKvXOlKn0eCIGnKppBk7cF/w?= =?us-ascii?Q?l8Ha3Q3STPy7tjfH04DwkLqvr5updYrtbrFe51BwUmfgTvCrfQ1Ul3wyDFJ/?= =?us-ascii?Q?h8vf+A7+HVV32LRJCjPTPRh7XB/nYF9tPVlVtPyBfKkjdwl8r+sTIKl/+7SV?= =?us-ascii?Q?eGRXCTlvZ6oBO0VnTqYPxMA5htKwP7JePjoOKAbZpZUzH8fc0TqFCRcaTLmX?= =?us-ascii?Q?VB/tQQfEor/PU8zRPAL21P0crOhotxX59LPb/8lc34ctSUJmB0TpeQ17liUv?= =?us-ascii?Q?A3MCiQHI3qe0o2tM4Uls7Pd6e1qiTp1T5GVfdrE2YUflnDG6vQPOtpgZwXvs?= =?us-ascii?Q?lbXWbhowfU14r7wo2WeiHBk5+7/64Jd16uV0cf3eb+CxdHf9I185SEqbFgAT?= =?us-ascii?Q?ZPf1cjBTLCNKjbhmiobTdVjLS0tGmHKkWQXShzi/NSTu+eebtKK0GsioqBgc?= =?us-ascii?Q?EwDeTyNk28xQgzEf6vktpAMZPVoKBe9GXmNJMDtZH/TyuPb9+hvtudOiems4?= =?us-ascii?Q?RDnc65G7LgmeYUiDt73dZN2ioEfORTk2b56UbzQ26q0j6MgTgcMlU3sTqF6M?= =?us-ascii?Q?NMzyvP7PS3vEi2d6DS+SE0eQ?= 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: SN6PR11MB3117.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 41b2ab8a-5f27-4cdd-69d0-08d8ef663695 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Mar 2021 08:15:55.3030 (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: UaGeUVc0gU36LYaUOEDsJWH8MZojyDsS6H1mOfykRWOd8p5lfFZjw/lN1R6xZVdTSjXeqVSk7td2MveSkEA6sMyyo6x/a5W6CxBX4PFqUFA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR11MB4987 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v5 2/8] eventdev: introduce event vector Rx capability 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" > -----Original Message----- > From: pbhagavatula@marvell.com > Sent: Wednesday, March 24, 2021 10:35 AM > To: jerinj@marvell.com; Jayatheerthan, Jay ;= Carrillo, Erik G ; Gujjar, > Abhinandan S ; McDaniel, Timothy ; hemant.agrawal@nxp.com; Van > Haaren, Harry ; mattias.ronnblom ; Ma, Liang J > ; Ray Kinsella ; Neil Horman > Cc: dev@dpdk.org; Pavan Nikhilesh > Subject: [dpdk-dev] [PATCH v5 2/8] eventdev: introduce event vector Rx ca= pability >=20 > From: Pavan Nikhilesh >=20 > Introduce event ethernet Rx adapter event vector capability. >=20 > If an event eth Rx adapter has the capability of > RTE_EVENT_ETH_RX_ADAPTER_CAP_EVENT_VECTOR then a given Rx queue > can be configured to enable event vectorization by passing the > flag RTE_EVENT_ETH_RX_ADAPTER_QUEUE_EVENT_VECTOR to > rte_event_eth_rx_adapter_queue_conf::rx_queue_flags while configuring > Rx adapter through rte_event_eth_rx_adapter_queue_add(). >=20 > The max vector size, vector timeout define the vector size and > mempool used for allocating vector event are configured through > rte_event_eth_rx_adapter_queue_add. The element size of the element > in the vector pool should be equal to > sizeof(struct rte_event_vector) + (vector_sz * sizeof(uintptr_t)) >=20 > Application can use `rte_event_vector_pool_create` to create the > vector mempool used for > rte_event_eth_rx_adapter_queue_conf::vector_mp. >=20 > The Rx adapter would be responsible for vectorizing the mbufs > based on the flow, the vector limits configured by the application > and add the vector event of mbufs to the event queue set via > rte_event_eth_rx_adapter_queue_conf::ev::queue_id. > It should also mark rte_event_vector::union_valid and fill > rte_event_vector::port, rte_event_vector::queue. >=20 > Signed-off-by: Pavan Nikhilesh > Acked-by: Jerin Jacob > --- > .../prog_guide/event_ethernet_rx_adapter.rst | 38 ++++++ > lib/librte_eventdev/eventdev_pmd.h | 53 ++++++++ > .../rte_event_eth_rx_adapter.c | 114 ++++++++++++++++++ > .../rte_event_eth_rx_adapter.h | 105 ++++++++++++++++ > lib/librte_eventdev/rte_eventdev.h | 30 ++++- > lib/librte_eventdev/version.map | 2 + > 6 files changed, 340 insertions(+), 2 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 cb44ce0e4..5eefef355 100644 > --- a/doc/guides/prog_guide/event_ethernet_rx_adapter.rst > +++ b/doc/guides/prog_guide/event_ethernet_rx_adapter.rst > @@ -186,3 +186,41 @@ the event buffer fill level is low. The > ``rte_event_eth_rx_adapter_cb_register()`` function allow the applicatio= n > to register a callback that selects which packets to enqueue to the even= t > device. > + > +Rx event vectorization > +~~~~~~~~~~~~~~~~~~~~~~ > + > +The event devices, ethernet device pairs which support the capability > +``RTE_EVENT_ETH_RX_ADAPTER_CAP_EVENT_VECTOR`` can aggregate packets base= d on > +flow characteristics and generate a ``rte_event`` containing ``rte_event= _vector`` > +whose event type is either ``RTE_EVENT_TYPE_ETHDEV_VECTOR`` or > +``RTE_EVENT_TYPE_ETH_RX_ADAPTER_VECTOR``. > +The aggregation size and timeout are configurable at a queue level and t= he > +maximum, minimum vector sizes and timeouts vary based on the device capa= bility > +and can be queried using ``rte_event_eth_rx_adapter_vector_limits_get``. > +The Rx adapter additionally might include useful data such as ethernet d= evice > +port and queue identifier in the ``rte_event_vector::port`` and > +``rte_event_vector::queue`` and mark ``rte_event_vector::attr_valid`` as= true. > + > +A loop processing ``rte_event_vector`` containing mbufs is shown below. > + > +.. code-block:: c > + > + event =3D rte_event_dequeue_burst(event_dev, event_port, &event, > + 1, 0); > + if (!event) > + continue; > + > + switch (ev.event_type) { > + case RTE_EVENT_TYPE_ETH_RX_ADAPTER_VECTOR: > + case RTE_EVENT_TYPE_ETHDEV_VECTOR: > + struct rte_mbufs **mbufs; > + > + mbufs =3D (struct rte_mbufs **)ev[i].vec->mbufs; > + for (i =3D 0; i < ev.vec->nb_elem; i++) { > + /* Process each mbuf. */ > + } > + break; > + case ... > + ... > + } > diff --git a/lib/librte_eventdev/eventdev_pmd.h b/lib/librte_eventdev/eve= ntdev_pmd.h > index 7eb9a7739..9297f1433 100644 > --- a/lib/librte_eventdev/eventdev_pmd.h > +++ b/lib/librte_eventdev/eventdev_pmd.h > @@ -645,6 +645,53 @@ typedef int (*eventdev_eth_rx_adapter_stats_reset) > */ > typedef int (*eventdev_selftest)(void); >=20 > +struct rte_event_eth_rx_adapter_vector_limits; > +/** > + * Get event vector limits for a given event, ethernet device pair. > + * > + * @param dev > + * Event device pointer > + * > + * @param eth_dev > + * Ethernet device pointer > + * > + * @param[out] limits > + * Pointer to the limits structure to be filled. > + * > + * @return > + * - 0: Success. > + * - <0: Error code returned by the driver function. > + */ > +typedef int (*eventdev_eth_rx_adapter_vector_limits_get_t)( > + const struct rte_eventdev *dev, const struct rte_eth_dev *eth_dev, > + struct rte_event_eth_rx_adapter_vector_limits *limits); > + > +struct rte_event_eth_rx_adapter_event_vector_config; > +/** > + * Enable event vector on an given Rx queue of a ethernet devices belong= ing to > + * the Rx adapter. > + * > + * @param dev > + * Event device pointer > + * > + * @param eth_dev > + * Ethernet device pointer > + * > + * @param rx_queue_id > + * The Rx queue identifier > + * > + * @param config > + * Pointer to the event vector configuration structure. > + * > + * @return > + * - 0: Success. > + * - <0: Error code returned by the driver function. > + */ > +typedef int (*eventdev_eth_rx_adapter_event_vector_config_t)( > + const struct rte_eventdev *dev, const struct rte_eth_dev *eth_dev, > + int32_t rx_queue_id, > + const struct rte_event_eth_rx_adapter_event_vector_config *config); > + > typedef uint32_t rte_event_pmd_selftest_seqn_t; > extern int rte_event_pmd_selftest_seqn_dynfield_offset; >=20 > @@ -1067,6 +1114,12 @@ struct rte_eventdev_ops { > /**< Get ethernet Rx stats */ > eventdev_eth_rx_adapter_stats_reset eth_rx_adapter_stats_reset; > /**< Reset ethernet Rx stats */ > + eventdev_eth_rx_adapter_vector_limits_get_t > + eth_rx_adapter_vector_limits_get; > + /**< Get event vector limits for the Rx adapter */ > + eventdev_eth_rx_adapter_event_vector_config_t > + eth_rx_adapter_event_vector_config; > + /**< Configure Rx adapter with event vector */ >=20 > eventdev_timer_adapter_caps_get_t timer_adapter_caps_get; > /**< Get timer adapter capabilities */ > diff --git a/lib/librte_eventdev/rte_event_eth_rx_adapter.c b/lib/librte_= eventdev/rte_event_eth_rx_adapter.c > index d8c635e99..ac8ba5bf0 100644 > --- a/lib/librte_eventdev/rte_event_eth_rx_adapter.c > +++ b/lib/librte_eventdev/rte_event_eth_rx_adapter.c > @@ -2263,6 +2263,120 @@ rte_event_eth_rx_adapter_queue_del(uint8_t id, ui= nt16_t eth_dev_id, > return ret; > } >=20 > +int > +rte_event_eth_rx_adapter_queue_event_vector_config( > + uint8_t id, uint16_t eth_dev_id, int32_t rx_queue_id, > + struct rte_event_eth_rx_adapter_event_vector_config *config) > +{ > + struct rte_event_eth_rx_adapter_vector_limits limits; > + struct rte_event_eth_rx_adapter *rx_adapter; > + struct rte_eventdev *dev; > + uint32_t cap; > + int ret; > + > + RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL); > + RTE_ETH_VALID_PORTID_OR_ERR_RET(eth_dev_id, -EINVAL); > + > + rx_adapter =3D rxa_id_to_adapter(id); > + if ((rx_adapter =3D=3D NULL) || (config =3D=3D NULL)) > + return -EINVAL; > + > + dev =3D &rte_eventdevs[rx_adapter->eventdev_id]; > + ret =3D rte_event_eth_rx_adapter_caps_get(rx_adapter->eventdev_id, > + eth_dev_id, &cap); > + if (ret) { > + RTE_EDEV_LOG_ERR("Failed to get adapter caps edev %" PRIu8 > + "eth port %" PRIu16, > + id, eth_dev_id); > + return ret; > + } > + > + if (!(cap & RTE_EVENT_ETH_RX_ADAPTER_CAP_EVENT_VECTOR)) { > + RTE_EDEV_LOG_ERR("Event vectorization is not supported," > + " eth port: %" PRIu16 " adapter id: %" PRIu8, > + eth_dev_id, id); > + return -EINVAL; > + } > + > + ret =3D rte_event_eth_rx_adapter_vector_limits_get( > + rx_adapter->eventdev_id, eth_dev_id, &limits); > + if (ret) { > + RTE_EDEV_LOG_ERR("Failed to get vector limits edev %" PRIu8 > + "eth port %" PRIu16, > + rx_adapter->eventdev_id, eth_dev_id); > + return ret; > + } > + > + if (config->vector_sz < limits.min_sz || > + config->vector_sz > limits.max_sz || > + config->vector_timeout_ns < limits.min_timeout_ns || > + config->vector_timeout_ns > limits.max_timeout_ns || > + config->vector_mp =3D=3D NULL) { > + RTE_EDEV_LOG_ERR("Invalid event vector configuration," > + " eth port: %" PRIu16 " adapter id: %" PRIu8, > + eth_dev_id, id); > + return -EINVAL; > + } > + if (config->vector_mp->elt_size < > + (sizeof(struct rte_event_vector) + > + (sizeof(uintptr_t) * config->vector_sz))) { > + RTE_EDEV_LOG_ERR("Invalid event vector configuration," > + " eth port: %" PRIu16 " adapter id: %" PRIu8, > + eth_dev_id, id); > + return -EINVAL; > + } > + > + if (cap & RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT) { > + RTE_FUNC_PTR_OR_ERR_RET( > + *dev->dev_ops->eth_rx_adapter_event_vector_config, > + -ENOTSUP); > + ret =3D dev->dev_ops->eth_rx_adapter_event_vector_config( > + dev, &rte_eth_devices[eth_dev_id], rx_queue_id, config); > + } else { > + ret =3D -ENOTSUP; > + } Trying to understand why non-INTERNAL_PORT based event device implementatio= n returns ENOTSUP. Do you foresee any issues if such a device implements th= is function? > + > + return ret; > +} > + > +int > +rte_event_eth_rx_adapter_vector_limits_get( > + uint8_t dev_id, uint16_t eth_port_id, > + struct rte_event_eth_rx_adapter_vector_limits *limits) > +{ > + struct rte_eventdev *dev; > + uint32_t cap; > + int ret; > + > + RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL); > + RTE_ETH_VALID_PORTID_OR_ERR_RET(eth_port_id, -EINVAL); > + > + if (limits =3D=3D NULL) > + return -EINVAL; > + > + dev =3D &rte_eventdevs[dev_id]; > + > + ret =3D rte_event_eth_rx_adapter_caps_get(dev_id, eth_port_id, &cap); > + if (ret) { > + RTE_EDEV_LOG_ERR("Failed to get adapter caps edev %" PRIu8 > + "eth port %" PRIu16, > + dev_id, eth_port_id); > + return ret; > + } > + > + if (cap & RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT) { > + RTE_FUNC_PTR_OR_ERR_RET( > + *dev->dev_ops->eth_rx_adapter_vector_limits_get, > + -ENOTSUP); > + ret =3D dev->dev_ops->eth_rx_adapter_vector_limits_get( > + dev, &rte_eth_devices[eth_port_id], limits); > + } else { > + ret =3D -ENOTSUP; > + } > + Same here. > + return ret; > +} > + > int > rte_event_eth_rx_adapter_start(uint8_t id) > { > diff --git a/lib/librte_eventdev/rte_event_eth_rx_adapter.h b/lib/librte_= eventdev/rte_event_eth_rx_adapter.h > index 21bb1e54c..7407cde00 100644 > --- a/lib/librte_eventdev/rte_event_eth_rx_adapter.h > +++ b/lib/librte_eventdev/rte_event_eth_rx_adapter.h > @@ -92,6 +92,10 @@ extern "C" { > /**< This flag indicates the flow identifier is valid > * @see rte_event_eth_rx_adapter_queue_conf::rx_queue_flags > */ > +#define RTE_EVENT_ETH_RX_ADAPTER_QUEUE_EVENT_VECTOR 0x2 > +/**< This flag indicates that mbufs arriving on the queue need to be vec= torized > + * @see rte_event_eth_rx_adapter_queue_conf::rx_queue_flags > + */ >=20 > /** > * Adapter configuration structure that the adapter configuration callba= ck > @@ -169,6 +173,36 @@ struct rte_event_eth_rx_adapter_queue_conf { > */ > }; >=20 > +struct rte_event_eth_rx_adapter_event_vector_config { > + uint16_t vector_sz; > + /**< > + * Indicates the maximum number for mbufs to combine and form a vector. > + * Should be within > + * @see rte_event_eth_rx_adapter_vector_limits::min_vector_sz > + * @see rte_event_eth_rx_adapter_vector_limits::max_vector_sz > + * Valid when RTE_EVENT_ETH_RX_ADAPTER_QUEUE_EVENT_VECTOR flag is set i= n > + * @see rte_event_eth_rx_adapter_queue_conf::rx_queue_flags > + */ > + uint64_t vector_timeout_ns; > + /**< > + * Indicates the maximum number of nanoseconds to wait for receiving > + * mbufs. Should be within vectorization limits of the > + * adapter > + * @see rte_event_eth_rx_adapter_vector_limits::min_vector_ns > + * @see rte_event_eth_rx_adapter_vector_limits::max_vector_ns > + * Valid when RTE_EVENT_ETH_RX_ADAPTER_QUEUE_EVENT_VECTOR flag is set i= n > + * @see rte_event_eth_rx_adapter_queue_conf::rx_queue_flags > + */ > + struct rte_mempool *vector_mp; > + /**< > + * Indicates the mempool that should be used for allocating > + * rte_event_vector container. > + * Should be created by using `rte_event_vector_pool_create`. > + * Valid when RTE_EVENT_ETH_RX_ADAPTER_QUEUE_EVENT_VECTOR flag is set i= n > + * @see rte_event_eth_rx_adapter_queue_conf::rx_queue_flags. > + */ > +}; > + > /** > * A structure used to retrieve statistics for an eth rx adapter instanc= e. > */ > @@ -199,6 +233,32 @@ struct rte_event_eth_rx_adapter_stats { > /**< Received packet count for interrupt mode Rx queues */ > }; >=20 > +/** > + * A structure used to retrieve eth rx adapter vector limits. > + */ > +struct rte_event_eth_rx_adapter_vector_limits { > + uint16_t min_sz; > + /**< Minimum vector limit configurable. > + * @see rte_event_eth_rx_adapter_event_vector_config::vector_sz > + */ > + uint16_t max_sz; > + /**< Maximum vector limit configurable. > + * @see rte_event_eth_rx_adapter_event_vector_config::vector_sz > + */ > + uint8_t log2_sz; > + /**< True if the size configured should be in log2. > + * @see rte_event_eth_rx_adapter_event_vector_config::vector_sz > + */ > + uint64_t min_timeout_ns; > + /**< Minimum vector timeout configurable. > + * @see rte_event_eth_rx_adapter_event_vector_config::vector_timeout_ns > + */ > + uint64_t max_timeout_ns; > + /**< Maximum vector timeout configurable. > + * @see rte_event_eth_rx_adapter_event_vector_config::vector_timeout_ns > + */ > +}; > + > /** > * > * Callback function invoked by the SW adapter before it continues > @@ -467,6 +527,51 @@ int rte_event_eth_rx_adapter_cb_register(uint8_t id,= uint16_t eth_dev_id, > rte_event_eth_rx_adapter_cb_fn cb_fn, > void *cb_arg); >=20 > +/** > + * Retrieve vector limits for a given event dev and eth dev pair. > + * @see rte_event_eth_rx_adapter_vector_limits > + * > + * @param dev_id > + * Event device identifier. > + * @param eth_port_id > + * Port identifier of the ethernet device. > + * @param [out] limits > + * A pointer to rte_event_eth_rx_adapter_vector_limits structure that h= as to > + * be filled. > + * > + * @return > + * - 0: Success. > + * - <0: Error code on failure. > + */ > +__rte_experimental > +int rte_event_eth_rx_adapter_vector_limits_get( > + uint8_t dev_id, uint16_t eth_port_id, > + struct rte_event_eth_rx_adapter_vector_limits *limits); > + > +/** > + * Configure event vectorization for a given ethernet device queue, that= has > + * been added to a event eth Rx adapter. > + * > + * @param id > + * The identifier of the ethernet Rx event adapter. > + * > + * @param eth_dev_id > + * The identifier of the ethernet device. > + * > + * @param rx_queue_id > + * Ethernet device receive queue index. > + * If rx_queue_id is -1, then all Rx queues configured for the ethernet= device > + * are configured with event vectorization. > + * > + * @return > + * - 0: Success, Receive queue configured correctly. > + * - <0: Error code on failure. > + */ > +__rte_experimental > +int rte_event_eth_rx_adapter_queue_event_vector_config( > + uint8_t id, uint16_t eth_dev_id, int32_t rx_queue_id, > + struct rte_event_eth_rx_adapter_event_vector_config *config); > + > #ifdef __cplusplus > } > #endif > diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte= _eventdev.h > index aa4dd3959..678338247 100644 > --- a/lib/librte_eventdev/rte_eventdev.h > +++ b/lib/librte_eventdev/rte_eventdev.h > @@ -919,10 +919,28 @@ rte_event_dev_close(uint8_t dev_id); > * Event vector structure. > */ > struct rte_event_vector { > - uint64_t nb_elem : 16; > + uint16_t nb_elem; > /**< Number of elements in this event vector. */ > - uint64_t rsvd : 48; > + uint16_t rsvd : 15; > /**< Reserved for future use */ > + uint16_t attr_valid : 1; > + /**< Indicates that the below union attributes have valid information. > + */ > + union { > + /* Used by Rx adapter. > + * Indicates that all the elements in this vector belong to the > + * same port and queue pair when originating from Rx adapter, > + * valid only when event type is ETHDEV_VECTOR or > + * ETH_RX_ADAPTER_VECTOR. > + */ > + struct { > + uint16_t port; > + /* Ethernet device port id. */ > + uint16_t queue; > + /* Ethernet device queue id. */ > + }; > + }; > + /**< Union to hold common attributes of the vector array. */ > uint64_t impl_opaque; > /**< Implementation specific opaque value. > * An implementation may use this field to hold implementation specific > @@ -1025,8 +1043,14 @@ struct rte_event_vector { > * // Classify and handle event. > * } > */ > +#define RTE_EVENT_TYPE_ETHDEV_VECTOR = \ > + (RTE_EVENT_TYPE_VECTOR | RTE_EVENT_TYPE_ETHDEV) > +/**< The event vector generated from ethdev subsystem */ > #define RTE_EVENT_TYPE_CPU_VECTOR (RTE_EVENT_TYPE_VECTOR | RTE_EVENT_TYP= E_CPU) > /**< The event vector generated from cpu for pipelining. */ > +#define RTE_EVENT_TYPE_ETH_RX_ADAPTER_VECTOR = \ > + (RTE_EVENT_TYPE_VECTOR | RTE_EVENT_TYPE_ETH_RX_ADAPTER) > +/**< The event vector generated from eth Rx adapter. */ >=20 > #define RTE_EVENT_TYPE_MAX 0x10 > /**< Maximum number of event types */ > @@ -1171,6 +1195,8 @@ struct rte_event { > * @see struct rte_event_eth_rx_adapter_queue_conf::ev > * @see struct rte_event_eth_rx_adapter_queue_conf::rx_queue_flags > */ > +#define RTE_EVENT_ETH_RX_ADAPTER_CAP_EVENT_VECTOR 0x8 > +/**< Adapter supports event vectorization per ethdev. */ >=20 > /** > * Retrieve the event device's ethdev Rx adapter capabilities for the > diff --git a/lib/librte_eventdev/version.map b/lib/librte_eventdev/versio= n.map > index a070ef56e..902df0ae3 100644 > --- a/lib/librte_eventdev/version.map > +++ b/lib/librte_eventdev/version.map > @@ -141,6 +141,8 @@ EXPERIMENTAL { >=20 > #added in 21.05 > rte_event_vector_pool_create; > + rte_event_eth_rx_adapter_vector_limits_get; > + rte_event_eth_rx_adapter_queue_event_vector_config; > }; >=20 > INTERNAL { > -- > 2.17.1 More of informational queries. Acked-by: Jay Jayatheerthan