DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Dumitrescu, Cristian" <cristian.dumitrescu@intel.com>
To: "alangordondewar@gmail.com" <alangordondewar@gmail.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, Alan Dewar <alan.dewar@att.com>,
	"Kantecki, Tomasz" <tomasz.kantecki@intel.com>,
	"Singh, Jasvinder" <jasvinder.singh@intel.com>
Subject: Re: [dpdk-dev] [PATCH v5] sched: make RED scaling configurable
Date: Thu, 11 Jan 2018 13:11:05 +0000	[thread overview]
Message-ID: <3EB4FA525960D640B5BDFFD6A3D891267BAFB4EE@IRSMSX108.ger.corp.intel.com> (raw)
In-Reply-To: <1515425232-18888-1-git-send-email-alan.dewar@att.com>

Hi Alan,

More issues and questions below:

...<snip>

> diff --git a/lib/librte_sched/rte_red.c b/lib/librte_sched/rte_red.h
I suggest we use uint32_t for rte_red_scaling and rte_red_max_threshold, even though their values can fit into uint8_t and uint16_t respectively.


> diff --git a/lib/librte_sched/rte_red.c b/lib/librte_sched/rte_red.c
> +int
> +rte_red_set_scaling(uint16_t max_red_queue_length)
> +{
> +	int8_t count;
> +
> +	if (rte_red_init_done)
> +		/**
> +		 * Can't change the scaling once the red table has been
> +		 * computed.
> +		 */
> +		return -1;

Is there a reason why we cannot simply reset the scaling here?

> +
> +	if (max_red_queue_length < RTE_RED_MIN_QUEUE_LENGTH)
> +		return -2;
> +
> +	if (max_red_queue_length > RTE_RED_MAX_QUEUE_LENGTH)
> +		return -3;
> +
> +	if (!rte_is_power_of_2(max_red_queue_length))
> +		return -4;
> +
> +	count = 0;
> +	while (max_red_queue_length != 0) {
> +		max_red_queue_length >>= 1;
> +		count++;
> +	}

This does not look right to me. I think you want to compute the log2 of max_red_queue_length here, but your result (count) is bigger by 1 than it should be, right?
When max_red_queue_length = RTE_RED_DEFAULT_QUEUE_LENGTH = 1024, the result should be: count = RTE_RED_SCALING = 10, not 11.

I suggest you use rte_bsf32() function for this purpose.

> +
> +	rte_red_scaling -= count - RTE_RED_SCALING;

Why not simply: rte_red_scaling = count?

> +	rte_red_max_threshold = max_red_queue_length - 1;
> +	return 0;
> +}
> +

> diff --git a/lib/librte_sched/rte_sched_version.map
> b/lib/librte_sched/rte_sched_version.map
> index 3aa159a..262bece 100644
> --- a/lib/librte_sched/rte_sched_version.map
> +++ b/lib/librte_sched/rte_sched_version.map
> @@ -29,3 +29,10 @@ DPDK_2.1 {
>  	rte_sched_port_pkt_read_color;
> 
>  } DPDK_2.0;
> +
> +DPDK_17.08 {
> +	global;
> +
> +	__rte_red_reset;
> +	rte_red_set_scaling;
> +} DPDK_2.1;

You need to put the correct DPDK release number here.

You also need to do more work to make sure the share library support  is not broken:
-need to increase LIBABIVER in Makefile
-need to update the library .so number in release notes
-need to check that build does not fail for shared libraries

(You can use this patch as example: https://dpdk.org/dev/patchwork/patch/33109/ )

> diff --git a/test/test/test_red.c b/test/test/test_red.c
The RED  test code fails to link, please fix:

export RTE_TARGET=x86_64-native-linuxapp-gcc

[ ]$ ~/git_dpdk_red/dpdk$ make -C test/test
make: Entering directory 'dpdk/test/test'
...<snip>
   LD test
test_red.o: In function `test_rte_red_init':
test_red.c:(.text+0x2cd): undefined reference to `__rte_red_reset'
test_red.c:(.text+0x2da): undefined reference to `rte_red_set_scaling'
test_red.c:(.text+0x2ed): undefined reference to `rte_red_max_threshold'
test_red.o: In function `increase_actual_qsize':
test_red.c:(.text+0x48c): undefined reference to `rte_red_scaling'
test_red.c:(.text+0x533): undefined reference to `rte_red_scaling'
test_red.o: In function `enqueue_dequeue_func':
test_red.c:(.text+0x70c): undefined reference to `rte_red_scaling'
test_red.c:(.text+0x7a5): undefined reference to `rte_red_scaling'
test_red.o: In function `increase_average_qsize':
test_red.c:(.text+0x95c): undefined reference to `rte_red_scaling'
test_red.o:test_red.c:(.text+0x9f1): more undefined references to `rte_red_scaling' follow
collect2: error: ld returned 1 exit status
dpdk/mk/rte.app.mk:306: recipe for target 'test' failed
make: *** [test] Error 1
make: Leaving directory 'dpdk/test/test'

Regards,
Cristian

  reply	other threads:[~2018-01-11 13:11 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1507022514-21831-1>
2018-01-08 15:27 ` alangordondewar
2018-01-11 13:11   ` Dumitrescu, Cristian [this message]
2018-01-12  9:38     ` Dewar, Alan
2018-01-12 11:09       ` Dumitrescu, Cristian
2018-01-12 11:52         ` Dumitrescu, Cristian
2018-01-15 15:36           ` Dewar, Alan
2018-01-16 11:56             ` Dumitrescu, Cristian
2018-01-12 10:44     ` Dewar, Alan
2018-01-12 11:43       ` Dumitrescu, Cristian
2018-01-15 16:16   ` [dpdk-dev] [PATCH v6] " alangordondewar
2018-01-15 16:52     ` Stephen Hemminger
2018-01-16 15:50       ` Alan Dewar
2018-01-16 15:57         ` Alan Dewar
2018-01-16 16:44           ` Dumitrescu, Cristian
2018-01-16 16:07     ` [dpdk-dev] [PATCH v7] " alangordondewar
2019-04-05 15:36       ` Ferruh Yigit
2019-04-05 15:36         ` Ferruh Yigit
2019-04-08  8:24         ` Alan Dewar
2019-04-08  8:24           ` Alan Dewar
2019-04-08  8:53           ` Thomas Monjalon
2019-04-08  8:53             ` Thomas Monjalon
2019-04-08 13:29             ` Dumitrescu, Cristian
2019-04-08 13:29               ` Dumitrescu, Cristian
2020-07-06 23:09               ` Thomas Monjalon

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=3EB4FA525960D640B5BDFFD6A3D891267BAFB4EE@IRSMSX108.ger.corp.intel.com \
    --to=cristian.dumitrescu@intel.com \
    --cc=alan.dewar@att.com \
    --cc=alangordondewar@gmail.com \
    --cc=dev@dpdk.org \
    --cc=jasvinder.singh@intel.com \
    --cc=tomasz.kantecki@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).