Re: [PATCH net-next 1/3] net: cpsw: return proper RX timestamping filter in cpsw_hwtstamp_get()
From: Vladimir Oltean
Date: Fri May 09 2025 - 09:23:53 EST
On Thu, May 08, 2025 at 11:33:06PM +0100, Vadim Fedorenko wrote:
> On 08/05/2025 20:48, Vladimir Oltean wrote:
> > priv->rx_ts_enabled is a boolean variable (0 or 1). Overlapped over enum
> > hwtstamp_rx_filters, it makes cfg.rx_filter take the value of either
> > HWTSTAMP_FILTER_NONE (when 0) or HWTSTAMP_FILTER_ALL (when 1).
>
> Hmm.. I have to disagree here. rx_ts_enabled is int, not bool:
>
> struct cpsw_priv {
> struct net_device *ndev;
> struct device *dev;
> u32 msg_enable;
> u8 mac_addr[ETH_ALEN];
> bool rx_pause;
> bool tx_pause;
> bool mqprio_hw;
> int fifo_bw[CPSW_TC_NUM];
> int shp_cfg_speed;
> int tx_ts_enabled;
> int rx_ts_enabled;
> struct bpf_prog *xdp_prog;
> ....
>
> And it's assigned a value of HWTSTAMP_FILTER_PTP_V2_EVENT in
> cpsw_hwtstamp_set(). Not sure this change is actually needed.
You're right, thanks for pointing it out. I had searched for
"rx_ts_enabled" and mistook the first occurrence, in am65-cpsw-nuss.h,
as the definition for this driver. The patch is not needed in that case.