Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
This commit is contained in:
@@ -1047,7 +1047,6 @@ static int txq_reclaim(struct tx_queue *txq, int budget, int force)
|
||||
int tx_index;
|
||||
struct tx_desc *desc;
|
||||
u32 cmd_sts;
|
||||
struct sk_buff *skb;
|
||||
|
||||
tx_index = txq->tx_used_desc;
|
||||
desc = &txq->tx_desc_area[tx_index];
|
||||
@@ -1066,19 +1065,22 @@ static int txq_reclaim(struct tx_queue *txq, int budget, int force)
|
||||
reclaimed++;
|
||||
txq->tx_desc_count--;
|
||||
|
||||
skb = NULL;
|
||||
if (cmd_sts & TX_LAST_DESC)
|
||||
skb = __skb_dequeue(&txq->tx_skb);
|
||||
if (!IS_TSO_HEADER(txq, desc->buf_ptr))
|
||||
dma_unmap_single(mp->dev->dev.parent, desc->buf_ptr,
|
||||
desc->byte_cnt, DMA_TO_DEVICE);
|
||||
|
||||
if (cmd_sts & TX_ENABLE_INTERRUPT) {
|
||||
struct sk_buff *skb = __skb_dequeue(&txq->tx_skb);
|
||||
|
||||
if (!WARN_ON(!skb))
|
||||
dev_kfree_skb(skb);
|
||||
}
|
||||
|
||||
if (cmd_sts & ERROR_SUMMARY) {
|
||||
netdev_info(mp->dev, "tx error\n");
|
||||
mp->dev->stats.tx_errors++;
|
||||
}
|
||||
|
||||
if (!IS_TSO_HEADER(txq, desc->buf_ptr))
|
||||
dma_unmap_single(mp->dev->dev.parent, desc->buf_ptr,
|
||||
desc->byte_cnt, DMA_TO_DEVICE);
|
||||
dev_kfree_skb(skb);
|
||||
}
|
||||
|
||||
__netif_tx_unlock_bh(nq);
|
||||
|
@@ -1692,6 +1692,7 @@ static int mvpp2_prs_vlan_add(struct mvpp2 *priv, unsigned short tpid, int ai,
|
||||
{
|
||||
struct mvpp2_prs_entry *pe;
|
||||
int tid_aux, tid;
|
||||
int ret = 0;
|
||||
|
||||
pe = mvpp2_prs_vlan_find(priv, tpid, ai);
|
||||
|
||||
@@ -1723,8 +1724,10 @@ static int mvpp2_prs_vlan_add(struct mvpp2 *priv, unsigned short tpid, int ai,
|
||||
break;
|
||||
}
|
||||
|
||||
if (tid <= tid_aux)
|
||||
return -EINVAL;
|
||||
if (tid <= tid_aux) {
|
||||
ret = -EINVAL;
|
||||
goto error;
|
||||
}
|
||||
|
||||
memset(pe, 0 , sizeof(struct mvpp2_prs_entry));
|
||||
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,
|
||||
|
||||
mvpp2_prs_hw_write(priv, pe);
|
||||
|
||||
error:
|
||||
kfree(pe);
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Get first free double vlan ai number */
|
||||
@@ -1821,7 +1825,7 @@ static int mvpp2_prs_double_vlan_add(struct mvpp2 *priv, unsigned short tpid1,
|
||||
unsigned int port_map)
|
||||
{
|
||||
struct mvpp2_prs_entry *pe;
|
||||
int tid_aux, tid, ai;
|
||||
int tid_aux, tid, ai, ret = 0;
|
||||
|
||||
pe = mvpp2_prs_double_vlan_find(priv, tpid1, tpid2);
|
||||
|
||||
@@ -1838,8 +1842,10 @@ static int mvpp2_prs_double_vlan_add(struct mvpp2 *priv, unsigned short tpid1,
|
||||
|
||||
/* Set ai value for new double vlan entry */
|
||||
ai = mvpp2_prs_double_vlan_ai_free_get(priv);
|
||||
if (ai < 0)
|
||||
return ai;
|
||||
if (ai < 0) {
|
||||
ret = ai;
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* Get first single/triple vlan tid */
|
||||
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,
|
||||
break;
|
||||
}
|
||||
|
||||
if (tid >= tid_aux)
|
||||
return -ERANGE;
|
||||
if (tid >= tid_aux) {
|
||||
ret = -ERANGE;
|
||||
goto error;
|
||||
}
|
||||
|
||||
memset(pe, 0, sizeof(struct mvpp2_prs_entry));
|
||||
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,
|
||||
mvpp2_prs_tcam_port_map_set(pe, port_map);
|
||||
mvpp2_prs_hw_write(priv, pe);
|
||||
|
||||
error:
|
||||
kfree(pe);
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* IPv4 header parsing for fragmentation and L4 offset */
|
||||
|
Reference in New Issue
Block a user