Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH net-next] gianfar: Change default HW Tx queue scheduling mode
From: David Miller @ 2012-09-21 17:35 UTC (permalink / raw)
  To: claudiu.manoil; +Cc: netdev, paul.gortmaker
In-Reply-To: <1348156674-31551-1-git-send-email-claudiu.manoil@freescale.com>

From: Claudiu Manoil <claudiu.manoil@freescale.com>
Date: Thu, 20 Sep 2012 18:57:54 +0300

> The TXSCHED setting may be changed at runtime, via sysfs, for devices
> using multiple H/W Tx queues. For single queue devices this config
> option is disabled, as the TXSCHED setting is superfluous in those cases.

Please, no special driver specific sysfs knobs.

Extend ethtool as necessary for your needs, so that any driver can
provide this kind of configurability in a consistent way for users..

^ permalink raw reply

* Re: [PATCH] tcp: sysctl for initial receive window
From: Jesper Dangaard Brouer @ 2012-09-21 17:34 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: netdev, Nandita Dukkipati
In-Reply-To: <1348241111.2669.580.camel@edumazet-glaptop>

On Fri, 2012-09-21 at 17:25 +0200, Eric Dumazet wrote:
> On Fri, 2012-09-21 at 10:55 +0200, Jesper Dangaard Brouer wrote:
> > Make it possible to adjust the TCP default initial advertised receive
> > window, via sysctl /proc/sys/net/ipv4/tcp_init_recv_window.
> > 
> > The window size is this value multiplied by the MSS of the connection.
> > The default value is (still) 10, as descibed in commit 356f039822b
> > (TCP: increase default initial receive window.)
> > 
> > Allow minimum value of 1, but recommend against setting value below 2
> > in the documentation.
> > 
> > Its possible to control/override this value per route table entry via
> > the iproute2 option initrwnd.  Having the global default exported via
> > sysctl, helps determine the default setting, and make is easier to
> > adjust.
> 
> I was wondering why its not symmetric :
> 
> If we add a sysctl for initial receive window, we need another one for
> initial send window ?

Yes, that was also part of my plan (I just didn't have time to complete
it).  I'll implement the sysctl for initial congestion window, next
week.

Just wanted some initial feedback, on if this sysctl approach is
acceptable or not.

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Sr. Network Kernel Developer at Red Hat
  Author of http://www.iptv-analyzer.org
  LinkedIn: http://www.linkedin.com/in/brouer

^ permalink raw reply

* Re: [PATCH net] bnx2x: remove false warning regarding interrupt number
From: David Miller @ 2012-09-21 17:27 UTC (permalink / raw)
  To: ariele; +Cc: netdev, eilong
In-Reply-To: <1348154801-6592-1-git-send-email-ariele@broadcom.com>

From: "Ariel Elior" <ariele@broadcom.com>
Date: Thu, 20 Sep 2012 18:26:41 +0300

> Since version 7.4 the FW configures in the pci config space the max
> number of interrupts available to the physical function, instead of
> the exact number to use.
> This causes a false warning in driver when comparing the number of
> configured interrupts to the number about to be used.
> 
> Signed-off-by: Ariel Elior <ariele@broadcom.com>
> Signed-off-by: Eilon Greenstein <eilong@broadcom.com>

Applied, thanks.

^ permalink raw reply

* Re: regression: tethering fails in 3.5 with iwlwifi
From: David Miller @ 2012-09-21 17:24 UTC (permalink / raw)
  To: eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w
  Cc: artem.bityutskiy-VuQAYsv1563Yd54FQh9/CA,
	edumazet-hpIqsD4AKlfQT0dZR+AlfA, johannes-cdvu00un1VgdHxzADdlk8Q,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1348151149.31352.109.camel@edumazet-glaptop>

From: Eric Dumazet <eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Date: Thu, 20 Sep 2012 16:25:49 +0200

> Please remove this hack and try the following bugfix in raw handler
> 
> icmp_filter() should not modify skb, or else its caller should not
> assume ip_hdr() is unchanged.

Right, good catch.

Please submit this fix formally Eric, thanks a lot.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" 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-next] net: qmi_wwan: adding Huawei E367, ZTE MF683 and Pantech P4200
From: David Miller @ 2012-09-21 17:22 UTC (permalink / raw)
  To: bjorn; +Cc: netdev, linux-usb, fangxiaozhi, tschaefer, dcbw, shawn7400
In-Reply-To: <1348125485-3404-1-git-send-email-bjorn@mork.no>

From: Bjørn Mork <bjorn@mork.no>
Date: Thu, 20 Sep 2012 09:18:05 +0200

> This is the net-next version of the previously posted patch with the
> same title.  I totally forgot that I had messed with the .driver_info
> fields, making it impossible to apply the same patch to both net and 
> net-next.
> 
> Sorry about that.  Please apply this version to net-next.  The other
> one should still be applied to net (if still possible) and stable.

Ok I applied this to net-next, and it should help with the merge
resolution between net and net-next, which BTW Stephen Rothwell
already had to deal with.

^ permalink raw reply

* Re: [PATCH] rds: Error on offset mismatch if not loopback
From: David Miller @ 2012-09-21 17:20 UTC (permalink / raw)
  To: jjolly; +Cc: linux-kernel, venkat.x.venkatsubra, netdev
In-Reply-To: <20120920071134.GF14393@linux-tkdk.sfcn.org>

From: John Jolly <jjolly@suse.com>
Date: Thu, 20 Sep 2012 01:11:34 -0600

> Attempting an rds connection from the IP address of an IPoIB interface
> to itself causes a kernel panic due to a BUG_ON() being triggered. Making
> the test less strict allows rds-ping to work without crashing the machine.
> 
> A local unprivileged user could use this flaw to crash the sytem.

Please read Documentation/SubmittingPatches to learn how to properly
submit a change, in particular your patch submission was missing a
proper signoff.

Thanks.

^ permalink raw reply

* Re: [PATCH net-next v2] ipv6: remove unnecessary call rt6_clean_expires
From: David Miller @ 2012-09-21 17:19 UTC (permalink / raw)
  To: roy.qing.li; +Cc: netdev, gaofeng
In-Reply-To: <1348119118-23416-1-git-send-email-roy.qing.li@gmail.com>

From: roy.qing.li@gmail.com
Date: Thu, 20 Sep 2012 13:31:58 +0800

> From: Li RongQing <roy.qing.li@gmail.com>
> 
> the from of dst_entry and rt6i_flags of rt6_info have been zeroed out in
> ip6_blackhole_route or after calling ip6_dst_alloc, so it is unnecessary
> to call rt6_clean_expires again.
> 
> Cc: Gao feng <gaofeng@cn.fujitsu.com>
> Signed-off-by: Li RongQing <roy.qing.li@gmail.com>

I still don't like this change.

The rt6_clean_expires() calls actually do some work (clear the
RTF_EXPIRES) bit in two of the cases you are changing.

And more importantly, having the rt6_clean_expires() call makes
it easier to audit and make sure this is handled in all the
necessary situations.

The whole point of having an abstracted helper function is so
that we don't have code directly manipulating RTF_EXPIRES.

I'm not applying this patch, sorry.

^ permalink raw reply

* Re: [PATCH net-next 3/3] ptp: derive the device name from the parent device
From: Ben Hutchings @ 2012-09-21 17:19 UTC (permalink / raw)
  To: Richard Cochran
  Cc: netdev, David Miller, Jacob Keller, Jeff Kirsher, John Stultz,
	Matthew Vick
In-Reply-To: <9f2ed4a62d52182eeab86ad3dca7f6feeb68368a.1348245523.git.richardcochran@gmail.com>

On Fri, 2012-09-21 at 19:00 +0200, Richard Cochran wrote:
> PTP Hardware Clock device have a name that appears under sysfs that should
> identify the underlying device. Instead of leaving it up to the driver to
> invent a name, this patch changes the registration to automatically use
> the name from the parent device.

I thought you wanted the driver name and not the parent device name?

[...]
> diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c
> index 6e47450..60fa259 100644
> --- a/drivers/ptp/ptp_clock.c
> +++ b/drivers/ptp/ptp_clock.c
[...]
> @@ -219,11 +220,13 @@ struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info)
>         init_waitqueue_head(&ptp->tsev_wq);
>  
>         /* Create a new device in our class. */
> -       ptp->dev = device_create(ptp_class, NULL, ptp->devid, ptp,
> +       ptp->dev = device_create(ptp_class, parent, ptp->devid, ptp,
>                                  "ptp%d", ptp->index);
>         if (IS_ERR(ptp->dev))
>                 goto no_device;
>  
> +       ptp->name = parent ? dev_name(parent) : dev_name(ptp->dev);
> +

The fallback of using dev_name(ptp->dev) is a bit sad, as that's the
same name userland already has when it reads this attribute.

[...]
> diff --git a/drivers/ptp/ptp_ixp46x.c b/drivers/ptp/ptp_ixp46x.c
> index e03c406..c0939b1 100644
> --- a/drivers/ptp/ptp_ixp46x.c
> +++ b/drivers/ptp/ptp_ixp46x.c
> @@ -241,7 +241,6 @@ static int ptp_ixp_enable(struct ptp_clock_info *ptp,
>  
>  static struct ptp_clock_info ptp_ixp_caps = {
>  	.owner		= THIS_MODULE,
> -	.name		= "IXP46X timer",
>  	.max_adj	= 66666655,
>  	.n_ext_ts	= N_EXT_TS,
>  	.pps		= 0,
> @@ -298,7 +297,7 @@ static int __init ptp_ixp_init(void)
>  
>  	ixp_clock.caps = ptp_ixp_caps;
>  
> -	ixp_clock.ptp_clock = ptp_clock_register(&ixp_clock.caps);
> +	ixp_clock.ptp_clock = ptp_clock_register(&ixp_clock.caps, NULL);
[...]

I think this should really register a platform driver and a platform
device to be the parent of the clock device.  And then you don't need
the fallback for parent == NULL.

Since David has pulled the addition of PTP/PHC support to sfc, that will
need to be adjusted as well.

Ben.

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

^ permalink raw reply

* Re: [PATCH] ipv6: release referenct of ip6_null_entry's dst entry in __ip6_del_rt
From: David Miller @ 2012-09-21 17:16 UTC (permalink / raw)
  To: gaofeng; +Cc: netdev
In-Reply-To: <1348118734-2967-1-git-send-email-gaofeng@cn.fujitsu.com>

From: Gao feng <gaofeng@cn.fujitsu.com>
Date: Thu, 20 Sep 2012 13:25:34 +0800

> as we hold dst_entry before we call __ip6_del_rt,
> so we should alse call dst_release not only return
> -ENOENT when the rt6_info is ip6_null_entry.
> 
> and we already hold the dst entry, so I think it's
> safe to call dst_release out of the write-read lock.
> 
> Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>

I cannot find a code path where we can actually end up
with an ip6_null_entry here and I'd much rather declare
this condition as a bug.

Patrick McHardy added this check back in 2006:

	commit 6c813a7297e3af4cd7c3458e09e9ee3d161c6830
	Author: Patrick McHardy <kaber@trash.net>
	Date:   Sun Aug 6 22:22:47 2006 -0700

	    [IPV6]: Fix crash in ip6_del_rt

But the ipv6 code has changed substantially since then.

^ permalink raw reply

* Re: [RFC] tcp: use order-3 pages in tcp_sendmsg()
From: Eric Dumazet @ 2012-09-21 17:11 UTC (permalink / raw)
  To: David Miller; +Cc: rick.jones2, subramanian.vijay, netdev
In-Reply-To: <20120921.130440.1881102470665263512.davem@davemloft.net>

On Fri, 2012-09-21 at 13:04 -0400, David Miller wrote:

> It's a silly limitation, in net/core/dev.c:
> 
> 	/* Turn on no cache copy if HW is doing checksum */
> 	if (!(dev->flags & IFF_LOOPBACK)) {
> 		dev->hw_features |= NETIF_F_NOCACHE_COPY;
> 		if (dev->features & NETIF_F_ALL_CSUM) {
> 			dev->wanted_features |= NETIF_F_NOCACHE_COPY;
> 			dev->features |= NETIF_F_NOCACHE_COPY;
> 		}
> 	}
> 
> Maybe this is probably better done as:
> 
> 	/* Turn on no cache copy if HW is doing checksum */
> 	dev->hw_features |= NETIF_F_NOCACHE_COPY;
> 	if (!(dev->flags & IFF_LOOPBACK)) {
> 		if (dev->features & NETIF_F_ALL_CSUM) {
> 			dev->wanted_features |= NETIF_F_NOCACHE_COPY;
> 			dev->features |= NETIF_F_NOCACHE_COPY;
> 		}
> 	}
> 
> And then the code matches more closely the comment. :-)

I did a test, and for various combinations (producer/consumer on same
core or not, same cpu or not...) and performance is divided by 2

So I guess we can leave the code as is

^ permalink raw reply

* Re: [RFC] tcp: use order-3 pages in tcp_sendmsg()
From: David Miller @ 2012-09-21 17:04 UTC (permalink / raw)
  To: eric.dumazet; +Cc: rick.jones2, subramanian.vijay, netdev
In-Reply-To: <1348246281.2669.755.camel@edumazet-glaptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 21 Sep 2012 18:51:21 +0200

> On Fri, 2012-09-21 at 12:27 -0400, David Miller wrote:
>> From: Eric Dumazet <eric.dumazet@gmail.com>
>> Date: Fri, 21 Sep 2012 17:48:31 +0200
>> 
>> > There is probably a reason why lo default MTU is 16436 ?
>> 
>> That's what fit into L1 caches back in 1999
> 
> I see ;)
> 
> Nowadays, we even have the NETIF_F_NOCACHE_COPY flag and
> __copy_from_user_nocache()
> 
> Hmm, we can not toggle this flag on loopback yet
> 
> # ethtool -K lo tx-nocache-copy on
> Could not change any device features

It's a silly limitation, in net/core/dev.c:

	/* Turn on no cache copy if HW is doing checksum */
	if (!(dev->flags & IFF_LOOPBACK)) {
		dev->hw_features |= NETIF_F_NOCACHE_COPY;
		if (dev->features & NETIF_F_ALL_CSUM) {
			dev->wanted_features |= NETIF_F_NOCACHE_COPY;
			dev->features |= NETIF_F_NOCACHE_COPY;
		}
	}

Maybe this is probably better done as:

	/* Turn on no cache copy if HW is doing checksum */
	dev->hw_features |= NETIF_F_NOCACHE_COPY;
	if (!(dev->flags & IFF_LOOPBACK)) {
		if (dev->features & NETIF_F_ALL_CSUM) {
			dev->wanted_features |= NETIF_F_NOCACHE_COPY;
			dev->features |= NETIF_F_NOCACHE_COPY;
		}
	}

And then the code matches more closely the comment. :-)

^ permalink raw reply

* [PATCH net-next 3/3] ptp: derive the device name from the parent device
From: Richard Cochran @ 2012-09-21 17:00 UTC (permalink / raw)
  To: netdev
  Cc: Ben Hutchings, David Miller, Jacob Keller, Jeff Kirsher,
	John Stultz, Matthew Vick
In-Reply-To: <cover.1348245523.git.richardcochran@gmail.com>

PTP Hardware Clock device have a name that appears under sysfs that should
identify the underlying device. Instead of leaving it up to the driver to
invent a name, this patch changes the registration to automatically use
the name from the parent device.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 drivers/net/ethernet/freescale/gianfar_ptp.c |    3 +--
 drivers/net/ethernet/intel/igb/igb_ptp.c     |    7 ++-----
 drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c |    5 ++---
 drivers/net/phy/dp83640.c                    |    3 +--
 drivers/ptp/ptp_clock.c                      |    7 +++++--
 drivers/ptp/ptp_ixp46x.c                     |    3 +--
 drivers/ptp/ptp_pch.c                        |    3 +--
 drivers/ptp/ptp_private.h                    |    1 +
 drivers/ptp/ptp_sysfs.c                      |    2 +-
 include/linux/ptp_clock_kernel.h             |    8 +++++---
 10 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/drivers/net/ethernet/freescale/gianfar_ptp.c b/drivers/net/ethernet/freescale/gianfar_ptp.c
index c08e5d4..a0eaafd 100644
--- a/drivers/net/ethernet/freescale/gianfar_ptp.c
+++ b/drivers/net/ethernet/freescale/gianfar_ptp.c
@@ -408,7 +408,6 @@ static int ptp_gianfar_enable(struct ptp_clock_info *ptp,
 
 static struct ptp_clock_info ptp_gianfar_caps = {
 	.owner		= THIS_MODULE,
-	.name		= "gianfar clock",
 	.max_adj	= 512000,
 	.n_alarm	= N_ALARM,
 	.n_ext_ts	= N_EXT_TS,
@@ -510,7 +509,7 @@ static int gianfar_ptp_probe(struct platform_device *dev)
 
 	spin_unlock_irqrestore(&etsects->lock, flags);
 
-	etsects->clock = ptp_clock_register(&etsects->caps);
+	etsects->clock = ptp_clock_register(&etsects->caps, &dev->dev);
 	if (IS_ERR(etsects->clock)) {
 		err = PTR_ERR(etsects->clock);
 		goto no_clock;
diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c b/drivers/net/ethernet/intel/igb/igb_ptp.c
index e13ba1d..546e9e2 100644
--- a/drivers/net/ethernet/intel/igb/igb_ptp.c
+++ b/drivers/net/ethernet/intel/igb/igb_ptp.c
@@ -665,11 +665,9 @@ int igb_ptp_hwtstamp_ioctl(struct net_device *netdev,
 void igb_ptp_init(struct igb_adapter *adapter)
 {
 	struct e1000_hw *hw = &adapter->hw;
-	struct net_device *netdev = adapter->netdev;
 
 	switch (hw->mac.type) {
 	case e1000_82576:
-		snprintf(adapter->ptp_caps.name, 16, "%pm", netdev->dev_addr);
 		adapter->ptp_caps.owner = THIS_MODULE;
 		adapter->ptp_caps.max_adj = 1000000000;
 		adapter->ptp_caps.n_ext_ts = 0;
@@ -688,7 +686,6 @@ void igb_ptp_init(struct igb_adapter *adapter)
 		break;
 	case e1000_82580:
 	case e1000_i350:
-		snprintf(adapter->ptp_caps.name, 16, "%pm", netdev->dev_addr);
 		adapter->ptp_caps.owner = THIS_MODULE;
 		adapter->ptp_caps.max_adj = 62499999;
 		adapter->ptp_caps.n_ext_ts = 0;
@@ -707,7 +704,6 @@ void igb_ptp_init(struct igb_adapter *adapter)
 		break;
 	case e1000_i210:
 	case e1000_i211:
-		snprintf(adapter->ptp_caps.name, 16, "%pm", netdev->dev_addr);
 		adapter->ptp_caps.owner = THIS_MODULE;
 		adapter->ptp_caps.max_adj = 62499999;
 		adapter->ptp_caps.n_ext_ts = 0;
@@ -752,7 +748,8 @@ void igb_ptp_init(struct igb_adapter *adapter)
 		wr32(E1000_IMS, E1000_IMS_TS);
 	}
 
-	adapter->ptp_clock = ptp_clock_register(&adapter->ptp_caps);
+	adapter->ptp_clock = ptp_clock_register(&adapter->ptp_caps,
+						&adapter->pdev->dev);
 	if (IS_ERR(adapter->ptp_clock)) {
 		adapter->ptp_clock = NULL;
 		dev_err(&adapter->pdev->dev, "ptp_clock_register failed\n");
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
index 3456d56..6219c91 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
@@ -917,7 +917,6 @@ void ixgbe_ptp_init(struct ixgbe_adapter *adapter)
 
 	switch (adapter->hw.mac.type) {
 	case ixgbe_mac_X540:
-		snprintf(adapter->ptp_caps.name, 16, "%pm", netdev->dev_addr);
 		adapter->ptp_caps.owner = THIS_MODULE;
 		adapter->ptp_caps.max_adj = 250000000;
 		adapter->ptp_caps.n_alarm = 0;
@@ -931,7 +930,6 @@ void ixgbe_ptp_init(struct ixgbe_adapter *adapter)
 		adapter->ptp_caps.enable = ixgbe_ptp_enable;
 		break;
 	case ixgbe_mac_82599EB:
-		snprintf(adapter->ptp_caps.name, 16, "%pm", netdev->dev_addr);
 		adapter->ptp_caps.owner = THIS_MODULE;
 		adapter->ptp_caps.max_adj = 250000000;
 		adapter->ptp_caps.n_alarm = 0;
@@ -960,7 +958,8 @@ void ixgbe_ptp_init(struct ixgbe_adapter *adapter)
 	/* (Re)start the overflow check */
 	adapter->flags2 |= IXGBE_FLAG2_OVERFLOW_CHECK_ENABLED;
 
-	adapter->ptp_clock = ptp_clock_register(&adapter->ptp_caps);
+	adapter->ptp_clock = ptp_clock_register(&adapter->ptp_caps,
+						&adapter->pdev->dev);
 	if (IS_ERR(adapter->ptp_clock)) {
 		adapter->ptp_clock = NULL;
 		e_dev_err("ptp_clock_register failed\n");
diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c
index b0da022..12a4c4c 100644
--- a/drivers/net/phy/dp83640.c
+++ b/drivers/net/phy/dp83640.c
@@ -871,7 +871,6 @@ static void dp83640_clock_init(struct dp83640_clock *clock, struct mii_bus *bus)
 	mutex_init(&clock->clock_lock);
 	INIT_LIST_HEAD(&clock->phylist);
 	clock->caps.owner = THIS_MODULE;
-	sprintf(clock->caps.name, "dp83640 timer");
 	clock->caps.max_adj	= 1953124;
 	clock->caps.n_alarm	= 0;
 	clock->caps.n_ext_ts	= N_EXT_TS;
@@ -980,7 +979,7 @@ static int dp83640_probe(struct phy_device *phydev)
 
 	if (choose_this_phy(clock, phydev)) {
 		clock->chosen = dp83640;
-		clock->ptp_clock = ptp_clock_register(&clock->caps);
+		clock->ptp_clock = ptp_clock_register(&clock->caps, &phydev->dev);
 		if (IS_ERR(clock->ptp_clock)) {
 			err = PTR_ERR(clock->ptp_clock);
 			goto no_register;
diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c
index 6e47450..60fa259 100644
--- a/drivers/ptp/ptp_clock.c
+++ b/drivers/ptp/ptp_clock.c
@@ -186,7 +186,8 @@ static void delete_ptp_clock(struct posix_clock *pc)
 
 /* public interface */
 
-struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info)
+struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info,
+				     struct device *parent)
 {
 	struct ptp_clock *ptp;
 	int err = 0, index, major = MAJOR(ptp_devt);
@@ -219,11 +220,13 @@ struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info)
 	init_waitqueue_head(&ptp->tsev_wq);
 
 	/* Create a new device in our class. */
-	ptp->dev = device_create(ptp_class, NULL, ptp->devid, ptp,
+	ptp->dev = device_create(ptp_class, parent, ptp->devid, ptp,
 				 "ptp%d", ptp->index);
 	if (IS_ERR(ptp->dev))
 		goto no_device;
 
+	ptp->name = parent ? dev_name(parent) : dev_name(ptp->dev);
+
 	dev_set_drvdata(ptp->dev, ptp);
 
 	err = ptp_populate_sysfs(ptp);
diff --git a/drivers/ptp/ptp_ixp46x.c b/drivers/ptp/ptp_ixp46x.c
index e03c406..c0939b1 100644
--- a/drivers/ptp/ptp_ixp46x.c
+++ b/drivers/ptp/ptp_ixp46x.c
@@ -241,7 +241,6 @@ static int ptp_ixp_enable(struct ptp_clock_info *ptp,
 
 static struct ptp_clock_info ptp_ixp_caps = {
 	.owner		= THIS_MODULE,
-	.name		= "IXP46X timer",
 	.max_adj	= 66666655,
 	.n_ext_ts	= N_EXT_TS,
 	.pps		= 0,
@@ -298,7 +297,7 @@ static int __init ptp_ixp_init(void)
 
 	ixp_clock.caps = ptp_ixp_caps;
 
-	ixp_clock.ptp_clock = ptp_clock_register(&ixp_clock.caps);
+	ixp_clock.ptp_clock = ptp_clock_register(&ixp_clock.caps, NULL);
 
 	if (IS_ERR(ixp_clock.ptp_clock))
 		return PTR_ERR(ixp_clock.ptp_clock);
diff --git a/drivers/ptp/ptp_pch.c b/drivers/ptp/ptp_pch.c
index 3a9c17e..0ae0c27 100644
--- a/drivers/ptp/ptp_pch.c
+++ b/drivers/ptp/ptp_pch.c
@@ -511,7 +511,6 @@ static int ptp_pch_enable(struct ptp_clock_info *ptp,
 
 static struct ptp_clock_info ptp_pch_caps = {
 	.owner		= THIS_MODULE,
-	.name		= "PCH timer",
 	.max_adj	= 50000000,
 	.n_ext_ts	= N_EXT_TS,
 	.pps		= 0,
@@ -627,7 +626,7 @@ pch_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	}
 
 	chip->caps = ptp_pch_caps;
-	chip->ptp_clock = ptp_clock_register(&chip->caps);
+	chip->ptp_clock = ptp_clock_register(&chip->caps, &pdev->dev);
 
 	if (IS_ERR(chip->ptp_clock))
 		return PTR_ERR(chip->ptp_clock);
diff --git a/drivers/ptp/ptp_private.h b/drivers/ptp/ptp_private.h
index 69d3207..a3bf959 100644
--- a/drivers/ptp/ptp_private.h
+++ b/drivers/ptp/ptp_private.h
@@ -42,6 +42,7 @@ struct ptp_clock {
 	struct posix_clock clock;
 	struct device *dev;
 	struct ptp_clock_info *info;
+	const char *name;
 	dev_t devid;
 	int index; /* index into clocks.map */
 	struct pps_device *pps_source;
diff --git a/drivers/ptp/ptp_sysfs.c b/drivers/ptp/ptp_sysfs.c
index 2f93926..f3c4519 100644
--- a/drivers/ptp/ptp_sysfs.c
+++ b/drivers/ptp/ptp_sysfs.c
@@ -25,7 +25,7 @@ static ssize_t clock_name_show(struct device *dev,
 			       struct device_attribute *attr, char *page)
 {
 	struct ptp_clock *ptp = dev_get_drvdata(dev);
-	return snprintf(page, PAGE_SIZE-1, "%s\n", ptp->info->name);
+	return snprintf(page, PAGE_SIZE-1, "%s\n", ptp->name);
 }
 
 #define PTP_SHOW_INT(name)						\
diff --git a/include/linux/ptp_clock_kernel.h b/include/linux/ptp_clock_kernel.h
index 945704c..e673de0 100644
--- a/include/linux/ptp_clock_kernel.h
+++ b/include/linux/ptp_clock_kernel.h
@@ -21,6 +21,7 @@
 #ifndef _PTP_CLOCK_KERNEL_H_
 #define _PTP_CLOCK_KERNEL_H_
 
+#include <linux/device.h>
 #include <linux/ptp_clock.h>
 
 
@@ -73,7 +74,6 @@ struct ptp_clock_request {
 
 struct ptp_clock_info {
 	struct module *owner;
-	char name[16];
 	s32 max_adj;
 	int n_alarm;
 	int n_ext_ts;
@@ -92,10 +92,12 @@ struct ptp_clock;
 /**
  * ptp_clock_register() - register a PTP hardware clock driver
  *
- * @info:  Structure describing the new clock.
+ * @info:   Structure describing the new clock.
+ * @parent: Pointer to the parent device of the new clock.
  */
 
-extern struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info);
+extern struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info,
+					    struct device *parent);
 
 /**
  * ptp_clock_unregister() - unregister a PTP hardware clock driver
-- 
1.7.2.5

^ permalink raw reply related

* [PATCH net-next 2/3] ptp: provide the clock's adjusted frequency
From: Richard Cochran @ 2012-09-21 17:00 UTC (permalink / raw)
  To: netdev
  Cc: Ben Hutchings, David Miller, Jacob Keller, Jeff Kirsher,
	John Stultz, Matthew Vick
In-Reply-To: <cover.1348245523.git.richardcochran@gmail.com>

If the timex.mode field indicates a query, then we provide the value of
the current frequency adjustment.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 drivers/ptp/ptp_clock.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c
index fbd7104..6e47450 100644
--- a/drivers/ptp/ptp_clock.c
+++ b/drivers/ptp/ptp_clock.c
@@ -148,6 +148,11 @@ static int ptp_clock_adjtime(struct posix_clock *pc, struct timex *tx)
 
 		err = ops->adjfreq(ops, scaled_ppm_to_ppb(tx->freq));
 		ptp->dialed_frequency = tx->freq;
+
+	} else if (tx->modes == 0) {
+
+		tx->freq = ptp->dialed_frequency;
+		err = 0;
 	}
 
 	return err;
-- 
1.7.2.5

^ permalink raw reply related

* [PATCH net-next 1/3] ptp: remember the adjusted frequency
From: Richard Cochran @ 2012-09-21 17:00 UTC (permalink / raw)
  To: netdev
  Cc: Ben Hutchings, David Miller, Jacob Keller, Jeff Kirsher,
	John Stultz, Matthew Vick
In-Reply-To: <cover.1348245523.git.richardcochran@gmail.com>

This patch adds a field to the representation of a PTP hardware clock in
order to remember the frequency adjustment value dialed by the user.

Adding this field will let us answer queries in the manner of adjtimex
in a follow on patch.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 drivers/ptp/ptp_clock.c   |    1 +
 drivers/ptp/ptp_private.h |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c
index 1e528b5..fbd7104 100644
--- a/drivers/ptp/ptp_clock.c
+++ b/drivers/ptp/ptp_clock.c
@@ -147,6 +147,7 @@ static int ptp_clock_adjtime(struct posix_clock *pc, struct timex *tx)
 	} else if (tx->modes & ADJ_FREQUENCY) {
 
 		err = ops->adjfreq(ops, scaled_ppm_to_ppb(tx->freq));
+		ptp->dialed_frequency = tx->freq;
 	}
 
 	return err;
diff --git a/drivers/ptp/ptp_private.h b/drivers/ptp/ptp_private.h
index 4d5b508..69d3207 100644
--- a/drivers/ptp/ptp_private.h
+++ b/drivers/ptp/ptp_private.h
@@ -45,6 +45,7 @@ struct ptp_clock {
 	dev_t devid;
 	int index; /* index into clocks.map */
 	struct pps_device *pps_source;
+	long dialed_frequency; /* remembers the frequency adjustment */
 	struct timestamp_event_queue tsevq; /* simple fifo for time stamps */
 	struct mutex tsevq_mux; /* one process at a time reading the fifo */
 	wait_queue_head_t tsev_wq;
-- 
1.7.2.5

^ permalink raw reply related

* [PATCH net-next 0/3] Two new PTP Hardware Clock features
From: Richard Cochran @ 2012-09-21 17:00 UTC (permalink / raw)
  To: netdev
  Cc: Ben Hutchings, David Miller, Jacob Keller, Jeff Kirsher,
	John Stultz, Matthew Vick

This patch series adds two new features to the PHC code.

The first two patches let a user program find out the previously
dialed frequency adjustment. This is primarily useful when restarting
a PTP service, since without this information, the presumably correct
adjustment will bias the new frequency estimation.

The third patch makes the sysfs clock name come from the 'struct
device'. This idea was recently discussed on netdev as a way of taking
the guesswork out of the naming scheme.

Thanks,
Richard

Richard Cochran (3):
  ptp: remember the adjusted frequency
  ptp: provide the clock's adjusted frequency
  ptp: derive the device name from the parent device

 drivers/net/ethernet/freescale/gianfar_ptp.c |    3 +--
 drivers/net/ethernet/intel/igb/igb_ptp.c     |    7 ++-----
 drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c |    5 ++---
 drivers/net/phy/dp83640.c                    |    3 +--
 drivers/ptp/ptp_clock.c                      |   13 +++++++++++--
 drivers/ptp/ptp_ixp46x.c                     |    3 +--
 drivers/ptp/ptp_pch.c                        |    3 +--
 drivers/ptp/ptp_private.h                    |    2 ++
 drivers/ptp/ptp_sysfs.c                      |    2 +-
 include/linux/ptp_clock_kernel.h             |    8 +++++---
 10 files changed, 27 insertions(+), 22 deletions(-)

-- 
1.7.2.5

^ permalink raw reply

* Re: [RFC] tcp: use order-3 pages in tcp_sendmsg()
From: Eric Dumazet @ 2012-09-21 16:51 UTC (permalink / raw)
  To: David Miller; +Cc: rick.jones2, subramanian.vijay, netdev
In-Reply-To: <20120921.122705.1344923255084267186.davem@davemloft.net>

On Fri, 2012-09-21 at 12:27 -0400, David Miller wrote:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Fri, 21 Sep 2012 17:48:31 +0200
> 
> > There is probably a reason why lo default MTU is 16436 ?
> 
> That's what fit into L1 caches back in 1999

I see ;)

Nowadays, we even have the NETIF_F_NOCACHE_COPY flag and
__copy_from_user_nocache()

Hmm, we can not toggle this flag on loopback yet

# ethtool -K lo tx-nocache-copy on
Could not change any device features

^ permalink raw reply

* Re: [PATCH] ath6kl: use list_move_tail instead of list_del/list_add_tail
From: Kalle Valo @ 2012-09-21 16:42 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: linville, yongjun_wei, linux-wireless, netdev, ath6kl-devel
In-Reply-To: <CAPgLHd-6RmrLpi9FPTFhXiA+BHywGknmvNAd-KCdHaM+tn0qgQ@mail.gmail.com>

On 09/05/2012 10:07 AM, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Using list_move_tail() instead of list_del() + list_add_tail().
> 
> spatch with a semantic match is used to found this problem.
> (http://coccinelle.lip6.fr/)
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Thanks, applied to ath6kl.git.

Kalle

^ permalink raw reply

* RE: Netfilter lacks ability to filter packets via Application-origin
From: Chad Gray @ 2012-09-21 16:39 UTC (permalink / raw)
  To: netdev@vger.kernel.org

No firewall appears to exist for Linux that can filter packets based on application. Mac and Windows both offer these firewalls. Why can't Linux add this capability to its firewalls? It is a very powerful privacy & security & awareness tool for the user. 

Every attempt I've made to get this capability added to Distributions, firewall makers, etc has resulted in their telling me the Kernel does not support this capability and that is why Linux can't do this and won't be able to do this until the Kernel supports it. 		 	   		  

^ permalink raw reply

* [PATCH net-next] be2net: Ignore spurious UE indication from NIC
From: Ajit Khaparde @ 2012-09-21 16:36 UTC (permalink / raw)
  To: davem; +Cc: netdev

Ignore spurious UE indication seen on some platforms.
Consider the error as un-recoverable only when the bits
stay high during second sampling.

Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com>
---
 drivers/net/ethernet/emulex/benet/be.h      |    2 ++
 drivers/net/ethernet/emulex/benet/be_main.c |   18 +++++++++++++++---
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h
index 5b622993..3d4a7bc 100644
--- a/drivers/net/ethernet/emulex/benet/be.h
+++ b/drivers/net/ethernet/emulex/benet/be.h
@@ -401,6 +401,8 @@ struct be_adapter {
 	bool eeh_error;
 	bool fw_timeout;
 	bool hw_error;
+	u32 ue_lo;
+	u32 ue_hi;
 
 	u32 port_num;
 	bool promiscuous;
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 84379f4..e970f77 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -2105,6 +2105,7 @@ void be_detect_error(struct be_adapter *adapter)
 	u32 ue_lo = 0, ue_hi = 0, ue_lo_mask = 0, ue_hi_mask = 0;
 	u32 sliport_status = 0, sliport_err1 = 0, sliport_err2 = 0;
 	u32 i;
+	struct device *dev = &adapter->pdev->dev;
 
 	if (be_crit_error(adapter))
 		return;
@@ -2129,13 +2130,22 @@ void be_detect_error(struct be_adapter *adapter)
 
 		ue_lo = (ue_lo & ~ue_lo_mask);
 		ue_hi = (ue_hi & ~ue_hi_mask);
+		if (ue_lo != adapter->ue_lo || ue_hi != adapter->ue_hi) {
+			dev_err(dev, "UE read: 0x%x/0x%x\n", ue_lo, ue_hi);
+			goto done;
+		}
+	}
+
+	if (ue_lo == 0xffffffff || ue_hi == 0xffffffff) {
+		adapter->eeh_error = true;
+		dev_err(dev, "PCI slot disconnected\n");
+		goto done;
 	}
 
 	if (ue_lo || ue_hi ||
 		sliport_status & SLIPORT_STATUS_ERR_MASK) {
 		adapter->hw_error = true;
-		dev_err(&adapter->pdev->dev,
-			"Error detected in the card\n");
+		dev_err(dev, "UE detected\n");
 	}
 
 	if (sliport_status & SLIPORT_STATUS_ERR_MASK) {
@@ -2162,7 +2172,9 @@ void be_detect_error(struct be_adapter *adapter)
 				"UE: %s bit set\n", ue_status_hi_desc[i]);
 		}
 	}
-
+done:
+	adapter->ue_lo = ue_lo;
+	adapter->ue_hi = ue_hi;
 }
 
 static void be_msix_disable(struct be_adapter *adapter)
-- 
1.7.9.5

^ permalink raw reply related

* Re: [RFC] tcp: use order-3 pages in tcp_sendmsg()
From: David Miller @ 2012-09-21 16:27 UTC (permalink / raw)
  To: eric.dumazet; +Cc: rick.jones2, subramanian.vijay, netdev
In-Reply-To: <1348242511.2669.635.camel@edumazet-glaptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 21 Sep 2012 17:48:31 +0200

> There is probably a reason why lo default MTU is 16436 ?

That's what fit into L1 caches back in 1999

^ permalink raw reply

* Re: [Patch net-next v2] l2tp: fix compile error when CONFIG_IPV6=m and CONFIG_L2TP=y
From: David Miller @ 2012-09-21 16:07 UTC (permalink / raw)
  To: amwang; +Cc: netdev
In-Reply-To: <1348209366-26978-1-git-send-email-amwang@redhat.com>

From: Cong Wang <amwang@redhat.com>
Date: Fri, 21 Sep 2012 14:36:06 +0800

> When CONFIG_IPV6=m and CONFIG_L2TP=y, I got the following compile error:
...
> This is due to l2tp uses symbols from IPV6, so when IPV6
> is a module, l2tp is not allowed to be builtin.
> 
> Cc: David Miller <davem@davemloft.net>
> Signed-off-by: Cong Wang <amwang@redhat.com>

Applied, thanks.

^ permalink raw reply

* [PATCH 1/6] xen-netfront: handle backend CLOSED without CLOSING
From: David Vrabel @ 2012-09-21 16:04 UTC (permalink / raw)
  To: xen-devel
  Cc: David Vrabel, Konrad Rzeszutek Wilk, linux-kernel, Ian Campbell,
	netdev
In-Reply-To: <1348243464-15903-1-git-send-email-david.vrabel@citrix.com>

From: David Vrabel <david.vrabel@citrix.com>

Backend drivers shouldn't transistion to CLOSED unless the frontend is
CLOSED.  If a backend does transition to CLOSED too soon then the
frontend may not see the CLOSING state and will not properly shutdown.

So, treat an unexpected backend CLOSED state the same as CLOSING.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: <netdev@vger.kernel.org>
---
 drivers/net/xen-netfront.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 3089990..843533a 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -1719,7 +1719,6 @@ static void netback_changed(struct xenbus_device *dev,
 	case XenbusStateReconfiguring:
 	case XenbusStateReconfigured:
 	case XenbusStateUnknown:
-	case XenbusStateClosed:
 		break;
 
 	case XenbusStateInitWait:
@@ -1734,6 +1733,10 @@ static void netback_changed(struct xenbus_device *dev,
 		netif_notify_peers(netdev);
 		break;
 
+	case XenbusStateClosed:
+		if (dev->state == XenbusStateClosed)
+			break;
+		/* Missed the backend's CLOSING state -- fallthrough */
 	case XenbusStateClosing:
 		xenbus_frontend_closed(dev);
 		break;
-- 
1.7.2.5

^ permalink raw reply related

* Re: [RFC] tcp: use order-3 pages in tcp_sendmsg()
From: Eric Dumazet @ 2012-09-21 15:48 UTC (permalink / raw)
  To: Rick Jones; +Cc: David Miller, subramanian.vijay, netdev
In-Reply-To: <1348172722.2669.10.camel@edumazet-glaptop>

On Thu, 2012-09-20 at 22:25 +0200, Eric Dumazet wrote:
> On Thu, 2012-09-20 at 13:06 -0700, Rick Jones wrote:
> 
> > 
> > Yes, I was being too fast and loose with my wording, paying more 
> > attention to the netperf tests than the rest of it.  While loopback may 
> > be lossless, TCP retransmissions over loopback shouldn't be all *that* 
> > surprising.
> 
> Sending perfect packets (large packets) should trigger no retransmits.

By the way, with current MTU of 16436 on loopback, max packet size is
48KB (3 MSS)

Using an mtu of 65536 allows another 25% increase of bulk performance...

(and less potential reordering effects, as a packet contains one MSS
instead of three)

There is probably a reason why lo default MTU is 16436 ?

^ permalink raw reply

* 3.6rc6 use-after-free in destroy_conntrack()
From: Dave Jones @ 2012-09-21 15:31 UTC (permalink / raw)
  To: netdev; +Cc: stefw, Fedora Kernel Team

We just had a report of this happening during shutdown..

There's a blurry photograph of the full trace here.. https://bugzilla.redhat.com/attachment.cgi?id=615311

Rough transcription:

general protection fault
RIP: destroy_conntrack+0x88

RAX: 6b6b6b6b6b6b6b6b6b6b

trace:
 ? destroy_conntrack
 ? __nf_conntrack_find
 nf_conntrack_destroy
 ? nf_regsiter_afinfo
 skb_release_head_state
 __kfree
 kfree
 arp_error_report
 ? neigh_parms_alloc
 neigh_invalidate
 ? neigh_parms_alloc
 neigh_timer_handler
 run_timer_softirq
 ? run_timer_softirq
 __do_softirq
 call_softirq
 do_softirq
 irq_exit
 smp_apic_timer_interrupt
 apic_timer_interrupt
 <EOI>
 ? mwait_idle
 ? mwait_idle
 cpu_idle
 start_secondary

Disassembly of the code line shows that the dereference is happening here
in destroy_conntrack ..


        l4proto = __nf_ct_l4proto_find(nf_ct_l3num(ct), nf_ct_protonum(ct));
    1403:       0f b6 b3 86 00 00 00    movzbl 0x86(%rbx),%esi
    140a:       0f b7 7b 72             movzwl 0x72(%rbx),%edi
    140e:       e8 00 00 00 00          callq  1413 <destroy_conntrack+0x83>
->       if (l4proto && l4proto->destroy)
    1413:       48 85 c0                test   %rax,%rax
    1416:       74 0e                   je     1426 <destroy_conntrack+0x96>
    1418:       48 8b 40 28             mov    0x28(%rax),%rax

'l4proto' seems to have been freed already, judging by the value in rax.

	Dave

^ permalink raw reply

* Re: [PATCH] tcp: sysctl for initial receive window
From: Eric Dumazet @ 2012-09-21 15:25 UTC (permalink / raw)
  To: Jesper Dangaard Brouer; +Cc: netdev, Nandita Dukkipati
In-Reply-To: <20120921085502.4534.20232.stgit@dragon>

On Fri, 2012-09-21 at 10:55 +0200, Jesper Dangaard Brouer wrote:
> Make it possible to adjust the TCP default initial advertised receive
> window, via sysctl /proc/sys/net/ipv4/tcp_init_recv_window.
> 
> The window size is this value multiplied by the MSS of the connection.
> The default value is (still) 10, as descibed in commit 356f039822b
> (TCP: increase default initial receive window.)
> 
> Allow minimum value of 1, but recommend against setting value below 2
> in the documentation.
> 
> Its possible to control/override this value per route table entry via
> the iproute2 option initrwnd.  Having the global default exported via
> sysctl, helps determine the default setting, and make is easier to
> adjust.

I was wondering why its not symmetric :

If we add a sysctl for initial receive window, we need another one for
initial send window ?

Thanks

^ 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