diff --git a/devlink/Makefile b/devlink/Makefile index ace34c7b..7da7d1fa 100644 --- a/devlink/Makefile +++ b/devlink/Makefile @@ -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) diff --git a/ip/iplink_can.c b/ip/iplink_can.c index c0deeb1f..5bf490a9 100644 --- a/ip/iplink_can.c +++ b/ip/iplink_can.c @@ -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"); } diff --git a/lib/libnetlink.c b/lib/libnetlink.c index c0b80ed6..95457109 100644 --- a/lib/libnetlink.c +++ b/lib/libnetlink.c @@ -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; } diff --git a/rdma/Makefile b/rdma/Makefile index 819fcbe3..0498994f 100644 --- a/rdma/Makefile +++ b/rdma/Makefile @@ -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) diff --git a/rdma/include/uapi/rdma/ib_user_verbs.h b/rdma/include/uapi/rdma/ib_user_verbs.h index 25a16760..1254b51a 100644 --- a/rdma/include/uapi/rdma/ib_user_verbs.h +++ b/rdma/include/uapi/rdma/ib_user_verbs.h @@ -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; diff --git a/testsuite/tests/tc/batch.t b/testsuite/tests/tc/batch.t new file mode 100755 index 00000000..50e7ba37 --- /dev/null +++ b/testsuite/tests/tc/batch.t @@ -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 diff --git a/tipc/Makefile b/tipc/Makefile index fdb18d39..a10debe0 100644 --- a/tipc/Makefile +++ b/tipc/Makefile @@ -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) diff --git a/tipc/nametable.c b/tipc/nametable.c index eb4bd0bd..d899eeb6 100644 --- a/tipc/nametable.c +++ b/tipc/nametable.c @@ -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();