Small patch to multicast code...

gnn at freebsd.org gnn at freebsd.org
Fri Aug 22 21:34:08 UTC 2008


At Fri, 22 Aug 2008 21:42:00 +0200,
Luigi Rizzo wrote:
> 
> On Fri, Aug 22, 2008 at 07:43:03PM +0100, Bruce M. Simpson wrote:
> > gnn at FreeBSD.org wrote:
> > >I gather you mean that a fast link on which also we're looping back
> > >the packet will be an issue?  Since this packet is only going into the
> > >simloop() routine.
> > >  
> > 
> > We end up calling if_simloop() from a few "interesting" places, in 
> > particular the kernel PIM packet handler.
> > 
> > In this particular case we're going to take a full mbuf chain copy every 
> > time we send a packet which needs to be looped back to userland.
> ...
> > In the case of ip_mloopback(), somehow we are stomping on a read-only 
> > copy of an mbuf chain. The use of m_copy() with m_pullup() there is fine 
> > according to the documented uses of mbuf(9), although as Luigi pointed 
> > out, most likely we need to look at the upper-layer protocol too, e.g. 
> > where UDP checksums are also being offloaded.
> 
> in fact, george, if you have an easy way to reproduce the error,
> could you see if reverting your change and instead adding
> sizeof(struct udphdr) to the length argument in the call to m_pullup()
> fixes the problem ?

I don't have sample code I can give but it's simple to set up and
test.

On machine A set up a sender and a listener for the same multicast
group/port.

On machine B set up a listener.

Send from A with the listener on.  B should see nothing and its "bad
checksums" counter should increase.

Turn off listener on A.

Send again, B should get the packet.

If you listen to the traffic with tcpdump on a 3rd machine you'll see
that the checksum is constant, even if the data in the packet, like
the ports, is not.

Your ethernet cards have to have hardware checksum offloading.  I'm
using em/igb in 7-STABLE.

Best,
George


More information about the freebsd-net mailing list