From: Simon Horman <simon.horman@corigine.com>
To: Hangbin Liu <liuhangbin@gmail.com>
Cc: netdev@vger.kernel.org, Jay Vosburgh <j.vosburgh@gmail.com>,
"David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Jonathan Toppins <jtoppins@redhat.com>,
Paolo Abeni <pabeni@redhat.com>,
Eric Dumazet <edumazet@google.com>, Liang Li <liali@redhat.com>,
Miroslav Lichvar <mlichvar@redhat.com>
Subject: Re: [PATCHv2 net-next] bonding: add software tx timestamping support
Date: Fri, 7 Apr 2023 17:31:21 +0200 [thread overview]
Message-ID: <ZDA3SZ5PHqfif7AK@corigine.com> (raw)
In-Reply-To: <20230407061228.1035431-1-liuhangbin@gmail.com>
On Fri, Apr 07, 2023 at 02:12:28PM +0800, Hangbin Liu wrote:
> Currently, bonding only obtain the timestamp (ts) information of
> the active slave, which is available only for modes 1, 5, and 6.
> For other modes, bonding only has software rx timestamping support.
>
> However, some users who use modes such as LACP also want tx timestamp
> support. To address this issue, let's check the ts information of each
> slave. If all slaves support tx timestamping, we can enable tx
> timestamping support for the bond.
>
> Suggested-by: Miroslav Lichvar <mlichvar@redhat.com>
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
...
> @@ -5707,10 +5711,41 @@ static int bond_ethtool_get_ts_info(struct net_device *bond_dev,
> ret = ops->get_ts_info(real_dev, info);
> goto out;
> }
> + } else {
> + /* Check if all slaves support software rx/tx timestamping */
> + rcu_read_lock();
> + bond_for_each_slave_rcu(bond, slave, iter) {
> + ret = -1;
> + dev_hold(slave->dev);
> + ops = slave->dev->ethtool_ops;
> + phydev = slave->dev->phydev;
> +
> + if (phy_has_tsinfo(phydev))
> + ret = phy_ts_info(phydev, &ts_info);
> + else if (ops->get_ts_info)
> + ret = ops->get_ts_info(slave->dev, &ts_info);
> +
> + if (!ret && (ts_info.so_timestamping & SOF_TIMESTAMPING_SOFTRXTX) == \
nit: no need for the '\' for line continuation.
> + SOF_TIMESTAMPING_SOFTRXTX) {
> + dev_put(slave->dev);
> + soft_support = true;
> + continue;
> + }
> +
> + soft_support = false;
> + dev_put(slave->dev);
> + break;
> + }
> + rcu_read_unlock();
> }
prev parent reply other threads:[~2023-04-07 15:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-07 6:12 [PATCHv2 net-next] bonding: add software tx timestamping support Hangbin Liu
2023-04-07 9:34 ` Eric Dumazet
2023-04-10 7:55 ` Hangbin Liu
2023-04-07 15:31 ` Simon Horman [this message]
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=ZDA3SZ5PHqfif7AK@corigine.com \
--to=simon.horman@corigine.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=j.vosburgh@gmail.com \
--cc=jtoppins@redhat.com \
--cc=kuba@kernel.org \
--cc=liali@redhat.com \
--cc=liuhangbin@gmail.com \
--cc=mlichvar@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/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 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).