DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Van Haaren, Harry" <harry.van.haaren@intel.com>
To: "Eads, Gage" <gage.eads@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "jerin.jacob@caviumnetworks.com" <jerin.jacob@caviumnetworks.com>,
	"Richardson, Bruce" <bruce.richardson@intel.com>,
	"hemant.agrawal@nxp.com" <hemant.agrawal@nxp.com>,
	"nipun.gupta@nxp.com" <nipun.gupta@nxp.com>,
	"santosh.shukla@caviumnetworks.com"
	<santosh.shukla@caviumnetworks.com>,
	"pbhagavatula@caviumnetworks.com"
	<pbhagavatula@caviumnetworks.com>
Subject: Re: [dpdk-dev] [PATCH 2/2] event/sw: use dynamically-sized IQs
Date: Thu, 7 Dec 2017 17:15:35 +0000	[thread overview]
Message-ID: <E923DB57A917B54B9182A2E928D00FA650FDEC43@IRSMSX102.ger.corp.intel.com> (raw)
In-Reply-To: <1512011314-19682-2-git-send-email-gage.eads@intel.com>

> From: Eads, Gage
> Sent: Thursday, November 30, 2017 3:09 AM
> To: dev@dpdk.org
> Cc: jerin.jacob@caviumnetworks.com; Van Haaren, Harry
> <harry.van.haaren@intel.com>; Richardson, Bruce
> <bruce.richardson@intel.com>; hemant.agrawal@nxp.com; nipun.gupta@nxp.com;
> santosh.shukla@caviumnetworks.com; pbhagavatula@caviumnetworks.com
> Subject: [PATCH 2/2] event/sw: use dynamically-sized IQs
> 
> This commit introduces dynamically-sized IQs, by switching the underlying
> data structure from a fixed-size ring to a linked list of queue 'chunks.'
> This has a number of benefits:
> - Certain corner cases were observed in which all of a pipeline's flows
>   could be pinned to one port for extended periods, effectively turning a
>   multi-core pipeline into single-core one. This was caused by an event
>   producer having a larger new_event_threshold than the IQ depth, and
>   injecting large numbers of packets that are ultimately backpressured in a
>   worker's rx_ring, causing those packets' flows to be scheduled to that
>   port.
>   The dynamically sized IQ does not have this problem because each IQ can
>   grow large enough to store all the system's events, such that
>   backpressure will not reach the worker_ring.
> - Slight performance improvement (~1-2%) in high throughput scenarios,
>   tested with eventdev_pipeline_sw_pmd.
> 
> This implementation has a small increase in the queue storage memory
> footprint (~70KB). This commit also removes the iq_size xstat, which no
> longer applies to this implementation.
> 
> Signed-off-by: Gage Eads <gage.eads@intel.com>

Some review notes below - but nothing that needs changing.

Acked-by: Harry van Haaren <harry.van.haaren@intel.com>


> diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c
<snip>

> -	for (i = 0; i < SW_IQS_MAX; i++) {
> -		snprintf(buf, sizeof(buf), "q_%u_iq_%d", idx, i);
> -		qid->iq[i] = iq_ring_create(buf, socket_id);
> -		if (!qid->iq[i]) {
> -			SW_LOG_DBG("ring create failed");
> -			goto cleanup;
> -		}
> -	}
> +	for (i = 0; i < SW_IQS_MAX; i++)
> +		iq_init(sw, &qid->iq[i]);

Review notes;
- It looks like error checking is being lost above, but in reality the iq_init() cannot fail in this new scheme, provided that the pool of chunks is provisioned correctly at configure() time (see provisioning below).

No action required here - just noting this error-checking change.


> +	/* Number of chunks sized for worst-case spread of events across IQs */
> +	num_chunks = ((SW_INFLIGHT_EVENTS_TOTAL/SW_EVS_PER_Q_CHUNK)+1) +
> +			sw->qid_count*SW_IQS_MAX*2;

To verify the logic here;

((TOTAL / CHUNK_SIZE) + 1) is the main body of chunks.
QID * IQ * 2 is there so each QID can hold a chunk, and a next pointer, for each priority of IQ.

add these two together, is the total number of chunks. Check :)

  reply	other threads:[~2017-12-07 17:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-30  3:08 [dpdk-dev] [PATCH 1/2] event/sw: fix queue memory leak and multi-link bug Gage Eads
2017-11-30  3:08 ` [dpdk-dev] [PATCH 2/2] event/sw: use dynamically-sized IQs Gage Eads
2017-12-07 17:15   ` Van Haaren, Harry [this message]
2017-12-09  9:26     ` Jerin Jacob
2018-01-08 15:32   ` Pavan Nikhilesh
2018-01-08 15:50     ` Van Haaren, Harry
2018-01-08 16:05       ` Pavan Nikhilesh
2018-01-08 18:36         ` Eads, Gage
2018-01-09  7:12           ` Pavan Nikhilesh
2017-12-07 17:15 ` [dpdk-dev] [PATCH 1/2] event/sw: fix queue memory leak and multi-link bug Van Haaren, Harry
2017-12-09  9:26   ` Jerin Jacob

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=E923DB57A917B54B9182A2E928D00FA650FDEC43@IRSMSX102.ger.corp.intel.com \
    --to=harry.van.haaren@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=gage.eads@intel.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=jerin.jacob@caviumnetworks.com \
    --cc=nipun.gupta@nxp.com \
    --cc=pbhagavatula@caviumnetworks.com \
    --cc=santosh.shukla@caviumnetworks.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).