summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAndrey Zhizhikin <andrey.z@gmail.com>2020-08-11 08:11:29 +0000
committerAndrey Zhizhikin <andrey.z@gmail.com>2020-08-11 08:11:29 +0000
commit1e70c7255a572e917dff8c5f3fe49dca0e5fa815 (patch)
tree8fae9dc92e2fef8d5c847d31e960650edb6b143b /tools
parent6ae0a6e3c2e959d4b96c49e5d6aa475ed6932c43 (diff)
parente75220890bf6b37c5f7b1dbd81d8292ed6d96643 (diff)
Merge tag 'v5.4.50' into 5.4-2.1.x-imx
This is the 5.4.50 stable release Conflicts (manual resolve): arch/arm64/boot/dts/freescale/imx8mm-evk.dts: arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dts: NXP patches kept to provide proper LDO setup: imx8mm-evk.dts: 975d8ab07267ded741c4c5d7500e524c85ab40d3 imx8mn-ddr4-evk.dts: e8e35fd0e759965809f3dca5979a908a09286198 drivers/net/ethernet/freescale/enetc/enetc.c Commit [ce06fcb6a66d22b080385768113ee28bf3593984] from upstream merged, base NXP version kept drivers/usb/cdns3/ep0.c Manual merge of commit [be8df027079b856a89e85778330394cea2b0b290] from upstream to protect cdns3_check_new_setup Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/net/so_txtime.c33
1 files changed, 26 insertions, 7 deletions
diff --git a/tools/testing/selftests/net/so_txtime.c b/tools/testing/selftests/net/so_txtime.c
index 383bac05ac32..ceaad78e9667 100644
--- a/tools/testing/selftests/net/so_txtime.c
+++ b/tools/testing/selftests/net/so_txtime.c
@@ -15,8 +15,9 @@
#include <inttypes.h>
#include <linux/net_tstamp.h>
#include <linux/errqueue.h>
+#include <linux/if_ether.h>
#include <linux/ipv6.h>
-#include <linux/tcp.h>
+#include <linux/udp.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
@@ -140,8 +141,8 @@ static void do_recv_errqueue_timeout(int fdt)
{
char control[CMSG_SPACE(sizeof(struct sock_extended_err)) +
CMSG_SPACE(sizeof(struct sockaddr_in6))] = {0};
- char data[sizeof(struct ipv6hdr) +
- sizeof(struct tcphdr) + 1];
+ char data[sizeof(struct ethhdr) + sizeof(struct ipv6hdr) +
+ sizeof(struct udphdr) + 1];
struct sock_extended_err *err;
struct msghdr msg = {0};
struct iovec iov = {0};
@@ -159,6 +160,8 @@ static void do_recv_errqueue_timeout(int fdt)
msg.msg_controllen = sizeof(control);
while (1) {
+ const char *reason;
+
ret = recvmsg(fdt, &msg, MSG_ERRQUEUE);
if (ret == -1 && errno == EAGAIN)
break;
@@ -176,14 +179,30 @@ static void do_recv_errqueue_timeout(int fdt)
err = (struct sock_extended_err *)CMSG_DATA(cm);
if (err->ee_origin != SO_EE_ORIGIN_TXTIME)
error(1, 0, "errqueue: origin 0x%x\n", err->ee_origin);
- if (err->ee_code != ECANCELED)
- error(1, 0, "errqueue: code 0x%x\n", err->ee_code);
+
+ switch (err->ee_errno) {
+ case ECANCELED:
+ if (err->ee_code != SO_EE_CODE_TXTIME_MISSED)
+ error(1, 0, "errqueue: unknown ECANCELED %u\n",
+ err->ee_code);
+ reason = "missed txtime";
+ break;
+ case EINVAL:
+ if (err->ee_code != SO_EE_CODE_TXTIME_INVALID_PARAM)
+ error(1, 0, "errqueue: unknown EINVAL %u\n",
+ err->ee_code);
+ reason = "invalid txtime";
+ break;
+ default:
+ error(1, 0, "errqueue: errno %u code %u\n",
+ err->ee_errno, err->ee_code);
+ };
tstamp = ((int64_t) err->ee_data) << 32 | err->ee_info;
tstamp -= (int64_t) glob_tstart;
tstamp /= 1000 * 1000;
- fprintf(stderr, "send: pkt %c at %" PRId64 "ms dropped\n",
- data[ret - 1], tstamp);
+ fprintf(stderr, "send: pkt %c at %" PRId64 "ms dropped: %s\n",
+ data[ret - 1], tstamp, reason);
msg.msg_flags = 0;
msg.msg_controllen = sizeof(control);