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

ioat1: trim ioat_dma_desc_sw

Save 4 bytes per software descriptor by transmitting tx_cnt in an unused
portion of the hardware descriptor.

Signed-off-by: Maciej Sosnowski <maciej.sosnowski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>

+7 -5
+2 -2
drivers/dma/ioat/dma.c
··· 396 396 dump_desc_dbg(ioat, chain_tail); 397 397 dump_desc_dbg(ioat, first); 398 398 399 - ioat->pending += desc->tx_cnt; 399 + ioat->pending += desc->hw->tx_cnt; 400 400 if (ioat->pending >= ioat_pending_level) 401 401 __ioat1_dma_memcpy_issue_pending(ioat); 402 402 spin_unlock_bh(&ioat->desc_lock); ··· 655 655 spin_unlock_bh(&ioat->desc_lock); 656 656 657 657 desc->txd.flags = flags; 658 - desc->tx_cnt = tx_cnt; 659 658 desc->len = total_len; 660 659 list_splice(&chain, &desc->txd.tx_list); 661 660 hw->ctl_f.int_en = !!(flags & DMA_PREP_INTERRUPT); 662 661 hw->ctl_f.compl_write = 1; 662 + hw->tx_cnt = tx_cnt; 663 663 dump_desc_dbg(ioat, desc); 664 664 665 665 return &desc->txd;
-2
drivers/dma/ioat/dma.h
··· 165 165 * @hw: hardware DMA descriptor 166 166 * @node: this descriptor will either be on the free list, 167 167 * or attached to a transaction list (async_tx.tx_list) 168 - * @tx_cnt: number of descriptors required to complete the transaction 169 168 * @txd: the generic software descriptor for all engines 170 169 * @id: identifier for debug 171 170 */ 172 171 struct ioat_desc_sw { 173 172 struct ioat_dma_descriptor *hw; 174 173 struct list_head node; 175 - int tx_cnt; 176 174 size_t len; 177 175 struct dma_async_tx_descriptor txd; 178 176 #ifdef DEBUG
+5 -1
drivers/dma/ioat/hw.h
··· 63 63 uint64_t next; 64 64 uint64_t rsv1; 65 65 uint64_t rsv2; 66 - uint64_t user1; 66 + /* store some driver data in an unused portion of the descriptor */ 67 + union { 68 + uint64_t user1; 69 + uint64_t tx_cnt; 70 + }; 67 71 uint64_t user2; 68 72 }; 69 73 #endif