Search Linux Wireless

Re: Linux 2.6.24-rc7

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jeff Garzik <jeff@xxxxxxxxxx>
Date: Sun, 27 Jan 2008 02:16:00 -0500

> It would be nice to stop maintaining code like the following in 
> drivers/net/tulip/tulip_core.c:
> 
> > /* Set the copy breakpoint for the copy-only-tiny-buffer Rx structure. */
> > #if defined(__alpha__) || defined(__arm__) || defined(__hppa__) \
> >         || defined(CONFIG_SPARC) || defined(__ia64__) \
> >         || defined(__sh__) || defined(__mips__)
> > static int rx_copybreak = 1518;
> > #else
> > static int rx_copybreak = 100;
> > #endif
> 
> The driver passes a lot of information implicitly to the net stack 
> simply via its "style" of allocation and mapping.

I just want to note in passing that we should remember that
there is a secoondary reason this copy-break logic exists
in the drivers.

When a reeived packet is attached to, and charged to, a socket,
we account the real amount of memory the SKB has allocated to it.

This means if the driver allocates full MTU sized frames for the
device to DMA into, we can cause unintended problems for passing
that packet directly in if there is only say 100 bytes of data.

The socket gets charged for a full MTU's amount of memory instead
of something more on the order of 100 bytes :-)

In fact that is the original reason all of these things exists,
it was just simple to extend it to handle alignment cases too.

Anyways, once we put the logic for unaligned handling into a
centralized location the above can now evaluate to a constant,
or default to the lower value of 100.
-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux