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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04CC7EE49A0 for ; Sat, 19 Aug 2023 00:55:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243250AbjHSAye (ORCPT ); Fri, 18 Aug 2023 20:54:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243325AbjHSAxi (ORCPT ); Fri, 18 Aug 2023 20:53:38 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8851448D; Fri, 18 Aug 2023 17:53:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1692406415; x=1723942415; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=TpUo5Edi6QFUhdJVj1ej9UvxlhacliszgVQIhmTKSe0=; b=YRlNur6KXSGvypmwfJ2zXMS6iTLXB1NBHS8LTaohqmxkw44gfp5sUmJ6 UKTwNlt+5C2EDUO5DipwpoGgJoEnJ93zVNbf/yxLdUnUmaG3Lajg6e1/J ft2luc0IjjoPz9Lt8MOB9DvQOa1RONLq4X2T0ixpynFjPIeAdAoNGw1pV Ude2AtVzn5c+GQRWWdX0HM6WWOtz832lMO0RV/J8X7vGzyX/rcTEqEA3r EwZ8GHEYNKs8aasMV51GpQQVODBvmjpEKxiiCcshC9mXe8hGDm6V5Vrgv zc7T18Nz9ml6e4X20ik51XxPPv7HcZ/S39fw+2e1sfqGGli9i46m2mWi8 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10806"; a="373209892" X-IronPort-AV: E=Sophos;i="6.01,184,1684825200"; d="scan'208";a="373209892" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Aug 2023 17:53:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10806"; a="770311176" X-IronPort-AV: E=Sophos;i="6.01,184,1684825200"; d="scan'208";a="770311176" Received: from pglc00067.png.intel.com ([10.221.207.87]) by orsmga001.jf.intel.com with ESMTP; 18 Aug 2023 17:53:29 -0700 From: Rohan G Thomas To: fancer.lancer@gmail.com Cc: alexandre.torgue@foss.st.com, conor+dt@kernel.org, davem@davemloft.net, devicetree@vger.kernel.org, edumazet@google.com, joabreu@synopsys.com, krzysztof.kozlowski+dt@linaro.org, kuba@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, mcoquelin.stm32@gmail.com, netdev@vger.kernel.org, pabeni@redhat.com, peppe.cavallaro@st.com, robh+dt@kernel.org, rohan.g.thomas@intel.com Subject: [PATCH net-next v4 2/2] net: stmmac: Tx coe sw fallback Date: Sat, 19 Aug 2023 08:53:26 +0800 Message-Id: <20230819005326.22204-1-rohan.g.thomas@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Fri, Aug 18, 2023 at 09:53:50PM +0800, Rohan G Thomas wrote: >> + u32 flags; > >This looks redundant. See my last comment. > >> + > >> + u32 tx_q_with_coe; > >This one too. Can't you just use the >plat_stmmacenet_data.tx_queues_with_coe field? > >> + if (priv->plat->tx_coe && >> + priv->plat->tx_queues_with_coe < priv->plat->tx_queues_to_use) { >> + priv->flags |= STMMAC_PRIV_FLG_TXQ_COE_LIMIT; >> + priv->tx_q_with_coe = priv->plat->tx_queues_with_coe; >> + dev_info(priv->device, "TX COE limited to %u tx queues\n", >> + priv->tx_q_with_coe); >> + } > >What about: >+ if (priv->plat->tx_coe && !priv->plat->tx_queues_with_coe) >+ priv->plat->tx_queues_with_coe = priv->plat->tx_queues_to_use; >+ else if (!priv->plat->tx_coe) >+ priv->plat->tx_queues_with_coe = 0; >+ else if (priv->plat->tx_queues_with_coe < priv->plat->tx_queues_to_use) >+ dev_info(priv->device, "TX COE is available for %u queues\n", priv->plat->tx_queues_with_coe); > >? > >-Serge(y) Hi Serge, Agreed. Thanks for the suggestion. Will rework in next version. BR, Rohan >> >>