Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH 1/3] ipv6: Select fragment id during UFO/GSO segmentation if not set.
From: Vlad Yasevich @ 2015-01-27 14:26 UTC (permalink / raw)
  To: Hannes Frederic Sowa, Michael S. Tsirkin
  Cc: netdev, Vladislav Yasevich, Ben Hutchings, edumazet,
	virtualization
In-Reply-To: <1422366458.13969.11.camel@stressinduktion.org>

On 01/27/2015 08:47 AM, Hannes Frederic Sowa wrote:
> On Di, 2015-01-27 at 10:42 +0200, Michael S. Tsirkin wrote:
>> On Tue, Jan 27, 2015 at 02:47:54AM +0000, Ben Hutchings wrote:
>>> On Mon, 2015-01-26 at 09:37 -0500, Vladislav Yasevich wrote:
>>>> If the IPv6 fragment id has not been set and we perform
>>>> fragmentation due to UFO, select a new fragment id.
>>>> When we store the fragment id into skb_shinfo, set the bit
>>>> in the skb so we can re-use the selected id.
>>>> This preserves the behavior of UFO packets generated on the
>>>> host and solves the issue of id generation for packet sockets
>>>> and tap/macvtap devices.
>>>>
>>>> This patch moves ipv6_select_ident() back in to the header file.  
>>>> It also provides the helper function that sets skb_shinfo() frag
>>>> id and sets the bit.
>>>>
>>>> It also makes sure that we select the fragment id when doing
>>>> just gso validation, since it's possible for the packet to
>>>> come from an untrusted source (VM) and be forwarded through
>>>> a UFO enabled device which will expect the fragment id.
>>>>
>>>> CC: Eric Dumazet <edumazet@google.com>
>>>> Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
>>>> ---
>>>>  include/linux/skbuff.h |  3 ++-
>>>>  include/net/ipv6.h     |  2 ++
>>>>  net/ipv6/ip6_output.c  |  4 ++--
>>>>  net/ipv6/output_core.c |  9 ++++++++-
>>>>  net/ipv6/udp_offload.c | 10 +++++++++-
>>>>  5 files changed, 23 insertions(+), 5 deletions(-)
>>>>
>>>> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
>>>> index 85ab7d7..3ad5203 100644
>>>> --- a/include/linux/skbuff.h
>>>> +++ b/include/linux/skbuff.h
>>>> @@ -605,7 +605,8 @@ struct sk_buff {
>>>>  	__u8			ipvs_property:1;
>>>>  	__u8			inner_protocol_type:1;
>>>>  	__u8			remcsum_offload:1;
>>>> -	/* 3 or 5 bit hole */
>>>> +	__u8			ufo_fragid_set:1;
>>> [...]
>>>
>>> Doesn't the flag belong in struct skb_shared_info, rather than struct
>>> sk_buff?  Otherwise this looks fine.
>>>
>>> Ben.
>>
>> Hmm we seem to be out of tx flags.
>> Maybe ip6_frag_id == 0 should mean "not set".
> 
> Maybe that is the best idea. Definitely the ufo_fragid_set bit should
> move into the skb_shared_info area.

That's what I originally wanted to do, but had to move and grow txflags thus
skb_shinfo ended up growing.  I wanted to avoid that, so stole an skb flag.

I considered treating fragid == 0 as unset, but a 0 fragid is perfectly valid
from the protocol perspective and could actually be generated by the id generator
functions.  This may cause us to call the id generation multiple times.

-vlad
> 
> Thanks,
> Hannes
> 
> 

^ permalink raw reply

* RE: [PATCH net-next V1 04/11] net/mlx4_core: Adjust command timeouts to conform to the firmware spec
From: David Laight @ 2015-01-27 14:30 UTC (permalink / raw)
  To: 'Amir Vadai', David S. Miller
  Cc: netdev@vger.kernel.org, Or Gerlitz, Yevgeny Petrilin,
	Jack Morgenstein
In-Reply-To: <1422367089-13419-5-git-send-email-amirv@mellanox.com>

From: Amir Vadai
> From: Jack Morgenstein <jackm@dev.mellanox.co.il>
> 
> The firmware spec states that the timeout for all commands should be 60 seconds.

Hmmm... 60 seconds seems a long time to wait for a device to do something.

I'll have given up and reset the machine before that expires.

	David

^ permalink raw reply

* [PATCH net-next] cxgb4: Move firmware version MACRO to t4fw_version.h
From: Hariprasad Shenai @ 2015-01-27 14:42 UTC (permalink / raw)
  To: netdev; +Cc: davem, leedom, anish, nirranjan, praveenm, Hariprasad Shenai

Move firmware version MACRO to a new t4fw_version.h file so that csiostor driver
can also use it.

Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h        |   10 ----
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c   |    1 +
 drivers/net/ethernet/chelsio/cxgb4/t4fw_version.h |   48 +++++++++++++++++++++
 3 files changed, 49 insertions(+), 10 deletions(-)
 create mode 100644 drivers/net/ethernet/chelsio/cxgb4/t4fw_version.h

diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
index d98a446..fb6980a 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
@@ -49,16 +49,6 @@
 #include <asm/io.h>
 #include "cxgb4_uld.h"
 
-#define T4FW_VERSION_MAJOR 0x01
-#define T4FW_VERSION_MINOR 0x0C
-#define T4FW_VERSION_MICRO 0x19
-#define T4FW_VERSION_BUILD 0x00
-
-#define T5FW_VERSION_MAJOR 0x01
-#define T5FW_VERSION_MINOR 0x0C
-#define T5FW_VERSION_MICRO 0x19
-#define T5FW_VERSION_BUILD 0x00
-
 #define CH_WARN(adap, fmt, ...) dev_warn(adap->pdev_dev, fmt, ## __VA_ARGS__)
 
 enum {
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index c27dcd9..5bf490a 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -70,6 +70,7 @@
 #include "t4_values.h"
 #include "t4_msg.h"
 #include "t4fw_api.h"
+#include "t4fw_version.h"
 #include "cxgb4_dcb.h"
 #include "cxgb4_debugfs.h"
 #include "clip_tbl.h"
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4fw_version.h b/drivers/net/ethernet/chelsio/cxgb4/t4fw_version.h
new file mode 100644
index 0000000..e2bd3f7
--- /dev/null
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4fw_version.h
@@ -0,0 +1,48 @@
+/*
+ * This file is part of the Chelsio T4 Ethernet driver for Linux.
+ *
+ * Copyright (c) 2003-2014 Chelsio Communications, Inc. All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ *     Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *      - Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *
+ *      - Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifndef __T4FW_VERSION_H__
+#define __T4FW_VERSION_H__
+
+#define T4FW_VERSION_MAJOR 0x01
+#define T4FW_VERSION_MINOR 0x0C
+#define T4FW_VERSION_MICRO 0x19
+#define T4FW_VERSION_BUILD 0x00
+
+#define T5FW_VERSION_MAJOR 0x01
+#define T5FW_VERSION_MINOR 0x0C
+#define T5FW_VERSION_MICRO 0x19
+#define T5FW_VERSION_BUILD 0x00
+
+#endif
-- 
1.7.1

^ permalink raw reply related

* Re: [PATCH 1/3] ipv6: Select fragment id during UFO/GSO segmentation if not set.
From: Eric Dumazet @ 2015-01-27 14:38 UTC (permalink / raw)
  To: vyasevic
  Cc: Michael S. Tsirkin, netdev, Vladislav Yasevich, virtualization,
	edumazet, Hannes Frederic Sowa, Ben Hutchings
In-Reply-To: <54C7A007.6050707@redhat.com>

On Tue, 2015-01-27 at 09:26 -0500, Vlad Yasevich wrote:

> That's what I originally wanted to do, but had to move and grow txflags thus
> skb_shinfo ended up growing.  I wanted to avoid that, so stole an skb flag.
> 
> I considered treating fragid == 0 as unset, but a 0 fragid is perfectly valid
> from the protocol perspective and could actually be generated by the id generator
> functions.  This may cause us to call the id generation multiple times.

With 32bit ID, you certainly can replace fragid=0 by fragid=0x80000000
and nobody will notice.

I certainly vote for not adding an extra bit in skb or skb_shared_info,
considering we already consume 32bits for this thing.

fragid are best effort, otherwise they would have 128bits.

^ permalink raw reply

* Re: [PATCH net-next 2/2] flow_dissector: add tipc support
From: Eric Dumazet @ 2015-01-27 14:40 UTC (permalink / raw)
  To: Erik Hugne
  Cc: David Miller, richard.alpe, netdev, jon.maloy, ying.xue,
	tipc-discussion
In-Reply-To: <20150127120852.GB11522@haze>

On Tue, 2015-01-27 at 13:08 +0100, Erik Hugne wrote:

> 
> About time we do something about this.. I'll post a patch with proper header
> definitions soon.

Thanks for following up ;)

^ permalink raw reply

* Re: [PATCH net-next 06/10] net/mlx4_core: Fix struct mlx4_vhcr_cmd to make implicit padding explicit
From: Jack Morgenstein @ 2015-01-27 14:43 UTC (permalink / raw)
  To: David Laight
  Cc: 'Amir Vadai', David S. Miller, netdev@vger.kernel.org,
	Or Gerlitz, Yevgeny Petrilin
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D1CAD3D71@AcuExch.aculab.com>

On Tue, 27 Jan 2015 13:38:28 +0000
David Laight <David.Laight@ACULAB.COM> wrote:

> Haven't you broken communication between an old and new
> 32bit Guests and 32bit hosts (assuming they exist)?

Yes, but I don't see any interest on the net in running 32-bit Hosts
with virtualization and SR IOV.  I do see that there is interest in
running 32-bit Guests over 64-bit Hosts (which configuration KVM
supports).

Since this change is *required* for supporting 32-bit Guests on 64-bit
Hosts, I don't see that we have much choice here.

As you say, an old 32-bit Host will not be compatible with a new 32-bit
guest, and vice-versa. However, I would assume that almost all Hosts
would have 64-bit architectures, because of the performance and
memory-space requirements for running SRIOV and virtualization.
Therefore, I don't see this as a stopper.

-Jack

^ permalink raw reply

* Re: [net-next] net: netcp: remove unused kconfig option and code
From: Murali Karicheri @ 2015-01-27 14:43 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-kernel
In-Reply-To: <20150123.222120.467596005244092508.davem@davemloft.net>

On 01/24/2015 01:21 AM, David Miller wrote:
> From: Murali Karicheri<m-karicheri2@ti.com>
> Date: Tue, 20 Jan 2015 14:22:36 -0500
>
>> Currently CPTS is built into the netcp driver even though there is no
>> call out to the CPTS driver. This patch removes the dependency in Kconfig
>> and remove cpts.o from the Makefile for NetCP.
>>
>> Signed-off-by: Murali Karicheri<m-karicheri2@ti.com>
>> ---
>>   drivers/net/ethernet/ti/Kconfig  |    2 +-
>>   drivers/net/ethernet/ti/Makefile |    2 +-
>>   2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/ti/Kconfig b/drivers/net/ethernet/ti/Kconfig
>> index e11bcfa..824e376 100644
>> --- a/drivers/net/ethernet/ti/Kconfig
>> +++ b/drivers/net/ethernet/ti/Kconfig
>> @@ -73,7 +73,7 @@ config TI_CPSW
>>   config TI_CPTS
>>   	boolean "TI Common Platform Time Sync (CPTS) Support"
>>   	depends on TI_CPSW
>> -	depends on TI_CPSW || TI_KEYSTONE_NET
>> +	depends on TI_CPSW
>
> Just remove the second dependency line, it's redundant because you've
> made it identical to the line before it.
Ok. Will post it with the change

-- 
Murali Karicheri
Linux Kernel, Texas Instruments

^ permalink raw reply

* Re: [PATCH] net: Linn Ethernet Packet Sniffer driver
From: Daniel Borkmann @ 2015-01-27 14:46 UTC (permalink / raw)
  To: Stathis Voukelatos
  Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, abrestic@chromium.org, f.fainelli
In-Reply-To: <54C7736C.8090704@linn.co.uk>

Hi Stathis,

On 01/27/2015 12:15 PM, Stathis Voukelatos wrote:
> On 26/01/15 10:10, Daniel Borkmann wrote:
>>> Hello Daniel. Thank you for your feedback.
>>> Packet sockets could also be used for the driver interface to
>>> user space, however I think that both approaches would require the same
>>> amount of maintenance. We need to maintain a protocol consisting of
>>> a set of messages or commands that user space can use to communicate
>>> with the driver in order to configure the H/W and retrieve results.
>>> We could use packet sockets to send those messages  too, but I thought
>>> netlink already provides a message exchange framework that we could
>>> make use of.
>>
>> When using packet sockets and your driver as a backend feeding them,
>> users can see that there's an extra capturing/monitoring netdev present,
>> all libpcap-based tools such as tcpdump et al would work out of the box
>> w/o adapting any code, and as an admin you can also see what users/tools
>> are making of use of the device through packet sockets. I couldn't parse
>> the exact motivation from the commit message of why avoiding all this is
>> better?
>
> Just wanted to clarify some implementation details for your approach.
> - The driver would need to create and register two net_device instances.
> One for sniffing Ethernet TX packets and one for RX.

Hm, I would represent the whole device as a single monitoring-only netdev.
I'm somehow still missing the big advantage of all this as compared to
using packet sockets on the normal netdev? I couldn't parse that from your
commit message.

> - Would the control interface for the sniffer in that case need to be
> through private socket ioctls (ie SIOCDEVPRIVATE + x ioctl ids)?

Nope, please have a look at Documentation/networking/packet_mmap.txt.

^ permalink raw reply

* [PATCH net-next v1] net: netcp: remove unused kconfig option and code
From: Murali Karicheri @ 2015-01-27 14:49 UTC (permalink / raw)
  To: davem, netdev, linux-kernel; +Cc: Murali Karicheri

Currently CPTS is built into the netcp driver even though there is no
call out to the CPTS driver. This patch removes the dependency in Kconfig
and remove cpts.o from the Makefile for NetCP.

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
---
 v1 - removed the dependancy line introduced earlier as per comment
 drivers/net/ethernet/ti/Kconfig  |    1 -
 drivers/net/ethernet/ti/Makefile |    2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/ti/Kconfig b/drivers/net/ethernet/ti/Kconfig
index e11bcfa..4ea1663 100644
--- a/drivers/net/ethernet/ti/Kconfig
+++ b/drivers/net/ethernet/ti/Kconfig
@@ -73,7 +73,6 @@ config TI_CPSW
 config TI_CPTS
 	boolean "TI Common Platform Time Sync (CPTS) Support"
 	depends on TI_CPSW
-	depends on TI_CPSW || TI_KEYSTONE_NET
 	select PTP_1588_CLOCK
 	---help---
 	  This driver supports the Common Platform Time Sync unit of
diff --git a/drivers/net/ethernet/ti/Makefile b/drivers/net/ethernet/ti/Makefile
index 465d03d..0a9813b 100644
--- a/drivers/net/ethernet/ti/Makefile
+++ b/drivers/net/ethernet/ti/Makefile
@@ -13,4 +13,4 @@ ti_cpsw-y := cpsw_ale.o cpsw.o cpts.o
 
 obj-$(CONFIG_TI_KEYSTONE_NETCP) += keystone_netcp.o
 keystone_netcp-y := netcp_core.o netcp_ethss.o	netcp_sgmii.o \
-			netcp_xgbepcsr.o cpsw_ale.o cpts.o
+			netcp_xgbepcsr.o cpsw_ale.o
-- 
1.7.9.5

^ permalink raw reply related

* Re: [PATCH net 0/2] netns: audit netdevice creation with IFLA_NET_NS_[PID|FD]
From: Nicolas Dichtel @ 2015-01-27 14:50 UTC (permalink / raw)
  To: Alexander Aring; +Cc: netdev, davem, arvid.brodin, linux-wpan
In-Reply-To: <20150127140620.GA8941@omega>

Le 27/01/2015 15:06, Alexander Aring a écrit :
> Hi,
>
> On Tue, Jan 27, 2015 at 02:28:47PM +0100, Nicolas Dichtel wrote:
> ...
[snip]
>>
>> I don't know how wpan0 is created and if this interface can be created directly
>> in another netns than init_net.
>>
>
> no it can't. The wpan0 interface can be created via the 802.15.4
> userspace tools and we don't have such option for namespaces. It
> should be always to init_net while creation.
Even with 'ip netns exec foo iwpan ...'?

>
>>>
>>>
>>> Summarize:
>>>
>>> I would add the dev->features |= NETIF_F_NETNS_LOCAL; while wpan
>>> interface generation and add only the !net_eq(src_net, &init_net) check
>>> above. I suppose that src_net is the net namespace from "underlaying"
>>> interface wpan by calling:
>>>
>>> $ ip link add link wpan0 name lowpan0 type lowpan
>> No. src_net is the netns where the ip command is launched. With this patch, my
>
> ah, and when no "ip netns" is given it's default to init_net?
The default netns is the netns where your shell is running :)
It may be different from init_net when you are playing on a virtual machine. On
a physical machine, it's usually init_net.

>
>
> Okay, then I agree with that both interfaces should be set
>
> dev->features |= NETIF_F_NETNS_LOCAL
Ok.

>
> because both interfaces should started with "init_net" as default
> namespace. For wpan interface this should always be in "init_net",
> because we don't set anything while creation.
Not sure this is true. It's probably possible to create it directly in another
netns (with 'ip netns exec' or because your system is a virtual machine that
runs over a namespaces construction (see docker [0], lxc [1], etc).

[0] https://www.docker.com/
[1] https://linuxcontainers.org/

>
> For 6LoWPAN interface this should also always in the same namespace like
> the wpan interface and not diffrent namespace between link (wpan) and
> virtual (6LoWPAN) interface.
>
> Do you agree with that?
Yes.

But I still wonder if we should add a check about dev_net(dev) != init_net in
net/ieee802154/6lowpan/core.c.
If my understanding is correct:
  - wpan can be created directly in a netns != init_net
  - 6lowpan must be in the same netns than wpan
  - code under net/ieee802154 only works in init_net, thus 6lowpan only works
    in init_net.

Do you agree?
What about this (based on net-next)?

 From 5ca1c46c68e4e4381b2f7e284f5dadeb28a53b2f Mon Sep 17 00:00:00 2001
From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Tue, 27 Jan 2015 11:26:20 +0100
Subject: [PATCH] wpan/6lowpan: fix netns settings

6LoWPAN currently doesn't supports x-netns and works only in init_net.

With this patch, we ensure that:
  - the wpan interface cannot be moved to another netns;
  - the 6lowpan interface cannot be moved to another netns;
  - the wpan interface is in the same netns than the 6lowpan interface;
  - the 6lowpan interface is in init_net.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
  net/ieee802154/6lowpan/core.c | 6 ++++--
  net/mac802154/iface.c         | 1 +
  2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/net/ieee802154/6lowpan/core.c b/net/ieee802154/6lowpan/core.c
index 055fbb71ba6f..dfd3c6007f60 100644
--- a/net/ieee802154/6lowpan/core.c
+++ b/net/ieee802154/6lowpan/core.c
@@ -126,6 +126,7 @@ static void lowpan_setup(struct net_device *dev)
  	dev->header_ops		= &lowpan_header_ops;
  	dev->ml_priv		= &lowpan_mlme;
  	dev->destructor		= free_netdev;
+	dev->features		|= NETIF_F_NETNS_LOCAL;
  }

  static int lowpan_validate(struct nlattr *tb[], struct nlattr *data[])
@@ -148,10 +149,11 @@ static int lowpan_newlink(struct net *src_net, struct 
net_device *dev,

  	pr_debug("adding new link\n");

-	if (!tb[IFLA_LINK])
+	if (!tb[IFLA_LINK] ||
+	    !net_eq(dev_net(dev), &init_net))
  		return -EINVAL;
  	/* find and hold real wpan device */
-	real_dev = dev_get_by_index(src_net, nla_get_u32(tb[IFLA_LINK]));
+	real_dev = dev_get_by_index(dev_net(dev), nla_get_u32(tb[IFLA_LINK]));
  	if (!real_dev)
  		return -ENODEV;
  	if (real_dev->type != ARPHRD_IEEE802154) {
diff --git a/net/mac802154/iface.c b/net/mac802154/iface.c
index 6fb6bdf9868c..b67da8d578b4 100644
--- a/net/mac802154/iface.c
+++ b/net/mac802154/iface.c
@@ -475,6 +475,7 @@ static void ieee802154_if_setup(struct net_device *dev)
  	dev->mtu		= IEEE802154_MTU;
  	dev->tx_queue_len	= 300;
  	dev->flags		= IFF_NOARP | IFF_BROADCAST;
+	dev->features		|= NETIF_F_NETNS_LOCAL;
  }

  static int
-- 
2.2.2

^ permalink raw reply related

* Re: [RFC PATCH] net: ipv6: Make address flushing on ifdown optional
From: David Ahern @ 2015-01-27 14:55 UTC (permalink / raw)
  To: Hannes Frederic Sowa, Andy Gospodarek; +Cc: Stephen Hemminger, netdev
In-Reply-To: <1422351861.13969.5.camel@stressinduktion.org>

On 1/27/15 2:44 AM, Hannes Frederic Sowa wrote:
>> You are probably correct that many will not switch, but this sysctl
>> gives those who want to switch a nice option without having to carry
>> extra kernel patches.  I like it.
>
> I don't see any problem with the patch in general but DAD should
> definitely happen on reenabling interfaces. Current behavior does not
> seem fine to me. It's ok if this patch doesn't change this behavior now
> but a follow-up one will be needed then.
>
> David, will you look after the DAD logic and do you plan a follow-up
> patch?

Yes, I do plan a follow-up patch for this change. Will work on that this 
week.

 From the discussion a second patch is needed to make sure DAD is done 
on a link up if there is an address configured.

David

^ permalink raw reply

* Re: [RFC PATCH] net: ipv6: Make address flushing on ifdown optional
From: Hannes Frederic Sowa @ 2015-01-27 15:28 UTC (permalink / raw)
  To: David Ahern; +Cc: Andy Gospodarek, Stephen Hemminger, netdev
In-Reply-To: <54C7A6D6.8020805@gmail.com>

On Di, 2015-01-27 at 07:55 -0700, David Ahern wrote:
> On 1/27/15 2:44 AM, Hannes Frederic Sowa wrote:
> >> You are probably correct that many will not switch, but this sysctl
> >> gives those who want to switch a nice option without having to carry
> >> extra kernel patches.  I like it.
> >
> > I don't see any problem with the patch in general but DAD should
> > definitely happen on reenabling interfaces. Current behavior does not
> > seem fine to me. It's ok if this patch doesn't change this behavior now
> > but a follow-up one will be needed then.
> >
> > David, will you look after the DAD logic and do you plan a follow-up
> > patch?
> 
> Yes, I do plan a follow-up patch for this change. Will work on that this 
> week.
> 
>  From the discussion a second patch is needed to make sure DAD is done 
> on a link up if there is an address configured.

Thank you!

Let's see if the DAD patch isn't complex, maybe it is a candidate for
stable?

^ permalink raw reply

* Re: [net-next PATCH v3 00/12] Flow API
From: Jamal Hadi Salim @ 2015-01-27 15:54 UTC (permalink / raw)
  To: Andy Gospodarek, David Ahern
  Cc: Simon Horman, John Fastabend, Thomas Graf, Jiri Pirko,
	Pablo Neira Ayuso, sfeldma, netdev, davem, gerlitz.or, andy, ast
In-Reply-To: <20150127045820.GC13164@gospo.home.greyhouse.net>

On 01/26/15 23:58, Andy Gospodarek wrote:
> On Mon, Jan 26, 2015 at 09:28:57PM -0700, David Ahern wrote:

>> Will someone be taking copious notes or recording the sessions and then
>> making those available for those not in attendance?
>>
>
> I'm not sure if the sessions will be recorded, but notes will be taken
> for those wise enough not to come to Ottawa this time of year.  :)
>

We hope the content is hot enough it will melt all the ice around the
building but not down the street.
Tourists are welcome as well ;->

We are soliciting volunteers to do videos that we can post.
Having volunteers taking notes certainly is an excellent idea.

cheers,
janmal

^ permalink raw reply

* Re: [PATCH 1/3] ipv6: Select fragment id during UFO/GSO segmentation if not set.
From: Hannes Frederic Sowa @ 2015-01-27 16:02 UTC (permalink / raw)
  To: vyasevic
  Cc: Michael S. Tsirkin, netdev, Vladislav Yasevich, virtualization,
	edumazet, Ben Hutchings
In-Reply-To: <54C7A007.6050707@redhat.com>

On Di, 2015-01-27 at 09:26 -0500, Vlad Yasevich wrote:
> On 01/27/2015 08:47 AM, Hannes Frederic Sowa wrote:
> > On Di, 2015-01-27 at 10:42 +0200, Michael S. Tsirkin wrote:
> >> On Tue, Jan 27, 2015 at 02:47:54AM +0000, Ben Hutchings wrote:
> >>> On Mon, 2015-01-26 at 09:37 -0500, Vladislav Yasevich wrote:
> >>>> If the IPv6 fragment id has not been set and we perform
> >>>> fragmentation due to UFO, select a new fragment id.
> >>>> When we store the fragment id into skb_shinfo, set the bit
> >>>> in the skb so we can re-use the selected id.
> >>>> This preserves the behavior of UFO packets generated on the
> >>>> host and solves the issue of id generation for packet sockets
> >>>> and tap/macvtap devices.
> >>>>
> >>>> This patch moves ipv6_select_ident() back in to the header file.  
> >>>> It also provides the helper function that sets skb_shinfo() frag
> >>>> id and sets the bit.
> >>>>
> >>>> It also makes sure that we select the fragment id when doing
> >>>> just gso validation, since it's possible for the packet to
> >>>> come from an untrusted source (VM) and be forwarded through
> >>>> a UFO enabled device which will expect the fragment id.
> >>>>
> >>>> CC: Eric Dumazet <edumazet@google.com>
> >>>> Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
> >>>> ---
> >>>>  include/linux/skbuff.h |  3 ++-
> >>>>  include/net/ipv6.h     |  2 ++
> >>>>  net/ipv6/ip6_output.c  |  4 ++--
> >>>>  net/ipv6/output_core.c |  9 ++++++++-
> >>>>  net/ipv6/udp_offload.c | 10 +++++++++-
> >>>>  5 files changed, 23 insertions(+), 5 deletions(-)
> >>>>
> >>>> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> >>>> index 85ab7d7..3ad5203 100644
> >>>> --- a/include/linux/skbuff.h
> >>>> +++ b/include/linux/skbuff.h
> >>>> @@ -605,7 +605,8 @@ struct sk_buff {
> >>>>  	__u8			ipvs_property:1;
> >>>>  	__u8			inner_protocol_type:1;
> >>>>  	__u8			remcsum_offload:1;
> >>>> -	/* 3 or 5 bit hole */
> >>>> +	__u8			ufo_fragid_set:1;
> >>> [...]
> >>>
> >>> Doesn't the flag belong in struct skb_shared_info, rather than struct
> >>> sk_buff?  Otherwise this looks fine.
> >>>
> >>> Ben.
> >>
> >> Hmm we seem to be out of tx flags.
> >> Maybe ip6_frag_id == 0 should mean "not set".
> > 
> > Maybe that is the best idea. Definitely the ufo_fragid_set bit should
> > move into the skb_shared_info area.
> 
> That's what I originally wanted to do, but had to move and grow txflags thus
> skb_shinfo ended up growing.  I wanted to avoid that, so stole an skb flag.
> 
> I considered treating fragid == 0 as unset, but a 0 fragid is perfectly valid
> from the protocol perspective and could actually be generated by the id generator
> functions.  This may cause us to call the id generation multiple times.

Are there plans in the long run to let virtio_net transmit auxiliary
data to the other end so we can clean all of this this up one day?

I don't like the whole situation: looking into the virtio_net headers
just adding a field for ipv6 fragmentation ids to those small structs
seems bloated, not doing it feels incorrect. :/

Thoughts?

Bye,
Hannes

^ permalink raw reply

* Re: [PATCH 1/3] ipv6: Select fragment id during UFO/GSO segmentation if not set.
From: Michael S. Tsirkin @ 2015-01-27 16:08 UTC (permalink / raw)
  To: Hannes Frederic Sowa
  Cc: netdev, Vladislav Yasevich, virtualization, edumazet,
	Ben Hutchings
In-Reply-To: <1422374551.13969.35.camel@stressinduktion.org>

On Tue, Jan 27, 2015 at 05:02:31PM +0100, Hannes Frederic Sowa wrote:
> On Di, 2015-01-27 at 09:26 -0500, Vlad Yasevich wrote:
> > On 01/27/2015 08:47 AM, Hannes Frederic Sowa wrote:
> > > On Di, 2015-01-27 at 10:42 +0200, Michael S. Tsirkin wrote:
> > >> On Tue, Jan 27, 2015 at 02:47:54AM +0000, Ben Hutchings wrote:
> > >>> On Mon, 2015-01-26 at 09:37 -0500, Vladislav Yasevich wrote:
> > >>>> If the IPv6 fragment id has not been set and we perform
> > >>>> fragmentation due to UFO, select a new fragment id.
> > >>>> When we store the fragment id into skb_shinfo, set the bit
> > >>>> in the skb so we can re-use the selected id.
> > >>>> This preserves the behavior of UFO packets generated on the
> > >>>> host and solves the issue of id generation for packet sockets
> > >>>> and tap/macvtap devices.
> > >>>>
> > >>>> This patch moves ipv6_select_ident() back in to the header file.  
> > >>>> It also provides the helper function that sets skb_shinfo() frag
> > >>>> id and sets the bit.
> > >>>>
> > >>>> It also makes sure that we select the fragment id when doing
> > >>>> just gso validation, since it's possible for the packet to
> > >>>> come from an untrusted source (VM) and be forwarded through
> > >>>> a UFO enabled device which will expect the fragment id.
> > >>>>
> > >>>> CC: Eric Dumazet <edumazet@google.com>
> > >>>> Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
> > >>>> ---
> > >>>>  include/linux/skbuff.h |  3 ++-
> > >>>>  include/net/ipv6.h     |  2 ++
> > >>>>  net/ipv6/ip6_output.c  |  4 ++--
> > >>>>  net/ipv6/output_core.c |  9 ++++++++-
> > >>>>  net/ipv6/udp_offload.c | 10 +++++++++-
> > >>>>  5 files changed, 23 insertions(+), 5 deletions(-)
> > >>>>
> > >>>> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> > >>>> index 85ab7d7..3ad5203 100644
> > >>>> --- a/include/linux/skbuff.h
> > >>>> +++ b/include/linux/skbuff.h
> > >>>> @@ -605,7 +605,8 @@ struct sk_buff {
> > >>>>  	__u8			ipvs_property:1;
> > >>>>  	__u8			inner_protocol_type:1;
> > >>>>  	__u8			remcsum_offload:1;
> > >>>> -	/* 3 or 5 bit hole */
> > >>>> +	__u8			ufo_fragid_set:1;
> > >>> [...]
> > >>>
> > >>> Doesn't the flag belong in struct skb_shared_info, rather than struct
> > >>> sk_buff?  Otherwise this looks fine.
> > >>>
> > >>> Ben.
> > >>
> > >> Hmm we seem to be out of tx flags.
> > >> Maybe ip6_frag_id == 0 should mean "not set".
> > > 
> > > Maybe that is the best idea. Definitely the ufo_fragid_set bit should
> > > move into the skb_shared_info area.
> > 
> > That's what I originally wanted to do, but had to move and grow txflags thus
> > skb_shinfo ended up growing.  I wanted to avoid that, so stole an skb flag.
> > 
> > I considered treating fragid == 0 as unset, but a 0 fragid is perfectly valid
> > from the protocol perspective and could actually be generated by the id generator
> > functions.  This may cause us to call the id generation multiple times.
> 
> Are there plans in the long run to let virtio_net transmit auxiliary
> data to the other end so we can clean all of this this up one day?
> 
> I don't like the whole situation: looking into the virtio_net headers
> just adding a field for ipv6 fragmentation ids to those small structs
> seems bloated, not doing it feels incorrect. :/
> 
> Thoughts?
> 
> Bye,
> Hannes

I'm not sure - what will be achieved by generating the IDs guest side as
opposed to host side?  It's certainly harder to get hold of entropy
guest-side.

-- 
MST

^ permalink raw reply

* Re: [RFC PATCH] net: ipv6: Make address flushing on ifdown optional
From: Andy Gospodarek @ 2015-01-27 16:09 UTC (permalink / raw)
  To: Hannes Frederic Sowa; +Cc: Stephen Hemminger, David Ahern, netdev
In-Reply-To: <1422351861.13969.5.camel@stressinduktion.org>

On Tue, Jan 27, 2015 at 10:44:21AM +0100, Hannes Frederic Sowa wrote:
> Hi,
> 
> On Mo, 2015-01-26 at 23:56 -0500, Andy Gospodarek wrote:
> > On Fri, Jan 23, 2015 at 01:22:17PM +0100, Hannes Frederic Sowa wrote:
> > > On Do, 2015-01-22 at 22:40 -0800, Stephen Hemminger wrote:
> > > > On Wed, 14 Jan 2015 12:17:19 -0700
> > > > David Ahern <dsahern@gmail.com> wrote:
> > > > 
> > > > > Currently, ipv6 addresses are flushed when the interface is configured down:
> > > > > 
> > > > > [root@f20 ~]# ip -6 addr add dev eth1 2000:11:1:1::1/64
> > > > > [root@f20 ~]# ip addr show dev eth1
> > > > > 3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
> > > > >     link/ether 02:04:11:22:33:01 brd ff:ff:ff:ff:ff:ff
> > > > >     inet6 2000:11:1:1::1/64 scope global tentative
> > > > >        valid_lft forever preferred_lft forever
> > > > > [root@f20 ~]# ip link set dev eth1 up
> > > > > [root@f20 ~]# ip link set dev eth1 down
> > > > > [root@f20 ~]# ip addr show dev eth1
> > > > > 3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
> > > > >     link/ether 02:04:11:22:33:01 brd ff:ff:ff:ff:ff:ff
> > > > > 
> > > > > Add a new sysctl to make this behavior optional. Setting defaults to flush
> > > > > addresses to maintain backwards compatibility. When reset flushing is bypassed:
> > > > > 
> > > > > [root@f20 ~]# echo 0 > /proc/sys/net/ipv6/conf/eth1/flush_addr_on_down
> > > > > [root@f20 ~]# ip -6 addr add dev eth1 2000:11:1:1::1/64
> > > > > [root@f20 ~]# ip addr show dev eth1
> > > > > 3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
> > > > >     link/ether 02:04:11:22:33:01 brd ff:ff:ff:ff:ff:ff
> > > > >     inet6 2000:11:1:1::1/64 scope global tentative
> > > > >        valid_lft forever preferred_lft forever
> > > > > [root@f20 ~]#  ip link set dev eth1 up
> > > > > [root@f20 ~]#  ip link set dev eth1 down
> > > > > [root@f20 ~]# ip addr show dev eth1
> > > > > 3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
> > > > >     link/ether 02:04:11:22:33:01 brd ff:ff:ff:ff:ff:ff
> > > > >     inet6 2000:11:1:1::1/64 scope global
> > > > >        valid_lft forever preferred_lft forever
> > > > >     inet6 fe80::4:11ff:fe22:3301/64 scope link
> > > > >        valid_lft forever preferred_lft forever
> > > > > 
> > > > > Suggested-by: Hannes Frederic Sowa <hannes@redhat.com>
> > > > > Signed-off-by: David Ahern <dsahern@gmail.com>
> > > > > Cc: Hannes Frederic Sowa <hannes@redhat.com>
> > > > 
> > > > Would this break existing application expecting a particular semantic
> > > > by listening to netlink?  What happens to packets received with the static
> > > > address when interface is down? With IPv4 Linux is mostly a weak host
> > > > model, and IPv6 somewhere in between.
> > > 
> > > IPv6 is mostly a weak end model, too, but IFA_LINK addresses are used
> > > much more. So yes, it is somewhere in between.
> > > 
> > > Addresses bound to interfaces which are currently down will work with
> > > IPv6 (in contrast to IPv4).
> > > 
> > > > For vendors that control the application stack or have limited number
> > > > of services this would work fine, but what about RHEL?
> > > 
> > > The new model is only enabled if the sysctl is set. I don't expect a lot
> > > of vendors or distributions switching anytime soon.
> > 
> > You are probably correct that many will not switch, but this sysctl
> > gives those who want to switch a nice option without having to carry
> > extra kernel patches.  I like it. 
> 
> I don't see any problem with the patch in general but DAD should
> definitely happen on reenabling interfaces. Current behavior does not
> seem fine to me. It's ok if this patch doesn't change this behavior now
> but a follow-up one will be needed then.
> 
> David, will you look after the DAD logic and do you plan a follow-up
> patch?
> 
> > I have been pondering a few different changes to interface address and
> > route behavior on both interface and link (gasp!) down and would like to
> > use sysctls to make those options available to those who are interested
> > without changing the current model.
> 
> Can you be more specific? In the last year we added some per interface
> flags to e.g. handle the creation of on-link routes in case of an
> address gets added to the interface. Maybe this is the better approach,
> because quite a lot of stuff happens interface local in IPv6.

Unfortunately some of the work I've been doing is on a 3.2 long-term
kernel, but I've also been testing some of my hacks^Wpatches on the
latest tree as well to make control/mark FIB entries based on
link-status (carrier not I would call 'admin state' set via 'ip link
set').

Overloading the use of the onlink could be a good option -- I'll review
your patches and the functionality a bit more closely to see if I can
merge my changes with those and clean everything up.

I know that NM, netplugd, ifplugd, networkd, etc. could be used to
handle issue like this, but an in-kernel solution has a much better
chance of being reliable when you are dealing with ~100 network
interfaces and do not want to black-hole traffic when link is down to a
router in your datacenter and there is another possible route to get to
the network that was previously directly connected.

^ permalink raw reply

* Re: [PATCH 1/3] ipv6: Select fragment id during UFO/GSO segmentation if not set.
From: Vlad Yasevich @ 2015-01-27 16:25 UTC (permalink / raw)
  To: Hannes Frederic Sowa
  Cc: Michael S. Tsirkin, netdev, Vladislav Yasevich, virtualization,
	edumazet, Ben Hutchings
In-Reply-To: <1422374551.13969.35.camel@stressinduktion.org>

On 01/27/2015 11:02 AM, Hannes Frederic Sowa wrote:
> On Di, 2015-01-27 at 09:26 -0500, Vlad Yasevich wrote:
>> On 01/27/2015 08:47 AM, Hannes Frederic Sowa wrote:
>>> On Di, 2015-01-27 at 10:42 +0200, Michael S. Tsirkin wrote:
>>>> On Tue, Jan 27, 2015 at 02:47:54AM +0000, Ben Hutchings wrote:
>>>>> On Mon, 2015-01-26 at 09:37 -0500, Vladislav Yasevich wrote:
>>>>>> If the IPv6 fragment id has not been set and we perform
>>>>>> fragmentation due to UFO, select a new fragment id.
>>>>>> When we store the fragment id into skb_shinfo, set the bit
>>>>>> in the skb so we can re-use the selected id.
>>>>>> This preserves the behavior of UFO packets generated on the
>>>>>> host and solves the issue of id generation for packet sockets
>>>>>> and tap/macvtap devices.
>>>>>>
>>>>>> This patch moves ipv6_select_ident() back in to the header file.  
>>>>>> It also provides the helper function that sets skb_shinfo() frag
>>>>>> id and sets the bit.
>>>>>>
>>>>>> It also makes sure that we select the fragment id when doing
>>>>>> just gso validation, since it's possible for the packet to
>>>>>> come from an untrusted source (VM) and be forwarded through
>>>>>> a UFO enabled device which will expect the fragment id.
>>>>>>
>>>>>> CC: Eric Dumazet <edumazet@google.com>
>>>>>> Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
>>>>>> ---
>>>>>>  include/linux/skbuff.h |  3 ++-
>>>>>>  include/net/ipv6.h     |  2 ++
>>>>>>  net/ipv6/ip6_output.c  |  4 ++--
>>>>>>  net/ipv6/output_core.c |  9 ++++++++-
>>>>>>  net/ipv6/udp_offload.c | 10 +++++++++-
>>>>>>  5 files changed, 23 insertions(+), 5 deletions(-)
>>>>>>
>>>>>> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
>>>>>> index 85ab7d7..3ad5203 100644
>>>>>> --- a/include/linux/skbuff.h
>>>>>> +++ b/include/linux/skbuff.h
>>>>>> @@ -605,7 +605,8 @@ struct sk_buff {
>>>>>>  	__u8			ipvs_property:1;
>>>>>>  	__u8			inner_protocol_type:1;
>>>>>>  	__u8			remcsum_offload:1;
>>>>>> -	/* 3 or 5 bit hole */
>>>>>> +	__u8			ufo_fragid_set:1;
>>>>> [...]
>>>>>
>>>>> Doesn't the flag belong in struct skb_shared_info, rather than struct
>>>>> sk_buff?  Otherwise this looks fine.
>>>>>
>>>>> Ben.
>>>>
>>>> Hmm we seem to be out of tx flags.
>>>> Maybe ip6_frag_id == 0 should mean "not set".
>>>
>>> Maybe that is the best idea. Definitely the ufo_fragid_set bit should
>>> move into the skb_shared_info area.
>>
>> That's what I originally wanted to do, but had to move and grow txflags thus
>> skb_shinfo ended up growing.  I wanted to avoid that, so stole an skb flag.
>>
>> I considered treating fragid == 0 as unset, but a 0 fragid is perfectly valid
>> from the protocol perspective and could actually be generated by the id generator
>> functions.  This may cause us to call the id generation multiple times.
> 
> Are there plans in the long run to let virtio_net transmit auxiliary
> data to the other end so we can clean all of this this up one day?

Yes, and I am working on this.  Part of that is UFO/UFO6 split so that the
fragment id is carried for UFO6.

> 
> I don't like the whole situation: looking into the virtio_net headers
> just adding a field for ipv6 fragmentation ids to those small structs
> seems bloated, not doing it feels incorrect. :/
> 

We are thinking right now how to extend virtio_net header as this is
not the only extension people have thought off.  It'll probably only
happen for virtio 1.0 spec, so we may still have to support legacy
devices that may still rely on UFO being available.

-vlad
> Thoughts?
> 
> Bye,
> Hannes
> 
> 

^ permalink raw reply

* Re: Fw: [Bug 92081] New: skb->len=0 and getting "EOF on netlink" with "ip monitor all" (of iproute) when adding a vlan with "bridge vlan add"
From: roopa @ 2015-01-27 16:36 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev
In-Reply-To: <20150127120123.4550d9ca@uryu.home.lan>

I noticed this during my  recent cleanup of 
rtnl_bridge_setlink/rtnl_bridge_dellink.

I think my below commit fixed one case of such error:

commit 02dba4388d1691a087f40fe8acd2e1ffd577a07f
Author: Roopa Prabhu <roopa@cumulusnetworks.com>
Date:   Wed Jan 14 20:02:25 2015 -0800

     bridge: fix setlink/dellink notifications



The reason for the zero length message in this case is that the user is 
sending
  the setlink request to the bridge with self flag set.
And since the getlink on the bridge device only returns bytes when its 
a  bridge port,
there are no bytes in the skb.

I will reconfirm that the above is true and submit a patch (I can update 
the bugzilla link below as well).

Thanks,
Roopa



On 1/27/15, 4:01 AM, Stephen Hemminger wrote:
>
> Begin forwarded message:
>
> Date: Mon, 26 Jan 2015 10:15:12 -0800
> From: "bugzilla-daemon@bugzilla.kernel.org" <bugzilla-daemon@bugzilla.kernel.org>
> To: "stephen@networkplumber.org" <stephen@networkplumber.org>
> Subject: [Bug 92081] New: skb->len=0 and getting "EOF on netlink" with "ip monitor all" (of iproute) when adding a vlan with "bridge vlan add"
>
>
> https://bugzilla.kernel.org/show_bug.cgi?id=92081
>
>              Bug ID: 92081
>             Summary: skb->len=0 and getting "EOF on netlink" with "ip
>                      monitor all" (of iproute) when adding a vlan with
>                      "bridge vlan add"
>             Product: Networking
>             Version: 2.5
>      Kernel Version: 3.17.6-300
>            Hardware: All
>                  OS: Linux
>                Tree: Fedora
>              Status: NEW
>            Severity: high
>            Priority: P1
>           Component: Other
>            Assignee: shemminger@linux-foundation.org
>            Reporter: ramirose@gmail.com
>          Regression: No
>
> On Fedora 21, with 3.17.6-300.fc21.x86_64, with iproute-3.16.0-3 (installed
> from rpm),
> ip -V:
> ip utility, iproute2-ss140804
>
> Running in one terminal:
> ip monitor all
>
> And then running in a second terminal this sequence:
> ip link add br0 type bridge
> bridge vlan add vid 10 dev br0 self
>
> causes the "ip monitor all" to terminate, with "EOF on netlink".
>
> This happens also on older distros of Fedora (Fedora 20 and downward) with
> older kernels.
>
> It seems that the reason is that an skb->len is 0 for the netlink notification
> which is sent from
> with rtnl_notify() which is invoked from  rtnl_bridge_notify(), which in turn
> is invoked from  rtnl_bridge_setlink().
>
> See:
> http://lxr.free-electrons.com/source/net/core/rtnetlink.c#L2773
>
> Rami Rosen
>

^ permalink raw reply

* [PATCH v1] stmmac: prevent probe drivers to crash kernel
From: Andy Shevchenko @ 2015-01-27 16:38 UTC (permalink / raw)
  To: Giuseppe Cavallaro, netdev; +Cc: Andy Shevchenko

In the case when alloc_netdev fails we return NULL to a caller. But there is no
check for NULL in the probe drivers. This patch changes NULL to an error
pointer. The function description is amended to reflect what we may get
returned.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 8c6b7c1..cf62ff4 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -2778,6 +2778,9 @@ static int stmmac_hw_init(struct stmmac_priv *priv)
  * @addr: iobase memory address
  * Description: this is the main probe function used to
  * call the alloc_etherdev, allocate the priv structure.
+ * Return:
+ * on success the new private structure is returned, otherwise the error
+ * pointer.
  */
 struct stmmac_priv *stmmac_dvr_probe(struct device *device,
 				     struct plat_stmmacenet_data *plat_dat,
@@ -2789,7 +2792,7 @@ struct stmmac_priv *stmmac_dvr_probe(struct device *device,
 
 	ndev = alloc_etherdev(sizeof(struct stmmac_priv));
 	if (!ndev)
-		return NULL;
+		return ERR_PTR(-ENOMEM);
 
 	SET_NETDEV_DEV(ndev, device);
 
-- 
2.1.4

^ permalink raw reply related

* Re: [PATCH] stmmac: platform: adjust messages and move to dev level
From: Andy Shevchenko @ 2015-01-27 16:41 UTC (permalink / raw)
  To: David Miller; +Cc: peppe.cavallaro, netdev
In-Reply-To: <20141209.182837.2218983730769727387.davem@davemloft.net>

On Tue, 2014-12-09 at 18:28 -0500, David Miller wrote:
> From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Date: Tue,  9 Dec 2014 11:59:13 +0200
> 
> > This patch amendes error and warning messages across the platform driver. It
> > includes the following changes:
> >  - remove unneccessary message when no memory is available
> >  - change info level to warn in the validation functions
> >  - append \n to the end of messages
> >  - change pr_* macros to dev_*
> > 
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> This does not apply to the net-next tree, please respin.

Gently ping on this patch. It smoothly applies to the current net-next,
IIUC.

-- 
Andy Shevchenko <andriy.shevchenko@intel.com>
Intel Finland Oy

^ permalink raw reply

* Re: [PATCH] net: Linn Ethernet Packet Sniffer driver
From: Stathis Voukelatos @ 2015-01-27 17:22 UTC (permalink / raw)
  To: Daniel Borkmann
  Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, abrestic@chromium.org, f.fainelli
In-Reply-To: <54C7A4DD.7030109@redhat.com>


Hi Daniel,

On 27/01/15 14:46, Daniel Borkmann wrote:
>> Just wanted to clarify some implementation details for your approach.
>> - The driver would need to create and register two net_device instances.
>> One for sniffing Ethernet TX packets and one for RX.
>
> Hm, I would represent the whole device as a single monitoring-only 
> netdev.
> I'm somehow still missing the big advantage of all this as compared to
> using packet sockets on the normal netdev? I couldn't parse that from 
> your
> commit message.

This H/W module was developed to allow accurate timestamping of selected
outgoing or incoming data packets. Timestamp values are provided by an
external implementation-dependent clock or timer that is of suitable
quality for the application.
Example: multiple audio receivers synchronizing their clocks to a
single transmitter, for synchronized playback.

The TX and RX blocks of the sniffer can be operated (eg. started, stopped,
configured) independently, that is why I believe two netdev instances would
be a better match to the H/W architecture.

>
>> - Would the control interface for the sniffer in that case need to be
>> through private socket ioctls (ie SIOCDEVPRIVATE + x ioctl ids)?
>
> Nope, please have a look at Documentation/networking/packet_mmap.txt.
>
>
Thanks for the link to the document. That is the way forward for retrieving
data from sniffer match events from user space very efficiently.

However, I am not sure about configuration, where we want to eg set the
command string, or query device attributes such as the size of the command
memory. That looks more suitable to an ioctl or a netlink message to me
and better use the packet socket just for data from sniffer match events.

Thanks,
Stathis

^ permalink raw reply

* Re: [E1000-devel] [PATCH 1/2] if_link: Add VF multicast promiscuous mode control
From: Alexander Duyck @ 2015-01-27 17:34 UTC (permalink / raw)
  To: Hiroshi Shimamoto, Skidmore, Donald C, Bjørn Mork
  Cc: e1000-devel@lists.sourceforge.net, netdev@vger.kernel.org,
	Choi, Sy Jong, linux-kernel@vger.kernel.org, David Laight,
	Hayato Momma
In-Reply-To: <7F861DC0615E0C47A872E6F3C5FCDDBD05E1335D@BPXM14GP.gisp.nec.co.jp>

On 01/27/2015 04:53 AM, Hiroshi Shimamoto wrote:
>>> On 01/22/2015 04:32 PM, Hiroshi Shimamoto wrote:
>>>>> Subject: RE: [E1000-devel] [PATCH 1/2] if_link: Add VF multicast
>>>>> promiscuous mode control
>>>>>> "Skidmore, Donald C" <donald.c.skidmore@intel.com> writes:
>>>>>>
>>>>>>> My hang up is more related to: without the nob to enable it (off by
>>>>>>> default) we are letting one VF dictate policy for all the other VFs
>>>>>>> and the PF.  If one VF needs to be in promiscuous multicast so is
>>>>>>> everyone else.  Their stacks now needs to deal with all the extra
>>>>>>> multicast packets.  As you point out this might not be a direct
>>>>>>> concern for isolation in that the VM could have 'chosen' to join
>>>>>>> any Multicast group and seen this traffic.  My concern over
>>>>>>> isolation is one VF has chosen that all the other VM now have to
>>>>>>> see this multicast traffic.
>>>>>> Apologies if this question is stupid, but I just have to ask about
>>>>>> stuff I don't understand...
>>>>>>
>>>>>> Looking at the proposed implementation, the promiscous multicast
>>>>>> flag seems to be a per-VF flag:
>>>>>>
>>>>>> +int ixgbe_ndo_set_vf_mc_promisc(struct net_device *netdev, int vf,
>>>>>> +bool
>>>>>> +setting) {
>>>>>> +	struct ixgbe_adapter *adapter = netdev_priv(netdev);
>>>>>> +	struct ixgbe_hw *hw = &adapter->hw;
>>>>>> +	u32 vmolr;
>>>>>> +
>>>>>> +	if (vf >= adapter->num_vfs)
>>>>>> +		return -EINVAL;
>>>>>> +
>>>>>> +	adapter->vfinfo[vf].mc_promisc_enabled = setting;
>>>>>> +
>>>>>> +	vmolr = IXGBE_READ_REG(hw, IXGBE_VMOLR(vf));
>>>>>> +	if (setting) {
>>>>>> +		e_info(drv, "VF %u: enabling multicast promiscuous\n", vf);
>>>>>> +		vmolr |= IXGBE_VMOLR_MPE;
>>>>>> +	} else {
>>>>>> +		e_info(drv, "VF %u: disabling multicast promiscuous\n", vf);
>>>>>> +		vmolr &= ~IXGBE_VMOLR_MPE;
>>>>>> +	}
>>>>>> +
>>>>>> +	IXGBE_WRITE_REG(hw, IXGBE_VMOLR(vf), vmolr);
>>>>>> +
>>>>>> +	return 0;
>>>>>> +}
>>>>>> +
>>>>>>
>>>>>> I haven't read the data sheet, but I took a quick look at the
>>>>>> excellent high level driver docs:
>>>>>> http://www.intel.com/content/dam/doc/design-guide/82599-sr-iov-
>>> drive
>>>>>> r-
>>>>>> companion-guide.pdf
>>>>>>
>>>>>> It mentions "Multicast Promiscuous Enable" in its "Thoughts for
>>>>>> Customization" section:
>>>>>>
>>>>>>  7.1 Multicast Promiscuous Enable
>>>>>>
>>>>>>  The controller has provisions to allow each VF to be put into
>>>>>> Multicast Promiscuous mode.  The Intel reference driver does not
>>>>>> configure this option .
>>>>>>
>>>>>>  The capability can be enabled/disabled by manipulating the MPE
>>>>>> field  (bit
>>>>>> 28) of the PF VF L2 Control Register (PFVML2FLT – 0x0F000)
>>>>>>
>>>>>> and showing a section from the data sheet describing the "PF VM L2
>>>>>> Control Register - PFVML2FLT[n]  (0x0F000 + 4 * n, n=0...63; RW)"
>>>>>>
>>>>>> To me it looks like enabling Promiscuos Multicast for a VF won't
>>>>>> affect any other VF at all.  Is this really not the case?
>>>>>>
>>>>>>
>>>>>>
>>>>>> Bjørn
>>>>> Clearly not a dumb question at all and I'm glad you mentioned that.
>>>>> :)  I was going off the assumption, been awhile since I read the
>>>>> patch, that the patch was using FCTRL.MPE or MANC.MCST_PASS_L2
>>> which would turn multicast promiscuous on for everyone.  Since the patch is
>>> using PFVML2FLT.MPE this lessens my concern over effect on the entire
>>> system.
>>>> I believe the patches for this VF multicast promiscuous mode is per VF.
>>>>
>>>>> That said I still would prefer having a way to override this behavior on the
>>> PF, although I admit my argument is weaker.
>>>>> I'm still concerned about a VF changing the behavior of the PF
>>>>> without any way to prevent it.  This might be one part philosophical
>>>>> (PF sets policy not the VF) but this still could have a noticeable
>>>>> effect on the overall system.  If any other VFs (or the PF) are
>>>>> receiving MC packets these will have to be replicated which will be a
>>>>> performance hit.  When we use the MC hash this is limited vs. when
>>> anyone is in MC promiscuous every MC packet used by another pool would
>>> be replicated.  I could imagine in some environments (i.e. public clouds)
>>> where you don't trust what is running in your VM you might what to block
>>> this from happening.
>>>> I understand your request and I'm thinking to submit the patches
>>>>   1) Add new mbox API between ixgbe/ixgbevf to turn MC promiscuous on,
>>>>      and enables it when ixgbevf needs over 30 MC addresses.
>>>>   2) Add a policy knob to prevent enabling it from the PF.
>>>>
>>>> Does it seem okay?
>>> I would advise that if such a knob is added it should be set to disabled by
>>> default.  The main problem with supporting that many multicast addresses
>>> per VF is that you run the risk for flooding the PCIe interface on the network
>>> adapter if too many adapters were to go into such a mode.
>>>
>> This was my understanding as well.  Someone would have to "choose" to allow VM to enter this mode, meaning off by default.
> I see you'd like to keep it off unless the administrator wants to configure.

Correct.  This is a somewhat risky configuration so it is best to
control who has access to it.

One additional thought is that you may want to make it so that the VF
has some control over it from its side as well.  In the case of the igb
driver I believe there is already a control for setting the multicast
promiscuous in the event of exceeding 30 multicast addresses.  You may
want to look at that for ideas on how to have a mailbox message work in
conjunction with your control to allow enabling/disabling the multicast
promiscuous mode.

>>>> BTW, I'm bit worried about to use ndo interface for 2) because adding
>>>> a new hook makes core code complicated.
>>>> Is it really reasonable to do it with ndo?
>>>> I haven't find any other suitable method to do it, right now. And
>>>> using ndo VF hook looks standard way to control VF functionality.
>>>> Then, I think it's the best way to implement this policy in ndo hook.
>>> The ndo is probably the only way to go on this.  It is how past controls for the
>>> VF network functionality have been implemented.
>>>
>>>>> In some ways it is almost the mirror image of the issue you brought up:
>>>>>
>>>>> Adding a new hook for this seems over-complicated to me.  And it
>>>>> still doesn't solve the real problems that
>>>>>  a) the user has to know about this limit, and
>>>>>  b) manually configure the feature
>>>>>
>>>>> My reverse argument might be that if this happens automatically.  It
>>>>> might take the VM provider a long time to realize performance has
>>>>> taken a hit because some VM asked to join 31 multicast groups and
>>> entered MC promiscuous.  Then only to find that they have no way to block
>>> such behavior.
>>>>> Maybe I wouldn't as concerned if the patch author could provide some
>>>>> performance results to show this won't have as a negative effect as I'm
>>> afraid it might?
>>>> Hm, what kind of test case would you like to have?
>>>> The user A who has 30 MC addresses vs the user B who has 31 MC
>>>> addresses, which means that MC promiscuous mode, and coming MC
>>> packets the user doesn't expect?
>>>> thanks,
>>>> Hiroshi
>>> The question I would have is how many of these interfaces do you expect to
>>> have supporting the expanded multicast mode?  As it currently stands
> Right now, we're thinking 1 or 2 VFs per PF will be enabled this feature
> in our use case. Another representation, 1 or 2 VMs will be used VF device on
> one server, each VM has 2 VFs usually.

This seems reasonable.  If it is only one or two VFs then you probably
would be better of using the promiscuous mode.

>>> multicast traffic has the potential to flood the adapter, greatly reduce the
>>> overall throughput, and add extra workload to the PF and all VFs.
>>> For example if several VFs enable this feature, and then someone on the
>>> network sends a stream of multicast traffic what happens to the CPU load for
>>> the host system?
> I'm not sure why all VFs are affected.
> I can imagine that PF and VFs which are enabled this feature could receive
> flooding packets, but other VFs never receive such packets.

The other VFs would't be receiving the traffic, they would just have
reduced access to traffic because for each VF that can receive a packet
it multiplies the PCIe bandwidth.  So if you have 4 VFs in multicast
promiscuous mode then that means for each multicast frame receive the
PCIe bus will have to pass the frame 4 times in order to provide a copy
to each VF.   When you consider that the 82599 can support 64 VFs this
replication can have a huge impact on the PCIe bus bandwidth.

>>> Also how many addresses beyond 30 is it you require?  An alternative to
>>> adding multicast promiscuous might be to consider extending the mailbox
>>> API to support sending more than 30 addresses via something such as a
>>> multi-part multicast configuration message.  The fm10k driver already has
>>> logic similar to this as it adds addresses 1 at a time though a separate Switch
>>> interface API between the PF and the Switch.  You might be able to reuse
>>> some of that code to reach beyond the 30 address limit.
>> I think this would be a much safer approach and probably scale well for small sets.  However I don't think it would work
>> for Hiroshi's use case.  If I remember correctly he wanted 1000's of MC groups per VM.   I imagine there would be considerable
>> overhead even loading up our 4K hash table 1 address at a time, likewise with that many address wouldn't this just be
>> pretty much the same as being in multicast promiscuous.  Still this might be an interesting approach to support those
>> needing only a few MC groups over the limit.
> We would like to use 2000 IPs usually, and would extend to 4k which comes from VLAN limit.
> IIRC, mbox API has only 32 words, it doesn't scale, I think.
> And there is a single hash table per PF, not per VF. I guess if we set 4k hash entries
> from a specific VF, every VF will receive all MC packets.

This is true.  So if you only have one or two VFs that you expect to
need that many entries it might be preferable to go the multicast
promiscuous route to avoid excess replication.

>> Alex's point is worth reiterating, this will effect performance.  Have you tested this out under load and still see the
>> results you can live with?
> I don't have any number in MC load.
> In general case, we have enough performance in VM, almost wire rate in our scenario.
>
> thanks,
> Hiroshi
>

I'd say your best bet for this is to make it both an NDO (defaulted to
disabled) and a mailbox request.  If both are enabling it then enable
the feature.  That way you can avoid possibly sending unexpected packets
to a legacy VF, or allowing a VF to enable it on a system that hasn't
been configured for it.

- Alex

^ permalink raw reply

* Re: [PATCH net-next v1 05/18] net: tx4939: use __ethtool_get_ksettings
From: David Decotigny @ 2015-01-27 17:38 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: David S. Miller, Ben Hutchings, Amir Vadai,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Eric Dumazet,
	Eugenia Emantayev, Or Gerlitz, Ido Shamay, Joe Perches,
	Saeed Mahameed, Govindarajulu Varadarajan, Venkata Duvvuru,
	Jeff Kirsher, Eyal Perry, Pravin B Shelar, Ed Swierk
In-Reply-To: <54C78540.6080404-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>

On Tue, Jan 27, 2015 at 4:32 AM, Sergei Shtylyov
<sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org> wrote:
> linux-mips-6z/3iImG2C/i7sgoIIk9UQ@public.gmane.org

Thanks, added mips + usnic + fcoe in my copy for the next wave of
reviews. Also updated the subject line.

^ permalink raw reply

* Re: [PATCH net-next V1 04/11] net/mlx4_core: Adjust command timeouts to conform to the firmware spec
From: Jack Morgenstein @ 2015-01-27 18:06 UTC (permalink / raw)
  To: David Laight
  Cc: 'Amir Vadai', David S. Miller, netdev@vger.kernel.org,
	Or Gerlitz, Yevgeny Petrilin
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D1CAD3EAA@AcuExch.aculab.com>

On Tue, 27 Jan 2015 14:30:31 +0000
David Laight <David.Laight@ACULAB.COM> wrote:

> From: Amir Vadai
> > From: Jack Morgenstein <jackm@dev.mellanox.co.il>
> > 
> > The firmware spec states that the timeout for all commands should
> > be 60 seconds.
> 
> Hmmm... 60 seconds seems a long time to wait for a device to do
> something.
> 
> I'll have given up and reset the machine before that expires.
> 
> 	David
> 

We have some automatic recovery features which involve resetting the
HCA upon command timeout, and we purposely give a long timeout
in order to be sure that there are no false positives
(i.e., unjustified resets).

-Jack

^ permalink raw reply

* Re: [PATCH 3/3] net: allwinner: sun4i-emac: fix emac SRAM mapping
From: Maxime Ripard @ 2015-01-27 18:13 UTC (permalink / raw)
  To: Jens Kuske
  Cc: Arnd Bergmann, Lee Jones, netdev-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Chen-Yu Tsai,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw
In-Reply-To: <54C65089.70305-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

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

Hi,

On Mon, Jan 26, 2015 at 03:34:49PM +0100, Jens Kuske wrote:
> Hi,
> 
> On 25/01/15 17:25, Maxime Ripard wrote:
> >Hi Jens,
> >
> >On Sun, Jan 25, 2015 at 04:49:19PM +0100, Jens Kuske wrote:
> >>The EMAC needs SRAM block A3_A4 being mapped to EMAC peripheral to
> >>work. This is done by the bootloader most of the time, but U-Boot
> >>Falcon Mode, for example, skips emac initialization and SRAM would
> >>stay mapped to the CPU.
> >
> >Thanks for reviving this.
> >
> >>Signed-off-by: Jens Kuske <jenskuske-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> >>---
> >>  drivers/net/ethernet/allwinner/Kconfig      |  1 +
> >>  drivers/net/ethernet/allwinner/sun4i-emac.c | 18 ++++++++++++++++++
> >>  2 files changed, 19 insertions(+)
> >>
> >>diff --git a/drivers/net/ethernet/allwinner/Kconfig b/drivers/net/ethernet/allwinner/Kconfig
> >>index d8d95d4..508a288 100644
> >>--- a/drivers/net/ethernet/allwinner/Kconfig
> >>+++ b/drivers/net/ethernet/allwinner/Kconfig
> >>@@ -28,6 +28,7 @@ config SUN4I_EMAC
> >>  	select MII
> >>  	select PHYLIB
> >>  	select MDIO_SUN4I
> >>+	select MFD_SYSCON
> >>          ---help---
> >>            Support for Allwinner A10 EMAC ethernet driver.
> >>
> >>diff --git a/drivers/net/ethernet/allwinner/sun4i-emac.c b/drivers/net/ethernet/allwinner/sun4i-emac.c
> >>index 1fcd556..86c891d 100644
> >>--- a/drivers/net/ethernet/allwinner/sun4i-emac.c
> >>+++ b/drivers/net/ethernet/allwinner/sun4i-emac.c
> >>@@ -18,6 +18,8 @@
> >>  #include <linux/gpio.h>
> >>  #include <linux/interrupt.h>
> >>  #include <linux/irq.h>
> >>+#include <linux/mfd/syscon.h>
> >>+#include <linux/mfd/syscon/sun4i-sc.h>
> >>  #include <linux/mii.h>
> >>  #include <linux/module.h>
> >>  #include <linux/netdevice.h>
> >>@@ -28,6 +30,7 @@
> >>  #include <linux/of_platform.h>
> >>  #include <linux/platform_device.h>
> >>  #include <linux/phy.h>
> >>+#include <linux/regmap.h>
> >>
> >>  #include "sun4i-emac.h"
> >>
> >>@@ -78,6 +81,7 @@ struct emac_board_info {
> >>
> >>  	struct phy_device	*phy_dev;
> >>  	struct device_node	*phy_node;
> >>+	struct regmap		*sc;
> >>  	unsigned int		link;
> >>  	unsigned int		speed;
> >>  	unsigned int		duplex;
> >>@@ -862,6 +866,18 @@ static int emac_probe(struct platform_device *pdev)
> >>  		goto out;
> >>  	}
> >>
> >>+	/* Map SRAM_A3_A4 to EMAC */
> >>+	db->sc = syscon_regmap_lookup_by_compatible(
> >>+						"allwinner,sun4i-a10-syscon");
> >>+	if (IS_ERR(db->sc)) {
> >>+		dev_err(&pdev->dev, "failed to find syscon regmap\n");
> >>+		ret = PTR_ERR(db->sc);
> >>+		goto out;
> >>+	}
> >>+
> >>+	regmap_update_bits(db->sc, SUN4I_SC1, SUN4I_SC1_SRAM_A3_A4_MAP_MASK,
> >>+						SUN4I_SC1_SRAM_A3_A4_MAP_EMAC);
> >>+
> >
> >I don't think that using a syscon is the right solution here.
> >
> >All this SRAM mapping thing is mutually exclusive, and will possibly
> >impact other drivers as well.
> 
> Each single SRAM area can only be mapped to a single peripheral, so as long
> as the driver only changes bits related to his own area nothing can go wrong
> I believe.

Which is exactly my point. This kind of assumption is very
fragile. Such mistakes might be made, will slip in under any review
and might get un-noticed for a very long time.

While adding a simple driver at least would make this obvious when two
drivers will contend for the same SRAM mapping.

> SRAM_C2 looks like it can be mapped do different devices (AE, CE, ACE), but
> as far as I understand this, they are all related to the ACE device, sharing
> a common register space, and would have to be handled by a single driver
> anyway (if that will ever happen without docs)
> https://linux-sunxi.org/ACE_Register_guide
> 
> >I think this is a more a case for a small driver in drivers/soc that
> >would take care of this, and make sure that client drivers don't step
> >on each other's toe.
> 
> I'm not convinced this is necessary, but what would this driver do different
> than a basic regmap? Check if the area is already mapped by any driver and
> deny mapping it again by a different driver? Which different driver, each
> area is only interesting for a single device/driver? Except maybe mapping it
> to CPU as general purpose sram, but that would need some direct agreement
> with the driver to steal its memory anyway.

Off the top of my head:
  - Make sure no one step on each other's toe, including the CPU that
    might require a SRAM for several things (suspend, cpuidle, PSCI,
    etc.)
  - Provide a comprehensive status of the various SRAM and what they
    are mapped to in debugfs
  - Provide an abstraction to the SRAM mapping IP. You make the
    assumption that the client drivers will always use on an A10 or an
    SoC that has the same SRAMs, and the same IP to control which
    device they are mapped to. This might not be true for other
    drivers, and other SoCs.
  - Make any adjustment to these registers that wouldn't fit in any
    client drivers.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox