Skip to contentSkip to conversation

netback: add ethtool stat to track copied skbs

PATCH New Ian Campbell 1 participant 1 message Feb 5, 2009 Xen hypervisor interface

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netback: add ethtool stat to track copied skbs

# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1233846695 0
# Node ID 7a24febd95d5abfc03e05de7fa991b11cef14eef # Parent 4f998fd102e24daa471482730d1a3ff68faa1ad6
netback: add ethtool stat to track copied skbs.

copied skbs should be rare but we have no way of verifying that.

drivers/xen/netback/common.h +3 -0
diff -r 4f998fd102e2 -r 7a24febd95d5 drivers/xen/netback/common.h
@@ -94,6 +94,9 @@ typedef struct netif_st {
 	/* Enforce draining of the transmit queue. */
 	struct timer_list tx_queue_timeout;
 
+	/* Statistics */
+	int nr_copied_skbs;
+
 	/* Miscellaneous private stuff. */
 	struct list_head list;  /* scheduling list */
 	atomic_t         refcnt;
drivers/xen/netback/interface.c +47 -0

61 lines not on this page · raw message

drivers/xen/netback/netback.c +5 -1
diff -r 4f998fd102e2 -r 7a24febd95d5 drivers/xen/netback/netback.c
@@ -914,7 +914,11 @@ inline static void net_tx_action_dealloc
 			if (time_after(inuse->alloc_time + HZ / 2, jiffies))
 				break;
 
-			switch (copy_pending_req(inuse - pending_inuse)) {
+			pending_idx = inuse - pending_inuse;
+
+			pending_tx_info[pending_idx].netif->nr_copied_skbs++;
+
+			switch (copy_pending_req(pending_idx)) {
 			case 0:
 				list_move_tail(&inuse->list, &list);
 				continue;