summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/sun/sunvnet.h
diff options
context:
space:
mode:
authorDavid L Stevens <david.stevens@oracle.com>2014-09-29 19:48:11 -0400
committerDavid S. Miller <davem@davemloft.net>2014-09-30 17:10:39 -0400
commit8e845f4cbbd2ef81846c2ab5dca46d88fb2717ee (patch)
tree59f30a451145d5e95bf308c4b06cacb61a996417 /drivers/net/ethernet/sun/sunvnet.h
parente4defc775424a3501caf98d266a8d7616fa53819 (diff)
sunvnet: make transmit path zero-copy in the kernel
This patch removes pre-allocated transmit buffers and instead directly maps pending packets on demand. This saves O(n^2) maximum-sized transmit buffers, for n hosts on a vswitch, as well as a copy to those buffers. Single-stream TCP throughput linux-solaris dropped ~5% for 1500-byte MTU, but linux-linux at 1500-bytes increased ~20%. Signed-off-by: David L Stevens <david.stevens@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sun/sunvnet.h')
-rw-r--r--drivers/net/ethernet/sun/sunvnet.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/net/ethernet/sun/sunvnet.h b/drivers/net/ethernet/sun/sunvnet.h
index 986e04b9313d..02f507db9951 100644
--- a/drivers/net/ethernet/sun/sunvnet.h
+++ b/drivers/net/ethernet/sun/sunvnet.h
@@ -11,6 +11,11 @@
*/
#define VNET_TX_TIMEOUT (5 * HZ)
+/* length of time (or less) we expect pending descriptors to be marked
+ * as VIO_DESC_DONE and skbs ready to be freed
+ */
+#define VNET_CLEAN_TIMEOUT ((HZ/100)+1)
+
#define VNET_MAXPACKET 1518ULL /* ETH_FRAMELEN + VLAN_HDR */
#define VNET_TX_RING_SIZE 512
#define VNET_TX_WAKEUP_THRESH(dr) ((dr)->pending / 4)
@@ -22,7 +27,7 @@
#define VNET_PACKET_SKIP 6
struct vnet_tx_entry {
- void *buf;
+ struct sk_buff *skb;
unsigned int ncookies;
struct ldc_trans_cookie cookies[2];
};
@@ -46,6 +51,8 @@ struct vnet_port {
bool stop_rx;
bool start_cons;
+ struct timer_list clean_timer;
+
u64 rmtu;
};