1. 20 Aug, 2024 6 commits
  2. 19 Aug, 2024 1 commit
  3. 17 Aug, 2024 2 commits
    • Simon Horman's avatar
      bnx2x: Set ivi->vlan field as an integer · a99ef548
      Simon Horman authored
      In bnx2x_get_vf_config():
      * The vlan field of ivi is a 32-bit integer, it is used to store a vlan ID.
      * The vlan field of bulletin is a 16-bit integer, it is also used to store
        a vlan ID.
      
      In the current code, ivi->vlan is set using memset. But in the case of
      setting it to the value of bulletin->vlan, this involves reading
      32 bits from a 16bit source. This is likely safe, as the following
      6 bytes are padding in the same structure, but none the less, it seems
      undesirable.
      
      However, it is entirely unclear to me how this scheme works on
      big-endian systems.
      
      Resolve this by simply assigning integer values to ivi->vlan.
      
      Flagged by W=1 builds.
      f.e. gcc-14 reports:
      
      In function 'fortify_memcpy_chk',
          inlined from 'bnx2x_get_vf_config' at .../bnx2x_sriov.c:2655:4:
      .../fortify-string.h:580:25: warning: call to '__read_overflow2_field' declared with attribute warning: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Wattribute-warning]
        580 |                         __read_overflow2_field(q_size_field, size);
            |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      Compile tested only.
      Signed-off-by: default avatarSimon Horman <horms@kernel.org>
      Reviewed-by: default avatarBrett Creeley <brett.creeley@amd.com>
      Link: https://patch.msgid.link/20240815-bnx2x-int-vlan-v1-1-5940b76e37ad@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      a99ef548
    • Christoph Paasch's avatar
      mpls: Reduce skb re-allocations due to skb_cow() · f4ae8420
      Christoph Paasch authored
      mpls_xmit() needs to prepend the MPLS-labels to the packet. That implies
      one needs to make sure there is enough space for it in the headers.
      
      Calling skb_cow() implies however that one wants to change even the
      playload part of the packet (which is not true for MPLS). Thus, call
      skb_cow_head() instead, which is what other tunnelling protocols do.
      
      Running a server with this comm it entirely removed the calls to
      pskb_expand_head() from the callstack in mpls_xmit() thus having
      significant CPU-reduction, especially at peak times.
      
      Cc: Roopa Prabhu <roopa@nvidia.com>
      Reported-by: default avatarCraig Taylor <cmtaylor@apple.com>
      Signed-off-by: default avatarChristoph Paasch <cpaasch@apple.com>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Link: https://patch.msgid.link/20240815161201.22021-1-cpaasch@apple.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      f4ae8420
  4. 16 Aug, 2024 31 commits