Re: [RESEND 2.6.27] netlink: Remove compat API for nested attributes

Previous thread: [PATCH -next] sysctl: simplify ->strategy by Alexey Dobriyan on Wednesday, August 27, 2008 - 10:02 pm. (1 message)

Next thread: Questions about Linux kernel network programming by Thiago Lacerda on Thursday, August 28, 2008 - 7:48 am. (6 messages)
From: Thomas Graf
Date: Thursday, August 28, 2008 - 7:00 am

Removes all _nested_compat() functions from the API. The prio qdisc
no longer requires them and netem has its own format anyway. Their
existance is only confusing.

Signed-off-by: Thomas Graf <tgraf@suug.ch>

Index: net-2.6/include/net/netlink.h
===================================================================
--- net-2.6.orig/include/net/netlink.h	2008-08-28 12:52:00.000000000 +0200
+++ net-2.6/include/net/netlink.h	2008-08-28 12:55:28.000000000 +0200
@@ -119,9 +119,6 @@
  * Nested Attributes Construction:
  *   nla_nest_start(skb, type)		start a nested attribute
  *   nla_nest_end(skb, nla)		finalize a nested attribute
- *   nla_nest_compat_start(skb, type,	start a nested compat attribute
- *			   len, data)
- *   nla_nest_compat_end(skb, type)	finalize a nested compat attribute
  *   nla_nest_cancel(skb, nla)		cancel nested attribute construction
  *
  * Attribute Length Calculations:
@@ -156,7 +153,6 @@
  *   nla_find_nested()			find attribute in nested attributes
  *   nla_parse()			parse and validate stream of attrs
  *   nla_parse_nested()			parse nested attribuets
- *   nla_parse_nested_compat()		parse nested compat attributes
  *   nla_for_each_attr()		loop over all attributes
  *   nla_for_each_nested()		loop over the nested attributes
  *=========================================================================
@@ -751,35 +747,6 @@
 	return nla_parse(tb, maxtype, nla_data(nla), nla_len(nla), policy);
 }
 
-/**
- * nla_parse_nested_compat - parse nested compat attributes
- * @tb: destination array with maxtype+1 elements
- * @maxtype: maximum attribute type to be expected
- * @nla: attribute containing the nested attributes
- * @data: pointer to point to contained structure
- * @len: length of contained structure
- * @policy: validation policy
- *
- * Parse a nested compat attribute. The compat attribute contains a structure
- * and optionally a set of nested attributes. On success the data pointer
- * points to the nested data and tb contains the parsed ...
From: Thomas Graf
Date: Thursday, August 28, 2008 - 7:05 am

Removes all _nested_compat() functions from the API. The prio qdisc
no longer requires them and netem has its own format anyway. Their
existance is only confusing.

Resend: Also remove the wrapper macro.

Signed-off-by: Thomas Graf <tgraf@suug.ch>

Index: net-2.6/include/net/netlink.h
===================================================================
--- net-2.6.orig/include/net/netlink.h	2008-08-28 12:52:00.000000000 +0200
+++ net-2.6/include/net/netlink.h	2008-08-28 16:02:24.000000000 +0200
@@ -119,9 +119,6 @@
  * Nested Attributes Construction:
  *   nla_nest_start(skb, type)		start a nested attribute
  *   nla_nest_end(skb, nla)		finalize a nested attribute
- *   nla_nest_compat_start(skb, type,	start a nested compat attribute
- *			   len, data)
- *   nla_nest_compat_end(skb, type)	finalize a nested compat attribute
  *   nla_nest_cancel(skb, nla)		cancel nested attribute construction
  *
  * Attribute Length Calculations:
@@ -156,7 +153,6 @@
  *   nla_find_nested()			find attribute in nested attributes
  *   nla_parse()			parse and validate stream of attrs
  *   nla_parse_nested()			parse nested attribuets
- *   nla_parse_nested_compat()		parse nested compat attributes
  *   nla_for_each_attr()		loop over all attributes
  *   nla_for_each_nested()		loop over the nested attributes
  *=========================================================================
@@ -752,39 +748,6 @@
 }
 
 /**
- * nla_parse_nested_compat - parse nested compat attributes
- * @tb: destination array with maxtype+1 elements
- * @maxtype: maximum attribute type to be expected
- * @nla: attribute containing the nested attributes
- * @data: pointer to point to contained structure
- * @len: length of contained structure
- * @policy: validation policy
- *
- * Parse a nested compat attribute. The compat attribute contains a structure
- * and optionally a set of nested attributes. On success the data pointer
- * points to the nested data and tb contains the parsed attributes
- * (see ...
From: Alexander Duyck
Date: Tuesday, September 2, 2008 - 2:46 pm

I don't think we need to do anything as drastic as completely throwing 
out this part of the Kernel ABI.  This is what I have been trying to get 
at all along.  All we need to do is revert the two patches that we 

This is the one section of this patch that I do completely agree with. 
There is no need to generate a nested compat attribute when there is 
nothing there to nest.  Since "multiqueue" is gone, this change can be 
made to just clean up the netlink portion of prio.

Thanks,

Alex
--

From: David Miller
Date: Tuesday, September 2, 2008 - 4:04 pm

From: Alexander Duyck <alexander.h.duyck@intel.com>

He's removing it because in 2.6.27 and later, besides netem, there are no
other users.  And we don't want to encourage new uses of this thing.

And all of that, I agree with.
--

From: Thomas Graf
Date: Tuesday, September 2, 2008 - 4:20 pm

Ever since the multiqueue bits have been removed from prio in net-next,
prio no longer requires the compat functions which leaves netem as the 
sole user. As you know, netem isn't really using the "compat" format but
instead uses its own format which was the origin of all this trouble.
Therefore I propose to move the current nla_parse_nested_compat() code
to netem and remove the API alltogether since there is no real user of
the original compat interface anymore. Leaving them around would only
encourage new code to use it.

Note that this patch is against the net-next tree which is not affected
by the prio regression (as the multiqueue bits have been removed) and
does not aim at resolving the regression. See my separate patch against
the stable tree which aims at resovling the prio regression.
Alternatively, reverting Patrick's and my patch in the stable tree is
perfectly fine with me as well.
--

From: Alexander Duyck
Date: Tuesday, September 2, 2008 - 5:27 pm

That is the point of code like this.  It defines a standard set of tools 
for extending an existing netlink interface.  If nothing else we should 
standardize on the netem approach for both parsing and creation since 

I saw your patches against the stable trees, and I would be happy with 
your solution or the reverting of the patches as long as one of them is 
implemented.

Thanks,

Alex
--

From: David Miller
Date: Tuesday, September 2, 2008 - 5:34 pm

From: Alexander Duyck <alexander.h.duyck@intel.com>

If there are no more users, and the netem case is a specialized format
we don't want to encourage anyone to ever use in the future (and we
certainlt DON'T), we delete the interface.
--

From: David Miller
Date: Tuesday, September 2, 2008 - 5:30 pm

From: Thomas Graf <tgraf@suug.ch>

Applied to net-next-2.6, thanks Thomas.
--

Previous thread: [PATCH -next] sysctl: simplify ->strategy by Alexey Dobriyan on Wednesday, August 27, 2008 - 10:02 pm. (1 message)

Next thread: Questions about Linux kernel network programming by Thiago Lacerda on Thursday, August 28, 2008 - 7:48 am. (6 messages)