Content-Type: multipart/mixed; boundary="===============7931205225041780243==" MIME-Version: 1.0 From: kbuild test robot To: kbuild-all@lists.01.org Subject: Re: [Intel-wired-lan] [next-queue PATCH v3 2/5] igc: Add support for RX timestamping Date: Thu, 05 Dec 2019 08:33:49 +0800 Message-ID: <201912050821.6rThTy4D%lkp@intel.com> In-Reply-To: <20191202231953.2203397-3-vinicius.gomes@intel.com> List-Id: --===============7931205225041780243== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi Vinicius, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on jkirsher-next-queue/dev-queue] [also build test WARNING on next-20191202 next-20191204] [cannot apply to v5.4 v5.4-rc8 v5.4-rc7 v5.4] [if your patch is applied to the wrong git tree, please drop us a note to h= elp improve the system. BTW, we also suggest to use '--base' option to specify = the base tree in git format-patch, please see https://stackoverflow.com/a/37406= 982] url: https://github.com/0day-ci/linux/commits/Vinicius-Costa-Gomes/igc-A= dd-basic-skeleton-for-PTP/20191203-072231 base: https://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue= .git dev-queue reproduce: # apt-get install sparse # sparse version: v0.6.1-91-g817270f-dirty make ARCH=3Dx86_64 allmodconfig make C=3D1 CF=3D'-fdiagnostic-prefix -D__CHECK_ENDIAN__' If you fix the issue, kindly add following tag Reported-by: kbuild test robot sparse warnings: (new ones prefixed by >>) >> drivers/net/ethernet/intel/igc/igc_ptp.c:397:17: sparse: sparse: incorre= ct type in argument 1 (different base types) @@ expected unsigned int va= l @@ got restricted __be1unsigned int val @@ >> drivers/net/ethernet/intel/igc/igc_ptp.c:397:17: sparse: expected uns= igned int val >> drivers/net/ethernet/intel/igc/igc_ptp.c:397:17: sparse: got restrict= ed __be16 [usertype] drivers/net/ethernet/intel/igc/igc_ptp.c:415:6: sparse: sparse: symbol '= igc_ptp_tx_hang' was not declared. Should it be static? drivers/net/ethernet/intel/igc/igc_ptp.c:445:6: sparse: sparse: symbol '= igc_ptp_tx_work' was not declared. Should it be static? drivers/net/ethernet/intel/igc/igc_ptp.c:549:6: sparse: sparse: symbol '= igc_ptp_suspend' was not declared. Should it be static? vim +397 drivers/net/ethernet/intel/igc/igc_ptp.c 281 = 282 /** 283 * igc_ptp_set_timestamp_mode - setup hardware for timestamping 284 * @adapter: networking device structure 285 * @config: hwtstamp configuration 286 * 287 * Incoming time stamping has to be configured via the hardware 288 * filters. Not all combinations are supported, in particular event 289 * type has to be specified. Matching the kind of event packet is 290 * not supported, with the exception of "all V2 events regardless of 291 * level 2 or 4". 292 * 293 */ 294 static int igc_ptp_set_timestamp_mode(struct igc_adapter *adapter, 295 struct hwtstamp_config *config) 296 { 297 struct igc_hw *hw =3D &adapter->hw; 298 u32 tsync_rx_ctl =3D IGC_TSYNCRXCTL_ENABLED; 299 u32 tsync_rx_cfg =3D 0; 300 bool is_l4 =3D false; 301 bool is_l2 =3D false; 302 u32 regval; 303 = 304 /* reserved for future extensions */ 305 if (config->flags) 306 return -EINVAL; 307 = 308 switch (config->rx_filter) { 309 case HWTSTAMP_FILTER_NONE: 310 tsync_rx_ctl =3D 0; 311 break; 312 case HWTSTAMP_FILTER_PTP_V1_L4_SYNC: 313 tsync_rx_ctl |=3D IGC_TSYNCRXCTL_TYPE_L4_V1; 314 tsync_rx_cfg =3D IGC_TSYNCRXCFG_PTP_V1_SYNC_MESSAGE; 315 is_l4 =3D true; 316 break; 317 case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ: 318 tsync_rx_ctl |=3D IGC_TSYNCRXCTL_TYPE_L4_V1; 319 tsync_rx_cfg =3D IGC_TSYNCRXCFG_PTP_V1_DELAY_REQ_MESSAGE; 320 is_l4 =3D true; 321 break; 322 case HWTSTAMP_FILTER_PTP_V2_EVENT: 323 case HWTSTAMP_FILTER_PTP_V2_L2_EVENT: 324 case HWTSTAMP_FILTER_PTP_V2_L4_EVENT: 325 case HWTSTAMP_FILTER_PTP_V2_SYNC: 326 case HWTSTAMP_FILTER_PTP_V2_L2_SYNC: 327 case HWTSTAMP_FILTER_PTP_V2_L4_SYNC: 328 case HWTSTAMP_FILTER_PTP_V2_DELAY_REQ: 329 case HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ: 330 case HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ: 331 tsync_rx_ctl |=3D IGC_TSYNCRXCTL_TYPE_EVENT_V2; 332 config->rx_filter =3D HWTSTAMP_FILTER_PTP_V2_EVENT; 333 is_l2 =3D true; 334 is_l4 =3D true; 335 break; 336 case HWTSTAMP_FILTER_PTP_V1_L4_EVENT: 337 case HWTSTAMP_FILTER_NTP_ALL: 338 case HWTSTAMP_FILTER_ALL: 339 tsync_rx_ctl |=3D IGC_TSYNCRXCTL_TYPE_ALL; 340 config->rx_filter =3D HWTSTAMP_FILTER_ALL; 341 break; 342 /* fall through */ 343 default: 344 config->rx_filter =3D HWTSTAMP_FILTER_NONE; 345 return -ERANGE; 346 } 347 = 348 /* Per-packet timestamping only works if all packets are 349 * timestamped, so enable timestamping in all packets as long 350 * as one rx filter was configured. 351 */ 352 if (tsync_rx_ctl) { 353 tsync_rx_ctl =3D IGC_TSYNCRXCTL_ENABLED; 354 tsync_rx_ctl |=3D IGC_TSYNCRXCTL_TYPE_ALL; 355 config->rx_filter =3D HWTSTAMP_FILTER_ALL; 356 is_l2 =3D true; 357 is_l4 =3D true; 358 = 359 if (hw->mac.type =3D=3D igc_i225) { 360 regval =3D rd32(IGC_RXPBS); 361 regval |=3D IGC_RXPBS_CFG_TS_EN; 362 wr32(IGC_RXPBS, regval); 363 = 364 /* FIXME: For now, only support retrieving RX 365 * timestamps from timer 0 366 */ 367 igc_ptp_enable_tstamp_all_rxqueues(adapter, 0); 368 } 369 } 370 = 371 /* enable/disable RX */ 372 regval =3D rd32(IGC_TSYNCRXCTL); 373 regval &=3D ~(IGC_TSYNCRXCTL_ENABLED | IGC_TSYNCRXCTL_TYPE_MASK); 374 regval |=3D tsync_rx_ctl; 375 wr32(IGC_TSYNCRXCTL, regval); 376 = 377 /* define which PTP packets are time stamped */ 378 wr32(IGC_TSYNCRXCFG, tsync_rx_cfg); 379 = 380 /* define ethertype filter for timestamped packets */ 381 if (is_l2) 382 wr32(IGC_ETQF(3), 383 (IGC_ETQF_FILTER_ENABLE | /* enable filter */ 384 IGC_ETQF_1588 | /* enable timestamping */ 385 ETH_P_1588)); /* 1588 eth protocol type */ 386 else 387 wr32(IGC_ETQF(3), 0); 388 = 389 /* L4 Queue Filter[3]: filter by destination port and protocol */ 390 if (is_l4) { 391 u32 ftqf =3D (IPPROTO_UDP /* UDP */ 392 | IGC_FTQF_VF_BP /* VF not compared */ 393 | IGC_FTQF_1588_TIME_STAMP /* Enable Timestamp */ 394 | IGC_FTQF_MASK); /* mask all inputs */ 395 ftqf &=3D ~IGC_FTQF_MASK_PROTO_BP; /* enable protocol check */ 396 = > 397 wr32(IGC_IMIR(3), htons(PTP_EV_PORT)); 398 wr32(IGC_IMIREXT(3), 399 (IGC_IMIREXT_SIZE_BP | IGC_IMIREXT_CTRL_BP)); 400 wr32(IGC_FTQF(3), ftqf); 401 } else { 402 wr32(IGC_FTQF(3), IGC_FTQF_MASK); 403 } 404 wrfl(); 405 = 406 /* clear TX/RX time stamp registers, just to be sure */ 407 regval =3D rd32(IGC_TXSTMPL); 408 regval =3D rd32(IGC_TXSTMPH); 409 regval =3D rd32(IGC_RXSTMPL); 410 regval =3D rd32(IGC_RXSTMPH); 411 = 412 return 0; 413 } 414 = --- 0-DAY kernel test infrastructure Open Source Technology Cen= ter https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corpor= ation --===============7931205225041780243==--