aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/apm/xgene (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-07-30net: Remove dev_err() usage after platform_get_irq()Stephen Boyd1-4/+1
We don't need dev_err() messages when platform_get_irq() fails now that platform_get_irq() prints an error message itself when something goes wrong. Let's remove these prints with a simple semantic patch. // <smpl> @@ expression ret; struct platform_device *E; @@ ret = ( platform_get_irq(E, ...) | platform_get_irq_byname(E, ...) ); if ( \( ret < 0 \| ret <= 0 \) ) { ( -if (ret != -EPROBE_DEFER) -{ ... -dev_err(...); -... } | ... -dev_err(...); ) ... } // </smpl> While we're here, remove braces on if statements that only have one statement (manually). Cc: "David S. Miller" <davem@davemloft.net> Cc: Kalle Valo <kvalo@codeaurora.org> Cc: Saeed Mahameed <saeedm@mellanox.com> Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Cc: Felix Fietkau <nbd@nbd.name> Cc: Lorenzo Bianconi <lorenzo@kernel.org> Cc: netdev@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Stephen Boyd <swboyd@chromium.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-27drivers: net: xgene: Move status variable declaration into CONFIG_ACPI blockNathan Chancellor3-3/+6
When CONFIG_ACPI is unset (arm allyesconfig), status is unused. drivers/net/ethernet/apm/xgene/xgene_enet_xgmac.c:383:14: warning: unused variable 'status' [-Wunused-variable] acpi_status status; ^ drivers/net/ethernet/apm/xgene/xgene_enet_sgmac.c:440:14: warning: unused variable 'status' [-Wunused-variable] acpi_status status; ^ drivers/net/ethernet/apm/xgene/xgene_enet_hw.c:697:14: warning: unused variable 'status' [-Wunused-variable] acpi_status status; ^ Move the declaration into the CONFIG_ACPI block so that there are no compiler warnings. Fixes: 570d785ba46b ("drivers: net: xgene: Remove acpi_has_method() calls") Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-24drivers: net: xgene: Remove acpi_has_method() callsKelsey Skunberg3-14/+13
acpi_evaluate_object will already return an error if the needed method does not exist. Remove unnecessary acpi_has_method() calls and check the returned acpi_status for failure instead. Signed-off-by: Kelsey Skunberg <skunberg.kelsey@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-22net: Use skb accessors in network driversMatthew Wilcox (Oracle)1-1/+2
In preparation for unifying the skb_frag and bio_vec, use the fine accessors which already exist and use skb_frag_t instead of struct skb_frag_struct. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-05-21treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13Thomas Gleixner13-169/+13
Based on 2 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not see http www gnu org licenses this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details [based] [from] [clk] [highbank] [c] you should have received a copy of the gnu general public license along with this program if not see http www gnu org licenses extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 355 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Jilayne Lovejoy <opensource@jilayne.com> Reviewed-by: Steve Winslow <swinslow@gmail.com> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190519154041.837383322@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-21treewide: Add SPDX license identifier - Makefile/KconfigThomas Gleixner2-0/+2
Add SPDX license identifiers to all Make/Kconfig files which: - Have no license information of any form These files fall under the project license, GPL v2 only. The resulting SPDX license identifier is: GPL-2.0-only Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-14drivers: net: xgene: Remove unnecessary forward declarationsNathan Chancellor1-3/+0
Clang warns: drivers/net/ethernet/apm/xgene/xgene_enet_main.c:33:36: warning: tentative array definition assumed to have one element static const struct acpi_device_id xgene_enet_acpi_match[]; ^ 1 warning generated. Both xgene_enet_acpi_match and xgene_enet_of_match are defined before their uses at the bottom of the file so this is unnecessary. When CONFIG_ACPI is disabled, ACPI_PTR becomes NULL so xgene_enet_acpi_match doesn't need to be defined. Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-09-12net: ethernet: Add helper to determine if pause configuration is supportedAndrew Lunn1-3/+1
Rather than have MAC drivers open code the test, add a helper in phylib. This will help when we change the type of phydev->supported. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-09-12net: ethernet: Add helper for set_pauseparam for Asym PauseAndrew Lunn1-22/+4
ethtool can be used to enable/disable pause. Add a helper to configure the PHY when asym pause is supported. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-09-12net: ethernet: Add helper for MACs which support asym pauseAndrew Lunn1-3/+1
Rather than have the MAC drivers manipulate phydev members to indicate they support Asym Pause, add a helper function. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-09-12net: ethernet: Add helper to remove a supported link modeAndrew Lunn1-3/+3
Some MAC hardware cannot support a subset of link modes. e.g. often 1Gbps Full duplex is supported, but Half duplex is not. Add a helper to remove such a link mode. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-23ACPI: Convert ACPI reference args to generic fwnode reference argsSakari Ailus1-3/+3
Convert all users of struct acpi_reference_args to more generic fwnode_reference_args. This will 1) avoid an ACPI specific references to device nodes with integer arguments as well as 2) allow making references to nodes other than device nodes in ACPI. As a by-product, convert the fwnode interger arguments to u64. The arguments were 64-bit integers on ACPI but the fwnode arguments were just 32-bit. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-06-23net: Remove depends on HAS_DMA in case of platform dependencyGeert Uytterhoeven1-1/+0
Remove dependencies on HAS_DMA where a Kconfig symbol depends on another symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST". In most cases this other symbol is an architecture or platform specific symbol, or PCI. Generic symbols and drivers without platform dependencies keep their dependencies on HAS_DMA, to prevent compiling subsystems or drivers that cannot work anyway. This simplifies the dependencies, and allows to improve compile-testing. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Mark Brown <broonie@kernel.org> Acked-by: Robin Murphy <robin.murphy@arm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-05drivers: net: xgene: Remove return statement from void functionIyappan Subramanian1-2/+0
commit 183db4 ("drivers: net: xgene: Correct probe sequence handling") changed the return type of xgene_enet_check_phy_handle() to void. This patch, removes the return statement from the last line. Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-05drivers: net: xgene: Configure tx/rx delay for ACPIQuan Nguyen1-5/+2
This patch fixes configuring tx/rx delay values for ACPI. Signed-off-by: Quan Nguyen <qnguyen@apm.com> Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-05drivers: net: xgene: Read tx/rx delay for ACPIIyappan Subramanian1-2/+2
This patch fixes reading tx/rx delay values for ACPI. Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: Quan Nguyen <qnguyen@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-08-29drivers: net: xgene: Correct probe sequence handlingQuan Nguyen1-14/+13
The phy is connected at early stage of probe but not properly disconnected if error occurs. This patch fixes the issue. Also changing the return type of xgene_enet_check_phy_handle(), since this function always returns success. Signed-off-by: Quan Nguyen <qnguyen@apm.com> Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-08-04xgene: Always get clk source, but ignore if it's missing for SGMII portsThomas Bogendoerfer1-3/+3
Even the driver doesn't do anything with the clk source for SGMII ports it needs to be enabled by doing a devm_clk_get(), if there is a clk source in DT. Fixes: 0db01097cabd ('xgene: Don't fail probe, if there is no clk resource for SGMII interfaces') Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de> Tested-by: Laura Abbott <labbott@redhat.com> Acked-by: Iyappan Subramanian <isubramanian@apm.com> Tested-by: Will Deacon <will.deacon@arm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-07-13xgene: Don't fail probe, if there is no clk resource for SGMII interfacesThomas Bogendoerfer1-10/+12
This change fixes following problem [ 1.827940] xgene-enet: probe of 1f210030.ethernet failed with error -2 which leads to a missing ethernet interface (reproducable at least on Gigabyte MP30-AR0 and APM Mustang systems). The check for a valid clk resource fails, because DT doesn't provide a clock for sgenet1. But the driver doesn't use this clk, if the ethernet port is connected via SGMII. Therefore this patch avoids probing for clk on SGMII interfaces. Fixes: 9aea7779b764 ("drivers: net: xgene: Fix crash on DT systems") Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-13net: phy: Make phy_ethtool_ksettings_get return voidyuval.shaia@oracle.com1-2/+6
Make return value void since function never return meaningfull value Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com> Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-05-19xgene: Check all RGMII phy mode variantsIyappan Subramanian3-15/+18
This patch addresses the review comment from the previous patch set, by using phy_interface_mode_is_rgmii() helper function to address all RGMII phy mode variants. Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: Quan Nguyen <qnguyen@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-05-16drivers: net: xgene: Fix redundant prefetch buffer cleanupIyappan Subramanian4-62/+1
Prefetch buffer cleanup code was called twice, causing EDAC to report errors during reboot. [ 1130.972475] xgene-edac 78800000.edac: IOB bridge agent (BA) transaction error [ 1130.979584] xgene-edac 78800000.edac: IOB BA write response error [ 1130.985648] xgene-edac 78800000.edac: IOB BA write access at 0x00.00000000 () [ 1130.993612] xgene-edac 78800000.edac: IOB BA requestor ID 0x00002400 [ 1131.000242] xgene-edac 78800000.edac: IOB bridge agent (BA) transaction error ... This patch fixes the errors by, - removing the redundant prefetch buffer cleanup from port_ops->shutdown() - moving port_ops->shutdown() after delete_rings() Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-05-16drivers: net: xgene: Workaround for HW errata 10GE_10/ENET_15Quan Nguyen3-9/+46
This patch adds workaround for HW errata 10GE_10 and ENET_15: "HW statistic counters value are duplicated". - RFCS duplicates RALN counter - RFLR duplicates RUND counter - TFCS duplicates TFRG counter - RALN should be intepreted as 0 in 10G mode Signed-off-by: Quan Nguyen <qnguyen@apm.com> Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-05-16drivers: net: xgene: Add frame recovered statistics counter for errata 10GE_8/ENET_11Quan Nguyen3-2/+10
This patch adds statistic counter for frames recovered from HW errata 10GE_8 and ENET_11: "HW reports Length error for valid 64 byte frames with len <46 bytes". Signed-off-by: Quan Nguyen <qnguyen@apm.com> Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-05-16drivers: net: xgene: Workaround for HW errata 10GE_4Quan Nguyen3-0/+9
This patch adds workaround for HW errata 10GE_4: "XGENET_ICM_ECM_DROP_COUNT_REG_0 reg not clear on read". Signed-off-by: Quan Nguyen <qnguyen@apm.com> Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-05-16drivers: net: xgene: Add rx_overrun/tx_underrun statisticsIyappan Subramanian7-3/+62
This patch adds rx_overrun and tx_underrun ethtool statistic counters. Signed-off-by: Quan Nguyen <qnguyen@apm.com> Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-05-16drivers: net: xgene: Extend ethtool statisticsQuan Nguyen6-1/+181
This patch adds extended ethtool statistics support. Signed-off-by: Quan Nguyen <qnguyen@apm.com> Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-05-16drivers: net: xgene: Remove unused macrosQuan Nguyen1-6/+0
This patch cleans up unused macros to improve readability. Signed-off-by: Quan Nguyen <qnguyen@apm.com> Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-05-16drivers: net: xgene: Refactor statistics error parsing codeQuan Nguyen4-18/+18
This patch fixes the tx error counters and adds more rx error counters. Signed-off-by: Quan Nguyen <qnguyen@apm.com> Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-05-16drivers: net: xgene: Remove redundant local statsQuan Nguyen3-7/+5
Commit 5944701df90d ("net: remove useless memset's in drivers get_stats64") makes the pdata->stats redundant. This patch removes pdata->stats and updates get_stats64() callback accordingly. Signed-off-by: Quan Nguyen <qnguyen@apm.com> Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-05-16drivers: net: xgene: Use rgmii mdio mac accessQuan Nguyen1-0/+14
This patch switches to use rgmii mdio mac access routines if available, as they share the same HW. Signed-off-by: Quan Nguyen <qnguyen@apm.com> Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-05-16drivers: net: xgene: Protect indirect MAC accessIyappan Subramanian6-177/+62
This patch, - refactors mac read/write functions - adds lock to protect indirect mac access Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: Quan Nguyen <qnguyen@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-03-15drivers: net: xgene: Add workaround for errata 10GE_8/ENET_11Iyappan Subramanian4-17/+30
This patch implements workaround for errata 10GE_8 and ENET_11: "HW reports length error for valid 64 byte frames with len <46 bytes" by recovering them from error. Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: Quan Nguyen <qnguyen@apm.com> Signed-off-by: Toan Le <toanle@apm.com> Tested-by: Fushen Chen <fchen@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-03-15drivers: net: xgene: Add workaround for errata 10GE_1Quan Nguyen2-0/+12
This patch implements workaround for errata 10GE_1: 10Gb Ethernet port FIFO threshold default values are incorrect. Signed-off-by: Quan Nguyen <qnguyen@apm.com> Signed-off-by: Toan Le <toanle@apm.com> Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Tested-by: Fushen Chen <fchen@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-03-15drivers: net: xgene: Fix Rx checksum validation logicIyappan Subramanian1-10/+17
This patch fixes Rx checksum validation logic and adds NETIF_F_RXCSUM flag. Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-03-15drivers: net: xgene: Fix wrong logical operationQuan Nguyen1-2/+2
This patch fixes the wrong logical OR operation by changing it to bit-wise OR operation. Fixes: 3bb502f83080 ("drivers: net: xgene: fix statistics counters race condition") Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: Quan Nguyen <qnguyen@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-03-15drivers: net: xgene: Fix hardware checksum settingQuan Nguyen2-0/+2
This patch fixes the hardware checksum settings by properly program the classifier. Otherwise, packet may be received with checksum error on X-Gene1 SoC. Signed-off-by: Quan Nguyen <qnguyen@apm.com> Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-03-02drivers: net: xgene: Fix crash on DT systemsAlban Bedel1-0/+6
On DT systems the driver require a clock, but the probe just print a warning and continue, leading to a crash when resetting the device. To fix this crash and properly handle probe deferals only ignore the missing clock if DT isn't used or if the clock doesn't exist. Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de> Acked-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-02-24drivers: net: xgene: Simplify xgene_enet_setup_mss() to kill warningGeert Uytterhoeven1-10/+3
With gcc-4.1.2 and -Os: drivers/net/ethernet/apm/xgene/xgene_enet_main.c: In function ‘xgene_enet_start_xmit’: drivers/net/ethernet/apm/xgene/xgene_enet_main.c:297: warning: ‘mss_index’ may be used uninitialized in this function Using a separate variable to track success may confuse the compiler. Preinitialize mss_index with -EBUSY and check for negative error values instead to kill the warning. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-02-02xgene_enet: remove bogus forward declarationsArnd Bergmann1-26/+24
The device match tables for both the xgene_enet driver and its phy driver have forward declarations that declare an array without a length, leading to a clang warning when they are not followed by an actual defitinition: drivers/net/ethernet/apm/xgene/../../../phy/mdio-xgene.h:135:34: warning: tentative array definition assumed to have one element drivers/net/ethernet/apm/xgene/xgene_enet_main.c:33:36: warning: tentative array definition assumed to have one element The declarations for the mdio driver are even in a header file, so they cause duplicate definitions of the tables for each file that includes them. This removes all four forward declarations and moves the actual definitions up a little, so they are in front of their first user. For the OF match tables, this means having to remove the #ifdef around them, and passing the actual structure into of_match_device(). This has no effect on the generated object code though, as the of_match_device function has an empty stub that does not evaluate its argument, and the symbol gets dropped either way. Fixes: 43b3cf6634a4 ("drivers: net: phy: xgene: Add MDIO driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-01-30drivers: net: generalize napi_complete_done()Eric Dumazet1-1/+1
napi_complete_done() allows to opt-in for gro_flush_timeout, added back in linux-3.19, commit 3b47d30396ba ("net: gro: add a per device gro flush timer") This allows for more efficient GRO aggregation without sacrifying latencies. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-01-08net: remove useless memset's in drivers get_stats64stephen hemminger1-1/+0
In dev_get_stats() the statistic structure storage has already been zeroed. Therefore network drivers do not need to call memset() again. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-01-08net: make ndo_get_stats64 a void functionstephen hemminger1-3/+1
The network device operation for reading statistics is only called in one place, and it ignores the return value. Having a structure return value is potentially confusing because some future driver could incorrectly assume that the return value was used. Fix all drivers with ndo_get_stats64 to have a void function. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-12-08net: xgene: avoid bogus maybe-uninitialized warningArnd Bergmann1-3/+3
In some configurations, gcc cannot trace the state of variables across a spin_unlock() barrier, leading to a warning about correct code: xgene_enet_main.c: In function 'xgene_enet_start_xmit': ../../../phy/mdio-xgene.h:112:14: error: 'mss_index' may be used uninitialized in this function [-Werror=maybe-uninitialized] Here we can trivially move the assignment before that spin_unlock, which reliably avoids the warning. Fixes: e3978673f514 ("drivers: net: xgene: Fix MSS programming") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-12-08net: xgene: move xgene_cle_ptree_ewdn data off stackArnd Bergmann2-389/+381
The array for initializing the cle is set up on the stack with almost entirely constant data and then passed to a function that converts it into HW specific bit patterns. With the latest addition, the size of this array has grown to the point that we get a warning about potential stack overflow in allmodconfig builds: xgene_enet_cle.c: In function ‘xgene_enet_cle_init’: xgene_enet_cle.c:836:1: error: the frame size of 1032 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] Looking a bit deeper at the usage, I noticed that the only modification of the data is in dead code, as we don't even use the cle module for phy_mode other than PHY_INTERFACE_MODE_XGMII. This means we can simply mark the structure constant and access it directly rather than passing the pointer down through another structure, making the code more efficient at the same time as avoiding the warning. Fixes: a809701fed15 ("drivers: net: xgene: fix: RSS for non-TCP/UDP") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-12-08drivers: net: xgene: uninitialized variable in xgene_enet_free_pagepool()Dan Carpenter1-0/+1
We never set "slots" in this function. Fixes: a9380b0f7be8 ("drivers: net: xgene: Add support for Jumbo frame") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-12-03drivers: net: xgene: ethtool: Add get/set_pauseparamIyappan Subramanian1-0/+70
This patch adds get_pauseparam and set_pauseparam functions. Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: Quan Nguyen <qnguyen@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-12-03drivers: net: xgene: Add flow control initializationIyappan Subramanian5-1/+131
This patch adds flow control/pause frame initialization and advertising capabilities. Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: Quan Nguyen <qnguyen@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-12-03drivers: net: xgene: Add flow control configurationIyappan Subramanian6-16/+176
This patch adds functions to configure mac, when flow control and pause frame settings change. Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: Quan Nguyen <qnguyen@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-12-03drivers: net: xgene: fix: RSS for non-TCP/UDPIyappan Subramanian2-2/+89
This patch fixes RSS feature, for non-TCP/UDP packets. Signed-off-by: Khuong Dinh <kdinh@apm.com> Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>