Re: [Intel-wired-lan] [PATCH net] igc: Fix RX HW timestamp reporting when NET_RX_BUSY_POLL is disabled
From: Ding Meng <hidden>
Date: 2026-06-25 10:38:38
Also in:
intel-wired-lan, lkml
Dear Paul, Thanks for your comments. On Mon, Jun 22, 2026 at 05:59:53PM +0200, Paul Menzel wrote:
Am 22.06.26 um 06:13 schrieb Ding Meng via Intel-wired-lan:quoted
When CONFIG_NET_RX_BUSY_POLL is deactivated, fetching RX HW timestamps from the NIC no longer works as expected.Maybe paste some logs/errors, so it can be easier found by people with the same issue.
Will do.
quoted
This occurs because disabling CONFIG_NET_RX_BUSY_POLL disables the SKB NAPI mapping in __skb_mark_napi_id(). Consequently, get_timestamp() fails to perform its driver lookup, and the igc driver's struct net_device_ops::ndo_get_tstamp is never invoked. Instead, get_timestamp() falls back to use shhwtstamps(skb)->hwtstamp, a field that the driver has not populated. Fix this by populating the hwtstamp field with the correct timestamp in the default timer when CONFIG_NET_RX_BUSY_POLL is disabled.Maybe detail, why the adapter needs to be passed now. Also, please describe a test case to check the change.
Will do.
quoted
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c index 8ac16808023..1da8d7aa76d 100644 --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c@@ -1992,7 +1992,26 @@ static struct sk_buff *igc_build_skb(struct igc_ring *rx_ring, return skb; } -static struct sk_buff *igc_construct_skb(struct igc_ring *rx_ring, +static void igc_construct_skb_timestamps(struct igc_adapter *adapter, + struct sk_buff *skb, + struct igc_xdp_buff *ctx) +{ + if (!ctx->rx_ts) + return; +#ifdef CONFIG_NET_RX_BUSY_POLLIs there a way to do this in C instead of the pre-processor. That way all the code gets build tested. (Is there a config with disabled NET_RX_BUSY_POLL?)
How about defining a function to replace the pre-processor:
static inline bool is_net_rx_busy_poll()
{
#ifdef CONFIG_NET_RX_BUSY_POLL
return true;
#else
return false;
#endif
}
CONFIG_PREEMPT_RT=y && CONFIG_NETCONSOLE=y will cause NET_RX_BUSY_POLL
disabled.
Kind regards,
Ding Meng