Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp1315537lqb; Thu, 18 Apr 2024 06:36:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU8mZQ8mAS59kR8314YoPLs7XRUAZ/Djlret32BcCv52etuPxz2q2GlAdQ7zFZ5ndXI7ksb78rdf5V7f7JRNzZAJCg2FUePgpuspKBIsA== X-Google-Smtp-Source: AGHT+IFRgGZnotbcf0myniKwF8iezYQQxiHxwjh5chqNgBuHB2ZjYV5Hjgrjd33lokMJ0d3mbVet X-Received: by 2002:ac2:44d9:0:b0:515:cb19:41f4 with SMTP id d25-20020ac244d9000000b00515cb1941f4mr1730614lfm.59.1713447371567; Thu, 18 Apr 2024 06:36:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713447371; cv=pass; d=google.com; s=arc-20160816; b=p78a+1gW6E+nFFHP3/o67afeyVHwmyNkSPN8hP55njCwXkfkMwVhDzIboM9wAzX1di huD1k0x3afkF5ebEXM7ABiQDkEiD4sKD3wZCtcxDhdI8TMS7SOz9Xrad8xhoKLGJCbAr K+Z3V4LUf/eYo/4RNL/zibVgx+2uOl3jrT7OsHqETHYDz88vOP3qbox/gbePjn5keOWW GsfpcZCVqiQnGpa4/Ebf/OE1FQhAGLFvRp8RL9NEEOxzcUcGN4t166V30rKA1i6dGjz6 geaaQZ5H4eSEWdvbf8toTINE7rmp3O4C4YyD9cFT1VdDeTAVFf01paU9uuIJVE+mDF99 QyzQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=g5fHXSPxLQIiGSd9D1sItraRBNGWAeaK2D+DAOeVHio=; fh=6QwuyRHU5cWmrtyELfFcQHWAm44NxPW/1TQQFtzmRZU=; b=cu4KxLpWIxTkZ5EK2lp8Ajyw5oTmnJqwXokTWsALWDPjrSr9kQJYDVaHzDB7Xo8grM O5OgSctQFJZOukjpv1lK0Vnhl5B8Af4qGM2OLEcjOLKTjjhuu9OmeC7sZgx+jvq60OYl rdiFTH+JhqwBdHVL1NZ64fYa/sQxz/v+nLW1sAc2O43Xu2kYQ5YMD+PjXSohjXZ41Uyg Tm08CMgBGYFvhxClqTZTscMVXatLHHcK/KeXVSovJbyYeKnBp0ElqPYTYK9aIXb2nOA+ tQrjq0GC1phTAPgYxp9Bejf778K+xXJ4WL8vjQ+WdbEFKnNBP0SkajP84hYamihWIgAA j98g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=GK6G+jI2; 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-150179-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150179-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. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id q7-20020a170906360700b00a522e89cb42si912809ejb.476.2024.04.18.06.36.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 06:36:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-150179-linux.lists.archive=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=GK6G+jI2; 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-150179-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150179-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 A45B81F22F76 for ; Thu, 18 Apr 2024 13:36:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C8894161320; Thu, 18 Apr 2024 13:35:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GK6G+jI2" 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 9FE1369DF5; Thu, 18 Apr 2024 13:35:55 +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=1713447357; cv=none; b=bzOlEAOBiCGOCxee8oKiAAd+X+tc6FPT1f189dQfVRI5qq8gt6XrsmX0WeTW5GBK5N9JvO7RAKE3+nuCQAQuxOGuVAVjxxBjJ1aE8noHQirluNgTzx3pIRaG8HD7wLUJ90KHPBanVCiBrcivQgD1usu1Cp29gzUjE4IUhLWJac8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713447357; c=relaxed/simple; bh=ugSV+/MOGhq9n75FEgYpVvgdy8aFV/GnMHdXlvDcXZs=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=oPkzXRYaODBbY2jVdHOg1YTlQL9RQLd173AuzKM93qkTThIkTeBl+Kovn3GbqRpfrZI85KrS9/hBad68BEiYkZwOMAEG51C0yTGjhW9m4d9emE2tMhxwshebc8Kc40dMVwBen5RZ8gBZ2Hhl243PfIn0Hu4wAfRyOEyN6xBGOJc= 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=GK6G+jI2; arc=none smtp.client-ip=209.85.208.171 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-lj1-f171.google.com with SMTP id 38308e7fff4ca-2da888330b1so13805521fa.1; Thu, 18 Apr 2024 06:35:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713447354; x=1714052154; darn=vger.kernel.org; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=g5fHXSPxLQIiGSd9D1sItraRBNGWAeaK2D+DAOeVHio=; b=GK6G+jI262VQeBRLbEaL1SYqEEXX4M3DomHgmG4EaVcZbDRUZ3gHobf7bcIOS19lmO 5ayOlra2d0JSqSNOzO1vYzCWalJFweik+Cf4XNRXrYS4aUb62jd1EausY7wusUKBcunx seJSWYRJb3GT40z8I0K6M7r0guNrUcsGAsg8KWBIuLAkA35qbkDAIlcwTJ2xwJy0QZ7F OjpKdJ4L13O0Pylnn6QSYYmAI66WzxsewWhy2GJ48nblwu6wBRGk7vd2FL1ro7VOAchW qj8PLwic2n9t94jVblEkBDa2ldkKRcyKYCLU+4ljc2iNlDJ2wET5xVWJX8tK0cixxZYL DUEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713447354; x=1714052154; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=g5fHXSPxLQIiGSd9D1sItraRBNGWAeaK2D+DAOeVHio=; b=nCNuJIMsv+8P2fqDRA8mlpOT/DbU0QQNxtHp7R3WcsTtkA8qZhZU5ldpRiKXzLiGuC B1hclH4gTKqhX0snH71231hj9YaGGEnOLYH2Ts/tD17nW8+iVRWdRUEdh5no3fikdiNm oTgTPBtwgD1qrrWuKbZEV+uKxVwcmvhqRuF0TQw8BbcA31BBrTPQIC9fWlgGRmIEAOKz X5cmbAB7mgBBvN0MeT1Hmq8ZjuecJD4qhNvou0uZuuAgklQ28OuWtraoo+TMohyGH+Gp nQK8qwW9xiAqwsT7q8hXZFHOgV0jp023CbCDvnh7hL3FuYI/3Ri7YUO9tWRX487Wcdr7 x7aQ== X-Forwarded-Encrypted: i=1; AJvYcCUW95JS/ycF/TzaG/nN5rXvUohSPr/71rEwaiZsoIx+dy+JXsShl6cO7BV1K5ENFvVUGXHCHmfcJh8pbCMhTnPMc6ZcrpSW36bLJGdP X-Gm-Message-State: AOJu0YyQF12FS6Dy42UQl3qFxvMlfmBH8qT5qAtwr3WnNCbMB8Tpdsgg LsHwNcblASYVx3VI6lb8q8vKobems8FFRdK+GIoxtNgii9i+aCrc X-Received: by 2002:a2e:9104:0:b0:2db:218:b050 with SMTP id m4-20020a2e9104000000b002db0218b050mr1722446ljg.34.1713447353460; Thu, 18 Apr 2024 06:35:53 -0700 (PDT) Received: from localhost (static-193-12-47-89.cust.tele2.se. [193.12.47.89]) by smtp.gmail.com with ESMTPSA id h25-20020a2e3a19000000b002da968f03f9sm198269lja.89.2024.04.18.06.35.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 06:35:52 -0700 (PDT) From: Casper Andersson To: Lukasz Majewski Cc: netdev@vger.kernel.org, Paolo Abeni , Andrew Lunn , Eric Dumazet , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , Oleksij Rempel , Tristram.Ha@microchip.com, Sebastian Andrzej Siewior , Ravi Gunasekaran , Simon Horman , Nikita Zhandarovich , Murali Karicheri , Jiri Pirko , Dan Carpenter , Ziyang Xuan , Shigeru Yoshida , "Ricardo B. Marliere" , linux-kernel@vger.kernel.org Subject: Re: [net-next PATCH v5 1/4] net: hsr: Provide RedBox support (HSR-SAN) In-Reply-To: <20240416150359.7362c762@wsk> References: <20240415124928.1263240-1-lukma@denx.de> <20240415124928.1263240-2-lukma@denx.de> <86mspt7glf.fsf@gmail.com> <20240416150359.7362c762@wsk> Date: Thu, 18 Apr 2024 15:35:52 +0200 Message-ID: <86bk66hjyf.fsf@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 Hi, Sorry for the late reply, I was awaiting confirmation on what I can say about the hardware I have access to. They won't let me say the name :( but I can give some details. On 2024-04-16 15:03 +0200, Lukasz Majewski wrote: >> On 2024-04-02 10:58 +0200, Lukasz Majewski wrote: >> > Changes for v3: >> > >> > - Modify frame passed Port C (Interlink) to have RedBox's source >> > address (SA) This fixes issue with connecting L2 switch to >> > Interlink Port as switches drop frames with SA other than one >> > registered in their (internal) routing tables. >> >> > + /* When HSR node is used as RedBox - the frame received >> > from HSR ring >> > + * requires source MAC address (SA) replacement to one >> > which can be >> > + * recognized by SAN devices (otherwise, frames are >> > dropped by switch) >> > + */ >> > + if (port->type == HSR_PT_INTERLINK) >> > + ether_addr_copy(eth_hdr(skb)->h_source, >> > + port->hsr->macaddress_redbox); >> >> I'm not really understanding the reason for this change. Can you >> explain it in more detail? > > According to the HSR standard [1] the RedBox device shall work as a > "proxy" [*] between HSR network and SAN (i.e. "normal" ethernet) > devices. > > This particular snippet handles the situation when frame from HSR node > is supposed to be sent to SAN network. In that case the SA of HSR > (SA_A) is replaced with SA of RedBox (SA_RB) as the MAC address of > RedBox is known and used by SAN devices. > > > Node A hsr1 |======| hsr1 Node Redbox | | > (SA_A) [**] | | eth3 |---| ethX SAN > | | (SA_RB)| | (e.g switch) > > > (the ====== represents duplicate link - like lan1,lan2) > > If the SA_A would be passed to SAN (e.g. switch) the switch could get > confused as also RedBox MAC address would be used. Hence, all the > frames going out from "Node Redbox" have SA set to SA_RB. > > According to [1] - RedBox shall have the MAC address. > This is similar to problem from [2]. Thanks for the explanation, but I still don't quite follow in what way the SAN gets confused. "also RedBox MAC address would be used", when does this happen? Do you mean that some frames from Node A end up using the RedBox MAC address so it's best if they all do? I see there is already some address replacement going on in the HSR interface, as you pointed out in [2]. And I get your idea of being a proxy. If no one else is opposed to this then I'm fine with it too. >> The standard does not say to modify the >> SA. However, it also does not say to *not* modify it in HSR-SAN mode >> like it does in other places. In HSR-HSR and HSR-PRP mode modifying >> SA breaks the duplicate discard. > > IMHO, the HSR-SAN shall be regarded as a "proxy" [*] between two types > (and not fully compatible) networks. > >> So keeping the same behavior for all >> modes would be ideal. >> >> I imagine any HW offloaded solutions will not modify the SA, so if >> possible the SW should also behave as such. > > The HW offloading in most cases works with HSR-HSR setup (i.e. it > duplicates frames automatically or discards them when recived - like > ksz9477 [3]). > > I think that RedBox HW offloading would be difficult to achieve to > comply with standard. One "rough" idea would be to configure > aforementioned ksz9477 to pass all frames in its HW between SAN and HSR > network (but then it wouldn't filter them). I don't know anything about ksz9477. The hardware I have access to is supposed to be compliant with 2016 version in an offloaded situation for all modes (HSR-SAN, PRP-SAN, HSR-PRP, HSR-HSR). Though, I haven't verified if the operation is fully according to standard. It does not modify any addresses in HW. Does the interlink port also reach the drivers? Does it call port_hsr_join and try to join as an HSR port? Do we maybe need a separate path or setting for configuring the interlink in the different modes (SAN, HSR, PRP interlink)? > Notes: > > [*] - However there is no specific "guidelines" on how the "proxy" > shall be implemented. > > [**] - With current approach - the SAN MAC addresses are added to > "node table" of Node A. For Node RedBox those are stored in a separate > ProxyNodeTable. I'm not sure if this is the best possible approach > [***], as ideally only MAC addresses of HSR "network" nodes shall be > visible. > > [***] - I think that this "improvement" could be addressed when HSR > support is added to Linux as it is the pre-requisite to add support for > it to iproute2. Afterwards, the code can be further refined (as it > would be added to net-next anyway). > > [****] - As I'm now "on the topic" - I can share full setup for busybox > to run tests included to v5 of this patch set. > > > Links: > > [1] - IEC 62439-3:2021 > > [2] - > https://elixir.bootlin.com/linux/latest/source/net/hsr/hsr_framereg.c#L397 > > [3] - > https://elixir.bootlin.com/linux/latest/source/drivers/net/dsa/microchip/ksz9477.c#L1341 BR, Casper