History

i40e: xsk: Move tmp desc array from driver to pool

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.

Magnus Karlsson committed 4 years ago

Commit d1bc5321 parent 3dd411e8 files · +24 −30Browse files

Showing the changes to include (2 of 8 files). Show all

Unified · Split

2 files
  1. include/net/xdp_sock_drv.h +2 −3
  2. include/net/xsk_buff_pool.h +1 −0
include/net/xdp_sock_drv.h+2−3
@@ -13,7 +13,7 @@ · 12 unmodified lines
1313
1414 void xsk_tx_completed(struct xsk_buff_pool *pool, u32 nb_entries);
1515 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);
1717 void xsk_tx_release(struct xsk_buff_pool *pool);
1818 struct xsk_buff_pool *xsk_get_pool_from_qid(struct net_device *dev,
1919 u16 queue_id);
@@ -142,8 +142,7 @@ static inline bool xsk_tx_peek_desc(struct xsk_buff_pool *pool, · 122 unmodified lines
142142 return false;
143143 }
144144
145−static inline u32 xsk_tx_peek_release_desc_batch(struct xsk_buff_pool *pool, struct xdp_desc *desc,
146− u32 max)
145+static inline u32 xsk_tx_peek_release_desc_batch(struct xsk_buff_pool *pool, u32 max)
147146 {
148147 return 0;
149148 }
include/net/xsk_buff_pool.h+1−0
@@ -60,6 +60,7 @@ struct xsk_buff_pool { · 59 unmodified lines
6060 */
6161 dma_addr_t *dma_pages;
6262 struct xdp_buff_xsk *heads;
63+ struct xdp_desc *tx_descs;
6364 u64 chunk_mask;
6465 u64 addrs_cnt;
6566 u32 free_list_cnt;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t