Skip to content
  1. Oct 05, 2023
    • Nathan Chancellor's avatar
      mlx5: Fix type of mode parameter in mlx5_dpll_device_mode_get() · f4ecb3d4
      Nathan Chancellor authored
      When building with -Wincompatible-function-pointer-types-strict, a
      warning designed to catch potential kCFI failures at build time rather
      than run time due to incorrect function pointer types, there is a
      warning due to a mismatch between the type of the mode parameter in
      mlx5_dpll_device_mode_get() vs. what the function pointer prototype for
      ->mode_get() in 'struct dpll_device_ops' expects.
      
        drivers/net/ethernet/mellanox/mlx5/core/dpll.c:141:14: error: incompatible function pointer types initializing 'int (*)(const struct dpll_device *, void *, enum dpll_mode *, struct netlink_ext_ack *)' with an expression of type 'int (const struct dpll_device *, void *, u32 *, struct netlink_ext_ack *)' (aka 'int (const struct dpll_device *, void *, unsigned int *, struct netlink_ext_ack *)') [-Werror,-Wincompatible-function-pointer-types-strict]
          141 |         .mode_get = mlx5_dpll_device_mode_get,
              |                     ^~~~~~~~~~~~~~~~~~~~~~~~~
        1 error generated.
      
      Change the type of the mode parameter in mlx5_dpll_device_mode_get() to
      clear up the warning and avoid kCFI failures at run time.
      
      Fixes: 496fd0a2
      
       ("mlx5: Implement SyncE support using DPLL infrastructure")
      Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Link: https://lore.kernel.org/r/20231002-net-wifpts-dpll_mode_get-v1-2-a356a16413cf@kernel.org
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      f4ecb3d4
    • Nathan Chancellor's avatar
      ptp: Fix type of mode parameter in ptp_ocp_dpll_mode_get() · 26cc115d
      Nathan Chancellor authored
      When building with -Wincompatible-function-pointer-types-strict, a
      warning designed to catch potential kCFI failures at build time rather
      than run time due to incorrect function pointer types, there is a
      warning due to a mismatch between the type of the mode parameter in
      ptp_ocp_dpll_mode_get() vs. what the function pointer prototype for
      ->mode_get() in 'struct dpll_device_ops' expects.
      
        drivers/ptp/ptp_ocp.c:4353:14: error: incompatible function pointer types initializing 'int (*)(const struct dpll_device *, void *, enum dpll_mode *, struct netlink_ext_ack *)' with an expression of type 'int (const struct dpll_device *, void *, u32 *, struct netlink_ext_ack *)' (aka 'int (const struct dpll_device *, void *, unsigned int *, struct netlink_ext_ack *)') [-Werror,-Wincompatible-function-pointer-types-strict]
         4353 |         .mode_get = ptp_ocp_dpll_mode_get,
              |                     ^~~~~~~~~~~~~~~~~~~~~
        1 error generated.
      
      Change the type of the mode parameter in ptp_ocp_dpll_mode_get() to
      clear up the warning and avoid kCFI failures at run time.
      
      Fixes: 09eeb3ae
      
       ("ptp_ocp: implement DPLL ops")
      Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Link: https://lore.kernel.org/r/20231002-net-wifpts-dpll_mode_get-v1-1-a356a16413cf@kernel.org
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      26cc115d
    • Jakub Kicinski's avatar
      Merge branch 'r8152-modify-rx_bottom' · 78cac6f1
      Jakub Kicinski authored
      
      
      Hayes Wang says:
      
      ====================
      r8152: modify rx_bottom
      
      v3:
      For patch #1, this patch is replaced. The new patch only break the loop,
      and keep that the driver would queue the rx packets.
      
      For patch #2, modify the code depends on patch #1. For work_down < budget,
      napi_get_frags() and napi_gro_frags() would be used. For the others,
      nothing is changed.
      
      v2:
      For patch #1, add comment, update commit message, and add Fixes tag.
      
      v1:
      These patches are used to improve rx_bottom().
      ====================
      
      Link: https://lore.kernel.org/r/20230926111714.9448-432-nic_swsd@realtek.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      78cac6f1
    • Hayes Wang's avatar
      r8152: use napi_gro_frags · 788d30da
      Hayes Wang authored
      
      
      Use napi_gro_frags() for the skb of fragments when the work_done is less
      than budget.
      
      Signed-off-by: default avatarHayes Wang <hayeswang@realtek.com>
      Link: https://lore.kernel.org/r/20230926111714.9448-434-nic_swsd@realtek.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      788d30da
    • Hayes Wang's avatar
      r8152: break the loop when the budget is exhausted · 2cf51f93
      Hayes Wang authored
      A bulk transfer of the USB may contain many packets. And, the total
      number of the packets in the bulk transfer may be more than budget.
      
      Originally, only budget packets would be handled by napi_gro_receive(),
      and the other packets would be queued in the driver for next schedule.
      
      This patch would break the loop about getting next bulk transfer, when
      the budget is exhausted. That is, only the current bulk transfer would
      be handled, and the other bulk transfers would be queued for next
      schedule. Besides, the packets which are more than the budget in the
      current bulk trasnfer would be still queued in the driver, as the
      original method.
      
      In addition, a bulk transfer wouldn't contain more than 400 packets, so
      the check of queue length is unnecessary. Therefore, I replace it with
      WARN_ON_ONCE().
      
      Fixes: cf74eb5a
      
       ("eth: r8152: try to use a normal budget")
      Signed-off-by: default avatarHayes Wang <hayeswang@realtek.com>
      Link: https://lore.kernel.org/r/20230926111714.9448-433-nic_swsd@realtek.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      2cf51f93
    • Jakub Kicinski's avatar
      Merge branch 'chelsio-annotate-structs-with-__counted_by' · f8e5b778
      Jakub Kicinski authored
      Kees Cook says:
      
      ====================
      chelsio: Annotate structs with __counted_by
      
      This annotates several chelsio structures with the coming __counted_by
      attribute for bounds checking of flexible arrays at run-time. For more details,
      see commit dd06e72e
      
       ("Compiler Attributes: Add __counted_by macro").
      ====================
      
      Link: https://lore.kernel.org/r/20230929181042.work.990-kees@kernel.org
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      f8e5b778
    • Kees Cook's avatar
      cxgb4: Annotate struct smt_data with __counted_by · 1508cb7e
      Kees Cook authored
      
      
      Prepare for the coming implementation by GCC and Clang of the __counted_by
      attribute. Flexible array members annotated with __counted_by can have
      their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS
      (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family
      functions).
      
      As found with Coccinelle[1], add __counted_by for struct smt_data.
      
      [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci
      
      Cc: Raju Rangoju <rajur@chelsio.com>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Reviewed-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
      Link: https://lore.kernel.org/r/20230929181149.3006432-5-keescook@chromium.org
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      1508cb7e
    • Kees Cook's avatar
      cxgb4: Annotate struct sched_table with __counted_by · ceba9725
      Kees Cook authored
      
      
      Prepare for the coming implementation by GCC and Clang of the __counted_by
      attribute. Flexible array members annotated with __counted_by can have
      their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS
      (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family
      functions).
      
      As found with Coccinelle[1], add __counted_by for struct sched_table.
      
      [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci
      
      Cc: Raju Rangoju <rajur@chelsio.com>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Reviewed-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
      Link: https://lore.kernel.org/r/20230929181149.3006432-4-keescook@chromium.org
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      ceba9725
    • Kees Cook's avatar
      cxgb4: Annotate struct cxgb4_tc_u32_table with __counted_by · 157c56a4
      Kees Cook authored
      
      
      Prepare for the coming implementation by GCC and Clang of the __counted_by
      attribute. Flexible array members annotated with __counted_by can have
      their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS
      (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family
      functions).
      
      As found with Coccinelle[1], add __counted_by for struct cxgb4_tc_u32_table.
      
      [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci
      
      Cc: Raju Rangoju <rajur@chelsio.com>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Reviewed-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
      Link: https://lore.kernel.org/r/20230929181149.3006432-3-keescook@chromium.org
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      157c56a4
    • Kees Cook's avatar
      cxgb4: Annotate struct clip_tbl with __counted_by · c3db467b
      Kees Cook authored
      
      
      Prepare for the coming implementation by GCC and Clang of the __counted_by
      attribute. Flexible array members annotated with __counted_by can have
      their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS
      (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family
      functions).
      
      As found with Coccinelle[1], add __counted_by for struct clip_tbl.
      
      [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci
      
      Cc: Raju Rangoju <rajur@chelsio.com>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Reviewed-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
      Link: https://lore.kernel.org/r/20230929181149.3006432-2-keescook@chromium.org
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      c3db467b
    • Kees Cook's avatar
      chelsio/l2t: Annotate struct l2t_data with __counted_by · 3bbae5f1
      Kees Cook authored
      
      
      Prepare for the coming implementation by GCC and Clang of the __counted_by
      attribute. Flexible array members annotated with __counted_by can have
      their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS
      (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family
      functions).
      
      As found with Coccinelle[1], add __counted_by for struct l2t_data.
      
      [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci
      
      Cc: Raju Rangoju <rajur@chelsio.com>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Reviewed-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
      Link: https://lore.kernel.org/r/20230929181149.3006432-1-keescook@chromium.org
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      3bbae5f1
    • Jakub Kicinski's avatar
      Merge tag 'nf-next-23-09-28' of https://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next · 07cf7974
      Jakub Kicinski authored
      
      
      Florian Westphal says:
      
      ====================
      netfilter updates for net-next
      
      First patch, from myself, is a bug fix. The issue (connect timeout) is
      ancient, so I think its safe to give this more soak time given the esoteric
      conditions needed to trigger this.
      Also updates the existing selftest to cover this.
      
      Add netlink extacks when an update references a non-existent
      table/chain/set.  This allows userspace to provide much better
      errors to the user, from Pablo Neira Ayuso.
      
      Last patch adds more policy checks to nf_tables as a better
      alternative to the existing runtime checks, from Phil Sutter.
      
      * tag 'nf-next-23-09-28' of https://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next:
        netfilter: nf_tables: Utilize NLA_POLICY_NESTED_ARRAY
        netfilter: nf_tables: missing extended netlink error in lookup functions
        selftests: netfilter: test nat source port clash resolution interaction with tcp early demux
        netfilter: nf_nat: undo erroneous tcp edemux lookup after port clash
      ====================
      
      Link: https://lore.kernel.org/r/20230928144916.18339-1-fw@strlen.de
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      07cf7974
    • Geert Uytterhoeven's avatar
      sctp: Spelling s/preceeding/preceding/g · 2b464cc2
      Geert Uytterhoeven authored
      
      
      Fix a misspelling of "preceding".
      
      Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Link: https://lore.kernel.org/r/663b14d07d6d716ddc34482834d6b65a2f714cfb.1695903447.git.geert+renesas@glider.be
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      2b464cc2
    • Dan Carpenter's avatar
      ptp: ocp: fix error code in probe() · 24a0fbf4
      Dan Carpenter authored
      There is a copy and paste error so this uses a valid pointer instead of
      an error pointer.
      
      Fixes: 09eeb3ae
      
       ("ptp_ocp: implement DPLL ops")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
      Reviewed-by: default avatarVadim Fedorenko <vadim.fedorenko@linux.dev>
      Link: https://lore.kernel.org/r/5c581336-0641-48bd-88f7-51984c3b1f79@moroto.mountain
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      24a0fbf4
    • Russell King (Oracle)'s avatar
      net: dsa: mt753x: remove mt753x_phylink_pcs_link_up() · d5a590b1
      Russell King (Oracle) authored
      
      
      Remove the mt753x_phylink_pcs_link_up() function for two reasons:
      
      1) priv->pcs[i].pcs.neg_mode is set true, meaning it doesn't take a
         MLO_AN_FIXED anymore, but one of PHYLINK_PCS_NEG_*. However, this
         is inconsequential due to...
      2) priv->pcs[port].pcs.ops is always initialised to point at
         mt7530_pcs_ops, which does not have a pcs_link_up() member.
      
      So, let's remove mt753x_phylink_pcs_link_up() entirely.
      
      Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      Reviewed-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: default avatarFlorian Fainelli <florian.fainelli@broadcom.com>
      Link: https://lore.kernel.org/r/E1qlTQS-008BWe-Va@rmk-PC.armlinux.org.uk
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      d5a590b1
    • Greg Kroah-Hartman's avatar
      net: appletalk: remove cops support · 00f3696f
      Greg Kroah-Hartman authored
      
      
      The COPS Appletalk support is very old, never said to actually work
      properly, and the firmware code for the devices are under a very suspect
      license.  Remove it all to clear up the license issue, if it is still
      needed and actually used by anyone, we can add it back later once the
      license is cleared up.
      
      Reported-by: default avatarPrarit Bhargava <prarit@redhat.com>
      Cc: jschlst@samba.org
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Acked-by: default avatarChristoph Hellwig <hch@lst.de>
      Acked-by: default avatarPrarit Bhargava <prarit@redhat.com>
      Reviewed-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Link: https://lore.kernel.org/r/20230927090029.44704-2-gregkh@linuxfoundation.org
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      00f3696f
    • Jakub Kicinski's avatar
      Revert "bnxt_en: Support QOS and TPID settings for the SRIOV VLAN" · c2715368
      Jakub Kicinski authored
      This reverts commit e76d44fe
      
      .
      
      We no longer accept drivers extending their use of the legacy
      SR-IOV configuration APIs. Users should move to bridge offload.
      
      Link: https://lore.kernel.org/r/20231004112243.41cb6351@kernel.org/
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      c2715368
    • Fabio Estevam's avatar
      dt-bindings: net: fec: Add imx8dxl description · ca6f5c2f
      Fabio Estevam authored
      
      
      The imx8dl FEC has the same programming model as the one on the imx8qxp.
      
      Add the imx8dl compatible string.
      
      Signed-off-by: default avatarFabio Estevam <festevam@denx.de>
      Acked-by: default avatarConor Dooley <conor.dooley@microchip.com>
      Link: https://lore.kernel.org/r/20230926111017.320409-1-festevam@gmail.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      ca6f5c2f
    • Jacob Keller's avatar
      ice: fix linking when CONFIG_PTP_1588_CLOCK=n · 91e43ca0
      Jacob Keller authored
      The recent support for DPLL introduced by commit 8a3a565f ("ice: add
      admin commands to access cgu configuration") and commit d7999f5e ("ice:
      implement dpll interface to control cgu") broke linking the ice driver if
      CONFIG_PTP_1588_CLOCK=n:
      
      ld: vmlinux.o: in function `ice_init_feature_support':
      (.text+0x8702b8): undefined reference to `ice_is_phy_rclk_present'
      ld: (.text+0x8702cd): undefined reference to `ice_is_cgu_present'
      ld: (.text+0x8702d9): undefined reference to `ice_is_clock_mux_present_e810t'
      ld: vmlinux.o: in function `ice_dpll_init_info_direct_pins':
      ice_dpll.c:(.text+0x894167): undefined reference to `ice_cgu_get_pin_freq_supp'
      ld: ice_dpll.c:(.text+0x894197): undefined reference to `ice_cgu_get_pin_name'
      ld: ice_dpll.c:(.text+0x8941a8): undefined reference to `ice_cgu_get_pin_type'
      ld: vmlinux.o: in function `ice_dpll_update_state':
      ice_dpll.c:(.text+0x894494): undefined reference to `ice_get_cgu_state'
      ld: vmlinux.o: in function `ice_dpll_init':
      (.text+0x8953d5): undefined reference to `ice_get_cgu_rclk_pin_info'
      
      The first commit broke things by calling functions in
      ice_init_feature_support that are compiled as part of ice_ptp_hw.o,
      including:
      
      * ice_is_phy_rclk_present
      * ice_is_clock_mux_present_e810t
      * ice_is_cgU_present
      
      The second commit continued the break by calling several CGU functions
      defined in ice_ptp_hw.c in the DPLL code.
      Because the ice_dpll.c file is compiled unconditionally, it will not
      link when CONFIG_PTP_1588_CLOCK=n.
      
      It might be possible to break this dependency and expose those functions
      without CONFIG_PTP_1588_CLOCK, but that is not clear to me.
      
      For the DPLL case, simply compile ice_dpll.o only when we have
      CONFIG_PTP_1588_CLOCK. Add stub no-op implementation of ice_dpll_init() and
      ice_dpll_uninit() when CONFIG_PTP_1588_CLOCK=n into ice_dpll.h
      
      The other functions are part of checking the netlist to see if hardware
      features are enabled. These checks don't really belong in ice_ptp_hw.c, and
      make more sense as part of the ice_common.c file. We already have
      ice_is_gps_in_netlist() in ice_common.c which is doing a similar check.
      
      Move the functions into ice_common.c and rename them to have the similar
      postfix of "in_netlist()" to be more expressive of what they are actually
      checking.
      
      This also makes the ice_find_netlist_node only called from within
      ice_common.c, so its safe to mark it static and stop declaring it in the
      ice_common.h header as well.
      
      Fixes: 8a3a565f ("ice: add admin commands to access cgu configuration")
      Fixes: d7999f5e
      
       ("ice: implement dpll interface to control cgu")
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Closes: https://lore.kernel.org/oe-kbuild-all/202309191214.TaYEct4H-lkp@intel.com
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Reviewed-by: default avatarPrzemek Kitszel <przemyslaw.kitszel@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Tested-by: Simon Horman <horms@kernel.org> # build-tested
      Link: https://lore.kernel.org/r/20231002185132.1575271-1-anthony.l.nguyen@intel.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      91e43ca0
  2. Oct 04, 2023