From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: Roger Quadros <rogerq@kernel.org>
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, s-vadapalli@ti.com, r-gunasekaran@ti.com,
vigneshr@ti.com, srk@ti.com, horms@kernel.org, p-varis@ti.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 net-next 6/7] net: ethernet: ti: am65-cpsw-qos: Add Frame Preemption MAC Merge support
Date: Thu, 30 Nov 2023 15:22:22 +0200 [thread overview]
Message-ID: <20231130132222.w2irs5c4lxh5jcv7@skbuf> (raw)
In-Reply-To: <6def78e7-8264-4745-94f3-b32b854af0c2@kernel.org>
On Thu, Nov 30, 2023 at 01:49:03PM +0200, Roger Quadros wrote:
> Thanks for the debug instructions. Indeed lldpad tries to enable MM TX and the
> network drivers set_mm() hook gets called and returns success but still
> lldpad sees some error.
>
> I've also confirmed that ethnl_set_mm() runs successfully and returns 1.
> I suppose something is going wrong in user-space with libnl?
>
> Nov 21 11:50:02 am62xx lldpad[708]: eth0: Link partner preemption capability supported
> Nov 21 11:50:02 am62xx lldpad[708]: eth0: Link partner preemption capability not enabled
> Nov 21 11:50:02 am62xx lldpad[708]: eth0: Link partner preemption capability not active
> Nov 21 11:50:02 am62xx lldpad[708]: eth0: Link partner minimum fragment size: 124 octets
> Nov 21 11:50:02 am62xx lldpad[708]: eth0: initiating MM verification with a retry interval of 134 ms...
> Nov 21 11:50:02 am62xx lldpad[708]: ethtool: kernel reports: integer out of range
>
>
> full debug log is below.
Ah, you got confused. Openlldp issues multiple ETHTOOL_MSG_MM_SET
netlink messages. What you observe is that one of them succeeds, and
then another one returns -ERANGE before even calling the driver's
set_mm() method.
And that comes from here in net/ethtool/mm.c:
149 const struct nla_policy ethnl_mm_set_policy[ETHTOOL_A_MM_MAX + 1] = {
150 » [ETHTOOL_A_MM_HEADER]» » = NLA_POLICY_NESTED(ethnl_header_policy),
151 » [ETHTOOL_A_MM_VERIFY_ENABLED]» = NLA_POLICY_MAX(NLA_U8, 1),
152 » [ETHTOOL_A_MM_VERIFY_TIME]» = NLA_POLICY_RANGE(NLA_U32, 1, 128), // <---- here
153 » [ETHTOOL_A_MM_TX_ENABLED]» = NLA_POLICY_MAX(NLA_U8, 1),
154 » [ETHTOOL_A_MM_PMAC_ENABLED]» = NLA_POLICY_MAX(NLA_U8, 1),
155 » [ETHTOOL_A_MM_TX_MIN_FRAG_SIZE]»= NLA_POLICY_RANGE(NLA_U32, 60, 252),
156 };
You are reporting in .get_mm() a maximum verify time which is larger
than the core ethtool is willing to accept in a further .set_mm() call.
And openlldp will try to max out on the verify time. Hence the -ERANGE.
The range I chose for the policy comes from 802.3-2018 clause 30.14.1.6,
which says that the aMACMergeVerifyTime variable has a range between 1
and 128 ms inclusive.
next prev parent reply other threads:[~2023-11-30 13:22 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-20 14:01 [PATCH v6 net-next 0/7] net: ethernet: am65-cpsw: Add mqprio, frame pre-emption & coalescing Roger Quadros
2023-11-20 14:01 ` [PATCH v6 net-next 1/7] net: ethernet: am65-cpsw: Build am65-cpsw-qos only if required Roger Quadros
2023-11-20 14:01 ` [PATCH v6 net-next 2/7] net: ethernet: am65-cpsw: cleanup TAPRIO handling Roger Quadros
2023-11-20 22:56 ` Vladimir Oltean
2023-11-21 9:23 ` Roger Quadros
2023-11-21 11:11 ` Roger Quadros
2023-11-20 14:01 ` [PATCH v6 net-next 3/7] net: ethernet: ti: am65-cpsw: Move code to avoid forward declaration Roger Quadros
2023-11-20 14:01 ` [PATCH v6 net-next 4/7] net: ethernet: am65-cpsw: Move register definitions to header file Roger Quadros
2023-11-20 14:01 ` [PATCH v6 net-next 5/7] net: ethernet: ti: am65-cpsw: add mqprio qdisc offload in channel mode Roger Quadros
2023-11-20 23:03 ` Vladimir Oltean
2023-11-21 9:25 ` Roger Quadros
2023-11-20 14:01 ` [PATCH v6 net-next 6/7] net: ethernet: ti: am65-cpsw-qos: Add Frame Preemption MAC Merge support Roger Quadros
2023-11-20 23:26 ` Vladimir Oltean
2023-11-21 11:02 ` Roger Quadros
2023-11-21 11:53 ` Vladimir Oltean
2023-11-30 11:49 ` Roger Quadros
2023-11-30 13:22 ` Vladimir Oltean [this message]
2023-11-30 14:23 ` Roger Quadros
2023-11-30 21:19 ` Vladimir Oltean
2023-11-21 11:48 ` Roger Quadros
2023-11-20 14:01 ` [PATCH v6 net-next 7/7] net: ethernet: ti: am65-cpsw: add sw tx/rx irq coalescing based on hrtimers Roger Quadros
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=20231130132222.w2irs5c4lxh5jcv7@skbuf \
--to=vladimir.oltean@nxp.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=p-varis@ti.com \
--cc=pabeni@redhat.com \
--cc=r-gunasekaran@ti.com \
--cc=rogerq@kernel.org \
--cc=s-vadapalli@ti.com \
--cc=srk@ti.com \
--cc=vigneshr@ti.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).