/* SPDX-License-Identifier: (GPL-2.0 OR MIT) *GooglevirtualEthernet(gve)driver * *Copyright(C)2015-2019Google,Inc.
*/
/* GVE Transmit Descriptor formats */
#ifndef _GVE_DESC_H_ #define _GVE_DESC_H_
#include <linux/build_bug.h>
/* A note on seg_addrs * *Baseaddressesencodedinseg_addrarenotassumedtobephysical *addresses.Theringformatassumesthesecomefromsomelinearaddress *space.Thiscouldbephysicalmemory,kernelvirtualmemory,uservirtual *memory. *IfrawdmaaddressingisnotsupportedthengVNICuseslistsofregistered *pages.Eachqueueisassumedtobeassociatedwithasinglesuchlinear *addressspacetoensureaconsistentmeaningforseg_addrspostedtoits *rings.
*/
struct gve_tx_pkt_desc {
u8 type_flags; /* desc type is lower 4 bits, flags upper */
u8 l4_csum_offset; /* relative offset of L4 csum word */
u8 l4_hdr_offset; /* Offset of start of L4 headers in packet */
u8 desc_cnt; /* Total descriptors for this packet */
__be16 len; /* Total length of this packet (in bytes) */
__be16 seg_len; /* Length of this descriptor's segment */
__be64 seg_addr; /* Base address (see note) of this segment */
} __packed;
struct gve_tx_mtd_desc {
u8 type_flags; /* type is lower 4 bits, subtype upper */
u8 path_state; /* state is lower 4 bits, hash type upper */
__be16 reserved0;
__be32 path_hash;
__be64 reserved1;
} __packed;
struct gve_tx_seg_desc {
u8 type_flags; /* type is lower 4 bits, flags upper */
u8 l3_offset; /* TSO: 2 byte units to start of IPH */
__be16 reserved;
__be16 mss; /* TSO MSS */
__be16 seg_len;
__be64 seg_addr;
} __packed;
/* GVE Receive Packet Descriptor */ /* The start of an ethernet packet comes 2 bytes into the rx buffer. *gVNICaddsthispaddingsothatboththeDMAandtheL3/4protocolheader *accessisaligned.
*/ #define GVE_RX_PAD 2
struct gve_rx_desc {
u8 padding[48];
__be32 rss_hash; /* Receive-side scaling hash (Toeplitz for gVNIC) */
__be16 mss;
__be16 reserved; /* Reserved to zero */
u8 hdr_len; /* Header length (L2-L4) including padding */
u8 hdr_off; /* 64-byte-scaled offset into RX_DATA entry */
__sum16 csum; /* 1's-complement partial checksum of L3+ bytes */
__be16 len; /* Length of the received packet */
__be16 flags_seq; /* Flags [15:3] and sequence number [2:0] (1-7) */
} __packed;
static_assert(sizeof(struct gve_rx_desc) == 64);
/* If the device supports raw dma addressing then the addr in data slot is *thedmaaddressofthebuffer. *Ifthedeviceonlysupportsregisteredsegmentsthentheaddrisabyte *offsetintotheregisteredsegment(anorderedlistofpages)wherethe *bufferis.
*/ union gve_rx_data_slot {
__be64 qpl_offset;
__be64 addr;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.