summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* net: ethernet: altera_tse: use phydev from struct net_devicePhilippe Reynes2016-06-223-14/+9Star
| | | | | | | | | | The private structure contain a pointer to phydev, but the structure net_device already contain such pointer. So we can remove the pointer phydev in the private structure, and update the driver to use the one contained in struct net_device. Signed-off-by: Philippe Reynes <tremyfr@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: sun4i-emac: use phy_ethtool_{get|set}_link_ksettingsPhilippe Reynes2016-06-221-22/+2Star
| | | | | | | | There are two generics functions phy_ethtool_{get|set}_link_ksettings, so we can use them instead of defining the same code in the driver. Signed-off-by: Philippe Reynes <tremyfr@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: sun4i-emac: use phydev from struct net_devicePhilippe Reynes2016-06-221-20/+14Star
| | | | | | | | | | The private structure contain a pointer to phydev, but the structure net_device already contain such pointer. So we can remove the pointer phydev in the private structure, and update the driver to use the one contained in struct net_device. Signed-off-by: Philippe Reynes <tremyfr@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'mlxsw-next'David S. Miller2016-06-213-684/+592Star
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Jiri Pirko says: ==================== mlxsw: Preparation for IPv4 router Ido says: This series prepares the driver for IPv4 router support. The router follow-up patches are available at: https://github.com/jpirko/linux_mlxsw/tree/net-next_queue Patches 1-9 simplify the netdevice notification block and also add several checks during PRECHANGEUPPER events against topologies that aren't supported by the device. This will ensure L3 interfaces are only configured on top of valid netdevs. Patches 10-13 contain trivial changes required for the introduction of a generic FID struct - currently only used for vFIDs - in patch 14. Making the FID struct generic will allow us to easily associate the underlying FIDs with their L3-counterparts - Router interfaces (RIFs): FID Type | Used by | RIF Type -------------------------------------------------------- FID | The VLAN-aware bridge | VLAN vFID | VLAN-unaware bridges | FID rFID | non-bridged netdevs (follow-up) | Sub-port Obligatory ASCII art to visualize the above: A.B.C.D + | FID RIF + br0 E.F.G.H + + | | VLAN RIF +---------+---------+ + | | br1.W | vFID | + | | | vPort +-+-+ +-+-+ + swXpY.Z | | | | br1 +-+-+ +-+-+ + | | FID=W | | | +------------+------------+ | | | | +---+---+ +---+-+-+ +---+---+ | | | | | | | | | | | | | | | | | | +-------+ +-------+ +-------+ swXpY Patches 15-16 further generalize the struct by exploiting the fact that the FID is a shared resource among ports. Each FID type is assigned a 'leave' function that is invoked based on CHANGEUPPER events and takes care of the necessary clean-up. Patches 17-22 build upon the previous patches and use the FID struct for the VLAN-aware bridge and take care of cleaning up FID resources in the 'leave' functions. For now, these are only FDB records, but later on we'll have to remove the RIFs associated with these FIDs, which will in turn take care of routes and neighbours clean-up. The last patch adds debug prints that proved very useful during the development of this series. Tested with the existing L2 recipes: https://github.com/jpirko/lnst/tree/master/recipes/switchdev ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * mlxsw: spectrum: Add debug printsIdo Schimmel2016-06-212-0/+14
| | | | | | | | | | | | | | | | | | | | | | For debug purposes, it's useful to know the order in which the driver responds to changes in the topology of its upper devices. Add debug prints to signal these events. 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: Free resources upon vPort destructionIdo Schimmel2016-06-212-35/+15Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are situations in which a vPort is destroyed while still holding references to device's resources such as FIDs and FDB records. This can happen, for example, when a VLAN device is deleted while still being bridged. Instead of trying to make sure vPort destruction is invoked when it no longer uses device's resources, just free them upon destruction. This simplifies the code, as we no longer need to take different situations into account when events are received - cleanup is taken care of in one place. 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: Refactor FDB flushing logicIdo Schimmel2016-06-213-89/+47Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FDB entries are learned using {Port / LAG ID, FID} and therefore should be flushed whenever a port (vPort) leaves its FID (vFID). However, when the bridge port is a LAG device (or a VLAN device on top), then FDB flushing is conditional. Ports removed from such LAG configurations must not trigger flushing, as other ports might still be members in the LAG and therefore the bridge port is still active. The decision whether to flush or not was previously computed in the netdevice notification block, but in order to flush the entries when a port leaves its FID this decision should be computed there. Strip the notification block from this logic and instead move it to one FDB flushing function that is invoked from both the FID / vFID leave functions. When port isn't member in LAG, FDB flushing should always occur. Otherwise, it should occur only when the last port (vPort) member in the LAG leaves the FID (vFID). This will allow us - in the next patch - to simplify the cleanup code paths that are hit whenever the topology above the port netdevs changes. 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: Don't count on FID being presentIdo Schimmel2016-06-213-8/+11
| | | | | | | | | | | | | | | | | | Not all vPorts will have FIDs assigned to them, so make sure functions first test for FID presence. 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: Add FID get / set functionsIdo Schimmel2016-06-213-21/+32
| | | | | | | | | | | | | | | | | | | | | | As previously explained, not all vPorts will be assigned FIDs, so instead of returning the FID index of a vPort, return a pointer to its FID struct. This will allow us to know whether it's legal to access the vPort's FID parameters such as index and device. 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: Check if port is vPort using its VIDIdo Schimmel2016-06-211-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When L3 interfaces will be introduced a vPort won't necessarily have a FID assigned to it. This can happen if it's not member in a bridge (in which case it's assigned a vFID) or doesn't have an IP address (in which case it's assigned an rFID). Therefore, instead check the VID parameter to test whether a port is a vPort or not. 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: Use per-FID struct for the VLAN-aware bridgeIdo Schimmel2016-06-213-125/+195
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a very similar way to the vFIDs, make the first 4K FIDs - used in the VLAN-aware bridge - use the new FID struct. Upon first use of the FID by any of the ports do the following: 1) Create the FID 2) Setup a matching flooding entry 3) Create a mapping for the FID Unlike vFIDs, upon creation of a FID we always create a global VID-to-FID mapping, so that ports without upper vPorts can use it instead of creating an explicit {Port, VID} to FID mapping. When a port leaves a FID the reverse is performed. Whenever the FID's reference count reaches zero the FID is deleted along with the global mapping. The per-FID struct will later allow us to configure L3 interfaces on top of the VLAN-aware bridge. 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: Remove unused function argumentIdo Schimmel2016-06-211-6/+3Star
| | | | | | | | | | | | 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: Use join / leave functions for vFID operationsIdo Schimmel2016-06-211-178/+126Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a vPort is created or when it joins a bridge we always do the same set of operations: 1) Create the vFID, if not already created 2) Setup flooding for the vFID 3) Map the {Port, VID} to the vFID When a vPort is destroyed or when it leaves a bridge the reverse is performed. Encapsulate the above in join / leave functions and simplify the code. FIDs and rFIDs will use a similar set of functions. 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: Make vFID struct genericIdo Schimmel2016-06-213-150/+131Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Up until now we had a dedicated struct only for vFIDs, but before introducing support for L3 interfaces we need to make it generic and use it for all three types of FIDs: 1) FIDs - 0..4K-1, used for the VLAN-aware bridge 2) vFIDs - 4K..15K-1, used for VLAN-unaware bridges 3) rFIDs - 15K..16K-1, used to direct traffic to / from the router in the device. Will be introduced later in the series. The three types of L3 interfaces - Router InterFaces, RIFs - that will be introduced correspond to the three types of FIDs and are configured using them. Therefore, we'll need to store the links between them as well as a reference count on the underlying FID, so that the corresponding RIF will be destroyed when it reaches zero. Note that the lower 0.5K vFIDs are currently used for for non-bridged netdevs, so that traffic could be flooded to the CPU port. However, when rFIDs will be introduced we'll no longer need these and they too will be used for VLAN-unaware bridges. Make the vFID struct generic by renaming it and some of its fields. FIDs will be converted to use it later in the series. 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: Use FID instead of vFID to setup floodingIdo Schimmel2016-06-213-10/+12
| | | | | | | | | | | | | | | | | | Use a FID index instead of vFID and ease the transition towards a generic FID struct. 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: Create a function to map vPort's FIDIdo Schimmel2016-06-211-46/+38Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A FID used by a vPort (vFID, but also rFID later in the series) is always mapped using {Port, VID} and not only VID as with the 4K FIDs of the VLAN-aware bridge. Instead of specifying all the arguments each time, just wrap this operation using a dedicated function and simplify the code. As before, the function takes FID as its argument in preparation for a generic FID struct. 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: Use only one function to create vFIDsIdo Schimmel2016-06-211-42/+37Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simplify the code and use only one function for vFID creation / destruction. Unlike before, the function receives a FID index as its argument and not a vFID index. Instead of passing 0, now one would need to pass 4K, which is the first vFID. This is the first step in creating a generic FID struct that will be used for all three types of FIDs. 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: Remove redundant function argumentIdo Schimmel2016-06-213-10/+8Star
| | | | | | | | | | | | | | | | In all call sites 'only_uc' is set to false, so strip it. 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: Use DECLARE_BITMAP() macroIdo Schimmel2016-06-211-4/+4
| | | | | | | | | | | | | | | | There is a macro to do this kind of declarations, so use it. 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: Centralize VLAN-aware bridge ref countingIdo Schimmel2016-06-211-28/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | We hold a reference count on the number of ports member in the VLAN-aware bridge, as we only support one. Instead of always incrementing / decrementing the reference count after joining / leaving the bridge, simply do this accounting in the join / leave functions. 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: Remove unnecessary function argumentIdo Schimmel2016-06-211-4/+3Star
| | | | | | | | | | | | | | | | The argument 'br_dev' is never used, so remove it. 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: Make unlinking functions return voidIdo Schimmel2016-06-211-40/+28Star
| | | | | | | | | | | | | | | | | | | | | | | | | | When responding to unlinking CHANGEUPPER notifications we shouldn't return any value, as it's not checked by upper layers. In addition, there's nothing the driver can do in case of failure, so it should simply continue and try to free as much resources as possible and not stop on first error. 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: Use WARN_ON() return valueIdo Schimmel2016-06-211-12/+4Star
| | | | | | | | | | | | | | | | | | Instead of checking for a condition and then issue the warning, just do it in one go and simplify the code. 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: Remove unnecessary checks from event processingIdo Schimmel2016-06-211-4/+2Star
| | | | | | | | | | | | | | | | | | | | When upper device of a VLAN device changes we already made sure it's a bridge device in PRECHANGEUPPER, so no need to check it's a master device in CHANGEUPPER. 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: Forbid LAG slave from having VLAN uppersIdo Schimmel2016-06-211-1/+6
| | | | | | | | | | | | | | | | | | When a port netdev is put under LAG it cannot have VLAN upper devices, so forbid that. The LAG device itself can have VLAN upper devices. 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: Sanitize port netdev upper devicesIdo Schimmel2016-06-211-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | We currently only support the following upper devices for port netdevs: 1) Bridge 2) LAG (bond / team) 3) VLAN Any other device is forbidden, so return an error. 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: Use notifier_from_errno() in notifier blockIdo Schimmel2016-06-211-63/+29Star
|/ | | | | | | | | Instead of checking the error value and returning NOTIFY_BAD, just use notifier_from_errno() and simplify the code. 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>
* Merge branch 'hns-next'David S. Miller2016-06-2111-155/+291
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Yisen Zhuang says: ==================== net: hns: fix some bugs in hns driver This series includes some bugs fixed. All these patches needs to be applied after the patchset about ACPI support, so this series is floated to net-next list. The patches are: > from Daode, fixes about pfc pause frame, getting coaslesce, led control logic, TSO on|off and tcam table configuration. > from Jun He, fix the potential leak to port unavailable > from Kejian, fix bug of loopback and failing to test ping6 > from Qianqian, fix the several typo in hns driver For more details, please see individual patches. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * net: hns: bug fix about TSO on|off when there is trafficDaode Huang2016-06-211-4/+4
| | | | | | | | | | | | | | | | | | | | | | When enable/disable tso, the driver tries to access the hardware register, but this operation will cause the port unavalible when there is traffic. This patch tries to enable TSO when initialize, then control tso through TSE bit in transmit descriptor. Signed-off-by: Daode Huang <huangdaode@hisilicon.com> Signed-off-by: Yisen Zhuang <Yisen.Zhuang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * net: hns: change the default coalesce usecsDaode Huang2016-06-212-2/+2
| | | | | | | | | | | | | | | | | | | | The default coalesce timeout is 3us, which is will cause CPU usage is too high. This patch change it to 50us in order to reduce CPU usage and the value makes sure network latency also meets requirement. Signed-off-by: Daode Huang <huangdaode@hisilicon.com> Signed-off-by: Yisen Zhuang <Yisen.Zhuang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * net: hns: fix sbm default parameters config errorDaode Huang2016-06-212-17/+39
| | | | | | | | | | | | | | | | | | | | The default sbm config parameter leaves little buffer when there is heavy traffic, which will cause packets drop. This patch changes them to make enough buffers for handling packets. Signed-off-by: Daode Huang <huangdaode@hisilicon.com> Signed-off-by: Yisen Zhuang <Yisen.Zhuang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * net: hns: fix bug that alloc skb fail lead to port unavailableJun He2016-06-211-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When hns_nic_poll_rx_skb alloc skb fail, it will break receive cycle and read new fbd_num to start new receive cycle. It recomputes cycle num is fbd_num minus clean_count, actually this cycle num is too big because it drop out receive cycle. It brings about the port unavailable. So we will goto out when alloc skb fail to fix this bug. Signed-off-by: Jun He <hjat2005@huawei.com> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com> Signed-off-by: Yisen Zhuang <Yisen.Zhuang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * net: hns: bug fix about led control logic when link downDaode Huang2016-06-211-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | The default driver sets anchor led bit to 0 when link down, actually, the anchor bit should be set to 1, so fixes it when link status is down. Secondly, change the return value of cpld_set_led_id to 0, which means leave the cpld to control led blink frequece other than the driver itself. Signed-off-by: Daode Huang <huangdaode@hisilicon.com> Signed-off-by: Yisen Zhuang <Yisen.Zhuang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * net: hns: delete redundancy ring enable operationsDaode Huang2016-06-214-21/+10Star
| | | | | | | | | | | | | | | | | | | | | | When network interface is enabled, the ring enable operation is conducted twice. This patch deletes the redundancy code of ring enable, and integrates hnae_ae_ops.toggle_queue_status other functions to hns_ae_start. Signed-off-by: Daode Huang <huangdaode@hisilicon.com> Signed-off-by: Yisen Zhuang <Yisen.Zhuang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * net: hns: add get_coalesce_range api for hnsDaode Huang2016-06-213-0/+40
| | | | | | | | | | | | | | | | | | | | This patch adds get_coalesce_range api for hns, it shows range of coalesce usecs and frames that can be set on this interface. Signed-off-by: Daode Huang <huangdaode@hisilicon.com> Signed-off-by: Yisen Zhuang <Yisen.Zhuang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * net: hns: fix bug of getting the wrong tcam dataDaode Huang2016-06-211-4/+4
| | | | | | | | | | | | | | | | | | | | The current driver stores the high bit value of tcam data register to the tcam data low element, stores the low bit value of tcam data register to tcam data high element, this patch fixes this bug. Signed-off-by: Daode Huang <huangdaode@hisilicon.com> Signed-off-by: Yisen Zhuang <Yisen.Zhuang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * net: hns: add spin lock for tcam table operationDaode Huang2016-06-212-0/+27
| | | | | | | | | | | | | | | | | | | | This patch adds spin lock for tcam table operation, there maybe a race condition happens when more than one thread try to change the tcam talbe entries. Signed-off-by: Daode Huang <huangdaode@hisilicon.com> Signed-off-by: Yisen Zhuang <Yisen.Zhuang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * net: hns: bugfix about pfc pause frame statisticsDaode Huang2016-06-214-12/+81
| | | | | | | | | | | | | | | | | | | | For SoC hip06, PFC pause handled in dsaf, while hip05 in XGMAC, so change the statistics of pfc pause in dsaf and remove the old pfc pause frame statistics. Signed-off-by: Daode Huang <huangdaode@hisilicon.com> Signed-off-by: Yisen Zhuang <Yisen.Zhuang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * net: hns: fix the wrong speed for bondQianqian Xie2016-06-212-20/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For debug-ports,there are two non-synchronized processes: Speed-Auto-Negotiation and Link-Update-Status. The two processes are towed by two different state machines. Bond reads the speed when link up, but the speed maybe not update the right value at that time.That make for bond's wrong speed. Thus only one state machine should be used and if phy_state_machine is used, it does not need to do hns_nic_update_link_status(). Signed-off-by: Qianqian Xie <xieqianqian@huawei.com> Signed-off-by: Yisen Zhuang <Yisen.Zhuang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * net: hns: fix ethtool loopback fail bugKejian Yan2016-06-211-21/+14Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When run ethtool cmd(ethtool -t ethx) again and again for a long time, it will be probabilistically fail. The PHYs' registers may be on different pages, so it must be switch to the right page before setting PHYs' registers. And __lb_up() calls phy_start() to startup the PHYs device, but this function may change Copper Control Register(Page 0, Register 0) to an other value. It would cause phy loopback test fail. if we remove phy_start(), we have to remove the relative phy_stop(), phy_disconnect() when doing phy loopback to keep the phy stay in right status. Reported-by: hejun <hjat2005@huawei.com> Signed-off-by: Kejian Yan <yankejian@huawei.com> Signed-off-by: Yisen Zhuang <Yisen.Zhuang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * net: hns: select Hilink before serdes loopback for HNS V2Kejian Yan2016-06-211-6/+20
| | | | | | | | | | | | | | | | | | | | As Hilink3 and Hilink4 use the same xge training and xge u adaptor for HNSv2, it needs to select which Hilink to be set before relative serdes being configed. The hilink_access_sel is the register to do that. Signed-off-by: Kejian Yan <yankejian@huawei.com> Signed-off-by: Yisen Zhuang <Yisen.Zhuang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * net: hns: fix the error info when dma_set_mask_and_coherent failQianqian Xie2016-06-211-1/+1
| | | | | | | | | | | | | | | | | | The error info should be printed as "set mask to 64bit fail!" instead of "set mask to 32bit fail!" in dma_set_mask_and_coherent(). Signed-off-by: Qianqian Xie <xieqianqian@huawei.com> Signed-off-by: Yisen Zhuang <Yisen.Zhuang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * net: hns: Remove unnecessary device resource freeQianqian Xie2016-06-211-35/+4Star
| | | | | | | | | | | | | | | | | | | | The driver uses devm_ioremap_resource, it will unmap the map automatically, remove the unnecessary the resource free. Signed-off-by: Qianqian Xie <xieqianqian@huawei.com> Reported-by: Kefeng Wang <wangkefeng.wang@huawei.com> Signed-off-by: Yisen Zhuang <Yisen.Zhuang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * net: hns: typo fix of annotation info for hns_nic_reset_subtask()Qianqian Xie2016-06-211-1/+1
| | | | | | | | | | | | | | | | | | The annotation info for hns_nic_reset_subtask() should be "for resetting subtask" instead of "for resetting suntask". Signed-off-by: Qianqian Xie <xieqianqian@huawei.com> Signed-off-by: Yisen Zhuang <Yisen.Zhuang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * net: hns: add skb_reset_mac_header() after skb being allocKejian Yan2016-06-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | HNS receives a packet without doing anything, but it should call skb_reset_mac_header() to initialize the header before using eth_hdr(). Fixes: 0d6b425a3773c3445b0f51b2f333821beaacb619 Signed-off-by: Kejian Yan <yankejian@huawei.com> Signed-off-by: Yisen Zhuang <Yisen.Zhuang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * net: hns: fix hns dsaf v1 dont support tx_pause closeQianqian Xie2016-06-211-3/+3
| | | | | | | | | | | | | | | | | | | | For service port, hns dsaf v1 support to close tx_pause. However, the port will be invalid when it run command ethtool to close tx_pause. This patch will fix it. Signed-off-by: Qianqian Xie <xieqiaqian@huawei.com> Signed-off-by: Yisen Zhuang <Yisen.Zhuang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * net: hns: bug fix of ge reset sequenceQianqian Xie2016-06-211-1/+5
|/ | | | | | | | | | | The bit fileds of PPE reset register are different between HNS v1 and HNS v2, but the current procedure just only match HNS v1. Here is a patch to fix it. Signed-off-by: Kejian Yan <yankejian@huawei.com> Signed-off-by: Qianqian Xie <xieqianqian@huawei.com> Signed-off-by: Yisen Zhuang <Yisen.Zhuang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'dsa-mv88e6xxx-probe-compatible'David S. Miller2016-06-212-216/+385
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Vivien Didelot says: ==================== net: dsa: mv88e6xxx: probe compatible This patchset factorizes the legacy and new SMI probing and abstracts the switch register accesses. This simplifies adding support for new chips or alternative register accesses. This will allow us to use a compatible chip info to describe how to access the SMI device and its switch ID register at probe time. For the legacy probe, we fix the compatible info to 88E6085. For the MDIO probe, we will use the compatible info from the device node data. All patches are reviewed. Changes since v4: - fix debug printing (was 'val' instead of '*val') Changes since v3 [3]: - better register access abstraction using the chip structure Changes since v2 [2]: - do not guess compatible model in legacy probe - add low level SMI API using a chip structure - allocate before probe and detection - add 3 cosmetic patches Changes since v1 [1]: - merge style fix from Ben Dooks - add Acked-by/Reviewed-by tags - drop one compatible string per model - detect the SMI device based on the compatible info - add an SMI ops structure [1] https://lkml.org/lkml/2016/6/8/1201 [2] https://lkml.org/lkml/2016/6/14/671 [3] https://lkml.org/lkml/2016/6/17/995 ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * net: dsa: mv88e6xxx: abstract switch registers accessesVivien Didelot2016-06-212-60/+170
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the SMI address of the switch chip is zero, the chip assumes to be the only one on the SMI master bus and thus responds to all its known SMI devices addresses (port registers, Global2, etc.) When its SMI address is not zero, some chips (e.g. 88E6352) use an indirect access through two SMI Command and Data registers. Other models (e.g. 88E6060) using less than 16 internal SMI addresses always use a direct access. Add a capability flag to describe chips supporting the (indirect) Multi-chip Addressing Mode, and a low-level API to access the registers via SMI. Other accesses (like Ethernet management frames) may be added later. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
| * net: dsa: mv88e6xxx: add port base address to infoVivien Didelot2016-06-212-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | The switch ID is located at address 0x3 of every Port Registers bank. But not all Marvell switches have their Port Registers SMI Addresses starting at 0x10. 88E6060 starts at 0x8 and 88E6390 starts at 0x0. Add this data in the info structure and use it in the detection code. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>