-
-
Notifications
You must be signed in to change notification settings - Fork 11.5k
realtek: rtl93xx: fix incorrect physical port selection #19802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
realtek: rtl93xx: fix incorrect physical port selection #19802
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice find
@@ -153,7 +153,8 @@ static void rtl839x_create_tx_header(struct p_hdr *h, unsigned int dest_port, in | |||
static void rtl930x_create_tx_header(struct p_hdr *h, unsigned int dest_port, int prio) | |||
{ | |||
h->cpu_tag[0] = 0x8000; /* CPU tag marker */ | |||
h->cpu_tag[1] = h->cpu_tag[2] = 0; | |||
h->cpu_tag[1] = 0x0100; /* Set FWD_TYPE to PHYSICAL (1) */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fear that this will not play well with trunks (if we ever get them in place). Please check if logical (2) works the same for now.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not used to seeing LLDP undergo load-balancing when ports are trunked - doesn't LLDP still relate to the underlying physical port even if a trunk is created - that is the "link layer" in LLDP. LLDP has limited usefulness when troubleshooting LAG and MLAG installations if all you see if the trunk ID and not the underlying interface that is connected from the peer switch.
But maybe I am misunderstanding this, I am still going to build the change and test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still working with 0x0200
instead of 0x0100
for cpu_tag[1]
in these functions (testing on rtl930x device).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As tiny as this change is ... The CPU port handling is tricky (e.g. https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=a22d359fa56fe06ebd74f87eccacf56b3752da58). So we should be sure if we
- can go for a one-config-fits-all-packets solution or
- if we must create headers per packet individually
Tests will tell.
@@ -168,7 +169,8 @@ static void rtl930x_create_tx_header(struct p_hdr *h, unsigned int dest_port, in | |||
static void rtl931x_create_tx_header(struct p_hdr *h, unsigned int dest_port, int prio) | |||
{ | |||
h->cpu_tag[0] = 0x8000; /* CPU tag marker */ | |||
h->cpu_tag[1] = h->cpu_tag[2] = 0; | |||
h->cpu_tag[1] = 0x0100; /* Set FWD_TYPE to PHYSICAL (1) */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
02a1f32
to
4c91e32
Compare
Final questions before approving this:
|
This comment was marked as resolved.
This comment was marked as resolved.
When testing LLDP and STP, we observed that locally generated multicast packets (e.g. LLDP, STP) were not restricted to the designated output port(s). For example, when transmitting on `lan1`, the same packet was also forwarded to other ports such as `lan2`. Steps to reproduce: 1. Configure lldpd to use `lan1` in UCI and restart the service 2. Connect devices to `lan1` and `lan2` 3. Observe that the device on `lan2` still receives LLDP packets The issue was caused by an incorrect `FWD_TYPE` setting in the TX CPU TAG, which failed to enforce the selected egress port(s). Fix this by updating the TX CPU TAG to set `FWD_TYPE` correctly, ensuring that locally generated packets are transmitted only on the intended port(s). Signed-off-by: Issam Hamdi <ih@simonwunderlich.de> Link: openwrt#19802 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4c91e32
to
8c42e63
Compare
When testing LLDP and STP, we observed that locally generated multicast packets (e.g. LLDP, STP) were not restricted to the designated output port(s). For example, when transmitting on `lan1`, the same packet was also forwarded to other ports such as `lan2`. Steps to reproduce: 1. Configure lldpd to use `lan1` in UCI and restart the service 2. Connect devices to `lan1` and `lan2` 3. Observe that the device on `lan2` still receives LLDP packets The issue was caused by an incorrect `FWD_TYPE` setting in the TX CPU TAG, which failed to enforce the selected egress port(s). Fix this by updating the TX CPU TAG to set `FWD_TYPE` correctly, ensuring that locally generated packets are transmitted only on the intended port(s). Signed-off-by: Issam Hamdi <ih@simonwunderlich.de> Link: openwrt#19802 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
When testing LLDP and STP, we observed that locally generated multicast packets (e.g. LLDP, STP) were not restricted to the designated output port(s). For example, when transmitting on `lan1`, the same packet was also forwarded to other ports such as `lan2`. Steps to reproduce: 1. Configure lldpd to use `lan1` in UCI and restart the service 2. Connect devices to `lan1` and `lan2` 3. Observe that the device on `lan2` still receives LLDP packets The issue was caused by an incorrect `FWD_TYPE` setting in the TX CPU TAG, which failed to enforce the selected egress port(s). Fix this by updating the TX CPU TAG to set `FWD_TYPE` correctly, ensuring that locally generated packets are transmitted only on the intended port(s). Signed-off-by: Issam Hamdi <ih@simonwunderlich.de> Link: openwrt#19802 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
When testing LLDP and STP, we observed that locally generated multicast packets (e.g. LLDP, STP) were not restricted to the designated output port(s). For example, when transmitting on `lan1`, the same packet was also forwarded to other ports such as `lan2`. Steps to reproduce: 1. Configure lldpd to use `lan1` in UCI and restart the service 2. Connect devices to `lan1` and `lan2` 3. Observe that the device on `lan2` still receives LLDP packets The issue was caused by an incorrect `FWD_TYPE` setting in the TX CPU TAG, which failed to enforce the selected egress port(s). Fix this by updating the TX CPU TAG to set `FWD_TYPE` correctly, ensuring that locally generated packets are transmitted only on the intended port(s). Signed-off-by: Issam Hamdi <ih@simonwunderlich.de> Link: openwrt/openwrt#19802 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
When testing LLDP and STP, we observed that locally generated multicast packets (e.g. LLDP, STP) were not restricted to the designated output port(s). For example, when transmitting on
lan1
, the same packet was also forwarded to other ports such aslan2
.Steps to reproduce:
lan1
in UCI and restart the servicelan1
andlan2
lan2
still receives LLDP packetsThe issue was caused by an incorrect
FWD_TYPE
setting in the TX CPU TAG, which failed to enforce the selected egress port(s).Fix this by updating the TX CPU TAG to set
FWD_TYPE
correctly, ensuring that locally generated packets are transmitted only on the intended port(s).