Re: [PATCH] net: ethernet: ravb: Fix release of refclk

2021-04-19 Thread David Miller
From: Adam Ford 
Date: Sat, 17 Apr 2021 08:23:29 -0500

> The call to clk_disable_unprepare() can happen before priv is
> initialized. This means moving clk_disable_unprepare out of
> out_release into a new label.
> 
> Fixes: 8ef7adc6beb2("net: ethernet: ravb: Enable optional refclk")
> Signed-off-by: Adam Ford 
Thjis does not apply cleanly, please rebbase and resubmit.

Please fix the formatting of your Fixes tag while you are at it, thank you.


Re: [PATCH][next] sctp: Fix out-of-bounds warning in sctp_process_asconf_param()

2021-04-19 Thread David Miller
From: "Gustavo A. R. Silva" 
Date: Fri, 16 Apr 2021 19:07:05 -0500

> Dave,
> 
> On 4/16/21 19:00, patchwork-bot+netdev...@kernel.org wrote:
>> Hello:
>> 
>> This patch was applied to netdev/net-next.git (refs/heads/master):
>> 
>> On Fri, 16 Apr 2021 14:12:36 -0500 you wrote:
>>> Fix the following out-of-bounds warning:
>>>
>>> net/sctp/sm_make_chunk.c:3150:4: warning: 'memcpy' offset [17, 28] from the 
>>> object at 'addr' is out of the bounds of referenced subobject 'v4' with 
>>> type 'struct sockaddr_in' at offset 0 [-Warray-bounds]
>>>
>>> This helps with the ongoing efforts to globally enable -Warray-bounds
>>> and get us closer to being able to tighten the FORTIFY_SOURCE routines
>>> on memcpy().
>>>
>>> [...]
>> 
>> Here is the summary with links:
>>   - [next] sctp: Fix out-of-bounds warning in sctp_process_asconf_param()
>> https://git.kernel.org/netdev/net-next/c/e5272ad4aab3
> 
> Thanks for this. Can you take these other two, as well, please?
> 
> https://lore.kernel.org/linux-hardening/20210416201540.GA593906@embeddedor/
> https://lore.kernel.org/linux-hardening/20210416193151.GA591935@embeddedor/
> 

Done.


Re: [PATCH v2 net-next 0/9] net: Korina improvements

2021-04-14 Thread David Miller
From: Thomas Bogendoerfer 
Date: Wed, 14 Apr 2021 17:29:36 +0200

> While converting Mikrotik RB532 support to use device tree I stumbled
> over the korina ethernet driver, which used way too many MIPS specific
> hacks. This series cleans this all up and adds support for device tree.
> 
> Changes in v2:
>   - added device tree support to get rid of idt_cpu_freq
>   - fixed compile test on 64bit archs
>   - fixed descriptor current address handling by storing/using mapped
> dma addresses (dma controller modifies current address)

The last patch causes compile failures.  Incorrect number of
arguments to of_get_mac_address(), please fix this and resubmit,
thanks.


Re: [PATCH net-next 6/7] net: stmmac: Enable RX via AF_XDP zero-copy

2021-04-12 Thread David Miller
+   /* synchronize_rcu() needed for pending XDP buffers to drain */
+   for (queue = 0; queue < rx_queues_cnt; queue++) {
+   rx_q = >rx_queue[queue];
+   if (rx_q->xsk_pool) {
+   synchronize_rcu();

Are you sure this is safe here, especially via the ->ndo_setup_tc() code path?

Thank you.


Re: [PATCH v3 net-next] net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)

2021-04-08 Thread David Miller
From: Dexuan Cui 
Date: Fri, 9 Apr 2021 00:24:51 +

>> From: David Miller 
>> Sent: Thursday, April 8, 2021 4:46 PM
>> ...
>> > +struct gdma_msg_hdr {
>> > +  u32 hdr_type;
>> > +  u32 msg_type;
>> > +  u16 msg_version;
>> > +  u16 hwc_msg_id;
>> > +  u32 msg_size;
>> > +} __packed;
>> > +
>> > +struct gdma_dev_id {
>> > +  union {
>> > +  struct {
>> > +  u16 type;
>> > +  u16 instance;
>> > +  };
>> > +
>> > +  u32 as_uint32;
>> > +  };
>> > +} __packed;
>> 
>> Please don't  use __packed unless absolutely necessary.  It generates
>> suboptimal code (byte at a time
>> accesses etc.) and for many of these you don't even need it.
> 
> In the driver code, all the structs/unions marked by __packed are used to
> talk with the hardware, so I think __packed is necessary here?

It actually isan't in many cases, check with and without the __packed directive
and see if anything chasnges.

> Do you think if it's better if we remove all the __packed, and add
> static_assert(sizeof(struct XXX) == YYY) instead? e.g.
> 
> @@ -105,7 +105,8 @@ struct gdma_msg_hdr {
> u16 msg_version;
> u16 hwc_msg_id;
> u32 msg_size;
> -} __packed;
> +};
> +static_assert(sizeof(struct gdma_msg_hdr) == 16);

This won't make sure the structure member offsets are what you expect.

I think you'll have to go through the structures one-by-one by hand to
figure out which ones really require the __packed attribute and which do not.

Thank you.


Re: [PATCH v3 net-next] net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)

2021-04-08 Thread David Miller
From: Dexuan Cui 
Date: Thu,  8 Apr 2021 15:58:40 -0700

> +struct gdma_msg_hdr {
> + u32 hdr_type;
> + u32 msg_type;
> + u16 msg_version;
> + u16 hwc_msg_id;
> + u32 msg_size;
> +} __packed;
> +
> +struct gdma_dev_id {
> + union {
> + struct {
> + u16 type;
> + u16 instance;
> + };
> +
> + u32 as_uint32;
> + };
> +} __packed;

Please don't  use __packed unless absolutely necessary.  It generates 
suboptimal code (byte at a time
accesses etc.) and for many of these you don't even need it.

Thank you.


Re: [PATCH] bnx2x: Fix potential infinite loop

2021-04-07 Thread David Miller
From: Colin King 
Date: Wed,  7 Apr 2021 15:28:02 +0100

> From: Colin Ian King 
> 
> The for_each_tx_queue loop iterates with a u8 loop counter i and
> compares this with the loop upper limit of bp->num_queues that
> is an int type.  There is a potential infinite loop if bp->num_queues
> is larger than the u8 loop counter. Fix this by making the loop
> counter the same type as bp->num_queues.
> 
> Addresses-Coverity: ("Infinite loop")
> Fixes: ad5afc89365e ("bnx2x: Separate VF and PF logic")
> Signed-off-by: Colin Ian King 

Please show how num_queues can take on a value larger than 255.

Thank you.


Re: [PATCH net-next] net: tipc: Fix spelling errors in net/tipc module

2021-04-06 Thread David Miller
From: Zheng Yongjun 
Date: Tue, 6 Apr 2021 23:19:09 +0800

> These patches fix a series of spelling errors in net/tipc module.
> 
> Reported-by: Hulk Robot 
> Signed-off-by: Zheng Yongjun 

This does not apply to net-next, please respin.

Thanks.


Re: [PATCH net v4] atl1c: move tx cleanup processing out of interrupt

2021-04-06 Thread David Miller
From: Gatis Peisenieks 
Date: Tue, 06 Apr 2021 17:49:32 +0300

> Tx queue cleanup happens in interrupt handler on same core as rx queue
> processing. Both can take considerable amount of processing in high
> packet-per-second scenarios.
> 
> Sending big amounts of packets can stall the rx processing which is
> unfair
> and also can lead to out-of-memory condition since __dev_kfree_skb_irq
> queues the skbs for later kfree in softirq which is not allowed to
> happen
> with heavy load in interrupt handler.
> 
> This puts tx cleanup in its own napi and enables threaded napi to
> allow
> the rx/tx queue processing to happen on different cores. Also as the
> first
> in-driver user of dev_set_threaded API, need to add EXPORT_SYMBOL for
> it.
> 
> The ability to sustain equal amounts of tx/rx traffic increased:
> from 280Kpps to 1130Kpps on Threadripper 3960X with upcoming
> Mikrotik 10/25G NIC,
> from 520Kpps to 850Kpps on Intel i3-3320 with Mikrotik RB44Ge adapter.
> 
> Signed-off-by: Gatis Peisenieks 
> ---
> changes since v3:
>   - made scripts/checkpatch.pl happy (commit message line wrap +
> missing comment on spinlock)
>   - moved the new intr_mask_lock to be besides the intr_mask it
> protects so they are more likely to be on same cacheline
> changes since v2:
>   - addressed comments from Eric Dumazet
>   - added EXPORT_SYMBOL for dev_set_threaded
> 
> Sorry for reposting, noticed that scripts/checkpatch.pl was not happy.

This does not apply to 'net',  did you mean 'net-next'?  If so, please indicate 
this clearly in
the Subject line as per convention.

Thank you.


Re: [PATCH] net: hso: fix null-ptr-deref during tty device unregistration

2021-04-06 Thread David Miller
From: Anirudh Rayabharam 
Date: Tue,  6 Apr 2021 18:13:59 +0530

> Multiple ttys try to claim the same the minor number causing a double
> unregistration of the same device. The first unregistration succeeds
> but the next one results in a null-ptr-deref.
> 
> The get_free_serial_index() function returns an available minor number
> but doesn't assign it immediately. The assignment is done by the caller
> later. But before this assignment, calls to get_free_serial_index()
> would return the same minor number.
> 
> Fix this by modifying get_free_serial_index to assign the minor number
> immediately after one is found to be and rename it to obtain_minor()
> to better reflect what it does. Similary, rename set_serial_by_index()
> to release_minor() and modify it to free up the minor number of the
> given hso_serial. Every obtain_minor() should have corresponding
> release_minor() call.
> 
> Reported-by: syzbot+c49fe6089f295a05e...@syzkaller.appspotmail.com
> Tested-by: syzbot+c49fe6089f295a05e...@syzkaller.appspotmail.com
> 
> Signed-off-by: Anirudh Rayabharam 

This adds a new build warning:

  CC [M]  drivers/net/usb/hso.o
drivers/net/usb/hso.c: In function ‘hso_serial_common_create’:
drivers/net/usb/hso.c:2256:6: warning: unused variable ‘minor’ 
[-Wunused-variable]

Please fix this and add an appropriate Fixes: tag, thank you.


Re: [PATCH net-next v5] net: x25: Queue received packets in the drivers instead of per-CPU queues

2021-04-06 Thread David Miller
From: Xie He 
Date: Fri,  2 Apr 2021 02:30:00 -0700

> X.25 Layer 3 (the Packet Layer) expects layer 2 to provide a reliable
> datalink service such that no packets are reordered or dropped. And
> X.25 Layer 2 (the LAPB layer) is indeed designed to provide such service.
> 
> However, this reliability is not preserved when a driver calls "netif_rx"
> to deliver the received packets to layer 3, because "netif_rx" will put
> the packets into per-CPU queues before they are delivered to layer 3.
> If there are multiple CPUs, the order of the packets may not be preserved.
> The per-CPU queues may also drop packets if there are too many.
> 
> Therefore, we should not call "netif_rx" to let it queue the packets.
> Instead, we should use our own queue that won't reorder or drop packets.
> 
> This patch changes all X.25 drivers to use their own queues instead of
> calling "netif_rx". The patch also documents this requirement in the
> "x25-iface" documentation.
> 
> Cc: Martin Schiller 
> Signed-off-by: Xie He 


This no longe applies to net-next, please respin.

Thank you.


Re: [PATCH] net: tun: set tun->dev->addr_len during TUNSETLINK processing

2021-04-05 Thread David Miller
From: Phillip Potter 
Date: Mon,  5 Apr 2021 12:35:55 +0100

> When changing type with TUNSETLINK ioctl command, set tun->dev->addr_len
> to match the appropriate type, using new tun_get_addr_len utility function
> which returns appropriate address length for given type. Fixes a
> KMSAN-found uninit-value bug reported by syzbot at:
> https://syzkaller.appspot.com/bug?id=0766d38c656abeace60621896d705743aeefed51
> 
> Reported-by: syzbot+001516d86dbe88862...@syzkaller.appspotmail.com
> Signed-off-by: Phillip Potter 
> ---
>  drivers/net/tun.c | 48 +++
>  1 file changed, 48 insertions(+)
> 
> diff --git a/drivers/net/tun.c b/drivers/net/tun.c
> index 978ac0981d16..56c26339ee3b 100644
> --- a/drivers/net/tun.c
> +++ b/drivers/net/tun.c
> @@ -69,6 +69,14 @@
>  #include 
>  #include 
>  #include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
>  
>  #include 
>  #include 
> @@ -2925,6 +2933,45 @@ static int tun_set_ebpf(struct tun_struct *tun, struct 
> tun_prog __rcu **prog_p,
>   return __tun_set_ebpf(tun, prog_p, prog);
>  }
>  
> +/* Return correct value for tun->dev->addr_len based on tun->dev->type. */
> +static inline unsigned char tun_get_addr_len(unsigned short type)
> +{

Please do not use inline in foo.c files, let the compiler decide.

Thanks.


Re: [PATCH] net/rds: Fix a use after free in rds_message_map_pages

2021-03-30 Thread David Miller
From: Lv Yunlong 
Date: Tue, 30 Mar 2021 03:16:02 -0700

> @@ -348,7 +348,7 @@ struct rds_message *rds_message_map_pages(unsigned long 
> *page_addrs, unsigned in
>   rm->data.op_sg = rds_message_alloc_sgs(rm, num_sgs);
>   if (IS_ERR(rm->data.op_sg)) {
>   rds_message_put(rm);
> - return ERR_CAST(rm->data.op_sg);
> + return ERR_PTR(-ENOMEM);
>   }
>  
>   for (i = 0; i < rm->data.op_nents; ++i) {

Maybe instead do:

  int err = ERR_CAST(rm->data.op_sg);
  rds_message_put(rm);
  return err;

Then if rds_message_alloc_sgs() starts to return other errors, they will 
propagate.

Thank you.


Re: [PATCH] fddi: skfp: Rudimentary spello fixes

2021-03-25 Thread David Miller
From: Bhaskar Chowdhury 
Date: Thu, 25 Mar 2021 12:38:35 +0530

> 
> s/autohorized/authorized/
> s/recsource/resource/
> s/measuered/measured/
> sauthoriziation/authorization/
> 
> Signed-off-by: Bhaskar Chowdhury 

Does not apply cleanly to net-next please respin.

Thank you.



[GIT] Networking

2021-03-24 Thread David Miller

Various fixes, all over:

1) Fix overflow in ptp_qoriq_adjfine(), from Yangbo Lu.

2) Always store the rx queue mapping in veth, from Maciej Fijalkowski.

3) Don't allow vmlinux btf in map_create, from Alexei Starovoitov.

4) Fix memory leak in octeontx2-af from Colin Ian King.

5) Use kvalloc in bpf x86 JIT for storing jit'd addresses,
   from Yonghong Song.

6) Fix tx ptp stats in mlx5, from Aya Levin.

7) Check correct ip version in tun decap, fropm Roi Dayan.

8) Fix rate calculation in mlx5 E-Switch code, from arav Pandit.

9) Work item memork leak in mlx5, from Shay Drory.

10) Fix ip6ip6 tunnel crash with bpf, from Daniel Borkmann.

11) Lack of preemptrion awareness in macvlan, from Eric Dumazet.

12) Fix data race in pxa168_eth, from Pavel Andrianov.

13) Range validate stab in red_check_params(), from Eric Dumazet.

14) Inherit vlan filtering setting properly in b53 driver, from Florian 
Fainelli.

15) Fix rtnl locking in igc driver, from Sasha Neftin.

16) Pause handling fixes in igc driver, from Muhammad Husaini Zulkifli.

17) Missing rtnl locking in e1000_reset_task, from Vitaly Lifshits.

18) Use after free in qlcnic, from Lv Yunlong.

19) fix crash in fritzpci mISDN, from Tong Zhang.

20) Premature rx buffer reuse in igb, from Li RongQing.

21) Missing termination of ip[a driver message handler arrays,
from Alex Elder.

22) Fix race between "x25_close" and  "x25_xmit"/"x25_rx" in hdlc_x25 driver,
from Xie He.

23) Use after free in c_can_pci_remove(), from Tong Zhang.

24) Uninitialized variable use in nl80211, from Jarod Wilson.

25) Off by one size calc in bpf verifier, from Piotr Krysiuk.

26) Use delayed work instead of deferrable for flowtable GC, from Yinjun Zhang.

27) Fix infinite loop in NPC unmap of octeontx2 driver, from Hariprasad Kelam.

28) Fix being unable to change MTU of dwmac-sun8i devices due to lack of fifo 
sizes,
from Corentin Labbe.

29) DMA use after free in r8169 with WoL, fom Heiner Kallweit.

30) Mismatched prototypes in isdn-capi, from Arnd Bergmann.

31) Fix psample UAPI breakage, from Ido Schimmel.

Please pull, thanks a lot!

The following changes since commit 05a59d79793d482f628a31753c671f2e92178a21:

  Merge git://git.kernel.org:/pub/scm/linux/kernel/git/netdev/net (2021-03-09 
17:15:56 -0800)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git 

for you to fetch changes up to e43accba9b071dcd106b5e7643b1b106a158cbb1:

  psample: Fix user API breakage (2021-03-24 16:44:31 -0700)


Alaa Hleihel (1):
  net/mlx5e: Allow to match on MPLS parameters only for MPLS over UDP

Alex Elder (2):
  net: ipa: terminate message handler arrays
  net: ipa: fix init header command validation

Alexander Lobakin (1):
  flow_dissector: fix byteorder of dissected ICMP ID

Alexander Ovechkin (1):
  tcp: relookup sock for RST+ACK packets handled by obsolete req sock

Alexei Starovoitov (4):
  bpf: Dont allow vmlinux BTF to be used in map_create and prog_load.
  ftrace: Fix modify_ftrace_direct.
  bpf: Fix fexit trampoline.
  selftest/bpf: Add a test to check trampoline freeing logic.

Andre Guedes (1):
  igc: Fix igc_ptp_rx_pktstamp()

Andrii Nakryiko (1):
  Merge branch 'libbpf: Fix BTF dump of pointer-to-array-of-struct'

Angelo Dureghello (1):
  can: flexcan: flexcan_chip_freeze(): fix chip freeze for missing bitrate

Arnd Bergmann (2):
  isdn: capi: fix mismatched prototypes
  ch_ktls: fix enum-conversion warning

Aya Levin (4):
  net/mlx5e: Accumulate port PTP TX stats with other channels stats
  net/mlx5e: Set PTP channel pointer explicitly to NULL
  net/mlx5: Fix turn-off PPS command
  net/mlx5e: Fix error path for ethtool set-priv-flag

Bhaskar Chowdhury (2):
  sch_red: Fix a typo
  docs: networking: Fix a typo

Brian Norris (1):
  mac80211: Allow HE operation to be longer than expected.

Carlos Llamas (1):
  selftests/net: fix warnings on reuseaddr_ports_exhausted

Christophe Leroy (1):
  net: marvell: Remove reference to CONFIG_MV64X60

Colin Ian King (1):
  octeontx2-af: Fix memory leak of object buf

Corentin Labbe (1):
  net: stmmac: dwmac-sun8i: Provide TX and RX fifo sizes

Dan Carpenter (1):
  mptcp: fix bit MPTCP_PUSH_PENDING tests

Daniel Borkmann (2):
  net: Consolidate common blackhole dst ops
  net, bpf: Fix ip6ip6 crash with collect_md populated skbs

Daniel Phan (1):
  mac80211: Check crypto_aead_encrypt for errors

David Brazdil (1):
  selinux: vsock: Set SID for socket returned by accept()

David S. Miller (19):
  Merge branch 'ip6ip6-crash'
  Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf
  Merge tag 'mlx5-fixes-2021-03-10' of 
git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux
  Merge branch '1GbE' of 
git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue
  Merge 

Re: [PATCH] net: make unregister netdev warning timeout configurable

2021-03-22 Thread David Miller
From: Dmitry Vyukov 
Date: Sat, 20 Mar 2021 15:28:51 +0100

> netdev_wait_allrefs() issues a warning if refcount does not drop to 0
> after 10 seconds. While 10 second wait generally should not happen
> under normal workload in normal environment, it seems to fire falsely
> very often during fuzzing and/or in qemu emulation (~10x slower).
> At least it's not possible to understand if it's really a false
> positive or not. Automated testing generally bumps all timeouts
> to very high values to avoid flake failures.
> Make the timeout configurable for automated testing systems.
> Lowering the timeout may also be useful for e.g. manual bisection.
> The default value matches the current behavior.
> 
> Signed-off-by: Dmitry Vyukov 
> Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=211877
> Cc: net...@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org

I'd say a sysctl knob is much better than a compile time setting for this.
That way stock kernels can be used in these testing scenerios.

Thanks.


Re: [PATCH v4 RESEND net-next] net: socket: use BIT() for MSG_*

2021-03-17 Thread David Miller
From: Menglong Dong 
Date: Wed, 17 Mar 2021 16:21:14 +0800

> Hello,
> 
> On Wed, Mar 17, 2021 at 9:38 AM Guenter Roeck  wrote:
>>
>> On Wed, Mar 17, 2021 at 01:02:51AM +0200, Andy Shevchenko wrote:
>> > On Wednesday, March 17, 2021, Guenter Roeck  wrote:
>> >
> ...
>>
>> The problem is in net/packet/af_packet.c:packet_recvmsg(). This function,
>> as well as all other rcvmsg functions, is declared as
>>
>> static int packet_recvmsg(struct socket *sock, struct msghdr *msg, size_t 
>> len,
>>   int flags)
>>
>> MSG_CMSG_COMPAT (0x8000) is set in flags, meaning its value is negative.
>> This is then evaluated in
>>
>>if (flags & 
>> ~(MSG_PEEK|MSG_DONTWAIT|MSG_TRUNC|MSG_CMSG_COMPAT|MSG_ERRQUEUE))
>> goto out;
> So what should I do? Revert this patch? Or fix the usages of 'flags'?

I already reverted this patch from net-next to fix the regression.


Re: [PATCH net-next] net: sched: remove unnecessay lock protection for skb_bad_txq/gso_skb

2021-03-16 Thread David Miller
From: Yunsheng Lin 
Date: Tue, 16 Mar 2021 10:40:56 +0800

> On 2021/3/16 7:41, David Miller wrote:
>> From: Yunsheng Lin 
> 
> At least for the fast path, taking two locks for lockless qdisc hurts
> performance when handling requeued skb, especially if the lockless
> qdisc supports TCQ_F_CAN_BYPASS.

The bad txq and gro skb cases are not "fast path", sorry


Re: [PATCH net-next] net: sched: remove unnecessay lock protection for skb_bad_txq/gso_skb

2021-03-15 Thread David Miller
From: Yunsheng Lin 
Date: Mon, 15 Mar 2021 17:30:10 +0800

> Currently qdisc_lock(q) is taken before enqueuing and dequeuing
> for lockless qdisc's skb_bad_txq/gso_skb queue, qdisc->seqlock is
> also taken, which can provide the same protection as qdisc_lock(q).
> 
> This patch removes the unnecessay qdisc_lock(q) protection for
> lockless qdisc' skb_bad_txq/gso_skb queue.
> 
> And dev_reset_queue() takes the qdisc->seqlock for lockless qdisc
> besides taking the qdisc_lock(q) when doing the qdisc reset,
> some_qdisc_is_busy() takes both qdisc->seqlock and qdisc_lock(q)
> when checking qdisc status. It is unnecessary to take both lock
> while the fast path only take one lock, so this patch also changes
> it to only take qdisc_lock(q) for locked qdisc, and only take
> qdisc->seqlock for lockless qdisc.
> 
> Since qdisc->seqlock is taken for lockless qdisc when calling
> qdisc_is_running() in some_qdisc_is_busy(), use qdisc->running
> to decide if the lockless qdisc is running.
> 
> Signed-off-by: Yunsheng Lin 

What about other things protected by this lock, such as statistics and qlen?

This change looks too risky to me.



Re: [PATCH v2 2/3] net: ethernet: actions: Add Actions Semi Owl Ethernet MAC driver

2021-03-15 Thread David Miller
From: Cristian Ciocaltea 
Date: Mon, 15 Mar 2021 13:29:17 +0200

> +
> +#define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_LINK)
> +static int debug = -1;
> +module_param(debug, int, 0);
> +MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");

Module parameters are strongly discouraged in networking drivers, pplease 
delete this
ad just pass the default to netif_mdg_init(), thanks!



Re: [PATCH net] flow_dissector: fix byteorder of dissected ICMP ID

2021-03-14 Thread David Miller
From: Vladimir Oltean 
Date: Sun, 14 Mar 2021 20:44:49 +

> On Sun, Mar 14, 2021 at 09:21:40PM +0100, Jakub Sitnicki wrote:
>> On Fri, Mar 12, 2021 at 09:08 PM CET, Alexander Lobakin wrote:
>> 
>> Smells like a breaking change for existing consumers of this value.
>> 
>> How about we change the type of flow_dissector_key_icmp{}.id to __be16
>> instead to make sparse happy?
> 
> The struct flow_dissector_key_icmp::id only appears to be used in
> bond_xmit_hash, and there, the exact value doesn't seem to matter.
> 
> This appears to be a real bug and not just to appease sparse:
> ih->un.echo.id has one endianness and "1" has another. Both cannot
> be correct.

Agreed, so I will apply this, thanks.


Re: [PATCH v2 net-next 0/6] skbuff: micro-optimize flow dissection

2021-03-13 Thread David Miller


None of these apply to net-next as per the patchwork automated checks.  Any 
idea why?

Thanks.



Re: [PATCH] net: bonding: fix error return code of bond_neigh_init()

2021-03-12 Thread David Miller
From: Eric Dumazet 
Date: Wed, 10 Mar 2021 17:55:04 +0100

> 
> Agreed, this commit made no sense, please revert.

Done.


Re: [PATCH 4/4] ftgmac100: Restart MAC HW once

2021-03-11 Thread David Miller
From: Joel Stanley 
Date: Fri, 12 Mar 2021 00:26:43 +

> On Tue, 20 Oct 2020 at 04:14, Joel Stanley  wrote:
>>
>> On Mon, 19 Oct 2020 at 08:57, Dylan Hung  wrote:
>> >
>> > The interrupt handler may set the flag to reset the mac in the future,
>> > but that flag is not cleared once the reset has occured.
>> >
>> > Fixes: 10cbd6407609 ("ftgmac100: Rework NAPI & interrupts handling")
>> > Signed-off-by: Dylan Hung 
>> > Signed-off-by: Joel Stanley 
>>
>> Reviewed-by: Joel Stanley 
> 
> net maintainers, this one never made it into the tree. Do you need me
> to re-send it?

If it has been this long, definitely you need to resend.



Re: [GIT] SPARC

2021-03-09 Thread David Miller
From: Linus Torvalds 
Date: Tue, 9 Mar 2021 17:17:24 -0800

> On Tue, Mar 9, 2021 at 5:15 PM David Miller  wrote:
>>
>> Somehow you pull didn't get commits:
> 
> Look closer at the pull date. That was before you had updated your branch.
> 
> I did a second pull just moments ago, I'll push it out (along with the
> networking one), after all my tests have passed.

Thank you.


Re: [GIT] SPARC

2021-03-09 Thread David Miller
From: David Miller 
Date: Tue, 09 Mar 2021 16:24:54 -0800 (PST)

> From: Linus Torvalds 
> Date: Tue, 9 Mar 2021 11:27:41 -0800
> 
>> On Tue, Mar 9, 2021 at 11:08 AM David Miller  wrote:
>> 
>> (And yes, I prefer lore.kernel.org over marc, although for single
>> patches it doesn't make much of a difference. For patch series, I find
>> 'b4' so convenient that I definitely want the patch to show up on
>> lore.kernel.org).
> 
> Sadly, lore does not archive sparcli...@vger.kernel.org, so there
> isn't much choice in this case.
>> 
>> I'll await your pull request or 'I have nothing else, take it from
>> xyz', this thread is otherwise archived for me as "done".
> 
> I added Rob's fix to the tree, here is a new pull request, thanks!
> 
> The following changes since commit 062c84fccc805738d76a2699c4d3c95184ec:
> 
>   Merge tag 'rproc-v5.12' of 
> git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc 
> (2021-02-24 11:30:13 -0800)
> 
> are available in the Git repository at:
> 
>   git://git.kernel.org:/pub/scm/linux/kernel/git/davem/sparc.git 
> 

Somehow you pull didn't get commits:

commit 69264b4a43aff7307283e2bae29e9305ab6b7d47 (HEAD -> master, origin/master, 
origin/HEAD)
Author: Corentin Labbe 
Date:   Mon Mar 8 09:51:26 2021 +

sparc: sparc64_defconfig: remove duplicate CONFIGs

After my patch there is CONFIG_ATA defined twice.
Remove the duplicate one.
Same problem for CONFIG_HAPPYMEAL, except I added as builtin for boot
test with NFS.

Reported-by: Stephen Rothwell 
Fixes: a57cdeb369ef ("sparc: sparc64_defconfig: add necessary configs for 
qemu")
Signed-off-by: Corentin Labbe 
Signed-off-by: David S. Miller 

commit e5e8b80d352ec999d2bba3ea584f541c83f4ca3f
Author: Rob Gardner 
Date:   Sun Feb 28 22:48:16 2021 -0700

sparc64: Fix opcode filtering in handling of no fault loads

is_no_fault_exception() has two bugs which were discovered via random
opcode testing with stress-ng. Both are caused by improper filtering
of opcodes.

The first bug can be triggered by a floating point store with a no-fault
ASI, for instance "sta %f0, [%g0] #ASI_PNF", opcode C1A01040.

The code first tests op3[5] (0x100), which denotes a floating
point instruction, and then tests op3[2] (0x20), which denotes a
store instruction. But these bits are not mutually exclusive, and the
above mentioned opcode has both bits set. The intent is to filter out
stores, so the test for stores must be done first in order to have
any effect.

The second bug can be triggered by a floating point load with one of
the invalid ASI values 0x8e or 0x8f, which pass this check in
is_no_fault_exception():
 if ((asi & 0xf2) == ASI_PNF)

An example instruction is "ldqa [%l7 + %o7] #ASI 0x8f, %f38",
opcode CF95D1EF. Asi values greater than 0x8b (ASI_SNFL) are fatal
in handle_ldf_stq(), and is_no_fault_exception() must not allow these
invalid asi values to make it that far.

In both of these cases, handle_ldf_stq() reacts by calling
sun4v_data_access_exception() or spitfire_data_access_exception(),
which call is_no_fault_exception() and results in an infinite
recursion.

Signed-off-by: Rob Gardner 
Tested-by: Anatoly Pugachev 

Can you repull to get them, thanks.



Re: [GIT] SPARC

2021-03-09 Thread David Miller
From: Linus Torvalds 
Date: Tue, 9 Mar 2021 11:27:41 -0800

> On Tue, Mar 9, 2021 at 11:08 AM David Miller  wrote:
> 
> (And yes, I prefer lore.kernel.org over marc, although for single
> patches it doesn't make much of a difference. For patch series, I find
> 'b4' so convenient that I definitely want the patch to show up on
> lore.kernel.org).

Sadly, lore does not archive sparcli...@vger.kernel.org, so there
isn't much choice in this case.
> 
> I'll await your pull request or 'I have nothing else, take it from
> xyz', this thread is otherwise archived for me as "done".

I added Rob's fix to the tree, here is a new pull request, thanks!

The following changes since commit 062c84fccc805738d76a2699c4d3c95184ec:

  Merge tag 'rproc-v5.12' of 
git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc (2021-02-24 
11:30:13 -0800)

are available in the Git repository at:

  git://git.kernel.org:/pub/scm/linux/kernel/git/davem/sparc.git 

for you to fetch changes up to 69264b4a43aff7307283e2bae29e9305ab6b7d47:

  sparc: sparc64_defconfig: remove duplicate CONFIGs (2021-03-09 16:22:40 -0800)


Al Viro (10):
  sparc32: don't bother with lookup_fault() in __bzero()
  sparc32: kill lookup_fault()
  sparc32: switch __bzero() away from range exception table entries
  sparc32: get rid of range exception table entries in checksum_32.S
  sparc32: switch copy_user.S away from range exception table entries
  sparc32: switch to generic extables
  Merge remote-tracking branch 'sparc/master' into work.sparc32
  sparc64: get rid of fake_swapper_regs
  sparc32: get rid of fake_swapper_regs
  sparc32: take ->thread.flags out

Corentin Labbe (1):
  sparc: sparc64_defconfig: remove duplicate CONFIGs

David S. Miller (2):
  Merge branch 'work.sparc' of 
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
  Merge branch 'work.sparc32' of 
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

Rob Gardner (1):
  sparc64: Fix opcode filtering in handling of no fault loads

 arch/sparc/configs/sparc64_defconfig   |   4 +-
 arch/sparc/include/asm/elf_64.h|   1 -
 arch/sparc/include/asm/{extable_64.h => extable.h} |   4 +-
 arch/sparc/include/asm/processor_32.h  |   6 +-
 arch/sparc/include/asm/thread_info_64.h|   1 +
 arch/sparc/include/asm/uaccess.h   |   3 +
 arch/sparc/include/asm/uaccess_32.h|  38 --
 arch/sparc/include/asm/uaccess_64.h|   1 -
 arch/sparc/kernel/head_32.S|   2 +-
 arch/sparc/kernel/head_64.S|   2 +-
 arch/sparc/kernel/process_32.c |  12 
 arch/sparc/kernel/setup_32.c   |   3 -
 arch/sparc/kernel/setup_64.c   |   4 --
 arch/sparc/kernel/traps_64.c   |  13 ++--
 arch/sparc/kernel/unaligned_32.c   | 106 
++-
 arch/sparc/lib/checksum_32.S   |  64 +++--
 arch/sparc/lib/copy_user.S | 315 
+
 arch/sparc/lib/memset.S|  87 
+--
 arch/sparc/mm/Makefile |   2 +-
 arch/sparc/mm/extable.c| 107 

 arch/sparc/mm/fault_32.c   |  80 +++--
 arch/sparc/mm/mm_32.h  |   2 -
 lib/extable.c  |   5 --
 23 files changed, 205 insertions(+), 657 deletions(-)
 rename arch/sparc/include/asm/{extable_64.h => extable.h} (92%)
 delete mode 100644 arch/sparc/mm/extable.c


Re: [GIT] SPARC

2021-03-09 Thread David Miller
From: John Paul Adrian Glaubitz 
Date: Tue, 9 Mar 2021 01:19:05 +0100

> Hi Dave!
> 
> On 3/9/21 12:46 AM, David Miller wrote:
>> Just some more random bits from Al,  including a conversion over to generic 
>> exytables.
> 
> Is there a chance we could include this important fix by Rob Gardner for 5.12 
> as well?
> 
>> https://marc.info/?l=linux-sparc=161457847223456=2
> 
> It fixes a hard kernel crash under certain loads which we have seen in Debian 
> quite frequently.

I'll ake sure that gets into my next pull req, thanks.


[GIT] SPARC

2021-03-08 Thread David Miller


Just some more random bits from Al,  including a conversion over to generic 
exytables.

Please pull, thanks a lot!

The following changes since commit 062c84fccc805738d76a2699c4d3c95184ec:

  Merge tag 'rproc-v5.12' of 
git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc (2021-02-24 
11:30:13 -0800)

are available in the Git repository at:

  git://git.kernel.org:/pub/scm/linux/kernel/git/davem/sparc.git 

for you to fetch changes up to cf64c2a905e0dabcc473ca70baf275fb3a61fac4:

  Merge branch 'work.sparc32' of 
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs (2021-02-26 16:16:24 
-0800)


Al Viro (10):
  sparc32: don't bother with lookup_fault() in __bzero()
  sparc32: kill lookup_fault()
  sparc32: switch __bzero() away from range exception table entries
  sparc32: get rid of range exception table entries in checksum_32.S
  sparc32: switch copy_user.S away from range exception table entries
  sparc32: switch to generic extables
  Merge remote-tracking branch 'sparc/master' into work.sparc32
  sparc64: get rid of fake_swapper_regs
  sparc32: get rid of fake_swapper_regs
  sparc32: take ->thread.flags out

David S. Miller (2):
  Merge branch 'work.sparc' of 
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
  Merge branch 'work.sparc32' of 
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

 arch/sparc/include/asm/elf_64.h|   1 -
 arch/sparc/include/asm/{extable_64.h => extable.h} |   4 +-
 arch/sparc/include/asm/processor_32.h  |   6 +-
 arch/sparc/include/asm/thread_info_64.h|   1 +
 arch/sparc/include/asm/uaccess.h   |   3 +
 arch/sparc/include/asm/uaccess_32.h|  38 --
 arch/sparc/include/asm/uaccess_64.h|   1 -
 arch/sparc/kernel/head_32.S|   2 +-
 arch/sparc/kernel/head_64.S|   2 +-
 arch/sparc/kernel/process_32.c |  12 
 arch/sparc/kernel/setup_32.c   |   3 -
 arch/sparc/kernel/setup_64.c   |   4 --
 arch/sparc/kernel/unaligned_32.c   | 106 
++-
 arch/sparc/lib/checksum_32.S   |  64 +++--
 arch/sparc/lib/copy_user.S | 315 
+
 arch/sparc/lib/memset.S|  87 
+--
 arch/sparc/mm/Makefile |   2 +-
 arch/sparc/mm/extable.c| 107 

 arch/sparc/mm/fault_32.c   |  80 +++--
 arch/sparc/mm/mm_32.h  |   2 -
 lib/extable.c  |   5 --
 21 files changed, 198 insertions(+), 647 deletions(-)
 rename arch/sparc/include/asm/{extable_64.h => extable.h} (92%)
 delete mode 100644 arch/sparc/mm/extable.c


Re: [PATCH][next] net: mscc: ocelot: Fix fall-through warnings for Clang

2021-03-05 Thread David Miller


Please resubmit these again when net-next opens back up, thank you.



[GIT] Sparc

2021-02-23 Thread David Miller


A host of mall cleanups and adjustments that have accumulated while
I was away, nothing major.

Please pull, thanks a lot!

The following changes since commit dd0d718152e4c65b173070d48ea9dfc06894c3e5:

  Merge tag 'spi-fix-v5.8-rc2' of 
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi (2020-06-22 09:49:59 
-0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc.git 

for you to fetch changes up to 356184fb6d67770d7788f316226be810a430937b:

  sparc: make xchg() into a statement expression (2021-02-18 16:40:22 -0800)


Al Viro (1):
  sparc32: fix a user-triggerable oops in clear_user()

Alexander A. Klimov (1):
  arch/sparc: Replace HTTP links with HTTPS ones

Andreas Larsson (2):
  sparc32: Limit memblock allocation to low memory
  sparc32: Preserve clone syscall flags argument for restarts due to signals

Ben Hutchings (1):
  sparc32: signal: Fix stack trampoline for RT signals

Christoph Hellwig (1):
  sparc64: switch defconfig from the legacy ide driver to libata

Corentin Labbe (2):
  sparc: piggyback: handle invalid image
  sparc: sparc64_defconfig: add necessary configs for qemu

David S. Miller (1):
  Merge branch 'sparc32-srmmu-improve-type-safety-of-__nocache_fix'

Gustavo A. R. Silva (2):
  sparc64: viohs: Use struct_size() helper
  sparc: Use fallthrough pseudo-keyword

Jing Xiangfeng (1):
  sbus: char: Remove meaningless jump label out_free

Kaixu Xia (1):
  sparc32: Fix comparing pointer to 0 coccicheck warning

Khalid Aziz (1):
  sparc64: Use arch_validate_flags() to validate ADI flag

Matthew Wilcox (Oracle) (1):
  sparc: Fix handling of page table constructor failure

Mike Rapoport (2):
  sparc32: use PUD rather than PGD to get PMD in 
srmmu_inherit_prom_mappings()
  sparc32: srmmu: improve type safety of __nocache_fix()

Peter Collingbourne (1):
  sparc: remove SA_STATIC_ALLOC macro definition

Qinglang Miao (1):
  sparc: use for_each_child_of_node() macro

Randy Dunlap (4):
  SPARC: backoff.h: delete a duplicated word
  sparc64: only select COMPAT_BINFMT_ELF if BINFMT_ELF is set
  sparc: fix led.c driver when PROC_FS is not enabled
  sparc: make xchg() into a statement expression

Tiezhu Yang (1):
  sparc: Replace test_ti_thread_flag() with test_tsk_thread_flag()

Uwe Kleine-König (3):
  tty: vcc: Drop impossible to hit WARN_ON
  tty: vcc: Drop unnecessary if block
  tty: hvcs: Drop unnecessary if block

 arch/sparc/Kconfig   |  4 ++--
 arch/sparc/boot/piggyback.c  |  4 
 arch/sparc/configs/sparc64_defconfig | 11 ---
 arch/sparc/include/asm/backoff.h |  2 +-
 arch/sparc/include/asm/cmpxchg_32.h  |  2 +-
 arch/sparc/include/asm/mman.h| 54 
+-
 arch/sparc/include/asm/pgtsrmmu.h|  2 +-
 arch/sparc/include/asm/signal.h  | 12 
 arch/sparc/kernel/auxio_64.c |  1 -
 arch/sparc/kernel/central.c  |  2 +-
 arch/sparc/kernel/entry.S|  8 +++-
 arch/sparc/kernel/kgdb_32.c  |  2 +-
 arch/sparc/kernel/kgdb_64.c  |  2 +-
 arch/sparc/kernel/led.c  |  2 ++
 arch/sparc/kernel/pci.c  |  3 +--
 arch/sparc/kernel/pcr.c  |  2 +-
 arch/sparc/kernel/process_32.c   |  2 +-
 arch/sparc/kernel/prom_32.c  |  2 +-
 arch/sparc/kernel/rtrap_32.S |  2 +-
 arch/sparc/kernel/signal32.c |  4 ++--
 arch/sparc/kernel/signal_32.c|  8 
 arch/sparc/kernel/signal_64.c|  4 ++--
 arch/sparc/kernel/viohs.c|  6 ++
 arch/sparc/lib/memset.S  |  1 +
 arch/sparc/math-emu/math_32.c|  8 
 arch/sparc/mm/init_32.c  |  3 +++
 arch/sparc/mm/init_64.c  |  2 +-
 arch/sparc/mm/srmmu.c| 20 ++--
 drivers/sbus/char/display7seg.c  |  4 +---
 drivers/tty/hvc/hvcs.c   |  3 ---
 drivers/tty/vcc.c| 10 ++
 31 files changed, 91 insertions(+), 101 deletions(-)


Re: [PATCH v15 0/4] Adding the Sparx5 Serdes driver

2021-02-18 Thread David Miller
From: Steen Hegelund 
Date: Thu, 18 Feb 2021 17:14:47 +0100

> Adding the Sparx5 Serdes driver
> 
The net-next tree is closed so this will have to wait until the next merge 
window.

Thanks.



Re: [PATCH net-next v2 0/2] net: phy: at803x: paging support

2021-02-18 Thread David Miller
From: Michael Walle 
Date: Thu, 18 Feb 2021 20:46:10 +0100

> Am 2021-02-18 20:26, schrieb Vladimir Oltean:
>> On Thu, Feb 18, 2021 at 07:52:38PM +0100, Michael Walle wrote:
>>> Add paging support to the QCA AR8031/33 PHY. This will be needed if we
>>> add support for the .config_inband_aneg callback, see series [1].
>>> The driver itself already accesses the fiber page (without proper
>>> locking).
>>> The former version of this patchset converted the access to
>>> phy_read_paged(), but Vladimir Oltean mentioned that it is dead code.
>>> Therefore, the second patch will just remove it.
>>> changes since v1:
>>>  - second patch will remove at803x_aneg_done() altogether
>> I'm pretty sure net-next is closed now, since David sent the pull
>> request, and I didn't come to a conclusion yet regarding the final
>> form of the phy_config_inband_aneg method either.
> 
> Yeah I wasn't sure. http://vger.kernel.org/~davem/net-next.html says
> it is still open. But anyway, if not, I'll resend the patch after
> the merge window. I've also thought about splitting it into two
> individual patches, because they aren't dependent on each other
> anymore.

It is closed now, so this will have to be deferred.

Thanks.



Re: [PATCH net-next v3 0/5] lan743x speed boost

2021-02-17 Thread David Miller
From: Sven Van Asbroeck 
Date: Wed, 17 Feb 2021 17:04:05 -0500

> Hi Jakub and Bryan,
> 
> Jakub, is there anything else you'd like to see from us, before you
> are satisfied that patches 1/5 and 2/5 can be merged into your tree?

They are already merged into net-next


Re: [PATCH net-next] octeontx2-pf: fix an off by one bug in otx2_get_fecparam()

2021-02-15 Thread David Miller
From: Dan Carpenter 
Date: Mon, 15 Feb 2021 18:56:46 +0300

> The "<= FEC_MAX_INDEX" comparison should be "< FEC_MAX_INDEX".
> 
> I did some cleanup in this function to hopefully make the code a bit
> clearer.  There was no blank line after the declaration block.  The
> closing curly brace on the fec[] declaration normally goes on a line
> by itself.  And I removed the FEC_MAX_INDEX define and used
> ARRAY_SIZE(fec) instead.
> 
> Fixes: d0cf9503e908 ("octeontx2-pf: ethtool fec mode support")
> Signed-off-by: Dan Carpenter 

This doesn't apply to net-next.


Re: [PATCH 2/4] net: stmmac: Add Toshiba Visconti SoCs glue driver

2021-02-11 Thread David Miller
From: Nobuhiro Iwamatsu 
Date: Thu, 11 Feb 2021 01:29:52 +0900

> +static int visconti_eth_init_hw(struct platform_device *pdev, struct 
> plat_stmmacenet_data *plat_dat)
> +{
> + struct visconti_eth *dwmac;
> + unsigned int reg_val, clk_sel_val;

Please use reverse christmas tree ordering for local variable declarations.

> +static int visconti_eth_clock_probe(struct platform_device *pdev,
> + struct plat_stmmacenet_data *plat_dat)
> +{
> + int err;
> + struct visconti_eth *dwmac;

Likewise.

> +static int visconti_eth_clock_remove(struct platform_device *pdev)
> +{
> + struct net_device *ndev = platform_get_drvdata(pdev);
> + struct stmmac_priv *priv = netdev_priv(ndev);
> + struct visconti_eth *dwmac = get_stmmac_bsp_priv(>dev);
Likewise.

Thanks.


Re: [PATCH v3 net-next 07/11] net: prep switchdev drivers for concurrent SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS

2021-02-10 Thread David Miller
From: Vladimir Oltean 
Date: Wed, 10 Feb 2021 11:14:41 +0200

> From: Vladimir Oltean 
> 
> Because the bridge will start offloading SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS
> while not serialized by any lock such as the br->lock spinlock, existing
> drivers that treat that attribute and cache the brport flags might no
> longer work correctly.
> 
> The issue is that the brport flags are a single unsigned long bitmask,
> and the bridge only guarantees the validity of the changed bits, not the
> full state. So when offloading two concurrent switchdev attributes, such
> as one for BR_LEARNING and another for BR_FLOOD, it might happen that
> the flags having BR_FLOOD are written into the cached value, and this in
> turn disables the BR_LEARNING bit which was set previously.
> 
> We can fix this across the board by keeping individual boolean variables
> for each brport flag. Note that mlxsw and prestera were setting the
> BR_LEARNING_SYNC flag too, but that appears to be just dead code, so I
> removed it.
> 
> Signed-off-by: Vladimir Oltean 


This needs updating because, as discussed, there is no race.


Re: [PATCH v14 2/4] phy: Add media type and speed serdes configuration interfaces

2021-02-10 Thread David Miller
From: Steen Hegelund 
Date: Wed, 10 Feb 2021 09:52:53 +0100

> Provide new phy configuration interfaces for media type and speed that
> allows allows e.g. PHYs used for ethernet to be configured with this
> information.
> 
> Signed-off-by: Lars Povlsen 
> Signed-off-by: Steen Hegelund 
> Reviewed-by: Andrew Lunn 
> Reviewed-by: Alexandre Belloni 
> ---
>  drivers/phy/phy-core.c  | 30 ++
>  include/linux/phy/phy.h | 26 ++
>  2 files changed, 56 insertions(+)
> 
> diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
> index 71cb10826326..ccb575b13777 100644
> --- a/drivers/phy/phy-core.c
> +++ b/drivers/phy/phy-core.c
> @@ -373,6 +373,36 @@ int phy_set_mode_ext(struct phy *phy, enum phy_mode 
> mode, int submode)
>  }
>  EXPORT_SYMBOL_GPL(phy_set_mode_ext);
>  
> +int phy_set_media(struct phy *phy, enum phy_media media)
> +{
> + int ret;
> +
> + if (!phy || !phy->ops->set_media)
> + return 0;
> +
> + mutex_lock(>mutex);
> + ret = phy->ops->set_media(phy, media);
> + mutex_unlock(>mutex);
> +
> + return ret;
> +}
> +EXPORT_SYMBOL_GPL(phy_set_media);
> +
> +int phy_set_speed(struct phy *phy, int speed)
> +{
> + int ret;
> +
> + if (!phy || !phy->ops->set_speed)
> + return 0;
> +
> + mutex_lock(>mutex);
> + ret = phy->ops->set_speed(phy, speed);
> + mutex_unlock(>mutex);
> +
> + return ret;
> +}
> +EXPORT_SYMBOL_GPL(phy_set_speed);
> +
>  int phy_reset(struct phy *phy)
>  {
>   int ret;
> diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
> index e435bdb0bab3..e4fd69a1faa7 100644
> --- a/include/linux/phy/phy.h
> +++ b/include/linux/phy/phy.h
> @@ -44,6 +44,12 @@ enum phy_mode {
>   PHY_MODE_DP
>  };
>  
> +enum phy_media {
> + PHY_MEDIA_DEFAULT,
> + PHY_MEDIA_SR,
> + PHY_MEDIA_DAC,
> +};
> +
>  /**
>   * union phy_configure_opts - Opaque generic phy configuration
>   *
> @@ -64,6 +70,8 @@ union phy_configure_opts {
>   * @power_on: powering on the phy
>   * @power_off: powering off the phy
>   * @set_mode: set the mode of the phy
> + * @set_media: set the media type of the phy (optional)
> + * @set_speed: set the speed of the phy (optional)
>   * @reset: resetting the phy
>   * @calibrate: calibrate the phy
>   * @release: ops to be performed while the consumer relinquishes the PHY
> @@ -75,6 +83,8 @@ struct phy_ops {
>   int (*power_on)(struct phy *phy);
>   int (*power_off)(struct phy *phy);
>   int (*set_mode)(struct phy *phy, enum phy_mode mode, int submode);
> + int (*set_media)(struct phy *phy, enum phy_media media);
> + int (*set_speed)(struct phy *phy, int speed);
>  
>   /**
>* @configure:
> @@ -215,6 +225,8 @@ int phy_power_off(struct phy *phy);
>  int phy_set_mode_ext(struct phy *phy, enum phy_mode mode, int submode);
>  #define phy_set_mode(phy, mode) \
>   phy_set_mode_ext(phy, mode, 0)
> +int phy_set_media(struct phy *phy, enum phy_media media);
> +int phy_set_speed(struct phy *phy, int speed);
>  int phy_configure(struct phy *phy, union phy_configure_opts *opts);
>  int phy_validate(struct phy *phy, enum phy_mode mode, int submode,
>union phy_configure_opts *opts);
> @@ -344,6 +356,20 @@ static inline int phy_set_mode_ext(struct phy *phy, enum 
> phy_mode mode,
>  #define phy_set_mode(phy, mode) \
>   phy_set_mode_ext(phy, mode, 0)
>  
> +static inline int phy_set_media(struct phy *phy, enum phy_media media)
> +{
> + if (!phy)
> + return 0;
> + return -ENOSYS;
> +}

Maybe ENODEV instead?


Re: [PATCH v12 net-next 12/15] net: mvpp2: add BM protection underrun feature support

2021-02-10 Thread David Miller
From: 
Date: Wed, 10 Feb 2021 11:48:17 +0200

>  
> +static int bm_underrun_protect = 1;
> +
> +module_param(bm_underrun_protect, int, 0444);
> +MODULE_PARM_DESC(bm_underrun_protect, "Set BM underrun protect feature 
> (0-1), def=1");

No new module parameters, please.


[GIT] Networking

2021-02-09 Thread David Miller


Another pile of networing fixes:

1) ath9k build error fix from Arnd Bergmann

2) dma memory leak fix in mediatec driver from Lorenzo Bianconi.

3) bpf int3 kprobe fix from Alexei Starovoitov.

4) bpf stackmap integer overflow fix from Bui Quang Minh.

5) Add usb device ids for Cinterion MV31 to qmi_qwwan driver, from
   Christoph Schemmel.

6) Don't update deleted entry in xt_recent netfilter module, from Jazsef 
Kadlecsik.

7) Use after free in nftables, fix from Pablo Neira Ayuso.

8) Header checksum fix in flowtable from Sven Auhagen.

9) Validate user controlled length in qrtr code, from Sabyrzhan Tasbolatov.

10) Fix race in xen/netback, from Juergen Gross,

11) New device ID in cxgb4, from Raju Rangoju.

12) Fix ring locking in rxrpc release call, from David Howells.

13) Don't return LAPB error codes from x25_open(), from Xie He.

14) Missing error returns in gsi_channel_setup() from Alex Elder.

15) Get skb_copy_and_csum_datagram working properly with odd segment sizes,
from Willem de Bruijn.

16) Missing RFS/RSS table init in enetc driver, from Vladimir Oltean.

17) Do teardown on probe failure in DSA, from Vladimir Oltean.

18) Fix compilation failures of txtimestamp selftest, from Vadim Fedorenko.

19) Limit rx per-napi gro queue size to fix latency regression,  from Eric 
Dumazet.

20) dpaa_eth xdp fixes from Camelia Groza.

21) Missing txq mode update when switching CBS off, in stmmac driver,
from Mohammad Athari Bin Ismail.

22) Failover pending logic fix in ibmvnic driver, from Sukadev Bhattiprolu.

23) Null deref fix in vmw_vsock, from Norbert Slusarek.

24) Missing verdict update in xdp paths of ena driver, from Shay Agroskin.

25) seq_file iteration fix in sctp from Neil Brown.

26) bpf 32-bit src register truncation fix on div/mod, from Daniel Borkmann.

27) Fix jmp32 pruning in bpf verifier, from  Daniel Borkmann.

28) Fix locking in vsock_shutdown(),  from Stefano Garzarella.

29) Various missing index bound checks in hns3 driver, from Yufeng Mo.

30) Flush ports on .phylink_mac_link_down() in dsa felix driver, from Vladimir 
Oltean.

31) Don't mix up stp and mrp port states in bridge layer, from Horatiu Vultur.

32) Fix locking during netif_tx_disable(), from Edwin Peer.

Please pull, thanks a lot!

The following changes since commit 3aaf0a27ffc29b19a62314edd684b9bc6346f9a8:

  Merge tag 'clang-format-for-linux-v5.11-rc7' of git://github.com/ojeda/linux 
(2021-02-02 10:46:59 -0800)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git 

for you to fetch changes up to b8776f14a47046796fe078c4a2e691f58e00ae06:

  Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf (2021-02-09 
18:55:17 -0800)


Alex Elder (1):
  net: ipa: set error code in gsi_channel_setup()

Alexei Starovoitov (1):
  bpf: Unbreak BPF_PROG_TYPE_KPROBE when kprobe is called via do_int3

Andrea Parri (Microsoft) (1):
  hv_netvsc: Reset the RSC count if NVSP_STAT_FAIL in netvsc_receive()

Arnd Bergmann (1):
  ath9k: fix build error with LEDS_CLASS=m

Bui Quang Minh (1):
  bpf: Check for integer overflow when using roundup_pow_of_two()

Camelia Groza (3):
  dpaa_eth: reserve space for the xdp_frame under the A050385 erratum
  dpaa_eth: reduce data alignment requirements for the A050385 erratum
  dpaa_eth: try to move the data in place for the A050385 erratum

Christoph Schemmel (1):
  NET: usb: qmi_wwan: Adding support for Cinterion MV31

Daniel Borkmann (3):
  bpf: Fix verifier jsgt branch analysis on max bound
  bpf: Fix verifier jmp32 pruning decision logic
  bpf: Fix 32 bit src register truncation on div/mod

David Howells (1):
  rxrpc: Fix clearance of Tx/Rx ring when releasing a call

David S. Miller (4):
  Merge branch 'bridge-mrp'
  Merge branch 'hns3-fixes'
  Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf
  Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf

Edwin Peer (1):
  net: watchdog: hold device global xmit lock during tx disable

Eric Dumazet (1):
  net: gro: do not keep too many GRO packets in napi->rx_list

Fabian Frederick (1):
  selftests: netfilter: fix current year

Florian Westphal (1):
  netfilter: conntrack: skip identical origin tuple in same zone only

Horatiu Vultur (2):
  bridge: mrp: Fix the usage of br_mrp_port_switchdev_set_state
  switchdev: mrp: Remove SWITCHDEV_ATTR_ID_MRP_PORT_STAT

Jakub Kicinski (3):
  Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf
  Merge branch 'dpaa_eth-a050385-erratum-workaround-fixes-under-xdp'
  Merge tag 'wireless-drivers-2021-02-05' of 
git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers

Jozsef Kadlecsik (1):
  netfilter: xt_recent: Fix attempt to update deleted entry

Juergen Gross (1):
  xen/netback: avoid race in xenvif_rx_ring_slots_available()

Lorenzo 

Re: [PATCH v2] net: ethernet: fs_enet: Add missing MODULE_LICENSE

2021-01-05 Thread David Miller
From: Michael Ellerman 
Date: Tue,  5 Jan 2021 20:15:15 +1100

> Since commit 1d6cd3929360 ("modpost: turn missing MODULE_LICENSE()
> into error") the ppc32_allmodconfig build fails with:
> 
>   ERROR: modpost: missing MODULE_LICENSE() in 
> drivers/net/ethernet/freescale/fs_enet/mii-fec.o
>   ERROR: modpost: missing MODULE_LICENSE() in 
> drivers/net/ethernet/freescale/fs_enet/mii-bitbang.o
> 
> Add the missing MODULE_LICENSEs to fix the build. Both files include a
> copyright header indicating they are GPL v2.
> 
> Signed-off-by: Michael Ellerman 

Applied.


Re: [PATCH net,stable v3] net: cdc_ncm: correct overhead in delayed_ndp_size

2021-01-05 Thread David Miller
From: Jouni Seppänen 
Date: Tue,  5 Jan 2021 06:52:49 +0200

> From: Jouni K. Seppänen 
> 
> Aligning to tx_ndp_modulus is not sufficient because the next align
> call can be cdc_ncm_align_tail, which can add up to ctx->tx_modulus +
> ctx->tx_remainder - 1 bytes. This used to lead to occasional crashes
> on a Huawei 909s-120 LTE module as follows:
> 
> - the condition marked /* if there is a remaining skb [...] */ is true
>   so the swaps happen
> - skb_out is set from ctx->tx_curr_skb
> - skb_out->len is exactly 0x3f52
> - ctx->tx_curr_size is 0x4000 and delayed_ndp_size is 0xac
>   (note that the sum of skb_out->len and delayed_ndp_size is 0x3ffe)
> - the for loop over n is executed once
> - the cdc_ncm_align_tail call marked /* align beginning of next frame */
>   increases skb_out->len to 0x3f56 (the sum is now 0x4002)
> - the condition marked /* check if we had enough room left [...] */ is
>   false so we break out of the loop
> - the condition marked /* If requested, put NDP at end of frame. */ is
>   true so the NDP is written into skb_out
> - now skb_out->len is 0x4002, so padding_count is minus two interpreted
>   as an unsigned number, which is used as the length argument to memset,
>   leading to a crash with various symptoms but usually including
> 
>> Call Trace:
>>  
>>  cdc_ncm_fill_tx_frame+0x83a/0x970 [cdc_ncm]
>>  cdc_mbim_tx_fixup+0x1d9/0x240 [cdc_mbim]
>>  usbnet_start_xmit+0x5d/0x720 [usbnet]
> 
> The cdc_ncm_align_tail call first aligns on a ctx->tx_modulus
> boundary (adding at most ctx->tx_modulus-1 bytes), then adds
> ctx->tx_remainder bytes. Alternatively, the next alignment call can
> occur in cdc_ncm_ndp16 or cdc_ncm_ndp32, in which case at most
> ctx->tx_ndp_modulus-1 bytes are added.
> 
> A similar problem has occurred before, and the code is nontrivial to
> reason about, so add a guard before the crashing call. By that time it
> is too late to prevent any memory corruption (we'll have written past
> the end of the buffer already) but we can at least try to get a warning
> written into an on-disk log by avoiding the hard crash caused by padding
> past the buffer with a huge number of zeros.
> 
> Signed-off-by: Jouni K. Seppänen 
> Fixes: 4a0e3e989d66 ("cdc_ncm: Add support for moving NDP to end of NCM 
> frame")
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=209407
> Reported-by: kernel test robot 
> Reviewed-by: Bjørn Mork 

Applied and queued up for -stable, thanks.


Re: [PATCH v2] net: qrtr: fix null-ptr-deref in qrtr_ns_remove

2021-01-05 Thread David Miller
From: Qinglang Miao 
Date: Tue, 5 Jan 2021 13:57:54 +0800

> A null-ptr-deref bug is reported by Hulk Robot like this:
> --
> KASAN: null-ptr-deref in range [0x0128-0x012f]
> Call Trace:
> qrtr_ns_remove+0x22/0x40 [ns]
> qrtr_proto_fini+0xa/0x31 [qrtr]
> __x64_sys_delete_module+0x337/0x4e0
> do_syscall_64+0x34/0x80
> entry_SYSCALL_64_after_hwframe+0x44/0xa9
> RIP: 0033:0x468ded
> --
> 
> When qrtr_ns_init fails in qrtr_proto_init, qrtr_ns_remove which would
> be called later on would raise a null-ptr-deref because qrtr_ns.workqueue
> has been destroyed.
> 
> Fix it by making qrtr_ns_init have a return value and adding a check in
> qrtr_proto_init.
> 
> Reported-by: Hulk Robot 
> Signed-off-by: Qinglang Miao 
> ---
> v1->v2: remove redundant braces for single statement blocks.

Applied.


Re: [PATCH net-next] net: nfc: nci: Change the NCI close sequence

2021-01-05 Thread David Miller
From: Bongsu Jeon 
Date: Mon, 28 Dec 2020 10:46:31 +0900

> From: Bongsu Jeon 
> 
> Change the NCI close sequence because the NCI Command timer should be
> deleted after flushing the NCI command work queue.
> 
> Signed-off-by: Bongsu Jeon 

Applied.


Re: [PATCH] neighbour: Disregard DEAD dst in neigh_update

2021-01-05 Thread David Miller
From: Tong Zhu 
Date: Wed, 30 Dec 2020 17:54:23 -0500

> In 4.x kernel a dst in DST_OBSOLETE_DEAD state is associated
> with loopback net_device and leads to loopback neighbour. It
> leads to an ethernet header with all zero addresses.
> 
> A very troubling case is working with mac80211 and ath9k.
> A packet with all zero source MAC address to mac80211 will
> eventually fail ieee80211_find_sta_by_ifaddr in ath9k (xmit.c).
> As result, ath9k flushes tx queue (ath_tx_complete_aggr) without
> updating baw (block ack window), damages baw logic and disables
> transmission.
> 
> Signed-off-by: Tong Zhu 

Please repost with an appropriate Fixes: tag.

Thanks.


Re: [PATCH v3 net-next] net: kcm: Replace fput with sockfd_put

2021-01-05 Thread David Miller
From: Zheng Yongjun 
Date: Wed, 30 Dec 2020 17:18:09 +0800

> The function sockfd_lookup uses fget on the value that is stored in
> the file field of the returned structure, so fput should ultimately be
> applied to this value.  This can be done directly, but it seems better
> to use the specific macro sockfd_put, which does the same thing.
> 
> Perform a source code refactoring by using the following semantic patch.
> 
> // 
> @@
> expression s;
> @@
> 
>s = sockfd_lookup(...)
>...
> + sockfd_put(s);
> - fput(s->file);
> // 
> 
> Signed-off-by: Zheng Yongjun 

Applied.


Re: [PATCH net-next] net/mlxfw: Use kzalloc for allocating only one thing

2021-01-05 Thread David Miller
From: Zheng Yongjun 
Date: Wed, 30 Dec 2020 16:18:35 +0800

> Use kzalloc rather than kcalloc(1,...)
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // 
> @@
> @@
> 
> - kcalloc(1,
> + kzalloc(
>   ...)
> // 
> 
> Signed-off-by: Zheng Yongjun 

Applied.


Re: [PATCH v4 net RESEND] net/sonic: Fix some resource leaks in error handling paths

2021-01-05 Thread David Miller
From: Finn Thain 
Date: Sun, 03 Jan 2021 11:26:26 +1100

> From: Christophe JAILLET 
> 
> A call to dma_alloc_coherent() is wrapped by sonic_alloc_descriptors().
> 
> This is correctly freed in the remove function, but not in the error
> handling path of the probe function. Fix this by adding the missing
> dma_free_coherent() call.
> 
> While at it, rename a label in order to be slightly more informative.
> 
> Cc: Christophe JAILLET 
> Cc: Thomas Bogendoerfer 
> Cc: Chris Zankel 
> References: commit 10e3cc180e64 ("net/sonic: Fix a resource leak in an error 
> handling path in 'jazz_sonic_probe()'")
> Fixes: 74f2a5f0ef64 ("xtensa: Add support for the Sonic Ethernet device for 
> the XT2000 board.")
> Fixes: efcce839360f ("[PATCH] macsonic/jazzsonic network drivers update")
> Signed-off-by: Christophe JAILLET 
> Signed-off-by: Finn Thain 

Applied and queued up for -stable, thanks.


Re: [PATCH] liquidio: style: Identical condition and return expression 'retval', return value is always 0.

2021-01-05 Thread David Miller
From: YANG LI 
Date: Wed, 30 Dec 2020 14:07:30 +0800

> The warning was because of the following line in function
> liquidio_set_fec():
> 
> retval = wait_for_sc_completion_timeout(oct, sc, 0);
> if (retval)
>   return (-EIO);
> 
> If this statement is not true, retval must be 0 and not updated
> later. So, It is better to return 0 directly.
> 
> Signed-off-by: YANG LI 
> Reported-by: Abaci 

Maybe you can remove the rest of the 'retval' usage in this function
and even the variable itself?

Thanks.


Re: [PATCH RESEND net-next 0/4] enetc: code cleanups

2021-01-05 Thread David Miller
From: Michael Walle 
Date: Mon, 28 Dec 2020 14:00:30 +0100

> This are some code cleanups in the MDIO part of the enetc. They are
> intended to make the code more readable.

Series applied, thank you.


Re: [PATCH net v2] net: hdlc_ppp: Fix issues when mod_timer is called while timer is running

2020-12-28 Thread David Miller
From: Xie He 
Date: Sun, 27 Dec 2020 18:53:39 -0800

> ppp_cp_event is called directly or indirectly by ppp_rx with "ppp->lock"
> held. It may call mod_timer to add a new timer. However, at the same time
> ppp_timer may be already running and waiting for "ppp->lock". In this
> case, there's no need for ppp_timer to continue running and it can just
> exit.
> 
> If we let ppp_timer continue running, it may call add_timer. This causes
> kernel panic because add_timer can't be called with a timer pending.
> This patch fixes this problem.
> 
> Fixes: e022c2f07ae5 ("WAN: new synchronous PPP implementation for generic 
> HDLC.")
> Cc: Krzysztof Halasa 
> Signed-off-by: Xie He 

Applied and queued up for -stable, thanks!


Re: [PATCH] ipv6: Prevent overrun when parsing v6 header options

2020-12-28 Thread David Miller
From: Defang Bo 
Date: Sun, 27 Dec 2020 22:11:35 +0800

> Similar to commit<2423496af35>, the fragmentation code tries to parse the 
> header options in order
> to figure out where to insert the fragment option.  Since nexthdr points
> to an invalid option, the calculation of the size of the network header
> can made to be much larger than the linear section of the skb and data
> is read outside of it.
> 
> Signed-off-by: Defang Bo 

Could you please repost this with a proper Fixes: tag, thank you.


Re: [PATCH -net] net: sched: prevent invalid Scell_log shift count

2020-12-28 Thread David Miller
From: Randy Dunlap 
Date: Thu, 24 Dec 2020 22:23:44 -0800

> Check Scell_log shift size in red_check_params() and modify all callers
> of red_check_params() to pass Scell_log.
> 
> This prevents a shift out-of-bounds as detected by UBSAN:
>   UBSAN: shift-out-of-bounds in ./include/net/red.h:252:22
>   shift exponent 72 is too large for 32-bit type 'int'
> 
> Fixes: 8afa10cbe281 ("net_sched: red: Avoid illegal values")
> Signed-off-by: Randy Dunlap 
> Reported-by: syzbot+97c5bd9cc81eca63d...@syzkaller.appspotmail.com

Applied and queued up for -stable, thanks.


Re: [PATCH v4] net: neighbor: fix a crash caused by mod zero

2020-12-28 Thread David Miller
From: weichenchen 
Date: Fri, 25 Dec 2020 13:44:45 +0800

> pneigh_enqueue() tries to obtain a random delay by mod
> NEIGH_VAR(p, PROXY_DELAY). However, NEIGH_VAR(p, PROXY_DELAY)
> migth be zero at that point because someone could write zero
> to /proc/sys/net/ipv4/neigh/[device]/proxy_delay after the
> callers check it.
> 
> This patch uses prandom_u32_max() to get a random delay instead
> which avoids potential division by zero.
> 
> Signed-off-by: weichenchen 
> ---
> V4:
> - Use prandom_u32_max() to get a random delay in
>   pneigh_enqueue().
> V3:
> - Callers need to pass the delay time to pneigh_enqueue()
>   now and they should guarantee it is not zero.
> - Use READ_ONCE() to read NEIGH_VAR(p, PROXY_DELAY) in both
>   of the existing callers of pneigh_enqueue() and then pass
>   it to pneigh_enqueue().
> V2:
> - Use READ_ONCE() to prevent the complier from re-reading
>   NEIGH_VAR(p, PROXY_DELAY).
> - Give a hint to the complier that delay <= 0 is unlikely
>   to happen.
> 
> V4 is quite concise and works well.
> Thanks for Eric's and Jakub's advice.

Applied and queued up for -stable, thanks.


Re: [PATCH net-next V8] net: Variable SLAAC: SLAAC with prefixes of arbitrary length in PIO

2020-12-15 Thread David Miller
From: Dmytro Shytyi 
Date: Wed, 09 Dec 2020 04:27:54 +0100

> Variable SLAAC [Can be activated via sysctl]: 
> SLAAC with prefixes of arbitrary length in PIO (randomly
> generated hostID or stable privacy + privacy extensions).
> The main problem is that SLAAC RA or PD allocates a /64 by the Wireless
> carrier 4G, 5G to a mobile hotspot, however segmentation of the /64 via
> SLAAC is required so that downstream interfaces can be further subnetted.
> Example: uCPE device (4G + WI-FI enabled) receives /64 via Wireless, and
> assigns /72 to VNF-Firewall, /72 to WIFI, /72 to VNF-Router, /72 to
> Load-Balancer and /72 to wired connected devices.
> IETF document that defines problem statement:
> draft-mishra-v6ops-variable-slaac-problem-stmt
> IETF document that specifies variable slaac:
> draft-mishra-6man-variable-slaac
> 
> Signed-off-by: Dmytro Shytyi 
> ---
> diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
> index dda61d150a13..67ca3925463c 100644
> --- a/include/linux/ipv6.h
> +++ b/include/linux/ipv6.h
> @@ -75,6 +75,7 @@ struct ipv6_devconf {
>   __s32   disable_policy;
>   __s32   ndisc_tclass;
>   __s32   rpl_seg_enabled;
> + __s32   variable_slaac;
>  
>   struct ctl_table_header *sysctl_header;
>  };
> diff --git a/include/uapi/linux/ipv6.h b/include/uapi/linux/ipv6.h
> index 13e8751bf24a..f2af4f9fba2d 100644
> --- a/include/uapi/linux/ipv6.h
> +++ b/include/uapi/linux/ipv6.h
> @@ -189,7 +189,8 @@ enum {
>   DEVCONF_ACCEPT_RA_RT_INFO_MIN_PLEN,
>   DEVCONF_NDISC_TCLASS,
>   DEVCONF_RPL_SEG_ENABLED,
> - DEVCONF_MAX
> + DEVCONF_MAX,
> + DEVCONF_VARIABLE_SLAAC
>  };
>  
>  
> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
> index eff2cacd5209..07afe4ce984e 100644
> --- a/net/ipv6/addrconf.c
> +++ b/net/ipv6/addrconf.c
> @@ -236,6 +236,7 @@ static struct ipv6_devconf ipv6_devconf __read_mostly = {
>   .addr_gen_mode  = IN6_ADDR_GEN_MODE_EUI64,
>   .disable_policy = 0,
>   .rpl_seg_enabled= 0,
> + .variable_slaac = 0,
>  };
>  
>  static struct ipv6_devconf ipv6_devconf_dflt __read_mostly = {
> @@ -291,6 +292,7 @@ static struct ipv6_devconf ipv6_devconf_dflt 
> __read_mostly = {
>   .addr_gen_mode  = IN6_ADDR_GEN_MODE_EUI64,
>   .disable_policy = 0,
>   .rpl_seg_enabled= 0,
> + .variable_slaac = 0,
>  };
>  
>  /* Check if link is ready: is it up and is a valid qdisc available */
> @@ -1340,9 +1342,15 @@ static int ipv6_create_tempaddr(struct inet6_ifaddr 
> *ifp, bool block)
>   goto out;
>   }
>   in6_ifa_hold(ifp);
> - memcpy(addr.s6_addr, ifp->addr.s6_addr, 8);
> - ipv6_gen_rnd_iid();
>  
> + if (ifp->prefix_len == 64) {
> + memcpy(addr.s6_addr, ifp->addr.s6_addr, 8);
> + ipv6_gen_rnd_iid();
> + } else if (ifp->prefix_len > 0 && ifp->prefix_len <= 128 &&
> +idev->cnf.variable_slaac) {
> + get_random_bytes(addr.s6_addr, 16);
> + ipv6_addr_prefix_copy(, >addr, ifp->prefix_len);
> + }
>   age = (now - ifp->tstamp) / HZ;
>  
>   regen_advance = idev->cnf.regen_max_retry *
> @@ -2569,6 +2577,37 @@ static bool is_addr_mode_generate_stable(struct 
> inet6_dev *idev)
>  idev->cnf.addr_gen_mode == IN6_ADDR_GEN_MODE_RANDOM;
>  }
>  
> +static struct inet6_ifaddr *ipv6_cmp_rcvd_prsnt_prfxs(struct inet6_ifaddr 
> *ifp,
> +   struct inet6_dev *in6_dev,
> +   struct net *net,
> +   const struct prefix_info 
> *pinfo)
> +{
> + struct inet6_ifaddr *result_base = NULL;
> + struct inet6_ifaddr *result = NULL;
> + bool prfxs_equal;
> +
> + result_base = result;

This is NULL, are you sure you didn't mewan to init this to 'ifp'
 or similar instead?

Thanks.


Re: [PATCH net-next] net: lapbether: Consider it successful if (dis)connecting when already (dis)connected

2020-12-10 Thread David Miller
From: Xie He 
Date: Tue,  8 Dec 2020 14:50:44 -0800

> When the upper layer instruct us to connect (or disconnect), but we have
> already connected (or disconnected), consider this operation successful
> rather than failed.
> 
> This can help the upper layer to correct its record about whether we are
> connected or not here in layer 2.
> 
> The upper layer may not have the correct information about whether we are
> connected or not. This can happen if this driver has already been running
> for some time when the "x25" module gets loaded.
> 
> Another X.25 driver (hdlc_x25) is already doing this, so we make this
> driver do this, too.
> 
> Cc: Martin Schiller 
> Signed-off-by: Xie He 

Applied, thank you.


Re: [PATCH net-next] net: mediatek: simplify the return expression of mtk_gmac_sgmii_path_setup()

2020-12-10 Thread David Miller
From: Zheng Yongjun 
Date: Thu, 10 Dec 2020 21:50:50 +0800

> Simplify the return expression.
> 
> Signed-off-by: Zheng Yongjun 

Applied, thanks.


Re: [PATCH net-next] net/mlx4: simplify the return expression of mlx4_init_srq_table()

2020-12-10 Thread David Miller
From: Zheng Yongjun 
Date: Thu, 10 Dec 2020 21:50:00 +0800

> Simplify the return expression.
> 
> Signed-off-by: Zheng Yongjun 

Applied.


Re: [PATCH net-next] net: stmmac: simplify the return tc_delete_knode()

2020-12-10 Thread David Miller
From: Zheng Yongjun 
Date: Thu, 10 Dec 2020 21:48:33 +0800

> Simplify the return expression.
> 
> Signed-off-by: Zheng Yongjun 

Applied, thanks.


Re: [PATCH] vxlan: avoid double unlikely() notation when using IS_ERR()

2020-12-10 Thread David Miller
From: Antonio Quartulli 
Date: Thu, 10 Dec 2020 09:55:49 +0100

> The definition of IS_ERR() already applies the unlikely() notation
> when checking the error status of the passed pointer. For this
> reason there is no need to have the same notation outside of
> IS_ERR() itself.
> 
> Clean up code by removing redundant notation.
> 
> Signed-off-by: Antonio Quartulli 

Applied to net-next, thanks.


Re: [PATCH net-next 0/7] net: hns3: updates for -next

2020-12-09 Thread David Miller
From: Huazhong Tan 
Date: Thu, 10 Dec 2020 11:42:05 +0800

> This patchset adds support for tc mqprio offload, hw tc
> offload of tc flower, and adpation for max rss size changes.

ZSeries applied, thanks.



Re: [PATCH v2 net-next 1/1] net: stmmac: allow stmmac to probe for C45 PHY devices

2020-12-09 Thread David Miller
From: Wong Vee Khee 
Date: Thu, 10 Dec 2020 06:47:00 +0800

> Assign stmmac's mdio_bus probe capabilities to MDIOBUS_C22_C45.
> This extended the probing of C45 PHY devices on the MDIO bus.
> 
> Signed-off-by: Wong Vee Khee 
> ---
> v2 changelog:
> - Added conditional check for gmac4.

Applied, thanks.


Re: [PATCH net-next] net: x25: Fix handling of Restart Request and Restart Confirmation

2020-12-09 Thread David Miller
From: Xie He 
Date: Wed,  9 Dec 2020 00:16:04 -0800

> 1. When the x25 module gets loaded, layer 2 may already be running and
> connected. In this case, although we are in X25_LINK_STATE_0, we still
> need to handle the Restart Request received, rather than ignore it.
> 
> 2. When we are in X25_LINK_STATE_2, we have already sent a Restart Request
> and is waiting for the Restart Confirmation with t20timer. t20timer will
> restart itself repeatedly forever so it will always be there, as long as we
> are in State 2. So we don't need to check x25_t20timer_pending again.
> 
> Fixes: d023b2b9ccc2 ("net/x25: fix restart request/confirm handling")
> Cc: Martin Schiller 
> Signed-off-by: Xie He 

Applied, thanks.


Re: [PATCH net-next v2] net: hdlc_x25: Remove unnecessary skb_reset_network_header calls

2020-12-09 Thread David Miller
From: Xie He 
Date: Tue,  8 Dec 2020 17:40:13 -0800

> 1. In x25_xmit, skb_reset_network_header is not necessary before we call
> lapb_data_request. The lapb module doesn't need skb->network_header.
> So there is no need to set skb->network_header before calling
> lapb_data_request.
> 
> 2. In x25_data_indication (called by the lapb module after some data
> have been received), skb_reset_network_header is not necessary before we
> call netif_rx. After we call netif_rx, the code in net/core/dev.c will
> call skb_reset_network_header before handing the skb to upper layers
> (in __netif_receive_skb_core, called by __netif_receive_skb_one_core,
> called by __netif_receive_skb, called by process_backlog). So we don't
> need to call skb_reset_network_header by ourselves.
> 
> Cc: Martin Schiller 
> Signed-off-by: Xie He 

Applied, thanks.


Re: [PATCH v2 net-next] net/mlx4: simplify the return expression of mlx4_init_cq_table()

2020-12-09 Thread David Miller
From: Zheng Yongjun 
Date: Wed, 9 Dec 2020 09:20:02 +0800

> Simplify the return expression.
> 
> Signed-off-by: Zheng Yongjun 

Applied.


Re: [PATCH net-next] net: marvell: octeontx2: simplify the otx2_ptp_adjfine()

2020-12-09 Thread David Miller
From: Zheng Yongjun 
Date: Wed, 9 Dec 2020 17:27:26 +0800

> Simplify the return expression.
> 
> Signed-off-by: Zheng Yongjun 

Applied.


Re: [PATCH net-next] net: marvell: octeontx2: simplify the otx2_ptp_adjfine()

2020-12-09 Thread David Miller
From: Zheng Yongjun 
Date: Wed, 9 Dec 2020 17:27:26 +0800

> Simplify the return expression.
> 
> Signed-off-by: Zheng Yongjun 

Applied.


Re: [PATCH net-next] net: emulex: benet: simplify the return expression of be_if_create()

2020-12-09 Thread David Miller
From: Zheng Yongjun 
Date: Wed, 9 Dec 2020 17:19:57 +0800

> Simplify the return expression.
> 
> Signed-off-by: Zheng Yongjun 

Applied.


Re: [PATCH net-next] net: sja1105: simplify the return sja1105_cls_flower_stats()

2020-12-09 Thread David Miller
From: Zheng Yongjun 
Date: Wed, 9 Dec 2020 17:25:04 +0800

> Simplify the return expression.
> 
> Signed-off-by: Zheng Yongjun 

Applied.


Re: [PATCH net-next] net: stmmac: simplify the return dwmac5_rxp_disable()

2020-12-09 Thread David Miller
From: Zheng Yongjun 
Date: Wed, 9 Dec 2020 17:23:25 +0800

> Simplify the return expression.
> 
> Signed-off-by: Zheng Yongjun 

Applied.


Re: [PATCH net-next] net: dsa: simplify the return rtl8366_vlan_prepare()

2020-12-09 Thread David Miller
From: Zheng Yongjun 
Date: Wed, 9 Dec 2020 17:26:21 +0800

> Simplify the return expression.
> 
> Signed-off-by: Zheng Yongjun 

Applied.


Re: [PATCH net-next] net: hinic: simplify the return hinic_configure_max_qnum()

2020-12-09 Thread David Miller
From: Zheng Yongjun 
Date: Wed, 9 Dec 2020 17:22:41 +0800

> Simplify the return expression.
> 
> Signed-off-by: Zheng Yongjun 

Applied.


Re: [PATCH net-next] net: cisco: enic: simplify the return vnic_cq_alloc()

2020-12-09 Thread David Miller
From: Zheng Yongjun 
Date: Wed, 9 Dec 2020 17:20:31 +0800

> Simplify the return expression.
> 
> Signed-off-by: Zheng Yongjun 

Applied.


Re: [PATCH net-next] net: freescale: dpaa: simplify the return dpaa_eth_refill_bpools()

2020-12-09 Thread David Miller
From: Zheng Yongjun 
Date: Wed, 9 Dec 2020 17:21:07 +0800

> Simplify the return expression.
> 
> Signed-off-by: Zheng Yongjun 

Applied.


Re: [PATCH net-next] net: marvell: octeontx2: simplify the return expression of rvu_npa_init()

2020-12-09 Thread David Miller
From: Zheng Yongjun 
Date: Wed, 9 Dec 2020 17:18:44 +0800

> Simplify the return expression.
> 
> Signed-off-by: Zheng Yongjun 

Applied.


Re: [PATCH net-next] net: marvell: prestera: simplify the return expression of prestera_port_close()

2020-12-09 Thread David Miller
From: Zheng Yongjun 
Date: Wed, 9 Dec 2020 17:17:51 +0800

> Simplify the return expression.
> 
> Signed-off-by: Zheng Yongjun 

Applied.


Re: [PATCH v2 net-next 0/2] nfc: s3fwrn5: Change I2C interrupt trigger to EDGE_RISING

2020-12-09 Thread David Miller
From: Bongsu Jeon 
Date: Tue,  8 Dec 2020 23:10:10 +0900

> From: Bongsu Jeon 
> 
> For stable Samsung's I2C interrupt handling, I changed the interrupt 
> trigger from IRQ_TYPE_LEVEL_HIGH to IRQ_TYPE_EDGE_RISING and removed 
> the hard coded interrupt trigger type in the i2c module for the flexible 
> control.
> 
> 1/2 is the changed dt binding for the edge rising trigger.
> 2/2 is to remove the hard coded interrupt trigger type in the i2c module.
> 
> ChangeLog:
>  v2:
>   2/2
>- remove the hard coded interrupt trigger type.

Series applied, thanks.


Re: [PATCH net-next] net: mlx5: convert comma to semicolon

2020-12-09 Thread David Miller
From: Zheng Yongjun 
Date: Wed, 9 Dec 2020 21:34:41 +0800

> Replace a comma between expression statements by a semicolon.
> 
> Signed-off-by: Zheng Yongjun 

Applied.


Re: [PATCH net-next] hisilicon/hns3: convert comma to semicolon

2020-12-09 Thread David Miller
From: Zheng Yongjun 
Date: Wed, 9 Dec 2020 21:36:30 +0800

> Replace a comma between expression statements by a semicolon.
> 
> Signed-off-by: Zheng Yongjun 

Applied.


Re: [PATCH net-next] net: ipa: convert comma to semicolon

2020-12-09 Thread David Miller
From: Zheng Yongjun 
Date: Wed, 9 Dec 2020 21:40:03 +0800

> Replace a comma between expression statements by a semicolon.
> 
> Signed-off-by: Zheng Yongjun 

Applied.


Re: [PATCH net-next] net: thunderbolt: convert comma to semicolon

2020-12-09 Thread David Miller
From: Zheng Yongjun 
Date: Wed, 9 Dec 2020 21:38:52 +0800

> Replace a comma between expression statements by a semicolon.
> 
> Signed-off-by: Zheng Yongjun 

Applied.



Re: [PATCH net-next] net: mv88e6xxx: convert comma to semicolon

2020-12-09 Thread David Miller
From: Zheng Yongjun 
Date: Wed, 9 Dec 2020 21:39:38 +0800

> Replace a comma between expression statements by a semicolon.
> 
> Signed-off-by: Zheng Yongjun 

Applied.


Re: [PATCH net-next] net: usb: convert comma to semicolon

2020-12-09 Thread David Miller
From: Zheng Yongjun 
Date: Wed, 9 Dec 2020 21:38:11 +0800

> Replace a comma between expression statements by a semicolon.
> 
> Signed-off-by: Zheng Yongjun 

Applied.


Re: [PATCH net-next] net: ethernet: ti: convert comma to semicolon

2020-12-09 Thread David Miller
From: Zheng Yongjun 
Date: Wed, 9 Dec 2020 21:37:16 +0800

> Replace a comma between expression statements by a semicolon.
> 
> Signed-off-by: Zheng Yongjun 
Applied.


Re: [PATCH net-next] net: ethernet: ti: convert comma to semicolon

2020-12-09 Thread David Miller
From: Zheng Yongjun 
Date: Wed, 9 Dec 2020 21:37:16 +0800

> Replace a comma between expression statements by a semicolon.
> 
> Signed-off-by: Zheng Yongjun 

Applied.


Re: [PATCH net-next] net: freescale: convert comma to semicolon

2020-12-09 Thread David Miller
From: Zheng Yongjun 
Date: Wed, 9 Dec 2020 21:37:39 +0800

> Replace a comma between expression statements by a semicolon.
> 
> Signed-off-by: Zheng Yongjun 

Applied.


Re: [PATCH net-next] hisilicon/hns3: convert comma to semicolon

2020-12-09 Thread David Miller
From: Zheng Yongjun 
Date: Wed, 9 Dec 2020 21:36:30 +0800

> Replace a comma between expression statements by a semicolon.
> 
> Signed-off-by: Zheng Yongjun 

Applied.


Re: [PATCH net-next] hisilicon/hns: convert comma to semicolon

2020-12-09 Thread David Miller
From: Zheng Yongjun 
Date: Wed, 9 Dec 2020 21:35:31 +0800

> Replace a comma between expression statements by a semicolon.
> 
> Signed-off-by: Zheng Yongjun 

Applied.



Re: [PATCH net-next] net: mlx5: convert comma to semicolon

2020-12-09 Thread David Miller
From: Zheng Yongjun 
Date: Wed, 9 Dec 2020 21:34:41 +0800

> Replace a comma between expression statements by a semicolon.
> 
> Signed-off-by: Zheng Yongjun 

Applied.


Re: [PATCH net-next] net: rxrpc: convert comma to semicolon

2020-12-09 Thread David Miller
From: Zheng Yongjun 
Date: Wed, 9 Dec 2020 21:32:28 +0800

> Replace a comma between expression statements by a semicolon.
> 
> Signed-off-by: Zheng Yongjun 

Applied.


Re: [PATCH net-next] net: micrel: convert comma to semicolon

2020-12-09 Thread David Miller
From: Zheng Yongjun 
Date: Wed, 9 Dec 2020 21:34:02 +0800

> Replace a comma between expression statements by a semicolon.
> 
> Signed-off-by: Zheng Yongjun 

Applied.


Re: [PATCH net-next] net: ipv6: rpl_iptunnel: simplify the return expression of rpl_do_srh()

2020-12-08 Thread David Miller
From: Zheng Yongjun 
Date: Tue, 8 Dec 2020 20:09:49 +0800

> Simplify the return expression.
> 
> Signed-off-by: Zheng Yongjun 

Applied.


Re: [PATCH net-next] net: atheros: simplify the return expression of atl2_phy_setup_autoneg_adv()

2020-12-08 Thread David Miller
From: Zheng Yongjun 
Date: Tue, 8 Dec 2020 21:57:30 +0800

> Simplify the return expression.
> 
> Signed-off-by: Zheng Yongjun 

Applied.


Re: [PATCH net-next] net/mlx4: simplify the return expression of mlx4_init_cq_table()

2020-12-08 Thread David Miller
From: Zheng Yongjun 
Date: Tue, 8 Dec 2020 21:55:43 +0800

> Simplify the return expression.
> 
> Signed-off-by: Zheng Yongjun 

Applied.


Re: [PATCH net-next] net/mlx5: simplify the return expression of mlx5_esw_offloads_pair()

2020-12-08 Thread David Miller
From: Zheng Yongjun 
Date: Tue, 8 Dec 2020 21:56:25 +0800

> Simplify the return expression.
> 
> Signed-off-by: Zheng Yongjun 

Applied.



Re: [PATCH net-next] drivers: net: qlcnic: simplify the return expression of qlcnic_sriov_vf_shutdown()

2020-12-08 Thread David Miller
From: Zheng Yongjun 
Date: Tue, 8 Dec 2020 21:54:37 +0800

> Simplify the return expression.
> 
> Signed-off-by: Zheng Yongjun 

Applied.


Re: [PATCH net-next] net: openvswitch: conntrack: simplify the return expression of ovs_ct_limit_get_default_limit()

2020-12-08 Thread David Miller
From: Zheng Yongjun 
Date: Tue, 8 Dec 2020 20:13:53 +0800

> Simplify the return expression.
> 
> Signed-off-by: Zheng Yongjun 

Applied.


Re: [PATCH net-next] net: core: devlink: simplify the return expression of devlink_nl_cmd_trap_set_doit()

2020-12-08 Thread David Miller
From: Zheng Yongjun 
Date: Tue, 8 Dec 2020 20:10:46 +0800

> Simplify the return expression.
> 
> Signed-off-by: Zheng Yongjun 

Applied.


Re: [PATCH net-next] net/sched: cls_u32: simplify the return expression of u32_reoffload_knode()

2020-12-08 Thread David Miller
From: Zheng Yongjun 
Date: Tue, 8 Dec 2020 20:08:22 +0800

> Simplify the return expression.
> 
> Signed-off-by: Zheng Yongjun 

Applied


Re: [PATCH net-next] net: core: devlink: simplify the return expression of devlink_nl_cmd_trap_set_doit()

2020-12-08 Thread David Miller
From: Zheng Yongjun 
Date: Tue, 8 Dec 2020 20:10:46 +0800

> Simplify the return expression.
> 
> Signed-off-by: Zheng Yongjun 

Applied.


  1   2   3   4   5   6   7   8   9   10   >