Merge branch 'iproute2-master' into iproute2-next

Signed-off-by: David Ahern <dsahern@gmail.com>
This commit is contained in:
David Ahern 2018-12-07 13:02:08 -08:00
commit fbe7da2306
8 changed files with 60 additions and 8 deletions

View File

@ -8,9 +8,6 @@ ifeq ($(HAVE_MNL),y)
DEVLINKOBJ = devlink.o mnlg.o
TARGETS += devlink
CFLAGS += $(shell $(PKG_CONFIG) libmnl --cflags)
LDLIBS += $(shell $(PKG_CONFIG) libmnl --libs)
endif
all: $(TARGETS) $(LIBS)
@ -19,7 +16,9 @@ devlink: $(DEVLINKOBJ)
$(QUIET_LINK)$(CC) $^ $(LDFLAGS) $(LDLIBS) -o $@
install: all
install -m 0755 $(TARGETS) $(DESTDIR)$(SBINDIR)
for i in $(TARGETS); \
do install -m 0755 $$i $(DESTDIR)$(SBINDIR); \
done
clean:
rm -f $(DEVLINKOBJ) $(TARGETS)

View File

@ -283,7 +283,7 @@ static void can_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
if (tb[IFLA_CAN_STATE]) {
uint32_t state = rta_getattr_u32(tb[IFLA_CAN_STATE]);
fprintf(f, "state %s ", state < CAN_STATE_MAX ?
print_string(PRINT_ANY, "state", "state %s ", state < CAN_STATE_MAX ?
can_state_names[state] : "UNKNOWN");
}

View File

@ -763,6 +763,7 @@ static int __rtnl_talk_iov(struct rtnl_handle *rtnl, struct iovec *iov,
msg.msg_iovlen = 1;
i = 0;
while (1) {
next:
status = rtnl_recvmsg(rtnl->fd, &msg, &buf);
++i;
@ -826,6 +827,8 @@ static int __rtnl_talk_iov(struct rtnl_handle *rtnl, struct iovec *iov,
else
free(buf);
if (i < iovlen)
goto next;
return error ? -i : 0;
}

View File

@ -17,7 +17,9 @@ rdma: $(RDMA_OBJ) $(LIBS)
$(QUIET_LINK)$(CC) $^ $(LDFLAGS) $(LDLIBS) -o $@
install: all
install -m 0755 $(TARGETS) $(DESTDIR)$(SBINDIR)
for i in $(TARGETS); \
do install -m 0755 $$i $(DESTDIR)$(SBINDIR); \
done
clean:
rm -f $(RDMA_OBJ) $(TARGETS)

View File

@ -763,10 +763,28 @@ struct ib_uverbs_sge {
__u32 lkey;
};
enum ib_uverbs_wr_opcode {
IB_UVERBS_WR_RDMA_WRITE = 0,
IB_UVERBS_WR_RDMA_WRITE_WITH_IMM = 1,
IB_UVERBS_WR_SEND = 2,
IB_UVERBS_WR_SEND_WITH_IMM = 3,
IB_UVERBS_WR_RDMA_READ = 4,
IB_UVERBS_WR_ATOMIC_CMP_AND_SWP = 5,
IB_UVERBS_WR_ATOMIC_FETCH_AND_ADD = 6,
IB_UVERBS_WR_LOCAL_INV = 7,
IB_UVERBS_WR_BIND_MW = 8,
IB_UVERBS_WR_SEND_WITH_INV = 9,
IB_UVERBS_WR_TSO = 10,
IB_UVERBS_WR_RDMA_READ_WITH_INV = 11,
IB_UVERBS_WR_MASKED_ATOMIC_CMP_AND_SWP = 12,
IB_UVERBS_WR_MASKED_ATOMIC_FETCH_AND_ADD = 13,
/* Review enum ib_wr_opcode before modifying this */
};
struct ib_uverbs_send_wr {
__aligned_u64 wr_id;
__u32 num_sge;
__u32 opcode;
__u32 opcode; /* see enum ib_uverbs_wr_opcode */
__u32 send_flags;
union {
__be32 imm_data;

23
testsuite/tests/tc/batch.t Executable file
View File

@ -0,0 +1,23 @@
#!/bin/sh
. lib/generic.sh
DEV="$(rand_dev)"
ts_ip "$0" "Add $DEV dummy interface" link add dev $DEV type dummy
ts_ip "$0" "Enable $DEV" link set $DEV up
ts_tc "$0" "Add ingress qdisc" qdisc add dev $DEV clsact
TMP="$(mktemp)"
echo filt add dev $DEV ingress pref 1000 matchall action pass >> "$TMP"
echo filt add dev $DEV ingress pref 1000 matchall action pass >> "$TMP"
"$TC" -b "$TMP" 2> $STD_ERR > $STD_OUT
if [ $? -eq 0 ]; then
ts_err "$0: batch passed when it should have failed"
elif [ ! -s $STD_ERR ]; then
ts_err "$0: batch produced no error message"
else
echo "$0: batch failed, as expected"
fi
rm "$TMP"
ts_ip "$0" "Del $DEV dummy interface" link del dev $DEV

View File

@ -22,7 +22,9 @@ tipc: $(TIPCOBJ)
$(QUIET_LINK)$(CC) $^ $(LDFLAGS) $(LDLIBS) -o $@
install: all
install -m 0755 $(TARGETS) $(DESTDIR)$(SBINDIR)
for i in $(TARGETS); \
do install -m 0755 $$i $(DESTDIR)$(SBINDIR); \
done
clean:
rm -f $(TIPCOBJ) $(TARGETS)

View File

@ -58,14 +58,19 @@ static int nametable_show_cb(const struct nlmsghdr *nlh, void *data)
open_json_object(NULL);
print_uint(PRINT_ANY, "type", "%-10u",
mnl_attr_get_u32(publ[TIPC_NLA_PUBL_TYPE]));
print_string(PRINT_FP, NULL, " ", "");
print_uint(PRINT_ANY, "lower", "%-10u",
mnl_attr_get_u32(publ[TIPC_NLA_PUBL_LOWER]));
print_string(PRINT_FP, NULL, " ", "");
print_uint(PRINT_ANY, "upper", "%-10u",
mnl_attr_get_u32(publ[TIPC_NLA_PUBL_UPPER]));
print_string(PRINT_FP, NULL, " ", "");
print_string(PRINT_ANY, "scope", "%-8s",
scope[mnl_attr_get_u32(publ[TIPC_NLA_PUBL_SCOPE])]);
print_string(PRINT_FP, NULL, " ", "");
print_uint(PRINT_ANY, "port", "%-10u",
mnl_attr_get_u32(publ[TIPC_NLA_PUBL_REF]));
print_string(PRINT_FP, NULL, " ", "");
print_string(PRINT_ANY, "node", "%s", str);
print_string(PRINT_FP, NULL, "\n", "");
close_json_object();