[dpdk-dev] [RFC v2] /net: memory interface (memif)

Stephen Hemminger stephen at networkplumber.org
Mon Dec 10 17:20:59 CET 2018


Things I saw so far, probably not everything

> +
> +_Static_assert(sizeof(memif_msg_t) == 128, "Size of memif_msg_t must be 128");
> +

DPDK uses RTE_BUILD_BUG_ON for checks like this.

> diff --git a/drivers/net/memif/Makefile b/drivers/net/memif/Makefile
> new file mode 100644
> index 000000000..a82448423
> --- /dev/null
> +++ b/drivers/net/memif/Makefile
> @@ -0,0 +1,29 @@
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright 2018 Cisco Systems, Inc.  All rights reserved.
> +
> +include $(RTE_SDK)/mk/rte.vars.mk
> +
> +#
> +# library name
> +#
> +LIB = librte_pmd_memif.a
> +
> +EXPORT_MAP := rte_pmd_memif_version.map
> +
> +LIBABIVER := 1
> +
> +CFLAGS += -O3
> +CFLAGS += -I$(SRCDIR)
> +CFLAGS += $(WERROR_FLAGS)
> +CFLAGS += -Wno-pointer-arith
> +LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
> +LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs
> +LDLIBS += -lrte_bus_vdev
> +
> +#
> +# all source are stored in SRCS-y
> +#
> +SRCS-$(CONFIG_RTE_LIBRTE_PMD_MEMIF) += rte_eth_memif.c
> +SR

What about meson build?

...

> +
> +/*
> + * fd.io coding-style-patch-verification: ON
> + *
> + * Local Variables:
> + * eval: (c-set-style "gnu")
> + * End:
> + */


This is DPDK not FD.io, this must be removed.


> +static inline ssize_t memif_msg_send(int fd, memif_msg_t * msg, int afd)
> +{

inline is not necessary with current generation compilers.
Only needed in header file.

> +
> +#define memif_min(a,b) (((a) < (b)) ? (a) : (b))

Use RTE_MIN() instead.

Also, what about documentation??




More information about the dev mailing list