aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/sfc_tweak.h
blob: 4d543f6853a4557b3fa7dd7f2a6b774df79e7b90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* SPDX-License-Identifier: BSD-3-Clause
 *
 * Copyright (c) 2016-2018 Solarflare Communications Inc.
 * All rights reserved.
 *
 * This software was jointly developed between OKTET Labs (under contract
 * for Solarflare) and Solarflare Communications, Inc.
 */

#ifndef _SFC_TWEAK_H_
#define _SFC_TWEAK_H_

/*
 * The header is intended to collect defines/constants which could be
 * tweaked to improve the PMD performance characteristics depending on
 * the usecase or requirements (CPU load, packet rate, latency).
 */

/**
 * Number of Rx descriptors in the bulk submitted on Rx ring refill.
 */
#define SFC_RX_REFILL_BULK	(RTE_CACHE_LINE_SIZE / sizeof(efx_qword_t))

/**
 * Make the transmit path reap at least one time per a burst;
 * this improves cache locality because the same mbufs may be used to send
 * subsequent bursts in certain cases because of well-timed reap
 */
#define SFC_TX_XMIT_PKTS_REAP_AT_LEAST_ONCE	0

/** Default free threshold follows recommendations from DPDK documentation */
#define SFC_TX_DEFAULT_FREE_THRESH	32

/** Number of mbufs to be freed in bulk in a single call */
#define SFC_TX_REAP_BULK_SIZE		32

/**
 * Default head-of-line block timeout to wait for Rx descriptor before
 * packet drop because of no descriptors available.
 *
 * DPDK FW variant only with equal stride super-buffer Rx mode.
 */
#define SFC_RXD_WAIT_TIMEOUT_NS_DEF	(200U * 1000)

#endif /* _SFC_TWEAK_H_ */