netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Edward Cree <ecree.xilinx@gmail.com>
To: "Íñigo Huguet" <ihuguet@redhat.com>, habetsm.xilinx@gmail.com
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, richardcochran@gmail.com,
	netdev@vger.kernel.org, Yalin Li <yalli@redhat.com>
Subject: Re: [PATCH v5 net-next 4/4] sfc: remove expired unicast PTP filters
Date: Tue, 28 Mar 2023 05:19:33 +0100	[thread overview]
Message-ID: <b1cb1f82-d5db-af2b-ceeb-956501abc639@gmail.com> (raw)
In-Reply-To: <20230327105755.13949-5-ihuguet@redhat.com>

On 27/03/2023 11:57, Íñigo Huguet wrote:
> Filters inserted to support unicast PTP mode might become unused after
> some time, so we need to remove them to avoid accumulating many of them.
> 
> Refresh the expiration time of a filter each time it's used. Then check
> periodically if any filter hasn't been used for a long time (30s) and
> remove it.
> 
> Reported-by: Yalin Li <yalli@redhat.com>
> Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
> ---
...
> @@ -1378,8 +1394,12 @@ static int efx_ptp_insert_filter(struct efx_nic *efx,
>  	rxfilter->ether_type = spec->ether_type;
>  	rxfilter->loc_port = spec->loc_port;
>  	memcpy(rxfilter->loc_host, spec->loc_host, sizeof(spec->loc_host));
> +	rxfilter->expiry = expiry;
>  	list_add(&rxfilter->list, filter_list);
>  
> +	queue_delayed_work(ptp->workwq, &ptp->cleanup_work,
> +			   UCAST_FILTER_EXPIRY_JIFFIES);

Why not +1 here...

> +static void efx_ptp_cleanup_worker(struct work_struct *work)
> +{
> +	struct efx_ptp_data *ptp =
> +		container_of(work, struct efx_ptp_data, cleanup_work.work);
> +	struct efx_ptp_rxfilter *rxfilter, *tmp;
> +
> +	list_for_each_entry_safe(rxfilter, tmp, &ptp->rxfilters_ucast, list) {
> +		if (time_is_before_jiffies(rxfilter->expiry))
> +			efx_ptp_remove_one_filter(ptp->efx, rxfilter);
> +	}
> +
> +	if (!list_empty(&ptp->rxfilters_ucast)) {
> +		queue_delayed_work(ptp->workwq, &ptp->cleanup_work,
> +				   UCAST_FILTER_EXPIRY_JIFFIES + 1);
> +	}

... like you have here?  (Or vice-versa.)
Other than that LGTM.

  reply	other threads:[~2023-03-28  4:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-27 10:57 [PATCH v5 net-next 0/4] sfc: support unicast PTP Íñigo Huguet
2023-03-27 10:57 ` [PATCH v5 net-next 1/4] sfc: store PTP filters in a list Íñigo Huguet
2023-03-28  4:07   ` Edward Cree
2023-03-27 10:57 ` [PATCH v5 net-next 2/4] sfc: allow insertion of filters for unicast PTP Íñigo Huguet
2023-03-28  4:09   ` Edward Cree
2023-03-27 10:57 ` [PATCH v5 net-next 3/4] sfc: support " Íñigo Huguet
2023-03-28  4:10   ` Edward Cree
2023-03-27 10:57 ` [PATCH v5 net-next 4/4] sfc: remove expired unicast PTP filters Íñigo Huguet
2023-03-28  4:19   ` Edward Cree [this message]
2023-03-28 22:47   ` Jakub Kicinski

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=b1cb1f82-d5db-af2b-ceeb-956501abc639@gmail.com \
    --to=ecree.xilinx@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=habetsm.xilinx@gmail.com \
    --cc=ihuguet@redhat.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=yalli@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).