aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIntiyaz Basha <intiyaz.basha@cavium.com>2018-03-26 16:40:27 -0400
committerDavid S. Miller <davem@davemloft.net>2018-03-27 11:03:04 -0400
commit4171ec060073e1789cb868f43585983c69ff767b (patch)
tree162f8b6a09193dee41383de6b2a0290b6d6d65f8
parente32ac25018558f7bcab387708187ab5aa2733cf8 (diff)
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 <intiyaz.basha@cavium.com> Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/cavium/liquidio/lio_main.c28
-rw-r--r--drivers/net/ethernet/cavium/liquidio/lio_vf_main.c29
2 files changed, 0 insertions, 57 deletions
diff --git a/drivers/net/ethernet/cavium/liquidio/lio_main.c b/drivers/net/ethernet/cavium/liquidio/lio_main.c
index 58b5c75fd2ee..43c5ba0af12b 100644
--- a/drivers/net/ethernet/cavium/liquidio/lio_main.c
+++ b/drivers/net/ethernet/cavium/liquidio/lio_main.c
@@ -1635,28 +1635,6 @@ static int octeon_pci_os_setup(struct octeon_device *oct)
1635} 1635}
1636 1636
1637/** 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 */
1642static 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
1659/**
1660 * \brief Unmap and free network buffer 1638 * \brief Unmap and free network buffer
1661 * @param buf buffer 1639 * @param buf buffer
1662 */ 1640 */
@@ -1673,8 +1651,6 @@ static void free_netbuf(void *buf)
1673 dma_unmap_single(&lio->oct_dev->pci_dev->dev, finfo->dptr, skb->len, 1651 dma_unmap_single(&lio->oct_dev->pci_dev->dev, finfo->dptr, skb->len,
1674 DMA_TO_DEVICE); 1652 DMA_TO_DEVICE);
1675 1653
1676 check_txq_state(lio, skb);
1677
1678 tx_buffer_free(skb); 1654 tx_buffer_free(skb);
1679} 1655}
1680 1656
@@ -1715,8 +1691,6 @@ static void free_netsgbuf(void *buf)
1715 list_add_tail(&g->list, &lio->glist[iq]); 1691 list_add_tail(&g->list, &lio->glist[iq]);
1716 spin_unlock(&lio->glist_lock[iq]); 1692 spin_unlock(&lio->glist_lock[iq]);
1717 1693
1718 check_txq_state(lio, skb); /* mq support: sub-queue state check */
1719
1720 tx_buffer_free(skb); 1694 tx_buffer_free(skb);
1721} 1695}
1722 1696
@@ -1762,8 +1736,6 @@ static void free_netsgbuf_with_resp(void *buf)
1762 spin_unlock(&lio->glist_lock[iq]); 1736 spin_unlock(&lio->glist_lock[iq]);
1763 1737
1764 /* Don't free the skb yet */ 1738 /* Don't free the skb yet */
1765
1766 check_txq_state(lio, skb);
1767} 1739}
1768 1740
1769/** 1741/**
diff --git a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
index d5f5c9a693ee..dc62698bdaf7 100644
--- a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
+++ b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
@@ -954,29 +954,6 @@ static int octeon_pci_os_setup(struct octeon_device *oct)
954} 954}
955 955
956/** 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 */
961static 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
979/**
980 * \brief Unmap and free network buffer 957 * \brief Unmap and free network buffer
981 * @param buf buffer 958 * @param buf buffer
982 */ 959 */
@@ -993,8 +970,6 @@ static void free_netbuf(void *buf)
993 dma_unmap_single(&lio->oct_dev->pci_dev->dev, finfo->dptr, skb->len, 970 dma_unmap_single(&lio->oct_dev->pci_dev->dev, finfo->dptr, skb->len,
994 DMA_TO_DEVICE); 971 DMA_TO_DEVICE);
995 972
996 check_txq_state(lio, skb);
997
998 tx_buffer_free(skb); 973 tx_buffer_free(skb);
999} 974}
1000 975
@@ -1036,8 +1011,6 @@ static void free_netsgbuf(void *buf)
1036 list_add_tail(&g->list, &lio->glist[iq]); 1011 list_add_tail(&g->list, &lio->glist[iq]);
1037 spin_unlock(&lio->glist_lock[iq]); 1012 spin_unlock(&lio->glist_lock[iq]);
1038 1013
1039 check_txq_state(lio, skb); /* mq support: sub-queue state check */
1040
1041 tx_buffer_free(skb); 1014 tx_buffer_free(skb);
1042} 1015}
1043 1016
@@ -1083,8 +1056,6 @@ static void free_netsgbuf_with_resp(void *buf)
1083 spin_unlock(&lio->glist_lock[iq]); 1056 spin_unlock(&lio->glist_lock[iq]);
1084 1057
1085 /* Don't free the skb yet */ 1058 /* Don't free the skb yet */
1086
1087 check_txq_state(lio, skb);
1088} 1059}
1089 1060
1090/** 1061/**