Merge tag 'probes-fixes-v6.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-block.git] / drivers / net / ethernet / sfc / tx_common.h
CommitLineData
e1253f39
AM
1/* SPDX-License-Identifier: GPL-2.0-only */
2/****************************************************************************
3 * Driver for Solarflare network controllers and boards
4 * Copyright 2018 Solarflare Communications Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published
8 * by the Free Software Foundation, incorporated herein by reference.
9 */
10
11#ifndef EFX_TX_COMMON_H
12#define EFX_TX_COMMON_H
13
14int efx_probe_tx_queue(struct efx_tx_queue *tx_queue);
15void efx_init_tx_queue(struct efx_tx_queue *tx_queue);
16void efx_fini_tx_queue(struct efx_tx_queue *tx_queue);
17void efx_remove_tx_queue(struct efx_tx_queue *tx_queue);
18
19void efx_dequeue_buffer(struct efx_tx_queue *tx_queue,
20 struct efx_tx_buffer *buffer,
21 unsigned int *pkts_compl,
02443ab8 22 unsigned int *bytes_compl,
cfa63b90
EC
23 unsigned int *efv_pkts_compl,
24 unsigned int *xdp_pkts,
25 unsigned int *xdp_bytes);
e1253f39 26
3b4f06c7
TZ
27static inline bool efx_tx_buffer_in_use(struct efx_tx_buffer *buffer)
28{
29 return buffer->len || (buffer->flags & EFX_TX_BUF_OPTION);
30}
31
32void efx_xmit_done_check_empty(struct efx_tx_queue *tx_queue);
4aaf2c52 33int efx_xmit_done(struct efx_tx_queue *tx_queue, unsigned int index);
b8cd9499 34
88f7df35
AM
35void efx_enqueue_unwind(struct efx_tx_queue *tx_queue,
36 unsigned int insert_count);
37
e1253f39
AM
38struct efx_tx_buffer *efx_tx_map_chunk(struct efx_tx_queue *tx_queue,
39 dma_addr_t dma_addr, size_t len);
e7a25685 40int efx_tx_tso_header_length(struct sk_buff *skb);
e1253f39
AM
41int efx_tx_map_data(struct efx_tx_queue *tx_queue, struct sk_buff *skb,
42 unsigned int segment_count);
43
44unsigned int efx_tx_max_skb_descs(struct efx_nic *efx);
740acc15 45int efx_tx_tso_fallback(struct efx_tx_queue *tx_queue, struct sk_buff *skb);
51b35a45
EC
46
47extern bool efx_separate_tx_channels;
e1253f39 48#endif