* Re: [PATCH v3 0/2] Add support for clean shutdown with MSHV
From: Praveen K Paladugu @ 2025-10-27 21:11 UTC (permalink / raw)
To: Easwar Hariharan
Cc: kys, haiyangz, wei.liu, decui, tglx, mingo, linux-hyperv,
linux-kernel, bp, dave.hansen, x86, hpa, arnd, anbelski,
nunodasneves, skinsburskii
In-Reply-To: <9097e99c-8d80-44c2-9dab-87166760af9b@linux.microsoft.com>
On 10/27/2025 3:56 PM, Easwar Hariharan wrote:
> On 10/27/2025 1:28 PM, Praveen K Paladugu wrote:
>> Add support for clean shutdown of the root partition when running on MSHV
>> hypervisor.
>>
>> v3:
>> - Dropped acpi_sleep handlers as they are not used on mshv
>> - Applied ordering for hv_reboot_notifier
>> - Fixed build issues on i386, arm64 architectures
>>
>> v2:
>> - Addressed review comments from v1.
>> - Moved all sleep state handling methods under CONFIG_ACPI stub
>> - - This fixes build issues on non-x86 architectures.
>>
>> Praveen K Paladugu (2):
>> hyperv: Add definitions for MSHV sleep state configuration
>> hyperv: Enable clean shutdown for root partition with MSHV
>>
>> arch/x86/hyperv/hv_init.c | 8 +++
>> arch/x86/include/asm/mshyperv.h | 2 +
>> drivers/hv/mshv_common.c | 103 ++++++++++++++++++++++++++++++++
>> include/hyperv/hvgdk_mini.h | 4 +-
>> include/hyperv/hvhdk_mini.h | 33 ++++++++++
>> 5 files changed, 149 insertions(+), 1 deletion(-)
>>
>
> This series seems to assume that Mukesh's hypervisor crash series has been merged, but that's not the case.
> I don't see any code context or logical dependency on that series, but correct me if I'm wrong. If there's no
> dependency, can you send a v4 based on Linus' tree or hyperv-next to avoid a merge conflict?
>
I rebased this patchset on top of hyperv/hyperv-next branch, which has
crashdump patches:
https://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git/log/?h=hyperv-next
Let me know if I missed/misunderstood anything.
> Thanks,
> Easwar (he/him)
^ permalink raw reply
* Re: [PATCH v3 0/2] Add support for clean shutdown with MSHV
From: Easwar Hariharan @ 2025-10-27 20:56 UTC (permalink / raw)
To: Praveen K Paladugu
Cc: kys, haiyangz, wei.liu, decui, tglx, mingo, linux-hyperv,
linux-kernel, bp, dave.hansen, x86, hpa, arnd, easwar.hariharan,
anbelski, nunodasneves, skinsburskii
In-Reply-To: <20251027202859.72006-1-prapal@linux.microsoft.com>
On 10/27/2025 1:28 PM, Praveen K Paladugu wrote:
> Add support for clean shutdown of the root partition when running on MSHV
> hypervisor.
>
> v3:
> - Dropped acpi_sleep handlers as they are not used on mshv
> - Applied ordering for hv_reboot_notifier
> - Fixed build issues on i386, arm64 architectures
>
> v2:
> - Addressed review comments from v1.
> - Moved all sleep state handling methods under CONFIG_ACPI stub
> - - This fixes build issues on non-x86 architectures.
>
> Praveen K Paladugu (2):
> hyperv: Add definitions for MSHV sleep state configuration
> hyperv: Enable clean shutdown for root partition with MSHV
>
> arch/x86/hyperv/hv_init.c | 8 +++
> arch/x86/include/asm/mshyperv.h | 2 +
> drivers/hv/mshv_common.c | 103 ++++++++++++++++++++++++++++++++
> include/hyperv/hvgdk_mini.h | 4 +-
> include/hyperv/hvhdk_mini.h | 33 ++++++++++
> 5 files changed, 149 insertions(+), 1 deletion(-)
>
This series seems to assume that Mukesh's hypervisor crash series has been merged, but that's not the case.
I don't see any code context or logical dependency on that series, but correct me if I'm wrong. If there's no
dependency, can you send a v4 based on Linus' tree or hyperv-next to avoid a merge conflict?
Thanks,
Easwar (he/him)
^ permalink raw reply
* Re: [PATCH v6 02/10] x86/acpi: Move acpi_wakeup_cpu() and helpers to smpwakeup.c
From: Ricardo Neri @ 2025-10-27 20:58 UTC (permalink / raw)
To: Borislav Petkov
Cc: x86, Krzysztof Kozlowski, Conor Dooley, Rob Herring,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui,
Michael Kelley, Rafael J. Wysocki, Saurabh Sengar, Chris Oo,
Kirill A. Shutemov, linux-hyperv, devicetree, linux-acpi,
linux-kernel, Ricardo Neri, Rafael J. Wysocki, Yunhong Jiang
In-Reply-To: <20251027141835.GYaP9_O1C3cms6msfv@fat_crate.local>
On Mon, Oct 27, 2025 at 03:18:35PM +0100, Borislav Petkov wrote:
> On Thu, Oct 16, 2025 at 07:57:24PM -0700, Ricardo Neri wrote:
> > arch/x86/kernel/acpi/madt_wakeup.c | 76 ----------------------------------
> > arch/x86/kernel/smpwakeup.c | 83 ++++++++++++++++++++++++++++++++++++++
>
> How does ACPI-related code belong in the arch/x86/kernel/ hierarchy?
>
> Not to mention that arch/x86/kernel/ is a dumping ground for everything *and*
> the kitchen sink so we should not put more crap in there...
Right. All the functions in the file start with the acpi_ prefix. It could
be kept under arch/x86/kernel/acpi/. The Kconfig symbol X86_MAILBOX_WAKEUP
would have to live in arch/x86/Kconfig as there is no Kconfig file under
arch/x86/kernel/acpi. ACPI_MADT_WAKEUP is arch/x86/Kconfig.
Does that sound acceptable?
Thank you for your feedback, Boris,
Best,
Ricardo
^ permalink raw reply
* Re: [PATCH v6 03/10] dt-bindings: reserved-memory: Wakeup Mailbox for Intel processors
From: Wysocki, Rafael J @ 2025-10-27 20:41 UTC (permalink / raw)
To: Ricardo Neri, Borislav Petkov
Cc: x86, Krzysztof Kozlowski, Conor Dooley, Rob Herring,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui,
Michael Kelley, Rafael J. Wysocki, Saurabh Sengar, Chris Oo,
Kirill A. Shutemov, linux-hyperv, devicetree, linux-acpi,
linux-kernel, Ricardo Neri, Yunhong Jiang
In-Reply-To: <20251027204538.GA14161@ranerica-svr.sc.intel.com>
On 10/27/2025 9:45 PM, Ricardo Neri wrote:
> On Mon, Oct 27, 2025 at 03:22:44PM +0100, Borislav Petkov wrote:
>> On Thu, Oct 16, 2025 at 07:57:25PM -0700, Ricardo Neri wrote:
>>> Reviewed-by: Dexuan Cui <decui@microsoft.com>
>>> Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
>>> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>>> Co-developed-by: Yunhong Jiang <yunhong.jiang@linux.intel.com>
>>> Signed-off-by: Yunhong Jiang <yunhong.jiang@linux.intel.com>
>>> Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
>> This is missing an ack from the devicetree maintainers:
>>
>> ./scripts/get_maintainer.pl -f Documentation/devicetree/
> Agreed. They are in the "To:" field of my submission. Rob has reviewed the
> patchset.
Well, is an ACK required in addition to R-by? I thought that the latter
would imply the former, wouldn't it?
^ permalink raw reply
* Re: [PATCH v6 03/10] dt-bindings: reserved-memory: Wakeup Mailbox for Intel processors
From: Ricardo Neri @ 2025-10-27 20:45 UTC (permalink / raw)
To: Borislav Petkov
Cc: x86, Krzysztof Kozlowski, Conor Dooley, Rob Herring,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui,
Michael Kelley, Rafael J. Wysocki, Saurabh Sengar, Chris Oo,
Kirill A. Shutemov, linux-hyperv, devicetree, linux-acpi,
linux-kernel, Ricardo Neri, Rafael J. Wysocki, Yunhong Jiang
In-Reply-To: <20251027142244.GZaP-ANLSidOxk0R_W@fat_crate.local>
On Mon, Oct 27, 2025 at 03:22:44PM +0100, Borislav Petkov wrote:
> On Thu, Oct 16, 2025 at 07:57:25PM -0700, Ricardo Neri wrote:
> > Reviewed-by: Dexuan Cui <decui@microsoft.com>
> > Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
> > Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > Co-developed-by: Yunhong Jiang <yunhong.jiang@linux.intel.com>
> > Signed-off-by: Yunhong Jiang <yunhong.jiang@linux.intel.com>
> > Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
>
> This is missing an ack from the devicetree maintainers:
>
> ./scripts/get_maintainer.pl -f Documentation/devicetree/
Agreed. They are in the "To:" field of my submission. Rob has reviewed the
patchset.
^ permalink raw reply
* [PATCH v3 2/2] hyperv: Enable clean shutdown for root partition with MSHV
From: Praveen K Paladugu @ 2025-10-27 20:28 UTC (permalink / raw)
To: kys, haiyangz, wei.liu, decui, tglx, mingo, linux-hyperv,
linux-kernel, bp, dave.hansen, x86, hpa, arnd
Cc: anbelski, prapal, easwar.hariharan, nunodasneves, skinsburskii
In-Reply-To: <20251027202859.72006-1-prapal@linux.microsoft.com>
Without configuing sleep state info within mshv, if a root partition is
shut down, it will try to shutdown by writing to ACPI regions. These
writes are intercepted by mshv and will result in a Machine Check
Exception (MCE).
Root eventually panics with a trace similar to:
[ 81.306348] reboot: Power down
[ 81.314709] mce: [Hardware Error]: CPU 0: Machine Check Exception: 4 Bank 0: b2000000c0060001
[ 81.314711] mce: [Hardware Error]: TSC 3b8cb60a66 PPIN 11d98332458e4ea9
[ 81.314713] mce: [Hardware Error]: PROCESSOR 0:606a6 TIME 1759339405 SOCKET 0 APIC 0 microcode ffffffff
[ 81.314715] mce: [Hardware Error]: Run the above through 'mcelog --ascii'
[ 81.314716] mce: [Hardware Error]: Machine check: Processor context corrupt
[ 81.314717] Kernel panic - not syncing: Fatal machine check
To prevent this, properly configure sleep states within MSHV, enable a
reboot notifier, allowing the root partition to cleanly shut down without
any panics. Only S5 sleep state is enabled for now.
Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Co-developed-by: Anatol Belski <anbelski@linux.microsoft.com>
Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
---
arch/x86/hyperv/hv_init.c | 8 +++
arch/x86/include/asm/mshyperv.h | 2 +
drivers/hv/mshv_common.c | 103 ++++++++++++++++++++++++++++++++
3 files changed, 113 insertions(+)
diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c
index e28737ec7054..0a8856009792 100644
--- a/arch/x86/hyperv/hv_init.c
+++ b/arch/x86/hyperv/hv_init.c
@@ -555,6 +555,14 @@ void __init hyperv_init(void)
hv_remap_tsc_clocksource();
hv_root_crash_init();
+
+ /*
+ * The notifier registration might fail at various hops.
+ * Corresponding error messages will land in dmesg. There is
+ * otherwise nothing that can be specifically done to handle
+ * failures here.
+ */
+ hv_sleep_notifiers_register();
} else {
hypercall_msr.guest_physical_address = vmalloc_to_pfn(hv_hypercall_pg);
wrmsrq(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64);
diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyperv.h
index 1342d55c2545..fbc1233175ce 100644
--- a/arch/x86/include/asm/mshyperv.h
+++ b/arch/x86/include/asm/mshyperv.h
@@ -181,8 +181,10 @@ int hyperv_fill_flush_guest_mapping_list(
void hv_apic_init(void);
void __init hv_init_spinlocks(void);
bool hv_vcpu_is_preempted(int vcpu);
+void hv_sleep_notifiers_register(void);
#else
static inline void hv_apic_init(void) {}
+static inline void hv_sleep_notifiers_register(void) {};
#endif
struct irq_domain *hv_create_pci_msi_domain(void);
diff --git a/drivers/hv/mshv_common.c b/drivers/hv/mshv_common.c
index aa2be51979fd..12b248ea3498 100644
--- a/drivers/hv/mshv_common.c
+++ b/drivers/hv/mshv_common.c
@@ -14,6 +14,9 @@
#include <asm/mshyperv.h>
#include <linux/resume_user_mode.h>
#include <linux/export.h>
+#include <linux/acpi.h>
+#include <linux/notifier.h>
+#include <linux/reboot.h>
#include "mshv.h"
@@ -138,3 +141,103 @@ int hv_call_get_partition_property(u64 partition_id,
return 0;
}
EXPORT_SYMBOL_GPL(hv_call_get_partition_property);
+
+#if IS_ENABLED(CONFIG_ACPI)
+/*
+ * Corresponding sleep states have to be initialized in order for a subsequent
+ * HVCALL_ENTER_SLEEP_STATE call to succeed. Currently only S5 state as per
+ * ACPI 6.4 chapter 7.4.2 is relevant, while S1, S2 and S3 can be supported.
+ *
+ * ACPI should be initialized and should support S5 sleep state when this method
+ * is called, so that it can extract correct PM values and pass them to hv.
+ */
+static int hv_initialize_sleep_states(void)
+{
+ u64 status;
+ unsigned long flags;
+ struct hv_input_set_system_property *in;
+ acpi_status acpi_status;
+ u8 sleep_type_a, sleep_type_b;
+
+ if (!acpi_sleep_state_supported(ACPI_STATE_S5)) {
+ pr_err("%s: S5 sleep state not supported.\n", __func__);
+ return -ENODEV;
+ }
+
+ acpi_status = acpi_get_sleep_type_data(ACPI_STATE_S5, &sleep_type_a,
+ &sleep_type_b);
+ if (ACPI_FAILURE(acpi_status))
+ return -ENODEV;
+
+ local_irq_save(flags);
+ in = *this_cpu_ptr(hyperv_pcpu_input_arg);
+ memset(in, 0, sizeof(*in));
+
+ in->property_id = HV_SYSTEM_PROPERTY_SLEEP_STATE;
+ in->set_sleep_state_info.sleep_state = HV_SLEEP_STATE_S5;
+ in->set_sleep_state_info.pm1a_slp_typ = sleep_type_a;
+ in->set_sleep_state_info.pm1b_slp_typ = sleep_type_b;
+
+ status = hv_do_hypercall(HVCALL_SET_SYSTEM_PROPERTY, in, NULL);
+ local_irq_restore(flags);
+
+ if (!hv_result_success(status)) {
+ hv_status_err(status, "\n");
+ return hv_result_to_errno(status);
+ }
+
+ return 0;
+}
+
+static int hv_call_enter_sleep_state(u32 sleep_state)
+{
+ u64 status;
+ int ret;
+ unsigned long flags;
+ struct hv_input_enter_sleep_state *in;
+
+ ret = hv_initialize_sleep_states();
+ if (ret)
+ return ret;
+
+ local_irq_save(flags);
+ in = *this_cpu_ptr(hyperv_pcpu_input_arg);
+ in->sleep_state = sleep_state;
+
+ status = hv_do_hypercall(HVCALL_ENTER_SLEEP_STATE, in, NULL);
+ local_irq_restore(flags);
+
+ if (!hv_result_success(status)) {
+ hv_status_err(status, "\n");
+ return hv_result_to_errno(status);
+ }
+
+ return 0;
+}
+
+static int hv_reboot_notifier_handler(struct notifier_block *this,
+ unsigned long code, void *another)
+{
+ int ret = 0;
+
+ if (code == SYS_HALT || code == SYS_POWER_OFF)
+ ret = hv_call_enter_sleep_state(HV_SLEEP_STATE_S5);
+
+ return ret ? NOTIFY_DONE : NOTIFY_OK;
+}
+
+static struct notifier_block hv_reboot_notifier = {
+ .notifier_call = hv_reboot_notifier_handler,
+ .priority = INT_MIN, /* may not return */
+};
+
+void hv_sleep_notifiers_register(void)
+{
+ int ret;
+
+ ret = register_reboot_notifier(&hv_reboot_notifier);
+ if (ret)
+ pr_err("%s: cannot register reboot notifier %d\n", __func__,
+ ret);
+}
+#endif
--
2.51.0
^ permalink raw reply related
* [PATCH v3 1/2] hyperv: Add definitions for MSHV sleep state configuration
From: Praveen K Paladugu @ 2025-10-27 20:28 UTC (permalink / raw)
To: kys, haiyangz, wei.liu, decui, tglx, mingo, linux-hyperv,
linux-kernel, bp, dave.hansen, x86, hpa, arnd
Cc: anbelski, prapal, easwar.hariharan, nunodasneves, skinsburskii
In-Reply-To: <20251027202859.72006-1-prapal@linux.microsoft.com>
Add the definitions required to configure sleep states in mshv hypervsior.
Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Co-developed-by: Anatol Belski <anbelski@linux.microsoft.com>
Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
Reviewed-by: Easwar Hariharan <easwar.hariharan@linux.microsoft.com>
Reviewed-by: Nuno Das Neves <nunodasneves@linux.microsoft.com>
---
include/hyperv/hvgdk_mini.h | 4 +++-
include/hyperv/hvhdk_mini.h | 33 +++++++++++++++++++++++++++++++++
2 files changed, 36 insertions(+), 1 deletion(-)
diff --git a/include/hyperv/hvgdk_mini.h b/include/hyperv/hvgdk_mini.h
index 7499a679e60a..b43fa1c9ed2c 100644
--- a/include/hyperv/hvgdk_mini.h
+++ b/include/hyperv/hvgdk_mini.h
@@ -465,19 +465,21 @@ union hv_vp_assist_msr_contents { /* HV_REGISTER_VP_ASSIST_PAGE */
#define HVCALL_RESET_DEBUG_SESSION 0x006b
#define HVCALL_MAP_STATS_PAGE 0x006c
#define HVCALL_UNMAP_STATS_PAGE 0x006d
+#define HVCALL_SET_SYSTEM_PROPERTY 0x006f
#define HVCALL_ADD_LOGICAL_PROCESSOR 0x0076
#define HVCALL_GET_SYSTEM_PROPERTY 0x007b
#define HVCALL_MAP_DEVICE_INTERRUPT 0x007c
#define HVCALL_UNMAP_DEVICE_INTERRUPT 0x007d
#define HVCALL_RETARGET_INTERRUPT 0x007e
#define HVCALL_NOTIFY_PARTITION_EVENT 0x0087
+#define HVCALL_ENTER_SLEEP_STATE 0x0084
#define HVCALL_NOTIFY_PORT_RING_EMPTY 0x008b
#define HVCALL_REGISTER_INTERCEPT_RESULT 0x0091
#define HVCALL_ASSERT_VIRTUAL_INTERRUPT 0x0094
#define HVCALL_CREATE_PORT 0x0095
#define HVCALL_CONNECT_PORT 0x0096
#define HVCALL_START_VP 0x0099
-#define HVCALL_GET_VP_INDEX_FROM_APIC_ID 0x009a
+#define HVCALL_GET_VP_INDEX_FROM_APIC_ID 0x009a
#define HVCALL_FLUSH_GUEST_PHYSICAL_ADDRESS_SPACE 0x00af
#define HVCALL_FLUSH_GUEST_PHYSICAL_ADDRESS_LIST 0x00b0
#define HVCALL_SIGNAL_EVENT_DIRECT 0x00c0
diff --git a/include/hyperv/hvhdk_mini.h b/include/hyperv/hvhdk_mini.h
index f2d7b50de7a4..06cf30deb319 100644
--- a/include/hyperv/hvhdk_mini.h
+++ b/include/hyperv/hvhdk_mini.h
@@ -140,6 +140,7 @@ enum hv_snp_status {
enum hv_system_property {
/* Add more values when needed */
+ HV_SYSTEM_PROPERTY_SLEEP_STATE = 3,
HV_SYSTEM_PROPERTY_SCHEDULER_TYPE = 15,
HV_DYNAMIC_PROCESSOR_FEATURE_PROPERTY = 21,
HV_SYSTEM_PROPERTY_CRASHDUMPAREA = 47,
@@ -155,6 +156,19 @@ union hv_pfn_range { /* HV_SPA_PAGE_RANGE */
} __packed;
};
+enum hv_sleep_state {
+ HV_SLEEP_STATE_S1 = 1,
+ HV_SLEEP_STATE_S2 = 2,
+ HV_SLEEP_STATE_S3 = 3,
+ HV_SLEEP_STATE_S4 = 4,
+ HV_SLEEP_STATE_S5 = 5,
+ /*
+ * After hypervisor has received this, any follow up sleep
+ * state registration requests will be rejected.
+ */
+ HV_SLEEP_STATE_LOCK = 6
+};
+
enum hv_dynamic_processor_feature_property {
/* Add more values when needed */
HV_X64_DYNAMIC_PROCESSOR_FEATURE_MAX_ENCRYPTED_PARTITIONS = 13,
@@ -184,6 +198,25 @@ struct hv_output_get_system_property {
};
} __packed;
+struct hv_sleep_state_info {
+ u32 sleep_state; /* enum hv_sleep_state */
+ u8 pm1a_slp_typ;
+ u8 pm1b_slp_typ;
+} __packed;
+
+struct hv_input_set_system_property {
+ u32 property_id; /* enum hv_system_property */
+ u32 reserved;
+ union {
+ /* More fields to be filled in when needed */
+ struct hv_sleep_state_info set_sleep_state_info;
+ };
+} __packed;
+
+struct hv_input_enter_sleep_state { /* HV_INPUT_ENTER_SLEEP_STATE */
+ u32 sleep_state; /* enum hv_sleep_state */
+} __packed;
+
struct hv_input_map_stats_page {
u32 type; /* enum hv_stats_object_type */
u32 padding;
--
2.51.0
^ permalink raw reply related
* [PATCH v3 0/2] Add support for clean shutdown with MSHV
From: Praveen K Paladugu @ 2025-10-27 20:28 UTC (permalink / raw)
To: kys, haiyangz, wei.liu, decui, tglx, mingo, linux-hyperv,
linux-kernel, bp, dave.hansen, x86, hpa, arnd
Cc: anbelski, prapal, easwar.hariharan, nunodasneves, skinsburskii
Add support for clean shutdown of the root partition when running on MSHV
hypervisor.
v3:
- Dropped acpi_sleep handlers as they are not used on mshv
- Applied ordering for hv_reboot_notifier
- Fixed build issues on i386, arm64 architectures
v2:
- Addressed review comments from v1.
- Moved all sleep state handling methods under CONFIG_ACPI stub
- - This fixes build issues on non-x86 architectures.
Praveen K Paladugu (2):
hyperv: Add definitions for MSHV sleep state configuration
hyperv: Enable clean shutdown for root partition with MSHV
arch/x86/hyperv/hv_init.c | 8 +++
arch/x86/include/asm/mshyperv.h | 2 +
drivers/hv/mshv_common.c | 103 ++++++++++++++++++++++++++++++++
include/hyperv/hvgdk_mini.h | 4 +-
include/hyperv/hvhdk_mini.h | 33 ++++++++++
5 files changed, 149 insertions(+), 1 deletion(-)
--
2.51.0
^ permalink raw reply
* [PATCH net-next v2] net: mana: Implement ndo_tx_timeout and serialize queue resets per port.
From: Dipayaan Roy @ 2025-10-27 20:13 UTC (permalink / raw)
To: kys, haiyangz, wei.liu, decui, andrew+netdev, davem, edumazet,
kuba, pabeni, longli, kotaranov, horms, shradhagupta, ssengar,
ernis, shirazsaleem, linux-hyperv, netdev, linux-kernel,
linux-rdma, dipayanroy
Implement .ndo_tx_timeout for MANA so any stalled TX queue can be detected
and a device-controlled port reset for all queues can be scheduled to a
ordered workqueue. The reset for all queues on stall detection is
recomended by hardware team.
The change introduces a single ordered workqueue
("mana_per_port_queue_reset_wq") with WQ_UNBOUND | WQ_MEM_RECLAIM and
queues exactly one work_struct per port onto it. This achieves:
* Global FIFO across all port reset requests (alloc_ordered_workqueue).
* Natural per-port de-duplication: the same work_struct cannot be
queued twice while pending/running.
* Avoids hogging a per-CPU kworker for long, may-sleep reset paths
(WQ_UNBOUND).
* Guarantees forward progress during memory pressure
(WQ_MEM_RECLAIM rescuer).
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Dipayaan Roy <dipayanroy@linux.microsoft.com>
---
Changes in v2:
- Fixed cosmetic changes.
---
drivers/net/ethernet/microsoft/mana/mana_en.c | 82 +++++++++++++++++++
include/net/mana/gdma.h | 6 +-
include/net/mana/mana.h | 15 ++++
3 files changed, 102 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c
index f4fc86f20213..05b7046ae3b5 100644
--- a/drivers/net/ethernet/microsoft/mana/mana_en.c
+++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
@@ -258,6 +258,45 @@ static int mana_get_gso_hs(struct sk_buff *skb)
return gso_hs;
}
+static void mana_per_port_queue_reset_work_handler(struct work_struct *work)
+{
+ struct mana_queue_reset_work *reset_queue_work =
+ container_of(work, struct mana_queue_reset_work, work);
+ struct mana_port_context *apc = reset_queue_work->apc;
+ struct net_device *ndev = apc->ndev;
+ struct mana_context *ac = apc->ac;
+ int err;
+
+ if (!rtnl_trylock()) {
+ /* Someone else holds RTNL, requeue and exit. */
+ queue_work(ac->per_port_queue_reset_wq,
+ &apc->queue_reset_work.work);
+ return;
+ }
+
+ /* Pre-allocate buffers to prevent failure in mana_attach later */
+ err = mana_pre_alloc_rxbufs(apc, ndev->mtu, apc->num_queues);
+ if (err) {
+ netdev_err(ndev, "Insufficient memory for reset post tx stall detection\n");
+ goto out;
+ }
+
+ err = mana_detach(ndev, false);
+ if (err) {
+ netdev_err(ndev, "mana_detach failed: %d\n", err);
+ goto dealloc_pre_rxbufs;
+ }
+
+ err = mana_attach(ndev);
+ if (err)
+ netdev_err(ndev, "mana_attach failed: %d\n", err);
+
+dealloc_pre_rxbufs:
+ mana_pre_dealloc_rxbufs(apc);
+out:
+ rtnl_unlock();
+}
+
netdev_tx_t mana_start_xmit(struct sk_buff *skb, struct net_device *ndev)
{
enum mana_tx_pkt_format pkt_fmt = MANA_SHORT_PKT_FMT;
@@ -762,6 +801,25 @@ static int mana_change_mtu(struct net_device *ndev, int new_mtu)
return err;
}
+static void mana_tx_timeout(struct net_device *netdev, unsigned int txqueue)
+{
+ struct mana_port_context *apc = netdev_priv(netdev);
+ struct mana_context *ac = apc->ac;
+ struct gdma_context *gc = ac->gdma_dev->gdma_context;
+
+ netdev_warn(netdev, "%s(): called on txq: %u\n", __func__, txqueue);
+
+ /* Already in service, hence tx queue reset is not required.*/
+ if (gc->in_service)
+ return;
+
+ /* Note: If there are pending queue reset work for this port(apc),
+ * subsequent request queued up from here are ignored. This is because
+ * we are using the same work instance per port(apc).
+ */
+ queue_work(ac->per_port_queue_reset_wq, &apc->queue_reset_work.work);
+}
+
static int mana_shaper_set(struct net_shaper_binding *binding,
const struct net_shaper *shaper,
struct netlink_ext_ack *extack)
@@ -844,7 +902,9 @@ static const struct net_device_ops mana_devops = {
.ndo_bpf = mana_bpf,
.ndo_xdp_xmit = mana_xdp_xmit,
.ndo_change_mtu = mana_change_mtu,
+ .ndo_tx_timeout = mana_tx_timeout,
.net_shaper_ops = &mana_shaper_ops,
+
};
static void mana_cleanup_port_context(struct mana_port_context *apc)
@@ -3218,6 +3278,7 @@ static int mana_probe_port(struct mana_context *ac, int port_idx,
ndev->min_mtu = ETH_MIN_MTU;
ndev->needed_headroom = MANA_HEADROOM;
ndev->dev_port = port_idx;
+ ndev->watchdog_timeo = MANA_TXQ_TIMEOUT;
SET_NETDEV_DEV(ndev, gc->dev);
netif_set_tso_max_size(ndev, GSO_MAX_SIZE);
@@ -3255,6 +3316,11 @@ static int mana_probe_port(struct mana_context *ac, int port_idx,
debugfs_create_u32("current_speed", 0400, apc->mana_port_debugfs, &apc->speed);
+ /* Initialize the per port queue reset work.*/
+ apc->queue_reset_work.apc = apc;
+ INIT_WORK(&apc->queue_reset_work.work,
+ mana_per_port_queue_reset_work_handler);
+
return 0;
free_indir:
@@ -3456,6 +3522,15 @@ int mana_probe(struct gdma_dev *gd, bool resuming)
if (ac->num_ports > MAX_PORTS_IN_MANA_DEV)
ac->num_ports = MAX_PORTS_IN_MANA_DEV;
+ ac->per_port_queue_reset_wq =
+ alloc_ordered_workqueue("mana_per_port_queue_reset_wq",
+ WQ_UNBOUND | WQ_MEM_RECLAIM);
+ if (!ac->per_port_queue_reset_wq) {
+ dev_err(dev, "Failed to allocate per port queue reset workqueue\n");
+ err = -ENOMEM;
+ goto out;
+ }
+
if (!resuming) {
for (i = 0; i < ac->num_ports; i++) {
err = mana_probe_port(ac, i, &ac->ports[i]);
@@ -3528,6 +3603,8 @@ void mana_remove(struct gdma_dev *gd, bool suspending)
*/
rtnl_lock();
+ cancel_work_sync(&apc->queue_reset_work.work);
+
err = mana_detach(ndev, false);
if (err)
netdev_err(ndev, "Failed to detach vPort %d: %d\n",
@@ -3547,6 +3624,11 @@ void mana_remove(struct gdma_dev *gd, bool suspending)
free_netdev(ndev);
}
+ if (ac->per_port_queue_reset_wq) {
+ destroy_workqueue(ac->per_port_queue_reset_wq);
+ ac->per_port_queue_reset_wq = NULL;
+ }
+
mana_destroy_eq(ac);
out:
mana_gd_deregister_device(gd);
diff --git a/include/net/mana/gdma.h b/include/net/mana/gdma.h
index 57df78cfbf82..1f8c536ba3be 100644
--- a/include/net/mana/gdma.h
+++ b/include/net/mana/gdma.h
@@ -591,6 +591,9 @@ enum {
/* Driver can self reset on FPGA Reconfig EQE notification */
#define GDMA_DRV_CAP_FLAG_1_HANDLE_RECONFIG_EQE BIT(17)
+/* Driver detects stalled send queues and recovers them */
+#define GDMA_DRV_CAP_FLAG_1_HANDLE_STALL_SQ_RECOVERY BIT(18)
+
#define GDMA_DRV_CAP_FLAGS1 \
(GDMA_DRV_CAP_FLAG_1_EQ_SHARING_MULTI_VPORT | \
GDMA_DRV_CAP_FLAG_1_NAPI_WKDONE_FIX | \
@@ -599,7 +602,8 @@ enum {
GDMA_DRV_CAP_FLAG_1_DEV_LIST_HOLES_SUP | \
GDMA_DRV_CAP_FLAG_1_DYNAMIC_IRQ_ALLOC_SUPPORT | \
GDMA_DRV_CAP_FLAG_1_SELF_RESET_ON_EQE | \
- GDMA_DRV_CAP_FLAG_1_HANDLE_RECONFIG_EQE)
+ GDMA_DRV_CAP_FLAG_1_HANDLE_RECONFIG_EQE | \
+ GDMA_DRV_CAP_FLAG_1_HANDLE_STALL_SQ_RECOVERY)
#define GDMA_DRV_CAP_FLAGS2 0
diff --git a/include/net/mana/mana.h b/include/net/mana/mana.h
index 0921485565c0..e0b44ae2226a 100644
--- a/include/net/mana/mana.h
+++ b/include/net/mana/mana.h
@@ -67,6 +67,11 @@ enum TRI_STATE {
#define MANA_RX_FRAG_ALIGNMENT 64
+/* Timeout value for Txq stall detection & recovery used by ndo_tx_timeout.
+ * The value is chosen after considering fpga re-config scenarios.
+ */
+#define MANA_TXQ_TIMEOUT (15 * HZ)
+
struct mana_stats_rx {
u64 packets;
u64 bytes;
@@ -475,13 +480,23 @@ struct mana_context {
struct mana_eq *eqs;
struct dentry *mana_eqs_debugfs;
+ struct workqueue_struct *per_port_queue_reset_wq;
struct net_device *ports[MAX_PORTS_IN_MANA_DEV];
};
+struct mana_queue_reset_work {
+
+ /* Work structure */
+ struct work_struct work;
+ /* Pointer to the port context */
+ struct mana_port_context *apc;
+};
+
struct mana_port_context {
struct mana_context *ac;
struct net_device *ndev;
+ struct mana_queue_reset_work queue_reset_work;
u8 mac_addr[ETH_ALEN];
--
2.43.0
^ permalink raw reply related
* RE: [PATCH net-next] net: mana: Implement ndo_tx_timeout and serialize queue resets per port.
From: Haiyang Zhang @ 2025-10-27 17:52 UTC (permalink / raw)
To: Dipayaan Roy, KY Srinivasan, wei.liu@kernel.org, Dexuan Cui,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, Long Li, Konstantin Taranov,
horms@kernel.org, shradhagupta@linux.microsoft.com,
ssengar@linux.microsoft.com, ernis@linux.microsoft.com,
Shiraz Saleem, linux-hyperv@vger.kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-rdma@vger.kernel.org, Dipayaan Roy
In-Reply-To: <20251027114549.GA12252@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net>
> -----Original Message-----
> From: Dipayaan Roy <dipayanroy@linux.microsoft.com>
> Sent: Monday, October 27, 2025 7:46 AM
> To: KY Srinivasan <kys@microsoft.com>; Haiyang Zhang
> <haiyangz@microsoft.com>; wei.liu@kernel.org; Dexuan Cui
> <DECUI@microsoft.com>; andrew+netdev@lunn.ch; davem@davemloft.net;
> edumazet@google.com; kuba@kernel.org; pabeni@redhat.com; Long Li
> <longli@microsoft.com>; Konstantin Taranov <kotaranov@microsoft.com>;
> horms@kernel.org; shradhagupta@linux.microsoft.com;
> ssengar@linux.microsoft.com; ernis@linux.microsoft.com; Shiraz Saleem
> <shirazsaleem@microsoft.com>; linux-hyperv@vger.kernel.org;
> netdev@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
> rdma@vger.kernel.org; Dipayaan Roy <dipayanroy@microsoft.com>
> Subject: [PATCH net-next] net: mana: Implement ndo_tx_timeout and
> serialize queue resets per port.
>
> Implement .ndo_tx_timeout for MANA so any stalled TX queue can be detected
> and a device-controlled port reset for all queues can be scheduled to an
> ordered workqueue. The reset for all queues on stall detection is
> recomended by hardware team.
>
> The change introduces a single ordered workqueue
> ("mana_per_port_queue_reset_wq") with WQ_UNBOUND | WQ_MEM_RECLAIM and
> queues exactly one work_struct per port onto it. This achieves:
>
> * Global FIFO across all port reset requests (alloc_ordered_workqueue).
> * Natural per-port de-duplication: the same work_struct cannot be
> queued twice while pending/running.
> * Avoids hogging a per-CPU kworker for long, may-sleep reset paths
> (WQ_UNBOUND).
> * Guarantees forward progress during memory pressure
> (WQ_MEM_RECLAIM rescuer).
>
> Signed-off-by: Dipayaan Roy <dipayanroy@linux.microsoft.com>
Looks good, except for the comments from Pavan.
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
^ permalink raw reply
* Re: [PATCH net-next v8 00/14] vsock: add namespace support to vhost-vsock
From: Bobby Eshleman @ 2025-10-27 17:25 UTC (permalink / raw)
To: Stefano Garzarella
Cc: Shuah Khan, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Stefan Hajnoczi, Michael S. Tsirkin,
Jason Wang, Xuan Zhuo, Eugenio Pérez, K. Y. Srinivasan,
Haiyang Zhang, Wei Liu, Dexuan Cui, Bryan Tan, Vishnu Dasa,
Broadcom internal kernel review list, virtualization, netdev,
linux-kselftest, linux-kernel, kvm, linux-hyperv, berrange,
Bobby Eshleman
In-Reply-To: <k4tqyp7wlnbmcntmvzp7oawacfofnnzdi5cjwlj6djxtlo6xai@44ivtv4kgjz2>
On Mon, Oct 27, 2025 at 02:28:31PM +0100, Stefano Garzarella wrote:
> Hi Bobby,
>
> >
> > Changes in v8:
> > - Break generic cleanup/refactoring patches into standalone series,
> > remove those from this series
>
> Yep, thanks for splitting the series. I'll review it ASAP since it's a
> dependency.
>
> I was at GSoC mentor summit last week, so I'm bit busy with the backlog, but
> I'll do my best to review both series this week.
>
> Thanks,
> Stefano
>
Thanks for the heads up!
Best,
Bobby
^ permalink raw reply
* Re: [PATCH] hv: fix missing kernel-doc description for 'size' in request_arr_init()
From: Easwar Hariharan @ 2025-10-27 16:09 UTC (permalink / raw)
To: kriish.sharma2006
Cc: kys, haiyangz, wei.liu, decui, longli, easwar.hariharan,
linux-hyperv, linux-kernel, kernel test robot
In-Reply-To: <20251025120707.686825-1-kriish.sharma2006@gmail.com>
On 10/25/2025 5:07 AM, kriish.sharma2006@gmail.com wrote:
> From: Kriish Sharma <kriish.sharma2006@gmail.com>
>
> Add missing kernel-doc entry for the @size parameter in
> request_arr_init(), fixing the following documentation warning
> reported by the kernel test robot and detected via kernel-doc:
>
> Warning: drivers/hv/channel.c:595 function parameter 'size' not described in 'request_arr_init'
>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202503021934.wH1BERla-lkp@intel.com
> Signed-off-by: Kriish Sharma <kriish.sharma2006@gmail.com>
> ---
> drivers/hv/channel.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Thanks for the patch!
Reviewed-by: Easwar Hariharan <easwar.hariharan@linux.microsoft.com>
> diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c
> index 88485d255a42..6821f225248b 100644
> --- a/drivers/hv/channel.c
> +++ b/drivers/hv/channel.c
> @@ -590,7 +590,7 @@ EXPORT_SYMBOL_GPL(vmbus_establish_gpadl);
> * keeps track of the next available slot in the array. Initially, each
> * slot points to the next one (as in a Linked List). The last slot
> * does not point to anything, so its value is U64_MAX by default.
> - * @size The size of the array
> + * @size: The size of the array
> */
> static u64 *request_arr_init(u32 size)
> {
^ permalink raw reply
* Re: [PATCH v6 03/10] dt-bindings: reserved-memory: Wakeup Mailbox for Intel processors
From: Borislav Petkov @ 2025-10-27 14:22 UTC (permalink / raw)
To: Ricardo Neri
Cc: x86, Krzysztof Kozlowski, Conor Dooley, Rob Herring,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui,
Michael Kelley, Rafael J. Wysocki, Saurabh Sengar, Chris Oo,
Kirill A. Shutemov, linux-hyperv, devicetree, linux-acpi,
linux-kernel, Ricardo Neri, Rafael J. Wysocki, Yunhong Jiang
In-Reply-To: <20251016-rneri-wakeup-mailbox-v6-3-40435fb9305e@linux.intel.com>
On Thu, Oct 16, 2025 at 07:57:25PM -0700, Ricardo Neri wrote:
> Reviewed-by: Dexuan Cui <decui@microsoft.com>
> Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> Co-developed-by: Yunhong Jiang <yunhong.jiang@linux.intel.com>
> Signed-off-by: Yunhong Jiang <yunhong.jiang@linux.intel.com>
> Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
This is missing an ack from the devicetree maintainers:
./scripts/get_maintainer.pl -f Documentation/devicetree/
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
^ permalink raw reply
* Re: [PATCH v6 02/10] x86/acpi: Move acpi_wakeup_cpu() and helpers to smpwakeup.c
From: Borislav Petkov @ 2025-10-27 14:18 UTC (permalink / raw)
To: Ricardo Neri
Cc: x86, Krzysztof Kozlowski, Conor Dooley, Rob Herring,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui,
Michael Kelley, Rafael J. Wysocki, Saurabh Sengar, Chris Oo,
Kirill A. Shutemov, linux-hyperv, devicetree, linux-acpi,
linux-kernel, Ricardo Neri, Rafael J. Wysocki, Yunhong Jiang
In-Reply-To: <20251016-rneri-wakeup-mailbox-v6-2-40435fb9305e@linux.intel.com>
On Thu, Oct 16, 2025 at 07:57:24PM -0700, Ricardo Neri wrote:
> arch/x86/kernel/acpi/madt_wakeup.c | 76 ----------------------------------
> arch/x86/kernel/smpwakeup.c | 83 ++++++++++++++++++++++++++++++++++++++
How does ACPI-related code belong in the arch/x86/kernel/ hierarchy?
Not to mention that arch/x86/kernel/ is a dumping ground for everything *and*
the kitchen sink so we should not put more crap in there...
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
^ permalink raw reply
* Re: [PATCH net-next] net: mana: Implement ndo_tx_timeout and serialize queue resets per port.
From: Pavan Chebbi @ 2025-10-27 13:58 UTC (permalink / raw)
To: Dipayaan Roy
Cc: kys, haiyangz, wei.liu, decui, andrew+netdev, davem, edumazet,
kuba, pabeni, longli, kotaranov, horms, shradhagupta, ssengar,
ernis, shirazsaleem, linux-hyperv, netdev, linux-kernel,
linux-rdma, dipayanroy
In-Reply-To: <20251027114549.GA12252@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net>
[-- Attachment #1: Type: text/plain, Size: 9551 bytes --]
On Mon, Oct 27, 2025 at 5:19 PM Dipayaan Roy
<dipayanroy@linux.microsoft.com> wrote:
>
> Implement .ndo_tx_timeout for MANA so any stalled TX queue can be detected
> and a device-controlled port reset for all queues can be scheduled to an
> ordered workqueue. The reset for all queues on stall detection is
> recomended by hardware team.
>
> The change introduces a single ordered workqueue
> ("mana_per_port_queue_reset_wq") with WQ_UNBOUND | WQ_MEM_RECLAIM and
> queues exactly one work_struct per port onto it. This achieves:
>
> * Global FIFO across all port reset requests (alloc_ordered_workqueue).
> * Natural per-port de-duplication: the same work_struct cannot be
> queued twice while pending/running.
> * Avoids hogging a per-CPU kworker for long, may-sleep reset paths
> (WQ_UNBOUND).
> * Guarantees forward progress during memory pressure
> (WQ_MEM_RECLAIM rescuer).
>
> Signed-off-by: Dipayaan Roy <dipayanroy@linux.microsoft.com>
> ---
> drivers/net/ethernet/microsoft/mana/mana_en.c | 83 +++++++++++++++++++
> include/net/mana/gdma.h | 6 +-
> include/net/mana/mana.h | 12 +++
> 3 files changed, 100 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c
> index f4fc86f20213..2833f66d8b2b 100644
> --- a/drivers/net/ethernet/microsoft/mana/mana_en.c
> +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
> @@ -258,6 +258,45 @@ static int mana_get_gso_hs(struct sk_buff *skb)
> return gso_hs;
> }
>
> +static void mana_per_port_queue_reset_work_handler(struct work_struct *work)
> +{
> + struct mana_queue_reset_work *reset_queue_work =
> + container_of(work, struct mana_queue_reset_work, work);
> + struct mana_port_context *apc = reset_queue_work->apc;
> + struct net_device *ndev = apc->ndev;
> + struct mana_context *ac = apc->ac;
> + int err;
> +
> + if (!rtnl_trylock()) {
> + /* Someone else holds RTNL, requeue and exit. */
> + queue_work(ac->per_port_queue_reset_wq,
> + &apc->queue_reset_work.work);
> + return;
> + }
> +
> + /* Pre-allocate buffers to prevent failure in mana_attach later */
> + err = mana_pre_alloc_rxbufs(apc, ndev->mtu, apc->num_queues);
> + if (err) {
> + netdev_err(ndev, "Insufficient memory for reset post tx stall detection\n");
> + goto out;
> + }
> +
> + err = mana_detach(ndev, false);
> + if (err) {
> + netdev_err(ndev, "mana_detach failed: %d\n", err);
> + goto dealloc_pre_rxbufs;
> + }
> +
> + err = mana_attach(ndev);
> + if (err)
> + netdev_err(ndev, "mana_attach failed: %d\n", err);
> +
> +dealloc_pre_rxbufs:
> + mana_pre_dealloc_rxbufs(apc);
> +out:
> + rtnl_unlock();
> +}
> +
> netdev_tx_t mana_start_xmit(struct sk_buff *skb, struct net_device *ndev)
> {
> enum mana_tx_pkt_format pkt_fmt = MANA_SHORT_PKT_FMT;
> @@ -762,6 +801,25 @@ static int mana_change_mtu(struct net_device *ndev, int new_mtu)
> return err;
> }
>
> +static void mana_tx_timeout(struct net_device *netdev, unsigned int txqueue)
> +{
> + struct mana_port_context *apc = netdev_priv(netdev);
> + struct mana_context *ac = apc->ac;
> + struct gdma_context *gc = ac->gdma_dev->gdma_context;
> +
> + netdev_warn(netdev, "%s(): called on txq: %u\n", __func__, txqueue);
> +
> + /* Already in service, hence tx queue reset is not required.*/
> + if (gc->in_service)
> + return;
> +
> + /* Note: If there are pending queue reset work for this port(apc),
> + * subsequent request queued up drom here are ignored. This is because
%s/drom/from/
> + * we are using the same work instance per port(apc).
> + */
> + queue_work(ac->per_port_queue_reset_wq, &apc->queue_reset_work.work);
> +}
> +
> static int mana_shaper_set(struct net_shaper_binding *binding,
> const struct net_shaper *shaper,
> struct netlink_ext_ack *extack)
> @@ -844,7 +902,9 @@ static const struct net_device_ops mana_devops = {
> .ndo_bpf = mana_bpf,
> .ndo_xdp_xmit = mana_xdp_xmit,
> .ndo_change_mtu = mana_change_mtu,
> + .ndo_tx_timeout = mana_tx_timeout,
> .net_shaper_ops = &mana_shaper_ops,
> +
> };
>
> static void mana_cleanup_port_context(struct mana_port_context *apc)
> @@ -3218,6 +3278,7 @@ static int mana_probe_port(struct mana_context *ac, int port_idx,
> ndev->min_mtu = ETH_MIN_MTU;
> ndev->needed_headroom = MANA_HEADROOM;
> ndev->dev_port = port_idx;
> + ndev->watchdog_timeo = MANA_TXQ_TIMEOUT;
> SET_NETDEV_DEV(ndev, gc->dev);
>
> netif_set_tso_max_size(ndev, GSO_MAX_SIZE);
> @@ -3255,6 +3316,11 @@ static int mana_probe_port(struct mana_context *ac, int port_idx,
>
> debugfs_create_u32("current_speed", 0400, apc->mana_port_debugfs, &apc->speed);
>
> + /* Initialize the per port queue reset work.*/
> + apc->queue_reset_work.apc = apc;
> + INIT_WORK(&apc->queue_reset_work.work,
> + mana_per_port_queue_reset_work_handler);
> +
> return 0;
>
> free_indir:
> @@ -3456,6 +3522,15 @@ int mana_probe(struct gdma_dev *gd, bool resuming)
> if (ac->num_ports > MAX_PORTS_IN_MANA_DEV)
> ac->num_ports = MAX_PORTS_IN_MANA_DEV;
>
> + ac->per_port_queue_reset_wq =
> + alloc_ordered_workqueue("mana_per_port_queue_reset_wq",
> + WQ_UNBOUND | WQ_MEM_RECLAIM);
> + if (!ac->per_port_queue_reset_wq) {
> + dev_err(dev, "Failed to allocate per port queue reset workqueue\n");
> + err = -ENOMEM;
> + goto out;
> + }
> +
> if (!resuming) {
> for (i = 0; i < ac->num_ports; i++) {
> err = mana_probe_port(ac, i, &ac->ports[i]);
> @@ -3528,6 +3603,8 @@ void mana_remove(struct gdma_dev *gd, bool suspending)
> */
> rtnl_lock();
>
> + cancel_work_sync(&apc->queue_reset_work.work);
> +
> err = mana_detach(ndev, false);
> if (err)
> netdev_err(ndev, "Failed to detach vPort %d: %d\n",
> @@ -3547,6 +3624,12 @@ void mana_remove(struct gdma_dev *gd, bool suspending)
> free_netdev(ndev);
> }
>
> + if (ac->per_port_queue_reset_wq) {
> + drain_workqueue(ac->per_port_queue_reset_wq);
> + destroy_workqueue(ac->per_port_queue_reset_wq);
destroy will take care of the drain.
> + ac->per_port_queue_reset_wq = NULL;
> + }
> +
> mana_destroy_eq(ac);
> out:
> mana_gd_deregister_device(gd);
> diff --git a/include/net/mana/gdma.h b/include/net/mana/gdma.h
> index 57df78cfbf82..1f8c536ba3be 100644
> --- a/include/net/mana/gdma.h
> +++ b/include/net/mana/gdma.h
> @@ -591,6 +591,9 @@ enum {
> /* Driver can self reset on FPGA Reconfig EQE notification */
> #define GDMA_DRV_CAP_FLAG_1_HANDLE_RECONFIG_EQE BIT(17)
>
> +/* Driver detects stalled send queues and recovers them */
> +#define GDMA_DRV_CAP_FLAG_1_HANDLE_STALL_SQ_RECOVERY BIT(18)
> +
> #define GDMA_DRV_CAP_FLAGS1 \
> (GDMA_DRV_CAP_FLAG_1_EQ_SHARING_MULTI_VPORT | \
> GDMA_DRV_CAP_FLAG_1_NAPI_WKDONE_FIX | \
> @@ -599,7 +602,8 @@ enum {
> GDMA_DRV_CAP_FLAG_1_DEV_LIST_HOLES_SUP | \
> GDMA_DRV_CAP_FLAG_1_DYNAMIC_IRQ_ALLOC_SUPPORT | \
> GDMA_DRV_CAP_FLAG_1_SELF_RESET_ON_EQE | \
> - GDMA_DRV_CAP_FLAG_1_HANDLE_RECONFIG_EQE)
> + GDMA_DRV_CAP_FLAG_1_HANDLE_RECONFIG_EQE | \
> + GDMA_DRV_CAP_FLAG_1_HANDLE_STALL_SQ_RECOVERY)
>
> #define GDMA_DRV_CAP_FLAGS2 0
>
> diff --git a/include/net/mana/mana.h b/include/net/mana/mana.h
> index 0921485565c0..9b8f236f27c9 100644
> --- a/include/net/mana/mana.h
> +++ b/include/net/mana/mana.h
> @@ -67,6 +67,11 @@ enum TRI_STATE {
>
> #define MANA_RX_FRAG_ALIGNMENT 64
>
> +/* Timeout value for Txq stall detetcion & recovery used by ndo_tx_timeout.
%s/detetcion/detection/
> + * The value is chosen after considering fpga re-config scenarios.
> + */
> +#define MANA_TXQ_TIMEOUT (15 * HZ)
> +
> struct mana_stats_rx {
> u64 packets;
> u64 bytes;
> @@ -475,13 +480,20 @@ struct mana_context {
>
> struct mana_eq *eqs;
> struct dentry *mana_eqs_debugfs;
> + struct workqueue_struct *per_port_queue_reset_wq;
>
> struct net_device *ports[MAX_PORTS_IN_MANA_DEV];
> };
>
> +struct mana_queue_reset_work {
> + struct work_struct work; // Work structure
> + struct mana_port_context *apc; // Pointer to the port context
Block comment style is preferred instead of //
> +};
> +
> struct mana_port_context {
> struct mana_context *ac;
> struct net_device *ndev;
> + struct mana_queue_reset_work queue_reset_work;
>
> u8 mac_addr[ETH_ALEN];
>
> --
> 2.43.0
>
>
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 5469 bytes --]
^ permalink raw reply
* Re: [PATCH net-next v8 00/14] vsock: add namespace support to vhost-vsock
From: Stefano Garzarella @ 2025-10-27 13:28 UTC (permalink / raw)
To: Bobby Eshleman
Cc: Shuah Khan, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Stefan Hajnoczi, Michael S. Tsirkin,
Jason Wang, Xuan Zhuo, Eugenio Pérez, K. Y. Srinivasan,
Haiyang Zhang, Wei Liu, Dexuan Cui, Bryan Tan, Vishnu Dasa,
Broadcom internal kernel review list, virtualization, netdev,
linux-kselftest, linux-kernel, kvm, linux-hyperv, berrange,
Bobby Eshleman
In-Reply-To: <20251023-vsock-vmtest-v8-0-dea984d02bb0@meta.com>
Hi Bobby,
On Thu, Oct 23, 2025 at 11:27:39AM -0700, Bobby Eshleman wrote:
>This series adds namespace support to vhost-vsock and loopback. It does
>not add namespaces to any of the other guest transports (virtio-vsock,
>hyperv, or vmci).
>
>The current revision supports two modes: local and global. Local
>mode is complete isolation of namespaces, while global mode is complete
>sharing between namespaces of CIDs (the original behavior).
>
>The mode is set using /proc/sys/net/vsock/ns_mode.
>
>Modes are per-netns and write-once. This allows a system to configure
>namespaces independently (some may share CIDs, others are completely
>isolated). This also supports future possible mixed use cases, where
>there may be namespaces in global mode spinning up VMs while there are
>mixed mode namespaces that provide services to the VMs, but are not
>allowed to allocate from the global CID pool (this mode not implemented
>in this series).
>
>If a socket or VM is created when a namespace is global but the
>namespace changes to local, the socket or VM will continue working
>normally. That is, the socket or VM assumes the mode behavior of the
>namespace at the time the socket/VM was created. The original mode is
>captured in vsock_create() and so occurs at the time of socket(2) and
>accept(2) for sockets and open(2) on /dev/vhost-vsock for VMs. This
>prevents a socket/VM connection from suddenly breaking due to a
>namespace mode change. Any new sockets/VMs created after the mode change
>will adopt the new mode's behavior.
>
>Additionally, added tests for the new namespace features:
>
>tools/testing/selftests/vsock/vmtest.sh
>1..30
>ok 1 vm_server_host_client
>ok 2 vm_client_host_server
>ok 3 vm_loopback
>ok 4 ns_host_vsock_ns_mode_ok
>ok 5 ns_host_vsock_ns_mode_write_once_ok
>ok 6 ns_global_same_cid_fails
>ok 7 ns_local_same_cid_ok
>ok 8 ns_global_local_same_cid_ok
>ok 9 ns_local_global_same_cid_ok
>ok 10 ns_diff_global_host_connect_to_global_vm_ok
>ok 11 ns_diff_global_host_connect_to_local_vm_fails
>ok 12 ns_diff_global_vm_connect_to_global_host_ok
>ok 13 ns_diff_global_vm_connect_to_local_host_fails
>ok 14 ns_diff_local_host_connect_to_local_vm_fails
>ok 15 ns_diff_local_vm_connect_to_local_host_fails
>ok 16 ns_diff_global_to_local_loopback_local_fails
>ok 17 ns_diff_local_to_global_loopback_fails
>ok 18 ns_diff_local_to_local_loopback_fails
>ok 19 ns_diff_global_to_global_loopback_ok
>ok 20 ns_same_local_loopback_ok
>ok 21 ns_same_local_host_connect_to_local_vm_ok
>ok 22 ns_same_local_vm_connect_to_local_host_ok
>ok 23 ns_mode_change_connection_continue_vm_ok
>ok 24 ns_mode_change_connection_continue_host_ok
>ok 25 ns_mode_change_connection_continue_both_ok
>ok 26 ns_delete_vm_ok
>ok 27 ns_delete_host_ok
>ok 28 ns_delete_both_ok
>ok 29 ns_loopback_global_global_late_module_load_ok
>ok 30 ns_loopback_local_local_late_module_load_fails
>SUMMARY: PASS=30 SKIP=0 FAIL=0
>
>Dependent on series:
>https://lore.kernel.org/all/20251022-vsock-selftests-fixes-and-improvements-v1-0-edeb179d6463@meta.com/
>
>Thanks again for everyone's help and reviews!
>
>Signed-off-by: Bobby Eshleman <bobbyeshleman@gmail.com>
>To: Stefano Garzarella <sgarzare@redhat.com>
>To: Shuah Khan <shuah@kernel.org>
>To: David S. Miller <davem@davemloft.net>
>To: Eric Dumazet <edumazet@google.com>
>To: Jakub Kicinski <kuba@kernel.org>
>To: Paolo Abeni <pabeni@redhat.com>
>To: Simon Horman <horms@kernel.org>
>To: Stefan Hajnoczi <stefanha@redhat.com>
>To: Michael S. Tsirkin <mst@redhat.com>
>To: Jason Wang <jasowang@redhat.com>
>To: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
>To: Eugenio Pérez <eperezma@redhat.com>
>To: K. Y. Srinivasan <kys@microsoft.com>
>To: Haiyang Zhang <haiyangz@microsoft.com>
>To: Wei Liu <wei.liu@kernel.org>
>To: Dexuan Cui <decui@microsoft.com>
>To: Bryan Tan <bryan-bt.tan@broadcom.com>
>To: Vishnu Dasa <vishnu.dasa@broadcom.com>
>To: Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
>Cc: virtualization@lists.linux.dev
>Cc: netdev@vger.kernel.org
>Cc: linux-kselftest@vger.kernel.org
>Cc: linux-kernel@vger.kernel.org
>Cc: kvm@vger.kernel.org
>Cc: linux-hyperv@vger.kernel.org
>Cc: berrange@redhat.com
>
>Changes in v8:
>- Break generic cleanup/refactoring patches into standalone series,
> remove those from this series
Yep, thanks for splitting the series. I'll review it ASAP since it's a
dependency.
I was at GSoC mentor summit last week, so I'm bit busy with the backlog,
but I'll do my best to review both series this week.
Thanks,
Stefano
>- Link to dependency: https://lore.kernel.org/all/20251022-vsock-selftests-fixes-and-improvements-v1-0-edeb179d6463@meta.com/
>- Link to v7: https://lore.kernel.org/r/20251021-vsock-vmtest-v7-0-0661b7b6f081@meta.com
>
>Changes in v7:
>- fix hv_sock build
>- break out vmtest patches into distinct, more well-scoped patches
>- change `orig_net_mode` to `net_mode`
>- many fixes and style changes in per-patch change sets (see individual
> patches for specific changes)
>- optimize `virtio_vsock_skb_cb` layout
>- update commit messages with more useful descriptions
>- vsock_loopback: use orig_net_mode instead of current net mode
>- add tests for edge cases (ns deletion, mode changing, loopback module
> load ordering)
>- Link to v6: https://lore.kernel.org/r/20250916-vsock-vmtest-v6-0-064d2eb0c89d@meta.com
>
>Changes in v6:
>- define behavior when mode changes to local while socket/VM is alive
>- af_vsock: clarify description of CID behavior
>- af_vsock: use stronger langauge around CID rules (dont use "may")
>- af_vsock: improve naming of buf/buffer
>- af_vsock: improve string length checking on proc writes
>- vsock_loopback: add space in struct to clarify lock protection
>- vsock_loopback: do proper cleanup/unregister on vsock_loopback_exit()
>- vsock_loopback: use virtio_vsock_skb_net() instead of sock_net()
>- vsock_loopback: set loopback to NULL after kfree()
>- vsock_loopback: use pernet_operations and remove callback mechanism
>- vsock_loopback: add macros for "global" and "local"
>- vsock_loopback: fix length checking
>- vmtest.sh: check for namespace support in vmtest.sh
>- Link to v5: https://lore.kernel.org/r/20250827-vsock-vmtest-v5-0-0ba580bede5b@meta.com
>
>Changes in v5:
>- /proc/net/vsock_ns_mode -> /proc/sys/net/vsock/ns_mode
>- vsock_global_net -> vsock_global_dummy_net
>- fix netns lookup in vhost_vsock to respect pid namespaces
>- add callbacks for vsock_loopback to avoid circular dependency
>- vmtest.sh loads vsock_loopback module
>- remove vsock_net_mode_can_set()
>- change vsock_net_write_mode() to return true/false based on success
>- make vsock_net_mode enum instead of u8
>- Link to v4: https://lore.kernel.org/r/20250805-vsock-vmtest-v4-0-059ec51ab111@meta.com
>
>Changes in v4:
>- removed RFC tag
>- implemented loopback support
>- renamed new tests to better reflect behavior
>- completed suite of tests with permutations of ns modes and vsock_test
> as guest/host
>- simplified socat bridging with unix socket instead of tcp + veth
>- only use vsock_test for success case, socat for failure case (context
> in commit message)
>- lots of cleanup
>
>Changes in v3:
>- add notion of "modes"
>- add procfs /proc/net/vsock_ns_mode
>- local and global modes only
>- no /dev/vhost-vsock-netns
>- vmtest.sh already merged, so new patch just adds new tests for NS
>- Link to v2:
> https://lore.kernel.org/kvm/20250312-vsock-netns-v2-0-84bffa1aa97a@gmail.com
>
>Changes in v2:
>- only support vhost-vsock namespaces
>- all g2h namespaces retain old behavior, only common API changes
> impacted by vhost-vsock changes
>- add /dev/vhost-vsock-netns for "opt-in"
>- leave /dev/vhost-vsock to old behavior
>- removed netns module param
>- Link to v1:
> https://lore.kernel.org/r/20200116172428.311437-1-sgarzare@redhat.com
>
>Changes in v1:
>- added 'netns' module param to vsock.ko to enable the
> network namespace support (disabled by default)
>- added 'vsock_net_eq()' to check the "net" assigned to a socket
> only when 'netns' support is enabled
>- Link to RFC: https://patchwork.ozlabs.org/cover/1202235/
>
>---
>Bobby Eshleman (14):
> vsock: a per-net vsock NS mode state
> vsock/virtio: pack struct virtio_vsock_skb_cb
> vsock: add netns to vsock skb cb
> vsock: add netns to vsock core
> vsock/loopback: add netns support
> vsock/virtio: add netns to virtio transport common
> vhost/vsock: add netns support
> selftests/vsock: add namespace helpers to vmtest.sh
> selftests/vsock: prepare vm management helpers for namespaces
> selftests/vsock: add tests for proc sys vsock ns_mode
> selftests/vsock: add namespace tests for CID collisions
> selftests/vsock: add tests for host <-> vm connectivity with namespaces
> selftests/vsock: add tests for namespace deletion and mode changes
> selftests/vsock: add tests for module loading order
>
> MAINTAINERS | 1 +
> drivers/vhost/vsock.c | 48 +-
> include/linux/virtio_vsock.h | 47 +-
> include/net/af_vsock.h | 70 ++-
> include/net/net_namespace.h | 4 +
> include/net/netns/vsock.h | 22 +
> net/vmw_vsock/af_vsock.c | 264 +++++++-
> net/vmw_vsock/virtio_transport.c | 7 +-
> net/vmw_vsock/virtio_transport_common.c | 21 +-
> net/vmw_vsock/vsock_loopback.c | 89 ++-
> tools/testing/selftests/vsock/vmtest.sh | 1044 ++++++++++++++++++++++++++++++-
> 11 files changed, 1532 insertions(+), 85 deletions(-)
>---
>base-commit: 962ac5ca99a5c3e7469215bf47572440402dfd59
>change-id: 20250325-vsock-vmtest-b3a21d2102c2
>prerequisite-message-id: <20251022-vsock-selftests-fixes-and-improvements-v1-0-edeb179d6463@meta.com>
>prerequisite-patch-id: a2eecc3851f2509ed40009a7cab6990c6d7cfff5
>prerequisite-patch-id: 501db2100636b9c8fcb3b64b8b1df797ccbede85
>prerequisite-patch-id: ba1a2f07398a035bc48ef72edda41888614be449
>prerequisite-patch-id: fd5cc5445aca9355ce678e6d2bfa89fab8a57e61
>prerequisite-patch-id: 795ab4432ffb0843e22b580374782e7e0d99b909
>prerequisite-patch-id: 1499d263dc933e75366c09e045d2125ca39f7ddd
>prerequisite-patch-id: f92d99bb1d35d99b063f818a19dcda999152d74c
>prerequisite-patch-id: e3296f38cdba6d903e061cff2bbb3e7615e8e671
>prerequisite-patch-id: bc4662b4710d302d4893f58708820fc2a0624325
>prerequisite-patch-id: f8991f2e98c2661a706183fde6b35e2b8d9aedcf
>prerequisite-patch-id: 44bf9ed69353586d284e5ee63d6fffa30439a698
>prerequisite-patch-id: d50621bc630eeaf608bbaf260370c8dabf6326df
>
>Best regards,
>--
>Bobby Eshleman <bobbyeshleman@meta.com>
>
^ permalink raw reply
* Re: [RFC PATCH net-next v2] net: mana: Handle SKB if TX SGEs exceed hardware limit
From: Aditya Garg @ 2025-10-27 13:28 UTC (permalink / raw)
To: kys, haiyangz, wei.liu, decui, andrew+netdev, davem, edumazet,
kuba, pabeni, longli, kotaranov, horms, shradhagupta, ssengar,
ernis, dipayanroy, shirazsaleem, linux-hyperv, netdev,
linux-kernel, linux-rdma, gargaditya
In-Reply-To: <20251022204325.GA18380@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net>
On 23-10-2025 02:13, Aditya Garg wrote:
> The MANA hardware supports a maximum of 30 scatter-gather entries (SGEs)
> per TX WQE. Exceeding this limit can cause TX failures.
> Add ndo_features_check() callback to validate SKB layout before
> transmission. For GSO SKBs that would exceed the hardware SGE limit, clear
> NETIF_F_GSO_MASK to enforce software segmentation in the stack.
> Add a fallback in mana_start_xmit() to linearize non-GSO SKBs that still
> exceed the SGE limit.
>
> Return NETDEV_TX_BUSY only for -ENOSPC from mana_gd_post_work_request(),
> send other errors to free_sgl_ptr to free resources and record the tx
> drop.
>
> Co-developed-by: Dipayaan Roy <dipayanroy@linux.microsoft.com>
> Signed-off-by: Dipayaan Roy <dipayanroy@linux.microsoft.com>
> Signed-off-by: Aditya Garg <gargaditya@linux.microsoft.com>
> ---
> drivers/net/ethernet/microsoft/mana/mana_en.c | 48 +++++++++++++++++--
> include/net/mana/gdma.h | 6 ++-
> include/net/mana/mana.h | 1 +
> 3 files changed, 49 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c
> index 0142fd98392c..8e23a87a779d 100644
> --- a/drivers/net/ethernet/microsoft/mana/mana_en.c
> +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
> @@ -11,6 +11,7 @@
> #include <linux/mm.h>
> #include <linux/pci.h>
> #include <linux/export.h>
> +#include <linux/skbuff.h>
>
> #include <net/checksum.h>
> #include <net/ip6_checksum.h>
> @@ -289,6 +290,21 @@ netdev_tx_t mana_start_xmit(struct sk_buff *skb, struct net_device *ndev)
> cq = &apc->tx_qp[txq_idx].tx_cq;
> tx_stats = &txq->stats;
>
> + if (MAX_SKB_FRAGS + 2 > MAX_TX_WQE_SGL_ENTRIES &&
> + skb_shinfo(skb)->nr_frags + 2 > MAX_TX_WQE_SGL_ENTRIES) {
> + /* GSO skb with Hardware SGE limit exceeded is not expected here
> + * as they are handled in mana_features_check() callback
> + */
> + if (skb_is_gso(skb))
> + netdev_warn_once(ndev, "GSO enabled skb exceeds max SGE limit\n");
> + if (skb_linearize(skb)) {
> + netdev_warn_once(ndev, "Failed to linearize skb with nr_frags=%d and is_gso=%d\n",
> + skb_shinfo(skb)->nr_frags,
> + skb_is_gso(skb));
> + goto tx_drop_count;
> + }
> + }
> +
> pkg.tx_oob.s_oob.vcq_num = cq->gdma_id;
> pkg.tx_oob.s_oob.vsq_frame = txq->vsq_frame;
>
> @@ -402,8 +418,6 @@ netdev_tx_t mana_start_xmit(struct sk_buff *skb, struct net_device *ndev)
> }
> }
>
> - WARN_ON_ONCE(pkg.wqe_req.num_sge > MAX_TX_WQE_SGL_ENTRIES);
> -
> if (pkg.wqe_req.num_sge <= ARRAY_SIZE(pkg.sgl_array)) {
> pkg.wqe_req.sgl = pkg.sgl_array;
> } else {
> @@ -438,9 +452,13 @@ netdev_tx_t mana_start_xmit(struct sk_buff *skb, struct net_device *ndev)
>
> if (err) {
> (void)skb_dequeue_tail(&txq->pending_skbs);
> + mana_unmap_skb(skb, apc);
> netdev_warn(ndev, "Failed to post TX OOB: %d\n", err);
> - err = NETDEV_TX_BUSY;
> - goto tx_busy;
> + if (err == -ENOSPC) {
> + err = NETDEV_TX_BUSY;
> + goto tx_busy;
> + }
> + goto free_sgl_ptr;
> }
>
> err = NETDEV_TX_OK;
> @@ -478,6 +496,25 @@ netdev_tx_t mana_start_xmit(struct sk_buff *skb, struct net_device *ndev)
> return NETDEV_TX_OK;
> }
>
> +static netdev_features_t mana_features_check(struct sk_buff *skb,
> + struct net_device *ndev,
> + netdev_features_t features)
> +{
> + if (MAX_SKB_FRAGS + 2 > MAX_TX_WQE_SGL_ENTRIES &&
> + skb_shinfo(skb)->nr_frags + 2 > MAX_TX_WQE_SGL_ENTRIES) {
> + /* Exceeds HW SGE limit.
> + * GSO case:
> + * Disable GSO so the stack will software-segment the skb
> + * into smaller skbs that fit the SGE budget.
> + * Non-GSO case:
> + * The xmit path will attempt skb_linearize() as a fallback.
> + */
> + if (skb_is_gso(skb))
> + features &= ~NETIF_F_GSO_MASK;
> + }
> + return features;
> +}
> +
> static void mana_get_stats64(struct net_device *ndev,
> struct rtnl_link_stats64 *st)
> {
> @@ -838,6 +875,7 @@ static const struct net_device_ops mana_devops = {
> .ndo_open = mana_open,
> .ndo_stop = mana_close,
> .ndo_select_queue = mana_select_queue,
> + .ndo_features_check = mana_features_check,
> .ndo_start_xmit = mana_start_xmit,
> .ndo_validate_addr = eth_validate_addr,
> .ndo_get_stats64 = mana_get_stats64,
> @@ -1606,7 +1644,7 @@ static int mana_move_wq_tail(struct gdma_queue *wq, u32 num_units)
> return 0;
> }
>
> -static void mana_unmap_skb(struct sk_buff *skb, struct mana_port_context *apc)
> +void mana_unmap_skb(struct sk_buff *skb, struct mana_port_context *apc)
> {
> struct mana_skb_head *ash = (struct mana_skb_head *)skb->head;
> struct gdma_context *gc = apc->ac->gdma_dev->gdma_context;
> diff --git a/include/net/mana/gdma.h b/include/net/mana/gdma.h
> index 57df78cfbf82..b35ecc58fbab 100644
> --- a/include/net/mana/gdma.h
> +++ b/include/net/mana/gdma.h
> @@ -591,6 +591,9 @@ enum {
> /* Driver can self reset on FPGA Reconfig EQE notification */
> #define GDMA_DRV_CAP_FLAG_1_HANDLE_RECONFIG_EQE BIT(17)
>
> +/* Driver supports linearizing the skb when num_sge exceeds hardware limit */
> +#define GDMA_DRV_CAP_FLAG_1_SKB_LINEARIZE BIT(20)
> +
> #define GDMA_DRV_CAP_FLAGS1 \
> (GDMA_DRV_CAP_FLAG_1_EQ_SHARING_MULTI_VPORT | \
> GDMA_DRV_CAP_FLAG_1_NAPI_WKDONE_FIX | \
> @@ -599,7 +602,8 @@ enum {
> GDMA_DRV_CAP_FLAG_1_DEV_LIST_HOLES_SUP | \
> GDMA_DRV_CAP_FLAG_1_DYNAMIC_IRQ_ALLOC_SUPPORT | \
> GDMA_DRV_CAP_FLAG_1_SELF_RESET_ON_EQE | \
> - GDMA_DRV_CAP_FLAG_1_HANDLE_RECONFIG_EQE)
> + GDMA_DRV_CAP_FLAG_1_HANDLE_RECONFIG_EQE | \
> + GDMA_DRV_CAP_FLAG_1_SKB_LINEARIZE)
>
> #define GDMA_DRV_CAP_FLAGS2 0
>
> diff --git a/include/net/mana/mana.h b/include/net/mana/mana.h
> index 0921485565c0..330e1bb088bb 100644
> --- a/include/net/mana/mana.h
> +++ b/include/net/mana/mana.h
> @@ -580,6 +580,7 @@ int mana_set_bw_clamp(struct mana_port_context *apc, u32 speed,
> void mana_query_phy_stats(struct mana_port_context *apc);
> int mana_pre_alloc_rxbufs(struct mana_port_context *apc, int mtu, int num_queues);
> void mana_pre_dealloc_rxbufs(struct mana_port_context *apc);
> +void mana_unmap_skb(struct sk_buff *skb, struct mana_port_context *apc);
>
> extern const struct ethtool_ops mana_ethtool_ops;
> extern struct dentry *mana_debugfs_root;
Hi Eric,
I hope this approach is okay. If there are no issues, I'll go ahead and
send the patch for final review.
Let me know if you need more time for this RFC.
Regards,
Aditya
^ permalink raw reply
* [PATCH net-next] net: mana: Implement ndo_tx_timeout and serialize queue resets per port.
From: Dipayaan Roy @ 2025-10-27 11:45 UTC (permalink / raw)
To: kys, haiyangz, wei.liu, decui, andrew+netdev, davem, edumazet,
kuba, pabeni, longli, kotaranov, horms, shradhagupta, ssengar,
ernis, shirazsaleem, linux-hyperv, netdev, linux-kernel,
linux-rdma, dipayanroy
Implement .ndo_tx_timeout for MANA so any stalled TX queue can be detected
and a device-controlled port reset for all queues can be scheduled to an
ordered workqueue. The reset for all queues on stall detection is
recomended by hardware team.
The change introduces a single ordered workqueue
("mana_per_port_queue_reset_wq") with WQ_UNBOUND | WQ_MEM_RECLAIM and
queues exactly one work_struct per port onto it. This achieves:
* Global FIFO across all port reset requests (alloc_ordered_workqueue).
* Natural per-port de-duplication: the same work_struct cannot be
queued twice while pending/running.
* Avoids hogging a per-CPU kworker for long, may-sleep reset paths
(WQ_UNBOUND).
* Guarantees forward progress during memory pressure
(WQ_MEM_RECLAIM rescuer).
Signed-off-by: Dipayaan Roy <dipayanroy@linux.microsoft.com>
---
drivers/net/ethernet/microsoft/mana/mana_en.c | 83 +++++++++++++++++++
include/net/mana/gdma.h | 6 +-
include/net/mana/mana.h | 12 +++
3 files changed, 100 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c
index f4fc86f20213..2833f66d8b2b 100644
--- a/drivers/net/ethernet/microsoft/mana/mana_en.c
+++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
@@ -258,6 +258,45 @@ static int mana_get_gso_hs(struct sk_buff *skb)
return gso_hs;
}
+static void mana_per_port_queue_reset_work_handler(struct work_struct *work)
+{
+ struct mana_queue_reset_work *reset_queue_work =
+ container_of(work, struct mana_queue_reset_work, work);
+ struct mana_port_context *apc = reset_queue_work->apc;
+ struct net_device *ndev = apc->ndev;
+ struct mana_context *ac = apc->ac;
+ int err;
+
+ if (!rtnl_trylock()) {
+ /* Someone else holds RTNL, requeue and exit. */
+ queue_work(ac->per_port_queue_reset_wq,
+ &apc->queue_reset_work.work);
+ return;
+ }
+
+ /* Pre-allocate buffers to prevent failure in mana_attach later */
+ err = mana_pre_alloc_rxbufs(apc, ndev->mtu, apc->num_queues);
+ if (err) {
+ netdev_err(ndev, "Insufficient memory for reset post tx stall detection\n");
+ goto out;
+ }
+
+ err = mana_detach(ndev, false);
+ if (err) {
+ netdev_err(ndev, "mana_detach failed: %d\n", err);
+ goto dealloc_pre_rxbufs;
+ }
+
+ err = mana_attach(ndev);
+ if (err)
+ netdev_err(ndev, "mana_attach failed: %d\n", err);
+
+dealloc_pre_rxbufs:
+ mana_pre_dealloc_rxbufs(apc);
+out:
+ rtnl_unlock();
+}
+
netdev_tx_t mana_start_xmit(struct sk_buff *skb, struct net_device *ndev)
{
enum mana_tx_pkt_format pkt_fmt = MANA_SHORT_PKT_FMT;
@@ -762,6 +801,25 @@ static int mana_change_mtu(struct net_device *ndev, int new_mtu)
return err;
}
+static void mana_tx_timeout(struct net_device *netdev, unsigned int txqueue)
+{
+ struct mana_port_context *apc = netdev_priv(netdev);
+ struct mana_context *ac = apc->ac;
+ struct gdma_context *gc = ac->gdma_dev->gdma_context;
+
+ netdev_warn(netdev, "%s(): called on txq: %u\n", __func__, txqueue);
+
+ /* Already in service, hence tx queue reset is not required.*/
+ if (gc->in_service)
+ return;
+
+ /* Note: If there are pending queue reset work for this port(apc),
+ * subsequent request queued up drom here are ignored. This is because
+ * we are using the same work instance per port(apc).
+ */
+ queue_work(ac->per_port_queue_reset_wq, &apc->queue_reset_work.work);
+}
+
static int mana_shaper_set(struct net_shaper_binding *binding,
const struct net_shaper *shaper,
struct netlink_ext_ack *extack)
@@ -844,7 +902,9 @@ static const struct net_device_ops mana_devops = {
.ndo_bpf = mana_bpf,
.ndo_xdp_xmit = mana_xdp_xmit,
.ndo_change_mtu = mana_change_mtu,
+ .ndo_tx_timeout = mana_tx_timeout,
.net_shaper_ops = &mana_shaper_ops,
+
};
static void mana_cleanup_port_context(struct mana_port_context *apc)
@@ -3218,6 +3278,7 @@ static int mana_probe_port(struct mana_context *ac, int port_idx,
ndev->min_mtu = ETH_MIN_MTU;
ndev->needed_headroom = MANA_HEADROOM;
ndev->dev_port = port_idx;
+ ndev->watchdog_timeo = MANA_TXQ_TIMEOUT;
SET_NETDEV_DEV(ndev, gc->dev);
netif_set_tso_max_size(ndev, GSO_MAX_SIZE);
@@ -3255,6 +3316,11 @@ static int mana_probe_port(struct mana_context *ac, int port_idx,
debugfs_create_u32("current_speed", 0400, apc->mana_port_debugfs, &apc->speed);
+ /* Initialize the per port queue reset work.*/
+ apc->queue_reset_work.apc = apc;
+ INIT_WORK(&apc->queue_reset_work.work,
+ mana_per_port_queue_reset_work_handler);
+
return 0;
free_indir:
@@ -3456,6 +3522,15 @@ int mana_probe(struct gdma_dev *gd, bool resuming)
if (ac->num_ports > MAX_PORTS_IN_MANA_DEV)
ac->num_ports = MAX_PORTS_IN_MANA_DEV;
+ ac->per_port_queue_reset_wq =
+ alloc_ordered_workqueue("mana_per_port_queue_reset_wq",
+ WQ_UNBOUND | WQ_MEM_RECLAIM);
+ if (!ac->per_port_queue_reset_wq) {
+ dev_err(dev, "Failed to allocate per port queue reset workqueue\n");
+ err = -ENOMEM;
+ goto out;
+ }
+
if (!resuming) {
for (i = 0; i < ac->num_ports; i++) {
err = mana_probe_port(ac, i, &ac->ports[i]);
@@ -3528,6 +3603,8 @@ void mana_remove(struct gdma_dev *gd, bool suspending)
*/
rtnl_lock();
+ cancel_work_sync(&apc->queue_reset_work.work);
+
err = mana_detach(ndev, false);
if (err)
netdev_err(ndev, "Failed to detach vPort %d: %d\n",
@@ -3547,6 +3624,12 @@ void mana_remove(struct gdma_dev *gd, bool suspending)
free_netdev(ndev);
}
+ if (ac->per_port_queue_reset_wq) {
+ drain_workqueue(ac->per_port_queue_reset_wq);
+ destroy_workqueue(ac->per_port_queue_reset_wq);
+ ac->per_port_queue_reset_wq = NULL;
+ }
+
mana_destroy_eq(ac);
out:
mana_gd_deregister_device(gd);
diff --git a/include/net/mana/gdma.h b/include/net/mana/gdma.h
index 57df78cfbf82..1f8c536ba3be 100644
--- a/include/net/mana/gdma.h
+++ b/include/net/mana/gdma.h
@@ -591,6 +591,9 @@ enum {
/* Driver can self reset on FPGA Reconfig EQE notification */
#define GDMA_DRV_CAP_FLAG_1_HANDLE_RECONFIG_EQE BIT(17)
+/* Driver detects stalled send queues and recovers them */
+#define GDMA_DRV_CAP_FLAG_1_HANDLE_STALL_SQ_RECOVERY BIT(18)
+
#define GDMA_DRV_CAP_FLAGS1 \
(GDMA_DRV_CAP_FLAG_1_EQ_SHARING_MULTI_VPORT | \
GDMA_DRV_CAP_FLAG_1_NAPI_WKDONE_FIX | \
@@ -599,7 +602,8 @@ enum {
GDMA_DRV_CAP_FLAG_1_DEV_LIST_HOLES_SUP | \
GDMA_DRV_CAP_FLAG_1_DYNAMIC_IRQ_ALLOC_SUPPORT | \
GDMA_DRV_CAP_FLAG_1_SELF_RESET_ON_EQE | \
- GDMA_DRV_CAP_FLAG_1_HANDLE_RECONFIG_EQE)
+ GDMA_DRV_CAP_FLAG_1_HANDLE_RECONFIG_EQE | \
+ GDMA_DRV_CAP_FLAG_1_HANDLE_STALL_SQ_RECOVERY)
#define GDMA_DRV_CAP_FLAGS2 0
diff --git a/include/net/mana/mana.h b/include/net/mana/mana.h
index 0921485565c0..9b8f236f27c9 100644
--- a/include/net/mana/mana.h
+++ b/include/net/mana/mana.h
@@ -67,6 +67,11 @@ enum TRI_STATE {
#define MANA_RX_FRAG_ALIGNMENT 64
+/* Timeout value for Txq stall detetcion & recovery used by ndo_tx_timeout.
+ * The value is chosen after considering fpga re-config scenarios.
+ */
+#define MANA_TXQ_TIMEOUT (15 * HZ)
+
struct mana_stats_rx {
u64 packets;
u64 bytes;
@@ -475,13 +480,20 @@ struct mana_context {
struct mana_eq *eqs;
struct dentry *mana_eqs_debugfs;
+ struct workqueue_struct *per_port_queue_reset_wq;
struct net_device *ports[MAX_PORTS_IN_MANA_DEV];
};
+struct mana_queue_reset_work {
+ struct work_struct work; // Work structure
+ struct mana_port_context *apc; // Pointer to the port context
+};
+
struct mana_port_context {
struct mana_context *ac;
struct net_device *ndev;
+ struct mana_queue_reset_work queue_reset_work;
u8 mac_addr[ETH_ALEN];
--
2.43.0
^ permalink raw reply related
* [PATCH] net: mana: Fix incorrect speed reported by debugfs
From: Erni Sri Satya Vennela @ 2025-10-27 10:03 UTC (permalink / raw)
To: kys, haiyangz, wei.liu, decui, andrew+netdev, davem, edumazet,
kuba, pabeni, shradhagupta, ssengar, ernis, dipayanroy,
shirazsaleem, kotaranov, longli, linux-hyperv, netdev,
linux-kernel
Once the netshaper is created for MANA, the current bandwidth
is reported in debugfs like this:
$ sudo ./tools/net/ynl/pyynl/cli.py \
--spec Documentation/netlink/specs/net_shaper.yaml \
--do set \
--json '{"ifindex":'3',
"handle":{ "scope": "netdev", "id":'1' },
"bw-max": 200000000 }'
None
$ sudo cat /sys/kernel/debug/mana/1/vport0/current_speed
200
After the shaper is deleted, it is expected to report
the maximum speed supported by the SKU. But currently it is
reporting 0, which is incorrect.
Fix this inconsistency, by resetting apc->speed to apc->max_speed
during deletion of the shaper object. This will improve
readability and debuggability.
Signed-off-by: Erni Sri Satya Vennela <ernis@linux.microsoft.com>
---
drivers/net/ethernet/microsoft/mana/mana_en.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c
index 0142fd98392c..9d56bfefd755 100644
--- a/drivers/net/ethernet/microsoft/mana/mana_en.c
+++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
@@ -814,7 +814,7 @@ static int mana_shaper_del(struct net_shaper_binding *binding,
/* Reset mana port context parameters */
apc->handle.id = 0;
apc->handle.scope = NET_SHAPER_SCOPE_UNSPEC;
- apc->speed = 0;
+ apc->speed = apc->max_speed;
}
return err;
--
2.43.0
^ permalink raw reply related
* [PATCH AUTOSEL 6.17] clocksource: hyper-v: Skip unnecessary checks for the root partition
From: Sasha Levin @ 2025-10-26 14:49 UTC (permalink / raw)
To: patches, stable
Cc: Wei Liu, Nuno Das Neves, Sasha Levin, kys, haiyangz, decui,
daniel.lezcano, tglx, linux-hyperv, linux-kernel
In-Reply-To: <20251026144958.26750-1-sashal@kernel.org>
From: Wei Liu <wei.liu@kernel.org>
[ Upstream commit 47691ced158ab3a7ce2189b857b19c0c99a9aa80 ]
The HV_ACCESS_TSC_INVARIANT bit is always zero when Linux runs as the
root partition. The root partition will see directly what the hardware
provides.
The old logic in ms_hyperv_init_platform caused the native TSC clock
source to be incorrectly marked as unstable on x86. Fix it.
Skip the unnecessary checks in code for the root partition. Add one
extra comment in code to clarify the behavior.
Reviewed-by: Nuno Das Neves <nunodasneves@linux.microsoft.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
YES – this fix prevents Linux Hyper-V root partitions from unnecessarily
downgrading their primary time source.
- `mark_tsc_unstable()` is now gated by `!hv_root_partition()`
(`arch/x86/kernel/cpu/mshyperv.c:655`), so the native TSC is no longer
flagged as unreliable when the kernel is the Hyper-V root partition.
Without this, hosts always fell back to the slower Hyper-V reference
clock, hurting timekeeping and scheduler precision.
- The Hyper-V clocksource ratings are lowered for either
`HV_ACCESS_TSC_INVARIANT` guests or root partitions
(`drivers/clocksource/hyperv_timer.c:566-569`). That ensures the
hardware TSC regains priority on hosts, matching what the platform
actually guarantees.
- All new behaviour is tightly scoped to the root-partition path; guests
still see the old logic, so regression risk for common deployments is
negligible.
- The change aligns the code with the documented hardware behaviour
(root partitions always see hardware invariant TSC) without
introducing new features, making it an appropriate stable fix. (On
older trees that still expose `hv_root_partition` as a global, this
needs the usual trivial adaptation.)
arch/x86/kernel/cpu/mshyperv.c | 11 ++++++++++-
drivers/clocksource/hyperv_timer.c | 10 +++++++++-
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
index c78f860419d69..25773af116bc4 100644
--- a/arch/x86/kernel/cpu/mshyperv.c
+++ b/arch/x86/kernel/cpu/mshyperv.c
@@ -565,6 +565,11 @@ static void __init ms_hyperv_init_platform(void)
machine_ops.crash_shutdown = hv_machine_crash_shutdown;
#endif
#endif
+ /*
+ * HV_ACCESS_TSC_INVARIANT is always zero for the root partition. Root
+ * partition doesn't need to write to synthetic MSR to enable invariant
+ * TSC feature. It sees what the hardware provides.
+ */
if (ms_hyperv.features & HV_ACCESS_TSC_INVARIANT) {
/*
* Writing to synthetic MSR 0x40000118 updates/changes the
@@ -636,8 +641,12 @@ static void __init ms_hyperv_init_platform(void)
* TSC should be marked as unstable only after Hyper-V
* clocksource has been initialized. This ensures that the
* stability of the sched_clock is not altered.
+ *
+ * HV_ACCESS_TSC_INVARIANT is always zero for the root partition. No
+ * need to check for it.
*/
- if (!(ms_hyperv.features & HV_ACCESS_TSC_INVARIANT))
+ if (!hv_root_partition() &&
+ !(ms_hyperv.features & HV_ACCESS_TSC_INVARIANT))
mark_tsc_unstable("running on Hyper-V");
hardlockup_detector_disable();
diff --git a/drivers/clocksource/hyperv_timer.c b/drivers/clocksource/hyperv_timer.c
index 2edc13ca184e0..10356d4ec55c3 100644
--- a/drivers/clocksource/hyperv_timer.c
+++ b/drivers/clocksource/hyperv_timer.c
@@ -549,14 +549,22 @@ static void __init hv_init_tsc_clocksource(void)
union hv_reference_tsc_msr tsc_msr;
/*
+ * When running as a guest partition:
+ *
* If Hyper-V offers TSC_INVARIANT, then the virtualized TSC correctly
* handles frequency and offset changes due to live migration,
* pause/resume, and other VM management operations. So lower the
* Hyper-V Reference TSC rating, causing the generic TSC to be used.
* TSC_INVARIANT is not offered on ARM64, so the Hyper-V Reference
* TSC will be preferred over the virtualized ARM64 arch counter.
+ *
+ * When running as the root partition:
+ *
+ * There is no HV_ACCESS_TSC_INVARIANT feature. Always lower the rating
+ * of the Hyper-V Reference TSC.
*/
- if (ms_hyperv.features & HV_ACCESS_TSC_INVARIANT) {
+ if ((ms_hyperv.features & HV_ACCESS_TSC_INVARIANT) ||
+ hv_root_partition()) {
hyperv_cs_tsc.rating = 250;
hyperv_cs_msr.rating = 245;
}
--
2.51.0
^ permalink raw reply related
* [PATCH AUTOSEL 6.17] hyperv: Add missing field to hv_output_map_device_interrupt
From: Sasha Levin @ 2025-10-26 14:48 UTC (permalink / raw)
To: patches, stable
Cc: Nuno Das Neves, Michael Kelley, Wei Liu, Sasha Levin, kys,
haiyangz, decui, linux-hyperv
In-Reply-To: <20251026144958.26750-1-sashal@kernel.org>
From: Nuno Das Neves <nunodasneves@linux.microsoft.com>
[ Upstream commit 4cd661c248b6671914ad59e16760bb6d908dfc61 ]
This field is unused, but the correct structure size is needed
when computing the amount of space for the output argument to
reside, so that it does not cross a page boundary.
Signed-off-by: Nuno Das Neves <nunodasneves@linux.microsoft.com>
Reviewed-by: Michael Kelley <mhklinux@outlook.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
YES — The change is a low-risk ABI fix that prevents a real functional
hazard for the new Hyper-V root-partition path.
- `include/hyperv/hvhdk_mini.h:302-305` now models `struct
hv_output_map_device_interrupt` with the host-defined
`ext_status_deprecated[5]` trailer. Without those 40 bytes we under-
represent what the hypervisor actually writes back for
`HVCALL_MAP_DEVICE_INTERRUPT`, so callers reserve too little space for
the result.
- `arch/x86/hyperv/irqdomain.c:21-64` takes the shared per-CPU hypercall
output page (`*this_cpu_ptr(hyperv_pcpu_output_arg)`) and hands it
straight to the hypervisor expecting exactly `sizeof(struct
hv_output_map_device_interrupt)` bytes of room. With the old, shorter
definition the host still stores the extra status words, which can
spill past the area the kernel thinks is free and into whatever other
data has been staged in that page, triggering hypercall failures or
corrupting later outputs.
- The shared-page allocation in `drivers/hv/hv_common.c:470-498` makes
this especially risky: every root-partition hypercall in the kernel
reuses the very same page, and several (`hv_call_get_vp_registers()`,
`hv_call_get_partition_property()`, etc.) rely on the struct
definitions to know how much of that page is safe to use. On big
systems where the IPI/vpset variable header already consumes most of
the page, the missing 40 bytes are enough to push the returned
interrupt descriptor over a page boundary, at which point Hyper-V
rejects the call with `HV_STATUS_INVALID_PARAMETER` and MSI setup in
the nested root partition fails outright.
Given that the regression was introduced with the new root-partition
headers (commit 0bd921a4b4d9c) and the fix is confined to restoring the
correct ABI layout, this should go to stable kernels that carry the
root-partition support. After backporting, run the Hyper-V root-
partition interrupt mapping or nested MSI smoke tests if available.
include/hyperv/hvhdk_mini.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/hyperv/hvhdk_mini.h b/include/hyperv/hvhdk_mini.h
index 42e7876455b5b..858f6a3925b30 100644
--- a/include/hyperv/hvhdk_mini.h
+++ b/include/hyperv/hvhdk_mini.h
@@ -301,6 +301,7 @@ struct hv_input_map_device_interrupt {
/* HV_OUTPUT_MAP_DEVICE_INTERRUPT */
struct hv_output_map_device_interrupt {
struct hv_interrupt_entry interrupt_entry;
+ u64 ext_status_deprecated[5];
} __packed;
/* HV_INPUT_UNMAP_DEVICE_INTERRUPT */
--
2.51.0
^ permalink raw reply related
* [PATCH] hv: fix missing kernel-doc description for 'size' in request_arr_init()
From: kriish.sharma2006 @ 2025-10-25 12:07 UTC (permalink / raw)
To: kys, haiyangz, wei.liu, decui, longli
Cc: linux-hyperv, linux-kernel, Kriish Sharma, kernel test robot
From: Kriish Sharma <kriish.sharma2006@gmail.com>
Add missing kernel-doc entry for the @size parameter in
request_arr_init(), fixing the following documentation warning
reported by the kernel test robot and detected via kernel-doc:
Warning: drivers/hv/channel.c:595 function parameter 'size' not described in 'request_arr_init'
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202503021934.wH1BERla-lkp@intel.com
Signed-off-by: Kriish Sharma <kriish.sharma2006@gmail.com>
---
drivers/hv/channel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c
index 88485d255a42..6821f225248b 100644
--- a/drivers/hv/channel.c
+++ b/drivers/hv/channel.c
@@ -590,7 +590,7 @@ EXPORT_SYMBOL_GPL(vmbus_establish_gpadl);
* keeps track of the next available slot in the array. Initially, each
* slot points to the next one (as in a Linked List). The last slot
* does not point to anything, so its value is U64_MAX by default.
- * @size The size of the array
+ * @size: The size of the array
*/
static u64 *request_arr_init(u32 size)
{
--
2.34.1
^ permalink raw reply related
* [net-next, v3] net: mana: Support HW link state events
From: Haiyang Zhang @ 2025-10-24 1:41 UTC (permalink / raw)
To: linux-hyperv, netdev
Cc: haiyangz, paulros, decui, kys, wei.liu, edumazet, davem, kuba,
pabeni, longli, ssengar, ernis, dipayanroy, kotaranov, horms,
shradhagupta, leon, mlevitsk, yury.norov, shirazsaleem,
andrew+netdev, linux-rdma, linux-kernel
From: Haiyang Zhang <haiyangz@microsoft.com>
Handle the HW link state events received from HW channel, and
set the proper link state accordingly.
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
v3:
Don't stop / start the queues, and use disable_work_sync() as
suggested by Jakub Kicinski.
v2:
Updated link up/down to be symmetric, and other minor changes based
on comments from Andrew Lunn.
---
.../net/ethernet/microsoft/mana/gdma_main.c | 1 +
.../net/ethernet/microsoft/mana/hw_channel.c | 12 +++++
drivers/net/ethernet/microsoft/mana/mana_en.c | 53 +++++++++++++++++--
include/net/mana/gdma.h | 4 +-
include/net/mana/hw_channel.h | 2 +
include/net/mana/mana.h | 4 ++
6 files changed, 70 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/microsoft/mana/gdma_main.c b/drivers/net/ethernet/microsoft/mana/gdma_main.c
index 43f034e180c4..effe0a2f207a 100644
--- a/drivers/net/ethernet/microsoft/mana/gdma_main.c
+++ b/drivers/net/ethernet/microsoft/mana/gdma_main.c
@@ -528,6 +528,7 @@ static void mana_gd_process_eqe(struct gdma_queue *eq)
case GDMA_EQE_HWC_INIT_DONE:
case GDMA_EQE_HWC_SOC_SERVICE:
case GDMA_EQE_RNIC_QP_FATAL:
+ case GDMA_EQE_HWC_SOC_RECONFIG_DATA:
if (!eq->eq.callback)
break;
diff --git a/drivers/net/ethernet/microsoft/mana/hw_channel.c b/drivers/net/ethernet/microsoft/mana/hw_channel.c
index ada6c78a2bef..367e18d71413 100644
--- a/drivers/net/ethernet/microsoft/mana/hw_channel.c
+++ b/drivers/net/ethernet/microsoft/mana/hw_channel.c
@@ -118,6 +118,7 @@ static void mana_hwc_init_event_handler(void *ctx, struct gdma_queue *q_self,
struct gdma_dev *gd = hwc->gdma_dev;
union hwc_init_type_data type_data;
union hwc_init_eq_id_db eq_db;
+ struct mana_context *ac;
u32 type, val;
int ret;
@@ -196,6 +197,17 @@ static void mana_hwc_init_event_handler(void *ctx, struct gdma_queue *q_self,
hwc->hwc_timeout = val;
break;
+ case HWC_DATA_HW_LINK_CONNECT:
+ case HWC_DATA_HW_LINK_DISCONNECT:
+ ac = gd->gdma_context->mana.driver_data;
+ if (!ac)
+ break;
+
+ ac->link_event = type;
+ schedule_work(&ac->link_change_work);
+
+ break;
+
default:
dev_warn(hwc->dev, "Received unknown reconfig type %u\n", type);
break;
diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c
index 0142fd98392c..949aedebc8c3 100644
--- a/drivers/net/ethernet/microsoft/mana/mana_en.c
+++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
@@ -20,6 +20,7 @@
#include <net/mana/mana.h>
#include <net/mana/mana_auxiliary.h>
+#include <net/mana/hw_channel.h>
static DEFINE_IDA(mana_adev_ida);
@@ -84,7 +85,6 @@ static int mana_open(struct net_device *ndev)
/* Ensure port state updated before txq state */
smp_wmb();
- netif_carrier_on(ndev);
netif_tx_wake_all_queues(ndev);
netdev_dbg(ndev, "%s successful\n", __func__);
return 0;
@@ -100,6 +100,45 @@ static int mana_close(struct net_device *ndev)
return mana_detach(ndev, true);
}
+static void mana_link_state_handle(struct work_struct *w)
+{
+ struct mana_context *ac;
+ struct net_device *ndev;
+ bool link_up;
+ int i;
+
+ ac = container_of(w, struct mana_context, link_change_work);
+
+ rtnl_lock();
+
+ if (ac->link_event == HWC_DATA_HW_LINK_CONNECT)
+ link_up = true;
+ else if (ac->link_event == HWC_DATA_HW_LINK_DISCONNECT)
+ link_up = false;
+ else
+ goto out;
+
+ /* Process all ports */
+ for (i = 0; i < ac->num_ports; i++) {
+ ndev = ac->ports[i];
+ if (!ndev)
+ continue;
+
+ if (link_up) {
+ if (!netif_carrier_ok(ndev))
+ netif_carrier_on(ndev);
+
+ __netdev_notify_peers(ndev);
+ } else {
+ if (netif_carrier_ok(ndev))
+ netif_carrier_off(ndev);
+ }
+ }
+
+out:
+ rtnl_unlock();
+}
+
static bool mana_can_tx(struct gdma_queue *wq)
{
return mana_gd_wq_avail_space(wq) >= MAX_TX_WQE_SIZE;
@@ -3059,9 +3098,6 @@ int mana_attach(struct net_device *ndev)
/* Ensure port state updated before txq state */
smp_wmb();
- if (apc->port_is_up)
- netif_carrier_on(ndev);
-
netif_device_attach(ndev);
return 0;
@@ -3154,7 +3190,6 @@ int mana_detach(struct net_device *ndev, bool from_close)
smp_wmb();
netif_tx_disable(ndev);
- netif_carrier_off(ndev);
if (apc->port_st_save) {
err = mana_dealloc_queues(ndev);
@@ -3243,6 +3278,8 @@ static int mana_probe_port(struct mana_context *ac, int port_idx,
goto free_indir;
}
+ netif_carrier_on(ndev);
+
debugfs_create_u32("current_speed", 0400, apc->mana_port_debugfs, &apc->speed);
return 0;
@@ -3431,6 +3468,8 @@ int mana_probe(struct gdma_dev *gd, bool resuming)
if (!resuming) {
ac->num_ports = num_ports;
+
+ INIT_WORK(&ac->link_change_work, mana_link_state_handle);
} else {
if (ac->num_ports != num_ports) {
dev_err(dev, "The number of vPorts changed: %d->%d\n",
@@ -3438,6 +3477,8 @@ int mana_probe(struct gdma_dev *gd, bool resuming)
err = -EPROTO;
goto out;
}
+
+ enable_work(&ac->link_change_work);
}
if (ac->num_ports == 0)
@@ -3500,6 +3541,8 @@ void mana_remove(struct gdma_dev *gd, bool suspending)
int err;
int i;
+ disable_work_sync(&ac->link_change_work);
+
/* adev currently doesn't support suspending, always remove it */
if (gd->adev)
remove_adev(gd);
diff --git a/include/net/mana/gdma.h b/include/net/mana/gdma.h
index 57df78cfbf82..637f42485dba 100644
--- a/include/net/mana/gdma.h
+++ b/include/net/mana/gdma.h
@@ -590,6 +590,7 @@ enum {
/* Driver can self reset on FPGA Reconfig EQE notification */
#define GDMA_DRV_CAP_FLAG_1_HANDLE_RECONFIG_EQE BIT(17)
+#define GDMA_DRV_CAP_FLAG_1_HW_VPORT_LINK_AWARE BIT(6)
#define GDMA_DRV_CAP_FLAGS1 \
(GDMA_DRV_CAP_FLAG_1_EQ_SHARING_MULTI_VPORT | \
@@ -599,7 +600,8 @@ enum {
GDMA_DRV_CAP_FLAG_1_DEV_LIST_HOLES_SUP | \
GDMA_DRV_CAP_FLAG_1_DYNAMIC_IRQ_ALLOC_SUPPORT | \
GDMA_DRV_CAP_FLAG_1_SELF_RESET_ON_EQE | \
- GDMA_DRV_CAP_FLAG_1_HANDLE_RECONFIG_EQE)
+ GDMA_DRV_CAP_FLAG_1_HANDLE_RECONFIG_EQE | \
+ GDMA_DRV_CAP_FLAG_1_HW_VPORT_LINK_AWARE)
#define GDMA_DRV_CAP_FLAGS2 0
diff --git a/include/net/mana/hw_channel.h b/include/net/mana/hw_channel.h
index 83cf93338eb3..16feb39616c1 100644
--- a/include/net/mana/hw_channel.h
+++ b/include/net/mana/hw_channel.h
@@ -24,6 +24,8 @@
#define HWC_INIT_DATA_PF_DEST_CQ_ID 11
#define HWC_DATA_CFG_HWC_TIMEOUT 1
+#define HWC_DATA_HW_LINK_CONNECT 2
+#define HWC_DATA_HW_LINK_DISCONNECT 3
#define HW_CHANNEL_WAIT_RESOURCE_TIMEOUT_MS 30000
diff --git a/include/net/mana/mana.h b/include/net/mana/mana.h
index 0921485565c0..8906901535f5 100644
--- a/include/net/mana/mana.h
+++ b/include/net/mana/mana.h
@@ -477,6 +477,10 @@ struct mana_context {
struct dentry *mana_eqs_debugfs;
struct net_device *ports[MAX_PORTS_IN_MANA_DEV];
+
+ /* Link state change work */
+ struct work_struct link_change_work;
+ u32 link_event;
};
struct mana_port_context {
--
2.34.1
^ permalink raw reply related
* [PATCH net-next v8 11/14] selftests/vsock: add namespace tests for CID collisions
From: Bobby Eshleman @ 2025-10-23 18:27 UTC (permalink / raw)
To: Stefano Garzarella, Shuah Khan, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Stefan Hajnoczi,
Michael S. Tsirkin, Jason Wang, Xuan Zhuo, Eugenio Pérez,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Bryan Tan,
Vishnu Dasa, Broadcom internal kernel review list, Bobby Eshleman
Cc: virtualization, netdev, linux-kselftest, linux-kernel, kvm,
linux-hyperv, berrange, Bobby Eshleman
In-Reply-To: <20251023-vsock-vmtest-v8-0-dea984d02bb0@meta.com>
From: Bobby Eshleman <bobbyeshleman@meta.com>
Add tests to verify CID collision rules across different vsock namespace
modes.
1. Two VMs with the same CID cannot start in different global namespaces
(ns_global_same_cid_fails)
2. Two VMs with the same CID can start in different local namespaces
(ns_local_same_cid_ok)
3. VMs with the same CID can coexist when one is in a global namespace
and another is in a local namespace (ns_global_local_same_cid_ok and
ns_local_global_same_cid_ok)
The tests ns_global_local_same_cid_ok and ns_local_global_same_cid_ok
make sure that ordering does not matter.
The tests use a shared helper function namespaces_can_boot_same_cid()
that attempts to start two VMs with identical CIDs in the specified
namespaces and verifies whether VM initialization failed or succeeded.
Signed-off-by: Bobby Eshleman <bobbyeshleman@meta.com>
---
tools/testing/selftests/vsock/vmtest.sh | 74 +++++++++++++++++++++++++++++++++
1 file changed, 74 insertions(+)
diff --git a/tools/testing/selftests/vsock/vmtest.sh b/tools/testing/selftests/vsock/vmtest.sh
index b775fb0cd4ed..f2a99cde9fb4 100755
--- a/tools/testing/selftests/vsock/vmtest.sh
+++ b/tools/testing/selftests/vsock/vmtest.sh
@@ -44,6 +44,10 @@ readonly TEST_NAMES=(
vm_loopback
ns_host_vsock_ns_mode_ok
ns_host_vsock_ns_mode_write_once_ok
+ ns_global_same_cid_fails
+ ns_local_same_cid_ok
+ ns_global_local_same_cid_ok
+ ns_local_global_same_cid_ok
)
readonly TEST_DESCS=(
# vm_server_host_client
@@ -60,6 +64,18 @@ readonly TEST_DESCS=(
# ns_host_vsock_ns_mode_write_once_ok
"Check /proc/sys/net/vsock/ns_mode is write-once on the host."
+
+ # ns_global_same_cid_fails
+ "Check QEMU fails to start two VMs with same CID in two different global namespaces."
+
+ # ns_local_same_cid_ok
+ "Check QEMU successfully starts two VMs with same CID in two different local namespaces."
+
+ # ns_global_local_same_cid_ok
+ "Check QEMU successfully starts one VM in a global ns and then another VM in a local ns with the same CID."
+
+ # ns_local_global_same_cid_ok
+ "Check QEMU successfully starts one VM in a local ns and then another VM in a global ns with the same CID."
)
readonly USE_SHARED_VM=(vm_server_host_client vm_client_host_server vm_loopback)
@@ -548,6 +564,64 @@ test_ns_host_vsock_ns_mode_ok() {
return "${KSFT_PASS}"
}
+namespaces_can_boot_same_cid() {
+ local ns0=$1
+ local ns1=$2
+ local pidfile1 pidfile2
+ local rc
+
+ pidfile1=$(mktemp $PIDFILE_TEMPLATE)
+ vm_start "${pidfile1}" "${ns0}"
+
+ pidfile2=$(mktemp $PIDFILE_TEMPLATE)
+ vm_start "${pidfile2}" "${ns1}"
+
+ rc=$?
+ terminate_pidfiles "${pidfile1}" "${pidfile2}"
+
+ return $rc
+}
+
+test_ns_global_same_cid_fails() {
+ init_namespaces
+
+ if namespaces_can_boot_same_cid "global0" "global1"; then
+ return "${KSFT_FAIL}"
+ fi
+
+ return "${KSFT_PASS}"
+}
+
+test_ns_local_global_same_cid_ok() {
+ init_namespaces
+
+ if namespaces_can_boot_same_cid "local0" "global0"; then
+ return "${KSFT_PASS}"
+ fi
+
+ return "${KSFT_FAIL}"
+}
+
+test_ns_global_local_same_cid_ok() {
+ init_namespaces
+
+ if namespaces_can_boot_same_cid "global0" "local0"; then
+ return "${KSFT_PASS}"
+ fi
+
+ return "${KSFT_FAIL}"
+}
+
+test_ns_local_same_cid_ok() {
+ init_namespaces
+
+ if namespaces_can_boot_same_cid "local0" "local0"; then
+ return "${KSFT_FAIL}"
+ fi
+
+ return "${KSFT_PASS}"
+}
+
test_ns_host_vsock_ns_mode_write_once_ok() {
add_namespaces
--
2.47.3
^ permalink raw reply related
* [PATCH net-next v8 14/14] selftests/vsock: add tests for module loading order
From: Bobby Eshleman @ 2025-10-23 18:27 UTC (permalink / raw)
To: Stefano Garzarella, Shuah Khan, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Stefan Hajnoczi,
Michael S. Tsirkin, Jason Wang, Xuan Zhuo, Eugenio Pérez,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Bryan Tan,
Vishnu Dasa, Broadcom internal kernel review list, Bobby Eshleman
Cc: virtualization, netdev, linux-kselftest, linux-kernel, kvm,
linux-hyperv, berrange, Bobby Eshleman
In-Reply-To: <20251023-vsock-vmtest-v8-0-dea984d02bb0@meta.com>
From: Bobby Eshleman <bobbyeshleman@meta.com>
Add tests to check that module loading order does not break
vsock_loopback. Because vsock_loopback has some per-namespace data
structure initialization that affects vsock namespace modes, lets make
sure that namespace modes are respected and loopback sockets are
functional even when the namespaces and modes are set prior to loading
the vsock_loopback module.
Signed-off-by: Bobby Eshleman <bobbyeshleman@meta.com>
---
tools/testing/selftests/vsock/vmtest.sh | 138 ++++++++++++++++++++++++++++++++
1 file changed, 138 insertions(+)
diff --git a/tools/testing/selftests/vsock/vmtest.sh b/tools/testing/selftests/vsock/vmtest.sh
index 014cecd93858..9aa3200b160f 100755
--- a/tools/testing/selftests/vsock/vmtest.sh
+++ b/tools/testing/selftests/vsock/vmtest.sh
@@ -68,6 +68,8 @@ readonly TEST_NAMES=(
ns_delete_vm_ok
ns_delete_host_ok
ns_delete_both_ok
+ ns_loopback_global_global_late_module_load_ok
+ ns_loopback_local_local_late_module_load_fails
)
readonly TEST_DESCS=(
# vm_server_host_client
@@ -153,6 +155,12 @@ readonly TEST_DESCS=(
# ns_delete_both_ok
"Check that deleting the VM and host's namespaces does not break the socket connection"
+
+ # ns_loopback_global_global_late_module_load_ok
+ "Test that loopback still works in global namespaces initialized prior to loading the vsock_loopback kmod"
+
+ # ns_loopback_local_local_late_module_load_fails
+ "Test that loopback connections still fail between local namespaces initialized prior to loading the vsock_loopback kmod"
)
readonly USE_SHARED_VM=(vm_server_host_client vm_client_host_server vm_loopback)
@@ -914,6 +922,30 @@ test_ns_diff_local_vm_connect_to_local_host_fails() {
return "${KSFT_FAIL}"
}
+unload_module() {
+ local module=$1
+ local retries=5
+ readonly retries
+ local delay=1
+ local i
+
+ # Sometimes previously executed tests may result in a delayed release
+ # of the reference to the vsock_loopback module and result in the
+ # module being unremovable. For that reason, we use retries to allow
+ # some time for those references to be dropped.
+ for ((i = 0; i < ${retries}; i++)); do
+ modprobe -r "${module}" 2>/dev/null || :
+
+ if [[ "$(lsmod | grep -c ${module})" -eq 0 ]]; then
+ return 0
+ fi
+
+ sleep ${delay}
+ done
+
+ return 1
+}
+
__test_loopback_two_netns() {
local ns0=$1
local ns1=$2
@@ -1266,6 +1298,112 @@ test_ns_delete_both_ok() {
check_ns_changes_dont_break_connection "both" "delete"
}
+test_ns_loopback_global_global_late_module_load_ok() {
+ declare -a pids
+ local unixfile
+ local ns0 ns1
+ local pids
+ local port
+
+ if ! unload_module vsock_loopback; then
+ log_host "Unable to unload vsock_loopback, skipping..."
+ return "${KSFT_SKIP}"
+ fi
+
+ ns0=loopback_ns0
+ ns1=loopback_ns1
+
+ ip netns del "${ns0}" &>/dev/null || :
+ ip netns del "${ns1}" &>/dev/null || :
+ ip netns add "${ns0}"
+ ip netns add "${ns1}"
+ ns_set_mode "${ns0}" global
+ ns_set_mode "${ns1}" global
+ ip netns exec "${ns0}" ip link set dev lo up
+ ip netns exec "${ns1}" ip link set dev lo up
+
+ modprobe vsock_loopback &> /dev/null || :
+
+ unixfile=$(mktemp -u /tmp/XXXX.sock)
+ port=321
+ ip netns exec "${ns1}" \
+ socat TCP-LISTEN:"${port}",fork \
+ UNIX-CONNECT:"${unixfile}" &
+ pids+=($!)
+
+ host_wait_for_listener "${ns1}" "${port}"
+ ip netns exec "${ns0}" socat UNIX-LISTEN:"${unixfile}",fork \
+ TCP-CONNECT:localhost:"${port}" &
+ pids+=($!)
+
+ if ! host_vsock_test "${ns0}" "server" 1 "${port}"; then
+ ip netns del "${ns0}" &>/dev/null || :
+ ip netns del "${ns1}" &>/dev/null || :
+ terminate_pids "${pids[@]}"
+ return "${KSFT_FAIL}"
+ fi
+
+ if ! host_vsock_test "${ns1}" "127.0.0.1" 1 "${port}"; then
+ ip netns del "${ns0}" &>/dev/null || :
+ ip netns del "${ns1}" &>/dev/null || :
+ terminate_pids "${pids[@]}"
+ return "${KSFT_FAIL}"
+ fi
+
+ ip netns del "${ns0}" &>/dev/null || :
+ ip netns del "${ns1}" &>/dev/null || :
+ terminate_pids "${pids[@]}"
+
+ return "${KSFT_PASS}"
+}
+
+test_ns_loopback_local_local_late_module_load_fails() {
+ declare -a pids
+ local ns0 ns1
+ local outfile
+ local pids
+ local rc
+
+ if ! unload_module vsock_loopback; then
+ log_host "Unable to unload vsock_loopback, skipping..."
+ return "${KSFT_SKIP}"
+ fi
+
+ ns0=loopback_ns0
+ ns1=loopback_ns1
+
+ ip netns del "${ns0}" &>/dev/null || :
+ ip netns del "${ns1}" &>/dev/null || :
+ ip netns add "${ns0}"
+ ip netns add "${ns1}"
+ ns_set_mode "${ns0}" local
+ ns_set_mode "${ns1}" local
+
+ modprobe vsock_loopback &> /dev/null || :
+
+ outfile=$(mktemp /tmp/XXXX.vmtest.out)
+ ip netns exec "${ns0}" socat VSOCK-LISTEN:${port} STDOUT \
+ > "${outfile}" 2>/dev/null &
+ pids+=($!)
+
+ echo TEST | \
+ ip netns exec "${ns1}" socat STDIN VSOCK-CONNECT:1:${port} \
+ 2>/dev/null
+
+ if grep -q "TEST" "${outfile}" 2>/dev/null; then
+ rc="${KSFT_FAIL}"
+ else
+ rc="${KSFT_PASS}"
+ fi
+
+ ip netns del "${ns0}" &>/dev/null || :
+ ip netns del "${ns1}" &>/dev/null || :
+ terminate_pids "${pids[@]}"
+ rm -f "${outfile}"
+
+ return "${rc}"
+}
+
shared_vm_test() {
local tname
--
2.47.3
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox