Re: [PATCH 1/3] net: macb: fix random memory corruption on RX with 64-bit DMA

2018-12-06 Thread Claudiu.Beznea
On 05.12.2018 22:32, David Miller wrote: > From: Anssi Hannula > Date: Fri, 30 Nov 2018 20:21:35 +0200 > >> @@ -682,6 +682,11 @@ static void macb_set_addr(struct macb *bp, struct >> macb_dma_desc *desc, dma_addr_ >> if (bp->hw_dma_cap & HW_DMA_CAP_64B) { >> desc_64 =

Re: [PATCH 3/3] net: macb: add missing barriers when reading buffers

2018-12-06 Thread Claudiu.Beznea
Hi Anssi, On 05.12.2018 16:00, Anssi Hannula wrote: > On 5.12.2018 14:37, claudiu.bez...@microchip.com wrote: >> >> On 30.11.2018 20:21, Anssi Hannula wrote: >>> When reading buffer descriptors on RX or on TX completion, an >>> RX_USED/TX_USED bit is checked first to ensure that the descriptor

Re: [PATCH 2/3] net: macb: fix dropped RX frames due to a race

2018-12-05 Thread Claudiu.Beznea
On 30.11.2018 20:21, Anssi Hannula wrote: > Bit RX_USED set to 0 in the address field allows the controller to write > data to the receive buffer descriptor. > > The driver does not ensure the ctrl field is ready (cleared) when the > controller sees the RX_USED=0 written by the driver. The ctrl

Re: [PATCH 3/3] net: macb: add missing barriers when reading buffers

2018-12-05 Thread Claudiu.Beznea
On 30.11.2018 20:21, Anssi Hannula wrote: > When reading buffer descriptors on RX or on TX completion, an > RX_USED/TX_USED bit is checked first to ensure that the descriptor has > been populated. However, there are no memory barriers to ensure that the > data protected by the RX_USED/TX_USED

Re: [PATCH 1/3] net: macb: fix random memory corruption on RX with 64-bit DMA

2018-12-05 Thread Claudiu.Beznea
Hi Anssi, Few comments... Otherwise I tested this series on a SAMA5D2 Xplained and SAMA5D4 Xplained under heavy traffic and it seems to behave OK. Thank you, Claudiu Beznea On 30.11.2018 20:21, Anssi Hannula wrote: > 64-bit DMA addresses are split in upper and lower halves that are > written in

Re: [PATCH net] net: ethernet: cadence: fix socket buffer corruption problem

2018-10-31 Thread Claudiu.Beznea
On 30.10.2018 21:36, Tristram Ha - C24268 wrote: >> Could you check on your side that applying this on top of your patch, your >> scenario is still working? >> >> diff --git a/drivers/net/ethernet/cadence/macb_main.c >> b/drivers/net/ethernet/cadence/macb_main.c >> index

Re: [PATCH net] net: ethernet: cadence: fix socket buffer corruption problem

2018-10-30 Thread Claudiu.Beznea
On 29.10.2018 23:40, Tristram Ha - C24268 wrote: >> Could you, please, tell me if the above variable was false in your case? >> >> bool cloned = skb_cloned(*skb) || skb_header_cloned(*skb); >> >> If yes, then, the proper fix would be as follows: >> >> diff --git

Re: [PATCH net] net: ethernet: cadence: fix socket buffer corruption problem

2018-10-29 Thread Claudiu.Beznea
Hi Tristram, Could you, please, tell me if the above variable was false in your case? bool cloned = skb_cloned(*skb) || skb_header_cloned(*skb); If yes, then, the proper fix would be as follows: diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c