DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pavan Nikhilesh Bhagavatula <pbhagavatula@caviumnetworks.com>
To: Nikhil Rao <nikhil.rao@intel.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v5 6/7] eventdev: add eth Rx adapter implementation
Date: Fri, 6 Oct 2017 20:04:23 +0530	[thread overview]
Message-ID: <20171006143421.GA12102@PBHAGAVATULA-LT> (raw)
In-Reply-To: <1507324201-3517-7-git-send-email-nikhil.rao@intel.com>

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 <gage.eads@intel.com>
> Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
> Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
> ---
>  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 <rte_cycles.h>
> +#include <rte_common.h>
> +#include <rte_dev.h>
> +#include <rte_errno.h>
> +#include <rte_ethdev.h>
> +#include <rte_log.h>
> +#include <rte_malloc.h>
> +#include <rte_service_component.h>
> +#include <rte_thash.h>
> +
> +#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;
> +

<snip>

> +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) {
<snip>

Thanks,
Pavan

  reply	other threads:[~2017-10-06 14:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-06 21:09 [dpdk-dev] [PATCH v5 0/7] eventdev: cover letter: eth Rx adapter Nikhil Rao
2017-10-06 21:09 ` [dpdk-dev] [PATCH v5 1/7] eventdev: add caps API and PMD callback for " Nikhil Rao
2017-10-09 12:03   ` Jerin Jacob
2017-10-06 21:09 ` [dpdk-dev] [PATCH v5 2/7] eventdev: add PMD callbacks " Nikhil Rao
2017-10-09 12:05   ` Jerin Jacob
2017-10-06 21:09 ` [dpdk-dev] [PATCH v5 3/7] eventdev: add eth Rx adapter caps function to SW PMD Nikhil Rao
2017-10-09 12:06   ` Jerin Jacob
2017-10-06 21:09 ` [dpdk-dev] [PATCH v5 4/7] eventdev: add eth Rx adapter API header Nikhil Rao
2017-10-09 12:27   ` Jerin Jacob
2017-10-06 21:09 ` [dpdk-dev] [PATCH v5 5/7] eventdev: add event type for eth rx adapter Nikhil Rao
2017-10-09 12:31   ` Jerin Jacob
2017-10-06 21:10 ` [dpdk-dev] [PATCH v5 6/7] eventdev: add eth Rx adapter implementation Nikhil Rao
2017-10-06 14:34   ` Pavan Nikhilesh Bhagavatula [this message]
2017-10-06 21:10 ` [dpdk-dev] [PATCH v5 7/7] eventdev: add tests for eth Rx adapter APIs Nikhil Rao
2017-10-09 12:33   ` Jerin Jacob
2017-10-09 12:42 ` [dpdk-dev] [PATCH v5 0/7] eventdev: cover letter: eth Rx adapter Jerin Jacob
2017-10-09 13:06   ` Nipun Gupta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171006143421.GA12102@PBHAGAVATULA-LT \
    --to=pbhagavatula@caviumnetworks.com \
    --cc=dev@dpdk.org \
    --cc=nikhil.rao@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).