Netdev List
 help / color / mirror / Atom feed
* IPv6 kernel warning
From: Russell King - ARM Linux @ 2013-09-20 13:11 UTC (permalink / raw)
  To: netdev

While running v3.11 on my firewall, I saw this warning.  I'm not sure
what it means or what its implications are:

------------[ cut here ]------------
WARNING: CPU: 0 PID: 0 at /home/rmk/git/linux-rmk/net/ipv4/tcp_input.c:2711 tcp_fastretrans_alert+0x178/0x840()
Modules linked in: ipt_REJECT xt_multiport iptable_filter ipt_MASQUERADE xt_nat
xt_mark iptable_nat nf_nat_ipv4 nf_nat ip6table_mangle xt_LOG xt_limit nf_conntrack_ipv6 nf_defrag_ipv6 xt_state ip6table_filter pata_pcmcia libata scsi_mod 3c589_cs ide_gd_mod ide_cs ide_core sa1111_cs sa1100_cs sa11xx_base soc_common sa11x0_dma virt_dma usbcore usb_common
CPU: 0 PID: 0 Comm: swapper Not tainted 3.11.0+ #15
Backtrace:
[<c02111a8>] (dump_backtrace+0x0/0x114) from [<c02115a0>] (show_stack+0x18/0x1c) r6:c0520824 r5:00000009 r4:00000000
[<c0211588>] (show_stack+0x0/0x1c) from [<c04d65e0>] (dump_stack+0x20/0x28)
[<c04d65c0>] (dump_stack+0x0/0x28) from [<c021bfb0>] (warn_slowpath_common+0x68/0x88)
[<c021bf48>] (warn_slowpath_common+0x0/0x88) from [<c021bff4>] (warn_slowpath_null+0x24/0x28)
 r8:00000000 r7:00000001 r6:00000006 r5:00004320 r4:c11c6580
[<c021bfd0>] (warn_slowpath_null+0x0/0x28) from [<c04515bc>] (tcp_fastretrans_alert+0x178/0x840)
[<c0451444>] (tcp_fastretrans_alert+0x0/0x840) from [<c045273c>] (tcp_ack+0xa14/0xc18)
[<c0451d28>] (tcp_ack+0x0/0xc18) from [<c0453138>] (tcp_rcv_established+0x494/0x594)
[<c0452ca4>] (tcp_rcv_established+0x0/0x594) from [<c04a977c>] (tcp_v6_do_rcv+0xd0/0x428)
[<c04a96ac>] (tcp_v6_do_rcv+0x0/0x428) from [<c04a9e70>] (tcp_v6_rcv+0x340/0x63c)
[<c04a9b30>] (tcp_v6_rcv+0x0/0x63c) from [<c048b334>] (ip6_input_finish+0x214/0x3c4)
[<c048b120>] (ip6_input_finish+0x0/0x3c4) from [<c048ba60>] (ip6_input+0x64/0x74)
[<c048b9fc>] (ip6_input+0x0/0x74) from [<c048b564>] (ip6_rcv_finish+0x80/0x8c)
 r4:c1c9ee20
[<c048b4e4>] (ip6_rcv_finish+0x0/0x8c) from [<c048b994>] (ipv6_rcv+0x424/0x48c)
 r4:c1c9ee20
[<c048b570>] (ipv6_rcv+0x0/0x48c) from [<c0407624>] (__netif_receive_skb_core+0x618/0x688)
 r8:0000dd86 r7:00000000 r6:c11f6800 r5:c05ee6cc r4:c05f1b98
[<c040700c>] (__netif_receive_skb_core+0x0/0x688) from [<c040770c>] (__netif_receive_skb+0x78/0x80)
[<c0407694>] (__netif_receive_skb+0x0/0x80) from [<c04077a8>] (process_backlog+0x94/0x14c)
 r5:c06091e0 r4:c0609220
[<c0407714>] (process_backlog+0x0/0x14c) from [<c0407af4>] (net_rx_action+0x78/0x1ac)
[<c0407a7c>] (net_rx_action+0x0/0x1ac) from [<c021f500>] (__do_softirq+0xb4/0x198)
[<c021f44c>] (__do_softirq+0x0/0x198) from [<c021f90c>] (irq_exit+0x74/0xc8)
[<c021f898>] (irq_exit+0x0/0xc8) from [<c020f1ac>] (handle_IRQ+0x68/0x88)
 r4:0000000b
[<c020f144>] (handle_IRQ+0x0/0x88) from [<c0208210>] (asm_do_IRQ+0x10/0x14)
 r5:60000013 r4:c0246818
[<c0208200>] (asm_do_IRQ+0x0/0x14) from [<c0211fcc>] (__irq_svc+0x2c/0x98)
Exception stack(0xc05e7f54 to 0xc05e7f9c)
7f40:                                              00000000 00000000 00000000
7f60: 60000013 c05e6000 c06092a4 c05ee080 00000001 c0204000 6901b115 c05e0800
7f80: c05e7fb8 c05e7f9c c05e7f9c c020f348 c0246818 60000013 ffffffff
[<c0246794>] (cpu_startup_entry+0x0/0xe8) from [<c04d4d70>] (rest_init+0x64/0x7c)
 r7:c05f3940 r6:c0922200 r5:c0609340 r4:c05ee0c0
[<c04d4d0c>] (rest_init+0x0/0x7c) from [<c05c3acc>] (start_kernel+0x350/0x3ac)
[<c05c377c>] (start_kernel+0x0/0x3ac) from [<c0208040>] (0xc0208040)
---[ end trace ab55f0e3f592fa5e ]---

^ permalink raw reply

* Re: [PATCH 42/51] DMA-API: usb: musb: use platform_device_register_full() to avoid directly messing with dma masks
From: Felipe Balbi @ 2013-09-20 13:11 UTC (permalink / raw)
  To: Russell King
  Cc: alsa-devel, linux-doc, linux-mmc, linux-fbdev, linux-nvme,
	linux-ide, devel, linux-samsung-soc, linux-scsi, e1000-devel,
	b43-dev, linux-media, devicetree, dri-devel, linux-tegra,
	linux-omap, linux-arm-kernel, Solarflare linux maintainers,
	netdev, linux-usb, linux-wireless, Felipe Balbi, linux-crypto,
	Greg Kroah-Hartman, uclinux-dist-devel, linuxppc-dev
In-Reply-To: <E1VMnQk-0007sX-Ty@rmk-PC.arm.linux.org.uk>


[-- Attachment #1.1: Type: text/plain, Size: 731 bytes --]

Hi,

On Fri, Sep 20, 2013 at 12:14:38AM +0100, Russell King wrote:
> Use platform_device_register_full() for those drivers which can, to
> avoid messing directly with DMA masks.  This can only be done when
> the driver does not need to access the allocated musb platform device
> from within its callbacks, which may be called during the musb
> device probing.
> 
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

you want me to carry this one through my tree or you prefer getting my
Acked-by ? Either way works for me:

Acked-by: Felipe Balbi <balbi@ti.com>

there's also the third option of me setting up a branch with only this
patch and we both merge it, that'd also work.

cheers

-- 
balbi

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply

* Re: [PATCH 37/51] DMA-API: usb: use new dma_coerce_mask_and_coherent()
From: Felipe Balbi @ 2013-09-20 13:10 UTC (permalink / raw)
  To: Russell King
  Cc: alsa-devel, linux-doc, Alexander Shishkin, linux-mmc, linux-fbdev,
	linux-nvme, linux-ide, devel, linux-samsung-soc, linux-scsi,
	e1000-devel, Alan Stern, b43-dev, linux-media, devicetree,
	Stephen Warren, Kukjin Kim, dri-devel, linux-tegra, linux-omap,
	linux-arm-kernel, Solarflare linux maintainers, netdev, linux-usb,
	linux-wireless, Felipe Balbi, linux-crypto
In-Reply-To: <E1VMmIV-0007jw-Gq@rmk-PC.arm.linux.org.uk>


[-- Attachment #1.1: Type: text/plain, Size: 1432 bytes --]

Hi,

On Thu, Sep 19, 2013 at 11:02:03PM +0100, Russell King wrote:
> diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c
> index c10b324..8b20c70 100644
> --- a/drivers/usb/dwc3/dwc3-exynos.c
> +++ b/drivers/usb/dwc3/dwc3-exynos.c
> @@ -119,9 +119,7 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
>  	 * Since shared usb code relies on it, set it here for now.
>  	 * Once we move to full device tree support this will vanish off.
>  	 */
> -	if (!dev->dma_mask)
> -		dev->dma_mask = &dev->coherent_dma_mask;
> -	ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
> +	ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32));
>  	if (ret)
>  		goto err1;
>  
> diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
> index d0759c5..6fa82d6 100644
> --- a/drivers/usb/host/ehci-omap.c
> +++ b/drivers/usb/host/ehci-omap.c
> @@ -144,9 +144,7 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
>  	 * Since shared usb code relies on it, set it here for now.
>  	 * Once we have dma capability bindings this can go away.
>  	 */
> -	if (!dev->dma_mask)
> -		dev->dma_mask = &dev->coherent_dma_mask;
> -	ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
> +	ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32));
>  	if (ret)
>  		return ret;

for dwc3 and ehci-omap:

Acked-by: Felipe Balbi <balbi@ti.com>

-- 
balbi

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply

* Re: [PATCH 36/51] DMA-API: usb: use dma_set_coherent_mask()
From: Felipe Balbi @ 2013-09-20 13:08 UTC (permalink / raw)
  To: Russell King
  Cc: alsa-devel, linux-doc, Alexander Shishkin, linux-mmc, linux-fbdev,
	linux-nvme, linux-ide, devel, linux-samsung-soc, linux-scsi,
	e1000-devel, Alan Stern, b43-dev, linux-media, devicetree,
	Stephen Warren, Kukjin Kim, dri-devel, linux-tegra, linux-omap,
	linux-arm-kernel, Solarflare linux maintainers, netdev, linux-usb,
	linux-wireless, Felipe Balbi, linux-crypto
In-Reply-To: <E1VMmHX-0007jq-Cj@rmk-PC.arm.linux.org.uk>


[-- Attachment #1.1: Type: text/plain, Size: 1358 bytes --]

Hi,

On Thu, Sep 19, 2013 at 11:01:03PM +0100, Russell King wrote:
> diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c
> index 2f2e88a..c10b324 100644
> --- a/drivers/usb/dwc3/dwc3-exynos.c
> +++ b/drivers/usb/dwc3/dwc3-exynos.c
> @@ -121,8 +121,9 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
>  	 */
>  	if (!dev->dma_mask)
>  		dev->dma_mask = &dev->coherent_dma_mask;
> -	if (!dev->coherent_dma_mask)
> -		dev->coherent_dma_mask = DMA_BIT_MASK(32);
> +	ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
> +	if (ret)
> +		goto err1;
>  
>  	platform_set_drvdata(pdev, exynos);
>  
> diff --git a/drivers/usb/gadget/lpc32xx_udc.c b/drivers/usb/gadget/lpc32xx_udc.c
> index 67128be..6a2a65a 100644
> --- a/drivers/usb/gadget/lpc32xx_udc.c
> +++ b/drivers/usb/gadget/lpc32xx_udc.c
> @@ -3078,7 +3078,9 @@ static int __init lpc32xx_udc_probe(struct platform_device *pdev)
>  		 udc->isp1301_i2c_client->addr);
>  
>  	pdev->dev.dma_mask = &lpc32xx_usbd_dmamask;
> -	pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
> +	retval = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
> +	if (retval)
> +		goto resource_fail;
>  
>  	udc->board = &lpc32xx_usbddata;
>  

for dwc3 and drivers/usb/gadget:

Acked-by: Felipe Balbi <balbi@ti.com>

pretty cool work :-)

-- 
balbi

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply

* [PATCH net-next 2/2] xen-netback: handle frontends that fail to transition through Closing
From: Paul Durrant @ 2013-09-20 12:56 UTC (permalink / raw)
  To: netdev, xen-devel; +Cc: Paul Durrant, David Vrabel, Wei Liu, Ian Campbell
In-Reply-To: <1379681791-21842-1-git-send-email-paul.durrant@citrix.com>

Some old Windows frontends fail to transition through the xenbus Closing
state and move directly from Connected to Closed. Handle this case properly.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Cc: David Vrabel <david.vrabel@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
---
 drivers/net/xen-netback/xenbus.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c
index a53782e..bcaa25b 100644
--- a/drivers/net/xen-netback/xenbus.c
+++ b/drivers/net/xen-netback/xenbus.c
@@ -265,6 +265,8 @@ static void frontend_changed(struct xenbus_device *dev,
 		break;
 
 	case XenbusStateClosed:
+		if (dev->state == XenbusStateConnected)
+			disconnect_backend(dev);
 		xenbus_switch_state(dev, XenbusStateClosed);
 		if (xenbus_dev_is_online(dev))
 			break;
-- 
1.7.10.4

^ permalink raw reply related

* [PATCH net-next 1/2] xen-netback: add a vif-is-connected flag
From: Paul Durrant @ 2013-09-20 12:56 UTC (permalink / raw)
  To: netdev, xen-devel; +Cc: Paul Durrant, David Vrabel, Wei Liu, Ian Campbell
In-Reply-To: <1379681791-21842-1-git-send-email-paul.durrant@citrix.com>

Having applied my patch to separate vif disconnect and free, I ran into a
BUG when testing resume from S3 with a Windows frontend because the vif task
pointer was not cleared by xenvif_disconnect() and so a double call to this
function tries to stop the thread twice.
Rather than applying a point fix for that issue it seems better to introduce
a boolean to indicate whether the vif is connected or not such that repeated
calls to either xenvif_connect() or xenvif_disconnect() behave appropriately.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Cc: David Vrabel <david.vrabel@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
---
 drivers/net/xen-netback/common.h    |    1 +
 drivers/net/xen-netback/interface.c |   24 +++++++++++++-----------
 2 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h
index 5715318..860d92c 100644
--- a/drivers/net/xen-netback/common.h
+++ b/drivers/net/xen-netback/common.h
@@ -169,6 +169,7 @@ struct xenvif {
 
 	/* Miscellaneous private stuff. */
 	struct net_device *dev;
+	bool connected;
 };
 
 static inline struct xenbus_device *xenvif_to_xenbus_device(struct xenvif *vif)
diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
index 01bb854..94b47f5 100644
--- a/drivers/net/xen-netback/interface.c
+++ b/drivers/net/xen-netback/interface.c
@@ -366,7 +366,7 @@ int xenvif_connect(struct xenvif *vif, unsigned long tx_ring_ref,
 	int err = -ENOMEM;
 
 	/* Already connected through? */
-	if (vif->tx_irq)
+	if (vif->connected)
 		return 0;
 
 	err = xenvif_map_frontend_rings(vif, tx_ring_ref, rx_ring_ref);
@@ -425,6 +425,7 @@ int xenvif_connect(struct xenvif *vif, unsigned long tx_ring_ref,
 
 	wake_up_process(vif->task);
 
+	vif->connected = 1;
 	return 0;
 
 err_rx_unbind:
@@ -453,23 +454,24 @@ void xenvif_carrier_off(struct xenvif *vif)
 
 void xenvif_disconnect(struct xenvif *vif)
 {
+	if (!vif->connected)
+		return;
+
 	if (netif_carrier_ok(vif->dev))
 		xenvif_carrier_off(vif);
 
-	if (vif->tx_irq) {
-		if (vif->tx_irq == vif->rx_irq)
-			unbind_from_irqhandler(vif->tx_irq, vif);
-		else {
-			unbind_from_irqhandler(vif->tx_irq, vif);
-			unbind_from_irqhandler(vif->rx_irq, vif);
-		}
-		vif->tx_irq = 0;
+	if (vif->tx_irq == vif->rx_irq)
+		unbind_from_irqhandler(vif->tx_irq, vif);
+	else {
+		unbind_from_irqhandler(vif->tx_irq, vif);
+		unbind_from_irqhandler(vif->rx_irq, vif);
 	}
 
-	if (vif->task)
-		kthread_stop(vif->task);
+	kthread_stop(vif->task);
 
 	xenvif_unmap_frontend_rings(vif);
+
+	vif->connected = 0;
 }
 
 void xenvif_free(struct xenvif *vif)
-- 
1.7.10.4

^ permalink raw reply related

* [PATCH net-next 0/2] xen-netback: windows frontend compatibility fixes
From: Paul Durrant @ 2013-09-20 12:56 UTC (permalink / raw)
  To: netdev, xen-devel

The following patches fix a couple more issues found when testing with Windows
frontends.

^ permalink raw reply

* Re: [PATCH 39/51] DMA-API: others: use dma_set_coherent_mask()
From: Tejun Heo @ 2013-09-20 12:18 UTC (permalink / raw)
  To: Russell King
  Cc: alsa-devel, b43-dev, devel, devicetree, dri-devel, e1000-devel,
	linux-arm-kernel, linux-crypto, linux-doc, linux-fbdev, linux-ide,
	linux-media, linux-mmc, linux-nvme, linux-omap, linuxppc-dev,
	linux-samsung-soc, linux-scsi, linux-tegra, linux-usb,
	linux-wireless, netdev, Solarflare linux maintainers,
	uclinux-dist-devel, Inki Dae, Joonyoung Shim, Seung-Woo Kim, Kyun
In-Reply-To: <20130920121652.GA7630@mtj.dyndns.org>

On Fri, Sep 20, 2013 at 07:16:52AM -0500, Tejun Heo wrote:
> On Fri, Sep 20, 2013 at 12:11:38AM +0100, Russell King wrote:
> > The correct way for a driver to specify the coherent DMA mask is
> > not to directly access the field in the struct device, but to use
> > dma_set_coherent_mask().  Only arch and bus code should access this
> > member directly.
> > 
> > Convert all direct write accesses to using the correct API.
> > 
> > Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> 
> Acked-by: Tejun Heo <tj@kernel.org>
> 
> The patch is pretty widely spread.  I don't mind how it gets routed
> but what's the plan?

Hmm... maybe hte pata_ixp4xx_cf.c part should be moved to the one
which updates pata_octeon_cf.c?

Thanks.

-- 
tejun

^ permalink raw reply

* Re: [PATCH 39/51] DMA-API: others: use dma_set_coherent_mask()
From: Tejun Heo @ 2013-09-20 12:16 UTC (permalink / raw)
  To: Russell King
  Cc: alsa-devel, linux-doc, David Airlie, linux-mmc, linux-fbdev,
	linux-nvme, linux-ide, devel, linux-samsung-soc, Joonyoung Shim,
	linux-scsi, e1000-devel, Seung-Woo Kim, b43-dev, linux-media,
	devicetree, Inki Dae, Kukjin Kim, dri-devel, linux-tegra,
	linux-omap, linux-arm-kernel, Solarflare linux maintainers,
	netdev, linux-usb, linux-wireless, Kyungmin Park
In-Reply-To: <E1VMnNq-0007s4-HN@rmk-PC.arm.linux.org.uk>

On Fri, Sep 20, 2013 at 12:11:38AM +0100, Russell King wrote:
> The correct way for a driver to specify the coherent DMA mask is
> not to directly access the field in the struct device, but to use
> dma_set_coherent_mask().  Only arch and bus code should access this
> member directly.
> 
> Convert all direct write accesses to using the correct API.
> 
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

Acked-by: Tejun Heo <tj@kernel.org>

The patch is pretty widely spread.  I don't mind how it gets routed
but what's the plan?

Thanks.

-- 
tejun

^ permalink raw reply

* Re: [PATCH v2] ip6tnl: do route updating for redirect in ip6_tnl_err()
From: Duan Jiong @ 2013-09-20 10:43 UTC (permalink / raw)
  To: David Miller; +Cc: djduanjiong, netdev
In-Reply-To: <20130919.140213.417316271045370155.davem@davemloft.net>

于 2013年09月20日 02:02, David Miller 写道:
> From: Duan Jiong <djduanjiong@gmail.com>
> Date: Tue, 17 Sep 2013 20:27:57 -0700
> 
>> After the ip6_tnl_err() is called, the rel_msg is assigned to
>> 0, and the ip4ip6_err() will return directly, the instruction
>> below will not be executed.
>>
>> In rfc2473, we can know that the tunnel ICMP redirect message
>> should not be reported to the source of the original packet,
>> so we can handle it in ip6_tnl_err().
>>
>> Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
> 
> I do not think this change is correct.
> 
>> @@ -576,9 +579,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;
>>  	}
> 
> The bug is a missing "break;" statement for this case, and:

You can read the ip6_tnl_err(). when the message is NDISC_REDIRECT, the
rel_msg is assigned to 0, then 

 561         if (rel_msg == 0)
 562                 return 0;

the function ip4ip6_err() return directly. so even though you add "break;"
statement for this case, the redirect message will not be handled.

> 
>> @@ -637,8 +637,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);
>>  
> 
> We absolutely must run the ipv4 dst_ops redirect handler here so you must
> keep this code around as well.
> 

Because the Redirect Message is sent to tunnel entry-point, so the target address in
Redirect ICMPv6 Message is an ipv6 address, then we could not run the ipv4 dst_ops 
redirect handler here.

Thanks,
  Duan

> The only change you need to make is to add the missing break;
> statement to ip4ip6_err() and then also add appropriate NDISC_REDIRECT
> handling to ip6ip6_err().

^ permalink raw reply

* [PATCH ] net: raw: do not report ICMP redirects to user space
From: Duan Jiong @ 2013-09-20 10:21 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

From: Duan Jiong <duanj.fnst@cn.fujitsu.com>

Redirect isn't an error condition, it should leave
the error handler without touching the socket.

Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
---
 net/ipv4/raw.c | 4 +++-
 net/ipv6/raw.c | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index bfec521..193db03 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -218,8 +218,10 @@ static void raw_err(struct sock *sk, struct sk_buff *skb, u32 info)
 
 	if (type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED)
 		ipv4_sk_update_pmtu(skb, sk, info);
-	else if (type == ICMP_REDIRECT)
+	else if (type == ICMP_REDIRECT) {
 		ipv4_sk_redirect(skb, sk);
+		return;
+	}
 
 	/* Report error on raw socket, if:
 	   1. User requested ip_recverr.
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index 58916bb..a4ed241 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -335,8 +335,10 @@ 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)
+	if (type == NDISC_REDIRECT) {
 		ip6_sk_redirect(skb, sk);
+		return;
+	}
 	if (np->recverr) {
 		u8 *payload = skb->data;
 		if (!inet->hdrincl)
-- 
1.8.3.1

^ permalink raw reply related

* [PATCH ] net: udp: do not report ICMP redirects to user space
From: Duan Jiong @ 2013-09-20 10:20 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

From: Duan Jiong <duanj.fnst@cn.fujitsu.com>

Redirect isn't an error condition, it should leave
the error handler without touching the socket.

Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
---
 net/ipv4/udp.c | 2 +-
 net/ipv6/udp.c | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 74d2c95..0ca44df 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -658,7 +658,7 @@ void __udp4_lib_err(struct sk_buff *skb, u32 info, struct udp_table *udptable)
 		break;
 	case ICMP_REDIRECT:
 		ipv4_sk_redirect(skb, sk);
-		break;
+		goto out;
 	}
 
 	/*
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index f405815..72b7eaa 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -525,8 +525,10 @@ 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)
+	if (type == NDISC_REDIRECT) {
 		ip6_sk_redirect(skb, sk);
+		goto out;
+	}
 
 	np = inet6_sk(sk);
 
-- 
1.8.3.1

^ permalink raw reply related

* Re: [GIT PULL 0/5] IPVS fixes for v3.12
From: Pablo Neira Ayuso @ 2013-09-20 10:07 UTC (permalink / raw)
  To: Simon Horman
  Cc: lvs-devel, netdev, netfilter-devel, Wensong Zhang,
	Julian Anastasov
In-Reply-To: <1379533542-9891-1-git-send-email-horms@verge.net.au>

On Wed, Sep 18, 2013 at 02:45:37PM -0500, Simon Horman wrote:
> please consider the following fixes for IPVS for v3.12.
> 
> The following changes since commit 61c5923a2f2d8ab98a1e3c76f17e0f4a871ec75b:
> 
>   Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf (2013-09-17 20:22:53 -0400)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/horms/ipvs.git tags/ipvs-fixes-for-v3.12

Pulled, thanks Simon.

^ permalink raw reply

* RE: [PATCH net-next v4] Don't destroy the netdev until the vif is shut down
From: Paul Durrant @ 2013-09-20  8:10 UTC (permalink / raw)
  To: David Miller
  Cc: xen-devel@lists.xen.org, netdev@vger.kernel.org, David Vrabel,
	Wei Liu, Ian Campbell
In-Reply-To: <20130919.140513.2047786411565716987.davem@davemloft.net>

> -----Original Message-----
> From: David Miller [mailto:davem@davemloft.net]
> Sent: 19 September 2013 19:05
> To: Paul Durrant
> Cc: xen-devel@lists.xen.org; netdev@vger.kernel.org; David Vrabel; Wei Liu;
> Ian Campbell
> Subject: Re: [PATCH net-next v4] Don't destroy the netdev until the vif is
> shut down
> 
> From: Paul Durrant <paul.durrant@citrix.com>
> Date: Tue, 17 Sep 2013 17:46:08 +0100
> 
> > Without this patch, if a frontend cycles through states Closing
> > and Closed (which Windows frontends need to do) then the netdev
> > will be destroyed and requires re-invocation of hotplug scripts
> > to restore state before the frontend can move to Connected. Thus
> > when udev is not in use the backend gets stuck in InitWait.
> >
> > With this patch, the netdev is left alone whilst the backend is
> > still online and is only de-registered and freed just prior to
> > destroying the vif (which is also nicely symmetrical with the
> > netdev allocation and registration being done during probe) so
> > no re-invocation of hotplug scripts is required.
> >
> > Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
> 
> I think all of the testing requests have been satisfied so I have
> applied this.
> 
> But _please_ write a more proper subject line in future patch
> submissions.  You have to provide a subsystem prefix in the
> subject line, here I added "xen-netback: ", otherwise someone
> skimming the shortlog has no idea what area of code this change
> touches.
> 

Ok. Will do. Thanks,

  Paul

^ permalink raw reply

* Re: [PATCH 1/2] remove all uses of printf's %n
From: Jiri Slaby @ 2013-09-20  8:08 UTC (permalink / raw)
  To: Tetsuo Handa, viro, xemul, remi.denis-courmont
  Cc: keescook, linux-kernel, netdev, linux-sctp, linux, akpm,
	dan.carpenter, geert, JBeulich, joe, kosaki.motohiro
In-Reply-To: <201309201309.GFB52620.OQOtSFLMJVHOFF@I-love.SAKURA.ne.jp>

On 09/20/2013 06:09 AM, Tetsuo Handa wrote:
> --- a/fs/proc/consoles.c
> +++ b/fs/proc/consoles.c
...
> @@ -47,11 +46,10 @@ static int show_console_dev(struct seq_file *m, void *v)
>  			con_flags[a].name : ' ';
>  	flags[a] = 0;
>  
> -	seq_printf(m, "%s%d%n", con->name, con->index, &len);
> -	len = 21 - len;
> -	if (len < 1)
> -		len = 1;
> -	seq_printf(m, "%*c%c%c%c (%s)", len, ' ', con->read ? 'R' : '-',
> +	seq_setwidth(m, 21 - 1);
> +	seq_printf(m, "%s%d", con->name, con->index);
> +	seq_pad(m, ' ');
> +	seq_printf(m, "%c%c%c (%s)", con->read ? 'R' : '-',
>  			con->write ? 'W' : '-', con->unblank ? 'U' : '-',
>  			flags);

Hello, do you really need seq_setwidth? It makes it really ugly...

Or do we need that all? Couldn't we simply have seq_printf_padded? Or
maybe some % modifier in seq_printf to pad the string?

> --- a/net/ipv4/fib_trie.c
> +++ b/net/ipv4/fib_trie.c
...
> @@ -2548,15 +2549,15 @@ static int fib_route_seq_show(struct seq_file *seq, void *v)
>  					 (fi->fib_advmss ?
>  					  fi->fib_advmss + 40 : 0),
>  					 fi->fib_window,
> -					 fi->fib_rtt >> 3, &len);
> +					 fi->fib_rtt >> 3);
>  			else
>  				seq_printf(seq,
>  					 "*\t%08X\t%08X\t%04X\t%d\t%u\t"
> -					 "%d\t%08X\t%d\t%u\t%u%n",
> +					 "%d\t%08X\t%d\t%u\t%u",
>  					 prefix, 0, flags, 0, 0, 0,
> -					 mask, 0, 0, 0, &len);
> +					 mask, 0, 0, 0);
>  
> -			seq_printf(seq, "%*s\n", 127 - len, "");
> +			seq_pad(seq, '\n');

Hmm, seq_pad is unintuitive. I would say it pads the string by '\n'. Of
course it does not, but...

thanks,
-- 
js
suse labs

^ permalink raw reply

* Re: [PATCH] phy/micrel: Add suspend/resume support to Micrel PHYs
From: Nicolas Ferre @ 2013-09-20  7:37 UTC (permalink / raw)
  To: David Miller
  Cc: netdev, b.brezillon, f.fainelli, linux-kernel, linux-arm-kernel,
	patrice.vilchez, david.choi
In-Reply-To: <20130919.140829.372011462903870193.davem@davemloft.net>

On 19/09/2013 20:08, David Miller :
> From: Nicolas Ferre <nicolas.ferre@atmel.com>
> Date: Thu, 19 Sep 2013 19:40:48 +0200
>
>> From: Patrice Vilchez <patrice.vilchez@atmel.com>
>>
>> All supported Micrel PHYs implement the standard "power down" bit 11 of BMCR,
>> so this patch adds support using the generic genphy_{suspend,resume} functions.
>>
>> Signed-off-by: Patrice Vilchez <patrice.vilchez@atmel.com>
>> [b.brezillon@overkiz.com: adapt to newer kernel and generalize to other phys]
>> Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
>> [nicolas.ferre@atmel.com: commit message modification]
>> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
>> Cc: David J. Choi <david.choi@micrel.com>
>
> What's the difference between this patch and the one you sent 60
> seconds beforehand?

No difference, just the addition of Boris in the CC list.
He was missing in the previous one despite his presence in the 
"Signed-off-by" tag. I tried to stop "git send-email" before it can 
complete but I hit "Ctrl-c" too late it seems...

Sorry for the noise.

Bye,
-- 
Nicolas Ferre

^ permalink raw reply

* Fw: [Bug 61681] New: Incoming TCP4 connections fail to start, don't get past SYN_RECV and then quickly disappear
From: Stephen Hemminger @ 2013-09-20  5:18 UTC (permalink / raw)
  To: netdev



Begin forwarded message:

Date: Thu, 19 Sep 2013 09:42:15 -0700
From: "bugzilla-daemon@bugzilla.kernel.org" <bugzilla-daemon@bugzilla.kernel.org>
To: "stephen@networkplumber.org" <stephen@networkplumber.org>
Subject: [Bug 61681] New: Incoming TCP4 connections fail to start, don't get past SYN_RECV and then quickly disappear


https://bugzilla.kernel.org/show_bug.cgi?id=61681

            Bug ID: 61681
           Summary: Incoming TCP4 connections fail to start, don't get
                    past SYN_RECV and then quickly disappear
           Product: Networking
           Version: 2.5
    Kernel Version: Linux xxxxxx 3.4.57-48.42.amzn1.x86_64 #1 SMP Mon Aug
                    12 21:43:36 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
          Hardware: IA-64
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: IPV4
          Assignee: shemminger@linux-foundation.org
          Reporter: dcrooke@gmail.com
        Regression: No

This bug appears to be very rare, but entirely real, and it dates back a long
time. I tried to debug it thoroughly looking at both kernel and webserver
settings, and then got down to looking at netstat.

The Linux kernel can sometimes get into a state where it fails to complete
approx 98% of incoming TCP connection attempts, and only correctly processes
about 2%. These numbers may be relevant as others have posted finding the same
"1 in 50" ratio on much older kernels over the years.

I did not get a chance to capture traffic with iptables / pcap / Wireshark
(production box so we gave up quickly and tried a reboot) but other folks with
the same issue indicate that Linux is sending the wrong remote sequence number
back in the SYN-ACK packet, and the client simply drops it. My experience is
that the half formed connection is torn down almost immediately - I was running
netstat in a continuous loop to see this, others have observed that their
clients send RST in response to the malformed SYN-ACK.

http://serverfault.com/questions/297134/server-not-sending-a-syn-ack-packet-in-response-to-a-syn-packet

http://ask.wireshark.org/questions/23885/rst-after-syn-ack

For us, the problem went away on a reboot and so far has stayed away, so I am
wondering if it is a factor of cumulative traffic but TCP sequence number
wraparound on the Linux end shouldn't cause this afaict, it should be simply
replying to the client with the sequence number that came in the SYN packet.

A number of people have had very similar looking issues due to broken
multi-path network config or a broken NAT device. Obviously this is not the
case here, Amazon knows how to do IT, this box only has one interface, and in
any case the Linux kernel is still responsible for the sequence number it
replies with.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply

* Re: [PATCH 1/2] remove all uses of printf's %n
From: Kees Cook @ 2013-09-20  4:53 UTC (permalink / raw)
  To: Joe Perches
  Cc: Tetsuo Handa, Jiri Slaby, Al Viro, Pavel Emelyanov,
	remi.denis-courmont, LKML, netdev, linux-sctp, George Spelvin,
	Andrew Morton, Dan Carpenter, Geert Uytterhoeven, Jan Beulich,
	Motohiro KOSAKI
In-Reply-To: <1379650985.2021.12.camel@joe-AO722>

On Thu, Sep 19, 2013 at 9:23 PM, Joe Perches <joe@perches.com> wrote:
> On Fri, 2013-09-20 at 13:09 +0900, Tetsuo Handa wrote:
>> Hello.
>
> Tetsuo-san:
>
>> We are discussing about removal of %n support from vsnprintf() at
>> https://lkml.org/lkml/2013/9/16/52 , and you are using %n in seq_printf().
>
> Well, I'm not using (mere alcohol isn't using, right?)
> but I still have the same question for Al.
>
> Are there any races here?

All the call sites I examined were linear. FWIW, I didn't see any races.

-Kees

>
>> I posted https://lkml.org/lkml/diff/2013/9/19/53/1 which introduces
>> seq_setwidth() / seq_pad() which can avoid use of %n in seq_printf().
>
> I still think adding last_len, last_rtn
> is sensible.
>
>



-- 
Kees Cook
Chrome OS Security

^ permalink raw reply

* Re: [PATCH 1/2] remove all uses of printf's %n
From: Joe Perches @ 2013-09-20  4:23 UTC (permalink / raw)
  To: Tetsuo Handa
  Cc: jslaby, viro, xemul, remi.denis-courmont, keescook, linux-kernel,
	netdev, linux-sctp, linux, akpm, dan.carpenter, geert, JBeulich,
	kosaki.motohiro
In-Reply-To: <201309201309.GFB52620.OQOtSFLMJVHOFF@I-love.SAKURA.ne.jp>

On Fri, 2013-09-20 at 13:09 +0900, Tetsuo Handa wrote:
> Hello.

Tetsuo-san:

> We are discussing about removal of %n support from vsnprintf() at
> https://lkml.org/lkml/2013/9/16/52 , and you are using %n in seq_printf().

Well, I'm not using (mere alcohol isn't using, right?)
but I still have the same question for Al.

Are there any races here?

> I posted https://lkml.org/lkml/diff/2013/9/19/53/1 which introduces
> seq_setwidth() / seq_pad() which can avoid use of %n in seq_printf().

I still think adding last_len, last_rtn
is sensible.

^ permalink raw reply

* Re: [PATCH 1/2] remove all uses of printf's %n
From: Tetsuo Handa @ 2013-09-20  4:09 UTC (permalink / raw)
  To: jslaby, viro, xemul, remi.denis-courmont
  Cc: keescook, linux-kernel, netdev, linux-sctp, linux, akpm,
	dan.carpenter, geert, JBeulich, joe, kosaki.motohiro
In-Reply-To: <CAGXu5jK_D1BJOQr=1A-UFrpM5Ad+Qu894HT_XjkZh4EmsbCkTQ@mail.gmail.com>

Hello.

We are discussing about removal of %n support from vsnprintf() at
https://lkml.org/lkml/2013/9/16/52 , and you are using %n in seq_printf().

I posted https://lkml.org/lkml/diff/2013/9/19/53/1 which introduces
seq_setwidth() / seq_pad() which can avoid use of %n in seq_printf().
Assuming that this patch is merged, would you confirm that I didn't break
your code with below patch?

Regards.
----------------------------------------
>From f8b60ebe3971901b93dedb8eee0f85b60d0fdc5f Mon Sep 17 00:00:00 2001
From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Date: Fri, 20 Sep 2013 12:01:07 +0900
Subject: [PATCH] Remove "%n" usage from seq_file users.

All seq_printf() users are using "%n" for calculating padding size, convert
them to use seq_setwidth() / seq_pad() pair.

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
---
 fs/proc/consoles.c   |   10 ++++------
 fs/proc/nommu.c      |   12 +++++-------
 fs/proc/task_mmu.c   |   20 ++++++--------------
 fs/proc/task_nommu.c |   19 ++++++-------------
 net/ipv4/fib_trie.c  |   13 +++++++------
 net/ipv4/ping.c      |   15 +++++++--------
 net/ipv4/tcp_ipv4.c  |   33 +++++++++++++++------------------
 net/ipv4/udp.c       |   15 +++++++--------
 net/phonet/socket.c  |   24 +++++++++++-------------
 net/sctp/objcnt.c    |    9 +++++----
 10 files changed, 73 insertions(+), 97 deletions(-)

diff --git a/fs/proc/consoles.c b/fs/proc/consoles.c
index b701eaa..51942d5 100644
--- a/fs/proc/consoles.c
+++ b/fs/proc/consoles.c
@@ -29,7 +29,6 @@ static int show_console_dev(struct seq_file *m, void *v)
 	char flags[ARRAY_SIZE(con_flags) + 1];
 	struct console *con = v;
 	unsigned int a;
-	int len;
 	dev_t dev = 0;
 
 	if (con->device) {
@@ -47,11 +46,10 @@ static int show_console_dev(struct seq_file *m, void *v)
 			con_flags[a].name : ' ';
 	flags[a] = 0;
 
-	seq_printf(m, "%s%d%n", con->name, con->index, &len);
-	len = 21 - len;
-	if (len < 1)
-		len = 1;
-	seq_printf(m, "%*c%c%c%c (%s)", len, ' ', con->read ? 'R' : '-',
+	seq_setwidth(m, 21 - 1);
+	seq_printf(m, "%s%d", con->name, con->index);
+	seq_pad(m, ' ');
+	seq_printf(m, "%c%c%c (%s)", con->read ? 'R' : '-',
 			con->write ? 'W' : '-', con->unblank ? 'U' : '-',
 			flags);
 	if (dev)
diff --git a/fs/proc/nommu.c b/fs/proc/nommu.c
index ccfd99b..5f9bc8a 100644
--- a/fs/proc/nommu.c
+++ b/fs/proc/nommu.c
@@ -39,7 +39,7 @@ static int nommu_region_show(struct seq_file *m, struct vm_region *region)
 	unsigned long ino = 0;
 	struct file *file;
 	dev_t dev = 0;
-	int flags, len;
+	int flags;
 
 	flags = region->vm_flags;
 	file = region->vm_file;
@@ -50,8 +50,9 @@ static int nommu_region_show(struct seq_file *m, struct vm_region *region)
 		ino = inode->i_ino;
 	}
 
+	seq_setwidth(m, 25 + sizeof(void *) * 6 - 1);
 	seq_printf(m,
-		   "%08lx-%08lx %c%c%c%c %08llx %02x:%02x %lu %n",
+		   "%08lx-%08lx %c%c%c%c %08llx %02x:%02x %lu ",
 		   region->vm_start,
 		   region->vm_end,
 		   flags & VM_READ ? 'r' : '-',
@@ -59,13 +60,10 @@ static int nommu_region_show(struct seq_file *m, struct vm_region *region)
 		   flags & VM_EXEC ? 'x' : '-',
 		   flags & VM_MAYSHARE ? flags & VM_SHARED ? 'S' : 's' : 'p',
 		   ((loff_t)region->vm_pgoff) << PAGE_SHIFT,
-		   MAJOR(dev), MINOR(dev), ino, &len);
+		   MAJOR(dev), MINOR(dev), ino);
 
 	if (file) {
-		len = 25 + sizeof(void *) * 6 - len;
-		if (len < 1)
-			len = 1;
-		seq_printf(m, "%*c", len, ' ');
+		seq_pad(m, ' ');
 		seq_path(m, &file->f_path, "");
 	}
 
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 7366e9d..cc24165 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -83,14 +83,6 @@ unsigned long task_statm(struct mm_struct *mm,
 	return mm->total_vm;
 }
 
-static void pad_len_spaces(struct seq_file *m, int len)
-{
-	len = 25 + sizeof(void*) * 6 - len;
-	if (len < 1)
-		len = 1;
-	seq_printf(m, "%*c", len, ' ');
-}
-
 #ifdef CONFIG_NUMA
 /*
  * These functions are for numa_maps but called in generic **maps seq_file
@@ -268,7 +260,6 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid)
 	unsigned long long pgoff = 0;
 	unsigned long start, end;
 	dev_t dev = 0;
-	int len;
 	const char *name = NULL;
 
 	if (file) {
@@ -286,7 +277,8 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid)
 	if (stack_guard_page_end(vma, end))
 		end -= PAGE_SIZE;
 
-	seq_printf(m, "%08lx-%08lx %c%c%c%c %08llx %02x:%02x %lu %n",
+	seq_setwidth(m, 25 + sizeof(void *) * 6 - 1);
+	seq_printf(m, "%08lx-%08lx %c%c%c%c %08llx %02x:%02x %lu ",
 			start,
 			end,
 			flags & VM_READ ? 'r' : '-',
@@ -294,14 +286,14 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid)
 			flags & VM_EXEC ? 'x' : '-',
 			flags & VM_MAYSHARE ? 's' : 'p',
 			pgoff,
-			MAJOR(dev), MINOR(dev), ino, &len);
+			MAJOR(dev), MINOR(dev), ino);
 
 	/*
 	 * Print the dentry name for named mappings, and a
 	 * special [heap] marker for the heap:
 	 */
 	if (file) {
-		pad_len_spaces(m, len);
+		seq_pad(m, ' ');
 		seq_path(m, &file->f_path, "\n");
 		goto done;
 	}
@@ -333,7 +325,7 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid)
 				name = "[stack]";
 			} else {
 				/* Thread stack in /proc/PID/maps */
-				pad_len_spaces(m, len);
+				seq_pad(m, ' ');
 				seq_printf(m, "[stack:%d]", tid);
 			}
 		}
@@ -341,7 +333,7 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid)
 
 done:
 	if (name) {
-		pad_len_spaces(m, len);
+		seq_pad(m, ' ');
 		seq_puts(m, name);
 	}
 	seq_putc(m, '\n');
diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c
index 56123a6..678455d 100644
--- a/fs/proc/task_nommu.c
+++ b/fs/proc/task_nommu.c
@@ -123,14 +123,6 @@ unsigned long task_statm(struct mm_struct *mm,
 	return size;
 }
 
-static void pad_len_spaces(struct seq_file *m, int len)
-{
-	len = 25 + sizeof(void*) * 6 - len;
-	if (len < 1)
-		len = 1;
-	seq_printf(m, "%*c", len, ' ');
-}
-
 /*
  * display a single VMA to a sequenced file
  */
@@ -142,7 +134,7 @@ static int nommu_vma_show(struct seq_file *m, struct vm_area_struct *vma,
 	unsigned long ino = 0;
 	struct file *file;
 	dev_t dev = 0;
-	int flags, len;
+	int flags;
 	unsigned long long pgoff = 0;
 
 	flags = vma->vm_flags;
@@ -155,8 +147,9 @@ static int nommu_vma_show(struct seq_file *m, struct vm_area_struct *vma,
 		pgoff = (loff_t)vma->vm_pgoff << PAGE_SHIFT;
 	}
 
+	seq_setwidth(m, 25 + sizeof(void *) * 6 - 1);
 	seq_printf(m,
-		   "%08lx-%08lx %c%c%c%c %08llx %02x:%02x %lu %n",
+		   "%08lx-%08lx %c%c%c%c %08llx %02x:%02x %lu ",
 		   vma->vm_start,
 		   vma->vm_end,
 		   flags & VM_READ ? 'r' : '-',
@@ -164,16 +157,16 @@ static int nommu_vma_show(struct seq_file *m, struct vm_area_struct *vma,
 		   flags & VM_EXEC ? 'x' : '-',
 		   flags & VM_MAYSHARE ? flags & VM_SHARED ? 'S' : 's' : 'p',
 		   pgoff,
-		   MAJOR(dev), MINOR(dev), ino, &len);
+		   MAJOR(dev), MINOR(dev), ino);
 
 	if (file) {
-		pad_len_spaces(m, len);
+		seq_pad(m, ' ');
 		seq_path(m, &file->f_path, "");
 	} else if (mm) {
 		pid_t tid = vm_is_stack(priv->task, vma, is_pid);
 
 		if (tid != 0) {
-			pad_len_spaces(m, len);
+			seq_pad(m, ' ');
 			/*
 			 * Thread stack in /proc/PID/task/TID/maps or
 			 * the main process stack.
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index 3df6d3e..b1af50e 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -2530,16 +2530,17 @@ static int fib_route_seq_show(struct seq_file *seq, void *v)
 		list_for_each_entry_rcu(fa, &li->falh, fa_list) {
 			const struct fib_info *fi = fa->fa_info;
 			unsigned int flags = fib_flag_trans(fa->fa_type, mask, fi);
-			int len;
 
 			if (fa->fa_type == RTN_BROADCAST
 			    || fa->fa_type == RTN_MULTICAST)
 				continue;
 
+			seq_setwidth(seq, 127);
+
 			if (fi)
 				seq_printf(seq,
 					 "%s\t%08X\t%08X\t%04X\t%d\t%u\t"
-					 "%d\t%08X\t%d\t%u\t%u%n",
+					 "%d\t%08X\t%d\t%u\t%u",
 					 fi->fib_dev ? fi->fib_dev->name : "*",
 					 prefix,
 					 fi->fib_nh->nh_gw, flags, 0, 0,
@@ -2548,15 +2549,15 @@ static int fib_route_seq_show(struct seq_file *seq, void *v)
 					 (fi->fib_advmss ?
 					  fi->fib_advmss + 40 : 0),
 					 fi->fib_window,
-					 fi->fib_rtt >> 3, &len);
+					 fi->fib_rtt >> 3);
 			else
 				seq_printf(seq,
 					 "*\t%08X\t%08X\t%04X\t%d\t%u\t"
-					 "%d\t%08X\t%d\t%u\t%u%n",
+					 "%d\t%08X\t%d\t%u\t%u",
 					 prefix, 0, flags, 0, 0, 0,
-					 mask, 0, 0, 0, &len);
+					 mask, 0, 0, 0);
 
-			seq_printf(seq, "%*s\n", 127 - len, "");
+			seq_pad(seq, '\n');
 		}
 	}
 
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
index d7d9882..94cc685 100644
--- a/net/ipv4/ping.c
+++ b/net/ipv4/ping.c
@@ -1073,7 +1073,7 @@ void ping_seq_stop(struct seq_file *seq, void *v)
 EXPORT_SYMBOL_GPL(ping_seq_stop);
 
 static void ping_v4_format_sock(struct sock *sp, struct seq_file *f,
-		int bucket, int *len)
+		int bucket)
 {
 	struct inet_sock *inet = inet_sk(sp);
 	__be32 dest = inet->inet_daddr;
@@ -1082,7 +1082,7 @@ static void ping_v4_format_sock(struct sock *sp, struct seq_file *f,
 	__u16 srcp = ntohs(inet->inet_sport);
 
 	seq_printf(f, "%5d: %08X:%04X %08X:%04X"
-		" %02X %08X:%08X %02X:%08lX %08X %5u %8d %lu %d %pK %d%n",
+		" %02X %08X:%08X %02X:%08lX %08X %5u %8d %lu %d %pK %d",
 		bucket, src, srcp, dest, destp, sp->sk_state,
 		sk_wmem_alloc_get(sp),
 		sk_rmem_alloc_get(sp),
@@ -1090,23 +1090,22 @@ static void ping_v4_format_sock(struct sock *sp, struct seq_file *f,
 		from_kuid_munged(seq_user_ns(f), sock_i_uid(sp)),
 		0, sock_i_ino(sp),
 		atomic_read(&sp->sk_refcnt), sp,
-		atomic_read(&sp->sk_drops), len);
+		atomic_read(&sp->sk_drops));
 }
 
 static int ping_v4_seq_show(struct seq_file *seq, void *v)
 {
+	seq_setwidth(seq, 127);
 	if (v == SEQ_START_TOKEN)
-		seq_printf(seq, "%-127s\n",
-			   "  sl  local_address rem_address   st tx_queue "
+		seq_puts(seq, "  sl  local_address rem_address   st tx_queue "
 			   "rx_queue tr tm->when retrnsmt   uid  timeout "
 			   "inode ref pointer drops");
 	else {
 		struct ping_iter_state *state = seq->private;
-		int len;
 
-		ping_v4_format_sock(v, seq, state->bucket, &len);
-		seq_printf(seq, "%*s\n", 127 - len, "");
+		ping_v4_format_sock(v, seq, state->bucket);
 	}
+	seq_pad(seq, '\n');
 	return 0;
 }
 
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index b14266b..2948b76 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -2598,13 +2598,13 @@ void tcp_proc_unregister(struct net *net, struct tcp_seq_afinfo *afinfo)
 EXPORT_SYMBOL(tcp_proc_unregister);
 
 static void get_openreq4(const struct sock *sk, const struct request_sock *req,
-			 struct seq_file *f, int i, kuid_t uid, int *len)
+			 struct seq_file *f, int i, kuid_t uid)
 {
 	const struct inet_request_sock *ireq = inet_rsk(req);
 	long delta = req->expires - jiffies;
 
 	seq_printf(f, "%4d: %08X:%04X %08X:%04X"
-		" %02X %08X:%08X %02X:%08lX %08X %5u %8d %u %d %pK%n",
+		" %02X %08X:%08X %02X:%08lX %08X %5u %8d %u %d %pK",
 		i,
 		ireq->loc_addr,
 		ntohs(inet_sk(sk)->inet_sport),
@@ -2619,11 +2619,10 @@ static void get_openreq4(const struct sock *sk, const struct request_sock *req,
 		0,  /* non standard timer */
 		0, /* open_requests have no inode */
 		atomic_read(&sk->sk_refcnt),
-		req,
-		len);
+		req);
 }
 
-static void get_tcp4_sock(struct sock *sk, struct seq_file *f, int i, int *len)
+static void get_tcp4_sock(struct sock *sk, struct seq_file *f, int i)
 {
 	int timer_active;
 	unsigned long timer_expires;
@@ -2662,7 +2661,7 @@ static void get_tcp4_sock(struct sock *sk, struct seq_file *f, int i, int *len)
 		rx_queue = max_t(int, tp->rcv_nxt - tp->copied_seq, 0);
 
 	seq_printf(f, "%4d: %08X:%04X %08X:%04X %02X %08X:%08X %02X:%08lX "
-			"%08X %5u %8d %lu %d %pK %lu %lu %u %u %d%n",
+			"%08X %5u %8d %lu %d %pK %lu %lu %u %u %d",
 		i, src, srcp, dest, destp, sk->sk_state,
 		tp->write_seq - tp->snd_una,
 		rx_queue,
@@ -2679,12 +2678,11 @@ static void get_tcp4_sock(struct sock *sk, struct seq_file *f, int i, int *len)
 		tp->snd_cwnd,
 		sk->sk_state == TCP_LISTEN ?
 		    (fastopenq ? fastopenq->max_qlen : 0) :
-		    (tcp_in_initial_slowstart(tp) ? -1 : tp->snd_ssthresh),
-		len);
+		    (tcp_in_initial_slowstart(tp) ? -1 : tp->snd_ssthresh));
 }
 
 static void get_timewait4_sock(const struct inet_timewait_sock *tw,
-			       struct seq_file *f, int i, int *len)
+			       struct seq_file *f, int i)
 {
 	__be32 dest, src;
 	__u16 destp, srcp;
@@ -2696,10 +2694,10 @@ static void get_timewait4_sock(const struct inet_timewait_sock *tw,
 	srcp  = ntohs(tw->tw_sport);
 
 	seq_printf(f, "%4d: %08X:%04X %08X:%04X"
-		" %02X %08X:%08X %02X:%08lX %08X %5d %8d %d %d %pK%n",
+		" %02X %08X:%08X %02X:%08lX %08X %5d %8d %d %d %pK",
 		i, src, srcp, dest, destp, tw->tw_substate, 0, 0,
 		3, jiffies_delta_to_clock_t(delta), 0, 0, 0, 0,
-		atomic_read(&tw->tw_refcnt), tw, len);
+		atomic_read(&tw->tw_refcnt), tw);
 }
 
 #define TMPSZ 150
@@ -2707,11 +2705,10 @@ static void get_timewait4_sock(const struct inet_timewait_sock *tw,
 static int tcp4_seq_show(struct seq_file *seq, void *v)
 {
 	struct tcp_iter_state *st;
-	int len;
 
+	seq_setwidth(seq, TMPSZ - 1);
 	if (v == SEQ_START_TOKEN) {
-		seq_printf(seq, "%-*s\n", TMPSZ - 1,
-			   "  sl  local_address rem_address   st tx_queue "
+		seq_puts(seq, "  sl  local_address rem_address   st tx_queue "
 			   "rx_queue tr tm->when retrnsmt   uid  timeout "
 			   "inode");
 		goto out;
@@ -2721,17 +2718,17 @@ static int tcp4_seq_show(struct seq_file *seq, void *v)
 	switch (st->state) {
 	case TCP_SEQ_STATE_LISTENING:
 	case TCP_SEQ_STATE_ESTABLISHED:
-		get_tcp4_sock(v, seq, st->num, &len);
+		get_tcp4_sock(v, seq, st->num);
 		break;
 	case TCP_SEQ_STATE_OPENREQ:
-		get_openreq4(st->syn_wait_sk, v, seq, st->num, st->uid, &len);
+		get_openreq4(st->syn_wait_sk, v, seq, st->num, st->uid);
 		break;
 	case TCP_SEQ_STATE_TIME_WAIT:
-		get_timewait4_sock(v, seq, st->num, &len);
+		get_timewait4_sock(v, seq, st->num);
 		break;
 	}
-	seq_printf(seq, "%*s\n", TMPSZ - 1 - len, "");
 out:
+	seq_pad(seq, '\n');
 	return 0;
 }
 
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 74d2c95..31c132c 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -2150,7 +2150,7 @@ EXPORT_SYMBOL(udp_proc_unregister);
 
 /* ------------------------------------------------------------------------ */
 static void udp4_format_sock(struct sock *sp, struct seq_file *f,
-		int bucket, int *len)
+		int bucket)
 {
 	struct inet_sock *inet = inet_sk(sp);
 	__be32 dest = inet->inet_daddr;
@@ -2159,7 +2159,7 @@ static void udp4_format_sock(struct sock *sp, struct seq_file *f,
 	__u16 srcp	  = ntohs(inet->inet_sport);
 
 	seq_printf(f, "%5d: %08X:%04X %08X:%04X"
-		" %02X %08X:%08X %02X:%08lX %08X %5u %8d %lu %d %pK %d%n",
+		" %02X %08X:%08X %02X:%08lX %08X %5u %8d %lu %d %pK %d",
 		bucket, src, srcp, dest, destp, sp->sk_state,
 		sk_wmem_alloc_get(sp),
 		sk_rmem_alloc_get(sp),
@@ -2167,23 +2167,22 @@ static void udp4_format_sock(struct sock *sp, struct seq_file *f,
 		from_kuid_munged(seq_user_ns(f), sock_i_uid(sp)),
 		0, sock_i_ino(sp),
 		atomic_read(&sp->sk_refcnt), sp,
-		atomic_read(&sp->sk_drops), len);
+		atomic_read(&sp->sk_drops));
 }
 
 int udp4_seq_show(struct seq_file *seq, void *v)
 {
+	seq_setwidth(seq, 127);
 	if (v == SEQ_START_TOKEN)
-		seq_printf(seq, "%-127s\n",
-			   "  sl  local_address rem_address   st tx_queue "
+		seq_puts(seq, "  sl  local_address rem_address   st tx_queue "
 			   "rx_queue tr tm->when retrnsmt   uid  timeout "
 			   "inode ref pointer drops");
 	else {
 		struct udp_iter_state *state = seq->private;
-		int len;
 
-		udp4_format_sock(v, seq, state->bucket, &len);
-		seq_printf(seq, "%*s\n", 127 - len, "");
+		udp4_format_sock(v, seq, state->bucket);
 	}
+	seq_pad(seq, '\n');
 	return 0;
 }
 
diff --git a/net/phonet/socket.c b/net/phonet/socket.c
index 77e38f7..008214a 100644
--- a/net/phonet/socket.c
+++ b/net/phonet/socket.c
@@ -595,26 +595,25 @@ static void pn_sock_seq_stop(struct seq_file *seq, void *v)
 
 static int pn_sock_seq_show(struct seq_file *seq, void *v)
 {
-	int len;
-
+	seq_setwidth(seq, 127);
 	if (v == SEQ_START_TOKEN)
-		seq_printf(seq, "%s%n", "pt  loc  rem rs st tx_queue rx_queue "
-			"  uid inode ref pointer drops", &len);
+		seq_puts(seq, "pt  loc  rem rs st tx_queue rx_queue "
+			"  uid inode ref pointer drops");
 	else {
 		struct sock *sk = v;
 		struct pn_sock *pn = pn_sk(sk);
 
 		seq_printf(seq, "%2d %04X:%04X:%02X %02X %08X:%08X %5d %lu "
-			"%d %pK %d%n",
+			"%d %pK %d",
 			sk->sk_protocol, pn->sobject, pn->dobject,
 			pn->resource, sk->sk_state,
 			sk_wmem_alloc_get(sk), sk_rmem_alloc_get(sk),
 			from_kuid_munged(seq_user_ns(seq), sock_i_uid(sk)),
 			sock_i_ino(sk),
 			atomic_read(&sk->sk_refcnt), sk,
-			atomic_read(&sk->sk_drops), &len);
+			atomic_read(&sk->sk_drops));
 	}
-	seq_printf(seq, "%*s\n", 127 - len, "");
+	seq_pad(seq, '\n');
 	return 0;
 }
 
@@ -785,20 +784,19 @@ static void pn_res_seq_stop(struct seq_file *seq, void *v)
 
 static int pn_res_seq_show(struct seq_file *seq, void *v)
 {
-	int len;
-
+	seq_setwidth(seq, 63);
 	if (v == SEQ_START_TOKEN)
-		seq_printf(seq, "%s%n", "rs   uid inode", &len);
+		seq_puts(seq, "rs   uid inode");
 	else {
 		struct sock **psk = v;
 		struct sock *sk = *psk;
 
-		seq_printf(seq, "%02X %5u %lu%n",
+		seq_printf(seq, "%02X %5u %lu",
 			   (int) (psk - pnres.sk),
 			   from_kuid_munged(seq_user_ns(seq), sock_i_uid(sk)),
-			   sock_i_ino(sk), &len);
+			   sock_i_ino(sk));
 	}
-	seq_printf(seq, "%*s\n", 63 - len, "");
+	seq_pad(seq, '\n');
 	return 0;
 }
 
diff --git a/net/sctp/objcnt.c b/net/sctp/objcnt.c
index 5ea573b..647396b 100644
--- a/net/sctp/objcnt.c
+++ b/net/sctp/objcnt.c
@@ -79,12 +79,13 @@ static sctp_dbg_objcnt_entry_t sctp_dbg_objcnt[] = {
  */
 static int sctp_objcnt_seq_show(struct seq_file *seq, void *v)
 {
-	int i, len;
+	int i;
 
 	i = (int)*(loff_t *)v;
-	seq_printf(seq, "%s: %d%n", sctp_dbg_objcnt[i].label,
-				atomic_read(sctp_dbg_objcnt[i].counter), &len);
-	seq_printf(seq, "%*s\n", 127 - len, "");
+	seq_setwidth(seq, 127);
+	seq_printf(seq, "%s: %d", sctp_dbg_objcnt[i].label,
+				atomic_read(sctp_dbg_objcnt[i].counter));
+	seq_pad(seq, '\n');
 	return 0;
 }
 
-- 
1.7.1

^ permalink raw reply related

* Re: add ip to interface as primary ip address, not secondary ip when there is alreadly primary ip?
From: Vincent Li @ 2013-09-20  3:53 UTC (permalink / raw)
  To: Cong Wang; +Cc: netdev@vger.kernel.org
In-Reply-To: <l1gbs4$da2$1@ger.gmane.org>

yes, I found them too, they are for 'ip addr show' or 'ip addr list'
though, not for 'ip addr add' unless  I am missing something obvious.
care to clarify further ?

Vincent

On Thu, Sep 19, 2013 at 7:28 PM, Cong Wang <xiyou.wangcong@gmail.com> wrote:
> On Thu, 19 Sep 2013 at 16:54 GMT, Vincent Li <vincent.mc.li@gmail.com> wrote:
>> thanks for the pointer
>>
>> 'ip addr' indeed has flag IFA_F_SECONDARY for this, but it is not
>> available for 'ip addr add', so I made a simple patch for iproute2
>> ip/ipaddress.c as below:
>
> % git grep secondary ip/ipaddress.c
> ip/ipaddress.c: fprintf(stderr, "FLAG  := [ permanent | dynamic |
> secondary | primary |\n");
> ip/ipaddress.c:                 fprintf(fp, "secondary ");
> ip/ipaddress.c:static int print_addrinfo_secondary(const struct
> sockaddr_nl *who,
> ip/ipaddress.c:                         .filter =
> print_addrinfo_secondary,
> ip/ipaddress.c:         } else if (strcmp(*argv, "secondary") == 0 ||
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: add ip to interface as primary ip address, not secondary ip when there is alreadly primary ip?
From: Cong Wang @ 2013-09-20  2:28 UTC (permalink / raw)
  To: netdev
In-Reply-To: <CAK3+h2yWjswp6qrToMPbrQyuyCKkh5Yuuo6TeX8VhGQCGpCecw@mail.gmail.com>

On Thu, 19 Sep 2013 at 16:54 GMT, Vincent Li <vincent.mc.li@gmail.com> wrote:
> thanks for the pointer
>
> 'ip addr' indeed has flag IFA_F_SECONDARY for this, but it is not
> available for 'ip addr add', so I made a simple patch for iproute2
> ip/ipaddress.c as below:

% git grep secondary ip/ipaddress.c
ip/ipaddress.c: fprintf(stderr, "FLAG  := [ permanent | dynamic |
secondary | primary |\n");
ip/ipaddress.c:                 fprintf(fp, "secondary ");
ip/ipaddress.c:static int print_addrinfo_secondary(const struct
sockaddr_nl *who,
ip/ipaddress.c:                         .filter =
print_addrinfo_secondary,
ip/ipaddress.c:         } else if (strcmp(*argv, "secondary") == 0 ||

^ permalink raw reply

* Re: [ovs-dev] [PATCH v2.39 7/7] datapath: Add basic MPLS support to kernel
From: Pravin Shelar @ 2013-09-20  1:31 UTC (permalink / raw)
  To: Simon Horman; +Cc: dev@openvswitch.org, Ravi K, netdev, Isaku Yamahata
In-Reply-To: <20130919204214.GA2734@verge.net.au>

On Thu, Sep 19, 2013 at 1:45 PM, Simon Horman <horms@verge.net.au> wrote:
> On Wed, Sep 18, 2013 at 05:07:59PM -0500, Simon Horman wrote:
>> On Tue, Sep 17, 2013 at 11:38:18AM -0700, Pravin Shelar wrote:
>> > On Mon, Sep 9, 2013 at 12:20 AM, Simon Horman <horms@verge.net.au> wrote:
>> > > Allow datapath to recognize and extract MPLS labels into flow keys
>> > > and execute actions which push, pop, and set labels on packets.
>> > >
>> > > Based heavily on work by Leo Alterman, Ravi K, Isaku Yamahata and Joe Stringer.
>> > >
>> > > Cc: Ravi K <rkerur@gmail.com>
>> > > Cc: Leo Alterman <lalterman@nicira.com>
>> > > Cc: Isaku Yamahata <yamahata@valinux.co.jp>
>> > > Cc: Joe Stringer <joe@wand.net.nz>
>> > > Signed-off-by: Simon Horman <horms@verge.net.au>
>> > >
>> > > ---
>> > ....
>> > > diff --git a/datapath/datapath.h b/datapath/datapath.h
>> > > index 5d50dd4..babae3b 100644
>> > > --- a/datapath/datapath.h
>> > > +++ b/datapath/datapath.h
>> > > @@ -36,6 +36,10 @@
>> > >
>> > >  #define SAMPLE_ACTION_DEPTH 3
>> > >
>> > > +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)
>> > > +#define HAVE_INNER_PROTOCOL
>> > > +#endif
>> > > +
>> > >  /**
>> > >   * struct dp_stats_percpu - per-cpu packet processing statistics for a given
>> > >   * datapath.
>> > > @@ -93,11 +97,16 @@ struct datapath {
>> > >   * @pkt_key: The flow information extracted from the packet.  Must be nonnull.
>> > >   * @tun_key: Key for the tunnel that encapsulated this packet. NULL if the
>> > >   * packet is not being tunneled.
>> > > + * @inner_protocol: Provides a substitute for the skb->inner_protocol field on
>> > > + * kernels before 3.11.
>> > >   */
>> > >  struct ovs_skb_cb {
>> > >         struct sw_flow          *flow;
>> > >         struct sw_flow_key      *pkt_key;
>> > >         struct ovs_key_ipv4_tunnel  *tun_key;
>> > > +#ifndef HAVE_INNER_PROTOCOL
>> > > +       __be16                  inner_protocol;
>> > > +#endif
>> > >  };
>> > >  #define OVS_CB(skb) ((struct ovs_skb_cb *)(skb)->cb)
>> > >
>> > Can you move this to compat struct ovs_gso_cb {}
>>
>> I think that you are correct and inner_protocol needs
>> to be in struct ovs_gso_cb so that it can
>> be accessed via skb_network_protocol() from
>> rpl___skb_gso_segment().
>>
>> However I think it may also need to be present in struct ovs_cb
>> so that it can be set correctly.
>>
>> Currently it is set unconditionally
>> in ovs_execute_actions() and Jesse has suggested setting
>> it conditionally in pop_mpls() (which is called by do_execute_actions()).
>> But regardless it seems to me that the field would need to be available
>> in struct ovs_cb.
>
> Having reviewed the code once more I now notice that struct ovs_gso_cb
> contains struct ovs_skb_cb dp_cb. Whereas my previous assumption was
> that they were mutually exclusive.
>
> With this in mind I think it should be safe to use ovs_gso_cb from
> ovs_execute_actions() or do_execute_actions() but I would value
> your opinion on that.
>
> Conversely, if inner_protocol was left in struct ovs_skb_cb there should
> be no problem with accessing it from GSO code as the code currently does.
> So I am not sure that I see the value of moving it but I am happy to do
> so if you think it is safe and it is your preferred option.

right, access is not issue.
Value is the code in datapath.c, with compatibility, remains closer to
upstream ovs module. We have always tried to keep it that way.

^ permalink raw reply

* Re: [PATCH 01/51] DMA-API: provide a helper to set both DMA and coherent DMA masks
From: Ben Hutchings @ 2013-09-20  1:21 UTC (permalink / raw)
  To: Russell King
  Cc: alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	b43-dev-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	e1000-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-crypto-u79uwXL29TY76Z2rM5mHXA,
	linux-doc-u79uwXL29TY76Z2rM5mHXA,
	linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
	linux-ide-u79uwXL29TY76Z2rM5mHXA,
	linux-media-u79uwXL29TY76Z2rM5mHXA,
	linux-mmc-u79uwXL29TY76Z2rM5mHXA,
	linux-nvme-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-scsi-u79uwXL29TY76Z2rM5mHXA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA, Solarflare linux maintainers,
	uclinux-dist-devel-ZG0+EudsQA8dtHy/vicBwGD2FQJk+8+b, Rob Landley,
	Vinod Koul, Dan
In-Reply-To: <E1VMlja-0007fA-HU-eh5Bv4kxaXIANfyc6IWni62ZND6+EDdj@public.gmane.org>

On Thu, 2013-09-19 at 22:25 +0100, Russell King wrote:
> Provide a helper to set both the DMA and coherent DMA masks to the
> same value - this avoids duplicated code in a number of drivers,
> sometimes with buggy error handling, and also allows us identify
> which drivers do things differently.
> 
> Signed-off-by: Russell King <rmk+kernel-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
> ---
>  Documentation/DMA-API-HOWTO.txt |   37 ++++++++++++++++++++++---------------
>  Documentation/DMA-API.txt       |    8 ++++++++
>  include/linux/dma-mapping.h     |   14 ++++++++++++++
>  3 files changed, 44 insertions(+), 15 deletions(-)
> 
> diff --git a/Documentation/DMA-API-HOWTO.txt b/Documentation/DMA-API-HOWTO.txt
> index 14129f1..5e98303 100644
> --- a/Documentation/DMA-API-HOWTO.txt
> +++ b/Documentation/DMA-API-HOWTO.txt
[...]
> -dma_set_coherent_mask() will always be able to set the same or a
> -smaller mask as dma_set_mask(). However for the rare case that a
> +The coherent coherent mask will always be able to set the same or a
> +smaller mask as the streaming mask. However for the rare case that a
[...]

The new wording doesn't make sense; a mask doesn't set itself.  I would
suggest:

"The coherent mask can always be set to the same or a smaller mask than
the streaming mask."

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

--
To unsubscribe from this list: send the line "unsubscribe devicetree" 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: [PATCH] iproute2: bridge: document mdb
From: Cong Wang @ 2013-09-20  1:09 UTC (permalink / raw)
  To: netdev
In-Reply-To: <1379580086-31784-2-git-send-email-ppisar@redhat.com>

On Thu, 19 Sep 2013 at 08:41 GMT, Petr Písař <ppisar@redhat.com> wrote:
> This augments bridge(8) manual page with `bridge mdb' and `bridge
> monitor mdb' commands which have been added recently.
>
> Signed-off-by: Petr Písař <ppisar@redhat.com>

Acked-by: Cong Wang <amwang@redhat.com>

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox