History

fwctl/bnxt: Add DMA buffer support for HWRM commands

Several HWRM commands carry __le64 DMA address fields in their input structures; firmware reads from or writes to the memory those addresses point to. Have a static per-command descriptor table in the driver that records the details of the DMA fields in each supported HWRM input struct. When a DMA-bearing HWRM command arrives, the driver reads the userspace pointer out of each declared address field and clears the field, allocates a DMA-coherent kernel buffer sized from the command's own length information, copies data to/from the userspace pointer, and patches the field with the real DMA bus address before the command is sent to firmware. Responses are copied back to the original userspace pointer afterward. Scope-gated allow-list and timeout value list are updated with the new the commands.

Pavan Chebbi committed 3 months ago

Commit ee1c2631 parent a3739342 files · +395 −5Browse files

Showing the changes to include/uapi (1 of 2 files). Show all

Unified · Split

include/uapi/fwctl/bnxt.h+4−0
@@ -12,6 +12,7 @@ enum fwctl_bnxt_commands { · 11 unmodified lines
1212 FWCTL_BNXT_INLINE_COMMANDS = 0,
1313 FWCTL_BNXT_QUERY_COMMANDS,
1414 FWCTL_BNXT_SEND_COMMANDS,
15+ FWCTL_BNXT_DMA_COMMANDS,
1516 };
1617
1718 /**
@@ -23,4 +24,7 @@ enum fwctl_bnxt_commands { · 5 unmodified lines
2324 struct fwctl_info_bnxt {
2425 __u32 uctx_caps;
2526 };
27+
28+#define FWCTL_BNXT_MAX_DMABUF 0x10000 /* 64 KiB */
29+
2630 #endif