lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <db713b6b-cee4-5163-c081-4d7c0c4ebd4b@intel.com>
Date:   Mon, 23 Jan 2023 11:15:04 -0800
From:   Jacob Keller <jacob.e.keller@...el.com>
To:     Daniel Vacek <neelx@...hat.com>,
        Jesse Brandeburg <jesse.brandeburg@...el.com>,
        Tony Nguyen <anthony.l.nguyen@...el.com>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        "Richard Cochran" <richardcochran@...il.com>
CC:     <intel-wired-lan@...ts.osuosl.org>, <netdev@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3] ice/ptp: fix the PTP worker retrying indefinitely if
 the link went down



On 1/19/2023 12:23 PM, Daniel Vacek wrote:
> When the link goes down the ice_ptp_tx_tstamp() may loop re-trying to
> process the packets till the 2 seconds timeout finally drops them.
> In such a case it makes sense to just drop them right away.
> 
> Signed-off-by: Daniel Vacek <neelx@...hat.com>

This version looks fine to me, thanks for responding to feedback.

Reviewed-by: Jacob Keller <jacob.e.keller@...el.com>

> ---
>  drivers/net/ethernet/intel/ice/ice_ptp.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c
> index d63161d73eb16..3c39ae3ed2426 100644
> --- a/drivers/net/ethernet/intel/ice/ice_ptp.c
> +++ b/drivers/net/ethernet/intel/ice/ice_ptp.c
> @@ -680,6 +680,7 @@ static bool ice_ptp_tx_tstamp(struct ice_ptp_tx *tx)
>  	struct ice_pf *pf;
>  	struct ice_hw *hw;
>  	u64 tstamp_ready;
> +	bool link_up;
>  	int err;
>  	u8 idx;
>  
> @@ -695,11 +696,14 @@ static bool ice_ptp_tx_tstamp(struct ice_ptp_tx *tx)
>  	if (err)
>  		return false;
>  
> +	/* Drop packets if the link went down */
> +	link_up = ptp_port->link_up;
> +
>  	for_each_set_bit(idx, tx->in_use, tx->len) {
>  		struct skb_shared_hwtstamps shhwtstamps = {};
>  		u8 phy_idx = idx + tx->offset;
>  		u64 raw_tstamp = 0, tstamp;
> -		bool drop_ts = false;
> +		bool drop_ts = !link_up;
>  		struct sk_buff *skb;
>  
>  		/* Drop packets which have waited for more than 2 seconds */
> @@ -728,7 +732,7 @@ static bool ice_ptp_tx_tstamp(struct ice_ptp_tx *tx)
>  		ice_trace(tx_tstamp_fw_req, tx->tstamps[idx].skb, idx);
>  
>  		err = ice_read_phy_tstamp(hw, tx->block, phy_idx, &raw_tstamp);
> -		if (err)
> +		if (err && !drop_ts)
>  			continue;
>  
>  		ice_trace(tx_tstamp_fw_done, tx->tstamps[idx].skb, idx);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ