Merge remote-tracking branch 'main/main' into next

Fixed conflicts in lib/utils.c

Signed-off-by: David Ahern <dsahern@kernel.org>
This commit is contained in:
David Ahern
2024-10-05 23:06:06 +00:00
15 changed files with 91 additions and 52 deletions

View File

@@ -4,6 +4,8 @@
*/
#include <stdio.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <linux/if_bridge.h>
#include <net/if.h>

View File

@@ -5519,11 +5519,12 @@ union bpf_attr {
* **-EOPNOTSUPP** if the hash calculation failed or **-EINVAL** if
* invalid arguments are passed.
*
* void *bpf_kptr_xchg(void *map_value, void *ptr)
* void *bpf_kptr_xchg(void *dst, void *ptr)
* Description
* Exchange kptr at pointer *map_value* with *ptr*, and return the
* old value. *ptr* can be NULL, otherwise it must be a referenced
* pointer which will be released when this helper is called.
* Exchange kptr at pointer *dst* with *ptr*, and return the old value.
* *dst* can be map value or local kptr. *ptr* can be NULL, otherwise
* it must be a referenced pointer which will be released when this helper
* is called.
* Return
* The old value of kptr (which can be NULL). The returned pointer
* if not NULL, is a reference which must be released using its
@@ -7513,4 +7514,13 @@ struct bpf_iter_num {
__u64 __opaque[1];
} __attribute__((aligned(8)));
/*
* Flags to control BPF kfunc behaviour.
* - BPF_F_PAD_ZEROS: Pad destination buffer with zeros. (See the respective
* helper documentation for details.)
*/
enum bpf_kfunc_flags {
BPF_F_PAD_ZEROS = (1ULL << 0),
};
#endif /* __LINUX_BPF_H__ */

View File

@@ -28,6 +28,23 @@
#define _BITUL(x) (_UL(1) << (x))
#define _BITULL(x) (_ULL(1) << (x))
#if !defined(__ASSEMBLY__)
/*
* Missing __asm__ support
*
* __BIT128() would not work in the __asm__ code, as it shifts an
* 'unsigned __init128' data type as direct representation of
* 128 bit constants is not supported in the gcc compiler, as
* they get silently truncated.
*
* TODO: Please revisit this implementation when gcc compiler
* starts representing 128 bit constants directly like long
* and unsigned long etc. Subsequently drop the comment for
* GENMASK_U128() which would then start supporting __asm__ code.
*/
#define _BIT128(x) ((unsigned __int128)(1) << (x))
#endif
#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (__typeof__(x))(a) - 1)
#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask))

View File

@@ -67,6 +67,7 @@ enum {
FRA_IP_PROTO, /* ip proto */
FRA_SPORT_RANGE, /* sport */
FRA_DPORT_RANGE, /* dport */
FRA_DSCP, /* dscp */
__FRA_MAX
};

View File

@@ -140,25 +140,6 @@
#endif /* _NETINET_IN_H */
/* Coordinate with glibc netipx/ipx.h header. */
#if defined(__NETIPX_IPX_H)
#define __UAPI_DEF_SOCKADDR_IPX 0
#define __UAPI_DEF_IPX_ROUTE_DEFINITION 0
#define __UAPI_DEF_IPX_INTERFACE_DEFINITION 0
#define __UAPI_DEF_IPX_CONFIG_DATA 0
#define __UAPI_DEF_IPX_ROUTE_DEF 0
#else /* defined(__NETIPX_IPX_H) */
#define __UAPI_DEF_SOCKADDR_IPX 1
#define __UAPI_DEF_IPX_ROUTE_DEFINITION 1
#define __UAPI_DEF_IPX_INTERFACE_DEFINITION 1
#define __UAPI_DEF_IPX_CONFIG_DATA 1
#define __UAPI_DEF_IPX_ROUTE_DEF 1
#endif /* defined(__NETIPX_IPX_H) */
/* Definitions for xattr.h */
#if defined(_SYS_XATTR_H)
#define __UAPI_DEF_XATTR 0
@@ -240,23 +221,6 @@
#define __UAPI_DEF_IP6_MTUINFO 1
#endif
/* Definitions for ipx.h */
#ifndef __UAPI_DEF_SOCKADDR_IPX
#define __UAPI_DEF_SOCKADDR_IPX 1
#endif
#ifndef __UAPI_DEF_IPX_ROUTE_DEFINITION
#define __UAPI_DEF_IPX_ROUTE_DEFINITION 1
#endif
#ifndef __UAPI_DEF_IPX_INTERFACE_DEFINITION
#define __UAPI_DEF_IPX_INTERFACE_DEFINITION 1
#endif
#ifndef __UAPI_DEF_IPX_CONFIG_DATA
#define __UAPI_DEF_IPX_CONFIG_DATA 1
#endif
#ifndef __UAPI_DEF_IPX_ROUTE_DEF
#define __UAPI_DEF_IPX_ROUTE_DEF 1
#endif
/* Definitions for xattr.h */
#ifndef __UAPI_DEF_XATTR
#define __UAPI_DEF_XATTR 1

View File

@@ -397,4 +397,7 @@ const char *proto_n2a(unsigned short id, char *buf, int len,
FILE *generic_proc_open(const char *env, const char *name);
int open_fds_add(int fd);
void open_fds_close(void);
#endif /* __UTILS_H__ */

View File

@@ -1 +1 @@
static const char version[] = "6.10.0";
static const char version[] = "6.11.0";

View File

@@ -622,9 +622,11 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req, char **type)
if (netns != -1)
duparg("netns", *argv);
netns = netns_get_fd(*argv);
if (netns >= 0)
if (netns >= 0) {
open_fds_add(netns);
addattr_l(&req->n, sizeof(*req), IFLA_NET_NS_FD,
&netns, 4);
}
else if (get_integer(&netns, *argv, 0) == 0)
addattr_l(&req->n, sizeof(*req),
IFLA_NET_NS_PID, &netns, 4);
@@ -1088,6 +1090,8 @@ static int iplink_modify(int cmd, unsigned int flags, int argc, char **argv)
else
ret = rtnl_talk(&rth, &req.n, NULL);
open_fds_close();
if (ret)
return -2;

View File

@@ -43,6 +43,9 @@ int use_iec;
int human_readable;
const char *_SL_ = "\n";
static int open_fds[5];
static int open_fds_cnt;
static int af_byte_len(int af);
static void print_time(char *buf, int len, __u32 time);
static void print_time64(char *buf, int len, __s64 time);
@@ -2060,3 +2063,22 @@ void print_num(FILE *fp, unsigned int width, uint64_t count)
fprintf(fp, "%*s ", width, buf);
}
int open_fds_add(int fd)
{
if (open_fds_cnt >= ARRAY_SIZE(open_fds))
return -1;
open_fds[open_fds_cnt++] = fd;
return 0;
}
void open_fds_close(void)
{
int i;
for (i = 0; i < open_fds_cnt; i++)
close(open_fds[i]);
open_fds_cnt = 0;
}

View File

@@ -220,7 +220,7 @@ select the destination prefix to match.
select the incoming device to match. If the interface is loopback,
the rule only matches packets originating from this host. This means
that you may create separate routing tables for forwarded and local
packets and, hence, completely segregate them.
packets and, hence, completely separate them.
.TP
.BI oif " NAME"

View File

@@ -120,8 +120,8 @@ Match with skb mark of 17:
Configure the sending side to encode for the filters above. Use a destination
IP address of 192.168.122.237/24, then tag with skb mark of decimal 17. Encode
the packaet with ethertype 0xdead, add skb->mark to whitelist of metadatum to
send, and rewrite the destination MAC address to 02:15:15:15:15:15.
the packet with ethertype 0xdead, add skb->mark to allowed list of meta
datum to send, and rewrite the destination MAC address to 02:15:15:15:15:15.
.RS
.EX

View File

@@ -437,10 +437,10 @@ static void get_kern_msg(void)
struct iovec iov;
char buf[8192];
struct msghdr msg = {
(void *)&nladdr, sizeof(nladdr),
&iov, 1,
NULL, 0,
0
.msg_name = &nladdr,
.msg_namelen = sizeof(nladdr),
.msg_iov = &iov,
.msg_iovlen = 1,
};
iov.iov_base = buf;
@@ -494,8 +494,7 @@ static void get_arp_pkt(void)
if (ifnum && !handle_if(sll.sll_ifindex))
return;
/* Sanity checks */
/* Validate packet */
if (n < sizeof(*a) ||
(a->ar_op != htons(ARPOP_REQUEST) &&
a->ar_op != htons(ARPOP_REPLY)) ||

View File

@@ -15,6 +15,7 @@ enum {
enum {
RDMA_NL_GROUP_IWPM = 2,
RDMA_NL_GROUP_LS,
RDMA_NL_GROUP_NOTIFY,
RDMA_NL_NUM_GROUPS
};
@@ -305,6 +306,8 @@ enum rdma_nldev_command {
RDMA_NLDEV_CMD_DELDEV,
RDMA_NLDEV_CMD_MONITOR,
RDMA_NLDEV_NUM_OPS
};
@@ -574,6 +577,9 @@ enum rdma_nldev_attr {
RDMA_NLDEV_ATTR_NAME_ASSIGN_TYPE, /* u8 */
RDMA_NLDEV_ATTR_EVENT_TYPE, /* u8 */
RDMA_NLDEV_SYS_ATTR_MONITOR_MODE, /* u8 */
/*
* Always the end
*/
@@ -624,4 +630,14 @@ enum rdma_nl_name_assign_type {
RDMA_NAME_ASSIGN_TYPE_USER = 1, /* Provided by user-space */
};
/*
* Supported rdma monitoring event types.
*/
enum rdma_nl_notify_event_type {
RDMA_REGISTER_EVENT,
RDMA_UNREGISTER_EVENT,
RDMA_NETDEV_ATTACH_EVENT,
RDMA_NETDEV_DETACH_EVENT,
};
#endif /* _RDMA_NETLINK_H */

View File

@@ -252,7 +252,7 @@ get_ops:
/* Get master key indication */
opt_master = get_opt(opts, "master");
/* Sanity check if wrong option */
/* Validate node key */
if (opt_nodeid && opt_master) {
fprintf(stderr, "error, per-node key cannot be master\n");
return -EINVAL;

View File

@@ -19,6 +19,7 @@ enum vdpa_command {
VDPA_CMD_DEV_GET, /* can dump */
VDPA_CMD_DEV_CONFIG_GET, /* can dump */
VDPA_CMD_DEV_VSTATS_GET,
VDPA_CMD_DEV_ATTR_SET,
};
enum vdpa_attr {