* [PATCH] ibmveth: Add a proper check for the availability of the checksum features
@ 2017-01-24 6:28 Thomas Huth
2017-01-24 20:15 ` David Miller
2017-01-24 21:28 ` Thomas Falcon
0 siblings, 2 replies; 3+ messages in thread
From: Thomas Huth @ 2017-01-24 6:28 UTC (permalink / raw)
To: Thomas Falcon, netdev; +Cc: linuxppc-dev
When using the ibmveth driver in a KVM/QEMU based VM, it currently
always prints out a scary error message like this when it is started:
ibmveth 71000003 (unregistered net_device): unable to change
checksum offload settings. 1 rc=-2 ret_attr=71000003
This happens because the driver always tries to enable the checksum
offloading without checking for the availability of this feature first.
QEMU does not support checksum offloading for the spapr-vlan device,
thus we always get the error message here.
According to the LoPAPR specification, the "ibm,illan-options" property
of the corresponding device tree node should be checked first to see
whether the H_ILLAN_ATTRIUBTES hypercall and thus the checksum offloading
feature is available. Thus let's do this in the ibmveth driver, too, so
that the error message is really only limited to cases where something
goes wrong, and does not occur if the feature is just missing.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
drivers/net/ethernet/ibm/ibmveth.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c
index a831f94..309f5c6 100644
--- a/drivers/net/ethernet/ibm/ibmveth.c
+++ b/drivers/net/ethernet/ibm/ibmveth.c
@@ -1601,8 +1601,11 @@ static int ibmveth_probe(struct vio_dev *dev, const struct vio_device_id *id)
netdev->netdev_ops = &ibmveth_netdev_ops;
netdev->ethtool_ops = &netdev_ethtool_ops;
SET_NETDEV_DEV(netdev, &dev->dev);
- netdev->hw_features = NETIF_F_SG | NETIF_F_RXCSUM |
- NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
+ netdev->hw_features = NETIF_F_SG;
+ if (vio_get_attribute(dev, "ibm,illan-options", NULL) != NULL) {
+ netdev->hw_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
+ NETIF_F_RXCSUM;
+ }
netdev->features |= netdev->hw_features;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ibmveth: Add a proper check for the availability of the checksum features
2017-01-24 6:28 [PATCH] ibmveth: Add a proper check for the availability of the checksum features Thomas Huth
@ 2017-01-24 20:15 ` David Miller
2017-01-24 21:28 ` Thomas Falcon
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2017-01-24 20:15 UTC (permalink / raw)
To: thuth; +Cc: tlfalcon, netdev, linuxppc-dev
From: Thomas Huth <thuth@redhat.com>
Date: Tue, 24 Jan 2017 07:28:41 +0100
> When using the ibmveth driver in a KVM/QEMU based VM, it currently
> always prints out a scary error message like this when it is started:
>
> ibmveth 71000003 (unregistered net_device): unable to change
> checksum offload settings. 1 rc=-2 ret_attr=71000003
>
> This happens because the driver always tries to enable the checksum
> offloading without checking for the availability of this feature first.
> QEMU does not support checksum offloading for the spapr-vlan device,
> thus we always get the error message here.
> According to the LoPAPR specification, the "ibm,illan-options" property
> of the corresponding device tree node should be checked first to see
> whether the H_ILLAN_ATTRIUBTES hypercall and thus the checksum offloading
> feature is available. Thus let's do this in the ibmveth driver, too, so
> that the error message is really only limited to cases where something
> goes wrong, and does not occur if the feature is just missing.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ibmveth: Add a proper check for the availability of the checksum features
2017-01-24 6:28 [PATCH] ibmveth: Add a proper check for the availability of the checksum features Thomas Huth
2017-01-24 20:15 ` David Miller
@ 2017-01-24 21:28 ` Thomas Falcon
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Falcon @ 2017-01-24 21:28 UTC (permalink / raw)
To: Thomas Huth, netdev; +Cc: linuxppc-dev
On 01/24/2017 12:28 AM, Thomas Huth wrote:
> When using the ibmveth driver in a KVM/QEMU based VM, it currently
> always prints out a scary error message like this when it is started:
>
> ibmveth 71000003 (unregistered net_device): unable to change
> checksum offload settings. 1 rc=-2 ret_attr=71000003
>
> This happens because the driver always tries to enable the checksum
> offloading without checking for the availability of this feature first.
> QEMU does not support checksum offloading for the spapr-vlan device,
> thus we always get the error message here.
> According to the LoPAPR specification, the "ibm,illan-options" property
> of the corresponding device tree node should be checked first to see
> whether the H_ILLAN_ATTRIUBTES hypercall and thus the checksum offloading
> feature is available. Thus let's do this in the ibmveth driver, too, so
> that the error message is really only limited to cases where something
> goes wrong, and does not occur if the feature is just missing.
Thanks a lot for this patch, Thomas. Was going to give an Ack, but its already been applied :)
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> drivers/net/ethernet/ibm/ibmveth.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c
> index a831f94..309f5c6 100644
> --- a/drivers/net/ethernet/ibm/ibmveth.c
> +++ b/drivers/net/ethernet/ibm/ibmveth.c
> @@ -1601,8 +1601,11 @@ static int ibmveth_probe(struct vio_dev *dev, const struct vio_device_id *id)
> netdev->netdev_ops = &ibmveth_netdev_ops;
> netdev->ethtool_ops = &netdev_ethtool_ops;
> SET_NETDEV_DEV(netdev, &dev->dev);
> - netdev->hw_features = NETIF_F_SG | NETIF_F_RXCSUM |
> - NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
> + netdev->hw_features = NETIF_F_SG;
> + if (vio_get_attribute(dev, "ibm,illan-options", NULL) != NULL) {
> + netdev->hw_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
> + NETIF_F_RXCSUM;
> + }
>
> netdev->features |= netdev->hw_features;
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-01-24 21:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-24 6:28 [PATCH] ibmveth: Add a proper check for the availability of the checksum features Thomas Huth
2017-01-24 20:15 ` David Miller
2017-01-24 21:28 ` Thomas Falcon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).