All of lore.kernel.org
 help / color / mirror / Atom feed
* [Question] net: dsa: tag_qca: QCA tag and headroom size?
@ 2020-02-12  9:57 Per Förlin
  2020-02-12 20:23 ` Andrew Lunn
  0 siblings, 1 reply; 4+ messages in thread
From: Per Förlin @ 2020-02-12  9:57 UTC (permalink / raw)
  To: netdev, john; +Cc: andrew, f.fainelli

Hi,

---
 net/dsa/tag_qca.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/dsa/tag_qca.c b/net/dsa/tag_qca.c
index c8a128c9e5e0..70db7c909f74 100644
--- a/net/dsa/tag_qca.c
+++ b/net/dsa/tag_qca.c
@@ -33,7 +33,7 @@ static struct sk_buff *qca_tag_xmit(struct sk_buff *skb, struct net_device *dev)
 	struct dsa_port *dp = dsa_slave_to_port(dev);
 	u16 *phdr, hdr;
 
-	if (skb_cow_head(skb, 0) < 0)
>  Is it really safe to assume there is enough headroom for the QCA tag?

+	if (skb_cow_head(skb, QCA_HDR_LEN) < 0)
> My proposal. Specify QCA tag size to make sure there is headroom.

 		return NULL;
 
 	skb_push(skb, QCA_HDR_LEN);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Question] net: dsa: tag_qca: QCA tag and headroom size?
  2020-02-12  9:57 [Question] net: dsa: tag_qca: QCA tag and headroom size? Per Förlin
@ 2020-02-12 20:23 ` Andrew Lunn
  2020-02-13  5:23   ` Per Förlin
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Lunn @ 2020-02-12 20:23 UTC (permalink / raw)
  To: Per Förlin; +Cc: netdev, john, f.fainelli

On Wed, Feb 12, 2020 at 09:57:00AM +0000, Per Förlin wrote:
> Hi,
> 
> ---
>  net/dsa/tag_qca.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/dsa/tag_qca.c b/net/dsa/tag_qca.c
> index c8a128c9e5e0..70db7c909f74 100644
> --- a/net/dsa/tag_qca.c
> +++ b/net/dsa/tag_qca.c
> @@ -33,7 +33,7 @@ static struct sk_buff *qca_tag_xmit(struct sk_buff *skb, struct net_device *dev)
>  	struct dsa_port *dp = dsa_slave_to_port(dev);
>  	u16 *phdr, hdr;
>  
> -	if (skb_cow_head(skb, 0) < 0)
> >  Is it really safe to assume there is enough headroom for the QCA tag?
> 
> +	if (skb_cow_head(skb, QCA_HDR_LEN) < 0)
> > My proposal. Specify QCA tag size to make sure there is headroom.
> 
>  		return NULL;
>  
>  	skb_push(skb, QCA_HDR_LEN);

Hi Per

Yes, your change looks correct. ar9331_tag_xmit() also seems to have
the same problem.

Do you want to submit a patch?

Thanks

    Andrew

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Question] net: dsa: tag_qca: QCA tag and headroom size?
  2020-02-12 20:23 ` Andrew Lunn
@ 2020-02-13  5:23   ` Per Förlin
  2020-02-13 12:53     ` Andrew Lunn
  0 siblings, 1 reply; 4+ messages in thread
From: Per Förlin @ 2020-02-13  5:23 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: netdev, john, f.fainelli


> > -     if (skb_cow_head(skb, 0) < 0)
> > >  Is it really safe to assume there is enough headroom for the QCA tag?
> >
> > +     if (skb_cow_head(skb, QCA_HDR_LEN) < 0)
> > > My proposal. Specify QCA tag size to make sure there is headroom.
> >
> >               return NULL;
> >
> >       skb_push(skb, QCA_HDR_LEN);

> > Hi Per

> > Yes, your change looks correct. ar9331_tag_xmit() also seems to have
> > the same problem.

>> Do you want to submit a patch?
Thanks for your response,
I can submit a patch on both drivers, however I only have hardware to perform an actual test on the QCA switch.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Question] net: dsa: tag_qca: QCA tag and headroom size?
  2020-02-13  5:23   ` Per Förlin
@ 2020-02-13 12:53     ` Andrew Lunn
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2020-02-13 12:53 UTC (permalink / raw)
  To: Per Förlin; +Cc: netdev, john, f.fainelli

On Thu, Feb 13, 2020 at 05:23:59AM +0000, Per Förlin wrote:
> 
> > > -     if (skb_cow_head(skb, 0) < 0)
> > > >  Is it really safe to assume there is enough headroom for the QCA tag?
> > >
> > > +     if (skb_cow_head(skb, QCA_HDR_LEN) < 0)
> > > > My proposal. Specify QCA tag size to make sure there is headroom.
> > >
> > >               return NULL;
> > >
> > >       skb_push(skb, QCA_HDR_LEN);
> 
> > > Hi Per
> 
> > > Yes, your change looks correct. ar9331_tag_xmit() also seems to have
> > > the same problem.
> 
> >> Do you want to submit a patch?
> Thanks for your response,

> I can submit a patch on both drivers, however I only have hardware
> to perform an actual test on the QCA switch.

Hi Per

That is fine. This should be low risk. Cc: Oleksij Rempel
<kernel@pengutronix.de> when you post the patch, so he can review and
test it.

Thanks
	Andrew

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-02-13 12:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-12  9:57 [Question] net: dsa: tag_qca: QCA tag and headroom size? Per Förlin
2020-02-12 20:23 ` Andrew Lunn
2020-02-13  5:23   ` Per Förlin
2020-02-13 12:53     ` Andrew Lunn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.