Netdev List
 help / color / mirror / Atom feed
* Re: Cannot use NFS with linux-next 20160429
From: Fabio Estevam @ 2016-05-03 19:37 UTC (permalink / raw)
  To: Chuck Lever
  Cc: Trond Myklebust, netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Linux NFS Mailing List
In-Reply-To: <13CA7D80-3F3D-4D92-9E52-1434BD8047DE-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>

Hi Chuck,

On Sun, May 1, 2016 at 4:52 PM, Chuck Lever <chuck.lever-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> wrote:
> Hi Fabio-
>
>> On Apr 29, 2016, at 7:18 PM, Fabio Estevam <festevam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>
>> Hi,
>>
>> NFS is not working on a imx6q-sabresd board running linux-next 20160429:
>>
>> [   15.753317]   #0: wm8962-audio
>> [   15.759437] Root-NFS: no NFS server address
>
> At a glance, that looks like the NFSROOT mount options are
> invalid? First, confirm what is specified on the kernel
> cmdline.

Yes, the kernel command line is correct.

>
> I'm not aware of any recent changes to NFSROOT. Often
> these NFSROOT problems turn out to be related to churn in
> the underlying Ethernet drivers or the generic code that
> handles mounting the root filesystem at boot time.

Today's next shows some different info:

[    7.606456]   #0: wm8962-audio
[    7.672659] VFS: Mounted root (nfs filesystem) readonly on device 0:14.
[    7.680860] devtmpfs: mounted
[    7.685664] Freeing unused kernel memory: 1024K (c0c00000 - c0d00000)
[    7.871481]
[    7.873004] =================================
[    7.877381] [ INFO: inconsistent lock state ]
[    7.881760] 4.6.0-rc6-next-20160503-00002-g51d9962 #351 Not tainted
[    7.888043] ---------------------------------
[    7.892419] inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage.
[    7.898449] kworker/0:1H/179 [HC0[0]:SC0[0]:HE1:SE1] takes:
[    7.904040]  (&syncp->seq#5){+.?...}, at: [<c0752328>] tcp_ack+0x134/0x129c
[    7.911166] {IN-SOFTIRQ-W} state was registered at:
[    7.916061]   [<c016cc68>] lock_acquire+0x78/0x98
[    7.920816]   [<c074ccbc>] tcp_snd_una_update+0x64/0xa8
[    7.926092]   [<c0752328>] tcp_ack+0x134/0x129c
[    7.930668]   [<c0755de8>] tcp_rcv_state_process+0x814/0xfc8
[    7.936375]   [<c075e800>] tcp_v4_do_rcv+0x64/0x1c8
[    7.941305]   [<c07616c8>] tcp_v4_rcv+0xf00/0xfbc
[    7.946057]   [<c07374cc>] ip_local_deliver_finish+0xd4/0x550
[    7.951859]   [<c0737bc4>] ip_local_deliver+0xcc/0xdc
[    7.956957]   [<c0736d78>] ip_rcv_finish+0xc4/0x744
[    7.961881]   [<c073809c>] ip_rcv+0x4c8/0x7a8
[    7.966284]   [<c06fa448>] __netif_receive_skb_core+0x514/0x8ec
[    7.972251]   [<c06ff854>] __netif_receive_skb+0x2c/0x8c
[    7.977614]   [<c06ffb50>] netif_receive_skb_internal+0x7c/0x1f0
[    7.983666]   [<c0700e38>] napi_gro_receive+0x88/0xdc
[    7.988764]   [<c058fb4c>] fec_enet_rx_napi+0x390/0x9c8
[    7.994036]   [<c0700724>] net_rx_action+0x148/0x344
[    7.999046]   [<c012996c>] __do_softirq+0x130/0x2bc
[    8.003976]   [<c0129e40>] irq_exit+0xc4/0x138
[    8.008466]   [<c0177920>] __handle_domain_irq+0x74/0xe4
[    8.013838]   [<c01015d8>] gic_handle_irq+0x4c/0x9c
[    8.018763]   [<c010c4b8>] __irq_svc+0x58/0x78
[    8.023251]   [<c08f7db8>] _raw_spin_unlock_irq+0x30/0x34
[    8.028710]   [<c014a03c>] finish_task_switch+0xcc/0x274
[    8.034072]   [<c08f2728>] __schedule+0x23c/0x6f8
[    8.038823]   [<c08f2d0c>] schedule+0x3c/0xa0
[    8.043224]   [<c08f2f74>] schedule_preempt_disabled+0x10/0x14
[    8.049103]   [<c01663b0>] cpu_startup_entry+0x1f4/0x24c
[    8.054468]   [<c08f070c>] rest_init+0x12c/0x16c
[    8.059130]   [<c0c00cbc>] start_kernel+0x340/0x3b0
[    8.064059]   [<1000807c>] 0x1000807c
[    8.067767] irq event stamp: 3601
[    8.071099] hardirqs last  enabled at (3601): [<c08f7d74>]
_raw_spin_unlock_irqrestore+0x38/0x4c
[    8.079936] hardirqs last disabled at (3600): [<c08f7728>]
_raw_spin_lock_irqsave+0x24/0x54
[    8.088336] softirqs last  enabled at (3598): [<c06e9754>]
__release_sock+0x3c/0x124
[    8.096128] softirqs last disabled at (3596): [<c06e985c>]
release_sock+0x20/0xa4
[    8.103654]
[    8.103654] other info that might help us debug this:
[    8.110202]  Possible unsafe locking scenario:
[    8.110202]
[    8.116140]        CPU0
[    8.118601]        ----
[    8.121062]   lock(&syncp->seq#5);
[    8.124547]   <Interrupt>
[    8.127182]     lock(&syncp->seq#5);
[    8.130838]
[    8.130838]  *** DEADLOCK ***
[    8.130838]
[    8.136785] 3 locks held by kworker/0:1H/179:
[    8.141157]  #0:  ("rpciod"){.+.+.+}, at: [<c013e478>]
process_one_work+0x128/0x410
[    8.148965]  #1:  ((&task->u.tk_work)){+.+.+.}, at: [<c013e478>]
process_one_work+0x128/0x410
[    8.157630]  #2:  (sk_lock-AF_INET-RPC){+.+...}, at: [<c074af70>]
tcp_sendmsg+0x24/0xb5c
[    8.165859]
[    8.165859] stack backtrace:
[    8.170247] CPU: 0 PID: 179 Comm: kworker/0:1H Not tainted
4.6.0-rc6-next-20160503-00002-g51d9962 #351
[    8.179572] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[    8.186137] Workqueue: rpciod rpc_async_schedule
[    8.190791] Backtrace:
[    8.193307] [<c010b6f8>] (dump_backtrace) from [<c010b894>]
(show_stack+0x18/0x1c)
[    8.200894]  r6:60000193 r5:ffffffff r4:00000000 r3:eebdc800
[    8.206692] [<c010b87c>] (show_stack) from [<c03dfbf4>]
(dump_stack+0xb0/0xe8)
[    8.213961] [<c03dfb44>] (dump_stack) from [<c01c72d4>]
(print_usage_bug+0x268/0x2dc)
[    8.221809]  r8:00000004 r7:eebdcd00 r6:eebdc800 r5:c0ae4bbc
r4:c0ec6054 r3:eebdc800
[    8.229712] [<c01c706c>] (print_usage_bug) from [<c016ace0>]
(mark_lock+0x29c/0x6b0)
[    8.237472]  r10:c016a1c8 r8:00000004 r7:eebdc800 r6:00001054
r5:eebdcd00 r4:00000006
[    8.245456] [<c016aa44>] (mark_lock) from [<c016b644>]
(__lock_acquire+0x550/0x17c8)
[    8.253216]  r10:c0d21d9c r9:000002be r8:c0e97784 r7:eebdc800
r6:c153a09c r5:eebdcd00
[    8.261188]  r4:00000003 r3:00000001
[    8.264837] [<c016b0f4>] (__lock_acquire) from [<c016cc68>]
(lock_acquire+0x78/0x98)
[    8.272598]  r10:00000001 r9:c0752328 r8:2d738f6b r7:00000001
r6:c0752328 r5:60000113
[    8.280568]  r4:00000000
[    8.283155] [<c016cbf0>] (lock_acquire) from [<c074ccbc>]
(tcp_snd_una_update+0x64/0xa8)
[    8.291261]  r7:00000000 r6:ee6b9500 r5:ee6b9500 r4:ee6b99cc
[    8.297050] [<c074cc58>] (tcp_snd_una_update) from [<c0752328>]
(tcp_ack+0x134/0x129c)
[    8.304984]  r10:ee6b9570 r9:ee42f9c0 r8:2d738f6b r7:c0d02100
r6:00000002 r5:ee6b9500
[    8.312956]  r4:00000002
[    8.315542] [<c07521f4>] (tcp_ack) from [<c0754c08>]
(tcp_rcv_established+0x140/0x774)
[    8.323477]  r10:ee6b9570 r9:ee42f9c0 r8:c0d6bfb3 r7:c155a080
r6:ee6e9a62 r5:ee42f9c0
[    8.331448]  r4:ee6b9500
[    8.334039] [<c0754ac8>] (tcp_rcv_established) from [<c075e8fc>]
(tcp_v4_do_rcv+0x160/0x1c8)
[    8.342494]  r8:c0d6bfb3 r7:c155a080 r6:eea79600 r5:ee6b9500 r4:ee42f9c0
[    8.349348] [<c075e79c>] (tcp_v4_do_rcv) from [<c06e97ac>]
(__release_sock+0x94/0x124)
[    8.357281]  r6:00000000 r5:ee6b9500 r4:00000000 r3:c075e79c
[    8.363065] [<c06e9718>] (__release_sock) from [<c06e9870>]
(release_sock+0x34/0xa4)
[    8.370825]  r10:ee6b9500 r9:ee6c1ce4 r8:00000000 r7:00000080
r6:c074b1f0 r5:ee6b9570
[    8.378797]  r4:ee6b9500 r3:ee42f9c0
[    8.382448] [<c06e983c>] (release_sock) from [<c074b1f0>]
(tcp_sendmsg+0x2a4/0xb5c)
[    8.390122]  r6:00000080 r5:ee6b9500 r4:ee6c2000 r3:00000015
[    8.395922] [<c074af4c>] (tcp_sendmsg) from [<c077a824>]
(inet_sendmsg+0x128/0x200)
[    8.403596]  r10:c0d6c136 r9:ee6a4000 r8:ee6c1ce4 r7:00000080
r6:00000000 r5:c0d6c136
[    8.411565]  r4:ee6b9500
[    8.414161] [<c077a6fc>] (inet_sendmsg) from [<c06e41ec>]
(sock_sendmsg+0x1c/0x2c)
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH v2] net: mvneta: Remove superfluous SMP function call
From: David Miller @ 2016-05-03 19:28 UTC (permalink / raw)
  To: anna-maria; +Cc: linux-kernel, rt, thomas.petazzoni, netdev
In-Reply-To: <1462179771-55875-1-git-send-email-anna-maria@linutronix.de>

From: Anna-Maria Gleixner <anna-maria@linutronix.de>
Date: Mon,  2 May 2016 11:02:51 +0200

> Since commit 3b9d6da67e11 ("cpu/hotplug: Fix rollback during error-out
> in __cpu_disable()") it is ensured that callbacks of CPU_ONLINE and
> CPU_DOWN_PREPARE are processed on the hotplugged CPU. Due to this SMP
> function calls are no longer required.
> 
> Replace smp_call_function_single() with a direct call to
> mvneta_percpu_enable() or mvneta_percpu_disable(). The functions do
> not require to be called with interrupts disabled, therefore the
> smp_call_function_single() calling convention is not preserved.
> 
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Cc: netdev@vger.kernel.org
> Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>

Applied, thanks.

^ permalink raw reply

* Re: [net-next PATCH v2 0/5] stmmac: dwmac-socfpga refactor+cleanup
From: David Miller @ 2016-05-03 19:22 UTC (permalink / raw)
  To: manabian; +Cc: marex, dinguyen, peppe.cavallaro, alexandre.torgue, netdev
In-Reply-To: <1462136303-16825-1-git-send-email-manabian@gmail.com>

From: Joachim Eastwood <manabian@gmail.com>
Date: Sun,  1 May 2016 22:58:18 +0200

> This patch aims to remove the init/exit callbacks from the dwmac-
> socfpga driver and instead use standard PM callbacks. Doing this
> will also allow us to cleanup the driver.
> 
> Eventually the init/exit callbacks will be deprecated and removed
> from all drivers dwmac-* except for dwmac-generic. Drivers will be
> refactored to use standard PM and remove callbacks.
> 
> This patch set should not change the behavior of the driver itself,
> it only moves code around. The only exception to this is patch
> number 4 which restores the resume callback behavior which was
> changed in the "net: stmmac: socfpga: Remove re-registration of
> reset controller" patch. I belive calling phy_resume() only
> from the resume callback and not probe is the right thing to do.
> 
> Changes from v1:
>  - Rebase on net-next
> 
> One heads-up here:
> The first patch changes the prototype of a couple of
> functions used in Alexandre's "add Ethernet glue logic for
> stm32 chip" patch [1] and will cause build failures for
> dwmac-stm32.c if not fixed up!
> If Alexandre's patch set is applied first I will gladly
> rebase my patch set to account for his driver as well.
> 
> [1] https://patchwork.ozlabs.org/patch/614405/

Series applied, thanks.  stm32 will need to be respun, therefore.

^ permalink raw reply

* Re: [PATCH 2/2] mac80211_hwsim: Allow managing radios from non-initial namespaces
From: Johannes Berg @ 2016-05-03 19:16 UTC (permalink / raw)
  To: Martin Willi
  Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1462258398-6749-3-git-send-email-martin-jzJueiEJWxp8fCCB1iTX4w@public.gmane.org>

On Tue, 2016-05-03 at 08:53 +0200, Martin Willi wrote:
> 
> +static __net_init int hwsim_init_net(struct net *net)
> +{
> +	struct mac80211_hwsim_data *data;
> +	bool exists = true;
> +	int netgroup = 0;
> +
> +	spin_lock_bh(&hwsim_radio_lock);
> +	while (exists) {
> +		exists = false;
> +		list_for_each_entry(data, &hwsim_radios, list) {
> +			if (netgroup == data->netgroup) {
> +				exists = true;
> +				netgroup++;
> +				break;
> +			}
> +		}
> +	}
> +	spin_unlock_bh(&hwsim_radio_lock);
> +
> +	*(int *)net_generic(net, hwsim_net_id) = netgroup;


This seems somewhat awkward. Why not just take the maximum of all the
netgroup IDs + 1? We'd run out of memory and radio IDs long before
netgroup IDs even that way, and they're not actually visible anywhere
so it doesn't matter.

Actually though, *both* your approach and my suggestion don't seem
safe: consider a new netns that doesn't have any hwsim radios yet. Now
you create *another* one, but it would get the same netgroup.

IOW, you should simply use a global counter. Surprising (net)
namespaces don't have an index like that already, but I don't see one.

> +static void __net_exit hwsim_exit_net(struct net *net)
> +{
> +	struct mac80211_hwsim_data *entry, *tmp;
> +
> +	spin_lock_bh(&hwsim_radio_lock);
> +	list_for_each_entry_safe(entry, tmp, &hwsim_radios, list) {
> +		if (net_eq(wiphy_net(entry->hw->wiphy), net)) {
> +			list_del(&entry->list);
> +			INIT_WORK(&entry->destroy_work,
> destroy_radio);
> +			schedule_work(&entry->destroy_work);
> +		}
> +	}
> +	spin_unlock_bh(&hwsim_radio_lock);
> +}

This changes today's default behaviour of moving the wiphys to the
default namespace. Did you intend to destroy them based on the
netgroup, i.e. based on the namespace that created them? Actually,
maybe they should move back to the namespace that created them, if the
namespace they are in is destroyed? But that's difficult, I don't mind
this behaviour, but I'm not sure it's what we want by default for
radios created in the init_net.

johannes
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH] macb: fix mdiobus_scan() error check
From: David Miller @ 2016-05-03 19:04 UTC (permalink / raw)
  To: sergei.shtylyov; +Cc: netdev, nicolas.ferre
In-Reply-To: <2317306.aZN9iKAKYz@wasted.cogentembedded.com>

From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Sun, 01 May 2016 01:47:36 +0300

> Now mdiobus_scan() returns ERR_PTR(-ENODEV) instead of NULL if the PHY
> device ID was read as all ones. As this was not  an error before, this
> value  should be filtered out now in this driver.
> 
> Fixes: b74766a0a0fe ("phylib: don't return NULL from get_phy_device()")
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

Applied.

^ permalink raw reply

* Re: [PATCH] pxa168_eth: fix mdiobus_scan() error check
From: David Miller @ 2016-05-03 19:03 UTC (permalink / raw)
  To: sergei.shtylyov; +Cc: netdev, arnd
In-Reply-To: <6024241.YxM8l6DPJo@wasted.cogentembedded.com>

From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Sat, 30 Apr 2016 23:35:11 +0300

> Since mdiobus_scan() returns either an error code or NULL on error, the
> driver should check  for both,  not only for NULL, otherwise a crash is
> imminent...
> 
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

Applied.

^ permalink raw reply

* Re: [PATCH v6 00/21] Add HiSilicon RoCE driver
From: Leon Romanovsky @ 2016-05-03 18:48 UTC (permalink / raw)
  To: Lijun Ou
  Cc: dledford, sean.hefty, hal.rosenstock, davem, jeffrey.t.kirsher,
	jiri, ogerlitz, linux-rdma, linux-kernel, netdev, gongyangming,
	xiaokun, tangchaofei, haifeng.wei, yisen.zhuang, yankejian,
	charles.chenxin, linuxarm
In-Reply-To: <1461845396-61306-1-git-send-email-oulijun@huawei.com>

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

On Thu, Apr 28, 2016 at 08:09:35PM +0800, Lijun Ou wrote:
> The HiSilicon Network Substem is a long term evolution IP which is
> supposed to be used in HiSilicon ICT SoCs. HNS (HiSilicon Network
> Sybsystem) also has a hardware support of performing RDMA with
> RoCEE.
> The driver for HiSilicon RoCEE(RoCE Engine) is a platform driver and
> will support mulitple versions of SOCs in future. This version of driver
> is meant to support Hip06 SoC(which confirms to RoCEEv1 hardware
> specifications).

Please read Dave's comment [1], it is valuable for your code as
well.

* Please use 'bool' and "true/false"

[1] http://marc.info/?l=linux-rdma&m=146229367301442&w=2

Thanks

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply

* [PATCH net-next v2] macvtap: add namespace support to the sysfs device class
From: Marc Angel @ 2016-05-03 18:30 UTC (permalink / raw)
  To: netdev; +Cc: ebiederm
In-Reply-To: <CAPSAET_u3CYvhYgyxXdomi7n5Z6c1DTCpSMv=K544U=TjmM=cw@mail.gmail.com>

When creating macvtaps that are expected to have the same ifindex
in different network namespaces, only the first one will succeed.
The others will fail with a sysfs_warn_dup warning due to them trying
to create the following sysfs link (with 'NN' the ifindex of macvtapX):

/sys/class/macvtap/tapNN -> /sys/devices/virtual/net/macvtapX/tapNN

This is reproducible by running the following commands:

ip netns add ns1
ip netns add ns2
ip link add veth0 type veth peer name veth1
ip link set veth0 netns ns1
ip link set veth1 netns ns2
ip netns exec ns1 ip l add link veth0 macvtap0 type macvtap
ip netns exec ns2 ip l add link veth1 macvtap1 type macvtap

The last command will fail with "RTNETLINK answers: File exists" (along
with the kernel warning) but retrying it will work because the ifindex
was incremented.

The 'net' device class is isolated between network namespaces so each
one has its own hierarchy of net devices.
This isn't the case for the 'macvtap' device class.
The problem occurs half-way through the netdev registration, when
`macvtap_device_event` is called-back to create the 'tapNN' macvtap
class device under the 'macvtapX' net class device.

This patch adds namespace support to the 'macvtap' device class so
that /sys/class/macvtap is no longer shared between net namespaces.

However, making the macvtap sysfs class namespace-aware has the side
effect of changing /sys/devices/virtual/net/macvtapX/tapNN  into
/sys/devices/virtual/net/macvtapX/macvtap/tapNN.

This is due to Commit 24b1442 ("Driver-core: Always create class
directories for classses that support namespaces") and the fact that
class devices supporting namespaces are really not supposed to be placed
directly under other class devices.

To avoid breaking userland, a tapNN symlink pointing to macvtap/tapNN is
created inside the macvtapX directory.

Signed-off-by: Marc Angel <marc@arista.com>
---
 drivers/net/macvtap.c | 35 +++++++++++++++++++++++++----------
 1 file changed, 25 insertions(+), 10 deletions(-)

diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index 95394ed..b7ebfcd 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -129,7 +129,18 @@ static DEFINE_MUTEX(minor_lock);
 static DEFINE_IDR(minor_idr);
 
 #define GOODCOPY_LEN 128
-static struct class *macvtap_class;
+static const void *macvtap_net_namespace(struct device *d)
+{
+	struct net_device *dev = to_net_dev(d->parent);
+	return dev_net(dev);
+}
+
+static struct class macvtap_class = {
+	.name = "macvtap",
+	.owner = THIS_MODULE,
+	.ns_type = &net_ns_type_operations,
+	.namespace = macvtap_net_namespace,
+};
 static struct cdev macvtap_cdev;
 
 static const struct proto_ops macvtap_socket_ops;
@@ -1274,6 +1285,7 @@ static int macvtap_device_event(struct notifier_block *unused,
 				unsigned long event, void *ptr)
 {
 	struct net_device *dev = netdev_notifier_info_to_dev(ptr);
+	const char *tap_name = kasprintf(GFP_KERNEL, "tap%d", dev->ifindex);
 	struct macvlan_dev *vlan;
 	struct device *classdev;
 	dev_t devt;
@@ -1295,16 +1307,21 @@ static int macvtap_device_event(struct notifier_block *unused,
 			return notifier_from_errno(err);
 
 		devt = MKDEV(MAJOR(macvtap_major), vlan->minor);
-		classdev = device_create(macvtap_class, &dev->dev, devt,
-					 dev, "tap%d", dev->ifindex);
+		classdev = device_create(&macvtap_class, &dev->dev, devt,
+					 dev, tap_name);
 		if (IS_ERR(classdev)) {
 			macvtap_free_minor(vlan);
 			return notifier_from_errno(PTR_ERR(classdev));
 		}
+		err = sysfs_create_link(&dev->dev.kobj, &classdev->kobj,
+					dev_name(classdev));
+		if (err)
+			return notifier_from_errno(err);
 		break;
 	case NETDEV_UNREGISTER:
+		sysfs_remove_link(&dev->dev.kobj, tap_name);
 		devt = MKDEV(MAJOR(macvtap_major), vlan->minor);
-		device_destroy(macvtap_class, devt);
+		device_destroy(&macvtap_class, devt);
 		macvtap_free_minor(vlan);
 		break;
 	}
@@ -1330,11 +1347,9 @@ static int macvtap_init(void)
 	if (err)
 		goto out2;
 
-	macvtap_class = class_create(THIS_MODULE, "macvtap");
-	if (IS_ERR(macvtap_class)) {
-		err = PTR_ERR(macvtap_class);
+	err = class_register(&macvtap_class);
+	if (err)
 		goto out3;
-	}
 
 	err = register_netdevice_notifier(&macvtap_notifier_block);
 	if (err)
@@ -1349,7 +1364,7 @@ static int macvtap_init(void)
 out5:
 	unregister_netdevice_notifier(&macvtap_notifier_block);
 out4:
-	class_unregister(macvtap_class);
+	class_unregister(&macvtap_class);
 out3:
 	cdev_del(&macvtap_cdev);
 out2:
@@ -1363,7 +1378,7 @@ static void macvtap_exit(void)
 {
 	rtnl_link_unregister(&macvtap_link_ops);
 	unregister_netdevice_notifier(&macvtap_notifier_block);
-	class_unregister(macvtap_class);
+	class_unregister(&macvtap_class);
 	cdev_del(&macvtap_cdev);
 	unregister_chrdev_region(macvtap_major, MACVTAP_NUM_DEVS);
 	idr_destroy(&minor_idr);
-- 
2.8.0

^ permalink raw reply related

* Re: [PATCHv2 bluetooth-next 07/10] ipv6: introduce neighbour discovery ops
From: Stefan Schmidt @ 2016-05-03 18:17 UTC (permalink / raw)
  To: Hannes Frederic Sowa, Alexander Aring,
	linux-wpan-u79uwXL29TY76Z2rM5mHXA
  Cc: kernel-bIcnvbaLZ9MEGnE8C9+IrQ, marcel-kz+m5ild9QBg9hUCZPvPmw,
	jukka.rissanen-VuQAYsv1563Yd54FQh9/CA, mcr-SWp7JaYWvAQV+D8aMU/kSg,
	werner-SEdMjqphH88wryQfseakQg,
	linux-bluetooth-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA, David S . Miller, Alexey Kuznetsov,
	James Morris, Hideaki YOSHIFUJI, Patrick McHardy
In-Reply-To: <fbd4c25c-2673-2848-c636-a5d21a6890d7-tFNcAqjVMyqKXQKiL6tip0B+6BGkLq7r@public.gmane.org>

Hello.

On 02/05/16 21:36, Hannes Frederic Sowa wrote:
> On 20.04.2016 10:19, Alexander Aring wrote:
>> This patch introduces neighbour discovery ops callback structure. The
>> structure contains at first receive and transmit handling for NS/NA and
>> userspace option field functionality.
>>
>> These callback offers 6lowpan different handling, such as 802.15.4 short
>> address handling or RFC6775 (Neighbor Discovery Optimization for IPv6 over
>> 6LoWPANs).
>>
>> Cc: David S. Miller<davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
>> Cc: Alexey Kuznetsov<kuznet-v/Mj1YrvjDBInbfyfbPRSQ@public.gmane.org>
>> Cc: James Morris<jmorris-gx6/JNMH7DfYtjvyW6yDsg@public.gmane.org>
>> Cc: Hideaki YOSHIFUJI<yoshfuji-VfPWfsRibaP+Ru+s062T9g@public.gmane.org>
>> Cc: Patrick McHardy<kaber-dcUjhNyLwpNeoWH0uzbU5w@public.gmane.org>
>> Signed-off-by: Alexander Aring<aar-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
>> ---
>>   include/linux/netdevice.h |  3 ++
>>   include/net/ndisc.h       | 96 +++++++++++++++++++++++++++++++++++++++++++----
>>   net/ipv6/addrconf.c       |  1 +
>>   net/ipv6/ndisc.c          | 71 ++++++++++++++++++++++++-----------
>>   net/ipv6/route.c          |  2 +-
>>   5 files changed, 144 insertions(+), 29 deletions(-)
>>
>> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
>> index 0052c42..bc60033 100644
>> --- a/include/linux/netdevice.h
>> +++ b/include/linux/netdevice.h
>> @@ -1677,6 +1677,9 @@ struct net_device {
>>   #ifdef CONFIG_NET_L3_MASTER_DEV
>>   	const struct l3mdev_ops	*l3mdev_ops;
>>   #endif
>> +#if IS_ENABLED(CONFIG_IPV6)
>> +	const struct ndisc_ops *ndisc_ops;
>> +#endif
>>   
>>   	const struct header_ops *header_ops;
>>   
>> diff --git a/include/net/ndisc.h b/include/net/ndisc.h
>> index aac868e..14ed016 100644
>> --- a/include/net/ndisc.h
>> +++ b/include/net/ndisc.h
>> @@ -110,7 +110,8 @@ struct ndisc_options {
>>   
>>   #define NDISC_OPT_SPACE(len) (((len)+2+7)&~7)
>>   
>> -struct ndisc_options *ndisc_parse_options(u8 *opt, int opt_len,
>> +struct ndisc_options *ndisc_parse_options(const struct net_device *dev,
>> +					  u8 *opt, int opt_len,
>>   					  struct ndisc_options *ndopts);
>>   
>>   /*
>> @@ -173,6 +174,93 @@ static inline struct neighbour *__ipv6_neigh_lookup(struct net_device *dev, cons
>>   	return n;
>>   }
>>   
>> +static inline int __ip6_ndisc_is_useropt(struct nd_opt_hdr *opt)
>> +{
>> +	return opt->nd_opt_type == ND_OPT_RDNSS ||
>> +		opt->nd_opt_type == ND_OPT_DNSSL;
>> +}
>> +
>> +#if IS_ENABLED(CONFIG_IPV6)
>> +struct ndisc_ops {
>> +	int	(*is_useropt)(struct nd_opt_hdr *opt);
>> +	void	(*send_na)(struct net_device *dev,
>> +			   const struct in6_addr *daddr,
>> +			   const struct in6_addr *solicited_addr,
>> +			   bool router, bool solicited,
>> +			   bool override, bool inc_opt);
>> +	void	(*recv_na)(struct sk_buff *skb);
>> +	void	(*send_ns)(struct net_device *dev,
>> +			   const struct in6_addr *solicit,
>> +			   const struct in6_addr *daddr,
>> +			   const struct in6_addr *saddr);
>> +	void	(*recv_ns)(struct sk_buff *skb);
>> +};
>> +
>> +static inline int ndisc_is_useropt(const struct net_device *dev,
>> +				   struct nd_opt_hdr *opt)
>> +{
>> +	if (likely(dev->ndisc_ops->is_useropt))
>> +		return dev->ndisc_ops->is_useropt(opt);
>> +	else
>> +		return 0;
>> +}
>> +
>> +static inline void ndisc_send_na(struct net_device *dev,
>> +				 const struct in6_addr *daddr,
>> +				 const struct in6_addr *solicited_addr,
>> +				 bool router, bool solicited, bool override,
>> +				 bool inc_opt)
>> +{
>> +	if (likely(dev->ndisc_ops->send_na))
>> +		dev->ndisc_ops->send_na(dev, daddr, solicited_addr, router,
>> +					solicited, override, inc_opt);
>> +}
>> +
>> +static inline void ndisc_recv_na(struct sk_buff *skb)
>> +{
>> +	if (likely(skb->dev->ndisc_ops->recv_na))
>> +		skb->dev->ndisc_ops->recv_na(skb);
>> +}
>> +
>> +static inline void ndisc_send_ns(struct net_device *dev,
>> +				 const struct in6_addr *solicit,
>> +				 const struct in6_addr *daddr,
>> +				 const struct in6_addr *saddr)
>> +{
>> +	if (likely(dev->ndisc_ops->send_ns))
>> +		dev->ndisc_ops->send_ns(dev, solicit, daddr, saddr);
>> +}
>> +
>> +static inline void ndisc_recv_ns(struct sk_buff *skb)
>> +{
>> +	if (likely(skb->dev->ndisc_ops->recv_ns))
>> +		skb->dev->ndisc_ops->recv_ns(skb);
>> +}
>> +#else
>> +static inline int ndisc_is_useropt(const struct net_device *dev,
>> +				   struct nd_opt_hdr *opt)
>> +{
>> +	return 0;
>> +}
>> +
>> +static inline void ndisc_send_na(struct net_device *dev,
>> +				 const struct in6_addr *daddr,
>> +				 const struct in6_addr *solicited_addr,
>> +				 bool router, bool solicited, bool override,
>> +				 bool inc_opt) { }
>> +
>> +static inline void ndisc_recv_na(struct sk_buff *skb) { }
>> +
>> +static inline void ndisc_send_ns(struct net_device *dev,
>> +				 const struct in6_addr *solicit,
>> +				 const struct in6_addr *daddr,
>> +				 const struct in6_addr *saddr) { }
>> +
>> +static inline void ndisc_recv_ns(struct sk_buff *skb) { }
>> +#endif
> Do those empty functions actually make sense? I wonder a bit because
> 6lowpan strictly depends on ipv6 and they should never be called without
> IPv6, no?

Agreed. 6LoWAPN is only an adaptation layer so we know that IPv6 must be 
enabled here. I would also argue for removing this ifdef and the empty 
functions.

regards
Stefan Schmidt

^ permalink raw reply

* Re: [PATCHv2 bluetooth-next 06/10] ndisc: add addr_len parameter to ndisc_fill_addr_option
From: Stefan Schmidt @ 2016-05-03 18:17 UTC (permalink / raw)
  To: Alexander Aring, linux-wpan
  Cc: kernel, marcel, jukka.rissanen, hannes, mcr, werner,
	linux-bluetooth, netdev, David S . Miller, Alexey Kuznetsov,
	James Morris, Hideaki YOSHIFUJI, Patrick McHardy
In-Reply-To: <1461140382-4784-7-git-send-email-aar@pengutronix.de>

Hello.

On 20/04/16 10:19, Alexander Aring wrote:
> This patch makes the address length as argument for the
> ndisc_fill_addr_option function. This is necessary to handle addresses
> which don't use dev->addr_len as address length.
>
> Cc: David S. Miller<davem@davemloft.net>
> Cc: Alexey Kuznetsov<kuznet@ms2.inr.ac.ru>
> Cc: James Morris<jmorris@namei.org>
> Cc: Hideaki YOSHIFUJI<yoshfuji@linux-ipv6.org>
> Cc: Patrick McHardy<kaber@trash.net>
> Signed-off-by: Alexander Aring<aar@pengutronix.de>
> ---
>   net/ipv6/ndisc.c | 15 ++++++++-------
>   1 file changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
> index 4e91d5e..176c7c4 100644
> --- a/net/ipv6/ndisc.c
> +++ b/net/ipv6/ndisc.c
> @@ -150,11 +150,11 @@ struct neigh_table nd_tbl = {
>   };
>   EXPORT_SYMBOL_GPL(nd_tbl);
>   
> -static void ndisc_fill_addr_option(struct sk_buff *skb, int type, void *data)
> +static void ndisc_fill_addr_option(struct sk_buff *skb, int type, void *data,
> +				   int data_len)
>   {
>   	int pad   = ndisc_addr_option_pad(skb->dev->type);
> -	int data_len = skb->dev->addr_len;
> -	int space = ndisc_opt_addr_space(skb->dev, skb->dev->addr_len);
> +	int space = ndisc_opt_addr_space(skb->dev, data_len);
>   	u8 *opt = skb_put(skb, space);
>   
>   	opt[0] = type;
> @@ -528,7 +528,7 @@ void ndisc_send_na(struct net_device *dev, const struct in6_addr *daddr,
>   
>   	if (inc_opt)
>   		ndisc_fill_addr_option(skb, ND_OPT_TARGET_LL_ADDR,
> -				       dev->dev_addr);
> +				       dev->dev_addr, dev->addr_len);
>   
>   
>   	ndisc_send_skb(skb, daddr, src_addr);
> @@ -590,7 +590,7 @@ void ndisc_send_ns(struct net_device *dev, const struct in6_addr *solicit,
>   
>   	if (inc_opt)
>   		ndisc_fill_addr_option(skb, ND_OPT_SOURCE_LL_ADDR,
> -				       dev->dev_addr);
> +				       dev->dev_addr, dev->addr_len);
>   
>   	ndisc_send_skb(skb, daddr, saddr);
>   }
> @@ -641,7 +641,7 @@ void ndisc_send_rs(struct net_device *dev, const struct in6_addr *saddr,
>   
>   	if (send_sllao)
>   		ndisc_fill_addr_option(skb, ND_OPT_SOURCE_LL_ADDR,
> -				       dev->dev_addr);
> +				       dev->dev_addr, dev->addr_len);
>   
>   	ndisc_send_skb(skb, daddr, saddr);
>   }
> @@ -1597,7 +1597,8 @@ void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target)
>   	 */
>   
>   	if (ha)
> -		ndisc_fill_addr_option(buff, ND_OPT_TARGET_LL_ADDR, ha);
> +		ndisc_fill_addr_option(buff, ND_OPT_TARGET_LL_ADDR, ha,
> +				       dev->addr_len);
>   
>   	/*
>   	 *	build redirect option and copy skb over to the new packet.

Reviewed-by: Stefan Schmidt<stefan@osg.samsung.com>

regards
Stefan Schmidt

^ permalink raw reply

* Re: [PATCHv2 bluetooth-next 05/10] ndisc: add addr_len parameter to ndisc_opt_addr_data
From: Stefan Schmidt @ 2016-05-03 18:17 UTC (permalink / raw)
  To: Alexander Aring, linux-wpan
  Cc: kernel, marcel, jukka.rissanen, hannes, mcr, werner,
	linux-bluetooth, netdev, David S . Miller, Alexey Kuznetsov,
	James Morris, Hideaki YOSHIFUJI, Patrick McHardy
In-Reply-To: <1461140382-4784-6-git-send-email-aar@pengutronix.de>

Hello.

On 20/04/16 10:19, Alexander Aring wrote:
> This patch makes the address length as argument for the
> ndisc_opt_addr_data function. This is necessary to handle addresses
> which don't use dev->addr_len as address length.
>
> Cc: David S. Miller<davem@davemloft.net>
> Cc: Alexey Kuznetsov<kuznet@ms2.inr.ac.ru>
> Cc: James Morris<jmorris@namei.org>
> Cc: Hideaki YOSHIFUJI<yoshfuji@linux-ipv6.org>
> Cc: Patrick McHardy<kaber@trash.net>
> Signed-off-by: Alexander Aring<aar@pengutronix.de>
> ---
>   include/net/ndisc.h |  5 +++--
>   net/ipv6/ndisc.c    | 11 +++++++----
>   net/ipv6/route.c    |  2 +-
>   3 files changed, 11 insertions(+), 7 deletions(-)
>
> diff --git a/include/net/ndisc.h b/include/net/ndisc.h
> index ef43e88..aac868e 100644
> --- a/include/net/ndisc.h
> +++ b/include/net/ndisc.h
> @@ -134,12 +134,13 @@ static inline int ndisc_opt_addr_space(struct net_device *dev,
>   }
>   
>   static inline u8 *ndisc_opt_addr_data(struct nd_opt_hdr *p,
> -				      struct net_device *dev)
> +				      struct net_device *dev,
> +				      unsigned char addr_len)
>   {
>   	u8 *lladdr = (u8 *)(p + 1);
>   	int lladdrlen = p->nd_opt_len << 3;
>   	int prepad = ndisc_addr_option_pad(dev->type);
> -	if (lladdrlen != ndisc_opt_addr_space(dev, dev->addr_len))
> +	if (lladdrlen != ndisc_opt_addr_space(dev, addr_len))
>   		return NULL;
>   	return lladdr + prepad;
>   }
> diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
> index 69e20e3..4e91d5e 100644
> --- a/net/ipv6/ndisc.c
> +++ b/net/ipv6/ndisc.c
> @@ -744,7 +744,8 @@ static void ndisc_recv_ns(struct sk_buff *skb)
>   	}
>   
>   	if (ndopts.nd_opts_src_lladdr) {
> -		lladdr = ndisc_opt_addr_data(ndopts.nd_opts_src_lladdr, dev);
> +		lladdr = ndisc_opt_addr_data(ndopts.nd_opts_src_lladdr, dev,
> +					     dev->addr_len);
>   		if (!lladdr) {
>   			ND_PRINTK(2, warn,
>   				  "NS: invalid link-layer address length\n");
> @@ -916,7 +917,8 @@ static void ndisc_recv_na(struct sk_buff *skb)
>   		return;
>   	}
>   	if (ndopts.nd_opts_tgt_lladdr) {
> -		lladdr = ndisc_opt_addr_data(ndopts.nd_opts_tgt_lladdr, dev);
> +		lladdr = ndisc_opt_addr_data(ndopts.nd_opts_tgt_lladdr, dev,
> +					     dev->addr_len);
>   		if (!lladdr) {
>   			ND_PRINTK(2, warn,
>   				  "NA: invalid link-layer address length\n");
> @@ -1024,7 +1026,7 @@ static void ndisc_recv_rs(struct sk_buff *skb)
>   
>   	if (ndopts.nd_opts_src_lladdr) {
>   		lladdr = ndisc_opt_addr_data(ndopts.nd_opts_src_lladdr,
> -					     skb->dev);
> +					     skb->dev, skb->dev->addr_len);
>   		if (!lladdr)
>   			goto out;
>   	}
> @@ -1322,7 +1324,8 @@ skip_linkparms:
>   		u8 *lladdr = NULL;
>   		if (ndopts.nd_opts_src_lladdr) {
>   			lladdr = ndisc_opt_addr_data(ndopts.nd_opts_src_lladdr,
> -						     skb->dev);
> +						     skb->dev,
> +						     skb->dev->addr_len);
>   			if (!lladdr) {
>   				ND_PRINTK(2, warn,
>   					  "RA: invalid link-layer address length\n");
> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> index ed44663..cc180b3 100644
> --- a/net/ipv6/route.c
> +++ b/net/ipv6/route.c
> @@ -2157,7 +2157,7 @@ static void rt6_do_redirect(struct dst_entry *dst, struct sock *sk, struct sk_bu
>   	lladdr = NULL;
>   	if (ndopts.nd_opts_tgt_lladdr) {
>   		lladdr = ndisc_opt_addr_data(ndopts.nd_opts_tgt_lladdr,
> -					     skb->dev);
> +					     skb->dev, skb->dev->addr_len);
>   		if (!lladdr) {
>   			net_dbg_ratelimited("rt6_redirect: invalid link-layer address length\n");
>   			return;

Reviewed-by: Stefan Schmidt<stefan@osg.samsung.com>

regards
Stefan Schmidt

^ permalink raw reply

* Re: [PATCHv2 bluetooth-next 04/10] ndisc: add addr_len parameter to ndisc_opt_addr_space
From: Stefan Schmidt @ 2016-05-03 18:17 UTC (permalink / raw)
  To: Alexander Aring, linux-wpan
  Cc: kernel, marcel, jukka.rissanen, hannes, mcr, werner,
	linux-bluetooth, netdev, David S . Miller, Alexey Kuznetsov,
	James Morris, Hideaki YOSHIFUJI, Patrick McHardy
In-Reply-To: <1461140382-4784-5-git-send-email-aar@pengutronix.de>

Hello.

On 20/04/16 10:19, Alexander Aring wrote:
> This patch makes the address length as argument for the
> ndisc_opt_addr_space function. This is necessary to handle addresses
> which don't use dev->addr_len as address length.
>
> Cc: David S. Miller<davem@davemloft.net>
> Cc: Alexey Kuznetsov<kuznet@ms2.inr.ac.ru>
> Cc: James Morris<jmorris@namei.org>
> Cc: Hideaki YOSHIFUJI<yoshfuji@linux-ipv6.org>
> Cc: Patrick McHardy<kaber@trash.net>
> Signed-off-by: Alexander Aring<aar@pengutronix.de>
> ---
>   include/net/ndisc.h |  8 ++++----
>   net/ipv6/ndisc.c    | 10 +++++-----
>   2 files changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/include/net/ndisc.h b/include/net/ndisc.h
> index 2d8edaa..ef43e88 100644
> --- a/include/net/ndisc.h
> +++ b/include/net/ndisc.h
> @@ -127,10 +127,10 @@ static inline int ndisc_addr_option_pad(unsigned short type)
>   	}
>   }
>   
> -static inline int ndisc_opt_addr_space(struct net_device *dev)
> +static inline int ndisc_opt_addr_space(struct net_device *dev,
> +				       unsigned char addr_len)
>   {
> -	return NDISC_OPT_SPACE(dev->addr_len +
> -			       ndisc_addr_option_pad(dev->type));
> +	return NDISC_OPT_SPACE(addr_len + ndisc_addr_option_pad(dev->type));
>   }
>   
>   static inline u8 *ndisc_opt_addr_data(struct nd_opt_hdr *p,
> @@ -139,7 +139,7 @@ static inline u8 *ndisc_opt_addr_data(struct nd_opt_hdr *p,
>   	u8 *lladdr = (u8 *)(p + 1);
>   	int lladdrlen = p->nd_opt_len << 3;
>   	int prepad = ndisc_addr_option_pad(dev->type);
> -	if (lladdrlen != ndisc_opt_addr_space(dev))
> +	if (lladdrlen != ndisc_opt_addr_space(dev, dev->addr_len))
>   		return NULL;
>   	return lladdr + prepad;
>   }
> diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
> index c245895..69e20e3 100644
> --- a/net/ipv6/ndisc.c
> +++ b/net/ipv6/ndisc.c
> @@ -154,7 +154,7 @@ static void ndisc_fill_addr_option(struct sk_buff *skb, int type, void *data)
>   {
>   	int pad   = ndisc_addr_option_pad(skb->dev->type);
>   	int data_len = skb->dev->addr_len;
> -	int space = ndisc_opt_addr_space(skb->dev);
> +	int space = ndisc_opt_addr_space(skb->dev, skb->dev->addr_len);
>   	u8 *opt = skb_put(skb, space);
>   
>   	opt[0] = type;
> @@ -509,7 +509,7 @@ void ndisc_send_na(struct net_device *dev, const struct in6_addr *daddr,
>   	if (!dev->addr_len)
>   		inc_opt = 0;
>   	if (inc_opt)
> -		optlen += ndisc_opt_addr_space(dev);
> +		optlen += ndisc_opt_addr_space(dev, dev->addr_len);
>   
>   	skb = ndisc_alloc_skb(dev, sizeof(*msg) + optlen);
>   	if (!skb)
> @@ -574,7 +574,7 @@ void ndisc_send_ns(struct net_device *dev, const struct in6_addr *solicit,
>   	if (ipv6_addr_any(saddr))
>   		inc_opt = false;
>   	if (inc_opt)
> -		optlen += ndisc_opt_addr_space(dev);
> +		optlen += ndisc_opt_addr_space(dev, dev->addr_len);
>   
>   	skb = ndisc_alloc_skb(dev, sizeof(*msg) + optlen);
>   	if (!skb)
> @@ -626,7 +626,7 @@ void ndisc_send_rs(struct net_device *dev, const struct in6_addr *saddr,
>   	}
>   #endif
>   	if (send_sllao)
> -		optlen += ndisc_opt_addr_space(dev);
> +		optlen += ndisc_opt_addr_space(dev, dev->addr_len);
>   
>   	skb = ndisc_alloc_skb(dev, sizeof(*msg) + optlen);
>   	if (!skb)
> @@ -1563,7 +1563,7 @@ void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target)
>   			memcpy(ha_buf, neigh->ha, dev->addr_len);
>   			read_unlock_bh(&neigh->lock);
>   			ha = ha_buf;
> -			optlen += ndisc_opt_addr_space(dev);
> +			optlen += ndisc_opt_addr_space(dev, dev->addr_len);
>   		} else
>   			read_unlock_bh(&neigh->lock);
>   

Reviewed-by: Stefan Schmidt<stefan@osg.samsung.com>

regards
Stefan Schmidt

^ permalink raw reply

* Re: [PATCHv2 bluetooth-next 03/10] 6lowpan: remove ipv6 module request
From: Stefan Schmidt @ 2016-05-03 18:16 UTC (permalink / raw)
  To: Alexander Aring, linux-wpan
  Cc: kernel, marcel, jukka.rissanen, hannes, mcr, werner,
	linux-bluetooth, netdev
In-Reply-To: <1461140382-4784-4-git-send-email-aar@pengutronix.de>

Hello.

On 20/04/16 10:19, Alexander Aring wrote:
> Since we use exported function from ipv6 kernel module we don't need to
> request the module anymore to have ipv6 functionality.
>
> Signed-off-by: Alexander Aring<aar@pengutronix.de>
> ---
>   net/6lowpan/core.c | 2 --
>   1 file changed, 2 deletions(-)
>
> diff --git a/net/6lowpan/core.c b/net/6lowpan/core.c
> index fbae31e..824d1bc 100644
> --- a/net/6lowpan/core.c
> +++ b/net/6lowpan/core.c
> @@ -158,8 +158,6 @@ static int __init lowpan_module_init(void)
>   		return ret;
>   	}
>   
> -	request_module_nowait("ipv6");
> -
>   	request_module_nowait("nhc_dest");
>   	request_module_nowait("nhc_fragment");
>   	request_module_nowait("nhc_hop");
Good point.

Reviewed-by: Stefan Schmidt<stefan@osg.samsung.com>

regards
Stefan Schmidt

^ permalink raw reply

* Re: [PATCHv2 bluetooth-next 02/10] 6lowpan: add 802.15.4 short addr slaac
From: Stefan Schmidt @ 2016-05-03 18:16 UTC (permalink / raw)
  To: Alexander Aring, linux-wpan-u79uwXL29TY76Z2rM5mHXA
  Cc: kernel-bIcnvbaLZ9MEGnE8C9+IrQ, marcel-kz+m5ild9QBg9hUCZPvPmw,
	jukka.rissanen-VuQAYsv1563Yd54FQh9/CA,
	hannes-tFNcAqjVMyqKXQKiL6tip0B+6BGkLq7r,
	mcr-SWp7JaYWvAQV+D8aMU/kSg, werner-SEdMjqphH88wryQfseakQg,
	linux-bluetooth-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA, David S . Miller, Alexey Kuznetsov,
	James Morris, Hideaki YOSHIFUJI, Patrick McHardy
In-Reply-To: <1461140382-4784-3-git-send-email-aar-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>

Hello.

On 20/04/16 10:19, Alexander Aring wrote:
> This patch adds the autoconfiguration if a valid 802.15.4 short address
> is available for 802.15.4 6LoWPAN interfaces.
>
> Cc: David S. Miller<davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
> Cc: Alexey Kuznetsov<kuznet-v/Mj1YrvjDBInbfyfbPRSQ@public.gmane.org>
> Cc: James Morris<jmorris-gx6/JNMH7DfYtjvyW6yDsg@public.gmane.org>
> Cc: Hideaki YOSHIFUJI<yoshfuji-VfPWfsRibaP+Ru+s062T9g@public.gmane.org>
> Cc: Patrick McHardy<kaber-dcUjhNyLwpNeoWH0uzbU5w@public.gmane.org>
> Signed-off-by: Alexander Aring<aar-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> ---
>   include/net/addrconf.h |  3 +++
>   net/6lowpan/core.c     | 46 ++++++++++++++++++++++++++++++++++++++++++++++
>   net/ipv6/addrconf.c    |  5 +++--
>   3 files changed, 52 insertions(+), 2 deletions(-)
>
> diff --git a/include/net/addrconf.h b/include/net/addrconf.h
> index 730d856..b1774eb 100644
> --- a/include/net/addrconf.h
> +++ b/include/net/addrconf.h
> @@ -94,6 +94,9 @@ int ipv6_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2,
>   void addrconf_join_solict(struct net_device *dev, const struct in6_addr *addr);
>   void addrconf_leave_solict(struct inet6_dev *idev, const struct in6_addr *addr);
>   
> +void addrconf_add_linklocal(struct inet6_dev *idev,
> +			    const struct in6_addr *addr, u32 flags);
> +
>   static inline int addrconf_ifid_eui48(u8 *eui, struct net_device *dev)
>   {
>   	if (dev->addr_len != ETH_ALEN)
> diff --git a/net/6lowpan/core.c b/net/6lowpan/core.c
> index 7a240b3..fbae31e 100644
> --- a/net/6lowpan/core.c
> +++ b/net/6lowpan/core.c
> @@ -14,6 +14,7 @@
>   #include <linux/module.h>
>   
>   #include <net/6lowpan.h>
> +#include <net/addrconf.h>
>   
>   #include "6lowpan_i.h"
>   
> @@ -72,16 +73,61 @@ void lowpan_unregister_netdev(struct net_device *dev)
>   }
>   EXPORT_SYMBOL(lowpan_unregister_netdev);
>   
> +static int addrconf_ifid_802154_6lowpan(u8 *eui, struct net_device *dev)
> +{
> +	struct wpan_dev *wpan_dev = lowpan_802154_dev(dev)->wdev->ieee802154_ptr;
> +
> +	/* Set short_addr autoconfiguration if short_addr is present only */
> +	if (!ieee802154_is_valid_src_short_addr(wpan_dev->short_addr))
> +		return -1;

-EINVAL instead of -1?

> +
> +	/* For either address format, all zero addresses MUST NOT be used */
> +	if (wpan_dev->pan_id == cpu_to_le16(0x0000) &&
> +	    wpan_dev->short_addr == cpu_to_le16(0x0000))
> +		return -1;

-EINVAL instead of -1?
> +
> +	/* Alternatively, if no PAN ID is known, 16 zero bits may be used */
> +	if (wpan_dev->pan_id == cpu_to_le16(IEEE802154_PAN_ID_BROADCAST))
> +		memset(eui, 0, 2);
> +	else
> +		ieee802154_le16_to_be16(eui, &wpan_dev->pan_id);
> +
> +	/* The "Universal/Local" (U/L) bit shall be set to zero */
> +	eui[0] &= ~2;
> +	eui[2] = 0;
> +	eui[3] = 0xFF;
> +	eui[4] = 0xFE;
> +	eui[5] = 0;
> +	ieee802154_le16_to_be16(&eui[6], &wpan_dev->short_addr);
> +	return 0;
> +}
> +
>   static int lowpan_event(struct notifier_block *unused,
>   			unsigned long event, void *ptr)
>   {
>   	struct net_device *dev = netdev_notifier_info_to_dev(ptr);
> +	struct inet6_dev *idev;
> +	struct in6_addr addr;
>   	int i;
>   
>   	if (dev->type != ARPHRD_6LOWPAN)
>   		return NOTIFY_DONE;
>   
> +	idev = __in6_dev_get(dev);
> +	if (!idev)
> +		return NOTIFY_DONE;
> +
>   	switch (event) {
> +	case NETDEV_UP:
> +	case NETDEV_CHANGE:
> +		/* (802.15.4 6LoWPAN short address slaac handling */
> +		if (lowpan_is_ll(dev, LOWPAN_LLTYPE_IEEE802154) &&
> +		    addrconf_ifid_802154_6lowpan(addr.s6_addr + 8, dev) == 0) {

I normally would like to get a define here instead of the magic number 
8, but given how complex this if statement already is I think its fine 
to keep it.

> +			__ipv6_addr_set_half(&addr.s6_addr32[0],
> +					     htonl(0xFE800000), 0);
> +			addrconf_add_linklocal(idev, &addr, 0);
> +		}
> +		break;
>   	case NETDEV_DOWN:
>   		for (i = 0; i < LOWPAN_IPHC_CTX_TABLE_SIZE; i++)
>   			clear_bit(LOWPAN_IPHC_CTX_FLAG_ACTIVE,
> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
> index 27aed1a..54e18c2 100644
> --- a/net/ipv6/addrconf.c
> +++ b/net/ipv6/addrconf.c
> @@ -2948,8 +2948,8 @@ static void init_loopback(struct net_device *dev)
>   	}
>   }
>   
> -static void addrconf_add_linklocal(struct inet6_dev *idev,
> -				   const struct in6_addr *addr, u32 flags)
> +void addrconf_add_linklocal(struct inet6_dev *idev,
> +			    const struct in6_addr *addr, u32 flags)
>   {
>   	struct inet6_ifaddr *ifp;
>   	u32 addr_flags = flags | IFA_F_PERMANENT;
> @@ -2968,6 +2968,7 @@ static void addrconf_add_linklocal(struct inet6_dev *idev,
>   		in6_ifa_put(ifp);
>   	}
>   }
> +EXPORT_SYMBOL(addrconf_add_linklocal);
>   
>   static bool ipv6_reserved_interfaceid(struct in6_addr address)
>   {

Reviewed-by: Stefan Schmidt<stefan-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>

regards
Stefan Schmidt

^ permalink raw reply

* Re: [PATCHv2 bluetooth-next 01/10] 6lowpan: add private neighbour data
From: Stefan Schmidt @ 2016-05-03 18:16 UTC (permalink / raw)
  To: Alexander Aring, linux-wpan
  Cc: kernel, marcel, jukka.rissanen, hannes, mcr, werner,
	linux-bluetooth, netdev, David S . Miller
In-Reply-To: <1461140382-4784-2-git-send-email-aar@pengutronix.de>

Hello.

On 20/04/16 10:19, Alexander Aring wrote:
> This patch will introduce a 6lowpan neighbour private data. Like the
> interface private data we handle private data for generic 6lowpan and
> for link-layer specific 6lowpan.
>
> The current first use case if to save the short address for a 802.15.4
> 6lowpan neighbour.
>
> Cc: David S. Miller<davem@davemloft.net>
> Signed-off-by: Alexander Aring<aar@pengutronix.de>
> ---
>   include/linux/netdevice.h     |  3 +--
>   include/net/6lowpan.h         | 24 ++++++++++++++++++++++++
>   net/bluetooth/6lowpan.c       |  2 ++
>   net/ieee802154/6lowpan/core.c | 12 ++++++++++++
>   4 files changed, 39 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index 166402a..0052c42 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -1487,8 +1487,7 @@ enum netdev_priv_flags {
>    * 	@perm_addr:		Permanent hw address
>    * 	@addr_assign_type:	Hw address assignment type
>    * 	@addr_len:		Hardware address length
> - * 	@neigh_priv_len;	Used in neigh_alloc(),
> - * 				initialized only in atm/clip.c
> + *	@neigh_priv_len;	Used in neigh_alloc()
>    * 	@dev_id:		Used to differentiate devices that share
>    * 				the same link layer address
>    * 	@dev_port:		Used to differentiate devices that share
> diff --git a/include/net/6lowpan.h b/include/net/6lowpan.h
> index da84cf9..61c6517 100644
> --- a/include/net/6lowpan.h
> +++ b/include/net/6lowpan.h
> @@ -98,6 +98,9 @@ static inline bool lowpan_is_iphc(u8 dispatch)
>   #define LOWPAN_PRIV_SIZE(llpriv_size)	\
>   	(sizeof(struct lowpan_dev) + llpriv_size)
>   
> +#define LOWPAN_NEIGH_PRIV_SIZE(llneigh_priv_size)	\
> +	(sizeof(struct lowpan_neigh) + llneigh_priv_size)
> +
>   enum lowpan_lltypes {
>   	LOWPAN_LLTYPE_BTLE,
>   	LOWPAN_LLTYPE_IEEE802154,
> @@ -141,6 +144,27 @@ struct lowpan_dev {
>   	u8 priv[0] __aligned(sizeof(void *));
>   };
>   
> +struct lowpan_neigh {
> +	/* 6LoWPAN neigh private data */
> +	/* must be last */
> +	u8 priv[0] __aligned(sizeof(void *));
> +};
> +
> +struct lowpan_802154_neigh {
> +	__le16 short_addr;
> +};
> +
> +static inline struct lowpan_neigh *lowpan_neigh(void *neigh_priv)
> +{
> +	return neigh_priv;
> +}
> +
> +static inline
> +struct lowpan_802154_neigh *lowpan_802154_neigh(void *neigh_priv)
> +{
> +	return (struct lowpan_802154_neigh *)lowpan_neigh(neigh_priv)->priv;
> +}
> +
>   static inline
>   struct lowpan_dev *lowpan_dev(const struct net_device *dev)
>   {
> diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
> index 38e82dd..b7c4efa 100644
> --- a/net/bluetooth/6lowpan.c
> +++ b/net/bluetooth/6lowpan.c
> @@ -833,6 +833,8 @@ static int setup_netdev(struct l2cap_chan *chan, struct lowpan_btle_dev **dev)
>   	list_add_rcu(&(*dev)->list, &bt_6lowpan_devices);
>   	spin_unlock(&devices_lock);
>   
> +	netdev->neigh_priv_len = LOWPAN_NEIGH_PRIV_SIZE(0);
> +
>   	err = lowpan_register_netdev(netdev, LOWPAN_LLTYPE_BTLE);
>   	if (err < 0) {
>   		BT_INFO("register_netdev failed %d", err);
> diff --git a/net/ieee802154/6lowpan/core.c b/net/ieee802154/6lowpan/core.c
> index dd085db..3162632 100644
> --- a/net/ieee802154/6lowpan/core.c
> +++ b/net/ieee802154/6lowpan/core.c
> @@ -92,11 +92,21 @@ static int lowpan_stop(struct net_device *dev)
>   	return 0;
>   }
>   
> +static int lowpan_neigh_construct(struct neighbour *n)
> +{
> +	struct lowpan_802154_neigh *neigh = lowpan_802154_neigh(neighbour_priv(n));
> +
> +	/* default no short_addr is available for a neighbour */
> +	neigh->short_addr = cpu_to_le16(IEEE802154_ADDR_SHORT_UNSPEC);
> +	return 0;
> +}
> +
>   static const struct net_device_ops lowpan_netdev_ops = {
>   	.ndo_init		= lowpan_dev_init,
>   	.ndo_start_xmit		= lowpan_xmit,
>   	.ndo_open		= lowpan_open,
>   	.ndo_stop		= lowpan_stop,
> +	.ndo_neigh_construct    = lowpan_neigh_construct,
>   };
>   
>   static void lowpan_setup(struct net_device *ldev)
> @@ -161,6 +171,8 @@ static int lowpan_newlink(struct net *src_net, struct net_device *ldev,
>   				wdev->needed_headroom;
>   	ldev->needed_tailroom = wdev->needed_tailroom;
>   
> +	ldev->neigh_priv_len = LOWPAN_NEIGH_PRIV_SIZE(sizeof(struct lowpan_802154_neigh));
> +
>   	ret = lowpan_register_netdevice(ldev, LOWPAN_LLTYPE_IEEE802154);
>   	if (ret < 0) {
>   		dev_put(wdev);

Reviewed-by: Stefan Schmidt<stefan@osg.samsung.com>

regards
Stefan Schmidt

^ permalink raw reply

* Re: [PATCH v1 net] net/mlx4: Avoid wrong virtual mappings
From: Or Gerlitz @ 2016-05-03 18:15 UTC (permalink / raw)
  To: David Miller
  Cc: Haggai Abramovsky, Linux Netdev List, Sinan Kaya, Timur Tabi,
	Eran Ben Elisha, Yishai Hadas, talal@mellanox.com, Saeed Mahameed
In-Reply-To: <20160503.120032.1579415495628422336.davem@davemloft.net>

On Tue, May 3, 2016, David Miller <davem@davemloft.net> wrote:
> From: Or Gerlitz <gerlitz.or@gmail.com>

>> The patch changes the driver to do single allocation for potentially
>> very large HW WQE descriptor buffers such as those used by the RDMA
>> (mlx5_ib) driver.

> I know exactly what this patch does and how, but thanks for trying to
> teach me what it does anyways.

Dave,

This was more of a thinking out loud, not trying to teach you anything.

As I said, we're aiming for net-next, and as such the re-spin to
address your comment on bool vs int will be targeted there.

Or.

^ permalink raw reply

* Re: [PATCH nf-next 5/9] netfilter: conntrack: small refactoring of conntrack seq_printf
From: Pablo Neira Ayuso @ 2016-05-03 18:12 UTC (permalink / raw)
  To: Florian Westphal; +Cc: netfilter-devel, netdev
In-Reply-To: <1461863628-23350-6-git-send-email-fw@strlen.de>

On Thu, Apr 28, 2016 at 07:13:44PM +0200, Florian Westphal wrote:
> The iteration process is lockless, so we test if the conntrack object is
> eligible for printing (e.g. is AF_INET) after obtaining the reference
> count.
> 
> Once we put all conntracks into same hash table we might see more
> entries that need to be skipped.
> 
> So add a helper and first perform the test in a lockless fashion
> for fast skip.
> 
> Once we obtain the reference count, just repeat the check.
> 
> Signed-off-by: Florian Westphal <fw@strlen.de>
> ---
>  .../netfilter/nf_conntrack_l3proto_ipv4_compat.c   | 24 +++++++++++++++++-----
>  1 file changed, 19 insertions(+), 5 deletions(-)
> 
> diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c
> index f0dfe92..483cf79 100644
> --- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c
> +++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c
> @@ -114,6 +114,19 @@ static inline void ct_show_secctx(struct seq_file *s, const struct nf_conn *ct)
>  }
>  #endif
>  
> +static bool ct_seq_should_skip(const struct nf_conn *ct,
> +			       const struct nf_conntrack_tuple_hash *hash)
> +{
> +	/* we only want to print DIR_ORIGINAL */
> +	if (NF_CT_DIRECTION(hash))
> +		return true;
> +
> +	if (nf_ct_l3num(ct) != AF_INET)
> +		return true;
> +
> +	return false;
> +}
> +
>  static int ct_seq_show(struct seq_file *s, void *v)
>  {
>  	struct nf_conntrack_tuple_hash *hash = v;
> @@ -123,14 +136,15 @@ static int ct_seq_show(struct seq_file *s, void *v)
>  	int ret = 0;
>  
>  	NF_CT_ASSERT(ct);
> -	if (unlikely(!atomic_inc_not_zero(&ct->ct_general.use)))
> +	if (ct_seq_should_skip(ct, hash))
>  		return 0;
>  
> +	if (unlikely(!atomic_inc_not_zero(&ct->ct_general.use)))
> +		return 0;
>  
> -	/* we only want to print DIR_ORIGINAL */
> -	if (NF_CT_DIRECTION(hash))
> -		goto release;
> -	if (nf_ct_l3num(ct) != AF_INET)
> +	/* check if we raced w. object reuse */
> +	if (!nf_ct_is_confirmed(ct) ||

This refactoring includes this new check, is this intentional?

> +	    ct_seq_should_skip(ct, hash))
>  		goto release;
>  
>  	l3proto = __nf_ct_l3proto_find(nf_ct_l3num(ct));
> -- 
> 2.7.3
> 

^ permalink raw reply

* Re: [PATCH nf-next 3/9] netfilter: conntrack: don't attempt to iterate over empty table
From: Florian Westphal @ 2016-05-03 17:55 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Florian Westphal, netfilter-devel, netdev
In-Reply-To: <20160503174144.GA3782@salvia>

Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> > I was thinking of the cleanup we do in the netns exit path
> > (in nf_conntrack_cleanup_net_list() ).
> 
> Right, but in that path we still have entries in the table.

Not necessarily, they might have already been removed
(timeout, close).

> > If you don't like this I can move the check here:
> > 
> > i_see_dead_people:
> >     busy = 0;
> >     list_for_each_entry(net, net_exit_list, exit_list) {
> >     // here
> >     if (atomic_read .. > 0)
> >        nf_ct_iterate_cleanup(net, kill_all, ...
> 
> I don't mind about placing this or there, as I said, my question is
> how often we will hit this optimization in a real scenario.
> 
> If you think the answer is often, then this will help.

I think the extra atomic_read in this code does no harm and
saves us the entire scan.  Also, in the exit path, when we hit the
'i_see_dead_people' label we restart the entire loop, so if we
have 200 netns on the list and the last one caused that restart,
we re-iterate needlesly for 199 netns...

> Otherwise, every time we'll go container destruction path, we'll hit
> slow path, ie.  scanning the full table.

Yes, but I see no other choice.

^ permalink raw reply

* Re: [PATCH nf-next 3/9] netfilter: conntrack: don't attempt to iterate over empty table
From: Pablo Neira Ayuso @ 2016-05-03 17:41 UTC (permalink / raw)
  To: Florian Westphal; +Cc: netfilter-devel, netdev
In-Reply-To: <20160503171744.GG2395@breakpoint.cc>

On Tue, May 03, 2016 at 07:17:44PM +0200, Florian Westphal wrote:
> Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> > On Thu, Apr 28, 2016 at 07:13:42PM +0200, Florian Westphal wrote:
> > > Once we place all conntracks into same table iteration becomes more
> > > costly because the table contains conntracks that we are not interested
> > > in (belonging to other netns).
> > > 
> > > So don't bother scanning if the current namespace has no entries.
> > > 
> > > Signed-off-by: Florian Westphal <fw@strlen.de>
> > > ---
> > >  net/netfilter/nf_conntrack_core.c | 3 +++
> > >  1 file changed, 3 insertions(+)
> > > 
> > > diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
> > > index 29fa08b..f2e75a5 100644
> > > --- a/net/netfilter/nf_conntrack_core.c
> > > +++ b/net/netfilter/nf_conntrack_core.c
> > > @@ -1428,6 +1428,9 @@ void nf_ct_iterate_cleanup(struct net *net,
> > >  
> > >  	might_sleep();
> > >  
> > > +	if (atomic_read(&net->ct.count) == 0)
> > > +		return;
> > 
> > This optimization gets defeated with just one single conntrack (ie.
> > net->ct.count == 1), so I wonder if this is practical thing.
> 
> I was thinking of the cleanup we do in the netns exit path
> (in nf_conntrack_cleanup_net_list() ).

Right, but in that path we still have entries in the table.

> If you don't like this I can move the check here:
> 
> i_see_dead_people:
>     busy = 0;
>     list_for_each_entry(net, net_exit_list, exit_list) {
>     // here
>     if (atomic_read .. > 0)
>        nf_ct_iterate_cleanup(net, kill_all, ...

I don't mind about placing this or there, as I said, my question is
how often we will hit this optimization in a real scenario.

If you think the answer is often, then this will help.

Otherwise, every time we'll go container destruction path, we'll hit
slow path, ie.  scanning the full table.

> > At the cost of consuming more memory per conntrack, we may consider
> > adding a per-net list so this iteration doesn't become a problem.
> 
> I don't think that will be needed.   We don't have any such iterations
> in the fast path.
>
> For dumps via ctnetlink it shouldn't be a big deal either, if needed
> we can optimize that to use rcu readlocks only and 'upgrade' to locked
> path only when we want to dump the candidate ct.
> for deferred pruning).
> early_drop will go away soon (i'll rework it to do the early_drop from
> work queue).

OK.

^ permalink raw reply

* [PATCH v2 net-next] dmfe: kill DEVICE define
From: Florian Westphal @ 2016-05-03 16:53 UTC (permalink / raw)
  To: netdev; +Cc: Florian Westphal

use net_device directly. Compile tested, objdiff shows no changes.

Signed-off-by: Florian Westphal <fw@strlen.de>
---
 resending this separately as it's not related to the
 rest of the dev->trans_start removal series.

 drivers/net/ethernet/dec/tulip/dmfe.c | 39 ++++++++++++++++-------------------
 1 file changed, 18 insertions(+), 21 deletions(-)

diff --git a/drivers/net/ethernet/dec/tulip/dmfe.c b/drivers/net/ethernet/dec/tulip/dmfe.c
index afd8e78..42c759e 100644
--- a/drivers/net/ethernet/dec/tulip/dmfe.c
+++ b/drivers/net/ethernet/dec/tulip/dmfe.c
@@ -192,9 +192,6 @@
 	(__CHK_IO_SIZE(((pci_dev)->device << 16) | (pci_dev)->vendor, \
 	(pci_dev)->revision))
 
-/* Sten Check */
-#define DEVICE net_device
-
 /* Structure/enum declaration ------------------------------- */
 struct tx_desc {
         __le32 tdes0, tdes1, tdes2, tdes3; /* Data for the card */
@@ -313,10 +310,10 @@ static u8 SF_mode;		/* Special Function: 1:VLAN, 2:RX Flow Control
 
 
 /* function declaration ------------------------------------- */
-static int dmfe_open(struct DEVICE *);
-static netdev_tx_t dmfe_start_xmit(struct sk_buff *, struct DEVICE *);
-static int dmfe_stop(struct DEVICE *);
-static void dmfe_set_filter_mode(struct DEVICE *);
+static int dmfe_open(struct net_device *);
+static netdev_tx_t dmfe_start_xmit(struct sk_buff *, struct net_device *);
+static int dmfe_stop(struct net_device *);
+static void dmfe_set_filter_mode(struct net_device *);
 static const struct ethtool_ops netdev_ethtool_ops;
 static u16 read_srom_word(void __iomem *, int);
 static irqreturn_t dmfe_interrupt(int , void *);
@@ -326,8 +323,8 @@ static void poll_dmfe (struct net_device *dev);
 static void dmfe_descriptor_init(struct net_device *);
 static void allocate_rx_buffer(struct net_device *);
 static void update_cr6(u32, void __iomem *);
-static void send_filter_frame(struct DEVICE *);
-static void dm9132_id_table(struct DEVICE *);
+static void send_filter_frame(struct net_device *);
+static void dm9132_id_table(struct net_device *);
 static u16 dmfe_phy_read(void __iomem *, u8, u8, u32);
 static void dmfe_phy_write(void __iomem *, u8, u8, u16, u32);
 static void dmfe_phy_write_1bit(void __iomem *, u32);
@@ -336,12 +333,12 @@ static u8 dmfe_sense_speed(struct dmfe_board_info *);
 static void dmfe_process_mode(struct dmfe_board_info *);
 static void dmfe_timer(unsigned long);
 static inline u32 cal_CRC(unsigned char *, unsigned int, u8);
-static void dmfe_rx_packet(struct DEVICE *, struct dmfe_board_info *);
-static void dmfe_free_tx_pkt(struct DEVICE *, struct dmfe_board_info *);
+static void dmfe_rx_packet(struct net_device *, struct dmfe_board_info *);
+static void dmfe_free_tx_pkt(struct net_device *, struct dmfe_board_info *);
 static void dmfe_reuse_skb(struct dmfe_board_info *, struct sk_buff *);
-static void dmfe_dynamic_reset(struct DEVICE *);
+static void dmfe_dynamic_reset(struct net_device *);
 static void dmfe_free_rxbuffer(struct dmfe_board_info *);
-static void dmfe_init_dm910x(struct DEVICE *);
+static void dmfe_init_dm910x(struct net_device *);
 static void dmfe_parse_srom(struct dmfe_board_info *);
 static void dmfe_program_DM9801(struct dmfe_board_info *, int);
 static void dmfe_program_DM9802(struct dmfe_board_info *);
@@ -558,7 +555,7 @@ static void dmfe_remove_one(struct pci_dev *pdev)
  *	The interface is opened whenever "ifconfig" actives it.
  */
 
-static int dmfe_open(struct DEVICE *dev)
+static int dmfe_open(struct net_device *dev)
 {
 	struct dmfe_board_info *db = netdev_priv(dev);
 	const int irq = db->pdev->irq;
@@ -617,7 +614,7 @@ static int dmfe_open(struct DEVICE *dev)
  *	Enable Tx/Rx machine
  */
 
-static void dmfe_init_dm910x(struct DEVICE *dev)
+static void dmfe_init_dm910x(struct net_device *dev)
 {
 	struct dmfe_board_info *db = netdev_priv(dev);
 	void __iomem *ioaddr = db->ioaddr;
@@ -684,7 +681,7 @@ static void dmfe_init_dm910x(struct DEVICE *dev)
  */
 
 static netdev_tx_t dmfe_start_xmit(struct sk_buff *skb,
-					 struct DEVICE *dev)
+					 struct net_device *dev)
 {
 	struct dmfe_board_info *db = netdev_priv(dev);
 	void __iomem *ioaddr = db->ioaddr;
@@ -754,7 +751,7 @@ static netdev_tx_t dmfe_start_xmit(struct sk_buff *skb,
  *	The interface is stopped when it is brought.
  */
 
-static int dmfe_stop(struct DEVICE *dev)
+static int dmfe_stop(struct net_device *dev)
 {
 	struct dmfe_board_info *db = netdev_priv(dev);
 	void __iomem *ioaddr = db->ioaddr;
@@ -798,7 +795,7 @@ static int dmfe_stop(struct DEVICE *dev)
 
 static irqreturn_t dmfe_interrupt(int irq, void *dev_id)
 {
-	struct DEVICE *dev = dev_id;
+	struct net_device *dev = dev_id;
 	struct dmfe_board_info *db = netdev_priv(dev);
 	void __iomem *ioaddr = db->ioaddr;
 	unsigned long flags;
@@ -879,7 +876,7 @@ static void poll_dmfe (struct net_device *dev)
  *	Free TX resource after TX complete
  */
 
-static void dmfe_free_tx_pkt(struct DEVICE *dev, struct dmfe_board_info * db)
+static void dmfe_free_tx_pkt(struct net_device *dev, struct dmfe_board_info *db)
 {
 	struct tx_desc *txptr;
 	void __iomem *ioaddr = db->ioaddr;
@@ -961,7 +958,7 @@ static inline u32 cal_CRC(unsigned char * Data, unsigned int Len, u8 flag)
  *	Receive the come packet and pass to upper layer
  */
 
-static void dmfe_rx_packet(struct DEVICE *dev, struct dmfe_board_info * db)
+static void dmfe_rx_packet(struct net_device *dev, struct dmfe_board_info *db)
 {
 	struct rx_desc *rxptr;
 	struct sk_buff *skb, *newskb;
@@ -1052,7 +1049,7 @@ static void dmfe_rx_packet(struct DEVICE *dev, struct dmfe_board_info * db)
  * Set DM910X multicast address
  */
 
-static void dmfe_set_filter_mode(struct DEVICE * dev)
+static void dmfe_set_filter_mode(struct net_device *dev)
 {
 	struct dmfe_board_info *db = netdev_priv(dev);
 	unsigned long flags;
-- 
2.7.3

^ permalink raw reply related

* Re: [PATCH net 0/4] Mellanox 100G mlx5 fixes for 4.6-rc
From: David Miller @ 2016-05-03 17:37 UTC (permalink / raw)
  To: saeedm; +Cc: netdev, ogerlitz, talal, eranbe
In-Reply-To: <1462132797-22853-1-git-send-email-saeedm@mellanox.com>

From: Saeed Mahameed <saeedm@mellanox.com>
Date: Sun,  1 May 2016 22:59:53 +0300

> This small series provides some bug fixes for mlx5 driver.
>  
> A small bug fix for iounmap of a null pointer, which dumps a warning on some archs.
> 
> One patch to fix the VXLAN/MLX5_EN dependency issue reported by Arnd.
> 
> Two patches to fix the scheduling while atomic issue for ndo_add/del_vxlan_port 
> NDOs.  The first will add an internal mlx5e workqueue and the second will 
> delegate vxlan ports add/del requests to that workqueue.
> 
> Note: ('net/mlx5: Kconfig: Fix MLX5_EN/VXLAN build issue') is only needed for net 
> and not net-next as the issue was globally fixed for all device drivers by:
> b7aade15485a ('vxlan: break dependency with netdev drivers') in net-next.
> 
> Applied on top: f27337e16f2d ('ip_tunnel: fix preempt warning in ip tunnel creation/updating')

Series applied, thanks.

^ permalink raw reply

* Re: [PATCH nf-next 3/9] netfilter: conntrack: don't attempt to iterate over empty table
From: Florian Westphal @ 2016-05-03 17:17 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Florian Westphal, netfilter-devel, netdev
In-Reply-To: <20160503170357.GA21641@salvia>

Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> On Thu, Apr 28, 2016 at 07:13:42PM +0200, Florian Westphal wrote:
> > Once we place all conntracks into same table iteration becomes more
> > costly because the table contains conntracks that we are not interested
> > in (belonging to other netns).
> > 
> > So don't bother scanning if the current namespace has no entries.
> > 
> > Signed-off-by: Florian Westphal <fw@strlen.de>
> > ---
> >  net/netfilter/nf_conntrack_core.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
> > index 29fa08b..f2e75a5 100644
> > --- a/net/netfilter/nf_conntrack_core.c
> > +++ b/net/netfilter/nf_conntrack_core.c
> > @@ -1428,6 +1428,9 @@ void nf_ct_iterate_cleanup(struct net *net,
> >  
> >  	might_sleep();
> >  
> > +	if (atomic_read(&net->ct.count) == 0)
> > +		return;
> 
> This optimization gets defeated with just one single conntrack (ie.
> net->ct.count == 1), so I wonder if this is practical thing.

I was thinking of the cleanup we do in the netns exit path
(in nf_conntrack_cleanup_net_list() ).

If you don't like this I can move the check here:

i_see_dead_people:
    busy = 0;
    list_for_each_entry(net, net_exit_list, exit_list) {
    // here
    if (atomic_read .. > 0)
       nf_ct_iterate_cleanup(net, kill_all, ...

> At the cost of consuming more memory per conntrack, we may consider
> adding a per-net list so this iteration doesn't become a problem.

I don't think that will be needed.   We don't have any such iterations
in the fast path.

For dumps via ctnetlink it shouldn't be a big deal either, if needed
we can optimize that to use rcu readlocks only and 'upgrade' to locked
path only when we want to dump the candidate ct.
for deferred pruning).

early_drop will go away soon (i'll rework it to do the early_drop from
work queue).

^ permalink raw reply

* Re: [PATCH 4/4] net: ethernet: fec_mpc52xx: move to new ethtool api {get|set}_link_ksettings
From: David Miller @ 2016-05-03 17:04 UTC (permalink / raw)
  To: tremyfr
  Cc: pantelis.antoniou, vbordug, claudiu.manoil, leoli, treding,
	netdev, linux-kernel, linuxppc-dev
In-Reply-To: <1462115291-11372-4-git-send-email-tremyfr@gmail.com>

From: Philippe Reynes <tremyfr@gmail.com>
Date: Sun,  1 May 2016 17:08:11 +0200

> The ethtool api {get|set}_settings is deprecated.
> We move the fec_mpc52xx driver to new api {get|set}_link_ksettings.
> 
> Signed-off-by: Philippe Reynes <tremyfr@gmail.com>

Applied.

^ permalink raw reply

* Re: [PATCH 3/4] net: ethernet: fs-enet: move to new ethtool api {get|set}_link_ksettings
From: David Miller @ 2016-05-03 17:04 UTC (permalink / raw)
  To: tremyfr
  Cc: pantelis.antoniou, vbordug, claudiu.manoil, leoli, treding,
	netdev, linux-kernel, linuxppc-dev
In-Reply-To: <1462115291-11372-3-git-send-email-tremyfr@gmail.com>

From: Philippe Reynes <tremyfr@gmail.com>
Date: Sun,  1 May 2016 17:08:10 +0200

> The ethtool api {get|set}_settings is deprecated.
> We move the fs-enet driver to new api {get|set}_link_ksettings.
> 
> Signed-off-by: Philippe Reynes <tremyfr@gmail.com>

Applied.

^ permalink raw reply

* Re: [PATCH 2/4] net: ethernet: ucc: move to new ethtool api {get|set}_link_ksettings
From: David Miller @ 2016-05-03 17:04 UTC (permalink / raw)
  To: tremyfr
  Cc: pantelis.antoniou, vbordug, claudiu.manoil, leoli, treding,
	netdev, linux-kernel, linuxppc-dev
In-Reply-To: <1462115291-11372-2-git-send-email-tremyfr@gmail.com>

From: Philippe Reynes <tremyfr@gmail.com>
Date: Sun,  1 May 2016 17:08:09 +0200

> The ethtool api {get|set}_settings is deprecated.
> We move the ucc driver to new api {get|set}_link_ksettings.
> 
> Signed-off-by: Philippe Reynes <tremyfr@gmail.com>

Applied.

^ 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