Skip to contentSkip to conversation

ehea: Receive SKB Aggregation

PATCH In review Thomas Klein 3 participants 3 messages May 8, 2007

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

PATCH 1/1 ehea: Receive SKB Aggregation

This patch enables the receive side processing to aggregate TCP packets within the HEA device driver. It analyses the packets already received after a interrupt arrived and forwards these as a chains of SKBs for the same TCP connection with modified header field. We have seen a lower CPU load and improved throughput for small numbers of parallel TCP connections.

We added a disabled module parameter to prevent disruption of normal driver operation.
We currently consider this as "experimental" until further review and tests have been passed.

Are there any concerns about including this in the mainline driver?

---

drivers/net/ehea/ehea.h +32 -1
diff -Nurp -X dontdiff linux-2.6.22pre/drivers/net/ehea/ehea.h patched_kernel/drivers/net/ehea/ehea.h
@@ -39,7 +39,7 @@
 #include <asm/io.h>
 
 #define DRV_NAME	"ehea"
-#define DRV_VERSION	"EHEA_0058"
+#define DRV_VERSION	"EHEA_0060"
 
 #define EHEA_MSG_DEFAULT (NETIF_MSG_LINK | NETIF_MSG_TIMER \
 	| NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR)
@@ -49,6 +49,7 @@
 #define EHEA_MAX_ENTRIES_RQ3 16383
 #define EHEA_MAX_ENTRIES_SQ  32767
 #define EHEA_MIN_ENTRIES_QP  127
+#define EHEA_LRO_MAX_PKTS 60
 
 #define EHEA_SMALL_QUEUES
 #define EHEA_NUM_TX_QP 1
@@ -78,6 +79,9 @@
 #define EHEA_RQ2_PKT_SIZE       1522
 #define EHEA_L_PKT_SIZE         256	/* low latency */
 
+#define MAX_LRO_DESCRIPTORS 8
+#define LRO_DESC_MASK 0xFFFFFFFF
+
 /* Send completion signaling */
 
 /* Protection Domain Identifier */
@@ -334,6 +338,29 @@ struct ehea_q_skb_arr {
 };
 
 /*
+ * Large Receive Offload (LRO) descriptor for a tcp seesion
+ */
+struct ehea_lro {
+	struct sk_buff *parent;
+	struct sk_buff *last_skb;
+        struct iphdr *iph;
+        struct tcphdr *tcph;
+
+	u32 tcp_rcv_tsecr;
+	u32 tcp_rcv_tsval;
+	u32 tcp_ack;
+	u32 tcp_next_seq;
+	u32 skb_tot_frags_len;
+	u16 ip_tot_len;
+	u16 tcp_saw_tstamp; 		/* timestamps enabled */
+	u16 tcp_window;
+	u16 vlan_tag;
+	int skb_sg_cnt;			/* counts aggregated skbs */
+	int vlan_packet;
+	int active;
+};
+
+/*
  * Port resources
  */
 struct ehea_port_res {
@@ -362,6 +389,9 @@ struct ehea_port_res {
 	u64 tx_packets;
 	u64 rx_packets;
 	u32 poll_counter;
+	struct ehea_lro lro[MAX_LRO_DESCRIPTORS];
+	u64 lro_desc;
+	struct port_stats p_state;
 };
 
 
@@ -411,6 +441,7 @@ struct ehea_port {
 	u32 msg_enable;
 	u32 sig_comp_iv;
 	u32 state;
+	u32 lro_max_aggr;
 	u8 full_duplex;
 	u8 autoneg;
 	u8 num_def_qps;
drivers/net/ehea/ehea_main.c +320 -27

485 lines not on this page · raw message

#1 lore raw
Quoted 6 lines · Thomas Klein

This patch enables the receive side processing to aggregate TCP packets within the HEA device driver. It analyses the packets already received after a interrupt arrived and forwards these as a chains of SKBs for the same TCP connection with modified header field. We have seen a lower CPU load and improved throughput for small numbers of parallel TCP connections.

Quoted 6 lines

We added a disabled module parameter to prevent disruption of normal driver operation.
We currently consider this as "experimental" until further review and tests have been passed.

Are there any concerns about including this in the mainline driver?

So we grow yet another LRO copy in drivers? I think someone needs to bite the bullet and make it generic.

#2 lore raw
In reply to Thomas Klein

drivers/net/ehea/ehea.h struct ehea_q_skb_arr { · line 347

Quoted 6 lines · On Tue, 8 May 2007 14:05:33 +0200 Thomas Klein <[email protected]> wrote:
drivers/net/ehea/ehea.h +5 -0
+struct ehea_lro {
+	struct sk_buff *parent;
+	struct sk_buff *last_skb;
+        struct iphdr *iph;
+        struct tcphdr *tcph;

^^^^^^^^
Spaces instead of tabs.

Also in at least one other place in this patch.

--
Cheers,
Stephen Rothwell [email protected]
http://www.canb.auug.org.au/~sfr/