From patchwork Fri Jan 5 08:23:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: claudiu beznea X-Patchwork-Id: 185260 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp6091547dyb; Fri, 5 Jan 2024 00:24:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IEE7UstUMMmacj8jDaRN6EdryGssn9m0+73K9Jiw6qAesntNar7q5zxybPBOOF6BEJriNSi X-Received: by 2002:aa7:d504:0:b0:553:861a:4963 with SMTP id y4-20020aa7d504000000b00553861a4963mr500953edq.65.1704443092525; Fri, 05 Jan 2024 00:24:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704443092; cv=none; d=google.com; s=arc-20160816; b=k/b2zdrRcO3QIJYdsNE6T6uRLkQQb2MroY5KIdcEEzhDunEDowoik3TxhZEEUsVsME 5BqfZ1LzPXd9c3YE9JcEYmxwLkljbjH2KKfFRrW6hm3uTaRHHOP/frZ6pvIzJXLNt4wI uHzYml04SWqHgPug41+nRVsYcCGi2S38gNzIhwVUEhCUmeQzc1wCqk52n7UGvMC6jmyB r9cH3vm5cZhqrtnI8Bng5Khxx5VacD9UwH3bPyoJS3yoZ+d1pERk5NsOdIXe670VWMyy 7XNAPJDGn2BJmuBW/C36RArH/hKIbYlBCYdoayC3L1/As2+RR5mwDrLxGumZYI06Dt0M eRZg== ARC-Message-Signature: i=1; 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=l+tjNoHjZQ1yXHRb/ulbcR3/2aD9RiH4l3tk8kImOzo=; fh=qryrdWWtksp4Ojh0keXejXriHeHARah4mOGZkuZ1jnk=; b=QEx+37daHRudWBDugXwDmZnyK2h1xZkPqFT1x2GpPzUd3MfNbaY0XXCG1HP/h9w4hX Yq99x/9nzck2fUlhpEAp26m3fKQraorDhK+QVmiGl6K+PHVOL0yEq84CZbo65zEOz2HU Zq9j2mecFDCrLtb3l6wVKjRqOTPeol0rHL9/In20S/XBZH5PlsstL9lgIruUJL+H5JQA xs6tsN5Sf5R9SXhsf2n+Sc4agLDvuHlZRopQJJILU0DLdtQ/B3wvfURKz8j+YkShjAYa hgtFobCLu3svHWx9yolJFdX2CW72sJ3ekR6rrmsSS3SehZhCuYdKFtfxLL0Sq9IMHB2I L+kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=l74xefE6; spf=pass (google.com: domain of linux-kernel+bounces-17580-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17580-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id s6-20020a50ab06000000b005561c393184si438407edc.221.2024.01.05.00.24.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 00:24:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17580-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=l74xefE6; spf=pass (google.com: domain of linux-kernel+bounces-17580-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17580-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 2309D1F239DF for ; Fri, 5 Jan 2024 08:24:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 27200225D3; Fri, 5 Jan 2024 08:24:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="l74xefE6" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) (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 1BD3421376 for ; Fri, 5 Jan 2024 08:24:08 +0000 (UTC) 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-ej1-f44.google.com with SMTP id a640c23a62f3a-a293f2280c7so31038966b.1 for ; Fri, 05 Jan 2024 00:24:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1704443047; x=1705047847; 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=l+tjNoHjZQ1yXHRb/ulbcR3/2aD9RiH4l3tk8kImOzo=; b=l74xefE6EIja6pmePL2sMlf9yaK+OV8WMikYVjLK84Y9Q9xwmL47Smpq6lJNbN1Iv/ OphuOt80nK1O6wW3SmMVe4tDy5vgmrorxvmgvTGb3e8QAUSMZkmoeSZUIZeSpR5AgFdk 1/9OuKZV008UPT3RRWpkF0ldSzVltgCooBMqQhsWtLkUoBTnOP1hiqIl3wh+x1BchMgr 8VNhLTpsiwS/+w5XVzpP9PD1fLEzm6HAmrFaH/zJOdGBNjfC39i+5dOJ0z39w/ockvfP zwfyr77lpnMkQVRpEc4Ml/ucyST2n+Z+bOf1pKNKrwYzA4UjQCOGrsBQac1r7G5Tg5Ov fW/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704443047; x=1705047847; 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=l+tjNoHjZQ1yXHRb/ulbcR3/2aD9RiH4l3tk8kImOzo=; b=TPhZO3L0i3EEfvTlsWPkcNj5ViGLszQSMnThe8lTJqzx/i31IrEZsY3ksbqwWn4npG YGp6kXOjM/vb3aj2Lf4i7G4nMs9ueG/SYCTmvLR3KoTuDIzpqws52H5ZEmJE/lynKzDz YB23LtpPJyT9z7CoDfWarxTprxBPdz7jt/hEUM6U8ScOB5I/XfXWndo0JuttXhEoN2dS 29GNyc0SjxF3mdOmGJbrUap1K82bmyRptlTDQ1RONSItxzFPX0F2TKqRMrYDSDEERQqN OYKfckAkmUbfbSi+Lee5TR2H2che45l9rEesEflqGNzmSOtrMWNudEuh0aV9l/qGQ+nH tC3w== X-Gm-Message-State: AOJu0YxGb+QZZl/1moO3E/yGVJDjkwnTYYX4DIgJYnJDYWy+9UZCpuHb lf9QZMP2aRqDtQ5hi7SWoToOmFiN/qh5OQ== X-Received: by 2002:a17:906:57d8:b0:a27:b676:a603 with SMTP id u24-20020a17090657d800b00a27b676a603mr456149ejr.269.1704443047364; Fri, 05 Jan 2024 00:24:07 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.5]) by smtp.gmail.com with ESMTPSA id j15-20020a1709064b4f00b00a28e759a447sm596198ejv.213.2024.01.05.00.24.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 00:24:07 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: s.shtylyov@omp.ru, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, richardcochran@gmail.com, p.zabel@pengutronix.de, yoshihiro.shimoda.uh@renesas.com, wsa+renesas@sang-engineering.com Cc: netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, claudiu.beznea@tuxon.dev, geert+renesas@glider.be, Claudiu Beznea Subject: [PATCH net-next v3 01/19] net: ravb: Let IP-specific receive function to interrogate descriptors Date: Fri, 5 Jan 2024 10:23:21 +0200 Message-Id: <20240105082339.1468817-2-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240105082339.1468817-1-claudiu.beznea.uj@bp.renesas.com> References: <20240105082339.1468817-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787238120484882521 X-GMAIL-MSGID: 1787238120484882521 From: Claudiu Beznea 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 Signed-off-by: Claudiu Beznea --- 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 8649b3e90edb..921f645a7218 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);