Hi Vedang,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
url:
https://github.com/0day-ci/linux/commits/Vedang-Patel/igc-Add-XDP-support...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
de1db4a6ed6241e34cab0e5059d4b56f6bae39b9
config: i386-randconfig-s002-20210211 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-215-g0fb77bb6-dirty
#
https://github.com/0day-ci/linux/commit/486d877688ec9b7b34adb9a2757c6ccf0...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review Vedang-Patel/igc-Add-XDP-support/20210211-061713
git checkout 486d877688ec9b7b34adb9a2757c6ccf0b31853a
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
"sparse warnings: (new ones prefixed by >>)"
> drivers/net/ethernet/intel/igc/igc_ptp.c:181:18: sparse: sparse:
cast to restricted __le32
drivers/net/ethernet/intel/igc/igc_ptp.c:182:24:
sparse: sparse: cast to restricted __le32
vim +181 drivers/net/ethernet/intel/igc/igc_ptp.c
153
154 /**
155 * igc_ptp_rx_pktstamp - Retrieve timestamp from Rx packet buffer
156 * @q_vector: Pointer to interrupt specific structure
157 * @va: Pointer to address containing Rx buffer
158 * @skb: Buffer containing timestamp and packet
159 *
160 * This function retrieves the timestamp saved in the beginning of packet
161 * buffer. While two timestamps are available, one in timer0 reference and the
162 * other in timer1 reference, this function considers only the timestamp in
163 * timer0 reference.
164 */
165 void igc_ptp_rx_pktstamp(struct igc_q_vector *q_vector, u32 *va,
166 struct sk_buff *skb)
167 {
168 struct igc_adapter *adapter = q_vector->adapter;
169 u64 regval;
170 int adjust;
171
172 /* Timestamps are saved in little endian at the beginning of the packet
173 * buffer following the layout:
174 *
175 * DWORD: | 0 | 1 | 2 | 3 |
176 * Field: | Timer1 SYSTIML | Timer1 SYSTIMH | Timer0 SYSTIML | Timer0 SYSTIMH |
177 *
178 * SYSTIML holds the nanoseconds part while SYSTIMH holds the seconds
179 * part of the timestamp.
180 */
181 regval = le32_to_cpu(va[2]);
182 regval |=
(u64)le32_to_cpu(va[3]) << 32;
183 igc_ptp_systim_to_hwtstamp(adapter, skb_hwtstamps(skb), regval);
184
185 /* Adjust timestamp for the RX latency based on link speed */
186 switch (adapter->link_speed) {
187 case SPEED_10:
188 adjust = IGC_I225_RX_LATENCY_10;
189 break;
190 case SPEED_100:
191 adjust = IGC_I225_RX_LATENCY_100;
192 break;
193 case SPEED_1000:
194 adjust = IGC_I225_RX_LATENCY_1000;
195 break;
196 case SPEED_2500:
197 adjust = IGC_I225_RX_LATENCY_2500;
198 break;
199 default:
200 adjust = 0;
201 netdev_warn_once(adapter->netdev, "Imprecise timestamp\n");
202 break;
203 }
204 skb_hwtstamps(skb)->hwtstamp =
205 ktime_sub_ns(skb_hwtstamps(skb)->hwtstamp, adjust);
206 }
207
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org