Subject: Re: [Intel-wired-lan] [PATCH iwl-next v1 09/12] iavf: refactor iavf_clean_rx_irq to support legacy and flex descriptors

From: kernel test robot <[email-masked]>
Date: Wed, 27 Mar 2024 05:01:55 +0800

Hi Mateusz,

kernel test robot noticed the following build warnings:

[auto build test WARNING on tnguy-next-queue/dev-queue]

url:    https://github.com/intel-lab-lkp/linux/commits/Mateusz-Polchlopek/virtchnl-add-support-for-enabling-PTP-on-iAVF/20240326-200321
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue.git dev-queue
patch link:    https://lore.kernel.org/r/20240326115116.10040-10-mateusz.polchlopek%40intel.com
patch subject: [Intel-wired-lan] [PATCH iwl-next v1 09/12] iavf: refactor iavf_clean_rx_irq to support legacy and flex descriptors
config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20240327/[email-masked]/config)
compiler: alpha-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240327/[email-masked]/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-masked]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email-masked]/

All warnings (new ones prefixed by >>):

   drivers/net/ethernet/intel/iavf/iavf_txrx.c: In function 'iavf_legacy_rx_csum':
>> drivers/net/ethernet/intel/iavf/iavf_txrx.c:1081:23: warning: variable 'rx_status' set but not used [-Wunused-but-set-variable]
    1081 |         u32 rx_error, rx_status;
         |                       ^~~~~~~~~
   drivers/net/ethernet/intel/iavf/iavf_txrx.c: In function 'iavf_flex_rx_csum':
>> drivers/net/ethernet/intel/iavf/iavf_txrx.c:1118:25: warning: variable 'rx_status1' set but not used [-Wunused-but-set-variable]
    1118 |         u16 rx_status0, rx_status1, ptype;
         |                         ^~~~~~~~~~

vim +/rx_status +1081 drivers/net/ethernet/intel/iavf/iavf_txrx.c

  1065	
  1066	/**
  1067	 * iavf_legacy_rx_csum - Indicate in skb if hw indicated a good cksum
  1068	 * @vsi: the VSI we care about
  1069	 * @skb: skb currently being received and modified
  1070	 * @rx_desc: the receive descriptor
  1071	 *
  1072	 * This function only operates on the VIRTCHNL_RXDID_1_32B_BASE legacy 32byte
  1073	 * descriptor writeback format.
  1074	 **/
  1075	static inline void iavf_legacy_rx_csum(struct iavf_vsi *vsi,
  1076					       struct sk_buff *skb,
  1077					       union iavf_rx_desc *rx_desc)
  1078	{
  1079		struct iavf_rx_csum_decoded csum_bits;
  1080		struct iavf_rx_ptype_decoded decoded;
> 1081		u32 rx_error, rx_status;
  1082		u64 qword;
  1083		u16 ptype;
  1084	
  1085		qword = le64_to_cpu(rx_desc->wb.qword1.status_error_len);
  1086		ptype = FIELD_GET(IAVF_RXD_QW1_PTYPE_MASK, qword);
  1087		rx_error = FIELD_GET(IAVF_RXD_QW1_ERROR_MASK, qword);
  1088		rx_status = FIELD_GET(IAVF_RXD_QW1_STATUS_MASK, qword);
  1089		decoded = decode_rx_desc_ptype(ptype);
  1090	
  1091		csum_bits.ipe = FIELD_GET(IAVF_RX_DESC_ERROR_IPE_MASK, rx_error);
  1092		csum_bits.eipe = FIELD_GET(IAVF_RX_DESC_ERROR_EIPE_MASK, rx_error);
  1093		csum_bits.l4e = FIELD_GET(IAVF_RX_DESC_ERROR_L4E_MASK, rx_error);
  1094		csum_bits.pprs = FIELD_GET(IAVF_RX_DESC_ERROR_PPRS_MASK, rx_error);
  1095		csum_bits.l3l4p = FIELD_GET(IAVF_RX_DESC_STATUS_L3L4P_MASK, rx_error);
  1096		csum_bits.ipv6exadd = FIELD_GET(IAVF_RX_DESC_STATUS_IPV6EXADD_MASK,
  1097						rx_error);
  1098		csum_bits.nat = 0;
  1099		csum_bits.eudpe = 0;
  1100	
  1101		iavf_rx_csum(vsi, skb, &decoded, &csum_bits);
  1102	}
  1103	
  1104	/**
  1105	 * iavf_flex_rx_csum - Indicate in skb if hw indicated a good cksum
  1106	 * @vsi: the VSI we care about
  1107	 * @skb: skb currently being received and modified
  1108	 * @rx_desc: the receive descriptor
  1109	 *
  1110	 * This function only operates on the VIRTCHNL_RXDID_2_FLEX_SQ_NIC flexible
  1111	 * descriptor writeback format.
  1112	 **/
  1113	static inline void iavf_flex_rx_csum(struct iavf_vsi *vsi, struct sk_buff *skb,
  1114					     union iavf_rx_desc *rx_desc)
  1115	{
  1116		struct iavf_rx_csum_decoded csum_bits;
  1117		struct iavf_rx_ptype_decoded decoded;
> 1118		u16 rx_status0, rx_status1, ptype;
  1119	
  1120		rx_status0 = le16_to_cpu(rx_desc->flex_wb.status_error0);
  1121		rx_status1 = le16_to_cpu(rx_desc->flex_wb.status_error1);
  1122		ptype = le16_to_cpu(FIELD_GET(IAVF_RX_FLEX_DESC_PTYPE_M,
  1123					      rx_desc->flex_wb.ptype_flexi_flags0));
  1124		decoded = decode_rx_desc_ptype(ptype);
  1125	
  1126		csum_bits.ipe = FIELD_GET(IAVF_RX_FLEX_DESC_STATUS0_XSUM_IPE_M,
  1127					  rx_status0);
  1128		csum_bits.eipe = FIELD_GET(IAVF_RX_FLEX_DESC_STATUS0_XSUM_EIPE_M,
  1129					   rx_status0);
  1130		csum_bits.l4e = FIELD_GET(IAVF_RX_FLEX_DESC_STATUS0_XSUM_L4E_M,
  1131					  rx_status0);
  1132		csum_bits.eudpe = FIELD_GET(IAVF_RX_FLEX_DESC_STATUS0_XSUM_EUDPE_M,
  1133					    rx_status0);
  1134		csum_bits.l3l4p = FIELD_GET(IAVF_RX_FLEX_DESC_STATUS0_L3L4P_M,
  1135					    rx_status0);
  1136		csum_bits.ipv6exadd = FIELD_GET(IAVF_RX_FLEX_DESC_STATUS0_IPV6EXADD_M,
  1137						rx_status0);
  1138		csum_bits.nat = FIELD_GET(IAVF_RX_FLEX_DESC_STATUS1_NAT_M, rx_status0);
  1139		csum_bits.pprs = 0;
  1140	
  1141		iavf_rx_csum(vsi, skb, &decoded, &csum_bits);
  1142	}
  1143	

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