The throughput meter module is a simple, kernel-space replacement for throughtput measurements tool like iperf and netperf. It is intended to approximate TCP behaviour. It is invoked through batctl: the protocol is connection oriented, with cumulative acknowledgment and a dynamic-size sliding window. The test *can* be interrupted by batctl. A receiver side timeout avoids unlimited waitings for sender packets: after one second of inactivity, the receiver abort the ongoing test. Based on a prototype from Edo Monticelli <montik@autistici.org>
Showing the changes to include/uapi (1 of 13 files). Show all
Unified · Split
| @@ -20,6 +20,8 @@ · 19 unmodified lines | ||
| 20 | 20 | |
| 21 | 21 | #define BATADV_NL_NAME "batadv" |
| 22 | 22 | |
| 23 | +#define BATADV_NL_MCAST_GROUP_TPMETER "tpmeter" | |
| 24 | + | |
| 23 | 25 | /** |
| 24 | 26 | * enum batadv_nl_attrs - batman-adv netlink attributes |
| 25 | 27 | * |
| @@ -32,6 +34,12 @@ · 6 unmodified lines | ||
| 32 | 34 | * @BATADV_ATTR_HARD_IFINDEX: index of the non-batman-adv interface |
| 33 | 35 | * @BATADV_ATTR_HARD_IFNAME: name of the non-batman-adv interface |
| 34 | 36 | * @BATADV_ATTR_HARD_ADDRESS: mac address of the non-batman-adv interface |
| 37 | + * @BATADV_ATTR_ORIG_ADDRESS: originator mac address | |
| 38 | + * @BATADV_ATTR_TPMETER_RESULT: result of run (see batadv_tp_meter_status) | |
| 39 | + * @BATADV_ATTR_TPMETER_TEST_TIME: time (msec) the run took | |
| 40 | + * @BATADV_ATTR_TPMETER_BYTES: amount of acked bytes during run | |
| 41 | + * @BATADV_ATTR_TPMETER_COOKIE: session cookie to match tp_meter session | |
| 42 | + * @BATADV_ATTR_PAD: attribute used for padding for 64-bit alignment | |
| 35 | 43 | * @__BATADV_ATTR_AFTER_LAST: internal use |
| 36 | 44 | * @NUM_BATADV_ATTR: total number of batadv_nl_attrs available |
| 37 | 45 | * @BATADV_ATTR_MAX: highest attribute number currently defined |
| @@ -46,6 +54,12 @@ enum batadv_nl_attrs { · 8 unmodified lines | ||
| 46 | 54 | BATADV_ATTR_HARD_IFINDEX, |
| 47 | 55 | BATADV_ATTR_HARD_IFNAME, |
| 48 | 56 | BATADV_ATTR_HARD_ADDRESS, |
| 57 | + BATADV_ATTR_ORIG_ADDRESS, | |
| 58 | + BATADV_ATTR_TPMETER_RESULT, | |
| 59 | + BATADV_ATTR_TPMETER_TEST_TIME, | |
| 60 | + BATADV_ATTR_TPMETER_BYTES, | |
| 61 | + BATADV_ATTR_TPMETER_COOKIE, | |
| 62 | + BATADV_ATTR_PAD, | |
| 49 | 63 | /* add attributes above here, update the policy in netlink.c */ |
| 50 | 64 | __BATADV_ATTR_AFTER_LAST, |
| 51 | 65 | NUM_BATADV_ATTR = __BATADV_ATTR_AFTER_LAST, |
| @@ -57,15 +71,44 @@ enum batadv_nl_attrs { · 5 unmodified lines | ||
| 57 | 71 | * |
| 58 | 72 | * @BATADV_CMD_UNSPEC: unspecified command to catch errors |
| 59 | 73 | * @BATADV_CMD_GET_MESH_INFO: Query basic information about batman-adv device |
| 74 | + * @BATADV_CMD_TP_METER: Start a tp meter session | |
| 75 | + * @BATADV_CMD_TP_METER_CANCEL: Cancel a tp meter session | |
| 60 | 76 | * @__BATADV_CMD_AFTER_LAST: internal use |
| 61 | 77 | * @BATADV_CMD_MAX: highest used command number |
| 62 | 78 | */ |
| 63 | 79 | enum batadv_nl_commands { |
| 64 | 80 | BATADV_CMD_UNSPEC, |
| 65 | 81 | BATADV_CMD_GET_MESH_INFO, |
| 82 | + BATADV_CMD_TP_METER, | |
| 83 | + BATADV_CMD_TP_METER_CANCEL, | |
| 66 | 84 | /* add new commands above here */ |
| 67 | 85 | __BATADV_CMD_AFTER_LAST, |
| 68 | 86 | BATADV_CMD_MAX = __BATADV_CMD_AFTER_LAST - 1 |
| 69 | 87 | }; |
| 70 | 88 | |
| 89 | +/** | |
| 90 | + * enum batadv_tp_meter_reason - reason of a tp meter test run stop | |
| 91 | + * @BATADV_TP_REASON_COMPLETE: sender finished tp run | |
| 92 | + * @BATADV_TP_REASON_CANCEL: sender was stopped during run | |
| 93 | + * @BATADV_TP_REASON_DST_UNREACHABLE: receiver could not be reached or didn't | |
| 94 | + * answer | |
| 95 | + * @BATADV_TP_REASON_RESEND_LIMIT: (unused) sender retry reached limit | |
| 96 | + * @BATADV_TP_REASON_ALREADY_ONGOING: test to or from the same node already | |
| 97 | + * ongoing | |
| 98 | + * @BATADV_TP_REASON_MEMORY_ERROR: test was stopped due to low memory | |
| 99 | + * @BATADV_TP_REASON_CANT_SEND: failed to send via outgoing interface | |
| 100 | + * @BATADV_TP_REASON_TOO_MANY: too many ongoing sessions | |
| 101 | + */ | |
| 102 | +enum batadv_tp_meter_reason { | |
| 103 | + BATADV_TP_REASON_COMPLETE = 3, | |
| 104 | + BATADV_TP_REASON_CANCEL = 4, | |
| 105 | + /* error status >= 128 */ | |
| 106 | + BATADV_TP_REASON_DST_UNREACHABLE = 128, | |
| 107 | + BATADV_TP_REASON_RESEND_LIMIT = 129, | |
| 108 | + BATADV_TP_REASON_ALREADY_ONGOING = 130, | |
| 109 | + BATADV_TP_REASON_MEMORY_ERROR = 131, | |
| 110 | + BATADV_TP_REASON_CANT_SEND = 132, | |
| 111 | + BATADV_TP_REASON_TOO_MANY = 133, | |
| 112 | +}; | |
| 113 | + | |
| 71 | 114 | #endif /* _UAPI_LINUX_BATMAN_ADV_H_ */ |