2018-03-20 21:20:35 +02:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
2017-09-01 10:06:16 +02:00
|
|
|
# Copyright 2012 6WIND S.A.
|
2018-03-20 21:20:35 +02:00
|
|
|
# Copyright 2012 Mellanox Technologies, Ltd
|
2015-02-25 14:52:05 +01:00
|
|
|
|
|
|
|
include $(RTE_SDK)/mk/rte.vars.mk
|
|
|
|
|
|
|
|
# Library name.
|
|
|
|
LIB = librte_pmd_mlx4.a
|
2018-02-02 17:46:16 +01:00
|
|
|
LIB_GLUE = $(LIB_GLUE_BASE).$(LIB_GLUE_VERSION)
|
|
|
|
LIB_GLUE_BASE = librte_pmd_mlx4_glue.so
|
|
|
|
LIB_GLUE_VERSION = 18.02.0
|
2015-02-25 14:52:05 +01:00
|
|
|
|
|
|
|
# Sources.
|
|
|
|
SRCS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += mlx4.c
|
2017-09-01 10:06:58 +02:00
|
|
|
SRCS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += mlx4_ethdev.c
|
2017-03-05 09:51:32 +02:00
|
|
|
SRCS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += mlx4_flow.c
|
2018-01-30 16:34:54 +01:00
|
|
|
ifneq ($(CONFIG_RTE_LIBRTE_MLX4_DLOPEN_DEPS),y)
|
2018-01-30 16:34:52 +01:00
|
|
|
SRCS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += mlx4_glue.c
|
2018-01-30 16:34:54 +01:00
|
|
|
endif
|
2017-09-01 10:06:55 +02:00
|
|
|
SRCS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += mlx4_intr.c
|
2017-09-01 10:07:03 +02:00
|
|
|
SRCS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += mlx4_mr.c
|
2017-09-01 10:07:00 +02:00
|
|
|
SRCS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += mlx4_rxq.c
|
2017-09-01 10:06:57 +02:00
|
|
|
SRCS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += mlx4_rxtx.c
|
2017-09-01 10:06:59 +02:00
|
|
|
SRCS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += mlx4_txq.c
|
2017-09-01 10:06:52 +02:00
|
|
|
SRCS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += mlx4_utils.c
|
2015-02-25 14:52:05 +01:00
|
|
|
|
2018-01-30 16:34:54 +01:00
|
|
|
ifeq ($(CONFIG_RTE_LIBRTE_MLX4_DLOPEN_DEPS),y)
|
|
|
|
INSTALL-$(CONFIG_RTE_LIBRTE_MLX4_PMD)-lib += $(LIB_GLUE)
|
|
|
|
endif
|
|
|
|
|
2015-02-25 14:52:05 +01:00
|
|
|
# Basic CFLAGS.
|
|
|
|
CFLAGS += -O3
|
2017-06-30 19:19:08 +02:00
|
|
|
CFLAGS += -std=c11 -Wall -Wextra
|
2015-02-25 14:52:05 +01:00
|
|
|
CFLAGS += -g
|
|
|
|
CFLAGS += -I.
|
2016-06-20 15:31:46 +02:00
|
|
|
CFLAGS += -D_BSD_SOURCE
|
|
|
|
CFLAGS += -D_DEFAULT_SOURCE
|
2015-02-25 14:52:05 +01:00
|
|
|
CFLAGS += -D_XOPEN_SOURCE=600
|
|
|
|
CFLAGS += $(WERROR_FLAGS)
|
2018-04-11 13:30:18 +01:00
|
|
|
CFLAGS += -DALLOW_EXPERIMENTAL_API
|
2018-01-30 16:34:54 +01:00
|
|
|
ifeq ($(CONFIG_RTE_LIBRTE_MLX4_DLOPEN_DEPS),y)
|
|
|
|
CFLAGS += -DMLX4_GLUE='"$(LIB_GLUE)"'
|
2018-02-02 17:46:16 +01:00
|
|
|
CFLAGS += -DMLX4_GLUE_VERSION='"$(LIB_GLUE_VERSION)"'
|
2018-01-30 16:34:54 +01:00
|
|
|
CFLAGS_mlx4_glue.o += -fPIC
|
|
|
|
LDLIBS += -ldl
|
|
|
|
else
|
net/mlx4: add RSS flow rule action support
This patch dissociates single-queue indirection tables and hash QP objects
from Rx queue structures to relinquish their control to users through the
RSS flow rule action, while simultaneously allowing multiple queues to be
associated with RSS contexts.
Flow rules share identical RSS contexts (hashed fields, hash key, target
queues) to save on memory and other resources. The trade-off is some added
complexity due to reference counters management on RSS contexts.
The QUEUE action is re-implemented on top of an automatically-generated
single-queue RSS context.
The following hardware limitations apply to RSS contexts:
- The number of queues in a group must be a power of two.
- Queue indices must be consecutive, for instance the [0 1 2 3] set is
allowed, however [3 2 1 0], [0 2 1 3] and [0 0 1 1 2 3 3 3] are not.
- The first queue of a group must be aligned to a multiple of the context
size, e.g. if queues [0 1 2 3 4] are defined globally, allowed group
combinations are [0 1] and [2 3]; groups [1 2] and [3 4] are not
supported.
- RSS hash key, while configurable per context, must be exactly 40 bytes
long.
- The only supported hash algorithm is Toeplitz.
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2017-10-12 14:19:41 +02:00
|
|
|
LDLIBS += -libverbs -lmlx4
|
2018-01-30 16:34:54 +01:00
|
|
|
endif
|
2017-10-12 18:04:21 +02:00
|
|
|
LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
|
|
|
|
LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs
|
2017-10-26 12:06:08 +02:00
|
|
|
LDLIBS += -lrte_bus_pci
|
2015-02-25 14:52:05 +01:00
|
|
|
|
|
|
|
# A few warnings cannot be avoided in external headers.
|
|
|
|
CFLAGS += -Wno-error=cast-qual
|
|
|
|
|
|
|
|
EXPORT_MAP := rte_pmd_mlx4_version.map
|
|
|
|
LIBABIVER := 1
|
|
|
|
|
|
|
|
# DEBUG which is usually provided on the command-line may enable
|
|
|
|
# CONFIG_RTE_LIBRTE_MLX4_DEBUG.
|
|
|
|
ifeq ($(DEBUG),1)
|
|
|
|
CONFIG_RTE_LIBRTE_MLX4_DEBUG := y
|
|
|
|
endif
|
|
|
|
|
|
|
|
# User-defined CFLAGS.
|
|
|
|
ifeq ($(CONFIG_RTE_LIBRTE_MLX4_DEBUG),y)
|
|
|
|
CFLAGS += -pedantic -UNDEBUG -DPEDANTIC
|
|
|
|
else
|
|
|
|
CFLAGS += -DNDEBUG -UPEDANTIC
|
|
|
|
endif
|
|
|
|
|
|
|
|
include $(RTE_SDK)/mk/rte.lib.mk
|
|
|
|
|
|
|
|
# Generate and clean-up mlx4_autoconf.h.
|
|
|
|
|
|
|
|
export CC CFLAGS CPPFLAGS EXTRA_CFLAGS EXTRA_CPPFLAGS
|
|
|
|
export AUTO_CONFIG_CFLAGS = -Wno-error
|
|
|
|
|
2015-03-03 12:29:45 +01:00
|
|
|
ifndef V
|
|
|
|
AUTOCONF_OUTPUT := >/dev/null
|
|
|
|
endif
|
|
|
|
|
2016-06-10 17:09:32 +02:00
|
|
|
mlx4_autoconf.h.new: FORCE
|
|
|
|
|
2016-12-15 22:46:47 +01:00
|
|
|
mlx4_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config-h.sh
|
2015-02-25 14:52:05 +01:00
|
|
|
$Q $(RM) -f -- '$@'
|
2017-09-01 10:06:38 +02:00
|
|
|
$Q : > '$@'
|
2015-02-25 14:52:05 +01:00
|
|
|
|
2016-06-10 17:09:32 +02:00
|
|
|
# Create mlx4_autoconf.h or update it in case it differs from the new one.
|
|
|
|
|
|
|
|
mlx4_autoconf.h: mlx4_autoconf.h.new
|
|
|
|
$Q [ -f '$@' ] && \
|
|
|
|
cmp '$<' '$@' $(AUTOCONF_OUTPUT) || \
|
|
|
|
mv '$<' '$@'
|
|
|
|
|
2017-03-05 09:51:32 +02:00
|
|
|
$(SRCS-$(CONFIG_RTE_LIBRTE_MLX4_PMD):.c=.o): mlx4_autoconf.h
|
2015-02-25 14:52:05 +01:00
|
|
|
|
2018-01-30 16:34:54 +01:00
|
|
|
# Generate dependency plug-in for rdma-core when the PMD must not be linked
|
|
|
|
# directly, so that applications do not inherit this dependency.
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_RTE_LIBRTE_MLX4_DLOPEN_DEPS),y)
|
|
|
|
|
|
|
|
$(LIB): $(LIB_GLUE)
|
|
|
|
|
2018-03-29 14:36:20 +01:00
|
|
|
ifeq ($(LINK_USING_CC),1)
|
|
|
|
GLUE_LDFLAGS := $(call linkerprefix,$(LDFLAGS))
|
|
|
|
else
|
|
|
|
GLUE_LDFLAGS := $(LDFLAGS)
|
|
|
|
endif
|
2018-01-30 16:34:54 +01:00
|
|
|
$(LIB_GLUE): mlx4_glue.o
|
2018-03-29 14:36:20 +01:00
|
|
|
$Q $(LD) $(GLUE_LDFLAGS) $(EXTRA_LDFLAGS) \
|
2018-02-02 17:46:16 +01:00
|
|
|
-Wl,-h,$(LIB_GLUE) \
|
2018-01-30 16:34:54 +01:00
|
|
|
-s -shared -o $@ $< -libverbs -lmlx4
|
|
|
|
|
|
|
|
mlx4_glue.o: mlx4_autoconf.h
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
2015-02-25 14:52:05 +01:00
|
|
|
clean_mlx4: FORCE
|
2016-06-10 17:09:32 +02:00
|
|
|
$Q rm -f -- mlx4_autoconf.h mlx4_autoconf.h.new
|
2018-02-02 17:46:16 +01:00
|
|
|
$Q rm -f -- mlx4_glue.o $(LIB_GLUE_BASE)*
|
2015-02-25 14:52:05 +01:00
|
|
|
|
|
|
|
clean: clean_mlx4
|