From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C51EDA0512; Tue, 14 Jan 2020 20:21:04 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9D3091C0DB; Tue, 14 Jan 2020 20:21:03 +0100 (CET) Received: from mail-il1-f196.google.com (mail-il1-f196.google.com [209.85.166.196]) by dpdk.org (Postfix) with ESMTP id 0F9301C069; Tue, 14 Jan 2020 20:21:01 +0100 (CET) Received: by mail-il1-f196.google.com with SMTP id g12so12557847ild.2; Tue, 14 Jan 2020 11:21:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=h6R0fPv02qJWuMUQ6erAJG81xkZ0X7QOLhK3OIkscqw=; b=X8IHr/TO173b+lnxImhJLPvSqFUomD3kfNkN7+nrZ7P+m+B/lfUabJa2YeDes4ETDz D2XTOJi6Yq/WEVYL452E1ogk4KQtlZE3NgreJIECvxA7Q+ttMGKQ33AUUoz50HRDY9+5 yX08a7VlAvg/8FrhuQug49j2EDLGd1VrHvGcRScmmE/UoG3WPtUWVwr3BMC/4AqQ4nlD PNkfWs0II6dUQlhxWlLTFRZwmCmd3016u1Rb6/zKG78iW9Z2+uflk53dPZVGPRVDXmTV ZyN/Ghm0wjxhCXCR3BDon+mBotJaRmnGakBS2u6Ak4+xToRi02lF3pfrSx1rHiC9hHqZ jLqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=h6R0fPv02qJWuMUQ6erAJG81xkZ0X7QOLhK3OIkscqw=; b=lLUOR7NSVCE17IpCQSDF6t+3+qvbAevOp6ViJIpXRw7CXIKQuOchYMvycVRZqRtJrP 3fp7yJoEGmlqMbTEd4tVzy4QXOs9AJEk0emi1jVTDrFIsOF4NRGPTqQwI1UpXbcZ5lfF jVC+Amc8XjujmHqe/EzMMz5N1nacKXkwu8F3mqjKHvgDuodzUdh4ELo9HcKhhJoPdC/g 6o+Yr8MBmfW0jXxlQdwpxsKo47sA+AP/krWnKU16XhSzYfQvE6sbaonlpBFnUqmljM8U C3gPRvAEwy1ynUtgygSRf0hKHF320szWOoANj0ACNMNCZvvRGRmc+J2bsI3YJLkb75Lr Bv/g== X-Gm-Message-State: APjAAAU+LbIAh5eVmoWE4Xk60rQWvSi3YwhMnBP1QmKwtpoqPQYHKlgJ STZy8tlWQUWp76nOFnk7N3XWwwqS2HZb4vibGf0= X-Google-Smtp-Source: APXvYqy9bR33VTmwS/vPaES1m+MyTvb3wMvtMBnTtbRJqgbxp9mhBgytUsc/8tAEYnw/02jkibSQjJTJ1qyRckUUtvc= X-Received: by 2002:a92:5e46:: with SMTP id s67mr4913854ilb.162.1579029661138; Tue, 14 Jan 2020 11:21:01 -0800 (PST) MIME-Version: 1.0 References: <20191220142742.2077-1-pbhagavatula@marvell.com> In-Reply-To: <20191220142742.2077-1-pbhagavatula@marvell.com> From: Jerin Jacob Date: Wed, 15 Jan 2020 00:50:45 +0530 Message-ID: To: Pavan Nikhilesh Cc: Jerin Jacob , Marko Kovacevic , Ori Kam , Bruce Richardson , Radu Nicolau , Akhil Goyal , Tomasz Kantecki , Sunil Kumar Kori , dpdk-dev , dpdk stable Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH] examples/l2fwd-event: fix event device config 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, Dec 20, 2019 at 7:57 PM wrote: > > From: Pavan Nikhilesh > > Always enable implicit release since we don't support explicit release > in datapath. > Master lcore is used only for printing stats so don't allocate event > port for it. > Fix service launch for event device without distributed scheduling. > > Fixes: bcb6f841d42a ("examples/l2fwd-event: setup service core") > Cc: stable@dpdk.org > > Signed-off-by: Pavan Nikhilesh Applied to dpdk-next-eventdev/master. Thanks. > --- > examples/l2fwd-event/l2fwd_event.c | 2 +- > examples/l2fwd-event/l2fwd_event_generic.c | 9 ++++++--- > examples/l2fwd-event/l2fwd_event_internal_port.c | 11 +++++------ > 3 files changed, 12 insertions(+), 10 deletions(-) > > diff --git a/examples/l2fwd-event/l2fwd_event.c b/examples/l2fwd-event/l2fwd_event.c > index 0379c580d..38d590c14 100644 > --- a/examples/l2fwd-event/l2fwd_event.c > +++ b/examples/l2fwd-event/l2fwd_event.c > @@ -67,7 +67,7 @@ l2fwd_event_service_setup(struct l2fwd_resources *rsrc) > int ret, i; > > rte_event_dev_info_get(evt_rsrc->event_d_id, &evdev_info); > - if (evdev_info.event_dev_cap & RTE_EVENT_DEV_CAP_DISTRIBUTED_SCHED) { > + if (!(evdev_info.event_dev_cap & RTE_EVENT_DEV_CAP_DISTRIBUTED_SCHED)) { > ret = rte_event_dev_service_id_get(evt_rsrc->event_d_id, > &service_id); > if (ret != -ESRCH && ret != 0) > diff --git a/examples/l2fwd-event/l2fwd_event_generic.c b/examples/l2fwd-event/l2fwd_event_generic.c > index b7e467c1e..b07306a17 100644 > --- a/examples/l2fwd-event/l2fwd_event_generic.c > +++ b/examples/l2fwd-event/l2fwd_event_generic.c > @@ -42,8 +42,10 @@ l2fwd_event_device_setup_generic(struct l2fwd_resources *rsrc) > > /* Event device configurtion */ > rte_event_dev_info_get(event_d_id, &dev_info); > - evt_rsrc->disable_implicit_release = !!(dev_info.event_dev_cap & > - RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE); > + > + /* Enable implicit release */ > + if (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE) > + evt_rsrc->disable_implicit_release = 0; > > if (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES) > event_queue_cfg |= RTE_EVENT_QUEUE_CFG_ALL_TYPES; > @@ -70,7 +72,8 @@ l2fwd_event_device_setup_generic(struct l2fwd_resources *rsrc) > event_d_conf.nb_event_port_enqueue_depth = > dev_info.max_event_port_enqueue_depth; > > - num_workers = rte_lcore_count() - rte_service_lcore_count(); > + /* Ignore Master core and service cores. */ > + num_workers = rte_lcore_count() - 1 - rte_service_lcore_count(); > if (dev_info.max_event_ports < num_workers) > num_workers = dev_info.max_event_ports; > > diff --git a/examples/l2fwd-event/l2fwd_event_internal_port.c b/examples/l2fwd-event/l2fwd_event_internal_port.c > index b382763dd..5e6e8598a 100644 > --- a/examples/l2fwd-event/l2fwd_event_internal_port.c > +++ b/examples/l2fwd-event/l2fwd_event_internal_port.c > @@ -27,7 +27,6 @@ l2fwd_event_device_setup_internal_port(struct l2fwd_resources *rsrc) > .nb_event_port_enqueue_depth = 128 > }; > struct rte_event_dev_info dev_info; > - uint8_t disable_implicit_release; > const uint8_t event_d_id = 0; /* Always use first event device only */ > uint32_t event_queue_cfg = 0; > uint16_t ethdev_count = 0; > @@ -44,10 +43,9 @@ l2fwd_event_device_setup_internal_port(struct l2fwd_resources *rsrc) > /* Event device configurtion */ > rte_event_dev_info_get(event_d_id, &dev_info); > > - disable_implicit_release = !!(dev_info.event_dev_cap & > - RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE); > - evt_rsrc->disable_implicit_release = > - disable_implicit_release; > + /* Enable implicit release */ > + if (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE) > + evt_rsrc->disable_implicit_release = 0; > > if (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES) > event_queue_cfg |= RTE_EVENT_QUEUE_CFG_ALL_TYPES; > @@ -73,7 +71,8 @@ l2fwd_event_device_setup_internal_port(struct l2fwd_resources *rsrc) > event_d_conf.nb_event_port_enqueue_depth = > dev_info.max_event_port_enqueue_depth; > > - num_workers = rte_lcore_count(); > + /* Ignore Master core. */ > + num_workers = rte_lcore_count() - 1; > if (dev_info.max_event_ports < num_workers) > num_workers = dev_info.max_event_ports; > > -- > 2.17.1 >