1. 13 Mar, 2020 4 commits
    • Bodong Wang's avatar
      net/mlx5: E-Switch, Remove redundant check of eswitch manager cap · 86f9453c
      Bodong Wang authored
      esw_vport_create_legacy_acl_tables bails out immediately for eswitch
      manager, hence remove all the check of esw manager cap after.
      Signed-off-by: default avatarBodong Wang <bodong@mellanox.com>
      Reviewed-by: default avatarParav Pandit <parav@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      86f9453c
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 1d343579
      David S. Miller authored
      Minor overlapping changes, nothing serious.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1d343579
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2020-03-13' of git://anongit.freedesktop.org/drm/drm · 0d81a3f2
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "It's a bit quieter, probably not as much as it could be.
      
        There is on large regression fix in here from Lyude for displayport
        bandwidth calculations, there've been reports of multi-monitor in
        docks not working since -rc1 and this has been tested to fix those.
      
        Otherwise it's a bunch of i915 (with some GVT fixes), a set of amdgpu
        watermark + bios fixes, and an exynos iommu cleanup fix.
      
        core:
         - DP MST bandwidth regression fix.
      
        i915:
         - hard lockup fix
         - GVT fixes
         - 32-bit alignment issue fix
         - timeline wait fixes
         - cacheline_retire and free
      
        amdgpu:
         - Update the display watermark bounding box for navi14
         - Fix fetching vbios directly from rom on vega20/arcturus
         - Navi and renoir watermark fixes
      
        exynos:
         - iommu object cleanup fix"
      
      `
      
      * tag 'drm-fixes-2020-03-13' of git://anongit.freedesktop.org/drm/drm:
        drm/dp_mst: Rewrite and fix bandwidth limit checks
        drm/dp_mst: Reprobe path resources in CSN handler
        drm/dp_mst: Use full_pbn instead of available_pbn for bandwidth checks
        drm/dp_mst: Rename drm_dp_mst_is_dp_mst_end_device() to be less redundant
        drm/i915: Defer semaphore priority bumping to a workqueue
        drm/i915/gt: Close race between cacheline_retire and free
        drm/i915/execlists: Enable timeslice on partial virtual engine dequeue
        drm/i915: be more solid in checking the alignment
        drm/i915/gvt: Fix dma-buf display blur issue on CFL
        drm/i915: Return early for await_start on same timeline
        drm/i915: Actually emit the await_start
        drm/amdgpu/powerplay: nv1x, renior copy dcn clock settings of watermark to smu during boot up
        drm/exynos: Fix cleanup of IOMMU related objects
        drm/amdgpu: correct ROM_INDEX/DATA offset for VEGA20
        drm/amd/display: update soc bb for nv14
        drm/i915/gvt: Fix emulated vbt size issue
        drm/i915/gvt: Fix unnecessary schedule timer when no vGPU exits
      0d81a3f2
    • Dave Airlie's avatar
      Merge tag 'topic/mst-bw-check-fixes-for-airlied-2020-03-12-2' of... · 16b78f05
      Dave Airlie authored
      Merge tag 'topic/mst-bw-check-fixes-for-airlied-2020-03-12-2' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes
      
      UAPI Changes: None
      
      Cross-subsystem Changes: None
      
      Core Changes: Fixed regressions introduced by commit cd82d82c
      ("drm/dp_mst: Add branch bandwidth validation to MST atomic check"),
      which would cause us to:
      
      * Calculate the available bandwidth on an MST topology incorrectly, and
        as a result reject most display configurations that would try to enable
        more then one sink on a topology
      * Occasionally expose MST connectors to userspace before finishing
        probing their PBN capabilities, resulting in us rejecting display
        configurations because we assumed briefly that no bandwidth was
        available
      
      Driver Changes: None
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      From: Lyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/bf16ee577567beed91c86b7d9cda3ec2e8c50a71.camel@redhat.com
      16b78f05
  2. 12 Mar, 2020 36 commits
    • Dave Airlie's avatar
      Merge tag 'drm-intel-fixes-2020-03-12' of... · f31d83f0
      Dave Airlie authored
      Merge tag 'drm-intel-fixes-2020-03-12' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
      
      drm/i915 fixes for v5.6-rc6:
      - hard lockup fix
      - GVT fixes
      - 32-bit alignment issue fix
      - timeline wait fixes
      - cacheline_retire and free
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      
      From: Jani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/87lfo6ksvw.fsf@intel.com
      f31d83f0
    • Dave Airlie's avatar
      Merge tag 'amd-drm-fixes-5.6-2020-03-11' of... · d9443265
      Dave Airlie authored
      Merge tag 'amd-drm-fixes-5.6-2020-03-11' of git://people.freedesktop.org/~agd5f/linux into drm-fixes
      
      amd-drm-fixes-5.6-2020-03-11:
      
      amdgpu:
      - Update the display watermark bounding box for navi14
      - Fix fetching vbios directly from rom on vega20/arcturus
      - Navi and renoir watermark fixes
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      From: Alex Deucher <alexdeucher@gmail.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200312020924.4161-1-alexander.deucher@amd.com
      d9443265
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 1b51f694
      Linus Torvalds authored
      Pull networking fixes from David Miller:
       "It looks like a decent sized set of fixes, but a lot of these are one
        liner off-by-one and similar type changes:
      
         1) Fix netlink header pointer to calcular bad attribute offset
            reported to user. From Pablo Neira Ayuso.
      
         2) Don't double clear PHY interrupts when ->did_interrupt is set,
            from Heiner Kallweit.
      
         3) Add missing validation of various (devlink, nl802154, fib, etc.)
            attributes, from Jakub Kicinski.
      
         4) Missing *pos increments in various netfilter seq_next ops, from
            Vasily Averin.
      
         5) Missing break in of_mdiobus_register() loop, from Dajun Jin.
      
         6) Don't double bump tx_dropped in veth driver, from Jiang Lidong.
      
         7) Work around FMAN erratum A050385, from Madalin Bucur.
      
         8) Make sure ARP header is pulled early enough in bonding driver,
            from Eric Dumazet.
      
         9) Do a cond_resched() during multicast processing of ipvlan and
            macvlan, from Mahesh Bandewar.
      
        10) Don't attach cgroups to unrelated sockets when in interrupt
            context, from Shakeel Butt.
      
        11) Fix tpacket ring state management when encountering unknown GSO
            types. From Willem de Bruijn.
      
        12) Fix MDIO bus PHY resume by checking mdio_bus_phy_may_suspend()
            only in the suspend context. From Heiner Kallweit"
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (112 commits)
        net: systemport: fix index check to avoid an array out of bounds access
        tc-testing: add ETS scheduler to tdc build configuration
        net: phy: fix MDIO bus PM PHY resuming
        net: hns3: clear port base VLAN when unload PF
        net: hns3: fix RMW issue for VLAN filter switch
        net: hns3: fix VF VLAN table entries inconsistent issue
        net: hns3: fix "tc qdisc del" failed issue
        taprio: Fix sending packets without dequeueing them
        net: mvmdio: avoid error message for optional IRQ
        net: dsa: mv88e6xxx: Add missing mask of ATU occupancy register
        net: memcg: fix lockdep splat in inet_csk_accept()
        s390/qeth: implement smarter resizing of the RX buffer pool
        s390/qeth: refactor buffer pool code
        s390/qeth: use page pointers to manage RX buffer pool
        seg6: fix SRv6 L2 tunnels to use IANA-assigned protocol number
        net: dsa: Don't instantiate phylink for CPU/DSA ports unless needed
        net/packet: tpacket_rcv: do not increment ring index on drop
        sxgbe: Fix off by one in samsung driver strncpy size arg
        net: caif: Add lockdep expression to RCU traversal primitive
        MAINTAINERS: remove Sathya Perla as Emulex NIC maintainer
        ...
      1b51f694
    • Lyude Paul's avatar
      drm/dp_mst: Rewrite and fix bandwidth limit checks · 047d4cd2
      Lyude Paul authored
      Sigh, this is mostly my fault for not giving commit cd82d82c
      ("drm/dp_mst: Add branch bandwidth validation to MST atomic check")
      enough scrutiny during review. The way we're checking bandwidth
      limitations here is mostly wrong:
      
      For starters, drm_dp_mst_atomic_check_bw_limit() determines the
      pbn_limit of a branch by simply scanning each port on the current branch
      device, then uses the last non-zero full_pbn value that it finds. It
      then counts the sum of the PBN used on each branch device for that
      level, and compares against the full_pbn value it found before.
      
      This is wrong because ports can and will have different PBN limitations
      on many hubs, especially since a number of DisplayPort hubs out there
      will be clever and only use the smallest link rate required for each
      downstream sink - potentially giving every port a different full_pbn
      value depending on what link rate it's trained at. This means with our
      current code, which max PBN value we end up with is not well defined.
      
      Additionally, we also need to remember when checking bandwidth
      limitations that the top-most device in any MST topology is a branch
      device, not a port. This means that the first level of a topology
      doesn't technically have a full_pbn value that needs to be checked.
      Instead, we should assume that so long as our VCPI allocations fit we're
      within the bandwidth limitations of the primary MSTB.
      
      We do however, want to check full_pbn on every port including those of
      the primary MSTB. However, it's important to keep in mind that this
      value represents the minimum link rate /between a port's sink or mstb,
      and the mstb itself/. A quick diagram to explain:
      
                                      MSTB #1
                                     /       \
                                    /         \
                                 Port #1    Port #2
             full_pbn for Port #1 → |          | ← full_pbn for Port #2
                                 Sink #1    MSTB #2
                                               |
                                             etc...
      
      Note that in the above diagram, the combined PBN from all VCPI
      allocations on said hub should not exceed the full_pbn value of port #2,
      and the display configuration on sink #1 should not exceed the full_pbn
      value of port #1. However, port #1 and port #2 can otherwise consume as
      much bandwidth as they want so long as their VCPI allocations still fit.
      
      And finally - our current bandwidth checking code also makes the mistake
      of not checking whether something is an end device or not before trying
      to traverse down it.
      
      So, let's fix it by rewriting our bandwidth checking helpers. We split
      the function into one part for handling branches which simply adds up
      the total PBN on each branch and returns it, and one for checking each
      port to ensure we're not going over its PBN limit. Phew.
      
      This should fix regressions seen, where we erroneously reject display
      configurations due to thinking they're going over our bandwidth limits
      when they're not.
      
      Changes since v1:
      * Took an even closer look at how PBN limitations are supposed to be
        handled, and did some experimenting with Sean Paul. Ended up rewriting
        these helpers again, but this time they should actually be correct!
      Changes since v2:
      * Small indenting fix
      * Fix pbn_used check in drm_dp_mst_atomic_check_port_bw_limit()
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Fixes: cd82d82c ("drm/dp_mst: Add branch bandwidth validation to MST atomic check")
      Cc: Sean Paul <seanpaul@google.com>
      Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Reviewed-by: default avatarMikita Lipski <mikita.lipski@amd.com>
      Tested-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200309210131.1497545-1-lyude@redhat.com
      047d4cd2
    • Lyude Paul's avatar
      drm/dp_mst: Reprobe path resources in CSN handler · 87212b51
      Lyude Paul authored
      We used to punt off reprobing path resources to the link address probe
      work, but now that we handle CSNs asynchronously from the driver's HPD
      handling we can do whatever the heck we want from the CSN!
      
      So, reprobe the path resources from drm_dp_mst_handle_conn_stat(). Also,
      get rid of the path resource reprobing code in
      drm_dp_check_and_send_link_address() since it's needlessly complicated
      when we already reprobe path resources from
      drm_dp_handle_link_address_port(). And finally, teach
      drm_dp_send_enum_path_resources() to return 1 on PBN changes so we know
      if we need to send another hotplug or not.
      
      This fixes issues where we've indicated to userspace that a port has
      just been connected, before we actually probed it's available PBN -
      something that results in unexpected atomic check failures.
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Fixes: cd82d82c ("drm/dp_mst: Add branch bandwidth validation to MST atomic check")
      Cc: Mikita Lipski <mikita.lipski@amd.com>
      Cc: Hans de Goede <hdegoede@redhat.com>
      Cc: Sean Paul <sean@poorly.run>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200306234623.547525-4-lyude@redhat.comReviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Tested-by: default avatarHans de Goede <hdegoede@redhat.com>
      87212b51
    • Lyude Paul's avatar
      drm/dp_mst: Use full_pbn instead of available_pbn for bandwidth checks · fcf46380
      Lyude Paul authored
      DisplayPort specifications are fun. For a while, it's been really
      unclear to us what available_pbn actually does. There's a somewhat vague
      explanation in the DisplayPort spec (starting from 1.2) that partially
      explains it:
      
        The minimum payload bandwidth number supported by the path. Each node
        updates this number with its available payload bandwidth number if its
        payload bandwidth number is less than that in the Message Transaction
        reply.
      
      So, it sounds like available_pbn represents the smallest link rate in
      use between the source and the branch device. Cool, so full_pbn is just
      the highest possible PBN that the branch device supports right?
      
      Well, we assumed that for quite a while until Sean Paul noticed that on
      some MST hubs, available_pbn will actually get set to 0 whenever there's
      any active payloads on the respective branch device. This caused quite a
      bit of confusion since clearing the payload ID table would end up fixing
      the available_pbn value.
      
      So, we just went with that until commit cd82d82c ("drm/dp_mst: Add
      branch bandwidth validation to MST atomic check") started breaking
      people's setups due to us getting erroneous available_pbn values. So, we
      did some more digging and got confused until we finally looked at the
      definition for full_pbn:
      
        The bandwidth of the link at the trained link rate and lane count
        between the DP Source device and the DP Sink device with no time slots
        allocated to VC Payloads, represented as a Payload Bandwidth Number. As
        with the Available_Payload_Bandwidth_Number, this number is determined
        by the link with the lowest lane count and link rate.
      
      That's what we get for not reading specs closely enough, hehe. So, since
      full_pbn is definitely what we want for doing bandwidth restriction
      checks - let's start using that instead and ignore available_pbn
      entirely.
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Fixes: cd82d82c ("drm/dp_mst: Add branch bandwidth validation to MST atomic check")
      Cc: Mikita Lipski <mikita.lipski@amd.com>
      Cc: Hans de Goede <hdegoede@redhat.com>
      Cc: Sean Paul <sean@poorly.run>
      Reviewed-by: default avatarMikita Lipski <mikita.lipski@amd.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200306234623.547525-3-lyude@redhat.comReviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Tested-by: default avatarHans de Goede <hdegoede@redhat.com>
      fcf46380
    • Lyude Paul's avatar
      drm/dp_mst: Rename drm_dp_mst_is_dp_mst_end_device() to be less redundant · b2feb1d6
      Lyude Paul authored
      It's already prefixed by dp_mst, so we don't really need to repeat
      ourselves here. One of the changes I should have picked up originally
      when reviewing MST DSC support.
      
      There should be no functional changes here
      
      Cc: Mikita Lipski <mikita.lipski@amd.com>
      Cc: Sean Paul <seanpaul@google.com>
      Cc: Hans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Tested-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200306234623.547525-2-lyude@redhat.com
      b2feb1d6
    • Joe Perches's avatar
      inet: Use fallthrough; · a8eceea8
      Joe Perches authored
      Convert the various uses of fallthrough comments to fallthrough;
      
      Done via script
      Link: https://lore.kernel.org/lkml/b56602fcf79f849e733e7b521bb0e17895d390fa.1582230379.git.joe@perches.com/
      
      And by hand:
      
      net/ipv6/ip6_fib.c has a fallthrough comment outside of an #ifdef block
      that causes gcc to emit a warning if converted in-place.
      
      So move the new fallthrough; inside the containing #ifdef/#endif too.
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a8eceea8
    • Dan Carpenter's avatar
      octeontx2-pf: unlock on error path in otx2_config_pause_frm() · 8a765471
      Dan Carpenter authored
      We need to unlock before returning if this allocation fails.
      
      Fixes: 75f36270 ("octeontx2-pf: Support to enable/disable pause frames via ethtool")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8a765471
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · 807f030b
      Linus Torvalds authored
      Pull vfs fixes from Al Viro:
       "A couple of fixes for old crap in ->atomic_open() instances"
      
      * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        cifs_atomic_open(): fix double-put on late allocation failure
        gfs2_atomic_open(): fix O_EXCL|O_CREAT handling on cold dcache
      807f030b
    • Colin Ian King's avatar
      net: systemport: fix index check to avoid an array out of bounds access · c0368595
      Colin Ian King authored
      Currently the bounds check on index is off by one and can lead to
      an out of bounds access on array priv->filters_loc when index is
      RXCHK_BRCM_TAG_MAX.
      
      Fixes: bb9051a2 ("net: systemport: Add support for WAKE_FILTER")
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c0368595
    • David S. Miller's avatar
      Merge branch 'ipa-fixes' · 0f70eedc
      David S. Miller authored
      Alex Elder says:
      
      ====================
      net: fix net-next
      
      David:	These patches resolve two issues caused by the IPA driver
      	being incorporated into net-next.  I hope you will merge
      	them as soon as you can.
      
      The IPA driver was merged into net-next last week, but two problems
      arise as a result, affecting net-next and linux-next:
        - The patch that defines field_max() was not incorporated into
          net-next, but is required by the IPA code
        - A patch that updates "sdm845.dtsi" *was* incorporated into
          net-next, but other changes to that file in the Qualcomm
          for-next branch lead to errors
      
      Bjorn has agreed to incorporate the DTS file change into the
      Qualcomm tree after it is reverted from net-next.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0f70eedc
    • Alex Elder's avatar
      Revert "arm64: dts: sdm845: add IPA information" · 4639b38b
      Alex Elder authored
      This reverts commit 9cc5ae12.
      
      This commit:
        b303f9f0 arm64: dts: sdm845: Redefine interconnect provider DT nodes
      found in the Qualcomm for-next tree removes/redefines the interconnect
      provider node(s) used for IPA.  I'm not sure whether it technically
      conflicts with the IPA change to "sdm845.dtsi" in for-next, but it renders
      it broken.
      
      Revert this commit in the for-next tree, with the plan to incorporate
      it into the Qualcomm tree instead.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4639b38b
    • Alex Elder's avatar
      bitfield.h: add FIELD_MAX() and field_max() · e31a5016
      Alex Elder authored
      Define FIELD_MAX(), which supplies the maximum value that can be
      represented by a field value.  Define field_max() as well, to go
      along with the lower-case forms of the field mask functions.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Acked-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e31a5016
    • Davide Caratti's avatar
      tc-testing: add ETS scheduler to tdc build configuration · 9d0e0cd9
      Davide Caratti authored
      add CONFIG_NET_SCH_ETS to 'config', otherwise test suites using this file
      to perform a full tdc run will encounter the following warning:
      
        ok 645 e90e - Add ETS qdisc using bands # skipped - "-----> teardown stage" did not complete successfully
      
      Fixes: 82c664b6 ("selftests: qdiscs: Add test coverage for ETS Qdisc")
      Reported-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: default avatarDavide Caratti <dcaratti@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9d0e0cd9
    • Heiner Kallweit's avatar
      net: phy: fix MDIO bus PM PHY resuming · 611d779a
      Heiner Kallweit authored
      So far we have the unfortunate situation that mdio_bus_phy_may_suspend()
      is called in suspend AND resume path, assuming that function result is
      the same. After the original change this is no longer the case,
      resulting in broken resume as reported by Geert.
      
      To fix this call mdio_bus_phy_may_suspend() in the suspend path only,
      and let the phy_device store the info whether it was suspended by
      MDIO bus PM.
      
      Fixes: 503ba7c6 ("net: phy: Avoid multiple suspends")
      Reported-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Tested-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      611d779a
    • David S. Miller's avatar
      Merge branch 'ethtool-netlink-interface-part-3' · 82a9822b
      David S. Miller authored
      Michal Kubecek says:
      
      ====================
      ethtool netlink interface, part 3
      
      Implementation of more netlink request types:
      
        - netdev features (ethtool -k/-K, patches 3-6)
        - private flags (--show-priv-flags / --set-priv-flags, patches 7-9)
        - ring sizes (ethtool -g/-G, patches 10-12)
        - channel counts (ethtool -l/-L, patches 13-15)
      
      Patch 1 is a style cleanup suggested in part 2 review and patch 2 updates
      the mapping between netdev features and legacy ioctl requests (which are
      still used by ethtool for backward compatibility).
      
      Changes in v2:
        - fix netdev reference leaks in error path of ethnl_set_rings() and
          ethnl_set_channels() (found by Jakub Kicinski)
        - use __set_bit() rather than set_bit() (suggested by David Miller)
        - in replies to RINGS_GET and CHANNELS_GET requests, omit ring and
          channel types not supported by driver/device (suggested by Jakub
          Kicinski)
        - more descriptive message size calculations in rings_reply_size() and
          channels_reply_size() (suggested by Jakub Kicinski)
        - coding style cleanup (suggested by Jakub Kicinski)
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      82a9822b
    • Michal Kubecek's avatar
      ethtool: add CHANNELS_NTF notification · 546379b9
      Michal Kubecek authored
      Send ETHTOOL_MSG_CHANNELS_NTF notification whenever channel counts of
      a network device are modified using ETHTOOL_MSG_CHANNELS_SET netlink
      message or ETHTOOL_SCHANNELS ioctl request.
      Signed-off-by: default avatarMichal Kubecek <mkubecek@suse.cz>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      546379b9
    • Michal Kubecek's avatar
      ethtool: set device channel counts with CHANNELS_SET request · e19c591e
      Michal Kubecek authored
      Implement CHANNELS_SET netlink request to set channel counts of a network
      device. These are traditionally set with ETHTOOL_SCHANNELS ioctl request.
      
      Like the ioctl implementation, the generic ethtool code checks if supplied
      values do not exceed driver defined limits; if they do, first offending
      attribute is reported using extack. Checks preventing removing channels
      used for RX indirection table or zerocopy AF_XDP socket are also
      implemented.
      
      Move ethtool_get_max_rxfh_channel() helper into common.c so that it can be
      used by both ioctl and netlink code.
      
      v2:
        - fix netdev reference leak in error path (found by Jakub Kicinsky)
      Signed-off-by: default avatarMichal Kubecek <mkubecek@suse.cz>
      Reviewed-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e19c591e
    • Michal Kubecek's avatar
      ethtool: provide channel counts with CHANNELS_GET request · 0c84979c
      Michal Kubecek authored
      Implement CHANNELS_GET request to get channel counts of a network device.
      These are traditionally available via ETHTOOL_GCHANNELS ioctl request.
      
      Omit attributes for channel types which are not supported by driver or
      device (zero reported for maximum).
      
      v2: (all suggested by Jakub Kicinski)
        - minor cleanup in channels_prepare_data()
        - more descriptive channels_reply_size()
        - omit attributes with zero max count
      Signed-off-by: default avatarMichal Kubecek <mkubecek@suse.cz>
      Reviewed-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0c84979c
    • Michal Kubecek's avatar
      ethtool: add RINGS_NTF notification · bc9d1c99
      Michal Kubecek authored
      Send ETHTOOL_MSG_RINGS_NTF notification whenever ring sizes of a network
      device are modified using ETHTOOL_MSG_RINGS_SET netlink message or
      ETHTOOL_SRINGPARAM ioctl request.
      Signed-off-by: default avatarMichal Kubecek <mkubecek@suse.cz>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bc9d1c99
    • Michal Kubecek's avatar
      ethtool: set device ring sizes with RINGS_SET request · 2fc2929e
      Michal Kubecek authored
      Implement RINGS_SET netlink request to set ring sizes of a network device.
      These are traditionally set with ETHTOOL_SRINGPARAM ioctl request.
      
      Like the ioctl implementation, the generic ethtool code checks if supplied
      values do not exceed driver defined limits; if they do, first offending
      attribute is reported using extack.
      
      v2:
        - fix netdev reference leak in error path (found by Jakub Kicinsky)
      Signed-off-by: default avatarMichal Kubecek <mkubecek@suse.cz>
      Reviewed-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2fc2929e
    • Michal Kubecek's avatar
      ethtool: provide ring sizes with RINGS_GET request · e4a1717b
      Michal Kubecek authored
      Implement RINGS_GET request to get ring sizes of a network device. These
      are traditionally available via ETHTOOL_GRINGPARAM ioctl request.
      
      Omit attributes for ring types which are not supported by driver or device
      (zero reported for maximum).
      
      v2: (all suggested by Jakub Kicinski)
        - minor cleanup in rings_prepare_data()
        - more descriptive rings_reply_size()
        - omit attributes with zero max size
      Signed-off-by: default avatarMichal Kubecek <mkubecek@suse.cz>
      Reviewed-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e4a1717b
    • Michal Kubecek's avatar
      ethtool: add PRIVFLAGS_NTF notification · 111dcba3
      Michal Kubecek authored
      Send ETHTOOL_MSG_PRIVFLAGS_NTF notification whenever private flags of
      a network device are modified using ETHTOOL_MSG_PRIVFLAGS_SET netlink
      message or ETHTOOL_SPFLAGS ioctl request.
      Signed-off-by: default avatarMichal Kubecek <mkubecek@suse.cz>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      111dcba3
    • Michal Kubecek's avatar
      ethtool: set device private flags with PRIVFLAGS_SET request · f265d799
      Michal Kubecek authored
      Implement PRIVFLAGS_SET netlink request to set private flags of a network
      device. These are traditionally set with ETHTOOL_SPFLAGS ioctl request.
      Signed-off-by: default avatarMichal Kubecek <mkubecek@suse.cz>
      Reviewed-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f265d799
    • Michal Kubecek's avatar
      ethtool: provide private flags with PRIVFLAGS_GET request · e16c3386
      Michal Kubecek authored
      Implement PRIVFLAGS_GET request to get private flags for a network device.
      These are traditionally available via ETHTOOL_GPFLAGS ioctl request.
      Signed-off-by: default avatarMichal Kubecek <mkubecek@suse.cz>
      Reviewed-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e16c3386
    • Michal Kubecek's avatar
      ethtool: add FEATURES_NTF notification · 9c6451ef
      Michal Kubecek authored
      Send ETHTOOL_MSG_FEATURES_NTF notification whenever network device features
      are modified using ETHTOOL_MSG_FEATURES_SET netlink message, ethtool ioctl
      request or any other way resulting in call to netdev_update_features() or
      netdev_change_features()
      Signed-off-by: default avatarMichal Kubecek <mkubecek@suse.cz>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9c6451ef
    • Michal Kubecek's avatar
      ethtool: set netdev features with FEATURES_SET request · 0980bfcd
      Michal Kubecek authored
      Implement FEATURES_SET netlink request to set network device features.
      These are traditionally set using ETHTOOL_SFEATURES ioctl request.
      
      Actual change is subject to netdev_change_features() sanity checks so that
      it can differ from what was requested. Unlike with most other SET requests,
      in addition to error code and optional extack, kernel provides an optional
      reply message (ETHTOOL_MSG_FEATURES_SET_REPLY) in the same format but with
      different semantics: information about difference between user request and
      actual result and difference between old and new state of dev->features.
      This reply message can be suppressed by setting ETHTOOL_FLAG_OMIT_REPLY
      flag in request header.
      Signed-off-by: default avatarMichal Kubecek <mkubecek@suse.cz>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0980bfcd
    • Michal Kubecek's avatar
      ethtool: add ethnl_parse_bitset() helper · 88db6d1e
      Michal Kubecek authored
      Unlike other SET type commands, modifying netdev features is required to
      provide a reply telling userspace what was actually changed, compared to
      what was requested. For that purpose, the "modified" flag provided by
      ethnl_update_bitset() is not sufficient, we need full information which
      bits were requested to change.
      
      Therefore provide ethnl_parse_bitset() returning effective value and mask
      bitmaps equivalent to the contents of a bitset nested attribute.
      
      v2: use non-atomic __set_bit() (suggested by David Miller)
      Signed-off-by: default avatarMichal Kubecek <mkubecek@suse.cz>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      88db6d1e
    • Michal Kubecek's avatar
      ethtool: provide netdev features with FEATURES_GET request · 0524399d
      Michal Kubecek authored
      Implement FEATURES_GET request to get network device features. These are
      traditionally available via ETHTOOL_GFEATURES ioctl request.
      
      v2:
        - style cleanup suggested by Jakub Kicinski
      Signed-off-by: default avatarMichal Kubecek <mkubecek@suse.cz>
      Reviewed-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0524399d
    • Michal Kubecek's avatar
      ethtool: update mapping of features to legacy ioctl requests · f70bb065
      Michal Kubecek authored
      Legacy ioctl request like ETHTOOL_GTXCSUM are still used by ethtool utility
      to get values of legacy flags (which rather work as feature groups). These
      are calculated from values of actual features and request to set them is
      implemented as an attempt to set all features mapping to them but there are
      two inconsistencies:
      
      - tx-checksum-fcoe-crc is shown under tx-checksumming but NETIF_F_FCOE_CRC
        is not included in ETHTOOL_GTXCSUM/ETHTOOL_STXCSUM
      - tx-scatter-gather-fraglist is shown under scatter-gather but
        NETIF_F_FRAGLIST is not included in ETHTOOL_GSG/ETHTOOL_SSG
      
      As the mapping in ethtool output is more correct from logical point of
      view, fix ethtool_get_feature_mask() to match it.
      Signed-off-by: default avatarMichal Kubecek <mkubecek@suse.cz>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f70bb065
    • Michal Kubecek's avatar
      ethtool: rename ethnl_parse_header() to ethnl_parse_header_dev_get() · 98130546
      Michal Kubecek authored
      Andrew Lunn pointed out that even if it's documented that
      ethnl_parse_header() takes reference to network device if it fills it
      into the target structure, its name doesn't make it apparent so that
      corresponding dev_put() looks like mismatched.
      
      Rename the function ethnl_parse_header_dev_get() to indicate that it
      takes a reference.
      Suggested-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarMichal Kubecek <mkubecek@suse.cz>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      98130546
    • Al Viro's avatar
      cifs_atomic_open(): fix double-put on late allocation failure · d9a9f484
      Al Viro authored
      several iterations of ->atomic_open() calling conventions ago, we
      used to need fput() if ->atomic_open() failed at some point after
      successful finish_open().  Now (since 2016) it's not needed -
      struct file carries enough state to make fput() work regardless
      of the point in struct file lifecycle and discarding it on
      failure exits in open() got unified.  Unfortunately, I'd missed
      the fact that we had an instance of ->atomic_open() (cifs one)
      that used to need that fput(), as well as the stale comment in
      finish_open() demanding such late failure handling.  Trivially
      fixed...
      
      Fixes: fe9ec829 "do_last(): take fput() on error after opening to out:"
      Cc: stable@kernel.org # v4.7+
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      d9a9f484
    • Al Viro's avatar
      gfs2_atomic_open(): fix O_EXCL|O_CREAT handling on cold dcache · 21039132
      Al Viro authored
      with the way fs/namei.c:do_last() had been done, ->atomic_open()
      instances needed to recognize the case when existing file got
      found with O_EXCL|O_CREAT, either by falling back to finish_no_open()
      or failing themselves.  gfs2 one didn't.
      
      Fixes: 6d4ade98 (GFS2: Add atomic_open support)
      Cc: stable@kernel.org # v3.11
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      21039132
    • David S. Miller's avatar
      Merge branch 'Introduce-connection-tracking-offload' · f8ab3047
      David S. Miller authored
      Paul Blakey says:
      
      ====================
      Introduce connection tracking offload
      
      Background
      ----------
      
      The connection tracking action provides the ability to associate connection state to a packet.
      The connection state may be used for stateful packet processing such as stateful firewalls
      and NAT operations.
      
      Connection tracking in TC SW
      ----------------------------
      
      The CT state may be matched only after the CT action is performed.
      As such, CT use cases are commonly implemented using multiple chains.
      Consider the following TC filters, as an example:
      1. tc filter add dev ens1f0_0 ingress prio 1 chain 0 proto ip flower \
          src_mac 24:8a:07:a5:28:01 ct_state -trk \
          action ct \
          pipe action goto chain 2
      
      2. tc filter add dev ens1f0_0 ingress prio 1 chain 2 proto ip flower \
          ct_state +trk+new \
          action ct commit \
          pipe action tunnel_key set \
              src_ip 0.0.0.0 \
              dst_ip 7.7.7.8 \
              id 98 \
              dst_port 4789 \
          action mirred egress redirect dev vxlan0
      
      3. tc filter add dev ens1f0_0 ingress prio 1 chain 2 proto ip flower \
          ct_state +trk+est \
          action tunnel_key set \
              src_ip 0.0.0.0 \
              dst_ip 7.7.7.8 \
              id 98 \
              dst_port 4789 \
          action mirred egress redirect dev vxlan0
      
      Filter #1 (chain 0) decides, after initial packet classification, to send the packet to the
      connection tracking module (ct action).
      Once the ct_state is initialized by the CT action the packet processing continues on chain 2.
      
      Chain 2 classifies the packet based on the ct_state.
      Filter #2 matches on the +trk+new CT state while filter #3 matches on the +trk+est ct_state.
      
      MLX5 Connection tracking HW offload - MLX5 driver patches
      ------------------------------
      
      The MLX5 hardware model aligns with the software model by realizing a multi-table
      architecture. In SW the TC CT action sets the CT state on the skb. Similarly,
      HW sets the CT state on a HW register. Driver gets this CT state while offloading
      a tuple with a new ct_metadata action that provides it.
      
      Matches on ct_state are translated to HW register matches.
      
      TC filter with CT action broken to two rules, a pre_ct rule, and a post_ct rule.
      pre_ct rule:
         Inserted on the corrosponding tc chain table, matches on original tc match, with
         actions: any pre ct actions, set fte_id, set zone, and goto the ct table.
         The fte_id is a register mapping uniquely identifying this filter.
      post_ct_rule:
         Inserted in a post_ct table, matches on the fte_id register mapping, with
         actions: counter + any post ct actions (this is usally 'goto chain X')
      
      post_ct table is a table that all the tuples inserted to the ct table goto, so
      if there is a tuple hit, packet will continue from ct table to post_ct table,
      after being marked with the CT state (mark/label..)
      
      This design ensures that the rule's actions and counters will be executed only after a CT hit.
      HW misses will continue processing in SW from the last chain ID that was processed in hardware.
      
      The following illustrates the HW model:
      
      +-------------------+      +--------------------+    +--------------+
      + pre_ct (tc chain) +----->+ CT (nat or no nat) +--->+ post_ct      +----->
      + original match    +   |  + tuple + zone match + |  + fte_id match +  |
      +-------------------+   |  +--------------------+ |  +--------------+  |
                              v                         v                    v
                           set chain miss mapping    set mark             original
                           set fte_id                set label            filter
                           set zone                  set established      actions
                           set tunnel_id             do nat (if needed)
                           do decap
      
      To fill CT table, driver registers a CB for flow offload events, for each new
      flow table that is passed to it from offloading ct actions. Once a flow offload
      event is triggered on this CB, offload this flow to the hardware CT table.
      
      Established events offload
      --------------------------
      
      Currently, act_ct maintains an FT instance per ct zone. Flow table entries
      are created, per ct connection, when connections enter an established
      state and deleted otherwise. Once an entry is created, the FT assumes
      ownership of the entries, and manages their aging. FT is used for software
      offload of conntrack. FT entries associate 5-tuples with an action list.
      
      The act_ct changes in this patchset:
      Populate the action list with a (new) ct_metadata action, providing the
      connection's ct state (zone,mark and label), and mangle actions if NAT
      is configured.
      
      Pass the action's flow table instance as ct action entry parameter,
      so  when the action is offloaded, the driver may register a callback on
      it's block to receive FT flow offload add/del/stats events.
      
      Netilter changes
      --------------------------
      The netfilter changes export the relevant bits, and add the relevant CBs
      to support the above.
      
      Applying this patchset
      --------------------------
      
      On top of current net-next ("r8169: simplify getting stats by using netdev_stats_to_stats64"),
      pull Saeed's ct-offload branch, from git git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git
      and fix the following non trivial conflict in fs_core.c as follows:
      
      Then apply this patchset.
      
      Changelog:
        v2->v3:
          Added the first two patches needed after rebasing on net-next:
           "net/mlx5: E-Switch, Enable reg c1 loopback when possible"
           "net/mlx5e: en_rep: Create uplink rep root table after eswitch offloads table"
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f8ab3047
    • Paul Blakey's avatar
      net/mlx5e: CT: Support clear action · 1ef3018f
      Paul Blakey authored
      Clear action, as with software, removes all ct metadata from
      the packet.
      Signed-off-by: default avatarPaul Blakey <paulb@mellanox.com>
      Reviewed-by: default avatarOz Shlomo <ozsh@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1ef3018f