summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-07-319p: client: remove unused code and any reference to "cancelled" functionAndi Shyti2-10/+2
This patch reverts commit 80b45261a0b263536b043c5ccfc4ba4fc27c2acc which was implementing a 'cancelled' functionality to notify that a cancelled request will not be replied. This implementation was not used anywhere and therefore removed. Signed-off-by: Andi Shyti <andi@etezian.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-30be2net: don't use dev_err when AER enabling failsIvan Vecera1-1/+1
The driver uses dev_err when enabling of AER fails (e.g. PCIe AER is not supported). The dev_info is more appropriate to avoid console pollution. Cc: sathya.perla@emulex.com Cc: subbu.seetharaman@emulex.com Cc: ajit.khaparde@emulex.com Signed-off-by: Ivan Vecera <ivecera@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-30tg3: Update version to 3.133Nithin Sujir1-2/+2
Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-30tg3: Fix UDP fragments treated as RMCPNithin Sujir2-0/+4
The 5762 devices sometimes incorrectly treat udp fragments as RMCP packets and route to the APE. This patch sets the RX_MODE_IPV4_FRAG_FIX bit for these devices which enables the proper behaviour. Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-30tg3: Enable support for timesync gpio outputNithin Sujir2-4/+68
The PTP_CAPABLE tg3 devices have a gpio output that is toggled when the free running counter matches a watchdog value. This patch adds support to set the watchdog and enable this feature. Since the output is controlled via bits in the EAV_REF_CLCK_CTL register, we have to read-modify-write it when we stop/resume. Cc: Richard Cochran <richardcochran@gmail.com> Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-30tg3: Implement the shutdown handlerNithin Sujir1-2/+18
Also remove the call to tg3_power_down_prepare() in tg3_power_down() since tg3_close() calls it. Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-30tg3: Allow NVRAM programming when interface is downNithin Sujir1-8/+2
Previously, when the interface was brought down, the driver would set the power state to D3hot. In D3hot, we don't have access to the NVRAM. This patch removes the call to set the power state to PCI_D3hot in close. A following patch will implement the shutdown handler to properly set the D3hot state when the system is going down. Doing the above means that the TG3_PHYFLG_IS_LOW_POWER should not be checked to validate access to the NVRAM. Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-30tg3: Remove incorrect switch to aux powerNithin Sujir1-5/+0
During probe, the driver is incorrectly switching the power to Vaux on the 5717 and later devices. At this point, we are in D0 state and drawing maximum power. We also definitely have Vmain available. It doesn't make sense to switch to Vaux since it has a lesser maximum power draw and we might go over the limit. On a new system, we observe that not all ports are recognized in some of the slots with this call in place. Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-30cnic: Update version to 2.5.17 and copyright year.Michael Chan4-6/+6
Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-30cnic: Add missing error checking for RAMROD_CMD_ID_CLOSEEddie Wai1-4/+7
Completion status field should also be checked for non-zero error condition. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-30cnic: Update TCP options setup for iSCSI.Eddie Wai3-32/+37
Update TCP delayed ACK and timestamp options setup to match latest bnx2x firmware. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-30cnic: Reset tcp_flags during cnic_cm_create().Eddie Wai1-0/+1
Without resetting it, the bnx2i driver cannot use different options for different iSCSI connections. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-30cnic: Simplify cnic_release().Michael Chan1-13/+0
Since unregister_netdevice_notifier() will replay the NETDEV_DOWN and NETDEV_UNREGISTER_EVENTS, the cnic_dev_list will be cleaned up automatically. The loop to cleanup the cnic_dev_list can be removed in cnic_release(). Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-30cnic: Simplify netdev events handling.Michael Chan1-2/+2
After this earlier commit to simplify probing: commit 4bd9b0fffb193d2e288f67f81821af32df8d4349 cnic, bnx2x, bnx2: Simplify cnic probing. we can now reliably receive netdev events and we can simplify the handling of these events. We now remove the logic that tries to handle missed NETDEV_REGISTER events. This change will allow cleanup to be simplified in the next patch. We can now rely on the play back of netdev events during unregister_netdevice_notifier() to cleanup the structures. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-29net/mlx4_core: Respond to operation request by firmwareYevgeny Petrilin9-27/+166
This commit adds new firmware command and new firmware event. The firmware raises the MLX4_EVENT_TYPE_OP_REQUIRED event in order to signal the driver it needs to perform an administrative operation throughout the MLX4_CMD_GET_OP_REQ command. At the moment the supported operation is adding/removing multicast entries which are used by the firmware for handling NCSI traffic in B0 steering mode. Also, had to swap the order of mlx4_init_mcg_table() and mlx4_init_eq_table() to make sure that driver will get events only after resources are initialized to handle it. Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.com> Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.com> Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com> Signed-off-by: Amir Vadai <amirv@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-29net/mlx4_en: Fix BlueFlame raceEugenia Emantayev1-19/+42
Fix a race between BlueFlame flow and stamping in post send flow. Example: SW: Build WQE 0 on the TX buffer, except the ownership bit SW: Set ownership for WQE 0 on the TX buffer SW: Ring doorbell for WQE 0 SW: Build WQE 1 on the TX buffer, except the ownership bit SW: Set ownership for WQE 1 on the TX buffer HW: Read WQE 0 and then WQE 1, before doorbell was rung/BF was done for WQE 1 HW: Produce CQEs for WQE 0 and WQE 1 SW: Process the CQEs, and stamp WQE 0 and WQE 1 accordingly (on the TX buffer) SW: Copy WQE 1 from the TX buffer to the BF register - ALREADY STAMPED! HW: CQE error with index 0xFFFF - the BF WQE's control segment is STAMPED, so the BF index is 0xFFFF. Error: Invalid Opcode. As a result QP enters the error state and no traffic can be sent. Solution: When stamping - do not stamp last completed wqe. Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com> Signed-off-by: Amir Vadai <amirv@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-29pktgen: add needed include fileStephen Rothwell1-0/+1
Fixes this on PowerPC (at least): net/core/pktgen.c: In function 'fill_packet_ipv6': net/core/pktgen.c:2906:3: error: implicit declaration of function 'csum_ipv6_magic' [-Werror=implicit-function-declaration] udph->check = ~csum_ipv6_magic(&iph->saddr, &iph->daddr, udplen, IPPROTO_UDP, 0); ^ Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-29Merge branch 'master' of ↵David S. Miller8-101/+217
git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next Jeff Kirsher says: ==================== This series contains updates to e100 and e1000e. The e100 patch from Andy simply updates the netif_printk() to use %*ph to dump small buffers. The changes to e1000e include a fix from Dean Nelson to resolve a issue where a pci_clear_master() was accidentally dropped during a conflict resolution. Wei Young provides 2 patches, one removes an assignment of the default ring size because it was a duplicate. The second changes the packet split receive structure to use PS_PAGE_BUFFERS macro for the length so that problems won't occur when the length is changed. The remaining patches for e1000e are from Bruce Allan, where he provides a number of fixes and updates for I218. In addition, a fix for 82583 which can disappear off the PCIe bus, to resolve this, disable ASPM L1. Bruce also provides a fix to a previous commit (commit e60b22c5b7 e1000e: fix accessing to suspended device) so that devices are only taken out of runtime power management for those ethtool operations that must access device registers. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-28ipv4, ipv6: send igmpv3/mld packets with TC_PRIO_CONTROLHannes Frederic Sowa2-1/+6
v2: a) Also send ipv4 igmp messages with TC_PRIO_CONTROL Cc: William Manley <william.manley@youview.com> Cc: Lukas Tribus <luky-37@hotmail.com> Acked-by: Benjamin LaHaise <bcrl@kvack.org> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-28e1000e: fix I217/I218 PHY initialization flowBruce Allan1-33/+50
The initialization of the PHY on I217/I218, while similar to 82579, must also check to see if the MAC and PHY are in the same mode (PCIe vs. SMBus) otherwise the PHY will be inaccessible by the MAC. 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>
2013-07-28e1000e: do not resume device from RPM suspend to read PHY status registersBruce Allan1-3/+2
When the device is runtime suspended (e.g. when there is no link), do not wake it from D3 to read the PHY status; just set the values to typical power-on defaults as is done when runtime PM is not enabled and there is no link. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-07-28e1000e: enable support for new device IDsBruce Allan3-2/+14
The device IDs 0x15a0 and 0x15a1 are new SKUs that contain the same MAC as I217 and same PHY as I218. The device IDs 0x15a2 and 0x15a3 are the same as existing I218 SKUs. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-07-28e1000e: ethtool unnecessarily takes device out of RPM suspendBruce Allan1-28/+77
A previous patch (commit e60b22c5b7 e1000e: fix accessing to suspended device) added .begin and .complete ethtool driver callbacks so that the device was resumed from Runtime Power Management (RPM) suspend state for all ethtool operations. This is overkill for operations which do not need to access any registers in the device. This patch makes it so that the device is taken out of RPM suspend only for those ethtool operations that must access device registers. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-07-28e1000e: Tx hang on I218 when linked at 100Half and slow response at 10MbpsBruce Allan2-7/+48
Tx hang is an unintended consequence of another workaround that is in the EEPROM for an issue with the firmware at 10Mbps when K1 (a power mode of the MAC-PHY interconnect) is enabled. The issue is resolved by setting appropriate Tx re-transmission timeouts in the PHY and associated K1 entry times in the MAC to allow enough transmissions to occur without triggering a Tx hang. A similar change is needed when linked at 10Mbps to improve latency. 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>
2013-07-28e1000e: low throughput using 4K jumbos on I218Bruce Allan1-0/+2
Alter the packet buffer allocation accordingly. 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>
2013-07-28e1000e: iAMT connections drop on driver unload when jumbo frames enabledBruce Allan1-11/+10
The jumbo frame configuration in the MAC/PHY should be reverted on 82579 and newer parts when the interface is brought down (not just when the MTU is changed back to standard frame size) otherwise iAMT connections (e.g. SoL, IDE-R) will be dropped and cannot be re-acquired until the MTU is changed again. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-07-28e1000e: disable ASPM L1 on 82583Bruce Allan1-0/+1
The 82583 can disappear off the PCIe bus. This device is a modified 82574 which had the same problem which was fixed by disabling ASPM L1; disabling it on 82583 fixes the issue on this device. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-07-28e1000e: Use marco instead of digit for defining e1000_rx_desc_packet_splitWei Yang2-4/+5
In structure e1000_rx_desc_packet_split, the size of wb.upper.length is defined by a digit. This may introduce some problem when the length is changed. This patch use the macro PS_PAGE_BUFFERS for the definition. And move the definition to hw.h. Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-07-28e1000e: Remove duplicate assignment of default rx/tx ring sizeWei Yang1-4/+0
tx_ring/rx_ring size is assigned in function e1000_alloc_queues(), which is called by e1000_sw_init() in the early stage of e1000_probe(). This patch just remove the duplicate assignment of this default ring size value. Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com> Reviewed-by: Gavin Shan <shangw@linux.vnet.ibm.com> Reviewed-by: Da Yu Qiu <qiudayu@cn.ibm.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Acked-by: Bruce Allan <bruce.w.allan@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-07-28e1000e: restore call to pci_clear_master()Dean Nelson1-0/+2
In attempting to resolve a minor merge conflict, commit e5f2ef7ab4690d2e8faa (Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net) accidentally dropped a call to pci_clear_master() that was intended to remain in place. Commit 4e0855dff094b0d56d6b (e1000e: fix pci-device enable-counter balance) replaced a call to pci_disable_device() by one to pci_clear_master(). And then commit 66148babe728f3e00e13 (e1000e: fix runtime power management transitions) deleted a number of lines starting two lines following that call. This patch restores the call to pci_clear_master() in __e1000_shutdown(). v2: added summary lines (enclosed in parens) following commit IDs Signed-off-by: Dean Nelson <dnelson@redhat.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Acked-by: Bruce Allan <bruce.w.allan@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-07-28e100: dump small buffers via %*phAndy Shevchenko1-9/+6
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-07-28bonding: remove bond_resend_igmp_join_requests read_unlock leftovernikolay@redhat.com1-1/+0
After commit 4aa5dee4d9 ("net: convert resend IGMP to notifier event") we have 1 read_unlock in bond_resend_igmp_join_requests which isn't paired with a read_lock because it's removed by that commit. Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com> Reviewed-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-28pktgen: Use ip_send_check() to compute checksumThomas Graf1-2/+1
Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-28pktgen: Add UDPCSUM flag to support UDP checksumsThomas Graf3-6/+55
UDP checksums are optional, hence pktgen has been omitting them in favour of performance. The optional flag UDPCSUM enables UDP checksumming. If the output device supports hardware checksumming the skb is prepared and marked CHECKSUM_PARTIAL, otherwise the checksum is generated in software. Signed-off-by: Thomas Graf <tgraf@suug.ch> Cc: Eric Dumazet <edumazet@google.com> Cc: Ben Greear <greearb@candelatech.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-28VSOCK: Move af_vsock.h and vsock_addr.h to include/netAsias He6-7/+5
This is useful for other VSOCK transport implemented outside the net/vmw_vsock/ directory to use these headers. Signed-off-by: Asias He <asias@redhat.com> Acked-by: Andy King <acking@vmware.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-28Merge branch 'minnow/net-next' of ↵David S. Miller4-1/+164
git://git.infradead.org/users/dvhart/linux-2.6 into minnow Darren Hart says: ==================== Add support for the MinnowBoard in the pch_gbe driver. This was originally sent to LKML as part of the MinnowBoard support series. That is now partially merged and this version of the patch has been isolated from those changes and is now completely self-contained. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-28USBNET: increase max rx/tx qlen for improving USB3 thoughtputMing Lei1-0/+9
The default RX_QLEN()/TX_QLEN() didn't consider super speed USB device, so only max 4 URBs are scheduled at the same time for tx/rx, then USB3 NIC can't perform very well. With this patch, both rx and tx thoughput are increased more than 100Mbps when doing iperf test on ax88179_178a USB 3.0 NIC. Signed-off-by: Ming Lei <ming.lei@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-28USBNET: centralize computing of max rx/tx qlenMing Lei4-8/+46
This patch centralizes computing of max rx/tx qlen, because: - RX_QLEN()/TX_QLEN() is called in hot path - computing depends on device's usb speed, now we have ls/fs, hs, ss, so more checks need to be involved - in fact, max rx/tx qlen should not only depend on device USB speed, but also depend on ethernet link speed, so we need to consider that in future. - if SG support is done, max tx qlen may need change too Generally, hard_mtu and rx_urb_size are changed in bind(), reset() and link_reset() callback, and change mtu network operation, this patches introduces the API of usbnet_update_max_qlen(), and calls it in above path. Signed-off-by: Ming Lei <ming.lei@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-28tuntap: hardware vlan tx supportJason Wang1-4/+36
Inspired by commit f09e2249c4f5c7c13261ec73f5a7807076af0c8e (macvtap: restore vlan header on user read). This patch adds hardware vlan tx support for tuntap. This is done by copying vlan header directly into userspace in tun_put_user() instead of doing it through __vlan_put_tag() in dev_hard_start_xmit(). This eliminates one unnecessary memmove() in vlan_insert_tag() for 802.1ad and 802.1q traffic. pktgen test shows about 20% improvement for 802.1q traffic: Before: 662149pps 317Mb/sec (317831520bps) errors: 0 After: 801033pps 384Mb/sec (384495840bps) errors: 0 Cc: Basil Gor <basil.gor@gmail.com> Cc: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-28net/sctp: Refactor SCTP skb checksum computationJoe Stringer4-36/+20
This patch consolidates the SCTP checksum calculation code from various places to a single new function, sctp_compute_cksum(skb, offset). Signed-off-by: Joe Stringer <joe@wand.net.nz> Reviewed-by: Julian Anastasov <ja@ssi.bg> Acked-by: Simon Horman <horms@verge.net.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-28virtio-net: put virtio net header inline with dataMichael S. Tsirkin2-9/+37
For small packets we can simplify xmit processing by linearizing buffers with the header: most packets seem to have enough head room we can use for this purpose. Since existing hypervisors require that header is the first s/g element, we need a feature bit for this. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-27bond: cleanup netpoll codestephen hemminger1-7/+1
This started out with fixing a sparse warning, then I realized that the wrapper function bond_netpoll_info could just be removed by rolling it into the enable code. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Jiri Pirko <jiri@resnulli.us> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-27team: cleanup netpoll clodestephen hemminger1-17/+8
This started out with fixing a sparse warning, then I realized that the wrapper function team_netpoll_info could just be collapsed away by rolling it into the enable code. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-27bridge: cleanup netpoll codestephen hemminger3-17/+8
This started out with fixing a sparse warning, then I realized that the wrapper function br_netpoll_info could just be collapsed away by rolling it into the enable code. Also, eliminate unnecessary goto's Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Jiri Pirko <jiri@resnulli.us> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-27bonding: use pre-defined macro in bond_mode_name instead of magic number 0Wang Sheng-Hui1-1/+1
We have BOND_MODE_ROUNDROBIN pre-defined as 0, and it's the lowest mode number. Use it to check the arg lower bound instead of magic number 0 in bond_mode_name. Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-25pch_gbe: Add MinnowBoard supportDarren Hart4-0/+163
The MinnowBoard uses an AR803x PHY with the PCH GBE which requires special handling. Use the MinnowBoard PCI Subsystem ID to detect this and add a pci_device_id.driver_data structure and functions to handle platform setup. The AR803x does not implement the RGMII 2ns TX clock delay in the trace routing nor via strapping. Add a detection method for the board and the PHY and enable the TX clock delay via the registers. This PHY will hibernate without link for 10 seconds. Ensure the PHY is awake for probe and then disable hibernation. A future improvement would be to convert pch_gbe to using PHYLIB and making sure we can wake the PHY at the necessary times rather than permanently disabling it. Signed-off-by: Darren Hart <dvhart@linux.intel.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Peter Waskiewicz <peter.p.waskiewicz.jr@intel.com> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Joe Perches <joe@perches.com> Cc: netdev@vger.kernel.org
2013-07-25drivers/net/ethernet/stmicro/stmmac: don't check resource with ↵Wolfram Sang1-3/+0
devm_ioremap_resource devm_ioremap_resource does sanity checks on the given resource. No need to duplicate this in the driver. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-25pch_gbe: Use PCH_GBE_PHY_REGS_LEN instead of 32Darren Hart1-1/+1
Avoid using magic numbers when we have perfectly good defines just lying around. Signed-off-by: Darren Hart <dvhart@linux.intel.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Peter Waskiewicz <peter.p.waskiewicz.jr@intel.com> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: netdev@vger.kernel.org
2013-07-25net: Make devnet_rename_seq staticThomas Gleixner2-4/+1
No users outside net/core/dev.c. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-25tcp: TCP_NOTSENT_LOWAT socket optionEric Dumazet10-6/+61
Idea of this patch is to add optional limitation of number of unsent bytes in TCP sockets, to reduce usage of kernel memory. TCP receiver might announce a big window, and TCP sender autotuning might allow a large amount of bytes in write queue, but this has little performance impact if a large part of this buffering is wasted : Write queue needs to be large only to deal with large BDP, not necessarily to cope with scheduling delays (incoming ACKS make room for the application to queue more bytes) For most workloads, using a value of 128 KB or less is OK to give applications enough time to react to POLLOUT events in time (or being awaken in a blocking sendmsg()) This patch adds two ways to set the limit : 1) Per socket option TCP_NOTSENT_LOWAT 2) A sysctl (/proc/sys/net/ipv4/tcp_notsent_lowat) for sockets not using TCP_NOTSENT_LOWAT socket option (or setting a zero value) Default value being UINT_MAX (0xFFFFFFFF), meaning this has no effect. This changes poll()/select()/epoll() to report POLLOUT only if number of unsent bytes is below tp->nosent_lowat Note this might increase number of sendmsg()/sendfile() calls when using non blocking sockets, and increase number of context switches for blocking sockets. Note this is not related to SO_SNDLOWAT (as SO_SNDLOWAT is defined as : Specify the minimum number of bytes in the buffer until the socket layer will pass the data to the protocol) Tested: netperf sessions, and watching /proc/net/protocols "memory" column for TCP With 200 concurrent netperf -t TCP_STREAM sessions, amount of kernel memory used by TCP buffers shrinks by ~55 % (20567 pages instead of 45458) lpq83:~# echo -1 >/proc/sys/net/ipv4/tcp_notsent_lowat lpq83:~# (super_netperf 200 -t TCP_STREAM -H remote -l 90 &); sleep 60 ; grep TCP /proc/net/protocols TCPv6 1880 2 45458 no 208 yes ipv6 y y y y y y y y y y y y y n y y y y y TCP 1696 508 45458 no 208 yes kernel y y y y y y y y y y y y y n y y y y y lpq83:~# echo 131072 >/proc/sys/net/ipv4/tcp_notsent_lowat lpq83:~# (super_netperf 200 -t TCP_STREAM -H remote -l 90 &); sleep 60 ; grep TCP /proc/net/protocols TCPv6 1880 2 20567 no 208 yes ipv6 y y y y y y y y y y y y y n y y y y y TCP 1696 508 20567 no 208 yes kernel y y y y y y y y y y y y y n y y y y y Using 128KB has no bad effect on the throughput or cpu usage of a single flow, although there is an increase of context switches. A bonus is that we hold socket lock for a shorter amount of time and should improve latencies of ACK processing. lpq83:~# echo -1 >/proc/sys/net/ipv4/tcp_notsent_lowat lpq83:~# perf stat -e context-switches ./netperf -H 7.7.7.84 -t omni -l 20 -c -i10,3 OMNI Send TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 7.7.7.84 () port 0 AF_INET : +/-2.500% @ 99% conf. Local Remote Local Elapsed Throughput Throughput Local Local Remote Remote Local Remote Service Send Socket Recv Socket Send Time Units CPU CPU CPU CPU Service Service Demand Size Size Size (sec) Util Util Util Util Demand Demand Units Final Final % Method % Method 1651584 6291456 16384 20.00 17447.90 10^6bits/s 3.13 S -1.00 U 0.353 -1.000 usec/KB Performance counter stats for './netperf -H 7.7.7.84 -t omni -l 20 -c -i10,3': 412,514 context-switches 200.034645535 seconds time elapsed lpq83:~# echo 131072 >/proc/sys/net/ipv4/tcp_notsent_lowat lpq83:~# perf stat -e context-switches ./netperf -H 7.7.7.84 -t omni -l 20 -c -i10,3 OMNI Send TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 7.7.7.84 () port 0 AF_INET : +/-2.500% @ 99% conf. Local Remote Local Elapsed Throughput Throughput Local Local Remote Remote Local Remote Service Send Socket Recv Socket Send Time Units CPU CPU CPU CPU Service Service Demand Size Size Size (sec) Util Util Util Util Demand Demand Units Final Final % Method % Method 1593240 6291456 16384 20.00 17321.16 10^6bits/s 3.35 S -1.00 U 0.381 -1.000 usec/KB Performance counter stats for './netperf -H 7.7.7.84 -t omni -l 20 -c -i10,3': 2,675,818 context-switches 200.029651391 seconds time elapsed Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Neal Cardwell <ncardwell@google.com> Cc: Yuchung Cheng <ycheng@google.com> Acked-By: Yuchung Cheng <ycheng@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>