CV-Bowen opened a new pull request, #22565:
URL: https://github.com/apache/nuttx/pull/22565

   ## Summary
   
   Follow-ups for the vhost (device-side) CAN backend, plus one vhost-crypto
   fix, in commit order:
   
   - `drivers/vhost/vhost-can: carry the CAN FD BRS flag over the wire`: the
     wire format only encoded the FD flag, so Bit Rate Switch was lost in both
     directions, and the frame type was guessed from the length, so an 8-byte
     FD frame went out as classic. Add `VIRTIO_CAN_FLAGS_BRS` (0x1000) and take
     FD/BRS from `canfd_frame.flags`.
   - `drivers/vhost/vhost-can: decouple START/STOP from the bridged netdev`:
     START returned early when the bridged interface was already up, so the
     socket poll was never registered and RX stalled. Register the poll at
     probe; START/STOP only bring the interface up and down.
   - `drivers/vhost/vhost-can: add static RX filters for the bridged socket`:
     an optional `CAN_RAW` filter list in the NuttX-private device config
     (`struct vhost_can_config_s`), offered through the private feature bit
     `VIRTIO_CAN_F_RX_FILTER` (5), applied to the bridge socket at probe.
     Bit 4 (`VIRTIO_CAN_F_IFNAME`) is reserved for a driver that takes its
     interface name from the same private config.
   - `drivers/vhost/vhost-can: use the CAN features negotiated at probe`: the
     TX path read the features from the resource table for every frame;
     `vhost_get_features()` at probe already caches the negotiated set in
     `hdev->features`.
   - `drivers/vhost/vhost-crypto: report a driver error on cipher, hash and
     MAC`: these paths returned `crypto_invoke()` alone, which leaves a driver
     error in `crp_etype`, so a failed request reached the peer as a success.
     Read `crp_etype` afterwards, as the AEAD paths do.
   
   ## Impact
   
   vhost-can only, plus the three vhost-crypto paths. `VIRTIO_CAN_FLAGS_BRS`,
   `VIRTIO_CAN_F_RX_FILTER` and the filter fields of the NuttX-private
   `struct vhost_can_config_s` are NuttX extensions, not part of the OASIS
   VirtIO CAN device; a peer that does not negotiate the feature is
   unaffected. `vhost_can_config_s` grows by the filter list, so a resource
   table that carries it must be rebuilt.
   
   ## Testing
   
   Host: Ubuntu 22.04.5 LTS x86_64, QEMU version 10.2.1, sim: cc (Ubuntu 
13.1.0-8ubuntu1~22.04) 13.1.0, qemu-armv8a: aarch64-none-elf-gcc (Arm GNU 
Toolchain 12.2.Rel1 (Build arm-12.24)) 12.2.1 20221205
   
   Each commit builds qemu-armv8a:rpproxy + `CONFIG_NET_CAN=y
   CONFIG_DRIVERS_VHOST_CAN=y CONFIG_ALLOW_BSD_COMPONENTS=y CONFIG_CRYPTO=y
   CONFIG_CRYPTO_CRYPTODEV=y CONFIG_DRIVERS_VHOST_CRYPTO=y` with 0 warnings.
   
   No regression in rpmsg: sim:rpserver/rpproxy and 
qemu-armv8a:rpserver/rpproxy boot and pass the fixed rpmsg cases (dump, ping, 
rpmsgfs; 15/15). No regression in virtio: qemu-armv8a:netnsh boot and pass the 
fixed virtio cases (rng, blk on mmio and pci, net, 9p; 24/24). qemu-armv8a was 
built with LIBC_ENVPATH and BINFMT_CHECKEXEC disabled, which current master 
needs for nxinit to start nsh there; unrelated to this change. checkpatch 
passes.
   


-- 
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