* Re: [PATCH 2/2] phy/micrel: move flag handling to function for common use
From: David Miller @ 2013-03-12 10:55 UTC (permalink / raw)
To: hector.palacios; +Cc: netdev, linux-kernel, marex
In-Reply-To: <1362991803-4610-2-git-send-email-hector.palacios@digi.com>
From: Hector Palacios <hector.palacios@digi.com>
Date: Mon, 11 Mar 2013 09:50:03 +0100
> The flag MICREL_PHY_50MHZ_CLK is not of exclusive use of KSZ8051
> model. At least KSZ8021 and KSZ8031 models also use it.
> This patch moves the handling of this and future flags to a
> separate function so that the different PHY models can call it on
> their init function, if needed.
>
> Signed-off-by: Hector Palacios <hector.palacios@digi.com>
Applied.
^ permalink raw reply
* Re: [PATCH 1/2] phy/micrel: Add support for KSZ8031
From: David Miller @ 2013-03-12 10:55 UTC (permalink / raw)
To: marex; +Cc: hector.palacios, netdev, linux-kernel
In-Reply-To: <201303111339.46507.marex@denx.de>
From: Marek Vasut <marex@denx.de>
Date: Mon, 11 Mar 2013 13:39:46 +0100
> Dear Hector Palacios,
>
>> Micrel PHY KSZ8031 is similar to KSZ8021 and also requires the special
>> initialization of "Operation Mode Strap Override" in reg 0x16
>> introduced in 212ea99 (phy/micrel: Implement support for KSZ8021).
>>
>> Signed-off-by: Hector Palacios <hector.palacios@digi.com>
>
> I dont have any board with this one, yet I think this change is correct, so:
>
> Reviewed-by: Marek Vasut <marex@denx.de>
Applied.
^ permalink raw reply
* RE: [PATCH net-next 06/13] bnx2x: Control number of vfs dynamically
From: Ariel Elior @ 2013-03-12 10:51 UTC (permalink / raw)
To: David Miller, Yuval Mintz; +Cc: netdev@vger.kernel.org, Eilon Greenstein
In-Reply-To: <20130312.052811.2289109881056913990.davem@davemloft.net>
> -----Original Message-----
> From: David Miller [mailto:davem@davemloft.net]
> Sent: Tuesday, March 12, 2013 11:28 AM
> To: Yuval Mintz
> Cc: netdev@vger.kernel.org; Eilon Greenstein; Ariel Elior
> Subject: Re: [PATCH net-next 06/13] bnx2x: Control number of vfs
> dynamically
>
> From: "Yuval Mintz" <yuvalmin@broadcom.com>
> Date: Mon, 11 Mar 2013 17:17:46 +0200
>
> > From: Ariel Elior <ariele@broadcom.com>
> >
> > 1. Support sysfs interface for getting the maximal number of virtual
> functions
> > of a given physical function.
> > 2. Support sysfs interface for getting and setting the current number of
> > virtual functions.
> >
> > Signed-off-by: Ariel Elior <ariele@broadcom.com>
> > Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
> > Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
>
> I don't like these sysfs knobs at all, what are other drivers
> doing?
Intel's ixgbe and igb already implement these callbacks.
Other drivers are using proprietary module parameters.
This is a generic sysfs interface which any driver can use.
Yuval Mintz from Broadcom started the
"New commands to configure IOV features" thread
http://marc.info/?l=linux-netdev&m=133638974914452&w=2
As the discussion developed it was realized that virtual functions
have a wider scope than networking.
The discussion culminated with a submission to the pci tree:
commit 1789382a72a537447d65ea4131d8bcc1ad85ce7b
Author: Donald Dutile <ddutile@redhat.com>
Date: Mon Nov 5 15:20:36 2012 -0500
Adding sriov_numvfs and sriov_totalvfs to all SR-IOV capable pci devices.
I would like to add that sysfs is actually a very convenient place to have
these knobs, because the virtfn entries there are a simple reliable way to
know which vf devices sprouted from which PF devices and what are their
names, which is very handy when scripting with VFs.
Thanks,
Ariel
^ permalink raw reply
* Re: linux-next: manual merge of the net-next tree with Linus' tree
From: David Miller @ 2013-03-12 10:49 UTC (permalink / raw)
To: sfr
Cc: netdev, linux-next, linux-kernel, khlebnikov, jeffrey.t.kirsher,
bruce.w.allan
In-Reply-To: <20130312113320.b1f41dcb59baa74a51b064cc@canb.auug.org.au>
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Tue, 12 Mar 2013 11:33:20 +1100
> Hi all,
>
> Today's linux-next merge of the net-next tree got a conflict in
> drivers/net/ethernet/intel/e1000e/netdev.c between commits 4e0855dff094
> ("e1000e: fix pci-device enable-counter balance") and 66148babe728
> ("e1000e: fix runtime power management transitions") from Linus' tree and
> commit f0ff439872e1 ("e1000e: cleanup CODE_INDENT checkpatch errors")
> from the net-next tree.
>
> The former removed the line fixed by the latter, so I did that and can
> carry the fix as necessary (no action is required).
I've just merged 'net' into 'net-next' and resolved this merge conflict.
^ permalink raw reply
* Re: [PATCH] l2tp: Restore socket refcount when sendmsg succeeds
From: Guillaume Nault @ 2013-03-12 10:36 UTC (permalink / raw)
To: David Miller; +Cc: jchapman, linux-kernel, netdev
In-Reply-To: <20130301.141252.1152926224695074046.davem@davemloft.net>
On Fri, Mar 01, 2013 at 02:12:52PM -0500, David Miller wrote:
> From: Guillaume Nault <g.nault@alphalink.fr>
> Date: Fri, 1 Mar 2013 16:02:02 +0100
>
> > The sendmsg() syscall handler for PPPoL2TP doesn't decrease the socket
> > reference counter after successful transmissions. Any successful
> > sendmsg() call from userspace will then increase the reference counter
> > forever, thus preventing the kernel's session and tunnel data from
> > being freed later on.
> >
> > The problem only happens when writing directly on L2TP sockets.
> > PPP sockets attached to L2TP are unaffected as the PPP subsystem
> > uses pppol2tp_xmit() which symmetrically increase/decrease reference
> > counters.
> >
> > This patch adds the missing call to sock_put() before returning from
> > pppol2tp_sendmsg().
> >
> > Cc: <stable@vger.kernel.org>
> > Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
>
> Looking at how this code works, it is such a terrible design. This
> whole reference counting issue exists purely because
> pppol2tp_sock_to_session() grabs the 'sk' reference.
>
> In all but one case, it need not do this.
>
> The socket system calls have an implicit reference to 'sk' via
> socket->sk. If you can get into the system call and socket->sk
> is non-NULL then 'sk' is NOT going anywhere.
>
> And all of these system call handlers have this pattern:
>
> session = pppol2tp_sock_to_session(sk);
> ...
> sock_put(sk);
>
> The only case where the reference count is really needed is that
> sequence in pppol2tp_release().
>
> Long term the right thing to do here is stop having this session
> grabber function take the 'sk' reference. Then in pppol2tp_release
> we'll grab a reference explicitly. At all the other call sites we
> then blast aweay all of the sock_put(sk) paths.
>
Could this also apply to l2tp_sock_to_tunnel() (in l2tp_core.h)? As per
my understanding, none of its callers needs to take a socket reference.
So sock_hold() could be removed in both pppol2tp_sock_to_session() and
l2tp_sock_to_tunnel() functions. The corresponding sock_put() calls
would then be removed from all calling functions but pppol2tp_release().
If this is correct, I'll send a patch for net-next.
^ permalink raw reply
* Re: [PATCH] ethernet: amd: use PTR_RET instead of IS_ERR + PTR_ERR
From: Geert Uytterhoeven @ 2013-03-12 9:44 UTC (permalink / raw)
To: Silviu-Mihai Popescu; +Cc: netdev, davem, joe, dhowells, linux-kernel
In-Reply-To: <1363074487-21248-1-git-send-email-silviupopescu1990@gmail.com>
On Tue, Mar 12, 2013 at 8:48 AM, Silviu-Mihai Popescu
<silviupopescu1990@gmail.com> wrote:
> This uses PTR_RET instead of IS_ERR and PTR_ERR in order to increase
> readability.
>
> Signed-off-by: Silviu-Mihai Popescu <silviupopescu1990@gmail.com>
Acked-by: <Geert Uytterhoeven <geert@linux-m68k.org>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply
* Re: [PATCH net] bridge: reserve space for IFLA_BRPORT_FAST_LEAVE
From: David Miller @ 2013-03-12 9:39 UTC (permalink / raw)
To: stephen; +Cc: netdev
In-Reply-To: <20130311165217.760e80fe@nehalam.linuxnetplumber.net>
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Mon, 11 Mar 2013 16:52:17 -0700
> The bridge multicast fast leave feature was added sufficient space
> was not reserved in the netlink message. This means the flag may be
> lost in netlink events and results of queries.
>
> Found by observation while looking up some netlink stuff for discussion with Vlad.
> Problem introduced by commit c2d3babfafbb9f6629cfb47139758e59a5eb0d80
> Author: David S. Miller <davem@davemloft.net>
> Date: Wed Dec 5 16:24:45 2012 -0500
>
> bridge: implement multicast fast leave
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
>
> ---
> Should go to net and stable for 3.8.X
Applied and queued up for -stable.
^ permalink raw reply
* Re: [PATCH net-next] cxgb4: Allow for backward compatibility with new VPD scheme.
From: David Miller @ 2013-03-12 9:37 UTC (permalink / raw)
To: vipul; +Cc: netdev, divy, dm, abhishek, santosh
In-Reply-To: <1362749729-4532-1-git-send-email-vipul@chelsio.com>
From: Vipul Pandya <vipul@chelsio.com>
Date: Fri, 8 Mar 2013 19:05:29 +0530
> From: Santosh Rastapur <santosh@chelsio.com>
>
> New scheme calls for 3rd party VPD at offset 0x0 and Chelsio VPD at offset
> 0x400 of the function. If no 3rd party VPD is present, then a copy of
> Chelsio's VPD will be at offset 0x0 to keep in line with PCI spec which
> requires the VPD to be present at offset 0x0.
>
> Signed-off-by: Santosh Rastapur <santosh@chelsio.com>
> Signed-off-by: Vipul Pandya <vipul@chelsio.com>
Applied to 'net'.
^ permalink raw reply
* Re: [PATCH] net/ipv4: Ensure that location of timestamp option is stored
From: David Miller @ 2013-03-12 9:37 UTC (permalink / raw)
To: david.ward; +Cc: netdev
In-Reply-To: <1363034619-5887-1-git-send-email-david.ward@ll.mit.edu>
From: David Ward <david.ward@ll.mit.edu>
Date: Mon, 11 Mar 2013 16:43:39 -0400
> This is needed in order to detect if the timestamp option appears
> more than once in a packet, to remove the option if the packet is
> fragmented, etc. My previous change neglected to store the option
> location when the router addresses were prespecified and Pointer >
> Length. But now the option location is also stored when Flag is an
> unrecognized value, to ensure these option handling behaviors are
> still performed.
>
> Signed-off-by: David Ward <david.ward@ll.mit.edu>
Applied.
^ permalink raw reply
* igb_poll - device driver failed to check map error
From: Christoph Paasch @ 2013-03-12 9:31 UTC (permalink / raw)
To: Jeff Kirsher, Jesse Brandeburg, Bruce Allan, Alex Duyck,
Eric Dumazet
Cc: netdev
Hello,
I'm seeing a warning while booting my machine when DMA_API_DEBUG is set:
[ 36.402824] ------------[ cut here ]------------
[ 36.458070] WARNING: at /home/cpaasch/builder/net-next/lib/dma-debug.c:934
check_unmap+0x648/0x702()
[ 36.567377] Hardware name: ProLiant DL165 G7
[ 36.618452] igb 0000:04:00.0: DMA-API: device driver failed to check map
error[device address=0x0000000233d9b232] [size=154 bytes] [mapped as single]
[ 36.776640] Modules linked in:
[ 36.815446] Pid: 0, comm: swapper/7 Not tainted 3.9.0-rc1-mptcp+ #101
[ 36.892515] Call Trace:
[ 36.921745] <IRQ> [<ffffffff8102ad7f>] warn_slowpath_common+0x80/0x9a
[ 37.001023] [<ffffffff8102ae2d>] warn_slowpath_fmt+0x41/0x43
[ 37.069771] [<ffffffff811db17f>] check_unmap+0x648/0x702
[ 37.134363] [<ffffffff811db3e9>] debug_dma_unmap_page+0x50/0x52
[ 37.206234] [<ffffffff8136676a>] igb_poll+0x144/0xf7c
[ 37.267706] [<ffffffff8104dd19>] ? sched_clock_cpu+0x46/0xd1
[ 37.336456] [<ffffffff814458ce>] net_rx_action+0xa7/0x1d0
[ 37.402085] [<ffffffff81030b65>] __do_softirq+0xb4/0x16f
[ 37.466673] [<ffffffff81030c90>] irq_exit+0x40/0x87
[ 37.526067] [<ffffffff81002db1>] do_IRQ+0x98/0xaf
[ 37.583378] [<ffffffff815210aa>] common_interrupt+0x6a/0x6a
[ 37.651086] <EOI> [<ffffffff8105d4be>] ?
__tick_nohz_idle_enter+0x116/0x31f
[ 37.736595] [<ffffffff81008a04>] ? default_idle+0x24/0x39
[ 37.802224] [<ffffffff81008c62>] cpu_idle+0x68/0xa4
[ 37.861616] [<ffffffff81519f78>] start_secondary+0x1a9/0x1ad
[ 37.930364] ---[ end trace 01b5bb0fd75a464c ]---
It happens shortly after mounting the NFS-root filesystem.
I tried to understand what is going on, but I am now at my wit's end.
By adding some print-statements, here is what I found out (not sure if this is
anyhow helpful):
The difference between tx_buffer->time_stamp and the current 'jiffies' is up
to 2000 jiffies (HZ==1000) at the first time the above warning happens (this
seems too much for me). From then on, I see my print 3-4 times appear but
without such a big difference between the timestamps (difference around 1 and
2 jiffies).
Some other stuff, I printed:
tx_buffer->skb: ffff880235054c80
tx_buffer->bytecount: 154
tx_buffer->gso_segs: 1
tx_buffer->protocol: 8
tx_buffer->tx_flags 0x20
One last thing:
Am I right that after each call to dma_map_single/page a call to
dma_mapping_error is needed? If that's the case, I have some patches that add
this statement at missing places in the e1000, e1000e and ixgb driver. But
these patches do not fix my above problem.
Thanks for your help,
Christoph
--
IP Networking Lab --- http://inl.info.ucl.ac.be
MultiPath TCP in the Linux Kernel --- http://multipath-tcp.org
UCLouvain
--
^ permalink raw reply
* Re: [PATCH net-next 06/13] bnx2x: Control number of vfs dynamically
From: David Miller @ 2013-03-12 9:28 UTC (permalink / raw)
To: yuvalmin; +Cc: netdev, eilong, ariele
In-Reply-To: <1363015073-25743-7-git-send-email-yuvalmin@broadcom.com>
From: "Yuval Mintz" <yuvalmin@broadcom.com>
Date: Mon, 11 Mar 2013 17:17:46 +0200
> From: Ariel Elior <ariele@broadcom.com>
>
> 1. Support sysfs interface for getting the maximal number of virtual functions
> of a given physical function.
> 2. Support sysfs interface for getting and setting the current number of
> virtual functions.
>
> Signed-off-by: Ariel Elior <ariele@broadcom.com>
> Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
> Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
I don't like these sysfs knobs at all, what are other drivers
doing?
^ permalink raw reply
* [PATCH v2 2/5] drivers: net: ethernet: cpsw: change cpts_active_slave to active_slave
From: Mugunthan V N @ 2013-03-12 9:16 UTC (permalink / raw)
To: netdev
Cc: davem, devicetree-discuss, linux-omap, b-cousson, paul,
Mugunthan V N, Richard Cochran
In-Reply-To: <1363079798-18147-1-git-send-email-mugunthanvnm@ti.com>
Change cpts_active_slave to active_slave so that the same DT property
can be used to ethtool and SIOCGMIIPHY.
CC: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
---
Documentation/devicetree/bindings/net/cpsw.txt | 7 ++++---
arch/arm/boot/dts/am33xx.dtsi | 2 +-
drivers/net/ethernet/ti/cpsw.c | 10 +++++-----
include/linux/platform_data/cpsw.h | 2 +-
4 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/Documentation/devicetree/bindings/net/cpsw.txt b/Documentation/devicetree/bindings/net/cpsw.txt
index 8e49c42..4f2ca6b 100644
--- a/Documentation/devicetree/bindings/net/cpsw.txt
+++ b/Documentation/devicetree/bindings/net/cpsw.txt
@@ -15,7 +15,8 @@ Required properties:
- mac_control : Specifies Default MAC control register content
for the specific platform
- slaves : Specifies number for slaves
-- cpts_active_slave : Specifies the slave to use for time stamping
+- active_slave : Specifies the slave to use for time stamping,
+ ethtool and SIOCGMIIPHY
- cpts_clock_mult : Numerator to convert input clock ticks into nanoseconds
- cpts_clock_shift : Denominator to convert input clock ticks into nanoseconds
@@ -52,7 +53,7 @@ Examples:
rx_descs = <64>;
mac_control = <0x20>;
slaves = <2>;
- cpts_active_slave = <0>;
+ active_slave = <0>;
cpts_clock_mult = <0x80000000>;
cpts_clock_shift = <29>;
cpsw_emac0: slave@0 {
@@ -78,7 +79,7 @@ Examples:
rx_descs = <64>;
mac_control = <0x20>;
slaves = <2>;
- cpts_active_slave = <0>;
+ active_slave = <0>;
cpts_clock_mult = <0x80000000>;
cpts_clock_shift = <29>;
cpsw_emac0: slave@0 {
diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index 0957645..91fe4f1 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -349,7 +349,7 @@
rx_descs = <64>;
mac_control = <0x20>;
slaves = <2>;
- cpts_active_slave = <0>;
+ active_slave = <0>;
cpts_clock_mult = <0x80000000>;
cpts_clock_shift = <29>;
reg = <0x4a100000 0x800
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 01ffbc4..98aa17a 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -942,7 +942,7 @@ static void cpsw_ndo_change_rx_flags(struct net_device *ndev, int flags)
static void cpsw_hwtstamp_v1(struct cpsw_priv *priv)
{
- struct cpsw_slave *slave = &priv->slaves[priv->data.cpts_active_slave];
+ struct cpsw_slave *slave = &priv->slaves[priv->data.active_slave];
u32 ts_en, seq_id;
if (!priv->cpts->tx_enable && !priv->cpts->rx_enable) {
@@ -971,7 +971,7 @@ static void cpsw_hwtstamp_v2(struct cpsw_priv *priv)
if (priv->data.dual_emac)
slave = &priv->slaves[priv->emac_port];
else
- slave = &priv->slaves[priv->data.cpts_active_slave];
+ slave = &priv->slaves[priv->data.active_slave];
ctrl = slave_read(slave, CPSW2_CONTROL);
ctrl &= ~CTRL_ALL_TS_MASK;
@@ -1282,12 +1282,12 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data,
}
data->slaves = prop;
- if (of_property_read_u32(node, "cpts_active_slave", &prop)) {
- pr_err("Missing cpts_active_slave property in the DT.\n");
+ if (of_property_read_u32(node, "active_slave", &prop)) {
+ pr_err("Missing active_slave property in the DT.\n");
ret = -EINVAL;
goto error_ret;
}
- data->cpts_active_slave = prop;
+ data->active_slave = prop;
if (of_property_read_u32(node, "cpts_clock_mult", &prop)) {
pr_err("Missing cpts_clock_mult property in the DT.\n");
diff --git a/include/linux/platform_data/cpsw.h b/include/linux/platform_data/cpsw.h
index 798fb80..bb3cd58 100644
--- a/include/linux/platform_data/cpsw.h
+++ b/include/linux/platform_data/cpsw.h
@@ -30,7 +30,7 @@ struct cpsw_platform_data {
u32 channels; /* number of cpdma channels (symmetric) */
u32 slaves; /* number of slave cpgmac ports */
struct cpsw_slave_data *slave_data;
- u32 cpts_active_slave; /* time stamping slave */
+ u32 active_slave; /* time stamping, ethtool and SIOCGMIIPHY slave */
u32 cpts_clock_mult; /* convert input clock ticks to nanoseconds */
u32 cpts_clock_shift; /* convert input clock ticks to nanoseconds */
u32 ale_entries; /* ale table size */
--
1.7.9.5
^ permalink raw reply related
* [PATCH v2 5/5] drivers: net: ethernet: cpsw: implement get phy_id via ioctl
From: Mugunthan V N @ 2013-03-12 9:16 UTC (permalink / raw)
To: netdev
Cc: davem, devicetree-discuss, linux-omap, b-cousson, paul,
Mugunthan V N
In-Reply-To: <1363079798-18147-1-git-send-email-mugunthanvnm@ti.com>
Implement get phy_id via ioctl SIOCGMIIPHY. In switch mode active phy_id
is returned and in dual EMAC mode slave's specific phy_id is returned.
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
---
drivers/net/ethernet/ti/cpsw.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index d6cf698..8ff1d3d 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -1157,14 +1157,26 @@ static int cpsw_hwtstamp_ioctl(struct net_device *dev, struct ifreq *ifr)
static int cpsw_ndo_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
{
+ struct cpsw_priv *priv = netdev_priv(dev);
+ struct mii_ioctl_data *data = if_mii(req);
+ int slave_no = cpsw_slave_index(priv);
+
if (!netif_running(dev))
return -EINVAL;
+ switch (cmd) {
#ifdef CONFIG_TI_CPTS
- if (cmd == SIOCSHWTSTAMP)
+ case SIOCSHWTSTAMP:
return cpsw_hwtstamp_ioctl(dev, req);
#endif
- return -ENOTSUPP;
+ case SIOCGMIIPHY:
+ data->phy_id = priv->slaves[slave_no].phy->addr;
+ break;
+ default:
+ return -ENOTSUPP;
+ }
+
+ return 0;
}
static void cpsw_ndo_tx_timeout(struct net_device *ndev)
--
1.7.9.5
^ permalink raw reply related
* [PATCH v2 1/5] documentation: dt: bindings: cpsw: cleanup documentation
From: Mugunthan V N @ 2013-03-12 9:16 UTC (permalink / raw)
To: netdev
Cc: davem, devicetree-discuss, linux-omap, b-cousson, paul,
Mugunthan V N
In-Reply-To: <1363079798-18147-1-git-send-email-mugunthanvnm@ti.com>
Move all the slave note properties to separate section to reduce the
confusion between slave note properties and cpsw node properties
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
---
Documentation/devicetree/bindings/net/cpsw.txt | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/net/cpsw.txt b/Documentation/devicetree/bindings/net/cpsw.txt
index ecfdf75..8e49c42 100644
--- a/Documentation/devicetree/bindings/net/cpsw.txt
+++ b/Documentation/devicetree/bindings/net/cpsw.txt
@@ -18,13 +18,18 @@ Required properties:
- cpts_active_slave : Specifies the slave to use for time stamping
- cpts_clock_mult : Numerator to convert input clock ticks into nanoseconds
- cpts_clock_shift : Denominator to convert input clock ticks into nanoseconds
-- phy_id : Specifies slave phy id
-- mac-address : Specifies slave MAC address
Optional properties:
- ti,hwmods : Must be "cpgmac0"
- no_bd_ram : Must be 0 or 1
- dual_emac : Specifies Switch to act as Dual EMAC
+
+Slave Properties:
+Required properties:
+- phy_id : Specifies slave phy id
+- mac-address : Specifies slave MAC address
+
+Optional properties:
- dual_emac_res_vlan : Specifies VID to be used to segregate the ports
Note: "ti,hwmods" field is used to fetch the base address and irq
--
1.7.9.5
^ permalink raw reply related
* [PATCH v2 4/5] driver: net: ethernet: cpsw: implement interrupt pacing via ethtool
From: Mugunthan V N @ 2013-03-12 9:16 UTC (permalink / raw)
To: netdev
Cc: davem, devicetree-discuss, linux-omap, b-cousson, paul,
Mugunthan V N
In-Reply-To: <1363079798-18147-1-git-send-email-mugunthanvnm@ti.com>
This patch implements support for interrupt pacing block of CPSW via ethtool
Inetrrupt pacing block is common of both the ethernet interface in
dual emac mode
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
---
drivers/net/ethernet/ti/cpsw.c | 104 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 104 insertions(+)
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 83ce890..d6cf698 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -126,6 +126,13 @@ do { \
#define CPSW_FIFO_DUAL_MAC_MODE (1 << 15)
#define CPSW_FIFO_RATE_LIMIT_MODE (2 << 15)
+#define CPSW_INTPACEEN (0x3f << 16)
+#define CPSW_INTPRESCALE_MASK (0x7FF << 0)
+#define CPSW_CMINTMAX_CNT 63
+#define CPSW_CMINTMIN_CNT 2
+#define CPSW_CMINTMAX_INTVL (1000 / CPSW_CMINTMIN_CNT)
+#define CPSW_CMINTMIN_INTVL ((1000 / CPSW_CMINTMAX_CNT) + 1)
+
#define cpsw_enable_irq(priv) \
do { \
u32 i; \
@@ -164,6 +171,15 @@ struct cpsw_wr_regs {
u32 rx_en;
u32 tx_en;
u32 misc_en;
+ u32 mem_allign1[8];
+ u32 rx_thresh_stat;
+ u32 rx_stat;
+ u32 tx_stat;
+ u32 misc_stat;
+ u32 mem_allign2[8];
+ u32 rx_imax;
+ u32 tx_imax;
+
};
struct cpsw_ss_regs {
@@ -318,6 +334,8 @@ struct cpsw_priv {
struct cpsw_host_regs __iomem *host_port_regs;
u32 msg_enable;
u32 version;
+ u32 coal_intvl;
+ u32 bus_freq_mhz;
struct net_device_stats stats;
int rx_packet_max;
int host_port;
@@ -616,6 +634,77 @@ static void cpsw_adjust_link(struct net_device *ndev)
}
}
+static int cpsw_get_coalesce(struct net_device *ndev,
+ struct ethtool_coalesce *coal)
+{
+ struct cpsw_priv *priv = netdev_priv(ndev);
+
+ coal->rx_coalesce_usecs = priv->coal_intvl;
+ return 0;
+}
+
+static int cpsw_set_coalesce(struct net_device *ndev,
+ struct ethtool_coalesce *coal)
+{
+ struct cpsw_priv *priv = netdev_priv(ndev);
+ u32 int_ctrl;
+ u32 num_interrupts = 0;
+ u32 prescale = 0;
+ u32 addnl_dvdr = 1;
+ u32 coal_intvl = 0;
+
+ if (!coal->rx_coalesce_usecs)
+ return -EINVAL;
+
+ coal_intvl = coal->rx_coalesce_usecs;
+
+ int_ctrl = readl(&priv->wr_regs->int_control);
+ prescale = priv->bus_freq_mhz * 4;
+
+ if (coal_intvl < CPSW_CMINTMIN_INTVL)
+ coal_intvl = CPSW_CMINTMIN_INTVL;
+
+ if (coal_intvl > CPSW_CMINTMAX_INTVL) {
+ /* Interrupt pacer works with 4us Pulse, we can
+ * throttle further by dilating the 4us pulse.
+ */
+ addnl_dvdr = CPSW_INTPRESCALE_MASK / prescale;
+
+ if (addnl_dvdr > 1) {
+ prescale *= addnl_dvdr;
+ if (coal_intvl > (CPSW_CMINTMAX_INTVL * addnl_dvdr))
+ coal_intvl = (CPSW_CMINTMAX_INTVL
+ * addnl_dvdr);
+ } else {
+ addnl_dvdr = 1;
+ coal_intvl = CPSW_CMINTMAX_INTVL;
+ }
+ }
+
+ num_interrupts = (1000 * addnl_dvdr) / coal_intvl;
+ writel(num_interrupts, &priv->wr_regs->rx_imax);
+ writel(num_interrupts, &priv->wr_regs->tx_imax);
+
+ int_ctrl |= CPSW_INTPACEEN;
+ int_ctrl &= (~CPSW_INTPRESCALE_MASK);
+ int_ctrl |= (prescale & CPSW_INTPRESCALE_MASK);
+ writel(int_ctrl, &priv->wr_regs->int_control);
+
+ cpsw_notice(priv, timer, "Set coalesce to %d usecs.\n", coal_intvl);
+ if (priv->data.dual_emac) {
+ int i;
+
+ for (i = 0; i < priv->data.slaves; i++) {
+ priv = netdev_priv(priv->slaves[i].ndev);
+ priv->coal_intvl = coal_intvl;
+ }
+ } else {
+ priv->coal_intvl = coal_intvl;
+ }
+
+ return 0;
+}
+
static inline int __show_stat(char *buf, int maxlen, const char *name, u32 val)
{
static char *leader = "........................................";
@@ -838,6 +927,14 @@ static int cpsw_ndo_open(struct net_device *ndev)
cpsw_info(priv, ifup, "submitted %d rx descriptors\n", i);
}
+ /* Enable Interrupt pacing if configured */
+ if (priv->coal_intvl != 0) {
+ struct ethtool_coalesce coal;
+
+ coal.rx_coalesce_usecs = (priv->coal_intvl << 4);
+ cpsw_set_coalesce(ndev, &coal);
+ }
+
cpdma_ctlr_start(priv->dma);
cpsw_intr_enable(priv);
napi_enable(&priv->napi);
@@ -1279,6 +1376,8 @@ static const struct ethtool_ops cpsw_ethtool_ops = {
.get_ts_info = cpsw_get_ts_info,
.get_settings = cpsw_get_settings,
.set_settings = cpsw_set_settings,
+ .get_coalesce = cpsw_get_coalesce,
+ .set_coalesce = cpsw_set_coalesce,
};
static void cpsw_slave_init(struct cpsw_slave *slave, struct cpsw_priv *priv,
@@ -1466,6 +1565,9 @@ static int cpsw_probe_dual_emac(struct platform_device *pdev,
priv_sl2->slaves = priv->slaves;
priv_sl2->clk = priv->clk;
+ priv_sl2->coal_intvl = 0;
+ priv_sl2->bus_freq_mhz = priv->bus_freq_mhz;
+
priv_sl2->cpsw_res = priv->cpsw_res;
priv_sl2->regs = priv->regs;
priv_sl2->host_port = priv->host_port;
@@ -1575,6 +1677,8 @@ static int cpsw_probe(struct platform_device *pdev)
ret = -ENODEV;
goto clean_slave_ret;
}
+ priv->coal_intvl = 0;
+ priv->bus_freq_mhz = clk_get_rate(priv->clk) / 1000000;
priv->cpsw_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!priv->cpsw_res) {
--
1.7.9.5
^ permalink raw reply related
* [PATCH v2 3/5] driver: net: ethernet: cpsw: implement ethtool get/set phy setting
From: Mugunthan V N @ 2013-03-12 9:16 UTC (permalink / raw)
To: netdev
Cc: davem, devicetree-discuss, linux-omap, b-cousson, paul,
Mugunthan V N
In-Reply-To: <1363079798-18147-1-git-send-email-mugunthanvnm@ti.com>
This patch implements get/set of the phy settings via ethtool apis
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
---
drivers/net/ethernet/ti/cpsw.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 98aa17a..83ce890 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -139,6 +139,10 @@ do { \
disable_irq_nosync(priv->irqs_table[i]); \
} while (0);
+#define cpsw_slave_index(priv) \
+ ((priv->data.dual_emac) ? priv->emac_port : \
+ priv->data.active_slave)
+
static int debug_level;
module_param(debug_level, int, 0);
MODULE_PARM_DESC(debug_level, "cpsw debug level (NETIF_MSG bits)");
@@ -1244,12 +1248,37 @@ static int cpsw_get_ts_info(struct net_device *ndev,
return 0;
}
+static int cpsw_get_settings(struct net_device *ndev,
+ struct ethtool_cmd *ecmd)
+{
+ struct cpsw_priv *priv = netdev_priv(ndev);
+ int slave_no = cpsw_slave_index(priv);
+
+ if (priv->slaves[slave_no].phy)
+ return phy_ethtool_gset(priv->slaves[slave_no].phy, ecmd);
+ else
+ return -EOPNOTSUPP;
+}
+
+static int cpsw_set_settings(struct net_device *ndev, struct ethtool_cmd *ecmd)
+{
+ struct cpsw_priv *priv = netdev_priv(ndev);
+ int slave_no = cpsw_slave_index(priv);
+
+ if (priv->slaves[slave_no].phy)
+ return phy_ethtool_sset(priv->slaves[slave_no].phy, ecmd);
+ else
+ return -EOPNOTSUPP;
+}
+
static const struct ethtool_ops cpsw_ethtool_ops = {
.get_drvinfo = cpsw_get_drvinfo,
.get_msglevel = cpsw_get_msglevel,
.set_msglevel = cpsw_set_msglevel,
.get_link = ethtool_op_get_link,
.get_ts_info = cpsw_get_ts_info,
+ .get_settings = cpsw_get_settings,
+ .set_settings = cpsw_set_settings,
};
static void cpsw_slave_init(struct cpsw_slave *slave, struct cpsw_priv *priv,
--
1.7.9.5
^ permalink raw reply related
* [PATCH v2 0/5] cpsw interrupt pacing and get/set phy setting implementation
From: Mugunthan V N @ 2013-03-12 9:16 UTC (permalink / raw)
To: netdev
Cc: davem, devicetree-discuss, linux-omap, b-cousson, paul,
Mugunthan V N
This patch serires implements the following features in CPSW driver
* get/set phy link settings
* interrupt pacing
* get phy id via ioctl cmd SIOCGMIIPHY
Changes from initial version
* Made active-slave common for cpts, ethtool and SIOCGMIIPHY ioctl
* Cleaned CPSW DT binding documentation by seperating slave nodes
under sub-section
* implemented get phy id via ioctl cmd SIOCGMIIPHY
Mugunthan V N (5):
documentation: dt: bindings: cpsw: cleanup documentation
drivers: net: ethernet: cpsw: change cpts_active_slave to
active_slave
driver: net: ethernet: cpsw: implement ethtool get/set phy setting
driver: net: ethernet: cpsw: implement interrupt pacing via ethtool
drivers: net: ethernet: cpsw: implement get phy_id via ioctl
Documentation/devicetree/bindings/net/cpsw.txt | 16 ++-
arch/arm/boot/dts/am33xx.dtsi | 2 +-
drivers/net/ethernet/ti/cpsw.c | 159 ++++++++++++++++++++++--
include/linux/platform_data/cpsw.h | 2 +-
4 files changed, 165 insertions(+), 14 deletions(-)
--
1.7.9.5
^ permalink raw reply
* Re: [PATCH net-next] flow_dissector: support L2 GRE
From: David Miller @ 2013-03-12 9:15 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, mwdalton
In-Reply-To: <1363020748.13690.3.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 11 Mar 2013 17:52:28 +0100
> From: Michael Dalton <mwdalton@google.com>
>
> Add support for L2 GRE tunnels, so that RPS can be more effective.
>
> Signed-off-by: Michael Dalton <mwdalton@google.com>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied.
^ permalink raw reply
* Re: Pull request: sfc-next 2013-03-11
From: David Miller @ 2013-03-12 9:15 UTC (permalink / raw)
To: bhutchings; +Cc: netdev, linux-net-drivers, scrum-linux, levans
In-Reply-To: <1363030400.2608.37.camel@bwh-desktop.uk.solarflarecom.com>
From: Ben Hutchings <bhutchings@solarflare.com>
Date: Mon, 11 Mar 2013 19:33:20 +0000
> git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc-next.git for-davem
>
> (commit 1648a23fa159e5c433aac06dc5e0d9db36146016)
>
> 1. Merge sfc changes (only) accepted for 3.9.
>
> 2. PTP improvements from Laurence Evans.
>
> 3. Overhaul of RX buffer management:
> - Always allocate pages, and enable scattering where possible
> - Fit as many buffers as will fit into a page, rather than limiting to 2
> - Introduce recycle rings to reduce the need for IOMMU mapping and
> unmapping
>
> 4. PCI error recovery (AER and EEH) implementation.
>
> 5. Fix a bug in RX filter replacement.
>
> 6. Fix configuration with 1 RX queue in the PF and multiple RX queues in
> VFs.
Pulled, thanks Ben.
^ permalink raw reply
* Re: [PATCH] mv643xx_eth: Fix a possible deadlock upon ifdown
From: Alexander Holler @ 2013-03-12 9:04 UTC (permalink / raw)
To: Lennert Buytenhek; +Cc: Lubomir Rintel, netdev, linux-kernel, Lubomir Rintel
In-Reply-To: <20130312024932.GF850@wantstofly.org>
Am 12.03.2013 03:49, schrieb Lennert Buytenhek:
> On Fri, Mar 01, 2013 at 06:30:13PM +0100, Alexander Holler wrote:
>
>>>> From: Lubomir Rintel <lubo.rintel@gooddata.com>
>>>>
>>>> =================================
>>>> [ INFO: inconsistent lock state ]
>>>> 3.7.0-6.luboskovo.fc19.armv5tel.kirkwood #1 Tainted: G W
>>>> ---------------------------------
>>>> inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage.
>>>> NetworkManager/337 [HC0[0]:SC0[0]:HE1:SE1] takes:
>>>> (_xmit_ETHER#2){+.?...}, at: [<bf07adfc>] txq_reclaim+0x54/0x264 [mv643xx_eth]
>>
>> I get the same annoying warning when the MTU gets changed (through dhcp).
>
> That is actually an issue.
>
I don't think so. Internally the driver calls mv643xx_eth_stop()
therefore lockdep issues almost the same warning as when the interface
is shut down (see below). And reading the code, I haven't seen how a
deadlock could happen. I just wanted to mention that it happens too,
when the MTU gets changed, in case someone else will see that warning
after enabling lockdep and wonders if it actually is a problem.
> It fixes a bug (the MTU change thing) and a non-bug (the lockdep
> warning) at the expense of slowing down the much more common path,
> and I don't like it for that reason.
I don't see how something important is slowed down. The patch only
affects code which is either used when the link goes down or when the
interface will be polled. I'm not sure where poll is used, but I believe
it is only used by netconsole, so nothing really important is slowed
down by the patch. At least if I understood everything correct. ;)
> Can you make a __txq_reclaim() which is basically txq_reclaim()
> without grabbing the tx queue lock, and then move the lock grabbing
> to the caller?
>
> E.g. make __txq_reclaim() have two callers, txq_reclaim() and
> txq_reclaim_bh(), and then use the appropriate wrapper depending on
> the context. (tx queue lock but no BH disable when called from
> mv643xx_eth_poll(), tx queue lock plus BH disable for MTU change,
> and no locking at all when called from ->ndo_stop(). Something
> like that.)
Hmm, I'm have to take a deep look at the driver to understand what you
mean (it's some days ago I've last did), but I will try. ;)
For completeness, below is the full output (when the MTU will be changed
and lockdep is enabled), I've just removed the dates to shorten it.
Regards,
Alexander
=================================
[ INFO: inconsistent lock state ]
3.8.1-dockstar-00023-g524f9cf #280 Not tainted
---------------------------------
inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage.
ip/1169 [HC0[0]:SC0[0]:HE1:SE1] takes:
(_xmit_ETHER#2){+.?...}, at: [<c0264f2c>] txq_reclaim+0x44/0x1c8
{IN-SOFTIRQ-W} state was registered at:
[<c00504c0>] __lock_acquire+0x5ac/0x17cc
[<c0051b54>] lock_acquire+0x64/0x78
[<c03656e0>] _raw_spin_lock+0x40/0x50
[<c0265764>] mv643xx_eth_poll+0x1e8/0x634
[<c02bfd54>] net_rx_action+0x9c/0x218
[<c001dc1c>] __do_softirq+0xb4/0x18c
[<c001e0b0>] irq_exit+0x54/0xb8
[<c00098ec>] handle_IRQ+0x64/0x84
[<c0008b98>] __irq_svc+0x38/0xa0
[<c00186e8>] console_unlock+0x194/0x398
[<c0019934>] register_console+0x294/0x36c
[<c04cc4ec>] init_netconsole+0x138/0x1d4
[<c0008480>] do_one_initcall+0x90/0x16c
[<c04b9858>] kernel_init_freeable+0xe8/0x1b0
[<c035ca40>] kernel_init+0x8/0xe4
[<c00090a8>] ret_from_fork+0x14/0x2c
irq event stamp: 3539
hardirqs last enabled at (3539): [<c0360d78>]
__slab_free.isra.53+0x1ac/0x2f8
hardirqs last disabled at (3538): [<c0360c98>]
__slab_free.isra.53+0xcc/0x2f8
softirqs last enabled at (3246): [<c0264d10>]
mib_counters_update+0x56c/0x58c
softirqs last disabled at (3244): [<c0365a48>] _raw_spin_lock_bh+0x14/0x5c
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
----
lock(_xmit_ETHER#2);
<Interrupt>
lock(_xmit_ETHER#2);
*** DEADLOCK ***
1 lock held by ip/1169:
#0: (rtnl_mutex){+.+.+.}, at: [<c02cfe50>] rtnetlink_rcv+0xc/0x24
stack backtrace:
[<c000d650>] (unwind_backtrace+0x0/0xe0) from [<c035ff90>]
(print_usage_bug.part.25+0x20c/0x26c)
[<c035ff90>] (print_usage_bug.part.25+0x20c/0x26c) from [<c004fd0c>]
(mark_lock+0x404/0x60c)
[<c004fd0c>] (mark_lock+0x404/0x60c) from [<c0050544>]
(__lock_acquire+0x630/0x17cc)
[<c0050544>] (__lock_acquire+0x630/0x17cc) from [<c0051b54>]
(lock_acquire+0x64/0x78)
[<c0051b54>] (lock_acquire+0x64/0x78) from [<c03656e0>]
(_raw_spin_lock+0x40/0x50)
[<c03656e0>] (_raw_spin_lock+0x40/0x50) from [<c0264f2c>]
(txq_reclaim+0x44/0x1c8)
[<c0264f2c>] (txq_reclaim+0x44/0x1c8) from [<c02650d8>]
(txq_deinit+0x28/0xc0)
[<c02650d8>] (txq_deinit+0x28/0xc0) from [<c0265284>]
(mv643xx_eth_stop+0x114/0x130)
[<c0265284>] (mv643xx_eth_stop+0x114/0x130) from [<c02672b0>]
(mv643xx_eth_change_mtu+0x4c/0x80)
[<c02672b0>] (mv643xx_eth_change_mtu+0x4c/0x80) from [<c02bf1e0>]
(dev_set_mtu+0x3c/0x70)
[<c02bf1e0>] (dev_set_mtu+0x3c/0x70) from [<c02d0148>]
(do_setlink+0x1ac/0x794)
[<c02d0148>] (do_setlink+0x1ac/0x794) from [<c02d1624>]
(rtnl_newlink+0x24c/0x438)
[<c02d1624>] (rtnl_newlink+0x24c/0x438) from [<c02d117c>]
(rtnetlink_rcv_msg+0x264/0x284)
[<c02d117c>] (rtnetlink_rcv_msg+0x264/0x284) from [<c02e36e4>]
(netlink_rcv_skb+0x50/0xac)
[<c02e36e4>] (netlink_rcv_skb+0x50/0xac) from [<c02cfe5c>]
(rtnetlink_rcv+0x18/0x24)
[<c02cfe5c>] (rtnetlink_rcv+0x18/0x24) from [<c02e30e8>]
(netlink_unicast+0x14c/0x1fc)
[<c02e30e8>] (netlink_unicast+0x14c/0x1fc) from [<c02e3518>]
(netlink_sendmsg+0x2e0/0x368)
[<c02e3518>] (netlink_sendmsg+0x2e0/0x368) from [<c02ab128>]
(sock_sendmsg+0x80/0x9c)
[<c02ab128>] (sock_sendmsg+0x80/0x9c) from [<c02ab418>]
(__sys_sendmsg+0x1c4/0x250)
[<c02ab418>] (__sys_sendmsg+0x1c4/0x250) from [<c02ad164>]
(sys_sendmsg+0x3c/0x60)
[<c02ad164>] (sys_sendmsg+0x3c/0x60) from [<c0009000>]
(ret_fast_syscall+0x0/0x38)
mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, full
duplex, flow control disabled
^ permalink raw reply
* Re: [PATCH] sh: remove references to CPU_SUBTYPE_SH7764
From: Paul Mundt @ 2013-03-12 7:57 UTC (permalink / raw)
To: Paul Bolle; +Cc: linux-sh, netdev, linux-kernel
In-Reply-To: <1363002940.3137.65.camel@x61.thuisdomein>
On Mon, Mar 11, 2013 at 12:55:40PM +0100, Paul Bolle wrote:
> Since release v2.6.29 the tree has a few references to the Kconfig
> symbol CPU_SUBTYPE_SH7764 and the Kconfig macro
> CONFIG_CPU_SUBTYPE_SH7764. But the actual symbol CPU_SUBTYPE_SH7764 was
> never added to the tree. Perhaps no one noticed because these references
> were never used alone. Anyhow, these references serve no purpose and
> can be removed.
>
> Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Looks fine, I suspect Iwamatsu-san let this trickle in from some vendor
branch given that these are all his drivers. I'll queue it up, thanks.
^ permalink raw reply
* [PATCH] ethernet: amd: use PTR_RET instead of IS_ERR + PTR_ERR
From: Silviu-Mihai Popescu @ 2013-03-12 7:48 UTC (permalink / raw)
To: netdev; +Cc: davem, geert, joe, dhowells, linux-kernel, Silviu-Mihai Popescu
This uses PTR_RET instead of IS_ERR and PTR_ERR in order to increase
readability.
Signed-off-by: Silviu-Mihai Popescu <silviupopescu1990@gmail.com>
---
drivers/net/ethernet/amd/atarilance.c | 4 +---
drivers/net/ethernet/amd/mvme147.c | 4 +---
drivers/net/ethernet/amd/ni65.c | 2 +-
drivers/net/ethernet/amd/sun3lance.c | 4 +---
4 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/amd/atarilance.c b/drivers/net/ethernet/amd/atarilance.c
index ab9bedb..e8d0ef5 100644
--- a/drivers/net/ethernet/amd/atarilance.c
+++ b/drivers/net/ethernet/amd/atarilance.c
@@ -1147,9 +1147,7 @@ static struct net_device *atarilance_dev;
static int __init atarilance_module_init(void)
{
atarilance_dev = atarilance_probe(-1);
- if (IS_ERR(atarilance_dev))
- return PTR_ERR(atarilance_dev);
- return 0;
+ return PTR_RET(atarilance_dev);
}
static void __exit atarilance_module_exit(void)
diff --git a/drivers/net/ethernet/amd/mvme147.c b/drivers/net/ethernet/amd/mvme147.c
index 9af3c30..a51497c 100644
--- a/drivers/net/ethernet/amd/mvme147.c
+++ b/drivers/net/ethernet/amd/mvme147.c
@@ -188,9 +188,7 @@ static struct net_device *dev_mvme147_lance;
int __init init_module(void)
{
dev_mvme147_lance = mvme147lance_probe(-1);
- if (IS_ERR(dev_mvme147_lance))
- return PTR_ERR(dev_mvme147_lance);
- return 0;
+ return PTR_RET(dev_mvme147_lance);
}
void __exit cleanup_module(void)
diff --git a/drivers/net/ethernet/amd/ni65.c b/drivers/net/ethernet/amd/ni65.c
index 013b651..26fc0ce 100644
--- a/drivers/net/ethernet/amd/ni65.c
+++ b/drivers/net/ethernet/amd/ni65.c
@@ -1238,7 +1238,7 @@ MODULE_PARM_DESC(dma, "ni6510 ISA DMA channel (ignored for some cards)");
int __init init_module(void)
{
dev_ni65 = ni65_probe(-1);
- return IS_ERR(dev_ni65) ? PTR_ERR(dev_ni65) : 0;
+ return PTR_RET(dev_ni65);
}
void __exit cleanup_module(void)
diff --git a/drivers/net/ethernet/amd/sun3lance.c b/drivers/net/ethernet/amd/sun3lance.c
index de412d3..4375abe 100644
--- a/drivers/net/ethernet/amd/sun3lance.c
+++ b/drivers/net/ethernet/amd/sun3lance.c
@@ -940,9 +940,7 @@ static struct net_device *sun3lance_dev;
int __init init_module(void)
{
sun3lance_dev = sun3lance_probe(-1);
- if (IS_ERR(sun3lance_dev))
- return PTR_ERR(sun3lance_dev);
- return 0;
+ return PTR_RET(sun3lance_dev);
}
void __exit cleanup_module(void)
--
1.7.9.5
^ permalink raw reply related
* Re: igb driver triggers BUILD_BUG_ON on s390
From: Heiko Carstens @ 2013-03-12 6:59 UTC (permalink / raw)
To: Alexander Duyck; +Cc: Jeff Kirsher, netdev, David S. Miller
In-Reply-To: <513DFC80.5000105@intel.com>
On Mon, Mar 11, 2013 at 08:47:12AM -0700, Alexander Duyck wrote:
> On 03/09/2013 02:00 AM, Heiko Carstens wrote:
> > git commit 74e238ead "igb: Support using build_skb in the case that
> > jumbo frames are disabled" added a BUILD_BUG_ON() to the igb drivers
> > which triggers on s390:
> >
> > drivers/net/ethernet/intel/igb/igb_main.c:6231:2:
> > error: call to ‘__compiletime_assert_6235’ declared with attribute error:
> > BUILD_BUG_ON failed: SKB_WITH_OVERHEAD(IGB_RX_BUFSZ) <
> > (NET_SKB_PAD + NET_IP_ALIGN + IGB_TS_HDR_LEN + ETH_FRAME_LEN + ETH_FCS_LEN)
> >
> > Any opinions?
> >
>
> A fix for this has already been submitted. As it turns out the
> BUILD_BUG_ON is mostly redundant anyway since we used a similar
> calculation to determine if we were going to enable the use of build_skb
> per ring.
Ok, thanks!
^ permalink raw reply
* Re: [PATCH net-next] net/core: move vlan_depth out of while loop in skb_network_protocol()
From: Eric Dumazet @ 2013-03-12 6:56 UTC (permalink / raw)
To: roy.qing.li; +Cc: netdev, Pravin B Shelar
In-Reply-To: <1363069844-10624-1-git-send-email-roy.qing.li@gmail.com>
On Tue, 2013-03-12 at 14:30 +0800, roy.qing.li@gmail.com wrote:
> From: Li RongQing <roy.qing.li@gmail.com>
>
> move vlan_depth out of while loop, or else vlan_depth always is ETH_HLEN,
> can not be increased, and lead to infinite loop when frame has two vlan headers.
>
> Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
> ---
> net/core/dev.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 90cee5b..35a6a6e 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -2211,9 +2211,9 @@ EXPORT_SYMBOL(skb_checksum_help);
> __be16 skb_network_protocol(struct sk_buff *skb)
> {
> __be16 type = skb->protocol;
> + int vlan_depth = ETH_HLEN;
>
> while (type == htons(ETH_P_8021Q)) {
> - int vlan_depth = ETH_HLEN;
> struct vlan_hdr *vh;
>
> if (unlikely(!pskb_may_pull(skb, vlan_depth + VLAN_HLEN)))
Nice catch, bug added in commit 05e8ef4ab2d8087d (net: factor out
skb_mac_gso_segment() from skb_gso_segment() )
So this is a patch for net tree, not for net-next.
Acked-by: Eric Dumazet <edumazet@google.com>
^ permalink raw reply
* [PATCH net-next] net/core: move vlan_depth out of while loop in skb_network_protocol()
From: roy.qing.li @ 2013-03-12 6:30 UTC (permalink / raw)
To: netdev
From: Li RongQing <roy.qing.li@gmail.com>
move vlan_depth out of while loop, or else vlan_depth always is ETH_HLEN,
can not be increased, and lead to infinite loop when frame has two vlan headers.
Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
---
net/core/dev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 90cee5b..35a6a6e 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2211,9 +2211,9 @@ EXPORT_SYMBOL(skb_checksum_help);
__be16 skb_network_protocol(struct sk_buff *skb)
{
__be16 type = skb->protocol;
+ int vlan_depth = ETH_HLEN;
while (type == htons(ETH_P_8021Q)) {
- int vlan_depth = ETH_HLEN;
struct vlan_hdr *vh;
if (unlikely(!pskb_may_pull(skb, vlan_depth + VLAN_HLEN)))
--
1.7.10.4
^ permalink raw reply related
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