Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp581744lqg; Fri, 1 Mar 2024 14:25:08 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXOm2dNdmxeJBsz541Q92yMyzA9X9kXNc77VF3aluh8N06a3x6HWS4hm3ECM+g8+zAo4P7JuVjJaCKNy5yyEtkYE1YielYgPnMoaUU+lg== X-Google-Smtp-Source: AGHT+IEwcmklsaZtYTfluVYVT2FlWlYLr8lo1HkeC/vXuYZkqiL7bSm0rhEbp0p6IpZLMOnU8GBy X-Received: by 2002:a17:902:ccd2:b0:1db:3a0d:1cf9 with SMTP id z18-20020a170902ccd200b001db3a0d1cf9mr3694169ple.48.1709331908010; Fri, 01 Mar 2024 14:25:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709331907; cv=pass; d=google.com; s=arc-20160816; b=eFqMas3+L6d4Np1hpVJvR3Wq0LQkHq9VQabg9zq0FGRIOOAaxJlk2NJzQj6cMYQFD0 cJu+eMz3WJb3el4VULaB8+iQy0Ro2/xDaqLrCcmE4zs9CicvfPT4n6zifUAzrmkrp/EF 4mkJYEi2McXnyvX8Hpm7+dItb0TzLhEINR89LzQkrhFZuGorOYAnf4jzltIFKoqvJwOK mEGCKXEK7kFEJ4fLT71NoeTF51OiNnL2Ym/VONTQDb/V8tYe//d0IpJePW/ZthfPwQDv gESWOJpr7GmTBSy0uT1jrPIjyOTzdG7OXuYFLizDEVLQOoYv9q306dWfhzCGYt7rY08w YCUA== 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=8eAOK6LG+DqrzRy5jAnNYEM/hys4zUVsiXRG3NHFhSI=; fh=KAH+Yoo7cqi+NrKXVTNaEqVALf1m/UVuHvW/DJOrHAA=; b=k5x4ydTFU4akkaYTy4o3Rp2z9sBmzI90GbrHNHACJ5iOQFSgaVzwxRgp/ATCf03pp+ oD2aL3Nf8V5YdgEA6FRObz1feurwilDRpr9CUapDOxGtrEILb0sbms0XfEJC0qgXiqox tNCjdEkowSuvF8Z9jN5PWvFsTq1dxMI5bwrlhZc+PDuBRmmURLOfact8V0MwH3gtanEr 6I8lpHco0F0Mp8/VbNGwDizPVXe/Rxnm/KyiOWQW6HGXUqcfGpB8jgJxBbGet9ShsuFx rZGsg1RwmtUcbwLn1W5pguNQ64TfK5zkIbP0bFLsiLhCy6BK6ku573S1dU7unhKdc7tV BzvA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=fOkF0okA; 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-89185-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89185-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id z8-20020a170902ccc800b001d9aa55e4aasi4501728ple.396.2024.03.01.14.25.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 14:25:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89185-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=fOkF0okA; 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-89185-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89185-linux.lists.archive=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 796DBB22C4C for ; Fri, 1 Mar 2024 22:20:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AF5B45C8E4; Fri, 1 Mar 2024 22:18:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fOkF0okA" Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (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 3E70D5A0FA; Fri, 1 Mar 2024 22:18:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709331489; cv=none; b=F6GiUweeFvOUehzmZXiGz9VWlDnA39LZnpxOETkF7WJSMfTd4syZvQvoEQXmBE0NvmQP17vacD0xGPaLxaa57+1lI6mxtpslB7sRhvZWVvVTAmNtAPeat9m5b9kpRyGdZAntZJkNR2bf8DLuNLfaMjFjeAGUi0P21mIu2yxLUEk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709331489; c=relaxed/simple; bh=Mpw8JDktOqAHVSnGhPK7OvlSmt3P/Pn9/iGcawwaPNA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rHUDMxMMkopDzb+hy3wHf+jTFVKLMPQ0+4f+1ycF7dXqng3GwEmBfgBnSWwMKRdyFLHEMP/nNgFatzelQS0NruDQO1oaIjM/1kp44SyAH3FjuG8r7lL18o0P+XHJ1m45h9GweWcgJIGyqMzy3LHjTIoGPNve9ikMpH/i25Uaiy0= 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=fOkF0okA; arc=none smtp.client-ip=209.85.218.51 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-f51.google.com with SMTP id a640c23a62f3a-a293f2280c7so497772966b.1; Fri, 01 Mar 2024 14:18:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709331486; x=1709936286; 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=8eAOK6LG+DqrzRy5jAnNYEM/hys4zUVsiXRG3NHFhSI=; b=fOkF0okAJ7wZf0VYkVkm7GHBVz65sXVcMutqgBxfhlTqHogY0mtNeg/KG+tFnjYr1m H4rGSWBzx6sXJ/TA01HAD+aBfB6UVP8yKNUc14YYaW/nZBOt1G5+P/ElqwvD40wF0MBr XL/mLu3OxJkIe8rzfTxsM1XkQVJPcdqqUL/9tNq3pUhBONr+jmq5HdZ7si4SJlaRM5Ef zEqG5ZloNpaqZJ4RV53WPrln/BmxcL/evvQdZS25Sl3x2wmFQFkLLudjTX41F2CUtp/K gqCYqAiB7ExTAo7ELo/kPuyFvx3SpkRW3S8eOJy7BiGQKyd1sj6w2aKEaDdnoigZoDYM 3p4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709331486; x=1709936286; 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=8eAOK6LG+DqrzRy5jAnNYEM/hys4zUVsiXRG3NHFhSI=; b=K3EXAZzyditA7j+9gG1b3KEvVvxSEe9kyVukfTRl/1ujWge/usi292/VrEp/KbLEMt ChvbURZVMB422BrKtf8JkEUxUClTz6O+YqiwSH+0wvZG29lykfrg6EZHGR5Cfy373uZj Na5iIYA+huro+j8hJQoeKWdCJhg9egppPMJ2zYTNuPPxSC1Qe5r6SMWBpL966Ph3Mnub N7Ofv8uJ+azhP8u5i9LeSBH7FPUtIqgBkNSswuNr6qyZEcOJ6Z0W6DrG8tv4/S3Dmire yZYq231SxjnSwt97OFqPtxS2O/uwDdFfG9yP120iTL+cle5/kf6mdu8AMgv8HD5IIjCb Q52A== X-Forwarded-Encrypted: i=1; AJvYcCW6S388+vbzvvxtNdUDeGpYp0FKYUBG6Key7sUyzBN3JzCzHeMWJqcgRe2cNTRSEZhsiumVKR/k6XbFwokOwYVMPJW7ZYEI9BAQbA3W X-Gm-Message-State: AOJu0YxfJjzHTOoUI1UepQPKhuDv43lJ/WcmiXRCFoRTRSRUI+VqWqUU +JHUaGjPNetwKuhvnDSLQOOcQU1rliL3kYgjUs0UNCA0/BlzwzrCBtaFWG3mihg= X-Received: by 2002:a17:906:4558:b0:a43:9857:8112 with SMTP id s24-20020a170906455800b00a4398578112mr2365844ejq.20.1709331486353; Fri, 01 Mar 2024 14:18:06 -0800 (PST) Received: from WBEC325.dom.lan ([185.188.71.122]) by smtp.gmail.com with ESMTPSA id g16-20020a17090613d000b00a3f480154a3sm2091122ejc.65.2024.03.01.14.18.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 14:18:06 -0800 (PST) From: Pawel Dembicki To: netdev@vger.kernel.org Cc: Linus Walleij , Simon Horman , Vladimir Oltean , Pawel Dembicki , Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Russell King , linux-kernel@vger.kernel.org Subject: [PATCH net-next v6 10/16] net: dsa: tag_sja1105: prefer precise source port info on SJA1110 too Date: Fri, 1 Mar 2024 23:16:32 +0100 Message-Id: <20240301221641.159542-11-paweldembicki@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240301221641.159542-1-paweldembicki@gmail.com> References: <20240301221641.159542-1-paweldembicki@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Vladimir Oltean 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 Signed-off-by: Pawel Dembicki --- v6,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; -- 2.34.1