Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1897514rwb; Fri, 28 Jul 2023 17:37:42 -0700 (PDT) X-Google-Smtp-Source: APBJJlH9E7qju1bmNJx17GaBAlc35ke1vhYxhzY2nXMXh5cU2UdwseeaZwylPB3TSTtR5RifENYM X-Received: by 2002:a17:907:78d3:b0:991:e7c2:d0be with SMTP id kv19-20020a17090778d300b00991e7c2d0bemr835029ejc.63.1690591062469; Fri, 28 Jul 2023 17:37:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690591062; cv=none; d=google.com; s=arc-20160816; b=H2P9KafTQ9Q2qAvpuBMcdjIkb2VqNBrudXho5wXHTgeEUAQfzjSBJ+dwsIaAV9heqr 9WzoZx3ERdurrPd/epC/lb5LbtTWOCG8ibOFlCaqJZe/rR5gznchuvZywvq8vQIsMO0E tEY1zCaM885UGffKZpL/SdghduW/l8t+HR22C1NdF2jk4G0Ynanih1YTqIV5mQWYoNg+ 2dvJ5+QuPoFylrnz6hsuvwIOZJoXWg00K1MnIohBWsBs425m2KjBnOyqtj9sb9FJfzKb 5j/ImfyBdEgxpGjyHZkp7D6qqB/N3hh/eZ4cg0FlFpvPlIqENyWBMkROobs91Fg+LJiO OvnQ== 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=kxpqOz9/sQxfgZL0NKE7jAQ/RVq/huK0woTwycPkV1I=; fh=gz4ObIMc4NeQCHdZ3rWVwlgFHb+bHuhROoav4WyE1M4=; b=GZFPFqpe7+e+R2qRW9yKI+WAuyQcTtu0R2eghkXgl1CuuTdPkXeCCCbm1AwgCiz9h3 HOiwUHf4RO3ngMOAj5T0hxbr4DYEKMlOhM0uiA4KUFkkdOi+9azvuXhHSuYqvPg2RLb+ 2nZf31lTn8jhWp38QdzYT2QQMM65WKYw9pAjUvaaQezPCFM81v5qrjXXYIXfbJYQ+HDL yApFvj9cuFGvjRI9hVzzVMXrDe1cBJxmupjRiH2vNAJoS7KetUZzBAmvUaHt41/ia62j 2bdTr5tfa6Pqh5MLHduXDKrKWYxiIk/+3sDyWAz0tpoT6pp9KnH9l/vKqeOd0vFKEq8W s1ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=k8ANMUwV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s11-20020a170906a18b00b009930e13a56fsi3414256ejy.346.2023.07.28.17.37.16; Fri, 28 Jul 2023 17:37:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=k8ANMUwV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234826AbjG2AYZ (ORCPT + 99 others); Fri, 28 Jul 2023 20:24:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235937AbjG2AYX (ORCPT ); Fri, 28 Jul 2023 20:24:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF6762680; Fri, 28 Jul 2023 17:24:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5DF5262219; Sat, 29 Jul 2023 00:24:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 221CAC433C7; Sat, 29 Jul 2023 00:24:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690590260; bh=LcvjFZ5wQlT1R6n8uisvWwenXjdvtew/LYTUALvrObc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=k8ANMUwVHZyTxyGa3n7sz2LHzbUGdyjNE/J3IJLU9ml/Zqn6ToTj3nqSMmnWv86HE ljVs22Qb90Bw9NXXmPFj9pNMI0mq0ESXP12HP1NQUg4oNm0oy2FQE11CB0NBNUd0G+ OewanG+lTJsH17XqdIOPY6NDhrNj+/bVoLB85cpAdgD1AUB923nedsJMnJtEMBykQS vBKZA7MRLDZpu0nFrKX+91j2/g7V7BH+5Zc5MjXXDr7PLLHcemQwj9NdSemoFJUeOf bNGaOXZewZpKb7A4Mupld1931Itsmi/3gwfgRyJlZkoHY1y7tmMWkfVBXjBJ/f5kgi Bg9wqklNDEBrQ== Date: Fri, 28 Jul 2023 17:24:19 -0700 From: Jakub Kicinski To: MD Danish Anwar Cc: Randy Dunlap , Roger Quadros , Simon Horman , Vignesh Raghavendra , Andrew Lunn , Richard Cochran , Conor Dooley , Krzysztof Kozlowski , Rob Herring , Paolo Abeni , Eric Dumazet , "David S. Miller" , , , , , , , Subject: Re: [PATCH v12 06/10] net: ti: icssg-prueth: Add ICSSG ethernet driver Message-ID: <20230728172419.702b4ac0@kernel.org> In-Reply-To: <20230727112827.3977534-7-danishanwar@ti.com> References: <20230727112827.3977534-1-danishanwar@ti.com> <20230727112827.3977534-7-danishanwar@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 27 Jul 2023 16:58:23 +0530 MD Danish Anwar wrote: > +static int emac_tx_complete_packets(struct prueth_emac *emac, int chn, > + int budget) > +{ > + struct net_device *ndev = emac->ndev; > + struct cppi5_host_desc_t *desc_tx; > + struct netdev_queue *netif_txq; > + struct prueth_tx_chn *tx_chn; > + unsigned int total_bytes = 0; > + struct sk_buff *skb; > + dma_addr_t desc_dma; > + int res, num_tx = 0; > + void **swdata; > + > + tx_chn = &emac->tx_chns[chn]; > + > + while (budget) { > + res = k3_udma_glue_pop_tx_chn(tx_chn->tx_chn, &desc_dma); > + if (res == -ENODATA) > + break; You shouldn't limit the number of serviced packets to budget for Tx NAPI. https://docs.kernel.org/next/networking/napi.html#driver-api > + skb->dev = ndev; > + if (!netif_running(skb->dev)) { > + dev_kfree_skb_any(skb); > + return 0; > + } why do you check if the interface is running? If a packet arrives, it means the interface is running.. > +drop_free_descs: > + prueth_xmit_free(tx_chn, first_desc); > +drop_stop_q: > + netif_tx_stop_queue(netif_txq); Do not stop the queue on DMA errors. If the queue is empty nothing will wake it up. Queue should only be stopped based on occupancy. > + dev_kfree_skb_any(skb); > + > + /* error */ > + ndev->stats.tx_dropped++; > + netdev_err(ndev, "tx: error: %d\n", ret); > + > + return ret; -- pw-bot: cr