Hello,

On Fri, Apr 28, 2023 at 09:02:35PM +0000, Klemens Nanni wrote:
> Same logic and argument as for the parent *S ioctl, might as well have
> committed them together:
>     ---
>     Remove net lock from DIOCGETQUEUES
> 
>     Both ticket and number of queues stem from the pf_queues_active list which
>     is effectively static to pf_ioctl.c and fully protected by the pf lock.
>     ---
> 
> OK?

    looks good

OK sashan
> 
> 
> Index: pf_ioctl.c
> ===================================================================
> RCS file: /cvs/src/sys/net/pf_ioctl.c,v
> retrieving revision 1.401
> diff -u -p -U5 -r1.401 pf_ioctl.c
> --- pf_ioctl.c        28 Apr 2023 14:08:38 -0000      1.401
> +++ pf_ioctl.c        28 Apr 2023 20:52:54 -0000
> @@ -1229,32 +1229,28 @@ pfioctl(dev_t dev, u_long cmd, caddr_t a
>       case DIOCGETQUEUE: {
>               struct pfioc_queue      *pq = (struct pfioc_queue *)addr;
>               struct pf_queuespec     *qs;
>               u_int32_t                nr = 0;
>  
> -             NET_LOCK();
>               PF_LOCK();
>               if (pq->ticket != pf_main_ruleset.rules.active.version) {
>                       error = EBUSY;
>                       PF_UNLOCK();
> -                     NET_UNLOCK();
>                       goto fail;
>               }
>  
>               /* save state to not run over them all each time? */
>               qs = TAILQ_FIRST(pf_queues_active);
>               while ((qs != NULL) && (nr++ < pq->nr))
>                       qs = TAILQ_NEXT(qs, entries);
>               if (qs == NULL) {
>                       error = EBUSY;
>                       PF_UNLOCK();
> -                     NET_UNLOCK();
>                       goto fail;
>               }
>               memcpy(&pq->queue, qs, sizeof(pq->queue));
>               PF_UNLOCK();
> -             NET_UNLOCK();
>               break;
>       }
>  
>       case DIOCGETQSTATS: {
>               struct pfioc_qstats     *pq = (struct pfioc_qstats *)addr;
> 

Reply via email to