From c6dfeecb1581103c2a6cd95c8158e8bff18b9667 Mon Sep 17 00:00:00 2001 From: Jerin Jacob Date: Sat, 13 May 2017 14:57:27 +0530 Subject: [PATCH] eal: introduce macro for no inline Signed-off-by: Jerin Jacob Acked-by: Bruce Richardson --- drivers/net/bnx2x/bnx2x.c | 6 +++--- drivers/net/dpaa2/dpaa2_rxtx.c | 2 +- drivers/net/mlx4/mlx4.c | 2 +- lib/librte_eal/common/include/rte_common.h | 5 +++++ 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c index 1a7e1c8e12..207f0e1f7b 100644 --- a/drivers/net/bnx2x/bnx2x.c +++ b/drivers/net/bnx2x/bnx2x.c @@ -120,7 +120,7 @@ static int bnx2x_alloc_mem(struct bnx2x_softc *sc); static void bnx2x_free_mem(struct bnx2x_softc *sc); static int bnx2x_alloc_fw_stats_mem(struct bnx2x_softc *sc); static void bnx2x_free_fw_stats_mem(struct bnx2x_softc *sc); -static __attribute__ ((noinline)) +static __rte_noinline int bnx2x_nic_load(struct bnx2x_softc *sc); static int bnx2x_handle_sp_tq(struct bnx2x_softc *sc); @@ -1962,7 +1962,7 @@ static void bnx2x_squeeze_objects(struct bnx2x_softc *sc) } /* stop the controller */ -__attribute__ ((noinline)) +__rte_noinline int bnx2x_nic_unload(struct bnx2x_softc *sc, uint32_t unload_mode, uint8_t keep_link) { @@ -7124,7 +7124,7 @@ void bnx2x_periodic_callout(struct bnx2x_softc *sc) } /* start the controller */ -static __attribute__ ((noinline)) +static __rte_noinline int bnx2x_nic_load(struct bnx2x_softc *sc) { uint32_t val; diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c index c5d49cbef9..ff9a696e0f 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -171,7 +171,7 @@ eth_fd_to_mbuf(const struct qbman_fd *fd) return mbuf; } -static void __attribute__ ((noinline)) __attribute__((hot)) +static void __rte_noinline __attribute__((hot)) eth_mbuf_to_fd(struct rte_mbuf *mbuf, struct qbman_fd *fd, uint16_t bpid) { diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index ec4419a8c7..0d7b4b6365 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -1098,7 +1098,7 @@ static int mlx4_check_mempool(struct rte_mempool *mp, uintptr_t *start, /* For best performance, this function should not be inlined. */ static struct ibv_mr *mlx4_mp2mr(struct ibv_pd *, struct rte_mempool *) - __attribute__((noinline)); + __rte_noinline; /** * Register mempool as a memory region. diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h index a9a749488b..27bfbd4f84 100644 --- a/lib/librte_eal/common/include/rte_common.h +++ b/lib/librte_eal/common/include/rte_common.h @@ -107,6 +107,11 @@ typedef uint16_t unaligned_uint16_t; */ #define __rte_always_inline inline __attribute__((always_inline)) +/** + * Force a function to be noinlined + */ +#define __rte_noinline __attribute__((noinline)) + /*********** Macros for pointer arithmetic ********/ /**