Skip to contentSkip to conversation

pktdev as wrapper type

RFC PATCH In review Bruce Richardson 5 participants 19 messages May 11, 2015 – Jun 10, 2015 Library code

lore
Share & tools
lore
#0 lore raw

v2 cover pktdev as wrapper type

Hi all,

after a small amount of offline discussion with Marc Sune, here is an alternative proposal for a higher-level interface - aka pktdev - to allow a common Rx/Tx API across device types handling mbufs [for now, ethdev, ring and KNI]. The key code is in the first patch fo the set - the second is an example of a trivial usecase.

What is different about this to previously:
* wrapper class, so no changes to any existing ring, ethdev implementations
* use of function pointers for RX/TX with an API that maps to ethdev
- this means there is little/no additional overhead for ethdev calls
- inline special case for rings, to accelerate that. Since we are at a higher level, we can special case process some things if appropriate. This means the impact to ring ops is one (predictable) branch per burst
* elimination of the queue abstraction. For the ring and KNI, there is no concept of queues, so we just wrap the functions directly (no need even for wrapper functions, the api's match so we can call directly). This also means:
- adding in features per-queue, is far easier as we don't need to worry about having arrays of multiple queues. For example:
- adding in buffering on TX (or RX) is easier since again we only have a single queue.
* thread safety is made easier using a wrapper. For a MP ring, we can create multiple pktdevs around it, and each thread will then be able to use their own copy, with their own buffering etc.

However, at this point, I'm just looking for general feedback on this as an approach. I think it's quite flexible - even more so than the earlier proposal we had. It's less proscriptive and doesn't make any demands on any other libs.

Comments/thoughts welcome.

Bruce Richardson (2):
Add example pktdev implementation
example app showing pktdevs used in a chain

 config/common_bsdapp           |   5 +
 config/common_linuxapp         |   5 +
 examples/pktdev/Makefile       |  57 +++++++++++
 examples/pktdev/basicfwd.c     | 221 +++++++++++++++++++++++++++++++++++++++++
 lib/Makefile                   |   1 +
 lib/librte_pktdev/Makefile     |  53 ++++++++++
 lib/librte_pktdev/rte_pktdev.h | 200 +++++++++++++++++++++++++++++++++++++
 7 files changed, 542 insertions(+)
 create mode 100644 examples/pktdev/Makefile
 create mode 100644 examples/pktdev/basicfwd.c
 create mode 100644 lib/librte_pktdev/Makefile
 create mode 100644 lib/librte_pktdev/rte_pktdev.h
Signature · 1 line
2.1.0
#1 lore raw

RFC PATCH v2 1/2 Add example pktdev implementation

This commit demonstrates what a minimal API for all packet handling might look like. It provides common APIs for RX and TX, by wrapping the types as appropriate. Implementations provided for ring, ethdev and kni.

---
 config/common_bsdapp           |   5 ++
 config/common_linuxapp         |   5 ++
 lib/Makefile                   |   1 +
 lib/librte_pktdev/Makefile     |  53 +++++++++++
 lib/librte_pktdev/rte_pktdev.h | 200 +++++++++++++++++++++++++++++++++++++++++
 5 files changed, 264 insertions(+)
 create mode 100644 lib/librte_pktdev/Makefile
 create mode 100644 lib/librte_pktdev/rte_pktdev.h
config/common_bsdapp +5 -0
index c2374c0..64fcdc8 100644
@@ -132,6 +132,11 @@ CONFIG_RTE_LIBRTE_EAL_VMWARE_TSC_MAP_SUPPORT=y
 CONFIG_RTE_LIBRTE_KVARGS=y
 
 #
+# Compile generic packet handling device library
+#
+CONFIG_RTE_LIBRTE_PKTDEV=y
+
+#
 # Compile generic ethernet library
 #
 CONFIG_RTE_LIBRTE_ETHER=y
config/common_linuxapp +5 -0
index 0078dc9..399f15d 100644
@@ -129,6 +129,11 @@ CONFIG_RTE_LIBRTE_EAL_VMWARE_TSC_MAP_SUPPORT=y
 CONFIG_RTE_LIBRTE_KVARGS=y
 
 #
+# Compile generic packet handling device library
+#
+CONFIG_RTE_LIBRTE_PKTDEV=y
+
+#
 # Compile generic ethernet library
 #
 CONFIG_RTE_LIBRTE_ETHER=y
lib/Makefile +1 -0
index d94355d..4db5ee0 100644
@@ -32,6 +32,7 @@
 include $(RTE_SDK)/mk/rte.vars.mk
 
 DIRS-y += librte_compat
+DIRS-$(CONFIG_RTE_LIBRTE_PKTDEV) += librte_pktdev
 DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal
 DIRS-$(CONFIG_RTE_LIBRTE_MALLOC) += librte_malloc
 DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring
lib/librte_pktdev/Makefile new file +53 -0

53 lines not on this page · raw message

lib/librte_pktdev/rte_pktdev.h new file +200 -0

200 lines not on this page · raw message

Signature · 1 line
2.1.0
#2 lore raw

RFC PATCH v2 2/2 example app showing pktdevs used in a chain

In reply to Bruce Richardson

This is a trivial example showing code which is using ethdevs and rings in a neutral manner, with the same piece of pipeline code passing mbufs along a chain without ever having to query its source or destination type.

---
 examples/pktdev/Makefile   |  57 ++++++++++++
 examples/pktdev/basicfwd.c | 221 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 278 insertions(+)
 create mode 100644 examples/pktdev/Makefile
 create mode 100644 examples/pktdev/basicfwd.c
examples/pktdev/Makefile new file +57 -0
new file mode 100644
index 0000000..4a5d99f
@@ -0,0 +1,57 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2010-2014 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.
+
+ifeq ($(RTE_SDK),)
+$(error "Please define RTE_SDK environment variable")
+endif
+
+# Default target, can be overridden by command line or environment
+RTE_TARGET ?= x86_64-native-linuxapp-gcc
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+# binary name
+APP = basicfwd
+
+# all source are stored in SRCS-y
+SRCS-y := basicfwd.c
+
+CFLAGS += $(WERROR_FLAGS)
+
+# workaround for a gcc bug with noreturn attribute
+# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
+ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
+CFLAGS_main.o += -Wno-return-type
+endif
+
+EXTRA_CFLAGS += -O3 -g -Wfatal-errors
+
+include $(RTE_SDK)/mk/rte.extapp.mk
examples/pktdev/basicfwd.c new file +221 -0

221 lines not on this page · raw message

Signature · 1 line
2.1.0
#3 lore raw
In reply to Bruce Richardson
Quoted 31 lines · Bruce Richardson

Hi all,

after a small amount of offline discussion with Marc Sune, here is an alternative proposal for a higher-level interface - aka pktdev - to allow a common Rx/Tx API across device types handling mbufs [for now, ethdev, ring and KNI]. The key code is in the first patch fo the set - the second is an example of a trivial usecase.

What is different about this to previously:
* wrapper class, so no changes to any existing ring, ethdev implementations
* use of function pointers for RX/TX with an API that maps to ethdev
- this means there is little/no additional overhead for ethdev calls
- inline special case for rings, to accelerate that. Since we are at a higher level, we can special case process some things if appropriate. This means the impact to ring ops is one (predictable) branch per burst
* elimination of the queue abstraction. For the ring and KNI, there is no concept of queues, so we just wrap the functions directly (no need even for wrapper functions, the api's match so we can call directly). This also means:
- adding in features per-queue, is far easier as we don't need to worry about having arrays of multiple queues. For example:
- adding in buffering on TX (or RX) is easier since again we only have a single queue.
* thread safety is made easier using a wrapper. For a MP ring, we can create multiple pktdevs around it, and each thread will then be able to use their own copy, with their own buffering etc.

However, at this point, I'm just looking for general feedback on this as an approach. I think it's quite flexible - even more so than the earlier proposal we had. It's less proscriptive and doesn't make any demands on any other libs.

Quoted 6 lines

Comments/thoughts welcome.

Bruce Richardson (2):
Add example pktdev implementation
example app showing pktdevs used in a chain

Any comments on this RFC before I see about investing further time in it to clean it up a bit and submit as a non-RFC patchset for merge in 2.1?

/Bruce

#4 lore raw

It looks fine to me.

Quoted 59 lines · Bruce
Quoted 46 lines · Bruce Richardson

Hi all,

after a small amount of offline discussion with Marc Sune, here is an alternative proposal for a higher-level interface - aka pktdev - to allow a
common Rx/Tx API across device types handling mbufs [for now, ethdev, ring
and KNI]. The key code is in the first patch fo the set - the second is an
example of a trivial usecase.

What is different about this to previously:
* wrapper class, so no changes to any existing ring, ethdev implementations
* use of function pointers for RX/TX with an API that maps to ethdev
- this means there is little/no additional overhead for ethdev calls
- inline special case for rings, to accelerate that. Since we are at
a
higher level, we can special case process some things if
appropriate. This
means the impact to ring ops is one (predictable) branch per burst
* elimination of the queue abstraction. For the ring and KNI, there is no
concept of queues, so we just wrap the functions directly (no need
even for
wrapper functions, the api's match so we can call directly). This also means:
- adding in features per-queue, is far easier as we don't need to
worry about
having arrays of multiple queues. For example:
- adding in buffering on TX (or RX) is easier since again we only
have a
single queue.
* thread safety is made easier using a wrapper. For a MP ring, we can create
multiple pktdevs around it, and each thread will then be able to use
their
own copy, with their own buffering etc.

However, at this point, I'm just looking for general feedback on this as an
approach. I think it's quite flexible - even more so than the earlier proposal
we had. It's less proscriptive and doesn't make any demands on any other libs.

Quoted 6 lines

Comments/thoughts welcome.

Bruce Richardson (2):
Add example pktdev implementation
example app showing pktdevs used in a chain

Any comments on this RFC before I see about investing further time in it to clean
it up a bit and submit as a non-RFC patchset for merge in 2.1?

/Bruce

#5 lore raw
In reply to Bruce Richardson

2015-05-19 12:31, Bruce Richardson:

Quoted 28 lines · Bruce Richardson
Quoted 27 lines

Hi all,

after a small amount of offline discussion with Marc Sune, here is an alternative proposal for a higher-level interface - aka pktdev - to allow a common Rx/Tx API across device types handling mbufs [for now, ethdev, ring and KNI]. The key code is in the first patch fo the set - the second is an example of a trivial usecase.

What is different about this to previously:
* wrapper class, so no changes to any existing ring, ethdev implementations
* use of function pointers for RX/TX with an API that maps to ethdev
- this means there is little/no additional overhead for ethdev calls
- inline special case for rings, to accelerate that. Since we are at a higher level, we can special case process some things if appropriate. This means the impact to ring ops is one (predictable) branch per burst
* elimination of the queue abstraction. For the ring and KNI, there is no concept of queues, so we just wrap the functions directly (no need even for wrapper functions, the api's match so we can call directly). This also means:
- adding in features per-queue, is far easier as we don't need to worry about having arrays of multiple queues. For example:
- adding in buffering on TX (or RX) is easier since again we only have a single queue.
* thread safety is made easier using a wrapper. For a MP ring, we can create multiple pktdevs around it, and each thread will then be able to use their own copy, with their own buffering etc.

Quoted 8 lines
Quoted 5 lines

However, at this point, I'm just looking for general feedback on this as an approach. I think it's quite flexible - even more so than the earlier proposal we had. It's less proscriptive and doesn't make any demands on any other libs.

Comments/thoughts welcome.

Any comments on this RFC before I see about investing further time in it to clean it up a bit and submit as a non-RFC patchset for merge in 2.1?

I would say there are 2 possible approaches for KNI and ring handling:
1/ You Bruce, Marc and Keith are advocating for a layer on top of ethdev, ring, KNI and possibly other devices, which uses mbuf. The set of functions is simpler than ethdev but the data structure is mbuf which is related to ethdev layer.
2/ Konstantin and Neil talked about keeping mbuf for ethdev layer and related libs only. Ring and KNI could have an ethdev API with a reduced set of implemented functions. Crypto devices could adopt a specific crypto API and an ethdev API at the same time.

I feel it's cleaner, more generic and more maintainable to have drivers implementing one or several stable APIs instead of having some restricted wrappers to update.

Comments are welcome.

#6 lore raw
Quoted 36 lines · Thomas Monjalon

2015-05-19 12:31, Bruce Richardson:

Quoted 28 lines · Bruce Richardson
Quoted 27 lines

Hi all,

after a small amount of offline discussion with Marc Sune, here is an alternative proposal for a higher-level interface - aka pktdev - to allow a common Rx/Tx API across device types handling mbufs [for now, ethdev, ring and KNI]. The key code is in the first patch fo the set - the second is an example of a trivial usecase.

What is different about this to previously:
* wrapper class, so no changes to any existing ring, ethdev implementations
* use of function pointers for RX/TX with an API that maps to ethdev
- this means there is little/no additional overhead for ethdev calls
- inline special case for rings, to accelerate that. Since we are at a higher level, we can special case process some things if appropriate. This means the impact to ring ops is one (predictable) branch per burst
* elimination of the queue abstraction. For the ring and KNI, there is no concept of queues, so we just wrap the functions directly (no need even for wrapper functions, the api's match so we can call directly). This also means:
- adding in features per-queue, is far easier as we don't need to worry about having arrays of multiple queues. For example:
- adding in buffering on TX (or RX) is easier since again we only have a single queue.
* thread safety is made easier using a wrapper. For a MP ring, we can create multiple pktdevs around it, and each thread will then be able to use their own copy, with their own buffering etc.

Quoted 7 lines
Quoted 5 lines

However, at this point, I'm just looking for general feedback on this as an approach. I think it's quite flexible - even more so than the earlier proposal we had. It's less proscriptive and doesn't make any demands on any other libs.

Comments/thoughts welcome.

Any comments on this RFC before I see about investing further time in it to clean it up a bit and submit as a non-RFC patchset for merge in 2.1?

Quoted 9 lines

I would say there are 2 possible approaches for KNI and ring handling:
1/ You Bruce, Marc and Keith are advocating for a layer on top of ethdev, ring, KNI and possibly other devices, which uses mbuf. The set of functions is simpler than ethdev but the data structure is mbuf which is related to ethdev layer.
2/ Konstantin and Neil talked about keeping mbuf for ethdev layer and related libs only. Ring and KNI could have an ethdev API with a reduced set of implemented functions. Crypto devices could adopt a specific crypto API and an ethdev API at the same time.

I don't fully understand which APIs you meant by non-ethdev. This pktdev wrapper proposal abstracts RX and TX functions only, and all of these are using mbufs as the packet buffer abstraction right now anyway (ethdev).

This approach does not preclude that different libraries expose other API calls. In fact they will have to; setup the port/device ... It is just a higher level API, so that you don't have to check the type of port in your DPDK application I/O loop, minimizing user's code.

Or were you in 2) thinking about creating a different "packet buffer" abstraction, independent from the ethdev, and then map the different port specifics (e.g. mbuf) to this new abstraction?

Quoted 4 lines

I feel it's cleaner, more generic and more maintainable to have drivers implementing one or several stable APIs instead of having some restricted wrappers to update.

This would be a separate library _on top_ of the existing APIs, and it has the advantage to simplify the DPDK user's application code when an application needs to deal with several types of port, as shown in the example that Bruce provided in PATCH #2.

I don't see why this could limit us or make it less maintainable. Of course this is an RFC patch; appropriate tests are missing (Bruce I can help you on that)

Marc

Quoted 2 lines

Comments are welcome.

#7 lore raw
Quoted 49 lines · Marc Sune
Quoted 36 lines · Thomas Monjalon

2015-05-19 12:31, Bruce Richardson:

Quoted 28 lines · Bruce Richardson
Quoted 27 lines

Hi all,

after a small amount of offline discussion with Marc Sune, here is an alternative proposal for a higher-level interface - aka pktdev - to allow a common Rx/Tx API across device types handling mbufs [for now, ethdev, ring and KNI]. The key code is in the first patch fo the set - the second is an example of a trivial usecase.

What is different about this to previously:
* wrapper class, so no changes to any existing ring, ethdev implementations
* use of function pointers for RX/TX with an API that maps to ethdev
- this means there is little/no additional overhead for ethdev calls
- inline special case for rings, to accelerate that. Since we are at a higher level, we can special case process some things if appropriate. This means the impact to ring ops is one (predictable) branch per burst
* elimination of the queue abstraction. For the ring and KNI, there is no concept of queues, so we just wrap the functions directly (no need even for wrapper functions, the api's match so we can call directly). This also means:
- adding in features per-queue, is far easier as we don't need to worry about having arrays of multiple queues. For example:
- adding in buffering on TX (or RX) is easier since again we only have a single queue.
* thread safety is made easier using a wrapper. For a MP ring, we can create multiple pktdevs around it, and each thread will then be able to use their own copy, with their own buffering etc.

Quoted 7 lines
Quoted 5 lines

However, at this point, I'm just looking for general feedback on this as an approach. I think it's quite flexible - even more so than the earlier proposal we had. It's less proscriptive and doesn't make any demands on any other libs.

Comments/thoughts welcome.

Any comments on this RFC before I see about investing further time in it to clean it up a bit and submit as a non-RFC patchset for merge in 2.1?

Quoted 9 lines

I would say there are 2 possible approaches for KNI and ring handling:
1/ You Bruce, Marc and Keith are advocating for a layer on top of ethdev, ring, KNI and possibly other devices, which uses mbuf. The set of functions is simpler than ethdev but the data structure is mbuf which is related to ethdev layer.
2/ Konstantin and Neil talked about keeping mbuf for ethdev layer and related libs only. Ring and KNI could have an ethdev API with a reduced set of implemented functions. Crypto devices could adopt a specific crypto API and an ethdev API at the same time.

Quoted 4 lines

I don't fully understand which APIs you meant by non-ethdev. This pktdev wrapper proposal abstracts RX and TX functions only, and all of these are using mbufs as the packet buffer abstraction right now anyway (ethdev).

He's referring to future device classes (like crypto devices), which ostensibly would make use of the pktdev API. My argument (and I think Thomas') is that if a bit of hardware can be made to operate as a packet sending/receiving device, then its just as reasonable to use the existing ethdev api rather than some other restricted version of it (pktdev)

Quoted 5 lines

This approach does not preclude that different libraries expose other API calls. In fact they will have to; setup the port/device ... It is just a higher level API, so that you don't have to check the type of port in your DPDK application I/O loop, minimizing user's code.

No argument there. But if thats the case (and I agree that it is), an application will implicitly have to know what what type of device it is, because it (the application) will need to understand the specific API it is writing to.

Quoted 4 lines

Or were you in 2) thinking about creating a different "packet buffer" abstraction, independent from the ethdev, and then map the different port specifics (e.g. mbuf) to this new abstraction?

My argument was to just leave the ethdev api alone. If a device class can be made to look like a packet forwarding device, then use the existing ethdev api to implement it.

Quoted 10 lines
Quoted 4 lines

I feel it's cleaner, more generic and more maintainable to have drivers implementing one or several stable APIs instead of having some restricted wrappers to update.

This would be a separate library _on top_ of the existing APIs, and it has the advantage to simplify the DPDK user's application code when an application needs to deal with several types of port, as shown in the example that Bruce provided in PATCH #2.

But thats already the purpose of the ethdev api. Different types of hardware/software can be made to look like the same thing (an ethdev) from an application standpoint. Adding this pktdev layer does nothing but that, add a layer. If you want restricted functionality of an interface, thats ok, ethdev offers that ability. unimplemented methods in a pmd cause the ethdev api to return EOPNOTSUP to the calling application, so the application knows when a given ethdev can't do some aspect of what an ethdev is.

Quoted 4 lines

I don't see why this could limit us or make it less maintainable. Of course this is an RFC patch; appropriate tests are missing (Bruce I can help you on that)

It doesn't limit us, its just not a useful abstraction, because we already have the abilities it provides.

Neil

Quoted 6 lines

Marc

Quoted 2 lines

Comments are welcome.

#8 lore raw
Quoted 83 lines · Neil Horman
Quoted 47 lines · Marc Sune
Quoted 36 lines · Thomas Monjalon

2015-05-19 12:31, Bruce Richardson:

Quoted 28 lines · Bruce Richardson
Quoted 27 lines

Hi all,

after a small amount of offline discussion with Marc Sune, here is an alternative proposal for a higher-level interface - aka pktdev - to allow a common Rx/Tx API across device types handling mbufs [for now, ethdev, ring and KNI]. The key code is in the first patch fo the set - the second is an example of a trivial usecase.

What is different about this to previously:
* wrapper class, so no changes to any existing ring, ethdev implementations
* use of function pointers for RX/TX with an API that maps to ethdev
- this means there is little/no additional overhead for ethdev calls
- inline special case for rings, to accelerate that. Since we are at a higher level, we can special case process some things if appropriate. This means the impact to ring ops is one (predictable) branch per burst
* elimination of the queue abstraction. For the ring and KNI, there is no concept of queues, so we just wrap the functions directly (no need even for wrapper functions, the api's match so we can call directly). This also means:
- adding in features per-queue, is far easier as we don't need to worry about having arrays of multiple queues. For example:
- adding in buffering on TX (or RX) is easier since again we only have a single queue.
* thread safety is made easier using a wrapper. For a MP ring, we can create multiple pktdevs around it, and each thread will then be able to use their own copy, with their own buffering etc.

Quoted 7 lines
Quoted 5 lines

However, at this point, I'm just looking for general feedback on this as an approach. I think it's quite flexible - even more so than the earlier proposal we had. It's less proscriptive and doesn't make any demands on any other libs.

Comments/thoughts welcome.

Any comments on this RFC before I see about investing further time in it to clean it up a bit and submit as a non-RFC patchset for merge in 2.1?

Quoted 9 lines

I would say there are 2 possible approaches for KNI and ring handling:
1/ You Bruce, Marc and Keith are advocating for a layer on top of ethdev, ring, KNI and possibly other devices, which uses mbuf. The set of functions is simpler than ethdev but the data structure is mbuf which is related to ethdev layer.
2/ Konstantin and Neil talked about keeping mbuf for ethdev layer and related libs only. Ring and KNI could have an ethdev API with a reduced set of implemented functions. Crypto devices could adopt a specific crypto API and an ethdev API at the same time.

Quoted 4 lines

I don't fully understand which APIs you meant by non-ethdev. This pktdev wrapper proposal abstracts RX and TX functions only, and all of these are using mbufs as the packet buffer abstraction right now anyway (ethdev).

He's referring to future device classes (like crypto devices), which ostensibly would make use of the pktdev API. My argument (and I think Thomas') is that if a bit of hardware can be made to operate as a packet sending/receiving device, then its just as reasonable to use the existing ethdev api rather than some other restricted version of it (pktdev)

Quoted 5 lines

This approach does not preclude that different libraries expose other API calls. In fact they will have to; setup the port/device ... It is just a higher level API, so that you don't have to check the type of port in your DPDK application I/O loop, minimizing user's code.

No argument there. But if thats the case (and I agree that it is), an application will implicitly have to know what what type of device it is, because it (the application) will need to understand the specific API it is writing to.

Quoted 4 lines

Or were you in 2) thinking about creating a different "packet buffer" abstraction, independent from the ethdev, and then map the different port specifics (e.g. mbuf) to this new abstraction?

My argument was to just leave the ethdev api alone. If a device class can be made to look like a packet forwarding device, then use the existing ethdev api to implement it.

Quoted 8 lines
Quoted 3 lines

I feel it's cleaner, more generic and more maintainable to have drivers implementing one or several stable APIs instead of having some restricted wrappers to update.

This would be a separate library _on top_ of the existing APIs, and it has the advantage to simplify the DPDK user's application code when an application needs to deal with several types of port, as shown in the example that Bruce provided in PATCH #2.

Quoted 7 lines

But thats already the purpose of the ethdev api. Different types of hardware/software can be made to look like the same thing (an ethdev) from an application standpoint. Adding this pktdev layer does nothing but that, add a layer. If you want restricted functionality of an interface, thats ok, ethdev offers that ability. unimplemented methods in a pmd cause the ethdev api to return EOPNOTSUP to the calling application, so the application knows when a given ethdev can't do some aspect of what an ethdev is.

Hi Neil,

Thanks for the clarifications. Now I understand the concern Thomas expressed. Using ethdev API (port-ids) was actually my first suggestion here:

http://permalink.gmane.org/gmane.comp.networking.dpdk.devel/13545

And to be honest, what I was expecting when I was reading for the first time DPDK's APIs. It is indeed an option. However, if we take a look at the API:

http://www.dpdk.org/doc/api/rte__ethdev_8h.html

none of the API calls, except the burst RX/TX and, perhaps, the callbacks, would be used by devices other than NICs. It seems going a bit too far using it, but ofc possible.

In essence, rte_ether(rte_ethdev.h) right now has: i) NIC setup; general configuration, queue config, fdir, offloads, hw stuff like leds... ii) RX/TX routines and callbacks iii) Stats and queue stats iv) other utils for ethernet stuff (rte_ether.h)

i) is clearly HW specific, and does only apply to NICs/ASICs (e.g. FM10k) while ii) and iii) are things that could be abstracted beyond NICs, like KNI, rte_ring, crypto... (iv could be moved into some utils/protocol parsing libraries).

Perhaps these two groups could be split into two different libraries and then ii) and iii) together would be something like ~ rte_pktdev (stats are missing on the proposed patch), while i) would be rte_ether, or rte_nic if we think it is a better name.

In any case, and I think we all agree here, I just think that one way or another this should be abstracted so that it simplifies (and reduces) a bit the code of DPDK applications.

Marc

Quoted 13 lines
Quoted 5 lines

I don't see why this could limit us or make it less maintainable. Of course this is an RFC patch; appropriate tests are missing (Bruce I can help you on that)

It doesn't limit us, its just not a useful abstraction, because we already have the abilities it provides.

Neil

Quoted 4 lines

Marc

Quoted 1 line

Comments are welcome.

#9 lore raw
Quoted 102 lines · Marc Sune
Quoted 83 lines · Neil Horman
Quoted 47 lines · Marc Sune
Quoted 36 lines · Thomas Monjalon

2015-05-19 12:31, Bruce Richardson:

Quoted 28 lines · Bruce Richardson
Quoted 27 lines

Hi all,

after a small amount of offline discussion with Marc Sune, here is an alternative proposal for a higher-level interface - aka pktdev - to allow a common Rx/Tx API across device types handling mbufs [for now, ethdev, ring and KNI]. The key code is in the first patch fo the set - the second is an example of a trivial usecase.

What is different about this to previously:
* wrapper class, so no changes to any existing ring, ethdev implementations
* use of function pointers for RX/TX with an API that maps to ethdev
- this means there is little/no additional overhead for ethdev calls
- inline special case for rings, to accelerate that. Since we are at a higher level, we can special case process some things if appropriate. This means the impact to ring ops is one (predictable) branch per burst
* elimination of the queue abstraction. For the ring and KNI, there is no concept of queues, so we just wrap the functions directly (no need even for wrapper functions, the api's match so we can call directly). This also means:
- adding in features per-queue, is far easier as we don't need to worry about having arrays of multiple queues. For example:
- adding in buffering on TX (or RX) is easier since again we only have a single queue.
* thread safety is made easier using a wrapper. For a MP ring, we can create multiple pktdevs around it, and each thread will then be able to use their own copy, with their own buffering etc.

Quoted 7 lines
Quoted 5 lines

However, at this point, I'm just looking for general feedback on this as an approach. I think it's quite flexible - even more so than the earlier proposal we had. It's less proscriptive and doesn't make any demands on any other libs.

Comments/thoughts welcome.

Any comments on this RFC before I see about investing further time in it to clean it up a bit and submit as a non-RFC patchset for merge in 2.1?

Quoted 9 lines

I would say there are 2 possible approaches for KNI and ring handling:
1/ You Bruce, Marc and Keith are advocating for a layer on top of ethdev, ring, KNI and possibly other devices, which uses mbuf. The set of functions is simpler than ethdev but the data structure is mbuf which is related to ethdev layer.
2/ Konstantin and Neil talked about keeping mbuf for ethdev layer and related libs only. Ring and KNI could have an ethdev API with a reduced set of implemented functions. Crypto devices could adopt a specific crypto API and an ethdev API at the same time.

Quoted 4 lines

I don't fully understand which APIs you meant by non-ethdev. This pktdev wrapper proposal abstracts RX and TX functions only, and all of these are using mbufs as the packet buffer abstraction right now anyway (ethdev).

He's referring to future device classes (like crypto devices), which ostensibly would make use of the pktdev API. My argument (and I think Thomas') is that if a bit of hardware can be made to operate as a packet sending/receiving device, then its just as reasonable to use the existing ethdev api rather than some other restricted version of it (pktdev)

Quoted 5 lines

This approach does not preclude that different libraries expose other API calls. In fact they will have to; setup the port/device ... It is just a higher level API, so that you don't have to check the type of port in your DPDK application I/O loop, minimizing user's code.

No argument there. But if thats the case (and I agree that it is), an application will implicitly have to know what what type of device it is, because it (the application) will need to understand the specific API it is writing to.

Quoted 4 lines

Or were you in 2) thinking about creating a different "packet buffer" abstraction, independent from the ethdev, and then map the different port specifics (e.g. mbuf) to this new abstraction?

My argument was to just leave the ethdev api alone. If a device class can be made to look like a packet forwarding device, then use the existing ethdev api to implement it.

Quoted 8 lines
Quoted 3 lines

I feel it's cleaner, more generic and more maintainable to have drivers implementing one or several stable APIs instead of having some restricted wrappers to update.

This would be a separate library _on top_ of the existing APIs, and it has the advantage to simplify the DPDK user's application code when an application needs to deal with several types of port, as shown in the example that Bruce provided in PATCH #2.

Quoted 7 lines

But thats already the purpose of the ethdev api. Different types of hardware/software can be made to look like the same thing (an ethdev) from an application standpoint. Adding this pktdev layer does nothing but that, add a layer. If you want restricted functionality of an interface, thats ok, ethdev offers that ability. unimplemented methods in a pmd cause the ethdev api to return EOPNOTSUP to the calling application, so the application knows when a given ethdev can't do some aspect of what an ethdev is.

Hi Neil,

Thanks for the clarifications. Now I understand the concern Thomas expressed. Using ethdev API (port-ids) was actually my first suggestion here:

http://permalink.gmane.org/gmane.comp.networking.dpdk.devel/13545

Quoted 9 lines

And to be honest, what I was expecting when I was reading for the first time DPDK's APIs. It is indeed an option. However, if we take a look at the API:

http://www.dpdk.org/doc/api/rte__ethdev_8h.html

none of the API calls, except the burst RX/TX and, perhaps, the callbacks, would be used by devices other than NICs. It seems going a bit too far using it, but ofc possible.

So, I'll make 3 counter-arguments here:

1) To your point about the ethdev api being much larger than what a non-ethernet device could use, I'll tacitly agree, but indicate that its not relevant. If you want a bit of hardware that isn't a network interface to behave like a network interface, then there are going to be alot of aspects of a network interface that it just can't do. Thats true regardless of how you implement that. In the pktdev model, you prevent those operations from being an option at all, while in the current ethdev model, you simply get a return code of EOPNOTSUP, and the application does the right thing (which is to say, it understands that this hardware doesn't need that aspect of network card mangement and goes on with its day). I assert that, because we already have the ethdev api, its a lower time investment to simply reuse it

2) To the implication that we aren't working with NICs here, you're correct. As you note in your previous message, the pktdev interface is in no way the end all and be all of device model design. You will need to add other api calls to manage the device. If thats the case, then don't shoehorn any one particular aspect of the API to fit a device model that the device doesn't conform to. Design the API so that it best reflects the hardware behavior.

3) An addendum to the point about hardware not being a NIC (and you didn't make this point directly above, but I think you may have mentioned it previously), sometimes you want a device to behave like another device for the purposes of using generic code to talk to several device types. While this is true, this is a case for device translation and use, not for carving out parts of an api to make something more generic. The use case I cited previously was an ipsec tunnel. An ipsec tunnel uses cryptography, and crypto device apis to encrypt decrypt packet data. The common way to implement this is to design a crypto api that accepts a block of data in a way most condusive to the hardware, and then implement a network driver (that uses whatever ethernet api, in this case the ethdev api), to integrate with the network datapath. With this model, the ipsec tunnel uses the full range of the ethdev api (or a good deal more of it), and the crypto api is optimized to work with crypo acceleration hardware.

Quoted 5 lines

In essence, rte_ether(rte_ethdev.h) right now has: i) NIC setup; general configuration, queue config, fdir, offloads, hw stuff like leds... ii) RX/TX routines and callbacks iii) Stats and queue stats iv) other utils for ethernet stuff (rte_ether.h)

The key that I'm taking away here is 'right now'. Its already written, so theres no work involved in implementing it for new devices.

Quoted 1 line

i) is clearly HW specific, and does only apply to NICs/ASICs (e.g. FM10k)

Ok, so it only applies to NIC's, thats fine. If you want to write a driver that leaves those methods for the pmd set to NULL, the ethdev library will correctly return EOPNOTSUPP to the calling applications.

Quoted 4 lines

while ii) and iii) are things that could be abstracted beyond NICs, like KNI, rte_ring, crypto... (iv could be moved into some utils/protocol parsing libraries).

Right again, so let those device types implement the appropriate portions of the pmd driver structure that match to what they support. EVerything else is handled by the ethdev library automatically.

Quoted 5 lines

Perhaps these two groups could be split into two different libraries and then ii) and iii) together would be something like ~ rte_pktdev (stats are missing on the proposed patch), while i) would be rte_ether, or rte_nic if we think it is a better name.

The point I'm trying to get to is, why split at all? Theres just no need that I can see. The example I would set here is the dummy driver in linux. Its a net device that only serves to act as a sink for network packets. It still uses the network driver interface, but of the 65-ish methods that the netdevice model in linux offers, it implements 8 (or approximately 12%). The other unused method are just that, unused, and thats ok. Applications that try to do things like set flow director options, or speed/duplex options gets a return code that effectively says "This device can't do that", and thats ok. Thats what we need to be doing here. Instead of finding a way to codify the subset of functionality that other devices might be able to implement, for those cases where we want other hardware to act like a netdevice, lets just let those devices pick and choose what to implement, and the interface we already have will communicate with applications appropriately.

Regards
Neil

Quoted 21 lines

In any case, and I think we all agree here, I just think that one way or another this should be abstracted so that it simplifies (and reduces) a bit the code of DPDK applications.

Marc

Quoted 13 lines
Quoted 5 lines

I don't see why this could limit us or make it less maintainable. Of course this is an RFC patch; appropriate tests are missing (Bruce I can help you on that)

It doesn't limit us, its just not a useful abstraction, because we already have the abilities it provides.

Neil

Quoted 4 lines

Marc

Quoted 1 line

Comments are welcome.

#10 lore raw
Quoted 226 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Neil Horman
Sent: Wednesday, May 20, 2015 7:47 PM
To: Marc Sune
Cc: [email protected]
Subject: Re: [dpdk-dev] [RFC PATCHv2 0/2] pktdev as wrapper type

Quoted 7 lines · Marc Sune
Quoted 4 lines · Neil Horman
Quoted 3 lines · Marc Sune
Quoted 1 line · Thomas Monjalon

2015-05-19 12:31, Bruce Richardson:

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines · Bruce Richardson
Quoted 7 lines

Hi all,

after a small amount of offline discussion with Marc Sune, here is an alternative proposal for a higher-level interface - aka pktdev - to allow a common Rx/Tx API across device types handling mbufs [for now, ethdev, ring and KNI]. The key code is in the first patch fo the set - the second is an example of a trivial

usecase.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

What is different about this to previously:
* wrapper class, so no changes to any existing ring, ethdev implementations
* use of function pointers for RX/TX with an API that maps to

ethdev

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

- this means there is little/no additional overhead for ethdev

calls

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

- inline special case for rings, to accelerate that. Since we

are at a

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

higher level, we can special case process some things if

appropriate. This

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

means the impact to ring ops is one (predictable) branch per
burst
* elimination of the queue abstraction. For the ring and KNI, there

is no

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

concept of queues, so we just wrap the functions directly (no

need even for

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

wrapper functions, the api's match so we can call directly).

This also

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

means:
- adding in features per-queue, is far easier as we don't need

to worry about

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

having arrays of multiple queues. For example:
- adding in buffering on TX (or RX) is easier since again we

only have a

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

single queue.
* thread safety is made easier using a wrapper. For a MP ring, we

can create

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

multiple pktdevs around it, and each thread will then be able to

use their

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

own copy, with their own buffering etc.

However, at this point, I'm just looking for general feedback on this as an approach. I think it's quite flexible - even more so than the earlier proposal we had. It's less proscriptive and

doesn't make any demands on any other libs.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

Comments/thoughts welcome.

Any comments on this RFC before I see about investing further time in it to clean it up a bit and submit as a non-RFC patchset for

merge in 2.1?

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

I would say there are 2 possible approaches for KNI and ring

handling:

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 8 lines

1/ You Bruce, Marc and Keith are advocating for a layer on top of ethdev, ring, KNI and possibly other devices, which uses mbuf. The set of functions is simpler than ethdev but the data structure is mbuf which is related to ethdev layer.
2/ Konstantin and Neil talked about keeping mbuf for ethdev layer and related libs only. Ring and KNI could have an ethdev API with a reduced set of implemented functions. Crypto devices could adopt a specific crypto API and an ethdev API at the same time.

I don't fully understand which APIs you meant by non-ethdev. This pktdev wrapper proposal abstracts RX and TX functions only, and all of these are using mbufs as the packet buffer abstraction right now

anyway (ethdev).

Quoted 8 lines
Quoted 8 lines
Quoted 1 line

He's referring to future device classes (like crypto devices), which ostensibly would make use of the pktdev API. My argument (and I think Thomas') is that if a bit of hardware can be made to operate as a packet sending/receiving device, then its just as reasonable to use the existing ethdev api rather than some other restricted version of it (pktdev)

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

This approach does not preclude that different libraries expose other API calls. In fact they will have to; setup the port/device ... It is just a higher level API, so that you don't have to check the type of port in your DPDK application I/O loop, minimizing user's

code.

Quoted 4 lines
Quoted 4 lines
Quoted 1 line

No argument there. But if thats the case (and I agree that it is), an application will implicitly have to know what what type of device it is, because it (the application) will need to understand the

specific API it is writing to.

Quoted 17 lines
Quoted 17 lines
Quoted 5 lines

Or were you in 2) thinking about creating a different "packet buffer" abstraction, independent from the ethdev, and then map the different port specifics (e.g. mbuf) to this new abstraction?

My argument was to just leave the ethdev api alone. If a device class can be made to look like a packet forwarding device, then use the existing ethdev api to implement it.

Quoted 8 lines
Quoted 3 lines

I feel it's cleaner, more generic and more maintainable to have drivers implementing one or several stable APIs instead of having some restricted wrappers to update.

This would be a separate library _on top_ of the existing APIs, and it has the advantage to simplify the DPDK user's application code when an application needs to deal with several types of port, as shown in the example that Bruce provided in PATCH #2.

Quoted 7 lines
Quoted 7 lines

But thats already the purpose of the ethdev api. Different types of hardware/software can be made to look like the same thing (an ethdev) from an application standpoint. Adding this pktdev layer does nothing but that, add a layer. If you want restricted functionality of an interface, thats ok, ethdev offers that ability. unimplemented methods in a pmd cause the ethdev api to return EOPNOTSUP to the calling application, so the application knows when a given ethdev can't

do some aspect of what an ethdev is.

Quoted 8 lines

Hi Neil,

Thanks for the clarifications. Now I understand the concern Thomas expressed. Using ethdev API (port-ids) was actually my first suggestion
here:

Quoted 4 lines

http://permalink.gmane.org/gmane.comp.networking.dpdk.devel/13545

And to be honest, what I was expecting when I was reading for the first time DPDK's APIs. It is indeed an option. However, if we take a

look at the API:

Quoted 7 lines

http://www.dpdk.org/doc/api/rte__ethdev_8h.html

none of the API calls, except the burst RX/TX and, perhaps, the callbacks, would be used by devices other than NICs. It seems going a bit too far using it, but ofc possible.

So, I'll make 3 counter-arguments here:

1) To your point about the ethdev api being much larger than what a non- ethernet device could use, I'll tacitly agree, but indicate that its not relevant. If you want a bit of hardware that isn't a network interface to behave like a network interface, then there are going to be alot of aspects of a network interface that it just can't do. Thats true regardless of how you implement that. In the pktdev model, you prevent those operations from being an option at all, while in the current ethdev model, you simply get a return code of EOPNOTSUP, and the application does the right thing (which is to say, it understands that this hardware doesn't need that aspect of network card mangement and goes on with its day). I assert that, because we already have the ethdev api, its a lower time investment to simply reuse it

2) To the implication that we aren't working with NICs here, you're correct. As you note in your previous message, the pktdev interface is in no way the end all and be all of device model design. You will need to add other api calls to manage the device. If thats the case, then don't shoehorn any one particular aspect of the API to fit a device model that the device doesn't conform to.
Design the API so that it best reflects the hardware behavior.

3) An addendum to the point about hardware not being a NIC (and you didn't make this point directly above, but I think you may have mentioned it previously), sometimes you want a device to behave like another device for the purposes of using generic code to talk to several device types. While this is true, this is a case for device translation and use, not for carving out parts of an api to make something more generic. The use case I cited previously was an ipsec tunnel. An ipsec tunnel uses cryptography, and crypto device apis to encrypt decrypt packet data. The common way to implement this is to design a crypto api that accepts a block of data in a way most condusive to the hardware, and then implement a network driver (that uses whatever ethernet api, in this case the ethdev api), to integrate with the network datapath. With this model, the ipsec tunnel uses the full range of the ethdev api (or a good deal more of it), and the crypto api is optimized to work with crypo acceleration hardware.

Quoted 5 lines

In essence, rte_ether(rte_ethdev.h) right now has: i) NIC setup; general configuration, queue config, fdir, offloads, hw stuff like leds... ii) RX/TX routines and callbacks iii) Stats and queue stats iv) other utils for ethernet stuff (rte_ether.h)

The key that I'm taking away here is 'right now'. Its already written, so theres no work involved in implementing it for new devices.

Quoted 2 lines

i) is clearly HW specific, and does only apply to NICs/ASICs (e.g. FM10k)

Ok, so it only applies to NIC's, thats fine. If you want to write a driver that leaves those methods for the pmd set to NULL, the ethdev library will correctly return EOPNOTSUPP to the calling applications.

Quoted 4 lines

while ii) and iii) are things that could be abstracted beyond NICs, like KNI, rte_ring, crypto... (iv could be moved into some utils/protocol parsing libraries).

Right again, so let those device types implement the appropriate portions of the pmd driver structure that match to what they support. EVerything else is handled by the ethdev library automatically.

Quoted 5 lines

Perhaps these two groups could be split into two different libraries and then ii) and iii) together would be something like ~ rte_pktdev (stats are missing on the proposed patch), while i) would be rte_ether, or rte_nic if we think it is a better name.

The point I'm trying to get to is, why split at all? Theres just no need that I can see. The example I would set here is the dummy driver in linux. Its a net device that only serves to act as a sink for network packets. It still uses the network driver interface, but of the 65-ish methods that the netdevice model in linux offers, it implements 8 (or approximately 12%). The other unused method are just that, unused, and thats ok. Applications that try to do things like set flow director options, or speed/duplex options gets a return code that effectively says "This device can't do that", and thats ok. Thats what we need to be doing here. Instead of finding a way to codify the subset of functionality that other devices might be able to implement, for those cases where we want other hardware to act like a netdevice, lets just let those devices pick and choose what to implement, and the interface we already have will communicate with applications appropriately.

Quoted 3 lines

Regards
Neil

Hi Neil,

First off, a note on the naming and the basic concept: this proposal is not trying to make everything look like NIC, rather we are trying to make a bunch of different components appear as generic sources/sinks for pkts or mbufs. From my point of view, it's an important difference.

Be that as it may, I'd like to first deal with the whole idea of the application needing to know about the type of the underlying device. For me, this is a critical point. Applications - such as all our sample apps - have essentially two parts:
* an initialization and control part
* a data-path part.
These two parts are very, very different in what they do. The initialization part - which e.g. in testpmd continues on in the form of the cmdline interface as a control part - does the initial setup of devices/rings/etc. and potentially makes use of the full APIs provided by the ethdev interface. It's also not performance critical, as evidenced by the fact that the APIs used there have additional checks for valid input etc. The second, data-path part, is entirely the part that this proposal is targeting. This data-path is completely separate in the application, is highly performance sensitive, and rarely, if ever needs to know or care about the actual source of its data. So the idea behind this library is that you can write your initialization control parts of your app as-now, fully aware of the underlying types involved, and without ever using rx/tx burst. Then when you have the various devices and DPDK objects set up, you spawn your data-path threads and pass each one the set of input and outputs it needs, in the form of your generic packet source objects.

This distinction is also why I'm not particularly interested in the ability to pass in different objects via cmdline, as is done now with pcap/ring PMDs. That's ok when you want the initialization part of your app to be oblivious to see everything under a common abstraction, but when it's only the data path you want to work with generic packet objects that's unnecessary, and the initialization path should be able to convert any of the required input/output sources to a generic type using a single API call. [This doesn't rule out specifying different inputs/outputs on the commandline, it's just you can specify them as their native types, rather than hiding them under a common API at the control-path level].

As for what that abstraction should be. There are a number of issues I see with ethdev - as it is right now, as that common abstraction.

1. The use of port-ids. I think port ids are fine for numbering physical ports, but I think pointers are better for passing around objects to be worked on by the data path. What is more concerning [than my opinion on numbers vs pointers :-)] is the fact that we are limited to 256 port ids. Yes, that can be changed, but the impacts are massive. To change the type, we would break the ABI for every single ethdev API, as well as likely other functions too. Furthermore, increasing the size of the port id would require a change to the internals of the mbuf structure, which would lead to the ABI being broken for any function that uses mbufs. By adopting an API, such as proposed, which uses pointers, we avoid the problem, as port ids would only apply to ethdevs.

2. Simplicity. While you say that its fine for an ethdev not to implement all the functions in the ethdev API, to create a proper PMD like you are proposing involves a good deal more work than using the proposed pktdev abstraction. If it's to appear like a proper NIC to the control paths, as well as the init paths - which seems to be what you imply - you really do need to implement additional functions like queue setup, and start and stop. While it's true that the library can return -ENOSUP on an unsupported function, I don't believe any of our sample apps are set up to check for this on NIC setup, and therefore I would hazard a guess that real-world customer apps aren't set up to handle it either.

3. Performance for rings. While not applicable for all cases, the performance of the rings under an ethdev abstraction would not be the same as here. For example, when polling on an empty ring for packets, the current time taken by our ring rx/tx functions, is literally a few cycles (as tested by the rings autotest). If these functions cannot be inlined, that cycle count goes up to 3x what it is now. [I observed this previously when doing reworking of the rings code, and the code-size led to icc no longer doing inlining. In that case, the gcc code for empty polling was indeed 3 times faster than the icc version. Adding forced inlining made things equal again]. This metric of empty polling may seem trivial i.e. "if there are no packets, why does it matter how long it takes?", but is important in real-world cases where you are pulling packets from multiple sources, and your application is only currently dealing with input on one of them. [Often tested to see how an application handles in a single-flow situation - an metric our customers do look at]. Even in the non-empty situation, for smaller packet bursts, the overhead of the function call may slow things down. [For larger bursts, e.g. 32, the effect should not be noticeable, I suspect].

The only other final point I'd make here is that what is proposed is not proscriptive - whatever a future API for handling other device types, such as crypto devices, may look like can be decided separately from this pktdev implementation. Whether one chooses pktdev or ethdev as a common abstraction layer type, the decision of whether or not a particular object type is allowed to be made look like that common type can be made entirely independently, and based upon whether or not such a type-conversion makes sense.

Regards,
/Bruce

#11 lore raw

cover pktdev update

In reply to Bruce Richardson

Following on from the feedback received from the community about the pktdev idea, I've decided not to push this approach further for DPDK 2.1.

Instead, for future releases, I'll look at taking some of what was investigated in this work and see if it can be applied to the existing ethdev library, which seems to be the favoured point of convergence in the community. Hopefully, we can get ethdev to meet all the requirements I had looked for for pktdev. [If not, I may need to come back to look at this again, but I hope not! :-)]

For the sake of completeness, I'm also sending out my latest, and final, draft set of patches for pktdev, in case Marc, or someone else, wishes to take this further right now. As I've said, for the time being, I'm going to switch focus to ethdev.

Thanks for all the feedback.

Regards,
/Bruce

Bruce Richardson (5):
kni: add function to query the name of a kni object
pktdev: Add pktdev implementation library example app showing pktdevs used in a chain new pktdev l2fwd sample
test: add pktdev performance tests

Marc Sune (1):
pktdev: adding app test

 app/test/Makefile                        |   2 +
 app/test/test_pktdev.c                   | 440 +++++++++++++++++++++++++
 app/test/test_pktdev_perf.c              | 260 +++++++++++++++
 config/common_bsdapp                     |   5 +
 config/common_linuxapp                   |   5 +
 examples/pktdev-chain/Makefile           |  57 ++++
 examples/pktdev-chain/basicfwd.c         | 221 +++++++++++++
 examples/pktdev-l2fwd/Makefile           |  50 +++
 examples/pktdev-l2fwd/main.c             | 530 +++++++++++++++++++++++++++++++
 lib/Makefile                             |   1 +
 lib/librte_kni/rte_kni.c                 |   6 +
 lib/librte_kni/rte_kni.h                 |  10 +
 lib/librte_kni/rte_kni_version.map       |   1 +
 lib/librte_pktdev/Makefile               |  56 ++++
 lib/librte_pktdev/rte_pktdev.c           | 188 +++++++++++
 lib/librte_pktdev/rte_pktdev.h           | 400 +++++++++++++++++++++++
 lib/librte_pktdev/rte_pktdev_version.map |  11 +
 mk/rte.app.mk                            |   1 +
 18 files changed, 2244 insertions(+)
 create mode 100644 app/test/test_pktdev.c
 create mode 100644 app/test/test_pktdev_perf.c
 create mode 100644 examples/pktdev-chain/Makefile
 create mode 100644 examples/pktdev-chain/basicfwd.c
 create mode 100644 examples/pktdev-l2fwd/Makefile
 create mode 100644 examples/pktdev-l2fwd/main.c
 create mode 100644 lib/librte_pktdev/Makefile
 create mode 100644 lib/librte_pktdev/rte_pktdev.c
 create mode 100644 lib/librte_pktdev/rte_pktdev.h
 create mode 100644 lib/librte_pktdev/rte_pktdev_version.map
Signature · 1 line
2.4.2
#12 lore raw

PATCH 1/6 kni: add function to query the name of a kni object

When a KNI object is created, a name is assigned to it which is stored internally. There is also an API function to look up a KNI object by name, but there is no API to query the current name of an existing KNI object. This patch adds just such an API.

---
 lib/librte_kni/rte_kni.c           |  6 ++++++
 lib/librte_kni/rte_kni.h           | 10 ++++++++++
 lib/librte_kni/rte_kni_version.map |  1 +
 3 files changed, 17 insertions(+)
lib/librte_kni/rte_kni.c +6 -0
index 4e70fa0..c5a0089 100644
@@ -674,6 +674,12 @@ rte_kni_get(const char *name)
 	return NULL;
 }
 
+const char *
+rte_kni_get_name(const struct rte_kni *kni)
+{
+	return kni->name;
+}
+
 /*
  * It is deprecated and just for backward compatibility.
  */
lib/librte_kni/rte_kni.h +10 -0
index 44240fe..0c74251 100644
@@ -248,6 +248,16 @@ extern uint8_t rte_kni_get_port_id(struct rte_kni *kni) \
 extern struct rte_kni *rte_kni_get(const char *name);
 
 /**
+ * Get the name given to a KNI device
+ *
+ * @param kni
+ *   The KNI instance to query
+ * @return
+ *   The pointer to the KNI name
+ */
+extern const char *rte_kni_get_name(const struct rte_kni *kni);
+
+/**
  * Get the KNI context of the specific port.
  *
  * Note: It is deprecated and just for backward compatibility.
lib/librte_kni/rte_kni_version.map +1 -0
index b0bbf4d..e5e4e1b 100644
@@ -6,6 +6,7 @@ DPDK_2.0 {
 	rte_kni_create;
 	rte_kni_get;
 	rte_kni_get_port_id;
+	rte_kni_get_name;
 	rte_kni_handle_request;
 	rte_kni_info_get;
 	rte_kni_init;
Signature · 1 line
2.4.2
#13 lore raw

PATCH 2/6 pktdev: Add pktdev implementation library

In reply to Bruce Richardson

The pktdev API is a minimal API designed for runtime packet processing use. It works by providing a common API for RX and TX across a range of device and object types: namely SW rings, ethernet ports and KNI ports.

By using the pktdev abstraction, packet data-path code can be written to accept packets from a source and pass them to a destination without having to be concerned about what the underlying types of those sources and destinations are.

Pktdev does not provide any specific APIs for manipulating the underlying packet sources - that should be handled by the application initialization, or control code, not the data path code which uses the pktdev abstraction.

---
 config/common_bsdapp                     |   5 +
 config/common_linuxapp                   |   5 +
 lib/Makefile                             |   1 +
 lib/librte_pktdev/Makefile               |  56 +++++
 lib/librte_pktdev/rte_pktdev.c           | 188 +++++++++++++++
 lib/librte_pktdev/rte_pktdev.h           | 400 +++++++++++++++++++++++++++++++
 lib/librte_pktdev/rte_pktdev_version.map |  11 +
 mk/rte.app.mk                            |   1 +
 8 files changed, 667 insertions(+)
 create mode 100644 lib/librte_pktdev/Makefile
 create mode 100644 lib/librte_pktdev/rte_pktdev.c
 create mode 100644 lib/librte_pktdev/rte_pktdev.h
 create mode 100644 lib/librte_pktdev/rte_pktdev_version.map
config/common_bsdapp +5 -0
index 0b169c8..ad073f2 100644
@@ -132,6 +132,11 @@ CONFIG_RTE_LIBRTE_EAL_VMWARE_TSC_MAP_SUPPORT=y
 CONFIG_RTE_LIBRTE_KVARGS=y
 
 #
+# Compile generic packet handling device library
+#
+CONFIG_RTE_LIBRTE_PKTDEV=y
+
+#
 # Compile generic ethernet library
 #
 CONFIG_RTE_LIBRTE_ETHER=y
config/common_linuxapp +5 -0
index 5deb55a..ffffb58 100644
@@ -129,6 +129,11 @@ CONFIG_RTE_LIBRTE_EAL_VMWARE_TSC_MAP_SUPPORT=y
 CONFIG_RTE_LIBRTE_KVARGS=y
 
 #
+# Compile generic packet handling device library
+#
+CONFIG_RTE_LIBRTE_PKTDEV=y
+
+#
 # Compile generic ethernet library
 #
 CONFIG_RTE_LIBRTE_ETHER=y
lib/Makefile +1 -0
index 5f480f9..c7980d4 100644
@@ -32,6 +32,7 @@
 include $(RTE_SDK)/mk/rte.vars.mk
 
 DIRS-y += librte_compat
+DIRS-$(CONFIG_RTE_LIBRTE_PKTDEV) += librte_pktdev
 DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal
 DIRS-$(CONFIG_RTE_LIBRTE_MALLOC) += librte_malloc
 DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring
lib/librte_pktdev/Makefile new file +56 -0

56 lines not on this page · raw message

lib/librte_pktdev/rte_pktdev.c new file +188 -0

188 lines not on this page · raw message

lib/librte_pktdev/rte_pktdev.h new file +400 -0

400 lines not on this page · raw message

lib/librte_pktdev/rte_pktdev_version.map new file +11 -0
new file mode 100644
index 0000000..8c8671a
@@ -0,0 +1,11 @@
+DPDK_2.1 {
+	global:
+
+	rte_pkt_rx_burst;
+	rte_pkt_tx_burst;
+	rte_pkt_dev_from_ring;
+	rte_pkt_dev_from_kni;
+	rte_pkt_dev_from_eth_port;
+	
+	local: *;
+};
mk/rte.app.mk +1 -0
index 1a2043a..85d8732 100644
@@ -112,6 +112,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_RING)           += -lrte_ring
 _LDLIBS-$(CONFIG_RTE_LIBRTE_EAL)            += -lrte_eal
 _LDLIBS-$(CONFIG_RTE_LIBRTE_CMDLINE)        += -lrte_cmdline
 _LDLIBS-$(CONFIG_RTE_LIBRTE_CFGFILE)        += -lrte_cfgfile
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PKTDEV)         += -lrte_pktdev
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BOND)       += -lrte_pmd_bond
 
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT)    += -lrte_pmd_xenvirt
Signature · 1 line
2.4.2
#14 lore raw

PATCH 3/6 example app showing pktdevs used in a chain

In reply to Bruce Richardson

This is a trivial example showing code which is using ethdevs and rings in a neutral manner, with the same piece of pipeline code passing mbufs along a chain without ever having to query its source or destination type.

---
 examples/pktdev-chain/Makefile   |  57 ++++++++++
 examples/pktdev-chain/basicfwd.c | 221 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 278 insertions(+)
 create mode 100644 examples/pktdev-chain/Makefile
 create mode 100644 examples/pktdev-chain/basicfwd.c
examples/pktdev-chain/Makefile new file +57 -0
new file mode 100644
index 0000000..4a5d99f
@@ -0,0 +1,57 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2015 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.
+
+ifeq ($(RTE_SDK),)
+$(error "Please define RTE_SDK environment variable")
+endif
+
+# Default target, can be overridden by command line or environment
+RTE_TARGET ?= x86_64-native-linuxapp-gcc
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+# binary name
+APP = basicfwd
+
+# all source are stored in SRCS-y
+SRCS-y := basicfwd.c
+
+CFLAGS += $(WERROR_FLAGS)
+
+# workaround for a gcc bug with noreturn attribute
+# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
+ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
+CFLAGS_main.o += -Wno-return-type
+endif
+
+EXTRA_CFLAGS += -O3 -g -Wfatal-errors
+
+include $(RTE_SDK)/mk/rte.extapp.mk
examples/pktdev-chain/basicfwd.c new file +221 -0

221 lines not on this page · raw message

Signature · 1 line
2.4.2
#15 lore raw

PATCH 4/6 new pktdev l2fwd sample

In reply to Bruce Richardson

This patch takes the existing l2fwd example application and modifies it to use pktdevs instead of ethdevs directly. The code is shorter, as we are able to take advantage of the TX buffering provided by pktdev.

---
 examples/pktdev-l2fwd/Makefile |  50 ++++
 examples/pktdev-l2fwd/main.c   | 530 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 580 insertions(+)
 create mode 100644 examples/pktdev-l2fwd/Makefile
 create mode 100644 examples/pktdev-l2fwd/main.c
examples/pktdev-l2fwd/Makefile new file +50 -0
new file mode 100644
index 0000000..78feeeb
@@ -0,0 +1,50 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2015 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.
+
+ifeq ($(RTE_SDK),)
+$(error "Please define RTE_SDK environment variable")
+endif
+
+# Default target, can be overriden by command line or environment
+RTE_TARGET ?= x86_64-native-linuxapp-gcc
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+# binary name
+APP = l2fwd
+
+# all source are stored in SRCS-y
+SRCS-y := main.c
+
+CFLAGS += -O3
+CFLAGS += $(WERROR_FLAGS)
+
+include $(RTE_SDK)/mk/rte.extapp.mk
examples/pktdev-l2fwd/main.c new file +530 -0

530 lines not on this page · raw message

Signature · 1 line
2.4.2
#16 lore raw

PATCH 5/6 pktdev: adding app test

In reply to Bruce Richardson

From: Marc Sune <[email protected]>

Add a basic test for pktdev non-buffered API for pktdev types:

* ethdev
* ring
* kni

---
 app/test/Makefile      |   4 +
 app/test/test_pktdev.c | 440 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 444 insertions(+)
 create mode 100644 app/test/test_pktdev.c
app/test/Makefile +4 -0
index 3c777bf..77e48c1 100644
@@ -58,6 +58,10 @@ SRCS-y += test_ring.c
 SRCS-y += test_ring_perf.c
 SRCS-y += test_pmd_perf.c
 
+ifeq ($(CONFIG_RTE_LIBRTE_PKTDEV),y)
+SRCS-y += test_pktdev.c
+endif
+
 ifeq ($(CONFIG_RTE_LIBRTE_TABLE),y)
 SRCS-y += test_table.c
 SRCS-$(CONFIG_RTE_LIBRTE_PIPELINE) += test_table_pipeline.c
app/test/test_pktdev.c new file +440 -0

440 lines not on this page · raw message

Signature · 1 line
2.4.2
#17 lore raw

PATCH 6/6 test: add pktdev performance tests

In reply to Bruce Richardson

Add in some performance testing for the pktdev library. Looking at cycles count for a ring-based implementation, based off the ring performance tests.
Compares ring performance:
* native ring calls
* calls through pktdev to the ring
* calls through ring pmd wrapper to the ring
* calls through pktdev to the pmd wrapper to the ring.

---
 app/test/Makefile              |   4 +-
 app/test/test_pktdev_perf.c    | 260 +++++++++++++++++++++++++++++++++++++++++
 lib/librte_pktdev/rte_pktdev.h |   8 +-
 3 files changed, 265 insertions(+), 7 deletions(-)
 create mode 100644 app/test/test_pktdev_perf.c
app/test/Makefile +1 -3
index 77e48c1..8697893 100644
@@ -58,9 +58,7 @@ SRCS-y += test_ring.c
 SRCS-y += test_ring_perf.c
 SRCS-y += test_pmd_perf.c
 
-ifeq ($(CONFIG_RTE_LIBRTE_PKTDEV),y)
-SRCS-y += test_pktdev.c
-endif
+SRCS-$(CONFIG_RTE_LIBRTE_PKTDEV) += test_pktdev.c test_pktdev_perf.c
 
 ifeq ($(CONFIG_RTE_LIBRTE_TABLE),y)
 SRCS-y += test_table.c
app/test/test_pktdev_perf.c new file +260 -0

260 lines not on this page · raw message

lib/librte_pktdev/rte_pktdev.h +4 -4
index 3acbc0d..4740c67 100644
@@ -46,6 +46,7 @@ extern "C" {
 
 #include <stdint.h>
 #include <rte_ring.h>
+#include <rte_mbuf.h>
 #include <rte_branch_prediction.h>
 
 /* Buffered TX works in bursts of 32 */
@@ -53,9 +54,8 @@ extern "C" {
 
 /*
  * forward definition of data structures.
- * We don't need full mbuf/kni/ethdev headers here
+ * We don't need full kni/ethdev headers here
  */
-struct rte_mbuf;
 struct rte_kni;
 struct rte_eth_dev;
 
@@ -136,7 +136,7 @@ struct rte_pktdev {
  *   of pointers to *rte_mbuf* structures effectively supplied to the
  *   *rx_pkts* array.
  */
-static inline uint16_t
+static inline uint16_t __attribute__((always_inline))
 rte_pkt_rx_burst(struct rte_pktdev *dev, struct rte_mbuf **rx_pkts,
 		uint16_t nb_pkts)
 {
@@ -168,7 +168,7 @@ rte_pkt_rx_burst(struct rte_pktdev *dev, struct rte_mbuf **rx_pkts,
  *   the transmit ring. The return value can be less than the value of the
  *   *tx_pkts* parameter when the transmit ring is full or has been filled up.
  */
-static inline uint16_t
+static inline uint16_t __attribute__((always_inline))
 rte_pkt_tx_burst(struct rte_pktdev *dev, struct rte_mbuf **tx_pkts,
 		uint16_t nb_pkts)
 {
Signature · 1 line
2.4.2
#18 lore raw

Re: [RFC-PATCH-v3 0/6] pktdev update

In reply to Bruce Richardson

2015-06-10 14:07, Bruce Richardson:

Quoted 8 lines

Following on from the feedback received from the community about the pktdev idea, I've decided not to push this approach further for DPDK 2.1.

Instead, for future releases, I'll look at taking some of what was investigated in this work and see if it can be applied to the existing ethdev library, which seems to be the favoured point of convergence in the community. Hopefully, we can get ethdev to meet all the requirements I had looked for for pktdev. [If not, I may need to come back to look at this again, but I hope not! :-)]

Maybe we should start removing some things from ethdev.
There are some functions or structures which are specific to some devices only. Why not include a header from the driver when we want to use a specific feature of this driver?
Examples: ixgbe bypass mode, ixgbe queue stats mapping, Rx/Tx thresholds tuning...