Commit Graph

256781 Commits

Author SHA1 Message Date
maxv
e7ef501d6b Remove some more FreeBSD sysctl declarations that already have NetBSD
counterparts. Discussed with ozaki-r@.
2018-02-16 09:07:50 +00:00
maxv
85384b6c32 Remove ipsec_replay and ipsec_integrity from this place, they are already
declared as sysctls. Discussed with ozaki-r@.
2018-02-16 08:56:50 +00:00
maxv
2ff2bfdeb3 Remove ip4_esp_randpad and ip6_esp_randpad, unused. Discussed with
ozaki-r@.
2018-02-16 08:51:28 +00:00
ryo
368bc5b1f5 * avoid writing past the end of the mbuf.
* m_getptr was introduced for the IPsec Crypto code. it must not be used here.

pointed out by maxv@. thanks.
2018-02-16 08:42:45 +00:00
mrg
08873910d3 minimal basic support for ia64 and gcc6. i am not sure about the
bp part of the GetPcSpBp() port, cherry please look :-)
2018-02-16 07:59:05 +00:00
ozaki-r
4a7e2a5c72 Add missing barriers to curlwp_bind and curlwp_bindx
The barriers prevent the instruction of setting/clearing the LP_BOUND flag
from reordering over where we want to prevent LWP migrations.

Note that the fix doesn't mean that there was a race condition.  For now the API
is used only for psref and the combination use of them doesn't need the
barriers(*).

(*) https://mail-index.netbsd.org/tech-kern/2018/02/15/msg023101.html

Pointed out by Mateusz Guzik
2018-02-16 07:11:50 +00:00
knakahara
5392e2869c Fix build failure, sorry. 2018-02-16 07:05:21 +00:00
ozaki-r
63a81b4f12 Avoid a race condition between an LWP migration and curlwp_bind
curlwp_bind sets the LP_BOUND flag to l_pflags of the current LWP, which
prevents it from migrating to another CPU until curlwp_bindx is called.
Meanwhile, there are several ways that an LWP is migrated to another CPU and in
any cases the scheduler postpones a migration if a target LWP is running.  One
example of LWP migrations is a load balancing; the scheduler periodically
explores CPU-hogging LWPs and schedule them to migrate (see sched_lwp_stats).
At that point the scheduler checks the LP_BOUND flag and if it's set to a LWP,
the scheduler doesn't schedule the LWP.  A scheduled LWP is tried to be migrated
when it is leaving a running CPU, i.e., mi_switch.  And mi_switch does NOT check
the LP_BOUND flag.  So if an LWP is scheduled first and then it sets the
LP_BOUND flag, the LWP can be migrated regardless of the flag.  To avoid this
race condition, we need to check the flag in mi_switch too.

For more details see https://mail-index.netbsd.org/tech-kern/2018/02/13/msg023079.html
2018-02-16 07:04:51 +00:00
knakahara
83c72d690c Apply RSS utility to ixg(4) and ixv(4).
ok by msaitoh@n.o.
2018-02-16 04:50:19 +00:00
knakahara
a5975ab2c5 Apply RSS utility to wm(4).
ok by msaitoh@n.o.
2018-02-16 04:49:27 +00:00
knakahara
4a6a088a32 Introduce very simple Receive Side Scaling (RSS) utility.
ok by msaitoh@n.o.
2018-02-16 04:48:32 +00:00
sevan
18fbadf9f8 regen 2018-02-16 01:54:18 +00:00
sevan
f89e640958 Add Nvidia GeForce 9400M as found in the late 2009 13" MacBook (MacBook6,1) 2018-02-16 01:38:24 +00:00
uwe
6ef25358e3 Explicitly enable PCI_COMMAND_MASTER_ENABLE and PCI_COMMAND_IO_ENABLE.
Recent versions of VirtualBox do not enable bus-mastering by default -
this will be fixed, but it doesn't hurt to do it ourselves too.
2018-02-15 19:05:10 +00:00
christos
a3a22b2ed2 we now has _UC_MACHINE_FP. 2018-02-15 19:02:06 +00:00
kamil
847996952c Introduce _UC_MACHINE_FP() as a macro
_UC_MACHINE_FP() is a helper macro to extract from mcontext a frame pointer.

Don't rely on this interface as a compiler might strip frame pointer or
optimize it making this interface unreliable.


For hppa assume a small frame context, for larger frames FP might be located
in a different register (4 instead of 3).

For ia64 there is no strict frame pointer, and registers might rotate.
Reuse 79 following:

  ./gcc/config/ia64/ia64.h:#define HARD_FRAME_POINTER_REGNUM  LOC_REG (79)

Once ia64 will mature, this should be revisited.

A macro can encapsulate a real function for extracting Frame Pointer on
more complex CPUs / ABIs.


For the remaining CPUs, reuse standard register as defined in appropriate ABI.

The direct users of this macro are LLVM and GCC with Sanitizers.

Proposed on tech-userlevel@.

Sponsored by <The NetBSD Foundation>
2018-02-15 15:53:56 +00:00
maxv
30a9923153 Style and simplify. 2018-02-15 13:51:32 +00:00
maxv
2ebc96e2af Style a bit, and if we don't know the pad-filling policy use
SADB_X_EXT_PZERO by default.

There doesn't seem to be a sanity check in the keysock API to make sure
this place is never reached, and it's better to fill in with zeros than
not filling in at all (and leaking uninitialized mbuf data).
2018-02-15 12:40:12 +00:00
maxv
a0cc537671 Remove broken MROUTING code, rename ipo->ip4, and simplify. 2018-02-15 10:41:51 +00:00
maxv
7c3a8f9a1f Fix the IPIP_STAT_IBYTES stats; we did m_adj(m, iphlen) which substracted
iphlen, so no need to re-substract it again.
2018-02-15 10:28:49 +00:00
maxv
79a778597c dedup again 2018-02-15 10:21:39 +00:00
maxv
f281f715a5 dedup 2018-02-15 10:09:53 +00:00
maxv
d8dc4e58f1 Style and remove dead code. 2018-02-15 10:04:43 +00:00
ozaki-r
80650a2eb3 Fix buffer overflow on sending an IPv6 packet with large options
If an IPv6 packet has large options, a necessary space for evacuation can
exceed the expected size (ah_pool_item_size). Give up using the pool_cache
if it happens.

Pointed out by maxv@
2018-02-15 09:23:47 +00:00
ozaki-r
c096df4c1e Commonalize error paths (NFC) 2018-02-15 09:17:37 +00:00
maxv
16ab6c18b5 style 2018-02-15 08:38:00 +00:00
maxv
1b56fb55d0 Make sure the Authentication Header fits the mbuf chain, otherwise panic. 2018-02-15 07:38:46 +00:00
maxv
63cc563f51 Fix use-after-free, 'ah' may not be valid after m_makewritable and
ah_massage_headers.
2018-02-15 07:16:05 +00:00
ozaki-r
a7134ed919 Fix kernel panic (assertion failure) on receiving an IPv6 packet with large options
If an IPv6 packet has large options, a necessary space for evacuation can
exceed the expected size (ah_pool_item_size). Give up using the pool_cache
if it happens.

Pointed out by maxv@
2018-02-15 04:27:24 +00:00
ozaki-r
e7e35b3318 Don't relook up an SP/SA in opencrpyto callbacks
We don't need to do so because we have a reference to it. And also
relooking-up one there may return an sp/sav that has different
parameters from an original one.
2018-02-15 04:24:32 +00:00
jakllsch
7a57d75cd6 Adjust Allwinner emac(4) drivers to be compatible with root on NFS. 2018-02-14 20:10:17 +00:00
jakllsch
3bb366c249 Adjust comment; sun4i_emac is also used on sun5i. 2018-02-14 19:09:09 +00:00
maya
1b2f7af0ae Remove dead code.
From David Binderman in PR kern/53029
2018-02-14 18:28:43 +00:00
jakllsch
fbdc91920d Revert functional changes in previous, at expense of strict KNF conformance. 2018-02-14 17:43:09 +00:00
christos
edb81c568b join lines where they fit. 2018-02-14 16:45:24 +00:00
maya
4004dcca06 Don't invoke UB.
Heads up by John D. Baker.
2018-02-14 16:07:55 +00:00
maxv
76b4502019 Style, and remove unused prototypes and functions. 2018-02-14 14:28:40 +00:00
maxv
b73ef2611f Remove m_checkalignment(), unused. This eliminates a reference to
m_getptr().
2018-02-14 14:19:53 +00:00
maxv
0c95a1b211 Remove IFF_STATICARP, we don't support this, and the code is useless in its
current form.

ok ozaki-r@
2018-02-14 14:15:53 +00:00
uwe
d934b67dca Cosmetic - consistently use #define<SPACE> 2018-02-14 14:04:48 +00:00
knakahara
03709a814c Fix a bug that RX and TX may stall on heavy load on wm(4) like ixgbe.c:r1.121.
wm_rxeof() and wm_txeof() have loop limit and the function returns true
if a packet still exists.

XXX need pullup-8
2018-02-14 12:56:00 +00:00
ryoon
2c4c2d277a Fix broken dig and host commands
OpenSSL 1.1 does not have GOST support, so restrict GOST support to 1.0.
2018-02-14 12:47:43 +00:00
msaitoh
d382d1364d Fix a bug that RX may stall on heavy load on ixg(4). ixgbe_rxeof() has loop
limit and the function returns true if a packet are still in the RX ring.
ixgbe_handle_que() didn't check the return value. Check the return vaule
and issue a softint.

 This bug is derived from FreeBSD and ixv(4) has no this bug.

XXX pullup-8
2018-02-14 10:38:28 +00:00
wiz
ec5498f5ad Sort some lists. Use EXIT STATUS instead of RETURN VALUES. 2018-02-14 10:13:25 +00:00
ozaki-r
2c1d530904 Dedup common codes in error paths (NFCI) 2018-02-14 09:13:03 +00:00
ozaki-r
b4596d0446 Fix mbuf leaks on error paths
Pointed out by maxv@
2018-02-14 08:59:23 +00:00
maxv
d33dbf4b86 Use .Cm instead of .Li, same as arp.8. 2018-02-14 06:52:41 +00:00
maxv
f574a1384a Re-make ip6_nexthdr global, it will be used in soon-to-be-added code... 2018-02-14 05:29:39 +00:00
maxv
239cec4999 Revert my two last changes in this file. They are apparently causing
problems with racoon, I'll investigate this later.
2018-02-14 05:24:44 +00:00
ozaki-r
4e4255942a Use cpu_softintr_p 2018-02-14 03:56:26 +00:00