Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1612898rdh; Fri, 27 Oct 2023 23:39:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEjkeDvJKuzgsYmpv7MLzPAOXvyrixMu0QmZYi81fOQlEB9MwX25jb7LnQVSemp2e4gMivo X-Received: by 2002:a05:6808:1293:b0:3b0:daf8:954 with SMTP id a19-20020a056808129300b003b0daf80954mr6853440oiw.49.1698475189949; Fri, 27 Oct 2023 23:39:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698475189; cv=none; d=google.com; s=arc-20160816; b=s6s9lHj32s7eFm1cHWbC1QKN9UkewknKAHOM8funDmmf0ECkZ7iU9IaYkRWj9YflPe ZxU3afKIChlTbEKgWzwxphvT9vH4Wv3bDkmVWw4902ngZPITXN/OGm76pyW/ct8TIYwy 3U7IiwQL3u6h8d6eMa+0zqlddz7alIILkZ/ja7ARmoiYG9672DFU5u4UlpHJWIECrG0c 3R5/Ber9qaUx9r+VhXCnsynEuGcmG38DBxqNgtbjNfyNGakWIq/UDg8/oGE/w+FgS5QO nRfI5tYQ6Hu+6FY3iXtF75C4xdPxL5F0kKP5uF3HskRM9RAjmTx4DiKClRb6ZryVv90e jwkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=ucrk3yN1o7TQPhSd2Ft6KHBw2aa58ppJ6EW1ojBgNy8=; fh=O+fi8wPgTXn29A38JzX/UzHeqlNGybohmyJKLZn7FFM=; b=k5HRIfPaAnMKMbPMiUeCn22e0eg7JyoIRW2P6/noyJcwIAH5Kfyhu2NIhOHodAscG+ GZyrRA21Q9BO8GOwxWez6X1YS/IzRcb28/ClxQMGqGMSbvk6czG/EE7Ds0tYCTy9vH72 ewJ775B6Ksin0Nygh64FzSnk6GkAlEBBJIvJfAnQoykkFK3oPlZMgczKpTrFc7tCvyl7 uLxW1QNroM6oQAvAZm5AnAfN3I1xoPfLsamsqh4YP7twSc0iIqM/bS+KAFweeZ1cg6dz E4Np7fKB7nGQvxyf9JootL4/4KSESzlFmMzj4cEE9y8UQSir6Si4iNilR0sjH3VoJAHx N2Eg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id z9-20020aa78889000000b006be3ce60e4csi2099806pfe.369.2023.10.27.23.39.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 23:39:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id D1DCE8097A5C; Fri, 27 Oct 2023 23:39:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229484AbjJ1Gi6 convert rfc822-to-8bit (ORCPT + 99 others); Sat, 28 Oct 2023 02:38:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229458AbjJ1Gi5 (ORCPT ); Sat, 28 Oct 2023 02:38:57 -0400 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.86.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2927AAB for ; Fri, 27 Oct 2023 23:38:53 -0700 (PDT) Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-53-WxaLHLu_OZ2prnQx6wMy0Q-1; Sat, 28 Oct 2023 07:38:49 +0100 X-MC-Unique: WxaLHLu_OZ2prnQx6wMy0Q-1 Received: from AcuMS.Aculab.com (10.202.163.4) by AcuMS.aculab.com (10.202.163.4) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Sat, 28 Oct 2023 07:38:52 +0100 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Sat, 28 Oct 2023 07:38:52 +0100 From: David Laight To: 'Shinas Rasheed' , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: "hgani@marvell.com" , "vimleshk@marvell.com" , "egallen@redhat.com" , "mschmidt@redhat.com" , "pabeni@redhat.com" , "horms@kernel.org" , "kuba@kernel.org" , "davem@davemloft.net" , "wizhao@redhat.com" , "konguyen@redhat.com" , Veerasenareddy Burru , "Sathesh Edara" , Eric Dumazet Subject: RE: [PATCH net-next v2 3/4] octeon_ep: implement xmit_more in transmit Thread-Topic: [PATCH net-next v2 3/4] octeon_ep: implement xmit_more in transmit Thread-Index: AQHaBomkOels9gSWWE2IVlse9GkwiLBevpOA Date: Sat, 28 Oct 2023 06:38:51 +0000 Message-ID: <0fc50b8e6ff44c43b10481da608c95c3@AcuMS.aculab.com> References: <20231024145119.2366588-1-srasheed@marvell.com> <20231024145119.2366588-4-srasheed@marvell.com> In-Reply-To: <20231024145119.2366588-4-srasheed@marvell.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, 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 pete.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 (pete.vger.email [0.0.0.0]); Fri, 27 Oct 2023 23:39:07 -0700 (PDT) From: Shinas Rasheed > Sent: 24 October 2023 15:51 > > Add xmit_more handling in tx datapath for octeon_ep pf. > ... > - > - /* 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; Does that really need the count? A 'doorbell' register usually just tells the MAC engine to go and look at the transmit ring. It then continues to process transmits until it fails to find a packet. So if the transmit is active you don't need to set the bit. (Although that is actually rather hard to detect.) The 'xmit_more' flag is useful if (the equivalent of) writing the doorbell register is expensive since it can be delayed to a later frame and only done once - adding a slight latency to the earlier transmits if the mac engine was idle. I'm not sure how much (if any) performance gain you actually get from avoiding the writel(). Single PCIe writes are 'posted' and pretty much completely asynchronous. The other problem I've seen is that netdev_xmit_more() is the state of the queue when the transmit was started, not the current state. If a packet is added while the earlier transmit setup code is running (setting up the descriptors etc) the it isn't set. So the fast path doesn't get taken. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)