* Re: [PATCH v2 09/12] doc/armv8: update documentation about crypto PMD
From: Mcnamara, John @ 2016-12-07 21:13 UTC (permalink / raw)
To: zbigniew.bodek@caviumnetworks.com, De Lara Guarch, Pablo,
jerin.jacob@caviumnetworks.com
Cc: dev@dpdk.org
In-Reply-To: <1481077985-4224-10-git-send-email-zbigniew.bodek@caviumnetworks.com>
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of
> zbigniew.bodek@caviumnetworks.com
> Sent: Wednesday, December 7, 2016 2:33 AM
> To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>;
> jerin.jacob@caviumnetworks.com
> Cc: dev@dpdk.org; Zbigniew Bodek <zbigniew.bodek@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH v2 09/12] doc/armv8: update documentation about
> crypto PMD
>
> From: Zbigniew Bodek <zbigniew.bodek@caviumnetworks.com>
>
> Add documentation about the driver and update release notes.
>
> Signed-off-by: Zbigniew Bodek <zbigniew.bodek@caviumnetworks.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
^ permalink raw reply
* Re: [PATCH v2 32/32] app/testpmd: fix invalid port ID
From: Lu, Wenzhuo @ 2016-12-08 0:49 UTC (permalink / raw)
To: Yigit, Ferruh, dev@dpdk.org; +Cc: Chen, Jing D
In-Reply-To: <49f75886-8149-4900-c948-ea75be694b11@intel.com>
Hi Ferruh,
> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Wednesday, December 7, 2016 11:49 PM
> To: Lu, Wenzhuo; dev@dpdk.org
> Cc: Chen, Jing D
> Subject: Re: [dpdk-dev] [PATCH v2 32/32] app/testpmd: fix invalid port ID
>
> On 12/7/2016 3:32 AM, Wenzhuo Lu wrote:
> > Some CLIs don't check the input port ID, it may cause segmentation
> > fault (core dumped).
>
> Are these functions (that we are adding extra check) added with this patchset? If
> so why not add these checks where function implemented.
>
> If these functions are already implemented before this patchset, this patch can
> be standalone patch, instead of being part of this patchset, and can be before
> this patchset so that it can be easily backported to stable trees.
This patch is for the existing code. I think you're right. I'll remove it from this patch set and send an isolate patch for it.
>
> >
> > Fixes: 425781ff5afe ("app/testpmd: add ixgbe VF management")
> >
> > Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> > Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
> > ---
>
> <...>
^ permalink raw reply
* Re: [PATCH] net/ixgbe: fix typo in comment
From: Lu, Wenzhuo @ 2016-12-08 0:49 UTC (permalink / raw)
To: Yigit, Ferruh, dev@dpdk.org
Cc: Zhang, Helin, Ananyev, Konstantin, stable@dpdk.org
In-Reply-To: <20161207171948.19488-1-ferruh.yigit@intel.com>
Hi,
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Ferruh Yigit
> Sent: Thursday, December 8, 2016 1:20 AM
> To: dev@dpdk.org
> Cc: Zhang, Helin; Ananyev, Konstantin; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/ixgbe: fix typo in comment
>
> Fixes: c03fcee9abbd ("ixgbe: remove CRC size from byte counters")
>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
^ permalink raw reply
* Re: [PATCH v2] eal: optimize aligned rte_memcpy
From: Yao, Lei A @ 2016-12-08 0:55 UTC (permalink / raw)
To: Wang, Zhihong, dev@dpdk.org
Cc: yuanhan.liu@linux.intel.com, thomas.monjalon@6wind.com
In-Reply-To: <1481074266-4461-1-git-send-email-zhihong.wang@intel.com>
Tested-by: Lei Yao <lei.a.yao@intel.com>
- Apply patch to v16.11
I have tested the loopback performance for this patch on 3 following settings:
CPU: IVB
Ubutnu16.04
Kernal: 4.4.0
gcc : 5.4.0
CPU: HSW
Fedora 21
Kernal: 4.1.13
gcc: 4.9.2
CPU:BDW
Ubutnu16.04
Kernal: 4.4.0
gcc : 5.4.0
I can see 10%~20% performance gain for different packet size on mergeable path. Only on IVB + gcc5.4.0, slight performance drop(~4%) on vector path for packet size 128 ,260. It's may related to gcc version as this performance drop not see with gcc 6+.
-----Original Message-----
From: Wang, Zhihong
Sent: Wednesday, December 7, 2016 9:31 AM
To: dev@dpdk.org
Cc: yuanhan.liu@linux.intel.com; thomas.monjalon@6wind.com; Yao, Lei A <lei.a.yao@intel.com>; Wang, Zhihong <zhihong.wang@intel.com>
Subject: [PATCH v2] eal: optimize aligned rte_memcpy
This patch optimizes rte_memcpy for well aligned cases, where both
dst and src addr are aligned to maximum MOV width. It introduces a
dedicated function called rte_memcpy_aligned to handle the aligned
cases with simplified instruction stream. The existing rte_memcpy
is renamed as rte_memcpy_generic. The selection between them 2 is
done at the entry of rte_memcpy.
The existing rte_memcpy is for generic cases, it handles unaligned
copies and make store aligned, it even makes load aligned for micro
architectures like Ivy Bridge. However alignment handling comes at
a price: It adds extra load/store instructions, which can cause
complications sometime.
DPDK Vhost memcpy with Mergeable Rx Buffer feature as an example:
The copy is aligned, and remote, and there is header write along
which is also remote. In this case the memcpy instruction stream
should be simplified, to reduce extra load/store, therefore reduce
the probability of load/store buffer full caused pipeline stall, to
let the actual memcpy instructions be issued and let H/W prefetcher
goes to work as early as possible.
This patch is tested on Ivy Bridge, Haswell and Skylake, it provides
up to 20% gain for Virtio Vhost PVP traffic, with packet size ranging
from 64 to 1500 bytes.
The test can also be conducted without NIC, by setting loopback
traffic between Virtio and Vhost. For example, modify the macro
TXONLY_DEF_PACKET_LEN to the requested packet size in testpmd.h,
rebuild and start testpmd in both host and guest, then "start" on
one side and "start tx_first 32" on the other.
Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
---
.../common/include/arch/x86/rte_memcpy.h | 81 +++++++++++++++++++++-
1 file changed, 78 insertions(+), 3 deletions(-)
diff --git a/lib/librte_eal/common/include/arch/x86/rte_memcpy.h b/lib/librte_eal/common/include/arch/x86/rte_memcpy.h
index b3bfc23..b9785e8 100644
--- a/lib/librte_eal/common/include/arch/x86/rte_memcpy.h
+++ b/lib/librte_eal/common/include/arch/x86/rte_memcpy.h
@@ -69,6 +69,8 @@ rte_memcpy(void *dst, const void *src, size_t n) __attribute__((always_inline));
#ifdef RTE_MACHINE_CPUFLAG_AVX512F
+#define ALIGNMENT_MASK 0x3F
+
/**
* AVX512 implementation below
*/
@@ -189,7 +191,7 @@ rte_mov512blocks(uint8_t *dst, const uint8_t *src, size_t n)
}
static inline void *
-rte_memcpy(void *dst, const void *src, size_t n)
+rte_memcpy_generic(void *dst, const void *src, size_t n)
{
uintptr_t dstu = (uintptr_t)dst;
uintptr_t srcu = (uintptr_t)src;
@@ -308,6 +310,8 @@ COPY_BLOCK_128_BACK63:
#elif defined RTE_MACHINE_CPUFLAG_AVX2
+#define ALIGNMENT_MASK 0x1F
+
/**
* AVX2 implementation below
*/
@@ -387,7 +391,7 @@ rte_mov128blocks(uint8_t *dst, const uint8_t *src, size_t n)
}
static inline void *
-rte_memcpy(void *dst, const void *src, size_t n)
+rte_memcpy_generic(void *dst, const void *src, size_t n)
{
uintptr_t dstu = (uintptr_t)dst;
uintptr_t srcu = (uintptr_t)src;
@@ -499,6 +503,8 @@ COPY_BLOCK_128_BACK31:
#else /* RTE_MACHINE_CPUFLAG */
+#define ALIGNMENT_MASK 0x0F
+
/**
* SSE & AVX implementation below
*/
@@ -677,7 +683,7 @@ __extension__ ({ \
})
static inline void *
-rte_memcpy(void *dst, const void *src, size_t n)
+rte_memcpy_generic(void *dst, const void *src, size_t n)
{
__m128i xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8;
uintptr_t dstu = (uintptr_t)dst;
@@ -821,6 +827,75 @@ COPY_BLOCK_64_BACK15:
#endif /* RTE_MACHINE_CPUFLAG */
+static inline void *
+rte_memcpy_aligned(void *dst, const void *src, size_t n)
+{
+ void *ret = dst;
+
+ /* Copy size <= 16 bytes */
+ if (n < 16) {
+ if (n & 0x01) {
+ *(uint8_t *)dst = *(const uint8_t *)src;
+ src = (const uint8_t *)src + 1;
+ dst = (uint8_t *)dst + 1;
+ }
+ if (n & 0x02) {
+ *(uint16_t *)dst = *(const uint16_t *)src;
+ src = (const uint16_t *)src + 1;
+ dst = (uint16_t *)dst + 1;
+ }
+ if (n & 0x04) {
+ *(uint32_t *)dst = *(const uint32_t *)src;
+ src = (const uint32_t *)src + 1;
+ dst = (uint32_t *)dst + 1;
+ }
+ if (n & 0x08)
+ *(uint64_t *)dst = *(const uint64_t *)src;
+
+ return ret;
+ }
+
+ /* Copy 16 <= size <= 32 bytes */
+ if (n <= 32) {
+ rte_mov16((uint8_t *)dst, (const uint8_t *)src);
+ rte_mov16((uint8_t *)dst - 16 + n,
+ (const uint8_t *)src - 16 + n);
+
+ return ret;
+ }
+
+ /* Copy 32 < size <= 64 bytes */
+ if (n <= 64) {
+ rte_mov32((uint8_t *)dst, (const uint8_t *)src);
+ rte_mov32((uint8_t *)dst - 32 + n,
+ (const uint8_t *)src - 32 + n);
+
+ return ret;
+ }
+
+ /* Copy 64 bytes blocks */
+ for (; n >= 64; n -= 64) {
+ rte_mov64((uint8_t *)dst, (const uint8_t *)src);
+ dst = (uint8_t *)dst + 64;
+ src = (const uint8_t *)src + 64;
+ }
+
+ /* Copy whatever left */
+ rte_mov64((uint8_t *)dst - 64 + n,
+ (const uint8_t *)src - 64 + n);
+
+ return ret;
+}
+
+static inline void *
+rte_memcpy(void *dst, const void *src, size_t n)
+{
+ if (!(((uintptr_t)dst | (uintptr_t)src) & ALIGNMENT_MASK))
+ return rte_memcpy_aligned(dst, src, n);
+ else
+ return rte_memcpy_generic(dst, src, n);
+}
+
#ifdef __cplusplus
}
#endif
--
2.7.4
^ permalink raw reply related
* Re: [PATCH v2 12/32] net/i40e: set VF MAC from PF support
From: Lu, Wenzhuo @ 2016-12-08 1:01 UTC (permalink / raw)
To: Yigit, Ferruh, dev@dpdk.org
In-Reply-To: <ade05c4f-1e55-f276-81ff-952ae768cc15@intel.com>
Hi Ferruh,
> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Wednesday, December 7, 2016 10:30 PM
> To: Lu, Wenzhuo; dev@dpdk.org
> Subject: Re: [PATCH v2 12/32] net/i40e: set VF MAC from PF support
>
> On 12/7/2016 3:31 AM, Wenzhuo Lu wrote:
> > Support setting VF MAC address from PF.
> > User can call the API on PF to set a specific VF's MAC address.
> >
> > This will reset the VF.
> >
> > Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> > ---
>
> <...>
>
> >
> > +/**
> > + * Set the VF MAC address.
> > + *
> > + * This will reset the vf.
>
> It may be good if I add a comment that this also will remove all existing mac
> filters. Same to commit log perhaps.
Agree. Please:)
^ permalink raw reply
* Re: [PATCH v2 1/6] eventdev: introduce event driven programming model
From: Jerin Jacob @ 2016-12-08 1:24 UTC (permalink / raw)
To: Van Haaren, Harry
Cc: dev@dpdk.org, thomas.monjalon@6wind.com, Richardson, Bruce,
hemant.agrawal@nxp.com, Eads, Gage
In-Reply-To: <E923DB57A917B54B9182A2E928D00FA6129C9515@IRSMSX102.ger.corp.intel.com>
On Wed, Dec 07, 2016 at 10:57:13AM +0000, Van Haaren, Harry wrote:
> > From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
>
> Hi Jerin,
Hi Harry,
>
> Re v2 rte_event struct, there seems to be some changes in the struct layout and field sizes. I've investigated them, and would like to propose some changes to balance the byte-alignment and accessing of the fields.
OK. Looks like balanced byte-alignment makes more sense on IA.We will go with that then.
Few comments below,
>
> These changes target only the first 64 bits of the rte_event struct. I've left the current v2 code for reference, please find my proposed changes below.
>
> > +struct rte_event {
> > + /** WORD0 */
> > + RTE_STD_C11
> > + union {
> > + uint64_t event;
> > + /** Event attributes for dequeue or enqueue operation */
> > + struct {
> > + uint64_t flow_id:20;
> > + /**< Targeted flow identifier for the enqueue and
> > + * dequeue operation.
> > + * The value must be in the range of
> > + * [0, nb_event_queue_flows - 1] which
> > + * previously supplied to rte_event_dev_configure().
> > + */
> > + uint64_t sub_event_type:8;
> > + /**< Sub-event types based on the event source.
> > + * @see RTE_EVENT_TYPE_CPU
> > + */
> > + uint64_t event_type:4;
> > + /**< Event type to classify the event source.
> > + * @see RTE_EVENT_TYPE_ETHDEV, (RTE_EVENT_TYPE_*)
> > + */
> > + uint64_t sched_type:2;
> > + /**< Scheduler synchronization type (RTE_SCHED_TYPE_*)
> > + * associated with flow id on a given event queue
> > + * for the enqueue and dequeue operation.
> > + */
> > + uint64_t queue_id:8;
> > + /**< Targeted event queue identifier for the enqueue or
> > + * dequeue operation.
> > + * The value must be in the range of
> > + * [0, nb_event_queues - 1] which previously supplied to
> > + * rte_event_dev_configure().
> > + */
> > + uint64_t priority:8;
> > + /**< Event priority relative to other events in the
> > + * event queue. The requested priority should in the
> > + * range of [RTE_EVENT_DEV_PRIORITY_HIGHEST,
> > + * RTE_EVENT_DEV_PRIORITY_LOWEST].
> > + * The implementation shall normalize the requested
> > + * priority to supported priority value.
> > + * Valid when the device has
> > + * RTE_EVENT_DEV_CAP_FLAG_EVENT_QOS capability.
> > + */
> > + uint64_t op:2;
> > + /**< The type of event enqueue operation - new/forward/
> > + * etc.This field is not preserved across an instance
> > + * and is undefined on dequeue.
> > + * @see RTE_EVENT_OP_NEW, (RTE_EVENT_OP_*)
> > + */
> > + uint64_t impl_opaque:12;
> > + /**< Implementation specific opaque value.
> > + * An implementation may use this field to hold
> > + * implementation specific value to share between
> > + * dequeue and enqueue operation.
> > + * The application should not modify this field.
> > + */
> > + };
> > + };
>
> struct rte_event {
> /** WORD0 */
> RTE_STD_C11
> union {
> uint64_t event;
> struct {
> uint32_t flow_id: 24;
> uint32_t impl_opaque : 8; /* not defined on deq */
>
> uint8_t queue_id;
> uint8_t priority;
>
> uint8_t operation : 4; /* new fwd drop */
> uint8_t sched_type : 4;
>
> uint8_t event_type : 4;
> uint8_t sub_event_type : 4;
> };
> };
> /** word 1 */
> <snip>
>
>
> The changes made are as follows:
> * Add impl_opaque to the remaining 8 bits of those 32 bits (previous size was 12 bits)
OK
>
> * QueueID and Priority remain 8 bit integers - but now accessible as 8 bit ints.
OK
>
> * Operation and sched_type *increased* to 4 bits each (from previous value of 2) to allow future expansion without ABI changes
Anyway it will break ABI if we add new operation. I would propose to keep 4bit
reserved and add it when required.
>
> * Event type remains constant at 4 bits
OK
> * Restore flow_id to 24 bits of a 32 bit int (previous size was 20 bits)
> * sub-event-type reduced to 4 bits (previous value was 8 bits). Can we think of situations where 16 values for application specified identifiers of each event-type is genuinely not enough?
One packet will not go beyond 16 stages but an application may have more stages and
each packet may go mutually exclusive stages. For example,
packet 0: stagex_0 ->stagex_1
packet 1: stagey_0 ->stagey_1
In that sense, IMO, more than 16 is required.(AFIAK, VPP has any much larger limit on number of stages)
>
> In my opinion this structure layout is more balanced, and will perform better due to less loads that will need masking to access the required value.
OK. Considering more balanced layout and above points. I propose following scheme(based on your input)
union {
uint64_t event;
struct {
uint32_t flow_id: 20;
uint32_t sub_event_type : 8;
uint32_t event_type : 4;
uint8_t rsvd: 4; /* for future additions */
uint8_t operation : 2; /* new fwd drop */
uint8_t sched_type : 2;
uint8_t queue_id;
uint8_t priority;
uint8_t impl_opaque;
};
};
Feedback and improvements welcomed,
^ permalink raw reply
* [PATCH 0/2] minor cleanups
From: Stephen Hemminger @ 2016-12-08 1:47 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Saw this while reviewing other changes
Stephen Hemminger (2):
eth: get rid of goto's in rte_eth_dev_detach
sched/malloc: remove unnecesary return statements
drivers/net/bonding/rte_eth_bond_pmd.c | 2 +-
lib/librte_eal/common/rte_malloc.c | 1 -
lib/librte_ether/rte_ethdev.c | 21 +++++++--------------
lib/librte_sched/rte_bitmap.h | 2 --
4 files changed, 8 insertions(+), 18 deletions(-)
--
2.10.2
^ permalink raw reply
* [PATCH 1/2] eth: get rid of goto's in rte_eth_dev_detach
From: Stephen Hemminger @ 2016-12-08 1:47 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
In-Reply-To: <20161208014751.24285-1-stephen@networkplumber.org>
Extra goto's to just a return are unnecessary.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/librte_ether/rte_ethdev.c | 21 +++++++--------------
1 file changed, 7 insertions(+), 14 deletions(-)
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 4209ad0..40c7cc6 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -466,27 +466,20 @@ rte_eth_dev_attach(const char *devargs, uint8_t *port_id)
int
rte_eth_dev_detach(uint8_t port_id, char *name)
{
- int ret = -1;
+ int ret;
- if (name == NULL) {
- ret = -EINVAL;
- goto err;
- }
+ if (name == NULL)
+ return -EINVAL;
/* FIXME: move this to eal, once device flags are relocated there */
- if (rte_eth_dev_is_detachable(port_id))
- goto err;
+ ret = rte_eth_dev_is_detachable(port_id);
+ if (ret < 0)
+ return ret;
snprintf(name, sizeof(rte_eth_devices[port_id].data->name),
"%s", rte_eth_devices[port_id].data->name);
- ret = rte_eal_dev_detach(name);
- if (ret < 0)
- goto err;
- return 0;
-
-err:
- return ret;
+ return rte_eal_dev_detach(name);
}
static int
--
2.10.2
^ permalink raw reply related
* [PATCH 2/2] sched/malloc: remove unnecesary return statements
From: Stephen Hemminger @ 2016-12-08 1:47 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
In-Reply-To: <20161208014751.24285-1-stephen@networkplumber.org>
return statements at end of void functions are unnecessary and unwanted.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/bonding/rte_eth_bond_pmd.c | 2 +-
lib/librte_eal/common/rte_malloc.c | 1 -
lib/librte_sched/rte_bitmap.h | 2 --
3 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index a80b6fa..05afcee 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -241,8 +241,8 @@ arp_op_name(uint16_t arp_op, char *buf)
default:
break;
}
+
snprintf(buf, sizeof("Unknown"), "%s", "Unknown");
- return;
}
#endif
#define MaxIPv4String 16
diff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c
index f4a8835..09970b0 100644
--- a/lib/librte_eal/common/rte_malloc.c
+++ b/lib/librte_eal/common/rte_malloc.c
@@ -232,7 +232,6 @@ rte_malloc_dump_stats(FILE *f, __rte_unused const char *type)
fprintf(f, "\tAlloc_count:%u,\n",sock_stats.alloc_count);
fprintf(f, "\tFree_count:%u,\n", sock_stats.free_count);
}
- return;
}
/*
diff --git a/lib/librte_sched/rte_bitmap.h b/lib/librte_sched/rte_bitmap.h
index 010d752..d432fdf 100644
--- a/lib/librte_sched/rte_bitmap.h
+++ b/lib/librte_sched/rte_bitmap.h
@@ -453,8 +453,6 @@ rte_bitmap_clear(struct rte_bitmap *bmp, uint32_t pos)
offset1 = (pos >> RTE_BITMAP_CL_BIT_SIZE_LOG2) & RTE_BITMAP_SLAB_BIT_MASK;
slab1 = bmp->array1 + index1;
*slab1 &= ~(1lu << offset1);
-
- return;
}
static inline int
--
2.10.2
^ permalink raw reply related
* Re: [PATCH v2 1/6] eventdev: introduce event driven programming model
From: Jerin Jacob @ 2016-12-08 1:48 UTC (permalink / raw)
To: Bruce Richardson
Cc: dev, thomas.monjalon, hemant.agrawal, gage.eads, harry.van.haaren
In-Reply-To: <20161207111251.GA22932@bricha3-MOBL3.ger.corp.intel.com>
On Wed, Dec 07, 2016 at 11:12:51AM +0000, Bruce Richardson wrote:
> On Tue, Dec 06, 2016 at 09:22:15AM +0530, Jerin Jacob wrote:
> > In a polling model, lcores poll ethdev ports and associated
> > rx queues directly to look for packet. In an event driven model,
> > by contrast, lcores call the scheduler that selects packets for
> > them based on programmer-specified criteria. Eventdev library
> > adds support for event driven programming model, which offer
> > applications automatic multicore scaling, dynamic load balancing,
> > pipelining, packet ingress order maintenance and
> > synchronization services to simplify application packet processing.
> >
> > By introducing event driven programming model, DPDK can support
> > both polling and event driven programming models for packet processing,
> > and applications are free to choose whatever model
> > (or combination of the two) that best suits their needs.
> >
> > This patch adds the eventdev specification header file.
> >
> > Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> > ---
> > +
> > +/**
> > + * Link multiple source event queues supplied in *rte_event_queue_link*
> > + * structure as *queue_id* to the destination event port designated by its
> > + * *port_id* on the event device designated by its *dev_id*.
> > + *
> > + * The link establishment shall enable the event port *port_id* from
> > + * receiving events from the specified event queue *queue_id*
> > + *
> > + * An event queue may link to one or more event ports.
> > + * The number of links can be established from an event queue to event port is
> > + * implementation defined.
> > + *
> > + * Event queue(s) to event port link establishment can be changed at runtime
> > + * without re-configuring the device to support scaling and to reduce the
> > + * latency of critical work by establishing the link with more event ports
> > + * at runtime.
> > + *
> > + * @param dev_id
> > + * The identifier of the device.
> > + *
> > + * @param port_id
> > + * Event port identifier to select the destination port to link.
> > + *
> > + * @param link
> > + * Points to an array of *nb_links* objects of type *rte_event_queue_link*
> > + * structure which contain the event queue to event port link establishment
> > + * attributes.
> > + * NULL value is allowed, in which case this function links all the configured
> > + * event queues *nb_event_queues* which previously supplied to
> > + * rte_event_dev_configure() to the event port *port_id* with normal servicing
> > + * priority(RTE_EVENT_DEV_PRIORITY_NORMAL).
> > + *
> > + * @param nb_links
> > + * The number of links to establish
> > + *
> > + * @return
> > + * The number of links actually established. The return value can be less than
> > + * the value of the *nb_links* parameter when the implementation has the
> > + * limitation on specific queue to port link establishment or if invalid
> > + * parameters are specified in a *rte_event_queue_link*.
> > + * If the return value is less than *nb_links*, the remaining links at the end
> > + * of link[] are not established, and the caller has to take care of them.
> > + * If return value is less than *nb_links* then implementation shall update the
> > + * rte_errno accordingly, Possible rte_errno values are
> > + * (-EDQUOT) Quota exceeded(Application tried to link the queue configured with
> > + * RTE_EVENT_QUEUE_CFG_FLAG_SINGLE_LINK to more than one event ports)
> > + * (-EINVAL) Invalid parameter
> > + *
> > + */
> > +int
> > +rte_event_port_link(uint8_t dev_id, uint8_t port_id,
> > + const struct rte_event_queue_link link[],
> > + uint16_t nb_links);
> > +
>
> Hi again Jerin,
>
> another small suggestion here. I'm not a big fan of using small
> structures to pass parameters into functions, especially when not all
> fields are always going to be used. Rather than use the event queue link
> structure, can we just pass in two array parameters here - the list of
> QIDs, and the list of priorities. In cases where the eventdev
> implementation does not support link prioritization, or where the app
> does not want different priority mappings , then the second
> array can be null [implying NORMAL priority for the don't care case].
>
> int
> rte_event_port_link(uint8_t dev_id, uint8_t port_id,
> const uint8_t queues[], const uint8_t priorities[],
> uint16_t nb_queues);
>
> This just makes mapping an array of queues easier, as we can just pass
> an array of ints directly in, and it especially makes it easier to
> create a single link via:
>
> rte_event_port_link(dev_id, port_id, &queue_id, NULL, 1);
The reason why I thought of creating "struct rte_event_queue_link",
- Its easy to add new parameter in link attributes if required
- Its _easy_ to implement PAUSE and RESUME in application
PAUSE:
nr_links = rte_event_port_links_get(,,link)
rte_event_port_unlink_all
RESUME:
rte_event_port_link(,,link, nr_links);
No strong opinion here. I will go with your proposal then
>
> Regards,
> /Bruce
^ permalink raw reply
* Re: [PATCH v2] eal: optimize aligned rte_memcpy
From: Yuanhan Liu @ 2016-12-08 2:18 UTC (permalink / raw)
To: Zhihong Wang; +Cc: dev, thomas.monjalon, lei.a.yao
In-Reply-To: <1481074266-4461-1-git-send-email-zhihong.wang@intel.com>
On Tue, Dec 06, 2016 at 08:31:06PM -0500, Zhihong Wang wrote:
> This patch optimizes rte_memcpy for well aligned cases, where both
> dst and src addr are aligned to maximum MOV width. It introduces a
> dedicated function called rte_memcpy_aligned to handle the aligned
> cases with simplified instruction stream. The existing rte_memcpy
> is renamed as rte_memcpy_generic. The selection between them 2 is
> done at the entry of rte_memcpy.
>
> The existing rte_memcpy is for generic cases, it handles unaligned
> copies and make store aligned, it even makes load aligned for micro
> architectures like Ivy Bridge. However alignment handling comes at
> a price: It adds extra load/store instructions, which can cause
> complications sometime.
>
> DPDK Vhost memcpy with Mergeable Rx Buffer feature as an example:
> The copy is aligned, and remote, and there is header write along
> which is also remote. In this case the memcpy instruction stream
> should be simplified, to reduce extra load/store, therefore reduce
> the probability of load/store buffer full caused pipeline stall, to
> let the actual memcpy instructions be issued and let H/W prefetcher
> goes to work as early as possible.
>
> This patch is tested on Ivy Bridge, Haswell and Skylake, it provides
> up to 20% gain for Virtio Vhost PVP traffic, with packet size ranging
> from 64 to 1500 bytes.
>
> The test can also be conducted without NIC, by setting loopback
> traffic between Virtio and Vhost. For example, modify the macro
> TXONLY_DEF_PACKET_LEN to the requested packet size in testpmd.h,
> rebuild and start testpmd in both host and guest, then "start" on
> one side and "start tx_first 32" on the other.
>
>
> Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
--yliu
^ permalink raw reply
* [RFC] ethdev: expand size of eth_dev_name in next release
From: Stephen Hemminger @ 2016-12-08 2:27 UTC (permalink / raw)
To: dev
This came up while revising earlier work on Hyper-V.
The current versions of DPDK does not have enough space to support
a logical device name in VMBUS. The kernel exposes the VMBUS
devices by GUID in a manner similar to how PCI is expressed
with domain:host:function notation.
In order to support Hyper-V in a direct fashion, the eth_dev name
needs to be expanded. The standard format for text representation of GUID
is 36 bytes (plus null). See uuid_unparse(3).
The other alternative is to use base64 encoding, but this worse for
humans to read, and isn't directly handled by lib uuid.
---
doc/guides/rel_notes/release_17_02.rst | 4 +++-
lib/librte_ether/rte_ethdev.h | 4 ++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/doc/guides/rel_notes/release_17_02.rst b/doc/guides/rel_notes/release_17_02.rst
index 3b65038..52c97c6 100644
--- a/doc/guides/rel_notes/release_17_02.rst
+++ b/doc/guides/rel_notes/release_17_02.rst
@@ -116,7 +116,9 @@ ABI Changes
Also, make sure to start the actual text at the margin.
=========================================================
-
+ * The macro ``RTE_ETH_NAME_MAX_LEN`` used in rte_eth_dev_data will be
+ increased from 32 to 40 characters to allow for longer values such
+ as GUID which is 36 characters long (plus null character).
Shared Library Versions
-----------------------
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 9678179..68cb956 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1652,7 +1652,11 @@ struct rte_eth_dev_sriov {
};
#define RTE_ETH_DEV_SRIOV(dev) ((dev)->data->sriov)
+#ifdef RTE_NEXT_ABI
+#define RTE_ETH_NAME_MAX_LEN 40
+#else
#define RTE_ETH_NAME_MAX_LEN (32)
+#endif
/**
* @internal
--
2.10.2
^ permalink raw reply related
* [PATCH] doc: fix mistakes in contribution guide
From: Yong Wang @ 2016-12-08 4:19 UTC (permalink / raw)
To: john.mcnamara; +Cc: dev, Yong Wang
Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
---
doc/guides/contributing/documentation.rst | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/doc/guides/contributing/documentation.rst b/doc/guides/contributing/documentation.rst
index 5ec0675..5f16a0c 100644
--- a/doc/guides/contributing/documentation.rst
+++ b/doc/guides/contributing/documentation.rst
@@ -381,9 +381,9 @@ Lists
#. Item one.
#. Item two is a long line that is wrapped and then indented
- to match the start of the e first line.
+ to match the start of the first line.
- #. Item two is a long line that is wrapped and then indented to match
+ #. Item three is a long line that is wrapped and then indented to match
the start of the previous line.
* Definition lists can be written with or without a bullet::
@@ -477,7 +477,7 @@ Images
* `Inkscape <http://inkscape.org>`_ is the recommended graphics editor for creating the images.
Use some of the older images in ``doc/guides/prog_guide/img/`` as a template, for example ``mbuf1.svg``
- or ``ring-enqueue.svg``.
+ or ``ring-enqueue1.svg``.
* The SVG images should include a copyright notice, as an XML comment.
--
1.8.3.1
^ permalink raw reply related
* Re: [PATCH v2 09/32] rte: add APIs for VF stats get/reset
From: Zhang, Qi Z @ 2016-12-08 3:23 UTC (permalink / raw)
To: Yigit, Ferruh, Lu, Wenzhuo, dev@dpdk.org; +Cc: Thomas Monjalon
In-Reply-To: <86fe08d5-6f14-8495-c26c-2f08a5468587@intel.com>
Hi Ferruh:
> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Wednesday, December 7, 2016 9:52 PM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; dev@dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Thomas Monjalon
> <thomas.monjalon@6wind.com>
> Subject: Re: [dpdk-dev] [PATCH v2 09/32] rte: add APIs for VF stats get/reset
>
> On 12/7/2016 3:31 AM, Wenzhuo Lu wrote:
> > This patch add below two APIs so that VF statistics can be get/clear
> > from PF side.
> > rte_eth_vf_stats_get.
> > rte_eth_vf_stats_reset.
>
> patch subject can have " ... from PF" both to be consistent with other patches
> and to clarify what it does: add APIS to get/reset VF stats from PF?
>
> >
> > Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> > ---
>
> <...>
>
> > diff --git a/lib/librte_ether/rte_ethdev.h
> > b/lib/librte_ether/rte_ethdev.h index 9678179..8b564ee 100644
> > --- a/lib/librte_ether/rte_ethdev.h
> > +++ b/lib/librte_ether/rte_ethdev.h
> > @@ -1271,6 +1271,15 @@ typedef int (*eth_set_vf_vlan_filter_t)(struct
> rte_eth_dev *dev,
> > uint8_t vlan_on);
> > /**< @internal Set VF VLAN pool filter */
> >
> > +typedef int (*eth_vf_stats_get)(struct rte_eth_dev *dev,
> > + uint16_t vf,
> > + struct rte_eth_stats *stats);
> > +/**< @internal Get VF statistics */
> > +
> > +typedef int (*eth_vf_stats_reset)(struct rte_eth_dev *dev,
> > + uint16_t vf);
> > +/**< @internal Clear VF statistics */
> > +
> > typedef int (*eth_set_queue_rate_limit_t)(struct rte_eth_dev *dev,
> > uint16_t queue_idx,
> > uint16_t tx_rate);
> > @@ -1483,6 +1492,8 @@ struct eth_dev_ops {
> > eth_set_vf_rx_t set_vf_rx; /**< enable/disable a VF
> receive */
> > eth_set_vf_tx_t set_vf_tx; /**< enable/disable a VF
> transmit */
> > eth_set_vf_vlan_filter_t set_vf_vlan_filter; /**< Set VF VLAN filter */
> > + eth_vf_stats_get vf_stats_get; /**< Get VF's statistics */
> > + eth_vf_stats_reset vf_stats_reset; /**< Reset VF's statistics */
>
> Do we really want to add more ops to the eth_dev_ops?
>
> Although vf_stats_get & vf_stats_reset sounds generic, why not implement
> these first in PMD specific manner, and more PMDs implement these, move to
> the generic eth_dev_ops layer?
OK, will move to rte_pmd_i40 APIs.
> CC: Thomas
>
> <...>
Thanks
Qi
^ permalink raw reply
* Re: [RFC PATCH] eventdev: add buffered enqueue and flush APIs
From: Jerin Jacob @ 2016-12-08 4:41 UTC (permalink / raw)
To: Eads, Gage
Cc: dev@dpdk.org, Richardson, Bruce, Van Haaren, Harry,
hemant.agrawal@nxp.com
In-Reply-To: <60DABA4C-E3E8-4768-B2E4-BB97C6421A50@intel.com>
On Mon, Dec 05, 2016 at 11:30:46PM +0000, Eads, Gage wrote:
>
> > On Dec 3, 2016, at 5:18 AM, Jerin Jacob <jerin.jacob@caviumnetworks.com> wrote:
> >
> >> On Fri, Dec 02, 2016 at 01:45:56PM -0600, Gage Eads wrote:
> >> This commit adds buffered enqueue functionality to the eventdev API.
> >> It is conceptually similar to the ethdev API's tx buffering, however
> >> with a smaller API surface and no dropping of events.
> >
> > Hello Gage,
> > Different implementation may have different strategies to hold the buffers.
>
> A benefit of inlining the buffering logic in the header is that we avoid the overhead of entering the PMD for what is a fairly simple operation (common case: add event to an array, increment counter). If we make this implementation-defined (i.e. use PMD callbacks), we lose that benefit.
In general, I agree from the system perspective. But, few general issues with
eventdev integration part,
1) What if the burst has ATOMIC flows and if we are NOT en-queuing to the
implementation then other event ports won't get the packets from the same ATOMIC
tag ? BAD. Right?
2) At least, In our HW implementation, The event buffer strategy is more like,
if you enqueue to HW then ONLY you get the events from dequeue provided
if op == RTE_EVENT_OP_FORWARD.So it will create deadlock.i.e application cannot
hold the events with RTE_EVENT_OP_FORWARD
3) So considering the above case there is nothing like flush for us
4) In real high throughput benchmark case, we will get the packets at
the rate of max burst and then we always needs to memcpy before we flush.
Otherwise there will be ordering issue as burst can get us the packet from
different flows(unlike polling mode)
>
> > and some does not need to hold the buffers if it is DDR backed.
>
> Though DDR-backed hardware doesn't need to buffer in software, doing so would reduce the software overhead of enqueueing. Compared to N individual calls to enqueue, buffering N events then calling enqueue burst once can benefit from amortized (or parallelized) PMD-specific bookkeeping and error-checking across the set of events, and will definitely benefit from the amortized function call overhead and better I-cache behavior. (Essentially this is VPP from the fd.io project.) This should result in higher overall event throughout (agnostic of the underlying device).
See above. I am not against burst processing in "application".
The flush does not make sense for us in HW perspective and
it is costly for us if we trying generalize it.
>
> I'm skeptical that other buffering strategies would emerge, but I can only speculate on Cavium/NXP/etc. NPU software.
i>
> > IHMO, This may not be the candidate for common code. I guess you can move this
> > to driver side and abstract under SW driver's enqueue_burst.
> >
>
> I don't think that will work without adding a flush API, otherwise we could have indefinitely buffered events. I see three ways forward:
I agree. More portable way is to move the "flush" to the implementation and "flush"
whenever it makes sense to PMD.
>
> - The proposed approach
> - Add the proposed functions but make them implementation-specific.
> - Require the application to write its own buffering logic (i.e. no API change)
I think, If the additional function call overhead cost is too much for SW
implementation then we can think of implementation-specific API or
custom application flow based on SW driver.
But I am not fan of that(but tempted do now a days), If we take that route, we have truckload of custom
implementation specific API and now we try to hide all black magic under enqueue/dequeue
to make it portable at some expense.
>
> Thanks,
> Gage
>
> >
> >>
> >> Signed-off-by: Gage Eads <gage.eads@intel.com>
> >> ---
> >> lib/librte_eventdev/rte_eventdev.c | 29 ++++++++++
> >> lib/librte_eventdev/rte_eventdev.h | 106 +++++++++++++++++++++++++++++++++++++
> >> 2 files changed, 135 insertions(+)
> >>
> >> diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c
> >> index 17ce5c3..564573f 100644
> >> --- a/lib/librte_eventdev/rte_eventdev.c
> >> +++ b/lib/librte_eventdev/rte_eventdev.c
> >> @@ -219,6 +219,7 @@
> >> uint16_t *links_map;
> >> uint8_t *ports_dequeue_depth;
> >> uint8_t *ports_enqueue_depth;
> >> + struct rte_eventdev_enqueue_buffer *port_buffers;
> >> unsigned int i;
> >>
> >> EDEV_LOG_DEBUG("Setup %d ports on device %u", nb_ports,
> >> @@ -272,6 +273,19 @@
> >> "nb_ports %u", nb_ports);
> >> return -(ENOMEM);
> >> }
> >> +
> >> + /* Allocate memory to store port enqueue buffers */
> >> + dev->data->port_buffers =
> >> + rte_zmalloc_socket("eventdev->port_buffers",
> >> + sizeof(dev->data->port_buffers[0]) * nb_ports,
> >> + RTE_CACHE_LINE_SIZE, dev->data->socket_id);
> >> + if (dev->data->port_buffers == NULL) {
> >> + dev->data->nb_ports = 0;
> >> + EDEV_LOG_ERR("failed to get memory for port enq"
> >> + " buffers, nb_ports %u", nb_ports);
> >> + return -(ENOMEM);
> >> + }
> >> +
> >> } else if (dev->data->ports != NULL && nb_ports != 0) {/* re-config */
> >> RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->port_release, -ENOTSUP);
> >>
> >> @@ -279,6 +293,7 @@
> >> ports_dequeue_depth = dev->data->ports_dequeue_depth;
> >> ports_enqueue_depth = dev->data->ports_enqueue_depth;
> >> links_map = dev->data->links_map;
> >> + port_buffers = dev->data->port_buffers;
> >>
> >> for (i = nb_ports; i < old_nb_ports; i++)
> >> (*dev->dev_ops->port_release)(ports[i]);
> >> @@ -324,6 +339,17 @@
> >> return -(ENOMEM);
> >> }
> >>
> >> + /* Realloc memory to store port enqueue buffers */
> >> + port_buffers = rte_realloc(dev->data->port_buffers,
> >> + sizeof(dev->data->port_buffers[0]) * nb_ports,
> >> + RTE_CACHE_LINE_SIZE);
> >> + if (port_buffers == NULL) {
> >> + dev->data->nb_ports = 0;
> >> + EDEV_LOG_ERR("failed to realloc mem for port enq"
> >> + " buffers, nb_ports %u", nb_ports);
> >> + return -(ENOMEM);
> >> + }
> >> +
> >> if (nb_ports > old_nb_ports) {
> >> uint8_t new_ps = nb_ports - old_nb_ports;
> >>
> >> @@ -336,12 +362,15 @@
> >> memset(links_map +
> >> (old_nb_ports * RTE_EVENT_MAX_QUEUES_PER_DEV),
> >> 0, sizeof(ports_enqueue_depth[0]) * new_ps);
> >> + memset(port_buffers + old_nb_ports, 0,
> >> + sizeof(port_buffers[0]) * new_ps);
> >> }
> >>
> >> dev->data->ports = ports;
> >> dev->data->ports_dequeue_depth = ports_dequeue_depth;
> >> dev->data->ports_enqueue_depth = ports_enqueue_depth;
> >> dev->data->links_map = links_map;
> >> + dev->data->port_buffers = port_buffers;
> >> } else if (dev->data->ports != NULL && nb_ports == 0) {
> >> RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->port_release, -ENOTSUP);
> >>
> >> diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h
> >> index 778d6dc..3f24342 100644
> >> --- a/lib/librte_eventdev/rte_eventdev.h
> >> +++ b/lib/librte_eventdev/rte_eventdev.h
> >> @@ -246,6 +246,7 @@
> >> #include <rte_dev.h>
> >> #include <rte_memory.h>
> >> #include <rte_errno.h>
> >> +#include <rte_memcpy.h>
> >>
> >> #define EVENTDEV_NAME_SKELETON_PMD event_skeleton
> >> /**< Skeleton event device PMD name */
> >> @@ -965,6 +966,26 @@ typedef uint16_t (*event_dequeue_burst_t)(void *port, struct rte_event ev[],
> >> #define RTE_EVENTDEV_NAME_MAX_LEN (64)
> >> /**< @internal Max length of name of event PMD */
> >>
> >> +#define RTE_EVENT_BUF_MAX 16
> >> +/**< Maximum number of events in an enqueue buffer. */
> >> +
> >> +/**
> >> + * @internal
> >> + * An enqueue buffer for each port.
> >> + *
> >> + * The reason this struct is in the header is for inlining the function calls
> >> + * to enqueue, as doing a function call per packet would incur significant
> >> + * performance overhead.
> >> + *
> >> + * \see rte_event_enqueue_buffer(), rte_event_enqueue_buffer_flush()
> >> + */
> >> +struct rte_eventdev_enqueue_buffer {
> >> + /**> Count of events in this buffer */
> >> + uint16_t count;
> >> + /**> Array of events in this buffer */
> >> + struct rte_event events[RTE_EVENT_BUF_MAX];
> >> +} __rte_cache_aligned;
> >> +
> >> /**
> >> * @internal
> >> * The data part, with no function pointers, associated with each device.
> >> @@ -983,6 +1004,8 @@ struct rte_eventdev_data {
> >> /**< Number of event ports. */
> >> void **ports;
> >> /**< Array of pointers to ports. */
> >> + struct rte_eventdev_enqueue_buffer *port_buffers;
> >> + /**< Array of port enqueue buffers. */
> >> uint8_t *ports_dequeue_depth;
> >> /**< Array of port dequeue depth. */
> >> uint8_t *ports_enqueue_depth;
> >> @@ -1132,6 +1155,89 @@ struct rte_eventdev {
> >> }
> >>
> >> /**
> >> + * Flush the enqueue buffer of the event port specified by *port_id*, in the
> >> + * event device specified by *dev_id*.
> >> + *
> >> + * This function attempts to flush as many of the buffered events as possible,
> >> + * and returns the number of flushed events. Any unflushed events remain in
> >> + * the buffer.
> >> + *
> >> + * @param dev_id
> >> + * The identifier of the device.
> >> + * @param port_id
> >> + * The identifier of the event port.
> >> + *
> >> + * @return
> >> + * The number of event objects actually flushed to the event device.
> >> + *
> >> + * \see rte_event_enqueue_buffer(), rte_event_enqueue_burst()
> >> + * \see rte_event_port_enqueue_depth()
> >> + */
> >> +static inline int
> >> +rte_event_enqueue_buffer_flush(uint8_t dev_id, uint8_t port_id)
> >> +{
> >> + struct rte_eventdev *dev = &rte_eventdevs[dev_id];
> >> + struct rte_eventdev_enqueue_buffer *buf =
> >> + &dev->data->port_buffers[port_id];
> >> + int n;
> >> +
> >> + n = rte_event_enqueue_burst(dev_id, port_id, buf->events, buf->count);
> >> +
> >> + if (n != buf->count)
> >> + memmove(buf->events, &buf->events[n], buf->count - n);
> >> +
> >> + buf->count -= n;
> >> +
> >> + return n;
> >> +}
> >> +
> >> +/**
> >> + * Buffer an event object supplied in *rte_event* structure for future
> >> + * enqueueing on an event device designated by its *dev_id* through the event
> >> + * port specified by *port_id*.
> >> + *
> >> + * This function takes a single event and buffers it for later enqueuing to the
> >> + * queue specified in the event structure. If the buffer is full, the
> >> + * function will attempt to flush the buffer before buffering the event.
> >> + * If the flush operation fails, the previously buffered events remain in the
> >> + * buffer and an error is returned to the user to indicate that *ev* was not
> >> + * buffered.
> >> + *
> >> + * @param dev_id
> >> + * The identifier of the device.
> >> + * @param port_id
> >> + * The identifier of the event port.
> >> + * @param ev
> >> + * Pointer to struct rte_event
> >> + *
> >> + * @return
> >> + * - 0 on success
> >> + * - <0 on failure. Failure can occur if the event port's output queue is
> >> + * backpressured, for instance.
> >> + *
> >> + * \see rte_event_enqueue_buffer_flush(), rte_event_enqueue_burst()
> >> + * \see rte_event_port_enqueue_depth()
> >> + */
> >> +static inline int
> >> +rte_event_enqueue_buffer(uint8_t dev_id, uint8_t port_id, struct rte_event *ev)
> >> +{
> >> + struct rte_eventdev *dev = &rte_eventdevs[dev_id];
> >> + struct rte_eventdev_enqueue_buffer *buf =
> >> + &dev->data->port_buffers[port_id];
> >> + int ret;
> >> +
> >> + /* If necessary, flush the enqueue buffer to make space for ev. */
> >> + if (buf->count == RTE_EVENT_BUF_MAX) {
> >> + ret = rte_event_enqueue_buffer_flush(dev_id, port_id);
> >> + if (ret == 0)
> >> + return -ENOSPC;
> >> + }
> >> +
> >> + rte_memcpy(&buf->events[buf->count++], ev, sizeof(struct rte_event));
> >> + return 0;
> >> +}
> >> +
> >> +/**
> >> * Converts nanoseconds to *wait* value for rte_event_dequeue()
> >> *
> >> * If the device is configured with RTE_EVENT_DEV_CFG_PER_DEQUEUE_WAIT flag then
> >> --
> >> 1.9.1
> >>
^ permalink raw reply
* Re: [PATCH 00/13] Introducing EAL Bus-Device-Driver Model
From: Shreyansh Jain @ 2016-12-08 5:04 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: David Marchand, dev
In-Reply-To: <1524529.OpOKghfniY@xps13>
On Wednesday 07 December 2016 06:54 PM, Thomas Monjalon wrote:
> 2016-12-07 18:40, Shreyansh Jain:
>> Is there anything specific that you are looking for in patchset v2?
>> I was thinking of:
>> 0. fixing BSD compilation issue reported by CI
>> 1. improving the test_pci.c
>> 2. hotplugging
>> 3. trying to move PCI to drives/bus/pci/linux/* and resolving how
>> drivers link to it, and how EAL resources like devargs are consumed.
>
> I am concerned about the time needed for all these changes.
> Please let's make sure that the basic parts are well done and pushed, first.
> That's why I suggest to postpone 1, 2 and 3 to next release if possible.
> The priority is to have a clean bus model,
> and if time permits, integrate the NXP driver.
>
I am absolutely OK with this.
Just a confirmation, though. Is it OK to have a broken test_pci.c (1) in
a series? It is not getting compiled by default, but it would definitely
not work if compiled (symbols are missing).
^ permalink raw reply
* Re: [PATCH] vhost: allow for many vhost user ports
From: Yuanhan Liu @ 2016-12-08 5:50 UTC (permalink / raw)
To: Jan Wickbom; +Cc: dev@dpdk.org, Patrik Andersson R
In-Reply-To: <AM4PR0701MB2146020B030F882D09A24A4E94850@AM4PR0701MB2146.eurprd07.prod.outlook.com>
On Wed, Dec 07, 2016 at 01:23:48PM +0000, Jan Wickbom wrote:
> > On Thu, Dec 01, 2016 at 04:26:50PM +0100, Jan Wickbom wrote:
> > > static int
> > > -fdset_fill(fd_set *rfset, fd_set *wfset, struct fdset *pfdset)
> > > +fdset_fill(struct pollfd *rwfds, struct fdset *pfdset)
...
> > > + rwfds[i].fd = pfdentry->fd;
> > > + rwfds[i].events = pfdentry->rcb ? POLLIN : 0;
> > > + rwfds[i].events |= pfdentry->wcb ? POLLOUT :
> > 0;
> >
> > Another thing is we don't have to re-init this rwfds array again
> > and again. Instead, we could
> >
> > - set it up correctly when fdset_add is invoked: set the fd and
> > events.
> >
> > - reset revents when it's been handled at fdset_event_dispatch().
> >
> > - swap with the last one and shrink the array on fd delete
> >
> > Could you make a follow up patch for that?
>
> I don't see how that could easily be done. The loop index, i, is a direct reference between
> an entry in the rwfds array and an entry in the pfdset array. It should stay like that while we are
> hanging in the poll(). If an entry in the pfdset array is removed while we are hanging in the poll()
> and we then immediately replaces it with the last entry in the array we will end up in trouble if the
> revent gets set for the "replaced" index. The direct reference is gone.
> Or am I missing something?
Yes, we should not shrink the rwfds during the poll, but we could later, at
the end of the while() loop.
Talking about that, you should not invoke fdset_shrink() inside fdset_del(),
since it could be in the poll stage.
--yliu
^ permalink raw reply
* Re: [PATCH 5/5] examples/l3fwd: add parse-ptype option
From: Yuanhan Liu @ 2016-12-08 6:59 UTC (permalink / raw)
To: Jianfeng Tan; +Cc: dev, stephen
In-Reply-To: <1480810702-114815-6-git-send-email-jianfeng.tan@intel.com>
On Sun, Dec 04, 2016 at 12:18:22AM +0000, Jianfeng Tan wrote:
> To support those devices that do not provide packet type info when
> receiving packets, add a new option, --parse-ptype, to analyze
> packet type in the Rx callback.
A quick question: does this patch have anything to do with the virtio
interrupt enabling?
--yliu
^ permalink raw reply
* Re: [PATCH v2 1/8] eal: define container_of macro
From: Shreyansh Jain @ 2016-12-08 7:01 UTC (permalink / raw)
To: Jan Blunck, dev; +Cc: david.marchand, Jan Viktorin
In-Reply-To: <1479747322-5774-1-git-send-email-jblunck@infradead.org>
Hello Jan,
Need your help in resolving the checkpatch issue for this patch.
I have used this in EAL Bus series [1].
[1] http://dpdk.org/ml/archives/dev/2016-December/051350.html
On Monday 21 November 2016 10:25 PM, Jan Blunck wrote:
> This macro is based on Jan Viktorin's original patch but also checks the
> type of the passed pointer against the type of the member.
>
> Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
> Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
> [jblunck@infradead.org: add type checking and __extension__]
> Signed-off-by: Jan Blunck <jblunck@infradead.org>
> ---
> lib/librte_eal/common/include/rte_common.h | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
> diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h
> index db5ac91..8dda3e2 100644
> --- a/lib/librte_eal/common/include/rte_common.h
> +++ b/lib/librte_eal/common/include/rte_common.h
> @@ -331,6 +331,26 @@ rte_bsf32(uint32_t v)
> #define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)
> #endif
>
> +/**
> + * Return pointer to the wrapping struct instance.
> + *
> + * Example:
> + *
> + * struct wrapper {
> + * ...
> + * struct child c;
> + * ...
> + * };
> + *
> + * struct child *x = obtain(...);
> + * struct wrapper *w = container_of(x, struct wrapper, c);
> + */
> +#ifndef container_of
> +#define container_of(ptr, type, member) __extension__ ({ \
> + typeof(((type *)0)->member) *_ptr = (ptr); \
> + (type *)(((char *)_ptr) - offsetof(type, member)); })
> +#endif
(I think there was discussion in ML about this but where, I couldn't
find it).
Above code snippet doesn't go down well with the checkpatch script. It
reports:
---->8----
ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in
parentheses
#40: FILE: lib/librte_eal/common/include/rte_common.h:349:
+#define container_of(ptr, type, member) __extension__ ({
\
+ typeof(((type *)0)->member) *_ptr = (ptr); \
+ (type *)(((char *)_ptr) - offsetof(type,
member)); })
ERROR:SPACING: need consistent spacing around '*' (ctx:WxV)
#41: FILE: lib/librte_eal/common/include/rte_common.h:350:
+ typeof(((type *)0)->member) *_ptr = (ptr); \
---->8----
Second error is primarily because of '*<space>_ptr' rather than '*_ptr'.
Is do{ ... }while(0) the fix for the first one?
This:
---->8----
#ifndef container_of
#define container_of(ptr, type, member) do { \
__extension__ \
typeof(((type *)0)->member) * _ptr = (ptr); \
(type *)(((char *)_ptr) - offsetof(type, member));\
} while (0)
#endif
---->8----
Seems to be ok with checkpatch. Do you see any technical/compiler issue
with this?
> +
> #define _RTE_STR(x) #x
> /** Take a macro value and get a string version of it */
> #define RTE_STR(x) _RTE_STR(x)
>
-
Shreyansh
^ permalink raw reply
* Re: [PATCH 1/3] net/virtio_user: add vhost layer
From: Yuanhan Liu @ 2016-12-08 7:21 UTC (permalink / raw)
To: Jianfeng Tan; +Cc: dev, ferruh.yigit, cunming.liang
In-Reply-To: <1480689075-66977-2-git-send-email-jianfeng.tan@intel.com>
On Fri, Dec 02, 2016 at 02:31:13PM +0000, Jianfeng Tan wrote:
> To support vhost kernel as the backend of net_virtio_user in comming
> patches, we abstract a vhost layer to hide all vhost_user functions.
> - Move vhost_user specific structs and macros into vhost_user.c,
> and only keep common definitions in vhost.h;
Do that in another patch.
> - Add a struct vhost_internal, and an array to store vhost_user and
> vhost_kernel backends; in multiqueue case, vhost_user has only
> one vhost FD, but vhost_kernel would have multiple FDs (equal to
> # of queues), so we turn to use an id to index the backend info;
It's okay to add a struct for that, but what's the point of referencing
it by an id? Instead, you could directly allocate one and return it.
This would also remove the hardcoded limit: 8 devices at most.
> - Add a struct vhost_ops depending on different type of backends.
Firstly, the "control" method is not well named, IMO. Something like
"send_request" is better.
And there is another way to achieve that: instead of introducing one
callback (control, or send_request) for all requests, you could
define one callback for each request. QEMU switched to that way
few releases ago. In that way, you don't have to do the request
translation at least.
Last, please make one patch for each of 3 items. It helps review.
--yliu
^ permalink raw reply
* Re: [PATCH 00/13] Introducing EAL Bus-Device-Driver Model
From: Thomas Monjalon @ 2016-12-08 7:21 UTC (permalink / raw)
To: Shreyansh Jain; +Cc: David Marchand, dev
In-Reply-To: <a0b14c5f-ad9d-dc08-90f3-284226ce714a@nxp.com>
2016-12-08 10:34, Shreyansh Jain:
> On Wednesday 07 December 2016 06:54 PM, Thomas Monjalon wrote:
> > 2016-12-07 18:40, Shreyansh Jain:
> >> Is there anything specific that you are looking for in patchset v2?
> >> I was thinking of:
> >> 0. fixing BSD compilation issue reported by CI
> >> 1. improving the test_pci.c
> >> 2. hotplugging
> >> 3. trying to move PCI to drives/bus/pci/linux/* and resolving how
> >> drivers link to it, and how EAL resources like devargs are consumed.
> >
> > I am concerned about the time needed for all these changes.
> > Please let's make sure that the basic parts are well done and pushed, first.
> > That's why I suggest to postpone 1, 2 and 3 to next release if possible.
> > The priority is to have a clean bus model,
> > and if time permits, integrate the NXP driver.
> >
>
> I am absolutely OK with this.
>
> Just a confirmation, though. Is it OK to have a broken test_pci.c (1) in
> a series? It is not getting compiled by default, but it would definitely
> not work if compiled (symbols are missing).
No, that's why I said "if possible" :).
I thought 1. was about improvements. But if it does not compile, it is
a must.
^ permalink raw reply
* Re: [PATCH 5/5] examples/l3fwd: add parse-ptype option
From: Tan, Jianfeng @ 2016-12-08 7:40 UTC (permalink / raw)
To: Yuanhan Liu; +Cc: dev@dpdk.org, stephen@networkplumber.org
In-Reply-To: <20161208065928.GA30698@yliu-dev.sh.intel.com>
> -----Original Message-----
> From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com]
> Sent: Thursday, December 8, 2016 2:59 PM
> To: Tan, Jianfeng
> Cc: dev@dpdk.org; stephen@networkplumber.org
> Subject: Re: [PATCH 5/5] examples/l3fwd: add parse-ptype option
>
> On Sun, Dec 04, 2016 at 12:18:22AM +0000, Jianfeng Tan wrote:
> > To support those devices that do not provide packet type info when
> > receiving packets, add a new option, --parse-ptype, to analyze
> > packet type in the Rx callback.
>
> A quick question: does this patch have anything to do with the virtio
> interrupt enabling?
Yes, it does as this example is used to test the functionality. But like l3fwd example, this example depends on the ptypes to forward packets. So we need to add software parser to parse ptypes like l3fwd example.
Thanks,
Jianfeng
>
> --yliu
^ permalink raw reply
* Re: [PATCH 1/4] eal/common: introduce rte_memset on IA platform
From: Yang, Zhiyong @ 2016-12-08 7:41 UTC (permalink / raw)
To: Thomas Monjalon
Cc: dev@dpdk.org, yuanhan.liu@linux.intel.com, Richardson, Bruce,
Ananyev, Konstantin, De Lara Guarch, Pablo
In-Reply-To: <7223515.9TZuZb6buy@xps13>
HI, Thomas:
Sorry for late reply. I have been being always considering your suggestion.
> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Friday, December 2, 2016 6:25 PM
> To: Yang, Zhiyong <zhiyong.yang@intel.com>
> Cc: dev@dpdk.org; yuanhan.liu@linux.intel.com; Richardson, Bruce
> <bruce.richardson@intel.com>; Ananyev, Konstantin
> <konstantin.ananyev@intel.com>; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>
> Subject: Re: [dpdk-dev] [PATCH 1/4] eal/common: introduce rte_memset on
> IA platform
>
> 2016-12-05 16:26, Zhiyong Yang:
> > +#ifndef _RTE_MEMSET_X86_64_H_
>
> Is this implementation specific to 64-bit?
>
Yes.
> > +
> > +#define rte_memset memset
> > +
> > +#else
> > +
> > +static void *
> > +rte_memset(void *dst, int a, size_t n);
> > +
> > +#endif
>
> If I understand well, rte_memset (as rte_memcpy) is using the most recent
> instructions available (and enabled) when compiling.
> It is not adapting the instructions to the run-time CPU.
> There is no need to downgrade at run-time the instruction set as it is
> obviously not a supported case, but it would be nice to be able to upgrade a
> "default compilation" at run-time as it is done in rte_acl.
> I explain this case more clearly for reference:
>
> We can have AVX512 supported in the compiler but disable it when compiling
> (CONFIG_RTE_MACHINE=snb) in order to build a binary running almost
> everywhere.
> When running this binary on a CPU having AVX512 support, it will not benefit
> of the AVX512 improvement.
> Though, we can compile an AVX512 version of some functions and use them
> only if the running CPU is capable.
> This kind of miracle can be achieved in two ways:
>
> 1/ For generic C code compiled with a recent GCC, a function can be built for
> several CPUs thanks to the attribute target_clones.
>
> 2/ For manually optimized functions using CPU-specific intrinsics or asm, it is
> possible to build them with non-default flags thanks to the attribute target.
>
> 3/ For manually optimized files using CPU-specific intrinsics or asm, we use
> specifics flags in the makefile.
>
> The function clone in case 1/ is dynamically chosen at run-time through ifunc
> resolver.
> The specific functions in cases 2/ and 3/ must chosen at run-time by
> initializing a function pointer thanks to rte_cpu_get_flag_enabled().
>
> Note that rte_hash and software crypto PMDs have a run-time check with
> rte_cpu_get_flag_enabled() but do not override CFLAGS in the Makefile.
> Next step for these libraries?
>
> Back to rte_memset, I think you should try the solution 2/.
I have read the ACL code, if I understand well , for complex algo implementation,
it is good idea, but Choosing functions at run time will bring some overhead. For frequently called function
Which consumes small cycles, the overhead maybe is more than the gains optimizations brings
For example, for most applications in dpdk, memset only set N = 10 or 12bytes. It consumes fewer cycles.
Thanks
Zhiyong
^ permalink raw reply
* Re: [PATCH 00/13] Introducing EAL Bus-Device-Driver Model
From: Shreyansh Jain @ 2016-12-08 7:53 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: David Marchand, dev@dpdk.org
In-Reply-To: <1743313.gQvgAgeimG@xps13>
> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Thursday, December 08, 2016 12:51 PM
> To: Shreyansh Jain <shreyansh.jain@nxp.com>
> Cc: David Marchand <david.marchand@6wind.com>; dev@dpdk.org
> Subject: Re: [PATCH 00/13] Introducing EAL Bus-Device-Driver Model
>
> 2016-12-08 10:34, Shreyansh Jain:
> > On Wednesday 07 December 2016 06:54 PM, Thomas Monjalon wrote:
> > > 2016-12-07 18:40, Shreyansh Jain:
> > >> Is there anything specific that you are looking for in patchset v2?
> > >> I was thinking of:
> > >> 0. fixing BSD compilation issue reported by CI
> > >> 1. improving the test_pci.c
> > >> 2. hotplugging
> > >> 3. trying to move PCI to drives/bus/pci/linux/* and resolving how
> > >> drivers link to it, and how EAL resources like devargs are consumed.
> > >
> > > I am concerned about the time needed for all these changes.
> > > Please let's make sure that the basic parts are well done and pushed,
> first.
> > > That's why I suggest to postpone 1, 2 and 3 to next release if possible.
> > > The priority is to have a clean bus model,
> > > and if time permits, integrate the NXP driver.
> > >
> >
> > I am absolutely OK with this.
> >
> > Just a confirmation, though. Is it OK to have a broken test_pci.c (1) in
> > a series? It is not getting compiled by default, but it would definitely
> > not work if compiled (symbols are missing).
>
> No, that's why I said "if possible" :).
> I thought 1. was about improvements. But if it does not compile, it is
> a must.
Agree.
I should have mentioned 'fixing the test_pci.c' rather than 'improvement'.
^ permalink raw reply
* Re: [PATCH 3/3] net/virtio_user: fix wrongly set features
From: Yuanhan Liu @ 2016-12-08 8:32 UTC (permalink / raw)
To: Jianfeng Tan; +Cc: dev, ferruh.yigit, cunming.liang
In-Reply-To: <1480689075-66977-4-git-send-email-jianfeng.tan@intel.com>
On Fri, Dec 02, 2016 at 02:31:15PM +0000, Jianfeng Tan wrote:
> Before the commit 86d59b21468a ("net/virtio: support LRO"), features
> in virtio PMD, is decided and properly set at device initialization
> and will not be changed. But afterward, features could be changed in
> virtio_dev_configure(), and will be re-negotiated if it's changed.
>
> In virtio_user, host features is obtained at device initialization
> only once, but we did not store it. So the added feature bits in
> re-negotiation will fail.
I think you misunderstood the features negotiation logic here, since
the beginning.
The feature negotiation is a work of 3 parts (the virtio device, the
virtio driver and the vhost). Each part has it's own feature bits
to claim what kind of features it supports.
On the init stage, the driver will have a sync with the device, and
that's what the "get_features" and "set_features" for. Once they have
come to an agreement on the negotiated features, it will have a
last sync with the vhost backend, through the GET_FEATURES and
SET_FEATURES request.
Last, we would have a features bits that would work for all of the
3 parts.
That said, you should not mix the driver's features bits with the
device one. It's Okay to introduce host_features, but it should not
be in the driver layer, it should be in the device layer. And naming
it to something like "device_features" is better, IMO.
And maybe you should re-visit the whole virtio_user features negotiation
logic, to see what can be improved.
Besides, I would put the bug fixing patch in the first of a series,
so that it has minimal chance to introduce conflics while backporting
it to a stable branch.
--yliu
>
> Fixes: e9efa4d93821 ("net/virtio-user: add new virtual PCI driver")
>
> Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
> ---
> drivers/net/virtio/virtio_user/virtio_user_dev.c | 2 +-
> drivers/net/virtio/virtio_user/virtio_user_dev.h | 1 +
> drivers/net/virtio/virtio_user_ethdev.c | 4 ++--
> 3 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
> index 3aef5f6..a9157a9 100644
> --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
> +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
> @@ -224,7 +224,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
> }
>
> if (vhost_call(dev->vid, VHOST_USER_GET_FEATURES,
> - &dev->features) < 0) {
> + &dev->host_features) < 0) {
> PMD_INIT_LOG(ERR, "get_features failed: %s", strerror(errno));
> return -1;
> }
> diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.h b/drivers/net/virtio/virtio_user/virtio_user_dev.h
> index 80efb6e..d219432 100644
> --- a/drivers/net/virtio/virtio_user/virtio_user_dev.h
> +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.h
> @@ -47,6 +47,7 @@ struct virtio_user_dev {
> uint32_t queue_pairs;
> uint32_t queue_size;
> uint64_t features;
> + uint64_t host_features;
> uint8_t status;
> uint8_t mac_addr[ETHER_ADDR_LEN];
> char path[PATH_MAX];
> diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c
> index 406beea..cfe2bfc 100644
> --- a/drivers/net/virtio/virtio_user_ethdev.c
> +++ b/drivers/net/virtio/virtio_user_ethdev.c
> @@ -117,7 +117,7 @@ virtio_user_get_features(struct virtio_hw *hw)
> {
> struct virtio_user_dev *dev = virtio_user_get_dev(hw);
>
> - return dev->features;
> + return dev->host_features;
> }
>
> static void
> @@ -125,7 +125,7 @@ virtio_user_set_features(struct virtio_hw *hw, uint64_t features)
> {
> struct virtio_user_dev *dev = virtio_user_get_dev(hw);
>
> - dev->features = features;
> + dev->features = features & dev->host_features;
> }
>
> static uint8_t
> --
> 2.7.4
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox