Netdev List
 help / color / mirror / Atom feed
* [BUGFIX PATCH] net: ethernet: cpsw: fix erroneous condition in error check
From: Lothar Waßmann @ 2013-03-21 12:20 UTC (permalink / raw)
  To: Richard Cochran
  Cc: David S. Miller, netdev, linux-kernel, Mugunthan V N,
	Lothar Waßmann

The error check in cpsw_probe_dt() has an '&&' where an '||' is
meant to be. This causes a NULL pointer dereference when incomplet DT
data is passed to the driver ('phy_id' property for cpsw_emac1
missing).


Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
---
 drivers/net/ethernet/ti/cpsw.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 5ceaa4c3..7aebc0c 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -1504,7 +1504,7 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data,
 		struct platform_device *mdio;
 
 		parp = of_get_property(slave_node, "phy_id", &lenp);
-		if ((parp == NULL) && (lenp != (sizeof(void *) * 2))) {
+		if ((parp == NULL) || (lenp != (sizeof(void *) * 2))) {
 			pr_err("Missing slave[%d] phy_id property\n", i);
 			ret = -EINVAL;
 			goto error_ret;
-- 
1.7.2.5

^ permalink raw reply related

* Re: [BUGFIX PATCH] net: ethernet: cpsw: fix erroneous condition in error check
From: Mugunthan V N @ 2013-03-21 12:32 UTC (permalink / raw)
  To: Lothar Waßmann
  Cc: Richard Cochran, David S. Miller, netdev, linux-kernel
In-Reply-To: <1363868411-25318-1-git-send-email-LW@KARO-electronics.de>

On 3/21/2013 5:50 PM, Lothar Waßmann wrote:
> The error check in cpsw_probe_dt() has an '&&' where an '||' is
> meant to be. This causes a NULL pointer dereference when incomplet DT
> data is passed to the driver ('phy_id' property for cpsw_emac1
> missing).
>
>
> Signed-off-by: Lothar Waßmann<LW@KARO-electronics.de>
Acked-by: Mugunthan V N <mugunthanvnm@ti.com>

Regards
Mugunthan V N

^ permalink raw reply

* tools/selftests: psock_fanout compiler errors
From: devendra.aaru @ 2013-03-21 12:37 UTC (permalink / raw)
  To: netdev

Hello,

when i do make -C tools/testing/selftests/.

I get

gcc -Wall -I../../../../usr/include/ -o psock_fanout psock_fanout.c
psock_fanout.c: In function ‘test_control_single’:
psock_fanout.c:239:23: error: ‘PACKET_FANOUT_ROLLOVER’ undeclared
(first use in this function)
psock_fanout.c:239:23: note: each undeclared identifier is reported
only once for each function it appears in
psock_fanout.c:240:11: error: ‘PACKET_FANOUT_FLAG_ROLLOVER’ undeclared
(first use in this function)
psock_fanout.c: In function ‘test_control_group’:
psock_fanout.c:264:11: error: ‘PACKET_FANOUT_FLAG_ROLLOVER’ undeclared
(first use in this function)
psock_fanout.c: In function ‘main’:
psock_fanout.c:368:44: error: ‘PACKET_FANOUT_FLAG_ROLLOVER’ undeclared
(first use in this function)
psock_fanout.c:372:23: error: ‘PACKET_FANOUT_ROLLOVER’ undeclared
(first use in this function)
make[1]: *** [psock_fanout] Error 1

i have the linux/if_packet.h file in /usr/include/ but i couldn't see
PACKET_FANOUT_ROLLOVER flag in that header.

I have a fedora 18 userspace

uname -a if you need it:

Linux localhost.localdomain 3.6.10-4.fc18.x86_64 #1 SMP Tue Dec 11
18:01:27 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

and the recent git head points to id in net-next is
e76d120b68d2e0f159ba999b1210920a5a0ed53d.

do i need to recompile the kernel and install kernel headers (i guess
kernel headers doesn't matter in this point)?

thanks,

^ permalink raw reply

* Re: tools/selftests: psock_fanout compiler errors
From: Daniel Baluta @ 2013-03-21 12:42 UTC (permalink / raw)
  To: devendra.aaru; +Cc: netdev
In-Reply-To: <CAHdPZaMsvkwmbYm=-q_cynaScAr-vn0UfEPTzorb+ywKqU2a7w@mail.gmail.com>

On Thu, Mar 21, 2013 at 2:37 PM, devendra.aaru <devendra.aaru@gmail.com> wrote:
> Hello,
>
> when i do make -C tools/testing/selftests/.
>
> I get
>
> gcc -Wall -I../../../../usr/include/ -o psock_fanout psock_fanout.c
> psock_fanout.c: In function ‘test_control_single’:
> psock_fanout.c:239:23: error: ‘PACKET_FANOUT_ROLLOVER’ undeclared
> (first use in this function)
> psock_fanout.c:239:23: note: each undeclared identifier is reported
> only once for each function it appears in
> psock_fanout.c:240:11: error: ‘PACKET_FANOUT_FLAG_ROLLOVER’ undeclared
> (first use in this function)
> psock_fanout.c: In function ‘test_control_group’:
> psock_fanout.c:264:11: error: ‘PACKET_FANOUT_FLAG_ROLLOVER’ undeclared
> (first use in this function)
> psock_fanout.c: In function ‘main’:
> psock_fanout.c:368:44: error: ‘PACKET_FANOUT_FLAG_ROLLOVER’ undeclared
> (first use in this function)
> psock_fanout.c:372:23: error: ‘PACKET_FANOUT_ROLLOVER’ undeclared
> (first use in this function)
> make[1]: *** [psock_fanout] Error 1
>
> i have the linux/if_packet.h file in /usr/include/ but i couldn't see
> PACKET_FANOUT_ROLLOVER flag in that header.
>
> I have a fedora 18 userspace
>
> uname -a if you need it:
>
> Linux localhost.localdomain 3.6.10-4.fc18.x86_64 #1 SMP Tue Dec 11
> 18:01:27 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
>
> and the recent git head points to id in net-next is
> e76d120b68d2e0f159ba999b1210920a5a0ed53d.
>
> do i need to recompile the kernel and install kernel headers (i guess
> kernel headers doesn't matter in this point)?

Well :), check this [1].

thanks,
Daniel.

[1] http://www.spinics.net/lists/netdev/msg229812.html

^ permalink raw reply

* Re: tools/selftests: psock_fanout compiler errors
From: devendra.aaru @ 2013-03-21 12:44 UTC (permalink / raw)
  To: Daniel Baluta; +Cc: netdev
In-Reply-To: <CAEnQRZC6pJPmG0WAKRPx34AGTDBAaTkXif4Ufx-SpwYsPP5wvA@mail.gmail.com>

> Well :), check this [1].
>

I would have tried it in first place, thanks.


> thanks,
> Daniel.
>
> [1] http://www.spinics.net/lists/netdev/msg229812.html

^ permalink raw reply

* Re: [PATCH 2/2] netlink: Diag core and basic socket info dumping
From: Thomas Graf @ 2013-03-21 12:52 UTC (permalink / raw)
  To: Andrey Vagin
  Cc: linux-kernel, netdev, David S. Miller, Eric Dumazet,
	Pavel Emelyanov, Pablo Neira Ayuso, Eric W. Biederman, Gao feng
In-Reply-To: <1363857669-19990-3-git-send-email-avagin@openvz.org>

On 03/21/13 at 01:21pm, Andrey Vagin wrote:
> diff --git a/include/uapi/linux/netlink_diag.h b/include/uapi/linux/netlink_diag.h
> new file mode 100644
> index 0000000..9328866
> --- /dev/null
> +++ b/include/uapi/linux/netlink_diag.h
> +enum {
> +	NETLINK_DIAG_MEMINFO,
> +	NETLINK_DIAG_GROUPS,
> +
> +	NETLINK_DIAG_MAX,
> +};

Please follow the common pattern and define NETLINK_DIAG_MAX as
NETLINK_DIAG_GROUPS like other by doing>

	[...] 
        __NETLINK_DIAG_MAX,
};
 
#define NETLINK_DIAG_MAX (__NETLINK_DIAG_MAX - 1)
 
Everyone is used to do:
 
        struct nlattr *attrs[NETLINK_DIAG_MAX+1];
         
        nla_parse([...], NETLINK_DIAG_MAX, [...]

In fact, the follow-up patch to ss is buggy because of this.
UNIX_DIAG_MAX suffers from the same problem which is problem the
cause for this.

^ permalink raw reply

* Re: [PATCH 2/2] thermal: shorten too long mcast group name
From: Thomas Graf @ 2013-03-21 13:04 UTC (permalink / raw)
  To: Masatake YAMATO; +Cc: netdev
In-Reply-To: <1363693648-10015-3-git-send-email-yamato@redhat.com>

On 03/19/13 at 08:47pm, Masatake YAMATO wrote:
> The original name is too long.
> 
> Signed-off-by: Masatake YAMATO <yamato@redhat.com>
> ---
>  include/linux/thermal.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/thermal.h b/include/linux/thermal.h
> index f0bd7f9..e3c0ae9 100644
> --- a/include/linux/thermal.h
> +++ b/include/linux/thermal.h
> @@ -44,7 +44,7 @@
>  /* Adding event notification support elements */
>  #define THERMAL_GENL_FAMILY_NAME                "thermal_event"
>  #define THERMAL_GENL_VERSION                    0x01
> -#define THERMAL_GENL_MCAST_GROUP_NAME           "thermal_mc_group"
> +#define THERMAL_GENL_MCAST_GROUP_NAME           "thermal_mc_grp"

Just saying that this would not be OK in general as this would
break any application looking up the multicast group id by name
via genetlink but since it's broken anyway right now it's OK I guess.

^ permalink raw reply

* [PATCH net-next 1/3] gianfar: Remove 'maybe-uninitialized' compile warning
From: Claudiu Manoil @ 2013-03-21 13:12 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller

Warning message:
warning: 'budget_per_q' may be used uninitialized in this function

budget_per_q won't be used uninitialized since the only time
it doesn't get initialized is when entering gfar_poll with
num_act_queues == 0, meaning rstat_rxf == 0, in which case
budget_per_q is not utilized (as it has no meaning).
Inititalize budget_per_q to 0 though to suppress this compile
warning.

Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com>
---
(Sorry I didn't notice this (unexpected) warning before submitting
the patches that introduced 'budget_per_q'.)

 drivers/net/ethernet/freescale/gianfar.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index 49ce83b..37fbf67 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -2838,7 +2838,7 @@ static int gfar_poll(struct napi_struct *napi, int budget)
 	struct gfar_priv_tx_q *tx_queue = NULL;
 	struct gfar_priv_rx_q *rx_queue = NULL;
 	int work_done = 0, work_done_per_q = 0;
-	int i, budget_per_q;
+	int i, budget_per_q = 0;
 	int has_tx_work;
 	unsigned long rstat_rxf;
 	int num_act_queues;
-- 
1.7.11.3

^ permalink raw reply related

* [PATCH net-next 3/3] gianfar: Remove superfluous kernel_dropped local counter
From: Claudiu Manoil @ 2013-03-21 13:12 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller
In-Reply-To: <1363871535-29612-1-git-send-email-claudiu.manoil@freescale.com>

The GRO_DROP return code is handled by the core network layer.
The current kernel approach is to factorize this kind of statistics into
the upper layers, instead of having all the drivers maintaining them.

Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com>
---
 drivers/net/ethernet/freescale/gianfar.c         | 6 +-----
 drivers/net/ethernet/freescale/gianfar.h         | 1 -
 drivers/net/ethernet/freescale/gianfar_ethtool.c | 1 -
 3 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index 434b31b..96fbe35 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -2695,8 +2695,6 @@ static void gfar_process_frame(struct net_device *dev, struct sk_buff *skb,
 	struct gfar_private *priv = netdev_priv(dev);
 	struct rxfcb *fcb = NULL;
 
-	gro_result_t ret;
-
 	/* fcb is at the beginning if exists */
 	fcb = (struct rxfcb *)skb->data;
 
@@ -2735,10 +2733,8 @@ static void gfar_process_frame(struct net_device *dev, struct sk_buff *skb,
 		__vlan_hwaccel_put_tag(skb, fcb->vlctl);
 
 	/* Send the packet up the stack */
-	ret = napi_gro_receive(napi, skb);
+	napi_gro_receive(napi, skb);
 
-	if (unlikely(GRO_DROP == ret))
-		atomic64_inc(&priv->extra_stats.kernel_dropped);
 }
 
 /* gfar_clean_rx_ring() -- Processes each frame in the rx ring
diff --git a/drivers/net/ethernet/freescale/gianfar.h b/drivers/net/ethernet/freescale/gianfar.h
index eec87ea..04b552c 100644
--- a/drivers/net/ethernet/freescale/gianfar.h
+++ b/drivers/net/ethernet/freescale/gianfar.h
@@ -629,7 +629,6 @@ struct rmon_mib
 };
 
 struct gfar_extra_stats {
-	atomic64_t kernel_dropped;
 	atomic64_t rx_large;
 	atomic64_t rx_short;
 	atomic64_t rx_nonoctet;
diff --git a/drivers/net/ethernet/freescale/gianfar_ethtool.c b/drivers/net/ethernet/freescale/gianfar_ethtool.c
index 8248df7..4e7118f 100644
--- a/drivers/net/ethernet/freescale/gianfar_ethtool.c
+++ b/drivers/net/ethernet/freescale/gianfar_ethtool.c
@@ -66,7 +66,6 @@ static void gfar_gdrvinfo(struct net_device *dev,
 			  struct ethtool_drvinfo *drvinfo);
 
 static const char stat_gstrings[][ETH_GSTRING_LEN] = {
-	"rx-dropped-by-kernel",
 	"rx-large-frame-errors",
 	"rx-short-frame-errors",
 	"rx-non-octet-errors",
-- 
1.7.11.3

^ permalink raw reply related

* [PATCH net-next 2/3] gianfar: Cleanup dead code and minor formatting
From: Claudiu Manoil @ 2013-03-21 13:12 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller
In-Reply-To: <1363871535-29612-1-git-send-email-claudiu.manoil@freescale.com>

Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com>
---
 drivers/net/ethernet/freescale/gianfar.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index 37fbf67..434b31b 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -690,7 +690,7 @@ static int gfar_of_init(struct platform_device *ofdev, struct net_device **pdev)
 	}
 
 	for (i = 0; i < priv->num_tx_queues; i++)
-	       priv->tx_queue[i] = NULL;
+		priv->tx_queue[i] = NULL;
 	for (i = 0; i < priv->num_rx_queues; i++)
 		priv->rx_queue[i] = NULL;
 
@@ -1824,6 +1824,7 @@ static void gfar_configure_coalescing(struct gfar_private *priv,
 
 	if (priv->mode == MQ_MG_MODE) {
 		int i = 0;
+
 		baddr = &regs->txic0;
 		for_each_set_bit(i, &tx_mask, priv->num_tx_queues) {
 			gfar_write(baddr + i, 0);
@@ -1838,7 +1839,7 @@ static void gfar_configure_coalescing(struct gfar_private *priv,
 				gfar_write(baddr + i, priv->rx_queue[i]->rxic);
 		}
 	} else {
-		/* Backward compatible case ---- even if we enable
+		/* Backward compatible case -- even if we enable
 		 * multiple queues, there's only single reg to program
 		 */
 		gfar_write(&regs->txic, 0);
@@ -2478,7 +2479,6 @@ static void gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue)
 	struct net_device *dev = tx_queue->dev;
 	struct netdev_queue *txq;
 	struct gfar_private *priv = netdev_priv(dev);
-	struct gfar_priv_rx_q *rx_queue = NULL;
 	struct txbd8 *bdp, *next = NULL;
 	struct txbd8 *lbdp = NULL;
 	struct txbd8 *base = tx_queue->tx_bd_base;
@@ -2493,7 +2493,6 @@ static void gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue)
 	u32 lstatus;
 	size_t buflen;
 
-	rx_queue = priv->rx_queue[tqi];
 	txq = netdev_get_tx_queue(dev, tqi);
 	bdp = tx_queue->dirty_tx;
 	skb_dirtytx = tx_queue->skb_dirtytx;
-- 
1.7.11.3

^ permalink raw reply related

* [PATCH] unix_diag: Fix definition of UNIX_DIAG_MAX
From: Thomas Graf @ 2013-03-21 13:17 UTC (permalink / raw)
  To: davem; +Cc: netdev

UNIX_DIAG_MAX should point to the maximum attribute type known
instead of + 1. User space applications compiled against the
old definition are currently passing through unknown attribute
types while parsing.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
---
 include/uapi/linux/unix_diag.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/uapi/linux/unix_diag.h b/include/uapi/linux/unix_diag.h
index b8a2494..387aab0 100644
--- a/include/uapi/linux/unix_diag.h
+++ b/include/uapi/linux/unix_diag.h
@@ -38,10 +38,11 @@ enum {
 	UNIX_DIAG_RQLEN,
 	UNIX_DIAG_MEMINFO,
 	UNIX_DIAG_SHUTDOWN,
-
-	UNIX_DIAG_MAX,
+	__UNIX_DIAG_MAX,
 };
 
+#define UNIX_DIAG_MAX (__UNIX_DIAG_MAX - 1)
+
 struct unix_diag_vfs {
 	__u32	udiag_vfs_ino;
 	__u32	udiag_vfs_dev;
-- 
1.7.11.7

^ permalink raw reply related

* Re: [PATCH] net: add ETH_P_802_3_MIN
From: Stefan Richter @ 2013-03-21 13:24 UTC (permalink / raw)
  To: Simon Horman
  Cc: dev, Karsten Keil, linux1394-devel, Carvalho Chehab, netdev,
	Gross, linux-media, Jesse, David S. Miller, Mauro
In-Reply-To: <1363854568-32228-1-git-send-email-horms@verge.net.au>

On Mar 21 Simon Horman wrote:
> Add a new constant ETH_P_802_3_MIN, the minimum ethernet type for
> an 802.3 frame. Frames with a lower value in the ethernet type field
> are Ethernet II.
> 
> Also update all the users of this value that I could find to use the
> new constant.
> 
> I anticipate adding some more users of this constant when
> adding MPLS support to Open vSwtich.
> 
> As suggested by Jesse Gross.
> 
> Compile tested only.
> 
> Cc: Jesse Gross <jesse@nicira.com>
> Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
> Cc: Karsten Keil <isdn@linux-pingi.de>
> Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
> Cc: linux1394-devel@lists.sourceforge.net
> Cc: linux-media@vger.kernel.org
> Cc: dev@openvswitch.org
> Signed-off-by: Simon Horman <horms@verge.net.au>
> ---
>  drivers/firewire/net.c           |    2 +-

Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de>

>  drivers/isdn/i4l/isdn_net.c      |    2 +-
>  drivers/media/dvb-core/dvb_net.c |    6 +++---
>  drivers/net/ethernet/sun/niu.c   |    2 +-
>  drivers/net/plip/plip.c          |    2 +-
>  include/uapi/linux/if_ether.h    |    3 +++
>  net/ethernet/eth.c               |    2 +-
>  net/openvswitch/datapath.c       |    2 +-
>  8 files changed, 12 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c
> index 2b27bff..bd34ca1 100644
> --- a/drivers/firewire/net.c
> +++ b/drivers/firewire/net.c
> @@ -630,7 +630,7 @@ static int fwnet_finish_incoming_packet(struct net_device *net,
>  			if (memcmp(eth->h_dest, net->dev_addr, net->addr_len))
>  				skb->pkt_type = PACKET_OTHERHOST;
>  		}
> -		if (ntohs(eth->h_proto) >= 1536) {
> +		if (ntohs(eth->h_proto) >= ETH_P_802_3_MIN) {
>  			protocol = eth->h_proto;
>  		} else {
>  			rawp = (u16 *)skb->data;
[...]

-- 
Stefan Richter
-=====-===-= --== =-=-=
http://arcgraph.de/sr/

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar

^ permalink raw reply

* Re: [PATCH v2 3/3 net-next] tcp: implement RFC5682 F-RTO
From: Neal Cardwell @ 2013-03-21 13:26 UTC (permalink / raw)
  To: Yuchung Cheng
  Cc: David Miller, Eric Dumazet, Nandita Dukkipati, Ilpo Jarvinen,
	Netdev
In-Reply-To: <1363822380-16687-3-git-send-email-ycheng@google.com>

On Wed, Mar 20, 2013 at 7:33 PM, Yuchung Cheng <ycheng@google.com> wrote:
> This patch implements F-RTO (foward RTO recovery):
>
> When the first retransmission after timeout is acknowledged, F-RTO
> sends new data instead of old data. If the next ACK acknowledges
> some never-retransmitted data, then the timeout was spurious and the
> congestion state is reverted.  Otherwise if the next ACK selectively
> acknowledges the new data, then the timeout was genuine and the
> loss recovery continues. This idea applies to recurring timeouts
> as well. While F-RTO sends different data during timeout recovery,
> it does not (and should not) change the congestion control.
>
> The implementaion follows the three steps of SACK enhanced algorithm
> (section 3) in RFC5682. Step 1 is in tcp_enter_loss(). Step 2 and
> 3 are in tcp_process_loss().  The basic version is not supported
> because SACK enhanced version also works for non-SACK connections.
>
> The new implementation is functionally in parity with the old F-RTO
> implementation except the one case where it increases undo events:
> In addition to the RFC algorithm, a spurious timeout may be detected
> without sending data in step 2, as long as the SACK confirms not
> all the original data are dropped. When this happens, the sender
> will undo the cwnd and perhaps enter fast recovery instead. This
> additional check increases the F-RTO undo events by 5x compared
> to the prior implementation on Google Web servers, since the sender
> often does not have new data to send for HTTP.
>
> Note F-RTO may detect spurious timeout before Eifel with timestamps
> does so.
>
> Signed-off-by: Yuchung Cheng <ycheng@google.com>
> ---
> ChangeLog in v2:
>  - Removed extra while spaces
>  - Allow F-RTO in sack reneging case to detect spurious retransmit(s)
>  - Re-tested after merging with the recent TCP tail loss probe patch
>
>  Documentation/networking/ip-sysctl.txt | 18 +++------
>  include/linux/tcp.h                    |  3 +-
>  net/ipv4/tcp_input.c                   | 73 ++++++++++++++++++++++++++++------
>  3 files changed, 68 insertions(+), 26 deletions(-)

Acked-by: Neal Cardwell <ncardwell@google.com>

^ permalink raw reply

* Re: [Xen-devel] [PATCH 2/4] xen-netfront: drop skb when skb->len > 65535
From: Wei Liu @ 2013-03-21 13:40 UTC (permalink / raw)
  To: David Vrabel
  Cc: wei.liu2, Ian Campbell, netdev@vger.kernel.org,
	annie.li@oracle.com, konrad.wilk@oracle.com,
	xen-devel@lists.xen.org
In-Reply-To: <514A15C8.1050209@citrix.com>

On Wed, 2013-03-20 at 20:02 +0000, David Vrabel wrote:

> >  		first->size -= txp->size;
> > @@ -938,6 +949,12 @@ static int netbk_count_requests(struct xenvif *vif,
> >  			return -EINVAL;
> >  		}
> >  	} while ((txp++)->flags & XEN_NETTXF_more_data);
> > +
> > +	if (drop) {
> > +		netbk_tx_err(vif, txp, idx + frags);
> 
> This needs to be netbk_tx_err(vif, first, idx + frags) or the guest will
> crash as we push a bunch of invalid responses.
> 

Can this really handle the situation when first->size overflows? In that
case frag == 0, the netbk_tx_err call is in fact netbk_tx_err(vif, txp,
idx). idx is the ring index of first txp, so in fact you're only
responding to the head txp, ignoring other tx requests for the same skb?

Even first->size doesn't overflow, a malicious / buggy frontend can
still generate tx req that makes txp->size > first->size. In that case
there could be also some trailing tx requests left un-responded.

I check the code before XSA-39 fix, its logic is more or less the same,
but it did work. My suspicion is that those trailing tx requests are
invalidated in future loops of xen_netbk_tx_build_gops.

I think the correct action is to just take first txp and loop responding
until we consume the whole packet.


Wei.


> David
> 
> > +		return -EIO;
> > +	}
> > +
> >  	return frags;
> >  }
> > 
> > @@ -1327,7 +1344,7 @@ static unsigned xen_netbk_tx_build_gops(struct
> > xen_netbk *netbk)
> >  				continue;
> >  		}
> > 
> > -		ret = netbk_count_requests(vif, &txreq, txfrags, work_to_do);
> > +		ret = netbk_count_requests(vif, &txreq, txfrags, work_to_do, idx);
> >  		if (unlikely(ret < 0))
> >  			continue;

^ permalink raw reply

* Re: [PATCH] net: add ETH_P_802_3_MIN
From: Mauro Carvalho Chehab @ 2013-03-21 14:02 UTC (permalink / raw)
  To: Simon Horman
  Cc: dev, Karsten Keil, netdev, Gross, linux-media, Stefan Richter,
	linux1394-devel, David S. Miller, Jesse
In-Reply-To: <1363854568-32228-1-git-send-email-horms@verge.net.au>

Em Thu, 21 Mar 2013 17:29:28 +0900
Simon Horman <horms@verge.net.au> escreveu:

> Add a new constant ETH_P_802_3_MIN, the minimum ethernet type for
> an 802.3 frame. Frames with a lower value in the ethernet type field
> are Ethernet II.
> 
> Also update all the users of this value that I could find to use the
> new constant.
> 
> I anticipate adding some more users of this constant when
> adding MPLS support to Open vSwtich.
> 
> As suggested by Jesse Gross.
> 
> Compile tested only.
> 
> Cc: Jesse Gross <jesse@nicira.com>
> Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
> Cc: Karsten Keil <isdn@linux-pingi.de>
> Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
> Cc: linux1394-devel@lists.sourceforge.net
> Cc: linux-media@vger.kernel.org
> Cc: dev@openvswitch.org
> Signed-off-by: Simon Horman <horms@verge.net.au>

...

> diff --git a/drivers/media/dvb-core/dvb_net.c b/drivers/media/dvb-core/dvb_net.c
> index 44225b1..9fc82a1 100644
> --- a/drivers/media/dvb-core/dvb_net.c
> +++ b/drivers/media/dvb-core/dvb_net.c
> @@ -185,7 +185,7 @@ static __be16 dvb_net_eth_type_trans(struct sk_buff *skb,
>  			skb->pkt_type=PACKET_MULTICAST;
>  	}
>  
> -	if (ntohs(eth->h_proto) >= 1536)
> +	if (ntohs(eth->h_proto) >= ETH_P_802_3_MIN)
>  		return eth->h_proto;

...

Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>

Cheers,
Mauro

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar

^ permalink raw reply

* Re: [Xen-devel] [PATCH 2/4] xen-netfront: drop skb when skb->len > 65535
From: David Vrabel @ 2013-03-21 14:11 UTC (permalink / raw)
  To: Wei Liu
  Cc: Ian Campbell, netdev@vger.kernel.org, annie.li@oracle.com,
	konrad.wilk@oracle.com, xen-devel@lists.xen.org
In-Reply-To: <1363873208.2160.13.camel@zion.uk.xensource.com>

On 21/03/13 13:40, Wei Liu wrote:
> 
> 
> I think the correct action is to just take first txp and loop responding
> until we consume the whole packet.

Um.  This is what the patch is doing.

David

^ permalink raw reply

* Re: [Xen-devel] [PATCH 2/4] xen-netfront: drop skb when skb->len > 65535
From: Wei Liu @ 2013-03-21 14:15 UTC (permalink / raw)
  To: David Vrabel
  Cc: wei.liu2, Ian Campbell, netdev@vger.kernel.org,
	annie.li@oracle.com, konrad.wilk@oracle.com,
	xen-devel@lists.xen.org
In-Reply-To: <514B151A.80705@citrix.com>

On Thu, 2013-03-21 at 14:11 +0000, David Vrabel wrote:
> On 21/03/13 13:40, Wei Liu wrote:
> > 
> > 
> > I think the correct action is to just take first txp and loop responding
> > until we consume the whole packet.
> 
> Um.  This is what the patch is doing.
> 

No. The idx you passed in is the index of the first txp, and idx + fras
doesn't necessary point to last tx requests of the packet. We should use
XEN_NETTXF_more_data to loop through the packet.


Wei.

> David

^ permalink raw reply

* [PATCH] net: fix *_DIAG_MAX constants
From: Andrey Vagin @ 2013-03-21 14:18 UTC (permalink / raw)
  To: Thomas Graf, linux-kernel, netdev
  Cc: Andrey Vagin, David S. Miller, Pavel Emelyanov, Eric Dumazet,
	Paul E. McKenney, David Howells

Follow the common pattern and define *_DIAG_MAX like:

        [...]
        __XXX_DIAG_MAX,
};

Because everyone is used to do:

        struct nlattr *attrs[XXX_DIAG_MAX+1];

        nla_parse([...], XXX_DIAG_MAX, [...]

Reported-by: Thomas Graf <tgraf@suug.ch>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Pavel Emelyanov <xemul@parallels.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
---
 include/uapi/linux/netlink_diag.h | 4 +++-
 include/uapi/linux/packet_diag.h  | 4 +++-
 include/uapi/linux/unix_diag.h    | 4 +++-
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/include/uapi/linux/netlink_diag.h b/include/uapi/linux/netlink_diag.h
index 9328866..88009a3 100644
--- a/include/uapi/linux/netlink_diag.h
+++ b/include/uapi/linux/netlink_diag.h
@@ -29,9 +29,11 @@ enum {
 	NETLINK_DIAG_MEMINFO,
 	NETLINK_DIAG_GROUPS,
 
-	NETLINK_DIAG_MAX,
+	__NETLINK_DIAG_MAX,
 };
 
+#define NETLINK_DIAG_MAX (__NETLINK_DIAG_MAX - 1)
+
 #define NDIAG_PROTO_ALL		((__u8) ~0)
 
 #define NDIAG_SHOW_MEMINFO	0x00000001 /* show memory info of a socket */
diff --git a/include/uapi/linux/packet_diag.h b/include/uapi/linux/packet_diag.h
index 93f5fa9..afafd70 100644
--- a/include/uapi/linux/packet_diag.h
+++ b/include/uapi/linux/packet_diag.h
@@ -33,9 +33,11 @@ enum {
 	PACKET_DIAG_TX_RING,
 	PACKET_DIAG_FANOUT,
 
-	PACKET_DIAG_MAX,
+	__PACKET_DIAG_MAX,
 };
 
+#define PACKET_DIAG_MAX (__PACKET_DIAG_MAX - 1)
+
 struct packet_diag_info {
 	__u32	pdi_index;
 	__u32	pdi_version;
diff --git a/include/uapi/linux/unix_diag.h b/include/uapi/linux/unix_diag.h
index b8a2494..b9e2a6a 100644
--- a/include/uapi/linux/unix_diag.h
+++ b/include/uapi/linux/unix_diag.h
@@ -39,9 +39,11 @@ enum {
 	UNIX_DIAG_MEMINFO,
 	UNIX_DIAG_SHUTDOWN,
 
-	UNIX_DIAG_MAX,
+	__UNIX_DIAG_MAX,
 };
 
+#define UNIX_DIAG_MAX (__UNIX_DIAG_MAX - 1)
+
 struct unix_diag_vfs {
 	__u32	udiag_vfs_ino;
 	__u32	udiag_vfs_dev;
-- 
1.8.1.4

^ permalink raw reply related

* Re: [Xen-devel] [PATCH 2/4] xen-netfront: drop skb when skb->len > 65535
From: Wei Liu @ 2013-03-21 14:20 UTC (permalink / raw)
  To: David Vrabel
  Cc: wei.liu2, Ian Campbell, netdev@vger.kernel.org,
	annie.li@oracle.com, konrad.wilk@oracle.com,
	xen-devel@lists.xen.org
In-Reply-To: <1363875350.2160.16.camel@zion.uk.xensource.com>

On Thu, 2013-03-21 at 14:15 +0000, Wei Liu wrote:
> On Thu, 2013-03-21 at 14:11 +0000, David Vrabel wrote:
> > On 21/03/13 13:40, Wei Liu wrote:
> > > 
> > > 
> > > I think the correct action is to just take first txp and loop responding
> > > until we consume the whole packet.
> > 
> > Um.  This is what the patch is doing.
> > 
> 
> No. The idx you passed in is the index of the first txp, and idx + fras
> doesn't necessary point to last tx requests of the packet. We should use
> XEN_NETTXF_more_data to loop through the packet.
> 

Sorry for the noise, this patch already loop through the whole packet.


Wei.

> 
> Wei.
> 
> > David
> 
> 

^ permalink raw reply

* Re: [PATCH 2/2] netlink: Diag core and basic socket info dumping
From: Andrew Vagin @ 2013-03-21 14:31 UTC (permalink / raw)
  To: Thomas Graf
  Cc: Andrey Vagin, linux-kernel, netdev, David S. Miller, Eric Dumazet,
	Pavel Emelyanov, Pablo Neira Ayuso, Eric W. Biederman, Gao feng
In-Reply-To: <20130321125230.GB9046@casper.infradead.org>

On Thu, Mar 21, 2013 at 12:52:30PM +0000, Thomas Graf wrote:
> On 03/21/13 at 01:21pm, Andrey Vagin wrote:
> > diff --git a/include/uapi/linux/netlink_diag.h b/include/uapi/linux/netlink_diag.h
> > new file mode 100644
> > index 0000000..9328866
> > --- /dev/null
> > +++ b/include/uapi/linux/netlink_diag.h
> > +enum {
> > +	NETLINK_DIAG_MEMINFO,
> > +	NETLINK_DIAG_GROUPS,
> > +
> > +	NETLINK_DIAG_MAX,
> > +};
> 
> Please follow the common pattern and define NETLINK_DIAG_MAX as
> NETLINK_DIAG_GROUPS like other by doing>
> 
> 	[...] 
>         __NETLINK_DIAG_MAX,
> };
>  
> #define NETLINK_DIAG_MAX (__NETLINK_DIAG_MAX - 1)
>  
> Everyone is used to do:
>  
>         struct nlattr *attrs[NETLINK_DIAG_MAX+1];
>          
>         nla_parse([...], NETLINK_DIAG_MAX, [...]
> 

Thank you for this issue. I sent the separate patch
"[PATCH] net: fix *_DIAG_MAX constants", because currently only
INET_DIAG_MAX is correct.

> In fact, the follow-up patch to ss is buggy because of this.
> UNIX_DIAG_MAX suffers from the same problem which is problem the
> cause for this.

The code in ss looks like you described:
        struct rtattr *tb[UNIX_DIAG_MAX+1];
...
        parse_rtattr(tb, UNIX_DIAG_MAX, (struct rtattr*)(r+1),
                     nlh->nlmsg_len - NLMSG_LENGTH(sizeof(*r)));


        struct rtattr *tb[NETLINK_DIAG_MAX+1];
...
        parse_rtattr(tb, NETLINK_DIAG_MAX, (struct rtattr*)(r+1),
                     nlh->nlmsg_len - NLMSG_LENGTH(sizeof(*r)))

I think I should only update headers... Or I don't understand something.

^ permalink raw reply

* [BUG NFQUEUE] NFQUEUE readers get -PERM from sys_sendto() if !root
From: Holger Eitzenberger @ 2013-03-21 14:36 UTC (permalink / raw)
  To: netfilter-devel; +Cc: netdev, Eric W. Biederman

Hi,

after updating to kernel v3.8.4 I see that Netfilter NFQUEUE readers
get -EPERM from sys_sendto() at the time they try to inject the verdict
back to the kernel.  This only occurs iff not running as 'root'.

The last working kernel is v3.7.7.

Skimming through the changeset since v3.7.7 the following changes
pop up:

 userns: Require CAP_SYS_ADMIN for most uses of setns.
 userns: Allow unprivileged use of setns.

So it could be related to my current namespace config, which is

  CONFIG_NAMESPACES=y
  # CONFIG_UTS_NS is not set
  # CONFIG_IPC_NS is not set
  # CONFIG_USER_NS is not set
  # CONFIG_PID_NS is not set
  # CONFIG_NET_NS is not set

I rate this a major issue, as quite some of those programs
drop privileges for various reasons.

Is this a known issue?  Well, I skimmed through the list, but didn't
find anything.

 /Holger


^ permalink raw reply

* Re: [PATCH] unix_diag: Fix definition of UNIX_DIAG_MAX
From: Thomas Graf @ 2013-03-21 14:40 UTC (permalink / raw)
  To: davem; +Cc: netdev
In-Reply-To: <7c4a72239f4795677484c99c105ef5f27c12d246.1363871797.git.tgraf@suug.ch>

On 03/21/13 at 02:17pm, Thomas Graf wrote:
> UNIX_DIAG_MAX should point to the maximum attribute type known
> instead of + 1. User space applications compiled against the
> old definition are currently passing through unknown attribute
> types while parsing.
> 
> Signed-off-by: Thomas Graf <tgraf@suug.ch>

Disregard this patch, the patch 

        [PATCH] net: fix *_DIAG_MAX constants

is more complete.

^ permalink raw reply

* Re: [PATCH 2/2] netlink: Diag core and basic socket info dumping
From: Thomas Graf @ 2013-03-21 14:41 UTC (permalink / raw)
  To: Andrew Vagin
  Cc: Andrey Vagin, linux-kernel, netdev, David S. Miller, Eric Dumazet,
	Pavel Emelyanov, Pablo Neira Ayuso, Eric W. Biederman, Gao feng
In-Reply-To: <20130321143119.GA14763@paralelels.com>

On 03/21/13 at 06:31pm, Andrew Vagin wrote:
> The code in ss looks like you described:
>         struct rtattr *tb[UNIX_DIAG_MAX+1];
> ...
>         parse_rtattr(tb, UNIX_DIAG_MAX, (struct rtattr*)(r+1),
>                      nlh->nlmsg_len - NLMSG_LENGTH(sizeof(*r)));
> 
> 
>         struct rtattr *tb[NETLINK_DIAG_MAX+1];
> ...
>         parse_rtattr(tb, NETLINK_DIAG_MAX, (struct rtattr*)(r+1),
>                      nlh->nlmsg_len - NLMSG_LENGTH(sizeof(*r)))
> 
> I think I should only update headers... Or I don't understand something.

Right, fixing the headers will resolve the issue.

^ permalink raw reply

* Re: [BUG] bisected: PandaBoard smsc95xx ethernet driver error from USB timeout
From: Alan Stern @ 2013-03-21 14:41 UTC (permalink / raw)
  To: Frank Rowand
  Cc: gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA, balbi-l0cyMroinI0,
	netdev-u79uwXL29TY76Z2rM5mHXA, steve.glendinning-sdUf+H5yV5I
In-Reply-To: <514A7E81.9000501-mEdOJwZ7QcZBDgjK7y7TUQ@public.gmane.org>

On Wed, 20 Mar 2013, Frank Rowand wrote:

> Hi All,
> 
> Not quite sure quite where the problem is (USB, OMAP, smsc95xx driver, other???),
> so casting the nets wide...
> 
> The PandaBoard frequently fails to boot with an eth0 error when mounting
> the root file system via NFS (ethernet driver fails due to a USB timeout;
> no ethernet means NFS won't work).  A typical set of error messages is:
> 
> [    3.264373] smsc95xx 1-1.1:1.0: usb_probe_interface
> [    3.269500] smsc95xx 1-1.1:1.0: usb_probe_interface - got id
> [    3.275543] smsc95xx v1.0.4
> [    8.078674] smsc95xx 1-1.1:1.0: eth0: register 'smsc95xx' at usb-ehci-omap.0-1.1, smsc95xx USB 2.0 Ethernet, 82:b9:1d:fa:67:0d
> [    8.091003] hub 1-1:1.0: state 7 ports 5 chg 0000 evt 0002
> [   13.509918] usb 1-1.1: swapper/0 timed out on ep0out len=0/4
> [   13.515869] smsc95xx 1-1.1:1.0: eth0: Failed to write register index 0x00000108
> [   13.523559] smsc95xx 1-1.1:1.0: eth0: Failed to write ADDRL: -110
> [   13.529998] IP-Config: Failed to open eth0
> 
> I have bisected this to:
> 
>   commit 18aafe64d75d0e27dae206cacf4171e4e485d285
>   Author: Alan Stern <stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org>
>   Date:   Wed Jul 11 11:23:04 2012 -0400
> 
>      USB: EHCI: use hrtimer for the I/O watchdog

I don't understand how that commit could cause a timeout unless there 
are at least two other bugs present in your system.

> Note that to compile this version of the kernel, an additional fix must
> also be applied:
> 
>   commit ba5952e0711b14d8d4fe172671f8aa6091ace3ee
>   Author: Ming Lei <ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
>   Date:   Fri Jul 13 17:25:24 2012 +0800
> 
>      USB: ehci-omap: fix compile failure(v1)
> 
> The symptom can be worked around by retrying the USB access if a timeout
> occurs.  This is clearly _not_ the fix, just a hack that I used to
> investigate the problem:
> 
>   http://article.gmane.org/gmane.linux.rt.user/9773
> 
> My kernel configuration is:
> 
>   arch/arm/configs/omap2plus_defconfig
> 
>   plus to get the ethernet driver I add:
> 
>     CONFIG_USB_EHCI_HCD
>     CONFIG_USB_NET_SMSC95XX
> 
> I found the problem on 3.6.11, but have not replicated it on 3.9-rcX
> yet because my config fails to build on 3.9-rc1 and 3.9-rc2.  I'll try
> to work on that issue tomorrow.

Let me know how it works out.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" 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] net: fix *_DIAG_MAX constants
From: Thomas Graf @ 2013-03-21 14:42 UTC (permalink / raw)
  To: Andrey Vagin
  Cc: linux-kernel, netdev, David S. Miller, Pavel Emelyanov,
	Eric Dumazet, Paul E. McKenney, David Howells
In-Reply-To: <1363875500-14574-1-git-send-email-avagin@openvz.org>

On 03/21/13 at 06:18pm, Andrey Vagin wrote:
> Follow the common pattern and define *_DIAG_MAX like:
> 
>         [...]
>         __XXX_DIAG_MAX,
> };
> 
> Because everyone is used to do:
> 
>         struct nlattr *attrs[XXX_DIAG_MAX+1];
> 
>         nla_parse([...], XXX_DIAG_MAX, [...]
> 
> Reported-by: Thomas Graf <tgraf@suug.ch>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Pavel Emelyanov <xemul@parallels.com>
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> Cc: David Howells <dhowells@redhat.com>
> Signed-off-by: Andrey Vagin <avagin@openvz.org>

Acked-by: Thomas Graf <tgraf@suug.ch>

^ 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