linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch v1, kernel 3.2.1] RTNETLINK adjusting values of min_ifinfo_dump_size
       [not found] <30372884.681327480899559.JavaMail.root@5-MeO-DMT.ynet.sk>
@ 2012-01-25  8:43 ` Stefan Gula
  2012-01-26  2:36   ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Gula @ 2012-01-25  8:43 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, linux-kernel

From: Stefan Gula <steweg@gmail.com>

This patch extends the rtnetlink.c. The problem is that calcit, which
returns the value min_ifinfo_dump_size, is called without ability to
get device info as well (struct net_device *dev is not accessible from
it). This create a problem if required size of struct sk_buff *skb is
not enough big to comply with all data returned by fill_info function
for the interface that required size can vary over time, e.g. some
dynamic structures will be putted to skb like hlists or lists. To do
this patch extends the do_setlink function with recalculating of
min_ifinfo_dump_size accordingly to device type and get_size
functions.

Signed-off-by: Stefan Gula <steweg@gmail.com>

---

code needed to be ok before I can resubmit my macvlan source mode patch

--- linux-3.2.1-orig/net/core/rtnetlink.c	2012-01-12 20:42:45.000000000 +0100
+++ linux/net/core/rtnetlink.c	2012-01-24 14:26:58.083219352 +0100
@@ -1506,6 +1506,9 @@ errout:
 
 	if (send_addr_notify)
 		call_netdevice_notifiers(NETDEV_CHANGEADDR, dev);
+	min_ifinfo_dump_size = max_t(u16, if_nlmsg_size(dev),
+					min_ifinfo_dump_size);
+
 	return err;
 }

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

* Re: [patch v1, kernel 3.2.1] RTNETLINK adjusting values of min_ifinfo_dump_size
  2012-01-25  8:43 ` [patch v1, kernel 3.2.1] RTNETLINK adjusting values of min_ifinfo_dump_size Stefan Gula
@ 2012-01-26  2:36   ` David Miller
  2012-01-26 11:01     ` Štefan Gula
  0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2012-01-26  2:36 UTC (permalink / raw)
  To: steweg; +Cc: netdev, linux-kernel

From: Stefan Gula <steweg@ynet.sk>
Date: Wed, 25 Jan 2012 09:43:15 +0100 (CET)

> From: Stefan Gula <steweg@gmail.com>
> 
> This patch extends the rtnetlink.c. The problem is that calcit, which
> returns the value min_ifinfo_dump_size, is called without ability to
> get device info as well (struct net_device *dev is not accessible from
> it). This create a problem if required size of struct sk_buff *skb is
> not enough big to comply with all data returned by fill_info function
> for the interface that required size can vary over time, e.g. some
> dynamic structures will be putted to skb like hlists or lists. To do
> this patch extends the do_setlink function with recalculating of
> min_ifinfo_dump_size accordingly to device type and get_size
> functions.
> 
> Signed-off-by: Stefan Gula <steweg@gmail.com>

This commit message is terrible, and the reason I know it's terrible
is because even after reading it I still had to go read the code
in order to understand what your change even does or why it's even
necessary.

How about this:

	Setting link parameters on a netdevice changes the value
	of if_nlmsg_size(), therefore it is necessary to recalculate
	min_ifinfo_dump_size.


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

* Re: [patch v1, kernel 3.2.1] RTNETLINK adjusting values of min_ifinfo_dump_size
  2012-01-26  2:36   ` David Miller
@ 2012-01-26 11:01     ` Štefan Gula
  2012-01-26 18:30       ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Štefan Gula @ 2012-01-26 11:01 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-kernel

2012/1/26 David Miller <davem@davemloft.net>:
> From: Stefan Gula <steweg@ynet.sk>
> Date: Wed, 25 Jan 2012 09:43:15 +0100 (CET)
>
>> From: Stefan Gula <steweg@gmail.com>
>>
>> This patch extends the rtnetlink.c. The problem is that calcit, which
>> returns the value min_ifinfo_dump_size, is called without ability to
>> get device info as well (struct net_device *dev is not accessible from
>> it). This create a problem if required size of struct sk_buff *skb is
>> not enough big to comply with all data returned by fill_info function
0>> for the interface that required size can vary over time, e.g. some
>> dynamic structures will be putted to skb like hlists or lists. To do
>> this patch extends the do_setlink function with recalculating of
>> min_ifinfo_dump_size accordingly to device type and get_size
>> functions.
>>
>> Signed-off-by: Stefan Gula <steweg@gmail.com>
>
> This commit message is terrible, and the reason I know it's terrible
> is because even after reading it I still had to go read the code
> in order to understand what your change even does or why it's even
> necessary.
>
> How about this:
>
>        Setting link parameters on a netdevice changes the value
>        of if_nlmsg_size(), therefore it is necessary to recalculate
>        min_ifinfo_dump_size.
>
Sound good... do I have to resubmit the patch with the correct description?

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

* Re: [patch v1, kernel 3.2.1] RTNETLINK adjusting values of min_ifinfo_dump_size
  2012-01-26 11:01     ` Štefan Gula
@ 2012-01-26 18:30       ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2012-01-26 18:30 UTC (permalink / raw)
  To: steweg; +Cc: netdev, linux-kernel

From: Štefan Gula <steweg@ynet.sk>
Date: Thu, 26 Jan 2012 12:01:44 +0100

> 2012/1/26 David Miller <davem@davemloft.net>:
>> From: Stefan Gula <steweg@ynet.sk>
>> Date: Wed, 25 Jan 2012 09:43:15 +0100 (CET)
>>
>>> From: Stefan Gula <steweg@gmail.com>
>>>
>>> This patch extends the rtnetlink.c. The problem is that calcit, which
>>> returns the value min_ifinfo_dump_size, is called without ability to
>>> get device info as well (struct net_device *dev is not accessible from
>>> it). This create a problem if required size of struct sk_buff *skb is
>>> not enough big to comply with all data returned by fill_info function
> 0>> for the interface that required size can vary over time, e.g. some
>>> dynamic structures will be putted to skb like hlists or lists. To do
>>> this patch extends the do_setlink function with recalculating of
>>> min_ifinfo_dump_size accordingly to device type and get_size
>>> functions.
>>>
>>> Signed-off-by: Stefan Gula <steweg@gmail.com>
>>
>> This commit message is terrible, and the reason I know it's terrible
>> is because even after reading it I still had to go read the code
>> in order to understand what your change even does or why it's even
>> necessary.
>>
>> How about this:
>>
>>        Setting link parameters on a netdevice changes the value
>>        of if_nlmsg_size(), therefore it is necessary to recalculate
>>        min_ifinfo_dump_size.
>>
> Sound good... do I have to resubmit the patch with the correct description?

Yes.

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

end of thread, other threads:[~2012-01-26 18:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <30372884.681327480899559.JavaMail.root@5-MeO-DMT.ynet.sk>
2012-01-25  8:43 ` [patch v1, kernel 3.2.1] RTNETLINK adjusting values of min_ifinfo_dump_size Stefan Gula
2012-01-26  2:36   ` David Miller
2012-01-26 11:01     ` Štefan Gula
2012-01-26 18:30       ` 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).