* Re: [PATCH net 0/3] net: dsa: mv88e6xxx: fix hardware cross-chip bridging
From: David Miller @ 2016-04-16 23:07 UTC (permalink / raw)
To: vivien.didelot; +Cc: netdev, linux-kernel, kernel, f.fainelli, andrew
In-Reply-To: <1460659329-11473-1-git-send-email-vivien.didelot@savoirfairelinux.com>
From: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Date: Thu, 14 Apr 2016 14:42:06 -0400
> In order to accelerate cross-chip switching of frames with the hardware,
> the DSA Tag ports, used to interconnect switch devices, must learn SA
> and DA addresses, and share the same FDB with the user ports.
>
> The two first patches restore address learning on DSA links. This fixes
> hardware cross-chip bridging in a VLAN filtering enabled system, which
> implements a bridge group as a 802.1Q VLAN and thus share an isolated
> address database between DSA and user ports.
>
> The third patch changes the distinct default databases used for each
> port, to the same address database. This fixes the hardware cross-chip
> bridging in a VLAN filtering disabled system, where a bridge group gets
> implemented only as a port-based VLAN.
Series applied, thanks.
^ permalink raw reply
* Re: [net-next PATCH 0/5] Add support for offloads with IPv6 GRE tunnels
From: David Miller @ 2016-04-16 23:12 UTC (permalink / raw)
To: aduyck; +Cc: jesse, netdev, alexander.duyck, tom
In-Reply-To: <20160414192709.12934.82858.stgit@ahduyck-xeon-server>
From: Alexander Duyck <aduyck@mirantis.com>
Date: Thu, 14 Apr 2016 15:33:30 -0400
> This patch series enables the use of segmentation and checksum
> offloads with IPv6 based GRE tunnels.
Series applied, nice work Alex.
^ permalink raw reply
* Re: [net-next PATCH] netdev_features: Add NETIF_F_TSO_MANGLEID to NETIF_F_ALL_TSO
From: David Miller @ 2016-04-16 23:15 UTC (permalink / raw)
To: aduyck; +Cc: jesse, netdev, alexander.duyck, tom
In-Reply-To: <20160414210434.14117.52071.stgit@ahduyck-xeon-server>
From: Alexander Duyck <aduyck@mirantis.com>
Date: Thu, 14 Apr 2016 17:04:34 -0400
> I realized that when I added NETIF_F_TSO_MANGLEID as a TSO type I forgot to
> add it to NETIF_F_ALL_TSO. This patch corrects that so the flag will be
> included correctly.
>
> The result should be minor as it was only used by a few drivers and in a
> few specific cases such as when NETIF_F_SG was not supported on a device so
> the TSO flags were cleared.
>
> Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Applied.
^ permalink raw reply
* Re: [PATCH] dsa: mv88e6xxx: Kill the REG_READ and REG_WRITE macros
From: David Miller @ 2016-04-16 23:23 UTC (permalink / raw)
To: andrew; +Cc: f.fainelli, netdev, vivien.didelot
In-Reply-To: <1460670432-23801-1-git-send-email-andrew@lunn.ch>
From: Andrew Lunn <andrew@lunn.ch>
Date: Thu, 14 Apr 2016 23:47:12 +0200
> These macros hide a ds variable and a return statement on error, which
> can lead to locking issues. Kill them off.
>
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Applied, thanks Andrew.
^ permalink raw reply
* Re: [PATCH v3] prism54: isl_38xx: Replace 'struct timeval'
From: Arnd Bergmann @ 2016-04-16 23:34 UTC (permalink / raw)
To: Johannes Berg
Cc: y2038, netdev, linux-wireless, Tina Ruchandani, linux-kernel
In-Reply-To: <1460536706.3057.3.camel@sipsolutions.net>
On Wednesday 13 April 2016 10:38:26 Johannes Berg wrote:
> > The patch was build-tested / debugged by removing the
> > "if VERBOSE > SHOW_ERROR_MESSAGES" guards.
>
> Stands to reason that we should just remove the (more or less) dead
> code, since I don't think anyone really ever touches this driver any
> more or will ever again ...
Do you mean removing all DEBUG() statements from the driver, or
removing the entire driver?
Arnd
_______________________________________________
Y2038 mailing list
Y2038@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/y2038
^ permalink raw reply
* Re: [net][PATCH v2 0/2] RDS: couple of fixes for 4.6
From: santosh shilimkar @ 2016-04-16 23:57 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-kernel
In-Reply-To: <20160416.185342.1833113899705435419.davem@davemloft.net>
On 4/16/2016 3:53 PM, David Miller wrote:
> From: Santosh Shilimkar <santosh.shilimkar@oracle.com>
> Date: Thu, 14 Apr 2016 10:43:25 -0700
>
>> git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux.git for_4.6/net/rds-fixes
>
> I have no idea how you set this up, but there is no WAY this can be
> pulled from by me.
>
Thought I did based it against 'net' after your last comment.
Just checked again and the 'net' remote added by me points
to wrong url(net-next).
> When I try to pull it into 'net' I get 2690 objects. That means you
> didn't base it upon the 'net' tree which you must do. You can't base
> it upon Linus's tree, because if you do I'll get a ton of changes that
> are absolutely not appropriate to be pulled into my 'net' tree.
>
> Are you always doing this? Working against Linus's tree instead of
> mine?
>
No, its not Linus's tree. Its yours but not the right one.
Sorry for the trouble. Won't happen again.
Thanks for picking up the matches from patchworks.
Regards,
Santosh
^ permalink raw reply
* Re: [Odd commit author id merge via netdev]
From: santosh shilimkar @ 2016-04-17 0:13 UTC (permalink / raw)
To: Johannes Berg; +Cc: netdev, David S. Miller
In-Reply-To: <56FEF2F6.4090302@oracle.com>
On 4/1/2016 3:15 PM, santosh shilimkar wrote:
> On 4/1/2016 1:01 PM, Johannes Berg wrote:
>> On Fri, 2016-04-01 at 10:51 -0700, santosh shilimkar wrote:
>>> Hi Dave,
>>>
>>> I noticed something odd while checking the recent
>>> commits of mine in kernel.org tree made it via netdev.
>>>
>>> Don't know if its patchwork tool doing this.
>>> Usual author line in my git objects :
>>> Author: Santosh Shilimkar <emaid-id>
>>>
>>> But the commits going via your tree seems to be like below..
>>> Author: email-id <email-id>
>>>
>>> Few more examples of the commits end of the email. Can this
>>> be fixed for future commits ? The git objects you pulled from
>>> my tree directly have right author format where as ones which
>>> are picked from patchworks seems to be odd.
>>>
>>
>> Patchwork does store this info somehow and re-use it, quite possibly
>> from the very first patch you ever sent. I think this bug was *just*
>> fixed in patchwork, but it'll probably be a while until that fix lands.
>>
>> However, you can go and create a patchwork account with the real name,
>> associate it with all the email addresses you use and then I think
>> it'll pick it up. Not entirely sure though, you'll have to test it.
>>
Thought of letting you know that creating username didn't
seems to help. I did create a patchwork account and associated
the email ids I use for commits after last email exchange.
Now it got tested with Dave's 'net' tree commits indirectly.
The patchwork commit format still seems to be
"Author: email-id <email-id>" irrespective of patchwork user
name for me.
Regards,
Santosh
^ permalink raw reply
* Re: [PATCH] bpf: avoid warning for wrong pointer cast
From: Alexei Starovoitov @ 2016-04-17 0:47 UTC (permalink / raw)
To: Arnd Bergmann
Cc: David S . Miller, netdev, Steven Rostedt, Ingo Molnar,
Alexei Starovoitov, Daniel Borkmann, linux-kernel, fengguang.wu
In-Reply-To: <1460838585-1248139-1-git-send-email-arnd@arndb.de>
On Sat, Apr 16, 2016 at 10:29:33PM +0200, Arnd Bergmann wrote:
> Two new functions in bpf contain a cast from a 'u64' to a
> pointer. This works on 64-bit architectures but causes a warning
> on all 32-bit architectures:
>
> kernel/trace/bpf_trace.c: In function 'bpf_perf_event_output_tp':
> kernel/trace/bpf_trace.c:350:13: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
> u64 ctx = *(long *)r1;
>
> This changes the cast to first convert the u64 argument into a uintptr_t,
> which is guaranteed to be the same size as a pointer.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 9940d67c93b5 ("bpf: support bpf_get_stackid() and bpf_perf_event_output() in tracepoint programs")
Thanks.
Acked-by: Alexei Starovoitov <ast@kernel.org>
I guess I started to rely on 0-day build-bot too much.
This patch has been in my tree for 2+ weeks and then in net-next and
I didn't receive a single email from build-bot about this warning,
though I do receive them for my other work-in-progress stuff. Odd.
Fengguang, any idea why build-bot sometimes silent?
^ permalink raw reply
* Re: [net-next PATCH] stmmac: socfpga: remove extra call to socfpga_dwmac_setup
From: David Miller @ 2016-04-17 1:48 UTC (permalink / raw)
To: dinguyen; +Cc: peppe.cavallaro, dinh.linux, mgerlach, netdev
In-Reply-To: <1460684549-9549-1-git-send-email-dinguyen@opensource.altera.com>
From: <dinguyen@opensource.altera.com>
Date: Thu, 14 Apr 2016 20:42:29 -0500
> From: Dinh Nguyen <dinguyen@opensource.altera.com>
>
> In the socfpga_dwmac_probe function, we have a call to socfpga_dwmac_setup,
> which is already called from socfpga_dwmac_init later in the probe function.
> Remove this extra call to socfpga_dwmac_setup.
>
> Also we should not be calling socfpga_dwmac_setup() directly without wrapping
> it around the proper reset assert/deasserts. That is because the
> socfpga_dwmac_setup() is setting up PHY modes in the system manager, and it
> is requires the EMAC's to be in reset during the PHY setup.
>
> Reported-by: Matthew Gerlach <mgerlach@opensource.altera.com>
> Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
Applied, thank you.
^ permalink raw reply
* Re: [PATCH net-next v3 1/2] rtnetlink: add new RTM_GETSTATS message to query stats
From: roopa @ 2016-04-17 1:50 UTC (permalink / raw)
To: Thomas Graf; +Cc: netdev, jhs, davem
In-Reply-To: <20160416074910.GA2486@pox.localdomain>
On 4/16/16, 12:49 AM, Thomas Graf wrote:
> On 04/15/16 at 08:28pm, Roopa Prabhu wrote:
>> +static u16 rtnl_stats_calcit(struct sk_buff *skb, struct nlmsghdr *nlh)
>> +{
>> + struct net *net = sock_net(skb->sk);
>> + struct net_device *dev;
>> + u16 min_ifinfo_dump_size = 0;
>> + struct if_stats_msg *ifsm;
>> + u32 filter_mask;
>> +
>> + ifsm = nlmsg_data(nlh);
>> + filter_mask = ifsm->filter_mask;
>> +
>> + /* traverse the list of net devices and compute the minimum
>> + * buffer size based upon the filter mask.
>> + */
>> + list_for_each_entry(dev, &net->dev_base_head, dev_list) {
>> + min_ifinfo_dump_size = max_t(u16, min_ifinfo_dump_size,
>> + if_nlmsg_stats_size(dev,
>> + filter_mask));
>> + }
> Iterating over all net_devices in the namespace is quite an expensive
> operation and it would now be done twice.
>
> I understand that this code is taken over from rtnl_calcit() but there
> the cost is at least only paid if ext_filter_mask is actually set and
> the user opts into additional statistics.
>
> I wonder if we can reduce the cost for the stats interface as its
> purpose is to be minimal cost. I suggest we only add the loop once we
> have an extension which actually depends on it. We can then try and
> figure out to not require it.
ok, ack. Its not absolutely necessary right now with the one link filter stats
I am adding support for. We can bring it back later when we see a first instance
which makes it necessary.
In which case, I am going to trim down the series to absolute minimal.
just rtnl link stats64. I want to drop the ipv6 patch anyways.
With it I will also drop the general af stats handling. Will get it back when we get to the first
proper af stats implementation (hopefully mpls).
With this, the calcit for RTM_GETSTATS will be NULL, until we add the implementation for the other
stats attributes.
^ permalink raw reply
* Re: [PATCH net-next v2 0/6] FUJITSU Extended Socket driver version 1.1
From: David Miller @ 2016-04-17 1:51 UTC (permalink / raw)
To: izumi.taku; +Cc: netdev, jiri, isimatu.yasuaki
In-Reply-To: <1460686800-26427-1-git-send-email-izumi.taku@jp.fujitsu.com>
From: Taku Izumi <izumi.taku@jp.fujitsu.com>
Date: Fri, 15 Apr 2016 11:20:00 +0900
> This patchsets update FUJITSU Extended Socket network driver into version 1.1.
> This mainly includes some improvements and minor bugfix.
>
> v1->v2:
> - Remove ioctl and debugfs facility according to David comment
Series applied.
^ permalink raw reply
* Re: [PATCH net-next 0/2] Minor IFF_NO_QUEUE conversion follow-up
From: David Miller @ 2016-04-17 2:02 UTC (permalink / raw)
To: phil; +Cc: netdev
In-Reply-To: <1460740460-12859-1-git-send-email-phil@nwl.cc>
From: Phil Sutter <phil@nwl.cc>
Date: Fri, 15 Apr 2016 19:14:18 +0200
> The following series converts two further drivers away from setting
> 'tx_queue_len = 0' to adding IFF_NO_QUEUE to priv_flags instead.
>
> The first one, rtl8188eu in staging didn't exist back when all drivers
> were converted. The second one, openvswitch seems to have slipped through
> my grep'ing back then, no idea why.
Series applied, thanks Phil.
^ permalink raw reply
* Re: [PATCH net] net: bcmgenet: device stats are unsigned long
From: David Miller @ 2016-04-17 2:04 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, f.fainelli
In-Reply-To: <1460742472.10638.78.camel@edumazet-glaptop3.roam.corp.google.com>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 15 Apr 2016 10:47:52 -0700
> From: Eric Dumazet <edumazet@google.com>
>
> On 64bit kernels, device stats are 64bit wide, not 32bit.
>
> Fixes: 1c1008c793fa4 ("net: bcmgenet: add main driver file")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Florian Fainelli <f.fainelli@gmail.com>
Applied, thanks Eric.
^ permalink raw reply
* Нужны дилеры для кухонной мебели. Скидка - ЗO%., Нужны дилеры для кухонной мебели. Скидка - ЗO%.
From: Наталья Манько @ 2016-04-17 8:18 UTC (permalink / raw)
To: lgqpsajwcsr, mkonshin, netdev, mdage19, kovalenko, ooogitel, prof,
nwfgtf, kinobuka, metall-disain, mmmolga2020, pgomqljr, keryxxxa,
lwsybfma, moscow, nbrgpp, moscow, postmaster, moment-x, kos
Добрый день.
Меня зовут Наталья. Я представляю мебельную фабрику.
Наша фирма приглашает к сотрудничеству дилеров.
Наша мебель торгуется в среднем ценовом сегменте.
Цена нашей мебели для кухни в среднем на 2O-ЗО% ниже, чем на рынке:
- Классические кухни - ЗЗ000 р. за 1 п/м
- Кухни современные - от 3l OOO рублей за l п/м
- Кухни встроенные - 3IOOO руб. за l п/м
- Элитные кухни - 50000 руб. за 1 п/м
- Кухни-студии - Ч3 OOO р. за 1 п/м
- Кухонные стулья - 6 700 руб.
Вы сможете реализовать надбавку в цене.
При этом Вы хорошо заработаете!
Если Вас заинтересовало такое предложение, то Вы можете обратиться по телефону:
7 ≪4 9 9≫ 6 Ƽ З = 8 1 – 3 9
С уважением, Наталья.
^ permalink raw reply
* [PATCH] macsec: fix crypto Kconfig dependency
From: Arnd Bergmann @ 2016-04-17 9:19 UTC (permalink / raw)
To: David S. Miller, Sabrina Dubroca
Cc: Arnd Bergmann, Hannes Frederic Sowa, Johannes Berg, netdev,
linux-kernel
The new MACsec driver uses the AES crypto algorithm, but can be configured
even if CONFIG_CRYPTO is disabled, leading to a build error:
warning: (MAC80211 && MACSEC) selects CRYPTO_GCM which has unmet direct dependencies (CRYPTO)
warning: (BT && CEPH_LIB && INET && MAC802154 && MAC80211 && BLK_DEV_RBD && MACSEC && AIRO_CS && LIBIPW && HOSTAP && USB_WUSB && RTLLIB_CRYPTO_CCMP && FS_ENCRYPTION && EXT4_ENCRYPTION && CEPH_FS && BIG_KEYS && ENCRYPTED_KEYS) selects CRYPTO_AES which has unmet direct dependencies (CRYPTO)
crypto/built-in.o: In function `gcm_enc_copy_hash':
aes_generic.c:(.text+0x2b8): undefined reference to `crypto_xor'
aes_generic.c:(.text+0x2dc): undefined reference to `scatterwalk_map_and_copy'
This adds an explicit 'select CRYPTO' statement the way that other
drivers handle it.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: c09440f7dcb3 ("macsec: introduce IEEE 802.1AE driver")
---
drivers/net/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 2a1ba62b7da2..a24c18eee598 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -195,6 +195,7 @@ config GENEVE
config MACSEC
tristate "IEEE 802.1AE MAC-level encryption (MACsec)"
+ select CRYPTO
select CRYPTO_AES
select CRYPTO_GCM
---help---
--
2.7.0
^ permalink raw reply related
* Re: linux-next: build failure after merge of the net-next tree
From: Arnd Bergmann @ 2016-04-17 9:47 UTC (permalink / raw)
To: kernel-build-reports
Cc: David Miller, sfr, andrewx.bowers, linaro-kernel, netdev,
linux-kernel, linux-next, jeffrey.t.kirsher, mark.d.rustad
In-Reply-To: <20160413.111513.295841881765244758.davem@davemloft.net>
On Wednesday 13 April 2016 11:15:13 David Miller wrote:
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Wed, 13 Apr 2016 17:50:28 +1000
>
> > After merging the net-next tree, today's linux-next build (arm
> > allmodconfig) failed like thisi (this has actually been failing for a
> > few days, now):
> >
> > ERROR: "__bad_udelay" [drivers/net/ethernet/intel/ixgbe/ixgbe.ko] undefined!
> >
> > Caused by commit
> >
> > 49425dfc7451 ("ixgbe: Add support for x550em_a 10G MAC type")
> >
> > arm only allows udelay()s up to 2 milliseconds. This commit
> > adds a 5 ms udelay in ixgbe_acquire_swfw_sync_x550em_a() in
> > drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c.
>
> Jeff, please have your folks look into this. Probably just a simple
> conversion to mdelay().
>
I sent a patch, pretty sure we can use msleep() here rather than
a wasteful mdelay().
Arnd
^ permalink raw reply
* Re: [PATCH net-next] tun: don't require serialization lock on tx
From: Michael S. Tsirkin @ 2016-04-17 10:20 UTC (permalink / raw)
To: Paolo Abeni
Cc: netdev, David S. Miller, Hannes Frederic Sowa, Eric W. Biederman,
Greg Kurz, Jason Wang, Eric Dumazet
In-Reply-To: <cc7ac4631f0a32c4d61b73f4f28b52a05ab8651d.1460651429.git.pabeni@redhat.com>
On Thu, Apr 14, 2016 at 06:39:39PM +0200, Paolo Abeni wrote:
> The current tun_net_xmit() implementation don't need any external
> lock since it relies on rcu protection for the tun data structure
> and on socket queue lock for skb queuing.
>
> This patch set the NETIF_F_LLTX feature bit in the tun device, so
> that on xmit, in absence of qdisc, no serialization lock is acquired
> by the caller.
>
> The user space can remove the default tun qdisc with:
>
> tc qdisc replace dev <tun device name> root noqueue
>
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
> Acked-by: Eric Dumazet <edumazet@google.com>
This one seems transparent to userspace so:
Acked-by: Michael S. Tsirkin <mst@redhat.com>
>
> ---
> RFC -> v1
> - fixed a commit message typo, extended the comment with a
> configuration hint
> ---
> drivers/net/tun.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/tun.c b/drivers/net/tun.c
> index faf9297..42992dc 100644
> --- a/drivers/net/tun.c
> +++ b/drivers/net/tun.c
> @@ -1796,7 +1796,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
> dev->hw_features = NETIF_F_SG | NETIF_F_FRAGLIST |
> TUN_USER_FEATURES | NETIF_F_HW_VLAN_CTAG_TX |
> NETIF_F_HW_VLAN_STAG_TX;
> - dev->features = dev->hw_features;
> + dev->features = dev->hw_features | NETIF_F_LLTX;
> dev->vlan_features = dev->features &
> ~(NETIF_F_HW_VLAN_CTAG_TX |
> NETIF_F_HW_VLAN_STAG_TX);
> --
> 1.8.3.1
^ permalink raw reply
* Re: [PATCH V3 00/29] bitops: add parity functions
From: Dmitry Torokhov @ 2016-04-17 12:38 UTC (permalink / raw)
To: zengzhaoxiu
Cc: linux-kernel, Zhaoxiu Zeng, adi-buildroot-devel, Andrew Morton,
Anton Blanchard, Arnd Bergmann, Benjamin Tissoires,
Borislav Petkov, Bruce Allan, Christophe Leroy, David Herrmann,
David S. Miller, Denys Vlasenko, Duson Lin, Guenter Roeck,
Hans de Goede, Hans Verkuil, Hartmut Knaack, Heiko Carstens,
Hendrik
In-Reply-To: <1460601525-3822-1-git-send-email-zengzhaoxiu@163.com>
On Thu, Apr 14, 2016 at 10:36:41AM +0800, zengzhaoxiu@163.com wrote:
> drivers/input/joystick/grip_mp.c | 16 +--
> drivers/input/joystick/sidewinder.c | 24 +----
> drivers/input/mouse/elantech.c | 10 +-
> drivers/input/mouse/elantech.h | 1 -
> drivers/input/serio/ams_delta_serio.c | 8 +-
> drivers/input/serio/pcips2.c | 2 +-
> drivers/input/serio/sa1111ps2.c | 2 +-
For input bits:
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Thanks.
--
Dmitry
^ permalink raw reply
* Re: [PATCH v3] prism54: isl_38xx: Replace 'struct timeval'
From: Johannes Berg @ 2016-04-17 12:42 UTC (permalink / raw)
To: Arnd Bergmann
Cc: y2038, netdev, linux-wireless, Tina Ruchandani, linux-kernel
In-Reply-To: <5521267.mr5HLCdTY6@wuerfel>
On Sun, 2016-04-17 at 01:34 +0200, Arnd Bergmann wrote:
> On Wednesday 13 April 2016 10:38:26 Johannes Berg wrote:
> >
> > >
> > > The patch was build-tested / debugged by removing the
> > > "if VERBOSE > SHOW_ERROR_MESSAGES" guards.
> > Stands to reason that we should just remove the (more or less) dead
> > code, since I don't think anyone really ever touches this driver
> > any
> > more or will ever again ...
> Do you mean removing all DEBUG() statements from the driver, or
> removing the entire driver?
>
We tried removing the driver once, since p54 supposedly drives the same
hardware, but some people had certain use cases that didn't work there,
apparently.
I was thinking more restrictively of just the stuff that can't even be
built without modifying the sources - like the "#if VERBOSE" thing.
johannes
_______________________________________________
Y2038 mailing list
Y2038@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/y2038
^ permalink raw reply
* Re: FlameGraph of mlx4 early drop with order-0 pages
From: Mel Gorman @ 2016-04-17 13:23 UTC (permalink / raw)
To: Jesper Dangaard Brouer
Cc: linux-mm, netdev@vger.kernel.org, Brenden Blanco, tom,
alexei.starovoitov, ogerlitz, daniel, eric.dumazet, ecree,
john.fastabend, tgraf, johannes, eranlinuxmellanox
In-Reply-To: <20160415214034.6ffae9ee@redhat.com>
On Fri, Apr 15, 2016 at 09:40:34PM +0200, Jesper Dangaard Brouer wrote:
> Hi Mel,
>
> I did an experiment that you might find interesting. Using Brenden's
> early drop with eBPF in the mxl4 driver. I changed the mlx4 driver to
> use order-0 pages. It usually use order-3 pages to amortize the cost
> of calling the page allocator (which is problematic for other reasons,
> like memory pin-down, latency spikes and multi CPU scalability)
>
> With this change I could do around 12Mpps (Mill packet per sec) drops,
> usually does 14.5Mpps (limited due to a HW setup/limit, with idle cycles).
>
> Looking at the perf report as a FlameGraph, the page allocator clearly
> show up as the bottleneck:
>
Yeah, it's very obvious there. You didn't say if this had the optimisations
included or not but it doesn't really matter. Even halving the cost would
still be a lot.
FWIW, the latest series included an optimisation around the debugging
check. I also have an extreme patch that creates a special fast path for
order-0 pages only when there is plenty of free memory. It halved the
cost of the allocation side even on top of the current optimisations. I'm
not super-happy with it though as it duplicates some code and it requires
node-lru to be merged. Right now, node-lru is colliding very badly with
what's in mmotm so there is legwork required.
I also prototyped something that caches high-order pages on the per-cpu
lists on the flight over. It is at the "it builds so it must be ok"
stage. It's at the horrible hack and the accounting is quesionable but
something like it may be justified for SLUB even if network drivers move
away from high-order pages.
> Signing off, heading for the plane soon... see you at MM-summit!
Indeed and we'll slap some sort of plan together. If there is a slot free,
we might spend 15-30 minutes on it. Failing that, we'll grab a table
somewhere. We'll see how far we can get before considering a page-recycle
layer that preserves cache coherent state.
--
Mel Gorman
SUSE Labs
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* [RFC PATCH] net: ipv4: add l3 and l4 multipath algorithms
From: Nikolay Aleksandrov @ 2016-04-17 14:29 UTC (permalink / raw)
To: netdev
Cc: tom, roopa, dsa, gospo, pch, davem, eric.dumazet,
Nikolay Aleksandrov
Hi all,
I've been looking into adding both l3 and l4 multipath algorithms which
are consistent in both forwarded and locally originated traffic.
This attempt removes the old multipath code, and trades performance for
unifying both locally originated and forwarded traffic cases.
There's one case that is much faster though - for the forwarded case if the
l4 hash is already present we'll shortcircuit and use that.
We would like to see/implement the following items:
1. Unified and consistent multipath for local and forwarded traffic
2. Choice between different multipath algorithms
3. IPv4 and IPv6 symmetry (as much as we can)
4. Use of precomputed hash where possible
The first two points and partially the fourth are implemented by this
patch. Currently we can only be certain if the hash is L4, thus we can only
use skb->hash in the L4 hash case, the L3 hash is always computed.
Later we might revisit fib_multipath_hash and change it to accept enum
pkt_hash_types based on the precomputed hash that is passed.
Unfortunately I have to remove the special ICMP handling for now, I don't
mind adding the same workaround for IPv6 though, I'm not sure which is
preferred. This patch changes the IPv4 L4 hash to be computed only over
{src/dst IP, src/dst port, protocol}.
About the third point if a change like this is acceptable, I'll post the
respective IPv6 change which will make it symmetric in the way the hash
is derived.
And about the fourth point, I have a quick and dirty patch that passes
the socket txhash (currently randomly generated) for connected sockets down
to the multipath selection algorithm. It uses a 4 byte hole in flowi_common
to pass it down, but it's far from ready so I will not be submitting it with
this change.
The hash over flow_keys directly was chosen to avoid one zeroing and a few
initializations since if I were to use a flowi hash function it'd boil down
to flow_keys again, but I'd have to zero and initialize a fake flowi4 struct
as well. If this is not desired, I don't mind reverting to using the flowi4
version.
What do you think ?
Thanks,
Nik
Note: if you'd like to minimize the performance hit for L3, I can simply
use the jhash_2words directly, but that would violate point 3.
---
drivers/net/vrf.c | 2 +-
include/net/ip_fib.h | 16 ++++----
include/net/route.h | 5 +--
include/uapi/linux/rtnetlink.h | 10 ++++-
net/ipv4/fib_frontend.c | 8 ++++
net/ipv4/fib_semantics.c | 23 +++++++-----
net/ipv4/icmp.c | 19 +---------
net/ipv4/route.c | 83 +++++++++++++++++++++---------------------
8 files changed, 82 insertions(+), 84 deletions(-)
diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
index 9a9fabb900c1..3ab7a62edb23 100644
--- a/drivers/net/vrf.c
+++ b/drivers/net/vrf.c
@@ -768,7 +768,7 @@ static int vrf_get_saddr(struct net_device *dev, struct flowi4 *fl4)
if (res.type == RTN_LOCAL)
fl4->saddr = res.fi->fib_prefsrc ? : fl4->daddr;
else
- fib_select_path(net, &res, fl4, -1);
+ fib_select_path(net, &res, fl4);
}
fl4->flowi4_flags = flags;
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index 4079fc18ffe4..0ddcc028e520 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -37,6 +37,7 @@ struct fib_config {
u32 fc_flags;
u32 fc_priority;
__be32 fc_prefsrc;
+ u32 fc_mp_alg;
struct nlattr *fc_mx;
struct rtnexthop *fc_mp;
int fc_mx_len;
@@ -120,6 +121,7 @@ struct fib_info {
int fib_nhs;
#ifdef CONFIG_IP_ROUTE_MULTIPATH
int fib_weight;
+ u32 fib_mp_alg;
#endif
struct rcu_head rcu;
struct fib_nh fib_nh[0];
@@ -322,17 +324,13 @@ int fib_sync_down_dev(struct net_device *dev, unsigned long event, bool force);
int fib_sync_down_addr(struct net *net, __be32 local);
int fib_sync_up(struct net_device *dev, unsigned int nh_flags);
-extern u32 fib_multipath_secret __read_mostly;
-
-static inline int fib_multipath_hash(__be32 saddr, __be32 daddr)
-{
- return jhash_2words((__force u32)saddr, (__force u32)daddr,
- fib_multipath_secret) >> 1;
-}
-
+#ifdef CONFIG_IP_ROUTE_MULTIPATH
+int fib_multipath_hash(const struct fib_info *fi, const struct flowi4 *fl4,
+ const struct sk_buff *skb);
+#endif
void fib_select_multipath(struct fib_result *res, int hash);
void fib_select_path(struct net *net, struct fib_result *res,
- struct flowi4 *fl4, int mp_hash);
+ struct flowi4 *fl4);
/* Exported by fib_trie.c */
void fib_trie_init(void);
diff --git a/include/net/route.h b/include/net/route.h
index f4b11eee1754..2146964bdf6d 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -114,13 +114,12 @@ struct in_device;
int ip_rt_init(void);
void rt_cache_flush(struct net *net);
void rt_flush_dev(struct net_device *dev);
-struct rtable *__ip_route_output_key_hash(struct net *, struct flowi4 *flp,
- int mp_hash);
+struct rtable *__ip_route_output_key_hash(struct net *, struct flowi4 *flp);
static inline struct rtable *__ip_route_output_key(struct net *net,
struct flowi4 *flp)
{
- return __ip_route_output_key_hash(net, flp, -1);
+ return __ip_route_output_key_hash(net, flp);
}
struct rtable *ip_route_output_flow(struct net *, struct flowi4 *flp,
diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h
index 6be7fabf94a8..5d76194557d9 100644
--- a/include/uapi/linux/rtnetlink.h
+++ b/include/uapi/linux/rtnetlink.h
@@ -272,6 +272,14 @@ enum rt_scope_t {
#define RTM_F_PREFIX 0x800 /* Prefix addresses */
#define RTM_F_LOOKUP_TABLE 0x1000 /* set rtm_table to FIB lookup result */
+/* Multipath algorithms */
+enum rt_mp_alg_t {
+ RT_MP_ALG_L3_HASH,
+ RT_MP_ALG_L4_HASH,
+ __RT_MP_ALG_MAX
+};
+#define RT_MP_ALG_MAX (__RT_MP_ALG_MAX - 1)
+
/* Reserved table identifiers */
enum rt_class_t {
@@ -302,7 +310,7 @@ enum rtattr_type_t {
RTA_FLOW,
RTA_CACHEINFO,
RTA_SESSION, /* no longer used */
- RTA_MP_ALGO, /* no longer used */
+ RTA_MP_ALGO,
RTA_TABLE,
RTA_MARK,
RTA_MFC_STATS,
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 8a9246deccfe..0aecfec8f7a6 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -624,6 +624,7 @@ const struct nla_policy rtm_ipv4_policy[RTA_MAX + 1] = {
[RTA_PREFSRC] = { .type = NLA_U32 },
[RTA_METRICS] = { .type = NLA_NESTED },
[RTA_MULTIPATH] = { .len = sizeof(struct rtnexthop) },
+ [RTA_MP_ALGO] = { .type = NLA_U32 },
[RTA_FLOW] = { .type = NLA_U32 },
[RTA_ENCAP_TYPE] = { .type = NLA_U16 },
[RTA_ENCAP] = { .type = NLA_NESTED },
@@ -686,6 +687,13 @@ static int rtm_to_fib_config(struct net *net, struct sk_buff *skb,
cfg->fc_mp = nla_data(attr);
cfg->fc_mp_len = nla_len(attr);
break;
+ case RTA_MP_ALGO:
+ cfg->fc_mp_alg = nla_get_u32(attr);
+ if (cfg->fc_mp_alg > RT_MP_ALG_MAX) {
+ err = -EINVAL;
+ goto errout;
+ }
+ break;
case RTA_FLOW:
cfg->fc_flow = nla_get_u32(attr);
break;
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index ab64d9f2eef9..8af436352ec4 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -57,7 +57,6 @@ static unsigned int fib_info_cnt;
static struct hlist_head fib_info_devhash[DEVINDEX_HASHSIZE];
#ifdef CONFIG_IP_ROUTE_MULTIPATH
-u32 fib_multipath_secret __read_mostly;
#define for_nexthops(fi) { \
int nhsel; const struct fib_nh *nh; \
@@ -257,6 +256,11 @@ static inline int nh_comp(const struct fib_info *fi, const struct fib_info *ofi)
{
const struct fib_nh *onh = ofi->fib_nh;
+#ifdef CONFIG_IP_ROUTE_MULTIPATH
+ if (fi->fib_mp_alg != ofi->fib_mp_alg)
+ return -1;
+#endif
+
for_nexthops(fi) {
if (nh->nh_oif != onh->nh_oif ||
nh->nh_gw != onh->nh_gw ||
@@ -575,9 +579,6 @@ static void fib_rebalance(struct fib_info *fi)
atomic_set(&nexthop_nh->nh_upper_bound, upper_bound);
} endfor_nexthops(fi);
-
- net_get_random_once(&fib_multipath_secret,
- sizeof(fib_multipath_secret));
}
static inline void fib_add_weight(struct fib_info *fi,
@@ -1064,6 +1065,7 @@ struct fib_info *fib_create_info(struct fib_config *cfg)
if (cfg->fc_mp) {
#ifdef CONFIG_IP_ROUTE_MULTIPATH
+ fi->fib_mp_alg = cfg->fc_mp_alg;
err = fib_get_nhs(fi, cfg->fc_mp, cfg->fc_mp_len, cfg);
if (err != 0)
goto failure;
@@ -1277,6 +1279,9 @@ int fib_dump_info(struct sk_buff *skb, u32 portid, u32 seq, int event,
struct rtnexthop *rtnh;
struct nlattr *mp;
+ if (nla_put_u32(skb, RTA_MP_ALGO, fi->fib_mp_alg))
+ goto nla_put_failure;
+
mp = nla_nest_start(skb, RTA_MULTIPATH);
if (!mp)
goto nla_put_failure;
@@ -1602,16 +1607,14 @@ void fib_select_multipath(struct fib_result *res, int hash)
#endif
void fib_select_path(struct net *net, struct fib_result *res,
- struct flowi4 *fl4, int mp_hash)
+ struct flowi4 *fl4)
{
#ifdef CONFIG_IP_ROUTE_MULTIPATH
if (res->fi->fib_nhs > 1 && fl4->flowi4_oif == 0) {
- if (mp_hash < 0)
- mp_hash = get_hash_from_flowi4(fl4) >> 1;
+ int h = fib_multipath_hash(res->fi, fl4, NULL);
- fib_select_multipath(res, mp_hash);
- }
- else
+ fib_select_multipath(res, h);
+ } else
#endif
if (!res->prefixlen &&
res->table->tb_num_default > 1 &&
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 6333489771ed..51a4db5f22ad 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -440,22 +440,6 @@ out_unlock:
icmp_xmit_unlock(sk);
}
-#ifdef CONFIG_IP_ROUTE_MULTIPATH
-
-/* Source and destination is swapped. See ip_multipath_icmp_hash */
-static int icmp_multipath_hash_skb(const struct sk_buff *skb)
-{
- const struct iphdr *iph = ip_hdr(skb);
-
- return fib_multipath_hash(iph->daddr, iph->saddr);
-}
-
-#else
-
-#define icmp_multipath_hash_skb(skb) (-1)
-
-#endif
-
static struct rtable *icmp_route_lookup(struct net *net,
struct flowi4 *fl4,
struct sk_buff *skb_in,
@@ -480,8 +464,7 @@ static struct rtable *icmp_route_lookup(struct net *net,
fl4->flowi4_oif = l3mdev_master_ifindex(skb_in->dev);
security_skb_classify_flow(skb_in, flowi4_to_flowi(fl4));
- rt = __ip_route_output_key_hash(net, fl4,
- icmp_multipath_hash_skb(skb_in));
+ rt = __ip_route_output_key_hash(net, fl4);
if (IS_ERR(rt))
return rt;
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 02c62299d717..fba9de1f02d9 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1692,45 +1692,49 @@ out:
}
#ifdef CONFIG_IP_ROUTE_MULTIPATH
-
-/* To make ICMP packets follow the right flow, the multipath hash is
- * calculated from the inner IP addresses in reverse order.
- */
-static int ip_multipath_icmp_hash(struct sk_buff *skb)
+int fib_multipath_hash(const struct fib_info *fi, const struct flowi4 *fl4,
+ const struct sk_buff *skb)
{
- const struct iphdr *outer_iph = ip_hdr(skb);
- struct icmphdr _icmph;
- const struct icmphdr *icmph;
- struct iphdr _inner_iph;
- const struct iphdr *inner_iph;
-
- if (unlikely((outer_iph->frag_off & htons(IP_OFFSET)) != 0))
- goto standard_hash;
+ struct flow_keys hash_keys;
+ u32 mhash;
- icmph = skb_header_pointer(skb, outer_iph->ihl * 4, sizeof(_icmph),
- &_icmph);
- if (!icmph)
- goto standard_hash;
-
- if (icmph->type != ICMP_DEST_UNREACH &&
- icmph->type != ICMP_REDIRECT &&
- icmph->type != ICMP_TIME_EXCEEDED &&
- icmph->type != ICMP_PARAMETERPROB) {
- goto standard_hash;
+ switch (fi->fib_mp_alg) {
+ case RT_MP_ALG_L3_HASH:
+ memset(&hash_keys, 0, sizeof(hash_keys));
+ hash_keys.addrs.v4addrs.src = fl4->saddr;
+ hash_keys.addrs.v4addrs.dst = fl4->daddr;
+ break;
+ case RT_MP_ALG_L4_HASH:
+ /* skb is currently provided only when forwarding */
+ if (skb) {
+ unsigned int flag = FLOW_DISSECTOR_F_STOP_AT_ENCAP;
+ struct flow_keys keys;
+
+ /* short-circuit if we already have L4 hash present */
+ if (skb->l4_hash)
+ return skb_get_hash_raw(skb) >> 1;
+ memset(&hash_keys, 0, sizeof(hash_keys));
+ skb_flow_dissect_flow_keys(skb, &keys, flag);
+ hash_keys.addrs.v4addrs.src = keys.addrs.v4addrs.src;
+ hash_keys.addrs.v4addrs.dst = keys.addrs.v4addrs.dst;
+ hash_keys.ports.src = keys.ports.src;
+ hash_keys.ports.dst = keys.ports.dst;
+ hash_keys.basic.ip_proto = keys.basic.ip_proto;
+ } else {
+ memset(&hash_keys, 0, sizeof(hash_keys));
+ hash_keys.addrs.v4addrs.src = fl4->saddr;
+ hash_keys.addrs.v4addrs.dst = fl4->daddr;
+ hash_keys.ports.src = fl4->fl4_sport;
+ hash_keys.ports.dst = fl4->fl4_dport;
+ hash_keys.basic.ip_proto = fl4->flowi4_proto;
+ }
+ break;
}
+ mhash = flow_hash_from_keys(&hash_keys);
- inner_iph = skb_header_pointer(skb,
- outer_iph->ihl * 4 + sizeof(_icmph),
- sizeof(_inner_iph), &_inner_iph);
- if (!inner_iph)
- goto standard_hash;
-
- return fib_multipath_hash(inner_iph->daddr, inner_iph->saddr);
-
-standard_hash:
- return fib_multipath_hash(outer_iph->saddr, outer_iph->daddr);
+ return mhash >> 1;
}
-
+EXPORT_SYMBOL_GPL(fib_multipath_hash);
#endif /* CONFIG_IP_ROUTE_MULTIPATH */
static int ip_mkroute_input(struct sk_buff *skb,
@@ -1741,12 +1745,8 @@ static int ip_mkroute_input(struct sk_buff *skb,
{
#ifdef CONFIG_IP_ROUTE_MULTIPATH
if (res->fi && res->fi->fib_nhs > 1) {
- int h;
+ int h = fib_multipath_hash(res->fi, fl4, skb);
- if (unlikely(ip_hdr(skb)->protocol == IPPROTO_ICMP))
- h = ip_multipath_icmp_hash(skb);
- else
- h = fib_multipath_hash(saddr, daddr);
fib_select_multipath(res, h);
}
#endif
@@ -2125,8 +2125,7 @@ add:
* Major route resolver routine.
*/
-struct rtable *__ip_route_output_key_hash(struct net *net, struct flowi4 *fl4,
- int mp_hash)
+struct rtable *__ip_route_output_key_hash(struct net *net, struct flowi4 *fl4)
{
struct net_device *dev_out = NULL;
__u8 tos = RT_FL_TOS(fl4);
@@ -2289,7 +2288,7 @@ struct rtable *__ip_route_output_key_hash(struct net *net, struct flowi4 *fl4,
goto make_route;
}
- fib_select_path(net, &res, fl4, mp_hash);
+ fib_select_path(net, &res, fl4);
dev_out = FIB_RES_DEV(res);
fl4->flowi4_oif = dev_out->ifindex;
--
2.4.11
^ permalink raw reply related
* Re: [PATCH net-next v3 2/8] net: dsa: mv88e6xxx: drop revision probing
From: Andrew Lunn @ 2016-04-17 15:24 UTC (permalink / raw)
To: Vivien Didelot
Cc: netdev, linux-kernel, kernel, David S. Miller, Florian Fainelli
In-Reply-To: <1460846505-20305-3-git-send-email-vivien.didelot@savoirfairelinux.com>
On Sat, Apr 16, 2016 at 06:41:39PM -0400, Vivien Didelot wrote:
> There is no point in having a special case for the revision when probing
> a switch model. The code gets cluttered with unnecessary defines, and
> leads to errors when code such as mv88e6131_setup compares
> PORT_SWITCH_ID_6131_B2 to ps->id which masks the revision.
>
> Drop every revision definition, and lookup only the product number.
>
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Thanks
Andrew
> ---
> drivers/net/dsa/mv88e6123.c | 6 ------
> drivers/net/dsa/mv88e6131.c | 2 --
> drivers/net/dsa/mv88e6352.c | 6 ------
> drivers/net/dsa/mv88e6xxx.c | 14 +-------------
> drivers/net/dsa/mv88e6xxx.h | 15 ---------------
> 5 files changed, 1 insertion(+), 42 deletions(-)
>
> diff --git a/drivers/net/dsa/mv88e6123.c b/drivers/net/dsa/mv88e6123.c
> index 88a812d..00c1121 100644
> --- a/drivers/net/dsa/mv88e6123.c
> +++ b/drivers/net/dsa/mv88e6123.c
> @@ -19,14 +19,8 @@
>
> static const struct mv88e6xxx_switch_id mv88e6123_table[] = {
> { PORT_SWITCH_ID_6123, "Marvell 88E6123" },
> - { PORT_SWITCH_ID_6123_A1, "Marvell 88E6123 (A1)" },
> - { PORT_SWITCH_ID_6123_A2, "Marvell 88E6123 (A2)" },
> { PORT_SWITCH_ID_6161, "Marvell 88E6161" },
> - { PORT_SWITCH_ID_6161_A1, "Marvell 88E6161 (A1)" },
> - { PORT_SWITCH_ID_6161_A2, "Marvell 88E6161 (A2)" },
> { PORT_SWITCH_ID_6165, "Marvell 88E6165" },
> - { PORT_SWITCH_ID_6165_A1, "Marvell 88E6165 (A1)" },
> - { PORT_SWITCH_ID_6165_A2, "Marvell 88e6165 (A2)" },
> };
>
> static char *mv88e6123_drv_probe(struct device *dsa_dev,
> diff --git a/drivers/net/dsa/mv88e6131.c b/drivers/net/dsa/mv88e6131.c
> index 6b2bcb0..df534da 100644
> --- a/drivers/net/dsa/mv88e6131.c
> +++ b/drivers/net/dsa/mv88e6131.c
> @@ -21,7 +21,6 @@ static const struct mv88e6xxx_switch_id mv88e6131_table[] = {
> { PORT_SWITCH_ID_6085, "Marvell 88E6085" },
> { PORT_SWITCH_ID_6095, "Marvell 88E6095/88E6095F" },
> { PORT_SWITCH_ID_6131, "Marvell 88E6131" },
> - { PORT_SWITCH_ID_6131_B2, "Marvell 88E6131 (B2)" },
> { PORT_SWITCH_ID_6185, "Marvell 88E6185" },
> };
>
> @@ -109,7 +108,6 @@ static int mv88e6131_setup(struct dsa_switch *ds)
> ps->num_ports = 11;
> break;
> case PORT_SWITCH_ID_6131:
> - case PORT_SWITCH_ID_6131_B2:
> ps->num_ports = 8;
> break;
> default:
> diff --git a/drivers/net/dsa/mv88e6352.c b/drivers/net/dsa/mv88e6352.c
> index dbd920e..30fc5f6 100644
> --- a/drivers/net/dsa/mv88e6352.c
> +++ b/drivers/net/dsa/mv88e6352.c
> @@ -27,14 +27,8 @@ static const struct mv88e6xxx_switch_id mv88e6352_table[] = {
> { PORT_SWITCH_ID_6176, "Marvell 88E6176" },
> { PORT_SWITCH_ID_6240, "Marvell 88E6240" },
> { PORT_SWITCH_ID_6320, "Marvell 88E6320" },
> - { PORT_SWITCH_ID_6320_A1, "Marvell 88E6320 (A1)" },
> - { PORT_SWITCH_ID_6320_A2, "Marvell 88e6320 (A2)" },
> { PORT_SWITCH_ID_6321, "Marvell 88E6321" },
> - { PORT_SWITCH_ID_6321_A1, "Marvell 88E6321 (A1)" },
> - { PORT_SWITCH_ID_6321_A2, "Marvell 88e6321 (A2)" },
> { PORT_SWITCH_ID_6352, "Marvell 88E6352" },
> - { PORT_SWITCH_ID_6352_A0, "Marvell 88E6352 (A0)" },
> - { PORT_SWITCH_ID_6352_A1, "Marvell 88E6352 (A1)" },
> };
>
> static char *mv88e6352_drv_probe(struct device *dsa_dev,
> diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c
> index 9985a0c..b63e985 100644
> --- a/drivers/net/dsa/mv88e6xxx.c
> +++ b/drivers/net/dsa/mv88e6xxx.c
> @@ -3081,22 +3081,10 @@ static char *mv88e6xxx_lookup_name(struct mii_bus *bus, int sw_addr,
> if (ret < 0)
> return NULL;
>
> - /* Look up the exact switch ID */
> for (i = 0; i < num; ++i)
> - if (table[i].id == ret)
> + if (table[i].id == (ret & 0xfff0))
> return table[i].name;
>
> - /* Look up only the product number */
> - for (i = 0; i < num; ++i) {
> - if (table[i].id == (ret & PORT_SWITCH_ID_PROD_NUM_MASK)) {
> - dev_warn(&bus->dev,
> - "unknown revision %d, using base switch 0x%x\n",
> - ret & PORT_SWITCH_ID_REV_MASK,
> - ret & PORT_SWITCH_ID_PROD_NUM_MASK);
> - return table[i].name;
> - }
> - }
> -
> return NULL;
> }
>
> diff --git a/drivers/net/dsa/mv88e6xxx.h b/drivers/net/dsa/mv88e6xxx.h
> index 5d27dec..9242aea 100644
> --- a/drivers/net/dsa/mv88e6xxx.h
> +++ b/drivers/net/dsa/mv88e6xxx.h
> @@ -68,8 +68,6 @@
> #define PORT_PCS_CTRL_UNFORCED 0x03
> #define PORT_PAUSE_CTRL 0x02
> #define PORT_SWITCH_ID 0x03
> -#define PORT_SWITCH_ID_PROD_NUM_MASK 0xfff0
> -#define PORT_SWITCH_ID_REV_MASK 0x000f
> #define PORT_SWITCH_ID_6031 0x0310
> #define PORT_SWITCH_ID_6035 0x0350
> #define PORT_SWITCH_ID_6046 0x0480
> @@ -84,18 +82,11 @@
> #define PORT_SWITCH_ID_6121 0x1040
> #define PORT_SWITCH_ID_6122 0x1050
> #define PORT_SWITCH_ID_6123 0x1210
> -#define PORT_SWITCH_ID_6123_A1 0x1212
> -#define PORT_SWITCH_ID_6123_A2 0x1213
> #define PORT_SWITCH_ID_6131 0x1060
> -#define PORT_SWITCH_ID_6131_B2 0x1066
> #define PORT_SWITCH_ID_6152 0x1a40
> #define PORT_SWITCH_ID_6155 0x1a50
> #define PORT_SWITCH_ID_6161 0x1610
> -#define PORT_SWITCH_ID_6161_A1 0x1612
> -#define PORT_SWITCH_ID_6161_A2 0x1613
> #define PORT_SWITCH_ID_6165 0x1650
> -#define PORT_SWITCH_ID_6165_A1 0x1652
> -#define PORT_SWITCH_ID_6165_A2 0x1653
> #define PORT_SWITCH_ID_6171 0x1710
> #define PORT_SWITCH_ID_6172 0x1720
> #define PORT_SWITCH_ID_6175 0x1750
> @@ -104,16 +95,10 @@
> #define PORT_SWITCH_ID_6185 0x1a70
> #define PORT_SWITCH_ID_6240 0x2400
> #define PORT_SWITCH_ID_6320 0x1150
> -#define PORT_SWITCH_ID_6320_A1 0x1151
> -#define PORT_SWITCH_ID_6320_A2 0x1152
> #define PORT_SWITCH_ID_6321 0x3100
> -#define PORT_SWITCH_ID_6321_A1 0x3101
> -#define PORT_SWITCH_ID_6321_A2 0x3102
> #define PORT_SWITCH_ID_6350 0x3710
> #define PORT_SWITCH_ID_6351 0x3750
> #define PORT_SWITCH_ID_6352 0x3520
> -#define PORT_SWITCH_ID_6352_A0 0x3521
> -#define PORT_SWITCH_ID_6352_A1 0x3522
> #define PORT_CONTROL 0x04
> #define PORT_CONTROL_USE_CORE_TAG BIT(15)
> #define PORT_CONTROL_DROP_ON_LOCK BIT(14)
> --
> 2.8.0
>
^ permalink raw reply
* Re: [PATCH net-next v3 3/8] net: dsa: mv88e6xxx: read switch ID in probe
From: Andrew Lunn @ 2016-04-17 15:26 UTC (permalink / raw)
To: Vivien Didelot
Cc: netdev, linux-kernel, kernel, David S. Miller, Florian Fainelli
In-Reply-To: <1460846505-20305-4-git-send-email-vivien.didelot@savoirfairelinux.com>
On Sat, Apr 16, 2016 at 06:41:40PM -0400, Vivien Didelot wrote:
> Read the switch ID only once, at probe time, to avoid multiple read
> accesses and MII bus checking.
>
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Thanks
Andrew
> ---
> drivers/net/dsa/mv88e6xxx.c | 54 +++++++++++++++++++++++++--------------------
> 1 file changed, 30 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c
> index b63e985..af5ae70 100644
> --- a/drivers/net/dsa/mv88e6xxx.c
> +++ b/drivers/net/dsa/mv88e6xxx.c
> @@ -2667,8 +2667,6 @@ int mv88e6xxx_setup_common(struct dsa_switch *ds)
> ps->ds = ds;
> mutex_init(&ps->smi_mutex);
>
> - ps->id = REG_READ(REG_PORT(0), PORT_SWITCH_ID) & 0xfff0;
> -
> INIT_WORK(&ps->bridge_work, mv88e6xxx_bridge_work);
>
> return 0;
> @@ -3068,21 +3066,14 @@ int mv88e6xxx_get_temp_alarm(struct dsa_switch *ds, bool *alarm)
> }
> #endif /* CONFIG_NET_DSA_HWMON */
>
> -static char *mv88e6xxx_lookup_name(struct mii_bus *bus, int sw_addr,
> +static char *mv88e6xxx_lookup_name(unsigned int id,
> const struct mv88e6xxx_switch_id *table,
> unsigned int num)
> {
> - int i, ret;
> -
> - if (!bus)
> - return NULL;
> -
> - ret = __mv88e6xxx_reg_read(bus, sw_addr, REG_PORT(0), PORT_SWITCH_ID);
> - if (ret < 0)
> - return NULL;
> + int i;
>
> for (i = 0; i < num; ++i)
> - if (table[i].id == (ret & 0xfff0))
> + if (table[i].id == (id & 0xfff0))
> return table[i].name;
>
> return NULL;
> @@ -3094,23 +3085,38 @@ char *mv88e6xxx_drv_probe(struct device *dsa_dev, struct device *host_dev,
> unsigned int num)
> {
> struct mv88e6xxx_priv_state *ps;
> - struct mii_bus *bus = dsa_host_dev_to_mii_bus(host_dev);
> + struct mii_bus *bus;
> + int id, prod_num, rev;
> char *name;
>
> + bus = dsa_host_dev_to_mii_bus(host_dev);
> if (!bus)
> return NULL;
>
> - name = mv88e6xxx_lookup_name(bus, sw_addr, table, num);
> - if (name) {
> - ps = devm_kzalloc(dsa_dev, sizeof(*ps), GFP_KERNEL);
> - if (!ps)
> - return NULL;
> - *priv = ps;
> - ps->bus = dsa_host_dev_to_mii_bus(host_dev);
> - if (!ps->bus)
> - return NULL;
> - ps->sw_addr = sw_addr;
> - }
> + id = __mv88e6xxx_reg_read(bus, sw_addr, REG_PORT(0), PORT_SWITCH_ID);
> + if (id < 0)
> + return NULL;
> +
> + prod_num = (id & 0xfff0) >> 4;
> + rev = id & 0x000f;
> +
> + name = mv88e6xxx_lookup_name(id, table, num);
> + if (!name)
> + return NULL;
> +
> + ps = devm_kzalloc(dsa_dev, sizeof(*ps), GFP_KERNEL);
> + if (!ps)
> + return NULL;
> +
> + ps->bus = bus;
> + ps->sw_addr = sw_addr;
> + ps->id = id & 0xfff0;
> +
> + *priv = ps;
> +
> + dev_info(&ps->bus->dev, "switch 0x%x probed: %s, revision %u\n",
> + prod_num, name, rev);
> +
> return name;
> }
>
> --
> 2.8.0
>
^ permalink raw reply
* Re: [PATCH net-next v3 4/8] net: dsa: mv88e6xxx: add switch info
From: Andrew Lunn @ 2016-04-17 15:35 UTC (permalink / raw)
To: Vivien Didelot
Cc: netdev, linux-kernel, kernel, David S. Miller, Florian Fainelli
In-Reply-To: <1460846505-20305-5-git-send-email-vivien.didelot@savoirfairelinux.com>
> @@ -3100,16 +3100,19 @@ char *mv88e6xxx_drv_probe(struct device *dsa_dev, struct device *host_dev,
> prod_num = (id & 0xfff0) >> 4;
> rev = id & 0x000f;
>
> - name = mv88e6xxx_lookup_name(id, table, num);
> - if (!name)
> + info = mv88e6xxx_lookup_info(prod_num, table, num);
> + if (!info)
> return NULL;
>
> + name = (char *) info->name;
> +
Hi Vivien
Casting off the const is not so nice. How about adding in another
patch to change the API to return a const char *.
Andrew
^ permalink raw reply
* Re: [PATCH net-next v3 4/8] net: dsa: mv88e6xxx: add switch info
From: Vivien Didelot @ 2016-04-17 16:37 UTC (permalink / raw)
To: Andrew Lunn
Cc: netdev, linux-kernel, kernel, David S. Miller, Florian Fainelli
In-Reply-To: <20160417153541.GC907@lunn.ch>
Hi Andrew,
Andrew Lunn <andrew@lunn.ch> writes:
>> @@ -3100,16 +3100,19 @@ char *mv88e6xxx_drv_probe(struct device *dsa_dev, struct device *host_dev,
>> prod_num = (id & 0xfff0) >> 4;
>> rev = id & 0x000f;
>>
>> - name = mv88e6xxx_lookup_name(id, table, num);
>> - if (!name)
>> + info = mv88e6xxx_lookup_info(prod_num, table, num);
>> + if (!info)
>> return NULL;
>>
>> + name = (char *) info->name;
>> +
>
> Hi Vivien
>
> Casting off the const is not so nice. How about adding in another
> patch to change the API to return a const char *.
OK.
Thanks,
Vivien
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox