From 7ee7e57c345d9e563b87e1645ecce5a1f1e4500f Mon Sep 17 00:00:00 2001 From: Andrew Rybchenko Date: Thu, 19 Apr 2018 12:36:52 +0100 Subject: [PATCH] net/sfc: conditionally compile support for tunnel packets Equal stride super-buffer Rx datapath does not support tunnels, code to parse tunnel packet types and inner checksum offload is not required and it is important to be able to compile it out on build time to avoid extra CPU load. Cutting of tunnels support relies on compiler optimizaitons to be able to drop extra checks and branches if tun_ptype is always 0. Signed-off-by: Andrew Rybchenko Reviewed-by: Ivan Malov --- drivers/net/sfc/sfc_ef10_rx.c | 2 ++ drivers/net/sfc/sfc_ef10_rx_ev.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c index 7560891e1b..5ec82dbf29 100644 --- a/drivers/net/sfc/sfc_ef10_rx.c +++ b/drivers/net/sfc/sfc_ef10_rx.c @@ -25,6 +25,8 @@ #include "sfc_dp_rx.h" #include "sfc_kvargs.h" #include "sfc_ef10.h" + +#define SFC_EF10_RX_EV_ENCAP_SUPPORT 1 #include "sfc_ef10_rx_ev.h" #define sfc_ef10_rx_err(dpq, ...) \ diff --git a/drivers/net/sfc/sfc_ef10_rx_ev.h b/drivers/net/sfc/sfc_ef10_rx_ev.h index 774a78933c..9054fb90e1 100644 --- a/drivers/net/sfc/sfc_ef10_rx_ev.h +++ b/drivers/net/sfc/sfc_ef10_rx_ev.h @@ -37,6 +37,7 @@ sfc_ef10_rx_ev_to_offloads(const efx_qword_t rx_ev, struct rte_mbuf *m, if (unlikely(EFX_TEST_QWORD_BIT(rx_ev, ESF_DZ_RX_PARSE_INCOMPLETE_LBN))) goto done; +#if SFC_EF10_RX_EV_ENCAP_SUPPORT switch (EFX_QWORD_FIELD(rx_ev, ESF_EZ_RX_ENCAP_HDR)) { default: /* Unexpected encapsulation tag class */ @@ -58,6 +59,7 @@ sfc_ef10_rx_ev_to_offloads(const efx_qword_t rx_ev, struct rte_mbuf *m, tun_ptype = RTE_PTYPE_TUNNEL_NVGRE; break; } +#endif if (tun_ptype == 0) { ip_csum_err_bit = ESF_DZ_RX_IPCKSUM_ERR_LBN; -- 2.20.1