Re: [PATCH net-next v5 6/6] net: dsa: microchip: fix tag_ksz egress mask for KSZ8795 family

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Pieter, 

On Mon, 2024-08-12 at 17:29 +0200, vtpieter@xxxxxxxxx wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you
> know the content is safe
> 
> From: Pieter Van Trappen <pieter.van.trappen@xxxxxxx>
> 
> Fix the tag_ksz egress mask for DSA_TAG_PROTO_KSZ8795, the port is
> encoded in the two and not three LSB. This fix is for completeness,
> for example the bug doesn't manifest itself on the KSZ8794 because
> bit
> 2 seems to be always zero.
> 
> Signed-off-by: Pieter Van Trappen <pieter.van.trappen@xxxxxxx>
> ---
>  net/dsa/tag_ksz.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/dsa/tag_ksz.c b/net/dsa/tag_ksz.c
> index ee7b272ab715..15d9f8d28ffc 100644
> --- a/net/dsa/tag_ksz.c
> +++ b/net/dsa/tag_ksz.c
> @@ -141,7 +141,7 @@ static struct sk_buff *ksz8795_rcv(struct sk_buff
> *skb, struct net_device *dev)
>  {
>         u8 *tag = skb_tail_pointer(skb) - KSZ_EGRESS_TAG_LEN;
> 
> -       return ksz_common_rcv(skb, dev, tag[0] & 7,
> KSZ_EGRESS_TAG_LEN);
> +       return ksz_common_rcv(skb, dev, tag[0] & GENMASK(1, 0),
> KSZ_EGRESS_TAG_LEN);

It's not like adding GENMASK(1,0) inside statement. You can add macro
above the ksz8795_xmit( ) like

#define KSZ8795_EG_TAIL_TAG_PORT_M GENMASK(1, 0)

Also you need to update the comments above ksz8795_xmit( ) where
comments explains for egress it supports upto port 7. Kindly update it
as well.

 * tag0 : zero-based value represents port
 *	  (eg, 0x00=port1, 0x02=port3, 0x06=port7)

You can wait for 24hrs betweeen two patch set submission, to get review
comments from other reviewers as well. 

>  }
> 
>  static const struct dsa_device_ops ksz8795_netdev_ops = {
> --
> 2.43.0
> 




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux