Re: [PATCH net-next v2 0/3] introduce skb_for_each_frag()

2021-04-16 Thread Matteo Croce
On Tue, Apr 13, 2021 at 9:53 AM David Laight wrote: > > From: Matteo Croce > > Sent: 12 April 2021 01:38 > > > > Introduce skb_for_each_frag, an helper macro to iterate over the SKB frags. > > The real question is why, the change is: > > - for (i =

[PATCH net-next v2 3/3] net: use skb_for_each_frag() in illegal_highdma()

2021-04-11 Thread Matteo Croce
From: Matteo Croce Coccinelle failed with the following error: EXN: Failure("no position information") in net/core/dev.c Apply it by hand as it's trivial. Signed-off-by: Matteo Croce --- net/core/dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/d

[PATCH net-next v2 2/3] net: use skb_for_each_frag() helper where possible

2021-04-11 Thread Matteo Croce
From: Matteo Croce use the new helper macro skb_for_each_frag() which allows to iterate through all the SKB fragments. The patch was created with Coccinelle, this was the semantic patch: @@ struct sk_buff *skb; identifier i; statement S; iterator name skb_for_each_frag; @@ -for (i = 0; i

[PATCH net-next v2 0/3] introduce skb_for_each_frag()

2021-04-11 Thread Matteo Croce
From: Matteo Croce Introduce skb_for_each_frag, an helper macro to iterate over the SKB frags. First patch introduces the helper, the second one is generated with coccinelle and uses the macro where possible. Last one is a chunk which have to be applied by hand. The second patch raises some

[PATCH net-next v2 1/3] skbuff: add helper to walk over the fraglist

2021-04-11 Thread Matteo Croce
From: Matteo Croce Add an skb_for_each_frag() macro to iterate on SKB fragments. Signed-off-by: Matteo Croce --- include/linux/skbuff.h | 4 1 file changed, 4 insertions(+) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index dbf820a50a39..a8d4ccacdda5 100644 --- a/include

Re: [PATCH net-next 2/3] net: use skb_for_each_frag() helper where possible

2021-04-09 Thread Matteo Croce
On Fri, Apr 9, 2021 at 11:28 PM Jakub Kicinski wrote: > > On Fri, 9 Apr 2021 22:44:50 +0200 Matteo Croce wrote: > > > What pops to mind (although quite nit picky) is the question if the > > > assembly changes much between driver which used to cache nr_frags and > >

Re: [PATCH net-next v3 3/5] page_pool: Allow drivers to hint on SKB recycling

2021-04-09 Thread Matteo Croce
On Sat, Apr 10, 2021 at 2:11 AM Ilias Apalodimas wrote: > > Hi Matteo, > > [...] > > +bool page_pool_return_skb_page(void *data); > > + > > struct page_pool *page_pool_create(const struct page_pool_params *params); > > > > #ifdef CONFIG_PAGE_POOL > > @@ -243,4 +247,13 @@ static inline void

[PATCH net-next v3 4/5] mvpp2: recycle buffers

2021-04-09 Thread Matteo Croce
From: Matteo Croce Use the new recycling API for page_pool. In a drop rate test, the packet rate is more than doubled, from 962 Kpps to 2047 Kpps. perf top on a stock system shows: Overhead Shared Object Symbol 30.67% [kernel] [k] page_pool_release_page 8.37% [kernel

[PATCH net-next v3 5/5] mvneta: recycle buffers

2021-04-09 Thread Matteo Croce
From: Matteo Croce Use the new recycling API for page_pool. In a drop rate test, the packet rate increased di 10%, from 269 Kpps to 296 Kpps. perf top on a stock system shows: Overhead Shared Object Symbol 21.78% [kernel] [k] __pi___inval_dcache_area 21.66% [mvneta

[PATCH net-next v3 3/5] page_pool: Allow drivers to hint on SKB recycling

2021-04-09 Thread Matteo Croce
->private and enabling the recycling bit, or page_pool_store_mem_info() for a fragment Since we added an extra argument on __skb_frag_unref() to handle recycling, update the current users of the function with that. Co-developed-by: Jesper Dangaard Brouer Co-developed-by: Matteo Croce Signed-of

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

2021-04-09 Thread Matteo Croce
From: Matteo Croce This is needed by the page_pool to avoid recycling a page not allocated via page_pool. Signed-off-by: Matteo Croce --- include/linux/mm_types.h | 1 + include/net/page_pool.h | 2 ++ net/core/page_pool.c | 4 3 files changed, 7 insertions(+) diff --git a/include

[PATCH net-next v3 1/5] xdp: reduce size of struct xdp_mem_info

2021-04-09 Thread Matteo Croce
From: Jesper Dangaard Brouer It is possible to compress/reduce the size of struct xdp_mem_info. This change reduce struct xdp_mem_info from 8 bytes to 4 bytes. The member xdp_mem_info.id can be reduced to u16, as the mem_id_ht rhashtable in net/core/xdp.c is already limited by MEM_ID_MAX=0xFFFE

[PATCH net-next v3 0/5] page_pool: recycle buffers

2021-04-09 Thread Matteo Croce
From: Matteo Croce This is a respin of [1] This patchset shows the plans for allowing page_pool to handle and maintain DMA map/unmap of the pages it serves to the driver. For this to work a return hook in the network core is introduced. The overall purpose is to simplify drivers

Re: [PATCH net-next 2/3] net: use skb_for_each_frag() helper where possible

2021-04-09 Thread Matteo Croce
On Fri, Apr 9, 2021 at 8:54 PM Jakub Kicinski wrote: > > On Fri, 9 Apr 2021 20:06:04 +0200 Matteo Croce wrote: > > From: Matteo Croce > > > > use the new helper macro skb_for_each_frag() which allows to iterate > > through all the SKB fragments. > > >

[PATCH net-next 2/3] net: use skb_for_each_frag() helper where possible

2021-04-09 Thread Matteo Croce
From: Matteo Croce use the new helper macro skb_for_each_frag() which allows to iterate through all the SKB fragments. The patch was created with Coccinelle, this was the semantic patch: @@ struct sk_buff *skb; identifier i; statement S; iterator name skb_for_each_frag; @@ -for (i = 0; i

[PATCH net-next 3/3] net: use skb_for_each_frag() in illegal_highdma()

2021-04-09 Thread Matteo Croce
From: Matteo Croce Coccinelle failed with the following error: EXN: Failure("no position information") in net/core/dev.c Apply it by hand as it's trivial. Signed-off-by: Matteo Croce --- net/core/dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/d

[PATCH net-next 1/3] skbuff: add helper to walk over the fraglist

2021-04-09 Thread Matteo Croce
From: Matteo Croce Add an skb_for_each_frag() macro to iterate on SKB fragments. Signed-off-by: Matteo Croce --- include/linux/skbuff.h | 4 1 file changed, 4 insertions(+) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index dbf820a50a39..a8d4ccacdda5 100644 --- a/include

[PATCH net-next 0/3] introduce skb_for_each_frag()

2021-04-09 Thread Matteo Croce
From: Matteo Croce Introduce skb_for_each_frag, an helper macro to iterate over the SKB frags. First patch introduces the helper, the second one is generated with coccinelle and uses the macro where possible. Last one is a chunk which have to be applied by hand. The second patch raises some

[PATCH net-next v2 5/5] mvneta: recycle buffers

2021-04-02 Thread Matteo Croce
From: Matteo Croce Use the new recycling API for page_pool. In a drop rate test, the packet rate increased di 10%, from 269 Kpps to 296 Kpps. perf top on a stock system shows: Overhead Shared Object Symbol 21.78% [kernel] [k] __pi___inval_dcache_area 21.66% [mvneta

[PATCH net-next v2 4/5] mvpp2: recycle buffers

2021-04-02 Thread Matteo Croce
From: Matteo Croce Use the new recycling API for page_pool. In a drop rate test, the packet rate is more than doubled, from 962 Kpps to 2047 Kpps. perf top on a stock system shows: Overhead Shared Object Symbol 30.67% [kernel] [k] page_pool_release_page 8.37% [kernel

[PATCH net-next v2 3/5] page_pool: Allow drivers to hint on SKB recycling

2021-04-02 Thread Matteo Croce
->private and enabling the recycling bit, or page_pool_store_mem_info() for a fragment Since we added an extra argument on __skb_frag_unref() to handle recycling, update the current users of the function with that. Co-developed-by: Jesper Dangaard Brouer Co-developed-by: Matteo Croce Signed-o

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

2021-04-02 Thread Matteo Croce
From: Matteo Croce This is needed by the page_pool to avoid recycling a page not allocated via page_pool. Signed-off-by: Matteo Croce --- include/linux/mm_types.h | 1 + include/net/page_pool.h | 2 ++ net/core/page_pool.c | 4 3 files changed, 7 insertions(+) diff --git a/include

[PATCH net-next v2 1/5] xdp: reduce size of struct xdp_mem_info

2021-04-02 Thread Matteo Croce
From: Jesper Dangaard Brouer It is possible to compress/reduce the size of struct xdp_mem_info. This change reduce struct xdp_mem_info from 8 bytes to 4 bytes. The member xdp_mem_info.id can be reduced to u16, as the mem_id_ht rhashtable in net/core/xdp.c is already limited by MEM_ID_MAX=0xFFFE

[PATCH net-next v2 0/5] page_pool: recycle buffers

2021-04-02 Thread Matteo Croce
From: Matteo Croce This is a respin of [1] This patchset shows the plans for allowing page_pool to handle and maintain DMA map/unmap of the pages it serves to the driver. For this to work a return hook in the network core is introduced. The overall purpose is to simplify drivers

Re: [PATCH -next 1/5] block: add disk sequence number

2021-03-25 Thread Matteo Croce
On Mon, Mar 15, 2021 at 10:05 PM Matthew Wilcox wrote: > > On Mon, Mar 15, 2021 at 08:18:24PM +, Matthew Wilcox wrote: > > On Mon, Mar 15, 2021 at 09:02:38PM +0100, Matteo Croce wrote: > > > From: Matteo Croce > > > > > > Add a sequence number

Re: [PATCH -next 1/5] block: add disk sequence number

2021-03-23 Thread Matteo Croce
On Tue, Mar 16, 2021 at 2:44 AM JeffleXu wrote: > > On 3/16/21 4:02 AM, Matteo Croce wrote: > > From: Matteo Croce > > > > Add a sequence number to the disk devices. This number is put in the > > uevent so userspace can correlate events when a driver reuses a

Re: [PATCH net-next 0/6] page_pool: recycle buffers

2021-03-23 Thread Matteo Croce
bakin wrote: > > > > From: Matteo Croce > > > > Date: Mon, 22 Mar 2021 18:02:55 +0100 > > > > > > > > > From: Matteo Croce > > > > > > > > > > This series enables recycling of the buffers allocated

Re: [PATCH net-next 3/6] page_pool: DMA handling and allow to recycles frames via SKB

2021-03-22 Thread Matteo Croce
On Mon, Mar 22, 2021 at 6:03 PM Matteo Croce wrote: > > From: Ilias Apalodimas > > During skb_release_data() intercept the packet and if it's a buffer > coming from our page_pool API recycle it back to the pool for further > usage. > To achieve that we introduce a

[PATCH net-next 6/6] mvneta: recycle buffers

2021-03-22 Thread Matteo Croce
From: Matteo Croce Use the new recycling API for page_pool. In a drop rate test, the packet rate increased di 10%, from 269 Kpps to 296 Kpps. perf top on a stock system shows: Overhead Shared Object Symbol 21.78% [kernel] [k] __pi___inval_dcache_area 21.66% [mvneta

[PATCH net-next 5/6] mvpp2: recycle buffers

2021-03-22 Thread Matteo Croce
From: Matteo Croce Use the new recycling API for page_pool. In a drop rate test, the packet rate is more than doubled, from 962 Kpps to 2047 Kpps. perf top on a stock system shows: Overhead Shared Object Symbol 30.67% [kernel] [k] page_pool_release_page 8.37% [kernel

[PATCH net-next 4/6] net: change users of __skb_frag_unref() and add an extra argument

2021-03-22 Thread Matteo Croce
From: Ilias Apalodimas On a previous patch we added an extra argument on __skb_frag_unref() to handle recycling. Update the current users of the function with that. Signed-off-by: Ilias Apalodimas Signed-off-by: Matteo Croce --- drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c

[PATCH net-next 3/6] page_pool: DMA handling and allow to recycles frames via SKB

2021-03-22 Thread Matteo Croce
uer Signed-off-by: Matteo Croce --- include/linux/skbuff.h | 33 +++ include/net/page_pool.h | 13 + include/net/xdp.h | 1 + net/core/page_pool.c| 43 + net/core/skbuff.c | 20 +--

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

2021-03-22 Thread Matteo Croce
From: Matteo Croce This is needed by the page_pool to avoid recycling a page not allocated via page_pool. Signed-off-by: Matteo Croce --- include/linux/mm_types.h | 1 + include/net/page_pool.h | 2 ++ net/core/page_pool.c | 4 3 files changed, 7 insertions(+) diff --git a/include

[PATCH net-next 1/6] xdp: reduce size of struct xdp_mem_info

2021-03-22 Thread Matteo Croce
From: Jesper Dangaard Brouer It is possible to compress/reduce the size of struct xdp_mem_info. This change reduce struct xdp_mem_info from 8 bytes to 4 bytes. The member xdp_mem_info.id can be reduced to u16, as the mem_id_ht rhashtable in net/core/xdp.c is already limited by MEM_ID_MAX=0xFFFE

[PATCH net-next 0/6] page_pool: recycle buffers

2021-03-22 Thread Matteo Croce
From: Matteo Croce This series enables recycling of the buffers allocated with the page_pool API. The first two patches are just prerequisite to save space in a struct and avoid recycling pages allocated with other API. Patch 2 was based on a previous idea from Jonathan Lemon. The third one

Re: [PATCH -next 2/5] block: add ioctl to read the disk sequence number

2021-03-15 Thread Matteo Croce
On Mon, Mar 15, 2021 at 9:13 PM Matthew Wilcox wrote: > > On Mon, Mar 15, 2021 at 09:02:39PM +0100, Matteo Croce wrote: > > +++ b/include/uapi/linux/fs.h > > @@ -184,6 +184,7 @@ struct fsxattr { > > #define BLKSECDISCARD _IO(0x12,125) > > #define BLKROTATIO

[PATCH -next 4/5] block: export diskseq in sysfs

2021-03-15 Thread Matteo Croce
From: Matteo Croce Add a new sysfs handle to export the new diskseq value. Place it in /block//diskseq and document it. Signed-off-by: Matteo Croce --- Documentation/ABI/testing/sysfs-block | 12 block/genhd.c | 11 +++ 2 files changed, 23

[PATCH -next 5/5] loop: increment sequence number

2021-03-15 Thread Matteo Croce
From: Matteo Croce On a very loaded system, if there are many events queued up from multiple attach/detach cycles, it's impossible to match them up with the LOOP_CONFIGURE or LOOP_SET_FD call, since we don't know where the position of our own association in the queue is[1]. Not even an empty

[PATCH -next 3/5] block: refactor sysfs code

2021-03-15 Thread Matteo Croce
From: Matteo Croce Move the sysfs register code from a function named disk_add_events() to a new function named disk_add_sysfs(). Also, rename the attribute list with a more generic name than disk_events_attrs. Signed-off-by: Matteo Croce --- block/genhd.c | 13 + 1 file changed

[PATCH -next 2/5] block: add ioctl to read the disk sequence number

2021-03-15 Thread Matteo Croce
From: Matteo Croce Add a new BLKGETDISKSEQ ioctl which retrieves the disk sequence number from the genhd structure. Signed-off-by: Matteo Croce --- block/ioctl.c | 2 ++ include/uapi/linux/fs.h | 1 + 2 files changed, 3 insertions(+) diff --git a/block/ioctl.c b/block/ioctl.c index

[PATCH -next 1/5] block: add disk sequence number

2021-03-15 Thread Matteo Croce
From: Matteo Croce Add a sequence number to the disk devices. This number is put in the uevent so userspace can correlate events when a driver reuses a device, like the loop one. Signed-off-by: Matteo Croce --- block/genhd.c | 19 +++ include/linux/genhd.h | 2 ++ 2

[PATCH -next 0/5] block: add a sequence number to disks

2021-03-15 Thread Matteo Croce
From: Matteo Croce With this series a monotonically increasing number is added to disks, precisely in the genhd struct, and it's exported in sysfs and uevent. This helps the userspace correlate events for devices that reuse the same device, like loop. The first patch is the core one, the 2..4

[RFC net-next 6/6] mvneta: recycle buffers

2021-03-11 Thread Matteo Croce
From: Matteo Croce Use the new recycling API for page_pool. In a drop rate test, the packet rate increased di 10%, from 269 Kpps to 296 Kpps. perf top on a stock system shows: Overhead Shared Object Symbol 21.78% [kernel] [k] __pi___inval_dcache_area 21.66% [mvneta

[RFC net-next 5/6] mvpp2: recycle buffers

2021-03-11 Thread Matteo Croce
From: Matteo Croce Use the new recycling API for page_pool. In a drop rate test, the packet rate is more than doubled, from 962 Kpps to 2047 Kpps. perf top on a stock system shows: Overhead Shared Object Symbol 30.67% [kernel] [k] page_pool_release_page 8.37% [kernel

[RFC net-next 4/6] net: change users of __skb_frag_unref() and add an extra argument

2021-03-11 Thread Matteo Croce
From: Ilias Apalodimas On a previous patch we added an extra argument on __skb_frag_unref() to handle recycling. Update the current users of the function with that. Signed-off-by: Ilias Apalodimas Signed-off-by: Matteo Croce --- drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c

[RFC net-next 3/6] page_pool: DMA handling and frame recycling via SKBs

2021-03-11 Thread Matteo Croce
uer Signed-off-by: Matteo Croce --- include/linux/skbuff.h | 33 +++ include/net/page_pool.h | 13 + include/net/xdp.h | 1 + net/core/page_pool.c| 43 + net/core/skbuff.c | 20 +--

[RFC net-next 2/6] mm: add a signature in struct page

2021-03-11 Thread Matteo Croce
From: Matteo Croce This is needed by the page_pool to avoid recycling a page not allocated via page_pool. Signed-off-by: Matteo Croce --- include/linux/mm_types.h | 1 + include/net/page_pool.h | 2 ++ net/core/page_pool.c | 4 3 files changed, 7 insertions(+) diff --git a/include

[RFC net-next 1/6] xdp: reduce size of struct xdp_mem_info

2021-03-11 Thread Matteo Croce
From: Jesper Dangaard Brouer It is possible to compress/reduce the size of struct xdp_mem_info. This change reduce struct xdp_mem_info from 8 bytes to 4 bytes. The member xdp_mem_info.id can be reduced to u16, as the mem_id_ht rhashtable in net/core/xdp.c is already limited by MEM_ID_MAX=0xFFFE

[RFC net-next 0/6] page_pool: recycle buffers

2021-03-11 Thread Matteo Croce
From: Matteo Croce This series enables recycling of the buffers allocated with the page_pool API. The first two patches are just prerequisite to save space in a struct and avoid recycling pages allocated with other API. Patch 2 was based on a previous idea from Jonathan Lemon. The third one

Re: [PATCH 0/5] block: add a sequence number to disks

2021-02-23 Thread Matteo Croce
On Sat, Feb 6, 2021 at 1:09 AM Matteo Croce wrote: > > From: Matteo Croce > > With this series a monotonically increasing number is added to disks, > precisely in the genhd struct, and it's exported in sysfs and uevent. > > This helps the userspace correlate events f

Re: [PATCH v4] reboot: allow to specify reboot mode via sysfs

2021-02-22 Thread Matteo Croce
On Mon, Feb 22, 2021 at 11:03 AM Pavel Machek wrote: > > On Tue 2020-11-10 21:27:46, Matteo Croce wrote: > > From: Matteo Croce > > > > The kernel cmdline reboot= option offers some sort of control > > on how the reboot is issued. > > Add handles in sysfs t

Re: pstore: fix compression

2021-02-18 Thread Matteo Croce
isabled. > > Use the correct config option name. > > Signed-off-by: Jiri Bohac > Fixes: fd49e03280e596e54edb93a91bc96170f8e97e4a ("pstore: Fix linking when > crypto API disabled") > Acked-by: Matteo Croce -- per aspera ad upstream

Re: [PATCH net-next] cfg80211: remove unused callback

2021-02-06 Thread Matteo Croce
On Sat, Feb 6, 2021 at 1:29 PM Matteo Croce wrote: > > From: Matteo Croce > > The ieee80211 class registers a callback which actually does nothing. > Given that the callback is optional, and all its accesses are protected > by a NULL check, remove it entirely. > > Sig

[PATCH RESEND net-next] cfg80211: remove unused callback

2021-02-06 Thread Matteo Croce
From: Matteo Croce The ieee80211 class registers a callback which actually does nothing. Given that the callback is optional, and all its accesses are protected by a NULL check, remove it entirely. Signed-off-by: Matteo Croce --- net/wireless/sysfs.c | 7 --- 1 file changed, 7 deletions

[PATCH net-next] cfg80211: remove unused callback

2021-02-06 Thread Matteo Croce
From: Matteo Croce The ieee80211 class registers a callback which actually does nothing. Given that the callback is optional, and all its accesses are protected by a NULL check, remove it entirely. Signed-off-by: Matteo Croce --- net/wireless/sysfs.c | 7 --- 1 file changed, 7 deletions

[PATCH 4/5] block: export diskseq in sysfs

2021-02-05 Thread Matteo Croce
From: Matteo Croce Add a new sysfs handle to export the new diskseq value. Place it in /block//diskseq and document it. Signed-off-by: Matteo Croce --- Documentation/ABI/testing/sysfs-block | 12 block/genhd.c | 11 +++ 2 files changed, 23

[PATCH 2/5] block: add ioctl to read the disk sequence number

2021-02-05 Thread Matteo Croce
From: Matteo Croce Add a new BLKGETDISKSEQ ioctl which retrieves the disk sequence number from the genhd structure. Signed-off-by: Matteo Croce --- block/ioctl.c | 2 ++ include/uapi/linux/fs.h | 1 + 2 files changed, 3 insertions(+) diff --git a/block/ioctl.c b/block/ioctl.c index

[PATCH 0/5] block: add a sequence number to disks

2021-02-05 Thread Matteo Croce
From: Matteo Croce With this series a monotonically increasing number is added to disks, precisely in the genhd struct, and it's exported in sysfs and uevent. This helps the userspace correlate events for devices that reuse the same device, like loop. The first patch is the core one, the 2..4

[PATCH 3/5] block: refactor sysfs code

2021-02-05 Thread Matteo Croce
From: Matteo Croce Move the sysfs register code from a function named disk_add_events() to a new function named disk_add_sysfs(). Also, rename the attribute list with a more generic name than disk_events_attrs. Signed-off-by: Matteo Croce --- block/genhd.c | 13 + 1 file changed

[PATCH 1/5] block: add disk sequence number

2021-02-05 Thread Matteo Croce
From: Matteo Croce Add a sequence number to the disk devices. This number is put in the uevent so userspace can correlate events when a driver reuses a device, like the loop one. Signed-off-by: Matteo Croce --- block/genhd.c | 19 +++ include/linux/genhd.h | 2 ++ 2

[PATCH 5/5] loop: increment sequence number

2021-02-05 Thread Matteo Croce
From: Matteo Croce On a very loaded system, if there are many events queued up from multiple attach/detach cycles, it's impossible to match them up with the LOOP_CONFIGURE or LOOP_SET_FD call, since we don't know where the position of our own association in the queue is[1]. Not even an empty

Re: [PATCH net 0/2] ipv6: fixes for the multicast routes

2021-01-16 Thread Matteo Croce
On Sat, Jan 16, 2021 at 5:41 AM David Ahern wrote: > > On 1/15/21 4:12 PM, Matteo Croce wrote: > > On Fri, Jan 15, 2021 at 11:50 PM Jakub Kicinski wrote: > >> > >> On Fri, 15 Jan 2021 19:42:07 +0100 Matteo Croce wrote: > >>> From: Matteo Croce &

Re: [PATCH net 1/2] ipv6: create multicast route with RTPROT_KERNEL

2021-01-16 Thread Matteo Croce
On Sat, Jan 16, 2021 at 5:36 AM David Ahern wrote: > > On 1/15/21 11:42 AM, Matteo Croce wrote: > > From: Matteo Croce > > > > The ff00::/8 multicast route is created without specifying the fc_protocol > > field, so the default RTPROT_BOOT value is used: > >

Re: [PATCH net 0/2] ipv6: fixes for the multicast routes

2021-01-15 Thread Matteo Croce
On Fri, Jan 15, 2021 at 11:50 PM Jakub Kicinski wrote: > > On Fri, 15 Jan 2021 19:42:07 +0100 Matteo Croce wrote: > > From: Matteo Croce > > > > Fix two wrong flags in the IPv6 multicast routes created > > by the autoconf code. > > Any chance for Fixes tag

[PATCH net 2/2] ipv6: set multicast flag on the multicast route

2021-01-15 Thread Matteo Croce
From: Matteo Croce The multicast route ff00::/8 is created with type RTN_UNICAST: $ ip -6 -d route unicast ::1 dev lo proto kernel scope global metric 256 pref medium unicast fe80::/64 dev eth0 proto kernel scope global metric 256 pref medium unicast ff00::/8 dev eth0 proto kernel scope

[PATCH net 1/2] ipv6: create multicast route with RTPROT_KERNEL

2021-01-15 Thread Matteo Croce
From: Matteo Croce The ff00::/8 multicast route is created without specifying the fc_protocol field, so the default RTPROT_BOOT value is used: $ ip -6 -d route unicast ::1 dev lo proto kernel scope global metric 256 pref medium unicast fe80::/64 dev eth0 proto kernel scope global metric

[PATCH net 0/2] ipv6: fixes for the multicast routes

2021-01-15 Thread Matteo Croce
From: Matteo Croce Fix two wrong flags in the IPv6 multicast routes created by the autoconf code. Matteo Croce (2): ipv6: create multicast route with RTPROT_KERNEL ipv6: set multicast flag on the multicast route net/ipv6/addrconf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion

[PATCH 2/2] reboot: hide from sysfs not applicable settings

2020-11-30 Thread Matteo Croce
From: Matteo Croce Not all the reboot settings from both the kernel command line or sysfs interface are available to all platforms. Filter out reboot_type and reboot_force which are x86 only, and also remove reboot_cpu on kernels without SMP support. This saves some space, and avoid confusing

[PATCH 1/2] reboot: allow to override reboot type if quirks are found

2020-11-30 Thread Matteo Croce
From: Matteo Croce On some machines a quirk can force a specific reboot type. Quirks are found during a DMI scan, the list of machines which need special reboot handling is defined in reboot_dmi_table. The kernel command line reboot= option overrides this via a global variable `reboot_default

[PATCH 0/2] reboot: sysfs improvements

2020-11-30 Thread Matteo Croce
From: Matteo Croce Some improvements to the sysfs reboot interface: hide not working settings and support machines with known reboot quirks. Matteo Croce (2): reboot: allow to override reboot type if quirks are found reboot: hide from sysfs not applicable settings kernel/reboot.c | 58

Re: [PATCH] reboot: Fix variable assignments in type_store

2020-11-13 Thread Matteo Croce
On Fri, Nov 13, 2020 at 9:06 PM Petr Mladek wrote: > > On Fri 2020-11-13 03:58:49, Matteo Croce wrote: > > On Fri, Nov 13, 2020 at 3:46 AM Andrew Morton > > wrote: > > > > > > On Fri, 13 Nov 2020 02:38:18 +0100 Matteo Croce > > > wrote: >

Re: [PATCH] reboot: Fix variable assignments in type_store

2020-11-12 Thread Matteo Croce
On Fri, Nov 13, 2020 at 3:46 AM Andrew Morton wrote: > > On Fri, 13 Nov 2020 02:38:18 +0100 Matteo Croce > wrote: > > > At this point, since 'pci' enables BOOT_CF9_FORCE type and > > BOOT_CF9_SAFE is not user selectable, should I simply leave only > > 'pci'? >

[PATCH] reboot: remove cf9_safe from allowed types and rename cf9_force

2020-11-12 Thread Matteo Croce
From: Matteo Croce BOOT_CF9_SAFE_STR is an internal value used only by the x86 code and it's not possible to set it from userspace. Remove it, and rename 'cf9_force' to 'pci', so to make it coherent with the kernel command line reboot= option. Tested with this script: cd /sys/kernel

Re: [PATCH] reboot: sync documentation with current code

2020-11-12 Thread Matteo Croce
On Fri, Nov 13, 2020 at 2:07 AM Matteo Croce wrote: > > From: Matteo Croce > > The valid values accepted by /sys/kernel/reboot/type are a bit different > that the ones used in the kernel command line. > > In /sys we supports 'cf9_force' and 'cf9_safe', while in the kerne

Re: [PATCH] reboot: Fix variable assignments in type_store

2020-11-12 Thread Matteo Croce
On Fri, Nov 13, 2020 at 2:18 AM Andrew Morton wrote: > > On Fri, 13 Nov 2020 01:20:29 +0100 Matteo Croce > wrote: > > > While writing the script I found that in the documentation I left for > > 'type' the values from > > Documentation/admin-guide/kernel

[PATCH] reboot: sync documentation with current code

2020-11-12 Thread Matteo Croce
From: Matteo Croce The valid values accepted by /sys/kernel/reboot/type are a bit different that the ones used in the kernel command line. In /sys we supports 'cf9_force' and 'cf9_safe', while in the kernel command line 'pci' and 'q' are used. Document the right values in the sysfs

Re: [PATCH] reboot: Fix variable assignments in type_store

2020-11-12 Thread Matteo Croce
On Fri, Nov 13, 2020 at 1:20 AM Matteo Croce wrote: > > On Fri, Nov 13, 2020 at 12:13 AM Andrew Morton > wrote: > > > > On Wed, 11 Nov 2020 20:50:23 -0700 Nathan Chancellor > > wrote: > > > > > Clang warns: > > > > > > kernel/re

Re: [PATCH] reboot: Fix variable assignments in type_store

2020-11-12 Thread Matteo Croce
On Fri, Nov 13, 2020 at 12:13 AM Andrew Morton wrote: > > On Wed, 11 Nov 2020 20:50:23 -0700 Nathan Chancellor > wrote: > > > Clang warns: > > > > kernel/reboot.c:707:17: warning: implicit conversion from enumeration > > type 'enum reboot_type' to different enumeration type 'enum reboot_mode' >

Re: [PATCH] reboot: Fix variable assignments in type_store

2020-11-12 Thread Matteo Croce
On Thu, Nov 12, 2020 at 6:49 PM Nathan Chancellor wrote: > > Hi Matteo, > > On Thu, Nov 12, 2020 at 12:26:45PM +0100, Matteo Croce wrote: > > On Thu, Nov 12, 2020 at 4:50 AM Nathan Chancellor > > wrote: > > > > > > Clang warns: > > > > &g

Re: [PATCH] reboot: Fix variable assignments in type_store

2020-11-12 Thread Matteo Croce
On Thu, Nov 12, 2020 at 4:50 AM Nathan Chancellor wrote: > > Clang warns: > > kernel/reboot.c:707:17: warning: implicit conversion from enumeration > type 'enum reboot_type' to different enumeration type 'enum reboot_mode' > [-Wenum-conversion] > reboot_mode = BOOT_TRIPLE; >

[PATCH v4] reboot: allow to specify reboot mode via sysfs

2020-11-10 Thread Matteo Croce
From: Matteo Croce The kernel cmdline reboot= option offers some sort of control on how the reboot is issued. Add handles in sysfs to allow setting these reboot options, so they can be changed when the system is booted, other than at boot time. The handlers are under /kernel/reboot, can be read

Re: [PATCH v3] reboot: allow to specify reboot mode via sysfs

2020-11-10 Thread Matteo Croce
On Tue, Nov 10, 2020 at 3:58 PM Petr Mladek wrote: > > On Mon 2020-11-09 17:45:38, Matteo Croce wrote: > > From: Matteo Croce > > > > The kernel cmdline reboot= option offers some sort of control > > on how the reboot is issued. > > Add handles in sysfs to al

[PATCH v3] reboot: allow to specify reboot mode via sysfs

2020-11-09 Thread Matteo Croce
From: Matteo Croce The kernel cmdline reboot= option offers some sort of control on how the reboot is issued. Add handles in sysfs to allow setting these reboot options, so they can be changed when the system is booted, other than at boot time. The handlers are under /kernel/reboot, can be read

Re: [PATCH v2] reboot: allow to specify reboot mode via sysfs

2020-11-09 Thread Matteo Croce
On Mon, Nov 9, 2020 at 3:16 PM Petr Mladek wrote: > > On Fri 2020-11-06 21:07:04, Matteo Croce wrote: > > From: Matteo Croce > > > > The kernel cmdline reboot= option offers some sort of control > > on how the reboot is issued. > > Add handles in sysfs to al

Re: [PATCH v2] reboot: allow to specify reboot mode via sysfs

2020-11-06 Thread Matteo Croce
On Fri, Nov 6, 2020 at 11:33 PM Andrew Morton wrote: > > On Fri, 6 Nov 2020 21:07:04 +0100 Matteo Croce > wrote: > > > The kernel cmdline reboot= option offers some sort of control > > on how the reboot is issued. > > Add handles in sysfs to allow setting these r

[PATCH v2] reboot: allow to specify reboot mode via sysfs

2020-11-06 Thread Matteo Croce
From: Matteo Croce The kernel cmdline reboot= option offers some sort of control on how the reboot is issued. Add handles in sysfs to allow setting these reboot options, so they can be changed when the system is booted, other than at boot time. The handlers are under /kernel/reboot, can be read

Re: [PATCH v3 2/3] reboot: fix overflow parsing reboot cpu number

2020-11-05 Thread Matteo Croce
On Thu, Nov 5, 2020 at 7:09 PM Petr Mladek wrote: > > + if (reboot_cpu >= num_possible_cpus()) { > > + pr_err("Ignoring the CPU number in reboot= > > option. " > > +"CPU %d exceeds possible cpu number > > %d\n",

Re: [PATCH] reboot: allow to specify reboot mode via sysfs

2020-11-04 Thread Matteo Croce
On Wed, Nov 4, 2020 at 8:42 PM Matteo Croce wrote: > +#ifdef CONFIG_SYSFS > + > +#define STARTS_WITH(s, sc) (!strncmp(s, sc, sizeof(sc))) > + Just noticed an off-by-one here, it should be sizeof(sc)-1 because of the null terminator. This way, the CR usually added by echo wil

[PATCH] reboot: allow to specify reboot mode via sysfs

2020-11-04 Thread Matteo Croce
From: Matteo Croce The kernel cmdline reboot= option offers some sort of control on how the reboot is issued. Add handles in sysfs to allow setting these reboot options, so they can be changed when the system is booted, other than at boot time. The handlers are under /kernel/reboot, can be read

[PATCH v3 3/3] reboot: refactor and comment the cpu selection code

2020-11-03 Thread Matteo Croce
From: Matteo Croce Small improvements to the code, without changing the way it works: - use a local variable, to avoid a small time lapse where reboot_cpu can have an invalid value - comment the code which is not easy to understand at a glance - merge two identical code blocks into one

[PATCH v3 2/3] reboot: fix overflow parsing reboot cpu number

2020-11-03 Thread Matteo Croce
From: Matteo Croce Limit the CPU number to num_possible_cpus(), because setting it to a value lower than INT_MAX but higher than NR_CPUS produces the following error on reboot and shutdown: BUG: unable to handle page fault for address: 90ab1bb0 #PF: supervisor read access

[PATCH v3 0/3] fix parsing of reboot= cmdline

2020-11-03 Thread Matteo Croce
From: Matteo Croce The parsing of the reboot= cmdline has two major errors: - a missing bound check can crash the system on reboot - parsing of the cpu number only works if specified last Fix both, along with a small code refactor. v2->v3: Revert the offending commit first, then fix the ot

[PATCH v3 1/3] Revert "kernel/reboot.c: convert simple_strtoul to kstrtoint"

2020-11-03 Thread Matteo Croce
From: Matteo Croce This reverts commit 616feab753972b9751308f3cd2a68fc57eae8edb. kstrtoint() and simple_strtoul() have a subtle difference which makes them non interchangeable: if a non digit character is found amid the parsing, the former will return an error, while the latter will just stop

Re: [PATCH v2 2/2] reboot: fix parsing of reboot cpu number

2020-11-03 Thread Matteo Croce
On Tue, Nov 3, 2020 at 3:25 PM Petr Mladek wrote: > > On Tue 2020-11-03 12:43:32, Matteo Croce wrote: > > On Mon, Nov 2, 2020 at 12:01 PM Petr Mladek wrote: > > > > > > On Sun 2020-11-01 02:57:40, Matteo Croce wrote: > > > > On Fri,

Re: [PATCH v2 2/2] reboot: fix parsing of reboot cpu number

2020-11-03 Thread Matteo Croce
On Mon, Nov 2, 2020 at 12:01 PM Petr Mladek wrote: > > On Sun 2020-11-01 02:57:40, Matteo Croce wrote: > > On Fri, Oct 30, 2020 at 3:30 PM Petr Mladek wrote: > > > > > > On Tue 2020-10-27 14:35:45, Matteo Croce wrote: > > > > From: Matteo Croce

Re: [PATCH v2 2/2] reboot: fix parsing of reboot cpu number

2020-10-31 Thread Matteo Croce
On Fri, Oct 30, 2020 at 3:30 PM Petr Mladek wrote: > > On Tue 2020-10-27 14:35:45, Matteo Croce wrote: > > From: Matteo Croce > > > > The kernel cmdline reboot= argument allows to specify the CPU used > > for rebooting, with the syntax `s` among the other flags,

Re: [PATCH v2 1/2] reboot: fix overflow parsing reboot cpu number

2020-10-30 Thread Matteo Croce
On Fri, Oct 30, 2020 at 3:13 PM Petr Mladek wrote: > > On Tue 2020-10-27 14:42:43, Greg KH wrote: > > On Tue, Oct 27, 2020 at 02:35:44PM +0100, Matteo Croce wrote: > > > From: Matteo Croce > > > > > > Limit the CPU number to num_possible_cpus(), because

[PATCH v2 0/2] fix parsing of reboot= cmdline

2020-10-27 Thread Matteo Croce
From: Matteo Croce The parsing of the reboot= cmdline has two major errors: - a missing bound check can crash the system on reboot - parsing of the cpu number only works if specified last Fix both, along with a small code refactor. v1->v2: As Petr suggested, don't force base

[PATCH v2 2/2] reboot: fix parsing of reboot cpu number

2020-10-27 Thread Matteo Croce
From: Matteo Croce The kernel cmdline reboot= argument allows to specify the CPU used for rebooting, with the syntax `s` among the other flags, e.g. reboot=soft,s4 reboot=warm,s31,force In the early days the parsing was done with simple_strtoul(), later deprecated in favor of the safer

[PATCH v2 1/2] reboot: fix overflow parsing reboot cpu number

2020-10-27 Thread Matteo Croce
From: Matteo Croce Limit the CPU number to num_possible_cpus(), because setting it to a value lower than INT_MAX but higher than NR_CPUS produces the following error on reboot and shutdown: BUG: unable to handle page fault for address: 90ab1bb0 #PF: supervisor read access

  1   2   3   4   >