aboutsummaryrefslogtreecommitdiff
path: root/drivers/net
AgeCommit message (Collapse)AuthorFilesLines
2016-11-19virtio_net: Do not clear memory for struct virtio_net_hdr twice.Jarno Rajahalme1-2/+1
virtio_net_hdr_from_skb() clears the memory for the header, so there is no point for the callers to do the same. Signed-off-by: Jarno Rajahalme <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-11-19virtio_net: Simplify call sites for virtio_net_hdr_{from, to}_skb().Jarno Rajahalme2-8/+5
No point storing the return value of virtio_net_hdr_to_skb() or virtio_net_hdr_from_skb() to a variable when the value is used only once as a boolean in an immediately following if statement. Signed-off-by: Jarno Rajahalme <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-11-19net: macb: add check for dma mapping error in start_xmit()Alexey Khoroshilov1-0/+6
at91ether_start_xmit() does not check for dma mapping errors. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-11-19mwifiex: pcie: stop checking for NULL adapter->cardBrian Norris1-30/+23
It should never be NULL here, and to think otherwise makes things confusing. Signed-off-by: Brian Norris <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2016-11-19mwifiex: stop checking for NULL drvata/intfdataBrian Norris2-21/+8
These are never NULL, so stop making people think they might be. I don't change this for SDIO because SDIO has a racy card-reset handler that reallocates this struct. I'd rather not touch that mess right now. Signed-off-by: Brian Norris <[email protected]> Tested-by: Xinming Hu <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2016-11-19mwifiex: sdio: don't check for NULL sdio_funcBrian Norris1-25/+15
sdio_func is retrieved via container_of() and should never be NULL. Checking for NULL just makes the logic more confusing than necessary. Stop doing that. Signed-off-by: Brian Norris <[email protected]> Tested-by: Xinming Hu <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2016-11-19mwifiex: usb: handle HS failuresBrian Norris1-1/+8
SDIO and PCIe drivers handle this. Let's imitate it. Signed-off-by: Brian Norris <[email protected]> Tested-by: Xinming Hu <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2016-11-19mwifiex: reset card->adapter during device unregisterXinming Hu2-0/+2
card->adapter gets initialized in mwifiex_register_dev(). As it's not cleared in mwifiex_unregister_dev(), we may end up accessing the memory which is already free in below scenario. Scenario: Driver initialization is failed due to incorrect firmware or some other reason. Meanwhile device reboot/unload occurs. This is safe, now that we've properly synchronized suspend() and remove() with the FW initialization thread; now that code can simply check for 'card->adapter == NULL' and exit safely. Signed-off-by: Xinming Hu <[email protected]> Tested-by: Xinming Hu <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Brian Norris <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2016-11-19mwifiex: resolve suspend() race with async FW init failureBrian Norris3-6/+30
Signed-off-by: Brian Norris <[email protected]> Tested-by: Xinming Hu <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2016-11-19mwifiex: don't pretend to resume while remove()'ingBrian Norris3-13/+0
The device core will not allow suspend() to race with remove(). Signed-off-by: Brian Norris <[email protected]> Tested-by: Xinming Hu <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2016-11-19mwifiex: remove redundant pdev check in suspend/resume handlersAmitkumar Karwar1-16/+6
to_pci_dev() would just do struct offset arithmetic on struct device to get 'pdev' pointer. We never get NULL pdev pointer. Signed-off-by: Amitkumar Karwar <[email protected]> Tested-by: Xinming Hu <[email protected]> Signed-off-by: Brian Norris <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2016-11-19mwifiex: resolve races between async FW init (failure) and device removalBrian Norris8-68/+55
It's possible for the FW init sequence to fail, which will trigger a device cleanup sequence in mwifiex_fw_dpc(). This sequence can race with device suspend() or remove() (e.g., reboot or unbind), and can trigger use-after-free issues. Currently, this driver attempts (poorly) to synchronize remove() using a semaphore, but it doesn't protect some of the critical sections properly. Particularly, we grab a pointer to the adapter struct (card->adapter) without checking if it's being freed or not. We later do a NULL check on the adapter, but that doesn't work if the adapter was freed. Also note that the PCIe interface driver doesn't ever set card->adapter to NULL, so even if we get the synchronization right, we still might try to redo the cleanup in ->remove(), even if the FW init failure sequence already did it. This patch replaces the static semaphore with a per-device completion struct, and uses that completion to synchronize the remove() thread with the mwifiex_fw_dpc(). A future patch will utilize this completion to synchronize the suspend() thread as well. Signed-off-by: Brian Norris <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2016-11-19mwifiex: complete blocked power save handshake in main processShengzhen Li1-4/+5
Power save handshake with firmware might be blocked by on-going data transfer. this patch check the PS status in main process and complete previous blocked PS handshake. this patch also remove redudant check before call mwifiex_check_ps_cond function. Signed-off-by: Cathy Luo <[email protected]> Signed-off-by: Shengzhen Li <[email protected]> Tested-by: Xinming Hu <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2016-11-19mwifiex: check tx_hw_pending before downloading sleep confirmShengzhen Li4-2/+10
We may get SLEEP event from firmware even if TXDone interrupt for last Tx packet is still pending. In this case, we may end up accessing PCIe memory for handling TXDone after power save handshake is completed. This causes kernel crash with external abort. This patch will only allow downloading sleep confirm when no tx done interrupt is pending in the hardware. Signed-off-by: Cathy Luo <[email protected]> Signed-off-by: Shengzhen Li <[email protected]> Tested-by: Xinming Hu <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Reviewed-by: Brian Norris <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2016-11-19mwifiex: Enable WoWLAN for both sdio and pcieRajat Jain5-75/+73
Commit ce4f6f0c353b ("mwifiex: add platform specific wakeup interrupt support") added WoWLAN feature only for sdio. This patch moves that code to the common module so that all the interface drivers can use it for free. It enables pcie and sdio for its use currently. Signed-off-by: Rajat Jain <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2016-11-19mwifiex: Introduce mwifiex_probe_of() to parse common propertiesRajat Jain2-4/+13
Introduce function mwifiex_probe_of() to parse common properties. Interface drivers get to decide whether or not the device tree node was a valid one (depending on the compatible property), Lets fill "adapter->dt_node" in mwifiex_add_card(). The function mwifiex_probe_of() is currently only a place holder with the next patch adding content to it. Signed-off-by: Rajat Jain <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2016-11-19mwifiex: Allow mwifiex early access to device structureRajat Jain5-11/+9
Today all the interface drivers (usb/pcie/sdio) assign the adapter->dev in the register_dev() callback, although they have this piece of info well before hand. This patch makes the device structure available for mwifiex right at the beginning, so that it can be used for early initialization if needed. This is needed for subsequent patches in this patchset that intend to unify and consolidate some of the code that would otherwise have to be duplicated among the interface drivers (sdio, pcie, usb). Signed-off-by: Rajat Jain <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2016-11-19mwifiex: parse device tree node for PCIeXinming Hu2-1/+26
This patch derives device tree node from pcie bus layer framework. Device tree bindings file has been renamed(marvell-sd8xxx.txt -> marvell-8xxx.txt) to accommodate PCIe changes. Signed-off-by: Xinming Hu <[email protected]> Signed-off-by: Rajat Jain <[email protected]> Reviewed-by: Brian Norris <[email protected]> Signed-off-by: Amitkumar Karwar <[email protected]> Acked-by: Rob Herring <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
2016-11-18Merge tag 'v4.9-rc4' into soundJonathan Corbet108-819/+1059
Bring in -rc4 patches so I can successfully merge the sound doc changes.
2016-11-18sunbmac: Fix compiler warningTushar Dave2-3/+4
sunbmac uses '__u32' for dma handle while invoking kernel DMA APIs, instead of using dma_addr_t. This hasn't caused any 'incompatible pointer type' warning on SPARC because until now dma_addr_t is of type u32. However, recent changes in SPARC ATU (iommu) enables 64bit DMA and therefore dma_addr_t becomes of type u64. This makes 'incompatible pointer type' warnings inevitable. e.g. drivers/net/ethernet/sun/sunbmac.c: In function ‘bigmac_ether_init’: drivers/net/ethernet/sun/sunbmac.c:1166: warning: passing argument 3 of ‘dma_alloc_coherent’ from incompatible pointer type ./include/linux/dma-mapping.h:445: note: expected ‘dma_addr_t *’ but argument is of type ‘__u32 *’ This patch resolves above compiler warning. Signed-off-by: Tushar Dave <[email protected]> Reviewed-by: chris hyser <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-11-18sunqe: Fix compiler warningsTushar Dave2-7/+8
sunqe uses '__u32' for dma handle while invoking kernel DMA APIs, instead of using dma_addr_t. This hasn't caused any 'incompatible pointer type' warning on SPARC because until now dma_addr_t is of type u32. However, recent changes in SPARC ATU (iommu) enables 64bit DMA and therefore dma_addr_t becomes of type u64. This makes 'incompatible pointer type' warnings inevitable. e.g. drivers/net/ethernet/sun/sunqe.c: In function ‘qec_ether_init’: drivers/net/ethernet/sun/sunqe.c:883: warning: passing argument 3 of ‘dma_alloc_coherent’ from incompatible pointer type ./include/linux/dma-mapping.h:445: note: expected ‘dma_addr_t *’ but argument is of type ‘__u32 *’ drivers/net/ethernet/sun/sunqe.c:885: warning: passing argument 3 of ‘dma_alloc_coherent’ from incompatible pointer type ./include/linux/dma-mapping.h:445: note: expected ‘dma_addr_t *’ but argument is of type ‘__u32 *’ This patch resolves above compiler warnings. Signed-off-by: Tushar Dave <[email protected]> Reviewed-by: chris hyser <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-11-18cxgb4: Allocate Tx queues dynamicallyHariprasad Shenai6-74/+273
Allocate resources dynamically for Upper layer driver's (ULD) like cxgbit, iw_cxgb4, cxgb4i and chcr. The resources allocated include Tx queues which are allocated when ULD register with cxgb4 driver and freed while un-registering. The Tx queues which are shared by ULD shall be allocated by first registering driver and un-allocated by last unregistering driver. Signed-off-by: Atul Gupta <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-11-18liquidio CN23XX: bitwise vs logical AND typoDan Carpenter1-1/+1
We obviously intended a bitwise AND here, not a logical one. Fixes: 8c978d059224 ("liquidio CN23XX: Mailbox support") Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-11-18Merge tag 'mac80211-for-davem-2016-11-18' of ↵David S. Miller1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211 Johannes Berg says: ==================== A few more bugfixes: * limit # of scan results stored in memory - this is a long-standing bug Jouni and I only noticed while discussing other things in Santa Fe * revert AP_LINK_PS patch that was causing issues (Felix) * various A-MSDU/A-MPDU fixes for TXQ code (Felix) * interoperability workaround for peers with broken VHT capabilities (Filip Matusiak) * add bitrate definition for a VHT MCS that's supposed to be invalid but gets used by some hardware anyway (Thomas Pedersen) * beacon timer fix in hwsim (Benjamin Beichler) ==================== Signed-off-by: David S. Miller <[email protected]>
2016-11-18lan78xx: relocate mdix setting to phy driverWoojung Huh2-71/+38
Relocate mdix code to phy driver to be called at config_init(). Signed-off-by: Woojung Huh <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-11-18net: dsa: mv88e6xxx: Select IRQ_DOMAINFlorian Fainelli1-0/+1
Some architectures may not define IRQ_DOMAIN (like m32r), fixes undefined references to IRQ_DOMAIN functions. Fixes: dc30c35be720 ("net: dsa: mv88e6xxx: Implement interrupt support.") Signed-off-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-11-18net: marvell: Allow drivers to be built with COMPILE_TESTFlorian Fainelli1-4/+7
All Marvell Ethernet drivers actually build fine with COMPILE_TEST with a few warnings. We need to add a few HAS_DMA dependencies to fix linking failures on problematic architectures like m32r. Signed-off-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-11-18net: fsl: Allow most drivers to be built with COMPILE_TESTFlorian Fainelli1-1/+3
There are only a handful of Freescale Ethernet drivers that don't actually build with COMPILE_TEST: * FEC, for which we would need to define a default register layout if no supported architecture is defined * UCC_GETH which depends on PowerPC cpm.h header (which could be moved to a generic location) * GIANFAR needs to depend on HAS_DMA to fix linking failures on some architectures (like m32r) We need to fix an unmet dependency to get there though: warning: (FSL_XGMAC_MDIO) selects OF_MDIO which has unmet direct dependencies (OF && PHYLIB) which would result in CONFIG_OF_MDIO=[ym] without CONFIG_OF to be set. Signed-off-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-11-18net: gianfar_ptp: Rename FS bit to FIPERSTFlorian Fainelli1-2/+2
FS is a global symbol used by the x86 32-bit architecture, fixes builds re-definitions: >> drivers/net/ethernet/freescale/gianfar_ptp.c:75:0: warning: "FS" >> redefined #define FS (1<<28) /* FIPER start indication */ In file included from arch/x86/include/uapi/asm/ptrace.h:5:0, from arch/x86/include/asm/ptrace.h:6, from arch/x86/include/asm/math_emu.h:4, from arch/x86/include/asm/processor.h:11, from include/linux/mutex.h:19, from include/linux/kernfs.h:13, from include/linux/sysfs.h:15, from include/linux/kobject.h:21, from include/linux/device.h:17, from drivers/net/ethernet/freescale/gianfar_ptp.c:23: arch/x86/include/uapi/asm/ptrace-abi.h:15:0: note: this is the location of the previous definition #define FS 9 Reported-by: kbuild test robot <[email protected]> Signed-off-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-11-18net: ethernet: ti: cpsw: fix fixed-link phy probe deferralJohan Hovold1-5/+7
Make sure to propagate errors from of_phy_register_fixed_link() which can fail with -EPROBE_DEFER. Fixes: 1f71e8c96fc6 ("drivers: net: cpsw: Add support for fixed-link PHY") Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-11-18net: ethernet: ti: cpsw: add missing sanity checkJohan Hovold1-0/+3
Make sure to check for allocation failures before dereferencing a NULL-pointer during probe. Fixes: 649a1688c960 ("net: ethernet: ti: cpsw: create common struct to hold shared driver data") Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-11-18net: ethernet: ti: cpsw: fix secondary-emac probe error pathJohan Hovold1-1/+3
Make sure to deregister the primary device in case the secondary emac fails to probe. kernel BUG at /home/johan/work/omicron/src/linux/net/core/dev.c:7743! ... [<c05b3dec>] (free_netdev) from [<c04fe6c0>] (cpsw_probe+0x9cc/0xe50) [<c04fe6c0>] (cpsw_probe) from [<c047b28c>] (platform_drv_probe+0x5c/0xc0) Fixes: d9ba8f9e6298 ("driver: net: ethernet: cpsw: dual emac interface implementation") Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-11-18net: ethernet: ti: cpsw: fix of_node and phydev leaksJohan Hovold1-0/+35
Make sure to drop references taken and deregister devices registered during probe on probe errors (including deferred probe) and driver unbind. Specifically, PHY of-node references were never released and fixed-link PHY devices were never deregistered. Fixes: 9e42f715264f ("drivers: net: cpsw: add phy-handle parsing") Fixes: 1f71e8c96fc6 ("drivers: net: cpsw: Add support for fixed-link PHY") Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-11-18net: ethernet: ti: cpsw: fix deferred probeJohan Hovold1-17/+24
Make sure to deregister all child devices also on probe errors to avoid leaks and to fix probe deferral: cpsw 4a100000.ethernet: omap_device: omap_device_enable() called from invalid state 1 cpsw 4a100000.ethernet: use pm_runtime_put_sync_suspend() in driver? cpsw: probe of 4a100000.ethernet failed with error -22 Add generic helper to undo the effects of cpsw_probe_dt(), which will also be used in a follow-on patch to fix further leaks that have been introduced more recently. Note that the platform device is now runtime-resumed before registering any child devices in order to make sure that it is synchronously suspended after having deregistered the children in the error path. Fixes: 1fb19aa730e4 ("net: cpsw: Add parent<->child relation support between cpsw and mdio") Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-11-18net: ethernet: ti: cpsw: fix mdio device reference leakJohan Hovold1-0/+1
Make sure to drop the reference taken by of_find_device_by_node() when looking up an mdio device from a phy_id property during probe. Fixes: 549985ee9c72 ("cpsw: simplify the setup of the register pointers") Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-11-18net: ethernet: ti: cpsw: fix bad register access in probe error pathJohan Hovold1-4/+7
Make sure to keep the platform device runtime-resumed throughout probe to avoid accessing the CPSW registers in the error path (e.g. for deferred probe) with clocks disabled: Unhandled fault: external abort on non-linefetch (0x1008) at 0xd0872d08 ... [<c04fabcc>] (cpsw_ale_control_set) from [<c04fb8b4>] (cpsw_ale_destroy+0x2c/0x44) [<c04fb8b4>] (cpsw_ale_destroy) from [<c04fea58>] (cpsw_probe+0xbd0/0x10c4) [<c04fea58>] (cpsw_probe) from [<c047b2a0>] (platform_drv_probe+0x5c/0xc0) Fixes: df828598a755 ("netdev: driver: ethernet: Add TI CPSW driver") Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-11-18net: sky2: Fix shutdown crashJeremy Linton1-0/+13
The sky2 frequently crashes during machine shutdown with: sky2_get_stats+0x60/0x3d8 [sky2] dev_get_stats+0x68/0xd8 rtnl_fill_stats+0x54/0x140 rtnl_fill_ifinfo+0x46c/0xc68 rtmsg_ifinfo_build_skb+0x7c/0xf0 rtmsg_ifinfo.part.22+0x3c/0x70 rtmsg_ifinfo+0x50/0x5c netdev_state_change+0x4c/0x58 linkwatch_do_dev+0x50/0x88 __linkwatch_run_queue+0x104/0x1a4 linkwatch_event+0x30/0x3c process_one_work+0x140/0x3e0 worker_thread+0x60/0x44c kthread+0xdc/0xf0 ret_from_fork+0x10/0x50 This is caused by the sky2 being called after it has been shutdown. A previous thread about this can be found here: https://lkml.org/lkml/2016/4/12/410 An alternative fix is to assure that IFF_UP gets cleared by calling dev_close() during shutdown. This is similar to what the bnx2/tg3/xgene and maybe others are doing to assure that the driver isn't being called following _shutdown(). Signed-off-by: Jeremy Linton <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-11-18amd-xgbe: Update connection validation for backplane modeLendacky, Thomas1-0/+2
Update the connection type enumeration for backplane mode and return an error when there is a mismatch between the mode and the connection type. Signed-off-by: Tom Lendacky <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-11-18net: phy: Add downshift get/set support in Microsemi PHYs driverRaju Lakkaraju1-0/+100
Implements the phy tunable function pointers and implement downshift functionality for MSCC PHYs. Signed-off-by: Raju Lakkaraju <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: Allan W. Nielsen <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-11-18net/mlx5e: Expose PCIe statistics to ethtoolGal Pressman3-1/+72
This patch exposes two groups of PCIe counters: - Performance counters. - Timers and states counters. Queried with ethtool -S <devname>. Signed-off-by: Gal Pressman <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-11-18net/mlx5: Set driver version into firmwareHuy Nguyen1-0/+37
If driver_version capability bit is enabled, set driver version to firmware after the init HCA command, for display purposes. Example of driver version: "Linux,mlx5_core,3.0-1" Signed-off-by: Huy Nguyen <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-11-18net/mlx5e: Add port module event counters to ethtool statsHuy Nguyen2-1/+39
Add port module event counters to ethtool -S command Signed-off-by: Huy Nguyen <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-11-18net/mlx5: Add handling for port module eventHuy Nguyen3-0/+70
For each asynchronous port module event: 1. print with ratelimit to the dmesg log 2. increment the corresponding event counter Signed-off-by: Huy Nguyen <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-11-18net/mlx5: Make the command interface cache more flexibleMohamad Haj Yahia1-76/+69
Add more cache command size sets and more entries for each set based on the current commands set different sizes and commands frequency. Fixes: e126ba97dba9 ('mlx5: Add driver for Mellanox Connect-IB adapters') Signed-off-by: Mohamad Haj Yahia <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-11-18sfc: remove Software TSOEdward Cree6-211/+154
It gives no advantage over GSO now that xmit_more exists. If we find ourselves unable to handle a TSO skb (because our TXQ doesn't have a TSOv2 context and the NIC doesn't support TSOv1), hand it back to GSO. Also do that if the TSO handler fails with EINVAL for any other reason. As Falcon-architecture NICs don't support any firmware-assisted TSO, they no longer advertise TSO feature flags at all. Signed-off-by: Edward Cree <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-11-18sfc: handle failure to allocate TSOv2 contextsEdward Cree1-16/+24
If we fail to init the TXQ because of insufficient TSOv2 contexts, try again with TSOv2 disabled. Signed-off-by: Edward Cree <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-11-18sfc: Firmware-Assisted TSO version 2Bert Kenward11-768/+1035
Add support for FATSOv2 to the driver. FATSOv2 offloads far more of the task of TCP segmentation to the firmware, such that we now just pass a single super-packet to the NIC. This means TSO has a great deal in common with a normal DMA transmit, apart from adding a couple of option descriptors. NIC-specific checks have been moved off the fast path and in to initialisation where possible. This also moves FATSOv1/SWTSO to a new file (tx_tso.c). The end of transmit and some error handling is now outside TSO, since it is common with other code. Signed-off-by: Edward Cree <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-11-18sfc: Update EF10 register definitionsEdward Cree1-15/+88
Signed-off-by: Edward Cree <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-11-18sfc: Update MCDI protocol definitionsEdward Cree1-21/+462
Signed-off-by: Edward Cree <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2016-11-18netns: make struct pernet_operations::id unsigned intAlexey Dobriyan7-7/+7
Make struct pernet_operations::id unsigned. There are 2 reasons to do so: 1) This field is really an index into an zero based array and thus is unsigned entity. Using negative value is out-of-bound access by definition. 2) On x86_64 unsigned 32-bit data which are mixed with pointers via array indexing or offsets added or subtracted to pointers are preffered to signed 32-bit data. "int" being used as an array index needs to be sign-extended to 64-bit before being used. void f(long *p, int i) { g(p[i]); } roughly translates to movsx rsi, esi mov rdi, [rsi+...] call g MOVSX is 3 byte instruction which isn't necessary if the variable is unsigned because x86_64 is zero extending by default. Now, there is net_generic() function which, you guessed it right, uses "int" as an array index: static inline void *net_generic(const struct net *net, int id) { ... ptr = ng->ptr[id - 1]; ... } And this function is used a lot, so those sign extensions add up. Patch snipes ~1730 bytes on allyesconfig kernel (without all junk messing with code generation): add/remove: 0/0 grow/shrink: 70/598 up/down: 396/-2126 (-1730) Unfortunately some functions actually grow bigger. This is a semmingly random artefact of code generation with register allocator being used differently. gcc decides that some variable needs to live in new r8+ registers and every access now requires REX prefix. Or it is shifted into r12, so [r12+0] addressing mode has to be used which is longer than [r8] However, overall balance is in negative direction: add/remove: 0/0 grow/shrink: 70/598 up/down: 396/-2126 (-1730) function old new delta nfsd4_lock 3886 3959 +73 tipc_link_build_proto_msg 1096 1140 +44 mac80211_hwsim_new_radio 2776 2808 +32 tipc_mon_rcv 1032 1058 +26 svcauth_gss_legacy_init 1413 1429 +16 tipc_bcbase_select_primary 379 392 +13 nfsd4_exchange_id 1247 1260 +13 nfsd4_setclientid_confirm 782 793 +11 ... put_client_renew_locked 494 480 -14 ip_set_sockfn_get 730 716 -14 geneve_sock_add 829 813 -16 nfsd4_sequence_done 721 703 -18 nlmclnt_lookup_host 708 686 -22 nfsd4_lockt 1085 1063 -22 nfs_get_client 1077 1050 -27 tcf_bpf_init 1106 1076 -30 nfsd4_encode_fattr 5997 5930 -67 Total: Before=154856051, After=154854321, chg -0.00% Signed-off-by: Alexey Dobriyan <[email protected]> Signed-off-by: David S. Miller <[email protected]>