struct nfp_nfdk_tx_desc { union { struct {
__le16 dma_addr_hi; /* High bits of host buf address */
__le16 dma_len_type; /* Length to DMA for this desc */
__le32 dma_addr_lo; /* Low 32bit of host buf addr */
};
struct {
__le16 mss; /* MSS to be used for LSO */
u8 lso_hdrlen; /* LSO, TCP payload offset */
u8 lso_totsegs; /* LSO, total segments */
u8 l3_offset; /* L3 header offset */
u8 l4_offset; /* L4 header offset */
__le16 lso_meta_res; /* Rsvd bits in TSO metadata */
};
struct {
u8 flags; /* TX Flags, see @NFDK_DESC_TX_* */
u8 reserved[7]; /* meta byte placeholder */
};
__le32 vals[2];
__le64 raw;
};
};
/* 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) ((val) & ~(sizeof(void *) - 1)) #define NFDK_TX_BUF_INFO(val) ((val) & (sizeof(void *) - 1)) #define NFDK_TX_BUF_INFO_SOP BIT(0)
struct nfp_nfdk_tx_buf { union { /* First slot */ union { struct sk_buff *skb; void *frag; unsignedlong val;
};
/* 1 + nr_frags next slots */
dma_addr_t dma_addr;
staticinlineint nfp_nfdk_headlen_to_segs(unsignedint headlen)
{ /* First descriptor fits less data, so adjust for that */ return DIV_ROUND_UP(headlen +
NFDK_TX_MAX_DATA_PER_DESC -
NFDK_TX_MAX_DATA_PER_HEAD,
NFDK_TX_MAX_DATA_PER_DESC);
}
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.