netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jiawen Wu <jiawenwu@trustnetic.com>,
	andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, richardcochran@gmail.com,
	linux@armlinux.org.uk, horms@kernel.org,
	jacob.e.keller@intel.com, netdev@vger.kernel.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	mengyuanlou@net-swift.com, Jiawen Wu <jiawenwu@trustnetic.com>
Subject: Re: [PATCH net-next 1/4] net: wangxun: Add support for PTP clock
Date: Fri, 3 Jan 2025 00:16:06 +0800	[thread overview]
Message-ID: <202501022323.HDFZ6FVp-lkp@intel.com> (raw)
In-Reply-To: <20250102103026.1982137-2-jiawenwu@trustnetic.com>

Hi Jiawen,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Jiawen-Wu/net-wangxun-Add-support-for-PTP-clock/20250102-181338
base:   net-next/main
patch link:    https://lore.kernel.org/r/20250102103026.1982137-2-jiawenwu%40trustnetic.com
patch subject: [PATCH net-next 1/4] net: wangxun: Add support for PTP clock
config: x86_64-buildonly-randconfig-004-20250102 (https://download.01.org/0day-ci/archive/20250102/202501022323.HDFZ6FVp-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250102/202501022323.HDFZ6FVp-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202501022323.HDFZ6FVp-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from drivers/net/ethernet/wangxun/libwx/wx_ptp.c:4:
   In file included from include/linux/ptp_classify.h:14:
   In file included from include/linux/ip.h:16:
   In file included from include/linux/skbuff.h:17:
   In file included from include/linux/bvec.h:10:
   In file included from include/linux/highmem.h:8:
   In file included from include/linux/cacheflush.h:5:
   In file included from arch/x86/include/asm/cacheflush.h:5:
   In file included from include/linux/mm.h:2223:
   include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     518 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
>> drivers/net/ethernet/wangxun/libwx/wx_ptp.c:358:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
     358 |         case HWTSTAMP_TX_ON:
         |         ^
   drivers/net/ethernet/wangxun/libwx/wx_ptp.c:358:2: note: insert 'break;' to avoid fall-through
     358 |         case HWTSTAMP_TX_ON:
         |         ^
         |         break; 
   2 warnings generated.


vim +358 drivers/net/ethernet/wangxun/libwx/wx_ptp.c

   315	
   316	/**
   317	 * wx_ptp_set_timestamp_mode - setup the hardware for the requested mode
   318	 * @wx: the private board structure
   319	 * @config: the hwtstamp configuration requested
   320	 *
   321	 * Returns 0 on success, negative on failure
   322	 *
   323	 * Outgoing time stamping can be enabled and disabled. Play nice and
   324	 * disable it when requested, although it shouldn't cause any overhead
   325	 * when no packet needs it. At most one packet in the queue may be
   326	 * marked for time stamping, otherwise it would be impossible to tell
   327	 * for sure to which packet the hardware time stamp belongs.
   328	 *
   329	 * Incoming time stamping has to be configured via the hardware
   330	 * filters. Not all combinations are supported, in particular event
   331	 * type has to be specified. Matching the kind of event packet is
   332	 * not supported, with the exception of "all V2 events regardless of
   333	 * level 2 or 4".
   334	 *
   335	 * Since hardware always timestamps Path delay packets when timestamping V2
   336	 * packets, regardless of the type specified in the register, only use V2
   337	 * Event mode. This more accurately tells the user what the hardware is going
   338	 * to do anyways.
   339	 *
   340	 * Note: this may modify the hwtstamp configuration towards a more general
   341	 * mode, if required to support the specifically requested mode.
   342	 */
   343	static int wx_ptp_set_timestamp_mode(struct wx *wx,
   344					     struct hwtstamp_config *config)
   345	{
   346		u32 tsync_tx_ctl = WX_TSC_1588_CTL_ENABLED;
   347		u32 tsync_rx_ctl = WX_PSR_1588_CTL_ENABLED;
   348		DECLARE_BITMAP(flags, WX_PF_FLAGS_NBITS);
   349		u32 tsync_rx_mtrl = PTP_EV_PORT << 16;
   350		bool is_l2 = false;
   351		u32 regval;
   352	
   353		memcpy(flags, wx->flags, sizeof(wx->flags));
   354	
   355		switch (config->tx_type) {
   356		case HWTSTAMP_TX_OFF:
   357			tsync_tx_ctl = 0;
 > 358		case HWTSTAMP_TX_ON:
   359			break;
   360		default:
   361			return -ERANGE;
   362		}
   363	
   364		switch (config->rx_filter) {
   365		case HWTSTAMP_FILTER_NONE:
   366			tsync_rx_ctl = 0;
   367			tsync_rx_mtrl = 0;
   368			clear_bit(WX_FLAG_RX_HWTSTAMP_ENABLED, flags);
   369			clear_bit(WX_FLAG_RX_HWTSTAMP_IN_REGISTER, flags);
   370			break;
   371		case HWTSTAMP_FILTER_PTP_V1_L4_SYNC:
   372			tsync_rx_ctl |= WX_PSR_1588_CTL_TYPE_L4_V1;
   373			tsync_rx_mtrl |= WX_PSR_1588_MSG_V1_SYNC;
   374			set_bit(WX_FLAG_RX_HWTSTAMP_ENABLED, flags);
   375			set_bit(WX_FLAG_RX_HWTSTAMP_IN_REGISTER, flags);
   376			break;
   377		case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ:
   378			tsync_rx_ctl |= WX_PSR_1588_CTL_TYPE_L4_V1;
   379			tsync_rx_mtrl |= WX_PSR_1588_MSG_V1_DELAY_REQ;
   380			set_bit(WX_FLAG_RX_HWTSTAMP_ENABLED, flags);
   381			set_bit(WX_FLAG_RX_HWTSTAMP_IN_REGISTER, flags);
   382			break;
   383		case HWTSTAMP_FILTER_PTP_V2_EVENT:
   384		case HWTSTAMP_FILTER_PTP_V2_L2_EVENT:
   385		case HWTSTAMP_FILTER_PTP_V2_L4_EVENT:
   386		case HWTSTAMP_FILTER_PTP_V2_SYNC:
   387		case HWTSTAMP_FILTER_PTP_V2_L2_SYNC:
   388		case HWTSTAMP_FILTER_PTP_V2_L4_SYNC:
   389		case HWTSTAMP_FILTER_PTP_V2_DELAY_REQ:
   390		case HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ:
   391		case HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ:
   392			tsync_rx_ctl |= WX_PSR_1588_CTL_TYPE_EVENT_V2;
   393			is_l2 = true;
   394			config->rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT;
   395			set_bit(WX_FLAG_RX_HWTSTAMP_ENABLED, flags);
   396			set_bit(WX_FLAG_RX_HWTSTAMP_IN_REGISTER, flags);
   397			break;
   398		default:
   399			/* register RXMTRL must be set in order to do V1 packets,
   400			 * therefore it is not possible to time stamp both V1 Sync and
   401			 * Delay_Req messages unless hardware supports timestamping all
   402			 * packets => return error
   403			 */
   404			clear_bit(WX_FLAG_RX_HWTSTAMP_ENABLED, wx->flags);
   405			clear_bit(WX_FLAG_RX_HWTSTAMP_IN_REGISTER, wx->flags);
   406			config->rx_filter = HWTSTAMP_FILTER_NONE;
   407			return -ERANGE;
   408		}
   409	
   410		/* define ethertype filter for timestamping L2 packets */
   411		if (is_l2)
   412			wr32(wx, WX_PSR_ETYPE_SWC(WX_PSR_ETYPE_SWC_FILTER_1588),
   413			     (WX_PSR_ETYPE_SWC_FILTER_EN | /* enable filter */
   414			      WX_PSR_ETYPE_SWC_1588 | /* enable timestamping */
   415			      ETH_P_1588)); /* 1588 eth protocol type */
   416		else
   417			wr32(wx, WX_PSR_ETYPE_SWC(WX_PSR_ETYPE_SWC_FILTER_1588), 0);
   418	
   419		/* enable/disable TX */
   420		regval = rd32ptp(wx, WX_TSC_1588_CTL);
   421		regval &= ~WX_TSC_1588_CTL_ENABLED;
   422		regval |= tsync_tx_ctl;
   423		wr32ptp(wx, WX_TSC_1588_CTL, regval);
   424	
   425		/* enable/disable RX */
   426		regval = rd32(wx, WX_PSR_1588_CTL);
   427		regval &= ~(WX_PSR_1588_CTL_ENABLED | WX_PSR_1588_CTL_TYPE_MASK);
   428		regval |= tsync_rx_ctl;
   429		wr32(wx, WX_PSR_1588_CTL, regval);
   430	
   431		/* define which PTP packets are time stamped */
   432		wr32(wx, WX_PSR_1588_MSG, tsync_rx_mtrl);
   433	
   434		WX_WRITE_FLUSH(wx);
   435	
   436		/* configure adapter flags only when HW is actually configured */
   437		memcpy(wx->flags, flags, sizeof(wx->flags));
   438	
   439		/* clear TX/RX timestamp state, just to be sure */
   440		wx_ptp_clear_tx_timestamp(wx);
   441		rd32(wx, WX_PSR_1588_STMPH);
   442	
   443		return 0;
   444	}
   445	

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

  parent reply	other threads:[~2025-01-02 16:16 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-02 10:30 [PATCH net-next 0/4] Support PTP clock for Wangxun NICs Jiawen Wu
2025-01-02 10:30 ` [PATCH net-next 1/4] net: wangxun: Add support for PTP clock Jiawen Wu
2025-01-02 14:13   ` Andrew Lunn
2025-01-06  7:42     ` Jiawen Wu
2025-01-06 14:26       ` Andrew Lunn
2025-01-07  2:24         ` Jiawen Wu
2025-01-07 13:33           ` Andrew Lunn
2025-01-08  0:34             ` Keller, Jacob E
2025-01-08  7:26               ` Jiawen Wu
2025-01-08 18:32                 ` Andrew Lunn
2025-01-02 16:16   ` kernel test robot [this message]
2025-01-02 17:33   ` Vadim Fedorenko
2025-01-06 21:29   ` Keller, Jacob E
2025-01-02 10:30 ` [PATCH net-next 2/4] net: wangxun: Implement get_ts_info Jiawen Wu
2025-01-02 17:44   ` Vadim Fedorenko
2025-01-06  2:35     ` Jiawen Wu
2025-01-02 10:30 ` [PATCH net-next 3/4] net: wangxun: Add watchdog task for PTP clock Jiawen Wu
2025-01-02 17:53   ` Vadim Fedorenko
2025-01-03  8:45     ` Richard Cochran
2025-01-02 10:30 ` [PATCH net-next 4/4] net: ngbe: Add support for 1PPS and TOD Jiawen Wu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202501022323.HDFZ6FVp-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jacob.e.keller@intel.com \
    --cc=jiawenwu@trustnetic.com \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=llvm@lists.linux.dev \
    --cc=mengyuanlou@net-swift.com \
    --cc=netdev@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).