summaryrefslogtreecommitdiffstats
path: root/drivers/net
Commit message (Collapse)AuthorAgeFilesLines
* bnx2: remove redundant initializations of pointers txr and rxrColin Ian King2018-01-231-2/+2
| | | | | | | | | | | | | | | | Pointers txr and rxr are being initialized and a few statements later are being assigned new values without the original values ever being read. The initialized values are therefore redundant and can be removed. Cleans up clang warnings: drivers/net/ethernet/broadcom/bnx2.c:5821:28: warning: Value stored to 'txr' during its initialization is never read drivers/net/ethernet/broadcom/bnx2.c:5822:28: warning: Value stored to 'rxr' during its initialization is never read Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* forcedeth: remove duplicate structure member in rxZhu Yanjun2018-01-231-6/+7
| | | | | | | | | | | | Since both first_rx_ctx and rx_skb are the head of rx ctx, it not necessary to use two structure members to statically indicate the head of rx ctx. So first_rx_ctx is removed. CC: Srinivas Eeda <srinivas.eeda@oracle.com> CC: Joe Jin <joe.jin@oracle.com> CC: Junxiao Bi <junxiao.bi@oracle.com> Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: phy: sfp: Fix kernel doc warningFlorian Fainelli2018-01-231-1/+1
| | | | | | | | We forgot to update the kernel doc header above sfp_register_upstream() Fixes: c19bb00070dd ("sfp: convert to fwnode") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: aquantia: make symbol hw_atl_boards staticWei Yongjun2018-01-231-1/+1
| | | | | | | | | | | | Fixes the following sparse warning: drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c:50:34: warning: symbol 'hw_atl_boards' was not declared. Should it be static? Fixes: 4948293ff963 ("net: aquantia: Introduce new AQC devices and capabilities") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Acked-by: Igor Russkikh <igor.russkikh@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: aquantia: Fix error return code in aq_pci_probe()Wei Yongjun2018-01-231-1/+3
| | | | | | | | | | Fix to return error code -ENOMEM from the aq_ndev_alloc() error handling case instead of 0, as done elsewhere in this function. Fixes: 23ee07ad3c2f ("net: aquantia: Cleanup pci functions module") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Acked-by: Igor Russkikh <igor.russkikh@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: fix error return code in nfp_pci_probe()Wei Yongjun2018-01-231-0/+1
| | | | | | | | | | Fix to return error code -EINVAL instead of 0 when num_vfs above limit_vfs, as done elsewhere in this function. Fixes: 0dc786219186 ("nfp: handle SR-IOV already enabled when driver is probing") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: fix fw dump handling of absolute rtsym sizeCarl Heymann2018-01-231-6/+10
| | | | | | | | | | | | | | | | Fix bug that causes _absolute_ rtsym sizes of > 8 bytes (as per symbol table) to result in incorrect space used during a TLV-based debug dump. Detail: The size calculation stage calculates the correct size (size of the rtsym address field == 8), while the dump uses the size in the table to calculate the TLV size to reserve. Symbols with size <= 8 are handled OK due to aligning sizes to 8, but including any absolute symbol with listed size > 8 leads to an ENOSPC error during the dump. Fixes: da762863edd9 ("nfp: fix absolute rtsym handling in debug dump") Signed-off-by: Carl Heymann <carl.heymann@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tun: avoid calling xdp_rxq_info_unreg() twiceCong Wang2018-01-221-2/+0
| | | | | | | | | | | | | | Similarly to tx ring, xdp_rxq_info is only registered when !tfile->detached, so we need to avoid calling xdp_rxq_info_unreg() twice too. The helper tun_cleanup_tx_ring() already checks for this properly, so it is correct to put xdp_rxq_info_unreg() just inside there. Reported-by: syzbot+1c788d7ce0f0888f1d7f@syzkaller.appspotmail.com Fixes: 8565d26bcb2f ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net") Cc: Jason Wang <jasowang@redhat.com> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: bpf: use extack support to improve debuggingQuentin Monnet2018-01-223-18/+39
| | | | | | | | Use the recently added extack support for eBPF offload in the driver. Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: bpf: plumb extack into functions related to XDP offloadQuentin Monnet2018-01-223-6/+9
| | | | | | | | | | | Pass a pointer to an extack object to nfp_app_xdp_offload() in order to prepare for extack usage in the nfp driver. Next step will be to forward this extack pointer to nfp_net_bpf_offload(), once this function is able to use it for printing error messages. Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* hv_netvsc: Use the num_online_cpus() for channel limitHaiyang Zhang2018-01-221-9/+2
| | | | | | | | | | | Since we no longer localize channel/CPU affiliation within one NUMA node, num_online_cpus() is used as the number of channel cap, instead of the number of processors in a NUMA node. This patch allows a bigger range for tuning the number of channels. Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: hns3: converting spaces into tabs to avoid checkpatch.pl warningSalil Mehta2018-01-221-2/+2
| | | | | | | | | Spaces were mistakenly used instead of tabs in some of the code related to reset functionality, which caused checkpatch.pl errors. These were missed earlier so fixing them now. Signed-off-by: Salil Mehta <salil.mehta@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cxgb3: assign port id to net_device->dev_portArjun Vynipadath2018-01-221-0/+1
| | | | | | | | | T3 devices have different ports on same PCI function, so using dev_port to identify ports. Signed-off-by: Arjun Vynipadath <arjun@chelsio.com> Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: stmmac: Fix reception of Broadcom switches tagsFlorian Fainelli2018-01-226-7/+39
| | | | | | | | | | | | | | | | | | Broadcom tags inserted by Broadcom switches put a 4 byte header after the MAC SA and before the EtherType, which may look like some sort of 0 length LLC/SNAP packet (tcpdump and wireshark do think that way). With ACS enabled in stmmac the packets were truncated to 8 bytes on reception, whereas clearing this bit allowed normal reception to occur. In order to make that possible, we need to pass a net_device argument to the different core_init() functions and we are dependent on the Broadcom tagger padding packets correctly (which it now does). To be as little invasive as possible, this is only done for gmac1000 when the network device is DSA-enabled (netdev_uses_dsa() returns true). Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: hns3: add net status led support for fiber portJian Shen2018-01-223-0/+113
| | | | | | | | | Check the net status per second, include port speed, total rx/tx packets and link status. Updating the led status for fiber port. Signed-off-by: Jian Shen <shenjian15@huawei.com> Signed-off-by: Peng Li <lipeng321@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: hns3: add ethtool -p support for fiber portJian Shen2018-01-224-0/+104
| | | | | | | | | Add led location support for fiber port. The led will keep blinking when locating. Signed-off-by: Jian Shen <shenjian15@huawei.com> Signed-off-by: Peng Li <lipeng321@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: hns3: add manager table initialization for hardwareFuyun Liang2018-01-222-0/+123
| | | | | | | | | | The manager table is empty by default. If it is not initialized, the management pkgs like LLDP will be dropped by hardware. Default entries need to be added to manager table. Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com> Signed-off-by: Peng Li <lipeng321@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: hns3: add support for get_regsFuyun Liang2018-01-224-1/+205
| | | | | | | | This patch adds get_regs support for ethtool cmd. Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com> Signed-off-by: Peng Li <lipeng321@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* macsec: restore uAPI after addition of GCM-AES-256Sabrina Dubroca2018-01-221-7/+5
| | | | | | | | | | | | | | | | | | | | | | Commit ccfdec908922 ("macsec: Add support for GCM-AES-256 cipher suite") changed a few values in the uapi headers for MACsec. Because of existing userspace implementations, we need to preserve the value of MACSEC_DEFAULT_CIPHER_ID. Not doing that resulted in wpa_supplicant segfaults when a secure channel was created using the default cipher. Thus, swap MACSEC_DEFAULT_CIPHER_{ID,ALT} back to their original values. Changing the maximum length of the MACSEC_SA_ATTR_KEY attribute is unnecessary, as the previous value (MACSEC_MAX_KEY_LEN, which was 128B) is large enough to carry 32-bytes keys. This patch reverts MACSEC_MAX_KEY_LEN to 128B and restores the old length check on MACSEC_SA_ATTR_KEY. Fixes: ccfdec908922 ("macsec: Add support for GCM-AES-256 cipher suite") Signed-off-by: Davide Caratti <dcaratti@redhat.com> Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: hns: Fix for variable may be used uninitialized warningsHuazhong Tan2018-01-222-21/+38
| | | | | | | | | | | | When !CONFIG_REGMAP hns throws compiler warnings since dsaf_read_syscon ignores the return result from regmap_read, which allows val to be uninitialized. Fixes: 86897c960b49 ("net: hns: add syscon operation for dsaf") Reported-by: Jason Gunthorpe <jgg@ziepe.ca> Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: fec: add necessary defines to work on ARM64Lucas Stach2018-01-222-5/+8
| | | | | | | | | The i.MX8 is a ARMv8 based SoC, that uses the same FEC IP as the earlier, ARMv7 based, i.MX SoCs. Allow the driver to work on ARM64. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Acked-by: Fugang Duan <fugang.duan@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* virtio_net: Add ethtool statsToshiaki Makita2018-01-221-50/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main purpose of this patch is adding a way of checking per-queue stats. It's useful to debug performance problems on multiqueue environment. $ ethtool -S ens10 NIC statistics: rx_queue_0_packets: 2090408 rx_queue_0_bytes: 3164825094 rx_queue_1_packets: 2082531 rx_queue_1_bytes: 3152932314 tx_queue_0_packets: 2770841 tx_queue_0_bytes: 4194955474 tx_queue_1_packets: 3084697 tx_queue_1_bytes: 4670196372 This change converts existing per-cpu stats structure into per-queue one. This should not impact on performance since each queue counter is not updated concurrently by multiple cpus. Performance numbers: - Guest has 2 vcpus and 2 queues - Guest runs netserver - Host runs 100-flow super_netperf Before After Diff UDP_STREAM 18byte 86.22 87.00 +0.90% UDP_STREAM 1472byte 4055.27 4042.18 -0.32% TCP_STREAM 16956.32 16890.63 -0.39% UDP_RR 178667.11 185862.70 +4.03% TCP_RR 128473.04 124985.81 -2.71% Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: mvpp2: enable ACPI support in the driverMarcin Wojtas2018-01-221-39/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces an alternative way of obtaining resources - via ACPI tables provided by firmware. Enabling coexistence with the DT support, in addition to the OF_*->device_*/fwnode_* API replacement, required following steps to be taken: * Add mvpp2_acpi_match table * Omit clock configuration and obtain tclk from the property - in ACPI world, the firmware is responsible for clock maintenance. * Disable comphy and syscon handling as they are not available for ACPI. * Modify way of obtaining interrupts - use newly introduced fwnode_irq_get() routine * Until proper MDIO bus and PHY handling with ACPI is established in the kernel, use only link interrupts feature in the driver. For the RGMII port it results in depending on GMAC settings done during firmware stage. * When booting with ACPI MVPP2_QDIST_MULTI_MODE is picked by default, as there is no need to keep any kind of the backward compatibility. Moreover, a memory region used by mvmdio driver is usually placed in the middle of the address space of the PP2 network controller. The MDIO base address is obtained without requesting memory region (by devm_ioremap() call) in mvmdio.c, later overlapping resources are requested by the network driver, which is responsible for avoiding a concurrent access. In case the MDIO memory region is declared in the ACPI, it can already appear as 'in-use' in the OS. Because it is overlapped by second region of the network controller, make sure it is released, before requesting it again. The care is taken by mvpp2 driver to avoid concurrent access to this memory region. Signed-off-by: Marcin Wojtas <mw@semihalf.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: mvpp2: use device_*/fwnode_* APIs instead of of_*Marcin Wojtas2018-01-221-21/+24
| | | | | | | | | | | | | OF functions can be used only for the driver using DT. As a preparation for introducing ACPI support in mvpp2 driver, use struct fwnode_handle in order to obtain properties from the hardware description. This patch replaces of_* function with device_*/fwnode_* where possible in the mvpp2. Signed-off-by: Marcin Wojtas <mw@semihalf.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: mvpp2: simplify maintaining enabled ports' listMarcin Wojtas2018-01-221-21/+11
| | | | | | | | | | | | | | | 'port_count' field of the mvpp2 structure holds an overall amount of available ports, based on DT nodes status. In order to be prepared to support other HW description, obtain the value by incrementing it upon each successful port initialization. This allowed for simplifying port indexing in the controller's private array, whose size is now not dynamically allocated, but fixed to MVPP2_MAX_PORTS. This patch simplifies creating and filling list of enabled ports and is a part of the preparation for adding ACPI support in the mvpp2 driver. Signed-off-by: Marcin Wojtas <mw@semihalf.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: caif: remove redundant re-assignment of pointer pfrmColin Ian King2018-01-221-1/+0
| | | | | | | | | | | | The pointer pfrm is initialized and then later re-assigned the same value and hence the second assignment is redundant and can be removed. Cleans up clang warning: drivers/net/caif/caif_hsi.c:222:6: warning: Value stored to 'pfrm' during its initialization is never read Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cxgb4: add geneve offload support for T6Ganesh Goudar2018-01-224-24/+63
| | | | | | | | Add geneve segmentation offload support of T6 cards. Original work by: Santosh Rastapur <santosh@chelsio.com> Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge tag 'mac80211-next-for-davem-2018-01-22' of ↵David S. Miller2018-01-222-19/+143
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next Johannes Berg says: ==================== Less than a handful of changes: * possible memory leak fix in hwsim * speed up hwsim * add hwsim userspace rate control API * code cleanups ==================== A conflict was resolved in mac80211_hwsim.c, mostly of the simple overlapping changes category. One adding a rhashtable and another adding a workqueue. Signed-off-by: David S. Miller <davem@davemloft.net>
| * mac80211_hwsim: fix possible memory leak in hwsim_new_radio_nl()weiyongjun (A)2018-01-221-1/+3
| | | | | | | | | | | | | | | | | | | | | | 'hwname' is malloced in hwsim_new_radio_nl() and should be freed before leaving from the error handling cases, otherwise it will cause memory leak. Fixes: ff4dd73dd2b4 ("mac80211_hwsim: check HWSIM_ATTR_RADIO_NAME length") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Reviewed-by: Ben Hutchings <ben.hutchings@codethink.co.uk> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
| * mac80211_hwsim: add hwsim_tx_rate_flags to netlink attributesBenjamin Beichler2018-01-152-2/+107
| | | | | | | | | | | | | | | | | | | | | | For correct interpretation of a tx rate, the corresponding rate flags are needed (e.g. whether a HT-MCS rate or a legacy rate) and moreover for more correct simulation the other infos of the flags are important (like short-GI). Keeping compatibility, the flags are not integrated into the existing hwsim_tx_rate, but transmitted as an additional netlink attribute. Signed-off-by: Benjamin Beichler <benjamin.beichler@uni-rostock.de> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
| * mac80211_hwsim: add hashtable with mac address keys for faster lookupBenjamin Beichler2018-01-151-16/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a rhastable for mac address lookup of hwsim radios. This especially improve the speed on reception of a netlink message with a new frame. Although redundant, we keep holding a normal list for all radios, since the rhashtable_walk interface adds a lot of overhead for iterating over all radios and the doc of rhashtable recommend a redundant structure for stable walks in such situations. Since rhashtable is rcu protected we do not need a lock for delivering frames and thus improving this scenario. Signed-off-by: Benjamin Beichler <benjamin.beichler@uni-rostock.de> [remove hash function, it would cause alignment issues] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | mlxsw: spectrum_router: Remove unnecessary prefix lengths from LPM treeIdo Schimmel2018-01-221-101/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit fc922bb0dd94 ("mlxsw: spectrum_router: Use one LPM tree for all virtual routers") I tried to make sure only used prefix lengths are present in the LPM tree shared between all virtual routers. However, this optimization had to be removed in commit a69518cf0b4c ("mlxsw: spectrum_router: Avoid expensive lookup during route removal"), since determining the used prefix lengths required us to traverse all the active virtual routers, which could result in a hung task depending on the number of VRFs and whether routes were removed due to abort or not. Re-introduce the optimization by moving the prefix usage accounting from the virtual routers to the LPM tree, as this accounting is only used in order to determine the tree's structure. To make the sharing of the trees more explicit, the two trees (for IPv4 and IPv6) are stored in the shared router struct and upon the creation of a virtual router it is immediately bound to both. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | mlxsw: spectrum_router: Pass FIB node to LPM tree unlink functionIdo Schimmel2018-01-221-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Next patch will try to optimize the LPM tree and make sure only used prefix lengths are present, to avoid unnecessary look-ups. Pass the currently removed FIB node to the unlinking function as its associated prefix length is a potential candidate for removal from the tree. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | mlxsw: spectrum_router: Use the nodes list as indication for empty FIBIdo Schimmel2018-01-221-9/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, each FIB (IPv4 / IPv6) in a virtual router holds a prefix usage that is used to choose a matching LPM tree, but also to check if the FIB is empty, so that the LPM tree could be unbound. Next patches will remove the reliance on the per-FIB prefix usage for LPM tree matching. Keeping it only to check if the FIB is empty is a waste, since we can use the nodes ({Prefix, Length}) list instead. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | tun: add missing rcu annotationJason Wang2018-01-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | This patch fixes the following sparse warnings: drivers/net/tun.c:2241:15: error: incompatible types in comparison expression (different address spaces) Fixes: cd5681d7d890 ("tuntap: rename struct tun_steering_prog to struct tun_prog") Cc: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | mlxsw: spectrum_acl: Add support for mirror actionArkadi Sharshevsky2018-01-215-3/+126
| | | | | | | | | | | | | | | | Add support for mirror action. Only one mirror action can be set per rule. Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | mlxsw: spectrum: Extend mlxsw_afa_ops for counter index and implement for ↵Arkadi Sharshevsky2018-01-212-0/+52
| | | | | | | | | | | | | | | | | | | | | | Spectrum Introduce extension of mlxsw_afa_ops in order to add/del mirroring and implement the ops for Spectrum. Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | mlxsw: spectrum: Extend and export SPAN APIArkadi Sharshevsky2018-01-212-32/+57
| | | | | | | | | | | | | | | | | | | | Extend SPAN API for ACL case. In case of ACL triggering the MPAR register shouldn't be configured. This patch also export those helpers for ACL usage. Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | mlxsw: spectrum_acl: Add support for mirroring actionArkadi Sharshevsky2018-01-212-0/+35
| | | | | | | | | | | | | | | | The patch extends the trap action for mirroring. Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | mlxsw: core: Make counter index allocated inside the action appendJiri Pirko2018-01-215-35/+82
| | | | | | | | | | | | | | | | | | | | | | So far, the caller of mlxsw_afa_block_append_counter needed to allocate counter index by hand. Benefit from the previously introduced resource infra and counter_index_get/put callbacks, and allocate the counter index in place where it is needed, inside the action append function. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | mlxsw: core: Convert fwd_entry_ref list to be generic per-block resource listJiri Pirko2018-01-211-26/+49
| | | | | | | | | | | | | | | | | | | | | | Since the resource list needs to be used also for other entries different to fwd_entry_ref, make the list generic. For that purpose, introduce a resource structure with couple of helpers that the code which need to store a per-block resource should use. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | mlxsw: spectrum: Extend mlxsw_afa_ops for counter index and implement for ↵Jiri Pirko2018-01-212-0/+20
| | | | | | | | | | | | | | | | | | | | | | Spectrum Introduce extension of mlxsw_afa_ops in order to get/put counter indexes and implement the ops for Spectrum. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: aquantia: bump driver version to match aquantia internal numberingIgor Russkikh2018-01-211-3/+3
| | | | | | | | | | Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: aquantia: Report correct mediatype via ethtoolIgor Russkikh2018-01-211-3/+13
| | | | | | | | | | | | | | | | For devices with known capabilities of Fibre media type we now report that to ethtool. Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: aquantia: Introduce global AQC hardware reset sequenceIgor Russkikh2018-01-213-29/+183
| | | | | | | | | | | | | | | | | | The detailed reset sequence ensures all HW components are in aligned state before NIC startup. It also supports cards with signed firmware (RBL) and checks if their FW is valid. Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: aquantia: Introduce support for new firmware on AQC cardsIgor Russkikh2018-01-215-4/+257
| | | | | | | | | | | | | | | | This defines fw2x operations table and corresponding methods. Some of the functions are being shared with 1.x firmware Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: aquantia: Introduce firmware ops callbacksIgor Russkikh2018-01-218-81/+101
| | | | | | | | | | | | | | | | | | New AQC cards will have an updated firmware with new binary interface. This patch extracts firmware specific operations into a separate table and prepares for the introduction of new fw 2.x and 3.x Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: aquantia: Change confusing no_ff_addr to more meaningful nameIgor Russkikh2018-01-214-4/+9
| | | | | | | | | | | | | | | | | | The address to check if HW is not dead/hang could be stored in capabilities, since it is a constant. Change its name to better reflect the idea. Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: aquantia: Remove create/destroy from hw opsIgor Russkikh2018-01-213-54/+0
| | | | | | | | | | | | | | | | These ops are not related to HW and are now implemented in pci module. Thus, remove these ops pointers and implementation. Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: aquantia: Cleanup pci functions moduleIgor Russkikh2018-01-217-385/+156
| | | | | | | | | | | | | | | | | | | | | | | | Driver contained a dead code of maintaining multiple pci port instances. That will never be used since for each pci function a separate NIC instance is created. Simplify this, making pci module only responsible for pci resource management. NIC initialization is also simplified accordingly. Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>