完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好,我在使用OK1028A板子时发现一个问题:
配置了一个bridge,把所有口(eno0,swp0-3)都加入这个网桥。 将PC先接到swp0上,bridge fdb show里面查到了两条mac表(一条在bridge上,一条在swp0上切类型为self): root@forlinx:~# bridge fdb | grep 0a:35 00:e0:99:00:0a:35 dev swp0 vlan 100 master Bridge 00:e0:99:00:0a:35 dev swp0 vlan 100 self root@forlinx:~# 然后拔掉PC的网线,还剩下一条mac表(self类型的那条),并且永远不老化: root@forlinx:~# bridge fdb | grep 0a:35 00:e0:99:00:0a:35 dev swp0 vlan 100 self root@forlinx:~# 然后PC接到eno0上,又生成了一条新的mac表,但是上面那条仍然存在,并没有刷新,这样就会导致流量转发出问题。 root@forlinx:~# bridge fdb | grep 0a:35 00:e0:99:00:0a:35 dev eno0 vlan 100 master Bridge 00:e0:99:00:0a:35 dev swp0 vlan 100 self root@forlinx:~# 另外:如果PC只是在swp0~3之间切换,mac表可以正常刷新的。感觉就是swp口与eno0之间切换会出问题。请帮忙看看啥原因? |
|
相关推荐
5个回答
|
|
|
|
|
|
操作很简单,就是把eno0和swp0~3全部加入bridge中,然后按照上面的步骤操作一下,就能复现:
ip link set eno0 up ip link set eno2 up ip link set swp0 up ip link set swp1 up ip link set swp2 up ip link set swp3 up ip link add Bridge up type bridge vlan_filtering 1 ip link set eno0 master Bridge ip link set swp0 master Bridge ip link set swp1 master Bridge ip link set swp2 master Bridge ip link set swp3 master Bridge bridge vlan add vid 100 dev Bridge self bridge vlan add vid 100 dev eno0 master pvid untagged bridge vlan add vid 100 dev swp0 master pvid untagged bridge vlan add vid 100 dev swp1 master pvid untagged bridge vlan add vid 100 dev swp2 master pvid untagged bridge vlan add vid 100 dev swp3 master pvid untagged root@forlinx:~# brctl show bridge name bridge id STP enabled inte**ces Bridge 8000.1636ad6de5ed no eno0 swp0 swp1 swp2 swp3 docker0 8000.0242e37c4144 no root@forlinx:~# bridge vlan port vlan ids eno0 1 Egress Untagged 100 PVID Egress Untagged swp0 1 Egress Untagged 100 PVID Egress Untagged swp1 1 Egress Untagged 100 PVID Egress Untagged swp2 1 Egress Untagged 100 PVID Egress Untagged swp3 1 Egress Untagged 100 PVID Egress Untagged docker0 1 PVID Egress Untagged Bridge 1 PVID Egress Untagged 100 |
|
|
|
我在执行下列命令的过程中,出现了报错:
root@forlinx:~# bridge vlan add vid 100 dev swp0 master pvid untagged [ 209.302944] mscc_felix 0000:00:00.5: Port already has a native VLAN: 1 [ 209.309611] mscc_felix 0000:00:00.5: Failed to add VLAN 100 to port 0: -16 [ 209.317637] mscc_felix 0000:00:00.5: Port already has a native VLAN: 1 [ 209.324708] mscc_felix 0000:00:00.5: Failed to add VLAN 100 to port 4: -16 root@forlinx:~# bridge vlan add vid 100 dev swp1 master pvid untagged [ 265.085154] mscc_felix 0000:00:00.5: Port already has a native VLAN: 1 [ 265.091739] mscc_felix 0000:00:00.5: Failed to add VLAN 100 to port 1: -16 [ 265.098665] mscc_felix 0000:00:00.5: Port already has a native VLAN: 1 [ 265.105224] mscc_felix 0000:00:00.5: Failed to add VLAN 100 to port 4: -16 root@forlinx:~# bridge vlan add vid 100 dev swp2 master pvid untagged [ 273.630731] mscc_felix 0000:00:00.5: Port already has a native VLAN: 1 [ 273.637311] mscc_felix 0000:00:00.5: Failed to add VLAN 100 to port 2: -16 [ 273.644244] mscc_felix 0000:00:00.5: Port already has a native VLAN: 1 [ 273.650823] mscc_felix 0000:00:00.5: Failed to add VLAN 100 to port 4: -16 root@forlinx:~# bridge vlan add vid 100 dev swp3 master pvid untagged [ 278.387161] mscc_felix 0000:00:00.5: Port already has a native VLAN: 1 [ 278.393733] mscc_felix 0000:00:00.5: Failed to add VLAN 100 to port 3: -16 [ 278.401709] mscc_felix 0000:00:00.5: Port already has a native VLAN: 1 [ 278.408752] mscc_felix 0000:00:00.5: Failed to add VLAN 100 to port 4: -16 |
|
|
|
每次配PVID时候都会报错
[ 209.302944] mscc_felix 0000:00:00.5: Port already has a native VLAN: 1 [ 209.309611] mscc_felix 0000:00:00.5: Failed to add VLAN 100 to port 0: -16 [ 209.317637] mscc_felix 0000:00:00.5: Port already has a native VLAN: 1 [ 209.324708] mscc_felix 0000:00:00.5: Failed to add VLAN 100 to port 4: -16 能请你们开发看看吗? |
|
|
|
修改一下驱动:
+++ b/drivers/net/ethernet/mscc/ocelot.c @@ -238,12 +238,12 @@ static int ocelot_port_set_native_vlan(struct ocelot *ocelot, int port, if (ocelot_port->vid != vid) { /* Always permit deleting the native VLAN (vid = 0) */ - if (ocelot_port->vid && vid) { + /*if (ocelot_port->vid && vid) { dev_err(ocelot->dev, "Port already has a native VLAN: %dn", ocelot_port->vid); return -EBUSY; - } + }*/ ocelot_port->vid = vid; } |
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
1820 浏览 1 评论
synopsys 的design ware:DW_fpv_div,浮点数除法器,默认32位下,想提升覆盖率(TMAX),如果用功能case去提升覆盖率呢?
2269 浏览 1 评论
RK3588 GStreamer调试四路鱼眼摄像头四宫格显示报错
5092 浏览 1 评论
【飞凌嵌入式OK3576-C开发板体验】RKNN神经网络-YOLO图像识别
254 浏览 0 评论
【飞凌嵌入式OK3576-C开发板体验】SSH远程登录网络配置及CAN通讯
1336 浏览 0 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-19 02:08 , Processed in 2.852556 second(s), Total 45, Slave 40 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号