aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-11-14i40e: always set ks->base.speed in i40e_get_settings_link_upJacob Keller1-0/+1
In i40e_get_settings_link_up, set ks->base.speed to SPEED_UNKNOWN in the case where we don't know the link speed. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2018-11-14i40e: don't restart nway if autoneg not supportedMitch Williams1-5/+5
On link types that do not support autoneg, we cannot attempt to restart nway negotiation. This results in a dead link that requires a power cycle to remedy. Fix this by saving off the autoneg state and checking this value before we try to restart nway. Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2018-11-14i40e: Allow disabling FW LLDP on X722 devicesPatryk Małek4-15/+17
This patch allows disabling FW LLDP agent on X722 devices. It also changes a source of information for this feature from pf->hw_features to pf->hw.flags which are set in i40e_init_adminq. Signed-off-by: Patryk Małek <patryk.malek@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2018-11-14i40e: update driver versionAlice Michael1-2/+2
The version numbers have not been kept up to date and this is an effort to ammend that. Signed-off-by: Alice Michael <alice.michael@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2018-11-14i40e: Protect access to VF control methodsJan Sokolowski2-5/+60
A scenario has been found in which simultaneous addition/removal and modification of VF's might cause unstable behaviour, up to and including kernel panics. Protect the methods that create/modify/destroy VF's by locking them behind an atomically set bit in PF status bitfield. Signed-off-by: Jan Sokolowski <jan.sokolowski@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2018-11-14i40e: Replace strncpy with strlcpy to ensure null terminationPatryk Małek2-8/+8
Using strncpy allows destination buffer to be not null terminated after the copying takes place. strlcpy ensures that's not the case by explicitly setting last element in the buffer as '\0'. Signed-off-by: Patryk Małek <patryk.malek@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2018-11-14i40e: Add capability flag for stopping FW LLDPKrzysztof Galazka3-1/+10
Add HW capability flag to indicate that firmware supports stopping LLDP agent. This feature has been added in FW API 1.7 for XL710 devices and 1.6 for X722. Also raise expected minor version number for X722 FW API to 6. Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2018-11-14i40e: Use a local variable for readabilityJan Sokolowski1-2/+2
Use a local variable to make the code a bit more readable. Signed-off-by: Jan Sokolowski <jan.sokolowski@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2018-11-14i40e: Replace spin_is_locked() with lockdepLance Roy1-2/+1
lockdep_assert_held() is better suited to checking locking requirements, since it won't get confused when someone else holds the lock. This is also a step towards possibly removing spin_is_locked(). Signed-off-by: Lance Roy <ldr709@gmail.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2018-11-14net: aquantia: add support of rx-vlan-filter offloadDmitry Bogdanov7-18/+197
Since it uses the same NIC table as rx flow vlan filter therefore rx-flow vlan filter accepts only vlans that present on the interface in case of rx-vlan-filter is on. Signed-off-by: Dmitry Bogdanov <dmitry.bogdanov@aquantia.com> Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-14net: aquantia: add ethertype and PCP to rx flow filtersDmitry Bogdanov5-4/+133
L2 EtherType filters allows to filter packet by EtherType field or both EtherType and User Priority (PCP) field of 802.1Q. UserPriority (vlan) parameter must be accompanied by mask 0x1FFF. That is to distinguish VLAN filter from L2 Ethertype filter with UserPriority since both User Priority and VLAN ID are passed in the same 'vlan' parameter. Example: To add a filter that directs IP4 packess of priority 3 to queue 3: ethtool -N <ethX> flow-type ether proto 0x800 vlan 0x600 m 0x1FFF \ action 3 loc 16 Signed-off-by: Dmitry Bogdanov <dmitry.bogdanov@aquantia.com> Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-14net: aquantia: add vlan id to rx flow filtersDmitry Bogdanov7-3/+151
The VLAN filter (VLAN id) is compared against 16 filters. VLAN id must be accompanied by mask 0xF000. That is to distinguish VLAN filter from L2 Ethertype filter with UserPriority since both User Priority and VLAN ID are passed in the same 'vlan' parameter. Flow type may be any as it is not matched for VLAN filter. Due to fixed order of the rules in the NIC, the location 0-15 are reserved for vlan filters. Example: To add a rule that directs packets from VLAN 2001 to queue 5: ethtool -N <ethX> flow-type ip4 vlan 2001 m 0xF000 action 5 loc 0 Signed-off-by: Dmitry Bogdanov <dmitry.bogdanov@aquantia.com> Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-14net: aquantia: add support of L3/L4 ntuple filtersDmitry Bogdanov5-3/+284
Add support of L3/L4 5-tuple {protocol, src-ip, dst-ip, src-port, dst-port} filters. Mask is not supported. Src-port and dst-port are only compared for TCP/UDP/SCTP packets. Both IPv4 and IPv6 are supported. The supported actions are the drop and the queue assignment. Due to fixed order of the rules in the NIC, the location 32-39 are reserved for L3/L4 5-tuple filters. The locations 32 and 36 are reserved for IPv6 filters. Examples: sudo ethtool -N eth0 flow-type ip6 src-ip 2001:db8:0:f101::2 \ dst-ip 2001:db8:0:f101::5 action -1 loc 36 sudo ethtool -N eth0 flow-type udp4 src-ip 10.0.0.4 \ dst-ip 10.0.0.7 src-port 2000 dst-port 2001 action 2 loc 32 Signed-off-by: Dmitry Bogdanov <dmitry.bogdanov@aquantia.com> Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-14net: aquantia: add infrastructure for ntuple rulesDmitry Bogdanov8-1/+501
Add infrastructure to support ntuple filter configuration. Add rule, remove rule, reapply on interface up. Signed-off-by: Dmitry Bogdanov <dmitry.bogdanov@aquantia.com> Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-14net: aquantia: add rx-flow filter definitionsDmitry Bogdanov3-17/+275
Add missing register definitions and the functions accessing them related to rx-flow filters. Signed-off-by: Dmitry Bogdanov <dmitry.bogdanov@aquantia.com> Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-13net: ethernet: ti: cpsw: allow vlan tagged packets to be timestampedIvan Khoronzhuk1-2/+3
Allow vlan tagged packets to be timestamped, as no any restrictions for this. Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-13net: ethernet: ti: cpts: move enable/disable flags outside of cpts moduleIvan Khoronzhuk4-77/+41
Each slave has it's own receive timestamp filter. But cpts rx/tx timestamp enable flags are used to allow ts retrieve only for one user. This limitation causes data path redundancy and setting overlap if cpsw module is in dual-mac mode for instance. If rx ts is enabled only for one port - the second interface must expect every incoming packet to be PTP packet w/o absolutely any reason, and if it's PTP - do unneeded stuff, as rx filter for second port is not set and cpts fifo is not supposed to contain appropriate ts event. That's not correct. So, to fix control overlap and avoid redundant CPU cycles, the patch splits rx/tx ts enable flags between network devices. After the patch, PTP timestamping still should be used for only one port (or PTP id counter has to be different for both ports as cpts IP is common). Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-13net: ethernet: ti: cpts: purge staled skbs from txqIvan Khoronzhuk1-2/+24
The overflow event is running with 1 jiffy in case if txq is not empty, but it can be emptied completely only if next tx event consumes skb or deletes staled skb from the txq. In case of staled skb, that can happen for some unpredictable reason (the ts event was lost or timed out), the overflow event can be generated quite long time consuming CPU w/o reason before next tx event happens. To avoid it, purge txq before increasing overflow event rate. Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-13net: ethernet: ti: cpts: correct debug for expired txq skbIvan Khoronzhuk1-3/+1
The msgtype and seqid that is smth that belongs to event for comparison but not for staled txq skb. Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-11Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller43-162/+365
2018-11-11PCI: add USR vendor id and use it in r8169 and w6692 driverHeiner Kallweit1-1/+1
The PCI vendor id of U.S. Robotics isn't defined in pci_ids.h so far, only ISDN driver w6692 has a private definition. Move the definition to pci_ids.h and use it in the r8169 driver too. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-11net: ethernet: Convert phydev advertize and supported from u32 to link modeAndrew Lunn23-113/+160
There are a few MAC/PHYs combinations which now support > 1Gbps. These may need to make use of link modes with bits > 31. Thus their supported PHY features or advertised features cannot be implemented using the current bitmap in a u32. Convert to using a linkmode bitmap, which can support all the currently devices link modes, and is future proof as more modes are added. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-11nfp: flower: remove unnecessary code in flow lookupJohn Hurley3-14/+6
Recent changes to NFP mean that stats updates from fw to driver no longer require a flow lookup and (because egdev offload has been removed) the ingress netdev for a lookup is now always known. Remove obsolete code in a flow lookup that matches on host context and that allows for a netdev to be NULL. Signed-off-by: John Hurley <john.hurley@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-11nfp: flower: remove TC egdev offloadsJohn Hurley4-78/+17
Previously, only tunnel decap rules required egdev registration for offload in NFP. These are now supported via indirect TC block callbacks. Remove the egdev code from NFP. Signed-off-by: John Hurley <john.hurley@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-11nfp: flower: offload tunnel decap rules via indirect TC blocksJohn Hurley3-4/+144
Previously, TC block tunnel decap rules were only offloaded when a callback was triggered through registration of the rules egress device. This meant that the driver had no access to the ingress netdev and so could not verify it was the same tunnel type that the rule implied. Register tunnel devices for indirect TC block offloads in NFP, giving access to new rules based on the ingress device rather than egress. Use this to verify the netdev type of VXLAN and Geneve based rules and offload the rules to HW if applicable. Tunnel registration is done via a netdev notifier. On notifier registration, this is triggered for already existing netdevs. This means that NFP can register for offloads from devices that exist before it is loaded (filter rules will be replayed from the TC core). Similarly, on notifier unregister, a call is triggered for each currently active netdev. This allows the driver to unregister any indirect block callbacks that may still be active. Signed-off-by: John Hurley <john.hurley@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-11nfp: flower: increase scope of netdev checking functionsJohn Hurley3-31/+29
Both the actions and tunnel_conf files contain local functions that check the type of an input netdev. In preparation for re-use with tunnel offload via indirect blocks, move these to static inline functions in a header file. Signed-off-by: John Hurley <john.hurley@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-11nfp: flower: allow non repr netdev offloadJohn Hurley4-39/+49
Previously the offload functions in NFP assumed that the ingress (or egress) netdev passed to them was an nfp repr. Modify the driver to permit the passing of non repr netdevs as the ingress device for an offload rule candidate. This may include devices such as tunnels. The driver should then base its offload decision on a combination of ingress device and egress port for a rule. Signed-off-by: John Hurley <john.hurley@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-09net: mvneta: correct typoAlexandre Belloni1-2/+2
The reserved variable should be named reserved1. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-09dpaa2-ptp: defer probe when portal allocation failedIoana Ciornei1-1/+4
The fsl_mc_portal_allocate can fail when the requested MC portals are not yet probed by the fsl_mc_allocator. In this situation, the driver should defer the probe. Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-09dpaa2-eth: defer probe on object allocateIoana Ciornei1-10/+22
The fsl_mc_object_allocate function can fail because not all allocatable objects are probed by the fsl_mc_allocator at the call time. Defer the dpaa2-eth probe when this happens. Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-09nfp: use the new __netdev_tx_sent_queue() BQL optimisationJakub Kicinski1-3/+1
__netdev_tx_sent_queue() was added in commit e59020abf0f ("net: bql: add __netdev_tx_sent_queue()") and allows for better GSO performance. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com> Reviewed-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-09net: qualcomm: rmnet: Fix incorrect assignment of real_devSubash Abhinov Kasiviswanathan1-3/+3
A null dereference was observed when a sysctl was being set from userspace and rmnet was stuck trying to complete some actions in the NETDEV_REGISTER callback. This is because the real_dev is set only after the device registration handler completes. sysctl call stack - <6> Unable to handle kernel NULL pointer dereference at virtual address 00000108 <2> pc : rmnet_vnd_get_iflink+0x1c/0x28 <2> lr : dev_get_iflink+0x2c/0x40 <2> rmnet_vnd_get_iflink+0x1c/0x28 <2> inet6_fill_ifinfo+0x15c/0x234 <2> inet6_ifinfo_notify+0x68/0xd4 <2> ndisc_ifinfo_sysctl_change+0x1b8/0x234 <2> proc_sys_call_handler+0xac/0x100 <2> proc_sys_write+0x3c/0x4c <2> __vfs_write+0x54/0x14c <2> vfs_write+0xcc/0x188 <2> SyS_write+0x60/0xc0 <2> el0_svc_naked+0x34/0x38 device register call stack - <2> notifier_call_chain+0x84/0xbc <2> raw_notifier_call_chain+0x38/0x48 <2> call_netdevice_notifiers_info+0x40/0x70 <2> call_netdevice_notifiers+0x38/0x60 <2> register_netdevice+0x29c/0x3d8 <2> rmnet_vnd_newlink+0x68/0xe8 <2> rmnet_newlink+0xa0/0x160 <2> rtnl_newlink+0x57c/0x6c8 <2> rtnetlink_rcv_msg+0x1dc/0x328 <2> netlink_rcv_skb+0xac/0x118 <2> rtnetlink_rcv+0x24/0x30 <2> netlink_unicast+0x158/0x1f0 <2> netlink_sendmsg+0x32c/0x338 <2> sock_sendmsg+0x44/0x60 <2> SyS_sendto+0x150/0x1ac <2> el0_svc_naked+0x34/0x38 Fixes: b752eff5be24 ("net: qualcomm: rmnet: Implement ndo_get_iflink") Signed-off-by: Sean Tranchetti <stranche@codeaurora.org> Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-09tg3: extend PTP gettime function to read system clockMiroslav Lichvar1-6/+13
This adds support for the PTP_SYS_OFFSET_EXTENDED ioctl. Cc: Richard Cochran <richardcochran@gmail.com> Cc: Michael Chan <michael.chan@broadcom.com> Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-09ixgbe: extend PTP gettime function to read system clockMiroslav Lichvar1-10/+44
This adds support for the PTP_SYS_OFFSET_EXTENDED ioctl. Cc: Richard Cochran <richardcochran@gmail.com> Cc: Jacob Keller <jacob.e.keller@intel.com> Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com> Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-09igb: extend PTP gettime function to read system clockMiroslav Lichvar1-10/+55
This adds support for the PTP_SYS_OFFSET_EXTENDED ioctl. Cc: Richard Cochran <richardcochran@gmail.com> Cc: Jacob Keller <jacob.e.keller@intel.com> Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com> Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-09e1000e: extend PTP gettime function to read system clockMiroslav Lichvar3-16/+45
This adds support for the PTP_SYS_OFFSET_EXTENDED ioctl. Cc: Richard Cochran <richardcochran@gmail.com> Cc: Jacob Keller <jacob.e.keller@intel.com> Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com> Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-09net: hns3: add PCIe FLR support for VFHuazhong Tan2-2/+64
This patch implements the .reset_prepare and .reset_done ops from pci framework to support the VF FLR. This patch uses hclgevf_set_def_reset_request() and hclgevf_reset_event() to handle FLR, so when hdev->default_reset_request is non zero, it means there is some reset requseted by hclgevf_set_def_reset_request() need to be processed. Also get the hdev from the ae_dev because hclgevf_reset_event is called with handle being NULL. Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-09net: hns3: do VF's pci re-initialization while PF doing FLRHuazhong Tan3-8/+74
While doing PF FLR, VF's PCIe configuration space will be cleared, so the pci and vector of VF should be re-initialized in the VF's reset process while PF doing FLR. Also, this patch fixes some memory not freed problem when pci re-initialization is done during reset process. Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-09net: hns3: add PCIe FLR support for PFHuazhong Tan6-1/+100
This patch implements the .reset_prepare and .reset_done ops from pci framework to support the PF FLR. Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-09net: hns3: implement the IMP reset processing for PFHuazhong Tan3-9/+37
The current code only print the prompt message after receiving the IMP reset interrupt and does not perform the corresponding driver reset operation. This patch implements the missing IMP reset handling in the driver. 1. The driver sets the HCLGE_STATE_CMD_DISABLE to stop sending command after receiving the IMP reset interrupt. 2. The driver needs to notify the hardware to reload the IMP firmware. 3. The IMP firmware reloading makes the reset time of hardware longer, so it is necessary to extend the driver's waiting time to wait for the hardware reset to complete. 4. In hclge_check_event_cause, IMP reset event should have higher priority than other events. Also, after clearing HCLGE_STATE_CMD_DISABLE in the hclge_cmd_init(), it needs to check whether there is a pending reset, if so, just set the HCLGE_STATE_CMD_DISABLE back and return. Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-09net: hns3: stop napi polling when HNS3_NIC_STATE_DOWN is setHuazhong Tan1-6/+16
When calling napi_disable during reset down process, if NAPIF_STATE_MISSED is set, napi_complete will call __napi_schedule to do the polling again. So this patch uses HNS3_NIC_STATE_DOWN to ensure the polling is not scheduled again. Also, when napi_complete returns true, it means polling is scheduled again, it is not neccssary to enable the interrupt. Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-09net: hns3: add error handler for hclgevf_reset()Huazhong Tan1-14/+37
Since hclgevf_reset() may fail for some reasons, so it needs an error handler to deal with it. When VF reset failed, VF can only be restored by a higher level reset asserted by PF. So, it needs to reinitialize its command queue, then it can respond to higher level reset. Also, this patch adds error logging in the hclgevf_notify_client(). Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-09net: hns3: stop handling command queue while resetting VFHuazhong Tan4-1/+35
According to hardware's description, after the reset occurs, the driver needs to re-initialize the command queue before sending and receiving any commands. Therefore, the VF's driver needs to identify the command queue needs to re-initialize with HCLGEVF_STATE_CMD_DISABLE, and does not allow sending or receiving commands before the re-initialization. Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-09net: hns3: add reset handling for VF when doing Core/Global/IMP resetHuazhong Tan2-12/+46
When a Core/Global/IMP reset occurs, the hardware sets the reset status register of all PF/VF and reports a reset interrupt to all PF/VF and firmware. When receiving the reset interrupt: 1. The firmware will wait for 100 ms before resetting the hardware and clear the reset status register of all PF when hardware reset is done. 2. The PF/VF driver needs to down the netdev within 100 ms and then wait for hardware reset to finish. 3. After firmware clearing the reset status register of all PF, the PF driver reinitializes the hardware and clear the reset status register of it's VF. 4. After PF driver clearing the reset status register of VF, the VF driver reinitializes the hardware. This patch mainly add handling for the step 4. Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-09net: hns3: add reset handling for VF when doing PF resetHuazhong Tan9-20/+146
When PF performs a function reset, the hardware will reset both PF and all the VF belong to this PF. Hence, both PF's driver and VF's driver need to perform corresponding reset operations. Before PF driver asserting function reset to hardware, it firstly set up VF's hardware reset status, and inform the VF driver with HNAE3_VF_PF_FUNC_RESET, then VF driver sets this reset type to reset_pending and shechule reset task to stop IO and waits for the hardware reset status to clear. When PF driver has reinitialized the hardware and is ready to process mailbox from VF, PF driver clears VF's hardware reset status for VF to continue its reset process. Also, this patch uses readl_poll_timeout to simplify the hardware reset status waitting. 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>
2018-11-09net: hns3: adjust VF's reset processHuazhong Tan7-48/+63
Currently when VF need to reset itself, it will send a cmd to PF, after receiving the VF reset requset, PF sends a cmd to inform VF to enter the reset process and send a cmd to firmware to do the actual reset for the VF, it is possible that firmware has resetted the VF, but VF has not entered the reset process, which may cause IO not stopped problem when firmware is resetting VF. This patch fixes it by adjusting the VF reset process, when VF need to reset itself, it will enter the reset process first, and it will tell the PF to send cmd to firmware to reset itself. Add member reset_pending to struct hclgevf_dev, which indicates that there is reset event need to be processed by the VF's reset task, and the VF's reset task chooses the highest-level one and clears other low-level one when it processes reset_pending. hclge_inform_reset_assert_to_vf function is unused now, but it will be used to support the PF reset with VF working, so declare it in the header file. 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>
2018-11-09net: hns3: add reset_hdev to reinit the hdev in VF's reset processHuazhong Tan2-54/+31
When doing reset, the reset handling function only need to reinitialize hardware, it makes sense to add a function to do that job. Also the error handling of hclgevf_init_hdev is different when it is used in reset process. This patch adds reset_hdev to reinitialize hardware when resetting. Also, this patch removes the hclgevf_dev_ongoing_full_reset because it is unused now. 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>
2018-11-09net: aquantia: allow rx checksum offload configurationDmitry Bogdanov5-6/+18
RX Checksum offloads could not be configured and ignored netdev features flag for checksumming. Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com> Signed-off-by: Dmitry Bogdanov <dmitry.bogdanov@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-09net: aquantia: invalid checksumm offload implementationDmitry Bogdanov2-30/+41
Packets with marked invalid IP/UDP/TCP checksums were considered as good by the driver. The error was in a logic, processing offload bits in RX descriptor. Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com> Signed-off-by: Dmitry Bogdanov <dmitry.bogdanov@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-11-09net: aquantia: fixed enable unicast on 32 macvlanIgor Russkikh1-1/+1
Fixed a condition mistake due to which macvlans unicast item number 32 was not added in the unicast filter. The consequence is that when exactly 32 macvlans are created on NIC, the last created macvlan receives no traffic because its MAC was not registered in HW. Fixes: 94b3b542303f ("net: aquantia: vlan unicast address list correct handling") Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com> Tested-by: Nikita Danilov <nikita.danilov@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>