skb: report completion status for zero copy skbs
Even if skb is marked for zero copy, net core might still decide to copy it later which is somewhat slower than a copy in user context: besides copying the data we need to pin/unpin the pages. Add a parameter reporting such cases through zero copy callback: if this happens a lot, device can take this into account and switch to copying in user context. This patch updates all users but ignores the passed value for now: it will be used by follow-up patches. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
202975b4c5
commit
e19d6763cc
@@ -235,11 +235,13 @@ enum {
|
||||
/*
|
||||
* The callback notifies userspace to release buffers when skb DMA is done in
|
||||
* lower device, the skb last reference should be 0 when calling this.
|
||||
* The zerocopy_success argument is true if zero copy transmit occurred,
|
||||
* false on data copy or out of memory error caused by data copy attempt.
|
||||
* The ctx field is used to track device context.
|
||||
* The desc field is used to track userspace buffer index.
|
||||
*/
|
||||
struct ubuf_info {
|
||||
void (*callback)(struct ubuf_info *);
|
||||
void (*callback)(struct ubuf_info *, bool zerocopy_success);
|
||||
void *ctx;
|
||||
unsigned long desc;
|
||||
};
|
||||
|
Reference in New Issue
Block a user