* 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
* [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
* [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 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
* 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
* 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] 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: 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: 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
* [PATCH] drivers: ethernet: qlogic: netxen_nic_ethtool.c: Fixed a coding style issue
From: Kumar Amit Mehta @ 2012-11-05 5:46 UTC (permalink / raw)
To: sony.chacko; +Cc: rajesh.borundia, netdev, linux-kernel, kernel-janitors
Fixed some coding style issues.
Signed-off-by: Kumar Amit Mehta <gmate.amit@gmail.com>
---
.../ethernet/qlogic/netxen/netxen_nic_ethtool.c | 86 ++++++++++----------
1 file changed, 43 insertions(+), 43 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c
index 6bf73e1..4ca2c19 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c
@@ -218,7 +218,7 @@ skip:
check_sfp_module = netif_running(dev) &&
adapter->has_link_events;
} else {
- ecmd->supported |= (SUPPORTED_TP |SUPPORTED_Autoneg);
+ ecmd->supported |= (SUPPORTED_TP | SUPPORTED_Autoneg);
ecmd->advertising |=
(ADVERTISED_TP | ADVERTISED_Autoneg);
ecmd->port = PORT_TP;
@@ -381,7 +381,7 @@ static u32 netxen_nic_test_link(struct net_device *dev)
static int
netxen_nic_get_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
- u8 * bytes)
+ u8 *bytes)
{
struct netxen_adapter *adapter = netdev_priv(dev);
int offset;
@@ -498,19 +498,19 @@ netxen_nic_get_pauseparam(struct net_device *dev,
pause->rx_pause = netxen_gb_get_rx_flowctl(val);
val = NXRD32(adapter, NETXEN_NIU_GB_PAUSE_CTL);
switch (port) {
- case 0:
- pause->tx_pause = !(netxen_gb_get_gb0_mask(val));
- break;
- case 1:
- pause->tx_pause = !(netxen_gb_get_gb1_mask(val));
- break;
- case 2:
- pause->tx_pause = !(netxen_gb_get_gb2_mask(val));
- break;
- case 3:
- default:
- pause->tx_pause = !(netxen_gb_get_gb3_mask(val));
- break;
+ case 0:
+ pause->tx_pause = !(netxen_gb_get_gb0_mask(val));
+ break;
+ case 1:
+ pause->tx_pause = !(netxen_gb_get_gb1_mask(val));
+ break;
+ case 2:
+ pause->tx_pause = !(netxen_gb_get_gb2_mask(val));
+ break;
+ case 3:
+ default:
+ pause->tx_pause = !(netxen_gb_get_gb3_mask(val));
+ break;
}
} else if (adapter->ahw.port_type == NETXEN_NIC_XGBE) {
if ((port < 0) || (port >= NETXEN_NIU_MAX_XG_PORTS))
@@ -556,31 +556,31 @@ netxen_nic_set_pauseparam(struct net_device *dev,
/* set autoneg */
val = NXRD32(adapter, NETXEN_NIU_GB_PAUSE_CTL);
switch (port) {
- case 0:
- if (pause->tx_pause)
- netxen_gb_unset_gb0_mask(val);
- else
- netxen_gb_set_gb0_mask(val);
- break;
- case 1:
- if (pause->tx_pause)
- netxen_gb_unset_gb1_mask(val);
- else
- netxen_gb_set_gb1_mask(val);
- break;
- case 2:
- if (pause->tx_pause)
- netxen_gb_unset_gb2_mask(val);
- else
- netxen_gb_set_gb2_mask(val);
- break;
- case 3:
- default:
- if (pause->tx_pause)
- netxen_gb_unset_gb3_mask(val);
- else
- netxen_gb_set_gb3_mask(val);
- break;
+ case 0:
+ if (pause->tx_pause)
+ netxen_gb_unset_gb0_mask(val);
+ else
+ netxen_gb_set_gb0_mask(val);
+ break;
+ case 1:
+ if (pause->tx_pause)
+ netxen_gb_unset_gb1_mask(val);
+ else
+ netxen_gb_set_gb1_mask(val);
+ break;
+ case 2:
+ if (pause->tx_pause)
+ netxen_gb_unset_gb2_mask(val);
+ else
+ netxen_gb_set_gb2_mask(val);
+ break;
+ case 3:
+ default:
+ if (pause->tx_pause)
+ netxen_gb_unset_gb3_mask(val);
+ else
+ netxen_gb_set_gb3_mask(val);
+ break;
}
NXWR32(adapter, NETXEN_NIU_GB_PAUSE_CTL, val);
} else if (adapter->ahw.port_type == NETXEN_NIC_XGBE) {
@@ -643,7 +643,7 @@ static int netxen_get_sset_count(struct net_device *dev, int sset)
static void
netxen_nic_diag_test(struct net_device *dev, struct ethtool_test *eth_test,
- u64 * data)
+ u64 *data)
{
memset(data, 0, sizeof(uint64_t) * NETXEN_NIC_TEST_LEN);
if ((data[0] = netxen_nic_reg_test(dev)))
@@ -654,7 +654,7 @@ netxen_nic_diag_test(struct net_device *dev, struct ethtool_test *eth_test,
}
static void
-netxen_nic_get_strings(struct net_device *dev, u32 stringset, u8 * data)
+netxen_nic_get_strings(struct net_device *dev, u32 stringset, u8 *data)
{
int index;
@@ -675,7 +675,7 @@ netxen_nic_get_strings(struct net_device *dev, u32 stringset, u8 * data)
static void
netxen_nic_get_ethtool_stats(struct net_device *dev,
- struct ethtool_stats *stats, u64 * data)
+ struct ethtool_stats *stats, u64 *data)
{
struct netxen_adapter *adapter = netdev_priv(dev);
int index;
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH] vlan: set sysfs device_type to 'vlan'
From: Doug Goldstein @ 2012-11-05 5:45 UTC (permalink / raw)
To: David Miller; +Cc: kaber, netdev, systemd-devel, linux-kernel
In-Reply-To: <20121023.023647.2164665243829038911.davem@davemloft.net>
On Tue, Oct 23, 2012 at 1:36 AM, David Miller <davem@davemloft.net> wrote:
> From: Doug Goldstein <cardoe@cardoe.com>
> Date: Mon, 22 Oct 2012 00:53:57 -0500
>
>> Sets the sysfs device_type to 'vlan' for udev. This makes it easier for
>> applications that query network information via udev to identify vlans
>> instead of using strrchr().
>>
>> Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
>
> You're extremely misguided. This change, in fact, makes it ten times
> harder for such applications to query such devices.
>
> Because now the application has to decide whether it wants to support
> EVERY EXISTING SYSTEM OUT THERE or not. Hundreds of millions of Linux
> systems do not provide this attribute.
>
> Applications have to handle the case of not having the 'vlan' device
> type available attribute essentially forever.
>
> So providing it in new kernels provides zero value whatsoever.
>
> I'm not applying this patch, sorry.
Dave,
As others on this thread have discussed there are other merits to the
patch as well. Yes you are correct that netlink is the preferred
method to gather information about network devices but the point was
really to make the sysfs layout more correct a matter of completeness.
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.
Thanks.
--
Doug Goldstein
^ permalink raw reply
* [PATCH] drivers: ethernet: qlogic: qlge_dbg.c: Fixed a coding style issue
From: Kumar Amit Mehta @ 2012-11-05 5:11 UTC (permalink / raw)
To: jitendra.kalsaria
Cc: ron.mercer, linux-driver, netdev, linux-kernel, kernel-janitors
checkpatch.pl throws error message for the current code. This patch fixes
this coding style issue.
Signed-off-by: Kumar Amit Mehta <gmate.amit@gmail.com>
---
drivers/net/ethernet/qlogic/qlge/qlge_dbg.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_dbg.c b/drivers/net/ethernet/qlogic/qlge/qlge_dbg.c
index 58185b6..10093f0 100644
--- a/drivers/net/ethernet/qlogic/qlge/qlge_dbg.c
+++ b/drivers/net/ethernet/qlogic/qlge/qlge_dbg.c
@@ -86,7 +86,7 @@ exit:
}
/* Read out the SERDES registers */
-static int ql_read_serdes_reg(struct ql_adapter *qdev, u32 reg, u32 * data)
+static int ql_read_serdes_reg(struct ql_adapter *qdev, u32 reg, u32 *data)
{
int status;
@@ -364,7 +364,7 @@ exit:
/* Read the 400 xgmac control/statistics registers
* skipping unused locations.
*/
-static int ql_get_xgmac_regs(struct ql_adapter *qdev, u32 * buf,
+static int ql_get_xgmac_regs(struct ql_adapter *qdev, u32 *buf,
unsigned int other_function)
{
int status = 0;
@@ -405,7 +405,7 @@ static int ql_get_xgmac_regs(struct ql_adapter *qdev, u32 * buf,
return status;
}
-static int ql_get_ets_regs(struct ql_adapter *qdev, u32 * buf)
+static int ql_get_ets_regs(struct ql_adapter *qdev, u32 *buf)
{
int status = 0;
int i;
@@ -423,7 +423,7 @@ static int ql_get_ets_regs(struct ql_adapter *qdev, u32 * buf)
return status;
}
-static void ql_get_intr_states(struct ql_adapter *qdev, u32 * buf)
+static void ql_get_intr_states(struct ql_adapter *qdev, u32 *buf)
{
int i;
@@ -434,7 +434,7 @@ static void ql_get_intr_states(struct ql_adapter *qdev, u32 * buf)
}
}
-static int ql_get_cam_entries(struct ql_adapter *qdev, u32 * buf)
+static int ql_get_cam_entries(struct ql_adapter *qdev, u32 *buf)
{
int i, status;
u32 value[3];
@@ -471,7 +471,7 @@ err:
return status;
}
-static int ql_get_routing_entries(struct ql_adapter *qdev, u32 * buf)
+static int ql_get_routing_entries(struct ql_adapter *qdev, u32 *buf)
{
int status;
u32 value, i;
@@ -496,7 +496,7 @@ err:
}
/* Read the MPI Processor shadow registers */
-static int ql_get_mpi_shadow_regs(struct ql_adapter *qdev, u32 * buf)
+static int ql_get_mpi_shadow_regs(struct ql_adapter *qdev, u32 *buf)
{
u32 i;
int status;
@@ -515,7 +515,7 @@ end:
}
/* Read the MPI Processor core registers */
-static int ql_get_mpi_regs(struct ql_adapter *qdev, u32 * buf,
+static int ql_get_mpi_regs(struct ql_adapter *qdev, u32 *buf,
u32 offset, u32 count)
{
int i, status = 0;
--
1.7.9.5
^ permalink raw reply related
* 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 3:02 UTC (permalink / raw)
To: Shan Wei; +Cc: davem, kuznet, jmorris, yoshfuji, kaber, netdev
In-Reply-To: <5093E953.5020709@gmail.com>
>
> 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,
-----------------------------------------------------------------------------------
the length of rt->dst.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.
additional information:
%8s limit the width, not for the original string output length
if name length is more than 8, it still can be fully displayed.
if name length is less than 8, the ' ' will be filled before name.
%.8s truly limit the original string output length (precision)
Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
net/ipv6/route.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index c42650c..b60bc52 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2835,7 +2835,7 @@ static int rt6_info_route(struct rt6_info *rt, void *p_arg)
} else {
seq_puts(m, "00000000000000000000000000000000");
}
- seq_printf(m, " %08x %08x %08x %08x %8s\n",
+ seq_printf(m, " %08x %08x %08x %08x %s\n",
rt->rt6i_metric, atomic_read(&rt->dst.__refcnt),
rt->dst.__use, rt->rt6i_flags,
rt->dst.dev ? rt->dst.dev->name : "");
--
1.7.9.5
^ permalink raw reply related
* [PATCH net-next] sparc: bpf_jit_comp: add VLAN instructions for BPF JIT
From: Daniel Borkmann @ 2012-11-05 2:59 UTC (permalink / raw)
To: davem; +Cc: netdev
This patch is a follow-up for patch "net: filter: add vlan tag access"
to support the new VLAN_TAG/VLAN_TAG_PRESENT accessors in BPF JIT.
Signed-off-by: Daniel Borkmann <daniel.borkmann@tik.ee.ethz.ch>
---
Disclaimer: uncompiled and untested, since I don't have a SPARC machine,
but it should (hopefully) integrate cleanly. ;)
arch/sparc/net/bpf_jit_comp.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/arch/sparc/net/bpf_jit_comp.c b/arch/sparc/net/bpf_jit_comp.c
index 2836870..3109ca6 100644
--- a/arch/sparc/net/bpf_jit_comp.c
+++ b/arch/sparc/net/bpf_jit_comp.c
@@ -3,6 +3,7 @@
#include <linux/netdevice.h>
#include <linux/filter.h>
#include <linux/cache.h>
+#include <linux/if_vlan.h>
#include <asm/cacheflush.h>
#include <asm/ptrace.h>
@@ -312,6 +313,12 @@ do { *prog++ = BR_OPC | WDISP22(OFF); \
#define emit_addi(R1, IMM, R3) \
*prog++ = (ADD | IMMED | RS1(R1) | S13(IMM) | RD(R3))
+#define emit_and(R1, R2, R3) \
+ *prog++ = (AND | RS1(R1) | RS2(R2) | RD(R3))
+
+#define emit_andi(R1, IMM, R3) \
+ *prog++ = (AND | IMMED | RS1(R1) | S13(IMM) | RD(R3))
+
#define emit_alloc_stack(SZ) \
*prog++ = (SUB | IMMED | RS1(SP) | S13(SZ) | RD(SP))
@@ -415,6 +422,8 @@ void bpf_jit_compile(struct sk_filter *fp)
case BPF_S_ANC_IFINDEX:
case BPF_S_ANC_MARK:
case BPF_S_ANC_RXHASH:
+ case BPF_S_ANC_VLAN_TAG:
+ case BPF_S_ANC_VLAN_TAG_PRESENT:
case BPF_S_ANC_CPU:
case BPF_S_ANC_QUEUE:
case BPF_S_LD_W_ABS:
@@ -600,6 +609,16 @@ void bpf_jit_compile(struct sk_filter *fp)
case BPF_S_ANC_RXHASH:
emit_skb_load32(rxhash, r_A);
break;
+ case BPF_S_ANC_VLAN_TAG:
+ case BPF_S_ANC_VLAN_TAG_PRESENT:
+ emit_skb_load16(vlan_tci, r_A);
+ if (filter[i].code == BPF_S_ANC_VLAN_TAG) {
+ emit_andi(r_A, VLAN_VID_MASK, r_A);
+ } else {
+ emit_loadimm(VLAN_TAG_PRESENT, r_TMP);
+ emit_and(r_A, r_TMP, r_A);
+ }
+ break;
case BPF_S_LD_IMM:
emit_loadimm(K, r_A);
^ permalink raw reply related
* Re: [rfc net-next v6 2/3] virtio_net: multiqueue support
From: Rusty Russell @ 2012-11-05 1:08 UTC (permalink / raw)
To: Jason Wang, mst, davem, virtualization, linux-kernel, netdev,
krkumar2; +Cc: kvm
In-Reply-To: <1351591403-23065-3-git-send-email-jasowang@redhat.com>
Jason Wang <jasowang@redhat.com> writes:
> +struct virtnet_info {
> + u16 num_queue_pairs; /* # of RX/TX vq pairs */
> + u16 total_queue_pairs;
> +
> + struct send_queue *sq;
> + struct receive_queue *rq;
> + struct virtqueue *cvq;
> +
> + struct virtio_device *vdev;
> + struct net_device *dev;
> + unsigned int status;
status seems unused?
> +static const struct ethtool_ops virtnet_ethtool_ops;
Strange hoist, but I can't tell from the patch if this is necessary.
Assume it is.
> +static inline int vq2txq(struct virtqueue *vq)
> +{
> + int index = virtqueue_get_queue_index(vq);
> + return index == 1 ? 0 : (index - 3) / 2;
> +}
> +
> +static inline int txq2vq(int txq)
> +{
> + return txq ? 2 * txq + 3 : 1;
> +}
> +
> +static inline int vq2rxq(struct virtqueue *vq)
> +{
> + int index = virtqueue_get_queue_index(vq);
> + return index ? (index - 2) / 2 : 0;
> +}
> +
> +static inline int rxq2vq(int rxq)
> +{
> + return rxq ? 2 * rxq + 2 : 0;
> +}
> +
> static inline struct skb_vnet_hdr *skb_vnet_hdr(struct sk_buff *skb)
I know skb_vnet_hdr() does it, but I generally dislike inline in C
files; gcc is generally smart enough these days, and inline suppresses
unused function warnings.
I guess these mappings have to work even when we're switching from mq to
single queue mode; otherwise we could simplify them using a 'bool mq'
flag.
> +static int virtnet_set_queues(struct virtnet_info *vi)
> +{
> + struct scatterlist sg;
> + struct virtio_net_ctrl_steering s;
> + struct net_device *dev = vi->dev;
> +
> + if (vi->num_queue_pairs == 1) {
> + s.current_steering_rule = VIRTIO_NET_CTRL_STEERING_SINGLE;
> + s.current_steering_param = 1;
> + } else {
> + s.current_steering_rule =
> + VIRTIO_NET_CTRL_STEERING_RX_FOLLOWS_TX;
> + s.current_steering_param = vi->num_queue_pairs;
> + }
(BTW, VIRTIO_NET_CTRL_STEERING_RX_FOLLOWS_TX etc not defined anywhere?)
Hmm, it's not clear that anything other than RX_FOLLOWS_TX will ever
make sense, so this is really just turning mq on and off.
Unfortunately, we can't turn feature bits on and off after startup, so
if we want this level of control (and I think we do), there does need to
be a mechanism.
Michael? I'd prefer this to be further simplfied, to just
disable/enable. We can extend it later, but for now the second
parameter is redundant, ie.:
struct virtio_net_ctrl_steering {
u8 mode; /* 0 == off, 1 == on */
} __attribute__((packed));
> @@ -924,11 +1032,10 @@ static void virtnet_get_ringparam(struct net_device *dev,
> {
> struct virtnet_info *vi = netdev_priv(dev);
>
> - ring->rx_max_pending = virtqueue_get_vring_size(vi->rvq);
> - ring->tx_max_pending = virtqueue_get_vring_size(vi->svq);
> + ring->rx_max_pending = virtqueue_get_vring_size(vi->rq[0].vq);
> + ring->tx_max_pending = virtqueue_get_vring_size(vi->sq[0].vq);
> ring->rx_pending = ring->rx_max_pending;
> ring->tx_pending = ring->tx_max_pending;
> -
> }
This assumes all vqs are the same size. I think this should probably
check: for mq mode, use the first vq, otherewise use the 0th.
For bonus points, check this assertion at probe time.
> + /*
> + * We expect 1 RX virtqueue followed by 1 TX virtqueue, followd by
> + * possible control virtqueue, followed by 1 reserved vq, followed
> + * by RX/TX queue pairs used in multiqueue mode.
> + */
> + if (vi->total_queue_pairs == 1)
> + total_vqs = 2 + virtio_has_feature(vi->vdev,
> + VIRTIO_NET_F_CTRL_VQ);
> + else
> + total_vqs = 2 * vi->total_queue_pairs + 2;
What's the allergy to odd numbers? Why the reserved queue?
> + if (virtio_has_feature(vdev, VIRTIO_NET_F_CTRL_VQ))
> + vi->has_cvq = true;
> +
> + /* Use single tx/rx queue pair as default */
> + vi->num_queue_pairs = 1;
> + vi->total_queue_pairs = num_queue_pairs;
> +
> + /* Allocate/initialize the rx/tx queues, and invoke find_vqs */
> + err = virtnet_setup_vqs(vi);
> if (err)
> goto free_stats;
>
> + if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VQ) &&
> + virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VLAN))
> + dev->features |= NETIF_F_HW_VLAN_FILTER;
We should be using has_cvq here...
> -#ifdef CONFIG_PM
> -static int virtnet_freeze(struct virtio_device *vdev)
> +static void virtnet_stop(struct virtnet_info *vi)
I think you still want this under CONFIG_PM, right? Doesn't seem used
elsewhere.
Cheers,
Rusty.
^ permalink raw reply
* Re: [rfc net-next v6 3/3] virtio-net: change the number of queues through ethtool
From: Rusty Russell @ 2012-11-04 23:46 UTC (permalink / raw)
To: Jason Wang, mst, davem, virtualization, linux-kernel, netdev,
krkumar2; +Cc: kvm
In-Reply-To: <1351591403-23065-4-git-send-email-jasowang@redhat.com>
Jason Wang <jasowang@redhat.com> writes:
> This patch implement the {set|get}_channels method of ethool to allow user to
> change the number of queues dymaically when the device is running. This would
> let the user to tune the device for specific applications.
...
> + /* Only two modes were support currently */
> + if (queue_pairs == 0)
> + return -EINVAL;
> + if (queue_pairs != vi->total_queue_pairs - 1 && queue_pairs != 1)
> + return -EINVAL;
OK, so you let them do all or nothing, but this three-way test is
pretty unclear.
In fact, the whole total_queue_pairs/num_queue_pairs thing is weird (and
uncommented). I think for "total" you mean "max"; the maximum possible
queue pair number.
Let me go back and review the previous patch again...
Cheers,
Rusty.
^ permalink raw reply
* Re: [rfc net-next v6 2/3] virtio_net: multiqueue support
From: Rusty Russell @ 2012-11-04 23:16 UTC (permalink / raw)
To: Jason Wang, mst, davem, virtualization, linux-kernel, netdev,
krkumar2; +Cc: kvm
In-Reply-To: <1351591403-23065-3-git-send-email-jasowang@redhat.com>
Jason Wang <jasowang@redhat.com> writes:
> This addes multiqueue support to virtio_net driver. There's two mode supported:
> single queue pair mode and multiple queue pairs mode. An obvious
> difference compared with a physical mq card is that virtio-net reserve
> first two virtqueues when it is working in multiqueue mode, this is
> used for implementing adaptive mode switching in the future. The
> virtqueues that were in both mq and sq mode were initialized and only
> one queue pair (single queue mode) were used at default. User could
> use ethtool -L to switch to multiqueue mode withe the next patch.
Hi Jason,
This first patch looks good, but conflates three things
together:
(1) Separate per-queue structures from struct virtnet_info to allow
multiple queues. This is the mechanical part of the patch.
(2) An annotation bugfix, see below.
(3) Enabling mq using a new feature and negotiation.
> @@ -700,7 +767,8 @@ static struct rtnl_link_stats64 *virtnet_stats(struct net_device *dev,
> unsigned int start;
>
> for_each_possible_cpu(cpu) {
> - struct virtnet_stats *stats = per_cpu_ptr(vi->stats, cpu);
> + struct virtnet_stats __percpu *stats
> + = per_cpu_ptr(vi->stats, cpu);
> u64 tpackets, tbytes, rpackets, rbytes;
>
> do {
Cheers,
Rusty.
^ permalink raw reply
* Re: [PATCH] net/at91_ether: fix the use of macb structure
From: Nicolas Ferre @ 2012-11-04 23:02 UTC (permalink / raw)
To: David Miller
Cc: netdev, manabian, patrice.vilchez, linux-kernel, havard,
bhutchings, plagnioj, linux-arm-kernel
In-Reply-To: <20121103.150414.707741347606909244.davem@davemloft.net>
On 11/03/2012 08:04 PM, David Miller :
> From: Nicolas Ferre <nicolas.ferre@atmel.com>
> Date: Tue, 30 Oct 2012 12:30:28 +0100
>
>> Due to the use of common structure in at91_ether and macb drivers,
>> change the name of DMA descriptor structures in at91_ether as well:
>> dma_desc => macb_dma_desc
>>
>> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
>
> This does not apply to net-next, respin it if this change is
> still relevant.
This one is not relevant anymore.
Best regards,
--
Nicolas Ferre
^ permalink raw reply
* Re: [PATCH 1/2] net: at91_ether: add dt support
From: Joachim Eastwood @ 2012-11-04 22:21 UTC (permalink / raw)
To: Jean-Christophe PLAGNIOL-VILLARD
Cc: linux-arm-kernel, devicetree-discuss, Nicolas Ferre, netdev
In-Reply-To: <1352052637-5154-1-git-send-email-plagnioj@jcrosoft.com>
Hi Jean-Christophe,
Some minor comments below.
On 4 November 2012 19:10, Jean-Christophe PLAGNIOL-VILLARD
<plagnioj@jcrosoft.com> wrote:
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> Cc: Joachim Eastwood <manabian@gmail.com>
> Cc: netdev@vger.kernel.org
> ---
> .../devicetree/bindings/net/cdns-emac.txt | 23 +++++++
> drivers/net/ethernet/cadence/at91_ether.c | 72 ++++++++++++++++++--
> 2 files changed, 88 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..45b8760
> --- /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,atrm9200-emac";
Typo in the compatible string. Should be "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..3e843b4 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,49 @@ 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;
Space between variables and code, please.
> + 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 +512,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 +543,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 +659,7 @@ static struct platform_driver at91ether_driver = {
> .driver = {
> .name = DRV_NAME,
> .owner = THIS_MODULE,
> + .of_match_table = of_match_ptr(at91ether_dt_ids),
> },
> };
>
Tested-by: Joachim Eastwood <manabian@gmail.com>
regards
Joachim Eastwood
^ permalink raw reply
* Re: [PATCH net-next 3/3] eth: Rename and properly align br_reserved_address array
From: Stephen Hemminger @ 2012-11-04 20:42 UTC (permalink / raw)
To: John Fastabend; +Cc: Ben Hutchings, David Miller, netdev, linux-net-drivers
In-Reply-To: <509314F3.6030206@intel.com>
On Thu, 01 Nov 2012 17:33:55 -0700
John Fastabend <john.r.fastabend@intel.com> wrote:
> On 11/1/2012 12:12 PM, Ben Hutchings wrote:
> > Since this array is no longer part of the bridge driver, it should
> > have an 'eth' prefix not 'br'.
> >
> > We also assume that either it's 16-bit-aligned or the architecture has
> > efficient unaligned access. Ensure the first of these is true by
> > explicitly aligning it.
> >
> > Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
> > ---
>
> Thanks.
>
> Acked-by: John Fastabend <john.r.fastabend@intel.com>
>
I wonder if aligning to 64 bit and doing 64 bit read
and mask would be trivially more efficient for this.
^ permalink raw reply
* merging printk and WARN
From: Julia Lawall @ 2012-11-04 20:25 UTC (permalink / raw)
To: linux-kernel, airlied, netdev, arnd, joern, chris.mason, m, jejb,
faisal.latif, neilb, gregkh, JBottomley, swise, achim_leubner,
swise, tytso
Cc: dri-devel, jason.wessel, kgdb-bugreport, Prasad Joshi, logfs,
linux-btrfs, Helge Deller, linux-parisc, Roland Dreier,
Sean Hefty, hal.rosenstock, linux-rdma, linux-raid, linux-usb,
linux-scsi, Andreas Dilger, linux-ext4
It looks like these patches were not a good idea, because in each case the
printk provides an error level, and WARN then provides another one.
Sorry for the noise.
julia
^ permalink raw reply
* [PATCH 2/2] net: at91_ether: add pinctrl support
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-11-04 18:10 UTC (permalink / raw)
To: linux-arm-kernel
Cc: Nicolas Ferre, devicetree-discuss,
Jean-Christophe PLAGNIOL-VILLARD, Joachim Eastwood, netdev
In-Reply-To: <1352052637-5154-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>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Joachim Eastwood <manabian@gmail.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 3e843b4..ffcdbc3 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"
@@ -500,11 +501,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
* [PATCH 1/2] net: at91_ether: add dt support
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-11-04 18:10 UTC (permalink / raw)
To: linux-arm-kernel
Cc: Nicolas Ferre, devicetree-discuss,
Jean-Christophe PLAGNIOL-VILLARD, Joachim Eastwood, netdev
In-Reply-To: <20121104154954.GJ19021@game.jcrosoft.org>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Joachim Eastwood <manabian@gmail.com>
Cc: netdev@vger.kernel.org
---
.../devicetree/bindings/net/cdns-emac.txt | 23 +++++++
drivers/net/ethernet/cadence/at91_ether.c | 72 ++++++++++++++++++--
2 files changed, 88 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..45b8760
--- /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,atrm9200-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..3e843b4 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,49 @@ 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 +512,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 +543,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 +659,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
* Re: [PATCH 1/9] batman-adv: add UNICAST_4ADDR packet type
From: David Miller @ 2012-11-04 17:30 UTC (permalink / raw)
To: sven-KaDOiPu9UxWEi8DpZVb4nw
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r
In-Reply-To: <5244128.ID77evUSAJ-S/pmIDWWJIwhrEaHGRlFQnOel7F/LzPIcbWoRP8EXgk@public.gmane.org>
From: Sven Eckelmann <sven-KaDOiPu9UxWEi8DpZVb4nw@public.gmane.org>
Date: Sun, 04 Nov 2012 12:20:13 +0100
> To push this question in a direction: May I assume that the driver always
> ensures that the ethernet header is 4 byte boundary - NET_IP_ALIGN (2)
> aligned?
Yes.
> When yes, this would result in a slight variations of your suggestion:
> unicast/bcast headers have to end at 4 bytes boundary + 2 bytes. The reason is
> easy to explain. batman-adv unicast/bcast headers are used to encapsulate the
> important parts of an ethernet frame:
>
> Ethernet Header for P2P | batman-adv header stuff | ethernet header | payload.
>
> Would you aggree?
Then you can get rid of the packed crap.
^ permalink raw reply
* Re: [PATCH 8/9] isdn: Remove unused variable causing a compile build warning
From: David Miller @ 2012-11-04 17:30 UTC (permalink / raw)
To: lee.jones; +Cc: pebolle, linux-kernel, isdn, netdev
In-Reply-To: <20121104105332.GC27124@gmail.com>
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.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox