Thank you for your contribution! Sashiko AI review found more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you respin. Low priority / nit picks for your consideration: - [Low] In net/hsr/hsr_slave.c, hsr_handle_frame() now drops every received PTP frame on purpose (HSR-tagged frames whose… -- hsr: Drop received PTP packets With this change hsr_handle_frame() drops every PTP frame it receives instead of forwarding it through the HSR stack. For HSR/PRP tagged frames it checks the encapsulated protocol, and for other frames it checks the ether type. The existing kfree_skb() + return paths are also merged into a common finish_free_consume label.
> diff --git a/net/hsr/hsr_slave.c b/net/hsr/hsr_slave.c > index 84d8a40bba0a6..86a05f3fc1cc5 100644 > --- a/net/hsr/hsr_slave.c > +++ b/net/hsr/hsr_slave.c
[ ... ]
> @@ -64,15 +64,28 @@ static rx_handler_result_t hsr_handle_frame(struct sk_buff **pskb) > skb_reset_mac_header(skb); > if ((!hsr->prot_version && protocol == htons(ETH_P_PRP)) || > protocol == htons(ETH_P_HSR)) { > - if (!pskb_may_pull(skb, ETH_HLEN + HSR_HLEN)) { > - kfree_skb(skb); > - goto finish_consume; > - } > + if (!pskb_may_pull(skb, ETH_HLEN + HSR_HLEN)) > + goto finish_free_consume; > > skb_set_network_header(skb, ETH_HLEN + HSR_HLEN); > } > skb_reset_mac_len(skb); > > + /* PTP packets are not supposed to be forwarded via HSR as-is. The > + * latency introduced by forwarding renders the time information > + * useless. Userland needs to capture the packet on the original > + * interface instead of hsr. > + */ > + if ((!hsr->prot_version && protocol == htons(ETH_P_PRP)) || > + protocol == htons(ETH_P_HSR)) { > + hsr_ethhdr = (struct hsr_ethhdr *)skb_mac_header(skb); > + if (hsr_ethhdr->hsr_tag.encap_proto == htons(ETH_P_1588)) > + goto finish_free_consume; > + } else { > + if (protocol == htons(ETH_P_1588)) > + goto finish_free_consume; > + } > +
[ ... ]
> -finish_consume: > + return RX_HANDLER_CONSUMED; > + > +finish_free_consume: > + kfree_skb(skb); > return RX_HANDLER_CONSUMED;
[Severity: Low] Should these intentional PTP drops use a dedicated drop reason? Both new PTP checks in hsr_handle_frame() jump to finish_free_consume. That label calls kfree_skb(), which is kfree_skb_reason(skb, SKB_DROP_REASON_NOT_SPECIFIED). The same label also handles the real error drops, which are the pskb_may_pull() failure and frames sent by ourselves. As a result, every PTP frame received on an HSR/PRP slave or interlink port shows up in the skb:kfree_skb tracepoint and in drop_monitor as an unexplained NOT_SPECIFIED drop in hsr_handle_frame(). On a linuxptp-over-HSR setup this produces a steady stream of such drops at the PTP message rate. They cannot be told apart from drops of malformed frames. The kernel-doc for consume_skb() in net/core/skbuff.c says kfree_skb() assumes the frame is being dropped after a failure. Would it be better to use kfree_skb_reason() with a specific reason here, or consume_skb() if this discard is not meant to count as a drop?
> > finish_pass:
-- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/2026…%40linutronix.de