linux/drivers/net/ethernet/netronome/nfp/nfdk/nfdk.h

/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
/* Copyright (C) 2019 Netronome Systems, Inc. */

#ifndef _NFP_DP_NFDK_H_
#define _NFP_DP_NFDK_H_

#include <linux/bitops.h>
#include <linux/types.h>

#define NFDK_TX_DESC_PER_SIMPLE_PKT

#define NFDK_TX_MAX_DATA_PER_HEAD
#define NFDK_TX_MAX_DATA_PER_DESC
#define NFDK_TX_DESC_BLOCK_SZ
#define NFDK_TX_DESC_BLOCK_CNT
#define NFDK_TX_DESC_STOP_CNT
#define NFDK_TX_MAX_DATA_PER_BLOCK
#define NFDK_TX_DESC_GATHER_MAX

/* TX descriptor format */

#define NFDK_DESC_TX_MSS_MASK

#define NFDK_DESC_TX_CHAIN_META
#define NFDK_DESC_TX_ENCAP
#define NFDK_DESC_TX_L4_CSUM
#define NFDK_DESC_TX_L3_CSUM

#define NFDK_DESC_TX_DMA_LEN_HEAD
#define NFDK_DESC_TX_TYPE_HEAD
#define NFDK_DESC_TX_DMA_LEN
#define NFDK_DESC_TX_TYPE_NOP
#define NFDK_DESC_TX_TYPE_GATHER
#define NFDK_DESC_TX_TYPE_TSO
#define NFDK_DESC_TX_TYPE_SIMPLE
#define NFDK_DESC_TX_EOP

#define NFDK_META_LEN
#define NFDK_META_FIELDS

#define D_BLOCK_CPL(idx)

struct nfp_nfdk_tx_desc {};

/* The device don't make use of the 2 or 3 least significant bits of the address
 * due to alignment constraints. The driver can make use of those bits to carry
 * information about the buffer before giving it to the device.
 *
 * NOTE: The driver must clear the lower bits before handing the buffer to the
 * device.
 *
 * - NFDK_TX_BUF_INFO_SOP - Start of a packet
 *   Mark the buffer as a start of a packet. This is used in the XDP TX process
 *   to stash virtual and DMA address so that they can be recycled when the TX
 *   operation is completed.
 */
#define NFDK_TX_BUF_PTR(val)
#define NFDK_TX_BUF_INFO(val)
#define NFDK_TX_BUF_INFO_SOP

struct nfp_nfdk_tx_buf {};

static inline int nfp_nfdk_headlen_to_segs(unsigned int headlen)
{}

int nfp_nfdk_poll(struct napi_struct *napi, int budget);
netdev_tx_t nfp_nfdk_tx(struct sk_buff *skb, struct net_device *netdev);
bool
nfp_nfdk_ctrl_tx_one(struct nfp_net *nn, struct nfp_net_r_vector *r_vec,
		     struct sk_buff *skb, bool old);
void nfp_nfdk_ctrl_poll(struct tasklet_struct *t);
void nfp_nfdk_rx_ring_fill_freelist(struct nfp_net_dp *dp,
				    struct nfp_net_rx_ring *rx_ring);
#ifndef CONFIG_NFP_NET_IPSEC
static inline u64 nfp_nfdk_ipsec_tx(u64 flags, struct sk_buff *skb)
{
	return flags;
}
#else
u64 nfp_nfdk_ipsec_tx(u64 flags, struct sk_buff *skb);
#endif
#endif