1. 28 4月, 2016 13 次提交
    • D
      Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue · 2995aea5
      David S. Miller 提交于
      Jeff Kirsher says:
      
      ====================
      40GbE Intel Wired LAN Driver Updates 2016-04-27
      
      This series contains updates to i40e and i40evf.
      
      Alex Duyck cleans up the feature flags since they are becoming pretty
      "massive", the primary change being that we now build our features list
      around hw_encap_features.  Added support for IPIP and SIT offloads,
      which should improvement in throughput for IPIP and SIT tunnels with
      the offload enabled.
      
      Mitch adds support for configuring RSS on behalf of the VFs, which removes
      the burden of dealing with different hardware interfaces from the VF
      drivers and improves future compatibility.  Fix to ensure that we do not
      panic by checking that the vsi_res pointer is valid before dereferencing
      it, after which we can drink beer and eat peanuts.
      
      Shannon does come housekeeping in i40e_add_fdir_ethtool() in preparation
      for more cloud filter work.  Added flexibility to the nvmupdate
      facility by adding the ability to specify an AQ event opcode to wait on
      after Exec_AQ request.
      
      Michal adds device capability which defines if an update is available and
      if a security check is needed during the update process.
      
      Kamil just adds a device id to support X722 QSFP+ device.
      
      Greg fixes an issue where a mirror rule ID may be zero, so do not return
      invalid parameter when the user passes in a zero for a rule ID.  Adds
      support to steer packets to VSIs by VLAN tag alone while being in
      promiscuous mode for multicast and unicast MAC addresses.
      
      Jesse fixes the driver from offloading the VLAN tag into the skb any
      time there was a VLAN tag and the hardware stripping was enabled, to
      making sure it is enabled before put_tag.
      
      v2: Dropped patch 8 ("i40e: Allow user to change input set mask for flow
          director") while Kiran reworks a more generalized solution based
          on feedback from David Miller.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2995aea5
    • E
      net-rfs: fix false sharing accessing sd->input_queue_head · 501e7ef5
      Eric Dumazet 提交于
      sd->input_queue_head is incremented for each processed packet
      in process_backlog(), and read from other cpus performing
      Out Of Order avoidance in get_rps_cpu()
      
      Moving this field in a separate cache line keeps it mostly
      hot for the cpu in process_backlog(), as other cpus will
      only read it.
      
      In a stress test, process_backlog() was consuming 6.80 % of cpu cycles,
      and the patch reduced the cost to 0.65 %
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Acked-by: NTom Herbert <tom@herbertland.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      501e7ef5
    • A
      net: w5100: support W5500 · 35ef7d68
      Akinobu Mita 提交于
      This adds support for W5500 chip.
      
      W5500 has similar register and memory organization with W5100 and W5200.
      There are a few important differences listed below but it is still
      possible to share common code with W5100 and W5200.
      
      * W5500 register and memory are organized by multiple blocks.  Each one
      is selected by 16bits offset address and 5bits block select bits.
      
      But the existing register access operations take u16 address.  This change
      extends the addess by u32 address and put offset address to lower 16bits
      and block select bits to upper 16bits.
      
      This change also adds the offset addresses for socket register and TX/RX
      memory blocks to the driver private data structure in order to reduce
      conditional switches for each chip.
      
      * W5500 has the different register offset for socket interrupt mask
      register.  Newly added internal functions w5100_enable_intr() and
      w5100_disable_intr() take care of the diffrence.
      
      * W5500 has the different register offset for retry time-value register.
      But this register is only used to verify that the reset value is correctly
      read at initialization.  So move the verification to w5100_hw_reset()
      which already does different things for different chips.
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Cc: Mike Sinkovsky <msink@permonline.ru>
      Cc: David S. Miller <davem@davemloft.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      35ef7d68
    • A
      i40evf: Add driver support for promiscuous mode · 47d34839
      Anjali Singhai Jain 提交于
      Add necessary Linux Ethernet driver support for promiscuous mode
      operation. Add a flag so the VF knows it is in promiscuous mode
      and two state flags to discreetly track multicast and unicast
      promiscuous states.
      
      Change-Id: Ib2f2dc7a7582304fec90fc917ebb7ded21ba1de4
      Signed-off-by: NAnjali Singhai Jain <anjali.singhai@intel.com>
      Signed-off-by: NGreg Rose <gregory.v.rose@intel.com>
      Signed-off-by: NJesse Brandeburg <jesse.brandeburg@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      47d34839
    • A
      i40e: Add VF promiscuous mode driver support · 5676a8b9
      Anjali Singhai Jain 提交于
      Add infrastructure for Network Function Virtualization VLAN tagged
      packet steering feature.
      
      Change-Id: I9b873d8fcc253858e6baba65ac68ec5b9363944e
      Signed-off-by: NAnjali Singhai Jain <anjali.singhai@intel.com>
      Signed-off-by: NGreg Rose <gregory.v.rose@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      5676a8b9
    • G
      i40e: Add promiscuous on VLAN support · 6c41a760
      Greg Rose 提交于
      NFV use cases require the ability to steer packets to VSIs by VLAN tag
      alone while being in promiscuous mode for multicast and unicast MAC
      addresses.  These two new functions support that ability.
      Signed-off-by: NGreg Rose <gregory.v.rose@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      6c41a760
    • J
      i40e/i40evf: Only offload VLAN tag if enabled · a149f2c3
      Jesse Brandeburg 提交于
      The driver was offloading the VLAN tag into the skb
      any time there was a VLAN tag and the hardware stripping was
      enabled.  Just check to make sure it's enabled before put_tag.
      
      Change-Id: Ife95290c06edd9a616393b38679923938b382241
      Signed-off-by: NJesse Brandeburg <jesse.brandeburg@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      a149f2c3
    • G
      i40e: Remove zero check · db077278
      Greg Rose 提交于
      A mirror rule ID may be zero so do not return invalid parameter when the
      user passes in a zero value for a rule ID.
      
      Change-ID: I261b8c24725ce2c6ed32f859da81093dfcbe2970
      Signed-off-by: NGreg Rose <gregory.v.rose@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      db077278
    • K
      i40e: Add DeviceID for X722 QSFP+ · bccf4744
      Kamil Krawczyk 提交于
      Change-ID: I1370fbc7774e815ac1ad56561e97488e829592fc
      Signed-off-by: NKamil Krawczyk <kamil.krawczyk@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      bccf4744
    • M
      i40e: Add device capability which defines if update is available · 68a1c5a7
      Michal Kosiarz 提交于
      Add device capability which defines if update is available and security
      check is needed during update process.
      
      Change-ID: I380787c878275e1df18b39198df3ee3666342282
      Signed-off-by: NMichal Kosiarz <michal.kosiarz@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      68a1c5a7
    • D
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · c0cc5316
      David S. Miller 提交于
      Minor overlapping changes in the conflicts.
      
      In the macsec case, the change of the default ID macro
      name overlapped with the 64-bit netlink attribute alignment
      fixes in net-next.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c0cc5316
    • D
      net: ipv6: Use passed in table for nexthop lookups · 8c14586f
      David Ahern 提交于
      Similar to 3bfd8472 ("net: Use passed in table for nexthop lookups")
      for IPv4, if the route spec contains a table id use that to lookup the
      next hop first and fall back to a full lookup if it fails (per the fix
      4c9bcd11 ("net: Fix nexthop lookups")).
      
      Example:
      
          root@kenny:~# ip -6 ro ls table red
          local 2100:1::1 dev lo  proto none  metric 0  pref medium
          2100:1::/120 dev eth1  proto kernel  metric 256  pref medium
          local 2100:2::1 dev lo  proto none  metric 0  pref medium
          2100:2::/120 dev eth2  proto kernel  metric 256  pref medium
          local fe80::e0:f9ff:fe09:3cac dev lo  proto none  metric 0  pref medium
          local fe80::e0:f9ff:fe1c:b974 dev lo  proto none  metric 0  pref medium
          fe80::/64 dev eth1  proto kernel  metric 256  pref medium
          fe80::/64 dev eth2  proto kernel  metric 256  pref medium
          ff00::/8 dev red  metric 256  pref medium
          ff00::/8 dev eth1  metric 256  pref medium
          ff00::/8 dev eth2  metric 256  pref medium
          unreachable default dev lo  metric 240  error -113 pref medium
      
          root@kenny:~# ip -6 ro add table red 2100:3::/64 via 2100:1::64
          RTNETLINK answers: No route to host
      
      Route add fails even though 2100:1::64 is a reachable next hop:
          root@kenny:~# ping6 -I red  2100:1::64
          ping6: Warning: source address might be selected on device other than red.
          PING 2100:1::64(2100:1::64) from 2100:1::1 red: 56 data bytes
          64 bytes from 2100:1::64: icmp_seq=1 ttl=64 time=1.33 ms
      
      With this patch:
          root@kenny:~# ip -6 ro add table red 2100:3::/64 via 2100:1::64
          root@kenny:~# ip -6 ro ls table red
          local 2100:1::1 dev lo  proto none  metric 0  pref medium
          2100:1::/120 dev eth1  proto kernel  metric 256  pref medium
          local 2100:2::1 dev lo  proto none  metric 0  pref medium
          2100:2::/120 dev eth2  proto kernel  metric 256  pref medium
          2100:3::/64 via 2100:1::64 dev eth1  metric 1024  pref medium
          local fe80::e0:f9ff:fe09:3cac dev lo  proto none  metric 0  pref medium
          local fe80::e0:f9ff:fe1c:b974 dev lo  proto none  metric 0  pref medium
          fe80::/64 dev eth1  proto kernel  metric 256  pref medium
          fe80::/64 dev eth2  proto kernel  metric 256  pref medium
          ff00::/8 dev red  metric 256  pref medium
          ff00::/8 dev eth1  metric 256  pref medium
          ff00::/8 dev eth2  metric 256  pref medium
          unreachable default dev lo  metric 240  error -113 pref medium
      Signed-off-by: NDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8c14586f
    • N
      taskstats: fix nl parsing in accounting/getdelays.c · 570d8e93
      Nicolas Dichtel 提交于
      The type TASKSTATS_TYPE_NULL should always be ignored.
      
      When jumping to the next attribute, only the length of the current
      attribute should be added, not the length of all nested attributes.
      This last bug was not visible before commit 80df5542, because the
      kernel didn't put more than two nested attributes.
      
      Fixes: a3baf649 ("[PATCH] per-task-delay-accounting: documentation")
      Fixes: 80df5542 ("taskstats: use the libnl API to align nlattr on 64-bit")
      Signed-off-by: NNicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      570d8e93
  2. 27 4月, 2016 27 次提交
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · f28f20da
      Linus Torvalds 提交于
      Pull networking fixes from David Miller:
      
       1) Handle v4/v6 mixed sockets properly in soreuseport, from Craig
          Gallak.
      
       2) Bug fixes for the new macsec facility (missing kmalloc NULL checks,
          missing locking around netdev list traversal, etc.) from Sabrina
          Dubroca.
      
       3) Fix handling of host routes on ifdown in ipv6, from David Ahern.
      
       4) Fix double-fdput in bpf verifier.  From Jann Horn.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (31 commits)
        bpf: fix double-fdput in replace_map_fd_with_map_ptr()
        net: ipv6: Delete host routes on an ifdown
        Revert "ipv6: Revert optional address flusing on ifdown."
        net/mlx4_en: fix spurious timestamping callbacks
        net: dummy: remove note about being Y by default
        cxgbi: fix uninitialized flowi6
        ipv6: Revert optional address flusing on ifdown.
        ipv4/fib: don't warn when primary address is missing if in_dev is dead
        net/mlx5: Add pci shutdown callback
        net/mlx5_core: Remove static from local variable
        net/mlx5e: Use vport MTU rather than physical port MTU
        net/mlx5e: Fix minimum MTU
        net/mlx5e: Device's mtu field is u16 and not int
        net/mlx5_core: Add ConnectX-5 to list of supported devices
        net/mlx5e: Fix MLX5E_100BASE_T define
        net/mlx5_core: Fix soft lockup in steering error flow
        qlcnic: Update version to 5.3.64
        net: stmmac: socfpga: Remove re-registration of reset controller
        macsec: fix netlink attribute validation
        macsec: add missing macsec prefix in uapi
        ...
      f28f20da
    • L
      Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 91ea692f
      Linus Torvalds 提交于
      Pull ARM SoC fixes from Arnd Bergmann:
       "Here are the latest bug fixes for ARM SoCs, mostly addressing recent
        regressions.  Changes are across several platforms, so I'm listing
        every change separately here.
      
        Regressions since 4.5:
      
         - A correction of the psci firmware DT binding, to prevent users from
           relying on unintended semantics
      
         - Actually getting the newly merged clock driver for some OMAP
           platforms to work
      
         - A revert of patches for the Qualcomm BAM, these need to be reworked
           for 4.7 to avoid breaking boards other than the one they were
           intended for
      
         - A correction for the I2C device nodes on the Socionext Uniphier
           platform
      
         - i.MX SDHCI was broken for non-DT platforms due to a change with the
           setting of the DMA mask
      
         - A revert of a patch that accidentally added a nonexisting clock on
           the Rensas "Porter" board
      
         - A couple of OMAP fixes that are all related to suspend after the
           power domain changes for dra7
      
         - On Mediatek, revert part of the power domain initialization changes
           that broke mt8173-evb
      
        Fixes for older bugs:
      
         - Workaround for an "external abort" in the omap34xx suspend/resume
           code.
      
         - The USB1/eSATA should not be listed as an excon device on
           am57xx-beagle-x15 (broken since v4.0)
      
         - A v4.5 regression in the TI AM33xx and AM43XX DT specifying
           incorrect DMA request lines for the GPMC
      
         - The jiffies calibration on Renesas platforms was incorrect for some
           modern CPU cores.
      
         - A hardware errata woraround for clockdomains on TI DRA7"
      
      * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        drivers: firmware: psci: unify enable-method binding on ARM {64,32}-bit systems
        arm64: dts: uniphier: fix I2C nodes of PH1-LD20
        ARM: shmobile: timer: Fix preset_lpj leading to too short delays
        Revert "ARM: dts: porter: Enable SCIF_CLK frequency and pins"
        ARM: dts: r8a7791: Don't disable referenced optional clocks
        Revert "ARM: OMAP: Catch callers of revision information prior to it being populated"
        ARM: OMAP3: Fix external abort on 36xx waking from off mode idle
        ARM: dts: am57xx-beagle-x15: remove extcon_usb1
        ARM: dts: am437x: Fix GPMC dma properties
        ARM: dts: am33xx: Fix GPMC dma properties
        Revert "soc: mediatek: SCPSYS: Fix double enabling of regulators"
        ARM: mach-imx: sdhci-esdhc-imx: initialize DMA mask
        ARM: DRA7: clockdomain: Implement timer workaround for errata i874
        ARM: OMAP: Catch callers of revision information prior to it being populated
        ARM: dts: dra7: Correct clock tree for sys_32k_ck
        ARM: OMAP: DRA7: Provide proper class to omap2_set_globals_tap
        ARM: OMAP: DRA7: wakeupgen: Skip SAR save for wakeupgen
        Revert "dts: msm8974: Add dma channels for blsp2_i2c1 node"
        Revert "dts: msm8974: Add blsp2_bam dma node"
        ARM: dts: Add clocks for dm814x ADPLL
      91ea692f
    • L
      devpts: more pty driver interface cleanups · 8ead9dd5
      Linus Torvalds 提交于
      This is more prep-work for the upcoming pty changes.  Still just code
      cleanup with no actual semantic changes.
      
      This removes a bunch pointless complexity by just having the slave pty
      side remember the dentry associated with the devpts slave rather than
      the inode.  That allows us to remove all the "look up the dentry" code
      for when we want to remove it again.
      
      Together with moving the tty pointer from "inode->i_private" to
      "dentry->d_fsdata" and getting rid of pointless inode locking, this
      removes about 30 lines of code.  Not only is the end result smaller,
      it's simpler and easier to understand.
      
      The old code, for example, depended on the d_find_alias() to not just
      find the dentry, but also to check that it is still hashed, which in
      turn validated the tty pointer in the inode.
      
      That is a _very_ roundabout way to say "invalidate the cached tty
      pointer when the dentry is removed".
      
      The new code just does
      
      	dentry->d_fsdata = NULL;
      
      in devpts_pty_kill() instead, invalidating the tty pointer rather more
      directly and obviously.  Don't do something complex and subtle when the
      obvious straightforward approach will do.
      
      The rest of the patch (ie apart from code deletion and the above tty
      pointer clearing) is just switching the calling convention to pass the
      dentry or file pointer around instead of the inode.
      
      Cc: Eric Biederman <ebiederm@xmission.com>
      Cc: Peter Anvin <hpa@zytor.com>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Peter Hurley <peter@hurleysoftware.com>
      Cc: Serge Hallyn <serge.hallyn@ubuntu.com>
      Cc: Willy Tarreau <w@1wt.eu>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: Alan Cox <gnomes@lxorguk.ukuu.org.uk>
      Cc: Jann Horn <jann@thejh.net>
      Cc: Greg KH <greg@kroah.com>
      Cc: Jiri Slaby <jslaby@suse.com>
      Cc: Florian Weimer <fw@deneb.enyo.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8ead9dd5
    • J
      bpf: fix double-fdput in replace_map_fd_with_map_ptr() · 8358b02b
      Jann Horn 提交于
      When bpf(BPF_PROG_LOAD, ...) was invoked with a BPF program whose bytecode
      references a non-map file descriptor as a map file descriptor, the error
      handling code called fdput() twice instead of once (in __bpf_map_get() and
      in replace_map_fd_with_map_ptr()). If the file descriptor table of the
      current task is shared, this causes f_count to be decremented too much,
      allowing the struct file to be freed while it is still in use
      (use-after-free). This can be exploited to gain root privileges by an
      unprivileged user.
      
      This bug was introduced in
      commit 0246e64d ("bpf: handle pseudo BPF_LD_IMM64 insn"), but is only
      exploitable since
      commit 1be7f75d ("bpf: enable non-root eBPF programs") because
      previously, CAP_SYS_ADMIN was required to reach the vulnerable code.
      
      (posted publicly according to request by maintainer)
      Signed-off-by: NJann Horn <jannh@google.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Acked-by: NAlexei Starovoitov <ast@kernel.org>
      Acked-by: NDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8358b02b
    • F
      pch_gbe: fix bogus trylock conversion · 0e7dd0c9
      Florian Westphal 提交于
      Should have converted 'if (trylock)' to 'lock'.
      
      Fixes: a6086a89 ("drivers: net: remove NETDEV_TX_LOCKED")
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0e7dd0c9
    • D
      Merge branch 'sh_eth-next' · 50d5d2bd
      David S. Miller 提交于
      Sergei Shtylyov says:
      
      ====================
      sh_eth: couple of software reset bit cleanups
      
         Here's a set of 2 patches against DaveM's 'net-next.git' repo. We clean up
      the use of the software reset bits...
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      50d5d2bd
    • S
      sh_eth: rename ARSTR register bit · ec65cfce
      Sergei Shtylyov 提交于
      The Renesas RZ/A1H manual names the software reset bit in the software reset
      register (ARSTR) ARST which makes a bit more sense than the ARSTR_ARSTR name
      used now  by the driver -- rename the latter to ARSTR_ARST.
      Signed-off-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Reviewed-by: NSimon Horman <horms+renesas@verge.net.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ec65cfce
    • S
      sh_eth: use EDMR_SRST_GETHER in sh_eth_check_reset() · 97717edc
      Sergei Shtylyov 提交于
      sh_eth_check_reset() uses a bare number where EDMR_SRST_GETHER would fit,
      i.e. the receive/trasmit software reset bits that comprise EDMR_SRST_GETHER
      read as 1  while the corresponding reset is in progress and thus, when both
      are 0, the reset is complete.
      Signed-off-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Reviewed-by: NSimon Horman <horms+renesas@verge.net.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      97717edc
    • D
      Merge branch 'mlx5-next' · 3ccec4bd
      David S. Miller 提交于
      Saeed Mahameed says:
      
      ====================
      Mellanox 100G extending mlx5 ethtool support
      
      Changes from V0:
      	- Dropped: net/mlx5e: Disable link up on INIT HCA command
      	  Due to Ido's and Or's requests we will submit this patch to net and will need it for -stable.
      	- Rebased to: 11afbff8 ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next")
      
      This series is centralized around extending and improving mlx5 ethernet driver ethtool
      support. We've done some code refactoring for ethtool statistics reporting, making it
      more scalable and robust, now each reported ethtool counter belongs to a group and has
      its own descriptor within that group, the descriptor holds the counter name and offset
      in memory in that group memory block.
      
      Added new counters:
      	- Reporting more error and drop counter in ifconig/ip tool.
      	- Per priority pause and traffic counter in ethtool.
      	- link down events counter in ethtool.
      
      Set features handling was also refactored a little bit to be more resilient and generic,
      now setting more than one feature will not stop on the first failed one, but instead
      it will try to continue setting others. We made it generic to make it simpler for adding
      more features support, it is now done easily by only introducing a handler function of
      the new supported netdev feature, and let the generic handler do the job.
      
      New netdev features and ethtool support:
      	- Netdev feature RXALL, set on/off FCS check offload.
      	- Netdev feature HW_VLAN_CTAG_RX, set on/off rx-vlan stripping offload.
      	- Ethtool interface identify.
      	- Ethtool dump module EEPROM.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3ccec4bd
    • S
      net/mlx5e: Fix checksum handling for non-stripped vlan packets · 1b223dd3
      Saeed Mahameed 提交于
      Now as rx-vlan offload can be disabled, packets can be received
      with vlan tag not stripped, which means is_first_ethertype_ip will
      return false, for that we need to check if the hardware reported
      csum OK so we will report CHECKSUM_UNNECESSARY for those packets.
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1b223dd3
    • G
      net/mlx5e: Add ethtool support for rxvlan-offload (vlan stripping) · 36350114
      Gal Pressman 提交于
      Use ethtool -K <interface> rxvlan <on/off> to enable/disable
      C-TAG vlan stripping by hardware.
      Signed-off-by: NGal Pressman <galp@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      36350114
    • G
      net/mlx5e: Add ethtool support for dump module EEPROM · bb64143e
      Gal Pressman 提交于
      Add query MCIA, PMLP registers infrastructure and commands.
      Add ethtool support for get_module_info() and get_module_eeprom()
      callbacks.
      Signed-off-by: NGal Pressman <galp@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bb64143e
    • G
      net/mlx5e: Add ethtool support for interface identify (LED blinking) · da54d24e
      Gal Pressman 提交于
      Add the needed hardware command and mlx5_ifc structs for managing LED
      control.
      Add set_phys_id ethtool callback to support ethtool -p flag.
      Signed-off-by: NGal Pressman <galp@mellanox.com>
      Signed-off-by: NEugenia Emantayev <eugenia@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      da54d24e
    • E
      net/mlx5e: Add support for RXALL netdev feature · 94cb1ebb
      Eran Ben Elisha 提交于
      Introduce new access register named Ports Check Mask Register (PCMR) to
      control all HW checks on port. With this register, the driver can
      enable/disable Hardware FCS validation.
      
      When RXALL is enabled/disabled using ndo_set_features, enable/disable
      fcs check at HW.
      User can change HW configuration using rx-all flag at ethtool.
      Signed-off-by: NEran Ben Elisha <eranbe@mellanox.com>
      Signed-off-by: NGal Pressman <galp@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      94cb1ebb
    • G
      net/mlx5e: Improve set features ndo resiliency · 0e405443
      Gal Pressman 提交于
      In current mlx5e ndo_set_features implementation, setting some features
      can success while others can fail. Today, we return one error code which
      doesn't reflect the current features status of the netdev at the end of
      the ndo callback.
      
      Set netdev->features with features which were successfully set in order
      to keep the current status in case of failure. For this purpose, define
      new Macro to set/unset specific feature in netdev->features.
      
      This patch introduces a mechanism that uses feature handlers for each
      feature.
      Set features will call a generic handler, which will then call a specific
      handler in his turn and update netdev->features according to it's return
      value. Each specific handler is responsible to perform driver specific
      actions, and updating params if needed.
      Signed-off-by: NGal Pressman <galp@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0e405443
    • G
      net/mlx5e: Add link down events counter · 121fcdc8
      Gal Pressman 提交于
      Expose link_down_events counter through ethtool -S.
      This counter is read from PPort statistics, then proccessed and stored as
      a special handling software counter.
      This counter is stored along software counters since it is the only PPort
      counter that it's size is not 64 bits.
      Signed-off-by: NGal Pressman <galp@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      121fcdc8
    • G
      net/mlx5e: Add per priority group to PPort counters · cf678570
      Gal Pressman 提交于
      Expose counters providing information for each priority level (PCP) through
      ethtool -S option and DCBNL.
      This includes rx/tx bytes, frames, and pause counters.
      Signed-off-by: NGal Pressman <galp@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cf678570
    • G
      net/mlx5e: Rename VPort counters · 8075cb72
      Gal Pressman 提交于
      VPort and software counters names are confusing and may be unclear, all
      VPort counters now have a prefix of rx/tx_vport_*.
      Signed-off-by: NGal Pressman <galp@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8075cb72
    • G
      net/mlx5e: Statistics handling refactoring · 9218b44d
      Gal Pressman 提交于
      Redesign ethtool statistics handling and reporting in the driver:
      1. Move counters to a separate file (en_stats.h).
      2. Remove unnecessary dependencies between stats and strings.
      3. Use counter descriptors which hold a name and offset for each counter,
         and will be used to decide which counters will be exposed.
      
      For example when adding a new software counter to ethtool, instead of:
      1. Add to stats struct.
      2. Add to strings struct in the same order.
      3. Change macro defining number of software counters.
      The only thing needed is to link the new counter to a counter descriptor.
      
      VPort counters are a set of hardware traffic counters created automatically
      for each virtual port opened.
      PPort counters are a set of counters describing per physical port
      performance statistics.
      These counters are gathered from hardware register and divided to groups
      according to different protocols.
      Signed-off-by: NGal Pressman <galp@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9218b44d
    • G
      net/mlx5e: Report additional error statistics in get stats ndo · 269e6b3a
      Gal Pressman 提交于
      Provide rtnl_link_stats64 with information regarding physical errors to be
      seen in ifconfig and ip tool.
      Signed-off-by: NGal Pressman <galp@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      269e6b3a
    • D
    • D
      Merge branch 'netdev_tx_locked-removal' · c578e9ab
      David S. Miller 提交于
      Florian Westphal says:
      
      ====================
      net: core: remove TX_LOCKED support
      
      Not that many users left, lets kill it.
      
      TX_LOCKED was meant to be used by LLTX drivers when spin_trylock()
      failed.  Stack then re-queued if collisions happened on different
      cpus or free'd the skb to prevent deadlocks.
      
      Most of the driver removal patches fall into one of three categories:
      1. remove the driver-private tx lock (and LLTX flag), or...
      2. convert spin_trylock to plain spin_lock, or...
      3. convert TX_LOCKED to free+TX_OK
      
      Patches are grouped by these categories, last patch is the actual removal.
      All driver changes were compile tested only with exception of atl1e.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c578e9ab
    • F
      net: remove NETDEV_TX_LOCKED support · f0cdf76c
      Florian Westphal 提交于
      No more users in the tree, remove NETDEV_TX_LOCKED support.
      Adds another hole in softnet_stats struct, but better than keeping
      the unused collision counter around.
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f0cdf76c
    • F
      drivers: net: remove NETDEV_TX_LOCKED · a6086a89
      Florian Westphal 提交于
      replace the trylock by a full spin_lock and remove TX_LOCKED return value.
      Followup patch will remove TX_LOCKED from the kernel.
      
      Cc: Jon Mason <jdmason@kudzu.us>
      Cc: Andy Gospodarek <andy@greyhouse.net>
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a6086a89
    • F
      drivers: net: use NETDEV_TX_OK instead of NETDEV_TX_LOCKED · 926f2730
      Florian Westphal 提交于
      These drivers already call netif_stop_queue() so we should not be called
      unless tx space is available.  Just free the skb and return TX_OK.
      
      Followup patch will remove NETDEV_TX_LOCKED from the kernel.
      
      Cc: linux-parisc@vger.kernel.org
      Cc: linux-hams@vger.kernel.org
      Cc: Thomas Sailer <t.sailer@alumni.ethz.ch>
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      926f2730
    • F
      atle1: remove LLTX support and TX_UNLOCKED · 4acff371
      Florian Westphal 提交于
      similar to atl1c: lock is only used in ndo_start_xmit, but we also
      advertised LLTX, so remove that as well and let core stack handle
      tx locking.
      
      Allows to remove the TX_LOCKED return value from the driver.
      
      Cc: Jay Cliburn <jcliburn@gmail.com>
      Cc: Chris Snook <chris.snook@gmail.com>
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4acff371
    • F
      atl1c: remove private tx lock · 353e3bd5
      Florian Westphal 提交于
      AFAICS this is safe: the lock is only used in the .ndo_start_xmit
      function and this driver does not set LLTX.
      
      Gets rid of TX_LOCKED return value, followup patches will remove it.
      
      Cc: Jay Cliburn <jcliburn@gmail.com>
      Cc: Chris Snook <chris.snook@gmail.com>
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      353e3bd5