* [Bridge] [RFC] The problem with the mirrored traffic: setageing 0 not work
@ 2015-12-14 19:21 Vitaly Lavrov
0 siblings, 0 replies; only message in thread
From: Vitaly Lavrov @ 2015-12-14 19:21 UTC (permalink / raw)
To: bridge
Hi!
After commit c62987bbd8a1a1664f99e89e3959339350a6131e (bridge: push bridge setting ageing_time down to switchdev)
impossible to handle mirrored traffic through netfilter and it is impossible to transfer it to a virtual machine.
The problem code is net/bridge/br_stp.c:br_set_ageing_time() line 580
---------------------------------------------------------------------
570 int br_set_ageing_time(struct net_bridge *br, u32 ageing_time)
571 {
572 struct switchdev_attr attr = {
573 .id = SWITCHDEV_ATTR_ID_BRIDGE_AGEING_TIME,
574 .flags = SWITCHDEV_F_SKIP_EOPNOTSUPP,
575 .u.ageing_time = ageing_time,
576 };
577 unsigned long t = clock_t_to_jiffies(ageing_time);
578 int err;
579
580 if (t < BR_MIN_AGEING_TIME || t > BR_MAX_AGEING_TIME)
581 return -ERANGE;
582
583 err = switchdev_port_attr_set(br->dev, &attr);
584 if (err)
585 return err;
586
587 br->ageing_time = t;
-----------------------------------------------------------------------
To handle the mirrored traffic we must have ageing_time = 0.
IMHO check aging_time need to move in ops->switchdev_port_attr_set().
If it is a hardware switch and it has restrictions on ageing_time, then it must return -ERANGE.
For a software implementation of a switch(brigde) we can allow the special value "0" ageing_time.
The second problem is in the line 584 - Do not check the error code "EOPNOTSUPP"
This line must be "if (err && err != -EOPNOTSUPP)"
How better to done in such situation?
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-12-14 19:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-14 19:21 [Bridge] [RFC] The problem with the mirrored traffic: setageing 0 not work Vitaly Lavrov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).