* Re: [V2 PATCH 9/9] vhost: zerocopy: poll vq in zerocopy callback
From: Shirley Ma @ 2012-05-21 16:12 UTC (permalink / raw)
To: Jason Wang
Cc: Michael S. Tsirkin, eric.dumazet, netdev, linux-kernel, ebiederm,
davem
In-Reply-To: <1337614972.12999.56.camel@oc3660625478.ibm.com>
On Mon, 2012-05-21 at 08:42 -0700, Shirley Ma wrote:
> On Mon, 2012-05-21 at 14:05 +0800, Jason Wang wrote:
> > >> - tx polling depends on skb_orphan() which is often called by
> > device
> > >> driver when it place the packet into the queue of the devices
> > instead
> > >> of when the packets were sent. So it was too early for vhost to
> be
> > >> notified.
> > > Then do you think it's better to replace with vhost_poll_queue
> here
> > > instead?
> >
> > Just like what does this patch do - calling vhost_poll_queue() in
> > vhost_zerocopy_callback().
> > >> - it only works when the pending DMAs exceeds VHOST_MAX_PEND,
> it's
> > >> highly possible that guest needs to be notified when the pending
> > >> packets
> > >> isn't so much.
> > > In which situation the guest needs to be notified when there is no
> > TX
> > > besides buffers run out?
> >
> > Consider guest call virtqueue_enable_cb_delayed() which means it
> only
> > need to be notified when 3/4 of pending buffers ( about 178 buffers
> > (256-MAX_SKB_FRAGS-2)*3/4 ) were sent by host. So vhost_net would
> > notify
> > guest when about 60 buffers were pending. Since tx polling is only
> > enabled when pending packets exceeds VHOST_MAX_PEND 128, so tx work
> > would not be notified to run and guest would never get the interrupt
> > it
> > expected to re-enable the queue.
>
> So it seems we still need vhost_enable_notify() in handle_tx when there
> is no tx in zerocopy case.
>
> Do you know which one is more expensive: the cost of
> vhost_poll_queue()
> in each zerocopy callback or calling vhost_enable_notify()?
>
> Have you compared the results by removing below code in handle_tx()?
>
> - if (unlikely(num_pends > VHOST_MAX_PEND)) {
> - tx_poll_start(net, sock);
> - set_bit(SOCK_ASYNC_NOSPACE,
> &sock->flags);
> - break;
> - }
> >
> > And just like what we've discussed, tx polling based adding and
> > signaling is too early for vhost.
>
Then it could be too early for vhost to notify guest anywhere in
handle_tx for zerocopy. Then we might need to remove any notification in
handle_tx for zerocopy to vhost zerocopy callback instead.
Adding vhost_poll_queue in vhost zerocopy callback unconditionally would
consume unnecessary cpu.
We need to think about a better solution here.
Thanks
Shirley
^ permalink raw reply
* Re: [PATCH] Bluetooth: Fix null pointer dereference in l2cap_chan_send
From: Gustavo Padovan @ 2012-05-21 16:17 UTC (permalink / raw)
To: Minho Ban
Cc: Marcel Holtmann, Johan Hedberg, David S. Miller, linux-bluetooth,
netdev, linux-kernel
In-Reply-To: <4FB9932B.9070101@samsung.com>
Hi Minho,
* Minho Ban <mhban@samsung.com> [2012-05-21 09:58:19 +0900]:
> If l2cap_chan_send is called will null conn it will cause kernel Oops.
> This patch checks if conn is valid before entering l2cap_chan_send.
chan->conn should be always valid, and if not we have a bug somewhere else in
the code and not in l2cap_chan_send(). It could be a locking problem maybe.
Also check if you can reproduce this with latest bluetooth-next.
Gustavo
^ permalink raw reply
* Re: [RFC/PATCH] Bluetooth: prevent double l2cap_chan_destroy
From: Gustavo Padovan @ 2012-05-21 16:21 UTC (permalink / raw)
To: Minho Ban
Cc: Marcel Holtmann, Johan Hedberg, David S. Miller, linux-bluetooth,
netdev, linux-kernel
In-Reply-To: <4FB992C8.8090105@samsung.com>
Hi Minho,
* Minho Ban <mhban@samsung.com> [2012-05-21 09:56:40 +0900]:
> l2cap_sock_kill can be called in l2cap_sock_release and l2cap_sock_close_cb
> either. This lead l2cap_chan_destroy to be called twice for same channel.
> To prevent double list_del and double chan_put, chan_destroy should be protected
> with chan->refcnt and chan_list_lock so that reentrance could be forbidden.
Even if l2cap_sock_kill() is called twice it will call l2cap_chan_destroy()
only once. If this is not happening we just have a broken piece of code
somewhere else and not here.
Gustavo
^ permalink raw reply
* [RFC/PATCH] crypto: talitos - replace the tasklet implementation with NAPI
From: Horia Geanta @ 2012-05-21 16:53 UTC (permalink / raw)
To: linux-crypto
Cc: netdev, Herbert Xu, David S. Miller, Kim Phillips, Sandeep Malik
Hi,
During performance measurements & optimization phase, we found out that we get
better numbers (in the range of 9-10%) by using the NAPI approach for the
crypto engine interrupt mechanism instead of tasklet.
We found out that for the tasklet-based interrupt mechanism, we were facing
imbalanced processing - NET RX softirq was running more frequently than the
crypto tasklet.
The patch replaces the tasklet-based implementation with NAPI. It is based on
latest crypto-2.6 tree.
I am aware of the fact that using NAPI for anything else than net devices might
be frowned upon, that's why I am adding the netdev folks to comment, advise.
Thanks,
Horia
>From 30f6247fa5ada7e53523492ca4e70b61e3f5aeeb Mon Sep 17 00:00:00 2001
From: Horia Geanta <horia.geanta@freescale.com>
Date: Wed, 2 May 2012 18:40:03 +0300
Subject: [RFC/PATCH] crypto: talitos - replace the tasklet implementation with NAPI
This patch updates the current tasklet implement to NAPI so as
the system is more balanced in the terms that the packet submission
and the packet forwarding after being processed can be done at
the same priority.
Signed-off-by: Sandeep Malik <Sandeep.Malik@freescale.com>
Signed-off-by: Horia Geanta <horia.geanta@freescale.com>
---
drivers/crypto/Kconfig | 2 +-
drivers/crypto/talitos.c | 148 +++++++++++++++++++++++++++++++++-------------
drivers/crypto/talitos.h | 4 +-
3 files changed, 110 insertions(+), 44 deletions(-)
diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig
index ab9abb4..934fa57 100644
--- a/drivers/crypto/Kconfig
+++ b/drivers/crypto/Kconfig
@@ -209,7 +209,7 @@ config CRYPTO_DEV_TALITOS
select CRYPTO_ALGAPI
select CRYPTO_AUTHENC
select HW_RANDOM
- depends on FSL_SOC
+ depends on FSL_SOC && NET
help
Say 'Y' here to use the Freescale Security Engine (SEC)
to offload cryptographic algorithm computation.
diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c
index 921039e..817f74c 100644
--- a/drivers/crypto/talitos.c
+++ b/drivers/crypto/talitos.c
@@ -1,7 +1,7 @@
/*
* talitos - Freescale Integrated Security Engine (SEC) device driver
*
- * Copyright (c) 2008-2011 Freescale Semiconductor, Inc.
+ * Copyright (c) 2008-2012 Freescale Semiconductor, Inc.
*
* Scatterlist Crypto API glue code copied from files with the following:
* Copyright (c) 2006-2007 Herbert Xu <herbert@gondor.apana.org.au>
@@ -37,6 +37,7 @@
#include <linux/io.h>
#include <linux/spinlock.h>
#include <linux/rtnetlink.h>
+#include <linux/netdevice.h>
#include <linux/slab.h>
#include <crypto/algapi.h>
@@ -121,6 +122,7 @@ struct talitos_channel {
struct talitos_private {
struct device *dev;
struct platform_device *ofdev;
+ struct net_device __percpu *netdev;
void __iomem *reg;
int irq[2];
@@ -148,8 +150,8 @@ struct talitos_private {
/* next channel to be assigned next incoming descriptor */
atomic_t last_chan ____cacheline_aligned;
- /* request callback tasklet */
- struct tasklet_struct done_task[2];
+ /* request callback napi */
+ struct napi_struct __percpu *done_task[2];
/* list of registered algorithms */
struct list_head alg_list;
@@ -352,17 +354,18 @@ static int talitos_submit(struct device *dev, int ch, struct talitos_desc *desc,
/*
* process what was done, notify callback of error if not
*/
-static void flush_channel(struct device *dev, int ch, int error, int reset_ch)
+static int flush_channel(struct device *dev, int ch, int error, int reset_ch,
+ int weight)
{
struct talitos_private *priv = dev_get_drvdata(dev);
struct talitos_request *request, saved_req;
unsigned long flags;
- int tail, status;
+ int tail, status, count = 0;
spin_lock_irqsave(&priv->chan[ch].tail_lock, flags);
tail = priv->chan[ch].tail;
- while (priv->chan[ch].fifo[tail].desc) {
+ while (priv->chan[ch].fifo[tail].desc && (count < weight)) {
request = &priv->chan[ch].fifo[tail];
/* descriptors with their done bits set don't get the error */
@@ -399,46 +402,57 @@ static void flush_channel(struct device *dev, int ch, int error, int reset_ch)
status);
/* channel may resume processing in single desc error case */
if (error && !reset_ch && status == error)
- return;
+ return 0;
+ count++;
spin_lock_irqsave(&priv->chan[ch].tail_lock, flags);
tail = priv->chan[ch].tail;
}
spin_unlock_irqrestore(&priv->chan[ch].tail_lock, flags);
+
+ return count;
}
/*
* process completed requests for channels that have done status
*/
-#define DEF_TALITOS_DONE(name, ch_done_mask) \
-static void talitos_done_##name(unsigned long data) \
+#define DEF_TALITOS_DONE(name, ch_done_mask, num_ch) \
+static int talitos_done_##name(struct napi_struct *napi, int budget) \
{ \
- struct device *dev = (struct device *)data; \
+ struct device *dev = &napi->dev->dev; \
struct talitos_private *priv = dev_get_drvdata(dev); \
+ int budget_per_ch = budget / num_ch, work_done = 0; \
unsigned long flags; \
\
if (ch_done_mask & 1) \
- flush_channel(dev, 0, 0, 0); \
+ work_done += flush_channel(dev, 0, 0, 0, budget_per_ch);\
if (priv->num_channels == 1) \
goto out; \
if (ch_done_mask & (1 << 2)) \
- flush_channel(dev, 1, 0, 0); \
+ work_done += flush_channel(dev, 1, 0, 0, budget_per_ch);\
if (ch_done_mask & (1 << 4)) \
- flush_channel(dev, 2, 0, 0); \
+ work_done += flush_channel(dev, 2, 0, 0, budget_per_ch);\
if (ch_done_mask & (1 << 6)) \
- flush_channel(dev, 3, 0, 0); \
+ work_done += flush_channel(dev, 3, 0, 0, budget_per_ch);\
\
out: \
- /* At this point, all completed channels have been processed */ \
- /* Unmask done interrupts for channels completed later on. */ \
- spin_lock_irqsave(&priv->reg_lock, flags); \
- setbits32(priv->reg + TALITOS_IMR, ch_done_mask); \
- setbits32(priv->reg + TALITOS_IMR_LO, TALITOS_IMR_LO_INIT); \
- spin_unlock_irqrestore(&priv->reg_lock, flags); \
+ if (work_done < budget) { \
+ napi_complete(napi); \
+ /* At this point, all completed channels have been */ \
+ /* processed. Unmask done interrupts for channels */ \
+ /* completed later on. */ \
+ spin_lock_irqsave(&priv->reg_lock, flags); \
+ setbits32(priv->reg + TALITOS_IMR, ch_done_mask); \
+ setbits32(priv->reg + TALITOS_IMR_LO, \
+ TALITOS_IMR_LO_INIT); \
+ spin_unlock_irqrestore(&priv->reg_lock, flags); \
+ } \
+ \
+ return work_done; \
}
-DEF_TALITOS_DONE(4ch, TALITOS_ISR_4CHDONE)
-DEF_TALITOS_DONE(ch0_2, TALITOS_ISR_CH_0_2_DONE)
-DEF_TALITOS_DONE(ch1_3, TALITOS_ISR_CH_1_3_DONE)
+DEF_TALITOS_DONE(4ch, TALITOS_ISR_4CHDONE, 4)
+DEF_TALITOS_DONE(ch0_2, TALITOS_ISR_CH_0_2_DONE, 2)
+DEF_TALITOS_DONE(ch1_3, TALITOS_ISR_CH_1_3_DONE, 2)
/*
* locate current (offending) descriptor
@@ -588,7 +602,7 @@ static void talitos_error(struct device *dev, u32 isr, u32 isr_lo)
if (v_lo & TALITOS_CCPSR_LO_SRL)
dev_err(dev, "scatter return/length error\n");
- flush_channel(dev, ch, error, reset_ch);
+ flush_channel(dev, ch, error, reset_ch, priv->fifo_len);
if (reset_ch) {
reset_channel(dev, ch);
@@ -612,14 +626,14 @@ static void talitos_error(struct device *dev, u32 isr, u32 isr_lo)
/* purge request queues */
for (ch = 0; ch < priv->num_channels; ch++)
- flush_channel(dev, ch, -EIO, 1);
+ flush_channel(dev, ch, -EIO, 1, priv->fifo_len);
/* reset and reinitialize the device */
init_device(dev);
}
}
-#define DEF_TALITOS_INTERRUPT(name, ch_done_mask, ch_err_mask, tlet) \
+#define DEF_TALITOS_INTERRUPT(name, ch_done_mask, ch_err_mask, sirq) \
static irqreturn_t talitos_interrupt_##name(int irq, void *data) \
{ \
struct device *dev = data; \
@@ -643,7 +657,8 @@ static irqreturn_t talitos_interrupt_##name(int irq, void *data) \
/* mask further done interrupts. */ \
clrbits32(priv->reg + TALITOS_IMR, ch_done_mask); \
/* done_task will unmask done interrupts at exit */ \
- tasklet_schedule(&priv->done_task[tlet]); \
+ napi_schedule(per_cpu_ptr(priv->done_task[sirq], \
+ smp_processor_id())); \
} \
spin_unlock_irqrestore(&priv->reg_lock, flags); \
} \
@@ -2567,7 +2582,7 @@ static int talitos_remove(struct platform_device *ofdev)
struct device *dev = &ofdev->dev;
struct talitos_private *priv = dev_get_drvdata(dev);
struct talitos_crypto_alg *t_alg, *n;
- int i;
+ int i, j;
list_for_each_entry_safe(t_alg, n, &priv->alg_list, entry) {
switch (t_alg->algt.type) {
@@ -2586,25 +2601,32 @@ static int talitos_remove(struct platform_device *ofdev)
if (hw_supports(dev, DESC_HDR_SEL0_RNG))
talitos_unregister_rng(dev);
- for (i = 0; i < priv->num_channels; i++)
- kfree(priv->chan[i].fifo);
-
- kfree(priv->chan);
-
for (i = 0; i < 2; i++)
if (priv->irq[i]) {
free_irq(priv->irq[i], dev);
irq_dispose_mapping(priv->irq[i]);
+
+ for_each_possible_cpu(j) {
+ napi_disable(per_cpu_ptr(priv->done_task[i],
+ j));
+ netif_napi_del(per_cpu_ptr(priv->done_task[i],
+ j));
+ }
+
+ free_percpu(priv->done_task[i]);
}
- tasklet_kill(&priv->done_task[0]);
- if (priv->irq[1])
- tasklet_kill(&priv->done_task[1]);
+ for (i = 0; i < priv->num_channels; i++)
+ kfree(priv->chan[i].fifo);
+
+ kfree(priv->chan);
iounmap(priv->reg);
dev_set_drvdata(dev, NULL);
+ free_percpu(priv->netdev);
+
kfree(priv);
return 0;
@@ -2730,21 +2752,63 @@ static int talitos_probe(struct platform_device *ofdev)
dev_set_drvdata(dev, priv);
priv->ofdev = ofdev;
+ priv->dev = dev;
spin_lock_init(&priv->reg_lock);
+ priv->netdev = alloc_percpu(struct net_device);
+ if (!priv->netdev) {
+ dev_err(dev, "failed to allocate netdevice\n");
+ err = -ENOMEM;
+ goto err_out;
+ }
+
+ for_each_possible_cpu(i) {
+ err = init_dummy_netdev(per_cpu_ptr(priv->netdev, i));
+ if (err) {
+ dev_err(dev, "failed to initialize dummy netdevice\n");
+ goto err_out;
+ }
+ (per_cpu_ptr(priv->netdev, i))->dev = *dev;
+ }
+
err = talitos_probe_irq(ofdev);
if (err)
goto err_out;
+ priv->done_task[0] = alloc_percpu(struct napi_struct);
+ if (!priv->done_task[0]) {
+ dev_err(dev, "failed to allocate napi for 1st irq\n");
+ err = -ENOMEM;
+ goto err_out;
+ }
+
if (!priv->irq[1]) {
- tasklet_init(&priv->done_task[0], talitos_done_4ch,
- (unsigned long)dev);
+ for_each_possible_cpu(i) {
+ netif_napi_add(per_cpu_ptr(priv->netdev, i),
+ per_cpu_ptr(priv->done_task[0], i),
+ talitos_done_4ch, TALITOS_NAPI_WEIGHT);
+ napi_enable(per_cpu_ptr(priv->done_task[0], i));
+ }
} else {
- tasklet_init(&priv->done_task[0], talitos_done_ch0_2,
- (unsigned long)dev);
- tasklet_init(&priv->done_task[1], talitos_done_ch1_3,
- (unsigned long)dev);
+ priv->done_task[1] = alloc_percpu(struct napi_struct);
+ if (!priv->done_task[1]) {
+ dev_err(dev, "failed to allocate napi for 2nd irq\n");
+ err = -ENOMEM;
+ goto err_out;
+ }
+
+ for_each_possible_cpu(i) {
+ netif_napi_add(per_cpu_ptr(priv->netdev, i),
+ per_cpu_ptr(priv->done_task[0], i),
+ talitos_done_ch0_2, TALITOS_NAPI_WEIGHT);
+ napi_enable(per_cpu_ptr(priv->done_task[0], i));
+
+ netif_napi_add(per_cpu_ptr(priv->netdev, i),
+ per_cpu_ptr(priv->done_task[1], i),
+ talitos_done_ch1_3, TALITOS_NAPI_WEIGHT);
+ napi_enable(per_cpu_ptr(priv->done_task[1], i));
+ }
}
INIT_LIST_HEAD(&priv->alg_list);
diff --git a/drivers/crypto/talitos.h b/drivers/crypto/talitos.h
index 3c17395..3fe0e36 100644
--- a/drivers/crypto/talitos.h
+++ b/drivers/crypto/talitos.h
@@ -1,7 +1,7 @@
/*
* Freescale SEC (talitos) device register and descriptor header defines
*
- * Copyright (c) 2006-2011 Freescale Semiconductor, Inc.
+ * Copyright (c) 2006-2012 Freescale Semiconductor, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -28,6 +28,8 @@
*
*/
+#define TALITOS_NAPI_WEIGHT 22
+
/*
* TALITOS_xxx_LO addresses point to the low data bits (32-63) of the register
*/
--
1.7.3.4
^ permalink raw reply related
* [PATCH] xen/netback: calculate correctly the SKB slots.
From: Konrad Rzeszutek Wilk @ 2012-05-21 17:36 UTC (permalink / raw)
To: xen-devel, ian.campbell, netdev, davem, linux-kernel
Cc: Adnan Misherfi, Konrad Rzeszutek Wilk
From: Adnan Misherfi <adnan.misherfi@oracle.com>
A programming error cause the calculation of receive SKB slots to be
wrong, which caused the RX ring to be erroneously declared full,
and the receive queue to be stopped. The problem shows up when two
guest running on the same server tries to communicates using large
MTUs. Each guest is connected to a bridge with VLAN over bond
interface, so traffic from one guest leaves the server on one bridge
and comes back to the second guest on the second bridge. This can be
reproduces using ping, and one guest as follow:
- Create active-back bond (bond0)
- Set up VLAN 5 on bond0 (bond0.5)
- Create a bridge (br1)
- Add bond0.5 to a bridge (br1)
- Start a guest and connect it to br1
- Set MTU of 9000 across the link
Ping the guest from an external host using packet sizes of 3991, and
4054; ping -s 3991 -c 128 "Guest-IP-Address"
At the beginning ping works fine, but after a while ping packets do
not reach the guest because the RX ring becomes full, and the queue
get stopped. Once the problem accrued, the only way to get out of it
is to reboot the guest, or use xm network-detach/network-attach.
ping works for packets sizes 3990,3992, and many other sizes including
4000,5000,9000, and 1500 ..etc. MTU size of 3991,4054 are the sizes
that quickly reproduce this problem.
Signed-off-by: Adnan Misherfi <adnan.misherfi@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
drivers/net/xen-netback/netback.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
index 957cf9d..e382e5b 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -212,7 +212,7 @@ unsigned int xenvif_count_skb_slots(struct xenvif *vif, struct sk_buff *skb)
int i, copy_off;
count = DIV_ROUND_UP(
- offset_in_page(skb->data)+skb_headlen(skb), PAGE_SIZE);
+ offset_in_page(skb->data + skb_headlen(skb)), PAGE_SIZE);
copy_off = skb_headlen(skb) % PAGE_SIZE;
--
1.7.7.5
^ permalink raw reply related
* Re: [PATCH net-next] drivers/net: delete old 8bit ISA 3c501 driver.
From: Alan Cox @ 2012-05-21 18:46 UTC (permalink / raw)
To: David Laight; +Cc: Paul Gortmaker, Ondrej Zary, davem, netdev
In-Reply-To: <AE90C24D6B3A694183C094C60CF0A2F6026B6F13@saturn3.aculab.com>
> Probing for non-pnp ISA cards is definitely unreliable.
> Maybe some of these drivers should need to be explicitly
> enabled in the kernel config.
The config is set by the distributions, not always cluefully. Non PnP
ISA drivers won't autoload either as they have nothing to key off.
> I hadn't realised how bad some of the 3cxxx cards were!
The 3c500/01 were the first PC ethernet card ever so very very old.
> I thought the 'parallel tasking' was all about starting
> to tx a frame while the host was still copting it to the
> tx fifo (and rx copies before end of frame), not that
It was.
Alan
^ permalink raw reply
* [PATCH] net: drop NET dependency from HAVE_BPF_JIT
From: Sam Ravnborg @ 2012-05-21 18:52 UTC (permalink / raw)
To: Linus Torvalds, netdev, David S. Miller
Cc: David Miller, akpm, sparclinux, linux-kernel
In-Reply-To: <CA+55aFy4He9X6wQjATaJukzH1FkyhGqnmC4kb+azKuMmjPGbmg@mail.gmail.com>
>From 4976b8fc9fd9f876634d6d73e5b808c762e1352a Mon Sep 17 00:00:00 2001
From: Sam Ravnborg <sam@ravnborg.org>
Date: Mon, 21 May 2012 20:45:37 +0200
Subject: [PATCH] net: drop NET dependency from HAVE_BPF_JIT
There is no point having the NET dependency on the select target,
as it forces all users to depend on NET to tell they support BPF_JIT.
Move the config option to the bottom of the file - this
could be a nice place also for future "selectable" config symbols.
Fix up all users to drop the dependency on NET now that
it is not required to supress warnings for non-NET builds.
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
Did a few "make ARCH=xxx allnoconfig" and no warning were triggered.
Sam
arch/arm/Kconfig | 2 +-
arch/powerpc/Kconfig | 2 +-
arch/sparc/Kconfig | 2 +-
arch/x86/Kconfig | 2 +-
net/Kconfig | 7 ++++---
5 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 36586db..e19ed3f 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -33,7 +33,7 @@ config ARM
select GENERIC_IRQ_SHOW
select CPU_PM if (SUSPEND || CPU_IDLE)
select GENERIC_PCI_IOMAP
- select HAVE_BPF_JIT if NET
+ select HAVE_BPF_JIT
help
The ARM series is a line of low-power-consumption RISC chip designs
licensed by ARM Ltd and targeted at embedded applications and
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index feab3ba..73ec039 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -141,7 +141,7 @@ config PPC
select IRQ_FORCED_THREADING
select HAVE_RCU_TABLE_FREE if SMP
select HAVE_SYSCALL_TRACEPOINTS
- select HAVE_BPF_JIT if (PPC64 && NET)
+ select HAVE_BPF_JIT if PPC64
select HAVE_ARCH_JUMP_LABEL
select ARCH_HAVE_NMI_SAFE_CMPXCHG
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 6c49ed2..d176c03 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -30,7 +30,7 @@ config SPARC
select USE_GENERIC_SMP_HELPERS if SMP
select GENERIC_PCI_IOMAP
select HAVE_NMI_WATCHDOG if SPARC64
- select HAVE_BPF_JIT if NET
+ select HAVE_BPF_JIT
config SPARC32
def_bool !64BIT
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index c9866b0..25f87bc 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -77,7 +77,7 @@ config X86
select GENERIC_CLOCKEVENTS_MIN_ADJUST
select IRQ_FORCED_THREADING
select USE_GENERIC_SMP_HELPERS if SMP
- select HAVE_BPF_JIT if (X86_64 && NET)
+ select HAVE_BPF_JIT if X86_64
select CLKEVT_I8253
select ARCH_HAVE_NMI_SAFE_CMPXCHG
select GENERIC_IOMAP
diff --git a/net/Kconfig b/net/Kconfig
index 1e47bd0..245831b 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -246,9 +246,6 @@ config BQL
select DQL
default y
-config HAVE_BPF_JIT
- bool
-
config BPF_JIT
bool "enable BPF Just In Time compiler"
depends on HAVE_BPF_JIT
@@ -340,3 +337,7 @@ source "net/nfc/Kconfig"
endif # if NET
+
+# Used by archs to tell that they support BPF_JIT
+config HAVE_BPF_JIT
+ bool
--
1.6.0.6
^ permalink raw reply related
* Re: [PATCH] net: drop NET dependency from HAVE_BPF_JIT
From: Linus Torvalds @ 2012-05-21 18:54 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: netdev, David S. Miller, akpm, sparclinux, linux-kernel
In-Reply-To: <20120521185202.GA6486@merkur.ravnborg.org>
On Mon, May 21, 2012 at 11:52 AM, Sam Ravnborg <sam@ravnborg.org> wrote:
>
> Fix up all users to drop the dependency on NET now that
> it is not required to supress warnings for non-NET builds.
Do you want me to take this directly, or will it go through the net
tree? I can live with it either way.
Linus
^ permalink raw reply
* [PATCH 2/4]net:ipv6:fixed spacing issues for = operator
From: Jeffrin Jose @ 2012-05-21 19:04 UTC (permalink / raw)
To: davem, edumazet, loke.chetan, herbert; +Cc: netdev, linux-kernel, ahiliation
Fixed spacing issues related to = operator
found in net/ipv6/mcast.c by checkpatch.pl tool
Signed-off-by: Jeffrin Jose <ahiliation@yahoo.co.in>
---
net/ipv6/mcast.c | 94 +++++++++++++++++++++++++++---------------------------
1 file changed, 47 insertions(+), 47 deletions(-)
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 8f7eee9..66235a0 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -369,7 +369,7 @@ int ip6_mc_source(int add, int omode, struct sock *sk,
if (!psl)
goto done; /* err = -EADDRNOTAVAIL */
rv = !0;
- for (i=0; i<psl->sl_count; i++) {
+ for (i = 0; i<psl->sl_count; i++) {
rv = memcmp(&psl->sl_addr[i], source,
sizeof(struct in6_addr));
if (rv == 0)
@@ -387,7 +387,7 @@ int ip6_mc_source(int add, int omode, struct sock *sk,
/* update the interface filter */
ip6_mc_del_src(idev, group, omode, 1, source, 1);
- for (j=i+1; j<psl->sl_count; j++)
+ for (j = i+1; j<psl->sl_count; j++)
psl->sl_addr[j-1] = psl->sl_addr[j];
psl->sl_count--;
err = 0;
@@ -413,21 +413,21 @@ int ip6_mc_source(int add, int omode, struct sock *sk,
newpsl->sl_max = count;
newpsl->sl_count = count - IP6_SFBLOCK;
if (psl) {
- for (i=0; i<psl->sl_count; i++)
+ for (i = 0; i<psl->sl_count; i++)
newpsl->sl_addr[i] = psl->sl_addr[i];
sock_kfree_s(sk, psl, IP6_SFLSIZE(psl->sl_max));
}
pmc->sflist = psl = newpsl;
}
rv = 1; /* > 0 for insert logic below if sl_count is 0 */
- for (i=0; i<psl->sl_count; i++) {
+ for (i = 0; i<psl->sl_count; i++) {
rv = memcmp(&psl->sl_addr[i], source, sizeof(struct in6_addr));
if (rv == 0)
break;
}
if (rv == 0) /* address already there is an error */
goto done;
- for (j=psl->sl_count-1; j>=i; j--)
+ for (j = psl->sl_count-1; j>=i; j--)
psl->sl_addr[j+1] = psl->sl_addr[j];
psl->sl_addr[i] = *source;
psl->sl_count++;
@@ -496,7 +496,7 @@ int ip6_mc_msfilter(struct sock *sk, struct group_filter *gsf)
goto done;
}
newpsl->sl_max = newpsl->sl_count = gsf->gf_numsrc;
- for (i=0; i<newpsl->sl_count; ++i) {
+ for (i = 0; i<newpsl->sl_count; ++i) {
struct sockaddr_in6 *psin6;
psin6 = (struct sockaddr_in6 *)&gsf->gf_slist[i];
@@ -588,7 +588,7 @@ int ip6_mc_msfget(struct sock *sk, struct group_filter *gsf,
* on ipv6_sk_mc_lock and a write lock on pmc->sflock. We
* have the socket lock, so reading here is safe.
*/
- for (i=0; i<copycount; i++) {
+ for (i = 0; i<copycount; i++) {
struct sockaddr_in6 *psin6;
struct sockaddr_storage ss;
@@ -630,7 +630,7 @@ int inet6_mc_check(struct sock *sk, const struct in6_addr *mc_addr,
} else {
int i;
- for (i=0; i<psl->sl_count; i++) {
+ for (i = 0; i<psl->sl_count; i++) {
if (ipv6_addr_equal(&psl->sl_addr[i], src_addr))
break;
}
@@ -736,7 +736,7 @@ static void mld_add_delrec(struct inet6_dev *idev, struct ifmcaddr6 *im)
pmc->mca_tomb = im->mca_tomb;
pmc->mca_sources = im->mca_sources;
im->mca_tomb = im->mca_sources = NULL;
- for (psf=pmc->mca_sources; psf; psf=psf->sf_next)
+ for (psf = pmc->mca_sources; psf; psf = psf->sf_next)
psf->sf_crcount = pmc->mca_crcount;
}
spin_unlock_bh(&im->mca_lock);
@@ -754,7 +754,7 @@ static void mld_del_delrec(struct inet6_dev *idev, const struct in6_addr *pmca)
spin_lock_bh(&idev->mc_lock);
pmc_prev = NULL;
- for (pmc=idev->mc_tomb; pmc; pmc=pmc->next) {
+ for (pmc = idev->mc_tomb; pmc; pmc = pmc->next) {
if (ipv6_addr_equal(&pmc->mca_addr, pmca))
break;
pmc_prev = pmc;
@@ -768,7 +768,7 @@ static void mld_del_delrec(struct inet6_dev *idev, const struct in6_addr *pmca)
spin_unlock_bh(&idev->mc_lock);
if (pmc) {
- for (psf=pmc->mca_tomb; psf; psf=psf_next) {
+ for (psf = pmc->mca_tomb; psf; psf = psf_next) {
psf_next = psf->sf_next;
kfree(psf);
}
@@ -795,14 +795,14 @@ static void mld_clear_delrec(struct inet6_dev *idev)
/* clear dead sources, too */
read_lock_bh(&idev->lock);
- for (pmc=idev->mc_list; pmc; pmc=pmc->next) {
+ for (pmc = idev->mc_list; pmc; pmc = pmc->next) {
struct ip6_sf_list *psf, *psf_next;
spin_lock_bh(&pmc->mca_lock);
psf = pmc->mca_tomb;
pmc->mca_tomb = NULL;
spin_unlock_bh(&pmc->mca_lock);
- for (; psf; psf=psf_next) {
+ for (; psf; psf = psf_next) {
psf_next = psf->sf_next;
kfree(psf);
}
@@ -891,7 +891,7 @@ int __ipv6_dev_mc_dec(struct inet6_dev *idev, const struct in6_addr *addr)
struct ifmcaddr6 *ma, **map;
write_lock_bh(&idev->lock);
- for (map = &idev->mc_list; (ma=*map) != NULL; map = &ma->next) {
+ for (map = &idev->mc_list; (ma = *map) != NULL; map = &ma->next) {
if (ipv6_addr_equal(&ma->mca_addr, addr)) {
if (--ma->mca_users == 0) {
*map = ma->next;
@@ -969,7 +969,7 @@ int ipv6_chk_mcast_addr(struct net_device *dev, const struct in6_addr *group,
idev = __in6_dev_get(dev);
if (idev) {
read_lock_bh(&idev->lock);
- for (mc = idev->mc_list; mc; mc=mc->next) {
+ for (mc = idev->mc_list; mc; mc = mc->next) {
if (ipv6_addr_equal(&mc->mca_addr, group))
break;
}
@@ -978,7 +978,7 @@ int ipv6_chk_mcast_addr(struct net_device *dev, const struct in6_addr *group,
struct ip6_sf_list *psf;
spin_lock_bh(&mc->mca_lock);
- for (psf=mc->mca_sources;psf;psf=psf->sf_next) {
+ for (psf = mc->mca_sources;psf;psf = psf->sf_next) {
if (ipv6_addr_equal(&psf->sf_addr, src_addr))
break;
}
@@ -1053,10 +1053,10 @@ static int mld_xmarksources(struct ifmcaddr6 *pmc, int nsrcs,
int i, scount;
scount = 0;
- for (psf=pmc->mca_sources; psf; psf=psf->sf_next) {
+ for (psf = pmc->mca_sources; psf; psf = psf->sf_next) {
if (scount == nsrcs)
break;
- for (i=0; i<nsrcs; i++) {
+ for (i = 0; i<nsrcs; i++) {
/* skip inactive filters */
if (psf->sf_count[MCAST_INCLUDE] ||
pmc->mca_sfcount[MCAST_EXCLUDE] !=
@@ -1086,10 +1086,10 @@ static int mld_marksources(struct ifmcaddr6 *pmc, int nsrcs,
/* mark INCLUDE-mode sources */
scount = 0;
- for (psf=pmc->mca_sources; psf; psf=psf->sf_next) {
+ for (psf = pmc->mca_sources; psf; psf = psf->sf_next) {
if (scount == nsrcs)
break;
- for (i=0; i<nsrcs; i++) {
+ for (i = 0; i<nsrcs; i++) {
if (ipv6_addr_equal(&srcs[i], &psf->sf_addr)) {
psf->sf_gsresp = 1;
scount++;
@@ -1192,13 +1192,13 @@ int igmp6_event_query(struct sk_buff *skb)
read_lock_bh(&idev->lock);
if (group_type == IPV6_ADDR_ANY) {
- for (ma = idev->mc_list; ma; ma=ma->next) {
+ for (ma = idev->mc_list; ma; ma = ma->next) {
spin_lock_bh(&ma->mca_lock);
igmp6_group_queried(ma, max_delay);
spin_unlock_bh(&ma->mca_lock);
}
} else {
- for (ma = idev->mc_list; ma; ma=ma->next) {
+ for (ma = idev->mc_list; ma; ma = ma->next) {
if (!ipv6_addr_equal(group, &ma->mca_addr))
continue;
spin_lock_bh(&ma->mca_lock);
@@ -1262,7 +1262,7 @@ int igmp6_event_report(struct sk_buff *skb)
*/
read_lock_bh(&idev->lock);
- for (ma = idev->mc_list; ma; ma=ma->next) {
+ for (ma = idev->mc_list; ma; ma = ma->next) {
if (ipv6_addr_equal(&ma->mca_addr, &mld->mld_mca)) {
spin_lock(&ma->mca_lock);
if (del_timer(&ma->mca_timer))
@@ -1326,7 +1326,7 @@ mld_scount(struct ifmcaddr6 *pmc, int type, int gdeleted, int sdeleted)
struct ip6_sf_list *psf;
int scount = 0;
- for (psf=pmc->mca_sources; psf; psf=psf->sf_next) {
+ for (psf = pmc->mca_sources; psf; psf = psf->sf_next) {
if (!is_in(pmc, psf, type, gdeleted, sdeleted))
continue;
scount++;
@@ -1510,7 +1510,7 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ifmcaddr6 *pmc,
}
first = 1;
psf_prev = NULL;
- for (psf=*psf_list; psf; psf=psf_next) {
+ for (psf = *psf_list; psf; psf = psf_next) {
struct in6_addr *psrc;
psf_next = psf->sf_next;
@@ -1589,7 +1589,7 @@ static void mld_send_report(struct inet6_dev *idev, struct ifmcaddr6 *pmc)
if (!pmc) {
read_lock_bh(&idev->lock);
- for (pmc=idev->mc_list; pmc; pmc=pmc->next) {
+ for (pmc = idev->mc_list; pmc; pmc = pmc->next) {
if (pmc->mca_flags & MAF_NOREPORT)
continue;
spin_lock_bh(&pmc->mca_lock);
@@ -1622,7 +1622,7 @@ static void mld_clear_zeros(struct ip6_sf_list **ppsf)
struct ip6_sf_list *psf_prev, *psf_next, *psf;
psf_prev = NULL;
- for (psf=*ppsf; psf; psf = psf_next) {
+ for (psf = *ppsf; psf; psf = psf_next) {
psf_next = psf->sf_next;
if (psf->sf_crcount == 0) {
if (psf_prev)
@@ -1646,7 +1646,7 @@ static void mld_send_cr(struct inet6_dev *idev)
/* deleted MCA's */
pmc_prev = NULL;
- for (pmc=idev->mc_tomb; pmc; pmc=pmc_next) {
+ for (pmc = idev->mc_tomb; pmc; pmc = pmc_next) {
pmc_next = pmc->next;
if (pmc->mca_sfmode == MCAST_INCLUDE) {
type = MLD2_BLOCK_OLD_SOURCES;
@@ -1679,7 +1679,7 @@ static void mld_send_cr(struct inet6_dev *idev)
spin_unlock(&idev->mc_lock);
/* change recs */
- for (pmc=idev->mc_list; pmc; pmc=pmc->next) {
+ for (pmc = idev->mc_list; pmc; pmc = pmc->next) {
spin_lock_bh(&pmc->mca_lock);
if (pmc->mca_sfcount[MCAST_EXCLUDE]) {
type = MLD2_BLOCK_OLD_SOURCES;
@@ -1812,7 +1812,7 @@ static int ip6_mc_del1_src(struct ifmcaddr6 *pmc, int sfmode,
int rv = 0;
psf_prev = NULL;
- for (psf=pmc->mca_sources; psf; psf=psf->sf_next) {
+ for (psf = pmc->mca_sources; psf; psf = psf->sf_next) {
if (ipv6_addr_equal(&psf->sf_addr, psfsrc))
break;
psf_prev = psf;
@@ -1853,7 +1853,7 @@ static int ip6_mc_del_src(struct inet6_dev *idev, const struct in6_addr *pmca,
if (!idev)
return -ENODEV;
read_lock_bh(&idev->lock);
- for (pmc=idev->mc_list; pmc; pmc=pmc->next) {
+ for (pmc = idev->mc_list; pmc; pmc = pmc->next) {
if (ipv6_addr_equal(pmca, &pmc->mca_addr))
break;
}
@@ -1873,7 +1873,7 @@ static int ip6_mc_del_src(struct inet6_dev *idev, const struct in6_addr *pmca,
pmc->mca_sfcount[sfmode]--;
}
err = 0;
- for (i=0; i<sfcount; i++) {
+ for (i = 0; i<sfcount; i++) {
int rv = ip6_mc_del1_src(pmc, sfmode, &psfsrc[i]);
changerec |= rv > 0;
@@ -1889,7 +1889,7 @@ static int ip6_mc_del_src(struct inet6_dev *idev, const struct in6_addr *pmca,
pmc->mca_sfmode = MCAST_INCLUDE;
pmc->mca_crcount = idev->mc_qrv;
idev->mc_ifc_count = pmc->mca_crcount;
- for (psf=pmc->mca_sources; psf; psf = psf->sf_next)
+ for (psf = pmc->mca_sources; psf; psf = psf->sf_next)
psf->sf_crcount = 0;
mld_ifc_event(pmc->idev);
} else if (sf_setstate(pmc) || changerec)
@@ -1908,7 +1908,7 @@ static int ip6_mc_add1_src(struct ifmcaddr6 *pmc, int sfmode,
struct ip6_sf_list *psf, *psf_prev;
psf_prev = NULL;
- for (psf=pmc->mca_sources; psf; psf=psf->sf_next) {
+ for (psf = pmc->mca_sources; psf; psf = psf->sf_next) {
if (ipv6_addr_equal(&psf->sf_addr, psfsrc))
break;
psf_prev = psf;
@@ -1933,7 +1933,7 @@ static void sf_markstate(struct ifmcaddr6 *pmc)
struct ip6_sf_list *psf;
int mca_xcount = pmc->mca_sfcount[MCAST_EXCLUDE];
- for (psf=pmc->mca_sources; psf; psf=psf->sf_next)
+ for (psf = pmc->mca_sources; psf; psf = psf->sf_next)
if (pmc->mca_sfcount[MCAST_EXCLUDE]) {
psf->sf_oldin = mca_xcount ==
psf->sf_count[MCAST_EXCLUDE] &&
@@ -1950,7 +1950,7 @@ static int sf_setstate(struct ifmcaddr6 *pmc)
int new_in, rv;
rv = 0;
- for (psf=pmc->mca_sources; psf; psf=psf->sf_next) {
+ for (psf = pmc->mca_sources; psf; psf = psf->sf_next) {
if (pmc->mca_sfcount[MCAST_EXCLUDE]) {
new_in = mca_xcount == psf->sf_count[MCAST_EXCLUDE] &&
!psf->sf_count[MCAST_INCLUDE];
@@ -1960,8 +1960,8 @@ static int sf_setstate(struct ifmcaddr6 *pmc)
if (!psf->sf_oldin) {
struct ip6_sf_list *prev = NULL;
- for (dpsf=pmc->mca_tomb; dpsf;
- dpsf=dpsf->sf_next) {
+ for (dpsf = pmc->mca_tomb; dpsf;
+ dpsf = dpsf->sf_next) {
if (ipv6_addr_equal(&dpsf->sf_addr,
&psf->sf_addr))
break;
@@ -1983,7 +1983,7 @@ static int sf_setstate(struct ifmcaddr6 *pmc)
* add or update "delete" records if an active filter
* is now inactive
*/
- for (dpsf=pmc->mca_tomb; dpsf; dpsf=dpsf->sf_next)
+ for (dpsf = pmc->mca_tomb; dpsf; dpsf = dpsf->sf_next)
if (ipv6_addr_equal(&dpsf->sf_addr,
&psf->sf_addr))
break;
@@ -2017,7 +2017,7 @@ static int ip6_mc_add_src(struct inet6_dev *idev, const struct in6_addr *pmca,
if (!idev)
return -ENODEV;
read_lock_bh(&idev->lock);
- for (pmc=idev->mc_list; pmc; pmc=pmc->next) {
+ for (pmc = idev->mc_list; pmc; pmc = pmc->next) {
if (ipv6_addr_equal(pmca, &pmc->mca_addr))
break;
}
@@ -2033,7 +2033,7 @@ static int ip6_mc_add_src(struct inet6_dev *idev, const struct in6_addr *pmca,
if (!delta)
pmc->mca_sfcount[sfmode]++;
err = 0;
- for (i=0; i<sfcount; i++) {
+ for (i = 0; i<sfcount; i++) {
err = ip6_mc_add1_src(pmc, sfmode, &psfsrc[i]);
if (err)
break;
@@ -2043,7 +2043,7 @@ static int ip6_mc_add_src(struct inet6_dev *idev, const struct in6_addr *pmca,
if (!delta)
pmc->mca_sfcount[sfmode]--;
- for (j=0; j<i; j++)
+ for (j = 0; j<i; j++)
ip6_mc_del1_src(pmc, sfmode, &psfsrc[j]);
} else if (isexclude != (pmc->mca_sfcount[MCAST_EXCLUDE] != 0)) {
struct ip6_sf_list *psf;
@@ -2057,7 +2057,7 @@ static int ip6_mc_add_src(struct inet6_dev *idev, const struct in6_addr *pmca,
pmc->mca_crcount = idev->mc_qrv;
idev->mc_ifc_count = pmc->mca_crcount;
- for (psf=pmc->mca_sources; psf; psf = psf->sf_next)
+ for (psf = pmc->mca_sources; psf; psf = psf->sf_next)
psf->sf_crcount = 0;
mld_ifc_event(idev);
} else if (sf_setstate(pmc))
@@ -2071,12 +2071,12 @@ static void ip6_mc_clear_src(struct ifmcaddr6 *pmc)
{
struct ip6_sf_list *psf, *nextpsf;
- for (psf=pmc->mca_tomb; psf; psf=nextpsf) {
+ for (psf = pmc->mca_tomb; psf; psf = nextpsf) {
nextpsf = psf->sf_next;
kfree(psf);
}
pmc->mca_tomb = NULL;
- for (psf=pmc->mca_sources; psf; psf=nextpsf) {
+ for (psf = pmc->mca_sources; psf; psf = nextpsf) {
nextpsf = psf->sf_next;
kfree(psf);
}
@@ -2223,7 +2223,7 @@ void ipv6_mc_down(struct inet6_dev *idev)
if (del_timer(&idev->mc_gq_timer))
__in6_dev_put(idev);
- for (i = idev->mc_list; i; i=i->next)
+ for (i = idev->mc_list; i; i = i->next)
igmp6_group_dropped(i);
read_unlock_bh(&idev->lock);
@@ -2240,7 +2240,7 @@ void ipv6_mc_up(struct inet6_dev *idev)
/* Install multicast list, except for all-nodes (already installed) */
read_lock_bh(&idev->lock);
- for (i = idev->mc_list; i; i=i->next)
+ for (i = idev->mc_list; i; i = i->next)
igmp6_group_added(i);
read_unlock_bh(&idev->lock);
}
--
1.7.10
^ permalink raw reply related
* [PATCH 3/4]net:ipv6:fixed spacing issues related to < operator
From: Jeffrin Jose @ 2012-05-21 19:04 UTC (permalink / raw)
To: davem, edumazet, loke.chetan, herbert; +Cc: netdev, linux-kernel, ahiliation
Fixed spacing issues relating to < operator
found in net/ipv6/mcast.c by checkpatch.pl tool
Signed-off-by: Jeffrin Jose <ahiliation@yahoo.co.in>
---
net/ipv6/mcast.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 66235a0..541893d 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -369,7 +369,7 @@ int ip6_mc_source(int add, int omode, struct sock *sk,
if (!psl)
goto done; /* err = -EADDRNOTAVAIL */
rv = !0;
- for (i = 0; i<psl->sl_count; i++) {
+ for (i = 0; i < psl->sl_count; i++) {
rv = memcmp(&psl->sl_addr[i], source,
sizeof(struct in6_addr));
if (rv == 0)
@@ -387,7 +387,7 @@ int ip6_mc_source(int add, int omode, struct sock *sk,
/* update the interface filter */
ip6_mc_del_src(idev, group, omode, 1, source, 1);
- for (j = i+1; j<psl->sl_count; j++)
+ for (j = i+1; j < psl->sl_count; j++)
psl->sl_addr[j-1] = psl->sl_addr[j];
psl->sl_count--;
err = 0;
@@ -413,14 +413,14 @@ int ip6_mc_source(int add, int omode, struct sock *sk,
newpsl->sl_max = count;
newpsl->sl_count = count - IP6_SFBLOCK;
if (psl) {
- for (i = 0; i<psl->sl_count; i++)
+ for (i = 0; i < psl->sl_count; i++)
newpsl->sl_addr[i] = psl->sl_addr[i];
sock_kfree_s(sk, psl, IP6_SFLSIZE(psl->sl_max));
}
pmc->sflist = psl = newpsl;
}
rv = 1; /* > 0 for insert logic below if sl_count is 0 */
- for (i = 0; i<psl->sl_count; i++) {
+ for (i = 0; i < psl->sl_count; i++) {
rv = memcmp(&psl->sl_addr[i], source, sizeof(struct in6_addr));
if (rv == 0)
break;
@@ -496,7 +496,7 @@ int ip6_mc_msfilter(struct sock *sk, struct group_filter *gsf)
goto done;
}
newpsl->sl_max = newpsl->sl_count = gsf->gf_numsrc;
- for (i = 0; i<newpsl->sl_count; ++i) {
+ for (i = 0; i < newpsl->sl_count; ++i) {
struct sockaddr_in6 *psin6;
psin6 = (struct sockaddr_in6 *)&gsf->gf_slist[i];
@@ -588,7 +588,7 @@ int ip6_mc_msfget(struct sock *sk, struct group_filter *gsf,
* on ipv6_sk_mc_lock and a write lock on pmc->sflock. We
* have the socket lock, so reading here is safe.
*/
- for (i = 0; i<copycount; i++) {
+ for (i = 0; i < copycount; i++) {
struct sockaddr_in6 *psin6;
struct sockaddr_storage ss;
@@ -630,7 +630,7 @@ int inet6_mc_check(struct sock *sk, const struct in6_addr *mc_addr,
} else {
int i;
- for (i = 0; i<psl->sl_count; i++) {
+ for (i = 0; i < psl->sl_count; i++) {
if (ipv6_addr_equal(&psl->sl_addr[i], src_addr))
break;
}
@@ -1056,7 +1056,7 @@ static int mld_xmarksources(struct ifmcaddr6 *pmc, int nsrcs,
for (psf = pmc->mca_sources; psf; psf = psf->sf_next) {
if (scount == nsrcs)
break;
- for (i = 0; i<nsrcs; i++) {
+ for (i = 0; i < nsrcs; i++) {
/* skip inactive filters */
if (psf->sf_count[MCAST_INCLUDE] ||
pmc->mca_sfcount[MCAST_EXCLUDE] !=
@@ -1089,7 +1089,7 @@ static int mld_marksources(struct ifmcaddr6 *pmc, int nsrcs,
for (psf = pmc->mca_sources; psf; psf = psf->sf_next) {
if (scount == nsrcs)
break;
- for (i = 0; i<nsrcs; i++) {
+ for (i = 0; i < nsrcs; i++) {
if (ipv6_addr_equal(&srcs[i], &psf->sf_addr)) {
psf->sf_gsresp = 1;
scount++;
@@ -1873,7 +1873,7 @@ static int ip6_mc_del_src(struct inet6_dev *idev, const struct in6_addr *pmca,
pmc->mca_sfcount[sfmode]--;
}
err = 0;
- for (i = 0; i<sfcount; i++) {
+ for (i = 0; i < sfcount; i++) {
int rv = ip6_mc_del1_src(pmc, sfmode, &psfsrc[i]);
changerec |= rv > 0;
@@ -2033,7 +2033,7 @@ static int ip6_mc_add_src(struct inet6_dev *idev, const struct in6_addr *pmca,
if (!delta)
pmc->mca_sfcount[sfmode]++;
err = 0;
- for (i = 0; i<sfcount; i++) {
+ for (i = 0; i < sfcount; i++) {
err = ip6_mc_add1_src(pmc, sfmode, &psfsrc[i]);
if (err)
break;
@@ -2043,7 +2043,7 @@ static int ip6_mc_add_src(struct inet6_dev *idev, const struct in6_addr *pmca,
if (!delta)
pmc->mca_sfcount[sfmode]--;
- for (j = 0; j<i; j++)
+ for (j = 0; j < i; j++)
ip6_mc_del1_src(pmc, sfmode, &psfsrc[j]);
} else if (isexclude != (pmc->mca_sfcount[MCAST_EXCLUDE] != 0)) {
struct ip6_sf_list *psf;
--
1.7.10
^ permalink raw reply related
* [PATCH 4/4]net:ipv6:fixed space issues relating to >= and !=
From: Jeffrin Jose @ 2012-05-21 19:05 UTC (permalink / raw)
To: davem, edumazet, loke.chetan, herbert; +Cc: netdev, linux-kernel, ahiliation
Fixed space issues related to >= and != operators
in net/ipv6/mcast.c found by cheackpatch.pl tool
Signed-off-by: Jeffrin Jose <ahiliation@yahoo.co.in>
---
net/ipv6/mcast.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 541893d..9de31b3 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -427,7 +427,7 @@ int ip6_mc_source(int add, int omode, struct sock *sk,
}
if (rv == 0) /* address already there is an error */
goto done;
- for (j = psl->sl_count-1; j>=i; j--)
+ for (j = psl->sl_count-1; j >= i; j--)
psl->sl_addr[j+1] = psl->sl_addr[j];
psl->sl_addr[i] = *source;
psl->sl_count++;
@@ -987,7 +987,7 @@ int ipv6_chk_mcast_addr(struct net_device *dev, const struct in6_addr *group,
psf->sf_count[MCAST_EXCLUDE] !=
mc->mca_sfcount[MCAST_EXCLUDE];
else
- rv = mc->mca_sfcount[MCAST_EXCLUDE] !=0;
+ rv = mc->mca_sfcount[MCAST_EXCLUDE] != 0;
spin_unlock_bh(&mc->mca_lock);
} else
rv = 1; /* don't filter unspecified source */
--
1.7.10
^ permalink raw reply related
* [PATCH 1/4]net:ipv6:fixed a space issue relating to != operator
From: Jeffrin Jose @ 2012-05-21 19:03 UTC (permalink / raw)
To: davem, edumazet, loke.chetan, herbert; +Cc: netdev, linux-kernel, ahiliation
Fixed a space issue relating to != operator
found by checkpatch.pl tool in net/ipv6/mcast.c
Signed-off-by: Jeffrin Jose <ahiliation@yahoo.co.in>
---
net/ipv6/mcast.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 7dfb89f..8f7eee9 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -214,7 +214,7 @@ int ipv6_sock_mc_drop(struct sock *sk, int ifindex, const struct in6_addr *addr)
spin_lock(&ipv6_sk_mc_lock);
for (lnk = &np->ipv6_mc_list;
(mc_lst = rcu_dereference_protected(*lnk,
- lockdep_is_held(&ipv6_sk_mc_lock))) !=NULL ;
+ lockdep_is_held(&ipv6_sk_mc_lock))) != NULL ;
lnk = &mc_lst->next) {
if ((ifindex == 0 || mc_lst->ifindex == ifindex) &&
ipv6_addr_equal(&mc_lst->addr, addr)) {
--
1.7.10
^ permalink raw reply related
* Re: [PATCH] xen/netback: calculate correctly the SKB slots.
From: Ben Hutchings @ 2012-05-21 19:14 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk
Cc: xen-devel, ian.campbell, netdev, davem, linux-kernel,
Adnan Misherfi
In-Reply-To: <1337621793-12486-1-git-send-email-konrad.wilk@oracle.com>
On Mon, 2012-05-21 at 13:36 -0400, Konrad Rzeszutek Wilk wrote:
> From: Adnan Misherfi <adnan.misherfi@oracle.com>
>
> A programming error cause the calculation of receive SKB slots to be
> wrong, which caused the RX ring to be erroneously declared full,
> and the receive queue to be stopped. The problem shows up when two
> guest running on the same server tries to communicates using large
> MTUs. Each guest is connected to a bridge with VLAN over bond
> interface, so traffic from one guest leaves the server on one bridge
> and comes back to the second guest on the second bridge. This can be
> reproduces using ping, and one guest as follow:
>
> - Create active-back bond (bond0)
> - Set up VLAN 5 on bond0 (bond0.5)
> - Create a bridge (br1)
> - Add bond0.5 to a bridge (br1)
> - Start a guest and connect it to br1
> - Set MTU of 9000 across the link
>
> Ping the guest from an external host using packet sizes of 3991, and
> 4054; ping -s 3991 -c 128 "Guest-IP-Address"
>
> At the beginning ping works fine, but after a while ping packets do
> not reach the guest because the RX ring becomes full, and the queue
> get stopped. Once the problem accrued, the only way to get out of it
> is to reboot the guest, or use xm network-detach/network-attach.
>
> ping works for packets sizes 3990,3992, and many other sizes including
> 4000,5000,9000, and 1500 ..etc. MTU size of 3991,4054 are the sizes
> that quickly reproduce this problem.
>
> Signed-off-by: Adnan Misherfi <adnan.misherfi@oracle.com>
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> ---
> drivers/net/xen-netback/netback.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
> index 957cf9d..e382e5b 100644
> --- a/drivers/net/xen-netback/netback.c
> +++ b/drivers/net/xen-netback/netback.c
> @@ -212,7 +212,7 @@ unsigned int xenvif_count_skb_slots(struct xenvif *vif, struct sk_buff *skb)
The function name is xen_netbk_count_skb_slots() in net-next. This
appears to depend on the series in
<http://lists.xen.org/archives/html/xen-devel/2012-01/msg00982.html>.
> int i, copy_off;
>
> count = DIV_ROUND_UP(
> - offset_in_page(skb->data)+skb_headlen(skb), PAGE_SIZE);
> + offset_in_page(skb->data + skb_headlen(skb)), PAGE_SIZE);
The new version would be equivalent to:
count = offset_in_page(skb->data + skb_headlen(skb)) != 0;
which is not right, as netbk_gop_skb() will use one slot per page.
The real problem is likely that you're not using the same condition to
stop and wake the queue. Though it appears you're also missing an
smp_mb() at the top of xenvif_notify_tx_completion().
Ben.
> copy_off = skb_headlen(skb) % PAGE_SIZE;
>
--
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] net: drop NET dependency from HAVE_BPF_JIT
From: David Miller @ 2012-05-21 19:48 UTC (permalink / raw)
To: torvalds; +Cc: sam, netdev, akpm, sparclinux, linux-kernel
In-Reply-To: <CA+55aFwo6XusR8pNY+dp_5uFNqCxZjeWWL6h+V=PFqT884Qc_A@mail.gmail.com>
From: Linus Torvalds <torvalds@linux-foundation.org>
Date: Mon, 21 May 2012 11:54:00 -0700
> On Mon, May 21, 2012 at 11:52 AM, Sam Ravnborg <sam@ravnborg.org> wrote:
>>
>> Fix up all users to drop the dependency on NET now that
>> it is not required to supress warnings for non-NET builds.
>
> Do you want me to take this directly, or will it go through the net
> tree? I can live with it either way.
Linus, please take it directly, Sam's change looks great.
^ permalink raw reply
* [README] net-next has been merged
From: David Miller @ 2012-05-21 21:09 UTC (permalink / raw)
To: netdev; +Cc: linux-wireless, netfilter-devel
Linus has pulled in all of the net-next changes, and I have
subsequently fast-forwarded both 'net' and 'net-next' to
Linus's tree.
All work at this time should be bug fixes and should be arranged
against 'net'. 'net-next' will be frozen and untouched until
some time after the merge window closes, and no development should
occur against it.
I am rejecting all patches in patchwork which implement new features,
perform cleanups, or otherwise are inappropriate at this time. You
must resubmit them when the net-next tree opens back up.
There is one exception waiting in the wings, there is one netfilter
pull remaining from Pedro for the merge window and I told him that
this is OK.
^ permalink raw reply
* Re: [README] net-next has been merged
From: Joe Perches @ 2012-05-21 21:24 UTC (permalink / raw)
To: David Miller
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netfilter-devel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20120521.170939.1673415470771353481.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
On Mon, 2012-05-21 at 17:09 -0400, David Miller wrote:
> Linus has pulled in all of the net-next changes, and I have
> subsequently fast-forwarded both 'net' and 'net-next' to
> Linus's tree.
I think you should consider pulling the tags too.
The last tag in -next seems to be v3.1-rc9.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [README] net-next has been merged
From: David Miller @ 2012-05-21 21:32 UTC (permalink / raw)
To: joe; +Cc: netdev, linux-wireless, netfilter-devel
In-Reply-To: <1337635442.13812.44.camel@joe2Laptop>
From: Joe Perches <joe@perches.com>
Date: Mon, 21 May 2012 14:24:02 -0700
> On Mon, 2012-05-21 at 17:09 -0400, David Miller wrote:
>> Linus has pulled in all of the net-next changes, and I have
>> subsequently fast-forwarded both 'net' and 'net-next' to
>> Linus's tree.
>
> I think you should consider pulling the tags too.
> The last tag in -next seems to be v3.1-rc9.
I've now done this, thanks Joe.
^ permalink raw reply
* [ANNOUNCE] iproute2 3.4.0
From: Stephen Hemminger @ 2012-05-21 21:37 UTC (permalink / raw)
To: netdev, linux-kernel
To go with kernel release of 3.4 here is the update to
iproute2. There wasn't a lot new features in this release, mostly
manual pages and cleanups.
Source:
http://www.kernel.org/pub/linux/utils/net/iproute2/iproute2-3.4.0.tar.gz
Repository:
git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git
Changes:
Andreas Henriksson (1):
iproute2: trivial fix of ip link syntax in manpage
Chris Elston (1):
iproute2: allow IPv6 addresses for l2tp local and remote parameters
Christoph J. Thompson (4):
iproute2 - Don't hardcode the path to config files
iproute2 - Split up cflags
iproute2 - Split up manual page installation
iproute2 - Fix up and simplify variables pointing to install directories
Eric Dumazet (1):
Fix ss if INET_DIAG not enabled in kernel
Florian Westphal (1):
tc: man: choke counts packets, not bytes
James Chapman (1):
iproute2: add ip-l2tp man page
Jorge Boncompte [DTI2] (1):
iproute: show metrics as an unsigned value
João Valverde (1):
ipl2tp: allow setting session interface name
Rose, Gregory V (1):
iproute2: Add netlink attribute to filter dump requests
Shan Wei (1):
ss: use new INET_DIAG_SKMEMINFO option to get more memory information for tcp socket
Stephen Hemminger (6):
Add ability to set link state with ip
Make link mode case independent
Convert to use rta_getattr_ functions
Merge in 3.3-rc2 kernel headers
Revert "iproute2: allow IPv6 addresses for l2tp local and remote parameters"
v3.4.0
Vijay Subramanian (1):
Update man8 Makefile
^ permalink raw reply
* Re: [ANNOUNCE] iproute2 3.4.0
From: John Fastabend @ 2012-05-21 21:48 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev
In-Reply-To: <20120521143740.2f6c0ecd@nehalam.linuxnetplumber.net>
On 5/21/2012 2:37 PM, Stephen Hemminger wrote:
> To go with kernel release of 3.4 here is the update to
> iproute2. There wasn't a lot new features in this release, mostly
> manual pages and cleanups.
>
> Source:
> http://www.kernel.org/pub/linux/utils/net/iproute2/iproute2-3.4.0.tar.gz
>
> Repository:
> git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git
>
> Changes:
>
Hi Stephen,
Any plans to push the new 'bridge' tool into the next release? We
have been using it internally and it works great. I also wanted
to add some code to it for managing the forwarding tables of the
embedded switching elements and have been experimenting with some
code to enable VEB/VEPA modes.
If you want me to help with testing or otherwise let me know.
Thanks,
John
^ permalink raw reply
* Re: [ANNOUNCE] iproute2 3.4.0
From: Stephen Hemminger @ 2012-05-21 22:01 UTC (permalink / raw)
To: John Fastabend; +Cc: netdev
In-Reply-To: <4FBAB82A.2070907@intel.com>
On Mon, 21 May 2012 14:48:26 -0700
John Fastabend <john.r.fastabend@intel.com> wrote:
> On 5/21/2012 2:37 PM, Stephen Hemminger wrote:
> > To go with kernel release of 3.4 here is the update to
> > iproute2. There wasn't a lot new features in this release, mostly
> > manual pages and cleanups.
> >
> > Source:
> > http://www.kernel.org/pub/linux/utils/net/iproute2/iproute2-3.4.0.tar.gz
> >
> > Repository:
> > git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git
> >
> > Changes:
> >
>
> Hi Stephen,
>
> Any plans to push the new 'bridge' tool into the next release? We
> have been using it internally and it works great. I also wanted
> to add some code to it for managing the forwarding tables of the
> embedded switching elements and have been experimenting with some
> code to enable VEB/VEPA modes.
>
> If you want me to help with testing or otherwise let me know.
>
It is on my TODO list, but haven't got to it yet. Will put in for 3.5.
The name will be 'bridge' not 'br' to avoid conflict wit X10
^ permalink raw reply
* Re: [ANNOUNCE] iproute2 3.4.0
From: John Fastabend @ 2012-05-21 22:02 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev
In-Reply-To: <20120521150106.6ac4ca0d@nehalam.linuxnetplumber.net>
On 5/21/2012 3:01 PM, Stephen Hemminger wrote:
> On Mon, 21 May 2012 14:48:26 -0700
> John Fastabend <john.r.fastabend@intel.com> wrote:
>
>> On 5/21/2012 2:37 PM, Stephen Hemminger wrote:
>>> To go with kernel release of 3.4 here is the update to
>>> iproute2. There wasn't a lot new features in this release, mostly
>>> manual pages and cleanups.
>>>
>>> Source:
>>> http://www.kernel.org/pub/linux/utils/net/iproute2/iproute2-3.4.0.tar.gz
>>>
>>> Repository:
>>> git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git
>>>
>>> Changes:
>>>
>>
>> Hi Stephen,
>>
>> Any plans to push the new 'bridge' tool into the next release? We
>> have been using it internally and it works great. I also wanted
>> to add some code to it for managing the forwarding tables of the
>> embedded switching elements and have been experimenting with some
>> code to enable VEB/VEPA modes.
>>
>> If you want me to help with testing or otherwise let me know.
>>
>
> It is on my TODO list, but haven't got to it yet. Will put in for 3.5.
> The name will be 'bridge' not 'br' to avoid conflict wit X10
Sounds good thanks. Figured it was on your TODO list somewhere
thought I would check though.
^ permalink raw reply
* Re: [PATCH] iproute2: man page and /bin/ip disagree on del vs delete
From: Stephen Hemminger @ 2012-05-21 22:17 UTC (permalink / raw)
To: Andreas Henriksson; +Cc: Robert Henney, 673355, netdev
In-Reply-To: <20120519140821.GA5400@amd64.fatal.se>
On Sat, 19 May 2012 16:08:21 +0200
Andreas Henriksson <andreas@fatal.se> wrote:
> On Thu, May 17, 2012 at 09:29:28PM -0400, Robert Henney wrote:
> > the 'ip' man page does not mention the command "del" at all but does
> > claim, "As a rule, it is possible to add, delete and show (or list ) objects".
> > however, 'ip' does not always recognize "delete" as a commend.
> >
> > robh@debian:~$ ip tunnel delete
> > Command "delete" is unknown, try "ip tunnel help".
>
> Lets use "delete" in all calls to matches() for consistency. This will
> make both "del" and "delete" work everywhere.
>
> Signed-off-by: Andreas Henriksson <andreas@fatal.se>
>
> diff --git a/ip/ip6tunnel.c b/ip/ip6tunnel.c
> index d5bee36..c9720eb 100644
> --- a/ip/ip6tunnel.c
> +++ b/ip/ip6tunnel.c
> @@ -408,7 +408,7 @@ int do_ip6tunnel(int argc, char **argv)
> return do_add(SIOCADDTUNNEL, argc - 1, argv + 1);
> if (matches(*argv, "change") == 0)
> return do_add(SIOCCHGTUNNEL, argc - 1, argv + 1);
> - if (matches(*argv, "del") == 0)
> + if (matches(*argv, "delete") == 0)
> return do_del(argc - 1, argv + 1);
> if (matches(*argv, "show") == 0 ||
> matches(*argv, "lst") == 0 ||
> diff --git a/ip/ipl2tp.c b/ip/ipl2tp.c
> index c5683f5..3a5f94b 100644
> --- a/ip/ipl2tp.c
> +++ b/ip/ipl2tp.c
> @@ -795,7 +795,7 @@ int do_ipl2tp(int argc, char **argv)
>
> if (matches(*argv, "add") == 0)
> return do_add(argc-1, argv+1);
> - if (matches(*argv, "del") == 0)
> + if (matches(*argv, "delete") == 0)
> return do_del(argc-1, argv+1);
> if (matches(*argv, "show") == 0 ||
> matches(*argv, "lst") == 0 ||
> diff --git a/ip/iptunnel.c b/ip/iptunnel.c
> index 3d41a27..38ccd87 100644
> --- a/ip/iptunnel.c
> +++ b/ip/iptunnel.c
> @@ -620,7 +620,7 @@ int do_iptunnel(int argc, char **argv)
> return do_add(SIOCADDTUNNEL, argc-1, argv+1);
> if (matches(*argv, "change") == 0)
> return do_add(SIOCCHGTUNNEL, argc-1, argv+1);
> - if (matches(*argv, "del") == 0)
> + if (matches(*argv, "delete") == 0)
> return do_del(argc-1, argv+1);
> if (matches(*argv, "show") == 0 ||
> matches(*argv, "lst") == 0 ||
> diff --git a/ip/iptuntap.c b/ip/iptuntap.c
> index 29f2777..20914e1 100644
> --- a/ip/iptuntap.c
> +++ b/ip/iptuntap.c
> @@ -307,7 +307,7 @@ int do_iptuntap(int argc, char **argv)
> if (argc > 0) {
> if (matches(*argv, "add") == 0)
> return do_add(argc-1, argv+1);
> - if (matches(*argv, "del") == 0)
> + if (matches(*argv, "delete") == 0)
> return do_del(argc-1, argv+1);
> if (matches(*argv, "show") == 0 ||
> matches(*argv, "lst") == 0 ||
Applied (for 3.5)
^ permalink raw reply
* [PATCH] phy/micrel: Fix ID of KSZ9021
From: Nobuhiro Iwamatsu @ 2012-05-22 0:20 UTC (permalink / raw)
To: netdev; +Cc: david.choi, Nobuhiro Iwamatsu
Right ID of KSZ9021 is 0x00221610.
Because lower 4bit is a revision number, it varies according to a chip.
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Cc: David J. Choi <david.choi@micrel.com>
---
include/linux/micrel_phy.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/micrel_phy.h b/include/linux/micrel_phy.h
index dd8da34..61f0905 100644
--- a/include/linux/micrel_phy.h
+++ b/include/linux/micrel_phy.h
@@ -3,7 +3,7 @@
#define MICREL_PHY_ID_MASK 0x00fffff0
-#define PHY_ID_KSZ9021 0x00221611
+#define PHY_ID_KSZ9021 0x00221610
#define PHY_ID_KS8737 0x00221720
#define PHY_ID_KS8041 0x00221510
#define PHY_ID_KS8051 0x00221550
--
1.7.10
^ permalink raw reply related
* [PATCH] net: Surpress kmemleak messages on sysctl paths
From: Steven Rostedt @ 2012-05-22 0:43 UTC (permalink / raw)
To: David Miller, LKML; +Cc: netdev, viro, ebiederm, tixxdz
The network code allocates ctl_table_headers that are used for the life
of the kernel. These headers are registered and never unregistered. The
head pointer is allocated and not referenced, as it never needs to be
unregistered, and the kmemleak detector triggers these as false
positives:
unreferenced object 0xffff88007843fec0 (size 128):
comm "swapper/0", pid 1, jiffies 4294669964 (age 12611.525s)
hex dump (first 32 bytes):
00 bb 59 82 ff ff ff ff 00 00 00 00 01 00 00 00 ..Y.............
01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<ffffffff8146b590>] kmemleak_alloc+0x73/0x98
[<ffffffff8110a935>] kmemleak_alloc_recursive.constprop.42+0x16/0x18
[<ffffffff8110b852>] __kmalloc+0x107/0x153
[<ffffffff8116fa72>] kzalloc.constprop.8+0xe/0x10
[<ffffffff8116fe2e>] __register_sysctl_table+0x46/0x39c
[<ffffffff811703a7>] __register_sysctl_paths+0xbf/0x160
[<ffffffff81170463>] register_sysctl_paths+0x1b/0x1d
[<ffffffff81b1c769>] sysctl_core_init+0x17/0x38
[<ffffffff81000229>] do_one_initcall+0x7f/0x13a
[<ffffffff81ae5d00>] kernel_init+0x148/0x1cc
[<ffffffff81493174>] kernel_thread_helper+0x4/0x10
[<ffffffffffffffff>] 0xffffffffffffffff
unreferenced object 0xffff8800784330c0 (size 128):
comm "swapper/0", pid 1, jiffies 4294669968 (age 12611.521s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<ffffffff8146b590>] kmemleak_alloc+0x73/0x98
[<ffffffff8110a935>] kmemleak_alloc_recursive.constprop.42+0x16/0x18
[<ffffffff8110b852>] __kmalloc+0x107/0x153
[<ffffffff8116fa72>] kzalloc.constprop.8+0xe/0x10
[<ffffffff811703c9>] __register_sysctl_paths+0xe1/0x160
[<ffffffff81170463>] register_sysctl_paths+0x1b/0x1d
[<ffffffff81b1d897>] ip_static_sysctl_init+0x17/0x19
[<ffffffff81b1e1f4>] inet_init+0x9e/0x29c
[<ffffffff81000229>] do_one_initcall+0x7f/0x13a
[<ffffffff81ae5d00>] kernel_init+0x148/0x1cc
[<ffffffff81493174>] kernel_thread_helper+0x4/0x10
[<ffffffffffffffff>] 0xffffffffffffffff
unreferenced object 0xffff88007843fdc0 (size 128):
comm "swapper/0", pid 1, jiffies 4294669969 (age 12611.520s)
hex dump (first 32 bytes):
d0 d8 59 82 ff ff ff ff 00 00 00 00 01 00 00 00 ..Y.............
01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<ffffffff8146b590>] kmemleak_alloc+0x73/0x98
[<ffffffff8110a935>] kmemleak_alloc_recursive.constprop.42+0x16/0x18
[<ffffffff8110b852>] __kmalloc+0x107/0x153
[<ffffffff8116fa72>] kzalloc.constprop.8+0xe/0x10
[<ffffffff8116fe2e>] __register_sysctl_table+0x46/0x39c
[<ffffffff8117024a>] register_leaf_sysctl_tables+0xc6/0x147
[<ffffffff8117029f>] register_leaf_sysctl_tables+0x11b/0x147
[<ffffffff811703f4>] __register_sysctl_paths+0x10c/0x160
[<ffffffff81170463>] register_sysctl_paths+0x1b/0x1d
[<ffffffff81b1d897>] ip_static_sysctl_init+0x17/0x19
[<ffffffff81b1e1f4>] inet_init+0x9e/0x29c
[<ffffffff81000229>] do_one_initcall+0x7f/0x13a
[<ffffffff81ae5d00>] kernel_init+0x148/0x1cc
[<ffffffff81493174>] kernel_thread_helper+0x4/0x10
[<ffffffffffffffff>] 0xffffffffffffffff
Tell kmemleak to not consider these allocations as leaks.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
index 0c28508..0bc5e0d 100644
--- a/net/core/sysctl_net_core.c
+++ b/net/core/sysctl_net_core.c
@@ -11,6 +11,7 @@
#include <linux/socket.h>
#include <linux/netdevice.h>
#include <linux/ratelimit.h>
+#include <linux/kmemleak.h>
#include <linux/vmalloc.h>
#include <linux/init.h>
#include <linux/slab.h>
@@ -255,9 +256,12 @@ static __net_initdata struct pernet_operations sysctl_core_ops = {
static __init int sysctl_core_init(void)
{
static struct ctl_table empty[1];
+ struct ctl_table_header *hdr;
- register_sysctl_paths(net_core_path, empty);
- register_net_sysctl_rotable(net_core_path, net_core_table);
+ hdr = register_sysctl_paths(net_core_path, empty);
+ kmemleak_not_leak(hdr);
+ hdr = register_net_sysctl_rotable(net_core_path, net_core_table);
+ kmemleak_not_leak(hdr);
return register_pernet_subsys(&sysctl_core_ops);
}
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 167ea10..35aeaa7 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -87,6 +87,7 @@
#include <linux/pkt_sched.h>
#include <linux/mroute.h>
#include <linux/netfilter_ipv4.h>
+#include <linux/kmemleak.h>
#include <linux/random.h>
#include <linux/jhash.h>
#include <linux/rcupdate.h>
@@ -3505,6 +3506,9 @@ int __init ip_rt_init(void)
*/
void __init ip_static_sysctl_init(void)
{
- register_sysctl_paths(ipv4_path, ipv4_skeleton);
+ struct ctl_table_header *hdr;
+
+ hdr = register_sysctl_paths(ipv4_path, ipv4_skeleton);
+ kmemleak_not_leak(hdr);
}
#endif
^ permalink raw reply related
* Re: [PATCH] Bluetooth: Fix null pointer dereference in l2cap_chan_send
From: Minho Ban @ 2012-05-22 1:21 UTC (permalink / raw)
To: Gustavo Padovan, Marcel Holtmann, Johan Hedberg, David S. Miller,
linux-bluetooth-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20120521161707.GD16942@joana>
On 05/22/2012 01:17 AM, Gustavo Padovan wrote:
> Hi Minho,
>
> * Minho Ban <mhban-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org> [2012-05-21 09:58:19 +0900]:
>
>> If l2cap_chan_send is called will null conn it will cause kernel Oops.
>> This patch checks if conn is valid before entering l2cap_chan_send.
>
> chan->conn should be always valid, and if not we have a bug somewhere else in
> the code and not in l2cap_chan_send(). It could be a locking problem maybe.
> Also check if you can reproduce this with latest bluetooth-next.
>
> Gustavo
>
Thanks for comment. I'm using bluetooth-next backporting to kernel 3.0
I wonder how do we guarantee chan->conn is valid if other thread release chan->lock
just after exit l2cap_chan_del.
It seem l2cap_chan_del is well protected with various mutex (eg, sk, conn, chan) but
that may not enough to prevent lock waiters from accessing object.
Regards,
Minho Ban
^ 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