Re: [PATCH net-next v7] net/ipv4: add tracepoint for icmp_send

2024-04-26 Thread Eric Dumazet
On Fri, Apr 26, 2024 at 10:47 AM wrote: > > From: Peilin He > > Introduce a tracepoint for icmp_send, which can help users to get more > detail information conveniently when icmp abnormal events happen. > > 1. Giving an usecase example: > = > When an application

Re: [PATCH net-next v9 0/7] Implement reset reason mechanism to detect

2024-04-26 Thread Eric Dumazet
st=x state=x reason=NOT_SPECIFIED > -0 [002] ..s1. 1830.262425: tcp_send_reset: skbaddr=x > skaddr=x src=x dest=x state=x reason=NO_SOCKET > > [1] > Link: > https://lore.kernel.org/all/CANn89iJw8x-LqgsWOeJQQvgVg6DnL5aBRLi10QN2WBdr+X4k=w...@mail.gmail.com/ Reviewed-by: Eric Dumazet Thanks !

Re: [PATCH net-next v9 7/7] rstreason: make it work in trace world

2024-04-26 Thread Eric Dumazet
tate=TCP_ESTABLISHED reason=NOT_SPECIFIED > > Signed-off-by: Jason Xing > Reviewed-by: Steven Rostedt (Google) > --- Reviewed-by: Eric Dumazet

Re: [PATCH net-next v9 6/7] mptcp: introducing a helper into active reset logic

2024-04-26 Thread Eric Dumazet
ason. > > Note: using SK_RST_REASON_NOT_SPECIFIED is the same as > SK_RST_REASON_MPTCP_RST_EUNSPEC. They are both unknown. So we can convert > it directly. > > Suggested-by: Paolo Abeni > Signed-off-by: Jason Xing > Reviewed-by: Matthieu Baerts (NGI0) Reviewed-by: Eric Dumazet

Re: [PATCH net-next v9 5/7] mptcp: support rstreason for passive reset

2024-04-26 Thread Eric Dumazet
: Jason Xing > Reviewed-by: Matthieu Baerts (NGI0) Reviewed-by: Eric Dumazet

Re: [PATCH net-next v9 3/7] rstreason: prepare for active reset

2024-04-26 Thread Eric Dumazet
On Thu, Apr 25, 2024 at 5:14 AM Jason Xing wrote: > > From: Jason Xing > > Like what we did to passive reset: > only passing possible reset reason in each active reset path. > > No functional changes. > > Signed-off-by: Jason Xing > Acked-by: Matthieu Baerts (NGI0) Reviewed-by: Eric Dumazet

Re: [PATCH net-next v9 2/7] rstreason: prepare for passive reset

2024-04-26 Thread Eric Dumazet
On Thu, Apr 25, 2024 at 5:14 AM Jason Xing wrote: > > From: Jason Xing > > Adjust the parameter and support passing reason of reset which > is for now NOT_SPECIFIED. No functional changes. > > Signed-off-by: Jason Xing > Acked-by: Matthieu Baerts (NGI0) Reviewed-by: Eric Dumazet

Re: [PATCH net-next v9 1/7] net: introduce rstreason to detect why the RST is sent

2024-04-26 Thread Eric Dumazet
fter this series applied, it will have the ability to open a new > gate to let other people contribute more reasons into it :) > > Signed-off-by: Jason Xing > Acked-by: Matthieu Baerts (NGI0) Reviewed-by: Eric Dumazet

Re: [PATCH net-next v6 0/7] Implement reset reason mechanism to detect

2024-04-19 Thread Eric Dumazet
On Fri, Apr 19, 2024 at 9:29 AM Jason Xing wrote: > > On Fri, Apr 19, 2024 at 3:02 PM Eric Dumazet wrote: > > > > On Fri, Apr 19, 2024 at 4:31 AM Jason Xing > > wrote: > > > > > > On Fri, Apr 19, 2024 at 7:26 AM Jason Xing > > > wrote:

Re: [PATCH net-next v6 0/7] Implement reset reason mechanism to detect

2024-04-19 Thread Eric Dumazet
> + tcp_v4_send_reset(NULL, skb, rst_reason); > } > > discard_it: > > As you can see, we need to add a new 'rst_reason' variable which > actually is the same as drop reason. They are the same except for the > enum type... Such rst_reasons/drop_reasons are all over th

Re: [PATCH net-next v6 0/7] Implement reset reason mechanism to detect

2024-04-18 Thread Eric Dumazet
ted', until now I don't think I need to change something. > > > > > > Should I repost this series (keeping the v6 tag) and then wait for > > > more comments? > > > > If Eric doesn't like it - it's not getting merged. > > I'm not a English native speaker. If I un

Re: [PATCH net-next v6 1/7] net: introduce rstreason to detect why the RST is sent

2024-04-17 Thread Eric Dumazet
On Wed, Apr 17, 2024 at 10:51 AM Jason Xing wrote: > > From: Jason Xing > > Add a new standalone file for the easy future extension to support > both active reset and passive reset in the TCP/DCCP/MPTCP protocols. > > This patch only does the preparations for reset reason mechanism, > nothing

Re: [PATCH net-next v3 2/3] trace: tcp: fully support trace_tcp_send_reset

2024-03-29 Thread Eric Dumazet
On Fri, Mar 29, 2024 at 11:23 AM Jason Xing wrote: > > On Fri, Mar 29, 2024 at 5:07 PM Eric Dumazet wrote: > > > > On Fri, Mar 29, 2024 at 4:43 AM Jason Xing > > wrote: > > > > > > From: Jason Xing > > > > > > Prior to this pat

Re: [PATCH net-next v3 3/3] tcp: add location into reset trace process

2024-03-29 Thread Eric Dumazet
On Fri, Mar 29, 2024 at 4:43 AM Jason Xing wrote: > > From: Jason Xing > > In addition to knowing the 4-tuple of the flow which generates RST, > the reason why it does so is very important because we have some > cases where the RST should be sent and have no clue which one > exactly. > > Adding

Re: [PATCH net-next v3 2/3] trace: tcp: fully support trace_tcp_send_reset

2024-03-29 Thread Eric Dumazet
On Fri, Mar 29, 2024 at 4:43 AM Jason Xing wrote: > > From: Jason Xing > > Prior to this patch, what we can see by enabling trace_tcp_send is > only happening under two circumstances: > 1) active rst mode > 2) non-active rst mode and based on the full socket > > That means the inconsistency

Re: [PATCH net-next v3 1/3] trace: adjust TP_STORE_ADDR_PORTS_SKB() parameters

2024-03-29 Thread Eric Dumazet
igned-off-by: Jason Xing Reviewed-by: Eric Dumazet

Re: [PATCH net-next 0/3] trace: use TP_STORE_ADDRS macro

2024-03-26 Thread Eric Dumazet
On Tue, Mar 26, 2024 at 11:44 AM Jason Xing wrote: > Well, it's a pity that it seems that we are about to abandon this > method but it's not that friendly to the users who are unable to > deploy BPF... It is a pity these tracepoint patches are consuming a lot of reviewer time, just because some

Re: [PATCH v3 resend] net/ipv4: add tracepoint for icmp_send

2024-03-21 Thread Eric Dumazet
On Thu, Mar 21, 2024 at 4:09 AM wrote: > > From: he peilin > > Introduce a tracepoint for icmp_send, which can help users to get more > detail information conveniently when icmp abnormal events happen. > > 1. Giving an usecase example: > = > When an application

Re: [PATCH net-next v2 2/2] tcp: add tracing of skbaddr in tcp_event_skb class

2024-03-07 Thread Eric Dumazet
On Mon, Mar 4, 2024 at 10:29 AM Jason Xing wrote: > > From: Jason Xing > > Use the existing parameter and print the address of skbaddr > as other trace functions do. > > Signed-off-by: Jason Xing Reviewed-by: Eric Dumazet

Re: [PATCH net-next v2 1/2] tcp: add tracing of skb/skaddr in tcp_event_sk_skb class

2024-03-07 Thread Eric Dumazet
nd it will print like below: > > ...tcp_retransmit_skb: skbaddr=XXX skaddr=XXX family=AF_INET... > > Signed-off-by: Jason Xing Reviewed-by: Eric Dumazet

Re: [PATCH net-next 1/2] tcp: add tracing of skb/skaddr in tcp_event_sk_skb class

2024-03-04 Thread Eric Dumazet
On Thu, Feb 29, 2024 at 6:10 PM Jason Xing wrote: > > From: Jason Xing > > Prio to this patch, the trace function doesn't print addresses > which might be forgotten. As we can see, it already fetches > those, use it directly and it will print like below: > > ...tcp_retransmit_skb: skbaddr=XXX

Re: [PATCH net-next 0/2] add two missing addresses when using trace

2024-03-04 Thread Eric Dumazet
On Mon, Mar 4, 2024 at 8:01 AM Jason Xing wrote: > > On Fri, Mar 1, 2024 at 1:10 AM Jason Xing wrote: > > > > From: Jason Xing > > > > When I reviewed other people's patch [1], I noticed that similar thing > > also happens in tcp_event_skb class and tcp_event_sk_skb class. They > > don't print

Re: [PATCH net-next v2] tcp: Add skb addr and sock addr to arguments of tracepoint tcp_probe.

2024-03-04 Thread Eric Dumazet
On Mon, Mar 4, 2024 at 4:46 AM fuyuanli wrote: > > It is useful to expose skb addr and sock addr to user in tracepoint > tcp_probe, so that we can get more information while monitoring > receiving of tcp data, by ebpf or other ways. > > For example, we need to identify a packet by seq and end_seq

Re: [PATCH] net/ipv4: add tracepoint for icmp_send

2024-02-26 Thread Eric Dumazet
On Tue, Feb 27, 2024 at 3:50 AM wrote: > > From: xu xin > > Introduce a tracepoint for icmp_send, which can help users to get more > detail information conveniently when icmp abnormal events happen. > > 1. Giving an usecase example: > = > When an application

Re: [PATCH net-next 1/2] net/vsockmon: Leverage core stats allocator

2024-02-23 Thread Eric Dumazet
oesn't have to bother with error > handling (allocation failure checking, making sure free happens in the > right spot, etc). This is core responsibility now. > > Remove the allocation in the vsockmon driver and leverage the network > core allocation instead. > > Signed-off-by: Breno Leitao Reviewed-by: Eric Dumazet

Re: [PATCH net-next 2/2] net/vsockmon: Do not set zeroed statistics

2024-02-23 Thread Eric Dumazet
On Fri, Feb 23, 2024 at 12:58 PM Breno Leitao wrote: > > Do not set rtnl_link_stats64 fields to zero, since they are zeroed > before ops->ndo_get_stats64 is called in core dev_get_stats() function. > > Signed-off-by: Breno Leitao Reviewed-by: Eric Dumazet

Re: [PATCH v3] modules: wait do_free_init correctly

2024-02-20 Thread Eric Chanudet
false positive reports in > > W+X checking, and the rcu synchronization is unnecessary which can > > introduce significant delay. > > > > Eric Chanudet reports that the rcu_barrier introduces ~0.1s delay on a > > PREEMPT_RT kernel. > > [0.291444] Freeing unused kern

Re: [RESEND PATCH v2] modules: wait do_free_init correctly

2024-02-15 Thread Eric Chanudet
ng 0 # 1 systemd-1 [002] . 0.413351: rcu_barrier: rcu_preempt Inc2 cpu -1 remaining 0 # 1 With this patch the delay is no longer there: [0.377662] Freeing unused kernel memory: 14080K [0.377767] Run /sbin/init as init process AFAIU, for the race to happen, module_alloc() needs to create a W+X mapping (neither x86 nor arm64 does) and debug_checkwx() has to happen before module_enable_nx() in complete_formation(), I didn't get a reproducer so far. Best, -- Eric Chanudet

Re: [PATCH net-next v3] net: dqs: add NIC stall detector based on BQL

2024-02-14 Thread Eric Dumazet
On Wed, Feb 14, 2024 at 5:49 PM Breno Leitao wrote: > > On Wed, Feb 14, 2024 at 04:41:36PM +0100, Eric Dumazet wrote: > > On Wed, Feb 14, 2024 at 3:45 PM Breno Leitao wrote: > > > > > > On Tue, Feb 13, 2024 at 10:04:57AM -0800, Jakub Kicinski wrote: > > &g

Re: [PATCH net-next v3] net: dqs: add NIC stall detector based on BQL

2024-02-14 Thread Eric Dumazet
On Wed, Feb 14, 2024 at 3:45 PM Breno Leitao wrote: > > On Tue, Feb 13, 2024 at 10:04:57AM -0800, Jakub Kicinski wrote: > > On Tue, 13 Feb 2024 14:57:49 +0100 Eric Dumazet wrote: > > > Please note that adding other sysfs entries is expensive for workloads > > > crea

Re: [PATCH net-next v3] net: dqs: add NIC stall detector based on BQL

2024-02-13 Thread Eric Dumazet
On Fri, Feb 2, 2024 at 5:55 PM Breno Leitao wrote: > > From: Jakub Kicinski > > softnet_data->time_squeeze is sometimes used as a proxy for > host overload or indication of scheduling problems. In practice > this statistic is very noisy and has hard to grasp units - > e.g. is 10 squeezes a

Re: [PATCH net-next] tcp: add tracepoints for data send/recv/acked

2023-12-05 Thread Eric Dumazet
On Tue, Dec 5, 2023 at 3:11 AM Xuan Zhuo wrote: > > On Mon, 4 Dec 2023 13:28:21 +0100, Eric Dumazet wrote: > > On Mon, Dec 4, 2023 at 12:43 PM Philo Lu wrote: > > > > > > Add 3 tracepoints, namely tcp_data_send/tcp_data_recv/tcp_data_acked, > > > whi

Re: [PATCH net-next] tcp: add tracepoints for data send/recv/acked

2023-12-04 Thread Eric Dumazet
On Mon, Dec 4, 2023 at 12:43 PM Philo Lu wrote: > > Add 3 tracepoints, namely tcp_data_send/tcp_data_recv/tcp_data_acked, > which will be called every time a tcp data packet is sent, received, and > acked. > tcp_data_send: called after a data packet is sent. > tcp_data_recv: called after a data

Re: [PATCH net-next v7] net/core: Introduce netdev_core_stats_inc()

2023-10-09 Thread Eric Dumazet
On Mon, Oct 9, 2023 at 11:43 AM Yajun Deng wrote: > > > On 2023/10/9 17:30, Eric Dumazet wrote: > > On Mon, Oct 9, 2023 at 10:36 AM Yajun Deng wrote: > >> > >> On 2023/10/9 16:20, Eric Dumazet wrote: > >>> On Mon, Oct 9, 2023 at 10:14 AM Yajun Deng w

Re: [PATCH net-next v7] net/core: Introduce netdev_core_stats_inc()

2023-10-09 Thread Eric Dumazet
On Mon, Oct 9, 2023 at 10:36 AM Yajun Deng wrote: > > > On 2023/10/9 16:20, Eric Dumazet wrote: > > On Mon, Oct 9, 2023 at 10:14 AM Yajun Deng wrote: > >> > >> On 2023/10/9 15:53, Eric Dumazet wrote: > >>> On Mon, Oct 9, 2023 at 5:07 AM Y

Re: [PATCH net-next v7] net/core: Introduce netdev_core_stats_inc()

2023-10-09 Thread Eric Dumazet
On Mon, Oct 9, 2023 at 10:14 AM Yajun Deng wrote: > > > On 2023/10/9 15:53, Eric Dumazet wrote: > > On Mon, Oct 9, 2023 at 5:07 AM Yajun Deng wrote: > > > >> 'this_cpu_read + this_cpu_write' and 'pr_info + this_cpu_inc' will make > >> the trace

Re: [PATCH net-next v7] net/core: Introduce netdev_core_stats_inc()

2023-10-09 Thread Eric Dumazet
On Mon, Oct 9, 2023 at 5:07 AM Yajun Deng wrote: > 'this_cpu_read + this_cpu_write' and 'pr_info + this_cpu_inc' will make > the trace work well. > > They all have 'pop' instructions in them. This may be the key to making > the trace work well. > > Hi all, > > I need your help on percpu and

Re: [PATCH] certs: Restrict blacklist updates to the secondary trusted keyring

2023-09-12 Thread Eric Snowberg
> On Sep 12, 2023, at 4:47 PM, Mimi Zohar wrote: > > On Tue, 2023-09-12 at 17:11 +0000, Eric Snowberg wrote: >> >>> On Sep 12, 2023, at 5:54 AM, Mimi Zohar wrote: >>> >>> On Tue, 2023-09-12 at 02:00 +, Eric Snowberg wrote: >>>>

Re: [PATCH] certs: Restrict blacklist updates to the secondary trusted keyring

2023-09-12 Thread Eric Snowberg
> On Sep 12, 2023, at 5:54 AM, Mimi Zohar wrote: > > On Tue, 2023-09-12 at 02:00 +0000, Eric Snowberg wrote: >> >>> On Sep 11, 2023, at 5:08 PM, Mimi Zohar wrote: >>> >>> On Mon, 2023-09-11 at 22:17 +, Eric Snowberg wrote: >>>> >

Re: [PATCH] certs: Restrict blacklist updates to the secondary trusted keyring

2023-09-11 Thread Eric Snowberg
> On Sep 11, 2023, at 5:08 PM, Mimi Zohar wrote: > > On Mon, 2023-09-11 at 22:17 +0000, Eric Snowberg wrote: >> >>> On Sep 11, 2023, at 10:51 AM, Mickaël Salaün wrote: >>> >>> On Mon, Sep 11, 2023 at 09:29:07AM -0400, Mimi Zohar wrote: >>&g

Re: [PATCH] certs: Restrict blacklist updates to the secondary trusted keyring

2023-09-11 Thread Eric Snowberg
> On Sep 11, 2023, at 4:04 PM, Jarkko Sakkinen wrote: > > On Mon Sep 11, 2023 at 4:29 PM EEST, Mimi Zohar wrote: >> Hi Eric, >> >> On Fri, 2023-09-08 at 17:34 -0400, Eric Snowberg wrote: >>> Currently root can dynamically update the blacklist keyring i

Re: [PATCH] certs: Restrict blacklist updates to the secondary trusted keyring

2023-09-11 Thread Eric Snowberg
> On Sep 11, 2023, at 10:51 AM, Mickaël Salaün wrote: > > On Mon, Sep 11, 2023 at 09:29:07AM -0400, Mimi Zohar wrote: >> Hi Eric, >> >> On Fri, 2023-09-08 at 17:34 -0400, Eric Snowberg wrote: >>> Currently root can dynamically update the blacklist keyring i

Re: [PATCH] fs: Replace kmap{,_atomic}() with kmap_local_page()

2022-06-30 Thread Eric W. Biederman
hat can sleep in page faults so any nearly any requirement except a thread local use is invalidated. As you have described kmap_local above it does not sound like kmap_local is safe in this context, but that could just be a problem in description that my poor memory does is not recalling the ne

Re: [PATCH v3 bpf-next 00/11] Socket migration for SO_REUSEPORT.

2021-04-20 Thread Eric Dumazet
On 4/20/21 5:41 PM, Kuniyuki Iwashima wrote: > The SO_REUSEPORT option allows sockets to listen on the same port and to > accept connections evenly. However, there is a defect in the current > implementation [1]. When a SYN packet is received, the connection is tied > to a listening socket.

Re: BUG: KASAN: use-after-free in page_to_skb.isra.0+0x300/0x418

2021-04-20 Thread Eric Dumazet
On Tue, Apr 20, 2021 at 3:45 PM Naresh Kamboju wrote: > > Following kernel BUG reported on qemu-arm64 running linux next 20210420 > the config is enabled with KASAN. > > steps to reproduce: > > - Build the arm64 kernel with KASAN enabled. > - boot it with below

Re: [PATCH] tcp: prevent loss of bytes when using syncookie

2021-04-20 Thread Eric Dumazet
On Tue, Apr 20, 2021 at 2:00 PM zhaoya wrote: > > When using syncookie, since $MSSID is spliced into cookie and > the legal index of msstab is 0,1,2,3, this gives client 3 bytes > of freedom, resulting in at most 3 bytes of silent loss. > > C seq=12345-> S > C

Re: [PATCH] net: called rtnl_unlock() before runpm resumes devices

2021-04-20 Thread Eric Dumazet
On Tue, Apr 20, 2021 at 9:54 AM AceLan Kao wrote: > > From: "Chia-Lin Kao (AceLan)" > > The rtnl_lock() has been called in rtnetlink_rcv_msg(), and then in > __dev_open() it calls pm_runtime_resume() to resume devices, and in > some devices' resume function(igb_resum,igc_resume) they calls

Re: [PATCH 1/1 v9] use crc32 instead of md5 for hibernation e820 integrity check

2021-04-19 Thread Eric Biggers
uot;Fixes" line shouldn't be line-wrapped. Otherwise this looks fine. The explanation in the commit message still isn't great, but it's much better than it was before. You can add: Reviewed-by: Eric Biggers - Eric

Re: [PATCH net] gro: fix napi_gro_frags() Fast GRO breakage due to IP alignment check

2021-04-19 Thread Eric Dumazet
eth = skb_gro_header_slow(skb, hlen, 0); > -- > 2.31.1 > > Good catch, thanks. This has the unfortunate effect of increasing code length on x86, maybe we should have an exception to normal rules so that skb_gro_reset_offset() is inlined. Reviewed-by: Eric Dumazet

Re: PROBLEM: DoS Attack on Fragment Cache

2021-04-19 Thread Eric Dumazet
On Sun, Apr 18, 2021 at 4:31 PM Matt Corallo wrote: > > Should the default, though, be so low? If someone is still using a old modem > they can crank up the sysctl, it does seem > like such things are pretty rare these days :). Its rather trivial to, > without any kind of attack, hit 1Mbps of

Re: [PATCH] capabilities: require CAP_SETFCAP to map uid 0 (v3.2)

2021-04-18 Thread Eric W. Biederman
se problems as is, I will be surprised. Eric "Serge E. Hallyn" writes: > A process running as uid 0 but without cap_setfcap currently can simply > unshare a new user namespace with uid 0 mapped to 0. While this task > will not have new capabilities against the parent namespac

Re: [PATCH] x86/uaccess: small optimization in unsafe_copy_to_user()

2021-04-17 Thread Eric Dumazet
On Sat, Apr 17, 2021 at 6:03 PM Linus Torvalds wrote: > > On Fri, Apr 16, 2021 at 12:24 PM Eric Dumazet wrote: > > > > From: Eric Dumazet > > > > We have to loop only to copy u64 values. > > After this first loop, we copy at most one u32, one u16 and one

Re: [External] Re: [PATCH] tcp: fix silent loss when syncookie is trigered

2021-04-16 Thread Eric Dumazet
On Sat, Apr 17, 2021 at 12:45 AM 赵亚 wrote: > > On Fri, Apr 16, 2021 at 7:52 PM Eric Dumazet wrote: > > > > On Fri, Apr 16, 2021 at 12:52 PM zhaoya wrote: > > > > > > When syncookie is triggered, since $MSSID is spliced into cookie and > > > the

Re: [PATCH net] net/core/dev.c: Ensure pfmemalloc skbs are correctly handled when receiving

2021-04-16 Thread Eric Dumazet
kb". > This patch also fixes it. > > Fixes: b4b9e3558508 ("netvm: set PF_MEMALLOC as appropriate during SKB > processing") > Cc: Mel Gorman > Cc: David S. Miller > Cc: Neil Brown > Cc: Peter Zijlstra > Cc: Jiri Slaby > Cc: Mike Christie >

Re: PROBLEM: DoS Attack on Fragment Cache

2021-04-16 Thread Eric Dumazet
On Sat, Apr 17, 2021 at 2:31 AM David Ahern wrote: > > [ cc author of 648700f76b03b7e8149d13cc2bdb3355035258a9 ] I think this has been discussed already. There is no strategy that makes IP reassembly units immune to DDOS attacks. We added rb-tree and sysctls to let admins choose to use GB of

Re: [PATCH] x86/uaccess: small optimization in unsafe_copy_to_user()

2021-04-16 Thread Eric Dumazet
On Fri, Apr 16, 2021 at 10:11 PM Eric Dumazet wrote: > > On Fri, Apr 16, 2021 at 9:44 PM Al Viro wrote: > > > > On Fri, Apr 16, 2021 at 12:24:13PM -0700, Eric Dumazet wrote: > > > From: Eric Dumazet > > > > > > We have to loop only to copy u64

Re: [PATCH] x86/uaccess: small optimization in unsafe_copy_to_user()

2021-04-16 Thread Eric Dumazet
On Fri, Apr 16, 2021 at 9:44 PM Al Viro wrote: > > On Fri, Apr 16, 2021 at 12:24:13PM -0700, Eric Dumazet wrote: > > From: Eric Dumazet > > > > We have to loop only to copy u64 values. > > After this first loop, we copy at most one u32, one u16 and one byte. >

[PATCH] x86/uaccess: small optimization in unsafe_copy_to_user()

2021-04-16 Thread Eric Dumazet
From: Eric Dumazet We have to loop only to copy u64 values. After this first loop, we copy at most one u32, one u16 and one byte. Signed-off-by: Eric Dumazet --- arch/x86/include/asm/uaccess.h | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/arch/x86/include

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-16 Thread Auger Eric
Hi Jason, On 4/16/21 4:34 PM, Jason Gunthorpe wrote: > On Fri, Apr 16, 2021 at 04:26:19PM +0200, Auger Eric wrote: > >> This was largely done during several confs including plumber, KVM forum, >> for several years. Also API docs were shared on the ML. I don't remember >&

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-16 Thread Auger Eric
Hi, On 4/16/21 4:05 PM, Jason Gunthorpe wrote: > On Fri, Apr 16, 2021 at 03:38:02PM +0200, Auger Eric wrote: > >> The redesign requirement came pretty late in the development process. >> The iommu user API is upstream for a while, the VFIO interfaces have >> been s

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-16 Thread Auger Eric
Hi Jason, On 4/16/21 1:07 AM, Jason Gunthorpe wrote: > On Thu, Apr 15, 2021 at 03:11:19PM +0200, Auger Eric wrote: >> Hi Jason, >> >> On 4/1/21 6:03 PM, Jason Gunthorpe wrote: >>> On Thu, Apr 01, 2021 at 02:08:17PM +, Liu, Yi L wrote: >>> >>>>

Re: [PATCH] tcp: fix silent loss when syncookie is trigered

2021-04-16 Thread Eric Dumazet
On Fri, Apr 16, 2021 at 12:52 PM zhaoya wrote: > > When syncookie is triggered, since $MSSID is spliced into cookie and > the legal index of msstab is 0,1,2,3, this gives client 3 bytes > of freedom, resulting in at most 3 bytes of silent loss. > > C seq=12345-> S > C

Re: [PATCH 4.14 16/68] net: ensure mac header is set in virtio_net_hdr_to_skb()

2021-04-16 Thread Eric Dumazet
On Fri, Apr 16, 2021 at 10:49 AM Balazs Nemeth wrote: > > On Thu, 2021-04-15 at 16:46 +0200, Greg Kroah-Hartman wrote: > > From: Eric Dumazet > > > > commit 61431a5907fc36d0738e9a547c7e1556349a03e9 upstream. > > > > Commit 924a9bc362a

Re: [PATCH v8 1/1] use crc32 instead of md5 for hibernation e820 integrity check

2021-04-15 Thread Eric Biggers
hould be updated, in arch/x86/kernel/e820.c. - Eric

Re: [PATCH v2 8/8] block: add WARN() in bio_split() for sector alignment

2021-04-15 Thread Eric Biggers
t;= 0); > BUG_ON(sectors >= bio_sectors(bio)); > + WARN_ON(!IS_ALIGNED(sectors, bio_required_sector_alignment(bio))); If this warning triggers, shouldn't the function return NULL to indicate a failure rather than proceeding on? - Eric

Re: [PATCH v2 6/8] block: keyslot-manager: introduce blk_ksm_restrict_dus_to_queue_limits()

2021-04-15 Thread Eric Biggers
if (blk_integrity_queue_supports_integrity(q)) { > pr_warn("Integrity and hardware inline encryption are not > supported together. Disabling hardware inline encryption.\n"); > return false; > } > + > + blk_ksm_restrict_dus_to_queue_limits(ksm, >limits); > + > + if (blk_ksm_is_empty(ksm)) > + return false; > + > q->ksm = ksm; > return true; > } Adding a kerneldoc comment to this function would be helpful. Especially to explain what a return value of false means, exactly. - Eric

Re: [PATCH v2 5/8] block: respect bio_required_sector_alignment() in blk-crypto-fallback

2021-04-15 Thread Eric Biggers
umstances? - Eric

Re: [PATCH v2 4/8] block: introduce bio_required_sector_alignment()

2021-04-15 Thread Eric Biggers
On Thu, Mar 25, 2021 at 09:26:05PM +, Satya Tangirala wrote: > This function returns the required alignment for the number of sectors in > a bio. In particular, the number of sectors passed to bio_split() must be > aligned to this value. > > Signed-off-by: Satya Tangirala > --- >

Re: [PATCH v2 4/8] block: introduce bio_required_sector_alignment()

2021-04-15 Thread Eric Biggers
aximum > required. I don't see how that would work here, as the required alignment is a per-bio thing which depends on whether the bio has an encryption context or not, and (if it does) also the data_unit_size the submitter of the bio selected. We could just always assume the worst-case scenario, but that seems unnecessarily pessimistic? - Eric

Re: [PATCH v2 3/8] block: blk-crypto: introduce blk_crypto_bio_sectors_alignment()

2021-04-15 Thread Eric Biggers
ata unit size that was selected by the submitter of the bio, which is the granularity of encryption/decryption. Keep in mind that people reading this code won't necessarily be familiar with inline encryption. - Eric

Re: [PATCH v2 2/8] dm,mmc,ufshcd: handle error from blk_ksm_register()

2021-04-15 Thread Eric Biggers
earing UFSHCD_CAP_CRYPTO or MMC_CAP2_CRYPTO doesn't really make sense here because those capabilities apply to the whole UFS or MMC host controller, not just to the individual request_queue which failed. (A host controller can control multiple devices, each of which has its own request_queue.) Isn't blk_ksm_register() failing already enough to ensure that the inline crypto support isn't used on that particular request_queue? What is the benefit of clearing UFSHCD_CAP_CRYPTO and MMC_CAP2_CRYPTO too? - Eric

Re: [PATCH v2 1/8] block: introduce blk_ksm_is_empty()

2021-04-15 Thread Eric Biggers
l blk_ksm_is_empty(struct blk_keyslot_manager *ksm); > + It's easier to read if declarations are kept in the same order as the definitions. - Eric

Re: [PROBLEM] a data race between tcp_set_default_congestion_control() and tcp_set_congestion_control()

2021-04-15 Thread Eric Dumazet
On Thu, Apr 15, 2021 at 5:47 PM Gong, Sishuai wrote: > > Hi, > > We found a data race between tcp_set_default_congestion_control() and > tcp_set_congestion_control() in linux-5.12-rc3. > In general, when tcp_set_congestion_control() is reading ca->flags with a > lock grabbed,

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-04-15 Thread Auger Eric
-PCI QEMU device. this latter retrives the faault from the mmapped circ buffer, it knowns which vIOMMU it is attached to, and passes the fault to the vIOMMU. Then the vIOMMU triggers and IRQ in the guest. We are reusing the existing concepts from VFIO, region, IRQ to do that. For that use case, would

[tip: sched/core] rseq: Optimize rseq_update_cpu_id()

2021-04-15 Thread tip-bot2 for Eric Dumazet
The following commit has been merged into the sched/core branch of tip: Commit-ID: 60af388d23889636011488c42763876bcdda3eab Gitweb: https://git.kernel.org/tip/60af388d23889636011488c42763876bcdda3eab Author:Eric Dumazet AuthorDate:Tue, 13 Apr 2021 13:33:50 -07:00

[tip: sched/core] rseq: Remove redundant access_ok()

2021-04-15 Thread tip-bot2 for Eric Dumazet
The following commit has been merged into the sched/core branch of tip: Commit-ID: 0ed96051531ecc6965f6456d25b19b9b6bdb5c28 Gitweb: https://git.kernel.org/tip/0ed96051531ecc6965f6456d25b19b9b6bdb5c28 Author:Eric Dumazet AuthorDate:Tue, 13 Apr 2021 13:33:51 -07:00

[tip: sched/core] rseq: Optimise rseq_get_rseq_cs() and clear_rseq_cs()

2021-04-15 Thread tip-bot2 for Eric Dumazet
The following commit has been merged into the sched/core branch of tip: Commit-ID: 5e0ccd4a3b01c5a71732a13186ca110a138516ea Gitweb: https://git.kernel.org/tip/5e0ccd4a3b01c5a71732a13186ca110a138516ea Author:Eric Dumazet AuthorDate:Tue, 13 Apr 2021 13:33:52 -07:00

Re: [PATCH net-next v3 2/5] mm: add a signature in struct page

2021-04-14 Thread Eric Dumazet
On Wed, Apr 14, 2021 at 10:09 PM Shakeel Butt wrote: > > I will let TCP RX zerocopy experts respond to this but from my high > level code inspection, I didn't see page->private usage. Indeed, we do not use page->private, since we do not own the page(s).

Re: [PATCH v2 3/3] rseq: optimise rseq_get_rseq_cs() and clear_rseq_cs()

2021-04-14 Thread Eric Dumazet
On Wed, Apr 14, 2021 at 10:15 PM Arjun Roy wrote: > > On Wed, Apr 14, 2021 at 10:35 AM Eric Dumazet wrote: > > > > On Wed, Apr 14, 2021 at 7:15 PM Arjun Roy wrote: > > > > > > On Wed, Apr 14, 2021 at 9:10 AM Eric Dumazet wrote: > > > > >

Re: [GIT PULL][PATCH v9 0/3] Update to zstd-1.4.10

2021-04-14 Thread Eric Biggers
On Wed, Apr 14, 2021 at 11:53:51AM -0700, Nick Terrell wrote: > On Wed, Apr 14, 2021 at 11:35 AM Eric Biggers wrote: > > > > On Wed, Apr 14, 2021 at 11:01:29AM -0700, Nick Terrell wrote: > > > Hi all, > > > > > > I would really like to ma

Re: [GIT PULL][PATCH v9 0/3] Update to zstd-1.4.10

2021-04-14 Thread Eric Biggers
import zstd directly from upstream so we don't fall 3 > years out of date again > > Thanks, > Nick > I think it would help get it merged if someone actually volunteered to maintain it. As-is there is no entry in MAINTAINERS for this code. - Eric

Re: [PATCH v2 3/3] rseq: optimise rseq_get_rseq_cs() and clear_rseq_cs()

2021-04-14 Thread Eric Dumazet
On Wed, Apr 14, 2021 at 7:15 PM Arjun Roy wrote: > > On Wed, Apr 14, 2021 at 9:10 AM Eric Dumazet wrote: > > > > On Wed, Apr 14, 2021 at 6:08 PM David Laight > > wrote: > > > > > > From: Eric Dumazet > > > > Sent: 14 April 2021 17:0

[PATCH] sh: remove unused variable

2021-04-14 Thread Eric Dumazet
From: Eric Dumazet Removes this annoying warning: arch/sh/kernel/traps.c: In function ‘nmi_trap_handler’: arch/sh/kernel/traps.c:183:15: warning: unused variable ‘cpu’ [-Wunused-variable] 183 | unsigned int cpu = smp_processor_id(); Fixes: fe3f1d5d7cd3 ("sh: Get rid of nmi_count()&quo

Re: [PATCH v2 3/3] rseq: optimise rseq_get_rseq_cs() and clear_rseq_cs()

2021-04-14 Thread Eric Dumazet
On Wed, Apr 14, 2021 at 6:08 PM David Laight wrote: > > From: Eric Dumazet > > Sent: 14 April 2021 17:00 > ... > > > Repeated unsafe_get_user() calls are crying out for an optimisation. > > > You get something like: > > > failed = 0; > >

Re: [PATCH v2 3/3] rseq: optimise rseq_get_rseq_cs() and clear_rseq_cs()

2021-04-14 Thread Eric Dumazet
On Wed, Apr 14, 2021 at 9:55 AM David Laight wrote: > > From: Arjun Roy > > Sent: 13 April 2021 23:04 > > > > On Tue, Apr 13, 2021 at 2:19 PM David Laight > > wrote: > > > > > > > If we're special-casing 64-bit architectures anyways - unrolling the > > > > 32B copy_from_user() for struct

Darlehensvorschlag zwischen Einzelpersonen

2021-04-13 Thread Eric Chaix
Hallo, Ich biete Kredite an Personen an, die Geld für ihre benötigen kleine Finanzierungsprobleme, um endlich den Stillstand zu überwinden provozieren Sie die Banken, indem Sie Ihre Bewerbungsunterlagen für ablehnen Anerkennung. Ich bin ein französischer Staatsbürger, der Ihnen einen Kredit

[PATCH v3 2/3] rseq: remove redundant access_ok()

2021-04-13 Thread Eric Dumazet
From: Eric Dumazet After commit 8f2817701492 ("rseq: Use get_user/put_user rather than __get_user/__put_user") we no longer need an access_ok() call from __rseq_handle_notify_resume() Mathieu pointed out the same cleanup can be done in rseq_syscall(). Signed-off-by: Eric Dumazet C

[PATCH v3 3/3] rseq: optimise rseq_get_rseq_cs() and clear_rseq_cs()

2021-04-13 Thread Eric Dumazet
From: Eric Dumazet Commit ec9c82e03a74 ("rseq: uapi: Declare rseq_cs field as union, update includes") added regressions for our servers. Using copy_from_user() and clear_user() for 64bit values is suboptimal. We can use faster put_user() and get_user() on 64bit arches. Signed-of

[PATCH v3 0/3] rseq: minor optimizations

2021-04-13 Thread Eric Dumazet
From: Eric Dumazet rseq is a heavy user of copy to/from user data in fast paths. This series tries to reduce the cost. v3: Third patch going back to v1 (only deal with 64bit arches) v2: Addressed Peter and Mathieu feedbacks, thanks ! Eric Dumazet (3): rseq: optimize rseq_update_cpu_id

[PATCH v3 1/3] rseq: optimize rseq_update_cpu_id()

2021-04-13 Thread Eric Dumazet
From: Eric Dumazet Two put_user() in rseq_update_cpu_id() are replaced by a pair of unsafe_put_user() with appropriate surroundings. This removes one stac/clac pair on x86 in fast path. Signed-off-by: Eric Dumazet Cc: Mathieu Desnoyers Cc: Peter Zijlstra Cc: "Paul E. McKenney"

Re: [PATCH v7 1/1] use crc32 instead of md5 for hibernation e820 integrity check

2021-04-13 Thread Eric Biggers
nsigned long jump_address_phys; > unsigned long cr3; > unsigned long magic; > - u8 e820_digest[MD5_DIGEST_SIZE]; > + unsigned long e820_digest; > }; This field should probably be renamed to 'e820_crc' or 'e820_checksum', since "digest" normally means a cryptographic digest. - Eric

Re: [PATCH v7 1/1] use crc32 instead of md5 for hibernation e820 integrity check

2021-04-13 Thread Eric Biggers
header_restore(void *addr) > jump_address_phys = rdr->jump_address_phys; > restore_cr3 = rdr->cr3; > > - if (hibernation_e820_mismatch(rdr->e820_digest)) { > + if (hibernation_e820_mismatch(>e820_digest)) { Likewise, this should be just if (rdr->e820_digest != compute_e820_crc32(e820_table_firmware)) { - Eric

Re: [PATCH v2 3/3] rseq: optimise rseq_get_rseq_cs() and clear_rseq_cs()

2021-04-13 Thread Eric Dumazet
On Tue, Apr 13, 2021 at 8:00 PM Mathieu Desnoyers wrote: > > As long as the ifdefs are localized within clearly identified wrappers in the > rseq code I don't mind doing the special-casing there. > > The point which remains is that I don't think we want to optimize for speed > on 32-bit

Re: [PATCH v2 3/3] rseq: optimise rseq_get_rseq_cs() and clear_rseq_cs()

2021-04-13 Thread Eric Dumazet
On Tue, Apr 13, 2021 at 7:20 PM Mathieu Desnoyers wrote: > > - On Apr 13, 2021, at 1:07 PM, Eric Dumazet eduma...@google.com wrote: > > > On Tue, Apr 13, 2021 at 7:01 PM Eric Dumazet wrote: > >> > >> On Tue, Apr 13, 2021 at 6:57 PM Eric Dumazet wrote: > &

Re: [PATCH v2 3/3] rseq: optimise rseq_get_rseq_cs() and clear_rseq_cs()

2021-04-13 Thread Eric Dumazet
On Tue, Apr 13, 2021 at 7:01 PM Eric Dumazet wrote: > > On Tue, Apr 13, 2021 at 6:57 PM Eric Dumazet wrote: > > > > On Tue, Apr 13, 2021 at 6:54 PM Mathieu Desnoyers > > wrote: > > > > > > - On Apr 13, 2021, at 12:22 PM, Eric Dumazet eric.duma...@

Re: [PATCH v2 3/3] rseq: optimise rseq_get_rseq_cs() and clear_rseq_cs()

2021-04-13 Thread Eric Dumazet
On Tue, Apr 13, 2021 at 6:57 PM Eric Dumazet wrote: > > On Tue, Apr 13, 2021 at 6:54 PM Mathieu Desnoyers > wrote: > > > > - On Apr 13, 2021, at 12:22 PM, Eric Dumazet eric.duma...@gmail.com > > wrote: > > > > > From: Eric Dumazet > > &

Re: [PATCH v2 3/3] rseq: optimise rseq_get_rseq_cs() and clear_rseq_cs()

2021-04-13 Thread Eric Dumazet
On Tue, Apr 13, 2021 at 6:54 PM Mathieu Desnoyers wrote: > > - On Apr 13, 2021, at 12:22 PM, Eric Dumazet eric.duma...@gmail.com wrote: > > > From: Eric Dumazet > > > > Commit ec9c82e03a74 ("rseq: uapi: Declare rseq_cs field as union, > > update includ

[PATCH v2 3/3] rseq: optimise rseq_get_rseq_cs() and clear_rseq_cs()

2021-04-13 Thread Eric Dumazet
From: Eric Dumazet Commit ec9c82e03a74 ("rseq: uapi: Declare rseq_cs field as union, update includes") added regressions for our servers. Using copy_from_user() and clear_user() for 64bit values is suboptimal. We can use faster put_user() and get_user(). 32bit arches can be chan

[PATCH v2 2/3] rseq: remove redundant access_ok()

2021-04-13 Thread Eric Dumazet
From: Eric Dumazet After commit 8f2817701492 ("rseq: Use get_user/put_user rather than __get_user/__put_user") we no longer need an access_ok() call from __rseq_handle_notify_resume() Mathieu pointed out the same cleanup can be done in rseq_syscall(). Signed-off-by: Eric Dumazet C

[PATCH v2 1/3] rseq: optimize rseq_update_cpu_id()

2021-04-13 Thread Eric Dumazet
From: Eric Dumazet Two put_user() in rseq_update_cpu_id() are replaced by a pair of unsafe_put_user() with appropriate surroundings. This removes one stac/clac pair on x86 in fast path. Signed-off-by: Eric Dumazet Cc: Mathieu Desnoyers Cc: Peter Zijlstra Cc: "Paul E. McKenney"

  1   2   3   4   5   6   7   8   9   10   >