From: "Íñigo Huguet" <ihuguet@redhat.com>
To: ecree.xilinx@gmail.com, habetsm.xilinx@gmail.com, amaftei@solarflare.com
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, netdev@vger.kernel.org,
"Íñigo Huguet" <ihuguet@redhat.com>,
"Tianhao Zhao" <tizhao@redhat.com>
Subject: [PATCH net 2/2] sfc: do not initialize non existing queues with efx_separate_tx_channels
Date: Wed, 11 May 2022 14:59:41 +0200 [thread overview]
Message-ID: <20220511125941.55812-3-ihuguet@redhat.com> (raw)
In-Reply-To: <20220511125941.55812-1-ihuguet@redhat.com>
If efx_separate_tx_channels is used, some error messages and backtraces
are shown in the logs (see below). This is because during channels
start, all queues in the channels are init asumming that they exist, but
they might not if efx_separate_tx_channels is used: some channels only
have RX queues and others only have TX queues.
Avoid that by checking if the channel has TX, RX or both queues.
However, even with this patch the NIC is unusable when using
efx_separate_tx_channels, so there are more problems that I've not
identified. These messages are still shown at probe time many times:
sfc 0000:03:00.0 (unnamed net_device) (uninitialized): MC command 0x92 inlen 8 failed rc=-71 (raw=0) arg=0
sfc 0000:03:00.0 (unnamed net_device) (uninitialized): failed to link VI 4294967295 to PIO buffer 1 (-71)
Those messages were also shown before these patch.
And then this other message and backtrace were also shown many times,
but now they're not:
sfc 0000:03:00.0 ens6f0np0: MC command 0x82 inlen 544 failed rc=-22 (raw=0) arg=0
------------[ cut here ]------------
netdevice: ens6f0np0: failed to initialise TXQ -1
WARNING: CPU: 1 PID: 626 at drivers/net/ethernet/sfc/ef10.c:2393 efx_ef10_tx_init+0x201/0x300 [sfc]
[...] stripped
RIP: 0010:efx_ef10_tx_init+0x201/0x300 [sfc]
[...] stripped
Call Trace:
efx_init_tx_queue+0xaa/0xf0 [sfc]
efx_start_channels+0x49/0x120 [sfc]
efx_start_all+0x1f8/0x430 [sfc]
efx_net_open+0x5a/0xe0 [sfc]
__dev_open+0xd0/0x190
__dev_change_flags+0x1b3/0x220
dev_change_flags+0x21/0x60
[...]
At remove time, these messages were shown. Now they're neither shown:
sfc 0000:03:00.0 ens6f0np0: failed to flush 10 queues
sfc 0000:03:00.0 ens6f0np0: failed to flush queues
Fixes: 7ec3de426014 ("sfc: move datapath management code")
Reported-by: Tianhao Zhao <tizhao@redhat.com>
Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
---
drivers/net/ethernet/sfc/efx_channels.c | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/sfc/efx_channels.c b/drivers/net/ethernet/sfc/efx_channels.c
index da2db6791907..b6b960e2021c 100644
--- a/drivers/net/ethernet/sfc/efx_channels.c
+++ b/drivers/net/ethernet/sfc/efx_channels.c
@@ -1139,17 +1139,21 @@ void efx_start_channels(struct efx_nic *efx)
struct efx_channel *channel;
efx_for_each_channel_rev(channel, efx) {
- efx_for_each_channel_tx_queue(tx_queue, channel) {
- efx_init_tx_queue(tx_queue);
- atomic_inc(&efx->active_queues);
+ if (channel->channel >= efx->tx_channel_offset) {
+ efx_for_each_channel_tx_queue(tx_queue, channel) {
+ efx_init_tx_queue(tx_queue);
+ atomic_inc(&efx->active_queues);
+ }
}
- efx_for_each_channel_rx_queue(rx_queue, channel) {
- efx_init_rx_queue(rx_queue);
- atomic_inc(&efx->active_queues);
- efx_stop_eventq(channel);
- efx_fast_push_rx_descriptors(rx_queue, false);
- efx_start_eventq(channel);
+ if (channel->channel < efx->n_rx_channels) {
+ efx_for_each_channel_rx_queue(rx_queue, channel) {
+ efx_init_rx_queue(rx_queue);
+ atomic_inc(&efx->active_queues);
+ efx_stop_eventq(channel);
+ efx_fast_push_rx_descriptors(rx_queue, false);
+ efx_start_eventq(channel);
+ }
}
WARN_ON(channel->rx_pkt_n_frags);
--
2.34.1
next prev parent reply other threads:[~2022-05-11 13:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-11 12:59 [PATCH net 0/2] sfc: fix some efx_separate_tx_channels errors Íñigo Huguet
2022-05-11 12:59 ` [PATCH net 1/2] sfc: fix wrong tx channel offset with efx_separate_tx_channels Íñigo Huguet
2022-05-12 17:01 ` Jakub Kicinski
2022-05-11 12:59 ` Íñigo Huguet [this message]
2022-05-13 11:07 ` [PATCH net 2/2] sfc: do not initialize non existing queues " Martin Habets
2022-05-13 12:37 ` Martin Habets
2022-05-24 15:36 ` Íñigo Huguet
2022-05-27 6:14 ` Martin Habets
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=20220511125941.55812-3-ihuguet@redhat.com \
--to=ihuguet@redhat.com \
--cc=amaftei@solarflare.com \
--cc=davem@davemloft.net \
--cc=ecree.xilinx@gmail.com \
--cc=edumazet@google.com \
--cc=habetsm.xilinx@gmail.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=tizhao@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).