aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2019-04-17s390/qeth: add TX multiqueue support for IQD devicesJulian Wiedmann6-26/+97
qeth has been supporting multiple HW Output Queues for a long time. But rather than exposing those queues to the stack, it uses its own queue selection logic in .ndo_start_xmit... with all the drawbacks that entails. Start off by switching IQD devices over to a proper mqs net_device, and converting all the netdev_queue management code. One oddity with IQD devices is the requirement to place all mcast traffic on the _highest_ established HW queue. Doing so via .ndo_select_queue seems straight-forward - but that won't work if only some of the HW queues are active (ie. when dev->real_num_tx_queues < dev->num_tx_queues), since netdev_cap_txqueue() will not allow us to put skbs on the higher queues. To make this work, we 1. let .ndo_select_queue() map all mcast traffic to netdev_queue 0, and 2. later re-map the netdev_queue and HW queue indices in .ndo_start_xmit and the TX completion handler. With this patch we default to a fixed set of 1 ucast and 1 mcast queue. Support for dynamic reconfiguration is added at a later time. Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-17s390/qeth: don't keep statistics for tx timeoutJulian Wiedmann2-3/+0
struct netdev_queue contains a counter for tx timeouts, which gets updated by dev_watchdog(). So let's not attempt to maintain our own statistics, in particular not by overloading the skb-error counter. Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-17s390/qeth: don't bother updating the last-tx timeJulian Wiedmann1-1/+0
As the documentation for netif_trans_update() says, netdev_start_xmit() already updates the last-tx time after every good xmit. So don't duplicate that effort. One odd case is that qeth_flush_buffers() also gets called from our TX completion handler, to flush out any partially filled buffer when we switch the queue to non-packing mode. But as the TX completion handler will _always_ wake the txq, we don't have to worry about the TX watchdog there. Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-17s390/qeth: handle error from qeth_update_from_chp_desc()Julian Wiedmann1-4/+10
Subsequent code relies on the values that qeth_update_from_chp_desc() reads from the CHP descriptor. Rather than dealing with weird errors later on, just handle it properly here. Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-17s390/qeth: clarify naming for some QDIO helpersJulian Wiedmann4-23/+22
The naming of several QDIO helpers doesn't match their actual functionality, or the structures they operate on. Clean this up. s/qeth_alloc_qdio_buffers/qeth_alloc_qdio_queues s/qeth_free_qdio_buffers/qeth_free_qdio_queues s/qeth_alloc_qdio_out_buf/qeth_alloc_output_queue s/qeth_clear_outq_buffers/qeth_drain_output_queue s/qeth_clear_qdio_buffers/qeth_drain_output_queues Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-17Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queueDavid S. Miller15-93/+901
Jeff Kirsher says: ==================== 40GbE Intel Wired LAN Driver Updates 2019-04-16 This series contains updates to i40e driver only. Adam fixes i40e so that queues can be restored to its original value if configuring queue channels fails. Bumped the maximum API version supported and added the API version to error messages to clarify supported firmware API versions. Fixed the problem with the driver being able to add only 7 multicast MAC address filters instead of 16. Aleksandr adds support for Dynamic Device Personalization (DDP) which allows loading profiles that change the way internal parser interprets processed frames. Nick fixes an issue where if we modify the VLAN stripping options when a port VLAN is configured, it will break traffic for the VSI, so prevent changes from being made. Jake fixes an issue where a device reset can mess up the clock time because we reset the clock time based on the kernel time every reset. This causes us to potentially completely reset the PTP time, and can cause unexpected behavior in programs like ptp4l. Piotr fixes an LED blink issue with the 'ethtool -p' command, so that identification blinking will work on all hardware. Chinh fixed the error returned to correctly reflect the current state when LLDP or DCBx is not in an operational state. Grzegorz cleans up a misleading error message when untrusted VF tries to exceed addresses beyond the NIC limit. Carolyn fixes the error return code to correctly reflect the error case. v2: updated the URL provided in the DDP patch (#2) ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-17Merge branch 'stmmac-Enable-Flow-Control'David S. Miller3-1/+52
Jose Abreu says: ==================== net: stmmac: Enable Flow Control I don't know of any specific reason why Flow Control is off by default but do let me know if there is any. Tested in B2B between XGMAC2 and GMAC5. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-17net: stmmac: Set Flow Control to automatic mode in the driverJose Abreu1-1/+1
By default Flow Control feature is not being enabled in stmmac. This is a useful feature that can prevent loss of packets and now that XGMAC already supports it (along with GMAC and QoS) it makes sense to activate it. Switch the module parameter to FLOW_AUTO so that Flow Control is activated. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Cc: Joao Pinto <jpinto@synopsys.com> Cc: David S. Miller <davem@davemloft.net> Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com> Cc: Alexandre Torgue <alexandre.torgue@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-17net: stmmac: dwxgmac: Finish the Flow Control implementationJose Abreu2-0/+51
Finish the implementation of Flow Control feature. In order for it to work correctly we need to set EHFC bit and the correct threshold values for activating and deactivating it. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Cc: Joao Pinto <jpinto@synopsys.com> Cc: David S. Miller <davem@davemloft.net> Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com> Cc: Alexandre Torgue <alexandre.torgue@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-16Merge branch 'dpaa2-eth-Add-flow-steering-support-without-masking'David S. Miller3-34/+167
Ioana Ciocoi Radulescu says: ==================== dpaa2-eth: Add flow steering support without masking On DPAA2 platforms that lack a TCAM (like LS1088A), masking of flow steering keys is not supported. Until now we didn't offer flow steering capabilities at all on these platforms. Introduce a limited support for flow steering, where we only allow ethtool rules that share a common key (i.e. have the same header fields). If a rule with a new composition key is wanted, the user must first manually delete all previous rules. First patch fixes a minor bug, the next two cleanup and prepare the code and the last one introduces the actual FS support. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-16dpaa2-eth: Add flow steering support without maskingIoana Ciocoi Radulescu3-32/+127
On platforms that lack a TCAM (like LS1088A), masking of flow steering keys is not supported. Until now we didn't offer flow steering capabilities at all on these platforms, since our driver implementation configured a "comprehensive" FS key (containing all supported header fields), with masks used to ignore the fields not present in the rules provided by the user. We now allow ethtool rules that share a common key (i.e. have the same header fields). The FS key is now kept in the driver private data and initialized when the first rule is added to an empty table, rather than at probe time. If a rule with a new composition key is wanted, the user must first manually delete all previous rules. When building a FS table entry to pass to firmware, we still use the old building algorithm, which assumes an all-supported-fields key, and later collapse the fields which aren't actually needed. Masked rules are not supported; if provided, the mask value will be ignored. For firmware versions older than MC10.7.0 (that only offer the legacy ABIs for configuring distribution keys) flow steering without masking support remains unavailable. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-16dpaa2-eth: Update hash key composition codeIoana Ciocoi Radulescu2-2/+30
Introduce an internal id bitfield to uniquely identify header fields supported by the Rx distribution keys. For the hash key, add a conversion from the RXH_* bitmask provided by ethtool to the internal ids. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-16dpaa2-eth: Add a couple of macrosIoana Ciocoi Radulescu2-2/+7
Add two macros to simplify reading DPNI options. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-16dpaa2-eth: Fix Rx classification statusIoana Ciocoi Radulescu1-1/+6
Set the Rx flow classification enable flag only if key config operation is successful. Fixes 3f9b5c9 ("dpaa2-eth: Configure Rx flow classification key") Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-16nfp: flower: fix implicit fallthrough warningJohn Hurley1-0/+1
The nfp_flower_copy_pre_actions function introduces a case statement with an intentional fallthrough. However, this generates a warning if built with the -Wimplicit-fallthrough flag. Remove the warning by adding a fall through comment. Fixes: 1c6952ca587d ("nfp: flower: generate merge flow rule") Signed-off-by: John Hurley <john.hurley@netronome.com> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Reviewed-by: Jiong Wang <jiong.wang@netronome.com> Reviewed-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-16net: phy: micrel: add Asym Pause workaroundAntoine Tenart1-1/+26
The Micrel KSZ9031 PHY may fail to establish a link when the Asymmetric Pause capability is set. This issue is described in a Silicon Errata (DS80000691D or DS80000692D), which advises to always disable the capability. This patch implements the workaround by defining a KSZ9031 specific get_feature callback to force the Asymmetric Pause capability bit to be cleared. This fixes issues where the link would not come up at boot time, or when the Asym Pause bit was set later on. Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-16Merge branch 'bnx2x-Support-for-timestamping-in-P2P-mode'David S. Miller1-20/+32
Sudarsana Reddy Kalluru says: ==================== bnx2x: Support for timestamping in P2P mode. The patch series adds driver support for timestamping the ptp packets in peer-delay (P2P) mode. - Patch (1) performs the code cleanup. - Patch (2) adds the required implementation. Please consider applying it 'net-next' tree. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-16bnx2x: Add support for detection of P2P event packets.Sudarsana Reddy Kalluru1-10/+12
The patch adds support for detecting the P2P (peer-to-peer) event packets. This is required for timestamping the PTP packets in peer delay mode. Unmask the below bits (set to 0) for device to detect the p2p packets. NIG_REG_P0/1_LLH_PTP_PARAM_MASK NIG_REG_P0/1_TLLH_PTP_PARAM_MASK bit 1 - IPv4 DA 1 of 224.0.0.107. bit 3 - IPv6 DA 1 of 0xFF02:0:0:0:0:0:0:6B. bit 9 - MAC DA 1 of 0x01-80-C2-00-00-0E. NIG_REG_P0/1_LLH_PTP_RULE_MASK NIG_REG_P0/1_TLLH_PTP_RULE_MASK bit 2 - {IPv4 DA 1; UDP DP 0} bit 6 - MAC Ethertype 0 of 0x88F7. bit 9 - MAC DA 1 of 0x01-80-C2-00-00-0E. Signed-off-by: Sudarsana Reddy Kalluru <skalluru@marvell.com> Signed-off-by: Ariel Elior <aelior@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-16bnx2x: Replace magic numbers with macro definitions.Sudarsana Reddy Kalluru1-20/+30
This patch performs code cleanup by defining macros for the ptp-timestamp filters. Signed-off-by: Sudarsana Reddy Kalluru <skalluru@marvell.com> Signed-off-by: Ariel Elior <aelior@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-16xen-netfront: mark expected switch fall-throughGustavo A. R. Silva1-1/+1
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. This patch fixes the following warning: drivers/net/xen-netfront.c: In function ‘netback_changed’: drivers/net/xen-netfront.c:2038:6: warning: this statement may fall through [-Wimplicit-fallthrough=] if (dev->state == XenbusStateClosed) ^ drivers/net/xen-netfront.c:2041:2: note: here case XenbusStateClosing: ^~~~ Warning level 3 was used: -Wimplicit-fallthrough=3 Notice that, in this particular case, the code comment is modified in accordance with what GCC is expecting to find. This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Reviewed-by: Juergen Gross <jgross@suse.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-16i40e: Fix misleading error messageCarolyn Wyborny1-1/+1
This patch changes an error code for an admin queue head overrun to use I40E_ERR_ADMIN_QUEUE_FULL instead of I40E_ERR_QUEUE_EMPTY. Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2019-04-16i40e: Able to add up to 16 MAC filters on an untrusted VFAdam Ludkiewicz1-2/+4
This patch fixes the problem with the driver being able to add only 7 multicast MAC address filters instead of 16. The problem is fixed by changing the maximum number of MAC address filters to 16+1+1 (two extra are needed because the driver uses 1 for unicast MAC address and 1 for broadcast). Signed-off-by: Adam Ludkiewicz <adam.ludkiewicz@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2019-04-16i40e: Report advertised link modes on 40GBASE_SR4Adam Ludkiewicz1-1/+6
Defined the advertised link mode field for 40000baseSR4_Full for use with ethtool. Signed-off-by: Adam Ludkiewicz <adam.ludkiewicz@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2019-04-16i40e: The driver now prints the API version in error messageAdam Ludkiewicz1-3/+15
Added the API version in the error message for clarity. Signed-off-by: Adam Ludkiewicz <adam.ludkiewicz@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2019-04-16i40e: Changed maximum supported FW API version to 1.8Adam Ludkiewicz2-3/+3
A new FW has been released, which uses API version 1.8. Signed-off-by: Adam Ludkiewicz <adam.ludkiewicz@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2019-04-16i40e: Remove misleading messages for untrusted VFGrzegorz Siwik1-5/+16
Removed misleading messages when untrusted VF tries to add more addresses than NIC limit Signed-off-by: Grzegorz Siwik <grzegorz.siwik@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2019-04-16i40e: Update i40e_init_dcb to return correct errorChinh T Cao3-19/+13
Modify the i40e_init_dcb to return the correct error when LLDP or DCBX is not in operational state. Signed-off-by: Chinh T Cao <chinh.t.cao@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2019-04-16i40e: Fix for 10G ports LED not blinkingPiotr Marczak1-33/+0
On some hardware LEDs would not blink after command 'ethtool -p {eth-port}' in certain circumstances. Now, function does not care about the activity of the LED (though still preserves its state) but forcibly executes identification blinking and then restores the LED state. Signed-off-by: Piotr Marczak <piotr.marczak@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2019-04-16i40e: save PTP time before a device resetJacob Keller3-4/+63
In the case where PTP is running on the hardware clock, but the kernel system time is not being synced, a device reset can mess up the clock time. This occurs because we reset the clock time based on the kernel time every reset. This causes us to potentially completely reset the PTP time, and can cause unexpected behavior in programs like ptp4l. Avoid this by saving the PTP time prior to device reset, and then restoring using that time after the reset. Directly restoring the PTP time we saved isn't perfect, because time should have continued running, but the clock will essentially be stopped during the reset. This is still better than the current solution of assuming that the PTP HW clock is synced to the CLOCK_REALTIME. We can do even better, by saving the ktime and calculating a differential, using ktime_get(). This is based on CLOCK_MONOTONIC, and allows us to get a fairly precise measure of the time difference between saving and restoring the time. Using this, we can update the saved PTP time, and use that as the value to write to the hardware clock registers. This, of course is not perfect. However, it does help ensure that the PTP time is restored as close as feasible to the time it should have been if the reset had not occurred. During device initialization, continue using the system time as the source for the creation of the PTP clock, since this is the best known current time source at driver load. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2019-04-16i40e: don't allow changes to HW VLAN stripping on active port VLANsNicholas Nunley1-0/+8
Modifying the VLAN stripping options when a port VLAN is configured will break traffic for the VSI, and conceptually doesn't make sense, so don't allow this. Signed-off-by: Nicholas Nunley <nicholas.d.nunley@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2019-04-16i40e: Implement DDP support in i40e driverAleksandr Loktionov8-22/+769
This patch introduces DDP (Dynamic Device Personalization) which allows loading profiles that change the way internal parser interprets processed frames. To load DDP profiles it utilizes ethtool flash feature. The files with recipes must be located in /var/lib/firmware directory. Afterwards the recipe can be loaded by invoking: ethtool -f <if_name> <file_name> 100 ethtool -f <if_name> - 100 See further details of this feature in the i40e documentation, or visit https://www.intel.com/content/www/us/en/architecture-and-technology/ethernet/dynamic-device-personalization-brief.html The driver shall verify DDP profile can be loaded in accordance with the rules: * Package with Group ID 0 are exclusive and can only be loaded the first. * Packages with Group ID 0x01-0xFE can only be loaded simultaneously with the packages from the same group. * Packages with Group ID 0xFF are compatible with all other packages. Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2019-04-16i40e: Queues are reserved despite "Invalid argument" errorAdam Ludkiewicz1-0/+3
Added a new local variable in the i40e_setup_tc function named old_queue_pairs so num_queue_pairs can be restored to the correct value in case configuring queue channels fails. Additionally, moved the exit label in the i40e_setup_tc function so the if (need_reset) block can be executed. Also, fixed data packing in the i40e_setup_tc function. Signed-off-by: Adam Ludkiewicz <adam.ludkiewicz@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2019-04-15Merge branch 'hsr-next'David S. Miller5-29/+36
Murali Karicheri says: ==================== net: hsr: updates from internal tree This series picks commit from our internal kernel tree. Patch 1/3 fixes a file name issue introduced in my previous series. History: v2: fixed patch 3/3 by moving stats update to inside hsr_forward_skb() ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-15net: hsr: add tx stats for master interfaceMurali Karicheri1-0/+7
Add tx stats to hsr interface. Without this ifconfig for hsr interface doesn't show tx packet stats. Signed-off-by: Murali Karicheri <m-karicheri2@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-15net: hsr: fix debugfs path to support multiple interfacesMurali Karicheri3-9/+9
Fix the path of hsr debugfs root directory to use the net device name so that it can work with multiple interfaces. While at it, also fix some typos. Signed-off-by: Murali Karicheri <m-karicheri2@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-15net: hsr: fix naming of file and functionsMurali Karicheri4-24/+24
Fix the file name and functions to match with existing implementation. Signed-off-by: Murali Karicheri <m-karicheri2@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-15net: phy: switch drivers to use dynamic feature detectionHeiner Kallweit30-120/+120
Recently genphy_read_abilities() has been added that dynamically detects clause 22 PHY abilities. I *think* this detection should work with all supported PHY's, at least for the ones with basic features sets, i.e. PHY_BASIC_FEATURES and PHY_GBIT_FEATURES. So let's remove setting these features explicitly and rely on phylib feature detection. I don't have access to most of these PHY's, therefore I'd appreciate regression testing. v2: - make the feature constant a comment so that readers know which features are supported by the respective PHY Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Tested-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-15Merge branch 'nfp-Flower-flow-merging'David S. Miller11-53/+1016
Simon Horman says: ==================== nfp: Flower flow merging John Hurley says, These patches deal with 'implicit recirculation' on the NFP. This is a firmware feature whereby a packet egresses to an 'internal' port meaning that it will recirculate back to the header extract phase with the 'internal' port now marked as its ingress port. This internal port can then be matched on by another rule. This process simulates how OvS datapath outputs to an internal port. The FW traces the packet's recirculation route and sends a 'merge hint' to the driver telling it which flows it matched against. The driver can then decide if these flows can be merged to a single rule and offloaded. The patches deal with the following issues: - assigning/freeing IDs to/from each of these new internal ports - offloading rules that match on internal ports - offloading neighbour table entries whose egress port is internal - handling fallback traffic with an internal port as ingress - using merge hints to create 'faster path' flows and tracking stats etc. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-15nfp: flower: offload merge flowsJohn Hurley4-13/+126
A merge flow is formed from 2 sub flows. The match fields of the merge are the same as the first sub flow that has formed it, with the actions being a combination of the first and second sub flow. Therefore, a merge flow should replace sub flow 1 when offloaded. Offload valid merge flows by using a new 'flow mod' message type to replace an existing offloaded rule. Track the deletion of sub flows that are linked to a merge flow and revert offloaded merge rules if required. Signed-off-by: John Hurley <john.hurley@netronome.com> Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-15nfp: flower: support stats update for merge flowsJohn Hurley2-0/+117
With the merging of 2 sub flows, a new 'merge' flow will be created and written to FW. The TC layer is unaware that the merge flow exists and will request stats from the sub flows. Conversely, the FW treats a merge rule the same as any other rule and sends stats updates to the NFP driver. Add links between merge flows and their sub flows. Use these links to pass merge flow stats updates from FW to the underlying sub flows, ensuring TC stats requests are handled correctly. The updating of sub flow stats is done on (the less time critcal) TC stats requests rather than on FW stats update. Signed-off-by: John Hurley <john.hurley@netronome.com> Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-15nfp: flower: generate merge flow ruleJohn Hurley2-1/+150
When combining 2 sub_flows to a single 'merge flow' (assuming the merge is valid), the merge flow should contain the same match fields as sub_flow 1 with actions derived from a combination of sub_flows 1 and 2. This action list should have all actions from sub_flow 1 with the exception of the output action that triggered the 'implicit recirculation' by sending to an internal port, followed by all actions of sub_flow 2. Any pre-actions in either sub_flow should feature at the start of the action list. Add code to generate a new merge flow and populate the match and actions fields based on the sub_flows. The offloading of the flow is left to future patches. Signed-off-by: John Hurley <john.hurley@netronome.com> Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-15nfp: flower: validate merge hint flowsJohn Hurley1-0/+228
Two flows can be merged if the second flow (after recirculation) matches on bits that are either matched on or explicitly set by the first flow. This means that if a packet hits flow 1 and recirculates then it is guaranteed to hit flow 2. Add a 'can_merge' function that determines if 2 sub_flows in a merge hint can be validly merged to a single flow. Signed-off-by: John Hurley <john.hurley@netronome.com> Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-15nfp: flower: handle merge hint messagesJohn Hurley4-1/+78
If a merge hint is received containing 2 flows that are matched via an implicit recirculation (sending to and matching on an internal port), fw reports that the flows (called sub_flows) may be able to be combined to a single flow. Add infastructure to accept and process merge hint messages. The actual merging of the flows is left as a stub call. Signed-off-by: John Hurley <john.hurley@netronome.com> Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-15nfp: flower: get flows by host contextJohn Hurley2-16/+89
Each flow is given a context ID that the fw uses (along with its cookie) to identity the flow. The flows stats are updated by the fw via this ID which is a reference to a pre-allocated array entry. In preparation for flow merge code, enable the nfp_fl_payload structure to be accessed via this stats context ID. Rather than increasing the memory requirements of the pre-allocated array, add a new rhashtable to associate each active stats context ID with its rule payload. While adding new code to the compile metadata functions, slightly restructure the existing function to allow for cleaner, easier to read error handling. Signed-off-by: John Hurley <john.hurley@netronome.com> Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-15nfp: flower: allow tunnels to output to internal portJohn Hurley1-3/+4
The neighbour table in the FW only accepts next hop entries if the egress port is an nfp repr. Modify this to allow the next hop to be an internal port. This means that if a packet is to egress to that port, it will recirculate back into the system with the internal port becoming its ingress port. Signed-off-by: John Hurley <john.hurley@netronome.com> Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-15nfp: flower: support fallback packets from internal portsJohn Hurley1-2/+24
FW may receive a packet with its ingress port marked as an internal port. If a rule does not exist to match on this port, the packet will be sent to the NFP driver. Modify the flower app to detect packets from such internal ports and convert the ingress port to the correct kernel space netdev. At this point, it is assumed that fallback packets from internal ports are to be sent out said port. Therefore, set the redir_egress bool to true on detection of these ports. Signed-off-by: John Hurley <john.hurley@netronome.com> Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-15nfp: allow fallback packets from non-reprsJohn Hurley6-16/+30
Currently, it is assumed that fallback packets will be from reprs. Modify this to allow an app to receive non-repr ports from the fallback channel - e.g. from an internal port. If such a packet is received, do not update repr stats. Change the naming function calls so as not to imply it will always be a repr netdev returned. Add the option to set a bool value to redirect a fallback packet out the returned port rather than RXing it. Setting of this bool in subsequent patches allows the handling of packets falling back when they are due to egress an internal port. Signed-off-by: John Hurley <john.hurley@netronome.com> Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-15nfp: flower: allow offloading of matches on 'internal' portsJohn Hurley5-9/+153
Recent FW modifications allow the offloading of non repr ports. These ports exist internally on the NFP. So if a rule outputs to an 'internal' port, then the packet will recirculate back into the system but will now have this internal port as it's incoming port. These ports are indicated by a specific type field combined with an 8 bit port id. Add private app data to assign additional port ids for use in offloads. Provide functions to lookup or create new ids when a rule attempts to match on an internal netdev - the only internal netdevs currently supported are of type openvswitch. Have a netdev notifier to release port ids on netdev unregister. OvS offloads rules that match on internal ports as TC egress filters. Ensure that such rules are accepted by the driver. Signed-off-by: John Hurley <john.hurley@netronome.com> Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-15nfp: flower: turn on recirc and merge hint support in firmwareJohn Hurley4-0/+25
Write to a FW symbol to indicate that the driver supports flow merging. If this symbol does not exist then flow merging and recirculation is not supported on the FW. If support is available, add a stub to deal with FW to kernel merge hint messages. Full flow merging requires the firmware to support of flow mods. If it does not, then do not attempt to 'turn on' flow merging. Signed-off-by: John Hurley <john.hurley@netronome.com> Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-15Merge branch 'hns3-next'David S. Miller2-3/+5
Huazhong Tan says: ==================== net: hns3: fixes sparse: warning and type error This patchset fixes a sparse warning and a overflow problem. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>