virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] staging: hv: Fix missing functions for net_device_ops (resubmit)
@ 2010-08-02 17:46 Haiyang Zhang
  0 siblings, 0 replies; 4+ messages in thread
From: Haiyang Zhang @ 2010-08-02 17:46 UTC (permalink / raw)
  To: 'linux-kernel@vger.kernel.org',
	'devel@driverdev.osuosl.org',
	"'virtualization@lists.osdl.org'" <virtualiz>

From: Haiyang Zhang <haiyangz@microsoft.com>

Subject: staging: hv: Fix missing functions for net_device_ops
  Unlike in older kernels, ether_setup() no longer sets default
functions. We need to put them into net_device_ops. For example,
eth_change_mtu prevents setting MTU beyond 1500. This is necessary
because we don't support jumbo frame at this time.
  It affects kernel 2.6.32 and later, which are all versions
containing Hyper-V drivers.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>

---
 drivers/staging/hv/netvsc_drv.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
index 56e1157..64a0114 100644
--- a/drivers/staging/hv/netvsc_drv.c
+++ b/drivers/staging/hv/netvsc_drv.c
@@ -327,6 +327,9 @@ static const struct net_device_ops device_ops = {
 	.ndo_stop =			netvsc_close,
 	.ndo_start_xmit =		netvsc_start_xmit,
 	.ndo_set_multicast_list =	netvsc_set_multicast_list,
+	.ndo_change_mtu =		eth_change_mtu,
+	.ndo_validate_addr =		eth_validate_addr,
+	.ndo_set_mac_address =		eth_mac_addr,
 };
 
 static int netvsc_probe(struct device *device)
-- 
1.6.3.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] staging: hv: Fix missing functions for net_device_ops (resubmit)
       [not found] <1FB5E1D5CA062146B38059374562DF7280E8556B@TK5EX14MBXC121.redmond.corp.microsoft.com>
@ 2010-08-03  1:30 ` Greg KH
  2010-08-03 18:21   ` Haiyang Zhang
  0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2010-08-03  1:30 UTC (permalink / raw)
  To: Haiyang Zhang
  Cc: 'linux-kernel@vger.kernel.org',
	'devel@driverdev.osuosl.org',
	'virtualization@lists.osdl.org', 'gregkh@suse.de',
	Hank Janssen

On Mon, Aug 02, 2010 at 05:46:01PM +0000, Haiyang Zhang wrote:
> From: Haiyang Zhang <haiyangz@microsoft.com>
> 
> Subject: staging: hv: Fix missing functions for net_device_ops
>   Unlike in older kernels, ether_setup() no longer sets default

Why put the subject in the body of the email?  This forces me to edit it
again :(

> functions. We need to put them into net_device_ops. For example,
> eth_change_mtu prevents setting MTU beyond 1500. This is necessary
> because we don't support jumbo frame at this time.

What does this mean?  Is it a bug?  Just not going as fast as possible?
Something else?

>   It affects kernel 2.6.32 and later, which are all versions
> containing Hyper-V drivers.

So is this fixing a bug that needs to be backported to these older
kernels (i.e. the staging tree?)  Is this something that is causing
people problems?

Third time's a charm?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH 1/1] staging: hv: Fix missing functions for net_device_ops (resubmit)
  2010-08-03  1:30 ` [PATCH 1/1] staging: hv: Fix missing functions for net_device_ops (resubmit) Greg KH
@ 2010-08-03 18:21   ` Haiyang Zhang
  2010-08-03 18:43     ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Haiyang Zhang @ 2010-08-03 18:21 UTC (permalink / raw)
  To: Greg KH
  Cc: 'linux-kernel@vger.kernel.org',
	'devel@driverdev.osuosl.org',
	'virtualization@lists.osdl.org', 'gregkh@suse.de',
	Hank Janssen

> From: Greg KH [mailto:greg@kroah.com]
> Sent: Monday, August 02, 2010 9:30 PM
> Why put the subject in the body of the email?  This forces me to edit
> it again :(

Sure, I'll remove it.

> > functions. We need to put them into net_device_ops. For example,
> > eth_change_mtu prevents setting MTU beyond 1500. This is necessary
> > because we don't support jumbo frame at this time.
> 
> What does this mean?  Is it a bug?  Just not going as fast as possible?
> Something else?

Yes, it's a bug when porting Linux IC from 2.6.27 to 2.6.32. In 2.6.27,
the default functions for Ethernet, like eth_change_mtu(), were assigned
by ether_setup(). But in 2.6.32, these function pointers moved to
net_device_ops structure and no longer be assigned in ether_setup(). So we
need to set these functions in our driver code. It will ensure the MTU won't
be set beyong 1500. Otherwise, this can cause an error on the server side,
because the HyperV linux driver doesn't support jumbo frame yet.

> >   It affects kernel 2.6.32 and later, which are all versions
> > containing Hyper-V drivers.
> 
> So is this fixing a bug that needs to be backported to these older
> kernels (i.e. the staging tree?)  Is this something that is causing
> people problems?

Yes it should be backported. The bug can cause error on guest and host.

Thanks,

- Haiyang

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] staging: hv: Fix missing functions for net_device_ops (resubmit)
  2010-08-03 18:21   ` Haiyang Zhang
@ 2010-08-03 18:43     ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2010-08-03 18:43 UTC (permalink / raw)
  To: Haiyang Zhang
  Cc: Greg KH, 'linux-kernel@vger.kernel.org',
	'devel@driverdev.osuosl.org',
	'virtualization@lists.osdl.org', Hank Janssen

On Tue, Aug 03, 2010 at 06:21:50PM +0000, Haiyang Zhang wrote:
> > From: Greg KH [mailto:greg@kroah.com]
> > Sent: Monday, August 02, 2010 9:30 PM
> > Why put the subject in the body of the email?  This forces me to edit
> > it again :(
> 
> Sure, I'll remove it.

thanks.

> > > functions. We need to put them into net_device_ops. For example,
> > > eth_change_mtu prevents setting MTU beyond 1500. This is necessary
> > > because we don't support jumbo frame at this time.
> > 
> > What does this mean?  Is it a bug?  Just not going as fast as possible?
> > Something else?
> 
> Yes, it's a bug when porting Linux IC from 2.6.27 to 2.6.32. In 2.6.27,
> the default functions for Ethernet, like eth_change_mtu(), were assigned
> by ether_setup(). But in 2.6.32, these function pointers moved to
> net_device_ops structure and no longer be assigned in ether_setup(). So we
> need to set these functions in our driver code. It will ensure the MTU won't
> be set beyong 1500. Otherwise, this can cause an error on the server side,
> because the HyperV linux driver doesn't support jumbo frame yet.

Wonderful, why not put this type of full information in the patch itself
so that people can understand and rememeber what is going on when they
look at it in a few months time?

> > >   It affects kernel 2.6.32 and later, which are all versions
> > > containing Hyper-V drivers.
> > 
> > So is this fixing a bug that needs to be backported to these older
> > kernels (i.e. the staging tree?)  Is this something that is causing
> > people problems?
> 
> Yes it should be backported. The bug can cause error on guest and host.

Than please ask for it to be backported in the future.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-08-03 18:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1FB5E1D5CA062146B38059374562DF7280E8556B@TK5EX14MBXC121.redmond.corp.microsoft.com>
2010-08-03  1:30 ` [PATCH 1/1] staging: hv: Fix missing functions for net_device_ops (resubmit) Greg KH
2010-08-03 18:21   ` Haiyang Zhang
2010-08-03 18:43     ` Greg KH
2010-08-02 17:46 Haiyang Zhang

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).