From mboxrd@z Thu Jan 1 00:00:00 1970 From: Harini Katakam Subject: Re: [PATCH 2/3] net: macb: fix dropped RX frames due to a race Date: Mon, 3 Dec 2018 10:22:56 +0530 Message-ID: References: <20181130182137.27974-1-anssi.hannula@bitwise.fi> <20181130182137.27974-3-anssi.hannula@bitwise.fi> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Cc: Nicolas Ferre , David Miller , netdev@vger.kernel.org To: anssi.hannula@bitwise.fi Return-path: Received: from mail-ot1-f53.google.com ([209.85.210.53]:46318 "EHLO mail-ot1-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725790AbeLCExJ (ORCPT ); Sun, 2 Dec 2018 23:53:09 -0500 Received: by mail-ot1-f53.google.com with SMTP id w25so10389159otm.13 for ; Sun, 02 Dec 2018 20:53:07 -0800 (PST) In-Reply-To: <20181130182137.27974-3-anssi.hannula@bitwise.fi> Sender: netdev-owner@vger.kernel.org List-ID: Hi Anssi, On Fri, Nov 30, 2018 at 11:53 PM 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 field might > only be cleared after the controller has already updated it according to > a newly received frame, causing the frame to be discarded in gem_rx() due > to unexpected ctrl field contents. > > A message is logged when the above scenario occurs: > > macb ff0b0000.ethernet eth0: not whole frame pointed by descriptor > > Fix the issue by ensuring that when the controller sees RX_USED=0 the > ctrl field is already cleared. > > This issue was observed on a ZynqMP based system. > Thanks for the patch. Could you please describe the test in which this behavior was observed? Were you able to confirm that this was because of the ctrl field being cleared late? This error can also be observed under stress when RX UBR is observed. I understand it makes sense to clear ctrl field before setting RX used bit. But I'm trying to understand if a dmb is necessary in the receive data path. Regards, Harini