* Re: Regression on TX throughput when using bonding
From: Jean-Michel Hautbois @ 2012-06-14 14:14 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev
In-Reply-To: <CAL8zT=icffEiz9MeaNwMtzteQnXiaT4k++s0TPWt5zsnHxFbmw@mail.gmail.com>
2012/6/14 Jean-Michel Hautbois <jhautbois@gmail.com>:
> 2012/6/14 Eric Dumazet <eric.dumazet@gmail.com>:
>> On Thu, 2012-06-14 at 11:22 +0200, Eric Dumazet wrote:
>>
>>> So you are saying that if you make skb_orphan_try() doing nothing, it
>>> solves your problem ?
>>
>> It probably does, if your application does an UDP flood, trying to send
>> more than the link bandwidth. I guess only benchmarks workloads ever try
>> to do that.
>>
>> bonding has no way to give congestion back, it has no Qdisc by default.
>>
>> We probably can defer the skb_orphan_try() for bonding master, a bit
>> like the IFF_XMIT_DST_RELEASE
>>
>> drivers/net/bonding/bond_main.c | 2 +-
>> include/linux/if.h | 3 +++
>> net/core/dev.c | 5 +++--
>> 3 files changed, 7 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>> index 2ee8cf9..1b1e9c8 100644
>> --- a/drivers/net/bonding/bond_main.c
>> +++ b/drivers/net/bonding/bond_main.c
>> @@ -4343,7 +4343,7 @@ static void bond_setup(struct net_device *bond_dev)
>> bond_dev->tx_queue_len = 0;
>> bond_dev->flags |= IFF_MASTER|IFF_MULTICAST;
>> bond_dev->priv_flags |= IFF_BONDING;
>> - bond_dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING);
>> + bond_dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING | IFF_XMIT_ORPHAN);
>>
>> /* At first, we block adding VLANs. That's the only way to
>> * prevent problems that occur when adding VLANs over an
>> diff --git a/include/linux/if.h b/include/linux/if.h
>> index f995c66..a788e7b 100644
>> --- a/include/linux/if.h
>> +++ b/include/linux/if.h
>> @@ -81,6 +81,9 @@
>> #define IFF_UNICAST_FLT 0x20000 /* Supports unicast filtering */
>> #define IFF_TEAM_PORT 0x40000 /* device used as team port */
>> #define IFF_SUPP_NOFCS 0x80000 /* device supports sending custom FCS */
>> +#define IFF_XMIT_ORPHAN 0x100000 /* dev_hard_start_xmit() is allowed to
>> + * orphan skb
>> + */
>>
>>
>> #define IF_GET_IFACE 0x0001 /* for querying only */
>> diff --git a/net/core/dev.c b/net/core/dev.c
>> index cd09819..3435463 100644
>> --- a/net/core/dev.c
>> +++ b/net/core/dev.c
>> @@ -2193,7 +2193,8 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
>> if (!list_empty(&ptype_all))
>> dev_queue_xmit_nit(skb, dev);
>>
>> - skb_orphan_try(skb);
>> + if (dev->priv_flags & IFF_XMIT_ORPHAN)
>> + skb_orphan_try(skb);
>>
>> features = netif_skb_features(skb);
>>
>> @@ -5929,7 +5930,7 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
>> INIT_LIST_HEAD(&dev->napi_list);
>> INIT_LIST_HEAD(&dev->unreg_list);
>> INIT_LIST_HEAD(&dev->link_watch_list);
>> - dev->priv_flags = IFF_XMIT_DST_RELEASE;
>> + dev->priv_flags = IFF_XMIT_DST_RELEASE | IFF_XMIT_ORPHAN;
>> setup(dev);
>>
>> dev->num_tx_queues = txqs;
>>
>>
>
> It works
For your information :
~# tc -s -d qdisc show dev eth1 > before_tc && sleep 10 && tc -s -d
qdisc show dev eth1 > after_tc && ./beforeafter before_tc after_tc
qdisc mq 0: root
Sent 3185900568 bytes 788681 pkt (dropped 0, overlimits 0 requeues 620)
backlog 0b 0p requeues 620
As you can see, 2.5Gbps without any difficulties :).
Thanks,
JM
^ permalink raw reply
* Re: [PATCH 2/5] drivers/net/ethernet/dec/tulip: Use standard __set_bit_le() function
From: Takuya Yoshikawa @ 2012-06-14 14:28 UTC (permalink / raw)
To: Akinobu Mita
Cc: Grant Grundler, Takuya Yoshikawa, akpm, bhutchings, grundler,
arnd, benh, avi, mtosatti, linux-net-drivers, netdev,
linux-kernel, linux-arch, kvm
In-Reply-To: <CAC5umyjkdDqavCo3Dk+WOggCnH+_CZz5jrOr3SougS4HSgV3OA@mail.gmail.com>
On Thu, 14 Jun 2012 18:36:42 +0900
Akinobu Mita <akinobu.mita@gmail.com> wrote:
> >> 1) while I agree with Akinobu and thank him for pointing out a
> >> _potential_ alignment problem, this is a separate issue and your
> >> existing patch should go in anyway. There are probably other drivers
> >> with _potential_ alignment issues. Akinobu could get credit for
> >> finding them by submitting patches after reviewing calls to set_bit
> >> and set_bit_le() - similar to what you are doing now.
> >
> > I prefer approach 1.
> >
> > hash_table is local in build_setup_frame_hash(), so if further
> > improvement is also required, we can do that locally there later.
>
> This potential alignment problem is introduced by this patch. Because
> the original set_bit_le() in tulip driver can handle unaligned bitmap.
> This is why I recommended it should be fixed in this patch.
The original set_bit_le() was used only in build_setup_frame_hash().
If it's clear that the table is aligned locally in the function, I do
not think the __potential__ problem is introduced by this patch.
As you can see from my response to Arnd in v1 thread, I knew the
alignment requirement at that time and checked the definition of
hash_table before using __set_bit_le().
> But please just ignore me if I'm too much paranoid. And I'll handle
> this issue if no one wants to do it.
I'm open to suggestions.
But now that the maintainer who can test the driver on real hardware
has suggested this patch should go in, I won't change the patch without
any real issue.
I would thank you if you improve this driver later on top of that.
Thanks,
Takuya
^ permalink raw reply
* Re: Regression on TX throughput when using bonding
From: Eric Dumazet @ 2012-06-14 14:29 UTC (permalink / raw)
To: Jean-Michel Hautbois; +Cc: netdev
In-Reply-To: <CAL8zT=huqtqBKzH3DDwid_C8jH16SH=kjYEK6zjxp_spfnLxXA@mail.gmail.com>
On Thu, 2012-06-14 at 16:14 +0200, Jean-Michel Hautbois wrote:
> ~# tc -s -d qdisc show dev eth1 > before_tc && sleep 10 && tc -s -d
> qdisc show dev eth1 > after_tc && ./beforeafter before_tc after_tc
> qdisc mq 0: root
> Sent 3185900568 bytes 788681 pkt (dropped 0, overlimits 0 requeues 620)
> backlog 0b 0p requeues 620
>
> As you can see, 2.5Gbps without any difficulties :).
>
> Thanks,
> JM
I have no idea why throughput on ethernet link is changed.
There is another bug elsewhere. Use a thousand of sockets instead of
few, and you'll hit the bug.
Orphaning skbs should not lower speed of the device, only drops excess
packets, instead of blocking the application, waiting the socket wmem
alloc being freed by destructors.
Are you playing with process priorities ?
If the ksoftirqd cannot run, this could explain the problem.
^ permalink raw reply
* Re: [PATCH] leds: Rename led_brightness_set() to led_set_brightness()
From: Shuah Khan @ 2012-06-14 14:52 UTC (permalink / raw)
To: bryan.wu
Cc: shuahkhan, rpurdie, johannes, linville, davem, LKML,
linux-wireless, netdev, linux-leds
In-Reply-To: <1339619670.13326.22.camel@lorien2>
On Wed, 2012-06-13 at 14:34 -0600, Shuah Khan wrote:
> Rename leds external interface led_brightness_set() to led_set_brightness().
> This is the second phase of the change to reduce confusion between the
> leds internal and external interfaces that set brightness. With this change,
> now the external interface is led_set_brightness(). The first phase renamed
> the internal interface led_set_brightness() to __led_set_brightness().
> There are no changes to the interface implementations.
>
> Signed-off-by: Shuah Khan <shuahkhan@gmail.com>
Bryan,
Just in case you didn't see this patch. cc'ing linux-leds
-- Shuah
> ---
> drivers/leds/led-class.c | 2 +-
> drivers/leds/led-core.c | 4 ++--
> drivers/leds/led-triggers.c | 2 +-
> drivers/leds/ledtrig-oneshot.c | 2 +-
> drivers/leds/ledtrig-timer.c | 2 +-
> include/linux/leds.h | 4 ++--
> net/mac80211/led.c | 2 +-
> 7 files changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
> index cb0a6eb..c599095 100644
> --- a/drivers/leds/led-class.c
> +++ b/drivers/leds/led-class.c
> @@ -222,7 +222,7 @@ void led_classdev_unregister(struct led_classdev *led_cdev)
> #endif
>
> /* Stop blinking */
> - led_brightness_set(led_cdev, LED_OFF);
> + led_set_brightness(led_cdev, LED_OFF);
>
> device_unregister(led_cdev->dev);
>
> diff --git a/drivers/leds/led-core.c b/drivers/leds/led-core.c
> index 176961b..8a09c5f 100644
> --- a/drivers/leds/led-core.c
> +++ b/drivers/leds/led-core.c
> @@ -103,7 +103,7 @@ void led_blink_set_oneshot(struct led_classdev *led_cdev,
> }
> EXPORT_SYMBOL(led_blink_set_oneshot);
>
> -void led_brightness_set(struct led_classdev *led_cdev,
> +void led_set_brightness(struct led_classdev *led_cdev,
> enum led_brightness brightness)
> {
> /* stop and clear soft-blink timer */
> @@ -113,4 +113,4 @@ void led_brightness_set(struct led_classdev *led_cdev,
>
> __led_set_brightness(led_cdev, brightness);
> }
> -EXPORT_SYMBOL(led_brightness_set);
> +EXPORT_SYMBOL(led_set_brightness);
> diff --git a/drivers/leds/led-triggers.c b/drivers/leds/led-triggers.c
> index f8b14dd..57721f2 100644
> --- a/drivers/leds/led-triggers.c
> +++ b/drivers/leds/led-triggers.c
> @@ -112,7 +112,7 @@ void led_trigger_set(struct led_classdev *led_cdev, struct led_trigger *trig)
> if (led_cdev->trigger->deactivate)
> led_cdev->trigger->deactivate(led_cdev);
> led_cdev->trigger = NULL;
> - led_brightness_set(led_cdev, LED_OFF);
> + led_set_brightness(led_cdev, LED_OFF);
> }
> if (trig) {
> write_lock_irqsave(&trig->leddev_list_lock, flags);
> diff --git a/drivers/leds/ledtrig-oneshot.c b/drivers/leds/ledtrig-oneshot.c
> index 5cbab41..2c029aa 100644
> --- a/drivers/leds/ledtrig-oneshot.c
> +++ b/drivers/leds/ledtrig-oneshot.c
> @@ -177,7 +177,7 @@ static void oneshot_trig_deactivate(struct led_classdev *led_cdev)
> }
>
> /* Stop blinking */
> - led_brightness_set(led_cdev, LED_OFF);
> + led_set_brightness(led_cdev, LED_OFF);
> }
>
> static struct led_trigger oneshot_led_trigger = {
> diff --git a/drivers/leds/ledtrig-timer.c b/drivers/leds/ledtrig-timer.c
> index 9010f7a..f774d05 100644
> --- a/drivers/leds/ledtrig-timer.c
> +++ b/drivers/leds/ledtrig-timer.c
> @@ -104,7 +104,7 @@ static void timer_trig_deactivate(struct led_classdev *led_cdev)
> }
>
> /* Stop blinking */
> - led_brightness_set(led_cdev, LED_OFF);
> + led_set_brightness(led_cdev, LED_OFF);
> }
>
> static struct led_trigger timer_led_trigger = {
> diff --git a/include/linux/leds.h b/include/linux/leds.h
> index dd93a22..3aade1d 100644
> --- a/include/linux/leds.h
> +++ b/include/linux/leds.h
> @@ -124,7 +124,7 @@ extern void led_blink_set_oneshot(struct led_classdev *led_cdev,
> unsigned long *delay_off,
> int invert);
> /**
> - * led_brightness_set - set LED brightness
> + * led_set_brightness - set LED brightness
> * @led_cdev: the LED to set
> * @brightness: the brightness to set it to
> *
> @@ -132,7 +132,7 @@ extern void led_blink_set_oneshot(struct led_classdev *led_cdev,
> * software blink timer that implements blinking when the
> * hardware doesn't.
> */
> -extern void led_brightness_set(struct led_classdev *led_cdev,
> +extern void led_set_brightness(struct led_classdev *led_cdev,
> enum led_brightness brightness);
>
> /*
> diff --git a/net/mac80211/led.c b/net/mac80211/led.c
> index 1bf7903..bcffa69 100644
> --- a/net/mac80211/led.c
> +++ b/net/mac80211/led.c
> @@ -276,7 +276,7 @@ static void ieee80211_stop_tpt_led_trig(struct ieee80211_local *local)
>
> read_lock(&tpt_trig->trig.leddev_list_lock);
> list_for_each_entry(led_cdev, &tpt_trig->trig.led_cdevs, trig_list)
> - led_brightness_set(led_cdev, LED_OFF);
> + led_set_brightness(led_cdev, LED_OFF);
> read_unlock(&tpt_trig->trig.leddev_list_lock);
> }
>
^ permalink raw reply
* Server Rental services in Hong Kong
From: trtr678678 @ 2012-06-14 15:22 UTC (permalink / raw)
Dear All,
We have our own datacenter in Hong Kong & provide email/application/web rental service to clients.We are APNIC member & provide clean IP to clients.
Dell? PowerEdge? EnterpriseRack Mount Server
-Intel(R) Xeon(R) E3-1240 Processor (3.3GHz, 8M Cache, Turbo, 4C/8T, 80W)
-8GB RAM, 2x4GB, 1333MHz, DDR-3, Dual Ranked UDIMMs
-500GB, 3.5", 6Gbps SAS x 2
-Raid 1 Mirroring Protection
-Remote KVM (iDRAC6 Enterprise)
Dell(TM) PowerEdge(TM) R410 Rack Mount Server
-Intel(R) Quad Core E5606 Xeon(R) CPU, 2.13GHz, 4M Cache, 4.86 GT/s QPI
-4GB Memory (2x2GB), 1333MHz Dual Ranked RDIMMs Fully-Buffered
-500GB 7.2K RPM SATAII 3.5" Hard Drive x 2
-iDRAC6 Enterprise or Express (Remote KVM Management)
Every Dedicated Server Hosting Solution Also Includes:
Software Specification
- CentOS / Fedora / Debian / FreeBSD / Ubuntu / Redhat Linux
- Full root-level access
- Data Center Facilities
- Shared Local & International Bandwidth
- 2 IP Addresses Allocation
- Un-interruptible Power Supply (UPS) backed up by private diesel generator
- FM200¡§based fire suppression system
- 24x7 CRAC Air Conditioning and Humidity Control
- 24x7 Security Control
- 24x7 Remote Hand Service
Pls send us email for further information.Thanks,
Ron
trtr678678@gmail.com
If you do not wish to further receive this event message, email "trtr789789@gmail.com" to unsubscribe this message or remove your email from the list.
^ permalink raw reply
* Server Rental services in Hong Kong
From: trtr678678 @ 2012-06-14 15:22 UTC (permalink / raw)
Dear All,
We have our own datacenter in Hong Kong & provide email/application/web rental service to clients.We are APNIC member & provide clean IP to clients.
Dell? PowerEdge? EnterpriseRack Mount Server
-Intel(R) Xeon(R) E3-1240 Processor (3.3GHz, 8M Cache, Turbo, 4C/8T, 80W)
-8GB RAM, 2x4GB, 1333MHz, DDR-3, Dual Ranked UDIMMs
-500GB, 3.5", 6Gbps SAS x 2
-Raid 1 Mirroring Protection
-Remote KVM (iDRAC6 Enterprise)
Dell(TM) PowerEdge(TM) R410 Rack Mount Server
-Intel(R) Quad Core E5606 Xeon(R) CPU, 2.13GHz, 4M Cache, 4.86 GT/s QPI
-4GB Memory (2x2GB), 1333MHz Dual Ranked RDIMMs Fully-Buffered
-500GB 7.2K RPM SATAII 3.5" Hard Drive x 2
-iDRAC6 Enterprise or Express (Remote KVM Management)
Every Dedicated Server Hosting Solution Also Includes:
Software Specification
- CentOS / Fedora / Debian / FreeBSD / Ubuntu / Redhat Linux
- Full root-level access
- Data Center Facilities
- Shared Local & International Bandwidth
- 2 IP Addresses Allocation
- Un-interruptible Power Supply (UPS) backed up by private diesel generator
- FM200¡§based fire suppression system
- 24x7 CRAC Air Conditioning and Humidity Control
- 24x7 Security Control
- 24x7 Remote Hand Service
Pls send us email for further information.Thanks,
Ron
trtr678678@gmail.com
If you do not wish to further receive this event message, email "trtr789789@gmail.com" to unsubscribe this message or remove your email from the list.
^ permalink raw reply
* Re: Regression on TX throughput when using bonding
From: Jean-Michel Hautbois @ 2012-06-14 15:43 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev
In-Reply-To: <1339684157.22704.722.camel@edumazet-glaptop>
2012/6/14 Eric Dumazet <eric.dumazet@gmail.com>:
> On Thu, 2012-06-14 at 16:14 +0200, Jean-Michel Hautbois wrote:
>
>> ~# tc -s -d qdisc show dev eth1 > before_tc && sleep 10 && tc -s -d
>> qdisc show dev eth1 > after_tc && ./beforeafter before_tc after_tc
>> qdisc mq 0: root
>> Sent 3185900568 bytes 788681 pkt (dropped 0, overlimits 0 requeues 620)
>> backlog 0b 0p requeues 620
>>
>> As you can see, 2.5Gbps without any difficulties :).
>>
>> Thanks,
>> JM
>
> I have no idea why throughput on ethernet link is changed.
>
> There is another bug elsewhere. Use a thousand of sockets instead of
> few, and you'll hit the bug.
>
> Orphaning skbs should not lower speed of the device, only drops excess
> packets, instead of blocking the application, waiting the socket wmem
> alloc being freed by destructors.
>
> Are you playing with process priorities ?
>
> If the ksoftirqd cannot run, this could explain the problem.
>
As suggested by Eric, here is a description I wish to be as precise as possible.
I send three RAW video frames, 1920x1088@30fps on three udp sockets to
the same NIC.
Each sending is in a thread, so I will focus on the numbers for one thread.
This generates burst of send(), as this : each 1/30s send 3.133.440
bytes to the ethernet interface.
This is in fact something similar to this :
while (n != 0)
{
sendto(socket, packet, 4000);
n -= 4000;
packet += 4000
}
My interface is a bond with a 10Gbps interface and MTU set to 4096.
This means I have 784 packets each 1/30s which are sent on my
interface by one thread, then I wait for the next burst, and so on.
The videos are not necessarily the same video, so the threads may send
simultaneously or not...
My socket is in blocking mode.
JM
^ permalink raw reply
* Re: [PATCH 0/8] dcbnl: Major simplifications
From: John Fastabend @ 2012-06-14 16:06 UTC (permalink / raw)
To: tgraf, alexander.h.duyck; +Cc: David Miller, netdev, lucy.liu
In-Reply-To: <20120614075435.GA29185@canuck.infradead.org>
On 6/14/2012 12:54 AM, Thomas Graf wrote:
> On Wed, Jun 13, 2012 at 03:55:41PM -0700, David Miller wrote:
>> Lots of deleted code, I like it :-)
>>
>> Applied, but could you send a follow-on patch to use BUG_ON() instead
>> of that "if (!ptr) { /* ... */ BUG(); }" construct?
>
> Sure, I must have had a weak moment right there :)
>
Nice! I'm a bit late but dumped this into my dcbnl netlink test kit
and everything looks good so...
Tested-by: john.r.fastabend@intel.com
^ permalink raw reply
* [PATCH] net: remove skb_orphan_try()
From: Eric Dumazet @ 2012-06-14 16:42 UTC (permalink / raw)
To: David Miller; +Cc: jhautbois, netdev
In-Reply-To: <20120614.033153.258221733380821664.davem@davemloft.net>
From: Eric Dumazet <edumazet@google.com>
On Thu, 2012-06-14 at 03:31 -0700, David Miller wrote:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> > We should have a way to properly park packets in Qdiscs, and only do the
> > orphaning once skb given to real device for 'immediate or so'
> > transmission.
>
> Ok.
In the other hand, all this stuff happens too late with BQL, since more
packets are parked in a Qdisc instead of being delivered with hot
caches.
Doing the orphaning once packet was enqueued, then dequeued, is probably
not worth adding yet another test in fast path.
[PATCH] net: remove skb_orphan_try()
Orphaning skb in dev_hard_start_xmit() makes bonding behavior
unfriendly for applications sending big UDP bursts : Once packets
pass the bonding device and come to real device, they might hit a full
qdisc and be dropped. Without orphaning, the sender is automatically
throttled because sk->sk_wmemalloc reaches sk->sk_sndbuf (assuming
sk_sndbuf is not too big)
We could try to defer the orphaning adding another test in
dev_hard_start_xmit(), but all this seems of little gain,
now that BQL tends to make packets more likely to be parked
in Qdisc queues instead of NIC TX ring, in cases where performance
matters.
Reverts commits :
fc6055a5ba31 net: Introduce skb_orphan_try()
87fd308cfc6b net: skb_tx_hash() fix relative to skb_orphan_try()
and removes SKBTX_DRV_NEEDS_SK_REF flag
Reported-and-bisected-by: Jean-Michel Hautbois <jhautbois@gmail.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
include/linux/skbuff.h | 7 ++-----
net/can/raw.c | 3 ---
net/core/dev.c | 23 +----------------------
net/iucv/af_iucv.c | 1 -
4 files changed, 3 insertions(+), 31 deletions(-)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index b534a1b..642cb73 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -225,14 +225,11 @@ enum {
/* device driver is going to provide hardware time stamp */
SKBTX_IN_PROGRESS = 1 << 2,
- /* ensure the originating sk reference is available on driver level */
- SKBTX_DRV_NEEDS_SK_REF = 1 << 3,
-
/* device driver supports TX zero-copy buffers */
- SKBTX_DEV_ZEROCOPY = 1 << 4,
+ SKBTX_DEV_ZEROCOPY = 1 << 3,
/* generate wifi status information (where possible) */
- SKBTX_WIFI_STATUS = 1 << 5,
+ SKBTX_WIFI_STATUS = 1 << 4,
};
/*
diff --git a/net/can/raw.c b/net/can/raw.c
index cde1b4a..46cca3a 100644
--- a/net/can/raw.c
+++ b/net/can/raw.c
@@ -681,9 +681,6 @@ static int raw_sendmsg(struct kiocb *iocb, struct socket *sock,
if (err < 0)
goto free_skb;
- /* to be able to check the received tx sock reference in raw_rcv() */
- skb_shinfo(skb)->tx_flags |= SKBTX_DRV_NEEDS_SK_REF;
-
skb->dev = dev;
skb->sk = sk;
diff --git a/net/core/dev.c b/net/core/dev.c
index cd09819..6df2140 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2089,25 +2089,6 @@ static int dev_gso_segment(struct sk_buff *skb, netdev_features_t features)
return 0;
}
-/*
- * Try to orphan skb early, right before transmission by the device.
- * We cannot orphan skb if tx timestamp is requested or the sk-reference
- * is needed on driver level for other reasons, e.g. see net/can/raw.c
- */
-static inline void skb_orphan_try(struct sk_buff *skb)
-{
- struct sock *sk = skb->sk;
-
- if (sk && !skb_shinfo(skb)->tx_flags) {
- /* skb_tx_hash() wont be able to get sk.
- * We copy sk_hash into skb->rxhash
- */
- if (!skb->rxhash)
- skb->rxhash = sk->sk_hash;
- skb_orphan(skb);
- }
-}
-
static bool can_checksum_protocol(netdev_features_t features, __be16 protocol)
{
return ((features & NETIF_F_GEN_CSUM) ||
@@ -2193,8 +2174,6 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
if (!list_empty(&ptype_all))
dev_queue_xmit_nit(skb, dev);
- skb_orphan_try(skb);
-
features = netif_skb_features(skb);
if (vlan_tx_tag_present(skb) &&
@@ -2304,7 +2283,7 @@ u16 __skb_tx_hash(const struct net_device *dev, const struct sk_buff *skb,
if (skb->sk && skb->sk->sk_hash)
hash = skb->sk->sk_hash;
else
- hash = (__force u16) skb->protocol ^ skb->rxhash;
+ hash = (__force u16) skb->protocol;
hash = jhash_1word(hash, hashrnd);
return (u16) (((u64) hash * qcount) >> 32) + qoffset;
diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c
index 07d7d55..cd6f7a9 100644
--- a/net/iucv/af_iucv.c
+++ b/net/iucv/af_iucv.c
@@ -372,7 +372,6 @@ static int afiucv_hs_send(struct iucv_message *imsg, struct sock *sock,
skb_trim(skb, skb->dev->mtu);
}
skb->protocol = ETH_P_AF_IUCV;
- skb_shinfo(skb)->tx_flags |= SKBTX_DRV_NEEDS_SK_REF;
nskb = skb_clone(skb, GFP_ATOMIC);
if (!nskb)
return -ENOMEM;
^ permalink raw reply related
* Re: Regression on TX throughput when using bonding
From: Rick Jones @ 2012-06-14 17:46 UTC (permalink / raw)
To: Jean-Michel Hautbois; +Cc: Eric Dumazet, netdev
In-Reply-To: <CAL8zT=joBA5pgXB7QfDM5qhOizmdneghXsSnwN5G74-yoGzg_Q@mail.gmail.com>
On 06/14/2012 08:43 AM, Jean-Michel Hautbois wrote:
> As suggested by Eric, here is a description I wish to be as precise as possible.
> I send three RAW video frames, 1920x1088@30fps on three udp sockets to
> the same NIC.
> Each sending is in a thread, so I will focus on the numbers for one thread.
>
> This generates burst of send(), as this : each 1/30s send 3.133.440
> bytes to the ethernet interface.
> This is in fact something similar to this :
> while (n != 0)
> {
> sendto(socket, packet, 4000);
> n -= 4000;
> packet += 4000
> }
>
> My interface is a bond with a 10Gbps interface and MTU set to 4096.
> This means I have 784 packets each 1/30s which are sent on my
> interface by one thread, then I wait for the next burst, and so on.
> The videos are not necessarily the same video, so the threads may send
> simultaneously or not...
>
> My socket is in blocking mode.
If desired, here is how to simulate that with netperf:
./configure --enable-intervals
make
And an example over loopback:
raj@tardy:~/netperf2_trunk$ src/netperf -l 10 -t UDP_STREAM -H localhost
-w 33 -b 783 -- -s 1M -S 1M -m 4000
MIGRATED UDP STREAM TEST from ::0 (::) port 0 AF_INET6 to tardy (::1)
port 0 AF_INET6 : interval
Socket Message Elapsed Messages
Size Size Time Okay Errors Throughput
bytes bytes secs # # 10^6bits/sec
2097152 4000 9.99 260739 0 835.18
2097152 9.99 260442 834.23
Adjust the -s and/or -S options to match what Jean-Michel's application
uses for socket buffer sizes. Run another two simultaneous instances to
get the three streams. Adjust the run length with the -l option.
happy benchmarking,
rick jones
^ permalink raw reply
* Re: [PATCH 02/10] netfilter: add parameter proto for l4proto.init_net
From: Pablo Neira Ayuso @ 2012-06-14 17:59 UTC (permalink / raw)
To: Gao feng; +Cc: netdev, netfilter-devel
In-Reply-To: <1339668445-23848-2-git-send-email-gaofeng@cn.fujitsu.com>
On Thu, Jun 14, 2012 at 06:07:17PM +0800, Gao feng wrote:
> there are redundancy codes in l4proto's init_net functions.
> we can use one init_net function and l3proto to impletment
> the same thing.
>
> So we should add l3proto as a parameter for init_net function.
>
> Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
> ---
> include/net/netfilter/nf_conntrack_l4proto.h | 2 +-
> net/ipv4/netfilter/nf_conntrack_proto_icmp.c | 2 +-
> net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c | 2 +-
> net/netfilter/nf_conntrack_proto.c | 6 ++++--
> net/netfilter/nf_conntrack_proto_dccp.c | 2 +-
> net/netfilter/nf_conntrack_proto_generic.c | 2 +-
> net/netfilter/nf_conntrack_proto_gre.c | 2 +-
> net/netfilter/nf_conntrack_proto_sctp.c | 4 ++--
> net/netfilter/nf_conntrack_proto_tcp.c | 4 ++--
> net/netfilter/nf_conntrack_proto_udp.c | 4 ++--
> net/netfilter/nf_conntrack_proto_udplite.c | 2 +-
> 11 files changed, 17 insertions(+), 15 deletions(-)
>
> diff --git a/include/net/netfilter/nf_conntrack_l4proto.h b/include/net/netfilter/nf_conntrack_l4proto.h
> index 81c52b5..5dd60f2 100644
> --- a/include/net/netfilter/nf_conntrack_l4proto.h
> +++ b/include/net/netfilter/nf_conntrack_l4proto.h
> @@ -97,7 +97,7 @@ struct nf_conntrack_l4proto {
> #endif
> int *net_id;
> /* Init l4proto pernet data */
> - int (*init_net)(struct net *net);
> + int (*init_net)(struct net *net, u_int16_t proto);
>
> /* Protocol name */
> const char *name;
> diff --git a/net/ipv4/netfilter/nf_conntrack_proto_icmp.c b/net/ipv4/netfilter/nf_conntrack_proto_icmp.c
> index 041923c..76f7a2f 100644
> --- a/net/ipv4/netfilter/nf_conntrack_proto_icmp.c
> +++ b/net/ipv4/netfilter/nf_conntrack_proto_icmp.c
> @@ -337,7 +337,7 @@ static struct ctl_table icmp_compat_sysctl_table[] = {
> #endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */
> #endif /* CONFIG_SYSCTL */
>
> -static int icmp_init_net(struct net *net)
> +static int icmp_init_net(struct net *net, u_int16_t proto)
> {
> struct nf_icmp_net *in = icmp_pernet(net);
> struct nf_proto_net *pn = (struct nf_proto_net *)in;
> diff --git a/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c b/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
> index 63ed012..807ae09 100644
> --- a/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
> +++ b/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
> @@ -333,7 +333,7 @@ static struct ctl_table icmpv6_sysctl_table[] = {
> };
> #endif /* CONFIG_SYSCTL */
>
> -static int icmpv6_init_net(struct net *net)
> +static int icmpv6_init_net(struct net *net, u_int16_t proto)
> {
> struct nf_icmp_net *in = icmpv6_pernet(net);
> struct nf_proto_net *pn = (struct nf_proto_net *)in;
> diff --git a/net/netfilter/nf_conntrack_proto.c b/net/netfilter/nf_conntrack_proto.c
> index a434dd7..8fc0332 100644
> --- a/net/netfilter/nf_conntrack_proto.c
> +++ b/net/netfilter/nf_conntrack_proto.c
> @@ -193,6 +193,7 @@ static int nf_ct_l3proto_register_sysctl(struct net *net,
> l3proto->ctl_table_path,
> in->ctl_table,
> NULL);
> +
This entire patchset contains many extra new lines. If you want to
provide some cleanup, it should come in some follow-up patch.
> if (err < 0) {
> kfree(in->ctl_table);
> in->ctl_table = NULL;
> @@ -460,7 +461,7 @@ int nf_conntrack_l4proto_register(struct net *net,
> {
> int ret = 0;
> if (l4proto->init_net) {
> - ret = l4proto->init_net(net);
> + ret = l4proto->init_net(net, l4proto->l3proto);
> if (ret < 0)
> return ret;
> }
> @@ -514,7 +515,8 @@ int nf_conntrack_proto_init(struct net *net)
> {
> unsigned int i;
> int err;
> - err = nf_conntrack_l4proto_generic.init_net(net);
> + err = nf_conntrack_l4proto_generic.init_net(net,
> + nf_conntrack_l4proto_generic.l3proto);
You have to make sure that lines break at 80-chars per column.
Something like this should be fine:
err = nf_conntrack_l4proto_generic.init_net(net,
nf_conntrack_l4proto_generic.l3proto);
> if (err < 0)
> return err;
> err = nf_ct_l4proto_register_sysctl(net,
> diff --git a/net/netfilter/nf_conntrack_proto_dccp.c b/net/netfilter/nf_conntrack_proto_dccp.c
> index c33f76a..52da8f0 100644
> --- a/net/netfilter/nf_conntrack_proto_dccp.c
> +++ b/net/netfilter/nf_conntrack_proto_dccp.c
> @@ -815,7 +815,7 @@ static struct ctl_table dccp_sysctl_table[] = {
> };
> #endif /* CONFIG_SYSCTL */
>
> -static int dccp_init_net(struct net *net)
> +static int dccp_init_net(struct net *net, u_int16_t proto)
> {
> struct dccp_net *dn = dccp_pernet(net);
> struct nf_proto_net *pn = (struct nf_proto_net *)dn;
> diff --git a/net/netfilter/nf_conntrack_proto_generic.c b/net/netfilter/nf_conntrack_proto_generic.c
> index bb0e74f..d1ed7b4 100644
> --- a/net/netfilter/nf_conntrack_proto_generic.c
> +++ b/net/netfilter/nf_conntrack_proto_generic.c
> @@ -135,7 +135,7 @@ static struct ctl_table generic_compat_sysctl_table[] = {
> #endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */
> #endif /* CONFIG_SYSCTL */
>
> -static int generic_init_net(struct net *net)
> +static int generic_init_net(struct net *net, u_int16_t proto)
> {
> struct nf_generic_net *gn = generic_pernet(net);
> struct nf_proto_net *pn = (struct nf_proto_net *)gn;
> diff --git a/net/netfilter/nf_conntrack_proto_gre.c b/net/netfilter/nf_conntrack_proto_gre.c
> index 25ba5a2..851b93b 100644
> --- a/net/netfilter/nf_conntrack_proto_gre.c
> +++ b/net/netfilter/nf_conntrack_proto_gre.c
> @@ -348,7 +348,7 @@ gre_timeout_nla_policy[CTA_TIMEOUT_GRE_MAX+1] = {
> };
> #endif /* CONFIG_NF_CT_NETLINK_TIMEOUT */
>
> -static int gre_init_net(struct net *net)
> +static int gre_init_net(struct net *net, u_int16_t proto)
> {
> struct netns_proto_gre *net_gre = gre_pernet(net);
> int i;
> diff --git a/net/netfilter/nf_conntrack_proto_sctp.c b/net/netfilter/nf_conntrack_proto_sctp.c
> index 8fb0582..1e7836c 100644
> --- a/net/netfilter/nf_conntrack_proto_sctp.c
> +++ b/net/netfilter/nf_conntrack_proto_sctp.c
> @@ -767,7 +767,7 @@ static int sctp_kmemdup_compat_sysctl_table(struct nf_proto_net *pn)
> return 0;
> }
>
> -static int sctpv4_init_net(struct net *net)
> +static int sctpv4_init_net(struct net *net, u_int16_t proto)
> {
> int ret;
> struct sctp_net *sn = sctp_pernet(net);
> @@ -793,7 +793,7 @@ static int sctpv4_init_net(struct net *net)
> return ret;
> }
>
> -static int sctpv6_init_net(struct net *net)
> +static int sctpv6_init_net(struct net *net, u_int16_t proto)
> {
> struct sctp_net *sn = sctp_pernet(net);
> struct nf_proto_net *pn = (struct nf_proto_net *)sn;
> diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c
> index 99caa13..6db9d3c 100644
> --- a/net/netfilter/nf_conntrack_proto_tcp.c
> +++ b/net/netfilter/nf_conntrack_proto_tcp.c
> @@ -1593,7 +1593,7 @@ static int tcp_kmemdup_compat_sysctl_table(struct nf_proto_net *pn)
> return 0;
> }
>
> -static int tcpv4_init_net(struct net *net)
> +static int tcpv4_init_net(struct net *net, u_int16_t proto)
> {
> int i;
> int ret = 0;
> @@ -1631,7 +1631,7 @@ static int tcpv4_init_net(struct net *net)
> return ret;
> }
>
> -static int tcpv6_init_net(struct net *net)
> +static int tcpv6_init_net(struct net *net, u_int16_t proto)
> {
> int i;
> struct nf_tcp_net *tn = tcp_pernet(net);
> diff --git a/net/netfilter/nf_conntrack_proto_udp.c b/net/netfilter/nf_conntrack_proto_udp.c
> index a83cf93..2b978e6 100644
> --- a/net/netfilter/nf_conntrack_proto_udp.c
> +++ b/net/netfilter/nf_conntrack_proto_udp.c
> @@ -283,7 +283,7 @@ static void udp_init_net_data(struct nf_udp_net *un)
> }
> }
>
> -static int udpv4_init_net(struct net *net)
> +static int udpv4_init_net(struct net *net, u_int16_t proto)
> {
> int ret;
> struct nf_udp_net *un = udp_pernet(net);
> @@ -307,7 +307,7 @@ static int udpv4_init_net(struct net *net)
> return ret;
> }
>
> -static int udpv6_init_net(struct net *net)
> +static int udpv6_init_net(struct net *net, u_int16_t proto)
> {
> struct nf_udp_net *un = udp_pernet(net);
> struct nf_proto_net *pn = (struct nf_proto_net *)un;
> diff --git a/net/netfilter/nf_conntrack_proto_udplite.c b/net/netfilter/nf_conntrack_proto_udplite.c
> index b32e700..d33e511 100644
> --- a/net/netfilter/nf_conntrack_proto_udplite.c
> +++ b/net/netfilter/nf_conntrack_proto_udplite.c
> @@ -234,7 +234,7 @@ static struct ctl_table udplite_sysctl_table[] = {
> };
> #endif /* CONFIG_SYSCTL */
>
> -static int udplite_init_net(struct net *net)
> +static int udplite_init_net(struct net *net, u_int16_t proto)
> {
> int i;
> struct udplite_net *un = udplite_pernet(net);
> --
> 1.7.7.6
>
> --
> 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
* Re: [PATCH 04/10] netfilter: regard users as refcount for l4proto's per-net data
From: Pablo Neira Ayuso @ 2012-06-14 18:03 UTC (permalink / raw)
To: Gao feng; +Cc: netdev, netfilter-devel
In-Reply-To: <1339668445-23848-4-git-send-email-gaofeng@cn.fujitsu.com>
On Thu, Jun 14, 2012 at 06:07:19PM +0800, Gao feng wrote:
> Now, nf_proto_net's users is confusing.
> we should regard it as the refcount for l4proto's per-net data,
> because maybe there are two l4protos use the same per-net data.
>
> so increment pn->users when nf_conntrack_l4proto_register
> success, and decrement it for nf_conntrack_l4_unregister case.
>
> because nf_conntrack_l3proto_ipv[4|6] don't use the same per-net
> data,so we don't need to add a refcnt for their per-net data.
>
> Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
> ---
> net/netfilter/nf_conntrack_proto.c | 70 ++++++++++++++++++++++-------------
> 1 files changed, 44 insertions(+), 26 deletions(-)
>
> diff --git a/net/netfilter/nf_conntrack_proto.c b/net/netfilter/nf_conntrack_proto.c
> index c9df1b4..63f9430 100644
> --- a/net/netfilter/nf_conntrack_proto.c
> +++ b/net/netfilter/nf_conntrack_proto.c
> @@ -39,16 +39,13 @@ static int
> nf_ct_register_sysctl(struct net *net,
> struct ctl_table_header **header,
> const char *path,
> - struct ctl_table *table,
> - unsigned int *users)
> + struct ctl_table *table)
> {
> if (*header == NULL) {
> *header = register_net_sysctl(net, path, table);
> if (*header == NULL)
> return -ENOMEM;
> }
> - if (users != NULL)
> - (*users)++;
>
> return 0;
> }
> @@ -58,7 +55,7 @@ nf_ct_unregister_sysctl(struct ctl_table_header **header,
> struct ctl_table **table,
> unsigned int *users)
> {
> - if (users != NULL && --*users > 0)
> + if (users != NULL && *users > 0)
> return;
>
> unregister_net_sysctl_table(*header);
> @@ -191,8 +188,7 @@ static int nf_ct_l3proto_register_sysctl(struct net *net,
> err = nf_ct_register_sysctl(net,
> &in->ctl_table_header,
> l3proto->ctl_table_path,
> - in->ctl_table,
> - NULL);
> + in->ctl_table);
>
> if (err < 0) {
> kfree(in->ctl_table);
> @@ -330,20 +326,17 @@ static struct nf_proto_net *nf_ct_l4proto_net(struct net *net,
>
> static
> int nf_ct_l4proto_register_sysctl(struct net *net,
> + struct nf_proto_net *pn,
> struct nf_conntrack_l4proto *l4proto)
> {
> int err = 0;
> - struct nf_proto_net *pn = nf_ct_l4proto_net(net, l4proto);
> - if (pn == NULL)
> - return 0;
>
> #ifdef CONFIG_SYSCTL
> if (pn->ctl_table != NULL) {
> err = nf_ct_register_sysctl(net,
> &pn->ctl_table_header,
> "net/netfilter",
> - pn->ctl_table,
> - &pn->users);
> + pn->ctl_table);
> if (err < 0) {
> if (!pn->users) {
> kfree(pn->ctl_table);
> @@ -357,8 +350,7 @@ int nf_ct_l4proto_register_sysctl(struct net *net,
> err = nf_ct_register_sysctl(net,
> &pn->ctl_compat_header,
> "net/ipv4/netfilter",
> - pn->ctl_compat_table,
> - NULL);
> + pn->ctl_compat_table);
> if (err == 0)
> goto out;
> nf_ct_kfree_compat_sysctl_table(pn);
> @@ -374,11 +366,9 @@ out:
>
> static
> void nf_ct_l4proto_unregister_sysctl(struct net *net,
> + struct nf_proto_net *pn,
> struct nf_conntrack_l4proto *l4proto)
> {
> - struct nf_proto_net *pn = nf_ct_l4proto_net(net, l4proto);
> - if (pn == NULL)
> - return;
> #ifdef CONFIG_SYSCTL
> if (pn->ctl_table_header != NULL)
> nf_ct_unregister_sysctl(&pn->ctl_table_header,
> @@ -391,8 +381,6 @@ void nf_ct_l4proto_unregister_sysctl(struct net *net,
> &pn->ctl_compat_table,
> NULL);
> #endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */
> -#else
> - pn->users--;
> #endif /* CONFIG_SYSCTL */
> }
>
> @@ -458,22 +446,33 @@ int nf_conntrack_l4proto_register(struct net *net,
> struct nf_conntrack_l4proto *l4proto)
> {
> int ret = 0;
> +
> + struct nf_proto_net *pn = NULL;
> +
> if (l4proto->init_net) {
> ret = l4proto->init_net(net, l4proto->l3proto);
> if (ret < 0)
> - return ret;
> + goto out;
> }
>
> - ret = nf_ct_l4proto_register_sysctl(net, l4proto);
> + pn = nf_ct_l4proto_net(net, l4proto);
> + if (pn == NULL)
> + goto out;
> +
> + ret = nf_ct_l4proto_register_sysctl(net, pn, l4proto);
> if (ret < 0)
> - return ret;
> + goto out;
>
> if (net == &init_net) {
> ret = nf_conntrack_l4proto_register_net(l4proto);
> - if (ret < 0)
> - nf_ct_l4proto_unregister_sysctl(net, l4proto);
> + if (ret < 0) {
> + nf_ct_l4proto_unregister_sysctl(net, pn, l4proto);
> + goto out;
> + }
> }
> -
> + /* increase the nf_proto_net's refcnt */
this comment is superfluous, please remove it.
> + pn->users++;
> +out:
> return ret;
> }
> EXPORT_SYMBOL_GPL(nf_conntrack_l4proto_register);
> @@ -498,10 +497,18 @@ nf_conntrack_l4proto_unregister_net(struct nf_conntrack_l4proto *l4proto)
> void nf_conntrack_l4proto_unregister(struct net *net,
> struct nf_conntrack_l4proto *l4proto)
> {
> + struct nf_proto_net *pn = NULL;
> if (net == &init_net)
> nf_conntrack_l4proto_unregister_net(l4proto);
>
> - nf_ct_l4proto_unregister_sysctl(net, l4proto);
> + pn = nf_ct_l4proto_net(net, l4proto);
> + if (pn == NULL)
> + return;
> +
> + /* decrease the nf_proto_net's refcnt */
same thing.
> + pn->users--;
> + nf_ct_l4proto_unregister_sysctl(net, pn, l4proto);
> +
> /* Remove all contrack entries for this protocol */
> rtnl_lock();
> nf_ct_iterate_cleanup(net, kill_l4proto, l4proto);
> @@ -513,11 +520,14 @@ int nf_conntrack_proto_init(struct net *net)
> {
> unsigned int i;
> int err;
> + struct nf_proto_net *pn = nf_ct_l4proto_net(net,
> + &nf_conntrack_l4proto_generic);
break lines at 80 chars per column.
> err = nf_conntrack_l4proto_generic.init_net(net,
> nf_conntrack_l4proto_generic.l3proto);
> if (err < 0)
> return err;
> err = nf_ct_l4proto_register_sysctl(net,
> + pn,
> &nf_conntrack_l4proto_generic);
> if (err < 0)
> return err;
> @@ -527,13 +537,21 @@ int nf_conntrack_proto_init(struct net *net)
> rcu_assign_pointer(nf_ct_l3protos[i],
> &nf_conntrack_l3proto_generic);
> }
> + /* increase generic proto's nf_proto_net refcnt */
> + pn->users++;
> +
> return 0;
> }
>
> void nf_conntrack_proto_fini(struct net *net)
> {
> unsigned int i;
> + struct nf_proto_net *pn = nf_ct_l4proto_net(net,
> + &nf_conntrack_l4proto_generic);
> + /* decrease generic proto's nf_proto_net refcnt */
> + pn->users--;
> nf_ct_l4proto_unregister_sysctl(net,
> + pn,
> &nf_conntrack_l4proto_generic);
> if (net == &init_net) {
> /* free l3proto protocol tables */
> --
> 1.7.7.6
>
> --
> 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
* Re: [PATCH 03/10] netfilter: add nf_ct_kfree_compat_sysctl_table to make codes clear
From: Pablo Neira Ayuso @ 2012-06-14 18:06 UTC (permalink / raw)
To: Gao feng; +Cc: netdev, netfilter-devel
In-Reply-To: <1339668445-23848-3-git-send-email-gaofeng@cn.fujitsu.com>
On Thu, Jun 14, 2012 at 06:07:18PM +0800, Gao feng wrote:
> add function nf_ct_kfree_compat_sysctl_table to kfree l4proto's
> compat sysctl table and set the sysctl table point to NULL.
>
> Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
> ---
> include/net/netfilter/nf_conntrack_l4proto.h | 8 ++++++++
> net/netfilter/nf_conntrack_proto.c | 4 +---
> 2 files changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/include/net/netfilter/nf_conntrack_l4proto.h b/include/net/netfilter/nf_conntrack_l4proto.h
> index 5dd60f2..889b717 100644
> --- a/include/net/netfilter/nf_conntrack_l4proto.h
> +++ b/include/net/netfilter/nf_conntrack_l4proto.h
> @@ -132,6 +132,14 @@ extern int nf_ct_port_nlattr_to_tuple(struct nlattr *tb[],
> extern int nf_ct_port_nlattr_tuple_size(void);
> extern const struct nla_policy nf_ct_port_nla_policy[];
>
> +static inline void nf_ct_kfree_compat_sysctl_table(struct nf_proto_net *pn)
> +{
> +#if defined(CONFIG_SYSCTL) && defined(CONFIG_NF_CONNTRACK_PROC_COMPAT)
> + kfree(pn->ctl_compat_table);
> + pn->ctl_compat_table = NULL;
> +#endif
> +}
> +
> #ifdef CONFIG_SYSCTL
> #ifdef DEBUG_INVALID_PACKETS
> #define LOG_INVALID(net, proto) \
> diff --git a/net/netfilter/nf_conntrack_proto.c b/net/netfilter/nf_conntrack_proto.c
> index 8fc0332..c9df1b4 100644
> --- a/net/netfilter/nf_conntrack_proto.c
> +++ b/net/netfilter/nf_conntrack_proto.c
> @@ -361,9 +361,7 @@ int nf_ct_l4proto_register_sysctl(struct net *net,
> NULL);
> if (err == 0)
> goto out;
> -
> - kfree(pn->ctl_compat_table);
> - pn->ctl_compat_table = NULL;
> + nf_ct_kfree_compat_sysctl_table(pn);
if this is the only client of this function, then make it static and
define it inside nf_conntrack_proto.c
> nf_ct_unregister_sysctl(&pn->ctl_table_header,
> &pn->ctl_table,
> &pn->users);
> --
> 1.7.7.6
>
> --
> To unsubscribe from this list: send the line "unsubscribe netfilter-devel" 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
* Re: [PATCH 06/10] merge udpv[4,6]_net_init into udp_net_init
From: Pablo Neira Ayuso @ 2012-06-14 18:13 UTC (permalink / raw)
To: Gao feng; +Cc: netdev, netfilter-devel
In-Reply-To: <1339668445-23848-6-git-send-email-gaofeng@cn.fujitsu.com>
On Thu, Jun 14, 2012 at 06:07:21PM +0800, Gao feng wrote:
> merge udpv4_net_init and udpv6_net_init into udp_net_init to
> reduce the redundancy codes.
>
> and use nf_proto_net.users to identify if it's the first time
> we use the nf_proto_net. when it's the first time,we will
> initialized it.
>
> Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
> ---
> net/netfilter/nf_conntrack_proto_udp.c | 60 ++++++++++++--------------------
> 1 files changed, 22 insertions(+), 38 deletions(-)
>
> diff --git a/net/netfilter/nf_conntrack_proto_udp.c b/net/netfilter/nf_conntrack_proto_udp.c
> index 2b978e6..480126e 100644
> --- a/net/netfilter/nf_conntrack_proto_udp.c
> +++ b/net/netfilter/nf_conntrack_proto_udp.c
> @@ -239,13 +239,16 @@ static int udp_kmemdup_sysctl_table(struct nf_proto_net *pn)
> {
> #ifdef CONFIG_SYSCTL
> struct nf_udp_net *un = (struct nf_udp_net *)pn;
> +
> if (pn->ctl_table)
> return 0;
> +
> pn->ctl_table = kmemdup(udp_sysctl_table,
> sizeof(udp_sysctl_table),
> GFP_KERNEL);
> if (!pn->ctl_table)
> return -ENOMEM;
> +
I like this cleanup. But you have to make it in a separate patch.
> pn->ctl_table[0].data = &un->timeouts[UDP_CT_UNREPLIED];
> pn->ctl_table[1].data = &un->timeouts[UDP_CT_REPLIED];
> #endif
> @@ -257,6 +260,7 @@ static int udp_kmemdup_compat_sysctl_table(struct nf_proto_net *pn)
> #ifdef CONFIG_SYSCTL
> #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
> struct nf_udp_net *un = (struct nf_udp_net *)pn;
> +
> pn->ctl_compat_table = kmemdup(udp_compat_sysctl_table,
> sizeof(udp_compat_sysctl_table),
> GFP_KERNEL);
> @@ -270,52 +274,32 @@ static int udp_kmemdup_compat_sysctl_table(struct nf_proto_net *pn)
> return 0;
> }
>
> -static void udp_init_net_data(struct nf_udp_net *un)
> +static int udp_init_net(struct net *net, u_int16_t proto)
> {
> - int i;
> -#ifdef CONFIG_SYSCTL
> - if (!un->pn.ctl_table) {
> -#else
> - if (!un->pn.users++) {
> -#endif
> + int ret = 0;
> + struct nf_udp_net *un = udp_pernet(net);
> + struct nf_proto_net *pn = (struct nf_proto_net *)un;
> +
> + if (pn->users) {
> + int i = 0;
redundant initialization of that i variable.
> for (i = 0; i < UDP_CT_MAX; i++)
> un->timeouts[i] = udp_timeouts[i];
> }
> -}
>
> -static int udpv4_init_net(struct net *net, u_int16_t proto)
> -{
> - int ret;
> - struct nf_udp_net *un = udp_pernet(net);
> - struct nf_proto_net *pn = (struct nf_proto_net *)un;
> + if (proto == AF_INET) {
> + ret = udp_kmemdup_compat_sysctl_table(pn);
> + if (ret < 0)
> + return ret;
>
> - udp_init_net_data(un);
> + ret = udp_kmemdup_sysctl_table(pn);
> + if (ret < 0)
> + nf_ct_kfree_compat_sysctl_table(pn);
> + } else
> + ret = udp_kmemdup_sysctl_table(pn);
>
> - ret = udp_kmemdup_compat_sysctl_table(pn);
> - if (ret < 0)
> - return ret;
> -
> - ret = udp_kmemdup_sysctl_table(pn);
> -#ifdef CONFIG_SYSCTL
> -#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
> - if (ret < 0) {
> - kfree(pn->ctl_compat_table);
> - pn->ctl_compat_table = NULL;
> - }
> -#endif
> -#endif
> return ret;
> }
>
> -static int udpv6_init_net(struct net *net, u_int16_t proto)
> -{
> - struct nf_udp_net *un = udp_pernet(net);
> - struct nf_proto_net *pn = (struct nf_proto_net *)un;
> -
> - udp_init_net_data(un);
> - return udp_kmemdup_sysctl_table(pn);
> -}
> -
> struct nf_conntrack_l4proto nf_conntrack_l4proto_udp4 __read_mostly =
> {
> .l3proto = PF_INET,
> @@ -343,7 +327,7 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_udp4 __read_mostly =
> .nla_policy = udp_timeout_nla_policy,
> },
> #endif /* CONFIG_NF_CT_NETLINK_TIMEOUT */
> - .init_net = udpv4_init_net,
> + .init_net = udp_init_net,
> };
> EXPORT_SYMBOL_GPL(nf_conntrack_l4proto_udp4);
>
> @@ -374,6 +358,6 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_udp6 __read_mostly =
> .nla_policy = udp_timeout_nla_policy,
> },
> #endif /* CONFIG_NF_CT_NETLINK_TIMEOUT */
> - .init_net = udpv6_init_net,
> + .init_net = udp_init_net,
> };
> EXPORT_SYMBOL_GPL(nf_conntrack_l4proto_udp6);
> --
> 1.7.7.6
>
^ permalink raw reply
* Re: [PATCH 07/10] netfilter: nf_conntrack_l4proto_udplite[4,6] cleanup
From: Pablo Neira Ayuso @ 2012-06-14 18:17 UTC (permalink / raw)
To: Gao feng; +Cc: netdev, netfilter-devel
In-Reply-To: <1339668445-23848-7-git-send-email-gaofeng@cn.fujitsu.com>
On Thu, Jun 14, 2012 at 06:07:22PM +0800, Gao feng wrote:
> some cleanup for nf_conntrack_l4proto_udplite[4,6],
> make codes more clearer and ready for moving the
> sysctl code to nf_conntrack_proto_*_sysctl.c to
> reduce the ifdef pollution.
>
> and use nf_proto_net.users to identify if it's the first time
> we use the nf_proto_net. when it's the first time,we will
> initialized it.
>
> Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
> ---
> net/netfilter/nf_conntrack_proto_udplite.c | 42 +++++++++++++++++----------
> 1 files changed, 26 insertions(+), 16 deletions(-)
>
> diff --git a/net/netfilter/nf_conntrack_proto_udplite.c b/net/netfilter/nf_conntrack_proto_udplite.c
> index d33e511..f6a789a 100644
> --- a/net/netfilter/nf_conntrack_proto_udplite.c
> +++ b/net/netfilter/nf_conntrack_proto_udplite.c
> @@ -234,29 +234,39 @@ static struct ctl_table udplite_sysctl_table[] = {
> };
> #endif /* CONFIG_SYSCTL */
>
> +static int udplite_kmemdup_sysctl_table(struct nf_proto_net *pn)
> +{
> +#ifdef CONFIG_SYSCTL
> + struct udplite_net *un = (struct udplite_net *)pn;
> +
> + if (pn->ctl_table)
> + return 0;
> +
> + pn->ctl_table = kmemdup(udplite_sysctl_table,
> + sizeof(udplite_sysctl_table),
> + GFP_KERNEL);
> + if (!pn->ctl_table)
> + return -ENOMEM;
> +
> + pn->ctl_table[0].data = &un->timeouts[UDPLITE_CT_UNREPLIED];
> + pn->ctl_table[1].data = &un->timeouts[UDPLITE_CT_REPLIED];
> +#endif
> + return 0;
> +}
> +
> +
Remove extra line.
> static int udplite_init_net(struct net *net, u_int16_t proto)
> {
> - int i;
> struct udplite_net *un = udplite_pernet(net);
> struct nf_proto_net *pn = (struct nf_proto_net *)un;
> -#ifdef CONFIG_SYSCTL
> - if (!pn->ctl_table) {
> -#else
> - if (!pn->users++) {
> -#endif
> +
> + if (!pn->users) {
> + int i;
> for (i = 0 ; i < UDPLITE_CT_MAX; i++)
> un->timeouts[i] = udplite_timeouts[i];
> -#ifdef CONFIG_SYSCTL
> - pn->ctl_table = kmemdup(udplite_sysctl_table,
> - sizeof(udplite_sysctl_table),
> - GFP_KERNEL);
> - if (!pn->ctl_table)
> - return -ENOMEM;
> - pn->ctl_table[0].data = &un->timeouts[UDPLITE_CT_UNREPLIED];
> - pn->ctl_table[1].data = &un->timeouts[UDPLITE_CT_REPLIED];
> -#endif
> }
> - return 0;
> +
> + return udplite_kmemdup_sysctl_table(pn);
> }
>
> static struct nf_conntrack_l4proto nf_conntrack_l4proto_udplite4 __read_mostly =
> --
> 1.7.7.6
>
^ permalink raw reply
* [patch] qlcnic: off by one in qlcnic_init_pci_info()
From: Dan Carpenter @ 2012-06-14 18:34 UTC (permalink / raw)
To: Anirban Chakraborty; +Cc: Sony Chacko, linux-driver, netdev, kernel-janitors
The adapter->npars[] array has QLCNIC_MAX_PCI_FUNC elements. We
allocate it that way a few lines earlier in the function. So this test
is off by one.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 33c3e46..212c121 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -479,7 +479,7 @@ qlcnic_init_pci_info(struct qlcnic_adapter *adapter)
for (i = 0; i < QLCNIC_MAX_PCI_FUNC; i++) {
pfn = pci_info[i].id;
- if (pfn > QLCNIC_MAX_PCI_FUNC) {
+ if (pfn >= QLCNIC_MAX_PCI_FUNC) {
ret = QL_STATUS_INVALID_PARAM;
goto err_eswitch;
}
^ permalink raw reply related
* Re: [PATCH 3/3] be2net: Increase statistics structure size for skyhawk.
From: Ben Hutchings @ 2012-06-14 18:50 UTC (permalink / raw)
To: sarveshwar.bandi; +Cc: davem, netdev, Vasundhara Volam
In-Reply-To: <57eadb3c-1687-40a3-b846-e1fcee3f5a58@exht1.ad.emulex.com>
On Thu, 2012-06-14 at 11:21 +0530, sarveshwar.bandi@emulex.com wrote:
> From: Vasundhara Volam <vasundhara.volam@emulex.com>
>
> Increasing the hardware statistics structure to accomodate statistics for skyhawk.
>
> Signed-off-by: Vasundhara Volam <vasundhara.volam@emulex.com>
> ---
> drivers/net/ethernet/emulex/benet/be_cmds.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.h b/drivers/net/ethernet/emulex/benet/be_cmds.h
> index 2f6bb06..3c938f5 100644
> --- a/drivers/net/ethernet/emulex/benet/be_cmds.h
> +++ b/drivers/net/ethernet/emulex/benet/be_cmds.h
> @@ -1566,7 +1566,7 @@ struct be_hw_stats_v1 {
> u32 rsvd0[BE_TXP_SW_SZ];
> struct be_erx_stats_v1 erx;
> struct be_pmem_stats pmem;
> - u32 rsvd1[3];
> + u32 rsvd1[18];
> };
>
> struct be_cmd_req_get_stats_v1 {
Doesn't this merit a 'struct be_hw_stats_v2'?
Does this mean that the driver wasn't currently allocating enough memory
for the structure, and could that result in a buffer overrun? If so
then this fix would need to go into 3.5 and 3.4.y as well.
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
* Re: [PATCH] usbnet: sanitise overlong driver information strings
From: Ben Hutchings @ 2012-06-14 19:08 UTC (permalink / raw)
To: Phil Sutter; +Cc: netdev, davem
In-Reply-To: <1339672722-22793-1-git-send-email-phil.sutter@viprinet.com>
On Thu, 2012-06-14 at 13:18 +0200, Phil Sutter wrote:
> As seen on smsc75xx, driver_info->description being longer than 32
> characters messes up 'ethtool -i' output.
I should make ethtool tolerate that, but yes these are supposed to be
null-terminated strings.
Ben.
> Signed-off-by: Phil Sutter <phil.sutter@viprinet.com>
> ---
> drivers/net/usb/usbnet.c | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
> index 9f58330..d4f7256 100644
> --- a/drivers/net/usb/usbnet.c
> +++ b/drivers/net/usb/usbnet.c
> @@ -876,9 +876,9 @@ void usbnet_get_drvinfo (struct net_device *net, struct ethtool_drvinfo *info)
> {
> struct usbnet *dev = netdev_priv(net);
>
> - strncpy (info->driver, dev->driver_name, sizeof info->driver);
> - strncpy (info->version, DRIVER_VERSION, sizeof info->version);
> - strncpy (info->fw_version, dev->driver_info->description,
> + strlcpy (info->driver, dev->driver_name, sizeof info->driver);
> + strlcpy (info->version, DRIVER_VERSION, sizeof info->version);
> + strlcpy (info->fw_version, dev->driver_info->description,
> sizeof info->fw_version);
> usb_make_path (dev->udev, info->bus_info, sizeof info->bus_info);
> }
--
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] Don't trust drivers to null-terminate strings
From: Ben Hutchings @ 2012-06-14 19:52 UTC (permalink / raw)
To: netdev; +Cc: Phil Sutter
I've committed the following change to ethtool.
Ben.
---
Some drivers have been seen to fill all bytes of
ethtool_drvinfo::fw_version without including a null terminator, which
effectively concatenates the following bytes to the string. We've
already dealt with a similar problem in dump_stats() (commit
7764430a139e4a089127f5616b0d56f497be1036). Try to cover all the
remaining string fields:
- In dump_drvinfo(), limit the length using printf() modifiers
- Add an option to get_stringset() to null-terminate all strings
- Change all callers except dump_stats() to set that option
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
ethtool.c | 38 +++++++++++++++++++++++---------------
1 files changed, 23 insertions(+), 15 deletions(-)
diff --git a/ethtool.c b/ethtool.c
index a5dce44..9e50640 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -615,19 +615,19 @@ static int dump_ecmd(struct ethtool_cmd *ep)
static int dump_drvinfo(struct ethtool_drvinfo *info)
{
fprintf(stdout,
- "driver: %s\n"
- "version: %s\n"
- "firmware-version: %s\n"
- "bus-info: %s\n"
+ "driver: %.*s\n"
+ "version: %.*s\n"
+ "firmware-version: %.*s\n"
+ "bus-info: %.*s\n"
"supports-statistics: %s\n"
"supports-test: %s\n"
"supports-eeprom-access: %s\n"
"supports-register-dump: %s\n"
"supports-priv-flags: %s\n",
- info->driver,
- info->version,
- info->fw_version,
- info->bus_info,
+ (int)sizeof(info->driver), info->driver,
+ (int)sizeof(info->version), info->version,
+ (int)sizeof(info->fw_version), info->fw_version,
+ (int)sizeof(info->bus_info), info->bus_info,
info->n_stats ? "yes" : "no",
info->testinfo_len ? "yes" : "no",
info->eedump_len ? "yes" : "no",
@@ -1317,14 +1317,14 @@ static int dump_tsinfo(const struct ethtool_ts_info *info)
static struct ethtool_gstrings *
get_stringset(struct cmd_context *ctx, enum ethtool_stringset set_id,
- ptrdiff_t drvinfo_offset)
+ ptrdiff_t drvinfo_offset, int null_terminate)
{
struct {
struct ethtool_sset_info hdr;
u32 buf[1];
} sset_info;
struct ethtool_drvinfo drvinfo;
- u32 len;
+ u32 len, i;
struct ethtool_gstrings *strings;
sset_info.hdr.cmd = ETHTOOL_GSSET_INFO;
@@ -1354,6 +1354,10 @@ get_stringset(struct cmd_context *ctx, enum ethtool_stringset set_id,
return NULL;
}
+ if (null_terminate)
+ for (i = 0; i < len; i++)
+ strings->data[(i + 1) * ETH_GSTRING_LEN - 1] = 0;
+
return strings;
}
@@ -1364,7 +1368,7 @@ static struct feature_defs *get_feature_defs(struct cmd_context *ctx)
u32 n_features;
int i, j;
- names = get_stringset(ctx, ETH_SS_FEATURES, 0);
+ names = get_stringset(ctx, ETH_SS_FEATURES, 0, 1);
if (names) {
n_features = names->len;
} else if (errno == EOPNOTSUPP || errno == EINVAL) {
@@ -2640,7 +2644,8 @@ static int do_test(struct cmd_context *ctx)
}
strings = get_stringset(ctx, ETH_SS_TEST,
- offsetof(struct ethtool_drvinfo, testinfo_len));
+ offsetof(struct ethtool_drvinfo, testinfo_len),
+ 1);
if (!strings) {
perror("Cannot get strings");
return 74;
@@ -2709,7 +2714,8 @@ static int do_gstats(struct cmd_context *ctx)
exit_bad_args();
strings = get_stringset(ctx, ETH_SS_STATS,
- offsetof(struct ethtool_drvinfo, n_stats));
+ offsetof(struct ethtool_drvinfo, n_stats),
+ 0);
if (!strings) {
perror("Cannot get stats strings information");
return 96;
@@ -3274,7 +3280,8 @@ static int do_gprivflags(struct cmd_context *ctx)
exit_bad_args();
strings = get_stringset(ctx, ETH_SS_PRIV_FLAGS,
- offsetof(struct ethtool_drvinfo, n_priv_flags));
+ offsetof(struct ethtool_drvinfo, n_priv_flags),
+ 1);
if (!strings) {
perror("Cannot get private flag names");
return 1;
@@ -3314,7 +3321,8 @@ static int do_sprivflags(struct cmd_context *ctx)
unsigned int i;
strings = get_stringset(ctx, ETH_SS_PRIV_FLAGS,
- offsetof(struct ethtool_drvinfo, n_priv_flags));
+ offsetof(struct ethtool_drvinfo, n_priv_flags),
+ 1);
if (!strings) {
perror("Cannot get private flag names");
return 1;
--
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
* Greetings
From: Abegail Benson @ 2012-06-14 19:59 UTC (permalink / raw)
Greetings,
i hope you are doing fine over there,my name is Abegail,
and am contacting you because am looking for a honest partner for
a relationship, so if you don't mind reply me for more information about me
and picture.
^ permalink raw reply
* Re: [net-next patch 8/12] bnx2x: Allow up to 63 RSS queues default 8 queues
From: David Miller @ 2012-06-14 20:36 UTC (permalink / raw)
To: meravs; +Cc: eilong, eric.dumazet, netdev
In-Reply-To: <1339688046.20038.3.camel@lb-tlvb-meravs.il.broadcom.com>
From: "Merav Sicron" <meravs@broadcom.com>
Date: Thu, 14 Jun 2012 18:34:06 +0300
> That's why we think (and so does Eric Dumazet) that it is better
> to have a smaller default number which is good for most cases.
> Do you agree with that?
What I think is that the thing which is more important than the
default we choose, is that it is consistently followed by all
multiqueue drivers.
By blazing your own unique path here, that is nearly guaranteed not to
happen.
I'd much rather have a bad default that every driver adheres to.
^ permalink raw reply
* Re: [PATCH] e1000: save skb counts in TX to avoid cache misses
From: Greg KH @ 2012-06-14 22:30 UTC (permalink / raw)
To: Roman Kagan
Cc: e1000-devel@lists.sourceforge.net, dnelson@redhat.com,
bruce.w.allan@intel.com, jesse.brandeburg@intel.com,
stable@vger.kernel.org, linux-kernel@vger.kernel.org,
john.ronciak@intel.com, netdev@vger.kernel.org, David Miller
In-Reply-To: <1339585937.17472.11.camel@rkaganb.sw.ru>
On Wed, Jun 13, 2012 at 03:12:17PM +0400, Roman Kagan wrote:
> On Fri, 2012-06-08 at 11:37 +0400, Roman Kagan wrote:
> > On Fri, 2012-06-08 at 06:15 +0400, Greg KH wrote:
> > > On Thu, Jun 07, 2012 at 02:43:58PM -0700, David Miller wrote:
> > > > From: Jeff Kirsher <tarbal@gmail.com>
> > > > Date: Thu, 07 Jun 2012 14:38:17 -0700
> > > >
> > > > > Thanks! I have applied the patch to my queue
> > > >
> > > > Why?
> > > >
> > > > My impression is that this is a patch already in the tree, and it's
> > > > being submitted for -stable but such minor performance hacks are
> > > > absolutely not appropriate for -stable submission.
> > >
> > > The patch description says it is fixing reported oopses,
> >
> > Exactly.
> >
> > > but the Subject: isn't all that helpful there.
> >
> > Well I just preserved the original subject from the upstream commit.
> > Want me to resubmit with a more alarming one?
> >
> > > So which is this? Should I accept it for a stable release or not?
> >
> > IMO yes ;)
>
> What came out of this discussion? Should I resubmit with a different
> subject, or the original one is good enough?
>
> The patch resolves a real oops; we've seen it multiple times when
> running Ubuntu-11.10 in virtual machines. Upstream and RHEL have the
> fix since long. Ubuntu is waiting for 3.0-stable to merge it
> (https://bugs.launchpad.net/bugs/1009545).
That's pretty funny that Ubuntu is letting me be the gatekeeper of fixes
to get to their customers, there's just so much wrong in that it's sad.
Anyway, I've queued it up for the next 3.0-stable release.
thanks,
greg k-h
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply
* Re: linux-next: manual merge of the wireless-next tree with the net tree
From: Stephen Rothwell @ 2012-06-15 0:23 UTC (permalink / raw)
To: John W. Linville
Cc: linux-next, linux-kernel, Emmanuel Grumbach, Johannes Berg,
David Miller, netdev
In-Reply-To: <20120612114129.68159847828093544c867306@canb.auug.org.au>
[-- Attachment #1: Type: text/plain, Size: 804 bytes --]
Hi John, Dave,
On Tue, 12 Jun 2012 11:41:29 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Today's linux-next merge of the wireless-next tree got a conflict in
> drivers/net/wireless/iwlwifi/pcie/trans.c between commit d012d04e4d63
> ("iwlwifi: disable the buggy chain extension feature in HW") from the net
> tree and commit 4beaf6c2f8af ("iwlwifi: s/txq_setup/txq_enable") from the
> wireless-next tree.
>
> I fixed it up (I think - see below) and can carry the fix as necessary.
So this conflict has now been fixed up in both the net-next (commit
43b03f1f6d68) and wireless-next (commit 627ae3ddd6f9) trees, but slightly
differently :-( I used the version from the net-next tree.
Just a heads up.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* Re: [PATCH 03/10] netfilter: add nf_ct_kfree_compat_sysctl_table to make codes clear
From: Gao feng @ 2012-06-15 1:36 UTC (permalink / raw)
To: Pablo Neira Ayuso; +Cc: netdev, netfilter-devel
In-Reply-To: <20120614180632.GD10633@1984>
Hi Pablo:
于 2012年06月15日 02:06, Pablo Neira Ayuso 写道:
> On Thu, Jun 14, 2012 at 06:07:18PM +0800, Gao feng wrote:
>> add function nf_ct_kfree_compat_sysctl_table to kfree l4proto's
>> compat sysctl table and set the sysctl table point to NULL.
>>
>> Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
>> ---
>> include/net/netfilter/nf_conntrack_l4proto.h | 8 ++++++++
>> net/netfilter/nf_conntrack_proto.c | 4 +---
>> 2 files changed, 9 insertions(+), 3 deletions(-)
>>
>> diff --git a/include/net/netfilter/nf_conntrack_l4proto.h b/include/net/netfilter/nf_conntrack_l4proto.h
>> index 5dd60f2..889b717 100644
>> --- a/include/net/netfilter/nf_conntrack_l4proto.h
>> +++ b/include/net/netfilter/nf_conntrack_l4proto.h
>> @@ -132,6 +132,14 @@ extern int nf_ct_port_nlattr_to_tuple(struct nlattr *tb[],
>> extern int nf_ct_port_nlattr_tuple_size(void);
>> extern const struct nla_policy nf_ct_port_nla_policy[];
>>
>> +static inline void nf_ct_kfree_compat_sysctl_table(struct nf_proto_net *pn)
>> +{
>> +#if defined(CONFIG_SYSCTL) && defined(CONFIG_NF_CONNTRACK_PROC_COMPAT)
>> + kfree(pn->ctl_compat_table);
>> + pn->ctl_compat_table = NULL;
>> +#endif
>> +}
>> +
>> #ifdef CONFIG_SYSCTL
>> #ifdef DEBUG_INVALID_PACKETS
>> #define LOG_INVALID(net, proto) \
>> diff --git a/net/netfilter/nf_conntrack_proto.c b/net/netfilter/nf_conntrack_proto.c
>> index 8fc0332..c9df1b4 100644
>> --- a/net/netfilter/nf_conntrack_proto.c
>> +++ b/net/netfilter/nf_conntrack_proto.c
>> @@ -361,9 +361,7 @@ int nf_ct_l4proto_register_sysctl(struct net *net,
>> NULL);
>> if (err == 0)
>> goto out;
>> -
>> - kfree(pn->ctl_compat_table);
>> - pn->ctl_compat_table = NULL;
>> + nf_ct_kfree_compat_sysctl_table(pn);
>
> if this is the only client of this function, then make it static and
> define it inside nf_conntrack_proto.c
>
tcp_init_net,udp_init_net use this function too.
Thanks
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" 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
* Re: [PATCH 02/10] netfilter: add parameter proto for l4proto.init_net
From: Gao feng @ 2012-06-15 1:38 UTC (permalink / raw)
To: Pablo Neira Ayuso; +Cc: netdev, netfilter-devel
In-Reply-To: <20120614175903.GB10633@1984>
于 2012年06月15日 01:59, Pablo Neira Ayuso 写道:
> On Thu, Jun 14, 2012 at 06:07:17PM +0800, Gao feng wrote:
>> there are redundancy codes in l4proto's init_net functions.
>> we can use one init_net function and l3proto to impletment
>> the same thing.
>>
>> So we should add l3proto as a parameter for init_net function.
>>
>> Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
>> ---
>> include/net/netfilter/nf_conntrack_l4proto.h | 2 +-
>> net/ipv4/netfilter/nf_conntrack_proto_icmp.c | 2 +-
>> net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c | 2 +-
>> net/netfilter/nf_conntrack_proto.c | 6 ++++--
>> net/netfilter/nf_conntrack_proto_dccp.c | 2 +-
>> net/netfilter/nf_conntrack_proto_generic.c | 2 +-
>> net/netfilter/nf_conntrack_proto_gre.c | 2 +-
>> net/netfilter/nf_conntrack_proto_sctp.c | 4 ++--
>> net/netfilter/nf_conntrack_proto_tcp.c | 4 ++--
>> net/netfilter/nf_conntrack_proto_udp.c | 4 ++--
>> net/netfilter/nf_conntrack_proto_udplite.c | 2 +-
>> 11 files changed, 17 insertions(+), 15 deletions(-)
>>
>> diff --git a/include/net/netfilter/nf_conntrack_l4proto.h b/include/net/netfilter/nf_conntrack_l4proto.h
>> index 81c52b5..5dd60f2 100644
>> --- a/include/net/netfilter/nf_conntrack_l4proto.h
>> +++ b/include/net/netfilter/nf_conntrack_l4proto.h
>> @@ -97,7 +97,7 @@ struct nf_conntrack_l4proto {
>> #endif
>> int *net_id;
>> /* Init l4proto pernet data */
>> - int (*init_net)(struct net *net);
>> + int (*init_net)(struct net *net, u_int16_t proto);
>>
>> /* Protocol name */
>> const char *name;
>> diff --git a/net/ipv4/netfilter/nf_conntrack_proto_icmp.c b/net/ipv4/netfilter/nf_conntrack_proto_icmp.c
>> index 041923c..76f7a2f 100644
>> --- a/net/ipv4/netfilter/nf_conntrack_proto_icmp.c
>> +++ b/net/ipv4/netfilter/nf_conntrack_proto_icmp.c
>> @@ -337,7 +337,7 @@ static struct ctl_table icmp_compat_sysctl_table[] = {
>> #endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */
>> #endif /* CONFIG_SYSCTL */
>>
>> -static int icmp_init_net(struct net *net)
>> +static int icmp_init_net(struct net *net, u_int16_t proto)
>> {
>> struct nf_icmp_net *in = icmp_pernet(net);
>> struct nf_proto_net *pn = (struct nf_proto_net *)in;
>> diff --git a/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c b/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
>> index 63ed012..807ae09 100644
>> --- a/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
>> +++ b/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
>> @@ -333,7 +333,7 @@ static struct ctl_table icmpv6_sysctl_table[] = {
>> };
>> #endif /* CONFIG_SYSCTL */
>>
>> -static int icmpv6_init_net(struct net *net)
>> +static int icmpv6_init_net(struct net *net, u_int16_t proto)
>> {
>> struct nf_icmp_net *in = icmpv6_pernet(net);
>> struct nf_proto_net *pn = (struct nf_proto_net *)in;
>> diff --git a/net/netfilter/nf_conntrack_proto.c b/net/netfilter/nf_conntrack_proto.c
>> index a434dd7..8fc0332 100644
>> --- a/net/netfilter/nf_conntrack_proto.c
>> +++ b/net/netfilter/nf_conntrack_proto.c
>> @@ -193,6 +193,7 @@ static int nf_ct_l3proto_register_sysctl(struct net *net,
>> l3proto->ctl_table_path,
>> in->ctl_table,
>> NULL);
>> +
>
> This entire patchset contains many extra new lines. If you want to
> provide some cleanup, it should come in some follow-up patch.
Ok, I will make a follow-up patch to do some cleanup.
>
>> if (err < 0) {
>> kfree(in->ctl_table);
>> in->ctl_table = NULL;
>> @@ -460,7 +461,7 @@ int nf_conntrack_l4proto_register(struct net *net,
>> {
>> int ret = 0;
>> if (l4proto->init_net) {
>> - ret = l4proto->init_net(net);
>> + ret = l4proto->init_net(net, l4proto->l3proto);
>> if (ret < 0)
>> return ret;
>> }
>> @@ -514,7 +515,8 @@ int nf_conntrack_proto_init(struct net *net)
>> {
>> unsigned int i;
>> int err;
>> - err = nf_conntrack_l4proto_generic.init_net(net);
>> + err = nf_conntrack_l4proto_generic.init_net(net,
>> + nf_conntrack_l4proto_generic.l3proto);
>
> You have to make sure that lines break at 80-chars per column.
>
> Something like this should be fine:
>
> err = nf_conntrack_l4proto_generic.init_net(net,
> nf_conntrack_l4proto_generic.l3proto);
>
>
Get it, thanks.
^ 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