From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0067.outbound.protection.outlook.com [104.47.32.67]) by dpdk.org (Postfix) with ESMTP id BAFB71B2F4 for ; Sat, 21 Oct 2017 17:56:24 +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; bh=xU1IPl2zgyrha1jgAprCtOUcnw6T6IFB3m6d9wIABb4=; b=MCoiM67fhw+olR9Q/cpR0Ola1ZXh+mSl1urLzgPSEXM9++5qXzrheezw2OLqFX+WBpoJ9h0z40zy8q1fBE1xl6HM1jRTEDVi3CuXR4iFiS8/eS90CHkco29joy4cz8MiVQYC1lOk4Y7k0qsR1RmVohfHxhUWqwE3FCJkYnc8yVk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin (171.76.118.225) by CO2PR07MB2520.namprd07.prod.outlook.com (10.166.201.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Sat, 21 Oct 2017 15:56:20 +0000 Date: Sat, 21 Oct 2017 21:26:01 +0530 From: Jerin Jacob To: Nikhil Rao Cc: dev@dpdk.org, john.mcnamara@intel.com Message-ID: <20171021155600.GA10328@jerin> References: <1508318141-11256-1-git-send-email-nikhil.rao@intel.com> <1508320690-12047-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: <1508320690-12047-1-git-send-email-nikhil.rao@intel.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-Originating-IP: [171.76.118.225] X-ClientProxiedBy: PN1PR01CA0111.INDPRD01.PROD.OUTLOOK.COM (10.174.144.27) To CO2PR07MB2520.namprd07.prod.outlook.com (10.166.201.7) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 59f346c6-4a68-47cd-8947-08d5189c46a4 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199); SRVR:CO2PR07MB2520; X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2520; 3:L2ACuUbOzCMSPXzjQ0pFApp0gQhEYWGDPAZ6sP2oWZO4jOrThQAi5dAzMooHUQlnDNHWD5sohbyldm5lrMEP8t6tzRv/xFhBkjd20q6WmKYXWgPmdAveMQCLQD1m8eWQ7/hy26QkoZe6Va22Qz3pkgBzk3Cr7NKgVmHoX5Fd8ahL4CazVgewp7tkfaK36y+YTMGk0dAxEVkF4AwlqRgIovXHmvxfMeKSPAqRwdqqRze49UzDDBd1uF2VoI4pLX36; 25:wm9nHQX7JOmagA+vrwQBUlT4rvz1Zkphmdz0nfFMKsJc90U862/98HZNTZ9o5E8ULwH9+Wji8NVus8VpefP2f3cNcC72S0XcY8NVRr/bw04eeK3IABTCTEbYimYzQNMebZKB7D9X/0+DAo27GqHjEjaaGK/6y/fiKlFwga7FXvgAEJ1e3k8GnTLAJmTOysaBuHLX+fMNkSi93KXTparyq6z5oO3dpZDEBl/DSiWC48bwkoDtJ+OivAw4V/e0zw8DBfil6hQ0CFvf9jSW8cZ692xODNChBKsJBpHLj9hI6tbXMkotZlHIQGYY5bVfsDYTRZ2yR4gWjTHaBna/nhQFXg==; 31:zH3NH2C0+wfHKJWKwQa9YVyUdzVSwZ3/kZm8SbO04I7oGgTDZpHfVxcY+wG6+itcGSQGpmgIRR6vEQpVDS3FagGM1CnsOD0+y1xh0bSQJM26C4j37cj4d3UfDJI4oD2vwJmuPRTQ8/idK0vftvfLmhD3aB309XqBie1nWEIeq9lcysuNq1naG49mfvAUBGmTB3EedYIMzKe4Tfk1/NrVfntSKvCsgMI8CzwppaqzVH4= X-MS-TrafficTypeDiagnostic: CO2PR07MB2520: X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2520; 20:1gXz3NjhwC9OicwmrQbCLLMnA2bMRjo54cJNWYFlpPGpsLIQXLp4IJduoj8EoiKvhs6XEQrAiiexvBoedGFSs9DaWhemnGrSajuU4zU6tITS3c1DZw4pbteJ1PE/uRNjwU1HgVxfbNV3vi/oreOlLv8y8tiEVqU8s+juI2o5/XhueMk1mCqBfYTmBG63caMB29GIOa6m+TnBTQPF3lbKfq+d88muuO3IQz3bLUOoR9S59AA8o4aS+e0xuFW9Dbcr0X169tuWxJPzK/obF2FD+dUWWQJW6FeNHubdf4O75jIxuiA9+RHuuOX10OZYclJKPHJ6QA5dlyKTI7RzabR1+p1xzOYDs1u70+zwAS91yNyOJx7B530yp29xXWZEMDVlwe69Mzlj/i00y/8yzaN4+SEmnZVT47u1yKju24ybUGac8fMgpZP4lfq72ZQtK3djxV/7QrCeEMKJFjwTw67iJtrJQynnN64QPq1OutS4fkPO3mBmm1HG9snI9caIZIE/ORQh1vV/I24HvmG8Y/66oEq7EF02ZZKQOZgiDOUkZOcHPuJ6wGI7bsUT75Inj6eLNUuaQhXOEpncUkls51IzdHLm5o53+oxnahFUTTTHR7s=; 4:7mb1A0mCBAj2tJi/vfyrw2/AAj/bV7Zdn1ug3j/jlUljfapkfXMhUz5zCj3fYQXPT7ehxxEVarPRtiNx0NXBUI7A8Xn9f4bxrqbw5NzVxWB66Aswj/MbD9wvlvE9bkuLEvkKBOfClB+RRjuljFvbr5cFcWDYzp++ybNW4roxb25tlFLB0DgdhjlaMahBLisAv7f+XOFHCa9dEJAg/oGHbxFtnbuTq8pOnFn3MGMXnaod0l9722VJIofuz3Qbuq9phSD3WYjHWpdgAO56vxRebX7oqlfiYKpAlBRaj/gOryQ= X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(3002001)(93006095)(3231020)(10201501046)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CO2PR07MB2520; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CO2PR07MB2520; X-Forefront-PRVS: 046753C63C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(979002)(6009001)(346002)(376002)(13464003)(189002)(199003)(4326008)(6246003)(229853002)(66066001)(47776003)(33716001)(478600001)(6496005)(33656002)(189998001)(83506002)(97736004)(1076002)(3846002)(23726003)(6116002)(9686003)(25786009)(53936002)(55016002)(2906002)(68736007)(105586002)(7736002)(305945005)(50466002)(106356001)(50986999)(54356999)(76176999)(8936002)(5660300001)(8676002)(81166006)(2950100002)(81156014)(72206003)(6666003)(316002)(6916009)(58126008)(16586007)(101416001)(42882006)(16526018)(18370500001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR07MB2520; H:jerin; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR07MB2520; 23:neV7BEN1cvALiXSEQvNGr6K4N1fxD9MNUXsnvSkFR?= =?us-ascii?Q?fI83LBeSIV4G6k5tZ0XsVQh0wYqKvx0ZCP9bv1iM8SgC7o/pZS2wz3ejd+bN?= =?us-ascii?Q?FdViDHjUR7ehuCrtAmkIPp1Dr0SIDbh5zSLgn/f7pRk6FLu0bLltKrE63cZh?= =?us-ascii?Q?zRwXfQhX0VeLtc3WZncZ+W6PoyiwsaxRJtyY+a5n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Lg982jXREhJF3e8IgqkfaSs5gHBoZjXzDNW1uxXSysTeX4xOt2Gpi70U7ZnhXFINUZwbeS49FnY90bWcetWcUQJCXllkA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2017 15:56:20.6946 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR07MB2520 Subject: Re: [dpdk-dev] [PATCH v2] doc: add event eth Rx adapter programmer's guide 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: Sat, 21 Oct 2017 15:56:25 -0000 -----Original Message----- > Date: Wed, 18 Oct 2017 15:28:10 +0530 > From: Nikhil Rao > To: jerin.jacob@caviumnetworks.com > CC: dev@dpdk.org > Subject: [PATCH v2] doc: add event eth Rx adapter programmer's guide > X-Mailer: git-send-email 2.7.4 > > Add programmer's guide doc to explain the use of the > Event Ethernet Rx Adapter library. > > Signed-off-by: Nikhil Rao CC: John McNamara > --- > v2: Update MAINTAINERS > > + > +Event Ethernet Rx Adapter Library > +================================= > + > +The DPDK Eventdev API allows the application to use an event driven programming > +model for packet processing. In this model, the application polls an event device > +port for receiving events that reference packets instead of polling Rx queues of > +ethdev ports. Packet transfer between ethdev and the event device can be > +supported in hardware or require a software thread to receive packets from the > +ethdev port using ethdev poll mode APIs and enqueue these as events to the event > +device using the eventdev API. Both transfer mechanisms may be present on the same > +platform depending on the particular combination of the ethdev and the event device. > + > +The Event Ethernet Rx Adapter library is intended for the application code to configure > +both transfer mechanisms using a common API. through event device capabilities(or something similar text) > + > +API Walk-through > +---------------- > + > +This section will introduce the reader to the adapter API. The > +application has to first instantiate an adapter which is associated with > +a single eventdev, next the adapter instance is configured with Rx queues > +that are either polled by a SW thread or linked using hardware support. Finally > +the adapter is started. > + > +For SW based packet transfers from ethdev to eventdev, the the adapter uses a > +DPDK service function and the application is also required to assign a core to the > +service function. > + > +Creating an Adapter Instance > +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > + > +An adapter instance is created using rte_event_eth_rx_adapter_create(). This > +function is passed the event device to be associated with the adapter and port > +configuration for the adapter to setup an event port if the adapter needs to use > +a service function. > + > +.. code-block:: c > + > + int err; > + uint8_t dev_id; > + struct rte_event_dev_info dev_info; > + struct rte_event_port_conf rx_p_conf; > + > + err = rte_event_dev_info_get(id, &dev_info); > + > + rx_p_conf.new_event_threshold = dev_info.max_num_events; > + rx_p_conf.dequeue_depth = dev_info.max_event_port_dequeue_depth; > + rx_p_conf.enqueue_depth = dev_info.max_event_port_enqueue_depth; > + err = rte_event_eth_rx_adapter_create(id, dev_id, &rx_p_conf); > + > +If the application desires to have finer control of eventdev port allocation and > +setup, it can use the rte_event_eth_rx_adapter_create_ext() function. The > +rte_event_eth_rx_adapter_create_ext() function is passed a callback function. > +The callback function is invoked if the adapter needs to use a 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. > + > +Querying Adapter Capabilties > +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ s/Capabilties/Capabilities > + > +The rte_event_eth_rx_adapter_caps_get() function allows > +the application to query the adapter capabilities for an eventdev and ethdev > +combination. For e.g, if the RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID is > +set, the application can override the adapter generated flow ID in the event > +using rx_queue_flags field in struct rte_event_eth_rx_adapter_queue_conf which > +is a passed as a parameter to the rte_event_eth_rx_adapter_queue_add() function. > + > +Adding Rx Queues to the Adapter Instance > +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > + > +Ethdev Rx queues are added to the instance using the > +rte_event_eth_rx_adapter_queue_add() function. Configuration for the Rx queue is > +passed in using a struct rte_event_eth_rx_adapter_queue_conf parameter. Event > +information for packets from this Rx queue is encoded in the ''ev'' field of > +struct rte_event_eth_rx_adapter_queue_conf. The servicing_weight member of > +the struct rte_event_eth_rx_adapter_queue_conf is the relative polling > +frequency of the Rx queue and is applicable when the adapter uses a service > +core function. > + > +.. code-block:: c > + > + err = rte_event_eth_rx_adapter_caps_get(dev_id, eth_dev_id, &cap); > + > + ev.queue_id = 0; > + ev.sched_type = RTE_SCHED_TYPE_ATOMIC; > + ev.priority = 0; > + > + queue_config.rx_queue_flags = 0; > + if (cap & RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID) { > + ev.flow_id = 1; > + queue_config.rx_queue_flags = > + RTE_EVENT_ETH_RX_ADAPTER_QUEUE_FLOW_ID_VALID; > + } IMO, In default configuration, we may not need to add "if (cap & RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID)". I guess we can add separate code section to describe the use of RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID or in general the use of capabilities in application. > + queue_config.ev = ev; > + queue_config.servicing_weight = 1; > + > + err = rte_event_eth_rx_adapter_queue_add(id, > + eth_dev_id, > + 0, &queue_config); > + With above changes: Acked-by: Jerin Jacob