* Re: [PATCH net-next] Re: rib_trie / Fix inflate_threshold_root. Now=15 size=11 bits
From: David Miller @ 2009-07-20 14:41 UTC (permalink / raw)
To: jarkao2; +Cc: paulmck, pstaszewski, netdev, robert
In-Reply-To: <20090714183308.GB3090@ami.dom.local>
From: Jarek Poplawski <jarkao2@gmail.com>
Date: Tue, 14 Jul 2009 20:33:08 +0200
> ipv4: Use synchronize_rcu() during trie_rebalance()
>
> During trie_rebalance() we free memory after resizing with call_rcu(),
> but large updates, especially with PREEMPT_NONE configs, can cause
> memory stresses, so this patch calls synchronize_rcu() in
> tnode_free_flush() after each sync_pages to guarantee such freeing
> (especially before resizing the root node).
>
> The value of sync_pages = 128 is based on Pawel Staszewski's tests as
> the lowest which doesn't hinder updating times. (For testing purposes
> there was a sysfs module parameter to change it on demand, but it's
> removed until we're sure it could be really useful.)
>
> The patch is based on suggestions by: Paul E. McKenney
> <paulmck@linux.vnet.ibm.com>
>
> Reported-by: Pawel Staszewski <pstaszewski@itcare.pl>
> Tested-by: Pawel Staszewski <pstaszewski@itcare.pl>
> Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Applied.
^ permalink raw reply
* Re: [Bugme-new] [Bug 13467] New: Cannot set larger mtu on vlan then on underlying untagged device
From: David Miller @ 2009-07-20 14:36 UTC (permalink / raw)
To: herbert; +Cc: akpm, netdev, bugzilla-daemon, bugme-daemon, tomek
In-Reply-To: <20090706101950.GA18953@gondor.apana.org.au>
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Mon, 6 Jul 2009 18:19:50 +0800
> vlan: Propagate physical MTU changes
>
> When the physical MTU changes we want to ensure that all existing
> VLAN device MTUs do not exceed the new underlying MTU. This patch
> adds that propagation.
>
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Applied to net-next-2.6, thanks.
^ permalink raw reply
* Re: [PATCH] Phonet: sockets list through proc_fs
From: Marcel Holtmann @ 2009-07-20 14:25 UTC (permalink / raw)
To: David Miller; +Cc: remi.denis-courmont, netdev
In-Reply-To: <20090720.070940.88336950.davem@davemloft.net>
Hi Dave,
> > in the end it is up to Dave, however I would put these things into
> > debugfs.
>
> You're being rediculious.
>
> Listing sockets is a standard facility, not a debugging thing.
> Just like listing processes.
fair enough. I would still have used debugfs ;)
Regards
Marcel
^ permalink raw reply
* Re: [PATCH] Phonet: sockets list through proc_fs
From: David Miller @ 2009-07-20 14:09 UTC (permalink / raw)
To: marcel; +Cc: remi.denis-courmont, netdev
In-Reply-To: <1248094840.4549.119.camel@violet>
From: Marcel Holtmann <marcel@holtmann.org>
Date: Mon, 20 Jul 2009 15:00:40 +0200
> in the end it is up to Dave, however I would put these things into
> debugfs.
You're being rediculious.
Listing sockets is a standard facility, not a debugging thing.
Just like listing processes.
^ permalink raw reply
* [PATCH 0/3] can: various fixes to the device driver interface
From: Wolfgang Grandegger @ 2009-07-20 14:06 UTC (permalink / raw)
To: netdev; +Cc: socketcan-core
Hello,
this patch series fixes the following issues with CAN device driver
interface and the SJA1000 driver:
[PATCH 1/3] can: sja1000: remove duplicated includes
[PATCH 2/3] can: restart device even if dev_alloc_skb() fails
[PATCH 3/3] can: switch carrier on if device was stopped while in bus-off state
Wolfgang.
^ permalink raw reply
* [PATCH 3/3] can: switch carrier on if device was stopped while in bus-off state
From: Wolfgang Grandegger @ 2009-07-20 14:06 UTC (permalink / raw)
To: netdev; +Cc: socketcan-core, Kurt Van Dijck, Wolfgang Grandegger
In-Reply-To: <20090720140638.342067093@denx.de>
[-- Attachment #1: can-bus-off-carrier.patch --]
[-- Type: text/plain, Size: 829 bytes --]
This patch fixes a problem when a device is stopped while in the
bus-off state. Then the carrier remains off forever.
Signed-off-by: Kurt Van Dijck <kurt.van.dijck@skynet.be>
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
---
drivers/net/can/dev.c | 4 ++++
1 file changed, 4 insertions(+)
Index: net-next-2.6/drivers/net/can/dev.c
===================================================================
--- net-next-2.6.orig/drivers/net/can/dev.c 2009-07-20 16:03:35.083997416 +0200
+++ net-next-2.6/drivers/net/can/dev.c 2009-07-20 16:03:35.100998431 +0200
@@ -473,6 +473,10 @@
return -EINVAL;
}
+ /* Switch carrier on if device was stopped while in bus-off state */
+ if (!netif_carrier_ok(dev))
+ netif_carrier_on(dev);
+
setup_timer(&priv->restart_timer, can_restart, (unsigned long)dev);
return 0;
^ permalink raw reply
* [PATCH 2/3] can: restart device even if dev_alloc_skb() fails
From: Wolfgang Grandegger @ 2009-07-20 14:06 UTC (permalink / raw)
To: netdev; +Cc: socketcan-core, Kurt Van Dijck, Wolfgang Grandegger
In-Reply-To: <20090720140638.342067093@denx.de>
[-- Attachment #1: busoff-restart.patch --]
[-- Type: text/plain, Size: 1149 bytes --]
If dev_alloc_skb() failed in can_restart(), the device was left behind
in the bus-off state. This patch restarts the device nevertheless.
Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
---
drivers/net/can/dev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: net-next-2.6/drivers/net/can/dev.c
===================================================================
--- net-next-2.6.orig/drivers/net/can/dev.c 2009-06-09 12:45:38.446934371 +0200
+++ net-next-2.6/drivers/net/can/dev.c 2009-07-20 16:03:19.129997395 +0200
@@ -346,7 +346,7 @@
skb = dev_alloc_skb(sizeof(struct can_frame));
if (skb == NULL) {
err = -ENOMEM;
- goto out;
+ goto restart;
}
skb->dev = dev;
skb->protocol = htons(ETH_P_CAN);
@@ -361,13 +361,13 @@
stats->rx_packets++;
stats->rx_bytes += cf->can_dlc;
+restart:
dev_dbg(dev->dev.parent, "restarted\n");
priv->can_stats.restarts++;
/* Now restart the device */
err = priv->do_set_mode(dev, CAN_MODE_START);
-out:
netif_carrier_on(dev);
if (err)
dev_err(dev->dev.parent, "Error %d during restart", err);
^ permalink raw reply
* [PATCH 1/3] can: sja1000: remove duplicated includes
From: Wolfgang Grandegger @ 2009-07-20 14:06 UTC (permalink / raw)
To: netdev; +Cc: socketcan-core, Huang Weiyi, Wolfgang Grandegger
In-Reply-To: <20090720140638.342067093@denx.de>
[-- Attachment #1: sja1000-remove-duplicate-includes.patch --]
[-- Type: text/plain, Size: 713 bytes --]
Remove duplicated #include('s) in
drivers/net/can/sja1000/sja1000.c
Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
---
drivers/net/can/sja1000/sja1000.c | 1 -
1 file changed, 1 deletion(-)
Index: net-next-2.6/drivers/net/can/sja1000/sja1000.c
===================================================================
--- net-next-2.6.orig/drivers/net/can/sja1000/sja1000.c 2009-07-20 15:04:52.150997074 +0200
+++ net-next-2.6/drivers/net/can/sja1000/sja1000.c 2009-07-20 15:33:22.289997606 +0200
@@ -63,7 +63,6 @@
#include <linux/can.h>
#include <linux/can/dev.h>
#include <linux/can/error.h>
-#include <linux/can/dev.h>
#include "sja1000.h"
^ permalink raw reply
* Re: [PATCH] Phonet: sockets list through proc_fs
From: David Miller @ 2009-07-20 14:05 UTC (permalink / raw)
To: marcel; +Cc: remi.denis-courmont, netdev
In-Reply-To: <1248091650.4549.107.camel@violet>
From: Marcel Holtmann <marcel@holtmann.org>
Date: Mon, 20 Jul 2009 14:07:30 +0200
> And if we are talking about debugging information, then they should go
> into debugfs and not /proc. At least for new protocols.
Getting a list of active sockets is not, and never will be,
"debugging" information.
^ permalink raw reply
* Re: [PATCH] TCP: Add comments to (near) all functions in tcp_output.c v2
From: David Miller @ 2009-07-20 14:05 UTC (permalink / raw)
To: shanwei; +Cc: andi, ilpo.jarvinen, netdev
In-Reply-To: <4A645DDD.8050402@cn.fujitsu.com>
From: Shan Wei <shanwei@cn.fujitsu.com>
Date: Mon, 20 Jul 2009 20:06:53 +0800
> Andi Kleen said:
>>
>> +/* Compute TCP options for ESTABLISHED sockets. This is not the
>> + * final wire format yet.
>> + */
>
> typo, “network wire”?
Saying plain "wire" is canonical, the context is well understood.
^ permalink raw reply
* kernel BUG at include/net/netns/generic.h:41!
From: Luca Tettamanti @ 2009-07-20 13:27 UTC (permalink / raw)
To: linux-kernel; +Cc: netdev
Hello,
with recent git kernel (78af08d) I get the following BUG at startup (it seems
that racoon is triggering it):
[ 20.371630] NET: Registered protocol family 15
[ 20.371776] ------------[ cut here ]------------
[ 20.371779] kernel BUG at /home/kronos/src/linux-2.6.git/include/net/netns/generic.h:41!
[ 20.371781] invalid opcode: 0000 [#1] PREEMPT SMP
[ 20.371784] last sysfs file: /sys/module/microcode/initstate
[ 20.371785] CPU 0
[ 20.371787] Modules linked in: af_key(+) ext3 jbd coretemp hwmon microcode loop snd_hda_codec_realtek arc4 snd_hda_intel ecb snd_hda_codec snd_hwdep iwlagn snd_pcm iwlcore snd_seq snd_timer mac80211 snd_seq_device video btusb snd bluetooth cfg80211 rtc_cmos rfkill pcspkr soundcore psmouse evdev rtc_core asus_laptop output rtc_lib snd_page_alloc battery button ac processor ext4 mbcache jbd2 crc16 dm_mod usbhid hid sg sr_mod cdrom sd_mod uhci_hcd sdhci_pci sdhci mmc_core led_class ata_piix ahci ohci1394 ieee1394 libata scsi_mod ehci_hcd usbcore intel_agp thermal fan unix
[ 20.371822] Pid: 2896, comm: racoon Not tainted 2.6.31-rc3-00096-g78af08d-dirty #138 F3Sa
[ 20.371825] RIP: 0010:[<ffffffffa03bd404>] [<ffffffffa03bd404>] pfkey_create+0x34/0x1ac [af_key]
[ 20.371832] RSP: 0018:ffff88013d249eb8 EFLAGS: 00010246
[ 20.371834] RAX: ffff88013d249fd8 RBX: 0000000000000000 RCX: ffff88013d249d18
[ 20.371836] RDX: ffff88013f85a280 RSI: ffff88013f44ac00 RDI: 0000000000000001
[ 20.371838] RBP: ffff88013d249ed8 R08: 0000000000000008 R09: ffff8800284017c0
[ 20.371840] R10: ffff88013d249d30 R11: 000000000000000a R12: ffffffff814ec0a0
[ 20.371842] R13: ffff88013f44ac00 R14: 0000000000000002 R15: ffffffffa03c00e0
[ 20.371844] FS: 00007f90152f8710(0000) GS:ffff880028022000(0000) knlGS:0000000000000000
[ 20.371847] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[ 20.371849] CR2: 00007f00ada76000 CR3: 000000013db06000 CR4: 00000000000006f0
[ 20.371850] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 20.371853] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[ 20.371855] Process racoon (pid: 2896, threadinfo ffff88013d248000, task ffff88013e3a8000)
[ 20.371856] Stack:
[ 20.371858] ffffffffa03c0100 000000000000000f 0000000000000001 ffff88013f44ac00
[ 20.371860] <0> ffff88013d249f38 ffffffff811f1ffe ffff88013d249ef8 0000000081051ed7
[ 20.371863] <0> ffff88013d249f60 0000000300000002 ffffffff814ec0a0 000000000178e400
[ 20.371866] Call Trace:
[ 20.371872] [<ffffffff811f1ffe>] __sock_create+0x1b7/0x2b1
[ 20.371875] [<ffffffff811f2146>] sock_create+0x2d/0x2f
[ 20.371878] [<ffffffff811f2361>] sys_socket+0x29/0x5d
[ 20.371883] [<ffffffff8100bb2b>] system_call_fastpath+0x16/0x1b
[ 20.371885] Code: 41 55 49 89 f5 41 54 49 89 fc 53 bf 01 00 00 00 8b 1d 3d 2f 00 00 e8 ed 45 eb e0 49 8b 94 24 38 07 00 00 85 db 74 04 3b 1a 76 04 <0f> 0b eb fe 48 63 c3 48 f7 d0 48 6b c0 f8 48 8b 5c 02 08 bf 01
[ 20.371904] RIP [<ffffffffa03bd404>] pfkey_create+0x34/0x1ac [af_key]
[ 20.371909] RSP <ffff88013d249eb8>
[ 20.371911] ---[ end trace 31464162cdbb79f4 ]---
[ 20.371913] note: racoon[2896] exited with preempt_count 1
(the kernel is dirty because of changes to the asus_atk0110 hwmon driver).
I _think_ that the issue was introduced after -rc1, so if you want I can try to
bisect.
Luca
^ permalink raw reply
* Re: [PATCH] Phonet: sockets list through proc_fs
From: Marcel Holtmann @ 2009-07-20 13:00 UTC (permalink / raw)
To: Rémi Denis-Courmont; +Cc: netdev@vger.kernel.org
In-Reply-To: <200907201549.30870.remi.denis-courmont@nokia.com>
Hi Remi,
> > > > On Monday 20 July 2009 13:21:01 ext Marcel Holtmann wrote:
> > > >> > It's just like most network protocols exposing their sockets list in
> > > >> > /proc/net. Debugging/monitoring indeed.
> > > >>
> > > >> I think that for new protocols, we should not do this anymore and just
> > > >> use debugfs. Since that is exactly its job.
> > > >
> > > > Requiring debugfs for something like 'netstat' sounds restrictive to
> > > > me...
> > >
> > > Me too.
> >
> > hold on, what has netstat to do with Phonet support?
>
> First, I said "*like* netstat". Second, *net*stat has at least as much to do
> with Pho*net* than it has with Unix sockets. I'm interested in monitoring
> userland usage of Phonet sockets, not so much in debugging the kernel-mode
> Phonet stack. I am not convinced that debugfs is the right tool at all here -
> regardless whether we extend netstat or write a Phonet-specific tool.
in the end it is up to Dave, however I would put these things into
debugfs. Note that even something like mac80211 still provides a
wireless file here while most debugging is nowaydays in debugfs and it
might be better removed.
Regards
Marcel
^ permalink raw reply
* Re: [PATCH] Phonet: sockets list through proc_fs
From: Rémi Denis-Courmont @ 2009-07-20 12:49 UTC (permalink / raw)
To: netdev@vger.kernel.org
In-Reply-To: <1248091650.4549.107.camel@violet>
On Monday 20 July 2009 15:07:30 ext Marcel Holtmann wrote:
> Hi Dave,
>
> > > On Monday 20 July 2009 13:21:01 ext Marcel Holtmann wrote:
> > >> > It's just like most network protocols exposing their sockets list in
> > >> > /proc/net. Debugging/monitoring indeed.
> > >>
> > >> I think that for new protocols, we should not do this anymore and just
> > >> use debugfs. Since that is exactly its job.
> > >
> > > Requiring debugfs for something like 'netstat' sounds restrictive to
> > > me...
> >
> > Me too.
>
> hold on, what has netstat to do with Phonet support?
First, I said "*like* netstat". Second, *net*stat has at least as much to do
with Pho*net* than it has with Unix sockets. I'm interested in monitoring
userland usage of Phonet sockets, not so much in debugging the kernel-mode
Phonet stack. I am not convinced that debugfs is the right tool at all here -
regardless whether we extend netstat or write a Phonet-specific tool.
> Does netstat now support Phonet or what are we trying to achieve here?
There is currently no Phonet socket monitoring hook. I guess you refer to
backward compatibility, which -I would agree- is a non-issue.
--
Rémi Denis-Courmont
Nokia Devices R&D, Maemo Software, Helsinki
^ permalink raw reply
* Re: [PATCH] TCP: Add comments to (near) all functions in tcp_output.c v2
From: Shan Wei @ 2009-07-20 12:46 UTC (permalink / raw)
To: Andi Kleen; +Cc: Ilpo Järvinen, Netdev, David Miller
In-Reply-To: <20090720123404.GA16072@basil.fritz.box>
Andi Kleen said:
> On Mon, Jul 20, 2009 at 08:06:53PM +0800, Shan Wei wrote:
>> Andi Kleen said:
>>>
>>> +/* Compute TCP options for ESTABLISHED sockets. This is not the
>>> + * final wire format yet.
>>> + */
>> typo, “network wire”?
>
> I don't see a typo.
Just see the comment about tcp_syn_options().
"wire" vs "network wire".
>
>>
>>> +/* Test if sending is allowed right now.
>>> + */
>>> int tcp_may_send_now(struct sock *sk)
>> Is it better to provide the condition be allowed?
>
> Such a introductionary comment is not intended to be a full
> representation of the code, just a overview.
>
OK
^ permalink raw reply
* Re: [PATCH] TCP: Add comments to (near) all functions in tcp_output.c v2
From: Andi Kleen @ 2009-07-20 12:34 UTC (permalink / raw)
To: Shan Wei; +Cc: Andi Kleen, Ilpo Järvinen, Netdev, David Miller
In-Reply-To: <4A645DDD.8050402@cn.fujitsu.com>
On Mon, Jul 20, 2009 at 08:06:53PM +0800, Shan Wei wrote:
> Andi Kleen said:
> >
> > +/* Compute TCP options for ESTABLISHED sockets. This is not the
> > + * final wire format yet.
> > + */
>
> typo, “network wire”?
I don't see a typo.
>
>
> > +/* Test if sending is allowed right now.
> > + */
> > int tcp_may_send_now(struct sock *sk)
>
> Is it better to provide the condition be allowed?
Such a introductionary comment is not intended to be a full
representation of the code, just a overview.
-Andi
--
ak@linux.intel.com -- Speaking for myself only.
^ permalink raw reply
* [RFC/PATCH] net: Rework mdio-ofgpio driver to use of_mdio infrastructure
From: Mark Ware @ 2009-07-20 12:20 UTC (permalink / raw)
To: netdev; +Cc: grant.likely
Changes to the fs_enet driver (aa73832c5a80d6c52c69b18af858d88fa595dd3c) cause kernel crashes when using the mdio-ofgpio driver.
The following patch is a fairly naive attempt to replicate similar changes made to the fs_enet mii-bitbang drivers.
Signed-of-by: Mark Ware <mware@elphinstone.net>
---
This patch probably misses some important details, but it does allow my mpc8280 based board to boot and use an NFS mounted root.
drivers/net/phy/mdio-gpio.c | 39 +++++++++++++--------------------------
1 files changed, 13 insertions(+), 26 deletions(-)
diff --git a/drivers/net/phy/mdio-gpio.c b/drivers/net/phy/mdio-gpio.c
index 33984b7..6568176 100644
--- a/drivers/net/phy/mdio-gpio.c
+++ b/drivers/net/phy/mdio-gpio.c
@@ -30,6 +30,7 @@
#ifdef CONFIG_OF_GPIO
#include <linux/of_gpio.h>
+#include <linux/of_mdio.h>
#include <linux/of_platform.h>
#endif
@@ -83,7 +84,8 @@ static struct mdiobb_ops mdio_gpio_ops = {
static int __devinit mdio_gpio_bus_init(struct device *dev,
struct mdio_gpio_platform_data *pdata,
- int bus_id)
+ int bus_id,
+ void *ofdev)
{
struct mii_bus *new_bus;
struct mdio_gpio_info *bitbang;
@@ -129,7 +131,14 @@ static int __devinit mdio_gpio_bus_init(struct device *dev,
dev_set_drvdata(dev, new_bus);
- ret = mdiobus_register(new_bus);
+#ifdef CONFIG_OF_GPIO
+ if (ofdev)
+ ret = of_mdiobus_register(new_bus, ((struct of_device *) ofdev)->node);
+ else
+#else
+ ret = mdiobus_register(new_bus);
+#endif
+
if (ret)
goto out_free_all;
@@ -168,7 +177,7 @@ static int __devinit mdio_gpio_probe(struct platform_device *pdev)
if (!pdata)
return -ENODEV;
- return mdio_gpio_bus_init(&pdev->dev, pdata, pdev->id);
+ return mdio_gpio_bus_init(&pdev->dev, pdata, pdev->id, NULL);
}
static int __devexit mdio_gpio_remove(struct platform_device *pdev)
@@ -179,28 +188,10 @@ static int __devexit mdio_gpio_remove(struct platform_device *pdev)
}
#ifdef CONFIG_OF_GPIO
-static void __devinit add_phy(struct mdio_gpio_platform_data *pdata,
- struct device_node *np)
-{
- const u32 *data;
- int len, id, irq;
-
- data = of_get_property(np, "reg", &len);
- if (!data || len != 4)
- return;
-
- id = *data;
- pdata->phy_mask &= ~(1 << id);
-
- irq = of_irq_to_resource(np, 0, NULL);
- if (irq)
- pdata->irqs[id] = irq;
-}
static int __devinit mdio_ofgpio_probe(struct of_device *ofdev,
const struct of_device_id *match)
{
- struct device_node *np = NULL;
struct mdio_gpio_platform_data *pdata;
int ret;
@@ -218,11 +209,7 @@ static int __devinit mdio_ofgpio_probe(struct of_device *ofdev,
goto out_free;
pdata->mdio = ret;
- while ((np = of_get_next_child(ofdev->node, np)))
- if (!strcmp(np->type, "ethernet-phy"))
- add_phy(pdata, np);
-
- return mdio_gpio_bus_init(&ofdev->dev, pdata, pdata->mdc);
+ return mdio_gpio_bus_init(&ofdev->dev, pdata, pdata->mdc, ofdev);
out_free:
kfree(pdata);
--
1.5.6.5
^ permalink raw reply related
* Re: [PATCH] Phonet: sockets list through proc_fs
From: Marcel Holtmann @ 2009-07-20 12:07 UTC (permalink / raw)
To: David Miller; +Cc: remi.denis-courmont, netdev
In-Reply-To: <20090720.034328.193709571.davem@davemloft.net>
Hi Dave,
> > On Monday 20 July 2009 13:21:01 ext Marcel Holtmann wrote:
> >> > It's just like most network protocols exposing their sockets list in
> >> > /proc/net. Debugging/monitoring indeed.
> >>
> >> I think that for new protocols, we should not do this anymore and just
> >> use debugfs. Since that is exactly its job.
> >
> > Requiring debugfs for something like 'netstat' sounds restrictive to me...
>
> Me too.
hold on, what has netstat to do with Phonet support? Does netstat now
support Phonet or what are we trying to achieve here?
And if we are talking about debugging information, then they should go
into debugfs and not /proc. At least for new protocols.
Regards
Marcel
^ permalink raw reply
* Re: [PATCH] TCP: Add comments to (near) all functions in tcp_output.c v2
From: Shan Wei @ 2009-07-20 12:06 UTC (permalink / raw)
To: Andi Kleen; +Cc: Ilpo Järvinen, Netdev, David Miller
In-Reply-To: <20090718103159.GB2682@basil.fritz.box>
Andi Kleen said:
>
> +/* Compute TCP options for ESTABLISHED sockets. This is not the
> + * final wire format yet.
> + */
typo, “network wire”?
> +/* Test if sending is allowed right now.
> + */
> int tcp_may_send_now(struct sock *sk)
Is it better to provide the condition be allowed?
+ /* Check the nagle, the congestion window and
+ * the send window, decide if sending is allowed right now.
+ */
^ permalink raw reply
* [PATCH] [RFC] add getsockopt(SO_RCVDROPS) to fetch soclket RX drops count
From: Rémi Denis-Courmont @ 2009-07-20 10:48 UTC (permalink / raw)
To: netdev
From: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Several socket protocols use sk_drops, but it is only visible through
protocol-specific /proc. This adds a generic socket option to retrieve
the counter of a given socket.
Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
---
arch/alpha/include/asm/socket.h | 2 ++
arch/arm/include/asm/socket.h | 2 ++
arch/avr32/include/asm/socket.h | 2 ++
arch/cris/include/asm/socket.h | 2 ++
arch/frv/include/asm/socket.h | 2 ++
arch/h8300/include/asm/socket.h | 2 ++
arch/ia64/include/asm/socket.h | 2 ++
arch/m32r/include/asm/socket.h | 2 ++
arch/m68k/include/asm/socket.h | 2 ++
arch/microblaze/include/asm/socket.h | 2 ++
arch/mips/include/asm/socket.h | 2 ++
arch/mn10300/include/asm/socket.h | 2 ++
arch/parisc/include/asm/socket.h | 2 ++
arch/powerpc/include/asm/socket.h | 2 ++
arch/s390/include/asm/socket.h | 2 ++
arch/sparc/include/asm/socket.h | 2 ++
arch/x86/include/asm/socket.h | 2 ++
arch/xtensa/include/asm/socket.h | 2 ++
include/asm-generic/socket.h | 2 ++
net/core/sock.c | 4 ++++
20 files changed, 42 insertions(+), 0 deletions(-)
diff --git a/arch/alpha/include/asm/socket.h b/arch/alpha/include/asm/socket.h
index 3641ec1..9987748 100644
--- a/arch/alpha/include/asm/socket.h
+++ b/arch/alpha/include/asm/socket.h
@@ -65,6 +65,8 @@
#define SO_TIMESTAMPING 37
#define SCM_TIMESTAMPING SO_TIMESTAMPING
+#define SO_RCVDROPS 38
+
/* O_NONBLOCK clashes with the bits used for socket types. Therefore we
* have to define SOCK_NONBLOCK to a different value here.
*/
diff --git a/arch/arm/include/asm/socket.h b/arch/arm/include/asm/socket.h
index 537de4e..4b4cbaf 100644
--- a/arch/arm/include/asm/socket.h
+++ b/arch/arm/include/asm/socket.h
@@ -57,4 +57,6 @@
#define SO_TIMESTAMPING 37
#define SCM_TIMESTAMPING SO_TIMESTAMPING
+#define SO_RCVDROPS 38
+
#endif /* _ASM_SOCKET_H */
diff --git a/arch/avr32/include/asm/socket.h b/arch/avr32/include/asm/socket.h
index 04c8606..04463b1 100644
--- a/arch/avr32/include/asm/socket.h
+++ b/arch/avr32/include/asm/socket.h
@@ -57,4 +57,6 @@
#define SO_TIMESTAMPING 37
#define SCM_TIMESTAMPING SO_TIMESTAMPING
+#define SO_RCVDROPS 38
+
#endif /* __ASM_AVR32_SOCKET_H */
diff --git a/arch/cris/include/asm/socket.h b/arch/cris/include/asm/socket.h
index d5cf740..80ab434 100644
--- a/arch/cris/include/asm/socket.h
+++ b/arch/cris/include/asm/socket.h
@@ -59,6 +59,8 @@
#define SO_TIMESTAMPING 37
#define SCM_TIMESTAMPING SO_TIMESTAMPING
+#define SO_RCVDROPS 38
+
#endif /* _ASM_SOCKET_H */
diff --git a/arch/frv/include/asm/socket.h b/arch/frv/include/asm/socket.h
index 57c3d40..0040d99 100644
--- a/arch/frv/include/asm/socket.h
+++ b/arch/frv/include/asm/socket.h
@@ -57,5 +57,7 @@
#define SO_TIMESTAMPING 37
#define SCM_TIMESTAMPING SO_TIMESTAMPING
+#define SO_RCVDROPS 38
+
#endif /* _ASM_SOCKET_H */
diff --git a/arch/h8300/include/asm/socket.h b/arch/h8300/include/asm/socket.h
index 602518a..78240ad 100644
--- a/arch/h8300/include/asm/socket.h
+++ b/arch/h8300/include/asm/socket.h
@@ -57,4 +57,6 @@
#define SO_TIMESTAMPING 37
#define SCM_TIMESTAMPING SO_TIMESTAMPING
+#define SO_RCVDROPS 38
+
#endif /* _ASM_SOCKET_H */
diff --git a/arch/ia64/include/asm/socket.h b/arch/ia64/include/asm/socket.h
index 7454212..b5c2391 100644
--- a/arch/ia64/include/asm/socket.h
+++ b/arch/ia64/include/asm/socket.h
@@ -66,4 +66,6 @@
#define SO_TIMESTAMPING 37
#define SCM_TIMESTAMPING SO_TIMESTAMPING
+#define SO_RCVDROPS 38
+
#endif /* _ASM_IA64_SOCKET_H */
diff --git a/arch/m32r/include/asm/socket.h b/arch/m32r/include/asm/socket.h
index be7ed58..81d346f 100644
--- a/arch/m32r/include/asm/socket.h
+++ b/arch/m32r/include/asm/socket.h
@@ -57,4 +57,6 @@
#define SO_TIMESTAMPING 37
#define SCM_TIMESTAMPING SO_TIMESTAMPING
+#define SO_RCVDROPS 38
+
#endif /* _ASM_M32R_SOCKET_H */
diff --git a/arch/m68k/include/asm/socket.h b/arch/m68k/include/asm/socket.h
index ca87f93..a0a3385 100644
--- a/arch/m68k/include/asm/socket.h
+++ b/arch/m68k/include/asm/socket.h
@@ -57,4 +57,6 @@
#define SO_TIMESTAMPING 37
#define SCM_TIMESTAMPING SO_TIMESTAMPING
+#define SO_RCVDROPS 38
+
#endif /* _ASM_SOCKET_H */
diff --git a/arch/microblaze/include/asm/socket.h b/arch/microblaze/include/asm/socket.h
index 8259368..7d5f523 100644
--- a/arch/microblaze/include/asm/socket.h
+++ b/arch/microblaze/include/asm/socket.h
@@ -66,4 +66,6 @@
#define SO_TIMESTAMPING 37
#define SCM_TIMESTAMPING SO_TIMESTAMPING
+#define SO_RCVDROPS 38
+
#endif /* _ASM_MICROBLAZE_SOCKET_H */
diff --git a/arch/mips/include/asm/socket.h b/arch/mips/include/asm/socket.h
index 2abca17..8dbc692 100644
--- a/arch/mips/include/asm/socket.h
+++ b/arch/mips/include/asm/socket.h
@@ -78,6 +78,8 @@ To add: #define SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */
#define SO_TIMESTAMPING 37
#define SCM_TIMESTAMPING SO_TIMESTAMPING
+#define SO_RCVDROPS 38
+
#ifdef __KERNEL__
/** sock_type - Socket types
diff --git a/arch/mn10300/include/asm/socket.h b/arch/mn10300/include/asm/socket.h
index fb5daf4..1474ea5 100644
--- a/arch/mn10300/include/asm/socket.h
+++ b/arch/mn10300/include/asm/socket.h
@@ -57,4 +57,6 @@
#define SO_TIMESTAMPING 37
#define SCM_TIMESTAMPING SO_TIMESTAMPING
+#define SO_RCVDROPS 38
+
#endif /* _ASM_SOCKET_H */
diff --git a/arch/parisc/include/asm/socket.h b/arch/parisc/include/asm/socket.h
index 885472b..7b743f3 100644
--- a/arch/parisc/include/asm/socket.h
+++ b/arch/parisc/include/asm/socket.h
@@ -57,6 +57,8 @@
#define SO_TIMESTAMPING 0x4020
#define SCM_TIMESTAMPING SO_TIMESTAMPING
+#define SO_RCVDROPS 0x4021
+
/* O_NONBLOCK clashes with the bits used for socket types. Therefore we
* have to define SOCK_NONBLOCK to a different value here.
*/
diff --git a/arch/powerpc/include/asm/socket.h b/arch/powerpc/include/asm/socket.h
index 1e5cfad..e787f99 100644
--- a/arch/powerpc/include/asm/socket.h
+++ b/arch/powerpc/include/asm/socket.h
@@ -64,4 +64,6 @@
#define SO_TIMESTAMPING 37
#define SCM_TIMESTAMPING SO_TIMESTAMPING
+#define SO_RCVDROPS 38
+
#endif /* _ASM_POWERPC_SOCKET_H */
diff --git a/arch/s390/include/asm/socket.h b/arch/s390/include/asm/socket.h
index 02330c5..0ebaea1 100644
--- a/arch/s390/include/asm/socket.h
+++ b/arch/s390/include/asm/socket.h
@@ -65,4 +65,6 @@
#define SO_TIMESTAMPING 37
#define SCM_TIMESTAMPING SO_TIMESTAMPING
+#define SO_RCVDROPS 38
+
#endif /* _ASM_SOCKET_H */
diff --git a/arch/sparc/include/asm/socket.h b/arch/sparc/include/asm/socket.h
index 982a12f..b2e1d80 100644
--- a/arch/sparc/include/asm/socket.h
+++ b/arch/sparc/include/asm/socket.h
@@ -53,6 +53,8 @@
#define SO_TIMESTAMPING 0x0023
#define SCM_TIMESTAMPING SO_TIMESTAMPING
+#define SO_RCVDROPS 0x0024
+
/* Security levels - as per NRL IPv6 - don't actually do anything */
#define SO_SECURITY_AUTHENTICATION 0x5001
#define SO_SECURITY_ENCRYPTION_TRANSPORT 0x5002
diff --git a/arch/x86/include/asm/socket.h b/arch/x86/include/asm/socket.h
index ca8bf2c..1875822 100644
--- a/arch/x86/include/asm/socket.h
+++ b/arch/x86/include/asm/socket.h
@@ -57,4 +57,6 @@
#define SO_TIMESTAMPING 37
#define SCM_TIMESTAMPING SO_TIMESTAMPING
+#define SO_RCVDROPS 38
+
#endif /* _ASM_X86_SOCKET_H */
diff --git a/arch/xtensa/include/asm/socket.h b/arch/xtensa/include/asm/socket.h
index dd1a7a4..445cb7b 100644
--- a/arch/xtensa/include/asm/socket.h
+++ b/arch/xtensa/include/asm/socket.h
@@ -68,4 +68,6 @@
#define SO_TIMESTAMPING 37
#define SCM_TIMESTAMPING SO_TIMESTAMPING
+#define SO_RCVDROPS 38
+
#endif /* _XTENSA_SOCKET_H */
diff --git a/include/asm-generic/socket.h b/include/asm-generic/socket.h
index 5d79e40..778283a 100644
--- a/include/asm-generic/socket.h
+++ b/include/asm-generic/socket.h
@@ -60,4 +60,6 @@
#define SO_TIMESTAMPING 37
#define SCM_TIMESTAMPING SO_TIMESTAMPING
+#define SO_RCVDROPS 38
+
#endif /* __ASM_GENERIC_SOCKET_H */
diff --git a/net/core/sock.c b/net/core/sock.c
index 73b5af5..18dbb5f 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -891,6 +891,10 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
v.val = sk->sk_mark;
break;
+ case SO_RCVDROPS:
+ v.val = atomic_read(&sk->sk_drops);
+ break;
+
default:
return -ENOPROTOOPT;
}
--
1.6.0.4
^ permalink raw reply related
* [PATCH] Fix error return for setsockopt(SO_TIMESTAMPING)
From: Rémi Denis-Courmont @ 2009-07-20 10:47 UTC (permalink / raw)
To: netdev
From: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
I guess it should be -EINVAL rather than EINVAL. I have not checked
when the bug came in. Perhaps a candidate for -stable?
Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
---
net/core/sock.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/core/sock.c b/net/core/sock.c
index 6354863..73b5af5 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -631,7 +631,7 @@ set_rcvbuf:
case SO_TIMESTAMPING:
if (val & ~SOF_TIMESTAMPING_MASK) {
- ret = EINVAL;
+ ret = -EINVAL;
break;
}
sock_valbool_flag(sk, SOCK_TIMESTAMPING_TX_HARDWARE,
--
1.6.0.4
^ permalink raw reply related
* Re: [PATCH] Phonet: sockets list through proc_fs
From: David Miller @ 2009-07-20 10:43 UTC (permalink / raw)
To: remi.denis-courmont; +Cc: netdev
In-Reply-To: <200907201332.05329.remi.denis-courmont@nokia.com>
From: "Rémi Denis-Courmont" <remi.denis-courmont@nokia.com>
Date: Mon, 20 Jul 2009 13:32:04 +0300
> On Monday 20 July 2009 13:21:01 ext Marcel Holtmann wrote:
>> > It's just like most network protocols exposing their sockets list in
>> > /proc/net. Debugging/monitoring indeed.
>>
>> I think that for new protocols, we should not do this anymore and just
>> use debugfs. Since that is exactly its job.
>
> Requiring debugfs for something like 'netstat' sounds restrictive to me...
Me too.
^ permalink raw reply
* Re: [PATCH] Phonet: sockets list through proc_fs
From: Eric Dumazet @ 2009-07-20 10:31 UTC (permalink / raw)
To: Marcel Holtmann; +Cc: Rémi Denis-Courmont, netdev@vger.kernel.org
In-Reply-To: <1248085261.4549.103.camel@violet>
Marcel Holtmann a écrit :
> Hi Remi,
>
>>>>>> From: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
>>>>> isn't there are proper explaining commit message missing here?
>>>> AFAIK, a one-liners stick to the Subject line.
>>>>
>>>> (I use explicit From: due to my broken Microsoft-provided MTA).
>>> the From: is not the problem here. However it would be nice to have a
>>> description of the change. Especially details like this is for debugging
>>> or this is a public API or etc.
>> It's just like most network protocols exposing their sockets list in
>> /proc/net. Debugging/monitoring indeed.
>
> I think that for new protocols, we should not do this anymore and just
> use debugfs. Since that is exactly its job.
netstat uses /proc/net
iproute2 uses netlink
Now you suggest adding debugfs support ?
What a mess...
^ permalink raw reply
* Re: [PATCH] Phonet: sockets list through proc_fs
From: Rémi Denis-Courmont @ 2009-07-20 10:32 UTC (permalink / raw)
To: netdev@vger.kernel.org
In-Reply-To: <1248085261.4549.103.camel@violet>
On Monday 20 July 2009 13:21:01 ext Marcel Holtmann wrote:
> > It's just like most network protocols exposing their sockets list in
> > /proc/net. Debugging/monitoring indeed.
>
> I think that for new protocols, we should not do this anymore and just
> use debugfs. Since that is exactly its job.
Requiring debugfs for something like 'netstat' sounds restrictive to me...
--
Rémi Denis-Courmont
Nokia Devices R&D, Maemo Software, Helsinki
^ permalink raw reply
* Re: [PATCH] Phonet: sockets list through proc_fs
From: Marcel Holtmann @ 2009-07-20 10:21 UTC (permalink / raw)
To: Rémi Denis-Courmont; +Cc: netdev@vger.kernel.org
In-Reply-To: <200907201247.23020.remi.denis-courmont@nokia.com>
Hi Remi,
> > > > > From: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
> > > >
> > > > isn't there are proper explaining commit message missing here?
> > >
> > > AFAIK, a one-liners stick to the Subject line.
> > >
> > > (I use explicit From: due to my broken Microsoft-provided MTA).
> >
> > the From: is not the problem here. However it would be nice to have a
> > description of the change. Especially details like this is for debugging
> > or this is a public API or etc.
>
> It's just like most network protocols exposing their sockets list in
> /proc/net. Debugging/monitoring indeed.
I think that for new protocols, we should not do this anymore and just
use debugfs. Since that is exactly its job.
Regards
Marcel
^ permalink raw reply
* Re: [PATCH] Phonet: sockets list through proc_fs
From: Rémi Denis-Courmont @ 2009-07-20 9:47 UTC (permalink / raw)
To: netdev@vger.kernel.org
In-Reply-To: <1248082487.4549.102.camel@violet>
On Monday 20 July 2009 12:34:47 ext Marcel Holtmann wrote:
> Hi Remi,
>
> > > > From: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
> > >
> > > isn't there are proper explaining commit message missing here?
> >
> > AFAIK, a one-liners stick to the Subject line.
> >
> > (I use explicit From: due to my broken Microsoft-provided MTA).
>
> the From: is not the problem here. However it would be nice to have a
> description of the change. Especially details like this is for debugging
> or this is a public API or etc.
It's just like most network protocols exposing their sockets list in
/proc/net. Debugging/monitoring indeed.
--
Rémi Denis-Courmont
Nokia Devices R&D, Maemo Software, Helsinki
^ 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