mirror of
https://github.com/corundum/corundum.git
synced 2025-01-16 08:12:53 +08:00
Unconditionally deactivate rings
This commit is contained in:
parent
292d805450
commit
eeedc179fb
@ -99,8 +99,7 @@ void mqnic_destroy_cq_ring(struct mqnic_cq_ring **ring_ptr)
|
||||
struct mqnic_cq_ring *ring = *ring_ptr;
|
||||
*ring_ptr = NULL;
|
||||
|
||||
if (ring->active)
|
||||
mqnic_deactivate_cq_ring(ring);
|
||||
mqnic_deactivate_cq_ring(ring);
|
||||
|
||||
dma_free_coherent(ring->priv->dev, ring->buf_size, ring->buf, ring->buf_dma_addr);
|
||||
kfree(ring);
|
||||
@ -108,8 +107,7 @@ void mqnic_destroy_cq_ring(struct mqnic_cq_ring **ring_ptr)
|
||||
|
||||
int mqnic_activate_cq_ring(struct mqnic_cq_ring *ring, int eq_index)
|
||||
{
|
||||
if (ring->active)
|
||||
mqnic_deactivate_cq_ring(ring);
|
||||
mqnic_deactivate_cq_ring(ring);
|
||||
|
||||
ring->eq_index = eq_index;
|
||||
|
||||
|
@ -114,8 +114,7 @@ void mqnic_destroy_eq_ring(struct mqnic_eq_ring **ring_ptr)
|
||||
struct device *dev = ring->priv->dev;
|
||||
*ring_ptr = NULL;
|
||||
|
||||
if (ring->active)
|
||||
mqnic_deactivate_eq_ring(ring);
|
||||
mqnic_deactivate_eq_ring(ring);
|
||||
|
||||
dma_free_coherent(dev, ring->buf_size, ring->buf, ring->buf_dma_addr);
|
||||
kfree(ring);
|
||||
@ -125,8 +124,7 @@ int mqnic_activate_eq_ring(struct mqnic_eq_ring *ring, int int_index)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (ring->active)
|
||||
mqnic_deactivate_eq_ring(ring);
|
||||
mqnic_deactivate_eq_ring(ring);
|
||||
|
||||
if (int_index < 0 || int_index >= ring->priv->mdev->irq_count)
|
||||
return -EINVAL;
|
||||
|
@ -115,8 +115,7 @@ void mqnic_destroy_rx_ring(struct mqnic_ring **ring_ptr)
|
||||
struct mqnic_ring *ring = *ring_ptr;
|
||||
*ring_ptr = NULL;
|
||||
|
||||
if (ring->active)
|
||||
mqnic_deactivate_rx_ring(ring);
|
||||
mqnic_deactivate_rx_ring(ring);
|
||||
|
||||
mqnic_free_rx_buf(ring);
|
||||
|
||||
@ -128,8 +127,7 @@ void mqnic_destroy_rx_ring(struct mqnic_ring **ring_ptr)
|
||||
|
||||
int mqnic_activate_rx_ring(struct mqnic_ring *ring, int cpl_index)
|
||||
{
|
||||
if (ring->active)
|
||||
mqnic_deactivate_rx_ring(ring);
|
||||
mqnic_deactivate_rx_ring(ring);
|
||||
|
||||
// deactivate queue
|
||||
iowrite32(0, ring->hw_addr + MQNIC_QUEUE_ACTIVE_LOG_SIZE_REG);
|
||||
|
@ -117,8 +117,7 @@ void mqnic_destroy_tx_ring(struct mqnic_ring **ring_ptr)
|
||||
struct mqnic_ring *ring = *ring_ptr;
|
||||
*ring_ptr = NULL;
|
||||
|
||||
if (ring->active)
|
||||
mqnic_deactivate_tx_ring(ring);
|
||||
mqnic_deactivate_tx_ring(ring);
|
||||
|
||||
mqnic_free_tx_buf(ring);
|
||||
|
||||
@ -130,8 +129,7 @@ void mqnic_destroy_tx_ring(struct mqnic_ring **ring_ptr)
|
||||
|
||||
int mqnic_activate_tx_ring(struct mqnic_ring *ring, int cpl_index)
|
||||
{
|
||||
if (ring->active)
|
||||
mqnic_deactivate_tx_ring(ring);
|
||||
mqnic_deactivate_tx_ring(ring);
|
||||
|
||||
// deactivate queue
|
||||
iowrite32(0, ring->hw_addr + MQNIC_QUEUE_ACTIVE_LOG_SIZE_REG);
|
||||
|
Loading…
x
Reference in New Issue
Block a user