[dpdk-dev] [PATCH v6 5/8] lib/librte_pdump: add new library for packet capturing support

2016-06-09 Thread Ananyev, Konstantin


> -Original Message-
> From: Aaron Conole [mailto:aconole at redhat.com]
> Sent: Thursday, June 09, 2016 6:24 PM
> To: Ananyev, Konstantin
> Cc: Pattan, Reshma; dev at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v6 5/8] lib/librte_pdump: add new library for 
> packet capturing support
> 
> "Ananyev, Konstantin"  writes:
> 
> >> -Original Message-
> >> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Aaron Conole
> >> Sent: Thursday, June 09, 2016 4:59 PM
> >> To: Pattan, Reshma
> >> Cc: dev at dpdk.org
> >> Subject: Re: [dpdk-dev] [PATCH v6 5/8] lib/librte_pdump: add new
> > library for packet capturing support
> >>
> >> Reshma Pattan  writes:
> >>
> >> > Added new library for packet capturing support.
> >> >
> >> > Added public api rte_pdump_init, applications should call
> >> > this as part of their application setup to have packet
> >> > capturing framework ready.
> >> >
> >> > Added public api rte_pdump_uninit to uninitialize the packet
> >> > capturing framework.
> >> >
> >> > Added public apis rte_pdump_enable and rte_pdump_disable to
> >> > enable and disable packet capturing on specific port and queue.
> >> >
> >> > Added public apis rte_pdump_enable_by_deviceid and
> >> > rte_pdump_disable_by_deviceid to enable and disable packet
> >> > capturing on a specific device (pci address or name) and queue.
> >> >
> >> > Signed-off-by: Reshma Pattan 
> >> > ---
> >> > +
> >> > +int
> >> > +rte_pdump_init(void)
> >>
> >> Would you be opposed to having an argument here which takes a path to
> >> the server socket?  That way the application can have some control over
> >> the server socket location rather than using the guesses from
> >> pdump_get_socket_path.
> >
> > I suppose it is better to keep IPC mechanism details internal for the
> > pdump library.
> > That way upper layer don't need to know what is that and write the
> > code to open/maintain it.
> > Again, that gives pdump library a freedom to change it (if needed) or
> > possibly introduce some alternatives.
> > Konstantin
> >
> 
> How does the application change it?  The details do matter here, as some
> applications (ex: openvswitch) have specific policies on which files
> files get opened and where those files exist.  That has impact on things
> like selinux and other access control technology.
> 
> If I missed the API that lets apps redirect the output, please correct me,
> but so far I don't think I've missed it.  pdump still can change a
> default, but it would be good to give a method for guiding the final
> choice of file to open.

No, I think, right now it is not possible to change socket path from the API.
Basically it follows the same logic as generating path for DPDK runtime config, 
etc:
/var/run for root, or $HOME dir otherwise.
I suppose if openswitch or any other dpdk app is able to start successfully,
then it should be able to open pdump socket too, correct?

Anyway, as I understand what you suggest:

rte_pdump_init(const char *dir)
{
 If (sock_name != NULL) {/*open socket at provided dir path*/}
 else { /*generate default pathname for the socket*/

and something similar for client side, might be a new function:

rte_pdump_set_dirpath(const char *dir);

Is that right?
Konstantin

> 
> -Aaron


[dpdk-dev] [PATCH v6 5/8] lib/librte_pdump: add new library for packet capturing support

2016-06-09 Thread Ananyev, Konstantin


> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Aaron Conole
> Sent: Thursday, June 09, 2016 4:59 PM
> To: Pattan, Reshma
> Cc: dev at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v6 5/8] lib/librte_pdump: add new library for 
> packet capturing support
> 
> Reshma Pattan  writes:
> 
> > Added new library for packet capturing support.
> >
> > Added public api rte_pdump_init, applications should call
> > this as part of their application setup to have packet
> > capturing framework ready.
> >
> > Added public api rte_pdump_uninit to uninitialize the packet
> > capturing framework.
> >
> > Added public apis rte_pdump_enable and rte_pdump_disable to
> > enable and disable packet capturing on specific port and queue.
> >
> > Added public apis rte_pdump_enable_by_deviceid and
> > rte_pdump_disable_by_deviceid to enable and disable packet
> > capturing on a specific device (pci address or name) and queue.
> >
> > Signed-off-by: Reshma Pattan 
> > ---
> >  MAINTAINERS|   4 +
> >  config/common_base |   5 +
> >  lib/Makefile   |   1 +
> >  lib/librte_pdump/Makefile  |  55 +++
> >  lib/librte_pdump/rte_pdump.c   | 841 
> > +
> >  lib/librte_pdump/rte_pdump.h   | 186 
> >  lib/librte_pdump/rte_pdump_version.map |  12 +
> >  mk/rte.app.mk  |   1 +
> >  8 files changed, 1105 insertions(+)
> >  create mode 100644 lib/librte_pdump/Makefile
> >  create mode 100644 lib/librte_pdump/rte_pdump.c
> >  create mode 100644 lib/librte_pdump/rte_pdump.h
> >  create mode 100644 lib/librte_pdump/rte_pdump_version.map
> >
> > diff --git a/MAINTAINERS b/MAINTAINERS
> > index 3e8558f..cc3ffdb 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -432,6 +432,10 @@ F: app/test/test_reorder*
> >  F: examples/packet_ordering/
> >  F: doc/guides/sample_app_ug/packet_ordering.rst
> >
> > +Pdump
> > +M: Reshma Pattan 
> > +F: lib/librte_pdump/
> > +
> >  Hierarchical scheduler
> >  M: Cristian Dumitrescu 
> >  F: lib/librte_sched/
> > diff --git a/config/common_base b/config/common_base
> > index 47c26f6..a2d5d72 100644
> > --- a/config/common_base
> > +++ b/config/common_base
> > @@ -484,6 +484,11 @@ CONFIG_RTE_LIBRTE_DISTRIBUTOR=y
> >  CONFIG_RTE_LIBRTE_REORDER=y
> >
> >  #
> > +# Compile the pdump library
> > +#
> > +CONFIG_RTE_LIBRTE_PDUMP=y
> > +
> > +#
> >  # Compile librte_port
> >  #
> >  CONFIG_RTE_LIBRTE_PORT=y
> > diff --git a/lib/Makefile b/lib/Makefile
> > index f254dba..ca7c02f 100644
> > --- a/lib/Makefile
> > +++ b/lib/Makefile
> > @@ -57,6 +57,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_PORT) += librte_port
> >  DIRS-$(CONFIG_RTE_LIBRTE_TABLE) += librte_table
> >  DIRS-$(CONFIG_RTE_LIBRTE_PIPELINE) += librte_pipeline
> >  DIRS-$(CONFIG_RTE_LIBRTE_REORDER) += librte_reorder
> > +DIRS-$(CONFIG_RTE_LIBRTE_PDUMP) += librte_pdump
> >
> >  ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y)
> >  DIRS-$(CONFIG_RTE_LIBRTE_KNI) += librte_kni
> > diff --git a/lib/librte_pdump/Makefile b/lib/librte_pdump/Makefile
> > new file mode 100644
> > index 000..af81a28
> > --- /dev/null
> > +++ b/lib/librte_pdump/Makefile
> > @@ -0,0 +1,55 @@
> > +#   BSD LICENSE
> > +#
> > +#   Copyright(c) 2016 Intel Corporation. All rights reserved.
> > +#   All rights reserved.
> > +#
> > +#   Redistribution and use in source and binary forms, with or without
> > +#   modification, are permitted provided that the following conditions
> > +#   are met:
> > +#
> > +# * Redistributions of source code must retain the above copyright
> > +#   notice, this list of conditions and the following disclaimer.
> > +# * Redistributions in binary form must reproduce the above copyright
> > +#   notice, this list of conditions and the following disclaimer in
> > +#   the documentation and/or other materials provided with the
> > +#   distribution.
> > +# * Neither the name of Intel Corporation nor the names of its
> > +#   contributors may be used to endorse or promote products derived
> > +#   from this software without specific prior written permission.
> > +#
> > +#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > +#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT N

[dpdk-dev] [PATCH v6 5/8] lib/librte_pdump: add new library for packet capturing support

2016-06-09 Thread Aaron Conole
"Ananyev, Konstantin"  writes:

>> -Original Message-
>> From: Aaron Conole [mailto:aconole at redhat.com]
>> Sent: Thursday, June 09, 2016 6:24 PM
>> To: Ananyev, Konstantin
>> Cc: Pattan, Reshma; dev at dpdk.org
>> Subject: Re: [dpdk-dev] [PATCH v6 5/8] lib/librte_pdump: add new
>> library for packet capturing support
>> 
>> "Ananyev, Konstantin"  writes:
>> 
>> >> -Original Message-
>> >> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Aaron Conole
>> >> Sent: Thursday, June 09, 2016 4:59 PM
>> >> To: Pattan, Reshma
>> >> Cc: dev at dpdk.org
>> >> Subject: Re: [dpdk-dev] [PATCH v6 5/8] lib/librte_pdump: add new
>> > library for packet capturing support
>> >>
>> >> Reshma Pattan  writes:
>> >>
>> >> > Added new library for packet capturing support.
>> >> >
>> >> > Added public api rte_pdump_init, applications should call
>> >> > this as part of their application setup to have packet
>> >> > capturing framework ready.
>> >> >
>> >> > Added public api rte_pdump_uninit to uninitialize the packet
>> >> > capturing framework.
>> >> >
>> >> > Added public apis rte_pdump_enable and rte_pdump_disable to
>> >> > enable and disable packet capturing on specific port and queue.
>> >> >
>> >> > Added public apis rte_pdump_enable_by_deviceid and
>> >> > rte_pdump_disable_by_deviceid to enable and disable packet
>> >> > capturing on a specific device (pci address or name) and queue.
>> >> >
>> >> > Signed-off-by: Reshma Pattan 
>> >> > ---
>> >> > +
>> >> > +int
>> >> > +rte_pdump_init(void)
>> >>
>> >> Would you be opposed to having an argument here which takes a path to
>> >> the server socket?  That way the application can have some control over
>> >> the server socket location rather than using the guesses from
>> >> pdump_get_socket_path.
>> >
>> > I suppose it is better to keep IPC mechanism details internal for the
>> > pdump library.
>> > That way upper layer don't need to know what is that and write the
>> > code to open/maintain it.
>> > Again, that gives pdump library a freedom to change it (if needed) or
>> > possibly introduce some alternatives.
>> > Konstantin
>> >
>> 
>> How does the application change it?  The details do matter here, as some
>> applications (ex: openvswitch) have specific policies on which files
>> files get opened and where those files exist.  That has impact on things
>> like selinux and other access control technology.
>> 
>> If I missed the API that lets apps redirect the output, please correct me,
>> but so far I don't think I've missed it.  pdump still can change a
>> default, but it would be good to give a method for guiding the final
>> choice of file to open.
>
> No, I think, right now it is not possible to change socket path from the API.
> Basically it follows the same logic as generating path for DPDK
> runtime config, etc:
> /var/run for root, or $HOME dir otherwise.
> I suppose if openswitch or any other dpdk app is able to start successfully,
> then it should be able to open pdump socket too, correct?
>
> Anyway, as I understand what you suggest:
>
> rte_pdump_init(const char *dir)
> {
>  If (sock_name != NULL) {/*open socket at provided dir path*/}
>  else { /*generate default pathname for the socket*/
>
> and something similar for client side, might be a new function:
>
> rte_pdump_set_dirpath(const char *dir);
>
> Is that right?

Something like that, yes.

> Konstantin
>  
>> 
>> -Aaron


[dpdk-dev] [PATCH v6 5/8] lib/librte_pdump: add new library for packet capturing support

2016-06-09 Thread Aaron Conole
"Ananyev, Konstantin"  writes:

>> -Original Message-
>> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Aaron Conole
>> Sent: Thursday, June 09, 2016 4:59 PM
>> To: Pattan, Reshma
>> Cc: dev at dpdk.org
>> Subject: Re: [dpdk-dev] [PATCH v6 5/8] lib/librte_pdump: add new
> library for packet capturing support
>> 
>> Reshma Pattan  writes:
>> 
>> > Added new library for packet capturing support.
>> >
>> > Added public api rte_pdump_init, applications should call
>> > this as part of their application setup to have packet
>> > capturing framework ready.
>> >
>> > Added public api rte_pdump_uninit to uninitialize the packet
>> > capturing framework.
>> >
>> > Added public apis rte_pdump_enable and rte_pdump_disable to
>> > enable and disable packet capturing on specific port and queue.
>> >
>> > Added public apis rte_pdump_enable_by_deviceid and
>> > rte_pdump_disable_by_deviceid to enable and disable packet
>> > capturing on a specific device (pci address or name) and queue.
>> >
>> > Signed-off-by: Reshma Pattan 
>> > ---
>> > +
>> > +int
>> > +rte_pdump_init(void)
>> 
>> Would you be opposed to having an argument here which takes a path to
>> the server socket?  That way the application can have some control over
>> the server socket location rather than using the guesses from
>> pdump_get_socket_path.
>
> I suppose it is better to keep IPC mechanism details internal for the
> pdump library.
> That way upper layer don't need to know what is that and write the
> code to open/maintain it.
> Again, that gives pdump library a freedom to change it (if needed) or
> possibly introduce some alternatives.
> Konstantin
>

How does the application change it?  The details do matter here, as some
applications (ex: openvswitch) have specific policies on which files
files get opened and where those files exist.  That has impact on things
like selinux and other access control technology.

If I missed the API that lets apps redirect the output, please correct me,
but so far I don't think I've missed it.  pdump still can change a
default, but it would be good to give a method for guiding the final
choice of file to open.

-Aaron


[dpdk-dev] [PATCH v6 5/8] lib/librte_pdump: add new library for packet capturing support

2016-06-09 Thread Aaron Conole
Reshma Pattan  writes:

> Added new library for packet capturing support.
>
> Added public api rte_pdump_init, applications should call
> this as part of their application setup to have packet
> capturing framework ready.
>
> Added public api rte_pdump_uninit to uninitialize the packet
> capturing framework.
>
> Added public apis rte_pdump_enable and rte_pdump_disable to
> enable and disable packet capturing on specific port and queue.
>
> Added public apis rte_pdump_enable_by_deviceid and
> rte_pdump_disable_by_deviceid to enable and disable packet
> capturing on a specific device (pci address or name) and queue.
>
> Signed-off-by: Reshma Pattan 
> ---
>  MAINTAINERS|   4 +
>  config/common_base |   5 +
>  lib/Makefile   |   1 +
>  lib/librte_pdump/Makefile  |  55 +++
>  lib/librte_pdump/rte_pdump.c   | 841 
> +
>  lib/librte_pdump/rte_pdump.h   | 186 
>  lib/librte_pdump/rte_pdump_version.map |  12 +
>  mk/rte.app.mk  |   1 +
>  8 files changed, 1105 insertions(+)
>  create mode 100644 lib/librte_pdump/Makefile
>  create mode 100644 lib/librte_pdump/rte_pdump.c
>  create mode 100644 lib/librte_pdump/rte_pdump.h
>  create mode 100644 lib/librte_pdump/rte_pdump_version.map
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 3e8558f..cc3ffdb 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -432,6 +432,10 @@ F: app/test/test_reorder*
>  F: examples/packet_ordering/
>  F: doc/guides/sample_app_ug/packet_ordering.rst
>  
> +Pdump
> +M: Reshma Pattan 
> +F: lib/librte_pdump/
> +
>  Hierarchical scheduler
>  M: Cristian Dumitrescu 
>  F: lib/librte_sched/
> diff --git a/config/common_base b/config/common_base
> index 47c26f6..a2d5d72 100644
> --- a/config/common_base
> +++ b/config/common_base
> @@ -484,6 +484,11 @@ CONFIG_RTE_LIBRTE_DISTRIBUTOR=y
>  CONFIG_RTE_LIBRTE_REORDER=y
>  
>  #
> +# Compile the pdump library
> +#
> +CONFIG_RTE_LIBRTE_PDUMP=y
> +
> +#
>  # Compile librte_port
>  #
>  CONFIG_RTE_LIBRTE_PORT=y
> diff --git a/lib/Makefile b/lib/Makefile
> index f254dba..ca7c02f 100644
> --- a/lib/Makefile
> +++ b/lib/Makefile
> @@ -57,6 +57,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_PORT) += librte_port
>  DIRS-$(CONFIG_RTE_LIBRTE_TABLE) += librte_table
>  DIRS-$(CONFIG_RTE_LIBRTE_PIPELINE) += librte_pipeline
>  DIRS-$(CONFIG_RTE_LIBRTE_REORDER) += librte_reorder
> +DIRS-$(CONFIG_RTE_LIBRTE_PDUMP) += librte_pdump
>  
>  ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y)
>  DIRS-$(CONFIG_RTE_LIBRTE_KNI) += librte_kni
> diff --git a/lib/librte_pdump/Makefile b/lib/librte_pdump/Makefile
> new file mode 100644
> index 000..af81a28
> --- /dev/null
> +++ b/lib/librte_pdump/Makefile
> @@ -0,0 +1,55 @@
> +#   BSD LICENSE
> +#
> +#   Copyright(c) 2016 Intel Corporation. All rights reserved.
> +#   All rights reserved.
> +#
> +#   Redistribution and use in source and binary forms, with or without
> +#   modification, are permitted provided that the following conditions
> +#   are met:
> +#
> +# * Redistributions of source code must retain the above copyright
> +#   notice, this list of conditions and the following disclaimer.
> +# * Redistributions in binary form must reproduce the above copyright
> +#   notice, this list of conditions and the following disclaimer in
> +#   the documentation and/or other materials provided with the
> +#   distribution.
> +# * Neither the name of Intel Corporation nor the names of its
> +#   contributors may be used to endorse or promote products derived
> +#   from this software without specific prior written permission.
> +#
> +#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> +#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> +#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> +#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
> +#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> +#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> +#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> +#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> +#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> +#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
> +#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> +
> +include $(RTE_SDK)/mk/rte.vars.mk
> +
> +# library name
> +LIB = librte_pdump.a
> +
> +CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
> +CFLAGS += -D_GNU_SOURCE
> +
> +EXPORT_MAP := rte_pdump_version.map
> +
> +LIBABIVER := 1
> +
> +# all source are stored in SRCS-y
> +SRCS-$(CONFIG_RTE_LIBRTE_PDUMP) := rte_pdump.c
> +
> +# install this header file
> +SYMLINK-$(CONFIG_RTE_LIBRTE_PDUMP)-include := rte_pdump.h
> +
> +# this lib depends upon:
> 

[dpdk-dev] [PATCH v6 5/8] lib/librte_pdump: add new library for packet capturing support

2016-06-09 Thread Reshma Pattan
Added new library for packet capturing support.

Added public api rte_pdump_init, applications should call
this as part of their application setup to have packet
capturing framework ready.

Added public api rte_pdump_uninit to uninitialize the packet
capturing framework.

Added public apis rte_pdump_enable and rte_pdump_disable to
enable and disable packet capturing on specific port and queue.

Added public apis rte_pdump_enable_by_deviceid and
rte_pdump_disable_by_deviceid to enable and disable packet
capturing on a specific device (pci address or name) and queue.

Signed-off-by: Reshma Pattan 
---
 MAINTAINERS|   4 +
 config/common_base |   5 +
 lib/Makefile   |   1 +
 lib/librte_pdump/Makefile  |  55 +++
 lib/librte_pdump/rte_pdump.c   | 841 +
 lib/librte_pdump/rte_pdump.h   | 186 
 lib/librte_pdump/rte_pdump_version.map |  12 +
 mk/rte.app.mk  |   1 +
 8 files changed, 1105 insertions(+)
 create mode 100644 lib/librte_pdump/Makefile
 create mode 100644 lib/librte_pdump/rte_pdump.c
 create mode 100644 lib/librte_pdump/rte_pdump.h
 create mode 100644 lib/librte_pdump/rte_pdump_version.map

diff --git a/MAINTAINERS b/MAINTAINERS
index 3e8558f..cc3ffdb 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -432,6 +432,10 @@ F: app/test/test_reorder*
 F: examples/packet_ordering/
 F: doc/guides/sample_app_ug/packet_ordering.rst

+Pdump
+M: Reshma Pattan 
+F: lib/librte_pdump/
+
 Hierarchical scheduler
 M: Cristian Dumitrescu 
 F: lib/librte_sched/
diff --git a/config/common_base b/config/common_base
index 47c26f6..a2d5d72 100644
--- a/config/common_base
+++ b/config/common_base
@@ -484,6 +484,11 @@ CONFIG_RTE_LIBRTE_DISTRIBUTOR=y
 CONFIG_RTE_LIBRTE_REORDER=y

 #
+# Compile the pdump library
+#
+CONFIG_RTE_LIBRTE_PDUMP=y
+
+#
 # Compile librte_port
 #
 CONFIG_RTE_LIBRTE_PORT=y
diff --git a/lib/Makefile b/lib/Makefile
index f254dba..ca7c02f 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -57,6 +57,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_PORT) += librte_port
 DIRS-$(CONFIG_RTE_LIBRTE_TABLE) += librte_table
 DIRS-$(CONFIG_RTE_LIBRTE_PIPELINE) += librte_pipeline
 DIRS-$(CONFIG_RTE_LIBRTE_REORDER) += librte_reorder
+DIRS-$(CONFIG_RTE_LIBRTE_PDUMP) += librte_pdump

 ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y)
 DIRS-$(CONFIG_RTE_LIBRTE_KNI) += librte_kni
diff --git a/lib/librte_pdump/Makefile b/lib/librte_pdump/Makefile
new file mode 100644
index 000..af81a28
--- /dev/null
+++ b/lib/librte_pdump/Makefile
@@ -0,0 +1,55 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2016 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# * Neither the name of Intel Corporation nor the names of its
+#   contributors may be used to endorse or promote products derived
+#   from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+# library name
+LIB = librte_pdump.a
+
+CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
+CFLAGS += -D_GNU_SOURCE
+
+EXPORT_MAP := rte_pdump_version.map
+
+LIBABIVER := 1
+
+# all source are stored in SRCS-y
+SRCS-$(CONFIG_RTE_LIBRTE_PDUMP) := rte_pdump.c
+
+# install this header file
+SYMLINK-$(CONFIG_RTE_LIBRTE_PDUMP)-include := rte_pdump.h
+
+# this lib depends upon:
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PDUMP) += lib/librte_mbuf
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PDUMP) += lib/librte_eal
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PDUMP) += lib/librte_ether
+
+include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/lib/librte_pdump/rte_pdump.c b/lib/librte_pdump/rte_pdump.c
new file mode 100644
index