Commit Graph

290818 Commits

Author SHA1 Message Date
rillig 388dc5879b indent: add reminder to make the code understandable for humans 2021-10-20 05:41:57 +00:00
rillig 5fb4571551 indent: rename ps.last_u_d to match its comment
No functional change.
2021-10-20 05:37:21 +00:00
rillig 68e14313bc indent: rename parser stack variables
No functional change.
2021-10-20 05:26:46 +00:00
rillig 4719ae5c0b indent: rename blankline_requested variables
The words 'prefix' and 'postfix' sounded too much like horizontal
concepts, like in operators. The actual purpose of these variables is to
add blank lines before and after the current line, so use the same
wording as in the command line options.

No functional change.
2021-10-20 05:14:21 +00:00
rillig 4c28bd5551 indent: invert condition in process_newline
It's hard to follow a condition that combines many negated terms with
'||'. Group the conditions by their origin.

The condition '!opt.break_after_comma && break_comma' still sounds like
a contradition, more investigations to follow.

No functional change.
2021-10-20 05:07:08 +00:00
rillig a1a0df58f8 indent: rename next_blank_lines to blank_lines_to_output
The previous name was already an improvement over the name before that
(n_real_blanklines), but didn't express the intended purpose clearly
enough, so try another name.

No functional change.
2021-10-20 05:00:37 +00:00
thorpej 56265c7c8b Oops, forgot to note the history of NOTE_OPEN, NOTE_CLOSE, NOTE_CLOSE_WRITE,
and NOTE_READ.
2021-10-20 03:26:20 +00:00
thorpej 051986d92d Regen for:
Overhaul of the EVFILT_VNODE kevent(2) filter:

- Centralize vnode kevent handling in the VOP_*() wrappers, rather than
  forcing each individual file system to deal with it (except VOP_RENAME(),
  because VOP_RENAME() is a mess and we currently have 2 different ways
  of handling it; at least it's reasonably well-centralized in the "new"
  way).
- Add support for NOTE_OPEN, NOTE_CLOSE, NOTE_CLOSE_WRITE, and NOTE_READ,
  compatible with the same events in FreeBSD.
- Track which kevent notifications clients are interested in receiving
  to avoid doing work for events no one cares about (avoiding, e.g.
  taking locks and traversing the klist to send a NOTE_WRITE when
  someone is merely watching for a file to be deleted, for example).

In support of the above:

- Add support in vnode_if.sh for specifying PRE- and POST-op handlers,
  to be invoked before and after vop_pre() and vop_post(), respectively.
  Basic idea from FreeBSD, but implemented differently.
- Add support in vnode_if.sh for specifying CONTEXT fields in the
  vop_*_args structures.  These context fields are used to convey information
  between the file system VOP function and the VOP wrapper, but do not
  occupy an argument slot in the VOP_*() call itself.  These context fields
  are initialized and subsequently interpreted by PRE- and POST-op handlers.
- Version VOP_REMOVE(), uses the a context field for the file system to report
  back the resulting link count of the target vnode.  Return this in tmpfs,
  udf, nfs, chfs, ext2fs, lfs, and ufs.

NetBSD 9.99.92.
2021-10-20 03:13:14 +00:00
thorpej 982ae832c3 Overhaul of the EVFILT_VNODE kevent(2) filter:
- Centralize vnode kevent handling in the VOP_*() wrappers, rather than
  forcing each individual file system to deal with it (except VOP_RENAME(),
  because VOP_RENAME() is a mess and we currently have 2 different ways
  of handling it; at least it's reasonably well-centralized in the "new"
  way).
- Add support for NOTE_OPEN, NOTE_CLOSE, NOTE_CLOSE_WRITE, and NOTE_READ,
  compatible with the same events in FreeBSD.
- Track which kevent notifications clients are interested in receiving
  to avoid doing work for events no one cares about (avoiding, e.g.
  taking locks and traversing the klist to send a NOTE_WRITE when
  someone is merely watching for a file to be deleted, for example).

In support of the above:

- Add support in vnode_if.sh for specifying PRE- and POST-op handlers,
  to be invoked before and after vop_pre() and vop_post(), respectively.
  Basic idea from FreeBSD, but implemented differently.
- Add support in vnode_if.sh for specifying CONTEXT fields in the
  vop_*_args structures.  These context fields are used to convey information
  between the file system VOP function and the VOP wrapper, but do not
  occupy an argument slot in the VOP_*() call itself.  These context fields
  are initialized and subsequently interpreted by PRE- and POST-op handlers.
- Version VOP_REMOVE(), uses the a context field for the file system to report
  back the resulting link count of the target vnode.  Return this in tmpfs,
  udf, nfs, chfs, ext2fs, lfs, and ufs.

NetBSD 9.99.92.
2021-10-20 03:08:16 +00:00
knakahara defcf4e52b Uniform INTx/MSI handler's Tx/Rx behavior to MSI-X's one.
Because the difference has caused INTx/MSI own bugs.
2021-10-20 02:12:36 +00:00
knakahara 9affeb2e7f Fix Tx stall, reported and implemented original patch by chs@n.o, thanks.
Check if_snd queue because if.c::if_transmit() doesn't call ifp->if_start()
when IFQ_ENQUEUE failed.

Reviewed and tested by chs@n.o and msaitoh@n.o.
2021-10-20 02:05:15 +00:00
jmcneill 33f66e53aa - microtime -> microuptime
- avoid kpause with timeo=0
2021-10-20 01:09:49 +00:00
rillig 54f8de4287 indent: always keep next_blank_lines >= 0
No functional change.
2021-10-19 21:39:19 +00:00
blymn 5b90c1a33c Fix for PR lib/47397
Fix a misinterpretation of the role of field fore and back.  Now field
pad is rendered in the back attribute always instead of only being used
for the non-current field.
2021-10-19 21:22:20 +00:00
rillig 022f9c1147 indent: use simpler code for copying the input buffer
In debug mode, this reduces the amount of debug output lines.

No functional change in default mode.
2021-10-19 21:21:07 +00:00
rillig 0c2a630071 tests/indent: move tests for indent comments
The special INDENT ON and INDENT OFF comments look like ordinary
comments but are handled in inbuf_read_line. Implementing this feature
in the input function has several unintended side effects regarding
indentation of these comments, as demonstrated by the tests.
2021-10-19 20:41:42 +00:00
rillig a08a922a72 tests/indent: add test for INDENT OFF/ON comments
Just to prevent unintended side effects when fixing bugs in this area.
2021-10-19 20:20:24 +00:00
roy ca7d1a57f1 netinet: Allow binding the unspecified address when no addresses exist
You should always be able to bind to the unspecified address even if
no addresses have been configured on any interface.

For example, a DHCP client could be started before the loopback interface
has been fully configured.
2021-10-19 20:01:09 +00:00
rillig b4159c4803 tests/indent: make add-test generate flexible tests
They need fewer source files and are more versatile.
2021-10-19 19:59:05 +00:00
rillig e3e725ae28 indent: if a file ends with indent off, don't add space-newline 2021-10-19 18:29:59 +00:00
rillig 31aea5263f tests/indent: remove main code from test for token_comment
I had indented to use that code for completing the list of missing tests
but somehow forgot to remove it.
2021-10-19 18:18:23 +00:00
sjg c7d4dee19b Replace ${.OBJDIR} with <curdir> for consistent results.
If we replace ${.OBJDIR} with <objdir> some tests produce
different results depending on the value of .OBJDIR

For similar reasons eliminate .OBJDIR and .PATH from output of
varname-empty

Reviewed by: rillig
2021-10-19 15:59:26 +00:00
yamaguchi 3e05162506 lagg: reject a vlan interface that is not configured
The vlan I/F has no MAC address used in LACP.
2021-10-19 08:02:42 +00:00
yamaguchi 9e7e46397b added test cases for lagg(4) on l2tp(4) 2021-10-19 07:57:15 +00:00
yamaguchi a5c0a90f03 lagg: support l2tp(4) aggregation
- Accept "ifconfig lagg* laggport l2tp*"
- Set promiscuous mode when the added interface is l2tp*
- check IFF_UP in addition to IFF_RUNNING on
  SIOCSIFFLAGS to a child interface.
2021-10-19 07:52:33 +00:00
yamaguchi 396733a098 lagg: clear I/G bitg and set G/L bit in a generated MAC address 2021-10-19 07:40:52 +00:00
blymn 63621d5a6b Add a bit more debug. 2021-10-19 06:41:03 +00:00
blymn 669adb1459 Fix for PR pkg/55931
Don't move the cursor when getch is called if input is not going to
be echoed.  Lynx uses the cursor to mark the current selection in a
pop-up, previously the cursor was being relocated when getch was called
which broke the Lynx item marking.
2021-10-19 06:37:29 +00:00
rin 49b0c0364d Revert previous:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/mips/mips/vm_machdep.c#rev1.163

> cpu_uarea_alloc: For ILP32, do not try to allocate physical memory above
> pmap_limits.avail_end.
>
> Fix NULL dereference in uvm_pglistalloc_contig_aggressive().

"high" argument larger than pmap_limits.avail_end is just legal for
uvm_pglistalloc(); uvm_pglistalloc_contig_aggressive() and friends
allocate memory between uvm_physseg_get_avail_start() and
uvm_physseg_get_avail_end().

It turned out that the NULL dereference took place as PHYS_TO_VM_PAGE()
aka uvm_phys_to_vm_page() returns NULL for a valid pa. I've not figured
out why...

Thanks chs@ for correcting my misunderstanding.
2021-10-19 03:47:33 +00:00
rillig ed7ca38191 tests/indent: remove redundant tests for '-ncs' and '-pcs'
These tests are already covered by opt_cs.c and opt_pcs.c.
2021-10-18 23:01:10 +00:00
rillig d543264ca7 tests/indent: condense test for indentation level, add missing files 2021-10-18 22:46:33 +00:00
rillig 2f0d7369b1 tests/indent: condense the token tests
This reduces the number of files in the test directory. It also allows
the tests to be read from top to bottom, looking at only a single file.

Since t_options.awk complains about files that don't have any test case
at all, add some test for each token kind. Most of the tests had
previously been effectively empty.
2021-10-18 22:30:34 +00:00
rillig f014d0e7c6 tests/indent: extend tests for labels, extract test driver
Having the test driver in a separate file allows to run it on its own,
as 'awk -f t_options.awk label.c'. When the test driver warns, exit 1;
this is only needed for the standalone version, when run from inside ATF
the warnings on stderr already suffice to make the test fail in the end.
2021-10-18 20:18:00 +00:00
rillig a7fa8202c8 tests/indent: consolidate tests for comments
These tests have been the motivation for t_options.sh, which allows to
run indent with various command line options on the same input, without
having to create 3 files per test case.

A test file actually contains several tests, all separated by '#indent'
directives. Isolating each of these tests is simpler than having to pick
up the corresponding sections from 3 separate files. Running indent on
each small test case isolates the test cases from each other, preventing
them to influence later test cases. Exactly this had happened when
support for C99 comments was added in March 2021, which later turned
out to be done wrong.
2021-10-18 19:36:29 +00:00
rillig 19176aa25f tests/indent: merge tests for numbers into token_ident
The previous tests 'binary' and 'float' not only test binary and
floating point numbers, making their names too specific. Move them into
a new test token_ident that covers all "identifier-like" tokens, just as
in the code.

The test cases for the option '-cs' are already covered more
systematically in opt_cs.c, so remove that test.
2021-10-18 18:10:19 +00:00
christos f229892ff8 Explicitly cast the long->float conversion since it is value-changing and
produces clang warnings.
2021-10-18 14:16:49 +00:00
christos ef513097b6 Fix llvm build: error: equality comparison with extraneous parentheses
[-Werror,-Wparentheses-equality]
2021-10-18 14:14:07 +00:00
simonb 9edf7099a4 Whitespace nits. 2021-10-18 11:40:56 +00:00
jmcneill 911a0d1bfd Only print an error about missing I/O BARs for chips that need it. 2021-10-18 11:36:11 +00:00
uki 8d12f8ce38 Replace @dirrm to @pkgdir in packing list of syspkg 2021-10-18 10:47:44 +00:00
hannken 7e1e2ee903 Use a local static variable to hold "pktq_rps_hash_default"
like the other devices do.

Kernel ALL/amd64 compiles again.

OK: Kengo NAKAHARA <knakahara@netbsd.org>
2021-10-18 08:15:00 +00:00
rillig 2794646a84 tests/indent: merge duplicate input/output and output/output
No functional change.
2021-10-18 07:11:31 +00:00
ryo 3e14ca5b84 When booted with "boot netbsd -1" (disable multiprocessor boot),
"ddb>continue" didn't work when ddb was started by breakpoint trap.
2021-10-17 22:44:34 +00:00
jmcneill be917db8d8 plcom: speed up close with HUPCL set
Instead of incurring a 1s penalty on close of a plcom device with HUPCL set,
defer the sleep until the next open, and only sleep if necessary.
2021-10-17 22:34:17 +00:00
andvar cc8386344a regen 2021-10-17 20:40:20 +00:00
andvar 85aa460fcb s/Techonology/Technology/ 2021-10-17 20:40:03 +00:00
andvar 0a828985a3 regen 2021-10-17 20:33:27 +00:00
andvar 9a713fea03 s/Versin/Version/ 2021-10-17 20:33:05 +00:00
rillig c315557ec3 make: fix order of parameters in function comments
No functional change.
2021-10-17 18:40:14 +00:00
rillig 11e259efbb indent: parse int command line options strictly
On i386 and other platforms where LONG_MAX == INT_MAX, the test
t_errors/option_tabsize_very_large failed since the behavior on integer
overflow differs between ILP32 and LP64 platforms. Noticed by gson@.

Avoid this unintended difference by adding reasonable limits for each of
the integer options and by replacing atoi with strtol.
2021-10-17 18:13:00 +00:00