netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: Michal Kubiak <michal.kubiak@intel.com>
Cc: <intel-wired-lan@lists.osuosl.org>, <netdev@vger.kernel.org>,
	<anthony.l.nguyen@intel.com>, <magnus.karlsson@intel.com>,
	<larysa.zaremba@intel.com>, <jacob.e.keller@intel.com>,
	Shannon Nelson <shannon.nelson@amd.com>,
	Chandan Kumar Rout <chandanx.rout@intel.com>
Subject: Re: [PATCH v3 iwl-net 5/8] ice: toggle netif_carrier when setting up XSK pool
Date: Wed, 26 Jun 2024 15:52:51 +0200	[thread overview]
Message-ID: <ZnwdMw1TgvFG1Quc@boxer> (raw)
In-Reply-To: <ZnwH07F44QBSdQ1Z@localhost.localdomain>

On Wed, Jun 26, 2024 at 02:21:39PM +0200, Michal Kubiak wrote:
> On Tue, Jun 04, 2024 at 03:21:52PM +0200, Maciej Fijalkowski wrote:
> > This so we prevent Tx timeout issues. One of conditions checked on
> > running in the background dev_watchdog() is netif_carrier_ok(), so let
> > us turn it off when we disable the queues that belong to a q_vector
> > where XSK pool is being configured.
> > 
> > Fixes: 2d4238f55697 ("ice: Add support for AF_XDP")
> > Reviewed-by: Shannon Nelson <shannon.nelson@amd.com>
> > Tested-by: Chandan Kumar Rout <chandanx.rout@intel.com> (A Contingent Worker at Intel)
> > Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
> > ---
> >  drivers/net/ethernet/intel/ice/ice_xsk.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/net/ethernet/intel/ice/ice_xsk.c b/drivers/net/ethernet/intel/ice/ice_xsk.c
> > index 8ca7ff1a7e7f..21df6888961b 100644
> > --- a/drivers/net/ethernet/intel/ice/ice_xsk.c
> > +++ b/drivers/net/ethernet/intel/ice/ice_xsk.c
> > @@ -180,6 +180,7 @@ static int ice_qp_dis(struct ice_vsi *vsi, u16 q_idx)
> >  	}
> >  
> >  	synchronize_net();
> > +	netif_carrier_off(vsi->netdev);
> >  	netif_tx_stop_queue(netdev_get_tx_queue(vsi->netdev, q_idx));
> >  
> >  	ice_qvec_dis_irq(vsi, rx_ring, q_vector);
> > @@ -249,6 +250,7 @@ static int ice_qp_ena(struct ice_vsi *vsi, u16 q_idx)
> >  	ice_qvec_ena_irq(vsi, q_vector);
> >  
> >  	netif_tx_start_queue(netdev_get_tx_queue(vsi->netdev, q_idx));
> > +	netif_carrier_on(vsi->netdev);
> 
> I would add checking the physical link state before calling
> 'netif_carrier_on()'. Please consider the scenario that the link is
> going physically *down* during the XSk pool configuration.
> In such a case we can wrongly set "carrier_on" uncoditionally.
> Please take a look at the followng suggestion:
> 
> 	ice_get_link_status(vsi->port_info, &link_up);
> 	if (link_up)
>  		netif_carrier_on(vsi->netdev);

Will include this in v4. Worth mentioning that it is safe to do so as
there is always a service task that will turn carrier on for us.

> 
> Thanks,
> Michal

  reply	other threads:[~2024-06-26 13:53 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-04 13:21 [PATCH v3 iwl-net 0/8] ice: fix AF_XDP ZC timeout and concurrency issues Maciej Fijalkowski
2024-06-04 13:21 ` [PATCH v3 iwl-net 1/8] ice: respect netif readiness in AF_XDP ZC related ndo's Maciej Fijalkowski
2024-06-11 11:59   ` [Intel-wired-lan] " Alexander Lobakin
2024-06-11 14:21     ` Maciej Fijalkowski
2024-06-11 20:13       ` Tony Nguyen
2024-06-12  9:09       ` Alexander Lobakin
2024-06-12  9:15         ` Alexander Lobakin
2024-06-13 15:51           ` Maciej Fijalkowski
2024-06-13 16:07             ` Maciej Fijalkowski
2024-06-14  9:34               ` Alexander Lobakin
2024-06-04 13:21 ` [PATCH v3 iwl-net 2/8] ice: don't busy wait for Rx queue disable in ice_qp_dis() Maciej Fijalkowski
2024-06-04 13:21 ` [PATCH v3 iwl-net 3/8] ice: replace synchronize_rcu with synchronize_net Maciej Fijalkowski
2024-06-04 13:21 ` [PATCH v3 iwl-net 4/8] ice: modify error handling when setting XSK pool in ndo_bpf Maciej Fijalkowski
2024-06-04 13:21 ` [PATCH v3 iwl-net 5/8] ice: toggle netif_carrier when setting up XSK pool Maciej Fijalkowski
2024-06-26 12:21   ` Michal Kubiak
2024-06-26 13:52     ` Maciej Fijalkowski [this message]
2024-06-04 13:21 ` [PATCH v3 iwl-net 6/8] ice: improve updating ice_{t,r}x_ring::xsk_pool Maciej Fijalkowski
2024-06-04 13:21 ` [PATCH v3 iwl-net 7/8] ice: add missing WRITE_ONCE when clearing ice_rx_ring::xdp_prog Maciej Fijalkowski
2024-06-04 13:21 ` [PATCH v3 iwl-net 8/8] ice: xsk: fix txq interrupt mapping Maciej Fijalkowski

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=ZnwdMw1TgvFG1Quc@boxer \
    --to=maciej.fijalkowski@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=chandanx.rout@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jacob.e.keller@intel.com \
    --cc=larysa.zaremba@intel.com \
    --cc=magnus.karlsson@intel.com \
    --cc=michal.kubiak@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=shannon.nelson@amd.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).