* [PATCH net-next] igc: avoid kernel warning when changing RX ring parameters
@ 2022-01-13 16:00 Corinna Vinschen
2022-01-14 0:37 ` Vinicius Costa Gomes
0 siblings, 1 reply; 3+ messages in thread
From: Corinna Vinschen @ 2022-01-13 16:00 UTC (permalink / raw)
To: netdev, intel-wired-lan; +Cc: Andre Guedes, Sasha Neftin
Calling ethtool changing the RX ring parameters like this:
$ ethtool -G eth0 rx 1024
triggers the "Missing unregister, handled but fix driver" warning in
xdp_rxq_info_reg().
igc_ethtool_set_ringparam() copies the igc_ring structure but neglects to
reset the xdp_rxq_info member before calling igc_setup_rx_resources().
This in turn calls xdp_rxq_info_reg() with an already registered xdp_rxq_info.
This fix initializes the xdp_rxq_info member prior to calling
igc_setup_rx_resources(), exactly like igb.
Fixes: 73f1071c1d29 ("igc: Add support for XDP_TX action")
Signed-off-by: Corinna Vinschen <vinschen@redhat.com>
---
drivers/net/ethernet/intel/igc/igc_ethtool.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c
index 8cc077b712ad..93839106504d 100644
--- a/drivers/net/ethernet/intel/igc/igc_ethtool.c
+++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c
@@ -671,6 +671,10 @@ igc_ethtool_set_ringparam(struct net_device *netdev,
memcpy(&temp_ring[i], adapter->rx_ring[i],
sizeof(struct igc_ring));
+ /* Clear copied XDP RX-queue info */
+ memset(&temp_ring[i].xdp_rxq, 0,
+ sizeof(temp_ring[i].xdp_rxq));
+
temp_ring[i].count = new_rx_count;
err = igc_setup_rx_resources(&temp_ring[i]);
if (err) {
--
2.27.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH net-next] igc: avoid kernel warning when changing RX ring parameters
2022-01-13 16:00 [PATCH net-next] igc: avoid kernel warning when changing RX ring parameters Corinna Vinschen
@ 2022-01-14 0:37 ` Vinicius Costa Gomes
2022-01-14 10:27 ` [Intel-wired-lan] " Corinna Vinschen
0 siblings, 1 reply; 3+ messages in thread
From: Vinicius Costa Gomes @ 2022-01-14 0:37 UTC (permalink / raw)
To: Corinna Vinschen, netdev, intel-wired-lan; +Cc: Andre Guedes, Sasha Neftin
Corinna Vinschen <vinschen@redhat.com> writes:
> Calling ethtool changing the RX ring parameters like this:
>
> $ ethtool -G eth0 rx 1024
>
> triggers the "Missing unregister, handled but fix driver" warning in
> xdp_rxq_info_reg().
>
> igc_ethtool_set_ringparam() copies the igc_ring structure but neglects to
> reset the xdp_rxq_info member before calling igc_setup_rx_resources().
> This in turn calls xdp_rxq_info_reg() with an already registered xdp_rxq_info.
>
> This fix initializes the xdp_rxq_info member prior to calling
> igc_setup_rx_resources(), exactly like igb.
>
> Fixes: 73f1071c1d29 ("igc: Add support for XDP_TX action")
> Signed-off-by: Corinna Vinschen <vinschen@redhat.com>
> ---
> drivers/net/ethernet/intel/igc/igc_ethtool.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c
> index 8cc077b712ad..93839106504d 100644
> --- a/drivers/net/ethernet/intel/igc/igc_ethtool.c
> +++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c
> @@ -671,6 +671,10 @@ igc_ethtool_set_ringparam(struct net_device *netdev,
> memcpy(&temp_ring[i], adapter->rx_ring[i],
> sizeof(struct igc_ring));
>
> + /* Clear copied XDP RX-queue info */
> + memset(&temp_ring[i].xdp_rxq, 0,
> + sizeof(temp_ring[i].xdp_rxq));
> +
Reaching "inside" xdp_rxq to reset it doesn't feel right in this
context, even if it's going to work fine (for now).
I think that the suggestion that Alexander gave in that other thread is
the best approach. And thanks for noticing that igb '_set_ringparam()'
has the same underlying problem and also needs to be fixed.
Cheers,
--
Vinicius
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [Intel-wired-lan] [PATCH net-next] igc: avoid kernel warning when changing RX ring parameters
2022-01-14 0:37 ` Vinicius Costa Gomes
@ 2022-01-14 10:27 ` Corinna Vinschen
0 siblings, 0 replies; 3+ messages in thread
From: Corinna Vinschen @ 2022-01-14 10:27 UTC (permalink / raw)
To: Vinicius Costa Gomes; +Cc: netdev, intel-wired-lan, Andre Guedes
On Jan 13 16:37, Vinicius Costa Gomes wrote:
> Corinna Vinschen <vinschen@redhat.com> writes:
>
> > Calling ethtool changing the RX ring parameters like this:
> >
> > $ ethtool -G eth0 rx 1024
> >
> > triggers the "Missing unregister, handled but fix driver" warning in
> > xdp_rxq_info_reg().
> >[...]
>
> Reaching "inside" xdp_rxq to reset it doesn't feel right in this
> context, even if it's going to work fine (for now).
>
> I think that the suggestion that Alexander gave in that other thread is
> the best approach. And thanks for noticing that igb '_set_ringparam()'
> has the same underlying problem and also needs to be fixed.
Yeah, it didn't sit overly well with me either, but I thought if it's
good for igb...
Either way, the better approach should be sth. like this in both,
ig[bc]_setup_rx_resources:
if (xdp_rxq_info_is_reg(&rx_ring->xdp_rxq))
xdp_rxq_info_unreg(&rx_ring->xdp_rxq);
res = xdp_rxq_info_reg(&rx_ring->xdp_rxq, ndev, index,
rx_ring->q_vector->napi.napi_id);
And while at it, wouldn't it make sense to move the xdp_rxq_info_reg
call in igc_setup_rx_resources down to be the last action, so the error
path doesn't have to call xdp_rxq_info_unreg, just like in
igb_setup_rx_resources?
Thanks,
Corinna
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-01-14 10:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-13 16:00 [PATCH net-next] igc: avoid kernel warning when changing RX ring parameters Corinna Vinschen
2022-01-14 0:37 ` Vinicius Costa Gomes
2022-01-14 10:27 ` [Intel-wired-lan] " Corinna Vinschen
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).