Thread (3 messages) flat view 3 messages, 3 authors, 2007-07-23

Re: [RFC 1/1] lro: Generic Large Receive Offload for TCP traffic

From: Evgeniy Polyakov <hidden>
Date: 2007-07-23 10:39:09
Also in: lkml, netdev

Hi Jan-Bernd.

On Fri, Jul 20, 2007 at 05:41:48PM +0200, Jan-Bernd Themann (ossthema@de.ibm.com) wrote:
Generic LRO patch

Signed-off-by: Jan-Bernd Themann <redacted>
Besides couple trivial codyng/formatting nits I did not found any
problematic places after review. Details below.

Thanks.
+#define TCP_PAYLOAD_LENGTH(iph, tcph) \
+(ntohs(iph->tot_len) - IP_HDR_LEN(iph) - TCP_HDR_LEN(tcph))
A tab?
+static void lro_add_common(struct net_lro_desc *lro_desc, struct iphdr *iph,
+			   struct tcphdr *tcph, int tcp_data_len)
+{
+	struct sk_buff *parent = lro_desc->parent;
+	u32 *topt;
+
+	lro_desc->pkt_aggr_cnt++;
+	lro_desc->ip_tot_len += tcp_data_len;
+	lro_desc->tcp_next_seq += tcp_data_len;
+	lro_desc->tcp_window = tcph->window;
+	lro_desc->tcp_ack = tcph->ack_seq;
+
+	/* don't update tcp_rcv_tsval, would not work with PAWS */
+	if (lro_desc->tcp_saw_tstamp) {
+		topt = (u32 *) (tcph + 1);
+		lro_desc->tcp_rcv_tsecr = *(topt + 2);
+	}
+
+	parent->len += tcp_data_len;
+	parent->data_len += tcp_data_len;
+
+	lro_desc->data_csum = csum_add(lro_desc->data_csum,
+				       lro_tcp_data_csum(iph, tcph,
+							 tcp_data_len));
+	return;
+}
return from void? And in other places too.
+int __lro_proc_skb(struct net_lro_mgr *lro_mgr, struct sk_buff *skb,
+		   struct vlan_group *vgrp, u16 vlan_tag, void *priv)
+{
+	struct net_lro_desc *lro_desc;
+        struct iphdr *iph;
+        struct tcphdr *tcph;
+	u64 flags;
Broken tab and spaces.
+struct sk_buff *lro_gen_skb(struct net_lro_mgr *lro_mgr,
+			    struct skb_frag_struct *frags,
+			    int len, int true_size,
+			    void *mac_hdr,
+			    int hlen)
+{
+	struct sk_buff *skb;
+        struct skb_frag_struct *skb_frags;
+	int data_len = len;
The same.
+	skb = netdev_alloc_skb(lro_mgr->dev, hlen);
+	if (!skb)
+		return NULL;
+
+        skb->len = len;
+	skb->data_len = len - hlen;
Here too.
There is number of such places, ommitted others.


-- 
	Evgeniy Polyakov
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help