[dpdk-dev] [PATCH] event/dsw: use custom element size ring forcontrol
Mattias Rönnblom
mattias.ronnblom at ericsson.com
Tue Jan 21 14:54:00 CET 2020
On 2020-01-21 13:04, Morten Brørup wrote:
>> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Mattias Rönnblom
>> Sent: Monday, January 20, 2020 4:03 PM
>>
>> Replace DSW's use of regular DPDK rings (and code for
>> packing/unpacking control messages into void pointers) with custom
>> size rings.
>>
>> In addition to cleaner code, this change allows DSW to support up to
>> the eventdev API's maximum of 255 ports by tweaking DSW_MAX_PORTS.
> Considering that the mbuf port_id was increased from 8 to 16 bit a long time ago... does it make sense increasing this and perhaps the eventdev API's type from 8 to 16 bit too?
Moving from uint8_t to uint16_t in the Eventdev API seems like a good
idea to me. The need for eventdev ports typically grows with growing
lcore count, and some systems aren't too far from 255 (or is it 256)?
I don't think it makes sense to use uint16_t internally in DSW before
this happen, though.
>> Signed-off-by: Mattias Rönnblom <mattias.ronnblom at ericsson.com>
>> ---
>> drivers/event/dsw/Makefile | 3 +++
>> drivers/event/dsw/dsw_evdev.c | 9 ++++++---
>> drivers/event/dsw/dsw_evdev.h | 10 +++-------
>> drivers/event/dsw/dsw_event.c | 16 ++--------------
>> drivers/event/dsw/meson.build | 3 +++
>> 5 files changed, 17 insertions(+), 24 deletions(-)
>>
> [snip]
>
>> diff --git a/drivers/event/dsw/dsw_evdev.h
>> b/drivers/event/dsw/dsw_evdev.h
>> index dc28ab125..5c7b6108d 100644
>> --- a/drivers/event/dsw/dsw_evdev.h
>> +++ b/drivers/event/dsw/dsw_evdev.h
>> @@ -10,7 +10,6 @@
>>
>> #define DSW_PMD_NAME RTE_STR(event_dsw)
>>
>> -/* Code changes are required to allow more ports. */
>> #define DSW_MAX_PORTS (64)
> 64 or 256?
64 to save some memory, in the common case.
>> #define DSW_MAX_PORT_DEQUEUE_DEPTH (128)
>> #define DSW_MAX_PORT_ENQUEUE_DEPTH (128)
>> @@ -226,15 +225,12 @@ struct dsw_evdev {
>> #define DSW_CTL_UNPAUS_REQ (1)
>> #define DSW_CTL_CFM (2)
>>
>> -/* sizeof(struct dsw_ctl_msg) must be equal or less than
>> - * sizeof(void *), to fit on the control ring.
>> - */
>> struct dsw_ctl_msg {
>> - uint8_t type:2;
>> - uint8_t originating_port_id:6;
>> + uint8_t type;
>> + uint8_t originating_port_id;
>> uint8_t queue_id;
>> uint16_t flow_hash;
>> -} __rte_packed;
>> +} __rte_aligned(4);
> [snip]
>
>
> Med venlig hilsen / kind regards
> - Morten Brørup
>
More information about the dev
mailing list