* [PATCH net-next v7 1/3] vmcore: add API to collect hardware dump in second kernel
From: Rahul Lakkireddy @ 2018-05-01 18:27 UTC (permalink / raw)
To: netdev, kexec, linux-fsdevel, linux-kernel
Cc: davem, viro, ebiederm, stephen, akpm, torvalds, ganeshgr,
nirranjan, indranil, Rahul Lakkireddy
In-Reply-To: <cover.1525197407.git.rahul.lakkireddy@chelsio.com>
The sequence of actions done by device drivers to append their device
specific hardware/firmware logs to /proc/vmcore are as follows:
1. During probe (before hardware is initialized), device drivers
register to the vmcore module (via vmcore_add_device_dump()), with
callback function, along with buffer size and log name needed for
firmware/hardware log collection.
2. vmcore module allocates the buffer with requested size. It adds
an Elf note and invokes the device driver's registered callback
function.
3. Device driver collects all hardware/firmware logs into the buffer
and returns control back to vmcore module.
Ensure that the device dump buffer size is always aligned to page size
so that it can be mmaped.
Also, rename alloc_elfnotes_buf() to vmcore_alloc_buf() to make it more
generic and reserve NT_VMCOREDD note type to indicate vmcore device
dump.
Suggested-by: Eric Biederman <ebiederm@xmission.com>.
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
---
v7:
- Removed "CHELSIO" vendor identifier in Elf Note name. Instead,
writing "LINUX".
- Moved vmcoredd_header to new file include/uapi/linux/vmcore.h
- Reworked vmcoredd_header to include Elf Note as part of the header
itself.
- Removed vmcoredd_get_note_size().
- Renamed vmcoredd_write_note() to vmcoredd_write_header().
- Replaced all "unsigned long" with "unsigned int" for device dump
size since max size of Elf Word is u32.
v6:
- Reworked device dump elf note name to contain vendor identifier.
- Added vmcoredd_header that precedes actual dump in the Elf Note.
- Device dump's name is moved inside vmcoredd_header.
v5:
- Removed enabling CONFIG_PROC_VMCORE_DEVICE_DUMP by default and
updated help message to indicate that the driver must be present
in second kernel's initramfs to collect the underlying device
snapshot.
v4:
- Made __vmcore_add_device_dump() static.
- Moved compile check to define vmcore_add_device_dump() to
crash_dump.h to fix compilation when vmcore.c is not compiled in.
- Convert ---help--- to help in Kconfig as indicated by checkpatch.
- Rebased to tip.
v3:
- Dropped sysfs crashdd module.
- Added CONFIG_PROC_VMCORE_DEVICE_DUMP to allow configuring device
dump support.
- Moved logic related to adding dumps from crashdd to vmcore module.
- Rename all crashdd* to vmcoredd*.
v2:
- Added ABI Documentation for crashdd.
- Directly use octal permission instead of macro.
Changes since rfc v2:
- Moved exporting crashdd from procfs to sysfs. Suggested by
Stephen Hemminger <stephen@networkplumber.org>
- Moved code from fs/proc/crashdd.c to fs/crashdd/ directory.
- Replaced all proc API with sysfs API and updated comments.
- Calling driver callback before creating the binary file under
crashdd sysfs.
- Changed binary dump file permission from S_IRUSR to S_IRUGO.
- Changed module name from CRASH_DRIVER_DUMP to CRASH_DEVICE_DUMP.
rfc v2:
- Collecting logs in 2nd kernel instead of during kernel panic.
Suggested by Eric Biederman <ebiederm@xmission.com>.
- Patch added in this series.
fs/proc/Kconfig | 15 +++++
fs/proc/vmcore.c | 140 +++++++++++++++++++++++++++++++++++++++++---
include/linux/crash_dump.h | 18 ++++++
include/linux/kcore.h | 6 ++
include/uapi/linux/elf.h | 1 +
include/uapi/linux/vmcore.h | 16 +++++
6 files changed, 187 insertions(+), 9 deletions(-)
create mode 100644 include/uapi/linux/vmcore.h
diff --git a/fs/proc/Kconfig b/fs/proc/Kconfig
index 1ade1206bb89..0eaeb41453f5 100644
--- a/fs/proc/Kconfig
+++ b/fs/proc/Kconfig
@@ -43,6 +43,21 @@ config PROC_VMCORE
help
Exports the dump image of crashed kernel in ELF format.
+config PROC_VMCORE_DEVICE_DUMP
+ bool "Device Hardware/Firmware Log Collection"
+ depends on PROC_VMCORE
+ default n
+ help
+ After kernel panic, device drivers can collect the device
+ specific snapshot of their hardware or firmware before the
+ underlying devices are initialized in crash recovery kernel.
+ Note that the device driver must be present in the crash
+ recovery kernel's initramfs to collect its underlying device
+ snapshot.
+
+ If you say Y here, the collected device dumps will be added
+ as ELF notes to /proc/vmcore.
+
config PROC_SYSCTL
bool "Sysctl support (/proc/sys)" if EXPERT
depends on PROC_FS
diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c
index a45f0af22a60..60fce8dfe4e3 100644
--- a/fs/proc/vmcore.c
+++ b/fs/proc/vmcore.c
@@ -20,6 +20,7 @@
#include <linux/init.h>
#include <linux/crash_dump.h>
#include <linux/list.h>
+#include <linux/mutex.h>
#include <linux/vmalloc.h>
#include <linux/pagemap.h>
#include <linux/uaccess.h>
@@ -44,6 +45,12 @@ static u64 vmcore_size;
static struct proc_dir_entry *proc_vmcore;
+#ifdef CONFIG_PROC_VMCORE_DEVICE_DUMP
+/* Device Dump list and mutex to synchronize access to list */
+static LIST_HEAD(vmcoredd_list);
+static DEFINE_MUTEX(vmcoredd_mutex);
+#endif /* CONFIG_PROC_VMCORE_DEVICE_DUMP */
+
/*
* Returns > 0 for RAM pages, 0 for non-RAM pages, < 0 on error
* The called function has to take care of module refcounting.
@@ -302,10 +309,8 @@ static const struct vm_operations_struct vmcore_mmap_ops = {
};
/**
- * alloc_elfnotes_buf - allocate buffer for ELF note segment in
- * vmalloc memory
- *
- * @notes_sz: size of buffer
+ * vmcore_alloc_buf - allocate buffer in vmalloc memory
+ * @sizez: size of buffer
*
* If CONFIG_MMU is defined, use vmalloc_user() to allow users to mmap
* the buffer to user-space by means of remap_vmalloc_range().
@@ -313,12 +318,12 @@ static const struct vm_operations_struct vmcore_mmap_ops = {
* If CONFIG_MMU is not defined, use vzalloc() since mmap_vmcore() is
* disabled and there's no need to allow users to mmap the buffer.
*/
-static inline char *alloc_elfnotes_buf(size_t notes_sz)
+static inline char *vmcore_alloc_buf(size_t size)
{
#ifdef CONFIG_MMU
- return vmalloc_user(notes_sz);
+ return vmalloc_user(size);
#else
- return vzalloc(notes_sz);
+ return vzalloc(size);
#endif
}
@@ -665,7 +670,7 @@ static int __init merge_note_headers_elf64(char *elfptr, size_t *elfsz,
return rc;
*notes_sz = roundup(phdr_sz, PAGE_SIZE);
- *notes_buf = alloc_elfnotes_buf(*notes_sz);
+ *notes_buf = vmcore_alloc_buf(*notes_sz);
if (!*notes_buf)
return -ENOMEM;
@@ -851,7 +856,7 @@ static int __init merge_note_headers_elf32(char *elfptr, size_t *elfsz,
return rc;
*notes_sz = roundup(phdr_sz, PAGE_SIZE);
- *notes_buf = alloc_elfnotes_buf(*notes_sz);
+ *notes_buf = vmcore_alloc_buf(*notes_sz);
if (!*notes_buf)
return -ENOMEM;
@@ -1145,6 +1150,120 @@ static int __init parse_crash_elf_headers(void)
return 0;
}
+#ifdef CONFIG_PROC_VMCORE_DEVICE_DUMP
+/**
+ * vmcoredd_write_header - Write vmcore device dump header at the
+ * beginning of the dump's buffer.
+ * @buf: Output buffer where the note is written
+ * @data: Dump info
+ * @size: Size of the dump
+ *
+ * Fills beginning of the dump's buffer with vmcore device dump header.
+ */
+static void vmcoredd_write_header(void *buf, struct vmcoredd_data *data,
+ u32 size)
+{
+ struct vmcoredd_header *vdd_hdr = (struct vmcoredd_header *)buf;
+
+ vdd_hdr->n_namesz = sizeof(vdd_hdr->name);
+ vdd_hdr->n_descsz = size + sizeof(vdd_hdr->dump_name);
+ vdd_hdr->n_type = NT_VMCOREDD;
+
+ strncpy((char *)vdd_hdr->name, VMCOREDD_NOTE_NAME,
+ sizeof(vdd_hdr->name));
+ memcpy(vdd_hdr->dump_name, data->dump_name, sizeof(vdd_hdr->dump_name));
+}
+
+/**
+ * vmcore_add_device_dump - Add a buffer containing device dump to vmcore
+ * @data: dump info.
+ *
+ * Allocate a buffer and invoke the calling driver's dump collect routine.
+ * Write Elf note at the beginning of the buffer to indicate vmcore device
+ * dump and add the dump to global list.
+ */
+static int __vmcore_add_device_dump(struct vmcoredd_data *data)
+{
+ struct vmcoredd_node *dump;
+ void *buf = NULL;
+ size_t data_size;
+ int ret;
+
+ if (!data || !strlen(data->dump_name) ||
+ !data->vmcoredd_callback || !data->size)
+ return -EINVAL;
+
+ dump = vzalloc(sizeof(*dump));
+ if (!dump) {
+ ret = -ENOMEM;
+ goto out_err;
+ }
+
+ /* Keep size of the buffer page aligned so that it can be mmaped */
+ data_size = roundup(sizeof(struct vmcoredd_header) + data->size,
+ PAGE_SIZE);
+
+ /* Allocate buffer for driver's to write their dumps */
+ buf = vmcore_alloc_buf(data_size);
+ if (!buf) {
+ ret = -ENOMEM;
+ goto out_err;
+ }
+
+ vmcoredd_write_header(buf, data, data_size -
+ sizeof(struct vmcoredd_header));
+
+ /* Invoke the driver's dump collection routing */
+ ret = data->vmcoredd_callback(data, buf +
+ sizeof(struct vmcoredd_header));
+ if (ret)
+ goto out_err;
+
+ dump->buf = buf;
+ dump->size = data_size;
+
+ /* Add the dump to driver sysfs list */
+ mutex_lock(&vmcoredd_mutex);
+ list_add_tail(&dump->list, &vmcoredd_list);
+ mutex_unlock(&vmcoredd_mutex);
+
+ return 0;
+
+out_err:
+ if (buf)
+ vfree(buf);
+
+ if (dump)
+ vfree(dump);
+
+ return ret;
+}
+
+int vmcore_add_device_dump(struct vmcoredd_data *data)
+{
+ return __vmcore_add_device_dump(data);
+}
+EXPORT_SYMBOL(vmcore_add_device_dump);
+#endif /* CONFIG_PROC_VMCORE_DEVICE_DUMP */
+
+/* Free all dumps in vmcore device dump list */
+static void vmcore_free_device_dumps(void)
+{
+#ifdef CONFIG_PROC_VMCORE_DEVICE_DUMP
+ mutex_lock(&vmcoredd_mutex);
+ while (!list_empty(&vmcoredd_list)) {
+ struct vmcoredd_node *dump;
+
+ dump = list_first_entry(&vmcoredd_list, struct vmcoredd_node,
+ list);
+ list_del(&dump->list);
+ vfree(dump->buf);
+ vfree(dump);
+ }
+ mutex_unlock(&vmcoredd_mutex);
+#endif /* CONFIG_PROC_VMCORE_DEVICE_DUMP */
+}
+
/* Init function for vmcore module. */
static int __init vmcore_init(void)
{
@@ -1192,4 +1311,7 @@ void vmcore_cleanup(void)
kfree(m);
}
free_elfcorebuf();
+
+ /* clear vmcore device dump list */
+ vmcore_free_device_dumps();
}
diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h
index f7ac2aa93269..3e4ba9d753c8 100644
--- a/include/linux/crash_dump.h
+++ b/include/linux/crash_dump.h
@@ -5,6 +5,7 @@
#include <linux/kexec.h>
#include <linux/proc_fs.h>
#include <linux/elf.h>
+#include <uapi/linux/vmcore.h>
#include <asm/pgtable.h> /* for pgprot_t */
@@ -93,4 +94,21 @@ static inline bool is_kdump_kernel(void) { return 0; }
#endif /* CONFIG_CRASH_DUMP */
extern unsigned long saved_max_pfn;
+
+/* Device Dump information to be filled by drivers */
+struct vmcoredd_data {
+ char dump_name[VMCOREDD_MAX_NAME_BYTES]; /* Unique name of the dump */
+ unsigned int size; /* Size of the dump */
+ /* Driver's registered callback to be invoked to collect dump */
+ int (*vmcoredd_callback)(struct vmcoredd_data *data, void *buf);
+};
+
+#ifdef CONFIG_PROC_VMCORE_DEVICE_DUMP
+int vmcore_add_device_dump(struct vmcoredd_data *data);
+#else
+static inline int vmcore_add_device_dump(struct vmcoredd_data *data)
+{
+ return -EOPNOTSUPP;
+}
+#endif /* CONFIG_PROC_VMCORE_DEVICE_DUMP */
#endif /* LINUX_CRASHDUMP_H */
diff --git a/include/linux/kcore.h b/include/linux/kcore.h
index 80db19d3a505..8de55e4b5ee9 100644
--- a/include/linux/kcore.h
+++ b/include/linux/kcore.h
@@ -28,6 +28,12 @@ struct vmcore {
loff_t offset;
};
+struct vmcoredd_node {
+ struct list_head list; /* List of dumps */
+ void *buf; /* Buffer containing device's dump */
+ unsigned int size; /* Size of the buffer */
+};
+
#ifdef CONFIG_PROC_KCORE
extern void kclist_add(struct kcore_list *, void *, size_t, int type);
#else
diff --git a/include/uapi/linux/elf.h b/include/uapi/linux/elf.h
index e2535d6dcec7..4e12c423b9fe 100644
--- a/include/uapi/linux/elf.h
+++ b/include/uapi/linux/elf.h
@@ -421,6 +421,7 @@ typedef struct elf64_shdr {
#define NT_ARM_SYSTEM_CALL 0x404 /* ARM system call number */
#define NT_ARM_SVE 0x405 /* ARM Scalable Vector Extension registers */
#define NT_ARC_V2 0x600 /* ARCv2 accumulator/extra registers */
+#define NT_VMCOREDD 0x700 /* Vmcore Device Dump Note */
/* Note header in a PT_NOTE section */
typedef struct elf32_note {
diff --git a/include/uapi/linux/vmcore.h b/include/uapi/linux/vmcore.h
new file mode 100644
index 000000000000..f9eab9a37370
--- /dev/null
+++ b/include/uapi/linux/vmcore.h
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _UAPI_VMCORE_H
+#define _UAPI_VMCORE_H
+
+#define VMCOREDD_NOTE_NAME "LINUX"
+#define VMCOREDD_MAX_NAME_BYTES 44
+
+struct vmcoredd_header {
+ __u32 n_namesz; /* Name size */
+ __u32 n_descsz; /* Content size */
+ __u32 n_type; /* NT_VMCOREDD */
+ __u8 name[8]; /* LINUX\0\0\0 */
+ __u8 dump_name[VMCOREDD_MAX_NAME_BYTES]; /* Device dump's name */
+};
+
+#endif /* _UAPI_VMCORE_H */
--
2.14.1
^ permalink raw reply related
* [PATCH net-next v7 0/3] kernel: add support to collect hardware logs in crash recovery kernel
From: Rahul Lakkireddy @ 2018-05-01 18:27 UTC (permalink / raw)
To: netdev-u79uwXL29TY76Z2rM5mHXA,
kexec-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-fsdevel-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
Cc: indranil-ut6Up61K2wZBDgjK7y7TUQ, nirranjan-ut6Up61K2wZBDgjK7y7TUQ,
stephen-OTpzqLSitTUnbdJkjeBofR2eb7JE58TQ,
ganeshgr-ut6Up61K2wZBDgjK7y7TUQ, Rahul Lakkireddy,
ebiederm-aS9lmoZGLiVWk0Htik3J/w,
akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
davem-fT/PcQaiUtIeIZ0/mPfg9Q,
viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn
On production servers running variety of workloads over time, kernel
panic can happen sporadically after days or even months. It is
important to collect as much debug logs as possible to root cause
and fix the problem, that may not be easy to reproduce. Snapshot of
underlying hardware/firmware state (like register dump, firmware
logs, adapter memory, etc.), at the time of kernel panic will be very
helpful while debugging the culprit device driver.
This series of patches add new generic framework that enable device
drivers to collect device specific snapshot of the hardware/firmware
state of the underlying device in the crash recovery kernel. In crash
recovery kernel, the collected logs are added as elf notes to
/proc/vmcore, which is copied by user space scripts for post-analysis.
The sequence of actions done by device drivers to append their device
specific hardware/firmware logs to /proc/vmcore are as follows:
1. During probe (before hardware is initialized), device drivers
register to the vmcore module (via vmcore_add_device_dump()), with
callback function, along with buffer size and log name needed for
firmware/hardware log collection.
2. vmcore module allocates the buffer with requested size. It adds
an elf note and invokes the device driver's registered callback
function.
3. Device driver collects all hardware/firmware logs into the buffer
and returns control back to vmcore module.
The device specific hardware/firmware logs can be seen as elf notes
with note type 0x700, as shown below:
# readelf -n /proc/vmcore
Displaying notes found at file offset 0x00001000 with length 0x040032c0:
Owner Data size Description
LINUX 0x02000fec Unknown note type: (0x00000700)
LINUX 0x02000fec Unknown note type: (0x00000700)
CORE 0x00000150 NT_PRSTATUS (prstatus structure)
CORE 0x00000150 NT_PRSTATUS (prstatus structure)
CORE 0x00000150 NT_PRSTATUS (prstatus structure)
CORE 0x00000150 NT_PRSTATUS (prstatus structure)
CORE 0x00000150 NT_PRSTATUS (prstatus structure)
CORE 0x00000150 NT_PRSTATUS (prstatus structure)
CORE 0x00000150 NT_PRSTATUS (prstatus structure)
CORE 0x00000150 NT_PRSTATUS (prstatus structure)
VMCOREINFO 0x00000785 Unknown note type: (0x00000000)
Patch 1 adds API to vmcore module to allow drivers to register callback
to collect the device specific hardware/firmware logs. The logs will
be added to /proc/vmcore as elf notes.
Patch 2 updates read and mmap logic to append device specific hardware/
firmware logs as elf notes.
Patch 3 shows a cxgb4 driver example using the API to collect
hardware/firmware logs in crash recovery kernel, before hardware is
initialized.
Thanks,
Rahul
---
v7:
- Removed "CHELSIO" vendor identifier in Elf Note name. Instead,
writing "LINUX".
- Moved vmcoredd_header to new file include/uapi/linux/vmcore.h
- Reworked vmcoredd_header to include Elf Note as part of the header
itself.
- Removed vmcoredd_get_note_size().
- Renamed vmcoredd_write_note() to vmcoredd_write_header().
- Replaced all "unsigned long" with "unsigned int" for device dump
size since max size of Elf Word is u32.
v6:
- Reworked device dump elf note name to contain vendor identifier.
- Added vmcoredd_header that precedes actual dump in the Elf Note.
- Device dump's name is moved inside vmcoredd_header.
- Added "CHELSIO" string as vendor identifier in the Elf Note name
for cxgb4 device dumps.
v5:
- Removed enabling CONFIG_PROC_VMCORE_DEVICE_DUMP by default and
updated help message.
v4:
- Made __vmcore_add_device_dump() static.
- Moved compile check to define vmcore_add_device_dump() to
crash_dump.h to fix compilation when vmcore.c is not compiled in.
- Convert ---help--- to help in Kconfig as indicated by checkpatch.
- Rebased to tip.
v3:
- Dropped sysfs crashdd module.
- Exported dumps as elf notes. Suggested by Eric Biederman
<ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>. Added as patch 2 in this version.
- Added CONFIG_PROC_VMCORE_DEVICE_DUMP to allow configuring device
dump support.
- Moved logic related to adding dumps from crashdd to vmcore module.
- Rename all crashdd* to vmcoredd*.
- Updated comments.
v2:
- Added ABI Documentation for crashdd.
- Directly use octal permission instead of macro.
Changes since rfc v2:
- Moved exporting crashdd from procfs to sysfs. Suggested by
Stephen Hemminger <stephen-OTpzqLSitTUnbdJkjeBofR2eb7JE58TQ@public.gmane.org>
- Moved code from fs/proc/crashdd.c to fs/crashdd/ directory.
- Replaced all proc API with sysfs API and updated comments.
- Calling driver callback before creating the binary file under
crashdd sysfs.
- Changed binary dump file permission from S_IRUSR to S_IRUGO.
- Changed module name from CRASH_DRIVER_DUMP to CRASH_DEVICE_DUMP.
rfc v2:
- Collecting logs in 2nd kernel instead of during kernel panic.
Suggested by Eric Biederman <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>.
- Added new crashdd module that exports /proc/crashdd/ containing
driver's registered hardware/firmware logs in patch 1.
- Replaced the API to allow drivers to register their hardware/firmware
log collect routine in crash recovery kernel in patch 1.
- Updated patch 2 to use the new API in patch 1.
Rahul Lakkireddy (3):
vmcore: add API to collect hardware dump in second kernel
vmcore: append device dumps to vmcore as elf notes
cxgb4: collect hardware dump in second kernel
drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | 4 +
drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c | 25 ++
drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.h | 3 +
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 10 +
fs/proc/Kconfig | 15 +
fs/proc/vmcore.c | 387 ++++++++++++++++++++++-
include/linux/crash_dump.h | 18 ++
include/linux/kcore.h | 6 +
include/uapi/linux/elf.h | 1 +
include/uapi/linux/vmcore.h | 16 +
10 files changed, 472 insertions(+), 13 deletions(-)
create mode 100644 include/uapi/linux/vmcore.h
--
2.14.1
^ permalink raw reply
* Re: [RFC net-next 0/5] Support for PHY test modes
From: Florian Fainelli @ 2018-05-01 18:27 UTC (permalink / raw)
To: Andrew Lunn
Cc: David Miller, netdev, rmk, linux-kernel, cphealy, nikita.yoush,
vivien.didelot, Nisar.Sayed, UNGLinuxDriver
In-Reply-To: <20180501174752.GA1265@lunn.ch>
On 05/01/2018 10:47 AM, Andrew Lunn wrote:
> On Tue, May 01, 2018 at 10:21:54AM -0700, Florian Fainelli wrote:
>> On 04/30/2018 04:24 PM, Andrew Lunn wrote:
>>>> Turning these tests on will typically result in the link partner
>>>> dropping the link with us, and the interface will be non-functional as
>>>> far as the data path is concerned (similar to an isolation mode). This
>>>> might warrant properly reporting that to user-space through e.g: a
>>>> private IFF_* value maybe?
>>>
>>> Hi Florian
>>>
>>> I think a IFF_* value would be a good idea. We want to give the user
>>> some indicate why they don't have working networking. ip link show
>>> showing PHY-TEST-MODE would help.
>>
>> IF_OPER_TESTING as defined in RFC 2863 looks like the correct way to
>> signal that. I did a quick test and setting operstate to
>> IFF_OPER_TESTING seems to correctly get reflected by iproute2/ifconfig
>> which no longer see RUNNING though the interface is still UP.
>
> Hi Florian
>
> I should really play with this.... but is the opstate printed by ip
> link show? Not showing RUNNING is not the best hint something else is
> going on. Actually saying TESTING somewhere is much clearer.
The operstate is settable and gettable from iproute2:
# ip link show gphy
4: gphy@eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue
switchid 00000000 state UP mode DEFAULT group default qlen 1000
# ip link set gphy state testing
Although the kernel refuses to allow user space to set it to something
different from up or down AFAICT. With my local hack to allow setting
operstate from user-space through sysfs, we do see that iproute2
correctly show it:
# echo 4 > /sys/class/net/gphy/operstate
# ip link show gphy
4: gphy@eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500
qdisc noqueue switchid 00000000 state TESTING mode DEFAULT group default
qlen 1000
link/ether 00:10:18:de:38:1f brd ff:ff:ff:ff:ff:ff
but not from ifconfig. I was not too keen on adding a new IFF_* flag
because it usually means there was nothing else that could be done, and
it is disruptive to include/uapi/linux/if.h which I am afraid to break
(especially for non glibc systems).
Do you think that is acceptable? There are lots of things ifconfig can't
report, but at least, the state of the interface would not be "UP".
--
Florian
^ permalink raw reply
* Re: [PATCH RESEND] connector: add parent pid and tgid to coredump and exit events
From: David Miller @ 2018-05-01 18:26 UTC (permalink / raw)
To: sstrogin
Cc: zbr, netdev, linux-kernel, xe-linux-external, jderehag,
matt.helsley
In-Reply-To: <20180430220429.14788-1-sstrogin@cisco.com>
From: Stefan Strogin <sstrogin@cisco.com>
Date: Tue, 1 May 2018 01:04:29 +0300
> The intention is to get notified of process failures as soon
> as possible, before a possible core dumping (which could be very long)
> (e.g. in some process-manager). Coredump and exit process events
> are perfect for such use cases (see 2b5faa4c553f "connector: Added
> coredumping event to the process connector").
>
> The problem is that for now the process-manager cannot know the parent
> of a dying process using connectors. This could be useful if the
> process-manager should monitor for failures only children of certain
> parents, so we could filter the coredump and exit events by parent
> process and/or thread ID.
>
> Add parent pid and tgid to coredump and exit process connectors event
> data.
>
> Signed-off-by: Stefan Strogin <sstrogin@cisco.com>
> Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Applied to net-next, thank you.
^ permalink raw reply
* Re: [RFC v2 bpf-next 5/9] net/ipv6: Add fib6_lookup
From: David Ahern @ 2018-05-01 18:25 UTC (permalink / raw)
To: Vincent Bernat
Cc: netdev, borkmann, ast, davem, shm, roopa, brouer, toke,
john.fastabend
In-Reply-To: <m3wownckdr.fsf@luffy.cx>
On 5/1/18 12:15 PM, Vincent Bernat wrote:
> ❦ 29 avril 2018 11:07 -0700, David Ahern <dsahern@gmail.com> :
>
>> +struct fib6_info *fib6_lookup(struct net *net, int oif, struct flowi6 *fl6,
>> + int flags)
>
> Maybe an EXPORT_SYMBOL_GPL? There is one for __fib_lookup (fib_lookup is
> an inline function).
>
There needs to be an in-tree user relying on it. My intention is to
convert rt6_lookup to fib6_lookup; as I recall all of those just want
the egress device and do not need a dst based response. That might
provide the in-tree user - depending on how the conversion is done.
And I presume you are asking for your benchmark modules. I can send you
my diffs and results.
^ permalink raw reply
* Re: [PATCH net-next] net: core: Inline netdev_features_size_check()
From: David Miller @ 2018-05-01 18:24 UTC (permalink / raw)
To: f.fainelli; +Cc: netdev, stephen
In-Reply-To: <20180430212005.28204-1-f.fainelli@gmail.com>
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Mon, 30 Apr 2018 14:20:05 -0700
> We do not require this inline function to be used in multiple different
> locations, just inline it where it gets used in register_netdevice().
>
> Suggested-by: David Miller <davem@davemloft.net>
> Suggested-by: Stephen Hemminger <stephen@networkplumber.org>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Yeah that looks a lot better, applied, thanks Florian.
^ permalink raw reply
* Re: [PATCH] ipv6: Allow non-gateway ECMP for IPv6
From: David Miller @ 2018-05-01 18:23 UTC (permalink / raw)
To: Thomas.Winter; +Cc: netdev, dsahern, kuznet, yoshfuji
In-Reply-To: <20180430211529.8295-1-Thomas.Winter@alliedtelesis.co.nz>
From: Thomas Winter <Thomas.Winter@alliedtelesis.co.nz>
Date: Tue, 1 May 2018 09:15:29 +1200
> It is valid to have static routes where the nexthop
> is an interface not an address such as tunnels.
> For IPv4 it was possible to use ECMP on these routes
> but not for IPv6.
>
> Signed-off-by: Thomas Winter <Thomas.Winter@alliedtelesis.co.nz>
Applied, thank you.
^ permalink raw reply
* Re: [PATCH net-next] udp: disable gso with no_check_tx
From: David Miller @ 2018-05-01 18:21 UTC (permalink / raw)
To: willemdebruijn.kernel; +Cc: netdev, willemb
In-Reply-To: <20180430195836.69378-1-willemdebruijn.kernel@gmail.com>
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Date: Mon, 30 Apr 2018 15:58:36 -0400
> From: Willem de Bruijn <willemb@google.com>
>
> Syzbot managed to send a udp gso packet without checksum offload into
> the gso stack by disabling tx checksum (UDP_NO_CHECK6_TX).
Impressive...
> This triggered the skb_warn_bad_offload.
>
> RIP: 0010:skb_warn_bad_offload+0x2bc/0x600 net/core/dev.c:2658
> skb_gso_segment include/linux/netdevice.h:4038 [inline]
> validate_xmit_skb+0x54d/0xd90 net/core/dev.c:3120
> __dev_queue_xmit+0xbf8/0x34c0 net/core/dev.c:3577
> dev_queue_xmit+0x17/0x20 net/core/dev.c:3618
>
> UDP_NO_CHECK6_TX sets skb->ip_summed to CHECKSUM_NONE just after the
> udp gso integrity checks in udp_(v6_)send_skb. Extend those checks to
> catch and fail in this case.
>
> After the integrity checks jump directly to the CHECKSUM_PARTIAL case
> to avoid reading the no_check_tx flags again (a TOCTTOU race).
>
> Fixes: bec1f6f69736 ("udp: generate gso with UDP_SEGMENT")
> Signed-off-by: Willem de Bruijn <willemb@google.com>
Applied, thanks Willem.
^ permalink raw reply
* Re: [PATCH v2] ethtool: fix a potential missing-check bug
From: David Miller @ 2018-05-01 18:19 UTC (permalink / raw)
To: wang6495
Cc: kjlu, f.fainelli, andrew, ecree, rmk+kernel, alan.brady, stephen,
eugenia, inbark, vidya.chowdary, ynorov, viro, netdev,
linux-kernel
In-Reply-To: <1525109474-5595-1-git-send-email-wang6495@umn.edu>
From: Wenwen Wang <wang6495@umn.edu>
Date: Mon, 30 Apr 2018 12:31:13 -0500
> In ethtool_get_rxnfc(), the object "info" is firstly copied from
> user-space. If the FLOW_RSS flag is set in the member field flow_type of
> "info" (and cmd is ETHTOOL_GRXFH), info needs to be copied again from
> user-space because FLOW_RSS is newer and has new definition, as mentioned
> in the comment. However, given that the user data resides in user-space, a
> malicious user can race to change the data after the first copy. By doing
> so, the user can inject inconsistent data. For example, in the second
> copy, the FLOW_RSS flag could be cleared in the field flow_type of "info".
> In the following execution, "info" will be used in the function
> ops->get_rxnfc(). Such inconsistent data can potentially lead to unexpected
> information leakage since ops->get_rxnfc() will prepare various types of
> data according to flow_type, and the prepared data will be eventually
> copied to user-space. This inconsistent data may also cause undefined
> behaviors based on how ops->get_rxnfc() is implemented.
>
> This patch simply re-verifies the flow_type field of "info" after the
> second copy. If the value is not as expected, an error code will be
> returned.
>
> Signed-off-by: Wenwen Wang <wang6495@umn.edu>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH] net/mlx4: fix spelling mistake: "failedi" -> "failed"
From: David Miller @ 2018-05-01 18:17 UTC (permalink / raw)
To: colin.king; +Cc: tariqt, netdev, linux-rdma, kernel-janitors, linux-kernel
In-Reply-To: <20180430162945.5274-1-colin.king@canonical.com>
From: Colin King <colin.king@canonical.com>
Date: Mon, 30 Apr 2018 17:29:45 +0100
> From: Colin Ian King <colin.king@canonical.com>
>
> trivial fix to spelling mistake in mlx4_warn message.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Applied, thanks Colin.
^ permalink raw reply
* Re: [RFC v2 bpf-next 5/9] net/ipv6: Add fib6_lookup
From: Vincent Bernat @ 2018-05-01 18:15 UTC (permalink / raw)
To: David Ahern
Cc: netdev, borkmann, ast, davem, shm, roopa, brouer, toke,
john.fastabend
In-Reply-To: <20180429180752.15428-6-dsahern@gmail.com>
❦ 29 avril 2018 11:07 -0700, David Ahern <dsahern@gmail.com> :
> +struct fib6_info *fib6_lookup(struct net *net, int oif, struct flowi6 *fl6,
> + int flags)
Maybe an EXPORT_SYMBOL_GPL? There is one for __fib_lookup (fib_lookup is
an inline function).
--
Use the "telephone test" for readability.
- The Elements of Programming Style (Kernighan & Plauger)
^ permalink raw reply
* Re: [PATCH net-next V2] cls_flower: Support multiple masks per priority
From: David Miller @ 2018-05-01 18:14 UTC (permalink / raw)
To: paulb
Cc: jiri, xiyou.wangcong, jhs, netdev, kliteyn, roid, shahark, markb,
ogerlitz
In-Reply-To: <1525087710-17495-1-git-send-email-paulb@mellanox.com>
From: Paul Blakey <paulb@mellanox.com>
Date: Mon, 30 Apr 2018 14:28:30 +0300
> Currently flower doesn't support inserting filters with different masks
> on a single priority, even if the actual flows (key + mask) inserted
> aren't overlapping, as with the use case of offloading openvswitch
> datapath flows. Instead one must go up one level, and assign different
> priorities for each mask, which will create a different flower
> instances.
>
> This patch opens flower to support more than one mask per priority,
> and a single flower instance. It does so by adding another hash table
> on top of the existing one which will store the different masks,
> and the filters that share it.
>
> The user is left with the responsibility of ensuring non overlapping
> flows, otherwise precedence is not guaranteed.
>
> Signed-off-by: Paul Blakey <paulb@mellanox.com>
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
> ---
>
> Changes:
> V1 -> V2: in fl_init, removed unnessecry err variable, just return direct result instead.
> in fl_mask_range, removed extra new line.
> commit msg, spelling.
Applied, thanks.
^ permalink raw reply
* Re: [RFC net-next 0/5] Support for PHY test modes
From: David Miller @ 2018-05-01 18:06 UTC (permalink / raw)
To: f.fainelli
Cc: andrew, netdev, rmk, linux-kernel, cphealy, nikita.yoush,
vivien.didelot, Nisar.Sayed, UNGLinuxDriver
In-Reply-To: <19a6bf90-03d5-aa63-5f35-3b26801b79a9@gmail.com>
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Tue, 1 May 2018 10:21:54 -0700
> On 04/30/2018 04:24 PM, Andrew Lunn wrote:
>>> Turning these tests on will typically result in the link partner
>>> dropping the link with us, and the interface will be non-functional as
>>> far as the data path is concerned (similar to an isolation mode). This
>>> might warrant properly reporting that to user-space through e.g: a
>>> private IFF_* value maybe?
>>
>> Hi Florian
>>
>> I think a IFF_* value would be a good idea. We want to give the user
>> some indicate why they don't have working networking. ip link show
>> showing PHY-TEST-MODE would help.
>
> IF_OPER_TESTING as defined in RFC 2863 looks like the correct way to
> signal that. I did a quick test and setting operstate to
> IFF_OPER_TESTING seems to correctly get reflected by iproute2/ifconfig
> which no longer see RUNNING though the interface is still UP. If we
> couple that with a proper phy_stop(), this would IMHO be consistent from
> an user experience perspective.
>
> David, would that look reasonable to you?
Yes, it does.
^ permalink raw reply
* Re: [PATCH] vhost: make msg padding explicit
From: David Miller @ 2018-05-01 18:05 UTC (permalink / raw)
To: mst; +Cc: linux-kernel, kevin, jasowang, kvm, virtualization, netdev
In-Reply-To: <20180501201841-mutt-send-email-mst@kernel.org>
From: "Michael S. Tsirkin" <mst@redhat.com>
Date: Tue, 1 May 2018 20:19:19 +0300
> On Tue, May 01, 2018 at 11:28:22AM -0400, David Miller wrote:
>> From: "Michael S. Tsirkin" <mst@redhat.com>
>> Date: Fri, 27 Apr 2018 19:02:05 +0300
>>
>> > There's a 32 bit hole just after type. It's best to
>> > give it a name, this way compiler is forced to initialize
>> > it with rest of the structure.
>> >
>> > Reported-by: Kevin Easton <kevin@guarana.org>
>> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
>>
>> Michael, will you be sending this directly to Linus or would you like
>> me to apply it to net or net-next?
>>
>> Thanks.
>
> I'd prefer you to apply it for net and cc stable if possible.
Ok, applied, and added to my -stable submission queue.
^ permalink raw reply
* Re: [PATCH net-next 0/2] bridge: FDB: Notify about removal of non-user-added entries
From: Andrew Lunn @ 2018-05-01 17:54 UTC (permalink / raw)
To: Petr Machata
Cc: netdev, ivecera, davem, stephen, vivien.didelot, f.fainelli, jiri
In-Reply-To: <cover.1525194039.git.petrm@mellanox.com>
On Tue, May 01, 2018 at 07:04:19PM +0200, Petr Machata wrote:
> Device drivers may generally need to keep in sync with bridge's FDB. In
> particular, for its offload of tc mirror action where the mirrored-to
> device is a gretap device, mlxsw needs to listen to a number of events.
> SWITCHDEV_FDB_{ADD,DEL}_TO_DEVICE would be a natural notification to
> listen to in order to keep up with FDB updates.
>
> However, for removal of FDB entries added due to device activity (as
> opposed to explicit addition through "bridge fdb add" or similar), there
> are no notifications.
Hi Petr
Could you explain this some more. Why is mlxsw special in that it
needs this, but other drivers don't. The b53 driver supports tc
mirror, for example.
Andrew
^ permalink raw reply
* Re: [PATCH net-next 1/2] switchdev: Add fdb.added_by_user to switchdev notifications
From: Nikolay Aleksandrov @ 2018-05-01 17:49 UTC (permalink / raw)
To: Petr Machata, netdev
Cc: ivecera, davem, stephen, andrew, vivien.didelot, f.fainelli, jiri
In-Reply-To: <eeca97d95fb615675a0687e5268c588e0d233de5.1525194039.git.petrm@mellanox.com>
On 01/05/18 20:04, Petr Machata wrote:
> The following patch enables sending notifications also for events on FDB
> entries that weren't added by the user. Give the drivers the information
> necessary to distinguish between the two origins of FDB entries.
>
> To maintain the current behavior, have switchdev-implementing drivers
> bail out on notifications about non-user-added FDB entries. In case of
> mlxsw driver, allow a call to mlxsw_sp_span_respin() so that SPAN over
> bridge catches up with the changed FDB.
>
> Signed-off-by: Petr Machata <petrm@mellanox.com>
> ---
> drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c | 4 ++++
> drivers/net/ethernet/rocker/rocker_main.c | 2 ++
> include/net/switchdev.h | 1 +
> net/bridge/br_switchdev.c | 10 +++++++---
> net/dsa/slave.c | 5 ++++-
> 5 files changed, 18 insertions(+), 4 deletions(-)
>
Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
^ permalink raw reply
* Re: [PATCH net-next 2/2] net: bridge: Notify about !added_by_user FDB entries
From: Nikolay Aleksandrov @ 2018-05-01 17:49 UTC (permalink / raw)
To: Petr Machata, netdev
Cc: ivecera, davem, stephen, andrew, vivien.didelot, f.fainelli, jiri,
stephen, bridge@lists.linux-foundation.org
In-Reply-To: <8934024270c83055e1e0e9468aafa3fe5e35e745.1525194039.git.petrm@mellanox.com>
On 01/05/18 20:04, Petr Machata wrote:
> Do not automatically bail out on sending notifications about activity on
> non-user-added FDB entries. Instead, notify about this activity except
> for cases where the activity itself originates in a notification, to
> avoid sending duplicate notifications.
>
> Signed-off-by: Petr Machata <petrm@mellanox.com>
> ---
> net/bridge/br.c | 4 ++--
> net/bridge/br_fdb.c | 40 +++++++++++++++++++++++++++-------------
> net/bridge/br_private.h | 4 ++--
> net/bridge/br_switchdev.c | 2 +-
> 4 files changed, 32 insertions(+), 18 deletions(-)
>
Hi Petr,
We already have 7 different fdb delete functions, I'm really not a fan of
adding yet another one for such trivial change.
Why don't you just add the new notify parameter to the already existing
fdb_delete() ? (actually about the name see below)
IMO it's confusing - if one wants a notification then use fdb_delete() or __fdb_delete(true)
vs __fdb_delete(false) if a notification is not required. I think simply having the last
parameter everywhere for fdb_delete() shows the intention clearer and avoids another
fdb delete function.
Another point, the notify parameter has a confusing name in this context because
you're controlling the switchdev notifications not the rtnetlink ones. I'd suggest
changing the name to something more descriptive like swdev_notify, otherwise you
could get the funny end result of calling __fdb_notify() with notify == false which
to me means don't notify. :-)
Also please add the bridge maintainers to the CC list.
Thanks,
Nik
^ permalink raw reply
* Re: [RFC net-next 0/5] Support for PHY test modes
From: Andrew Lunn @ 2018-05-01 17:47 UTC (permalink / raw)
To: Florian Fainelli
Cc: David Miller, netdev, rmk, linux-kernel, cphealy, nikita.yoush,
vivien.didelot, Nisar.Sayed, UNGLinuxDriver
In-Reply-To: <19a6bf90-03d5-aa63-5f35-3b26801b79a9@gmail.com>
On Tue, May 01, 2018 at 10:21:54AM -0700, Florian Fainelli wrote:
> On 04/30/2018 04:24 PM, Andrew Lunn wrote:
> >> Turning these tests on will typically result in the link partner
> >> dropping the link with us, and the interface will be non-functional as
> >> far as the data path is concerned (similar to an isolation mode). This
> >> might warrant properly reporting that to user-space through e.g: a
> >> private IFF_* value maybe?
> >
> > Hi Florian
> >
> > I think a IFF_* value would be a good idea. We want to give the user
> > some indicate why they don't have working networking. ip link show
> > showing PHY-TEST-MODE would help.
>
> IF_OPER_TESTING as defined in RFC 2863 looks like the correct way to
> signal that. I did a quick test and setting operstate to
> IFF_OPER_TESTING seems to correctly get reflected by iproute2/ifconfig
> which no longer see RUNNING though the interface is still UP.
Hi Florian
I should really play with this.... but is the opstate printed by ip
link show? Not showing RUNNING is not the best hint something else is
going on. Actually saying TESTING somewhere is much clearer.
Andrew
^ permalink raw reply
* [PATCH] net: ethernet: ti: cpsw: fix packet leaking in dual_mac mode
From: Grygorii Strashko @ 2018-05-01 17:41 UTC (permalink / raw)
To: David S. Miller, netdev
Cc: Sekhar Nori, linux-kernel, linux-omap, Grygorii Strashko
In dual_mac mode packets arrived on one port should not be forwarded by
switch hw to another port. Only Linux Host can forward packets between
ports. The below test case (reported in [1]) shows that packet arrived on
one port can be leaked to anoter (reproducible with dual port evms):
- connect port 1 (eth0) to linux Host 0 and run tcpdump or Wireshark
- connect port 2 (eth1) to linux Host 1 with vlan 1 configured
- ping <IPx> from Host 1 through vlan 1 interface.
ARP packets will be seen on Host 0.
Issue happens because dual_mac mode is implemnted using two vlans: 1 (Port
1+Port 0) and 2 (Port 2+Port 0), so there are vlan records created for for
each vlan. By default, the ALE will find valid vlan record in its table
when vlan 1 tagged packet arrived on Port 2 and so forwards packet to all
ports which are vlan 1 members (like Port.
To avoid such behaviorr the ALE VLAN ID Ingress Check need to be enabled
for each external CPSW port (ALE_PORTCTLn.VID_INGRESS_CHECK) so ALE will
drop ingress packets if Rx port is not VLAN member.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
drivers/net/ethernet/ti/cpsw.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 5047f4b..46500a2 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -1340,6 +1340,8 @@ static inline void cpsw_add_dual_emac_def_ale_entries(
cpsw_ale_add_ucast(cpsw->ale, priv->mac_addr,
HOST_PORT_NUM, ALE_VLAN |
ALE_SECURE, slave->port_vlan);
+ cpsw_ale_control_set(cpsw->ale, slave_port,
+ ALE_PORT_DROP_UNKNOWN_VLAN, 1);
}
static void soft_reset_slave(struct cpsw_slave *slave)
--
2.10.5
^ permalink raw reply related
* Re: kTLS in combination with mlx4 is very unstable
From: Andre Tomt @ 2018-05-01 17:41 UTC (permalink / raw)
To: Dave Watson; +Cc: netdev, borisp, Aviad Yehezkel
In-Reply-To: <20180501160908.GA26223@advait-mbp.dhcp.thefacebook.com>
On 01. mai 2018 18:09, Dave Watson wrote:
> On 04/24/18 10:01 AM, Dave Watson wrote:
>> On 04/22/18 11:21 PM, Andre Tomt wrote:
>>> The kernel seems to get increasingly unstable as I load it up with client
>>> connections. At about 9Gbps and 700 connections, it is okay at least for a
>>> while - it might run fine for say 45 minutes. Once it gets to 20 - 30Gbps,
>>> the kernel will usually start spewing OOPSes within minutes and the traffic
>>> drops.
>>>
>>> Some bad interaction between mlx4 and kTLS?
> I tried to repro, but wasn't able to - of course I don't have an mlx4
> test setup. If I manually add a tls_write_space call after
> do_tcp_sendpages, I get a similar stack though.
>
> Something like the following should work, can you test? Thanks
Thank you!
This does indeed seem to have fixed this problem. It has been sustaining
~36Gbps and about 3000 clients for about an hour now without any crashes.
Tested on 4.17-rc3 git snapshot as of a few hours ago.
As for performance I am very happy with kTLS. This is some very cool
stuff. I dig it. I'm getting a bit over 10Gbps per 2.5Ghz Broadwell-DE
core on this low power quad core system. Nearly ideal network conditions
and all the data is hot in pagecache but still. I'm going to have to add
another port. ;-)
^ permalink raw reply
* [PATCH net-next] liquidio VF: indicate that disabling rx vlan offload is not allowed
From: Felix Manlunas @ 2018-05-01 17:32 UTC (permalink / raw)
To: davem
Cc: netdev, raghu.vatsavayi, derek.chickles, satananda.burla,
prasad.kanneganti
From: Raghu Vatsavayi <raghu.vatsavayi@cavium.com>
NIC firmware does not support disabling rx vlan offload, but the VF driver
incorrectly indicates that it is supported. The PF driver already does the
correct indication by clearing the NETIF_F_HW_VLAN_CTAG_RX bit in its
netdev->hw_features. So just do the same thing in the VF.
Signed-off-by: Raghu Vatsavayi <raghu.vatsavayi@cavium.com>
Acked-by: Prasad Kanneganti <prasad.kanneganti@cavium.com>
Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>
---
drivers/net/ethernet/cavium/liquidio/lio_vf_main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
index 08b682b..6295eee 100644
--- a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
+++ b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
@@ -2100,6 +2100,7 @@ static int setup_nic_devices(struct octeon_device *octeon_dev)
netdev->features = (lio->dev_capability & ~NETIF_F_LRO);
netdev->hw_features = lio->dev_capability;
+ netdev->hw_features &= ~NETIF_F_HW_VLAN_CTAG_RX;
/* MTU range: 68 - 16000 */
netdev->min_mtu = LIO_MIN_MTU_SIZE;
^ permalink raw reply related
* RE: [RFC net-next 4/5] net: phy: Add support for IEEE standard test modes
From: Woojung.Huh @ 2018-05-01 17:29 UTC (permalink / raw)
To: f.fainelli, netdev
Cc: andrew, rmk, linux-kernel, davem, cphealy, nikita.yoush,
vivien.didelot, Nisar.Sayed, UNGLinuxDriver
In-Reply-To: <20180428003237.1536-5-f.fainelli@gmail.com>
Hi Florian,
> diff --git a/drivers/net/phy/phy-tests.c b/drivers/net/phy/phy-tests.c
...
> +/* genphy_set_test - Make a PHY enter one of the standard IEEE defined
> + * test modes
> + * @phydev: the PHY device instance
> + * @test: the desired test mode
> + * @data: test specific data (none)
> + *
> + * This function makes the designated @phydev enter the desired standard
> + * 100BaseT2 or 1000BaseT test mode as defined in IEEE 802.3-2012 section TWO
> + * and THREE under 32.6.1.2.1 and 40.6.1.1.2 respectively
> + */
> +int genphy_set_test(struct phy_device *phydev,
> + struct ethtool_phy_test *test, const u8 *data)
> +{
> + u16 shift, base, bmcr = 0;
> + int ret;
> +
> + /* Exit test mode */
> + if (test->mode == PHY_STD_TEST_MODE_NORMAL) {
> + ret = phy_read(phydev, MII_CTRL1000);
> + if (ret < 0)
> + return ret;
> +
> + ret &= ~GENMASK(15, 13);
> +
> + return phy_write(phydev, MII_CTRL1000, ret);
> + }
> +
> + switch (test->mode) {
> + case PHY_STD_TEST_MODE_100BASET2_1:
> + case PHY_STD_TEST_MODE_100BASET2_2:
> + case PHY_STD_TEST_MODE_100BASET2_3:
> + if (!(phydev->supported & PHY_100BT_FEATURES))
> + return -EOPNOTSUPP;
> +
> + shift = 14;
> + base = test->mode - PHY_STD_TEST_MODE_NORMAL;
> + bmcr = BMCR_SPEED100;
> + break;
> +
> + case PHY_STD_TEST_MODE_1000BASET_1:
> + case PHY_STD_TEST_MODE_1000BASET_2:
> + case PHY_STD_TEST_MODE_1000BASET_3:
> + case PHY_STD_TEST_MODE_1000BASET_4:
> + if (!(phydev->supported & PHY_1000BT_FEATURES))
> + return -EOPNOTSUPP;
> +
> + shift = 13;
> + base = test->mode - PHY_STD_TEST_MODE_100BASET2_MAX;
> + bmcr = BMCR_SPEED1000;
> + break;
> +
> + default:
> + /* Let an upper driver deal with additional modes it may
> + * support
> + */
> + return -EOPNOTSUPP;
> + }
> +
> + /* Force speed and duplex */
> + ret = phy_write(phydev, MII_BMCR, bmcr | BMCR_FULLDPLX);
> + if (ret < 0)
> + return ret;
> +
> + /* Set the desired test mode bit */
> + return phy_write(phydev, MII_CTRL1000, (test->mode + base) << shift);
> +}
For now, these are for 100B-T2 & 1000B-TX.
But, other speeds such as 802.3bw/bq/cq have very similar format,
how about make phy_write() to BMCR & CTRL1000 as another function call per speed?
Thanks.
Woojung
^ permalink raw reply
* Re: [RFC net-next 0/5] Support for PHY test modes
From: Florian Fainelli @ 2018-05-01 17:21 UTC (permalink / raw)
To: Andrew Lunn, David Miller
Cc: netdev, rmk, linux-kernel, cphealy, nikita.yoush, vivien.didelot,
Nisar.Sayed, UNGLinuxDriver
In-Reply-To: <20180430232448.GB25602@lunn.ch>
On 04/30/2018 04:24 PM, Andrew Lunn wrote:
>> Turning these tests on will typically result in the link partner
>> dropping the link with us, and the interface will be non-functional as
>> far as the data path is concerned (similar to an isolation mode). This
>> might warrant properly reporting that to user-space through e.g: a
>> private IFF_* value maybe?
>
> Hi Florian
>
> I think a IFF_* value would be a good idea. We want to give the user
> some indicate why they don't have working networking. ip link show
> showing PHY-TEST-MODE would help.
IF_OPER_TESTING as defined in RFC 2863 looks like the correct way to
signal that. I did a quick test and setting operstate to
IFF_OPER_TESTING seems to correctly get reflected by iproute2/ifconfig
which no longer see RUNNING though the interface is still UP. If we
couple that with a proper phy_stop(), this would IMHO be consistent from
an user experience perspective.
David, would that look reasonable to you?
--
Florian
^ permalink raw reply
* [PATCH bpf] bpf: minor fix to selftest test_stacktrace_build_id()
From: Song Liu @ 2018-05-01 17:20 UTC (permalink / raw)
To: netdev; +Cc: Song Liu, kernel-team, Alexei Starovoitov, Daniel Borkmann
1. remove useless parameter list to ./urandom_read
2. add missing "\n" to the end of an error message
Fixes: 81f77fd0deeb ("bpf: add selftest for stackmap with BPF_F_STACK_BUILD_ID")
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Song Liu <songliubraving@fb.com>
---
tools/testing/selftests/bpf/test_progs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/bpf/test_progs.c b/tools/testing/selftests/bpf/test_progs.c
index faadbe2..4123d0a 100644
--- a/tools/testing/selftests/bpf/test_progs.c
+++ b/tools/testing/selftests/bpf/test_progs.c
@@ -1108,7 +1108,7 @@ static void test_stacktrace_build_id(void)
assert(system("dd if=/dev/urandom of=/dev/zero count=4 2> /dev/null")
== 0);
- assert(system("./urandom_read if=/dev/urandom of=/dev/zero count=4 2> /dev/null") == 0);
+ assert(system("./urandom_read") == 0);
/* disable stack trace collection */
key = 0;
val = 1;
@@ -1158,7 +1158,7 @@ static void test_stacktrace_build_id(void)
} while (bpf_map_get_next_key(stackmap_fd, &previous_key, &key) == 0);
CHECK(build_id_matches < 1, "build id match",
- "Didn't find expected build ID from the map");
+ "Didn't find expected build ID from the map\n");
disable_pmu:
ioctl(pmu_fd, PERF_EVENT_IOC_DISABLE);
--
2.9.5
^ permalink raw reply related
* Re: [PATCH] vhost: make msg padding explicit
From: Michael S. Tsirkin @ 2018-05-01 17:19 UTC (permalink / raw)
To: David Miller; +Cc: linux-kernel, kevin, jasowang, kvm, virtualization, netdev
In-Reply-To: <20180501.112822.1871426720257639849.davem@davemloft.net>
On Tue, May 01, 2018 at 11:28:22AM -0400, David Miller wrote:
> From: "Michael S. Tsirkin" <mst@redhat.com>
> Date: Fri, 27 Apr 2018 19:02:05 +0300
>
> > There's a 32 bit hole just after type. It's best to
> > give it a name, this way compiler is forced to initialize
> > it with rest of the structure.
> >
> > Reported-by: Kevin Easton <kevin@guarana.org>
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
>
> Michael, will you be sending this directly to Linus or would you like
> me to apply it to net or net-next?
>
> Thanks.
I'd prefer you to apply it for net and cc stable if possible.
Thanks!
--
MST
^ permalink raw reply
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