1. 23 2月, 2019 12 次提交
    • M
      bnxt_en: Fix typo in firmware message timeout logic. · 67681d02
      Michael Chan 提交于
      The logic that polls for the firmware message response uses a shorter
      sleep interval for the first few passes.  But there was a typo so it
      was using the wrong counter (larger counter) for these short sleep
      passes.  The result is a slightly shorter timeout period for these
      firmware messages than intended.  Fix it by using the proper counter.
      
      Fixes: 9751e8e7 ("bnxt_en: reduce timeout on initial HWRM calls")
      Signed-off-by: NMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      67681d02
    • V
      net: thunderx: remove link change polling code and info from nicpf · 2e1c3fff
      Vadim Lomovtsev 提交于
      Since link change polling routine was moved to nicvf side,
      we don't need anymore polling function at nicpf side along
      with link status info for all enabled Vfs as at VF side
      this info is already tracked.
      
      This commit is to remove unnecessary code & fields from
      nicpf structure.
      Signed-off-by: NVadim Lomovtsev <vlomovtsev@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2e1c3fff
    • V
      net: thunderx: move link state polling function to VF · 2c632ad8
      Vadim Lomovtsev 提交于
      Move the link change polling task to VF side in order to
      prevent races between VF and PF while sending link change
      message(s). This commit is to implement link change request
      to be initiated by VF.
      Signed-off-by: NVadim Lomovtsev <vlomovtsev@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2c632ad8
    • V
      net: thunderx: add mutex to protect mailbox from concurrent calls for same VF · 609ea65c
      Vadim Lomovtsev 提交于
      In some cases it could happen that nicvf_send_msg_to_pf() could be called
      concurrently for the same NIC VF, and thus re-writing mailbox contents and
      breaking messaging sequence with PF by re-writing NICVF data.
      
      This commit is to implement mutex for NICVF to protect mailbox registers
      and NICVF messaging control data from concurrent access.
      Signed-off-by: NVadim Lomovtsev <vlomovtsev@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      609ea65c
    • V
      net: thunderx: rework xcast message structure to make it fit into 64 bit · 53544396
      Vadim Lomovtsev 提交于
      To communicate to PF each of ThunderX NIC VF uses mailbox which is
      pair of 64 bit registers available to both VFn and PF.
      
      This commit is to change the xcast message structure in order to
      fit it into 64 bit.
      Signed-off-by: NVadim Lomovtsev <vlomovtsev@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      53544396
    • V
      net: thunderx: add nicvf_send_msg_to_pf result check for set_rx_mode_task · 7db730d9
      Vadim Lomovtsev 提交于
      The rx_set_mode invokes number of messages to be send to PF for receive
      mode configuration. In case if there any issues we need to stop sending
      messages and release allocated memory.
      
      This commit is to implement check of nicvf_msg_send_to_pf() result.
      Signed-off-by: NVadim Lomovtsev <vlomovtsev@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7db730d9
    • V
      net: thunderx: make CFG_DONE message to run through generic send-ack sequence · 0dd563b9
      Vadim Lomovtsev 提交于
      At the end of NIC VF initialization VF sends CFG_DONE message to PF without
      using nicvf_msg_send_to_pf routine. This potentially could re-write data in
      mailbox. This commit is to implement common way of sending CFG_DONE message
      by the same way with other configuration messages by using
      nicvf_send_msg_to_pf() routine.
      Signed-off-by: NVadim Lomovtsev <vlomovtsev@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0dd563b9
    • V
      net: thunderx: replace global nicvf_rx_mode_wq work queue for all VFs to private for each of them. · 2ecbe4f4
      Vadim Lomovtsev 提交于
      Having one work queue for receive mode configuration ndo_set_rx_mode()
      call for all VFs results in making each of them wait till the
      set_rx_mode() call completes for another VF if any of close, set
      receive mode and change flags calls being already invoked. Potentially
      this could cause device state change before appropriate call of receive
      mode configuration completes, so the call itself became meaningless,
      corrupt data or break configuration sequence.
      
      We don't need any delays in NIC VF configuration sequence so having delayed
      work call with 0 delay has no sense.
      
      This commit is to implement one work queue for each NIC VF for set_rx_mode
      task and to let them work independently and replacing delayed_work
      with work_struct.
      Signed-off-by: NVadim Lomovtsev <vlomovtsev@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2ecbe4f4
    • V
      net: thunderx: correct typo in macro name · f6d25aca
      Vadim Lomovtsev 提交于
      Correct STREERING to STEERING at macro name for BGX steering register.
      Signed-off-by: NVadim Lomovtsev <vlomovtsev@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f6d25aca
    • G
      team: use operstate consistently for linkup · 8c7a7726
      George Wilkie 提交于
      When a port is added to a team, its initial state is derived
      from netif_carrier_ok rather than netif_oper_up.
      If it is carrier up but operationally down at the time of being
      added, the port state.linkup will be set prematurely.
      port state.linkup should be set consistently using
      netif_oper_up rather than netif_carrier_ok.
      
      Fixes: f1d22a1e ("team: account for oper state")
      Signed-off-by: NGeorge Wilkie <gwilkie@vyatta.att-mail.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8c7a7726
    • D
      r8152: Fix an error on RTL8153-BD MAC Address Passthrough support · c286909f
      David Chen 提交于
      RTL8153-BD is used in Dell DA300 type-C dongle.
      Added RTL8153-BD support to activate MAC address pass through on DA300.
      Apply correction on previously submitted patch in net.git tree.
      Signed-off-by: NDavid Chen <david.chen7@dell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c286909f
    • D
      ipvlan: disallow userns cap_net_admin to change global mode/flags · 7cc9f700
      Daniel Borkmann 提交于
      When running Docker with userns isolation e.g. --userns-remap="default"
      and spawning up some containers with CAP_NET_ADMIN under this realm, I
      noticed that link changes on ipvlan slave device inside that container
      can affect all devices from this ipvlan group which are in other net
      namespaces where the container should have no permission to make changes
      to, such as the init netns, for example.
      
      This effectively allows to undo ipvlan private mode and switch globally to
      bridge mode where slaves can communicate directly without going through
      hostns, or it allows to switch between global operation mode (l2/l3/l3s)
      for everyone bound to the given ipvlan master device. libnetwork plugin
      here is creating an ipvlan master and ipvlan slave in hostns and a slave
      each that is moved into the container's netns upon creation event.
      
      * In hostns:
      
        # ip -d a
        [...]
        8: cilium_host@bond0: <BROADCAST,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
           link/ether 0c:c4:7a:e1:3d:cc brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 65535
           ipvlan  mode l3 bridge numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
           inet 10.41.0.1/32 scope link cilium_host
             valid_lft forever preferred_lft forever
        [...]
      
      * Spawn container & change ipvlan mode setting inside of it:
      
        # docker run -dt --cap-add=NET_ADMIN --network cilium-net --name client -l app=test cilium/netperf
        9fff485d69dcb5ce37c9e33ca20a11ccafc236d690105aadbfb77e4f4170879c
      
        # docker exec -ti client ip -d a
        [...]
        10: cilium0@if4: <BROADCAST,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
            link/ether 0c:c4:7a:e1:3d:cc brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 65535
            ipvlan  mode l3 bridge numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
            inet 10.41.197.43/32 brd 10.41.197.43 scope global cilium0
               valid_lft forever preferred_lft forever
      
        # docker exec -ti client ip link change link cilium0 name cilium0 type ipvlan mode l2
      
        # docker exec -ti client ip -d a
        [...]
        10: cilium0@if4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
            link/ether 0c:c4:7a:e1:3d:cc brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 65535
            ipvlan  mode l2 bridge numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
            inet 10.41.197.43/32 brd 10.41.197.43 scope global cilium0
               valid_lft forever preferred_lft forever
      
      * In hostns (mode switched to l2):
      
        # ip -d a
        [...]
        8: cilium_host@bond0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
            link/ether 0c:c4:7a:e1:3d:cc brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 65535
            ipvlan  mode l2 bridge numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
            inet 10.41.0.1/32 scope link cilium_host
               valid_lft forever preferred_lft forever
        [...]
      
      Same l3 -> l2 switch would also happen by creating another slave inside
      the container's network namespace when specifying the existing cilium0
      link to derive the actual (bond0) master:
      
        # docker exec -ti client ip link add link cilium0 name cilium1 type ipvlan mode l2
      
        # docker exec -ti client ip -d a
        [...]
        2: cilium1@if4: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
            link/ether 0c:c4:7a:e1:3d:cc brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 65535
            ipvlan  mode l2 bridge numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
        10: cilium0@if4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
            link/ether 0c:c4:7a:e1:3d:cc brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 65535
            ipvlan  mode l2 bridge numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
            inet 10.41.197.43/32 brd 10.41.197.43 scope global cilium0
               valid_lft forever preferred_lft forever
      
      * In hostns:
      
        # ip -d a
        [...]
        8: cilium_host@bond0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
            link/ether 0c:c4:7a:e1:3d:cc brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 65535
            ipvlan  mode l2 bridge numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
            inet 10.41.0.1/32 scope link cilium_host
               valid_lft forever preferred_lft forever
        [...]
      
      One way to mitigate it is to check CAP_NET_ADMIN permissions of
      the ipvlan master device's ns, and only then allow to change
      mode or flags for all devices bound to it. Above two cases are
      then disallowed after the patch.
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: NMahesh Bandewar <maheshb@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7cc9f700
  2. 22 2月, 2019 8 次提交
  3. 21 2月, 2019 1 次提交
    • R
      net: marvell: mvneta: fix DMA debug warning · a8fef9ba
      Russell King 提交于
      Booting 4.20 on SolidRun Clearfog issues this warning with DMA API
      debug enabled:
      
      WARNING: CPU: 0 PID: 555 at kernel/dma/debug.c:1230 check_sync+0x514/0x5bc
      mvneta f1070000.ethernet: DMA-API: device driver tries to sync DMA memory it has not allocated [device address=0x000000002dd7dc00] [size=240 bytes]
      Modules linked in: ahci mv88e6xxx dsa_core xhci_plat_hcd xhci_hcd devlink armada_thermal marvell_cesa des_generic ehci_orion phy_armada38x_comphy mcp3021 spi_orion evbug sfp mdio_i2c ip_tables x_tables
      CPU: 0 PID: 555 Comm: bridge-network- Not tainted 4.20.0+ #291
      Hardware name: Marvell Armada 380/385 (Device Tree)
      [<c0019638>] (unwind_backtrace) from [<c0014888>] (show_stack+0x10/0x14)
      [<c0014888>] (show_stack) from [<c07f54e0>] (dump_stack+0x9c/0xd4)
      [<c07f54e0>] (dump_stack) from [<c00312bc>] (__warn+0xf8/0x124)
      [<c00312bc>] (__warn) from [<c00313b0>] (warn_slowpath_fmt+0x38/0x48)
      [<c00313b0>] (warn_slowpath_fmt) from [<c00b0370>] (check_sync+0x514/0x5bc)
      [<c00b0370>] (check_sync) from [<c00b04f8>] (debug_dma_sync_single_range_for_cpu+0x6c/0x74)
      [<c00b04f8>] (debug_dma_sync_single_range_for_cpu) from [<c051bd14>] (mvneta_poll+0x298/0xf58)
      [<c051bd14>] (mvneta_poll) from [<c0656194>] (net_rx_action+0x128/0x424)
      [<c0656194>] (net_rx_action) from [<c000a230>] (__do_softirq+0xf0/0x540)
      [<c000a230>] (__do_softirq) from [<c00386e0>] (irq_exit+0x124/0x144)
      [<c00386e0>] (irq_exit) from [<c009b5e0>] (__handle_domain_irq+0x58/0xb0)
      [<c009b5e0>] (__handle_domain_irq) from [<c03a63c4>] (gic_handle_irq+0x48/0x98)
      [<c03a63c4>] (gic_handle_irq) from [<c0009a10>] (__irq_svc+0x70/0x98)
      ...
      
      This appears to be caused by mvneta_rx_hwbm() calling
      dma_sync_single_range_for_cpu() with the wrong struct device pointer,
      as the buffer manager device pointer is used to map and unmap the
      buffer.  Fix this.
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a8fef9ba
  4. 20 2月, 2019 2 次提交
  5. 19 2月, 2019 9 次提交
  6. 18 2月, 2019 4 次提交
  7. 17 2月, 2019 3 次提交
  8. 16 2月, 2019 1 次提交