RE: [PATCH net-next v02 1/2] af_packet: allow fanout_add when socket is not RUNNING

2024-10-11 Thread Willem de Bruijn
Gur Stavi wrote: > > Gur Stavi wrote: > > > > > > > > If we don't care about opening up fanout groups to ETH_P_NONE, then > > > > patch v2 seems sufficient. If explicitly blocking this, the ENXIO > > > > return can be added, but ideally without touching the other lines. > > > > > > I don't think th

RE: [PATCH net-next v02 1/2] af_packet: allow fanout_add when socket is not RUNNING

2024-10-11 Thread Gur Stavi
> Gur Stavi wrote: > > > > > > If we don't care about opening up fanout groups to ETH_P_NONE, then > > > patch v2 seems sufficient. If explicitly blocking this, the ENXIO > > > return can be added, but ideally without touching the other lines. > > > > I don't think that allowing ETH_P_NONE is relev

RE: [PATCH net-next v02 1/2] af_packet: allow fanout_add when socket is not RUNNING

2024-10-11 Thread Willem de Bruijn
Gur Stavi wrote: > > > > If we don't care about opening up fanout groups to ETH_P_NONE, then > > patch v2 seems sufficient. If explicitly blocking this, the ENXIO > > return can be added, but ideally without touching the other lines. > > I don't think that allowing ETH_P_NONE is relevant. > In my

RE: [PATCH net-next v02 1/2] af_packet: allow fanout_add when socket is not RUNNING

2024-10-11 Thread Willem de Bruijn
Gur Stavi wrote: > > Gur Stavi wrote: > > > > Gur Stavi wrote: > > > > > > Gur Stavi wrote: > > > > > > > > Gur Stavi wrote: > > > > > > > > > >> @@ -1846,21 +1846,21 @@ static int fanout_add(struct > > sock > > > > *sk, > > > > > > > > struct fanout_args *args) > > > > > > > > > >>err = -EINVA

RE: [PATCH net-next v02 1/2] af_packet: allow fanout_add when socket is not RUNNING

2024-10-11 Thread Gur Stavi
> > If we don't care about opening up fanout groups to ETH_P_NONE, then > patch v2 seems sufficient. If explicitly blocking this, the ENXIO > return can be added, but ideally without touching the other lines. I don't think that allowing ETH_P_NONE is relevant. In my opinion the 2 options that sho

RE: [PATCH net-next v02 1/2] af_packet: allow fanout_add when socket is not RUNNING

2024-10-10 Thread Gur Stavi
> Gur Stavi wrote: > > > Gur Stavi wrote: > > > > > Gur Stavi wrote: > > > > > > > Gur Stavi wrote: > > > > > > > > >> @@ -1846,21 +1846,21 @@ static int fanout_add(struct > sock > > > *sk, > > > > > > > struct fanout_args *args) > > > > > > > > >> err = -EINVAL; > > > > > > > > >> > > > > > >

RE: [PATCH net-next v02 1/2] af_packet: allow fanout_add when socket is not RUNNING

2024-10-10 Thread Willem de Bruijn
Gur Stavi wrote: > > Gur Stavi wrote: > > > > Gur Stavi wrote: > > > > > > Gur Stavi wrote: > > > > > > > >> @@ -1846,21 +1846,21 @@ static int fanout_add(struct sock > > *sk, > > > > > > struct fanout_args *args) > > > > > > > >>err = -EINVAL; > > > > > > > >> > > > > > > > >>spin_

RE: [PATCH net-next v02 1/2] af_packet: allow fanout_add when socket is not RUNNING

2024-10-10 Thread Gur Stavi
> Gur Stavi wrote: > > > Gur Stavi wrote: > > > > > Gur Stavi wrote: > > > > > > >> @@ -1846,21 +1846,21 @@ static int fanout_add(struct sock > *sk, > > > > > struct fanout_args *args) > > > > > > >> err = -EINVAL; > > > > > > >> > > > > > > >> spin_lock(&po->bind_lock); > > > > >

RE: [PATCH net-next v02 1/2] af_packet: allow fanout_add when socket is not RUNNING

2024-10-10 Thread Willem de Bruijn
Gur Stavi wrote: > > Gur Stavi wrote: > > > > Gur Stavi wrote: > > > > > >> @@ -1846,21 +1846,21 @@ static int fanout_add(struct sock *sk, > > > > struct fanout_args *args) > > > > > >>err = -EINVAL; > > > > > >> > > > > > >>spin_lock(&po->bind_lock); > > > > > >> - if (packet_sock_flag(po

RE: [PATCH net-next v02 1/2] af_packet: allow fanout_add when socket is not RUNNING

2024-10-10 Thread Gur Stavi
> I realized another possible problem. We should consider adding ifindex > Field to struct packet_fanout to be used for lookup of an existing match. > There is little sense to bind sockets to different interfaces and then > put them in the same fanout group. > If you agree, I can prepare a separate

RE: [PATCH net-next v02 1/2] af_packet: allow fanout_add when socket is not RUNNING

2024-10-10 Thread Gur Stavi
> Gur Stavi wrote: > > > Gur Stavi wrote: > > > > >> @@ -1846,21 +1846,21 @@ static int fanout_add(struct sock *sk, > > > struct fanout_args *args) > > > > >> err = -EINVAL; > > > > >> > > > > >> spin_lock(&po->bind_lock); > > > > >> -if (packet_sock_flag(po, PACKET_SOCK_RUNNING) && >

RE: [PATCH net-next v02 1/2] af_packet: allow fanout_add when socket is not RUNNING

2024-10-09 Thread Willem de Bruijn
Gur Stavi wrote: > > Gur Stavi wrote: > > > >> @@ -1846,21 +1846,21 @@ static int fanout_add(struct sock *sk, > > struct fanout_args *args) > > > >>err = -EINVAL; > > > >> > > > >>spin_lock(&po->bind_lock); > > > >> - if (packet_sock_flag(po, PACKET_SOCK_RUNNING) && > > > >> -

RE: [PATCH net-next v02 1/2] af_packet: allow fanout_add when socket is not RUNNING

2024-10-09 Thread Gur Stavi
> Gur Stavi wrote: > > >> @@ -1846,21 +1846,21 @@ static int fanout_add(struct sock *sk, > struct fanout_args *args) > > >> err = -EINVAL; > > >> > > >> spin_lock(&po->bind_lock); > > >> -if (packet_sock_flag(po, PACKET_SOCK_RUNNING) && > > >> -match->type == t

Re: [PATCH net-next v02 1/2] af_packet: allow fanout_add when socket is not RUNNING

2024-10-09 Thread Willem de Bruijn
Gur Stavi wrote: > >> @@ -1846,21 +1846,21 @@ static int fanout_add(struct sock *sk, struct > >> fanout_args *args) > >>err = -EINVAL; > >> > >>spin_lock(&po->bind_lock); > >> - if (packet_sock_flag(po, PACKET_SOCK_RUNNING) && > >> - match->type == type && > >> + if (match->type ==

Re: [PATCH net-next v02 1/2] af_packet: allow fanout_add when socket is not RUNNING

2024-10-09 Thread Gur Stavi
>> @@ -1846,21 +1846,21 @@ static int fanout_add(struct sock *sk, struct >> fanout_args *args) >> err = -EINVAL; >> >> spin_lock(&po->bind_lock); >> -if (packet_sock_flag(po, PACKET_SOCK_RUNNING) && >> -match->type == type && >> +if (match->type == type && >> mat

Re: [PATCH net-next v02 1/2] af_packet: allow fanout_add when socket is not RUNNING

2024-10-08 Thread Willem de Bruijn
Gur Stavi wrote: > PACKET socket can retain its fanout membership through link down and up > and leave a fanout while closed regardless of link state. > However, socket was forbidden from joining a fanout while it was not > RUNNING. > > This patch allows PACKET socket to join fanout while not RUNN