* [PATCH] atm: lec use dev_change_mtu
@ 2009-03-20 0:24 Stephen Hemminger
2009-03-20 7:26 ` Yang Hongyang
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Stephen Hemminger @ 2009-03-20 0:24 UTC (permalink / raw)
To: David Miller; +Cc: chas, netdev
Rather than calling device pointer directly (which is incorrect with
net_device_ops), use the standard dev_change_mtu. Compile tested only.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/net/atm/lec.c 2009-03-19 17:18:35.140652628 -0700
+++ b/net/atm/lec.c 2009-03-19 17:19:19.500777355 -0700
@@ -502,7 +502,7 @@ static int lec_atm_send(struct atm_vcc *
priv->lane2_ops = NULL;
if (priv->lane_version > 1)
priv->lane2_ops = &lane2_ops;
- if (dev->change_mtu(dev, mesg->content.config.mtu))
+ if (dev_set_mtu(dev, mesg->content.config.mtu))
printk("%s: change_mtu to %d failed\n", dev->name,
mesg->content.config.mtu);
priv->is_proxy = mesg->content.config.is_proxy;
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] atm: lec use dev_change_mtu
2009-03-20 0:24 [PATCH] atm: lec use dev_change_mtu Stephen Hemminger
@ 2009-03-20 7:26 ` Yang Hongyang
2009-03-20 7:45 ` Yang Hongyang
2009-03-21 20:37 ` David Miller
2 siblings, 0 replies; 6+ messages in thread
From: Yang Hongyang @ 2009-03-20 7:26 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: David Miller, chas, netdev
Stephen Hemminger wrote:
> Rather than calling device pointer directly (which is incorrect with
> net_device_ops), use the standard dev_change_mtu. Compile tested only.
^^^^^^^^^^^^Should it be dev_set_mtu?
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>
> --- a/net/atm/lec.c 2009-03-19 17:18:35.140652628 -0700
> +++ b/net/atm/lec.c 2009-03-19 17:19:19.500777355 -0700
> @@ -502,7 +502,7 @@ static int lec_atm_send(struct atm_vcc *
> priv->lane2_ops = NULL;
> if (priv->lane_version > 1)
> priv->lane2_ops = &lane2_ops;
> - if (dev->change_mtu(dev, mesg->content.config.mtu))
> + if (dev_set_mtu(dev, mesg->content.config.mtu))
> printk("%s: change_mtu to %d failed\n", dev->name,
> mesg->content.config.mtu);
> priv->is_proxy = mesg->content.config.is_proxy;
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
--
Regards
Yang Hongyang
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] atm: lec use dev_change_mtu
2009-03-20 0:24 [PATCH] atm: lec use dev_change_mtu Stephen Hemminger
2009-03-20 7:26 ` Yang Hongyang
@ 2009-03-20 7:45 ` Yang Hongyang
2009-03-20 7:48 ` David Miller
2009-03-21 20:37 ` David Miller
2 siblings, 1 reply; 6+ messages in thread
From: Yang Hongyang @ 2009-03-20 7:45 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: David Miller, chas, netdev
Stephen Hemminger wrote:
> Rather than calling device pointer directly (which is incorrect with
> net_device_ops), use the standard dev_change_mtu. Compile tested only.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>
> --- a/net/atm/lec.c 2009-03-19 17:18:35.140652628 -0700
> +++ b/net/atm/lec.c 2009-03-19 17:19:19.500777355 -0700
> @@ -502,7 +502,7 @@ static int lec_atm_send(struct atm_vcc *
> priv->lane2_ops = NULL;
> if (priv->lane_version > 1)
> priv->lane2_ops = &lane2_ops;
> - if (dev->change_mtu(dev, mesg->content.config.mtu))
> + if (dev_set_mtu(dev, mesg->content.config.mtu))
I think it's not correct.This dev->change_mtu is:
663 static int lec_change_mtu(struct net_device *dev, int new_mtu)
664 {
665 if ((new_mtu < 68) || (new_mtu > 18190))
666 return -EINVAL;
667 dev->mtu = new_mtu;
^^^^^^^^^^^^^^^^maybe should use dev_set_mtu() here.
668 return 0;
669 }
and it's not quite same as dev_set_mtu.
> printk("%s: change_mtu to %d failed\n", dev->name,
> mesg->content.config.mtu);
> priv->is_proxy = mesg->content.config.is_proxy;
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
--
Regards
Yang Hongyang
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] atm: lec use dev_change_mtu
2009-03-20 7:45 ` Yang Hongyang
@ 2009-03-20 7:48 ` David Miller
2009-03-20 7:59 ` Yang Hongyang
0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2009-03-20 7:48 UTC (permalink / raw)
To: yanghy; +Cc: shemminger, chas, netdev
From: Yang Hongyang <yanghy@cn.fujitsu.com>
Date: Fri, 20 Mar 2009 15:45:20 +0800
> Stephen Hemminger wrote:
> > Rather than calling device pointer directly (which is incorrect with
> > net_device_ops), use the standard dev_change_mtu. Compile tested only.
> >
> > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> >
> > --- a/net/atm/lec.c 2009-03-19 17:18:35.140652628 -0700
> > +++ b/net/atm/lec.c 2009-03-19 17:19:19.500777355 -0700
> > @@ -502,7 +502,7 @@ static int lec_atm_send(struct atm_vcc *
> > priv->lane2_ops = NULL;
> > if (priv->lane_version > 1)
> > priv->lane2_ops = &lane2_ops;
> > - if (dev->change_mtu(dev, mesg->content.config.mtu))
> > + if (dev_set_mtu(dev, mesg->content.config.mtu))
>
> I think it's not correct.This dev->change_mtu is:
> 663 static int lec_change_mtu(struct net_device *dev, int new_mtu)
> 664 {
> 665 if ((new_mtu < 68) || (new_mtu > 18190))
> 666 return -EINVAL;
> 667 dev->mtu = new_mtu;
> ^^^^^^^^^^^^^^^^maybe should use dev_set_mtu() here.
> 668 return 0;
> 669 }
>
> and it's not quite same as dev_set_mtu.
dev_set_mtu() calls netdev->ops->ndo_set_mtu() so it will call
this function you are quoting.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] atm: lec use dev_change_mtu
2009-03-20 7:48 ` David Miller
@ 2009-03-20 7:59 ` Yang Hongyang
0 siblings, 0 replies; 6+ messages in thread
From: Yang Hongyang @ 2009-03-20 7:59 UTC (permalink / raw)
To: David Miller; +Cc: shemminger, chas, netdev
David Miller wrote:
> From: Yang Hongyang <yanghy@cn.fujitsu.com>
> Date: Fri, 20 Mar 2009 15:45:20 +0800
>
>> Stephen Hemminger wrote:
>>> Rather than calling device pointer directly (which is incorrect with
>>> net_device_ops), use the standard dev_change_mtu. Compile tested only.
>>>
>>> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>>>
>>> --- a/net/atm/lec.c 2009-03-19 17:18:35.140652628 -0700
>>> +++ b/net/atm/lec.c 2009-03-19 17:19:19.500777355 -0700
>>> @@ -502,7 +502,7 @@ static int lec_atm_send(struct atm_vcc *
>>> priv->lane2_ops = NULL;
>>> if (priv->lane_version > 1)
>>> priv->lane2_ops = &lane2_ops;
>>> - if (dev->change_mtu(dev, mesg->content.config.mtu))
>>> + if (dev_set_mtu(dev, mesg->content.config.mtu))
>> I think it's not correct.This dev->change_mtu is:
>> 663 static int lec_change_mtu(struct net_device *dev, int new_mtu)
>> 664 {
>> 665 if ((new_mtu < 68) || (new_mtu > 18190))
>> 666 return -EINVAL;
>> 667 dev->mtu = new_mtu;
>> ^^^^^^^^^^^^^^^^maybe should use dev_set_mtu() here.
>> 668 return 0;
>> 669 }
>>
>> and it's not quite same as dev_set_mtu.
>
> dev_set_mtu() calls netdev->ops->ndo_set_mtu() so it will call
> this function you are quoting.
got it.:)
>
>
--
Regards
Yang Hongyang
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] atm: lec use dev_change_mtu
2009-03-20 0:24 [PATCH] atm: lec use dev_change_mtu Stephen Hemminger
2009-03-20 7:26 ` Yang Hongyang
2009-03-20 7:45 ` Yang Hongyang
@ 2009-03-21 20:37 ` David Miller
2 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2009-03-21 20:37 UTC (permalink / raw)
To: shemminger; +Cc: chas, netdev
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Thu, 19 Mar 2009 17:24:00 -0700
> Rather than calling device pointer directly (which is incorrect with
> net_device_ops), use the standard dev_change_mtu. Compile tested only.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Applied.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-03-21 20:38 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-20 0:24 [PATCH] atm: lec use dev_change_mtu Stephen Hemminger
2009-03-20 7:26 ` Yang Hongyang
2009-03-20 7:45 ` Yang Hongyang
2009-03-20 7:48 ` David Miller
2009-03-20 7:59 ` Yang Hongyang
2009-03-21 20:37 ` David Miller
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).