linux/drivers/net/ethernet/google/gve/gve_desc_dqo.h

/* SPDX-License-Identifier: (GPL-2.0 OR MIT)
 * Google virtual Ethernet (gve) driver
 *
 * Copyright (C) 2015-2021 Google, Inc.
 */

/* GVE DQO Descriptor formats */

#ifndef _GVE_DESC_DQO_H_
#define _GVE_DESC_DQO_H_

#include <linux/build_bug.h>

#define GVE_TX_MAX_HDR_SIZE_DQO
#define GVE_TX_MIN_TSO_MSS_DQO

#ifndef __LITTLE_ENDIAN_BITFIELD
#error "Only little endian supported"
#endif

/* Basic TX descriptor (DTYPE 0x0C) */
struct gve_tx_pkt_desc_dqo {} __packed;
static_assert();

#define GVE_TX_PKT_DESC_DTYPE_DQO
#define GVE_TX_MAX_BUF_SIZE_DQO

/* Maximum number of data descriptors allowed per packet, or per-TSO segment. */
#define GVE_TX_MAX_DATA_DESCS

/* Min gap between tail and head to avoid cacheline overlap */
#define GVE_TX_MIN_DESC_PREVENT_CACHE_OVERLAP

/* "report_event" on TX packet descriptors may only be reported on the last
 * descriptor of a TX packet, and they must be spaced apart with at least this
 * value.
 */
#define GVE_TX_MIN_RE_INTERVAL

struct gve_tx_context_cmd_dtype {};

static_assert();

/* TX Native TSO Context DTYPE (0x05)
 *
 * "flex" fields allow the driver to send additional packet context to HW.
 */
struct gve_tx_tso_context_desc_dqo {} __packed;
static_assert();

#define GVE_TX_TSO_CTX_DESC_DTYPE_DQO

/* General context descriptor for sending metadata. */
struct gve_tx_general_context_desc_dqo {} __packed;
static_assert();

#define GVE_TX_GENERAL_CTX_DESC_DTYPE_DQO

/* Logical structure of metadata which is packed into context descriptor flex
 * fields.
 */
struct gve_tx_metadata_dqo {}  __packed;
static_assert();

#define GVE_TX_METADATA_VERSION_DQO

/* TX completion descriptor */
struct gve_tx_compl_desc {} __packed;
static_assert();

#define GVE_COMPL_TYPE_DQO_PKT
#define GVE_COMPL_TYPE_DQO_DESC
#define GVE_COMPL_TYPE_DQO_MISS
#define GVE_COMPL_TYPE_DQO_REINJECTION

/* The most significant bit in the completion tag can change the completion
 * type from packet completion to miss path completion.
 */
#define GVE_ALT_MISS_COMPL_BIT

/* Descriptor to post buffers to HW on buffer queue. */
struct gve_rx_desc_dqo {} __packed;
static_assert();

/* Descriptor for HW to notify SW of new packets received on RX queue. */
struct gve_rx_compl_desc_dqo {} __packed;

static_assert();

/* Ringing the doorbell too often can hurt performance.
 *
 * HW requires this value to be at least 8.
 */
#define GVE_RX_BUF_THRESH_DQO

#endif /* _GVE_DESC_DQO_H_ */