Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2232184rda; Tue, 24 Oct 2023 17:22:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHJylMgTfaWg6azLCMDKQx5mzBfMNdOMY9bRN+WvXiodyfOE+OWVkusN2rY/2NAWP2Dxt3/ X-Received: by 2002:a05:6358:6a46:b0:168:de6b:6c70 with SMTP id c6-20020a0563586a4600b00168de6b6c70mr7100024rwh.1.1698193333280; Tue, 24 Oct 2023 17:22:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698193333; cv=none; d=google.com; s=arc-20160816; b=xV2W4zE5+3gux7AVqVtsKaWlv+nGHf6ThYU46lxKirW+GEg8Dr+wM+7PrBYamgWhhA NsY8QnD4XhOxgVkknMDNB0x8nVvTHwnSMiqi95pdXZgXdhlhO4ryZ5ZkRe076TMIVoVe GL86XzDYpNQ1Q2lNzZxbMhRJ74GBgeMhFdbFjAXBMNxa4NF1+bYfOkEqVAHY8nZibeO4 58Mp8dGty9AeVMToEHAPwaHjO9blAKbIo8WOqt4xUoAtlDu8rEPxw1r9zw904emQZ9Qn v6bjSwCbKAkpAfQQAu8RH1LKv1UlbIhvDSplIg7iUMeaBmDDEa6uHZC8Jn0D1joIrgpB FaZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=l7+7JPbWJBmXiAX6IeL4DKrP3zgx+/x+cKnHB/M6WE0=; fh=MnYeU5i6JdkG/BhI3IOUy7jGUVbMOVpMbbG/yJOWlwY=; b=zWgKYxpLQDcpcnkGF/SwdYNPVctDZAmPP5fPVDJB6usqKc/yS3HS3CKLg19/fbJtU/ FJHnVtnBN96ox+GtwrOdSuVPCIr7verqcqmF4cGk6/kp26QmvvUr794uSwhmp7ZbwNOe lX42otMsdvO5KrsG8jgSsHI+6TwB09P2EeoMxT4jy09Yqakg+3eC9j77ndyEsiSgSf7m 4ccvaZJx0YOidRfFL7Wkm6aFl63AGWLvTyu0OtuGcp3tPGrb5T9KmCurWbUvT4Kse/E/ 6GlmgDq/T1f7F07vxlTTzlnPIOiwA4qW+T5ShhR6xXxhaEYOiC6f1hWwOu/uD88gvMaA YUsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NjxOhjtw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id ca27-20020a056a02069b00b0058bfcc0f4b7si9676794pgb.473.2023.10.24.17.22.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 17:22:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NjxOhjtw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id C20AD8025AC3; Tue, 24 Oct 2023 17:22:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344725AbjJYAV7 (ORCPT + 99 others); Tue, 24 Oct 2023 20:21:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344722AbjJYAV6 (ORCPT ); Tue, 24 Oct 2023 20:21:58 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1809C118 for ; Tue, 24 Oct 2023 17:21:53 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25CEFC433C7; Wed, 25 Oct 2023 00:21:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698193312; bh=bSb6lFJWhOO+xj/NDMEeOkBFoXydyY6bxf7XMv2ArVg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=NjxOhjtwoKdQ3UgCoeY/58mRDR40YFwMjdJFTvXp8v3ZwzkpUSTo3371ZEgcQ/MD3 g7fVYkajpSDQK9il3+2Lv3bO6Bc5iNUZs/joAZY/06zhS/nXgqb2vHQBhbCPRFhjsi BYNPM6nexCdjqmwlTY7cgBU2h9SzEu6MwpHfpmR0/T2HMGRpzUQnsw0NQhxaBnnN7L 2xq/yXV+N35C6I7d6ZwT3Od/hqLfZRB1Sum41gCz8uN6o5ZpuOF1xthJVkOmhObt2/ XaEhON5dyV4l9JSxY97k0wrGNZdnvsak4F8KCa4AsR6IrX5jrJjmiTVgoG8NQwdzgz a+mUugyhSxphA== Date: Tue, 24 Oct 2023 17:21:51 -0700 From: Jakub Kicinski To: Shinas Rasheed Cc: , , , , , , , , , , , "Veerasenareddy Burru" , Sathesh Edara , Eric Dumazet Subject: Re: [PATCH net-next v2 3/4] octeon_ep: implement xmit_more in transmit Message-ID: <20231024172151.5fd1b29a@kernel.org> In-Reply-To: <20231024145119.2366588-4-srasheed@marvell.com> References: <20231024145119.2366588-1-srasheed@marvell.com> <20231024145119.2366588-4-srasheed@marvell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 24 Oct 2023 17:22:11 -0700 (PDT) On Tue, 24 Oct 2023 07:51:18 -0700 Shinas Rasheed wrote: > iq->host_write_index = wi; > + if (xmit_more && > + (atomic_read(&iq->instr_pending) < > + (iq->max_count - OCTEP_WAKE_QUEUE_THRESHOLD)) && > + iq->fill_cnt < iq->fill_threshold) > + return NETDEV_TX_OK; Does this guarantee that a full-sized skb can be accommodated? If so - consider stopping stopping the queue when the condition is not true. The recommended way of implementing 'driver flow control' is to stop the queue once next packet may not fit, and then use netif_xmit_stopped() when deciding whether we need to flush or we can trust xmit_more. see https://www.kernel.org/doc/html/next/networking/driver.html#transmit-path-guidelines > /* Flush the hw descriptor before writing to doorbell */ > wmb(); > - > - /* Ring Doorbell to notify the NIC there is a new packet */ > - writel(1, iq->doorbell_reg); > - iq->stats.instr_posted++; > + /* Ring Doorbell to notify the NIC of new packets */ > + writel(iq->fill_cnt, iq->doorbell_reg); > + iq->stats.instr_posted += iq->fill_cnt; > + iq->fill_cnt = 0; > return NETDEV_TX_OK;