Netdev List
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: Frank Wunderlich <frank-w@public-files.de>
Cc: "Arınç ÜNAL" <arinc.unal@arinc9.com>,
	"Felix Fietkau" <nbd@nbd.name>, netdev <netdev@vger.kernel.org>,
	erkin.bozoglu@xeront.com, "Andrew Lunn" <andrew@lunn.ch>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"John Crispin" <john@phrozen.org>,
	"Mark Lee" <Mark-MC.Lee@mediatek.com>,
	"Lorenzo Bianconi" <lorenzo@kernel.org>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"Landen Chao" <Landen.Chao@mediatek.com>,
	"Sean Wang" <sean.wang@mediatek.com>,
	"DENG Qingfang" <dqfext@gmail.com>
Subject: Re: Choose a default DSA CPU port
Date: Tue, 7 Mar 2023 19:43:23 +0200	[thread overview]
Message-ID: <20230307174323.sbzhb7gy6blgj2jf@skbuf> (raw)
In-Reply-To: <trinity-a6b4447d-52b8-42a6-a4ce-b06543872534-1678126825554@3c-app-gmx-bs54>

On Mon, Mar 06, 2023 at 07:20:25PM +0100, Frank Wunderlich wrote:
> is it possible to map this function only to mt7530, not mt7531?
> 
> as one way i would add a check for the chip
> 
> if (priv->id != ID_MT7530) { return NULL; }
> //existing content for mt7531

yeah, returning "NULL" to ds->ops->preferred_default_local_cpu_port()
would mean "don't know, don't care" and DSA would choose by itself.

although I feel we're not at the stage where we should discuss about
that just yet.

> where did you find the comment about multicast?

well, I didn't find "link-local multicast", but "BPDU to CPU port" and
may have ran a little bit too far with that info.

If you search for the "Bridge Group Address" keyword in IEEE 802.1Q or
IEEE 802.1D (older) documents, you'll see that STP BPDUs are sent to a
reserved multicast MAC DA of 01-80-C2-00-00-00, which is link-local,
meaning that switches don't forward it but trap it. Since I knew that,
I just assumed that "BPDU to CPU port" means "trapping of any frames
with that MAC DA to the CPU port", since if I were a hardware designer,
that's what I would do. It's possible to identify STP BPDUs (to trap
just those) by examining the LLC header, but I wouldn't bother since the
MAC DA is reserved for this kind of stuff and I'd be locking myself out
of being compatible with possible protocol changes in the future.

> https://elixir.bootlin.com/linux/v6.3-rc1/source/drivers/net/dsa/mt7530.c has
> "multicast" only in the packet-counters (mib_desc)
> 
> > The next most obvious thing would be L2 PTP (ptp4l -2), but since mt7530
> > doesn't support hw timestamping, you'd need to try software timestamping
> > instead ("ptp4l -i swpX -2 -P -S -m", plus the equivalent command on a
> > link partner).
> 
> have not done anything with l2 p2p yet, and no server running...i'm not sure
> i can check this the right way.

Anyway, it doesn't have to be PTP, it can be literally any application
using a PF_PACKET socket to send sequence-numbered packets towards a
mt7530 port with the 01:80:c2:00:00:00 MAC DA, and using 2 tcpdump
instances on the 2 GMACs to check whether packets are received once or
twice.

If this is still too complicated, just send 5 actual BPDUs and see if
you receive them on both CPU ports:

mausezahn eth0 -b 01:80:c2:00:00:00 -c 5 -t bpdu

  reply	other threads:[~2023-03-07 17:49 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-24 20:44 Aw: Re: Choose a default DSA CPU port Frank Wunderlich
2023-02-24 21:08 ` Vladimir Oltean
2023-02-25 11:14   ` Aw: " Frank Wunderlich
2023-02-25 13:50   ` Frank Wunderlich
2023-02-25 16:11     ` Arınç ÜNAL
2023-02-25 19:56       ` Arınç ÜNAL
2023-02-26 12:12         ` Aw: " Frank Wunderlich
2023-02-28  9:54           ` Arınç ÜNAL
2023-02-28 11:58           ` Vladimir Oltean
2023-02-28 13:48             ` Frank Wunderlich
2023-02-28 22:56               ` Vladimir Oltean
2023-03-01  6:38                 ` Frank Wunderlich
2023-03-01 12:37                   ` Vladimir Oltean
2023-03-06 18:20                     ` Aw: " Frank Wunderlich
2023-03-07 17:43                       ` Vladimir Oltean [this message]
2023-04-13 18:09                         ` Frank Wunderlich
2023-04-13 21:30                           ` Frank Wunderlich
2023-05-16 19:29             ` Arınç ÜNAL
2023-05-17 16:10               ` Vladimir Oltean
2023-05-17 16:14                 ` Arınç ÜNAL
2023-05-17 16:16                   ` Vladimir Oltean
2023-05-18 10:36                     ` Arınç ÜNAL
2023-05-18 14:24                       ` Vladimir Oltean
2023-05-19  9:00                         ` Arınç ÜNAL
2023-05-19 23:54                           ` Vladimir Oltean
  -- strict thread matches above, loose matches on Subject: below --
2023-02-18 17:07 Arınç ÜNAL
2023-02-18 20:17 ` Frank Wunderlich
2023-02-18 20:17 ` Florian Fainelli
2023-02-18 20:52 ` Vladimir Oltean
2023-02-19  7:35   ` Arınç ÜNAL
2023-02-19  9:49     ` Aw: " Frank Wunderlich
2023-02-21  0:27       ` Vladimir Oltean
2023-02-22 17:17         ` Aw: " Frank Wunderlich
2023-02-22 18:06           ` Vladimir Oltean
2023-02-22 18:08             ` Arınç ÜNAL
2023-02-22 19:34               ` Vladimir Oltean
2023-02-22 19:42                 ` Arınç ÜNAL
2023-02-24 18:07                   ` Aw: " Frank Wunderlich
2023-02-24 18:13                     ` Vladimir Oltean
2023-02-24 18:16                       ` Vladimir Oltean
2023-02-22 19:39           ` Vladimir Oltean

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230307174323.sbzhb7gy6blgj2jf@skbuf \
    --to=olteanv@gmail.com \
    --cc=Landen.Chao@mediatek.com \
    --cc=Mark-MC.Lee@mediatek.com \
    --cc=andrew@lunn.ch \
    --cc=arinc.unal@arinc9.com \
    --cc=dqfext@gmail.com \
    --cc=erkin.bozoglu@xeront.com \
    --cc=f.fainelli@gmail.com \
    --cc=frank-w@public-files.de \
    --cc=john@phrozen.org \
    --cc=lorenzo@kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=nbd@nbd.name \
    --cc=netdev@vger.kernel.org \
    --cc=sean.wang@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox