Merge remote-tracking branch 'main' into next
Signed-off-by: David Ahern <dsahern@kernel.org>
diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h
index a89df2a..bcd5fde 100644
--- a/include/uapi/linux/devlink.h
+++ b/include/uapi/linux/devlink.h
@@ -636,6 +636,8 @@
DEVLINK_ATTR_RATE_TC_BWS, /* nested */
+ DEVLINK_ATTR_HEALTH_REPORTER_BURST_PERIOD, /* u64 */
+
/* Add new attributes above here, update the spec in
* Documentation/netlink/specs/devlink.yaml and re-generate
* net/devlink/netlink_gen.c.
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index b450757..8c460dc 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -1562,6 +1562,7 @@
IFLA_BOND_SLAVE_AD_ACTOR_OPER_PORT_STATE,
IFLA_BOND_SLAVE_AD_PARTNER_OPER_PORT_STATE,
IFLA_BOND_SLAVE_PRIO,
+ IFLA_BOND_SLAVE_ACTOR_PORT_PRIO,
__IFLA_BOND_SLAVE_MAX,
};
diff --git a/include/uapi/linux/stddef.h b/include/uapi/linux/stddef.h
index e1fcfcf..48ee443 100644
--- a/include/uapi/linux/stddef.h
+++ b/include/uapi/linux/stddef.h
@@ -3,7 +3,6 @@
#define _LINUX_STDDEF_H
-
#ifndef __always_inline
#define __always_inline __inline__
#endif
diff --git a/ip/iplink_bond.c b/ip/iplink_bond.c
index d6960f6..3ae626a 100644
--- a/ip/iplink_bond.c
+++ b/ip/iplink_bond.c
@@ -91,6 +91,7 @@
"stable",
"bandwidth",
"count",
+ "actor_port_prio",
NULL,
};
diff --git a/ip/iplink_bond_slave.c b/ip/iplink_bond_slave.c
index ad68750..c88100e 100644
--- a/ip/iplink_bond_slave.c
+++ b/ip/iplink_bond_slave.c
@@ -15,7 +15,9 @@
static void print_explain(FILE *f)
{
- fprintf(f, "Usage: ... bond_slave [ queue_id ID ] [ prio PRIORITY ]\n");
+ fprintf(f, "Usage: ... bond_slave [ queue_id ID ] [ prio PRIORITY ]\n"
+ " [ actor_port_prio PRIORITY ]\n"
+ );
}
static void explain(void)
@@ -145,12 +147,18 @@
state);
print_slave_oper_state(f, "ad_partner_oper_port_state_str", state);
}
+
+ if (tb[IFLA_BOND_SLAVE_ACTOR_PORT_PRIO])
+ print_int(PRINT_ANY,
+ "actor_port_prio",
+ "actor_port_prio %d ",
+ rta_getattr_u16(tb[IFLA_BOND_SLAVE_ACTOR_PORT_PRIO]));
}
static int bond_slave_parse_opt(struct link_util *lu, int argc, char **argv,
struct nlmsghdr *n)
{
- __u16 queue_id;
+ __u16 queue_id, actor_port_prio;
int prio;
while (argc > 0) {
@@ -164,6 +172,12 @@
if (get_s32(&prio, *argv, 0))
invarg("prio is invalid", *argv);
addattr32(n, 1024, IFLA_BOND_SLAVE_PRIO, prio);
+ } else if (strcmp(*argv, "actor_port_prio") == 0) {
+ NEXT_ARG();
+ if (get_u16(&actor_port_prio, *argv, 0))
+ invarg("actor prio is invalid", *argv);
+ addattr16(n, 1024, IFLA_BOND_SLAVE_ACTOR_PORT_PRIO,
+ actor_port_prio);
} else {
if (matches(*argv, "help") != 0)
fprintf(stderr,
diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in
index e3297c5..7995943 100644
--- a/man/man8/ip-link.8.in
+++ b/man/man8/ip-link.8.in
@@ -2846,6 +2846,12 @@
(a 32bit signed value). This option only valid for active-backup(1),
balance-tlb (5) and balance-alb (6) mode.
+.sp
+.BI actor_port_prio " PRIORITY"
+- set the slave's ad actor port priority for 802.3ad aggregation selection
+logic during failover (a 16bit unsigned value). This option only valid for
+802.3ad (4) mode.
+
.in -8
.TP
diff --git a/scripts/iproute2-import-uapi b/scripts/iproute2-import-uapi
new file mode 100755
index 0000000..505ab25
--- /dev/null
+++ b/scripts/iproute2-import-uapi
@@ -0,0 +1,67 @@
+#!/bin/bash -e
+#
+# iproute2-import-uapi [commit]
+#
+# Imports sanitized copies of kernel uapi headers from <commit> (can be
+# a commit id, a tag or a branch name). If the argument is omitted,
+# commit currently checked out in the kernel repository is used.
+
+sn="${0##*/}"
+export ARCH="x86_64"
+mkopt="-j$(nproc)" || mkopt=''
+
+if [ ! -d "$LINUX_GIT" ]; then
+ echo "${sn}: please set LINUX_GIT to the location of kernel git" >&2
+ exit 1
+fi
+
+pushd "$LINUX_GIT"
+if [ -n "$1" ]; then
+ git checkout "$1"
+fi
+desc=$(git describe --exact-match 2>/dev/null \
+ || git show -s --abbrev=12 --pretty='%h: ("%s")')
+kobj=$(mktemp -d)
+make $mkopt O="$kobj" allmodconfig
+make $mkopt O="$kobj" prepare
+make $mkopt O="$kobj" INSTALL_HDR_PATH="${kobj}/hdr" headers_install
+popd
+
+pushd include/uapi
+find . -type f -name '*.h' -exec cp -v "${kobj}/hdr/include/{}" {} \;
+
+go_on=true
+while $go_on; do
+ go_on=false
+ while read f; do
+ if [ "${f#asm/}" != "$f" ]; then
+ # skip architecture dependent asm/ headers
+ continue
+ fi
+ if [ -f "$f" ]; then
+ # already present
+ continue
+ fi
+ if [ ! -f "${kobj}/hdr/include/${f}" ]; then
+ # not a kernel header
+ continue
+ fi
+ echo "+ add $f"
+ go_on=true
+ mkdir -p "${f%/*}"
+ cp "${kobj}/hdr/include/${f}" "${f}"
+ done < <(
+ find . -type f -name '*.[ch]' -exec sed -nre '\_^[[:blank:]]*#include[[:blank:]]<.+>_ { s_^[[:blank:]]*#include[[:blank:]]<([^>]*)>.*$_\1_ ; p }' {} \; \
+ | LC_ALL=C sort -u
+ )
+done
+popd
+rm -rf "$kobj"
+
+git add include/uapi
+git commit -s -F - <<EOT
+Update kernel headers
+
+Update kernel headers to commit:
+ ${desc}
+EOT