Re: [PATCH 03/20] net: xilinx: tsn: add endpoint MAC driver skeleton

[email protected]
Newsgroups org.kernel.vger.linux-devicetree
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Dropped packets are freed using `dev_kfree_skb()`, which aliases to `consume_skb()` and incorrectly signals successful transmission to tracepoints.
--

--- Patch [3]: [PATCH 03/20] net: xilinx: tsn: add endpoint MAC driver skeleton ---
commit 3acdda66dd5bb6201672edaed64d428e5efb7890
Author: Srinivas Neeli <[email protected]>

net: xilinx: tsn: add endpoint MAC driver skeleton

This commit adds a platform driver skeleton for the TSN Endpoint MAC. It
registers the netdev, sets the MAC address, and provides minimal operations
for device bring-up, intentionally dropping frames on transmit since there
is no data path yet.

[ ... ]
> diff --git a/drivers/net/ethernet/xilinx/tsn/xilinx_tsn_ep.c b/drivers/net/ethernet/xilinx/tsn/xilinx_tsn_ep.c
> new file mode 100644
> index 0000000000000..9b556edf54237
> --- /dev/null
> +++ b/drivers/net/ethernet/xilinx/tsn/xilinx_tsn_ep.c
[ ... ]
> +static netdev_tx_t ep_start_xmit(struct sk_buff *skb, struct net_device *ndev)
> +{
> +	dev_kfree_skb(skb);
> +	DEV_STATS_INC(ndev, tx_dropped);
> +	return NETDEV_TX_OK;
> +}

[Severity: Medium]
Since ep_start_xmit() intentionally drops the packet, should it use
kfree_skb() or dev_kfree_skb_any() instead of dev_kfree_skb()?

dev_kfree_skb() aliases to consume_skb(), which triggers the 'consume'
tracepoints used for successfully transmitted packets. Calling it here
prevents network diagnostic tools (such as dropwatch) from properly
recording these packets as dropped.

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.