Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2635476iob; Mon, 16 May 2022 02:43:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZDqfdG9VtG24vm0/gbfSXL2jmU116U1s9cbiXSDdUyVL67Ow3lGxqASkh6aMcrScriDl2 X-Received: by 2002:a05:6402:f13:b0:428:a849:d0c1 with SMTP id i19-20020a0564020f1300b00428a849d0c1mr12199266eda.346.1652694206076; Mon, 16 May 2022 02:43:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652694206; cv=none; d=google.com; s=arc-20160816; b=opDJC6RmpYd+7TM7uZ2Djb6/V+hXaFxaQZUgCfDjI729FUAb5Y7XTsNpPECRNLvpcO 1E7f3+R14QSAbnxOHJCmD6cFePSBVWF2pU/9YlaGcZCkcND/kLBYC4+7hJ776Alt5Kwr Uvhj0k4ySpcGvL+fMNKQxA4AOT/iMNYt2qZGSkc6l99iLQZpwI+SMCCbCH2HTH1wJeS9 SsHS84ZjI0QONlqzlPGtS8CuuZK5DCJhC7oCWVsOUV++3csyxo897W2Wm2o/4QVEKy1R IBJbGAwmzHNcBXY1mrELT/BzVSLQ8hGUAJgTcMEuZgyD7HNle0iIe5lT56nD8GZiRDKQ ThBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=aeIiodYHNThScuod1GW5LkC5SMWKdFNGndzQilLs9lY=; b=TF4H6SRe1TjcnOFBLlcSieyK/JYTtmMZyg3/QNPI0o/AXrZ7OeR9d/0y+Kld24NoSl Y5xuLTfVTlDlbtXcR/MDhoSUSIFB1bwOmr/TSEUtK+IF/lIuaq5yNK8Fa0W1qgqqw14c /HZECClC04k+BlyyczBXLpcSDWOsxeLWkCqJ/q6ItMz+bg4KFXO94KERWOGwdGWnFRnX bDMsaanLBIV7zEcry06Ayp6KL/VTTOezUMd7VuYNUUb5r0HopBoWVgS6/Y0pNhIjEia3 s2SwumIuv+ZAIMTRkyZiTNBkaXkffkZVRZkUhpslJI67H7TUz2bSbd8IpWajBSzw3g2D /ptA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=DBFHslQ4; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qh3-20020a170906eca300b006df76385d68si9785798ejb.520.2022.05.16.02.43.00; Mon, 16 May 2022 02:43:26 -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=@lunn.ch header.s=20171124 header.b=DBFHslQ4; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239484AbiEPCvT (ORCPT + 99 others); Sun, 15 May 2022 22:51:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239483AbiEPCvO (ORCPT ); Sun, 15 May 2022 22:51:14 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [185.16.172.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB55FCE39; Sun, 15 May 2022 19:51:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=aeIiodYHNThScuod1GW5LkC5SMWKdFNGndzQilLs9lY=; b=DBFHslQ4kVTac7kIIocJyO0sUs QUZje+acCpNESTHr4kcevQ1jDHf8qkTE/h/8IOI3ay+VcQbxXDAPZsnJosNka2BKONFX4GTJ0+Zbg I/aB5Vd6xe+33jY/J5cuO0jTUc0CfAZyzp7e2huZaPcR9TJgaVDmU6yDn7RTvFdywE8k=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1nqQp5-002wrJ-HM; Mon, 16 May 2022 04:51:03 +0200 Date: Mon, 16 May 2022 04:51:03 +0200 From: Andrew Lunn To: Maxime Chevallier Cc: davem@davemloft.net, Rob Herring , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, thomas.petazzoni@bootlin.com, Florian Fainelli , Heiner Kallweit , Russell King , linux-arm-kernel@lists.infradead.org, Vladimir Oltean , Luka Perkov , Robert Marko Subject: Re: [PATCH net-next v2 1/5] net: ipqess: introduce the Qualcomm IPQESS driver Message-ID: References: <20220514150656.122108-1-maxime.chevallier@bootlin.com> <20220514150656.122108-2-maxime.chevallier@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220514150656.122108-2-maxime.chevallier@bootlin.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,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 > +static int ipqess_tx_ring_alloc(struct ipqess *ess) > +{ > + struct device *dev = &ess->pdev->dev; > + int i; > + > + for (i = 0; i < IPQESS_NETDEV_QUEUES; i++) { > + struct ipqess_tx_ring *tx_ring = &ess->tx_ring[i]; > + size_t size; > + u32 idx; > + > + tx_ring->ess = ess; > + tx_ring->ring_id = i; > + tx_ring->idx = i * 4; > + tx_ring->count = IPQESS_TX_RING_SIZE; > + tx_ring->nq = netdev_get_tx_queue(ess->netdev, i); > + > + size = sizeof(struct ipqess_buf) * IPQESS_TX_RING_SIZE; > + tx_ring->buf = devm_kzalloc(dev, size, GFP_KERNEL); > + if (!tx_ring->buf) { > + netdev_err(ess->netdev, "buffer alloc of tx ring failed"); > + return -ENOMEM; > + } kzalloc() is pretty loud when there is no memory. So you see patches removing such warning messages. > +static int ipqess_rx_napi(struct napi_struct *napi, int budget) > +{ > + struct ipqess_rx_ring *rx_ring = container_of(napi, struct ipqess_rx_ring, > + napi_rx); > + struct ipqess *ess = rx_ring->ess; > + u32 rx_mask = BIT(rx_ring->idx); > + int remain_budget = budget; > + int rx_done; > + u32 status; > + > +poll_again: > + ipqess_w32(ess, IPQESS_REG_RX_ISR, rx_mask); > + rx_done = ipqess_rx_poll(rx_ring, remain_budget); > + > + if (rx_done == remain_budget) > + return budget; > + > + status = ipqess_r32(ess, IPQESS_REG_RX_ISR); > + if (status & rx_mask) { > + remain_budget -= rx_done; > + goto poll_again; > + } Could this be turned into a do while() loop? > +static void ipqess_irq_enable(struct ipqess *ess) > +{ > + int i; > + > + ipqess_w32(ess, IPQESS_REG_RX_ISR, 0xff); > + ipqess_w32(ess, IPQESS_REG_TX_ISR, 0xffff); > + for (i = 0; i < IPQESS_NETDEV_QUEUES; i++) { > + ipqess_w32(ess, IPQESS_REG_RX_INT_MASK_Q(ess->rx_ring[i].idx), 1); > + ipqess_w32(ess, IPQESS_REG_TX_INT_MASK_Q(ess->tx_ring[i].idx), 1); > + } > +} > + > +static void ipqess_irq_disable(struct ipqess *ess) > +{ > + int i; > + > + for (i = 0; i < IPQESS_NETDEV_QUEUES; i++) { > + ipqess_w32(ess, IPQESS_REG_RX_INT_MASK_Q(ess->rx_ring[i].idx), 0); > + ipqess_w32(ess, IPQESS_REG_TX_INT_MASK_Q(ess->tx_ring[i].idx), 0); > + } > +} Enable and disable are not symmetric? > +static inline void ipqess_kick_tx(struct ipqess_tx_ring *tx_ring) No inline functions please in .c files. Let the compiler decide. Andrew