From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0081.outbound.protection.outlook.com [104.47.37.81]) by dpdk.org (Postfix) with ESMTP id CF6385F0F for ; Tue, 10 Jul 2018 14:17:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SC7Q4aUZXZDzAuAYuHrddUGT7MgjoNS65LqWyUriYKc=; b=ng2KHAKqWBpULBbfTDX2DlRax/J29kETAJn91GbtyuIQaZtq3mrScZF1+eMvizGu9RK9hlwRtyy/TJQMrm8ll3On8mQ4AZPa5d7QrpctmRJbiFX8M+Jz2e+JKywWfbPfsvLaJfPNVVMbLGqct5kKGUdTz5JQwhM3abihTyyutr0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin (111.93.218.67) by CY1PR07MB2523.namprd07.prod.outlook.com (2a01:111:e400:c636::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.930.19; Tue, 10 Jul 2018 12:17:44 +0000 Date: Tue, 10 Jul 2018 17:47:30 +0530 From: Jerin Jacob To: Nikhil Rao Cc: olivier.matz@6wind.com, dev@dpdk.org, anoob.joseph@cavium.com Message-ID: <20180710121728.GA11131@jerin> References: <1530859329-160189-1-git-send-email-nikhil.rao@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1530859329-160189-1-git-send-email-nikhil.rao@intel.com> User-Agent: Mutt/1.10.0 (2018-05-17) X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BM1PR0101CA0070.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:19::32) To CY1PR07MB2523.namprd07.prod.outlook.com (2a01:111:e400:c636::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: afb9f173-61c4-4f79-1073-08d5e65f2551 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600053)(711020)(2017052603328)(7153060)(7193020); SRVR:CY1PR07MB2523; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2523; 3:V01GbgjgDAZGP45kidBAvoO7X/M60jmSxVYgMGeBijtGnvmehZtL8ouLY9sD6f6He+XG8aW4FW7cGy7HP7bl0A3g362faTvDCWkrWGu2TN49bQa1DCzJCi1BpAK8W5f2jCouoT3XHO8Qc6ZL9ER5Ik3bxlu0pmK1s95tA0TUQULM7eRxsxU6RtwJnw3zKGI+GZUz+slSdY8+b5kNJEoJxHLMeeY7ZY6PG/B0gtI1Y+JurgAxLd6Ck7z7hy4olsoo; 25:m2K9MfxddXcPBskoWfx4iR2V9Gc8RZCMcVnSO/ilqqT/G4TDHRGS45P55AgWuwtCFcqCNeZOF3Gs1Mwgw1epgpMeN9g2R+3jgAkq44PcKY3w7cYGBNMsasa1z2THLF8M7nu/fHi8BfHZlynt2ISdGZr5fi2av38DrmVJbUkCsVTdA9xdaddWcx1eSbfpRCnczxZN3XSGpThMje6GR8BtNG9G7GrwzWN36MuXqaTMeoVc5F8vfWsEpt2/Ip4pssnuBIywmRkPhBp0+UgAA/HCWNp/M2K1pWPh1nPTDqHl6IdZcKT1bPzp2OW/vVHwoXOyDpAU9pNTbQNMazUmlwjZww==; 31:AFIuTG1EgVwh6DsVX26Qn6xkROzDO27QCgVB6D4nfWs5ol6xrZZ+lSqj3p4uL/y2kALozdNVI4iuuqiFEYoYyx3Fee2565QLF1YTyhxEwubBnn0NEnHSdYSYcI9WVhqI5ULZqHgzgehbc51n+UneKtUEqO3s8KGr38XlW5QxQZl2YBMRIkx30Svzntk3EAKgulqRRf8BAfzd3zI6zEz5m2IVYlko0CFG2lSV/vOXqjw= X-MS-TrafficTypeDiagnostic: CY1PR07MB2523: X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2523; 20:t5smBJXbGzT9eO/+TLRU3u2IXMH0WWbioX7RzKK3ASBQsWuD+oJdovcORnryqSlIeV4Py94GoVXdjYogIaFeuBt3YJoCNBVDsuoOmqcimThnNa8FH1JAxc/4gFOzPkJoIoJ09NqlvtgIecnkKZydKsZOxTS2l6KtfKtT5COWlSfTUz3JpAxy8kXUg26HsMVIpPlR3ir+mrqqvG6Nk+j5czlYpLPczZBpiezQ0F2Vgo70GxVkXCIvPMFuwq1wTl2bo3EMtlips9CZTnSm+m7Ier9dFSDEo6vIuoMO677csCzyw30MSov/1QxKWJVr/ENPIDdMEKzetx6C7+31qiMtTl1GP0T31VOLcURRKSbGYU0ReFUPkA48uZbiUqpW/iKR5ywtSFSjfBv2+chatRqqo9dlUeXOJ3CZyQlIdpWH22pHu+CQ4nKYRN3LS4B4hEEYnqmHS7bI2zcJFZuOEotlcdhcRM83t6w2Kgjn8VMCHnhIrWv9m0VHymOptiSiKxQQD3OI3GNN416TCeNbI4cW97heeCTG0oU/6Yl7SAHJZi7zG54Dn8I5oom0TuSmRJaoY6ppY6UtmUN+X11CAUhbKw6wK/cmujoMhizjBe3hfFo= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(228905959029699); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(3231311)(944501410)(52105095)(3002001)(10201501046)(149027)(150027)(6041310)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:CY1PR07MB2523; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2523; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2523; 4:TOE26ELV0Z8N4oTCJ6clkDZxXoS6G2bnK4HBzzH9IMn34r9hqrC/XFpw8PVehWCYJaQ8NlMZ7azhkp8CsA7q3MrfdnbTWx5FDuPXUpy7KNmZEhq0yD0N7pvkuvIZMZUTbr8NDKaEJP1+SW7NZFOP4Sj8DpvOU2G4cmiahQESOv4RP7dE1wkKPJCNwK801v38EOTh+FchEdHcJxbmVQZ3CttYaaToO61cFxRz/8AWngoF+hJswoPOFVVTcudggW7CIWdIF1uGdVak77vlePZXVq10k8fsICRD1Gc8cAN+oFfqXXGEOOlu4Lo9wBeMj4T6PTFTERUggjeBY/r2nbKpRQsY9EAydOtIwDuA/mzhGvw= X-Forefront-PRVS: 0729050452 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(39860400002)(366004)(136003)(396003)(376002)(43544003)(13464003)(189003)(199004)(7736002)(4326008)(305945005)(966005)(72206003)(81166006)(81156014)(8676002)(229853002)(478600001)(107886003)(53936002)(55016002)(47776003)(6306002)(6916009)(9686003)(6666003)(5660300001)(97736004)(33656002)(25786009)(6246003)(8936002)(956004)(23726003)(1076002)(476003)(66066001)(5009440100003)(2906002)(316002)(6496006)(68736007)(26005)(16526019)(186003)(44832011)(76176011)(33896004)(16586007)(50466002)(52116002)(386003)(58126008)(446003)(11346002)(33716001)(6116002)(42882007)(5024004)(14444005)(486006)(106356001)(105586002)(3846002)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR07MB2523; H:jerin; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR07MB2523; 23:IKN+EvcP7MY0ZoVU8YsDSw2BH0A0nHedtWTQeFJcH?= =?us-ascii?Q?SyAwXo4bG+19kwbnGQreiIhlJOc7Ap5tasS8eZv1cUzS9ODtVIQbkkhsTZuN?= =?us-ascii?Q?ScrnLTKOV/1BvmaOhh5OhZD0PhB5iw1wsdNyAFVdHm7yAqJx6an4KJ539fhf?= =?us-ascii?Q?Ww+FXPUwa2Vh2ENlqolzlebze0O7ktP6aj6u0FZfelOM8ZWiDxMDbdO6YDZZ?= =?us-ascii?Q?9r+7KbHHt6jr9yJisrHLhgXkuznmfof+SE95wjL1fadM99mLj3XyIk+kxJe+?= =?us-ascii?Q?1y31qsFQEFZhhnug/02ImfxmIsXKk5uhphyLQwq4aDQF7ovTDVyAMK9KgpsA?= =?us-ascii?Q?SUS5UYkpynDlaXN7agenhcUjK41wRfWchIU2l62GsA7KzGs4cKVfEO+AhJFA?= =?us-ascii?Q?9rqLY8Z7NMATbvy+BtISRFP1GpiI6iummBJ5LXZzH23faOGLzGpc/2dFwY8u?= =?us-ascii?Q?ZYqlV+psltZ5HSojmzkrFnTCBcvSPIeQsJ2LDXmKhdwRPD016ylFEpn0PX6T?= =?us-ascii?Q?rE0sTtOOCq0l53u5egS3mr2VwnzUsSFnRL8nQnBFC1rLsjWgh7T2JUhRaWRe?= =?us-ascii?Q?L2GO/8gstmeefynogZSbEaJyu49Wyuv+SpWQ/dLX5yUZ5bFsNRbN9r+vxIQg?= =?us-ascii?Q?9Z0ft0/ZoLWdotluwli5LGVoYIMXMTlCIBRz3HEPIYfFYk0aDHBX6D+7QLUa?= =?us-ascii?Q?SB55DKSlfgve3m2VFd+AwP4jYE+fPdaAZA61tszjTy04duRes2yewNQIq94o?= =?us-ascii?Q?aP0fR4pQGbLRQFfceg/c8fHs9mzTxN8LSl9/otDG2aB2q8vW/SPuVEgzckuF?= =?us-ascii?Q?QcZZ/8mhBuKGb3uJ4xCbLeKAKhtJ8dPy+d+i1NXww+DdK+BCjwZhdbmSNG2i?= =?us-ascii?Q?DKoAG9NvzJHxm2jCQk2FM9xsqex+VTOvvxks32c/ZyQW8inn7jcm4Y/tdVQ/?= =?us-ascii?Q?8hCO1LcZAVkvMGAHodhnkARUuC+5BMCulre2nVoVOnCvPwPfPSfKkqzU9d+8?= =?us-ascii?Q?2DL5fal4ucoQ6PFZCZFP1azHVEblybYytmoNF1nkUhUBG3677xSrohfIEcuU?= =?us-ascii?Q?ABtWvrreC7ADmd3vTm/nr2TaeDnOiguW12vh5WcUmNaD+XOLZF1ucEuxI5/3?= =?us-ascii?Q?Wuj9l2nsCXt37iq3riykSCzM8tNMUuGMn5hmJu8n8Uo/TKTVENAev2ndoPvd?= =?us-ascii?Q?f+a7YGaDorQZ3/T3qW7g7xOYV6e7sWnInYtzt+kMqfmFN8m9Q6eoalJHJI/E?= =?us-ascii?Q?Mp9Qexcpk9kvyqL/PEP+tMKrAfTFBYDeixHr2950ur9vU0yq2WS73b274pSv?= =?us-ascii?Q?Wk3005TaQC9n1/8EEHYk/YWVn6lOy2QvBxvON9AR3W2F7yf5Nxz56L/jbCmP?= =?us-ascii?Q?v1Fw6bLs2iZcqlVcWc6odW34fATiIeoS5e9DunjhNlht0rTAIc0oExjPh7PV?= =?us-ascii?Q?bkUghARnXZlh11Ipdt5urW9BpFkFUvyYtiwuHRLpOqUXU9B8OvN?= X-Microsoft-Antispam-Message-Info: jXk7KW/MMi/QfgV/P7W47ge+SuArXy89/Zl2F3bROy4pMzvbSe+afrSxKOgdtH2dlmnLa6CXtWSkgnhsgK6ya2wCWc67lgf8kKUmc/izRekJGl+4lNeaVpVa7e2ptAo339TAnTJri7Qa4qg+tYBiAZo+idCTX72i52qm1S8cW7DNRR4/1fqs0mNEeQsfIwHex8jFlqFe0iyzG8fx/35MU3BQB/1SaWyRFqIwcxDfv9vNkSr1ZH0WoTnRT9nrTjkpsPC3IqYZoyFBnKYR+ix5vU9+z4MpoOx4gyHJmTVA9XmQmB8zhINynLobf2lr9i4qhWWwZksMKjEEoxg99Fllrz8ocr289ghD1jGFsGriDIU= X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2523; 6:aYCuhcX6CO3aygrz/Alg71i69/+EK8v0hXdFKdjDnymdGiWJtoB20q2QFgln50WyKrWFYEcFhu+IzCPSO4U2qtTQMn9nTzjhYJsRQEqE6xHsFwXiU6tN/ajQPMVaTo8vydwjrs9qq1bSf3Nhfqq7ovnE41KDr4qn+2G9ndlIP7oUIdzX0EB2M9wU5ZLJtOBWlO5QkTQorAPQShX0+JBqqC2jFxMzh5WGzKyo0JJQhvhzBrT501Z1lM7Hq5BF3MpztPFUJ186DpUfF+VqwC/9aMppfR0tjQh3Fyv0/rhjQAciXWj+p7o8KTk+YtfGwJx7kLp4xhypGzVVor+f1JxAJ1LNPVMsed9EIp2Qi3ANB7EUwiUzqKjAdjsjY9COpeo8CcGGZJVaYyDpwxutU0Wwg0tVM/gr9U7b0qPM+D7KjQCLoGBGbYme2MhkWkvebp4RkKdPgg/KyY6hIyDHxzfKug==; 5:AojsEH5zMW4452Dok3iDj2pNvlmpDy4JDVDsK93/T/bCKF6UAht4AlLWWwwBZAckLXvl9hTtIDrz2hVQGAuEwEb18Nyb443KFwHyA4OYuMwRVhEcvpTQG9wQBaDsCCGfz04iIRuJqoAngP3+jQ5QRlvKjmOgbE1UWznwcDsVSls=; 24:YyOp0GIAqt7zqjR0thrG3HIP12vj57noqzp3DWQuhVX9X4N+BxFphymLS1x+jZz420ekSQ8mGt/Bv7w1XsxttkwQy9dyogj9a4wpkFt4e7I= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2523; 7:D5uk4LfwUwnSbiGz1D3FPQpyuChaXlo6TYiLzDc8e3zEptBpW93R3dUr0TVvvYz44ndCIsl0f+d5f6zGMVPhS+hBFZ11Q0YAyBcJIN8M8WDaY3JWFmIIS8ukGKbBconP5y2GmdeKwH2ul3bdjhNhJeT70t9lQiZkB+pM/ZWA1jc+ETYAzTS5cGelLYrUUOL2TfRlmg+5zoW+26SN7uY4FQKZ4gF8knhKAxbXrej8bmepAhxGddQW07UKfwu61VHW X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2018 12:17:44.7589 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: afb9f173-61c4-4f79-1073-08d5e65f2551 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2523 Subject: Re: [dpdk-dev] [PATCH 1/4] eventdev: add eth Tx adapter APIs 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: , X-List-Received-Date: Tue, 10 Jul 2018 12:17:49 -0000 -----Original Message----- > Date: Fri, 6 Jul 2018 12:12:06 +0530 > From: Nikhil Rao > To: jerin.jacob@caviumnetworks.com, olivier.matz@6wind.com > CC: nikhil.rao@intel.com, dev@dpdk.org > Subject: [PATCH 1/4] eventdev: add eth Tx adapter APIs > X-Mailer: git-send-email 1.8.3.1 > > > The ethernet Tx adapter abstracts the transmit stage of an > event driven packet processing application. The transmit > stage may be implemented with eventdev PMD support or use a > rte_service function implemented in the adapter. These APIs > provide a common configuration and control interface and > an transmit API for the eventdev PMD implementation. > > The transmit port is specified using mbuf::port. The transmit > queue is specified using the rte_event_eth_tx_adapter_txq_set() > function. The mbuf will specify a queue ID in the future > (http://mails.dpdk.org/archives/dev/2018-February/090651.html) > at which point this function will be replaced with a macro. > > Signed-off-by: Nikhil Rao > --- 1) Update doc/api/doxy-api-index.md 2) Update lib/librte_eventdev/Makefile +SYMLINK-y-include += rte_event_eth_tx_adapter.h I think, the following working is _pending_ 1) Update app/test-eventdev/ for Tx adapter 2) Update examples/eventdev_pipeline/ for Tx adapter 3) Add Tx adapter documentation 4) Add Tx adapter ops for octeontx driver 5) Add Tx adapter ops for dpaa driver(if need) Nikhil, If you are OK then Cavium would like to take up (1), (2) and (4) activities. Let me know your thoughts. Since this patch set already crossed the RC1 deadline. We will complete all the _pending_ work and push to next-eventdev tree in the very beginning of v18.11 so that Anoob's adapter helper function work can be added v18.11. > > This patch series adds the event ethernet Tx adapter which is > based on a previous RFC > * RFCv1 - http://mails.dpdk.org/archives/dev/2018-May/102936.html > * RFCv2 - http://mails.dpdk.org/archives/dev/2018-June/104075.html > > RFC -> V1: > ========= > > * Move port and tx queue id to mbuf from mbuf private area. (Jerin Jacob) > > * Support for PMD transmit function. (Jerin Jacob) > > * mbuf change has been replaced with rte_event_eth_tx_adapter_txq_set(). > The goal is to align with the mbuf change for a qid field. > (http://mails.dpdk.org/archives/dev/2018-February/090651.html). Once the mbuf > change is available, the function can be replaced with a macro with no impact > to applications. > > * Various cleanups (Jerin Jacob) > > lib/librte_eventdev/rte_event_eth_tx_adapter.h | 497 +++++++++++++++++++++++++ > lib/librte_mbuf/rte_mbuf.h | 4 +- > MAINTAINERS | 5 + > 3 files changed, 505 insertions(+), 1 deletion(-) > create mode 100644 lib/librte_eventdev/rte_event_eth_tx_adapter.h > > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change without prior notice > + * > + * A structure used to retrieve statistics for an eth tx adapter instance. > + */ > +struct rte_event_eth_tx_adapter_stats { > + uint64_t tx_retry; > + /**< Number of transmit retries */ > + uint64_t tx_packets; > + /**< Number of packets transmitted */ > + uint64_t tx_dropped; > + /**< Number of packets dropped */ > +}; > + > +/** Event Eth Tx Adapter Structure */ > +struct rte_event_eth_tx_adapter { > + uint8_t id; > + /**< Adapter Identifier */ > + uint8_t eventdev_id; > + /**< Max mbufs processed in any service function invocation */ > + uint32_t max_nb_tx; > + /**< The adapter can return early if it has processed at least > + * max_nb_tx mbufs. This isn't treated as a requirement; batching may > + * cause the adapter to process more than max_nb_tx mbufs. > + */ > + uint32_t nb_queues; > + /**< Number of Tx queues in adapter */ > + int socket_id; > + /**< socket id */ > + rte_spinlock_t tx_lock; > + /**< Synchronization with data path */ > + void *dev_private; > + /**< PMD private data */ > + char mem_name[RTE_EVENT_ETH_TX_ADAPTER_SERVICE_NAME_LEN]; > + /**< Memory allocation name */ > + rte_event_eth_tx_adapter_conf_cb conf_cb; > + /** Configuration callback */ > + void *conf_arg; > + /**< Configuration callback argument */ > + uint16_t dev_count; > + /**< Highest port id supported + 1 */ > + struct rte_event_eth_tx_adapter_ethdev *txa_ethdev; > + /**< Per ethernet device structure */ > + struct rte_event_eth_tx_adapter_stats stats; > +} __rte_cache_aligned; Can you move this structure to .c file as implementation, Reasons are - a) It should not be under ABI deprecation b) INTERNAL_PORT based adapter may have different values.i.e the above structure is implementation defined. > + > +struct rte_event_eth_tx_adapters { > + struct rte_event_eth_tx_adapter **data; > +}; > + same as above > +/* Per eth device structure */ > +struct rte_event_eth_tx_adapter_ethdev { > + /* Pointer to ethernet device */ > + struct rte_eth_dev *dev; > + /* Number of queues added */ > + uint16_t nb_queues; > + /* PMD specific queue data */ > + void *queues; > +}; same as above > + > +extern struct rte_event_eth_tx_adapters rte_event_eth_tx_adapters; > + same as above > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change without prior notice > + * > + * Create a new event ethernet Tx adapter with the specified identifier. > + * > + * @param id > + * The identifier of the event ethernet Tx adapter. > + * @param dev_id > + * The event device identifier. > + * @param port_config > + * Event port configuration, the adapter uses this configuration to > + * create an event port if needed. > + * @return > + * - 0: Success > + * - <0: Error code on failure > + */ > +int __rte_experimental > +rte_event_eth_tx_adapter_create(uint8_t id, uint8_t dev_id, > + struct rte_event_port_conf *port_config); > + > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change without prior notice > + * > + * Create a new event ethernet Tx adapter with the specified identifier. > + * > + * @param id > + * The identifier of the event ethernet Tx adapter. > + * @param dev_id > + * The event device identifier. > + * @param conf_cb > + * Callback function that initalizes members of the s/initalizes/initializes > + * struct rte_event_eth_tx_adapter_conf struct passed into > + * it. > + * @param conf_arg > + * Argument that is passed to the conf_cb function. > + * @return > + * - 0: Success > + * - <0: Error code on failure > + */ > +int __rte_experimental > +rte_event_eth_tx_adapter_create_ext(uint8_t id, uint8_t dev_id, > + rte_event_eth_tx_adapter_conf_cb conf_cb, > + void *conf_arg); > + > +/** > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change without prior notice > + * > + * Add a Tx queue to the adapter. > + * A queue value of -1 is used to indicate all > + * queues within the device. > + * > + * @param id > + * Adapter identifier. > + * @param eth_dev_id > + * Ethernet Port Identifier. > + * @param queue > + * Tx queue index. > + * @return > + * - 0: Success, Queues added succcessfully. s/succcessfully/successfully > + * - <0: Error code on failure. > + */ > +int __rte_experimental > +rte_event_eth_tx_adapter_queue_add(uint8_t id, > + uint16_t eth_dev_id, > + int32_t queue); > + > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change without prior notice > + * > + * > + * Set Tx queue in the mbuf. > + * > + * @param pkt > + * Pointer to the mbuf. > + * @param queue > + * Tx queue index. > + */ > +void __rte_experimental > +rte_event_eth_tx_adapter_txq_set(struct rte_mbuf *pkt, uint16_t queue); 1) Can you make this as static inline for better performance(as it is just a mbuf field access)? 2) Please add _get function, It will be useful for application and Tx adapter op implementation. > + > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change without prior notice > + * > + * Retrieve the adapter event port. The adapter creates an event port if > + * the RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT is not set in the > + * eth Tx capabilities of the event device. > + * > + * @param id > + * Adapter Identifier. > + * @param[out] event_port_id > + * Event port pointer. > + * @return > + * - 0: Success. > + * - <0: Error code on failure. > + */ > +int __rte_experimental > +rte_event_eth_tx_adapter_event_port_get(uint8_t id, uint8_t *event_port_id); > + > +static __rte_always_inline uint16_t __rte_experimental > +__rte_event_eth_tx_adapter_enqueue(uint8_t id, uint8_t dev_id, uint8_t port_id, > + struct rte_event ev[], > + uint16_t nb_events, > + const event_tx_adapter_enqueue fn) > +{ > + const struct rte_eventdev *dev = &rte_eventdevs[dev_id]; Access to *dev twice(see below rte_event_eth_tx_adapter_enqueue()) > + struct rte_event_eth_tx_adapter *txa = > + rte_event_eth_tx_adapters.data[id]; Just like common Tx adapter implementation, We can manage ethdev queue to adapter mapping internally. So this deference is not required in fastpath. Please simply call the following, just like other eventdev ops. fn(dev->data->ports[port_id], ev, nb_events) > + > +#ifdef RTE_LIBRTE_EVENTDEV_DEBUG > + if (id >= RTE_EVENT_ETH_TX_ADAPTER_MAX_INSTANCE || > + dev_id >= RTE_EVENT_MAX_DEVS || > + !rte_eventdevs[dev_id].attached) { > + rte_errno = -EINVAL; > + return 0; > + } > + > + if (port_id >= dev->data->nb_ports) { > + rte_errno = -EINVAL; > + return 0; > + } > +#endif > + return fn((void *)txa, dev, dev->data->ports[port_id], ev, nb_events); > +} > + > +/** > + * Enqueue a burst of events objects or an event object supplied in *rte_event* > + * structure on an event device designated by its *dev_id* through the event > + * port specified by *port_id*. This function is supported if the eventdev PMD > + * has the RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT capability flag set. > + * > + * The *nb_events* parameter is the number of event objects to enqueue which are > + * supplied in the *ev* array of *rte_event* structure. > + * > + * The rte_event_eth_tx_adapter_enqueue() function returns the number of > + * events objects it actually enqueued. A return value equal to *nb_events* > + * means that all event objects have been enqueued. > + * > + * @param id > + * The identifier of the tx adapter. > + * @param dev_id > + * The identifier of the device. > + * @param port_id > + * The identifier of the event port. > + * @param ev > + * Points to an array of *nb_events* objects of type *rte_event* structure > + * which contain the event object enqueue operations to be processed. > + * @param nb_events > + * The number of event objects to enqueue, typically number of > + * rte_event_port_enqueue_depth() available for this port. > + * > + * @return > + * The number of event objects actually enqueued on the event device. The > + * return value can be less than the value of the *nb_events* parameter when > + * the event devices queue is full or if invalid parameters are specified in a > + * *rte_event*. If the return value is less than *nb_events*, the remaining > + * events at the end of ev[] are not consumed and the caller has to take care > + * of them, and rte_errno is set accordingly. Possible errno values include: > + * - -EINVAL The port ID is invalid, device ID is invalid, an event's queue > + * ID is invalid, or an event's sched type doesn't match the > + * capabilities of the destination queue. > + * - -ENOSPC The event port was backpressured and unable to enqueue > + * one or more events. This error code is only applicable to > + * closed systems. > + */ > +static inline uint16_t __rte_experimental > +rte_event_eth_tx_adapter_enqueue(uint8_t id, uint8_t dev_id, > + uint8_t port_id, > + struct rte_event ev[], > + uint16_t nb_events) > +{ > + const struct rte_eventdev *dev = &rte_eventdevs[dev_id]; > + > + return __rte_event_eth_tx_adapter_enqueue(id, dev_id, port_id, ev, > + nb_events, > + dev->txa_enqueue); As per above, Since the function call logic is simplified you can add the above function logic here. > +} > + > index dabb12d..ab23503 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -388,6 +388,11 @@ F: lib/librte_eventdev/*crypto_adapter* > F: test/test/test_event_crypto_adapter.c > F: doc/guides/prog_guide/event_crypto_adapter.rst > > +Eventdev Ethdev Tx Adapter API - EXPERIMENTAL > +M: Nikhil Rao > +T: git://dpdk.org/next/dpdk-next-eventdev > +F: lib/librte_eventdev/*eth_tx_adapter* Add the testcase also. Overall it looks good. No more comments on specification. > + > Raw device API - EXPERIMENTAL > M: Shreyansh Jain > M: Hemant Agrawal > -- > 1.8.3.1 >