netdev
[Top] [All Lists]

Re: A new driver for Broadcom bcm5706

To: "David S.Miller" <davem@xxxxxxxxxxxxx>
Subject: Re: A new driver for Broadcom bcm5706
From: Jeff Garzik <jgarzik@xxxxxxxxx>
Date: Fri, 20 May 2005 19:30:01 -0400
Cc: mchan@xxxxxxxxxxxx, netdev@xxxxxxxxxxx, ffan@xxxxxxxxxxxx, lusinsky@xxxxxxxxxxxx
In-reply-to: <20050520.152836.48528379.davem@davemloft.net>
References: <1116609329.31523.16.camel@rh4> <20050520194220.GA18259@havoc.gtf.org> <20050520.152836.48528379.davem@davemloft.net>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050328 Fedora/1.7.6-1.2.5
David S.Miller wrote:
From: Jeff Garzik <jgarzik@xxxxxxxxx>
Date: Fri, 20 May 2005 15:42:20 -0400
10) [additional review] doesn't bnx2_rx_int() need to move the rmb()
inside the loop?  Are you protecting against the compiler
reordering/caching loads/stores, or against SMP CPUs?


This rmb() is needed to strongly order the status block consumer
index read, from that of the descriptor data.  I'm pretty sure it's
in the right spot.


10.1) [additional review] is the rmb() even needed in bnx2_rx_int(),
since its caller also uses rmb()?


No, it's guarding status block consumer index read to the first
RX descriptor read, as explained above.

OK


13) [additional review] why is CHECKSUM_UNNECESSARY used when
cksum==0xffff or cksum==0 ?

+                       u16 cksum = rx_hdr->l2_fhdr_tcp_udp_xsum;
+
+                       if ((cksum == 0xffff) || (cksum == 0)) {
+                               skb->ip_summed = CHECKSUM_UNNECESSARY;
+                       }


For UDP, a checksum value of zero means no checksum at all.

Sure. What I'm driving at is that a checksum of zero seems to imply CHECKSUM_NONE not CHECKSUM_UNNECESSARY. tg3 only does the 0xffff check.


I am also a bit surprised that, if the actual checksum value is available, why not use CHECKSUM_HW like sunhme?

        Jeff



<Prev in Thread] Current Thread [Next in Thread>