* [PATCH] net: natsemi: remove deprecated IRQF_DISABLED
From: Michael Opdenacker @ 2013-09-13 4:16 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-kernel, Michael Opdenacker
This patch proposes to remove the IRQF_DISABLED flag from
code in drivers/net/ethernet/natsemi/
It's a NOOP since 2.6.35 and it will be removed one day.
Signed-off-by: Michael Opdenacker <michael.opdenacker@free-electrons.com>
---
drivers/net/ethernet/natsemi/jazzsonic.c | 3 +--
drivers/net/ethernet/natsemi/xtsonic.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/natsemi/jazzsonic.c b/drivers/net/ethernet/natsemi/jazzsonic.c
index c20766c..79257f7 100644
--- a/drivers/net/ethernet/natsemi/jazzsonic.c
+++ b/drivers/net/ethernet/natsemi/jazzsonic.c
@@ -83,8 +83,7 @@ static int jazzsonic_open(struct net_device* dev)
{
int retval;
- retval = request_irq(dev->irq, sonic_interrupt, IRQF_DISABLED,
- "sonic", dev);
+ retval = request_irq(dev->irq, sonic_interrupt, 0, "sonic", dev);
if (retval) {
printk(KERN_ERR "%s: unable to get IRQ %d.\n",
dev->name, dev->irq);
diff --git a/drivers/net/ethernet/natsemi/xtsonic.c b/drivers/net/ethernet/natsemi/xtsonic.c
index c2e0256..4da172a 100644
--- a/drivers/net/ethernet/natsemi/xtsonic.c
+++ b/drivers/net/ethernet/natsemi/xtsonic.c
@@ -95,8 +95,7 @@ static int xtsonic_open(struct net_device *dev)
{
int retval;
- retval = request_irq(dev->irq, sonic_interrupt, IRQF_DISABLED,
- "sonic", dev);
+ retval = request_irq(dev->irq, sonic_interrupt, 0, "sonic", dev);
if (retval) {
printk(KERN_ERR "%s: unable to get IRQ %d.\n",
dev->name, dev->irq);
--
1.8.1.2
^ permalink raw reply related
* [PATCH] net: ks8851-ml: remove deprecated IRQF_DISABLED
From: Michael Opdenacker @ 2013-09-13 4:10 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-kernel, Michael Opdenacker
This patch proposes to remove the IRQF_DISABLED flag from
drivers/net/ethernet/micrel/ks8851_mll.c
It's a NOOP since 2.6.35 and it will be removed one day.
Signed-off-by: Michael Opdenacker <michael.opdenacker@free-electrons.com>
---
drivers/net/ethernet/micrel/ks8851_mll.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/micrel/ks8851_mll.c b/drivers/net/ethernet/micrel/ks8851_mll.c
index 0fba153..075f4e2 100644
--- a/drivers/net/ethernet/micrel/ks8851_mll.c
+++ b/drivers/net/ethernet/micrel/ks8851_mll.c
@@ -915,7 +915,7 @@ static int ks_net_open(struct net_device *netdev)
struct ks_net *ks = netdev_priv(netdev);
int err;
-#define KS_INT_FLAGS (IRQF_DISABLED|IRQF_TRIGGER_LOW)
+#define KS_INT_FLAGS IRQF_TRIGGER_LOW
/* lock the card, even if we may not actually do anything
* else at the moment.
*/
--
1.8.1.2
^ permalink raw reply related
* [PATCH] net: pxa168_eth: remove deprecated IRQF_DISABLED
From: Michael Opdenacker @ 2013-09-13 4:04 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-kernel, Michael Opdenacker
Signed-off-by: Michael Opdenacker <michael.opdenacker@free-electrons.com>
---
drivers/net/ethernet/marvell/pxa168_eth.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c
index 4ae0c74..fff6246 100644
--- a/drivers/net/ethernet/marvell/pxa168_eth.c
+++ b/drivers/net/ethernet/marvell/pxa168_eth.c
@@ -1123,8 +1123,7 @@ static int pxa168_eth_open(struct net_device *dev)
struct pxa168_eth_private *pep = netdev_priv(dev);
int err;
- err = request_irq(dev->irq, pxa168_eth_int_handler,
- IRQF_DISABLED, dev->name, dev);
+ err = request_irq(dev->irq, pxa168_eth_int_handler, 0, dev->name, dev);
if (err) {
dev_err(&dev->dev, "can't assign irq\n");
return -EAGAIN;
--
1.8.1.2
^ permalink raw reply related
* [PATCH] net: lantiq_etop: remove deprecated IRQF_DISABLED
From: Michael Opdenacker @ 2013-09-13 3:59 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-kernel, Michael Opdenacker
This patch proposes to remove the IRQF_DISABLED flag from
drivers/net/ethernet/lantiq_etop.c
It's a NOOP since 2.6.35 and it will be removed one day.
Signed-off-by: Michael Opdenacker <michael.opdenacker@free-electrons.com>
---
drivers/net/ethernet/lantiq_etop.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lantiq_etop.c
index bfdb0686..6a6c1f7 100644
--- a/drivers/net/ethernet/lantiq_etop.c
+++ b/drivers/net/ethernet/lantiq_etop.c
@@ -282,8 +282,7 @@ ltq_etop_hw_init(struct net_device *dev)
if (IS_TX(i)) {
ltq_dma_alloc_tx(&ch->dma);
- request_irq(irq, ltq_etop_dma_irq, IRQF_DISABLED,
- "etop_tx", priv);
+ request_irq(irq, ltq_etop_dma_irq, 0, "etop_tx", priv);
} else if (IS_RX(i)) {
ltq_dma_alloc_rx(&ch->dma);
for (ch->dma.desc = 0; ch->dma.desc < LTQ_DESC_NUM;
@@ -291,8 +290,7 @@ ltq_etop_hw_init(struct net_device *dev)
if (ltq_etop_alloc_skb(ch))
return -ENOMEM;
ch->dma.desc = 0;
- request_irq(irq, ltq_etop_dma_irq, IRQF_DISABLED,
- "etop_rx", priv);
+ request_irq(irq, ltq_etop_dma_irq, 0, "etop_rx", priv);
}
ch->dma.irq = irq;
}
--
1.8.1.2
^ permalink raw reply related
* [PATCH] net: hp100: remove deprecated IRQF_DISABLED
From: Michael Opdenacker @ 2013-09-13 3:51 UTC (permalink / raw)
To: perex; +Cc: netdev, linux-kernel, Michael Opdenacker
This patch proposes to remove the IRQF_DISABLED flag from
drivers/net/ethernet/hp/hp100.c
It's a NOOP since 2.6.35 and it will be removed one day.
Signed-off-by: Michael Opdenacker <michael.opdenacker@free-electrons.com>
---
drivers/net/ethernet/hp/hp100.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/hp/hp100.c b/drivers/net/ethernet/hp/hp100.c
index e3c7c69..91227d0 100644
--- a/drivers/net/ethernet/hp/hp100.c
+++ b/drivers/net/ethernet/hp/hp100.c
@@ -1097,7 +1097,7 @@ static int hp100_open(struct net_device *dev)
/* New: if bus is PCI or EISA, interrupts might be shared interrupts */
if (request_irq(dev->irq, hp100_interrupt,
lp->bus == HP100_BUS_PCI || lp->bus ==
- HP100_BUS_EISA ? IRQF_SHARED : IRQF_DISABLED,
+ HP100_BUS_EISA ? IRQF_SHARED : 0,
"hp100", dev)) {
printk("hp100: %s: unable to get IRQ %d\n", dev->name, dev->irq);
return -EAGAIN;
--
1.8.1.2
^ permalink raw reply related
* [PATCH] net: fec: remove deprecated IRQF_DISABLED
From: Michael Opdenacker @ 2013-09-13 3:44 UTC (permalink / raw)
To: davem, fabio.estevam
Cc: frank.li, B38611, jim_baxter, netdev, linux-kernel,
Michael Opdenacker
This patch proposes to remove the IRQF_DISABLED flag from
drivers/net/ethernet/freescale/fec_main.c
It's a NOOP since 2.6.35 and it will be removed one day.
Signed-off-by: Michael Opdenacker <michael.opdenacker@free-electrons.com>
---
drivers/net/ethernet/freescale/fec_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index f9aacf5..b2793b9 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -2199,7 +2199,7 @@ fec_probe(struct platform_device *pdev)
goto failed_irq;
}
ret = devm_request_irq(&pdev->dev, irq, fec_enet_interrupt,
- IRQF_DISABLED, pdev->name, ndev);
+ 0, pdev->name, ndev);
if (ret)
goto failed_irq;
}
--
1.8.1.2
^ permalink raw reply related
* Re: [PATCH for-net] net/mlx4_en: Check device state when setting coalescing
From: David Miller @ 2013-09-13 3:42 UTC (permalink / raw)
To: amirv; +Cc: netdev, ogerlitz, gideonn, eugenia
In-Reply-To: <1378998680-7546-1-git-send-email-amirv@mellanox.com>
From: Amir Vadai <amirv@mellanox.com>
Date: Thu, 12 Sep 2013 18:11:20 +0300
> From: Eugenia Emantayev <eugenia@mellanox.com>
>
> When the device is down, CQs are freed. We must check the device state
> to avoid issuing firmware commands on non existing CQs.
>
> CC: Or Gerlitz <ogerlitz@mellanox.com>
> Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com>
> Signed-off-by: Amir Vadai <amirv@mellanox.com>
Applied, thanks.
^ permalink raw reply
* Re: bridge: Clamp forward_delay when enabling STP
From: David Miller @ 2013-09-13 3:32 UTC (permalink / raw)
To: herbert; +Cc: shemminger, netdev
In-Reply-To: <20130912071204.GA16548@gondor.apana.org.au>
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Thu, 12 Sep 2013 17:12:05 +1000
> At some point limits were added to forward_delay. However, the
> limits are only enforced when STP is enabled. This created a
> scenario where you could have a value outside the allowed range
> while STP is disabled, which then stuck around even after STP
> is enabled.
>
> This patch fixes this by clamping the value when we enable STP.
>
> I had to move the locking around a bit to ensure that there is
> no window where someone could insert a value outside the range
> while we're in the middle of enabling STP.
>
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Applied and queued up for -stable, thanks Herbert.
^ permalink raw reply
* Re: [PATCH 1/1] resubmit bridge: fix message_age_timer calculation
From: David Miller @ 2013-09-13 3:31 UTC (permalink / raw)
To: cphealy; +Cc: stephen, netdev, bridge, buytenh
In-Reply-To: <1378960667-5092-1-git-send-email-cphealy@gmail.com>
From: Chris Healy <cphealy@gmail.com>
Date: Wed, 11 Sep 2013 21:37:47 -0700
> This changes the message_age_timer calculation to use the BPDU's max age as
> opposed to the local bridge's max age. This is in accordance with section
> 8.6.2.3.2 Step 2 of the 802.1D-1998 sprecification.
>
> With the current implementation, when running with very large bridge
> diameters, convergance will not always occur even if a root bridge is
> configured to have a longer max age.
>
> Tested successfully on bridge diameters of ~200.
>
> Signed-off-by: Chris Healy <cphealy@gmail.com>
Applied and queued up for -stable, thanks!
^ permalink raw reply
* Re: [PATCH] net: tulip: remove deprecated IRQF_DISABLED
From: David Miller @ 2013-09-13 3:27 UTC (permalink / raw)
To: michael.opdenacker; +Cc: grundler, netdev, linux-kernel
In-Reply-To: <1378959624-4123-1-git-send-email-michael.opdenacker@free-electrons.com>
From: Michael Opdenacker <michael.opdenacker@free-electrons.com>
Date: Thu, 12 Sep 2013 06:20:24 +0200
> This patch proposes to remove the IRQF_DISABLED flag from
> drivers/net/ethernet/dec/tulip/de4x5.c
>
> It's a NOOP since 2.6.35 and it will be removed one day.
>
> Signed-off-by: Michael Opdenacker <michael.opdenacker@free-electrons.com>
Applied.
^ permalink raw reply
* Re: [PATCH] ethernet: amd: remove deprecated IRQF_DISABLED
From: David Miller @ 2013-09-13 3:27 UTC (permalink / raw)
To: michael.opdenacker
Cc: rusty, benh, silviupopescu1990, geert, netdev, linux-kernel
In-Reply-To: <1378957970-3666-1-git-send-email-michael.opdenacker@free-electrons.com>
From: Michael Opdenacker <michael.opdenacker@free-electrons.com>
Date: Thu, 12 Sep 2013 05:52:50 +0200
> This patch proposes to remove the IRQF_DISABLED flag from
> drivers/net/ethernet/amd/sun3lance.c
>
> It's a NOOP since 2.6.35 and it will be removed one day.
>
> Signed-off-by: Michael Opdenacker <michael.opdenacker@free-electrons.com>
Applied.
^ permalink raw reply
* Re: [PATCH] ehea: remove deprecated IRQF_DISABLED
From: David Miller @ 2013-09-13 3:27 UTC (permalink / raw)
To: michael.opdenacker; +Cc: cascardo, netdev, linux-kernel
In-Reply-To: <1378957571-3574-1-git-send-email-michael.opdenacker@free-electrons.com>
From: Michael Opdenacker <michael.opdenacker@free-electrons.com>
Date: Thu, 12 Sep 2013 05:46:11 +0200
> This patch proposes to remove the IRQF_DISABLED flag from
> drivers/net/ethernet/ibm/ehea/ehea_main.c
>
> It's a NOOP since 2.6.35 and it will be removed one day.
>
> Signed-off-by: Michael Opdenacker <michael.opdenacker@free-electrons.com>
Applied.
^ permalink raw reply
* Re: [PATCH] bfin_mac: remove deprecated IRQF_DISABLED
From: David Miller @ 2013-09-13 3:27 UTC (permalink / raw)
To: michael.opdenacker
Cc: richardcochran, jg1.han, jiri, mugunthanvnm, uclinux-dist-devel,
netdev, linux-kernel
In-Reply-To: <1378956943-3470-1-git-send-email-michael.opdenacker@free-electrons.com>
From: Michael Opdenacker <michael.opdenacker@free-electrons.com>
Date: Thu, 12 Sep 2013 05:35:43 +0200
> This patch proposes to remove the IRQF_DISABLED flag from
> drivers/net/ethernet/adi/bfin_mac.c.
>
> It's a NOOP since 2.6.35 and it will be removed one day.
>
> Signed-off-by: Michael Opdenacker <michael.opdenacker@free-electrons.com>
Applied.
^ permalink raw reply
* Re: [PATCHv2 net] xen-netback: count number required slots for an skb more carefully
From: David Miller @ 2013-09-13 3:23 UTC (permalink / raw)
To: david.vrabel
Cc: xen-devel, konrad.wilk, boris.ostrovsky, netdev, ian.campbell
In-Reply-To: <1378907568-8062-1-git-send-email-david.vrabel@citrix.com>
From: David Vrabel <david.vrabel@citrix.com>
Date: Wed, 11 Sep 2013 14:52:48 +0100
> From: David Vrabel <david.vrabel@citrix.com>
>
> When a VM is providing an iSCSI target and the LUN is used by the
> backend domain, the generated skbs for direct I/O writes to the disk
> have large, multi-page skb->data but no frags.
>
> With some lengths and starting offsets, xen_netbk_count_skb_slots()
> would be one short because the simple calculation of
> DIV_ROUND_UP(skb_headlen(), PAGE_SIZE) was not accounting for the
> decisions made by start_new_rx_buffer() which does not guarantee
> responses are fully packed.
...
> Fix this by counting the number of required slots more carefully. In
> xen_netbk_count_skb_slots(), more closely follow the algorithm used by
> xen_netbk_gop_skb() by introducing xen_netbk_count_frag_slots() which
> is the dry-run equivalent of netbk_gop_frag_copy().
>
> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
> Acked-by: Ian Campbell <ian.campbell@citrix.com>
> --
> v2: xen_netbk_* -> xenvif_* to match new style
Thanks for resolving this into a final patch after so much back and
forth :-)
I assume you want this queued up for -stable, and can you check if
there is any non-trivial backporting for earlier kernels?
^ permalink raw reply
* [PATCH net-next] bridge: fix NULL pointer deref in br_handle_frame
From: Hong Zhiguo @ 2013-09-13 3:09 UTC (permalink / raw)
To: netdev; +Cc: davem, zhiguohong, eric.dumazet, vyasevic
In-Reply-To: <1378988195-2710-1-git-send-email-zhiguohong@tencent.com>
From: Hong Zhiguo <zhiguohong@tencent.com>
I got an Oops on my box when br_handle_frame is called between these
2 lines of del_nbp:
dev->priv_flags &= ~IFF_BRIDGE_PORT;
/* --> br_handle_frame is called at this time */
netdev_rx_handler_unregister(dev);
In br_handle_frame the return of br_port_get_rcu(dev) is dereferenced
without check but br_port_get_rcu(dev) returns NULL if:
!(dev->priv_flags & IFF_BRIDGE_PORT)
In my first fix I moved netdev_rx_handler_unregister up. Eric Dumazet
pointed out the testing of IFF_BRIDGE_PORT is not necessary here since
we're in rcu_read_lock and we have synchronize_net() in
netdev_rx_handler_unregister. This fix removed the testing of
IFF_BRIDGE_PORT.
I tested the fix on my box with script doing "brctl addif" and "brctl
delif" repeatedly while a lot of broadcast frame present on the LAN.
I added msleep in del_nbp between setting of priv_flags and unregister
so it's easy to reproduce the oops without the fix.
I'll send another patch to net-next to take care of br_netfilter and
ebtable if necessary(seems there's NULL check following but I'll
have a look).
The Oops(some lines omitted):
BUG: unable to handle kernel NULL pointer dereference at 0000000000000021
IP: [<ffffffff8150901d>] br_handle_frame+0xed/0x230
Oops: 0000 [#1] PREEMPT SMP
RIP: 0010:[<ffffffff8150901d>] [<ffffffff8150901d>] br_handle_frame+0xed/0x230
RSP: 0018:ffff880030403c10 EFLAGS: 00010286
Stack:
ffff88002c945700 ffffffff81508f30 0000000000000000 ffff88002d41e000
ffff880030403c98 ffffffff81477acb ffffffff81477821 ffff880030403c68
ffffffff81090e10 00ff88002d545c80 ffff88002c945700 ffffffff81aa50c0
Call Trace:
<IRQ>
[<ffffffff81508f30>] ? br_handle_frame_finish+0x300/0x300
[<ffffffff81477acb>] __netif_receive_skb_core+0x39b/0x880
Signed-off-by: Hong Zhiguo <zhiguohong@tencent.com>
---
net/bridge/br_input.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index a2fd37e..2244049 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -60,7 +60,7 @@ static int br_pass_frame_up(struct sk_buff *skb)
int br_handle_frame_finish(struct sk_buff *skb)
{
const unsigned char *dest = eth_hdr(skb)->h_dest;
- struct net_bridge_port *p = br_port_get_rcu(skb->dev);
+ struct net_bridge_port *p = rcu_dereference(skb->dev->rx_handler_data);
struct net_bridge *br;
struct net_bridge_fdb_entry *dst;
struct net_bridge_mdb_entry *mdst;
@@ -143,7 +143,7 @@ drop:
/* note: already called with rcu_read_lock */
static int br_handle_local_finish(struct sk_buff *skb)
{
- struct net_bridge_port *p = br_port_get_rcu(skb->dev);
+ struct net_bridge_port *p = rcu_dereference(skb->dev->rx_handler_data);
u16 vid = 0;
br_vlan_get_tag(skb, &vid);
@@ -173,7 +173,7 @@ rx_handler_result_t br_handle_frame(struct sk_buff **pskb)
if (!skb)
return RX_HANDLER_CONSUMED;
- p = br_port_get_rcu(skb->dev);
+ p = rcu_dereference(skb->dev->rx_handler_data);
if (unlikely(is_link_local_ether_addr(dest))) {
/*
--
1.8.1.2
^ permalink raw reply related
* Re: [PATCH net] tg3: Expand led off fix to include 5720
From: David Miller @ 2013-09-13 3:11 UTC (permalink / raw)
To: nsujir; +Cc: netdev, stable, mchan
In-Reply-To: <1379019691-4618-1-git-send-email-nsujir@broadcom.com>
From: "Nithin Nayak Sujir" <nsujir@broadcom.com>
Date: Thu, 12 Sep 2013 14:01:31 -0700
> Commit 989038e217e94161862a959e82f9a1ecf8dda152 ("tg3: Don't turn off
> led on 5719 serdes port 0") added code to skip turning led off on port
> 0 of the 5719 since it powered down other ports. This workaround needs
> to be enabled on the 5720 as well.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com>
> Signed-off-by: Michael Chan <mchan@broadcom.com>
Applied and queued up for -stable.
^ permalink raw reply
* [PATCH v2 6/6] ipv6: Do route updating for redirect in ndisc layer
From: Duan Jiong @ 2013-09-13 3:03 UTC (permalink / raw)
To: davem; +Cc: netdev, hannes
In-Reply-To: <52327F00.4040802@cn.fujitsu.com>
From: Duan Jiong <duanj.fnst@cn.fujitsu.com>
Do the whole verification and route updating in ndisc
lay and then just call into icmpv6_notify() to notify
the upper protocols.
Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
---
include/net/ip6_route.h | 3 ---
net/ipv6/ndisc.c | 6 ++----
net/ipv6/route.c | 29 ++---------------------------
3 files changed, 4 insertions(+), 34 deletions(-)
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index f525e70..5db259e 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -133,9 +133,6 @@ extern void ip6_update_pmtu(struct sk_buff *skb, struct net *net, __be32 mtu,
extern void ip6_sk_update_pmtu(struct sk_buff *skb, struct sock *sk,
__be32 mtu);
extern void ip6_redirect(struct sk_buff *skb, struct net *net, int oif, u32 mark);
-extern void ip6_redirect_no_header(struct sk_buff *skb, struct net *net, int oif,
- u32 mark);
-extern void ip6_sk_redirect(struct sk_buff *skb, struct sock *sk);
struct netlink_callback;
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index f8a55ff..6bd1b41 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -1368,11 +1368,9 @@ static void ndisc_redirect_rcv(struct sk_buff *skb)
if (!ndisc_parse_options(msg->opt, ndoptlen, &ndopts))
return;
- if (!ndopts.nd_opts_rh) {
- ip6_redirect_no_header(skb, dev_net(skb->dev),
- skb->dev->ifindex, 0);
+ ip6_redirect(skb, dev_net(skb->dev), skb->dev->ifindex, 0);
+ if (!ndopts.nd_opts_rh)
return;
- }
hdr = (u8 *)ndopts.nd_opts_rh;
hdr += 8;
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index c979dd9..151bd6c 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1227,27 +1227,7 @@ static struct dst_entry *ip6_route_redirect(struct net *net,
flags, __ip6_route_redirect);
}
-void ip6_redirect(struct sk_buff *skb, struct net *net, int oif, u32 mark)
-{
- const struct ipv6hdr *iph = (struct ipv6hdr *) skb->data;
- struct dst_entry *dst;
- struct flowi6 fl6;
-
- memset(&fl6, 0, sizeof(fl6));
- fl6.flowi6_oif = oif;
- fl6.flowi6_mark = mark;
- fl6.flowi6_flags = 0;
- fl6.daddr = iph->daddr;
- fl6.saddr = iph->saddr;
- fl6.flowlabel = ip6_flowinfo(iph);
-
- dst = ip6_route_redirect(net, &fl6, &ipv6_hdr(skb)->saddr);
- rt6_do_redirect(dst, NULL, skb);
- dst_release(dst);
-}
-EXPORT_SYMBOL_GPL(ip6_redirect);
-
-void ip6_redirect_no_header(struct sk_buff *skb, struct net *net, int oif,
+void ip6_redirect(struct sk_buff *skb, struct net *net, int oif,
u32 mark)
{
const struct ipv6hdr *iph = ipv6_hdr(skb);
@@ -1266,12 +1246,7 @@ void ip6_redirect_no_header(struct sk_buff *skb, struct net *net, int oif,
rt6_do_redirect(dst, NULL, skb);
dst_release(dst);
}
-
-void ip6_sk_redirect(struct sk_buff *skb, struct sock *sk)
-{
- ip6_redirect(skb, sock_net(sk), sk->sk_bound_dev_if, sk->sk_mark);
-}
-EXPORT_SYMBOL_GPL(ip6_sk_redirect);
+EXPORT_SYMBOL_GPL(ip6_redirect);
static unsigned int ip6_default_advmss(const struct dst_entry *dst)
{
--
1.8.3.1
^ permalink raw reply related
* [PATCH v2 5/6] ipv6: modify the err to 0 when dealing with NDISC_REDIRECT
From: Duan Jiong @ 2013-09-13 3:02 UTC (permalink / raw)
To: davem; +Cc: netdev, hannes
In-Reply-To: <52327F00.4040802@cn.fujitsu.com>
From: Duan Jiong <duanj.fnst@cn.fujitsu.com>
when dealing with redirect message, the err shoud
be assigned to 0, not EPROTO. And del the statements
for updating route.
Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
---
net/ipv6/icmp.c | 3 +++
net/ipv6/raw.c | 3 +--
net/ipv6/udp.c | 2 --
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index 4bde43c..6bcedcc 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -975,6 +975,9 @@ int icmpv6_err_convert(u8 type, u8 code, int *err)
case ICMPV6_TIME_EXCEED:
*err = EHOSTUNREACH;
break;
+ case NDISC_REDIRECT:
+ *err = 0;
+ break;
}
return fatal;
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index 58916bb..baf86b8 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -335,8 +335,7 @@ static void rawv6_err(struct sock *sk, struct sk_buff *skb,
ip6_sk_update_pmtu(skb, sk, info);
harderr = (np->pmtudisc == IPV6_PMTUDISC_DO);
}
- if (type == NDISC_REDIRECT)
- ip6_sk_redirect(skb, sk);
+
if (np->recverr) {
u8 *payload = skb->data;
if (!inet->hdrincl)
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index f405815..a40b392 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -525,8 +525,6 @@ void __udp6_lib_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
if (type == ICMPV6_PKT_TOOBIG)
ip6_sk_update_pmtu(skb, sk, info);
- if (type == NDISC_REDIRECT)
- ip6_sk_redirect(skb, sk);
np = inet6_sk(sk);
--
1.8.3.1
^ permalink raw reply related
* [PATCH v2 4/6] ip6tnl: move route updating for redirect to ndisc layer
From: Duan Jiong @ 2013-09-13 3:01 UTC (permalink / raw)
To: davem; +Cc: netdev, hannes
In-Reply-To: <52327F00.4040802@cn.fujitsu.com>
From: Duan Jiong <duanj.fnst@cn.fujitsu.com>
In rfc2473, we can know that the tunnel ICMP redirect
message should not be reported to the source of the
original packet, so after calling ip6_tnl_err(), the
rel_msg is set to 0 in function ip4ip6_err(), and the
redirect will never be handled.
In order to deal with this, we move route updating for
redirect to ndisc layer.
Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
---
net/ipv6/ip6_tunnel.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index 61355f7..3ea834b 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -576,9 +576,6 @@ ip4ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
rel_type = ICMP_DEST_UNREACH;
rel_code = ICMP_FRAG_NEEDED;
break;
- case NDISC_REDIRECT:
- rel_type = ICMP_REDIRECT;
- rel_code = ICMP_REDIR_HOST;
default:
return 0;
}
@@ -637,8 +634,6 @@ ip4ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
skb_dst(skb2)->ops->update_pmtu(skb_dst(skb2), NULL, skb2, rel_info);
}
- if (rel_type == ICMP_REDIRECT)
- skb_dst(skb2)->ops->redirect(skb_dst(skb2), NULL, skb2);
icmp_send(skb2, rel_type, rel_code, htonl(rel_info));
--
1.8.3.1
^ permalink raw reply related
* [PATCH v2 3/6] ipv6: del statements for dealing with NDISC_REDIRECT
From: Duan Jiong @ 2013-09-13 3:00 UTC (permalink / raw)
To: davem; +Cc: netdev, hannes
In-Reply-To: <52327F00.4040802@cn.fujitsu.com>
From: Duan Jiong <duanj.fnst@cn.fujitsu.com>
Now the route updating for redirect is done in ndisc
layer.
Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
---
net/ipv6/icmp.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index eef8d94..4bde43c 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -91,8 +91,6 @@ static void icmpv6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
if (type == ICMPV6_PKT_TOOBIG)
ip6_update_pmtu(skb, net, info, 0, 0);
- else if (type == NDISC_REDIRECT)
- ip6_redirect(skb, net, skb->dev->ifindex, 0);
if (!(type & ICMPV6_INFOMSG_MASK))
if (icmp6->icmp6_type == ICMPV6_ECHO_REQUEST)
--
1.8.3.1
^ permalink raw reply related
* Re: [PATCH v2] bonding: Make alb learning packet interval configurable
From: Neil Horman @ 2013-09-13 3:01 UTC (permalink / raw)
To: Andy Gospodarek; +Cc: David Miller, netdev, vfalico, nhorman, fubar
In-Reply-To: <20130912210613.GA15224@gospo.rdu.redhat.com>
On Thu, Sep 12, 2013 at 05:06:13PM -0400, Andy Gospodarek wrote:
> On Thu, Sep 12, 2013 at 04:49:48PM -0400, David Miller wrote:
> > From: Neil Horman <nhorman@tuxdriver.com>
> > Date: Tue, 10 Sep 2013 16:39:03 -0400
> >
> > > From: Neil Horman <nhorman@redhat.com>
> > >
> > > running bonding in ALB mode requires that learning packets be sent periodically,
> > > so that the switch knows where to send responding traffic. However, depending
> > > on switch configuration, there may not be any need to send traffic at the
> > > default rate of 3 packets per second, which represents little more than wasted
> > > data. Allow the ALB learning packet interval to be made configurable via sysfs
> > >
> > > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> >
> > I hate to be a stickler, but I'd like you to make the default value
> > documented both in the code and in the documentation.
> >
> > Use some macro for the code "#define BOND_ALB_DEFAULT_LP_INTERVAL 1" and
> > mention the default in the bonding.txt changes.
> >
>
> Agree with DaveM on this. You can just keep the one that was there and
> it should be pretty easy.
>
Yeah, sure I can do that. v3 in the AM
Neil
^ permalink raw reply
* [PATCH v2 2/6] ipv6: just match on ICMPV6_PKT_TOOBIG in those err_handle
From: Duan Jiong @ 2013-09-13 2:59 UTC (permalink / raw)
To: davem; +Cc: netdev, hannes
In-Reply-To: <52327F00.4040802@cn.fujitsu.com>
From: Duan Jiong <duanj.fnst@cn.fujitsu.com>
we don't handle NDISC_REDIRECTs here any more, and the match
on ICMPV6_DEST_UNREACH is meaningless.
Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
---
net/ipv6/ah6.c | 9 ++-------
net/ipv6/esp6.c | 9 ++-------
net/ipv6/ipcomp6.c | 9 ++-------
3 files changed, 6 insertions(+), 21 deletions(-)
diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c
index 73784c3..79fb40f 100644
--- a/net/ipv6/ah6.c
+++ b/net/ipv6/ah6.c
@@ -618,19 +618,14 @@ static void ah6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
struct ip_auth_hdr *ah = (struct ip_auth_hdr*)(skb->data+offset);
struct xfrm_state *x;
- if (type != ICMPV6_DEST_UNREACH &&
- type != ICMPV6_PKT_TOOBIG &&
- type != NDISC_REDIRECT)
+ if (type != ICMPV6_PKT_TOOBIG)
return;
x = xfrm_state_lookup(net, skb->mark, (xfrm_address_t *)&iph->daddr, ah->spi, IPPROTO_AH, AF_INET6);
if (!x)
return;
- if (type == NDISC_REDIRECT)
- ip6_redirect(skb, net, skb->dev->ifindex, 0);
- else
- ip6_update_pmtu(skb, net, info, 0, 0);
+ ip6_update_pmtu(skb, net, info, 0, 0);
xfrm_state_put(x);
}
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c
index d3618a7..6aa64e1 100644
--- a/net/ipv6/esp6.c
+++ b/net/ipv6/esp6.c
@@ -436,9 +436,7 @@ static void esp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
struct ip_esp_hdr *esph = (struct ip_esp_hdr *)(skb->data + offset);
struct xfrm_state *x;
- if (type != ICMPV6_DEST_UNREACH &&
- type != ICMPV6_PKT_TOOBIG &&
- type != NDISC_REDIRECT)
+ if (type != ICMPV6_PKT_TOOBIG)
return;
x = xfrm_state_lookup(net, skb->mark, (const xfrm_address_t *)&iph->daddr,
@@ -446,10 +444,7 @@ static void esp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
if (!x)
return;
- if (type == NDISC_REDIRECT)
- ip6_redirect(skb, net, skb->dev->ifindex, 0);
- else
- ip6_update_pmtu(skb, net, info, 0, 0);
+ ip6_update_pmtu(skb, net, info, 0, 0);
xfrm_state_put(x);
}
diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c
index 5636a91..e943158 100644
--- a/net/ipv6/ipcomp6.c
+++ b/net/ipv6/ipcomp6.c
@@ -64,9 +64,7 @@ static void ipcomp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
(struct ip_comp_hdr *)(skb->data + offset);
struct xfrm_state *x;
- if (type != ICMPV6_DEST_UNREACH &&
- type != ICMPV6_PKT_TOOBIG &&
- type != NDISC_REDIRECT)
+ if (type != ICMPV6_PKT_TOOBIG)
return;
spi = htonl(ntohs(ipcomph->cpi));
@@ -75,10 +73,7 @@ static void ipcomp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
if (!x)
return;
- if (type == NDISC_REDIRECT)
- ip6_redirect(skb, net, skb->dev->ifindex, 0);
- else
- ip6_update_pmtu(skb, net, info, 0, 0);
+ ip6_update_pmtu(skb, net, info, 0, 0);
xfrm_state_put(x);
}
--
1.8.3.1
^ permalink raw reply related
* [PATCH v2 1/6] ipv6: del the statements for updating route in (dccp|tcp|sctp)_v6_err
From: Duan Jiong @ 2013-09-13 2:58 UTC (permalink / raw)
To: davem; +Cc: netdev, hannes
In-Reply-To: <52327F00.4040802@cn.fujitsu.com>
From: Duan Jiong <duanj.fnst@cn.fujitsu.com>
Because we will do route updating for redirect in nidsc layer. And
when dealing with redirect message, the dccp and sctp should like
tcp return directly.
Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
---
net/dccp/ipv6.c | 10 +++-------
net/ipv6/tcp_ipv6.c | 12 ++++--------
net/sctp/input.c | 12 ------------
net/sctp/ipv6.c | 6 +++---
4 files changed, 10 insertions(+), 30 deletions(-)
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index 9c61f9c..300840c 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -98,6 +98,9 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
return;
}
+ if (type == NDISC_REDIRECT)
+ return;
+
sk = inet6_lookup(net, &dccp_hashinfo,
&hdr->daddr, dh->dccph_dport,
&hdr->saddr, dh->dccph_sport, inet6_iif(skb));
@@ -130,13 +133,6 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
np = inet6_sk(sk);
- if (type == NDISC_REDIRECT) {
- struct dst_entry *dst = __sk_dst_check(sk, np->dst_cookie);
-
- if (dst)
- dst->ops->redirect(dst, sk, skb);
- }
-
if (type == ICMPV6_PKT_TOOBIG) {
struct dst_entry *dst = NULL;
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 5c71501..d3ca8a4 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -346,6 +346,10 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
__u32 seq;
struct net *net = dev_net(skb->dev);
+
+ if (type == NDISC_REDIRECT)
+ return;
+
sk = inet6_lookup(net, &tcp_hashinfo, &hdr->daddr,
th->dest, &hdr->saddr, th->source, skb->dev->ifindex);
@@ -382,14 +386,6 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
np = inet6_sk(sk);
- if (type == NDISC_REDIRECT) {
- struct dst_entry *dst = __sk_dst_check(sk, np->dst_cookie);
-
- if (dst)
- dst->ops->redirect(dst, sk, skb);
- goto out;
- }
-
if (type == ICMPV6_PKT_TOOBIG) {
/* We are not interested in TCP_LISTEN and open_requests
* (SYN-ACKs send out by Linux are always <576bytes so
diff --git a/net/sctp/input.c b/net/sctp/input.c
index 5f20686..0d2d4b7 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -413,18 +413,6 @@ void sctp_icmp_frag_needed(struct sock *sk, struct sctp_association *asoc,
sctp_retransmit(&asoc->outqueue, t, SCTP_RTXR_PMTUD);
}
-void sctp_icmp_redirect(struct sock *sk, struct sctp_transport *t,
- struct sk_buff *skb)
-{
- struct dst_entry *dst;
-
- if (!t)
- return;
- dst = sctp_transport_dst_check(t);
- if (dst)
- dst->ops->redirect(dst, sk, skb);
-}
-
/*
* SCTP Implementer's Guide, 2.37 ICMP handling procedures
*
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index da613ce..ee12d87 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -151,6 +151,9 @@ static void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
int err;
struct net *net = dev_net(skb->dev);
+ if (type == NDISC_REDIRECT)
+ return;
+
idev = in6_dev_get(skb->dev);
/* Fix up skb to look at the embedded net header. */
@@ -181,9 +184,6 @@ static void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
goto out_unlock;
}
break;
- case NDISC_REDIRECT:
- sctp_icmp_redirect(sk, transport, skb);
- break;
default:
break;
}
--
1.8.3.1
^ permalink raw reply related
* [PATCH v2 0/6] ipv6: Do route updating for redirect in ndisc layer
From: Duan Jiong @ 2013-09-13 2:57 UTC (permalink / raw)
To: davem; +Cc: netdev, hannes
From: Duan Jiong <duanj.fnst@cn.fujitsu.com>
the ip6_redirect() could be replaced with
ip6_redirect_no_header(), we could always use ip6_redirect()
for route updating in ndisc layer and use the data of the
redirected header option just for finding the socket to be
notified and then notify user in protocols' err_handler.
---
Changes for v2:
1.handle the update of the NDISC_REDIRECT error code directly in
icmpv6_err_convert.
2.squash some patchs into one patch.
3.modify the subject of those patchs.
Duan Jiong (6):
ipv6: del the statements for updating route in (dccp|tcp|sctp)_v6_err
ipv6: just match on ICMPV6_PKT_TOOBIG in those err_handle
ipv6: del statements for dealing with NDISC_REDIRECT
ip6tnl: move route updating for redirect to ndisc layer
ipv6: modify the err to 0 when dealing with NDISC_REDIRECT
ipv6: Do route updating for redirect in ndisc layer
include/net/ip6_route.h | 3 ---
net/dccp/ipv6.c | 10 +++-------
net/ipv6/ah6.c | 9 ++-------
net/ipv6/esp6.c | 9 ++-------
net/ipv6/icmp.c | 5 +++--
net/ipv6/ip6_tunnel.c | 5 -----
net/ipv6/ipcomp6.c | 9 ++-------
net/ipv6/ndisc.c | 6 ++----
net/ipv6/raw.c | 3 +--
net/ipv6/route.c | 29 ++---------------------------
net/ipv6/tcp_ipv6.c | 12 ++++--------
net/ipv6/udp.c | 2 --
net/sctp/input.c | 12 ------------
net/sctp/ipv6.c | 6 +++---
14 files changed, 24 insertions(+), 96 deletions(-)
--
1.8.3.1
^ permalink raw reply
* Re: [PATCHv3 linux-next] hrtimer: Add notifier when clock_was_set was called
From: Fan Du @ 2013-09-13 2:46 UTC (permalink / raw)
To: David Miller, tglx
Cc: herbert, steffen.klassert, dborkman, linux-kernel, netdev,
John Stultz
In-Reply-To: <20130912.133252.425268707009916773.davem@davemloft.net>
Hi Dave/Thomas
On 2013年09月13日 01:32, David Miller wrote:
> From: Thomas Gleixner<tglx@linutronix.de>
> Date: Thu, 12 Sep 2013 16:43:37 +0200 (CEST)
>
>> So what about going back to timer_list timers and simply utilize
>> register_pm_notifier(), which will tell you that the system resumed?
>
> The thing to understand is that there are two timeouts for an IPSEC
> rule, a soft and a hard timeout.
>
> There is a gap between these two exactly so that we can negotiate a
> new encapsulation with the IPSEC gateway before communication ceases
> to be possible over the IPSEC protected path.
>
> So the idea is that the soft timeout triggers the re-negotiation,
> and after a hard timeout the IPSEC path is no longer usable and
> all communication will fail.
>
> Simply triggering a re-negoation after every suspend/resume makes
> no sense at all. Spurious re-negotiations are undesirable.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (*a*)
What's the differences between this with re-negotiation after every
system wall clock changing by using clock_was_set notifier?
> On 2013年08月02日 06:35, David Miller wrote:
>
> I suspect the thing to do is to have system time changes generate a
> notifier when clock_was_set() is called.
>
> The XFRM code would walk the rules and pretend that we hit the soft
> timeout for every rule that we haven't hit the soft timeout yet
> already.
>
> If a rule hit the soft timeout, force a hard timeout.
>
> When forcing a soft timeout, adjust the hard timeout to be
> (hard_timeout - soft_timeout) into the future.
> What we want are real timers. We want that rather than a "we
> suspended so just assume all timers expired" event which is not very
> useful for this kind of application.
>
Here we are facing two problems:)
(1) what kind timer should xfrm_state should employ, Two requirements here:
First one, KEY lifetime should include suspend/resume time. Second one,
system wall clock time changing(backward/forward) should *not* impact
*timer* timeout event(not the soft/hard IPsec events fired to user space!)
net-next commit 99565a6c471cbb66caa68347c195133017559943 ("xfrm: Make
xfrm_state timer monotonic") by utilizing *CLOCK_BOOTTIME* has solved this problem.
(2) What I have been bugging you around here for this long time is really the second
problem, I'm sorry I didn't make it clearly to you and others, which is below:
Why using wall clock time to calculate soft/hard IPsec events when xfrm_state timer
out happens in its timeout handler? Because even if xfrm_state using CLOCK_BOOTTIME,
system wall clock time changing will surely disturb soft/hard IPsec events, which
you raised your concern about in (*a*).
The initial approach( http://marc.info/?l=linux-netdev&m=137534280429187&w=2) has
tried to solve this second problem by eliminating depending system wall clock in
xfrm_state timer timeout handler.
I think this time, I have made this situation crystal clear.
--
浮沉随浪只记今朝笑
--fan
^ 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