> TODO:
 > add checksum offload support to the core and hw devices.

Given this I assume this is just an RFC and you don't expect this to
be merged as-is, right?

 > +static int get_skb_hdr(struct sk_buff *skb, void **iphdr,
 > +                   void **tcph, u64 *hdr_flags, void *priv)
 > +{
 > +    unsigned int ip_len;
 > +    struct iphdr *iph;
 > +
 > +    /* FIXME - verify CQE checksum ??? */
 > +
 > +    /* non tcp packet */

I don't understand this comment here.

 > +    skb_reset_network_header(skb);
 > +    iph = ip_hdr(skb);
 > +    if (iph->protocol != IPPROTO_TCP)
 > +            return -1;
 > +
 > +    ip_len = ip_hdrlen(skb);
 > +    skb_set_transport_header(skb, ip_len);
 > +    *tcph = tcp_hdr(skb);
 > +
 > +    /* check if ip header and tcp header are complete */
 > +    if (iph->tot_len < ip_len + tcp_hdrlen(skb))
 > +            return -1;
 > +
 > +    *hdr_flags = LRO_IPV4 | LRO_TCP;

I don't see anywhere that you test the ethertype for IPv4 vs. IPv6.
So how do you know you have an IPv4 packet here?  I guess you need the
check before you use ip_hdr() above.

 > +    *iphdr = iph;
 > +
 > +    return 0;
_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to