aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJisheng Zhang <jszhang@marvell.com>2016-03-30 07:53:41 -0400
committerDavid S. Miller <davem@davemloft.net>2016-03-31 15:15:01 -0400
commitb7854efce20be7c7bcd43424dee027124e9af27f (patch)
tree575b50e44f64c2bb478199db773e15b7d376df20
parent13a7ebb38a659254e71a4a95cf39429a9287912b (diff)
net: mvpp2: replace MVPP2_CPU_D_CACHE_LINE_SIZE with L1_CACHE_BYTES
The mvpp2 ip maybe used in SoCs which may have have 64bytes cacheline size. Replace the MVPP2_CPU_D_CACHE_LINE_SIZE with L1_CACHE_BYTES. And since dma_alloc_coherent() is always cacheline size aligned, so remove the align checks. Signed-off-by: Jisheng Zhang <jszhang@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/marvell/mvpp2.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
index c797971aefab..05f358b81791 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -321,7 +321,6 @@
321/* Lbtd 802.3 type */ 321/* Lbtd 802.3 type */
322#define MVPP2_IP_LBDT_TYPE 0xfffa 322#define MVPP2_IP_LBDT_TYPE 0xfffa
323 323
324#define MVPP2_CPU_D_CACHE_LINE_SIZE 32
325#define MVPP2_TX_CSUM_MAX_SIZE 9800 324#define MVPP2_TX_CSUM_MAX_SIZE 9800
326 325
327/* Timeout constants */ 326/* Timeout constants */
@@ -377,7 +376,7 @@
377 376
378#define MVPP2_RX_PKT_SIZE(mtu) \ 377#define MVPP2_RX_PKT_SIZE(mtu) \
379 ALIGN((mtu) + MVPP2_MH_SIZE + MVPP2_VLAN_TAG_LEN + \ 378 ALIGN((mtu) + MVPP2_MH_SIZE + MVPP2_VLAN_TAG_LEN + \
380 ETH_HLEN + ETH_FCS_LEN, MVPP2_CPU_D_CACHE_LINE_SIZE) 379 ETH_HLEN + ETH_FCS_LEN, L1_CACHE_BYTES)
381 380
382#define MVPP2_RX_BUF_SIZE(pkt_size) ((pkt_size) + NET_SKB_PAD) 381#define MVPP2_RX_BUF_SIZE(pkt_size) ((pkt_size) + NET_SKB_PAD)
383#define MVPP2_RX_TOTAL_SIZE(buf_size) ((buf_size) + MVPP2_SKB_SHINFO_SIZE) 382#define MVPP2_RX_TOTAL_SIZE(buf_size) ((buf_size) + MVPP2_SKB_SHINFO_SIZE)
@@ -4493,10 +4492,6 @@ static int mvpp2_aggr_txq_init(struct platform_device *pdev,
4493 if (!aggr_txq->descs) 4492 if (!aggr_txq->descs)
4494 return -ENOMEM; 4493 return -ENOMEM;
4495 4494
4496 /* Make sure descriptor address is cache line size aligned */
4497 BUG_ON(aggr_txq->descs !=
4498 PTR_ALIGN(aggr_txq->descs, MVPP2_CPU_D_CACHE_LINE_SIZE));
4499
4500 aggr_txq->last_desc = aggr_txq->size - 1; 4495 aggr_txq->last_desc = aggr_txq->size - 1;
4501 4496
4502 /* Aggr TXQ no reset WA */ 4497 /* Aggr TXQ no reset WA */
@@ -4526,9 +4521,6 @@ static int mvpp2_rxq_init(struct mvpp2_port *port,
4526 if (!rxq->descs) 4521 if (!rxq->descs)
4527 return -ENOMEM; 4522 return -ENOMEM;
4528 4523
4529 BUG_ON(rxq->descs !=
4530 PTR_ALIGN(rxq->descs, MVPP2_CPU_D_CACHE_LINE_SIZE));
4531
4532 rxq->last_desc = rxq->size - 1; 4524 rxq->last_desc = rxq->size - 1;
4533 4525
4534 /* Zero occupied and non-occupied counters - direct access */ 4526 /* Zero occupied and non-occupied counters - direct access */
@@ -4616,10 +4608,6 @@ static int mvpp2_txq_init(struct mvpp2_port *port,
4616 if (!txq->descs) 4608 if (!txq->descs)
4617 return -ENOMEM; 4609 return -ENOMEM;
4618 4610
4619 /* Make sure descriptor address is cache line size aligned */
4620 BUG_ON(txq->descs !=
4621 PTR_ALIGN(txq->descs, MVPP2_CPU_D_CACHE_LINE_SIZE));
4622
4623 txq->last_desc = txq->size - 1; 4611 txq->last_desc = txq->size - 1;
4624 4612
4625 /* Set Tx descriptors queue starting address - indirect access */ 4613 /* Set Tx descriptors queue starting address - indirect access */