From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: davem@davemloft.net, pabeni@redhat.com, netdev@vger.kernel.org
Subject: Re: [PATCH net-next 04/14] eth: pch_gbe: remove a copy of the NAPI_POLL_WEIGHT define
Date: Thu, 28 Apr 2022 12:57:39 +0300 [thread overview]
Message-ID: <YmplE5BrOT8RpI8j@smile.fi.intel.com> (raw)
In-Reply-To: <20220427154111.529975-5-kuba@kernel.org>
On Wed, Apr 27, 2022 at 08:41:01AM -0700, Jakub Kicinski wrote:
> Defining local versions of NAPI_POLL_WEIGHT with the same
> values in the drivers just makes refactoring harder.
LGTM,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> CC: andriy.shevchenko@linux.intel.com
> ---
> drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 12 +++++-------
> 1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
> index 1dc40c537281..46da937ad27f 100644
> --- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
> +++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
> @@ -32,8 +32,6 @@
> #define PCI_DEVICE_ID_ROHM_ML7223_GBE 0x8013
> #define PCI_DEVICE_ID_ROHM_ML7831_GBE 0x8802
>
> -#define PCH_GBE_TX_WEIGHT 64
> -#define PCH_GBE_RX_WEIGHT 64
> #define PCH_GBE_RX_BUFFER_WRITE 16
>
> /* Initialize the wake-on-LAN settings */
> @@ -1469,7 +1467,7 @@ pch_gbe_clean_tx(struct pch_gbe_adapter *adapter,
> tx_desc->gbec_status, tx_desc->dma_status);
>
> unused = PCH_GBE_DESC_UNUSED(tx_ring);
> - thresh = tx_ring->count - PCH_GBE_TX_WEIGHT;
> + thresh = tx_ring->count - NAPI_POLL_WEIGHT;
> if ((tx_desc->gbec_status == DSC_INIT16) && (unused < thresh))
> { /* current marked clean, tx queue filling up, do extra clean */
> int j, k;
> @@ -1482,13 +1480,13 @@ pch_gbe_clean_tx(struct pch_gbe_adapter *adapter,
>
> /* current marked clean, scan for more that need cleaning. */
> k = i;
> - for (j = 0; j < PCH_GBE_TX_WEIGHT; j++)
> + for (j = 0; j < NAPI_POLL_WEIGHT; j++)
> {
> tx_desc = PCH_GBE_TX_DESC(*tx_ring, k);
> if (tx_desc->gbec_status != DSC_INIT16) break; /*found*/
> if (++k >= tx_ring->count) k = 0; /*increment, wrap*/
> }
> - if (j < PCH_GBE_TX_WEIGHT) {
> + if (j < NAPI_POLL_WEIGHT) {
> netdev_dbg(adapter->netdev,
> "clean_tx: unused=%d loops=%d found tx_desc[%x,%x:%x].gbec_status=%04x\n",
> unused, j, i, k, tx_ring->next_to_use,
> @@ -1547,7 +1545,7 @@ pch_gbe_clean_tx(struct pch_gbe_adapter *adapter,
> tx_desc = PCH_GBE_TX_DESC(*tx_ring, i);
>
> /* weight of a sort for tx, to avoid endless transmit cleanup */
> - if (cleaned_count++ == PCH_GBE_TX_WEIGHT) {
> + if (cleaned_count++ == NAPI_POLL_WEIGHT) {
> cleaned = false;
> break;
> }
> @@ -2519,7 +2517,7 @@ static int pch_gbe_probe(struct pci_dev *pdev,
> netdev->netdev_ops = &pch_gbe_netdev_ops;
> netdev->watchdog_timeo = PCH_GBE_WATCHDOG_PERIOD;
> netif_napi_add(netdev, &adapter->napi,
> - pch_gbe_napi_poll, PCH_GBE_RX_WEIGHT);
> + pch_gbe_napi_poll, NAPI_POLL_WEIGHT);
> netdev->hw_features = NETIF_F_RXCSUM |
> NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
> netdev->features = netdev->hw_features;
> --
> 2.34.1
>
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2022-04-28 10:06 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-27 15:40 [PATCH net-next 00/14] remove copies of the NAPI_POLL_WEIGHT define Jakub Kicinski
2022-04-27 15:40 ` [PATCH net-next 01/14] eth: " Jakub Kicinski
2022-04-27 15:40 ` Jakub Kicinski
2022-04-27 15:40 ` Jakub Kicinski
2022-05-01 22:10 ` Linus Walleij
2022-05-01 22:10 ` Linus Walleij
2022-05-01 22:10 ` Linus Walleij
2022-04-27 15:40 ` [PATCH net-next 02/14] eth: remove NAPI_WEIGHT defines Jakub Kicinski
2022-04-27 17:41 ` Greg KH
2022-04-27 15:41 ` [PATCH net-next 03/14] eth: cpsw: remove a copy of the NAPI_POLL_WEIGHT define Jakub Kicinski
2022-04-27 15:47 ` Vladimir Oltean
2022-04-27 15:53 ` Jakub Kicinski
2022-04-27 21:06 ` Francois Romieu
2022-04-27 15:41 ` [PATCH net-next 04/14] eth: pch_gbe: " Jakub Kicinski
2022-04-28 9:57 ` Andy Shevchenko [this message]
2022-04-27 15:41 ` [PATCH net-next 05/14] eth: mtk_eth_soc: " Jakub Kicinski
2022-04-27 15:41 ` Jakub Kicinski
2022-04-27 15:41 ` Jakub Kicinski
2022-04-27 15:41 ` [PATCH net-next 06/14] usb: lan78xx: " Jakub Kicinski
2022-04-27 15:41 ` [PATCH net-next 07/14] slic: " Jakub Kicinski
2022-04-27 15:41 ` [PATCH net-next 08/14] eth: bgnet: " Jakub Kicinski
2022-04-27 16:09 ` Florian Fainelli
2022-04-27 16:53 ` Jakub Kicinski
2022-04-27 17:32 ` Florian Fainelli
2022-04-27 15:41 ` [PATCH net-next 09/14] eth: atlantic: " Jakub Kicinski
2022-04-27 15:41 ` [PATCH net-next 10/14] eth: benet: " Jakub Kicinski
2022-04-27 15:41 ` [PATCH net-next 11/14] eth: gfar: " Jakub Kicinski
2022-04-27 15:41 ` [PATCH net-next 12/14] eth: vxge: " Jakub Kicinski
2022-04-27 15:41 ` [PATCH net-next 13/14] eth: spider: " Jakub Kicinski
2022-04-27 15:41 ` Jakub Kicinski
2022-04-27 21:56 ` Geoff Levand
2022-04-27 21:56 ` Geoff Levand
2022-04-27 15:41 ` [PATCH net-next 14/14] eth: velocity: " Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YmplE5BrOT8RpI8j@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.