Re: [PATCH net] net: dsa: ksz: fix padding size of skb

2020-10-16 Thread Jakub Kicinski
On Fri, 16 Oct 2020 21:13:19 +0300 Vladimir Oltean wrote: > On Fri, Oct 16, 2020 at 11:03:11AM -0700, Jakub Kicinski wrote: > > On Fri, 16 Oct 2020 18:56:45 +0300 Vladimir Oltean wrote: > > > > 3. "Manually" unsharing in dsa_slave_xmit(), reserving enough tailroom > > > > for the tail tag (and

Re: [PATCH net] net: dsa: ksz: fix padding size of skb

2020-10-16 Thread Vladimir Oltean
On Fri, Oct 16, 2020 at 11:03:11AM -0700, Jakub Kicinski wrote: > On Fri, 16 Oct 2020 18:56:45 +0300 Vladimir Oltean wrote: > > > 3. "Manually" unsharing in dsa_slave_xmit(), reserving enough tailroom > > > for the tail tag (and ETH_ZLEN?). Would moving the "else" clause from > > >

Re: [PATCH net] net: dsa: ksz: fix padding size of skb

2020-10-16 Thread Jakub Kicinski
On Fri, 16 Oct 2020 18:56:45 +0300 Vladimir Oltean wrote: > > 3. "Manually" unsharing in dsa_slave_xmit(), reserving enough tailroom > > for the tail tag (and ETH_ZLEN?). Would moving the "else" clause from > > ksz_common_xmit() to dsa_slave_xmit() do the job correctly? > > I was thinking

Re: [PATCH net] net: dsa: ksz: fix padding size of skb

2020-10-16 Thread Vladimir Oltean
On Fri, Oct 16, 2020 at 02:44:46PM +0200, Christian Eggers wrote: > Machine: > - ARMv7 (i.MX6ULL), SMP_CACHE_BYTES is 64 > - DSA device: Microchip KSZ9563 (I am currently working on time stamping > support) I have a board very similar to this on which I am going to test. > Last, CONFIG_SLOB

Re: [PATCH net] net: dsa: ksz: fix padding size of skb

2020-10-16 Thread Christian Eggers
On Friday, 16 October 2020, 11:05:27 CEST, Vladimir Oltean wrote: > On Fri, Oct 16, 2020 at 11:00:20AM +0200, Christian Eggers wrote: > > On Friday, 16 October 2020, 09:45:42 CEST, Kurt Kanzenbach wrote: > > > Hmm. I've never observed any problems using DSA with L2 PTP time > > > stamping with

Re: [PATCH net] net: dsa: ksz: fix padding size of skb

2020-10-16 Thread Vladimir Oltean
On Fri, Oct 16, 2020 at 11:00:20AM +0200, Christian Eggers wrote: > On Friday, 16 October 2020, 09:45:42 CEST, Kurt Kanzenbach wrote: > > On Thu Oct 15 2020, Christian Eggers wrote: > > > On Wednesday, 14 October 2020, 19:31:03 CEST, Vladimir Oltean wrote: > > >> What problem are you actually

Re: [PATCH net] net: dsa: ksz: fix padding size of skb

2020-10-16 Thread Christian Eggers
On Friday, 16 October 2020, 09:45:42 CEST, Kurt Kanzenbach wrote: > On Thu Oct 15 2020, Christian Eggers wrote: > > On Wednesday, 14 October 2020, 19:31:03 CEST, Vladimir Oltean wrote: > >> What problem are you actually trying to solve? > > > > After (hopefully) understanding the important bits,

Re: [PATCH net] net: dsa: ksz: fix padding size of skb

2020-10-16 Thread Kurt Kanzenbach
On Thu Oct 15 2020, Christian Eggers wrote: > On Wednesday, 14 October 2020, 19:31:03 CEST, Vladimir Oltean wrote: >> What problem are you actually trying to solve? > After (hopefully) understanding the important bits, I would like to solve the > problem that after calling __skb_put_padto() there

Re: [PATCH net] net: dsa: ksz: fix padding size of skb

2020-10-15 Thread Christian Eggers
Hi Vladimir, sorry for the delay, getting answers to all you questions seems to be challenging for me. Unfortunately it's about 1 year ago when I was originally working on this particular problem and obviously I didn't understand the full problem... On Wednesday, 14 October 2020, 19:31:03

Re: [PATCH net] net: dsa: ksz: fix padding size of skb

2020-10-14 Thread Vladimir Oltean
On Wed, Oct 14, 2020 at 07:02:13PM +0200, Christian Eggers wrote: > > Otherwise said, the frame must be padded to > > max(skb->len, ETH_ZLEN) + tail tag length. > At first I thought the same when working on this. But IMHO the padding must > only ensure the minimum required size, there is no need

Re: [PATCH net] net: dsa: ksz: fix padding size of skb

2020-10-14 Thread Christian Eggers
Hi Vladimir, On Wednesday, 14 October 2020, 18:54:10 CEST, Vladimir Oltean wrote: > On Wed, Oct 14, 2020 at 07:47:50PM +0300, Vladimir Oltean wrote: > > On Wed, Oct 14, 2020 at 06:17:19PM +0200, Christian Eggers wrote: > > > __skb_put_padto() is called in order to ensure a minimal size of the > >

Re: [PATCH net] net: dsa: ksz: fix padding size of skb

2020-10-14 Thread Vladimir Oltean
On Wed, Oct 14, 2020 at 07:47:50PM +0300, Vladimir Oltean wrote: > On Wed, Oct 14, 2020 at 06:17:19PM +0200, Christian Eggers wrote: > > __skb_put_padto() is called in order to ensure a minimal size of the > > sk_buff. The required minimal size is ETH_ZLEN + the size required for > > the tail tag.

Re: [PATCH net] net: dsa: ksz: fix padding size of skb

2020-10-14 Thread Vladimir Oltean
On Wed, Oct 14, 2020 at 06:17:19PM +0200, Christian Eggers wrote: > __skb_put_padto() is called in order to ensure a minimal size of the > sk_buff. The required minimal size is ETH_ZLEN + the size required for > the tail tag. > > The current argument misses the size for the tail tag. The

[PATCH net] net: dsa: ksz: fix padding size of skb

2020-10-14 Thread Christian Eggers
__skb_put_padto() is called in order to ensure a minimal size of the sk_buff. The required minimal size is ETH_ZLEN + the size required for the tail tag. The current argument misses the size for the tail tag. The expression "skb->len + padlen" can be simplified to ETH_ZLEN. Too small sk_buffs