re: CVS commit: src/sys/compat/linux/common

2018-01-08 Thread Christos Zoulas
On Jan 9, 12:33pm, m...@eterna.com.au (matthew green) wrote:
-- Subject: re: CVS commit: src/sys/compat/linux/common

| Christos Zoulas writes:
| > On Jan 9, 12:44am, m...@netbsd.org (m...@netbsd.org) wrote:
| > -- Subject: Re: CVS commit: src/sys/compat/linux/common
| > 
| > | Why not add a signal?
| > 
| > It is complicated to do so. It will even change the sigmask size.
| 
| it will?  don't we have support for upto 128 signals there?
| 
| 1.2  (thorpej  18-Jan-03): typedef struct {
| 1.2  (thorpej  18-Jan-03):  __uint32_t  __bits[4];
| 1.2  (thorpej  18-Jan-03): } sigset_t;
| 
| there might be some issues, but i was fairly sure when we went
| beyond the old 32 signals we made it upto 128.
| 
| we should be able to make it work in the kernel, at least.

You need to look at the compat code for linux... Ours is fine I think.
We use the NSIG linux macro to compute the words. Yes, it can be done,
but it requires more changes.

christos


re: CVS commit: src/sys/compat/linux/common

2018-01-08 Thread matthew green
Christos Zoulas writes:
> On Jan 9, 12:44am, m...@netbsd.org (m...@netbsd.org) wrote:
> -- Subject: Re: CVS commit: src/sys/compat/linux/common
> 
> | Why not add a signal?
> 
> It is complicated to do so. It will even change the sigmask size.

it will?  don't we have support for upto 128 signals there?

1.2  (thorpej  18-Jan-03): typedef struct {
1.2  (thorpej  18-Jan-03):  __uint32_t  __bits[4];
1.2  (thorpej  18-Jan-03): } sigset_t;

there might be some issues, but i was fairly sure when we went
beyond the old 32 signals we made it upto 128.

we should be able to make it work in the kernel, at least.


.mrg.


Re: CVS commit: src/sys/net

2018-01-08 Thread maya
On Tue, Jan 09, 2018 at 01:07:50AM +, m...@netbsd.org wrote:
> This is causing PR kern/52914 (on netbsd-8, not current)

Copied wrong number
kern/52895

it's in -current but also -8


Re: CVS commit: src/sys/net

2018-01-08 Thread maya
This is causing PR kern/52914 (on netbsd-8, not current)

On Fri, Dec 15, 2017 at 04:04:59AM +, Ryota Ozaki wrote:
> Module Name:  src
> Committed By: ozaki-r
> Date: Fri Dec 15 04:04:59 UTC 2017
> 
> Modified Files:
>   src/sys/net: if.c
> 
> Log Message:
> Remove IFNET_GLOBAL_LOCK where it's unnecessary because IFNET_LOCK is held
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.415 -r1.416 src/sys/net/if.c
> 
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
> 

> Modified files:
> 
> Index: src/sys/net/if.c
> diff -u src/sys/net/if.c:1.415 src/sys/net/if.c:1.416
> --- src/sys/net/if.c:1.415Fri Dec 15 04:03:46 2017
> +++ src/sys/net/if.c  Fri Dec 15 04:04:58 2017
> @@ -1,4 +1,4 @@
> -/*   $NetBSD: if.c,v 1.415 2017/12/15 04:03:46 ozaki-r Exp $ */
> +/*   $NetBSD: if.c,v 1.416 2017/12/15 04:04:58 ozaki-r Exp $ */
>  
>  /*-
>   * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
> @@ -90,7 +90,7 @@
>   */
>  
>  #include 
> -__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.415 2017/12/15 04:03:46 ozaki-r Exp $");
> +__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.416 2017/12/15 04:04:58 ozaki-r Exp $");
>  
>  #if defined(_KERNEL_OPT)
>  #include "opt_inet.h"
> @@ -1792,11 +1792,18 @@ ifa_insert(struct ifnet *ifp, struct ifa
>  
>   ifa->ifa_ifp = ifp;
>  
> - IFNET_GLOBAL_LOCK();
> + /*
> +  * Check !IFF_RUNNING for initialization routines that normally don't
> +  * take IFNET_LOCK but it's safe because there is no competitor.
> +  * XXX there are false positive cases because IFF_RUNNING can be off on
> +  * if_stop.
> +  */
> + KASSERT(!ISSET(ifp->if_flags, IFF_RUNNING) ||
> + IFNET_LOCKED(ifp));
> +
>   TAILQ_INSERT_TAIL(&ifp->if_addrlist, ifa, ifa_list);
>   IFADDR_ENTRY_INIT(ifa);
>   IFADDR_WRITER_INSERT_TAIL(ifp, ifa);
> - IFNET_GLOBAL_UNLOCK();
>  
>   ifaref(ifa);
>  }
> @@ -1806,14 +1813,19 @@ ifa_remove(struct ifnet *ifp, struct ifa
>  {
>  
>   KASSERT(ifa->ifa_ifp == ifp);
> + /*
> +  * if_is_deactivated indicates ifa_remove is called form if_detach
> +  * where is safe even if IFNET_LOCK isn't held.
> +  */
> + KASSERT(if_is_deactivated(ifp) || IFNET_LOCKED(ifp));
>  
> - IFNET_GLOBAL_LOCK();
>   TAILQ_REMOVE(&ifp->if_addrlist, ifa, ifa_list);
>   IFADDR_WRITER_REMOVE(ifa);
>  #ifdef NET_MPSAFE
> + IFNET_GLOBAL_LOCK();
>   pserialize_perform(ifnet_psz);
> -#endif
>   IFNET_GLOBAL_UNLOCK();
> +#endif
>  
>  #ifdef NET_MPSAFE
>   psref_target_destroy(&ifa->ifa_psref, ifa_psref_class);
> 



Re: CVS commit: src/sys/compat/linux/common

2018-01-08 Thread Christos Zoulas
On Jan 9, 12:44am, m...@netbsd.org (m...@netbsd.org) wrote:
-- Subject: Re: CVS commit: src/sys/compat/linux/common

| Why not add a signal?

It is complicated to do so. It will even change the sigmask size.

christos


Re: CVS commit: src/sys/compat/linux/common

2018-01-08 Thread maya
> + /*
> +  * XXX: Linux has 33 realtime signals, the go binary wants to
> +  * reset all of them; nothing else uses the last RT signal, so for
> +  * now ignore it.
> +  */
> + if (sig == LINUX__NSIG) {
> + uprintf("%s: setting signal %d ignored\n", __func__, sig);
> + sig--;  /* back to 63 which is ignored */
> + }

Why not add a signal?


Re: CVS commit: src/sys

2018-01-08 Thread Kengo NAKAHARA
Hi,

On 2018/01/09 8:27, Christos Zoulas wrote:
> In article <20180108232325.522d0f...@cvs.netbsd.org>,
> Kengo NAKAHARA  wrote:
>>  size_t hash;
>>
>> +printf(" %s: enter\n", __func__);
>> +
>>  ip6 = mtod(m, const struct ip6_hdr *);
>>
>>  KERNEL_LOCK_UNLESS_NET_MPSAFE();
>> @@ -571,8 +573,12 @@ ip6flow_create(struct route *ro, struct 
>>   *
>>   * Don't create a flow for ICMPv6 messages.
>>   */
>> -if (ip6_maxflows == 0 || ip6->ip6_nxt == IPPROTO_IPV6_ICMP)
>> +if (ip6_maxflows == 0 || ip6->ip6_nxt == IPPROTO_IPV6_ICMP) {
>> +printf(" %s: icmp skip\n", __func__);
>>  goto out;
>> +}
>> +
>> +printf(" %s: ip6->ip6_nxt=%d\n", __func__, ip6->ip6_nxt);
>>
>>  /*
>>   * See if an existing flow exists.  If so:
>>
> 
> These look like an accident.

Yes. Sorry, I revert the wrong modifications and re-commit the fix.


Thanks,

-- 
//
Internet Initiative Japan Inc.

Device Engineering Section,
IoT Platform Development Department,
Network Division,
Technology Unit

Kengo NAKAHARA 


Re: CVS commit: src/sys

2018-01-08 Thread Christos Zoulas
In article <20180108232325.522d0f...@cvs.netbsd.org>,
Kengo NAKAHARA  wrote:
>   size_t hash;
> 
>+  printf(" %s: enter\n", __func__);
>+
>   ip6 = mtod(m, const struct ip6_hdr *);
> 
>   KERNEL_LOCK_UNLESS_NET_MPSAFE();
>@@ -571,8 +573,12 @@ ip6flow_create(struct route *ro, struct 
>*
>* Don't create a flow for ICMPv6 messages.
>*/
>-  if (ip6_maxflows == 0 || ip6->ip6_nxt == IPPROTO_IPV6_ICMP)
>+  if (ip6_maxflows == 0 || ip6->ip6_nxt == IPPROTO_IPV6_ICMP) {
>+  printf(" %s: icmp skip\n", __func__);
>   goto out;
>+  }
>+
>+  printf(" %s: ip6->ip6_nxt=%d\n", __func__, ip6->ip6_nxt);
> 
>   /*
>* See if an existing flow exists.  If so:
>

These look like an accident.

christos