mailweb.openeuler.org
Manage this list

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

Kernel

Threads by month
  • ----- 2025 -----
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2021 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2020 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2019 -----
  • December
kernel@openeuler.org

  • 44 participants
  • 18679 discussions
[PATCH v2 OLK-6.6] SUNRPC: Fix a slow server-side memory leak with RPC-over-TCP
by Weifeng Su 28 Apr '24

28 Apr '24
From: Chuck Lever <chuck.lever(a)oracle.com> mainline inclusion from mainline-v6.9-rc3 commit 05258a0a69b3c5d2c003f818702c0a52b6fea861 category: bugfix bugzilla: https://gitee.com/src-openeuler/nfs-utils/issues/I9HSXQ?from=project-issue CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?… ------------------------------------------------------ Jan Schunk reports that his small NFS servers suffer from memory exhaustion after just a few days. A bisect shows that commit e18e157bb5c8 ("SUNRPC: Send RPC message on TCP with a single sock_sendmsg() call") is the first bad commit. That commit assumed that sock_sendmsg() releases all the pages in the underlying bio_vec array, but the reality is that it doesn't. svc_xprt_release() releases the rqst's response pages, but the record marker page fragment isn't one of those, so it is never released. This is a narrow fix that can be applied to stable kernels. A more extensive fix is in the works. Reported-by: Jan Schunk <scpcom(a)gmx.de> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218671 Fixes: e18e157bb5c8 ("SUNRPC: Send RPC message on TCP with a single sock_sendmsg() call") Cc: Alexander Duyck <alexander.duyck(a)gmail.com> Cc: Jakub Kacinski <kuba(a)kernel.org> Cc: David Howells <dhowells(a)redhat.com> Reviewed-by: David Howells <dhowells(a)redhat.com> Signed-off-by: Chuck Lever <chuck.lever(a)oracle.com> Signed-off-by: Weifeng Su <suweifeng1(a)huawei.com> --- net/sunrpc/svcsock.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index e0ce42762..933e12e3a 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c @@ -1216,15 +1216,6 @@ static int svc_tcp_recvfrom(struct svc_rqst *rqstp) * MSG_SPLICE_PAGES is used exclusively to reduce the number of * copy operations in this path. Therefore the caller must ensure * that the pages backing @xdr are unchanging. - * - * Note that the send is non-blocking. The caller has incremented - * the reference count on each page backing the RPC message, and - * the network layer will "put" these pages when transmission is - * complete. - * - * This is safe for our RPC services because the memory backing - * the head and tail components is never kmalloc'd. These always - * come from pages in the svc_rqst::rq_pages array. */ static int svc_tcp_sendmsg(struct svc_sock *svsk, struct svc_rqst *rqstp, rpc_fraghdr marker, unsigned int *sentp) @@ -1254,6 +1245,7 @@ static int svc_tcp_sendmsg(struct svc_sock *svsk, struct svc_rqst *rqstp, iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, rqstp->rq_bvec, 1 + count, sizeof(marker) + rqstp->rq_res.len); ret = sock_sendmsg(svsk->sk_sock, &msg); + page_frag_free(buf); if (ret < 0) return ret; *sentp += ret; -- 2.43.0
2 1
0 0
[PATCH OLK-6.6] SUNRPC: Fix a slow server-side memory leak with RPC-over-TCP
by Weifeng Su 28 Apr '24

28 Apr '24
From: Chuck Lever <chuck.lever(a)oracle.com> Jan Schunk reports that his small NFS servers suffer from memory exhaustion after just a few days. A bisect shows that commit e18e157bb5c8 ("SUNRPC: Send RPC message on TCP with a single sock_sendmsg() call") is the first bad commit. That commit assumed that sock_sendmsg() releases all the pages in the underlying bio_vec array, but the reality is that it doesn't. svc_xprt_release() releases the rqst's response pages, but the record marker page fragment isn't one of those, so it is never released. This is a narrow fix that can be applied to stable kernels. A more extensive fix is in the works. Reported-by: Jan Schunk <scpcom(a)gmx.de> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218671 Fixes: e18e157bb5c8 ("SUNRPC: Send RPC message on TCP with a single sock_sendmsg() call") Cc: Alexander Duyck <alexander.duyck(a)gmail.com> Cc: Jakub Kacinski <kuba(a)kernel.org> Cc: David Howells <dhowells(a)redhat.com> Reviewed-by: David Howells <dhowells(a)redhat.com> Signed-off-by: Chuck Lever <chuck.lever(a)oracle.com> --- net/sunrpc/svcsock.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index e0ce42762..933e12e3a 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c @@ -1216,15 +1216,6 @@ static int svc_tcp_recvfrom(struct svc_rqst *rqstp) * MSG_SPLICE_PAGES is used exclusively to reduce the number of * copy operations in this path. Therefore the caller must ensure * that the pages backing @xdr are unchanging. - * - * Note that the send is non-blocking. The caller has incremented - * the reference count on each page backing the RPC message, and - * the network layer will "put" these pages when transmission is - * complete. - * - * This is safe for our RPC services because the memory backing - * the head and tail components is never kmalloc'd. These always - * come from pages in the svc_rqst::rq_pages array. */ static int svc_tcp_sendmsg(struct svc_sock *svsk, struct svc_rqst *rqstp, rpc_fraghdr marker, unsigned int *sentp) @@ -1254,6 +1245,7 @@ static int svc_tcp_sendmsg(struct svc_sock *svsk, struct svc_rqst *rqstp, iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, rqstp->rq_bvec, 1 + count, sizeof(marker) + rqstp->rq_res.len); ret = sock_sendmsg(svsk->sk_sock, &msg); + page_frag_free(buf); if (ret < 0) return ret; *sentp += ret; -- 2.43.0
2 1
0 0
[PATCH OLK-6.6] SUNRPC: Fix a slow server-side memory leak with RPC-over-TCP
by Weifeng Su 28 Apr '24

28 Apr '24
From: Chuck Lever <chuck.lever(a)oracle.com> Jan Schunk reports that his small NFS servers suffer from memory exhaustion after just a few days. A bisect shows that commit e18e157bb5c8 ("SUNRPC: Send RPC message on TCP with a single sock_sendmsg() call") is the first bad commit. That commit assumed that sock_sendmsg() releases all the pages in the underlying bio_vec array, but the reality is that it doesn't. svc_xprt_release() releases the rqst's response pages, but the record marker page fragment isn't one of those, so it is never released. This is a narrow fix that can be applied to stable kernels. A more extensive fix is in the works. Reported-by: Jan Schunk <scpcom(a)gmx.de> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218671 Fixes: e18e157bb5c8 ("SUNRPC: Send RPC message on TCP with a single sock_sendmsg() call") Cc: Alexander Duyck <alexander.duyck(a)gmail.com> Cc: Jakub Kacinski <kuba(a)kernel.org> Cc: David Howells <dhowells(a)redhat.com> Reviewed-by: David Howells <dhowells(a)redhat.com> Signed-off-by: Chuck Lever <chuck.lever(a)oracle.com> --- net/sunrpc/svcsock.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index e0ce42762..933e12e3a 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c @@ -1216,15 +1216,6 @@ static int svc_tcp_recvfrom(struct svc_rqst *rqstp) * MSG_SPLICE_PAGES is used exclusively to reduce the number of * copy operations in this path. Therefore the caller must ensure * that the pages backing @xdr are unchanging. - * - * Note that the send is non-blocking. The caller has incremented - * the reference count on each page backing the RPC message, and - * the network layer will "put" these pages when transmission is - * complete. - * - * This is safe for our RPC services because the memory backing - * the head and tail components is never kmalloc'd. These always - * come from pages in the svc_rqst::rq_pages array. */ static int svc_tcp_sendmsg(struct svc_sock *svsk, struct svc_rqst *rqstp, rpc_fraghdr marker, unsigned int *sentp) @@ -1254,6 +1245,7 @@ static int svc_tcp_sendmsg(struct svc_sock *svsk, struct svc_rqst *rqstp, iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, rqstp->rq_bvec, 1 + count, sizeof(marker) + rqstp->rq_res.len); ret = sock_sendmsg(svsk->sk_sock, &msg); + page_frag_free(buf); if (ret < 0) return ret; *sentp += ret; -- 2.43.0
2 1
0 0
[PATCH OLK-5.10] random: Workaround for performance degrade
by GUO Zihua 28 Apr '24

28 Apr '24
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I9K8D1 -------------------------------- A performance degrade is observed on boards with certain chips. Debugging shows that degrade is caused by the two line in drivers/char/random.c. The root cause of why these two lines would cause such degrade is still unknown. This patch is meant to be a workaround for said issue. Fixes: 6c315cc252ce ("random: use first 128 bits of input as fast init") Signed-off-by: GUO Zihua <guozihua(a)huawei.com> --- drivers/char/Kconfig | 9 +++++++ drivers/char/random.c | 55 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 63 insertions(+), 1 deletion(-) diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig index 677e16195d32..ae35511a78f2 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig @@ -513,4 +513,13 @@ config RANDOM_TRUST_BOOTLOADER believe its RNG facilities may be faulty. This may also be configured at boot time with "random.trust_bootloader=on/off". +config FIX_RANDOM_PERFORMANCE + bool "Fix random performance degrade on certain platform" + depends on ARM + default n + help + It's observed that there is a performance degrade related to random on + system with certain chip. The root cause is unknown and this config is + meant to be a workaround for that issue. + endmenu diff --git a/drivers/char/random.c b/drivers/char/random.c index 6aa1c013a2b7..88f3284d3088 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -347,8 +347,10 @@ static void crng_make_state(u32 chacha_state[CHACHA_STATE_WORDS], spin_lock_irqsave(&base_crng.lock, flags); ready = crng_ready(); if (!ready) { +#ifndef CONFIG_FIX_RANDOM_PERFORMANCE if (crng_init == CRNG_EMPTY) extract_entropy(base_crng.key, sizeof(base_crng.key)); +#endif crng_fast_key_erasure(base_crng.key, chacha_state, random_data, random_data_len); } @@ -392,6 +394,21 @@ static void crng_make_state(u32 chacha_state[CHACHA_STATE_WORDS], local_unlock_irqrestore(&crngs.lock, flags); } +#ifdef CONFIG_FIX_RANDOM_PERFORMANCE +/* + * Dummy function acting as a placeholder to 1380 performance degrade. + * This is a de-facto workaround produced from bunch of testing. The root + * casue of this performance issue is still unknown. + */ +static __aligned(64) void __used dummy(const void *input, size_t len, bool account) +{ +} + +static __aligned(64) void __used dummy2(const void *input, size_t len, bool account) +{ +} +#endif // CONFIG_FIX_RANDOM_PERFORMANCE + static void _get_random_bytes(void *buf, size_t len) { u32 chacha_state[CHACHA_STATE_WORDS]; @@ -860,6 +877,14 @@ void add_device_randomness(const void *buf, size_t len) _mix_pool_bytes(&entropy, sizeof(entropy)); _mix_pool_bytes(buf, len); spin_unlock_irqrestore(&input_pool.lock, flags); + +#ifdef CONFIG_FIX_RANDOM_PERFORMANCE + if (crng_init == CRNG_EMPTY && len) { + spin_lock_irqsave(&base_crng.lock, flags); + extract_entropy(base_crng.key, sizeof(base_crng.key)); + spin_unlock_irqrestore(&base_crng.lock, flags); + } +#endif } EXPORT_SYMBOL(add_device_randomness); @@ -870,7 +895,17 @@ EXPORT_SYMBOL(add_device_randomness); */ void add_hwgenerator_randomness(const void *buf, size_t len, size_t entropy) { +#ifdef CONFIG_FIX_RANDOM_PERFORMANCE + unsigned long flags; +#endif mix_pool_bytes(buf, len); +#ifdef CONFIG_FIX_RANDOM_PERFORMANCE + if (crng_init == CRNG_EMPTY) { + spin_lock_irqsave(&base_crng.lock, flags); + extract_entropy(base_crng.key, sizeof(base_crng.key)); + spin_unlock_irqrestore(&base_crng.lock, flags); + } +#endif credit_init_bits(entropy); /* @@ -965,6 +1000,9 @@ static void mix_interrupt_randomness(struct timer_list *work) */ unsigned long pool[2]; unsigned int count; +#ifdef CONFIG_FIX_RANDOM_PERFORMANCE + unsigned long flags; +#endif /* Check to see if we're running on the wrong CPU due to hotplug. */ local_irq_disable(); @@ -984,6 +1022,13 @@ static void mix_interrupt_randomness(struct timer_list *work) local_irq_enable(); mix_pool_bytes(pool, sizeof(pool)); +#ifdef CONFIG_FIX_RANDOM_PERFORMANCE + if (crng_init == CRNG_EMPTY) { + spin_lock_irqsave(&base_crng.lock, flags); + extract_entropy(base_crng.key, sizeof(base_crng.key)); + spin_unlock_irqrestore(&base_crng.lock, flags); + } +#endif credit_init_bits(clamp_t(unsigned int, (count & U16_MAX) / 64, 1, sizeof(pool) * 8)); memzero_explicit(pool, sizeof(pool)); @@ -1090,8 +1135,16 @@ static void add_timer_randomness(struct timer_rand_state *state, unsigned int nu */ if (in_irq()) this_cpu_ptr(&irq_randomness)->count += max(1u, bits * 64) - 1; - else + else { +#ifdef CONFIG_FIX_RANDOM_PERFORMANCE + if (crng_init == CRNG_EMPTY) { + spin_lock_irqsave(&base_crng.lock, flags); + extract_entropy(base_crng.key, sizeof(base_crng.key)); + spin_unlock_irqrestore(&base_crng.lock, flags); + } +#endif _credit_init_bits(bits); + } } void add_input_randomness(unsigned int type, unsigned int code, unsigned int value) -- 2.34.1
2 1
0 0
[PATCH] SUNRPC: Fix a slow server-side memory leak with RPC-over-TCP
by wguanghao 28 Apr '24

28 Apr '24
From: Chuck Lever <chuck.lever(a)oracle.com> Jan Schunk reports that his small NFS servers suffer from memory exhaustion after just a few days. A bisect shows that commit e18e157bb5c8 ("SUNRPC: Send RPC message on TCP with a single sock_sendmsg() call") is the first bad commit. That commit assumed that sock_sendmsg() releases all the pages in the underlying bio_vec array, but the reality is that it doesn't. svc_xprt_release() releases the rqst's response pages, but the record marker page fragment isn't one of those, so it is never released. This is a narrow fix that can be applied to stable kernels. A more extensive fix is in the works. Reported-by: Jan Schunk <scpcom(a)gmx.de> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218671 Fixes: e18e157bb5c8 ("SUNRPC: Send RPC message on TCP with a single sock_sendmsg() call") Cc: Alexander Duyck <alexander.duyck(a)gmail.com> Cc: Jakub Kacinski <kuba(a)kernel.org> Cc: David Howells <dhowells(a)redhat.com> Reviewed-by: David Howells <dhowells(a)redhat.com> Signed-off-by: Chuck Lever <chuck.lever(a)oracle.com> --- net/sunrpc/svcsock.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index 545017a3daa4..6b3f01beb294 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c @@ -1206,15 +1206,6 @@ static int svc_tcp_recvfrom(struct svc_rqst *rqstp) * MSG_SPLICE_PAGES is used exclusively to reduce the number of * copy operations in this path. Therefore the caller must ensure * that the pages backing @xdr are unchanging. - * - * Note that the send is non-blocking. The caller has incremented - * the reference count on each page backing the RPC message, and - * the network layer will "put" these pages when transmission is - * complete. - * - * This is safe for our RPC services because the memory backing - * the head and tail components is never kmalloc'd. These always - * come from pages in the svc_rqst::rq_pages array. */ static int svc_tcp_sendmsg(struct svc_sock *svsk, struct svc_rqst *rqstp, rpc_fraghdr marker, unsigned int *sentp) @@ -1244,6 +1235,7 @@ static int svc_tcp_sendmsg(struct svc_sock *svsk, struct svc_rqst *rqstp, iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, rqstp->rq_bvec, 1 + count, sizeof(marker) + rqstp->rq_res.len); ret = sock_sendmsg(svsk->sk_sock, &msg); + page_frag_free(buf); if (ret < 0) return ret; *sentp += ret; -- 2.39.2
1 0
0 0
[PATCH OLK-6.6] quota: Fix potential NULL pointer dereference
by Baokun Li 28 Apr '24

28 Apr '24
From: Wang Jianjian <wangjianjian3(a)huawei.com> stable inclusion from stable-v6.6.23 commit 40a673b4b07efd6f74ff3ab60f38b26aa91ee5d5 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9HJX7 CVE: CVE-2024-26878 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id… -------------------------------- [ Upstream commit d0aa72604fbd80c8aabb46eda00535ed35570f1f ] Below race may cause NULL pointer dereference P1 P2 dquot_free_inode quota_off drop_dquot_ref remove_dquot_ref dquots = i_dquot(inode) dquots = i_dquot(inode) srcu_read_lock dquots[cnt]) != NULL (1) dquots[type] = NULL (2) spin_lock(&dquots[cnt]->dq_dqb_lock) (3) .... If dquot_free_inode(or other routines) checks inode's quota pointers (1) before quota_off sets it to NULL(2) and use it (3) after that, NULL pointer dereference will be triggered. So let's fix it by using a temporary pointer to avoid this issue. Signed-off-by: Wang Jianjian <wangjianjian3(a)huawei.com> Signed-off-by: Jan Kara <jack(a)suse.cz> Message-Id: <20240202081852.2514092-1-wangjianjian3(a)huawei.com> Stable-dep-of: 179b8c97ebf6 ("quota: Fix rcu annotations of inode dquot pointers") Signed-off-by: Sasha Levin <sashal(a)kernel.org> Signed-off-by: Baokun Li <libaokun1(a)huawei.com> --- fs/quota/dquot.c | 98 ++++++++++++++++++++++++++++-------------------- 1 file changed, 57 insertions(+), 41 deletions(-) diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 023b91b4e1f0..9707aa34f52e 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -399,15 +399,17 @@ int dquot_mark_dquot_dirty(struct dquot *dquot) EXPORT_SYMBOL(dquot_mark_dquot_dirty); /* Dirtify all the dquots - this can block when journalling */ -static inline int mark_all_dquot_dirty(struct dquot * const *dquot) +static inline int mark_all_dquot_dirty(struct dquot * const *dquots) { int ret, err, cnt; + struct dquot *dquot; ret = err = 0; for (cnt = 0; cnt < MAXQUOTAS; cnt++) { - if (dquot[cnt]) + dquot = srcu_dereference(dquots[cnt], &dquot_srcu); + if (dquot) /* Even in case of error we have to continue */ - ret = mark_dquot_dirty(dquot[cnt]); + ret = mark_dquot_dirty(dquot); if (!err) err = ret; } @@ -1684,6 +1686,7 @@ int __dquot_alloc_space(struct inode *inode, qsize_t number, int flags) struct dquot_warn warn[MAXQUOTAS]; int reserve = flags & DQUOT_SPACE_RESERVE; struct dquot **dquots; + struct dquot *dquot; if (!inode_quota_active(inode)) { if (reserve) { @@ -1703,27 +1706,26 @@ int __dquot_alloc_space(struct inode *inode, qsize_t number, int flags) index = srcu_read_lock(&dquot_srcu); spin_lock(&inode->i_lock); for (cnt = 0; cnt < MAXQUOTAS; cnt++) { - if (!dquots[cnt]) + dquot = srcu_dereference(dquots[cnt], &dquot_srcu); + if (!dquot) continue; if (reserve) { - ret = dquot_add_space(dquots[cnt], 0, number, flags, - &warn[cnt]); + ret = dquot_add_space(dquot, 0, number, flags, &warn[cnt]); } else { - ret = dquot_add_space(dquots[cnt], number, 0, flags, - &warn[cnt]); + ret = dquot_add_space(dquot, number, 0, flags, &warn[cnt]); } if (ret) { /* Back out changes we already did */ for (cnt--; cnt >= 0; cnt--) { - if (!dquots[cnt]) + dquot = srcu_dereference(dquots[cnt], &dquot_srcu); + if (!dquot) continue; - spin_lock(&dquots[cnt]->dq_dqb_lock); + spin_lock(&dquot->dq_dqb_lock); if (reserve) - dquot_free_reserved_space(dquots[cnt], - number); + dquot_free_reserved_space(dquot, number); else - dquot_decr_space(dquots[cnt], number); - spin_unlock(&dquots[cnt]->dq_dqb_lock); + dquot_decr_space(dquot, number); + spin_unlock(&dquot->dq_dqb_lock); } spin_unlock(&inode->i_lock); goto out_flush_warn; @@ -1754,6 +1756,7 @@ int dquot_alloc_inode(struct inode *inode) int cnt, ret = 0, index; struct dquot_warn warn[MAXQUOTAS]; struct dquot * const *dquots; + struct dquot *dquot; if (!inode_quota_active(inode)) return 0; @@ -1764,17 +1767,19 @@ int dquot_alloc_inode(struct inode *inode) index = srcu_read_lock(&dquot_srcu); spin_lock(&inode->i_lock); for (cnt = 0; cnt < MAXQUOTAS; cnt++) { - if (!dquots[cnt]) + dquot = srcu_dereference(dquots[cnt], &dquot_srcu); + if (!dquot) continue; - ret = dquot_add_inodes(dquots[cnt], 1, &warn[cnt]); + ret = dquot_add_inodes(dquot, 1, &warn[cnt]); if (ret) { for (cnt--; cnt >= 0; cnt--) { - if (!dquots[cnt]) + dquot = srcu_dereference(dquots[cnt], &dquot_srcu); + if (!dquot) continue; /* Back out changes we already did */ - spin_lock(&dquots[cnt]->dq_dqb_lock); - dquot_decr_inodes(dquots[cnt], 1); - spin_unlock(&dquots[cnt]->dq_dqb_lock); + spin_lock(&dquot->dq_dqb_lock); + dquot_decr_inodes(dquot, 1); + spin_unlock(&dquot->dq_dqb_lock); } goto warn_put_all; } @@ -1796,6 +1801,7 @@ EXPORT_SYMBOL(dquot_alloc_inode); int dquot_claim_space_nodirty(struct inode *inode, qsize_t number) { struct dquot **dquots; + struct dquot *dquot; int cnt, index; if (!inode_quota_active(inode)) { @@ -1811,9 +1817,8 @@ int dquot_claim_space_nodirty(struct inode *inode, qsize_t number) spin_lock(&inode->i_lock); /* Claim reserved quotas to allocated quotas */ for (cnt = 0; cnt < MAXQUOTAS; cnt++) { - if (dquots[cnt]) { - struct dquot *dquot = dquots[cnt]; - + dquot = srcu_dereference(dquots[cnt], &dquot_srcu); + if (dquot) { spin_lock(&dquot->dq_dqb_lock); if (WARN_ON_ONCE(dquot->dq_dqb.dqb_rsvspace < number)) number = dquot->dq_dqb.dqb_rsvspace; @@ -1838,6 +1843,7 @@ EXPORT_SYMBOL(dquot_claim_space_nodirty); void dquot_reclaim_space_nodirty(struct inode *inode, qsize_t number) { struct dquot **dquots; + struct dquot *dquot; int cnt, index; if (!inode_quota_active(inode)) { @@ -1853,9 +1859,8 @@ void dquot_reclaim_space_nodirty(struct inode *inode, qsize_t number) spin_lock(&inode->i_lock); /* Claim reserved quotas to allocated quotas */ for (cnt = 0; cnt < MAXQUOTAS; cnt++) { - if (dquots[cnt]) { - struct dquot *dquot = dquots[cnt]; - + dquot = srcu_dereference(dquots[cnt], &dquot_srcu); + if (dquot) { spin_lock(&dquot->dq_dqb_lock); if (WARN_ON_ONCE(dquot->dq_dqb.dqb_curspace < number)) number = dquot->dq_dqb.dqb_curspace; @@ -1882,6 +1887,7 @@ void __dquot_free_space(struct inode *inode, qsize_t number, int flags) unsigned int cnt; struct dquot_warn warn[MAXQUOTAS]; struct dquot **dquots; + struct dquot *dquot; int reserve = flags & DQUOT_SPACE_RESERVE, index; if (!inode_quota_active(inode)) { @@ -1902,17 +1908,18 @@ void __dquot_free_space(struct inode *inode, qsize_t number, int flags) int wtype; warn[cnt].w_type = QUOTA_NL_NOWARN; - if (!dquots[cnt]) + dquot = srcu_dereference(dquots[cnt], &dquot_srcu); + if (!dquot) continue; - spin_lock(&dquots[cnt]->dq_dqb_lock); - wtype = info_bdq_free(dquots[cnt], number); + spin_lock(&dquot->dq_dqb_lock); + wtype = info_bdq_free(dquot, number); if (wtype != QUOTA_NL_NOWARN) - prepare_warning(&warn[cnt], dquots[cnt], wtype); + prepare_warning(&warn[cnt], dquot, wtype); if (reserve) - dquot_free_reserved_space(dquots[cnt], number); + dquot_free_reserved_space(dquot, number); else - dquot_decr_space(dquots[cnt], number); - spin_unlock(&dquots[cnt]->dq_dqb_lock); + dquot_decr_space(dquot, number); + spin_unlock(&dquot->dq_dqb_lock); } if (reserve) *inode_reserved_space(inode) -= number; @@ -1937,6 +1944,7 @@ void dquot_free_inode(struct inode *inode) unsigned int cnt; struct dquot_warn warn[MAXQUOTAS]; struct dquot * const *dquots; + struct dquot *dquot; int index; if (!inode_quota_active(inode)) @@ -1947,16 +1955,16 @@ void dquot_free_inode(struct inode *inode) spin_lock(&inode->i_lock); for (cnt = 0; cnt < MAXQUOTAS; cnt++) { int wtype; - warn[cnt].w_type = QUOTA_NL_NOWARN; - if (!dquots[cnt]) + dquot = srcu_dereference(dquots[cnt], &dquot_srcu); + if (!dquot) continue; - spin_lock(&dquots[cnt]->dq_dqb_lock); - wtype = info_idq_free(dquots[cnt], 1); + spin_lock(&dquot->dq_dqb_lock); + wtype = info_idq_free(dquot, 1); if (wtype != QUOTA_NL_NOWARN) - prepare_warning(&warn[cnt], dquots[cnt], wtype); - dquot_decr_inodes(dquots[cnt], 1); - spin_unlock(&dquots[cnt]->dq_dqb_lock); + prepare_warning(&warn[cnt], dquot, wtype); + dquot_decr_inodes(dquot, 1); + spin_unlock(&dquot->dq_dqb_lock); } spin_unlock(&inode->i_lock); mark_all_dquot_dirty(dquots); @@ -1983,7 +1991,7 @@ int __dquot_transfer(struct inode *inode, struct dquot **transfer_to) qsize_t rsv_space = 0; qsize_t inode_usage = 1; struct dquot *transfer_from[MAXQUOTAS] = {}; - int cnt, ret = 0; + int cnt, index, ret = 0; char is_valid[MAXQUOTAS] = {}; struct dquot_warn warn_to[MAXQUOTAS]; struct dquot_warn warn_from_inodes[MAXQUOTAS]; @@ -2072,8 +2080,16 @@ int __dquot_transfer(struct inode *inode, struct dquot **transfer_to) spin_unlock(&inode->i_lock); spin_unlock(&dq_data_lock); + /* + * These arrays are local and we hold dquot references so we don't need + * the srcu protection but still take dquot_srcu to avoid warning in + * mark_all_dquot_dirty(). + */ + index = srcu_read_lock(&dquot_srcu); mark_all_dquot_dirty(transfer_from); mark_all_dquot_dirty(transfer_to); + srcu_read_unlock(&dquot_srcu, index); + flush_warnings(warn_to); flush_warnings(warn_from_inodes); flush_warnings(warn_from_space); -- 2.31.1
2 1
0 0
[PATCH OLK-5.10] PCI/IOV: Improve performance of creating VFs concurrently
by Jialin Zhang 28 Apr '24

28 Apr '24
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I9J08D -------------------------------- Previous commit 083577ae9d72 ("PCI/IOV: Add pci_sriov_numvfs_lock to support enable pci sriov concurrently") reduce performance of creating VFs belongs to different PFs. Fix it by checking whether a new bus will be created. Fixes: 083577ae9d72 ("PCI/IOV: Add pci_sriov_numvfs_lock to support enable pci sriov concurrently") Signed-off-by: Jialin Zhang <zhangjialin11(a)huawei.com> --- drivers/pci/iov.c | 40 +++++++++++++++++++++++++++++++++------- include/linux/pci.h | 8 ++++++++ 2 files changed, 41 insertions(+), 7 deletions(-) diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index 7006413aa0a3..2190a6977c4e 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c @@ -240,6 +240,16 @@ int pci_iov_add_virtfn(struct pci_dev *dev, int id) return rc; } +int pci_iov_add_virtfn_locked(struct pci_dev *dev, int id) +{ + int rc; + + mutex_lock(&pci_sriov_numvfs_lock); + rc = pci_iov_add_virtfn(dev, id); + mutex_unlock(&pci_sriov_numvfs_lock); + return rc; +} + void pci_iov_remove_virtfn(struct pci_dev *dev, int id) { char buf[VIRTFN_ID_LEN]; @@ -269,6 +279,13 @@ void pci_iov_remove_virtfn(struct pci_dev *dev, int id) pci_dev_put(dev); } +void pci_iov_remove_virtfn_locked(struct pci_dev *dev, int id) +{ + mutex_lock(&pci_sriov_numvfs_lock); + pci_iov_remove_virtfn(dev, id); + mutex_unlock(&pci_sriov_numvfs_lock); +} + static ssize_t sriov_totalvfs_show(struct device *dev, struct device_attribute *attr, char *buf) @@ -315,7 +332,6 @@ static ssize_t sriov_numvfs_store(struct device *dev, if (num_vfs > pci_sriov_get_totalvfs(pdev)) return -ERANGE; - mutex_lock(&pci_sriov_numvfs_lock); device_lock(&pdev->dev); if (num_vfs == pdev->sriov->num_VFs) @@ -352,7 +368,6 @@ static ssize_t sriov_numvfs_store(struct device *dev, exit: device_unlock(&pdev->dev); - mutex_unlock(&pci_sriov_numvfs_lock); if (ret < 0) return ret; @@ -463,14 +478,21 @@ static int sriov_add_vfs(struct pci_dev *dev, u16 num_vfs) return 0; for (i = 0; i < num_vfs; i++) { - rc = pci_iov_add_virtfn(dev, i); + if (dev->bus->number != pci_iov_virtfn_bus(dev, i)) + rc = pci_iov_add_virtfn_locked(dev, i); + else + rc = pci_iov_add_virtfn(dev, i); if (rc) goto failed; } return 0; failed: - while (i--) - pci_iov_remove_virtfn(dev, i); + while (i--) { + if (dev->bus->number != pci_iov_virtfn_bus(dev, i)) + pci_iov_remove_virtfn_locked(dev, i); + else + pci_iov_remove_virtfn(dev, i); + } return rc; } @@ -590,8 +612,12 @@ static void sriov_del_vfs(struct pci_dev *dev) struct pci_sriov *iov = dev->sriov; int i; - for (i = 0; i < iov->num_VFs; i++) - pci_iov_remove_virtfn(dev, i); + for (i = 0; i < iov->num_VFs; i++) { + if (dev->bus->number != pci_iov_virtfn_bus(dev, i)) + pci_iov_remove_virtfn_locked(dev, i); + else + pci_iov_remove_virtfn(dev, i); + } } static void sriov_disable(struct pci_dev *dev) diff --git a/include/linux/pci.h b/include/linux/pci.h index 0c116b6383ef..1638ac9a557c 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -2125,7 +2125,9 @@ void pci_disable_sriov(struct pci_dev *dev); int pci_iov_sysfs_link(struct pci_dev *dev, struct pci_dev *virtfn, int id); int pci_iov_add_virtfn(struct pci_dev *dev, int id); +int pci_iov_add_virtfn_locked(struct pci_dev *dev, int id); void pci_iov_remove_virtfn(struct pci_dev *dev, int id); +void pci_iov_remove_virtfn_locked(struct pci_dev *dev, int id); int pci_num_vf(struct pci_dev *dev); int pci_vfs_assigned(struct pci_dev *dev); int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs); @@ -2165,8 +2167,14 @@ static inline int pci_iov_add_virtfn(struct pci_dev *dev, int id) { return -ENOSYS; } +static inline int pci_iov_add_virtfn_locked(struct pci_dev *dev, int id) +{ + return -ENOSYS; +} static inline void pci_iov_remove_virtfn(struct pci_dev *dev, int id) { } +static inline void pci_iov_remove_virtfn_locked(struct pci_dev *dev, + int id) { } static inline void pci_disable_sriov(struct pci_dev *dev) { } static inline int pci_num_vf(struct pci_dev *dev) { return 0; } static inline int pci_vfs_assigned(struct pci_dev *dev) -- 2.25.1
2 1
0 0
[PATCH] SUNRPC: Fix a slow server-side memory leak with RPC-over-TCP
by wguanghao 28 Apr '24

28 Apr '24
From: Chuck Lever <chuck.lever(a)oracle.com> Jan Schunk reports that his small NFS servers suffer from memory exhaustion after just a few days. A bisect shows that commit e18e157bb5c8 ("SUNRPC: Send RPC message on TCP with a single sock_sendmsg() call") is the first bad commit. That commit assumed that sock_sendmsg() releases all the pages in the underlying bio_vec array, but the reality is that it doesn't. svc_xprt_release() releases the rqst's response pages, but the record marker page fragment isn't one of those, so it is never released. This is a narrow fix that can be applied to stable kernels. A more extensive fix is in the works. Reported-by: Jan Schunk <scpcom(a)gmx.de> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218671 Fixes: e18e157bb5c8 ("SUNRPC: Send RPC message on TCP with a single sock_sendmsg() call") Cc: Alexander Duyck <alexander.duyck(a)gmail.com> Cc: Jakub Kacinski <kuba(a)kernel.org> Cc: David Howells <dhowells(a)redhat.com> Reviewed-by: David Howells <dhowells(a)redhat.com> Signed-off-by: Chuck Lever <chuck.lever(a)oracle.com> --- net/sunrpc/svcsock.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index 545017a3daa4..6b3f01beb294 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c @@ -1206,15 +1206,6 @@ static int svc_tcp_recvfrom(struct svc_rqst *rqstp) * MSG_SPLICE_PAGES is used exclusively to reduce the number of * copy operations in this path. Therefore the caller must ensure * that the pages backing @xdr are unchanging. - * - * Note that the send is non-blocking. The caller has incremented - * the reference count on each page backing the RPC message, and - * the network layer will "put" these pages when transmission is - * complete. - * - * This is safe for our RPC services because the memory backing - * the head and tail components is never kmalloc'd. These always - * come from pages in the svc_rqst::rq_pages array. */ static int svc_tcp_sendmsg(struct svc_sock *svsk, struct svc_rqst *rqstp, rpc_fraghdr marker, unsigned int *sentp) @@ -1244,6 +1235,7 @@ static int svc_tcp_sendmsg(struct svc_sock *svsk, struct svc_rqst *rqstp, iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, rqstp->rq_bvec, 1 + count, sizeof(marker) + rqstp->rq_res.len); ret = sock_sendmsg(svsk->sk_sock, &msg); + page_frag_free(buf); if (ret < 0) return ret; *sentp += ret; -- 2.39.2
1 0
0 0
[openeuler:OLK-6.6 7547/7556] drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:860: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
by kernel test robot 28 Apr '24

28 Apr '24
tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: 6773f12aed5e797a2c93fd0f7632568554503971 commit: 4213ff7957de370c1cfe528c2bad1eb2e499038a [7547/7556] net/ethernet/huawei/hinic3: Add the CQM on which the RDMA depends config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20240428/202404281612.QppNPnCk-lkp@…) compiler: clang version 18.1.4 (https://github.com/llvm/llvm-project e6c3289804a67ea0bb6a86fadbe454dd93b8d855) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240428/202404281612.QppNPnCk-lkp@…) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp(a)intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202404281612.QppNPnCk-lkp@intel.com/ All warnings (new ones prefixed by >>): >> drivers/net/ethernet/huawei/hinic3/hw/hinic3_hw_cfg.c:1097: warning: expecting prototype for hinic_set_vf_dev_cap(). Prototype was for hinic3_init_vf_dev_cap() instead -- >> drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:863:5: warning: no previous prototype for function 'hinic3_global_func_id_hw' [-Wmissing-prototypes] 863 | u16 hinic3_global_func_id_hw(void *hwdev) | ^ drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:863:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 863 | u16 hinic3_global_func_id_hw(void *hwdev) | ^ | static >> drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:880:5: warning: no previous prototype for function 'hinic3_global_func_id_get' [-Wmissing-prototypes] 880 | int hinic3_global_func_id_get(void *hwdev, u16 *func_id) | ^ drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:880:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 880 | int hinic3_global_func_id_get(void *hwdev, u16 *func_id) | ^ | static 2 warnings generated. -- drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:312: warning: Function parameter or member 'attr6' not described in 'set_hwif_attr' drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:773: warning: Function parameter or member 'hwdev' not described in 'hinic3_init_hwif' drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:773: warning: Function parameter or member 'cfg_reg_base' not described in 'hinic3_init_hwif' drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:773: warning: Function parameter or member 'intr_reg_base' not described in 'hinic3_init_hwif' drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:773: warning: Function parameter or member 'mgmt_regs_base' not described in 'hinic3_init_hwif' drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:773: warning: Function parameter or member 'db_base_phy' not described in 'hinic3_init_hwif' drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:773: warning: Function parameter or member 'db_base' not described in 'hinic3_init_hwif' drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:773: warning: Function parameter or member 'db_dwqe_len' not described in 'hinic3_init_hwif' drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:773: warning: Excess function parameter 'hwif' description in 'hinic3_init_hwif' drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:773: warning: Excess function parameter 'pdev' description in 'hinic3_init_hwif' drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:839: warning: Function parameter or member 'hwdev' not described in 'hinic3_free_hwif' drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:839: warning: Excess function parameter 'hwif' description in 'hinic3_free_hwif' drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:839: warning: Excess function parameter 'pdev' description in 'hinic3_free_hwif' >> drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:860: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * get function id from register,used by sriov hot migration process drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:876: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * get function id, used by sriov hot migratition process. -- >> drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:46:6: warning: no previous prototype for function 'hinic3_get_master_host_mbox_enable' [-Wmissing-prototypes] 46 | bool hinic3_get_master_host_mbox_enable(void *hwdev) | ^ drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:46:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 46 | bool hinic3_get_master_host_mbox_enable(void *hwdev) | ^ | static >> drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:148:5: warning: no previous prototype for function '__mbox_to_host' [-Wmissing-prototypes] 148 | int __mbox_to_host(struct hinic3_hwdev *hwdev, enum hinic3_mod_type mod, | ^ drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:148:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 148 | int __mbox_to_host(struct hinic3_hwdev *hwdev, enum hinic3_mod_type mod, | ^ | static >> drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:547:5: warning: no previous prototype for function 'sw_func_ppf_mbox_handler' [-Wmissing-prototypes] 547 | int sw_func_ppf_mbox_handler(void *handle, u16 pf_idx, u16 vf_id, u16 cmd, | ^ drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:547:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 547 | int sw_func_ppf_mbox_handler(void *handle, u16 pf_idx, u16 vf_id, u16 cmd, | ^ | static >> drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:570:5: warning: no previous prototype for function '__ppf_process_mbox_msg' [-Wmissing-prototypes] 570 | int __ppf_process_mbox_msg(struct hinic3_hwdev *hwdev, u16 pf_idx, u16 vf_id, | ^ drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:570:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 570 | int __ppf_process_mbox_msg(struct hinic3_hwdev *hwdev, u16 pf_idx, u16 vf_id, | ^ | static >> drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:599:5: warning: no previous prototype for function 'hinic3_ppf_process_mbox_msg' [-Wmissing-prototypes] 599 | int hinic3_ppf_process_mbox_msg(struct hinic3_hwdev *hwdev, u16 pf_idx, u16 vf_id, | ^ drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:599:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 599 | int hinic3_ppf_process_mbox_msg(struct hinic3_hwdev *hwdev, u16 pf_idx, u16 vf_id, | ^ | static >> drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:643:5: warning: no previous prototype for function 'comm_ppf_mbox_handler' [-Wmissing-prototypes] 643 | int comm_ppf_mbox_handler(void *handle, u16 pf_idx, u16 vf_id, u16 cmd, | ^ drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:643:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 643 | int comm_ppf_mbox_handler(void *handle, u16 pf_idx, u16 vf_id, u16 cmd, | ^ | static >> drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:652:5: warning: no previous prototype for function 'hilink_ppf_mbox_handler' [-Wmissing-prototypes] 652 | int hilink_ppf_mbox_handler(void *handle, u16 pf_idx, u16 vf_id, u16 cmd, | ^ drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:652:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 652 | int hilink_ppf_mbox_handler(void *handle, u16 pf_idx, u16 vf_id, u16 cmd, | ^ | static >> drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:661:5: warning: no previous prototype for function 'hinic3_nic_ppf_mbox_handler' [-Wmissing-prototypes] 661 | int hinic3_nic_ppf_mbox_handler(void *handle, u16 pf_idx, u16 vf_id, u16 cmd, | ^ drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:661:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 661 | int hinic3_nic_ppf_mbox_handler(void *handle, u16 pf_idx, u16 vf_id, u16 cmd, | ^ | static >> drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:670:5: warning: no previous prototype for function 'hinic3_register_slave_ppf' [-Wmissing-prototypes] 670 | int hinic3_register_slave_ppf(struct hinic3_hwdev *hwdev, bool registered) | ^ drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:670:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 670 | int hinic3_register_slave_ppf(struct hinic3_hwdev *hwdev, bool registered) | ^ | static >> drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:743:5: warning: no previous prototype for function 'set_slave_func_nic_state' [-Wmissing-prototypes] 743 | int set_slave_func_nic_state(struct hinic3_hwdev *hwdev, | ^ drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:743:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 743 | int set_slave_func_nic_state(struct hinic3_hwdev *hwdev, | ^ | static >> drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:776:5: warning: no previous prototype for function 'get_slave_func_netdev_state' [-Wmissing-prototypes] 776 | int get_slave_func_netdev_state(struct hinic3_hwdev *hwdev, u16 func_idx, | ^ drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:776:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 776 | int get_slave_func_netdev_state(struct hinic3_hwdev *hwdev, u16 func_idx, | ^ | static 11 warnings generated. -- >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:30:25: warning: no previous prototype for function 'cqm3_cmd_alloc' [-Wmissing-prototypes] 30 | struct tag_cqm_cmd_buf *cqm_cmd_alloc(void *ex_handle) | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_define.h:13:44: note: expanded from macro 'cqm_cmd_alloc' 13 | #define cqm_cmd_alloc cqm3_cmd_alloc | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:30:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 30 | struct tag_cqm_cmd_buf *cqm_cmd_alloc(void *ex_handle) | ^ | static >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:55:6: warning: no previous prototype for function 'cqm3_cmd_free' [-Wmissing-prototypes] 55 | void cqm_cmd_free(void *ex_handle, struct tag_cqm_cmd_buf *cmd_buf) | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_define.h:15:44: note: expanded from macro 'cqm_cmd_free' 15 | #define cqm_cmd_free cqm3_cmd_free | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:55:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 55 | void cqm_cmd_free(void *ex_handle, struct tag_cqm_cmd_buf *cmd_buf) | ^ | static >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:95:5: warning: no previous prototype for function 'cqm3_send_cmd_box' [-Wmissing-prototypes] 95 | s32 cqm_send_cmd_box(void *ex_handle, u8 mod, u8 cmd, struct tag_cqm_cmd_buf *buf_in, | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_define.h:16:44: note: expanded from macro 'cqm_send_cmd_box' 16 | #define cqm_send_cmd_box cqm3_send_cmd_box | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:95:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 95 | s32 cqm_send_cmd_box(void *ex_handle, u8 mod, u8 cmd, struct tag_cqm_cmd_buf *buf_in, | ^ | static >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:141:5: warning: no previous prototype for function 'cqm3_lb_send_cmd_box' [-Wmissing-prototypes] 141 | s32 cqm_lb_send_cmd_box(void *ex_handle, u8 mod, u8 cmd, u8 cos_id, | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_define.h:17:44: note: expanded from macro 'cqm_lb_send_cmd_box' 17 | #define cqm_lb_send_cmd_box cqm3_lb_send_cmd_box | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:141:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 141 | s32 cqm_lb_send_cmd_box(void *ex_handle, u8 mod, u8 cmd, u8 cos_id, | ^ | static >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:184:5: warning: no previous prototype for function 'cqm3_lb_send_cmd_box_async' [-Wmissing-prototypes] 184 | s32 cqm_lb_send_cmd_box_async(void *ex_handle, u8 mod, u8 cmd, | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_define.h:18:44: note: expanded from macro 'cqm_lb_send_cmd_box_async' 18 | #define cqm_lb_send_cmd_box_async cqm3_lb_send_cmd_box_async | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:184:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 184 | s32 cqm_lb_send_cmd_box_async(void *ex_handle, u8 mod, u8 cmd, | ^ | static >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:226:5: warning: no previous prototype for function 'cqm3_send_cmd_imm' [-Wmissing-prototypes] 226 | s32 cqm_send_cmd_imm(void *ex_handle, u8 mod, u8 cmd, struct tag_cqm_cmd_buf *buf_in, | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_define.h:19:44: note: expanded from macro 'cqm_send_cmd_imm' 19 | #define cqm_send_cmd_imm cqm3_send_cmd_imm | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:226:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 226 | s32 cqm_send_cmd_imm(void *ex_handle, u8 mod, u8 cmd, struct tag_cqm_cmd_buf *buf_in, | ^ | static 6 warnings generated. -- >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_db.c:75:6: warning: no previous prototype for function 'cqm3_db_addr_free' [-Wmissing-prototypes] 75 | void cqm_db_addr_free(void *ex_handle, const void __iomem *db_addr, | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_define.h:21:44: note: expanded from macro 'cqm_db_addr_free' 21 | #define cqm_db_addr_free cqm3_db_addr_free | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_db.c:75:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 75 | void cqm_db_addr_free(void *ex_handle, const void __iomem *db_addr, | ^ | static >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_db.c:233:5: warning: no previous prototype for function 'cqm3_get_hardware_db_addr' [-Wmissing-prototypes] 233 | s32 cqm_get_hardware_db_addr(void *ex_handle, u64 *addr, | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_define.h:14:44: note: expanded from macro 'cqm_get_hardware_db_addr' 14 | #define cqm_get_hardware_db_addr cqm3_get_hardware_db_addr | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_db.c:233:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 233 | s32 cqm_get_hardware_db_addr(void *ex_handle, u64 *addr, | ^ | static 2 warnings generated. -- >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object.c:1604:5: warning: no previous prototype for function 'cqm3_dtoe_share_recv_queue_create' [-Wmissing-prototypes] 1604 | s32 cqm_dtoe_share_recv_queue_create(void *ex_handle, u32 contex_size, | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_define.h:47:44: note: expanded from macro 'cqm_dtoe_share_recv_queue_create' 47 | #define cqm_dtoe_share_recv_queue_create cqm3_dtoe_share_recv_queue_create | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_object.c:1604:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 1604 | s32 cqm_dtoe_share_recv_queue_create(void *ex_handle, u32 contex_size, | ^ | static >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object.c:1649:6: warning: no previous prototype for function 'cqm3_dtoe_free_srq_bitmap_index' [-Wmissing-prototypes] 1649 | void cqm_dtoe_free_srq_bitmap_index(void *ex_handle, u32 index_count, u32 index) | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_define.h:46:44: note: expanded from macro 'cqm_dtoe_free_srq_bitmap_index' 46 | #define cqm_dtoe_free_srq_bitmap_index cqm3_dtoe_free_srq_bitmap_index | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_object.c:1649:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 1649 | void cqm_dtoe_free_srq_bitmap_index(void *ex_handle, u32 index_count, u32 index) | ^ | static 2 warnings generated. -- >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:35: warning: Function parameter or member 'cqm_handle' not described in 'bloomfilter_init_cmd' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:35: warning: expecting prototype for Prototype(). Prototype was for bloomfilter_init_cmd() instead >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:207: warning: Function parameter or member 'ex_handle' not described in 'cqm_bloomfilter_init' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:207: warning: expecting prototype for Prototype(). Prototype was for cqm_bloomfilter_init() instead >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:242: warning: Function parameter or member 'ex_handle' not described in 'cqm_bloomfilter_uninit' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:242: warning: expecting prototype for Prototype(). Prototype was for cqm_bloomfilter_uninit() instead >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:265: warning: Function parameter or member 'ex_handle' not described in 'cqm_bloomfilter_cmd' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:265: warning: Function parameter or member 'func_id' not described in 'cqm_bloomfilter_cmd' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:265: warning: Function parameter or member 'op' not described in 'cqm_bloomfilter_cmd' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:265: warning: Function parameter or member 'k_flag' not described in 'cqm_bloomfilter_cmd' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:265: warning: Function parameter or member 'id' not described in 'cqm_bloomfilter_cmd' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:265: warning: expecting prototype for Prototype(). Prototype was for cqm_bloomfilter_cmd() instead >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:363: warning: Function parameter or member 'ex_handle' not described in 'cqm_bloomfilter_inc' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:363: warning: Function parameter or member 'func_id' not described in 'cqm_bloomfilter_inc' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:363: warning: Function parameter or member 'id' not described in 'cqm_bloomfilter_inc' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:363: warning: expecting prototype for Prototype(). Prototype was for cqm_bloomfilter_inc() instead >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:460: warning: Function parameter or member 'ex_handle' not described in 'cqm_bloomfilter_dec' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:460: warning: Function parameter or member 'func_id' not described in 'cqm_bloomfilter_dec' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:460: warning: Function parameter or member 'id' not described in 'cqm_bloomfilter_dec' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:460: warning: expecting prototype for Prototype(). Prototype was for cqm_bloomfilter_dec() instead -- >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:31: warning: Function parameter or member 'ex_handle' not described in 'cqm_cmd_alloc' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:31: warning: expecting prototype for Prototype(). Prototype was for cqm_cmd_alloc() instead >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:56: warning: Function parameter or member 'ex_handle' not described in 'cqm_cmd_free' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:56: warning: Function parameter or member 'cmd_buf' not described in 'cqm_cmd_free' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:56: warning: expecting prototype for Prototype(). Prototype was for cqm_cmd_free() instead >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:98: warning: Function parameter or member 'ex_handle' not described in 'cqm_send_cmd_box' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:98: warning: Function parameter or member 'mod' not described in 'cqm_send_cmd_box' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:98: warning: Function parameter or member 'cmd' not described in 'cqm_send_cmd_box' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:98: warning: Function parameter or member 'buf_in' not described in 'cqm_send_cmd_box' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:98: warning: Function parameter or member 'buf_out' not described in 'cqm_send_cmd_box' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:98: warning: Function parameter or member 'out_param' not described in 'cqm_send_cmd_box' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:98: warning: Function parameter or member 'timeout' not described in 'cqm_send_cmd_box' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:98: warning: Function parameter or member 'channel' not described in 'cqm_send_cmd_box' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:98: warning: expecting prototype for Prototype(). Prototype was for cqm_send_cmd_box() instead >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:144: warning: Function parameter or member 'ex_handle' not described in 'cqm_lb_send_cmd_box' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:144: warning: Function parameter or member 'mod' not described in 'cqm_lb_send_cmd_box' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:144: warning: Function parameter or member 'cmd' not described in 'cqm_lb_send_cmd_box' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:144: warning: Function parameter or member 'cos_id' not described in 'cqm_lb_send_cmd_box' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:144: warning: Function parameter or member 'buf_in' not described in 'cqm_lb_send_cmd_box' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:144: warning: Function parameter or member 'buf_out' not described in 'cqm_lb_send_cmd_box' drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:144: warning: Function parameter or member 'out_param' not described in 'cqm_lb_send_cmd_box' drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:144: warning: Function parameter or member 'timeout' not described in 'cqm_lb_send_cmd_box' drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:144: warning: Function parameter or member 'channel' not described in 'cqm_lb_send_cmd_box' drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:144: warning: expecting prototype for Prototype(). Prototype was for cqm_lb_send_cmd_box() instead drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:187: warning: Function parameter or member 'ex_handle' not described in 'cqm_lb_send_cmd_box_async' drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:187: warning: Function parameter or member 'mod' not described in 'cqm_lb_send_cmd_box_async' drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:187: warning: Function parameter or member 'cmd' not described in 'cqm_lb_send_cmd_box_async' drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:187: warning: Function parameter or member 'cos_id' not described in 'cqm_lb_send_cmd_box_async' drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:187: warning: Function parameter or member 'buf_in' not described in 'cqm_lb_send_cmd_box_async' drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:187: warning: Function parameter or member 'channel' not described in 'cqm_lb_send_cmd_box_async' drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:187: warning: expecting prototype for Prototype(). Prototype was for cqm_lb_send_cmd_box_async() instead drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:228: warning: Function parameter or member 'ex_handle' not described in 'cqm_send_cmd_imm' drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:228: warning: Function parameter or member 'mod' not described in 'cqm_send_cmd_imm' drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:228: warning: Function parameter or member 'cmd' not described in 'cqm_send_cmd_imm' drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:228: warning: Function parameter or member 'buf_in' not described in 'cqm_send_cmd_imm' drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:228: warning: Function parameter or member 'out_param' not described in 'cqm_send_cmd_imm' drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:228: warning: Function parameter or member 'timeout' not described in 'cqm_send_cmd_imm' drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:228: warning: Function parameter or member 'channel' not described in 'cqm_send_cmd_imm' drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:228: warning: expecting prototype for Prototype(). Prototype was for cqm_send_cmd_imm() instead -- >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:44: warning: Function parameter or member 'srq_head_container' not described in 'cqm_container_free' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:44: warning: Function parameter or member 'srq_tail_container' not described in 'cqm_container_free' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:44: warning: Function parameter or member 'common' not described in 'cqm_container_free' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:44: warning: expecting prototype for Prototype(). Prototype was for cqm_container_free() instead >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:126: warning: Function parameter or member 'object' not described in 'cqm_container_create' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:126: warning: Function parameter or member 'container_addr' not described in 'cqm_container_create' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:126: warning: Function parameter or member 'link' not described in 'cqm_container_create' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:126: warning: expecting prototype for Prototype(). Prototype was for cqm_container_create() instead >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:228: warning: Function parameter or member 'object' not described in 'cqm_srq_container_init' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:228: warning: expecting prototype for Prototype(). Prototype was for cqm_srq_container_init() instead >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:280: warning: Function parameter or member 'object' not described in 'cqm_share_recv_queue_create' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:280: warning: expecting prototype for Prototype(). Prototype was for cqm_share_recv_queue_create() instead >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:348: warning: Function parameter or member 'object' not described in 'cqm_srq_used_rq_delete' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:348: warning: expecting prototype for Prototype(). Prototype was for cqm_srq_used_rq_delete() instead >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:408: warning: Function parameter or member 'object' not described in 'cqm_share_recv_queue_delete' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:408: warning: expecting prototype for Prototype(). Prototype was for cqm_share_recv_queue_delete() instead >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:458: warning: Function parameter or member 'object' not described in 'cqm_qpc_mpt_bitmap_alloc' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:458: warning: Function parameter or member 'cla_table' not described in 'cqm_qpc_mpt_bitmap_alloc' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:458: warning: Function parameter or member 'low2bit_align_en' not described in 'cqm_qpc_mpt_bitmap_alloc' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:458: warning: expecting prototype for Prototype(). Prototype was for cqm_qpc_mpt_bitmap_alloc() instead drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:523: warning: Function parameter or member 'object' not described in 'cqm_qpc_mpt_create' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:523: warning: Function parameter or member 'low2bit_align_en' not described in 'cqm_qpc_mpt_create' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:523: warning: expecting prototype for Prototype(). Prototype was for cqm_qpc_mpt_create() instead drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:622: warning: Function parameter or member 'object' not described in 'cqm_qpc_mpt_delete' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:622: warning: expecting prototype for Prototype(). Prototype was for cqm_qpc_mpt_delete() instead drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:704: warning: Function parameter or member 'buf' not described in 'cqm_linkwqe_fill' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:704: warning: Function parameter or member 'wqe_per_buf' not described in 'cqm_linkwqe_fill' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:704: warning: Function parameter or member 'wqe_size' not described in 'cqm_linkwqe_fill' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:704: warning: Function parameter or member 'wqe_number' not described in 'cqm_linkwqe_fill' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:704: warning: Function parameter or member 'tail' not described in 'cqm_linkwqe_fill' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:704: warning: Function parameter or member 'link_mode' not described in 'cqm_linkwqe_fill' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:704: warning: expecting prototype for Prototype(). Prototype was for cqm_linkwqe_fill() instead drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:889: warning: Function parameter or member 'object' not described in 'cqm_nonrdma_queue_create' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:889: warning: expecting prototype for Prototype(). Prototype was for cqm_nonrdma_queue_create() instead drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:996: warning: Function parameter or member 'object' not described in 'cqm_nonrdma_queue_delete' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:996: warning: expecting prototype for Prototype(). Prototype was for cqm_nonrdma_queue_delete() instead drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:1174: warning: Function parameter or member 'object' not described in 'cqm_rdma_queue_create' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:1174: warning: expecting prototype for Prototype(). Prototype was for cqm_rdma_queue_create() instead drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:1258: warning: Function parameter or member 'object' not described in 'cqm_rdma_queue_delete' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:1258: warning: expecting prototype for Prototype(). Prototype was for cqm_rdma_queue_delete() instead drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:1342: warning: Function parameter or member 'object' not described in 'cqm_rdma_table_create' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:1342: warning: expecting prototype for Prototype(). Prototype was for cqm_rdma_table_create() instead drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:1391: warning: Function parameter or member 'object' not described in 'cqm_rdma_table_delete' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:1391: warning: expecting prototype for Prototype(). Prototype was for cqm_rdma_table_delete() instead drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:1426: warning: Function parameter or member 'object' not described in 'cqm_rdma_table_offset_addr' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:1426: warning: Function parameter or member 'offset' not described in 'cqm_rdma_table_offset_addr' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:1426: warning: Function parameter or member 'paddr' not described in 'cqm_rdma_table_offset_addr' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:1426: warning: expecting prototype for Prototype(). Prototype was for cqm_rdma_table_offset_addr() instead .. vim +860 drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c 763 764 /** 765 * hinic3_init_hwif - initialize the hw interface 766 * @hwif: the hardware interface of a pci function device 767 * @pdev: the pci device that will be part of the hwif struct 768 * Return: 0 - success, negative - failure 769 **/ 770 int hinic3_init_hwif(struct hinic3_hwdev *hwdev, void *cfg_reg_base, 771 void *intr_reg_base, void *mgmt_regs_base, u64 db_base_phy, 772 void *db_base, u64 db_dwqe_len) > 773 { 774 struct hinic3_hwif *hwif = NULL; 775 u32 attr1, attr4, attr5; 776 int err; 777 778 err = init_hwif(hwdev, cfg_reg_base, intr_reg_base, mgmt_regs_base); 779 if (err) 780 return err; 781 782 hwif = hwdev->hwif; 783 784 err = init_db_area_idx(hwif, db_base_phy, db_base, db_dwqe_len); 785 if (err) { 786 sdk_err(hwdev->dev_hdl, "Failed to init db area.\n"); 787 goto init_db_area_err; 788 } 789 790 err = wait_hwif_ready(hwdev); 791 if (err) { 792 attr1 = hinic3_hwif_read_reg(hwif, HINIC3_CSR_FUNC_ATTR1_ADDR); 793 sdk_err(hwdev->dev_hdl, "Chip status is not ready, attr1:0x%x\n", attr1); 794 goto hwif_ready_err; 795 } 796 797 err = get_hwif_attr(hwif); 798 if (err) { 799 sdk_err(hwdev->dev_hdl, "Get hwif attr failed\n"); 800 goto hwif_ready_err; 801 } 802 803 err = wait_until_doorbell_and_outbound_enabled(hwif); 804 if (err) { 805 attr4 = hinic3_hwif_read_reg(hwif, HINIC3_CSR_FUNC_ATTR4_ADDR); 806 attr5 = hinic3_hwif_read_reg(hwif, HINIC3_CSR_FUNC_ATTR5_ADDR); 807 sdk_err(hwdev->dev_hdl, "Hw doorbell/outbound is disabled, attr4 0x%x attr5 0x%x\n", 808 attr4, attr5); 809 goto hwif_ready_err; 810 } 811 812 select_ppf_mpf(hwdev); 813 814 disable_all_msix(hwdev); 815 /* disable mgmt cpu report any event */ 816 hinic3_set_pf_status(hwdev->hwif, HINIC3_PF_STATUS_INIT); 817 818 sdk_info(hwdev->dev_hdl, "global_func_idx: %u, func_type: %d, host_id: %u, ppf: %u, mpf: %u\n", 819 hwif->attr.func_global_idx, hwif->attr.func_type, hwif->attr.pci_intf_idx, 820 hwif->attr.ppf_idx, hwif->attr.mpf_idx); 821 822 return 0; 823 824 hwif_ready_err: 825 hinic3_show_chip_err_info(hwdev); 826 free_db_area(&hwif->free_db_area); 827 init_db_area_err: 828 kfree(hwif); 829 830 return err; 831 } 832 833 /** 834 * hinic3_free_hwif - free the hw interface 835 * @hwif: the hardware interface of a pci function device 836 * @pdev: the pci device that will be part of the hwif struct 837 **/ 838 void hinic3_free_hwif(struct hinic3_hwdev *hwdev) 839 { 840 spin_lock_deinit(&hwdev->hwif->free_db_area.idx_lock); 841 free_db_area(&hwdev->hwif->free_db_area); 842 enable_all_msix(hwdev); 843 kfree(hwdev->hwif); 844 } 845 846 u16 hinic3_global_func_id(void *hwdev) 847 { 848 struct hinic3_hwif *hwif = NULL; 849 850 if (!hwdev) 851 return 0; 852 853 hwif = ((struct hinic3_hwdev *)hwdev)->hwif; 854 855 return hwif->attr.func_global_idx; 856 } 857 EXPORT_SYMBOL(hinic3_global_func_id); 858 859 /** > 860 * get function id from register,used by sriov hot migration process 861 * @hwdev: the pointer to hw device 862 */ > 863 u16 hinic3_global_func_id_hw(void *hwdev) 864 { 865 u32 addr, attr0; 866 struct hinic3_hwdev *dev; 867 868 dev = (struct hinic3_hwdev *)hwdev; 869 addr = HINIC3_CSR_FUNC_ATTR0_ADDR; 870 attr0 = hinic3_hwif_read_reg(dev->hwif, addr); 871 872 return HINIC3_AF0_GET(attr0, FUNC_GLOBAL_IDX); 873 } 874 875 /** 876 * get function id, used by sriov hot migratition process. 877 * @hwdev: the pointer to hw device 878 * @func_id: function id 879 */ > 880 int hinic3_global_func_id_get(void *hwdev, u16 *func_id) 881 { 882 struct hinic3_hwdev *dev = (struct hinic3_hwdev *)hwdev; 883 884 if (!hwdev || !func_id) 885 return -EINVAL; 886 887 /* only vf get func_id from chip reg for sriov migrate */ 888 if (!HINIC3_IS_VF(dev)) { 889 *func_id = hinic3_global_func_id(hwdev); 890 return 0; 891 } 892 893 *func_id = hinic3_global_func_id_hw(dev); 894 return 0; 895 } 896 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[PATCH OLK-5.10] scsi: mpt3sas: Prevent sending diag_reset when the controller is ready
by Baogen Shang 28 Apr '24

28 Apr '24
From: Ranjan Kumar <ranjan.kumar(a)broadcom.com> stable inclusion from stable-v5.10.215 commit ba3a55d118bf211f4a7f53f83dafbc3405ea198d category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I9J6AL CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=… ------------------------- [ Upstream commit ee0017c3ed8a8abfa4d40e42f908fb38c31e7515 ] If the driver detects that the controller is not ready before sending the first IOC facts command, it will wait for a maximum of 10 seconds for it to become ready. However, even if the controller becomes ready within 10 seconds, the driver will still issue a diagnostic reset. Modify the driver to avoid sending a diag reset if the controller becomes ready within the 10-second wait time. Signed-off-by: Ranjan Kumar <ranjan.kumar(a)broadcom.com> Link: https://lore.kernel.org/r/20240221071724.14986-1-ranjan.kumar@broadcom.com Signed-off-by: Martin K. Petersen <martin.petersen(a)oracle.com> Signed-off-by: Sasha Levin <sashal(a)kernel.org> Signed-off-by: Baogen Shang <baogen.shang(a)windriver.com> --- drivers/scsi/mpt3sas/mpt3sas_base.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index 4bf1ea39d21a..55200f5db150 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c @@ -6357,7 +6357,9 @@ _base_wait_for_iocstate(struct MPT3SAS_ADAPTER *ioc, int timeout) return -EFAULT; } - issue_diag_reset: + return 0; + +issue_diag_reset: rc = _base_diag_reset(ioc); return rc; } -- 2.33.0
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 1087
  • 1088
  • 1089
  • 1090
  • 1091
  • 1092
  • 1093
  • ...
  • 1868
  • Older →

HyperKitty Powered by HyperKitty