Skip to content
  1. Oct 24, 2018
    • David Howells's avatar
      afs: Improve FS server rotation error handling · e7f680f4
      David Howells authored
      Improve the error handling in FS server rotation by:
      
       (1) Cache the latest useful error value for the fs operation as a whole in
           struct afs_fs_cursor separately from the error cached in the
           afs_addr_cursor struct.  The one in the address cursor gets clobbered
           occasionally.  Copy over the error to the fs operation only when it's
           something we'd be interested in passing to userspace.
      
       (2) Make it so that EDESTADDRREQ is the default that is seen only if no
           addresses are available to be accessed.
      
       (3) When calling utility functions, such as checking a volume status or
           probing a fileserver, don't let a successful result clobber the cached
           error in the cursor; instead, stash the result in a temporary variable
           until it has been assessed.
      
       (4) Don't return ETIMEDOUT or ETIME if a better error, such as
           ENETUNREACH, is already cached.
      
       (5) On leaving the rotation loop, turn any remote abort code into a more
           useful error than ECONNABORTED.
      
      Fixes: d2ddc776
      
       ("afs: Overhaul volume and server record caching and fileserver rotation")
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      e7f680f4
    • David Howells's avatar
      afs: Set up the iov_iter before calling afs_extract_data() · 12bdcf33
      David Howells authored
      
      
      afs_extract_data sets up a temporary iov_iter and passes it to AF_RXRPC
      each time it is called to describe the remaining buffer to be filled.
      
      Instead:
      
       (1) Put an iterator in the afs_call struct.
      
       (2) Set the iterator for each marshalling stage to load data into the
           appropriate places.  A number of convenience functions are provided to
           this end (eg. afs_extract_to_buf()).
      
           This iterator is then passed to afs_extract_data().
      
       (3) Use the new ITER_DISCARD iterator to discard any excess data provided
           by FetchData.
      
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      12bdcf33
    • David Howells's avatar
      afs: Better tracing of protocol errors · 160cb957
      David Howells authored
      
      
      Include the site of detection of AFS protocol errors in trace lines to
      better be able to determine what went wrong.
      
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      160cb957
    • David Howells's avatar
      iov_iter: Add I/O discard iterator · 9ea9ce04
      David Howells authored
      
      
      Add a new iterator, ITER_DISCARD, that can only be used in READ mode and
      just discards any data copied to it.
      
      This is useful in a network filesystem for discarding any unwanted data
      sent by a server.
      
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      9ea9ce04
    • David Howells's avatar
      iov_iter: Separate type from direction and use accessor functions · aa563d7b
      David Howells authored
      
      
      In the iov_iter struct, separate the iterator type from the iterator
      direction and use accessor functions to access them in most places.
      
      Convert a bunch of places to use switch-statements to access them rather
      then chains of bitwise-AND statements.  This makes it easier to add further
      iterator types.  Also, this can be more efficient as to implement a switch
      of small contiguous integers, the compiler can use ~50% fewer compare
      instructions than it has to use bitwise-and instructions.
      
      Further, cease passing the iterator type into the iterator setup function.
      The iterator function can set that itself.  Only the direction is required.
      
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      aa563d7b
    • David Howells's avatar
      iov_iter: Use accessor function · 00e23707
      David Howells authored
      
      
      Use accessor functions to access an iterator's type and direction.  This
      allows for the possibility of using some other method of determining the
      type of iterator than if-chains with bitwise-AND conditions.
      
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      00e23707
    • David Howells's avatar
      amd-gpu: Don't undefine READ and WRITE · 1fcb748d
      David Howells authored
      Remove the undefinition of READ and WRITE because these constants may be
      used elsewhere in subsequently included header files, thus breaking them.
      
      These constants don't actually appear to be used in the driver, so the
      undefinition seems pointless.
      
      Fixes: 4562236b
      
       ("drm/amd/dc: Add dc display driver (v2)")
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      1fcb748d
  2. Oct 20, 2018
  3. Oct 19, 2018
    • Greg Kroah-Hartman's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 91b15613
      Greg Kroah-Hartman authored
      David writes:
        "Networking
      
         1) Fix gro_cells leak in xfrm layer, from Li RongQing.
      
         2) BPF selftests change RLIMIT_MEMLOCK blindly, don't do that.  From
            Eric Dumazet.
      
         3) AF_XDP calls synchronize_net() under RCU lock, fix from Björn
            Töpel.
      
         4) Out of bounds packet access in _decode_session6(), from Alexei
            Starovoitov.
      
         5) Several ethtool bugs, where we copy a struct into the kernel twice
            and our validations of the values in the first copy can be
            invalidated by the second copy due to asynchronous updates to the
            memory by the user.  From Wenwen Wang.
      
         6) Missing netlink attribute validation in cls_api, from Davide
            Caratti.
      
         7) LLC SAP sockets neet to be SOCK_RCU FREE, from Cong Wang.
      
         8) rxrpc operates on wrong kvec, from Yue Haibing.
      
         9) A regression was introduced by the disassosciation of route
            neighbour references in rt6_probe(), causing probe for
            neighbourless routes to not be properly rate limited.  Fix from
            Sabrina Dubroca.
      
         10) Unsafe RCU locking in tipc, from Tung Nguyen.
      
         11) Use after free in inet6_mc_check(), from Eric Dumazet.
      
         12) PMTU from icmp packets should update the SCTP transport pathmtu,
             from Xin Long.
      
         13) Missing peer put on error in rxrpc, from David Howells.
      
         14) Fix pedit in nfp driver, from Pieter Jansen van Vuuren.
      
         15) Fix overflowing shift statement in qla3xxx driver, from Nathan
             Chancellor.
      
         16) Fix Spectre v1 in ptp code, from Gustavo A. R. Silva.
      
         17) udp6_unicast_rcv_skb() interprets udpv6_queue_rcv_skb() return
             value in an inverted manner, fix from Paolo Abeni.
      
         18) Fix missed unresolved entries in ipmr dumps, from Nikolay
             Aleksandrov.
      
         19) Fix NAPI handling under high load, we can completely miss events
             when NAPI has to loop more than one time in a cycle.  From Heiner
             Kallweit."
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (49 commits)
        ip6_tunnel: Fix encapsulation layout
        tipc: fix info leak from kernel tipc_event
        net: socket: fix a missing-check bug
        net: sched: Fix for duplicate class dump
        r8169: fix NAPI handling under high load
        net: ipmr: fix unresolved entry dumps
        net: mscc: ocelot: Fix comment in ocelot_vlant_wait_for_completion()
        sctp: fix the data size calculation in sctp_data_size
        virtio_net: avoid using netif_tx_disable() for serializing tx routine
        udp6: fix encap return code for resubmitting
        mlxsw: core: Fix use-after-free when flashing firmware during init
        sctp: not free the new asoc when sctp_wait_for_connect returns err
        sctp: fix race on sctp_id2asoc
        r8169: re-enable MSI-X on RTL8168g
        net: bpfilter: use get_pid_task instead of pid_task
        ptp: fix Spectre v1 vulnerability
        net: qla3xxx: Remove overflowing shift statement
        geneve, vxlan: Don't set exceptions if skb->len < mtu
        geneve, vxlan: Don't check skb_dst() twice
        sctp: get pr_assoc and pr_stream all status with SCTP_PR_SCTP_ALL instead
        ...
      91b15613
    • Greg Kroah-Hartman's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc · 2a966610
      Greg Kroah-Hartman authored
      David writes:
        "Sparc fixes:
      
         The main bit here is fixing how fallback system calls are handled in
         the sparc vDSO.
      
         Unfortunately, I fat fingered the commit and some perf debugging
         hacks slipped into the vDSO fix, which I revert in the very next
         commit."
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
        sparc: Revert unintended perf changes.
        sparc: vDSO: Silence an uninitialized variable warning
        sparc: Fix syscall fallback bugs in VDSO.
      2a966610
    • Greg Kroah-Hartman's avatar
      Merge tag 'drm-fixes-2018-10-19' of git://anongit.freedesktop.org/drm/drm · 7555c5d5
      Greg Kroah-Hartman authored
      Dave writes:
        "drm fixes for 4.19 final
      
         Just a last set of misc core fixes for final.
      
         4 fixes, one use after free, one fb integration fix, one EDID fix,
         and one laptop panel quirk,"
      
      * tag 'drm-fixes-2018-10-19' of git://anongit.freedesktop.org/drm/drm:
        drm/edid: VSDB yCBCr420 Deep Color mode bit definitions
        drm: fix use of freed memory in drm_mode_setcrtc
        drm: fb-helper: Reject all pixel format changing requests
        drm/edid: Add 6 bpc quirk for BOE panel in HP Pavilion 15-n233sl
      7555c5d5
    • Greg Kroah-Hartman's avatar
      Merge tag 'for-gkh' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma · eb6d938f
      Greg Kroah-Hartman authored
      Doug writes:
        "Really final for-rc pull request for 4.19
      
         Ok, so last week I thought we had sent our final pull request for
         4.19.  Well, wouldn't ya know someone went and found a couple Spectre
         v1 fixes were needed :-/.  So, a couple *very* small specter patches
         for this (hopefully) final -rc week."
      
      * tag 'for-gkh' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
        RDMA/ucma: Fix Spectre v1 vulnerability
        IB/ucm: Fix Spectre v1 vulnerability
      eb6d938f
    • Dave Airlie's avatar
      Merge tag 'drm-misc-fixes-2018-10-18' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes · f8e6e1b6
      Dave Airlie authored
      
      
      drm-misc-fixes for v4.19:
      - Fix use of freed memory in drm_mode_setcrtc.
      - Reject pixel format changing requests in fb helper.
      - Add 6 bpc quirk for HP Pavilion 15-n233sl
      - Fix VSDB yCBCr420 Deep Color mode bit definitions
      
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      
      From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/647fe5d0-4ec5-57cc-9f23-a4836b29e278@linux.intel.com
      f8e6e1b6
    • Colin Ian King's avatar
      qed: fix spelling mistake "transcevier" -> "transceiver" · 1107a674
      Colin Ian King authored
      
      
      Trivial fix to spelling mistake in DP_INFO message.
      
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1107a674
    • David S. Miller's avatar
      Merge tag 'mlx5-updates-2018-10-18' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux · 02e6dae6
      David S. Miller authored
      Saeed Mahameed says:
      
      ====================
      mlx5-updates-2018-10-18
      
      This series provides misc updates to mlx5 core and netdevice driver.
      
      1) From Tariq Toukan: Refactor fragmented buffer struct fields and init flow.
      
      2) From Vlad Buslov, Flow counters cache improvements and fixes follow up.
      as a follow up work for the previous series of the mlx5 flow counters,
      Vlad provides two fixes:
        2.1) Take fs_counters dellist before addlist
      Fixes: 6e5e2283 ("net/mlx5: Add new list to store deleted flow counters")
        2.2) Remove counter from idr after removing it from list
      Fixes: 12d6066c
      
       ("net/mlx5: Add flow counters idr")
      
      From Shay Agroskin,
      3) Add FEC set/get FW commands and FEC ethtool callbacks support
      4) Add new ethtool statistics to cover errors on rx, such as FEC errors.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      02e6dae6
    • Stefano Brivio's avatar
      ip6_tunnel: Fix encapsulation layout · d4d576f5
      Stefano Brivio authored
      Commit 058214a4 ("ip6_tun: Add infrastructure for doing
      encapsulation") added the ip6_tnl_encap() call in ip6_tnl_xmit(), before
      the call to ipv6_push_frag_opts() to append the IPv6 Tunnel Encapsulation
      Limit option (option 4, RFC 2473, par. 5.1) to the outer IPv6 header.
      
      As long as the option didn't actually end up in generated packets, this
      wasn't an issue. Then commit 89a23c8b ("ip6_tunnel: Fix missing tunnel
      encapsulation limit option") fixed sending of this option, and the
      resulting layout, e.g. for FoU, is:
      
      .-------------------.------------.----------.-------------------.----- - -
      | Outer IPv6 Header | UDP header | Option 4 | Inner IPv6 Header | Payload
      '-------------------'------------'----------'-------------------'----- - -
      
      Needless to say, FoU and GUE (at least) won't work over IPv6. The option
      is appended by default, and I couldn't find a way to disable it with the
      current iproute2.
      
      Turn this into a more reasonable:
      
      .-------------------.----------.------------.-------------------.----- - -
      | Outer IPv6 Header | Option 4 | UDP header | Inner IPv6 Header | Payload
      '-------------------'----------'------------'-------------------'----- - -
      
      With this, and with 84dad559 ("udp6: fix encap return code for
      resubmitting"), FoU and GUE work again over IPv6.
      
      Fixes: 058214a4
      
       ("ip6_tun: Add infrastructure for doing encapsulation")
      Signed-off-by: default avatarStefano Brivio <sbrivio@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d4d576f5
    • Eric Dumazet's avatar
      tcp: fix TCP_REPAIR xmit queue setup · 79861919
      Eric Dumazet authored
      Andrey reported the following warning triggered while running CRIU tests:
      
      tcp_clean_rtx_queue()
      ...
      	last_ackt = tcp_skb_timestamp_us(skb);
      	WARN_ON_ONCE(last_ackt == 0);
      
      This is caused by 5f6188a8 ("tcp: do not change tcp_wstamp_ns
      in tcp_mstamp_refresh"), as we end up having skbs in retransmit queue
      with a zero skb->skb_mstamp_ns field.
      
      We could fix this bug in different ways, like making sure
      tp->tcp_wstamp_ns is not zero at socket creation, but as Neal pointed
      out, we also do not want that pacing status of a repaired socket
      could push tp->tcp_wstamp_ns far ahead in the future.
      
      So we prefer changing tcp_write_xmit() to not call tcp_update_skb_after_send()
      and instead do what is requested by TCP_REPAIR logic.
      
      Fixes: 5f6188a8
      
       ("tcp: do not change tcp_wstamp_ns in tcp_mstamp_refresh")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarAndrey Vagin <avagin@openvz.org>
      Acked-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
      Acked-by: default avatarNeal Cardwell <ncardwell@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      79861919
    • Jon Maloy's avatar
      tipc: fix info leak from kernel tipc_event · b06f9d9f
      Jon Maloy authored
      
      
      We initialize a struct tipc_event allocated on the kernel stack to
      zero to avert info leak to user space.
      
      Reported-by: default avatar <syzbot+057458894bc8cada4dee@syzkaller.appspotmail.com>
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b06f9d9f
    • Zhao Chen's avatar
      net-next/hinic: add checksum offload and TSO support · cc18a754
      Zhao Chen authored
      
      
      This patch adds checksum offload and TSO support for the HiNIC
      driver. Perfomance test (Iperf) shows more than 100% improvement
      in TCP streams.
      
      Signed-off-by: default avatarZhao Chen <zhaochen6@huawei.com>
      Signed-off-by: default avatarXue Chaojing <xuechaojing@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cc18a754
    • Wenwen Wang's avatar
      net: socket: fix a missing-check bug · b6168562
      Wenwen Wang authored
      
      
      In ethtool_ioctl(), the ioctl command 'ethcmd' is checked through a switch
      statement to see whether it is necessary to pre-process the ethtool
      structure, because, as mentioned in the comment, the structure
      ethtool_rxnfc is defined with padding. If yes, a user-space buffer 'rxnfc'
      is allocated through compat_alloc_user_space(). One thing to note here is
      that, if 'ethcmd' is ETHTOOL_GRXCLSRLALL, the size of the buffer 'rxnfc' is
      partially determined by 'rule_cnt', which is actually acquired from the
      user-space buffer 'compat_rxnfc', i.e., 'compat_rxnfc->rule_cnt', through
      get_user(). After 'rxnfc' is allocated, the data in the original user-space
      buffer 'compat_rxnfc' is then copied to 'rxnfc' through copy_in_user(),
      including the 'rule_cnt' field. However, after this copy, no check is
      re-enforced on 'rxnfc->rule_cnt'. So it is possible that a malicious user
      race to change the value in the 'compat_rxnfc->rule_cnt' between these two
      copies. Through this way, the attacker can bypass the previous check on
      'rule_cnt' and inject malicious data. This can cause undefined behavior of
      the kernel and introduce potential security risk.
      
      This patch avoids the above issue via copying the value acquired by
      get_user() to 'rxnfc->rule_cn', if 'ethcmd' is ETHTOOL_GRXCLSRLALL.
      
      Signed-off-by: default avatarWenwen Wang <wang6495@umn.edu>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b6168562
    • Ganesh Goudar's avatar
      cxgb4: fix the error path of cxgb4_uld_register() · 40b06553
      Ganesh Goudar authored
      
      
      On multi adapter setup if the uld registration fails even on
      one adapter, the allocated resources for the uld on all the
      adapters are freed, rendering the functioning adapters unusable.
      
      This commit fixes the issue by freeing the allocated resources
      only for the failed adapter.
      
      Signed-off-by: default avatarGanesh Goudar <ganeshgr@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      40b06553
    • Phil Sutter's avatar
      net: sched: Fix for duplicate class dump · 3c53ed8f
      Phil Sutter authored
      When dumping classes by parent, kernel would return classes twice:
      
      | # tc qdisc add dev lo root prio
      | # tc class show dev lo
      | class prio 8001:1 parent 8001:
      | class prio 8001:2 parent 8001:
      | class prio 8001:3 parent 8001:
      | # tc class show dev lo parent 8001:
      | class prio 8001:1 parent 8001:
      | class prio 8001:2 parent 8001:
      | class prio 8001:3 parent 8001:
      | class prio 8001:1 parent 8001:
      | class prio 8001:2 parent 8001:
      | class prio 8001:3 parent 8001:
      
      This comes from qdisc_match_from_root() potentially returning the root
      qdisc itself if its handle matched. Though in that case, root's classes
      were already dumped a few lines above.
      
      Fixes: cb395b20
      
       ("net: sched: optimize class dumps")
      Signed-off-by: default avatarPhil Sutter <phil@nwl.cc>
      Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3c53ed8f
    • Dan Carpenter's avatar
      bnxt_en: Copy and paste bug in extended tx_stats · 35b842f2
      Dan Carpenter authored
      The struct type was copied from the line before but it should be "tx"
      instead of "rx".  I have reviewed the code and I can't immediately see
      that this bug causes a runtime issue.
      
      Fixes: 36e53349
      
       ("bnxt_en: Add additional extended port statistics.")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Acked-by: default avatarMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      35b842f2
    • David S. Miller's avatar
      Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue · 817e9290
      David S. Miller authored
      
      
      Jeff Kirsher says:
      
      ====================
      Intel Wired LAN Doc Updates 2018-10-18
      
      This series contains documentation fixes and updates for Intel wired
      LAN drivers.
      
      The following was done:
       - Updated incorrect URLs
       - removed document references which did not apply to the current
         in-kernel drivers
       - added documentation for fm10k driver
       - added missing documentation on existing or new features
       - added SPDX headers to all the documentation files
      
      Lastly, the documentation was converted over to the RST (reStructured
      Text) format, so that 'make htmldocs' produces pretty html driver
      documentation for our drivers.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      817e9290
    • Nathan Chancellor's avatar
      atm: zatm: Fix empty body Clang warnings · 64b9d16e
      Nathan Chancellor authored
      
      
      Clang warns:
      
      drivers/atm/zatm.c:513:7: error: while loop has empty body
      [-Werror,-Wempty-body]
              zwait;
                   ^
      drivers/atm/zatm.c:513:7: note: put the semicolon on a separate line to
      silence this warning
      
      Get rid of this warning by using an empty do-while loop. While we're at
      it, add parentheses to make it clear that this is a function-like macro.
      
      Link: https://github.com/ClangBuiltLinux/linux/issues/42
      Suggested-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      64b9d16e
    • Nathan Chancellor's avatar
      atm: eni: Move semicolon to a new line after empty for loop · 3e73cc5c
      Nathan Chancellor authored
      
      
      Clang warns:
      
      drivers/atm/eni.c:244:48: error: for loop has empty body
      [-Werror,-Wempty-body]
              for (order = 0; (1 << order) < *size; order++);
                                                            ^
      drivers/atm/eni.c:244:48: note: put the semicolon on a separate line to
      silence this warning
      
      In this case, that loop is expected to be empty so silence the warning
      in the way that Clang suggests.
      
      Link: https://github.com/ClangBuiltLinux/linux/issues/42
      Suggested-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3e73cc5c
    • David Ahern's avatar
      MAINTAINERS: Update contact info for VRF entry · d93adca7
      David Ahern authored
      
      
      Update Shrijeet's email address for the VRF entry.
      
      Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d93adca7
    • Shay Agroskin's avatar
      net/mlx5e: Added 'raw_errors_laneX' fields to ethtool statistics · 4cb4e98e
      Shay Agroskin authored
      
      
      These are counters for errors received on rx side, such as
      FEC errors.
      
      Signed-off-by: default avatarShay Agroskin <shayag@mellanox.com>
      Reviewed-by: default avatarEran Ben Elisha <eranbe@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      4cb4e98e
    • Shay Agroskin's avatar
      net/mlx5: Added "per_lane_error_counters" cap bit to PCAM · 67daf118
      Shay Agroskin authored
      
      
      Added "Per lane raw errors" capability bit in
      Ports Capabilities Mask (PCAM) enhanced features
      layout.
      
      This bit determines if the fields "phy_raw_errors_laneX"
      in "Physical Layer statistical" counters group are supported.
      
      Signed-off-by: default avatarShay Agroskin <shayag@mellanox.com>
      Reviewed-by: default avatarEran Ben Elisha <eranbe@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      67daf118
    • Shay Agroskin's avatar
      net/mlx5e: Ethtool driver callback for query/set FEC policy · 6cfa9460
      Shay Agroskin authored
      
      
      Driver callback function for 'ethtool --show-fec',
      'ethtool --set-fec' commands.
      
      The query function returns active and configured FEC policy
      for current link speed.
      
      The set function sets FEC policy for all supported link
      speeds.
      1) If current link speed doesn't support requested FEC policy,
         the function fails.
      2) If a different link speed doesn't support requested FEC
         policy, FEC capbilities for this speed are turned off.
      
      Signed-off-by: default avatarShay Agroskin <shayag@mellanox.com>
      Reviewed-by: default avatarEran Ben Elisha <eranbe@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      6cfa9460
    • Shay Agroskin's avatar
      net/mlx5e: Add port FEC get/set functions · 2095b264
      Shay Agroskin authored
      
      
      Added functions to query and set link FEC policy.
      To get/set FEC capabilities in PPLM reg we need to query
      current link speed.
      'mlx5_get_fec_speed_field' queries current link speed and returns
      correct field offset.
      
      FEC Query's return value is divided into 'active FEC policy', which is
      the FEC policy used by the link, and 'configured FEC policy', which
      is the FEC policy requested by the user.
      The two values may differ if:
      1) FEC policy was configured to 'auto',
         in which case the active FEC policy would be the default FEC policy
         for current link speed.
      
      2) FEC policy was changed, but no link reset is performed. In which case,
         the active FEC policy would become the configured one after a link
         reset.
      
      FEC set function sets FEC policy for all link speeds and perform link
      reset.
      1) If current link speed doesn't support requested FEC policy,
         the function fails.
      2) If a different link speed doesn't support requested FEC policy,
         FEC capbilities for this speed are turned off and a warning message
         is printed.
      
      Signed-off-by: default avatarShay Agroskin <shayag@mellanox.com>
      Reviewed-by: default avatarEran Ben Elisha <eranbe@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      2095b264
    • Shay Agroskin's avatar
      net/mlx5: Add FEC fields to Port Phy Link Mode (PPLM) reg · 4b5b9c7d
      Shay Agroskin authored
      
      
      Added FEC related fields to PPLM layout.
      These fields are needed to set and query FEC policy
      for different link speeds.
      
      Signed-off-by: default avatarShay Agroskin <shayag@mellanox.com>
      Reviewed-by: default avatarEran Ben Elisha <eranbe@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      4b5b9c7d
    • Vlad Buslov's avatar
      net/mlx5: Remove counter from idr after removing it from list · 2a4c4298
      Vlad Buslov authored
      Fs_counters list can temporary become unsorted when new counters are
      created/deleted concurrently. Idr is used to quickly lookup position to
      insert new counter in logarithmic time. However, if new flows are
      concurrently inserted during time window when flows with adjacent ids are
      already removed from idr but are still present in counters list,
      mlx5_fc_stats_work() observes counters list in inconsistent state, which
      results following warning:
      
      [ 1839.561955] mlx5_core 0000:81:00.0: mlx5_cmd_fc_bulk_get:587:(pid 729): Flow counter id (0x102d5) out of range (0x1c0a8..0x1c10b). Counter ignored.
      
      Move idr_remove() call to be executed synchronously with counter deletion
      from list. Extract this code to mlx5_fc_stats_remove() helper function that
      is called by workqueue job handler mlx5_fc_stats_work().
      
      Fixes: 12d6066c
      
       ("net/mlx5: Add flow counters idr")
      Signed-off-by: default avatarVlad Buslov <vladbu@mellanox.com>
      Reviewed-by: default avatarRoi Dayan <roid@mellanox.com>
      2a4c4298
    • Vlad Buslov's avatar
      net/mlx5: Take fs_counters dellist before addlist · fd330713
      Vlad Buslov authored
      In fs_counters elements from both addlist and dellist are removed by
      mlx5_fc_stats_work() without any locking. This introduces race condition
      when batch of new rules is created and then immediately deleted (for
      example, when error occurred during flow creation). In such case some of
      the rules might be in dellist, but not in addlist when mlx5_fc_stats_work()
      is executed concurrently with tc, which will result rule deletion and
      use-after-free on next iteration because deleted rules are still in
      addlist.
      
      Always take dellist first to guarantee that rules can only be deleted after
      they were removed from addlist.
      
      Fixes: 6e5e2283
      
       ("net/mlx5: Add new list to store deleted flow counters")
      Signed-off-by: default avatarVlad Buslov <vladbu@mellanox.com>
      Reported-by: default avatarChris Mi <chrism@mellanox.com>
      Reviewed-by: default avatarRoi Dayan <roid@mellanox.com>
      fd330713
    • Tariq Toukan's avatar
      net/mlx5: Refactor fragmented buffer struct fields and init flow · 4972e6fa
      Tariq Toukan authored
      
      
      Take struct mlx5_frag_buf out of mlx5_frag_buf_ctrl, as it is not
      needed to manage and control the datapath of the fragmented buffers API.
      
      struct mlx5_frag_buf contains control info to manage the allocation
      and de-allocation of the fragmented buffer.
      Its fields are not relevant for datapath, so here I take them out of the
      struct mlx5_frag_buf_ctrl, except for the fragments array itself.
      
      In addition, modified mlx5_fill_fbc to initialise the frags pointers
      as well. This implies that the buffer must be allocated before the
      function is called.
      
      A set of type-specific *_get_byte_size() functions are replaced by
      a generic one.
      
      Signed-off-by: default avatarTariq Toukan <tariqt@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      4972e6fa
    • Jeff Kirsher's avatar
      Documentation: intel: Convert to RST format · 828092ef
      Jeff Kirsher authored
      
      
      Now that the documents have been updated to conform to the reStructured Text
      guidelines, we can now change the file extensions and update the other
      related references.
      
      This converts all of the Intel wired LAN driver documentation to *.rst.
      
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
      828092ef
    • Jeff Kirsher's avatar
      Documentation: fm10k: Add kernel documentation · f12a84a9
      Jeff Kirsher authored
      
      
      Added the fm10k kernel documentation, which apparently was missing.
      
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
      f12a84a9
    • Jeff Kirsher's avatar
      Documentation: ice: Prepare documentation for RST conversion · 1fae869b
      Jeff Kirsher authored
      
      
      Before making the conversion to the RST (reStructured Text) format, there
      are changes needed to the documentation so that there are no build errors.
      
      Also fixed old/broken URLs to the correct or updated URL.
      
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
      1fae869b