DPDK-dev Archive on lore.kernel.org
 help / color / Atom feed
From: Sunil Kumar Kori <skori@marvell.com>
To: Anoob Joseph <anoobj@marvell.com>,
	Jerin Jacob Kollanukkaran <jerinj@marvell.com>,
	Nikhil Rao <nikhil.rao@intel.com>,
	"Erik Gabriel Carrillo" <erik.g.carrillo@intel.com>,
	Abhinandan Gujjar <abhinandan.gujjar@intel.com>,
	Bruce Richardson <bruce.richardson@intel.com>,
	Pablo de Lara <pablo.de.lara.guarch@intel.com>
Cc: "Narayana Prasad Raju Athreya" <pathreya@marvell.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	"Lukas Bartosik" <lbartosik@marvell.com>,
	"Pavan Nikhilesh Bhagavatula" <pbhagavatula@marvell.com>,
	"Hemant Agrawal" <hemant.agrawal@nxp.com>,
	"Nipun Gupta" <nipun.gupta@nxp.com>,
	"Harry van Haaren" <harry.van.haaren@intel.com>,
	"Mattias Rönnblom" <mattias.ronnblom@ericsson.com>,
	"Liang Ma" <liang.j.ma@intel.com>,
	"Anoob Joseph" <anoobj@marvell.com>
Subject: Re: [dpdk-dev] [EXT] [PATCH 26/39] eventdev: add default conf for event devs	field in conf
Date: Tue, 11 Jun 2019 08:58:25 +0000
Message-ID: <BN8PR18MB269138FA30AFD79C3AE4AB51B4ED0@BN8PR18MB2691.namprd18.prod.outlook.com> (raw)
In-Reply-To: <1559580584-5728-27-git-send-email-anoobj@marvell.com>



Regards
Sunil Kumar Kori

>-----Original Message-----
>From: dev <dev-bounces@dpdk.org> On Behalf Of Anoob Joseph
>Sent: Monday, June 3, 2019 10:20 PM
>To: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Nikhil Rao
><nikhil.rao@intel.com>; Erik Gabriel Carrillo <erik.g.carrillo@intel.com>;
>Abhinandan Gujjar <abhinandan.gujjar@intel.com>; Bruce Richardson
><bruce.richardson@intel.com>; Pablo de Lara
><pablo.de.lara.guarch@intel.com>
>Cc: Narayana Prasad Raju Athreya <pathreya@marvell.com>; dev@dpdk.org;
>Lukas Bartosik <lbartosik@marvell.com>; Pavan Nikhilesh Bhagavatula
><pbhagavatula@marvell.com>; Hemant Agrawal
><hemant.agrawal@nxp.com>; Nipun Gupta <nipun.gupta@nxp.com>; Harry
>van Haaren <harry.van.haaren@intel.com>; Mattias Rönnblom
><mattias.ronnblom@ericsson.com>; Liang Ma <liang.j.ma@intel.com>; Anoob
>Joseph <anoobj@marvell.com>
>Subject: [EXT] [dpdk-dev] [PATCH 26/39] eventdev: add default conf for event
>devs field in conf
>
>External Email
>
>----------------------------------------------------------------------
>Generate a default conf for event devs, if it's not specified in the conf. This
>routine will check the available event devices and it's properties and sets the
>conf accordingly.
>
>Signed-off-by: Anoob Joseph <anoobj@marvell.com>
>Signed-off-by: Lukasz Bartosik <lbartosik@marvell.com>
>---
> lib/librte_eventdev/rte_eventmode_helper.c | 67
>++++++++++++++++++++++++++++++
> 1 file changed, 67 insertions(+)
>
>diff --git a/lib/librte_eventdev/rte_eventmode_helper.c
>b/lib/librte_eventdev/rte_eventmode_helper.c
>index 4dbb94a..1729561 100644
>--- a/lib/librte_eventdev/rte_eventmode_helper.c
>+++ b/lib/librte_eventdev/rte_eventmode_helper.c
>@@ -179,6 +179,63 @@ rte_eventmode_validate_user_params(struct
>eventmode_conf *em_conf)  }
>
> static int
>+rte_eventmode_helper_set_default_conf_eventdev(struct eventmode_conf
>+*em_conf) {
>+	int i, ret;
>+	int nb_eventdev;
>+	struct eventdev_params *eventdev_config;
>+	struct rte_event_dev_info dev_info;
>+
>+	/* Get the number of event devices */
>+	nb_eventdev = rte_event_dev_count();
>+
>+	if (nb_eventdev == 0) {
>+		RTE_EM_HLPR_LOG_ERR("No event devices detected");
>+		return -1;
>+	}
>+
>+	for (i = 0; i < nb_eventdev; i++) {
>+
>+		/* Get the event dev conf */
>+		eventdev_config = &(em_conf->eventdev_config[i]);
>+
>+		/* Read event device info */
>+		ret = rte_event_dev_info_get(i, &dev_info);
>+
>+		if (ret < 0) {
>+			RTE_EM_HLPR_LOG_ERR(
>+				"Failed reading event device info (err:%d)",
>+				ret);
>+			return ret;
>+		}
>+
>+		/* Check if enough ports are available */
>+		if (dev_info.max_event_ports < 2) {
>+			RTE_EM_HLPR_LOG_ERR("Not enough ports
>available");
"Not Enough event ports available" instead of "Not enough ports available". Otherwise it looks confusing with eth ports.

>+			return -1;
>+		}
>+
>+		/* Save number of queues & ports available */
>+		eventdev_config->eventdev_id = i;
>+		eventdev_config->nb_eventqueue =
>dev_info.max_event_queues;
>+		eventdev_config->nb_eventport = dev_info.max_event_ports;
>+		eventdev_config->ev_queue_mode =
>+				RTE_EVENT_QUEUE_CFG_SINGLE_LINK;
>+
>+		/* One port is required for eth Rx adapter */
>+		eventdev_config->nb_eventport -= 1;
>+
>+		/* One port is reserved for eth Tx adapter */
>+		eventdev_config->nb_eventport -= 1;
>+
>+		/* Update the number of eventdevs */
>+		em_conf->nb_eventdev++;
>+	}
>+
>+	return 0;
>+}
>+
>+static int
> rte_eventmode_helper_validate_conf(struct eventmode_conf *em_conf)  {
> 	int ret;
>@@ -188,6 +245,16 @@ rte_eventmode_helper_validate_conf(struct
>eventmode_conf *em_conf)
> 	if (ret != 0)
> 		return ret;
>
>+	/*
>+	 * See if event devs are specified. Else probe the event devices
>+	 * and initialize the conf with all ports & queues available
>+	 */
>+	if (em_conf->nb_eventdev == 0) {
>+		ret =
>rte_eventmode_helper_set_default_conf_eventdev(em_conf);
>+		if (ret != 0)
>+			return ret;
>+	}
>+
> 	return 0;
> }
>
>--
>2.7.4


  reply index

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1559580584-5728-1-git-send-email-anoobj@marvell.com>
2019-06-03 16:49 ` [dpdk-dev] [PATCH 03/39] examples/l2fwd-event: move structures to common header Anoob Joseph
2019-06-03 16:49 ` [dpdk-dev] [PATCH 04/39] examples/l2fwd-event: move global vars " Anoob Joseph
2019-06-03 16:49 ` [dpdk-dev] [PATCH 05/39] examples/l2fwd-event: move dataplane code to new file Anoob Joseph
2019-06-03 16:49 ` [dpdk-dev] [PATCH 06/39] examples/l2fwd-event: remove unused header includes Anoob Joseph
2019-06-03 16:49 ` [dpdk-dev] [PATCH 07/39] examples/l2fwd-event: move drain buffers to new function Anoob Joseph
2019-06-03 16:49 ` [dpdk-dev] [PATCH 08/39] examples/l2fwd-event: optimize check for master core Anoob Joseph
2019-06-03 16:49 ` [dpdk-dev] [PATCH 09/39] examples/l2fwd-event: move periodic tasks to new func Anoob Joseph
2019-06-03 16:49 ` [dpdk-dev] [PATCH 10/39] examples/l2fwd-event: do timer updates only on master Anoob Joseph
2019-06-03 16:49 ` [dpdk-dev] [PATCH 11/39] examples/l2fwd-event: move pkt send code to a new func Anoob Joseph
2019-06-03 16:49 ` [dpdk-dev] [PATCH 12/39] examples/l2fwd-event: use fprintf in usage print Anoob Joseph
2019-06-03 16:49 ` [dpdk-dev] [PATCH 13/39] examples/l2fwd-event: improvements to the " Anoob Joseph
2019-06-03 16:49 ` [dpdk-dev] [PATCH 14/39] eventdev: add files for eventmode helper Anoob Joseph
2019-06-03 16:49 ` [dpdk-dev] [PATCH 15/39] eventdev: add routines for logging " Anoob Joseph
2019-06-03 16:49 ` [dpdk-dev] [PATCH 16/39] eventdev: add eventmode CL options framework Anoob Joseph
2019-06-03 16:49 ` [dpdk-dev] [PATCH 17/39] eventdev: allow application to set ethernet portmask Anoob Joseph
2019-06-03 16:49 ` [dpdk-dev] [PATCH 18/39] eventdev: add framework for eventmode conf Anoob Joseph
2019-06-03 16:49 ` [dpdk-dev] [PATCH 19/39] eventdev: add common initialize routine for eventmode devs Anoob Joseph
2019-06-03 16:49 ` [dpdk-dev] [PATCH 20/39] eventdev: add eventdevice init for eventmode Anoob Joseph
2019-06-03 16:49 ` [dpdk-dev] [PATCH 21/39] eventdev: add eventdev port-lcore link Anoob Joseph
2019-06-03 16:49 ` [dpdk-dev] [PATCH 22/39] eventdev: add option to specify schedule mode for app stage Anoob Joseph
2019-06-03 16:49 ` [dpdk-dev] [PATCH 23/39] eventdev: add placeholder for ethdev init Anoob Joseph
2019-06-03 16:49 ` [dpdk-dev] [PATCH 24/39] eventdev: add Rx adapter init in eventmode Anoob Joseph
2019-06-11  8:58   ` [dpdk-dev] [EXT] " Sunil Kumar Kori
2019-06-03 16:49 ` [dpdk-dev] [PATCH 25/39] eventdev: add routine to validate conf Anoob Joseph
2019-06-03 16:49 ` [dpdk-dev] [PATCH 26/39] eventdev: add default conf for event devs field in conf Anoob Joseph
2019-06-11  8:58   ` Sunil Kumar Kori [this message]
2019-06-03 16:49 ` [dpdk-dev] [PATCH 27/39] eventdev: add default conf for Rx adapter conf Anoob Joseph
2019-06-03 16:49 ` [dpdk-dev] [PATCH 28/39] eventdev: add default conf for event port-lcore link Anoob Joseph
2019-06-03 16:49 ` [dpdk-dev] [PATCH 29/39] eventdev: add routines to display the eventmode conf Anoob Joseph
2019-06-03 16:49 ` [dpdk-dev] [PATCH 30/39] eventdev: add routine to access eventmode link info Anoob Joseph
2019-06-03 16:49 ` [dpdk-dev] [PATCH 31/39] eventdev: add routine to access event queue for eth Tx Anoob Joseph
2019-06-03 16:49 ` [dpdk-dev] [PATCH 32/39] eventdev: add routine to launch eventmode workers Anoob Joseph
2019-06-03 16:49 ` [dpdk-dev] [PATCH 33/39] eventdev: add Tx adapter support Anoob Joseph
2019-06-03 16:49 ` [dpdk-dev] [PATCH 34/39] eventdev: add support for internal ports Anoob Joseph
2019-06-03 16:49 ` [dpdk-dev] [PATCH 35/39] eventdev: display Tx adapter conf Anoob Joseph
2019-06-03 16:49 ` [dpdk-dev] [PATCH 36/39] examples/l2fwd-event: add eventmode for l2fwd Anoob Joseph
2019-06-03 16:49 ` [dpdk-dev] [PATCH 37/39] examples/l2fwd-event: add eventmode worker Anoob Joseph
2019-06-03 16:49 ` [dpdk-dev] [PATCH 38/39] " Anoob Joseph
2019-06-03 16:49 ` [dpdk-dev] [PATCH 39/39] " Anoob Joseph

Reply instructions:

You may reply publically 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=BN8PR18MB269138FA30AFD79C3AE4AB51B4ED0@BN8PR18MB2691.namprd18.prod.outlook.com \
    --to=skori@marvell.com \
    --cc=abhinandan.gujjar@intel.com \
    --cc=anoobj@marvell.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=erik.g.carrillo@intel.com \
    --cc=harry.van.haaren@intel.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=jerinj@marvell.com \
    --cc=lbartosik@marvell.com \
    --cc=liang.j.ma@intel.com \
    --cc=mattias.ronnblom@ericsson.com \
    --cc=nikhil.rao@intel.com \
    --cc=nipun.gupta@nxp.com \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=pathreya@marvell.com \
    --cc=pbhagavatula@marvell.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

DPDK-dev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dpdk-dev/0 dpdk-dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dpdk-dev dpdk-dev/ https://lore.kernel.org/dpdk-dev \
		dev@dpdk.org dpdk-dev@archiver.kernel.org
	public-inbox-index dpdk-dev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox