From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM04-SN1-obe.outbound.protection.outlook.com (mail-eopbgr700071.outbound.protection.outlook.com [40.107.70.71]) by dpdk.org (Postfix) with ESMTP id 15E7C98 for ; Sun, 19 Aug 2018 12:19:40 +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=k+rfUWss3tCAKVEBNIsHKjHpe2i4bjAspfM2hLch7qI=; b=SDZTQCNacTDI3iqxk13oLa0JG7fQa5CPTqjhvWC93xlfWwF23oSEg1JuDvKpDc1p70POaNmwe4dFj7Na/tcMG6XIFZYaiLh/hixmZa6rTpY6VI/VPv3ZvTajjYSYXk0vbQka1brDb3tLHzXLgheVGZw9h+cnl4oLkpjClEeKKEs= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin (106.200.237.61) by DM6PR07MB5004.namprd07.prod.outlook.com (2603:10b6:5:25::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1059.21; Sun, 19 Aug 2018 10:19:36 +0000 Date: Sun, 19 Aug 2018 15:49:24 +0530 From: Jerin Jacob To: Nikhil Rao Cc: olivier.matz@6wind.com, dev@dpdk.org Message-ID: <20180819101923.GA11085@jerin> References: <1534479652-80182-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: <1534479652-80182-1-git-send-email-nikhil.rao@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Originating-IP: [106.200.237.61] X-ClientProxiedBy: SG2PR06CA0156.apcprd06.prod.outlook.com (2603:1096:1:1f::34) To DM6PR07MB5004.namprd07.prod.outlook.com (2603:10b6:5:25::25) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c1597e95-98b3-477f-5c8f-08d605bd44ef X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(5600074)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:DM6PR07MB5004; X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB5004; 3:xMICnWl/Lcn/i2L6Wvey97ygaS5FE6P34OKFD9yOlKm7L1AFsG/zkxCKGCnW3ypp5IUTWlTGPYVB2sfnpvMaOVrIglTMbMp6RzH2BMQvTWX2SGQGt722n+aXw3Lv7B7k6JC/Bb/6WEguxExqwxJ/mQjtvpYaAqLmoxUPDOhNh8eM5w7qNncSAkRq7IcpOurZZrfSicHTUx2E+/aqmqY/pDpsbMqsbNgiT1ngPP6/F17GagKOKCeKPiN6W6pmOiVP; 25:33qRPCaG3QP5WsoZUbmGzTu+mivWh96q6df6mzANM6gUKwHKIGqtI3K1pufSi8dlSAJuwhYzXn51EjYRHEgUo25xaZ/cWMywoGk+5nY1JzQzT5RU29KkUOLEwg66cKiCHLCMkCIb2CwbbE3up7cAU0CEbT6qy/0RvfcVGzsBdZyUeZaBw3gGaHHBUneQ7xIMyRGEt8zowzkG8qLeVBdyMdmYdTHydv7XNi1JyA63aCnhs0ExW/pWPFtxUxv8bifWRAR4zxGPQI7e37NiFF6T83ApgYrweRDwEcPpNfR7TE0OQ/sdeokwdOrhdZihCI/qUr39UsIWwDamJ962rHx8Yw==; 31:3OljgjKJS+7zYivkHdVLEAzL8/Yq1pnZro/WP4T+5aMhYcuQ5kIDoxAzrHRT+KRze9kYOJ9A/J1nmo6O1L6RpjYV1RJADvydOoLet22VP3lKoe58qtlbdnLmk9OoiIFBD5HkVgR1NoSA7v3xY2IX1qTIqCqMKMfvOQ1mJyh7qodsGm9U2/26TOWchotGIZ91re2NHXh5R1UV2CZXiLy+75YjDZMzE8H7A8LAVIr5GLQ= X-MS-TrafficTypeDiagnostic: DM6PR07MB5004: X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB5004; 20:ebbYF6Ll8L2qDIFNSxGX1xY+M8QJdL9q3riZFkIxzpXqXcaZGb1exKduOwztUVU1VI9b7zGABktkGkXgXROYVgQZeV0rBrOIe9TSWgO/L+jrgnr10y8db+qg21spkhrM+0Z856Oq1gRf+UckDAI3R8ydsJDA66kKe2J8HQzXbVeFJjVZJRgxOVAv4bzl0GW5nkZmKfA0kfXhJIJTnv5QpQ3XWUT3bNPvIh0clB9kEbJBkaBKDvSAoNnh9SXbXWvUYSeb5eb1I6hJRgodPm10NnBtQyq8bMMVLN6QUi/q9RBOP4rMlBlcBnSLRDUJ2rhyt3WpsB5eAMzBHnTNv/o7g+kkTHtYQ8EyfsBTSXLQbCv7mPt98OY1T5lxfIjnwQGdywTfP6rfN1aZSX0TvPpYKfBGeOoKa7WguzyET21plNntZtZdDBhuPHcKHTdT+BChc95IMhGD8VZJS5i0KCXXdse5W7EvDwR9lKLYhOhKriXb7sy6CXFX9WI1QSoH6GUBbPngtCn18u8b9U+7AUv+5USsZgWz1VJINsanKQZLj9/XtfCWyXBL4eNDHGaJ/jLP1p72n5Gfyl6yjlZxoybXcs5XcQCoiv9IGQ8n+9tf8sk=; 4:+MfYyuSj/TNQQvuUkF1ZX1JP1dgOkXF9zjOh8SiQ0NAErSCufWngLown0yjFG8gzbqhm/w/3mDUbj9t/NvcyYg94DzAMHCmoFJJTyC9ZqziZN7HG4E3SnyR4KdbUm8HZveg91LUbUpXcwayBHkLpRBRAnRmizp/ekxfxV5UQtPB0NSr2Vo8n/PNmMDa8o09LXg3wmEIxZqOEao3K6zs/va+yhaHUt0bESlnSv/ePRQSWXjsGyX8/0lmwKliiuq1xG0gieK6wpN4Bx+1jNmgzVnJNaLLsbIIq6JXwu2yPdvDNMrbgfp9VqYqnD6TPovc7 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231311)(944501410)(52105095)(10201501046)(93006095)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(201708071742011)(7699016); SRVR:DM6PR07MB5004; BCL:0; PCL:0; RULEID:; SRVR:DM6PR07MB5004; X-Forefront-PRVS: 07697999E6 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(136003)(346002)(366004)(396003)(376002)(199004)(13464003)(189003)(33896004)(33716001)(486006)(229853002)(9686003)(6116002)(11346002)(1076002)(3846002)(106356001)(23726003)(105586002)(316002)(478600001)(81166006)(81156014)(50466002)(8676002)(58126008)(55016002)(386003)(446003)(8936002)(42882007)(76176011)(53936002)(186003)(5009440100003)(956004)(68736007)(476003)(26005)(16526019)(66066001)(5660300001)(2906002)(6496006)(6246003)(33656002)(52116002)(47776003)(44832011)(16586007)(6666003)(97736004)(7736002)(72206003)(25786009)(6916009)(4326008)(14444005)(305945005)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR07MB5004; H:jerin; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM6PR07MB5004; 23:CyxByPiP/IxKyolQoTrWtiWODLDffoUUw/lRPw2ng?= =?us-ascii?Q?w/grXpSJD/2r+zEv7KsHcdvaYvDhb8/y//umxpDujM3iWVJf/E9WyNhSJpLz?= =?us-ascii?Q?/68AuH0rZXuw6ZErgQ562+VFYUTcDW+cJh3lxS6JFDy9YchFClSsC0mAC6ge?= =?us-ascii?Q?rXCjL+3HTn/m7TqZSH4bopZHu6yY4yj+BC4enGrT7sQ066uE981rWbaq0i1U?= =?us-ascii?Q?f8mwDx1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ZmUhf2pS/tltNSi11c+DYvT7rN27ET496HnCcJJ6YiLSZvlbh7N8Rysh8HunYmONxKpL8sYGt2/jjnP+FczO1QbI/C2ZJlU8kMSOHNMB5J5JBr32iL6BB/TE1e80wp0ahjEU+IyrFDSCNV/dHhx5d1ZIYcLXBc+cLOayxO/S9Qm7SqOHBTZyPw==; 5:p/hH65GQcS52/cB+Y/kehL4HjtLz/p6TkKgL4kzwtJ/T8nGU3U2paZ941GadGIkVJmHWvPIjY/u0/at55eonJWCorHZC4FBJyUxXokp0lHuOzlQFBfbxtRxUOd/oO6tt7pmC//OWS+NuK4e/jL7FKTe0gmlF8ddaThXci/8FCu4=; 7:2zTz1gXjgMvC0E2e+TsuRfuHZo/DQ/bd+y6n/uGP73PtmmHJvtdHnpcCgSnTAlUEqqdni98yHfHBeUXHbBTuZ99ReJq+dgQqoC/fJ06zDnoTtIdeJBsmfXQzaMFsbD9ptTaZZYzcXItggXktVE7hMwieamxs/fUR7LfUZPeqxphbDQ9g4mzPHpOSCP+TnbRK7KGgKOQtH0JXyEUmFhFJLGn9C9U3RaULTxPspfYgDwCb+9RaYDgImbX7mdaTS8x3 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Aug 2018 10:19:36.6297 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c1597e95-98b3-477f-5c8f-08d605bd44ef X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR07MB5004 Subject: Re: [dpdk-dev] [PATCH v2 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: Sun, 19 Aug 2018 10:19:40 -0000 -----Original Message----- > Date: Fri, 17 Aug 2018 09:50:49 +0530 > From: Nikhil Rao > To: jerin.jacob@caviumnetworks.com, olivier.matz@6wind.com > CC: dev@dpdk.org, Nikhil Rao > Subject: [PATCH v2 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. > > Signed-off-by: Nikhil Rao Overall it looks good to me. Could you please add programmers guide in the next revision? Some minor comments below. > --- > > +/** > + * @file > + * > + * RTE Event Ethernet Tx Adapter > + * > + * The event ethernet Tx adapter provides configuration and data path APIs > + * for the ethernet transmit stage of an event driven packet processing > + * application. These APIs abstract the implementation of the transmit stage > + * and allow the application to use eventdev PMD support or a common > + * implementation. > + * > + * In the common implementation, the application enqueues mbufs to the adapter > + * which runs as a rte_service function. The service function dequeues events > + * from its event port and transmits the mbufs referenced by these events. > + * > + * The ethernet Tx event adapter APIs are: > + * > + * - rte_event_eth_tx_adapter_create() > + * - rte_event_eth_tx_adapter_create_ext() > + * - rte_event_eth_tx_adapter_free() > + * - rte_event_eth_tx_adapter_start() > + * - rte_event_eth_tx_adapter_stop() > + * - rte_event_eth_tx_adapter_queue_add() > + * - rte_event_eth_tx_adapter_queue_del() > + * - rte_event_eth_tx_adapter_stats_get() > + * - rte_event_eth_tx_adapter_stats_reset() > + * - rte_event_eth_tx_adapter_enqueue() > + * - rte_event_eth_tx_adapter_event_port_get() > + * - rte_event_eth_tx_adapter_service_id_get() > + * > + * The application creates the adapter using > + * rte_event_eth_tx_adapter_create() or rte_event_eth_tx_adapter_create_ext(). > + * > + * The adapter will use the common implementation when the eventdev PMD > + * does not have the RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT capability. Due to some reason, the generated doxygen file, does not show RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT as hyperlink. > + * The common implementation uses an event port that is created using the port > + * configuration parameter passed to rte_event_eth_tx_adapter_create(). The > + * application can get the port identifier using > + * rte_event_eth_tx_adapter_event_port_get() and must link an event queue to > + * this port. > + * > + * If the eventdev PMD has the RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT > + * flags set, Tx adapter events should be enqueued using the > + * rte_event_eth_tx_adapter_enqueue() function, else the application should > + * use rte_event_enqueue_burst(). > + * > + * Transmit queues can be added and deleted from the adapter using > + * rte_event_eth_tx_adapter_queue_add()/del() APIs respectively. > + * > + * The application can start and stop the adapter using the > + * rte_event_eth_tx_adapter_start/stop() calls. > + * > + * The common adapter implementation uses an EAL service function as described > + * before and its execution is controlled using the rte_service APIs. The > + * rte_event_eth_tx_adapter_service_id_get() > + * function can be used to retrieve the adapter's service function ID. > + * > + * The ethernet port and transmit queue index to transmit the mbuf on are > + * specified using the mbuf port and the struct rte_event_tx_adapter_mbuf_queue > + * (overlaid on mbuf::hash). The application should use the > + * rte_event_eth_tx_adapter_txq_set() and rte_event_eth_tx_adapter_txq_get() > + * functions to access the transmit queue index since it is expected that the > + * transmit queue will be eventually defined within struct rte_mbuf and using > + * these macros will help with minimizing application impact due to > + * a change in how the transmit queue index is specified. > + */ > + > +#ifdef __cplusplus > +extern "C" { > +#endif > + > +#include > + > +#include > + > +#include "rte_eventdev.h" > + > + > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change without prior notice > + * > + * Set Tx queue in the mbuf. This queue is used by the adapter > + * to transmit the mbuf. > + * > + * @param pkt > + * Pointer to the mbuf. > + * @param queue > + * Tx queue index. > + */ > +static __rte_always_inline void __rte_experimental > +rte_event_eth_tx_adapter_txq_set(struct rte_mbuf *pkt, uint16_t queue) > +{ > + struct rte_event_tx_adapter_mbuf_queue *mbuf_queue = > + (struct rte_event_tx_adapter_mbuf_queue *)(&pkt->hash); It make sense to have inline function to set and get txq so that mbuf change wont have any visible impact. But, Can we get ride of struct rte_event_tx_adapter_mbuf_queue typecasting/indirection? I prefer to use just pkt->hi and add comment in rte_mbuf.h, see rte_event_eth_tx_adapter_txq_set() or add following without breaking anything on exiting scheme. +++ b/lib/librte_mbuf/rte_mbuf.h @@ -529,6 +529,11 @@ struct rte_mbuf { /**< First 4 flexible bytes or FD ID, dependent * on PKT_RX_FDIR_* flag in ol_flags. */ } fdir; /**< Filter identifier if FDIR enabled */ + struct { + uint32_t resvd1; + uint16_t resvd2; + uint16_t txq_id; + } txadapter; Reasons: 1) Additional indirection may result in additional instruction(s) in fastpath. 2) It is kind of hiding the mbuf usage on specific variable. So consumers may get confused on the usage and it may hide problem when mbuf gets changed as changes are not in one place. With above changes: Acked-by: Jerin Jacob