netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: libwx: fix the incorrect display of the queue number
@ 2025-06-27  8:09 Jiawen Wu
  2025-06-27 19:07 ` Simon Horman
  2025-07-01  1:31 ` Jakub Kicinski
  0 siblings, 2 replies; 4+ messages in thread
From: Jiawen Wu @ 2025-06-27  8:09 UTC (permalink / raw)
  To: netdev, andrew+netdev, davem, edumazet, kuba, pabeni, horms
  Cc: mengyuanlou, Jiawen Wu, stable

When setting "ethtool -L eth0 combined 1", the number of RX/TX queue is
changed to be 1. RSS is disabled at this moment, and the indices of FDIR
have not be changed in wx_set_rss_queues(). So the combined count still
shows the previous value. This issue was introduced when supporting
FDIR. Fix it for those devices that support FDIR.

Fixes: 34744a7749b3 ("net: txgbe: add FDIR info to ethtool ops")
Cc: stable@vger.kernel.org
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
 drivers/net/ethernet/wangxun/libwx/wx_ethtool.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/wangxun/libwx/wx_ethtool.c b/drivers/net/ethernet/wangxun/libwx/wx_ethtool.c
index c12a4cb951f6..d9de600e685a 100644
--- a/drivers/net/ethernet/wangxun/libwx/wx_ethtool.c
+++ b/drivers/net/ethernet/wangxun/libwx/wx_ethtool.c
@@ -438,6 +438,10 @@ void wx_get_channels(struct net_device *dev,
 	/* record RSS queues */
 	ch->combined_count = wx->ring_feature[RING_F_RSS].indices;
 
+	/* nothing else to report if RSS is disabled */
+	if (ch->combined_count == 1)
+		return;
+
 	if (test_bit(WX_FLAG_FDIR_CAPABLE, wx->flags))
 		ch->combined_count = wx->ring_feature[RING_F_FDIR].indices;
 }
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: libwx: fix the incorrect display of the queue number
  2025-06-27  8:09 [PATCH] net: libwx: fix the incorrect display of the queue number Jiawen Wu
@ 2025-06-27 19:07 ` Simon Horman
  2025-07-01  1:31 ` Jakub Kicinski
  1 sibling, 0 replies; 4+ messages in thread
From: Simon Horman @ 2025-06-27 19:07 UTC (permalink / raw)
  To: Jiawen Wu
  Cc: netdev, andrew+netdev, davem, edumazet, kuba, pabeni, mengyuanlou,
	stable

On Fri, Jun 27, 2025 at 04:09:38PM +0800, Jiawen Wu wrote:
> When setting "ethtool -L eth0 combined 1", the number of RX/TX queue is
> changed to be 1. RSS is disabled at this moment, and the indices of FDIR
> have not be changed in wx_set_rss_queues(). So the combined count still
> shows the previous value. This issue was introduced when supporting
> FDIR. Fix it for those devices that support FDIR.
> 
> Fixes: 34744a7749b3 ("net: txgbe: add FDIR info to ethtool ops")
> Cc: stable@vger.kernel.org
> Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>

I am assuming that this is for net.

Reviewed-by: Simon Horman <horms@kernel.org>

...

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: libwx: fix the incorrect display of the queue number
  2025-06-27  8:09 [PATCH] net: libwx: fix the incorrect display of the queue number Jiawen Wu
  2025-06-27 19:07 ` Simon Horman
@ 2025-07-01  1:31 ` Jakub Kicinski
  2025-07-01  7:02   ` Jiawen Wu
  1 sibling, 1 reply; 4+ messages in thread
From: Jakub Kicinski @ 2025-07-01  1:31 UTC (permalink / raw)
  To: Jiawen Wu
  Cc: netdev, andrew+netdev, davem, edumazet, pabeni, horms,
	mengyuanlou, stable

On Fri, 27 Jun 2025 16:09:38 +0800 Jiawen Wu wrote:
> When setting "ethtool -L eth0 combined 1", the number of RX/TX queue is
> changed to be 1. RSS is disabled at this moment, and the indices of FDIR
> have not be changed in wx_set_rss_queues(). So the combined count still
> shows the previous value. This issue was introduced when supporting
> FDIR. Fix it for those devices that support FDIR.

Why are you hacking up the get_channels rather than making _F_FDIR be
sane in all situations? I mean why not:

--- a/drivers/net/ethernet/wangxun/libwx/wx_lib.c
+++ b/drivers/net/ethernet/wangxun/libwx/wx_lib.c
@@ -1709,6 +1709,7 @@ static void wx_set_rss_queues(struct wx *wx)
         * distribution of flows across cores, even when an FDIR flow
         * isn't matched.
         */
+       wx->ring_feature[RING_F_FDIR].indices = 1;
        if (f->indices > 1) {
                f = &wx->ring_feature[RING_F_FDIR];
 
?
-- 
pw-bot: cr

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] net: libwx: fix the incorrect display of the queue number
  2025-07-01  1:31 ` Jakub Kicinski
@ 2025-07-01  7:02   ` Jiawen Wu
  0 siblings, 0 replies; 4+ messages in thread
From: Jiawen Wu @ 2025-07-01  7:02 UTC (permalink / raw)
  To: 'Jakub Kicinski'
  Cc: netdev, andrew+netdev, davem, edumazet, pabeni, horms,
	mengyuanlou, stable

On Tue, Jul 1, 2025 9:31 AM, Jakub Kicinski wrote:
> On Fri, 27 Jun 2025 16:09:38 +0800 Jiawen Wu wrote:
> > When setting "ethtool -L eth0 combined 1", the number of RX/TX queue is
> > changed to be 1. RSS is disabled at this moment, and the indices of FDIR
> > have not be changed in wx_set_rss_queues(). So the combined count still
> > shows the previous value. This issue was introduced when supporting
> > FDIR. Fix it for those devices that support FDIR.
> 
> Why are you hacking up the get_channels rather than making _F_FDIR be
> sane in all situations? I mean why not:
> 
> --- a/drivers/net/ethernet/wangxun/libwx/wx_lib.c
> +++ b/drivers/net/ethernet/wangxun/libwx/wx_lib.c
> @@ -1709,6 +1709,7 @@ static void wx_set_rss_queues(struct wx *wx)
>          * distribution of flows across cores, even when an FDIR flow
>          * isn't matched.
>          */
> +       wx->ring_feature[RING_F_FDIR].indices = 1;
>         if (f->indices > 1) {
>                 f = &wx->ring_feature[RING_F_FDIR];
> 
> ?

This is quite reasonable, thanks.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-07-01  7:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-27  8:09 [PATCH] net: libwx: fix the incorrect display of the queue number Jiawen Wu
2025-06-27 19:07 ` Simon Horman
2025-07-01  1:31 ` Jakub Kicinski
2025-07-01  7:02   ` Jiawen Wu

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).