1. 26 6月, 2020 1 次提交
  2. 25 6月, 2020 1 次提交
  3. 24 6月, 2020 1 次提交
  4. 14 6月, 2020 1 次提交
    • M
      treewide: replace '---help---' in Kconfig files with 'help' · a7f7f624
      Masahiro Yamada 提交于
      Since commit 84af7a61 ("checkpatch: kconfig: prefer 'help' over
      '---help---'"), the number of '---help---' has been gradually
      decreasing, but there are still more than 2400 instances.
      
      This commit finishes the conversion. While I touched the lines,
      I also fixed the indentation.
      
      There are a variety of indentation styles found.
      
        a) 4 spaces + '---help---'
        b) 7 spaces + '---help---'
        c) 8 spaces + '---help---'
        d) 1 space + 1 tab + '---help---'
        e) 1 tab + '---help---'    (correct indentation)
        f) 1 tab + 1 space + '---help---'
        g) 1 tab + 2 spaces + '---help---'
      
      In order to convert all of them to 1 tab + 'help', I ran the
      following commend:
      
        $ find . -name 'Kconfig*' | xargs sed -i 's/^[[:space:]]*---help---/\thelp/'
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      a7f7f624
  5. 10 6月, 2020 1 次提交
    • C
      net: change addr_list_lock back to static key · 845e0ebb
      Cong Wang 提交于
      The dynamic key update for addr_list_lock still causes troubles,
      for example the following race condition still exists:
      
      CPU 0:				CPU 1:
      (RCU read lock)			(RTNL lock)
      dev_mc_seq_show()		netdev_update_lockdep_key()
      				  -> lockdep_unregister_key()
       -> netif_addr_lock_bh()
      
      because lockdep doesn't provide an API to update it atomically.
      Therefore, we have to move it back to static keys and use subclass
      for nest locking like before.
      
      In commit 1a33e10e ("net: partially revert dynamic lockdep key
      changes"), I already reverted most parts of commit ab92d68f
      ("net: core: add generic lockdep keys").
      
      This patch reverts the rest and also part of commit f3b0a18b
      ("net: remove unnecessary variables and callback"). After this
      patch, addr_list_lock changes back to using static keys and
      subclasses to satisfy lockdep. Thanks to dev->lower_level, we do
      not have to change back to ->ndo_get_lock_subclass().
      
      And hopefully this reduces some syzbot lockdep noises too.
      
      Reported-by: syzbot+f3a0e80c34b3fc28ac5e@syzkaller.appspotmail.com
      Cc: Taehee Yoo <ap420073@gmail.com>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      845e0ebb
  6. 03 6月, 2020 1 次提交
    • C
      mm: remove the pgprot argument to __vmalloc · 88dca4ca
      Christoph Hellwig 提交于
      The pgprot argument to __vmalloc is always PAGE_KERNEL now, so remove it.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Reviewed-by: Michael Kelley <mikelley@microsoft.com> [hyperv]
      Acked-by: Gao Xiang <xiang@kernel.org> [erofs]
      Acked-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: NWei Liu <wei.liu@kernel.org>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Christophe Leroy <christophe.leroy@c-s.fr>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Laura Abbott <labbott@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
      Cc: Stephen Hemminger <sthemmin@microsoft.com>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Paul Mackerras <paulus@ozlabs.org>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Will Deacon <will@kernel.org>
      Link: http://lkml.kernel.org/r/20200414131348.444715-22-hch@lst.deSigned-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      88dca4ca
  7. 02 6月, 2020 3 次提交
  8. 28 5月, 2020 2 次提交
  9. 26 5月, 2020 2 次提交
  10. 23 5月, 2020 2 次提交
  11. 11 5月, 2020 1 次提交
  12. 08 5月, 2020 2 次提交
  13. 07 5月, 2020 1 次提交
  14. 01 5月, 2020 1 次提交
  15. 29 4月, 2020 2 次提交
  16. 28 4月, 2020 9 次提交
    • H
      net: bridge: Add checks for enabling the STP. · 419dba8a
      Horatiu Vultur 提交于
      It is not possible to have the MRP and STP running at the same time on the
      bridge, therefore add check when enabling the STP to check if MRP is already
      enabled. In that case return error.
      Reviewed-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      419dba8a
    • H
      bridge: mrp: Integrate MRP into the bridge · 65369933
      Horatiu Vultur 提交于
      To integrate MRP into the bridge, the bridge needs to do the following:
      - detect if the MRP frame was received on MRP ring port in that case it would be
        processed otherwise just forward it as usual.
      - enable parsing of MRP
      - before whenever the bridge was set up, it would set all the ports in
        forwarding state. Add an extra check to not set ports in forwarding state if
        the port is an MRP ring port. The reason of this change is that if the MRP
        instance initially sets the port in blocked state by setting the bridge up it
        would overwrite this setting.
      Reviewed-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      65369933
    • H
      bridge: mrp: Implement netlink interface to configure MRP · 4d02b8f0
      Horatiu Vultur 提交于
      Implement netlink interface to configure MRP. The implementation
      will do sanity checks over the attributes and then eventually call the MRP
      interface.
      Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4d02b8f0
    • H
      bridge: mrp: Connect MRP API with the switchdev API · 9a9f26e8
      Horatiu Vultur 提交于
      Implement the MRP API.
      
      In case the HW can't generate MRP Test frames then the SW will try to generate
      the frames. In case that also the SW will fail in generating the frames then a
      error is return to the userspace. The userspace is responsible to generate all
      the other MRP frames regardless if the test frames are generated by HW or SW.
      
      The forwarding/termination of MRP frames is happening in the kernel and is done
      by the MRP instance. The userspace application doesn't do the forwarding.
      Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9a9f26e8
    • H
      bridge: switchdev: mrp: Implement MRP API for switchdev · fadd4091
      Horatiu Vultur 提交于
      Implement the MRP api for switchdev.
      These functions will just eventually call the switchdev functions:
      switchdev_port_obj_add/del and switchdev_port_attr_set.
      Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fadd4091
    • H
      bridge: mrp: Add MRP interface. · 2f1a11ae
      Horatiu Vultur 提交于
      Define the MRP interface.
      This interface is used by the netlink to update the MRP instances and by the MRP
      to make the calls to switchdev to offload it to HW.
      
      It defines an MRP instance 'struct br_mrp' which is a list of MRP instances.
      Which will be part of the 'struct net_bridge'. Each instance has 2 ring ports,
      a bridge and an ID.
      
      In case the HW can't generate MRP Test frames then the SW will generate those.
      
      br_mrp_add - adds a new MRP instance.
      
      br_mrp_del - deletes an existing MRP instance. Each instance has an ID(ring_id).
      
      br_mrp_set_port_state - changes the port state. The port can be in forwarding
        state, which means that the frames can pass through or in blocked state which
        means that the frames can't pass through except MRP frames. This will
        eventually call the switchdev API to notify the HW. This information is used
        also by the SW bridge to know how to forward frames in case the HW doesn't
        have this capability.
      
      br_mrp_set_port_role - a port role can be primary or secondary. This
        information is required to be pushed to HW in case the HW can generate
        MRP_Test frames.  Because the MRP_Test frames contains a file with this
        information. Otherwise the HW will not be able to generate the frames
        correctly.
      
      br_mrp_set_ring_state - a ring can be in state open or closed. State open means
        that the mrp port stopped receiving MRP_Test frames, while closed means that
        the mrp port received MRP_Test frames. Similar with br_mrp_port_role, this
        information is pushed in HW because the MRP_Test frames contain this
        information.
      
      br_mrp_set_ring_role - a ring can have the following roles MRM or MRC. For the
        role MRM it is expected that the HW can terminate the MRP frames, notify the
        SW that it stopped receiving MRP_Test frames and trapp all the other MRP
        frames.  While for MRC mode it is expected that the HW can forward the MRP
        frames only between the MRP ports and copy MRP_Topology frames to CPU. In
        case the HW doesn't support a role it needs to return an error code different
        than -EOPNOTSUPP.
      
      br_mrp_start_test - this starts/stops the generation of MRP_Test frames. To stop
        the generation of frames the interval needs to have a value of 0. In this case
        the userspace needs to know if the HW supports this or not. Not to have
        duplicate frames(generated by HW and SW). Because if the HW supports this then
        the SW will not generate anymore frames and will expect that the HW will
        notify when it stopped receiving MRP frames using the function
        br_mrp_port_open.
      
      br_mrp_port_open - this function is used by drivers to notify the userspace via
        a netlink callback that one of the ports stopped receiving MRP_Test frames.
        This function is called only when the node has the role MRM. It is not
        supposed to be called from userspace.
      
      br_mrp_port_switchdev_add - this corresponds to the function br_mrp_add,
        and will notify the HW that a MRP instance is added. The function gets
        as parameter the MRP instance.
      
      br_mrp_port_switchdev_del - this corresponds to the function br_mrp_del,
        and will notify the HW that a MRP instance is removed. The function
        gets as parameter the ID of the MRP instance that is removed.
      
      br_mrp_port_switchdev_set_state - this corresponds to the function
        br_mrp_set_port_state. It would notify the HW if it should block or not
        non-MRP frames.
      
      br_mrp_port_switchdev_set_port - this corresponds to the function
        br_mrp_set_port_role. It would set the port role, primary or secondary.
      
      br_mrp_switchdev_set_role - this corresponds to the function
        br_mrp_set_ring_role and would set one of the role MRM or MRC.
      
      br_mrp_switchdev_set_ring_state - this corresponds to the function
        br_mrp_set_ring_state and would set the ring to be open or closed.
      
      br_mrp_switchdev_send_ring_test - this corresponds to the function
        br_mrp_start_test. This will notify the HW to start or stop generating
        MRP_Test frames. Value 0 for the interval parameter means to stop generating
        the frames.
      
      br_mrp_port_open - this function is used to notify the userspace that the port
        lost the continuity of MRP Test frames.
      Reviewed-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2f1a11ae
    • H
      net: bridge: Add port attribute IFLA_BRPORT_MRP_RING_OPEN · 3e54442c
      Horatiu Vultur 提交于
      This patch adds a new port attribute, IFLA_BRPORT_MRP_RING_OPEN, which allows
      to notify the userspace when the port lost the continuite of MRP frames.
      
      This attribute is set by kernel whenever the SW or HW detects that the ring is
      being open or closed.
      Reviewed-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3e54442c
    • H
      bridge: mrp: Extend bridge interface · 4b8d7d4c
      Horatiu Vultur 提交于
      To integrate MRP into the bridge, first the bridge needs to be aware of ports
      that are part of an MRP ring and which rings are on the bridge.
      Therefore extend bridge interface with the following:
      - add new flag(BR_MPP_AWARE) to the net bridge ports, this bit will be
        set when the port is added to an MRP instance. In this way it knows if
        the frame was received on MRP ring port
      - add new flag(BR_MRP_LOST_CONT) to the net bridge ports, this bit will be set
        when the port lost the continuity of MRP Test frames.
      - add a list of MRP instances
      Reviewed-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4b8d7d4c
    • H
      bridge: mrp: Update Kconfig · 2cc974f8
      Horatiu Vultur 提交于
      Add the option BRIDGE_MRP to allow to build in or not MRP support.
      The default value is N.
      Reviewed-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2cc974f8
  17. 27 4月, 2020 1 次提交
  18. 20 3月, 2020 3 次提交
  19. 18 3月, 2020 4 次提交
  20. 15 3月, 2020 1 次提交
    • G
      netfilter: Replace zero-length array with flexible-array member · 6daf1414
      Gustavo A. R. Silva 提交于
      The current codebase makes use of the zero-length array language
      extension to the C90 standard, but the preferred mechanism to declare
      variable-length types such as these ones is a flexible array member[1][2],
      introduced in C99:
      
      struct foo {
              int stuff;
              struct boo array[];
      };
      
      By making use of the mechanism above, we will get a compiler warning
      in case the flexible array does not occur last in the structure, which
      will help us prevent some kind of undefined behavior bugs from being
      inadvertently introduced[3] to the codebase from now on.
      
      Also, notice that, dynamic memory allocations won't be affected by
      this change:
      
      "Flexible array members have incomplete type, and so the sizeof operator
      may not be applied. As a quirk of the original implementation of
      zero-length arrays, sizeof evaluates to zero."[1]
      
      Lastly, fix checkpatch.pl warning
      WARNING: __aligned(size) is preferred over __attribute__((aligned(size)))
      in net/bridge/netfilter/ebtables.c
      
      This issue was found with the help of Coccinelle.
      
      [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
      [2] https://github.com/KSPP/linux/issues/21
      [3] commit 76497732 ("cxgb3/l2t: Fix undefined behaviour")
      Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      6daf1414