1. 31 Aug, 2016 17 commits
    • Raghu Vatsavayi's avatar
      liquidio: Consolidate common functionality · 32581245
      Raghu Vatsavayi authored
      Consolidate common functionality of various devices
      from different files into lio_core.c/octeon_console.c.
      Signed-off-by: default avatarDerek Chickles <derek.chickles@caviumnetworks.com>
      Signed-off-by: default avatarSatanand Burla <satananda.burla@caviumnetworks.com>
      Signed-off-by: default avatarFelix Manlunas <felix.manlunas@caviumnetworks.com>
      Signed-off-by: default avatarRaghu Vatsavayi <raghu.vatsavayi@caviumnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      32581245
    • Geert Uytterhoeven's avatar
    • Julia Lawall's avatar
      net: systemport: constify ethtool_ops structures · c1ab0e9c
      Julia Lawall authored
      Check for ethtool_ops structures that are only stored in the ethtool_ops
      field of a net_device structure or passed as the second argument to
      netdev_set_default_ethtool_ops.  These contexts are declared const, so
      ethtool_ops structures that have these properties can be declared as const
      also.
      
      The semantic patch that makes this change is as follows:
      (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @r disable optional_qualifier@
      identifier i;
      position p;
      @@
      static struct ethtool_ops i@p = { ... };
      
      @ok1@
      identifier r.i;
      struct net_device e;
      position p;
      @@
      e.ethtool_ops = &i@p;
      
      @ok2@
      identifier r.i;
      expression e;
      position p;
      @@
      netdev_set_default_ethtool_ops(e, &i@p)
      
      @bad@
      position p != {r.p,ok1.p,ok2.p};
      identifier r.i;
      @@
      i@p
      
      @depends on !bad disable optional_qualifier@
      identifier r.i;
      @@
      static
      +const
       struct ethtool_ops i = { ... };
      // </smpl>
      Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c1ab0e9c
    • Julia Lawall's avatar
      dwc_eth_qos: constify ethtool_ops structures · 777065e5
      Julia Lawall authored
      Check for ethtool_ops structures that are only stored in the ethtool_ops
      field of a net_device structure or passed as the second argument to
      netdev_set_default_ethtool_ops.  These contexts are declared const, so
      ethtool_ops structures that have these properties can be declared as const
      also.
      
      The semantic patch that makes this change is as follows:
      (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @r disable optional_qualifier@
      identifier i;
      position p;
      @@
      static struct ethtool_ops i@p = { ... };
      
      @ok1@
      identifier r.i;
      struct net_device e;
      position p;
      @@
      e.ethtool_ops = &i@p;
      
      @ok2@
      identifier r.i;
      expression e;
      position p;
      @@
      netdev_set_default_ethtool_ops(e, &i@p)
      
      @bad@
      position p != {r.p,ok1.p,ok2.p};
      identifier r.i;
      @@
      i@p
      
      @depends on !bad disable optional_qualifier@
      identifier r.i;
      @@
      static
      +const
       struct ethtool_ops i = { ... };
      // </smpl>
      Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      777065e5
    • Julia Lawall's avatar
      net: hisilicon: constify ethtool_ops structures · bc6f0136
      Julia Lawall authored
      Check for ethtool_ops structures that are only stored in the ethtool_ops
      field of a net_device structure or passed as the second argument to
      netdev_set_default_ethtool_ops.  These contexts are declared const, so
      ethtool_ops structures that have these properties can be declared as const
      also.
      
      The semantic patch that makes this change is as follows:
      (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @r disable optional_qualifier@
      identifier i;
      position p;
      @@
      static struct ethtool_ops i@p = { ... };
      
      @ok1@
      identifier r.i;
      struct net_device e;
      position p;
      @@
      e.ethtool_ops = &i@p;
      
      @ok2@
      identifier r.i;
      expression e;
      position p;
      @@
      netdev_set_default_ethtool_ops(e, &i@p)
      
      @bad@
      position p != {r.p,ok1.p,ok2.p};
      identifier r.i;
      @@
      i@p
      
      @depends on !bad disable optional_qualifier@
      identifier r.i;
      @@
      static
      +const
       struct ethtool_ops i = { ... };
      // </smpl>
      Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bc6f0136
    • Julia Lawall's avatar
      net: bcmgenet: constify ethtool_ops structures · 70591ab9
      Julia Lawall authored
      Check for ethtool_ops structures that are only stored in the ethtool_ops
      field of a net_device structure or passed as the second argument to
      netdev_set_default_ethtool_ops.  These contexts are declared const, so
      ethtool_ops structures that have these properties can be declared as const
      also.
      
      The semantic patch that makes this change is as follows:
      (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @r disable optional_qualifier@
      identifier i;
      position p;
      @@
      static struct ethtool_ops i@p = { ... };
      
      @ok1@
      identifier r.i;
      struct net_device e;
      position p;
      @@
      e.ethtool_ops = &i@p;
      
      @ok2@
      identifier r.i;
      expression e;
      position p;
      @@
      netdev_set_default_ethtool_ops(e, &i@p)
      
      @bad@
      position p != {r.p,ok1.p,ok2.p};
      identifier r.i;
      @@
      i@p
      
      @depends on !bad disable optional_qualifier@
      identifier r.i;
      @@
      static
      +const
       struct ethtool_ops i = { ... };
      // </smpl>
      Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      70591ab9
    • Julia Lawall's avatar
      net: ethernet: et131x: constify ethtool_ops structures · 1eff7002
      Julia Lawall authored
      Check for ethtool_ops structures that are only stored in the ethtool_ops
      field of a net_device structure or passed as the second argument to
      netdev_set_default_ethtool_ops.  These contexts are declared const, so
      ethtool_ops structures that have these properties can be declared as const
      also.
      
      The semantic patch that makes this change is as follows:
      (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @r disable optional_qualifier@
      identifier i;
      position p;
      @@
      static struct ethtool_ops i@p = { ... };
      
      @ok1@
      identifier r.i;
      struct net_device e;
      position p;
      @@
      e.ethtool_ops = &i@p;
      
      @ok2@
      identifier r.i;
      expression e;
      position p;
      @@
      netdev_set_default_ethtool_ops(e, &i@p)
      
      @bad@
      position p != {r.p,ok1.p,ok2.p};
      identifier r.i;
      @@
      i@p
      
      @depends on !bad disable optional_qualifier@
      identifier r.i;
      @@
      static
      +const
       struct ethtool_ops i = { ... };
      // </smpl>
      Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
      Acked-by: default avatarMark Einon <mark.einon@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1eff7002
    • Arnd Bergmann's avatar
      qede: hide 32-bit compile warning · 84fd1b19
      Arnd Bergmann authored
      The addition of the per-queue statistics introduced a harmless warning
      on all 32-bit architectures:
      
      drivers/net/ethernet/qlogic/qede/qede_ethtool.c: In function 'qede_get_ethtool_stats':
      drivers/net/ethernet/qlogic/qede/qede_ethtool.c:244:31: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
            buf[cnt++] = QEDE_TQSTATS_DATA(edev,
                                     ^
      drivers/net/ethernet/qlogic/qede/qede_ethtool.c:244:22: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
            buf[cnt++] = QEDE_TQSTATS_DATA(edev,
                            ^
      This changes the cast to 'void *' to shut up the warning, which
      avoids the assumptions on the size of the pointer type.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Fixes: 68db9ec2 ("qede: Add support for per-queue stats.")
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      84fd1b19
    • Arnd Bergmann's avatar
      ravb: avoid unused function warnings · 1ddcf41f
      Arnd Bergmann authored
      When CONFIG_PM_SLEEP is disabled, we get a couple of harmless warnings:
      
      drivers/net/ethernet/renesas/ravb_main.c:2117:12: error: 'ravb_resume' defined but not used [-Werror=unused-function]
      drivers/net/ethernet/renesas/ravb_main.c:2104:12: error: 'ravb_suspend' defined but not used [-Werror=unused-function]
      
      The simplest solution here is to replace the #ifdef with __maybe_unused
      annotations, which lets the compiler do the right thing by itself.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Fixes: 0184165b ("ravb: add sleep PM suspend/resume support")
      Acked-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1ddcf41f
    • David S. Miller's avatar
      Merge branch 'mpls-fragmentation-and-gso-fixes' · 7ba9d103
      David S. Miller authored
      David Ahern says:
      
      ====================
      net: mpls: fragmentation and gso fixes for locally originated traffic
      
      This series fixes mtu and fragmentation for tunnels using lwtunnel
      output redirect, and fixes GSO for MPLS for locally originated traffic
      reported by Lennert Buytenhek.
      
      A follow on series will address fragmentation and GSO for forwarded
      MPLS traffic. Hardware offload of GSO with MPLS also needs to be
      addressed.
      
      Simon: Can you verify this works with OVS for single and multiple
             labels?
      
      v4
      - more updates to mpls_gso_segment per Alex's comments (thanks, Alex)
      - updates to teaching OVS about marking MPLS labels as the network header
      
      v3
      - updates to mpls_gso_segment per Alex's comments
      - dropped skb->encapsulation = 1 from mpls_xmit per Alex's comment
      
      v2
      - consistent use of network_header in skb to fix GSO for MPLS
      - update MPLS code in OVS to network_header and inner_network_header
      ====================
      Tested-by: default avatarSimon Horman <simon.horman@netronome.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7ba9d103
    • David Ahern's avatar
      net: veth: Set features for MPLS · 607fca9a
      David Ahern authored
      veth does not really transmit packets only moves the skb from one
      netdev to another so gso and checksum is not really needed. Add
      the features to mpls_features to get the same benefit and performance
      with MPLS as without it.
      Reported-by: default avatarLennert Buytenhek <buytenh@wantstofly.org>
      Signed-off-by: default avatarDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      607fca9a
    • David Ahern's avatar
      net: mpls: Fixups for GSO · 48d2ab60
      David Ahern authored
      As reported by Lennert the MPLS GSO code is failing to properly segment
      large packets. There are a couple of problems:
      
      1. the inner protocol is not set so the gso segment functions for inner
         protocol layers are not getting run, and
      
      2  MPLS labels for packets that use the "native" (non-OVS) MPLS code
         are not properly accounted for in mpls_gso_segment.
      
      The MPLS GSO code was added for OVS. It is re-using skb_mac_gso_segment
      to call the gso segment functions for the higher layer protocols. That
      means skb_mac_gso_segment is called twice -- once with the network
      protocol set to MPLS and again with the network protocol set to the
      inner protocol.
      
      This patch sets the inner skb protocol addressing item 1 above and sets
      the network_header and inner_network_header to mark where the MPLS labels
      start and end. The MPLS code in OVS is also updated to set the two
      network markers.
      
      >From there the MPLS GSO code uses the difference between the network
      header and the inner network header to know the size of the MPLS header
      that was pushed. It then pulls the MPLS header, resets the mac_len and
      protocol for the inner protocol and then calls skb_mac_gso_segment
      to segment the skb.
      
      Afterward the inner protocol segmentation is done the skb protocol
      is set to mpls for each segment and the network and mac headers
      restored.
      Reported-by: default avatarLennert Buytenhek <buytenh@wantstofly.org>
      Signed-off-by: default avatarDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      48d2ab60
    • Roopa Prabhu's avatar
      net: lwtunnel: Handle fragmentation · 14972cbd
      Roopa Prabhu authored
      Today mpls iptunnel lwtunnel_output redirect expects the tunnel
      output function to handle fragmentation. This is ok but can be
      avoided if we did not do the mpls output redirect too early.
      ie we could wait until ip fragmentation is done and then call
      mpls output for each ip fragment.
      
      To make this work we will need,
      1) the lwtunnel state to carry encap headroom
      2) and do the redirect to the encap output handler on the ip fragment
      (essentially do the output redirect after fragmentation)
      
      This patch adds tunnel headroom in lwtstate to make sure we
      account for tunnel data in mtu calculations during fragmentation
      and adds new xmit redirect handler to redirect to lwtunnel xmit func
      after ip fragmentation.
      
      This includes IPV6 and some mtu fixes and testing from David Ahern.
      Signed-off-by: default avatarRoopa Prabhu <roopa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      14972cbd
    • Eric Dumazet's avatar
      net: batch calls to flush_all_backlogs() · 41852497
      Eric Dumazet authored
      After commit 145dd5f9 ("net: flush the softnet backlog in process
      context"), we can easily batch calls to flush_all_backlogs() for all
      devices processed in rollback_registered_many()
      
      Tested:
      
      Before patch, on an idle host.
      
      modprobe dummy numdummies=10000
      perf stat -e context-switches -a rmmod dummy
      
       Performance counter stats for 'system wide':
      
               1,211,798      context-switches
      
             1.302137465 seconds time elapsed
      
      After patch:
      
      perf stat -e context-switches -a rmmod dummy
      
       Performance counter stats for 'system wide':
      
                 225,523      context-switches
      
             0.721623566 seconds time elapsed
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Acked-by: default avatarHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      41852497
    • Mark Rustad's avatar
      ixgbe: Eliminate useless message and improve logic · ae3cb8cb
      Mark Rustad authored
      Remove a useless log message and improve the logic for setting
      a PHY address from the contents of the MNG_IF_SEL register.
      Signed-off-by: default avatarMark Rustad <mark.d.rustad@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ae3cb8cb
    • David S. Miller's avatar
      Merge tag 'rxrpc-rewrite-20160830-1' of... · 792438e5
      David S. Miller authored
      Merge tag 'rxrpc-rewrite-20160830-1' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs
      
      David Howells says:
      
      ====================
      rxrpc: Preparation for removal of use of skbs from AFS
      
      Here's a set of patches that prepare the way for the removal of the use of
      sk_buffs from fs/afs (they'll be entirely retained within net/rxrpc):
      
       (1) Fix a potential NULL-pointer deref in rxrpc_abort_calls().
      
       (2) Condense all the terminal call state machine states to a single one
           plus supplementary info.
      
       (3) Add a trace point for rxrpc call usage debugging.
      
       (4) Cleanups and missing headers.
      
       (5) Provide a way for AFS to ask about a call's peer address without
           having an sk_buff to query.
      
       (6) Use call->peer directly rather than going via call->conn (which might
           be NULL).
      
       (7) Pass struct socket * to various rxrpc kernel interface functions so
           they can use that directly rather than getting it from the rxrpc_call
           struct.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      792438e5
    • Colin Ian King's avatar
      drivers: net: stmmac: fix spelling mistake "mulitcast" -> "multicast" · cf4d13fe
      Colin Ian King authored
      Trivial fix to spelling mistake in dev_warn message.
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cf4d13fe
  2. 30 Aug, 2016 11 commits
  3. 29 Aug, 2016 12 commits
    • Linus Torvalds's avatar
      Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · b8927721
      Linus Torvalds authored
      Pull ext4 fixes from Ted Ts'o:
       "Fix bugs that could cause kernel deadlocks or file system corruption
        while moving xattrs to expand the extended inode.
      
        Also add some sanity checks to the block group descriptors to make
        sure we don't end up overwriting the superblock"
      
      * tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
        ext4: avoid deadlock when expanding inode size
        ext4: properly align shifted xattrs when expanding inodes
        ext4: fix xattr shifting when expanding inodes part 2
        ext4: fix xattr shifting when expanding inodes
        ext4: validate that metadata blocks do not overlap superblock
        ext4: reserve xattr index for the Hurd
      b8927721
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 1f6a563e
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Segregate namespaces properly in conntrack dumps, from Liping Zhang.
      
       2) tcp listener refcount fix in netfilter tproxy, from Eric Dumazet.
      
       3) Fix timeouts in qed driver due to xmit_more, from Yuval Mintz.
      
       4) Fix use-after-free in tcp_xmit_retransmit_queue().
      
       5) Userspace header fixups (use of __u32, missing includes, etc.) from
          Mikko Rapeli.
      
       6) Further refinements to fragmentation wrt gso and tunnels, from
          Shmulik Ladkani.
      
       7) Trigger poll correctly for zero length UDP packets, from Eric
          Dumazet.
      
       8) TCP window scaling fix, also from Eric Dumazet.
      
       9) SLAB_DESTROY_BY_RCU is not relevant any more for UDP sockets.
      
      10) Module refcount leak in qdisc_create_dflt(), from Eric Dumazet.
      
      11) Fix deadlock in cp_rx_poll() of 8139cp driver, from Gao Feng.
      
      12) Memory leak in rhashtable's alloc_bucket_locks(), from Eric Dumazet.
      
      13) Add new device ID to alx driver, from Owen Lin.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (83 commits)
        Add Killer E2500 device ID in alx driver.
        net: smc91x: fix SMC accesses
        Documentation: networking: dsa: Remove platform device TODO
        net/mlx5: Increase number of ethtool steering priorities
        net/mlx5: Add error prints when validate ETS failed
        net/mlx5e: Fix memory leak if refreshing TIRs fails
        net/mlx5e: Add ethtool counter for TX xmit_more
        net/mlx5e: Fix ethtool -g/G rx ring parameter report with striding RQ
        net/mlx5e: Don't wait for SQ completions on close
        net/mlx5e: Don't post fragmented MPWQE when RQ is disabled
        net/mlx5e: Don't wait for RQ completions on close
        net/mlx5e: Limit UMR length to the device's limitation
        rhashtable: fix a memory leak in alloc_bucket_locks()
        sfc: fix potential stack corruption from running past stat bitmask
        team: loadbalance: push lacpdus to exact delivery
        net: hns: dereference ppe_cb->ppe_common_cb if it is non-null
        8139cp: Fix one possible deadloop in cp_rx_poll
        i40e: Change some init flow for the client
        Revert "phy: IRQ cannot be shared"
        net: dsa: bcm_sf2: Fix race condition while unmasking interrupts
        ...
      1f6a563e
    • Linus Torvalds's avatar
      Merge tag 'platform-drivers-x86-v4.8-4' of... · cf4d3779
      Linus Torvalds authored
      Merge tag 'platform-drivers-x86-v4.8-4' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86
      
      Pull x86 platform driver fixes from Darren Hart:
       "Remove module related code from two drivers that are only configurable
        as built-in: intel_pmic_gpio and platform/olpc"
      
      * tag 'platform-drivers-x86-v4.8-4' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86:
        intel_pmic_gpio: Make explicitly non-modular
        platform/olpc: Make ec explicitly non-modular
      cf4d3779
    • Linus Torvalds's avatar
      Merge tag 'powerpc-4.8-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · 2a90309e
      Linus Torvalds authored
      Pull powerpc fixes from Ben Herrenschmidt:
       "This was meant to be sent early last week, but I has a change pending
        on one of the fixes and other things made me forget all about.  Ugh.
      
        We have some misc fixes for powerpc 4.8.  Some trivial bits and some
        regressions, and a trivial cleanup or two that I saw no point in
        letting rot in patchwork"
      
      * tag 'powerpc-4.8-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc: signals: Discard transaction state from signal frames
        powerpc/powernv : Drop reference added by kset_find_obj()
        powerpc/tm: do not use r13 for tabort_syscall
        powerpc: move hmi.c to arch/powerpc/kvm/
        powerpc: sysdev: cpm: fix gpio save_regs functions
        powerpc/pseries: PACA save area fix for MCE vs MCE
        powerpc/pseries: PACA save area fix for general exception vs MCE
        powerpc/prom: Fix sub-processor option passed to ibm, client-architecture-support
        powerpc, hotplug: Avoid to touch non-existent cpumasks.
        powerpc: migrate exception table users off module.h and onto extable.h
        powerpc/powernv/pci: fix iterator signedness
        powerpc/pseries: use pci_host_bridge.release_fn() to kfree(phb)
        cxl: use pcibios_free_controller_deferred() when removing vPHBs
        powerpc: mpc8349emitx: Delete unnecessary assignment for the field "owner"
        powerpc/512x: Delete unnecessary assignment for the field "owner"
        drivers/macintosh: Delete owner assignment
        powerpc: cputhreads: Add missing include file
      2a90309e
    • Jean Delvare's avatar
      hwmon: (it87) Add missing sysfs attribute group terminator · 3c329263
      Jean Delvare authored
      Attribute array it87_attributes_in lacks its NULL terminator,
      causing random behavior when operating on the attribute group.
      
      Fixes: 52929715 ("hwmon: (it87) Use is_visible for voltage sensors")
      Signed-off-by: default avatarJean Delvare <jdelvare@suse.de>
      Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
      Cc: Guenter Roeck <linux@roeck-us.net>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      3c329263
    • Jacob Keller's avatar
      fm10k: don't re-map queues when a mailbox message suffices · 325782a1
      Jacob Keller authored
      When the PF assigns a new MAC address to a VF it uses the base address
      registers to store the MAC address. This allows a VF which loads after
      this setup the ability to get the initial address without having to wait
      for a mailbox message. Unfortunately to do this, the PF must take queue
      ownership away from the VF, which can cause fault errors when there is
      already an active VF driver.
      
      This queue ownership assignment causes race condition between the PF and
      the VF such that potentially a VF can cause FUM fault errors due to
      normal PF/VF driver behavior.
      
      It is not safe to simply allow the PF to write the base address
      registers without taking queue ownership back as the PF must also
      disable the queues, and this would impact active VF use. The current
      code is safe because the queue ownership will prevent the VF from
      actually writing but does trigger the FUM fault.
      
      We can do better by simply avoiding the register write process when
      a mailbox message suffices. If the message can be sent over the mailbox,
      then we will not perform the queue ownership assignment and we won't
      update the base address to be the same as the MAC address.
      
      We do still have to write the TXQCTL registers in order to update the
      VID of the queue. This is necessary because the TXQCTL register is
      read-only from the VF, and thus the VF cannot do this for itself. This
      register does not need to wait for the Tx queue to be disabled and is
      safe for the PF to write during normal VF operation, so we move this
      write to the top of the function above the mailbox message. Without
      this, the TXQCTL register would be misconfigured and cause the VF to Tx
      hang.
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarKrishneil Singh <Krishneil.k.singh@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      325782a1
    • Jacob Keller's avatar
      fm10k: don't clear the RXQCTL register when enabling or disabling queues · c689eff1
      Jacob Keller authored
      Ensure that other bits in the RXQCTL register do not get cleared. This
      ensures that bits related to queue ownership are maintained.
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarKrishneil Singh <Krishneil.k.singh@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      c689eff1
    • Jacob Keller's avatar
    • Jacob Keller's avatar
      fm10k: add support for Rx offloads on one Geneve tunnel · 1ad78292
      Jacob Keller authored
      Similar to how we handle VXLAN offload, enable support for a single
      Geneve tunnel.
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarKrishneil Singh <Krishneil.k.singh@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      1ad78292
    • Jacob Keller's avatar
      fm10k: rework vxlan_port offload before adding geneve support · f92e0e48
      Jacob Keller authored
      In preparation for adding Geneve Rx offload support, refactor the
      current VXLAN offload flow to be a bit more generic so that it will be
      easier to add the new Geneve code. The fm10k hardware supports one VXLAN
      and one Geneve tunnel, so we will eventually treat the VXLAN and Geneve
      tunnels identically. To this end, factor out the code that handles the
      current list so that we can use the generic flow for both tunnels in the
      next patch.
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarKrishneil Singh <Krishneil.k.singh@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      f92e0e48
    • Jacob Keller's avatar
      fm10k: don't try to stop queues if we've lost hw_addr · 5f45c830
      Jacob Keller authored
      In the event of a surprise remove, we expect the driver to go down,
      which includes calling .stop_hw(). However, this function will return an
      error because the queues won't appear to cleanly disable. Prevent this
      and avoid the unnecessary checks by just returning when
      FM10K_REMOVED(hw->hw_addr) is true.
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarKrishneil Singh <Krishneil.k.singh@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      5f45c830
    • Jacob Keller's avatar
      fm10k: don't continue probe if PCI device not in normal IO state · 18095937
      Jacob Keller authored
      In the event of an uncorrectable AER error occurring when the driver has
      not loaded, the recovery routines are not done. This is done because
      future loads of the driver may not be aware of the IO state and may not
      be able to recover at all. In this case, when we next load the driver it
      fails due to what appears to be a surprise remove event. Instead, add
      a check to ensure that the device is in the normal IO state before
      continuing to probe. This allows us to give a more descriptive message
      of what is wrong.
      
      Without this change, the driver will attempt to probe up to our first
      call of .reset_hw() which will be unable to read registers and act as if
      a surprise remove event occurred.
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarKrishneil Singh <Krishneil.k.singh@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      18095937