From 3d959c2d4f35cf24b6ab25210f5a07c51e7bd35b Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Tue, 10 Mar 2020 23:07:30 -0700 Subject: [PATCH] Use configured ring stride --- modules/mqnic/mqnic_eq.c | 2 +- modules/mqnic/mqnic_rx.c | 4 ++-- modules/mqnic/mqnic_tx.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/mqnic/mqnic_eq.c b/modules/mqnic/mqnic_eq.c index e87f8bbc5..b5235628b 100644 --- a/modules/mqnic/mqnic_eq.c +++ b/modules/mqnic/mqnic_eq.c @@ -177,7 +177,7 @@ void mqnic_process_eq(struct net_device *ndev, struct mqnic_eq_ring *eq_ring) while (eq_ring->head_ptr != eq_tail_ptr) { - event = (struct mqnic_event *)(eq_ring->buf + eq_index * MQNIC_EVENT_SIZE); + event = (struct mqnic_event *)(eq_ring->buf + eq_index*eq_ring->stride); if (event->type == MQNIC_EVENT_TYPE_TX_CPL) { diff --git a/modules/mqnic/mqnic_rx.c b/modules/mqnic/mqnic_rx.c index 544cdc692..9219f975b 100644 --- a/modules/mqnic/mqnic_rx.c +++ b/modules/mqnic/mqnic_rx.c @@ -197,7 +197,7 @@ int mqnic_free_rx_buf(struct mqnic_priv *priv, struct mqnic_ring *ring) int mqnic_prepare_rx_desc(struct mqnic_priv *priv, struct mqnic_ring *ring, int index) { struct mqnic_rx_info *rx_info = &ring->rx_info[index]; - struct mqnic_desc *rx_desc = (struct mqnic_desc *)(ring->buf + index * sizeof(*rx_desc)); + struct mqnic_desc *rx_desc = (struct mqnic_desc *)(ring->buf + index*ring->stride); struct page *page = rx_info->page; u32 page_order = ring->page_order; u32 len = PAGE_SIZE << page_order; @@ -291,7 +291,7 @@ int mqnic_process_rx_cq(struct net_device *ndev, struct mqnic_cq_ring *cq_ring, while (cq_ring->head_ptr != cq_tail_ptr && done < budget) { - cpl = (struct mqnic_cpl *)(cq_ring->buf + cq_index * MQNIC_CPL_SIZE); + cpl = (struct mqnic_cpl *)(cq_ring->buf + cq_index*cq_ring->stride); ring_index = cpl->index & ring->size_mask; rx_info = &ring->rx_info[ring_index]; page = rx_info->page; diff --git a/modules/mqnic/mqnic_tx.c b/modules/mqnic/mqnic_tx.c index 6af8f1937..9eadfd96a 100644 --- a/modules/mqnic/mqnic_tx.c +++ b/modules/mqnic/mqnic_tx.c @@ -226,7 +226,7 @@ int mqnic_process_tx_cq(struct net_device *ndev, struct mqnic_cq_ring *cq_ring, while (cq_ring->head_ptr != cq_tail_ptr && done < budget) { - cpl = (struct mqnic_cpl *)(cq_ring->buf + cq_index * MQNIC_CPL_SIZE); + cpl = (struct mqnic_cpl *)(cq_ring->buf + cq_index*cq_ring->stride); ring_index = cpl->index & ring->size_mask; tx_info = &ring->tx_info[ring_index]; @@ -357,7 +357,7 @@ netdev_tx_t mqnic_start_xmit(struct sk_buff *skb, struct net_device *ndev) index = ring->head_ptr & ring->size_mask; - tx_desc = (struct mqnic_desc *)(ring->buf + index * sizeof(*tx_desc)); + tx_desc = (struct mqnic_desc *)(ring->buf + index*ring->stride); tx_info = &ring->tx_info[index];