1. 14 6月, 2019 5 次提交
  2. 12 6月, 2019 2 次提交
  3. 11 6月, 2019 1 次提交
    • J
      bpf: lpm_trie: check left child of last leftmost node for NULL · da2577fd
      Jonathan Lemon 提交于
      If the leftmost parent node of the tree has does not have a child
      on the left side, then trie_get_next_key (and bpftool map dump) will
      not look at the child on the right.  This leads to the traversal
      missing elements.
      
      Lookup is not affected.
      
      Update selftest to handle this case.
      
      Reproducer:
      
       bpftool map create /sys/fs/bpf/lpm type lpm_trie key 6 \
           value 1 entries 256 name test_lpm flags 1
       bpftool map update pinned /sys/fs/bpf/lpm key  8 0 0 0  0   0 value 1
       bpftool map update pinned /sys/fs/bpf/lpm key 16 0 0 0  0 128 value 2
       bpftool map dump   pinned /sys/fs/bpf/lpm
      
      Returns only 1 element. (2 expected)
      
      Fixes: b471f2f1 ("bpf: implement MAP_GET_NEXT_KEY command for LPM_TRIE")
      Signed-off-by: NJonathan Lemon <jonathan.lemon@gmail.com>
      Acked-by: NMartin KaFai Lau <kafai@fb.com>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      da2577fd
  4. 10 6月, 2019 13 次提交
  5. 08 6月, 2019 19 次提交
    • D
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf · 38e406f6
      David S. Miller 提交于
      Daniel Borkmann says:
      
      ====================
      pull-request: bpf 2019-06-07
      
      The following pull-request contains BPF updates for your *net* tree.
      
      The main changes are:
      
      1) Fix several bugs in riscv64 JIT code emission which forgot to clear high
         32-bits for alu32 ops, from Björn and Luke with selftests covering all
         relevant BPF alu ops from Björn and Jiong.
      
      2) Two fixes for UDP BPF reuseport that avoid calling the program in case of
         __udp6_lib_err and UDP GRO which broke reuseport_select_sock() assumption
         that skb->data is pointing to transport header, from Martin.
      
      3) Two fixes for BPF sockmap: a use-after-free from sleep in psock's backlog
         workqueue, and a missing restore of sk_write_space when psock gets dropped,
         from Jakub and John.
      
      4) Fix unconnected UDP sendmsg hook API which is insufficient as-is since it
         breaks standard applications like DNS if reverse NAT is not performed upon
         receive, from Daniel.
      
      5) Fix an out-of-bounds read in __bpf_skc_lookup which in case of AF_INET6
         fails to verify that the length of the tuple is long enough, from Lorenz.
      
      6) Fix libbpf's libbpf__probe_raw_btf to return an fd instead of 0/1 (for
         {un,}successful probe) as that is expected to be propagated as an fd to
         load_sk_storage_btf() and thus closing the wrong descriptor otherwise,
         from Michal.
      
      7) Fix bpftool's JSON output for the case when a lookup fails, from Krzesimir.
      
      8) Minor misc fixes in docs, samples and selftests, from various others.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      38e406f6
    • E
      net/mlx5e: Support tagged tunnel over bond · 45e7d4c0
      Eli Britstein 提交于
      Stacked devices like bond interface may have a VLAN device on top of
      them. Detect lag state correctly under this condition, and return the
      correct routed net device, according to it the encap header is built.
      
      Fixes: e32ee6c7 ("net/mlx5e: Support tunnel encap over tagged Ethernet")
      Signed-off-by: NEli Britstein <elibr@mellanox.com>
      Reviewed-by: NRoi Dayan <roid@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      45e7d4c0
    • A
      net/mlx5e: Avoid detaching non-existing netdev under switchdev mode · 47c9d2c9
      Alaa Hleihel 提交于
      After introducing dedicated uplink representor, the netdev instance
      set over the esw manager vport (PF) became no longer in use, so it was
      removed in the cited commit once we're on switchdev mode.
      However, the mlx5e_detach function was not updated accordingly, and it
      still tries to detach a non-existing netdev, causing a kernel crash.
      
      This patch fixes this issue.
      
      Fixes: aec002f6 ("net/mlx5e: Uninstantiate esw manager vport netdev on switchdev mode")
      Signed-off-by: NAlaa Hleihel <alaa@mellanox.com>
      Reviewed-by: NRoi Dayan <roid@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      47c9d2c9
    • R
      net/mlx5e: Fix source port matching in fdb peer flow rule · b83c0730
      Raed Salem 提交于
      The cited commit changed the initialization placement of the eswitch
      attributes so it is done prior to parse tc actions function call,
      including among others the in_rep and in_mdev fields which are mistakenly
      reassigned inside the parse actions function.
      
      This breaks the source port matching criteria of the peer redirect rule.
      
      Fix by removing the now redundant reassignment of the already initialized
      fields.
      
      Fixes: 988ab9c7 ("net/mlx5e: Introduce mlx5e_flow_esw_attr_init() helper")
      Signed-off-by: NRaed Salem <raeds@mellanox.com>
      Reviewed-by: NRoi Dayan <roid@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      b83c0730
    • S
      net/mlx5e: Replace reciprocal_scale in TX select queue function · 57c70d87
      Shay Agroskin 提交于
      The TX queue index returned by the fallback function ranges
      between [0,NUM CHANNELS - 1] if QoS isn't set and
      [0, (NUM CHANNELS)*(NUM TCs) -1] otherwise.
      
      Our HW uses different TC mapping than the fallback function
      (which is denoted as 'up', user priority) so we only need to extract
      a channel number out of the returned value.
      
      Since (NUM CHANNELS)*(NUM TCs) is a relatively small number, using
      reciprocal scale almost always returns zero.
      We instead access the 'txq2sq' table to extract the sq (and with it the
      channel number) associated with the tx queue, thus getting
      a more evenly distributed channel number.
      
      Perf:
      
      Rx/Tx side with Intel(R) Xeon(R) Silver 4108 CPU @ 1.80GHz and ConnectX-5.
      Used 'iperf' UDP traffic, 10 threads, and priority 5.
      
      Before:	0.566Mpps
      After:	 2.37Mpps
      
      As expected, releasing the existing bottleneck of steering all traffic
      to TX queue zero significantly improves transmission rates.
      
      Fixes: 7ccdd084 ("net/mlx5e: Fix select queue callback")
      Signed-off-by: NShay Agroskin <shayag@mellanox.com>
      Reviewed-by: NTariq Toukan <tariqt@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      57c70d87
    • C
      net/mlx5e: Add ndo_set_feature for uplink representor · d3cbd425
      Chris Mi 提交于
      After we have a dedicated uplink representor, the new netdev ops
      doesn't support ndo_set_feature. Because of that, we can't change
      some features, eg. rxvlan. Now add it back.
      
      In this patch, I also do a cleanup for the features flag handling,
      eg. remove duplicate NETIF_F_HW_TC flag setting.
      
      Fixes: aec002f6 ("net/mlx5e: Uninstantiate esw manager vport netdev on switchdev mode")
      Signed-off-by: NChris Mi <chrism@mellanox.com>
      Reviewed-by: NRoi Dayan <roid@mellanox.com>
      Reviewed-by: NVlad Buslov <vladbu@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      d3cbd425
    • A
      net/mlx5: Avoid reloading already removed devices · dd80857b
      Alaa Hleihel 提交于
      Prior to reloading a device we must first verify that it was not already
      removed. Otherwise, the attempt to remove the device will do nothing, and
      in that case we will end up proceeding with adding an new device that no
      one was expecting to remove, leaving behind used resources such as EQs that
      causes a failure to destroy comp EQs and syndrome (0x30f433).
      
      Fix that by making sure that we try to remove and add a device (based on a
      protocol) only if the device is already added.
      
      Fixes: c5447c70 ("net/mlx5: E-Switch, Reload IB interface when switching devlink modes")
      Signed-off-by: NAlaa Hleihel <alaa@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      dd80857b
    • E
      net/mlx5: Update pci error handler entries and command translation · 6a6fabbf
      Edward Srouji 提交于
      Add missing entries for create/destroy UCTX and UMEM commands.
      This could get us wrong "unknown FW command" error in flows
      where we unbind the device or reset the driver.
      
      Also the translation of these commands from opcodes to string
      was missing.
      
      Fixes: 6e3722ba ("IB/mlx5: Use the correct commands for UMEM and UCTX allocation")
      Signed-off-by: NEdward Srouji <edwards@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      6a6fabbf
    • W
      can: purge socket error queue on sock destruct · fd704bd5
      Willem de Bruijn 提交于
      CAN supports software tx timestamps as of the below commit. Purge
      any queued timestamp packets on socket destroy.
      
      Fixes: 51f31cab ("ip: support for TX timestamps on UDP and RAW sockets")
      Reported-by: syzbot+a90604060cb40f5bdd16@syzkaller.appspotmail.com
      Signed-off-by: NWillem de Bruijn <willemb@google.com>
      Cc: linux-stable <stable@vger.kernel.org>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      fd704bd5
    • F
      can: flexcan: Remove unneeded registration message · eb503004
      Fabio Estevam 提交于
      Currently the following message is observed when the flexcan
      driver is probed:
      
      flexcan 2090000.flexcan: device registered (reg_base=(ptrval), irq=23)
      
      The reason for printing 'ptrval' is explained at
      Documentation/core-api/printk-formats.rst:
      
      "Pointers printed without a specifier extension (i.e unadorned %p) are
      hashed to prevent leaking information about the kernel memory layout. This
      has the added benefit of providing a unique identifier. On 64-bit machines
      the first 32 bits are zeroed. The kernel will print ``(ptrval)`` until it
      gathers enough entropy."
      
      Instead of passing %pK, which can print the correct address, simply
      remove the entire message as it is not really that useful.
      Signed-off-by: NFabio Estevam <festevam@gmail.com>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      eb503004
    • Y
      can: af_can: Fix error path of can_init() · c5a3aed1
      YueHaibing 提交于
      This patch add error path for can_init() to avoid possible crash if some
      error occurs.
      
      Fixes: 0d66548a ("[CAN]: Add PF_CAN core module")
      Signed-off-by: NYueHaibing <yuehaibing@huawei.com>
      Acked-by: NOliver Hartkopp <socketcan@hartkopp.net>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      c5a3aed1
    • E
      can: m_can: implement errata "Needless activation of MRAF irq" · 3e82f2f3
      Eugen Hristev 提交于
      During frame reception while the MCAN is in Error Passive state and the
      Receive Error Counter has thevalue MCAN_ECR.REC = 127, it may happen
      that MCAN_IR.MRAF is set although there was no Message RAM access
      failure. If MCAN_IR.MRAF is enabled, an interrupt to the Host CPU is
      generated.
      
      Work around:
      The Message RAM Access Failure interrupt routine needs to check whether
      
          MCAN_ECR.RP = '1' and MCAN_ECR.REC = '127'.
      
      In this case, reset MCAN_IR.MRAF. No further action is required.
      This affects versions older than 3.2.0
      
      Errata explained on Sama5d2 SoC which includes this hardware block:
      http://ww1.microchip.com/downloads/en/DeviceDoc/SAMA5D2-Family-Silicon-Errata-and-Data-Sheet-Clarification-DS80000803B.pdf
      chapter 6.2
      
      Reproducibility: If 2 devices with m_can are connected back to back,
      configuring different bitrate on them will lead to interrupt storm on
      the receiving side, with error "Message RAM access failure occurred".
      Another way is to have a bad hardware connection. Bad wire connection
      can lead to this issue as well.
      
      This patch fixes the issue according to provided workaround.
      Signed-off-by: NEugen Hristev <eugen.hristev@microchip.com>
      Reviewed-by: NLudovic Desroches <ludovic.desroches@microchip.com>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      3e82f2f3
    • S
      can: mcp251x: add support for mcp25625 · 35b7fa4d
      Sean Nyekjaer 提交于
      Fully compatible with mcp2515, the mcp25625 have integrated transceiver.
      
      This patch adds support for the mcp25625 to the existing mcp251x driver.
      Signed-off-by: NSean Nyekjaer <sean@geanix.com>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      35b7fa4d
    • S
      dt-bindings: can: mcp251x: add mcp25625 support · 0df82dcd
      Sean Nyekjaer 提交于
      Fully compatible with mcp2515, the mcp25625 have integrated transceiver.
      
      This patch add the mcp25625 to the device tree bindings documentation.
      Signed-off-by: NSean Nyekjaer <sean@geanix.com>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      0df82dcd
    • A
      can: xilinx_can: use correct bittiming_const for CAN FD core · 904044dd
      Anssi Hannula 提交于
      Commit 9e5f1b27 ("can: xilinx_can: add support for Xilinx CAN FD
      core") added a new can_bittiming_const structure for CAN FD cores that
      support larger values for tseg1, tseg2, and sjw than previous Xilinx CAN
      cores, but the commit did not actually take that into use.
      
      Fix that.
      
      Tested with CAN FD core on a ZynqMP board.
      
      Fixes: 9e5f1b27 ("can: xilinx_can: add support for Xilinx CAN FD core")
      Reported-by: NShubhrajyoti Datta <shubhrajyoti.datta@gmail.com>
      Signed-off-by: NAnssi Hannula <anssi.hannula@bitwise.fi>
      Cc: Michal Simek <michal.simek@xilinx.com>
      Reviewed-by: NShubhrajyoti Datta <shubhrajyoti.datta@gmail.com>
      Cc: linux-stable <stable@vger.kernel.org>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      904044dd
    • J
      can: flexcan: fix timeout when set small bitrate · 247e5356
      Joakim Zhang 提交于
      Current we can meet timeout issue when setting a small bitrate like
      10000 as follows on i.MX6UL EVK board (ipg clock = 66MHZ, per clock =
      30MHZ):
      
      | root@imx6ul7d:~# ip link set can0 up type can bitrate 10000
      
      A link change request failed with some changes committed already.
      Interface can0 may have been left with an inconsistent configuration,
      please check.
      
      | RTNETLINK answers: Connection timed out
      
      It is caused by calling of flexcan_chip_unfreeze() timeout.
      
      Originally the code is using usleep_range(10, 20) for unfreeze
      operation, but the patch (8badd65e can: flexcan: avoid calling
      usleep_range from interrupt context) changed it into udelay(10) which is
      only a half delay of before, there're also some other delay changes.
      
      After double to FLEXCAN_TIMEOUT_US to 100 can fix the issue.
      
      Meanwhile, Rasmus Villemoes reported that even with a timeout of 100,
      flexcan_probe() fails on the MPC8309, which requires a value of at least
      140 to work reliably. 250 works for everyone.
      Signed-off-by: NJoakim Zhang <qiangqing.zhang@nxp.com>
      Reviewed-by: NDong Aisheng <aisheng.dong@nxp.com>
      Cc: linux-stable <stable@vger.kernel.org>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      247e5356
    • A
      can: usb: Kconfig: Remove duplicate menu entry · 0ed89d77
      Alexander Dahl 提交于
      This seems to have slipped in by accident when sorting the entries.
      
      Fixes: ffbdd917Signed-off-by: NAlexander Dahl <ada@thorsis.com>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      0ed89d77
    • D
      Merge tag 'wireless-drivers-for-davem-2019-06-07' of... · c7e3c93a
      David S. Miller 提交于
      Merge tag 'wireless-drivers-for-davem-2019-06-07' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers
      
      Kalle Valo says:
      
      ====================
      wireless-drivers fixes for 5.2
      
      First set of fixes for 5.2. Most important here are buffer overflow
      fixes for mwifiex.
      
      rtw88
      
      * fix out of bounds compiler warning
      
      * fix rssi handling to get 4x more throughput
      
      * avoid circular locking
      
      rsi
      
      * fix unitilised data warning, these are hopefully the last ones so
        that the warning can be enabled by default
      
      mwifiex
      
      * fix buffer overflows
      
      iwlwifi
      
      * remove not used debugfs file
      
      * various fixes
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c7e3c93a
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 1e1d9263
      Linus Torvalds 提交于
      Pull networking fixes from David Miller:
      
       1) Free AF_PACKET po->rollover properly, from Willem de Bruijn.
      
       2) Read SFP eeprom in max 16 byte increments to avoid problems with
          some SFP modules, from Russell King.
      
       3) Fix UDP socket lookup wrt. VRF, from Tim Beale.
      
       4) Handle route invalidation properly in s390 qeth driver, from Julian
          Wiedmann.
      
       5) Memory leak on unload in RDS, from Zhu Yanjun.
      
       6) sctp_process_init leak, from Neil HOrman.
      
       7) Fix fib_rules rule insertion semantic change that broke Android,
          from Hangbin Liu.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (33 commits)
        pktgen: do not sleep with the thread lock held.
        net: mvpp2: Use strscpy to handle stat strings
        net: rds: fix memory leak in rds_ib_flush_mr_pool
        ipv6: fix EFAULT on sendto with icmpv6 and hdrincl
        ipv6: use READ_ONCE() for inet->hdrincl as in ipv4
        Revert "fib_rules: return 0 directly if an exactly same rule exists when NLM_F_EXCL not supplied"
        net: aquantia: fix wol configuration not applied sometimes
        ethtool: fix potential userspace buffer overflow
        Fix memory leak in sctp_process_init
        net: rds: fix memory leak when unload rds_rdma
        ipv6: fix the check before getting the cookie in rt6_get_cookie
        ipv4: not do cache for local delivery if bc_forwarding is enabled
        s390/qeth: handle error when updating TX queue count
        s390/qeth: fix VLAN attribute in bridge_hostnotify udev event
        s390/qeth: check dst entry before use
        s390/qeth: handle limited IPv4 broadcast in L3 TX path
        net: fix indirect calls helpers for ptype list hooks.
        net: ipvlan: Fix ipvlan device tso disabled while NETIF_F_IP_CSUM is set
        udp: only choose unbound UDP socket for multicast when not in a VRF
        net/tls: replace the sleeping lock around RX resync with a bit lock
        ...
      1e1d9263