Netdev List
 help / color / mirror / Atom feed
* [PATCH net] net: Use this_cpu_inc() to increment net->core_stats
From: Sebastian Andrzej Siewior @ 2022-04-21 14:00 UTC (permalink / raw)
  To: netdev
  Cc: Eric Dumazet, David S. Miller, Jakub Kicinski, Paolo Abeni,
	Thomas Gleixner, Peter Zijlstra

The macro dev_core_stats_##FIELD##_inc() disables preemption and invokes
netdev_core_stats_alloc() to return a per-CPU pointer.
netdev_core_stats_alloc() will allocate memory on its first invocation
which breaks on PREEMPT_RT because it requires non-atomic context for
memory allocation.

This can be avoided by enabling preemption in netdev_core_stats_alloc()
assuming the caller always disables preemption.

It might be better to replace local_inc() with this_cpu_inc() now that
dev_core_stats_##FIELD##_inc() gained a preempt-disable section and does
not rely on already disabled preemption. This results in less
instructions on x86-64:
local_inc:
|          incl %gs:__preempt_count(%rip)  # __preempt_count
|          movq    488(%rdi), %rax # _1->core_stats, _22
|          testq   %rax, %rax      # _22
|          je      .L585   #,
|          add %gs:this_cpu_off(%rip), %rax        # this_cpu_off, tcp_ptr__
|  .L586:
|          testq   %rax, %rax      # _27
|          je      .L587   #,
|          incq (%rax)            # _6->a.counter
|  .L587:
|          decl %gs:__preempt_count(%rip)  # __preempt_count

this_cpu_inc(), this patch:
|         movq    488(%rdi), %rax # _1->core_stats, _5
|         testq   %rax, %rax      # _5
|         je      .L591   #,
| .L585:
|         incq %gs:(%rax) # _18->rx_dropped

Use unsigned long as type for the counter. Use this_cpu_inc() to
increment the counter. Use a plain read of the counter.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 include/linux/netdevice.h | 17 +++++++----------
 net/core/dev.c            | 14 +++++---------
 2 files changed, 12 insertions(+), 19 deletions(-)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 59e27a2b7bf04..0009112b23767 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -199,10 +199,10 @@ struct net_device_stats {
  * Try to fit them in a single cache line, for dev_get_stats() sake.
  */
 struct net_device_core_stats {
-	local_t		rx_dropped;
-	local_t		tx_dropped;
-	local_t		rx_nohandler;
-} __aligned(4 * sizeof(local_t));
+	unsigned long	rx_dropped;
+	unsigned long	tx_dropped;
+	unsigned long	rx_nohandler;
+} __aligned(4 * sizeof(unsigned long));
 
 #include <linux/cache.h>
 #include <linux/skbuff.h>
@@ -3843,7 +3843,7 @@ static __always_inline bool __is_skb_forwardable(const struct net_device *dev,
 	return false;
 }
 
-struct net_device_core_stats *netdev_core_stats_alloc(struct net_device *dev);
+struct net_device_core_stats __percpu *netdev_core_stats_alloc(struct net_device *dev);
 
 static inline struct net_device_core_stats *dev_core_stats(struct net_device *dev)
 {
@@ -3851,7 +3851,7 @@ static inline struct net_device_core_stats *dev_core_stats(struct net_device *de
 	struct net_device_core_stats __percpu *p = READ_ONCE(dev->core_stats);
 
 	if (likely(p))
-		return this_cpu_ptr(p);
+		return p;
 
 	return netdev_core_stats_alloc(dev);
 }
@@ -3861,12 +3861,9 @@ static inline void dev_core_stats_##FIELD##_inc(struct net_device *dev)		\
 {										\
 	struct net_device_core_stats *p;					\
 										\
-	preempt_disable();							\
 	p = dev_core_stats(dev);						\
-										\
 	if (p)									\
-		local_inc(&p->FIELD);						\
-	preempt_enable();							\
+		this_cpu_inc(p->FIELD);						\
 }
 DEV_CORE_STATS_INC(rx_dropped)
 DEV_CORE_STATS_INC(tx_dropped)
diff --git a/net/core/dev.c b/net/core/dev.c
index 9ec51c1d77cf4..bf6026158874e 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -10309,7 +10309,7 @@ void netdev_stats_to_stats64(struct rtnl_link_stats64 *stats64,
 }
 EXPORT_SYMBOL(netdev_stats_to_stats64);
 
-struct net_device_core_stats *netdev_core_stats_alloc(struct net_device *dev)
+struct net_device_core_stats __percpu *netdev_core_stats_alloc(struct net_device *dev)
 {
 	struct net_device_core_stats __percpu *p;
 
@@ -10320,11 +10320,7 @@ struct net_device_core_stats *netdev_core_stats_alloc(struct net_device *dev)
 		free_percpu(p);
 
 	/* This READ_ONCE() pairs with the cmpxchg() above */
-	p = READ_ONCE(dev->core_stats);
-	if (!p)
-		return NULL;
-
-	return this_cpu_ptr(p);
+	return READ_ONCE(dev->core_stats);
 }
 EXPORT_SYMBOL(netdev_core_stats_alloc);
 
@@ -10361,9 +10357,9 @@ struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev,
 
 		for_each_possible_cpu(i) {
 			core_stats = per_cpu_ptr(p, i);
-			storage->rx_dropped += local_read(&core_stats->rx_dropped);
-			storage->tx_dropped += local_read(&core_stats->tx_dropped);
-			storage->rx_nohandler += local_read(&core_stats->rx_nohandler);
+			storage->rx_dropped += core_stats->rx_dropped;
+			storage->tx_dropped += core_stats->tx_dropped;
+			storage->rx_nohandler += core_stats->rx_nohandler;
 		}
 	}
 	return storage;
-- 
2.35.2


^ permalink raw reply related

* Re: [PATCH 2/5] hv_sock: Copy packets sent by Hyper-V out of the ring buffer
From: Stefano Garzarella @ 2022-04-21 13:58 UTC (permalink / raw)
  To: Andrea Parri (Microsoft)
  Cc: KY Srinivasan, Haiyang Zhang, Stephen Hemminger, Wei Liu,
	Dexuan Cui, Michael Kelley, David Miller, Jakub Kicinski,
	Paolo Abeni, linux-hyperv, virtualization, netdev, linux-kernel
In-Reply-To: <20220420200720.434717-3-parri.andrea@gmail.com>

On Wed, Apr 20, 2022 at 10:07:17PM +0200, Andrea Parri (Microsoft) wrote:
>Pointers to VMbus packets sent by Hyper-V are used by the hv_sock driver
>within the guest VM.  Hyper-V can send packets with erroneous values or
>modify packet fields after they are processed by the guest.  To defend
>against these scenarios, copy the incoming packet after validating its
>length and offset fields using hv_pkt_iter_{first,next}().  In this way,
>the packet can no longer be modified by the host.
>
>Signed-off-by: Andrea Parri (Microsoft) <parri.andrea@gmail.com>
>---
> net/vmw_vsock/hyperv_transport.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
>diff --git a/net/vmw_vsock/hyperv_transport.c b/net/vmw_vsock/hyperv_transport.c
>index 943352530936e..8c37d07017fc4 100644
>--- a/net/vmw_vsock/hyperv_transport.c
>+++ b/net/vmw_vsock/hyperv_transport.c
>@@ -78,6 +78,9 @@ struct hvs_send_buf {
> 					 ALIGN((payload_len), 8) + \
> 					 VMBUS_PKT_TRAILER_SIZE)
>
>+/* Upper bound on the size of a VMbus packet for hv_sock */
>+#define HVS_MAX_PKT_SIZE	HVS_PKT_LEN(HVS_MTU_SIZE)
>+
> union hvs_service_id {
> 	guid_t	srv_id;
>
>@@ -378,6 +381,8 @@ static void hvs_open_connection(struct vmbus_channel *chan)
> 		rcvbuf = ALIGN(rcvbuf, HV_HYP_PAGE_SIZE);
> 	}
>
>+	chan->max_pkt_size = HVS_MAX_PKT_SIZE;
>+

premise, I don't know HyperV channels :-(

Is this change necessary to use hv_pkt_iter_first() instead of 
hv_pkt_iter_first_raw()?

If yes, then please mention that you set this value in the commit 
message, otherwise maybe better to have a separate patch.

Thanks,
Stefano

> 	ret = vmbus_open(chan, sndbuf, rcvbuf, NULL, 0, hvs_channel_cb,
> 			 conn_from_host ? new : sk);
> 	if (ret != 0) {
>@@ -602,7 +607,7 @@ static ssize_t hvs_stream_dequeue(struct vsock_sock *vsk, struct msghdr *msg,
> 		return -EOPNOTSUPP;
>
> 	if (need_refill) {
>-		hvs->recv_desc = hv_pkt_iter_first_raw(hvs->chan);
>+		hvs->recv_desc = hv_pkt_iter_first(hvs->chan);
> 		if (!hvs->recv_desc)
> 			return -ENOBUFS;
> 		ret = hvs_update_recv_data(hvs);
>@@ -618,7 +623,7 @@ static ssize_t hvs_stream_dequeue(struct vsock_sock *vsk, struct msghdr *msg,
>
> 	hvs->recv_data_len -= to_read;
> 	if (hvs->recv_data_len == 0) {
>-		hvs->recv_desc = hv_pkt_iter_next_raw(hvs->chan, hvs->recv_desc);
>+		hvs->recv_desc = hv_pkt_iter_next(hvs->chan, hvs->recv_desc);
> 		if (hvs->recv_desc) {
> 			ret = hvs_update_recv_data(hvs);
> 			if (ret)
>-- 
>2.25.1
>


^ permalink raw reply

* Re: [PATCH v8 09/13] dt-bindings: mmc: imx-esdhc: Add i.MX8DXL compatible string
From: Ulf Hansson @ 2022-04-21 13:54 UTC (permalink / raw)
  To: Abel Vesa
  Cc: Rob Herring, Krzysztof Kozlowski, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	devicetree, Linux Kernel Mailing List, linux-mmc, netdev,
	linux-arm-kernel
In-Reply-To: <20220419113516.1827863-10-abel.vesa@nxp.com>

On Tue, 19 Apr 2022 at 13:35, Abel Vesa <abel.vesa@nxp.com> wrote:
>
> Add i.MX8DXL compatible string. It also needs "fsl,imx8qm-fec" compatible.
>
> Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
> Acked-by: Rob Herring <robh@kernel.org>

Applied for next, thanks!

Kind regards
Uffe


> ---
>  Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml b/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml
> index 58447095f000..29339d0196ec 100644
> --- a/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml
> +++ b/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml
> @@ -54,6 +54,7 @@ properties:
>            - const: fsl,imx8qxp-usdhc
>        - items:
>            - enum:
> +              - fsl,imx8dxl-usdhc
>                - fsl,imx8mm-usdhc
>                - fsl,imx8mn-usdhc
>                - fsl,imx8mp-usdhc
> --
> 2.34.1
>

^ permalink raw reply

* Re: [PATCH 1/5] hv_sock: Check hv_pkt_iter_first_raw()'s return value
From: Stefano Garzarella @ 2022-04-21 13:50 UTC (permalink / raw)
  To: Andrea Parri (Microsoft)
  Cc: KY Srinivasan, Haiyang Zhang, Stephen Hemminger, Wei Liu,
	Dexuan Cui, Michael Kelley, David Miller, Jakub Kicinski,
	Paolo Abeni, linux-hyperv, virtualization, netdev, linux-kernel
In-Reply-To: <20220420200720.434717-2-parri.andrea@gmail.com>

On Wed, Apr 20, 2022 at 10:07:16PM +0200, Andrea Parri (Microsoft) wrote:
>The function returns NULL if the ring buffer doesn't contain enough
>readable bytes to constitute a packet descriptor.  The ring buffer's
>write_index is in memory which is shared with the Hyper-V host, an
>erroneous or malicious host could thus change its value and overturn
>the result of hvs_stream_has_data().
>
>Signed-off-by: Andrea Parri (Microsoft) <parri.andrea@gmail.com>
>---
> net/vmw_vsock/hyperv_transport.c | 2 ++
> 1 file changed, 2 insertions(+)
>
>diff --git a/net/vmw_vsock/hyperv_transport.c b/net/vmw_vsock/hyperv_transport.c
>index e111e13b66604..943352530936e 100644
>--- a/net/vmw_vsock/hyperv_transport.c
>+++ b/net/vmw_vsock/hyperv_transport.c
>@@ -603,6 +603,8 @@ static ssize_t hvs_stream_dequeue(struct vsock_sock *vsk, struct msghdr *msg,
>
> 	if (need_refill) {
> 		hvs->recv_desc = hv_pkt_iter_first_raw(hvs->chan);
>+		if (!hvs->recv_desc)
>+			return -ENOBUFS;
> 		ret = hvs_update_recv_data(hvs);
> 		if (ret)
> 			return ret;
>-- 
>2.25.1
>

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>


^ permalink raw reply

* [PATCH net 2/2] wireguard: device: check for metadata_dst with skb_valid_dst()
From: Jason A. Donenfeld @ 2022-04-21 13:48 UTC (permalink / raw)
  To: netdev, davem, kuba
  Cc: Nikolay Aleksandrov, stable, Martynas Pumputis, Daniel Borkmann,
	Jason A . Donenfeld
In-Reply-To: <20220421134805.279118-1-Jason@zx2c4.com>

From: Nikolay Aleksandrov <razor@blackwall.org>

When we try to transmit an skb with md_dst attached through wireguard
we hit a null pointer dereference in wg_xmit() due to the use of
dst_mtu() which calls into dst_blackhole_mtu() which in turn tries to
dereference dst->dev.

Since wireguard doesn't use md_dsts we should use skb_valid_dst(), which
checks for DST_METADATA flag, and if it's set, then falls back to
wireguard's device mtu. That gives us the best chance of transmitting
the packet; otherwise if the blackhole netdev is used we'd get
ETH_MIN_MTU.

 [  263.693506] BUG: kernel NULL pointer dereference, address: 00000000000000e0
 [  263.693908] #PF: supervisor read access in kernel mode
 [  263.694174] #PF: error_code(0x0000) - not-present page
 [  263.694424] PGD 0 P4D 0
 [  263.694653] Oops: 0000 [#1] PREEMPT SMP NOPTI
 [  263.694876] CPU: 5 PID: 951 Comm: mausezahn Kdump: loaded Not tainted 5.18.0-rc1+ #522
 [  263.695190] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1.fc35 04/01/2014
 [  263.695529] RIP: 0010:dst_blackhole_mtu+0x17/0x20
 [  263.695770] Code: 00 00 00 0f 1f 44 00 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 8b 47 10 48 83 e0 fc 8b 40 04 85 c0 75 09 48 8b 07 <8b> 80 e0 00 00 00 c3 66 90 0f 1f 44 00 00 48 89 d7 be 01 00 00 00
 [  263.696339] RSP: 0018:ffffa4a4422fbb28 EFLAGS: 00010246
 [  263.696600] RAX: 0000000000000000 RBX: ffff8ac9c3553000 RCX: 0000000000000000
 [  263.696891] RDX: 0000000000000401 RSI: 00000000fffffe01 RDI: ffffc4a43fb48900
 [  263.697178] RBP: ffffa4a4422fbb90 R08: ffffffff9622635e R09: 0000000000000002
 [  263.697469] R10: ffffffff9b69a6c0 R11: ffffa4a4422fbd0c R12: ffff8ac9d18b1a00
 [  263.697766] R13: ffff8ac9d0ce1840 R14: ffff8ac9d18b1a00 R15: ffff8ac9c3553000
 [  263.698054] FS:  00007f3704c337c0(0000) GS:ffff8acaebf40000(0000) knlGS:0000000000000000
 [  263.698470] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
 [  263.698826] CR2: 00000000000000e0 CR3: 0000000117a5c000 CR4: 00000000000006e0
 [  263.699214] Call Trace:
 [  263.699505]  <TASK>
 [  263.699759]  wg_xmit+0x411/0x450
 [  263.700059]  ? bpf_skb_set_tunnel_key+0x46/0x2d0
 [   263.700382]  ? dev_queue_xmit_nit+0x31/0x2b0
 [  263.700719]  dev_hard_start_xmit+0xd9/0x220
 [  263.701047]  __dev_queue_xmit+0x8b9/0xd30
 [  263.701344]  __bpf_redirect+0x1a4/0x380
 [  263.701664]  __dev_queue_xmit+0x83b/0xd30
 [  263.701961]  ? packet_parse_headers+0xb4/0xf0
 [  263.702275]  packet_sendmsg+0x9a8/0x16a0
 [  263.702596]  ? _raw_spin_unlock_irqrestore+0x23/0x40
 [  263.702933]  sock_sendmsg+0x5e/0x60
 [  263.703239]  __sys_sendto+0xf0/0x160
 [  263.703549]  __x64_sys_sendto+0x20/0x30
 [  263.703853]  do_syscall_64+0x3b/0x90
 [  263.704162]  entry_SYSCALL_64_after_hwframe+0x44/0xae
 [  263.704494] RIP: 0033:0x7f3704d50506
 [  263.704789] Code: 48 c7 c0 ff ff ff ff eb b7 66 2e 0f 1f 84 00 00 00 00 00 90 41 89 ca 64 8b 04 25 18 00 00 00 85 c0 75 11 b8 2c 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 72 c3 90 55 48 83 ec 30 44 89 4c 24 2c 4c 89
 [  263.705652] RSP: 002b:00007ffe954b0b88 EFLAGS: 00000246 ORIG_RAX: 000000000000002c
 [  263.706141] RAX: ffffffffffffffda RBX: 0000558bb259b490 RCX: 00007f3704d50506
 [  263.706544] RDX: 000000000000004a RSI: 0000558bb259b7b2 RDI: 0000000000000003
 [  263.706952] RBP: 0000000000000000 R08: 00007ffe954b0b90 R09: 0000000000000014
 [  263.707339] R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffe954b0b90
 [  263.707735] R13: 000000000000004a R14: 0000558bb259b7b2 R15: 0000000000000001
 [  263.708132]  </TASK>
 [  263.708398] Modules linked in: bridge netconsole bonding [last unloaded: bridge]
 [  263.708942] CR2: 00000000000000e0

Cc: stable@vger.kernel.org
Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
Link: https://github.com/cilium/cilium/issues/19428
Reported-by: Martynas Pumputis <m@lambda.lt>
Signed-off-by: Nikolay Aleksandrov <razor@blackwall.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
 drivers/net/wireguard/device.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireguard/device.c b/drivers/net/wireguard/device.c
index 0fad1331303c..aa9a7a5970fd 100644
--- a/drivers/net/wireguard/device.c
+++ b/drivers/net/wireguard/device.c
@@ -19,6 +19,7 @@
 #include <linux/if_arp.h>
 #include <linux/icmp.h>
 #include <linux/suspend.h>
+#include <net/dst_metadata.h>
 #include <net/icmp.h>
 #include <net/rtnetlink.h>
 #include <net/ip_tunnels.h>
@@ -167,7 +168,7 @@ static netdev_tx_t wg_xmit(struct sk_buff *skb, struct net_device *dev)
 		goto err_peer;
 	}
 
-	mtu = skb_dst(skb) ? dst_mtu(skb_dst(skb)) : dev->mtu;
+	mtu = skb_valid_dst(skb) ? dst_mtu(skb_dst(skb)) : dev->mtu;
 
 	__skb_queue_head_init(&packets);
 	if (!skb_is_gso(skb)) {
-- 
2.35.1


^ permalink raw reply related

* [PATCH net 1/2] wireguard: selftests: enable ACPI for SMP
From: Jason A. Donenfeld @ 2022-04-21 13:48 UTC (permalink / raw)
  To: netdev, davem, kuba; +Cc: Jason A. Donenfeld
In-Reply-To: <20220421134805.279118-1-Jason@zx2c4.com>

It turns out that by having CONFIG_ACPI=n, we've been failing to boot
additional CPUs, and so these systems were functionally UP. The code
bloat is unfortunate for build times, but I don't see an alternative. So
this commit sets CONFIG_ACPI=y for x86_64 and i686 configs.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
 tools/testing/selftests/wireguard/qemu/arch/i686.config   | 1 +
 tools/testing/selftests/wireguard/qemu/arch/x86_64.config | 1 +
 2 files changed, 2 insertions(+)

diff --git a/tools/testing/selftests/wireguard/qemu/arch/i686.config b/tools/testing/selftests/wireguard/qemu/arch/i686.config
index a85025d7206e..a9b4fe795048 100644
--- a/tools/testing/selftests/wireguard/qemu/arch/i686.config
+++ b/tools/testing/selftests/wireguard/qemu/arch/i686.config
@@ -1,3 +1,4 @@
+CONFIG_ACPI=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_CMDLINE_BOOL=y
diff --git a/tools/testing/selftests/wireguard/qemu/arch/x86_64.config b/tools/testing/selftests/wireguard/qemu/arch/x86_64.config
index 00a1ef4869d5..45dd53a0d760 100644
--- a/tools/testing/selftests/wireguard/qemu/arch/x86_64.config
+++ b/tools/testing/selftests/wireguard/qemu/arch/x86_64.config
@@ -1,3 +1,4 @@
+CONFIG_ACPI=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_CMDLINE_BOOL=y
-- 
2.35.1


^ permalink raw reply related

* [PATCH net 0/2] wireguard patches for 5.18-rc4
From: Jason A. Donenfeld @ 2022-04-21 13:48 UTC (permalink / raw)
  To: netdev, davem, kuba; +Cc: Jason A. Donenfeld

Hi Davekub,

Here are two small wireguard fixes for 5.18-rc4:

1) We enable ACPI in the QEMU test harness, so that multiple CPUs are
   actually used on x86 for testing for races.

2) Sending skbs with metadata dsts attached resulted in a null pointer
   dereference, triggerable from executing eBPF programs. The fix is a
   oneliner, changing a skb_dst() null check into a skb_valid_dst()
   boolean check.

Thanks,
Jason


Jason A. Donenfeld (1):
  wireguard: selftests: enable ACPI for SMP

Nikolay Aleksandrov (1):
  wireguard: device: check for metadata_dst with skb_valid_dst()

 drivers/net/wireguard/device.c                            | 3 ++-
 tools/testing/selftests/wireguard/qemu/arch/i686.config   | 1 +
 tools/testing/selftests/wireguard/qemu/arch/x86_64.config | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

-- 
2.35.1


^ permalink raw reply

* [PATCH] ethernet: broadcom/sb1250-mac: remove BUG_ON in sbmac_probe()
From: Yang Yingliang @ 2022-04-21 13:51 UTC (permalink / raw)
  To: linux-kernel, netdev; +Cc: davem, kuba

Replace the BUG_ON() with returning error code to handle
the fault more gracefully.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/net/ethernet/broadcom/sb1250-mac.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/sb1250-mac.c b/drivers/net/ethernet/broadcom/sb1250-mac.c
index a1a38456c9a3..5d5f10180158 100644
--- a/drivers/net/ethernet/broadcom/sb1250-mac.c
+++ b/drivers/net/ethernet/broadcom/sb1250-mac.c
@@ -2534,7 +2534,12 @@ static int sbmac_probe(struct platform_device *pldev)
 	int err;
 
 	res = platform_get_resource(pldev, IORESOURCE_MEM, 0);
-	BUG_ON(!res);
+	if (!res) {
+		printk(KERN_ERR "%s: failed to get resource\n",
+		       dev_name(&pldev->dev));
+		err = -EINVAL;
+		goto out_out;
+	}
 	sbm_base = ioremap(res->start, resource_size(res));
 	if (!sbm_base) {
 		printk(KERN_ERR "%s: unable to map device registers\n",
-- 
2.25.1


^ permalink raw reply related

* RE: Ethernet TX buffer crossing 4K boundary?
From: David Laight @ 2022-04-21 13:39 UTC (permalink / raw)
  To: 'Andrew Lunn', Joakim Tjernlund
  Cc: netdev@vger.kernel.org, Eric Gratorp
In-Reply-To: <YmFO431VWIR7e2hi@lunn.ch>

From: Andrew Lunn
> Sent: 21 April 2022 13:33
> 
> On Wed, Apr 20, 2022 at 09:09:58PM +0000, Joakim Tjernlund wrote:
> > We have this custom Ethernet controller that cannot DMA a buffer if the buffer crosses 4K boundary.

Fix the hardware :-)

> > Any ideas how to deal with that limitation in the driver?
> 
> Does the DMA support scatter gather? You might be able to tweak the
> generic scatter gather code to generate two blocks if it crosses the
> boundary.

I'd also look at the USB3 xhci code.
That also has a perverse set of restrictions on buffer alignment.
Might give you some hints.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


^ permalink raw reply

* Re: [PATCH v2 3/3] ARM: dts: imx6qdl-sr-som: update phy configuration for som revision 1.9
From: Andrew Lunn @ 2022-04-21 13:30 UTC (permalink / raw)
  To: Russell King (Oracle)
  Cc: Josua Mayer, netdev, alvaro.karsz, Rob Herring,
	Krzysztof Kozlowski, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team
In-Reply-To: <YmFWFzYz/iV4t2cW@shell.armlinux.org.uk>

> The only other ways around this that I can see would be to have some
> way to flag in DT that the PHYs are "optional" - if they're not found
> while probing the hardware, then don't whinge about them. Or have
> u-boot discover which address the PHY is located, and update the DT
> blob passed to the kernel to disable the PHY addresses that aren't
> present. Or edit the DT to update the node name and reg property. Or
> something along those lines.

uboot sounds like the best option. I don't know if we currently
support the status property for PHYs. Maybe the .dtsi file should have
them all status = "disabled"; and uboot can flip the populated ones to
"okay". Or maybe the other way around to handle older bootloaders.

	Andrew

^ permalink raw reply

* Re: [PATCH V2] octeontx2-pf: Add support for adaptive interrupt coalescing
From: Paolo Abeni @ 2022-04-21 13:27 UTC (permalink / raw)
  To: Suman Ghosh, davem, kuba, sgoutham, netdev
In-Reply-To: <20220418110205.282193-1-sumang@marvell.com>

On Mon, 2022-04-18 at 16:32 +0530, Suman Ghosh wrote:
> Added support for adaptive IRQ coalescing. It uses net_dim
> algorithm to find the suitable delay/IRQ count based on the
> current packet rate.
> 
> Signed-off-by: Suman Ghosh <sumang@marvell.com>
> Reviewed-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
> ---
> Changes since V1
> - No change, resubmitting because V1 did not get picked up in patchworks
>   for some reason.
> 
>  .../net/ethernet/marvell/octeontx2/Kconfig    |  1 +
>  .../marvell/octeontx2/nic/otx2_common.c       |  5 ---
>  .../marvell/octeontx2/nic/otx2_common.h       | 10 +++++
>  .../marvell/octeontx2/nic/otx2_ethtool.c      | 43 ++++++++++++++++---
>  .../ethernet/marvell/octeontx2/nic/otx2_pf.c  | 22 ++++++++++
>  .../marvell/octeontx2/nic/otx2_txrx.c         | 28 ++++++++++++
>  .../marvell/octeontx2/nic/otx2_txrx.h         |  1 +
>  7 files changed, 99 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/net/ethernet/marvell/octeontx2/Kconfig b/drivers/net/ethernet/marvell/octeontx2/Kconfig
> index 8560f7e463d3..a544733152d8 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/Kconfig
> +++ b/drivers/net/ethernet/marvell/octeontx2/Kconfig
> @@ -30,6 +30,7 @@ config OCTEONTX2_PF
>  	tristate "Marvell OcteonTX2 NIC Physical Function driver"
>  	select OCTEONTX2_MBOX
>  	select NET_DEVLINK
> +	select DIMLIB
>  	depends on PCI
>  	help
>  	  This driver supports Marvell's OcteonTX2 Resource Virtualization
> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
> index 033fd79d35b0..c28850d815c2 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
> @@ -103,11 +103,6 @@ void otx2_get_dev_stats(struct otx2_nic *pfvf)
>  {
>  	struct otx2_dev_stats *dev_stats = &pfvf->hw.dev_stats;
>  
> -#define OTX2_GET_RX_STATS(reg) \
> -	 otx2_read64(pfvf, NIX_LF_RX_STATX(reg))
> -#define OTX2_GET_TX_STATS(reg) \
> -	 otx2_read64(pfvf, NIX_LF_TX_STATX(reg))
> -
>  	dev_stats->rx_bytes = OTX2_GET_RX_STATS(RX_OCTS);
>  	dev_stats->rx_drops = OTX2_GET_RX_STATS(RX_DROP);
>  	dev_stats->rx_bcast_frames = OTX2_GET_RX_STATS(RX_BCAST);
> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h
> index d9f4b085b2a4..6abf5c28921f 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h
> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h
> @@ -16,6 +16,7 @@
>  #include <net/pkt_cls.h>
>  #include <net/devlink.h>
>  #include <linux/time64.h>
> +#include <linux/dim.h>
>  
>  #include <mbox.h>
>  #include <npc.h>
> @@ -54,6 +55,11 @@ enum arua_mapped_qtypes {
>  /* Send skid of 2000 packets required for CQ size of 4K CQEs. */
>  #define SEND_CQ_SKID	2000
>  
> +#define OTX2_GET_RX_STATS(reg) \
> +	 otx2_read64(pfvf, NIX_LF_RX_STATX(reg))
> +#define OTX2_GET_TX_STATS(reg) \
> +	 otx2_read64(pfvf, NIX_LF_TX_STATX(reg))
> +
>  struct otx2_lmt_info {
>  	u64 lmt_addr;
>  	u16 lmt_id;
> @@ -363,6 +369,7 @@ struct otx2_nic {
>  #define OTX2_FLAG_TC_MATCHALL_INGRESS_ENABLED	BIT_ULL(13)
>  #define OTX2_FLAG_DMACFLTR_SUPPORT		BIT_ULL(14)
>  #define OTX2_FLAG_PTP_ONESTEP_SYNC		BIT_ULL(15)
> +#define OTX2_FLAG_ADPTV_INT_COAL_ENABLED	BIT_ULL(16)
>  	u64			flags;
>  	u64			*cq_op_addr;
>  
> @@ -442,6 +449,9 @@ struct otx2_nic {
>  #endif
>  	/* qos */
>  	struct otx2_qos		qos;
> +
> +	/* napi event count. It is needed for adaptive irq coalescing */
> +	u32 napi_events;
>  };
>  
>  static inline bool is_otx2_lbkvf(struct pci_dev *pdev)
> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c
> index 72d0b02da3cc..8ed282991f05 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c
> @@ -477,6 +477,14 @@ static int otx2_get_coalesce(struct net_device *netdev,
>  	cmd->rx_max_coalesced_frames = hw->cq_ecount_wait;
>  	cmd->tx_coalesce_usecs = hw->cq_time_wait;
>  	cmd->tx_max_coalesced_frames = hw->cq_ecount_wait;
> +	if ((pfvf->flags & OTX2_FLAG_ADPTV_INT_COAL_ENABLED) ==
> +		OTX2_FLAG_ADPTV_INT_COAL_ENABLED) {
> +		cmd->use_adaptive_rx_coalesce = 1;
> +		cmd->use_adaptive_tx_coalesce = 1;
> +	} else {
> +		cmd->use_adaptive_rx_coalesce = 0;
> +		cmd->use_adaptive_tx_coalesce = 0;
> +	}
>  
>  	return 0;
>  }
> @@ -486,10 +494,10 @@ static int otx2_set_coalesce(struct net_device *netdev,
>  {
>  	struct otx2_nic *pfvf = netdev_priv(netdev);
>  	struct otx2_hw *hw = &pfvf->hw;
> +	u8 priv_coalesce_status;
>  	int qidx;
>  
> -	if (ec->use_adaptive_rx_coalesce || ec->use_adaptive_tx_coalesce ||
> -	    ec->rx_coalesce_usecs_irq || ec->rx_max_coalesced_frames_irq ||
> +	if (ec->rx_coalesce_usecs_irq || ec->rx_max_coalesced_frames_irq ||
>  	    ec->tx_coalesce_usecs_irq || ec->tx_max_coalesced_frames_irq ||
>  	    ec->stats_block_coalesce_usecs || ec->pkt_rate_low ||
>  	    ec->rx_coalesce_usecs_low || ec->rx_max_coalesced_frames_low ||
> @@ -502,6 +510,18 @@ static int otx2_set_coalesce(struct net_device *netdev,
>  	if (!ec->rx_max_coalesced_frames || !ec->tx_max_coalesced_frames)
>  		return 0;
>  
> +	/* Check and update coalesce status */
> +	if ((pfvf->flags & OTX2_FLAG_ADPTV_INT_COAL_ENABLED) ==
> +	    OTX2_FLAG_ADPTV_INT_COAL_ENABLED) {
> +		priv_coalesce_status = 1;
> +		if (!ec->use_adaptive_rx_coalesce || !ec->use_adaptive_tx_coalesce)
> +			pfvf->flags &= ~OTX2_FLAG_ADPTV_INT_COAL_ENABLED;
> +	} else {
> +		priv_coalesce_status = 0;
> +		if (ec->use_adaptive_rx_coalesce || ec->use_adaptive_tx_coalesce)
> +			pfvf->flags |= OTX2_FLAG_ADPTV_INT_COAL_ENABLED;
> +	}
> +
>  	/* 'cq_time_wait' is 8bit and is in multiple of 100ns,
>  	 * so clamp the user given value to the range of 1 to 25usec.
>  	 */
> @@ -521,13 +541,13 @@ static int otx2_set_coalesce(struct net_device *netdev,
>  		hw->cq_time_wait = min_t(u8, ec->rx_coalesce_usecs,
>  					 ec->tx_coalesce_usecs);
>  
> -	/* Max ecount_wait supported is 16bit,
> -	 * so clamp the user given value to the range of 1 to 64k.
> +	/* Max packet budget per napi is 64,
> +	 * so clamp the user given value to the range of 1 to 64.
>  	 */
>  	ec->rx_max_coalesced_frames = clamp_t(u32, ec->rx_max_coalesced_frames,
> -					      1, U16_MAX);
> +					      1, NAPI_POLL_WEIGHT);
>  	ec->tx_max_coalesced_frames = clamp_t(u32, ec->tx_max_coalesced_frames,
> -					      1, U16_MAX);
> +					      1, NAPI_POLL_WEIGHT);
>  
>  	/* Rx and Tx are mapped to same CQ, check which one
>  	 * is changed, if both then choose the min.
> @@ -540,6 +560,17 @@ static int otx2_set_coalesce(struct net_device *netdev,
>  		hw->cq_ecount_wait = min_t(u16, ec->rx_max_coalesced_frames,
>  					   ec->tx_max_coalesced_frames);
>  
> +	/* Reset 'cq_time_wait' and 'cq_ecount_wait' to
> +	 * default values if coalesce status changed from
> +	 * 'on' to 'off'.
> +	 */
> +	if (priv_coalesce_status &&
> +	    ((pfvf->flags & OTX2_FLAG_ADPTV_INT_COAL_ENABLED) !=
> +	    OTX2_FLAG_ADPTV_INT_COAL_ENABLED)) {
> +		hw->cq_time_wait = CQ_TIMER_THRESH_DEFAULT;
> +		hw->cq_ecount_wait = CQ_CQE_THRESH_DEFAULT;
> +	}
> +
>  	if (netif_running(netdev)) {
>  		for (qidx = 0; qidx < pfvf->hw.cint_cnt; qidx++)
>  			otx2_config_irq_coalescing(pfvf, qidx);
> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
> index f18c9a9a50d0..94aaafbeb365 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
> @@ -1279,6 +1279,7 @@ static irqreturn_t otx2_cq_intr_handler(int irq, void *cq_irq)
>  	otx2_write64(pf, NIX_LF_CINTX_ENA_W1C(qidx), BIT_ULL(0));
>  
>  	/* Schedule NAPI */
> +	pf->napi_events++;
>  	napi_schedule_irqoff(&cq_poll->napi);
>  
>  	return IRQ_HANDLED;
> @@ -1292,6 +1293,7 @@ static void otx2_disable_napi(struct otx2_nic *pf)
>  
>  	for (qidx = 0; qidx < pf->hw.cint_cnt; qidx++) {
>  		cq_poll = &qset->napi[qidx];
> +		cancel_work_sync(&cq_poll->dim.work);
>  		napi_disable(&cq_poll->napi);
>  		netif_napi_del(&cq_poll->napi);
>  	}
> @@ -1538,6 +1540,24 @@ static void otx2_free_hw_resources(struct otx2_nic *pf)
>  	mutex_unlock(&mbox->lock);
>  }
>  
> +static void otx2_dim_work(struct work_struct *w)
> +{
> +	struct dim_cq_moder cur_moder;
> +	struct otx2_cq_poll *cq_poll;
> +	struct otx2_nic *pfvf;
> +	struct dim *dim;
> +
> +	dim = container_of(w, struct dim, work);
> +	cur_moder = net_dim_get_rx_moderation(dim->mode, dim->profile_ix);
> +	cq_poll = container_of(dim, struct otx2_cq_poll, dim);
> +	pfvf = (struct otx2_nic *)cq_poll->dev;
> +	pfvf->hw.cq_time_wait = (cur_moder.usec > CQ_TIMER_THRESH_MAX) ?
> +				CQ_TIMER_THRESH_MAX : cur_moder.usec;
> +	pfvf->hw.cq_ecount_wait = (cur_moder.pkts > NAPI_POLL_WEIGHT) ?
> +				NAPI_POLL_WEIGHT : cur_moder.pkts;
> +	dim->state = DIM_START_MEASURE;
> +}
> +
>  int otx2_open(struct net_device *netdev)
>  {
>  	struct otx2_nic *pf = netdev_priv(netdev);
> @@ -1611,6 +1631,8 @@ int otx2_open(struct net_device *netdev)
>  					  CINT_INVALID_CQ;
>  
>  		cq_poll->dev = (void *)pf;
> +		cq_poll->dim.mode = DIM_CQ_PERIOD_MODE_START_FROM_CQE;
> +		INIT_WORK(&cq_poll->dim.work, otx2_dim_work);
>  		netif_napi_add(netdev, &cq_poll->napi,
>  			       otx2_napi_handler, NAPI_POLL_WEIGHT);
>  		napi_enable(&cq_poll->napi);
> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
> index 459b94b99ddb..927dd12b4f4e 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
> @@ -512,6 +512,22 @@ static int otx2_tx_napi_handler(struct otx2_nic *pfvf,
>  	return 0;
>  }
>  
> +static void otx2_adjust_adaptive_coalese(struct otx2_nic *pfvf, struct otx2_cq_poll *cq_poll)
> +{
> +	struct dim_sample dim_sample;
> +	u64 rx_frames, rx_bytes;
> +
> +	rx_frames = OTX2_GET_RX_STATS(RX_BCAST) + OTX2_GET_RX_STATS(RX_MCAST) +
> +			OTX2_GET_RX_STATS(RX_UCAST);
> +	rx_bytes = OTX2_GET_RX_STATS(RX_OCTS);
> +	dim_update_sample(pfvf->napi_events,
> +			  rx_frames,
> +			  rx_bytes,
> +			  &dim_sample);
> +
> +	net_dim(&cq_poll->dim, dim_sample);
> +}
> +
>  int otx2_napi_handler(struct napi_struct *napi, int budget)
>  {
>  	struct otx2_cq_queue *rx_cq = NULL;
> @@ -549,6 +565,18 @@ int otx2_napi_handler(struct napi_struct *napi, int budget)
>  		if (pfvf->flags & OTX2_FLAG_INTF_DOWN)
>  			return workdone;
>  
> +		/* Check for adaptive interrupt coalesce */
> +		if (workdone != 0 &&
> +		    ((pfvf->flags & OTX2_FLAG_ADPTV_INT_COAL_ENABLED) ==
> +		    OTX2_FLAG_ADPTV_INT_COAL_ENABLED)) {
> +			/* Adjust irq coalese using net_dim */
> +			otx2_adjust_adaptive_coalese(pfvf, cq_poll);
> +
> +			/* Update irq coalescing */
> +			for (i = 0; i < pfvf->hw.cint_cnt; i++)
> +				otx2_config_irq_coalescing(pfvf, i);
> +		}
> +

Why are you updating the IRQ coalescing parameters for every sample?
You probably should to that in void otx2_dim_work(), when dim tells
it's the right time to update them.

Thanks,

Paolo


^ permalink raw reply

* [PATCH bpf-next] selftests/bpf: fix prog_tests/uprobe_autoattach compilation error
From: Artem Savkov @ 2022-04-21 13:23 UTC (permalink / raw)
  To: Alan Maguire
  Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, bpf, netdev,
	linux-kernel, linux-kselftest, Artem Savkov

I am getting the following compilation error for prog_tests/uprobe_autoattach.c

tools/testing/selftests/bpf/prog_tests/uprobe_autoattach.c: In function ‘test_uprobe_autoattach’:
./test_progs.h:209:26: error: pointer ‘mem’ may be used after ‘free’ [-Werror=use-after-free]

mem variable is now used in one of the asserts so it shouldn't be freed right
away. Move free(mem) after the assert block.

Fixes: 1717e248014c ("selftests/bpf: Uprobe tests should verify param/return values")
Signed-off-by: Artem Savkov <asavkov@redhat.com>
---
 tools/testing/selftests/bpf/prog_tests/uprobe_autoattach.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/bpf/prog_tests/uprobe_autoattach.c b/tools/testing/selftests/bpf/prog_tests/uprobe_autoattach.c
index d6003dc8cc99..35b87c7ba5be 100644
--- a/tools/testing/selftests/bpf/prog_tests/uprobe_autoattach.c
+++ b/tools/testing/selftests/bpf/prog_tests/uprobe_autoattach.c
@@ -34,7 +34,6 @@ void test_uprobe_autoattach(void)
 
 	/* trigger & validate shared library u[ret]probes attached by name */
 	mem = malloc(malloc_sz);
-	free(mem);
 
 	ASSERT_EQ(skel->bss->uprobe_byname_parm1, trigger_val, "check_uprobe_byname_parm1");
 	ASSERT_EQ(skel->bss->uprobe_byname_ran, 1, "check_uprobe_byname_ran");
@@ -44,6 +43,8 @@ void test_uprobe_autoattach(void)
 	ASSERT_EQ(skel->bss->uprobe_byname2_ran, 3, "check_uprobe_byname2_ran");
 	ASSERT_EQ(skel->bss->uretprobe_byname2_rc, mem, "check_uretprobe_byname2_rc");
 	ASSERT_EQ(skel->bss->uretprobe_byname2_ran, 4, "check_uretprobe_byname2_ran");
+
+	free(mem);
 cleanup:
 	test_uprobe_autoattach__destroy(skel);
 }
-- 
2.35.1


^ permalink raw reply related

* [PATCH bpf-next 2/2] i40e: xsk: get rid of redundant 'fallthrough'
From: Maciej Fijalkowski @ 2022-04-21 13:21 UTC (permalink / raw)
  To: bpf, ast, daniel, sfr, andrii
  Cc: netdev, magnus.karlsson, linux-next, Maciej Fijalkowski
In-Reply-To: <20220421132126.471515-1-maciej.fijalkowski@intel.com>

Intel drivers translate actions returned from XDP programs to their own
return codes that have the following mapping:

XDP_REDIRECT -> I40E_XDP_{REDIR,CONSUMED}
XDP_TX -> I40E_XDP_{TX,CONSUMED}
XDP_DROP -> I40E_XDP_CONSUMED
XDP_ABORTED -> I40E_XDP_CONSUMED
XDP_PASS -> I40E_XDP_PASS

Commit b8aef650e549 ("i40e, xsk: Terminate Rx side of NAPI when XSK Rx
queue gets full") introduced new translation

XDP_REDIRECT -> I40E_XDP_EXIT

which is set when XSK RQ gets full and to indicate that driver should
stop further Rx processing. This happens for unsuccessful
xdp_do_redirect() so it is valuable to call trace_xdp_exception() for
this case. In order to avoid I40E_XDP_EXIT -> IXGBE_XDP_CONSUMED
overwrite, XDP_DROP case was moved above which in turn made the
'fallthrough' that is in XDP_ABORTED useless as it became the last label
in the switch statement.

Simply drop this leftover.

Fixes: b8aef650e549 ("i40e, xsk: Terminate Rx side of NAPI when XSK Rx queue gets full")
Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_xsk.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_xsk.c b/drivers/net/ethernet/intel/i40e/i40e_xsk.c
index 050280fd10c1..af3e7e6afc85 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_xsk.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_xsk.c
@@ -189,7 +189,6 @@ static int i40e_run_xdp_zc(struct i40e_ring *rx_ring, struct xdp_buff *xdp)
 		result = I40E_XDP_CONSUMED;
 out_failure:
 		trace_xdp_exception(rx_ring->netdev, xdp_prog, act);
-		fallthrough; /* handle aborts by dropping packet */
 	}
 	return result;
 }
-- 
2.27.0


^ permalink raw reply related

* [PATCH bpf-next 1/2] ixgbe: xsk: get rid of redundant 'fallthrough'
From: Maciej Fijalkowski @ 2022-04-21 13:21 UTC (permalink / raw)
  To: bpf, ast, daniel, sfr, andrii
  Cc: netdev, magnus.karlsson, linux-next, Maciej Fijalkowski
In-Reply-To: <20220421132126.471515-1-maciej.fijalkowski@intel.com>

Intel drivers translate actions returned from XDP programs to their own
return codes that have the following mapping:

XDP_REDIRECT -> IXGBE_XDP_{REDIR,CONSUMED}
XDP_TX -> IXGBE_XDP_{TX,CONSUMED}
XDP_DROP -> IXGBE_XDP_CONSUMED
XDP_ABORTED -> IXGBE_XDP_CONSUMED
XDP_PASS -> IXGBE_XDP_PASS

Commit c7dd09fd4628 ("ixgbe, xsk: Terminate Rx side of NAPI when XSK Rx
queue gets full") introduced new translation

XDP_REDIRECT -> IXGBE_XDP_EXIT

which is set when XSK RQ gets full and to indicate that driver should
stop further Rx processing. This happens for unsuccessful
xdp_do_redirect() so it is valuable to call trace_xdp_exception() for
this case. In order to avoid IXGBE_XDP_EXIT -> IXGBE_XDP_CONSUMED
overwrite, XDP_DROP case was moved above which in turn made the
'fallthrough' that is in XDP_ABORTED useless as it became the last label
in the switch statement.

Simply drop this leftover.

Fixes: c7dd09fd4628 ("ixgbe, xsk: Terminate Rx side of NAPI when XSK Rx queue gets full")
Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c
index 68532cffd453..1703c640a434 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c
@@ -144,7 +144,6 @@ static int ixgbe_run_xdp_zc(struct ixgbe_adapter *adapter,
 		result = IXGBE_XDP_CONSUMED;
 out_failure:
 		trace_xdp_exception(rx_ring->netdev, xdp_prog, act);
-		fallthrough; /* handle aborts by dropping packet */
 	}
 	return result;
 }
-- 
2.27.0


^ permalink raw reply related

* [PATCH bpf-next 0/2] xsk: remove reduntant 'falltrough' attributes
From: Maciej Fijalkowski @ 2022-04-21 13:21 UTC (permalink / raw)
  To: bpf, ast, daniel, sfr, andrii
  Cc: netdev, magnus.karlsson, linux-next, Maciej Fijalkowski

This is a follow-up to recently applied set [0] to fix the build
warnings:

error: attribute 'fallthrough' not preceding a case label or default
label [-Werror]

that Stephen has stumbled upon when merging bpf-next to linux-next.
Apologies for these leftovers.

Thanks,
Maciej

[0]: https://lore.kernel.org/bpf/20220413153015.453864-1-maciej.fijalkowski@intel.com/

Maciej Fijalkowski (2):
  ixgbe: xsk: get rid of redundant 'fallthrough'
  i40e: xsk: get rid of redundant 'fallthrough'

 drivers/net/ethernet/intel/i40e/i40e_xsk.c   | 1 -
 drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c | 1 -
 2 files changed, 2 deletions(-)

-- 
2.27.0


^ permalink raw reply

* Re: [PATCH bpf-next] selftests/bpf: fix attach tests retcode checks
From: Yafang Shao @ 2022-04-21 13:09 UTC (permalink / raw)
  To: Artem Savkov
  Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, bpf, netdev,
	LKML, open list:KERNEL SELFTEST FRAMEWORK
In-Reply-To: <20220421130104.1582053-1-asavkov@redhat.com>

On Thu, Apr 21, 2022 at 9:01 PM Artem Savkov <asavkov@redhat.com> wrote:
>
> Switching to libbpf 1.0 API broke test_sock and test_sysctl as they
> check for return of bpf_prog_attach to be exactly -1. Switch the check
> to '< 0' instead.
>
> Fixes: b858ba8c52b6 ("selftests/bpf: Use libbpf 1.0 API mode instead of RLIMIT_MEMLOCK")
> Signed-off-by: Artem Savkov <asavkov@redhat.com>

Reviewed-by: Yafang Shao <laoar.shao@gmail.com>

> ---
>  tools/testing/selftests/bpf/test_sock.c   | 2 +-
>  tools/testing/selftests/bpf/test_sysctl.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/bpf/test_sock.c b/tools/testing/selftests/bpf/test_sock.c
> index 6c4494076bbf..810c3740b2cc 100644
> --- a/tools/testing/selftests/bpf/test_sock.c
> +++ b/tools/testing/selftests/bpf/test_sock.c
> @@ -492,7 +492,7 @@ static int run_test_case(int cgfd, const struct sock_test *test)
>                         goto err;
>         }
>
> -       if (attach_sock_prog(cgfd, progfd, test->attach_type) == -1) {
> +       if (attach_sock_prog(cgfd, progfd, test->attach_type) < 0) {
>                 if (test->result == ATTACH_REJECT)
>                         goto out;
>                 else
> diff --git a/tools/testing/selftests/bpf/test_sysctl.c b/tools/testing/selftests/bpf/test_sysctl.c
> index 5bae25ca19fb..57620e7c9048 100644
> --- a/tools/testing/selftests/bpf/test_sysctl.c
> +++ b/tools/testing/selftests/bpf/test_sysctl.c
> @@ -1560,7 +1560,7 @@ static int run_test_case(int cgfd, struct sysctl_test *test)
>                         goto err;
>         }
>
> -       if (bpf_prog_attach(progfd, cgfd, atype, BPF_F_ALLOW_OVERRIDE) == -1) {
> +       if (bpf_prog_attach(progfd, cgfd, atype, BPF_F_ALLOW_OVERRIDE) < 0) {
>                 if (test->result == ATTACH_REJECT)
>                         goto out;
>                 else
> --
> 2.35.1
>


-- 
Regards
Yafang

^ permalink raw reply

* Re: [PATCH bpf-next] selftests/bpf: fix map tests errno checks
From: Yafang Shao @ 2022-04-21 13:08 UTC (permalink / raw)
  To: Artem Savkov
  Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, bpf, netdev,
	LKML, open list:KERNEL SELFTEST FRAMEWORK
In-Reply-To: <20220421094320.1563570-1-asavkov@redhat.com>

On Thu, Apr 21, 2022 at 5:43 PM Artem Savkov <asavkov@redhat.com> wrote:
>
> Switching to libbpf 1.0 API broke test_lpm_map and test_lru_map as error
> reporting changed. Instead of setting errno and returning -1 bpf calls
> now return -Exxx directly.
> Drop errno checks and look at return code directly.
>
> Fixes: b858ba8c52b6 ("selftests/bpf: Use libbpf 1.0 API mode instead of RLIMIT_MEMLOCK")

Ah, it is caused by the LIBBPF_STRICT_DIRECT_ERRS.

> Signed-off-by: Artem Savkov <asavkov@redhat.com>

Reviewed-by: Yafang Shao <laoar.shao@gmail.com>

P.S: It seems that other files which use libbpf 1.0 API mode are also
impacted, and it seems you are working on fixing them, thanks.

> ---
>  tools/testing/selftests/bpf/test_lpm_map.c | 39 +++++--------
>  tools/testing/selftests/bpf/test_lru_map.c | 66 ++++++++--------------
>  2 files changed, 37 insertions(+), 68 deletions(-)
>
> diff --git a/tools/testing/selftests/bpf/test_lpm_map.c b/tools/testing/selftests/bpf/test_lpm_map.c
> index 789c9748d241..c028d621c744 100644
> --- a/tools/testing/selftests/bpf/test_lpm_map.c
> +++ b/tools/testing/selftests/bpf/test_lpm_map.c
> @@ -408,16 +408,13 @@ static void test_lpm_ipaddr(void)
>
>         /* Test some lookups that should not match any entry */
>         inet_pton(AF_INET, "10.0.0.1", key_ipv4->data);
> -       assert(bpf_map_lookup_elem(map_fd_ipv4, key_ipv4, &value) == -1 &&
> -              errno == ENOENT);
> +       assert(bpf_map_lookup_elem(map_fd_ipv4, key_ipv4, &value) == -ENOENT);
>
>         inet_pton(AF_INET, "11.11.11.11", key_ipv4->data);
> -       assert(bpf_map_lookup_elem(map_fd_ipv4, key_ipv4, &value) == -1 &&
> -              errno == ENOENT);
> +       assert(bpf_map_lookup_elem(map_fd_ipv4, key_ipv4, &value) == -ENOENT);
>
>         inet_pton(AF_INET6, "2a00:ffff::", key_ipv6->data);
> -       assert(bpf_map_lookup_elem(map_fd_ipv6, key_ipv6, &value) == -1 &&
> -              errno == ENOENT);
> +       assert(bpf_map_lookup_elem(map_fd_ipv6, key_ipv6, &value) == -ENOENT);
>
>         close(map_fd_ipv4);
>         close(map_fd_ipv6);
> @@ -474,18 +471,15 @@ static void test_lpm_delete(void)
>         /* remove non-existent node */
>         key->prefixlen = 32;
>         inet_pton(AF_INET, "10.0.0.1", key->data);
> -       assert(bpf_map_lookup_elem(map_fd, key, &value) == -1 &&
> -               errno == ENOENT);
> +       assert(bpf_map_lookup_elem(map_fd, key, &value) == -ENOENT);
>
>         key->prefixlen = 30; // unused prefix so far
>         inet_pton(AF_INET, "192.255.0.0", key->data);
> -       assert(bpf_map_delete_elem(map_fd, key) == -1 &&
> -               errno == ENOENT);
> +       assert(bpf_map_delete_elem(map_fd, key) == -ENOENT);
>
>         key->prefixlen = 16; // same prefix as the root node
>         inet_pton(AF_INET, "192.255.0.0", key->data);
> -       assert(bpf_map_delete_elem(map_fd, key) == -1 &&
> -               errno == ENOENT);
> +       assert(bpf_map_delete_elem(map_fd, key) == -ENOENT);
>
>         /* assert initial lookup */
>         key->prefixlen = 32;
> @@ -530,8 +524,7 @@ static void test_lpm_delete(void)
>
>         key->prefixlen = 32;
>         inet_pton(AF_INET, "192.168.128.1", key->data);
> -       assert(bpf_map_lookup_elem(map_fd, key, &value) == -1 &&
> -               errno == ENOENT);
> +       assert(bpf_map_lookup_elem(map_fd, key, &value) == -ENOENT);
>
>         close(map_fd);
>  }
> @@ -552,8 +545,7 @@ static void test_lpm_get_next_key(void)
>         assert(map_fd >= 0);
>
>         /* empty tree. get_next_key should return ENOENT */
> -       assert(bpf_map_get_next_key(map_fd, NULL, key_p) == -1 &&
> -              errno == ENOENT);
> +       assert(bpf_map_get_next_key(map_fd, NULL, key_p) == -ENOENT);
>
>         /* get and verify the first key, get the second one should fail. */
>         key_p->prefixlen = 16;
> @@ -565,8 +557,7 @@ static void test_lpm_get_next_key(void)
>         assert(key_p->prefixlen == 16 && key_p->data[0] == 192 &&
>                key_p->data[1] == 168);
>
> -       assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == -1 &&
> -              errno == ENOENT);
> +       assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == -ENOENT);
>
>         /* no exact matching key should get the first one in post order. */
>         key_p->prefixlen = 8;
> @@ -590,8 +581,7 @@ static void test_lpm_get_next_key(void)
>                next_key_p->data[1] == 168);
>
>         memcpy(key_p, next_key_p, key_size);
> -       assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == -1 &&
> -              errno == ENOENT);
> +       assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == -ENOENT);
>
>         /* Add one more element (total three) */
>         key_p->prefixlen = 24;
> @@ -614,8 +604,7 @@ static void test_lpm_get_next_key(void)
>                next_key_p->data[1] == 168);
>
>         memcpy(key_p, next_key_p, key_size);
> -       assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == -1 &&
> -              errno == ENOENT);
> +       assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == -ENOENT);
>
>         /* Add one more element (total four) */
>         key_p->prefixlen = 24;
> @@ -643,8 +632,7 @@ static void test_lpm_get_next_key(void)
>                next_key_p->data[1] == 168);
>
>         memcpy(key_p, next_key_p, key_size);
> -       assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == -1 &&
> -              errno == ENOENT);
> +       assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == -ENOENT);
>
>         /* Add one more element (total five) */
>         key_p->prefixlen = 28;
> @@ -678,8 +666,7 @@ static void test_lpm_get_next_key(void)
>                next_key_p->data[1] == 168);
>
>         memcpy(key_p, next_key_p, key_size);
> -       assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == -1 &&
> -              errno == ENOENT);
> +       assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == -ENOENT);
>
>         /* no exact matching key should return the first one in post order */
>         key_p->prefixlen = 22;
> diff --git a/tools/testing/selftests/bpf/test_lru_map.c b/tools/testing/selftests/bpf/test_lru_map.c
> index a6aa2d121955..4d0650cfb5cd 100644
> --- a/tools/testing/selftests/bpf/test_lru_map.c
> +++ b/tools/testing/selftests/bpf/test_lru_map.c
> @@ -175,24 +175,20 @@ static void test_lru_sanity0(int map_type, int map_flags)
>                                     BPF_NOEXIST));
>
>         /* BPF_NOEXIST means: add new element if it doesn't exist */
> -       assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST) == -1
> -              /* key=1 already exists */
> -              && errno == EEXIST);
> +       assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST) == -EEXIST);
> +       /* key=1 already exists */
>
> -       assert(bpf_map_update_elem(lru_map_fd, &key, value, -1) == -1 &&
> -              errno == EINVAL);
> +       assert(bpf_map_update_elem(lru_map_fd, &key, value, -1) == -EINVAL);
>
>         /* insert key=2 element */
>
>         /* check that key=2 is not found */
>         key = 2;
> -       assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -1 &&
> -              errno == ENOENT);
> +       assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT);
>
>         /* BPF_EXIST means: update existing element */
> -       assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_EXIST) == -1 &&
> -              /* key=2 is not there */
> -              errno == ENOENT);
> +       assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_EXIST) == -ENOENT);
> +       /* key=2 is not there */
>
>         assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST));
>
> @@ -200,8 +196,7 @@ static void test_lru_sanity0(int map_type, int map_flags)
>
>         /* check that key=3 is not found */
>         key = 3;
> -       assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -1 &&
> -              errno == ENOENT);
> +       assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT);
>
>         /* check that key=1 can be found and mark the ref bit to
>          * stop LRU from removing key=1
> @@ -217,8 +212,7 @@ static void test_lru_sanity0(int map_type, int map_flags)
>
>         /* key=2 has been removed from the LRU */
>         key = 2;
> -       assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -1 &&
> -              errno == ENOENT);
> +       assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT);
>
>         /* lookup elem key=1 and delete it, then check it doesn't exist */
>         key = 1;
> @@ -381,8 +375,7 @@ static void test_lru_sanity2(int map_type, int map_flags, unsigned int tgt_free)
>         end_key = 1 + batch_size;
>         value[0] = 4321;
>         for (key = 1; key < end_key; key++) {
> -               assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -1 &&
> -                      errno == ENOENT);
> +               assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT);
>                 assert(!bpf_map_update_elem(lru_map_fd, &key, value,
>                                             BPF_NOEXIST));
>                 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value));
> @@ -562,8 +555,7 @@ static void do_test_lru_sanity5(unsigned long long last_key, int map_fd)
>         assert(!bpf_map_lookup_elem_with_ref_bit(map_fd, key, value));
>
>         /* Cannot find the last key because it was removed by LRU */
> -       assert(bpf_map_lookup_elem(map_fd, &last_key, value) == -1 &&
> -              errno == ENOENT);
> +       assert(bpf_map_lookup_elem(map_fd, &last_key, value) == -ENOENT);
>  }
>
>  /* Test map with only one element */
> @@ -711,21 +703,18 @@ static void test_lru_sanity7(int map_type, int map_flags)
>                                     BPF_NOEXIST));
>
>         /* BPF_NOEXIST means: add new element if it doesn't exist */
> -       assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST) == -1
> -              /* key=1 already exists */
> -              && errno == EEXIST);
> +       assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST) == -EEXIST);
> +       /* key=1 already exists */
>
>         /* insert key=2 element */
>
>         /* check that key=2 is not found */
>         key = 2;
> -       assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -1 &&
> -              errno == ENOENT);
> +       assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT);
>
>         /* BPF_EXIST means: update existing element */
> -       assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_EXIST) == -1 &&
> -              /* key=2 is not there */
> -              errno == ENOENT);
> +       assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_EXIST) == -ENOENT);
> +       /* key=2 is not there */
>
>         assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST));
>
> @@ -733,8 +722,7 @@ static void test_lru_sanity7(int map_type, int map_flags)
>
>         /* check that key=3 is not found */
>         key = 3;
> -       assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -1 &&
> -              errno == ENOENT);
> +       assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT);
>
>         /* check that key=1 can be found and mark the ref bit to
>          * stop LRU from removing key=1
> @@ -757,8 +745,7 @@ static void test_lru_sanity7(int map_type, int map_flags)
>
>         /* key=2 has been removed from the LRU */
>         key = 2;
> -       assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -1 &&
> -              errno == ENOENT);
> +       assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT);
>
>         assert(map_equal(lru_map_fd, expected_map_fd));
>
> @@ -805,21 +792,18 @@ static void test_lru_sanity8(int map_type, int map_flags)
>         assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST));
>
>         /* BPF_NOEXIST means: add new element if it doesn't exist */
> -       assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST) == -1
> -              /* key=1 already exists */
> -              && errno == EEXIST);
> +       assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST) == -EEXIST);
> +       /* key=1 already exists */
>
>         /* insert key=2 element */
>
>         /* check that key=2 is not found */
>         key = 2;
> -       assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -1 &&
> -              errno == ENOENT);
> +       assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT);
>
>         /* BPF_EXIST means: update existing element */
> -       assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_EXIST) == -1 &&
> -              /* key=2 is not there */
> -              errno == ENOENT);
> +       assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_EXIST) == -ENOENT);
> +       /* key=2 is not there */
>
>         assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST));
>         assert(!bpf_map_update_elem(expected_map_fd, &key, value,
> @@ -829,8 +813,7 @@ static void test_lru_sanity8(int map_type, int map_flags)
>
>         /* check that key=3 is not found */
>         key = 3;
> -       assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -1 &&
> -              errno == ENOENT);
> +       assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT);
>
>         /* check that key=1 can be found and do _not_ mark ref bit.
>          * this will be evicted on next update.
> @@ -853,8 +836,7 @@ static void test_lru_sanity8(int map_type, int map_flags)
>
>         /* key=1 has been removed from the LRU */
>         key = 1;
> -       assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -1 &&
> -              errno == ENOENT);
> +       assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT);
>
>         assert(map_equal(lru_map_fd, expected_map_fd));
>
> --
> 2.35.1
>


-- 
Regards
Yafang

^ permalink raw reply

* Re: [PATCH v2 3/3] ARM: dts: imx6qdl-sr-som: update phy configuration for som revision 1.9
From: Russell King (Oracle) @ 2022-04-21 13:03 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Josua Mayer, netdev, alvaro.karsz, Rob Herring,
	Krzysztof Kozlowski, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team
In-Reply-To: <YmFNpLLLDzBNPqGf@lunn.ch>

On Thu, Apr 21, 2022 at 02:27:16PM +0200, Andrew Lunn wrote:
> On Tue, Apr 19, 2022 at 01:27:09PM +0300, Josua Mayer wrote:
> > Since SoM revision 1.9 the PHY has been replaced with an ADIN1300,
> > add an entry for it next to the original.
> > 
> > Co-developed-by: Alvaro Karsz <alvaro.karsz@solid-run.com>
> > Signed-off-by: Alvaro Karsz <alvaro.karsz@solid-run.com>
> > Signed-off-by: Josua Mayer <josua@solid-run.com>
> > ---
> > V1 -> V2: changed dts property name
> > 
> >  arch/arm/boot/dts/imx6qdl-sr-som.dtsi | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/arch/arm/boot/dts/imx6qdl-sr-som.dtsi b/arch/arm/boot/dts/imx6qdl-sr-som.dtsi
> > index f86efd0ccc40..d46182095d79 100644
> > --- a/arch/arm/boot/dts/imx6qdl-sr-som.dtsi
> > +++ b/arch/arm/boot/dts/imx6qdl-sr-som.dtsi
> > @@ -83,6 +83,12 @@ ethernet-phy@4 {
> >  			qca,clk-out-frequency = <125000000>;
> >  			qca,smarteee-tw-us-1g = <24>;
> >  		};
> > +
> > +		/* ADIN1300 (som rev 1.9 or later) */
> > +		ethernet-phy@1 {
> > +			reg = <1>;
> > +			adi,phy-output-clock = "125mhz-free-running";
> > +		};
> 
> There is currently the comment:
> 
>                  * The PHY can appear at either address 0 or 4 due to the
>                  * configuration (LED) pin not being pulled sufficiently.
>                  */
> 
> It would be good to add another comment about this PHY at address 1.

There is an issue with this approach. Listing the "possible" PHYs in DT
so we can configure them leads to the kernel complaining at boot time
with:

mdio_bus 2188000.ethernet-1: MDIO device at address 4 is missing.

So with this patch, we'll also get:

mdio_bus 2188000.ethernet-1: MDIO device at address 1 is missing.

which is not great for the user to see. Arguably though, it's down to
broken hardware design in the case of the AR8035, since this is caused
by insufficient pull on the LED pin to ensure the hardware address is
reliable configured.

However, adding this for a rev 1.9 uSOM where we know that the PHY is
different matter. I think we should be aiming for a new revision of
DT for the uSOM with the AR8035 nodes removed and the ADIN added,
rather than trying to stuff them all into a single DT and have the
kernel complain about not just one missing PHY, but now two.

The only other ways around this that I can see would be to have some
way to flag in DT that the PHYs are "optional" - if they're not found
while probing the hardware, then don't whinge about them. Or have
u-boot discover which address the PHY is located, and update the DT
blob passed to the kernel to disable the PHY addresses that aren't
present. Or edit the DT to update the node name and reg property. Or
something along those lines.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

^ permalink raw reply

* [PATCH bpf-next] selftests/bpf: fix attach tests retcode checks
From: Artem Savkov @ 2022-04-21 13:01 UTC (permalink / raw)
  To: Yafang Shao
  Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, bpf, netdev,
	linux-kernel, linux-kselftest, Artem Savkov

Switching to libbpf 1.0 API broke test_sock and test_sysctl as they
check for return of bpf_prog_attach to be exactly -1. Switch the check
to '< 0' instead.

Fixes: b858ba8c52b6 ("selftests/bpf: Use libbpf 1.0 API mode instead of RLIMIT_MEMLOCK")
Signed-off-by: Artem Savkov <asavkov@redhat.com>
---
 tools/testing/selftests/bpf/test_sock.c   | 2 +-
 tools/testing/selftests/bpf/test_sysctl.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/bpf/test_sock.c b/tools/testing/selftests/bpf/test_sock.c
index 6c4494076bbf..810c3740b2cc 100644
--- a/tools/testing/selftests/bpf/test_sock.c
+++ b/tools/testing/selftests/bpf/test_sock.c
@@ -492,7 +492,7 @@ static int run_test_case(int cgfd, const struct sock_test *test)
 			goto err;
 	}
 
-	if (attach_sock_prog(cgfd, progfd, test->attach_type) == -1) {
+	if (attach_sock_prog(cgfd, progfd, test->attach_type) < 0) {
 		if (test->result == ATTACH_REJECT)
 			goto out;
 		else
diff --git a/tools/testing/selftests/bpf/test_sysctl.c b/tools/testing/selftests/bpf/test_sysctl.c
index 5bae25ca19fb..57620e7c9048 100644
--- a/tools/testing/selftests/bpf/test_sysctl.c
+++ b/tools/testing/selftests/bpf/test_sysctl.c
@@ -1560,7 +1560,7 @@ static int run_test_case(int cgfd, struct sysctl_test *test)
 			goto err;
 	}
 
-	if (bpf_prog_attach(progfd, cgfd, atype, BPF_F_ALLOW_OVERRIDE) == -1) {
+	if (bpf_prog_attach(progfd, cgfd, atype, BPF_F_ALLOW_OVERRIDE) < 0) {
 		if (test->result == ATTACH_REJECT)
 			goto out;
 		else
-- 
2.35.1


^ permalink raw reply related

* [PATCH -next] libbpf: Add additional null-pointer checking in make_parent_dir
From: Gaosheng Cui @ 2022-04-21 13:00 UTC (permalink / raw)
  To: cuigaosheng1, ast, daniel, andrii, kafai, songliubraving, yhs,
	john.fastabend, kpsingh
  Cc: netdev, bpf, linux-kernel, gongruiqi1, wangweiyang2

The make_parent_dir is called without null-pointer checking for path,
such as bpf_link__pin. To ensure there is no null-pointer dereference
in make_parent_dir, so make_parent_dir requires additional null-pointer
checking for path.

Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
---
 tools/lib/bpf/libbpf.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index b53e51884f9e..5786e6184bf5 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -7634,6 +7634,9 @@ static int make_parent_dir(const char *path)
 	char *dname, *dir;
 	int err = 0;
 
+	if (path == NULL)
+		return -EINVAL;
+
 	dname = strdup(path);
 	if (dname == NULL)
 		return -ENOMEM;
-- 
2.25.1


^ permalink raw reply related

* Re: [PATCH] net: eql: Use kzalloc instead of kmalloc/memset
From: patchwork-bot+netdevbpf @ 2022-04-21 13:00 UTC (permalink / raw)
  To: Haowen Bai; +Cc: davem, kuba, pabeni, netdev, linux-kernel
In-Reply-To: <1650277333-31090-1-git-send-email-baihaowen@meizu.com>

Hello:

This patch was applied to netdev/net-next.git (master)
by Paolo Abeni <pabeni@redhat.com>:

On Mon, 18 Apr 2022 18:22:13 +0800 you wrote:
> Use kzalloc rather than duplicating its implementation, which
> makes code simple and easy to understand.
> 
> Signed-off-by: Haowen Bai <baihaowen@meizu.com>
> ---
>  drivers/net/eql.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Here is the summary with links:
  - net: eql: Use kzalloc instead of kmalloc/memset
    https://git.kernel.org/netdev/net-next/c/9c8774e629a1

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply

* Re: [PATCH 4/5] net: phy: marvell: Add LED accessors for Marvell 88E1510
From: Andrew Lunn @ 2022-04-21 12:57 UTC (permalink / raw)
  To: Kai-Heng Feng
  Cc: hkallweit1, linux, peppe.cavallaro, alexandre.torgue, joabreu,
	davem, kuba, pabeni, netdev, linux-kernel
In-Reply-To: <CAAd53p6vUcUu=H=cDMh07zcUUDM8WTp+F_L+jiJSWKqd37+MDg@mail.gmail.com>

On Thu, Apr 21, 2022 at 08:24:00PM +0800, Kai-Heng Feng wrote:
> On Thu, Apr 21, 2022 at 7:51 PM Andrew Lunn <andrew@lunn.ch> wrote:
> >
> > > This is not feasible.
> > > If BIOS can define a method and restore the LED by itself, it can put
> > > the method inside its S3 method and I don't have to work on this at
> > > the first place.
> >
> > So maybe just declare the BIOS as FUBAR and move on to the next issue
> > assigned to you.
> >
> > Do we really want the maintenance burden of this code for one machines
> > BIOS?
> 
> Wasn't this the "set precedence" we discussed earlier for? Someone has
> to be the first, and more users will leverage the new property we
> added.

I both agree and disagree. I'm trying to make this feature generic,
unlike you who seem to be doing the minimal, only saving one of three
LED configuration registers. But on the other hand, i'm not sure there
will be more users. Do you have a list of machines where the BIOS is
FUBAR? Is it one machine? A range of machines from one vendor, or
multiple vendors with multiple machines. I would feel better about the
maintenance burden if i knew that this was going to be used a lot.
 
> > Maybe the better solution is to push back on the vendor and its
> > BIOS, tell them how they should of done this, if the BIOS wants to be
> > in control of the LEDs it needs to offer the methods to control the
> > LEDs. And then hopefully the next machine the vendor produces will
> > have working BIOS.
> 
> The BIOS doesn't want to control the LED. It just provides a default
> LED setting suitable for this platform, so the driver can use this
> value over the hardcoded one in marvell phy driver.

Exactly, it wants to control the LED, and tell the OS not to touch it
ever.

> So this really has nothing to do with with any ACPI method.
> I believe the new property can be useful for DT world too.

DT generally never trusts the bootloader to do anything. So i doubt
such a DT property would ever be used. Also, DT is about describing
the hardware, not how to configure the hardware. So you could list
there is a PHY LED, what colour it is, etc. But in general, you would
not describe how it is configured, that something else is configuring
it and it should be left alone.

> > Your other option is to take part in the effort to add control of the
> > LEDs via the standard Linux LED subsystem. The Marvel PHY driver is
> > likely to be one of the first to gain support this for. So you can
> > then totally take control of the LED from the BIOS and put it in the
> > users hands. And such a solution will be applicable to many machines,
> > not just one.
> 
> This series just wants to use the default value platform firmware provides.
> Create a sysfs to let user meddle with LED value doesn't really help
> the case here.

I would disagree. You can add a systemd service to configure it at
boot however you want. It opens up the possibility to implement
ethtool --identify in a generic way, etc. It is a much more powerful
and useful feature than saying 'don't touch', and also it justify the
maintenance burden.

     Andrew

^ permalink raw reply

* [PATCH net-next] qed: Remove IP services API.
From: Guillaume Nault @ 2022-04-21 12:47 UTC (permalink / raw)
  To: David Miller, Jakub Kicinski, Paolo Abeni
  Cc: netdev, Ariel Elior, Manish Chopra, Igor Russkikh, Nikolay Assa,
	Prabhakar Kushwaha, Omkar Kulkarni, Michal Kalderon, Shai Malin,
	Hannes Reinecke

qed_nvmetcp_ip_services.c and its corresponding header file were
introduced in commit 806ee7f81a2b ("qed: Add IP services APIs support")
but there's still no users for any of the functions they declare.
Since these files are effectively unused, let's just drop them.

Found by code inspection. Compile-tested only.

Signed-off-by: Guillaume Nault <gnault@redhat.com>
---
 drivers/net/ethernet/qlogic/qed/Makefile      |   3 +-
 .../qlogic/qed/qed_nvmetcp_ip_services.c      | 238 ------------------
 .../linux/qed/qed_nvmetcp_ip_services_if.h    |  29 ---
 3 files changed, 1 insertion(+), 269 deletions(-)
 delete mode 100644 drivers/net/ethernet/qlogic/qed/qed_nvmetcp_ip_services.c
 delete mode 100644 include/linux/qed/qed_nvmetcp_ip_services_if.h

diff --git a/drivers/net/ethernet/qlogic/qed/Makefile b/drivers/net/ethernet/qlogic/qed/Makefile
index 0d9c2fe0245d..3d2098f21bb7 100644
--- a/drivers/net/ethernet/qlogic/qed/Makefile
+++ b/drivers/net/ethernet/qlogic/qed/Makefile
@@ -30,8 +30,7 @@ qed-$(CONFIG_QED_OOO) += qed_ooo.o
 
 qed-$(CONFIG_QED_NVMETCP) +=	\
 	qed_nvmetcp.o		\
-	qed_nvmetcp_fw_funcs.o	\
-	qed_nvmetcp_ip_services.o
+	qed_nvmetcp_fw_funcs.o
 
 qed-$(CONFIG_QED_RDMA) +=	\
 	qed_iwarp.o		\
diff --git a/drivers/net/ethernet/qlogic/qed/qed_nvmetcp_ip_services.c b/drivers/net/ethernet/qlogic/qed/qed_nvmetcp_ip_services.c
deleted file mode 100644
index 7e286cddbedb..000000000000
--- a/drivers/net/ethernet/qlogic/qed/qed_nvmetcp_ip_services.c
+++ /dev/null
@@ -1,238 +0,0 @@
-// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
-/*
- * Copyright 2021 Marvell. All rights reserved.
- */
-
-#include <linux/types.h>
-#include <asm/byteorder.h>
-#include <asm/param.h>
-#include <linux/delay.h>
-#include <linux/pci.h>
-#include <linux/dma-mapping.h>
-#include <linux/etherdevice.h>
-#include <linux/kernel.h>
-#include <linux/stddef.h>
-#include <linux/errno.h>
-
-#include <net/tcp.h>
-
-#include <linux/qed/qed_nvmetcp_ip_services_if.h>
-
-#define QED_IP_RESOL_TIMEOUT  4
-
-int qed_route_ipv4(struct sockaddr_storage *local_addr,
-		   struct sockaddr_storage *remote_addr,
-		   struct sockaddr *hardware_address,
-		   struct net_device **ndev)
-{
-	struct neighbour *neigh = NULL;
-	__be32 *loc_ip, *rem_ip;
-	struct rtable *rt;
-	int rc = -ENXIO;
-	int retry;
-
-	loc_ip = &((struct sockaddr_in *)local_addr)->sin_addr.s_addr;
-	rem_ip = &((struct sockaddr_in *)remote_addr)->sin_addr.s_addr;
-	*ndev = NULL;
-	rt = ip_route_output(&init_net, *rem_ip, *loc_ip, 0/*tos*/, 0/*oif*/);
-	if (IS_ERR(rt)) {
-		pr_err("lookup route failed\n");
-		rc = PTR_ERR(rt);
-		goto return_err;
-	}
-
-	neigh = dst_neigh_lookup(&rt->dst, rem_ip);
-	if (!neigh) {
-		rc = -ENOMEM;
-		ip_rt_put(rt);
-		goto return_err;
-	}
-
-	*ndev = rt->dst.dev;
-	ip_rt_put(rt);
-
-	/* If not resolved, kick-off state machine towards resolution */
-	if (!(neigh->nud_state & NUD_VALID))
-		neigh_event_send(neigh, NULL);
-
-	/* query neighbor until resolved or timeout */
-	retry = QED_IP_RESOL_TIMEOUT;
-	while (!(neigh->nud_state & NUD_VALID) && retry > 0) {
-		msleep(1000);
-		retry--;
-	}
-
-	if (neigh->nud_state & NUD_VALID) {
-		/* copy resolved MAC address */
-		neigh_ha_snapshot(hardware_address->sa_data, neigh, *ndev);
-		hardware_address->sa_family = (*ndev)->type;
-		rc = 0;
-	}
-
-	neigh_release(neigh);
-	if (!(*loc_ip)) {
-		*loc_ip = inet_select_addr(*ndev, *rem_ip, RT_SCOPE_UNIVERSE);
-		local_addr->ss_family = AF_INET;
-	}
-
-return_err:
-
-	return rc;
-}
-EXPORT_SYMBOL(qed_route_ipv4);
-
-int qed_route_ipv6(struct sockaddr_storage *local_addr,
-		   struct sockaddr_storage *remote_addr,
-		   struct sockaddr *hardware_address,
-		   struct net_device **ndev)
-{
-	struct neighbour *neigh = NULL;
-	struct dst_entry *dst;
-	struct flowi6 fl6;
-	int rc = -ENXIO;
-	int retry;
-
-	memset(&fl6, 0, sizeof(fl6));
-	fl6.saddr = ((struct sockaddr_in6 *)local_addr)->sin6_addr;
-	fl6.daddr = ((struct sockaddr_in6 *)remote_addr)->sin6_addr;
-	dst = ip6_route_output(&init_net, NULL, &fl6);
-	if (!dst || dst->error) {
-		if (dst) {
-			dst_release(dst);
-			pr_err("lookup route failed %d\n", dst->error);
-		}
-
-		goto out;
-	}
-
-	neigh = dst_neigh_lookup(dst, &fl6.daddr);
-	if (neigh) {
-		*ndev = ip6_dst_idev(dst)->dev;
-
-		/* If not resolved, kick-off state machine towards resolution */
-		if (!(neigh->nud_state & NUD_VALID))
-			neigh_event_send(neigh, NULL);
-
-		/* query neighbor until resolved or timeout */
-		retry = QED_IP_RESOL_TIMEOUT;
-		while (!(neigh->nud_state & NUD_VALID) && retry > 0) {
-			msleep(1000);
-			retry--;
-		}
-
-		if (neigh->nud_state & NUD_VALID) {
-			neigh_ha_snapshot((u8 *)hardware_address->sa_data,
-					  neigh, *ndev);
-			hardware_address->sa_family = (*ndev)->type;
-			rc = 0;
-		}
-
-		neigh_release(neigh);
-
-		if (ipv6_addr_any(&fl6.saddr)) {
-			if (ipv6_dev_get_saddr(dev_net(*ndev), *ndev,
-					       &fl6.daddr, 0, &fl6.saddr)) {
-				pr_err("Unable to find source IP address\n");
-				goto out;
-			}
-
-			local_addr->ss_family = AF_INET6;
-			((struct sockaddr_in6 *)local_addr)->sin6_addr =
-								fl6.saddr;
-		}
-	}
-
-	dst_release(dst);
-
-out:
-
-	return rc;
-}
-EXPORT_SYMBOL(qed_route_ipv6);
-
-void qed_vlan_get_ndev(struct net_device **ndev, u16 *vlan_id)
-{
-	if (is_vlan_dev(*ndev)) {
-		*vlan_id = vlan_dev_vlan_id(*ndev);
-		*ndev = vlan_dev_real_dev(*ndev);
-	}
-}
-EXPORT_SYMBOL(qed_vlan_get_ndev);
-
-struct pci_dev *qed_validate_ndev(struct net_device *ndev)
-{
-	struct net_device *upper;
-	struct pci_dev *pdev;
-
-	for_each_pci_dev(pdev) {
-		if (pdev->driver &&
-		    !strcmp(pdev->driver->name, "qede")) {
-			upper = pci_get_drvdata(pdev);
-			if (upper->ifindex == ndev->ifindex)
-				return pdev;
-		}
-	}
-
-	return NULL;
-}
-EXPORT_SYMBOL(qed_validate_ndev);
-
-__be16 qed_get_in_port(struct sockaddr_storage *sa)
-{
-	return sa->ss_family == AF_INET
-		? ((struct sockaddr_in *)sa)->sin_port
-		: ((struct sockaddr_in6 *)sa)->sin6_port;
-}
-EXPORT_SYMBOL(qed_get_in_port);
-
-int qed_fetch_tcp_port(struct sockaddr_storage local_ip_addr,
-		       struct socket **sock, u16 *port)
-{
-	struct sockaddr_storage sa;
-	int rc = 0;
-
-	rc = sock_create(local_ip_addr.ss_family, SOCK_STREAM, IPPROTO_TCP,
-			 sock);
-	if (rc) {
-		pr_warn("failed to create socket: %d\n", rc);
-		goto err;
-	}
-
-	(*sock)->sk->sk_allocation = GFP_KERNEL;
-	sk_set_memalloc((*sock)->sk);
-
-	rc = kernel_bind(*sock, (struct sockaddr *)&local_ip_addr,
-			 sizeof(local_ip_addr));
-
-	if (rc) {
-		pr_warn("failed to bind socket: %d\n", rc);
-		goto err_sock;
-	}
-
-	rc = kernel_getsockname(*sock, (struct sockaddr *)&sa);
-	if (rc < 0) {
-		pr_warn("getsockname() failed: %d\n", rc);
-		goto err_sock;
-	}
-
-	*port = ntohs(qed_get_in_port(&sa));
-
-	return 0;
-
-err_sock:
-	sock_release(*sock);
-	sock = NULL;
-err:
-
-	return rc;
-}
-EXPORT_SYMBOL(qed_fetch_tcp_port);
-
-void qed_return_tcp_port(struct socket *sock)
-{
-	if (sock && sock->sk) {
-		tcp_set_state(sock->sk, TCP_CLOSE);
-		sock_release(sock);
-	}
-}
-EXPORT_SYMBOL(qed_return_tcp_port);
diff --git a/include/linux/qed/qed_nvmetcp_ip_services_if.h b/include/linux/qed/qed_nvmetcp_ip_services_if.h
deleted file mode 100644
index 3604aee53796..000000000000
--- a/include/linux/qed/qed_nvmetcp_ip_services_if.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
-/*
- * Copyright 2021 Marvell. All rights reserved.
- */
-
-#ifndef _QED_IP_SERVICES_IF_H
-#define _QED_IP_SERVICES_IF_H
-
-#include <linux/types.h>
-#include <net/route.h>
-#include <net/ip6_route.h>
-#include <linux/inetdevice.h>
-
-int qed_route_ipv4(struct sockaddr_storage *local_addr,
-		   struct sockaddr_storage *remote_addr,
-		   struct sockaddr *hardware_address,
-		   struct net_device **ndev);
-int qed_route_ipv6(struct sockaddr_storage *local_addr,
-		   struct sockaddr_storage *remote_addr,
-		   struct sockaddr *hardware_address,
-		   struct net_device **ndev);
-void qed_vlan_get_ndev(struct net_device **ndev, u16 *vlan_id);
-struct pci_dev *qed_validate_ndev(struct net_device *ndev);
-void qed_return_tcp_port(struct socket *sock);
-int qed_fetch_tcp_port(struct sockaddr_storage local_ip_addr,
-		       struct socket **sock, u16 *port);
-__be16 qed_get_in_port(struct sockaddr_storage *sa);
-
-#endif /* _QED_IP_SERVICES_IF_H */
-- 
2.21.3


^ permalink raw reply related

* Re: [next] LTP: netns_breakns: Command \"add\" is unknown, try \"ip link help\".
From: Ido Schimmel @ 2022-04-21 12:46 UTC (permalink / raw)
  To: Naresh Kamboju
  Cc: LTP List, Linux-Next Mailing List, open list, Netdev,
	David S. Miller, Jakub Kicinski, Paolo Abeni, Stephen Rothwell,
	vadimp@nvidia.com, idosch, Raju.Lakkaraju, jiri
In-Reply-To: <CA+G9fYvO5OERA0k-r=Q8gbGdUKm0VppL2KPJ9e-R0NreBESo_g@mail.gmail.com>

On Thu, Apr 21, 2022 at 06:12:54PM +0530, Naresh Kamboju wrote:
> Regressions found on all devices LTP containers test cases failed on
> Linux next-20220420. [1]
> 
>   - ltp-containers-tests/netns_comm_ns_exec_ipv6_ioctl
>   - ltp-containers-tests/netns_breakns_ns_exec_ipv6_netlink
>   - ltp-containers-tests/netns_breakns_ip_ipv6_netlink
>   - ltp-containers-tests/netns_breakns_ns_exec_ipv4_ioctl
>   - ltp-containers-tests/netns_breakns_ip_ipv4_netlink
>   - ltp-containers-tests/netns_comm_ip_ipv6_ioctl
>   - ltp-containers-tests/netns_comm_ip_ipv4_netlink
>   - ltp-containers-tests/netns_comm_ns_exec_ipv4_netlink
>   - ltp-containers-tests/netns_breakns_ns_exec_ipv6_ioctl
>   - ltp-containers-tests/netns_comm_ip_ipv6_netlink
>   - ltp-containers-tests/netns_comm_ns_exec_ipv4_ioctl
>   - ltp-containers-tests/netns_breakns_ns_exec_ipv4_netlink
>   - ltp-containers-tests/netns_breakns_ip_ipv4_ioctl
>   - ltp-containers-tests/netns_comm_ip_ipv4_ioctl
>   - ltp-containers-tests/netns_breakns_ip_ipv6_ioctl
>   - ltp-containers-tests/netns_comm_ns_exec_ipv6_netlink
> 
> 
> Test log:
> ---------
> netns_breakns 1 TINFO: timeout per run is 0h 15m 0s
> Command \"add\" is unknown, try \"ip link help\".
> netns_breakns 1 TBROK: unable to create veth pair devices
> Command \"delete\" is unknown, try \"ip link help\".
> 
> 
> Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
> 
> metadata:
>   git_ref: master
>   git_repo: https://gitlab.com/Linaro/lkft/mirrors/next/linux-next
>   git_sha: f1244c81da13009dbf61cb807f45881501c44789
>   git_describe: next-20220420
>   kernel_version: 5.18.0-rc3
>   kernel-config: https://builds.tuxbuild.com/283Ot2o4P4hh7rNSH56BnbPbNba/config
>   build-url: https://gitlab.com/Linaro/lkft/mirrors/next/linux-next/-/pipelines/520334286
>   artifact-location: https://builds.tuxbuild.com/283Ot2o4P4hh7rNSH56BnbPbNba
> 
> I will bisect these failures.

Should be fixed by:

https://patchwork.kernel.org/project/netdevbpf/patch/20220419125151.15589-1-florent.fourcot@wifirst.fr/

^ permalink raw reply

* [next] LTP: netns_breakns: Command \"add\" is unknown, try \"ip link help\".
From: Naresh Kamboju @ 2022-04-21 12:42 UTC (permalink / raw)
  To: LTP List, Linux-Next Mailing List, open list, Netdev
  Cc: David S. Miller, Jakub Kicinski, Paolo Abeni, Stephen Rothwell,
	vadimp@nvidia.com, idosch, Raju.Lakkaraju, jiri

Regressions found on all devices LTP containers test cases failed on
Linux next-20220420. [1]

  - ltp-containers-tests/netns_comm_ns_exec_ipv6_ioctl
  - ltp-containers-tests/netns_breakns_ns_exec_ipv6_netlink
  - ltp-containers-tests/netns_breakns_ip_ipv6_netlink
  - ltp-containers-tests/netns_breakns_ns_exec_ipv4_ioctl
  - ltp-containers-tests/netns_breakns_ip_ipv4_netlink
  - ltp-containers-tests/netns_comm_ip_ipv6_ioctl
  - ltp-containers-tests/netns_comm_ip_ipv4_netlink
  - ltp-containers-tests/netns_comm_ns_exec_ipv4_netlink
  - ltp-containers-tests/netns_breakns_ns_exec_ipv6_ioctl
  - ltp-containers-tests/netns_comm_ip_ipv6_netlink
  - ltp-containers-tests/netns_comm_ns_exec_ipv4_ioctl
  - ltp-containers-tests/netns_breakns_ns_exec_ipv4_netlink
  - ltp-containers-tests/netns_breakns_ip_ipv4_ioctl
  - ltp-containers-tests/netns_comm_ip_ipv4_ioctl
  - ltp-containers-tests/netns_breakns_ip_ipv6_ioctl
  - ltp-containers-tests/netns_comm_ns_exec_ipv6_netlink


Test log:
---------
netns_breakns 1 TINFO: timeout per run is 0h 15m 0s
Command \"add\" is unknown, try \"ip link help\".
netns_breakns 1 TBROK: unable to create veth pair devices
Command \"delete\" is unknown, try \"ip link help\".


Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>

metadata:
  git_ref: master
  git_repo: https://gitlab.com/Linaro/lkft/mirrors/next/linux-next
  git_sha: f1244c81da13009dbf61cb807f45881501c44789
  git_describe: next-20220420
  kernel_version: 5.18.0-rc3
  kernel-config: https://builds.tuxbuild.com/283Ot2o4P4hh7rNSH56BnbPbNba/config
  build-url: https://gitlab.com/Linaro/lkft/mirrors/next/linux-next/-/pipelines/520334286
  artifact-location: https://builds.tuxbuild.com/283Ot2o4P4hh7rNSH56BnbPbNba

I will bisect these failures.

--
Linaro LKFT
https://lkft.linaro.org

[1] https://lkft.validation.linaro.org/scheduler/job/4925635#L1272

^ permalink raw reply


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