diff options
author | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2017-02-21 05:28:02 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-02-21 13:16:14 -0500 |
commit | d63f9e41f981722b11f42ea2b19798c00fcae0f9 (patch) | |
tree | 384b123cc25cc2a049a36de7bd58166c50344887 | |
parent | 239a3b663647869330955ec59caac0100ef9b60a (diff) |
net: mvpp2: remove useless arguments in mvpp2_rx_{pkts, time}_coal_set
As noticed by Russell King, the last argument of
mvpp2_rx_{pkts,time}_coal_set() is useless, since the packet/time
coalescing value is already stored in the 'struct mvpp2_rx_queue *'
passed as argument to these functions. So passing the packet/time value
as an additional argument, and setting them again in the mvpp2_rx_queue
structure is useles.
This commit therefore gets rid of this additional argument, assuming the
caller has assigned the appropriate value to rxq->pkts_coal or
rxq->time_coal before calling the respective functions.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/marvell/mvpp2.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c index a6992ce34565..dfeee9636c7a 100644 --- a/drivers/net/ethernet/marvell/mvpp2.c +++ b/drivers/net/ethernet/marvell/mvpp2.c | |||
@@ -4379,27 +4379,23 @@ static void mvpp2_txp_max_tx_size_set(struct mvpp2_port *port) | |||
4379 | * will be generated by HW. | 4379 | * will be generated by HW. |
4380 | */ | 4380 | */ |
4381 | static void mvpp2_rx_pkts_coal_set(struct mvpp2_port *port, | 4381 | static void mvpp2_rx_pkts_coal_set(struct mvpp2_port *port, |
4382 | struct mvpp2_rx_queue *rxq, u32 pkts) | 4382 | struct mvpp2_rx_queue *rxq) |
4383 | { | 4383 | { |
4384 | u32 val; | 4384 | u32 val; |
4385 | 4385 | ||
4386 | val = (pkts & MVPP2_OCCUPIED_THRESH_MASK); | 4386 | val = (rxq->pkts_coal & MVPP2_OCCUPIED_THRESH_MASK); |
4387 | mvpp2_write(port->priv, MVPP2_RXQ_NUM_REG, rxq->id); | 4387 | mvpp2_write(port->priv, MVPP2_RXQ_NUM_REG, rxq->id); |
4388 | mvpp2_write(port->priv, MVPP2_RXQ_THRESH_REG, val); | 4388 | mvpp2_write(port->priv, MVPP2_RXQ_THRESH_REG, val); |
4389 | |||
4390 | rxq->pkts_coal = pkts; | ||
4391 | } | 4389 | } |
4392 | 4390 | ||
4393 | /* Set the time delay in usec before Rx interrupt */ | 4391 | /* Set the time delay in usec before Rx interrupt */ |
4394 | static void mvpp2_rx_time_coal_set(struct mvpp2_port *port, | 4392 | static void mvpp2_rx_time_coal_set(struct mvpp2_port *port, |
4395 | struct mvpp2_rx_queue *rxq, u32 usec) | 4393 | struct mvpp2_rx_queue *rxq) |
4396 | { | 4394 | { |
4397 | u32 val; | 4395 | u32 val; |
4398 | 4396 | ||
4399 | val = (port->priv->tclk / USEC_PER_SEC) * usec; | 4397 | val = (port->priv->tclk / USEC_PER_SEC) * rxq->time_coal; |
4400 | mvpp2_write(port->priv, MVPP2_ISR_RX_THRESHOLD_REG(rxq->id), val); | 4398 | mvpp2_write(port->priv, MVPP2_ISR_RX_THRESHOLD_REG(rxq->id), val); |
4401 | |||
4402 | rxq->time_coal = usec; | ||
4403 | } | 4399 | } |
4404 | 4400 | ||
4405 | /* Free Tx queue skbuffs */ | 4401 | /* Free Tx queue skbuffs */ |
@@ -4543,8 +4539,8 @@ static int mvpp2_rxq_init(struct mvpp2_port *port, | |||
4543 | mvpp2_rxq_offset_set(port, rxq->id, NET_SKB_PAD); | 4539 | mvpp2_rxq_offset_set(port, rxq->id, NET_SKB_PAD); |
4544 | 4540 | ||
4545 | /* Set coalescing pkts and time */ | 4541 | /* Set coalescing pkts and time */ |
4546 | mvpp2_rx_pkts_coal_set(port, rxq, rxq->pkts_coal); | 4542 | mvpp2_rx_pkts_coal_set(port, rxq); |
4547 | mvpp2_rx_time_coal_set(port, rxq, rxq->time_coal); | 4543 | mvpp2_rx_time_coal_set(port, rxq); |
4548 | 4544 | ||
4549 | /* Add number of descriptors ready for receiving packets */ | 4545 | /* Add number of descriptors ready for receiving packets */ |
4550 | mvpp2_rxq_status_update(port, rxq->id, 0, rxq->size); | 4546 | mvpp2_rxq_status_update(port, rxq->id, 0, rxq->size); |
@@ -5801,8 +5797,8 @@ static int mvpp2_ethtool_set_coalesce(struct net_device *dev, | |||
5801 | 5797 | ||
5802 | rxq->time_coal = c->rx_coalesce_usecs; | 5798 | rxq->time_coal = c->rx_coalesce_usecs; |
5803 | rxq->pkts_coal = c->rx_max_coalesced_frames; | 5799 | rxq->pkts_coal = c->rx_max_coalesced_frames; |
5804 | mvpp2_rx_pkts_coal_set(port, rxq, rxq->pkts_coal); | 5800 | mvpp2_rx_pkts_coal_set(port, rxq); |
5805 | mvpp2_rx_time_coal_set(port, rxq, rxq->time_coal); | 5801 | mvpp2_rx_time_coal_set(port, rxq); |
5806 | } | 5802 | } |
5807 | 5803 | ||
5808 | for (queue = 0; queue < txq_number; queue++) { | 5804 | for (queue = 0; queue < txq_number; queue++) { |