[PATCH v3 0/5] Improve EAL bit operations API

Mattias Rönnblom hofors at lysator.liu.se
Mon Sep 9 14:04:59 CEST 2024


On 2024-09-05 10:10, David Marchand wrote:
> Hello,
> 
> On Tue, Aug 20, 2024 at 7:05 PM Mattias Rönnblom <hofors at lysator.liu.se> wrote:
>>
>> On 2024-08-12 14:49, Mattias Rönnblom wrote:
>>> This patch set represent an attempt to improve and extend the RTE
>>> bitops API, in particular for functions that operate on individual
>>> bits.
>>>
>>
>> Is there anyone else that has any opinion on this patch set? Details, or
>> big picture.
> 
> Tyler, are you ok with this series?
> 
> Mattias, there are issues reported by the CI (compilation on Ubuntu
> 22.04 in GHA, and unit test failure in UNH), please have a look.
> 
> 

Standard practice in DPDK header files is the following:

--
/* rte_bar.h */
#ifdef __cplusplus
extern "C" {
#endif

#include <rte_foo.h>

void
rte_foo_do(void);

/../
--

That seems not like best practice to me, since rte_bar.h is messing 
around with linkage of constructs of any files included. In particular, 
it prohibits replacing _Generic with C++ function overloading, in C++ TUs.

What one should do is to have extern "C" linkage only on functions which 
the include file in question (e.g., rte_foo.h) itself declares.

--
/* rte_bar.h */
#include <rte_foo.h>

#ifdef __cplusplus
extern "C" {
#endif

void
rte_foo_do(void);

/../
--

There are 259 header files in the DPDK repo in need of fixing.

Should the fix be 259 patches, or something smaller? One large patch, or 
a patch per library, or something else. Please advise, over.


More information about the dev mailing list