1. 17 Nov, 2016 3 commits
  2. 16 Nov, 2016 37 commits
    • Eric Dumazet's avatar
      netpoll: more efficient locking · 89c4b442
      Eric Dumazet authored
      Callers of netpoll_poll_lock() own NAPI_STATE_SCHED
      
      Callers of netpoll_poll_unlock() have BH blocked between
      the NAPI_STATE_SCHED being cleared and poll_lock is released.
      
      We can avoid the spinlock which has no contention, and use cmpxchg()
      on poll_owner which we need to set anyway.
      
      This removes a possible lockdep violation after the cited commit,
      since sk_busy_loop() re-enables BH before calling busy_poll_stop()
      
      Fixes: 217f6974 ("net: busy-poll: allow preemption in sk_busy_loop()")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      89c4b442
    • Rafal Ozieblo's avatar
      cadence: Add LSO support. · 1629dd4f
      Rafal Ozieblo authored
      New Cadence GEM hardware support Large Segment Offload (LSO):
      TCP segmentation offload (TSO) as well as UDP fragmentation
      offload (UFO). Support for those features was added to the driver.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1629dd4f
    • Arnd Bergmann's avatar
      netronome: don't access real_num_rx_queues directly · 08348995
      Arnd Bergmann authored
      The netdev->real_num_rx_queues setting is only available if CONFIG_SYSFS
      is enabled, so we now get a build failure when that is turned off:
      
      netronome/nfp/nfp_net_common.c: In function 'nfp_net_ring_swap_enable':
      netronome/nfp/nfp_net_common.c:2489:18: error: 'struct net_device' has no member named 'real_num_rx_queues'; did you mean 'real_num_tx_queues'?
      
      As far as I can tell, the check here is only used as an optimization that
      we can skip in order to fix the compilation. If sysfs is disabled,
      the following netif_set_real_num_rx_queues() has no effect.
      
      Fixes: 164d1e9e ("nfp: add support for ethtool .set_channels")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Acked-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      08348995
    • Eric Dumazet's avatar
      sfc: remove napi_hash_del() call · 973334a1
      Eric Dumazet authored
      Calling napi_hash_del() after netif_napi_del() is pointless.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Edward Cree <ecree@solarflare.com>
      Cc: Bert Kenward <bkenward@solarflare.com>
      Acked-by: default avatarBert Kenward <bkenward@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      973334a1
    • David Lebrun's avatar
      lwtunnel: subtract tunnel headroom from mtu on output redirect · a23a8f5b
      David Lebrun authored
      This patch changes the lwtunnel_headroom() function which is called
      in ipv4_mtu() and ip6_mtu(), to also return the correct headroom
      value when the lwtunnel state is OUTPUT_REDIRECT.
      
      This patch enables e.g. SR-IPv6 encapsulations to work without
      manually setting the route mtu.
      Acked-by: default avatarRoopa Prabhu <roopa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid Lebrun <david.lebrun@uclouvain.be>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a23a8f5b
    • Ido Schimmel's avatar
      mlxsw: spectrum_router: Adjust placement of FIB abort warning · d331d303
      Ido Schimmel authored
      The recent merge commit bb598c1b ("Merge
      git://git.kernel.org/pub/scm/linux/kernel/git/davem/net") would cause
      the FIB abort warning to fire whenever we flush the FIB tables - either
      during module removal or actual abort.
      
      Move it back to its rightful location in the FIB abort function.
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d331d303
    • Andrew Lunn's avatar
      net: dsa: mv88e6xxx: Respect SPEED_UNFORCED, don't set force bit · 0b6e3d03
      Andrew Lunn authored
      The SPEED_UNFORCED indicates the MAC & PHY should perform
      auto-negotiation to determine a speed which works. If this is called
      for, don't set the force bit. If it is set, the MAC actually does
      10Gbps, why the internal PHYs don't support.
      Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0b6e3d03
    • David S. Miller's avatar
      Merge branch 'amd-xgbe-next' · a11485b7
      David S. Miller authored
      Tom Lendacky says:
      
      ====================
      amd-xgbe: AMD XGBE driver updates 2016-11-15
      
      This patch series addresses some minor issues found in the recently
      accepted patch series for the AMD XGBE driver.
      
      The following fixes are included in this driver update series:
      
      - Fix a possibly uninitialized variable in the debugfs support
      - Fix the GPIO pin number constraint check
      
      This patch series is based on net-next.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a11485b7
    • Lendacky, Thomas's avatar
      amd-xgbe: Fix maximum GPIO value check · 1c1f619e
      Lendacky, Thomas authored
      The GPIO support in the hardware allows for up to 16 GPIO pins, enumerated
      from 0 to 15.  The driver uses the wrong value (16) to validate the GPIO
      pin range in the routines to set and clear the GPIO output pins.  Update
      the code to use the correct value (15).
      Reported-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1c1f619e
    • Lendacky, Thomas's avatar
      amd-xgbe: Fix possible uninitialized variable · 5e4cbaa7
      Lendacky, Thomas authored
      The debugfs support in the driver uses a common routine to write the
      debugfs values. In this routine, if the input file position is non-zero
      then the write routine will not return an error and an output parameter
      will not have been set. Because an error isn't returned an uninitialized
      value will be written into a register.
      
      Fix the common write routine to return an error if the input file position
      is non-zero, which will propagate back to the caller.
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5e4cbaa7
    • David S. Miller's avatar
      Merge branch 'nway-reset' · 54dbf3a5
      David S. Miller authored
      Florian Fainelli says:
      
      ====================
      net: Implenent ethtool::nway_reset for a few drivers
      
      This patch series depends on "net: phy: Centralize auto-negotation restart"
      since it provides phy_ethtool_nway_reset as a helper function.
      
      The drivers here already support PHYLIB, so there really is no reason why
      restarting auto-negotiation would not be possible with these.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      54dbf3a5
    • Florian Fainelli's avatar
      net: ethernet: marvell: pxa168_eth: Implement ethtool::nway_reset · 13f0ac41
      Florian Fainelli authored
      Implement ethtool::nway_reset using phy_ethtool_nway_reset. We are
      already using dev->phydev all over the place so this comes for free.
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      13f0ac41
    • Florian Fainelli's avatar
      net: ethernet: mvpp2: Implement ethtool::nway_reset · 00606c49
      Florian Fainelli authored
      Implement ethtool::nway_reset using phy_ethtool_nway_reset. We are
      already using dev->phydev all over the place so this comes for free.
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      00606c49
    • Florian Fainelli's avatar
      net: ethernet: mvneta: Implement ethtool::nway_reset · 5489ee89
      Florian Fainelli authored
      Implement ethtool::nway_reset using phy_ethtool_nway_reset. We are
      already using dev->phydev all over the place so this comes for free.
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5489ee89
    • Florian Fainelli's avatar
      net: ethoc: Implement ethtool::nway_reset · 3d3ba568
      Florian Fainelli authored
      Implement ethtool::nway_reset using phy_ethtool_nway_reset. We are
      already using dev->phydev all over the place so this comes for free.
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Reviewed-by: default avatarTobias Klauser <tklauser@distanz.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3d3ba568
    • Florian Fainelli's avatar
      net: stmmac: Implement ethtool::nway_reset · cab247e9
      Florian Fainelli authored
      Utilize the generic phy_ethtool_nway_reset() helper function to
      implement an autonegotiation restart.
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cab247e9
    • David S. Miller's avatar
      Merge branch 'busypoll-preemption-and-other-optimizations' · fc3f9146
      David S. Miller authored
      Eric Dumazet says:
      
      ====================
      net: busy-poll: allow preemption and other optimizations
      
      It is time to have preemption points in sk_busy_loop() and improve
      its scalability.
      
      Also napi_complete() and friends can tell drivers when it is safe to
      not re-enable device interrupts, saving some overhead under
      high busy polling.
      
      mlx4 and bnx2x are changed accordingly, to show how this busy polling
      status can be exploited by drivers.
      
      Next steps will implement Zach Brown suggestion, where NAPI polling
      would be enabled all the time for some chosen queues.
      This is needed for efficient epoll() support anyway.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fc3f9146
    • Eric Dumazet's avatar
      bnx2x: switch to napi_complete_done() · 80f1c21c
      Eric Dumazet authored
      Switch from napi_complete() to napi_complete_done()
      for better GRO support (gro_flush_timeout) and core NAPI
      features.
      
      Do not rearm interrupts if we are busy polling,
      to reduce bus and interrupts overhead.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Willem de Bruijn <willemb@google.com>
      Cc: Adam Belay <abelay@google.com>
      Cc: Tariq Toukan <tariqt@mellanox.com>
      Cc: Yuval Mintz <Yuval.Mintz@cavium.com>
      Cc: Ariel Elior <ariel.elior@cavium.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      80f1c21c
    • Eric Dumazet's avatar
      net/mlx4_en: use napi_complete_done() return value · 2e713283
      Eric Dumazet authored
      Do not rearm interrupts if we are busy polling.
      
      mlx4 uses separate CQ for TX and RX, so number of TX interrupts
      does not change, unfortunately.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Willem de Bruijn <willemb@google.com>
      Cc: Adam Belay <abelay@google.com>
      Cc: Tariq Toukan <tariqt@mellanox.com>
      Cc: Yuval Mintz <Yuval.Mintz@cavium.com>
      Cc: Ariel Elior <ariel.elior@cavium.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2e713283
    • Eric Dumazet's avatar
      net: busy-poll: return busypolling status to drivers · 364b6055
      Eric Dumazet authored
      NAPI drivers use napi_complete_done() or napi_complete() when
      they drained RX ring and right before re-enabling device interrupts.
      
      In busy polling, we can avoid interrupts being delivered since
      we are polling RX ring in a controlled loop.
      
      Drivers can chose to use napi_complete_done() return value
      to reduce interrupts overhead while busy polling is active.
      
      This is optional, legacy drivers should work fine even
      if not updated.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Willem de Bruijn <willemb@google.com>
      Cc: Adam Belay <abelay@google.com>
      Cc: Tariq Toukan <tariqt@mellanox.com>
      Cc: Yuval Mintz <Yuval.Mintz@cavium.com>
      Cc: Ariel Elior <ariel.elior@cavium.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      364b6055
    • Eric Dumazet's avatar
      net: busy-poll: remove need_resched() from sk_can_busy_loop() · 21cb84c4
      Eric Dumazet authored
      Now sk_busy_loop() can schedule by itself, we can remove
      need_resched() check from sk_can_busy_loop()
      
      Also add a const to its struct sock parameter.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Willem de Bruijn <willemb@google.com>
      Cc: Adam Belay <abelay@google.com>
      Cc: Tariq Toukan <tariqt@mellanox.com>
      Cc: Yuval Mintz <Yuval.Mintz@cavium.com>
      Cc: Ariel Elior <ariel.elior@cavium.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      21cb84c4
    • Eric Dumazet's avatar
      net: busy-poll: allow preemption in sk_busy_loop() · 217f6974
      Eric Dumazet authored
      After commit 4cd13c21 ("softirq: Let ksoftirqd do its job"),
      sk_busy_loop() needs a bit of care :
      softirqs might be delayed since we do not allow preemption yet.
      
      This patch adds preemptiom points in sk_busy_loop(),
      and makes sure no unnecessary cache line dirtying
      or atomic operations are done while looping.
      
      A new flag is added into napi->state : NAPI_STATE_IN_BUSY_POLL
      
      This prevents napi_complete_done() from clearing NAPIF_STATE_SCHED,
      so that sk_busy_loop() does not have to grab it again.
      
      Similarly, netpoll_poll_lock() is done one time.
      
      This gives about 10 to 20 % improvement in various busy polling
      tests, especially when many threads are busy polling in
      configurations with large number of NIC queues.
      
      This should allow experimenting with bigger delays without
      hurting overall latencies.
      
      Tested:
       On a 40Gb mlx4 NIC, 32 RX/TX queues.
      
       echo 70 >/proc/sys/net/core/busy_read
       for i in `seq 1 40`; do echo -n $i: ; ./super_netperf $i -H lpaa24 -t UDP_RR -- -N -n; done
      
          Before:      After:
       1:   90072   92819
       2:  157289  184007
       3:  235772  213504
       4:  344074  357513
       5:  394755  458267
       6:  461151  487819
       7:  549116  625963
       8:  544423  716219
       9:  720460  738446
      10:  794686  837612
      11:  915998  923960
      12:  937507  925107
      13: 1019677  971506
      14: 1046831 1113650
      15: 1114154 1148902
      16: 1105221 1179263
      17: 1266552 1299585
      18: 1258454 1383817
      19: 1341453 1312194
      20: 1363557 1488487
      21: 1387979 1501004
      22: 1417552 1601683
      23: 1550049 1642002
      24: 1568876 1601915
      25: 1560239 1683607
      26: 1640207 1745211
      27: 1706540 1723574
      28: 1638518 1722036
      29: 1734309 1757447
      30: 1782007 1855436
      31: 1724806 1888539
      32: 1717716 1944297
      33: 1778716 1869118
      34: 1805738 1983466
      35: 1815694 2020758
      36: 1893059 2035632
      37: 1843406 2034653
      38: 1888830 2086580
      39: 1972827 2143567
      40: 1877729 2181851
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Willem de Bruijn <willemb@google.com>
      Cc: Adam Belay <abelay@google.com>
      Cc: Tariq Toukan <tariqt@mellanox.com>
      Cc: Yuval Mintz <Yuval.Mintz@cavium.com>
      Cc: Ariel Elior <ariel.elior@cavium.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      217f6974
    • Martin KaFai Lau's avatar
      bpf: Fix compilation warning in __bpf_lru_list_rotate_inactive · 2874aa2e
      Martin KaFai Lau authored
      gcc-6.2.1 gives the following warning:
      kernel/bpf/bpf_lru_list.c: In function ‘__bpf_lru_list_rotate_inactive.isra.3’:
      kernel/bpf/bpf_lru_list.c:201:28: warning: ‘next’ may be used uninitialized in this function [-Wmaybe-uninitialized]
      
      The "next" is currently initialized in the while() loop which must have >=1
      iterations.
      
      This patch initializes next to get rid of the compiler warning.
      
      Fixes: 3a08c2fd ("bpf: LRU List")
      Reported-by: default avatarDavid Miller <davem@davemloft.net>
      Signed-off-by: default avatarMartin KaFai Lau <kafai@fb.com>
      Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2874aa2e
    • David Lebrun's avatar
      ipv6: sr: add option to control lwtunnel support · 46738b13
      David Lebrun authored
      This patch adds a new option CONFIG_IPV6_SEG6_LWTUNNEL to enable/disable
      support of encapsulation with the lightweight tunnels. When this option
      is enabled, CONFIG_LWTUNNEL is automatically selected.
      
      Fix commit 6c8702c6 ("ipv6: sr: add support for SRH encapsulation and injection with lwtunnels")
      
      Without a proper option to control lwtunnel support for SR-IPv6, if
      CONFIG_LWTUNNEL=n then the IPv6 initialization fails as a consequence
      of seg6_iptunnel_init() failure with EOPNOTSUPP:
      
      NET: Registered protocol family 10
      IPv6: Attempt to unregister permanent protocol 6
      IPv6: Attempt to unregister permanent protocol 136
      IPv6: Attempt to unregister permanent protocol 17
      NET: Unregistered protocol family 10
      
      Tested (compiling, booting, and loading ipv6 module when relevant)
      with possible combinations of CONFIG_IPV6={y,m,n},
      CONFIG_IPV6_SEG6_LWTUNNEL={y,n} and CONFIG_LWTUNNEL={y,n}.
      Reported-by: default avatarLorenzo Colitti <lorenzo@google.com>
      Suggested-by: default avatarRoopa Prabhu <roopa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid Lebrun <david.lebrun@uclouvain.be>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      46738b13
    • David S. Miller's avatar
      Merge branch 'alx-multiqueue-support' · 21b23dae
      David S. Miller authored
      Tobias Regnery says:
      
      ====================
      alx: add multi queue support
      
      This patchset lays the groundwork for multi queue support in the alx driver
      and enables multi queue support for the tx path by default. The hardware
      supports up to 4 tx queues.
      
      Benefits are better utilization of multi core cpus and the usage of the
      msi-x support by default which splits the handling of rx / tx and misc
      other interrupts.
      
      The rx path is a little bit harder because apparently (based on the limited
      information from the downstream driver) the hardware supports up to 8 rss
      queues but only has one hardware descriptor ring on the rx side. So the rx
      path will be part of another patchset.
      
      Tested on my AR8161 ethernet adapter with different tests:
      - there are no regressions observed during my daily usage
      - iperf tcp and udp tests shows no performance regressions
      - netperf TCP_RR and UDP_RR shows a slight performance increase of about
        1-2% with this patchset applied
      
      This work is based on the downstream driver at github.com/qca/alx
      
      Changes in V2:
      	- drop unneeded casts in alx_alloc_rx_ring (Patch 1)
      	- add additional information about testing and benefit to the
      	  changelog
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      21b23dae
    • Tobias Regnery's avatar
      alx: enable multiple tx queues · d768319c
      Tobias Regnery authored
      Enable multiple tx queues by default based on the number of online cpus. The
      hardware supports up to four tx queues.
      
      Based on the downstream driver at github.com/qca/alx
      Signed-off-by: default avatarTobias Regnery <tobias.regnery@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d768319c
    • Tobias Regnery's avatar
      alx: enable msi-x interrupts by default · f58e0f77
      Tobias Regnery authored
      Remove the module parameter to enable msi-x support and enable msi-x
      interrupts unconditionally by default. This is a preparatory step to enable
      multi queue support by default, because this is only working with msi-x
      interrupts.
      Signed-off-by: default avatarTobias Regnery <tobias.regnery@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f58e0f77
    • Tobias Regnery's avatar
      alx: prepare tx path for multi queue support · 2e06826b
      Tobias Regnery authored
      This patch prepares the tx path to send data on multiple tx queues. It
      introduces per queue register adresses and uses them in the alx_tx_queue
      structs.
      
      There are new helper functions for the queue mapping in the tx path.
      
      Based on the downstream driver at github.com/qca/alx
      Signed-off-by: default avatarTobias Regnery <tobias.regnery@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2e06826b
    • Tobias Regnery's avatar
      alx: prepare resource allocation for multi queue support · a4076d34
      Tobias Regnery authored
      Allocate, initialise and free alx_tx_queue structs based on the number of
      alx_napi structures. Also increase the size of the descriptor memory based
      on the number of tx queues in use.
      
      Based on the downstream driver at github.com/qca/alx
      Signed-off-by: default avatarTobias Regnery <tobias.regnery@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a4076d34
    • Tobias Regnery's avatar
      alx: prepare interrupt functions for multiple queues · e0eac254
      Tobias Regnery authored
      Extend the interrupt bringup code and the interrupt handler for msi-x
      interrupts in order to handle multiple queues.
      
      We must change the poll function because with multiple queues it is possible
      that an alx_napi structure has only a tx or only a rx queue pointer.
      
      Based on the downstream driver at github.com/qca/alx
      Signed-off-by: default avatarTobias Regnery <tobias.regnery@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e0eac254
    • Tobias Regnery's avatar
      alx: switch to per queue data structures · 702e8418
      Tobias Regnery authored
      Remove the tx and rx queue structures from the alx_priv structure and switch
      everything over to the queue pointers in the alx_napi structure.
      
      Based on the downstream driver at github.com/qca/alx
      Signed-off-by: default avatarTobias Regnery <tobias.regnery@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      702e8418
    • Tobias Regnery's avatar
      alx: add ability to allocate and free alx_napi structures · b0999223
      Tobias Regnery authored
      Add new functions to allocate and free the alx_napi structures and use them
      in __alx_open and __alx_stop. We only allocate one of these structures for
      now, as the rest of the driver is not yet ready for multiple queues.
      
      We switch over the setup of the interrupt mask and the call to netif_napi_add
      to the new function because we must adjust these later on a per queue basis.
      
      Based on the downstream driver at github.com/qca/alx
      Signed-off-by: default avatarTobias Regnery <tobias.regnery@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b0999223
    • Tobias Regnery's avatar
      alx: extend data structures for multi queue support · bccffcf7
      Tobias Regnery authored
      Extend the driver data structures to be able to handle multiple queues.
      
      Based on the downstream driver at github.com/qca/alx
      Signed-off-by: default avatarTobias Regnery <tobias.regnery@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bccffcf7
    • Tobias Regnery's avatar
      alx: refactor descriptor allocation · 8c2a4c8e
      Tobias Regnery authored
      Split the allocation of descriptor memory and the buffer allocation into a
      tx and rx function. This is in preparation for multiple queues where we
      need to iterate over the new functions.
      
      While at it drop the unneeded casting on the rx side.
      Signed-off-by: default avatarTobias Regnery <tobias.regnery@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8c2a4c8e
    • David S. Miller's avatar
      Merge branch 'dpaa_eth-next' · 11b8ad33
      David S. Miller authored
      Madalin Bucur says:
      
      ====================
      dpaa_eth: Add the QorIQ DPAA Ethernet driver
      
      This patch series adds the Ethernet driver for the Freescale
      QorIQ Data Path Acceleration Architecture (DPAA).
      
      This version includes changes following the feedback received
      on previous versions from Eric Dumazet, Bob Cochran, Joe Perches,
      Paul Bolle, Joakim Tjernlund, Scott Wood, David Miller - thank you.
      
      Together with the driver a managed version of alloc_percpu
      is provided that simplifies the release of per-CPU memory.
      
      The Freescale DPAA architecture consists in a series of hardware
      blocks that support the Ethernet connectivity. The Ethernet driver
      depends upon the following drivers that are currently in the Linux
      kernel:
       - Peripheral Access Memory Unit (PAMU)
          drivers/iommu/fsl_*
       - Frame Manager (FMan) added in v4.4
          drivers/net/ethernet/freescale/fman
       - Queue Manager (QMan), Buffer Manager (BMan) added in v4.9-rc1
          drivers/soc/fsl/qbman
      
      dpaa_eth interfaces mapping to FMan MACs:
      
        dpaa_eth       /eth0\     ...       /ethN\
        driver        |      |             |      |
        -------------   ----   -----------   ----   -------------
             -Ports  / Tx  Rx \    ...    / Tx  Rx \
        FMan        |          |         |          |
             -MACs  |   MAC0   |         |   MACN   |
                   /   dtsec0   \  ...  /   dtsecN   \ (or tgec)
                  /              \     /              \(or memac)
        ---------  --------------  ---  --------------  ---------
            FMan, FMan Port, FMan SP, FMan MURAM drivers
        ---------------------------------------------------------
            FMan HW blocks: MURAM, MACs, Ports, SP
        ---------------------------------------------------------
      
      dpaa_eth relation to QMan, FMan:
                    ________________________________
        dpaa_eth   /            eth0                \
        driver    /                                  \
        ---------   -^-   -^-   -^-   ---    ---------
        QMan driver / \   / \   / \  \   /  | BMan    |
                   |Rx | |Rx | |Tx | |Tx |  | driver  |
        ---------  |Dfl| |Err| |Cnf| |FQs|  |         |
        QMan HW    |FQ | |FQ | |FQ | |   |  |         |
                   /   \ /   \ /   \  \ /   |         |
        ---------   ---   ---   ---   -v-    ---------
                  |        FMan QMI         |         |
                  | FMan HW       FMan BMI  | BMan HW |
                    -----------------------   --------
      
      where the acronyms used above (and in the code) are:
      DPAA = Data Path Acceleration Architecture
      FMan = DPAA Frame Manager
      QMan = DPAA Queue Manager
      BMan = DPAA Buffers Manager
      QMI = QMan interface in FMan
      BMI = BMan interface in FMan
      FMan SP = FMan Storage Profiles
      MURAM = Multi-user RAM in FMan
      FQ = QMan Frame Queue
      Rx Dfl FQ = default reception FQ
      Rx Err FQ = Rx error frames FQ
      Tx Cnf FQ = Tx confirmation FQ
      Tx FQs = transmission frame queues
      dtsec = datapath three speed Ethernet controller (10/100/1000 Mbps)
      tgec = ten gigabit Ethernet controller (10 Gbps)
      memac = multirate Ethernet MAC (10/100/1000/10000)
      
      Changes from v7:
       - remove the debug option to use a common buffer pool for all the
         interfaces
      
      Changed from v6:
       - fixed an issue on an error path in dpaa_set_mac_address()
       - removed NDO operation definitions that were not needed
       - sorted the local variable declarations
       - cleaned up a few checkpatch checks
       - removed friendly network interface naming code
      
      Changes from v5:
       - adapt to the latest Q/BMan drivers API
       - use build_skb() on Rx path instead of buffer pool refill path
       - proper support for multiple buffer pools
       - align function, variable names, code cleanup
       - driver file structure cleanup
      
      Changes from v4:
       - addressed feedback from Scott Wood and Joe Perches
       - fixed spelling
       - fixed leak of uninitialized stack to userspace
       - fix prints
       - replace raw_cpu_ptr() with this_cpu_ptr()
       - remove _s from the end of structure names
       - remove underscores at start of functions, goto labels
       - remove likely in error paths
       - use container_of() instead of open casts
       - remove priv from the driver name
       - move return type on same line with function name
       - drop DPA_READ_SKB_PTR/DPA_WRITE_SKB_PTR
      
      Changes from v3:
       - removed bogus delay and comment in .ndo_stop implementation
       - addressed minor issues reported by David Miller
      
      Changes from v2:
       - removed debugfs, moved exports to ethtool statistics
       - removed congestion groups Kconfig params
      
      Changes from v1:
       - bpool level Kconfig options removed
       - print format using pr_fmt, cleaned up prints
       - __hot/__cold removed
       - gratuitous unlikely() removed
       - code style aligned, consistent spacing for declarations
       - comment formatting
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      11b8ad33
    • Madalin Bucur's avatar
      arch/powerpc: Enable dpaa_eth · e0bd03d0
      Madalin Bucur authored
      Signed-off-by: default avatarMadalin Bucur <madalin.bucur@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e0bd03d0
    • Madalin Bucur's avatar
      arch/powerpc: Enable FSL_FMAN · 9256f21e
      Madalin Bucur authored
      Signed-off-by: default avatarMadalin Bucur <madalin.bucur@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9256f21e