[net-next,v5,10/16] net: dsa: tag_sja1105: prefer precise source port info on SJA1110 too
Message ID | 20240223210049.3197486-11-paweldembicki@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-79169-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp843774dyb; Fri, 23 Feb 2024 13:04:53 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVBTdtR1ke7f09gJ+2FTSpJAAoeYvqT4lJjMK2F2pLomWnqcaqxKtYfCJhZC224lpteah+YLh1lV/KOsItCx3WDKrYKPA== X-Google-Smtp-Source: AGHT+IHRdvRex/0J1SFSrOlIVAbCsPsYC1AxaFOWVWuDU+k5QFNJjKkydvMsVFtfn9TLaegPZGsP X-Received: by 2002:a2e:3a0f:0:b0:2d2:2dbb:3898 with SMTP id h15-20020a2e3a0f000000b002d22dbb3898mr157639lja.31.1708722293305; Fri, 23 Feb 2024 13:04:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708722293; cv=pass; d=google.com; s=arc-20160816; b=eculjaOklGRlDeDfMG4dy+jDTIkdCbgGD/e6tpF+jjlrjnVIZAuh2OdNoDNNCjGt5G 9rwsiELwrodbfI7GLv771TwyoQ8GsVUhtXAZyAr2lX929IYdHRAPuVEiXZhxnDTt3ho8 4hqMKlT78k/a9iIcYpTqfq2RfWwyoSFZmMkFb5y084ncOVdcb45OdlPI919AuAPRNGLm zElB/moFHyxyqaJZs4IQNL/kgv1CkGIOhARTr49wRS91itxwY/jxgeWeY9iIftecxvD6 01J9ctzoAk01thIwb3D9St8aWBfy2YYAXppNKYYwomPWhQ/nxWIsLX1ftE1QCVH2k74b WhuQ== 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=0NLCOmx0IepUq3FGeXL96wdgQ4A1ty/0t9iA55p68ic=; fh=KorcLfUJwvmWlef2o0ZqjNL9fr69dZKjAyUgHqgQIDE=; b=cdddc+Um9QUa3F/3Dq25+mWjwAwSQ8U/tYTsurJg0b5P1bGOSdKGL/67iYmX1lqDNi sIDuXB31AetqayuF8ziP4Ck9lC4reJwDpKXDd5aEvr23L8PwJAwxgsNED8cu/iptcGmq 8SadUMQZewszDSsiUNsVUtgX9MQH9rrZSHeUALMutAE8W5oobw8ecihNuv9We8xYNfVT dTszGBV4wLgvfUN+DnYTOymTAaZhpkyRew1+4rWJo+XZVFZk5+e1n9JJPzzGaKM0lFvn q8g/DetwtxgKRGq6e517I0cyZDt5TBxDM3QUz+WW2tDkUDFZ+ionR6pH7ItD8U+rOH7O xdHA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PNXStYk7; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-79169-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79169-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id x8-20020a50ba88000000b0056401546810si6184380ede.17.2024.02.23.13.04.53 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 13:04:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79169-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=@gmail.com header.s=20230601 header.b=PNXStYk7; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-79169-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79169-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 E0A931F26357 for <ouuuleilei@gmail.com>; Fri, 23 Feb 2024 21:04:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7B953149381; Fri, 23 Feb 2024 21:02:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PNXStYk7" Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (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 0CD5514EFC5; Fri, 23 Feb 2024 21:02:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708722161; cv=none; b=lWc+bv5RFngLWJ7C+Cseifwwzr56hVQdDoDL+gNRGoKXFh+JHZNDbzEGkGtCv1Mb45DlqNzxOvN4fIi9wEo/0tZkUkHK6fwTkWGDn0lEj7cistqOB4Kxw5uuOae7YKQh39AMWNbbVss9XR67aP82AYFYkA1eHov5Ozk++hRB+dE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708722161; c=relaxed/simple; bh=2iUVpsRP+GziJHbqwVWUqIeakMzbVBwpep9BwrCTVN0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Xt0vyel0C9vsK/EA8XXa7GfpbtxHFtzf8q4MN0bQrPkhxaC8XeKhaYL4uqO/8svKr0qdKImHaCP0f0qTcbGTpbtLdK8aUQPDaj2gL+Lm1V5Ir/ToOPZd4YSPgTCA0jGTdhOV++ZyjddHfCl8UmqQUIcKoJ+7RxNmClpZaQ3yRK8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PNXStYk7; arc=none smtp.client-ip=209.85.218.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a3e8c1e4aa7so127023266b.2; Fri, 23 Feb 2024 13:02:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708722158; x=1709326958; 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=0NLCOmx0IepUq3FGeXL96wdgQ4A1ty/0t9iA55p68ic=; b=PNXStYk70Er1WvWKORv5EiLjIBatBy+v3gb8FvENboTSbZLSAYa7gRjOHXA2QlAZt0 3lFg/56GI1UNw7Hty4SLOkkrquZuJuVbbWon/MKe1FNiBVEewnNiDigce7MoIEJTq1bQ Ab7Xw26lQXet+Xs3TZHSA7jikc+sHFTK/5BzxFiScz2zwNFF70cifDvJ/ISRc6f7Crc3 5JGkQ7np69Sy9cNuPT4YfrtDxKh5MW+ukMBzzS7RwFmd0IoLlvAFdxjDT4R46Ng3+TJp BrsDSBh44PRDZbwhllQR0HvrcbKy4BycHumplud4+d/LezoxRa239cAngC0rPRE0ADrA /ulQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708722158; x=1709326958; 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=0NLCOmx0IepUq3FGeXL96wdgQ4A1ty/0t9iA55p68ic=; b=j47woY2c7M5wCt9bK8U5iXWEsVLGzOJoUuRWBx/ARplVGJX72WwsJbxTZ4eseVvXcQ Tbz1TyFzh8LEWlpu1zXCpSZII2hGFKAyczuAUC4I5F/rcH2lxEu5LTGPAL1rHDZS0orw MXDRr2Q0c4wDzVBlwA8RUAKNaK8KsO+fEzJ3+VsaXlen3WAm7IrJmwjjrWO7yRwsfT/F P7IPRppcBMuA3rLHpMuup/KDhVkW8I3nKtcgyI5m19Q2CTzVUlGeG9IXZknz9VP1Pg9W x/w4nKGfVNHI1OaI9Mta9eax+iKram+O29ptj1LslKXVrBhJXF9sbq4UDFldE2ZpjH7P B/eQ== X-Forwarded-Encrypted: i=1; AJvYcCXpLM5ocNDNRjzWfMq0bQEJuVNWZa0klKCdITOGDMa2cOBFbmNVQ+QHwYFJh/J/+lFskkmCTOZQ0RVjJi/REYBdMNjE4zkSK6pYNqVQ X-Gm-Message-State: AOJu0YyKGt4WPTsedDrfZ6WQknnIVY2licYi/x+MpLk7lCRjgz/YPh3m i61PcU8SXufRH9EyFaD16K7YRyMHZNJhD05/TsZfG974hLbaSMfn9Jl1H6hajGk= X-Received: by 2002:a17:906:d20e:b0:a3f:9f38:ded with SMTP id w14-20020a170906d20e00b00a3f9f380dedmr584159ejz.69.1708722157949; Fri, 23 Feb 2024 13:02:37 -0800 (PST) Received: from WBEC325.dom.lan ([185.188.71.122]) by smtp.gmail.com with ESMTPSA id st11-20020a170907c08b00b00a3e559aaff9sm6185424ejc.29.2024.02.23.13.02.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 13:02:37 -0800 (PST) From: Pawel Dembicki <paweldembicki@gmail.com> To: netdev@vger.kernel.org Cc: linus.walleij@linaro.org, Vladimir Oltean <vladimir.oltean@nxp.com>, Pawel Dembicki <paweldembicki@gmail.com>, Andrew Lunn <andrew@lunn.ch>, Florian Fainelli <f.fainelli@gmail.com>, Vladimir Oltean <olteanv@gmail.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Claudiu Manoil <claudiu.manoil@nxp.com>, Alexandre Belloni <alexandre.belloni@bootlin.com>, UNGLinuxDriver@microchip.com, Russell King <linux@armlinux.org.uk>, linux-kernel@vger.kernel.org Subject: [PATCH net-next v5 10/16] net: dsa: tag_sja1105: prefer precise source port info on SJA1110 too Date: Fri, 23 Feb 2024 22:00:40 +0100 Message-Id: <20240223210049.3197486-11-paweldembicki@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240223210049.3197486-1-paweldembicki@gmail.com> References: <20240223210049.3197486-1-paweldembicki@gmail.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: 1791725187750689328 X-GMAIL-MSGID: 1791725187750689328 |
Series |
[net-next,v5,01/16] net: dsa: vsc73xx: use read_poll_timeout instead delay loop
|
|
Commit Message
Pawel Dembicki
Feb. 23, 2024, 9 p.m. UTC
From: Vladimir Oltean <vladimir.oltean@nxp.com> Now that dsa_8021q_rcv() handles better the case where we don't overwrite the precise source information if it comes from an external (non-tag_8021q) source, we can now unify the call sequence between sja1105_rcv() and sja1110_rcv(). This is a preparatory change for creating a higher-level wrapper for the entire sequence which will live in tag_8021q. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com> --- v5: - resend only v4: - introduce patch and replace 'slave' with 'conduit' after rebase net/dsa/tag_sja1105.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/dsa/tag_sja1105.c b/net/dsa/tag_sja1105.c index 7639ccb94d35..35a6346549f2 100644 --- a/net/dsa/tag_sja1105.c +++ b/net/dsa/tag_sja1105.c @@ -652,12 +652,12 @@ static struct sk_buff *sja1110_rcv(struct sk_buff *skb, if (likely(sja1105_skb_has_tag_8021q(skb))) dsa_8021q_rcv(skb, &source_port, &switch_id, &vbid, &vid); - if (vbid >= 1) + if (source_port != -1 && switch_id != -1) + skb->dev = dsa_conduit_find_user(netdev, switch_id, source_port); + else if (vbid >= 1) skb->dev = dsa_tag_8021q_find_port_by_vbid(netdev, vbid); - else if (source_port == -1 || switch_id == -1) - skb->dev = dsa_find_designated_bridge_port_by_vid(netdev, vid); else - skb->dev = dsa_conduit_find_user(netdev, switch_id, source_port); + skb->dev = dsa_find_designated_bridge_port_by_vid(netdev, vid); if (!skb->dev) { netdev_warn(netdev, "Couldn't decode source port\n"); return NULL;