for resilient NH groups
nexthop: Add data structures for resilient group notifications
nexthop: Allow setting "offload" and "trap" indication of nexthop
buckets
nexthop: Allow reporting activity of nexthop buckets
Petr Machata (10):
nexthop: Pass nh_config to replace_n
David Ahern writes:
> When you get to the end of the sets, it would be good to submit
> documentation for resilient multipath under Documentation/networking
All right.
David Ahern writes:
> On 3/11/21 8:39 AM, Petr Machata wrote:
>>
>> David Ahern writes:
>>
>>>> diff --git a/include/net/nexthop.h b/include/net/nexthop.h
>>>> index 7bc057aee40b..5062c2c08e2b 100644
>>>> --- a/include/net/nexth
David Ahern writes:
> On 3/11/21 8:45 AM, Petr Machata wrote:
>>
>> David Ahern writes:
>>
>>> On 3/10/21 8:02 AM, Petr Machata wrote:
>>>> diff --git a/include/uapi/linux/nexthop.h b/include/uapi/linux/nexthop.h
>>>> index 2d4a1e784
David Ahern writes:
> On 3/10/21 8:02 AM, Petr Machata wrote:
>> diff --git a/include/uapi/linux/nexthop.h b/include/uapi/linux/nexthop.h
>> index 2d4a1e784cf0..8efebf3cb9c7 100644
>> --- a/include/uapi/linux/nexthop.h
>> +++ b/include/uapi/linux/nexthop.h
David Ahern writes:
>> diff --git a/include/net/nexthop.h b/include/net/nexthop.h
>> index 7bc057aee40b..5062c2c08e2b 100644
>> --- a/include/net/nexthop.h
>> +++ b/include/net/nexthop.h
>> @@ -80,6 +80,7 @@ struct nh_grp_entry {
>> struct nh_group {
>> struct nh_group *spare; /*
Now that all the code is in place, stop rejecting requests to create
resilient next-hop groups.
Signed-off-by: Petr Machata
Reviewed-by: Ido Schimmel
---
net/ipv4/nexthop.c | 4
1 file changed, 4 deletions(-)
diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c
index 015a47e8163a
Implement the netlink messages that allow creation and dumping of resilient
nexthop groups.
Signed-off-by: Petr Machata
Reviewed-by: Ido Schimmel
---
Notes:
v1 (changes since RFC):
- u32 -> u16 for bucket counts / indices
net/ipv4/nexthop.c |
Add a dump handler for resilient next hop buckets. When next-hop group ID
is given, it walks buckets of that group, otherwise it walks buckets of all
groups. It then dumps the buckets whose next hops match the given filtering
criteria.
Signed-off-by: Petr Machata
Reviewed-by: Ido Schimmel
the
transaction back. This notification allows the driver to take a look and
veto the new proposed group up front, before anything is committed.
Signed-off-by: Petr Machata
Reviewed-by: Ido Schimmel
---
Notes:
v1 (changes since RFC):
- u32 -> u16 for bucket counts / indices
Nexthop replacements et.al. are notified through netlink, but if a delayed
work migrates buckets on the background, userspace will stay oblivious.
Notify these as RTM_NEWNEXTHOPBUCKET events.
Signed-off-by: Petr Machata
Reviewed-by: Ido Schimmel
---
Notes:
v1 (changes since RFC):
- u32
Allow getting (but not setting) individual buckets to inspect the next hop
mapped therein, idle time, and flags.
Signed-off-by: Petr Machata
Reviewed-by: Ido Schimmel
---
Notes:
v1 (changes since RFC):
- u32 -> u16 for bucket counts / indices
net/ipv4/nexthop.c |
hardware.
Add a function that can be periodically called by device drivers to
report activity on nexthop buckets after querying it from the underlying
device.
Signed-off-by: Ido Schimmel
Reviewed-by: Petr Machata
Signed-off-by: Petr Machata
---
Notes:
v1 (changes since RFC):
- u32
From: Ido Schimmel
Add a function that can be called by device drivers to set "offload" or
"trap" indication on nexthop buckets following nexthop notifications and
other changes such as a neighbour becoming invalid.
Signed-off-by: Ido Schimmel
Reviewed-by: Petr Machata
es not handle
notifications towards drivers, which are kept as if the group were an mpath
one. It does not handle netlink either. The only bit currently exposed to
user space is the new next-hop group type, and that is currently bounced.
There is therefore no way to actually access this code.
Sign
Therefore,
introduce a new flag, that should be set for next-hop groups that have more
than one nexthop, and should be considered multipath.
Signed-off-by: Petr Machata
Reviewed-by: Ido Schimmel
---
Notes:
v1 (changes since RFC):
- This patch is new
include/net/nexthop.h | 7 ---
type for now.
Signed-off-by: Ido Schimmel
Reviewed-by: Petr Machata
Signed-off-by: Petr Machata
---
Notes:
v1 (changes since RFC):
- u32 -> u16 for bucket counts / indices
include/uapi/linux/nexthop.h | 43 ++
include/uapi/linux/rtnetlink.h |
From: Ido Schimmel
Add data structures that will be used for in-kernel notifications about
addition / deletion of a resilient nexthop group and about changes to a
hash bucket within a resilient group.
Signed-off-by: Ido Schimmel
Reviewed-by: Petr Machata
Signed-off-by: Petr Machata
ow setting "offload" and "trap" indication of nexthop
buckets
nexthop: Allow reporting activity of nexthop buckets
Petr Machata (10):
nexthop: Pass nh_config to replace_nexthop()
nexthop: __nh_notifier_single_info_init(): Make nh_info an argument
nexthop: Add a dedi
replacement, propagate `cfg'
to replace_nexthop() and further to replace_nexthop_grp().
Signed-off-by: Petr Machata
Reviewed-by: Ido Schimmel
---
net/ipv4/nexthop.c | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c
function to its callers to make it possible to use a
different synchronization guarantee.
Signed-off-by: Petr Machata
Reviewed-by: Ido Schimmel
---
net/ipv4/nexthop.c | 12 +++-
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c
index
eeds to fit into one attribute, which limits the size to some
64K, so from UAPI direction this will never overflow. From the
command-line direction, size of 'struct app' is 4 bytes, so to overflow
you'd need to stuff in 1G APP entries. I think we don't need to worry
about that.
So this looks good.
Reviewed-by: Petr Machata
David Ahern writes:
> On 2/8/21 1:42 PM, Petr Machata wrote:
>> @@ -212,7 +254,7 @@ static inline bool nexthop_is_multipath(const struct
>> nexthop *nh)
>> struct nh_group *nh_grp;
>>
>> nh_grp = rcu_dereference_rtnl(nh->nh
Ido Schimmel writes:
> On Sat, Feb 13, 2021 at 12:16:45PM -0700, David Ahern wrote:
>> On 2/8/21 1:42 PM, Petr Machata wrote:
>> > @@ -52,8 +53,50 @@ enum {
>> >NHA_FDB,/* flag; nexthop belongs to a bridge fdb */
>> >/* if NHA_FDB is added,
a duplicate address. The described change of behavior therefore constitutes
a breakage. Revert it.
Fixes: c9dca822c729 ("net-loopback: set lo dev initial state to UP")
Signed-off-by: Petr Machata
---
drivers/net/loopback.c | 6 --
1 file changed, 6 deletions(-)
diff --git a/drivers/net/
Jakub Kicinski writes:
> Thanks for the report, could you send a revert with this explanation?
Sure.
Jian Yang writes:
> From: Jian Yang
>
> Traditionally loopback devices come up with initial state as DOWN for
> any new network-namespace. This would mean that anyone needing this
> device would have to bring this UP by issuing something like 'ip link
> set lo up'. This can be avoided if the i
Allow getting (but not setting) individual buckets to inspect the next hop
mapped therein, idle time, and flags.
Signed-off-by: Petr Machata
Reviewed-by: Ido Schimmel
---
net/ipv4/nexthop.c | 110 -
1 file changed, 109 insertions(+), 1 deletion
Add a dump handler for resilient next hop buckets. When next-hop group ID
is given, it walks buckets of that group, otherwise it walks buckets of all
groups. It then dumps the buckets whose next hops match the given filtering
criteria.
Signed-off-by: Petr Machata
Reviewed-by: Ido Schimmel
Implement the netlink messages that allow creation and dumping of resilient
nexthop groups.
Signed-off-by: Petr Machata
Reviewed-by: Ido Schimmel
---
net/ipv4/nexthop.c | 150 +++--
1 file changed, 145 insertions(+), 5 deletions(-)
diff --git a/net/ipv4
Nexthop replacements et.al. are notified through netlink, but if a delayed
work migrates buckets on the background, userspace will stay oblivious.
Notify these as RTM_NEWNEXTHOPBUCKET events.
Signed-off-by: Petr Machata
Reviewed-by: Ido Schimmel
---
net/ipv4/nexthop.c | 45
Now that all the code is in place, stop rejecting requests to create
resilient next-hop groups.
Signed-off-by: Petr Machata
Reviewed-by: Ido Schimmel
---
net/ipv4/nexthop.c | 4
1 file changed, 4 deletions(-)
diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c
index 4d89522fed4b
hardware.
Add a function that can be periodically called by device drivers to
report activity on nexthop buckets after querying it from the underlying
device.
Signed-off-by: Ido Schimmel
Reviewed-by: Petr Machata
Signed-off-by: Petr Machata
---
include/net/nexthop.h | 2 ++
net/ipv4/nexthop.c
the
transaction back. This notification allows the driver to take a look and
veto the new proposed group up front, before anything is committed.
Signed-off-by: Petr Machata
Reviewed-by: Ido Schimmel
---
net/ipv4/nexthop.c | 320 +++--
1 file changed
From: Ido Schimmel
Add data structures that will be used for in-kernel notifications about
addition / deletion of a resilient nexthop group and about changes to a
hash bucket within a resilient group.
Signed-off-by: Ido Schimmel
Reviewed-by: Petr Machata
Signed-off-by: Petr Machata
From: Ido Schimmel
Add a function that can be called by device drivers to set "offload" or
"trap" indication on nexthop buckets following nexthop notifications and
other changes such as a neighbour becoming invalid.
Signed-off-by: Ido Schimmel
Reviewed-by: Petr Machata
type for now.
Signed-off-by: Ido Schimmel
Reviewed-by: Petr Machata
Signed-off-by: Petr Machata
---
include/uapi/linux/nexthop.h | 43 ++
include/uapi/linux/rtnetlink.h | 7 ++
net/ipv4/nexthop.c | 2 ++
security/selinux/nlmsgtab.c| 5
es not handle
notifications towards drivers, which are kept as if the group were an mpath
one. It does not handle netlink either. The only bit currently exposed to
user space is the new next-hop group type, and that is currently bounced.
There is therefore no way to actually access this code.
Sign
function to its callers to make it possible to use a
different synchronization guarantee.
Signed-off-by: Petr Machata
Reviewed-by: Ido Schimmel
---
net/ipv4/nexthop.c | 12 +++-
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c
index
for resilient group notifications
nexthop: Allow setting "offload" and "trap" indication of nexthop
buckets
nexthop: Allow reporting activity of nexthop buckets
Petr Machata (9):
nexthop: Pass nh_config to replace_nexthop()
nexthop: __nh_notifier_single_info_init(
replacement, propagate `cfg'
to replace_nexthop() and further to replace_nexthop_grp().
Signed-off-by: Petr Machata
Reviewed-by: Ido Schimmel
---
net/ipv4/nexthop.c | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c
. Propagate the constness to
nh_valid_get_del_req().
Signed-off-by: Petr Machata
Reviewed-by: Ido Schimmel
---
net/ipv4/nexthop.c | 43 +--
1 file changed, 25 insertions(+), 18 deletions(-)
diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c
index
In order to allow different handling for next-hop tree dumper and for
bucket dumper, parameterize the next-hop tree walker with a callback. Add
rtm_dump_nexthop_cb() with just the bits relevant for next-hop tree
dumping.
Signed-off-by: Petr Machata
Reviewed-by: Ido Schimmel
---
net/ipv4
helper struct with a NH
index, and instead of using the .args array directly, use it through this
structure.
Signed-off-by: Petr Machata
Reviewed-by: Ido Schimmel
---
net/ipv4/nexthop.c | 18 --
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/nexthop.c b/net
one.
Signed-off-by: Petr Machata
Reviewed-by: Ido Schimmel
---
net/ipv4/nexthop.c | 44
1 file changed, 24 insertions(+), 20 deletions(-)
diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c
index 7149b12c4703..ad48e5d71bf9 100644
--- a/net/ipv4
Extract from rtm_dump_nexthop() a helper to walk the next hop tree. A
separate function for this will be reusable from the bucket dumper.
Signed-off-by: Petr Machata
Reviewed-by: Ido Schimmel
---
net/ipv4/nexthop.c | 52 +-
1 file changed, 33
thin wrapper around it.
Signed-off-by: Petr Machata
Reviewed-by: Ido Schimmel
---
net/ipv4/nexthop.c | 31 +++
1 file changed, 19 insertions(+), 12 deletions(-)
diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c
index ad48e5d71bf9..1c4f10fe3b4e 100644
--- a/net/ipv4
The values that a next-hop group needs to keep track of depend on the group
type. Introduce a union to separate fields specific to the mpath groups
from fields specific to other group types.
Signed-off-by: Petr Machata
Reviewed-by: Ido Schimmel
---
include/net/nexthop.h | 7 ++-
net/ipv4
From: David Ahern
nexthop_free_mpath really should be nexthop_free_group. Rename it.
Signed-off-by: David Ahern
Reviewed-by: Ido Schimmel
Signed-off-by: Petr Machata
---
net/ipv4/nexthop.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/nexthop.c b/net/ipv4
chimmel (1):
nexthop: Use enum to encode notification type
Petr Machata (10):
nexthop: Dispatch nexthop_select_path() by group type
nexthop: Introduce to struct nh_grp_entry a per-type union
nexthop: Assert the invariant that a NH group is of only one type
nexthop: Dispatch notifier init()/fini(
After there are several next-hop group types, initialization and
finalization of notifier type needs to reflect the actual type. Transform
nh_notifier_grp_info_init() and _fini() to make extending them easier.
Signed-off-by: Petr Machata
Reviewed-by: Ido Schimmel
---
net/ipv4/nexthop.c | 25
extensible interface. Instead, convert it to an
enum.
Signed-off-by: Ido Schimmel
Reviewed-by: Petr Machata
Signed-off-by: Petr Machata
---
.../ethernet/mellanox/mlxsw/spectrum_router.c | 54 ++-
drivers/net/netdevsim/fib.c | 23
i
The logic for selecting path depends on the next-hop group type. Adapt the
nexthop_select_path() to dispatch according to the group type.
Signed-off-by: Petr Machata
Reviewed-by: Ido Schimmel
---
net/ipv4/nexthop.c | 22 --
1 file changed, 16 insertions(+), 6 deletions
such place
into nexthop_create_group(), such that the check is done before the code
that relies on that invariant is invoked.
Signed-off-by: Petr Machata
Reviewed-by: Ido Schimmel
---
net/ipv4/nexthop.c | 7 +--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/nexthop.c
or
> any error distinct from -EOPNOTSUPP. But if all the callbacks return
> -EOPNOTSUPP, make sure that ->handled stays false, so the logic in
> switchdev_port_obj_notify() can propagate that information.
>
> Fixes: f30f0601eb93 ("switchdev: Add helpers to aid traversal through lower
> devices")
> Signed-off-by: Rasmus Villemoes
Looks good.
Reviewed-by: Petr Machata
Thanks!
replace NHA_MAX for ARRAY_SIZE as appropriate.
Note that with this commit, NHA_MAX and __NHA_MAX are not used anymore.
Leave them in purely as a user API.
Signed-off-by: Petr Machata
---
Notes:
v2:
- Do not specify size of the policy array. Use ARRAY_SIZE instead
of NHA_MAX
net
This function uses the global nexthop policy only to then bounce all
arguments except for NHA_ID. Instead, just create a new policy that
only includes the one allowed attribute.
Signed-off-by: Petr Machata
---
Notes:
v2:
- Do not specify size of the policy array. Use ARRAY_SIZE instead
This function uses the global nexthop policy, but only accepts four
particular attributes. Create a new policy that only includes the four
supported attributes, and use it. Convert the loop to a series of ifs.
Signed-off-by: Petr Machata
---
Notes:
v2:
- Do not specify size of the
ZE instead
of NHA_MAX
- Patch #2:
- Convert manual setting of true to nla_get_flag().
Petr Machata (3):
nexthop: Use a dedicated policy for nh_valid_get_del_req()
nexthop: Use a dedicated policy for nh_valid_dump_req()
nexthop: Specialize rtm_nh_policy
net/ipv4/nexth
Jakub Kicinski writes:
> On Mon, 18 Jan 2021 15:05:24 +0100 Petr Machata wrote:
>> +if (tb[NHA_GROUPS])
>> +*group_filter = true;
>> +if (tb[NHA_FDB])
>> +*fdb_filter = true;
>
> nla_get_flag()
OK.
David Ahern writes:
> On 1/19/21 1:55 PM, Jakub Kicinski wrote:
>>> diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c
>>> index e53e43aef785..d5d88f7c5c11 100644
>>> --- a/net/ipv4/nexthop.c
>>> +++ b/net/ipv4/nexthop.c
>>> @@ -36,6 +36,10 @@ static const struct nla_policy rtm_nh_policy[NHA_
This policy is currently only used for creation of new next hops and new
next hop groups. Rename it accordingly and remove the two attributes that
are not valid in that context: NHA_GROUPS and NHA_MASTER.
Signed-off-by: Petr Machata
Reviewed-by: Ido Schimmel
---
net/ipv4/nexthop.c | 11
This function uses the global nexthop policy only to then bounce all
arguments except for NHA_ID. Instead, just create a new policy that
only includes the one allowed attribute.
Signed-off-by: Petr Machata
Reviewed-by: Ido Schimmel
---
net/ipv4/nexthop.c | 21 ++---
1 file
This function uses the global nexthop policy, but only accepts four
particular attributes. Create a new policy that only includes the four
supported attributes, and use it. Convert the loop to a series of ifs.
Signed-off-by: Petr Machata
Reviewed-by: Ido Schimmel
---
net/ipv4/nexthop.c | 57
From: Petr Machata
There is currently one policy that covers all attributes for next hop
object management. Actual validation is then done in code, which makes it
unobvious which attributes are acceptable when, and indeed that everything
is rejected as necessary.
In this series, split
)
> Fixes: 44396bdfcc0a ("lib: Move get_size() from tc here")
> Fixes: adbe5de96662 ("lib: Move sprint_size() from tc here, add print_size()")
>
> Signed-off-by: Roi Dayan
Looking good:
$ ldd ip/ip | grep libm.so
$ ldd dcb/dcb | grep libm.so
libm.so.6 => /lib64/libm.so.6 (0x7f204d0c2000)
Reviewed-by: Petr Machata
Tested-by: Petr Machata
To allow building a new suite of DCB tools on an older kernel, carry a copy
of dcbnl.h.
Signed-off-by: Petr Machata
---
include/uapi/linux/dcbnl.h | 769 +
1 file changed, 769 insertions(+)
create mode 100644 include/uapi/linux/dcbnl.h
diff --git a/include
g backward compatibility.
Fixes: 2f90b8657ec9 ("ixgbe: this patch adds support for DCB to the kernel and
ixgbe driver")
Fixes: 826f328e2b7e ("net: dcb: Validate netlink message in DCB handler")
Signed-off-by: Petr Machata
---
net/dcb/dcbnl.c | 2 +-
1 file changed, 1 insertion
Roi Dayan writes:
> diff --git a/lib/json_print_math.c b/lib/json_print_math.c
> new file mode 100644
> index ..3d560defcd3e
> --- /dev/null
> +++ b/lib/json_print_math.c
> @@ -0,0 +1,46 @@
> +/*
> + * json_print_math.c "print regular or json output, based on
> json_writer"
Stephen Hemminger writes:
> On Thu, 7 Jan 2021 09:13:34 +0200
> Roi Dayan wrote:
>
>> +#define _IS_JSON_CONTEXT(type) ((type & PRINT_JSON || type & PRINT_ANY) &&
>> is_json_context())
>> +#define _IS_FP_CONTEXT(type) (!is_json_context() && (type & PRINT_FP ||
>> type & PRINT_ANY))
>
> You c
Ido Schimmel writes:
> +Petr
>
> On Thu, Jan 07, 2021 at 01:17:20AM +0200, Vladimir Oltean wrote:
>> static int mlxsw_sp_port_obj_add(struct net_device *dev,
>> const struct switchdev_obj *obj,
>> - struct switchdev_trans *trans,
>>
Stephen Hemminger writes:
> On Wed, 6 Jan 2021 10:42:35 +0200
> Roi Dayan wrote:
>
>> >
>> > I think that just adding an unnecessary -lm is more of a tidiness issue
>> > than anything else. One way to avoid it is to split the -lm deps out
>> > from util.c / json_print.c to like util_math.c /
Roi Dayan writes:
> On 2021-01-06 3:16 PM, Petr Machata wrote:
>> Regarding the publishing, the _jw reference can be changed to a call to
>> is_json_context(), which does the same thing. Then _jw can stay private
>> in json_print.c.
>> Exposing an _IS_JSON_CONTEXT /
Roi Dayan writes:
> On 2021-01-06 10:42 AM, Roi Dayan wrote:
>>
>> On 2021-01-04 6:07 PM, Petr Machata wrote:
>>>
>>> I think that just adding an unnecessary -lm is more of a tidiness issue
>>> than anything else. One way to avoid it is to split the -
Roi Dayan writes:
> Since moving get_rate() and get_size() from tc to lib, on some
> systems we fail to link because of missing the math lib.
> Move the link flag from tc makefile to the main makefile.
Hmm, yeah, it gets optimized out on x86-64. The issue is reproducible
on any platform with -
This to keep compatible with the major tools, ip and tc. Also
document the option in the man page, which was neglected.
Fixes: 67033d1c1c8a ("Add skeleton of a new tool, dcb")
Signed-off-by: Petr Machata
---
Notes:
v2:
- Add Fixes: tag.
dcb/dcb.c | 8
man/man8
DCB socket buffer is allocated in dcb_init(), but never freed(). Free it
in dcb_fini().
Fixes: 67033d1c1c8a ("Add skeleton of a new tool, dcb")
Signed-off-by: Petr Machata
---
Notes:
v2:
- Add Fixes: tag.
dcb/dcb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/dcb/d
dcb currently sends all netlink messages with a type RTM_GETDCB, even the
set ones. Change to the appropriate type.
Fixes: 67033d1c1c8a ("Add skeleton of a new tool, dcb")
Signed-off-by: Petr Machata
---
Notes:
v2:
- Add Fixes: tag.
dcb/dcb.c | 2 +-
1 file changed, 1 inser
:
- Add Fixes: tag.
Petr Machata (3):
dcb: Set values with RTM_SETDCB type
dcb: Plug a leaking DCB socket buffer
dcb: Change --Netns/-N to --netns/-n
dcb/dcb.c | 11 ++-
man/man8/dcb.8 | 7 +++
2 files changed, 13 insertions(+), 5 deletions(-)
--
2.26.2
Stephen Hemminger writes:
> On Sat, 2 Jan 2021 00:25:50 +0100
> Petr Machata wrote:
>
>> dcb currently sends all netlink messages with a type RTM_GETDCB, even the
>> set ones. Change to the appropriate type.
>>
>> Signed-off-by: Petr Machata
>> ---
is similar to dcb_set_attribute(), but does
not encapsulate the payload in an IEEE container. Rewrite
dcb_set_attribute() compatibly in terms of the new functions.
Signed-off-by: Petr Machata
---
dcb/dcb.c | 99 ++-
dcb/dcb.h | 7
2 files
dev eni1np1
dscp-prio 0:0 CS3:3 CS6:6
# dcb app add dev eni1np1 dscp-prio CS3:4
# dcb app show dev eni1np1
dscp-prio 0:0 CS3:3 CS3:4 CS6:6
# dcb app replace dev eni1np1 dscp-prio CS3:5
# dcb app show dev eni1np1
dscp-prio 0:0 CS3:5 CS6:6
Signed-off-by: Petr Machata
Some DSCP values can be translated to symbolic names. That may not be
always desirable. Introduce a command-line option similar to other tools,
-N or --Numeric, to suppress this translation.
Signed-off-by: Petr Machata
---
Notes:
v2:
- Make it -N / --Numeric instead of -n / --no-nice
For formatting DSCP (not full dsfield), it would be handy to be able to
just get the name from the name table, and not get any of the remaining
cruft related to formatting. Add a new entry point to just fetch the
name table string uninterpreted. Use it from rtnl_dsfield_n2a().
Signed-off-by: Petr
l". Publish the latter as well.
Signed-off-by: Petr Machata
---
include/utils.h | 5 +
lib/utils.c | 37 +++--
2 files changed, 36 insertions(+), 6 deletions(-)
diff --git a/include/utils.h b/include/utils.h
index 1704392525a2..f1403f7306a0 100644
--- a
ieee
# dcb dcbx show dev eni1np1
host ieee
Signed-off-by: Petr Machata
---
dcb/Makefile| 1 +
dcb/dcb.c | 4 +-
dcb/dcb.h | 4 +
dcb/dcb_dcbx.c | 192
man/man8/dcb-dcbx.8 | 108
- Patch #6:
- Adjust to s/no_nice_names/numeric/ from another patch.
Petr Machata (7):
lib: rt_names: Add rtnl_dsfield_get_name()
lib: Generalize parse_mapping()
dcb: Generalize dcb_set_attribute()
dcb: Generalize dcb_get_attribute()
dcb: Support -N to suppress translation to human-readable n
() as a thin wrapper for
IEEE-nested access, and dcb_get_attribute_bare() for access to attributes
that are not nested.
Signed-off-by: Petr Machata
---
dcb/dcb.c | 79 ---
dcb/dcb.h | 4 +++
2 files changed, 68 insertions(+), 15 deletions(-)
diff
dcb currently sends all netlink messages with a type RTM_GETDCB, even the
set ones. In patch #1, send the setters as RTM_SETDCB.
In patch #2, plug a leak.
In patch #3, change the command line option for namespace change from
devlink-like -N / --Netns to ip-like -n / --netns.
Petr Machata (3
This to keep compatible with the major tools, ip and tc. Also
document the option in the man page, which was neglected.
Signed-off-by: Petr Machata
---
dcb/dcb.c | 8
man/man8/dcb.8 | 7 +++
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/dcb/dcb.c b/dcb/dcb.c
DCB socket buffer is allocated in dcb_init(), but never freed(). Free it
in dcb_fini().
Signed-off-by: Petr Machata
---
dcb/dcb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/dcb/dcb.c b/dcb/dcb.c
index f5c62790e27e..0e3c87484f2a 100644
--- a/dcb/dcb.c
+++ b/dcb/dcb.c
@@ -38,6 +38,7
dcb currently sends all netlink messages with a type RTM_GETDCB, even the
set ones. Change to the appropriate type.
Signed-off-by: Petr Machata
---
dcb/dcb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dcb/dcb.c b/dcb/dcb.c
index adec57476e1d..f5c62790e27e 100644
--- a
David Ahern writes:
> On 12/23/20 11:25 AM, Petr Machata wrote:
>> diff --git a/dcb/dcb.c b/dcb/dcb.c
>> index a59b63ac9159..e6cda7337924 100644
>> --- a/dcb/dcb.c
>> +++ b/dcb/dcb.c
>> @@ -467,7 +467,8 @@ static void dcb_help(void)
>> &quo
l". Publish the latter as well.
Signed-off-by: Petr Machata
---
include/utils.h | 5 +
lib/utils.c | 37 +++--
2 files changed, 36 insertions(+), 6 deletions(-)
diff --git a/include/utils.h b/include/utils.h
index 1704392525a2..f1403f7306a0 100644
--- a
ieee
# dcb dcbx show dev eni1np1
host ieee
Signed-off-by: Petr Machata
---
dcb/Makefile| 1 +
dcb/dcb.c | 4 +-
dcb/dcb.h | 4 +
dcb/dcb_dcbx.c | 192
man/man8/dcb-dcbx.8 | 108
dcb currently sends all netlink messages with a type RTM_GETDCB, even the
set ones. Change to the appropriate type.
Signed-off-by: Petr Machata
---
dcb/dcb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dcb/dcb.c b/dcb/dcb.c
index adec57476e1d..f5c62790e27e 100644
--- a
dev eni1np1
dscp-prio 0:0 CS3:3 CS6:6
# dcb app add dev eni1np1 dscp-prio CS3:4
# dcb app show dev eni1np1
dscp-prio 0:0 CS3:3 CS3:4 CS6:6
# dcb app replace dev eni1np1 dscp-prio CS3:5
# dcb app show dev eni1np1
dscp-prio 0:0 CS3:5 CS6:6
Signed-off-by: Petr Machata
strings or as plain numbers.
Patches #8 and #9 add the subtools themselves and their man pages.
Petr Machata (9):
dcb: Set values with RTM_SETDCB type
dcb: Plug a leaking DCB socket buffer
lib: rt_names: Add rtnl_dsfield_get_name()
lib: Generalize parse_mapping()
dcb: Generalize
For formatting DSCP (not full dsfield), it would be handy to be able to
just get the name from the name table, and not get any of the remaining
cruft related to formatting. Add a new entry point to just fetch the
name table string uninterpreted. Use it from rtnl_dsfield_n2a().
Signed-off-by: Petr
is similar to dcb_set_attribute(), but does
not encapsulate the payload in an IEEE container. Rewrite
dcb_set_attribute() compatibly in terms of the new functions.
Signed-off-by: Petr Machata
---
dcb/dcb.c | 99 ++-
dcb/dcb.h | 7
2 files
301 - 400 of 2257 matches
Mail list logo