Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH net-next v1 3/5] ipv4: enable IFA_IF_NETNSID for RTM_GETADDR
From: Nicolas Dichtel @ 2018-09-04  7:20 UTC (permalink / raw)
  To: Jiri Benc, David Ahern
  Cc: Christian Brauner, netdev, linux-kernel, davem, kuznet, yoshfuji,
	pombredanne, kstewart, gregkh, fw, ktkhai, lucien.xin,
	jakub.kicinski
In-Reply-To: <20180904085006.58c665c0@redhat.com>


Le 04/09/2018 à 08:50, Jiri Benc a écrit :
> On Mon, 3 Sep 2018 21:11:30 -0600, David Ahern wrote:
>> Can only use it once per message type, but NLM_F_DUMP_FILTERED is a flag
>> that can be set to explicitly say the request is filtered as requested.
> 
> The problem is that NLM_F_DUMP_FILTERED is too coarse. There's no way
> to determine whether the netnsid was honored or whether it was not but
> other filtering took effect.
> 
> This is a general problem with netlink: unknown attributes are ignored.
> We need a way to detect that certain attribute was understood by the
> kernel or was not. And it needs to work retroactively, i.e. the
> application has to be able to determine the currently running kernel
> does not support the feature (because it's too old).
> 
> That's why we return back the attribute in responses to a request with
> IFLA_IF_NETNSID present and why we should do the same for
> IFA_IF_NETNSID.
+1

> 
>> See 21fdd092acc7e. I would like to see other filters added for addresses
>> in the same release this gets used. The only one that comes to mind for
>> addresses is to only return addresses for devices with master device
>> index N (same intent as 21fdd092acc7e for neighbors).
> 
> I also question the statement that IFA_F_NETNSID is a filter: my
> understanding of "filter" is something that limits the output to a
> certain subset. I.e., unfiltered results always contain everything that
> is in a filtered result. While with IFA_F_NETNSID, we get a completely
> different set of data. Does that really constitute a filter? Note that
> we can still filter in the target netns.
+1


Regards,
Nicolas

^ permalink raw reply

* Re: [PATCH net-next v2 4/7] net: phy: mscc: read 'vsc8531,edge-slowdown' as an u32
From: Quentin Schulz @ 2018-09-04  7:26 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: davem, robh+dt, mark.rutland, f.fainelli, allan.nielsen, netdev,
	devicetree, linux-kernel, thomas.petazzoni, rf
In-Reply-To: <20180903200554.GJ4445@lunn.ch>

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

Hi Andrew,

On Mon, Sep 03, 2018 at 10:05:54PM +0200, Andrew Lunn wrote:
> > Just to be sure, we're talking here about making sure the value stored
> > in the DT is not bigger than the specified value (here an u8)? If so,
> > that isn't the reason why I'm suggesting those two patches.
> > 
> > Without /bits 8/ in the DT property, whatever were the values I put in
> > the property, I'd always get a 0. So I need to fix it either in the DT
> > (but Rob does not really like it) or in the driver.
> 
> Hi Quentin
> 
> Ah, you are fixing endian issues. That was not clear to me from the
> commit message.
> 
> I don't know enough about how DT stores values in the blob. Is there
> type info? Can the DT core tell if a value in the blob is a u8 or a
> u32?  It would be nice if it warned about reading a u8 from a u32
> blob.
> 

From my quick research, the lower bound checking is performed by
of_property_read_u* functions but not the higher bound checking (the
internal function of_find_property_value_of_size allows higher bound
checking but it seems it's never used by those functions (see 0 in
sz_max of of_property_read_variable_u*_array)).

sz_max is used by of_property_read_variable_u*_array to copy at a
maximum of sz_max values in the output buffer. If sz_max is 0, it takes
sz_min so it's an array of definite size.
So since sz_max is 0 for all calls to of_property_read_variable_u*_array
by of_property_read_u*_array, we basically know we'll get a buffer of
sz_min values but we don't actually make use of the higher bound
checking of of_find_property_value_of_size.

We could enforce this higher bound check by, instead of setting sz_max
to 0, setting sz_max to sz_min in calls to of_property_read_u*_array.

But I guess there is a reason for sz_max being 0. Rob, Richard (commit
signer of this code) do you know why? Could you explain?

> Anyway, this change still removes some bounds checking. Are they
> important? Do they need to be added back?
> 

The edge-slowdown and the vddmac values are compared against a const
array so we´re fine with those ones.

For the led-X-mode, I added a constant for supported modes that gets
checked when retrieving the DT property. So we´re fine here too.

Quentin

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply

* Re: [PATCH 3/4 next] net: lan78xx: Switch to SPDX identifier
From: Stefan Wahren @ 2018-09-04  7:26 UTC (permalink / raw)
  To: RaghuramChary.Jallipalli, Woojung.Huh
  Cc: UNGLinuxDriver, davem, netdev, linux-usb, linux-kernel
In-Reply-To: <0573C9D4B793EF43BF95221F2F4CC8515912C3@CHN-SV-EXMX06.mchp-main.com>

Hi Raghu,


Am 04.09.2018 um 06:29 schrieb RaghuramChary.Jallipalli@microchip.com:
>> +// SPDX-License-Identifier: GPL-2.0+
>> +/* Copyright (C) 2015 Microchip Technology */
> Can we merge both in single comment line?

i don't think we can do this. I'm simply following this guideline [1].

How about this:

// SPDX-License-Identifier: GPL-2.0+
/*
 * Copyright (C) 2015 Microchip Technology
 */

[1] - https://www.kernel.org/doc/html/v4.18/process/license-rules.html

>
>> +/* SPDX-License-Identifier: GPL-2.0+ */
>> +/* Copyright (C) 2015 Microchip Technology */
> Here too.
>
> Thanks,
> -Raghu

^ permalink raw reply

* RE: [PATCH 3/4 next] net: lan78xx: Switch to SPDX identifier
From: RaghuramChary.Jallipalli @ 2018-09-04  7:32 UTC (permalink / raw)
  To: stefan.wahren, Woojung.Huh
  Cc: UNGLinuxDriver, davem, netdev, linux-usb, linux-kernel
In-Reply-To: <21c3f5d9-c884-3c78-6441-dbfd47001ffe@i2se.com>

> i don't think we can do this. I'm simply following this guideline [1].
> 
> How about this:
> 
> // SPDX-License-Identifier: GPL-2.0+
> /*
>  * Copyright (C) 2015 Microchip Technology
>  */
> 
> [1] - https://www.kernel.org/doc/html/v4.18/process/license-rules.html
> 
Thank you.
Looks good to me.

Thanks,
-Raghu


^ permalink raw reply

* Re: [PATCH net-next 10/12] net: ethernet: Add helper for set_pauseparam for Asym Pause
From: Florian Fainelli @ 2018-09-03 22:30 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: David Miller, netdev, maxime.chevallier
In-Reply-To: <20180903195805.GI4445@lunn.ch>



On 09/03/18 12:58, Andrew Lunn wrote:
>> Don't you want to go one step further and incorporate the logic that xgenet,
>> tg3, gianfar and others have? That is: look at the currently advertised
>> parameters, determine what changed, and re-start auto-negotiation as a
>> result of it being enabled and something changed?
> 
> Hi Florian
> 
> Given the number of changes i'm making, over a so many different
> drivers which i cannot test, i wanted to try to keep the changes
> KISS. That way we are more likely to spot errors during review.  So i
> would prefer to be done later, unless it actually makes review
> simpler...

That's fine, but you still need to keep the test for phydev->autoneg in
xgene I believe. Since all of these drivers appear to be doing the same
thing, that's why I suggested moving this into the helper directly.
-- 
Florian

^ permalink raw reply

* Re: [PATCH] rtl8xxxu: Add rtl8188ctv support
From: Kalle Valo @ 2018-09-04  8:16 UTC (permalink / raw)
  To: Aleksei Mamlin
  Cc: Jes Sorensen, David S . Miller, linux-wireless, netdev,
	linux-kernel, Aleksei Mamlin
In-Reply-To: <20180830140541.31964-1-mamlinav@gmail.com>

Aleksei Mamlin <mamlinav@gmail.com> wrote:

> The Realtek rtl8188ctv (0x0bda:0x018a) is a highly integrated single-chip
> WLAN USB2.0 network interface controller.
> 
> Currently rtl8188ctv is supported by rtlwifi driver.
> It is similar to the rtl8188cus(0x0bda:0x818a) and uses the same config.
> 
> Signed-off-by: Aleksei Mamlin <mamlinav@gmail.com>

Patch applied to wireless-drivers-next.git, thanks.

514502c3a70b rtl8xxxu: Add rtl8188ctv support

-- 
https://patchwork.kernel.org/patch/10581745/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply

* Re: [PATCH] orinoco_usb: fix spelling mistake in fall-through annotation
From: Kalle Valo @ 2018-09-04  8:18 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: David S. Miller, linux-wireless, netdev, linux-kernel,
	Gustavo A. R. Silva
In-Reply-To: <20180903201752.GA25288@embeddedor.com>

"Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:

> Replace "fall though" with a proper "fall through" annotation.
> 
> This fix is part of the ongoing efforts to enabling
> -Wimplicit-fallthrough
> 
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>

Patch applied to wireless-drivers-next.git, thanks.

cf5652c962da orinoco_usb: fix spelling mistake in fall-through annotation

-- 
https://patchwork.kernel.org/patch/10586357/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply

* Re: [PATCH net-next] tipc: correct structure parameter comments for topsrv
From: David Miller @ 2018-09-04  4:44 UTC (permalink / raw)
  To: zhenbo.gao; +Cc: jon.maloy, tipc-discussion, netdev, ying.xue, yue.tao
In-Reply-To: <1535954920-2722-1-git-send-email-zhenbo.gao@windriver.com>

From: Zhenbo Gao <zhenbo.gao@windriver.com>
Date: Mon, 3 Sep 2018 14:08:40 +0800

> Remove the following obsolete parameter comments of tipc_topsrv struct:
>   @rcvbuf_cache
>   @tipc_conn_new
>   @tipc_conn_release
>   @tipc_conn_recvmsg
>   @imp
>   @type
> 
> Add the comments for the missing parameters below of tipc_topsrv struct:
>   @awork
>   @listener
> 
> Remove the unused or duplicated parameter comments of tipc_conn struct:
>   @outqueue_lock
>   @rx_action
> 
> Signed-off-by: Zhenbo Gao <zhenbo.gao@windriver.com>
> Reviewed-by: Ying Xue <ying.xue@windriver.com>

Applied, thank you.

^ permalink raw reply

* Re: [PATCH net-next] net: sched: null actions array pointer before releasing action
From: David Miller @ 2018-09-04  4:47 UTC (permalink / raw)
  To: xiyou.wangcong; +Cc: vladbu, netdev, jhs, jiri
In-Reply-To: <CAM_iQpU+3O1oxTPg2D6_O-FxuEMjWYZjaHrBEzg5Jy5=3=Nq6A@mail.gmail.com>

From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Mon, 3 Sep 2018 11:18:43 -0700

> On Mon, Sep 3, 2018 at 12:05 AM Vlad Buslov <vladbu@mellanox.com> wrote:
>>
>> Currently, tcf_action_delete() nulls actions array pointer after putting
>> and deleting it. However, if tcf_idr_delete_index() returns an error,
>> pointer to action is not set to null. That results it being released second
>> time in error handling code of tca_action_gd().
> 
> Oops, good catch.
> 
> Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
> 
> David, this one should also go to -net rather than -net-next.

Applied to 'net', thanks.

^ permalink raw reply

* Re: [PATCH net 0/2] sctp: two fixes for spp_ipv6_flowlabel and spp_dscp sockopts
From: David Miller @ 2018-09-04  4:58 UTC (permalink / raw)
  To: marcelo.leitner; +Cc: lucien.xin, netdev, linux-sctp, nhorman
In-Reply-To: <20180903220606.GA19741@localhost.localdomain>

From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Date: Mon, 3 Sep 2018 19:06:06 -0300

> On Mon, Sep 03, 2018 at 03:47:09PM +0800, Xin Long wrote:
>> This patchset fixes two problems in sctp_apply_peer_addr_params()
>> when setting spp_ipv6_flowlabel or spp_dscp.
>> 
>> Xin Long (2):
>>   sctp: fix invalid reference to the index variable of the iterator
>>   sctp: not traverse asoc trans list if non-ipv6 trans exists for
>>     ipv6_flowlabel
>> 
>>  net/sctp/socket.c | 34 +++++++++++++++++++---------------
>>  1 file changed, 19 insertions(+), 15 deletions(-)
> 
> Series
> Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>

Series applied.

^ permalink raw reply

* Re: [PATCH net-next v2 4/7] net: phy: mscc: read 'vsc8531,edge-slowdown' as an u32 [UNSCANNED]
From: Richard Fitzgerald @ 2018-09-04  9:21 UTC (permalink / raw)
  To: Quentin Schulz, Andrew Lunn
  Cc: davem, robh+dt, mark.rutland, f.fainelli, allan.nielsen, netdev,
	devicetree, linux-kernel, thomas.petazzoni, rf
In-Reply-To: <20180904072630.zc6sdz2xdti5nku4@qschulz>

On 04/09/18 08:26, Quentin Schulz wrote:
> Hi Andrew,
> 
> On Mon, Sep 03, 2018 at 10:05:54PM +0200, Andrew Lunn wrote:
>>> Just to be sure, we're talking here about making sure the value stored
>>> in the DT is not bigger than the specified value (here an u8)? If so,
>>> that isn't the reason why I'm suggesting those two patches.
>>>
>>> Without /bits 8/ in the DT property, whatever were the values I put in
>>> the property, I'd always get a 0. So I need to fix it either in the DT
>>> (but Rob does not really like it) or in the driver.
>>
>> Hi Quentin
>>
>> Ah, you are fixing endian issues. That was not clear to me from the
>> commit message.
>>
>> I don't know enough about how DT stores values in the blob. Is there
>> type info? Can the DT core tell if a value in the blob is a u8 or a
>> u32?  It would be nice if it warned about reading a u8 from a u32
>> blob.
>>
> 
>  From my quick research, the lower bound checking is performed by
> of_property_read_u* functions but not the higher bound checking (the
> internal function of_find_property_value_of_size allows higher bound
> checking but it seems it's never used by those functions (see 0 in
> sz_max of of_property_read_variable_u*_array)).
> 
> sz_max is used by of_property_read_variable_u*_array to copy at a
> maximum of sz_max values in the output buffer. If sz_max is 0, it takes
> sz_min so it's an array of definite size.
> So since sz_max is 0 for all calls to of_property_read_variable_u*_array
> by of_property_read_u*_array, we basically know we'll get a buffer of
> sz_min values but we don't actually make use of the higher bound
> checking of of_find_property_value_of_size.
> 

This was the original behaviour of the of_property_read_u*_array functions.
If you look back at the of_property_read_u*_array implementations
before my patch they passed max=0 to of_find_property_value_of_size.

To avoid duplicating code I reimplemented the of_property_read_u*_array
to use the new of_property_read_variable_u*_array hence they pass
sz_max=0 to preserve the original behaviour that max=0 to
of_find_property_value_of_size, so that I didn't break any code that might
depend on that.

> We could enforce this higher bound check by, instead of setting sz_max
> to 0, setting sz_max to sz_min in calls to of_property_read_u*_array.
> 
> But I guess there is a reason for sz_max being 0. Rob, Richard (commit
> signer of this code) do you know why? Could you explain?

> 
>> Anyway, this change still removes some bounds checking. Are they
>> important? Do they need to be added back?
>>
> 
> The edge-slowdown and the vddmac values are compared against a const
> array so we´re fine with those ones.
> 
> For the led-X-mode, I added a constant for supported modes that gets
> checked when retrieving the DT property. So we´re fine here too.
> 
> Quentin
> 

^ permalink raw reply

* Re: [PATCH net 0/3] bnxt_en: Bug fixes.
From: David Miller @ 2018-09-04  5:01 UTC (permalink / raw)
  To: michael.chan; +Cc: netdev
In-Reply-To: <1535962999-10013-1-git-send-email-michael.chan@broadcom.com>

From: Michael Chan <michael.chan@broadcom.com>
Date: Mon,  3 Sep 2018 04:23:16 -0400

> This short series fixes resource related logic in the driver, mostly
> affecting the RDMA driver under corner cases.

Series applied, thanks Michael.

Do you want patch #3 queued up for -stable?

^ permalink raw reply

* [PATCH RFC net-next] net: Poptrie based routing table lookup
From: Md. Islam @ 2018-09-04  5:02 UTC (permalink / raw)
  To: Netdev, David Miller, David Ahern, Alexey Kuznetsov,
	alexei.starovoitov, Jesper Dangaard Brouer, Stephen Hemminger,
	makita.toshiaki, panda, yasuhiro.ohara, Eric Dumazet,
	john fastabend

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

This patch implements Poptrie based routing table
lookup/insert/delete/flush. Currently many carrier routers use kernel
bypass frameworks such as DPDK and VPP to implement the data plane.
XDP along with this patch will enable Linux to work as such a router.
Currently it supports up to 255 ports. Many real word backbone routers
have up to 233 ports (to the best of my knowledge), so it seems to be
sufficient at this moment.

I also have attached a draft paper to explain it works (poptrie.pdf).
Please set CONFIG_FIB_POPTRIE=y (default n) before testing the patch.
Note that, poptrie_lookup() is not being called from anywhere. It will
be used by XDP forwarding.


>From 3dc9683298ed896dd3080733503c35d68f05370e Mon Sep 17 00:00:00 2001
From: tamimcse <tamim@csebuet.org>
Date: Mon, 3 Sep 2018 23:56:43 -0400
Subject: [PATCH] Poptrie based routing table lookup

Signed-off-by: tamimcse <tamim@csebuet.org>
---
 include/net/ip_fib.h   |  42 +++++
 net/ipv4/Kconfig       |   4 +
 net/ipv4/Makefile      |   1 +
 net/ipv4/fib_poptrie.c | 483 +++++++++++++++++++++++++++++++++++++++++++++++++
 net/ipv4/fib_trie.c    |  12 ++
 5 files changed, 542 insertions(+)
 create mode 100644 net/ipv4/fib_poptrie.c

diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index 81d0f21..76be548 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -197,6 +197,45 @@ struct fib_entry_notifier_info {
     u32 tb_id;
 };

+#if IS_ENABLED(CONFIG_FIB_POPTRIE)
+/*
+ * The router can have upto 255 ports. This limitation
+ * allows us to represent fib_index as u8
+ */
+#define NEXT_HOP_MAX 255
+
+struct next_hops {
+    struct net_device    *netdev_arr[NEXT_HOP_MAX];
+    /*Total number of next-hops*/
+    u8 count;
+};
+
+struct poptrie_node {
+    u64 vector;
+    u64 leafvec;
+    u64 nodevec;
+    struct poptrie_node *child_nodes;
+    u8 *leaves;
+    u8 *prefixes;
+    struct rcu_head        rcu;
+};
+
+struct poptrie {
+    char    def_nh;
+    struct next_hops    nhs;
+    struct poptrie_node __rcu *root;
+    spinlock_t            lock;
+};
+
+int poptrie_insert(struct poptrie *pt, u32 key,
+        u8 prefix_len, struct net_device *dev);
+int poptrie_delete(struct poptrie *pt, u32 key,
+        u8 prefix_len);
+int poptrie_flush(struct poptrie *pt);
+int poptrie_lookup(struct poptrie *pt, __be32 dest,
+        struct net_device **dev);
+#endif
+
 struct fib_nh_notifier_info {
     struct fib_notifier_info info; /* must be first */
     struct fib_nh *fib_nh;
@@ -219,6 +258,9 @@ struct fib_table {
     int            tb_num_default;
     struct rcu_head        rcu;
     unsigned long         *tb_data;
+#if IS_ENABLED(CONFIG_FIB_POPTRIE)
+    struct poptrie    pt;
+#endif
     unsigned long        __data[0];
 };

diff --git a/net/ipv4/Kconfig b/net/ipv4/Kconfig
index 80dad30..75e9c9a 100644
--- a/net/ipv4/Kconfig
+++ b/net/ipv4/Kconfig
@@ -52,6 +52,10 @@ config IP_ADVANCED_ROUTER

       If unsure, say N here.

+config FIB_POPTRIE
+    bool
+    default n
+
 config IP_FIB_TRIE_STATS
     bool "FIB TRIE statistics"
     depends on IP_ADVANCED_ROUTER
diff --git a/net/ipv4/Makefile b/net/ipv4/Makefile
index b379520..fae4bd4 100644
--- a/net/ipv4/Makefile
+++ b/net/ipv4/Makefile
@@ -62,6 +62,7 @@ obj-$(CONFIG_TCP_CONG_LP) += tcp_lp.o
 obj-$(CONFIG_TCP_CONG_YEAH) += tcp_yeah.o
 obj-$(CONFIG_TCP_CONG_ILLINOIS) += tcp_illinois.o
 obj-$(CONFIG_NETLABEL) += cipso_ipv4.o
+obj-$(CONFIG_FIB_POPTRIE) += fib_poptrie.o

 obj-$(CONFIG_XFRM) += xfrm4_policy.o xfrm4_state.o xfrm4_input.o \
               xfrm4_output.o xfrm4_protocol.o
diff --git a/net/ipv4/fib_poptrie.c b/net/ipv4/fib_poptrie.c
new file mode 100644
index 0000000..3f231e7
--- /dev/null
+++ b/net/ipv4/fib_poptrie.c
@@ -0,0 +1,483 @@
+// SPDX-License-Identifier: GPL-2.0
+/*This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version
+ *   2 of the License, or (at your option) any later version.
+ *
+ * Author: MD Iftakharul Islam (Tamim) <mislam4@kent.edu>.
+ *
+ * Asai, Hirochika, and Yasuhiro Ohara. "Poptrie: A compressed trie
+ * with population count for fast and scalable software IP routing
+ * table lookup." ACM SIGCOMM Computer Communication Review. 2015.
+ *
+ */
+
+#include <net/ip_fib.h>
+
+/*Get next-hop index from next-hop*/
+static u8 get_fib_index(struct next_hops *nhs, struct net_device *dev)
+{
+    u8 i;
+
+    for (i = 0; i < nhs->count; i++) {
+        if (nhs->netdev_arr[i] == dev)
+            return i;
+    }
+    nhs->netdev_arr[nhs->count++] = dev;
+    return nhs->count - 1;
+}
+
+/*Extracts 6 bytes from key starting from offset*/
+static u32 extract(u32 key, int offset)
+{
+    if (likely(offset < 26))
+        return (key >> (26 - offset)) & 63;
+    else
+        return (key << 4) & 63;
+}
+
+/*Set FIB index and prefix length to a leaf*/
+static void set_fib_index(struct poptrie_node *node,
+              unsigned long leaf_index,
+              char fib_index, char prefix_len)
+{
+    node->leaves[leaf_index] = fib_index;
+    node->prefixes[leaf_index] = prefix_len;
+}
+
+/*Insert a leaf at index*/
+static bool insert_leaf(struct poptrie_node *node,
+            char index, char fib_index,
+            char prefix_len)
+{
+    int i, j;
+    char *leaves;
+    char *prefixes;
+    int size = (int)hweight64(node->leafvec);
+
+    if (index > size) {
+        pr_err("Index needs to be smaller or equal to size");
+        return false;
+    }
+
+    leaves = kcalloc(size + 1, sizeof(*leaves), GFP_ATOMIC);
+    prefixes = kcalloc(size + 1, sizeof(*prefixes), GFP_ATOMIC);
+
+    for (i = 0, j = 0; i < (size + 1); i++) {
+        if (i == index) {
+            leaves[i] = fib_index;
+            prefixes[i] = prefix_len;
+        } else {
+            leaves[i] = node->leaves[j];
+            prefixes[i] = node->prefixes[j];
+            j++;
+        }
+    }
+
+    kfree(node->leaves);
+    kfree(node->prefixes);
+    node->leaves = leaves;
+    node->prefixes = prefixes;
+    return true;
+}
+
+/*Insert a new node at index*/
+static void insert_chield_node(struct poptrie_node *node,
+                   char index)
+{
+    int i, j;
+    struct poptrie_node *arr;
+    int arr_size  = (int)hweight64(node->nodevec);
+
+    arr = kcalloc(arr_size + 1, sizeof(*arr), GFP_ATOMIC);
+    for (i = 0, j = 0; i < (arr_size + 1); i++) {
+        if (i != index && j < arr_size)
+            arr[i] = node->child_nodes[j++];
+    }
+
+    kfree(node->child_nodes);
+    node->child_nodes = arr;
+}
+
+/*Delete a leaf at index*/
+static bool delete_leaf(struct poptrie_node *node,
+            char index)
+{
+    int i, j;
+    char *leaves;
+    char *prefixes;
+    int size = (int)hweight64(node->leafvec);
+
+    if (index >= size) {
+        pr_err("Index needs to be smaller or equal to size");
+        return false;
+    }
+
+    leaves = kcalloc(size - 1, sizeof(*leaves), GFP_ATOMIC);
+    prefixes = kcalloc(size - 1, sizeof(*prefixes), GFP_ATOMIC);
+
+    for (i = 0, j = 0; i < size; i++) {
+        if (i != index) {
+            leaves[j] = node->leaves[i];
+            prefixes[j] = node->prefixes[i];
+            j++;
+        }
+    }
+
+    kfree(node->leaves);
+    kfree(node->prefixes);
+    node->leaves = leaves;
+    node->prefixes = prefixes;
+    return true;
+}
+
+int poptrie_insert(struct poptrie *pt, u32 key,
+           u8 prefix_len, struct net_device *dev)
+{
+    int offset, i;
+    u32 index;
+    u8 consecutive_leafs;
+    u64 bitmap;
+    u64 bitmap_hp;
+    int arr_size;
+    unsigned long chield_index;
+    unsigned long leaf_index, prev_leaf_index;
+    unsigned long index_hp;
+    struct poptrie_node *node;
+    u8 prev_fib_index, prev_prefix_len;
+    u8 fib_index = get_fib_index(&pt->nhs, dev);
+
+    spin_lock(&pt->lock);
+
+    node = rcu_dereference(pt->root);
+    if (!node) {
+        node = kzalloc(sizeof(*node), GFP_ATOMIC);
+        rcu_assign_pointer(pt->root, node);
+    }
+
+    /* Default route */
+    if (prefix_len == 0) {
+        pt->def_nh = fib_index;
+        goto finish;
+    }
+
+    /*Iterate through the nodes*/
+    offset = 0;
+    while (prefix_len > (offset + 6)) {
+        index = extract(key, offset);
+        bitmap = 1ULL << index;
+        chield_index = hweight64(node->nodevec & (bitmap - 1));
+
+        /*No node for this index, so need to insert a node*/
+        if (!(node->nodevec & bitmap)) {
+            insert_chield_node(node, chield_index);
+            node->nodevec |= bitmap;
+        }
+        node = &node->child_nodes[chield_index];
+        offset += 6;
+    }
+
+    /*Now need to insert a leaf*/
+
+    index = extract(key, offset);
+    bitmap = 1ULL << index;
+    consecutive_leafs = 1 << (offset + 6 - prefix_len);
+
+    if (node->vector & bitmap && node->leafvec & bitmap) {
+        /*A leaf already exist for this index,
+         *so update the existing leaf
+         */
+        leaf_index = hweight64(node->leafvec & (bitmap - 1));
+        arr_size = (int)hweight64(node->leafvec);
+        if (leaf_index >= arr_size)
+            goto error;
+        /*Ignore the prefix*/
+        if (node->prefixes[leaf_index] > prefix_len) {
+            goto finish;
+        } else if (node->prefixes[leaf_index] == prefix_len) {
+            set_fib_index(node, leaf_index, fib_index, prefix_len);
+        } else {
+            /*hole punching*/
+            bitmap_hp = bitmap << consecutive_leafs;
+            if (!(node->leafvec & bitmap_hp)) {
+                index_hp = hweight64(node->leafvec &
+                             (bitmap_hp - 1)) - 1;
+                if (node->prefixes[index_hp] <= prefix_len) {
+                    insert_leaf(node, index_hp,
+                            fib_index, prefix_len);
+                    node->leafvec |= bitmap_hp;
+                }
+
+                for (i = leaf_index; i < index_hp ; i++) {
+                    if (node->prefixes[i] <= prefix_len)
+                        set_fib_index(node, i, fib_index, prefix_len);
+                }
+            } else {
+                index_hp = hweight64(node->leafvec &
+                             (bitmap_hp - 1)) - 1;
+                for (i = leaf_index; i <= index_hp ; i++) {
+                    if (node->prefixes[i] <= prefix_len)
+                        set_fib_index(node, i, fib_index, prefix_len);
+                }
+            }
+        }
+    } else if (!(node->vector & bitmap)) {
+        /*No leaf for this index, so need to insert a leaf*/
+        leaf_index = hweight64(node->leafvec & (bitmap - 1));
+        insert_leaf(node, leaf_index, fib_index, prefix_len);
+        node->leafvec |= bitmap;
+    } else if (node->vector & bitmap && !(node->leafvec & bitmap)) {
+        /*There is a leaf for this index created by another
+         *  prefix with smaller length
+         */
+        prev_leaf_index = hweight64(node->leafvec & (bitmap - 1)) - 1;
+        arr_size = (int)hweight64(node->leafvec);
+        if (prev_leaf_index >= arr_size)
+            goto error;
+        if (node->prefixes[prev_leaf_index] <= prefix_len) {
+            insert_leaf(node, prev_leaf_index + 1,
+                    fib_index, prefix_len);
+            node->leafvec |= bitmap;
+        }
+
+        /*hole punching*/
+        prev_fib_index = node->leaves[prev_leaf_index];
+        prev_prefix_len = node->prefixes[prev_leaf_index];
+
+        bitmap_hp = bitmap << consecutive_leafs;
+        if (!(node->leafvec & bitmap_hp)) {
+            index_hp = hweight64(node->leafvec &
+                         (bitmap_hp - 1)) - 1;
+            if (node->prefixes[index_hp] <= prefix_len) {
+                if (prev_leaf_index < 0)
+                    goto error;
+                insert_leaf(node, index_hp + 1,
+                        prev_fib_index, prev_prefix_len);
+                node->leafvec |= bitmap_hp;
+            }
+        }
+
+        for (i = 2; i < consecutive_leafs; i++) {
+            bitmap_hp = bitmap << (i - 1);
+            if (node->leafvec & bitmap_hp) {
+                index_hp = hweight64(node->leafvec &
+                             (bitmap_hp - 1)) - 1;
+                insert_leaf(node, index_hp + 1,
+                        fib_index, prefix_len);
+                node->leafvec |= bitmap_hp;
+            }
+        }
+    }
+
+    if (consecutive_leafs > 1)
+        node->vector |= ((1ULL << consecutive_leafs) - 1) << index;
+    else
+        node->vector |= bitmap;
+
+    goto finish;
+
+error:
+    pr_err("Something is very wrong !!!!");
+finish:
+    spin_unlock(&pt->lock);
+    return 0;
+}
+
+int poptrie_delete(struct poptrie *pt, u32 key,
+           u8 prefix_len)
+{
+    int offset, i;
+    u32 index;
+    u8 consecutive_leafs;
+    u64 bitmap;
+    int arr_size;
+    unsigned long chield_index;
+    unsigned long leaf_index;
+    struct poptrie_node *node;
+    bool update_vector = true;
+
+    spin_lock(&pt->lock);
+
+    node = rcu_dereference(pt->root);
+
+    if (!node || prefix_len == 0)
+        goto finish;
+
+    /*Iterate through the nodes*/
+    offset = 0;
+    while (prefix_len > (offset + 6)) {
+        index = extract(key, offset);
+        bitmap = 1ULL << index;
+        chield_index = hweight64(node->nodevec & (bitmap - 1));
+        /*No node for this index*/
+        if (!(node->nodevec & bitmap))
+            goto finish;
+        node = &node->child_nodes[chield_index];
+        offset += 6;
+    }
+
+    /*Now need to delete the leaf*/
+
+    index = extract(key, offset);
+    bitmap = 1ULL << index;
+    consecutive_leafs = 1 << (offset + 6 - prefix_len);
+
+    /*The prefix does not exist*/
+    if (!(node->vector & bitmap) || !(node->leafvec & bitmap))
+        goto finish;
+
+    leaf_index = hweight64(node->leafvec & (bitmap - 1));
+    arr_size = (int)hweight64(node->leafvec);
+    if (leaf_index >= arr_size)
+        goto error;
+
+    /*The prefix-length does not match*/
+    if (node->prefixes[leaf_index] != prefix_len)
+        goto finish;
+
+    /*Check if this prefix will replaced
+     * by another prefix with smaller length
+     */
+    for (i = leaf_index - 1; i >= 0; i--) {
+        if (node->prefixes[leaf_index] < prefix_len) {
+            update_vector = false;
+            break;
+        }
+    }
+
+    if (update_vector) {
+        if (consecutive_leafs > 1)
+            node->vector &=
+                 ~(((1ULL << consecutive_leafs) - 1) << index);
+        else
+            node->vector &= ~bitmap;
+    }
+
+    if (consecutive_leafs > 1) {
+        for (i = 0; i < consecutive_leafs; i++) {
+            if ((node->leafvec & bitmap) &&
+                node->prefixes[leaf_index] == prefix_len) {
+                delete_leaf(node, leaf_index);
+                node->leafvec &= ~bitmap;
+            }
+            bitmap <<= 1;
+            leaf_index = hweight64(node->leafvec & (bitmap - 1));
+        }
+    } else {
+        delete_leaf(node, leaf_index);
+        node->leafvec &= ~bitmap;
+    }
+
+    goto finish;
+error:
+    pr_err("Something is very wrong !!!!");
+finish:
+    spin_unlock(&pt->lock);
+    return 0;
+}
+
+/*This recursive function frees all
+ * the nodes in depth-first-search fashion
+ */
+static int poptrie_node_free(struct poptrie_node *node)
+{
+    int i;
+    int child_count;
+
+    if (!node)
+        return 0;
+    child_count = hweight64(node->nodevec);
+    if (node->child_nodes) {
+        for (i = 0; i < child_count; i++)
+            poptrie_node_free(&node->child_nodes[i]);
+    }
+
+    kfree(node->leaves);
+    kfree(node->prefixes);
+    kfree(node->child_nodes);
+
+    node->leaves = NULL;
+    node->prefixes = NULL;
+    node->child_nodes = NULL;
+
+    node->vector = 0;
+    node->leafvec = 0;
+    node->nodevec = 0;
+
+    return 0;
+}
+
+static void poptrie_rcu_free(struct rcu_head *rcu)
+{
+    poptrie_node_free(container_of(rcu, struct poptrie_node, rcu));
+}
+
+int poptrie_flush(struct poptrie *pt)
+{
+    struct poptrie_node *rt = rcu_dereference(pt->root);
+
+    if (!rt)
+        return 0;
+
+    RCU_INIT_POINTER(pt->root, NULL);
+    /* Wait for all references to be released */
+    call_rcu(&rt->rcu, poptrie_rcu_free);
+    return 0;
+}
+
+int poptrie_lookup(struct poptrie *pt, __be32 dest, struct net_device **dev)
+{
+    register u32 index;
+    register u64 bitmap, bitmask;
+    register unsigned long leaf_index;
+    register unsigned long node_index;
+    register struct poptrie_node *node;
+    register u8 fib_index = pt->def_nh;
+    register u8 carry = 0;
+    register u8 carry_bit = 2;
+
+    rcu_read_lock();
+
+    node = rcu_dereference(pt->root);
+
+    if (!node)
+        goto finish;
+
+    while (1) {
+        /*Extract 6 bytes from dest */
+        if (likely(carry_bit != 8)) {
+            index = ((dest & 252) >> carry_bit) | carry;
+            carry = (dest & ((1 << carry_bit) - 1))
+                    << (6 - carry_bit);
+            carry_bit = carry_bit + 2;
+            dest = dest >> 8;
+        } else {
+            index = carry;
+            carry = 0;
+            carry_bit = 2;
+        }
+
+        /*Create a bitmap based on the the extracted value*/
+        bitmap = 1ULL << index;
+        bitmask = bitmap - 1;
+
+        /*Find corresponding leaf*/
+        if (likely(node->vector & bitmap)) {
+            leaf_index = hweight64(node->leafvec & bitmask);
+            if (!(node->leafvec & bitmap))
+                leaf_index--;
+            fib_index = node->leaves[leaf_index];
+        }
+
+        /*Find corresponding node*/
+        if (likely(node->nodevec & bitmap)) {
+            node_index = hweight64(node->nodevec & bitmask);
+            node = &node->child_nodes[node_index];
+            continue;
+        }
+finish:
+        *dev = pt->nhs.netdev_arr[fib_index];
+        rcu_read_unlock();
+        return 0;
+    }
+}
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index 3dcffd3..a34998c 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -1280,6 +1280,10 @@ int fib_table_insert(struct net *net, struct
fib_table *tb,
     if (err)
         goto out_fib_notif;

+#if IS_ENABLED(CONFIG_FIB_POPTRIE)
+    poptrie_insert(&tb->pt, key, plen, fi->fib_dev);
+#endif
+
     if (!plen)
         tb->tb_num_default++;

@@ -1564,6 +1568,10 @@ int fib_table_delete(struct net *net, struct
fib_table *tb,

     pr_debug("Deleting %08x/%d tos=%d t=%p\n", key, plen, tos, t);

+#if IS_ENABLED(CONFIG_FIB_POPTRIE)
+    poptrie_delete(&tb->pt, key, plen);
+#endif
+
     fa_to_delete = NULL;
     hlist_for_each_entry_from(fa, fa_list) {
         struct fib_info *fi = fa->fa_info;
@@ -1925,6 +1933,10 @@ int fib_table_flush(struct net *net, struct
fib_table *tb)
         }
     }

+#if IS_ENABLED(CONFIG_FIB_POPTRIE)
+    poptrie_flush(&tb->pt);
+#endif
+
     pr_debug("trie_flush found=%d\n", found);
     return found;
 }
-- 
2.7.4

[-- Attachment #2: poptrie.pdf --]
[-- Type: application/pdf, Size: 208517 bytes --]

^ permalink raw reply related

* Re: [PATCH net-next 1/2] tipc: correct spelling errors for struct tipc_bc_base's comment
From: David Miller @ 2018-09-04  5:03 UTC (permalink / raw)
  To: zhenbo.gao; +Cc: jon.maloy, tipc-discussion, netdev, ying.xue, yue.tao
In-Reply-To: <1535963806-27142-1-git-send-email-zhenbo.gao@windriver.com>

From: Zhenbo Gao <zhenbo.gao@windriver.com>
Date: Mon, 3 Sep 2018 16:36:45 +0800

> Trivial fix for two spelling mistakes.
> 
> Signed-off-by: Zhenbo Gao <zhenbo.gao@windriver.com>
> Reviewed-by: Ying Xue <ying.xue@windriver.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next 2/2] tipc: correct spelling errors for tipc_topsrv_queue_evt() comments
From: David Miller @ 2018-09-04  5:03 UTC (permalink / raw)
  To: zhenbo.gao; +Cc: jon.maloy, tipc-discussion, netdev, ying.xue, yue.tao
In-Reply-To: <1535963806-27142-2-git-send-email-zhenbo.gao@windriver.com>

From: Zhenbo Gao <zhenbo.gao@windriver.com>
Date: Mon, 3 Sep 2018 16:36:46 +0800

> tipc_conn_queue_evt -> tipc_topsrv_queue_evt
> tipc_send_work -> tipc_conn_send_work
> tipc_send_to_sock -> tipc_conn_send_to_sock
> 
> Signed-off-by: Zhenbo Gao <zhenbo.gao@windriver.com>
> Reviewed-by: Ying Xue <ying.xue@windriver.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next] cxgb4: when max_tx_rate is 0 disable tx rate limiting
From: David Miller @ 2018-09-04  5:10 UTC (permalink / raw)
  To: ganeshgr; +Cc: netdev, nirranjan, indranil, dt, leedom
In-Reply-To: <1535971906-31762-1-git-send-email-ganeshgr@chelsio.com>

From: Ganesh Goudar <ganeshgr@chelsio.com>
Date: Mon,  3 Sep 2018 16:21:46 +0530

> in ndo_set_vf_rate() when max_tx_rate is 0 disable tx
> rate limiting for that vf.
> 
> Signed-off-by: Casey Leedom <leedom@chelsio.com>
> Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH net-next v2] cxgb4: collect hardware queue descriptors
From: David Miller @ 2018-09-04  5:10 UTC (permalink / raw)
  To: rahul.lakkireddy; +Cc: netdev, ganeshgr, nirranjan, indranil
In-Reply-To: <1535976689-21710-1-git-send-email-rahul.lakkireddy@chelsio.com>

From: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Date: Mon,  3 Sep 2018 17:41:29 +0530

> Collect descriptors of all ULD and LLD hardware queues managed
> by LLD.
> 
> Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
> Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
> ---
> v2:
> - Move inline functions to header file.
> - Add missing undefine for QDESC_GET_* macros.

Applied.

^ permalink raw reply

* Re: pull-request: mac80211 2018-09-03
From: David Miller @ 2018-09-04  5:12 UTC (permalink / raw)
  To: johannes; +Cc: netdev, linux-wireless
In-Reply-To: <20180903121546.27673-1-johannes@sipsolutions.net>

From: Johannes Berg <johannes@sipsolutions.net>
Date: Mon,  3 Sep 2018 14:15:45 +0200

> This time around for mac80211 I have a larger than usual number of
> fixes, in part because Luca dumped our (Intel's) patches out after
> quite a while - we'll try to make sure this doesn't happen again.
> 
> Shortlog below, as usual, each fix is pretty self-contained but it
> adds up to quite a bit overall.
> 
> Please pull and let me know if there's any problem.

Ok pulled, I'll try to get this merged into net-next in the next day
or two.

Thanks.

^ permalink raw reply

* Re: [PATCH v3 0/6] Ethernet over hdlc
From: David Miller @ 2018-09-04  5:14 UTC (permalink / raw)
  To: david.gounaris; +Cc: qiang.zhao, netdev, linuxppc-dev, joakim.tjernlund
In-Reply-To: <20180903124730.1551-1-david.gounaris@infinera.com>

From: David Gounaris <david.gounaris@infinera.com>
Date: Mon,  3 Sep 2018 14:47:24 +0200

> Here is what has been changed in v3 after the review comments from v2.
> 
> v3-0001: corrected style problems
> v3-0002: corrected style problems
> v3-0003: corrected style problems
> v3-0004: corrected style problems
> v3-0005: corrected style problems
> v3-0006: corrected style problems
> 
> Sorry for that, I did not know about scripts/checkpatch.pl.

Series applied to net-next.

^ permalink raw reply

* Why not use all the syn queues? in the function "tcp_conn_request", I have some questions.
From: Ttttabcd @ 2018-09-04  5:31 UTC (permalink / raw)
  To: netdev@vger.kernel.org

Hello everyone,recently I am looking at the source code for handling TCP three-way handshake(Linux Kernel version 4.18.5).

I found some strange places in the source code for handling syn messages.

in the function "tcp_conn_request"

This code will be executed when we don't enable the syn cookies.

		if (!net->ipv4.sysctl_tcp_syncookies &&
		    (net->ipv4.sysctl_max_syn_backlog - inet_csk_reqsk_queue_len(sk) <
		     (net->ipv4.sysctl_max_syn_backlog >> 2)) &&
		    !tcp_peer_is_proven(req, dst)) {
			/* Without syncookies last quarter of
			 * backlog is filled with destinations,
			 * proven to be alive.
			 * It means that we continue to communicate
			 * to destinations, already remembered
			 * to the moment of synflood.
			 */
			pr_drop_req(req, ntohs(tcp_hdr(skb)->source),
				    rsk_ops->family);
			goto drop_and_release;
		}

But why don't we use all the syn queues?

Why do we need to leave the size of (net->ipv4.sysctl_max_syn_backlog >> 2) in the queue?

Even if the system is attacked by a syn flood, there is no need to leave a part. Why do we need to leave a part?

The value of sysctl_max_syn_backlog is the maximum length of the queue only if syn cookies are enabled.


This is the first strange place, here is another strange place

	__u32 isn = TCP_SKB_CB(skb)->tcp_tw_isn;

	if ((net->ipv4.sysctl_tcp_syncookies == 2 ||
	     inet_csk_reqsk_queue_is_full(sk)) && !isn) {

	if (!want_cookie && !isn) {

The value of "isn" comes from TCP_SKB_CB(skb)->tcp_tw_isn, then it is judged twice whether its value is indeed 0.

But "tcp_tw_isn" is initialized in the function "tcp_v4_fill_cb"

	TCP_SKB_CB(skb)->tcp_tw_isn = 0;

So it has always been 0, I used printk to test, and the result is always 0.

Since it is always 0, why do you need to judge twice?

This is two strange places I found.

Can anyone tell me why the code here is written like this?

^ permalink raw reply

* Re: [PATCH net 0/3] bnxt_en: Bug fixes.
From: Michael Chan @ 2018-09-04  5:50 UTC (permalink / raw)
  To: David Miller; +Cc: Netdev
In-Reply-To: <20180903.220108.1715486066701916741.davem@davemloft.net>

On Mon, Sep 3, 2018 at 10:01 PM, David Miller <davem@davemloft.net> wrote:
>
> From: Michael Chan <michael.chan@broadcom.com>
> Date: Mon,  3 Sep 2018 04:23:16 -0400
>
> > This short series fixes resource related logic in the driver, mostly
> > affecting the RDMA driver under corner cases.
>
> Series applied, thanks Michael.
>
> Do you want patch #3 queued up for -stable?

Yes, please go ahead.  Thanks.

^ permalink raw reply

* Re: [PATCH] iwlwifi: mvm:  fix spelling mistake "Recieved" -> "Received"
From: Luciano Coelho @ 2018-09-04  6:02 UTC (permalink / raw)
  To: Colin King, Johannes Berg, Emmanuel Grumbach,
	Intel Linux Wireless, Kalle Valo, David S . Miller,
	linux-wireless, netdev
  Cc: kernel-janitors, linux-kernel
In-Reply-To: <20180826223117.12892-1-colin.king@canonical.com>

On Sun, 2018-08-26 at 23:31 +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Trivial fix to spelling mistake in debug message.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
> index b15b0d84bb7e..5f32d3131d62 100644
> --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
> +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
> @@ -3320,7 +3320,7 @@ static bool iwl_mvm_rx_aux_roc(struct iwl_notif_wait_data *notif_wait,
>  	resp = (void *)pkt->data;
>  
>  	IWL_DEBUG_TE(mvm,
> -		     "Aux ROC: Recieved response from ucode: status=%d uid=%d\n",
> +		     "Aux ROC: Received response from ucode: status=%d uid=%d\n",
>  		     resp->status, resp->event_unique_id);
>  
>  	te_data->uid = le32_to_cpu(resp->event_unique_id);

Thanks! I pushed this to our internal tree and it will reach upstream
following our normal process.

^ permalink raw reply

* Re: [PATCH] [RFC v2] Drop all 00-INDEX files from Documentation/
From: Mark Brown @ 2018-09-04 10:41 UTC (permalink / raw)
  To: Henrik Austad
  Cc: Mark Rutland, linux-mips, linux-fbdev, x86, kvm, linux-doc,
	Peter Zijlstra, James Hogan, Will Deacon, dri-devel,
	Masahiro Yamada, Jan Kandziora, Paul Mackerras, Henrik Austad,
	Pavel Machek, H. Peter Anvin, Evgeniy Polyakov, linux-s390,
	Ian Kent, linux-security-module, Paul Moore, Jonathan Corbet,
	Michael Ellerman, Helge Deller, Radim Krčmář,
	James E.J. Bottomley
In-Reply-To: <1536012923-16275-1-git-send-email-henrik@austad.us>


[-- Attachment #1.1: Type: text/plain, Size: 307 bytes --]

On Tue, Sep 04, 2018 at 12:15:23AM +0200, Henrik Austad wrote:
> This is a respin with a wider audience (all that get_maintainer returned)
> and I know this spams a *lot* of people. Not sure what would be the correct
> way, so my apologies for ruining your inbox.

Acked-by: Mark Brown <broonie@kernel.org>

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply

* Re: [PATCH 01/25] tty: Change return type to void
From: Sergei Shtylyov @ 2018-09-04 10:45 UTC (permalink / raw)
  To: Jaejoong Kim, linux-um, netdev, linux-mmc, linux-s390, devel,
	greybus-dev, linuxppc-dev, linux-serial, sparclinux, linux-usb,
	linux-bluetooth, linux-kernel
  Cc: Greg Kroah-Hartman, Jiri Slaby
In-Reply-To: <1536029091-4426-2-git-send-email-climbbb.kim@gmail.com>

Hello!

On 9/4/2018 5:44 AM, Jaejoong Kim wrote:

> Many drivers with tty use the tty_stand_install(). But, there is no
> need to handle the error, since it always returns 0. So, change the
> return type of tty_standard_install() and tty_port_install() to void
> type and remove unnecessary exception handling where we use these
> functions.
> 
> Signed-off-by: Jaejoong Kim <climbbb.kim@gmail.com>
> ---
>   drivers/tty/tty_io.c   | 10 ++++++----
>   drivers/tty/tty_port.c |  4 ++--
>   include/linux/tty.h    |  4 ++--
>   3 files changed, 10 insertions(+), 8 deletions(-)
> 
[...]
> diff --git a/include/linux/tty.h b/include/linux/tty.h
> index c56e397..63cdac1 100644
> --- a/include/linux/tty.h
> +++ b/include/linux/tty.h
> @@ -556,7 +556,7 @@ extern struct tty_struct *tty_init_dev(struct tty_driver *driver, int idx);
>   extern void tty_release_struct(struct tty_struct *tty, int idx);
>   extern int tty_release(struct inode *inode, struct file *filp);
>   extern void tty_init_termios(struct tty_struct *tty);
> -extern int tty_standard_install(struct tty_driver *driver,
> +extern void tty_standard_install(struct tty_driver *driver,
>   		struct tty_struct *tty);
>   
>   extern struct mutex tty_mutex;
> @@ -688,7 +688,7 @@ extern int tty_port_close_start(struct tty_port *port,
>   extern void tty_port_close_end(struct tty_port *port, struct tty_struct *tty);
>   extern void tty_port_close(struct tty_port *port,
>   				struct tty_struct *tty, struct file *filp);
> -extern int tty_port_install(struct tty_port *port, struct tty_driver *driver,
> +extern void tty_port_install(struct tty_port *port, struct tty_driver *driver,
>   				struct tty_struct *tty);

    You need to update all the callers in the same patch -- the kernel must 
remain buildable after each patch but you seem to have spread that update 
among a lot of patches..

[...]

MBR, Sergei

^ permalink raw reply

* [PATCH v6] selftests: add headers_install to lib.mk
From: Anders Roxell @ 2018-09-04 10:47 UTC (permalink / raw)
  To: yamada.masahiro, michal.lkml, shuah, bamv2005, brgl, pbonzini,
	akpm, rppt, aarcange
  Cc: linux-kbuild, linux-kernel, linux-kselftest, netdev,
	Anders Roxell
In-Reply-To: <20180809080402.24469-1-anders.roxell@linaro.org>

If the kernel headers aren't installed we can't build all the tests.
Add a new make target rule 'khdr' in the file lib.mk to generate the
kernel headers and that gets include for every test-dir Makefile that
includes lib.mk If the testdir in turn have its own sub-dirs the
top_srcdir needs to be set to the linux-rootdir to be able to generate
the kernel headers.

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Reviewed-by: Fathi Boudra <fathi.boudra@linaro.org>
---

I sent this (v5) a month ago and wondered if it got lost. Resending
unchanged.

Cheers,
Anders

 Makefile                                           | 14 +-------------
 scripts/subarch.include                            | 13 +++++++++++++
 tools/testing/selftests/android/Makefile           |  2 +-
 tools/testing/selftests/android/ion/Makefile       |  2 ++
 tools/testing/selftests/futex/functional/Makefile  |  1 +
 tools/testing/selftests/gpio/Makefile              |  7 ++-----
 tools/testing/selftests/kvm/Makefile               |  7 ++-----
 tools/testing/selftests/lib.mk                     | 12 ++++++++++++
 tools/testing/selftests/net/Makefile               |  1 +
 .../selftests/networking/timestamping/Makefile     |  1 +
 tools/testing/selftests/vm/Makefile                |  4 ----
 11 files changed, 36 insertions(+), 28 deletions(-)
 create mode 100644 scripts/subarch.include

diff --git a/Makefile b/Makefile
index 19948e556941..9c781e77fa24 100644
--- a/Makefile
+++ b/Makefile
@@ -299,19 +299,7 @@ KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null)
 KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION)
 export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION
 
-# SUBARCH tells the usermode build what the underlying arch is.  That is set
-# first, and if a usermode build is happening, the "ARCH=um" on the command
-# line overrides the setting of ARCH below.  If a native build is happening,
-# then ARCH is assigned, getting whatever value it gets normally, and
-# SUBARCH is subsequently ignored.
-
-SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
-				  -e s/sun4u/sparc64/ \
-				  -e s/arm.*/arm/ -e s/sa110/arm/ \
-				  -e s/s390x/s390/ -e s/parisc64/parisc/ \
-				  -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
-				  -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ \
-				  -e s/riscv.*/riscv/)
+include scripts/subarch.include
 
 # Cross compiling and selecting different set of gcc/bin-utils
 # ---------------------------------------------------------------------------
diff --git a/scripts/subarch.include b/scripts/subarch.include
new file mode 100644
index 000000000000..650682821126
--- /dev/null
+++ b/scripts/subarch.include
@@ -0,0 +1,13 @@
+# SUBARCH tells the usermode build what the underlying arch is.  That is set
+# first, and if a usermode build is happening, the "ARCH=um" on the command
+# line overrides the setting of ARCH below.  If a native build is happening,
+# then ARCH is assigned, getting whatever value it gets normally, and
+# SUBARCH is subsequently ignored.
+
+SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
+				  -e s/sun4u/sparc64/ \
+				  -e s/arm.*/arm/ -e s/sa110/arm/ \
+				  -e s/s390x/s390/ -e s/parisc64/parisc/ \
+				  -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
+				  -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ \
+				  -e s/riscv.*/riscv/)
diff --git a/tools/testing/selftests/android/Makefile b/tools/testing/selftests/android/Makefile
index 72c25a3cb658..d9a725478375 100644
--- a/tools/testing/selftests/android/Makefile
+++ b/tools/testing/selftests/android/Makefile
@@ -6,7 +6,7 @@ TEST_PROGS := run.sh
 
 include ../lib.mk
 
-all:
+all: khdr
 	@for DIR in $(SUBDIRS); do		\
 		BUILD_TARGET=$(OUTPUT)/$$DIR;	\
 		mkdir $$BUILD_TARGET  -p;	\
diff --git a/tools/testing/selftests/android/ion/Makefile b/tools/testing/selftests/android/ion/Makefile
index e03695287f76..88cfe88e466f 100644
--- a/tools/testing/selftests/android/ion/Makefile
+++ b/tools/testing/selftests/android/ion/Makefile
@@ -10,6 +10,8 @@ $(TEST_GEN_FILES): ipcsocket.c ionutils.c
 
 TEST_PROGS := ion_test.sh
 
+KSFT_KHDR_INSTALL := 1
+top_srcdir = ../../../../..
 include ../../lib.mk
 
 $(OUTPUT)/ionapp_export: ionapp_export.c ipcsocket.c ionutils.c
diff --git a/tools/testing/selftests/futex/functional/Makefile b/tools/testing/selftests/futex/functional/Makefile
index ff8feca49746..ad1eeb14fda7 100644
--- a/tools/testing/selftests/futex/functional/Makefile
+++ b/tools/testing/selftests/futex/functional/Makefile
@@ -18,6 +18,7 @@ TEST_GEN_FILES := \
 
 TEST_PROGS := run.sh
 
+top_srcdir = ../../../../..
 include ../../lib.mk
 
 $(TEST_GEN_FILES): $(HEADERS)
diff --git a/tools/testing/selftests/gpio/Makefile b/tools/testing/selftests/gpio/Makefile
index 1bbb47565c55..4665cdbf1a8d 100644
--- a/tools/testing/selftests/gpio/Makefile
+++ b/tools/testing/selftests/gpio/Makefile
@@ -21,11 +21,8 @@ endef
 CFLAGS += -O2 -g -std=gnu99 -Wall -I../../../../usr/include/
 LDLIBS += -lmount -I/usr/include/libmount
 
-$(BINARIES): ../../../gpio/gpio-utils.o ../../../../usr/include/linux/gpio.h
+$(BINARIES):| khdr
+$(BINARIES): ../../../gpio/gpio-utils.o
 
 ../../../gpio/gpio-utils.o:
 	make ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C ../../../gpio
-
-../../../../usr/include/linux/gpio.h:
-	make -C ../../../.. headers_install INSTALL_HDR_PATH=$(shell pwd)/../../../../usr/
-
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index 03b0f551bedf..87d1a8488af8 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -37,9 +37,6 @@ $(LIBKVM_OBJ): $(OUTPUT)/%.o: %.c
 $(OUTPUT)/libkvm.a: $(LIBKVM_OBJ)
 	$(AR) crs $@ $^
 
-$(LINUX_HDR_PATH):
-	make -C $(top_srcdir) headers_install
-
-all: $(STATIC_LIBS) $(LINUX_HDR_PATH)
+all: $(STATIC_LIBS)
 $(TEST_GEN_PROGS): $(STATIC_LIBS)
-$(TEST_GEN_PROGS) $(LIBKVM_OBJ): | $(LINUX_HDR_PATH)
+$(STATIC_LIBS):| khdr
diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index 17ab36605a8e..0a8e75886224 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -16,8 +16,20 @@ TEST_GEN_PROGS := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS))
 TEST_GEN_PROGS_EXTENDED := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS_EXTENDED))
 TEST_GEN_FILES := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_FILES))
 
+top_srcdir ?= ../../../..
+include $(top_srcdir)/scripts/subarch.include
+ARCH		?= $(SUBARCH)
+
 all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES)
 
+.PHONY: khdr
+khdr:
+	make ARCH=$(ARCH) -C $(top_srcdir) headers_install
+
+ifdef KSFT_KHDR_INSTALL
+$(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES):| khdr
+endif
+
 .ONESHELL:
 define RUN_TEST_PRINT_RESULT
 	TEST_HDR_MSG="selftests: "`basename $$PWD`:" $$BASENAME_TEST";	\
diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile
index cccdb2295567..256d82d5fa87 100644
--- a/tools/testing/selftests/net/Makefile
+++ b/tools/testing/selftests/net/Makefile
@@ -15,6 +15,7 @@ TEST_GEN_FILES += udpgso udpgso_bench_tx udpgso_bench_rx ip_defrag
 TEST_GEN_PROGS = reuseport_bpf reuseport_bpf_cpu reuseport_bpf_numa
 TEST_GEN_PROGS += reuseport_dualstack reuseaddr_conflict tls
 
+KSFT_KHDR_INSTALL := 1
 include ../lib.mk
 
 $(OUTPUT)/reuseport_bpf_numa: LDFLAGS += -lnuma
diff --git a/tools/testing/selftests/networking/timestamping/Makefile b/tools/testing/selftests/networking/timestamping/Makefile
index a728040edbe1..14cfcf006936 100644
--- a/tools/testing/selftests/networking/timestamping/Makefile
+++ b/tools/testing/selftests/networking/timestamping/Makefile
@@ -5,6 +5,7 @@ TEST_PROGS := hwtstamp_config rxtimestamp timestamping txtimestamp
 
 all: $(TEST_PROGS)
 
+top_srcdir = ../../../../..
 include ../../lib.mk
 
 clean:
diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile
index 9881876d2aa0..e94b7b14bcb2 100644
--- a/tools/testing/selftests/vm/Makefile
+++ b/tools/testing/selftests/vm/Makefile
@@ -26,10 +26,6 @@ TEST_PROGS := run_vmtests
 
 include ../lib.mk
 
-$(OUTPUT)/userfaultfd: ../../../../usr/include/linux/kernel.h
 $(OUTPUT)/userfaultfd: LDLIBS += -lpthread
 
 $(OUTPUT)/mlock-random-test: LDLIBS += -lcap
-
-../../../../usr/include/linux/kernel.h:
-	make -C ../../../.. headers_install
-- 
2.18.0

^ permalink raw reply related


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