xen-netfront: convert to GRO API and advertise this feature
Subsystems (3)
PATCH 1/1 xen-netfront: convert to GRO API and advertise this feature
Anirban was seeing netfront received MTU size packets, which downgraded throughput. The following patch makes netfront use GRO API which improves throughput for that case.
--- drivers/net/xen-netfront.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/xen-netfront.c +5 -2
@@ -952,7 +952,7 @@ static int handle_incoming_queue(struct net_device *dev,u64_stats_update_end (&stats->syncp);/* Pass it up. */ -netif_receive_skb (skb); +napi_gro_receive (&np->napi, skb); }return packets_dropped;
@@ -1051,6 +1051,8 @@ err:if (work_done < budget) {int more_to_do =0 ; +napi_gro_flush (napi, false); +local_irq_save (flags);RING_FINAL_CHECK_FOR_RESPONSES (&np->rx, more_to_do);
@@ -1371,7 +1373,8 @@ static struct net_device *xennet_create_dev(struct xenbus_device *dev)netif_napi_add (netdev, &np->napi, xennet_poll,64 ); netdev->features =NETIF_F_IP_CSUM |NETIF_F_RXCSUM |NETIF_F_GSO_ROBUST ; - netdev->hw_features =NETIF_F_IP_CSUM |NETIF_F_SG |NETIF_F_TSO ; + netdev->hw_features =NETIF_F_IP_CSUM |NETIF_F_SG |NETIF_F_TSO | +NETIF_F_GRO ;/* * Assume that all hw features are available for now. This set
Signature · 1 line
1.7.10.4
Quoted 7 lines · Wei Liu
Anirban was seeing netfront received MTU size packets, which downgraded throughput. The following patch makes netfront use GRO API which improves throughput for that case.
Signed-off-by Wei Liu <[email protected]>Signed-off-by Anirban Chakraborty <[email protected]>Cc Ian Campbell <[email protected]>
Maybe a dumb question: doesn't Xen depends on the driver of host card to do GRO and pass it to netfront? What the case that netfront can receive a MTU size packet, for a card that does not support GRO in host? Doing GRO twice may introduce extra overheads.
Thanks
Quoted 7 lines · Wei Liu
Anirban was seeing netfront received MTU size packets, which downgraded throughput. The following patch makes netfront use GRO API which improves throughput for that case.
Signed-off-by Wei Liu <[email protected]>Signed-off-by Anirban Chakraborty <[email protected]>Cc Ian Campbell <[email protected]>
Maybe a dumb question: doesn't Xen depends on the driver of host card to do GRO and pass it to netfront? What the case that netfront can receive a MTU size packet, for a card that does not support GRO in host? Doing GRO twice may introduce extra overheads.
Thanks
Quoted 11 lines · Jason Wang
Quoted 7 lines · Wei Liu
Anirban was seeing netfront received MTU size packets, which downgraded throughput. The following patch makes netfront use GRO API which improves throughput for that case.
Signed-off-by Wei Liu <[email protected]>Signed-off-by Anirban Chakraborty <[email protected]>Cc Ian Campbell <[email protected]>Maybe a dumb question: doesn't Xen depends on the driver of host card to do GRO and pass it to netfront? What the case that netfront can receive
The would be the ideal situation. Netback pushes large packets to netfront and netfront sees large packets.
Quoted 1 line
a MTU size packet, for a card that does not support GRO in host? Doing
However Anirban saw the case when backend interface receives large packets but netfront sees MTU size packets, so my thought is there is certain configuration that leads to this issue. As we cannot tell users what to enable and what not to enable so I would like to solve this within our driver.
Quoted 2 lines
GRO twice may introduce extra overheads.
AIUI if the packet that frontend sees is large already then the GRO path is quite short which will not introduce heavy penalty, while on the other hand if packet is segmented doing GRO improves throughput.
Wei.
Quoted 1 line
Thanks
Quoted 11 lines · Jason Wang
Quoted 7 lines · Wei Liu
Anirban was seeing netfront received MTU size packets, which downgraded throughput. The following patch makes netfront use GRO API which improves throughput for that case.
Signed-off-by Wei Liu <[email protected]>Signed-off-by Anirban Chakraborty <[email protected]>Cc Ian Campbell <[email protected]>Maybe a dumb question: doesn't Xen depends on the driver of host card to do GRO and pass it to netfront? What the case that netfront can receive
The would be the ideal situation. Netback pushes large packets to netfront and netfront sees large packets.
Quoted 1 line
a MTU size packet, for a card that does not support GRO in host? Doing
However Anirban saw the case when backend interface receives large packets but netfront sees MTU size packets, so my thought is there is certain configuration that leads to this issue. As we cannot tell users what to enable and what not to enable so I would like to solve this within our driver.
Quoted 2 lines
GRO twice may introduce extra overheads.
AIUI if the packet that frontend sees is large already then the GRO path is quite short which will not introduce heavy penalty, while on the other hand if packet is segmented doing GRO improves throughput.
Wei.
Quoted 1 line
Thanks
Quoted 24 lines · Wei Liu
Quoted 11 lines · Jason Wang
Quoted 7 lines · Wei Liu
Anirban was seeing netfront received MTU size packets, which downgraded throughput. The following patch makes netfront use GRO API which improves throughput for that case.
Signed-off-by Wei Liu <[email protected]>Signed-off-by Anirban Chakraborty <[email protected]>Cc Ian Campbell <[email protected]>Maybe a dumb question: doesn't Xen depends on the driver of host card to do GRO and pass it to netfront? What the case that netfront can receive
The would be the ideal situation. Netback pushes large packets to netfront and netfront sees large packets.
Quoted 1 line
a MTU size packet, for a card that does not support GRO in host? Doing
However Anirban saw the case when backend interface receives large packets but netfront sees MTU size packets, so my thought is there is certain configuration that leads to this issue. As we cannot tell users what to enable and what not to enable so I would like to solve this within our driver.
Quoted 7 lines
Quoted 2 lines
GRO twice may introduce extra overheads.
AIUI if the packet that frontend sees is large already then the GRO path is quite short which will not introduce heavy penalty, while on the other hand if packet is segmented doing GRO improves throughput.
Thanks Wei, for explaining and submitting the patch. I would like add following to what you have already mentioned.
In my configuration, I was seeing netback was pushing large packets to the guest (Centos 6.4) but the netfront was receiving MTU sized packets. With this patch on, I do see large packets received on the guest interface. As a result there was substantial throughput improvement in the guest side (2.8 Gbps to 3.8 Gbps). Also, note that the host NIC driver was enabled for GRO already.
-Anirban
Quoted 24 lines · Wei Liu
Quoted 11 lines · Jason Wang
Quoted 7 lines · Wei Liu
Anirban was seeing netfront received MTU size packets, which downgraded throughput. The following patch makes netfront use GRO API which improves throughput for that case.
Signed-off-by Wei Liu <[email protected]>Signed-off-by Anirban Chakraborty <[email protected]>Cc Ian Campbell <[email protected]>Maybe a dumb question: doesn't Xen depends on the driver of host card to do GRO and pass it to netfront? What the case that netfront can receive
The would be the ideal situation. Netback pushes large packets to netfront and netfront sees large packets.
Quoted 1 line
a MTU size packet, for a card that does not support GRO in host? Doing
However Anirban saw the case when backend interface receives large packets but netfront sees MTU size packets, so my thought is there is certain configuration that leads to this issue. As we cannot tell users what to enable and what not to enable so I would like to solve this within our driver.
Quoted 7 lines
Quoted 2 lines
GRO twice may introduce extra overheads.
AIUI if the packet that frontend sees is large already then the GRO path is quite short which will not introduce heavy penalty, while on the other hand if packet is segmented doing GRO improves throughput.
Thanks Wei, for explaining and submitting the patch. I would like add following to what you have already mentioned.
In my configuration, I was seeing netback was pushing large packets to the guest (Centos 6.4) but the netfront was receiving MTU sized packets. With this patch on, I do see large packets received on the guest interface. As a result there was substantial throughput improvement in the guest side (2.8 Gbps to 3.8 Gbps). Also, note that the host NIC driver was enabled for GRO already.
-Anirban
Quoted 25 lines · Anirban Chakraborty
Quoted 23 lines · Wei Liu
Quoted 10 lines · Jason Wang
Quoted 7 lines · Wei Liu
Anirban was seeing netfront received MTU size packets, which downgraded throughput. The following patch makes netfront use GRO API which improves throughput for that case.
Signed-off-by Wei Liu <[email protected]>Signed-off-by Anirban Chakraborty <[email protected]>Cc Ian Campbell <[email protected]>Maybe a dumb question: doesn't Xen depends on the driver of host card to do GRO and pass it to netfront? What the case that netfront can receive
The would be the ideal situation. Netback pushes large packets to netfront and netfront sees large packets.
Quoted 1 line
a MTU size packet, for a card that does not support GRO in host? Doing
However Anirban saw the case when backend interface receives large packets but netfront sees MTU size packets, so my thought is there is certain configuration that leads to this issue. As we cannot tell users what to enable and what not to enable so I would like to solve this within our driver.
Quoted 2 lines
GRO twice may introduce extra overheads.
Quoted 8 lines
Quoted 4 lines
AIUI if the packet that frontend sees is large already then the GRO path is quite short which will not introduce heavy penalty, while on the other hand if packet is segmented doing GRO improves throughput.
Thanks Wei, for explaining and submitting the patch. I would like add following to what you have already mentioned.
In my configuration, I was seeing netback was pushing large packets to the guest (Centos 6.4) but the netfront was receiving MTU sized packets. With this patch on, I do see large packets received on the guest interface. As a result there was substantial throughput improvement in the guest side (2.8 Gbps to 3.8 Gbps). Also, note that the host NIC driver was enabled for GRO already.-Anirban
In this case, even if you still want to do GRO. It's better to find the root cause of why the GSO packet were segmented (maybe GSO were not enabled for netback?), since it introduces extra overheads.
Quoted 4 lines
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 25 lines · Anirban Chakraborty
Quoted 23 lines · Wei Liu
Quoted 10 lines · Jason Wang
Quoted 7 lines · Wei Liu
Anirban was seeing netfront received MTU size packets, which downgraded throughput. The following patch makes netfront use GRO API which improves throughput for that case.
Signed-off-by Wei Liu <[email protected]>Signed-off-by Anirban Chakraborty <[email protected]>Cc Ian Campbell <[email protected]>Maybe a dumb question: doesn't Xen depends on the driver of host card to do GRO and pass it to netfront? What the case that netfront can receive
The would be the ideal situation. Netback pushes large packets to netfront and netfront sees large packets.
Quoted 1 line
a MTU size packet, for a card that does not support GRO in host? Doing
However Anirban saw the case when backend interface receives large packets but netfront sees MTU size packets, so my thought is there is certain configuration that leads to this issue. As we cannot tell users what to enable and what not to enable so I would like to solve this within our driver.
Quoted 2 lines
GRO twice may introduce extra overheads.
Quoted 8 lines
Quoted 4 lines
AIUI if the packet that frontend sees is large already then the GRO path is quite short which will not introduce heavy penalty, while on the other hand if packet is segmented doing GRO improves throughput.
Thanks Wei, for explaining and submitting the patch. I would like add following to what you have already mentioned.
In my configuration, I was seeing netback was pushing large packets to the guest (Centos 6.4) but the netfront was receiving MTU sized packets. With this patch on, I do see large packets received on the guest interface. As a result there was substantial throughput improvement in the guest side (2.8 Gbps to 3.8 Gbps). Also, note that the host NIC driver was enabled for GRO already.-Anirban
In this case, even if you still want to do GRO. It's better to find the root cause of why the GSO packet were segmented (maybe GSO were not enabled for netback?), since it introduces extra overheads.
Quoted 4 lines
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 30 lines · Jason Wang
Quoted 29 lines · Anirban Chakraborty
Quoted 27 lines · Wei Liu
Quoted 10 lines · Jason Wang
Quoted 7 lines · Wei Liu
Anirban was seeing netfront received MTU size packets, which downgraded throughput. The following patch makes netfront use GRO API which improves throughput for that case.
Signed-off-by Wei Liu <[email protected]>Signed-off-by Anirban Chakraborty <[email protected]>Cc Ian Campbell <[email protected]>Maybe a dumb question: doesn't Xen depends on the driver of host card to do GRO and pass it to netfront? What the case that netfront can receive
The would be the ideal situation. Netback pushes large packets to netfront and netfront sees large packets.
Quoted 1 line
a MTU size packet, for a card that does not support GRO in host? Doing
However Anirban saw the case when backend interface receives large packets but netfront sees MTU size packets, so my thought is there is certain configuration that leads to this issue. As we cannot tell users what to enable and what not to enable so I would like to solve this within our driver.
Quoted 2 lines
GRO twice may introduce extra overheads.
AIUI if the packet that frontend sees is large already then the GRO path is quite short which will not introduce heavy penalty, while on the other hand if packet is segmented doing GRO improves throughput.
Quoted 6 lines
Quoted 4 lines
Thanks Wei, for explaining and submitting the patch. I would like add following to what you have already mentioned.
In my configuration, I was seeing netback was pushing large packets to the guest (Centos 6.4) but the netfront was receiving MTU sized packets. With this patch on, I do see large packets received on the guest interface. As a result there was substantial throughput improvement in the guest side (2.8 Gbps to 3.8 Gbps). Also, note that the host NIC driver was enabled for GRO already.-Anirban
In this case, even if you still want to do GRO. It's better to find the root cause of why the GSO packet were segmented
Totally agree, we need to find the cause why large packets is segmented only in different host case.
Quoted 2 lines
(maybe GSO were not
enabled for netback?), since it introduces extra overheads.
From Anirban's feedback, large packets can be seen on vif interface, and even on guests running on the same host.
Thanks
Annie
Quoted 30 lines · Jason Wang
Quoted 29 lines · Anirban Chakraborty
Quoted 27 lines · Wei Liu
Quoted 10 lines · Jason Wang
Quoted 7 lines · Wei Liu
Anirban was seeing netfront received MTU size packets, which downgraded throughput. The following patch makes netfront use GRO API which improves throughput for that case.
Signed-off-by Wei Liu <[email protected]>Signed-off-by Anirban Chakraborty <[email protected]>Cc Ian Campbell <[email protected]>Maybe a dumb question: doesn't Xen depends on the driver of host card to do GRO and pass it to netfront? What the case that netfront can receive
The would be the ideal situation. Netback pushes large packets to netfront and netfront sees large packets.
Quoted 1 line
a MTU size packet, for a card that does not support GRO in host? Doing
However Anirban saw the case when backend interface receives large packets but netfront sees MTU size packets, so my thought is there is certain configuration that leads to this issue. As we cannot tell users what to enable and what not to enable so I would like to solve this within our driver.
Quoted 2 lines
GRO twice may introduce extra overheads.
AIUI if the packet that frontend sees is large already then the GRO path is quite short which will not introduce heavy penalty, while on the other hand if packet is segmented doing GRO improves throughput.
Quoted 6 lines
Quoted 4 lines
Thanks Wei, for explaining and submitting the patch. I would like add following to what you have already mentioned.
In my configuration, I was seeing netback was pushing large packets to the guest (Centos 6.4) but the netfront was receiving MTU sized packets. With this patch on, I do see large packets received on the guest interface. As a result there was substantial throughput improvement in the guest side (2.8 Gbps to 3.8 Gbps). Also, note that the host NIC driver was enabled for GRO already.-Anirban
In this case, even if you still want to do GRO. It's better to find the root cause of why the GSO packet were segmented
Totally agree, we need to find the cause why large packets is segmented only in different host case.
Quoted 2 lines
(maybe GSO were not
enabled for netback?), since it introduces extra overheads.
From Anirban's feedback, large packets can be seen on vif interface, and even on guests running on the same host.
Thanks
Annie
Quoted 32 lines · annie li
Quoted 30 lines · Jason Wang
Quoted 29 lines · Anirban Chakraborty
Quoted 27 lines · Wei Liu
Quoted 10 lines · Jason Wang
Quoted 7 lines · Wei Liu
Anirban was seeing netfront received MTU size packets, which downgraded throughput. The following patch makes netfront use GRO API which improves throughput for that case.
Signed-off-by Wei Liu <[email protected]>Signed-off-by Anirban Chakraborty <[email protected]>Cc Ian Campbell <[email protected]>Maybe a dumb question: doesn't Xen depends on the driver of host card to do GRO and pass it to netfront? What the case that netfront can receive
The would be the ideal situation. Netback pushes large packets to netfront and netfront sees large packets.
Quoted 1 line
a MTU size packet, for a card that does not support GRO in host? Doing
However Anirban saw the case when backend interface receives large packets but netfront sees MTU size packets, so my thought is there is certain configuration that leads to this issue. As we cannot tell users what to enable and what not to enable so I would like to solve this within our driver.
Quoted 2 lines
GRO twice may introduce extra overheads.
AIUI if the packet that frontend sees is large already then the GRO path is quite short which will not introduce heavy penalty, while on the other hand if packet is segmented doing GRO improves throughput.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Thanks Wei, for explaining and submitting the patch. I would like add following to what you have already mentioned.
In my configuration, I was seeing netback was pushing large packets to the guest (Centos 6.4) but the netfront was receiving MTU sized packets. With this patch on, I do see large packets received on the guest interface. As a result there was substantial throughput improvement in the guest side (2.8 Gbps to 3.8 Gbps). Also, note that the host NIC driver was enabled for GRO already.-Anirban
In this case, even if you still want to do GRO. It's better to find the root cause of why the GSO packet were segmented
Totally agree, we need to find the cause why large packets is segmented only in different host case.
It appears (from looking at the netback code) that although GSO is turned on at the netback, the guest receives large packet:
1. if it is a local packet (vm to vm on the same host), in which case netfront does a LRO or,
2. via turning on GRO explicitly (with this patch).
-Anirban
Quoted 32 lines · annie li
Quoted 30 lines · Jason Wang
Quoted 29 lines · Anirban Chakraborty
Quoted 27 lines · Wei Liu
Quoted 10 lines · Jason Wang
Quoted 7 lines · Wei Liu
Anirban was seeing netfront received MTU size packets, which downgraded throughput. The following patch makes netfront use GRO API which improves throughput for that case.
Signed-off-by Wei Liu <[email protected]>Signed-off-by Anirban Chakraborty <[email protected]>Cc Ian Campbell <[email protected]>Maybe a dumb question: doesn't Xen depends on the driver of host card to do GRO and pass it to netfront? What the case that netfront can receive
The would be the ideal situation. Netback pushes large packets to netfront and netfront sees large packets.
Quoted 1 line
a MTU size packet, for a card that does not support GRO in host? Doing
However Anirban saw the case when backend interface receives large packets but netfront sees MTU size packets, so my thought is there is certain configuration that leads to this issue. As we cannot tell users what to enable and what not to enable so I would like to solve this within our driver.
Quoted 2 lines
GRO twice may introduce extra overheads.
AIUI if the packet that frontend sees is large already then the GRO path is quite short which will not introduce heavy penalty, while on the other hand if packet is segmented doing GRO improves throughput.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Thanks Wei, for explaining and submitting the patch. I would like add following to what you have already mentioned.
In my configuration, I was seeing netback was pushing large packets to the guest (Centos 6.4) but the netfront was receiving MTU sized packets. With this patch on, I do see large packets received on the guest interface. As a result there was substantial throughput improvement in the guest side (2.8 Gbps to 3.8 Gbps). Also, note that the host NIC driver was enabled for GRO already.-Anirban
In this case, even if you still want to do GRO. It's better to find the root cause of why the GSO packet were segmented
Totally agree, we need to find the cause why large packets is segmented only in different host case.
It appears (from looking at the netback code) that although GSO is turned on at the netback, the guest receives large packet:
1. if it is a local packet (vm to vm on the same host), in which case netfront does a LRO or,
2. via turning on GRO explicitly (with this patch).
-Anirban
drivers/net/xen-netfront.c static struct net_device *xennet_create_dev(struct xenbus_device *dev) · line 1377
Quoted 7 lines · Wei Liu
Anirban was seeing netfront received MTU size packets, which downgraded throughput. The following patch makes netfront use GRO API which improves throughput for that case.
drivers/net/xen-netfront.c +2
-1- netdev->hw_features =NETIF_F_IP_CSUM |NETIF_F_SG |NETIF_F_TSO ; + netdev->hw_features =NETIF_F_IP_CSUM |NETIF_F_SG |NETIF_F_TSO | +NETIF_F_GRO ;
This part is not needed.
drivers/net/xen-netfront.c static struct net_device *xennet_create_dev(struct xenbus_device *dev) · line 1377
Quoted 7 lines · Wei Liu
Anirban was seeing netfront received MTU size packets, which downgraded throughput. The following patch makes netfront use GRO API which improves throughput for that case.
drivers/net/xen-netfront.c +2
-1- netdev->hw_features =NETIF_F_IP_CSUM |NETIF_F_SG |NETIF_F_TSO ; + netdev->hw_features =NETIF_F_IP_CSUM |NETIF_F_SG |NETIF_F_TSO | +NETIF_F_GRO ;
This part is not needed.
Quoted 11 lines · Eric Dumazet
drivers/net/xen-netfront.c static struct net_device *xennet_create_dev(struct xenbus_device *dev) · line 1377
Quoted 7 lines · Wei Liu
Anirban was seeing netfront received MTU size packets, which downgraded throughput. The following patch makes netfront use GRO API which improves throughput for that case.
drivers/net/xen-netfront.c +2
-1- netdev->hw_features =NETIF_F_IP_CSUM |NETIF_F_SG |NETIF_F_TSO ; + netdev->hw_features =NETIF_F_IP_CSUM |NETIF_F_SG |NETIF_F_TSO | +NETIF_F_GRO ;This part is not needed.
Shouldn't the flag be set? In dev_gro_receive() we do check if this flag is set or not:
if (!(skb->dev->features & NETIF_F_GRO) || netpoll_rx_on(skb))
goto normal;-Anirban
Quoted 11 lines · Eric Dumazet
drivers/net/xen-netfront.c static struct net_device *xennet_create_dev(struct xenbus_device *dev) · line 1377
Quoted 7 lines · Wei Liu
Anirban was seeing netfront received MTU size packets, which downgraded throughput. The following patch makes netfront use GRO API which improves throughput for that case.
drivers/net/xen-netfront.c +2
-1- netdev->hw_features =NETIF_F_IP_CSUM |NETIF_F_SG |NETIF_F_TSO ; + netdev->hw_features =NETIF_F_IP_CSUM |NETIF_F_SG |NETIF_F_TSO | +NETIF_F_GRO ;This part is not needed.
Shouldn't the flag be set? In dev_gro_receive() we do check if this flag is set or not:
if (!(skb->dev->features & NETIF_F_GRO) || netpoll_rx_on(skb))
goto normal;-Anirban
Quoted 14 lines · Anirban Chakraborty
Quoted 11 lines · Eric Dumazet
drivers/net/xen-netfront.c static struct net_device *xennet_create_dev(struct xenbus_device *dev) · line 1377
Quoted 7 lines · Wei Liu
Anirban was seeing netfront received MTU size packets, which downgraded throughput. The following patch makes netfront use GRO API which improves throughput for that case.
drivers/net/xen-netfront.c +2
-1- netdev->hw_features =NETIF_F_IP_CSUM |NETIF_F_SG |NETIF_F_TSO ; + netdev->hw_features =NETIF_F_IP_CSUM |NETIF_F_SG |NETIF_F_TSO | +NETIF_F_GRO ;This part is not needed.
Quoted 4 lines
Shouldn't the flag be set? In
dev_gro_receive()we do check if this flag is set or not:if (!(skb->dev->features & NETIF_F_GRO) || netpoll_rx_on(skb)) goto normal;
Drivers do not set NETIF_F_GRO themselves, they do not need to.
Look at other drivers which are GRO ready : NETIF_F_GRO is enabled by default by core networking stack, in register_netdevice()
dev->hw_features |= NETIF_F_SOFT_FEATURES;dev->features |= NETIF_F_SOFT_FEATURES;
Quoted 14 lines · Anirban Chakraborty
Quoted 11 lines · Eric Dumazet
drivers/net/xen-netfront.c static struct net_device *xennet_create_dev(struct xenbus_device *dev) · line 1377
Quoted 7 lines · Wei Liu
Anirban was seeing netfront received MTU size packets, which downgraded throughput. The following patch makes netfront use GRO API which improves throughput for that case.
drivers/net/xen-netfront.c +2
-1- netdev->hw_features =NETIF_F_IP_CSUM |NETIF_F_SG |NETIF_F_TSO ; + netdev->hw_features =NETIF_F_IP_CSUM |NETIF_F_SG |NETIF_F_TSO | +NETIF_F_GRO ;This part is not needed.
Quoted 4 lines
Shouldn't the flag be set? In
dev_gro_receive()we do check if this flag is set or not:if (!(skb->dev->features & NETIF_F_GRO) || netpoll_rx_on(skb)) goto normal;
Drivers do not set NETIF_F_GRO themselves, they do not need to.
Look at other drivers which are GRO ready : NETIF_F_GRO is enabled by default by core networking stack, in register_netdevice()
dev->hw_features |= NETIF_F_SOFT_FEATURES;dev->features |= NETIF_F_SOFT_FEATURES;
Quoted 20 lines · Eric Dumazet
Quoted 14 lines · Anirban Chakraborty
Quoted 11 lines · Eric Dumazet
drivers/net/xen-netfront.c static struct net_device *xennet_create_dev(struct xenbus_device *dev) · line 1377
Quoted 7 lines · Wei Liu
Anirban was seeing netfront received MTU size packets, which downgraded throughput. The following patch makes netfront use GRO API which improves throughput for that case.
drivers/net/xen-netfront.c +2
-1- netdev->hw_features =NETIF_F_IP_CSUM |NETIF_F_SG |NETIF_F_TSO ; + netdev->hw_features =NETIF_F_IP_CSUM |NETIF_F_SG |NETIF_F_TSO | +NETIF_F_GRO ;This part is not needed.
Quoted 4 lines
Shouldn't the flag be set? In
dev_gro_receive()we do check if this flag is set or not:if (!(skb->dev->features & NETIF_F_GRO) || netpoll_rx_on(skb)) goto normal;
Quoted 8 lines
Drivers do not set
NETIF_F_GROthemselves, they do not need to.Look at other drivers which are GRO ready :
NETIF_F_GROis enabled by default by core networking stack, inregister_netdevice()
dev->hw_features|=NETIF_F_SOFT_FEATURES;dev->features|=NETIF_F_SOFT_FEATURES;
I didn't realize that the drivers no longer need to set the GRO flag explicitly. It looks like it has been changed since 3.2. I was looking at the kernel version 2.6.32.43 (which corresponds to the dom0 kernel) where the problem is happening.
-Anirban
Quoted 7 lines · Wei Liu
Anirban was seeing netfront received MTU size packets, which downgraded throughput. The following patch makes netfront use GRO API which improves throughput for that case.
Signed-off-by Wei Liu <[email protected]>Signed-off-by Anirban Chakraborty <[email protected]>Cc Ian Campbell <[email protected]>
Quoted 44 lines
--- drivers/net/xen-netfront.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)drivers/net/xen-netfront.c +5
-2@@ -952,7 +952,7 @@ static int handle_incoming_queue(struct net_device *dev,u64_stats_update_end (&stats->syncp);/* Pass it up. */ -netif_receive_skb (skb); +napi_gro_receive (&np->napi, skb); }return packets_dropped;@@ -1051,6 +1051,8 @@ err:if (work_done < budget) {int more_to_do =0 ; +napi_gro_flush (napi, false); +local_irq_save (flags);RING_FINAL_CHECK_FOR_RESPONSES (&np->rx, more_to_do);@@ -1371,7 +1373,8 @@ static struct net_device *xennet_create_dev(struct xenbus_device *dev)netif_napi_add (netdev, &np->napi, xennet_poll,64 ); netdev->features =NETIF_F_IP_CSUM |NETIF_F_RXCSUM |NETIF_F_GSO_ROBUST ; - netdev->hw_features =NETIF_F_IP_CSUM |NETIF_F_SG |NETIF_F_TSO ; + netdev->hw_features =NETIF_F_IP_CSUM |NETIF_F_SG |NETIF_F_TSO | +NETIF_F_GRO ;/* * Assume that all hw features are available for now. This set Signature · 7 lines
1.7.10.4 _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
Quoted 7 lines · Wei Liu
Anirban was seeing netfront received MTU size packets, which downgraded throughput. The following patch makes netfront use GRO API which improves throughput for that case.
Signed-off-by Wei Liu <[email protected]>Signed-off-by Anirban Chakraborty <[email protected]>Cc Ian Campbell <[email protected]>
Quoted 44 lines
--- drivers/net/xen-netfront.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)drivers/net/xen-netfront.c +5
-2@@ -952,7 +952,7 @@ static int handle_incoming_queue(struct net_device *dev,u64_stats_update_end (&stats->syncp);/* Pass it up. */ -netif_receive_skb (skb); +napi_gro_receive (&np->napi, skb); }return packets_dropped;@@ -1051,6 +1051,8 @@ err:if (work_done < budget) {int more_to_do =0 ; +napi_gro_flush (napi, false); +local_irq_save (flags);RING_FINAL_CHECK_FOR_RESPONSES (&np->rx, more_to_do);@@ -1371,7 +1373,8 @@ static struct net_device *xennet_create_dev(struct xenbus_device *dev)netif_napi_add (netdev, &np->napi, xennet_poll,64 ); netdev->features =NETIF_F_IP_CSUM |NETIF_F_RXCSUM |NETIF_F_GSO_ROBUST ; - netdev->hw_features =NETIF_F_IP_CSUM |NETIF_F_SG |NETIF_F_TSO ; + netdev->hw_features =NETIF_F_IP_CSUM |NETIF_F_SG |NETIF_F_TSO | +NETIF_F_GRO ;/* * Assume that all hw features are available for now. This set Signature · 7 lines
1.7.10.4 _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
David Miller
maintainerFrom: Wei Liu <[email protected]>
Date: Sat, 21 Sep 2013 17:05:43 +0100
drivers/net/xen-netfront.c static struct net_device *xennet_create_dev(struct xenbus_device *dev) · line 1377
Quoted 7 lines
drivers/net/xen-netfront.c +2
-1@@ -1371,7 +1373,8 @@ static struct net_device *xennet_create_dev(struct xenbus_device *dev)netif_napi_add (netdev, &np->napi, xennet_poll,64 ); netdev->features =NETIF_F_IP_CSUM |NETIF_F_RXCSUM |NETIF_F_GSO_ROBUST ; - netdev->hw_features =NETIF_F_IP_CSUM |NETIF_F_SG |NETIF_F_TSO ; + netdev->hw_features =NETIF_F_IP_CSUM |NETIF_F_SG |NETIF_F_TSO | +NETIF_F_GRO ;
Please post a new version of this patch with the feedback you've been given integrated, in particular with this part removed because it is not necessary.
Ian, please review the patch when Wei posts it.
Thanks.
David Miller
maintainerFrom: Wei Liu <[email protected]>
Date: Sat, 21 Sep 2013 17:05:43 +0100
drivers/net/xen-netfront.c static struct net_device *xennet_create_dev(struct xenbus_device *dev) · line 1377
Quoted 7 lines
drivers/net/xen-netfront.c +2
-1@@ -1371,7 +1373,8 @@ static struct net_device *xennet_create_dev(struct xenbus_device *dev)netif_napi_add (netdev, &np->napi, xennet_poll,64 ); netdev->features =NETIF_F_IP_CSUM |NETIF_F_RXCSUM |NETIF_F_GSO_ROBUST ; - netdev->hw_features =NETIF_F_IP_CSUM |NETIF_F_SG |NETIF_F_TSO ; + netdev->hw_features =NETIF_F_IP_CSUM |NETIF_F_SG |NETIF_F_TSO | +NETIF_F_GRO ;
Please post a new version of this patch with the feedback you've been given integrated, in particular with this part removed because it is not necessary.
Ian, please review the patch when Wei posts it.
Thanks.
Quoted 15 lines · David Miller
From: Wei Liu <[email protected]>
Date: Sat, 21 Sep 2013 17:05:43 +0100drivers/net/xen-netfront.c static struct net_device *xennet_create_dev(struct xenbus_device *dev) · line 1377
Quoted 7 lines
drivers/net/xen-netfront.c +2
-1@@ -1371,7 +1373,8 @@ static struct net_device *xennet_create_dev(struct xenbus_device *dev)netif_napi_add (netdev, &np->napi, xennet_poll,64 ); netdev->features =NETIF_F_IP_CSUM |NETIF_F_RXCSUM |NETIF_F_GSO_ROBUST ; - netdev->hw_features =NETIF_F_IP_CSUM |NETIF_F_SG |NETIF_F_TSO ; + netdev->hw_features =NETIF_F_IP_CSUM |NETIF_F_SG |NETIF_F_TSO | +NETIF_F_GRO ;Please post a new version of this patch with the feedback you've been given integrated, in particular with this part removed because it is not necessary.
Quoted 1 line
Ian, please review the patch when Wei posts it.
I will, but note:
$ ./scripts/get_maintainer.pl -f drivers/net/xen-netfront.c
Konrad Rzeszutek Wilk <[email protected]> (supporter:XEN HYPERVISOR IN...)
Jeremy Fitzhardinge <[email protected]> (supporter:XEN HYPERVISOR IN...)
[email protected] (moderated list:XEN HYPERVISOR IN...)
[email protected] (open list:XEN HYPERVISOR IN...)
[email protected] (open list:NETWORKING DRIVERS)
[email protected] (open list)Strictly speaking I maintain netback not front, so Wei please remember to CC the right people (mainly Konrad) as well as me.
BTW I think this separation is a good thing since it keeps changes to the protocol "honest". Doesn't matter so much for this particular patch since don't think it actually touches the protocol.
Ian.
Quoted 15 lines · David Miller
From: Wei Liu <[email protected]>
Date: Sat, 21 Sep 2013 17:05:43 +0100drivers/net/xen-netfront.c static struct net_device *xennet_create_dev(struct xenbus_device *dev) · line 1377
Quoted 7 lines
drivers/net/xen-netfront.c +2
-1@@ -1371,7 +1373,8 @@ static struct net_device *xennet_create_dev(struct xenbus_device *dev)netif_napi_add (netdev, &np->napi, xennet_poll,64 ); netdev->features =NETIF_F_IP_CSUM |NETIF_F_RXCSUM |NETIF_F_GSO_ROBUST ; - netdev->hw_features =NETIF_F_IP_CSUM |NETIF_F_SG |NETIF_F_TSO ; + netdev->hw_features =NETIF_F_IP_CSUM |NETIF_F_SG |NETIF_F_TSO | +NETIF_F_GRO ;Please post a new version of this patch with the feedback you've been given integrated, in particular with this part removed because it is not necessary.
Quoted 1 line
Ian, please review the patch when Wei posts it.
I will, but note:
$ ./scripts/get_maintainer.pl -f drivers/net/xen-netfront.c
Konrad Rzeszutek Wilk <[email protected]> (supporter:XEN HYPERVISOR IN...)
Jeremy Fitzhardinge <[email protected]> (supporter:XEN HYPERVISOR IN...)
[email protected] (moderated list:XEN HYPERVISOR IN...)
[email protected] (open list:XEN HYPERVISOR IN...)
[email protected] (open list:NETWORKING DRIVERS)
[email protected] (open list)Strictly speaking I maintain netback not front, so Wei please remember to CC the right people (mainly Konrad) as well as me.
BTW I think this separation is a good thing since it keeps changes to the protocol "honest". Doesn't matter so much for this particular patch since don't think it actually touches the protocol.
Ian.
Quoted 27 lines · Ian Campbell
Quoted 15 lines · David Miller
From: Wei Liu <[email protected]>
Date: Sat, 21 Sep 2013 17:05:43 +0100drivers/net/xen-netfront.c static struct net_device *xennet_create_dev(struct xenbus_device *dev) · line 1377
Quoted 7 lines
drivers/net/xen-netfront.c +2
-1@@ -1371,7 +1373,8 @@ static struct net_device *xennet_create_dev(struct xenbus_device *dev)netif_napi_add (netdev, &np->napi, xennet_poll,64 ); netdev->features =NETIF_F_IP_CSUM |NETIF_F_RXCSUM |NETIF_F_GSO_ROBUST ; - netdev->hw_features =NETIF_F_IP_CSUM |NETIF_F_SG |NETIF_F_TSO ; + netdev->hw_features =NETIF_F_IP_CSUM |NETIF_F_SG |NETIF_F_TSO | +NETIF_F_GRO ;Please post a new version of this patch with the feedback you've been given integrated, in particular with this part removed because it is not necessary.
Quoted 1 line
Ian, please review the patch when Wei posts it.
I will, but note:
$ ./scripts/get_maintainer.pl -f drivers/net/xen-netfront.c Konrad Rzeszutek Wilk <[email protected]> (supporter:XEN HYPERVISOR IN...) Jeremy Fitzhardinge <[email protected]> (supporter:XEN HYPERVISOR IN...) [email protected] (moderated list:XEN HYPERVISOR IN...) [email protected] (open list:XEN HYPERVISOR IN...) [email protected] (open list:NETWORKING DRIVERS) [email protected] (open list)
Quoted 2 lines
Strictly speaking I maintain netback not front, so Wei please remember to CC the right people (mainly Konrad) as well as me.
Which was Acked:
http://mid.gmane.org/[email protected]
Quoted 12 lines
BTW I think this separation is a good thing since it keeps changes to the protocol "honest". Doesn't matter so much for this particular patch since don't think it actually touches the protocol.
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 27 lines · Ian Campbell
Quoted 15 lines · David Miller
From: Wei Liu <[email protected]>
Date: Sat, 21 Sep 2013 17:05:43 +0100drivers/net/xen-netfront.c static struct net_device *xennet_create_dev(struct xenbus_device *dev) · line 1377
Quoted 7 lines
drivers/net/xen-netfront.c +2
-1@@ -1371,7 +1373,8 @@ static struct net_device *xennet_create_dev(struct xenbus_device *dev)netif_napi_add (netdev, &np->napi, xennet_poll,64 ); netdev->features =NETIF_F_IP_CSUM |NETIF_F_RXCSUM |NETIF_F_GSO_ROBUST ; - netdev->hw_features =NETIF_F_IP_CSUM |NETIF_F_SG |NETIF_F_TSO ; + netdev->hw_features =NETIF_F_IP_CSUM |NETIF_F_SG |NETIF_F_TSO | +NETIF_F_GRO ;Please post a new version of this patch with the feedback you've been given integrated, in particular with this part removed because it is not necessary.
Quoted 1 line
Ian, please review the patch when Wei posts it.
I will, but note:
$ ./scripts/get_maintainer.pl -f drivers/net/xen-netfront.c Konrad Rzeszutek Wilk <[email protected]> (supporter:XEN HYPERVISOR IN...) Jeremy Fitzhardinge <[email protected]> (supporter:XEN HYPERVISOR IN...) [email protected] (moderated list:XEN HYPERVISOR IN...) [email protected] (open list:XEN HYPERVISOR IN...) [email protected] (open list:NETWORKING DRIVERS) [email protected] (open list)
Quoted 2 lines
Strictly speaking I maintain netback not front, so Wei please remember to CC the right people (mainly Konrad) as well as me.
Which was Acked:
http://mid.gmane.org/[email protected]
Quoted 12 lines
BTW I think this separation is a good thing since it keeps changes to the protocol "honest". Doesn't matter so much for this particular patch since don't think it actually touches the protocol.
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel