diff mbox series

[01/14] net: ethernet: mtk_eth_soc: account for vlan in rx header length

Message ID 20221107185452.90711-1-nbd@nbd.name (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series [01/14] net: ethernet: mtk_eth_soc: account for vlan in rx header length | expand

Checks

Context Check Description
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter warning Series does not have a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 11 this patch: 11
netdev/cc_maintainers success CCed 12 of 12 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 11 this patch: 11
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Felix Fietkau Nov. 7, 2022, 6:54 p.m. UTC
This may be needed for correct MTU settings on devices using DSA

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 drivers/net/ethernet/mediatek/mtk_eth_soc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Vladimir Oltean Nov. 7, 2022, 8:55 p.m. UTC | #1
On Mon, Nov 07, 2022 at 07:54:39PM +0100, Felix Fietkau wrote:
> This may be needed for correct MTU settings on devices using DSA
> 
> Signed-off-by: Felix Fietkau <nbd@nbd.name>
> ---
>  drivers/net/ethernet/mediatek/mtk_eth_soc.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
> index 589f27ddc401..dcf2a0d5da33 100644
> --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
> +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
> @@ -29,7 +29,7 @@
>  #define MTK_TX_DMA_BUF_LEN_V2	0xffff
>  #define MTK_DMA_SIZE		512
>  #define MTK_MAC_COUNT		2
> -#define MTK_RX_ETH_HLEN		(ETH_HLEN + ETH_FCS_LEN)
> +#define MTK_RX_ETH_HLEN		(VLAN_ETH_HLEN + ETH_HLEN + ETH_FCS_LEN)

Commit title says account for VLAN (VLAN_HLEN, 4 bytes), code says add
VLAN_ETH_HLEN (18) more bytes.

Also, why is DSA mentioned in the commit message? Is accounting for VLAN
hlen not needed if DSA is not used? Why?

>  #define MTK_RX_HLEN		(NET_SKB_PAD + MTK_RX_ETH_HLEN + NET_IP_ALIGN)
>  #define MTK_DMA_DUMMY_DESC	0xffffffff
>  #define MTK_DEFAULT_MSG_ENABLE	(NETIF_MSG_DRV | \
> -- 
> 2.38.1
>
Felix Fietkau Nov. 8, 2022, 6:18 a.m. UTC | #2
On 07.11.22 21:55, Vladimir Oltean wrote:
> On Mon, Nov 07, 2022 at 07:54:39PM +0100, Felix Fietkau wrote:
>> This may be needed for correct MTU settings on devices using DSA
>> 
>> Signed-off-by: Felix Fietkau <nbd@nbd.name>
>> ---
>>  drivers/net/ethernet/mediatek/mtk_eth_soc.h | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
>> index 589f27ddc401..dcf2a0d5da33 100644
>> --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
>> +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
>> @@ -29,7 +29,7 @@
>>  #define MTK_TX_DMA_BUF_LEN_V2	0xffff
>>  #define MTK_DMA_SIZE		512
>>  #define MTK_MAC_COUNT		2
>> -#define MTK_RX_ETH_HLEN		(ETH_HLEN + ETH_FCS_LEN)
>> +#define MTK_RX_ETH_HLEN		(VLAN_ETH_HLEN + ETH_HLEN + ETH_FCS_LEN)
> 
> Commit title says account for VLAN (VLAN_HLEN, 4 bytes), code says add
> VLAN_ETH_HLEN (18) more bytes.
> 
> Also, why is DSA mentioned in the commit message? Is accounting for VLAN
> hlen not needed if DSA is not used? Why?
Will fix the code and improve the comments in v2.

- Felix
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
index 589f27ddc401..dcf2a0d5da33 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -29,7 +29,7 @@ 
 #define MTK_TX_DMA_BUF_LEN_V2	0xffff
 #define MTK_DMA_SIZE		512
 #define MTK_MAC_COUNT		2
-#define MTK_RX_ETH_HLEN		(ETH_HLEN + ETH_FCS_LEN)
+#define MTK_RX_ETH_HLEN		(VLAN_ETH_HLEN + ETH_HLEN + ETH_FCS_LEN)
 #define MTK_RX_HLEN		(NET_SKB_PAD + MTK_RX_ETH_HLEN + NET_IP_ALIGN)
 #define MTK_DMA_DUMMY_DESC	0xffffffff
 #define MTK_DEFAULT_MSG_ENABLE	(NETIF_MSG_DRV | \