* Re: [PATCH 1/1 v2] Ethtool: Add EEE support
From: Ben Hutchings @ 2012-06-08 18:14 UTC (permalink / raw)
To: Yuval Mintz; +Cc: netdev, eilong, peppe.cavallaro
In-Reply-To: <1339179089.2648.5.camel@bwh-desktop.uk.solarflarecom.com>
On Fri, 2012-06-08 at 19:11 +0100, Ben Hutchings wrote:
> On Wed, 2012-06-06 at 22:15 +0300, Yuval Mintz wrote:
> > This patch adds 2 new ethtool commands which can be
> > used to manipulate network interfaces' support in
> > EEE.
> [...]
> > @@ -3423,6 +3514,12 @@ static const struct option {
> > " [ hex on|off ]\n"
> > " [ offset N ]\n"
> > " [ length N ]\n" },
> > + { "--get-eee", 1, do_geee, "Get EEE settings"},
> > + { "--set-eee", 1, do_seee, "Set EEE settings",
> > + " [ eee on|off ]\n"
> > + " [ advertise %x ]\n"
> > + " [ tx-lpi on|off ]\n"
> > + " [ tx-timer %d ]\n"},
> [...]
>
> Another thing: the long options are generally --foo to set/change foo
> settings and --show-foo to get/show foo settings. Please rename these
> options to match.
Hmm, we already have a lot of --set-foo options, so never mind that.
But do change --get-eee to --show-eee.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* [PATCH ethtool] Make link mode listing in dump_link_caps() a data-driven loop
From: Ben Hutchings @ 2012-06-08 18:25 UTC (permalink / raw)
To: netdev
I've committed the following change.
Ben.
---
This removes lots of repeated code and makes it trivial to support
additional modes.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
ethtool.c | 99 +++++++++++++++++++------------------------------------------
1 files changed, 31 insertions(+), 68 deletions(-)
diff --git a/ethtool.c b/ethtool.c
index f09a032..3576f4c 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -444,8 +444,25 @@ static void dump_supported(struct ethtool_cmd *ep)
static void
dump_link_caps(const char *prefix, const char *an_prefix, u32 mask)
{
+ static const struct {
+ int same_line; /* print on same line as previous */
+ u32 value;
+ const char *name;
+ } mode_defs[] = {
+ { 0, ADVERTISED_10baseT_Half, "10baseT/Half" },
+ { 1, ADVERTISED_10baseT_Full, "10baseT/Full" },
+ { 0, ADVERTISED_100baseT_Half, "100baseT/Half" },
+ { 1, ADVERTISED_100baseT_Full, "100baseT/Full" },
+ { 0, ADVERTISED_1000baseT_Half, "1000baseT/Half" },
+ { 1, ADVERTISED_1000baseT_Full, "1000baseT/Full" },
+ { 0, ADVERTISED_1000baseKX_Full, "1000baseKX/Full" },
+ { 0, ADVERTISED_2500baseX_Full, "2500baseX/Full" },
+ { 0, ADVERTISED_10000baseT_Full, "10000baseT/Full" },
+ { 0, ADVERTISED_10000baseKX4_Full, "10000baseKX4/Full" },
+ { 0, ADVERTISED_20000baseMLD2_Full, "20000baseMLD2/Full" },
+ };
int indent;
- int did1;
+ int did1, new_line_pend, i;
/* Indent just like the separate functions used to */
indent = strlen(prefix) + 14;
@@ -455,73 +472,19 @@ dump_link_caps(const char *prefix, const char *an_prefix, u32 mask)
fprintf(stdout, " %s link modes:%*s", prefix,
indent - (int)strlen(prefix) - 12, "");
did1 = 0;
- if (mask & ADVERTISED_10baseT_Half) {
- did1++; fprintf(stdout, "10baseT/Half ");
- }
- if (mask & ADVERTISED_10baseT_Full) {
- did1++; fprintf(stdout, "10baseT/Full ");
- }
- if (did1 && (mask & (ADVERTISED_100baseT_Half|ADVERTISED_100baseT_Full))) {
- fprintf(stdout, "\n");
- fprintf(stdout, " %*s", indent, "");
- }
- if (mask & ADVERTISED_100baseT_Half) {
- did1++; fprintf(stdout, "100baseT/Half ");
- }
- if (mask & ADVERTISED_100baseT_Full) {
- did1++; fprintf(stdout, "100baseT/Full ");
- }
- if (did1 && (mask & (ADVERTISED_1000baseT_Half|ADVERTISED_1000baseT_Full))) {
- fprintf(stdout, "\n");
- fprintf(stdout, " %*s", indent, "");
- }
- if (mask & ADVERTISED_1000baseT_Half) {
- did1++; fprintf(stdout, "1000baseT/Half ");
- }
- if (mask & ADVERTISED_1000baseT_Full) {
- did1++; fprintf(stdout, "1000baseT/Full ");
- }
- if (did1 && (mask & ADVERTISED_1000baseKX_Full)) {
- fprintf(stdout, "\n");
- fprintf(stdout, " %*s", indent, "");
- }
- if (mask & ADVERTISED_1000baseKX_Full) {
- did1++; fprintf(stdout, "1000baseKX/Full ");
- }
- if (did1 && (mask & ADVERTISED_2500baseX_Full)) {
- fprintf(stdout, "\n");
- fprintf(stdout, " %*s", indent, "");
- }
- if (mask & ADVERTISED_2500baseX_Full) {
- did1++; fprintf(stdout, "2500baseX/Full ");
- }
- if (did1 && (mask & ADVERTISED_10000baseT_Full)) {
- fprintf(stdout, "\n");
- fprintf(stdout, " %*s", indent, "");
- }
- if (mask & ADVERTISED_10000baseT_Full) {
- did1++; fprintf(stdout, "10000baseT/Full ");
- }
- if (did1 && (mask & ADVERTISED_10000baseKX4_Full)) {
- fprintf(stdout, "\n");
- fprintf(stdout, " %*s", indent, "");
- }
- if (mask & ADVERTISED_10000baseKX4_Full) {
- did1++; fprintf(stdout, "10000baseKX4/Full ");
- }
- if (did1 && (mask & ADVERTISED_20000baseMLD2_Full)) {
- fprintf(stdout, "\n");
- fprintf(stdout, " %*s", indent, "");
- }
- if (mask & ADVERTISED_20000baseMLD2_Full) {
- did1++; fprintf(stdout, "20000baseMLD2/Full ");
- }
- if (did1 && (mask & ADVERTISED_20000baseKR2_Full)) {
- fprintf(stdout, "\n");
- fprintf(stdout, " %*s", indent, "");
- }
- if (mask & ADVERTISED_20000baseKR2_Full) {
- did1++; fprintf(stdout, "20000baseKR2/Full ");
+ new_line_pend = 0;
+ for (i = 0; i < ARRAY_SIZE(mode_defs); i++) {
+ if (did1 && !mode_defs[i].same_line)
+ new_line_pend = 1;
+ if (mask & mode_defs[i].value) {
+ if (new_line_pend) {
+ fprintf(stdout, "\n");
+ fprintf(stdout, " %*s", indent, "");
+ new_line_pend = 0;
+ }
+ did1++;
+ fprintf(stdout, "%s ", mode_defs[i].name);
+ }
}
if (did1 == 0)
fprintf(stdout, "Not reported");
--
1.7.7.6
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply related
* formal way to map from pf to vfs when using VT-d?
From: Chris Friesen @ 2012-06-08 20:14 UTC (permalink / raw)
To: netdev, e1000-devel@lists.sourceforge.net, Kirsher, Jeffrey T,
Brandeburg, Jesse, Allan, Bruce W
Hi,
I'm using the igb/igbvf drivers. If I set igb.max_vfs=7,7,7,7 it
creates 7 vfs for each of my pfs. So far so good.
Now, how do I map from a given pf to the PCI addresses for the set of
vfs that are associated with it? I don't have virsh installed, so is
there a way to query this with sysfs or something?
Thanks,
Chris
--
Chris Friesen
Software Designer
3500 Carling Avenue
Ottawa, Ontario K2H 8E9
www.genband.com
^ permalink raw reply
* Re: [PATCH net-next] ipv4: Add interface option to enable routing of 127.0.0.0/8
From: David Miller @ 2012-06-08 20:23 UTC (permalink / raw)
To: tgraf; +Cc: netdev
In-Reply-To: <20120608101859.GH32152@canuck.infradead.org>
What's the different between this patch and the one you posted
half a day ago?
^ permalink raw reply
* Re: formal way to map from pf to vfs when using VT-d?
From: Chris Friesen @ 2012-06-08 20:41 UTC (permalink / raw)
To: netdev, e1000-devel@lists.sourceforge.net, Kirsher, Jeffrey T,
Brandeburg, Jesse, Allan, Bruce W
In-Reply-To: <4FD25D18.6090002@genband.com>
On 06/08/2012 02:14 PM, Chris Friesen wrote:
>
> Hi,
>
> I'm using the igb/igbvf drivers. If I set igb.max_vfs=7,7,7,7 it
> creates 7 vfs for each of my pfs. So far so good.
>
> Now, how do I map from a given pf to the PCI addresses for the set of
> vfs that are associated with it? I don't have virsh installed, so is
> there a way to query this with sysfs or something?
>
I think I found it.../sys/class/net/eth0/device/ has "virtfnX" entries
which are symlinks to the appropriate pci address.
Chris
^ permalink raw reply
* Re: [PATCH net-next v3 1/2] inetpeer: add namespace support for inetpeer
From: David Miller @ 2012-06-08 21:27 UTC (permalink / raw)
To: gaofeng; +Cc: eric.dumazet, steffen.klassert, netdev, containers
In-Reply-To: <1339137683-19217-1-git-send-email-gaofeng@cn.fujitsu.com>
From: Gao feng <gaofeng@cn.fujitsu.com>
Date: Fri, 8 Jun 2012 14:41:23 +0800
> now inetpeer doesn't support namespace,the information will
> be leaking across namespace.
>
> this patch move the global vars v4_peers and v6_peers to
> netns_ipv4 and netns_ipv6 as a field peers.
>
> add struct pernet_operations inetpeer_ops to initial pernet
> inetpeer data.
>
> and change family_to_base and inet_getpeer to support namespace.
>
> Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next v3 2/2] inetpeer: add parameter net for inet_getpeer_v4,v6
From: David Miller @ 2012-06-08 21:27 UTC (permalink / raw)
To: gaofeng-BthXqXjhjHXQFUHtdCDX3A
Cc: steffen.klassert-opNxpl+3fjRBDgjK7y7TUQ,
netdev-u79uwXL29TY76Z2rM5mHXA,
containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w
In-Reply-To: <1339137779-19340-1-git-send-email-gaofeng-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
From: Gao feng <gaofeng-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
Date: Fri, 8 Jun 2012 14:42:59 +0800
> add struct net as a parameter of inet_getpeer_v[4,6],
> use net to replace &init_net.
>
> and modify some places to provide net for inet_getpeer_v[4,6]
>
> Signed-off-by: Gao feng <gaofeng-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] af_unix: speedup /proc/net/unix
From: David Miller @ 2012-06-08 21:28 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, swhiteho, xemul
In-Reply-To: <1339167801.6001.111.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 08 Jun 2012 17:03:21 +0200
> From: Eric Dumazet <edumazet@google.com>
>
> /proc/net/unix has quadratic behavior, and can hold unix_table_lock for
> a while if high number of unix sockets are alive. (90 ms for 200k
> sockets...)
>
> We already have a hash table, so its quite easy to use it.
>
> Problem is unbound sockets are still hashed in a single hash slot
> (unix_socket_table[UNIX_HASH_TABLE])
>
> This patch also spreads unbound sockets to 256 hash slots, to speedup
> both /proc/net/unix and unix_diag.
>
> Time to read /proc/net/unix with 200k unix sockets :
> (time dd if=/proc/net/unix of=/dev/null bs=4k)
>
> before : 520 secs
> after : 2 secs
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Nice work Eric, applied.
^ permalink raw reply
* Re: [PATCH] l2tp: fix a race in l2tp_ip_sendmsg()
From: David Miller @ 2012-06-08 21:31 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, jchapman, denys
In-Reply-To: <1339172700.6001.128.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 08 Jun 2012 18:25:00 +0200
> From: Eric Dumazet <edumazet@google.com>
>
> Commit 081b1b1bb27f (l2tp: fix l2tp_ip_sendmsg() route handling) added
> a race, in case IP route cache is disabled.
>
> In this case, we should not do the dst_release(&rt->dst), since it'll
> free the dst immediately, instead of waiting a RCU grace period.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Working with a zero-ref'd object is always playing with fire even
when we "know what we are doing" :-)
Applied and queued up for -stable, thanks Eric.
^ permalink raw reply
* Re: [PATCH] be2net: fix a race in be_xmit()
From: David Miller @ 2012-06-08 21:44 UTC (permalink / raw)
To: Sathya.Perla; +Cc: eric.dumazet, netdev
In-Reply-To: <3367B80B08154D42A3B2BC708B5D41F647C6A0B900@EXMAIL.ad.emulex.com>
From: <Sathya.Perla@Emulex.Com>
Date: Fri, 8 Jun 2012 03:06:14 -0700
>
>>-----Original Message-----
>>From: Eric Dumazet <edumazet@google.com>
>>
>>As soon as hardware is notified of a transmit, we no longer can assume
>>skb can be dereferenced, as TX completion might have freed the packet.
>>
>>Signed-off-by: Eric Dumazet <edumazet@google.com>
>>Cc: Sathya Perla <sathya.perla@emulex.com>
>
> Good catch. Thanks!
> Acked-by: Sathya Perla <sathya.perla@emulex.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] ipv4: Add interface option to enable routing of 127.0.0.0/8
From: Thomas Graf @ 2012-06-08 22:22 UTC (permalink / raw)
To: David Miller; +Cc: tgraf, netdev
In-Reply-To: <20120608.132338.892251811480644242.davem@davemloft.net>
On Fri, Jun 08, 2012 at 01:23:38PM -0700, David Miller wrote:
>
> What's the different between this patch and the one you posted
> half a day ago?
There is no difference. I didn't see my own mail appear in
my netdev folder and assumed git send-email had failed so
I did send it again. Sorry for the double post.
^ permalink raw reply
* [PATCH] net/core: fix kernel-doc warnings
From: Randy Dunlap @ 2012-06-09 0:01 UTC (permalink / raw)
To: netdev, David Miller
From: Randy Dunlap <rdunlap@xenotime.net>
Fix kernel-doc warnings in net/core:
Warning(net/core/skbuff.c:3368): No description found for parameter 'delta_truesize'
Warning(net/core/filter.c:628): No description found for parameter 'pfp'
Warning(net/core/filter.c:628): Excess function parameter 'sk' description in 'sk_unattached_filter_create'
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
---
net/core/filter.c | 4 ++--
net/core/skbuff.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
--- lnx-35-rc1.orig/net/core/filter.c
+++ lnx-35-rc1/net/core/filter.c
@@ -616,9 +616,9 @@ static int __sk_prepare_filter(struct sk
/**
* sk_unattached_filter_create - create an unattached filter
* @fprog: the filter program
- * @sk: the socket to use
+ * @pfp: the unattached filter that is created
*
- * Create a filter independent ofr any socket. We first run some
+ * Create a filter independent of any socket. We first run some
* sanity checks on it to make sure it does not explode on us later.
* If an error occurs or there is insufficient memory for the filter
* a negative errno code is returned. On success the return is zero.
--- lnx-35-rc1.orig/net/core/skbuff.c
+++ lnx-35-rc1/net/core/skbuff.c
@@ -3361,7 +3361,7 @@ EXPORT_SYMBOL(kfree_skb_partial);
* @to: prior buffer
* @from: buffer to add
* @fragstolen: pointer to boolean
- *
+ * @delta_truesize: how much more was allocated than was requested
*/
bool skb_try_coalesce(struct sk_buff *to, struct sk_buff *from,
bool *fragstolen, int *delta_truesize)
^ permalink raw reply
* Re: formal way to map from pf to vfs when using VT-d?
From: Greg Rose @ 2012-06-09 0:04 UTC (permalink / raw)
To: Chris Friesen
Cc: netdev, e1000-devel@lists.sourceforge.net, Kirsher, Jeffrey T,
Brandeburg, Jesse, Allan, Bruce W
In-Reply-To: <4FD26382.3050303@genband.com>
On Fri, 8 Jun 2012 14:41:38 -0600
Chris Friesen <chris.friesen@genband.com> wrote:
> On 06/08/2012 02:14 PM, Chris Friesen wrote:
> >
> > Hi,
> >
> > I'm using the igb/igbvf drivers. If I set igb.max_vfs=7,7,7,7 it
> > creates 7 vfs for each of my pfs. So far so good.
> >
> > Now, how do I map from a given pf to the PCI addresses for the set
> > of vfs that are associated with it? I don't have virsh installed,
> > so is there a way to query this with sysfs or something?
> >
>
> I think I found it.../sys/class/net/eth0/device/ has "virtfnX"
> entries which are symlinks to the appropriate pci address.
Here's a script used by our validation team, inserted inline.
#!/usr/bin/perl
use strict;
if ($#ARGV <1)
{
print " Usage: ./list_vfs.pl Nic_name (t for Twinville, n for niantic, k for kawela, p for powerville) port_numer( 1 for first port, 2 for second port..) \n";
exit ;
}
my $nic_name=$ARGV[0];
#my $port_n=$ARGV[1]%4;
my $all_vfs;
my $vf_str;
my $mode = 2;
my $my_pf_str;
if ($nic_name eq 't') {
$my_pf_str= "\"10 Gigabit\"";
$vf_str="\"Intel Corporation Device 1515\"";
} elsif ($nic_name eq 'n') {
$my_pf_str="\"82599EB\"";
$vf_str="\"82599 Ethernet Controller Virtual\"";
} elsif ($nic_name eq 'k') {
$my_pf_str="\"82576 Gigabit Network Connection\"";
$vf_str="\"Intel Corporation 82576 Virtual Function\"";
} elsif ($nic_name eq 'p') {
$my_pf_str= "\"I350\"";
$vf_str="\"Intel Corporation Device 1520\"";
$mode=4;
} else {
print "No such virtual Function device, please check again\n";
}
my $port_n=$ARGV[1]%$mode;
my $my_pf=qx(lspci | grep $my_pf_str | awk '{print \$1}' | awk 'NR%$mode==$port_n');
print "PF=$my_pf\n";
my $all_vfs=qx(lspci | grep $vf_str | awk '{print \$1}' | awk 'NR%$mode==$port_n');
print "VFs are:\n";
print "$all_vfs\n";
- Greg
>
> Chris
> --
> 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
^ permalink raw reply
* [PATCH] netdev: fix drivers/net/phy/ kernel-doc warnings
From: Randy Dunlap @ 2012-06-09 0:07 UTC (permalink / raw)
To: netdev, David Miller
From: Randy Dunlap <rdunlap@xenotime.net>
Fix kernel-doc warnings in drivers/net/phy:
Warning(drivers/net/phy/mdio_bus.c:109): No description found for parameter 'mdio_bus_np'
Warning(drivers/net/phy/mdio_bus.c:109): Excess function parameter 'mdio_np' description in 'of_mdio_find_bus'
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
---
drivers/net/phy/mdio_bus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- lnx-35-rc1.orig/drivers/net/phy/mdio_bus.c
+++ lnx-35-rc1/drivers/net/phy/mdio_bus.c
@@ -96,7 +96,7 @@ static int of_mdio_bus_match(struct devi
}
/**
* of_mdio_find_bus - Given an mii_bus node, find the mii_bus.
- * @mdio_np: Pointer to the mii_bus.
+ * @mdio_bus_np: Pointer to the mii_bus.
*
* Returns a pointer to the mii_bus, or NULL if none found.
*
^ permalink raw reply
* solar lala shared photos with you
From: solar lala @ 2012-06-09 0:52 UTC (permalink / raw)
To: netdev
[-- Attachment #1: Type: text/plain, Size: 326 bytes --]
dear sir
We send an updated list (enclosed )of available Solar automatic control
insecticidal lamps , Please contact us for more information.
Regards
lala
Ecosol PV Tech Co., Ltd
Tel: 86-769-8279 2468
Fax: 86-769-879 2478
email:info@ecsolsolar.com
skype:solarlala
msn:solarlala@hotmail.com
www.ecsolsolar.com
[-- Attachment #2: 太阳能杀虫灯002.jpg --]
[-- Type: image/jpeg, Size: 144424 bytes --]
[-- Attachment #3: laptop charger.jpg --]
[-- Type: image/jpeg, Size: 10232 bytes --]
[-- Attachment #4: 太阳能手提箱002.jpg --]
[-- Type: image/jpeg, Size: 42070 bytes --]
[-- Attachment #5: 太阳能水泵.jpg --]
[-- Type: image/jpeg, Size: 48979 bytes --]
^ permalink raw reply
* [PATCH] inetpeer: fix build failed when IPV6 not enabled
From: Gao feng @ 2012-06-09 2:12 UTC (permalink / raw)
To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
wfg-VuQAYsv1563Yd54FQh9/CA
commit c8a627ed06d6d49bf65015a2185c519335c4c83f
(inetpeer: add namespace support for inetpeer)
makes kernel bulid failed when IPV6 not enabled.
fix this by adding #if IS_ENABLED(CONFIG_IPV6)
Reported-by: Fengguang Wu <wfg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Signed-off-by: Gao feng <gaofeng-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
---
net/ipv4/inetpeer.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/net/ipv4/inetpeer.c b/net/ipv4/inetpeer.c
index 1c85273..57f694e 100644
--- a/net/ipv4/inetpeer.c
+++ b/net/ipv4/inetpeer.c
@@ -151,18 +151,19 @@ static int __net_init inetpeer_net_init(struct net *net)
net->ipv4.peers->root = peer_avl_empty_rcu;
seqlock_init(&net->ipv4.peers->lock);
+#if IS_ENABLED(CONFIG_IPV6)
net->ipv6.peers = kzalloc(sizeof(struct inet_peer_base),
GFP_KERNEL);
- if (net->ipv6.peers == NULL)
- goto out_ipv6;
+ if (net->ipv6.peers == NULL) {
+ kfree(net->ipv4.peers);
+ return -ENOMEM;
+ }
net->ipv6.peers->root = peer_avl_empty_rcu;
seqlock_init(&net->ipv6.peers->lock);
+#endif
return 0;
-out_ipv6:
- kfree(net->ipv4.peers);
- return -ENOMEM;
}
static void __net_exit inetpeer_net_exit(struct net *net)
@@ -170,10 +171,11 @@ static void __net_exit inetpeer_net_exit(struct net *net)
inetpeer_invalidate_tree(net, AF_INET);
kfree(net->ipv4.peers);
net->ipv4.peers = NULL;
-
+#if IS_ENABLED(CONFIG_IPV6)
inetpeer_invalidate_tree(net, AF_INET6);
kfree(net->ipv6.peers);
net->ipv6.peers = NULL;
+#endif
}
static struct pernet_operations inetpeer_ops = {
@@ -433,7 +435,11 @@ static void unlink_from_pool(struct inet_peer *p, struct inet_peer_base *base,
static struct inet_peer_base *family_to_base(struct net *net,
int family)
{
+#if IS_ENABLED(CONFIG_IPV6)
return family == AF_INET ? net->ipv4.peers : net->ipv6.peers;
+#else
+ return net->ipv4.peers;
+#endif
}
/* perform garbage collect on all items stacked during a lookup */
--
1.7.7.6
^ permalink raw reply related
* Re: [PATCH] netdev: mv643xx_eth: Prevent build on PPC32
From: Mark Brown @ 2012-06-09 4:01 UTC (permalink / raw)
To: Josh Boyer
Cc: Ben Hutchings, Lennert Buytenhek, Andrew Lunn, Olof Johansson,
netdev
In-Reply-To: <20120608010403.GL7683@zod.bos.redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2013 bytes --]
On Thu, Jun 07, 2012 at 09:04:03PM -0400, Josh Boyer wrote:
> I'm not placing blame. I'm declaring people should be cautious going
> forward. 5 arches have the clock API. 21 don't. Whatever reasons
> there are for that, I don't care. It should be a big warning sign.
My point here is that it's a warning sign for the API, not really for
the drivers that use it.
> It might even be beneficial to put some Kconfig dependencies on both
> CONFIG_COMMON_CLK (which is somewhat misleadingly named) and
> CONFIG_CLKDEV_LOOKUP so those are only selectable on those 5 arches.
> Something like:
> config CLKDEV_LOOKUP
> bool
> + depends on (ARM || SUPERH || MIPS || C6X || BLACKFIN)
> select HAVE_CLK
This is a really bad approach. It's sending totally the wrong message
about where we want to be (we want to have the clock API available
everywhere) and more importantly it still means that drivers need to go
on carrying around ifdefery or unhelpful dependencies which is just lots
of pointless work. A very large proportion of the drivers that use
clocks are just making sure clocks are enabled when the device is active
to integrate with system wide power optimisation and don't actually care
if there are clocks there at all, we should be making their life as easy
as possible.
A much better approach is get the stubs mentioned earlier merged
(they're already on their way) faster. That way there are no compile
time dependencies and the problem goes away unless the driver is doing
something more active with clocks like managing the clock rate.
In the case of CLKDEV_LOOKUP the symbol should only be selected by an
architecture anyway, it's a layer on top of the architecture clock code.
> Regardless, hopefully things like this will get hit in linux-next in the
> future. I believe the only reason that it wasn't this time is that
> none of the PPC defconfigs build in linux-next bother to build the
> driver at all.
They do generally, people do randconfig and allXconfig builds all the
time.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* Re: [PATCH torvalds/linux.git] Make linux/tcp.h C++ friendly (trivial)
From: Paul Pluzhnikov @ 2012-06-09 4:14 UTC (permalink / raw)
To: Jiri Kosina; +Cc: netdev
In-Reply-To: <CALoOobMSXp4x_+En2gyHmpXcxq=sECQvMZN1LX_j3Yve7Ha6Aw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 776 bytes --]
On Tue, Mar 6, 2012 at 4:14 PM, Paul Pluzhnikov <ppluzhnikov@google.com> wrote:
> Ping?
>
> I am attaching the patch again so it doesn't get mangled by quoting
> and is easier to apply.
Ping? Ping?
I thought the patch has been applied, and stopped pinging it.
But it appears that it never did get applied :-(
Thanks,
On Thu, Dec 29, 2011 at 10:30 AM, Paul Pluzhnikov
<ppluzhnikov@google.com> wrote:
>
> Using linux/tcp.h from C++ results in:
>
> cat t.cc
>
> #include <linux/tcp.h>
> int main() { }
>
> g++ -c t.cc
>
> In file included from t.cc:1:
> /usr/include/linux/tcp.h:72: error: '__u32 __fswab32(__u32)' cannot appear in a constant-expression
> /usr/include/linux/tcp.h:72: error: a function call cannot appear in a constant-expression
> ...
--
Paul Pluzhnikov
[-- Attachment #2: linux-tcp_h-patch-20111229.txt --]
[-- Type: text/plain, Size: 1255 bytes --]
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 7f59ee9..63334f7 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -69,16 +69,16 @@ union tcp_word_hdr {
#define tcp_flag_word(tp) ( ((union tcp_word_hdr *)(tp))->words [3])
enum {
- TCP_FLAG_CWR = __cpu_to_be32(0x00800000),
- TCP_FLAG_ECE = __cpu_to_be32(0x00400000),
- TCP_FLAG_URG = __cpu_to_be32(0x00200000),
- TCP_FLAG_ACK = __cpu_to_be32(0x00100000),
- TCP_FLAG_PSH = __cpu_to_be32(0x00080000),
- TCP_FLAG_RST = __cpu_to_be32(0x00040000),
- TCP_FLAG_SYN = __cpu_to_be32(0x00020000),
- TCP_FLAG_FIN = __cpu_to_be32(0x00010000),
- TCP_RESERVED_BITS = __cpu_to_be32(0x0F000000),
- TCP_DATA_OFFSET = __cpu_to_be32(0xF0000000)
+ TCP_FLAG_CWR = __constant_cpu_to_be32(0x00800000),
+ TCP_FLAG_ECE = __constant_cpu_to_be32(0x00400000),
+ TCP_FLAG_URG = __constant_cpu_to_be32(0x00200000),
+ TCP_FLAG_ACK = __constant_cpu_to_be32(0x00100000),
+ TCP_FLAG_PSH = __constant_cpu_to_be32(0x00080000),
+ TCP_FLAG_RST = __constant_cpu_to_be32(0x00040000),
+ TCP_FLAG_SYN = __constant_cpu_to_be32(0x00020000),
+ TCP_FLAG_FIN = __constant_cpu_to_be32(0x00010000),
+ TCP_RESERVED_BITS = __constant_cpu_to_be32(0x0F000000),
+ TCP_DATA_OFFSET = __constant_cpu_to_be32(0xF0000000)
};
/*
^ permalink raw reply related
* Re: [PATCH torvalds/linux.git] Make linux/tcp.h C++ friendly (trivial)
From: David Miller @ 2012-06-09 5:17 UTC (permalink / raw)
To: ppluzhnikov; +Cc: jkosina, netdev
In-Reply-To: <CALoOobNbt0Kbea8gHdNkQFa0+ydpH++6ND+fOBGvy5Rmf=_QpA@mail.gmail.com>
From: Paul Pluzhnikov <ppluzhnikov@google.com>
Date: Fri, 8 Jun 2012 21:14:19 -0700
> I thought the patch has been applied, and stopped pinging it.
> But it appears that it never did get applied :-(
Your submission is not properly formed, you need to post this as a
fresh email with proper commit message and signoffs.
Please read Documentation/SubmittingPatches if you want us to
seriously consider this change.
Thanks.
^ permalink raw reply
* Re: [PATCH] inetpeer: fix build failed when IPV6 not enabled
From: David Miller @ 2012-06-09 5:20 UTC (permalink / raw)
To: gaofeng; +Cc: netdev, containers, wfg
In-Reply-To: <1339207973-11479-1-git-send-email-gaofeng@cn.fujitsu.com>
From: Gao feng <gaofeng@cn.fujitsu.com>
Date: Sat, 9 Jun 2012 10:12:53 +0800
> fix this by adding #if IS_ENABLED(CONFIG_IPV6)
There is not a single UGLY ifdef in inetpeer.c, and I am not going to
allow you to start crapping it up with ifdefs now.
We support ipv6 just fine without ifdefs before your network namespace
changes, so you need to find a way to continue dong so afterwards.
^ permalink raw reply
* Re: [PATCH] net/core: fix kernel-doc warnings
From: David Miller @ 2012-06-09 5:21 UTC (permalink / raw)
To: rdunlap; +Cc: netdev
In-Reply-To: <4FD29268.1010604@xenotime.net>
From: Randy Dunlap <rdunlap@xenotime.net>
Date: Fri, 08 Jun 2012 17:01:44 -0700
> From: Randy Dunlap <rdunlap@xenotime.net>
>
> Fix kernel-doc warnings in net/core:
>
> Warning(net/core/skbuff.c:3368): No description found for parameter 'delta_truesize'
> Warning(net/core/filter.c:628): No description found for parameter 'pfp'
> Warning(net/core/filter.c:628): Excess function parameter 'sk' description in 'sk_unattached_filter_create'
>
> Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Applied.
^ permalink raw reply
* Re: [PATCH] netdev: fix drivers/net/phy/ kernel-doc warnings
From: David Miller @ 2012-06-09 5:21 UTC (permalink / raw)
To: rdunlap; +Cc: netdev
In-Reply-To: <4FD293B7.6080702@xenotime.net>
From: Randy Dunlap <rdunlap@xenotime.net>
Date: Fri, 08 Jun 2012 17:07:19 -0700
> From: Randy Dunlap <rdunlap@xenotime.net>
>
> Fix kernel-doc warnings in drivers/net/phy:
>
> Warning(drivers/net/phy/mdio_bus.c:109): No description found for parameter 'mdio_bus_np'
> Warning(drivers/net/phy/mdio_bus.c:109): Excess function parameter 'mdio_np' description in 'of_mdio_find_bus'
>
> Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] af_unix: speedup /proc/net/unix
From: Michael Tokarev @ 2012-06-09 5:42 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David Miller, netdev, Steven Whitehouse, Pavel Emelyanov
In-Reply-To: <1339167801.6001.111.camel@edumazet-glaptop>
On 08.06.2012 19:03, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> /proc/net/unix has quadratic behavior, and can hold unix_table_lock for
> a while if high number of unix sockets are alive. (90 ms for 200k
> sockets...)
Two comments, nitpicking...
[]
> struct unix_iter_state {
> struct seq_net_private p;
> - int i;
> };
Can't seq_net_private be used directly?
> +static struct sock *unix_next_socket(struct seq_file *seq,
> + struct sock *sk,
> + loff_t *pos)
> +{
....
> }
>
> static void *unix_seq_next(struct seq_file *seq, void *v, loff_t *pos)
> {
> + return unix_next_socket(seq, v, pos);
> }
Why unix_seq_next() is needed? Can't unix_next_socket() be used directly instead?
Thanks,
/mjt
^ permalink raw reply
* Re: [PATCH torvalds/linux.git] Make linux/tcp.h C++ friendly (trivial)
From: Paul Pluzhnikov @ 2012-06-09 5:45 UTC (permalink / raw)
To: David Miller; +Cc: jkosina, netdev
In-Reply-To: <20120608.221755.927511342271201223.davem@davemloft.net>
[-- Attachment #1: Type: text/plain, Size: 1605 bytes --]
On Fri, Jun 8, 2012 at 10:17 PM, David Miller <davem@davemloft.net> wrote:
> From: Paul Pluzhnikov <ppluzhnikov@google.com>
> Date: Fri, 8 Jun 2012 21:14:19 -0700
>
>> I thought the patch has been applied, and stopped pinging it.
>> But it appears that it never did get applied :-(
>
> Your submission is not properly formed, you need to post this as a
> fresh email with proper commit message and signoffs.
>
> Please read Documentation/SubmittingPatches if you want us to
> seriously consider this change.
Here is the original message I sent to <trivial@kernel.org> on
Thu, Dec 29, 2011 at 10:30 AM:
-----------------------------------------
Greetings,
Using linux/tcp.h from C++ results in:
cat t.cc
#include <linux/tcp.h>
int main() { }
g++ -c t.cc
In file included from t.cc:1:
/usr/include/linux/tcp.h:72: error: '__u32 __fswab32(__u32)' cannot
appear in a constant-expression
/usr/include/linux/tcp.h:72: error: a function call cannot appear in a
constant-expression
...
Attached trivial patch fixes this problem.
Tested:
- the t.cc above compiles with g++ and
- the following program generates the same output before/after
the patch:
#include <linux/tcp.h>
#include <stdio.h>
int main ()
{
#define P(a) printf("%s: %08x\n", #a, (int)a)
P(TCP_FLAG_CWR);
P(TCP_FLAG_ECE);
P(TCP_FLAG_URG);
P(TCP_FLAG_ACK);
P(TCP_FLAG_PSH);
P(TCP_FLAG_RST);
P(TCP_FLAG_SYN);
P(TCP_FLAG_FIN);
P(TCP_RESERVED_BITS);
P(TCP_DATA_OFFSET);
#undef P
return 0;
}
Signed-off-by: Paul Pluzhnikov <ppluzhnikov@google.com>
Thanks,
P.S. Google has blanket copyright assignment to FSF.
--
Paul Pluzhnikov
[-- Attachment #2: linux-tcp_h-patch-20111229.txt --]
[-- Type: text/plain, Size: 1255 bytes --]
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 7f59ee9..63334f7 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -69,16 +69,16 @@ union tcp_word_hdr {
#define tcp_flag_word(tp) ( ((union tcp_word_hdr *)(tp))->words [3])
enum {
- TCP_FLAG_CWR = __cpu_to_be32(0x00800000),
- TCP_FLAG_ECE = __cpu_to_be32(0x00400000),
- TCP_FLAG_URG = __cpu_to_be32(0x00200000),
- TCP_FLAG_ACK = __cpu_to_be32(0x00100000),
- TCP_FLAG_PSH = __cpu_to_be32(0x00080000),
- TCP_FLAG_RST = __cpu_to_be32(0x00040000),
- TCP_FLAG_SYN = __cpu_to_be32(0x00020000),
- TCP_FLAG_FIN = __cpu_to_be32(0x00010000),
- TCP_RESERVED_BITS = __cpu_to_be32(0x0F000000),
- TCP_DATA_OFFSET = __cpu_to_be32(0xF0000000)
+ TCP_FLAG_CWR = __constant_cpu_to_be32(0x00800000),
+ TCP_FLAG_ECE = __constant_cpu_to_be32(0x00400000),
+ TCP_FLAG_URG = __constant_cpu_to_be32(0x00200000),
+ TCP_FLAG_ACK = __constant_cpu_to_be32(0x00100000),
+ TCP_FLAG_PSH = __constant_cpu_to_be32(0x00080000),
+ TCP_FLAG_RST = __constant_cpu_to_be32(0x00040000),
+ TCP_FLAG_SYN = __constant_cpu_to_be32(0x00020000),
+ TCP_FLAG_FIN = __constant_cpu_to_be32(0x00010000),
+ TCP_RESERVED_BITS = __constant_cpu_to_be32(0x0F000000),
+ TCP_DATA_OFFSET = __constant_cpu_to_be32(0xF0000000)
};
/*
^ permalink raw reply related
* Re: [PATCH torvalds/linux.git] Make linux/tcp.h C++ friendly (trivial)
From: David Miller @ 2012-06-09 5:55 UTC (permalink / raw)
To: ppluzhnikov; +Cc: jkosina, netdev
In-Reply-To: <CALoOobMCio0GtxerOpXwB-Bxf-cKnLotPBA69oPC-6CWDfyPyg@mail.gmail.com>
From: Paul Pluzhnikov <ppluzhnikov@google.com>
Date: Fri, 8 Jun 2012 22:45:20 -0700
> On Fri, Jun 8, 2012 at 10:17 PM, David Miller <davem@davemloft.net> wrote:
>> From: Paul Pluzhnikov <ppluzhnikov@google.com>
>> Date: Fri, 8 Jun 2012 21:14:19 -0700
>>
>>> I thought the patch has been applied, and stopped pinging it.
>>> But it appears that it never did get applied :-(
>>
>> Your submission is not properly formed, you need to post this as a
>> fresh email with proper commit message and signoffs.
>>
>> Please read Documentation/SubmittingPatches if you want us to
>> seriously consider this change.
>
> Here is the original message I sent to <trivial@kernel.org> on
> Thu, Dec 29, 2011 at 10:30 AM:
Please make a new, proper submission. I didn't ask you to reference
your original submission did I?
Thank you.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox