Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3842442ybz; Mon, 4 May 2020 10:42:24 -0700 (PDT) X-Google-Smtp-Source: APiQypJRJCzDpDWaQvQJ4hFP2liOJK63i2hnF26UyFlSh0yHUNUidVMqXKtQFxMDyS1ZAbepm9hI X-Received: by 2002:a05:6402:1d1c:: with SMTP id dg28mr15408190edb.315.1588614144777; Mon, 04 May 2020 10:42:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588614144; cv=none; d=google.com; s=arc-20160816; b=H6CBdVWhbsg0MnOLLRUDMctwdK5nMcwalBbofOBODS+vb3JUQL78A3d8qGlMYHTnFa e6fZg7usbAGVouInde2mU9EVQCA7wKSd3zthf/DMyCvDPVIzQax0FeK1KIb70vxZ9i5X V0ciTJT2W+5skwkh8HX+D78MHB1wqfJccn9Gz6qMBVuoR1kLoPj3JcxwpDO9V67AROlh Xg0BitEz+1paVJuGsUTLjkx14FLeFZTsesBVCkQP7c+M2+L8FIYZkdlmb75ssehOwGz6 /IEdl/sSTkrU6y2uQfTagh/xDWCl/OyCfPlgTr/kypT0AbLhXgrpyINkfsu+kvS1d8dP +9TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=6kTcI33TDcKrYI2ruESGPC2Yxf812/u30JXjXZFEaM8=; b=RMOaOg+MnhF3sVp4CS0d6ystyQi2/nCMKygONjW2enL7byAK9n9/I5IECJpl4Tkuva ncKw1LInAUThX7LPFmVOPmi6iMQ9M8kOPVo8iPop20mYB0r0u+zUB6WACWpSf/lf8xXq vdov78OxK8yu7U4PNks6C/FHKOKe+XWof70bn1DFw+H/9eruOt89kU+IonvUUiTs55ff cT8rpE9W5pFzHRGcW/L96S7Gr9joWcLtosCK7p3ljm/wpbGewZJdGNbbrD+74gnjnyUz T/YRvoz0KwXij+MCyHUZWIUWE2p50bjVoZ/sP94IzUFP7gLmKbFae2Z7dYDt8pgjLjPG vrBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u3si6814083edq.473.2020.05.04.10.41.59; Mon, 04 May 2020 10:42:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730149AbgEDRjk (ORCPT + 99 others); Mon, 4 May 2020 13:39:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729969AbgEDRjj (ORCPT ); Mon, 4 May 2020 13:39:39 -0400 Received: from shards.monkeyblade.net (shards.monkeyblade.net [IPv6:2620:137:e000::1:9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCCA5C061A0E; Mon, 4 May 2020 10:39:37 -0700 (PDT) Received: from localhost (unknown [IPv6:2601:601:9f00:477::3d5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id E3A8F15B52E80; Mon, 4 May 2020 10:39:36 -0700 (PDT) Date: Mon, 04 May 2020 10:39:35 -0700 (PDT) Message-Id: <20200504.103935.1584665284135386530.davem@davemloft.net> To: joyce.ooi@intel.com Cc: thor.thayer@linux.intel.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, dalon.westergreen@intel.com, ley.foon.tan@intel.com, chin.liang.see@intel.com, dinh.nguyen@intel.com Subject: Re: [PATCHv2 01/10] net: eth: altera: tse_start_xmit ignores tx_buffer call response From: David Miller In-Reply-To: <20200504082558.112627-2-joyce.ooi@intel.com> References: <20200504082558.112627-1-joyce.ooi@intel.com> <20200504082558.112627-2-joyce.ooi@intel.com> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Mon, 04 May 2020 10:39:37 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joyce Ooi Date: Mon, 4 May 2020 16:25:49 +0800 > The return from tx_buffer call in tse_start_xmit is > inapropriately ignored. tse_buffer calls should return > 0 for success or NETDEV_TX_BUSY. tse_start_xmit should > return not report a successful transmit when the tse_buffer > call returns an error condition. From driver.txt: ==================== 1) The ndo_start_xmit method must not return NETDEV_TX_BUSY under any normal circumstances. It is considered a hard error unless there is no way your device can tell ahead of time when it's transmit function will become busy. ==================== The problem is that when you return this error code, something has to trigger restarting the transmit queue to start sending packets to your device again. The usual mechanism is waking the transmit queue, but it's obviously already awake since your transmit routine is being called. Therefore nothing will reliably restart the queue when you return this error code. The best thing to do honestly is to drop the packet and return NETDEV_TX_OK, meanwhile bumping a statistic counter to record this event.