diff options
author | David S. Miller <davem@davemloft.net> | 2014-11-06 22:01:18 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-11-06 22:01:18 -0500 |
commit | 4e84b496fd2a226883920e0e0de4ed3f94898adf (patch) | |
tree | 662e314870fabf5d6e3bf25b955bd537eb72de54 /drivers/net/ethernet/marvell | |
parent | 5c91ae08e4500ebc8efd584c8b87c4040d5393ea (diff) | |
parent | 9d01412ae76fec5274a3d94a28a3552a742a60dc (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'drivers/net/ethernet/marvell')
-rw-r--r-- | drivers/net/ethernet/marvell/mv643xx_eth.c | 18 | ||||
-rw-r--r-- | drivers/net/ethernet/marvell/mvpp2.c | 27 |
2 files changed, 28 insertions, 17 deletions
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c index b151a949f352..d44560d1d268 100644 --- a/drivers/net/ethernet/marvell/mv643xx_eth.c +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c | |||
@@ -1047,7 +1047,6 @@ static int txq_reclaim(struct tx_queue *txq, int budget, int force) | |||
1047 | int tx_index; | 1047 | int tx_index; |
1048 | struct tx_desc *desc; | 1048 | struct tx_desc *desc; |
1049 | u32 cmd_sts; | 1049 | u32 cmd_sts; |
1050 | struct sk_buff *skb; | ||
1051 | 1050 | ||
1052 | tx_index = txq->tx_used_desc; | 1051 | tx_index = txq->tx_used_desc; |
1053 | desc = &txq->tx_desc_area[tx_index]; | 1052 | desc = &txq->tx_desc_area[tx_index]; |
@@ -1066,19 +1065,22 @@ static int txq_reclaim(struct tx_queue *txq, int budget, int force) | |||
1066 | reclaimed++; | 1065 | reclaimed++; |
1067 | txq->tx_desc_count--; | 1066 | txq->tx_desc_count--; |
1068 | 1067 | ||
1069 | skb = NULL; | 1068 | if (!IS_TSO_HEADER(txq, desc->buf_ptr)) |
1070 | if (cmd_sts & TX_LAST_DESC) | 1069 | dma_unmap_single(mp->dev->dev.parent, desc->buf_ptr, |
1071 | skb = __skb_dequeue(&txq->tx_skb); | 1070 | desc->byte_cnt, DMA_TO_DEVICE); |
1071 | |||
1072 | if (cmd_sts & TX_ENABLE_INTERRUPT) { | ||
1073 | struct sk_buff *skb = __skb_dequeue(&txq->tx_skb); | ||
1074 | |||
1075 | if (!WARN_ON(!skb)) | ||
1076 | dev_kfree_skb(skb); | ||
1077 | } | ||
1072 | 1078 | ||
1073 | if (cmd_sts & ERROR_SUMMARY) { | 1079 | if (cmd_sts & ERROR_SUMMARY) { |
1074 | netdev_info(mp->dev, "tx error\n"); | 1080 | netdev_info(mp->dev, "tx error\n"); |
1075 | mp->dev->stats.tx_errors++; | 1081 | mp->dev->stats.tx_errors++; |
1076 | } | 1082 | } |
1077 | 1083 | ||
1078 | if (!IS_TSO_HEADER(txq, desc->buf_ptr)) | ||
1079 | dma_unmap_single(mp->dev->dev.parent, desc->buf_ptr, | ||
1080 | desc->byte_cnt, DMA_TO_DEVICE); | ||
1081 | dev_kfree_skb(skb); | ||
1082 | } | 1084 | } |
1083 | 1085 | ||
1084 | __netif_tx_unlock_bh(nq); | 1086 | __netif_tx_unlock_bh(nq); |
diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c index ece83f101526..fdf3e382e464 100644 --- a/drivers/net/ethernet/marvell/mvpp2.c +++ b/drivers/net/ethernet/marvell/mvpp2.c | |||
@@ -1692,6 +1692,7 @@ static int mvpp2_prs_vlan_add(struct mvpp2 *priv, unsigned short tpid, int ai, | |||
1692 | { | 1692 | { |
1693 | struct mvpp2_prs_entry *pe; | 1693 | struct mvpp2_prs_entry *pe; |
1694 | int tid_aux, tid; | 1694 | int tid_aux, tid; |
1695 | int ret = 0; | ||
1695 | 1696 | ||
1696 | pe = mvpp2_prs_vlan_find(priv, tpid, ai); | 1697 | pe = mvpp2_prs_vlan_find(priv, tpid, ai); |
1697 | 1698 | ||
@@ -1723,8 +1724,10 @@ static int mvpp2_prs_vlan_add(struct mvpp2 *priv, unsigned short tpid, int ai, | |||
1723 | break; | 1724 | break; |
1724 | } | 1725 | } |
1725 | 1726 | ||
1726 | if (tid <= tid_aux) | 1727 | if (tid <= tid_aux) { |
1727 | return -EINVAL; | 1728 | ret = -EINVAL; |
1729 | goto error; | ||
1730 | } | ||
1728 | 1731 | ||
1729 | memset(pe, 0 , sizeof(struct mvpp2_prs_entry)); | 1732 | memset(pe, 0 , sizeof(struct mvpp2_prs_entry)); |
1730 | mvpp2_prs_tcam_lu_set(pe, MVPP2_PRS_LU_VLAN); | 1733 | mvpp2_prs_tcam_lu_set(pe, MVPP2_PRS_LU_VLAN); |
@@ -1756,9 +1759,10 @@ static int mvpp2_prs_vlan_add(struct mvpp2 *priv, unsigned short tpid, int ai, | |||
1756 | 1759 | ||
1757 | mvpp2_prs_hw_write(priv, pe); | 1760 | mvpp2_prs_hw_write(priv, pe); |
1758 | 1761 | ||
1762 | error: | ||
1759 | kfree(pe); | 1763 | kfree(pe); |
1760 | 1764 | ||
1761 | return 0; | 1765 | return ret; |
1762 | } | 1766 | } |
1763 | 1767 | ||
1764 | /* Get first free double vlan ai number */ | 1768 | /* Get first free double vlan ai number */ |
@@ -1821,7 +1825,7 @@ static int mvpp2_prs_double_vlan_add(struct mvpp2 *priv, unsigned short tpid1, | |||
1821 | unsigned int port_map) | 1825 | unsigned int port_map) |
1822 | { | 1826 | { |
1823 | struct mvpp2_prs_entry *pe; | 1827 | struct mvpp2_prs_entry *pe; |
1824 | int tid_aux, tid, ai; | 1828 | int tid_aux, tid, ai, ret = 0; |
1825 | 1829 | ||
1826 | pe = mvpp2_prs_double_vlan_find(priv, tpid1, tpid2); | 1830 | pe = mvpp2_prs_double_vlan_find(priv, tpid1, tpid2); |
1827 | 1831 | ||
@@ -1838,8 +1842,10 @@ static int mvpp2_prs_double_vlan_add(struct mvpp2 *priv, unsigned short tpid1, | |||
1838 | 1842 | ||
1839 | /* Set ai value for new double vlan entry */ | 1843 | /* Set ai value for new double vlan entry */ |
1840 | ai = mvpp2_prs_double_vlan_ai_free_get(priv); | 1844 | ai = mvpp2_prs_double_vlan_ai_free_get(priv); |
1841 | if (ai < 0) | 1845 | if (ai < 0) { |
1842 | return ai; | 1846 | ret = ai; |
1847 | goto error; | ||
1848 | } | ||
1843 | 1849 | ||
1844 | /* Get first single/triple vlan tid */ | 1850 | /* Get first single/triple vlan tid */ |
1845 | for (tid_aux = MVPP2_PE_FIRST_FREE_TID; | 1851 | for (tid_aux = MVPP2_PE_FIRST_FREE_TID; |
@@ -1859,8 +1865,10 @@ static int mvpp2_prs_double_vlan_add(struct mvpp2 *priv, unsigned short tpid1, | |||
1859 | break; | 1865 | break; |
1860 | } | 1866 | } |
1861 | 1867 | ||
1862 | if (tid >= tid_aux) | 1868 | if (tid >= tid_aux) { |
1863 | return -ERANGE; | 1869 | ret = -ERANGE; |
1870 | goto error; | ||
1871 | } | ||
1864 | 1872 | ||
1865 | memset(pe, 0, sizeof(struct mvpp2_prs_entry)); | 1873 | memset(pe, 0, sizeof(struct mvpp2_prs_entry)); |
1866 | mvpp2_prs_tcam_lu_set(pe, MVPP2_PRS_LU_VLAN); | 1874 | mvpp2_prs_tcam_lu_set(pe, MVPP2_PRS_LU_VLAN); |
@@ -1887,8 +1895,9 @@ static int mvpp2_prs_double_vlan_add(struct mvpp2 *priv, unsigned short tpid1, | |||
1887 | mvpp2_prs_tcam_port_map_set(pe, port_map); | 1895 | mvpp2_prs_tcam_port_map_set(pe, port_map); |
1888 | mvpp2_prs_hw_write(priv, pe); | 1896 | mvpp2_prs_hw_write(priv, pe); |
1889 | 1897 | ||
1898 | error: | ||
1890 | kfree(pe); | 1899 | kfree(pe); |
1891 | return 0; | 1900 | return ret; |
1892 | } | 1901 | } |
1893 | 1902 | ||
1894 | /* IPv4 header parsing for fragmentation and L4 offset */ | 1903 | /* IPv4 header parsing for fragmentation and L4 offset */ |