[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b197865d-8905-497c-8fe0-d6e122b0d9f7@lunn.ch>
Date: Thu, 9 Nov 2023 17:22:58 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Gan Yi Fang <yi.fang.gan@...el.com>
Cc: Alexandre Torgue <alexandre.torgue@...s.st.com>,
Jose Abreu <joabreu@...opsys.com>,
"David S . Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Russell King <linux@...linux.org.uk>,
Andrew Halaney <ahalaney@...hat.com>,
Simon Horman <horms@...nel.org>,
Bartosz Golaszewski <bartosz.golaszewski@...aro.org>,
Shenwei Wang <shenwei.wang@....com>,
Russell King <rmk+kernel@...linux.org.uk>,
Johannes Zink <j.zink@...gutronix.de>,
Jochen Henneberg <jh@...neberg-systemdesign.com>,
netdev@...r.kernel.org, linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Looi Hong Aun <hong.aun.looi@...el.com>,
Voon Weifeng <weifeng.voon@...el.com>,
Song Yoong Siang <yoong.siang.song@...el.com>
Subject: Re: [PATCH net-next 1/1] net: stmmac: Add support for HW-accelerated
VLAN stripping
> +static void dwmac4_rx_hw_vlan(struct mac_device_info *hw,
> + struct dma_desc *rx_desc, struct sk_buff *skb)
> +{
> + if (hw->desc->get_rx_vlan_valid(rx_desc)) {
> + u16 vid = (u16)hw->desc->get_rx_vlan_tci(rx_desc);
> +
> + __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vid);
> + }
> +}
> +static inline int dwmac4_wrback_get_rx_vlan_tci(struct dma_desc *p)
> +{
> + return (le32_to_cpu(p->des0) & RDES0_VLAN_TAG_MASK);
> +}
A tci is a u16. If you make this function return a u16, you can avoid
the cast.
Andrew
Powered by blists - more mailing lists