[net-next,v5,01/15] net: ravb: Let IP-specific receive function to interrogate descriptors
Message ID | 20240131084133.1671440-2-claudiu.beznea.uj@bp.renesas.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-46019-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1751464dyb; Wed, 31 Jan 2024 00:43:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IF8VpyFkxdysbjyi1IZC90cCtpL1RP9jbp+duUsx4spToBjeFP9kkMd3+Bl5zj1yJGx2vyC X-Received: by 2002:a17:906:1b4b:b0:a2f:1650:a0fb with SMTP id p11-20020a1709061b4b00b00a2f1650a0fbmr555638ejg.66.1706690602938; Wed, 31 Jan 2024 00:43:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706690602; cv=pass; d=google.com; s=arc-20160816; b=I+ba45nyPvF54431dXkJ/zfZyQOzac9DGKDXN+zt1Nhv4XAGXfdsOQA8JZ4LuH6iSZ 8VTdaLm0hDMN0jrrMzwO7dmoKdCs2nR4rASQXxhEm6hZxZpSUO1MKtUnLiXAaWM+7aZm 4AICaf+2ln6iaAY7DcJvOLk9X4ckwudtLcz1jicxvY8JYJWoSclZvLxuq6bSs5g3XLOz 8+H/brdlk9QT5t+6HkIuHXXPHXCI+1ah0ltsWOYFOCbWWi/NQCLkWLrMafvNJCrRv4OY xbdSbQH7Dy8B1SNJXWLV7z2uiMFiKGKHy6L2JmExIrqD8Q/I0vDaA50FBlKMZ/fbdAXy rzjg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=3nopmGlOYDibDD0J+/Hxx33H1qRqX0KJvglV4HoOWvw=; fh=QxcDr2Odk/hmRSkvc7XnYae7S5Gb0Ahg5S1OQ4a0v5w=; b=GkdJulCKscXpf/mPMaMu+5wYkGFmQWtgrWbfb8pPzh9qlkVxcL2cXZ5bk07tgN+GLR e9z1FRrRRXApI22Ig18AIA8Aa4pOMhjLhRDyiwfbV8u/aRqbDiYUstqWJL0YMX6E9ioE TS1sDRu77Sl6db0E+MhwY4NgShWHagdtxWWDkhKOS0/SPyOvo7yD0pkGTjAxVhobru+8 0wy/Fla/HlOZymP5JUB66+bJakWK2npPPTIdTTkvsg69D3yMi0wP1p/JrfaZiop/yEkC naxeRRW8a+GisaV2HAlEsid377uEF2d2aCYISQfBt1sXN9YD9OIYhpP1o3NahPWIlTU9 uRog==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=a08gYhQR; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-46019-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46019-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCVUhDHU6jPdgSuK80XhpATOmfhIOgBjwpJqK7nIjah/o0AlqXztfw8hT2jvBstmNgGN/kes1WKHOGnSdv1/qwPMj8DcPg== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id h13-20020a17090619cd00b00a35e32fd8a6si2242363ejd.237.2024.01.31.00.43.22 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 00:43:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46019-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=a08gYhQR; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-46019-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46019-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 8C9061F248C4 for <ouuuleilei@gmail.com>; Wed, 31 Jan 2024 08:43:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1FDC560885; Wed, 31 Jan 2024 08:41:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="a08gYhQR" Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 86BD460B9A for <linux-kernel@vger.kernel.org>; Wed, 31 Jan 2024 08:41:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706690511; cv=none; b=BvjnylJTzPXQPpAtwqgcpqlYSNmKnGd5lGLN4WQSMbo5UxSD287E+mjMiAX09oYTH/VmTf40kMO3gbh2wRpyrs9k8ZAhr+iHQuPgbR8rBfXwKQWhJbbJbpjSAmxGnJZg2gs2i2rbYxcvnwnDLrGLhtB4JDIrQCEAhR7BHvMJqwQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706690511; c=relaxed/simple; bh=aaKf7z2xB1MNtfZ9vMqWh+Wx2jdR1MK9CRLol2unMF0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jX+CkPrM9rWzTv6ejjMPjopOp4hREWt7ZWP/Q0IkBZPIfK9hhmi2w7UykZdZlyJoBNl6FGOnvnYVsTVIwq/6GT0k8MrJrvfu6sD5BmY+1Yxfab7Y4EK59i04U4vXyXfiHISiZwTu0in1g29E7IWffuJ+HgJvpLcsWbMf+4dmo0o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=a08gYhQR; arc=none smtp.client-ip=209.85.208.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Received: by mail-lj1-f171.google.com with SMTP id 38308e7fff4ca-2d0600551ebso14518321fa.2 for <linux-kernel@vger.kernel.org>; Wed, 31 Jan 2024 00:41:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1706690507; x=1707295307; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3nopmGlOYDibDD0J+/Hxx33H1qRqX0KJvglV4HoOWvw=; b=a08gYhQRlIgi/qUl044Zw3FcKBfxoHa6kVj6bphuS2MGkJ4DFPrA5WtlJW0b815jEj yNNwGWK+aydDHlUSOEA8m+rdv6R4Oz6nsAN3qLyrmcuSC5iyXvsO5Bjnslq2X/seI2WU GwiXz6rhsdd/VBbthhLOmqaREsCqZ3HmEg6YXiGJJfMglgpFD9VLfr2nHWuXgnCCbvSS kFncaSuNC9qQkBv6Clwqe7Vu3zjY3ID2FaJwvTikntRep5lxVzyQwFswkupI23g8Oju8 o/K1p0ggZ3lgm/V29aZAfL0x0BhSKpgod51d/4lh32ECWTTCpX5kO/KIcRuodHs+NDXC 3SvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706690507; x=1707295307; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3nopmGlOYDibDD0J+/Hxx33H1qRqX0KJvglV4HoOWvw=; b=Jz8jbqlKEJ7S1Ij3qhd3VQ0kXbOeWWrU5djKy3ME+TLo1iaH7US0H2WshEwtffuEau aX3dvD0oLCbjQVaqcn8DXx86mjkhvPlwTDv2R/aMUkD3DEJ//E0z9TFezdv6umS+uYX5 r3NSfSZkL5Azr4AtwaR5M6nsC5uPQlH5mj4JEI9vYI8dIRqlS7xhXFmRgIFlb+QFGflK LRz3IdySdyeP+U1FjN5t06Wt1zN7pmgrT5HagKvtkJkn7mJBEA51Y5Ou2T5efKnjYF2Y bAO9z4HXx4w2Ih74ZkglhtRik7lx5VwM3A98lzwVqcml34zNyjKICFMF2imenHOc7gzZ P8vA== X-Gm-Message-State: AOJu0YwxwKATBcKbSgMQkzGwE6PEuWkMHeUN/2Cqcfr009dTKEZJXLtw H1mJe/K4bbjb7LWlBQlo00GM6/w+nqFtitwYvGRK5p3aacxCDsGCSg2TF00SHTs= X-Received: by 2002:a05:651c:1a0f:b0:2cf:1ae2:dca with SMTP id by15-20020a05651c1a0f00b002cf1ae20dcamr799228ljb.16.1706690507376; Wed, 31 Jan 2024 00:41:47 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCVINZIQxSHU9/Pkq2gP08HOZi6sVlBy3aTiloaO6v4iewhrYb8NolbjvUFEnGcamkz60RVZQPaEpoCm25S2D3KtobY34/cC3J+5c2db68rdUesbukQ2PDk/yl+19cu49aAWhdPT214NeskIYewypZ4LhXQJHSxXq/0vNHL1pT7M9w85CYUbtVv36onuBy3h8fkBead3dgATf9weN0/9QrT37J4bi0WVVHFhY181GC00R0hhJDmS1u8wnX4mayOpbUrqzg3YginFPuCoOMzv0NMbTvYngQhtbm7KZv9ugPwHOQiC0L9OGfBkPk4agQmKusxS84Sr3ZowH7+8mR5yFucpvC3n4nnMtTKIUrPlsL3WH/Y3yIO381AzrqQ8JInMxQEBqVBW4De67HXsmJ4ghB7SRsN8LTvZ1DZiv1fJyEpxO6/t3zY= Received: from claudiu-X670E-Pro-RS.. ([82.78.167.87]) by smtp.gmail.com with ESMTPSA id cq16-20020a056402221000b0055f02661ae2sm2863630edb.78.2024.01.31.00.41.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 00:41:47 -0800 (PST) From: Claudiu <claudiu.beznea@tuxon.dev> X-Google-Original-From: Claudiu <claudiu.beznea.uj@bp.renesas.com> To: s.shtylyov@omp.ru, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, richardcochran@gmail.com, p.zabel@pengutronix.de, geert+renesas@glider.be Cc: netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, claudiu.beznea@tuxon.dev, Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> Subject: [PATCH net-next v5 01/15] net: ravb: Let IP-specific receive function to interrogate descriptors Date: Wed, 31 Jan 2024 10:41:19 +0200 Message-Id: <20240131084133.1671440-2-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240131084133.1671440-1-claudiu.beznea.uj@bp.renesas.com> References: <20240131084133.1671440-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789594805335074473 X-GMAIL-MSGID: 1789594805335074473 |
Series |
net: ravb: Prepare for suspend to RAM and runtime PM support (part 1)
|
|
Commit Message
claudiu beznea
Jan. 31, 2024, 8:41 a.m. UTC
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> ravb_poll() initial code used to interrogate the first descriptor of the RX queue in case gPTP is false to determine if ravb_rx() should be called. This is done for non-gPTP IPs. For gPTP IPs the driver PTP-specific information was used to determine if receive function should be called. As every IP has its own receive function that interrogates the RX descriptors list in the same way the ravb_poll() was doing there is no need to double check this in ravb_poll(). Removing the code from ravb_poll() leads to a cleaner code. Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> --- Changes in v5: - none Changes in v4: - none Changes in v3: - collected Sergey's tag Changes in v2: - addressed review comments and keep stale code out of this patch drivers/net/ethernet/renesas/ravb_main.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index 0e3731f50fc2..d371c4bed634 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -1288,25 +1288,16 @@ static int ravb_poll(struct napi_struct *napi, int budget) struct net_device *ndev = napi->dev; struct ravb_private *priv = netdev_priv(ndev); const struct ravb_hw_info *info = priv->info; - bool gptp = info->gptp || info->ccc_gac; - struct ravb_rx_desc *desc; unsigned long flags; int q = napi - priv->napi; int mask = BIT(q); int quota = budget; - unsigned int entry; - if (!gptp) { - entry = priv->cur_rx[q] % priv->num_rx_ring[q]; - desc = &priv->gbeth_rx_ring[entry]; - } /* Processing RX Descriptor Ring */ /* Clear RX interrupt */ ravb_write(ndev, ~(mask | RIS0_RESERVED), RIS0); - if (gptp || desc->die_dt != DT_FEMPTY) { - if (ravb_rx(ndev, "a, q)) - goto out; - } + if (ravb_rx(ndev, "a, q)) + goto out; /* Processing TX Descriptor Ring */ spin_lock_irqsave(&priv->lock, flags);