xiaoxiang781216 commented on PR #20519:
URL: https://github.com/apache/nuttx/pull/20519#issuecomment-6097924050

   > Hi @zhhyu7, thanks for the suggestion.
   > 
   > I agree that a `netdev_lowerhalf_s`-based bridge under 
`drivers/net/bridge` would be the cleaner design: br0 would be a regular 
lowerhalf netdev, the upper half would handle RX/TX and locking, and I could 
drop `BRIDGE_POLL` in devif and some of the hooks.
   > 
   
   Ethernet bridge is a pure L2 concept, it's better to implement at the driver 
level since it's a clearer design.
   
   > My hesitation is driver coverage. A quick count of the current tree 
(files, so only approximate):
   > 
   > * **Lowerhalf** (`netdev_lower_register`): about 22 files. In `arch/` that 
is 4 in risc-v, 2 in xtensa, and 1 each in arm, mips and sim. The rest is under 
`drivers/` (net, can, virtio, vhost, usb).
   > * **Legacy** (`netdev_register`): about 85 files. `arch/arm` alone has 40, 
and there are 10 in risc-v and 3 in arm64. `drivers/net` has 12, plus wireless, 
usb and a few board-level drivers.
   > 
   
   yes, that's why we should do more feature with the new model to encourage 
the implementer do the migration as possible as they can. VLAN is implemented 
based on upper/lower half in the same principle.
   
   > So most of the in-tree Ethernet MACs (STM32, SAMV7, i.MX RT, Kinetis, 
PIC32MZ, ...) are still legacy. A lowerhalf-only bridge would leave the main 
use case of this PR unsupported: Ethernet<->Wi-Fi on the PIC32MZ, whose 
Ethernet driver is legacy while its Wi-Fi driver is lowerhalf. To support it I 
would first have to migrate `pic32mz_ethernet` to lowerhalf, which is a 
separate PR and can only be tested on hardware.
   > 
   
   With the AI, it's very simple to convert the driver from the old 
implementation to new one, so it isn't a big problem now.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to