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
| ||
|
Message-ID: <b1cb1f82-d5db-af2b-ceeb-956501abc639@gmail.com> Date: Tue, 28 Mar 2023 05:19:33 +0100 From: Edward Cree <ecree.xilinx@...il.com> To: Íñigo Huguet <ihuguet@...hat.com>, habetsm.xilinx@...il.com Cc: davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com, richardcochran@...il.com, netdev@...r.kernel.org, Yalin Li <yalli@...hat.com> Subject: Re: [PATCH v5 net-next 4/4] sfc: remove expired unicast PTP filters 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@...hat.com> > Signed-off-by: Íñigo Huguet <ihuguet@...hat.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.
Powered by blists - more mailing lists