* Re: [PATCH bpf-next 2/3] bpf: fix formatting for bpf_get_stack() helper doc
From: David Ahern @ 2018-04-30 15:12 UTC (permalink / raw)
To: Alexei Starovoitov, Quentin Monnet
Cc: daniel, ast, netdev, oss-drivers, Yonghong Song
In-Reply-To: <20180430150833.gt2di56f4jembb2f@ast-mbp.dhcp.thefacebook.com>
On 4/30/18 9:08 AM, Alexei Starovoitov wrote:
>> diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
>> index 530ff6588d8f..8daef7326bb7 100644
>> --- a/include/uapi/linux/bpf.h
>> +++ b/include/uapi/linux/bpf.h
>> @@ -1770,33 +1770,33 @@ union bpf_attr {
>> *
>> * int bpf_get_stack(struct pt_regs *regs, void *buf, u32 size, u64 flags)
>> * Description
>> - * Return a user or a kernel stack in bpf program provided buffer.
>> - * To achieve this, the helper needs *ctx*, which is a pointer
>> + * Return a user or a kernel stack in bpf program provided buffer.
>> + * To achieve this, the helper needs *ctx*, which is a pointer
>
> I still don't quite get the difference.
> It's replacing 2 tabs in above with 1 space + 2 tabs ?
> Can you please teach the python script to accept both?
> I bet that will be recurring mistake and it's impossible to spot in code review.
>
And checkpatch throws an error on the 1 space + 2 tabs so it gets
confusing on which format should be used.
^ permalink raw reply
* [PATCH RFC iproute2-next 2/2] rdma: print provider resource attributes
From: Steve Wise @ 2018-04-30 14:36 UTC (permalink / raw)
To: dsahern, leon; +Cc: stephen, netdev, linux-rdma
In-Reply-To: <cover.1525100473.git.swise@opengridcomputing.com>
This enhancement allows printing rdma device-specific state, if provided
by the kernel. This is done in a generic manner, so rdma tool doesn't
need to know about the details of every type of rdma device.
Provider attributes for a rdma resource are in the form of <key,
[print_type], value> tuples, where the key is a string and the value can
be any supported provider attribute. The print_type attribute, if present,
provides a print format to use vs the standard print format for the type.
For example, the default print type for a PROVIDER_S32 value is "%d ",
but "0x%x " if the print_type of PRINT_TYPE_HEX is included inthe tuple.
Provider resources are only printed when the -dd flag is present.
If -p is present, then the output is formatted to not exceed 80 columns,
otherwise it is printed as a single row to be grep/awk friendly.
Example output:
# rdma resource show qp lqpn 1028 -dd -p
link cxgb4_0/- lqpn 1028 rqpn 0 type RC state RTS rq-psn 0 sq-psn 0 path-mig-state MIGRATED pid 0 comm [nvme_rdma]
sqid 1028 flushed 0 memsize 123968 cidx 85 pidx 85 wq_pidx 106 flush_cidx 85 in_use 0
size 386 flags 0x0 rqid 1029 memsize 16768 cidx 43 pidx 41 wq_pidx 171 msn 44 rqt_hwaddr 0x2a8a5d00
rqt_size 256 in_use 128 size 130 idx 43 wr_id 0xffff881057c03408 idx 40 wr_id 0xffff881057c033f0
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
---
rdma/rdma.c | 7 ++-
rdma/rdma.h | 11 ++++
rdma/res.c | 30 +++------
rdma/utils.c | 194 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 221 insertions(+), 21 deletions(-)
diff --git a/rdma/rdma.c b/rdma/rdma.c
index b43e538..c7c8b83 100644
--- a/rdma/rdma.c
+++ b/rdma/rdma.c
@@ -132,6 +132,7 @@ int main(int argc, char **argv)
const char *batch_file = NULL;
bool pretty_output = false;
bool show_details = false;
+ bool show_provider_details = false;
bool json_output = false;
bool force = false;
char *filename;
@@ -152,7 +153,10 @@ int main(int argc, char **argv)
pretty_output = true;
break;
case 'd':
- show_details = true;
+ if (show_details)
+ show_provider_details = true;
+ else
+ show_details = true;
break;
case 'j':
json_output = true;
@@ -180,6 +184,7 @@ int main(int argc, char **argv)
argv += optind;
rd.show_details = show_details;
+ rd.show_provider_details = show_provider_details;
rd.json_output = json_output;
rd.pretty_output = pretty_output;
diff --git a/rdma/rdma.h b/rdma/rdma.h
index 1908fc4..e9581fe 100644
--- a/rdma/rdma.h
+++ b/rdma/rdma.h
@@ -55,6 +55,7 @@ struct rd {
char **argv;
char *filename;
bool show_details;
+ bool show_provider_details;
struct list_head dev_map_list;
uint32_t dev_idx;
uint32_t port_idx;
@@ -115,4 +116,14 @@ int rd_recv_msg(struct rd *rd, mnl_cb_t callback, void *data, uint32_t seq);
void rd_prepare_msg(struct rd *rd, uint32_t cmd, uint32_t *seq, uint16_t flags);
int rd_dev_init_cb(const struct nlmsghdr *nlh, void *data);
int rd_attr_cb(const struct nlattr *attr, void *data);
+int rd_attr_check(const struct nlattr *attr, int *typep);
+
+/*
+ * Print helpers
+ */
+void print_provider_table(struct rd *rd, struct nlattr *tb);
+void newline(struct rd *rd);
+void newline_indent(struct rd *rd);
+#define MAX_LINE_LENGTH 80
+
#endif /* _RDMA_TOOL_H_ */
diff --git a/rdma/res.c b/rdma/res.c
index 1a0aab6..bc0aef5 100644
--- a/rdma/res.c
+++ b/rdma/res.c
@@ -439,10 +439,8 @@ static int res_qp_parse_cb(const struct nlmsghdr *nlh, void *data)
if (nla_line[RDMA_NLDEV_ATTR_RES_PID])
free(comm);
- if (rd->json_output)
- jsonw_end_array(rd->jw);
- else
- pr_out("\n");
+ print_provider_table(rd, nla_line[RDMA_NLDEV_ATTR_PROVIDER]);
+ newline(rd);
}
return MNL_CB_OK;
}
@@ -678,10 +676,8 @@ static int res_cm_id_parse_cb(const struct nlmsghdr *nlh, void *data)
if (nla_line[RDMA_NLDEV_ATTR_RES_PID])
free(comm);
- if (rd->json_output)
- jsonw_end_array(rd->jw);
- else
- pr_out("\n");
+ print_provider_table(rd, nla_line[RDMA_NLDEV_ATTR_PROVIDER]);
+ newline(rd);
}
return MNL_CB_OK;
}
@@ -804,10 +800,8 @@ static int res_cq_parse_cb(const struct nlmsghdr *nlh, void *data)
if (nla_line[RDMA_NLDEV_ATTR_RES_PID])
free(comm);
- if (rd->json_output)
- jsonw_end_array(rd->jw);
- else
- pr_out("\n");
+ print_provider_table(rd, nla_line[RDMA_NLDEV_ATTR_PROVIDER]);
+ newline(rd);
}
return MNL_CB_OK;
}
@@ -919,10 +913,8 @@ static int res_mr_parse_cb(const struct nlmsghdr *nlh, void *data)
if (nla_line[RDMA_NLDEV_ATTR_RES_PID])
free(comm);
- if (rd->json_output)
- jsonw_end_array(rd->jw);
- else
- pr_out("\n");
+ print_provider_table(rd, nla_line[RDMA_NLDEV_ATTR_PROVIDER]);
+ newline(rd);
}
return MNL_CB_OK;
}
@@ -1004,10 +996,8 @@ static int res_pd_parse_cb(const struct nlmsghdr *nlh, void *data)
if (nla_line[RDMA_NLDEV_ATTR_RES_PID])
free(comm);
- if (rd->json_output)
- jsonw_end_array(rd->jw);
- else
- pr_out("\n");
+ print_provider_table(rd, nla_line[RDMA_NLDEV_ATTR_PROVIDER]);
+ newline(rd);
}
return MNL_CB_OK;
}
diff --git a/rdma/utils.c b/rdma/utils.c
index 49c967f..3d3225c 100644
--- a/rdma/utils.c
+++ b/rdma/utils.c
@@ -11,6 +11,7 @@
#include "rdma.h"
#include <ctype.h>
+#include <inttypes.h>
int rd_argc(struct rd *rd)
{
@@ -393,8 +394,32 @@ static const enum mnl_attr_data_type nldev_policy[RDMA_NLDEV_ATTR_MAX] = {
[RDMA_NLDEV_ATTR_RES_MRLEN] = MNL_TYPE_U64,
[RDMA_NLDEV_ATTR_NDEV_INDEX] = MNL_TYPE_U32,
[RDMA_NLDEV_ATTR_NDEV_NAME] = MNL_TYPE_NUL_STRING,
+ [RDMA_NLDEV_ATTR_PROVIDER] = MNL_TYPE_NESTED,
+ [RDMA_NLDEV_ATTR_PROVIDER_ENTRY] = MNL_TYPE_NESTED,
+ [RDMA_NLDEV_ATTR_PROVIDER_STRING] = MNL_TYPE_NUL_STRING,
+ [RDMA_NLDEV_ATTR_PROVIDER_PRINT_TYPE] = MNL_TYPE_U8,
+ [RDMA_NLDEV_ATTR_PROVIDER_S32] = MNL_TYPE_U32,
+ [RDMA_NLDEV_ATTR_PROVIDER_U32] = MNL_TYPE_U32,
+ [RDMA_NLDEV_ATTR_PROVIDER_S64] = MNL_TYPE_U64,
+ [RDMA_NLDEV_ATTR_PROVIDER_U64] = MNL_TYPE_U64,
};
+int rd_attr_check(const struct nlattr *attr, int *typep)
+{
+ int type;
+
+ if (mnl_attr_type_valid(attr, RDMA_NLDEV_ATTR_MAX) < 0)
+ return MNL_CB_ERROR;
+
+ type = mnl_attr_get_type(attr);
+
+ if (mnl_attr_validate(attr, nldev_policy[type]) < 0)
+ return MNL_CB_ERROR;
+
+ *typep = nldev_policy[type];
+ return MNL_CB_OK;
+}
+
int rd_attr_cb(const struct nlattr *attr, void *data)
{
const struct nlattr **tb = data;
@@ -660,3 +685,172 @@ struct dev_map *dev_map_lookup(struct rd *rd, bool allow_port_index)
free(dev_name);
return dev_map;
}
+
+#define nla_type(attr) ((attr)->nla_type & NLA_TYPE_MASK)
+
+void newline(struct rd *rd)
+{
+ if (rd->json_output)
+ jsonw_end_array(rd->jw);
+ else
+ pr_out("\n");
+}
+
+void newline_indent(struct rd *rd)
+{
+ newline(rd);
+ if (!rd->json_output)
+ pr_out(" ");
+}
+
+static int print_provider_string(struct rd *rd, const char *key_str,
+ const char *val_str)
+{
+ if (rd->json_output) {
+ jsonw_string_field(rd->jw, key_str, val_str);
+ return 0;
+ } else {
+ return pr_out("%s %s ", key_str, val_str);
+ }
+}
+
+static int print_provider_s32(struct rd *rd, const char *key_str, int32_t val,
+ enum rdma_nldev_print_type print_type)
+{
+ if (rd->json_output) {
+ jsonw_int_field(rd->jw, key_str, val);
+ return 0;
+ }
+ switch (print_type) {
+ case RDMA_NLDEV_PRINT_TYPE_UNSPEC:
+ return pr_out("%s %d ", key_str, val);
+ case RDMA_NLDEV_PRINT_TYPE_HEX:
+ return pr_out("%s 0x%x ", key_str, val);
+ default:
+ return -EINVAL;
+ }
+}
+
+static int print_provider_u32(struct rd *rd, const char *key_str, uint32_t val,
+ enum rdma_nldev_print_type print_type)
+{
+ if (rd->json_output) {
+ jsonw_int_field(rd->jw, key_str, val);
+ return 0;
+ }
+ switch (print_type) {
+ case RDMA_NLDEV_PRINT_TYPE_UNSPEC:
+ return pr_out("%s %u ", key_str, val);
+ case RDMA_NLDEV_PRINT_TYPE_HEX:
+ return pr_out("%s 0x%x ", key_str, val);
+ default:
+ return -EINVAL;
+ }
+}
+
+static int print_provider_s64(struct rd *rd, const char *key_str, int64_t val,
+ enum rdma_nldev_print_type print_type)
+{
+ if (rd->json_output) {
+ jsonw_int_field(rd->jw, key_str, val);
+ return 0;
+ }
+ switch (print_type) {
+ case RDMA_NLDEV_PRINT_TYPE_UNSPEC:
+ return pr_out("%s %" PRId64 " ", key_str, val);
+ case RDMA_NLDEV_PRINT_TYPE_HEX:
+ return pr_out("%s 0x%" PRIx64 " ", key_str, val);
+ default:
+ return -EINVAL;
+ }
+}
+
+static int print_provider_u64(struct rd *rd, const char *key_str, uint64_t val,
+ enum rdma_nldev_print_type print_type)
+{
+ if (rd->json_output) {
+ jsonw_int_field(rd->jw, key_str, val);
+ return 0;
+ }
+ switch (print_type) {
+ case RDMA_NLDEV_PRINT_TYPE_UNSPEC:
+ return pr_out("%s %" PRIu64 " ", key_str, val);
+ case RDMA_NLDEV_PRINT_TYPE_HEX:
+ return pr_out("%s 0x%" PRIx64 " ", key_str, val);
+ default:
+ return -EINVAL;
+ }
+}
+
+static int print_provider_entry(struct rd *rd, struct nlattr *key_attr,
+ struct nlattr *val_attr,
+ enum rdma_nldev_print_type print_type)
+{
+ const char *key_str = mnl_attr_get_str(key_attr);
+ int attr_type = nla_type(val_attr);
+
+ switch (attr_type) {
+ case RDMA_NLDEV_ATTR_PROVIDER_STRING:
+ return print_provider_string(rd, key_str,
+ mnl_attr_get_str(val_attr));
+ case RDMA_NLDEV_ATTR_PROVIDER_S32:
+ return print_provider_s32(rd, key_str,
+ mnl_attr_get_u32(val_attr), print_type);
+ case RDMA_NLDEV_ATTR_PROVIDER_U32:
+ return print_provider_u32(rd, key_str,
+ mnl_attr_get_u32(val_attr), print_type);
+ case RDMA_NLDEV_ATTR_PROVIDER_S64:
+ return print_provider_s64(rd, key_str,
+ mnl_attr_get_u64(val_attr), print_type);
+ case RDMA_NLDEV_ATTR_PROVIDER_U64:
+ return print_provider_u64(rd, key_str,
+ mnl_attr_get_u64(val_attr), print_type);
+ }
+ return -EINVAL;
+}
+
+void print_provider_table(struct rd *rd, struct nlattr *tb)
+{
+ int print_type = RDMA_NLDEV_PRINT_TYPE_UNSPEC;
+ struct nlattr *tb_entry, *key = NULL, *val;
+ int type, cc = 0;
+
+ if (!rd->show_provider_details || !tb)
+ return;
+
+ if (rd->pretty_output)
+ newline_indent(rd);
+
+ /*
+ * Provider attrs are tuples of {key, [print-type], value}.
+ * The key must be a string. If print-type is present, it
+ * defines an alternate printf format type vs the native format
+ * for the attribute. And the value can be any available
+ * provider type.
+ */
+ mnl_attr_for_each_nested(tb_entry, tb) {
+
+ if (cc > MAX_LINE_LENGTH) {
+ if (rd->pretty_output)
+ newline_indent(rd);
+ cc = 0;
+ }
+ if (rd_attr_check(tb_entry, &type) != MNL_CB_OK)
+ return;
+ if (!key) {
+ if (type != MNL_TYPE_NUL_STRING)
+ return;
+ key = tb_entry;
+ } else if (type == MNL_TYPE_U8) {
+ print_type = mnl_attr_get_u8(tb_entry);
+ } else {
+ val = tb_entry;
+ cc += print_provider_entry(rd, key, val, print_type);
+ if (cc < 0)
+ return;
+ print_type = RDMA_NLDEV_PRINT_TYPE_UNSPEC;
+ key = NULL;
+ }
+ }
+ return;
+}
--
1.8.3.1
^ permalink raw reply related
* [PATCH RFC iproute2-next 1/2] rdma: update rdma_netlink.h to get provider attrs
From: Steve Wise @ 2018-04-30 14:36 UTC (permalink / raw)
To: dsahern, leon; +Cc: stephen, netdev, linux-rdma
In-Reply-To: <cover.1525100473.git.swise@opengridcomputing.com>
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
---
rdma/include/uapi/rdma/rdma_netlink.h | 37 ++++++++++++++++++++++++++++++++++-
1 file changed, 36 insertions(+), 1 deletion(-)
diff --git a/rdma/include/uapi/rdma/rdma_netlink.h b/rdma/include/uapi/rdma/rdma_netlink.h
index 45474f1..faea9d5 100644
--- a/rdma/include/uapi/rdma/rdma_netlink.h
+++ b/rdma/include/uapi/rdma/rdma_netlink.h
@@ -249,10 +249,22 @@ enum rdma_nldev_command {
RDMA_NLDEV_NUM_OPS
};
+enum {
+ RDMA_NLDEV_ATTR_ENTRY_STRLEN = 16,
+};
+
+enum rdma_nldev_print_type {
+ RDMA_NLDEV_PRINT_TYPE_UNSPEC,
+ RDMA_NLDEV_PRINT_TYPE_HEX,
+};
+
enum rdma_nldev_attr {
/* don't change the order or add anything between, this is ABI! */
RDMA_NLDEV_ATTR_UNSPEC,
+ /* Pad attribute for 64b alignment */
+ RDMA_NLDEV_ATTR_PAD = RDMA_NLDEV_ATTR_UNSPEC,
+
/* Identifier for ib_device */
RDMA_NLDEV_ATTR_DEV_INDEX, /* u32 */
@@ -387,8 +399,31 @@ enum rdma_nldev_attr {
RDMA_NLDEV_ATTR_RES_PD_ENTRY, /* nested table */
RDMA_NLDEV_ATTR_RES_LOCAL_DMA_LKEY, /* u32 */
RDMA_NLDEV_ATTR_RES_UNSAFE_GLOBAL_RKEY, /* u32 */
+ /*
+ * provider-specific attributes.
+ */
+ RDMA_NLDEV_ATTR_PROVIDER, /* nested table */
+ RDMA_NLDEV_ATTR_PROVIDER_ENTRY, /* nested table */
+ RDMA_NLDEV_ATTR_PROVIDER_STRING, /* string */
+ /*
+ * u8 values from enum rdma_nldev_print_type
+ */
+ RDMA_NLDEV_ATTR_PROVIDER_PRINT_TYPE, /* u8 */
+ RDMA_NLDEV_ATTR_PROVIDER_S32, /* s32 */
+ RDMA_NLDEV_ATTR_PROVIDER_U32, /* u32 */
+ RDMA_NLDEV_ATTR_PROVIDER_S64, /* s64 */
+ RDMA_NLDEV_ATTR_PROVIDER_U64, /* u64 */
- /* Netdev information for relevant protocols, like RoCE and iWARP */
+ /*
+ * Provides logical name and index of netdevice which is
+ * connected to physical port. This information is relevant
+ * for RoCE and iWARP.
+ *
+ * The netdevices which are associated with containers are
+ * supposed to be exported together with GID table once it
+ * will be exposed through the netlink. Because the
+ * associated netdevices are properties of GIDs.
+ */
RDMA_NLDEV_ATTR_NDEV_INDEX, /* u32 */
RDMA_NLDEV_ATTR_NDEV_NAME, /* string */
--
1.8.3.1
^ permalink raw reply related
* [PATCH RFC iproute2-next 0/2] RDMA tool provider resource tracking
From: Steve Wise @ 2018-04-30 15:01 UTC (permalink / raw)
To: dsahern, leon; +Cc: stephen, netdev, linux-rdma
Hello,
This series enhances the iproute2 rdma tool to include displaying
provider-specific resource attributes. It is the user-space part of
the kernel provider resource tracking series currently under
review [1].
This is an RFC and should not be merged yet. Once [1] is in the
linux-rdma for-next branch (and all reviewing is complete), I'll post
a final version and request merging.
Thanks,
Steve.
[1] https://www.spinics.net/lists/linux-rdma/msg64013.html
Steve Wise (2):
rdma: update rdma_netlink.h to get provider attrs
rdma: print provider resource attributes
rdma/include/uapi/rdma/rdma_netlink.h | 37 ++++++-
rdma/rdma.c | 7 +-
rdma/rdma.h | 11 ++
rdma/res.c | 30 ++----
rdma/utils.c | 194 ++++++++++++++++++++++++++++++++++
5 files changed, 257 insertions(+), 22 deletions(-)
--
1.8.3.1
^ permalink raw reply
* Re: [PATCH bpf-next 2/3] bpf: fix formatting for bpf_get_stack() helper doc
From: Alexei Starovoitov @ 2018-04-30 15:08 UTC (permalink / raw)
To: Quentin Monnet; +Cc: daniel, ast, netdev, oss-drivers, Yonghong Song
In-Reply-To: <20180430103905.12863-3-quentin.monnet@netronome.com>
On Mon, Apr 30, 2018 at 11:39:04AM +0100, Quentin Monnet wrote:
> Fix formatting (indent) for bpf_get_stack() helper documentation, so
> that the doc is rendered correctly with the Python script.
>
> Fixes: c195651e565a ("bpf: add bpf_get_stack helper")
> Cc: Yonghong Song <yhs@fb.com>
> Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
> ---
>
> Note: The error was a missing space between the '*' marking the
> comments, and the tabs. This expected mixed indent comes from the fact I
> started to write the doc as a RST, then copied my contents (tabs
> included) in the header file and added a " * " (with a space) prefix
> everywhere.
>
> On a second thought, using such indent style was maybe... not my best idea
> ever. Anyway, if indent for documenting eBPF helpers really gets to painful, we
> could relax parsing rules in the Python script to make things easier.
> ---
> include/uapi/linux/bpf.h | 54 ++++++++++++++++++++++++------------------------
> 1 file changed, 27 insertions(+), 27 deletions(-)
>
> diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
> index 530ff6588d8f..8daef7326bb7 100644
> --- a/include/uapi/linux/bpf.h
> +++ b/include/uapi/linux/bpf.h
> @@ -1770,33 +1770,33 @@ union bpf_attr {
> *
> * int bpf_get_stack(struct pt_regs *regs, void *buf, u32 size, u64 flags)
> * Description
> - * Return a user or a kernel stack in bpf program provided buffer.
> - * To achieve this, the helper needs *ctx*, which is a pointer
> + * Return a user or a kernel stack in bpf program provided buffer.
> + * To achieve this, the helper needs *ctx*, which is a pointer
I still don't quite get the difference.
It's replacing 2 tabs in above with 1 space + 2 tabs ?
Can you please teach the python script to accept both?
I bet that will be recurring mistake and it's impossible to spot in code review.
^ permalink raw reply
* Re: [PATCH] connector: add parent pid and tgid to coredump and exit events
From: Evgeniy Polyakov @ 2018-04-30 15:01 UTC (permalink / raw)
To: Stefan Strogin, Jesper Derehag, David Miller
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
xe-linux-external@cisco.com, matt.helsley@gmail.com
In-Reply-To: <32f14672-5715-3e21-ba85-b27dc8d2c6b0@gmail.com>
Stefan, hi
Sorry for delay.
26.04.2018, 15:04, "Stefan Strogin" <stefan.strogin@gmail.com>:
> Hi David, Evgeniy,
>
> Sorry to bother you, but could you please comment about the UAPI change and the patch?
With 4-bytes pid_t everything looks fine, and I do not know arch where pid is larger currently, so it looks safe.
David, please pull it into your tree, or should it go via different path?
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
>> I don't see how it breaks UAPI. The point is that structures
>> coredump_proc_event and exit_proc_event are members of *union*
>> event_data, thus position of the existing data in the structure is
>> unchanged. Furthermore, this change won't increase size of struct
>> proc_event, because comm_proc_event (also a member of event_data) is
>> of bigger size than the changed structures.
>>
>> If I'm wrong, could you please explain what exactly will the change
>> break in UAPI?
>>
>> On 30/03/18 19:59, David Miller wrote:
>>> From: Stefan Strogin <sstrogin@cisco.com>
>>> Date: Thu, 29 Mar 2018 17:12:47 +0300
>>>
>>>> diff --git a/include/uapi/linux/cn_proc.h b/include/uapi/linux/cn_proc.h
>>>> index 68ff25414700..db210625cee8 100644
>>>> --- a/include/uapi/linux/cn_proc.h
>>>> +++ b/include/uapi/linux/cn_proc.h
>>>> @@ -116,12 +116,16 @@ struct proc_event {
>>>> struct coredump_proc_event {
>>>> __kernel_pid_t process_pid;
>>>> __kernel_pid_t process_tgid;
>>>> + __kernel_pid_t parent_pid;
>>>> + __kernel_pid_t parent_tgid;
>>>> } coredump;
>>>>
>>>> struct exit_proc_event {
>>>> __kernel_pid_t process_pid;
>>>> __kernel_pid_t process_tgid;
>>>> __u32 exit_code, exit_signal;
>>>> + __kernel_pid_t parent_pid;
>>>> + __kernel_pid_t parent_tgid;
>>>> } exit;
>>>>
>>>> } event_data;
>>>
>>> I don't think you can add these members without breaking UAPI.
^ permalink raw reply
* [PATCH net-next 4/4] net/smc: determine vlan_id of stacked net_device
From: Ursula Braun @ 2018-04-30 14:51 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390, schwidefsky, heiko.carstens, raspl, ubraun
In-Reply-To: <20180430145119.72479-1-ubraun@linux.ibm.com>
An SMC link group is bound to a specific vlan_id. Its link uses
the RoCE-GIDs established for the specific vlan_id. This patch makes
sure the appropriate vlan_id is determined for stacked scenarios like
for instance a master bonding device with vlan devices enslaved.
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
---
net/smc/smc_core.c | 26 +++++++++++++++++++++++---
1 file changed, 23 insertions(+), 3 deletions(-)
diff --git a/net/smc/smc_core.c b/net/smc/smc_core.c
index d9247765aff3..1f3ea62fac5c 100644
--- a/net/smc/smc_core.c
+++ b/net/smc/smc_core.c
@@ -360,7 +360,8 @@ void smc_lgr_terminate(struct smc_link_group *lgr)
static int smc_vlan_by_tcpsk(struct socket *clcsock, unsigned short *vlan_id)
{
struct dst_entry *dst = sk_dst_get(clcsock->sk);
- int rc = 0;
+ struct net_device *ndev;
+ int i, nest_lvl, rc = 0;
*vlan_id = 0;
if (!dst) {
@@ -372,8 +373,27 @@ static int smc_vlan_by_tcpsk(struct socket *clcsock, unsigned short *vlan_id)
goto out_rel;
}
- if (is_vlan_dev(dst->dev))
- *vlan_id = vlan_dev_vlan_id(dst->dev);
+ ndev = dst->dev;
+ if (is_vlan_dev(ndev)) {
+ *vlan_id = vlan_dev_vlan_id(ndev);
+ goto out_rel;
+ }
+
+ rtnl_lock();
+ nest_lvl = dev_get_nest_level(ndev);
+ for (i = 0; i < nest_lvl; i++) {
+ struct list_head *lower = &ndev->adj_list.lower;
+
+ if (list_empty(lower))
+ break;
+ lower = lower->next;
+ ndev = (struct net_device *)netdev_lower_get_next(ndev, &lower);
+ if (is_vlan_dev(ndev)) {
+ *vlan_id = vlan_dev_vlan_id(ndev);
+ break;
+ }
+ }
+ rtnl_unlock();
out_rel:
dst_release(dst);
--
2.13.5
^ permalink raw reply related
* [PATCH net-next 3/4] net/smc: handle ioctls SIOCINQ, SIOCOUTQ, and SIOCOUTQNSD
From: Ursula Braun @ 2018-04-30 14:51 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390, schwidefsky, heiko.carstens, raspl, ubraun
In-Reply-To: <20180430145119.72479-1-ubraun@linux.ibm.com>
SIOCINQ returns the amount of unread data in the RMB.
SIOCOUTQ returns the amount of unsent or unacked sent data in the send
buffer.
SIOCOUTQNSD returns the amount of data prepared for sending, but
not yet sent.
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
---
net/smc/af_smc.c | 33 ++++++++++++++++++++++++++++++---
1 file changed, 30 insertions(+), 3 deletions(-)
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index 961b8eff9553..823ea3371575 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -29,6 +29,7 @@
#include <net/sock.h>
#include <net/tcp.h>
#include <net/smc.h>
+#include <asm/ioctls.h>
#include "smc.h"
#include "smc_clc.h"
@@ -1389,12 +1390,38 @@ static int smc_ioctl(struct socket *sock, unsigned int cmd,
unsigned long arg)
{
struct smc_sock *smc;
+ int answ;
smc = smc_sk(sock->sk);
- if (smc->use_fallback)
+ if (smc->use_fallback) {
+ if (!smc->clcsock)
+ return -EBADF;
return smc->clcsock->ops->ioctl(smc->clcsock, cmd, arg);
- else
- return sock_no_ioctl(sock, cmd, arg);
+ }
+ switch (cmd) {
+ case SIOCINQ: /* same as FIONREAD */
+ if (smc->sk.sk_state == SMC_LISTEN)
+ return -EINVAL;
+ answ = atomic_read(&smc->conn.bytes_to_rcv);
+ break;
+ case SIOCOUTQ:
+ /* output queue size (not send + not acked) */
+ if (smc->sk.sk_state == SMC_LISTEN)
+ return -EINVAL;
+ answ = smc->conn.sndbuf_size -
+ atomic_read(&smc->conn.sndbuf_space);
+ break;
+ case SIOCOUTQNSD:
+ /* output queue size (not send only) */
+ if (smc->sk.sk_state == SMC_LISTEN)
+ return -EINVAL;
+ answ = smc_tx_prepared_sends(&smc->conn);
+ break;
+ default:
+ return -ENOIOCTLCMD;
+ }
+
+ return put_user(answ, (int __user *)arg);
}
static ssize_t smc_sendpage(struct socket *sock, struct page *page,
--
2.13.5
^ permalink raw reply related
* [PATCH net-next 0/4] net/smc: fixes 2018/04/30
From: Ursula Braun @ 2018-04-30 14:51 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390, schwidefsky, heiko.carstens, raspl, ubraun
From: Ursula Braun <ursula.braun@linux.ibm.com>
Dave,
here are 4 smc patches for net-next covering different areas:
* link health check
* diagnostics for IPv6 smc sockets
* ioctl
* improvement for vlan determination
Thanks, Ursula
Karsten Graul (2):
net/smc: periodic testlink support
net/smc: ipv6 support for smc_diag.c
Ursula Braun (2):
net/smc: handle ioctls SIOCINQ, SIOCOUTQ, and SIOCOUTQNSD
net/smc: determine vlan_id of stacked net_device
net/smc/af_smc.c | 39 +++++++++++++++++++++++++++++-----
net/smc/smc_core.c | 28 +++++++++++++++++++++---
net/smc/smc_core.h | 4 ++++
net/smc/smc_diag.c | 37 ++++++++++++++++++++++++--------
net/smc/smc_llc.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
net/smc/smc_llc.h | 3 +++
net/smc/smc_wr.c | 1 +
7 files changed, 156 insertions(+), 18 deletions(-)
--
2.13.5
^ permalink raw reply
* [PATCH net-next 2/4] net/smc: ipv6 support for smc_diag.c
From: Ursula Braun @ 2018-04-30 14:51 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390, schwidefsky, heiko.carstens, raspl, ubraun
In-Reply-To: <20180430145119.72479-1-ubraun@linux.ibm.com>
From: Karsten Graul <kgraul@linux.ibm.com>
Update smc_diag.c to support ipv6 addresses on the diagnosis interface.
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
---
net/smc/smc_diag.c | 37 ++++++++++++++++++++++++++++---------
1 file changed, 28 insertions(+), 9 deletions(-)
diff --git a/net/smc/smc_diag.c b/net/smc/smc_diag.c
index 427b91c1c964..9a8d0db7bb88 100644
--- a/net/smc/smc_diag.c
+++ b/net/smc/smc_diag.c
@@ -38,17 +38,25 @@ static void smc_diag_msg_common_fill(struct smc_diag_msg *r, struct sock *sk)
{
struct smc_sock *smc = smc_sk(sk);
- r->diag_family = sk->sk_family;
if (!smc->clcsock)
return;
r->id.idiag_sport = htons(smc->clcsock->sk->sk_num);
r->id.idiag_dport = smc->clcsock->sk->sk_dport;
r->id.idiag_if = smc->clcsock->sk->sk_bound_dev_if;
sock_diag_save_cookie(sk, r->id.idiag_cookie);
- memset(&r->id.idiag_src, 0, sizeof(r->id.idiag_src));
- memset(&r->id.idiag_dst, 0, sizeof(r->id.idiag_dst));
- r->id.idiag_src[0] = smc->clcsock->sk->sk_rcv_saddr;
- r->id.idiag_dst[0] = smc->clcsock->sk->sk_daddr;
+ if (sk->sk_protocol == SMCPROTO_SMC6) {
+ r->diag_family = PF_INET6;
+ memcpy(&r->id.idiag_src, &smc->clcsock->sk->sk_v6_rcv_saddr,
+ sizeof(smc->clcsock->sk->sk_v6_rcv_saddr));
+ memcpy(&r->id.idiag_dst, &smc->clcsock->sk->sk_v6_daddr,
+ sizeof(smc->clcsock->sk->sk_v6_daddr));
+ } else {
+ r->diag_family = PF_INET;
+ memset(&r->id.idiag_src, 0, sizeof(r->id.idiag_src));
+ memset(&r->id.idiag_dst, 0, sizeof(r->id.idiag_dst));
+ r->id.idiag_src[0] = smc->clcsock->sk->sk_rcv_saddr;
+ r->id.idiag_dst[0] = smc->clcsock->sk->sk_daddr;
+ }
}
static int smc_diag_msg_attrs_fill(struct sock *sk, struct sk_buff *skb,
@@ -153,7 +161,8 @@ static int __smc_diag_dump(struct sock *sk, struct sk_buff *skb,
return -EMSGSIZE;
}
-static int smc_diag_dump(struct sk_buff *skb, struct netlink_callback *cb)
+static int smc_diag_dump_proto(struct proto *prot, struct sk_buff *skb,
+ struct netlink_callback *cb)
{
struct net *net = sock_net(skb->sk);
struct nlattr *bc = NULL;
@@ -161,8 +170,8 @@ static int smc_diag_dump(struct sk_buff *skb, struct netlink_callback *cb)
struct sock *sk;
int rc = 0;
- read_lock(&smc_proto.h.smc_hash->lock);
- head = &smc_proto.h.smc_hash->ht;
+ read_lock(&prot->h.smc_hash->lock);
+ head = &prot->h.smc_hash->ht;
if (hlist_empty(head))
goto out;
@@ -175,7 +184,17 @@ static int smc_diag_dump(struct sk_buff *skb, struct netlink_callback *cb)
}
out:
- read_unlock(&smc_proto.h.smc_hash->lock);
+ read_unlock(&prot->h.smc_hash->lock);
+ return rc;
+}
+
+static int smc_diag_dump(struct sk_buff *skb, struct netlink_callback *cb)
+{
+ int rc = 0;
+
+ rc = smc_diag_dump_proto(&smc_proto, skb, cb);
+ if (!rc)
+ rc = smc_diag_dump_proto(&smc_proto6, skb, cb);
return rc;
}
--
2.13.5
^ permalink raw reply related
* [PATCH net-next 1/4] net/smc: periodic testlink support
From: Ursula Braun @ 2018-04-30 14:51 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390, schwidefsky, heiko.carstens, raspl, ubraun
In-Reply-To: <20180430145119.72479-1-ubraun@linux.ibm.com>
From: Karsten Graul <kgraul@linux.ibm.com>
Add periodic LLC testlink support to ensure the link is still active.
The interval time is initialized using the value of
sysctl_tcp_keepalive_time.
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
---
net/smc/af_smc.c | 6 ++++--
net/smc/smc_core.c | 2 ++
net/smc/smc_core.h | 4 ++++
net/smc/smc_llc.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
net/smc/smc_llc.h | 3 +++
net/smc/smc_wr.c | 1 +
6 files changed, 75 insertions(+), 3 deletions(-)
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index 20aa4175b9f8..961b8eff9553 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -294,6 +294,7 @@ static void smc_copy_sock_settings_to_smc(struct smc_sock *smc)
static int smc_clnt_conf_first_link(struct smc_sock *smc)
{
+ struct net *net = sock_net(smc->clcsock->sk);
struct smc_link_group *lgr = smc->conn.lgr;
struct smc_link *link;
int rest;
@@ -353,7 +354,7 @@ static int smc_clnt_conf_first_link(struct smc_sock *smc)
if (rc < 0)
return SMC_CLC_DECL_TCL;
- link->state = SMC_LNK_ACTIVE;
+ smc_llc_link_active(link, net->ipv4.sysctl_tcp_keepalive_time);
return 0;
}
@@ -715,6 +716,7 @@ void smc_close_non_accepted(struct sock *sk)
static int smc_serv_conf_first_link(struct smc_sock *smc)
{
+ struct net *net = sock_net(smc->clcsock->sk);
struct smc_link_group *lgr = smc->conn.lgr;
struct smc_link *link;
int rest;
@@ -769,7 +771,7 @@ static int smc_serv_conf_first_link(struct smc_sock *smc)
return rc;
}
- link->state = SMC_LNK_ACTIVE;
+ smc_llc_link_active(link, net->ipv4.sysctl_tcp_keepalive_time);
return 0;
}
diff --git a/net/smc/smc_core.c b/net/smc/smc_core.c
index f44f6803f7ff..d9247765aff3 100644
--- a/net/smc/smc_core.c
+++ b/net/smc/smc_core.c
@@ -310,6 +310,7 @@ static void smc_lgr_free_bufs(struct smc_link_group *lgr)
/* remove a link group */
void smc_lgr_free(struct smc_link_group *lgr)
{
+ smc_llc_link_flush(&lgr->lnk[SMC_SINGLE_LINK]);
smc_lgr_free_bufs(lgr);
smc_link_clear(&lgr->lnk[SMC_SINGLE_LINK]);
kfree(lgr);
@@ -332,6 +333,7 @@ void smc_lgr_terminate(struct smc_link_group *lgr)
struct rb_node *node;
smc_lgr_forget(lgr);
+ smc_llc_link_inactive(&lgr->lnk[SMC_SINGLE_LINK]);
write_lock_bh(&lgr->conns_lock);
node = rb_first(&lgr->conns_all);
diff --git a/net/smc/smc_core.h b/net/smc/smc_core.h
index 07e2a393e6d9..97339f03ba79 100644
--- a/net/smc/smc_core.h
+++ b/net/smc/smc_core.h
@@ -79,6 +79,7 @@ struct smc_link {
dma_addr_t wr_rx_dma_addr; /* DMA address of wr_rx_bufs */
u64 wr_rx_id; /* seq # of last recv WR */
u32 wr_rx_cnt; /* number of WR recv buffers */
+ unsigned long wr_rx_tstamp; /* jiffies when last buf rx */
struct ib_reg_wr wr_reg; /* WR register memory region */
wait_queue_head_t wr_reg_wait; /* wait for wr_reg result */
@@ -101,6 +102,9 @@ struct smc_link {
int llc_confirm_resp_rc; /* rc from conf_resp msg */
struct completion llc_add; /* wait for rx of add link */
struct completion llc_add_resp; /* wait for rx of add link rsp*/
+ struct delayed_work llc_testlink_wrk; /* testlink worker */
+ struct completion llc_testlink_resp; /* wait for rx of testlink */
+ int llc_testlink_time; /* testlink interval */
};
/* For now we just allow one parallel link per link group. The SMC protocol
diff --git a/net/smc/smc_llc.c b/net/smc/smc_llc.c
index ea4b21981b4b..33b4d856f4c6 100644
--- a/net/smc/smc_llc.c
+++ b/net/smc/smc_llc.c
@@ -397,7 +397,8 @@ static void smc_llc_rx_test_link(struct smc_link *link,
struct smc_llc_msg_test_link *llc)
{
if (llc->hd.flags & SMC_LLC_FLAG_RESP) {
- /* unused as long as we don't send this type of msg */
+ if (link->state == SMC_LNK_ACTIVE)
+ complete(&link->llc_testlink_resp);
} else {
smc_llc_send_test_link(link, llc->user_data, SMC_LLC_RESP);
}
@@ -502,6 +503,65 @@ static void smc_llc_rx_handler(struct ib_wc *wc, void *buf)
}
}
+/***************************** worker ****************************************/
+
+static void smc_llc_testlink_work(struct work_struct *work)
+{
+ struct smc_link *link = container_of(to_delayed_work(work),
+ struct smc_link, llc_testlink_wrk);
+ unsigned long next_interval;
+ struct smc_link_group *lgr;
+ unsigned long expire_time;
+ u8 user_data[16] = { 0 };
+ int rc;
+
+ lgr = container_of(link, struct smc_link_group, lnk[SMC_SINGLE_LINK]);
+ if (link->state != SMC_LNK_ACTIVE)
+ return; /* don't reschedule worker */
+ expire_time = link->wr_rx_tstamp + link->llc_testlink_time;
+ if (time_is_after_jiffies(expire_time)) {
+ next_interval = expire_time - jiffies;
+ goto out;
+ }
+ reinit_completion(&link->llc_testlink_resp);
+ smc_llc_send_test_link(link, user_data, SMC_LLC_REQ);
+ /* receive TEST LINK response over RoCE fabric */
+ rc = wait_for_completion_interruptible_timeout(&link->llc_testlink_resp,
+ SMC_LLC_WAIT_TIME);
+ if (rc <= 0) {
+ smc_lgr_terminate(lgr);
+ return;
+ }
+ next_interval = link->llc_testlink_time;
+out:
+ schedule_delayed_work(&link->llc_testlink_wrk, next_interval);
+}
+
+void smc_llc_link_active(struct smc_link *link, int testlink_time)
+{
+ init_completion(&link->llc_testlink_resp);
+ INIT_DELAYED_WORK(&link->llc_testlink_wrk, smc_llc_testlink_work);
+ link->state = SMC_LNK_ACTIVE;
+ if (testlink_time) {
+ link->llc_testlink_time = testlink_time * HZ;
+ schedule_delayed_work(&link->llc_testlink_wrk,
+ link->llc_testlink_time);
+ }
+}
+
+/* called in tasklet context */
+void smc_llc_link_inactive(struct smc_link *link)
+{
+ link->state = SMC_LNK_INACTIVE;
+ cancel_delayed_work(&link->llc_testlink_wrk);
+}
+
+/* called in worker context */
+void smc_llc_link_flush(struct smc_link *link)
+{
+ cancel_delayed_work_sync(&link->llc_testlink_wrk);
+}
+
/***************************** init, exit, misc ******************************/
static struct smc_wr_rx_handler smc_llc_rx_handlers[] = {
diff --git a/net/smc/smc_llc.h b/net/smc/smc_llc.h
index e4a7d5e234d5..d6e42116485e 100644
--- a/net/smc/smc_llc.h
+++ b/net/smc/smc_llc.h
@@ -44,6 +44,9 @@ int smc_llc_send_delete_link(struct smc_link *link,
enum smc_llc_reqresp reqresp);
int smc_llc_send_test_link(struct smc_link *lnk, u8 user_data[16],
enum smc_llc_reqresp reqresp);
+void smc_llc_link_active(struct smc_link *link, int testlink_time);
+void smc_llc_link_inactive(struct smc_link *link);
+void smc_llc_link_flush(struct smc_link *link);
int smc_llc_init(void) __init;
#endif /* SMC_LLC_H */
diff --git a/net/smc/smc_wr.c b/net/smc/smc_wr.c
index 1b8af23e6e2b..cc7c1bb60fe8 100644
--- a/net/smc/smc_wr.c
+++ b/net/smc/smc_wr.c
@@ -376,6 +376,7 @@ static inline void smc_wr_rx_process_cqes(struct ib_wc wc[], int num)
for (i = 0; i < num; i++) {
link = wc[i].qp->qp_context;
if (wc[i].status == IB_WC_SUCCESS) {
+ link->wr_rx_tstamp = jiffies;
smc_wr_rx_demultiplex(&wc[i]);
smc_wr_rx_post(link); /* refill WR RX */
} else {
--
2.13.5
^ permalink raw reply related
* Re: [PATCH 20/39] afs: simplify procfs code
From: David Howells @ 2018-04-30 14:37 UTC (permalink / raw)
To: Christoph Hellwig
Cc: dhowells, netdev, linux-kernel, Alexander Viro, Andrew Morton,
linux-afs, Alexey Dobriyan
In-Reply-To: <20180424141248.GA26136@lst.de>
Christoph Hellwig <hch@lst.de> wrote:
> I don't think you should need any of these. seq_file_net or
> seq_file_single_net will return you the net_ns based on a struct
> seq_file. And even from your write routines you can reach the
> seq_file in file->private pretty easily.
You've taken away things like single_open/release_net() which means I can't
supply my own fops and use the proc_net stuff. I wonder if I should add a
write op to struct proc_dir_entry.
David
^ permalink raw reply
* Re: [PATCH bpf-next] tools include uapi: Grab a copy of linux/erspan.h
From: Daniel Borkmann @ 2018-04-30 14:33 UTC (permalink / raw)
To: William Tu; +Cc: netdev, Yonghong Song
In-Reply-To: <1525098383-16368-1-git-send-email-u9012063@gmail.com>
On 04/30/2018 04:26 PM, William Tu wrote:
> Bring the erspan uapi header file so BPF tunnel helpers can use it.
>
> Fixes: 933a741e3b82 ("selftests/bpf: bpf tunnel test.")
> Reported-by: Yonghong Song <yhs@fb.com>
> Signed-off-by: William Tu <u9012063@gmail.com>
Thanks for the patch, William! I also Cc'ed Yonghong here, so he has a
chance to try it out.
^ permalink raw reply
* Re: [PATCH bpf-next] selftests/bpf: bpf tunnel test.
From: William Tu @ 2018-04-30 14:29 UTC (permalink / raw)
To: Daniel Borkmann; +Cc: Y Song, Linux Kernel Network Developers
In-Reply-To: <74a48492-ab99-bbe4-632d-ce7ff82ff127@iogearbox.net>
On Mon, Apr 30, 2018 at 2:05 AM, Daniel Borkmann <daniel@iogearbox.net> wrote:
> On 04/30/2018 09:02 AM, Y Song wrote:
>> Hi, William,
>>
>> When compiled the selftests/bpf in my centos 7 based system, I have
>> the following failures,
>>
>> clang -I. -I./include/uapi -I../../../include/uapi
>> -Wno-compare-distinct-pointer-types \
>> -O2 -target bpf -emit-llvm -c test_tunnel_kern.c -o - | \
>> llc -march=bpf -mcpu=generic -filetype=obj -o
>> /data/users/yhs/work/net-next/tools/testing/selftests/bpf/test_tunnel_kern.o
>> test_tunnel_kern.c:21:10: fatal error: 'linux/erspan.h' file not found
>> #include <linux/erspan.h>
>> ^~~~~~~~~~~~~~~~
>> 1 error generated.
>>
>> Maybe I missed some packages to install?
>
It works for me because I do 'make headers_install' and install the
erspan.h in my /usr/include/linux/
I will submit a patch to add the erspan.h in tools/include/uapi/linux
Thanks
William
^ permalink raw reply
* [PATCH bpf-next] tools include uapi: Grab a copy of linux/erspan.h
From: William Tu @ 2018-04-30 14:26 UTC (permalink / raw)
To: netdev
Bring the erspan uapi header file so BPF tunnel helpers can use it.
Fixes: 933a741e3b82 ("selftests/bpf: bpf tunnel test.")
Reported-by: Yonghong Song <yhs@fb.com>
Signed-off-by: William Tu <u9012063@gmail.com>
---
tools/include/uapi/linux/erspan.h | 52 +++++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
create mode 100644 tools/include/uapi/linux/erspan.h
diff --git a/tools/include/uapi/linux/erspan.h b/tools/include/uapi/linux/erspan.h
new file mode 100644
index 000000000000..841573019ae1
--- /dev/null
+++ b/tools/include/uapi/linux/erspan.h
@@ -0,0 +1,52 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+/*
+ * ERSPAN Tunnel Metadata
+ *
+ * Copyright (c) 2018 VMware
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * Userspace API for metadata mode ERSPAN tunnel
+ */
+#ifndef _UAPI_ERSPAN_H
+#define _UAPI_ERSPAN_H
+
+#include <linux/types.h> /* For __beXX in userspace */
+#include <asm/byteorder.h>
+
+/* ERSPAN version 2 metadata header */
+struct erspan_md2 {
+ __be32 timestamp;
+ __be16 sgt; /* security group tag */
+#if defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 hwid_upper:2,
+ ft:5,
+ p:1;
+ __u8 o:1,
+ gra:2,
+ dir:1,
+ hwid:4;
+#elif defined(__BIG_ENDIAN_BITFIELD)
+ __u8 p:1,
+ ft:5,
+ hwid_upper:2;
+ __u8 hwid:4,
+ dir:1,
+ gra:2,
+ o:1;
+#else
+#error "Please fix <asm/byteorder.h>"
+#endif
+};
+
+struct erspan_metadata {
+ int version;
+ union {
+ __be32 index; /* Version 1 (type II)*/
+ struct erspan_md2 md2; /* Version 2 (type III) */
+ } u;
+};
+
+#endif /* _UAPI_ERSPAN_H */
--
2.7.4
^ permalink raw reply related
* Re: [PATCH] ethtool: fix a potential missing-check bug
From: Edward Cree @ 2018-04-30 14:20 UTC (permalink / raw)
To: Wenwen Wang
Cc: Kangjie Lu, David S. Miller, Florian Fainelli, Andrew Lunn,
Russell King, Inbar Karmy, Eugenia Emantayev, Al Viro, Yury Norov,
Vidya Sagar Ravipati, Alan Brady, Stephen Hemminger,
open list:NETWORKING [GENERAL], open list
In-Reply-To: <1525051915-31944-1-git-send-email-wang6495@umn.edu>
On 30/04/18 02:31, Wenwen Wang wrote:
> 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.
I'm not sure there's actually an issue here, since the only purpose of the
FLOW_RSS check is to avoid faulting/trampling user memory when the user
process only has the short version of 'info'.
If userland subsequently removes the FLOW_RSS flag, then all that will
happen is that info_size is larger than it ought to be; that cannot affect
ops->get_rxnfc() since it isn't passed; the op should already be treating
'info' as unsafe/user-controlled.
The only way this could lead to information leakage would be if in the non-
FLOW_RSS case ops->get_rxnfc() was writing things it shouldn't into the
latter part of 'info' and was getting away with it so far as that was
never copied_to_user; that seems improbable to me, but I suppose you might
want to do the check anyway as belt-and-braces security.
(A cleaner approach might be to only copy_from_user() the extra region of
'info', leaving the previously-copied part alone. That way each byte is
only copied_from_user once and thus cannot change.)
-Ed
> This patch 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>
> ---
> net/core/ethtool.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/net/core/ethtool.c b/net/core/ethtool.c
> index 03416e6..a121034 100644
> --- a/net/core/ethtool.c
> +++ b/net/core/ethtool.c
> @@ -1032,6 +1032,8 @@ static noinline_for_stack int ethtool_get_rxnfc(struct net_device *dev,
> info_size = sizeof(info);
> if (copy_from_user(&info, useraddr, info_size))
> return -EFAULT;
> + if (!(info.flow_type & FLOW_RSS))
> + return -EINVAL;
> }
>
> if (info.cmd == ETHTOOL_GRXCLSRLALL) {
^ permalink raw reply
* [PATCH] rtlwifi: fix spelling mistake: "dismatch" -> "mismatch"
From: Colin King @ 2018-04-30 13:41 UTC (permalink / raw)
To: Ping-Ke Shih, Kalle Valo, David S . Miller, Larry Finger,
linux-wireless, netdev
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
Trivial fix to spelling mistake in RT_TRACE message text.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
.../net/wireless/realtek/rtlwifi/btcoexist/halbtc8192e2ant.c | 2 +-
.../net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c | 2 +-
.../net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8192e2ant.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8192e2ant.c
index 8fce371749d3..f22fec093f1d 100644
--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8192e2ant.c
+++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8192e2ant.c
@@ -1783,7 +1783,7 @@ static void btc8192e2ant_tdma_duration_adjust(struct btc_coexist *btcoexist,
bool scan = false, link = false, roam = false;
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
- "[BTCoex], PsTdma type dismatch!!!, ");
+ "[BTCoex], PsTdma type mismatch!!!, ");
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
"curPsTdma=%d, recordPsTdma=%d\n",
coex_dm->cur_ps_tdma, coex_dm->tdma_adj_type);
diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c
index 73ec31972944..279fe01bb55e 100644
--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c
+++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c
@@ -2766,7 +2766,7 @@ static void btc8723b2ant_tdma_duration_adjust(struct btc_coexist *btcoexist,
if (coex_dm->cur_ps_tdma != coex_dm->ps_tdma_du_adj_type) {
bool scan = false, link = false, roam = false;
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
- "[BTCoex], PsTdma type dismatch!!!, curPsTdma=%d, recordPsTdma=%d\n",
+ "[BTCoex], PsTdma type mismatch!!!, curPsTdma=%d, recordPsTdma=%d\n",
coex_dm->cur_ps_tdma, coex_dm->ps_tdma_du_adj_type);
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_SCAN, &scan);
diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c
index 2202d5e18977..01a9d303603b 100644
--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c
+++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c
@@ -2614,7 +2614,7 @@ static void btc8821a2ant_tdma_duration_adjust(struct btc_coexist *btcoexist,
bool scan = false, link = false, roam = false;
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
- "[BTCoex], PsTdma type dismatch!!!, cur_ps_tdma = %d, recordPsTdma = %d\n",
+ "[BTCoex], PsTdma type mismatch!!!, cur_ps_tdma = %d, recordPsTdma = %d\n",
coex_dm->cur_ps_tdma, coex_dm->ps_tdma_du_adj_type);
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_SCAN, &scan);
--
2.17.0
^ permalink raw reply related
* Re: [PATCH net-next 0/8] r8169: further improvements w/o functional change
From: David Miller @ 2018-04-30 13:39 UTC (permalink / raw)
To: hkallweit1; +Cc: nic_swsd, netdev
In-Reply-To: <9b5f541e-8725-46ca-4466-0c3295229252@gmail.com>
From: Heiner Kallweit <hkallweit1@gmail.com>
Date: Sat, 28 Apr 2018 22:06:02 +0200
> This series aims at further improving and simplifying the code w/o
> any intended functional changes.
>
> Series was tested on: RTL8169sb, RTL8168d, RTL8168e-vl
Series applied, thank you.
^ permalink raw reply
* KASAN: use-after-free Read in perf_trace_rpc_stats_latency
From: syzbot @ 2018-04-30 13:34 UTC (permalink / raw)
To: anna.schumaker, bfields, davem, jlayton, linux-kernel, linux-nfs,
netdev, syzkaller-bugs, trond.myklebust
Hello,
syzbot hit the following crash on bpf-next commit
f60ad0a0c441530280a4918eca781a6a94dffa50 (Sun Apr 29 15:45:55 2018 +0000)
Merge branch 'bpf_get_stack'
syzbot dashboard link:
https://syzkaller.appspot.com/bug?extid=27db1f90e2b972a5f2d3
Unfortunately, I don't have any reproducer for this crash yet.
Raw console output:
https://syzkaller.appspot.com/x/log.txt?id=6741221342969856
Kernel config:
https://syzkaller.appspot.com/x/.config?id=4410550353033654931
compiler: gcc (GCC) 8.0.1 20180413 (experimental)
IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+27db1f90e2b972a5f2d3@syzkaller.appspotmail.com
It will help syzbot understand when the bug is fixed. See footer for
details.
If you forward the report, please keep this part and the footer.
rpcbind: RPC call returned error 22
rpcbind: RPC call returned error 22
rpcbind: RPC call returned error 22
rpcbind: RPC call returned error 22
==================================================================
BUG: KASAN: use-after-free in strlen+0x83/0xa0 lib/string.c:482
Read of size 1 at addr ffff8801d6f0a1c0 by task syz-executor7/5079
CPU: 1 PID: 5079 Comm: syz-executor7 Not tainted 4.17.0-rc2+ #16
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1b9/0x294 lib/dump_stack.c:113
print_address_description+0x6c/0x20b mm/kasan/report.c:256
kasan_report_error mm/kasan/report.c:354 [inline]
kasan_report.cold.7+0x242/0x2fe mm/kasan/report.c:412
__asan_report_load1_noabort+0x14/0x20 mm/kasan/report.c:430
strlen+0x83/0xa0 lib/string.c:482
trace_event_get_offsets_rpc_stats_latency
include/trace/events/sunrpc.h:215 [inline]
perf_trace_rpc_stats_latency+0x318/0x10d0 include/trace/events/sunrpc.h:215
trace_rpc_stats_latency include/trace/events/sunrpc.h:215 [inline]
rpc_count_iostats_metrics+0x594/0x8a0 net/sunrpc/stats.c:182
rpc_count_iostats+0x76/0x90 net/sunrpc/stats.c:195
xprt_release+0xa3b/0x1110 net/sunrpc/xprt.c:1351
rpc_release_resources_task+0x20/0xa0 net/sunrpc/sched.c:1024
rpc_release_task net/sunrpc/sched.c:1068 [inline]
__rpc_execute+0x5e9/0xf50 net/sunrpc/sched.c:833
rpc_execute+0x37f/0x480 net/sunrpc/sched.c:852
rpc_run_task+0x615/0x8c0 net/sunrpc/clnt.c:1053
rpc_call_sync+0x196/0x290 net/sunrpc/clnt.c:1082
rpc_ping+0x155/0x1f0 net/sunrpc/clnt.c:2513
rpc_create_xprt+0x282/0x3f0 net/sunrpc/clnt.c:479
rpc_create+0x52e/0x900 net/sunrpc/clnt.c:587
nfs_create_rpc_client+0x63e/0x850 fs/nfs/client.c:523
nfs_init_client+0x74/0x100 fs/nfs/client.c:634
nfs_get_client+0x1065/0x1500 fs/nfs/client.c:425
nfs_init_server+0x364/0xfb0 fs/nfs/client.c:670
nfs_create_server+0x86/0x5f0 fs/nfs/client.c:953
nfs_try_mount+0x177/0xab0 fs/nfs/super.c:1884
nfs_fs_mount+0x17de/0x2efd fs/nfs/super.c:2695
mount_fs+0xae/0x328 fs/super.c:1267
vfs_kern_mount.part.34+0xd4/0x4d0 fs/namespace.c:1037
vfs_kern_mount fs/namespace.c:1027 [inline]
do_new_mount fs/namespace.c:2518 [inline]
do_mount+0x564/0x3070 fs/namespace.c:2848
ksys_mount+0x12d/0x140 fs/namespace.c:3064
__do_sys_mount fs/namespace.c:3078 [inline]
__se_sys_mount fs/namespace.c:3075 [inline]
__x64_sys_mount+0xbe/0x150 fs/namespace.c:3075
do_syscall_64+0x1b1/0x800 arch/x86/entry/common.c:287
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x455979
RSP: 002b:00007f1e2785bc68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f1e2785c6d4 RCX: 0000000000455979
RDX: 0000000020fb5ffc RSI: 0000000020343ff8 RDI: 000000002091dff8
RBP: 000000000072bf50 R08: 000000002000a000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff
R13: 0000000000000440 R14: 00000000006fa6a0 R15: 0000000000000001
Allocated by task 5079:
save_stack+0x43/0xd0 mm/kasan/kasan.c:448
set_track mm/kasan/kasan.c:460 [inline]
kasan_kmalloc+0xc4/0xe0 mm/kasan/kasan.c:553
__do_kmalloc mm/slab.c:3718 [inline]
__kmalloc_track_caller+0x14a/0x760 mm/slab.c:3733
kstrdup+0x39/0x70 mm/util.c:56
xs_format_common_peer_ports+0x130/0x370 net/sunrpc/xprtsock.c:290
xs_format_peer_addresses net/sunrpc/xprtsock.c:303 [inline]
xs_setup_udp+0x5ea/0x880 net/sunrpc/xprtsock.c:3037
xprt_create_transport+0x1d7/0x596 net/sunrpc/xprt.c:1433
rpc_create+0x489/0x900 net/sunrpc/clnt.c:573
nfs_create_rpc_client+0x63e/0x850 fs/nfs/client.c:523
nfs_init_client+0x74/0x100 fs/nfs/client.c:634
nfs_get_client+0x1065/0x1500 fs/nfs/client.c:425
nfs_init_server+0x364/0xfb0 fs/nfs/client.c:670
nfs_create_server+0x86/0x5f0 fs/nfs/client.c:953
nfs_try_mount+0x177/0xab0 fs/nfs/super.c:1884
nfs_fs_mount+0x17de/0x2efd fs/nfs/super.c:2695
mount_fs+0xae/0x328 fs/super.c:1267
vfs_kern_mount.part.34+0xd4/0x4d0 fs/namespace.c:1037
vfs_kern_mount fs/namespace.c:1027 [inline]
do_new_mount fs/namespace.c:2518 [inline]
do_mount+0x564/0x3070 fs/namespace.c:2848
ksys_mount+0x12d/0x140 fs/namespace.c:3064
__do_sys_mount fs/namespace.c:3078 [inline]
__se_sys_mount fs/namespace.c:3075 [inline]
__x64_sys_mount+0xbe/0x150 fs/namespace.c:3075
do_syscall_64+0x1b1/0x800 arch/x86/entry/common.c:287
entry_SYSCALL_64_after_hwframe+0x49/0xbe
Freed by task 6:
save_stack+0x43/0xd0 mm/kasan/kasan.c:448
set_track mm/kasan/kasan.c:460 [inline]
__kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:521
kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528
__cache_free mm/slab.c:3498 [inline]
kfree+0xd9/0x260 mm/slab.c:3813
xs_update_peer_port net/sunrpc/xprtsock.c:309 [inline]
xs_set_port+0x105/0x180 net/sunrpc/xprtsock.c:1827
rpcb_getport_done+0x224/0x2d0 net/sunrpc/rpcb_clnt.c:824
rpc_exit_task+0xc9/0x2d0 net/sunrpc/sched.c:725
__rpc_execute+0x28a/0xf50 net/sunrpc/sched.c:784
rpc_async_schedule+0x16/0x20 net/sunrpc/sched.c:857
process_one_work+0xc1e/0x1b50 kernel/workqueue.c:2145
worker_thread+0x1cc/0x1440 kernel/workqueue.c:2279
kthread+0x345/0x410 kernel/kthread.c:238
ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:412
The buggy address belongs to the object at ffff8801d6f0a1c0
which belongs to the cache kmalloc-32 of size 32
The buggy address is located 0 bytes inside of
32-byte region [ffff8801d6f0a1c0, ffff8801d6f0a1e0)
The buggy address belongs to the page:
page:ffffea00075bc280 count:1 mapcount:0 mapping:ffff8801d6f0a000
index:0xffff8801d6f0afc1
flags: 0x2fffc0000000100(slab)
raw: 02fffc0000000100 ffff8801d6f0a000 ffff8801d6f0afc1 0000000100000024
raw: ffffea00075c52a0 ffff8801da801238 ffff8801da8001c0 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff8801d6f0a080: 01 fc fc fc fc fc fc fc 00 02 fc fc fc fc fc fc
ffff8801d6f0a100: 00 02 fc fc fc fc fc fc 00 02 fc fc fc fc fc fc
> ffff8801d6f0a180: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc
^
ffff8801d6f0a200: 00 02 fc fc fc fc fc fc 01 fc fc fc fc fc fc fc
ffff8801d6f0a280: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc
==================================================================
---
This bug is generated by a dumb bot. It may contain errors.
See https://goo.gl/tpsmEJ for details.
Direct all questions to syzkaller@googlegroups.com.
syzbot will keep track of this bug report.
If you forgot to add the Reported-by tag, once the fix for this bug is
merged
into any tree, please reply to this email with:
#syz fix: exact-commit-title
To mark this as a duplicate of another syzbot report, please reply with:
#syz dup: exact-subject-of-another-report
If it's a one-off invalid bug report, please reply with:
#syz invalid
Note: if the crash happens again, it will cause creation of a new bug
report.
Note: all commands must start from beginning of the line in the email body.
^ permalink raw reply
* Re: [PATCH] net: ethernet: ucc: fix spelling mistake: "tx-late-collsion" -> "tx-late-collision"
From: David Miller @ 2018-04-30 13:30 UTC (permalink / raw)
To: colin.king
Cc: leoyang.li, netdev, linuxppc-dev, kernel-janitors, linux-kernel
In-Reply-To: <20180428095707.7424-1-colin.king@canonical.com>
From: Colin King <colin.king@canonical.com>
Date: Sat, 28 Apr 2018 10:57:07 +0100
> From: Colin Ian King <colin.king@canonical.com>
>
> Trivial fix to spelling mistake in tx_fw_stat_gstrings text
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Applied.
^ permalink raw reply
* Re: [PATCH] liquidio: fix spelling mistake: "mac_tx_multi_collison" -> "mac_tx_multi_collision"
From: David Miller @ 2018-04-30 13:30 UTC (permalink / raw)
To: colin.king
Cc: derek.chickles, satananda.burla, felix.manlunas, raghu.vatsavayi,
netdev, kernel-janitors, linux-kernel
In-Reply-To: <20180428095216.7236-1-colin.king@canonical.com>
From: Colin King <colin.king@canonical.com>
Date: Sat, 28 Apr 2018 10:52:16 +0100
> From: Colin Ian King <colin.king@canonical.com>
>
> Trivial fix to spelling mistake in oct_stats_strings text
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Applied.
^ permalink raw reply
* Re: [PATCH] qed: fix spelling mistake: "checksumed" -> "checksummed"
From: David Miller @ 2018-04-30 13:30 UTC (permalink / raw)
To: colin.king
Cc: Ariel.Elior, everest-linux-l2, netdev, kernel-janitors,
linux-kernel
In-Reply-To: <20180428094320.7016-1-colin.king@canonical.com>
From: Colin King <colin.king@canonical.com>
Date: Sat, 28 Apr 2018 10:43:20 +0100
> From: Colin Ian King <colin.king@canonical.com>
>
> Trivial fix to spelling mistake in DP_INFO message text
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Applied.
^ permalink raw reply
* Re: [PATCH V2 net-next 0/6] liquidio: enhanced ethtool --set-channels feature
From: David Miller @ 2018-04-30 13:26 UTC (permalink / raw)
To: felix.manlunas
Cc: netdev, raghu.vatsavayi, derek.chickles, satananda.burla,
intiyaz.basha
In-Reply-To: <20180428063204.GA3229@felix-thinkpad.cavium.com>
From: Felix Manlunas <felix.manlunas@cavium.com>
Date: Fri, 27 Apr 2018 23:32:04 -0700
> From: Intiyaz Basha <intiyaz.basha@cavium.com>
>
> For the ethtool --set-channels feature, the liquidio driver currently
> accepts max combined value as the queue count configured during driver
> load time, where max combined count is the total count of input and output
> queues. This limitation is applicable only when SR-IOV is enabled, that
> is, when VFs are created for PF. If SR-IOV is not enabled, the driver can
> configure max supported (64) queues.
>
> This series of patches are for enhancing driver to accept
> max supported queues for ethtool --set-channels.
>
> Changes in V2:
> Only patch #6 was changed to fix these Sparse warnings reported by kbuild
> test robot:
> lio_ethtool.c:848:5: warning: symbol 'lio_23xx_reconfigure_queue_count'
> was not declared. Should it be static?
> lio_ethtool.c:877:22: warning: incorrect type in assignment (different
> base types)
> lio_ethtool.c:878:22: warning: incorrect type in assignment (different
> base types)
> lio_ethtool.c:879:22: warning: incorrect type in assignment (different
> base types)
Series applied, thank you.
^ permalink raw reply
* Re: i.MX6S/DL and QCA8334 switch using DSA driver - CPU port not working
From: Andrew Lunn @ 2018-04-30 13:20 UTC (permalink / raw)
To: Michal Vokáč; +Cc: netdev, Vivien Didelot, Florian Fainelli
In-Reply-To: <48c029f1-1632-573f-c628-86b4972d668c@gmail.com>
> Using rgmii-id for the port is not valid as the qca8k driver does not support
> that mode. It only supports rgmii and sgmii. I think this is actually not
> correct. When phy-mode is set to rgmii for port the qca8k driver configures
> internal delays in the switch. So it behaves like rgmii-id I think.
>
> Should not it be:
>
> --- a/drivers/net/dsa/qca8k.c
> +++ b/drivers/net/dsa/qca8k.c
> @@ -474,7 +474,7 @@ qca8k_set_pad_ctrl(struct qca8k_priv *priv, int port, int mode)
> * PHY or MAC.
> */
> switch (mode) {
> - case PHY_INTERFACE_MODE_RGMII:
> + case PHY_INTERFACE_MODE_RGMII_ID:
> qca8k_write(priv, reg,
> QCA8K_PORT_PAD_RGMII_EN |
> QCA8K_PORT_PAD_RGMII_TX_DELAY(3) |
We have to be careful cleaning this up. It has the potential to break
existing boards when using an old device tree blob.
Andrew
^ permalink raw reply
* Re: [PATCH 04/40] proc: introduce proc_create_seq{,_data}
From: David Howells @ 2018-04-30 13:19 UTC (permalink / raw)
To: Christoph Hellwig
Cc: linux-rtc, Alessandro Zummo, Alexandre Belloni, devel, linux-scsi,
linux-acpi, Greg Kroah-Hartman, Jiri Slaby, megaraidlinux.pdl,
linux-kernel, Alexey Dobriyan, dhowells, linux-ide,
netfilter-devel, Alexander Viro, netdev, Andrew Morton,
linux-ext4, linux-afs, jfs-discussion, drbd-dev
In-Reply-To: <20180425154827.32251-5-hch@lst.de>
Christoph Hellwig <hch@lst.de> wrote:
> +
> +struct proc_dir_entry *proc_create_seq_data(const char *name, umode_t mode,
> + struct proc_dir_entry *parent, const struct seq_operations *ops,
> + void *data)
> +{
> ...
> +EXPORT_SYMBOL(proc_create_seq_data);
Please add documentation comments to exported functions when you add them.
David
^ 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