[PATCH] ath10k: Fix ath10k_wmi_tlv_op_pull_peer_stats_info() unlock without lock

2021-04-06 Thread Shuah Khan
_by_ifaddr()") Reported-by: Pavel Machek Signed-off-by: Shuah Khan --- drivers/net/wireless/ath/ath10k/wmi-tlv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c index d97b33f789e4..7efbe03fbc

Re: [PATCH v3 0/3] Add lockdep_assert_not_held()

2021-03-01 Thread Shuah Khan
On 3/1/21 4:02 AM, Kalle Valo wrote: Peter Zijlstra writes: On Mon, Mar 01, 2021 at 10:45:32AM +0200, Kalle Valo wrote: Peter Zijlstra writes: On Fri, Feb 26, 2021 at 05:06:57PM -0700, Shuah Khan wrote: Shuah Khan (3): lockdep: add lockdep_assert_not_held() lockdep: add lockdep

[PATCH v3 2/3] lockdep: add lockdep lock state defines

2021-02-26 Thread Shuah Khan
) and __lock_is_held() to use the new defines. Link: https://lore.kernel.org/lkml/37a29c383bff2fb1605241ee6c7c9be3784fb3c6.1613171185.git.sk...@linuxfoundation.org/ Link: https://lore.kernel.org/linux-wireless/871rdmu9z9@codeaurora.org/ Signed-off-by: Shuah Khan --- include/linux/lockdep.h

[PATCH v3 3/3] ath10k: detect conf_mutex held ath10k_drain_tx() calls

2021-02-26 Thread Shuah Khan
://lore.kernel.org/lkml/37a29c383bff2fb1605241ee6c7c9be3784fb3c6.1613171185.git.sk...@linuxfoundation.org/ Link: https://lore.kernel.org/linux-wireless/871rdmu9z9@codeaurora.org/ Acked-by: Kalle Valo Signed-off-by: Shuah Khan --- drivers/net/wireless/ath/ath10k/mac.c | 2 ++ 1 file changed, 2 insertions

[PATCH v3 0/3] Add lockdep_assert_not_held()

2021-02-26 Thread Shuah Khan
s the new interface in ath10k_drain_tx() function. Added Kalle Valo's Ack from v1 for this change. Tested on the mainline from yesterday. Shuah Khan (3): lockdep: add lockdep_assert_not_held() lockdep: add lockdep lock state defines ath10k: detect conf_mutex held ath10k_drain_tx() calls

[PATCH v3 1/3] lockdep: add lockdep_assert_not_held()

2021-02-26 Thread Shuah Khan
lockdep_assert_not_held(). Link: https://lore.kernel.org/lkml/37a29c383bff2fb1605241ee6c7c9be3784fb3c6.1613171185.git.sk...@linuxfoundation.org/ Link: https://lore.kernel.org/linux-wireless/871rdmu9z9@codeaurora.org/ Signed-off-by: Shuah Khan --- include/linux/lockdep.h | 11 --- kernel

Re: [PATCH v2 1/3] lockdep: add lockdep_assert_not_held()

2021-02-26 Thread Shuah Khan
On 2/26/21 2:07 PM, Peter Zijlstra wrote: On Fri, Feb 26, 2021 at 10:52:13AM -0700, Shuah Khan wrote: + /* avoid false negative lockdep_assert_not_held() +* and lockdep_assert_held() +*/ That's a coding style fail. Checkpatch didn'

Re: [PATCH v2 2/3] lockdep: add lockdep lock state defines

2021-02-26 Thread Shuah Khan
fines. thanks, -- Shuah

Re: [PATCH 5/5] ath10k: reduce invalid ht params rate message noise

2021-02-26 Thread Shuah Khan
On 2/11/21 4:24 AM, Kalle Valo wrote: Shuah Khan writes: On 2/10/21 1:28 AM, Kalle Valo wrote: Wen Gong writes: On 2021-02-10 08:42, Shuah Khan wrote: ath10k_mac_get_rate_flags_ht() floods dmesg with the following messages, when it fails to find a match for mcs=7 and rate=1440

[PATCH v2 3/3] ath10k: detect conf_mutex held ath10k_drain_tx() calls

2021-02-26 Thread Shuah Khan
://lore.kernel.org/lkml/37a29c383bff2fb1605241ee6c7c9be3784fb3c6.1613171185.git.sk...@linuxfoundation.org/ Link: https://lore.kernel.org/linux-wireless/871rdmu9z9@codeaurora.org/ Acked-by: Kalle Valo Signed-off-by: Shuah Khan --- drivers/net/wireless/ath/ath10k/mac.c | 2 ++ 1 file changed, 2 insertions

[PATCH v2 2/3] lockdep: add lockdep lock state defines

2021-02-26 Thread Shuah Khan
/lkml/37a29c383bff2fb1605241ee6c7c9be3784fb3c6.1613171185.git.sk...@linuxfoundation.org/ Link: https://lore.kernel.org/linux-wireless/871rdmu9z9@codeaurora.org/ Signed-off-by: Shuah Khan --- include/linux/lockdep.h | 11 +-- kernel/locking/lockdep.c | 3 ++- 2 files changed, 11 inser

[PATCH v2 1/3] lockdep: add lockdep_assert_not_held()

2021-02-26 Thread Shuah Khan
lockdep_assert_not_held(). Link: https://lore.kernel.org/lkml/37a29c383bff2fb1605241ee6c7c9be3784fb3c6.1613171185.git.sk...@linuxfoundation.org/ Link: https://lore.kernel.org/linux-wireless/871rdmu9z9@codeaurora.org/ Signed-off-by: Shuah Khan --- include/linux/lockdep.h | 11 --- kernel

[PATCH v2 0/3] Add lockdep_assert_not_held()

2021-02-26 Thread Shuah Khan
from yesterday. Shuah Khan (3): lockdep: add lockdep_assert_not_held() lockdep: add lockdep lock state defines ath10k: detect conf_mutex held ath10k_drain_tx() calls drivers/net/wireless/ath/ath10k/mac.c | 2 ++ include/linux/lockdep.h | 18 +++--- kernel/loc

Re: [PATCH 1/2] lockdep: add lockdep_assert_not_held()

2021-02-22 Thread Shuah Khan
Thank you both. Picking this back up. Will send v2 incorporating your comments and suggestions. thanks, -- Shuah

Re: [PATCH 00/20] Manual replacement of all strlcpy in favor of strscpy

2021-02-22 Thread Shuah Khan
thing that is in the plan to address as part of this work? thanks, -- Shuah

Re: [PATCH] Revert "ath9k: fix ath_tx_process_buffer() potential null ptr dereference"

2021-02-18 Thread Shuah Khan
On 2/17/21 11:23 PM, Kalle Valo wrote: Shuah Khan wrote: This reverts commit a56c14bb21b296fb6d395164ab62ef2e419e5069. ath_tx_process_buffer() doesn't dereference or check sta and passes it to ath_tx_complete_aggr() and ath_tx_complete_buf(). ath_tx_complete_aggr() checks the pointer b

[PATCH] Revert "ath9k: fix ath_tx_process_buffer() potential null ptr dereference"

2021-02-17 Thread Shuah Khan
g buffer completion if the pointer (sta) is NULL. Signed-off-by: Shuah Khan --- drivers/net/wireless/ath/ath9k/xmit.c | 28 --- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k

Re: [PATCH 2/2] ath9k: fix ath_tx_process_buffer() potential null ptr dereference

2021-02-17 Thread Shuah Khan
On 2/17/21 7:56 AM, Shuah Khan wrote: On 2/17/21 12:30 AM, Kalle Valo wrote: Shuah Khan writes: On 2/16/21 12:53 AM, Felix Fietkau wrote: On 2021-02-16 08:03, Kalle Valo wrote: Shuah Khan wrote: ath_tx_process_buffer() references ieee80211_find_sta_by_ifaddr() return pointer (sta

Re: [PATCH 2/2] ath9k: fix ath_tx_process_buffer() potential null ptr dereference

2021-02-17 Thread Shuah Khan
On 2/17/21 12:30 AM, Kalle Valo wrote: Shuah Khan writes: On 2/16/21 12:53 AM, Felix Fietkau wrote: On 2021-02-16 08:03, Kalle Valo wrote: Shuah Khan wrote: ath_tx_process_buffer() references ieee80211_find_sta_by_ifaddr() return pointer (sta) outside null check. Fix it by moving the

Re: [PATCH 2/2] ath9k: fix ath_tx_process_buffer() potential null ptr dereference

2021-02-16 Thread Shuah Khan
On 2/16/21 12:53 AM, Felix Fietkau wrote: On 2021-02-16 08:03, Kalle Valo wrote: Shuah Khan wrote: ath_tx_process_buffer() references ieee80211_find_sta_by_ifaddr() return pointer (sta) outside null check. Fix it by moving the code block under the null check. This problem was found while

[PATCH 2/2] ath10k: detect conf_mutex held ath10k_drain_tx() calls

2021-02-12 Thread Shuah Khan
://lore.kernel.org/linux-wireless/871rdmu9z9@codeaurora.org/ Signed-off-by: Shuah Khan --- drivers/net/wireless/ath/ath10k/mac.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index c202b167d8c6..7de05b679ad2 100644 --- a

[PATCH 0/2] Add lockdep_assert_not_held()

2021-02-12 Thread Shuah Khan
the second patch in ath10k_drain_tx() function. Shuah Khan (2): lockdep: add lockdep_assert_not_held() ath10k: detect conf_mutex held ath10k_drain_tx() calls drivers/net/wireless/ath/ath10k/mac.c | 2 ++ include/linux/lockdep.h | 7 ++- 2 files changed, 8 insertions(+), 1

[PATCH 1/2] lockdep: add lockdep_assert_not_held()

2021-02-12 Thread Shuah Khan
lockdep_assert_not_held() came up in a discussion on ath10k patch. ath10k_drain_tx() and i915_vma_pin_ww() are examples of functions that can use lockdep_assert_not_held(). Link: https://lore.kernel.org/linux-wireless/871rdmu9z9@codeaurora.org/ Signed-off-by: Shuah Khan --- include/linux/lockdep.h | 7

Re: [PATCH] mt76: hold RCU lock when calling ieee80211_find_sta_by_ifaddr()

2021-02-12 Thread Shuah Khan
On 2/11/21 10:36 PM, Felix Fietkau wrote: On 2021-02-12 03:13, Shuah Khan wrote: ieee80211_find_sta_by_ifaddr() must be called under the RCU lock and the resulting pointer is only valid under RCU lock as well. Fix mt76_check_sta() to hold RCU read lock before it calls

[PATCH 2/2] ath9k: fix ath_tx_process_buffer() potential null ptr dereference

2021-02-11 Thread Shuah Khan
of other callers of ieee80211_find_sta_by_ifaddr() that don't hold RCU read lock. Signed-off-by: Shuah Khan --- - Note: This patch is compile tested. I don't have access to hardware. drivers/net/wireless/ath/ath9k/xmit.c | 28 +++ 1 file changed, 16 inserti

[PATCH] rtw88: hold RCU lock when calling ieee80211_find_sta_by_ifaddr()

2021-02-11 Thread Shuah Khan
problem was found while reviewing code to debug RCU warn from ath10k_wmi_tlv_parse_peer_stats_info() and a subsequent manual audit of other callers of ieee80211_find_sta_by_ifaddr() that don't hold RCU read lock. Signed-off-by: Shuah Khan --- - Note: This patch is compile tested. I don&#

[PATCH 1/2] ath9k: hold RCU lock when calling ieee80211_find_sta_by_ifaddr()

2021-02-11 Thread Shuah Khan
problem was found while reviewing code to debug RCU warn from ath10k_wmi_tlv_parse_peer_stats_info() and a subsequent manual audit of other callers of ieee80211_find_sta_by_ifaddr() that don't hold RCU read lock. Signed-off-by: Shuah Khan --- - Note: This patch is compile tested. I don't h

[PATCH] mt76: hold RCU lock when calling ieee80211_find_sta_by_ifaddr()

2021-02-11 Thread Shuah Khan
was found while reviewing code to debug RCU warn from ath10k_wmi_tlv_parse_peer_stats_info() and a subsequent manual audit of other callers of ieee80211_find_sta_by_ifaddr() that don't hold RCU read lock. Signed-off-by: Shuah Khan --- - Note: This patch is compile tested. I don't have

Re: [PATCH 4/5] ath10k: detect conf_mutex held ath10k_drain_tx() calls

2021-02-11 Thread Shuah Khan
On 2/11/21 4:20 AM, Kalle Valo wrote: Shuah Khan writes: On 2/10/21 1:25 AM, Kalle Valo wrote: Shuah Khan writes: ath10k_drain_tx() must not be called with conf_mutex held as workers can use that also. Add check to detect conf_mutex held calls. Signed-off-by: Shuah Khan The commit log

[PATCH v2] ath10k: hold RCU lock when calling ieee80211_find_sta_by_ifaddr()

2021-02-10 Thread Shuah Khan
needed. This problem was found while reviewing code to debug RCU warn from ath10k_wmi_tlv_parse_peer_stats_info(). Link: https://lore.kernel.org/linux-wireless/7230c9e5-2632-b77e-c4f9-10eca557a...@linuxfoundation.org/ Signed-off-by: Shuah Khan --- Changes since v1: - v1 also included fix to

Re: [PATCH 2/5] ath10k: fix WARNING: suspicious RCU usage

2021-02-10 Thread Shuah Khan
On 2/10/21 1:13 AM, Kalle Valo wrote: Shuah Khan wrote: ieee80211_find_sta_by_ifaddr() must be called under the RCU lock and the resulting pointer is only valid under RCU lock as well. Fix ath10k_wmi_tlv_parse_peer_stats_info() to hold RCU lock before it calls ieee80211_find_sta_by_ifaddr

Re: [PATCH 1/5] ath10k: fix conf_mutex lock assert in ath10k_debug_fw_stats_request()

2021-02-10 Thread Shuah Khan
On 2/10/21 1:09 AM, Kalle Valo wrote: Shuah Khan wrote: ath10k_debug_fw_stats_request() is called ath10k_sta_statistics() without holding conf_mutex. ath10k_debug_fw_stats_request() simply returns when CONFIG_ATH10K_DEBUGFS is disabled. When CONFIG_ATH10K_DEBUGFS is enabled

Re: [PATCH 5/5] ath10k: reduce invalid ht params rate message noise

2021-02-10 Thread Shuah Khan
On 2/10/21 1:28 AM, Kalle Valo wrote: Wen Gong writes: On 2021-02-10 08:42, Shuah Khan wrote: ath10k_mac_get_rate_flags_ht() floods dmesg with the following messages, when it fails to find a match for mcs=7 and rate=1440. supported_ht_mcs_rate_nss2: {7, {1300, 2700, 1444, 3000

Re: [PATCH 4/5] ath10k: detect conf_mutex held ath10k_drain_tx() calls

2021-02-10 Thread Shuah Khan
On 2/10/21 1:25 AM, Kalle Valo wrote: Shuah Khan writes: ath10k_drain_tx() must not be called with conf_mutex held as workers can use that also. Add check to detect conf_mutex held calls. Signed-off-by: Shuah Khan The commit log does not answer to "Why?". How did you find

[PATCH 5/5] ath10k: reduce invalid ht params rate message noise

2021-02-09 Thread Shuah Khan
x27;t helping the noise. Use dev_warn_once() instead. Signed-off-by: Shuah Khan --- drivers/net/wireless/ath/ath10k/mac.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 3545ce7dce0a..276321f

[PATCH 4/5] ath10k: detect conf_mutex held ath10k_drain_tx() calls

2021-02-09 Thread Shuah Khan
ath10k_drain_tx() must not be called with conf_mutex held as workers can use that also. Add check to detect conf_mutex held calls. Signed-off-by: Shuah Khan --- drivers/net/wireless/ath/ath10k/mac.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b

[PATCH 2/5] ath10k: fix WARNING: suspicious RCU usage

2021-02-09 Thread Shuah Khan
+0x22/0x30 Signed-off-by: Shuah Khan --- drivers/net/wireless/ath/ath10k/wmi-tlv.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c index 7b5834157fe5..615157dd6866 100644

[PATCH 3/5] ath10k: change ath10k_offchan_tx_work() peer present msg to a warn

2021-02-09 Thread Shuah Khan
Based on the comment block in this function and the FIXME for this, peer being present for the offchannel tx is unlikely. Peer is deleted once tx is complete. Change peer present msg to a warn to detect this condition. Signed-off-by: Shuah Khan --- drivers/net/wireless/ath/ath10k/mac.c | 5

[PATCH 1/5] ath10k: fix conf_mutex lock assert in ath10k_debug_fw_stats_request()

2021-02-09 Thread Shuah Khan
nabled at (520903): [] console_unlock+0x4e5/0x5d0 hardirqs last disabled at (520908): [] console_unlock+0x458/0x5d0 softirqs last enabled at (520722): [] asm_call_irq_on_stack+0x12/0x20 softirqs last disabled at (520717): [] asm_call_irq_on_stack+0x12/0x20 Signed-off-by: Shuah Khan --- drivers/net/wireless/ath

[PATCH 0/5] ath10k fixes for warns

2021-02-09 Thread Shuah Khan
and RCU usage bugs. The last patch (5/5) is a fix to reduce invalid ht params rate message noise. Patch 3/4 changes a message from debug to warn. Patch 4 adds detect to assert not calling ath10k_drain_tx() holding conf_mutex. Shuah Khan (5): ath10k: fix conf_mutex lock assert in

Re: rpc_xprt_debugfs_register() - atomic_inc_return() usage

2021-01-21 Thread Shuah Khan
On 1/21/21 10:56 AM, Trond Myklebust wrote: On Wed, 2021-01-20 at 16:52 -0700, Shuah Khan wrote: Hi Anna and Trond, I came across the following while reviewing atomic_inc_return() usages that cast return value to unsigned rpc_xprt_debugfs_register()'s atomic_inc_return() usage looks a bi

rpc_xprt_debugfs_register() - atomic_inc_return() usage

2021-01-20 Thread Shuah Khan
e note that id is int. Is it expected that cur_id could overflow? Is there a maximum limit for this value? thanks, -- Shuah

Re: [PATCH] selftests: Skip BPF seftests by default

2020-12-17 Thread Shuah Khan
On 12/17/20 8:53 AM, Shuah Khan wrote: On 12/17/20 6:07 AM, Mark Brown wrote: On Wed, Dec 16, 2020 at 04:05:58PM -0600, Seth Forshee wrote: On Thu, Dec 10, 2020 at 06:52:33PM +, Mark Brown wrote: as part of the wider kselftest build by specifying SKIP_TARGETS, including setting an empty

Re: [PATCH] selftests: Skip BPF seftests by default

2020-12-17 Thread Shuah Khan
7;t require building the bpf self tests in order to pass. Right, that's a separate issue - the net tests should really skip that if they don't have BPF, as we do for other runtime detectable dependencies. It's nowhere near as severe as failing to build though. Correct. This has to be handled as a run-time dependency check and skip instead of fail. thanks, -- Shuah

Re: [PATCH] selftests: Skip BPF seftests by default

2020-12-10 Thread Shuah Khan
ut of selftests directory help? It would become harder on users that want to run the test. I don't support moving bpf out of selftests directory in the interest of Linux kernel quality and validation. Let's think big picture and kernel community as a whole. thanks, -- Shuah

Re: [PATCH v12 5/5] selftest: mhi: Add support to test MHI LOOPBACK channel

2020-11-20 Thread Shuah Khan
test_log(DBG_LVL_INFO, "log level: %d\n", atoi(optarg)); + break; + default: + test_log(DBG_LVL_ERROR, "Invalid Option: %d\n", +command); + usage(); + return TEST_STATUS_ERROR; + } + } + + if (pthread_create(&run_test, NULL, loopback_test_run, NULL) != 0) { + test_log(DBG_LVL_ERROR, "Error creating run_mhi_test\n"); + } else { + pthread_join(run_test, (void **)(&return_value)); + + if (*return_value != TEST_STATUS_SUCCESS) { + test_log(DBG_LVL_ERROR, "Test Failed\n"); + } else { + test_log(DBG_LVL_INFO, "Test Passed\n"); + status = 0; + } + } + + return status; +} + +int main(int argc, char *argv[]) +{ + int ret = 0; + + loopback_test_set_defaults(); + test_log(DBG_LVL_INFO, "MHI Loopback test App\n"); + + if (argc > 1) + ret = loopback_test_parse(argc, argv); + else + usage(); + + return ret; +} Are there any cases where this test can't run and have to - those cases need to be skips. thanks, -- Shuah

Re: [PATCH] selftests:mptcp: fix empty optstring

2020-05-22 Thread shuah
e! Please review and let me know if you want me to take this through kselftest tree. thanks, -- Shuah

Re: Linux 5.4 - bpf test build fails

2019-09-24 Thread Shuah Khan
On 9/24/19 1:19 PM, Daniel Borkmann wrote: On Tue, Sep 24, 2019 at 12:56:53PM -0600, Shuah Khan wrote: On 9/24/19 12:49 PM, Daniel Borkmann wrote: On Tue, Sep 24, 2019 at 09:48:35AM -0600, Shuah Khan wrote: On 9/24/19 9:43 AM, Yonghong Song wrote: On 9/24/19 8:26 AM, Shuah Khan wrote: Hi

Re: Linux 5.4 - bpf test build fails

2019-09-24 Thread Shuah Khan
On 9/24/19 12:49 PM, Daniel Borkmann wrote: On Tue, Sep 24, 2019 at 09:48:35AM -0600, Shuah Khan wrote: On 9/24/19 9:43 AM, Yonghong Song wrote: On 9/24/19 8:26 AM, Shuah Khan wrote: Hi Alexei and Daniel, bpf test doesn't build on Linux 5.4 mainline. Do you know what's happening h

Re: Linux 5.4 - bpf test build fails

2019-09-24 Thread Shuah Khan
On 9/24/19 12:07 PM, tim.b...@sony.com wrote: -Original Message- From: Cristian Marussi on Tuesday, September 24, 2019 7:30 AM Hi Shuah On 24/09/2019 17:39, Shuah Khan wrote: On 9/24/19 10:03 AM, Shuah Khan wrote: On 9/24/19 9:52 AM, Cristian Marussi wrote: Hi Shuah On 24/09

Re: Linux 5.4 - bpf test build fails

2019-09-24 Thread Shuah Khan
On 9/24/19 10:03 AM, Shuah Khan wrote: On 9/24/19 9:52 AM, Cristian Marussi wrote: Hi Shuah On 24/09/2019 16:26, Shuah Khan wrote: Hi Alexei and Daniel, bpf test doesn't build on Linux 5.4 mainline. Do you know what's happening here. make -C tools/testing/selftests/bpf/ sid

Re: Linux 5.4 - bpf test build fails

2019-09-24 Thread Shuah Khan
On 9/24/19 9:52 AM, Cristian Marussi wrote: Hi Shuah On 24/09/2019 16:26, Shuah Khan wrote: Hi Alexei and Daniel, bpf test doesn't build on Linux 5.4 mainline. Do you know what's happening here. make -C tools/testing/selftests/bpf/ side question, since I'm writing arm64/ te

Re: Linux 5.4 - bpf test build fails

2019-09-24 Thread Shuah Khan
On 9/24/19 9:43 AM, Yonghong Song wrote: On 9/24/19 8:26 AM, Shuah Khan wrote: Hi Alexei and Daniel, bpf test doesn't build on Linux 5.4 mainline. Do you know what's happening here. make -C tools/testing/selftests/bpf/ -c progs/test_core_reloc_ptr_as_arr.c -o - || echo &qu

Linux 5.4 - bpf test build fails

2019-09-24 Thread Shuah Khan
^~~~ 1 warning and 1 error generated. llc: error: llc: :1:1: error: expected top-level entity clang failed Also make TARGETS=bpf kselftest fails as well. Dependency between tools/lib/bpf and the test. How can we avoid this type of dependency or resolve it in a way it doesn't result in build failures? thanks, -- Shuah

Re: [PATCH] selftests: fix bpf build/test workflow regression when KBUILD_OUTPUT is set

2019-05-16 Thread Shuah Khan
On 5/16/19 12:36 PM, Alexei Starovoitov wrote: On Fri, May 10, 2019 at 9:37 PM Alexei Starovoitov wrote: On Fri, May 10, 2019 at 08:52:49PM -0600, Shuah Khan wrote: commit 8ce72dc32578 ("selftests: fix headers_install circular dependency") broke bpf build/test workflow. When KBUILD

Re: [GIT PULL] Kselftest update for Linux 5.2-rc1

2019-05-10 Thread Shuah Khan
On 5/9/19 8:17 PM, Alexei Starovoitov wrote: On Thu, May 09, 2019 at 07:42:09PM -0600, Shuah Khan wrote: On 5/9/19 4:40 PM, Shuah Khan wrote: On 5/9/19 4:20 PM, Alexei Starovoitov wrote: On Mon, May 06, 2019 at 10:56:56AM -0600, Shuah Khan wrote: Hi Linus, Please pull the following

[PATCH] selftests: fix bpf build/test workflow regression when KBUILD_OUTPUT is set

2019-05-10 Thread Shuah Khan
t_verifier: cd tools/testing/selftests/bpf; make; ./test_verifier; Fix it to set OUTPUT only when it is undefined in lib.mk. It didn't need to be set in the first place. Fixes: commit 8ce72dc32578 ("selftests: fix headers_install circular dependency") Reported-by: Alexei Starovoi

Re: [PATCH net] selftests: fix timestamping Makefile

2019-02-13 Thread shuah
$(TEST_GEN_FILES) Thanks for the patch. Acked-by: Shuah Khan thanks, -- Shuah

Re: [PATCH] tty: Fix WARNING in tty_set_termios

2019-01-31 Thread shuah
etups at least), and maybe we need not prevent that. Thanks for the feedback on the patch. Changes to prevent setting the HCI line discipline from hci_uart fixes the problem. I am sending v2 in a just a bit. thanks, -- Shuah

Re: [PATCH] tty: Fix WARNING in tty_set_termios

2019-01-30 Thread shuah
On 1/30/19 3:32 AM, Johan Hovold wrote: On Mon, Jan 28, 2019 at 02:29:22PM -0700, shuah wrote: On 1/25/19 9:14 PM, Al Viro wrote: On Fri, Jan 25, 2019 at 04:29:05PM -0700, Shuah Khan wrote: tty_set_termios() has the following WARMN_ON which can be triggered with a syscall to invoke TIOCGETD

Re: [PATCH] tty: Fix WARNING in tty_set_termios

2019-01-28 Thread shuah
On 1/25/19 9:14 PM, Al Viro wrote: On Fri, Jan 25, 2019 at 04:29:05PM -0700, Shuah Khan wrote: tty_set_termios() has the following WARMN_ON which can be triggered with a syscall to invoke TIOCGETD __NR_ioctl. WARN_ON(tty->driver->type == TTY_DRIVER_TYPE_PTY &&

[PATCH] tty: Fix WARNING in tty_set_termios

2019-01-25 Thread Shuah Khan
ix the WARN_ON. This fix changes tty_set_termios() to return error and all the callers to check error and bail out. The reproducer is used to reproduce the problem and verify the fix. Reported-by: syzbot+a950165cbb86bdd02...@syzkaller.appspotmail.com Signed-off-by: Shuah Khan --- drivers/bluetoo

Re: selftests/bpf doesn't compile

2019-01-04 Thread shuah
Hi Geert, On 1/4/19 10:16 AM, Geert Uytterhoeven wrote: Hi Shuah, CC kbuild, gpio On Thu, Sep 14, 2017 at 5:34 PM Shuah Khan wrote: bpf test depends on clang and fails to compile when -- make -C tools/testing/selftests/bpf run_tests

Re: selftests/net: udpgso: LTS kernels supportability ?

2018-12-18 Thread shuah
On 12/18/18 4:37 AM, Rafael David Tinoco wrote: On 12/17/18 4:42 PM, shuah wrote: Hi Rafael, On 12/17/18 10:53 AM, Rafael David Tinoco wrote: Shuah, I was recently investigating some errors coming out of our functional tests and we, Dan and I, came up with a discussion that might not be new

Re: selftests/net: udpgso: LTS kernels supportability ?

2018-12-17 Thread shuah
Hi Rafael, On 12/17/18 10:53 AM, Rafael David Tinoco wrote: Shuah, I was recently investigating some errors coming out of our functional tests and we, Dan and I, came up with a discussion that might not be new for you, but, interests us, in defining how to better use kselftests as a regression

Re: selftests/bpf: test_kmod.sh hangs on all devices

2018-10-08 Thread Shuah Khan
sure you have that >> commit included >> in your testing: > > I will re-validate on latest code base and let you know. > >> >> https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=100811936f89fd455eda1984810c09003550555b > > Thanks for the quick reply. > Great. Looks like this has been sorted. Thanks Daniel. thanks, -- Shuah

Re: [PATCH v4] selftests: add headers_install to lib.mk

2018-07-24 Thread Shuah Khan
tever value it gets normally, and >> +# SUBARCH is subsequently ignored. >> + >> +SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \ >> + -e s/sun4u/sparc64/ \ >> + -e s/arm.*/arm/ -e s/sa110/arm/ \ >> + -e s/s390x/s390/ -e s/parisc64/parisc/ \ >> + -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \ >> + -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ \ >> + -e s/riscv.*/riscv/) thanks, -- Shuah

Re: [PATCH bpf-next 0/5] fix test_sockmap

2018-05-18 Thread Shuah Khan
ike to see all the test patches cc'ed to it. Linaro and other test users watch the kselftest mailing list. I also have patchwork project now to manage the patch volume. I am okay with patches going through net/bpf trees - there are always test dependencies on net/bpf trees. thanks, -- Shuah

[PATCH 24/24] selftests: net: return Kselftest Skip code for skipped tests

2018-05-04 Thread Shuah Khan (Samsung OSG)
message, instead of failing the test when /sys/power/state file open fails. Signed-off-by: Shuah Khan (Samsung OSG) --- tools/testing/selftests/net/fib_tests.sh| 8 +--- tools/testing/selftests/net/netdevice.sh| 16 +-- tools/testing/selftests/net/pmtu.sh | 5

Re: [PATCH] selftest: net: reuseport_bpf_numa: don't fail if no numa support

2018-03-07 Thread Shuah Khan
infrastructure on the other hand maintains skip count and for tests skipped, also prints a distinct message for it. Originally skip was treated by the framework as distinct state implying that the test can't be run which makes more sense. Based on the request as stated above, I made a change to map KSFT_SKIP to KSFT_PASS. Several tests use the infrastructure. That said, I am open to adding a distinct state for skipped because can't be run. thanks, -- Shuah

Re: [PATCH] selftests/bpf: update gitignore with test_libbpf_open

2018-02-21 Thread Shuah Khan
On 02/21/2018 05:33 PM, Daniel Borkmann wrote: > Hi Shuah, > > On 02/22/2018 12:03 AM, Shuah Khan wrote: >> On 02/21/2018 03:48 PM, David Miller wrote: >>> From: Anders Roxell >>> Date: Wed, 21 Feb 2018 22:30:01 +0100 >>> >>>> bpf bu

Re: [PATCH] selftests/bpf: update gitignore with test_libbpf_open

2018-02-21 Thread Shuah Khan
d-by: David S. Miller > > Thanks. I will pull this in for 4.16-rc -- Shuah

[PATCH] selftests: bpf: update .gitignore with missing generated files

2018-01-18 Thread Shuah Khan
Update .gitignore with missing generated files. Signed-off-by: Shuah Khan --- tools/testing/selftests/bpf/.gitignore | 7 +++ 1 file changed, 7 insertions(+) diff --git a/tools/testing/selftests/bpf/.gitignore b/tools/testing/selftests/bpf/.gitignore index 541d9d7fad5a..1e09d77f1948

Re: [PATCH v3 2/2] selftests: bpf: test_kmod.sh: use modprobe on target device

2017-11-07 Thread Shuah Khan
Patch v3 1/2 and this one. Please collapse these two patches into one or fix the SRC_TREE problem first and then fix the missing module case. I would like to get an Ack from net-dev folks before getting these in. Alexei and Daniel! Please review and let me know if you good with this change. thanks, -- Shuah

Re: [PATCH v3 1/2] selftests: bpf: test_kmod.sh: check the module path before insmod

2017-11-07 Thread Shuah Khan
ko 2> /dev/null Hmm. Are you sure SRC_TREE is defined in all use-cases? What happens when "cd tools/testing/selftests/bpf; make run_tests" is run? > + if [ $? -ne 0 ]; then > + rc=1 > + fi > fi > rmmod test_bpf 2> /dev/null > dmesg | grep FAIL > thanks, -- Shuah

Re: [PATCH v2 1/2] selftests: bpf: test_kmod.sh: check if module is present in the path before insert

2017-11-06 Thread Shuah Khan
ase there was one. ;) > > No change for 1/2 to v2 1/2. The only change was to v2 2/2. > >> >> Which tree are you targeting? There are usually a lot of changes >> in BPF selftests going the usual route via net and net-next tree >> as we often require to put test cases

Re: [PATCH 3/3][v2] selftests: silence test output by default

2017-09-19 Thread Shuah Khan
r to track what > failed. > > Signed-off-by: Josef Bacik > --- > v1->v2: > - dump output into /tmp/testname instead of /dev/null > Thanks for the fix. Applied to linux-kselftest for 4.14-rc2 -- Shuah

Re: [PATCH 2/3][v2] selftests: actually run the various net selftests

2017-09-19 Thread Shuah Khan
ES. > > Signed-off-by: Josef Bacik > --- > v1->v2: > - Moved msg_zerocopy to TEST_GEN_FILES since it's not runnable in it's current > state > I usually don't sent new tests however, since it is a test for a regression, applied to linux-kselftest fixes for 4.14-rc2 thanks, -- Shuah

Re: [PATCH 1/3][v2] selftest: add a reuseaddr test

2017-09-19 Thread Shuah Khan
> Signed-off-by: Josef Bacik I usually don't sent new tests however, since it is a test for a regression, applied to linux-kselftest fixes for 4.14-rc2 thanks, -- Shuah

Re: [PATCH 2/3] selftests: actually run the various net selftests

2017-09-19 Thread Shuah Khan
On 09/19/2017 12:14 PM, Willem de Bruijn wrote: > On Tue, Sep 19, 2017 at 9:34 AM, Josef Bacik wrote: >> On Mon, Sep 18, 2017 at 04:14:41PM -0600, Shuah Khan wrote: >>> On 09/18/2017 11:32 AM, jo...@toxicpanda.com wrote: >>>> From: Josef Bacik >>>> >

Re: [PATCH 2/3] selftests: actually run the various net selftests

2017-09-18 Thread Shuah Khan
t_dualstack msg_zerocopy reuseaddr_conflict Hmm. I see msg_zerocopy.sh for running msg_zerocopy. msg_zerocopy should still stay in TEST_GEN_FILES and msg_zerocopy.sh needs to be added to TEST_PROGS so it runs. thanks, -- Shuah

Re: [PATCH 3/3] selftests: silence test output by default

2017-09-18 Thread Shuah Khan
On 09/18/2017 02:19 PM, Josef Bacik wrote: > On Mon, Sep 18, 2017 at 01:48:31PM -0600, Shuah Khan wrote: >> On 09/18/2017 12:24 PM, Josef Bacik wrote: >>> On Mon, Sep 18, 2017 at 12:13:40PM -0600, Shuah Khan wrote: >>>> On 09/18/2017 11:52 AM, Josef Bacik wrote: >&

Re: [PATCH 3/3] selftests: silence test output by default

2017-09-18 Thread Shuah Khan
On 09/18/2017 12:24 PM, Josef Bacik wrote: > On Mon, Sep 18, 2017 at 12:13:40PM -0600, Shuah Khan wrote: >> On 09/18/2017 11:52 AM, Josef Bacik wrote: >>> On Mon, Sep 18, 2017 at 11:46:18AM -0600, Shuah Khan wrote: >>>> On 09/18/2017 11:37 AM, jo...@toxicpanda.com

Re: [PATCH 3/3] selftests: silence test output by default

2017-09-18 Thread Shuah Khan
On 09/18/2017 11:52 AM, Josef Bacik wrote: > On Mon, Sep 18, 2017 at 11:46:18AM -0600, Shuah Khan wrote: >> On 09/18/2017 11:37 AM, jo...@toxicpanda.com wrote: >>> From: Josef Bacik >>> >>> Some of the networking tests are very noisy and make it impossible

Re: [PATCH 3/3] selftests: silence test output by default

2017-09-18 Thread Shuah Khan
amp;& echo \"selftests: $$BASENAME_TEST > [PASS]\") || echo \"selftests: $$BASENAME_TEST [FAIL]\""; \ > + echo "(./$$BASENAME_TEST > /dev/null 2>&1 && echo \"selftests: > $$BASENAME_TEST [PASS]\") || echo \"selftests: $$BASENAME_TEST [FAIL]\""; \ > done; > endef > > thanks, -- Shuah

Re: selftests/bpf doesn't compile

2017-09-15 Thread Shuah Khan
t;>>>> On Thu, Sep 14, 2017 at 09:33:48AM -0600, Shuah Khan wrote: >>>>>> Is bpf test intended to be run in kselftest run? The clang dependency >>>>>> might >>>>>> not be met on majority of the systems. Is this a hard dependency??

Re: selftests/bpf doesn't compile

2017-09-15 Thread Shuah Khan
On 09/15/2017 12:14 PM, Alexei Starovoitov wrote: > On Fri, Sep 15, 2017 at 11:00:31AM -0600, Shuah Khan wrote: >>>> I could add a special target for bpf TARGET_BPF perhaps and exclude it from >>>> the run_test> >>> I'm not sure what was the motivation

Re: selftests/bpf doesn't compile

2017-09-15 Thread Shuah Khan
On 09/15/2017 11:00 AM, Shuah Khan wrote: > On 09/15/2017 10:02 AM, Alexei Starovoitov wrote: >> On Thu, Sep 14, 2017 at 09:33:48AM -0600, Shuah Khan wrote: >>> Hi Alexei and Daniel, >>> >>> bpf test depend

Re: selftests/bpf doesn't compile

2017-09-15 Thread Shuah Khan
On 09/15/2017 10:02 AM, Alexei Starovoitov wrote: > On Thu, Sep 14, 2017 at 09:33:48AM -0600, Shuah Khan wrote: >> Hi Alexei and Daniel, >> >> bpf test depends on clang and fails to compile when >> >> -- >&

selftests/bpf doesn't compile

2017-09-14 Thread Shuah Khan
G += memory-hotplug I could add a special target for bpf TARGET_BPF perhaps and exclude it from the run_tests. Please let me know your thoughts on this. thanks, -- Shuah

Re: [PATCH][net-next][V3] bpf: test_maps: fix typos, "conenct" and "listeen"

2017-08-30 Thread Shuah Khan
listen" >> >> thanks to Daniel Borkmann for spotting one of these mistakes >> >> Signed-off-by: Colin Ian King > > Acked-by: Daniel Borkmann > > I can get this into 4.14-rc1 unless it should go through net-next for dependencies. In which case, Acked-by: Shuah Khan thanks, -- Shuah

Re: [PATCH net-next v7 01/10] selftest: Enhance kselftest_harness.h with a step mechanism

2017-08-28 Thread Shuah Khan
step mechanism may be useful to return an information about the >>>> error without being able to write to TH_LOG_STREAM. >>>> >>>> Set _metadata->no_print to true to print this counter. >>>> >>>> Signed-off-by: Mickaël Salaün >>&g

Re: [PATCH v2 net] selftests/bpf: fix broken build, take 2

2017-03-20 Thread Shuah Khan
both: >>> selftests/bpf$ make >>> and >>> selftests$ make TARGETS=bpf >>> on Ubuntu 16.04.2. >>> >>> Signed-off-by: Zi Shen Lim >> >> Looks reasonable to me as follow up to 1da8ac7c49fb ("selftests/bpf: >> fix broken build"), thanks for fixing Zi! >> >> Acked-by: Daniel Borkmann >> Tested-by: Daniel Borkmann > > worked for me as well: > Acked-by: Alexei Starovoitov > Tested-by: Alexei Starovoitov > > > David, Could you please apply it to your tree. I think you already applied the first fix. Acked-by: Shuah Khan thanks, -- Shuah

Re: linux-next: manual merge of the kselftest tree with the net-next tree

2017-02-22 Thread Shuah Khan
On 02/15/2017 08:24 PM, Stephen Rothwell wrote: > Hi Shuah, > > Today's linux-next merge of the kselftest tree got a conflict in: > > tools/testing/selftests/bpf/Makefile > > between commit: > > d498f8719a09 ("bpf: Rebuild bpf.o for any dependency upd

Re: linux-next: manual merge of the kselftest tree with the net-next tree

2017-01-24 Thread Shuah Khan
On 01/23/2017 09:45 PM, Stephen Rothwell wrote: > Hi Shuah, > > Today's linux-next merge of the kselftest tree got a conflict in: > > tools/testing/selftests/bpf/Makefile > > between commit: > > 4d3381f5a322 ("bpf: Add tests for the lpm trie map&quo

Re: [PATCH v3 net-next 1/2] tools: psock_lib: tighten conditions checked in sock_setfilter

2017-01-05 Thread Shuah Khan
On 01/05/2017 08:54 AM, Sowmini Varadhan wrote: > On (01/04/17 16:26), Shuah Khan wrote: >> >> Could you please split this patch into two. Hardening part in one and >> the cleanup in a separate patch. This way I can get the hardening fix >> into 4.10 in my next Kselftes

Re: [PATCH v3 net-next 1/2] tools: psock_lib: tighten conditions checked in sock_setfilter

2017-01-04 Thread Shuah Khan
On 01/04/2017 03:55 PM, Sowmini Varadhan wrote: > On (01/04/17 15:37), Shuah Khan wrote: >>> + /* the filter below checks for all of the following conditions that >>> +* are based on the contents of create_payload() >>> +* ether type 0x800 and &g

Re: [PATCH v3 net-next 1/2] tools: psock_lib: tighten conditions checked in sock_setfilter

2017-01-04 Thread Shuah Khan
explicitly use the BPF macros to make it more readable. > > Signed-off-by: Sowmini Varadhan > Acked-by: Willem de Bruijn > --- > v2: commit comment edited based on Willem de Bruijn review > v3: Shuah Khan nit. > > tools/testing/selftests/net/psock_lib.h | 29 +

Re: [PATCH v2 net-next 1/2] tools: psock_lib: tighten conditions checked in sock_setfilter

2017-01-04 Thread Shuah Khan
BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, ip_len, 0, 4), > + BPF_STMT(BPF_LD|BPF_B|BPF_ABS, 80), /* LD udp[38] */ > + BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, DATA_CHAR, 1, 0), > + BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, DATA_CHAR_1, 0, 1), > + BPF_STMT(BPF_RET | BPF_K, ~0), /* match */ > + BPF_STMT(BPF_RET | BPF_K, 0)/* no match */ > }; > struct sock_fprog bpf_prog; > > thanks, -- Shuah

Re: [PATCH 2/3] selftests: do not require bash to run bpf tests

2016-12-14 Thread Shuah Khan
do not require bash to run bpf tests >> >> Nothing in this minimal script seems to require bash. We often run these >> tests >> on embedded devices where the only shell available is the busybox ash. >> >> Signed-off-by: Rolf Eike Beer > > Acked-by: Daniel Borkmann Thanks. I will get these into 4.10-rc1 or rc2 -- Shuah

  1   2   >