aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net (follow)
AgeCommit message (Collapse)AuthorFilesLines
2015-08-27net/mlx4_core: Fix unintialized variable used in error pathCarol L Soto1-3/+2
The uninitialized value name in mlx4_en_activate_cq was used in order to print an error message. Fixing it by replacing it with cq->vector. Signed-off-by: Matan Barak <matanb@mellanox.com> Signed-off-by: Carol L Soto <clsoto@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-27net/mlx4_core: Capping number of requested MSIXs to MAX_MSIXCarol L Soto1-1/+9
We currently manage IRQs in pool_bm which is a bit field of MAX_MSIX bits. Thus, allocating more than MAX_MSIX interrupts can't be managed in pool_bm. Fixing this by capping number of requested MSIXs to MAX_MSIX. Signed-off-by: Matan Barak <matanb@mellanox.com> Signed-off-by: Carol L Soto <clsoto@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-27mlxsw: Make mailboxes 4KB alignedIdo Schimmel1-33/+50
The HW-SW contract requires mailboxes passed to the firmware to be 4KB aligned. Previously, these mailboxes were mapped using streaming DMA routines, which do not guarantee the bus addresses to be 4KB aligned. Under certain conditions this constraint was indeed violated and errors were observed. By using consistent DMA mapping routines together with a mailbox size of 4KB we are guaranteed not to violate the constraint. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-27mlxsw: adjust transmit fail log message level in __mlxsw_emad_transmitJiri Pirko1-2/+2
When transmit fails, it is an error, not a warning. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Elad Raz <eladr@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-27mlxsw: Remove duplicate included headerIdo Schimmel1-1/+0
Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Elad Raz <eladr@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-27rocker: use change upper infoJiri Pirko1-23/+38
Since now information about changed upper is passed along, benefit from that and use this info directly. This also fixes possible issues that could happen when non-master device is added (current code does not distinguish between master and non-master upper device). Signed-off-by: Jiri Pirko <jiri@mellanox.com> Acked-by: Scott Feldman <sfeldma@gmail.com Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-27rocker: use new helper to figure out master kindJiri Pirko1-12/+7
Looking at rtnl kind string is kind of ugly. So use new helpers to do this in nicer way. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Acked-by: Scott Feldman <sfeldma@gmail.com Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-27virtio-net: avoid unnecessary sg initialzationJason Wang1-2/+2
Usually an skb does not have up to MAX_SKB_FRAGS frags. So no need to initialize the unuse part of sg. This patch initialize the sg based on the real number it will used: - during xmit, it could be inferred from nr_frags and can_push. - for small receive buffer, it will also be 2. Cc: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-27geneve: Move device hash table to geneve socket.Pravin B Shelar1-26/+17
This change simplifies Geneve Tunnel hash table management. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Reviewed-by: Jesse Gross <jesse@nicira.com> Reviewed-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-27geneve: Consolidate Geneve functionality in single module.Pravin B Shelar2-90/+421
geneve_core module handles send and receive functionality. This way OVS could use the Geneve API. Now with use of tunnel meatadata mode OVS can directly use Geneve netdevice. So there is no need for separate module for Geneve. Following patch consolidates Geneve protocol processing in single module. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Reviewed-by: Jesse Gross <jesse@nicira.com> Acked-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-27geneve: Add support to collect tunnel metadata.Pravin B Shelar1-85/+271
Following patch create new tunnel flag which enable tunnel metadata collection on given device. These devices can be used by tunnel metadata based routing or by OVS. Geneve Consolidation patch get rid of collect_md_tun to simplify tunnel lookup further. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Reviewed-by: Jesse Gross <jesse@nicira.com> Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-27geneve: Make dst-port configurable.Pravin B Shelar1-4/+21
Add netlink interface to configure Geneve UDP port number. So that user can configure it for a Gevene device. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Reviewed-by: Jesse Gross <jesse@nicira.com> Acked-by: Thomas Graf <tgraf@suug.ch> Acked-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-27tunnel: introduce udp_tun_rx_dst()Pravin B Shelar1-26/+3
Introduce function udp_tun_rx_dst() to initialize tunnel dst on receive path. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Reviewed-by: Jesse Gross <jesse@nicira.com> Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-27geneve: Use skb mark and protocol to lookup route.Pravin B Shelar1-0/+3
On packet transmit path geneve need to lookup route. Following patch improves route lookup using more parameters. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Reviewed-by: Jesse Gross <jesse@nicira.com> Acked-by: Thomas Graf <tgraf@suug.ch> Acked-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-27geneve: Initialize ethernet address in device setup.Pravin B Shelar1-3/+1
Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Reviewed-by: Jesse Gross <jesse@nicira.com> Acked-by: Thomas Graf <tgraf@suug.ch> Acked-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-27bnx2x: Add new device ids under the Qlogic vendorYuval Mintz1-0/+3
This adds support for 3 new PCI device combinations - 1077:16a1, 1077:16a4 and 1077:16ad. Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-27smsc911x: Ignore error return from device_get_phy_mode()Guenter Roeck1-6/+8
Commit 62ee783bf1f8 ("smsc911x: Fix crash seen if neither ACPI nor OF is configured or used") introduces an error check for the return value from device_get_phy_mode() and bails out if there is an error. Unfortunately, there are configurations where no phy is configured. Those configurations now fail. To fix the problem, accept error returns from device_get_phy_mode(), and use the return value from device_property_read_u32() to determine if there is a suitable firmware interface to read the configuration. Fixes: 62ee783bf1f8 ("smsc911x: Fix crash seen if neither ACPI nor OF is configured or used") Tested-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-27Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queueDavid S. Miller15-3166/+188
Jeff Kirsher says: ==================== Intel Wired LAN Driver Updates 2015-08-26 This series contains updates to i40e and i40evf only. Anjali provides a fix for i40e where the part is not receiving multicast or VLAN tagged packets when in promiscuous mode. This can occur when a software bridge is created on top of the device. Fixed the legacy and MSI interrupt mode in the driver, which was non-existent before since we were assuming MSIX was the only mode that the driver ran in. Fixed the i40evf driver, where the wrong defines were getting used in the VF driver. Mitch fixes a sparse warning about comparing __le16 to u16 so use le16_to_cpu() to resolve the warning. Also fixed a dyslexic spelling of invalid. Shannon adds port.crc_errors to receive CRC error counter, since it is a receive counter. Catherine provides a fix to move the stopping of the service task and flow director to i40e_shutdown() instead of i40e_suspend(). Greg fixes the ethtool offline diagnostic with netqueues, which just need to be treated the same as virtual functions when someone wants to run the ethtool offline diagnostic test. Also fixed up code comments for the i40e ethtool diagnostic test function. Cleans up redundant and unneeded messages, since the kernel notifies all VXLAN capable registered drivers, so no need to log this. Neerav adds the ability to update statistics per VEB per traffic class and dump it via ethtool. Jingjing adds support for virtual channel offload to support receive polling mode in the VF driver. v2: dropped patch which added helper functions into a header, feedback from David Miller was to make the functions constant to reduce the driver footprint, so remove the patch while Anjali works on making the requested changes. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-27smsc9194: Remove uncompilable #if 0'd use of pr_dbgJoe Perches1-30/+2
No pr_dbg method exists. While this code is #if 0'd, it'd be nicer to use the generic hex_dump, so use it instead. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-27drivers: net: xgene: Adding support for TSOIyappan Subramanian5-24/+262
Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-27drivers: net: xgene: Preparatory patch for TSO supportIyappan Subramanian2-7/+23
- Rearranged descriptor writes - Moved increment command write to xgene_enet_setup_tx_desc Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-27bgmac: support up to 3 cores (devices) on a busRafał Miłecki1-5/+23
Broadcom buses may have more than 1 Ethernet device. This is used e.g. to have few interfaces connected to different switch ports. So far we saw chipsets with only 2 devices (e.g. BCM4706) but recent ones have up to 3 (e.g. Netgear R8000 uses 3rd interface for most of switch traffic, lower interfaces are for some kind of offloading). Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-27Merge tag 'wireless-drivers-next-for-davem-2015-08-26' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-nextDavid S. Miller37-196/+693
Kalle Valo says: ==================== Major changes: iwlwifi: * new Tx power firmware API * bump max firmware API to 17 * fix bug in debug prints * static checker fix * fix unused defines * fix command list on newest firmware brcmfmac: * support NVRAM loading for bcm47xx platform * new debugfs entry for msgbuf protocol layer used with PCIe devices ath10k: * add spectral scan support for qca99x0 * add qca6164 support ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-26i40e/i40evf: Bump i40e to 1.3.9 and i40evf to 1.3.5Catherine Sullivan2-3/+3
Bump version and update the copyright year for i40evf. Change-ID: Iddb81b9dba09f0dc57ab54937b5821ecdd721ff6 Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-08-26i40e/i40evf: Cache the CEE TLV status returned from firmwareNeerav Parikh3-0/+6
Store the CEE TLV status returned by firmware to allow drivers to dump that for debug purposes. Change-ID: Ie3c4cf8cebabee4f15e1e3fdc4fc8a68bbca40ee Signed-off-by: Neerav Parikh <neerav.parikh@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-08-26i40e/i40evf: add VIRTCHNL_VF_OFFLOAD flagAnjali Singhai Jain4-0/+21
Add virtual channel offload capability to support RX polling mode in the VF. Change-ID: Ib643ae2a7506dfc75fc489fc207493fabefa4832 Signed-off-by: Jingjing Wu <jingjing.wu@intel.com> Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-08-26i40e: Remove redundant and unneeded messagesGreg Rose2-4/+0
The kernel notifies all VXLAN capable registered drivers, i.e. any driver that implements ndo_add_vxlan_port(), of the addition of a port so that the driver can track which ports are in use. There's no need to log this - it just fills the system log with useless and irksome noise. Also, when failing to init SR-IOV interfaces the driver was printing the same message twice. Just remove the inner printk and let the outer message catch enable as well as the other failures. Change-ID: Id5ecb1d425c2a357ee2bc1635dab24553831dade Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-08-26i40evf: Remove PF specific register definitions from the VFAnjali Singhai Jain3-3108/+4
There were quite a few issues when the wrong defines were getting used in the VF driver. This patch fixes the code where PF driver registers were getting used for VF driver, and also removes the registers that are not being used from the VF register file. Change-ID: If116a9730112950d006eb8ec763998fc914cc839 Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com> Acked-by: Mitch Williams <mitch.a.williams@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-08-26i40evf: Use the correct defines to match the VF registersAnjali Singhai Jain2-33/+33
Use CTLN1 instead of CTLN for the VF relative register space. Change-ID: Iefba63faf0307af55fec8dbb64f26059f7d91318 Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-08-26i40e: correct spelling errorMitch Williams1-1/+1
Turns out that 'inavlid' is an inavlid spelling for 'invalid'. Change-ID: Ie1fe2d0f8d1ba75ab880594875ec2e4152a76f61 Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-08-26i40e: Fix comment for ethtool diagnostic link testGreg Rose1-3/+5
The existing comment is incorrect. Add new comment to point out that the PF reset does not affect link but if the reset is changed to a different type that does affect link then the link test would need to be moved to before the reset. Change-ID: I28d786f46e9465860babdee61c1dba51016464df Reported-by: Jeremiah Kyle <jeremiah.kyle@intel.com> Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-08-26i40e/i40evf: Add capability to gather VEB per TC statsNeerav Parikh5-2/+67
This patch adds capability to update per VEB per TC statistics and dump it via ethtool. It also adds a structure to hold VEB per TC statistics. The fields can be filled by reading the GLVEBTC_* counters. Change-ID: I28b4759b9ab6ad5a61f046a1bc9ef6b16fe31538 Signed-off-by: Neerav Parikh <neerav.parikh@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-08-26i40e: Fix ethtool offline diagnostic with netqueuesGreg Rose1-2/+17
Treat netqueues the same way we do virtual functions when someone wants to run the ethtool offline diagnostic test. Change-ID: Id48d2b933f1fd0db7be06305a93c6ebe3dc821f5 Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-08-26i40e: Fix legacy interrupt mode in the driverAnjali Singhai Jain1-4/+12
This patch fixes the driver flow to take into account legacy interrupts. Over time we added code that assumes MSIX is the only mode that the driver runs in. It also enables a legacy workaround to trigger SWINT when the TX ring has non-cache aligned descriptors pending and interrupts are disabled. We work with a single vector in MSI mode too, so apply the same restrictions as Legacy. Change-ID: I826ddff1f9bd45d2dbe11f56a3ddcef0dbf42563 Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-08-26i40e: Move function calls to i40e_shutdown instead of i40e_suspendCatherine Sullivan1-3/+13
We should be stopping the service task and flow director on shutdown not on suspension. Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-08-26i40e: add RX to port CRC errors labelShannon Nelson1-1/+1
The port.crc_errors is really an RX counter, so let's mark it as such. Change-ID: I179afd3f8a95d45229bb4163a6aeb01f0d2d250b Signed-off-by: Shannon Nelson <shannon.nelson@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-08-26i40e: don't degrade __le16Mitch Williams2-2/+5
Sparse cries when we compare an __le16 to a u16, almost like it cares about architectures other than x86. Weird. Use the le16_to_cpu macro to make it stop crying. Change-ID: Id068f4d7868a2d3df234a791a76d15938f37db35 Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2015-08-26Merge ath-next from ath.gitKalle Valo16-95/+348
Major changes in ath10k: * add spectral scan support for qca99x0 * add qca6164 support
2015-08-26ath10k: fix compilation warnings in wmi phyerr pull functionRaja Mani1-2/+2
Below compilation warnings are observed in gcc version 4.8.2. Even though it's not seen in bit older gcc versions (for ex, 4.7.3), It's good to fix it by changing format specifier from %d to %zd in wmi pull phyerr functions. wmi.c: In function 'ath10k_wmi_op_pull_phyerr_ev': wmi.c:3567:8: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long unsigned int' [-Wformat=] left_len, sizeof(*phyerr)); ^ wmi.c: In function 'ath10k_wmi_10_4_op_pull_phyerr_ev': wmi.c:3612:8: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long unsigned int' [-Wformat=] left_len, sizeof(*phyerr)); ^ Fixes: 991adf71a6cd ("ath10k: refactor phyerr event handlers") Fixes: 2b0a2e0d7c2f ("ath10k: handle 10.4 firmware phyerr event") Signed-off-by: Raja Mani <rmani@qti.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-08-26ath10k: add qca6164 supportMichal Kazior3-0/+25
This adds additional 0x0041 PCI Device ID definition to ath10k for QCA6164 which is a 1 spatial stream sibling of the QCA6174 (which is 2 spatial stream chip). The QCA6164 needs a dedicated board.bin file which is different than the one used for QCA6174. If the board.bin is wrong the device will crash early while trying to boot firmware. The register dump will look like this: ath10k_pci 0000:02:00.0: firmware register dump: ath10k_pci 0000:02:00.0: [00]: 0x05010000 0x000015B3 0x000A012D 0x00955B31 ... Note the value 0x000A012D. Special credit goes to Alan Liu <alanliu@qca.qualcomm.com> for providing support help which enabled me to come up with this patch. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-08-26ath10k: add spectral scan support for 10.4 fwRaja Mani2-0/+11
To enable/configure spectral scan parameters in 10.4 firmware, existing wmi spectral related functions can be reused. Link those functions in 10.4 wmi ops table. In addition, adjust bin size (only when size is 68 bytes) before reporting bin samples to user space. The background for this adjustment is that qca99x0 reports bin size as 68 bytes (64 bytes + 4 bytes) in report mode 2. First 64 bytes carries in-band tones (-32 to +31) and last 4 byte carries band edge detection data (+32) mainly used in radar detection purpose. Additional last 4 bytes are stripped to make bin size valid one. This bin size adjustment will happen only for qca99x0, all other chipsets will report proper bin sizes (64/128) without extra 4 bytes being added at the end. The changes are validated in qca99x0 using 10.4 firmware. Signed-off-by: Raja Mani <rmani@qti.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-08-26ath10k: fix dma_mapping_error() handlingMichal Kazior4-5/+16
The function returns 1 when DMA mapping fails. The driver would return bogus values and could possibly confuse itself if DMA failed. Fixes: 767d34fc67af ("ath10k: remove DMA mapping wrappers") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-08-26ath10k: add missing mutex unlock on failpathMichal Kazior1-1/+2
Kernel would complain about leaving a held lock after going back to userspace and would subsequently deadlock. Fixes: e04cafbc38c7 ("ath10k: fix peer limit enforcement") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-08-25enic: reduce ioread in devcmd2Govindarajulu Varadarajan2-3/+6
posted_index is RO in firmware. We need not do ioread everytime to get posted index. Store posted index locally. Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-25r8169: Add values missing in @get_stats64 from HW countersCorinna Vinschen1-14/+149
The r8169 driver collects statistical information returned by @get_stats64 by counting them in the driver itself, even though many (but not all) of the values are already collected by tally counters (TCs) in the NIC. Some of these TC values are not returned by @get_stats64. Especially the received multicast packages are missing from /proc/net/dev. Rectify this by fetching the TCs and returning them from rtl8169_get_stats64. The counters collected in the driver obviously disappear as soon as the driver is unloaded so after a driver is loaded the counters always start at 0. The TCs on the other hand are only reset by a power cycle. Without further considerations the values collected by the driver would not match up against the TC values. This patch introduces a new function rtl8169_reset_counters which resets the TCs. Also, since rtl8169_reset_counters shares most of its code with rtl8169_update_counters, refactor the shared code into two new functions rtl8169_map_counters and rtl8169_unmap_counters. Unfortunately chip versions prior to RTL_GIGA_MAC_VER_19 don't allow to reset the TCs programatically. Therefore introduce an addition to the rtl8169_private struct and a function rtl8169_init_counter_offsets to store the TCs at first rtl_open. Use these values as offsets in rtl8169_get_stats64. Propagate a failure to reset *and* update the counters up to rtl_open and emit a warning message, if so. Signed-off-by: Corinna Vinschen <vinschen@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-25ppp: implement x-netns supportGuillaume Nault1-2/+15
Let packets move from one netns to the other at PPP encapsulation and decapsulation time. PPP units and channels remain in the netns in which they were originally created. Only the net_device may move to a different namespace. Cross netns handling is thus transparent to lower PPP layers (PPPoE, L2TP, etc.). PPP devices are automatically unregistered when their netns gets removed. So read() and poll() on the unit file descriptor will respectively receive EOF and POLLHUP. Channels aren't affected. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-25net: sun4i-emac: Claim emac sramHans de Goede1-2/+11
Claim the emac sram ourselves, rather then relying on the bootloader having mapped the sram to the emac controller during boot. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-25net/mlx5e: Avoid accessing NULL pointer at ndo_select_queueRana Shahout3-6/+6
To avoid multiply/division operations on the data path, we hold a {channel, tc}==>txq mapping table. We held this mapping table inside the channel object that is being destroyed upon some configuration operations (e.g MTU change). So in case ndo_select_queue occurs during such a configuration operation, it may access a NULL channel pointer, resulting in kernel panic. To fix this issue we moved the {channel, tc}==>txq mapping table outside the channel object so that it will be available also during such configuration operations. Signed-off-by: Rana Shahout <ranas@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-25mlxsw: fix error return codeJulia Lawall1-0/+1
Return a negative error code on failure. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ identifier ret; expression e1,e2; @@ ( if (\(ret < 0\|ret != 0\)) { ... return ret; } | ret = 0 ) ... when != ret = e1 when != &ret *if(...) { ... when != ret = e2 when forall return ret; } // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-25net: davinci_emac: fix error return codeJulia Lawall1-1/+3
Propagate error code on failure. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ identifier ret; expression e1,e2; @@ ( if (\(ret < 0\|ret != 0\)) { ... return ret; } | ret = 0 ) ... when != ret = e1 when != &ret *if(...) { ... when != ret = e2 when forall return ret; } // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: David S. Miller <davem@davemloft.net>