@ -42,7 +42,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* Registers */
#define MVNETA_RXQ_CONFIG_REG(q) (0x1400 + ((q) << 2))
@@ -32 3,8 +324 ,10 @@
@@ -32 5,8 +326 ,10 @@
ETH_HLEN + ETH_FCS_LEN, \
cache_line_size())
@ -54,7 +54,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
#define MVNETA_SKB_SIZE(len) (SKB_DATA_ALIGN(len) + MVNETA_SKB_PAD)
#define MVNETA_MAX_RX_BUF_SIZE (PAGE_SIZE - MVNETA_SKB_PAD)
@@ -35 2,6 +355 ,11 @@ struct mvneta_statistic {
@@ -35 4,6 +357 ,11 @@ struct mvneta_statistic {
#define T_REG_64 64
#define T_SW 1
@ -66,7 +66,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static const struct mvneta_statistic mvneta_statistics[] = {
{ 0x3000, T_REG_64, "good_octets_received", },
{ 0x3010, T_REG_32, "good_frames_received", },
@@ -43 3,6 +441 ,8 @@ struct mvneta_port {
@@ -43 5,6 +443 ,8 @@ struct mvneta_port {
u32 cause_rx_tx;
struct napi_struct napi;
@ -75,7 +75,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* Core clock */
struct clk *clk;
/* AXI clock */
@@ -196 3,10 +1973 ,50 @@ int mvneta_rx_refill_queue(struct mvneta
@@ -196 5,10 +1975 ,50 @@ int mvneta_rx_refill_queue(struct mvneta
}
static int
@ -127,7 +127,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
{
unsigned char *data = page_address(page);
int data_len = -MVNETA_MH_SIZE, len;
@@ -198 6,7 +2036 ,26 @@ mvneta_swbm_rx_frame(struct mvneta_port
@@ -198 8,7 +2038 ,26 @@ mvneta_swbm_rx_frame(struct mvneta_port
rx_desc->buf_phys_addr,
len, dma_dir);
@ -155,7 +155,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (unlikely(!rxq->skb)) {
netdev_err(dev,
"Can't allocate skb on queue %d\n",
@@ -199 7,8 +2066 ,9 @@ mvneta_swbm_rx_frame(struct mvneta_port
@@ -199 9,8 +2068 ,9 @@ mvneta_swbm_rx_frame(struct mvneta_port
}
page_pool_release_page(rxq->page_pool, page);
@ -167,7 +167,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mvneta_rx_csum(pp, rx_desc->status, rxq->skb);
rxq->left_size = rx_desc->data_size - len;
@@ -203 2,7 +2102 ,7 @@ mvneta_swbm_add_rx_fragment(struct mvnet
@@ -203 4,7 +2104 ,7 @@ mvneta_swbm_add_rx_fragment(struct mvnet
/* refill descriptor with new buffer later */
skb_add_rx_frag(rxq->skb,
skb_shinfo(rxq->skb)->nr_frags,
@ -176,7 +176,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
PAGE_SIZE);
}
page_pool_release_page(rxq->page_pool, page);
@@ -204 7,11 +2117 ,18 @@ static int mvneta_rx_swbm(struct napi_st
@@ -204 9,11 +2119 ,18 @@ static int mvneta_rx_swbm(struct napi_st
{
int rcvd_pkts = 0, rcvd_bytes = 0, rx_proc = 0;
struct net_device *dev = pp->dev;
@ -195,7 +195,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* Fairness NAPI loop */
while (rx_proc < budget && rx_proc < rx_todo) {
struct mvneta_rx_desc *rx_desc = mvneta_rxq_next_desc_get(rxq);
@@ -20 79,7 +2156 ,8 @@ static int mvneta_rx_swbm(struct napi_st
@@ -20 81,7 +2158 ,8 @@ static int mvneta_rx_swbm(struct napi_st
continue;
}
@ -205,7 +205,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (err)
continue;
} else {
@@ -211 4,6 +2192 ,10 @@ static int mvneta_rx_swbm(struct napi_st
@@ -211 6,6 +2194 ,10 @@ static int mvneta_rx_swbm(struct napi_st
/* clean uncomplete skb pointer in queue */
rxq->skb = NULL;
}
@ -216,7 +216,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (rcvd_pkts)
mvneta_update_stats(pp, rcvd_pkts, rcvd_bytes, false);
@@ -285 5,13 +2937 ,14 @@ static int mvneta_poll(struct napi_struc
@@ -285 7,13 +2939 ,14 @@ static int mvneta_poll(struct napi_struc
static int mvneta_create_page_pool(struct mvneta_port *pp,
struct mvneta_rx_queue *rxq, int size)
{
@ -232,7 +232,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
};
int err;
@@ -33 28,6 +3411 ,11 @@ static int mvneta_change_mtu(struct net_
@@ -33 64,6 +3447 ,11 @@ static int mvneta_change_mtu(struct net_
mtu = ALIGN(MVNETA_RX_PKT_SIZE(mtu), 8);
}
@ -244,7 +244,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
dev->mtu = mtu;
if (!netif_running(dev)) {
@@ - 3997,6 +4085 ,47 @@ static int mvneta_ioctl(struct net_devic
@@ - 4029,6 +4117 ,47 @@ static int mvneta_ioctl(struct net_devic
return phylink_mii_ioctl(pp->phylink, ifr, cmd);
}
@ -292,7 +292,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* Ethtool methods */
/* Set link ksettings (phy address, speed) for ethtools */
@@ -4 393,6 +4522 ,7 @@ static const struct net_device_ops mvnet
@@ -4 425,6 +4554 ,7 @@ static const struct net_device_ops mvnet
.ndo_fix_features = mvneta_fix_features,
.ndo_get_stats64 = mvneta_get_stats64,
.ndo_do_ioctl = mvneta_ioctl,
@ -300,7 +300,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
};
static const struct ethtool_ops mvneta_eth_tool_ops = {
@@ -4 683,7 +4813 ,7 @@ static int mvneta_probe(struct platform_
@@ -4 705,7 +4835 ,7 @@ static int mvneta_probe(struct platform_
SET_NETDEV_DEV(dev, &pdev->dev);
pp->id = global_port_id++;