Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'correct-bd-length-masks-and-bql-accounting-for-multi-bd-tx-packets'

Suraj Gupta says:

====================
Correct BD length masks and BQL accounting for multi-BD TX packets

This patch series fixes two issues in the Xilinx AXI Ethernet driver:
1. Corrects the BD length masks to match the AXIDMA IP spec.
2. Fixes BQL accounting for multi-BD TX packets.
====================

Link: https://patch.msgid.link/20260327073238.134948-1-suraj.gupta2@amd.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

+6 -7
+2 -2
drivers/net/ethernet/xilinx/xilinx_axienet.h
··· 105 105 #define XAXIDMA_BD_HAS_DRE_MASK 0xF00 /* Whether has DRE mask */ 106 106 #define XAXIDMA_BD_WORDLEN_MASK 0xFF /* Whether has DRE mask */ 107 107 108 - #define XAXIDMA_BD_CTRL_LENGTH_MASK 0x007FFFFF /* Requested len */ 108 + #define XAXIDMA_BD_CTRL_LENGTH_MASK GENMASK(25, 0) /* Requested len */ 109 109 #define XAXIDMA_BD_CTRL_TXSOF_MASK 0x08000000 /* First tx packet */ 110 110 #define XAXIDMA_BD_CTRL_TXEOF_MASK 0x04000000 /* Last tx packet */ 111 111 #define XAXIDMA_BD_CTRL_ALL_MASK 0x0C000000 /* All control bits */ ··· 130 130 #define XAXIDMA_BD_CTRL_TXEOF_MASK 0x04000000 /* Last tx packet */ 131 131 #define XAXIDMA_BD_CTRL_ALL_MASK 0x0C000000 /* All control bits */ 132 132 133 - #define XAXIDMA_BD_STS_ACTUAL_LEN_MASK 0x007FFFFF /* Actual len */ 133 + #define XAXIDMA_BD_STS_ACTUAL_LEN_MASK GENMASK(25, 0) /* Actual len */ 134 134 #define XAXIDMA_BD_STS_COMPLETE_MASK 0x80000000 /* Completed */ 135 135 #define XAXIDMA_BD_STS_DEC_ERR_MASK 0x40000000 /* Decode error */ 136 136 #define XAXIDMA_BD_STS_SLV_ERR_MASK 0x20000000 /* Slave error */
+4 -5
drivers/net/ethernet/xilinx/xilinx_axienet_main.c
··· 770 770 * @first_bd: Index of first descriptor to clean up 771 771 * @nr_bds: Max number of descriptors to clean up 772 772 * @force: Whether to clean descriptors even if not complete 773 - * @sizep: Pointer to a u32 filled with the total sum of all bytes 774 - * in all cleaned-up descriptors. Ignored if NULL. 773 + * @sizep: Pointer to a u32 accumulating the total byte count of 774 + * completed packets (using skb->len). Ignored if NULL. 775 775 * @budget: NAPI budget (use 0 when not called from NAPI poll) 776 776 * 777 777 * Would either be called after a successful transmit operation, or after ··· 805 805 DMA_TO_DEVICE); 806 806 807 807 if (cur_p->skb && (status & XAXIDMA_BD_STS_COMPLETE_MASK)) { 808 + if (sizep) 809 + *sizep += cur_p->skb->len; 808 810 napi_consume_skb(cur_p->skb, budget); 809 811 packets++; 810 812 } ··· 820 818 wmb(); 821 819 cur_p->cntrl = 0; 822 820 cur_p->status = 0; 823 - 824 - if (sizep) 825 - *sizep += status & XAXIDMA_BD_STS_ACTUAL_LEN_MASK; 826 821 } 827 822 828 823 if (!force) {