]> git.droids-corp.org - dpdk.git/commitdiff
net/sfc: conditionally compile support for tunnel packets
authorAndrew Rybchenko <arybchenko@solarflare.com>
Thu, 19 Apr 2018 11:36:52 +0000 (12:36 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 27 Apr 2018 17:00:58 +0000 (18:00 +0100)
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 <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
drivers/net/sfc/sfc_ef10_rx.c
drivers/net/sfc/sfc_ef10_rx_ev.h

index 7560891e1b5a5dbab025d4b90fbf61023a594d8f..5ec82dbf298aeaa9bd4cf6859d22aec5d846519d 100644 (file)
@@ -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, ...) \
index 774a78933ceb15aafa30738049c751f3fd57d0ef..9054fb90e182cc856b0f27546b57ccb6035bda3f 100644 (file)
@@ -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;