aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/skbuff.h
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2012-11-01 05:16:22 -0400
committerDavid S. Miller <davem@davemloft.net>2012-11-02 21:29:57 -0400
commite19d6763cc300fcb706bd291b24ac06be71e1ce6 (patch)
tree05608ee69740360480b4c66a368eb21987993058 /include/linux/skbuff.h
parent202975b4c522c197e4e2269d389aafbf056a4c37 (diff)
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>
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r--include/linux/skbuff.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index a2a0bdb95a8f..e5eae5bc1d4d 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -235,11 +235,13 @@ enum {
235/* 235/*
236 * The callback notifies userspace to release buffers when skb DMA is done in 236 * The callback notifies userspace to release buffers when skb DMA is done in
237 * lower device, the skb last reference should be 0 when calling this. 237 * lower device, the skb last reference should be 0 when calling this.
238 * The zerocopy_success argument is true if zero copy transmit occurred,
239 * false on data copy or out of memory error caused by data copy attempt.
238 * The ctx field is used to track device context. 240 * The ctx field is used to track device context.
239 * The desc field is used to track userspace buffer index. 241 * The desc field is used to track userspace buffer index.
240 */ 242 */
241struct ubuf_info { 243struct ubuf_info {
242 void (*callback)(struct ubuf_info *); 244 void (*callback)(struct ubuf_info *, bool zerocopy_success);
243 void *ctx; 245 void *ctx;
244 unsigned long desc; 246 unsigned long desc;
245}; 247};