Subject: Re: [PATCH net v2 2/4] ethernet: Add helper for assigning packet type when dest address does not match device address

From: Sabrina Dubroca <[email-masked]>
Date: Tue, 23 Apr 2024 15:51:28 +0200

2024-04-19, 14:30:17 -0700, Rahul Rameshbabu wrote:
> Enable reuse of logic in eth_type_trans for determining packet type.
> 
> Suggested-by: Sabrina Dubroca <[email-masked]>
> Cc: [email-masked]
> Signed-off-by: Rahul Rameshbabu <[email-masked]>
> ---
>  include/linux/etherdevice.h | 24 ++++++++++++++++++++++++
>  net/ethernet/eth.c          | 12 +-----------
>  2 files changed, 25 insertions(+), 11 deletions(-)
> 
> diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
> index 224645f17c33..f5868ac69dec 100644
> --- a/include/linux/etherdevice.h
> +++ b/include/linux/etherdevice.h
> @@ -607,6 +607,30 @@ static inline void eth_hw_addr_gen(struct net_device *dev, const u8 *base_addr,
>  	eth_hw_addr_set(dev, addr);
>  }
>  
> +/**
> + * eth_skb_pkt_type - Assign packet type if destination address does not match
> + * @skb: Assigned a packet type if address does not match @dev address
> + * @dev: Network device used to compare packet address against
> + *
> + * If the destination MAC address of the packet does not match the network
> + * device address, assign an appropriate packet type.
> + */
> +static inline void eth_skb_pkt_type(struct sk_buff *skb, struct net_device *dev)

Could you make dev const? Otherwise the series looks good to me.

Thanks.

-- 
Sabrina