1. 08 Apr, 2021 25 commits
  2. 07 Apr, 2021 15 commits
    • Wei Yongjun's avatar
      net: fealnx: use module_pci_driver to simplify the code · 3cd52c1e
      Wei Yongjun authored
      Use the module_pci_driver() macro to make the code simpler
      by eliminating module_init and module_exit calls.
      Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3cd52c1e
    • Wei Yongjun's avatar
      net: atheros: atl2: use module_pci_driver to simplify the code · 6381c45b
      Wei Yongjun authored
      Use the module_pci_driver() macro to make the code simpler
      by eliminating module_init and module_exit calls.
      Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6381c45b
    • Wei Yongjun's avatar
      net: sundance: use module_pci_driver to simplify the code · f670149a
      Wei Yongjun authored
      Use the module_pci_driver() macro to make the code simpler
      by eliminating module_init and module_exit calls.
      Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f670149a
    • Wei Yongjun's avatar
      tulip: de2104x: use module_pci_driver to simplify the code · 02f2743e
      Wei Yongjun authored
      Use the module_pci_driver() macro to make the code simpler
      by eliminating module_init and module_exit calls.
      Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      02f2743e
    • Wei Yongjun's avatar
      tulip: windbond-840: use module_pci_driver to simplify the code · 95b2fbdb
      Wei Yongjun authored
      Use the module_pci_driver() macro to make the code simpler
      by eliminating module_init and module_exit calls.
      Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      95b2fbdb
    • Wei Yongjun's avatar
      enic: use module_pci_driver to simplify the code · 1ffa6604
      Wei Yongjun authored
      Use the module_pci_driver() macro to make the code simpler
      by eliminating module_init and module_exit calls.
      Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1ffa6604
    • Wei Yongjun's avatar
      net: encx24j600: use module_spi_driver to simplify the code · 4e92cac8
      Wei Yongjun authored
      module_spi_driver() makes the code simpler by eliminating
      boilerplate code.
      Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4e92cac8
    • Johan Hovold's avatar
      net: wan: z85230: drop unused async state · a18f19e9
      Johan Hovold authored
      According to the changelog, asynchronous mode was dropped sometime
      before v2.2. Let's get rid of the unused driver-specific async state as
      well so that it doesn't show up when doing tree-wide tty work.
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a18f19e9
    • Colin Ian King's avatar
      liquidio: Fix unintented sign extension of a left shift of a u16 · 298b58f0
      Colin Ian King authored
      The macro CN23XX_PEM_BAR1_INDEX_REG is being used to shift oct->pcie_port
      (a u16) left 24 places. There are two subtle issues here, first the
      shift gets promoted to an signed int and then sign extended to a u64.
      If oct->pcie_port is 0x80 or more then the upper bits get sign extended
      to 1. Secondly shfiting a u16 24 bits will lead to an overflow so it
      needs to be cast to a u64 for all the bits to not overflow.
      
      It is entirely possible that the u16 port value is never large enough
      for this to fail, but it is useful to fix unintended overflows such
      as this.
      
      Fix this by casting the port parameter to the macro to a u64 before
      the shift.
      
      Addresses-Coverity: ("Unintended sign extension")
      Fixes: 5bc67f58 ("liquidio: CN23XX register definitions")
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      298b58f0
    • Colin Ian King's avatar
      xircom: remove redundant error check on variable err · 7b3ae17f
      Colin Ian King authored
      The error check on err is always false as err is always 0 at the
      port_found label. The code is redundant and can be removed.
      
      Addresses-Coverity: ("Logically dead code")
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7b3ae17f
    • David S. Miller's avatar
      Merge tag 'linux-can-next-for-5.13-20210407' of... · 33b32a29
      David S. Miller authored
      Merge tag 'linux-can-next-for-5.13-20210407' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next
      
      Marc Kleine-Budde says:
      
      ====================
      pull-request: can-next 2021-04-07
      
      this is a pull request of 6 patches for net-next/master.
      
      The first patch targets the CAN driver infrastructure, it improves the
      alloc_can{,fd}_skb() function to set the pointer to the CAN frame to
      NULL if skb allocation fails.
      
      The next patch adds missing error handling to the m_can driver's RX
      path (the code was introduced in -next, no need to backport).
      
      In the next patch an unused constant is removed from an enum in the
      c_can driver.
      
      The last 3 patches target the mcp251xfd driver. They add BQL support
      and try to work around a sometimes broken CRC when reading the TBC
      register.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      33b32a29
    • Andrei Vagin's avatar
      net: remove the new_ifindex argument from dev_change_net_namespace · 0854fa82
      Andrei Vagin authored
      Here is only one place where we want to specify new_ifindex. In all
      other cases, callers pass 0 as new_ifindex. It looks reasonable to add a
      low-level function with new_ifindex and to convert
      dev_change_net_namespace to a static inline wrapper.
      
      Fixes: eeb85a14 ("net: Allow to specify ifindex when device is moved to another namespace")
      Suggested-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarAndrei Vagin <avagin@gmail.com>
      Acked-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0854fa82
    • Andrei Vagin's avatar
      net: introduce nla_policy for IFLA_NEW_IFINDEX · 7e4a5131
      Andrei Vagin authored
      In this case, we don't need to check that new_ifindex is positive in
      validate_linkmsg.
      
      Fixes: eeb85a14 ("net: Allow to specify ifindex when device is moved to another namespace")
      Suggested-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarAndrei Vagin <avagin@gmail.com>
      Acked-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7e4a5131
    • David S. Miller's avatar
      Merge tag 'mlx5-updates-2021-04-06' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux · f86c70ed
      David S. Miller authored
      Saeed Mahameed says:
      
      ====================
      mlx5-updates-2021-04-06
      
      Introduce TC sample offload
      
      Background
      ----------
      
      The tc sample action allows user to sample traffic matched by tc
      classifier. The sampling consists of choosing packets randomly and
      sampling them using psample module.
      
      The tc sample parameters include group id, sampling rate and packet's
      truncation (to save kernel-user traffic).
      
      Sample in TC SW
      ---------------
      
      User must specify rate and group id for sample action, truncate is
      optional.
      
      tc filter add dev enp4s0f0_0 ingress protocol ip prio 1 flower	\
      	src_mac 02:25:d0:14:01:02 dst_mac 02:25:d0:14:01:03	\
      	action sample rate 10 group 5 trunc 60			\
      	action mirred egress redirect dev enp4s0f0_1
      
      The tc sample action kernel module 'act_sample' will call another
      kernel module 'psample' to send sampled packets to userspace.
      
      MLX5 sample HW offload - MLX5 driver patches
      --------------------------------------------
      
      The sample action is translated to a goto flow table object
      destination which samples packets according to the provided
      sample ratio. Sampled packets are duplicated. One copy is
      processed by a termination table, named the sample table,
      which sends the packet to the eswitch manager port (that will
      be processed by software).
      
      The second copy is processed by the default table which executes
      the subsequent actions. The default table is created per <vport,
      chain, prio> tuple as rules with different prios and chains may
      overlap.
      
      For example, for the following typical flow table:
      
      +-------------------------------+
      +       original flow table     +
      +-------------------------------+
      +         original match        +
      +-------------------------------+
      + sample action + other actions +
      +-------------------------------+
      
      We translate the tc filter with sample action to the following HW model:
      
              +---------------------+
              + original flow table +
              +---------------------+
              +   original match    +
              +---------------------+
                         |
                         v
      +------------------------------------------------+
      +                Flow Sampler Object             +
      +------------------------------------------------+
      +                    sample ratio                +
      +------------------------------------------------+
      +    sample table id    |    default table id    +
      +------------------------------------------------+
                 |                            |
                 v                            v
      +-----------------------------+  +----------------------------------------+
      +        sample table         +  + default table per <vport, chain, prio> +
      +-----------------------------+  +----------------------------------------+
      + forward to management vport +  +            original match              +
      +-----------------------------+  +----------------------------------------+
                                       +            other actions               +
                                       +----------------------------------------+
      
      Flow sampler object
      -------------------
      
      Hardware introduces flow sampler object to do sample. It is a new
      destination type. Driver needs to specify two flow table ids in it.
      One is sample table id. The other one is the default table id.
      Sample table samples the packets according to the sample rate and
      forward the sampled packets to eswitch manager port. Default table
      finishes the subsequent actions.
      
      Group id and reg_c0
      -------------------
      
      Userspace program will take different actions for sampled packets
      according to tc sample action group id. So hardware must pass group
      id to software for each sampled packets. In Paul Blakey's "Introduce
      connection tracking offload" patch set, reg_c0 lower 16 bits are used
      for miss packet chain id restore. We convert reg_c0 lower 16 bits to
      a common object pool, so other features can also use it.
      
      Since sample group id is 32 bits, create a 16 bits object id to map
      the group id and write the object id to reg_c0 lower 16 bits. reg_c0
      can only be used for matching. Write reg_c0 to flow_tag, so software
      can get the object id via flow_tag and find group id via the common
      object pool.
      
      Sampler restore handle
      ----------------------
      
      Use common object pool to create an object id to map sample parameters.
      Allocate a modify header action to write the object id to reg_c0 lower
      16 bits. Create a restore rule to pass the object id to software. So
      software can identify sampled packets via the object id and send it to
      userspace.
      
      Aggregate the modify header action, restore rule and object id to a
      sample restore handle. Re-use identical sample restore handle for
      the same object id.
      
      Send sampled packets to userspace
      ---------------------------------
      
      The destination for sampled packets is eswitch manager port, so
      representors can receive sampled packets together with the group id.
      Driver will send sampled packets and group id to userspace via psample.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f86c70ed
    • wengjianfeng's avatar
      nfc/fdp: remove unnecessary assignment and label · 872fff33
      wengjianfeng authored
      In function fdp_nci_patch_otp and fdp_nci_patch_ram,many goto
      out statements are used, and out label just return variable r.
      in some places,just jump to the out label, and in other places,
      assign a value to the variable r,then jump to the out label.
      It is unnecessary, we just use return sentences to replace goto
      sentences and delete out label.
      Signed-off-by: default avatarwengjianfeng <wengjianfeng@yulong.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      872fff33