summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/stmicro
Commit message (Collapse)AuthorAgeFilesLines
...
* | net: stmmac: Prevent divide-by-zeroJose Abreu2019-09-111-1/+3
| | | | | | | | | | | | | | | | When RX Coalesce settings are set to all zero (which is a valid setting) we will currently get a divide-by-zero error. Fix it. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: Limit max speeds of XGMAC if asked toJose Abreu2019-09-071-9/+16
| | | | | | | | | | | | | | | | We may have some SoCs that can't achieve XGMAC max speed. Limit it if asked to. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: selftests: Add Split Header testJose Abreu2019-09-071-0/+42
| | | | | | | | | | | | | | | | | | Add a test to validate that Split Header feature is working correctly. It works by using the rececently introduced counter that increments each time a packet with split header is received. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: dwmac4: Enable RX Jumbo frame supportJose Abreu2019-09-072-7/+2
| | | | | | | | | | | | | | | | We are already doing it by default in the TX path so we can also enable Jumbo Frame support in the RX path independently of MTU value. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: selftests: Set RX tail pointer in Flow Control testJose Abreu2019-09-071-0/+6
| | | | | | | | | | | | | | | | We need to set the RX tail pointer so that RX engine starts working again after finishing the Flow Control test. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: selftests: Add missing checks for support of SAJose Abreu2019-09-071-0/+12
| | | | | | | | | | | | | | | | Add checks for support of Source Address Insertion/Replacement before running the test. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | stmmac: platform: adjust messages and move to dev levelAndy Shevchenko2019-09-061-9/+13
| | | | | | | | | | | | | | | | | | | | This patch amends the error and warning messages across the platform driver. It includes the following changes: - append \n to the end of messages - change pr_* macros to dev_* Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: selftests: Add Jumbo Frame testsJose Abreu2019-09-051-3/+62
| | | | | | | | | | | | | | | | Add a test to validate the Jumbo Frame support in stmmac in single channel and multichannel mode. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: xgmac: Enable RX Jumbo frame supportJose Abreu2019-09-052-12/+2
| | | | | | | | | | | | | | | | We are already doing it by default in the TX path so we can also enable Jumbo Frame support in the RX path independently of MTU value. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: Correctly assing MAX MTU in XGMAC cores caseJose Abreu2019-09-051-3/+3
| | | | | | | | | | | | | | | | Maximum MTU for XGMAC cores is 16k thus the check for presence of XGMAC shall be done first in order to assign correct value. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: xgmac: Correct RAVSEL field interpretationJose Abreu2019-09-051-1/+1
| | | | | | | | | | | | | | | | | | RAVSEL means that only RX side is available for AVB features. As we use both TX and RX features we need to check if RAVSEL is selected and disable AVB if only RX side is available. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: ethtool: Let user configure TX coalesce without RIWTJose Abreu2019-09-051-12/+9
| | | | | | | | | | | | | | | | When RX Watchdog is disabled its currently not possible to configure TX coalesce settings. Let user configure it anyway. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: Only consider RX error when HW Timestamping is not enabledJose Abreu2019-09-051-1/+2
| | | | | | | | | | | | | | | | | | Only consider that we have an error when HW Timestamping is not enabled as this can give false positives due to the fact the RX Timestamping in XGMAC and GMAC cores comes from context descriptors. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: selftests: Implement the ARP Offload testJose Abreu2019-09-051-0/+110
| | | | | | | | | | | | | | Implement a test for ARP Offload feature. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: xgmac: Implement ARP OffloadJose Abreu2019-09-054-0/+22
| | | | | | | | | | | | | | Implement the ARP Offload feature in XGMAC cores. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: selftests: Add selftest for L3/L4 FiltersJose Abreu2019-09-051-1/+285
| | | | | | | | | | | | | | | | | | | | Adds the selftests for L3 and L4 filters with DA/SA/DP/SP support. Changes from v1: - Reduce stack usage (kbuild test robot) Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: Implement L3/L4 Filters using TC FlowerJose Abreu2019-09-058-2/+488
| | | | | | | | | | | | | | | | Implement filters for Layer 3 and Layer 4 using TC Flower API. Add the corresponding callbacks in XGMAC core. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: Do not return error code in TC InitializationJose Abreu2019-09-051-1/+2
| | | | | | | | | | | | | | | | As we can still use the remaining TC callbacks, e.g. CBS. We should not fail in the initialization only because RX Parser is not available. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: xgmac: Add RBU handling in DMA interruptJose Abreu2019-09-051-0/+4
| | | | | | | | | | | | | | | | Add the handling of Receive Buffer Unavailable interrupt in the DMA handler of XGMAC cores. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: selftests: Return proper error code to userspaceJose Abreu2019-09-051-11/+11
| | | | | | | | | | | | | | | | We can do better than just return 1 to userspace. Lets return a proper Linux error code. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/netDavid S. Miller2019-09-021-4/+2
|\| | | | | | | | | | | | | r8152 conflicts are the NAPI fixes in 'net' overlapping with some tasklet stuff in net-next Signed-off-by: David S. Miller <davem@davemloft.net>
| * net: stmmac: dwmac-rk: Don't fail if phy regulator is absentChen-Yu Tsai2019-08-301-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The devicetree binding lists the phy phy as optional. As such, the driver should not bail out if it can't find a regulator. Instead it should just skip the remaining regulator related code and continue on normally. Skip the remainder of phy_power_on() if a regulator supply isn't available. This also gets rid of the bogus return code. Fixes: 2e12f536635f ("net: stmmac: dwmac-rk: Use standard devicetree property for phy regulator") Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: depend on COMMON_CLKStephen Rothwell2019-08-301-0/+1
| | | | | | | | | | | | Fixes: 190f73ab4c43 ("net: stmmac: setup higher frequency clk support for EHL & TGL") Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: setup higher frequency clk support for EHL & TGLVoon Weifeng2019-08-272-0/+24
| | | | | | | | | | | | | | | | | | EHL DW EQOS is running on a 200MHz clock. Setting up stmmac-clk, ptp clock and ptp_max_adj to 200MHz. Signed-off-by: Voon Weifeng <weifeng.voon@intel.com> Signed-off-by: Ong Boon Leong <boon.leong.ong@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: add EHL RGMII 1Gbps PCI info and PCI IDVoon Weifeng2019-08-271-0/+15
| | | | | | | | | | | | | | | | | | Added EHL RGMII 1Gbps PCI ID. Different MII and speed will have different PCI ID. Signed-off-by: Voon Weifeng <weifeng.voon@intel.com> Signed-off-by: Ong Boon Leong <boon.leong.ong@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: add TGL SGMII 1Gbps PCI info and PCI IDVoon Weifeng2019-08-271-0/+29
| | | | | | | | | | | | | | | | | | Added TGL SGMII 1Gbps PCI ID. Different MII and speed will have different PCI ID. Signed-off-by: Voon Weifeng <weifeng.voon@intel.com> Signed-off-by: Ong Boon Leong <boon.leong.ong@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: add EHL SGMII 1Gbps PCI info and PCI IDVoon Weifeng2019-08-271-0/+107
| | | | | | | | | | | | | | | | | | Added EHL SGMII 1Gbps PCI ID. Different MII and speed will have different PCI ID. Signed-off-by: Voon Weifeng <weifeng.voon@intel.com> Signed-off-by: Ong Boon Leong <boon.leong.ong@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | ethernet: Delete unnecessary checks before the macro call “dev_kfree_skb”Markus Elfring2019-08-221-2/+1
| | | | | | | | | | | | | | | | | | | | The dev_kfree_skb() function performs also input parameter validation. Thus the test around the shown calls is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: dwc-qos: use devm_platform_ioremap_resource() to simplify codeYueHaibing2019-08-211-3/+1
| | | | | | | | | | | | | | | | | | Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: dwmac-anarion: use devm_platform_ioremap_resource() to simplify ↵YueHaibing2019-08-211-3/+1
| | | | | | | | | | | | | | | | | | | | | | code Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: dwmac-meson: use devm_platform_ioremap_resource() to simplify codeYueHaibing2019-08-211-3/+1
| | | | | | | | | | | | | | | | | | | | Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: YueHaibing <yuehaibing@huawei.com> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: dwmac-meson8b: use devm_platform_ioremap_resource() to simplify ↵YueHaibing2019-08-211-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | code Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: YueHaibing <yuehaibing@huawei.com> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/netDavid S. Miller2019-08-191-1/+1
|\| | | | | | | | | | | | | Merge conflict of mlx5 resolved using instructions in merge commit 9566e650bf7fdf58384bb06df634f7531ca3a97e. Signed-off-by: David S. Miller <davem@davemloft.net>
| * net: sched: use major priority number as hardware priorityPablo Neira Ayuso2019-08-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | tc transparently maps the software priority number to hardware. Update it to pass the major priority which is what most drivers expect. Update drivers too so they do not need to lshift the priority field of the flow_cls_common_offload object. The stmmac driver is an exception, since this code assumes the tc software priority is fine, therefore, lshift it just to be conservative. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: selftests: Add selftest for VLAN TX OffloadJose Abreu2019-08-171-2/+94
| | | | | | | | | | | | | | | | Add 2 new selftests for VLAN Insertion offloading. Tests are for inner and outer VLAN offloading. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: Add support for VLAN Insertion OffloadJose Abreu2019-08-177-1/+135
| | | | | | | | | | | | | | | | | | Adds the logic to insert a given VLAN ID in a packet. This is offloaded to HW and its descriptor based. For now, only XGMAC implements the necessary callbacks. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: xgmac: Add EEE supportJose Abreu2019-08-173-5/+83
| | | | | | | | | | | | | | | | Add support for EEE in XGMAC cores by implementing the necessary callbacks. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: selftests: Add tests for SA Insertion/ReplacementJose Abreu2019-08-171-1/+97
| | | | | | | | | | | | | | | | | | | | | | Add 4 new tests: - SA Insertion (register based) - SA Insertion (descriptor based) - SA Replacament (register based) - SA Replacement (descriptor based) Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: Add support for SA Insertion/Replacement in XGMAC coresJose Abreu2019-08-176-1/+36
| | | | | | | | | | | | | | | | Add the support for Source Address Insertion and Replacement in XGMAC cores. Two methods are supported: Descriptor based and register based. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: Add ethtool register dump for XGMAC coresJose Abreu2019-08-174-9/+37
| | | | | | | | | | | | | | | | | | | | Add the ethtool interface to dump the register map in XGMAC cores. Changes from v2: - Remove uneeded memset (Jakub) Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: dwxgmac: Add Flexible PPS supportJose Abreu2019-08-172-0/+75
| | | | | | | | | | | | | | Add the support for Flexible PPS in XGMAC cores. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: Add a counter for Split Header packetsJose Abreu2019-08-173-0/+3
| | | | | | | | | | | | | | | | Add a counter that increments each time a packet with split header is received. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: Add Split Header support and enable it in XGMAC coresJose Abreu2019-08-177-2/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the support for Split Header feature in the RX path and enable it in XGMAC cores. This does not impact neither beneficts bandwidth but it does reduces CPU usage because without the feature all the entire packet is memcpy'ed, while that with the feature only the header is. With Split Header disabled 'perf stat -d' gives: 86870.624945 task-clock (msec) # 0.429 CPUs utilized 1073352 context-switches # 0.012 M/sec 1 cpu-migrations # 0.000 K/sec 213 page-faults # 0.002 K/sec 327113872376 cycles # 3.766 GHz (62.53%) 56618161216 instructions # 0.17 insn per cycle (75.06%) 10742205071 branches # 123.658 M/sec (75.36%) 584309242 branch-misses # 5.44% of all branches (75.19%) 17594787965 L1-dcache-loads # 202.540 M/sec (74.88%) 4003773131 L1-dcache-load-misses # 22.76% of all L1-dcache hits (74.89%) 1313301468 LLC-loads # 15.118 M/sec (49.75%) 355906510 LLC-load-misses # 27.10% of all LL-cache hits (49.92%) With Split Header enabled 'perf stat -d' gives: 49324.456539 task-clock (msec) # 0.245 CPUs utilized 2542387 context-switches # 0.052 M/sec 1 cpu-migrations # 0.000 K/sec 213 page-faults # 0.004 K/sec 177092791469 cycles # 3.590 GHz (62.30%) 68555756017 instructions # 0.39 insn per cycle (75.16%) 12697019382 branches # 257.418 M/sec (74.81%) 442081897 branch-misses # 3.48% of all branches (74.79%) 20337958358 L1-dcache-loads # 412.330 M/sec (75.46%) 3820210140 L1-dcache-load-misses # 18.78% of all L1-dcache hits (75.35%) 1257719198 LLC-loads # 25.499 M/sec (49.73%) 685543923 LLC-load-misses # 54.51% of all LL-cache hits (49.86%) Changes from v2: - Reword commit message (Jakub) Changes from v1: - Add performance info (David) - Add misssing dma_sync_single_for_device() Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: xgmac: Correctly return that RX descriptor is not last oneJose Abreu2019-08-171-4/+3
| | | | | | | | | | | | | | Return the correct value when RX descriptor is not the last one. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: Prepare to add Split Header supportJose Abreu2019-08-172-60/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to add Split Header support, stmmac_rx() needs to take into account that packet may be split accross multiple descriptors. Refactor the logic of this function in order to support this scenario. Changes from v2: - Fixup if condition detection (Jakub) - Don't stop NAPI with unfinished packet (Jakub) - Use napi_alloc_skb() (Jakub) Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: Get correct timestamp values from XGMACJose Abreu2019-08-174-9/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TX Timestamp in XGMAC comes from MAC instead of descriptors. Implement this in a new callback. Also, RX Timestamp in XGMAC must be cheked against corruption and we need a barrier to make sure that descriptor fields are read correctly. Changes from v2: - Rework return code check (Jakub) Changes from v1: - Rework the get timestamp function (David) Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | stmmac: no need to check return value of debugfs_create functionsGreg Kroah-Hartman2019-08-102-46/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Because we don't care about the individual files, we can remove the stored dentry for the files, as they are not needed to be kept track of at all. Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com> Cc: Alexandre Torgue <alexandre.torgue@st.com> Cc: Jose Abreu <joabreu@synopsys.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com> Cc: netdev@vger.kernel.org Cc: linux-stm32@st-md-mailman.stormreply.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: selftests: Add a selftest for Flexible RX ParserJose Abreu2019-08-081-1/+97
| | | | | | | | | | | | | | Add a selftest for the Flexible RX Parser feature. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: Add Flexible RX Parser support in XGMACJose Abreu2019-08-083-0/+206
| | | | | | | | | | | | | | | | XGMAC cores also support the Flexible RX Parser feature. Add the support for it in the XGMAC core. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: stmmac: Implement Safety Features in XGMAC coreJose Abreu2019-08-083-0/+311
| | | | | | | | | | | | | | | | XGMAC also supports Safety Features. This patch implements the configuration and handling of this feature in XGMAC core. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
OpenPOWER on IntegriCloud