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
13 13
14void xsk_tx_completed(struct xsk_buff_pool *pool, u32 nb_entries);14void xsk_tx_completed(struct xsk_buff_pool *pool, u32 nb_entries);
15bool xsk_tx_peek_desc(struct xsk_buff_pool *pool, struct xdp_desc *desc);15bool xsk_tx_peek_desc(struct xsk_buff_pool *pool, struct xdp_desc *desc);
16u32 xsk_tx_peek_release_desc_batch(struct xsk_buff_pool *pool, struct xdp_desc *desc, u32 max);16u32 xsk_tx_peek_release_desc_batch(struct xsk_buff_pool *pool, u32 max);
17void xsk_tx_release(struct xsk_buff_pool *pool);17void xsk_tx_release(struct xsk_buff_pool *pool);
18struct xsk_buff_pool *xsk_get_pool_from_qid(struct net_device *dev,18struct 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
145static inline u32 xsk_tx_peek_release_desc_batch(struct xsk_buff_pool *pool, struct xdp_desc *desc,145static 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}
include/net/xsk_buff_pool.h+1−0
@@ -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;

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