Skip to content

Commit 4171ec0

Browse files
Intiyaz Bashadavem330
authored andcommitted
liquidio: Removed duplicate Tx queue status check
Napi is checking Tx queue status and waking the Tx queue if required. Same operation is being done while freeing every Tx buffer. So removed the duplicate operation of checking Tx queue status from the Tx buffer free functions. Signed-off-by: Intiyaz Basha <[email protected]> Signed-off-by: Felix Manlunas <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e32ac25 commit 4171ec0

File tree

2 files changed

+0
-57
lines changed

2 files changed

+0
-57
lines changed

drivers/net/ethernet/cavium/liquidio/lio_main.c

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1634,28 +1634,6 @@ static int octeon_pci_os_setup(struct octeon_device *oct)
16341634
return 0;
16351635
}
16361636

1637-
/**
1638-
* \brief Check Tx queue state for a given network buffer
1639-
* @param lio per-network private data
1640-
* @param skb network buffer
1641-
*/
1642-
static inline int check_txq_state(struct lio *lio, struct sk_buff *skb)
1643-
{
1644-
int q, iq;
1645-
1646-
q = skb->queue_mapping;
1647-
iq = lio->linfo.txpciq[(q % lio->oct_dev->num_iqs)].s.q_no;
1648-
1649-
if (octnet_iq_is_full(lio->oct_dev, iq))
1650-
return 0;
1651-
1652-
if (__netif_subqueue_stopped(lio->netdev, q)) {
1653-
INCR_INSTRQUEUE_PKT_COUNT(lio->oct_dev, iq, tx_restart, 1);
1654-
netif_wake_subqueue(lio->netdev, q);
1655-
}
1656-
return 1;
1657-
}
1658-
16591637
/**
16601638
* \brief Unmap and free network buffer
16611639
* @param buf buffer
@@ -1673,8 +1651,6 @@ static void free_netbuf(void *buf)
16731651
dma_unmap_single(&lio->oct_dev->pci_dev->dev, finfo->dptr, skb->len,
16741652
DMA_TO_DEVICE);
16751653

1676-
check_txq_state(lio, skb);
1677-
16781654
tx_buffer_free(skb);
16791655
}
16801656

@@ -1715,8 +1691,6 @@ static void free_netsgbuf(void *buf)
17151691
list_add_tail(&g->list, &lio->glist[iq]);
17161692
spin_unlock(&lio->glist_lock[iq]);
17171693

1718-
check_txq_state(lio, skb); /* mq support: sub-queue state check */
1719-
17201694
tx_buffer_free(skb);
17211695
}
17221696

@@ -1762,8 +1736,6 @@ static void free_netsgbuf_with_resp(void *buf)
17621736
spin_unlock(&lio->glist_lock[iq]);
17631737

17641738
/* Don't free the skb yet */
1765-
1766-
check_txq_state(lio, skb);
17671739
}
17681740

17691741
/**

drivers/net/ethernet/cavium/liquidio/lio_vf_main.c

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -953,29 +953,6 @@ static int octeon_pci_os_setup(struct octeon_device *oct)
953953
return 0;
954954
}
955955

956-
/**
957-
* \brief Check Tx queue state for a given network buffer
958-
* @param lio per-network private data
959-
* @param skb network buffer
960-
*/
961-
static int check_txq_state(struct lio *lio, struct sk_buff *skb)
962-
{
963-
int q, iq;
964-
965-
q = skb->queue_mapping;
966-
iq = lio->linfo.txpciq[q % lio->oct_dev->num_iqs].s.q_no;
967-
968-
if (octnet_iq_is_full(lio->oct_dev, iq))
969-
return 0;
970-
971-
if (__netif_subqueue_stopped(lio->netdev, q)) {
972-
INCR_INSTRQUEUE_PKT_COUNT(lio->oct_dev, iq, tx_restart, 1);
973-
netif_wake_subqueue(lio->netdev, q);
974-
}
975-
976-
return 1;
977-
}
978-
979956
/**
980957
* \brief Unmap and free network buffer
981958
* @param buf buffer
@@ -993,8 +970,6 @@ static void free_netbuf(void *buf)
993970
dma_unmap_single(&lio->oct_dev->pci_dev->dev, finfo->dptr, skb->len,
994971
DMA_TO_DEVICE);
995972

996-
check_txq_state(lio, skb);
997-
998973
tx_buffer_free(skb);
999974
}
1000975

@@ -1036,8 +1011,6 @@ static void free_netsgbuf(void *buf)
10361011
list_add_tail(&g->list, &lio->glist[iq]);
10371012
spin_unlock(&lio->glist_lock[iq]);
10381013

1039-
check_txq_state(lio, skb); /* mq support: sub-queue state check */
1040-
10411014
tx_buffer_free(skb);
10421015
}
10431016

@@ -1083,8 +1056,6 @@ static void free_netsgbuf_with_resp(void *buf)
10831056
spin_unlock(&lio->glist_lock[iq]);
10841057

10851058
/* Don't free the skb yet */
1086-
1087-
check_txq_state(lio, skb);
10881059
}
10891060

10901061
/**

0 commit comments

Comments
 (0)