8a6ff33d6d
Add the vectorized version of the no-scatter Rx handler. It aims to process 8 descriptors per loop using AVX2 SIMD instructions. This handler is in its own file enic_rxtx_vec_avx2.c, and makefile and meson.build are modified to compile it when the compiler supports AVX2. Under ideal conditions, the vectorized handler reduces cycles/packet by more than 30%, when compared against the no-scatter Rx handler. Most implementation ideas come from i40e's AVX2 based handler, so credit goes to its authors. At this point, the new handler is meant for field trials, and is not selected by default. So add a new devarg enable-avx2-rx to allow the user to request the use of the new handler. When enable-avx2-rx=1, the driver will consider using the new handler. Also update the guide doc and introduce the vectorized handler. Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com> Reviewed-by: John Daley <johndale@cisco.com>
71 lines
2.1 KiB
Makefile
71 lines
2.1 KiB
Makefile
# SPDX-License-Identifier: BSD-3-Clause
|
|
# Copyright 2008-2017 Cisco Systems, Inc. All rights reserved.
|
|
# Copyright 2007 Nuova Systems, Inc. All rights reserved.
|
|
|
|
include $(RTE_SDK)/mk/rte.vars.mk
|
|
|
|
#
|
|
# library name
|
|
#
|
|
LIB = librte_pmd_enic.a
|
|
|
|
EXPORT_MAP := rte_pmd_enic_version.map
|
|
|
|
LIBABIVER := 1
|
|
|
|
CFLAGS += -I$(SRCDIR)/base/
|
|
CFLAGS += -I$(SRCDIR)
|
|
CFLAGS += -O3
|
|
CFLAGS += $(WERROR_FLAGS) -Wno-strict-aliasing
|
|
LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
|
|
LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs -lrte_hash
|
|
LDLIBS += -lrte_bus_pci
|
|
|
|
VPATH += $(SRCDIR)/src
|
|
|
|
#
|
|
# all source are stored in SRCS-y
|
|
#
|
|
SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_ethdev.c
|
|
SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_main.c
|
|
SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_rxtx.c
|
|
SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_clsf.c
|
|
SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_res.c
|
|
SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_flow.c
|
|
SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += base/vnic_cq.c
|
|
SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += base/vnic_wq.c
|
|
SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += base/vnic_dev.c
|
|
SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += base/vnic_intr.c
|
|
SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += base/vnic_rq.c
|
|
SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += base/vnic_rss.c
|
|
|
|
# The current implementation assumes 64-bit pointers
|
|
CC_AVX2_SUPPORT=0
|
|
ifeq ($(CONFIG_RTE_ARCH_X86_64),y)
|
|
# Figure out if the compiler supports avx2. The extra check using
|
|
# -march=core-avx2 is necessary to support users who build for the
|
|
# 'default' machine (corei7 which has no avx2) and run the binary on
|
|
# newer CPUs that have avx2.
|
|
# This part is verbatim from i40e makefile.
|
|
ifeq ($(findstring RTE_MACHINE_CPUFLAG_AVX2,$(CFLAGS)),RTE_MACHINE_CPUFLAG_AVX2)
|
|
CC_AVX2_SUPPORT=1
|
|
else
|
|
CC_AVX2_SUPPORT=\
|
|
$(shell $(CC) -march=core-avx2 -dM -E - </dev/null 2>&1 | \
|
|
grep -q AVX2 && echo 1)
|
|
ifeq ($(CC_AVX2_SUPPORT), 1)
|
|
ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y)
|
|
CFLAGS_enic_rxtx_vec_avx2.o += -march=core-avx2
|
|
else
|
|
CFLAGS_enic_rxtx_vec_avx2.o += -mavx2
|
|
endif
|
|
endif
|
|
endif
|
|
endif
|
|
|
|
ifeq ($(CC_AVX2_SUPPORT), 1)
|
|
SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_rxtx_vec_avx2.c
|
|
endif
|
|
|
|
include $(RTE_SDK)/mk/rte.lib.mk
|