Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH] net: ipv6: change %8s to %s for rt->dst.dev->name in seq_printf of rt6_info_route
From: David Miller @ 2012-11-05  5:50 UTC (permalink / raw)
  To: gang.chen; +Cc: shanwei88, kuznet, jmorris, yoshfuji, kaber, netdev
In-Reply-To: <50972C58.4010008@asianux.com>

From: Chen Gang <gang.chen@asianux.com>
Date: Mon, 05 Nov 2012 11:02:48 +0800

>> 
>> 1. not to send same patch triple times. 
> 
>   thanks, I shall notice, next time.
>   (I shall 'believe' another members).
> 
>> 2. config your email client,because tab is changed to space.
>>    you can read Documentation/email-clients.txt.
> 
>   1) thanks. I shall notice, next time.
>   2) now, I get gvim as extention editor for thounderbird
>   3) the patch is generated by `git format-patch -s --summary --stat`
>      it use "' '\t" as head, I do not touch it, maybe it is correct.
> 
> welcome any members to giving additional suggestions and completions.
> 
> thanks
> 
> the modified contents are below,

Post new versions of a patch as fresh postings, not as replies
to other emails.

^ permalink raw reply

* Re: [PATCH] vlan: set sysfs device_type to 'vlan'
From: David Miller @ 2012-11-05  5:53 UTC (permalink / raw)
  To: cardoe; +Cc: kaber, netdev, systemd-devel, linux-kernel
In-Reply-To: <CAFWqQMSes5J1bjUA6NBiWKrjbdUKJkhz-mdNYhGLU-A8cksxZg@mail.gmail.com>

From: Doug Goldstein <cardoe@cardoe.com>
Date: Sun, 4 Nov 2012 23:45:56 -0600

> As Ben Greear pointed out this would allow shell scripts and other
> scripting languages to better detect vlans. Kay pointed out that this
> would allow better uevent filters in the future as well. So there are
> some merits to this patch. If you'd prefer I can resubmit with a
> better commit message entailing the reasons behind it.

For the thousandth time:

All of those scripts and other users of this new facility will
need to have backup code to detect vlan devices when this
sysfs thing is not present.

They are already to determine this information already, and
they alreayd have to be ugly to handle EVERY EXISTING KERNEL
ON THE PLANET.

So the effective value is zero.

^ permalink raw reply

* Re: [PATCH] net: ipv6: change %8s to %s for rt->dst.dev->name in seq_printf of rt6_info_route
From: Chen Gang @ 2012-11-05  6:02 UTC (permalink / raw)
  To: David Miller; +Cc: shanwei88, kuznet, jmorris, yoshfuji, kaber, netdev
In-Reply-To: <20121105.005058.975475468510407211.davem@davemloft.net>

于 2012年11月05日 13:50, David Miller 写道:
> 
> Post new versions of a patch as fresh postings, not as replies
> to other emails.
> 
> 

  thanks, I shall notice, next time.
  if truly need sending it again (5th time), please tell me, thanks.
  (since, it has been posted "4 times", which has almost been 'spam')


-- 
Chen Gang

Asianux Corporation

^ permalink raw reply

* Re: [PATCH] vlan: set sysfs device_type to 'vlan'
From: Doug Goldstein @ 2012-11-05  6:19 UTC (permalink / raw)
  To: David Miller; +Cc: kaber, netdev, systemd-devel, linux-kernel
In-Reply-To: <20121105.005343.973313737817968846.davem@davemloft.net>

On Sun, Nov 4, 2012 at 11:53 PM, David Miller <davem@davemloft.net> wrote:
> From: Doug Goldstein <cardoe@cardoe.com>
> Date: Sun, 4 Nov 2012 23:45:56 -0600
>
>> As Ben Greear pointed out this would allow shell scripts and other
>> scripting languages to better detect vlans. Kay pointed out that this
>> would allow better uevent filters in the future as well. So there are
>> some merits to this patch. If you'd prefer I can resubmit with a
>> better commit message entailing the reasons behind it.
>
> For the thousandth time:
>
> All of those scripts and other users of this new facility will
> need to have backup code to detect vlan devices when this
> sysfs thing is not present.
>
> They are already to determine this information already, and
> they alreayd have to be ugly to handle EVERY EXISTING KERNEL
> ON THE PLANET.
>
> So the effective value is zero.

By this argument we shouldn't ever improve any API or add new syscalls
since we'll have to have fallback code to handle the old interfaces
when the new ones aren't available.

Since everything already has the existing implementations to handle
every existing kernel on the planet then this patch doesn't harm
anything and should I want to write a shell script that only works on
Linux 3.8 (assuming this patch is in there) and is only forward
looking then I can use the more complete sysfs.

So the effective penalty is zero and you get a more complete sysfs,
which is where you're value is.

-- 
Doug Goldstein

^ permalink raw reply

* Re: [PATCH] vlan: set sysfs device_type to 'vlan'
From: David Miller @ 2012-11-05  6:44 UTC (permalink / raw)
  To: cardoe; +Cc: kaber, netdev, systemd-devel, linux-kernel
In-Reply-To: <CAFWqQMRa6sPxqAJswu-6f06KxhqLSsY2T-dE3p-tpo4VEpwfdA@mail.gmail.com>

From: Doug Goldstein <cardoe@cardoe.com>
Date: Mon, 5 Nov 2012 00:19:19 -0600

> By this argument we shouldn't ever improve any API or add new syscalls
> since we'll have to have fallback code to handle the old interfaces
> when the new ones aren't available.

It makes sense to add new APIs when existing mechanisms are too
difficult _AND_ code doesn't already exist that works reasonable well
with existing facilities.

^ permalink raw reply

* [PATCH 0/2 v2] net: at91_ether add dt and pinctrl support
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-11-05  7:30 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: netdev, devicetree-discuss, Nicolas Ferre, Joachim Eastwood

Hi,

	v2: fix typo in doc + miising empty line

	This patch serie add dt and pinctrl support to the at91 ether

	this is need to use the network on at91rm9200 as we now have dt
	support on it

Jean-Christophe PLAGNIOL-VILLARD (2):
      net: at91_ether: add dt support
      net: at91_ether: add pinctrl support

 Documentation/devicetree/bindings/net/cdns-emac.txt |   23 +++++++++++++++++++++++
 drivers/net/ethernet/cadence/at91_ether.c           |   84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------
 2 files changed, 100 insertions(+), 7 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/cdns-emac.txt

Best Regards,
J.

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

^ permalink raw reply

* [PATCH 1/2 v2] net: at91_ether: add dt support
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-11-05  7:34 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Nicolas Ferre, devicetree-discuss,
	Jean-Christophe PLAGNIOL-VILLARD, netdev
In-Reply-To: <20121105073015.GM19021@game.jcrosoft.org>

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Tested-by: Joachim Eastwood <manabian@gmail.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: netdev@vger.kernel.org
---
 .../devicetree/bindings/net/cdns-emac.txt          |   23 ++++++
 drivers/net/ethernet/cadence/at91_ether.c          |   73 ++++++++++++++++++--
 2 files changed, 89 insertions(+), 7 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/cdns-emac.txt

diff --git a/Documentation/devicetree/bindings/net/cdns-emac.txt b/Documentation/devicetree/bindings/net/cdns-emac.txt
new file mode 100644
index 0000000..09055c2
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/cdns-emac.txt
@@ -0,0 +1,23 @@
+* Cadence EMAC Ethernet controller
+
+Required properties:
+- compatible: Should be "cdns,[<chip>-]{emac}"
+  Use "cdns,at91rm9200-emac" Atmel at91rm9200 SoC.
+  or the generic form: "cdns,emac".
+- reg: Address and length of the register set for the device
+- interrupts: Should contain macb interrupt
+- phy-mode: String, operation mode of the PHY interface.
+  Supported values are: "mii", "rmii".
+
+Optional properties:
+- local-mac-address: 6 bytes, mac address
+
+Examples:
+
+	macb0: ethernet@fffc4000 {
+		compatible = "cdns,at91rm9200-emac";
+		reg = <0xfffc4000 0x4000>;
+		interrupts = <21>;
+		phy-mode = "rmii";
+		local-mac-address = [3a 0e 03 04 05 06];
+	};
diff --git a/drivers/net/ethernet/cadence/at91_ether.c b/drivers/net/ethernet/cadence/at91_ether.c
index 0d6392d..039e7ef 100644
--- a/drivers/net/ethernet/cadence/at91_ether.c
+++ b/drivers/net/ethernet/cadence/at91_ether.c
@@ -31,6 +31,9 @@
 #include <linux/gfp.h>
 #include <linux/phy.h>
 #include <linux/io.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
+#include <linux/of_net.h>
 
 #include "macb.h"
 
@@ -443,6 +446,50 @@ static const struct net_device_ops at91ether_netdev_ops = {
 #endif
 };
 
+#if defined(CONFIG_OF)
+static const struct of_device_id at91ether_dt_ids[] = {
+	{ .compatible = "cdns,at91rm9200-emac" },
+	{ .compatible = "cdns,emac" },
+	{ /* sentinel */ }
+};
+
+MODULE_DEVICE_TABLE(of, at91ether_dt_ids);
+
+static int at91ether_get_phy_mode_dt(struct platform_device *pdev)
+{
+	struct device_node *np = pdev->dev.of_node;
+
+	if (np)
+		return of_get_phy_mode(np);
+
+	return -ENODEV;
+}
+
+static int at91ether_get_hwaddr_dt(struct macb *bp)
+{
+	struct device_node *np = bp->pdev->dev.of_node;
+
+	if (np) {
+		const char *mac = of_get_mac_address(np);
+		if (mac) {
+			memcpy(bp->dev->dev_addr, mac, ETH_ALEN);
+			return 0;
+		}
+	}
+
+	return -ENODEV;
+}
+#else
+static int at91ether_get_phy_mode_dt(struct platform_device *pdev)
+{
+	return -ENODEV;
+}
+static int at91ether_get_hwaddr_dt(struct macb *bp)
+{
+	return -ENODEV;
+}
+#endif
+
 /*
  * Detect MAC & PHY and perform ethernet interface initialization
  */
@@ -466,7 +513,8 @@ static int __init at91ether_probe(struct platform_device *pdev)
 	lp = netdev_priv(dev);
 	lp->pdev = pdev;
 	lp->dev = dev;
-	lp->board_data = *board_data;
+	if (board_data)
+		lp->board_data = *board_data;
 	spin_lock_init(&lp->lock);
 
 	dev->base_addr = regs->start;		/* physical base address */
@@ -496,18 +544,28 @@ static int __init at91ether_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, dev);
 	SET_NETDEV_DEV(dev, &pdev->dev);
 
-	get_mac_address(dev);		/* Get ethernet address and store it in dev->dev_addr */
+	res = at91ether_get_hwaddr_dt(lp);
+	if (res < 0)
+		get_mac_address(dev);		/* Get ethernet address and store it in dev->dev_addr */
+
 	update_mac_address(dev);	/* Program ethernet address into MAC */
 
+	res = at91ether_get_phy_mode_dt(pdev);
+	if (res < 0) {
+		if (board_data && board_data->is_rmii)
+			lp->phy_interface = PHY_INTERFACE_MODE_RMII;
+		else
+			lp->phy_interface = PHY_INTERFACE_MODE_MII;
+	} else {
+		lp->phy_interface = res;
+	}
+
 	macb_writel(lp, NCR, 0);
 
-	if (board_data->is_rmii) {
+	if (lp->phy_interface == PHY_INTERFACE_MODE_RMII)
 		macb_writel(lp, NCFGR, MACB_BF(CLK, MACB_CLK_DIV32) | MACB_BIT(BIG) | MACB_BIT(RM9200_RMII));
-		lp->phy_interface = PHY_INTERFACE_MODE_RMII;
-	} else {
+	else
 		macb_writel(lp, NCFGR, MACB_BF(CLK, MACB_CLK_DIV32) | MACB_BIT(BIG));
-		lp->phy_interface = PHY_INTERFACE_MODE_MII;
-	}
 
 	/* Register the network interface */
 	res = register_netdev(dev);
@@ -602,6 +660,7 @@ static struct platform_driver at91ether_driver = {
 	.driver		= {
 		.name	= DRV_NAME,
 		.owner	= THIS_MODULE,
+		.of_match_table	= of_match_ptr(at91ether_dt_ids),
 	},
 };
 
-- 
1.7.10.4

^ permalink raw reply related

* [PATCH 2/2 v2] net: at91_ether: add pinctrl support
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-11-05  7:34 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Nicolas Ferre, devicetree-discuss,
	Jean-Christophe PLAGNIOL-VILLARD, netdev
In-Reply-To: <1352100892-19936-1-git-send-email-plagnioj@jcrosoft.com>

If no pinctrl available just report a warning as some architecture may not
need to do anything.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Tested-by: Joachim Eastwood <manabian@gmail.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: netdev@vger.kernel.org
---
 drivers/net/ethernet/cadence/at91_ether.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/net/ethernet/cadence/at91_ether.c b/drivers/net/ethernet/cadence/at91_ether.c
index 039e7ef..6eb928e 100644
--- a/drivers/net/ethernet/cadence/at91_ether.c
+++ b/drivers/net/ethernet/cadence/at91_ether.c
@@ -34,6 +34,7 @@
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/of_net.h>
+#include <linux/pinctrl/consumer.h>
 
 #include "macb.h"
 
@@ -501,11 +502,21 @@ static int __init at91ether_probe(struct platform_device *pdev)
 	struct phy_device *phydev;
 	struct macb *lp;
 	int res;
+	struct pinctrl *pinctrl;
 
 	regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!regs)
 		return -ENOENT;
 
+	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
+	if (IS_ERR(pinctrl)) {
+		res = PTR_ERR(pinctrl);
+		if (res == -EPROBE_DEFER)
+			return res;
+
+		dev_warn(&pdev->dev, "No pinctrl provided\n");
+	}
+
 	dev = alloc_etherdev(sizeof(struct macb));
 	if (!dev)
 		return -ENOMEM;
-- 
1.7.10.4

^ permalink raw reply related

* Re: [RESEND PATCH net-next] ipv6/multipath: remove flag NLM_F_EXCL after the first nexthop
From: Nicolas Dichtel @ 2012-11-05  8:30 UTC (permalink / raw)
  To: David Miller; +Cc: shemminger, netdev, joe, bernat, eric.dumazet, yoshfuji
In-Reply-To: <20121102.213857.2276553238313329445.davem@davemloft.net>

Le 03/11/2012 02:38, David Miller a écrit :
> From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> Date: Fri,  2 Nov 2012 09:58:22 +0100
>
>> fib6_add_rt2node() will reject the nexthop if this flag is set, so
>> we perform the check only for the first nexthop.
>>
>> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
>
> It seems a bit hackish, but I don't have any better ideas, so
> applied, thanks.
>
Yes, I agree. It's why I didn't include it in the initial patch ... but I also 
didn't find a better way :/

^ permalink raw reply

* RE: [PATCH net-next 0/2] cpsw: fix resource leak for v3.8
From: N, Mugunthan V @ 2012-11-05  8:40 UTC (permalink / raw)
  To: Richard Cochran, netdev@vger.kernel.org
  Cc: linux-arm-kernel@lists.infradead.org, David Miller,
	Chemparathy, Cyril, Hiremath, Vaibhav
In-Reply-To: <cover.1351930782.git.richardcochran@gmail.com>

> -----Original Message-----
> From: Richard Cochran [mailto:richardcochran@gmail.com]
> Sent: Saturday, November 03, 2012 1:55 PM
> To: netdev@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org; David Miller; Chemparathy,
> Cyril; N, Mugunthan V; Hiremath, Vaibhav
> Subject: [PATCH net-next 0/2] cpsw: fix resource leak for v3.8
> 
> While looking at the idea of removing all of the register offsets in
> the CPSW's device tree, I noticed that the driver would be leaking IO
> mappings. Although this is, strictly speaking, a bug fix, still it can
> wait to appear in v3.8, since there is no way to use the driver in
> v3.7 (or earlier) anyhow.
> 
> Thanks,
> Richard
> 
> 
> Richard Cochran (2):
>   cpsw: rename register banks to match the reference manual, part 2
>   cpsw: fix leaking IO mappings
> 
>  drivers/net/ethernet/ti/cpsw.c |   39 +++++++++++++++++++-------------
> -------
>  1 files changed, 19 insertions(+), 20 deletions(-)
> 
> --
> 1.7.2.5

The patches look good to me.

Acked-by: Mugunthan V N <mugunthanvnm@ti.com>

^ permalink raw reply

* Re: [PATCH RFC] pkt_sched: enable QFQ to support TSO/GSO
From: Cong Wang @ 2012-11-05  8:41 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: Paolo Valente, jhs, David Miller, LKML,
	Linux Kernel Network Developers, rizzo, fchecconi
In-Reply-To: <20121030072415.17199f9a@nehalam.linuxnetplumber.net>

On Tue, Oct 30, 2012 at 10:24 PM, Stephen Hemminger
<shemminger@vyatta.com> wrote:
> On Tue, 30 Oct 2012 07:00:56 +0100
> Paolo Valente <paolo.valente@unimore.it> wrote:
>
>> Hi,
>> if the max packet size for some class (configured through tc) is
>> violated by the actual size of the packets of that class, then QFQ
>> would not schedule classes correctly, and the data structures
>> implementing the bucket lists may get corrupted. This problem occurs
>> with TSO/GSO even if the max packet size is set to the MTU, and is,
>> e.g., the cause of the failure reported in [1]. Two patches have been
>> proposed to solve this problem in [2], one of them is a preliminary
>> version of this patch.
>>
>> This patch addresses the above issues by: 1) setting QFQ parameters to
>> proper values for supporting TSO/GSO (in particular, setting the
>> maximum possible packet size to 64KB), 2) automatically increasing the
>> max packet size for a class, lmax, when a packet with a larger size
>> than the current value of lmax arrives.
>>
>> The drawback of the first point is that the maximum weight for a class
>> is now limited to 4096, which is equal to 1/16 of the maximum weight
>> sum.
>>
>> Finally, this patch also forcibly caps the timestamps of a class if
>> they are too high to be stored in the bucket list. This capping, taken
>> from QFQ+ [3], handles the unfrequent case described in the comment to
>> the function slot_insert.
>>
>> [1] http://marc.info/?l=linux-netdev&m=134968777902077&w=2
>> [2] http://marc.info/?l=linux-netdev&m=135096573507936&w=2
>> [3] http://marc.info/?l=linux-netdev&m=134902691421670&w=2
>>
>> Signed-off-by: Paolo Valente <paolo.valente@unimore.it>
>> Tested-by: Cong Wang <amwang@redhat.com>
>
> Acked-by: Stephen Hemminger <shemminger@vyatta.com>


David, could you take this patch? Stephen acked it.

Thanks!

^ permalink raw reply

* Re: [PATCH 8/9] isdn: Remove unused variable causing a compile build warning
From: Lee Jones @ 2012-11-05  8:44 UTC (permalink / raw)
  To: David Miller; +Cc: pebolle, linux-kernel, isdn, netdev
In-Reply-To: <20121104.123013.700345271120279281.davem@davemloft.net>

On Sun, 04 Nov 2012, David Miller wrote:

> From: Lee Jones <lee.jones@linaro.org>
> Date: Sun, 4 Nov 2012 11:53:32 +0100
> 
> > On Sun, 04 Nov 2012, Paul Bolle wrote:
> > 
> >> On Sat, 2012-11-03 at 23:48 +0100, Lee Jones wrote:
> >> > On Sat, 03 Nov 2012, Paul Bolle wrote:
> >> > > On Sat, 2012-11-03 at 23:02 +0100, Lee Jones wrote:
> >> > > > This patch fixes:
> >> > > > drivers/isdn/i4l/isdn_common.c: In function ‘isdn_ioctl’:
> >> > > > drivers/isdn/i4l/isdn_common.c:1278:8: warning: unused variable ‘s’ [-Wunused-variable]
> >> > > 
> >> > > Did you have CONFIG_NETDEVICES not set in this build?
> >> > 
> >> > Ah yes, I see it. The function went down further than I thought
> >> > it did. So the real fix is to ensure 's' is defined inside of
> >> > some ifdef CONFIG_NETDEVICES guards. 
> >> 
> >> What puzzles me is that we only find these "#ifdef CONFIG_NETDEVICES"
> >> guards in this file and not in isdn_net.c, were all the ioctl commands
> >> guarded that way seem to be calling into. On first glance that doesn't
> >> make much sense.
> >> 
> >> (Actually the idea of having ISDN without NETDEVICES is a bit puzzling
> >> too. But there are too many parts of the isdn subsystem that I'm
> >> unfamiliar with to say whether that can make sense.)
> > 
> > I'm in the same position as you Paul. I just noticed the warning so
> > fixed it following the current way of doing things. Any, more
> > substantial changes requiring greater knowledge of the subsystem
> > would have to be done by someone else.
> 
> I think the most appropriate thing to do is make CONFIG_ISDN depend
> upon CONFIG_NETDEVICES in the Kconfig file.

... and then remove the CONFIG_NETDEVICES guards in isdn_common.c?

If that's suitable more suitable I can do that instead?

Just need a yay or nay and I'll make it happen.

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply

* Re: [RFC PATCH v2] iproute2: bridge: add veb/vepa toggle
From: Stephen Hemminger @ 2012-11-05  8:50 UTC (permalink / raw)
  To: John Fastabend; +Cc: bhutchings, netdev
In-Reply-To: <20121103032436.8744.12352.stgit@localhost6.localdomain6>

On Fri, 02 Nov 2012 20:24:36 -0700
John Fastabend <john.r.fastabend@intel.com> wrote:

> Test bridge commands to set veb, vepa modes to iproute2.
> 
> [root@jf-dev1-dcblab iproute2]# ./bridge/bridge bridge show
> eth2: mode VEB bridge_flags: self
> eth3: mode VEPA bridge_flags: self
> eth10: mode VEB bridge_flags: self
> eth12: mode VEB bridge_flags: self
> 
> [root@jf-dev1-dcblab iproute2]# ./bridge/bridge bridge state mode veb dev eth3 self
> bridge_mode_set eth3: type 19 family 7 mode VEB flags 0002
> 
> [root@jf-dev1-dcblab iproute2]# ./bridge/bridge bridge show
> eth2: mode VEB bridge_flags: self
> eth3: mode VEB bridge_flags: self
> eth10: mode VEB bridge_flags: self
> eth12: mode VEB bridge_flags: self
> 
> Maybe the final patch should separate protocol (STP) configuraiton
> from the bridge setup (VEB.VEPA). But this is good for testing in
> the meantime.
> 
> v2: remove a lot of the crazy cruft in the last patch
> 
> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
> ---
> 
>  bridge/br_common.h      |    1 
>  bridge/bridge.c         |    3 -
>  bridge/fdb.c            |  244 +++++++++++++++++++++++++++++++++++++++++++++++
>  include/linux/if_link.h |   16 +++
>  4 files changed, 263 insertions(+), 1 deletions(-)
> 
> diff --git a/bridge/br_common.h b/bridge/br_common.h
> index 718ecb9..3e5dcab 100644
> --- a/bridge/br_common.h
> +++ b/bridge/br_common.h
> @@ -5,6 +5,7 @@ extern int print_fdb(const struct sockaddr_nl *who,
>  		     struct nlmsghdr *n, void *arg);
>  
>  extern int do_fdb(int argc, char **argv);
> +extern int do_bridge(int argc, char **argv);
>  extern int do_monitor(int argc, char **argv);
>  
>  extern int preferred_family;
> diff --git a/bridge/bridge.c b/bridge/bridge.c
> index e2c33b0..b5145c1 100644
> --- a/bridge/bridge.c
> +++ b/bridge/bridge.c
> @@ -27,7 +27,7 @@ static void usage(void)
>  {
>  	fprintf(stderr,
>  "Usage: bridge [ OPTIONS ] OBJECT { COMMAND | help }\n"
> -"where  OBJECT := { fdb |  monitor }\n"
> +"where  OBJECT := { fdb |  monitor | bridge }\n"
>  "       OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails]\n" );
>  	exit(-1);
>  }
> @@ -43,6 +43,7 @@ static const struct cmd {
>  	int (*func)(int argc, char **argv);
>  } cmds[] = {
>  	{ "fdb", 	do_fdb },
> +	{ "bridge",	do_bridge },
>  	{ "monitor",	do_monitor },
>  	{ "help",	do_help },
>  	{ 0 }
> diff --git a/bridge/fdb.c b/bridge/fdb.c
> index 4ca4861..e1c138d 100644
> --- a/bridge/fdb.c
> +++ b/bridge/fdb.c
> @@ -34,6 +34,13 @@ static void usage(void)
>  	exit(-1);
>  }
>  
> +static void bridge_usage(void)
> +{
> +	fprintf(stderr, "Usage: br bridge er mode {veb | vepa} dev DEV\n");
> +	fprintf(stderr, "	br bridge {show} [ dev DEV] \n");
> +	exit(-1);
> +}
> +
>  static const char *state_n2a(unsigned s)
>  {
>  	static char buf[32];
> @@ -269,3 +276,240 @@ int do_fdb(int argc, char **argv)
>  	fprintf(stderr, "Command \"%s\" is unknown, try \"bridge fdb help\".\n", *argv);
>  	exit(-1);
>  }
> +
> +int print_bridge(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
> +{
> +	FILE *fp = arg;
> +	struct ifinfomsg *ifm = NLMSG_DATA(n);
> +	int len = n->nlmsg_len;
> +	struct rtattr * tb[IFLA_MAX+1];
> +       
> +	len -= NLMSG_LENGTH(sizeof(*ifm));
> +	if (len < 0) {
> +		fprintf(stderr, "BUG: wrong nlmsg len %d\n", len);
> +		return -1;
> +	}
> +
> +	if (ifm->ifi_family != AF_BRIDGE) {
> +		fprintf(stderr, "hmm: Not PF_BRIDGE is %i\n", ifm->ifi_family);
> +	}
> +
> +	if (filter_index && filter_index != ifm->ifi_index)
> +		return 0;
> +
> +	parse_rtattr(tb, IFLA_MAX, IFLA_RTA(ifm), len);
> +
> +	if (!tb[IFLA_IFNAME]) {
> +		fprintf(stderr, "%s: missing ifname using ifi_index %u name %s\n",
> +			__func__, ifm->ifi_index,
> +			ll_index_to_name(ifm->ifi_index));
> +	}
> +	if (tb[IFLA_AF_SPEC]) {
> +		struct rtattr *bridge[IFLA_BRIDGE_MAX+1];
> +		__u16 mode = 0, flags = 0;
> +
> +		parse_rtattr_nested(bridge, IFLA_BRIDGE_MAX, tb[IFLA_AF_SPEC]);
> +		if (bridge[IFLA_BRIDGE_MODE])
> +			mode =*(__u16*)RTA_DATA(bridge[IFLA_BRIDGE_MODE]);
> +		if (bridge[IFLA_BRIDGE_FLAGS])
> +			flags =*(__u16*)RTA_DATA(bridge[IFLA_BRIDGE_FLAGS]);
> +
> +		fprintf(stderr, "%s: mode %s bridge_flags: %s %s\n",
> +			ll_index_to_name(ifm->ifi_index),
> +			mode ? "VEPA" : "VEB",
> +			flags & BRIDGE_FLAGS_SELF ? "self" : "",
> +			flags & BRIDGE_FLAGS_MASTER ? "master" : "");
> +	}
> +
> +	if (tb[IFLA_PROTINFO]) {
> +		__u8 state = *(__u8*)RTA_DATA(tb[IFLA_PROTINFO]);
> +		char *sstate;
> +
> +		switch (state) {
> +		case 0:
> +			sstate = "DISABLED";
> +			break;
> +		case 1:
> +			sstate = "LISTENING";
> +			break;
> +		case 2:
> +			sstate = "LEARNING";
> +			break;
> +		case 3:
> +			sstate = "FORWARDING";
> +			break;
> +		case 4:
> +			sstate = "BLOCKING";
> +			break;
> +		default:
> +			sstate = "UNKNOWN";
> +			break;
> +		}
> +	
> +
> +		fprintf(stderr, "%s: %s: ifla_protinfo: %s\n",
> +			ll_index_to_name(ifm->ifi_index),
> +			__func__, sstate);
> +	}
> +
> +	fflush(fp);
> +	return 0;
> +}
> +
> +static int bridge_show(int argc, char **argv)
> +{
> +	char *filter_dev = NULL;
> +
> +       
> +	while (argc > 0) {
> +		if (strcmp(*argv, "dev") == 0) {
> +			NEXT_ARG();
> +			if (filter_dev)
> +				duparg("dev", *argv);
> +                       
> +			filter_dev = *argv;
> +		}
> +		argc--; argv++;
> +	}
> +
> +	if (filter_dev) {
> +		if ((filter_index = if_nametoindex(filter_dev)) == 0) {
> +			fprintf(stderr, "Cannot find device \"%s\"\n", filter_dev);
> +			return -1;
> +		}
> +	}
> +
> +	if (rtnl_wilddump_request(&rth, PF_BRIDGE, RTM_GETLINK) < 0) {
> +		perror("Cannot send dump request");
> +		exit(1);
> +	}
> +
> +	if (rtnl_dump_filter(&rth, print_bridge, stdout) < 0) {
> +		fprintf(stderr, "Dump terminated\n");
> +		exit(1);
> +	}
> +
> +	return 0;
> +}
> +
> +static int bridge_state_set(int argc, char **argv)
> +{
> +	struct {
> +		struct nlmsghdr		n;
> +		struct ifinfomsg	ifm;
> +		char			buf[1024];
> +	} req;
> +	struct {
> +		struct nlmsghdr		hdr;
> +		struct nlmsgerr		err;
> +		struct nlmsghdr		rhdr;
> +		struct ifinfomsg	ifm;
> +		char			buf[1024];
> +	} reply;
> +	char *d = NULL;
> +	__u8 state = 0;
> +	__u16 mode = -1, flags = 0;
> +	
> +	memset(&req, 0, sizeof(req));
> +	memset(&reply, 0, sizeof(reply));
> +
> +	req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg));
> +	req.n.nlmsg_flags = NLM_F_REQUEST | NLM_F_REPLACE | NLM_F_ACK;
> +	req.n.nlmsg_type = RTM_SETLINK;
> +	req.ifm.ifi_family = PF_BRIDGE;
> +
> +	while (argc > 0) {
> +		if (strcmp(*argv, "dev") == 0) {
> +			NEXT_ARG();
> +			d = *argv;	
> +		} else if (matches(*argv, "state") == 0) {
> +			NEXT_ARG();
> +			if (matches(*argv, "DISABLED") == 0)
> +				state = 0;
> +			else if (matches(*argv, "LISTENING") == 0)
> +				 state = 1;
> +			else if (matches(*argv, "LEARNING") == 0)
> +				 state = 2;
> +			else if (matches(*argv, "FORWARDING") == 0)
> +				 state = 3;
> +			else if (matches(*argv, "BLOCKING") == 0)
> +				 state = 4;
> +			else
> +				invarg("Invalid state value\n", *argv);
> +
> +		} else if (matches(*argv, "mode") == 0) {
> +			NEXT_ARG();
> +			if (matches(*argv, "veb") == 0)
> +				mode = BRIDGE_MODE_VEB;
> +			else if (matches(*argv, "vepa") == 0)
> +				 mode = BRIDGE_MODE_VEPA;
> +			else
> +				invarg("Invalid mode value\n", *argv);
> +
> +		} else if (matches(*argv, "master") == 0) {
> +			flags |= BRIDGE_FLAGS_MASTER;
> +		} else if (matches(*argv, "self") == 0) {
> +			flags |= BRIDGE_FLAGS_SELF;
> +		}
> +
> +		argc--; argv++;
> +	}
> +
> +	if (!d) {
> +		fprintf(stderr, "Device required.\n");
> +		exit(-1);
> +	}
> +
> +       req.ifm.ifi_index = ll_name_to_index(d);
> +       if (req.ifm.ifi_index == 0) {
> +               fprintf(stderr, "Cannot find device \"%s\"\n", d);
> +               return -1;
> +       }
> +
> +	if (state < 4)
> +		addattr8(&req.n, sizeof(req.buf), IFLA_PROTINFO, state);
> +       
> +	printf("%s %s(%u): type %i family %i state 0x%x ", __func__, d, req.ifm.ifi_index,
> +		req.n.nlmsg_type, req.ifm.ifi_family, state);
> +
> +	if (mode < 3 || flags) {
> +		struct rtattr *binfo;
> +		int err = 0;
> +
> +		binfo = addattr_nest(&req.n, sizeof(req), IFLA_AF_SPEC);
> +		if (flags)
> +			err = addattr16(&req.n, sizeof(req), IFLA_BRIDGE_FLAGS, flags);
> +		if (mode < 3)
> +			err = addattr16(&req.n, sizeof(req), IFLA_BRIDGE_MODE, mode);
> +		if (err < 0)
> +			fprintf(stderr, "addattr16 failes\n");
> +		addattr_nest_end(&req.n, binfo);
> +       
> +		printf("mode %s\n", mode == BRIDGE_MODE_VEPA ? "VEPA" : "VEB");
> +	}
> +
> +	printf("%s: %s(%u): rtnl_talk length %u\n", __func__, d, req.ifm.ifi_index, req.n.nlmsg_len);
> +	if (rtnl_talk(&rth, &req.n, 0, 0, &reply.hdr) < 0) {
> +		printf("\nREPLY: error %i\n", reply.err.error);
> +		print_bridge(NULL, &reply.err.msg, stderr);
> +		exit(2);
> +	}
> +
> +	return 0;
> +}
> +
> +int do_bridge(int argc, char **argv)
> +{
> +	ll_init_map(&rth);
> +
> +	if (argc > 0) {
> +		if (matches(*argv, "show") == 0)
> +			return bridge_show(argc-1, argv+1);
> +		else if (matches(*argv, "state") == 0)
> +			return bridge_state_set(argc-1, argv+1);
> +		else if (matches(*argv, "help") == 0)
> +			bridge_usage();
> +	}
> +
> +	exit(0);
> +}
> diff --git a/include/linux/if_link.h b/include/linux/if_link.h
> index 012d95a..1a6c2f1 100644
> --- a/include/linux/if_link.h
> +++ b/include/linux/if_link.h
> @@ -142,6 +142,7 @@ enum {
>  #define IFLA_PROMISCUITY IFLA_PROMISCUITY
>  	IFLA_NUM_TX_QUEUES,
>  	IFLA_NUM_RX_QUEUES,
> +	IFLA_BRIDGE,
>  	__IFLA_MAX
>  };
>  
> @@ -375,6 +376,21 @@ enum {
>  #define PORT_UUID_MAX		16
>  #define PORT_SELF_VF		-1
>  
> +/* Bridge Flags */
> +#define BRIDGE_FLAGS_MASTER	1	/* Bridge command to/from master */
> +#define BRIDGE_FLAGS_SELF	2	/* Bridge command to/from lowerdev */
> +
> +#define BRIDGE_MODE_VEB		0	/* Default loopback mode */
> +#define BRIDGE_MODE_VEPA	1	/* 802.1Qbg defined VEPA mode */
> +
> +/* Bridge management nested attributes */
> +enum {
> +	IFLA_BRIDGE_FLAGS,
> +	IFLA_BRIDGE_MODE,
> +	__IFLA_BRIDGE_MAX,
> +};
> +#define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1)
> +
>  enum {
>  	PORT_REQUEST_PREASSOCIATE = 0,
>  	PORT_REQUEST_PREASSOCIATE_RR,
> 

This looks ok. I will roll it into the resubmit of bridge changes
when I get back from Linuxcon.

^ permalink raw reply

* Re: [PATCH 8/9] isdn: Remove unused variable causing a compile build warning
From: Paul Bolle @ 2012-11-05  9:11 UTC (permalink / raw)
  To: Lee Jones; +Cc: David Miller, linux-kernel, isdn, netdev
In-Reply-To: <20121105084419.GC2699@gmail.com>

On Mon, 2012-11-05 at 09:44 +0100, Lee Jones wrote:
> On Sun, 04 Nov 2012, David Miller wrote:
> > I think the most appropriate thing to do is make CONFIG_ISDN depend
> > upon CONFIG_NETDEVICES in the Kconfig file.
> 
> ... and then remove the CONFIG_NETDEVICES guards in isdn_common.c?

If ISDN would depend on NETDEVICES, ISDN_I4L would too, since it depends
on ISDN. In that case CONFIG_NETDEVICES would always be true when
compiling isdn_common.c. That would make these guards pointless. (The
dependency of ISDN_PPP on NETDEVICES would then also be pointless.)


Paul Bolle

^ permalink raw reply

* Re: ping -f is broken in iputils 20121011
From: Jan Synacek @ 2012-11-05  9:17 UTC (permalink / raw)
  To: netdev
In-Reply-To: <1TTUJN-000MzR-Tp@internal.tormail.org>

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

On 10/31/2012 10:11 AM, Mohammad Alsaleh wrote:
> On Tue, Oct 30, 2012 at 11:52:49PM +0300, Mohammad Alsaleh wrote:
>> As explained in this bug report(1). ping -f seems to be broken in
>> iputils 20121011.
>>
>> (1) https://bugs.archlinux.org/task/32306
> 
> Bisected to commit 8feb586c4c6df32badb159947ed233898891aecd
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

Can you please try the attached patch?

-- 
Jan Synacek
Software Engineer, BaseOS team Brno, Red Hat

[-- Attachment #2: flood.patch --]
[-- Type: text/x-patch, Size: 676 bytes --]

--- iputils-s20121011/ping_common.h	2012-11-05 10:07:40.065281888 +0100
+++ iputils-s20121011-new/ping_common.h	2012-11-05 10:07:22.001268362 +0100
@@ -141,7 +141,7 @@ static inline void write_stdout(const ch
 	do {
 		cc = write(STDOUT_FILENO, str + o, len - o);
 		o += cc;
-	} while (len >= o || cc < 0);
+	} while (len > o || cc < 0);
 }
 
 /*
--- iputils-s20121011/ping_common.c	2012-11-05 10:07:40.066281889 +0100
+++ iputils-s20121011-new/ping_common.c	2012-11-05 10:07:22.007268368 +0100
@@ -776,7 +776,7 @@ restamp:
 		if (!csfailed)
 			write_stdout("\b \b", 3);
 		else
-			write_stdout("\bC", 1);
+			write_stdout("\bC", 2);
 	} else {
 		int i;
 		__u8 *cp, *dp;

^ permalink raw reply

* Re: [PATCH v1 0/5] usbnet: avoiding access auto-suspended device
From: Oliver Neukum @ 2012-11-05  9:24 UTC (permalink / raw)
  To: Ming Lei
  Cc: David S. Miller, Greg Kroah-Hartman,
	netdev-u79uwXL29TY76Z2rM5mHXA, linux-usb-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1351992594-12818-1-git-send-email-ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>

On Sunday 04 November 2012 09:29:49 Ming Lei wrote:
> Thip patchset avoids accessing auto-suspended device in ioctl path,
> which is generally triggered by some network utility(ethtool, ifconfig,
> ...)
> 
> Most of network devices have the problem, but as discussed in the
> thread:
> 
>         http://marc.info/?t=135054860600003&r=1&w=2
> 
> the problem should be solved inside driver.
> 
> Considered that only smsc75xx and smsc95xx calls usbnet_read_cmd()
> and usbnet_write_cmd() inside its resume and suspend callback, the
> patcheset introduce the nopm version of the two functions which
> should be called only in the resume and suspend callback. So we
> can solve the problem by runtime resuming device before doing
> control message things.

Hi,

I am happy with these patches.
Dave, do you have a principal objection regarding these patches, too?

	Regards
		Oliver

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH 8/9] isdn: Remove unused variable causing a compile build warning
From: Lee Jones @ 2012-11-05  9:44 UTC (permalink / raw)
  To: Paul Bolle; +Cc: David Miller, linux-kernel, isdn, netdev
In-Reply-To: <1352106704.1434.25.camel@x61.thuisdomein>

On Mon, 05 Nov 2012, Paul Bolle wrote:

> On Mon, 2012-11-05 at 09:44 +0100, Lee Jones wrote:
> > On Sun, 04 Nov 2012, David Miller wrote:
> > > I think the most appropriate thing to do is make CONFIG_ISDN depend
> > > upon CONFIG_NETDEVICES in the Kconfig file.
> > 
> > ... and then remove the CONFIG_NETDEVICES guards in isdn_common.c?
> 
> If ISDN would depend on NETDEVICES, ISDN_I4L would too, since it depends
> on ISDN. In that case CONFIG_NETDEVICES would always be true when
> compiling isdn_common.c. That would make these guards pointless. (The
> dependency of ISDN_PPP on NETDEVICES would then also be pointless.)

I'll submit a patch based on your comments.

Thanks for your time Paul.

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply

* [PATCH 8/9] isdn: Make CONFIG_ISDN depend on CONFIG_NETDEVICES
From: Lee Jones @ 2012-11-05 10:31 UTC (permalink / raw)
  To: David Miller; +Cc: pebolle, linux-kernel, isdn, netdev
In-Reply-To: <20121104.123013.700345271120279281.davem@davemloft.net>

Does something like look like a better solution?

Author: Lee Jones <lee.jones@linaro.org>
Date:   Sat Nov 3 22:06:02 2012 +0100

    isdn: Make CONFIG_ISDN depend on CONFIG_NETDEVICES
    
    It doesn't make much sense to enable ISDN services if you don't
    intend to connect to a network. Therefore insisting that ISDN
    depends on NETDEVICES seems logical. We can then remove any
    guards mentioning NETDEVICES inside all subordinate drivers.
    
    This also has the nice side-effect of fixing the warning below
    when ISDN_I4L && !CONFIG_NETDEVICES at compile time.
    
    This patch fixes:
    drivers/isdn/i4l/isdn_common.c: In function ‘isdn_ioctl’:
    drivers/isdn/i4l/isdn_common.c:1278:8: warning: unused variable ‘s’ [-Wunused-variable]
    
    Cc: Karsten Keil <isdn@linux-pingi.de>
    Cc: netdev@vger.kernel.org
    Signed-off-by: Lee Jones <lee.jones@linaro.org>

diff --git a/drivers/isdn/Kconfig b/drivers/isdn/Kconfig
index a233ed5..86cd75a 100644
--- a/drivers/isdn/Kconfig
+++ b/drivers/isdn/Kconfig
@@ -4,7 +4,7 @@
 
 menuconfig ISDN
 	bool "ISDN support"
-	depends on NET
+	depends on NET && NETDEVICES
 	depends on !S390 && !UML
 	---help---
 	  ISDN ("Integrated Services Digital Network", called RNIS in France)
diff --git a/drivers/isdn/i4l/Kconfig b/drivers/isdn/i4l/Kconfig
index 2302fbe..9c6650e 100644
--- a/drivers/isdn/i4l/Kconfig
+++ b/drivers/isdn/i4l/Kconfig
@@ -6,7 +6,7 @@ if ISDN_I4L
 
 config ISDN_PPP
 	bool "Support synchronous PPP"
-	depends on INET && NETDEVICES
+	depends on INET
 	select SLHC
 	help
 	  Over digital connections such as ISDN, there is no need to
diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c
index 8c610fa..e2a945e 100644
--- a/drivers/isdn/i4l/isdn_common.c
+++ b/drivers/isdn/i4l/isdn_common.c
@@ -1312,7 +1312,6 @@ isdn_ioctl(struct file *file, uint cmd, ulong arg)
 			} else
 				return -EINVAL;
 			break;
-#ifdef CONFIG_NETDEVICES
 		case IIOCNETGPN:
 			/* Get peer phone number of a connected
 			 * isdn network interface */
@@ -1322,7 +1321,6 @@ isdn_ioctl(struct file *file, uint cmd, ulong arg)
 				return isdn_net_getpeer(&phone, argp);
 			} else
 				return -EINVAL;
-#endif
 		default:
 			return -EINVAL;
 		}
@@ -1352,7 +1350,6 @@ isdn_ioctl(struct file *file, uint cmd, ulong arg)
 		case IIOCNETLCR:
 			printk(KERN_INFO "INFO: ISDN_ABC_LCR_SUPPORT not enabled\n");
 			return -ENODEV;
-#ifdef CONFIG_NETDEVICES
 		case IIOCNETAIF:
 			/* Add a network-interface */
 			if (arg) {
@@ -1491,7 +1488,6 @@ isdn_ioctl(struct file *file, uint cmd, ulong arg)
 				return -EFAULT;
 			return isdn_net_force_hangup(name);
 			break;
-#endif                          /* CONFIG_NETDEVICES */
 		case IIOCSETVER:
 			dev->net_verbose = arg;
 			printk(KERN_INFO "isdn: Verbose-Level is %d\n", dev->net_verbose);

^ permalink raw reply related

* [PATCH] net: ipv6: change %8s to %s for seq_printf of if6_seq_stop
From: Chen Gang @ 2012-11-05 11:17 UTC (permalink / raw)
  To: David Miller, kuznet, jmorris, yoshfuji, kaber; +Cc: netdev


  the length of ifp->idev->dev->name is 16 (IFNAMSIZ)
  in seq_printf, it is not suitable to use %8s for rt->dst.dev->name.
  so change it to %s, since each line has not been solid any more.


Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
 net/ipv6/addrconf.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 8f0b12a..9f728a8 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -3281,7 +3281,7 @@ static void if6_seq_stop(struct seq_file *seq,
void *v)
 static int if6_seq_show(struct seq_file *seq, void *v)
 {
 	struct inet6_ifaddr *ifp = (struct inet6_ifaddr *)v;
-	seq_printf(seq, "%pi6 %02x %02x %02x %02x %8s\n",
+	seq_printf(seq, "%pi6 %02x %02x %02x %02x %s\n",
 		   &ifp->addr,
 		   ifp->idev->dev->ifindex,
 		   ifp->prefix_len,
-- 
1.7.9.5

^ permalink raw reply related

* Re: [PATCH 0/4] Support the MX6 FEC as a PTP hardware clock
From: Frank Li @ 2012-11-05 11:23 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: Frank.Li@freescale.com, netdev@vger.kernel.org, Richard Cochran,
	shawn.guo@linaro.org, David Miller,
	linux-arm-kernel@lists.infradead.org
In-Reply-To: <1351898728.2703.30.camel@bwh-desktop.uk.solarflarecom.com>


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

在 2012年11月3日星期六,Ben Hutchings 写道:

> On Fri, 2012-11-02 at 09:43 +0100, Richard Cochran wrote:
> > On Fri, Nov 02, 2012 at 10:36:09AM +0800, Frank Li wrote:
> > > >
> > > > All applied to net-next.
> > > >
> > > > Please make sure your changes are in sync with Ben's PTP/PPS
> > > > Kconfig changes of today, and send me any changes if necessary.
> > > >
> > >
> > > Thank you very much.
> > > I checked Ben's patch, which not affect FEC.
> >
> > Maybe just remove the Kconfig line "select PPS".
>
> More than that: FEC should select PTP_1588_CLOCK,


okay, I will do that.


> FEC_PTP should be
> removed and all the conditional code made unconditional.  Alternately,
> if that would cost too much (in terms of performance or memory) on some
> systems where the driver is used, FEC_PTP should default to 'y'.


Bd description will be difference between no PTP and PTP hardware,
So driver will not incompatible at two kind of hardware.

I can set it default is Y at MX6 platform.


> 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.
>
>

[-- Attachment #1.2: Type: text/html, Size: 2023 bytes --]

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

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

^ permalink raw reply

* [PATCH] driver: net: ppp: change 8% to %s for seq_printf of pppoe_seq_show
From: Chen Gang @ 2012-11-05 11:31 UTC (permalink / raw)
  To: David Miller, kuznet, jmorris, yoshfuji, kaber; +Cc: netdev


  the length of po->pppoe_pa.dev is 16 (IFNAMSIZ)
  in seq_printf, it is not suitable to use %8s for po->pppoe_pa.dev.
  so change it to %s, since each line has not been solid any more.

Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
 drivers/net/ppp/pppoe.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ppp/pppoe.c b/drivers/net/ppp/pppoe.c
index 20f31d0..7e89710 100644
--- a/drivers/net/ppp/pppoe.c
+++ b/drivers/net/ppp/pppoe.c
@@ -1009,7 +1009,7 @@ static int pppoe_seq_show(struct seq_file *seq,
void *v)
 	po = v;
 	dev_name = po->pppoe_pa.dev;

-	seq_printf(seq, "%08X %pM %8s\n",
+	seq_printf(seq, "%08X %pM %s\n",
 		po->pppoe_pa.sid, po->pppoe_pa.remote, dev_name);
 out:
 	return 0;
-- 
1.7.9.5

^ permalink raw reply related

* Re: [RFC virtio-next 0/4] Introduce CAIF Virtio and reversed Vrings
From: Sjur Brændeland @ 2012-11-05 12:12 UTC (permalink / raw)
  To: Rusty Russell
  Cc: Michael S. Tsirkin, Linus Walleij, Ohad Ben-Cohen, linux-kernel,
	netdev, virtualization, dmitry.tarnyagin
In-Reply-To: <87wqy54vo0.fsf@rustcorp.com.au>

Hi Rusty,

> So, this adds another host-side virtqueue implementation.
>
> Can we combine them together conveniently?  You pulled out more stuff
> into vring.h which is a start, but it's a bit overloaded.
> Perhaps we should separate the common fields into struct vring, and use
> it to build:
>
>         struct vring_guest {
>                 struct vring vr;
>                 u16 last_used_idx;
>         };
>
>         struct vring_host {
>                 struct vring vr;
>                 u16 last_avail_idx;
>         };
> I haven't looked closely at vhost to see what it wants, but I would
> think we could share more code.

I have played around with the code in vhost.c to explore your idea.
The main issue I run into is that vhost.c is accessing user data while my new
code does not. So I end up with some quirky code testing if the ring lives in
user memory or not.  Another issue is sparse warnings when
accessing user memory.

With your suggested changes I end up sharing about 100 lines of code.
So in sum, I feel this add more complexity than what we gain by sharing.

Below is an initial draft of the re-usable code. I added "is_uaccess" to struct
virtio_ring in order to know if the ring lives in user memory.

Let me know what you think.

[snip]
int virtqueue_add_used(struct vring_host *vr, unsigned int head, int len,
		    struct vring_used_elem  **used)
{
	/* The virtqueue contains a ring of used buffers.  Get a pointer to the
	 * next entry in that used ring. */
	*used = &vr->vring.used->ring[vr->last_used_idx % vr->vring.num];
	if (vr->is_uaccess) {
		if(unlikely(__put_user(head, &(*used)->id))) {
			pr_debug("Failed to write used id");
			return -EFAULT;
		}
		if (unlikely(__put_user(len, &(*used)->len))) {
			pr_debug("Failed to write used len");
			return -EFAULT;
		}
		smp_wmb();
		if (__put_user(vr->last_used_idx + 1,
			       &vr->vring.used->idx)) {
			pr_debug("Failed to increment used idx");
			return -EFAULT;
		}
	} else {
		(*used)->id = head;
		(*used)->len = len;
		smp_wmb();
		vr->vring.used->idx = vr->last_used_idx + 1;
	}
	vr->last_used_idx++;
	return 0;
}

/* Each buffer in the virtqueues is actually a chain of descriptors.  This
 * function returns the next descriptor in the chain,
 * or -1U if we're at the end. */
unsigned virtqueue_next_desc(struct vring_desc *desc)
{
	unsigned int next;

	/* If this descriptor says it doesn't chain, we're done. */
	if (!(desc->flags & VRING_DESC_F_NEXT))
		return -1U;

	/* Check they're not leading us off end of descriptors. */
	next = desc->next;
	/* Make sure compiler knows to grab that: we don't want it changing! */
	/* We will use the result as an index in an array, so most
	 * architectures only need a compiler barrier here. */
	read_barrier_depends();

	return next;
}

static int virtqueue_next_avail_desc(struct vring_host *vr)
{
	int head;
	u16 last_avail_idx;

	/* Check it isn't doing very strange things with descriptor numbers. */
	last_avail_idx = vr->last_avail_idx;
	if (vr->is_uaccess) {
		if (__get_user(vr->avail_idx, &vr->vring.avail->idx)) {
			pr_debug("Failed to access avail idx at %p\n",
				 &vr->vring.avail->idx);
			return -EFAULT;
		}
	} else
		vr->avail_idx = vr->vring.avail->idx;

	if (unlikely((u16)(vr->avail_idx - last_avail_idx) > vr->vring.num)) {
		pr_debug("Guest moved used index from %u to %u",
		       last_avail_idx, vr->avail_idx);
		return -EFAULT;
	}

	/* If there's nothing new since last we looked, return invalid. */
	if (vr->avail_idx == last_avail_idx)
		return vr->vring.num;

	/* Only get avail ring entries after they have been exposed by guest. */
	smp_rmb();

	/* Grab the next descriptor number they're advertising, and increment
	 * the index we've seen. */
	if (vr->is_uaccess) {
		if (unlikely(__get_user(head,
				&vr->vring.avail->ring[last_avail_idx
						       % vr->vring.num]))) {
			pr_debug("Failed to read head: idx %d address %p\n",
				 last_avail_idx,
				 &vr->vring.avail->ring[last_avail_idx %
							vr->vring.num]);
			return -EFAULT;
		}
	} else
		head = vr->vring.avail->ring[last_avail_idx % vr->vring.num];

	/* If their number is silly, that's an error. */
	if (unlikely(head >= vr->vring.num)) {
		pr_debug("Guest says index %u > %u is available",
		       head, vr->vring.num);
		return -EINVAL;
	}

	return head;
}

Thanks,
Sjur

^ permalink raw reply

* [PATCH net-next] ipv6: export IP6_RT_PRIO_* to userland
From: Nicolas Dichtel @ 2012-11-05 15:28 UTC (permalink / raw)
  To: netdev; +Cc: davem, Nicolas Dichtel

The kernel uses some default metric when routes are managed. For example, a
static route added with a metric set to 0 is inserted in the kernel with
metric 1024 (IP6_RT_PRIO_USER).
It is useful for routing daemons to know these values, to be able to set routes
without interfering with what the kernel does.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 include/net/ip6_route.h         | 3 ---
 include/uapi/linux/ipv6_route.h | 3 +++
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index 5fa2af0..27d8318 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -1,9 +1,6 @@
 #ifndef _NET_IP6_ROUTE_H
 #define _NET_IP6_ROUTE_H
 
-#define IP6_RT_PRIO_USER	1024
-#define IP6_RT_PRIO_ADDRCONF	256
-
 struct route_info {
 	__u8			type;
 	__u8			length;
diff --git a/include/uapi/linux/ipv6_route.h b/include/uapi/linux/ipv6_route.h
index 0459664..2be7bd1 100644
--- a/include/uapi/linux/ipv6_route.h
+++ b/include/uapi/linux/ipv6_route.h
@@ -55,4 +55,7 @@ struct in6_rtmsg {
 #define RTMSG_NEWROUTE		0x21
 #define RTMSG_DELROUTE		0x22
 
+#define IP6_RT_PRIO_USER	1024
+#define IP6_RT_PRIO_ADDRCONF	256
+
 #endif /* _UAPI_LINUX_IPV6_ROUTE_H */
-- 
1.7.12

^ permalink raw reply related

* Re: [PATCH v2 9/9] net: batman-adv: use per_cpu_add helper
From: Christoph Lameter @ 2012-11-05 15:19 UTC (permalink / raw)
  To: Shan Wei
  Cc: NetDev, b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r,
	Kernel-Maillist, siwu-MaAgPAbsBIVS8oHt8HbXEIQuADTiUCJX,
	lindner_marek-LWAfsSFWpa4, David Miller
In-Reply-To: <5094A485.4060409-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

On Sat, 3 Nov 2012, Shan Wei wrote:

> > Is this really supposed to be the commit message?
>
> Maybe it's ok when Linus said this. :-)
>
> Christoph is the maintainer of per-cpu.

Well please make the changelog nice and understandable.

^ permalink raw reply

* Re: ping -f is broken in iputils 20121011
From: Stéphane Gaudreault @ 2012-11-05 15:28 UTC (permalink / raw)
  To: netdev

The patch proposed by Jan Synacek worked to me.
Sorry for not replying to his message, I just subscribed to this ML.

Cheers,

--
Stéphane Gaudreault
Arch Linux developer

^ 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