alistair23-linux/drivers/net
Maciej W. Rozycki f46d53d0e9 defxx: Remove an incorrectly inverted preprocessor conditional
The RX handler of the driver has two paths switched between, depending on
the size of the frame received, as determined by SKBUFF_RX_COPYBREAK.

When a small frame is received, a new skb allocated has data space large
enough to hold the incoming frame only, and data is copied there from the
original skb whose buffer is returned to the DMA RX ring; in that case
`rx_in_place' is 0.  When a large frame is received, a new skb allocated
has data space large enough to hold the largest frame possible, including
the overhead for alignment, the receive status and padding, over 4.5kiB
overall, and its buffer is placed on the DMA RX ring while the original
buffer is passed up to the network stack avoiding the need to copy data;
in that case `rx_in_place' is 1.

However the latter scenario is only possible when dynamic buffers are
used, as determined by DYNAMIC_BUFFERS, because otherwise the buffers used
for the DMA RX ring are fixed at the time the interface is brought up.

That leads to an observation that the preprocessor conditional around the
`rx_in_place' check is inverted, the check only really matters when
dynamic buffers are in use.  It has gone unnoticed for many years since
support for using dynamic buffers on the DMA RX ring was introduced in
2.1.40 -- because the only problem that results is in the case where
`rx_in_place' is 1 frame data received is unnecessarily copied to the
newly-allocated buffer, before the buffer placed on the the DMA receive RX
and its contents ignored.  Therefore the only symptom is some performance
loss.

Rather than flipping the condition though I decided to discard the
conditional altogether -- in the case of static buffers `rx_in_place' is
always 0 so GCC will optimise the C conditional away instead.

Tested on a few DEFPA and DEFTA boards successfully using both small and
large frames, both with DYNAMIC_BUFFERS defined and with the macro
undefined.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-02 18:25:07 -07:00
..
appletalk
arcnet
bonding bonding: Advertize vxlan offload features when supported 2014-06-18 16:49:51 -07:00
caif
can slcan: Port write_wakeup deadlock fix from slip 2014-06-16 21:29:13 -07:00
cris
dsa
ethernet net: bcmgenet: do not set packet length for RX buffers 2014-07-01 17:25:03 -07:00
fddi defxx: Remove an incorrectly inverted preprocessor conditional 2014-07-02 18:25:07 -07:00
hamradio
hippi
hyperv hyperv: fix apparent cut-n-paste error in send path teardown 2014-06-16 21:36:13 -07:00
ieee802154 at86rf230: fix irq setup 2014-06-22 18:04:03 -07:00
irda Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-06-12 14:27:40 -07:00
phy net: fix circular dependency in of_mdio code 2014-07-02 00:24:14 -07:00
plip
ppp
slip slip: Fix deadlock in write_wakeup 2014-06-16 21:29:12 -07:00
team
usb net: huawei_cdc_ncm: increase command buffer size 2014-06-21 19:33:17 -07:00
vmxnet3 vmxnet3: adjust ring sizes when interface is down 2014-06-16 21:26:40 -07:00
wan farsync: Fix confusion about DMA address and buffer offset types 2014-06-11 00:45:29 -07:00
wimax net: wimax: i2400m: control.c: Cleaning up conjunction always evaluates to false 2014-06-11 00:13:16 -07:00
wireless Merge branch 'ath-current' of git://github.com/kvalo/ath 2014-06-26 11:39:36 -04:00
xen-netback xen-netback: bookkeep number of active queues in our own module 2014-06-25 15:59:47 -07:00
dummy.c
eql.c
ifb.c
Kconfig
LICENSE.SRC
loopback.c
macvlan.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-06-11 16:02:55 -07:00
macvtap.c
Makefile
mdio.c
mii.c
netconsole.c
nlmon.c
ntb_netdev.c net: use ethtool_cmd_speed_set helper to set ethtool speed value 2014-06-06 16:24:07 -07:00
rionet.c
sb1000.c
Space.c
sungem_phy.c
tun.c
veth.c
virtio_net.c
vxlan.c vxlan: Checksum fixes 2014-06-15 01:00:50 -07:00
xen-netfront.c xen-netfront: recreate queues correctly when reconnecting 2014-06-21 16:14:26 -07:00