From: Vineeth Karumanchi <vineeth.karumanchi@amd.com>
To: <git@amd.com>, <vinicius.gomes@intel.com>, <jhs@mojatatu.com>,
<xiyou.wangcong@gmail.com>, <jiri@resnulli.us>,
<davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
<pabeni@redhat.com>, <horms@kernel.org>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Cc: <vineeth.karumanchi@amd.com>
Subject: [RFC PATCH net] net: taprio: Validate offload support using NETIF_F_HW_TC in hw_features
Date: Tue, 29 Jul 2025 11:40:34 +0530 [thread overview]
Message-ID: <20250729061034.3400624-1-vineeth.karumanchi@amd.com> (raw)
The current taprio offload validation relies solely on the presence of
.ndo_setup_tc, which is insufficient. Some IP versions of a driver expose
.ndo_setup_tc but lack actual hardware offload support for taprio.
To address this, add a check for NETIF_F_HW_TC in netdev->hw_features.
This ensures that taprio offload is only enabled on devices that
explicitly advertise hardware traffic control capabilities.
Note: Some drivers already set NETIF_F_HW_TC alongside .ndo_setup_tc.
Follow-up patches will be submitted to update remaining drivers if this
approach is accepted.
Signed-off-by: Vineeth Karumanchi <vineeth.karumanchi@amd.com>
---
net/sched/sch_taprio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c
index 2b14c81a87e5..a797995bdc8d 100644
--- a/net/sched/sch_taprio.c
+++ b/net/sched/sch_taprio.c
@@ -1506,7 +1506,7 @@ static int taprio_enable_offload(struct net_device *dev,
struct tc_taprio_caps caps;
int tc, err = 0;
- if (!ops->ndo_setup_tc) {
+ if (!ops->ndo_setup_tc || !(dev->hw_features & NETIF_F_HW_TC)) {
NL_SET_ERR_MSG(extack,
"Device does not support taprio offload");
return -EOPNOTSUPP;
--
2.34.1
next reply other threads:[~2025-07-29 6:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-29 6:10 Vineeth Karumanchi [this message]
2025-07-29 6:45 ` Eric Dumazet
2025-07-29 10:40 ` Karumanchi, Vineeth
2025-07-29 13:36 ` Eric Dumazet
2025-07-30 5:49 ` Karumanchi, Vineeth
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=20250729061034.3400624-1-vineeth.karumanchi@amd.com \
--to=vineeth.karumanchi@amd.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=git@amd.com \
--cc=horms@kernel.org \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=vinicius.gomes@intel.com \
--cc=xiyou.wangcong@gmail.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
all inboxes | Powered by JetHome®