Message ID | 1349897005.2035.24.camel@joe-AO722 |
---|---|
State | Deferred, archived |
Delegated to: | David Miller |
Headers | show |
ipv4 and ipv6 use different styles for these tests. ipv4_is_<foo>(__be32) ipv6_addr_<foo>(struct in6_addr *) Perhaps it'd be good to convert the ipv4 tests to the ipv6 style. There are ~100 instances of ipv4_is_<foo> tests treewide. -- 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
Maybe all the is_<foo>_ether_addr functions should be renamed to eth_addr_<foo> for more api/style symmetry. $ git grep --name-only -E "\bis_\w+_ether_addr" | \ xargs sed -r -i -e 's/\bis_(\w+)_ether_addr\b/eth_addr_\1/g' $ git diff --shortstat 304 files changed, 690 insertions(+), 690 deletions(-) Maybe add #defines of the old names for a few releases. -- 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
On Thu, Oct 11, 2012 at 3:23 AM, Joe Perches <joe@perches.com> wrote: > Reduces object size and should be slightly faster. > > allyesconfig: > $ size net/core/pktgen.o* > text data bss dec hex filename > 52284 4321 11840 68445 10b5d net/core/pktgen.o.new > 52310 4293 11848 68451 10b63 net/core/pktgen.o.old > > Signed-off-by: Joe Perches <joe@perches.com> Looks good. This should go to -net, net-next is not open currently. Thanks. -- 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
> ipv4 and ipv6 use different styles for these tests. > > ipv4_is_<foo>(__be32) > ipv6_addr_<foo>(struct in6_addr *) I presume there is a 'const' in there ... > Perhaps it'd be good to convert the ipv4 tests to the ipv6 style. You don't want to force an IPv4 address (which might be in a register) be written out to stack. Taking the address also has implications for the optimiser. David -- 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
On Thu, 2012-10-11 at 09:11 +0100, David Laight wrote: > > ipv4 and ipv6 use different styles for these tests. > > > > ipv4_is_<foo>(__be32) > > ipv6_addr_<foo>(struct in6_addr *) > > I presume there is a 'const' in there ... > > > Perhaps it'd be good to convert the ipv4 tests to the ipv6 style. > > You don't want to force an IPv4 address (which might be in a register) > be written out to stack. > Taking the address also has implications for the optimiser. Of course not, I'm just talking about renaming. -- 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
From: Joe Perches <joe@perches.com> Date: Wed, 10 Oct 2012 12:23:25 -0700 > Reduces object size and should be slightly faster. > > allyesconfig: > $ size net/core/pktgen.o* > text data bss dec hex filename > 52284 4321 11840 68445 10b5d net/core/pktgen.o.new > 52310 4293 11848 68451 10b63 net/core/pktgen.o.old > > Signed-off-by: Joe Perches <joe@perches.com> Please resubmit when net-next opens. -- 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
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index 148e73d..a811a7d 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c @@ -2422,11 +2422,7 @@ static void mod_cur_headers(struct pktgen_dev *pkt_dev) } } else { /* IPV6 * */ - if (pkt_dev->min_in6_daddr.s6_addr32[0] == 0 && - pkt_dev->min_in6_daddr.s6_addr32[1] == 0 && - pkt_dev->min_in6_daddr.s6_addr32[2] == 0 && - pkt_dev->min_in6_daddr.s6_addr32[3] == 0) ; - else { + if (!ipv6_addr_any(&pkt_dev->min_in6_daddr)) { int i; /* Only random destinations yet */