* Re: [PATCH] sysctl: Fix proc_do_large_bitmap for large input buffers
From: Luis Chamberlain @ 2019-02-21 17:52 UTC (permalink / raw)
To: Eric Sandeen
Cc: Eric Sandeen, Andrew Morton, Linux Kernel Mailing List, fsdevel,
netdev, Kees Cook
In-Reply-To: <72a6d9bc-cfb9-a21a-960d-bb01331c0dd7@redhat.com>
On Thu, Feb 21, 2019 at 11:47:49AM -0600, Eric Sandeen wrote:
> On 2/21/19 9:18 AM, Luis Chamberlain wrote:
> > On Wed, Feb 20, 2019 at 05:35:04PM -0600, Eric Sandeen wrote:
> >> Here's a pretty hacky test script to test this code via
> >> ip_local_reserved_ports
> >
> > Thanks Eric!
> >
> > So /proc/sys/net/ipv4/ip_local_reserved_ports is a production knob, and
> > if we wanted to stress test it with a selftest it could break other self
> > tests or change the system behaviour. Because of this we have now have
> > lib/test_sysctl.c, and we test this with the script:
> >
> > tools/testing/selftests/sysctl/sysctl.sh
> >
> > Any chance you can extend lib/test_sysctl.c with a new respective bitmap
> > knob,
>
> Done
Thanks!
> > and add a respective test? This will ensure we don't regress
> > later. 0-day runs sysctl.sh so it should catch any regressions in the
> > future.
>
> As you know, learning somebody else's test harness infra is a PITA. ;)
> Can you find me off-list and give me a hand with this?
Sure, its actually quite simple, just as root, run the script.
Luis
^ permalink raw reply
* [RFC] rtnetlink: handle multiple vlan tags in set_vf_vlan
From: Stephen Hemminger @ 2019-02-21 17:54 UTC (permalink / raw)
To: Moshe Shemesh; +Cc: netdev, Stephen Hemminger, Stephen Hemminger
The netlink API for IFLA_VF_VLAN_LIST allows multiple VLAN tags to
be passed (and the message was validated) but only the first VLAN
tag was being passed to the device. Change to iterate over each tag received.
Fixes: 79aab093a0b5 ("net: Update API for VF vlan protocol 802.1ad support")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
net/core/rtnetlink.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index a51cab95ba64..3a9ec988ae21 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -2207,11 +2207,10 @@ static int do_setvfinfo(struct net_device *dev, struct nlattr **tb)
if (tb[IFLA_VF_VLAN_LIST]) {
struct ifla_vf_vlan_info *ivvl[MAX_VLAN_LIST_LEN];
struct nlattr *attr;
- int rem, len = 0;
+ int i, rem, len = 0;
- err = -EOPNOTSUPP;
if (!ops->ndo_set_vf_vlan)
- return err;
+ return -EOPNOTSUPP;
nla_for_each_nested(attr, tb[IFLA_VF_VLAN_LIST], rem) {
if (nla_type(attr) != IFLA_VF_VLAN_INFO ||
@@ -2224,13 +2223,15 @@ static int do_setvfinfo(struct net_device *dev, struct nlattr **tb)
len++;
}
- if (len == 0)
- return -EINVAL;
- err = ops->ndo_set_vf_vlan(dev, ivvl[0]->vf, ivvl[0]->vlan,
- ivvl[0]->qos, ivvl[0]->vlan_proto);
- if (err < 0)
- return err;
+ err = -EINVAL; /* empty list error */
+ for (i = 0; i < len; i++) {
+ err = ops->ndo_set_vf_vlan(dev, ivvl[i]->vf,
+ ivvl[i]->vlan, ivvl[i]->qos,
+ ivvl[i]->vlan_proto);
+ if (err < 0)
+ return err;
+ }
}
if (tb[IFLA_VF_TX_RATE]) {
--
2.17.1
^ permalink raw reply related
* Re: [PATCH net v2 0/2] ipv6: route: enforce RCU protection for fib6_info->from
From: David Miller @ 2019-02-21 17:54 UTC (permalink / raw)
To: pabeni; +Cc: netdev, dsahern
In-Reply-To: <cover.1550684182.git.pabeni@redhat.com>
From: Paolo Abeni <pabeni@redhat.com>
Date: Thu, 21 Feb 2019 11:19:40 +0100
> This series addresses a couple of RCU left-over dating back to rt6_info->from
> conversion to RCU
>
> v1 -> v2:
> - fix a possible race in patch 1
Series applied.
^ permalink raw reply
* Re: [PATCH] sysctl: Fix proc_do_large_bitmap for large input buffers
From: Eric Sandeen @ 2019-02-21 17:59 UTC (permalink / raw)
To: Luis Chamberlain, Eric Sandeen
Cc: Andrew Morton, Linux Kernel Mailing List, fsdevel, netdev,
Kees Cook
In-Reply-To: <20190221175232.GM11489@garbanzo.do-not-panic.com>
On 2/21/19 11:52 AM, Luis Chamberlain wrote:
> On Thu, Feb 21, 2019 at 11:47:49AM -0600, Eric Sandeen wrote:
>> On 2/21/19 9:18 AM, Luis Chamberlain wrote:
>>> On Wed, Feb 20, 2019 at 05:35:04PM -0600, Eric Sandeen wrote:
>>>> Here's a pretty hacky test script to test this code via
>>>> ip_local_reserved_ports
>>>
>>> Thanks Eric!
>>>
>>> So /proc/sys/net/ipv4/ip_local_reserved_ports is a production knob, and
>>> if we wanted to stress test it with a selftest it could break other self
>>> tests or change the system behaviour. Because of this we have now have
>>> lib/test_sysctl.c, and we test this with the script:
>>>
>>> tools/testing/selftests/sysctl/sysctl.sh
>>>
>>> Any chance you can extend lib/test_sysctl.c with a new respective bitmap
>>> knob,
>>
>> Done
>
> Thanks!
>
>>> and add a respective test? This will ensure we don't regress
>>> later. 0-day runs sysctl.sh so it should catch any regressions in the
>>> future.
>>
>> As you know, learning somebody else's test harness infra is a PITA. ;)
>> Can you find me off-list and give me a hand with this?
>
> Sure, its actually quite simple, just as root, run the script.
Running it looks easy. I'd like to know about how to extend it.
Thanks,
-Eric
^ permalink raw reply
* Re: [PATCH v2 iproute2-next 04/11] devlink: Add helper functions for name and value separately
From: Stephen Hemminger @ 2019-02-21 18:02 UTC (permalink / raw)
To: Aya Levin; +Cc: David Ahern, netdev, Jiri Pirko, Moshe Shemesh, Eran Ben Elisha
In-Reply-To: <1550756567-18227-5-git-send-email-ayal@mellanox.com>
On Thu, 21 Feb 2019 15:42:40 +0200
Aya Levin <ayal@mellanox.com> wrote:
> Add a new helper functions which outputs only values (without name
> label) for different types: boolean, uint, uint64, string and binary.
> In addition add a helper function which prints only the name label.
>
> Signed-off-by: Aya Levin <ayal@mellanox.com>
> Reviewed-by: Moshe Shemesh <moshe@mellanox.com>
> ---
> devlink/devlink.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 65 insertions(+), 1 deletion(-)
>
> diff --git a/devlink/devlink.c b/devlink/devlink.c
> index b073ae020d52..5d69c4f24f29 100644
> --- a/devlink/devlink.c
> +++ b/devlink/devlink.c
> @@ -1588,7 +1588,6 @@ static void pr_out_port_handle_end(struct dl *dl)
> pr_out("\n");
> }
>
> -
> static void pr_out_str(struct dl *dl, const char *name, const char *val)
> {
> if (dl->json_output) {
> @@ -1636,6 +1635,71 @@ static void pr_out_u64(struct dl *dl, const char *name, uint64_t val)
> }
> }
>
> +static void pr_out_bool_value(struct dl *dl, bool value)
> +{
> + if (dl->json_output)
> + jsonw_bool(dl->jw, value);
> + else
> + pr_out(" %s", value ? "true" : "false");
> +}
> +
> +static void pr_out_uint_value(struct dl *dl, unsigned int value)
> +{
> + if (dl->json_output)
> + jsonw_uint(dl->jw, value);
> + else
> + pr_out(" %u", value);
> +}
> +
> +static void pr_out_uint64_value(struct dl *dl, uint64_t value)
> +{
> + if (dl->json_output)
> + jsonw_u64(dl->jw, value);
> + else
> + pr_out(" %lu", value);
> +}
> +
> +static void pr_out_binary_value(struct dl *dl, uint8_t *data, uint32_t len)
> +{
> + int i = 1;
> +
> + if (dl->json_output)
> + jsonw_start_array(dl->jw);
> + else
> + pr_out("\n");
> +
> + while (i < len) {
> + if (dl->json_output) {
> + jsonw_printf(dl->jw, "%d", data[i]);
> + } else {
> + pr_out(" %02x", data[i]);
> + if (!(i % 16))
> + pr_out("\n");
> + }
> + i++;
> + }
> + if (dl->json_output)
> + jsonw_end_array(dl->jw);
> + else if ((i - 1) % 16)
> + pr_out("\n");
> +}
> +
> +static void pr_out_str_value(struct dl *dl, const char *value)
> +{
> + if (dl->json_output)
> + jsonw_string(dl->jw, value);
> + else
> + pr_out(" %s", value);
> +}
> +
> +static void pr_out_name(struct dl *dl, const char *name)
> +{
> + if (dl->json_output)
> + jsonw_name(dl->jw, name);
> + else
> + pr_out(" %s:", name);
> +}
> +
> static void pr_out_region_chunk_start(struct dl *dl, uint64_t addr)
> {
> if (dl->json_output) {
NAK
Please convert devlink to use existing iproute2 json_print infrasructure
rather than reinventing it.
^ permalink raw reply
* Re: [PATCH] bpfilter: remove extra header search paths for bpfilter_umh
From: Guenter Roeck @ 2019-02-21 18:05 UTC (permalink / raw)
To: Masahiro Yamada
Cc: David S. Miller, Alexei Starovoitov, Daniel Borkmann, Networking,
Linux Kernel Mailing List
In-Reply-To: <CAK7LNASfiSrULgdG_tcm+m4wmyOjg4ZHYAB9EUgaGrjv=g-Zbg@mail.gmail.com>
On Fri, Feb 22, 2019 at 12:54:47AM +0900, Masahiro Yamada wrote:
> On Thu, Feb 21, 2019 at 11:46 PM Guenter Roeck <linux@roeck-us.net> wrote:
> >
> > On Thu, Jan 31, 2019 at 12:15:35PM +0900, Masahiro Yamada wrote:
> > > Currently, the header search paths -Itools/include and
> > > -Itools/include/uapi are not used. Let's drop the unused code.
> > >
> > > We can remove -I. too by fixing up one C file.
> > >
> >
> > This patch reintroduces the problem last fixed with commit ae40832e53c3
> > ("bpfilter: fix a build err"). Seen (at least) with gcc 7.4.0, 8.2.0.
> > binutils version is 2.31.1. Reverting this patch fixes the problem.
>
>
> Hmm. I cannot reproduce the build error with my gcc,
> but you are right.
>
Maybe it has less to do with the gcc version and more with how the
toolchain is built. I see the problem with toolchains generated
using buildroot.
>
> I'd like to get back only
> 'KBUILD_HOSTCFLAGS += -Itools/include/ -Itools/include/uapi'
> instead of the full revert.
>
That doesn't work for me. I need
KBUILD_HOSTCFLAGS += -I. -Itools/include/uapi
Just don't ask me why.
Guenter
> If David is fine with it, I can send a patch with filling commit log.
>
>
>
> Thanks.
>
>
>
> > Guenter
> >
> > > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> > > Signed-off-by: David S. Miller <davem@davemloft.net>
> > > ---
> > > net/bpfilter/Makefile | 1 -
> > > net/bpfilter/main.c | 2 +-
> > > 2 files changed, 1 insertion(+), 2 deletions(-)
> > >
> > > diff --git a/net/bpfilter/Makefile b/net/bpfilter/Makefile
> > > index 0947ee7f70d5..5d6c7760142d 100644
> > > --- a/net/bpfilter/Makefile
> > > +++ b/net/bpfilter/Makefile
> > > @@ -5,7 +5,6 @@
> > >
> > > hostprogs-y := bpfilter_umh
> > > bpfilter_umh-objs := main.o
> > > -KBUILD_HOSTCFLAGS += -I. -Itools/include/ -Itools/include/uapi
> > > HOSTCC := $(CC)
> > >
> > > ifeq ($(CONFIG_BPFILTER_UMH), y)
> > > diff --git a/net/bpfilter/main.c b/net/bpfilter/main.c
> > > index 1317f108df8a..61ce8454a88e 100644
> > > --- a/net/bpfilter/main.c
> > > +++ b/net/bpfilter/main.c
> > > @@ -6,7 +6,7 @@
> > > #include <sys/socket.h>
> > > #include <fcntl.h>
> > > #include <unistd.h>
> > > -#include "include/uapi/linux/bpf.h"
> > > +#include "../../include/uapi/linux/bpf.h"
> > > #include <asm/unistd.h>
> > > #include "msgfmt.h"
> > >
> > > --
> > > 2.7.4
>
>
>
> --
> Best Regards
>
> Masahiro Yamada
^ permalink raw reply
* Re: [PATCH iproute2 1/1] man: Document COLORFGBG environment variable
From: Stephen Hemminger @ 2019-02-21 18:09 UTC (permalink / raw)
To: Petr Vorel; +Cc: netdev
In-Reply-To: <20190221150401.618-1-pvorel@suse.cz>
On Thu, 21 Feb 2019 16:04:01 +0100
Petr Vorel <pvorel@suse.cz> wrote:
> Default colors are not contrast enough on dark backround
> and this functionality, which uses more suitable colors
> is hidden in the code.
>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
COLORFGBG is a semi-standard thing used by many programs.
Maybe a reference to a more complete description of it on the web
might be better.
^ permalink raw reply
* Re: [PATCH net v2] ipv6: route: purge exception on removal
From: Stefano Brivio @ 2019-02-21 18:11 UTC (permalink / raw)
To: David Ahern, Paolo Abeni; +Cc: netdev, David S. Miller
In-Reply-To: <cf0a4167-a61a-1d6d-b82c-c7c98c31ba92@gmail.com>
On Thu, 21 Feb 2019 10:10:32 -0500
David Ahern <dsahern@gmail.com> wrote:
> I am surprised this was not found by the existing pmtu script which
> creates exceptions. Please add this test case to selftests to capture
> this specific set of events.
I think the reason is that, to keep the cleanup function minimal, I
just decided to tear down namespaces after tests, and the tests won't
catch this.
Paolo, I guess you could either make cleanup() symmetric with the
setup_routing() function (but then we don't catch issues related to
namespaces teardown), or introduce just two tests (IPv4 and IPv6) doing
this with one existing tunnel setup (and we don't have variability on
device types, but I don't think it's very relevant).
The alternative of doubling every test (with namespace *and* "orderly"
teardown) looks a bit overkill to me.
--
Stefano
^ permalink raw reply
* Re: [PATCH net 1/1] net/smc: fix smc_poll in SMC_INIT state
From: David Miller @ 2019-02-21 18:20 UTC (permalink / raw)
To: ubraun; +Cc: netdev, linux-s390, schwidefsky, heiko.carstens, raspl
In-Reply-To: <20190221115654.3889-1-ubraun@linux.ibm.com>
From: Ursula Braun <ubraun@linux.ibm.com>
Date: Thu, 21 Feb 2019 12:56:54 +0100
> smc_poll() returns with mask bit EPOLLPRI if the connection urg_state
> is SMC_URG_VALID. Since SMC_URG_VALID is zero, smc_poll signals
> EPOLLPRI errorneously if called in state SMC_INIT before the connection
> is created, for instance in a non-blocking connect scenario.
>
> This patch switches to non-zero values for the urg states.
>
> Reviewed-by: Karsten Graul <kgraul@linux.ibm.com>
> Fixes: de8474eb9d50 ("net/smc: urgent data support")
> Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Applied and queued up for -stable.
^ permalink raw reply
* [PATCH v1 iproute2-next 0/4] Dynamic rdma link creation
From: Steve Wise @ 2019-02-21 18:22 UTC (permalink / raw)
To: dsahern, leon; +Cc: stephen, netdev, linux-rdma
This series adds rdmatool support for creating/deleting rdma links.
This will be used, mainly, by soft rdma drivers to allow adding/deleting
rdma links over netdev interfaces. It provides the user side for
the following kernel changes merged in linux-rdma/for-next:
https://www.spinics.net/lists/linux-rdma/msg75609.html
I believe this series is ready to go. Please review!
Changes since RFC:
- add rd_sendrecv_msg() and make use of it in dev_set as well
as the new link commands.
- fixed problems with the man pages
- changed the command line to use "netdev" as the keyword
for the network device, do avoid confused with the ib_device
name.
- got rid of the "type" parameter for link delete. Also pass
down the device index instead of the name, using the common
rd services for validating the device name and fetching the
index.
Thanks,
Steve.
Steve Wise (4):
rdma: add helper rd_sendrecv_msg()
Sync up rdma_netlink.h
rdma: add 'link add/delete' commands
rdma: man page update for link add/delete
man/man8/rdma-link.8 | 47 ++++++++++++++++++++++
rdma/dev.c | 2 +-
rdma/include/uapi/rdma/rdma_netlink.h | 74 +++++++++++++++++++++++++++--------
rdma/link.c | 67 +++++++++++++++++++++++++++++++
rdma/rdma.h | 2 +
rdma/utils.c | 23 ++++++++++-
6 files changed, 197 insertions(+), 18 deletions(-)
--
1.8.3.1
^ permalink raw reply
* [PATCH v1 iproute2-next 1/4] rdma: add helper rd_sendrecv_msg()
From: Steve Wise @ 2019-02-21 16:19 UTC (permalink / raw)
To: dsahern, leon; +Cc: stephen, netdev, linux-rdma
In-Reply-To: <cover.1550773362.git.swise@opengridcomputing.com>
This function sends the constructed netlink message and then
receives the response, displaying any error text.
Change 'rdma dev set' to use it.
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
---
rdma/dev.c | 2 +-
rdma/rdma.h | 1 +
rdma/utils.c | 21 +++++++++++++++++++++
3 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/rdma/dev.c b/rdma/dev.c
index 60ff4b31e320..d2949c378f08 100644
--- a/rdma/dev.c
+++ b/rdma/dev.c
@@ -273,7 +273,7 @@ static int dev_set_name(struct rd *rd)
mnl_attr_put_u32(rd->nlh, RDMA_NLDEV_ATTR_DEV_INDEX, rd->dev_idx);
mnl_attr_put_strz(rd->nlh, RDMA_NLDEV_ATTR_DEV_NAME, rd_argv(rd));
- return rd_send_msg(rd);
+ return rd_sendrecv_msg(rd, seq);
}
static int dev_one_set(struct rd *rd)
diff --git a/rdma/rdma.h b/rdma/rdma.h
index 547bb5749a39..20be2f12c4f8 100644
--- a/rdma/rdma.h
+++ b/rdma/rdma.h
@@ -115,6 +115,7 @@ bool rd_check_is_key_exist(struct rd *rd, const char *key);
*/
int rd_send_msg(struct rd *rd);
int rd_recv_msg(struct rd *rd, mnl_cb_t callback, void *data, uint32_t seq);
+int rd_sendrecv_msg(struct rd *rd, unsigned int 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);
diff --git a/rdma/utils.c b/rdma/utils.c
index 069d44fece10..a6f2826c9605 100644
--- a/rdma/utils.c
+++ b/rdma/utils.c
@@ -664,6 +664,27 @@ int rd_recv_msg(struct rd *rd, mnl_cb_t callback, void *data, unsigned int seq)
return ret;
}
+static int null_cb(const struct nlmsghdr *nlh, void *data)
+{
+ return MNL_CB_OK;
+}
+
+int rd_sendrecv_msg(struct rd *rd, unsigned int seq)
+{
+ int ret;
+
+ ret = rd_send_msg(rd);
+ if (ret) {
+ perror(NULL);
+ goto out;
+ }
+ ret = rd_recv_msg(rd, null_cb, rd, seq);
+ if (ret)
+ perror(NULL);
+out:
+ return ret;
+}
+
static struct dev_map *_dev_map_lookup(struct rd *rd, const char *dev_name)
{
struct dev_map *dev_map;
--
1.8.3.1
^ permalink raw reply related
* [PATCH v1 iproute2-next 2/4] Sync up rdma_netlink.h
From: Steve Wise @ 2019-02-21 16:19 UTC (permalink / raw)
To: dsahern, leon; +Cc: stephen, netdev, linux-rdma
In-Reply-To: <cover.1550773362.git.swise@opengridcomputing.com>
Pull in the latest rdma_netlink.h to get the RDMA_NLDEV_CMD_NEWLINK /
RDMA_NLDEV_CMD_DELLINK API.
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
---
rdma/include/uapi/rdma/rdma_netlink.h | 74 +++++++++++++++++++++++++++--------
1 file changed, 58 insertions(+), 16 deletions(-)
diff --git a/rdma/include/uapi/rdma/rdma_netlink.h b/rdma/include/uapi/rdma/rdma_netlink.h
index 04c80cebef49..23a90ad52485 100644
--- a/rdma/include/uapi/rdma/rdma_netlink.h
+++ b/rdma/include/uapi/rdma/rdma_netlink.h
@@ -5,8 +5,7 @@
#include <linux/types.h>
enum {
- RDMA_NL_RDMA_CM = 1,
- RDMA_NL_IWCM,
+ RDMA_NL_IWCM = 2,
RDMA_NL_RSVD,
RDMA_NL_LS, /* RDMA Local Services */
RDMA_NL_NLDEV, /* RDMA device interface */
@@ -14,8 +13,7 @@ enum {
};
enum {
- RDMA_NL_GROUP_CM = 1,
- RDMA_NL_GROUP_IWPM,
+ RDMA_NL_GROUP_IWPM = 2,
RDMA_NL_GROUP_LS,
RDMA_NL_NUM_GROUPS
};
@@ -24,15 +22,17 @@ enum {
#define RDMA_NL_GET_OP(type) (type & ((1 << 10) - 1))
#define RDMA_NL_GET_TYPE(client, op) ((client << 10) + op)
-enum {
- RDMA_NL_RDMA_CM_ID_STATS = 0,
- RDMA_NL_RDMA_CM_NUM_OPS
-};
+/* The minimum version that the iwpm kernel supports */
+#define IWPM_UABI_VERSION_MIN 3
+
+/* The latest version that the iwpm kernel supports */
+#define IWPM_UABI_VERSION 4
+/* iwarp port mapper message flags */
enum {
- RDMA_NL_RDMA_CM_ATTR_SRC_ADDR = 1,
- RDMA_NL_RDMA_CM_ATTR_DST_ADDR,
- RDMA_NL_RDMA_CM_NUM_ATTR,
+
+ /* Do not map the port for this IWPM request */
+ IWPM_FLAGS_NO_PORT_MAP = (1 << 0),
};
/* iwarp port mapper op-codes */
@@ -45,6 +45,7 @@ enum {
RDMA_NL_IWPM_HANDLE_ERR,
RDMA_NL_IWPM_MAPINFO,
RDMA_NL_IWPM_MAPINFO_NUM,
+ RDMA_NL_IWPM_HELLO,
RDMA_NL_IWPM_NUM_OPS
};
@@ -83,20 +84,38 @@ enum {
IWPM_NLA_MANAGE_MAPPING_UNSPEC = 0,
IWPM_NLA_MANAGE_MAPPING_SEQ,
IWPM_NLA_MANAGE_ADDR,
- IWPM_NLA_MANAGE_MAPPED_LOC_ADDR,
+ IWPM_NLA_MANAGE_FLAGS,
+ IWPM_NLA_MANAGE_MAPPING_MAX
+};
+
+enum {
+ IWPM_NLA_RMANAGE_MAPPING_UNSPEC = 0,
+ IWPM_NLA_RMANAGE_MAPPING_SEQ,
+ IWPM_NLA_RMANAGE_ADDR,
+ IWPM_NLA_RMANAGE_MAPPED_LOC_ADDR,
+ /* The following maintains bisectability of rdma-core */
+ IWPM_NLA_MANAGE_MAPPED_LOC_ADDR = IWPM_NLA_RMANAGE_MAPPED_LOC_ADDR,
IWPM_NLA_RMANAGE_MAPPING_ERR,
IWPM_NLA_RMANAGE_MAPPING_MAX
};
-#define IWPM_NLA_MANAGE_MAPPING_MAX 3
-#define IWPM_NLA_QUERY_MAPPING_MAX 4
#define IWPM_NLA_MAPINFO_SEND_MAX 3
+#define IWPM_NLA_REMOVE_MAPPING_MAX 3
enum {
IWPM_NLA_QUERY_MAPPING_UNSPEC = 0,
IWPM_NLA_QUERY_MAPPING_SEQ,
IWPM_NLA_QUERY_LOCAL_ADDR,
IWPM_NLA_QUERY_REMOTE_ADDR,
+ IWPM_NLA_QUERY_FLAGS,
+ IWPM_NLA_QUERY_MAPPING_MAX,
+};
+
+enum {
+ IWPM_NLA_RQUERY_MAPPING_UNSPEC = 0,
+ IWPM_NLA_RQUERY_MAPPING_SEQ,
+ IWPM_NLA_RQUERY_LOCAL_ADDR,
+ IWPM_NLA_RQUERY_REMOTE_ADDR,
IWPM_NLA_RQUERY_MAPPED_LOC_ADDR,
IWPM_NLA_RQUERY_MAPPED_REM_ADDR,
IWPM_NLA_RQUERY_MAPPING_ERR,
@@ -114,6 +133,7 @@ enum {
IWPM_NLA_MAPINFO_UNSPEC = 0,
IWPM_NLA_MAPINFO_LOCAL_ADDR,
IWPM_NLA_MAPINFO_MAPPED_ADDR,
+ IWPM_NLA_MAPINFO_FLAGS,
IWPM_NLA_MAPINFO_MAX
};
@@ -132,6 +152,12 @@ enum {
IWPM_NLA_ERR_MAX
};
+enum {
+ IWPM_NLA_HELLO_UNSPEC = 0,
+ IWPM_NLA_HELLO_ABI_VERSION,
+ IWPM_NLA_HELLO_MAX
+};
+
/*
* Local service operations:
* RESOLVE - The client requests the local service to resolve a path.
@@ -229,9 +255,11 @@ enum rdma_nldev_command {
RDMA_NLDEV_CMD_GET, /* can dump */
RDMA_NLDEV_CMD_SET,
- /* 3 - 4 are free to use */
+ RDMA_NLDEV_CMD_NEWLINK,
- RDMA_NLDEV_CMD_PORT_GET = 5, /* can dump */
+ RDMA_NLDEV_CMD_DELLINK,
+
+ RDMA_NLDEV_CMD_PORT_GET, /* can dump */
/* 6 - 8 are free to use */
@@ -431,6 +459,20 @@ enum rdma_nldev_attr {
RDMA_NLDEV_ATTR_DRIVER_U64, /* u64 */
/*
+ * Indexes to get/set secific entry,
+ * for QP use RDMA_NLDEV_ATTR_RES_LQPN
+ */
+ RDMA_NLDEV_ATTR_RES_PDN, /* u32 */
+ RDMA_NLDEV_ATTR_RES_CQN, /* u32 */
+ RDMA_NLDEV_ATTR_RES_MRN, /* u32 */
+ RDMA_NLDEV_ATTR_RES_CM_IDN, /* u32 */
+ RDMA_NLDEV_ATTR_RES_CTXN, /* u32 */
+ /*
+ * Identifies the rdma driver. eg: "rxe" or "siw"
+ */
+ RDMA_NLDEV_ATTR_LINK_TYPE, /* string */
+
+ /*
* Always the end
*/
RDMA_NLDEV_ATTR_MAX
--
1.8.3.1
^ permalink raw reply related
* [PATCH v1 iproute2-next 3/4] rdma: add 'link add/delete' commands
From: Steve Wise @ 2019-02-21 16:19 UTC (permalink / raw)
To: dsahern, leon; +Cc: stephen, netdev, linux-rdma
In-Reply-To: <cover.1550773362.git.swise@opengridcomputing.com>
Add new 'link' subcommand 'add' and 'delete' to allow binding a soft-rdma
device to a netdev interface.
EG:
rdma link add rxe_eth0 type rxe netdev eth0
rdma link delete rxe_eth0
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
---
rdma/link.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
rdma/rdma.h | 1 +
rdma/utils.c | 2 +-
3 files changed, 69 insertions(+), 1 deletion(-)
diff --git a/rdma/link.c b/rdma/link.c
index c064be627be2..afaf19663728 100644
--- a/rdma/link.c
+++ b/rdma/link.c
@@ -14,6 +14,9 @@
static int link_help(struct rd *rd)
{
pr_out("Usage: %s link show [DEV/PORT_INDEX]\n", rd->filename);
+ pr_out("Usage: %s link add NAME type TYPE netdev NETDEV\n",
+ rd->filename);
+ pr_out("Usage: %s link delete NAME\n", rd->filename);
return 0;
}
@@ -341,10 +344,74 @@ static int link_show(struct rd *rd)
return rd_exec_link(rd, link_one_show, true);
}
+static int link_add(struct rd *rd)
+{
+ char *name;
+ char *type = NULL;
+ char *dev = NULL;
+ uint32_t seq;
+
+ if (rd_no_arg(rd)) {
+ pr_err("No link name was supplied\n");
+ return -EINVAL;
+ }
+ name = rd_argv(rd);
+ rd_arg_inc(rd);
+ while (!rd_no_arg(rd)) {
+ if (rd_argv_match(rd, "type")) {
+ rd_arg_inc(rd);
+ type = rd_argv(rd);
+ } else if (rd_argv_match(rd, "netdev")) {
+ rd_arg_inc(rd);
+ dev = rd_argv(rd);
+ } else {
+ pr_err("Invalid parameter %s\n", rd_argv(rd));
+ return -EINVAL;
+ }
+ rd_arg_inc(rd);
+ }
+ if (!type) {
+ pr_err("No type was supplied\n");
+ return -EINVAL;
+ }
+ if (!dev) {
+ pr_err("No net device was supplied\n");
+ return -EINVAL;
+ }
+
+ rd_prepare_msg(rd, RDMA_NLDEV_CMD_NEWLINK, &seq,
+ (NLM_F_REQUEST | NLM_F_ACK));
+ mnl_attr_put_strz(rd->nlh, RDMA_NLDEV_ATTR_DEV_NAME, name);
+ mnl_attr_put_strz(rd->nlh, RDMA_NLDEV_ATTR_LINK_TYPE, type);
+ mnl_attr_put_strz(rd->nlh, RDMA_NLDEV_ATTR_NDEV_NAME, dev);
+ return rd_sendrecv_msg(rd, seq);
+}
+
+static int _link_del(struct rd *rd)
+{
+ uint32_t seq;
+
+ if (!rd_no_arg(rd)) {
+ pr_err("Unknown parameter %s\n", rd_argv(rd));
+ return -EINVAL;
+ }
+ rd_prepare_msg(rd, RDMA_NLDEV_CMD_DELLINK, &seq,
+ (NLM_F_REQUEST | NLM_F_ACK));
+ mnl_attr_put_u32(rd->nlh, RDMA_NLDEV_ATTR_DEV_INDEX, rd->dev_idx);
+ return rd_sendrecv_msg(rd, seq);
+}
+
+static int link_del(struct rd *rd)
+{
+ return rd_exec_require_dev(rd, _link_del);
+}
+
int cmd_link(struct rd *rd)
{
const struct rd_cmd cmds[] = {
{ NULL, link_show },
+ { "add", link_add },
+ { "delete", link_del },
{ "show", link_show },
{ "list", link_show },
{ "help", link_help },
diff --git a/rdma/rdma.h b/rdma/rdma.h
index 20be2f12c4f8..af4597f45640 100644
--- a/rdma/rdma.h
+++ b/rdma/rdma.h
@@ -79,6 +79,7 @@ struct rd_cmd {
*/
bool rd_no_arg(struct rd *rd);
void rd_arg_inc(struct rd *rd);
+bool rd_argv_match(struct rd *rd, const char *pattern);
char *rd_argv(struct rd *rd);
diff --git a/rdma/utils.c b/rdma/utils.c
index a6f2826c9605..85a954167511 100644
--- a/rdma/utils.c
+++ b/rdma/utils.c
@@ -32,7 +32,7 @@ int strcmpx(const char *str1, const char *str2)
return strncmp(str1, str2, strlen(str1));
}
-static bool rd_argv_match(struct rd *rd, const char *pattern)
+bool rd_argv_match(struct rd *rd, const char *pattern)
{
if (!rd_argc(rd))
return false;
--
1.8.3.1
^ permalink raw reply related
* [PATCH v1 iproute2-next 4/4] rdma: man page update for link add/delete
From: Steve Wise @ 2019-02-21 16:19 UTC (permalink / raw)
To: dsahern, leon; +Cc: stephen, netdev, linux-rdma
In-Reply-To: <cover.1550773362.git.swise@opengridcomputing.com>
Update the 'rdma link' man page with 'link add/delete' info.
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
---
man/man8/rdma-link.8 | 47 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 47 insertions(+)
diff --git a/man/man8/rdma-link.8 b/man/man8/rdma-link.8
index bddf34746e8b..b3b40de75852 100644
--- a/man/man8/rdma-link.8
+++ b/man/man8/rdma-link.8
@@ -23,6 +23,18 @@ rdma-link \- rdma link configuration
.RI "[ " DEV/PORT_INDEX " ]"
.ti -8
+.B rdma link add
+.BR NAME
+.BR type
+.BR TYPE
+.BR netdev
+.BR NETDEV
+
+.ti -8
+.B rdma link delete
+.RI NAME
+
+.ti -8
.B rdma link help
.SH "DESCRIPTION"
@@ -33,6 +45,31 @@ rdma-link \- rdma link configuration
- specifies the RDMA link to show.
If this argument is omitted all links are listed.
+.SS rdma link add NAME type TYPE netdev NETDEV - add an rdma link for the specified type to the network device
+.sp
+.BR NAME
+- specifies the new name of the rdma link to add
+
+.BR TYPE
+- specifies which rdma type to use. Link types:
+.sp
+.in +8
+.B rxe
+- Soft RoCE driver
+.sp
+.B siw
+- Soft iWARP driver
+.in -8
+
+.BR NETDEV
+- specifies the network device to which the link is bound
+
+.SS rdma link delete NAME - delete an rdma link
+.PP
+.BR NAME
+- specifies the name of the rdma link to delete
+.PP
+
.SH "EXAMPLES"
.PP
rdma link show
@@ -45,6 +82,16 @@ rdma link show mlx5_2/1
Shows the state of specified rdma link.
.RE
.PP
+rdma link add rxe_eth0 type rxe netdev eth0
+.RS 4
+Adds a RXE link named rxe_eth0 to network device eth0
+.RE
+.PP
+rdma link del rxe_eth0
+.RS 4
+Removes RXE link rxe_eth0
+.RE
+.PP
.SH SEE ALSO
.BR rdma (8),
--
1.8.3.1
^ permalink raw reply related
* Re: [RFC] rtnetlink: handle multiple vlan tags in set_vf_vlan
From: Stefano Brivio @ 2019-02-21 18:34 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Moshe Shemesh, netdev, Stephen Hemminger
In-Reply-To: <20190221175436.10767-1-sthemmin@microsoft.com>
On Thu, 21 Feb 2019 09:54:36 -0800
Stephen Hemminger <stephen@networkplumber.org> wrote:
> @@ -2224,13 +2223,15 @@ static int do_setvfinfo(struct net_device *dev, struct nlattr **tb)
>
> len++;
> }
> - if (len == 0)
> - return -EINVAL;
>
> - err = ops->ndo_set_vf_vlan(dev, ivvl[0]->vf, ivvl[0]->vlan,
> - ivvl[0]->qos, ivvl[0]->vlan_proto);
> - if (err < 0)
> - return err;
> + err = -EINVAL; /* empty list error */
> + for (i = 0; i < len; i++) {
> + err = ops->ndo_set_vf_vlan(dev, ivvl[i]->vf,
> + ivvl[i]->vlan, ivvl[i]->qos,
> + ivvl[i]->vlan_proto);
> + if (err < 0)
> + return err;
> + }
I think the:
if (err < 0)
return err;
should be outside the loop (with a "break;" inside), otherwise you won't
return anymore if len == 0.
--
Stefano
^ permalink raw reply
* Re: [PATCH net-next 0/6] net/smc: patches 2019-02-21
From: David Miller @ 2019-02-21 18:36 UTC (permalink / raw)
To: ubraun; +Cc: netdev, linux-s390, schwidefsky, heiko.carstens, raspl, kgraul
In-Reply-To: <20190221120103.10866-1-ubraun@linux.ibm.com>
From: Ursula Braun <ubraun@linux.ibm.com>
Date: Thu, 21 Feb 2019 13:00:57 +0100
> here are patches for SMC:
> * patch 1 is a cleanup without functional change
> * patches 2-6 enhance SMC pnetid support
Series applied, thanks.
^ permalink raw reply
* Re: [PATCH] ip_tunnel: Add ip tunnel tunnel_info dst_cache in ip_tunnel_xmit
From: David Miller @ 2019-02-21 18:37 UTC (permalink / raw)
To: wenxu; +Cc: netdev
In-Reply-To: <1550750930-27138-1-git-send-email-wenxu@ucloud.cn>
From: wenxu@ucloud.cn
Date: Thu, 21 Feb 2019 20:08:50 +0800
> From: wenxu <wenxu@ucloud.cn>
>
> ip l add dev tun type gretap key 1000
>
> Non-tunnel-dst ip tunnel device can send packet through lwtunnel.
> This patch provide the tun_info dst cache support for this mode
>
> Signed-off-by: wenxu <wenxu@ucloud.cn>
> ---
> net/ipv4/ip_tunnel.c | 25 ++++++++++++++++++++-----
> 1 file changed, 20 insertions(+), 5 deletions(-)
>
> diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
> index 893f013..874ad58 100644
> --- a/net/ipv4/ip_tunnel.c
> +++ b/net/ipv4/ip_tunnel.c
> @@ -662,6 +662,9 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
> unsigned int max_headroom; /* The extra header space needed */
> __be32 dst;
> bool connected;
> + bool use_cache = false;
> + bool md = false;
> + struct ip_tunnel_info *tun_info;
Reverse christmas tree, please.
^ permalink raw reply
* [iproute PATCH] ip-address: Use correct max attribute value in print_vf_stats64()
From: Phil Sutter @ 2019-02-21 18:37 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev
IFLA_VF_MAX is larger than the highest valid index in vf array.
Fixes: a1b99717c7cd7 ("Add displaying VF traffic statistics")
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
ip/ipaddress.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index bc30d326ca0a3..139afe9d572e6 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -547,7 +547,7 @@ static void print_vf_stats64(FILE *fp, struct rtattr *vfstats)
return;
}
- parse_rtattr_nested(vf, IFLA_VF_MAX, vfstats);
+ parse_rtattr_nested(vf, IFLA_VF_STATS_MAX, vfstats);
if (is_json_context()) {
open_json_object("stats");
--
2.20.1
^ permalink raw reply related
* Re: [PATCH net-next 0/2] Devlink health fixes series
From: David Miller @ 2019-02-21 18:39 UTC (permalink / raw)
To: eranbe; +Cc: netdev, jiri, ayal
In-Reply-To: <1550751122-2788-1-git-send-email-eranbe@mellanox.com>
From: Eran Ben Elisha <eranbe@mellanox.com>
Date: Thu, 21 Feb 2019 14:12:00 +0200
> This series includes two small fixes from Aya for the devlink health
> infrastructure introduced earlier in this window.
>
> First patch rename some UAPI attributes to better reflect their use.
> Second patch reduces the amount of data passed from the devlink to the
> netlink layer upon get reporter command, in case of no-recovery reporter.
Series applied, thanks.
^ permalink raw reply
* Re: [PATCH] sysctl: add proc_do_large_bitmap test node
From: Kees Cook @ 2019-02-21 18:40 UTC (permalink / raw)
To: Eric Sandeen
Cc: Eric Sandeen, Linux Kernel Mailing List, fsdevel,
Network Development, Luis Chamberlain
In-Reply-To: <8166cf23-db52-7679-3378-8523889a9cd0@sandeen.net>
On Thu, Feb 21, 2019 at 9:45 AM Eric Sandeen <sandeen@sandeen.net> wrote:
>
> Add a test node for proc_do_large_bitmap to the test_sysctl.c
> infrastructure. It's sized the same as the one existing user.
>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Acked-by: Kees Cook <keescook@chromium.org>
-Kees
> ---
>
> diff --git a/lib/test_sysctl.c b/lib/test_sysctl.c
> index 3dd801c1c85b..1263be4ebfaf 100644
> --- a/lib/test_sysctl.c
> +++ b/lib/test_sysctl.c
> @@ -47,6 +47,9 @@ struct test_sysctl_data {
> unsigned int uint_0001;
>
> char string_0001[65];
> +
> +#define SYSCTL_TEST_BITMAP_SIZE 65536
> + unsigned long *bitmap_0001;
> };
>
> static struct test_sysctl_data test_data = {
> @@ -102,6 +106,13 @@ static struct ctl_table test_table[] = {
> .mode = 0644,
> .proc_handler = proc_dostring,
> },
> + {
> + .procname = "bitmap_0001",
> + .data = &test_data.bitmap_0001,
> + .maxlen = SYSCTL_TEST_BITMAP_SIZE,
> + .mode = 0644,
> + .proc_handler = proc_do_large_bitmap,
> + },
> { }
> };
>
> @@ -129,15 +140,21 @@ static struct ctl_table_header *test_sysctl_header;
>
> static int __init test_sysctl_init(void)
> {
> + test_data.bitmap_0001 = kzalloc(SYSCTL_TEST_BITMAP_SIZE/8, GFP_KERNEL);
> + if (!test_data.bitmap_0001)
> + return -ENOMEM;
> test_sysctl_header = register_sysctl_table(test_sysctl_root_table);
> - if (!test_sysctl_header)
> + if (!test_sysctl_header) {
> + kfree(test_data.bitmap_0001);
> return -ENOMEM;
> + }
> return 0;
> }
> late_initcall(test_sysctl_init);
>
> static void __exit test_sysctl_exit(void)
> {
> + kfree(test_data.bitmap_0001);
> if (test_sysctl_header)
> unregister_sysctl_table(test_sysctl_header);
> }
>
--
Kees Cook
^ permalink raw reply
* [PATCH] test_sysctl: add proc_do_large_bitmap test function
From: Eric Sandeen @ 2019-02-21 18:43 UTC (permalink / raw)
To: Linux Kernel Mailing List, fsdevel, netdev; +Cc: Luis Chamberlain, Kees Cook
In-Reply-To: <8166cf23-db52-7679-3378-8523889a9cd0@sandeen.net>
Add test to build up bitmap range string and test the bitmap
proc handler.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
nb: test_modprobe & load_req_mod fail for me before we ever
get to this test, but commenting them out, my test runs as expected.
I'm new to this script, so careful review would be wise. ;)
Thanks,
-Eric
diff --git a/tools/testing/selftests/sysctl/sysctl.sh b/tools/testing/selftests/sysctl/sysctl.sh
index 584eb8ea780a..c710b09e2d69 100755
--- a/tools/testing/selftests/sysctl/sysctl.sh
+++ b/tools/testing/selftests/sysctl/sysctl.sh
@@ -37,6 +37,7 @@ ALL_TESTS="$ALL_TESTS 0002:1:1"
ALL_TESTS="$ALL_TESTS 0003:1:1"
ALL_TESTS="$ALL_TESTS 0004:1:1"
ALL_TESTS="$ALL_TESTS 0005:3:1"
+ALL_TESTS="$ALL_TESTS 0006:3:1"
test_modprobe()
{
@@ -149,6 +150,9 @@ reset_vals()
string_0001)
VAL="(none)"
;;
+ bitmap_0001)
+ VAL=""
+ ;;
*)
;;
esac
@@ -548,6 +552,47 @@ run_stringtests()
test_rc
}
+run_bitmaptest() {
+ # Total length of bitmaps string to use, a bit under
+ # the maximum input size of the test node
+ LENGTH=$((RANDOM % 65000))
+
+ # First bit to set
+ BIT=$((RANDOM % 1024))
+
+ # String containing our list of bits to set
+ TEST_STR=$BIT
+
+ # build up the string
+ while [ "${#TEST_STR}" -le "$LENGTH" ]; do
+ # Make sure next entry is discontiguous,
+ # skip ahead at least 2
+ BIT=$((BIT + $((2 + RANDOM % 10))))
+
+ # Add new bit to the list
+ TEST_STR="${TEST_STR},${BIT}"
+
+ # Randomly make it a range
+ if [ "$((RANDOM % 2))" -eq "1" ]; then
+ RANGE_END=$((BIT + $((1 + RANDOM % 10))))
+ TEST_STR="${TEST_STR}-${RANGE_END}"
+ BIT=$RANGE_END
+ fi
+ done
+
+ echo -n "Checking bitmap handler... "
+ set_orig
+ echo -n $TEST_STR > $TARGET 2> /dev/null
+
+ if verify "${TARGET}"; then
+ echo "FAIL" >&2
+ rc=1
+ else
+ echo "ok"
+ fi
+ test_rc
+}
+
sysctl_test_0001()
{
TARGET="${SYSCTL}/int_0001"
@@ -605,6 +650,14 @@ sysctl_test_0005()
run_limit_digit_int_array
}
+sysctl_test_0006()
+{
+ TARGET="${SYSCTL}/bitmap_0001"
+ reset_vals
+ ORIG=$(cat "${TARGET}")
+ run_bitmaptest
+}
+
list_tests()
{
echo "Test ID list:"
@@ -618,6 +671,7 @@ list_tests()
echo "0003 x $(get_test_count 0003) - tests proc_dointvec()"
echo "0004 x $(get_test_count 0004) - tests proc_douintvec()"
echo "0005 x $(get_test_count 0005) - tests proc_douintvec() array"
+ echo "0006 x $(get_test_count 0006) - tests proc_do_large_bitmap"
}
test_reqs
^ permalink raw reply related
* Re: [PATCH net-next 1/1] qed: Read device port count from the shmem
From: David Miller @ 2019-02-21 18:51 UTC (permalink / raw)
To: skalluru; +Cc: netdev, aelior, mkalderon
In-Reply-To: <20190221140331.24119-1-skalluru@marvell.com>
From: Sudarsana Reddy Kalluru <skalluru@marvell.com>
Date: Thu, 21 Feb 2019 06:03:31 -0800
> Read port count from the shared memory instead of driver deriving this
> value. This change simplifies the driver implementation and also avoids
> any dependencies for finding the port-count.
>
> Signed-off-by: Sudarsana Reddy Kalluru <skalluru@marvell.com>
> Signed-off-by: Michal Kalderon <mkalderon@marvell.com>
Applied.
^ permalink raw reply
* Re: [RFC] rtnetlink: handle multiple vlan tags in set_vf_vlan
From: Stephen Hemminger @ 2019-02-21 18:52 UTC (permalink / raw)
To: Stefano Brivio; +Cc: Moshe Shemesh, netdev, Stephen Hemminger
In-Reply-To: <20190221193457.7861791e@redhat.com>
On Thu, 21 Feb 2019 19:34:57 +0100
Stefano Brivio <sbrivio@redhat.com> wrote:
> On Thu, 21 Feb 2019 09:54:36 -0800
> Stephen Hemminger <stephen@networkplumber.org> wrote:
>
> > @@ -2224,13 +2223,15 @@ static int do_setvfinfo(struct net_device *dev, struct nlattr **tb)
> >
> > len++;
> > }
> > - if (len == 0)
> > - return -EINVAL;
> >
> > - err = ops->ndo_set_vf_vlan(dev, ivvl[0]->vf, ivvl[0]->vlan,
> > - ivvl[0]->qos, ivvl[0]->vlan_proto);
> > - if (err < 0)
> > - return err;
> > + err = -EINVAL; /* empty list error */
> > + for (i = 0; i < len; i++) {
> > + err = ops->ndo_set_vf_vlan(dev, ivvl[i]->vf,
> > + ivvl[i]->vlan, ivvl[i]->qos,
> > + ivvl[i]->vlan_proto);
> > + if (err < 0)
> > + return err;
> > + }
>
> I think the:
>
> if (err < 0)
> return err;
>
> should be outside the loop (with a "break;" inside), otherwise you won't
> return anymore if len == 0.
>
Your right with empty list it would fall through and look at other attributes
which could overwrite err.
^ permalink raw reply
* Re: [PATCH] bpfilter: remove extra header search paths for bpfilter_umh
From: David Miller @ 2019-02-21 19:00 UTC (permalink / raw)
To: yamada.masahiro; +Cc: linux, ast, daniel, netdev, linux-kernel
In-Reply-To: <CAK7LNASfiSrULgdG_tcm+m4wmyOjg4ZHYAB9EUgaGrjv=g-Zbg@mail.gmail.com>
From: Masahiro Yamada <yamada.masahiro@socionext.com>
Date: Fri, 22 Feb 2019 00:54:47 +0900
> On Thu, Feb 21, 2019 at 11:46 PM Guenter Roeck <linux@roeck-us.net> wrote:
>>
>> On Thu, Jan 31, 2019 at 12:15:35PM +0900, Masahiro Yamada wrote:
>> > Currently, the header search paths -Itools/include and
>> > -Itools/include/uapi are not used. Let's drop the unused code.
>> >
>> > We can remove -I. too by fixing up one C file.
>> >
>>
>> This patch reintroduces the problem last fixed with commit ae40832e53c3
>> ("bpfilter: fix a build err"). Seen (at least) with gcc 7.4.0, 8.2.0.
>> binutils version is 2.31.1. Reverting this patch fixes the problem.
>
>
> Hmm. I cannot reproduce the build error with my gcc,
> but you are right.
>
>
> I'd like to get back only
> 'KBUILD_HOSTCFLAGS += -Itools/include/ -Itools/include/uapi'
> instead of the full revert.
>
> If David is fine with it, I can send a patch with filling commit log.
If that really fixes the build regression, sure.
^ permalink raw reply
* Re: [PATCH] test_sysctl: add proc_do_large_bitmap test function
From: Eric Sandeen @ 2019-02-21 19:01 UTC (permalink / raw)
To: Eric Sandeen, Linux Kernel Mailing List, fsdevel, netdev
Cc: Luis Chamberlain, Kees Cook
In-Reply-To: <a8caf97b-9dbb-5846-7e93-242226a6c8c7@redhat.com>
On 2/21/19 12:43 PM, Eric Sandeen wrote:
> Add test to build up bitmap range string and test the bitmap
> proc handler.
>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
>
> nb: test_modprobe & load_req_mod fail for me before we ever
> get to this test, but commenting them out, my test runs as expected.
> I'm new to this script, so careful review would be wise. ;)
>
> Thanks,
> -Eric
Gah, running this in different ways, it's not doing the right thing.
Hang on, V2 pending...
^ 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