ioatdma: Adding support for 16 src PQ ops and super extended descriptors
PATCH v3 1/1 ioatdma: Adding support for 16 src PQ ops and super extended descriptors
v3.3 introduced 16 sources PQ operations. This also introduced super extended descriptors to support the 16 srcs operations. This patch adds support for the 16 sources ops and in turn adds the super extended descriptors for those ops.
5 SED pools are created depending on the descriptor sizes. An SED can be a 64 bytes sized descriptor or larger and must be physically contiguous. A kmem cache pool is created for allocating the software descriptor that manages the hardware descriptor. The super extended descriptor will take place of extended descriptor under certain operations and be "attached" to the op descriptor during operation. This is a new feature for ioatdma v3.3.
--- drivers/dma/ioat/dma.h | 17 ++ drivers/dma/ioat/dma_v2.h | 2 drivers/dma/ioat/dma_v3.c | 394 ++++++++++++++++++++++++++++++++++++++++-- drivers/dma/ioat/hw.h | 43 ++++- drivers/dma/ioat/pci.c | 3 drivers/dma/ioat/registers.h | 1 6 files changed, 438 insertions(+), 22 deletions(-)
drivers/dma/ioat/dma.h +17 -0
@@ -81,6 +81,9 @@ struct ioatdma_device {void __iomem *reg_base;struct pci_pool *dma_pool;struct pci_pool *completion_pool; +#define MAX_SED_POOLS 5 +struct dma_pool *sed_hw_pool[MAX_SED_POOLS ]; +struct kmem_cache *sed_pool;struct dma_device common;u8 version;struct msix_entry msix_entries[4 ];
@@ -141,6 +144,20 @@ struct ioat_dma_chan {u16 active; }; +/** +* struct ioat_sed_ent - wrapper around super extended hardware descriptor +* @hw: hardware SED +* @sed_dma: dma address for the SED +* @list: list member +* @parent: point to the dma descriptor that's the parent +*/ +struct ioat_sed_ent { +struct ioat_sed_raw_descriptor *hw; +dma_addr_t dma; +struct ioat_ring_ent *parent; +unsigned int hw_pool; +}; +static inline struct ioat_chan_common *to_chan_common (struct dma_chan *c) { return container_of(c, struct ioat_chan_common, common);
drivers/dma/ioat/dma_v2.h +2 -0
@@ -137,6 +137,7 @@ struct ioat_ring_ent {#ifdef DEBUG int id;#endif +struct ioat_sed_ent *sed; }; static inline struct ioat_ring_ent *
@@ -157,6 +158,7 @@ static inline void ioat2_set_chainaddr(struct ioat2_dma_chan *ioat, u64 addr)int ioat2_dma_probe (struct ioatdma_device *dev,int dca);int ioat3_dma_probe (struct ioatdma_device *dev,int dca); +void ioat3_dma_remove (struct ioatdma_device *dev);struct dca_provider *ioat2_dca_init (struct pci_dev *pdev,void __iomem *iobase);struct dca_provider *ioat3_dca_init (struct pci_dev *pdev,void __iomem *iobase);int ioat2_check_space_lock (struct ioat2_dma_chan *ioat,int num_descs);
drivers/dma/ioat/dma_v3.c +373 -21
543 lines not on this page · raw message
drivers/dma/ioat/hw.h +42 -1
59 lines not on this page · raw message
drivers/dma/ioat/pci.c +3 -0
@@ -207,6 +207,9 @@ static void ioat_remove(struct pci_dev *pdev)if (!device)return ; +if (device->version >=IOAT_VER_3_0 ) +ioat3_dma_remove (device); +dev_err (&pdev->dev,"Removing dma and dca services\n" );if (device->dca) {unregister_dca_provider (device->dca, &pdev->dev);
drivers/dma/ioat/registers.h +1 -0
@@ -79,6 +79,7 @@#define IOAT_CAP_APIC 0x00000080#define IOAT_CAP_XOR 0x00000100#define IOAT_CAP_PQ 0x00000200 +#define IOAT_CAP_RAID16SS 0x00020000#define IOAT_CHANNEL_MMIO_SIZE 0x80/* Each Channel MMIO space is this size */