From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavan Nikhilesh Bhagavatula Subject: Re: [PATCH v5 6/7] eventdev: add eth Rx adapter implementation Date: Fri, 6 Oct 2017 20:04:23 +0530 Message-ID: <20171006143421.GA12102@PBHAGAVATULA-LT> References: <1507324201-3517-1-git-send-email-nikhil.rao@intel.com> <1507324201-3517-7-git-send-email-nikhil.rao@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org To: Nikhil Rao Return-path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0064.outbound.protection.outlook.com [104.47.42.64]) by dpdk.org (Postfix) with ESMTP id BACF11B1E6 for ; Fri, 6 Oct 2017 16:34:52 +0200 (CEST) Content-Disposition: inline In-Reply-To: <1507324201-3517-7-git-send-email-nikhil.rao@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Nikhil, I have verified the series with octeontx hw and found few issues mentioned below, I will send the hw driver in a while. On Sat, Oct 07, 2017 at 02:40:00AM +0530, Nikhil Rao wrote: > The adapter implementation uses eventdev PMDs to configure the packet > transfer if HW support is available and if not, it uses an EAL service > function that reads packets from ethernet Rx queues and injects these > as events into the event device. > > Signed-off-by: Gage Eads > Signed-off-by: Abhinandan Gujjar > Signed-off-by: Nikhil Rao > --- > lib/librte_eventdev/rte_event_eth_rx_adapter.c | 1237 ++++++++++++++++++++++++ > lib/Makefile | 2 +- > lib/librte_eventdev/Makefile | 1 + > lib/librte_eventdev/rte_eventdev_version.map | 9 + > 4 files changed, 1248 insertions(+), 1 deletion(-) > create mode 100644 lib/librte_eventdev/rte_event_eth_rx_adapter.c > > diff --git a/lib/librte_eventdev/rte_event_eth_rx_adapter.c b/lib/librte_eventdev/rte_event_eth_rx_adapter.c > new file mode 100644 > index 000000000..0823aee16 > --- /dev/null > +++ b/lib/librte_eventdev/rte_event_eth_rx_adapter.c > @@ -0,0 +1,1237 @@ > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include "rte_eventdev.h" > +#include "rte_eventdev_pmd.h" > +#include "rte_event_eth_rx_adapter.h" > + > +#define BATCH_SIZE 32 > +#define BLOCK_CNT_THRESHOLD 10 > +#define ETH_EVENT_BUFFER_SIZE (4*BATCH_SIZE) > + > +#define ETH_RX_ADAPTER_SERVICE_NAME_LEN 32 > +#define ETH_RX_ADAPTER_MEM_NAME_LEN 32 > + > +/* > + * There is an instance of this struct per polled Rx queue added to the > + * adapter > + */ > +struct eth_rx_poll_entry { > + /* Eth port to poll */ > + uint8_t eth_dev_id; > + /* Eth rx queue to poll */ > + uint16_t eth_rx_qid; > +}; > + > +/* Instance per adapter */ > +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_eth_rx_adapter { > + /* RSS key */ > + uint8_t rss_key_be[40]; Use #define or compile time config parameter instead of hardcoding to 40 > + /* Event device identifier */ > + uint8_t eventdev_id; > + /* Per ethernet device structure */ > + struct eth_device_info *eth_devices; > + /* Event port identifier */ > + uint8_t event_port_id; > + /* Lock to serialize config updates with service function */ > + rte_spinlock_t rx_lock; > + /* Max mbufs processed in any service function invocation */ > + uint32_t max_nb_rx; > + /* Receive queues that need to be polled */ > + struct eth_rx_poll_entry *eth_rx_poll; > + > +static int add_rx_queue(struct rte_event_eth_rx_adapter *rx_adapter, > + uint8_t eth_dev_id, > + int rx_queue_id, > + const struct rte_event_eth_rx_adapter_queue_conf *queue_conf) > +{ > + struct eth_device_info *dev_info = &rx_adapter->eth_devices[eth_dev_id]; > + uint32_t i; > + int ret; > + > + if (queue_conf->servicing_weight == 0) { > + struct rte_event_eth_rx_adapter_queue_conf temp_conf; temp_conf should be declared outside if condition, It goes out of scope and the assignment queue_conf = &temp_conf; would become undefined. > + > + struct rte_eth_dev_data *data = dev_info->dev->data; > + if (data->dev_conf.intr_conf.rxq) { > + RTE_EDEV_LOG_ERR("Interrupt driven queues" > + " not supported"); > + return -ENOTSUP; > + } > + temp_conf = *queue_conf; > + temp_conf.servicing_weight = 1; > + /* If Rx interrupts are disabled set wt = 1 */ > + queue_conf = &temp_conf; > + } > + > + if (dev_info->rx_queue == NULL) { Thanks, Pavan