[dpdk-dev] [PATCH v2 6/7] drivers: remove POSIX dependencies
dmitry.kozliuk at gmail.com
Sun Feb 21 18:05:36 CET 2021
On Sun, 21 Feb 2021 18:54:01 +0300, Andrew Rybchenko wrote:
> On 2/21/21 11:59 AM, Tal Shnaiderman wrote:
> >> Subject: [dpdk-dev] [PATCH v2 6/7] drivers: remove POSIX dependencies
> >> External email: Use caution opening links or attachments
> >> Replace POSIX strncasecmp() with EAL rte_strncasecmp().
> >> Replace POSIX strtok_r() with EAL rte_strtok().
> >> Replace POSIX strdup() with EAL rte_strdup().
> >> Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk at gmail.com>
> >> ---
> >> i40e: checkpatches.sh complains about long lines (it's ~85).
> >> I doubt that mechanical fix would keep the code readable.
> >> It's on 5th level of indentation, so I'd extract a function,
> >> but would like to hear from maintainers first.
> >> drivers/bus/pci/private.h | 2 +-
> >> drivers/bus/vdev/vdev.c | 4 +-
> >> drivers/bus/vdev/vdev_params.c | 3 +-
> >> drivers/common/mlx5/mlx5_common_pci.c | 4 +-
> > bus_cmdline_options_handler in mlx5_common_pci.c has a call to strdup which needs to be renamed to rte_strdup
> > (Also failed CI: https://lab.dpdk.org/results/dashboard/patchsets/15674/ )
> Frankly speaking I don't understand why such changes are useful/needed.
> Patch description does not explain/prove it.
Please see the cover letter (better to partially repeat in each patch?):
Driver code using POSIX functions is not really portable without a shim.
Having a shim in public API is wrong, it makes DPDK expose non-DPDK symbols.
An alternative approach would be to make the shim DPDK-internal. It would
require just a change in #includes for drivers and libs. My doubt is whether
EAL should emulate POSIX.
More information about the dev