Hi Lorenzo,

kernel test robot noticed the following build warnings:

[auto build test WARNING on db975debcb8c4cd367a78811bc1ba84c83f854bd]

url:    
https://github.com/intel-lab-lkp/linux/commits/Lorenzo-Bianconi/netlink-specs-Add-XDP-RX-checksum-capability-to-XDP-metadata-specs/20260211-012550
base:   db975debcb8c4cd367a78811bc1ba84c83f854bd
patch link:    
https://lore.kernel.org/r/20260210-bpf-xdp-meta-rxcksum-v1-3-e5d55caa0541%40kernel.org
patch subject: [Intel-wired-lan] [PATCH bpf-next 3/5] net: ice: Add 
xmo_rx_checksum callback
config: i386-randconfig-063-20260211 
(https://download.01.org/0day-ci/archive/20260211/[email protected]/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): 
(https://download.01.org/0day-ci/archive/20260211/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: 
https://lore.kernel.org/oe-kbuild-all/[email protected]/

sparse warnings: (new ones prefixed by >>)
>> drivers/net/ethernet/intel/ice/ice_txrx_lib.c:109:29: sparse: sparse: 
>> incorrect type in assignment (different base types) @@     expected unsigned 
>> int [usertype] @@     got restricted __wsum @@
   drivers/net/ethernet/intel/ice/ice_txrx_lib.c:109:29: sparse:     expected 
unsigned int [usertype]
   drivers/net/ethernet/intel/ice/ice_txrx_lib.c:109:29: sparse:     got 
restricted __wsum
>> drivers/net/ethernet/intel/ice/ice_txrx_lib.c:181:27: sparse: sparse: 
>> incorrect type in assignment (different base types) @@     expected 
>> restricted __wsum [usertype] csum @@     got unsigned int [addressable] 
>> [usertype] cksum_meta @@
   drivers/net/ethernet/intel/ice/ice_txrx_lib.c:181:27: sparse:     expected 
restricted __wsum [usertype] csum
   drivers/net/ethernet/intel/ice/ice_txrx_lib.c:181:27: sparse:     got 
unsigned int [addressable] [usertype] cksum_meta
   drivers/net/ethernet/intel/ice/ice_txrx_lib.c:515:9: sparse: sparse: context 
imbalance in 'ice_finalize_xdp_rx' - different lock contexts for basic block

vim +109 drivers/net/ethernet/intel/ice/ice_txrx_lib.c

    83  
    84  static void
    85  ice_get_rx_csum(const union ice_32b_rx_flex_desc *rx_desc, u16 ptype,
    86                  struct ice_rx_ring *ring, enum xdp_checksum *ip_summed,
    87                  u32 *cksum_meta)
    88  {
    89          struct libeth_rx_pt decoded = libie_rx_pt_parse(ptype);
    90          u16 rx_status0, rx_status1;
    91          bool ipv4, ipv6;
    92  
    93          if (!libeth_rx_pt_has_checksum(ring->netdev, decoded))
    94                  goto checksum_none;
    95  
    96          rx_status0 = le16_to_cpu(rx_desc->wb.status_error0);
    97          rx_status1 = le16_to_cpu(rx_desc->wb.status_error1);
    98          if ((ring->flags & ICE_RX_FLAGS_RING_GCS) &&
    99              rx_desc->wb.rxdid == ICE_RXDID_FLEX_NIC &&
   100              (decoded.inner_prot == LIBETH_RX_PT_INNER_TCP ||
   101               decoded.inner_prot == LIBETH_RX_PT_INNER_UDP ||
   102               decoded.inner_prot == LIBETH_RX_PT_INNER_ICMP)) {
   103                  const struct ice_32b_rx_flex_desc_nic *desc;
   104                  u16 csum;
   105  
   106                  desc = (struct ice_32b_rx_flex_desc_nic *)rx_desc;
   107                  *ip_summed = XDP_CHECKSUM_COMPLETE;
   108                  csum = (__force u16)desc->raw_csum;
 > 109                  *cksum_meta = csum_unfold((__force 
 > __sum16)swab16(csum));
   110                  return;
   111          }
   112  
   113          /* check if HW has decoded the packet and checksum */
   114          if (!(rx_status0 & BIT(ICE_RX_FLEX_DESC_STATUS0_L3L4P_S)))
   115                  goto checksum_none;
   116  
   117          ipv4 = libeth_rx_pt_get_ip_ver(decoded) == 
LIBETH_RX_PT_OUTER_IPV4;
   118          ipv6 = libeth_rx_pt_get_ip_ver(decoded) == 
LIBETH_RX_PT_OUTER_IPV6;
   119  
   120          if (ipv4 && (rx_status0 & 
(BIT(ICE_RX_FLEX_DESC_STATUS0_XSUM_EIPE_S)))) {
   121                  ring->vsi->back->hw_rx_eipe_error++;
   122                  goto checksum_none;
   123          }
   124  
   125          if (ipv4 && (rx_status0 & 
(BIT(ICE_RX_FLEX_DESC_STATUS0_XSUM_IPE_S))))
   126                  goto checksum_fail;
   127  
   128          if (ipv6 && (rx_status0 & 
(BIT(ICE_RX_FLEX_DESC_STATUS0_IPV6EXADD_S))))
   129                  goto checksum_fail;
   130  
   131          /* check for L4 errors and handle packets that were not able to 
be
   132           * checksummed due to arrival speed
   133           */
   134          if (rx_status0 & BIT(ICE_RX_FLEX_DESC_STATUS0_XSUM_L4E_S))
   135                  goto checksum_fail;
   136  
   137          /* check for outer UDP checksum error in tunneled packets */
   138          if ((rx_status1 & BIT(ICE_RX_FLEX_DESC_STATUS1_NAT_S)) &&
   139              (rx_status0 & BIT(ICE_RX_FLEX_DESC_STATUS0_XSUM_EUDPE_S)))
   140                  goto checksum_fail;
   141  
   142          /* If there is an outer header present that might contain a 
checksum
   143           * we need to bump the checksum level by 1 to reflect the fact 
that
   144           * we are indicating we validated the inner checksum.
   145           */
   146          if (decoded.tunnel_type >= LIBETH_RX_PT_TUNNEL_IP_GRENAT)
   147                  *cksum_meta = 1;
   148  
   149          *ip_summed = XDP_CHECKSUM_UNNECESSARY;
   150          return;
   151  
   152  checksum_fail:
   153          ring->vsi->back->hw_csum_rx_error++;
   154  checksum_none:
   155          *ip_summed = XDP_CHECKSUM_NONE;
   156          *cksum_meta = 0;
   157  }
   158  
   159  /**
   160   * ice_rx_csum - Indicate in skb if checksum is good
   161   * @ring: the ring we care about
   162   * @skb: skb currently being received and modified
   163   * @rx_desc: the receive descriptor
   164   * @ptype: the packet type decoded by hardware
   165   *
   166   * skb->protocol must be set before this function is called
   167   */
   168  static void
   169  ice_rx_csum(struct ice_rx_ring *ring, struct sk_buff *skb,
   170              union ice_32b_rx_flex_desc *rx_desc, u16 ptype)
   171  {
   172          enum xdp_checksum ip_summed;
   173          u32 cksum_meta;
   174  
   175          ice_get_rx_csum(rx_desc, ptype, ring, &ip_summed, &cksum_meta);
   176          switch (ip_summed) {
   177          case XDP_CHECKSUM_UNNECESSARY:
   178                  skb->csum_level = cksum_meta;
   179                  break;
   180          case XDP_CHECKSUM_COMPLETE:
 > 181                  skb->csum = cksum_meta;
   182                  break;
   183          default:
   184                  break;
   185          }
   186          skb->ip_summed = ip_summed;
   187  }
   188  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

Reply via email to