Move desc_array from the driver to the pool. The reason behind this is that we can then reuse this array as a temporary storage for descriptors in all zero-copy drivers that use the batched interface. This will make it easier to add batching to more drivers. i40e is the only driver that has a batched Tx zero-copy implementation, so no need to touch any other driver.
Showing the changes to include (2 of 8 files). Show all
Unified · Split
| @@ -13,7 +13,7 @@ · 12 unmodified lines | |||
| 13 | 13 | ||
| 14 | void xsk_tx_completed(struct xsk_buff_pool *pool, u32 nb_entries); | 14 | void xsk_tx_completed(struct xsk_buff_pool *pool, u32 nb_entries); |
| 15 | bool xsk_tx_peek_desc(struct xsk_buff_pool *pool, struct xdp_desc *desc); | 15 | bool xsk_tx_peek_desc(struct xsk_buff_pool *pool, struct xdp_desc *desc); |
| 16 | u32 xsk_tx_peek_release_desc_batch(struct xsk_buff_pool *pool, struct xdp_desc *desc, u32 max); | 16 | u32 xsk_tx_peek_release_desc_batch(struct xsk_buff_pool *pool, u32 max); |
| 17 | void xsk_tx_release(struct xsk_buff_pool *pool); | 17 | void xsk_tx_release(struct xsk_buff_pool *pool); |
| 18 | struct xsk_buff_pool *xsk_get_pool_from_qid(struct net_device *dev, | 18 | struct xsk_buff_pool *xsk_get_pool_from_qid(struct net_device *dev, |
| 19 | u16 queue_id); | 19 | u16 queue_id); |
| @@ -142,8 +142,7 @@ static inline bool xsk_tx_peek_desc(struct xsk_buff_pool *pool, · 122 unmodified lines | |||
| 142 | return false; | 142 | return false; |
| 143 | } | 143 | } |
| 144 | 144 | ||
| 145 | static inline u32 xsk_tx_peek_release_desc_batch(struct xsk_buff_pool *pool, struct xdp_desc *desc, | 145 | static inline u32 xsk_tx_peek_release_desc_batch(struct xsk_buff_pool *pool, u32 max) |
| 146 | u32 max) | ||
| 147 | { | 146 | { |
| 148 | return 0; | 147 | return 0; |
| 149 | } | 148 | } |
| @@ -60,6 +60,7 @@ struct xsk_buff_pool { · 59 unmodified lines | |||
| 60 | */ | 60 | */ |
| 61 | dma_addr_t *dma_pages; | 61 | dma_addr_t *dma_pages; |
| 62 | struct xdp_buff_xsk *heads; | 62 | struct xdp_buff_xsk *heads; |
| 63 | struct xdp_desc *tx_descs; | ||
| 63 | u64 chunk_mask; | 64 | u64 chunk_mask; |
| 64 | u64 addrs_cnt; | 65 | u64 addrs_cnt; |
| 65 | u32 free_list_cnt; | 66 | u32 free_list_cnt; |