2018-05-01 20:07:11 +00:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
# Copyright 2017 6WIND S.A.
|
|
|
|
# Copyright 2017 Mellanox Technologies, Ltd
|
2017-07-18 12:48:14 +00:00
|
|
|
|
|
|
|
include $(RTE_SDK)/mk/rte.vars.mk
|
|
|
|
|
|
|
|
# Library name
|
|
|
|
LIB = librte_pmd_failsafe.a
|
|
|
|
|
|
|
|
EXPORT_MAP := rte_pmd_failsafe_version.map
|
|
|
|
|
|
|
|
# Sources are stored in SRCS-y
|
|
|
|
SRCS-$(CONFIG_RTE_LIBRTE_PMD_FAILSAFE) += failsafe.c
|
|
|
|
SRCS-$(CONFIG_RTE_LIBRTE_PMD_FAILSAFE) += failsafe_args.c
|
|
|
|
SRCS-$(CONFIG_RTE_LIBRTE_PMD_FAILSAFE) += failsafe_eal.c
|
|
|
|
SRCS-$(CONFIG_RTE_LIBRTE_PMD_FAILSAFE) += failsafe_ops.c
|
|
|
|
SRCS-$(CONFIG_RTE_LIBRTE_PMD_FAILSAFE) += failsafe_rxtx.c
|
2017-07-18 12:48:15 +00:00
|
|
|
SRCS-$(CONFIG_RTE_LIBRTE_PMD_FAILSAFE) += failsafe_ether.c
|
2017-07-18 12:48:17 +00:00
|
|
|
SRCS-$(CONFIG_RTE_LIBRTE_PMD_FAILSAFE) += failsafe_flow.c
|
2018-01-25 16:19:30 +00:00
|
|
|
SRCS-$(CONFIG_RTE_LIBRTE_PMD_FAILSAFE) += failsafe_intr.c
|
2019-03-06 16:22:39 +00:00
|
|
|
ifeq ($(CONFIG_RTE_EXEC_ENV_LINUX),y)
|
2018-01-25 16:19:31 +00:00
|
|
|
CFLAGS += -DLINUX
|
|
|
|
else
|
|
|
|
CFLAGS += -DBSD
|
|
|
|
endif
|
2017-07-18 12:48:14 +00:00
|
|
|
|
|
|
|
# No exported include files
|
|
|
|
|
|
|
|
# Basic CFLAGS:
|
2017-07-20 12:27:53 +00:00
|
|
|
CFLAGS += -std=gnu99 -Wextra
|
2017-07-18 12:48:14 +00:00
|
|
|
CFLAGS += -O3
|
|
|
|
CFLAGS += -I.
|
|
|
|
CFLAGS += -D_DEFAULT_SOURCE
|
|
|
|
CFLAGS += -D_XOPEN_SOURCE=700
|
|
|
|
CFLAGS += $(WERROR_FLAGS)
|
|
|
|
CFLAGS += -Wno-strict-prototypes
|
|
|
|
CFLAGS += -pedantic
|
2017-10-12 16:04:21 +00:00
|
|
|
LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
|
|
|
|
LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs
|
2017-11-07 06:54:21 +00:00
|
|
|
LDLIBS += -lrte_bus_vdev
|
net/failsafe: fix hotplug races
Fail-safe uses a periodic alarm mechanism, running from the host
thread, to manage the hot-plug events of its sub-devices. This
management requires a lot of sub-devices PMDs operations
(stop, close, start, configure, etc.).
While the hot-plug alarm runs in the host thread, the application may
call fail-safe operations, which directly trigger the sub-devices PMDs
operations as well. This call may occur from any thread decided by the
application (probably the master thread).
Thus, more than one operation can be executed to a sub-device at the
same time. This can initiate a lot of races in the sub-PMDs.
Moreover, some control operations update the fail-safe internal
databases, which can be used by the alarm mechanism at the same time.
This can also initiate races and crashes.
Fail-safe is the owner of its sub-devices and must synchronize their
use according to the ETHDEV ownership rules.
Synchronize hot-plug management by a new lock mechanism uses a mutex to
atomically defend each critical section in the fail-safe hot-plug
mechanism and control operations to prevent any races between them.
Fixes: a46f8d5 ("net/failsafe: add fail-safe PMD")
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2018-02-12 20:51:42 +00:00
|
|
|
LDLIBS += -lpthread
|
2017-07-18 12:48:14 +00:00
|
|
|
|
|
|
|
include $(RTE_SDK)/mk/rte.lib.mk
|