1 /* SPDX-License-Identifier: BSD-3-Clause 2 * 3 * Copyright(c) 2019-2021 Xilinx, Inc. 4 * Copyright(c) 2016-2019 Solarflare Communications Inc. 5 * 6 * This software was jointly developed between OKTET Labs (under contract 7 * for Solarflare) and Solarflare Communications, Inc. 8 */ 9 10 #ifndef _SFC_TWEAK_H_ 11 #define _SFC_TWEAK_H_ 12 13 /* 14 * The header is intended to collect defines/constants which could be 15 * tweaked to improve the PMD performance characteristics depending on 16 * the usecase or requirements (CPU load, packet rate, latency). 17 */ 18 19 /** 20 * Number of Rx descriptors in the bulk submitted on Rx ring refill. 21 */ 22 #define SFC_RX_REFILL_BULK (RTE_CACHE_LINE_SIZE / sizeof(efx_qword_t)) 23 24 /** 25 * Make the transmit path reap at least one time per a burst; 26 * this improves cache locality because the same mbufs may be used to send 27 * subsequent bursts in certain cases because of well-timed reap 28 */ 29 #define SFC_TX_XMIT_PKTS_REAP_AT_LEAST_ONCE 1 30 31 /** Default free threshold follows recommendations from DPDK documentation */ 32 #define SFC_TX_DEFAULT_FREE_THRESH 32 33 34 /** Number of mbufs to be freed in bulk in a single call */ 35 #define SFC_TX_REAP_BULK_SIZE 32 36 37 /** 38 * Default head-of-line block timeout to wait for Rx descriptor before 39 * packet drop because of no descriptors available. 40 * 41 * DPDK FW variant only with equal stride super-buffer Rx mode. 42 */ 43 #define SFC_RXD_WAIT_TIMEOUT_NS_DEF (200U * 1000) 44 45 /** 46 * Ideally reading packet and byte counters together should return 47 * consistent values. I.e. a number of bytes corresponds to a number of 48 * packets. Since counters are updated in one thread and queried in 49 * another it requires either locking or atomics which are very 50 * expensive from performance point of view. So, disable it by default. 51 */ 52 #define SFC_SW_STATS_ATOMIC 0 53 54 #endif /* _SFC_TWEAK_H_ */ 55