* [dpdk-stable] [PATCH v3 1/2] test/distributor: fix flush with worker shutdown test
[not found] <223181000.veHZD1QNU4@xps>
@ 2019-07-05 10:05 ` Harman Kalra
2019-07-05 10:05 ` [dpdk-stable] [PATCH v3 2/2] distributor: fix additional check on no of workers Harman Kalra
2019-07-17 15:30 ` [dpdk-stable] [PATCH v3 1/2] test/distributor: fix flush with worker shutdown test Hunt, David
0 siblings, 2 replies; 6+ messages in thread
From: Harman Kalra @ 2019-07-05 10:05 UTC (permalink / raw)
To: thomas, david.hunt, ferruh.yigit
Cc: dev, Jerin Jacob Kollanukkaran, Harman Kalra, stable
On restarting worker 0 after shutdown, packets handled by
worker 0 must be incremented only when a packet is received by
it.
Fixes: c3eabff124e6 ("distributor: add unit tests")
Cc: stable@dpdk.org
Signed-off-by: Harman Kalra <hkalra@marvell.com>
---
app/test/test_distributor.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/test/test_distributor.c b/app/test/test_distributor.c
index 8084c0794..5d71bf87c 100644
--- a/app/test/test_distributor.c
+++ b/app/test/test_distributor.c
@@ -374,7 +374,8 @@ handle_work_for_shutdown_test(void *arg)
id, buf, buf, num);
while (!quit) {
- worker_stats[id].handled_packets++, count++;
+ worker_stats[id].handled_packets += num;
+ count += num;
rte_pktmbuf_free(pkt);
num = rte_distributor_get_pkt(d, id, buf, buf, num);
}
--
2.18.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [dpdk-stable] [PATCH v3 2/2] distributor: fix additional check on no of workers
2019-07-05 10:05 ` [dpdk-stable] [PATCH v3 1/2] test/distributor: fix flush with worker shutdown test Harman Kalra
@ 2019-07-05 10:05 ` Harman Kalra
2019-07-16 10:51 ` Thomas Monjalon
2019-07-17 15:32 ` Hunt, David
2019-07-17 15:30 ` [dpdk-stable] [PATCH v3 1/2] test/distributor: fix flush with worker shutdown test Hunt, David
1 sibling, 2 replies; 6+ messages in thread
From: Harman Kalra @ 2019-07-05 10:05 UTC (permalink / raw)
To: thomas, david.hunt, ferruh.yigit
Cc: dev, Jerin Jacob Kollanukkaran, Harman Kalra, stable
No of workers should never exceed RTE_MAX_LCORE.
RTE_DIST_ALG_SINGLE also require no of workers check.
Fixes: 775003ad2f96 ("distributor: add new burst-capable library")
Cc: stable@dpdk.org
Signed-off-by: Harman Kalra <hkalra@marvell.com>
---
lib/librte_distributor/rte_distributor.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/lib/librte_distributor/rte_distributor.c b/lib/librte_distributor/rte_distributor.c
index 208abfb1d..bfcc536fd 100644
--- a/lib/librte_distributor/rte_distributor.c
+++ b/lib/librte_distributor/rte_distributor.c
@@ -595,6 +595,12 @@ rte_distributor_create_v1705(const char *name,
RTE_BUILD_BUG_ON((sizeof(*d) & RTE_CACHE_LINE_MASK) != 0);
RTE_BUILD_BUG_ON((RTE_DISTRIB_MAX_WORKERS & 7) != 0);
+ if (name == NULL || num_workers >=
+ (unsigned int)RTE_MIN(RTE_DISTRIB_MAX_WORKERS, RTE_MAX_LCORE)) {
+ rte_errno = EINVAL;
+ return NULL;
+ }
+
if (alg_type == RTE_DIST_ALG_SINGLE) {
d = malloc(sizeof(struct rte_distributor));
if (d == NULL) {
@@ -612,11 +618,6 @@ rte_distributor_create_v1705(const char *name,
return d;
}
- if (name == NULL || num_workers >= RTE_DISTRIB_MAX_WORKERS) {
- rte_errno = EINVAL;
- return NULL;
- }
-
snprintf(mz_name, sizeof(mz_name), RTE_DISTRIB_PREFIX"%s", name);
mz = rte_memzone_reserve(mz_name, sizeof(*d), socket_id, NO_FLAGS);
if (mz == NULL) {
--
2.18.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-stable] [PATCH v3 2/2] distributor: fix additional check on no of workers
2019-07-05 10:05 ` [dpdk-stable] [PATCH v3 2/2] distributor: fix additional check on no of workers Harman Kalra
@ 2019-07-16 10:51 ` Thomas Monjalon
2019-07-17 15:32 ` Hunt, David
1 sibling, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2019-07-16 10:51 UTC (permalink / raw)
To: dev
Cc: stable, Harman Kalra, david.hunt, ferruh.yigit,
Jerin Jacob Kollanukkaran, bruce.richardson
Any review please?
05/07/2019 12:05, Harman Kalra:
> No of workers should never exceed RTE_MAX_LCORE.
> RTE_DIST_ALG_SINGLE also require no of workers check.
>
> Fixes: 775003ad2f96 ("distributor: add new burst-capable library")
> Cc: stable@dpdk.org
>
> Signed-off-by: Harman Kalra <hkalra@marvell.com>
> ---
> lib/librte_distributor/rte_distributor.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/lib/librte_distributor/rte_distributor.c b/lib/librte_distributor/rte_distributor.c
> index 208abfb1d..bfcc536fd 100644
> --- a/lib/librte_distributor/rte_distributor.c
> +++ b/lib/librte_distributor/rte_distributor.c
> @@ -595,6 +595,12 @@ rte_distributor_create_v1705(const char *name,
> RTE_BUILD_BUG_ON((sizeof(*d) & RTE_CACHE_LINE_MASK) != 0);
> RTE_BUILD_BUG_ON((RTE_DISTRIB_MAX_WORKERS & 7) != 0);
>
> + if (name == NULL || num_workers >=
> + (unsigned int)RTE_MIN(RTE_DISTRIB_MAX_WORKERS, RTE_MAX_LCORE)) {
> + rte_errno = EINVAL;
> + return NULL;
> + }
> +
> if (alg_type == RTE_DIST_ALG_SINGLE) {
> d = malloc(sizeof(struct rte_distributor));
> if (d == NULL) {
> @@ -612,11 +618,6 @@ rte_distributor_create_v1705(const char *name,
> return d;
> }
>
> - if (name == NULL || num_workers >= RTE_DISTRIB_MAX_WORKERS) {
> - rte_errno = EINVAL;
> - return NULL;
> - }
> -
> snprintf(mz_name, sizeof(mz_name), RTE_DISTRIB_PREFIX"%s", name);
> mz = rte_memzone_reserve(mz_name, sizeof(*d), socket_id, NO_FLAGS);
> if (mz == NULL) {
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-stable] [PATCH v3 1/2] test/distributor: fix flush with worker shutdown test
2019-07-05 10:05 ` [dpdk-stable] [PATCH v3 1/2] test/distributor: fix flush with worker shutdown test Harman Kalra
2019-07-05 10:05 ` [dpdk-stable] [PATCH v3 2/2] distributor: fix additional check on no of workers Harman Kalra
@ 2019-07-17 15:30 ` Hunt, David
1 sibling, 0 replies; 6+ messages in thread
From: Hunt, David @ 2019-07-17 15:30 UTC (permalink / raw)
To: Harman Kalra, thomas, ferruh.yigit; +Cc: dev, Jerin Jacob Kollanukkaran, stable
Hi Harman,
On 05/07/2019 11:05, Harman Kalra wrote:
> On restarting worker 0 after shutdown, packets handled by
> worker 0 must be incremented only when a packet is received by
> it.
>
> Fixes: c3eabff124e6 ("distributor: add unit tests")
> Cc: stable@dpdk.org
>
> Signed-off-by: Harman Kalra <hkalra@marvell.com>
> ---
> app/test/test_distributor.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/app/test/test_distributor.c b/app/test/test_distributor.c
> index 8084c0794..5d71bf87c 100644
> --- a/app/test/test_distributor.c
> +++ b/app/test/test_distributor.c
> @@ -374,7 +374,8 @@ handle_work_for_shutdown_test(void *arg)
> id, buf, buf, num);
>
> while (!quit) {
> - worker_stats[id].handled_packets++, count++;
> + worker_stats[id].handled_packets += num;
> + count += num;
> rte_pktmbuf_free(pkt);
> num = rte_distributor_get_pkt(d, id, buf, buf, num);
> }
Change makes sense. Builds OK, Runs OK, test passes.
Acked-by: David Hunt <david.hunt@intel.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-stable] [PATCH v3 2/2] distributor: fix additional check on no of workers
2019-07-05 10:05 ` [dpdk-stable] [PATCH v3 2/2] distributor: fix additional check on no of workers Harman Kalra
2019-07-16 10:51 ` Thomas Monjalon
@ 2019-07-17 15:32 ` Hunt, David
2019-07-17 20:37 ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon
1 sibling, 1 reply; 6+ messages in thread
From: Hunt, David @ 2019-07-17 15:32 UTC (permalink / raw)
To: Harman Kalra, thomas, ferruh.yigit; +Cc: dev, Jerin Jacob Kollanukkaran, stable
Hi Harman,
On 05/07/2019 11:05, Harman Kalra wrote:
> No of workers should never exceed RTE_MAX_LCORE.
> RTE_DIST_ALG_SINGLE also require no of workers check.
>
> Fixes: 775003ad2f96 ("distributor: add new burst-capable library")
> Cc: stable@dpdk.org
>
> Signed-off-by: Harman Kalra <hkalra@marvell.com>
> ---
> lib/librte_distributor/rte_distributor.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/lib/librte_distributor/rte_distributor.c b/lib/librte_distributor/rte_distributor.c
> index 208abfb1d..bfcc536fd 100644
> --- a/lib/librte_distributor/rte_distributor.c
> +++ b/lib/librte_distributor/rte_distributor.c
> @@ -595,6 +595,12 @@ rte_distributor_create_v1705(const char *name,
> RTE_BUILD_BUG_ON((sizeof(*d) & RTE_CACHE_LINE_MASK) != 0);
> RTE_BUILD_BUG_ON((RTE_DISTRIB_MAX_WORKERS & 7) != 0);
>
> + if (name == NULL || num_workers >=
> + (unsigned int)RTE_MIN(RTE_DISTRIB_MAX_WORKERS, RTE_MAX_LCORE)) {
> + rte_errno = EINVAL;
> + return NULL;
> + }
> +
> if (alg_type == RTE_DIST_ALG_SINGLE) {
> d = malloc(sizeof(struct rte_distributor));
> if (d == NULL) {
> @@ -612,11 +618,6 @@ rte_distributor_create_v1705(const char *name,
> return d;
> }
>
> - if (name == NULL || num_workers >= RTE_DISTRIB_MAX_WORKERS) {
> - rte_errno = EINVAL;
> - return NULL;
> - }
> -
> snprintf(mz_name, sizeof(mz_name), RTE_DISTRIB_PREFIX"%s", name);
> mz = rte_memzone_reserve(mz_name, sizeof(*d), socket_id, NO_FLAGS);
> if (mz == NULL) {
Builds OK, runs OK. Change makes sense, also good to move the check to
the new location.
Acked-by: David Hunt <david.hunt@intel.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-stable] [dpdk-dev] [PATCH v3 2/2] distributor: fix additional check on no of workers
2019-07-17 15:32 ` Hunt, David
@ 2019-07-17 20:37 ` Thomas Monjalon
0 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2019-07-17 20:37 UTC (permalink / raw)
To: Harman Kalra
Cc: dev, Hunt, David, ferruh.yigit, Jerin Jacob Kollanukkaran, stable
17/07/2019 17:32, Hunt, David:
> Hi Harman,
>
> On 05/07/2019 11:05, Harman Kalra wrote:
> > No of workers should never exceed RTE_MAX_LCORE.
> > RTE_DIST_ALG_SINGLE also require no of workers check.
> >
> > Fixes: 775003ad2f96 ("distributor: add new burst-capable library")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Harman Kalra <hkalra@marvell.com>
>
> Builds OK, runs OK. Change makes sense, also good to move the check to
> the new location.
>
> Acked-by: David Hunt <david.hunt@intel.com>
Applied, thanks
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-07-17 20:37 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <223181000.veHZD1QNU4@xps>
2019-07-05 10:05 ` [dpdk-stable] [PATCH v3 1/2] test/distributor: fix flush with worker shutdown test Harman Kalra
2019-07-05 10:05 ` [dpdk-stable] [PATCH v3 2/2] distributor: fix additional check on no of workers Harman Kalra
2019-07-16 10:51 ` Thomas Monjalon
2019-07-17 15:32 ` Hunt, David
2019-07-17 20:37 ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon
2019-07-17 15:30 ` [dpdk-stable] [PATCH v3 1/2] test/distributor: fix flush with worker shutdown test Hunt, David
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).