* [PATCH net-next v2 1/3] net: mvneta: Don't check NETIF_F_GRO ourself
2018-08-31 8:08 [PATCH net-next v2 0/3] net: mvneta: some small improvements Jisheng Zhang
@ 2018-08-31 8:09 ` Jisheng Zhang
2018-08-31 8:10 ` [PATCH net-next v2 2/3] net: mvneta: enable NETIF_F_RXCSUM by default Jisheng Zhang
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Jisheng Zhang @ 2018-08-31 8:09 UTC (permalink / raw)
To: linux-arm-kernel
napi_gro_receive() checks NETIF_F_GRO bit as well, if the bit is not
set, we will go through GRO_NORMAL in napi_skb_finish(), so fall back
to netif_receive_skb_internal(), so we don't need to check NETIF_F_GRO
ourself.
Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Reviewed-by: Gregory CLEMENT <gregory.clement@bootlin.com>
---
drivers/net/ethernet/marvell/mvneta.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index bc80a678abc3..814aee92a1d3 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -2065,10 +2065,7 @@ static int mvneta_rx_swbm(struct napi_struct *napi,
/* Linux processing */
rxq->skb->protocol = eth_type_trans(rxq->skb, dev);
- if (dev->features & NETIF_F_GRO)
- napi_gro_receive(napi, rxq->skb);
- else
- netif_receive_skb(rxq->skb);
+ napi_gro_receive(napi, rxq->skb);
/* clean uncomplete skb pointer in queue */
rxq->skb = NULL;
--
2.18.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net-next v2 2/3] net: mvneta: enable NETIF_F_RXCSUM by default
2018-08-31 8:08 [PATCH net-next v2 0/3] net: mvneta: some small improvements Jisheng Zhang
2018-08-31 8:09 ` [PATCH net-next v2 1/3] net: mvneta: Don't check NETIF_F_GRO ourself Jisheng Zhang
@ 2018-08-31 8:10 ` Jisheng Zhang
2018-09-02 18:21 ` Andrew Lunn
2018-08-31 8:11 ` [PATCH net-next v2 3/3] net: mvneta: reduce smp_processor_id() calling in mvneta_tx_done_gbe Jisheng Zhang
2018-09-02 21:14 ` [PATCH net-next v2 0/3] net: mvneta: some small improvements David Miller
3 siblings, 1 reply; 6+ messages in thread
From: Jisheng Zhang @ 2018-08-31 8:10 UTC (permalink / raw)
To: linux-arm-kernel
The code and HW supports NETIF_F_RXCSUM, so let's enable it by default.
Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Reviewed-by: Gregory CLEMENT <gregory.clement@bootlin.com>
---
drivers/net/ethernet/marvell/mvneta.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index 814aee92a1d3..bcd20ebb2ebd 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -4595,7 +4595,8 @@ static int mvneta_probe(struct platform_device *pdev)
}
}
- dev->features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | NETIF_F_TSO;
+ dev->features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
+ NETIF_F_TSO | NETIF_F_RXCSUM;
dev->hw_features |= dev->features;
dev->vlan_features |= dev->features;
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
--
2.18.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net-next v2 3/3] net: mvneta: reduce smp_processor_id() calling in mvneta_tx_done_gbe
2018-08-31 8:08 [PATCH net-next v2 0/3] net: mvneta: some small improvements Jisheng Zhang
2018-08-31 8:09 ` [PATCH net-next v2 1/3] net: mvneta: Don't check NETIF_F_GRO ourself Jisheng Zhang
2018-08-31 8:10 ` [PATCH net-next v2 2/3] net: mvneta: enable NETIF_F_RXCSUM by default Jisheng Zhang
@ 2018-08-31 8:11 ` Jisheng Zhang
2018-09-02 21:14 ` [PATCH net-next v2 0/3] net: mvneta: some small improvements David Miller
3 siblings, 0 replies; 6+ messages in thread
From: Jisheng Zhang @ 2018-08-31 8:11 UTC (permalink / raw)
To: linux-arm-kernel
In the loop of mvneta_tx_done_gbe(), we call the smp_processor_id()
each time, move the call out of the loop to optimize the code a bit.
Before the patch, the loop looks like(under arm64):
ldr x1, [x29,#120]
...
ldr w24, [x1,#36]
...
bl 0 <_raw_spin_lock>
str w24, [x27,#132]
...
After the patch, the loop looks like(under arm64):
...
bl 0 <_raw_spin_lock>
str w23, [x28,#132]
...
where w23 is loaded so be ready before the loop.
>From another side, mvneta_tx_done_gbe() is called from mvneta_poll()
which is in non-preemptible context, so it's safe to call the
smp_processor_id() function once.
Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Reviewed-by: Gregory CLEMENT <gregory.clement@bootlin.com>
---
drivers/net/ethernet/marvell/mvneta.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index bcd20ebb2ebd..fe3edb3c2bf4 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -2507,12 +2507,13 @@ static void mvneta_tx_done_gbe(struct mvneta_port *pp, u32 cause_tx_done)
{
struct mvneta_tx_queue *txq;
struct netdev_queue *nq;
+ int cpu = smp_processor_id();
while (cause_tx_done) {
txq = mvneta_tx_done_policy(pp, cause_tx_done);
nq = netdev_get_tx_queue(pp->dev, txq->id);
- __netif_tx_lock(nq, smp_processor_id());
+ __netif_tx_lock(nq, cpu);
if (txq->count)
mvneta_txq_done(pp, txq);
--
2.18.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net-next v2 0/3] net: mvneta: some small improvements
2018-08-31 8:08 [PATCH net-next v2 0/3] net: mvneta: some small improvements Jisheng Zhang
` (2 preceding siblings ...)
2018-08-31 8:11 ` [PATCH net-next v2 3/3] net: mvneta: reduce smp_processor_id() calling in mvneta_tx_done_gbe Jisheng Zhang
@ 2018-09-02 21:14 ` David Miller
3 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2018-09-02 21:14 UTC (permalink / raw)
To: linux-arm-kernel
From: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Date: Fri, 31 Aug 2018 16:08:10 +0800
> patch1 removes the NETIF_F_GRO check ourself, because the net subsystem
> will handle it for us.
>
> patch2 enables NETIF_F_RXCSUM by default, since the driver and HW
> supports the feature.
>
> patch3 is a small optimization, to reduce smp_processor_id() calling
> in mvneta_tx_done_gbe.
>
> since v1:
> - based on net-next tree
> - remove the fix patches, since they should be based on net branch.
> - Add Gregory's Reviewed-by tag
Series applied, thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread