[dpdk-dev] [PATCH] cmdline: fix unchecked return value

2016-06-28 Thread Mrzyglod, DanielX T
>From: Olivier Matz [mailto:olivier.matz at 6wind.com]
>Sent: Monday, May 02, 2016 3:37 PM
>To: Mrzyglod, DanielX T ; dev at dpdk.org
>Subject: Re: [PATCH] cmdline: fix unchecked return value
>
>Hi Daniel,
>
>On 04/14/2016 03:01 PM, Daniel Mrzyglod wrote:
>> This patch is for checking if error values occurs.
>> fix for coverity errors #13209 & #13195
>>
>> If the function returns an error value, the error value may be mistaken
>> for a normal value.
>>
>> In rdline_char_in: Value returned from a function is not checked for errors
>> before being used
>>
>> Signed-off-by: Daniel Mrzyglod 
>> ---
>>  lib/librte_cmdline/cmdline_rdline.c | 19 +++
>>  1 file changed, 15 insertions(+), 4 deletions(-)
>>
>> diff --git a/lib/librte_cmdline/cmdline_rdline.c
>b/lib/librte_cmdline/cmdline_rdline.c
>> index 1ef2258..e75a556 100644
>> --- a/lib/librte_cmdline/cmdline_rdline.c
>> +++ b/lib/librte_cmdline/cmdline_rdline.c
>> @@ -377,7 +377,10 @@ rdline_char_in(struct rdline *rdl, char c)
>>  case CMDLINE_KEY_CTRL_K:
>>  cirbuf_get_buf_head(>right, rdl->kill_buf,
>RDLINE_BUF_SIZE);
>>  rdl->kill_size = CIRBUF_GET_LEN(>right);
>> -cirbuf_del_buf_head(>right, rdl->kill_size);
>> +
>> +if (cirbuf_del_buf_head(>right, rdl->kill_size) < 
>> 0)
>> +return -EINVAL;
>> +
>>  rdline_puts(rdl, vt100_clear_right);
>>  break;
>>
>
>I wonder if a better way to fix wouldn't be to remove the checks
>introduced in http://dpdk.org/browse/dpdk/commit/?id=ab971e562860
>
>There is no reason to check that in cirbuf_get_buf_head/tail():
>if (!cbuf || !c)
>
>The function should never fail, it just returns the number of
>copied chars. This is the responsibility of the caller to ensure
>that the pointer to the circular buffer is not NULL.
>
>Also, rdline_char_in() is not expected to return -EINVAL, but
>RDLINE_RES_* instead.
>
>So I think that partially revert ab971e562860 would fix the
>coverity warning.
>
>Regards,
>Olivier

Removing checks probably will generate more Coverity errors somewhere.
I see that only places where we test negative values are in unit tests.

Reverting changes I think is overhead and maybe ignoring this patch and set is 
as false positive in Coverity is better idea ?

Regards
Daniel



[dpdk-dev] [PATCH v2] examples/ip_pipeline: fix build error for gcc 4.8

2016-06-22 Thread Mrzyglod, DanielX T
>From: Mrzyglod, DanielX T
>Sent: Tuesday, June 21, 2016 11:36 AM
>To: Singh, Jasvinder ; Dumitrescu, Cristian
>
>Cc: dev at dpdk.org; Mrzyglod, DanielX T 
>Subject: [PATCH v2] examples/ip_pipeline: fix build error for gcc 4.8
>
>This patch fixes a maybe-uninitialized warning when compiling DPDK with GCC 4.8
>
>examples/ip_pipeline/pipeline/pipeline_common_fe.c: In function
>'app_pipeline_track_pktq_out_to_link':
>examples/ip_pipeline/pipeline/pipeline_common_fe.c:66:31: error:
>'reader' may be used uninitialized in this function 
>[-Werror=maybe-uninitialized]
>
>   struct app_pktq_out_params *pktq_out =
>
>Fixes: 760064838ec0 ("examples/ip_pipeline: link routing output ports to
>devices")
>
>Signed-off-by: Daniel Mrzyglod 
>Acked-by: Cristian Dumitrescu 
>---
> examples/ip_pipeline/app.h | 8 
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
>diff --git a/examples/ip_pipeline/app.h b/examples/ip_pipeline/app.h
>index 7611341..242dae8 100644
>--- a/examples/ip_pipeline/app.h
>+++ b/examples/ip_pipeline/app.h
>@@ -667,11 +667,11 @@ app_swq_get_reader(struct app_params *app,
>   struct app_pktq_swq_params *swq,
>   uint32_t *pktq_in_id)
> {
>-  struct app_pipeline_params *reader;
>+  struct app_pipeline_params *reader = NULL;
>   uint32_t pos = swq - app->swq_params;
>   uint32_t n_pipelines = RTE_MIN(app->n_pipelines,
>   RTE_DIM(app->pipeline_params));
>-  uint32_t n_readers = 0, id, i;
>+  uint32_t n_readers = 0, id = 0, i;
>
>   for (i = 0; i < n_pipelines; i++) {
>   struct app_pipeline_params *p = >pipeline_params[i];
>@@ -727,11 +727,11 @@ app_tm_get_reader(struct app_params *app,
>   struct app_pktq_tm_params *tm,
>   uint32_t *pktq_in_id)
> {
>-  struct app_pipeline_params *reader;
>+  struct app_pipeline_params *reader = NULL;
>   uint32_t pos = tm - app->tm_params;
>   uint32_t n_pipelines = RTE_MIN(app->n_pipelines,
>   RTE_DIM(app->pipeline_params));
>-  uint32_t n_readers = 0, id, i;
>+  uint32_t n_readers = 0, id = 0, i;
>
>   for (i = 0; i < n_pipelines; i++) {
>   struct app_pipeline_params *p = >pipeline_params[i];
>--
>2.5.5

Self-NACK already applied


[dpdk-dev] [PATCH v2] examples/ip_pipeline: fix build error for gcc 4.8

2016-06-22 Thread Mrzyglod, DanielX T


>-Original Message-
>From: Dumitrescu, Cristian
>Sent: Tuesday, June 21, 2016 7:44 PM
>To: Mrzyglod, DanielX T ; Singh, Jasvinder
>
>Cc: dev at dpdk.org
>Subject: RE: [PATCH v2] examples/ip_pipeline: fix build error for gcc 4.8
>
>
>
>> -Original Message-
>> From: Mrzyglod, DanielX T
>> Sent: Tuesday, June 21, 2016 10:36 AM
>> To: Singh, Jasvinder ; Dumitrescu, Cristian
>> 
>> Cc: dev at dpdk.org; Mrzyglod, DanielX T 
>> Subject: [PATCH v2] examples/ip_pipeline: fix build error for gcc 4.8
>>
>> This patch fixes a maybe-uninitialized warning when compiling DPDK with
>> GCC 4.8
>>
>> examples/ip_pipeline/pipeline/pipeline_common_fe.c: In function
>> 'app_pipeline_track_pktq_out_to_link':
>> examples/ip_pipeline/pipeline/pipeline_common_fe.c:66:31: error:
>> 'reader' may be used uninitialized in this function [-Werror=maybe-
>> uninitialized]
>>
>>struct app_pktq_out_params *pktq_out =
>>
>> Fixes: 760064838ec0 ("examples/ip_pipeline: link routing output ports to
>> devices")
>>
>> Signed-off-by: Daniel Mrzyglod 
>> Acked-by: Cristian Dumitrescu 
>> ---
>>  examples/ip_pipeline/app.h | 8 
>>  1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/examples/ip_pipeline/app.h b/examples/ip_pipeline/app.h
>> index 7611341..242dae8 100644
>> --- a/examples/ip_pipeline/app.h
>> +++ b/examples/ip_pipeline/app.h
>> @@ -667,11 +667,11 @@ app_swq_get_reader(struct app_params *app,
>>  struct app_pktq_swq_params *swq,
>>  uint32_t *pktq_in_id)
>>  {
>> -struct app_pipeline_params *reader;
>> +struct app_pipeline_params *reader = NULL;
>>  uint32_t pos = swq - app->swq_params;
>>  uint32_t n_pipelines = RTE_MIN(app->n_pipelines,
>>  RTE_DIM(app->pipeline_params));
>> -uint32_t n_readers = 0, id, i;
>> +uint32_t n_readers = 0, id = 0, i;
>>
>>  for (i = 0; i < n_pipelines; i++) {
>>  struct app_pipeline_params *p = >pipeline_params[i];
>> @@ -727,11 +727,11 @@ app_tm_get_reader(struct app_params *app,
>>  struct app_pktq_tm_params *tm,
>>  uint32_t *pktq_in_id)
>>  {
>> -struct app_pipeline_params *reader;
>> +struct app_pipeline_params *reader = NULL;
>>  uint32_t pos = tm - app->tm_params;
>>  uint32_t n_pipelines = RTE_MIN(app->n_pipelines,
>>  RTE_DIM(app->pipeline_params));
>> -uint32_t n_readers = 0, id, i;
>> +uint32_t n_readers = 0, id = 0, i;
>>
>>  for (i = 0; i < n_pipelines; i++) {
>>  struct app_pipeline_params *p = >pipeline_params[i];
>> --
>> 2.5.5
>
>
>No need for this patch, as these fixes have been already applied by Ethan's 
>patch.
>
>Daniel, please check and let us know if otherwise.

You are correct


[dpdk-dev] [PATCH] mem: fix overflowed return value

2016-06-08 Thread Mrzyglod, DanielX T


>-Original Message-
>From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Stephen Hemminger
>Sent: Friday, April 22, 2016 6:25 PM
>To: Kobylinski, MichalX 
>Cc: thomas.monjalon at 6wind.com; dev at dpdk.org
>Subject: Re: [dpdk-dev] [PATCH] mem: fix overflowed return value
>
>On Fri, 22 Apr 2016 12:44:18 +0200
>Michal Kobylinski  wrote:
>
>> Fix issue reported by Coverity.
>>
>> Coverity ID 13255: Overflowed return value: The return value will be too
>> small or even negative, likely resulting in unexpected behavior in a
>> caller that uses the return value. In rte_mem_virt2phy: An integer
>> overflow occurs, with the overflowed value used as the return value of
>> the function
>>
>> Fixes: 3097de6e6bfb ("mem: get physical address of any pointer")
>>
>> Signed-off-by: Michal Kobylinski 
>> ---
>>  lib/librte_eal/linuxapp/eal/eal_memory.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c
>b/lib/librte_eal/linuxapp/eal/eal_memory.c
>> index 5b9132c..6ceca5b 100644
>> --- a/lib/librte_eal/linuxapp/eal/eal_memory.c
>> +++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
>> @@ -195,7 +195,7 @@ rte_mem_virt2phy(const void *virtaddr)
>>   * the pfn (page frame number) are bits 0-54 (see
>>   * pagemap.txt in linux Documentation)
>>   */
>> -physaddr = ((page & 0x7fULL) * page_size)
>> +physaddr = (uint64_t)((page & 0x7fULL) * page_size)
>>  + ((unsigned long)virtaddr % page_size);
>>  close(fd);
>>  return physaddr;
>
>I am not trusting any of these Coverity patches you are sending.
>It seems you think wraparound can be just fixed by casting, it can't

>From my point of view it's False Possitive there is no chance that page_size 
>will be bigger than  long.
Coverity Assume that page_size may be 18446744071562067968 but it can't.

Only for glibc<2.1 we probably should change page_size = getpagesize();   to  
page_size = sysconf(_SC_PAGESIZE); 
May I change this Coverity to False Positive or I missed something ? What's 
your opinion ? 



[dpdk-dev] [PATCH 2/2] examples: fix build errors for icc

2016-04-04 Thread Mrzyglod, DanielX T
>From: De Lara Guarch, Pablo
>Sent: Monday, April 04, 2016 11:34 AM
>To: Mrzyglod, DanielX T ; dev at dpdk.org
>Cc: Wu, Jingjing 
>Subject: RE: [PATCH 2/2] examples: fix build errors for icc
>
>Hi Daniel,
>
>> -Original Message-----
>> From: Mrzyglod, DanielX T
>> Sent: Monday, April 04, 2016 9:47 AM
>> To: dev at dpdk.org
>> Cc: Wu, Jingjing; De Lara Guarch, Pablo
>> Subject: [PATCH 2/2] examples: fix build errors for icc
>>
>> error: loops in this subroutine are not good vectorization candidates
>>  (try compiling with O3 and/or IPO).
>>
>> Solution to disable this diagnostic message
>> https://software.intel.com/en-us/forums/intel-c-compiler/topic/537688
>>
>> Fixes: d299106e8e31 ("examples/ipsec-secgw: add IPsec sample application")
>> Fixes: 8cc72f2814dd ("examples/vmdq_dcb: support X710")
>>
>> Signed-off-by: Daniel Mrzyglod 
>
>Which ICC version are you using? I don't see any errors with ICC 15.0, so is 
>it with
>16.0?

icc (ICC) 15.0.1 20141023
Copyright (C) 1985-2014 Intel Corporation.  All rights reserved.

When I did: make examples T=x86_64-native-linuxapp-icc
/mnt/shared/dtmrzglx/hubabuba/examples/vmdq_dcb/main.c(521): (col. 1) error: 
loops in this subroutine are not good vectorization candidates (try compiling 
with O3 and/or IPO).
compilation aborted for /mnt/shared/dtmrzglx/hubabuba/examples/vmdq_dcb/main.c 
(code 1)
/mnt/shared/dtmrzglx/hubabuba/mk/internal/rte.compile-pre.mk:126: recipe for 
target 'main.o' failed
make[4]: *** [main.o] Error 1
/mnt/shared/dtmrzglx/hubabuba/mk/rte.extapp.mk:42: recipe for target 'all' 
failed
make[3]: *** [all] Error 2
/mnt/shared/dtmrzglx/hubabuba/mk/rte.extsubdir.mk:46: recipe for target 
'vmdq_dcb' failed
make[2]: *** [vmdq_dcb] Error 2
make[2]: *** Waiting for unfinished jobs


/mnt/shared/dtmrzglx/hubabuba/examples/ipsec-secgw/sa.c(348): (col. 1) error: 
loops in this subroutine are not good vectorization candidates (try compiling 
with O3 and/or IPO).
compilation aborted for /mnt/shared/dtmrzglx/hubabuba/examples/ipsec-secgw/sa.c 
(code 1)
/mnt/shared/dtmrzglx/hubabuba/mk/internal/rte.compile-pre.mk:126: recipe for 
target 'sa.o' failed
make[4]: *** [sa.o] Error 1



[dpdk-dev] [PATCH] mk: fix eal shared library dependencies -lrt

2016-03-22 Thread Mrzyglod, DanielX T
>-Original Message-
>From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
>Sent: Tuesday, March 22, 2016 9:55 AM
>To: Mrzyglod, DanielX T 
>Cc: dev at dpdk.org
>Subject: Re: [dpdk-dev] [PATCH] mk: fix eal shared library dependencies -lrt
>
>2016-03-22 09:09, Daniel Mrzyglod:
>> For GLIBC < 2.17 it is necessery to add -lrt for linker
>> from glibc > 2.17 The `clock_*' suite of functions (declared in ) is 
>> now
>> available directly in the main C library. This affect Ubuntu 12.04 in i686
>> and other older Linux Distros).
>[...]
>> --- a/app/test/Makefile
>> +++ b/app/test/Makefile
>> @@ -114,6 +114,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) +=
>test_cmdline_string.c
>>  SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test_cmdline_lib.c
>>
>>  ifeq ($(CONFIG_RTE_LIBRTE_SCHED),y)
>> +LDFLAGS += -lrt
>
>Why are you adding it only for librte_sched?
>Is it needed by librte_sched or by some functions testing librte_sched?

Every clock_gettime() needs -lrt for >=GLIBC2.17. For glibc2.17 and above  
`clock_*' suite of functions (declared in ) is now available
directly in the main C library.
In test it's only in test_red.c and I see that I missed it in ptpclient example 
probably. So I will send Patch v2





[dpdk-dev] [PATCH] testpmd: fix build on FreeBSD

2016-03-21 Thread Mrzyglod, DanielX T
>From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Marvin Liu
>Sent: Monday, March 21, 2016 2:45 AM
>To: dev at dpdk.org
>Cc: Liu, Yong 
>Subject: [dpdk-dev] [PATCH] testpmd: fix build on FreeBSD
>
>Build log:
>/root/dpdk/app/test-pmd/cmdline.c:6687:45: error: no member named
>'s6_addr32' in 'struct in6_addr'
>   rte_be_to_cpu_32(res->ip_value.addr.ipv6.s6_addr32[i]);
>
>This is caused by macro "s6_addr32" not defined on FreeBSD.
>
>Signed-off-by: Marvin Liu 

Acked-by: Daniel Mrzyglod 


[dpdk-dev] [PATCH 1/2] mbuf: Add rte_pktmbuf_copy

2016-01-22 Thread Mrzyglod, DanielX T


>-Original Message-
>From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Stephen Hemminger
>Sent: Friday, July 10, 2015 1:38 AM
>To: dev at dpdk.org
>Cc: Mike Davison ; Stephen Hemminger
>
>Subject: [dpdk-dev] [PATCH 1/2] mbuf: Add rte_pktmbuf_copy
>
>From: Stephen Hemminger 
>
>Added rte_pktmbuf_copy() function since copying multi-part
>segments is common issue and can be problematic.
>
>Signed-off-by: Mike Davison 
>Reviewed-by: Stephen Hemminger 
>---
> lib/librte_mbuf/rte_mbuf.h | 59
>++
> 1 file changed, 59 insertions(+)
>
>diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
>index 80419df..f0a543b 100644
>--- a/lib/librte_mbuf/rte_mbuf.h
>+++ b/lib/librte_mbuf/rte_mbuf.h
>@@ -60,6 +60,7 @@
> #include 
> #include 
> #include 
>+#include 
>
> #ifdef __cplusplus
> extern "C" {
>@@ -1272,6 +1273,64 @@ static inline int rte_pktmbuf_is_contiguous(const
>struct rte_mbuf *m)
>   return !!(m->nb_segs == 1);
> }
>
>+/*
>+ * Creates a copy of the given packet mbuf.
>+ *
>+ * Walks through all segments of the given packet mbuf, and for each of them:
>+ *  - Creates a new packet mbuf from the given pool.
>+ *  - Copy segment to newly created mbuf.
>+ * Then updates pkt_len and nb_segs of the new packet mbuf to match values
>+ * from the original packet mbuf.
>+ *
>+ * @param md
>+ *   The packet mbuf to be copied.
>+ * @param mp
>+ *   The mempool from which the mbufs are allocated.
>+ * @return
>+ *   - The pointer to the new mbuf on success.
>+ *   - NULL if allocation fails.
>+ */
>+static inline struct rte_mbuf *rte_pktmbuf_copy(struct rte_mbuf *md,
>+  struct rte_mempool *mp)
>+{
>+  struct rte_mbuf *mc = NULL;
>+  struct rte_mbuf **prev = 
>+
>+  do {
>+  struct rte_mbuf *mi;
>+
>+  mi = rte_pktmbuf_alloc(mp);
>+  if (unlikely(mi == NULL)) {
>+  rte_pktmbuf_free(mc);
>+  return NULL;
>+  }
>+
>+  mi->data_off = md->data_off;
>+  mi->data_len = md->data_len;
>+  mi->port = md->port;
>+  mi->vlan_tci = md->vlan_tci;
>+  mi->tx_offload = md->tx_offload;
>+  mi->hash = md->hash;
>+
>+  mi->next = NULL;
>+  mi->pkt_len = md->pkt_len;
>+  mi->nb_segs = md->nb_segs;
>+  mi->ol_flags = md->ol_flags;
>+  mi->packet_type = md->packet_type;
>+
>+  rte_memcpy(rte_pktmbuf_mtod(mi, char *),
>+ rte_pktmbuf_mtod(md, char *),
>+ md->data_len);
>+
>+  *prev = mi;
>+  prev = >next;
>+  } while ((md = md->next) != NULL);
>+
>+  *prev = NULL;
>+  __rte_mbuf_sanity_check(mc, 1);
>+  return mc;
>+}
>+
> /**
>  * Dump an mbuf structure to the console.
>  *
>--
>2.1.4

Hi Stephen :>
This patch look useful in case of backup buffs. 
There will be second approach ?


[dpdk-dev] [PATCH v2] examples/bond: fix bsd compile error

2015-11-26 Thread Mrzyglod, DanielX T
>-Original Message-
>From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Ferruh Yigit
>Sent: Wednesday, November 25, 2015 6:41 PM
>To: dev at dpdk.org
>Subject: [dpdk-dev] [PATCH v2] examples/bond: fix bsd compile error
>
>Error:
>== bond
>  CC main.o
>/.../examples/bond/main.c:431:24: error: use of undeclared identifier 'AF_INET'
>if (res->ip.family == AF_INET)
>  ^
>1 error generated.
>/.../mk/internal/rte.compile-pre.mk:126: recipe for target 'main.o' failed
>
>AF_INET defined in sys/socket.h
>
>This header included for Linux:
>. //include/rte_ip.h
>.. /usr/include/netinet/in.h
>... /usr/include/sys/socket.h
>
>But not for FreeBSD:
>. //include/rte_ip.h
>.. /usr/include/netinet/in.h
>... /usr/include/machine/endian.h
>... /usr/include/netinet6/in6.h
>. //include/rte_tcp.h
>
>Signed-off-by: Ferruh Yigit 
>---
> examples/bond/main.c | 1 +
> 1 file changed, 1 insertion(+)
>
>diff --git a/examples/bond/main.c b/examples/bond/main.c
>index 4622283..19f4f05 100644
>--- a/examples/bond/main.c
>+++ b/examples/bond/main.c
>@@ -45,6 +45,7 @@
> #include 
> #include 
> #include 
>+#include 
>
> #include 
> #include 
>--
>2.5.0

Acked-by: Daniel Mrzyglod 


[dpdk-dev] [PATCH v2] net: fix build with gcc 4.4.7 and strict aliasing

2015-11-25 Thread Mrzyglod, DanielX T
If we change input buf:
xapp-gcc/include/rte_ip.h:211: error: dereferencing pointer 'u16' does break 
strict-aliasing rules
/root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ip.h:204: note: initialized 
from here
/root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ip.h:212: error: 
dereferencing pointer '({anonymous})' does break strict-aliasing rules
/root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ip.h:212: note: initialized 
from here
/root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ip.h:213: error: 
dereferencing pointer '({anonymous})' does break strict-aliasing rules
/root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ip.h:213: note: initialized 
from here
/root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ip.h:214: error: 
dereferencing pointer '({anonymous})' does break strict-aliasing rules
/root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ip.h:214: note: initialized 
from here

The change was pointed  out by Michael Qiu in patch: 
2b039d5f20a34016ecaf9b26f8f8b6c4a81bf4b6

We can only cast void to uint8 but it would involve big endian/ little endian 
macros:

static inline uint32_t __attribute__((__may_alias__))
__rte_raw_cksum(const void *buf, size_t len, uint32_t sum)
{
/* workaround gcc strict-aliasing warning */
const uint8_t *u8 = ((const uint8_t *)buf);
while (len >= (sizeof(*u8) * 8)) {
sum += *(u8+1) << 8 | *(u8);
sum += *(u8+3) << 8 | *(u8+2);
sum += *(u8+5) << 8 | *(u8+4);
sum += *(u8+7) << 8 | *(u8+6);

len -= sizeof(*u8) * 8;
u8 += 8;
}

while (len >= 2*sizeof(*u8)) {
sum += *u8 << 8 | *(u8+1);
len -= 2*sizeof(*u8);
u8 += 2;
}

/* if length is in odd bytes */
if (len == 1)
sum += *((const uint8_t *)u8);

return sum;
}

I will research about this union usage suggested by Stephen, but for this 
moment  local typedef & __attribute__((__may_alias__)) is the most clean 
solution which work under gcc(4.4.7), clang, icc.

>-Original Message-
>From: Ananyev, Konstantin
>Sent: Tuesday, November 24, 2015 6:58 PM
>To: Mrzyglod, DanielX T 
>Cc: dev at dpdk.org
>Subject: RE: [dpdk-dev] [PATCH v2] net: fix build with gcc 4.4.7 and strict 
>aliasing
>
>Hi Daniel,
>So for my own curiosity: what went wrong here?
>Did compiler avoid to generate a code for while {} loop?
>Or something else?
>BTW, it is an internal function, so instead of introducing new typedef,
>we can just change the type of buf?
>Let say to uint8_t *?
>From gcc manual page: "  A character type may alias any other type."
>Would that work?
>Konstantin
>
>> -Original Message-
>> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Daniel Mrzyglod
>> Sent: Tuesday, November 24, 2015 4:31 PM
>> To: dev at dpdk.org
>> Subject: [dpdk-dev] [PATCH v2] net: fix build with gcc 4.4.7 and strict 
>> aliasing
>>
>> This fix is for IPv6 checksum offload error on RHEL65.
>> Any optimalisation above -O0 provide error in IPv6 checksum
>> flag "-fstrict-aliasing" is default for optimalisation above -O0.
>>
>> Fixes: 2b039d5f20a3 ("net: fix build with gcc 4.4.7 and strict aliasing")
>>
>> Signed-off-by: Daniel Mrzyglod 
>> ---
>>  lib/librte_net/rte_ip.h | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/lib/librte_net/rte_ip.h b/lib/librte_net/rte_ip.h
>> index 71c519a..5b7554a 100644
>> --- a/lib/librte_net/rte_ip.h
>> +++ b/lib/librte_net/rte_ip.h
>> @@ -169,7 +169,8 @@ __rte_raw_cksum(const void *buf, size_t len, uint32_t
>sum)
>>  {
>>  /* workaround gcc strict-aliasing warning */
>>  uintptr_t ptr = (uintptr_t)buf;
>> -const uint16_t *u16 = (const uint16_t *)ptr;
>> +typedef uint16_t __attribute__((__may_alias__)) u16_p;
>> +const u16_p *u16 = (const u16_p *)ptr;
>>
>>  while (len >= (sizeof(*u16) * 4)) {
>>  sum += u16[0];
>> --
>> 2.5.0



[dpdk-dev] [PATCH] net: fix build with gcc 4.4.7 and strict aliasing

2015-11-24 Thread Mrzyglod, DanielX T
This error fix this situation for IPv6 checksum offload error on RHEL65
Any optimalisation above -O0 provide error in IPv6 checksum


Step 1 : start testpmd
./x86_64-native-linuxapp-gcc/app/testpmd -c 0x6 -n 4  -- -i --portmask=0x3 
--disable-hw-vlan --enable-rx-cksum --crc-strip --txqflags=0

Step 2 : settings and start
   set verbose 1
   set fwd csum
   start

Step 3 : calculate correct checksum values of IPv6/TCP and IPv6/UDP by scapy
   Packets info:  IPv6/UDP:Ether(dst="02:00:00:00:00:00", 
src="90:e2:ba:4a:33:5c")/IPv6(src="::2")/UDP()/("X"*46)
  IPv6/TCP:  Ether(src="52:00:00:00:00:00", 
dst="90:e2:ba:4a:33:5d")/IPv6(src="::1")/TCP()/("X"*46)

Step 4 : Send two packets with wrong checksum value,and calculate the right 
checksum value by port,packets received on another port
   Send packets info: IPv6/UDP?Ether(dst="90:e2:ba:4a:33:5d", 
src="52:00:00:00:00:00")/IPv6(src="::1")/UDP(chksum=0xf)/("X"*46)
  IPv6/TCP?Ether(dst="90:e2:ba:4a:33:5d", 
src="52:00:00:00:00:00")/IPv6(src="::1")/TCP(chksum=0xf)/("X"*46)

RESULTS:
'IPv6/TCP': ['0xd41']}, 'IPv6/UDP': ['0x7d07'],

EXPECTED RESULTS:
'IPv6/TCP': ['0x9f5e']}, 'IPv6/UDP': ['0xf26']


[dpdk-dev] [PATCH v4 0/7] add sample ptp slave application

2015-11-05 Thread Mrzyglod, DanielX T


> -Original Message-
> From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
> 2015-11-05 12:46, Mcnamara, John:
> > Why is this patchset marked as "Deferred"?
> >
> > http://dpdk.org/dev/patchwork/project/dpdk/list/?state=10
> 
> Because it is too late to integrate new networking features in 2.2
> (except for packet framework).
> It will be welcome in the 2.3 timeframe starting in December.

Those patches are basically fixes and supplement  to  
aee686ea17290271d62308b0f559c46e33f6364b

V1 were send on merge window.
V2 were send send at review window.
V2 were Acked but there was Konstantin's request to move common structures.
V3 was send as fast as possible.

>From my point of view it should be added to RC2.



[dpdk-dev] [PATCH v5 0/7] add sample ptp slave application

2015-11-05 Thread Mrzyglod, DanielX T


> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Daniel Mrzyglod
> Sent: Thursday, November 05, 2015 3:06 PM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH v5 0/7] add sample ptp slave application
> 
> Add a sample application that acts as a PTP slave using the DPDK IEEE1588
> functions.
> 
> Also add some additional IEEE1588 support functions to enable getting,
> setting and adjusting the device time.
> 
> V4->v5:
>  - rebase to the current master

Previous series was Acked by John McNamara:
http://dpdk.org/ml/archives/dev/2015-November/027666.html


[dpdk-dev] [PATCH v2] announce ABI change for librte_table

2015-07-23 Thread Mrzyglod, DanielX T
> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Cristian Dumitrescu
> Sent: Thursday, July 23, 2015 1:00 PM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH v2] announce ABI change for librte_table
> 
> v2 changes:
> -changed item on LPM table to add LPM IPv6
> -removed item for ACL table and replaced with item on table ops
> -added item for hash tables
> 
> Signed-off-by: Cristian Dumitrescu 
> ---
>  doc/guides/rel_notes/deprecation.rst |   10 ++
>  1 files changed, 10 insertions(+), 0 deletions(-)
> 
> diff --git a/doc/guides/rel_notes/deprecation.rst
> b/doc/guides/rel_notes/deprecation.rst
> index 5330d3b..677f111 100644
> --- a/doc/guides/rel_notes/deprecation.rst
> +++ b/doc/guides/rel_notes/deprecation.rst
> @@ -35,3 +35,13 @@ Deprecation Notices
>  * The following fields have been deprecated in rte_eth_stats:
>imissed, ibadcrc, ibadlen, imcasts, fdirmatch, fdirmiss,
>tx_pause_xon, rx_pause_xon, tx_pause_xoff, rx_pause_xoff
> +
> +* librte_table (rte_table_lpm.h, rte_table_lpm_ipv6.h): A new parameter to
> hold
> +  the table name will be added to the LPM table parameter structure.
> +
> +* librte_table (rte_table.h): New functions for table entry bulk add/delete 
> will
> +  be added to the table operations structure.
> +
> +* librte_table (rte_table_hash.h): Key mask parameter will be added to the 
> hash
> +  table parameter structure for 8-byte key and 16-byte key extendible bucket
> and
> +  LRU tables.
> --
> 1.7.4.1

Acked-by: Daniel Mrzyglod 


[dpdk-dev] [PATCH] doc: announce ABI change for librte_pipeline

2015-07-17 Thread Mrzyglod, DanielX T
> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Cristian Dumitrescu
> Sent: Thursday, July 16, 2015 7:08 PM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH] doc: announce ABI change for librte_pipeline
> 
> 
> Signed-off-by: Cristian Dumitrescu 

Acked-by: Daniel Mrzyglod 


[dpdk-dev] [PATCH] doc: announce ABI change for librte_table

2015-07-17 Thread Mrzyglod, DanielX T
> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Cristian Dumitrescu
> Sent: Thursday, July 16, 2015 7:00 PM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH] doc: announce ABI change for librte_table
> 
> 
> Signed-off-by: Cristian Dumitrescu 

Acked-by: Daniel Mrzyglod 


[dpdk-dev] [PATCH v2] doc: announce ABI change for librte_port

2015-07-17 Thread Mrzyglod, DanielX T
> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Cristian Dumitrescu
> Sent: Thursday, July 16, 2015 5:27 PM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH v2] doc: announce ABI change for librte_port
> 
> v2 changes:
> -text simplification
> 
> Signed-off-by: Cristian Dumitrescu 

Acked-by: Daniel Mrzyglod 


[dpdk-dev] [PATCH] doc: announce ABI change for librte_port

2015-07-16 Thread Mrzyglod, DanielX T


> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Cristian Dumitrescu
> Sent: Thursday, July 16, 2015 2:20 PM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH] doc: announce ABI change for librte_port
> 
> 
> Signed-off-by: Cristian Dumitrescu 
> ---
>  doc/guides/rel_notes/abi.rst |   12 
>  1 files changed, 12 insertions(+), 0 deletions(-)
> 
> diff --git a/doc/guides/rel_notes/abi.rst b/doc/guides/rel_notes/abi.rst
> index 9e98d62..271e08e 100644
> --- a/doc/guides/rel_notes/abi.rst
> +++ b/doc/guides/rel_notes/abi.rst
> @@ -34,3 +34,15 @@ Deprecation Notices
>creates a dummy/empty malloc library to fulfill binaries with dynamic 
> linking
>dependencies on librte_malloc.so. Such dummy library will not be created 
> from
>release 2.2 so binaries will need to be rebuilt.
> +
> +* librte_port (rte_port.h): Macros to access the packet meta-data stored 
> within
> +  the packet buffer will be adjusted to cover the packet mbuf structure as 
> well,
> +  as currently they are able to access any packet buffer location except the
> +  packet mbuf structure. The consequence is that applications currently using
> +  these macros will have to adjust the value of the offset parameter of these
> +  macros by increasing it with sizeof(struc rte_mbuf). The affected macros 
> are:
> +  RTE_MBUF_METADATA_UINT<8, 16, 32, 64>_PTR and
> +  RTE_MBUF_METADATA_UINT<8, 16, 32, 64>. In terms of code changes, most
> likely
> +  only the definition of RTE_MBUF_METADATA_UINT8_PTR macro will be
> changed from
> +  ``(&((uint8_t *) &(mbuf)[1])[offset])`` to
> +  ``(&((uint8_t *) (mbuf))[offset])``.
> --
> 1.7.4.1

> 1.7.4.1


Acked-by: Daniel Mrzyglod 


[dpdk-dev] [PATCH] doc: announce ABI change for librte_cfgfile

2015-07-16 Thread Mrzyglod, DanielX T


> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Cristian Dumitrescu
> Sent: Thursday, July 16, 2015 1:37 PM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH] doc: announce ABI change for librte_cfgfile
> 
> 
> Signed-off-by: Cristian Dumitrescu 
> ---
>  doc/guides/rel_notes/abi.rst |5 +
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/doc/guides/rel_notes/abi.rst b/doc/guides/rel_notes/abi.rst
> index 126f73e..942f3ea 100644
> --- a/doc/guides/rel_notes/abi.rst
> +++ b/doc/guides/rel_notes/abi.rst
> @@ -29,3 +29,8 @@ Deprecation Notices
>and several ``PKT_RX_`` flags will be removed, to support unified packet 
> type
>from release 2.1. Those changes may be enabled in the upcoming release 2.1
>with CONFIG_RTE_NEXT_ABI.
> +
> +* librte_cfgfile (rte_cfgfile.h): In order to allow for longer names and 
> values,
> +  the value of macros CFG_NAME_LEN and CFG_NAME_VAL will be increased.
> Most
> +  likely, the new values will be 64 and 256, respectively.
> +
> --
> 1.7.4.1

Acked-by: Daniel Mrzyglod  


[dpdk-dev] [PATCH v5 00/11] ip_pipeline: ip_pipeline application enhancements

2015-07-06 Thread Mrzyglod, DanielX T
NACK 
ICC Compilation Errors:


Pipeline/pipeline_routing_be.c:
/mnt/shared/dtmrzglx/dpdk_pipeline/examples/ip_pipeline/pipeline/pipeline_routing_be.c(740):
 error #188: enumerated type mixed with another type
.flags = 0,
 ^
ICC wants name like PIPELINE_ROUTING_ROUTE_LOCAL but got number instead.

Pipeline/Pipeline_routing.c:
/mnt/shared/dtmrzglx/dpdk_pipeline/examples/ip_pipeline/pipeline/pipeline_routing.c(851):
 error #188: enumerated type mixed with another type
rt_params.flags = 0; /* remote route */
^

The problem is that the value of PIPELINE_ROUTING_ROUTE_LOCAL is 1.

After this change it looks ok. 
Solution:
We need add another enum:
PIPELINE_ROUTING_ROUTE_REMOTE


ICC_I686:
Init.c:
/mnt/shared/dtmrzglx/dpdk_pipeline/examples/ip_pipeline/init.c(90): error #181: 
argument of type "uint64_t={unsigned long long}" is incompatible with format 
"%016lx", expecting argument of type "unsigned long"
APP_LOG(app, HIGH, "CPU core mask = 0x%016lx", app->core_mask);
^

/mnt/shared/dtmrzglx/dpdk_pipeline/examples/ip_pipeline/init.c(103): error 
#181: argument of type "uint64_t={unsigned long long}" is incompatible with 
format "%lx", expecting argument of type "unsigned long"
snprintf(buffer, sizeof(buffer), "-c%lx", app->core_mask);
  ^

pipeline_common_fe:
/mnt/shared/dtmrzglx/dpdk_pipeline/examples/ip_pipeline/pipeline/pipeline_common_fe.c(525):
 error #181: argument of type "uint64_t={unsigned long long}" is incompatible 
with format "%lu", expecting argument of type "unsigned long"
stats.stats.n_pkts_in,
^

/mnt/shared/dtmrzglx/dpdk_pipeline/examples/ip_pipeline/pipeline/pipeline_common_fe.c(526):
 error #181: argument of type "uint64_t={unsigned long long}" is incompatible 
with format "%lu", expecting argument of type "unsigned long"
stats.n_pkts_dropped_by_ah,
^

/mnt/shared/dtmrzglx/dpdk_pipeline/examples/ip_pipeline/pipeline/pipeline_common_fe.c(527):
 error #181: argument of type "uint64_t={unsigned long long}" is incompatible 
with format "%lu", expecting argument of type "unsigned long"
stats.stats.n_pkts_drop);
^

/mnt/shared/dtmrzglx/dpdk_pipeline/examples/ip_pipeline/pipeline/pipeline_common_fe.c(611):
 error #181: argument of type "uint64_t={unsigned long long}" is incompatible 
with format "%lu", expecting argument of type "unsigned long"
stats.stats.n_pkts_in,
^

/mnt/shared/dtmrzglx/dpdk_pipeline/examples/ip_pipeline/pipeline/pipeline_common_fe.c(612):
 error #181: argument of type "uint64_t={unsigned long long}" is incompatible 
with format "%lu", expecting argument of type "unsigned long"
stats.n_pkts_dropped_by_ah,
^

/mnt/shared/dtmrzglx/dpdk_pipeline/examples/ip_pipeline/pipeline/pipeline_common_fe.c(613):
 error #181: argument of type "uint64_t={unsigned long long}" is incompatible 
with format "%lu", expecting argument of type "unsigned long"
stats.stats.n_pkts_drop);
^

/mnt/shared/dtmrzglx/dpdk_pipeline/examples/ip_pipeline/pipeline/pipeline_common_fe.c(698):
 error #181: argument of type "uint64_t={unsigned long long}" is incompatible 
with format "%lu", expecting argument of type "unsigned long"
stats.stats.n_pkts_in,
^

/mnt/shared/dtmrzglx/dpdk_pipeline/examples/ip_pipeline/pipeline/pipeline_common_fe.c(699):
 error #181: argument of type "uint64_t={unsigned long long}" is incompatible 
with format "%lu", expecting argument of type "unsigned long"
stats.stats.n_pkts_lookup_miss,
^

/mnt/shared/dtmrzglx/dpdk_pipeline/examples/ip_pipeline/pipeline/pipeline_common_fe.c(700):
 error #181: argument of type "uint64_t={unsigned long long}" is incompatible 
with format "%lu", expecting argument of type "unsigned long"
stats.n_pkts_dropped_by_lkp_hit_ah,
^

/mnt/shared/dtmrzglx/dpdk_pipeline/examples/ip_pipeline/pipeline/pipeline_common_fe.c(701):
 error #181: argument of type "uint64_t={unsigned long long}" is incompatible 
with format "%lu", expecting argument of type "unsigned long"
stats.n_pkts_dropped_lkp_hit,
^

/mnt/shared/dtmrzglx/dpdk_pipeline/examples/ip_pipeline/pipeline/pipeline_common_fe.c(702):
 error #181: argument of type "uint64_t={unsigned long long}" is incompatible 
with format "%lu", expecting argument of type "unsigned long"
stats.n_pkts_dropped_by_lkp_miss_ah,
^

/mnt/shared/dtmrzglx/dpdk_pipeline/examples/ip_pipeline/pipeline/pipeline_common_fe.c(703):
 error #181: argument of type "uint64_t={unsigned long long}" is incompatible 
with format "%lu", expecting argument of type "unsigned long"
stats.n_pkts_dropped_lkp_miss);
^

[dpdk-dev] [PATCH] cfgfile: Fix for Reading Files on nfs filesystem.

2015-06-26 Thread Mrzyglod, DanielX T


> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Daniel Mrzyglod
> Sent: Wednesday, June 24, 2015 6:16 PM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH] cfgfile: Fix for Reading Files on nfs filesystem.
> 
> The problem occure when we have config files on NFS filesystem.
> Solution with minimal change to library is to add buffer for I/O operations.
> Without buffering there is  3-10% of faulty Reading from NFS.
> 
> The problem seems to be only NFS filesystem.
> 
> Signed-off-by: Daniel Mrzyglod 
> ---
>  lib/librte_cfgfile/rte_cfgfile.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/lib/librte_cfgfile/rte_cfgfile.c 
> b/lib/librte_cfgfile/rte_cfgfile.c
> index b81c273..6105e0c 100644
> --- a/lib/librte_cfgfile/rte_cfgfile.c
> +++ b/lib/librte_cfgfile/rte_cfgfile.c
> @@ -93,10 +93,13 @@ rte_cfgfile_load(const char *filename, int flags)
>   int curr_section = -1;
>   int curr_entry = -1;
>   char buffer[256];
> + char f_streambuff[BUFSIZ];
>   int lineno = 0;
>   struct rte_cfgfile *cfg = NULL;
> + memset(f_streambuff,'\0',BUFSIZ);
> 
>   FILE *f = fopen(filename, "r");
> + setbuf( f, f_streambuff);
>   if (f == NULL)
>   return NULL;
> 
> --
> 2.1.0

Self NACK



[dpdk-dev] [PATCH] x32 ABI support, first iteration

2014-11-13 Thread Mrzyglod, DanielX T

This patch provides support for x32 ABI.
x32 ABI provides benefits of x86-64 while using 32-bit pointers and avoiding 
overhead of 64-bit pointers.

Daniel Mrzyglod (1):
Konstantin Ananyev(1):
  x32 ABI support, first iteration

 config/defconfig_x86_x32-native-linuxapp-gcc | 46 
 mk/arch/x86_x32/rte.vars.mk  | 63 
 2 files changed, 109 insertions(+)
 create mode 100644 config/defconfig_x86_x32-native-linuxapp-gcc
 create mode 100644 mk/arch/x86_x32/rte.vars.mk

--
2.1.0



[dpdk-dev] [PATCH] Modify tools/setup.sh to be compatible with fedora 21

2014-10-08 Thread Mrzyglod, DanielX T
Section From: should be 
From: Daniel Mrzyglod <danielx.t.mrzyg...@intel.com>. 

error due to setting fedora 21 alpha on the new machine
> -Original Message-
> From: Mrzyglod, DanielX T
> Sent: Wednesday, October 08, 2014 3:12 PM
> To: dev at dpdk.org
> Cc: Daniel Mrzyglod; Mrzyglod, DanielX T
> Subject: [PATCH] Modify tools/setup.sh to be compatible with fedora 21
> 
> From: Daniel Mrzyglod 
> 
> script was expecting /lib/modules/$(uname -r)/kernel/drivers/uio/uio.ko but in
> fedora 21
> there are Compressed kernel modules - xz (LZMA)
> 
> Signed-off-by: Daniel Mrzyglod 
> ---
>  tools/setup.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/setup.sh b/tools/setup.sh
> index 369e09e..6a9d23c 100755
> --- a/tools/setup.sh
> +++ b/tools/setup.sh
> @@ -169,7 +169,7 @@ load_igb_uio_module()
> 
>   /sbin/lsmod | grep -s uio > /dev/null
>   if [ $? -ne 0 ] ; then
> - if [ -f /lib/modules/$(uname -r)/kernel/drivers/uio/uio.ko ] ;
> then
> + if ls /lib/modules/$(uname -r)/kernel/drivers/uio/uio.ko* &>
> /dev/null; then
>   echo "Loading uio module"
>   sudo /sbin/modprobe uio
>   fi
> --
> 2.1.0





[dpdk-dev] [PATCH v2] ADD mode 5(tlb) to link bonding pmd

2014-09-29 Thread Mrzyglod, DanielX T
Add this Release note
This patch set adds support of mode 5 to link bonding pmd

This patchset depend on  Declan Doherty patch set:
http://dpdk.org/ml/archives/dev/2014-September/005641.html

v2 change:
Add Unit Tests
Modification that updates obytes structure in virtualpmd driver.
change internals->slaves[i].last_obytes to have proper values.
Update codebase to Declan's patches.

v1 change
Add support for mode 5 (Transmit load balancing) into pmd driver

> -Original Message-
> From: Mrzyglod, DanielX T
> Sent: Friday, September 26, 2014 5:41 PM
> To: dev at dpdk.org
> Cc: Mrzyglod, DanielX T
> Subject: [PATCH v2] ADD mode 5(tlb) to link bonding pmd
> 
> 
> Signed-off-by: Daniel Mrzyglod 
> ---
>  app/test/test_link_bonding.c   |  501 
> +++-
>  app/test/virtual_pmd.c |6 +-
>  app/test/virtual_pmd.h |7 +
>  lib/librte_pmd_bond/rte_eth_bond.h |   23 ++
>  lib/librte_pmd_bond/rte_eth_bond_args.c|1 +
>  lib/librte_pmd_bond/rte_eth_bond_pmd.c |  161 -
>  lib/librte_pmd_bond/rte_eth_bond_private.h |3 +-
>  7 files changed, 696 insertions(+), 6 deletions(-)
> 
> diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c
> index c4fcaf7..77f791f 100644
> --- a/app/test/test_link_bonding.c
> +++ b/app/test/test_link_bonding.c
> @@ -41,7 +41,7 @@
>  #include 
>  #include 
>  #include 
> -
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -3845,6 +3845,500 @@ testsuite_teardown(void)
>   return remove_slaves_and_stop_bonded_device();
>  }
> 
> +#define NINETY_PERCENT_NUMERAL 90
> +#define ONE_HUNDRED_PERCENT_DENOMINATOR 100
> +#define ONE_HUNDRED_PERCENT_AND_TEN_NUMERAL 110
> +static int
> +test_tlb_tx_burst(void)
> +{
> + int i, burst_size, nb_tx;
> + uint64_t nb_tx2 = 0;
> + struct rte_mbuf *pkt_burst[MAX_PKT_BURST];
> + struct rte_eth_stats port_stats[32];
> + uint64_t sum_ports_opackets = 0, all_bond_opackets = 0,
> all_bond_obytes = 0;
> + uint16_t pktlen;
> +
> + TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves
> +
>   (BONDING_MODE_ADAPTIVE_TRANSMIT_LOAD_BALANCING, 1, 3, 1),
> + "Failed to initialise bonded device");
> +
> + burst_size = 20 * test_params->bonded_slave_count;
> +
> + TEST_ASSERT(burst_size < MAX_PKT_BURST,
> + "Burst size specified is greater than supported.\n");
> +
> +
> + /* Generate 40 test bursts in 2s of packets to transmit  */
> + for (i = 0; i < 40; i++) {
> + /*test two types of mac src own(bonding) and others */
> + if (i % 2 == 0) {
> + initialize_eth_header(test_params->pkt_eth_hdr,
> + (struct ether_addr *)src_mac, (struct
> ether_addr *)dst_mac_0, 0, 0);
> + } else {
> + initialize_eth_header(test_params->pkt_eth_hdr,
> + (struct ether_addr *)test_params-
> >default_slave_mac,
> + (struct ether_addr *)dst_mac_0, 0, 0);
> + }
> + pktlen = initialize_udp_header(test_params->pkt_udp_hdr,
> src_port,
> + dst_port_0, 16);
> + pktlen = initialize_ipv4_header(test_params->pkt_ipv4_hdr,
> src_addr,
> + dst_addr_0, pktlen);
> + generate_packet_burst(test_params->mbuf_pool, pkt_burst,
> + test_params->pkt_eth_hdr, 0, test_params-
> >pkt_ipv4_hdr,
> + 1, test_params->pkt_udp_hdr, burst_size, 60,
> 1);
> + /* Send burst on bonded port */
> + nb_tx = rte_eth_tx_burst(test_params->bonded_port_id, 0,
> pkt_burst,
> + burst_size);
> + nb_tx2 += nb_tx;
> +
> + TEST_ASSERT_EQUAL(nb_tx, burst_size,
> + "number of packet not equal burst size");
> +
> + rte_delay_us(5);
> + }
> +
> +
> + /* Verify bonded port tx stats */
> + rte_eth_stats_get(test_params->bonded_port_id, _stats[0]);
> +
> + all_bond_opackets = port_stats[0].opackets;
> + all_bond_obytes = port_stats[0].obytes;
> +
> + TEST_ASSERT_EQUAL(port_stats[0].opackets, (uint64_t)nb_tx2,
> + "Bonded Port (%d) opackets value (%u) not as expected
> (%d)\n",
> + test_params->bonded_port_id, (unsigned
> int)port_stats[0].opackets,
> + burst_size);
&g