<xi:include href="version-info.xml" xpointer="v248"/>
</listitem>
</varlistentry>
+
+ <varlistentry>
+ <term><varname>BroadcastQueueThreshold=</varname></term>
+ <listitem>
+ <para>Controls the threshold for broadcast queueing of the macvlan device. Takes the special value
+ <literal>no</literal>, or an integer in the range 0…2147483647. When <literal>no</literal> is
+ specified, the broadcast queueing is disabled altogether. When an integer is specified, a multicast
+ address will be queued as broadcast if the number of devices using it is greater than the given
+ value. Defaults to unset, and the kernel default will be used.</para>
+
+ <xi:include href="version-info.xml" xpointer="v256"/>
+ </listitem>
+ </varlistentry>
</variablelist>
</refsect1>
[IFLA_MACVLAN_MACADDR_COUNT] = BUILD_POLICY(U32),
[IFLA_MACVLAN_BC_QUEUE_LEN] = BUILD_POLICY(U32),
[IFLA_MACVLAN_BC_QUEUE_LEN_USED] = BUILD_POLICY(U32),
+ [IFLA_MACVLAN_BC_CUTOFF] = BUILD_POLICY(S32),
};
static const NLAPolicy rtnl_link_info_data_tun_policies[] = {
#include "networkd-network.h"
#include "parse-util.h"
+typedef enum BCQueueThreshold {
+ BC_QUEUE_THRESHOLD_UNDEF = INT32_MIN,
+ BC_QUEUE_THRESHOLD_DISABLE = -1,
+} BCQueueThreshold;
+
DEFINE_CONFIG_PARSE_ENUM(config_parse_macvlan_mode, macvlan_mode, MacVlanMode, "Failed to parse macvlan mode");
static int netdev_macvlan_fill_message_create(NetDev *netdev, Link *link, sd_netlink_message *req) {
return r;
}
+ if (m->bc_queue_threshold != BC_QUEUE_THRESHOLD_UNDEF) {
+ r = sd_netlink_message_append_s32(req, IFLA_MACVLAN_BC_CUTOFF, m->bc_queue_threshold);
+ if (r < 0)
+ return r;
+ }
+
return 0;
}
&m->bc_queue_length);
}
+int config_parse_macvlan_broadcast_queue_threshold(
+ const char *unit,
+ const char *filename,
+ unsigned line,
+ const char *section,
+ unsigned section_line,
+ const char *lvalue,
+ int ltype,
+ const char *rvalue,
+ void *data,
+ void *userdata) {
+
+ assert(filename);
+ assert(lvalue);
+ assert(rvalue);
+
+ int32_t v, *threshold = ASSERT_PTR(data);
+ int r;
+
+ if (isempty(rvalue)) {
+ *threshold = BC_QUEUE_THRESHOLD_UNDEF;
+ return 0;
+ }
+
+ if (streq(rvalue, "no")) {
+ *threshold = BC_QUEUE_THRESHOLD_DISABLE;
+ return 0;
+ }
+
+ r = safe_atoi32(rvalue, &v);
+ if (r < 0) {
+ log_syntax(unit, LOG_WARNING, filename, line, r,
+ "Failed to parse %s=, ignoring assignment: %s",
+ lvalue, rvalue);
+ return 0;
+ }
+ if (v < 0) {
+ log_syntax(unit, LOG_WARNING, filename, line, 0,
+ "Invalid %s= value specified, ignoring assignment: %s",
+ lvalue, rvalue);
+ return 0;
+ }
+
+ *threshold = v;
+ return 0;
+}
+
static void macvlan_done(NetDev *netdev) {
MacVlan *m = ASSERT_PTR(netdev)->kind == NETDEV_KIND_MACVLAN ? MACVLAN(netdev) : MACVTAP(netdev);
m->mode = _NETDEV_MACVLAN_MODE_INVALID;
m->bc_queue_length = UINT32_MAX;
+ m->bc_queue_threshold = BC_QUEUE_THRESHOLD_UNDEF;
}
const NetDevVTable macvtap_vtable = {
Set *match_source_mac;
uint32_t bc_queue_length;
+ int32_t bc_queue_threshold;
};
DEFINE_NETDEV_CAST(MACVLAN, MacVlan);
CONFIG_PARSER_PROTOTYPE(config_parse_macvlan_mode);
CONFIG_PARSER_PROTOTYPE(config_parse_macvlan_broadcast_queue_size);
+CONFIG_PARSER_PROTOTYPE(config_parse_macvlan_broadcast_queue_threshold);
MACVLAN.Mode, config_parse_macvlan_mode, 0, offsetof(MacVlan, mode)
MACVLAN.SourceMACAddress, config_parse_ether_addrs, 0, offsetof(MacVlan, match_source_mac)
MACVLAN.BroadcastMulticastQueueLength, config_parse_macvlan_broadcast_queue_size, 0, offsetof(MacVlan, bc_queue_length)
+MACVLAN.BroadcastQueueThreshold, config_parse_macvlan_broadcast_queue_threshold, 0, offsetof(MacVlan, bc_queue_threshold)
MACVTAP.Mode, config_parse_macvlan_mode, 0, offsetof(MacVlan, mode)
MACVTAP.SourceMACAddress, config_parse_ether_addrs, 0, offsetof(MacVlan, match_source_mac)
IPVLAN.Mode, config_parse_ipvlan_mode, 0, offsetof(IPVlan, mode)