Commit Graph

2307 Commits

Author SHA1 Message Date
Bhasker Hariharan 6b43cf791a Replace calculateChecksum w/ the unrolled version.
Fixes #1656

PiperOrigin-RevId: 291703760
2020-01-27 05:34:34 -08:00
Bhasker Hariharan 68514d4ba3 Unroll checksum computation loop.
Checksum computation is one of the most expensive bits of
packet processing. Manual unrolling of the loop provides
significant improvement in checksum speed.

Updates #1656

BenchmarkChecksum/checksum_64-12                49834124                23.6 ns/op
BenchmarkChecksum/checksum_128-12               27111997                44.1 ns/op
BenchmarkChecksum/checksum_256-12               11416683                91.5 ns/op
BenchmarkChecksum/checksum_512-12                6375298               174 ns/op
BenchmarkChecksum/checksum_1024-12               3403852               338 ns/op
BenchmarkChecksum/checksum_1500-12               2343576               493 ns/op
BenchmarkChecksum/checksum_2048-12               1730521               656 ns/op
BenchmarkChecksum/checksum_4096-12                920469              1327 ns/op
BenchmarkChecksum/checksum_8192-12                445885              2637 ns/op
BenchmarkChecksum/checksum_16384-12               226342              5268 ns/op
BenchmarkChecksum/checksum_32767-12               114210             10503 ns/op
BenchmarkChecksum/checksum_32768-12                99138             10610 ns/op
BenchmarkChecksum/checksum_65535-12                53438             21158 ns/op
BenchmarkChecksum/checksum_65536-12                52993             21067 ns/op
BenchmarkUnrolledChecksum/checksum_64-12        61035639                19.1 ns/op
BenchmarkUnrolledChecksum/checksum_128-12               36067015                33.6 ns/op
BenchmarkUnrolledChecksum/checksum_256-12               19731220                60.4 ns/op
BenchmarkUnrolledChecksum/checksum_512-12                9091291               116 ns/op
BenchmarkUnrolledChecksum/checksum_1024-12               4976406               226 ns/op
BenchmarkUnrolledChecksum/checksum_1500-12               3685224               328 ns/op
BenchmarkUnrolledChecksum/checksum_2048-12               2579108               447 ns/op
BenchmarkUnrolledChecksum/checksum_4096-12               1350475               887 ns/op
BenchmarkUnrolledChecksum/checksum_8192-12                658248              1780 ns/op
BenchmarkUnrolledChecksum/checksum_16384-12               335869              3534 ns/op
BenchmarkUnrolledChecksum/checksum_32767-12               168650              7095 ns/op
BenchmarkUnrolledChecksum/checksum_32768-12               168075              7098 ns/op
BenchmarkUnrolledChecksum/checksum_65535-12                75085             14277 ns/op
BenchmarkUnrolledChecksum/checksum_65536-12                75921             14127 ns/op

PiperOrigin-RevId: 291643290
2020-01-26 18:35:01 -08:00
Jamie Liu 18a7e1309d Add support for device special files to VFS2 tmpfs.
PiperOrigin-RevId: 291471892
2020-01-24 17:07:54 -08:00
Ghanan Gowripalan 878bda6e19 Lock the NIC when checking if an address is tentative
PiperOrigin-RevId: 291426657
2020-01-24 13:10:08 -08:00
Jamie Liu d135b5abf6 Add anonymous device number allocation to VFS2.
Note that in VFS2, filesystem device numbers are per-vfs.FilesystemImpl rather
than global, avoiding the need for a "registry" type to handle save/restore.
(This is more consistent with Linux anyway: compare e.g.
mm/shmem.c:shmem_mount() => fs/super.c:mount_nodev() => (indirectly)
set_anon_super().)

PiperOrigin-RevId: 291425193
2020-01-24 12:54:39 -08:00
Ghanan Gowripalan fb80979e3f Increase timeouts for NDP tests' async events
Increase the timeout to 1s when waiting for async NDP events to help
reduce flakiness. This will not significantly increase test times as the
async events continue to receive an event on a channel. The increased
timeout allows more time for an event to be sent on the channel as the
previous timeout of 100ms caused some flakes.

Test: Existing tests pass
PiperOrigin-RevId: 291420936
2020-01-24 12:30:23 -08:00
Michael Pratt 390bb9c241 Ignore external SIGURG
Go 1.14+ sends SIGURG to Ms to attempt asynchronous preemption of a G. Since it
can't guarantee that a SIGURG is only related to preemption, it continues to
forward them to signal.Notify (see runtime.sighandler).

We should ignore these signals, as applications shouldn't receive them. Note
that this means that truly external SIGURG can no longer be sent to the
application (as with SIGCHLD).

PiperOrigin-RevId: 291415357
2020-01-24 12:01:04 -08:00
Brad Burlage 24cfbf4b98 Fix corpus_name to match our ingestion config[1].
PiperOrigin-RevId: 291412676
2020-01-24 11:45:44 -08:00
Nicolas Lacasse 3db317390b Remove epoll entry from map when dropping it.
This pattern (delete from map when dropping) is also used in epoll.RemoveEntry,
and seems like generally a good idea.

PiperOrigin-RevId: 291268208
2020-01-23 16:19:10 -08:00
gVisor bot 3d10edc942 Merge pull request #1617 from kevinGC:iptables-write-filter-proto
PiperOrigin-RevId: 291249314
2020-01-23 14:48:39 -08:00
Brad Burlage 14d2ed1ad7 Fix kythe build.
* Pass --auth_credentials now that we're using RBE
* Fix kzips not being uploaded to the root of the GCS bucket

PiperOrigin-RevId: 291241757
2020-01-23 14:14:24 -08:00
Michael Pratt 7a79715504 Check for EINTR from KVM_CREATE_VM
The kernel may return EINTR from:

kvm_create_vm
  kvm_init_mmu_notifier
    mmu_notifier_register
      do_mmu_notifier_register
        mm_take_all_locks

Go 1.14's preemptive scheduling signals make hitting this much more likely.

PiperOrigin-RevId: 291212669
2020-01-23 11:49:02 -08:00
Brad Burlage 98e83c444f Try running kythe build on RBE.
Also add our RBE project/instance to the --config=remote defaults.

PiperOrigin-RevId: 291201426
2020-01-23 11:01:38 -08:00
Adin Scannell 04e3d56db1 Fix master build case.
Otherwise, this will be built when building a specific
release tag (typically in the past), causing the master
binary to be overwritten with something older.

We can generally assume that tags will be applied after
the commit has been integrated, and therefore that any
builds pointing to tags will use only the tags.

Another way to fix this would be to introduce something
akin to the KOKORO_BUILD_NIGHTLY environment variable,
but it doesn't seem strictly necessary.

PiperOrigin-RevId: 291198171
2020-01-23 10:45:48 -08:00
Rahat Mahmood 896bd654b6 De-duplicate common test functionality for VFS2 filesystems.
PiperOrigin-RevId: 291041576
2020-01-22 15:16:21 -08:00
Ghanan Gowripalan 1d97adaa6d Use embedded mutex pattern for stack.NIC
- Wrap NIC's fields that should only be accessed while holding the mutex in
  an anonymous struct with the embedded mutex.
- Make sure NIC's spoofing and promiscuous mode flags are only read while
  holding the NIC's mutex.
- Use the correct endpoint when sending DAD messages.
- Do not hold the NIC's lock when sending DAD messages.

This change does not introduce any behaviour changes.

Tests: Existing tests continue to pass.
PiperOrigin-RevId: 291036251
2020-01-22 14:51:53 -08:00
gVisor bot 8a5bfd7001 Merge pull request #1629 from xiaobo55x:fault_test
PiperOrigin-RevId: 291022423
2020-01-22 13:51:13 -08:00
gVisor bot 0e7f417293 Merge pull request #1631 from majek:fix-gonet-udp.RemoteAddr
PiperOrigin-RevId: 291019296
2020-01-22 13:35:07 -08:00
Jamie Liu 5ab1213a6c Move VFS2 handling of FD readability/writability to vfs.FileDescription.
PiperOrigin-RevId: 291006713
2020-01-22 12:29:36 -08:00
Nicolas Lacasse 159992300d Toolchain version bumps.
- bazel_toolchain to 2.0.2
- rules_go to 0.21.0
- Go toolchain to 1.13.6
- Use new proto lib archive.

PiperOrigin-RevId: 290999410
2020-01-22 11:52:38 -08:00
Adin Scannell cb3906ae00 Add tools for generating images.
This formalizes the adhoc scripts previously in kokoro. The image targets can
be used by e.g. benchmarks in order to automated image prepation.

PiperOrigin-RevId: 290982744
2020-01-22 10:39:45 -08:00
Kevin Krakauer 747137c120 Address GitHub comments. 2020-01-22 10:23:44 -08:00
Marek Majkowski 38fe05eb69 gonet PacketConn.RemoteAddr() incorrectly returns *net.TCPAddr, should be *net.UDPAddr
PacketConn.LocalAddr() already returns *net.UDPAddr correctly.
2020-01-22 11:34:29 +00:00
Haibo Xu d59a3cc959 Enable fault() syscall test on arm64.
Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: I9b2b2e0d84946c10cf136abeef6c60642fa3b6ec
2020-01-22 06:57:19 +00:00
Ian Gudger 6a59e7f510 Rename DowngradableRWMutex to RWmutex.
Also renames TMutex to Mutex.

These custom mutexes aren't any worse than the standard library versions (same
code), so having both seems redundant.

PiperOrigin-RevId: 290873587
2020-01-21 19:36:12 -08:00
Ian Gudger d0e75f2bef Add trylock support to DowngradableRWMutex.
Updates #231

PiperOrigin-RevId: 290868875
2020-01-21 19:11:18 -08:00
Ian Gudger 1effdc091b TMutex based on sync.Mutex.
Updates #231

PiperOrigin-RevId: 290854399
2020-01-21 18:49:28 -08:00
Nicolas Lacasse a944fcd946 Install Bazel 2.0.0 on kokoro images.
PiperOrigin-RevId: 290850738
2020-01-21 18:23:59 -08:00
gVisor bot f6225b111b Merge pull request #1609 from xiaobo55x:uname
PiperOrigin-RevId: 290849438
2020-01-21 17:59:00 -08:00
Adin Scannell 2296b47344 Change to standard types.
PiperOrigin-RevId: 290846481
2020-01-21 17:28:57 -08:00
gVisor bot 0693fb05d1 Merge pull request #1505 from xiaobo55x:fcntl_flags
PiperOrigin-RevId: 290840484
2020-01-21 17:02:56 -08:00
gVisor bot 45a8edbd5a Merge pull request #1492 from majek:err_typo_in_netstack_tests
PiperOrigin-RevId: 290840370
2020-01-21 16:32:49 -08:00
gVisor bot b3405a719c Merge pull request #1275 from lubinszARM:pr_ring0_5
PiperOrigin-RevId: 290839263
2020-01-21 16:09:25 -08:00
Mithun Iyer 7e6fbc6afe Add a new TCP stat for current open connections.
Such a stat accounts for all connections that are currently
established and not yet transitioned to close state.
Also fix bug in double increment of CurrentEstablished stat.

Fixes #1579

PiperOrigin-RevId: 290827365
2020-01-21 15:43:39 -08:00
Rahat Mahmood ad1968ed56 Implement sysfs.
PiperOrigin-RevId: 290822487
2020-01-21 15:13:26 -08:00
Michael Pratt dc99897205 Add missing verb
PiperOrigin-RevId: 290821997
2020-01-21 14:47:41 -08:00
Ryan Heacock cbc0a92276 Correct todos referencing IPV6_RECVTCLASS
Bug 68320120 was revived because TODOs referenced the IP_RECVTOS bug instead
of the IPV6_RECVTCLASS bug.

PiperOrigin-RevId: 290820178
2020-01-21 14:22:06 -08:00
gVisor bot 16694ad2ba Merge pull request #1274 from lubinszARM:pr_ring0_4
PiperOrigin-RevId: 290811598
2020-01-21 13:56:48 -08:00
Kevin Krakauer 9f736ac6a7 More little fixes. 2020-01-21 13:42:43 -08:00
Kevin Krakauer 47bc7550c0 Fixing stuff 2020-01-21 13:37:25 -08:00
Fabricio Voznika d46c397a1c Add line break to /proc/net files
Some files were missing the last line break.

PiperOrigin-RevId: 290808898
2020-01-21 13:28:24 -08:00
Kevin Krakauer 62357a0afb Merge branch 'master' into iptables-write-filter-proto 2020-01-21 13:16:25 -08:00
Dean Deng 2ba6198851 Add syscalls for lgetxattr, fgetxattr, lsetxattr, and fsetxattr.
Note that these simply will use the same logic as getxattr and setxattr, which
is not yet implemented for most filesystems.

PiperOrigin-RevId: 290800960
2020-01-21 12:43:18 -08:00
gVisor bot 5f82f092e7 Merge pull request #1558 from kevinGC:iptables-write-input-drop
PiperOrigin-RevId: 290793754
2020-01-21 12:08:52 -08:00
gVisor bot 7e155a133b Merge pull request #1546 from lubinszARM:pr_syscall_test_proc
PiperOrigin-RevId: 290789087
2020-01-21 11:42:41 -08:00
Haibo Xu c0e39a8271 Enable uname syscall support on arm64.
Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: I206f38416a64d7c6a8531d8eb305c6ea239616b8
2020-01-20 02:57:25 +00:00
Nicolas Lacasse 10401599e1 Include the cgroup name in the superblock options in /proc/self/mountinfo.
Java 11 parses /proc/self/mountinfo for cgroup information. Java 11.0.4 uses
the mount path to determine what cgroups existed, but Java 11.0.5 reads the
cgroup names from the superblock options.

This CL adds the cgroup name to the superblock options if the filesystem type
is "cgroup". Since gVisor doesn't actually support cgroups yet, we just infer
the cgroup name from the path.

PiperOrigin-RevId: 290434323
2020-01-18 09:34:04 -08:00
Eyal Soha 47d85257d3 Filter out received packets with a local source IP address.
CERT Advisory CA-96.21 III. Solution advises that devices drop packets which
could not have correctly arrived on the wire, such as receiving a packet where
the source IP address is owned by the device that sent it.

Fixes #1507

PiperOrigin-RevId: 290378240
2020-01-17 18:26:20 -08:00
Nicolas Lacasse f1a5178c58 Fix data race in MountNamespace.resolve.
We must hold fs.renameMu to access Dirent.parent.

PiperOrigin-RevId: 290340804
2020-01-17 14:21:27 -08:00
Andrei Vagin 9073521098 Convert EventMask to uint64
It is used for signalfd where the maximum signal is 64.

PiperOrigin-RevId: 290331008
2020-01-17 13:32:51 -08:00