netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 6.8 194/399] net: hns3: tracing: fix hclgevf trace event strings
       [not found] <20240401152549.131030308@linuxfoundation.org>
@ 2024-04-01 15:42 ` Greg Kroah-Hartman
  2024-04-01 19:40 ` [PATCH 6.8 000/399] 6.8.3-rc1 review Naresh Kamboju
  1 sibling, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2024-04-01 15:42 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, netdev, Yisen Zhuang, Salil Mehta,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Yufeng Mo,
	Huazhong Tan, Paolo Abeni, Jijie Shao, Steven Rostedt (Google),
	Sasha Levin

6.8-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Steven Rostedt (Google) <rostedt@goodmis.org>

[ Upstream commit 3f9952e8d80cca2da3b47ecd5ad9ec16cfd1a649 ]

The __string() and __assign_str() helper macros of the TRACE_EVENT() macro
are going through some optimizations where only the source string of
__string() will be used and the __assign_str() source will be ignored and
later removed.

To make sure that there's no issues, a new check is added between the
__string() src argument and the __assign_str() src argument that does a
strcmp() to make sure they are the same string.

The hclgevf trace events have:

  __assign_str(devname, &hdev->nic.kinfo.netdev->name);

Which triggers the warning:

hclgevf_trace.h:34:39: error: passing argument 1 of ‘strcmp’ from incompatible pointer type [-Werror=incompatible-pointer-types]
   34 |                 __assign_str(devname, &hdev->nic.kinfo.netdev->name);
 [..]
arch/x86/include/asm/string_64.h:75:24: note: expected ‘const char *’ but argument is of type ‘char (*)[16]’
   75 | int strcmp(const char *cs, const char *ct);
      |            ~~~~~~~~~~~~^~

Because __assign_str() now has:

	WARN_ON_ONCE(__builtin_constant_p(src) ?		\
		     strcmp((src), __data_offsets.dst##_ptr_) :	\
		     (src) != __data_offsets.dst##_ptr_);	\

The problem is the '&' on hdev->nic.kinfo.netdev->name. That's because
that name is:

	char			name[IFNAMSIZ]

Where passing an address '&' of a char array is not compatible with strcmp().

The '&' is not necessary, remove it.

Link: https://lore.kernel.org/linux-trace-kernel/20240313093454.3909afe7@gandalf.local.home

Cc: netdev <netdev@vger.kernel.org>
Cc: Yisen Zhuang <yisen.zhuang@huawei.com>
Cc: Salil Mehta <salil.mehta@huawei.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Yufeng Mo <moyufeng@huawei.com>
Cc: Huazhong Tan <tanhuazhong@huawei.com>
Cc: stable@vger.kernel.org
Acked-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Jijie Shao <shaojijie@huawei.com>
Fixes: d8355240cf8fb ("net: hns3: add trace event support for PF/VF mailbox")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_trace.h  | 8 ++++----
 .../net/ethernet/hisilicon/hns3/hns3vf/hclgevf_trace.h    | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_trace.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_trace.h
index 8510b88d49820..f3cd5a376eca9 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_trace.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_trace.h
@@ -24,7 +24,7 @@ TRACE_EVENT(hclge_pf_mbx_get,
 		__field(u8, code)
 		__field(u8, subcode)
 		__string(pciname, pci_name(hdev->pdev))
-		__string(devname, &hdev->vport[0].nic.kinfo.netdev->name)
+		__string(devname, hdev->vport[0].nic.kinfo.netdev->name)
 		__array(u32, mbx_data, PF_GET_MBX_LEN)
 	),
 
@@ -33,7 +33,7 @@ TRACE_EVENT(hclge_pf_mbx_get,
 		__entry->code = req->msg.code;
 		__entry->subcode = req->msg.subcode;
 		__assign_str(pciname, pci_name(hdev->pdev));
-		__assign_str(devname, &hdev->vport[0].nic.kinfo.netdev->name);
+		__assign_str(devname, hdev->vport[0].nic.kinfo.netdev->name);
 		memcpy(__entry->mbx_data, req,
 		       sizeof(struct hclge_mbx_vf_to_pf_cmd));
 	),
@@ -56,7 +56,7 @@ TRACE_EVENT(hclge_pf_mbx_send,
 		__field(u8, vfid)
 		__field(u16, code)
 		__string(pciname, pci_name(hdev->pdev))
-		__string(devname, &hdev->vport[0].nic.kinfo.netdev->name)
+		__string(devname, hdev->vport[0].nic.kinfo.netdev->name)
 		__array(u32, mbx_data, PF_SEND_MBX_LEN)
 	),
 
@@ -64,7 +64,7 @@ TRACE_EVENT(hclge_pf_mbx_send,
 		__entry->vfid = req->dest_vfid;
 		__entry->code = le16_to_cpu(req->msg.code);
 		__assign_str(pciname, pci_name(hdev->pdev));
-		__assign_str(devname, &hdev->vport[0].nic.kinfo.netdev->name);
+		__assign_str(devname, hdev->vport[0].nic.kinfo.netdev->name);
 		memcpy(__entry->mbx_data, req,
 		       sizeof(struct hclge_mbx_pf_to_vf_cmd));
 	),
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_trace.h b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_trace.h
index 5d4895bb57a17..b259e95dd53c2 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_trace.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_trace.h
@@ -23,7 +23,7 @@ TRACE_EVENT(hclge_vf_mbx_get,
 		__field(u8, vfid)
 		__field(u16, code)
 		__string(pciname, pci_name(hdev->pdev))
-		__string(devname, &hdev->nic.kinfo.netdev->name)
+		__string(devname, hdev->nic.kinfo.netdev->name)
 		__array(u32, mbx_data, VF_GET_MBX_LEN)
 	),
 
@@ -31,7 +31,7 @@ TRACE_EVENT(hclge_vf_mbx_get,
 		__entry->vfid = req->dest_vfid;
 		__entry->code = le16_to_cpu(req->msg.code);
 		__assign_str(pciname, pci_name(hdev->pdev));
-		__assign_str(devname, &hdev->nic.kinfo.netdev->name);
+		__assign_str(devname, hdev->nic.kinfo.netdev->name);
 		memcpy(__entry->mbx_data, req,
 		       sizeof(struct hclge_mbx_pf_to_vf_cmd));
 	),
@@ -55,7 +55,7 @@ TRACE_EVENT(hclge_vf_mbx_send,
 		__field(u8, code)
 		__field(u8, subcode)
 		__string(pciname, pci_name(hdev->pdev))
-		__string(devname, &hdev->nic.kinfo.netdev->name)
+		__string(devname, hdev->nic.kinfo.netdev->name)
 		__array(u32, mbx_data, VF_SEND_MBX_LEN)
 	),
 
@@ -64,7 +64,7 @@ TRACE_EVENT(hclge_vf_mbx_send,
 		__entry->code = req->msg.code;
 		__entry->subcode = req->msg.subcode;
 		__assign_str(pciname, pci_name(hdev->pdev));
-		__assign_str(devname, &hdev->nic.kinfo.netdev->name);
+		__assign_str(devname, hdev->nic.kinfo.netdev->name);
 		memcpy(__entry->mbx_data, req,
 		       sizeof(struct hclge_mbx_vf_to_pf_cmd));
 	),
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 6.8 000/399] 6.8.3-rc1 review
       [not found] <20240401152549.131030308@linuxfoundation.org>
  2024-04-01 15:42 ` [PATCH 6.8 194/399] net: hns3: tracing: fix hclgevf trace event strings Greg Kroah-Hartman
@ 2024-04-01 19:40 ` Naresh Kamboju
  2024-04-02  3:51   ` Jakub Kicinski
  1 sibling, 1 reply; 4+ messages in thread
From: Naresh Kamboju @ 2024-04-01 19:40 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: stable, patches, linux-kernel, torvalds, akpm, linux, shuah,
	patches, lkft-triage, pavel, jonathanh, f.fainelli,
	sudipm.mukherjee, srw, rwarsow, conor, allen.lkml, broonie,
	Netdev, Jakub Kicinski, David S. Miller, Arnd Bergmann,
	Eric Dumazet

On Mon, 1 Apr 2024 at 21:20, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> This is the start of the stable review cycle for the 6.8.3 release.
> There are 399 patches in this series, all will be posted as a response
> to this one.  If anyone has any issues with these being applied, please
> let me know.
>
> Responses should be made by Wed, 03 Apr 2024 15:24:46 +0000.
> Anything received after that time might be too late.
>
> The whole patch series can be found in one patch at:
>         https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.8.3-rc1.gz
> or in the git tree and branch at:
>         git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.8.y
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h

The following kernel BUG: unable to handle page fault for address and followed
by Kernel panic - not syncing: Fatal exception in interrupt noticed
on the qemu-i386 running  selftests: net: pmtu.sh test case and the kernel
built with kselftest merge net configs with clang.

We are investigating this problem on qemu-i386.

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

# selftests: net: pmtu.sh
# TEST: ipv4: PMTU exceptions                                         [ OK ]
# TEST: ipv4: PMTU exceptions - nexthop objects                       [ OK ]
# TEST: ipv6: PMTU exceptions                                         [ OK ]
<trim>
# TEST: ipv4: cleanup of cached exceptions                            [ OK ]
# TEST: ipv4: cleanup of cached exceptions - nexthop objects          [ OK ]
# TEST: ipv6: cleanup of cached exceptions                            [ OK ]
# TEST: ipv6: cleanup of cached exceptions - nexthop objects          [ OK ]
<1>[  577.550133] BUG: unable to handle page fault for address: 26c2e000
<1>[  577.555420] #PF: supervisor read access in kernel mode
<1>[  577.555881] #PF: error_code(0x0000) - not-present page
<6>[  577.556265] *pde = 00000000
<4>[  577.558166] Oops: 0000 [#1] PREEMPT SMP
<4>[  577.559142] CPU: 1 PID: 59 Comm: kworker/u4:5 Not tainted 6.8.3-rc1 #1
<4>[  577.560387] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009),
BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
<4>[  577.561517] Workqueue: netns cleanup_net
<4>[  577.563500] EIP: percpu_counter_add_batch+0x38/0xc0

<trim>

<4>[  577.569244] Call Trace:
<4>[  577.570414]  <SOFTIRQ>
<4>[  577.571182]  ? __die_body+0x56/0xa0
<4>[  577.571635]  ? __die+0x6b/0x80
<4>[  577.571877]  ? page_fault_oops+0x296/0x2e0
<4>[  577.572169]  ? kernelmode_fixup_or_oops+0xa0/0xb0
<4>[  577.572535]  ? __bad_area_nosemaphore+0x43/0x180
<4>[  577.572856]  ? bad_area_nosemaphore+0xd/0x20
<4>[  577.573186]  ? do_user_addr_fault+0x314/0x400
<4>[  577.573524]  ? exc_page_fault+0x49/0xa0
<4>[  577.573807]  ? pvclock_clocksource_read_nowd+0xec/0xec
<4>[  577.574143]  ? dst_release+0x60/0x60
<4>[  577.574408]  ? handle_exception+0x14b/0x14b
<4>[  577.574706]  ? dst_release+0x60/0x60
<4>[  577.574990]  ? pvclock_clocksource_read_nowd+0xec/0xec
<4>[  577.575340]  ? percpu_counter_add_batch+0x38/0xc0
<4>[  577.575664]  ? pvclock_clocksource_read_nowd+0xec/0xec
<4>[  577.576005]  ? percpu_counter_add_batch+0x38/0xc0
<4>[  577.576333]  ? dst_release+0x60/0x60
<4>[  577.576594]  dst_destroy+0x34/0xe0
<4>[  577.577017]  dst_destroy_rcu+0xb/0x10
<4>[  577.577298]  rcu_core+0x3f5/0x920
<4>[  577.577561]  rcu_core_si+0x8/0x10
<4>[  577.577803]  __do_softirq+0xa8/0x23e
<4>[  577.578088]  ? __lock_text_end+0x3/0x3
<4>[  577.578353]  do_softirq_own_stack+0x50/0x60
<4>[  577.578744]  </SOFTIRQ>
<4>[  577.578974]  ? sysvec_call_function_single+0x2c/0x2c
<4>[  577.579313]  irq_exit_rcu+0x3a/0x80
<4>[  577.579574]  sysvec_apic_timer_interrupt+0x1f/0x30
<4>[  577.579893]  handle_exception+0x14b/0x14b
<4>[  577.580315] EIP: rb_erase+0x1aa/0x270

<trim>

<4>[  577.581832]  ? sysvec_call_function_single+0x2c/0x2c
<4>[  577.582101]  ? sysvec_call_function_single+0x2c/0x2c
<4>[  577.582361]  ? rb_erase+0x1aa/0x270
<4>[  577.582631]  remove_proc_entry+0xce/0x1a0
<4>[  577.582959]  tcp4_proc_exit_net+0x10/0x20
<4>[  577.583251]  cleanup_net+0x1fb/0x350
<4>[  577.583515]  process_scheduled_works+0x1e1/0x3a0
<4>[  577.583837]  worker_thread+0x294/0x3c0
<4>[  577.584112]  kthread+0x13a/0x150
<4>[  577.584348]  ? pr_cont_work+0x180/0x180
<4>[  577.584624]  ? kthread_blkcg+0x30/0x30
<4>[  577.584892]  ? kthread_blkcg+0x30/0x30
<4>[  577.585175]  ret_from_fork+0x2b/0x40
<4>[  577.585433]  ret_from_fork_asm+0x12/0x18
<4>[  577.585734]  entry_INT80_32+0x108/0x108
<4>[  577.586133] Modules linked in: xfrm_user ipip bridge stp llc
geneve vxlan act_csum act_pedit cls_flower sch_prio xt_mark nft_compat
nf_tables libcrc32c sch_ingress act_mirred cls_basic sch_fq_codel vrf
macvtap macvlan tap ip_tables x_tables [last unloaded:
test_blackhole_dev]
<4>[  577.588292] CR2: 0000000026c2e000
<4>[  577.589067] ---[ end trace 0000000000000000 ]---
<4>[  577.589465] EIP: percpu_counter_add_batch+0x38/0xc0

<trim>

<0>[  577.592536] Kernel panic - not syncing: Fatal exception in interrupt
<0>[  577.598118] Kernel Offset: disabled
<0>[  577.598605] ---[ end Kernel panic - not syncing: Fatal exception
in interrupt ]---

Steps to reproduce:
-----
 - https://tuxapi.tuxsuite.com/v1/groups/linaro/projects/lkft/tests/2eVRrC1WkGHyPnNFg2O7ZvT2Vgy/reproducer

Links:
 - https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.8.y/build/v6.8.2-400-gbffeaccf18b5/testrun/23255383/suite/log-parser-test/test/check-kernel-bug/log
 - https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.8.y/build/v6.8.2-400-gbffeaccf18b5/testrun/23255383/suite/log-parser-test/tests/
 - https://tuxapi.tuxsuite.com/v1/groups/linaro/projects/lkft/tests/2eVRrC1WkGHyPnNFg2O7ZvT2Vgy


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 6.8 000/399] 6.8.3-rc1 review
  2024-04-01 19:40 ` [PATCH 6.8 000/399] 6.8.3-rc1 review Naresh Kamboju
@ 2024-04-02  3:51   ` Jakub Kicinski
  2024-04-02  5:01     ` Naresh Kamboju
  0 siblings, 1 reply; 4+ messages in thread
From: Jakub Kicinski @ 2024-04-02  3:51 UTC (permalink / raw)
  To: Naresh Kamboju
  Cc: Greg Kroah-Hartman, stable, patches, linux-kernel, torvalds, akpm,
	linux, shuah, patches, lkft-triage, pavel, jonathanh, f.fainelli,
	sudipm.mukherjee, srw, rwarsow, conor, allen.lkml, broonie,
	Netdev, David S. Miller, Arnd Bergmann, Eric Dumazet

On Tue, 2 Apr 2024 01:10:11 +0530 Naresh Kamboju wrote:
> The following kernel BUG: unable to handle page fault for address and followed
> by Kernel panic - not syncing: Fatal exception in interrupt noticed
> on the qemu-i386 running  selftests: net: pmtu.sh test case and the kernel
> built with kselftest merge net configs with clang.
> 
> We are investigating this problem on qemu-i386.

One-off or does it repro?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 6.8 000/399] 6.8.3-rc1 review
  2024-04-02  3:51   ` Jakub Kicinski
@ 2024-04-02  5:01     ` Naresh Kamboju
  0 siblings, 0 replies; 4+ messages in thread
From: Naresh Kamboju @ 2024-04-02  5:01 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Greg Kroah-Hartman, stable, patches, linux-kernel, torvalds, akpm,
	linux, shuah, patches, lkft-triage, pavel, jonathanh, f.fainelli,
	sudipm.mukherjee, srw, rwarsow, conor, allen.lkml, broonie,
	Netdev, David S. Miller, Arnd Bergmann, Eric Dumazet

On Tue, 2 Apr 2024 at 09:21, Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Tue, 2 Apr 2024 01:10:11 +0530 Naresh Kamboju wrote:
> > The following kernel BUG: unable to handle page fault for address and followed
> > by Kernel panic - not syncing: Fatal exception in interrupt noticed
> > on the qemu-i386 running  selftests: net: pmtu.sh test case and the kernel
> > built with kselftest merge net configs with clang.
> >
> > We are investigating this problem on qemu-i386.
>
> One-off or does it repro?

one-off.
I have tried reproducing this problem and no luck yet.

- Naresh

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-04-02  5:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20240401152549.131030308@linuxfoundation.org>
2024-04-01 15:42 ` [PATCH 6.8 194/399] net: hns3: tracing: fix hclgevf trace event strings Greg Kroah-Hartman
2024-04-01 19:40 ` [PATCH 6.8 000/399] 6.8.3-rc1 review Naresh Kamboju
2024-04-02  3:51   ` Jakub Kicinski
2024-04-02  5:01     ` Naresh Kamboju

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).