From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EDA18C433ED for ; Wed, 12 May 2021 07:53:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C0D26613BA for ; Wed, 12 May 2021 07:53:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230196AbhELHzB (ORCPT ); Wed, 12 May 2021 03:55:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229850AbhELHy6 (ORCPT ); Wed, 12 May 2021 03:54:58 -0400 Received: from plekste.mt.lv (bute.mt.lv [IPv6:2a02:610:7501:2000::195]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5454BC061574; Wed, 12 May 2021 00:53:51 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=bute.mt.lv) by plekste.mt.lv with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1lgjgX-0000nY-BE; Wed, 12 May 2021 10:53:37 +0300 MIME-Version: 1.0 Date: Wed, 12 May 2021 10:53:37 +0300 From: Gatis Peisenieks To: Eric Dumazet Cc: chris.snook@gmail.com, davem@davemloft.net, kuba@kernel.org, hkallweit1@gmail.com, jesse.brandeburg@intel.com, dchickles@marvell.com, tully@mikrotik.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next 2/4] atl1c: improve performance by avoiding unnecessary pcie writes on xmit In-Reply-To: <217ba8c9-ab09-46be-3e49-149f810e72fd@gmail.com> References: <20210511190518.8901-1-gatis@mikrotik.com> <20210511190518.8901-3-gatis@mikrotik.com> <217ba8c9-ab09-46be-3e49-149f810e72fd@gmail.com> User-Agent: Roundcube Webmail/1.4.11 Message-ID: X-Sender: gatis@mikrotik.com Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-05-12 00:39, Eric Dumazet wrote: >> @@ -2270,8 +2272,11 @@ static netdev_tx_t atl1c_xmit_frame(struct >> sk_buff *skb, >> atl1c_tx_rollback(adapter, tpd, type); >> dev_kfree_skb_any(skb); >> } else { >> - netdev_sent_queue(adapter->netdev, skb->len); >> - atl1c_tx_queue(adapter, skb, tpd, type); >> + bool more = netdev_xmit_more(); >> + >> + __netdev_sent_queue(adapter->netdev, skb->len, more); > > > This is probably buggy. > > You must check and use the return code of this function, > as in : > > bool door_bell = __netdev_sent_queue(adapter->netdev, skb->len, > netdev_xmit_more()); > > if (door_bell) > atl1c_tx_queue(adapter, type); > Eric, thank you for taking your time to look at this! You are correct, tx queue can get stopped in __netdev_sent_queue and if there were more packets coming the submit to HW would be missed / unnecessarily delayed. > >> + if (!more) >> + atl1c_tx_queue(adapter, type); >> } >> >> return NETDEV_TX_OK; >>