Received: by 2002:a05:7208:31d3:b0:81:e143:7c29 with SMTP id v19csp423084rbd; Fri, 5 Apr 2024 08:25:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVfHlNsOqsW8S7lCmHOG5MOFoPaBJq7xPUkXOujba81SpShiX5lRWlOTBeWvTl3vBTLmfwiTwpySpDwEkKGcho17PecT+3cD/IFWfV1fA== X-Google-Smtp-Source: AGHT+IGsdEApRXb6cU3PaE1X30359DvFtjsezLSFAj9MOiEPt4ND/39T0NWEsOuJ+DYZ/Jz4QJuC X-Received: by 2002:a05:6402:3227:b0:568:a226:6685 with SMTP id g39-20020a056402322700b00568a2266685mr3068561eda.8.1712330720754; Fri, 05 Apr 2024 08:25:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712330720; cv=pass; d=google.com; s=arc-20160816; b=OhclIYprqa1bSDzak9jVjbOj2o0WdSRvsbHBUkwaHt/oYFLgIdvo16PV62pNU+l2CN Q7weFUJWAXoFs4TaG+qrvWHsInmzWI4Gho2srHYTDUvpRh5H1kw+hnkTPXYdhkCxjYDy JiPJU4tjX/bb4ESvaldYvODIN+L8mBxPvdycm8JmQQQtgk6muKOkGTUSoElM0i229/IX HG7EUxfxTXswWqikldPRfwcI0tlEzGX5J/tQQCz1EaSSPgKUsraN6UgPlY115R5wGj+J NDXBJH+M2fU8ZZnDvp05xUXep0hVC1jdM761Usz6lgPzwjxP3Z1Dt989dBLsuDFuoIIX 0Mqw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Lu+Hj8riJMjp8b2OVIDj4dkzNvAkKOcq97y/I5O3guk=; fh=VJGSnRW5sxLxGgJJtfEByvKHRm8+6XeA2/Ut1ugGLpg=; b=lPLDPEyTge6F1K1L12YarrXIcgadFRmwPtvtJyCQZMDgCqRPoDpqYKmgY4uFleHrtA HHIh4tw8lBI57uUsHV9CDEwuHTv9BXyIDfWvzCcR0owk/dRWmL4NyTibARVPMUJ+zisg Ps3AH+hXwPGqI5EpQubH9HiWFqZLemmG8jslXkWJqTEDR0GpAbJzdA6ReqryI35DFcvM ewXUROVvkZYC4LBOShnCa5H1ocRVmwSlCjS7DPAP1HngWU/O+KSCDdkAtHfTKJ9SbSOD f0uAXcVh+w8UVGhFL3jiLVtxWDkSuSsDZ13sMTW+MEBqBM0/8S7OywIIb1aW61EgBLGk lscA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PBeKJNVc; 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-133235-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133235-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id b10-20020a056402350a00b0056e2caca119si836219edd.400.2024.04.05.08.25.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 08:25:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-133235-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PBeKJNVc; 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-133235-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133235-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 56DE51F24935 for ; Fri, 5 Apr 2024 15:25:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1F46016F90D; Fri, 5 Apr 2024 15:25:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PBeKJNVc" Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (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 76ADB16F27D; Fri, 5 Apr 2024 15:25:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712330709; cv=none; b=jF1BBZyPoketxWnko19NZCb9S6EG3X5WyGaOLOuHGL0UjNFlgPGEZnBW7YU3Hnoohp6qATof38ARYTsD0CgJuZkVdliDscrESy3If46f5SYzWXiWhwS+MnAgJQCASxz2PUCbhGpyKx6st3MALVBXLZBbD3n0JAgZLhU4p6bSOY8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712330709; c=relaxed/simple; bh=PAxYQH0nqngIa5c83U5GYyoBUN9IQi1r2j+0wAE7N3s=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nK48WlmX3/W34v1s8cZjs1GkIsP7H51RCrmOaHaK/RwWgNMo2GTMnl7fIiFD65AFUaQk0tK0x5Nwd7tFxUTk+mu86KAM3TOEoldWYefahC514g5EkVCr+5ONu4x+7asNpsoc4uGmV0NtPvDEW/N/IsZfMTbB95lGm2FltUw4JbU= 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=PBeKJNVc; arc=none smtp.client-ip=209.85.218.46 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-f46.google.com with SMTP id a640c23a62f3a-a4a393b699fso388725866b.0; Fri, 05 Apr 2024 08:25:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712330706; x=1712935506; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Lu+Hj8riJMjp8b2OVIDj4dkzNvAkKOcq97y/I5O3guk=; b=PBeKJNVcRP+MWVc7M9M/0Maa4uYH+hMYTR10fRufs+61o1CJxqH7m9lmyPqaWu/7Xf 1s4dRQ9ETIIZH6QJbL6auASEOOmZ+Sr8RvBo9unvJ4zp8DAWpQ98NTGYydcHI6edUG+6 dlUK4o+uCkaGzzIqVinKX8K4M4fCp8jXML0M1rltH+2i0v/DqxleETKJBMZovCZZ9T9o hWeFY5xIpAnefv5sVXX3O5XwERz90Cr1KC9m7w/oZFizSeaMyestK53jD2Nq6cBRvfNi a5ggt5HKcibdo9SbUyAcjI3adooUtLJJWzvy62zp80cQH+gG83x7EwKKBiK0ra8XtOE9 MTVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712330706; x=1712935506; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Lu+Hj8riJMjp8b2OVIDj4dkzNvAkKOcq97y/I5O3guk=; b=Irm+dRr/d1IM315uyomlOEwBrfY0grGW/r5x+QMworsdZIN+AZSG1RIxaNgX1jbmvG YbXDY1BHIuhIJrVpYTtNZIH772bvrmgvmMSZuNJdPhHa/u2cdXnDtmRhZetaQXf0aWxI W80wj62Dy+vlwAPP6iJgJq760yL2KIM09JPNnP+Rh3++Z0tQdPMx/xlq1k5TOA8KJi6T iGOOC9rcYhQl3A9fSeYwd8nlAcNtJkQMzUMgz/E1GwrD3q8Xdwl2RT74LGumPJwPzjLM ifLSS0gc+4rY+QrewIuyircndrdDT0Er8jSOFH4KTmmvtqw3ijj4RY1ePPbxUiQO61N7 6OSw== X-Forwarded-Encrypted: i=1; AJvYcCXYggExE1UwoDkx83wTRRHoeanPV0K3zItn+LAfdOoP8chrgEV3lbQyCIgCaoDBOwPHSqrvgWQewNyjymDTpByAVZaWO2T2LKp+mu4U X-Gm-Message-State: AOJu0Yz/KkrwyP7xtuhU/gIpva04cOEt1Wv1K2t85MNCav1A/0OqWk0b dtc8BhNh1d3u8NhSR+DBwTUUdD06xmfF8dfzcYuu5tL8l78jFr7VR6zYjUmsEYA= X-Received: by 2002:a17:907:a088:b0:a51:a288:4a4b with SMTP id hu8-20020a170907a08800b00a51a2884a4bmr2699103ejc.10.1712330705414; Fri, 05 Apr 2024 08:25:05 -0700 (PDT) Received: from skbuf ([2a02:2f04:d700:2000::b2c]) by smtp.gmail.com with ESMTPSA id h21-20020a1709066d9500b00a4dacd6b8b3sm952222ejt.68.2024.04.05.08.25.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 08:25:04 -0700 (PDT) Date: Fri, 5 Apr 2024 18:25:02 +0300 From: Vladimir Oltean To: Pawel Dembicki Cc: netdev@vger.kernel.org, Linus Walleij , Simon Horman , Florian Fainelli , Andrew Lunn , Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Russell King , linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next v8 15/16] net: dsa: vsc73xx: Add bridge support Message-ID: <20240405152502.wapf4btqq3dtqeq2@skbuf> References: <20240403103734.3033398-1-paweldembicki@gmail.com> <20240403103734.3033398-1-paweldembicki@gmail.com> <20240403103734.3033398-16-paweldembicki@gmail.com> <20240403103734.3033398-16-paweldembicki@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240403103734.3033398-16-paweldembicki@gmail.com> <20240403103734.3033398-16-paweldembicki@gmail.com> On Wed, Apr 03, 2024 at 12:37:31PM +0200, Pawel Dembicki wrote: > This patch adds bridge support for vsc73xx driver. > It introduce two functions for port_bridge_join and > vsc73xx_port_bridge_leave handling. > > Those functions implement forwarding adjust and use > dsa_tag_8021q_bridge_* api for adjust VLAN configuration. > > Reviewed-by: Linus Walleij > Signed-off-by: Pawel Dembicki > Reviewed-by: Vladimir Oltean > Reviewed-by: Florian Fainelli > --- > diff --git a/drivers/net/dsa/vitesse-vsc73xx-core.c b/drivers/net/dsa/vitesse-vsc73xx-core.c > index d0442ea8a610..87922804d1c1 100644 > --- a/drivers/net/dsa/vitesse-vsc73xx-core.c > +++ b/drivers/net/dsa/vitesse-vsc73xx-core.c > +static int vsc73xx_port_bridge_join(struct dsa_switch *ds, int port, > + struct dsa_bridge bridge, > + bool *tx_fwd_offload, > + struct netlink_ext_ack *extack) > +{ > + *tx_fwd_offload = true; > + > + return dsa_tag_8021q_bridge_join(ds, port, bridge); > +} > + > +static void vsc73xx_port_bridge_leave(struct dsa_switch *ds, int port, > + struct dsa_bridge bridge) > +{ > + dsa_tag_8021q_bridge_leave(ds, port, bridge); > +} > + > static int vsc73xx_port_setup(struct dsa_switch *ds, int port) > { > struct vsc73xx_portinfo *portinfo; > @@ -1708,6 +1727,8 @@ static const struct dsa_switch_ops vsc73xx_ds_ops = { > .port_setup = vsc73xx_port_setup, > .port_enable = vsc73xx_port_enable, > .port_disable = vsc73xx_port_disable, > + .port_bridge_join = vsc73xx_port_bridge_join, > + .port_bridge_leave = vsc73xx_port_bridge_leave, > .port_change_mtu = vsc73xx_change_mtu, > .port_max_mtu = vsc73xx_get_max_mtu, > .port_stp_state_set = vsc73xx_port_stp_state_set, > -- > 2.34.1 > Making a mental note here, out loud, that after this patch set is merged, "*tx_fwd_offload = true" should be absorbed into dsa_tag_8021q_bridge_join(). Then, you could simply point ds->ops->port_bridge_join() and ds->ops->port_bridge_leave() to the generic tag_8021q methods, without the need for intermediary shims. Looking at my upcoming schedule, I'll probably forget. Could you please try to remember to do it?