Paul Durrant
2013-Oct-11 15:06 UTC
[PATCH net-next v4 3/5] xen-netback: Unconditionally set NETIF_F_RXCSUM
There is no mechanism to insist that a guest always generates a packet with good checksum (at least for IPv4) so we must handle checksum offloading from the guest and hence should set NETIF_F_RXCSUM. Signed-off-by: Paul Durrant <paul.durrant@citrix.com> Cc: Wei Liu <wei.liu2@citrix.com> Cc: David Vrabel <david.vrabel@citrix.com> Cc: Ian Campbell <ian.campbell@citrix.com> --- drivers/net/xen-netback/interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c index 8e92783..cb0d8ea 100644 --- a/drivers/net/xen-netback/interface.c +++ b/drivers/net/xen-netback/interface.c @@ -321,7 +321,7 @@ struct xenvif *xenvif_alloc(struct device *parent, domid_t domid, dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | NETIF_F_TSO; - dev->features = dev->hw_features; + dev->features = dev->hw_features | NETIF_F_RXCSUM; SET_ETHTOOL_OPS(dev, &xenvif_ethtool_ops); dev->tx_queue_len = XENVIF_QUEUE_LENGTH; -- 1.7.10.4
Ian Campbell
2013-Oct-14 10:56 UTC
Re: [PATCH net-next v4 3/5] xen-netback: Unconditionally set NETIF_F_RXCSUM
On Fri, 2013-10-11 at 16:06 +0100, Paul Durrant wrote:> There is no mechanism to insist that a guest always generates a packet > with good checksum (at least for IPv4)Isn''t this what feature-no-csum-offload is?> so we must handle checksum > offloading from the guest and hence should set NETIF_F_RXCSUM. > > Signed-off-by: Paul Durrant <paul.durrant@citrix.com> > Cc: Wei Liu <wei.liu2@citrix.com> > Cc: David Vrabel <david.vrabel@citrix.com> > Cc: Ian Campbell <ian.campbell@citrix.com> > --- > drivers/net/xen-netback/interface.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c > index 8e92783..cb0d8ea 100644 > --- a/drivers/net/xen-netback/interface.c > +++ b/drivers/net/xen-netback/interface.c > @@ -321,7 +321,7 @@ struct xenvif *xenvif_alloc(struct device *parent, domid_t domid, > dev->hw_features = NETIF_F_SG | > NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | > NETIF_F_TSO; > - dev->features = dev->hw_features; > + dev->features = dev->hw_features | NETIF_F_RXCSUM; > SET_ETHTOOL_OPS(dev, &xenvif_ethtool_ops); > > dev->tx_queue_len = XENVIF_QUEUE_LENGTH;
Paul Durrant
2013-Oct-14 11:03 UTC
Re: [PATCH net-next v4 3/5] xen-netback: Unconditionally set NETIF_F_RXCSUM
> -----Original Message----- > From: Ian Campbell > Sent: 14 October 2013 11:56 > To: Paul Durrant > Cc: xen-devel@lists.xen.org; netdev@vger.kernel.org; Wei Liu; David Vrabel > Subject: Re: [PATCH net-next v4 3/5] xen-netback: Unconditionally set > NETIF_F_RXCSUM > > On Fri, 2013-10-11 at 16:06 +0100, Paul Durrant wrote: > > There is no mechanism to insist that a guest always generates a packet > > with good checksum (at least for IPv4) > > Isn''t this what feature-no-csum-offload is? >Theoretically, yes, but netback does not have code to advertise that flag (and never has?) and I don''t see anything in xen-netfront that checks such a flag so I think we have to assume it''s not going to be honoured even if we were to introduce it now. Paul