Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH v2 4/7] per-cgroup tcp buffers control
From: Kirill A. Shutemov @ 2011-09-18 18:58 UTC (permalink / raw)
  To: Cyrill Gorcunov
  Cc: Glauber Costa, linux-kernel, paul, lizf, kamezawa.hiroyu,
	ebiederm, davem, gthelen, netdev, linux-mm
In-Reply-To: <20110917183358.GB2783@moon>

On Sat, Sep 17, 2011 at 10:33:58PM +0400, Cyrill Gorcunov wrote:
> On Sat, Sep 17, 2011 at 09:11:32PM +0300, Kirill A. Shutemov wrote:
> > On Wed, Sep 14, 2011 at 10:46:12PM -0300, Glauber Costa wrote:
> > > +int tcp_init_cgroup_fill(struct proto *prot, struct cgroup *cgrp,
> > > +			 struct cgroup_subsys *ss)
> > > +{
> > > +	prot->enter_memory_pressure	= tcp_enter_memory_pressure;
> > > +	prot->memory_allocated		= memory_allocated_tcp;
> > > +	prot->prot_mem			= tcp_sysctl_mem;
> > > +	prot->sockets_allocated		= sockets_allocated_tcp;
> > > +	prot->memory_pressure		= memory_pressure_tcp;
> > 
> > No fancy formatting, please.
> > 
> 
> What's wrong with having fancy formatting? It's indeed easier to read
> when members are assigned this way. It's always up to maintainer to
> choose what he prefers, but I see nothing wrong in such style (if only it
> doesn't break the style of the whole file).

You have to remove this indenting if you'll reorganize code (e.g. move
part under if(...)).
IMO, it reduces code maintainability.

-- 
 Kirill A. Shutemov

^ permalink raw reply

* Re: [PATCH ] dynamic_debug: call __netdev_printk only for CONFIG_NET
From: Randy Dunlap @ 2011-09-18 18:42 UTC (permalink / raw)
  To: Greg KH
  Cc: Jason Baron, Arnd Bergmann, gregkh, joe, jim.cromie, bvanassche,
	linux-kernel, davem, aloisio.almeida, netdev
In-Reply-To: <20110918182714.GA32615@kroah.com>

On 09/18/2011 11:27 AM, Greg KH wrote:
> On Sun, Sep 18, 2011 at 10:21:14AM -0700, Randy Dunlap wrote:
>> On 09/18/2011 01:27 AM, Greg KH wrote:
>>> On Thu, Sep 01, 2011 at 11:18:18AM -0400, Jason Baron wrote:
>>>> On Thu, Sep 01, 2011 at 04:57:02PM +0200, Arnd Bergmann wrote:
>>>>> __netdev_printk is only defined when CONFIG_NET is set. Since we only need
>>>>> __dynamic_netdev_dbg for network drivers, we can make it conditional on the
>>>>> same Kconfig symbol.
>>>>>
>>>>
>>>> Hi,
>>>>
>>>> Yes, I've posted a fix for this:
>>>>
>>>> https://lkml.org/lkml/2011/8/30/297
>>>>
>>>> Hopefully, it will be pulled in soon.
>>>
>>> As that thread again spun off into confusion, can you please resend the
>>> end result?
>>
>> That spinning confusion had nothing to do with the posted & correct patch
>> which could have been applied several weeks ago.
>>
>> I'm curious:  Do you delete most of your email on a routine basis?
> 
> No, only after going through pending patches do I purge them.  And when
> a series of patches generates a thread like this one, where people are
> arguing over the way the macros are named, and no one seems to agree, I
> will take it as the fact that this series was contentious and needs to
> be resent after taking into consideration the original complaints.

Sheesh.  The naming of the macros has nothing to do with this build fix.

> For me to keep all email threads, based on the amount of email I get[1],
> would be ludicrous.
> 
> greg k-h
> 
> [1]: http://www.kroah.com/log/linux/get_lots_of_email.html


-- 
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

^ permalink raw reply

* Re: [PATCH ] dynamic_debug: call __netdev_printk only for CONFIG_NET
From: Greg KH @ 2011-09-18 18:27 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Jason Baron, Arnd Bergmann, gregkh, joe, jim.cromie, bvanassche,
	linux-kernel, davem, aloisio.almeida, netdev
In-Reply-To: <4E76288A.4020801@xenotime.net>

On Sun, Sep 18, 2011 at 10:21:14AM -0700, Randy Dunlap wrote:
> On 09/18/2011 01:27 AM, Greg KH wrote:
> > On Thu, Sep 01, 2011 at 11:18:18AM -0400, Jason Baron wrote:
> >> On Thu, Sep 01, 2011 at 04:57:02PM +0200, Arnd Bergmann wrote:
> >>> __netdev_printk is only defined when CONFIG_NET is set. Since we only need
> >>> __dynamic_netdev_dbg for network drivers, we can make it conditional on the
> >>> same Kconfig symbol.
> >>>
> >>
> >> Hi,
> >>
> >> Yes, I've posted a fix for this:
> >>
> >> https://lkml.org/lkml/2011/8/30/297
> >>
> >> Hopefully, it will be pulled in soon.
> > 
> > As that thread again spun off into confusion, can you please resend the
> > end result?
> 
> That spinning confusion had nothing to do with the posted & correct patch
> which could have been applied several weeks ago.
> 
> I'm curious:  Do you delete most of your email on a routine basis?

No, only after going through pending patches do I purge them.  And when
a series of patches generates a thread like this one, where people are
arguing over the way the macros are named, and no one seems to agree, I
will take it as the fact that this series was contentious and needs to
be resent after taking into consideration the original complaints.

For me to keep all email threads, based on the amount of email I get[1],
would be ludicrous.

greg k-h

[1]: http://www.kroah.com/log/linux/get_lots_of_email.html

^ permalink raw reply

* Re: [PATCH 4/4] net/fec: add imx6q enet support
From: Francois Romieu @ 2011-09-18 18:09 UTC (permalink / raw)
  To: Shawn Guo; +Cc: netdev, David S. Miller, linux-arm-kernel, patches
In-Reply-To: <1316346852-17090-5-git-send-email-shawn.guo@linaro.org>

Shawn Guo <shawn.guo@linaro.org> :
[...]
> diff --git a/drivers/net/fec.c b/drivers/net/fec.c
> index 04206e4..849cb0b 100644
> --- a/drivers/net/fec.c
> +++ b/drivers/net/fec.c
> @@ -442,18 +453,23 @@ fec_restart(struct net_device *ndev, int duplex)
>  		/* Enable flow control and length check */
>  		rcntl |= 0x40000000 | 0x00000020;
>  
> -		/* MII or RMII */
> +		/* RGMII, RMII or MII */
> +		if (fep->phy_interface == PHY_INTERFACE_MODE_RGMII)
> +			rcntl |= (1 << 6);
>  		if (fep->phy_interface == PHY_INTERFACE_MODE_RMII)
           ^^^^ missing "else"

[...]
> +		/* 1G, 100M or 10M */
> +		if (fep->phy_dev) {
> +			if (fep->phy_dev->speed == SPEED_1000)
> +				ecntl |= (1 << 8);
> +			else if (fep->phy_dev->speed == SPEED_100)
> +				rcntl &= ~(1 << 9);
> +			else
> +				rcntl |= (1 << 9);
> +		}
[...]
> +	if (id_entry->driver_data & FEC_QUIRK_ENET_MAC) {
> +		/* enable ENET endian swap */
> +		ecntl |= (1 << 8);

I do not understand why the endian swap bit of ecntl needs to be
set the same in these two different paths, especially as the latter
handles the old faulty imx28 and the former the newly fixed imx6q.
Typo ?

-- 
Ueimor

^ permalink raw reply

* Re: [GIT] Networking
From: Linus Torvalds @ 2011-09-18 18:06 UTC (permalink / raw)
  To: David Miller; +Cc: akpm, netdev, linux-kernel
In-Reply-To: <20110918.022125.1554085675403900813.davem@davemloft.net>

2011/9/17 David Miller <davem@davemloft.net>:
>
> dpward (2):
>      net: Make flow cache namespace-aware
>      net: Handle different key sizes between address families in flow cache
>
> nhorman (1):
>      net: don't clear IFF_XMIT_DST_RELEASE in ether_setup
>
> rajan.aggarwal85@gmail.com (1):
>      net/can/af_can.c: Change del_timer to del_timer_sync

Guys, if somebody has such a broken email setup that they don't even
show their own name, don't take patches from them.

If you cannot even set up email sanely, there is zero reason to
believe that the patch should be good. And if the patch is trivial and
you want to take it despite the source of the patch being crap, please
spend the five seconds to fix it up.

Proper names are part of the commit message. Don't make it look like
crap. I get ugly flashbacks to SVN or CVS when I see stuff like this.
Don't do it.

                          Linus

^ permalink raw reply

* Re: [PATCH ] dynamic_debug: call __netdev_printk only for CONFIG_NET
From: Randy Dunlap @ 2011-09-18 17:21 UTC (permalink / raw)
  To: Greg KH
  Cc: Jason Baron, Arnd Bergmann, gregkh, joe, jim.cromie, bvanassche,
	linux-kernel, davem, aloisio.almeida, netdev
In-Reply-To: <20110918082736.GB19444@kroah.com>

On 09/18/2011 01:27 AM, Greg KH wrote:
> On Thu, Sep 01, 2011 at 11:18:18AM -0400, Jason Baron wrote:
>> On Thu, Sep 01, 2011 at 04:57:02PM +0200, Arnd Bergmann wrote:
>>> __netdev_printk is only defined when CONFIG_NET is set. Since we only need
>>> __dynamic_netdev_dbg for network drivers, we can make it conditional on the
>>> same Kconfig symbol.
>>>
>>
>> Hi,
>>
>> Yes, I've posted a fix for this:
>>
>> https://lkml.org/lkml/2011/8/30/297
>>
>> Hopefully, it will be pulled in soon.
> 
> As that thread again spun off into confusion, can you please resend the
> end result?

That spinning confusion had nothing to do with the posted & correct patch
which could have been applied several weeks ago.

I'm curious:  Do you delete most of your email on a routine basis?

-- 
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

^ permalink raw reply

* Follow-up to routing IPv6 source address selection bug in kernel
From: Xavier Roche @ 2011-09-18 14:11 UTC (permalink / raw)
  To: netdev

[ Moved from linux-kernel where it did not belong ]

Hi folks,

I reported a year ago a bug regarding source address selection in the
kernel for Ipv6, but it seem to be still there. If anyone has any
insightful advice on possible workarounds, or (better) possible fixes,
it would be great.

Basically, the "src" attribute of "ip -6 route add" is ignored, and
default source address selection is selected by the kernel.

This is probably related to the way the kernel handles RFC 3484 source
address selection [ The RFC states that [RFC 3484] "If the eight [source
address selection] rules fail to choose a single address, some
unspecified tie-breaker should be used". The unspecified tie-breaker
would then be the src routing information, or any additional netfilter
setting. ]

Selecting the source address according to outgoing parameters
(destination network, destination protocol, for example, but it could be
running uid/gid with advanced netfilter rules) is kind of handy when you
want to have dedicated addresses for, say, outgoing SMTP, outgoing HTTP,
outgoing SSH and so on..

This is especially true with IPv6: the default allocated size is at
least 16 billions billions IP addresses. Being able to use more than one
address per server is then kind of handy.

Binding to a special IP address for outgoing connections is difficult in
most cases, because the application would have to do the logic the
kernel is computing normally (destination on local network ? or on the
same interface ..) and would prevent proper use when multiple
interfaces/networks are in use.

The simplest way to achieve that would be to build a dedicated route for
a specific netblock, for example (this would not solve the
"per-destination-protocol" case, but this is a beginning). As I said
before, it unfortunately does not work.

Note that:

- Marking packets and using policy-based routing is not possible either
(as I understood, the source address has already been computed at this
point and the packet is built, so this is too late)

- Source NATing is also impossible (not implemented on IPv6)

- The /etc/gai.conf tuning file is no help for this purpose either.

I understand this is not a major kernel issue, but this is a really
annoying limitation when you have an almost infinite address space unused :)

[ Note: see also "src attribute ignored for IPv6 (preferred source
address selection)" in linux-netdev mailing-list one year ago. ]

^ permalink raw reply

* Re: [PATCH 1/2] iwlegacy: change IWL_WARN to IWL_DEBUG_HT in iwl4965_tx_agg_start
From: Greg Dietsche @ 2011-09-18 14:41 UTC (permalink / raw)
  To: Stanislaw Gruszka; +Cc: linville, linux-wireless, netdev, linux-kernel
In-Reply-To: <20110908161129.GC2195@redhat.com>

On Thu, 8 Sep 2011 18:11:30 +0200, Stanislaw Gruszka wrote:

<snip>

> The second patch is ok. I'm not sure about first one, but we can get
> rid of "ctx = il_rxon_ctx_from_vif(vif)" at all, because we have
> only one context. Removing il_rxon_context structure from
> iwlegacy driver is my long term plan, you can look at that
> if you wish.
Sounds good. I'll let you know if I start to remove the il_rxon_context 
structure. It looks right now like I might not have much free time in 
the near future.

Greg

^ permalink raw reply

* (unknown)
From: Mrs. Tessy Brown @ 2011-09-18 13:54 UTC (permalink / raw)




Win $500,000 in Coca Cola Company @West Africa end of year 
promo.To qualify, Email the correct answer to the question given below 
to Mr. Frank Morris via(frankmorris10@ymail.com)
Question: Who won the 2010 FIFA World Cup in South Africa? 
(A)England (B)Spain (C)Germany (D)Brazil.

^ permalink raw reply

* [PATCH 4/4] net/fec: add imx6q enet support
From: Shawn Guo @ 2011-09-18 11:54 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller, linux-arm-kernel, patches, Shawn Guo
In-Reply-To: <1316346852-17090-1-git-send-email-shawn.guo@linaro.org>

The imx6q enet is a derivative of imx28 enet controller.  It fixed
the frame endian issue found on imx28, and added 1 Gbps support.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 drivers/net/Kconfig |    3 +-
 drivers/net/fec.c   |   59 +++++++++++++++++++++++++++++++++++++++++---------
 2 files changed, 49 insertions(+), 13 deletions(-)

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 8d0314d..fb38962 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -1937,8 +1937,7 @@ config DECLANCE
 config FEC
 	bool "FEC ethernet controller (of ColdFire and some i.MX CPUs)"
 	depends on M523x || M527x || M5272 || M528x || M520x || M532x || \
-		IMX_HAVE_PLATFORM_FEC || MXS_HAVE_PLATFORM_FEC
-	default IMX_HAVE_PLATFORM_FEC || MXS_HAVE_PLATFORM_FEC if ARM
+		ARCH_MXC || ARCH_MXS
 	select PHYLIB
 	help
 	  Say Y here if you want to use the built-in 10/100 Fast ethernet
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 04206e4..849cb0b 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -18,7 +18,7 @@
  * Bug fixes and cleanup by Philippe De Muyter (phdm@macqel.be)
  * Copyright (c) 2004-2006 Macq Electronique SA.
  *
- * Copyright (C) 2010 Freescale Semiconductor, Inc.
+ * Copyright (C) 2010-2011 Freescale Semiconductor, Inc.
  */
 
 #include <linux/module.h>
@@ -72,6 +72,10 @@
 #define FEC_QUIRK_SWAP_FRAME		(1 << 1)
 /* Controller uses gasket */
 #define FEC_QUIRK_USE_GASKET		(1 << 2)
+/* Controller has GBIT support */
+#define FEC_QUIRK_HAS_GBIT		(1 << 3)
+/* Controller's phy_speed bit field need to minus one */
+#define FEC_QUIRK_PHY_SPEED_MINUS_ONE	(1 << 4)
 
 static struct platform_device_id fec_devtype[] = {
 	{
@@ -88,6 +92,10 @@ static struct platform_device_id fec_devtype[] = {
 		.name = "imx28-fec",
 		.driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_SWAP_FRAME,
 	}, {
+		.name = "imx6q-fec",
+		.driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT |
+			       FEC_QUIRK_PHY_SPEED_MINUS_ONE,
+	}, {
 		/* sentinel */
 	}
 };
@@ -97,12 +105,14 @@ enum imx_fec_type {
 	IMX25_FEC = 1, 	/* runs on i.mx25/50/53 */
 	IMX27_FEC,	/* runs on i.mx27/35/51 */
 	IMX28_FEC,
+	IMX6Q_FEC,
 };
 
 static const struct of_device_id fec_dt_ids[] = {
 	{ .compatible = "fsl,imx25-fec", .data = &fec_devtype[IMX25_FEC], },
 	{ .compatible = "fsl,imx27-fec", .data = &fec_devtype[IMX27_FEC], },
 	{ .compatible = "fsl,imx28-fec", .data = &fec_devtype[IMX28_FEC], },
+	{ .compatible = "fsl,imx6q-fec", .data = &fec_devtype[IMX6Q_FEC], },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, fec_dt_ids);
@@ -373,6 +383,7 @@ fec_restart(struct net_device *ndev, int duplex)
 	int i;
 	u32 temp_mac[2];
 	u32 rcntl = OPT_FRAME_SIZE | 0x04;
+	u32 ecntl = 0x2; /* ETHEREN */
 
 	/* Whack a reset.  We should wait for this. */
 	writel(1, fep->hwp + FEC_ECNTRL);
@@ -442,18 +453,23 @@ fec_restart(struct net_device *ndev, int duplex)
 		/* Enable flow control and length check */
 		rcntl |= 0x40000000 | 0x00000020;
 
-		/* MII or RMII */
+		/* RGMII, RMII or MII */
+		if (fep->phy_interface == PHY_INTERFACE_MODE_RGMII)
+			rcntl |= (1 << 6);
 		if (fep->phy_interface == PHY_INTERFACE_MODE_RMII)
 			rcntl |= (1 << 8);
 		else
 			rcntl &= ~(1 << 8);
 
-		/* 10M or 100M */
-		if (fep->phy_dev && fep->phy_dev->speed == SPEED_100)
-			rcntl &= ~(1 << 9);
-		else
-			rcntl |= (1 << 9);
-
+		/* 1G, 100M or 10M */
+		if (fep->phy_dev) {
+			if (fep->phy_dev->speed == SPEED_1000)
+				ecntl |= (1 << 8);
+			else if (fep->phy_dev->speed == SPEED_100)
+				rcntl &= ~(1 << 9);
+			else
+				rcntl |= (1 << 9);
+		}
 	} else {
 #ifdef FEC_MIIGSK_ENR
 		if (id_entry->driver_data & FEC_QUIRK_USE_GASKET) {
@@ -478,8 +494,15 @@ fec_restart(struct net_device *ndev, int duplex)
 	}
 	writel(rcntl, fep->hwp + FEC_R_CNTRL);
 
+	if (id_entry->driver_data & FEC_QUIRK_ENET_MAC) {
+		/* enable ENET endian swap */
+		ecntl |= (1 << 8);
+		/* enable ENET store and forward mode */
+		writel(1 << 8, fep->hwp + FEC_X_WMRK);
+	}
+
 	/* And last, enable the transmit and receive processing */
-	writel(2, fep->hwp + FEC_ECNTRL);
+	writel(ecntl, fep->hwp + FEC_ECNTRL);
 	writel(0, fep->hwp + FEC_R_DES_ACTIVE);
 
 	/* Enable interrupts we wish to service */
@@ -490,6 +513,8 @@ static void
 fec_stop(struct net_device *ndev)
 {
 	struct fec_enet_private *fep = netdev_priv(ndev);
+	const struct platform_device_id *id_entry =
+				platform_get_device_id(fep->pdev);
 
 	/* We cannot expect a graceful transmit stop without link !!! */
 	if (fep->link) {
@@ -504,6 +529,10 @@ fec_stop(struct net_device *ndev)
 	udelay(10);
 	writel(fep->phy_speed, fep->hwp + FEC_MII_SPEED);
 	writel(FEC_DEFAULT_IMASK, fep->hwp + FEC_IMASK);
+
+	/* We have to keep ENET enabled to have MII interrupt stay working */
+	if (id_entry->driver_data & FEC_QUIRK_ENET_MAC)
+		writel(2, fep->hwp + FEC_ECNTRL);
 }
 
 
@@ -918,6 +947,8 @@ static int fec_enet_mdio_reset(struct mii_bus *bus)
 static int fec_enet_mii_probe(struct net_device *ndev)
 {
 	struct fec_enet_private *fep = netdev_priv(ndev);
+	const struct platform_device_id *id_entry =
+				platform_get_device_id(fep->pdev);
 	struct phy_device *phy_dev = NULL;
 	char mdio_bus_id[MII_BUS_ID_SIZE];
 	char phy_name[MII_BUS_ID_SIZE + 3];
@@ -949,14 +980,18 @@ static int fec_enet_mii_probe(struct net_device *ndev)
 
 	snprintf(phy_name, MII_BUS_ID_SIZE, PHY_ID_FMT, mdio_bus_id, phy_id);
 	phy_dev = phy_connect(ndev, phy_name, &fec_enet_adjust_link, 0,
-		PHY_INTERFACE_MODE_MII);
+			      fep->phy_interface);
 	if (IS_ERR(phy_dev)) {
 		printk(KERN_ERR "%s: could not attach to PHY\n", ndev->name);
 		return PTR_ERR(phy_dev);
 	}
 
 	/* mask with MAC supported features */
-	phy_dev->supported &= PHY_BASIC_FEATURES;
+	if (id_entry->driver_data & FEC_QUIRK_HAS_GBIT)
+		phy_dev->supported &= PHY_GBIT_FEATURES;
+	else
+		phy_dev->supported &= PHY_BASIC_FEATURES;
+
 	phy_dev->advertising = phy_dev->supported;
 
 	fep->phy_dev = phy_dev;
@@ -1008,6 +1043,8 @@ static int fec_enet_mii_init(struct platform_device *pdev)
 	 * Set MII speed to 2.5 MHz (= clk_get_rate() / 2 * phy_speed)
 	 */
 	fep->phy_speed = DIV_ROUND_UP(clk_get_rate(fep->clk), 5000000);
+	if (id_entry->driver_data & FEC_QUIRK_PHY_SPEED_MINUS_ONE)
+		fep->phy_speed--;
 	writel(fep->phy_speed, fep->hwp + FEC_MII_SPEED);
 
 	fep->mii_bus = mdiobus_alloc();
-- 
1.7.4.1

^ permalink raw reply related

* [PATCH 3/4] net/fec: set phy_speed to the optimal frequency 2.5 MHz
From: Shawn Guo @ 2011-09-18 11:54 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller, linux-arm-kernel, patches, Shawn Guo
In-Reply-To: <1316346852-17090-1-git-send-email-shawn.guo@linaro.org>

With the unnecessary 1 bit left-shift on fep->phy_speed during the
calculation, the phy_speed always runs at the half frequency of the
optimal one 2.5 MHz.

The patch removes that 1 bit left-shift to get the optimal phy_speed.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 drivers/net/fec.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 5ef0e34..04206e4 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -1007,7 +1007,7 @@ static int fec_enet_mii_init(struct platform_device *pdev)
 	/*
 	 * Set MII speed to 2.5 MHz (= clk_get_rate() / 2 * phy_speed)
 	 */
-	fep->phy_speed = DIV_ROUND_UP(clk_get_rate(fep->clk), 5000000) << 1;
+	fep->phy_speed = DIV_ROUND_UP(clk_get_rate(fep->clk), 5000000);
 	writel(fep->phy_speed, fep->hwp + FEC_MII_SPEED);
 
 	fep->mii_bus = mdiobus_alloc();
-- 
1.7.4.1

^ permalink raw reply related

* [PATCH 2/4] net/fec: fix fec1 check in fec_enet_mii_init()
From: Shawn Guo @ 2011-09-18 11:54 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller, linux-arm-kernel, patches, Shawn Guo
In-Reply-To: <1316346852-17090-1-git-send-email-shawn.guo@linaro.org>

In function fec_enet_mii_init(), it uses non-zero pdev->id as part
of the condition to check the second fec instance (fec1).  This works
before the driver supports device tree probe.  But in case of device
tree probe, pdev->id is -1 which is also non-zero, so the logic becomes
broken when device tree probe gets supported.

The patch change the logic to check "pdev->id > 0" as the part of the
condition for identifying fec1.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 drivers/net/fec.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 6a638e9..5ef0e34 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -996,7 +996,7 @@ static int fec_enet_mii_init(struct platform_device *pdev)
 	 * mdio interface in board design, and need to be configured by
 	 * fec0 mii_bus.
 	 */
-	if ((id_entry->driver_data & FEC_QUIRK_ENET_MAC) && pdev->id) {
+	if ((id_entry->driver_data & FEC_QUIRK_ENET_MAC) && pdev->id > 0) {
 		/* fec1 uses fec0 mii_bus */
 		fep->mii_bus = fec0_mii_bus;
 		return 0;
-- 
1.7.4.1

^ permalink raw reply related

* [PATCH 1/4] net/fec: change phy-reset-gpio request warning to debug message
From: Shawn Guo @ 2011-09-18 11:54 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller, linux-arm-kernel, patches, Shawn Guo
In-Reply-To: <1316346852-17090-1-git-send-email-shawn.guo@linaro.org>

FEC can work without a phy reset on some platforms, which means not
very platform necessarily have a phy-reset gpio encoded in device tree.
So it makes more sense to have the phy-reset-gpio request failure as
a debug message rather than a warning.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 drivers/net/fec.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index e8266cc..6a638e9 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -1422,7 +1422,7 @@ static int __devinit fec_reset_phy(struct platform_device *pdev)
 	phy_reset = of_get_named_gpio(np, "phy-reset-gpios", 0);
 	err = gpio_request_one(phy_reset, GPIOF_OUT_INIT_LOW, "phy-reset");
 	if (err) {
-		pr_warn("FEC: failed to get gpio phy-reset: %d\n", err);
+		pr_debug("FEC: failed to get gpio phy-reset: %d\n", err);
 		return err;
 	}
 	msleep(1);
-- 
1.7.4.1

^ permalink raw reply related

* [PATCH 0/4] add fec support for imx6q
From: Shawn Guo @ 2011-09-18 11:54 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller, linux-arm-kernel, patches

This series adds imx6q enet support.  The imx6q enet is a derivative of
imx28 enet controller.  It fixed the frame endian issue found on imx28,
and added 1 Gbps support.

It's based on v3.1-rc6.

Shawn Guo (4):
      net/fec: change phy-reset-gpio request warning to debug message
      net/fec: fix fec1 check in fec_enet_mii_init()
      net/fec: set phy_speed to the optimal frequency 2.5 MHz
      net/fec: add imx6q enet support

 drivers/net/Kconfig |    3 +-
 drivers/net/fec.c   |   65 ++++++++++++++++++++++++++++++++++++++++-----------
 2 files changed, 52 insertions(+), 16 deletions(-)

^ permalink raw reply

* Re: [PATCH ] dynamic_debug: call __netdev_printk only for CONFIG_NET
From: Greg KH @ 2011-09-18  8:27 UTC (permalink / raw)
  To: Jason Baron
  Cc: Arnd Bergmann, gregkh, joe, jim.cromie, bvanassche, linux-kernel,
	davem, aloisio.almeida, netdev
In-Reply-To: <20110901151817.GA14324@redhat.com>

On Thu, Sep 01, 2011 at 11:18:18AM -0400, Jason Baron wrote:
> On Thu, Sep 01, 2011 at 04:57:02PM +0200, Arnd Bergmann wrote:
> > __netdev_printk is only defined when CONFIG_NET is set. Since we only need
> > __dynamic_netdev_dbg for network drivers, we can make it conditional on the
> > same Kconfig symbol.
> >
> 
> Hi,
> 
> Yes, I've posted a fix for this:
> 
> https://lkml.org/lkml/2011/8/30/297
> 
> Hopefully, it will be pulled in soon.

As that thread again spun off into confusion, can you please resend the
end result?

thanks,

greg k-h

^ permalink raw reply

* [GIT] Networking
From: David Miller @ 2011-09-18  6:21 UTC (permalink / raw)
  To: torvalds; +Cc: akpm, netdev, linux-kernel


I thought the kernel.org issue would be cleared up a lot sooner than
it appears it will end up being resolved, so I held off on creating
another GIT tree to push changes to you until just a day or two ago.

Anyways, here are all of the fixes which have queued up meanwhile.

As usual, the majority of the stuff is in the drivers, with only a few
protocol and generic networking fixes here and there.

1) Fix DMA mapping failures and checksum offload failure handling in
   ibmveth driver, from Anton Blanchard and Brian King.

2) Netfilter fixes:
   a) Fix xt_rateest_mt_checkentry() error handling, from Eric Dumazet.
   b) Fix leak in ipq_build_packet_message(), from Jesper Juhl.
   c) Build dependencies for ebtables are wrong, from Bart De Schuymer.
   d) Userspace should never be allowed to send NF_STOLEN verdicts to
      nf_queue, fix from Florian Westphal.
   e) Fix translation of peer's call-id field in nf_ct_pptp when
      both the server and client are NATed, from Sanket Shah.
   f) Fix handling of invalid TCP options in nf_ct_tcp, from Jozsef Kadlecsik.
   g) Fix TCP option lengh calculations in nf_ct_tcp's tcp_sack(), also
      from Jozsef.

3) Socket address hardening in inet_bind() broke some apps, loosen
   the checks so they work again.

4) Fix locking in mac80211's __sta_info_destroy() from Johannes Berg.

5) Fix crash when unplugging ath9k devices, from Mohammed Shafi Shajakhan.

6) Fix stack corruption and command queue timeouts in iwlagn, from Johannes
   Berg.

7) Fix resets while reading device config, eliminate accidental accesses of
   not-present registers, and fix coalescing bug in bnx2x driver from Dmitry Kravkov,
   Vladislav Zolotarov, and Ariel Elior.

8) cls_rsvp.h indexes attribute array off-by-one, fix from Igor Maravić.

9) Syn flooding messages fill people's logs, rate limit it and report the
   number of times it is detected in a statistic.  From Eric Dumazet.

10) CAN protocol layer needs to use del_time_sync(), from Rajan Aggarwal.

11) Flow cache accidently uses entries from one namespace in another, fix
    from David Ward.

12) If zero copy skbs hit forward path, we must copy them, from Michael S. Tsirkin.

13) ether_setup() needs to "OR" in the IFF_TX_SKB_SHARING bit so that other
    settings made already don't get lost, from Neil Horman.

14) Revert regression causing SFC write-combining change, from Ben Hutchings.

15) Cure FIFO overrun handling in pch_gbe driver, from Toshiharu Okada.

16) SCTP connection wedges when it sees two COOKIE_ECHO chunks, fix from
    Max Matveev.

17) Fix NULL deref in CAIF stack, from Eric Dumazet.

18) Fix ipv4 route metrics leak caused by kfree_rcu() conversions, fix
    from Zheng Yan.

19) flow_key_compare has dependencies upon flow key alignment, make sure
    they are met.  From David Ward.

20) Also from David Ward, compare flow keys correctly based upon their
    address-family specific size.  Otherwise we reference garbage.

21) Fix ti_hecc driver build, missing include, from Daniel Mack.

22) Don't use inetpeer for the metrics of anything other than host
    routes, from Zheng Yan.

23) Fix EEPROM signature handling of e1000 devices on HPPA.  From
    Jeff Kirsher.

24) ipv6's datagram_send_ctl() needs to adhere to the socket's
    ->transparent setting, fix from Maciej Żenczykowski.

Please pull, thanks a lot!

The following changes since commit 9e79e3e9dd9672b37ac9412e9a926714306551fe:

  Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc (2011-08-30 11:28:18 -0700)

are available in the git repository at:

  git://github.com/davem330/net.git master

Andi Kleen (1):
      IRDA: Fix global type conflicts in net/irda/irsysctl.c v2

Anton Blanchard (3):
      ibmveth: Fix issue with DMA mapping failure
      ibmveth: Checksum offload is always disabled
      ibmveth: Fix checksum offload failure handling

Ariel Elior (1):
      bnx2x: Fix for a host coalescing bug which impared latency.

Bart De Schuymer (1):
      netfilter: ebtables: fix ebtables build dependency

Ben Hutchings (2):
      Revert "sfc: Use write-combining to reduce TX latency" and follow-ups
      sfc: Use 64-bit writes for TX push where possible

Brian King (1):
      ibmveth: Fix DMA unmap error

Daniel Mack (1):
      can: ti_hecc: include linux/io.h

David S. Miller (3):
      Merge branch 'master' of git://git.kernel.org/.../kaber/nf-2.6
      Merge branch 'for-davem' of git://git.infradead.org/users/linville/wireless
      Merge branch 'master' of ../netdev/

David Ward (1):
      net: Align AF-specific flowi structs to long

Dmitry Kravkov (6):
      bnx2x: fix BRB thresholds for dropless_fc mode
      bnx2x: decrease print level to debug
      bnx2x: fix MF for 4-port devices
      bnx2x: don't reset device while reading its configuration.
      bnx2x: init fw_seq after undi_unload is done
      bnx2x: don't access removed registers on 57712 and above

Eric Dumazet (4):
      netfilter: xt_rateest: fix xt_rateest_mt_checkentry()
      net: ipv4: relax AF_INET check in bind()
      tcp: Change possible SYN flooding messages
      caif: fix a potential NULL dereference

Felix Fietkau (1):
      ath9k_hw: fix calibration on 5 ghz

Florian Westphal (1):
      netfilter: nf_queue: reject NF_STOLEN verdicts from userspace

George (2):
      rtlwifi: rtl8192su: Fix problem connecting to HT-enabled AP
      rtlwifi: Fix problem when switching connections

Ian Campbell (3):
      MAINTAINERS: Update ATLX driver maintainers
      MAINTAINERS: Update Cisco VIC driver maintainers
      MAINTAINERS: Update BNA 10G Maintainer

Igor Maravić (1):
      pkt_sched: cls_rsvp.h was outdated

Jeff Kirsher (1):
      e1000: Fix driver to be used on PA RISC C8000 workstations

Jesper Juhl (1):
      netfilter: ip_queue: Fix small leak in ipq_build_packet_message()

Johannes Berg (3):
      mac80211: fix missing sta_lock in __sta_info_destroy
      iwlagn: fix stack corruption
      iwlagn: fix command queue timeout

John W. Linville (1):
      Merge branch 'master' of git://git.infradead.org/users/linville/wireless into for-davem

Jozsef Kadlecsik (2):
      netfilter: nf_ct_tcp: fix incorrect handling of invalid TCP option
      netfilter: nf_ct_tcp: wrong multiplication of TCPOLEN_TSTAMP_ALIGNED in tcp_sack skips fastpath

Kavan Smith (1):
      ipheth: iPhone 4 Verizon CDMA USB Product ID add

Maciej Żenczykowski (1):
      net: relax PKTINFO non local ipv6 udp xmit check

Marcos Paulo de Souza (1):
      Documentation: networking: dmfe.txt: Remove the maintainer of orphan networking driver

Max Matveev (1):
      sctp: deal with multiple COOKIE_ECHO chunks

Michael S. Tsirkin (1):
      net: copy userspace buffers on device forwarding

Mohammed Shafi Shajakhan (1):
      ath9k: Fix kernel panic on unplugging the device

Patrick McHardy (1):
      netfilter: update netfilter git URL

Rajkumar Manoharan (1):
      ath9k_hw: Fix init mode register regression

Sanket Shah (1):
      netfilter: nf_ct_pptp: fix DNATed PPTP connection address translation

Stanislaw Gruszka (1):
      iwlegacy: fix BUG_ON(info->control.rates[0].idx < 0)

Toshiharu Okada (3):
      pch_gbe: fixed the issue which receives an unnecessary packet.
      pch_gbe: added the process of FIFO over run error
      pch_gbe: support ML7831 IOH

Vladislav Zolotarov (1):
      bnx2x: fix rx ring size report

Yan, Zheng (2):
      ipv4: Fix fib_info->fib_metrics leak
      ipv6: don't use inetpeer to store metrics for routes.

Yaniv Rosner (6):
      bnx2x: Fix ETS bandwidth
      bnx2x: Enable FEC for 57810-KR
      bnx2x: Remove fiber remote fault detection
      bnx2x: Fix XMAC loopback test
      bnx2x: Fix 578xx link LED
      bnx2x: Fix ethtool advertisement

dpward (2):
      net: Make flow cache namespace-aware
      net: Handle different key sizes between address families in flow cache

nhorman (1):
      net: don't clear IFF_XMIT_DST_RELEASE in ether_setup

rajan.aggarwal85@gmail.com (1):
      net/can/af_can.c: Change del_timer to del_timer_sync

 Documentation/networking/dmfe.txt                |    3 +-
 MAINTAINERS                                      |    6 +-
 drivers/net/Kconfig                              |   11 +-
 drivers/net/bnx2x/bnx2x.h                        |  124 +++++++---
 drivers/net/bnx2x/bnx2x_cmn.c                    |   27 +-
 drivers/net/bnx2x/bnx2x_ethtool.c                |   48 +++-
 drivers/net/bnx2x/bnx2x_link.c                   |   46 ++--
 drivers/net/bnx2x/bnx2x_main.c                   |  162 ++++++++----
 drivers/net/bnx2x/bnx2x_reg.h                    |    7 +-
 drivers/net/bnx2x/bnx2x_stats.c                  |    7 +-
 drivers/net/can/ti_hecc.c                        |    1 +
 drivers/net/e1000/e1000_hw.c                     |    6 +
 drivers/net/ibmveth.c                            |   48 +++--
 drivers/net/pch_gbe/pch_gbe.h                    |   12 +-
 drivers/net/pch_gbe/pch_gbe_main.c               |  302 ++++++++++++++--------
 drivers/net/sfc/efx.c                            |   18 +--
 drivers/net/sfc/io.h                             |    6 -
 drivers/net/sfc/mcdi.c                           |   46 ++--
 drivers/net/sfc/nic.c                            |    7 -
 drivers/net/sfc/nic.h                            |    2 -
 drivers/net/sfc/siena.c                          |   25 +--
 drivers/net/sfc/workarounds.h                    |    2 -
 drivers/net/usb/ipheth.c                         |    5 +
 drivers/net/wireless/ath/ath9k/ar9002_calib.c    |    3 +-
 drivers/net/wireless/ath/ath9k/ar9003_phy.c      |    2 +-
 drivers/net/wireless/ath/ath9k/main.c            |    6 +
 drivers/net/wireless/iwlegacy/iwl-3945-rs.c      |   13 +-
 drivers/net/wireless/iwlwifi/iwl-agn-ucode.c     |    2 +-
 drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c |    2 +
 drivers/net/wireless/rtlwifi/core.c              |    8 +
 drivers/net/wireless/rtlwifi/rtl8192cu/trx.c     |   11 +-
 include/linux/skbuff.h                           |    1 +
 include/linux/snmp.h                             |    2 +
 include/net/flow.h                               |   25 ++-
 include/net/request_sock.h                       |    3 +-
 include/net/sctp/command.h                       |    1 +
 include/net/tcp.h                                |    3 +
 include/net/transp_v6.h                          |    1 +
 net/bridge/netfilter/Kconfig                     |    2 +-
 net/caif/caif_dev.c                              |    6 +-
 net/can/af_can.c                                 |    2 +-
 net/core/dev.c                                   |    8 +
 net/core/flow.c                                  |   36 ++-
 net/core/skbuff.c                                |   22 ++-
 net/ethernet/eth.c                               |    2 +-
 net/ipv4/af_inet.c                               |    7 +-
 net/ipv4/fib_semantics.c                         |   10 +-
 net/ipv4/netfilter/ip_queue.c                    |   12 +-
 net/ipv4/proc.c                                  |    2 +
 net/ipv4/tcp_ipv4.c                              |   51 ++--
 net/ipv6/datagram.c                              |    5 +-
 net/ipv6/ip6_flowlabel.c                         |    8 +-
 net/ipv6/ipv6_sockglue.c                         |    2 +-
 net/ipv6/netfilter/ip6_queue.c                   |   12 +-
 net/ipv6/raw.c                                   |    4 +-
 net/ipv6/route.c                                 |   33 ++-
 net/ipv6/tcp_ipv6.c                              |   31 +--
 net/ipv6/udp.c                                   |    4 +-
 net/irda/irsysctl.c                              |    6 +-
 net/irda/qos.c                                   |    6 +-
 net/mac80211/sta_info.c                          |    2 +-
 net/netfilter/nf_conntrack_pptp.c                |    1 +
 net/netfilter/nf_conntrack_proto_tcp.c           |    6 +-
 net/netfilter/nfnetlink_queue.c                  |    4 +-
 net/netfilter/xt_rateest.c                       |    9 +-
 net/sched/cls_rsvp.h                             |   27 +-
 net/sctp/sm_sideeffect.c                         |    5 +
 net/sctp/sm_statefuns.c                          |    6 +
 68 files changed, 827 insertions(+), 508 deletions(-)

^ permalink raw reply

* Re: [PATCH v2 1/7] Basic kernel memory functionality for the Memory Controller
From: Glauber Costa @ 2011-09-18  3:39 UTC (permalink / raw)
  To: Kirill A. Shutemov
  Cc: linux-kernel, paul, lizf, kamezawa.hiroyu, ebiederm, davem,
	gthelen, netdev, linux-mm
In-Reply-To: <20110917174535.GA1658@shutemov.name>


>>   	struct mem_cgroup_stat_cpu *stat;
>> @@ -391,6 +404,7 @@ enum charge_type {
>>   #define _MEM			(0)
>>   #define _MEMSWAP		(1)
>>   #define _OOM_TYPE		(2)
>> +#define _KMEM			(3)
>
> Ditto. Can we use enum instead?
Yes we can (tm)

>>   	if (!mem_cgroup_is_root(mem)) {
>>   		if (!swap)
>> -			return res_counter_read_u64(&mem->res, RES_USAGE);
>> +			kmem += res_counter_read_u64(&mem->res, RES_USAGE);
>>   		else
>> -			return res_counter_read_u64(&mem->memsw, RES_USAGE);
>> +			kmem += res_counter_read_u64(&mem->memsw, RES_USAGE);
>> +
>> +		return kmem;
>>   	}
>>
>>   	val = mem_cgroup_recursive_stat(mem, MEM_CGROUP_STAT_CACHE);
>
> No kernel memory accounting for root cgroup, right?
Not sure. Maybe kernel memory accounting is useful even for root cgroup. 
Same as normal memory accounting... what we want to avoid is kernel 
memory limits. OTOH, if we are not limiting it anyway, accounting it is 
just useless overhead... Even the statistics can then be gathered 
through all
the proc files that show slab usage, I guess?

>
>> @@ -3979,6 +3999,10 @@ static u64 mem_cgroup_read(struct cgroup *cont, struct cftype *cft)
>>   		else
>>   			val = res_counter_read_u64(&mem->memsw, name);
>>   		break;
>> +	case _KMEM:
>> +		val = res_counter_read_u64(&mem->kmem, name);
>> +		break;
>> +
>
> Always zero in root cgroup?

Yes, if we're not accounting, it should be zero. WARN_ON, maybe?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply

* [PATCH net-next 28/28] tipc: Remove unused link event tracking code
From: Paul Gortmaker @ 2011-09-18  3:32 UTC (permalink / raw)
  To: davem; +Cc: netdev, allan.stephens, ying.xue, Paul Gortmaker
In-Reply-To: <1316316744-29514-1-git-send-email-paul.gortmaker@windriver.com>

From: Ying Xue <ying.xue@windriver.com>

Elimintes prototype link event tracking functionality that has never
been fleshed out and doesn't do anything useful at the current time.

Signed-off-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 net/tipc/config.h |    1 -
 net/tipc/link.c   |   10 ----------
 2 files changed, 0 insertions(+), 11 deletions(-)

diff --git a/net/tipc/config.h b/net/tipc/config.h
index 443159a..80da6eb 100644
--- a/net/tipc/config.h
+++ b/net/tipc/config.h
@@ -65,7 +65,6 @@ struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd,
 				const void *req_tlv_area, int req_tlv_space,
 				int headroom);
 
-void tipc_cfg_link_event(u32 addr, char *name, int up);
 int  tipc_cfg_init(void);
 void tipc_cfg_stop(void);
 
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 2ea3f22..ae98a72 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -537,9 +537,6 @@ void tipc_link_stop(struct link *l_ptr)
 	l_ptr->proto_msg_queue = NULL;
 }
 
-/* LINK EVENT CODE IS NOT SUPPORTED AT PRESENT */
-#define link_send_event(fcn, l_ptr, up) do { } while (0)
-
 void tipc_link_reset(struct link *l_ptr)
 {
 	struct sk_buff *buf;
@@ -597,10 +594,6 @@ void tipc_link_reset(struct link *l_ptr)
 	l_ptr->fsm_msg_cnt = 0;
 	l_ptr->stale_count = 0;
 	link_reset_statistics(l_ptr);
-
-	link_send_event(tipc_cfg_link_event, l_ptr, 0);
-	if (!in_own_cluster(l_ptr->addr))
-		link_send_event(tipc_disc_link_event, l_ptr, 0);
 }
 
 
@@ -609,9 +602,6 @@ static void link_activate(struct link *l_ptr)
 	l_ptr->next_in_no = l_ptr->stats.recv_info = 1;
 	tipc_node_link_up(l_ptr->owner, l_ptr);
 	tipc_bearer_add_dest(l_ptr->b_ptr, l_ptr->addr);
-	link_send_event(tipc_cfg_link_event, l_ptr, 1);
-	if (!in_own_cluster(l_ptr->addr))
-		link_send_event(tipc_disc_link_event, l_ptr, 1);
 }
 
 /**
-- 
1.7.4.4

^ permalink raw reply related

* [PATCH net-next 27/28] tipc: Remove callback field from subscription structure
From: Paul Gortmaker @ 2011-09-18  3:32 UTC (permalink / raw)
  To: davem; +Cc: netdev, allan.stephens, ying.xue, Paul Gortmaker
In-Reply-To: <1316316744-29514-1-git-send-email-paul.gortmaker@windriver.com>

From: Ying Xue <ying.xue@windriver.com>

Eliminate the "event_cb" member from TIPC's "subscription" structure
since the function pointer it holds always points to subscr_send_event().

Signed-off-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 net/tipc/subscr.c |    3 +--
 net/tipc/subscr.h |    6 ------
 2 files changed, 1 insertions(+), 8 deletions(-)

diff --git a/net/tipc/subscr.c b/net/tipc/subscr.c
index 6cf7268..1983717 100644
--- a/net/tipc/subscr.c
+++ b/net/tipc/subscr.c
@@ -151,7 +151,7 @@ void tipc_subscr_report_overlap(struct subscription *sub,
 	if (!must && !(sub->filter & TIPC_SUB_PORTS))
 		return;
 
-	sub->event_cb(sub, found_lower, found_upper, event, port_ref, node);
+	subscr_send_event(sub, found_lower, found_upper, event, port_ref, node);
 }
 
 /**
@@ -365,7 +365,6 @@ static struct subscription *subscr_subscribe(struct tipc_subscr *s,
 		subscr_terminate(subscriber);
 		return NULL;
 	}
-	sub->event_cb = subscr_send_event;
 	INIT_LIST_HEAD(&sub->nameseq_list);
 	list_add(&sub->subscription_list, &subscriber->subscription_list);
 	sub->server_ref = subscriber->port_ref;
diff --git a/net/tipc/subscr.h b/net/tipc/subscr.h
index 45d89bf..4b06ef6 100644
--- a/net/tipc/subscr.h
+++ b/net/tipc/subscr.h
@@ -39,16 +39,11 @@
 
 struct subscription;
 
-typedef void (*tipc_subscr_event) (struct subscription *sub,
-				   u32 found_lower, u32 found_upper,
-				   u32 event, u32 port_ref, u32 node);
-
 /**
  * struct subscription - TIPC network topology subscription object
  * @seq: name sequence associated with subscription
  * @timeout: duration of subscription (in ms)
  * @filter: event filtering to be done for subscription
- * @event_cb: routine invoked when a subscription event is detected
  * @timer: timer governing subscription duration (optional)
  * @nameseq_list: adjacent subscriptions in name sequence's subscription list
  * @subscription_list: adjacent subscriptions in subscriber's subscription list
@@ -61,7 +56,6 @@ struct subscription {
 	struct tipc_name_seq seq;
 	u32 timeout;
 	u32 filter;
-	tipc_subscr_event event_cb;
 	struct timer_list timer;
 	struct list_head nameseq_list;
 	struct list_head subscription_list;
-- 
1.7.4.4

^ permalink raw reply related

* [PATCH net-next 26/28] tipc: Simplify prohibition of listen and accept for connectionless sockets
From: Paul Gortmaker @ 2011-09-18  3:32 UTC (permalink / raw)
  To: davem; +Cc: netdev, allan.stephens, ying.xue, Paul Gortmaker
In-Reply-To: <1316316744-29514-1-git-send-email-paul.gortmaker@windriver.com>

From: Ying Xue <ying.xue@windriver.com>

Modifies the proto_ops structure used by TIPC DGRAM and RDM sockets
so that calls to listen() and accept() are handled by existing kernel
"unsupported operation" routines, and eliminates the related checks
in the listen and accept routines used by SEQPACKET and STREAM sockets
that are no longer needed.

Signed-off-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 net/tipc/socket.c |   12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 2f90beb..9440a3d 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -1483,9 +1483,7 @@ static int listen(struct socket *sock, int len)
 
 	lock_sock(sk);
 
-	if (sock->state == SS_READY)
-		res = -EOPNOTSUPP;
-	else if (sock->state != SS_UNCONNECTED)
+	if (sock->state != SS_UNCONNECTED)
 		res = -EINVAL;
 	else {
 		sock->state = SS_LISTENING;
@@ -1513,10 +1511,6 @@ static int accept(struct socket *sock, struct socket *new_sock, int flags)
 
 	lock_sock(sk);
 
-	if (sock->state == SS_READY) {
-		res = -EOPNOTSUPP;
-		goto exit;
-	}
 	if (sock->state != SS_LISTENING) {
 		res = -EINVAL;
 		goto exit;
@@ -1793,11 +1787,11 @@ static const struct proto_ops msg_ops = {
 	.bind		= bind,
 	.connect	= connect,
 	.socketpair	= sock_no_socketpair,
-	.accept		= accept,
+	.accept		= sock_no_accept,
 	.getname	= get_name,
 	.poll		= poll,
 	.ioctl		= sock_no_ioctl,
-	.listen		= listen,
+	.listen		= sock_no_listen,
 	.shutdown	= shutdown,
 	.setsockopt	= setsockopt,
 	.getsockopt	= getsockopt,
-- 
1.7.4.4

^ permalink raw reply related

* [PATCH net-next 24/28] tipc: Enhance sending of bulk name table messages
From: Paul Gortmaker @ 2011-09-18  3:32 UTC (permalink / raw)
  To: davem; +Cc: netdev, allan.stephens, ying.xue, Paul Gortmaker
In-Reply-To: <1316316744-29514-1-git-send-email-paul.gortmaker@windriver.com>

From: Allan Stephens <allan.stephens@windriver.com>

Modifies the initial transfer of name table entries to a new neighboring
node so that the messages are enqueued as a unit, rather than individually.

The revised algorithm now locates the link carrying the message only once,
and eliminates unnecessary checks for link congestion, message fragmentation,
and message bundling that are not required when sending these messages.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 net/tipc/link.c       |   45 +++++++++++++++++++++++++++++++++++++++++++++
 net/tipc/link.h       |    1 +
 net/tipc/name_distr.c |   10 ++++++++--
 3 files changed, 54 insertions(+), 2 deletions(-)

diff --git a/net/tipc/link.c b/net/tipc/link.c
index 74126db..2ea3f22 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -986,6 +986,51 @@ int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector)
 }
 
 /*
+ * tipc_link_send_names - send name table entries to new neighbor
+ *
+ * Send routine for bulk delivery of name table messages when contact
+ * with a new neighbor occurs. No link congestion checking is performed
+ * because name table messages *must* be delivered. The messages must be
+ * small enough not to require fragmentation.
+ * Called without any locks held.
+ */
+
+void tipc_link_send_names(struct list_head *message_list, u32 dest)
+{
+	struct tipc_node *n_ptr;
+	struct link *l_ptr;
+	struct sk_buff *buf;
+	struct sk_buff *temp_buf;
+
+	if (list_empty(message_list))
+		return;
+
+	read_lock_bh(&tipc_net_lock);
+	n_ptr = tipc_node_find(dest);
+	if (n_ptr) {
+		tipc_node_lock(n_ptr);
+		l_ptr = n_ptr->active_links[0];
+		if (l_ptr) {
+			/* convert circular list to linear list */
+			((struct sk_buff *)message_list->prev)->next = NULL;
+			link_add_chain_to_outqueue(l_ptr,
+				(struct sk_buff *)message_list->next, 0);
+			tipc_link_push_queue(l_ptr);
+			INIT_LIST_HEAD(message_list);
+		}
+		tipc_node_unlock(n_ptr);
+	}
+	read_unlock_bh(&tipc_net_lock);
+
+	/* discard the messages if they couldn't be sent */
+
+	list_for_each_safe(buf, temp_buf, ((struct sk_buff *)message_list)) {
+		list_del((struct list_head *)buf);
+		buf_discard(buf);
+	}
+}
+
+/*
  * link_send_buf_fast: Entry for data messages where the
  * destination link is known and the header is complete,
  * inclusive total message length. Very time critical.
diff --git a/net/tipc/link.h b/net/tipc/link.h
index 74fbeca..e56cb53 100644
--- a/net/tipc/link.h
+++ b/net/tipc/link.h
@@ -223,6 +223,7 @@ struct sk_buff *tipc_link_cmd_show_stats(const void *req_tlv_area, int req_tlv_s
 struct sk_buff *tipc_link_cmd_reset_stats(const void *req_tlv_area, int req_tlv_space);
 void tipc_link_reset(struct link *l_ptr);
 int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector);
+void tipc_link_send_names(struct list_head *message_list, u32 dest);
 int tipc_link_send_buf(struct link *l_ptr, struct sk_buff *buf);
 u32 tipc_link_get_max_pkt(u32 dest, u32 selector);
 int tipc_link_send_sections_fast(struct tipc_port *sender,
diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c
index 97546f0..b7ca1bd 100644
--- a/net/tipc/name_distr.c
+++ b/net/tipc/name_distr.c
@@ -180,6 +180,7 @@ void tipc_named_node_up(unsigned long nodearg)
 	struct publication *publ;
 	struct distr_item *item = NULL;
 	struct sk_buff *buf = NULL;
+	struct list_head message_list;
 	u32 node = (u32)nodearg;
 	u32 left = 0;
 	u32 rest;
@@ -201,6 +202,10 @@ void tipc_named_node_up(unsigned long nodearg)
 	if (!max_item_buf)
 		return;
 
+	/* create list of publication messages, then send them as a unit */
+
+	INIT_LIST_HEAD(&message_list);
+
 	read_lock_bh(&tipc_nametbl_lock);
 	rest = publ_cnt * ITEM_SIZE;
 
@@ -219,13 +224,14 @@ void tipc_named_node_up(unsigned long nodearg)
 		item++;
 		left -= ITEM_SIZE;
 		if (!left) {
-			msg_set_link_selector(buf_msg(buf), node);
-			tipc_link_send(buf, node, node);
+			list_add_tail((struct list_head *)buf, &message_list);
 			buf = NULL;
 		}
 	}
 exit:
 	read_unlock_bh(&tipc_nametbl_lock);
+
+	tipc_link_send_names(&message_list, (u32)node);
 }
 
 /**
-- 
1.7.4.4

^ permalink raw reply related

* [PATCH net-next 25/28] tipc: Add support for SO_SNDTIMEO socket option
From: Paul Gortmaker @ 2011-09-18  3:32 UTC (permalink / raw)
  To: davem; +Cc: netdev, allan.stephens, ying.xue, Paul Gortmaker
In-Reply-To: <1316316744-29514-1-git-send-email-paul.gortmaker@windriver.com>

From: Ying Xue <ying.xue@windriver.com>

Adds support for the SO_SNDTIMEO socket option. (This complements the
existing support for SO_RCVTIMEO that is already present.)

Signed-off-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 net/tipc/socket.c |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index fc3c281..2f90beb 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -525,6 +525,7 @@ static int send_msg(struct kiocb *iocb, struct socket *sock,
 	struct tipc_port *tport = tipc_sk_port(sk);
 	struct sockaddr_tipc *dest = (struct sockaddr_tipc *)m->msg_name;
 	int needs_conn;
+	long timeout_val;
 	int res = -EINVAL;
 
 	if (unlikely(!dest))
@@ -564,6 +565,8 @@ static int send_msg(struct kiocb *iocb, struct socket *sock,
 		reject_rx_queue(sk);
 	}
 
+	timeout_val = sock_sndtimeo(sk, m->msg_flags & MSG_DONTWAIT);
+
 	do {
 		if (dest->addrtype == TIPC_ADDR_NAME) {
 			res = dest_name_check(dest, m);
@@ -600,16 +603,14 @@ static int send_msg(struct kiocb *iocb, struct socket *sock,
 				sock->state = SS_CONNECTING;
 			break;
 		}
-		if (m->msg_flags & MSG_DONTWAIT) {
-			res = -EWOULDBLOCK;
+		if (timeout_val <= 0L) {
+			res = timeout_val ? timeout_val : -EWOULDBLOCK;
 			break;
 		}
 		release_sock(sk);
-		res = wait_event_interruptible(*sk_sleep(sk),
-					       !tport->congested);
+		timeout_val = wait_event_interruptible_timeout(*sk_sleep(sk),
+					       !tport->congested, timeout_val);
 		lock_sock(sk);
-		if (res)
-			break;
 	} while (1);
 
 exit:
@@ -636,6 +637,7 @@ static int send_packet(struct kiocb *iocb, struct socket *sock,
 	struct sock *sk = sock->sk;
 	struct tipc_port *tport = tipc_sk_port(sk);
 	struct sockaddr_tipc *dest = (struct sockaddr_tipc *)m->msg_name;
+	long timeout_val;
 	int res;
 
 	/* Handle implied connection establishment */
@@ -650,6 +652,8 @@ static int send_packet(struct kiocb *iocb, struct socket *sock,
 	if (iocb)
 		lock_sock(sk);
 
+	timeout_val = sock_sndtimeo(sk, m->msg_flags & MSG_DONTWAIT);
+
 	do {
 		if (unlikely(sock->state != SS_CONNECTED)) {
 			if (sock->state == SS_DISCONNECTING)
@@ -663,16 +667,14 @@ static int send_packet(struct kiocb *iocb, struct socket *sock,
 				total_len);
 		if (likely(res != -ELINKCONG))
 			break;
-		if (m->msg_flags & MSG_DONTWAIT) {
-			res = -EWOULDBLOCK;
+		if (timeout_val <= 0L) {
+			res = timeout_val ? timeout_val : -EWOULDBLOCK;
 			break;
 		}
 		release_sock(sk);
-		res = wait_event_interruptible(*sk_sleep(sk),
-			(!tport->congested || !tport->connected));
+		timeout_val = wait_event_interruptible_timeout(*sk_sleep(sk),
+			(!tport->congested || !tport->connected), timeout_val);
 		lock_sock(sk);
-		if (res)
-			break;
 	} while (1);
 
 	if (iocb)
-- 
1.7.4.4

^ permalink raw reply related

* [PATCH net-next 23/28] tipc: relocate/coalesce node cast in tipc_named_node_up
From: Paul Gortmaker @ 2011-09-18  3:32 UTC (permalink / raw)
  To: davem; +Cc: netdev, allan.stephens, ying.xue, Paul Gortmaker
In-Reply-To: <1316316744-29514-1-git-send-email-paul.gortmaker@windriver.com>

Functions like this are called using unsigned longs from
function pointers.  In this case, the function is passed in
a node which is normally internally treated as a u32 by TIPC.

Rather than add more casts into this function in the future
for each added use of node within, move the cast to a single
place on a local.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 net/tipc/name_distr.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c
index 21bc028..97546f0 100644
--- a/net/tipc/name_distr.c
+++ b/net/tipc/name_distr.c
@@ -173,13 +173,14 @@ void tipc_named_withdraw(struct publication *publ)
  * tipc_named_node_up - tell specified node about all publications by this node
  */
 
-void tipc_named_node_up(unsigned long node)
+void tipc_named_node_up(unsigned long nodearg)
 {
 	struct tipc_node *n_ptr;
 	struct link *l_ptr;
 	struct publication *publ;
 	struct distr_item *item = NULL;
 	struct sk_buff *buf = NULL;
+	u32 node = (u32)nodearg;
 	u32 left = 0;
 	u32 rest;
 	u32 max_item_buf = 0;
@@ -187,7 +188,7 @@ void tipc_named_node_up(unsigned long node)
 	/* compute maximum amount of publication data to send per message */
 
 	read_lock_bh(&tipc_net_lock);
-	n_ptr = tipc_node_find((u32)node);
+	n_ptr = tipc_node_find(node);
 	if (n_ptr) {
 		tipc_node_lock(n_ptr);
 		l_ptr = n_ptr->active_links[0];
-- 
1.7.4.4

^ permalink raw reply related

* [PATCH net-next 22/28] tipc: Prevent fragmented messages during initial name table exchange
From: Paul Gortmaker @ 2011-09-18  3:32 UTC (permalink / raw)
  To: davem; +Cc: netdev, allan.stephens, ying.xue, Paul Gortmaker
In-Reply-To: <1316316744-29514-1-git-send-email-paul.gortmaker@windriver.com>

From: Allan Stephens <allan.stephens@windriver.com>

Reduces the maximum size of messages sent during the initial exchange
of name table information between two nodes to be no larger than the
MTU of the first link established between the nodes. This ensures that
messages will never need to be fragmented, which would add unnecessary
overhead to the name table synchronization mechanism.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 net/tipc/name_distr.c |   22 +++++++++++++++++++---
 1 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c
index cd356e5..21bc028 100644
--- a/net/tipc/name_distr.c
+++ b/net/tipc/name_distr.c
@@ -175,16 +175,32 @@ void tipc_named_withdraw(struct publication *publ)
 
 void tipc_named_node_up(unsigned long node)
 {
+	struct tipc_node *n_ptr;
+	struct link *l_ptr;
 	struct publication *publ;
 	struct distr_item *item = NULL;
 	struct sk_buff *buf = NULL;
 	u32 left = 0;
 	u32 rest;
-	u32 max_item_buf;
+	u32 max_item_buf = 0;
+
+	/* compute maximum amount of publication data to send per message */
+
+	read_lock_bh(&tipc_net_lock);
+	n_ptr = tipc_node_find((u32)node);
+	if (n_ptr) {
+		tipc_node_lock(n_ptr);
+		l_ptr = n_ptr->active_links[0];
+		if (l_ptr)
+			max_item_buf = ((l_ptr->max_pkt - INT_H_SIZE) /
+				ITEM_SIZE) * ITEM_SIZE;
+		tipc_node_unlock(n_ptr);
+	}
+	read_unlock_bh(&tipc_net_lock);
+	if (!max_item_buf)
+		return;
 
 	read_lock_bh(&tipc_nametbl_lock);
-	max_item_buf = TIPC_MAX_USER_MSG_SIZE / ITEM_SIZE;
-	max_item_buf *= ITEM_SIZE;
 	rest = publ_cnt * ITEM_SIZE;
 
 	list_for_each_entry(publ, &publ_root, local_list) {
-- 
1.7.4.4

^ permalink raw reply related

* [PATCH net-next 21/28] tipc: Lower limits for number of bearers and media types
From: Paul Gortmaker @ 2011-09-18  3:32 UTC (permalink / raw)
  To: davem; +Cc: netdev, allan.stephens, ying.xue, Paul Gortmaker
In-Reply-To: <1316316744-29514-1-git-send-email-paul.gortmaker@windriver.com>

From: Allan Stephens <allan.stephens@windriver.com>

Reduces the number of bearers a node can support to 2, which can use
identical or non-identical media. This change won't impact users,
since they are currently limited to a maximum of 2 Ethernet bearers,
and will save memory by eliminating a number of unused entries in
TIPC's media and bearer arrays.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 net/tipc/bearer.h    |    4 ++--
 net/tipc/eth_media.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/tipc/bearer.h b/net/tipc/bearer.h
index 5ad70ef..d696f9e 100644
--- a/net/tipc/bearer.h
+++ b/net/tipc/bearer.h
@@ -39,8 +39,8 @@
 
 #include "bcast.h"
 
-#define MAX_BEARERS 8
-#define MAX_MEDIA 4
+#define MAX_BEARERS	2
+#define MAX_MEDIA	2
 
 /*
  * Identifiers of supported TIPC media types
diff --git a/net/tipc/eth_media.c b/net/tipc/eth_media.c
index 413b337..e728d4c 100644
--- a/net/tipc/eth_media.c
+++ b/net/tipc/eth_media.c
@@ -37,7 +37,7 @@
 #include "core.h"
 #include "bearer.h"
 
-#define MAX_ETH_BEARERS		2
+#define MAX_ETH_BEARERS		MAX_BEARERS
 #define ETH_LINK_PRIORITY	TIPC_DEF_LINK_PRI
 #define ETH_LINK_TOLERANCE	TIPC_DEF_LINK_TOL
 #define ETH_LINK_WINDOW		TIPC_DEF_LINK_WIN
-- 
1.7.4.4

^ permalink raw reply related


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