pandora-kernel.git
12 years agodcb: add DCBX mode to event notifier attributes
John Fastabend [Thu, 6 Oct 2011 08:52:38 +0000 (08:52 +0000)]
dcb: add DCBX mode to event notifier attributes

Add DCBX mode to event notifiers so listeners can learn
currently enabled mode.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agodcb: Use ifindex instead of ifname
Mark Rustad [Thu, 6 Oct 2011 08:52:33 +0000 (08:52 +0000)]
dcb: Use ifindex instead of ifname

Use ifindex instead of ifname in the DCB app ring. This makes for a smaller
data structure and faster comparisons. It also avoids possible issues when
a net device is renamed.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agovirtio-net: Verify page list size before fitting into skb
Sasha Levin [Wed, 28 Sep 2011 04:40:54 +0000 (04:40 +0000)]
virtio-net: Verify page list size before fitting into skb

This patch verifies that the length of a buffer stored in a linked list
of pages is small enough to fit into a skb.

If the size is larger than a max size of a skb, it means that we shouldn't
go ahead building skbs anyway since we won't be able to send the buffer as
the user requested.

Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: virtualization@lists.linux-foundation.org
Cc: netdev@vger.kernel.org
Cc: kvm@vger.kernel.org
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobridge: allow forwarding some link local frames
stephen hemminger [Mon, 3 Oct 2011 18:14:46 +0000 (18:14 +0000)]
bridge: allow forwarding some link local frames

This is based on an earlier patch by Nick Carter with comments
by David Lamparter but with some refinements. Thanks for their patience
this is a confusing area with overlap of standards, user requirements,
and compatibility with earlier releases.

It adds a new sysfs attribute
   /sys/class/net/brX/bridge/group_fwd_mask
that controls forwarding of frames with address of: 01-80-C2-00-00-0X
The default setting has no forwarding to retain compatibility.

One change from earlier releases is that forwarding of group
addresses is not dependent on STP being enabled or disabled. This
choice was made based on interpretation of tie 802.1 standards.
I expect complaints will arise because of this, but better to follow
the standard than continue acting incorrectly by default.

The filtering mask is writeable, but only values that don't forward
known control frames are allowed. It intentionally blocks attempts
to filter control protocols. For example: writing a 8 allows
forwarding 802.1X PAE addresses which is the most common request.

Reported-by: David Lamparter <equinox@diac24.net>
Original-patch-by: Nick Carter <ncarter100@gmail.com>
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Tested-by: Benjamin Poirier <benjamin.poirier@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoigb: Alternate MAC Address Updates for Func2&3
Akeem G. Abodunrin [Fri, 2 Sep 2011 23:09:30 +0000 (23:09 +0000)]
igb: Alternate MAC Address Updates for Func2&3

Only function 1 has support for Alternate MAC Address in the EEPROM before,
this update now allow function 2 and 3 to have support for Alternate MAC
Address in the EEPROM.

Signed-off-by: "Akeem G. Abodunrin" <akeem.g.abodunrin@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
12 years agoigb: Alternate MAC Address EEPROM Updates
Akeem G. Abodunrin [Fri, 2 Sep 2011 23:08:55 +0000 (23:08 +0000)]
igb: Alternate MAC Address EEPROM Updates

This code check word 0x37 in the EEPROM, if it is 0xFFFF _or_ 0x0000, then
there is no Alternate MAC Address in the EEPROM.

Signed-off-by: "Akeem G. Abodunrin" <akeem.g.abodunrin@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
12 years agoigb: Code to prevent overwriting SFP I2C
Akeem G. Abodunrin [Fri, 2 Sep 2011 23:11:19 +0000 (23:11 +0000)]
igb: Code to prevent overwriting SFP I2C

This patch fixes "overwrite" problem. without this fix, SFP I2C EEPROM
data, which is located at A0 can be overwritten by the phy write function.

Signed-off-by: "Akeem G. Abodunrin" <akeem.g.abodunrin@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
12 years agoixgbe: X540 devices RX PFC frames pause traffic even if disabled
John Fastabend [Wed, 21 Sep 2011 14:44:10 +0000 (14:44 +0000)]
ixgbe: X540 devices RX PFC frames pause traffic even if disabled

Receiving PFC (priority flow control) frames while the feature
is off should not pause the traffic class. On the X540 devices
the traffic class react to frames if it was previously enabled
because the field is incorrectly cleared.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
12 years agoixgbe: DCB X540 devices support max traffic class of 4
John Fastabend [Tue, 27 Sep 2011 03:52:01 +0000 (03:52 +0000)]
ixgbe: DCB X540 devices support max traffic class of 4

X540 devices can only support up to 4 traffic classes and
guarantee a "lossless" traffic class on some platforms.
This patch sets the X540 devices to initialize a max
traffic class value of 4 at probe time.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
12 years agoixgbe: fixup hard dependencies on supporting 8 traffic classes
John Fastabend [Tue, 27 Sep 2011 03:51:56 +0000 (03:51 +0000)]
ixgbe: fixup hard dependencies on supporting 8 traffic classes

This patch correctly configures DCB when less than 8 traffic classes
are available in hardware.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
12 years agoixgbe: Fix PFC mask generation
Mark Rustad [Tue, 20 Sep 2011 03:00:27 +0000 (03:00 +0000)]
ixgbe: Fix PFC mask generation

Fix PFC mask generation to OR in only a single bit for each priority in
the PFC mask returned via netlink.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
12 years agoe1000e: WoL fails on device ID 0x1501
Bruce Allan [Fri, 30 Sep 2011 08:07:11 +0000 (08:07 +0000)]
e1000e: WoL fails on device ID 0x1501

PCI device ID 0x1501 has a hardware bug when the link downshifts for
whatever reason which requires a workaround.  The workaround already exists
for other similar devices but is not called for 0x1501 (it should be called
for any ICH8-based device that uses a GbE PHY).  There is also one other
instance when the workaround should be called - after disabling gigabit
speed when going to Sx.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
12 years agoe1000e: WoL can fail on 82578DM
Bruce Allan [Fri, 30 Sep 2011 08:07:05 +0000 (08:07 +0000)]
e1000e: WoL can fail on 82578DM

During suspend, the PHY must be reset for workaround updates to take effect
without restarting auto-negotiation.  Also, set the disable GbE and enable
Low Power Link Up (LPLU) if the EEPROM is configured to do likewise in
either D0 or non-D0a instead of just the latter.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
12 years agobnx2x: remove some dead code
Dan Carpenter [Wed, 5 Oct 2011 21:52:28 +0000 (17:52 -0400)]
bnx2x: remove some dead code

This code is after the break statement so it never gets used.  The
"vlan_mac_obj" variable does get initialized properly, so we can just
delete this.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agochelsio: convert to SKB paged frag API.
Ian Campbell [Wed, 5 Oct 2011 00:28:52 +0000 (00:28 +0000)]
chelsio: convert to SKB paged frag API.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Divy Le Ray <divy@chelsio.com>
Cc: Dimitris Michailidis <dm@chelsio.com>
Cc: Casey Leedom <leedom@chelsio.com>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agocxgb3: convert to SKB paged frag API.
Ian Campbell [Wed, 5 Oct 2011 00:28:51 +0000 (00:28 +0000)]
cxgb3: convert to SKB paged frag API.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Divy Le Ray <divy@chelsio.com>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agomyri10ge: convert to SKB paged frag API.
Ian Campbell [Wed, 5 Oct 2011 00:28:50 +0000 (00:28 +0000)]
myri10ge: convert to SKB paged frag API.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Jon Mason <mason@myri.com>
Cc: Andrew Gallatin <gallatin@myri.com>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agohv: netvsc: convert to SKB paged frag API.
Ian Campbell [Wed, 5 Oct 2011 00:28:49 +0000 (00:28 +0000)]
hv: netvsc: convert to SKB paged frag API.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Abhishek Kane <v-abkane@microsoft.com>
Cc: devel@driverdev.osuosl.org
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoet131x: convert to SKB paged frag API.
Ian Campbell [Wed, 5 Oct 2011 00:28:48 +0000 (00:28 +0000)]
et131x: convert to SKB paged frag API.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Mark Einon <mark.einon@gmail.com>
Cc: devel@driverdev.osuosl.org
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoxen: netfront: convert to SKB paged frag API.
Ian Campbell [Wed, 5 Oct 2011 00:28:47 +0000 (00:28 +0000)]
xen: netfront: convert to SKB paged frag API.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: xen-devel@lists.xensource.com
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoxen: netback: convert to SKB paged frag API.
Ian Campbell [Wed, 5 Oct 2011 00:28:46 +0000 (00:28 +0000)]
xen: netback: convert to SKB paged frag API.

netback currently uses frag->page to store a temporary index reference while
processing incoming requests. Since frag->page is to become opaque switch
instead to using page_offset. Add a wrapper to tidy this up and propagate the
fact that the indexes are only u16 through the code (this was already true in
practice but unsigned long and in were inconsistently used as variable and
parameter types)

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: xen-devel@lists.xensource.com
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agovxge: convert to SKB paged frag API.
Ian Campbell [Wed, 5 Oct 2011 21:35:34 +0000 (17:35 -0400)]
vxge: convert to SKB paged frag API.

[ Use DMA_TO_DEVICE and dma_mapping_error() -DaveM ]

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Jon Mason <jdmason@kudzu.us>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoixgbe: remove instances of ixgbe_phy_aq for 82598 and 82599
Emil Tantilov [Wed, 21 Sep 2011 09:02:50 +0000 (09:02 +0000)]
ixgbe: remove instances of ixgbe_phy_aq for 82598 and 82599

82598 and 82599 do not ship with this type of PHY

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
12 years agoixgbe: get pauseparam autoneg
Mika Lansirinne [Fri, 16 Sep 2011 16:52:59 +0000 (16:52 +0000)]
ixgbe: get pauseparam autoneg

There is a problem in the ixgbe driver with the reporting of the flow
control parameters. The autoneg parameter is shown to be of if
*either* it really is off, or current modes for both tx and rx are off.

The problem is seen when the parameters are read or set when the link
is down. In this case, the driver sees that tx and rx are currently off
and therefore autoneg parameter is incorrectly reported to be off too.
Also, the ethtool binary can not set the autoneg off since it sees that
it already is. When a link later comes up, the autonegotiation is
carried out normally and the driver later on reports the autoneg
parameter to be on (as it is) and then it can also be changed with
ethtool.

The patch is made against v3.0 kernel, but the problem seems to be there
since v2.6.30-rc1.

Reviewer comments: What we are trying to do is to disable flow control
while the cable is disconnected. Since ixgbe defaults to full flow
control, we call ethtool -A autoneg off rx off tx off while the cable
is disconnected. This doesn't work, because the driver sets
hw->fc.current_mode = ixgbe_fc_none if the cable is unplugged.
ixgbe_get_pauseparam() then reports to ethtool that nothing needs to be
done. The code fixes this, but it might have some unknown consequences.

Signed-off-by: Mika Lansirinne <mika.lansirinne@stonesoft.com>
Reviewed-by: Esa-Pekka Pyokkimies <esa-pekka.pyokkimies@stonesoft.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
12 years agoixgbe: do not disable flow control in ixgbe_check_mac_link
Emil Tantilov [Fri, 16 Sep 2011 06:27:56 +0000 (06:27 +0000)]
ixgbe: do not disable flow control in ixgbe_check_mac_link

Disabling flow control in ixgbe_check_mac_link() results in incorrect
reporting by ethtool when link goes down, so remove it.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
12 years agoixgbe: send MFLCN to ethtool
Emil Tantilov [Thu, 15 Sep 2011 06:23:10 +0000 (06:23 +0000)]
ixgbe: send MFLCN to ethtool

MFLCN register is used to set Rx flow control on parts newer than 82598.

This patch sends the value of MFLCN to ethtool, so it can be used in a
register dump (ethtool -d).

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
12 years agoixgbe: add support for new 82599 device
Emil Tantilov [Thu, 8 Sep 2011 08:30:14 +0000 (08:30 +0000)]
ixgbe: add support for new 82599 device

This patch adds support for new device ID.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
12 years agoixgbe: fix driver version initialization in firmware
Jacob Keller [Thu, 8 Sep 2011 03:50:54 +0000 (03:50 +0000)]
ixgbe: fix driver version initialization in firmware

This patch fixes an issue with storing the driver version for the
firmware. If the os does not support the particular firmware
management tools, the firmware requires a driver version to be written
as 0xFFFFFFFF rather than the actual driver version.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
12 years agoixgbe: remove return code for functions that always return 0
Emil Tantilov [Sat, 27 Aug 2011 07:18:47 +0000 (07:18 +0000)]
ixgbe: remove return code for functions that always return 0

Since ixgbe_raise_i2c_clk() can never return anything else than 0
this patch removes it's return value and all checks for it.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
12 years agoixgbe: clear the data field in ixgbe_read_i2c_byte_generic
Emil Tantilov [Tue, 30 Aug 2011 13:33:51 +0000 (13:33 +0000)]
ixgbe: clear the data field in ixgbe_read_i2c_byte_generic

Clear the data field in ixgbe_read_i2c_byte_generic so it does not
accumulate 1 bit using the same variable multiple times.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
12 years agoixgbe: prevent link checks while resetting
Emil Tantilov [Sat, 27 Aug 2011 07:18:37 +0000 (07:18 +0000)]
ixgbe: prevent link checks while resetting

It some situations the driver sets __IXGBE_RESETTING and then
__IXGBE_DOWN flags. It is possible a link check may sneak in
between.

This patch adds check for both flags.
The idea is to reduce register reads while the PHY is resetting.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
12 years agoe1000e: make function tables const
Jeff Kirsher [Sat, 24 Sep 2011 13:23:52 +0000 (13:23 +0000)]
e1000e: make function tables const

The initial function and setup tables can be marked as constant.

Reported-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
12 years agobna: Multiple Definition and Interface Setup Fix
Rasesh Mody [Wed, 5 Oct 2011 03:04:01 +0000 (23:04 -0400)]
bna: Multiple Definition and Interface Setup Fix

drivers/net/built-in.o: In function `bfa_ioc_ct2_poweron':
(.text+0xcdc90): multiple definition of `bfa_ioc_ct2_poweron'
drivers/scsi/built-in.o:(.text+0x17f9a0): first defined here

This patch renames bfa_ioc_ct2_poweron() to bfa_nw_ioc_ct2_poweron() to avoid
multiple definition with Brocade scsi driver. It also modifies asic specific
interface setup to allocate MSIX resources at power on in case of 1860 HW with
no asic block and warns if the asic gen is neither BFI_ASIC_GEN_CT nor
BFI_ASIC_GEN_CT2.

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Rasesh Mody <rmody@brocade.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoNET: white space/coding style cleanup of asix driver
Grant Grundler [Tue, 4 Oct 2011 09:55:18 +0000 (09:55 +0000)]
NET: white space/coding style cleanup of asix driver

check patch was complaining...mostly replaced:
   if ((ret = asix_foo(xx)) < 0) ...
with
   ret = asix_foo(xx);
   if (ret < 0) ...

Signed-off-by: Grant Grundler <grundler@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoNET: fix phy init for Asix AX88178 USB (GigE)
Grant Grundler [Tue, 4 Oct 2011 09:55:17 +0000 (09:55 +0000)]
NET: fix phy init for Asix AX88178 USB (GigE)

Asix provided this patch and I've confirmed "Plugable USB2-E1000" and
"Shenzhen Winstars NWU220G" USB dongles can get a link and TX/RX data.

Signed-off-by: "Freddy Xin" <freddy@asix.com.tw>
Signed-off-by: Grant Grundler <grundler@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoNET: fix phy init for AX88772 USB ethernet
Grant Grundler [Tue, 4 Oct 2011 09:55:16 +0000 (09:55 +0000)]
NET: fix phy init for AX88772 USB ethernet

Fix phy initialization for AX88772 (USB 2.0 100BT). Failure was
occasionally DHCP wouldn't work after reboot or suspend/resume cycle.

Remove MONITOR_MODE. In this mode, Received packets are not buffered when
the remote wakeup is enabled.

Signed-off-by: "Freddy Xin" <freddy@asix.com.tw>
Signed-off-by: Grant Grundler <grundler@chromium.org>
Acked-by: Olof Johansson <olofj@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoipv4: NET_IPV4_ROUTE_GC_INTERVAL removal
Vasily Averin [Fri, 30 Sep 2011 01:11:10 +0000 (01:11 +0000)]
ipv4: NET_IPV4_ROUTE_GC_INTERVAL removal

removing obsoleted sysctl,
ip_rt_gc_interval variable no longer used since 2.6.38

Signed-off-by: Vasily Averin <vvs@sw.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotehuti: shorten PCI device table.
françois romieu [Fri, 30 Sep 2011 00:39:23 +0000 (00:39 +0000)]
tehuti: shorten PCI device table.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agodrivers/net/ethernet: remove unused #define.
françois romieu [Fri, 30 Sep 2011 00:38:49 +0000 (00:38 +0000)]
drivers/net/ethernet: remove unused #define.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agortl8150: removal of forward declarations.
françois romieu [Fri, 30 Sep 2011 00:38:29 +0000 (00:38 +0000)]
rtl8150: removal of forward declarations.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agosc92031: use standard #defines from mii.h.
françois romieu [Fri, 30 Sep 2011 00:38:02 +0000 (00:38 +0000)]
sc92031: use standard #defines from mii.h.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoatm/iphase : removal of PCI space dereferences.
françois romieu [Fri, 30 Sep 2011 00:37:43 +0000 (00:37 +0000)]
atm/iphase : removal of PCI space dereferences.

Mostly PHY access and a few (ugly) debug statements for DMA control.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobnx2: don't request firmware when there's no userspace.
françois romieu [Fri, 30 Sep 2011 00:36:52 +0000 (00:36 +0000)]
bnx2: don't request firmware when there's no userspace.

The firmware is cached during the first successful call to open() and
released once the network device is unregistered. The driver uses the
cached firmware between open() and unregister_netdev().

It's similar to 953a12cc2889d1be92e80a2d0bab5ffef4942300 but the
firmware is mandatory.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoRepair wrong named definition aligned_u64
Jiří Župka [Fri, 30 Sep 2011 02:09:54 +0000 (02:09 +0000)]
Repair wrong named definition aligned_u64

This repairs problem with compile library in userspace (libnl).

Signed-off-by: Jiří Župka <jzupka@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotcp: report ECN_SEEN in tcp_info
Eric Dumazet [Mon, 3 Oct 2011 18:01:21 +0000 (14:01 -0400)]
tcp: report ECN_SEEN in tcp_info

Allows ss command (iproute2) to display "ecnseen" if at least one packet
with ECT(0) or ECT(1) or ECN was received by this socket.

"ecn" means ECN was negotiated at session establishment (TCP level)

"ecnseen" means we received at least one packet with ECT fields set (IP
level)

ss -i
...
ESTAB      0      0   192.168.20.110:22  192.168.20.144:38016
ino:5950 sk:f178e400
 mem:(r0,w0,f0,t0) ts sack ecn ecnseen bic wscale:7,8 rto:210
rtt:12.5/7.5 cwnd:10 send 9.3Mbps rcv_space:14480

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonet: sh_eth: fix build failure
Yoshihiro Shimoda [Thu, 29 Sep 2011 17:16:57 +0000 (17:16 +0000)]
net: sh_eth: fix build failure

The following commit removed some including headers:
 "net: sh_eth: move the asm/sh_eth.h to include/linux/"
 (commit id: d4fa0e35fdbd54acf791fa3793d6d17f7795f7ae)

Then, the build failure happened on the linux-next:

drivers/net/ethernet/renesas/sh_eth.c:601: error: 'THIS_MODULE' undeclared here (not in a function)
drivers/net/ethernet/renesas/sh_eth.c:1970: error: expected declaration specifiers or '...' before string constant
drivers/net/ethernet/renesas/sh_eth.c:1970: warning: data definition has no type or storage class
drivers/net/ethernet/renesas/sh_eth.c:1970: warning: type defaults to 'int' in declaration of 'MODULE_AUTHOR'
drivers/net/ethernet/renesas/sh_eth.c:1970: warning: function declaration isn't a prototype
drivers/net/ethernet/renesas/sh_eth.c:1971: error: expected declaration specifiers or '...' before string constant
drivers/net/ethernet/renesas/sh_eth.c:1971: warning: data definition has no type or storage class
drivers/net/ethernet/renesas/sh_eth.c:1971: warning: type defaults to 'int' in declaration of 'MODULE_DESCRIPTION'
drivers/net/ethernet/renesas/sh_eth.c:1971: warning: function declaration isn't a prototype
drivers/net/ethernet/renesas/sh_eth.c:1972: error: expected declaration specifiers or '...' before string constant
drivers/net/ethernet/renesas/sh_eth.c:1972: warning: data definition has no type or storage class
drivers/net/ethernet/renesas/sh_eth.c:1972: warning: type defaults to 'int' in declaration of 'MODULE_LICENSE'
drivers/net/ethernet/renesas/sh_eth.c:1972: warning: function declaration isn't a prototype

This patch fixes the issue. This patch also get back include/kernel.h
and linux/spinlock.h.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agocaif: add error handling for allocation
Dan Carpenter [Tue, 20 Sep 2011 21:21:59 +0000 (21:21 +0000)]
caif: add error handling for allocation

The allocation of "phyinfo" wasn't checked, and also the allocation
wasn't freed on error paths.  Sjur Brændeland pointed out as well
that "phy_driver" should be freed on the error path too.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobridge: allow updating existing fdb entries
stephen hemminger [Fri, 30 Sep 2011 14:37:27 +0000 (14:37 +0000)]
bridge: allow updating existing fdb entries

Need to allow application to update existing fdb entries that already
exist. This makes bridge netlink neighbor API have same flags and
semantics as ip neighbor table.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobridge: fix ordering of NEWLINK and NEWNEIGH events
stephen hemminger [Fri, 30 Sep 2011 14:37:26 +0000 (14:37 +0000)]
bridge: fix ordering of NEWLINK and NEWNEIGH events

When port is added to a bridge, the old code would send the new neighbor
netlink message before the subsequent new link message. This bug makes
it difficult to use the monitoring API in an application.

This code changes the ordering to add the forwarding entry
after the port is setup. One of the error checks (for invalid address)
is moved earlier in the process to avoid having to do unwind.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobe2net: Making die temperature ioctl call async
Somnath Kotur [Fri, 30 Sep 2011 07:25:05 +0000 (07:25 +0000)]
be2net: Making die temperature ioctl call async

Also changing it's frequency to once every 64s instead of existing 32s as
it was shown to affect performance

Signed-off-by: Somnath Kotur <somnath.kotur@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobe2net: Modified PCI MaxReadReq size to 4096 bytes
Somnath Kotur [Fri, 30 Sep 2011 07:24:28 +0000 (07:24 +0000)]
be2net: Modified PCI MaxReadReq size to 4096 bytes

Signed-off-by: Somnath Kotur <somnath.kotur@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobe2net: Fixed Endianness issues in the response read log length field while retrievin...
Somnath Kotur [Fri, 30 Sep 2011 07:24:00 +0000 (07:24 +0000)]
be2net: Fixed Endianness issues in the response read log length field while retrieving FAT data

This was manifesting as a crash when FAT Dump extraction was attempted on a PPC machine.

Signed-off-by: Somnath Kotur <somnath.kotur@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobe2net: Change the data type of the 'on die temperature' stat.
Somnath Kotur [Fri, 30 Sep 2011 07:23:35 +0000 (07:23 +0000)]
be2net: Change the data type of the 'on die temperature' stat.

This was showing up as junk value on PPC /Big endian machines since
it was marked as a byte.

Signed-off-by: Somnath Kotur <somnath.kotur@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobe2net: Add 60 second delay to allow FAT dump completion on recovery from EEH
Somnath Kotur [Mon, 3 Oct 2011 08:10:57 +0000 (08:10 +0000)]
be2net: Add 60 second delay to allow FAT dump completion on recovery from EEH

Add 60s delay before timeout on polling Bit 31 so that FAT dump can
complete when reset occurs.

Signed-off-by: Somnath Kotur <somnath.kotur@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoRPS: Ensure that an expired hardware filter can be re-added later
Ben Hutchings [Mon, 3 Oct 2011 04:42:46 +0000 (04:42 +0000)]
RPS: Ensure that an expired hardware filter can be re-added later

Amir Vadai wrote:
> When a stream is paused, and its rule is expired while it is paused,
> no new rule will be configured to the HW when traffic resume.
[...]
> - When stream was resumed, traffic was steered again by RSS, and
> because current-cpu was equal to desired-cpu,  ndo_rx_flow_steer
> wasn't called and no rule was configured to the HW.

Fix this by setting the flow's current CPU only in the table for the
newly selected RX queue.

Reported-and-tested-by: Amir Vadai <amirv@dev.mellanox.co.il>
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonetdev/phy/icplus: Use mdiobus_write() and mdiobus_read() for proper locking.
David Daney [Fri, 30 Sep 2011 12:17:48 +0000 (12:17 +0000)]
netdev/phy/icplus: Use mdiobus_write() and mdiobus_read() for proper locking.

Usually you have to take the bus lock.  Why not here too?

I saw this when working on something else.  Not even compile tested.

Signed-off-by: David Daney <david.daney@cavium.com>
Cc: Greg Dietsche <Gregory.Dietsche@cuw.edu>
Cc: "Uwe Kleine-Konig" <u.kleine-koenig@pengutronix.de>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonetdev/phy: Use mdiobus_read() so that proper locks are taken.
David Daney [Fri, 30 Sep 2011 11:51:22 +0000 (11:51 +0000)]
netdev/phy: Use mdiobus_read() so that proper locks are taken.

Accesses to the mdio busses must be done with the mdio_lock to ensure
proper operation.  Conveniently we have the helper function
mdiobus_read() to do that for us.  Lets use it in get_phy_id() instead
of accessing the bus without the lock held.

Signed-off-by: David Daney <david.daney@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoMerge branch 'master' of git://git.infradead.org/users/linville/wireless-next into...
John W. Linville [Fri, 30 Sep 2011 18:52:16 +0000 (14:52 -0400)]
Merge branch 'master' of git://git.infradead.org/users/linville/wireless-next into for-davem

Conflicts:
drivers/net/wireless/iwlwifi/iwl-pci.c
drivers/net/wireless/wl12xx/main.c

12 years agobna: Driver Version changed to 3.0.2.2
Rasesh Mody [Tue, 27 Sep 2011 10:39:11 +0000 (10:39 +0000)]
bna: Driver Version changed to 3.0.2.2

Signed-off-by: Gurunatha Karaje <gkaraje@brocade.com>
Signed-off-by: Rasesh Mody <rmody@brocade.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobna: Add Callback to Fix RXQ Stop
Rasesh Mody [Tue, 27 Sep 2011 10:39:10 +0000 (10:39 +0000)]
bna: Add Callback to Fix RXQ Stop

Change details:
 - Add a callback in the BNA, which is called before sending FW command to stop
   RxQs. After this callback is called, driver should not post anymore Rx
   buffers to the RxQ. This addresses a small window where driver posts Rx
   buffers while FW is stopping/has stopped the RxQ.
 - Registering callback function, rx_stall_cbfn, during bna_rx_create.
   Invoking callback function, rx_stall_cbfn, before sending rx_cfg_clr
   command to FW
 - Bnad_cb_rx_stall implementation - set a flag in the Rxq to mark buffer
   posting disabled state. While posting buffers check for the above flag.

Signed-off-by: Gurunatha Karaje <gkaraje@brocade.com>
Signed-off-by: Rasesh Mody <rmody@brocade.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobna: PLL Init Fix and Add Stats Attributes
Rasesh Mody [Tue, 27 Sep 2011 10:39:09 +0000 (10:39 +0000)]
bna: PLL Init Fix and Add Stats Attributes

Change details:
 - Fix to release soft reset in PLL init for HW
 - Added stats attributes and new bfi msg class
 - Removed some unused code and typo fixes

Signed-off-by: Gurunatha Karaje <gkaraje@brocade.com>
Signed-off-by: Rasesh Mody <rmody@brocade.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobna: Brocade 1860 HW Enablement
Rasesh Mody [Tue, 27 Sep 2011 10:39:08 +0000 (10:39 +0000)]
bna: Brocade 1860 HW Enablement

This patch enables new HW Brocade 1860. Add BFA_CM_NIC capability mask to
bfa_ioc_attr, Sub-System Device ID Info and support for Brocade 1860 device
ID to bfa_ioc.c and bnad.c.

Signed-off-by: Gurunatha Karaje <gkaraje@brocade.com>
Signed-off-by: Rasesh Mody <rmody@brocade.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobna: Implement FW Download for New HW
Rasesh Mody [Tue, 27 Sep 2011 10:39:07 +0000 (10:39 +0000)]
bna: Implement FW Download for New HW

Add new device ID 0x22 and new asic generation BFI_ASIC_GEN_CT2 for 1860.
Implement FW download from user space for new Brocade HW.

Signed-off-by: Gurunatha Karaje <gkaraje@brocade.com>
Signed-off-by: Rasesh Mody <rmody@brocade.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobna: Capability Map and MFG Block Changes for New HW
Rasesh Mody [Tue, 27 Sep 2011 10:39:06 +0000 (10:39 +0000)]
bna: Capability Map and MFG Block Changes for New HW

Add capability map and generic model name scheme for manufacturing block.
Add card types for new HW.

Remove bfa_mfg_is_card_type_valid and ibfa_mfg_adapter_prop_init_flash_ct
macros.

Signed-off-by: Gurunatha Karaje <gkaraje@brocade.com>
Signed-off-by: Rasesh Mody <rmody@brocade.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobna: Brocade 1860 IOC PLL, Reg Defs and ASIC Mode Changes
Rasesh Mody [Tue, 27 Sep 2011 10:39:05 +0000 (10:39 +0000)]
bna: Brocade 1860 IOC PLL, Reg Defs and ASIC Mode Changes

Add logic to set ASIC specfic interface in IOC, HW interface initialization
APIs, mode based initialization and MSI-X resource allocation for 1860 with
no asic block. Add new h/w specific register definitions and setup registers
used by IOC logic.

Use normal kernel declaration style, c99 initializers and const for mailbox
structures. Remove unneeded parentheses.

Signed-off-by: Gurunatha Karaje <gkaraje@brocade.com>
Signed-off-by: Rasesh Mody <rmody@brocade.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoMerge git://github.com/Jkirsher/net-next
David S. Miller [Thu, 29 Sep 2011 19:41:20 +0000 (15:41 -0400)]
Merge git://github.com/Jkirsher/net-next

12 years agousbnet: add timestamping support
Michael Riesch [Thu, 29 Sep 2011 04:06:26 +0000 (04:06 +0000)]
usbnet: add timestamping support

In order to make USB-to-Ethernet-adapters (depending on usbnet) support
timestamping, the "skb_defer_rx_timestamp" and "skb_tx_timestamp" function
calls are added.

Signed-off-by: Michael Riesch <michael@riesch.at>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonet/fec: add poll controller function for fec nic
Xiao Jiang [Thu, 29 Sep 2011 02:15:57 +0000 (02:15 +0000)]
net/fec: add poll controller function for fec nic

Add poll controller function for fec nic.

Signed-off-by: Xiao Jiang <jgq516@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonet/fec: replace hardcoded irq num with macro
Xiao Jiang [Thu, 29 Sep 2011 02:15:56 +0000 (02:15 +0000)]
net/fec: replace hardcoded irq num with macro

Don't use hardcoded irq num and replace it with
FEC_IRQ_NUM macro.

Signed-off-by: Xiao Jiang <jgq516@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoixgbe: add ECC warning for legacy interrupts
Don Skidmore [Thu, 4 Aug 2011 02:07:48 +0000 (02:07 +0000)]
ixgbe: add ECC warning for legacy interrupts

Noticed that the legacy Interrupt handler didn't have the same
ECC warning as did the MSI.  So this patch adds it.

Signed-off-by: Don Skidmore <donald.c.skidmore>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
12 years agoixgbe: cleanup ixgbe_setup_gpie() for X540
Don Skidmore [Wed, 17 Aug 2011 10:15:21 +0000 (10:15 +0000)]
ixgbe: cleanup ixgbe_setup_gpie() for X540

The X540 thermal sensor interrupt isn't a General Purpose Interrupt
so doesn't need to be enabled in ixgbe_setup_gpie().  Likewise X540 doesn't
use the SDP0 for thermal sensor so it doesn't need to be enabled for any
device other than 82599.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
12 years agoixgbe add thermal sensor support for x540 hardware
Jacob Keller [Sat, 20 Aug 2011 04:49:45 +0000 (04:49 +0000)]
ixgbe add thermal sensor support for x540 hardware

Add code to enable thermal sensors for the x540 hardware, as well as a
thermal interrupt check which will exit with a critical message of a
thermal overheat is detected. Intent of code allows other mac types to
be added with different configuration in the future.

Fixed in this version is the addition of setting the temp_sensor
capable flag which was previously only set for a specific mac.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
12 years agoixgbe: update {P}FC thresholds to account for X540 and loopback
John Fastabend [Tue, 23 Aug 2011 03:14:22 +0000 (03:14 +0000)]
ixgbe: update {P}FC thresholds to account for X540 and loopback

Revise high and low threshold marks wrt flow control to account
for the X540 devices and latency introduced by the loopback
switch.

Without this it was in theory possible to drop frames on a
supposedly lossless link with X540 or SR-IOV enabled.

Previously we used a magic number in a define to calculate the
threshold values. This made it difficult to sort out exactly
which latencies were or were not being accounted for. Here
I was overly explicit and tried to used #define names that would
be recognizable after reading the IEEE 802.1Qbb specification.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
12 years agoixgbe: disable LLI for FCoE
Vasu Dev [Thu, 18 Aug 2011 06:20:07 +0000 (06:20 +0000)]
ixgbe: disable LLI for FCoE

Disable LLI for FCoE since regular interrupt
and their moderation rate works slightly better
for FCoE also.

Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
12 years agoixgbe: Cleanup q_vector interrupt throttle rate logic
Emil Tantilov [Wed, 31 Aug 2011 00:01:16 +0000 (00:01 +0000)]
ixgbe: Cleanup q_vector interrupt throttle rate logic

This patch is meant to help cleanup the interrupt throttle rate logic by
storing the interrupt throttle rate as a value in microseconds instead of
interrupts per second.  The advantage to this approach is that the value
can now be stored in an 16 bit field and doesn't require as much math to
flip the value back and forth since the hardware already used microseconds
when setting the rate.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
12 years agoixgbevf: Fix broken trunk vlan
Greg Rose [Sat, 27 Aug 2011 02:06:25 +0000 (02:06 +0000)]
ixgbevf: Fix broken trunk vlan

Changes to clean up the vlan rx path broke trunk vlan.  Trunk vlans in
a VF driver are those set using:

"ip link set <pfdev> vf <n> <vlanid>"

Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
CC: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
12 years agoe1000: don't enable dma receives until after dma address has been setup
Dean Nelson [Fri, 16 Sep 2011 16:52:54 +0000 (16:52 +0000)]
e1000: don't enable dma receives until after dma address has been setup

Doing an 'ifconfig ethN down' followed by an 'ifconfig ethN up' on a qemu-kvm
guest system configured with two e1000 NICs can result in an 'unable to handle
kernel paging request at 0000000100000000' or 'bad page map in process ...' or
something similar.

These result from a 4096-byte page being corrupted with the following two-word
pattern (16-bytes) repeated throughout the entire page:

  0x0000000000000000
  0x0000000100000000

There can be other bits set as well. What is a constant is that the 2nd word
has the 32nd bit set. So one could see:

        :
  0x0000000000000000
  0x0000000100000000
  0x0000000000000000
  0x0000000172adc067    <<< bad pte
  0x800000006ec60067
  0x0000000700000040
  0x0000000000000000
  0x0000000100000000
        :

Which came from from a process' page table I dumped out when the marked line
was seen as bad by print_bad_pte().

The repeating pattern represents the e1000's two-word receive descriptor:

struct e1000_rx_desc {
        __le64 buffer_addr;   /* Address of the descriptor's data buffer */
        __le16 length;        /* Length of data DMAed into data buffer */
        __le16 csum;          /* Packet checksum */
        u8 status;            /* Descriptor status */
        u8 errors;            /* Descriptor Errors */
        __le16 special;
};

And the 32nd bit of the 2nd word maps to the 'u8 status' member, and
corresponds to E1000_RXD_STAT_DD which indicates the descriptor is done.

The corruption appears to result from the following...

 . An 'ifconfig ethN down' gets us into e1000_close(), which through a number
   of subfunctions results in:
     1. E1000_RCTL_EN being cleared in RCTL register.  [e1000_down()]
     2. dma_free_coherent() being called.  [e1000_free_rx_resources()]

 . An 'ifconfig ethN up' gets us into e1000_open(), which through a number of
   subfunctions results in:
     1. dma_alloc_coherent() being called.  [e1000_setup_rx_resources()]
     2. E1000_RCTL_EN being set in RCTL register.  [e1000_setup_rctl()]
     3. E1000_RCTL_EN being cleared in RCTL register.  [e1000_configure_rx()]
     4. RDLEN, RDBAH and RDBAL registers being set to reflect the dma page
        allocated in step 1.  [e1000_configure_rx()]
     5. E1000_RCTL_EN being set in RCTL register.  [e1000_configure_rx()]

During the 'ifconfig ethN up' there is a window opened, starting in step 2
where the receives are enabled up until they are disabled in step 3, in which
the address of the receive descriptor dma page known by the NIC is still the
previous one which was freed during the 'ifconfig ethN down'. If this memory
has been reallocated for some other use and the NIC feels so inclined, it will
write to that former dma page with predictably unpleasant results.

I realize that in the guest, we're dealing with an e1000 NIC that is software
emulated by qemu-kvm. The problem doesn't appear to occur on bare-metal. Andy
suspects that this is because in the emulator link-up is essentially instant
and traffic can start flowing immediately. Whereas on bare-metal, link-up
usually seems to take at least a few milliseconds. And this might be enough
to prevent traffic from flowing into the device inside the window where
E1000_RCTL_EN is set.

So perhaps a modification needs to be made to the qemu-kvm e1000 NIC emulator
to delay the link-up. But in defense of the emulator, it seems like a bad idea
to enable dma operations before the address of the memory to be involved has
been made known.

The following patch no longer enables receives in e1000_setup_rctl() but leaves
them however they were. It only enables receives in e1000_configure_rx(), and
only after the dma address has been made known to the hardware.

There are two places where e1000_setup_rctl() gets called. The one in
e1000_configure() is followed immediately by a call to e1000_configure_rx(), so
there's really no change functionally (except for the removal of the problem
window. The other is in __e1000_shutdown() and is not followed by a call to
e1000_configure_rx(), so there is a change functionally. But consider...

 . An 'ifconfig ethN down' (just as described above).

 . A 'suspend' of the system, which (I'm assuming) will find its way into
   e1000_suspend() which calls __e1000_shutdown() resulting in:
     1. E1000_RCTL_EN being set in RCTL register.  [e1000_setup_rctl()]

And again we've re-opened the problem window for some unknown amount of time.

Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Dean Nelson <dnelson@redhat.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
12 years agocandev: allow SJW user setting for bittiming calculation
Oliver Hartkopp [Wed, 28 Sep 2011 02:50:11 +0000 (02:50 +0000)]
candev: allow SJW user setting for bittiming calculation

This patch adds support for SJW user settings to not set the synchronization
jump width (SJW) to 1 in any case when using the in-kernel bittiming
calculation.

The ip-tool from iproute2 already supports to pass the user defined SJW
value. The given SJW value is sanitized with the controller specific sjw_max
and the calculated tseg2 value. As the SJW can have values up to 4 providing
this value will lead to the maximum possible SJW automatically. A higher SJW
allows higher controller oscillator tolerances.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonet: sh_eth: move the asm/sh_eth.h to include/linux/
Yoshihiro Shimoda [Tue, 27 Sep 2011 21:49:12 +0000 (21:49 +0000)]
net: sh_eth: move the asm/sh_eth.h to include/linux/

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agosh: modify prototype in sh_eth.h
Yoshihiro Shimoda [Tue, 27 Sep 2011 21:49:05 +0000 (21:49 +0000)]
sh: modify prototype in sh_eth.h

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonet: sh_eth: use ioremap()
Yoshihiro Shimoda [Tue, 27 Sep 2011 21:48:58 +0000 (21:48 +0000)]
net: sh_eth: use ioremap()

This patch also changes writel/readl to iowrite32/ioread32.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agocan/sja1000: add driver for EMS PCMCIA card
Oliver Hartkopp [Fri, 23 Sep 2011 06:59:48 +0000 (06:59 +0000)]
can/sja1000: add driver for EMS PCMCIA card

This patch adds the driver for the SJA1000 based PCMCIA card 'CPC-Card' from
EMS Dr. Thomas Wuensche (http://www.ems-wuensche.de).

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Acked-by: Markus Plessing <plessing@ems-wuensche.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoconnector: add comm change event report to proc connector
Vladimir Zapolskiy [Wed, 21 Sep 2011 09:26:44 +0000 (09:26 +0000)]
connector: add comm change event report to proc connector

Add an event to monitor comm value changes of tasks.  Such an event
becomes vital, if someone desires to control threads of a process in
different manner.

A natural characteristic of threads is its comm value, and helpfully
application developers have an opportunity to change it in runtime.
Reporting about such events via proc connector allows to fine-grain
monitoring and control potentials, for instance a process control daemon
listening to proc connector and following comm value policies can place
specific threads to assigned cgroup partitions.

It might be possible to achieve a pale partial one-shot likeness without
this update, if an application changes comm value of a thread generator
task beforehand, then a new thread is cloned, and after that proc
connector listener gets the fork event and reads new thread's comm value
from procfs stat file, but this change visibly simplifies and extends the
matter.

Signed-off-by: Vladimir Zapolskiy <vzapolskiy@gmail.com>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonet: rps: fix the support for PPPOE
Changli Gao [Tue, 20 Sep 2011 22:36:07 +0000 (22:36 +0000)]
net: rps: fix the support for PPPOE

The upper protocol numbers of PPPOE are different, and should be treated
specially.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoaf_unix: dont send SCM_CREDENTIALS by default
Eric Dumazet [Mon, 19 Sep 2011 05:52:27 +0000 (05:52 +0000)]
af_unix: dont send SCM_CREDENTIALS by default

Since commit 7361c36c5224 (af_unix: Allow credentials to work across
user and pid namespaces) af_unix performance dropped a lot.

This is because we now take a reference on pid and cred in each write(),
and release them in read(), usually done from another process,
eventually from another cpu. This triggers false sharing.

# Events: 154K cycles
#
# Overhead  Command       Shared Object        Symbol
# ........  .......  ..................  .........................
#
    10.40%  hackbench  [kernel.kallsyms]   [k] put_pid
     8.60%  hackbench  [kernel.kallsyms]   [k] unix_stream_recvmsg
     7.87%  hackbench  [kernel.kallsyms]   [k] unix_stream_sendmsg
     6.11%  hackbench  [kernel.kallsyms]   [k] do_raw_spin_lock
     4.95%  hackbench  [kernel.kallsyms]   [k] unix_scm_to_skb
     4.87%  hackbench  [kernel.kallsyms]   [k] pid_nr_ns
     4.34%  hackbench  [kernel.kallsyms]   [k] cred_to_ucred
     2.39%  hackbench  [kernel.kallsyms]   [k] unix_destruct_scm
     2.24%  hackbench  [kernel.kallsyms]   [k] sub_preempt_count
     1.75%  hackbench  [kernel.kallsyms]   [k] fget_light
     1.51%  hackbench  [kernel.kallsyms]   [k]
__mutex_lock_interruptible_slowpath
     1.42%  hackbench  [kernel.kallsyms]   [k] sock_alloc_send_pskb

This patch includes SCM_CREDENTIALS information in a af_unix message/skb
only if requested by the sender, [man 7 unix for details how to include
ancillary data using sendmsg() system call]

Note: This might break buggy applications that expected SCM_CREDENTIAL
from an unaware write() system call, and receiver not using SO_PASSCRED
socket option.

If SOCK_PASSCRED is set on source or destination socket, we still
include credentials for mere write() syscalls.

Performance boost in hackbench : more than 50% gain on a 16 thread
machine (2 quad-core cpus, 2 threads per core)

hackbench 20 thread 2000

4.228 sec instead of 9.102 sec

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Tim Chen <tim.c.chen@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoMerge branch 'master' of git://git.infradead.org/users/linville/wireless
John W. Linville [Wed, 28 Sep 2011 14:28:09 +0000 (10:28 -0400)]
Merge branch 'master' of git://git.infradead.org/users/linville/wireless

Conflicts:
drivers/net/wireless/iwlwifi/iwl-scan.c
net/wireless/nl80211.c

12 years agomac80211: treat the WME sta flag as a bit
Arik Nemtsov [Mon, 26 Sep 2011 06:36:42 +0000 (09:36 +0300)]
mac80211: treat the WME sta flag as a bit

Correct flag usage - use it as a bit index instead of a bit value.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agowl3501_cs: min_t() cast truncates high bits
Dan Carpenter [Mon, 26 Sep 2011 06:30:40 +0000 (09:30 +0300)]
wl3501_cs: min_t() cast truncates high bits

wrqu->encoding.length comes from the network administrator.  It's
size u16.  We want to limit "tocopy" to the smallest value of either
"len_keys", "wrqu->encoding.length" or 100.  But because .length
gets cast from u16 to u8 we might use a random, smaller value than
the was desired.  It's probably not very serious, but we may as well
fix it.

Btw, this is from code auditing and not from testing.  I don't know
if this affects anyone in real life.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: save tx params per sdata
Eliad Peller [Sun, 25 Sep 2011 17:06:54 +0000 (20:06 +0300)]
mac80211: save tx params per sdata

save and configure tx param per sdata, rather than
per hardware.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agocfg80211/mac80211: add netdev param to set_txq_params()
Eliad Peller [Sun, 25 Sep 2011 17:06:53 +0000 (20:06 +0300)]
cfg80211/mac80211: add netdev param to set_txq_params()

tx params are currently configured per hw, although they
should be configured per interface.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: Send the management frame at requested rate
Rajkumar Manoharan [Sun, 25 Sep 2011 09:23:31 +0000 (14:53 +0530)]
mac80211: Send the management frame at requested rate

Whenever the scan request or tx_mgmt is requesting not to
use CCK rate for managemet frames through
NL80211_ATTR_TX_NO_CCK_RATE attribute, then mac80211 should
select appropriate least non-CCK rate. This could help to
send P2P probes and P2P action frames at non 11b rates
without diabling 11b rates globally.

Cc: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agonl80211/cfg80211: Add support to disable CCK rate for management frame
Rajkumar Manoharan [Sun, 25 Sep 2011 09:23:30 +0000 (14:53 +0530)]
nl80211/cfg80211: Add support to disable CCK rate for management frame

Add a new nl80211 attribute to specify whether to send the management
frames in CCK rate or not. As of now the wpa_supplicant is disabling
CCK rate at P2P init itself. So this patch helps to send P2P probe
request/probe response/action frames being sent at non CCK rate in 2GHz
without disabling 11b rates.

This attribute is used with NL80211_CMD_TRIGGER_SCAN and
NL80211_CMD_FRAME commands to disable CCK rate for management frame
transmission.

Cc: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoNFC: use after free on error
Dan Carpenter [Fri, 23 Sep 2011 06:14:35 +0000 (09:14 +0300)]
NFC: use after free on error

We returned a freed variable on some error paths when the intent was
to return a NULL.  Part of the reason this was missed was that the
code was confusing because it had too many gotos so I removed them
and simplified the flow a bit.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Lauro Ramos Venancio <lauro.venancio@openbossa.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlagn: fix scan complete processing
Johannes Berg [Thu, 22 Sep 2011 22:15:00 +0000 (15:15 -0700)]
iwlagn: fix scan complete processing

When we cancel a scan, the completion runs
only from the workqueue. This can cause the
remain-on-channel scan to fail when another
one was just canceled, because we're still
aborting it.

To fix this, run the completion inline with
the lock still held before returning from
iwl_scan_cancel_timeout().

Also, to avoid the scan complete work from
completing a new scan prematurely, add a
new STATUS_SCAN_COMPLETE bit.

Reported-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Tested-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlagn: move iwl_process_scan_complete up
Johannes Berg [Thu, 22 Sep 2011 22:14:59 +0000 (15:14 -0700)]
iwlagn: move iwl_process_scan_complete up

To make the next patch easier to read, move
the function up, it'll be needed earlier in
this file in the next patch.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlagn: refactor scan complete
Johannes Berg [Thu, 22 Sep 2011 22:14:58 +0000 (15:14 -0700)]
iwlagn: refactor scan complete

We'll need to be able to run scan complete
inline, not from the workqueue, so refactor
it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlagn: make iwl_scan_cancel_timeout void
Johannes Berg [Thu, 22 Sep 2011 22:14:57 +0000 (15:14 -0700)]
iwlagn: make iwl_scan_cancel_timeout void

The return value of iwl_scan_cancel_timeout()
isn't used anywhere, so let's just remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlagn: remove Kelvin support
Johannes Berg [Thu, 22 Sep 2011 22:14:56 +0000 (15:14 -0700)]
iwlagn: remove Kelvin support

Only 5150 series devices report their temperature
in Kelvin, and for those we already convert it to
Celsius when storing into priv->temperature, so
there's no way priv->temperature will ever be in
Kelvin. Remove support for this.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlagn: fix slot programming
Johannes Berg [Thu, 22 Sep 2011 22:14:55 +0000 (15:14 -0700)]
iwlagn: fix slot programming

When an AP mode interface is added with a DTIM
period of two, the slot programming is wrong.
Fix it by taking into account the DTIM period.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlagn: fix dangling scan request
Johannes Berg [Thu, 22 Sep 2011 22:14:54 +0000 (15:14 -0700)]
iwlagn: fix dangling scan request

If iwl_scan_initiate() fails for any reason,
priv->scan_request and priv->scan_vif are left
dangling. This can lead to a crash later when
iwl_bg_scan_completed() tries to run a pending
scan request.

In practice, this seems to be very rare due to
the STATUS_SCANNING check earlier. That check,
however, is wrong -- it should allow a scan to
be queued when a reset/roc scan is going on.
When a normal scan is already going on, a new
one can't be issued by mac80211, so that code
can be removed completely. I introduced this
bug when adding off-channel support in commit
266af4c745952e9bebf687dd68af58df553cb59d.

Cc: stable@kernel.org [3.0]
Reported-by: Peng Yan <peng.yan@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>