> On 14 Jun 2021, at 19:12, Alexandr Nedvedicky
> <alexandr.nedvedi...@oracle.com> wrote:
>
> Hello,
>
> looks good to me. I think this should be committed
> as-is. I have just one question,
>
> On Mon, Jun 14, 2021 at 01:58:06PM +1000, David Gwynne wrote:
> </snip>
>> @@ -1931,6 +1933,9 @@ pfsync_defer(struct pf_state *st, struct
>> {
>> struct pfsync_softc *sc = pfsyncif;
>> struct pfsync_deferral *pd;
>> + struct timeval now;
>> + unsigned int sched;
>> + static const struct timeval defer = { 0, 20000 };
> ^^^^^^^
> I'm just curious, why there is a static?
so it can exist in the ro data section rather than get set up on the stack
every call.
>>
>> NET_ASSERT_LOCKED();
>>
>> @@ -1942,10 +1947,12 @@ pfsync_defer(struct pf_state *st, struct
>> if (sc->sc_deferred >= 128) {
>> mtx_enter(&sc->sc_deferrals_mtx);
>> pd = TAILQ_FIRST(&sc->sc_deferrals);
>> - TAILQ_REMOVE(&sc->sc_deferrals, pd, pd_entry);
>> - sc->sc_deferred--;
>> + if (pd != NULL) {
>> + TAILQ_REMOVE(&sc->sc_deferrals, pd, pd_entry);
>> + sc->sc_deferred--;
>> + }
>> mtx_leave(&sc->sc_deferrals_mtx);
>> - if (timeout_del(&pd->pd_tmo))
>> + if (pd != NULL)
>> pfsync_undefer(pd, 0);
>
> yes, this still needs fix, we discuss in other thread [1].
>
> please go ahead and commit your change here, so I can refresh
> my patches.
>
>
> OK sashan@