Skip to contentSkip to conversation

- Add packet aggregation capability

RFC In review David Hollis 2 participants 3 messages Jun 10, 2009 – Jun 11, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC 1/1 - Add packet aggregation capability

The ASIX AX88772 and AX88178 devices have the ability to transmit up 16K worth of packets in a single bulk transfer. The asix.c driver currently doesn't support aggregating multiple packets into this buffer so that packets can be transmitted in a single transfer. On some systems - notably ARM - high cpu utilization is experienced when transmitting large numbers of packets.

The attached set of patches provided by ASIX add this capability to the usbnet.c driver and add the implementation for the asix.c driver.

These patches are not yet ready for merging but we are very interested in any review and comments that can be provided at this time.

One item that I have is how to handle the portion in usbnet_probe() that sets the hard_start_xmit handler with the change to netdevice_ops:

- net->hard_start_xmit = usbnet_start_xmit;
+ if (info->tx_gather)
+ net->hard_start_xmit = usbnet_bundle_xmit;
+ else
+ net->hard_start_xmit = usbnet_start_xmit;

Would it be the most appropriate to merge the usbnet_aggregate_skb_xmit() pieces into the existing usbnet_start_xmit with appropriate conditionals?

usbnet.h renamed from ../linux-2.6.29.4/include/linux/usb/usbnet.h +9 -0
@@ -48,11 +48,15 @@
 	u32			xid;
 	u32			hard_mtu;	/* count any extra framing */
 	size_t			rx_urb_size;	/* size for rx urbs */
+	size_t			tx_threshold;
 	struct mii_if_info	mii;
 
 	/* various kinds of pending driver work */
 	struct sk_buff_head	rxq;
 	struct sk_buff_head	txq;
+	struct sk_buff_head	tx_waitq;
+	u32			tx_wait_bytes;
+	u32			tx_busy_pkt;
 	struct sk_buff_head	done;
 	struct urb		*interrupt;
 	struct tasklet_struct	bh;
@@ -114,6 +118,10 @@
 	struct sk_buff	*(*tx_fixup)(struct usbnet *dev,
 				struct sk_buff *skb, gfp_t flags);
 
+	/* aggregate tx packets */
+	struct sk_buff	*(*tx_gather)(struct usbnet *dev,
+				struct sk_buff_head *q, size_t *actual_len);
+
 	/* early initialization code, can sleep. This is for minidrivers
 	 * having 'subminidrivers' that need to do extra initialization
 	 * right after minidriver have initialized hardware. */
@@ -174,6 +182,7 @@
 	struct usbnet		*dev;
 	enum skb_state		state;
 	size_t			length;
+	size_t			pkt_cnt;
 };
 
 
usbnet.c renamed from ../linux-2.6.29.4/drivers/net/usb/usbnet.c +151 -6

227 lines not on this page · raw message

asix.c renamed from ../../linux-2.6.29.4/drivers/net/usb/asix.c +83 -0

113 lines not on this page · raw message

maintainer
#1 lore raw

From: David Hollis <[email protected]>
Date: Wed, 10 Jun 2009 13:57:39 -0400

Quoted 10 lines

One item that I have is how to handle the portion in usbnet_probe() that sets the hard_start_xmit handler with the change to netdevice_ops:

usbnet.c renamed from ../linux-2.6.29.4/drivers/net/usb/usbnet.c +4 -1
-	net->hard_start_xmit = usbnet_start_xmit;
+	if (info->tx_gather)
+		net->hard_start_xmit = usbnet_bundle_xmit;
+	else
+		net->hard_start_xmit = usbnet_start_xmit;
Quoted 3 lines

Would it be the most appropriate to merge the usbnet_aggregate_skb_xmit() pieces into the existing usbnet_start_xmit with appropriate conditionals?

In the current tree you cannot even make this assignment.

Everything must go through a net_device_ops set of methods, the pointer of which is const.

#2 lore raw
Quoted 13 lines · David Miller

From: David Hollis <[email protected]>
Date: Wed, 10 Jun 2009 13:57:39 -0400

Quoted 10 lines

One item that I have is how to handle the portion in usbnet_probe() that sets the hard_start_xmit handler with the change to netdevice_ops:

usbnet.c renamed from ../linux-2.6.29.4/drivers/net/usb/usbnet.c +4 -1
-	net->hard_start_xmit = usbnet_start_xmit;
+	if (info->tx_gather)
+		net->hard_start_xmit = usbnet_bundle_xmit;
+	else
+		net->hard_start_xmit = usbnet_start_xmit;
Quoted 8 lines
Quoted 3 lines

Would it be the most appropriate to merge the usbnet_aggregate_skb_xmit() pieces into the existing usbnet_start_xmit with appropriate conditionals?

In the current tree you cannot even make this assignment.

Everything must go through a net_device_ops set of methods, the pointer of which is const.

So I'd need to have to separate net_device_ops and set net->hard_start_xmit to the appropriate one based on info->tx_gather being defined.

Not a problem.

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html