Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next] packet: Fix compile error
From: Daniel Baluta @ 2013-03-19 22:01 UTC (permalink / raw)
  To: willemb, edumazet, davem, netdev; +Cc: Daniel Baluta

PACKET_FANOUT_ROLLOVER and PACKET_FANOUT_FLAG_ROLLOVER are not declared in
<tree>/usr/include/linux/if_packet.h together with the other PACKET_FANOUT_* macros
as one would expect. This causes the following compilation error:
<snip>
psock_fanout.c: In function ‘test_control_single’:
psock_fanout.c:230:23: error: ‘PACKET_FANOUT_ROLLOVER’ undeclared (first use in this function)
</snip>

Signed-off-by: Daniel Baluta <dbaluta@ixiacom.com>
---
 .../testing/selftests/net-afpacket/psock_fanout.c  |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/net-afpacket/psock_fanout.c b/tools/testing/selftests/net-afpacket/psock_fanout.c
index 09dbf93..c827415 100644
--- a/tools/testing/selftests/net-afpacket/psock_fanout.c
+++ b/tools/testing/selftests/net-afpacket/psock_fanout.c
@@ -63,6 +63,7 @@
 #define PACKET_FANOUT_LB		1
 #define PACKET_FANOUT_CPU		2
 #define PACKET_FANOUT_FLAG_DEFRAG	0x8000
+#endif
 
 #ifndef PACKET_FANOUT_ROLLOVER
 #define PACKET_FANOUT_ROLLOVER		3
@@ -72,8 +73,6 @@
 #define PACKET_FANOUT_FLAG_ROLLOVER	0x1000
 #endif
 
-#endif
-
 #define DATA_LEN			100
 #define DATA_CHAR			'a'
 
-- 
1.7.5.4

^ permalink raw reply related

* Re: [PATCH net-next] packet: Fix compile error
From: David Miller @ 2013-03-19 22:07 UTC (permalink / raw)
  To: dbaluta; +Cc: willemb, edumazet, netdev
In-Reply-To: <1363730481-7168-1-git-send-email-dbaluta@ixiacom.com>

From: Daniel Baluta <dbaluta@ixiacom.com>
Date: Wed, 20 Mar 2013 00:01:21 +0200

> PACKET_FANOUT_ROLLOVER and PACKET_FANOUT_FLAG_ROLLOVER are not declared in
> <tree>/usr/include/linux/if_packet.h together with the other PACKET_FANOUT_* macros
> as one would expect. This causes the following compilation error:
> <snip>
> psock_fanout.c: In function ‘test_control_single’:
> psock_fanout.c:230:23: error: ‘PACKET_FANOUT_ROLLOVER’ undeclared (first use in this function)
> </snip>
> 
> Signed-off-by: Daniel Baluta <dbaluta@ixiacom.com>

No, in fact, all of these should be removed completely.

They are provided by the header files under linux/usr/include which
get created by the "make headers_install" rule.

So you either need to run the "make headers_install" rule before
building the tests, or install the updated headers under /usr/include
on your test machine.

I'll remove the defines from the test, thanks for pointing this
out.

^ permalink raw reply

* [PATCH] net: Get rid of compat defines in psock_fanout.c selftest.
From: David Miller @ 2013-03-19 22:09 UTC (permalink / raw)
  To: netdev


Reported-by: Daniel Baluta <dbaluta@ixiacom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
 tools/testing/selftests/net-afpacket/psock_fanout.c | 18 ------------------
 1 file changed, 18 deletions(-)

diff --git a/tools/testing/selftests/net-afpacket/psock_fanout.c b/tools/testing/selftests/net-afpacket/psock_fanout.c
index 09dbf93..af9b019 100644
--- a/tools/testing/selftests/net-afpacket/psock_fanout.c
+++ b/tools/testing/selftests/net-afpacket/psock_fanout.c
@@ -56,24 +56,6 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-/* Hack: build even if local includes are old */
-#ifndef PACKET_FANOUT
-#define PACKET_FANOUT			18
-#define PACKET_FANOUT_HASH		0
-#define PACKET_FANOUT_LB		1
-#define PACKET_FANOUT_CPU		2
-#define PACKET_FANOUT_FLAG_DEFRAG	0x8000
-
-#ifndef PACKET_FANOUT_ROLLOVER
-#define PACKET_FANOUT_ROLLOVER		3
-#endif
-
-#ifndef PACKET_FANOUT_FLAG_ROLLOVER
-#define PACKET_FANOUT_FLAG_ROLLOVER	0x1000
-#endif
-
-#endif
-
 #define DATA_LEN			100
 #define DATA_CHAR			'a'
 
-- 
1.7.11.7

^ permalink raw reply related

* Re: [PATCH] net: Add socket() system call self test.
From: Julian Calaby @ 2013-03-19 22:12 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, netfilter-devel, linux-wireless
In-Reply-To: <20130319.145258.1891905092469394685.davem@davemloft.net>

Hi David,

On Wed, Mar 20, 2013 at 5:52 AM, David Miller <davem@davemloft.net> wrote:
>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> ---
>
> As mentioned during the netfilter workshop, we will be adding
> all sorts of networking tests now that 3.9.x has a selftest
> framework in place.
>
> The first test I'm adding to net-next does some very simple
> testing of the socket() system call.
>
> Feel free to send patches for more tests, making the run
> script more powerful (perhaps by taking a whitespace
> seperated list of tests to run on the command line), and
> adding more checks to the socket.c test.
>
> Thanks.
>
>  tools/testing/selftests/Makefile                   |  1 +
>  tools/testing/selftests/net-socket/Makefile        | 16 ++++
>  .../testing/selftests/net-socket/run_netsocktests  | 12 +++
>  tools/testing/selftests/net-socket/socket.c        | 92 ++++++++++++++++++++++
>  4 files changed, 121 insertions(+)
>  create mode 100644 tools/testing/selftests/net-socket/Makefile
>  create mode 100644 tools/testing/selftests/net-socket/run_netsocktests
>  create mode 100644 tools/testing/selftests/net-socket/socket.c
>
> diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
> index 3cc0ad7..7c6280f 100644
> --- a/tools/testing/selftests/Makefile
> +++ b/tools/testing/selftests/Makefile
> @@ -5,6 +5,7 @@ TARGETS += vm
>  TARGETS += cpu-hotplug
>  TARGETS += memory-hotplug
>  TARGETS += efivarfs
> +TARGETS += net-socket
>
>  all:
>         for TARGET in $(TARGETS); do \
> diff --git a/tools/testing/selftests/net-socket/Makefile b/tools/testing/selftests/net-socket/Makefile
> new file mode 100644
> index 0000000..f27ee10
> --- /dev/null
> +++ b/tools/testing/selftests/net-socket/Makefile
> @@ -0,0 +1,16 @@
> +# Makefile for net-socket selftests
> +
> +CC = $(CROSS_COMPILE)gcc
> +CFLAGS = -Wall
> +
> +NET_SOCK_PROGS = socket
> +
> +all: $(NET_SOCK_PROGS)
> +%: %.c
> +       $(CC) $(CFLAGS) -o $@ $^
> +
> +run_tests: all
> +       @/bin/sh ./run_netsocktests || echo "vmtests: [FAIL]"

Should that not be "vmtests"?

Thanks,

-- 
Julian Calaby

Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/

^ permalink raw reply

* Re: [PATCH] net: Add socket() system call self test.
From: Daniel Baluta @ 2013-03-19 22:14 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, netfilter-devel, linux-wireless
In-Reply-To: <20130319.145258.1891905092469394685.davem@davemloft.net>

Hi David,

On Tue, Mar 19, 2013 at 8:52 PM, David Miller <davem@davemloft.net> wrote:
>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> ---
>
> As mentioned during the netfilter workshop, we will be adding
> all sorts of networking tests now that 3.9.x has a selftest
> framework in place.
>
> The first test I'm adding to net-next does some very simple
> testing of the socket() system call.
>
> Feel free to send patches for more tests, making the run
> script more powerful (perhaps by taking a whitespace
> seperated list of tests to run on the command line), and
> adding more checks to the socket.c test.
>
> Thanks.
>
>  tools/testing/selftests/Makefile                   |  1 +
>  tools/testing/selftests/net-socket/Makefile        | 16 ++++
>  .../testing/selftests/net-socket/run_netsocktests  | 12 +++
>  tools/testing/selftests/net-socket/socket.c        | 92 ++++++++++++++++++++++
>  4 files changed, 121 insertions(+)
>  create mode 100644 tools/testing/selftests/net-socket/Makefile
>  create mode 100644 tools/testing/selftests/net-socket/run_netsocktests
>  create mode 100644 tools/testing/selftests/net-socket/socket.c
>
> diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
> index 3cc0ad7..7c6280f 100644
> --- a/tools/testing/selftests/Makefile
> +++ b/tools/testing/selftests/Makefile
> @@ -5,6 +5,7 @@ TARGETS += vm
>  TARGETS += cpu-hotplug
>  TARGETS += memory-hotplug
>  TARGETS += efivarfs
> +TARGETS += net-socket
>
>  all:
>         for TARGET in $(TARGETS); do \
> diff --git a/tools/testing/selftests/net-socket/Makefile b/tools/testing/selftests/net-socket/Makefile
> new file mode 100644
> index 0000000..f27ee10
> --- /dev/null
> +++ b/tools/testing/selftests/net-socket/Makefile
> @@ -0,0 +1,16 @@
> +# Makefile for net-socket selftests
> +
> +CC = $(CROSS_COMPILE)gcc
> +CFLAGS = -Wall
> +
> +NET_SOCK_PROGS = socket
> +
> +all: $(NET_SOCK_PROGS)
> +%: %.c
> +       $(CC) $(CFLAGS) -o $@ $^
> +
> +run_tests: all
> +       @/bin/sh ./run_netsocktests || echo "vmtests: [FAIL]"
> +
> +clean:
> +       $(RM) $(NET_SOCK_PROGS)
> diff --git a/tools/testing/selftests/net-socket/run_netsocktests b/tools/testing/selftests/net-socket/run_netsocktests

I think it's better to have a selftests/net directory dedicated for
networking tests. Over time
the number of net-{x} directories may become very large.


Daniel.

^ permalink raw reply

* Re: [PATCH] net: Add socket() system call self test.
From: David Miller @ 2013-03-19 22:19 UTC (permalink / raw)
  To: julian.calaby; +Cc: netdev, netfilter-devel, linux-wireless
In-Reply-To: <CAGRGNgU4nyDrbbN6QWh06PknACP9+h2sFrRcNyOLU_pnwMU5EA@mail.gmail.com>

From: Julian Calaby <julian.calaby@gmail.com>
Date: Wed, 20 Mar 2013 09:12:09 +1100

> Should that not be "vmtests"?

Fixed already:

http://patchwork.ozlabs.org/patch/229221/

^ permalink raw reply

* Re: [PATCH] net: Add socket() system call self test.
From: Julian Calaby @ 2013-03-19 22:22 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, netfilter-devel, linux-wireless
In-Reply-To: <20130319.181901.2168502438004923434.davem@davemloft.net>

Hi David,

On Wed, Mar 20, 2013 at 9:19 AM, David Miller <davem@davemloft.net> wrote:
> From: Julian Calaby <julian.calaby@gmail.com>
> Date: Wed, 20 Mar 2013 09:12:09 +1100
>
>> Should that not be "vmtests"?
>
> Fixed already:
>
> http://patchwork.ozlabs.org/patch/229221/

I'm not subscribed to netdev so I didn't see it. =)

Thanks,

-- 
Julian Calaby

Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/

^ permalink raw reply

* Re: [PATCH] ixp4xx_eth: set the device dma_coherent_mask
From: Krzysztof Halasa @ 2013-03-19 22:35 UTC (permalink / raw)
  To: Christophe Aeschlimann; +Cc: netdev, linux-kernel, Christophe Aeschlimann
In-Reply-To: <1363708765-20778-1-git-send-email-c.aeschlimann@acn-group.ch>

Christophe Aeschlimann <aeschlimann@gmail.com> writes:

> Without the mask it is impossible to take the network interface up
> since it returns the following error:
>
>> net eth1: coherent DMA mask is unset
>> ifconfig: SIOCSIFFLAGS: Cannot allocate memory
>
> +++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c
> @@ -1398,6 +1398,7 @@ static int eth_init_one(struct platform_device *pdev)
>  		return -ENOMEM;
>  
>  	SET_NETDEV_DEV(dev, &pdev->dev);
> +	dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
>  	port = netdev_priv(dev);
>  	port->netdev = dev;
>  	port->id = pdev->id;

This happens to work but seems to me like a bad "solution". The real
issue is that current ARM coherent_dma_mask (and regular dma_mask)
handling is just broken (at least on platforms with
CONFIG_ARCH_HAS_DMA_SET_COHERENT_MASK). I'm thinking how can it be
fixed.

The problematic parts include the dmabouncer (which takes over DMA
operations and provide services similar to swiotlb), the host DMA and
coherent DMA masks (which are property of the buses) and the device
masks, which should be ANDed with bus masks (but aren't).

What the driver should use is:
	err = dma_set_coherent_mask(xxx);

(but the subsystem have to be fixed first).
Also, according to DMA-API, 32-bit is the default.
-- 
Krzysztof Halasa

^ permalink raw reply

* [PATCH 1/2] sh_eth: fix bitbang memory leak
From: Sergei Shtylyov @ 2013-03-19 23:40 UTC (permalink / raw)
  To: netdev; +Cc: nobuhiro.iwamatsu.yj

sh_mdio_init() allocates pointer to 'struct bb_info' but only stores it locally,
so that sh_mdio_release() can't free it on driver unload.  Add the pointer to
'struct bb_info' to 'struct sh_eth_private', so that sh_mdio_init() can save
'bitbang' variable for sh_mdio_release() to be able to free it later...

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
 drivers/net/ethernet/renesas/sh_eth.c |    5 +++++
 drivers/net/ethernet/renesas/sh_eth.h |    1 +
 2 files changed, 6 insertions(+)

Index: renesas/drivers/net/ethernet/renesas/sh_eth.c
===================================================================
--- renesas.orig/drivers/net/ethernet/renesas/sh_eth.c
+++ renesas/drivers/net/ethernet/renesas/sh_eth.c
@@ -2220,6 +2220,7 @@ static void sh_eth_tsu_init(struct sh_et
 /* MDIO bus release function */
 static int sh_mdio_release(struct net_device *ndev)
 {
+	struct sh_eth_private *mdp = netdev_priv(ndev);
 	struct mii_bus *bus = dev_get_drvdata(&ndev->dev);
 
 	/* unregister mdio bus */
@@ -2234,6 +2235,9 @@ static int sh_mdio_release(struct net_de
 	/* free bitbang info */
 	free_mdio_bitbang(bus);
 
+	/* free bitbang memory */
+	kfree(mdp->bitbang);
+
 	return 0;
 }
 
@@ -2262,6 +2266,7 @@ static int sh_mdio_init(struct net_devic
 	bitbang->ctrl.ops = &bb_ops;
 
 	/* MII controller setting */
+	mdp->bitbang = bitbang;
 	mdp->mii_bus = alloc_mdio_bitbang(&bitbang->ctrl);
 	if (!mdp->mii_bus) {
 		ret = -ENOMEM;
Index: renesas/drivers/net/ethernet/renesas/sh_eth.h
===================================================================
--- renesas.orig/drivers/net/ethernet/renesas/sh_eth.h
+++ renesas/drivers/net/ethernet/renesas/sh_eth.h
@@ -705,6 +705,7 @@ struct sh_eth_private {
 	const u16 *reg_offset;
 	void __iomem *addr;
 	void __iomem *tsu_addr;
+	struct bb_info *bitbang;
 	u32 num_rx_ring;
 	u32 num_tx_ring;
 	dma_addr_t rx_desc_dma;

^ permalink raw reply

* [PATCH 2/2] sh_eth: check TSU registers ioremap() error
From: Sergei Shtylyov @ 2013-03-19 23:41 UTC (permalink / raw)
  To: netdev; +Cc: nobuhiro.iwamatsu.yj

One must check the result of ioremap() -- in this case it prevents potential
kernel oops when initializing TSU registers further on...

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
 drivers/net/ethernet/renesas/sh_eth.c |    5 +++++
 1 file changed, 5 insertions(+)

Index: renesas/drivers/net/ethernet/renesas/sh_eth.c
===================================================================
--- renesas.orig/drivers/net/ethernet/renesas/sh_eth.c
+++ renesas/drivers/net/ethernet/renesas/sh_eth.c
@@ -2446,6 +2446,11 @@ static int sh_eth_drv_probe(struct platf
 		}
 		mdp->tsu_addr = ioremap(rtsu->start,
 					resource_size(rtsu));
+		if (mdp->tsu_addr == NULL) {
+			ret = -ENOMEM;
+			dev_err(&pdev->dev, "TSU ioremap failed.\n");
+			goto out_release;
+		}
 		mdp->port = devno % 2;
 		ndev->features = NETIF_F_HW_VLAN_FILTER;
 	}

^ permalink raw reply

* Re: [PATCH net-next] packet: Fix compile error
From: Daniel Baluta @ 2013-03-19 22:46 UTC (permalink / raw)
  To: David Miller; +Cc: willemb, edumazet, netdev
In-Reply-To: <20130319.180722.1735800542274116990.davem@davemloft.net>

On Wed, Mar 20, 2013 at 12:07 AM, David Miller <davem@davemloft.net> wrote:
> From: Daniel Baluta <dbaluta@ixiacom.com>
> Date: Wed, 20 Mar 2013 00:01:21 +0200
>
>> PACKET_FANOUT_ROLLOVER and PACKET_FANOUT_FLAG_ROLLOVER are not declared in
>> <tree>/usr/include/linux/if_packet.h together with the other PACKET_FANOUT_* macros
>> as one would expect. This causes the following compilation error:
>> <snip>
>> psock_fanout.c: In function ‘test_control_single’:
>> psock_fanout.c:230:23: error: ‘PACKET_FANOUT_ROLLOVER’ undeclared (first use in this function)
>> </snip>
>>
>> Signed-off-by: Daniel Baluta <dbaluta@ixiacom.com>
>
> No, in fact, all of these should be removed completely.
>
> They are provided by the header files under linux/usr/include which
> get created by the "make headers_install" rule.
>
> So you either need to run the "make headers_install" rule before
> building the tests, or install the updated headers under /usr/include
> on your test machine.
>
> I'll remove the defines from the test, thanks for pointing this
> out.

Sorry if I am missing something but I don't think it's necessary to
"make headers_install" because selftests compilaton target already
include -I../../../../usr/include/ that points to linux/usr/include.

Anyhow, this is not an issue :). The problem is that there is no definition
for PACKET_FANOUT_ROLLOVER or PACKET_FANOUT_FLAG_ROLLOVER,
and the compilation still fails:

$ make
gcc -Wall -I../../../../usr/include/ -o psock_fanout psock_fanout.c
psock_fanout.c: In function ‘test_control_single’:
psock_fanout.c:212:23: error: ‘PACKET_FANOUT_ROLLOVER’ undeclared
(first use in this function)

On your system where does PACKET_FANOUT_ROLLOVER gets defined?

thanks,
Daniel.

^ permalink raw reply

* Re: [patch] RxRPC: use copy_to_user() instead of memcpy()
From: Dan Carpenter @ 2013-03-19 22:51 UTC (permalink / raw)
  To: David Howells; +Cc: David Miller, netdev, kernel-janitors
In-Reply-To: <30707.1363701570@warthog.procyon.org.uk>

[-- Attachment #1: Type: text/plain, Size: 260 bytes --]

Thanks for the explanation.  I misread the code and then managed to
trigger an unrelated locking bug and got confused.

I think there is a spin_unlock(call->lock) missing somewhere on an
error path.  I have attached a reproducer file.

regards,
dan carpenter


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: test_rxrpc.c --]
[-- Type: text/x-csrc; charset=utf-8, Size: 7271 bytes --]

/* klog.c: description
 *
 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
 * Written by David Howells (dhowells@redhat.com)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version
 * 2 of the License, or (at your option) any later version.
 *
 * Based on code:
 *
 * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
 * (Royal Institute of Technology, Stockholm, Sweden).
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * 3. Neither the name of the Institute nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */

#define _XOPEN_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <unistd.h>
#include <ctype.h>
#include <time.h>
#include <signal.h>
#include <errno.h>
#include <termios.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <keyutils.h>
//#include <rpc/xdr.h>

#define KA_SERVICE 731
#define KA_TICKET_GRANTING_SERVICE 732

#define OSERROR(X, Y) do { if ((long)(X) == -1) { perror(Y); exit(1); } } while(0)

struct sockaddr_rxrpc {
	sa_family_t	srx_family;	/* address family */
	unsigned short	srx_service;	/* service desired */
	unsigned short	transport_type;	/* type of transport socket (SOCK_DGRAM) */
	unsigned short	transport_len;	/* length of transport address */
	union {
		sa_family_t family;		/* transport address family */
		struct sockaddr_in sin;		/* IPv4 transport address */
		struct sockaddr_in6 sin6;	/* IPv6 transport address */
	} transport;
};

#define SOL_RXRPC		272
#define RXRPC_USER_CALL_ID	1	/* User call ID specifier */
#define RXRPC_ABORT		2	/* Abort request / notification */
#define RXRPC_ACK		3	/* [Server] RPC op final ACK received */
#define RXRPC_RESPONSE		4	/* [Server] security response received */
#define RXRPC_NET_ERROR		5	/* network error received */
#define RXRPC_BUSY		6	/* server busy received */
#define RXRPC_LOCAL_ERROR	7	/* local error generated */
#define RXRPC_PREPARE_CALL_SLOT	8	/* Propose user call ID specifier for next call */
#define RXRPC_SECURITY_KEY		1	/* [clnt] set client security key */
#define RXRPC_SECURITY_KEYRING		2	/* [srvr] set ring of server security keys */
#define RXRPC_EXCLUSIVE_CONNECTION	3	/* [clnt] use exclusive RxRPC connection */
#define RXRPC_MIN_SECURITY_LEVEL	4	/* minimum security level */

#define OSERROR(X, Y) do { if ((long)(X) == -1) { perror(Y); exit(1); } } while(0)

static const unsigned char local_addr[4] = { 0, 0, 0, 0 };
static const unsigned char remote_addr[4] = { 127, 0, 0, 1 };

#define RXRPC_ADD_CALLID(control, ctrllen, id)				\
do {									\
	struct cmsghdr *__cmsg;						\
	__cmsg = (void *)(control) + (ctrllen);				\
	__cmsg->cmsg_len	= CMSG_LEN(sizeof(unsigned long));	\
	__cmsg->cmsg_level	= SOL_RXRPC;				\
	__cmsg->cmsg_type	= RXRPC_USER_CALL_ID;			\
	*(unsigned long *)CMSG_DATA(__cmsg) = (id);			\
	(ctrllen) += __cmsg->cmsg_len;					\
									\
} while (0)

int main(int argc, char *argv[])
{
	struct sockaddr_rxrpc srx;
	struct msghdr send;
	struct msghdr msg;
	struct iovec iov[1];
	size_t ctrllen, replen;
	unsigned char control[4096];
	void *preply;
	int client, ret;
	int service = KA_SERVICE;
	char buffer[16384] __attribute__((aligned(4)));
	void *request = buffer;
	size_t reqlen = sizeof(buffer);
	void *reply = buffer;
	size_t replen_tmp = sizeof(buffer);
	size_t *_replen = &replen_tmp;
	void *p = NULL;
	int i;

	client = socket(AF_RXRPC, SOCK_DGRAM, PF_INET);
	OSERROR(client, "socket");

	/* the authentication is associated with the virtual
	 * connection, so we need to open an exclusive channel */
	ret = setsockopt(client, SOL_RXRPC, RXRPC_EXCLUSIVE_CONNECTION,
			 NULL, 0);
	OSERROR(ret, "setsockopt");

	/* bind an address to the local endpoint */
	srx.srx_family = AF_RXRPC;
	srx.srx_service = 0; /* it's a client */
	srx.transport_type = SOCK_DGRAM;
	srx.transport_len = sizeof(srx.transport.sin);
	srx.transport.sin.sin_family = AF_INET;
	srx.transport.sin.sin_port = htons(7001);
	memcpy(&srx.transport.sin.sin_addr, &local_addr, 4);

	ret = bind(client, (struct sockaddr *) &srx, sizeof(srx));
	OSERROR(ret, "bind");

	/* connect to the remote server */
	srx.srx_family = AF_RXRPC;
	srx.srx_service = service;
	srx.transport_type = SOCK_DGRAM;
	srx.transport_len = sizeof(srx.transport.sin);
	srx.transport.sin.sin_family = AF_INET;
	srx.transport.sin.sin_port = htons(7004);
	memcpy(&srx.transport.sin.sin_addr, &remote_addr, 4);

	ret = connect(client, (struct sockaddr *) &srx, sizeof(srx));
	OSERROR(ret, "connect");

	/* request an operation */
	ctrllen = 0;
	RXRPC_ADD_CALLID(control, ctrllen, 0x12345);

	iov[0].iov_base = (void *) request;
	iov[0].iov_len = reqlen;

	send.msg_name		= NULL;
	send.msg_namelen	= 0;
	send.msg_iov		= iov;
	send.msg_iovlen		= 1;
	send.msg_control	= control;
	send.msg_controllen	= ctrllen;
	send.msg_flags		= 0;


	/* wait for a reply */
	preply = reply;
	replen = 0;
	for (i = 0; i < 2; i++) {

		iov[0].iov_base = preply;
		iov[0].iov_len = *_replen - replen;

		ret = sendmsg(client, &send, 0);
		if (ret == -1 && (errno == ENOANO || errno == ECONNABORTED))
			perror("sendmsg/data");
		else
			OSERROR(ret, "sendmsg/data");


		p += 10000;
		msg.msg_name	= p;
		msg.msg_namelen	= sizeof(struct sockaddr_rxrpc);
		msg.msg_iov	= iov;
		msg.msg_iovlen	= 1;
		msg.msg_control	= control;
		msg.msg_controllen = sizeof(control);
		msg.msg_flags	= 0;

		ret = recvmsg(client, &msg, 0);
		if (ret < 0) {
			printf("%d %p recvmsg %s\n", i, p, strerror(errno));
			continue;
		}

		printf("RECV: %d [fl:%d]\n", ret, msg.msg_flags);
		printf("CMSG: %zu\n", msg.msg_controllen);
		printf("IOV: %zu [0]=%zu\n", msg.msg_iovlen, iov[0].iov_len);

		preply += ret;
		replen += ret;

		if (msg.msg_flags & MSG_EOR)
			break;
	}

	*_replen = replen;
	close(client);
	return 0;
}


^ permalink raw reply

* Re: [PATCH nf-next] netfilter: nfnetlink_queue: zero copy support
From: Pablo Neira Ayuso @ 2013-03-19 22:52 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: netdev, Netfilter Developer Mailing List
In-Reply-To: <1363576555.29475.122.camel@edumazet-glaptop>

On Sun, Mar 17, 2013 at 08:15:55PM -0700, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
> 
> nfqnl_build_packet_message() actually copy the packet
> inside the netlink message, while it can instead use
> zero copy.
> 
> Make sure the skb 'copy' is the last component of the
> cooked netlink message, as we cant add anything after it.
> 
> Patch cooked in Copenhagen at Netfilter Workshop ;)
> 
> Still to be addressed in separate patches :
> 
> -GRO/GSO packets are segmented in nf_queue()
> and checksummed in nfqnl_build_packet_message().
> 
> Proper support for GSO/GRO packets (no segmentation,
> and no checksumming) needs application cooperation, if we
> want no regressions.

Applied, thanks.

^ permalink raw reply

* Re: [PATCH] netfilter: nf_conntrack: Batch cleanup
From: Pablo Neira Ayuso @ 2013-03-19 22:53 UTC (permalink / raw)
  To: Vladimir Davydov
  Cc: netfilter-devel, netfilter, coreteam, netdev, linux-kernel, devel,
	Patrick McHardy, David S. Miller, Eric W. Biederman
In-Reply-To: <1363254014-10725-1-git-send-email-vdavydov@parallels.com>

On Thu, Mar 14, 2013 at 01:40:14PM +0400, Vladimir Davydov wrote:
> The patch introduces nf_conntrack_cleanup_net_list(), which cleanups
> nf_conntrack for a list of netns and calls synchronize_net() only once
> for them all. This should reduce netns destruction time.

Applied, thanks.

^ permalink raw reply

* Re: [PATCH net-next] packet: Fix compile error
From: David Miller @ 2013-03-19 23:06 UTC (permalink / raw)
  To: daniel.baluta; +Cc: willemb, edumazet, netdev
In-Reply-To: <CAEnQRZAVBqQ3Hz84YeyqHcKc9kS93TTQoz3H3ag2cTtQPYt68g@mail.gmail.com>

From: Daniel Baluta <daniel.baluta@gmail.com>
Date: Wed, 20 Mar 2013 00:46:38 +0200

> On Wed, Mar 20, 2013 at 12:07 AM, David Miller <davem@davemloft.net> wrote:
>> From: Daniel Baluta <dbaluta@ixiacom.com>
>> Date: Wed, 20 Mar 2013 00:01:21 +0200
>>
>>> PACKET_FANOUT_ROLLOVER and PACKET_FANOUT_FLAG_ROLLOVER are not declared in
>>> <tree>/usr/include/linux/if_packet.h together with the other PACKET_FANOUT_* macros
>>> as one would expect. This causes the following compilation error:
>>> <snip>
>>> psock_fanout.c: In function ‘test_control_single’:
>>> psock_fanout.c:230:23: error: ‘PACKET_FANOUT_ROLLOVER’ undeclared (first use in this function)
>>> </snip>
>>>
>>> Signed-off-by: Daniel Baluta <dbaluta@ixiacom.com>
>>
>> No, in fact, all of these should be removed completely.
>>
>> They are provided by the header files under linux/usr/include which
>> get created by the "make headers_install" rule.
>>
>> So you either need to run the "make headers_install" rule before
>> building the tests, or install the updated headers under /usr/include
>> on your test machine.
>>
>> I'll remove the defines from the test, thanks for pointing this
>> out.
> 
> Sorry if I am missing something but I don't think it's necessary to
> "make headers_install" because selftests compilaton target already
> include -I../../../../usr/include/ that points to linux/usr/include.

"make headers_install" populates the top-level usr/include/ with
actual header files.

You need to do this, unless you have the header check kconfig option
enabled.

That's how the tests can obtain the version of the headers in the
kernel tree in which they live, rather than the system headers.

> Anyhow, this is not an issue :). The problem is that there is no definition
> for PACKET_FANOUT_ROLLOVER or PACKET_FANOUT_FLAG_ROLLOVER,
> and the compilation still fails:
> 
> $ make
> gcc -Wall -I../../../../usr/include/ -o psock_fanout psock_fanout.c
> psock_fanout.c: In function ‘test_control_single’:
> psock_fanout.c:212:23: error: ‘PACKET_FANOUT_ROLLOVER’ undeclared
> (first use in this function)
> 
> On your system where does PACKET_FANOUT_ROLLOVER gets defined?

In include/uapi/linux/if_packet.h via usr/include/linux/if_packet.h

^ permalink raw reply

* [PATCH] netfilter: remove unused "config IP_NF_QUEUE"
From: Paul Bolle @ 2013-03-19 23:09 UTC (permalink / raw)
  To: Pablo Neira Ayuso, Patrick McHardy, David S. Miller,
	Alexey Kuznetsov, James Morris, Hideaki YOSHIFUJI
  Cc: netfilter-devel, netfilter, coreteam, netdev, linux-kernel

Kconfig symbol IP_NF_QUEUE is unused since commit
d16cf20e2f2f13411eece7f7fb72c17d141c4a84 ("netfilter: remove ip_queue
support"). Let's remove it too.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
---
Eyeball tested.

 net/ipv4/netfilter/Kconfig | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/net/ipv4/netfilter/Kconfig b/net/ipv4/netfilter/Kconfig
index ce2d43e..0d755c5 100644
--- a/net/ipv4/netfilter/Kconfig
+++ b/net/ipv4/netfilter/Kconfig
@@ -36,19 +36,6 @@ config NF_CONNTRACK_PROC_COMPAT
 
 	  If unsure, say Y.
 
-config IP_NF_QUEUE
-	tristate "IP Userspace queueing via NETLINK (OBSOLETE)"
-	depends on NETFILTER_ADVANCED
-	help
-	  Netfilter has the ability to queue packets to user space: the
-	  netlink device can be used to access them using this driver.
-
-	  This option enables the old IPv4-only "ip_queue" implementation
-	  which has been obsoleted by the new "nfnetlink_queue" code (see
-	  CONFIG_NETFILTER_NETLINK_QUEUE).
-
-	  To compile it as a module, choose M here.  If unsure, say N.
-
 config IP_NF_IPTABLES
 	tristate "IP tables support (required for filtering/masq/NAT)"
 	default m if NETFILTER_ADVANCED=n
-- 
1.7.11.7

^ permalink raw reply related

* Re: [PATCH] netfilter: remove unused "config IP_NF_QUEUE"
From: Pablo Neira Ayuso @ 2013-03-19 23:12 UTC (permalink / raw)
  To: Paul Bolle
  Cc: Patrick McHardy, David S. Miller, Alexey Kuznetsov, James Morris,
	Hideaki YOSHIFUJI, netfilter-devel, netfilter, coreteam, netdev,
	linux-kernel
In-Reply-To: <1363734599.1390.50.camel@x61.thuisdomein>

On Wed, Mar 20, 2013 at 12:09:59AM +0100, Paul Bolle wrote:
> Kconfig symbol IP_NF_QUEUE is unused since commit
> d16cf20e2f2f13411eece7f7fb72c17d141c4a84 ("netfilter: remove ip_queue
> support"). Let's remove it too.

Applied, thanks for catching up this leftover.

^ permalink raw reply

* Re: [PATCH 0/3] net/intel: Add missing calls to dma_mapping_error
From: Jeff Kirsher @ 2013-03-20  0:46 UTC (permalink / raw)
  To: Christoph Paasch
  Cc: Bruce Allan, Alex Duyck, e1000-devel, netdev, David Miller
In-Reply-To: <1363429925-12724-1-git-send-email-christoph.paasch@uclouvain.be>

[-- Attachment #1: Type: text/plain, Size: 720 bytes --]

On Sat, 2013-03-16 at 11:32 +0100, Christoph Paasch wrote:
> After dma_map_single/page, dma_mapping_error must be called.
> 
> Christoph Paasch (3):
>   e1000: ethtool: Add missing dma_mapping_error-call in
>     e1000_setup_desc_rings
>   ixgb: Add missing dma_mapping_error-call in ixgb_alloc_rx_buffers
>   e1000e: Add missing dma_mapping_error-call in
>     e1000_alloc_jumbo_rx_buffers
> 
>  drivers/net/ethernet/intel/e1000/e1000_ethtool.c | 14 +++++++++++---
>  drivers/net/ethernet/intel/e1000e/netdev.c       |  7 ++++++-
>  drivers/net/ethernet/intel/ixgb/ixgb_main.c      |  7 ++++++-
>  3 files changed, 23 insertions(+), 5 deletions(-) 

Thanks Christoph, I will add the series to my queue.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* Re: [PATCH 1/3] e1000: ethtool: Add missing dma_mapping_error-call in e1000_setup_desc_rings
From: Jeff Kirsher @ 2013-03-20  0:47 UTC (permalink / raw)
  To: Christoph Paasch
  Cc: Bruce Allan, Alex Duyck, e1000-devel, netdev, David Miller
In-Reply-To: <1363429925-12724-2-git-send-email-christoph.paasch@uclouvain.be>

[-- Attachment #1: Type: text/plain, Size: 361 bytes --]

On Sat, 2013-03-16 at 11:32 +0100, Christoph Paasch wrote:
> 
> After dma_map_single, dma_mapping_error must be called.
> 
> Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
> ---
>  drivers/net/ethernet/intel/e1000/e1000_ethtool.c | 14 +++++++++++---
>  1 file changed, 11 insertions(+), 3 deletions(-) 

Added to my e1000 patch queue

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* Re: [PATCH 3/3] e1000e: Add missing dma_mapping_error-call in e1000_alloc_jumbo_rx_buffers
From: Jeff Kirsher @ 2013-03-20  0:47 UTC (permalink / raw)
  To: Christoph Paasch
  Cc: Bruce Allan, Alex Duyck, e1000-devel, netdev, David Miller
In-Reply-To: <1363429925-12724-4-git-send-email-christoph.paasch@uclouvain.be>

[-- Attachment #1: Type: text/plain, Size: 453 bytes --]

On Sat, 2013-03-16 at 11:32 +0100, Christoph Paasch wrote:
> After dma_map_page, dma_mapping_error must be called. It seems safe to
> not free the skb/page allocated in this function, as the skb/page can
> be
> reused later.
> 
> Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
> ---
>  drivers/net/ethernet/intel/e1000e/netdev.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-) 

Added to my e1000e patch queue

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* Re: [PATCH 2/3] ixgb: Add missing dma_mapping_error-call in ixgb_alloc_rx_buffers
From: Jeff Kirsher @ 2013-03-20  0:48 UTC (permalink / raw)
  To: Christoph Paasch
  Cc: Bruce Allan, Alex Duyck, e1000-devel, netdev, David Miller
In-Reply-To: <1363429925-12724-3-git-send-email-christoph.paasch@uclouvain.be>

[-- Attachment #1: Type: text/plain, Size: 505 bytes --]

On Sat, 2013-03-16 at 11:32 +0100, Christoph Paasch wrote:
> After dma_map_single, dma_mapping_error must be called. It seems safe
> to
> not free the skb allocated in this function, as the skb can be reused
> later.
> 
> Additionally this patch fixes one coding-style error.
> 
> Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
> ---
>  drivers/net/ethernet/intel/ixgb/ixgb_main.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-) 

Added to my ixgb patch queue

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* Re: [PATCH] igb: make sensor info static
From: Jeff Kirsher @ 2013-03-20  0:48 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: e1000-devel, netdev
In-Reply-To: <20130316095606.1c8465f5@nehalam.linuxnetplumber.net>

[-- Attachment #1: Type: text/plain, Size: 207 bytes --]

On Sat, 2013-03-16 at 09:56 -0700, Stephen Hemminger wrote:
> Trivial sparse warning.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> 

Thanks Stephen, it has been added to my queue

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* Re: [PATCH] igb: fix PHC stopping on max freq
From: Jeff Kirsher @ 2013-03-20  0:49 UTC (permalink / raw)
  To: Jiri Benc; +Cc: netdev, e1000-devel, Stefan Assmann, Miroslav Lichvar
In-Reply-To: <f254bc583cbe1f623bd6ebb4ff375e440696d8b2.1363703896.git.jbenc@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 885 bytes --]

On Tue, 2013-03-19 at 15:42 +0100, Jiri Benc wrote:
> For 82576 MAC type, max_adj is reported as 1000000000 ppb. However, if
> this value is passed to igb_ptp_adjfreq_82576, incvalue overflows out
> of
> INCVALUE_82576_MASK, resulting in setting of zero TIMINCA.incvalue,
> stopping
> the PHC (instead of going at twice the nominal speed).
> 
> Fix the advertised max_adj value to the largest value hardware can
> handle.
> As there is no min_adj value available (-max_adj is used instead),
> this will
> also prevent stopping the clock intentionally. It's probably not a big
> deal,
> other igb MAC types don't support stopping the clock, either.
> 
> Signed-off-by: Jiri Benc <jbenc@redhat.com>
> ---
>  drivers/net/ethernet/intel/igb/igb_ptp.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-) 

Thanks Jiri, I have added the patch to my igb queue

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* Re: [PATCH net-next 4/4] filter: add minimal BPF JIT emitted image disassembler
From: Ben Hutchings @ 2013-03-20  2:58 UTC (permalink / raw)
  To: Daniel Borkmann; +Cc: netdev, davem, eric.dumazet, jasowang, Eric Dumazet
In-Reply-To: <8d8079d7a5cffe05eeb44a35cb5d7c3544a84f4f.1363699285.git.dborkman@redhat.com>

On Tue, 2013-03-19 at 14:28 +0100, Daniel Borkmann wrote:
> This is a minimal stand-alone user space helper, that allows for debugging or
> verification of emitted BPF JIT images. This is in particular useful for
> emitted opcode debugging, since minor bugs in the JIT compiler can be fatal.
> The disassembler is architecture generic and uses libopcodes and libbfd.
[...]
> ---
>  scripts/bpf_jit_disasm.c | 216 +++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 216 insertions(+)
>  create mode 100644 scripts/bpf_jit_disasm.c
[...]

This might belong in tools.  scripts is mostly for build scripts now.

Ben.

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

^ permalink raw reply

* Re: [PATCH] tcp: dont handle MTU reduction on LISTEN socket
From: dormando @ 2013-03-20  4:16 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: David Miller, netdev
In-Reply-To: <1363626088.29475.155.camel@edumazet-glaptop>

> From: Eric Dumazet <edumazet@google.com>
>
> When an ICMP ICMP_FRAG_NEEDED (or ICMPV6_PKT_TOOBIG) message finds a
> LISTEN socket, and this socket is currently owned by the user, we
> set TCP_MTU_REDUCED_DEFERRED flag in listener tsq_flags.
>
> This is bad because if we clone the parent before it had a chance to
> clear the flag, the child inherits the tsq_flags value, and next
> tcp_release_cb() on the child will decrement sk_refcnt.
>
> Result is that we might free a live TCP socket, as reported by
> Dormando.
>
> IPv4: Attempt to release TCP socket in state 1
>
> Fix this issue by testing sk_state against TCP_LISTEN early, so that we
> set TCP_MTU_REDUCED_DEFERRED on appropriate sockets (not a LISTEN one)
>
> This bug was introduced in commit 563d34d05786
> (tcp: dont drop MTU reduction indications)
>
> Reported-by: dormando <dormando@rydia.net>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---
>  net/ipv4/tcp_ipv4.c |   14 +++++++-------
>  net/ipv6/tcp_ipv6.c |    7 +++++++
>  2 files changed, 14 insertions(+), 7 deletions(-)
>
> diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
> index 4a8ec45..d09203c 100644
> --- a/net/ipv4/tcp_ipv4.c
> +++ b/net/ipv4/tcp_ipv4.c
> @@ -274,13 +274,6 @@ static void tcp_v4_mtu_reduced(struct sock *sk)
>  	struct inet_sock *inet = inet_sk(sk);
>  	u32 mtu = tcp_sk(sk)->mtu_info;
>
> -	/* We are not interested in TCP_LISTEN and open_requests (SYN-ACKs
> -	 * send out by Linux are always <576bytes so they should go through
> -	 * unfragmented).
> -	 */
> -	if (sk->sk_state == TCP_LISTEN)
> -		return;
> -
>  	dst = inet_csk_update_pmtu(sk, mtu);
>  	if (!dst)
>  		return;
> @@ -408,6 +401,13 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info)
>  			goto out;
>
>  		if (code == ICMP_FRAG_NEEDED) { /* PMTU discovery (RFC1191) */
> +			/* We are not interested in TCP_LISTEN and open_requests
> +			 * (SYN-ACKs send out by Linux are always <576bytes so
> +			 * they should go through unfragmented).
> +			 */
> +			if (sk->sk_state == TCP_LISTEN)
> +				goto out;
> +
>  			tp->mtu_info = info;
>  			if (!sock_owned_by_user(sk)) {
>  				tcp_v4_mtu_reduced(sk);
> diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
> index 9b64600..f6d629f 100644
> --- a/net/ipv6/tcp_ipv6.c
> +++ b/net/ipv6/tcp_ipv6.c
> @@ -389,6 +389,13 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
>  	}
>
>  	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
> +		 * they should go through unfragmented).
> +		 */
> +		if (sk->sk_state == TCP_LISTEN)
> +			goto out;
> +
>  		tp->mtu_info = ntohl(info);
>  		if (!sock_owned_by_user(sk))
>  			tcp_v6_mtu_reduced(sk);
>
>
>

Thanks! We are all incredibly appreciative of your quick help with this.

I have 3.8.3 + this patch running on our machine for 20 hours so far. We
haven't had a kernel newer than 3.2 go for a full day before. I'm giving
it another peak cycle before calling it dead but it looks like you nailed
it.

I assume you no longer need the kernel disassembly?

thanks again,
-Dormando

^ 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