From: Vitaly Lavrov <vel21ripn@gmail.com>
To: bridge@lists.linux-foundation.org
Subject: [Bridge] [RFC] The problem with the mirrored traffic: setageing 0 not work
Date: Mon, 14 Dec 2015 22:21:43 +0300 [thread overview]
Message-ID: <566F16C7.9060808@gmail.com> (raw)
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?
reply other threads:[~2015-12-14 19:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=566F16C7.9060808@gmail.com \
--to=vel21ripn@gmail.com \
--cc=bridge@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.