network: tc/cake: introduce UseRawPacketSize= setting

This commit is contained in:
Yu Watanabe 2021-11-04 10:04:47 +09:00
parent 35896db489
commit 1c7a81e626
5 changed files with 22 additions and 0 deletions

View file

@ -3511,6 +3511,15 @@ Token=prefixstable:2002:da8:1::</programlisting></para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>UseRawPacketSize=</varname></term>
<listitem>
<para>Takes a boolean value. When true, the packet size reported by the Linux kernel will be
used, instead of the underlying IP packet size. Defaults to unset, and the kernel's default
is used.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>FlowIsolationMode=</varname></term>
<listitem>

View file

@ -390,6 +390,7 @@ CAKE.AutoRateIngress, config_parse_cake_tristate,
CAKE.OverheadBytes, config_parse_cake_overhead, QDISC_KIND_CAKE, 0
CAKE.MPUBytes, config_parse_cake_mpu, QDISC_KIND_CAKE, 0
CAKE.CompensationMode, config_parse_cake_compensation_mode, QDISC_KIND_CAKE, 0
CAKE.UseRawPacketSize, config_parse_cake_tristate, QDISC_KIND_CAKE, 0
CAKE.FlowIsolationMode, config_parse_cake_flow_isolation_mode, QDISC_KIND_CAKE, 0
CAKE.NAT, config_parse_cake_tristate, QDISC_KIND_CAKE, 0
CAKE.PriorityQueueingPreset, config_parse_cake_priority_queueing_preset, QDISC_KIND_CAKE, 0

View file

@ -21,6 +21,7 @@ static int cake_init(QDisc *qdisc) {
c->autorate = -1;
c->compensation_mode = _CAKE_COMPENSATION_MODE_INVALID;
c->raw = -1;
c->flow_isolation_mode = _CAKE_FLOW_ISOLATION_MODE_INVALID;
c->nat = -1;
c->preset = _CAKE_PRESET_INVALID;
@ -74,6 +75,13 @@ static int cake_fill_message(Link *link, QDisc *qdisc, sd_netlink_message *req)
return log_link_error_errno(link, r, "Could not append TCA_CAKE_ATM attribute: %m");
}
if (c->raw > 0) {
/* TCA_CAKE_RAW attribute is mostly a flag, not boolean. */
r = sd_netlink_message_append_u32(req, TCA_CAKE_RAW, 0);
if (r < 0)
return log_link_error_errno(link, r, "Could not append TCA_CAKE_RAW attribute: %m");
}
if (c->flow_isolation_mode >= 0) {
r = sd_netlink_message_append_u32(req, TCA_CAKE_FLOW_MODE, c->flow_isolation_mode);
if (r < 0)
@ -326,6 +334,8 @@ int config_parse_cake_tristate(
if (streq(lvalue, "AutoRateIngress"))
dest = &c->autorate;
else if (streq(lvalue, "UseRawPacketSize"))
dest = &c->raw;
else if (streq(lvalue, "NAT"))
dest = &c->nat;
else if (streq(lvalue, "Wash"))

View file

@ -50,6 +50,7 @@ typedef struct CommonApplicationsKeptEnhanced {
int overhead;
uint32_t mpu;
CakeCompensationMode compensation_mode;
int raw;
/* Flow isolation parameters */
CakeFlowIsolationMode flow_isolation_mode;

View file

@ -472,6 +472,7 @@ AutoRateIngress=
OverheadBytes=
MPUBytes=
CompensationMode=
UseRawPacketSize=
FlowIsolationMode=
NAT=
PriorityQueueingPreset=