回复:[PATCH v5 net-next 05/11] net/nebula-matrix: add channel layer

From
Illusion Wang <Illusion.Wang@nebula-matrix.com>
Date
2026-03-04 02:04:30
Also in
linux-doc, lkml
Reply to
Andrew Lunn, 2026-02-27
quoted
+#define NBL_CHAN_TX_RING_TO_DESC(tx_ring, i) \
+ (&(((struct nbl_chan_tx_desc *)((tx_ring)-> >desc))[i]))
+#define NBL_CHAN_RX_RING_TO_DESC(rx_ring, i) \
+ (&(((struct nbl_chan_rx_desc *)((rx_ring)-> >desc))[i]))
Are the casts needed here?
quoted
+struct nbl_chan_tx_desc {
+ u16 flags;
+ u16 srcid;
+ u16 dstid;
+ u16 data_len;
quoted
+ u16 buf_len;
quoted
+ u64 buf_addr;
+ u16 msg_type;
+ u8 data[16];
+ u16 msgid;
+ u8 rsv[26];
+} __packed;
This is a hardware descriptor? It is actually in memory like this,
with the u64 buf_addr badly aligned? What was the hardware engineer
thinking? Just swapping buf_addr and buf_len would of made it a lot
better.
quoted
+struct nbl_chan_rx_desc {
+ u16 flags;
+ u32 buf_len;
+ u16 buf_id;
+ u64 buf_addr;
+} __packed;
Similarly badly designed.
Thank you for your feedback.
Since nbl_chan_ring->desc is a void *, casting is required for different scenarios.
The design of nbl_chan_tx_desc/nbl_chan_rx_desc is indeed poor, but the chip has
already been taped out (i.e., manufactured). We have recognized this issue and
have corrected it in the next-generation chip.

--illusion.wang
Thread (24 messages) 24 messages, 2 authors, last reply 2026-03-04
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help