Re: [RFC PATCH 02/13] net: dsa: implement a central TX reallocation procedure

2020-10-19 Thread Andrew Lunn
On Mon, Oct 19, 2020 at 10:30:47AM +, Vladimir Oltean wrote: > On Mon, Oct 19, 2020 at 08:33:27AM +, David Laight wrote: > > Is it possible to send the extra bytes from a separate buffer fragment? > > The entire area could be allocated (coherent) when the rings are > > allocated. > > That w

Re: [RFC PATCH 02/13] net: dsa: implement a central TX reallocation procedure

2020-10-19 Thread Vladimir Oltean
On Mon, Oct 19, 2020 at 11:14:07AM +, David Laight wrote: > If the skb are 'cloned' then I suspect you can't even put the MAC addresses > into the skb because they might be being transmitted on another interface. No, that's not right. The bridge floods frames by cloning them, and L2 forwarding

RE: [RFC PATCH 02/13] net: dsa: implement a central TX reallocation procedure

2020-10-19 Thread David Laight
From: Vladimir Oltean > Sent: 19 October 2020 11:31 > > On Mon, Oct 19, 2020 at 08:33:27AM +, David Laight wrote: > > Is it possible to send the extra bytes from a separate buffer fragment? > > The entire area could be allocated (coherent) when the rings are > > allocated. > > That would save

Re: [RFC PATCH 02/13] net: dsa: implement a central TX reallocation procedure

2020-10-19 Thread Vladimir Oltean
On Mon, Oct 19, 2020 at 08:33:27AM +, David Laight wrote: > Is it possible to send the extra bytes from a separate buffer fragment? > The entire area could be allocated (coherent) when the rings are > allocated. > That would save having to modify the skb at all. > > Even if some bytes of the f

RE: [RFC PATCH 02/13] net: dsa: implement a central TX reallocation procedure

2020-10-19 Thread David Laight
From: Florian Fainelli> > Sent: 17 October 2020 23:12 .. > Not positive you need that because you may be account for more head or > tail room than necessary. > > For instance with tag_brcm.c and systemport.c we need 4 bytes of head > room for the Broadcom tag and an additional 8 bytes for pushing

Re: [RFC PATCH 02/13] net: dsa: implement a central TX reallocation procedure

2020-10-18 Thread Vladimir Oltean
On Sun, Oct 18, 2020 at 01:59:43PM +0200, Christian Eggers wrote: > On Sunday, 18 October 2020, 13:42:06 CEST, Vladimir Oltean wrote: > > On Sun, Oct 18, 2020 at 12:36:03PM +0200, Christian Eggers wrote: > > > > err = pskb_expand_head(skb, max(needed_headroom, 0), > > > > > > > >

Re: [RFC PATCH 02/13] net: dsa: implement a central TX reallocation procedure

2020-10-18 Thread Christian Eggers
On Sunday, 18 October 2020, 13:42:06 CEST, Vladimir Oltean wrote: > On Sun, Oct 18, 2020 at 12:36:03PM +0200, Christian Eggers wrote: > > > err = pskb_expand_head(skb, max(needed_headroom, 0), > > > > > > max(needed_tailroom, 0), GFP_ATOMIC); > > > > You m

Re: [RFC PATCH 02/13] net: dsa: implement a central TX reallocation procedure

2020-10-18 Thread Vladimir Oltean
On Sun, Oct 18, 2020 at 12:36:03PM +0200, Christian Eggers wrote: > > /* For tail taggers, we need to pad short frames ourselves, to ensure > >* that the tail tag does not fail at its role of being at the end of > >* the packet, once the master interface pads the frame. > >

Re: [RFC PATCH 02/13] net: dsa: implement a central TX reallocation procedure

2020-10-18 Thread Christian Eggers
Hi Vladimir, thank you very much for bringing some progress into this. I tried to test on top of latest net-next, but I currently get a linker error (not related to this): arch/arm/vfp/vfphw.o: in function `vfp_support_entry': arch/arm/vfp/vfphw.S:85:(.text+0xa): relocation truncated to fit: R

Re: [RFC PATCH 02/13] net: dsa: implement a central TX reallocation procedure

2020-10-17 Thread Florian Fainelli
On 10/17/2020 3:17 PM, Vladimir Oltean wrote: On Sat, Oct 17, 2020 at 03:11:52PM -0700, Florian Fainelli wrote: slave_dev->needed_headroom += master->needed_headroom; slave_dev->needed_tailroom += master->needed_tailroom; Not positive you need that because you may be account

Re: [RFC PATCH 02/13] net: dsa: implement a central TX reallocation procedure

2020-10-17 Thread Vladimir Oltean
On Sun, Oct 18, 2020 at 01:31:20AM +0300, Vladimir Oltean wrote: > On Sun, Oct 18, 2020 at 01:01:04AM +0300, Vladimir Oltean wrote: > > > + return pskb_expand_head(skb, headroom, tailroom, GFP_ATOMIC); > > ~ > > err = pskb_expand_h

Re: [RFC PATCH 02/13] net: dsa: implement a central TX reallocation procedure

2020-10-17 Thread Vladimir Oltean
On Sun, Oct 18, 2020 at 01:01:04AM +0300, Vladimir Oltean wrote: > > + return pskb_expand_head(skb, headroom, tailroom, GFP_ATOMIC); > ~ > err = pskb_expand_head(skb, headroom, tailroom, GFP_ATOMIC); > if (err < 0 || !p

Re: [RFC PATCH 02/13] net: dsa: implement a central TX reallocation procedure

2020-10-17 Thread Vladimir Oltean
On Sat, Oct 17, 2020 at 03:11:52PM -0700, Florian Fainelli wrote: > > slave_dev->needed_headroom += master->needed_headroom; > > slave_dev->needed_tailroom += master->needed_tailroom; > > Not positive you need that because you may be account for more head or tail > room than necessary. >

Re: [RFC PATCH 02/13] net: dsa: implement a central TX reallocation procedure

2020-10-17 Thread Florian Fainelli
On 10/17/2020 3:01 PM, Vladimir Oltean wrote: On Sun, Oct 18, 2020 at 12:36:00AM +0300, Vladimir Oltean wrote: diff --git a/net/dsa/slave.c b/net/dsa/slave.c index d4326940233c..790f5c8deb13 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -548,6 +548,36 @@ netdev_tx_t dsa_enqueue_skb(st

Re: [RFC PATCH 02/13] net: dsa: implement a central TX reallocation procedure

2020-10-17 Thread Vladimir Oltean
On Sun, Oct 18, 2020 at 12:36:00AM +0300, Vladimir Oltean wrote: > diff --git a/net/dsa/slave.c b/net/dsa/slave.c > index d4326940233c..790f5c8deb13 100644 > --- a/net/dsa/slave.c > +++ b/net/dsa/slave.c > @@ -548,6 +548,36 @@ netdev_tx_t dsa_enqueue_skb(struct sk_buff *skb, struct > net_device *d

[RFC PATCH 02/13] net: dsa: implement a central TX reallocation procedure

2020-10-17 Thread Vladimir Oltean
At the moment, taggers are left with the task of ensuring that the skb headers are writable (which they aren't, if the frames were cloned for TX timestamping, for flooding by the bridge, etc), and that there is enough space in the skb data area for the DSA tag to be pushed. Moreover, the life of t