/* Guarantee we have space needed for storing the buffer * To store the buffer we need: * 1 descriptor per page * + 1 descriptor for skb head * + 2 descriptors for metadata and optional metadata * + 7 descriptors to keep tail out of the same cacheline as head * If we cannot guarantee that then we should return TX_BUSY
*/ #define FBNIC_MAX_SKB_DESC (MAX_SKB_FRAGS + 10) #define FBNIC_TX_DESC_WAKEUP (FBNIC_MAX_SKB_DESC * 2) #define FBNIC_TX_DESC_MIN roundup_pow_of_two(FBNIC_TX_DESC_WAKEUP)
/* To receive the worst case packet we need: * 1 descriptor for primary metadata * + 1 descriptor for optional metadata * + 1 descriptor for headers * + 4 descriptors for payload
*/ #define FBNIC_MAX_RX_PKT_DESC 7 #define FBNIC_RX_DESC_MIN roundup_pow_of_two(FBNIC_MAX_RX_PKT_DESC * 2)
struct fbnic_rx_buf { struct page *page; long pagecnt_bias;
};
struct fbnic_ring { /* Pointer to buffer specific info */ union { struct fbnic_pkt_buff *pkt; /* RCQ */ struct fbnic_rx_buf *rx_buf; /* BDQ */ void **tx_buf; /* TWQ */ void *buffer; /* Generic pointer */
};
u32 __iomem *doorbell; /* Pointer to CSR space for ring */
__le64 *desc; /* Descriptor ring memory */
u16 size_mask; /* Size of ring in descriptors - 1 */
u8 q_idx; /* Logical netdev ring index */
u8 flags; /* Ring flags (FBNIC_RING_F_*) */
u32 head, tail; /* Head/Tail of ring */
struct fbnic_queue_stats stats;
/* Slow path fields follow */
dma_addr_t dma; /* Phys addr of descriptor memory */
size_t size; /* Size of descriptor ring in memory */
};
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.