|
|
@@ -42,7 +42,7 @@ Signed-off-by: David S. Miller <[email protected]>
|
|
|
|
|
|
/* Registers */
|
|
|
#define MVNETA_RXQ_CONFIG_REG(q) (0x1400 + ((q) << 2))
|
|
|
-@@ -323,8 +324,10 @@
|
|
|
+@@ -325,8 +326,10 @@
|
|
|
ETH_HLEN + ETH_FCS_LEN, \
|
|
|
cache_line_size())
|
|
|
|
|
|
@@ -54,7 +54,7 @@ Signed-off-by: David S. Miller <[email protected]>
|
|
|
#define MVNETA_SKB_SIZE(len) (SKB_DATA_ALIGN(len) + MVNETA_SKB_PAD)
|
|
|
#define MVNETA_MAX_RX_BUF_SIZE (PAGE_SIZE - MVNETA_SKB_PAD)
|
|
|
|
|
|
-@@ -352,6 +355,11 @@ struct mvneta_statistic {
|
|
|
+@@ -354,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 <[email protected]>
|
|
|
static const struct mvneta_statistic mvneta_statistics[] = {
|
|
|
{ 0x3000, T_REG_64, "good_octets_received", },
|
|
|
{ 0x3010, T_REG_32, "good_frames_received", },
|
|
|
-@@ -433,6 +441,8 @@ struct mvneta_port {
|
|
|
+@@ -435,6 +443,8 @@ struct mvneta_port {
|
|
|
u32 cause_rx_tx;
|
|
|
struct napi_struct napi;
|
|
|
|
|
|
@@ -75,7 +75,7 @@ Signed-off-by: David S. Miller <[email protected]>
|
|
|
/* Core clock */
|
|
|
struct clk *clk;
|
|
|
/* AXI clock */
|
|
|
-@@ -1963,10 +1973,50 @@ int mvneta_rx_refill_queue(struct mvneta
|
|
|
+@@ -1965,10 +1975,50 @@ int mvneta_rx_refill_queue(struct mvneta
|
|
|
}
|
|
|
|
|
|
static int
|
|
|
@@ -127,7 +127,7 @@ Signed-off-by: David S. Miller <[email protected]>
|
|
|
{
|
|
|
unsigned char *data = page_address(page);
|
|
|
int data_len = -MVNETA_MH_SIZE, len;
|
|
|
-@@ -1986,7 +2036,26 @@ mvneta_swbm_rx_frame(struct mvneta_port
|
|
|
+@@ -1988,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 <[email protected]>
|
|
|
if (unlikely(!rxq->skb)) {
|
|
|
netdev_err(dev,
|
|
|
"Can't allocate skb on queue %d\n",
|
|
|
-@@ -1997,8 +2066,9 @@ mvneta_swbm_rx_frame(struct mvneta_port
|
|
|
+@@ -1999,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 <[email protected]>
|
|
|
mvneta_rx_csum(pp, rx_desc->status, rxq->skb);
|
|
|
|
|
|
rxq->left_size = rx_desc->data_size - len;
|
|
|
-@@ -2032,7 +2102,7 @@ mvneta_swbm_add_rx_fragment(struct mvnet
|
|
|
+@@ -2034,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 <[email protected]>
|
|
|
PAGE_SIZE);
|
|
|
}
|
|
|
page_pool_release_page(rxq->page_pool, page);
|
|
|
-@@ -2047,11 +2117,18 @@ static int mvneta_rx_swbm(struct napi_st
|
|
|
+@@ -2049,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 <[email protected]>
|
|
|
/* Fairness NAPI loop */
|
|
|
while (rx_proc < budget && rx_proc < rx_todo) {
|
|
|
struct mvneta_rx_desc *rx_desc = mvneta_rxq_next_desc_get(rxq);
|
|
|
-@@ -2079,7 +2156,8 @@ static int mvneta_rx_swbm(struct napi_st
|
|
|
+@@ -2081,7 +2158,8 @@ static int mvneta_rx_swbm(struct napi_st
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
@@ -205,7 +205,7 @@ Signed-off-by: David S. Miller <[email protected]>
|
|
|
if (err)
|
|
|
continue;
|
|
|
} else {
|
|
|
-@@ -2114,6 +2192,10 @@ static int mvneta_rx_swbm(struct napi_st
|
|
|
+@@ -2116,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 <[email protected]>
|
|
|
|
|
|
if (rcvd_pkts)
|
|
|
mvneta_update_stats(pp, rcvd_pkts, rcvd_bytes, false);
|
|
|
-@@ -2855,13 +2937,14 @@ static int mvneta_poll(struct napi_struc
|
|
|
+@@ -2857,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 <[email protected]>
|
|
|
};
|
|
|
int err;
|
|
|
|
|
|
-@@ -3328,6 +3411,11 @@ static int mvneta_change_mtu(struct net_
|
|
|
+@@ -3364,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 <[email protected]>
|
|
|
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 <[email protected]>
|
|
|
/* Ethtool methods */
|
|
|
|
|
|
/* Set link ksettings (phy address, speed) for ethtools */
|
|
|
-@@ -4393,6 +4522,7 @@ static const struct net_device_ops mvnet
|
|
|
+@@ -4425,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 <[email protected]>
|
|
|
};
|
|
|
|
|
|
static const struct ethtool_ops mvneta_eth_tool_ops = {
|
|
|
-@@ -4683,7 +4813,7 @@ static int mvneta_probe(struct platform_
|
|
|
+@@ -4705,7 +4835,7 @@ static int mvneta_probe(struct platform_
|
|
|
SET_NETDEV_DEV(dev, &pdev->dev);
|
|
|
|
|
|
pp->id = global_port_id++;
|