On Wed, Aug 20, 2025 at 06:16:09PM -0700, Jakub Kicinski wrote:
On Wed, 20 Aug 2025 20:11:58 +0300 Dragos Tatulea wrote:
quoted
+static struct device *netdev_nl_get_dma_dev(struct net_device *netdev,
+ unsigned long *rxq_bitmap,
+ struct netlink_ext_ack *extack)
break after type if it's long and multi line:
static struct device *
netdev_nl_get_dma_dev(struct net_device *netdev, unsigned long *rxq_bitmap,
struct netlink_ext_ack *extack)
Will fix. Hope to remember for next times as well.
quoted
+{
+ struct device *dma_dev = NULL;
+ u32 rxq_idx, prev_rxq_idx;
+
+ for_each_set_bit(rxq_idx, rxq_bitmap, netdev->real_num_rx_queues) {
+ struct device *rxq_dma_dev;
+
+ rxq_dma_dev = netdev_queue_get_dma_dev(netdev, rxq_idx);
+ /* Multi-PF netdev queues can belong to different DMA devoces.
typo: devoces
Thanks!
quoted
+ * Block this case.
+ */
+ if (dma_dev && rxq_dma_dev != dma_dev) {
+ NL_SET_ERR_MSG_FMT(extack, "Queue %u has a different dma device than queue %u",
s/dma/DMA/
I think we may want to bubble up the Multi-PF thing from the comment to
the user. This could be quite confusing to people. How about:
"DMA device mismatch between queue %u and %u (multi-PF device?)"
Sounds good. Do we still need the comment? A similar remark is done in
the commit message as well.
Thanks,
Dragos