Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
The only slightly tricky merge conflict was the netdevsim because the mutex locking fix overlapped a lot of driver reload reorganization. The rest were (relatively) trivial in nature. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -22,6 +22,7 @@ import os
|
||||
import pprint
|
||||
import random
|
||||
import re
|
||||
import stat
|
||||
import string
|
||||
import struct
|
||||
import subprocess
|
||||
@@ -311,7 +312,11 @@ class DebugfsDir:
|
||||
for f in out.split():
|
||||
if f == "ports":
|
||||
continue
|
||||
|
||||
p = os.path.join(path, f)
|
||||
if not os.stat(p).st_mode & stat.S_IRUSR:
|
||||
continue
|
||||
|
||||
if os.path.isfile(p) and os.access(p, os.R_OK):
|
||||
_, out = cmd('cat %s/%s' % (path, f))
|
||||
dfs[f] = out.strip()
|
||||
|
||||
@@ -59,7 +59,7 @@ ip netns exec ${NS_SRC} tc filter add dev veth_src egress \
|
||||
|
||||
# start the listener
|
||||
ip netns exec ${NS_DST} bash -c \
|
||||
"nc -4 -l -s ${IP_DST} -p 9000 >/dev/null &"
|
||||
"nc -4 -l -p 9000 >/dev/null &"
|
||||
declare -i NC_PID=$!
|
||||
sleep 1
|
||||
|
||||
|
||||
2
tools/testing/selftests/kvm/.gitignore
vendored
2
tools/testing/selftests/kvm/.gitignore
vendored
@@ -1,4 +1,5 @@
|
||||
/s390x/sync_regs_test
|
||||
/s390x/memop
|
||||
/x86_64/cr4_cpuid_sync_test
|
||||
/x86_64/evmcs_test
|
||||
/x86_64/hyperv_cpuid
|
||||
@@ -9,6 +10,7 @@
|
||||
/x86_64/state_test
|
||||
/x86_64/sync_regs_test
|
||||
/x86_64/vmx_close_while_nested_test
|
||||
/x86_64/vmx_dirty_log_test
|
||||
/x86_64/vmx_set_nested_state_test
|
||||
/x86_64/vmx_tsc_adjust_test
|
||||
/clear_dirty_log_test
|
||||
|
||||
@@ -580,6 +580,8 @@ bool prepare_for_vmx_operation(struct vmx_pages *vmx);
|
||||
void prepare_vmcs(struct vmx_pages *vmx, void *guest_rip, void *guest_rsp);
|
||||
bool load_vmcs(struct vmx_pages *vmx);
|
||||
|
||||
void nested_vmx_check_supported(void);
|
||||
|
||||
void nested_pg_map(struct vmx_pages *vmx, struct kvm_vm *vm,
|
||||
uint64_t nested_paddr, uint64_t paddr, uint32_t eptp_memslot);
|
||||
void nested_map(struct vmx_pages *vmx, struct kvm_vm *vm,
|
||||
|
||||
@@ -376,6 +376,16 @@ void prepare_vmcs(struct vmx_pages *vmx, void *guest_rip, void *guest_rsp)
|
||||
init_vmcs_guest_state(guest_rip, guest_rsp);
|
||||
}
|
||||
|
||||
void nested_vmx_check_supported(void)
|
||||
{
|
||||
struct kvm_cpuid_entry2 *entry = kvm_get_supported_cpuid_entry(1);
|
||||
|
||||
if (!(entry->ecx & CPUID_VMX)) {
|
||||
fprintf(stderr, "nested VMX not enabled, skipping test\n");
|
||||
exit(KSFT_SKIP);
|
||||
}
|
||||
}
|
||||
|
||||
void nested_pg_map(struct vmx_pages *vmx, struct kvm_vm *vm,
|
||||
uint64_t nested_paddr, uint64_t paddr, uint32_t eptp_memslot)
|
||||
{
|
||||
|
||||
@@ -22,18 +22,19 @@
|
||||
|
||||
#define VCPU_ID 5
|
||||
|
||||
#define UCALL_PIO_PORT ((uint16_t)0x1000)
|
||||
|
||||
/*
|
||||
* ucall is embedded here to protect against compiler reshuffling registers
|
||||
* before calling a function. In this test we only need to get KVM_EXIT_IO
|
||||
* vmexit and preserve RBX, no additional information is needed.
|
||||
*/
|
||||
void guest_code(void)
|
||||
{
|
||||
/*
|
||||
* use a callee-save register, otherwise the compiler
|
||||
* saves it around the call to GUEST_SYNC.
|
||||
*/
|
||||
register u32 stage asm("rbx");
|
||||
for (;;) {
|
||||
GUEST_SYNC(0);
|
||||
stage++;
|
||||
asm volatile ("" : : "r" (stage));
|
||||
}
|
||||
asm volatile("1: in %[port], %%al\n"
|
||||
"add $0x1, %%rbx\n"
|
||||
"jmp 1b"
|
||||
: : [port] "d" (UCALL_PIO_PORT) : "rax", "rbx");
|
||||
}
|
||||
|
||||
static void compare_regs(struct kvm_regs *left, struct kvm_regs *right)
|
||||
|
||||
@@ -53,12 +53,8 @@ static void l1_guest_code(struct vmx_pages *vmx_pages)
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
vm_vaddr_t vmx_pages_gva;
|
||||
struct kvm_cpuid_entry2 *entry = kvm_get_supported_cpuid_entry(1);
|
||||
|
||||
if (!(entry->ecx & CPUID_VMX)) {
|
||||
fprintf(stderr, "nested VMX not enabled, skipping test\n");
|
||||
exit(KSFT_SKIP);
|
||||
}
|
||||
nested_vmx_check_supported();
|
||||
|
||||
vm = vm_create_default(VCPU_ID, 0, (void *) l1_guest_code);
|
||||
vcpu_set_cpuid(vm, VCPU_ID, kvm_get_supported_cpuid());
|
||||
|
||||
@@ -78,6 +78,8 @@ int main(int argc, char *argv[])
|
||||
struct ucall uc;
|
||||
bool done = false;
|
||||
|
||||
nested_vmx_check_supported();
|
||||
|
||||
/* Create VM */
|
||||
vm = vm_create_default(VCPU_ID, 0, l1_guest_code);
|
||||
vcpu_set_cpuid(vm, VCPU_ID, kvm_get_supported_cpuid());
|
||||
|
||||
@@ -224,7 +224,6 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
struct kvm_vm *vm;
|
||||
struct kvm_nested_state state;
|
||||
struct kvm_cpuid_entry2 *entry = kvm_get_supported_cpuid_entry(1);
|
||||
|
||||
have_evmcs = kvm_check_cap(KVM_CAP_HYPERV_ENLIGHTENED_VMCS);
|
||||
|
||||
@@ -237,10 +236,7 @@ int main(int argc, char *argv[])
|
||||
* AMD currently does not implement set_nested_state, so for now we
|
||||
* just early out.
|
||||
*/
|
||||
if (!(entry->ecx & CPUID_VMX)) {
|
||||
fprintf(stderr, "nested VMX not enabled, skipping test\n");
|
||||
exit(KSFT_SKIP);
|
||||
}
|
||||
nested_vmx_check_supported();
|
||||
|
||||
vm = vm_create_default(VCPU_ID, 0, 0);
|
||||
|
||||
@@ -271,12 +267,7 @@ int main(int argc, char *argv[])
|
||||
state.flags = KVM_STATE_NESTED_RUN_PENDING;
|
||||
test_nested_state_expect_einval(vm, &state);
|
||||
|
||||
/*
|
||||
* TODO: When SVM support is added for KVM_SET_NESTED_STATE
|
||||
* add tests here to support it like VMX.
|
||||
*/
|
||||
if (entry->ecx & CPUID_VMX)
|
||||
test_vmx_nested_state(vm);
|
||||
test_vmx_nested_state(vm);
|
||||
|
||||
kvm_vm_free(vm);
|
||||
return 0;
|
||||
|
||||
@@ -128,12 +128,8 @@ static void report(int64_t val)
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
vm_vaddr_t vmx_pages_gva;
|
||||
struct kvm_cpuid_entry2 *entry = kvm_get_supported_cpuid_entry(1);
|
||||
|
||||
if (!(entry->ecx & CPUID_VMX)) {
|
||||
fprintf(stderr, "nested VMX not enabled, skipping test\n");
|
||||
exit(KSFT_SKIP);
|
||||
}
|
||||
nested_vmx_check_supported();
|
||||
|
||||
vm = vm_create_default(VCPU_ID, 0, (void *) l1_guest_code);
|
||||
vcpu_set_cpuid(vm, VCPU_ID, kvm_get_supported_cpuid());
|
||||
|
||||
@@ -1438,6 +1438,27 @@ ipv4_addr_metric_test()
|
||||
fi
|
||||
log_test $rc 0 "Prefix route with metric on link up"
|
||||
|
||||
# explicitly check for metric changes on edge scenarios
|
||||
run_cmd "$IP addr flush dev dummy2"
|
||||
run_cmd "$IP addr add dev dummy2 172.16.104.0/24 metric 259"
|
||||
run_cmd "$IP addr change dev dummy2 172.16.104.0/24 metric 260"
|
||||
rc=$?
|
||||
if [ $rc -eq 0 ]; then
|
||||
check_route "172.16.104.0/24 dev dummy2 proto kernel scope link src 172.16.104.0 metric 260"
|
||||
rc=$?
|
||||
fi
|
||||
log_test $rc 0 "Modify metric of .0/24 address"
|
||||
|
||||
run_cmd "$IP addr flush dev dummy2"
|
||||
run_cmd "$IP addr add dev dummy2 172.16.104.1/32 peer 172.16.104.2 metric 260"
|
||||
run_cmd "$IP addr change dev dummy2 172.16.104.1/32 peer 172.16.104.2 metric 261"
|
||||
rc=$?
|
||||
if [ $rc -eq 0 ]; then
|
||||
check_route "172.16.104.2 dev dummy2 proto kernel scope link src 172.16.104.1 metric 261"
|
||||
rc=$?
|
||||
fi
|
||||
log_test $rc 0 "Modify metric of address with peer route"
|
||||
|
||||
$IP li del dummy1
|
||||
$IP li del dummy2
|
||||
cleanup
|
||||
|
||||
0
tools/testing/selftests/net/l2tp.sh
Normal file → Executable file
0
tools/testing/selftests/net/l2tp.sh
Normal file → Executable file
@@ -129,7 +129,7 @@ static void test(int *rcv_fds, int count, int proto)
|
||||
{
|
||||
struct epoll_event ev;
|
||||
int epfd, i, test_fd;
|
||||
uint16_t test_family;
|
||||
int test_family;
|
||||
socklen_t len;
|
||||
|
||||
epfd = epoll_create(1);
|
||||
@@ -146,6 +146,7 @@ static void test(int *rcv_fds, int count, int proto)
|
||||
send_from_v4(proto);
|
||||
|
||||
test_fd = receive_once(epfd, proto);
|
||||
len = sizeof(test_family);
|
||||
if (getsockopt(test_fd, SOL_SOCKET, SO_DOMAIN, &test_family, &len))
|
||||
error(1, errno, "failed to read socket domain");
|
||||
if (test_family != AF_INET)
|
||||
|
||||
Reference in New Issue
Block a user