* Re: [RFC PATCH 4/4] ARM: dts: am33xx: adopt to cpsw-phy-sel driver to configure phy mode
From: Sergei Shtylyov @ 2013-09-10 12:55 UTC (permalink / raw)
To: Mugunthan V N
Cc: netdev, zonque, davem, bcousson, tony, devicetree, linux-omap
In-Reply-To: <522D6DE7.5080305@ti.com>
Hello.
On 09-09-2013 10:42, Mugunthan V N wrote:
>>> Add DT entries for the phy mode selection in AM33xx SoC using
>>> cpsw-phy-sel
>>> driver.
>>> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
>>> ---
>>> arch/arm/boot/dts/am33xx.dtsi | 6 ++++++
>>> 1 file changed, 6 insertions(+)
>>> diff --git a/arch/arm/boot/dts/am33xx.dtsi
>>> b/arch/arm/boot/dts/am33xx.dtsi
>>> index f9c5da9..4359672 100644
>>> --- a/arch/arm/boot/dts/am33xx.dtsi
>>> +++ b/arch/arm/boot/dts/am33xx.dtsi
>>> @@ -594,6 +594,12 @@
>>> /* Filled in by U-Boot */
>>> mac-address = [ 00 00 00 00 00 00 ];
>>> };
>>> +
>>> + phy_sel: cpsw_phy_sel@44e10650 {
>> Dashes are preferred to uderscores in the device tree names.
> I tried with dashes but i get the below error.
> $ make CROSS_COMPILE=arm-linux-gnueabihf- ARCH=arm dtbs
> DTC arch/arm/boot/dts/am335x-evm.dtb
> Error: arch/arm/boot/dts/am33xx.dtsi:598.11-12 syntax error
> FATAL ERROR: Unable to parse input tree
> make[1]: *** [arch/arm/boot/dts/am335x-evm.dtb] Error 1
> make: *** [dtbs] Error 2
Hm, perhaps the dashes can't be used in the labels but I was talking of
the names. Dashes in the node names should be definitely valid.
> Regards
> Mugunthan V N
WBR, Sergei
^ permalink raw reply
* Userspace header linux/netlink.h uses GCC-specific 'typeof'
From: Thorben Hasenpusch @ 2013-09-10 12:51 UTC (permalink / raw)
To: netdev@vger.kernel.org
Compilation of a user space program which includes linux/netlink.h and
uses NL_MMAP_MSG_ALIGN fails if GCC is ordered not to use GNU
extensions.
__KERNEL_ALIGN is defined to use typeof which is a GCC-extension and not
supported by standard C/C++.
Can that be changed so standard conforming C/C++ compiles successfully?
Regards.
^ permalink raw reply
* Re: [PATCH net-next] net: sk_buff: memset(skb,0) after alloc in skb_clone
From: Eric Dumazet @ 2013-09-10 12:40 UTC (permalink / raw)
To: Govindarajulu Varadarajan; +Cc: davem, netdev
In-Reply-To: <1378788533-5609-1-git-send-email-govindarajulu90@gmail.com>
On Tue, 2013-09-10 at 10:18 +0530, Govindarajulu Varadarajan wrote:
> The following patch memset the skb to 0 after alloc. We do this in
> __alloc_skb_head, __alloc_skb, build_skb. We are missing this in
> skb_clone.
>
> The following call to __skb_clone in skb_clone does not copy all the
> members of sk_buff. If we donot clear the skb to 0, we will have some
> uninitialized members in new skb.
Which ones exactly ?
I would rather make sure all fields are properly copied.
Your patch is incomplete, because it doesn't handle the fast clone case.
^ permalink raw reply
* Re: TSQ accounting skb->truesize degrades throughput for large packets
From: Eric Dumazet @ 2013-09-10 12:35 UTC (permalink / raw)
To: Jason Wang
Cc: Zoltan Kiss, Wei Liu, Jonathan Davies, Ian Campbell, netdev,
xen-devel, Michael S. Tsirkin
In-Reply-To: <522ECE2B.7020409@redhat.com>
On Tue, 2013-09-10 at 15:45 +0800, Jason Wang wrote:
> For example, virtio-net will stop the tx queue when it finds the tx
> queue may full and enable the queue when some packets were sent. In this
> case, tsq works and throttles the total bytes queued in qdisc. This
> usually happen during heavy network load such as two sessions of netperf.
You told me skb were _orphaned_.
This automatically _disables_ TSQ, after packets leave Qdisc.
So you have a problem because your skb orphaning is only working when
packets leave Qdisc.
If you cant afford sockets being throttled, make sure you have no
Qdisc !
> We notice a regression, and bisect shows it was introduced by TSQ.
You do realize TSQ is a balance between throughput and latencies ?
In case of TSQ, it was very clear that limiting amount of outstanding
bytes in queues could have an impact on bandwidth.
Pushing Megabytes of TCP packets with identical TCP timestamps is
bad, because it prevents us doing delay based congestion control and
a single flow could fill the Qdisc with a thousand of packets.
(Self induced delays, see BufferBloat discussions)
One known problem in TCP stack is that sendmsg() locks the socket for
the duration of the call. sendpage() do not have this problem.
tcp_tsq_handler() is deferred if tcp_tasklet_func() finds a locked
socket. The owner of socket will call tcp_tsq_handler() when socket is
released.
So if you use sendmsg() with large buffers or if copyin data from user
land involves page faults, it may explain why you need larger number of
in-flight bytes to sustain a given throughput.
You could take a look at commit c9bee3b7fdecb0c1d070c
("tcp: TCP_NOTSENT_LOWAT socket option"), and play
with /proc/sys/net/ipv4/tcp_notsent_lowat, to force sendmsg() to release
the socket lock every hundreds of kbytes.
^ permalink raw reply
* [PATCH 4/7] ptp: switch to use gpiolib
From: Linus Walleij @ 2013-09-10 12:31 UTC (permalink / raw)
To: linux-gpio, Imre Kaloz, Krzysztof Halasa, Richard Cochran
Cc: Alexandre Courbot, linux-arm-kernel, Linus Walleij, netdev
This platform supports gpiolib, so remove the custom API use
and replace with calls to gpiolib. Also request the GPIO before
starting to use it.
Cc: Imre Kaloz <kaloz@openwrt.org>
Cc: Krzysztof Halasa <khc@pm.waw.pl>
Cc: Alexandre Courbot <acourbot@nvidia.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: netdev@vger.kernel.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
Hi Richard, I'm seeking an ACK on this patch to take it throug
the GPIO tree as part of a clean-out of custom GPIO implementations.
---
drivers/ptp/ptp_ixp46x.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/ptp/ptp_ixp46x.c b/drivers/ptp/ptp_ixp46x.c
index d49b851..4a08727 100644
--- a/drivers/ptp/ptp_ixp46x.c
+++ b/drivers/ptp/ptp_ixp46x.c
@@ -259,8 +259,15 @@ static struct ixp_clock ixp_clock;
static int setup_interrupt(int gpio)
{
int irq;
+ int err;
- gpio_line_config(gpio, IXP4XX_GPIO_IN);
+ err = gpio_request(gpio, "ixp4-ptp");
+ if (err)
+ return err;
+
+ err = gpio_direction_input(gpio);
+ if (err)
+ return err;
irq = gpio_to_irq(gpio);
--
1.8.3.1
^ permalink raw reply related
* Re: [PATCH 1/1] sfc: Staticize efx_ef10_filter_update_rx_scatter
From: Ben Hutchings @ 2013-09-10 12:08 UTC (permalink / raw)
To: Sachin Kamat; +Cc: netdev, linux-net-drivers
In-Reply-To: <1378806567-30625-1-git-send-email-sachin.kamat@linaro.org>
On Tue, 2013-09-10 at 15:19 +0530, Sachin Kamat wrote:
> 'efx_ef10_filter_update_rx_scatter' is used only in this file.
> Make it static.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
> drivers/net/ethernet/sfc/ef10.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c
> index 5f42313..6956bd2 100644
> --- a/drivers/net/ethernet/sfc/ef10.c
> +++ b/drivers/net/ethernet/sfc/ef10.c
> @@ -2121,7 +2121,7 @@ out_unlock:
> return rc;
> }
>
> -void efx_ef10_filter_update_rx_scatter(struct efx_nic *efx)
> +static void efx_ef10_filter_update_rx_scatter(struct efx_nic *efx)
> {
> /* no need to do anything here on EF10 */
> }
Same for this.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH 1/1] sfc: Staticize efx_ethtool_get_ts_info
From: Ben Hutchings @ 2013-09-10 12:08 UTC (permalink / raw)
To: Sachin Kamat; +Cc: netdev, linux-net-drivers
In-Reply-To: <1378806210-12155-1-git-send-email-sachin.kamat@linaro.org>
On Tue, 2013-09-10 at 15:13 +0530, Sachin Kamat wrote:
> 'efx_ethtool_get_ts_info' is used only in this file.
> Make it static.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
> drivers/net/ethernet/sfc/ethtool.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/sfc/ethtool.c b/drivers/net/ethernet/sfc/ethtool.c
> index 5b471cf..c8dc407 100644
> --- a/drivers/net/ethernet/sfc/ethtool.c
> +++ b/drivers/net/ethernet/sfc/ethtool.c
> @@ -1035,8 +1035,8 @@ static int efx_ethtool_set_rxfh_indir(struct net_device *net_dev,
> return 0;
> }
>
> -int efx_ethtool_get_ts_info(struct net_device *net_dev,
> - struct ethtool_ts_info *ts_info)
> +static int efx_ethtool_get_ts_info(struct net_device *net_dev,
> + struct ethtool_ts_info *ts_info)
> {
> struct efx_nic *efx = netdev_priv(net_dev);
>
I already have this fix, but net-next is not open for changes.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Update to RFC793's TCP sequence number validation checks
From: Fernando Gont @ 2013-09-10 11:00 UTC (permalink / raw)
To: netdev
Folks,
Dave Borman and me have posted an IETF Internet-Draft
(<http://tools.ietf.org/id/draft-gont-tcpm-tcp-seq-validation-01.txt>)
that fixes an existing bug in the RFC 793 TCP sequence number validation
checks.
The proposed fix has been implemented in open source stacks for many
years, so we're essentially updating the specs accordingly.
The IETF's TCPM working group chairs wanted to to some reviews of this
(very short) Internet-Draft before it is adopted as a working group item.
If you have a few minutes, please take a look, and post your
comments/review to <tcpm@ietf.org> (and make sure to CC me). This will
be of much help, and having feedback from the implementers' community
would be really valuable.
Thanks!
Best regards,
--
Fernando Gont
SI6 Networks
e-mail: fgont@si6networks.com
PGP Fingerprint: 6666 31C6 D484 63B2 8FB1 E3C4 AE25 0D55 1D4E 7492
^ permalink raw reply
* copyright in net/usb/ax188179_178a.c
From: David Laight @ 2013-09-10 11:16 UTC (permalink / raw)
To: netdev
The copyright at the top of net/usb/ax188179_178a.c just says
Copyright (C) 2011-2113 ASIX
However a lot of the code comes from the earlier driver
so the earlier copyrights should have been copied over.
(Unless it can be determined that all the changes related
to one of the copyrights have not been carried forwards.)
David
^ permalink raw reply
* Re: [PATCH net-next 0/26] bonding: use neighbours instead of own lists
From: Ding Tianhong @ 2013-09-10 11:08 UTC (permalink / raw)
To: Veaceslav Falico
Cc: netdev, jiri, Jay Vosburgh, Andy Gospodarek, Dimitris Michailidis,
David S. Miller, Patrick McHardy, Eric Dumazet, Alexander Duyck
In-Reply-To: <1378757804-3159-1-git-send-email-vfalico@redhat.com>
On 2013/9/10 4:16, Veaceslav Falico wrote:
> (David, feel free to drop the whole patchset - I know that the window is
> closed and I'm quite sure that it's not the last version, and even if it is
> - I'll easily re-submit it. Sorry for the mess :-/)
>
> Hi,
>
> RFC -> v1:
> I've added proper, consistent naming for all variables/functions, uninlined
> some helpers to get better backtraces, just in case (overhead is minimal,
> no hot paths), rearranged patches for better review, dropped bondings
> ->prev and bond_for_each_slave_continue() functionality - to be able to
> RCUify it easier, and renamed slave_* sysfs links to lower_* sysfs links to
> maintain upper/lower naming. I've also dropped, thanks to bonding cleanup,
> some heavy and ugly/intrusive patches.
>
> I'm sending it as early as possible, because it's quite a big patchset and
> some of the approaches I've chosen are not really easy/straightforward.
> It's, however, quite heavily tested already and works fine.
>
> I'm sending it to gather any feedback possible.
>
> This patchset introduces all the needed infrastructure, on top of current
> adjacent lists, to be able to remove bond's slave_list/slave->list. The
> overhead in memory/CPU is minimal, and after the patchset bonding can rely
> on its slave-related functions, given the proper locking. I've done some
> netperf benchmarks on a vm, and the delta was about 0.1gbps for 35gbps as a
> whole, so no speed fluctuations.
>
> It also automatically creates lower/upper and master symlinks in dev's
> sysfs directory.
reviewed, and can't found any problem till now, but it is a big changes,
and I could not sure whether it is the trend of the future for net device,
I'll wait and see everyone's opinion.
Best Regards
Ding
> .
>
^ permalink raw reply
* [PATCH net 4/4] bridge: Fix updating FDB entries when the PVID is applied
From: Toshiaki Makita @ 2013-09-10 10:39 UTC (permalink / raw)
To: David S. Miller, Vlad Yasevich, netdev; +Cc: Toshiaki Makita
In-Reply-To: <1378808874.3988.2.camel@ubuntu-vm-makita>
We currently set the value that variable vid pointing, which will be used
in FDB later, to 0 at br_allowed_ingress() when we receive untagged or
priority-tagged frames, even though the PVID is valid.
This leads to FDB updates in such a wrong way that they are learned with
VID 0.
Update the value to that of PVID if the PVID is applied.
Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
---
net/bridge/br_vlan.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c
index 5a9c44a..53f0990 100644
--- a/net/bridge/br_vlan.c
+++ b/net/bridge/br_vlan.c
@@ -217,6 +217,7 @@ bool br_allowed_ingress(struct net_bridge *br, struct net_port_vlans *v,
/* PVID is set on this port. Any untagged or priority-tagged
* ingress frame is considered to belong to this vlan.
*/
+ *vid = pvid;
if (likely(err))
/* Untagged Frame. */
__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), pvid);
--
1.8.1.2
^ permalink raw reply related
* [PATCH net 3/4] bridge: Fix the way the PVID is referenced
From: Toshiaki Makita @ 2013-09-10 10:37 UTC (permalink / raw)
To: David S. Miller, Vlad Yasevich, netdev; +Cc: Toshiaki Makita
In-Reply-To: <1378808874.3988.2.camel@ubuntu-vm-makita>
We are using the VLAN_TAG_PRESENT bit to detect whether the PVID is
set or not at br_get_pvid(), while we don't care about the bit in
adding/deleting the PVID, which makes it impossible to forward any
incomming untagged frame with vlan_filtering enabled.
Since vid 0 cannot be used for the PVID, we can use vid 0 to indicate
that the PVID is not set, which is slightly more efficient than using
the VLAN_TAG_PRESENT.
Fix the problem by getting rid of using the VLAN_TAG_PRESENT.
Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
---
net/bridge/br_private.h | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index 598cb0b..435ca4d 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -646,9 +646,7 @@ static inline u16 br_get_pvid(const struct net_port_vlans *v)
* vid wasn't set
*/
smp_rmb();
- return (v->pvid & VLAN_TAG_PRESENT) ?
- (v->pvid & ~VLAN_TAG_PRESENT) :
- VLAN_N_VID;
+ return v->pvid ?: VLAN_N_VID;
}
#else
--
1.8.1.2
^ permalink raw reply related
* [PATCH net 2/4] bridge: Handle priority-tagged frames properly
From: Toshiaki Makita @ 2013-09-10 10:34 UTC (permalink / raw)
To: David S. Miller, Vlad Yasevich, netdev; +Cc: Toshiaki Makita
In-Reply-To: <1378808874.3988.2.camel@ubuntu-vm-makita>
IEEE 802.1Q says that when we receive priority-tagged (VID 0) frames
use the PVID for the port as its VID.
(See IEEE 802.1Q-2005 6.7.1 and Table 9-2)
Apply the PVID to not only untagged frames but also priority-tagged frames.
Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
---
net/bridge/br_vlan.c | 27 ++++++++++++++++++++-------
1 file changed, 20 insertions(+), 7 deletions(-)
diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c
index 21b6d21..5a9c44a 100644
--- a/net/bridge/br_vlan.c
+++ b/net/bridge/br_vlan.c
@@ -189,6 +189,8 @@ out:
bool br_allowed_ingress(struct net_bridge *br, struct net_port_vlans *v,
struct sk_buff *skb, u16 *vid)
{
+ int err;
+
/* If VLAN filtering is disabled on the bridge, all packets are
* permitted.
*/
@@ -201,20 +203,31 @@ bool br_allowed_ingress(struct net_bridge *br, struct net_port_vlans *v,
if (!v)
return false;
- if (br_vlan_get_tag(skb, vid)) {
+ err = br_vlan_get_tag(skb, vid);
+ if (!*vid) {
u16 pvid = br_get_pvid(v);
- /* Frame did not have a tag. See if pvid is set
- * on this port. That tells us which vlan untagged
- * traffic belongs to.
+ /* Frame had a tag with VID 0 or did not have a tag.
+ * See if pvid is set on this port. That tells us which
+ * vlan untagged or priority-tagged traffic belongs to.
*/
if (pvid == VLAN_N_VID)
return false;
- /* PVID is set on this port. Any untagged ingress
- * frame is considered to belong to this vlan.
+ /* PVID is set on this port. Any untagged or priority-tagged
+ * ingress frame is considered to belong to this vlan.
*/
- __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), pvid);
+ if (likely(err))
+ /* Untagged Frame. */
+ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), pvid);
+ else
+ /* Priority-tagged Frame.
+ * At this point, We know that skb->vlan_tci had
+ * VLAN_TAG_PRESENT bit and its VID field was 0x000.
+ * We update only VID field and preserve PCP field.
+ */
+ skb->vlan_tci |= pvid;
+
return true;
}
--
1.8.1.2
^ permalink raw reply related
* [PATCH net 1/4] bridge: Don't use VID 0 and 4095 in vlan filtering
From: Toshiaki Makita @ 2013-09-10 10:32 UTC (permalink / raw)
To: David S. Miller, Vlad Yasevich, netdev; +Cc: Toshiaki Makita
In-Reply-To: <1378808874.3988.2.camel@ubuntu-vm-makita>
IEEE 802.1Q says that:
- VID 0 shall not be configured as a PVID, or configured in any Filtering
Database entry.
- VID 4095 shall not be configured as a PVID, or transmitted in a tag
header. This VID value may be used to indicate a wildcard match for the VID
in management operations or Filtering Database entries.
(See IEEE 802.1Q-2005 6.7.1 and Table 9-2)
Don't accept adding these VIDs in the vlan_filtering implementation.
Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
---
net/bridge/br_fdb.c | 4 +-
net/bridge/br_netlink.c | 2 +-
net/bridge/br_vlan.c | 97 +++++++++++++++++++++++--------------------------
3 files changed, 49 insertions(+), 54 deletions(-)
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index ffd5874..33e8f23 100644
--- a/net/bridge/br_fdb.c
+++ b/net/bridge/br_fdb.c
@@ -700,7 +700,7 @@ int br_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
vid = nla_get_u16(tb[NDA_VLAN]);
- if (vid >= VLAN_N_VID) {
+ if (!vid || vid >= VLAN_VID_MASK) {
pr_info("bridge: RTM_NEWNEIGH with invalid vlan id %d\n",
vid);
return -EINVAL;
@@ -794,7 +794,7 @@ int br_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[],
vid = nla_get_u16(tb[NDA_VLAN]);
- if (vid >= VLAN_N_VID) {
+ if (!vid || vid >= VLAN_VID_MASK) {
pr_info("bridge: RTM_NEWNEIGH with invalid vlan id %d\n",
vid);
return -EINVAL;
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index b9259ef..9bac61e 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -243,7 +243,7 @@ static int br_afspec(struct net_bridge *br,
vinfo = nla_data(tb[IFLA_BRIDGE_VLAN_INFO]);
- if (vinfo->vid >= VLAN_N_VID)
+ if (!vinfo->vid || vinfo->vid >= VLAN_VID_MASK)
return -EINVAL;
switch (cmd) {
diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c
index 9a9ffe7..21b6d21 100644
--- a/net/bridge/br_vlan.c
+++ b/net/bridge/br_vlan.c
@@ -45,37 +45,34 @@ static int __vlan_add(struct net_port_vlans *v, u16 vid, u16 flags)
return 0;
}
- if (vid) {
- if (v->port_idx) {
- p = v->parent.port;
- br = p->br;
- dev = p->dev;
- } else {
- br = v->parent.br;
- dev = br->dev;
- }
- ops = dev->netdev_ops;
-
- if (p && (dev->features & NETIF_F_HW_VLAN_CTAG_FILTER)) {
- /* Add VLAN to the device filter if it is supported.
- * Stricly speaking, this is not necessary now, since
- * devices are made promiscuous by the bridge, but if
- * that ever changes this code will allow tagged
- * traffic to enter the bridge.
- */
- err = ops->ndo_vlan_rx_add_vid(dev, htons(ETH_P_8021Q),
- vid);
- if (err)
- return err;
- }
-
- err = br_fdb_insert(br, p, dev->dev_addr, vid);
- if (err) {
- br_err(br, "failed insert local address into bridge "
- "forwarding table\n");
- goto out_filt;
- }
+ if (v->port_idx) {
+ p = v->parent.port;
+ br = p->br;
+ dev = p->dev;
+ } else {
+ br = v->parent.br;
+ dev = br->dev;
+ }
+ ops = dev->netdev_ops;
+
+ if (p && (dev->features & NETIF_F_HW_VLAN_CTAG_FILTER)) {
+ /* Add VLAN to the device filter if it is supported.
+ * Stricly speaking, this is not necessary now, since
+ * devices are made promiscuous by the bridge, but if
+ * that ever changes this code will allow tagged
+ * traffic to enter the bridge.
+ */
+ err = ops->ndo_vlan_rx_add_vid(dev, htons(ETH_P_8021Q),
+ vid);
+ if (err)
+ return err;
+ }
+ err = br_fdb_insert(br, p, dev->dev_addr, vid);
+ if (err) {
+ br_err(br, "failed insert local address into bridge "
+ "forwarding table\n");
+ goto out_filt;
}
set_bit(vid, v->vlan_bitmap);
@@ -98,7 +95,7 @@ static int __vlan_del(struct net_port_vlans *v, u16 vid)
__vlan_delete_pvid(v, vid);
clear_bit(vid, v->untagged_bitmap);
- if (v->port_idx && vid) {
+ if (v->port_idx) {
struct net_device *dev = v->parent.port->dev;
const struct net_device_ops *ops = dev->netdev_ops;
@@ -248,7 +245,9 @@ bool br_allowed_egress(struct net_bridge *br,
return false;
}
-/* Must be protected by RTNL */
+/* Must be protected by RTNL.
+ * Must be called with vid in range from 1 to 4094 inclusive.
+ */
int br_vlan_add(struct net_bridge *br, u16 vid, u16 flags)
{
struct net_port_vlans *pv = NULL;
@@ -278,7 +277,9 @@ out:
return err;
}
-/* Must be protected by RTNL */
+/* Must be protected by RTNL.
+ * Must be called with vid in range from 1 to 4094 inclusive.
+ */
int br_vlan_delete(struct net_bridge *br, u16 vid)
{
struct net_port_vlans *pv;
@@ -289,14 +290,9 @@ int br_vlan_delete(struct net_bridge *br, u16 vid)
if (!pv)
return -EINVAL;
- if (vid) {
- /* If the VID !=0 remove fdb for this vid. VID 0 is special
- * in that it's the default and is always there in the fdb.
- */
- spin_lock_bh(&br->hash_lock);
- fdb_delete_by_addr(br, br->dev->dev_addr, vid);
- spin_unlock_bh(&br->hash_lock);
- }
+ spin_lock_bh(&br->hash_lock);
+ fdb_delete_by_addr(br, br->dev->dev_addr, vid);
+ spin_unlock_bh(&br->hash_lock);
__vlan_del(pv, vid);
return 0;
@@ -329,7 +325,9 @@ unlock:
return 0;
}
-/* Must be protected by RTNL */
+/* Must be protected by RTNL.
+ * Must be called with vid in range from 1 to 4094 inclusive.
+ */
int nbp_vlan_add(struct net_bridge_port *port, u16 vid, u16 flags)
{
struct net_port_vlans *pv = NULL;
@@ -363,7 +361,9 @@ clean_up:
return err;
}
-/* Must be protected by RTNL */
+/* Must be protected by RTNL.
+ * Must be called with vid in range from 1 to 4094 inclusive.
+ */
int nbp_vlan_delete(struct net_bridge_port *port, u16 vid)
{
struct net_port_vlans *pv;
@@ -374,14 +374,9 @@ int nbp_vlan_delete(struct net_bridge_port *port, u16 vid)
if (!pv)
return -EINVAL;
- if (vid) {
- /* If the VID !=0 remove fdb for this vid. VID 0 is special
- * in that it's the default and is always there in the fdb.
- */
- spin_lock_bh(&port->br->hash_lock);
- fdb_delete_by_addr(port->br, port->dev->dev_addr, vid);
- spin_unlock_bh(&port->br->hash_lock);
- }
+ spin_lock_bh(&port->br->hash_lock);
+ fdb_delete_by_addr(port->br, port->dev->dev_addr, vid);
+ spin_unlock_bh(&port->br->hash_lock);
return __vlan_del(pv, vid);
}
--
1.8.1.2
^ permalink raw reply related
* [PATCH net 0/4] bridge: Fix problems around the PVID
From: Toshiaki Makita @ 2013-09-10 10:27 UTC (permalink / raw)
To: David S. Miller, Vlad Yasevich, netdev; +Cc: Toshiaki Makita
There seem to be some undesirable behaviors related with PVID.
1. It has no effect assigning PVID to a port. PVID cannot be applied
to any frame regardless of whether we set it or not.
2. FDB entries learned via frames applied PVID are registered with
VID 0 rather than VID value of PVID.
3. We can set 0 or 4095 as a PVID that are not allowed in IEEE 802.1Q.
This leads interoperational problems such as sending frames with VID
4095, which is not allowed in IEEE 802.1Q, and treating frames with VID
0 as they belong to VLAN 0, which is expected to be handled as they have
no VID according to IEEE 802.1Q.
Note: 2nd and 3rd problems are potential and not exposed unless 1st problem
is fixed, because we cannot activate PVID due to it.
This is my analysis for each behavior.
1. We are using VLAN_TAG_PRESENT bit when getting PVID, and not when
adding/deleting PVID.
It can be fixed in either way using or not using VLAN_TAG_PRESENT,
but I think the latter is slightly more efficient.
2. We are setting skb->vlan_tci with the value of PVID but the variable
vid, which is used in FDB later, is set to 0 at br_allowed_ingress()
when untagged frames arrive at a port with PVID valid. I'm afraid that
vid should be updated to the value of PVID if PVID is valid.
3. According to IEEE 802.1Q-2005 (6.7.1 and Table 9-2), we cannot use
VID 0 or 4095 as a PVID.
It looks like that there are more stuff to consider.
- VID 0:
VID 0 shall not be configured in any FDB entry and used in a tag header
to indicate it is a 802.1p priority-tagged frame.
Priority-tagged frames should be applied PVID (from IEEE 802.1Q 6.7.1).
In my opinion, since we can filter incomming priority-tagged frames by
deleting PVID, we don't need to filter them by vlan_bitmap.
In other words, priority-tagged frames don't have VID 0 but have no VID,
which is the same as untagged frames, and should be filtered by unsetting
PVID.
So, not only we cannot set PVID as 0, but also we don't need to add 0 to
vlan_bitmap, which enable us to simply forbid to add vlan 0.
- VID 4095:
VID 4095 shall not be transmitted in a tag header. This VID value may be
used to indicate a wildcard match for the VID in management operations or
FDB entries (from IEEE 802.1Q Table 9-2).
In current implementation, we can create a static FDB entry with all
existing VIDs by not specifying any VID when creating it.
I don't think this way to add wildcard-like entries needs to change,
and VID 4095 looks no use and can be unacceptable to add.
Consequently, I believe what we should do for 3rd problem is below:
- Not allowing VID 0 and 4095 to be added.
- Applying PVID to priority-tagged (VID 0) frames.
Patch set follows this mail.
The order of patches is not the same as described above, because the way
to fix 1st problem is based on the assumption that we don't use VID 0 as
a PVID, which is realized by fixing 3rd problem.
(1/4)(2/4): Fix 3rd problem.
(3/4): Fix 1st problem.
(4/4): Fix 2nd probelm.
If something wrong or any misunderstanding is found, please comment.
If another way to fix is better such as using VLAN_TAG_PRESENT, I can
submit modified patches.
Thanks,
Toshiaki Makita
Toshiaki Makita (4):
bridge: Don't use VID 0 and 4095 in vlan filtering
bridge: Handle priority-tagged frames properly
bridge: Fix the way the PVID is referenced
bridge: Fix updating FDB entries when the PVID is applied
net/bridge/br_fdb.c | 4 +-
net/bridge/br_netlink.c | 2 +-
net/bridge/br_private.h | 4 +-
net/bridge/br_vlan.c | 125 ++++++++++++++++++++++++++----------------------
4 files changed, 71 insertions(+), 64 deletions(-)
--
1.8.1.2
^ permalink raw reply
* [PATCH 1/1] sfc: Staticize efx_ef10_filter_update_rx_scatter
From: Sachin Kamat @ 2013-09-10 9:49 UTC (permalink / raw)
To: netdev; +Cc: bhutchings, linux-net-drivers, sachin.kamat
'efx_ef10_filter_update_rx_scatter' is used only in this file.
Make it static.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
drivers/net/ethernet/sfc/ef10.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c
index 5f42313..6956bd2 100644
--- a/drivers/net/ethernet/sfc/ef10.c
+++ b/drivers/net/ethernet/sfc/ef10.c
@@ -2121,7 +2121,7 @@ out_unlock:
return rc;
}
-void efx_ef10_filter_update_rx_scatter(struct efx_nic *efx)
+static void efx_ef10_filter_update_rx_scatter(struct efx_nic *efx)
{
/* no need to do anything here on EF10 */
}
--
1.7.9.5
^ permalink raw reply related
* [PATCH 1/1] sfc: Staticize efx_ethtool_get_ts_info
From: Sachin Kamat @ 2013-09-10 9:43 UTC (permalink / raw)
To: netdev; +Cc: bhutchings, linux-net-drivers, sachin.kamat
'efx_ethtool_get_ts_info' is used only in this file.
Make it static.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
drivers/net/ethernet/sfc/ethtool.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/sfc/ethtool.c b/drivers/net/ethernet/sfc/ethtool.c
index 5b471cf..c8dc407 100644
--- a/drivers/net/ethernet/sfc/ethtool.c
+++ b/drivers/net/ethernet/sfc/ethtool.c
@@ -1035,8 +1035,8 @@ static int efx_ethtool_set_rxfh_indir(struct net_device *net_dev,
return 0;
}
-int efx_ethtool_get_ts_info(struct net_device *net_dev,
- struct ethtool_ts_info *ts_info)
+static int efx_ethtool_get_ts_info(struct net_device *net_dev,
+ struct ethtool_ts_info *ts_info)
{
struct efx_nic *efx = netdev_priv(net_dev);
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH 1/1] net: bnx2x: Staticize local symbols
From: Sachin Kamat @ 2013-09-10 9:35 UTC (permalink / raw)
To: Ariel Elior; +Cc: netdev@vger.kernel.org, davem@davemloft.net, Eilon Greenstein
In-Reply-To: <6AE768456CEC4B4A9B2248CB6B87EB3E1BEE8FD8@SJEXCHMB05.corp.ad.broadcom.com>
On 10 September 2013 13:53, Ariel Elior <ariele@broadcom.com> wrote:
>> -----Original Message-----
>> From: netdev-owner@vger.kernel.org [mailto:netdev-
>> owner@vger.kernel.org] On Behalf Of Sachin Kamat
>> Sent: Tuesday, September 10, 2013 9:43 AM
>> To: netdev@vger.kernel.org
>> Cc: davem@davemloft.net; Eilon Greenstein; sachin.kamat@linaro.org
>> Subject: [PATCH 1/1] net: bnx2x: Staticize local symbols
>>
>> -int bnx2x_vf_ndo_prep(struct bnx2x *bp, int vfidx, struct bnx2x_virtf **vf,
>> +static int
> I don't like this form. Better to put the last variable in the next line.
OK. Will change it.
>
> Thanks for suggesting the fix.
> Not sure this is appropriate for net though...
Sorry, did not get this. Please elaborate.
--
With warm regards,
Sachin
^ permalink raw reply
* [PATCH] net: fec: fix phy reset operation to let imx6sl evk work
From: Fugang Duan @ 2013-09-10 9:07 UTC (permalink / raw)
To: shawn.guo, davem; +Cc: netdev, bhutchings, stephen, b20596, s.hauer, b38611
The patch do correct phy reset operation to let imx6sl evk
ethernet work.
Current driver only do phy reset in probe function, which is
not right. Since some phy clock is disabled after module probe,
the phy enter abnormal status, which needs do reset to recovery
the phy. And do ifconfig ethx up/down test, the phy also enter
abnormal status.
The log as:
libphy: 2188000.ethernet:04 - Link is Up - 10/Full
libphy: 2188000.ethernet:04 - Link is Up - 100/Full
libphy: 2188000.ethernet:04 - Link is Down
libphy: 2188000.ethernet:04 - Link is Up - 10/Half
libphy: 2188000.ethernet:04 - Link is Up - 10/Full
libphy: 2188000.ethernet:04 - Link is Up - 100/Full
...
So, do phy reset if ethx up/down or clock enable/disable.
Signed-off-by: Fugang Duan <B38611@freescale.com>
Reviewed-by: Shawn Guo <R65073@freescale.com>
CC: Shawn Guo <shawn.guo@linaro.org>
CC: Li Frank <B20596@freescale.com>
CC: "David S. Miller" <davem@davemloft.net>
---
drivers/net/ethernet/freescale/fec.h | 3 +
drivers/net/ethernet/freescale/fec_main.c | 59 +++++++++++++++++-----------
2 files changed, 39 insertions(+), 23 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h
index 0120217..473d5fb 100644
--- a/drivers/net/ethernet/freescale/fec.h
+++ b/drivers/net/ethernet/freescale/fec.h
@@ -321,6 +321,9 @@ struct fec_enet_private {
struct napi_struct napi;
int csum_flags;
+ int phy_reset_gpio;
+ int reset_duration;
+
struct ptp_clock *ptp_clock;
struct ptp_clock_info ptp_caps;
unsigned long last_overflow_check;
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index f9aacf5..0c17df2 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -61,6 +61,7 @@
#include "fec.h"
static void set_multicast_list(struct net_device *ndev);
+static void fec_enet_reset_phy(struct platform_device *pdev);
#if defined(CONFIG_ARM)
#define FEC_ALIGNMENT 0xf
@@ -1780,6 +1781,10 @@ fec_enet_open(struct net_device *ndev)
phy_start(fep->phy_dev);
netif_start_queue(ndev);
fep->opened = 1;
+
+ /* reset phy */
+ fec_enet_reset_phy(fep->pdev);
+
return 0;
}
@@ -2029,43 +2034,52 @@ static int fec_enet_init(struct net_device *ndev)
return 0;
}
-#ifdef CONFIG_OF
-static void fec_reset_phy(struct platform_device *pdev)
+static void fec_enet_of_init(struct platform_device *pdev)
{
- int err, phy_reset;
- int msec = 1;
struct device_node *np = pdev->dev.of_node;
+ struct net_device *ndev = platform_get_drvdata(pdev);
+ struct fec_enet_private *fep = netdev_priv(ndev);
+ int err;
+
+ /*
+ * init phy-reset-gpio to one invalid GPIO for no phy
+ * gpio reset platform
+ */
+ fep->phy_reset_gpio = -1;
if (!np)
return;
- of_property_read_u32(np, "phy-reset-duration", &msec);
+ of_property_read_u32(np, "phy-reset-duration",
+ &fep->reset_duration);
/* A sane reset duration should not be longer than 1s */
- if (msec > 1000)
- msec = 1;
+ if ((fep->reset_duration > 1000) || (fep->reset_duration == 0))
+ fep->reset_duration = 1;
- phy_reset = of_get_named_gpio(np, "phy-reset-gpios", 0);
- if (!gpio_is_valid(phy_reset))
+ fep->phy_reset_gpio = of_get_named_gpio(np, "phy-reset-gpios", 0);
+ if (!gpio_is_valid(fep->phy_reset_gpio))
return;
- err = devm_gpio_request_one(&pdev->dev, phy_reset,
- GPIOF_OUT_INIT_LOW, "phy-reset");
+ err = devm_gpio_request_one(&pdev->dev, fep->phy_reset_gpio,
+ GPIOF_OUT_INIT_HIGH, "phy-reset");
if (err) {
dev_err(&pdev->dev, "failed to get phy-reset-gpios: %d\n", err);
- return;
+ fep->phy_reset_gpio = -1;
}
- msleep(msec);
- gpio_set_value(phy_reset, 1);
}
-#else /* CONFIG_OF */
-static void fec_reset_phy(struct platform_device *pdev)
+
+static void fec_enet_reset_phy(struct platform_device *pdev)
{
- /*
- * In case of platform probe, the reset has been done
- * by machine code.
- */
+ struct net_device *ndev = platform_get_drvdata(pdev);
+ struct fec_enet_private *fep = netdev_priv(ndev);
+
+ /* check GPIO valid to avoid kernel print warning when no gpio reset */
+ if (gpio_is_valid(fep->phy_reset_gpio)) {
+ gpio_set_value(fep->phy_reset_gpio, 0);
+ msleep(fep->reset_duration);
+ gpio_set_value(fep->phy_reset_gpio, 1);
+ }
}
-#endif /* CONFIG_OF */
static int
fec_probe(struct platform_device *pdev)
@@ -2113,6 +2127,7 @@ fec_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, ndev);
+ fec_enet_of_init(pdev);
ret = of_get_phy_mode(pdev->dev.of_node);
if (ret < 0) {
pdata = dev_get_platdata(&pdev->dev);
@@ -2181,8 +2196,6 @@ fec_probe(struct platform_device *pdev)
fep->reg_phy = NULL;
}
- fec_reset_phy(pdev);
-
if (fep->bufdesc_ex)
fec_ptp_init(pdev);
--
1.7.1
^ permalink raw reply related
* RE: [PATCH 1/1] net: bnx2x: Staticize local symbols
From: Ariel Elior @ 2013-09-10 8:23 UTC (permalink / raw)
To: Sachin Kamat, netdev@vger.kernel.org
Cc: davem@davemloft.net, Eilon Greenstein
In-Reply-To: <1378798960-6572-1-git-send-email-sachin.kamat@linaro.org>
> -----Original Message-----
> From: netdev-owner@vger.kernel.org [mailto:netdev-
> owner@vger.kernel.org] On Behalf Of Sachin Kamat
> Sent: Tuesday, September 10, 2013 9:43 AM
> To: netdev@vger.kernel.org
> Cc: davem@davemloft.net; Eilon Greenstein; sachin.kamat@linaro.org
> Subject: [PATCH 1/1] net: bnx2x: Staticize local symbols
>
> Local symbols used only in this file are made static.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
> drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
> b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
> index 2604b62..5ec30cc 100644
> --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
> +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
> @@ -2802,7 +2802,7 @@ struct set_vf_state_cookie {
> u8 state;
> };
>
> -void bnx2x_set_vf_state(void *cookie)
> +static void bnx2x_set_vf_state(void *cookie)
> {
> struct set_vf_state_cookie *p = (struct set_vf_state_cookie
> *)cookie;
>
> @@ -3222,7 +3222,8 @@ void bnx2x_disable_sriov(struct bnx2x *bp)
> pci_disable_sriov(bp->pdev);
> }
>
> -int bnx2x_vf_ndo_prep(struct bnx2x *bp, int vfidx, struct bnx2x_virtf **vf,
> +static int
I don't like this form. Better to put the last variable in the next line.
> +bnx2x_vf_ndo_prep(struct bnx2x *bp, int vfidx, struct bnx2x_virtf **vf,
> struct pf_vf_bulletin_content **bulletin)
> {
> if (bp->state != BNX2X_STATE_OPEN) {
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
Thanks for suggesting the fix.
Not sure this is appropriate for net though...
Ariel
^ permalink raw reply
* RE: [PATCH] net: fec: fix phy reset operation to let imx6sl evk work
From: Duan Fugang-B38611 @ 2013-09-10 8:21 UTC (permalink / raw)
To: Shawn Guo
Cc: davem@davemloft.net, netdev@vger.kernel.org,
bhutchings@solarflare.com, stephen@networkplumber.org,
Li Frank-B20596, s.hauer@pengutronix.de
In-Reply-To: <20130910081434.GG5815@S2101-09.ap.freescale.net>
From: Shawn Guo [mailto:shawn.guo@linaro.org]
Data: Tuesday, September 10, 2013 4:15 PM
> To: Duan Fugang-B38611
> Cc: davem@davemloft.net; netdev@vger.kernel.org; bhutchings@solarflare.com;
> stephen@networkplumber.org; Li Frank-B20596; s.hauer@pengutronix.de
> Subject: Re: [PATCH] net: fec: fix phy reset operation to let imx6sl evk
> work
>
> First of all, the patch does not apply on linux-next which means it will
> likely not apply on David's tree either. Please generate the patch
> against the tree which your patch will go through.
>
Sorry, pls drop to review the patch, there have two changes in local (Linux-next) not commit amend to the patch.
But I tested the patch (+ changes) on imx6sl evk and pass.
I send the integrated patch again.
^ permalink raw reply
* Re: [PATCH] net: fec: fix phy reset operation to let imx6sl evk work
From: Shawn Guo @ 2013-09-10 8:15 UTC (permalink / raw)
To: Fugang Duan; +Cc: davem, netdev, bhutchings, stephen, b20596, s.hauer
In-Reply-To: <1378780505-23102-1-git-send-email-B38611@freescale.com>
First of all, the patch does not apply on linux-next which means it will
likely not apply on David's tree either. Please generate the patch
against the tree which your patch will go through.
On Tue, Sep 10, 2013 at 10:35:05AM +0800, Fugang Duan wrote:
> The patch do correct phy reset operation to let imx6sl evk
> ethernet work.
>
> Current driver only do phy reset in probe function, which is
> not right. Since some phy clock is disabled after module probe,
> the phy enter abnormal status, which needs do reset to recovery
> the phy. And do ifconfig ethx up/down test, the phy also enter
> abnormal status.
>
> The log as:
> libphy: 2188000.ethernet:04 - Link is Up - 10/Full
> libphy: 2188000.ethernet:04 - Link is Up - 100/Full
> libphy: 2188000.ethernet:04 - Link is Down
> libphy: 2188000.ethernet:04 - Link is Up - 10/Half
> libphy: 2188000.ethernet:04 - Link is Up - 10/Full
> libphy: 2188000.ethernet:04 - Link is Up - 100/Full
> ...
>
> So, do phy reset if ethx up/down or clock enable/disable.
>
> Signed-off-by: Fugang Duan <B38611@freescale.com>
> Reviewed-by: Shawn Guo <R65073@freescale.com>
> CC: Shawn Guo <R65073@freescale.com>
> CC: Li Frank <B20596@freescale.com>
> CC: "David S. Miller" <davem@davemloft.net>
> ---
> drivers/net/ethernet/freescale/fec.h | 3 +
> drivers/net/ethernet/freescale/fec_main.c | 61 +++++++++++++++++-----------
> 2 files changed, 40 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h
> index 0120217..b33c92d 100644
> --- a/drivers/net/ethernet/freescale/fec.h
> +++ b/drivers/net/ethernet/freescale/fec.h
> @@ -321,6 +321,9 @@ struct fec_enet_private {
> struct napi_struct napi;
> int csum_flags;
>
> + int phy_reset_gpio;
> + int reset_duration;
> +
> struct ptp_clock *ptp_clock;
> struct ptp_clock_info ptp_caps;
> unsigned long last_overflow_check;
> diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
> index 7a87012..5a9ba1d 100644
> --- a/drivers/net/ethernet/freescale/fec_main.c
> +++ b/drivers/net/ethernet/freescale/fec_main.c
> @@ -18,7 +18,7 @@
> * Bug fixes and cleanup by Philippe De Muyter (phdm@macqel.be)
> * Copyright (c) 2004-2006 Macq Electronique SA.
> *
> - * Copyright (C) 2010-2011 Freescale Semiconductor, Inc.
> + * Copyright (C) 2010-2013 Freescale Semiconductor, Inc.
> */
>
> #include <linux/module.h>
> @@ -61,6 +61,7 @@
> #include "fec.h"
>
> static void set_multicast_list(struct net_device *ndev);
> +static void fec_reset_phy(struct platform_device *pdev);
You probably mean fec_enet_reset_phy()?
>
> #if defined(CONFIG_ARM)
> #define FEC_ALIGNMENT 0xf
> @@ -1781,6 +1782,10 @@ fec_enet_open(struct net_device *ndev)
> phy_start(fep->phy_dev);
> netif_start_queue(ndev);
> fep->opened = 1;
> +
> + /* reset phy */
> + fec_enet_reset_phy(fep->pdev);
> +
> return 0;
> }
>
> @@ -2030,43 +2035,52 @@ static int fec_enet_init(struct net_device *ndev)
> return 0;
> }
>
> -#ifdef CONFIG_OF
> -static void fec_reset_phy(struct platform_device *pdev)
> +static void fec_enet_of_init(struct platform_device *pdev)
> {
> - int err, phy_reset;
> - int msec = 1;
> struct device_node *np = pdev->dev.of_node;
> + struct net_device *ndev = platform_get_drvdata(pdev);
> + struct fec_enet_private *fep = netdev_priv(ndev);
> + int err;
> +
> + /*
> + * init phy-reset-gpio to one invalid GPIO for no phy
> + * gpio reset platform
> + */
> + fep->phy_reset_gpio = -1;
>
> if (!np)
> return;
>
> - of_property_read_u32(np, "phy-reset-duration", &msec);
> + of_property_read_u32(np, "phy-reset-duration"
It misses one comma at the end of the line.
Shawn
> + &fep->reset_duration);
> /* A sane reset duration should not be longer than 1s */
> - if (msec > 1000)
> - msec = 1;
> + if ((fep->reset_duration > 1000) || (fep->reset_duration == 0))
> + fep->reset_duration = 1;
>
> - phy_reset = of_get_named_gpio(np, "phy-reset-gpios", 0);
> - if (!gpio_is_valid(phy_reset))
> + fep->phy_reset_gpio = of_get_named_gpio(np, "phy-reset-gpios", 0);
> + if (!gpio_is_valid(fep->phy_reset_gpio))
> return;
>
> - err = devm_gpio_request_one(&pdev->dev, phy_reset,
> - GPIOF_OUT_INIT_LOW, "phy-reset");
> + err = devm_gpio_request_one(&pdev->dev, fep->phy_reset_gpio,
> + GPIOF_OUT_INIT_HIGH, "phy-reset");
> if (err) {
> dev_err(&pdev->dev, "failed to get phy-reset-gpios: %d\n", err);
> - return;
> + fep->phy_reset_gpio = -1;
> }
> - msleep(msec);
> - gpio_set_value(phy_reset, 1);
> }
> -#else /* CONFIG_OF */
> -static void fec_reset_phy(struct platform_device *pdev)
> +
> +static void fec_enet_reset_phy(struct platform_device *pdev)
> {
> - /*
> - * In case of platform probe, the reset has been done
> - * by machine code.
> - */
> + struct net_device *ndev = platform_get_drvdata(pdev);
> + struct fec_enet_private *fep = netdev_priv(ndev);
> +
> + /* check GPIO valid to avoid kernel print warning when no gpio reset */
> + if (gpio_is_valid(fep->phy_reset_gpio)) {
> + gpio_set_value(fep->phy_reset_gpio, 0);
> + msleep(fep->reset_duration);
> + gpio_set_value(fep->phy_reset_gpio, 1);
> + }
> }
> -#endif /* CONFIG_OF */
>
> static int
> fec_probe(struct platform_device *pdev)
> @@ -2117,6 +2131,7 @@ fec_probe(struct platform_device *pdev)
>
> platform_set_drvdata(pdev, ndev);
>
> + fec_enet_of_init(pdev);
> ret = of_get_phy_mode(pdev->dev.of_node);
> if (ret < 0) {
> pdata = pdev->dev.platform_data;
> @@ -2170,8 +2185,6 @@ fec_probe(struct platform_device *pdev)
> fep->reg_phy = NULL;
> }
>
> - fec_reset_phy(pdev);
> -
> if (fep->bufdesc_ex)
> fec_ptp_init(pdev);
>
> --
> 1.7.1
>
>
^ permalink raw reply
* [PATCH 1/1] net: cxgb4vf: Staticize local symbols
From: Sachin Kamat @ 2013-09-10 7:52 UTC (permalink / raw)
To: netdev; +Cc: leedom, davem, sachin.kamat
Local symbols used only in this file are made static.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
drivers/net/ethernet/chelsio/cxgb4vf/sge.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/sge.c b/drivers/net/ethernet/chelsio/cxgb4vf/sge.c
index df296af..8475c4c 100644
--- a/drivers/net/ethernet/chelsio/cxgb4vf/sge.c
+++ b/drivers/net/ethernet/chelsio/cxgb4vf/sge.c
@@ -1396,8 +1396,9 @@ static inline void copy_frags(struct sk_buff *skb,
* Builds an sk_buff from the given packet gather list. Returns the
* sk_buff or %NULL if sk_buff allocation failed.
*/
-struct sk_buff *t4vf_pktgl_to_skb(const struct pkt_gl *gl,
- unsigned int skb_len, unsigned int pull_len)
+static struct sk_buff *t4vf_pktgl_to_skb(const struct pkt_gl *gl,
+ unsigned int skb_len,
+ unsigned int pull_len)
{
struct sk_buff *skb;
@@ -1443,7 +1444,7 @@ out:
* Releases the pages of a packet gather list. We do not own the last
* page on the list and do not free it.
*/
-void t4vf_pktgl_free(const struct pkt_gl *gl)
+static void t4vf_pktgl_free(const struct pkt_gl *gl)
{
int frag;
@@ -1640,7 +1641,7 @@ static inline void rspq_next(struct sge_rspq *rspq)
* on this queue. If the system is under memory shortage use a fairly
* long delay to help recovery.
*/
-int process_responses(struct sge_rspq *rspq, int budget)
+static int process_responses(struct sge_rspq *rspq, int budget)
{
struct sge_eth_rxq *rxq = container_of(rspq, struct sge_eth_rxq, rspq);
int budget_left = budget;
@@ -1893,7 +1894,7 @@ static unsigned int process_intrq(struct adapter *adapter)
* The MSI interrupt handler handles data events from SGE response queues as
* well as error and other async events as they all use the same MSI vector.
*/
-irqreturn_t t4vf_intr_msi(int irq, void *cookie)
+static irqreturn_t t4vf_intr_msi(int irq, void *cookie)
{
struct adapter *adapter = cookie;
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH net 1/1] r8169: enforce RX_MULTI_EN for the 8168f.
From: Frédéric Leroy @ 2013-09-10 8:08 UTC (permalink / raw)
To: Francois Romieu
Cc: hayeswang, netdev, 'David Miller', 'David R',
'nic_swsd'
In-Reply-To: <20130909225050.GA2529@electric-eye.fr.zoreil.com>
Le 10/09/2013 00:50, Francois Romieu a écrit :
> hayeswang <hayeswang@realtek.com> :
> [...]
> > I don't have any issue reported about the fetching numbers, so I have no
> > idea about why it could fix you problem.
>
> Thanks Hayes.
>
> Frédéric, David (R not M), do your systems include some Marvell SATA controller ?
>
I have an amd one :
[fredo:~] $ lspci | grep SATA
00:11.0 SATA controller: Advanced Micro Devices [AMD] nee ATI
SB7x0/SB8x0/SB9x0 SATA Controller [AHCI mode] (rev 40)
But I know I have sata ncq errors and stability problems with kernels >=
3.11
from git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
I don't try to debug it for the moment because it is on my main computer
and have valuable data on my ssd.
For completeness, here is the full list of pci devices on my pc :
[fredo:~] $ lspci
00:00.0 Host bridge: Advanced Micro Devices [AMD] nee ATI RD890 PCI
to PCI bridge (external gfx0 port B) (rev 02)
00:00.2 IOMMU: Advanced Micro Devices [AMD] nee ATI RD990 I/O Memory
Management Unit (IOMMU)
00:02.0 PCI bridge: Advanced Micro Devices [AMD] nee ATI RD890 PCI
to PCI bridge (PCI express gpp port B)
00:04.0 PCI bridge: Advanced Micro Devices [AMD] nee ATI RD890 PCI
to PCI bridge (PCI express gpp port D)
00:05.0 PCI bridge: Advanced Micro Devices [AMD] nee ATI RD890 PCI
to PCI bridge (PCI express gpp port E)
00:07.0 PCI bridge: Advanced Micro Devices [AMD] nee ATI RD890 PCI
to PCI bridge (PCI express gpp port G)
00:11.0 SATA controller: Advanced Micro Devices [AMD] nee ATI
SB7x0/SB8x0/SB9x0 SATA Controller [AHCI mode] (rev 40)
00:12.0 USB controller: Advanced Micro Devices [AMD] nee ATI
SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:12.2 USB controller: Advanced Micro Devices [AMD] nee ATI
SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:13.0 USB controller: Advanced Micro Devices [AMD] nee ATI
SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:13.2 USB controller: Advanced Micro Devices [AMD] nee ATI
SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:14.0 SMBus: Advanced Micro Devices [AMD] nee ATI SBx00 SMBus
Controller (rev 42)
00:14.2 Audio device: Advanced Micro Devices [AMD] nee ATI SBx00
Azalia (Intel HDA) (rev 40)
00:14.3 ISA bridge: Advanced Micro Devices [AMD] nee ATI
SB7x0/SB8x0/SB9x0 LPC host controller (rev 40)
00:14.4 PCI bridge: Advanced Micro Devices [AMD] nee ATI SBx00 PCI
to PCI Bridge (rev 40)
00:14.5 USB controller: Advanced Micro Devices [AMD] nee ATI
SB7x0/SB8x0/SB9x0 USB OHCI2 Controller
00:16.0 USB controller: Advanced Micro Devices [AMD] nee ATI
SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:16.2 USB controller: Advanced Micro Devices [AMD] nee ATI
SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:18.0 Host bridge: Advanced Micro Devices [AMD] Family 15h
Processor Function 0
00:18.1 Host bridge: Advanced Micro Devices [AMD] Family 15h
Processor Function 1
00:18.2 Host bridge: Advanced Micro Devices [AMD] Family 15h
Processor Function 2
00:18.3 Host bridge: Advanced Micro Devices [AMD] Family 15h
Processor Function 3
00:18.4 Host bridge: Advanced Micro Devices [AMD] Family 15h
Processor Function 4
00:18.5 Host bridge: Advanced Micro Devices [AMD] Family 15h
Processor Function 5
01:00.0 VGA compatible controller: Advanced Micro Devices [AMD] nee
ATI Caicos [Radeon HD 6450]
01:00.1 Audio device: Advanced Micro Devices [AMD] nee ATI Caicos
HDMI Audio [Radeon HD 6400 Series]
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd.
RTL8111/8168 PCI Express Gigabit Ethernet controller (rev 09)
03:00.0 USB controller: ASMedia Technology Inc. ASM1042 SuperSpeed
USB Host Controller
04:00.0 USB controller: ASMedia Technology Inc. ASM1042 SuperSpeed
USB Host Controller
05:05.0 Ethernet controller: 3Com Corporation 3c940
10/100/1000Base-T [Marvell] (rev 10)
[fredo:~] $
^ permalink raw reply
* [PATCH 1/1] net: bnx2x: Staticize local symbols
From: Sachin Kamat @ 2013-09-10 7:42 UTC (permalink / raw)
To: netdev; +Cc: davem, eilong, sachin.kamat
Local symbols used only in this file are made static.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
index 2604b62..5ec30cc 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
@@ -2802,7 +2802,7 @@ struct set_vf_state_cookie {
u8 state;
};
-void bnx2x_set_vf_state(void *cookie)
+static void bnx2x_set_vf_state(void *cookie)
{
struct set_vf_state_cookie *p = (struct set_vf_state_cookie *)cookie;
@@ -3222,7 +3222,8 @@ void bnx2x_disable_sriov(struct bnx2x *bp)
pci_disable_sriov(bp->pdev);
}
-int bnx2x_vf_ndo_prep(struct bnx2x *bp, int vfidx, struct bnx2x_virtf **vf,
+static int
+bnx2x_vf_ndo_prep(struct bnx2x *bp, int vfidx, struct bnx2x_virtf **vf,
struct pf_vf_bulletin_content **bulletin)
{
if (bp->state != BNX2X_STATE_OPEN) {
--
1.7.9.5
^ 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