From owner-svn-src-all@freebsd.org Sun Jun 12 02:42:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3114AF08D6; Sun, 12 Jun 2016 02:42:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0311246F; Sun, 12 Jun 2016 02:42:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5C2g8WT046899; Sun, 12 Jun 2016 02:42:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5C2g8N2046898; Sun, 12 Jun 2016 02:42:08 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606120242.u5C2g8N2046898@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 12 Jun 2016 02:42:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301835 - stable/10/sys/amd64/amd64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2016 02:42:10 -0000 Author: kib Date: Sun Jun 12 02:42:08 2016 New Revision: 301835 URL: https://svnweb.freebsd.org/changeset/base/301835 Log: MFC r301457: Avoid spurious EINVAL in amd64 pmap_change_attr(). Modified: stable/10/sys/amd64/amd64/pmap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/pmap.c ============================================================================== --- stable/10/sys/amd64/amd64/pmap.c Sat Jun 11 14:46:49 2016 (r301834) +++ stable/10/sys/amd64/amd64/pmap.c Sun Jun 12 02:42:08 2016 (r301835) @@ -6480,7 +6480,7 @@ static int pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode) { vm_offset_t base, offset, tmpva; - vm_paddr_t pa_start, pa_end; + vm_paddr_t pa_start, pa_end, pa_end1; pdp_entry_t *pdpe; pd_entry_t *pde; pt_entry_t *pte; @@ -6660,9 +6660,12 @@ pmap_change_attr_locked(vm_offset_t va, tmpva += PAGE_SIZE; } } - if (error == 0 && pa_start != pa_end) - error = pmap_change_attr_locked(PHYS_TO_DMAP(pa_start), - pa_end - pa_start, mode); + if (error == 0 && pa_start != pa_end && pa_start < dmaplimit) { + pa_end1 = MIN(pa_end, dmaplimit); + if (pa_start != pa_end1) + error = pmap_change_attr_locked(PHYS_TO_DMAP(pa_start), + pa_end1 - pa_start, mode); + } /* * Flush CPU caches if required to make sure any data isn't cached that From owner-svn-src-all@freebsd.org Sun Jun 12 05:57:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D188AF0508; Sun, 12 Jun 2016 05:57:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 531CA2544; Sun, 12 Jun 2016 05:57:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5C5vhFm016948; Sun, 12 Jun 2016 05:57:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5C5vghj016935; Sun, 12 Jun 2016 05:57:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606120557.u5C5vghj016935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 12 Jun 2016 05:57:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301836 - stable/10/contrib/top X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2016 05:57:44 -0000 Author: ngie Date: Sun Jun 12 05:57:42 2016 New Revision: 301836 URL: https://svnweb.freebsd.org/changeset/base/301836 Log: MFC r300395: Silence top(1) compiler warnings The contrib/top code is no longer maintained upstream (last pulled 16 years ago). The K&R-style followed by the code spews -Wimplicit-int and -Wreturn-type warnings, amongst others. This silences 131 warnings with as little modification as possible by adding necessary return types, definitions, headers, and header guards, and missing header includes. The 5 warnings that remain are due to undeclared ncurses references. I didn't include curses.h and term.h because there are several local functions and macros that conflict with those definitions. Added: stable/10/contrib/top/commands.h - copied unchanged from r300395, head/contrib/top/commands.h stable/10/contrib/top/username.h - copied unchanged from r300395, head/contrib/top/username.h Modified: stable/10/contrib/top/commands.c stable/10/contrib/top/display.c stable/10/contrib/top/display.h stable/10/contrib/top/machine.h stable/10/contrib/top/screen.c stable/10/contrib/top/screen.h stable/10/contrib/top/top.c stable/10/contrib/top/top.h stable/10/contrib/top/username.c stable/10/contrib/top/utils.h stable/10/contrib/top/version.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/top/commands.c ============================================================================== --- stable/10/contrib/top/commands.c Sun Jun 12 02:42:08 2016 (r301835) +++ stable/10/contrib/top/commands.c Sun Jun 12 05:57:42 2016 (r301836) @@ -19,16 +19,21 @@ */ #include "os.h" -#include -#include -#include + #include #include +#include +#include +#include +#include + +#include "commands.h" #include "sigdesc.h" /* generated automatically */ #include "top.h" #include "boolean.h" #include "utils.h" +#include "machine.h" extern int errno; @@ -39,12 +44,15 @@ extern int overstrike; int err_compar(); char *err_string(); +static int str_adderr(char *str, int len, int err); +static int str_addarg(char *str, int len, char *arg, int first); /* * show_help() - display the help screen; invoked in response to * either 'h' or '?'. */ +void show_help() { @@ -123,6 +131,7 @@ register char *str; return(*str == '\0' ? NULL : str); } +int scanint(str, intp) char *str; @@ -262,6 +271,7 @@ char *err_string() * the string "str". */ +static int str_adderr(str, len, err) char *str; @@ -289,6 +299,7 @@ int err; * is set (indicating that a comma should NOT be added to the front). */ +static int str_addarg(str, len, arg, first) char *str; @@ -321,6 +332,7 @@ int first; * for sorting errors. */ +int err_compar(p1, p2) register struct errs *p1, *p2; @@ -339,6 +351,7 @@ register struct errs *p1, *p2; * error_count() - return the number of errors currently logged. */ +int error_count() { @@ -349,6 +362,7 @@ error_count() * show_errors() - display on stdout the current log of errors. */ +void show_errors() { Copied: stable/10/contrib/top/commands.h (from r300395, head/contrib/top/commands.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/top/commands.h Sun Jun 12 05:57:42 2016 (r301836, copy of r300395, head/contrib/top/commands.h) @@ -0,0 +1,21 @@ +/* + * Top users/processes display for Unix + * Version 3 + * + * This program may be freely redistributed, + * but this entire comment MUST remain intact. + * + * Copyright (c) 1984, 1989, William LeFebvre, Rice University + * Copyright (c) 1989, 1990, 1992, William LeFebvre, Northwestern University + * Copyright (c) 2016, Randy Westlund + * + * $FreeBSD$ + */ +#ifndef COMMANDS_H +#define COMMANDS_H + +void show_errors(void); +int error_count(void); +void show_help(void); + +#endif /* COMMANDS_H */ Modified: stable/10/contrib/top/display.c ============================================================================== --- stable/10/contrib/top/display.c Sun Jun 12 02:42:08 2016 (r301835) +++ stable/10/contrib/top/display.c Sun Jun 12 05:57:42 2016 (r301836) @@ -29,9 +29,12 @@ */ #include "os.h" + +#include + #include #include -#include +#include #include "screen.h" /* interface to screen package */ #include "layout.h" /* defines for screen position layout */ @@ -56,7 +59,6 @@ static int display_width = MAX_COLS; #define lineindex(l) ((l)*display_width) -char *printable(); /* things initialized by display_init and used thruout */ @@ -239,6 +241,7 @@ struct statics *statics; return(lines); } +void i_loadave(mpid, avenrun) int mpid; @@ -267,6 +270,7 @@ double *avenrun; lmpid = mpid; } +void u_loadave(mpid, avenrun) int mpid; @@ -306,6 +310,7 @@ double *avenrun; } } +void i_timeofday(tod) time_t *tod; @@ -351,6 +356,7 @@ static char procstates_buffer[MAX_COLS]; * lastline is valid */ +void i_procstates(total, brkdn) int total; @@ -378,6 +384,7 @@ int *brkdn; memcpy(lprocstates, brkdn, num_procstates * sizeof(int)); } +void u_procstates(total, brkdn) int total; @@ -460,9 +467,10 @@ char *cpustates_tag() } #endif +void i_cpustates(states) -register int *states; +int *states; { register int i = 0; @@ -505,9 +513,10 @@ for (cpu = 0; cpu < num_cpus; cpu++) { memcpy(lcpustates, states, num_cpustates * sizeof(int) * num_cpus); } +void u_cpustates(states) -register int *states; +int *states; { register int value; @@ -557,6 +566,7 @@ for (cpu = 0; cpu < num_cpus; cpu++) { } } +void z_cpustates() { @@ -606,6 +616,7 @@ for (cpu = 0; cpu < num_cpus; cpu++) { char memory_buffer[MAX_COLS]; +void i_memory(stats) int *stats; @@ -619,6 +630,7 @@ int *stats; fputs(memory_buffer, stdout); } +void u_memory(stats) int *stats; @@ -639,13 +651,14 @@ int *stats; */ char arc_buffer[MAX_COLS]; +void i_arc(stats) int *stats; { if (arc_names == NULL) - return (0); + return; fputs("\nARC: ", stdout); lastline++; @@ -655,6 +668,7 @@ int *stats; fputs(arc_buffer, stdout); } +void u_arc(stats) int *stats; @@ -663,7 +677,7 @@ int *stats; static char new[MAX_COLS]; if (arc_names == NULL) - return (0); + return; /* format the new line */ summary_format(new, stats, arc_names); @@ -680,6 +694,7 @@ int *stats; char swap_buffer[MAX_COLS]; +void i_swap(stats) int *stats; @@ -693,6 +708,7 @@ int *stats; fputs(swap_buffer, stdout); } +void u_swap(stats) int *stats; @@ -724,6 +740,7 @@ static int msglen = 0; /* Invariant: msglen is always the length of the message currently displayed on the screen (even when next_msg doesn't contain that message). */ +void i_message() { @@ -745,6 +762,7 @@ i_message() } } +void u_message() { @@ -786,6 +804,7 @@ char *text; * Assumptions: cursor is on the previous line and lastline is consistent */ +void i_header(text) char *text; @@ -811,9 +830,10 @@ char *text; } /*ARGSUSED*/ +void u_header(text) -char *text; /* ignored */ +char *text __unused; /* ignored */ { @@ -832,6 +852,7 @@ char *text; /* ignored */ * Assumptions: lastline is consistent */ +void i_process(line, thisline) int line; @@ -862,6 +883,7 @@ char *thisline; memzero(p, display_width - (p - base)); } +void u_process(line, newline) int line; @@ -909,9 +931,10 @@ char *newline; } } +void u_endscreen(hi) -register int hi; +int hi; { register int screen_line = hi + Header_lines; @@ -969,6 +992,7 @@ register int hi; } } +void display_header(t) int t; @@ -985,6 +1009,7 @@ int t; } /*VARARGS2*/ +void new_message(type, msgfmt, a1, a2, a3) int type; @@ -1025,6 +1050,7 @@ caddr_t a1, a2, a3; } } +void clear_message() { @@ -1034,6 +1060,7 @@ clear_message() } } +int readline(buffer, size, numeric) char *buffer; @@ -1336,6 +1363,7 @@ char *str; return(str); } +void i_uptime(bt, tod) struct timeval* bt; Modified: stable/10/contrib/top/display.h ============================================================================== --- stable/10/contrib/top/display.h Sun Jun 12 02:42:08 2016 (r301835) +++ stable/10/contrib/top/display.h Sun Jun 12 05:57:42 2016 (r301836) @@ -5,3 +5,37 @@ #define MT_standout 1 #define MT_delayed 2 +#include "machine.h" + +int display_updatecpus(struct statics *statics); +void clear_message(void); +int display_resize(void); +void i_header(char *text); +char *printable(char *string); +char *cpustates_tag(void); +void display_header(int t); +int display_init(struct statics *statics); +void i_arc(int *stats); +void i_cpustates(int *states); +void i_loadave(int mpid, double *avenrun); +void i_memory(int *stats); +void i_message(void); +void i_process(int line, char *thisline); +void i_procstates(int total, int *brkdn); +void i_swap(int *stats); +void i_timeofday(time_t *tod); +void i_uptime(struct timeval *bt, time_t *tod); +void new_message(); +int readline(char *buffer, int size, int numeric); +char *trim_header(char *text); +void u_arc(int *stats); +void u_cpustates(int *states); +void u_endscreen(int hi); +void u_header(char *text); +void u_loadave(int mpid, double *avenrun); +void u_memory(int *stats); +void u_message(void); +void u_process(int line, char *newline); +void u_procstates(int total, int *brkdn); +void u_swap(int *stats); +void z_cpustates(void); Modified: stable/10/contrib/top/machine.h ============================================================================== --- stable/10/contrib/top/machine.h Sun Jun 12 02:42:08 2016 (r301835) +++ stable/10/contrib/top/machine.h Sun Jun 12 05:57:42 2016 (r301836) @@ -7,6 +7,10 @@ * module. It is NOT machine dependent and should not need to be changed * for any specific machine. */ +#ifndef MACHINE_H +#define MACHINE_H + +#include "top.h" /* * the statics struct is filled in by machine_init @@ -74,8 +78,14 @@ struct process_select /* routines defined by the machine dependent module */ -char *format_header(); -char *format_next_process(); +char *format_header(); +char *format_next_process(); +void toggle_pcpustats(void); +void get_system_info(struct system_info *si); +int machine_init(struct statics *statics, char do_unames); +int proc_owner(int pid); /* non-int routines typically used by the machine dependent module */ -char *printable(); +char *printable(); + +#endif /* MACHINE_H */ Modified: stable/10/contrib/top/screen.c ============================================================================== --- stable/10/contrib/top/screen.c Sun Jun 12 02:42:08 2016 (r301835) +++ stable/10/contrib/top/screen.c Sun Jun 12 05:57:42 2016 (r301836) @@ -50,7 +50,6 @@ extern char *myname; -int putstdout(); int overstrike; int screen_length; @@ -236,6 +235,7 @@ int interactive; #endif } +void init_screen() { @@ -326,6 +326,7 @@ init_screen() } } +void end_screen() { @@ -356,6 +357,7 @@ end_screen() } } +void reinit_screen() { @@ -383,6 +385,7 @@ reinit_screen() } } +void get_screensize() { @@ -428,6 +431,7 @@ get_screensize() lower_left[sizeof(lower_left) - 1] = '\0'; } +void standout(msg) char *msg; @@ -445,6 +449,7 @@ char *msg; } } +void clear() { @@ -454,6 +459,7 @@ clear() } } +int clear_eol(len) int len; @@ -478,6 +484,7 @@ int len; return(-1); } +void go_home() { @@ -489,6 +496,7 @@ go_home() /* This has to be defined as a subroutine for tputs (instead of a macro) */ +void putstdout(ch) char ch; Modified: stable/10/contrib/top/screen.h ============================================================================== --- stable/10/contrib/top/screen.h Sun Jun 12 02:42:08 2016 (r301835) +++ stable/10/contrib/top/screen.h Sun Jun 12 05:57:42 2016 (r301836) @@ -28,4 +28,14 @@ extern int screen_length; extern int screen_width; /* a function that puts a single character on stdout */ -int putstdout(); +void putstdout(char ch); +int clear_eol(int len); +void standout(char *msg); +void clear(void); +void go_home(void); +void reinit_screen(void); +void get_screensize(void); +void init_termcap(int interactive); +void end_screen(void); +void init_screen(void); + Modified: stable/10/contrib/top/top.c ============================================================================== --- stable/10/contrib/top/top.c Sun Jun 12 02:42:08 2016 (r301835) +++ stable/10/contrib/top/top.c Sun Jun 12 05:57:42 2016 (r301836) @@ -34,15 +34,19 @@ char *copyright = */ #include "os.h" -#include -#include -#include -#include + #include #include + +#include +#include #include +#include +#include +#include /* includes specific to top */ +#include "commands.h" #include "display.h" /* interface to display package */ #include "screen.h" /* interface to screen package */ #include "top.h" @@ -50,6 +54,7 @@ char *copyright = #include "boolean.h" #include "machine.h" #include "utils.h" +#include "username.h" /* Size of the stdio buffer given to stdout */ #define Buffersize 2048 @@ -114,38 +119,21 @@ caddr_t get_process_info(); char *username(); char *itoa7(); -/* display routines that need to be predeclared */ -int i_loadave(); -int u_loadave(); -int i_procstates(); -int u_procstates(); -int i_cpustates(); -int u_cpustates(); -int i_memory(); -int u_memory(); -int i_arc(); -int u_arc(); -int i_swap(); -int u_swap(); -int i_message(); -int u_message(); -int i_header(); -int u_header(); -int i_process(); -int u_process(); - /* pointers to display routines */ -int (*d_loadave)() = i_loadave; -int (*d_procstates)() = i_procstates; -int (*d_cpustates)() = i_cpustates; -int (*d_memory)() = i_memory; -int (*d_arc)() = i_arc; -int (*d_swap)() = i_swap; -int (*d_message)() = i_message; -int (*d_header)() = i_header; -int (*d_process)() = i_process; +void (*d_loadave)() = i_loadave; +void (*d_procstates)() = i_procstates; +void (*d_cpustates)() = i_cpustates; +void (*d_memory)() = i_memory; +void (*d_arc)() = i_arc; +void (*d_swap)() = i_swap; +void (*d_message)() = i_message; +void (*d_header)() = i_header; +void (*d_process)() = i_process; + +void reset_display(void); +int main(argc, argv) int argc; @@ -1178,6 +1166,7 @@ restart: * screen will get redrawn. */ +void reset_display() { Modified: stable/10/contrib/top/top.h ============================================================================== --- stable/10/contrib/top/top.h Sun Jun 12 02:42:08 2016 (r301835) +++ stable/10/contrib/top/top.h Sun Jun 12 05:57:42 2016 (r301836) @@ -7,6 +7,9 @@ * General (global) definitions */ +#ifndef TOP_H +#define TOP_H + /* Current major version number */ #define VERSION 3 @@ -47,3 +50,5 @@ enum displaymodes { DISP_CPU = 0, DISP_I extern enum displaymodes displaymode; extern int pcpu_stats; + +#endif /* TOP_H */ Modified: stable/10/contrib/top/username.c ============================================================================== --- stable/10/contrib/top/username.c Sun Jun 12 02:42:08 2016 (r301835) +++ stable/10/contrib/top/username.c Sun Jun 12 05:57:42 2016 (r301836) @@ -32,11 +32,15 @@ #include #include -#include + #include +#include +#include +#include #include "top.local.h" #include "utils.h" +#include "username.h" struct hash_el { int uid; @@ -55,6 +59,8 @@ struct hash_el { /* We depend on that for hash_table and YOUR compiler had BETTER do it! */ struct hash_el hash_table[Table_size]; + +void init_hash() { @@ -67,7 +73,7 @@ init_hash() char *username(uid) -register int uid; +int uid; { register int hashindex; @@ -106,8 +112,8 @@ char *username; int enter_user(uid, name, wecare) -register int uid; -register char *name; +int uid; +char *name; int wecare; /* 1 = enter it always, 0 = nice to have */ { @@ -142,7 +148,7 @@ int wecare; /* 1 = enter it always, 0 = int get_user(uid) -register int uid; +int uid; { struct passwd *pwd; Copied: stable/10/contrib/top/username.h (from r300395, head/contrib/top/username.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/top/username.h Sun Jun 12 05:57:42 2016 (r301836, copy of r300395, head/contrib/top/username.h) @@ -0,0 +1,23 @@ +/* + * Top users/processes display for Unix + * Version 3 + * + * This program may be freely redistributed, + * but this entire comment MUST remain intact. + * + * Copyright (c) 1984, 1989, William LeFebvre, Rice University + * Copyright (c) 1989, 1990, 1992, William LeFebvre, Northwestern University + * Copyright (c) 2016, Randy Westlund + * + * $FreeBSD$ + */ +#ifndef USERNAME_H +#define USERNAME_H + +int enter_user(int uid, char *name, int wecare); +int get_user(int uid); +void init_hash(void); +char *username(int uid); +int userid(char *username); + +#endif /* USERNAME_H */ Modified: stable/10/contrib/top/utils.h ============================================================================== --- stable/10/contrib/top/utils.h Sun Jun 12 02:42:08 2016 (r301835) +++ stable/10/contrib/top/utils.h Sun Jun 12 05:57:42 2016 (r301836) @@ -22,3 +22,5 @@ char *errmsg(); char *format_time(); char *format_k(); char *format_k2(unsigned long long); +int string_index(char *string, char **array); + Modified: stable/10/contrib/top/version.c ============================================================================== --- stable/10/contrib/top/version.c Sun Jun 12 02:42:08 2016 (r301835) +++ stable/10/contrib/top/version.c Sun Jun 12 05:57:42 2016 (r301836) @@ -9,6 +9,9 @@ * Copyright (c) 1989, 1990, 1992, William LeFebvre, Northwestern University */ +#include +#include + #include "top.h" #include "patchlevel.h" From owner-svn-src-all@freebsd.org Sun Jun 12 08:32:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B610CAF0ECF; Sun, 12 Jun 2016 08:32:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A1FB27BA; Sun, 12 Jun 2016 08:32:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5C8We1u075523; Sun, 12 Jun 2016 08:32:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5C8WdLZ075510; Sun, 12 Jun 2016 08:32:39 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606120832.u5C8WdLZ075510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 12 Jun 2016 08:32:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301837 - stable/9/contrib/top X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2016 08:32:41 -0000 Author: ngie Date: Sun Jun 12 08:32:39 2016 New Revision: 301837 URL: https://svnweb.freebsd.org/changeset/base/301837 Log: MFstable/10 r301836: MFC r300395: Silence top(1) compiler warnings The contrib/top code is no longer maintained upstream (last pulled 16 years ago). The K&R-style followed by the code spews -Wimplicit-int and -Wreturn-type warnings, amongst others. This silences 131 warnings with as little modification as possible by adding necessary return types, definitions, headers, and header guards, and missing header includes. The 5 warnings that remain are due to undeclared ncurses references. I didn't include curses.h and term.h because there are several local functions and macros that conflict with those definitions. Added: stable/9/contrib/top/commands.h - copied unchanged from r301836, stable/10/contrib/top/commands.h stable/9/contrib/top/username.h - copied unchanged from r301836, stable/10/contrib/top/username.h Modified: stable/9/contrib/top/commands.c stable/9/contrib/top/display.c stable/9/contrib/top/display.h stable/9/contrib/top/machine.h stable/9/contrib/top/screen.c stable/9/contrib/top/screen.h stable/9/contrib/top/top.c stable/9/contrib/top/top.h stable/9/contrib/top/username.c stable/9/contrib/top/utils.h stable/9/contrib/top/version.c Directory Properties: stable/9/ (props changed) stable/9/contrib/ (props changed) stable/9/contrib/top/ (props changed) Modified: stable/9/contrib/top/commands.c ============================================================================== --- stable/9/contrib/top/commands.c Sun Jun 12 05:57:42 2016 (r301836) +++ stable/9/contrib/top/commands.c Sun Jun 12 08:32:39 2016 (r301837) @@ -19,16 +19,21 @@ */ #include "os.h" -#include -#include -#include + #include #include +#include +#include +#include +#include + +#include "commands.h" #include "sigdesc.h" /* generated automatically */ #include "top.h" #include "boolean.h" #include "utils.h" +#include "machine.h" extern int errno; @@ -39,12 +44,15 @@ extern int overstrike; int err_compar(); char *err_string(); +static int str_adderr(char *str, int len, int err); +static int str_addarg(char *str, int len, char *arg, int first); /* * show_help() - display the help screen; invoked in response to * either 'h' or '?'. */ +void show_help() { @@ -123,6 +131,7 @@ register char *str; return(*str == '\0' ? NULL : str); } +int scanint(str, intp) char *str; @@ -262,6 +271,7 @@ char *err_string() * the string "str". */ +static int str_adderr(str, len, err) char *str; @@ -289,6 +299,7 @@ int err; * is set (indicating that a comma should NOT be added to the front). */ +static int str_addarg(str, len, arg, first) char *str; @@ -321,6 +332,7 @@ int first; * for sorting errors. */ +int err_compar(p1, p2) register struct errs *p1, *p2; @@ -339,6 +351,7 @@ register struct errs *p1, *p2; * error_count() - return the number of errors currently logged. */ +int error_count() { @@ -349,6 +362,7 @@ error_count() * show_errors() - display on stdout the current log of errors. */ +void show_errors() { Copied: stable/9/contrib/top/commands.h (from r301836, stable/10/contrib/top/commands.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/contrib/top/commands.h Sun Jun 12 08:32:39 2016 (r301837, copy of r301836, stable/10/contrib/top/commands.h) @@ -0,0 +1,21 @@ +/* + * Top users/processes display for Unix + * Version 3 + * + * This program may be freely redistributed, + * but this entire comment MUST remain intact. + * + * Copyright (c) 1984, 1989, William LeFebvre, Rice University + * Copyright (c) 1989, 1990, 1992, William LeFebvre, Northwestern University + * Copyright (c) 2016, Randy Westlund + * + * $FreeBSD$ + */ +#ifndef COMMANDS_H +#define COMMANDS_H + +void show_errors(void); +int error_count(void); +void show_help(void); + +#endif /* COMMANDS_H */ Modified: stable/9/contrib/top/display.c ============================================================================== --- stable/9/contrib/top/display.c Sun Jun 12 05:57:42 2016 (r301836) +++ stable/9/contrib/top/display.c Sun Jun 12 08:32:39 2016 (r301837) @@ -29,9 +29,12 @@ */ #include "os.h" + +#include + #include #include -#include +#include #include "screen.h" /* interface to screen package */ #include "layout.h" /* defines for screen position layout */ @@ -56,7 +59,6 @@ static int display_width = MAX_COLS; #define lineindex(l) ((l)*display_width) -char *printable(); /* things initialized by display_init and used thruout */ @@ -239,6 +241,7 @@ struct statics *statics; return(lines); } +void i_loadave(mpid, avenrun) int mpid; @@ -267,6 +270,7 @@ double *avenrun; lmpid = mpid; } +void u_loadave(mpid, avenrun) int mpid; @@ -306,6 +310,7 @@ double *avenrun; } } +void i_timeofday(tod) time_t *tod; @@ -351,6 +356,7 @@ static char procstates_buffer[MAX_COLS]; * lastline is valid */ +void i_procstates(total, brkdn) int total; @@ -378,6 +384,7 @@ int *brkdn; memcpy(lprocstates, brkdn, num_procstates * sizeof(int)); } +void u_procstates(total, brkdn) int total; @@ -460,9 +467,10 @@ char *cpustates_tag() } #endif +void i_cpustates(states) -register int *states; +int *states; { register int i = 0; @@ -505,9 +513,10 @@ for (cpu = 0; cpu < num_cpus; cpu++) { memcpy(lcpustates, states, num_cpustates * sizeof(int) * num_cpus); } +void u_cpustates(states) -register int *states; +int *states; { register int value; @@ -557,6 +566,7 @@ for (cpu = 0; cpu < num_cpus; cpu++) { } } +void z_cpustates() { @@ -606,6 +616,7 @@ for (cpu = 0; cpu < num_cpus; cpu++) { char memory_buffer[MAX_COLS]; +void i_memory(stats) int *stats; @@ -619,6 +630,7 @@ int *stats; fputs(memory_buffer, stdout); } +void u_memory(stats) int *stats; @@ -639,13 +651,14 @@ int *stats; */ char arc_buffer[MAX_COLS]; +void i_arc(stats) int *stats; { if (arc_names == NULL) - return (0); + return; fputs("\nARC: ", stdout); lastline++; @@ -655,6 +668,7 @@ int *stats; fputs(arc_buffer, stdout); } +void u_arc(stats) int *stats; @@ -663,7 +677,7 @@ int *stats; static char new[MAX_COLS]; if (arc_names == NULL) - return (0); + return; /* format the new line */ summary_format(new, stats, arc_names); @@ -680,6 +694,7 @@ int *stats; char swap_buffer[MAX_COLS]; +void i_swap(stats) int *stats; @@ -693,6 +708,7 @@ int *stats; fputs(swap_buffer, stdout); } +void u_swap(stats) int *stats; @@ -724,6 +740,7 @@ static int msglen = 0; /* Invariant: msglen is always the length of the message currently displayed on the screen (even when next_msg doesn't contain that message). */ +void i_message() { @@ -745,6 +762,7 @@ i_message() } } +void u_message() { @@ -786,6 +804,7 @@ char *text; * Assumptions: cursor is on the previous line and lastline is consistent */ +void i_header(text) char *text; @@ -811,9 +830,10 @@ char *text; } /*ARGSUSED*/ +void u_header(text) -char *text; /* ignored */ +char *text __unused; /* ignored */ { @@ -832,6 +852,7 @@ char *text; /* ignored */ * Assumptions: lastline is consistent */ +void i_process(line, thisline) int line; @@ -862,6 +883,7 @@ char *thisline; memzero(p, display_width - (p - base)); } +void u_process(line, newline) int line; @@ -909,9 +931,10 @@ char *newline; } } +void u_endscreen(hi) -register int hi; +int hi; { register int screen_line = hi + Header_lines; @@ -969,6 +992,7 @@ register int hi; } } +void display_header(t) int t; @@ -985,6 +1009,7 @@ int t; } /*VARARGS2*/ +void new_message(type, msgfmt, a1, a2, a3) int type; @@ -1025,6 +1050,7 @@ caddr_t a1, a2, a3; } } +void clear_message() { @@ -1034,6 +1060,7 @@ clear_message() } } +int readline(buffer, size, numeric) char *buffer; @@ -1336,6 +1363,7 @@ char *str; return(str); } +void i_uptime(bt, tod) struct timeval* bt; Modified: stable/9/contrib/top/display.h ============================================================================== --- stable/9/contrib/top/display.h Sun Jun 12 05:57:42 2016 (r301836) +++ stable/9/contrib/top/display.h Sun Jun 12 08:32:39 2016 (r301837) @@ -5,3 +5,37 @@ #define MT_standout 1 #define MT_delayed 2 +#include "machine.h" + +int display_updatecpus(struct statics *statics); +void clear_message(void); +int display_resize(void); +void i_header(char *text); +char *printable(char *string); +char *cpustates_tag(void); +void display_header(int t); +int display_init(struct statics *statics); +void i_arc(int *stats); +void i_cpustates(int *states); +void i_loadave(int mpid, double *avenrun); +void i_memory(int *stats); +void i_message(void); +void i_process(int line, char *thisline); +void i_procstates(int total, int *brkdn); +void i_swap(int *stats); +void i_timeofday(time_t *tod); +void i_uptime(struct timeval *bt, time_t *tod); +void new_message(); +int readline(char *buffer, int size, int numeric); +char *trim_header(char *text); +void u_arc(int *stats); +void u_cpustates(int *states); +void u_endscreen(int hi); +void u_header(char *text); +void u_loadave(int mpid, double *avenrun); +void u_memory(int *stats); +void u_message(void); +void u_process(int line, char *newline); +void u_procstates(int total, int *brkdn); +void u_swap(int *stats); +void z_cpustates(void); Modified: stable/9/contrib/top/machine.h ============================================================================== --- stable/9/contrib/top/machine.h Sun Jun 12 05:57:42 2016 (r301836) +++ stable/9/contrib/top/machine.h Sun Jun 12 08:32:39 2016 (r301837) @@ -7,6 +7,10 @@ * module. It is NOT machine dependent and should not need to be changed * for any specific machine. */ +#ifndef MACHINE_H +#define MACHINE_H + +#include "top.h" /* * the statics struct is filled in by machine_init @@ -74,8 +78,14 @@ struct process_select /* routines defined by the machine dependent module */ -char *format_header(); -char *format_next_process(); +char *format_header(); +char *format_next_process(); +void toggle_pcpustats(void); +void get_system_info(struct system_info *si); +int machine_init(struct statics *statics, char do_unames); +int proc_owner(int pid); /* non-int routines typically used by the machine dependent module */ -char *printable(); +char *printable(); + +#endif /* MACHINE_H */ Modified: stable/9/contrib/top/screen.c ============================================================================== --- stable/9/contrib/top/screen.c Sun Jun 12 05:57:42 2016 (r301836) +++ stable/9/contrib/top/screen.c Sun Jun 12 08:32:39 2016 (r301837) @@ -50,7 +50,6 @@ extern char *myname; -int putstdout(); int overstrike; int screen_length; @@ -236,6 +235,7 @@ int interactive; #endif } +void init_screen() { @@ -326,6 +326,7 @@ init_screen() } } +void end_screen() { @@ -356,6 +357,7 @@ end_screen() } } +void reinit_screen() { @@ -383,6 +385,7 @@ reinit_screen() } } +void get_screensize() { @@ -428,6 +431,7 @@ get_screensize() lower_left[sizeof(lower_left) - 1] = '\0'; } +void standout(msg) char *msg; @@ -445,6 +449,7 @@ char *msg; } } +void clear() { @@ -454,6 +459,7 @@ clear() } } +int clear_eol(len) int len; @@ -478,6 +484,7 @@ int len; return(-1); } +void go_home() { @@ -489,6 +496,7 @@ go_home() /* This has to be defined as a subroutine for tputs (instead of a macro) */ +void putstdout(ch) char ch; Modified: stable/9/contrib/top/screen.h ============================================================================== --- stable/9/contrib/top/screen.h Sun Jun 12 05:57:42 2016 (r301836) +++ stable/9/contrib/top/screen.h Sun Jun 12 08:32:39 2016 (r301837) @@ -28,4 +28,14 @@ extern int screen_length; extern int screen_width; /* a function that puts a single character on stdout */ -int putstdout(); +void putstdout(char ch); +int clear_eol(int len); +void standout(char *msg); +void clear(void); +void go_home(void); +void reinit_screen(void); +void get_screensize(void); +void init_termcap(int interactive); +void end_screen(void); +void init_screen(void); + Modified: stable/9/contrib/top/top.c ============================================================================== --- stable/9/contrib/top/top.c Sun Jun 12 05:57:42 2016 (r301836) +++ stable/9/contrib/top/top.c Sun Jun 12 08:32:39 2016 (r301837) @@ -34,15 +34,19 @@ char *copyright = */ #include "os.h" -#include -#include -#include -#include + #include #include + +#include +#include #include +#include +#include +#include /* includes specific to top */ +#include "commands.h" #include "display.h" /* interface to display package */ #include "screen.h" /* interface to screen package */ #include "top.h" @@ -50,6 +54,7 @@ char *copyright = #include "boolean.h" #include "machine.h" #include "utils.h" +#include "username.h" /* Size of the stdio buffer given to stdout */ #define Buffersize 2048 @@ -114,38 +119,21 @@ caddr_t get_process_info(); char *username(); char *itoa7(); -/* display routines that need to be predeclared */ -int i_loadave(); -int u_loadave(); -int i_procstates(); -int u_procstates(); -int i_cpustates(); -int u_cpustates(); -int i_memory(); -int u_memory(); -int i_arc(); -int u_arc(); -int i_swap(); -int u_swap(); -int i_message(); -int u_message(); -int i_header(); -int u_header(); -int i_process(); -int u_process(); - /* pointers to display routines */ -int (*d_loadave)() = i_loadave; -int (*d_procstates)() = i_procstates; -int (*d_cpustates)() = i_cpustates; -int (*d_memory)() = i_memory; -int (*d_arc)() = i_arc; -int (*d_swap)() = i_swap; -int (*d_message)() = i_message; -int (*d_header)() = i_header; -int (*d_process)() = i_process; +void (*d_loadave)() = i_loadave; +void (*d_procstates)() = i_procstates; +void (*d_cpustates)() = i_cpustates; +void (*d_memory)() = i_memory; +void (*d_arc)() = i_arc; +void (*d_swap)() = i_swap; +void (*d_message)() = i_message; +void (*d_header)() = i_header; +void (*d_process)() = i_process; + +void reset_display(void); +int main(argc, argv) int argc; @@ -1178,6 +1166,7 @@ restart: * screen will get redrawn. */ +void reset_display() { Modified: stable/9/contrib/top/top.h ============================================================================== --- stable/9/contrib/top/top.h Sun Jun 12 05:57:42 2016 (r301836) +++ stable/9/contrib/top/top.h Sun Jun 12 08:32:39 2016 (r301837) @@ -7,6 +7,9 @@ * General (global) definitions */ +#ifndef TOP_H +#define TOP_H + /* Current major version number */ #define VERSION 3 @@ -47,3 +50,5 @@ enum displaymodes { DISP_CPU = 0, DISP_I extern enum displaymodes displaymode; extern int pcpu_stats; + +#endif /* TOP_H */ Modified: stable/9/contrib/top/username.c ============================================================================== --- stable/9/contrib/top/username.c Sun Jun 12 05:57:42 2016 (r301836) +++ stable/9/contrib/top/username.c Sun Jun 12 08:32:39 2016 (r301837) @@ -32,11 +32,15 @@ #include #include -#include + #include +#include +#include +#include #include "top.local.h" #include "utils.h" +#include "username.h" struct hash_el { int uid; @@ -55,6 +59,8 @@ struct hash_el { /* We depend on that for hash_table and YOUR compiler had BETTER do it! */ struct hash_el hash_table[Table_size]; + +void init_hash() { @@ -67,7 +73,7 @@ init_hash() char *username(uid) -register int uid; +int uid; { register int hashindex; @@ -106,8 +112,8 @@ char *username; int enter_user(uid, name, wecare) -register int uid; -register char *name; +int uid; +char *name; int wecare; /* 1 = enter it always, 0 = nice to have */ { @@ -142,7 +148,7 @@ int wecare; /* 1 = enter it always, 0 = int get_user(uid) -register int uid; +int uid; { struct passwd *pwd; Copied: stable/9/contrib/top/username.h (from r301836, stable/10/contrib/top/username.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/contrib/top/username.h Sun Jun 12 08:32:39 2016 (r301837, copy of r301836, stable/10/contrib/top/username.h) @@ -0,0 +1,23 @@ +/* + * Top users/processes display for Unix + * Version 3 + * + * This program may be freely redistributed, + * but this entire comment MUST remain intact. + * + * Copyright (c) 1984, 1989, William LeFebvre, Rice University + * Copyright (c) 1989, 1990, 1992, William LeFebvre, Northwestern University + * Copyright (c) 2016, Randy Westlund + * + * $FreeBSD$ + */ +#ifndef USERNAME_H +#define USERNAME_H + +int enter_user(int uid, char *name, int wecare); +int get_user(int uid); +void init_hash(void); +char *username(int uid); +int userid(char *username); + +#endif /* USERNAME_H */ Modified: stable/9/contrib/top/utils.h ============================================================================== --- stable/9/contrib/top/utils.h Sun Jun 12 05:57:42 2016 (r301836) +++ stable/9/contrib/top/utils.h Sun Jun 12 08:32:39 2016 (r301837) @@ -22,3 +22,5 @@ char *errmsg(); char *format_time(); char *format_k(); char *format_k2(unsigned long long); +int string_index(char *string, char **array); + Modified: stable/9/contrib/top/version.c ============================================================================== --- stable/9/contrib/top/version.c Sun Jun 12 05:57:42 2016 (r301836) +++ stable/9/contrib/top/version.c Sun Jun 12 08:32:39 2016 (r301837) @@ -9,6 +9,9 @@ * Copyright (c) 1989, 1990, 1992, William LeFebvre, Northwestern University */ +#include +#include + #include "top.h" #include "patchlevel.h" From owner-svn-src-all@freebsd.org Sun Jun 12 11:13:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E121AF0811; Sun, 12 Jun 2016 11:13:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F6922FAD; Sun, 12 Jun 2016 11:13:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5CBDcSu036535; Sun, 12 Jun 2016 11:13:38 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5CBDceu036534; Sun, 12 Jun 2016 11:13:38 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606121113.u5CBDceu036534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 12 Jun 2016 11:13:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301838 - head/sys/compat/linprocfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2016 11:13:39 -0000 Author: kib Date: Sun Jun 12 11:13:38 2016 New Revision: 301838 URL: https://svnweb.freebsd.org/changeset/base/301838 Log: swap_dev_info() does not require Giant, so Giant locking around the loop in linprocfs_doswaps() is useless. List of the registered filesystems is protected by vfsconf_sx, not by the Giant. Adjust linprocfs_dofilesystems() correspondingly. Approved by: re (delphij), des (linprocfs maintainer) Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Sun Jun 12 08:32:39 2016 (r301837) +++ head/sys/compat/linprocfs/linprocfs.c Sun Jun 12 11:13:38 2016 (r301838) @@ -490,7 +490,6 @@ linprocfs_doswaps(PFS_FILL_ARGS) char devname[SPECNAMELEN + 1]; sbuf_printf(sb, "Filename\t\t\t\tType\t\tSize\tUsed\tPriority\n"); - mtx_lock(&Giant); for (n = 0; ; n++) { if (swap_dev_info(n, &xsw, devname, sizeof(devname)) != 0) break; @@ -504,7 +503,6 @@ linprocfs_doswaps(PFS_FILL_ARGS) sbuf_printf(sb, "/dev/%-34s unknown\t\t%jd\t%jd\t-1\n", devname, total, used); } - mtx_unlock(&Giant); return (0); } @@ -1326,13 +1324,13 @@ linprocfs_dofilesystems(PFS_FILL_ARGS) { struct vfsconf *vfsp; - mtx_lock(&Giant); + vfsconf_slock(); TAILQ_FOREACH(vfsp, &vfsconf, vfc_list) { if (vfsp->vfc_flags & VFCF_SYNTHETIC) sbuf_printf(sb, "nodev"); sbuf_printf(sb, "\t%s\n", vfsp->vfc_name); } - mtx_unlock(&Giant); + vfsconf_sunlock(); return(0); } From owner-svn-src-all@freebsd.org Sun Jun 12 11:45:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B198EAF012C; Sun, 12 Jun 2016 11:45:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82BCB2DD4; Sun, 12 Jun 2016 11:45:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5CBjjOi047480; Sun, 12 Jun 2016 11:45:45 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5CBjjfD047479; Sun, 12 Jun 2016 11:45:45 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201606121145.u5CBjjfD047479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 12 Jun 2016 11:45:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301839 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2016 11:45:46 -0000 Author: dim Date: Sun Jun 12 11:45:45 2016 New Revision: 301839 URL: https://svnweb.freebsd.org/changeset/base/301839 Log: MFC r300967: Stop exposing the C11 _Atomic() macro in , when compiling for C++. It clashes with the one in libc++'s header. (Previously, the _Atomic() macro was defined in , which is only for use with C11, but for various reasons it was moved to its current location in r251804.) Discussed with: bdrewery, ed Modified: stable/10/sys/sys/cdefs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/cdefs.h ============================================================================== --- stable/10/sys/sys/cdefs.h Sun Jun 12 11:13:38 2016 (r301838) +++ stable/10/sys/sys/cdefs.h Sun Jun 12 11:45:45 2016 (r301839) @@ -273,7 +273,8 @@ #define _Alignof(x) __alignof(x) #endif -#if !__has_extension(c_atomic) && !__has_extension(cxx_atomic) +#if !defined(__cplusplus) && !__has_extension(c_atomic) && \ + !__has_extension(cxx_atomic) /* * No native support for _Atomic(). Place object in structure to prevent * most forms of direct non-atomic access. From owner-svn-src-all@freebsd.org Sun Jun 12 20:02:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D009AAF1F1C; Sun, 12 Jun 2016 20:02:38 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from smtp.imp.ch (smtp.imp.ch [IPv6:2001:4060:1:1001::13:198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98CF72F8C; Sun, 12 Jun 2016 20:02:38 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from [192.168.225.14] (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by fgznet.ch (Postfix) with ESMTPS id 2FD3E101035; Sun, 12 Jun 2016 22:02:35 +0200 (CEST) Subject: Re: svn commit: r300943 - in head: . lib/libc++ lib/libcxxrt share/mk To: Bryan Drewery , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605290620.u4T6KFjT002312@repo.freebsd.org> From: Andreas Tobler Message-ID: Date: Sun, 12 Jun 2016 22:02:34 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <201605290620.u4T6KFjT002312@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.73 on 127.0.1.1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2016 20:02:38 -0000 Hi Bryan, On 29.05.16 08:20, Bryan Drewery wrote: > Author: bdrewery > Date: Sun May 29 06:20:15 2016 > New Revision: 300943 > URL: https://svnweb.freebsd.org/changeset/base/300943 > > Log: > GCC External: Revert r300886, r300904, r300917, r300918 > > The fix in r300873 is mostly enough. A fix for lib32 will be > committed.separately. Did this commit already happen? I still suffer a broken buildworld on powerpc64 for 32-bit with internal tools. Unknown option -std=c++11... Thanks, Andreas From owner-svn-src-all@freebsd.org Sun Jun 12 22:55:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BAF6AF0385; Sun, 12 Jun 2016 22:55:52 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C84F121D8; Sun, 12 Jun 2016 22:55:51 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5CMtp1o095913; Sun, 12 Jun 2016 22:55:51 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5CMtoIB095911; Sun, 12 Jun 2016 22:55:50 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201606122255.u5CMtoIB095911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Sun, 12 Jun 2016 22:55:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301841 - head/sys/dev/dwc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2016 22:55:52 -0000 Author: jmcneill Date: Sun Jun 12 22:55:50 2016 New Revision: 301841 URL: https://svnweb.freebsd.org/changeset/base/301841 Log: Fix an issue with multicast hash filters on Amlogic and Allwinner boards. For DWC_GMAC_ALT_DESC implementations, the multicast hash table has only 64 entries. Instead of 8 registers starting at 0x500, a pair of registers at 0x08 and 0x0c are used instead. Approved by: re (hrs) Submitted by: Guy Yur Modified: head/sys/dev/dwc/if_dwc.c head/sys/dev/dwc/if_dwc.h Modified: head/sys/dev/dwc/if_dwc.c ============================================================================== --- head/sys/dev/dwc/if_dwc.c Sun Jun 12 15:37:35 2016 (r301840) +++ head/sys/dev/dwc/if_dwc.c Sun Jun 12 22:55:50 2016 (r301841) @@ -587,14 +587,13 @@ dwc_setup_rxfilter(struct dwc_softc *sc) struct ifmultiaddr *ifma; struct ifnet *ifp; uint8_t *eaddr, val; - uint32_t crc, ffval, hashbit, hashreg, hi, lo, hash[8], hmask; + uint32_t crc, ffval, hashbit, hashreg, hi, lo, hash[8]; int nhash, i; DWC_ASSERT_LOCKED(sc); ifp = sc->ifp; nhash = sc->mactype == DWC_GMAC_ALT_DESC ? 2 : 8; - hmask = ((nhash << 5) - 1) | 0xf; /* * Set the multicast (group) filter hash. @@ -615,11 +614,10 @@ dwc_setup_rxfilter(struct dwc_softc *sc) ifma->ifma_addr), ETHER_ADDR_LEN); /* Take lower 8 bits and reverse it */ - val = bitreverse(~crc & 0xff) & hmask; + val = bitreverse(~crc & 0xff); if (sc->mactype == DWC_GMAC_ALT_DESC) - hashreg = (val >> 5) == 0; - else - hashreg = (val >> 5); + val >>= nhash; /* Only need lower 6 bits */ + hashreg = (val >> 5); hashbit = (val & 31); hash[hashreg] |= (1 << hashbit); } @@ -642,8 +640,13 @@ dwc_setup_rxfilter(struct dwc_softc *sc) WRITE4(sc, MAC_ADDRESS_LOW(0), lo); WRITE4(sc, MAC_ADDRESS_HIGH(0), hi); WRITE4(sc, MAC_FRAME_FILTER, ffval); - for (i = 0; i < nhash; i++) - WRITE4(sc, HASH_TABLE_REG(i), hash[i]); + if (sc->mactype == DWC_GMAC_ALT_DESC) { + WRITE4(sc, GMAC_MAC_HTLOW, hash[0]); + WRITE4(sc, GMAC_MAC_HTHIGH, hash[1]); + } else { + for (i = 0; i < nhash; i++) + WRITE4(sc, HASH_TABLE_REG(i), hash[i]); + } } static int Modified: head/sys/dev/dwc/if_dwc.h ============================================================================== --- head/sys/dev/dwc/if_dwc.h Sun Jun 12 15:37:35 2016 (r301840) +++ head/sys/dev/dwc/if_dwc.h Sun Jun 12 22:55:50 2016 (r301841) @@ -53,6 +53,8 @@ #define FRAME_FILTER_HMC (1 << 2) #define FRAME_FILTER_HUC (1 << 1) #define FRAME_FILTER_PR (1 << 0) /* All Incoming Frames */ +#define GMAC_MAC_HTHIGH 0x08 +#define GMAC_MAC_HTLOW 0x0c #define GMII_ADDRESS 0x10 #define GMII_ADDRESS_PA_MASK 0x1f /* Phy device */ #define GMII_ADDRESS_PA_SHIFT 11 From owner-svn-src-all@freebsd.org Sun Jun 12 23:26:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E53AAF0998; Sun, 12 Jun 2016 23:26:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DB672BA5; Sun, 12 Jun 2016 23:26:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5CNQc0a006849; Sun, 12 Jun 2016 23:26:38 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5CNQcPU006848; Sun, 12 Jun 2016 23:26:38 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201606122326.u5CNQcPU006848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 12 Jun 2016 23:26:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301842 - head/lib/libusb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2016 23:26:39 -0000 Author: hselasky Date: Sun Jun 12 23:26:38 2016 New Revision: 301842 URL: https://svnweb.freebsd.org/changeset/base/301842 Log: Implement code to stop all USB endpoints before executing a USB device reset command, alternate setting command or set configuration command. Else LibUSB v1.0 will not re-open the endpoints which the kernel closes and the USB application might wait infinitely for transfers to complete. Approved by: re (hrs) MFC after: 3 days Modified: head/lib/libusb/libusb10.c Modified: head/lib/libusb/libusb10.c ============================================================================== --- head/lib/libusb/libusb10.c Sun Jun 12 22:55:50 2016 (r301841) +++ head/lib/libusb/libusb10.c Sun Jun 12 23:26:38 2016 (r301842) @@ -51,6 +51,8 @@ #include "libusb.h" #include "libusb10.h" +#define LIBUSB_NUM_SW_ENDPOINTS (16 * 4) + static pthread_mutex_t default_context_lock = PTHREAD_MUTEX_INITIALIZER; struct libusb_context *usbi_default_context = NULL; @@ -442,7 +444,7 @@ libusb_open(libusb_device *dev, libusb_d if (dev == NULL) return (LIBUSB_ERROR_INVALID_PARAM); - err = libusb20_dev_open(pdev, 16 * 4 /* number of endpoints */ ); + err = libusb20_dev_open(pdev, LIBUSB_NUM_SW_ENDPOINTS); if (err) { libusb_unref_device(dev); return (LIBUSB_ERROR_NO_MEM); @@ -1482,7 +1484,17 @@ libusb_cancel_transfer(struct libusb_tra UNEXPORTED void libusb10_cancel_all_transfer(libusb_device *dev) { - /* TODO */ + struct libusb20_device *pdev = dev->os_priv; + unsigned x; + + for (x = 0; x != LIBUSB_NUM_SW_ENDPOINTS; x++) { + struct libusb20_transfer *xfer; + + xfer = libusb20_tr_get_pointer(pdev, x); + if (xfer == NULL) + continue; + libusb20_tr_close(xfer); + } } uint16_t From owner-svn-src-all@freebsd.org Sun Jun 12 23:34:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B4C3AF0B17; Sun, 12 Jun 2016 23:34:50 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E14942F47; Sun, 12 Jun 2016 23:34:49 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5CNYnUA010446; Sun, 12 Jun 2016 23:34:49 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5CNYn1w010445; Sun, 12 Jun 2016 23:34:49 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201606122334.u5CNYn1w010445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Sun, 12 Jun 2016 23:34:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301843 - head/contrib/blacklist/libexec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2016 23:34:50 -0000 Author: lidl Date: Sun Jun 12 23:34:48 2016 New Revision: 301843 URL: https://svnweb.freebsd.org/changeset/base/301843 Log: Add ipfilter support to blacklistd-helper In addition to adding initial support for the ipfilter packet filtering system, wrap a few long lines, perform whitespace cleanup and sync with upstream changes made in NetBSD. Submitted by: cy Reviewed by: cy Approved by: re (hrs) Relnotes: YES Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6823 Modified: head/contrib/blacklist/libexec/blacklistd-helper Modified: head/contrib/blacklist/libexec/blacklistd-helper ============================================================================== --- head/contrib/blacklist/libexec/blacklistd-helper Sun Jun 12 23:26:38 2016 (r301842) +++ head/contrib/blacklist/libexec/blacklistd-helper Sun Jun 12 23:34:48 2016 (r301843) @@ -10,12 +10,6 @@ # $7 id pf= -for f in npf pf; do - if [ -f "/etc/$f.conf" ]; then - pf="$f" - break - fi -done if [ -f "/etc/ipfw-blacklist.rc" ]; then pf="ipfw" . /etc/ipfw-blacklist.rc @@ -23,6 +17,15 @@ if [ -f "/etc/ipfw-blacklist.rc" ]; then fi if [ -z "$pf" ]; then + for f in npf pf ipf; do + if [ -f "/etc/$f.conf" ]; then + pf="$f" + break + fi + done +fi + +if [ -z "$pf" ]; then echo "$0: Unsupported packet filter" 1>&2 exit 1 fi @@ -48,12 +51,20 @@ esac case "$1" in add) case "$pf" in + ipf) + /sbin/ipfstat -io | /sbin/ipf -I -f - >/dev/null 2>&1 + echo block in quick $proto from $addr/$mask to \ + any port=$6 head port$6 | \ + /sbin/ipf -I -f - -s >/dev/null 2>&1 + ;; ipfw) - rule=$(( $ipfw_offset + $6 )) # use $ipfw_offset+$port for rule number + # use $ipfw_offset+$port for rule number + rule=$(($ipfw_offset + $6)) tname="port$6" /sbin/ipfw table $tname create type addr 2>/dev/null /sbin/ipfw -q table $tname add "$addr/$mask" - /sbin/ipfw -q add $rule drop $3 from "table("$tname")" to any dst-port $6 + /sbin/ipfw -q add $rule drop $3 from "table("$tname")" to \ + any dst-port $6 ;; npf) /sbin/npfctl rule "$2" add block in final $proto from \ @@ -69,6 +80,12 @@ add) ;; rem) case "$pf" in + ipf) + /sbin/ipfstat -io | /sbin/ipf -I -f - >/dev/null 2>&1 + echo block in quick $proto from $addr/$mask to \ + any port=$6 head port$6 | \ + /sbin/ipf -I -r -f - -s >/dev/null 2>&1 + ;; ipfw) /sbin/ipfw table "port$6" delete "$addr/$mask" 2>/dev/null ;; @@ -81,7 +98,10 @@ rem) esac ;; flush) - case "$pf" in + case "$pf" in + ipf) + /sbin/ipf -Z -I -Fi -s > /dev/null + ;; ipfw) /sbin/ipfw table "port$6" flush 2>/dev/null ;; From owner-svn-src-all@freebsd.org Mon Jun 13 00:03:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C57FAF1393; Mon, 13 Jun 2016 00:03:56 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2E3E29D3; Mon, 13 Jun 2016 00:03:55 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5D03tUI021132; Mon, 13 Jun 2016 00:03:55 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5D03txm021131; Mon, 13 Jun 2016 00:03:55 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201606130003.u5D03txm021131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 13 Jun 2016 00:03:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301844 - head/lib/libcasper/libcasper X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 00:03:56 -0000 Author: oshogbo Date: Mon Jun 13 00:03:55 2016 New Revision: 301844 URL: https://svnweb.freebsd.org/changeset/base/301844 Log: Don't close fd if it's lower then stderr, otherwise we can close one of the descriptor which we just set. Pointed out by: jilles Approved by: re (hrs) Modified: head/lib/libcasper/libcasper/service.c Modified: head/lib/libcasper/libcasper/service.c ============================================================================== --- head/lib/libcasper/libcasper/service.c Sun Jun 12 23:34:48 2016 (r301843) +++ head/lib/libcasper/libcasper/service.c Mon Jun 13 00:03:55 2016 (r301844) @@ -360,7 +360,8 @@ stdnull(void) if (dup2(fd, STDERR_FILENO) == -1) errx(1, "Unable to cover stderr"); - close(fd); + if (fd > STDERR_FILENO) + close(fd); } static void From owner-svn-src-all@freebsd.org Mon Jun 13 00:13:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5454AF15BA; Mon, 13 Jun 2016 00:13:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7DF9A2DCC; Mon, 13 Jun 2016 00:13:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5D0DKOa025104; Mon, 13 Jun 2016 00:13:20 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5D0DKuX025102; Mon, 13 Jun 2016 00:13:20 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606130013.u5D0DKuX025102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 13 Jun 2016 00:13:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301845 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 00:13:21 -0000 Author: adrian Date: Mon Jun 13 00:13:20 2016 New Revision: 301845 URL: https://svnweb.freebsd.org/changeset/base/301845 Log: [iwm] Fix up busdma use in the RX path When allocating a new mbuf or bus_dmamap_load()-ing it fails, we can just keep the old mbuf since we are dropping that packet anyway. Instead of doing bus_dmamap_create() and bus_dmamap_destroy() all the time, create an extra bus_dmamap_t which we can use to safely try bus_dmamap_load()-ing the new mbuf. On success we just swap the spare bus_dmamap_t with the data->map of that ring entry. Tested: Tested with Intel AC7260, verified with vmstat -m that new kernel no longer visibly leaks memory from the M_DEVBUF malloc type. Before, leakage was 1KB every few seconds while ping(8)-ing over the wlan connection. Submitted by: Imre Vadasz Approved by: re@ Obtained from: DragonflyBSD.git cc440b26818b5dfdd9af504d71c1b0e6522b53ef Differential Revision: https://reviews.freebsd.org/D6742 Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwmvar.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Mon Jun 13 00:03:55 2016 (r301844) +++ head/sys/dev/iwm/if_iwm.c Mon Jun 13 00:13:20 2016 (r301845) @@ -866,10 +866,28 @@ iwm_alloc_rx_ring(struct iwm_softc *sc, goto fail; } + /* Allocate spare bus_dmamap_t for iwm_rx_addbuf() */ + error = bus_dmamap_create(ring->data_dmat, 0, &ring->spare_map); + if (error != 0) { + device_printf(sc->sc_dev, + "%s: could not create RX buf DMA map, error %d\n", + __func__, error); + goto fail; + } /* * Allocate and map RX buffers. */ for (i = 0; i < IWM_RX_RING_COUNT; i++) { + struct iwm_rx_data *data = &ring->data[i]; + error = bus_dmamap_create(ring->data_dmat, 0, &data->map); + if (error != 0) { + device_printf(sc->sc_dev, + "%s: could not create RX buf DMA map, error %d\n", + __func__, error); + goto fail; + } + data->m = NULL; + if ((error = iwm_rx_addbuf(sc, IWM_RBUF_SIZE, i)) != 0) { goto fail; } @@ -923,6 +941,10 @@ iwm_free_rx_ring(struct iwm_softc *sc, s data->map = NULL; } } + if (ring->spare_map != NULL) { + bus_dmamap_destroy(ring->data_dmat, ring->spare_map); + ring->spare_map = NULL; + } if (ring->data_dmat != NULL) { bus_dma_tag_destroy(ring->data_dmat); ring->data_dmat = NULL; @@ -2119,6 +2141,7 @@ iwm_rx_addbuf(struct iwm_softc *sc, int struct iwm_rx_ring *ring = &sc->rxq; struct iwm_rx_data *data = &ring->data[idx]; struct mbuf *m; + bus_dmamap_t dmamap = NULL; int error; bus_addr_t paddr; @@ -2126,28 +2149,26 @@ iwm_rx_addbuf(struct iwm_softc *sc, int if (m == NULL) return ENOBUFS; - if (data->m != NULL) - bus_dmamap_unload(ring->data_dmat, data->map); - m->m_len = m->m_pkthdr.len = m->m_ext.ext_size; - error = bus_dmamap_create(ring->data_dmat, 0, &data->map); - if (error != 0) { - device_printf(sc->sc_dev, - "%s: could not create RX buf DMA map, error %d\n", - __func__, error); - goto fail; - } - data->m = m; - error = bus_dmamap_load(ring->data_dmat, data->map, - mtod(data->m, void *), IWM_RBUF_SIZE, iwm_dma_map_addr, + error = bus_dmamap_load(ring->data_dmat, ring->spare_map, + mtod(m, void *), IWM_RBUF_SIZE, iwm_dma_map_addr, &paddr, BUS_DMA_NOWAIT); if (error != 0 && error != EFBIG) { device_printf(sc->sc_dev, - "%s: can't not map mbuf, error %d\n", __func__, - error); + "%s: can't map mbuf, error %d\n", __func__, error); goto fail; } + + if (data->m != NULL) + bus_dmamap_unload(ring->data_dmat, data->map); + + /* Swap ring->spare_map with data->map */ + dmamap = data->map; + data->map = ring->spare_map; + ring->spare_map = dmamap; + bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_PREREAD); + data->m = m; /* Update RX descriptor. */ ring->desc[idx] = htole32(paddr >> 8); @@ -2156,6 +2177,7 @@ iwm_rx_addbuf(struct iwm_softc *sc, int return 0; fail: + m_free(m); return error; } Modified: head/sys/dev/iwm/if_iwmvar.h ============================================================================== --- head/sys/dev/iwm/if_iwmvar.h Mon Jun 13 00:03:55 2016 (r301844) +++ head/sys/dev/iwm/if_iwmvar.h Mon Jun 13 00:13:20 2016 (r301845) @@ -289,6 +289,7 @@ struct iwm_rx_ring { uint32_t *desc; struct iwm_rb_status *stat; struct iwm_rx_data data[IWM_RX_RING_COUNT]; + bus_dmamap_t spare_map; /* for iwm_rx_addbuf() */ bus_dma_tag_t data_dmat; int cur; }; From owner-svn-src-all@freebsd.org Mon Jun 13 01:33:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66F4AAF0481; Mon, 13 Jun 2016 01:33:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34D7E278A; Mon, 13 Jun 2016 01:33:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5D1X2dc054662; Mon, 13 Jun 2016 01:33:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5D1X27l054661; Mon, 13 Jun 2016 01:33:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201606130133.u5D1X27l054661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 13 Jun 2016 01:33:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301846 - head/lib/libusb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 01:33:03 -0000 Author: hselasky Date: Mon Jun 13 01:33:02 2016 New Revision: 301846 URL: https://svnweb.freebsd.org/changeset/base/301846 Log: Fix compile warning. Approved by: re (delphij) MFC after: 1 week Modified: head/lib/libusb/libusb10_desc.c Modified: head/lib/libusb/libusb10_desc.c ============================================================================== --- head/lib/libusb/libusb10_desc.c Mon Jun 13 00:13:20 2016 (r301845) +++ head/lib/libusb/libusb10_desc.c Mon Jun 13 01:33:02 2016 (r301846) @@ -332,7 +332,7 @@ libusb_get_string_descriptor_ascii(libus if (libusb20_dev_req_string_simple_sync(pdev, desc_index, data, length) == 0) - return (strlen(data)); + return (strlen((char *)data)); return (LIBUSB_ERROR_OTHER); } From owner-svn-src-all@freebsd.org Mon Jun 13 02:54:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5F74AF0557; Mon, 13 Jun 2016 02:54:59 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88B0323F0; Mon, 13 Jun 2016 02:54:59 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5D2swLk083760; Mon, 13 Jun 2016 02:54:58 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5D2swKI083759; Mon, 13 Jun 2016 02:54:58 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606130254.u5D2swKI083759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 13 Jun 2016 02:54:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301847 - stable/10/contrib/hyperv/tools X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 02:54:59 -0000 Author: sephe Date: Mon Jun 13 02:54:58 2016 New Revision: 301847 URL: https://svnweb.freebsd.org/changeset/base/301847 Log: MFC 293653 hyperv/kvp_daemon: Make poll(2) block indefinitely Submitted by: Jun Su Reviewed by: Dexuan Cui , me, adrain Approved by: adrian Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D4762 Modified: stable/10/contrib/hyperv/tools/hv_kvp_daemon.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/hyperv/tools/hv_kvp_daemon.c ============================================================================== --- stable/10/contrib/hyperv/tools/hv_kvp_daemon.c Mon Jun 13 01:33:02 2016 (r301846) +++ stable/10/contrib/hyperv/tools/hv_kvp_daemon.c Mon Jun 13 02:54:58 2016 (r301847) @@ -1437,7 +1437,7 @@ main(int argc, char *argv[]) for (;;) { - r = poll (hv_kvp_poll_fd, 1, 100); + r = poll (hv_kvp_poll_fd, 1, INFTIM); KVP_LOG(LOG_DEBUG, "poll returned r = %d, revent = 0x%x\n", r, hv_kvp_poll_fd[0].revents); From owner-svn-src-all@freebsd.org Mon Jun 13 03:03:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15E32AF0762; Mon, 13 Jun 2016 03:03:10 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B95A82BA4; Mon, 13 Jun 2016 03:03:09 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5D338WY087980; Mon, 13 Jun 2016 03:03:08 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5D338IN087978; Mon, 13 Jun 2016 03:03:08 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606130303.u5D338IN087978@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 13 Jun 2016 03:03:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301848 - stable/10/sys/dev/bge X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 03:03:10 -0000 Author: sephe Date: Mon Jun 13 03:03:08 2016 New Revision: 301848 URL: https://svnweb.freebsd.org/changeset/base/301848 Log: MFC 300985, 301103 r300985 bge: Support 5717 C0, which is almost same as 5720 A0 PR: 209758 Obtained from: DragonFlyBSD d79f5d8f5fe94cd6769207b2901422977d502bc0 MFC after: 1 week ============ r301103 bge: Force chipid to 5720 A0 for 5717 C0 in an early place Discussed with: yongari MFC after: 1 week Sponsored by: Microsoft OSTC Modified: stable/10/sys/dev/bge/if_bge.c stable/10/sys/dev/bge/if_bgereg.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/bge/if_bge.c ============================================================================== --- stable/10/sys/dev/bge/if_bge.c Mon Jun 13 02:54:58 2016 (r301847) +++ stable/10/sys/dev/bge/if_bge.c Mon Jun 13 03:03:08 2016 (r301848) @@ -170,6 +170,7 @@ static const struct bge_type { { BCOM_VENDORID, BCOM_DEVICEID_BCM5715 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5715S }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5717 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5717C }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5718 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5719 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5720 }, @@ -310,6 +311,7 @@ static const struct bge_revision { { BGE_CHIPID_BCM5715_A3, "BCM5715 A3" }, { BGE_CHIPID_BCM5717_A0, "BCM5717 A0" }, { BGE_CHIPID_BCM5717_B0, "BCM5717 B0" }, + { BGE_CHIPID_BCM5717_C0, "BCM5717 C0" }, { BGE_CHIPID_BCM5719_A0, "BCM5719 A0" }, { BGE_CHIPID_BCM5720_A0, "BCM5720 A0" }, { BGE_CHIPID_BCM5755_A0, "BCM5755 A0" }, @@ -2689,6 +2691,10 @@ bge_chipid(device_t dev) * registers. */ switch (pci_get_device(dev)) { + case BCOM_DEVICEID_BCM5717C: + /* 5717 C0 seems to belong to 5720 line. */ + id = BGE_CHIPID_BCM5720_A0; + break; case BCOM_DEVICEID_BCM5717: case BCOM_DEVICEID_BCM5718: case BCOM_DEVICEID_BCM5719: Modified: stable/10/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/10/sys/dev/bge/if_bgereg.h Mon Jun 13 02:54:58 2016 (r301847) +++ stable/10/sys/dev/bge/if_bgereg.h Mon Jun 13 03:03:08 2016 (r301848) @@ -329,6 +329,7 @@ #define BGE_CHIPID_BCM57780_A1 0x57780001 #define BGE_CHIPID_BCM5717_A0 0x05717000 #define BGE_CHIPID_BCM5717_B0 0x05717100 +#define BGE_CHIPID_BCM5717_C0 0x05717200 #define BGE_CHIPID_BCM5719_A0 0x05719000 #define BGE_CHIPID_BCM5720_A0 0x05720000 #define BGE_CHIPID_BCM5762_A0 0x05762000 @@ -2452,6 +2453,7 @@ struct bge_status_block { #define BCOM_DEVICEID_BCM5715 0x1678 #define BCOM_DEVICEID_BCM5715S 0x1679 #define BCOM_DEVICEID_BCM5717 0x1655 +#define BCOM_DEVICEID_BCM5717C 0x1665 #define BCOM_DEVICEID_BCM5718 0x1656 #define BCOM_DEVICEID_BCM5719 0x1657 #define BCOM_DEVICEID_BCM5720_PP 0x1658 /* Not released to public. */ From owner-svn-src-all@freebsd.org Mon Jun 13 03:17:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B118AF0BA5; Mon, 13 Jun 2016 03:17:01 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6BF2F2163; Mon, 13 Jun 2016 03:17:01 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5D3H0XB091895; Mon, 13 Jun 2016 03:17:00 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5D3H0Kw091894; Mon, 13 Jun 2016 03:17:00 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606130317.u5D3H0Kw091894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 13 Jun 2016 03:17:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301849 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 03:17:01 -0000 Author: adrian Date: Mon Jun 13 03:17:00 2016 New Revision: 301849 URL: https://svnweb.freebsd.org/changeset/base/301849 Log: [mips] set hardfloat for fpu instruction generation for gcc/binutils 5.x This allows -HEAD to be compiled again using the gcc-5 mips port compiler. Reviewed by: imp Approved by: re@ Modified: head/sys/mips/mips/swtch.S Modified: head/sys/mips/mips/swtch.S ============================================================================== --- head/sys/mips/mips/swtch.S Mon Jun 13 03:03:08 2016 (r301848) +++ head/sys/mips/mips/swtch.S Mon Jun 13 03:17:00 2016 (r301849) @@ -400,6 +400,7 @@ END(cpu_switch) * *---------------------------------------------------------------------------- */ +.set hardfloat LEAF(MipsSwitchFPState) mfc0 t1, MIPS_COP_0_STATUS # Save old SR li t0, MIPS_SR_COP_1_BIT # enable the coprocessor From owner-svn-src-all@freebsd.org Mon Jun 13 03:28:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B4D1AF0D32; Mon, 13 Jun 2016 03:28:38 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 455412636; Mon, 13 Jun 2016 03:28:38 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5D3SbLY095537; Mon, 13 Jun 2016 03:28:37 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5D3Sbj1095534; Mon, 13 Jun 2016 03:28:37 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606130328.u5D3Sbj1095534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 13 Jun 2016 03:28:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301850 - in stable/10/sys/dev/hyperv: netvsc vmbus X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 03:28:38 -0000 Author: sephe Date: Mon Jun 13 03:28:37 2016 New Revision: 301850 URL: https://svnweb.freebsd.org/changeset/base/301850 Log: MFC 294701,294702,294703,294705,294788 294701 hyperv/hn: Use m_copydata for chimney sending. While I'm here, move stack variables near their usage. Reviewed by: adrian, delphij, Jun Su Approved by: adrian (mentor) Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D4977 294702 hyperv/hn: Remove unnecessary zeroing out the netvsc_packet All used fields are setup one by one, so there is no need to zero out this large struct. While I'm here, move the stack variable near its usage. Reviewed by: adrian, delphij, Jun Su Approved by: adrian (mentor) Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D4978 294703 hyperv/hn: Trust host TCP segment checksum verification by default. According to all available information, VMSWITCH always does the TCP segment checksum verification before sending the segment to guest. Reviewed by: adrian, delphij, Hongjiang Zhang Approved by: adrian (mentor) Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D4991 294705 hyperv/vmbus: Avoid extra copy of page information. The page information array could contain up to 32 elements (i.e. 512B). And on network side w/ TSO, 11+ (176B+) elements, i.e. ~44K TSO packet, in the page information array is quite common. This saves us some cpu cycles. Reviewed by: adrian, delphij Approved by: adrian (mentor) Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D4992 294788 hyperv/hn: Improve sending performance - Avoid main lock contention by trylock for if_start, if that fails, schedule TX taskqueue for if_start - Don't do direct sending if the packet to be sent is large, e.g. TSO packet. This change gives me stable 9.1Gbps TCP sending performance w/ TSO over a 10Gbe directly connected network (the performance fluctuated between 4Gbps and 9Gbps before this commit). It also improves non- TSO TCP sending performance a lot. Reviewed by: adrian, royger Approved by: adrian (mentor) Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5074 Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c stable/10/sys/dev/hyperv/vmbus/hv_channel.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Jun 13 03:17:00 2016 (r301849) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Jun 13 03:28:37 2016 (r301850) @@ -39,9 +39,11 @@ #define __HV_NET_VSC_H__ #include +#include #include #include #include +#include #include #include @@ -1009,7 +1011,6 @@ typedef struct hn_softc { struct hv_device *hn_dev_obj; netvsc_dev *net_dev; - int hn_txdesc_cnt; struct hn_txdesc *hn_txdesc; bus_dma_tag_t hn_tx_data_dtag; bus_dma_tag_t hn_tx_rndis_dtag; @@ -1018,9 +1019,15 @@ typedef struct hn_softc { struct mtx hn_txlist_spin; struct hn_txdesc_list hn_txlist; + int hn_txdesc_cnt; int hn_txdesc_avail; int hn_txeof; + int hn_direct_tx_size; + struct taskqueue *hn_tx_taskq; + struct task hn_start_task; + struct task hn_txeof_task; + struct lro_ctrl hn_lro; int hn_lro_hiwat; Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 03:17:00 2016 (r301849) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 03:28:37 2016 (r301850) @@ -146,6 +146,8 @@ __FBSDID("$FreeBSD$"); #define HN_TX_DATA_SEGCNT_MAX \ (NETVSC_PACKET_MAXPAGE - HV_RF_NUM_TX_RESERVED_PAGE_BUFS) +#define HN_DIRECT_TX_SIZE_DEF 128 + struct hn_txdesc { SLIST_ENTRY(hn_txdesc) link; struct mbuf *m; @@ -194,6 +196,7 @@ struct hn_txdesc { #define NV_LOCK_INIT(_sc, _name) \ mtx_init(&(_sc)->hn_lock, _name, MTX_NETWORK_LOCK, MTX_DEF) #define NV_LOCK(_sc) mtx_lock(&(_sc)->hn_lock) +#define NV_TRYLOCK(_sc) mtx_trylock(&(_sc)->hn_lock) #define NV_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->hn_lock, MA_OWNED) #define NV_UNLOCK(_sc) mtx_unlock(&(_sc)->hn_lock) #define NV_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->hn_lock) @@ -206,7 +209,7 @@ struct hn_txdesc { int hv_promisc_mode = 0; /* normal mode by default */ /* Trust tcp segements verification on host side. */ -static int hn_trust_hosttcp = 0; +static int hn_trust_hosttcp = 1; TUNABLE_INT("dev.hn.trust_hosttcp", &hn_trust_hosttcp); #if __FreeBSD_version >= 1100045 @@ -219,6 +222,10 @@ TUNABLE_INT("dev.hn.tso_maxlen", &hn_tso static int hn_tx_chimney_size = 0; TUNABLE_INT("dev.hn.tx_chimney_size", &hn_tx_chimney_size); +/* Limit the size of packet for direct transmission */ +static int hn_direct_tx_size = HN_DIRECT_TX_SIZE_DEF; +TUNABLE_INT("dev.hn.direct_tx_size", &hn_direct_tx_size); + /* * Forward declarations */ @@ -226,8 +233,9 @@ static void hn_stop(hn_softc_t *sc); static void hn_ifinit_locked(hn_softc_t *sc); static void hn_ifinit(void *xsc); static int hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data); -static void hn_start_locked(struct ifnet *ifp); +static int hn_start_locked(struct ifnet *ifp, int len); static void hn_start(struct ifnet *ifp); +static void hn_start_txeof(struct ifnet *ifp); static int hn_ifmedia_upd(struct ifnet *ifp); static void hn_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr); #ifdef HN_LRO_HIWAT @@ -237,6 +245,8 @@ static int hn_tx_chimney_size_sysctl(SYS static int hn_check_iplen(const struct mbuf *, int); static int hn_create_tx_ring(struct hn_softc *sc); static void hn_destroy_tx_ring(struct hn_softc *sc); +static void hn_start_taskfunc(void *xsc, int pending); +static void hn_txeof_taskfunc(void *xsc, int pending); static __inline void hn_set_lro_hiwat(struct hn_softc *sc, int hiwat) @@ -384,6 +394,14 @@ netvsc_attach(device_t dev) sc->hn_dev = dev; sc->hn_lro_hiwat = HN_LRO_HIWAT_DEF; sc->hn_trust_hosttcp = hn_trust_hosttcp; + sc->hn_direct_tx_size = hn_direct_tx_size; + + sc->hn_tx_taskq = taskqueue_create_fast("hn_tx", M_WAITOK, + taskqueue_thread_enqueue, &sc->hn_tx_taskq); + taskqueue_start_threads(&sc->hn_tx_taskq, 1, PI_NET, "%s tx", + device_get_nameunit(dev)); + TASK_INIT(&sc->hn_start_task, 0, hn_start_taskfunc, sc); + TASK_INIT(&sc->hn_txeof_task, 0, hn_txeof_taskfunc, sc); error = hn_create_tx_ring(sc); if (error) @@ -524,6 +542,9 @@ netvsc_attach(device_t dev) SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "tx_chimney_size", CTLTYPE_INT | CTLFLAG_RW, sc, 0, hn_tx_chimney_size_sysctl, "I", "Chimney send packet size limit"); + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "direct_tx_size", + CTLFLAG_RW, &sc->hn_direct_tx_size, 0, + "Size of the packet for direct transmission"); if (unit == 0) { struct sysctl_ctx_list *dc_ctx; @@ -548,6 +569,9 @@ netvsc_attach(device_t dev) SYSCTL_ADD_INT(dc_ctx, dc_child, OID_AUTO, "tso_maxlen", CTLFLAG_RD, &hn_tso_maxlen, 0, "TSO burst limit"); #endif + SYSCTL_ADD_INT(dc_ctx, dc_child, OID_AUTO, "direct_tx_size", + CTLFLAG_RD, &hn_direct_tx_size, 0, + "Size of the packet for direct transmission"); } return (0); @@ -583,6 +607,10 @@ netvsc_detach(device_t dev) hv_rf_on_device_remove(hv_device, HV_RF_NV_DESTROY_CHANNEL); + taskqueue_drain(sc->hn_tx_taskq, &sc->hn_start_task); + taskqueue_drain(sc->hn_tx_taskq, &sc->hn_txeof_task); + taskqueue_free(sc->hn_tx_taskq); + ifmedia_removeall(&sc->hn_media); #if defined(INET) || defined(INET6) tcp_lro_free(&sc->hn_lro); @@ -733,30 +761,23 @@ void netvsc_channel_rollup(struct hv_device *device_ctx) { struct hn_softc *sc = device_get_softc(device_ctx->device); - struct ifnet *ifp; if (!sc->hn_txeof) return; sc->hn_txeof = 0; - ifp = sc->hn_ifp; - NV_LOCK(sc); - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - hn_start_locked(ifp); - NV_UNLOCK(sc); + hn_start_txeof(sc->hn_ifp); } /* * Start a transmit of one or more packets */ -static void -hn_start_locked(struct ifnet *ifp) +static int +hn_start_locked(struct ifnet *ifp, int len) { hn_softc_t *sc = ifp->if_softc; struct hv_device *device_ctx = vmbus_get_devctx(sc->hn_dev); netvsc_dev *net_dev = sc->net_dev; - netvsc_packet *packet; - struct mbuf *m_head, *m; struct ether_vlan_header *eh; rndis_msg *rndis_mesg; rndis_packet *rndis_pkt; @@ -767,36 +788,42 @@ hn_start_locked(struct ifnet *ifp) int ether_len; uint32_t rndis_msg_size = 0; uint32_t trans_proto_type; - uint32_t send_buf_section_idx = - NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX; if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) - return; + return 0; while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { bus_dma_segment_t segs[HN_TX_DATA_SEGCNT_MAX]; int error, nsegs, i, send_failed = 0; struct hn_txdesc *txd; + netvsc_packet *packet; + struct mbuf *m_head; IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); if (m_head == NULL) break; + if (len > 0 && m_head->m_pkthdr.len > len) { + /* + * This sending could be time consuming; let callers + * dispatch this packet sending (and sending of any + * following up packets) to tx taskqueue. + */ + IF_PREPEND(&ifp->if_snd, m_head); + return 1; + } + txd = hn_txdesc_get(sc); if (txd == NULL) { sc->hn_no_txdescs++; IF_PREPEND(&ifp->if_snd, m_head); - ifp->if_drv_flags |= IFF_DRV_OACTIVE; + atomic_set_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); break; } packet = &txd->netvsc_pkt; - /* XXX not necessary */ - memset(packet, 0, sizeof(*packet)); - packet->is_data_pkt = TRUE; - /* Initialize it from the mbuf */ packet->tot_data_buf_len = m_head->m_pkthdr.len; @@ -940,24 +967,21 @@ pre_send: /* send packet with send buffer */ if (packet->tot_data_buf_len < sc->hn_tx_chimney_size) { + uint32_t send_buf_section_idx; + send_buf_section_idx = hv_nv_get_next_send_section(net_dev); if (send_buf_section_idx != NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX) { - char *dest = ((char *)net_dev->send_buf + - send_buf_section_idx * - net_dev->send_section_size); + uint8_t *dest = ((uint8_t *)net_dev->send_buf + + (send_buf_section_idx * + net_dev->send_section_size)); memcpy(dest, rndis_mesg, rndis_msg_size); dest += rndis_msg_size; - for (m = m_head; m != NULL; m = m->m_next) { - if (m->m_len) { - memcpy(dest, - (void *)mtod(m, vm_offset_t), - m->m_len); - dest += m->m_len; - } - } + + m_copydata(m_head, 0, m_head->m_pkthdr.len, + dest); packet->send_buf_section_idx = send_buf_section_idx; @@ -1069,10 +1093,11 @@ again: sc->hn_send_failed++; IF_PREPEND(&ifp->if_snd, m_head); - ifp->if_drv_flags |= IFF_DRV_OACTIVE; + atomic_set_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); break; } } + return 0; } /* @@ -1566,7 +1591,8 @@ hn_stop(hn_softc_t *sc) if (bootverbose) printf(" Closing Device ...\n"); - ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + atomic_clear_int(&ifp->if_drv_flags, + (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)); if_link_state_change(ifp, LINK_STATE_DOWN); sc->hn_initdone = 0; @@ -1582,13 +1608,43 @@ hn_start(struct ifnet *ifp) hn_softc_t *sc; sc = ifp->if_softc; - NV_LOCK(sc); - if (sc->temp_unusable) { + if (NV_TRYLOCK(sc)) { + int sched; + + sched = hn_start_locked(ifp, sc->hn_direct_tx_size); NV_UNLOCK(sc); - return; + if (!sched) + return; + } + taskqueue_enqueue_fast(sc->hn_tx_taskq, &sc->hn_start_task); +} + +static void +hn_start_txeof(struct ifnet *ifp) +{ + hn_softc_t *sc; + + sc = ifp->if_softc; + if (NV_TRYLOCK(sc)) { + int sched; + + atomic_clear_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); + sched = hn_start_locked(ifp, sc->hn_direct_tx_size); + NV_UNLOCK(sc); + if (sched) { + taskqueue_enqueue_fast(sc->hn_tx_taskq, + &sc->hn_start_task); + } + } else { + /* + * Release the OACTIVE earlier, with the hope, that + * others could catch up. The task will clear the + * flag again with the NV_LOCK to avoid possible + * races. + */ + atomic_clear_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); + taskqueue_enqueue_fast(sc->hn_tx_taskq, &sc->hn_txeof_task); } - hn_start_locked(ifp); - NV_UNLOCK(sc); } /* @@ -1615,8 +1671,8 @@ hn_ifinit_locked(hn_softc_t *sc) } else { sc->hn_initdone = 1; } - ifp->if_drv_flags |= IFF_DRV_RUNNING; - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + atomic_clear_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); + atomic_set_int(&ifp->if_drv_flags, IFF_DRV_RUNNING); if_link_state_change(ifp, LINK_STATE_UP); } @@ -1918,6 +1974,28 @@ hn_destroy_tx_ring(struct hn_softc *sc) mtx_destroy(&sc->hn_txlist_spin); } +static void +hn_start_taskfunc(void *xsc, int pending __unused) +{ + struct hn_softc *sc = xsc; + + NV_LOCK(sc); + hn_start_locked(sc->hn_ifp, 0); + NV_UNLOCK(sc); +} + +static void +hn_txeof_taskfunc(void *xsc, int pending __unused) +{ + struct hn_softc *sc = xsc; + struct ifnet *ifp = sc->hn_ifp; + + NV_LOCK(sc); + atomic_clear_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); + hn_start_locked(ifp, 0); + NV_UNLOCK(sc); +} + static device_method_t netvsc_methods[] = { /* Device interface */ DEVMETHOD(device_probe, netvsc_probe), Modified: stable/10/sys/dev/hyperv/vmbus/hv_channel.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_channel.c Mon Jun 13 03:17:00 2016 (r301849) +++ stable/10/sys/dev/hyperv/vmbus/hv_channel.c Mon Jun 13 03:28:37 2016 (r301850) @@ -666,11 +666,11 @@ hv_vmbus_channel_send_packet_pagebuffer( { int ret = 0; - int i = 0; boolean_t need_sig; uint32_t packet_len; + uint32_t page_buflen; uint32_t packetLen_aligned; - hv_vmbus_sg_buffer_list buffer_list[3]; + hv_vmbus_sg_buffer_list buffer_list[4]; hv_vmbus_channel_packet_page_buffer desc; uint32_t descSize; uint64_t alignedData = 0; @@ -682,36 +682,33 @@ hv_vmbus_channel_send_packet_pagebuffer( * Adjust the size down since hv_vmbus_channel_packet_page_buffer * is the largest size we support */ - descSize = sizeof(hv_vmbus_channel_packet_page_buffer) - - ((HV_MAX_PAGE_BUFFER_COUNT - page_count) * - sizeof(hv_vmbus_page_buffer)); - packet_len = descSize + buffer_len; + descSize = __offsetof(hv_vmbus_channel_packet_page_buffer, range); + page_buflen = sizeof(hv_vmbus_page_buffer) * page_count; + packet_len = descSize + page_buflen + buffer_len; packetLen_aligned = HV_ALIGN_UP(packet_len, sizeof(uint64_t)); /* Setup the descriptor */ desc.type = HV_VMBUS_PACKET_TYPE_DATA_USING_GPA_DIRECT; desc.flags = HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED; - desc.data_offset8 = descSize >> 3; /* in 8-bytes granularity */ + /* in 8-bytes granularity */ + desc.data_offset8 = (descSize + page_buflen) >> 3; desc.length8 = (uint16_t) (packetLen_aligned >> 3); desc.transaction_id = request_id; desc.range_count = page_count; - for (i = 0; i < page_count; i++) { - desc.range[i].length = page_buffers[i].length; - desc.range[i].offset = page_buffers[i].offset; - desc.range[i].pfn = page_buffers[i].pfn; - } - buffer_list[0].data = &desc; buffer_list[0].length = descSize; - buffer_list[1].data = buffer; - buffer_list[1].length = buffer_len; + buffer_list[1].data = page_buffers; + buffer_list[1].length = page_buflen; - buffer_list[2].data = &alignedData; - buffer_list[2].length = packetLen_aligned - packet_len; + buffer_list[2].data = buffer; + buffer_list[2].length = buffer_len; - ret = hv_ring_buffer_write(&channel->outbound, buffer_list, 3, + buffer_list[3].data = &alignedData; + buffer_list[3].length = packetLen_aligned - packet_len; + + ret = hv_ring_buffer_write(&channel->outbound, buffer_list, 4, &need_sig); /* TODO: We should determine if this is optional */ From owner-svn-src-all@freebsd.org Mon Jun 13 03:39:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4893AF0F19; Mon, 13 Jun 2016 03:39:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5CB62A26; Mon, 13 Jun 2016 03:39:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5D3dGgr099395; Mon, 13 Jun 2016 03:39:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5D3dGCf099394; Mon, 13 Jun 2016 03:39:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606130339.u5D3dGCf099394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 13 Jun 2016 03:39:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301851 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 03:39:17 -0000 Author: kib Date: Mon Jun 13 03:39:16 2016 New Revision: 301851 URL: https://svnweb.freebsd.org/changeset/base/301851 Log: Explicitely initialize sw_alloc_sx. Currently it is not initialized but works due to zeroed out bss on startup. Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (hrs) Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Mon Jun 13 03:28:37 2016 (r301850) +++ head/sys/vm/swap_pager.c Mon Jun 13 03:39:16 2016 (r301851) @@ -488,6 +488,7 @@ swap_pager_init(void) TAILQ_INIT(&swap_pager_object_list[i]); mtx_init(&sw_alloc_mtx, "swap_pager list", NULL, MTX_DEF); mtx_init(&sw_dev_mtx, "swapdev", NULL, MTX_DEF); + sx_init(&sw_alloc_sx, "swspsx"); sx_init(&swdev_syscall_lock, "swsysc"); /* From owner-svn-src-all@freebsd.org Mon Jun 13 03:42:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 627D9AF1142; Mon, 13 Jun 2016 03:42:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F59C2DFD; Mon, 13 Jun 2016 03:42:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5D3gk2s002858; Mon, 13 Jun 2016 03:42:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5D3gkAI002857; Mon, 13 Jun 2016 03:42:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606130342.u5D3gkAI002857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 13 Jun 2016 03:42:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301852 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 03:42:47 -0000 Author: kib Date: Mon Jun 13 03:42:46 2016 New Revision: 301852 URL: https://svnweb.freebsd.org/changeset/base/301852 Log: Fix inconsistent locking of the swap pager named objects list. Right now, all modifications of the list are locked by sw_alloc_mtx. But initial lookup of the object by the handle in swap_pager_alloc() is not protected by sw_alloc_mtx, which means that vm_pager_object_lookup() could follow freed pointer. Create a new named swap object with the OBJT_SWAP type, instead of OBJT_DEFAULT. With this change, swp_pager_meta_build() never need to upgrade named OBJT_DEFAULT to OBJT_SWAP (in the other place, we do not forbid for client code to create named OBJT_DEFAULT objects at all). That change allows to remove sw_alloc_mtx and make the list locked by sw_alloc_sx lock. Update swap_pager_copy() to new locking mode. Create helper swap_pager_alloc_init() to consolidate named and anonymous swap objects creation, while a caller ensures that the neccesary locks are held around the helper. Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Approved by: re (hrs) Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Mon Jun 13 03:39:16 2016 (r301851) +++ head/sys/vm/swap_pager.c Mon Jun 13 03:42:46 2016 (r301852) @@ -345,7 +345,6 @@ static struct sx sw_alloc_sx; #define NOBJLIST(handle) \ (&swap_pager_object_list[((int)(intptr_t)handle >> 4) & (NOBJLISTS-1)]) -static struct mtx sw_alloc_mtx; /* protect list manipulation */ static struct pagerlst swap_pager_object_list[NOBJLISTS]; static uma_zone_t swap_zone; @@ -486,7 +485,6 @@ swap_pager_init(void) for (i = 0; i < NOBJLISTS; ++i) TAILQ_INIT(&swap_pager_object_list[i]); - mtx_init(&sw_alloc_mtx, "swap_pager list", NULL, MTX_DEF); mtx_init(&sw_dev_mtx, "swapdev", NULL, MTX_DEF); sx_init(&sw_alloc_sx, "swspsx"); sx_init(&swdev_syscall_lock, "swsysc"); @@ -583,28 +581,46 @@ swap_pager_swap_init(void) mtx_init(&swhash_mtx, "swap_pager swhash", NULL, MTX_DEF); } +static vm_object_t +swap_pager_alloc_init(void *handle, struct ucred *cred, vm_ooffset_t size, + vm_ooffset_t offset) +{ + vm_object_t object; + + if (cred != NULL) { + if (!swap_reserve_by_cred(size, cred)) + return (NULL); + crhold(cred); + } + object = vm_object_allocate(OBJT_SWAP, OFF_TO_IDX(offset + + PAGE_MASK + size)); + object->handle = handle; + if (cred != NULL) { + object->cred = cred; + object->charge = size; + } + object->un_pager.swp.swp_bcount = 0; + return (object); +} + /* * SWAP_PAGER_ALLOC() - allocate a new OBJT_SWAP VM object and instantiate * its metadata structures. * * This routine is called from the mmap and fork code to create a new - * OBJT_SWAP object. We do this by creating an OBJT_DEFAULT object - * and then converting it with swp_pager_meta_build(). - * - * This routine may block in vm_object_allocate() and create a named - * object lookup race, so we must interlock. + * OBJT_SWAP object. * - * MPSAFE + * This routine must ensure that no live duplicate is created for + * the named object request, which is protected against by + * holding the sw_alloc_sx lock in case handle != NULL. */ static vm_object_t swap_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot, vm_ooffset_t offset, struct ucred *cred) { vm_object_t object; - vm_pindex_t pindex; - pindex = OFF_TO_IDX(offset + PAGE_MASK + size); - if (handle) { + if (handle != NULL) { /* * Reference existing named region or allocate new one. There * should not be a race here against swp_pager_meta_build() @@ -614,38 +630,16 @@ swap_pager_alloc(void *handle, vm_ooffse sx_xlock(&sw_alloc_sx); object = vm_pager_object_lookup(NOBJLIST(handle), handle); if (object == NULL) { - if (cred != NULL) { - if (!swap_reserve_by_cred(size, cred)) { - sx_xunlock(&sw_alloc_sx); - return (NULL); - } - crhold(cred); - } - object = vm_object_allocate(OBJT_DEFAULT, pindex); - VM_OBJECT_WLOCK(object); - object->handle = handle; - if (cred != NULL) { - object->cred = cred; - object->charge = size; + object = swap_pager_alloc_init(handle, cred, size, + offset); + if (object != NULL) { + TAILQ_INSERT_TAIL(NOBJLIST(object->handle), + object, pager_object_list); } - swp_pager_meta_build(object, 0, SWAPBLK_NONE); - VM_OBJECT_WUNLOCK(object); } sx_xunlock(&sw_alloc_sx); } else { - if (cred != NULL) { - if (!swap_reserve_by_cred(size, cred)) - return (NULL); - crhold(cred); - } - object = vm_object_allocate(OBJT_DEFAULT, pindex); - VM_OBJECT_WLOCK(object); - if (cred != NULL) { - object->cred = cred; - object->charge = size; - } - swp_pager_meta_build(object, 0, SWAPBLK_NONE); - VM_OBJECT_WUNLOCK(object); + object = swap_pager_alloc_init(handle, cred, size, offset); } return (object); } @@ -664,17 +658,22 @@ static void swap_pager_dealloc(vm_object_t object) { + VM_OBJECT_ASSERT_WLOCKED(object); + KASSERT((object->flags & OBJ_DEAD) != 0, ("dealloc of reachable obj")); + /* * Remove from list right away so lookups will fail if we block for * pageout completion. */ if (object->handle != NULL) { - mtx_lock(&sw_alloc_mtx); - TAILQ_REMOVE(NOBJLIST(object->handle), object, pager_object_list); - mtx_unlock(&sw_alloc_mtx); + VM_OBJECT_WUNLOCK(object); + sx_xlock(&sw_alloc_sx); + TAILQ_REMOVE(NOBJLIST(object->handle), object, + pager_object_list); + sx_xunlock(&sw_alloc_sx); + VM_OBJECT_WLOCK(object); } - VM_OBJECT_ASSERT_WLOCKED(object); vm_object_pip_wait(object, "swpdea"); /* @@ -901,16 +900,19 @@ swap_pager_copy(vm_object_t srcobject, v * If destroysource is set, we remove the source object from the * swap_pager internal queue now. */ - if (destroysource) { - if (srcobject->handle != NULL) { - mtx_lock(&sw_alloc_mtx); - TAILQ_REMOVE( - NOBJLIST(srcobject->handle), - srcobject, - pager_object_list - ); - mtx_unlock(&sw_alloc_mtx); - } + if (destroysource && srcobject->handle != NULL) { + vm_object_pip_add(srcobject, 1); + VM_OBJECT_WUNLOCK(srcobject); + vm_object_pip_add(dstobject, 1); + VM_OBJECT_WUNLOCK(dstobject); + sx_xlock(&sw_alloc_sx); + TAILQ_REMOVE(NOBJLIST(srcobject->handle), srcobject, + pager_object_list); + sx_xunlock(&sw_alloc_sx); + VM_OBJECT_WLOCK(dstobject); + vm_object_pip_wakeup(dstobject); + VM_OBJECT_WLOCK(srcobject); + vm_object_pip_wakeup(srcobject); } /* @@ -1746,16 +1748,7 @@ swp_pager_meta_build(vm_object_t object, if (object->type != OBJT_SWAP) { object->type = OBJT_SWAP; object->un_pager.swp.swp_bcount = 0; - - if (object->handle != NULL) { - mtx_lock(&sw_alloc_mtx); - TAILQ_INSERT_TAIL( - NOBJLIST(object->handle), - object, - pager_object_list - ); - mtx_unlock(&sw_alloc_mtx); - } + KASSERT(object->handle == NULL, ("default pager with handle")); } /* From owner-svn-src-all@freebsd.org Mon Jun 13 03:45:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1852CAF11D8; Mon, 13 Jun 2016 03:45:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E84EF2F7B; Mon, 13 Jun 2016 03:45:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5D3j9WF003032; Mon, 13 Jun 2016 03:45:09 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5D3j9hC003031; Mon, 13 Jun 2016 03:45:09 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606130345.u5D3j9hC003031@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 13 Jun 2016 03:45:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301853 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 03:45:10 -0000 Author: kib Date: Mon Jun 13 03:45:08 2016 New Revision: 301853 URL: https://svnweb.freebsd.org/changeset/base/301853 Log: Do not access pv_table array for fictitious pages, since the array does not cover the dynamically registered ficititious ranges, and fictitious pages mappings are not promoted. Offer a dummy struct md_page to fetch constant superpage pv list generation to satisfy logic. Also, by initializing the pv_dummy pv_list to empty, we can remove several explicit PG_FICTITIOUS tests. Reported and tested by: Michael Butler (previous version) Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D6728 Approved by: re (hrs) Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Jun 13 03:42:46 2016 (r301852) +++ head/sys/amd64/amd64/pmap.c Mon Jun 13 03:45:08 2016 (r301853) @@ -386,6 +386,7 @@ static struct mtx pv_chunks_mutex; static struct rwlock pv_list_locks[NPV_LIST_LOCKS]; static u_long pv_invl_gen[NPV_LIST_LOCKS]; static struct md_page *pv_table; +static struct md_page pv_dummy; /* * All those kernel PT submaps that BSD is so fond of @@ -1264,6 +1265,7 @@ pmap_init(void) M_WAITOK | M_ZERO); for (i = 0; i < pv_npg; i++) TAILQ_INIT(&pv_table[i].pv_list); + TAILQ_INIT(&pv_dummy.pv_list); pmap_initialized = 1; for (i = 0; i < PMAP_PREINIT_MAPPING_COUNT; i++) { @@ -3920,11 +3922,10 @@ pmap_remove_all(vm_page_t m) ("pmap_remove_all: page %p is not managed", m)); SLIST_INIT(&free); lock = VM_PAGE_TO_PV_LIST_LOCK(m); - pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); + pvh = (m->flags & PG_FICTITIOUS) != 0 ? &pv_dummy : + pa_to_pvh(VM_PAGE_TO_PHYS(m)); retry: rw_wlock(lock); - if ((m->flags & PG_FICTITIOUS) != 0) - goto small_mappings; while ((pv = TAILQ_FIRST(&pvh->pv_list)) != NULL) { pmap = PV_PMAP(pv); if (!PMAP_TRYLOCK(pmap)) { @@ -3943,7 +3944,6 @@ retry: (void)pmap_demote_pde_locked(pmap, pde, va, &lock); PMAP_UNLOCK(pmap); } -small_mappings: while ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) { pmap = PV_PMAP(pv); if (!PMAP_TRYLOCK(pmap)) { @@ -5743,11 +5743,10 @@ pmap_remove_write(vm_page_t m) if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) return; lock = VM_PAGE_TO_PV_LIST_LOCK(m); - pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); + pvh = (m->flags & PG_FICTITIOUS) != 0 ? &pv_dummy : + pa_to_pvh(VM_PAGE_TO_PHYS(m)); retry_pv_loop: rw_wlock(lock); - if ((m->flags & PG_FICTITIOUS) != 0) - goto small_mappings; TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_next, next_pv) { pmap = PV_PMAP(pv); if (!PMAP_TRYLOCK(pmap)) { @@ -5771,7 +5770,6 @@ retry_pv_loop: lock, VM_PAGE_TO_PV_LIST_LOCK(m), m)); PMAP_UNLOCK(pmap); } -small_mappings: TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) { pmap = PV_PMAP(pv); if (!PMAP_TRYLOCK(pmap)) { @@ -5877,12 +5875,11 @@ pmap_ts_referenced(vm_page_t m) cleared = 0; pa = VM_PAGE_TO_PHYS(m); lock = PHYS_TO_PV_LIST_LOCK(pa); - pvh = pa_to_pvh(pa); + pvh = (m->flags & PG_FICTITIOUS) != 0 ? &pv_dummy : pa_to_pvh(pa); rw_wlock(lock); retry: not_cleared = 0; - if ((m->flags & PG_FICTITIOUS) != 0 || - (pvf = TAILQ_FIRST(&pvh->pv_list)) == NULL) + if ((pvf = TAILQ_FIRST(&pvh->pv_list)) == NULL) goto small_mappings; pv = pvf; do { @@ -6194,12 +6191,11 @@ pmap_clear_modify(vm_page_t m) */ if ((m->aflags & PGA_WRITEABLE) == 0) return; - pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); + pvh = (m->flags & PG_FICTITIOUS) != 0 ? &pv_dummy : + pa_to_pvh(VM_PAGE_TO_PHYS(m)); lock = VM_PAGE_TO_PV_LIST_LOCK(m); rw_wlock(lock); restart: - if ((m->flags & PG_FICTITIOUS) != 0) - goto small_mappings; TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_next, next_pv) { pmap = PV_PMAP(pv); if (!PMAP_TRYLOCK(pmap)) { @@ -6243,7 +6239,6 @@ restart: } PMAP_UNLOCK(pmap); } -small_mappings: TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) { pmap = PV_PMAP(pv); if (!PMAP_TRYLOCK(pmap)) { From owner-svn-src-all@freebsd.org Mon Jun 13 05:06:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68154AF1C84; Mon, 13 Jun 2016 05:06:09 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 387672981; Mon, 13 Jun 2016 05:06:09 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5D5686B032613; Mon, 13 Jun 2016 05:06:08 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5D567nv032607; Mon, 13 Jun 2016 05:06:07 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606130506.u5D567nv032607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 13 Jun 2016 05:06:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301854 - in stable/10/sys/dev/hyperv: include vmbus X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 05:06:09 -0000 Author: sephe Date: Mon Jun 13 05:06:07 2016 New Revision: 301854 URL: https://svnweb.freebsd.org/changeset/base/301854 Log: MFC 294886 hyperv/vmbus: Event handling code refactor. - Use taskqueue instead of swi for event handling. - Scan the interrupt flags in filter - Disable ringbuffer interrupt mask in filter to ensure no unnecessary interrupts. Submitted by: Jun Su Reviewed by: adrian, sephe, Dexuan Approved by: adrian (mentor) MFC after: 2 weeks Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D4920 Modified: stable/10/sys/dev/hyperv/include/hyperv.h stable/10/sys/dev/hyperv/vmbus/hv_channel.c stable/10/sys/dev/hyperv/vmbus/hv_connection.c stable/10/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c stable/10/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/include/hyperv.h ============================================================================== --- stable/10/sys/dev/hyperv/include/hyperv.h Mon Jun 13 03:45:08 2016 (r301853) +++ stable/10/sys/dev/hyperv/include/hyperv.h Mon Jun 13 05:06:07 2016 (r301854) @@ -755,6 +755,8 @@ typedef struct hv_vmbus_channel { struct mtx inbound_lock; + struct taskqueue * rxq; + struct task channel_task; hv_vmbus_pfn_channel_callback on_channel_callback; void* channel_callback_context; Modified: stable/10/sys/dev/hyperv/vmbus/hv_channel.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_channel.c Mon Jun 13 03:45:08 2016 (r301853) +++ stable/10/sys/dev/hyperv/vmbus/hv_channel.c Mon Jun 13 05:06:07 2016 (r301854) @@ -52,6 +52,7 @@ static int vmbus_channel_create_gpadl_h uint32_t* message_count); static void vmbus_channel_set_event(hv_vmbus_channel* channel); +static void VmbusProcessChannelEvent(void* channel, int pending); /** * @brief Trigger an event notification on the specified channel @@ -115,6 +116,9 @@ hv_vmbus_channel_open( new_channel->on_channel_callback = pfn_on_channel_callback; new_channel->channel_callback_context = context; + new_channel->rxq = hv_vmbus_g_context.hv_event_queue[new_channel->target_cpu]; + TASK_INIT(&new_channel->channel_task, 0, VmbusProcessChannelEvent, new_channel); + /* Allocate the ring buffer */ out = contigmalloc((send_ring_buffer_size + recv_ring_buffer_size), M_DEVBUF, M_ZERO, 0UL, BUS_SPACE_MAXADDR, PAGE_SIZE, 0); @@ -518,6 +522,7 @@ static void hv_vmbus_channel_close_internal(hv_vmbus_channel *channel) { int ret = 0; + struct taskqueue *rxq = channel->rxq; hv_vmbus_channel_close_channel* msg; hv_vmbus_channel_msg_info* info; @@ -525,6 +530,11 @@ hv_vmbus_channel_close_internal(hv_vmbus channel->sc_creation_callback = NULL; /* + * set rxq to NULL to avoid more requests be scheduled + */ + channel->rxq = NULL; + taskqueue_drain(rxq, &channel->channel_task); + /* * Grab the lock to prevent race condition when a packet received * and unloading driver is in the process. */ @@ -877,3 +887,67 @@ hv_vmbus_channel_recv_packet_raw( return (0); } + + +/** + * Process a channel event notification + */ +static void +VmbusProcessChannelEvent(void* context, int pending) +{ + void* arg; + uint32_t bytes_to_read; + hv_vmbus_channel* channel = (hv_vmbus_channel*)context; + boolean_t is_batched_reading; + + /** + * Find the channel based on this relid and invokes + * the channel callback to process the event + */ + + if (channel == NULL) { + return; + } + /** + * To deal with the race condition where we might + * receive a packet while the relevant driver is + * being unloaded, dispatch the callback while + * holding the channel lock. The unloading driver + * will acquire the same channel lock to set the + * callback to NULL. This closes the window. + */ + + /* + * Disable the lock due to newly added WITNESS check in r277723. + * Will seek other way to avoid race condition. + * -- whu + */ + // mtx_lock(&channel->inbound_lock); + if (channel->on_channel_callback != NULL) { + arg = channel->channel_callback_context; + is_batched_reading = channel->batched_reading; + /* + * Optimize host to guest signaling by ensuring: + * 1. While reading the channel, we disable interrupts from + * host. + * 2. Ensure that we process all posted messages from the host + * before returning from this callback. + * 3. Once we return, enable signaling from the host. Once this + * state is set we check to see if additional packets are + * available to read. In this case we repeat the process. + */ + do { + if (is_batched_reading) + hv_ring_buffer_read_begin(&channel->inbound); + + channel->on_channel_callback(arg); + + if (is_batched_reading) + bytes_to_read = + hv_ring_buffer_read_end(&channel->inbound); + else + bytes_to_read = 0; + } while (is_batched_reading && (bytes_to_read != 0)); + } + // mtx_unlock(&channel->inbound_lock); +} Modified: stable/10/sys/dev/hyperv/vmbus/hv_connection.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_connection.c Mon Jun 13 03:45:08 2016 (r301853) +++ stable/10/sys/dev/hyperv/vmbus/hv_connection.c Mon Jun 13 05:06:07 2016 (r301854) @@ -339,78 +339,12 @@ hv_vmbus_disconnect(void) { } /** - * Process a channel event notification - */ -static void -VmbusProcessChannelEvent(uint32_t relid) -{ - void* arg; - uint32_t bytes_to_read; - hv_vmbus_channel* channel; - boolean_t is_batched_reading; - - /** - * Find the channel based on this relid and invokes - * the channel callback to process the event - */ - - channel = hv_vmbus_g_connection.channels[relid]; - - if (channel == NULL) { - return; - } - /** - * To deal with the race condition where we might - * receive a packet while the relevant driver is - * being unloaded, dispatch the callback while - * holding the channel lock. The unloading driver - * will acquire the same channel lock to set the - * callback to NULL. This closes the window. - */ - - /* - * Disable the lock due to newly added WITNESS check in r277723. - * Will seek other way to avoid race condition. - * -- whu - */ - // mtx_lock(&channel->inbound_lock); - if (channel->on_channel_callback != NULL) { - arg = channel->channel_callback_context; - is_batched_reading = channel->batched_reading; - /* - * Optimize host to guest signaling by ensuring: - * 1. While reading the channel, we disable interrupts from - * host. - * 2. Ensure that we process all posted messages from the host - * before returning from this callback. - * 3. Once we return, enable signaling from the host. Once this - * state is set we check to see if additional packets are - * available to read. In this case we repeat the process. - */ - do { - if (is_batched_reading) - hv_ring_buffer_read_begin(&channel->inbound); - - channel->on_channel_callback(arg); - - if (is_batched_reading) - bytes_to_read = - hv_ring_buffer_read_end(&channel->inbound); - else - bytes_to_read = 0; - } while (is_batched_reading && (bytes_to_read != 0)); - } - // mtx_unlock(&channel->inbound_lock); -} - -/** * Handler for events */ void -hv_vmbus_on_events(void *arg) +hv_vmbus_on_events(int cpu) { int bit; - int cpu; int dword; void *page_addr; uint32_t* recv_interrupt_page = NULL; @@ -419,7 +353,6 @@ hv_vmbus_on_events(void *arg) hv_vmbus_synic_event_flags *event; /* int maxdword = PAGE_SIZE >> 3; */ - cpu = (int)(long)arg; KASSERT(cpu <= mp_maxid, ("VMBUS: hv_vmbus_on_events: " "cpu out of range!")); @@ -461,8 +394,14 @@ hv_vmbus_on_events(void *arg) */ continue; } else { - VmbusProcessChannelEvent(rel_id); - + hv_vmbus_channel * channel = hv_vmbus_g_connection.channels[rel_id]; + /* if channel is closed or closing */ + if (channel == NULL || channel->rxq == NULL) + continue; + + if (channel->batched_reading) + hv_ring_buffer_read_begin(&channel->inbound); + taskqueue_enqueue_fast(channel->rxq, &channel->channel_task); } } } Modified: stable/10/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Mon Jun 13 03:45:08 2016 (r301853) +++ stable/10/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Mon Jun 13 05:06:07 2016 (r301854) @@ -177,7 +177,7 @@ hv_vmbus_isr(struct trapframe *frame) (hv_vmbus_protocal_version == HV_VMBUS_VERSION_WIN7)) { /* Since we are a child, we only need to check bit 0 */ if (synch_test_and_clear_bit(0, &event->flags32[0])) { - swi_sched(hv_vmbus_g_context.event_swintr[cpu], 0); + hv_vmbus_on_events(cpu); } } else { /* @@ -187,7 +187,7 @@ hv_vmbus_isr(struct trapframe *frame) * Directly schedule the event software interrupt on * current cpu. */ - swi_sched(hv_vmbus_g_context.event_swintr[cpu], 0); + hv_vmbus_on_events(cpu); } /* Check if there are actual msgs to be process */ @@ -225,7 +225,6 @@ hv_vmbus_isr(struct trapframe *frame) return (FILTER_HANDLED); } -uint32_t hv_vmbus_swintr_event_cpu[MAXCPU]; u_long *hv_vmbus_intr_cpu[MAXCPU]; void @@ -455,6 +454,19 @@ vmbus_vector_free(int vector) #endif /* HYPERV */ +static void +vmbus_cpuset_setthread_task(void *xmask, int pending __unused) +{ + cpuset_t *mask = xmask; + int error; + + error = cpuset_setthread(curthread->td_tid, mask); + if (error) { + panic("curthread=%ju: can't pin; error=%d", + (uintmax_t)curthread->td_tid, error); + } +} + /** * @brief Main vmbus driver initialization routine. * @@ -472,6 +484,7 @@ vmbus_bus_init(void) { int i, j, n, ret; char buf[MAXCOMLEN + 1]; + cpuset_t cpu_mask; if (vmbus_inited) return (0); @@ -508,10 +521,7 @@ vmbus_bus_init(void) setup_args.vector = hv_vmbus_g_context.hv_cb_vector; CPU_FOREACH(j) { - hv_vmbus_swintr_event_cpu[j] = 0; - hv_vmbus_g_context.hv_event_intr_event[j] = NULL; hv_vmbus_g_context.hv_msg_intr_event[j] = NULL; - hv_vmbus_g_context.event_swintr[j] = NULL; hv_vmbus_g_context.msg_swintr[j] = NULL; snprintf(buf, sizeof(buf), "cpu%d:hyperv", j); @@ -525,6 +535,26 @@ vmbus_bus_init(void) * Per cpu setup. */ CPU_FOREACH(j) { + struct task cpuset_task; + + /* + * Setup taskqueue to handle events + */ + hv_vmbus_g_context.hv_event_queue[j] = taskqueue_create_fast("hyperv event", M_WAITOK, + taskqueue_thread_enqueue, &hv_vmbus_g_context.hv_event_queue[j]); + if (hv_vmbus_g_context.hv_event_queue[j] == NULL) { + if (bootverbose) + printf("VMBUS: failed to setup taskqueue\n"); + goto cleanup1; + } + taskqueue_start_threads(&hv_vmbus_g_context.hv_event_queue[j], 1, PI_NET, + "hvevent%d", j); + + CPU_SETOF(j, &cpu_mask); + TASK_INIT(&cpuset_task, 0, vmbus_cpuset_setthread_task, &cpu_mask); + taskqueue_enqueue(hv_vmbus_g_context.hv_event_queue[j], &cpuset_task); + taskqueue_drain(hv_vmbus_g_context.hv_event_queue[j], &cpuset_task); + /* * Setup software interrupt thread and handler for msg handling. */ @@ -543,7 +573,7 @@ vmbus_bus_init(void) */ ret = intr_event_bind(hv_vmbus_g_context.hv_msg_intr_event[j], j); - if (ret) { + if (ret) { if(bootverbose) printf("VMBUS: failed to bind msg swi thread " "to cpu %d\n", j); @@ -551,20 +581,6 @@ vmbus_bus_init(void) } /* - * Setup software interrupt thread and handler for - * event handling. - */ - ret = swi_add(&hv_vmbus_g_context.hv_event_intr_event[j], - "hv_event", hv_vmbus_on_events, (void *)(long)j, - SWI_CLOCK, 0, &hv_vmbus_g_context.event_swintr[j]); - if (ret) { - if(bootverbose) - printf("VMBUS: failed to setup event swi for " - "cpu %d\n", j); - goto cleanup1; - } - - /* * Prepare the per cpu msg and event pages to be called on each cpu. */ for(i = 0; i < 2; i++) { @@ -607,12 +623,11 @@ vmbus_bus_init(void) * remove swi and vmbus callback vector; */ CPU_FOREACH(j) { + if (hv_vmbus_g_context.hv_event_queue[j] != NULL) + taskqueue_free(hv_vmbus_g_context.hv_event_queue[j]); if (hv_vmbus_g_context.msg_swintr[j] != NULL) swi_remove(hv_vmbus_g_context.msg_swintr[j]); - if (hv_vmbus_g_context.event_swintr[j] != NULL) - swi_remove(hv_vmbus_g_context.event_swintr[j]); hv_vmbus_g_context.hv_msg_intr_event[j] = NULL; - hv_vmbus_g_context.hv_event_intr_event[j] = NULL; } vmbus_vector_free(hv_vmbus_g_context.hv_cb_vector); @@ -677,12 +692,11 @@ vmbus_bus_exit(void) /* remove swi */ CPU_FOREACH(i) { + if (hv_vmbus_g_context.hv_event_queue[i] != NULL) + taskqueue_free(hv_vmbus_g_context.hv_event_queue[i]); if (hv_vmbus_g_context.msg_swintr[i] != NULL) swi_remove(hv_vmbus_g_context.msg_swintr[i]); - if (hv_vmbus_g_context.event_swintr[i] != NULL) - swi_remove(hv_vmbus_g_context.event_swintr[i]); hv_vmbus_g_context.hv_msg_intr_event[i] = NULL; - hv_vmbus_g_context.hv_event_intr_event[i] = NULL; } vmbus_vector_free(hv_vmbus_g_context.hv_cb_vector); Modified: stable/10/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Mon Jun 13 03:45:08 2016 (r301853) +++ stable/10/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Mon Jun 13 05:06:07 2016 (r301854) @@ -202,9 +202,8 @@ typedef struct { * Each cpu has its own software interrupt handler for channel * event and msg handling. */ - struct intr_event *hv_event_intr_event[MAXCPU]; + struct taskqueue *hv_event_queue[MAXCPU]; struct intr_event *hv_msg_intr_event[MAXCPU]; - void *event_swintr[MAXCPU]; void *msg_swintr[MAXCPU]; /* * Host use this vector to intrrupt guest for vmbus channel @@ -717,7 +716,7 @@ int hv_vmbus_connect(void); int hv_vmbus_disconnect(void); int hv_vmbus_post_message(void *buffer, size_t buf_size); int hv_vmbus_set_event(hv_vmbus_channel *channel); -void hv_vmbus_on_events(void *); +void hv_vmbus_on_events(int cpu); /** * Event Timer interfaces From owner-svn-src-all@freebsd.org Mon Jun 13 05:13:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72531AF1ECA; Mon, 13 Jun 2016 05:13:53 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 258232E90; Mon, 13 Jun 2016 05:13:53 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5D5DqwR036116; Mon, 13 Jun 2016 05:13:52 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5D5DqD0036115; Mon, 13 Jun 2016 05:13:52 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606130513.u5D5DqD0036115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 13 Jun 2016 05:13:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301855 - stable/10/sys/dev/hyperv/storvsc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 05:13:53 -0000 Author: sephe Date: Mon Jun 13 05:13:52 2016 New Revision: 301855 URL: https://svnweb.freebsd.org/changeset/base/301855 Log: MFC 295295 hyperv/stor: Fix the NULL pointer dereference Reported by: Netapp Submitted by: Hongjiang Zhang Reviewed by: adrian, sephe, Dexuan Cui Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5097 Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Mon Jun 13 05:06:07 2016 (r301854) +++ stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Mon Jun 13 05:13:52 2016 (r301855) @@ -1561,13 +1561,12 @@ static void storvsc_destroy_bounce_buffer(struct sglist *sgl) { struct hv_sgl_node *sgl_node = NULL; - - sgl_node = LIST_FIRST(&g_hv_sgl_page_pool.in_use_sgl_list); - LIST_REMOVE(sgl_node, link); - if (NULL == sgl_node) { + if (LIST_EMPTY(&g_hv_sgl_page_pool.in_use_sgl_list)) { printf("storvsc error: not enough in use sgl\n"); return; } + sgl_node = LIST_FIRST(&g_hv_sgl_page_pool.in_use_sgl_list); + LIST_REMOVE(sgl_node, link); sgl_node->sgl_data = sgl; LIST_INSERT_HEAD(&g_hv_sgl_page_pool.free_sgl_list, sgl_node, link); } @@ -1593,12 +1592,12 @@ storvsc_create_bounce_buffer(uint16_t se struct hv_sgl_node *sgl_node = NULL; /* get struct sglist from free_sgl_list */ - sgl_node = LIST_FIRST(&g_hv_sgl_page_pool.free_sgl_list); - LIST_REMOVE(sgl_node, link); - if (NULL == sgl_node) { + if (LIST_EMPTY(&g_hv_sgl_page_pool.free_sgl_list)) { printf("storvsc error: not enough free sgl\n"); return NULL; } + sgl_node = LIST_FIRST(&g_hv_sgl_page_pool.free_sgl_list); + LIST_REMOVE(sgl_node, link); bounce_sgl = sgl_node->sgl_data; LIST_INSERT_HEAD(&g_hv_sgl_page_pool.in_use_sgl_list, sgl_node, link); From owner-svn-src-all@freebsd.org Mon Jun 13 05:43:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59CDFAF066C; Mon, 13 Jun 2016 05:43:43 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E2BB2B16; Mon, 13 Jun 2016 05:43:43 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5D5hgY2046907; Mon, 13 Jun 2016 05:43:42 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5D5hgak046905; Mon, 13 Jun 2016 05:43:42 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606130543.u5D5hgak046905@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 13 Jun 2016 05:43:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301856 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 05:43:43 -0000 Author: sephe Date: Mon Jun 13 05:43:42 2016 New Revision: 301856 URL: https://svnweb.freebsd.org/changeset/base/301856 Log: MFC 295296,295297,295298,295299,295300,295301 295296 hyperv/hn: Avoid duplicate csum features settings - Record csum features in softc, so we don't need to duplicate the logic from attach path to ioctl path. - Protect if_capenable and if_hwassist changes by main lock. - Prefer turn on/off bits in if_hwassist explicitly instead of using XOR. Reviewed by: adrian, Hongjiang Zhang Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5085 295297 hyperv/hn: Reorganize TX csum offloading - For non-TSO offloading, we don't need to access mbuf to know which csum offloading is requested, we can just use the CSUM_{IP,TCP,UDP} in the csum_flags. - For TSO offloading, we still can depend on CSUM_{TSO4,TSO6} in the csum_flags to tell whether the TSO packet is an IPv4 TSO packet or an IPv6 TSO packet. This streamlines csum offloading handling (remove the two goto) and allows us the nuke the unnecessary get_transport_proto_type(). Reviewed by: adrian, Hongjiang Zhang Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5098 295298 hyperv/hn: Enable IP header checksum offloading So that: - TCP/IP stack will not do unnecessary IP header checksum for TSO packets. - Reduce guest load for non-TSO IP packets. Reviewed by: adrian Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5099 295299 hyperv/hn: Enable UDP RXCSUM Reviewed by: adrian Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5102 295300 hyperv/hn: Add sysctls to trust host side UDP and IP csum verification Reviewed by: adrian, Hongjiang Zhang Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5103 295301 hyperv/hn: Obey IFCAP_RXCSUM configure Reviewed by: adrian Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5104 Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Jun 13 05:13:52 2016 (r301855) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Jun 13 05:43:42 2016 (r301856) @@ -1016,6 +1016,7 @@ typedef struct hn_softc { bus_dma_tag_t hn_tx_rndis_dtag; int hn_tx_chimney_size; int hn_tx_chimney_max; + uint64_t hn_csum_assist; struct mtx hn_txlist_spin; struct hn_txdesc_list hn_txlist; @@ -1031,11 +1032,12 @@ typedef struct hn_softc { struct lro_ctrl hn_lro; int hn_lro_hiwat; - /* Trust tcp segments verification on host side */ - int hn_trust_hosttcp; + /* Trust csum verification on host side */ + int hn_trust_hcsum; /* HN_TRUST_HCSUM_ */ u_long hn_csum_ip; u_long hn_csum_tcp; + u_long hn_csum_udp; u_long hn_csum_trusted; u_long hn_lro_tried; u_long hn_small_pkts; @@ -1046,6 +1048,9 @@ typedef struct hn_softc { u_long hn_tx_chimney; } hn_softc_t; +#define HN_TRUST_HCSUM_IP 0x0001 +#define HN_TRUST_HCSUM_TCP 0x0002 +#define HN_TRUST_HCSUM_UDP 0x0004 /* * Externs Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 05:13:52 2016 (r301855) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 05:43:42 2016 (r301856) @@ -167,14 +167,12 @@ struct hn_txdesc { #define HN_TXD_FLAG_DMAMAP 0x2 /* - * A unified flag for all outbound check sum flags is useful, - * and it helps avoiding unnecessary check sum calculation in - * network forwarding scenario. + * Only enable UDP checksum offloading when it is on 2012R2 or + * later. UDP checksum offloading doesn't work on earlier + * Windows releases. */ -#define HV_CSUM_FOR_OUTBOUND \ - (CSUM_IP|CSUM_IP_UDP|CSUM_IP_TCP|CSUM_IP_SCTP|CSUM_IP_TSO| \ - CSUM_IP_ISCSI|CSUM_IP6_UDP|CSUM_IP6_TCP|CSUM_IP6_SCTP| \ - CSUM_IP6_TSO|CSUM_IP6_ISCSI) +#define HN_CSUM_ASSIST_WIN8 (CSUM_TCP) +#define HN_CSUM_ASSIST (CSUM_IP | CSUM_UDP | CSUM_TCP) /* XXX move to netinet/tcp_lro.h */ #define HN_LRO_HIWAT_MAX 65535 @@ -212,6 +210,14 @@ int hv_promisc_mode = 0; /* normal mo static int hn_trust_hosttcp = 1; TUNABLE_INT("dev.hn.trust_hosttcp", &hn_trust_hosttcp); +/* Trust udp datagrams verification on host side. */ +static int hn_trust_hostudp = 1; +TUNABLE_INT("dev.hn.trust_hostudp", &hn_trust_hostudp); + +/* Trust ip packets verification on host side. */ +static int hn_trust_hostip = 1; +TUNABLE_INT("dev.hn.trust_hostip", &hn_trust_hostip); + #if __FreeBSD_version >= 1100045 /* Limit TSO burst size */ static int hn_tso_maxlen = 0; @@ -241,6 +247,7 @@ static void hn_ifmedia_sts(struct ifnet #ifdef HN_LRO_HIWAT static int hn_lro_hiwat_sysctl(SYSCTL_HANDLER_ARGS); #endif +static int hn_trust_hcsum_sysctl(SYSCTL_HANDLER_ARGS); static int hn_tx_chimney_size_sysctl(SYSCTL_HANDLER_ARGS); static int hn_check_iplen(const struct mbuf *, int); static int hn_create_tx_ring(struct hn_softc *sc); @@ -257,62 +264,6 @@ hn_set_lro_hiwat(struct hn_softc *sc, in #endif } -/* - * NetVsc get message transport protocol type - */ -static uint32_t get_transport_proto_type(struct mbuf *m_head) -{ - uint32_t ret_val = TRANSPORT_TYPE_NOT_IP; - uint16_t ether_type = 0; - int ether_len = 0; - struct ether_vlan_header *eh; -#ifdef INET - struct ip *iph; -#endif -#ifdef INET6 - struct ip6_hdr *ip6; -#endif - - eh = mtod(m_head, struct ether_vlan_header*); - if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) { - ether_len = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; - ether_type = eh->evl_proto; - } else { - ether_len = ETHER_HDR_LEN; - ether_type = eh->evl_encap_proto; - } - - switch (ntohs(ether_type)) { -#ifdef INET6 - case ETHERTYPE_IPV6: - ip6 = (struct ip6_hdr *)(m_head->m_data + ether_len); - - if (IPPROTO_TCP == ip6->ip6_nxt) { - ret_val = TRANSPORT_TYPE_IPV6_TCP; - } else if (IPPROTO_UDP == ip6->ip6_nxt) { - ret_val = TRANSPORT_TYPE_IPV6_UDP; - } - break; -#endif -#ifdef INET - case ETHERTYPE_IP: - iph = (struct ip *)(m_head->m_data + ether_len); - - if (IPPROTO_TCP == iph->ip_p) { - ret_val = TRANSPORT_TYPE_IPV4_TCP; - } else if (IPPROTO_UDP == iph->ip_p) { - ret_val = TRANSPORT_TYPE_IPV4_UDP; - } - break; -#endif - default: - ret_val = TRANSPORT_TYPE_NOT_IP; - break; - } - - return (ret_val); -} - static int hn_ifmedia_upd(struct ifnet *ifp __unused) { @@ -393,8 +344,13 @@ netvsc_attach(device_t dev) sc->hn_unit = unit; sc->hn_dev = dev; sc->hn_lro_hiwat = HN_LRO_HIWAT_DEF; - sc->hn_trust_hosttcp = hn_trust_hosttcp; sc->hn_direct_tx_size = hn_direct_tx_size; + if (hn_trust_hosttcp) + sc->hn_trust_hcsum |= HN_TRUST_HCSUM_TCP; + if (hn_trust_hostudp) + sc->hn_trust_hcsum |= HN_TRUST_HCSUM_UDP; + if (hn_trust_hostip) + sc->hn_trust_hcsum |= HN_TRUST_HCSUM_IP; sc->hn_tx_taskq = taskqueue_create_fast("hn_tx", M_WAITOK, taskqueue_thread_enqueue, &sc->hn_tx_taskq); @@ -444,15 +400,12 @@ netvsc_attach(device_t dev) ifp->if_capenable |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_TSO | IFCAP_LRO; - /* - * Only enable UDP checksum offloading when it is on 2012R2 or - * later. UDP checksum offloading doesn't work on earlier - * Windows releases. - */ + if (hv_vmbus_protocal_version >= HV_VMBUS_VERSION_WIN8_1) - ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_TSO; + sc->hn_csum_assist = HN_CSUM_ASSIST; else - ifp->if_hwassist = CSUM_TCP | CSUM_TSO; + sc->hn_csum_assist = HN_CSUM_ASSIST_WIN8; + ifp->if_hwassist = sc->hn_csum_assist | CSUM_TSO; error = hv_rf_on_device_add(device_ctx, &device_info); if (error) @@ -509,17 +462,30 @@ netvsc_attach(device_t dev) CTLTYPE_INT | CTLFLAG_RW, sc, 0, hn_lro_hiwat_sysctl, "I", "LRO high watermark"); #endif - SYSCTL_ADD_INT(ctx, child, OID_AUTO, "trust_hosttcp", - CTLFLAG_RW, &sc->hn_trust_hosttcp, 0, + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "trust_hosttcp", + CTLTYPE_INT | CTLFLAG_RW, sc, HN_TRUST_HCSUM_TCP, + hn_trust_hcsum_sysctl, "I", "Trust tcp segement verification on host side, " "when csum info is missing"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "trust_hostudp", + CTLTYPE_INT | CTLFLAG_RW, sc, HN_TRUST_HCSUM_UDP, + hn_trust_hcsum_sysctl, "I", + "Trust udp datagram verification on host side, " + "when csum info is missing"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "trust_hostip", + CTLTYPE_INT | CTLFLAG_RW, sc, HN_TRUST_HCSUM_IP, + hn_trust_hcsum_sysctl, "I", + "Trust ip packet verification on host side, " + "when csum info is missing"); SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "csum_ip", CTLFLAG_RW, &sc->hn_csum_ip, "RXCSUM IP"); SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "csum_tcp", CTLFLAG_RW, &sc->hn_csum_tcp, "RXCSUM TCP"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "csum_udp", + CTLFLAG_RW, &sc->hn_csum_udp, "RXCSUM UDP"); SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "csum_trusted", CTLFLAG_RW, &sc->hn_csum_trusted, - "# of TCP segements that we trust host's csum verification"); + "# of packets that we trust host's csum verification"); SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "small_pkts", CTLFLAG_RW, &sc->hn_small_pkts, "# of small packets received"); SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "no_txdescs", @@ -562,6 +528,14 @@ netvsc_attach(device_t dev) CTLFLAG_RD, &hn_trust_hosttcp, 0, "Trust tcp segement verification on host side, " "when csum info is missing (global setting)"); + SYSCTL_ADD_INT(dc_ctx, dc_child, OID_AUTO, "trust_hostudp", + CTLFLAG_RD, &hn_trust_hostudp, 0, + "Trust udp datagram verification on host side, " + "when csum info is missing (global setting)"); + SYSCTL_ADD_INT(dc_ctx, dc_child, OID_AUTO, "trust_hostip", + CTLFLAG_RD, &hn_trust_hostip, 0, + "Trust ip packet verification on host side, " + "when csum info is missing (global setting)"); SYSCTL_ADD_INT(dc_ctx, dc_child, OID_AUTO, "tx_chimney_size", CTLFLAG_RD, &hn_tx_chimney_size, 0, "Chimney send packet size limit"); @@ -778,16 +752,13 @@ hn_start_locked(struct ifnet *ifp, int l hn_softc_t *sc = ifp->if_softc; struct hv_device *device_ctx = vmbus_get_devctx(sc->hn_dev); netvsc_dev *net_dev = sc->net_dev; - struct ether_vlan_header *eh; rndis_msg *rndis_mesg; rndis_packet *rndis_pkt; rndis_per_packet_info *rppi; ndis_8021q_info *rppi_vlan_info; rndis_tcp_ip_csum_info *csum_info; rndis_tcp_tso_info *tso_info; - int ether_len; uint32_t rndis_msg_size = 0; - uint32_t trans_proto_type; if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) @@ -867,101 +838,81 @@ hn_start_locked(struct ifnet *ifp, int l m_head->m_pkthdr.ether_vtag & 0xfff; } - /* Only check the flags for outbound and ignore the ones for inbound */ - if (0 == (m_head->m_pkthdr.csum_flags & HV_CSUM_FOR_OUTBOUND)) { - goto pre_send; - } - - eh = mtod(m_head, struct ether_vlan_header*); - if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) { - ether_len = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; - } else { - ether_len = ETHER_HDR_LEN; - } - - trans_proto_type = get_transport_proto_type(m_head); - if (TRANSPORT_TYPE_NOT_IP == trans_proto_type) { - goto pre_send; - } - - /* - * TSO packet needless to setup the send side checksum - * offload. - */ if (m_head->m_pkthdr.csum_flags & CSUM_TSO) { - goto do_tso; - } + struct ether_vlan_header *eh; + int ether_len; - /* setup checksum offload */ - rndis_msg_size += RNDIS_CSUM_PPI_SIZE; - rppi = hv_set_rppi_data(rndis_mesg, RNDIS_CSUM_PPI_SIZE, - tcpip_chksum_info); - csum_info = (rndis_tcp_ip_csum_info *)((char*)rppi + - rppi->per_packet_info_offset); + eh = mtod(m_head, struct ether_vlan_header*); + if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) { + ether_len = ETHER_HDR_LEN + + ETHER_VLAN_ENCAP_LEN; + } else { + ether_len = ETHER_HDR_LEN; + } - if (trans_proto_type & (TYPE_IPV4 << 16)) { - csum_info->xmit.is_ipv4 = 1; - } else { - csum_info->xmit.is_ipv6 = 1; - } + rndis_msg_size += RNDIS_TSO_PPI_SIZE; + rppi = hv_set_rppi_data(rndis_mesg, RNDIS_TSO_PPI_SIZE, + tcp_large_send_info); - if (trans_proto_type & TYPE_TCP) { - csum_info->xmit.tcp_csum = 1; - csum_info->xmit.tcp_header_offset = 0; - } else if (trans_proto_type & TYPE_UDP) { - csum_info->xmit.udp_csum = 1; - } - - goto pre_send; + tso_info = (rndis_tcp_tso_info *)((char *)rppi + + rppi->per_packet_info_offset); + tso_info->lso_v2_xmit.type = + RNDIS_TCP_LARGE_SEND_OFFLOAD_V2_TYPE; -do_tso: - /* setup TCP segmentation offload */ - rndis_msg_size += RNDIS_TSO_PPI_SIZE; - rppi = hv_set_rppi_data(rndis_mesg, RNDIS_TSO_PPI_SIZE, - tcp_large_send_info); - - tso_info = (rndis_tcp_tso_info *)((char *)rppi + - rppi->per_packet_info_offset); - tso_info->lso_v2_xmit.type = - RNDIS_TCP_LARGE_SEND_OFFLOAD_V2_TYPE; - #ifdef INET - if (trans_proto_type & (TYPE_IPV4 << 16)) { - struct ip *ip = - (struct ip *)(m_head->m_data + ether_len); - unsigned long iph_len = ip->ip_hl << 2; - struct tcphdr *th = - (struct tcphdr *)((caddr_t)ip + iph_len); - - tso_info->lso_v2_xmit.ip_version = - RNDIS_TCP_LARGE_SEND_OFFLOAD_IPV4; - ip->ip_len = 0; - ip->ip_sum = 0; - - th->th_sum = in_pseudo(ip->ip_src.s_addr, - ip->ip_dst.s_addr, - htons(IPPROTO_TCP)); - } + if (m_head->m_pkthdr.csum_flags & CSUM_IP_TSO) { + struct ip *ip = + (struct ip *)(m_head->m_data + ether_len); + unsigned long iph_len = ip->ip_hl << 2; + struct tcphdr *th = + (struct tcphdr *)((caddr_t)ip + iph_len); + + tso_info->lso_v2_xmit.ip_version = + RNDIS_TCP_LARGE_SEND_OFFLOAD_IPV4; + ip->ip_len = 0; + ip->ip_sum = 0; + + th->th_sum = in_pseudo(ip->ip_src.s_addr, + ip->ip_dst.s_addr, htons(IPPROTO_TCP)); + } #endif #if defined(INET6) && defined(INET) - else + else #endif #ifdef INET6 - { - struct ip6_hdr *ip6 = - (struct ip6_hdr *)(m_head->m_data + ether_len); - struct tcphdr *th = (struct tcphdr *)(ip6 + 1); - - tso_info->lso_v2_xmit.ip_version = - RNDIS_TCP_LARGE_SEND_OFFLOAD_IPV6; - ip6->ip6_plen = 0; - th->th_sum = in6_cksum_pseudo(ip6, 0, IPPROTO_TCP, 0); - } + { + struct ip6_hdr *ip6 = (struct ip6_hdr *) + (m_head->m_data + ether_len); + struct tcphdr *th = (struct tcphdr *)(ip6 + 1); + + tso_info->lso_v2_xmit.ip_version = + RNDIS_TCP_LARGE_SEND_OFFLOAD_IPV6; + ip6->ip6_plen = 0; + th->th_sum = + in6_cksum_pseudo(ip6, 0, IPPROTO_TCP, 0); + } #endif - tso_info->lso_v2_xmit.tcp_header_offset = 0; - tso_info->lso_v2_xmit.mss = m_head->m_pkthdr.tso_segsz; + tso_info->lso_v2_xmit.tcp_header_offset = 0; + tso_info->lso_v2_xmit.mss = m_head->m_pkthdr.tso_segsz; + } else if (m_head->m_pkthdr.csum_flags & sc->hn_csum_assist) { + rndis_msg_size += RNDIS_CSUM_PPI_SIZE; + rppi = hv_set_rppi_data(rndis_mesg, RNDIS_CSUM_PPI_SIZE, + tcpip_chksum_info); + csum_info = (rndis_tcp_ip_csum_info *)((char*)rppi + + rppi->per_packet_info_offset); + + csum_info->xmit.is_ipv4 = 1; + if (m_head->m_pkthdr.csum_flags & CSUM_IP) + csum_info->xmit.ip_header_csum = 1; + + if (m_head->m_pkthdr.csum_flags & CSUM_TCP) { + csum_info->xmit.tcp_csum = 1; + csum_info->xmit.tcp_header_offset = 0; + } else if (m_head->m_pkthdr.csum_flags & CSUM_UDP) { + csum_info->xmit.udp_csum = 1; + } + } -pre_send: rndis_mesg->msg_len = packet->tot_data_buf_len + rndis_msg_size; packet->tot_data_buf_len = rndis_mesg->msg_len; @@ -1191,7 +1142,7 @@ netvsc_recv(struct hv_device *device_ctx struct mbuf *m_new; struct ifnet *ifp; device_t dev = device_ctx->device; - int size, do_lro = 0; + int size, do_lro = 0, do_csum = 1; if (sc == NULL) { return (0); /* TODO: KYS how can this be! */ @@ -1241,21 +1192,28 @@ netvsc_recv(struct hv_device *device_ctx } m_new->m_pkthdr.rcvif = ifp; + if (__predict_false((ifp->if_capenable & IFCAP_RXCSUM) == 0)) + do_csum = 0; + /* receive side checksum offload */ - if (NULL != csum_info) { + if (csum_info != NULL) { /* IP csum offload */ - if (csum_info->receive.ip_csum_succeeded) { + if (csum_info->receive.ip_csum_succeeded && do_csum) { m_new->m_pkthdr.csum_flags |= (CSUM_IP_CHECKED | CSUM_IP_VALID); sc->hn_csum_ip++; } - /* TCP csum offload */ - if (csum_info->receive.tcp_csum_succeeded) { + /* TCP/UDP csum offload */ + if ((csum_info->receive.tcp_csum_succeeded || + csum_info->receive.udp_csum_succeeded) && do_csum) { m_new->m_pkthdr.csum_flags |= (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); m_new->m_pkthdr.csum_data = 0xffff; - sc->hn_csum_tcp++; + if (csum_info->receive.tcp_csum_succeeded) + sc->hn_csum_tcp++; + else + sc->hn_csum_udp++; } if (csum_info->receive.ip_csum_succeeded && @@ -1286,7 +1244,8 @@ netvsc_recv(struct hv_device *device_ctx pr = hn_check_iplen(m_new, hoff); if (pr == IPPROTO_TCP) { - if (sc->hn_trust_hosttcp) { + if (do_csum && + (sc->hn_trust_hcsum & HN_TRUST_HCSUM_TCP)) { sc->hn_csum_trusted++; m_new->m_pkthdr.csum_flags |= (CSUM_IP_CHECKED | CSUM_IP_VALID | @@ -1295,6 +1254,20 @@ netvsc_recv(struct hv_device *device_ctx } /* Rely on SW csum verification though... */ do_lro = 1; + } else if (pr == IPPROTO_UDP) { + if (do_csum && + (sc->hn_trust_hcsum & HN_TRUST_HCSUM_UDP)) { + sc->hn_csum_trusted++; + m_new->m_pkthdr.csum_flags |= + (CSUM_IP_CHECKED | CSUM_IP_VALID | + CSUM_DATA_VALID | CSUM_PSEUDO_HDR); + m_new->m_pkthdr.csum_data = 0xffff; + } + } else if (pr != IPPROTO_DONE && do_csum && + (sc->hn_trust_hcsum & HN_TRUST_HCSUM_IP)) { + sc->hn_csum_trusted++; + m_new->m_pkthdr.csum_flags |= + (CSUM_IP_CHECKED | CSUM_IP_VALID); } } } @@ -1508,47 +1481,40 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, error = 0; break; case SIOCSIFCAP: + NV_LOCK(sc); + mask = ifr->ifr_reqcap ^ ifp->if_capenable; if (mask & IFCAP_TXCSUM) { - if (IFCAP_TXCSUM & ifp->if_capenable) { - ifp->if_capenable &= ~IFCAP_TXCSUM; - ifp->if_hwassist &= ~(CSUM_TCP | CSUM_UDP); - } else { - ifp->if_capenable |= IFCAP_TXCSUM; - /* - * Only enable UDP checksum offloading on - * Windows Server 2012R2 or later releases. - */ - if (hv_vmbus_protocal_version >= - HV_VMBUS_VERSION_WIN8_1) { - ifp->if_hwassist |= - (CSUM_TCP | CSUM_UDP); - } else { - ifp->if_hwassist |= CSUM_TCP; - } - } + ifp->if_capenable ^= IFCAP_TXCSUM; + if (ifp->if_capenable & IFCAP_TXCSUM) + ifp->if_hwassist |= sc->hn_csum_assist; + else + ifp->if_hwassist &= ~sc->hn_csum_assist; } - if (mask & IFCAP_RXCSUM) { - if (IFCAP_RXCSUM & ifp->if_capenable) { - ifp->if_capenable &= ~IFCAP_RXCSUM; - } else { - ifp->if_capenable |= IFCAP_RXCSUM; - } - } + if (mask & IFCAP_RXCSUM) + ifp->if_capenable ^= IFCAP_RXCSUM; + if (mask & IFCAP_LRO) ifp->if_capenable ^= IFCAP_LRO; if (mask & IFCAP_TSO4) { ifp->if_capenable ^= IFCAP_TSO4; - ifp->if_hwassist ^= CSUM_IP_TSO; + if (ifp->if_capenable & IFCAP_TSO4) + ifp->if_hwassist |= CSUM_IP_TSO; + else + ifp->if_hwassist &= ~CSUM_IP_TSO; } if (mask & IFCAP_TSO6) { ifp->if_capenable ^= IFCAP_TSO6; - ifp->if_hwassist ^= CSUM_IP6_TSO; + if (ifp->if_capenable & IFCAP_TSO6) + ifp->if_hwassist |= CSUM_IP6_TSO; + else + ifp->if_hwassist &= ~CSUM_IP6_TSO; } + NV_UNLOCK(sc); error = 0; break; case SIOCADDMULTI: @@ -1737,6 +1703,30 @@ hn_lro_hiwat_sysctl(SYSCTL_HANDLER_ARGS) #endif /* HN_LRO_HIWAT */ static int +hn_trust_hcsum_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct hn_softc *sc = arg1; + int hcsum = arg2; + int on, error; + + on = 0; + if (sc->hn_trust_hcsum & hcsum) + on = 1; + + error = sysctl_handle_int(oidp, &on, 0, req); + if (error || req->newptr == NULL) + return error; + + NV_LOCK(sc); + if (on) + sc->hn_trust_hcsum |= hcsum; + else + sc->hn_trust_hcsum &= ~hcsum; + NV_UNLOCK(sc); + return 0; +} + +static int hn_tx_chimney_size_sysctl(SYSCTL_HANDLER_ARGS) { struct hn_softc *sc = arg1; From owner-svn-src-all@freebsd.org Mon Jun 13 06:09:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D28FAAF0A76; Mon, 13 Jun 2016 06:09:03 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94BD321E7; Mon, 13 Jun 2016 06:09:03 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5D6926b054582; Mon, 13 Jun 2016 06:09:02 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5D692hC054580; Mon, 13 Jun 2016 06:09:02 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606130609.u5D692hC054580@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 13 Jun 2016 06:09:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301857 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 06:09:03 -0000 Author: sephe Date: Mon Jun 13 06:09:02 2016 New Revision: 301857 URL: https://svnweb.freebsd.org/changeset/base/301857 Log: MFC 295302,295303 295302 hyperv/hn: Factor out hn_encap() from hn_start_locked() It will be shared w/ upcoming ifnet.if_transmit implementaion. No functional changes. Reviewed by: adrian Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5158 295303 hyperv/hn: Recover half of the chimney sending space We lost half of the chimney sending space, because we mis-used ffs() on a 64 bits mask, where ffsl() should be used. While I'm here: - Use system atomic operation instead. - Stringent chimney sending index assertion. Reviewed by: adrian Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5159 Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Jun 13 05:43:42 2016 (r301856) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Jun 13 06:09:02 2016 (r301857) @@ -135,15 +135,15 @@ hv_nv_get_next_send_section(netvsc_dev * int i; for (i = 0; i < bitsmap_words; i++) { - idx = ffs(~bitsmap[i]); + idx = ffsl(~bitsmap[i]); if (0 == idx) continue; idx--; - if (i * BITS_PER_LONG + idx >= net_dev->send_section_count) - return (ret); + KASSERT(i * BITS_PER_LONG + idx < net_dev->send_section_count, + ("invalid i %d and idx %lu", i, idx)); - if (synch_test_and_set_bit(idx, &bitsmap[i])) + if (atomic_testandset_long(&bitsmap[i], idx)) continue; ret = i * BITS_PER_LONG + idx; @@ -788,8 +788,27 @@ hv_nv_on_send_completion(netvsc_dev *net if (NULL != net_vsc_pkt) { if (net_vsc_pkt->send_buf_section_idx != NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX) { - synch_change_bit(net_vsc_pkt->send_buf_section_idx, - net_dev->send_section_bitsmap); + u_long mask; + int idx; + + idx = net_vsc_pkt->send_buf_section_idx / + BITS_PER_LONG; + KASSERT(idx < net_dev->bitsmap_words, + ("invalid section index %u", + net_vsc_pkt->send_buf_section_idx)); + mask = 1UL << + (net_vsc_pkt->send_buf_section_idx % + BITS_PER_LONG); + + KASSERT(net_dev->send_section_bitsmap[idx] & + mask, + ("index bitmap 0x%lx, section index %u, " + "bitmap idx %d, bitmask 0x%lx", + net_dev->send_section_bitsmap[idx], + net_vsc_pkt->send_buf_section_idx, + idx, mask)); + atomic_clear_long( + &net_dev->send_section_bitsmap[idx], mask); } /* Notify the layer above us */ Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 05:43:42 2016 (r301856) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 06:09:02 2016 (r301857) @@ -254,6 +254,7 @@ static int hn_create_tx_ring(struct hn_s static void hn_destroy_tx_ring(struct hn_softc *sc); static void hn_start_taskfunc(void *xsc, int pending); static void hn_txeof_taskfunc(void *xsc, int pending); +static int hn_encap(struct hn_softc *, struct hn_txdesc *, struct mbuf **); static __inline void hn_set_lro_hiwat(struct hn_softc *sc, int hiwat) @@ -744,31 +745,235 @@ netvsc_channel_rollup(struct hv_device * } /* - * Start a transmit of one or more packets + * NOTE: + * This this function fails, then both txd and m_head0 will be freed */ static int -hn_start_locked(struct ifnet *ifp, int len) +hn_encap(struct hn_softc *sc, struct hn_txdesc *txd, struct mbuf **m_head0) { - hn_softc_t *sc = ifp->if_softc; - struct hv_device *device_ctx = vmbus_get_devctx(sc->hn_dev); - netvsc_dev *net_dev = sc->net_dev; + bus_dma_segment_t segs[HN_TX_DATA_SEGCNT_MAX]; + int error, nsegs, i; + struct mbuf *m_head = *m_head0; + netvsc_packet *packet; rndis_msg *rndis_mesg; rndis_packet *rndis_pkt; rndis_per_packet_info *rppi; - ndis_8021q_info *rppi_vlan_info; - rndis_tcp_ip_csum_info *csum_info; - rndis_tcp_tso_info *tso_info; - uint32_t rndis_msg_size = 0; + uint32_t rndis_msg_size; + + packet = &txd->netvsc_pkt; + packet->is_data_pkt = TRUE; + packet->tot_data_buf_len = m_head->m_pkthdr.len; + + /* + * extension points to the area reserved for the + * rndis_filter_packet, which is placed just after + * the netvsc_packet (and rppi struct, if present; + * length is updated later). + */ + rndis_mesg = txd->rndis_msg; + /* XXX not necessary */ + memset(rndis_mesg, 0, HN_RNDIS_MSG_LEN); + rndis_mesg->ndis_msg_type = REMOTE_NDIS_PACKET_MSG; + + rndis_pkt = &rndis_mesg->msg.packet; + rndis_pkt->data_offset = sizeof(rndis_packet); + rndis_pkt->data_length = packet->tot_data_buf_len; + rndis_pkt->per_pkt_info_offset = sizeof(rndis_packet); + + rndis_msg_size = RNDIS_MESSAGE_SIZE(rndis_packet); + + if (m_head->m_flags & M_VLANTAG) { + ndis_8021q_info *rppi_vlan_info; + + rndis_msg_size += RNDIS_VLAN_PPI_SIZE; + rppi = hv_set_rppi_data(rndis_mesg, RNDIS_VLAN_PPI_SIZE, + ieee_8021q_info); + + rppi_vlan_info = (ndis_8021q_info *)((uint8_t *)rppi + + rppi->per_packet_info_offset); + rppi_vlan_info->u1.s1.vlan_id = + m_head->m_pkthdr.ether_vtag & 0xfff; + } + + if (m_head->m_pkthdr.csum_flags & CSUM_TSO) { + rndis_tcp_tso_info *tso_info; + struct ether_vlan_header *eh; + int ether_len; + + /* + * XXX need m_pullup and use mtodo + */ + eh = mtod(m_head, struct ether_vlan_header*); + if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) + ether_len = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; + else + ether_len = ETHER_HDR_LEN; + + rndis_msg_size += RNDIS_TSO_PPI_SIZE; + rppi = hv_set_rppi_data(rndis_mesg, RNDIS_TSO_PPI_SIZE, + tcp_large_send_info); + + tso_info = (rndis_tcp_tso_info *)((uint8_t *)rppi + + rppi->per_packet_info_offset); + tso_info->lso_v2_xmit.type = + RNDIS_TCP_LARGE_SEND_OFFLOAD_V2_TYPE; + +#ifdef INET + if (m_head->m_pkthdr.csum_flags & CSUM_IP_TSO) { + struct ip *ip = + (struct ip *)(m_head->m_data + ether_len); + unsigned long iph_len = ip->ip_hl << 2; + struct tcphdr *th = + (struct tcphdr *)((caddr_t)ip + iph_len); + + tso_info->lso_v2_xmit.ip_version = + RNDIS_TCP_LARGE_SEND_OFFLOAD_IPV4; + ip->ip_len = 0; + ip->ip_sum = 0; + + th->th_sum = in_pseudo(ip->ip_src.s_addr, + ip->ip_dst.s_addr, htons(IPPROTO_TCP)); + } +#endif +#if defined(INET6) && defined(INET) + else +#endif +#ifdef INET6 + { + struct ip6_hdr *ip6 = (struct ip6_hdr *) + (m_head->m_data + ether_len); + struct tcphdr *th = (struct tcphdr *)(ip6 + 1); + + tso_info->lso_v2_xmit.ip_version = + RNDIS_TCP_LARGE_SEND_OFFLOAD_IPV6; + ip6->ip6_plen = 0; + th->th_sum = in6_cksum_pseudo(ip6, 0, IPPROTO_TCP, 0); + } +#endif + tso_info->lso_v2_xmit.tcp_header_offset = 0; + tso_info->lso_v2_xmit.mss = m_head->m_pkthdr.tso_segsz; + } else if (m_head->m_pkthdr.csum_flags & sc->hn_csum_assist) { + rndis_tcp_ip_csum_info *csum_info; + + rndis_msg_size += RNDIS_CSUM_PPI_SIZE; + rppi = hv_set_rppi_data(rndis_mesg, RNDIS_CSUM_PPI_SIZE, + tcpip_chksum_info); + csum_info = (rndis_tcp_ip_csum_info *)((uint8_t *)rppi + + rppi->per_packet_info_offset); + + csum_info->xmit.is_ipv4 = 1; + if (m_head->m_pkthdr.csum_flags & CSUM_IP) + csum_info->xmit.ip_header_csum = 1; + + if (m_head->m_pkthdr.csum_flags & CSUM_TCP) { + csum_info->xmit.tcp_csum = 1; + csum_info->xmit.tcp_header_offset = 0; + } else if (m_head->m_pkthdr.csum_flags & CSUM_UDP) { + csum_info->xmit.udp_csum = 1; + } + } + + rndis_mesg->msg_len = packet->tot_data_buf_len + rndis_msg_size; + packet->tot_data_buf_len = rndis_mesg->msg_len; + + /* + * Chimney send, if the packet could fit into one chimney buffer. + */ + if (packet->tot_data_buf_len < sc->hn_tx_chimney_size) { + netvsc_dev *net_dev = sc->net_dev; + uint32_t send_buf_section_idx; + + send_buf_section_idx = + hv_nv_get_next_send_section(net_dev); + if (send_buf_section_idx != + NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX) { + uint8_t *dest = ((uint8_t *)net_dev->send_buf + + (send_buf_section_idx * + net_dev->send_section_size)); + + memcpy(dest, rndis_mesg, rndis_msg_size); + dest += rndis_msg_size; + m_copydata(m_head, 0, m_head->m_pkthdr.len, dest); + + packet->send_buf_section_idx = send_buf_section_idx; + packet->send_buf_section_size = + packet->tot_data_buf_len; + packet->page_buf_count = 0; + sc->hn_tx_chimney++; + goto done; + } + } + + error = hn_txdesc_dmamap_load(sc, txd, &m_head, segs, &nsegs); + if (error) { + int freed; + + /* + * This mbuf is not linked w/ the txd yet, so free it now. + */ + m_freem(m_head); + *m_head0 = NULL; + + freed = hn_txdesc_put(sc, txd); + KASSERT(freed != 0, + ("fail to free txd upon txdma error")); + + sc->hn_txdma_failed++; + if_inc_counter(sc->hn_ifp, IFCOUNTER_OERRORS, 1); + return error; + } + *m_head0 = m_head; + + packet->page_buf_count = nsegs + HV_RF_NUM_TX_RESERVED_PAGE_BUFS; + + /* send packet with page buffer */ + packet->page_buffers[0].pfn = atop(txd->rndis_msg_paddr); + packet->page_buffers[0].offset = txd->rndis_msg_paddr & PAGE_MASK; + packet->page_buffers[0].length = rndis_msg_size; + + /* + * Fill the page buffers with mbuf info starting at index + * HV_RF_NUM_TX_RESERVED_PAGE_BUFS. + */ + for (i = 0; i < nsegs; ++i) { + hv_vmbus_page_buffer *pb = &packet->page_buffers[ + i + HV_RF_NUM_TX_RESERVED_PAGE_BUFS]; + + pb->pfn = atop(segs[i].ds_addr); + pb->offset = segs[i].ds_addr & PAGE_MASK; + pb->length = segs[i].ds_len; + } + + packet->send_buf_section_idx = + NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX; + packet->send_buf_section_size = 0; +done: + txd->m = m_head; + + /* Set the completion routine */ + packet->compl.send.on_send_completion = netvsc_xmit_completion; + packet->compl.send.send_completion_context = packet; + packet->compl.send.send_completion_tid = (uint64_t)(uintptr_t)txd; + + return 0; +} + +/* + * Start a transmit of one or more packets + */ +static int +hn_start_locked(struct ifnet *ifp, int len) +{ + struct hn_softc *sc = ifp->if_softc; + struct hv_device *device_ctx = vmbus_get_devctx(sc->hn_dev); if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) return 0; while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { - bus_dma_segment_t segs[HN_TX_DATA_SEGCNT_MAX]; - int error, nsegs, i, send_failed = 0; + int error, send_failed = 0; struct hn_txdesc *txd; - netvsc_packet *packet; struct mbuf *m_head; IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); @@ -793,216 +998,17 @@ hn_start_locked(struct ifnet *ifp, int l break; } - packet = &txd->netvsc_pkt; - packet->is_data_pkt = TRUE; - /* Initialize it from the mbuf */ - packet->tot_data_buf_len = m_head->m_pkthdr.len; - - /* - * extension points to the area reserved for the - * rndis_filter_packet, which is placed just after - * the netvsc_packet (and rppi struct, if present; - * length is updated later). - */ - rndis_mesg = txd->rndis_msg; - /* XXX not necessary */ - memset(rndis_mesg, 0, HN_RNDIS_MSG_LEN); - rndis_mesg->ndis_msg_type = REMOTE_NDIS_PACKET_MSG; - - rndis_pkt = &rndis_mesg->msg.packet; - rndis_pkt->data_offset = sizeof(rndis_packet); - rndis_pkt->data_length = packet->tot_data_buf_len; - rndis_pkt->per_pkt_info_offset = sizeof(rndis_packet); - - rndis_msg_size = RNDIS_MESSAGE_SIZE(rndis_packet); - - /* - * If the Hyper-V infrastructure needs to embed a VLAN tag, - * initialize netvsc_packet and rppi struct values as needed. - */ - if (m_head->m_flags & M_VLANTAG) { - /* - * set up some additional fields so the Hyper-V infrastructure will stuff the VLAN tag - * into the frame. - */ - rndis_msg_size += RNDIS_VLAN_PPI_SIZE; - - rppi = hv_set_rppi_data(rndis_mesg, RNDIS_VLAN_PPI_SIZE, - ieee_8021q_info); - - /* VLAN info immediately follows rppi struct */ - rppi_vlan_info = (ndis_8021q_info *)((char*)rppi + - rppi->per_packet_info_offset); - /* FreeBSD does not support CFI or priority */ - rppi_vlan_info->u1.s1.vlan_id = - m_head->m_pkthdr.ether_vtag & 0xfff; - } - - if (m_head->m_pkthdr.csum_flags & CSUM_TSO) { - struct ether_vlan_header *eh; - int ether_len; - - eh = mtod(m_head, struct ether_vlan_header*); - if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) { - ether_len = ETHER_HDR_LEN + - ETHER_VLAN_ENCAP_LEN; - } else { - ether_len = ETHER_HDR_LEN; - } - - rndis_msg_size += RNDIS_TSO_PPI_SIZE; - rppi = hv_set_rppi_data(rndis_mesg, RNDIS_TSO_PPI_SIZE, - tcp_large_send_info); - - tso_info = (rndis_tcp_tso_info *)((char *)rppi + - rppi->per_packet_info_offset); - tso_info->lso_v2_xmit.type = - RNDIS_TCP_LARGE_SEND_OFFLOAD_V2_TYPE; - -#ifdef INET - if (m_head->m_pkthdr.csum_flags & CSUM_IP_TSO) { - struct ip *ip = - (struct ip *)(m_head->m_data + ether_len); - unsigned long iph_len = ip->ip_hl << 2; - struct tcphdr *th = - (struct tcphdr *)((caddr_t)ip + iph_len); - - tso_info->lso_v2_xmit.ip_version = - RNDIS_TCP_LARGE_SEND_OFFLOAD_IPV4; - ip->ip_len = 0; - ip->ip_sum = 0; - - th->th_sum = in_pseudo(ip->ip_src.s_addr, - ip->ip_dst.s_addr, htons(IPPROTO_TCP)); - } -#endif -#if defined(INET6) && defined(INET) - else -#endif -#ifdef INET6 - { - struct ip6_hdr *ip6 = (struct ip6_hdr *) - (m_head->m_data + ether_len); - struct tcphdr *th = (struct tcphdr *)(ip6 + 1); - - tso_info->lso_v2_xmit.ip_version = - RNDIS_TCP_LARGE_SEND_OFFLOAD_IPV6; - ip6->ip6_plen = 0; - th->th_sum = - in6_cksum_pseudo(ip6, 0, IPPROTO_TCP, 0); - } -#endif - tso_info->lso_v2_xmit.tcp_header_offset = 0; - tso_info->lso_v2_xmit.mss = m_head->m_pkthdr.tso_segsz; - } else if (m_head->m_pkthdr.csum_flags & sc->hn_csum_assist) { - rndis_msg_size += RNDIS_CSUM_PPI_SIZE; - rppi = hv_set_rppi_data(rndis_mesg, RNDIS_CSUM_PPI_SIZE, - tcpip_chksum_info); - csum_info = (rndis_tcp_ip_csum_info *)((char*)rppi + - rppi->per_packet_info_offset); - - csum_info->xmit.is_ipv4 = 1; - if (m_head->m_pkthdr.csum_flags & CSUM_IP) - csum_info->xmit.ip_header_csum = 1; - - if (m_head->m_pkthdr.csum_flags & CSUM_TCP) { - csum_info->xmit.tcp_csum = 1; - csum_info->xmit.tcp_header_offset = 0; - } else if (m_head->m_pkthdr.csum_flags & CSUM_UDP) { - csum_info->xmit.udp_csum = 1; - } - } - - rndis_mesg->msg_len = packet->tot_data_buf_len + rndis_msg_size; - packet->tot_data_buf_len = rndis_mesg->msg_len; - - /* send packet with send buffer */ - if (packet->tot_data_buf_len < sc->hn_tx_chimney_size) { - uint32_t send_buf_section_idx; - - send_buf_section_idx = - hv_nv_get_next_send_section(net_dev); - if (send_buf_section_idx != - NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX) { - uint8_t *dest = ((uint8_t *)net_dev->send_buf + - (send_buf_section_idx * - net_dev->send_section_size)); - - memcpy(dest, rndis_mesg, rndis_msg_size); - dest += rndis_msg_size; - - m_copydata(m_head, 0, m_head->m_pkthdr.len, - dest); - - packet->send_buf_section_idx = - send_buf_section_idx; - packet->send_buf_section_size = - packet->tot_data_buf_len; - packet->page_buf_count = 0; - sc->hn_tx_chimney++; - goto do_send; - } - } - - error = hn_txdesc_dmamap_load(sc, txd, &m_head, segs, &nsegs); + error = hn_encap(sc, txd, &m_head); if (error) { - int freed; - - /* - * This mbuf is not linked w/ the txd yet, so free - * it now. - */ - m_freem(m_head); - freed = hn_txdesc_put(sc, txd); - KASSERT(freed != 0, - ("fail to free txd upon txdma error")); - - sc->hn_txdma_failed++; - if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + /* Both txd and m_head are freed */ continue; } - - packet->page_buf_count = nsegs + - HV_RF_NUM_TX_RESERVED_PAGE_BUFS; - - /* send packet with page buffer */ - packet->page_buffers[0].pfn = atop(txd->rndis_msg_paddr); - packet->page_buffers[0].offset = - txd->rndis_msg_paddr & PAGE_MASK; - packet->page_buffers[0].length = rndis_msg_size; - - /* - * Fill the page buffers with mbuf info starting at index - * HV_RF_NUM_TX_RESERVED_PAGE_BUFS. - */ - for (i = 0; i < nsegs; ++i) { - hv_vmbus_page_buffer *pb = &packet->page_buffers[ - i + HV_RF_NUM_TX_RESERVED_PAGE_BUFS]; - - pb->pfn = atop(segs[i].ds_addr); - pb->offset = segs[i].ds_addr & PAGE_MASK; - pb->length = segs[i].ds_len; - } - - packet->send_buf_section_idx = - NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX; - packet->send_buf_section_size = 0; - -do_send: - txd->m = m_head; - - /* Set the completion routine */ - packet->compl.send.on_send_completion = netvsc_xmit_completion; - packet->compl.send.send_completion_context = packet; - packet->compl.send.send_completion_tid = - (uint64_t)(uintptr_t)txd; - again: /* * Make sure that txd is not freed before ETHER_BPF_MTAP. */ hn_txdesc_hold(txd); - error = hv_nv_on_send(device_ctx, packet); + error = hv_nv_on_send(device_ctx, &txd->netvsc_pkt); if (!error) { ETHER_BPF_MTAP(ifp, m_head); if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); From owner-svn-src-all@freebsd.org Mon Jun 13 06:24:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9B4FAF0E85; Mon, 13 Jun 2016 06:24:42 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C11F42ADF; Mon, 13 Jun 2016 06:24:42 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5D6OfwG062067; Mon, 13 Jun 2016 06:24:41 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5D6Ofcw062065; Mon, 13 Jun 2016 06:24:41 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606130624.u5D6Ofcw062065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 13 Jun 2016 06:24:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301858 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 06:24:43 -0000 Author: sephe Date: Mon Jun 13 06:24:41 2016 New Revision: 301858 URL: https://svnweb.freebsd.org/changeset/base/301858 Log: MFC 295304,295305,295306 295304 hyperv/hn: Increase LRO entry count to 128 by default hn(4) only has one RX ring currently, so default 8 LRO entries are too small. Reviewed by: adrian Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5166 295305 hyperv/hn: Move LRO flush to the channel processing rollup This significantly increases LRO aggregation ratio when there are large amount of connections (improves reception performance a lot). Reviewed by: adrian Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5167 295306 hyperv/hn: Add an option to always do transmission scheduling It is off by default. This eases more experiment on hn(4). Reviewed by: adrian, Hongjiang Zhang Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5175 Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Jun 13 06:09:02 2016 (r301857) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Jun 13 06:24:41 2016 (r301858) @@ -1024,6 +1024,7 @@ typedef struct hn_softc { int hn_txdesc_avail; int hn_txeof; + int hn_sched_tx; int hn_direct_tx_size; struct taskqueue *hn_tx_taskq; struct task hn_start_task; Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 06:09:02 2016 (r301857) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 06:24:41 2016 (r301858) @@ -132,6 +132,8 @@ __FBSDID("$FreeBSD$"); /* YYY should get it from the underlying channel */ #define HN_TX_DESC_CNT 512 +#define HN_LROENT_CNT_DEF 128 + #define HN_RNDIS_MSG_LEN \ (sizeof(rndis_msg) + \ RNDIS_VLAN_PPI_SIZE + \ @@ -232,6 +234,13 @@ TUNABLE_INT("dev.hn.tx_chimney_size", &h static int hn_direct_tx_size = HN_DIRECT_TX_SIZE_DEF; TUNABLE_INT("dev.hn.direct_tx_size", &hn_direct_tx_size); +#if defined(INET) || defined(INET6) +#if __FreeBSD_version >= 1100095 +static int hn_lro_entry_count = HN_LROENT_CNT_DEF; +TUNABLE_INT("dev.hn.lro_entry_count", &hn_lro_entry_count); +#endif +#endif + /* * Forward declarations */ @@ -335,6 +344,11 @@ netvsc_attach(device_t dev) #if __FreeBSD_version >= 1100045 int tso_maxlen; #endif +#if defined(INET) || defined(INET6) +#if __FreeBSD_version >= 1100095 + int lroent_cnt; +#endif +#endif sc = device_get_softc(dev); if (sc == NULL) { @@ -417,9 +431,17 @@ netvsc_attach(device_t dev) } #if defined(INET) || defined(INET6) +#if __FreeBSD_version >= 1100095 + lroent_cnt = hn_lro_entry_count; + if (lroent_cnt < TCP_LRO_ENTRIES) + lroent_cnt = TCP_LRO_ENTRIES; + tcp_lro_init_args(&sc->hn_lro, ifp, lroent_cnt, 0); + device_printf(dev, "LRO: entry count %d\n", lroent_cnt); +#else tcp_lro_init(&sc->hn_lro); /* Driver private LRO settings */ sc->hn_lro.ifp = ifp; +#endif #ifdef HN_LRO_HIWAT sc->hn_lro.lro_hiwat = sc->hn_lro_hiwat; #endif @@ -512,6 +534,10 @@ netvsc_attach(device_t dev) SYSCTL_ADD_INT(ctx, child, OID_AUTO, "direct_tx_size", CTLFLAG_RW, &sc->hn_direct_tx_size, 0, "Size of the packet for direct transmission"); + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "sched_tx", + CTLFLAG_RW, &sc->hn_sched_tx, 0, + "Always schedule transmission " + "instead of doing direct transmission"); if (unit == 0) { struct sysctl_ctx_list *dc_ctx; @@ -547,6 +573,12 @@ netvsc_attach(device_t dev) SYSCTL_ADD_INT(dc_ctx, dc_child, OID_AUTO, "direct_tx_size", CTLFLAG_RD, &hn_direct_tx_size, 0, "Size of the packet for direct transmission"); +#if defined(INET) || defined(INET6) +#if __FreeBSD_version >= 1100095 + SYSCTL_ADD_INT(dc_ctx, dc_child, OID_AUTO, "lro_entry_count", + CTLFLAG_RD, &hn_lro_entry_count, 0, "LRO entry count"); +#endif +#endif } return (0); @@ -736,6 +768,15 @@ void netvsc_channel_rollup(struct hv_device *device_ctx) { struct hn_softc *sc = device_get_softc(device_ctx->device); +#if defined(INET) || defined(INET6) + struct lro_ctrl *lro = &sc->hn_lro; + struct lro_entry *queued; + + while ((queued = SLIST_FIRST(&lro->lro_active)) != NULL) { + SLIST_REMOVE_HEAD(&lro->lro_active, next); + tcp_lro_flush(lro, queued); + } +#endif if (!sc->hn_txeof) return; @@ -1312,18 +1353,8 @@ skip: } void -netvsc_recv_rollup(struct hv_device *device_ctx) +netvsc_recv_rollup(struct hv_device *device_ctx __unused) { -#if defined(INET) || defined(INET6) - hn_softc_t *sc = device_get_softc(device_ctx->device); - struct lro_ctrl *lro = &sc->hn_lro; - struct lro_entry *queued; - - while ((queued = SLIST_FIRST(&lro->lro_active)) != NULL) { - SLIST_REMOVE_HEAD(&lro->lro_active, next); - tcp_lro_flush(lro, queued); - } -#endif } /* @@ -1577,9 +1608,11 @@ hn_stop(hn_softc_t *sc) static void hn_start(struct ifnet *ifp) { - hn_softc_t *sc; + struct hn_softc *sc = ifp->if_softc; + + if (sc->hn_sched_tx) + goto do_sched; - sc = ifp->if_softc; if (NV_TRYLOCK(sc)) { int sched; @@ -1588,15 +1621,18 @@ hn_start(struct ifnet *ifp) if (!sched) return; } +do_sched: taskqueue_enqueue_fast(sc->hn_tx_taskq, &sc->hn_start_task); } static void hn_start_txeof(struct ifnet *ifp) { - hn_softc_t *sc; + struct hn_softc *sc = ifp->if_softc; + + if (sc->hn_sched_tx) + goto do_sched; - sc = ifp->if_softc; if (NV_TRYLOCK(sc)) { int sched; @@ -1608,6 +1644,7 @@ hn_start_txeof(struct ifnet *ifp) &sc->hn_start_task); } } else { +do_sched: /* * Release the OACTIVE earlier, with the hope, that * others could catch up. The task will clear the From owner-svn-src-all@freebsd.org Mon Jun 13 06:38:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BB85AF11E8; Mon, 13 Jun 2016 06:38:49 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ECB812233; Mon, 13 Jun 2016 06:38:48 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5D6cmmu066216; Mon, 13 Jun 2016 06:38:48 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5D6clMh066204; Mon, 13 Jun 2016 06:38:47 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606130638.u5D6clMh066204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 13 Jun 2016 06:38:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301859 - in stable/10/sys/dev/hyperv: include netvsc utilities vmbus X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 06:38:49 -0000 Author: sephe Date: Mon Jun 13 06:38:46 2016 New Revision: 301859 URL: https://svnweb.freebsd.org/changeset/base/301859 Log: MFC 295307,295308,295309,295606 295307 hyperv: Use standard taskqueue instead of hv_work_queue HyperV code was ported from Linux. There is an implementation of work queue called hv_work_queue. In FreeBSD, taskqueue could be used for the same purpose. Convert all the consumer of hv_work_queue to use taskqueue, and remove work queue implementation. Submitted by: Jun Su Reviewed by: adrian, Hongjiang Zhang Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D4963 295308 hyperv: Use WAITOK in the places where we can wait And convert rndis non-hot path spinlock to mutex. Submitted by: Jun Su Reviewed by: adrian, sephe Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5081 295309 hyperv: Use malloc for page allocation. We will eventually convert them to use busdma. Submitted by: Jun Su Reviewed by: adrian, sephe, Dexuan Cui Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5087 295606 hyperv/hn: Fix typo in comment Noticed by: avos Reviewed by: adrian, avos, Hongjiang Zhang Approved by: adrian MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5199 Modified: stable/10/sys/dev/hyperv/include/hyperv.h stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c stable/10/sys/dev/hyperv/utilities/hv_kvp.c stable/10/sys/dev/hyperv/utilities/hv_util.c stable/10/sys/dev/hyperv/vmbus/hv_channel.c stable/10/sys/dev/hyperv/vmbus/hv_channel_mgmt.c stable/10/sys/dev/hyperv/vmbus/hv_connection.c stable/10/sys/dev/hyperv/vmbus/hv_hv.c stable/10/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c stable/10/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/include/hyperv.h ============================================================================== --- stable/10/sys/dev/hyperv/include/hyperv.h Mon Jun 13 06:24:41 2016 (r301858) +++ stable/10/sys/dev/hyperv/include/hyperv.h Mon Jun 13 06:38:46 2016 (r301859) @@ -908,30 +908,6 @@ int hv_vmbus_channel_teardown_gpdal( struct hv_vmbus_channel* vmbus_select_outgoing_channel(struct hv_vmbus_channel *promary); -/* - * Work abstraction defines - */ -typedef struct hv_work_queue { - struct taskqueue* queue; - struct proc* proc; - struct sema* work_sema; -} hv_work_queue; - -typedef struct hv_work_item { - struct task work; - void (*callback)(void *); - void* context; - hv_work_queue* wq; -} hv_work_item; - -struct hv_work_queue* hv_work_queue_create(char* name); - -void hv_work_queue_close(struct hv_work_queue* wq); - -int hv_queue_work_item( - hv_work_queue* wq, - void (*callback)(void *), - void* context); /** * @brief Get physical address from virtual */ @@ -952,8 +928,8 @@ typedef struct hv_vmbus_service { hv_guid guid; /* Hyper-V GUID */ char *name; /* name of service */ boolean_t enabled; /* service enabled */ - hv_work_queue *work_queue; /* background work queue */ - + void* context; + struct task task; /* * function to initialize service */ @@ -963,6 +939,11 @@ typedef struct hv_vmbus_service { * function to process Hyper-V messages */ void (*callback)(void *); + + /* + * function to uninitilize service + */ + int (*uninit)(struct hv_vmbus_service *); } hv_vmbus_service; extern uint8_t* receive_buffer[]; Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Jun 13 06:24:41 2016 (r301858) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Jun 13 06:38:46 2016 (r301859) @@ -73,10 +73,7 @@ hv_nv_alloc_net_device(struct hv_device netvsc_dev *net_dev; hn_softc_t *sc = device_get_softc(device->device); - net_dev = malloc(sizeof(netvsc_dev), M_NETVSC, M_NOWAIT | M_ZERO); - if (net_dev == NULL) { - return (NULL); - } + net_dev = malloc(sizeof(netvsc_dev), M_NETVSC, M_WAITOK | M_ZERO); net_dev->dev = device; net_dev->destroy = FALSE; @@ -223,11 +220,7 @@ hv_nv_init_rx_buffer_with_net_vsp(struct init_pkt->msgs.vers_1_msgs.send_rx_buf_complete.num_sections; net_dev->rx_sections = malloc(net_dev->rx_section_count * - sizeof(nvsp_1_rx_buf_section), M_NETVSC, M_NOWAIT); - if (net_dev->rx_sections == NULL) { - ret = EINVAL; - goto cleanup; - } + sizeof(nvsp_1_rx_buf_section), M_NETVSC, M_WAITOK); memcpy(net_dev->rx_sections, init_pkt->msgs.vers_1_msgs.send_rx_buf_complete.sections, net_dev->rx_section_count * sizeof(nvsp_1_rx_buf_section)); @@ -325,11 +318,7 @@ hv_nv_init_send_buffer_with_net_vsp(stru BITS_PER_LONG); net_dev->send_section_bitsmap = malloc(net_dev->bitsmap_words * sizeof(long), M_NETVSC, - M_NOWAIT | M_ZERO); - if (NULL == net_dev->send_section_bitsmap) { - ret = ENOMEM; - goto cleanup; - } + M_WAITOK | M_ZERO); goto exit; Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 06:24:41 2016 (r301858) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 06:38:46 2016 (r301859) @@ -787,7 +787,7 @@ netvsc_channel_rollup(struct hv_device * /* * NOTE: - * This this function fails, then both txd and m_head0 will be freed + * If this function fails, then both txd and m_head0 will be freed. */ static int hn_encap(struct hn_softc *sc, struct hn_txdesc *txd, struct mbuf **m_head0) Modified: stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Jun 13 06:24:41 2016 (r301858) +++ stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Jun 13 06:38:46 2016 (r301859) @@ -136,12 +136,9 @@ hv_get_rndis_device(void) { rndis_device *device; - device = malloc(sizeof(rndis_device), M_NETVSC, M_NOWAIT | M_ZERO); - if (device == NULL) { - return (NULL); - } + device = malloc(sizeof(rndis_device), M_NETVSC, M_WAITOK | M_ZERO); - mtx_init(&device->req_lock, "HV-FRL", NULL, MTX_SPIN | MTX_RECURSE); + mtx_init(&device->req_lock, "HV-FRL", NULL, MTX_DEF); /* Same effect as STAILQ_HEAD_INITIALIZER() static initializer */ STAILQ_INIT(&device->myrequest_list); @@ -172,10 +169,7 @@ hv_rndis_request(rndis_device *device, u rndis_msg *rndis_mesg; rndis_set_request *set; - request = malloc(sizeof(rndis_request), M_NETVSC, M_NOWAIT | M_ZERO); - if (request == NULL) { - return (NULL); - } + request = malloc(sizeof(rndis_request), M_NETVSC, M_WAITOK | M_ZERO); sema_init(&request->wait_sema, 0, "rndis sema"); @@ -194,9 +188,9 @@ hv_rndis_request(rndis_device *device, u set->request_id += 1; /* Add to the request list */ - mtx_lock_spin(&device->req_lock); + mtx_lock(&device->req_lock); STAILQ_INSERT_TAIL(&device->myrequest_list, request, mylist_entry); - mtx_unlock_spin(&device->req_lock); + mtx_unlock(&device->req_lock); return (request); } @@ -207,14 +201,14 @@ hv_rndis_request(rndis_device *device, u static inline void hv_put_rndis_request(rndis_device *device, rndis_request *request) { - mtx_lock_spin(&device->req_lock); + mtx_lock(&device->req_lock); /* Fixme: Has O(n) performance */ /* * XXXKYS: Use Doubly linked lists. */ STAILQ_REMOVE(&device->myrequest_list, request, rndis_request_, mylist_entry); - mtx_unlock_spin(&device->req_lock); + mtx_unlock(&device->req_lock); sema_destroy(&request->wait_sema); free(request, M_NETVSC); @@ -271,7 +265,7 @@ hv_rf_receive_response(rndis_device *dev rndis_request *next_request; boolean_t found = FALSE; - mtx_lock_spin(&device->req_lock); + mtx_lock(&device->req_lock); request = STAILQ_FIRST(&device->myrequest_list); while (request != NULL) { /* @@ -286,7 +280,7 @@ hv_rf_receive_response(rndis_device *dev next_request = STAILQ_NEXT(request, mylist_entry); request = next_request; } - mtx_unlock_spin(&device->req_lock); + mtx_unlock(&device->req_lock); if (found) { if (response->msg_len <= sizeof(rndis_msg)) { Modified: stable/10/sys/dev/hyperv/utilities/hv_kvp.c ============================================================================== --- stable/10/sys/dev/hyperv/utilities/hv_kvp.c Mon Jun 13 06:24:41 2016 (r301858) +++ stable/10/sys/dev/hyperv/utilities/hv_kvp.c Mon Jun 13 06:38:46 2016 (r301859) @@ -98,7 +98,7 @@ static d_poll_t hv_kvp_dev_daemon_poll; static int hv_kvp_req_in_progress(void); static void hv_kvp_transaction_init(uint32_t, hv_vmbus_channel *, uint64_t, uint8_t *); static void hv_kvp_send_msg_to_daemon(void); -static void hv_kvp_process_request(void *context); +static void hv_kvp_process_request(void *context, int pending); /* hv_kvp character device structure */ static struct cdevsw hv_kvp_cdevsw = @@ -123,9 +123,6 @@ static struct selinfo hv_kvp_selinfo; */ static struct { - /* Pre-allocated work item for queue */ - hv_work_item work_item; - /* Unless specified the pending mutex should be * used to alter the values of the following paramters: * 1. req_in_progress @@ -642,7 +639,7 @@ hv_kvp_send_msg_to_daemon(void) * and interact with daemon */ static void -hv_kvp_process_request(void *context) +hv_kvp_process_request(void *context, int pending) { uint8_t *kvp_buf; hv_vmbus_channel *channel = context; @@ -756,23 +753,18 @@ hv_kvp_callback(void *context) uint64_t pending_cnt = 0; if (kvp_globals.register_done == false) { - kvp_globals.channelp = context; + TASK_INIT(&service_table[HV_KVP].task, 0, hv_kvp_process_request, context); } else { - mtx_lock(&kvp_globals.pending_mutex); kvp_globals.pending_reqs = kvp_globals.pending_reqs + 1; pending_cnt = kvp_globals.pending_reqs; mtx_unlock(&kvp_globals.pending_mutex); if (pending_cnt == 1) { hv_kvp_log_info("%s: Queuing work item\n", __func__); - hv_queue_work_item( - service_table[HV_KVP].work_queue, - hv_kvp_process_request, - context - ); + taskqueue_enqueue(taskqueue_thread, &service_table[HV_KVP].task); } - } + } } @@ -977,26 +969,13 @@ int hv_kvp_init(hv_vmbus_service *srv) { int error = 0; - hv_work_queue *work_queue = NULL; - - memset(&kvp_globals, 0, sizeof(kvp_globals)); - work_queue = hv_work_queue_create("KVP Service"); - if (work_queue == NULL) { - hv_kvp_log_info("%s: Work queue alloc failed\n", __func__); - error = ENOMEM; - hv_kvp_log_error("%s: ENOMEM\n", __func__); - goto Finish; - } - srv->work_queue = work_queue; + memset(&kvp_globals, 0, sizeof(kvp_globals)); error = hv_kvp_dev_init(); mtx_init(&kvp_globals.pending_mutex, "hv-kvp pending mutex", - NULL, MTX_DEF); - kvp_globals.pending_reqs = 0; - + NULL, MTX_DEF); -Finish: return (error); } Modified: stable/10/sys/dev/hyperv/utilities/hv_util.c ============================================================================== --- stable/10/sys/dev/hyperv/utilities/hv_util.c Mon Jun 13 06:24:41 2016 (r301858) +++ stable/10/sys/dev/hyperv/utilities/hv_util.c Mon Jun 13 06:38:46 2016 (r301859) @@ -52,6 +52,8 @@ static void hv_heartbeat_cb(void *contex static void hv_timesync_cb(void *context); static int hv_timesync_init(hv_vmbus_service *serv); +static int hv_timesync_uninit(hv_vmbus_service *serv); +static void hv_set_host_time(void *context, int pending); /* * Note: GUID codes below are predefined by the host hypervisor @@ -73,6 +75,7 @@ hv_vmbus_service service_table[] = { .enabled = TRUE, .init = hv_timesync_init, .callback = hv_timesync_cb, + .uninit = hv_timesync_uninit, }, /* Heartbeat Service */ @@ -111,10 +114,16 @@ struct hv_ictimesync_data { static int hv_timesync_init(hv_vmbus_service *serv) { + void *time_msg = malloc(sizeof(time_sync_data), M_DEVBUF, M_WAITOK); + TASK_INIT(&serv->task, 1, hv_set_host_time, time_msg); + return (0); +} - serv->work_queue = hv_work_queue_create("Time Sync"); - if (serv->work_queue == NULL) - return (ENOMEM); +static int +hv_timesync_uninit(hv_vmbus_service *serv) +{ + taskqueue_drain(taskqueue_thread, &serv->task); + free(serv->task.ta_context, M_DEVBUF); return (0); } @@ -152,9 +161,9 @@ hv_negotiate_version( * Set host time based on time sync message from host */ static void -hv_set_host_time(void *context) +hv_set_host_time(void *context, int pending) { - time_sync_data* time_msg = (time_sync_data*) context; + time_sync_data* time_msg = (time_sync_data*) context; uint64_t hosttime = time_msg->data; struct timespec guest_ts, host_ts; uint64_t host_tns; @@ -166,7 +175,7 @@ hv_set_host_time(void *context) host_ts.tv_nsec = (long)(host_tns%HV_NANO_SEC_PER_SEC); nanotime(&guest_ts); - + diff = (int64_t)host_ts.tv_sec - (int64_t)guest_ts.tv_sec; /* @@ -175,12 +184,7 @@ hv_set_host_time(void *context) if (diff > 5 || diff < -5) { error = kern_clock_settime(curthread, CLOCK_REALTIME, &host_ts); - } - - /* - * Free the hosttime that was allocated in hv_adj_guesttime() - */ - free(time_msg, M_DEVBUF); + } } /** @@ -197,23 +201,13 @@ hv_set_host_time(void *context) static inline void hv_adj_guesttime(uint64_t hosttime, uint8_t flags) { - time_sync_data* time_msg; - - time_msg = malloc(sizeof(time_sync_data), M_DEVBUF, M_NOWAIT); + time_sync_data* time_msg = service_table[HV_TIME_SYNCH].task.ta_context; - if (time_msg == NULL) - return; - time_msg->data = hosttime; - if ((flags & HV_ICTIMESYNCFLAG_SYNC) != 0) { - hv_queue_work_item(service_table[HV_TIME_SYNCH].work_queue, - hv_set_host_time, time_msg); - } else if ((flags & HV_ICTIMESYNCFLAG_SAMPLE) != 0) { - hv_queue_work_item(service_table[HV_TIME_SYNCH].work_queue, - hv_set_host_time, time_msg); - } else { - free(time_msg, M_DEVBUF); + if (((flags & HV_ICTIMESYNCFLAG_SYNC) != 0) || + ((flags & HV_ICTIMESYNCFLAG_SAMPLE) != 0)) { + taskqueue_enqueue(taskqueue_thread, &service_table[HV_TIME_SYNCH].task); } } @@ -452,19 +446,14 @@ hv_util_detach(device_t dev) service = device_get_softc(dev); receive_buffer_offset = service - &service_table[0]; - if (service->work_queue != NULL) - hv_work_queue_close(service->work_queue); + if (service->uninit != NULL) + service->uninit(service); free(receive_buffer[receive_buffer_offset], M_DEVBUF); receive_buffer[receive_buffer_offset] = NULL; return (0); } -static void -hv_util_init(void) -{ -} - static int hv_util_modevent(module_t mod, int event, void *arg) { @@ -495,6 +484,3 @@ static devclass_t util_devclass; DRIVER_MODULE(hv_utils, vmbus, util_driver, util_devclass, hv_util_modevent, 0); MODULE_VERSION(hv_utils, 1); MODULE_DEPEND(hv_utils, vmbus, 1, 1, 1); - -SYSINIT(hv_util_initx, SI_SUB_KTHREAD_IDLE, SI_ORDER_MIDDLE + 1, - hv_util_init, NULL); Modified: stable/10/sys/dev/hyperv/vmbus/hv_channel.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_channel.c Mon Jun 13 06:24:41 2016 (r301858) +++ stable/10/sys/dev/hyperv/vmbus/hv_channel.c Mon Jun 13 06:38:46 2016 (r301859) @@ -69,9 +69,7 @@ vmbus_channel_set_event(hv_vmbus_channel + ((channel->offer_msg.child_rel_id >> 5)))); monitor_page = (hv_vmbus_monitor_page *) - hv_vmbus_g_connection.monitor_pages; - - monitor_page++; /* Get the child to parent monitor page */ + hv_vmbus_g_connection.monitor_page_2; synch_set_bit(channel->monitor_bit, (uint32_t *)&monitor_page-> Modified: stable/10/sys/dev/hyperv/vmbus/hv_channel_mgmt.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Mon Jun 13 06:24:41 2016 (r301858) +++ stable/10/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Mon Jun 13 06:38:46 2016 (r301859) @@ -39,8 +39,10 @@ __FBSDID("$FreeBSD$"); */ static void vmbus_channel_on_offer(hv_vmbus_channel_msg_header* hdr); +static void vmbus_channel_on_offer_internal(void* context); static void vmbus_channel_on_open_result(hv_vmbus_channel_msg_header* hdr); static void vmbus_channel_on_offer_rescind(hv_vmbus_channel_msg_header* hdr); +static void vmbus_channel_on_offer_rescind_internal(void* context); static void vmbus_channel_on_gpadl_created(hv_vmbus_channel_msg_header* hdr); static void vmbus_channel_on_gpadl_torndown(hv_vmbus_channel_msg_header* hdr); static void vmbus_channel_on_offers_delivered(hv_vmbus_channel_msg_header* hdr); @@ -52,41 +54,46 @@ static void vmbus_channel_on_version_res hv_vmbus_channel_msg_table_entry g_channel_message_table[HV_CHANNEL_MESSAGE_COUNT] = { { HV_CHANNEL_MESSAGE_INVALID, - 0, NULL }, + NULL }, { HV_CHANNEL_MESSAGE_OFFER_CHANNEL, - 0, vmbus_channel_on_offer }, + vmbus_channel_on_offer }, { HV_CHANNEL_MESSAGE_RESCIND_CHANNEL_OFFER, - 0, vmbus_channel_on_offer_rescind }, + vmbus_channel_on_offer_rescind }, { HV_CHANNEL_MESSAGE_REQUEST_OFFERS, - 0, NULL }, + NULL }, { HV_CHANNEL_MESSAGE_ALL_OFFERS_DELIVERED, - 1, vmbus_channel_on_offers_delivered }, + vmbus_channel_on_offers_delivered }, { HV_CHANNEL_MESSAGE_OPEN_CHANNEL, - 0, NULL }, + NULL }, { HV_CHANNEL_MESSAGE_OPEN_CHANNEL_RESULT, - 1, vmbus_channel_on_open_result }, + vmbus_channel_on_open_result }, { HV_CHANNEL_MESSAGE_CLOSE_CHANNEL, - 0, NULL }, + NULL }, { HV_CHANNEL_MESSAGEL_GPADL_HEADER, - 0, NULL }, + NULL }, { HV_CHANNEL_MESSAGE_GPADL_BODY, - 0, NULL }, + NULL }, { HV_CHANNEL_MESSAGE_GPADL_CREATED, - 1, vmbus_channel_on_gpadl_created }, + vmbus_channel_on_gpadl_created }, { HV_CHANNEL_MESSAGE_GPADL_TEARDOWN, - 0, NULL }, + NULL }, { HV_CHANNEL_MESSAGE_GPADL_TORNDOWN, - 1, vmbus_channel_on_gpadl_torndown }, + vmbus_channel_on_gpadl_torndown }, { HV_CHANNEL_MESSAGE_REL_ID_RELEASED, - 0, NULL }, + NULL }, { HV_CHANNEL_MESSAGE_INITIATED_CONTACT, - 0, NULL }, + NULL }, { HV_CHANNEL_MESSAGE_VERSION_RESPONSE, - 1, vmbus_channel_on_version_response }, + vmbus_channel_on_version_response }, { HV_CHANNEL_MESSAGE_UNLOAD, - 0, NULL } + NULL } }; +typedef struct hv_work_item { + struct task work; + void (*callback)(void *); + void* context; +} hv_work_item; /** * Implementation of the work abstraction. @@ -96,120 +103,30 @@ work_item_callback(void *work, int pendi { struct hv_work_item *w = (struct hv_work_item *)work; - /* - * Serialize work execution. - */ - if (w->wq->work_sema != NULL) { - sema_wait(w->wq->work_sema); - } - w->callback(w->context); - if (w->wq->work_sema != NULL) { - sema_post(w->wq->work_sema); - } - free(w, M_DEVBUF); } -struct hv_work_queue* -hv_work_queue_create(char* name) -{ - static unsigned int qid = 0; - char qname[64]; - int pri; - struct hv_work_queue* wq; - - wq = malloc(sizeof(struct hv_work_queue), M_DEVBUF, M_NOWAIT | M_ZERO); - KASSERT(wq != NULL, ("Error VMBUS: Failed to allocate work_queue\n")); - if (wq == NULL) - return (NULL); - - /* - * We use work abstraction to handle messages - * coming from the host and these are typically offers. - * Some FreeBsd drivers appear to have a concurrency issue - * where probe/attach needs to be serialized. We ensure that - * by having only one thread process work elements in a - * specific queue by serializing work execution. - * - */ - if (strcmp(name, "vmbusQ") == 0) { - pri = PI_DISK; - } else { /* control */ - pri = PI_NET; - /* - * Initialize semaphore for this queue by pointing - * to the globale semaphore used for synchronizing all - * control messages. - */ - wq->work_sema = &hv_vmbus_g_connection.control_sema; - } - - sprintf(qname, "hv_%s_%u", name, qid); - - /* - * Fixme: FreeBSD 8.2 has a different prototype for - * taskqueue_create(), and for certain other taskqueue functions. - * We need to research the implications of these changes. - * Fixme: Not sure when the changes were introduced. - */ - wq->queue = taskqueue_create(qname, M_NOWAIT, taskqueue_thread_enqueue, - &wq->queue - #if __FreeBSD_version < 800000 - , &wq->proc - #endif - ); - - if (wq->queue == NULL) { - free(wq, M_DEVBUF); - return (NULL); - } - - if (taskqueue_start_threads(&wq->queue, 1, pri, "%s taskq", qname)) { - taskqueue_free(wq->queue); - free(wq, M_DEVBUF); - return (NULL); - } - - qid++; - - return (wq); -} - -void -hv_work_queue_close(struct hv_work_queue *wq) -{ - /* - * KYS: Need to drain the taskqueue - * before we close the hv_work_queue. - */ - /*KYS: taskqueue_drain(wq->tq, ); */ - taskqueue_free(wq->queue); - free(wq, M_DEVBUF); -} - /** * @brief Create work item */ -int +static int hv_queue_work_item( - struct hv_work_queue *wq, void (*callback)(void *), void *context) { struct hv_work_item *w = malloc(sizeof(struct hv_work_item), - M_DEVBUF, M_NOWAIT | M_ZERO); + M_DEVBUF, M_NOWAIT); KASSERT(w != NULL, ("Error VMBUS: Failed to allocate WorkItem\n")); if (w == NULL) return (ENOMEM); w->callback = callback; w->context = context; - w->wq = wq; TASK_INIT(&w->work, 0, work_item_callback, w); - return (taskqueue_enqueue(wq->queue, &w->work)); + return (taskqueue_enqueue(taskqueue_thread, &w->work)); } @@ -224,10 +141,7 @@ hv_vmbus_allocate_channel(void) channel = (hv_vmbus_channel*) malloc( sizeof(hv_vmbus_channel), M_DEVBUF, - M_NOWAIT | M_ZERO); - KASSERT(channel != NULL, ("Error VMBUS: Failed to allocate channel!")); - if (channel == NULL) - return (NULL); + M_WAITOK | M_ZERO); mtx_init(&channel->inbound_lock, "channel inbound", NULL, MTX_DEF); mtx_init(&channel->sc_lock, "vmbus multi channel", NULL, MTX_DEF); @@ -238,16 +152,6 @@ hv_vmbus_allocate_channel(void) } /** - * @brief Release the vmbus channel object itself - */ -static inline void -ReleaseVmbusChannel(void *context) -{ - hv_vmbus_channel* channel = (hv_vmbus_channel*) context; - free(channel, M_DEVBUF); -} - -/** * @brief Release the resources used by the vmbus channel object */ void @@ -255,13 +159,8 @@ hv_vmbus_free_vmbus_channel(hv_vmbus_cha { mtx_destroy(&channel->sc_lock); mtx_destroy(&channel->inbound_lock); - /* - * We have to release the channel's workqueue/thread in - * the vmbus's workqueue/thread context - * ie we can't destroy ourselves - */ - hv_queue_work_item(hv_vmbus_g_connection.work_queue, - ReleaseVmbusChannel, (void *) channel); + + free(channel, M_DEVBUF); } /** @@ -459,7 +358,7 @@ static void vmbus_channel_on_offer(hv_vmbus_channel_msg_header* hdr) { hv_vmbus_channel_offer_channel* offer; - hv_vmbus_channel* new_channel; + hv_vmbus_channel_offer_channel* copied; offer = (hv_vmbus_channel_offer_channel*) hdr; @@ -469,10 +368,25 @@ vmbus_channel_on_offer(hv_vmbus_channel_ guidType = &offer->offer.interface_type; guidInstance = &offer->offer.interface_instance; + // copy offer data + copied = malloc(sizeof(*copied), M_DEVBUF, M_NOWAIT); + if (copied == NULL) { + printf("fail to allocate memory\n"); + return; + } + + memcpy(copied, hdr, sizeof(*copied)); + hv_queue_work_item(vmbus_channel_on_offer_internal, copied); +} + +static void +vmbus_channel_on_offer_internal(void* context) +{ + hv_vmbus_channel* new_channel; + + hv_vmbus_channel_offer_channel* offer = (hv_vmbus_channel_offer_channel*)context; /* Allocate the channel object and save this offer */ new_channel = hv_vmbus_allocate_channel(); - if (new_channel == NULL) - return; /* * By default we setup state to enable batched @@ -512,6 +426,8 @@ vmbus_channel_on_offer(hv_vmbus_channel_ new_channel->monitor_bit = (uint8_t) offer->monitor_id % 32; vmbus_channel_process_offer(new_channel); + + free(offer, M_DEVBUF); } /** @@ -529,13 +445,20 @@ vmbus_channel_on_offer_rescind(hv_vmbus_ rescind = (hv_vmbus_channel_rescind_offer*) hdr; channel = hv_vmbus_g_connection.channels[rescind->child_rel_id]; - if (channel == NULL) + if (channel == NULL) return; - hv_vmbus_child_device_unregister(channel->device); - mtx_lock(&hv_vmbus_g_connection.channel_lock); + hv_queue_work_item(vmbus_channel_on_offer_rescind_internal, channel); hv_vmbus_g_connection.channels[rescind->child_rel_id] = NULL; - mtx_unlock(&hv_vmbus_g_connection.channel_lock); +} + +static void +vmbus_channel_on_offer_rescind_internal(void *context) +{ + hv_vmbus_channel* channel; + + channel = (hv_vmbus_channel*)context; + hv_vmbus_child_device_unregister(channel->device); } /** @@ -712,35 +635,6 @@ vmbus_channel_on_version_response(hv_vmb } /** - * @brief Handler for channel protocol messages. - * - * This is invoked in the vmbus worker thread context. - */ -void -hv_vmbus_on_channel_message(void *context) -{ - hv_vmbus_message* msg; - hv_vmbus_channel_msg_header* hdr; - int size; - - msg = (hv_vmbus_message*) context; - hdr = (hv_vmbus_channel_msg_header*) msg->u.payload; - size = msg->header.payload_size; - - if (hdr->message_type >= HV_CHANNEL_MESSAGE_COUNT) { - free(msg, M_DEVBUF); - return; - } - - if (g_channel_message_table[hdr->message_type].messageHandler) { - g_channel_message_table[hdr->message_type].messageHandler(hdr); - } - - /* Free the msg that was allocated in VmbusOnMsgDPC() */ - free(msg, M_DEVBUF); -} - -/** * @brief Send a request to get all our pending offers. */ int @@ -765,8 +659,7 @@ hv_vmbus_request_channel_offers(void) ret = hv_vmbus_post_message(msg, sizeof(hv_vmbus_channel_msg_header)); - if (msg_info) - free(msg_info, M_DEVBUF); + free(msg_info, M_DEVBUF); return (ret); } Modified: stable/10/sys/dev/hyperv/vmbus/hv_connection.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_connection.c Mon Jun 13 06:24:41 2016 (r301858) +++ stable/10/sys/dev/hyperv/vmbus/hv_connection.c Mon Jun 13 06:38:46 2016 (r301859) @@ -90,12 +90,10 @@ hv_vmbus_negotiate_version(hv_vmbus_chan hv_vmbus_g_connection.interrupt_page); msg->monitor_page_1 = hv_get_phys_addr( - hv_vmbus_g_connection.monitor_pages); + hv_vmbus_g_connection.monitor_page_1); - msg->monitor_page_2 = - hv_get_phys_addr( - ((uint8_t *) hv_vmbus_g_connection.monitor_pages - + PAGE_SIZE)); + msg->monitor_page_2 = hv_get_phys_addr( + hv_vmbus_g_connection.monitor_page_2); /** * Add to list before we send the request since we may receive the @@ -168,8 +166,6 @@ hv_vmbus_connect(void) { * Initialize the vmbus connection */ hv_vmbus_g_connection.connect_state = HV_CONNECTING; - hv_vmbus_g_connection.work_queue = hv_work_queue_create("vmbusQ"); - sema_init(&hv_vmbus_g_connection.control_sema, 1, "control_sema"); TAILQ_INIT(&hv_vmbus_g_connection.channel_msg_anchor); mtx_init(&hv_vmbus_g_connection.channel_msg_lock, "vmbus channel msg", @@ -183,18 +179,9 @@ hv_vmbus_connect(void) { * Setup the vmbus event connection for channel interrupt abstraction * stuff */ - hv_vmbus_g_connection.interrupt_page = contigmalloc( + hv_vmbus_g_connection.interrupt_page = malloc( PAGE_SIZE, M_DEVBUF, - M_NOWAIT | M_ZERO, 0UL, - BUS_SPACE_MAXADDR, - PAGE_SIZE, 0); - KASSERT(hv_vmbus_g_connection.interrupt_page != NULL, - ("Error VMBUS: malloc failed to allocate Channel" - " Request Event message!")); - if (hv_vmbus_g_connection.interrupt_page == NULL) { - ret = ENOMEM; - goto cleanup; - } + M_WAITOK | M_ZERO); hv_vmbus_g_connection.recv_interrupt_page = hv_vmbus_g_connection.interrupt_page; @@ -207,31 +194,19 @@ hv_vmbus_connect(void) { * Set up the monitor notification facility. The 1st page for * parent->child and the 2nd page for child->parent */ - hv_vmbus_g_connection.monitor_pages = contigmalloc( - 2 * PAGE_SIZE, + hv_vmbus_g_connection.monitor_page_1 = malloc( + PAGE_SIZE, M_DEVBUF, - M_NOWAIT | M_ZERO, - 0UL, - BUS_SPACE_MAXADDR, + M_WAITOK | M_ZERO); + hv_vmbus_g_connection.monitor_page_2 = malloc( PAGE_SIZE, - 0); - KASSERT(hv_vmbus_g_connection.monitor_pages != NULL, - ("Error VMBUS: malloc failed to allocate Monitor Pages!")); - if (hv_vmbus_g_connection.monitor_pages == NULL) { - ret = ENOMEM; - goto cleanup; - } + M_DEVBUF, + M_WAITOK | M_ZERO); msg_info = (hv_vmbus_channel_msg_info*) malloc(sizeof(hv_vmbus_channel_msg_info) + sizeof(hv_vmbus_channel_initiate_contact), - M_DEVBUF, M_NOWAIT | M_ZERO); - KASSERT(msg_info != NULL, - ("Error VMBUS: malloc failed for Initiate Contact message!")); - if (msg_info == NULL) { - ret = ENOMEM; - goto cleanup; - } + M_DEVBUF, M_WAITOK | M_ZERO); hv_vmbus_g_connection.channels = malloc(sizeof(hv_vmbus_channel*) * HV_CHANNEL_MAX_COUNT, @@ -273,8 +248,6 @@ hv_vmbus_connect(void) { hv_vmbus_g_connection.connect_state = HV_DISCONNECTED; - hv_work_queue_close(hv_vmbus_g_connection.work_queue); - sema_destroy(&hv_vmbus_g_connection.control_sema); mtx_destroy(&hv_vmbus_g_connection.channel_lock); mtx_destroy(&hv_vmbus_g_connection.channel_msg_lock); @@ -286,13 +259,8 @@ hv_vmbus_connect(void) { hv_vmbus_g_connection.interrupt_page = NULL; } - if (hv_vmbus_g_connection.monitor_pages != NULL) { - contigfree( - hv_vmbus_g_connection.monitor_pages, - 2 * PAGE_SIZE, - M_DEVBUF); - hv_vmbus_g_connection.monitor_pages = NULL; - } + free(hv_vmbus_g_connection.monitor_page_1, M_DEVBUF); + free(hv_vmbus_g_connection.monitor_page_2, M_DEVBUF); if (msg_info) { sema_destroy(&msg_info->wait_sema); @@ -309,32 +277,19 @@ hv_vmbus_connect(void) { int hv_vmbus_disconnect(void) { int ret = 0; - hv_vmbus_channel_unload* msg; - - msg = malloc(sizeof(hv_vmbus_channel_unload), - M_DEVBUF, M_NOWAIT | M_ZERO); - KASSERT(msg != NULL, - ("Error VMBUS: malloc failed to allocate Channel Unload Msg!")); - if (msg == NULL) - return (ENOMEM); + hv_vmbus_channel_unload msg; - msg->message_type = HV_CHANNEL_MESSAGE_UNLOAD; - - ret = hv_vmbus_post_message(msg, sizeof(hv_vmbus_channel_unload)); + msg.message_type = HV_CHANNEL_MESSAGE_UNLOAD; + ret = hv_vmbus_post_message(&msg, sizeof(hv_vmbus_channel_unload)); contigfree(hv_vmbus_g_connection.interrupt_page, PAGE_SIZE, M_DEVBUF); mtx_destroy(&hv_vmbus_g_connection.channel_msg_lock); - hv_work_queue_close(hv_vmbus_g_connection.work_queue); - sema_destroy(&hv_vmbus_g_connection.control_sema); - free(hv_vmbus_g_connection.channels, M_DEVBUF); hv_vmbus_g_connection.connect_state = HV_DISCONNECTED; - free(msg, M_DEVBUF); - return (ret); } Modified: stable/10/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_hv.c Mon Jun 13 06:24:41 2016 (r301858) +++ stable/10/sys/dev/hyperv/vmbus/hv_hv.c Mon Jun 13 06:38:46 2016 (r301859) @@ -189,11 +189,7 @@ hv_vmbus_init(void) * See if the hypercall page is already set */ hypercall_msr.as_uint64_t = rdmsr(HV_X64_MSR_HYPERCALL); - virt_addr = malloc(PAGE_SIZE, M_DEVBUF, M_NOWAIT | M_ZERO); - KASSERT(virt_addr != NULL, - ("Error VMBUS: malloc failed to allocate page during init!")); - if (virt_addr == NULL) - goto cleanup; + virt_addr = malloc(PAGE_SIZE, M_DEVBUF, M_WAITOK | M_ZERO); hypercall_msr.u.enable = 1; hypercall_msr.u.guest_physical_address = Modified: stable/10/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Mon Jun 13 06:24:41 2016 (r301858) +++ stable/10/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Mon Jun 13 06:38:46 2016 (r301859) @@ -83,8 +83,6 @@ vmbus_msg_swintr(void *arg) hv_vmbus_channel_msg_table_entry *entry; hv_vmbus_channel_msg_type msg_type; hv_vmbus_message* msg; - hv_vmbus_message* copied; - static bool warned = false; cpu = (int)(long)arg; KASSERT(cpu <= mp_maxid, ("VMBUS: vmbus_msg_swintr: " @@ -100,31 +98,15 @@ vmbus_msg_swintr(void *arg) hdr = (hv_vmbus_channel_msg_header *)msg->u.payload; msg_type = hdr->message_type; - if (msg_type >= HV_CHANNEL_MESSAGE_COUNT && !warned) { - warned = true; + if (msg_type >= HV_CHANNEL_MESSAGE_COUNT) { printf("VMBUS: unknown message type = %d\n", msg_type); goto handled; } entry = &g_channel_message_table[msg_type]; - if (entry->handler_no_sleep) + if (entry->messageHandler) entry->messageHandler(hdr); - else { - - copied = malloc(sizeof(hv_vmbus_message), - M_DEVBUF, M_NOWAIT); - KASSERT(copied != NULL, - ("Error VMBUS: malloc failed to allocate" - " hv_vmbus_message!")); - if (copied == NULL) - continue; - - memcpy(copied, msg, sizeof(hv_vmbus_message)); - hv_queue_work_item(hv_vmbus_g_connection.work_queue, - hv_vmbus_on_channel_message, - copied); - } handled: msg->header.message_type = HV_MESSAGE_TYPE_NONE; @@ -309,12 +291,7 @@ hv_vmbus_child_device_create( * Allocate the new child device */ child_dev = malloc(sizeof(hv_device), M_DEVBUF, - M_NOWAIT | M_ZERO); - KASSERT(child_dev != NULL, - ("Error VMBUS: malloc failed to allocate hv_device!")); - - if (child_dev == NULL) - return (NULL); + M_WAITOK | M_ZERO); child_dev->channel = channel; memcpy(&child_dev->class_id, &type, sizeof(hv_guid)); @@ -585,12 +562,7 @@ vmbus_bus_init(void) */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Jun 13 07:03:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FC9EAF165A; Mon, 13 Jun 2016 07:03:01 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51F342CA3; Mon, 13 Jun 2016 07:03:01 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5D730Sq076877; Mon, 13 Jun 2016 07:03:00 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5D730pi076875; Mon, 13 Jun 2016 07:03:00 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606130703.u5D730pi076875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 13 Jun 2016 07:03:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301860 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 07:03:01 -0000 Author: sephe Date: Mon Jun 13 07:03:00 2016 New Revision: 301860 URL: https://svnweb.freebsd.org/changeset/base/301860 Log: MFC 295740,295741,295742 295740 hyperv/hn: Set the TCP ACK/data segment aggregation limit Set TCP ACK append limit to 1, i.e. aggregate 2 ACKs at most. Aggregating anything more than 2 hurts TCP sending performance in hyperv. This significantly improves the TCP sending performance when the number of concurrent connetion is low (2~8). And it greatly stabilizes the TCP sending performance in other cases. Set TCP data segments aggregation length limit to 37500. Without this limitation, hn(4) could aggregate ~45 TCP data segments for each connection (even at 64 or more connections) before dispatching them to socket code; large aggregation slows down ACK sending and eventually hurts/destabilizes TCP reception performance. This setting stabilizes and improves TCP reception performance for >4 concurrent connections significantly. Make them sysctls so they could be adjusted. Reviewed by: adrian, gallatin (previous version), hselasky (previous version) Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5185 295741 hyperv/hn: Add option to allow sharing TX taskq between hn instances It is off by default. This eases further experimenting on this driver. Reviewed by: adrian Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5272 295742 hyperv/hn: Always do transmission scheduling. This one gives the best performance so far. Reviewed by: adrian Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5273 Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Jun 13 06:38:46 2016 (r301859) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Jun 13 07:03:00 2016 (r301860) @@ -1031,7 +1031,6 @@ typedef struct hn_softc { struct task hn_txeof_task; struct lro_ctrl hn_lro; - int hn_lro_hiwat; /* Trust csum verification on host side */ int hn_trust_hcsum; /* HN_TRUST_HCSUM_ */ Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 06:38:46 2016 (r301859) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 07:03:00 2016 (r301860) @@ -176,14 +176,11 @@ struct hn_txdesc { #define HN_CSUM_ASSIST_WIN8 (CSUM_TCP) #define HN_CSUM_ASSIST (CSUM_IP | CSUM_UDP | CSUM_TCP) -/* XXX move to netinet/tcp_lro.h */ -#define HN_LRO_HIWAT_MAX 65535 -#define HN_LRO_HIWAT_DEF HN_LRO_HIWAT_MAX +#define HN_LRO_LENLIM_DEF (25 * ETHERMTU) /* YYY 2*MTU is a bit rough, but should be good enough. */ -#define HN_LRO_HIWAT_MTULIM(ifp) (2 * (ifp)->if_mtu) -#define HN_LRO_HIWAT_ISVALID(sc, hiwat) \ - ((hiwat) >= HN_LRO_HIWAT_MTULIM((sc)->hn_ifp) || \ - (hiwat) <= HN_LRO_HIWAT_MAX) +#define HN_LRO_LENLIM_MIN(ifp) (2 * (ifp)->if_mtu) + +#define HN_LRO_ACKCNT_DEF 1 /* * Be aware that this sleepable mutex will exhibit WITNESS errors when @@ -241,6 +238,11 @@ TUNABLE_INT("dev.hn.lro_entry_count", &h #endif #endif +static int hn_share_tx_taskq = 0; +TUNABLE_INT("hw.hn.share_tx_taskq", &hn_share_tx_taskq); + +static struct taskqueue *hn_tx_taskq; + /* * Forward declarations */ @@ -253,8 +255,9 @@ static void hn_start(struct ifnet *ifp); static void hn_start_txeof(struct ifnet *ifp); static int hn_ifmedia_upd(struct ifnet *ifp); static void hn_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr); -#ifdef HN_LRO_HIWAT -static int hn_lro_hiwat_sysctl(SYSCTL_HANDLER_ARGS); +#if __FreeBSD_version >= 1100099 +static int hn_lro_lenlim_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_lro_ackcnt_sysctl(SYSCTL_HANDLER_ARGS); #endif static int hn_trust_hcsum_sysctl(SYSCTL_HANDLER_ARGS); static int hn_tx_chimney_size_sysctl(SYSCTL_HANDLER_ARGS); @@ -265,15 +268,6 @@ static void hn_start_taskfunc(void *xsc, static void hn_txeof_taskfunc(void *xsc, int pending); static int hn_encap(struct hn_softc *, struct hn_txdesc *, struct mbuf **); -static __inline void -hn_set_lro_hiwat(struct hn_softc *sc, int hiwat) -{ - sc->hn_lro_hiwat = hiwat; -#ifdef HN_LRO_HIWAT - sc->hn_lro.lro_hiwat = sc->hn_lro_hiwat; -#endif -} - static int hn_ifmedia_upd(struct ifnet *ifp __unused) { @@ -358,7 +352,6 @@ netvsc_attach(device_t dev) bzero(sc, sizeof(hn_softc_t)); sc->hn_unit = unit; sc->hn_dev = dev; - sc->hn_lro_hiwat = HN_LRO_HIWAT_DEF; sc->hn_direct_tx_size = hn_direct_tx_size; if (hn_trust_hosttcp) sc->hn_trust_hcsum |= HN_TRUST_HCSUM_TCP; @@ -367,10 +360,14 @@ netvsc_attach(device_t dev) if (hn_trust_hostip) sc->hn_trust_hcsum |= HN_TRUST_HCSUM_IP; - sc->hn_tx_taskq = taskqueue_create_fast("hn_tx", M_WAITOK, - taskqueue_thread_enqueue, &sc->hn_tx_taskq); - taskqueue_start_threads(&sc->hn_tx_taskq, 1, PI_NET, "%s tx", - device_get_nameunit(dev)); + if (hn_tx_taskq == NULL) { + sc->hn_tx_taskq = taskqueue_create_fast("hn_tx", M_WAITOK, + taskqueue_thread_enqueue, &sc->hn_tx_taskq); + taskqueue_start_threads(&sc->hn_tx_taskq, 1, PI_NET, "%s tx", + device_get_nameunit(dev)); + } else { + sc->hn_tx_taskq = hn_tx_taskq; + } TASK_INIT(&sc->hn_start_task, 0, hn_start_taskfunc, sc); TASK_INIT(&sc->hn_txeof_task, 0, hn_txeof_taskfunc, sc); @@ -442,8 +439,9 @@ netvsc_attach(device_t dev) /* Driver private LRO settings */ sc->hn_lro.ifp = ifp; #endif -#ifdef HN_LRO_HIWAT - sc->hn_lro.lro_hiwat = sc->hn_lro_hiwat; +#if __FreeBSD_version >= 1100099 + sc->hn_lro.lro_length_lim = HN_LRO_LENLIM_DEF; + sc->hn_lro.lro_ackcnt_lim = HN_LRO_ACKCNT_DEF; #endif #endif /* INET || INET6 */ @@ -471,6 +469,13 @@ netvsc_attach(device_t dev) hn_tx_chimney_size < sc->hn_tx_chimney_max) sc->hn_tx_chimney_size = hn_tx_chimney_size; + /* + * Always schedule transmission instead of trying + * to do direct transmission. This one gives the + * best performance so far. + */ + sc->hn_sched_tx = 1; + ctx = device_get_sysctl_ctx(dev); child = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); @@ -480,10 +485,13 @@ netvsc_attach(device_t dev) CTLFLAG_RW, &sc->hn_lro.lro_flushed, 0, "LRO flushed"); SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "lro_tried", CTLFLAG_RW, &sc->hn_lro_tried, "# of LRO tries"); -#ifdef HN_LRO_HIWAT - SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_hiwat", - CTLTYPE_INT | CTLFLAG_RW, sc, 0, hn_lro_hiwat_sysctl, - "I", "LRO high watermark"); +#if __FreeBSD_version >= 1100099 + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_length_lim", + CTLTYPE_UINT | CTLFLAG_RW, sc, 0, hn_lro_lenlim_sysctl, "IU", + "Max # of data bytes to be aggregated by LRO"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_ackcnt_lim", + CTLTYPE_INT | CTLFLAG_RW, sc, 0, hn_lro_ackcnt_sysctl, "I", + "Max # of ACKs to be aggregated by LRO"); #endif SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "trust_hosttcp", CTLTYPE_INT | CTLFLAG_RW, sc, HN_TRUST_HCSUM_TCP, @@ -616,7 +624,8 @@ netvsc_detach(device_t dev) taskqueue_drain(sc->hn_tx_taskq, &sc->hn_start_task); taskqueue_drain(sc->hn_tx_taskq, &sc->hn_txeof_task); - taskqueue_free(sc->hn_tx_taskq); + if (sc->hn_tx_taskq != hn_tx_taskq) + taskqueue_free(sc->hn_tx_taskq); ifmedia_removeall(&sc->hn_media); #if defined(INET) || defined(INET6) @@ -1412,12 +1421,15 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, /* Obtain and record requested MTU */ ifp->if_mtu = ifr->ifr_mtu; + +#if __FreeBSD_version >= 1100099 /* - * Make sure that LRO high watermark is still valid, - * after MTU change (the 2*MTU limit). + * Make sure that LRO aggregation length limit is still + * valid, after the MTU change. */ - if (!HN_LRO_HIWAT_ISVALID(sc, sc->hn_lro_hiwat)) - hn_set_lro_hiwat(sc, HN_LRO_HIWAT_MTULIM(ifp)); + if (sc->hn_lro.lro_length_lim < HN_LRO_LENLIM_MIN(ifp)) + sc->hn_lro.lro_length_lim = HN_LRO_LENLIM_MIN(ifp); +#endif do { NV_LOCK(sc); @@ -1724,26 +1736,55 @@ hn_watchdog(struct ifnet *ifp) } #endif -#ifdef HN_LRO_HIWAT +#if __FreeBSD_version >= 1100099 + static int -hn_lro_hiwat_sysctl(SYSCTL_HANDLER_ARGS) +hn_lro_lenlim_sysctl(SYSCTL_HANDLER_ARGS) { struct hn_softc *sc = arg1; - int hiwat, error; + unsigned int lenlim; + int error; - hiwat = sc->hn_lro_hiwat; - error = sysctl_handle_int(oidp, &hiwat, 0, req); + lenlim = sc->hn_lro.lro_length_lim; + error = sysctl_handle_int(oidp, &lenlim, 0, req); if (error || req->newptr == NULL) return error; - if (!HN_LRO_HIWAT_ISVALID(sc, hiwat)) + if (lenlim < HN_LRO_LENLIM_MIN(sc->hn_ifp) || + lenlim > TCP_LRO_LENGTH_MAX) return EINVAL; - if (sc->hn_lro_hiwat != hiwat) - hn_set_lro_hiwat(sc, hiwat); + sc->hn_lro.lro_length_lim = lenlim; return 0; } -#endif /* HN_LRO_HIWAT */ + +static int +hn_lro_ackcnt_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct hn_softc *sc = arg1; + int ackcnt, error; + + /* + * lro_ackcnt_lim is append count limit, + * +1 to turn it into aggregation limit. + */ + ackcnt = sc->hn_lro.lro_ackcnt_lim + 1; + error = sysctl_handle_int(oidp, &ackcnt, 0, req); + if (error || req->newptr == NULL) + return error; + + if (ackcnt < 2 || ackcnt > (TCP_LRO_ACKCNT_MAX + 1)) + return EINVAL; + + /* + * Convert aggregation limit back to append + * count limit. + */ + sc->hn_lro.lro_ackcnt_lim = ackcnt - 1; + return 0; +} + +#endif static int hn_trust_hcsum_sysctl(SYSCTL_HANDLER_ARGS) @@ -2029,6 +2070,28 @@ hn_txeof_taskfunc(void *xsc, int pending NV_UNLOCK(sc); } +static void +hn_tx_taskq_create(void *arg __unused) +{ + if (!hn_share_tx_taskq) + return; + + hn_tx_taskq = taskqueue_create_fast("hn_tx", M_WAITOK, + taskqueue_thread_enqueue, &hn_tx_taskq); + taskqueue_start_threads(&hn_tx_taskq, 1, PI_NET, "hn tx"); +} +SYSINIT(hn_txtq_create, SI_SUB_DRIVERS, SI_ORDER_FIRST, + hn_tx_taskq_create, NULL); + +static void +hn_tx_taskq_destroy(void *arg __unused) +{ + if (hn_tx_taskq != NULL) + taskqueue_free(hn_tx_taskq); +} +SYSUNINIT(hn_txtq_destroy, SI_SUB_DRIVERS, SI_ORDER_FIRST, + hn_tx_taskq_destroy, NULL); + static device_method_t netvsc_methods[] = { /* Device interface */ DEVMETHOD(device_probe, netvsc_probe), From owner-svn-src-all@freebsd.org Mon Jun 13 07:30:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34679AF1B71; Mon, 13 Jun 2016 07:30:56 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F066F27A5; Mon, 13 Jun 2016 07:30:55 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5D7Ut4w086562; Mon, 13 Jun 2016 07:30:55 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5D7Utc6086560; Mon, 13 Jun 2016 07:30:55 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606130730.u5D7Utc6086560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 13 Jun 2016 07:30:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301861 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 07:30:56 -0000 Author: sephe Date: Mon Jun 13 07:30:54 2016 New Revision: 301861 URL: https://svnweb.freebsd.org/changeset/base/301861 Log: MFC 295743,295744,295745,295746,295747 295743 hyperv/hn: Change global tunable prefix to hw.hn And use SYSCTL+CTLFLAG_RDTUN for them. Suggested by: adrian Reviewed by: adrian, Hongjiang Zhang Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5274 295744 hyperv/hn: Split RX ring data structure out of softc This paves the way for upcoming vRSS stuffs and eases more code cleanup. Reviewed by: adrian Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5275 295745 hyperv/hn: Use taskqueue_enqueue() This also eases experiment on the non-fast taskqueue. Reviewed by: adrian, Jun Su Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5276 295746 hyperv/hn: Use non-fast taskqueue for transmission Performance stays same; so no need to use fast taskqueue here. 295747 hyperv/hn: Split TX ring data structure out of softc This paves the way for upcoming vRSS stuffs and eases more code cleanup. Reviewed by: adrian Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5283 Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Jun 13 07:03:00 2016 (r301860) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Jun 13 07:30:54 2016 (r301861) @@ -993,31 +993,25 @@ typedef struct { struct hn_txdesc; SLIST_HEAD(hn_txdesc_list, hn_txdesc); -/* - * Device-specific softc structure - */ -typedef struct hn_softc { - struct ifnet *hn_ifp; - struct arpcom arpcom; - struct ifmedia hn_media; - device_t hn_dev; - uint8_t hn_unit; - int hn_carrier; - int hn_if_flags; - struct mtx hn_lock; - int hn_initdone; - /* See hv_netvsc_drv_freebsd.c for rules on how to use */ - int temp_unusable; - struct hv_device *hn_dev_obj; - netvsc_dev *net_dev; +struct hn_rx_ring { + struct lro_ctrl hn_lro; - struct hn_txdesc *hn_txdesc; - bus_dma_tag_t hn_tx_data_dtag; - bus_dma_tag_t hn_tx_rndis_dtag; - int hn_tx_chimney_size; - int hn_tx_chimney_max; - uint64_t hn_csum_assist; + /* Trust csum verification on host side */ + int hn_trust_hcsum; /* HN_TRUST_HCSUM_ */ + + u_long hn_csum_ip; + u_long hn_csum_tcp; + u_long hn_csum_udp; + u_long hn_csum_trusted; + u_long hn_lro_tried; + u_long hn_small_pkts; +} __aligned(CACHE_LINE_SIZE); + +#define HN_TRUST_HCSUM_IP 0x0001 +#define HN_TRUST_HCSUM_TCP 0x0002 +#define HN_TRUST_HCSUM_UDP 0x0004 +struct hn_tx_ring { struct mtx hn_txlist_spin; struct hn_txdesc_list hn_txlist; int hn_txdesc_cnt; @@ -1025,32 +1019,57 @@ typedef struct hn_softc { int hn_txeof; int hn_sched_tx; - int hn_direct_tx_size; struct taskqueue *hn_tx_taskq; struct task hn_start_task; struct task hn_txeof_task; - struct lro_ctrl hn_lro; + struct mtx hn_tx_lock; + struct hn_softc *hn_sc; - /* Trust csum verification on host side */ - int hn_trust_hcsum; /* HN_TRUST_HCSUM_ */ + int hn_direct_tx_size; + int hn_tx_chimney_size; + bus_dma_tag_t hn_tx_data_dtag; + uint64_t hn_csum_assist; - u_long hn_csum_ip; - u_long hn_csum_tcp; - u_long hn_csum_udp; - u_long hn_csum_trusted; - u_long hn_lro_tried; - u_long hn_small_pkts; u_long hn_no_txdescs; u_long hn_send_failed; u_long hn_txdma_failed; u_long hn_tx_collapsed; u_long hn_tx_chimney; -} hn_softc_t; -#define HN_TRUST_HCSUM_IP 0x0001 -#define HN_TRUST_HCSUM_TCP 0x0002 -#define HN_TRUST_HCSUM_UDP 0x0004 + /* Rarely used stuffs */ + struct hn_txdesc *hn_txdesc; + bus_dma_tag_t hn_tx_rndis_dtag; + struct sysctl_oid *hn_tx_sysctl_tree; +} __aligned(CACHE_LINE_SIZE); + +/* + * Device-specific softc structure + */ +typedef struct hn_softc { + struct ifnet *hn_ifp; + struct arpcom arpcom; + struct ifmedia hn_media; + device_t hn_dev; + uint8_t hn_unit; + int hn_carrier; + int hn_if_flags; + struct mtx hn_lock; + int hn_initdone; + /* See hv_netvsc_drv_freebsd.c for rules on how to use */ + int temp_unusable; + struct hv_device *hn_dev_obj; + netvsc_dev *net_dev; + + int hn_rx_ring_cnt; + struct hn_rx_ring *hn_rx_ring; + + int hn_tx_ring_cnt; + struct hn_tx_ring *hn_tx_ring; + int hn_tx_chimney_max; + struct taskqueue *hn_tx_taskq; + struct sysctl_oid *hn_tx_sysctl_tree; +} hn_softc_t; /* * Externs Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 07:03:00 2016 (r301860) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 07:30:54 2016 (r301861) @@ -153,7 +153,7 @@ __FBSDID("$FreeBSD$"); struct hn_txdesc { SLIST_ENTRY(hn_txdesc) link; struct mbuf *m; - struct hn_softc *sc; + struct hn_tx_ring *txr; int refs; uint32_t flags; /* HN_TXD_FLAG_ */ netvsc_packet netvsc_pkt; /* XXX to be removed */ @@ -193,7 +193,6 @@ struct hn_txdesc { #define NV_LOCK_INIT(_sc, _name) \ mtx_init(&(_sc)->hn_lock, _name, MTX_NETWORK_LOCK, MTX_DEF) #define NV_LOCK(_sc) mtx_lock(&(_sc)->hn_lock) -#define NV_TRYLOCK(_sc) mtx_trylock(&(_sc)->hn_lock) #define NV_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->hn_lock, MA_OWNED) #define NV_UNLOCK(_sc) mtx_unlock(&(_sc)->hn_lock) #define NV_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->hn_lock) @@ -205,41 +204,57 @@ struct hn_txdesc { int hv_promisc_mode = 0; /* normal mode by default */ +SYSCTL_NODE(_hw, OID_AUTO, hn, CTLFLAG_RD, NULL, "Hyper-V network interface"); + /* Trust tcp segements verification on host side. */ static int hn_trust_hosttcp = 1; -TUNABLE_INT("dev.hn.trust_hosttcp", &hn_trust_hosttcp); +SYSCTL_INT(_hw_hn, OID_AUTO, trust_hosttcp, CTLFLAG_RDTUN, + &hn_trust_hosttcp, 0, + "Trust tcp segement verification on host side, " + "when csum info is missing (global setting)"); /* Trust udp datagrams verification on host side. */ static int hn_trust_hostudp = 1; -TUNABLE_INT("dev.hn.trust_hostudp", &hn_trust_hostudp); +SYSCTL_INT(_hw_hn, OID_AUTO, trust_hostudp, CTLFLAG_RDTUN, + &hn_trust_hostudp, 0, + "Trust udp datagram verification on host side, " + "when csum info is missing (global setting)"); /* Trust ip packets verification on host side. */ static int hn_trust_hostip = 1; -TUNABLE_INT("dev.hn.trust_hostip", &hn_trust_hostip); +SYSCTL_INT(_hw_hn, OID_AUTO, trust_hostip, CTLFLAG_RDTUN, + &hn_trust_hostip, 0, + "Trust ip packet verification on host side, " + "when csum info is missing (global setting)"); #if __FreeBSD_version >= 1100045 /* Limit TSO burst size */ static int hn_tso_maxlen = 0; -TUNABLE_INT("dev.hn.tso_maxlen", &hn_tso_maxlen); +SYSCTL_INT(_hw_hn, OID_AUTO, tso_maxlen, CTLFLAG_RDTUN, + &hn_tso_maxlen, 0, "TSO burst limit"); #endif /* Limit chimney send size */ static int hn_tx_chimney_size = 0; -TUNABLE_INT("dev.hn.tx_chimney_size", &hn_tx_chimney_size); +SYSCTL_INT(_hw_hn, OID_AUTO, tx_chimney_size, CTLFLAG_RDTUN, + &hn_tx_chimney_size, 0, "Chimney send packet size limit"); /* Limit the size of packet for direct transmission */ static int hn_direct_tx_size = HN_DIRECT_TX_SIZE_DEF; -TUNABLE_INT("dev.hn.direct_tx_size", &hn_direct_tx_size); +SYSCTL_INT(_hw_hn, OID_AUTO, direct_tx_size, CTLFLAG_RDTUN, + &hn_direct_tx_size, 0, "Size of the packet for direct transmission"); #if defined(INET) || defined(INET6) #if __FreeBSD_version >= 1100095 static int hn_lro_entry_count = HN_LROENT_CNT_DEF; -TUNABLE_INT("dev.hn.lro_entry_count", &hn_lro_entry_count); +SYSCTL_INT(_hw_hn, OID_AUTO, lro_entry_count, CTLFLAG_RDTUN, + &hn_lro_entry_count, 0, "LRO entry count"); #endif #endif static int hn_share_tx_taskq = 0; -TUNABLE_INT("hw.hn.share_tx_taskq", &hn_share_tx_taskq); +SYSCTL_INT(_hw_hn, OID_AUTO, share_tx_taskq, CTLFLAG_RDTUN, + &hn_share_tx_taskq, 0, "Enable shared TX taskqueue"); static struct taskqueue *hn_tx_taskq; @@ -250,9 +265,9 @@ static void hn_stop(hn_softc_t *sc); static void hn_ifinit_locked(hn_softc_t *sc); static void hn_ifinit(void *xsc); static int hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data); -static int hn_start_locked(struct ifnet *ifp, int len); +static int hn_start_locked(struct hn_tx_ring *txr, int len); static void hn_start(struct ifnet *ifp); -static void hn_start_txeof(struct ifnet *ifp); +static void hn_start_txeof(struct hn_tx_ring *); static int hn_ifmedia_upd(struct ifnet *ifp); static void hn_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr); #if __FreeBSD_version >= 1100099 @@ -261,12 +276,22 @@ static int hn_lro_ackcnt_sysctl(SYSCTL_H #endif static int hn_trust_hcsum_sysctl(SYSCTL_HANDLER_ARGS); static int hn_tx_chimney_size_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_rx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_rx_stat_u64_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_tx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_tx_conf_int_sysctl(SYSCTL_HANDLER_ARGS); static int hn_check_iplen(const struct mbuf *, int); -static int hn_create_tx_ring(struct hn_softc *sc); -static void hn_destroy_tx_ring(struct hn_softc *sc); +static int hn_create_tx_ring(struct hn_softc *, int); +static void hn_destroy_tx_ring(struct hn_tx_ring *); +static int hn_create_tx_data(struct hn_softc *); +static void hn_destroy_tx_data(struct hn_softc *); static void hn_start_taskfunc(void *xsc, int pending); static void hn_txeof_taskfunc(void *xsc, int pending); -static int hn_encap(struct hn_softc *, struct hn_txdesc *, struct mbuf **); +static void hn_stop_tx_tasks(struct hn_softc *); +static int hn_encap(struct hn_tx_ring *, struct hn_txdesc *, struct mbuf **); +static void hn_create_rx_data(struct hn_softc *sc); +static void hn_destroy_rx_data(struct hn_softc *sc); +static void hn_set_tx_chimney_size(struct hn_softc *, int); static int hn_ifmedia_upd(struct ifnet *ifp __unused) @@ -332,17 +357,10 @@ netvsc_attach(device_t dev) hn_softc_t *sc; int unit = device_get_unit(dev); struct ifnet *ifp = NULL; - struct sysctl_oid_list *child; - struct sysctl_ctx_list *ctx; int error; #if __FreeBSD_version >= 1100045 int tso_maxlen; #endif -#if defined(INET) || defined(INET6) -#if __FreeBSD_version >= 1100095 - int lroent_cnt; -#endif -#endif sc = device_get_softc(dev); if (sc == NULL) { @@ -352,29 +370,15 @@ netvsc_attach(device_t dev) bzero(sc, sizeof(hn_softc_t)); sc->hn_unit = unit; sc->hn_dev = dev; - sc->hn_direct_tx_size = hn_direct_tx_size; - if (hn_trust_hosttcp) - sc->hn_trust_hcsum |= HN_TRUST_HCSUM_TCP; - if (hn_trust_hostudp) - sc->hn_trust_hcsum |= HN_TRUST_HCSUM_UDP; - if (hn_trust_hostip) - sc->hn_trust_hcsum |= HN_TRUST_HCSUM_IP; if (hn_tx_taskq == NULL) { - sc->hn_tx_taskq = taskqueue_create_fast("hn_tx", M_WAITOK, + sc->hn_tx_taskq = taskqueue_create("hn_tx", M_WAITOK, taskqueue_thread_enqueue, &sc->hn_tx_taskq); taskqueue_start_threads(&sc->hn_tx_taskq, 1, PI_NET, "%s tx", device_get_nameunit(dev)); } else { sc->hn_tx_taskq = hn_tx_taskq; } - TASK_INIT(&sc->hn_start_task, 0, hn_start_taskfunc, sc); - TASK_INIT(&sc->hn_txeof_task, 0, hn_txeof_taskfunc, sc); - - error = hn_create_tx_ring(sc); - if (error) - goto failed; - NV_LOCK_INIT(sc, "NetVSCLock"); sc->hn_dev_obj = device_ctx; @@ -382,6 +386,12 @@ netvsc_attach(device_t dev) ifp = sc->hn_ifp = sc->arpcom.ac_ifp = if_alloc(IFT_ETHER); ifp->if_softc = sc; + error = hn_create_tx_data(sc); + if (error) + goto failed; + + hn_create_rx_data(sc); + if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_dunit = unit; ifp->if_dname = NETVSC_DEVNAME; @@ -412,12 +422,7 @@ netvsc_attach(device_t dev) ifp->if_capenable |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_TSO | IFCAP_LRO; - - if (hv_vmbus_protocal_version >= HV_VMBUS_VERSION_WIN8_1) - sc->hn_csum_assist = HN_CSUM_ASSIST; - else - sc->hn_csum_assist = HN_CSUM_ASSIST_WIN8; - ifp->if_hwassist = sc->hn_csum_assist | CSUM_TSO; + ifp->if_hwassist = sc->hn_tx_ring[0].hn_csum_assist | CSUM_TSO; error = hv_rf_on_device_add(device_ctx, &device_info); if (error) @@ -427,24 +432,6 @@ netvsc_attach(device_t dev) sc->hn_carrier = 1; } -#if defined(INET) || defined(INET6) -#if __FreeBSD_version >= 1100095 - lroent_cnt = hn_lro_entry_count; - if (lroent_cnt < TCP_LRO_ENTRIES) - lroent_cnt = TCP_LRO_ENTRIES; - tcp_lro_init_args(&sc->hn_lro, ifp, lroent_cnt, 0); - device_printf(dev, "LRO: entry count %d\n", lroent_cnt); -#else - tcp_lro_init(&sc->hn_lro); - /* Driver private LRO settings */ - sc->hn_lro.ifp = ifp; -#endif -#if __FreeBSD_version >= 1100099 - sc->hn_lro.lro_length_lim = HN_LRO_LENLIM_DEF; - sc->hn_lro.lro_ackcnt_lim = HN_LRO_ACKCNT_DEF; -#endif -#endif /* INET || INET6 */ - #if __FreeBSD_version >= 1100045 tso_maxlen = hn_tso_maxlen; if (tso_maxlen <= 0 || tso_maxlen > IP_MAXPACKET) @@ -464,134 +451,14 @@ netvsc_attach(device_t dev) #endif sc->hn_tx_chimney_max = sc->net_dev->send_section_size; - sc->hn_tx_chimney_size = sc->hn_tx_chimney_max; + hn_set_tx_chimney_size(sc, sc->hn_tx_chimney_max); if (hn_tx_chimney_size > 0 && hn_tx_chimney_size < sc->hn_tx_chimney_max) - sc->hn_tx_chimney_size = hn_tx_chimney_size; - - /* - * Always schedule transmission instead of trying - * to do direct transmission. This one gives the - * best performance so far. - */ - sc->hn_sched_tx = 1; - - ctx = device_get_sysctl_ctx(dev); - child = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); - - SYSCTL_ADD_INT(ctx, child, OID_AUTO, "lro_queued", - CTLFLAG_RW, &sc->hn_lro.lro_queued, 0, "LRO queued"); - SYSCTL_ADD_INT(ctx, child, OID_AUTO, "lro_flushed", - CTLFLAG_RW, &sc->hn_lro.lro_flushed, 0, "LRO flushed"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "lro_tried", - CTLFLAG_RW, &sc->hn_lro_tried, "# of LRO tries"); -#if __FreeBSD_version >= 1100099 - SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_length_lim", - CTLTYPE_UINT | CTLFLAG_RW, sc, 0, hn_lro_lenlim_sysctl, "IU", - "Max # of data bytes to be aggregated by LRO"); - SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_ackcnt_lim", - CTLTYPE_INT | CTLFLAG_RW, sc, 0, hn_lro_ackcnt_sysctl, "I", - "Max # of ACKs to be aggregated by LRO"); -#endif - SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "trust_hosttcp", - CTLTYPE_INT | CTLFLAG_RW, sc, HN_TRUST_HCSUM_TCP, - hn_trust_hcsum_sysctl, "I", - "Trust tcp segement verification on host side, " - "when csum info is missing"); - SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "trust_hostudp", - CTLTYPE_INT | CTLFLAG_RW, sc, HN_TRUST_HCSUM_UDP, - hn_trust_hcsum_sysctl, "I", - "Trust udp datagram verification on host side, " - "when csum info is missing"); - SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "trust_hostip", - CTLTYPE_INT | CTLFLAG_RW, sc, HN_TRUST_HCSUM_IP, - hn_trust_hcsum_sysctl, "I", - "Trust ip packet verification on host side, " - "when csum info is missing"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "csum_ip", - CTLFLAG_RW, &sc->hn_csum_ip, "RXCSUM IP"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "csum_tcp", - CTLFLAG_RW, &sc->hn_csum_tcp, "RXCSUM TCP"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "csum_udp", - CTLFLAG_RW, &sc->hn_csum_udp, "RXCSUM UDP"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "csum_trusted", - CTLFLAG_RW, &sc->hn_csum_trusted, - "# of packets that we trust host's csum verification"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "small_pkts", - CTLFLAG_RW, &sc->hn_small_pkts, "# of small packets received"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "no_txdescs", - CTLFLAG_RW, &sc->hn_no_txdescs, "# of times short of TX descs"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "send_failed", - CTLFLAG_RW, &sc->hn_send_failed, "# of hyper-v sending failure"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "txdma_failed", - CTLFLAG_RW, &sc->hn_txdma_failed, "# of TX DMA failure"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "tx_collapsed", - CTLFLAG_RW, &sc->hn_tx_collapsed, "# of TX mbuf collapsed"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "tx_chimney", - CTLFLAG_RW, &sc->hn_tx_chimney, "# of chimney send"); - SYSCTL_ADD_INT(ctx, child, OID_AUTO, "txdesc_cnt", - CTLFLAG_RD, &sc->hn_txdesc_cnt, 0, "# of total TX descs"); - SYSCTL_ADD_INT(ctx, child, OID_AUTO, "txdesc_avail", - CTLFLAG_RD, &sc->hn_txdesc_avail, 0, "# of available TX descs"); - SYSCTL_ADD_INT(ctx, child, OID_AUTO, "tx_chimney_max", - CTLFLAG_RD, &sc->hn_tx_chimney_max, 0, - "Chimney send packet size upper boundary"); - SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "tx_chimney_size", - CTLTYPE_INT | CTLFLAG_RW, sc, 0, hn_tx_chimney_size_sysctl, - "I", "Chimney send packet size limit"); - SYSCTL_ADD_INT(ctx, child, OID_AUTO, "direct_tx_size", - CTLFLAG_RW, &sc->hn_direct_tx_size, 0, - "Size of the packet for direct transmission"); - SYSCTL_ADD_INT(ctx, child, OID_AUTO, "sched_tx", - CTLFLAG_RW, &sc->hn_sched_tx, 0, - "Always schedule transmission " - "instead of doing direct transmission"); - - if (unit == 0) { - struct sysctl_ctx_list *dc_ctx; - struct sysctl_oid_list *dc_child; - devclass_t dc; - - /* - * Add sysctl nodes for devclass - */ - dc = device_get_devclass(dev); - dc_ctx = devclass_get_sysctl_ctx(dc); - dc_child = SYSCTL_CHILDREN(devclass_get_sysctl_tree(dc)); - - SYSCTL_ADD_INT(dc_ctx, dc_child, OID_AUTO, "trust_hosttcp", - CTLFLAG_RD, &hn_trust_hosttcp, 0, - "Trust tcp segement verification on host side, " - "when csum info is missing (global setting)"); - SYSCTL_ADD_INT(dc_ctx, dc_child, OID_AUTO, "trust_hostudp", - CTLFLAG_RD, &hn_trust_hostudp, 0, - "Trust udp datagram verification on host side, " - "when csum info is missing (global setting)"); - SYSCTL_ADD_INT(dc_ctx, dc_child, OID_AUTO, "trust_hostip", - CTLFLAG_RD, &hn_trust_hostip, 0, - "Trust ip packet verification on host side, " - "when csum info is missing (global setting)"); - SYSCTL_ADD_INT(dc_ctx, dc_child, OID_AUTO, "tx_chimney_size", - CTLFLAG_RD, &hn_tx_chimney_size, 0, - "Chimney send packet size limit"); -#if __FreeBSD_version >= 1100045 - SYSCTL_ADD_INT(dc_ctx, dc_child, OID_AUTO, "tso_maxlen", - CTLFLAG_RD, &hn_tso_maxlen, 0, "TSO burst limit"); -#endif - SYSCTL_ADD_INT(dc_ctx, dc_child, OID_AUTO, "direct_tx_size", - CTLFLAG_RD, &hn_direct_tx_size, 0, - "Size of the packet for direct transmission"); -#if defined(INET) || defined(INET6) -#if __FreeBSD_version >= 1100095 - SYSCTL_ADD_INT(dc_ctx, dc_child, OID_AUTO, "lro_entry_count", - CTLFLAG_RD, &hn_lro_entry_count, 0, "LRO entry count"); -#endif -#endif - } + hn_set_tx_chimney_size(sc, hn_tx_chimney_size); return (0); failed: - hn_destroy_tx_ring(sc); + hn_destroy_tx_data(sc); if (ifp != NULL) if_free(ifp); return (error); @@ -622,16 +489,14 @@ netvsc_detach(device_t dev) hv_rf_on_device_remove(hv_device, HV_RF_NV_DESTROY_CHANNEL); - taskqueue_drain(sc->hn_tx_taskq, &sc->hn_start_task); - taskqueue_drain(sc->hn_tx_taskq, &sc->hn_txeof_task); - if (sc->hn_tx_taskq != hn_tx_taskq) - taskqueue_free(sc->hn_tx_taskq); + hn_stop_tx_tasks(sc); ifmedia_removeall(&sc->hn_media); -#if defined(INET) || defined(INET6) - tcp_lro_free(&sc->hn_lro); -#endif - hn_destroy_tx_ring(sc); + hn_destroy_rx_data(sc); + hn_destroy_tx_data(sc); + + if (sc->hn_tx_taskq != hn_tx_taskq) + taskqueue_free(sc->hn_tx_taskq); return (0); } @@ -646,13 +511,13 @@ netvsc_shutdown(device_t dev) } static __inline int -hn_txdesc_dmamap_load(struct hn_softc *sc, struct hn_txdesc *txd, +hn_txdesc_dmamap_load(struct hn_tx_ring *txr, struct hn_txdesc *txd, struct mbuf **m_head, bus_dma_segment_t *segs, int *nsegs) { struct mbuf *m = *m_head; int error; - error = bus_dmamap_load_mbuf_sg(sc->hn_tx_data_dtag, txd->data_dmap, + error = bus_dmamap_load_mbuf_sg(txr->hn_tx_data_dtag, txd->data_dmap, m, segs, nsegs, BUS_DMA_NOWAIT); if (error == EFBIG) { struct mbuf *m_new; @@ -662,13 +527,13 @@ hn_txdesc_dmamap_load(struct hn_softc *s return ENOBUFS; else *m_head = m = m_new; - sc->hn_tx_collapsed++; + txr->hn_tx_collapsed++; - error = bus_dmamap_load_mbuf_sg(sc->hn_tx_data_dtag, + error = bus_dmamap_load_mbuf_sg(txr->hn_tx_data_dtag, txd->data_dmap, m, segs, nsegs, BUS_DMA_NOWAIT); } if (!error) { - bus_dmamap_sync(sc->hn_tx_data_dtag, txd->data_dmap, + bus_dmamap_sync(txr->hn_tx_data_dtag, txd->data_dmap, BUS_DMASYNC_PREWRITE); txd->flags |= HN_TXD_FLAG_DMAMAP; } @@ -676,20 +541,20 @@ hn_txdesc_dmamap_load(struct hn_softc *s } static __inline void -hn_txdesc_dmamap_unload(struct hn_softc *sc, struct hn_txdesc *txd) +hn_txdesc_dmamap_unload(struct hn_tx_ring *txr, struct hn_txdesc *txd) { if (txd->flags & HN_TXD_FLAG_DMAMAP) { - bus_dmamap_sync(sc->hn_tx_data_dtag, + bus_dmamap_sync(txr->hn_tx_data_dtag, txd->data_dmap, BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(sc->hn_tx_data_dtag, + bus_dmamap_unload(txr->hn_tx_data_dtag, txd->data_dmap); txd->flags &= ~HN_TXD_FLAG_DMAMAP; } } static __inline int -hn_txdesc_put(struct hn_softc *sc, struct hn_txdesc *txd) +hn_txdesc_put(struct hn_tx_ring *txr, struct hn_txdesc *txd) { KASSERT((txd->flags & HN_TXD_FLAG_ONLIST) == 0, @@ -699,7 +564,7 @@ hn_txdesc_put(struct hn_softc *sc, struc if (atomic_fetchadd_int(&txd->refs, -1) != 1) return 0; - hn_txdesc_dmamap_unload(sc, txd); + hn_txdesc_dmamap_unload(txr, txd); if (txd->m != NULL) { m_freem(txd->m); txd->m = NULL; @@ -707,31 +572,31 @@ hn_txdesc_put(struct hn_softc *sc, struc txd->flags |= HN_TXD_FLAG_ONLIST; - mtx_lock_spin(&sc->hn_txlist_spin); - KASSERT(sc->hn_txdesc_avail >= 0 && - sc->hn_txdesc_avail < sc->hn_txdesc_cnt, - ("txdesc_put: invalid txd avail %d", sc->hn_txdesc_avail)); - sc->hn_txdesc_avail++; - SLIST_INSERT_HEAD(&sc->hn_txlist, txd, link); - mtx_unlock_spin(&sc->hn_txlist_spin); + mtx_lock_spin(&txr->hn_txlist_spin); + KASSERT(txr->hn_txdesc_avail >= 0 && + txr->hn_txdesc_avail < txr->hn_txdesc_cnt, + ("txdesc_put: invalid txd avail %d", txr->hn_txdesc_avail)); + txr->hn_txdesc_avail++; + SLIST_INSERT_HEAD(&txr->hn_txlist, txd, link); + mtx_unlock_spin(&txr->hn_txlist_spin); return 1; } static __inline struct hn_txdesc * -hn_txdesc_get(struct hn_softc *sc) +hn_txdesc_get(struct hn_tx_ring *txr) { struct hn_txdesc *txd; - mtx_lock_spin(&sc->hn_txlist_spin); - txd = SLIST_FIRST(&sc->hn_txlist); + mtx_lock_spin(&txr->hn_txlist_spin); + txd = SLIST_FIRST(&txr->hn_txlist); if (txd != NULL) { - KASSERT(sc->hn_txdesc_avail > 0, - ("txdesc_get: invalid txd avail %d", sc->hn_txdesc_avail)); - sc->hn_txdesc_avail--; - SLIST_REMOVE_HEAD(&sc->hn_txlist, link); + KASSERT(txr->hn_txdesc_avail > 0, + ("txdesc_get: invalid txd avail %d", txr->hn_txdesc_avail)); + txr->hn_txdesc_avail--; + SLIST_REMOVE_HEAD(&txr->hn_txlist, link); } - mtx_unlock_spin(&sc->hn_txlist_spin); + mtx_unlock_spin(&txr->hn_txlist_spin); if (txd != NULL) { KASSERT(txd->m == NULL && txd->refs == 0 && @@ -763,22 +628,24 @@ netvsc_xmit_completion(void *context) { netvsc_packet *packet = context; struct hn_txdesc *txd; - struct hn_softc *sc; + struct hn_tx_ring *txr; txd = (struct hn_txdesc *)(uintptr_t) packet->compl.send.send_completion_tid; - sc = txd->sc; - sc->hn_txeof = 1; - hn_txdesc_put(sc, txd); + txr = txd->txr; + txr->hn_txeof = 1; + hn_txdesc_put(txr, txd); } void netvsc_channel_rollup(struct hv_device *device_ctx) { struct hn_softc *sc = device_get_softc(device_ctx->device); + struct hn_tx_ring *txr = &sc->hn_tx_ring[0]; /* TODO: vRSS */ #if defined(INET) || defined(INET6) - struct lro_ctrl *lro = &sc->hn_lro; + struct hn_rx_ring *rxr = &sc->hn_rx_ring[0]; /* TODO: vRSS */ + struct lro_ctrl *lro = &rxr->hn_lro; struct lro_entry *queued; while ((queued = SLIST_FIRST(&lro->lro_active)) != NULL) { @@ -787,11 +654,11 @@ netvsc_channel_rollup(struct hv_device * } #endif - if (!sc->hn_txeof) + if (!txr->hn_txeof) return; - sc->hn_txeof = 0; - hn_start_txeof(sc->hn_ifp); + txr->hn_txeof = 0; + hn_start_txeof(txr); } /* @@ -799,7 +666,7 @@ netvsc_channel_rollup(struct hv_device * * If this function fails, then both txd and m_head0 will be freed. */ static int -hn_encap(struct hn_softc *sc, struct hn_txdesc *txd, struct mbuf **m_head0) +hn_encap(struct hn_tx_ring *txr, struct hn_txdesc *txd, struct mbuf **m_head0) { bus_dma_segment_t segs[HN_TX_DATA_SEGCNT_MAX]; int error, nsegs, i; @@ -902,7 +769,7 @@ hn_encap(struct hn_softc *sc, struct hn_ #endif tso_info->lso_v2_xmit.tcp_header_offset = 0; tso_info->lso_v2_xmit.mss = m_head->m_pkthdr.tso_segsz; - } else if (m_head->m_pkthdr.csum_flags & sc->hn_csum_assist) { + } else if (m_head->m_pkthdr.csum_flags & txr->hn_csum_assist) { rndis_tcp_ip_csum_info *csum_info; rndis_msg_size += RNDIS_CSUM_PPI_SIZE; @@ -929,8 +796,8 @@ hn_encap(struct hn_softc *sc, struct hn_ /* * Chimney send, if the packet could fit into one chimney buffer. */ - if (packet->tot_data_buf_len < sc->hn_tx_chimney_size) { - netvsc_dev *net_dev = sc->net_dev; + if (packet->tot_data_buf_len < txr->hn_tx_chimney_size) { + netvsc_dev *net_dev = txr->hn_sc->net_dev; uint32_t send_buf_section_idx; send_buf_section_idx = @@ -949,12 +816,12 @@ hn_encap(struct hn_softc *sc, struct hn_ packet->send_buf_section_size = packet->tot_data_buf_len; packet->page_buf_count = 0; - sc->hn_tx_chimney++; + txr->hn_tx_chimney++; goto done; } } - error = hn_txdesc_dmamap_load(sc, txd, &m_head, segs, &nsegs); + error = hn_txdesc_dmamap_load(txr, txd, &m_head, segs, &nsegs); if (error) { int freed; @@ -964,12 +831,12 @@ hn_encap(struct hn_softc *sc, struct hn_ m_freem(m_head); *m_head0 = NULL; - freed = hn_txdesc_put(sc, txd); + freed = hn_txdesc_put(txr, txd); KASSERT(freed != 0, ("fail to free txd upon txdma error")); - sc->hn_txdma_failed++; - if_inc_counter(sc->hn_ifp, IFCOUNTER_OERRORS, 1); + txr->hn_txdma_failed++; + if_inc_counter(txr->hn_sc->hn_ifp, IFCOUNTER_OERRORS, 1); return error; } *m_head0 = m_head; @@ -1012,11 +879,15 @@ done: * Start a transmit of one or more packets */ static int -hn_start_locked(struct ifnet *ifp, int len) +hn_start_locked(struct hn_tx_ring *txr, int len) { - struct hn_softc *sc = ifp->if_softc; + struct hn_softc *sc = txr->hn_sc; + struct ifnet *ifp = sc->hn_ifp; struct hv_device *device_ctx = vmbus_get_devctx(sc->hn_dev); + KASSERT(txr == &sc->hn_tx_ring[0], ("not the first TX ring")); + mtx_assert(&txr->hn_tx_lock, MA_OWNED); + if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) return 0; @@ -1040,15 +911,15 @@ hn_start_locked(struct ifnet *ifp, int l return 1; } - txd = hn_txdesc_get(sc); + txd = hn_txdesc_get(txr); if (txd == NULL) { - sc->hn_no_txdescs++; + txr->hn_no_txdescs++; IF_PREPEND(&ifp->if_snd, m_head); atomic_set_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); break; } - error = hn_encap(sc, txd, &m_head); + error = hn_encap(txr, txd, &m_head); if (error) { /* Both txd and m_head are freed */ continue; @@ -1063,7 +934,7 @@ again: ETHER_BPF_MTAP(ifp, m_head); if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); } - hn_txdesc_put(sc, txd); + hn_txdesc_put(txr, txd); if (__predict_false(error)) { int freed; @@ -1075,9 +946,9 @@ again: * commands to run? Ask netvsc_channel_rollup() * to kick start later. */ - sc->hn_txeof = 1; + txr->hn_txeof = 1; if (!send_failed) { - sc->hn_send_failed++; + txr->hn_send_failed++; send_failed = 1; /* * Try sending again after set hn_txeof; @@ -1094,11 +965,11 @@ again: * DMA map in hn_txdesc_put(), if it was loaded. */ txd->m = NULL; - freed = hn_txdesc_put(sc, txd); + freed = hn_txdesc_put(txr, txd); KASSERT(freed != 0, ("fail to free txd upon send error")); - sc->hn_send_failed++; + txr->hn_send_failed++; IF_PREPEND(&ifp->if_snd, m_head); atomic_set_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); break; @@ -1194,10 +1065,10 @@ int netvsc_recv(struct hv_device *device_ctx, netvsc_packet *packet, rndis_tcp_ip_csum_info *csum_info) { - hn_softc_t *sc = (hn_softc_t *)device_get_softc(device_ctx->device); + struct hn_softc *sc = device_get_softc(device_ctx->device); + struct hn_rx_ring *rxr = &sc->hn_rx_ring[0]; /* TODO: vRSS */ struct mbuf *m_new; struct ifnet *ifp; - device_t dev = device_ctx->device; int size, do_lro = 0, do_csum = 1; if (sc == NULL) { @@ -1224,7 +1095,7 @@ netvsc_recv(struct hv_device *device_ctx memcpy(mtod(m_new, void *), packet->data, packet->tot_data_buf_len); m_new->m_pkthdr.len = m_new->m_len = packet->tot_data_buf_len; - sc->hn_small_pkts++; + rxr->hn_small_pkts++; } else { /* * Get an mbuf with a cluster. For packets 2K or less, @@ -1240,7 +1111,7 @@ netvsc_recv(struct hv_device *device_ctx m_new = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, size); if (m_new == NULL) { - device_printf(dev, "alloc mbuf failed.\n"); + if_printf(ifp, "alloc mbuf failed.\n"); return (0); } @@ -1257,7 +1128,7 @@ netvsc_recv(struct hv_device *device_ctx if (csum_info->receive.ip_csum_succeeded && do_csum) { m_new->m_pkthdr.csum_flags |= (CSUM_IP_CHECKED | CSUM_IP_VALID); - sc->hn_csum_ip++; + rxr->hn_csum_ip++; } /* TCP/UDP csum offload */ @@ -1267,9 +1138,9 @@ netvsc_recv(struct hv_device *device_ctx (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); m_new->m_pkthdr.csum_data = 0xffff; if (csum_info->receive.tcp_csum_succeeded) - sc->hn_csum_tcp++; + rxr->hn_csum_tcp++; else - sc->hn_csum_udp++; + rxr->hn_csum_udp++; } if (csum_info->receive.ip_csum_succeeded && @@ -1301,8 +1172,9 @@ netvsc_recv(struct hv_device *device_ctx pr = hn_check_iplen(m_new, hoff); if (pr == IPPROTO_TCP) { if (do_csum && - (sc->hn_trust_hcsum & HN_TRUST_HCSUM_TCP)) { - sc->hn_csum_trusted++; + (rxr->hn_trust_hcsum & + HN_TRUST_HCSUM_TCP)) { + rxr->hn_csum_trusted++; m_new->m_pkthdr.csum_flags |= (CSUM_IP_CHECKED | CSUM_IP_VALID | CSUM_DATA_VALID | CSUM_PSEUDO_HDR); @@ -1312,16 +1184,17 @@ netvsc_recv(struct hv_device *device_ctx do_lro = 1; } else if (pr == IPPROTO_UDP) { if (do_csum && - (sc->hn_trust_hcsum & HN_TRUST_HCSUM_UDP)) { - sc->hn_csum_trusted++; + (rxr->hn_trust_hcsum & + HN_TRUST_HCSUM_UDP)) { + rxr->hn_csum_trusted++; m_new->m_pkthdr.csum_flags |= (CSUM_IP_CHECKED | CSUM_IP_VALID | CSUM_DATA_VALID | CSUM_PSEUDO_HDR); m_new->m_pkthdr.csum_data = 0xffff; } } else if (pr != IPPROTO_DONE && do_csum && - (sc->hn_trust_hcsum & HN_TRUST_HCSUM_IP)) { - sc->hn_csum_trusted++; + (rxr->hn_trust_hcsum & HN_TRUST_HCSUM_IP)) { + rxr->hn_csum_trusted++; m_new->m_pkthdr.csum_flags |= (CSUM_IP_CHECKED | CSUM_IP_VALID); } @@ -1343,10 +1216,10 @@ skip: if ((ifp->if_capenable & IFCAP_LRO) && do_lro) { #if defined(INET) || defined(INET6) - struct lro_ctrl *lro = &sc->hn_lro; + struct lro_ctrl *lro = &rxr->hn_lro; if (lro->lro_cnt) { - sc->hn_lro_tried++; + rxr->hn_lro_tried++; if (tcp_lro_rx(lro, m_new, 0) == 0) { /* DONE! */ return 0; @@ -1427,8 +1300,16 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, * Make sure that LRO aggregation length limit is still * valid, after the MTU change. */ - if (sc->hn_lro.lro_length_lim < HN_LRO_LENLIM_MIN(ifp)) - sc->hn_lro.lro_length_lim = HN_LRO_LENLIM_MIN(ifp); + NV_LOCK(sc); + if (sc->hn_rx_ring[0].hn_lro.lro_length_lim < + HN_LRO_LENLIM_MIN(ifp)) { + int i; + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { + sc->hn_rx_ring[i].hn_lro.lro_length_lim = + HN_LRO_LENLIM_MIN(ifp); + } + } + NV_UNLOCK(sc); #endif do { @@ -1469,8 +1350,10 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, } sc->hn_tx_chimney_max = sc->net_dev->send_section_size; - if (sc->hn_tx_chimney_size > sc->hn_tx_chimney_max) - sc->hn_tx_chimney_size = sc->hn_tx_chimney_max; + if (sc->hn_tx_ring[0].hn_tx_chimney_size > + sc->hn_tx_chimney_max) + hn_set_tx_chimney_size(sc, sc->hn_tx_chimney_max); + hn_ifinit_locked(sc); NV_LOCK(sc); @@ -1535,10 +1418,13 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, mask = ifr->ifr_reqcap ^ ifp->if_capenable; if (mask & IFCAP_TXCSUM) { ifp->if_capenable ^= IFCAP_TXCSUM; - if (ifp->if_capenable & IFCAP_TXCSUM) - ifp->if_hwassist |= sc->hn_csum_assist; - else - ifp->if_hwassist &= ~sc->hn_csum_assist; + if (ifp->if_capenable & IFCAP_TXCSUM) { + ifp->if_hwassist |= + sc->hn_tx_ring[0].hn_csum_assist; + } else { + ifp->if_hwassist &= + ~sc->hn_tx_ring[0].hn_csum_assist; + } } if (mask & IFCAP_RXCSUM) @@ -1621,50 +1507,54 @@ static void hn_start(struct ifnet *ifp) { struct hn_softc *sc = ifp->if_softc; + struct hn_tx_ring *txr = &sc->hn_tx_ring[0]; - if (sc->hn_sched_tx) + if (txr->hn_sched_tx) goto do_sched; - if (NV_TRYLOCK(sc)) { + if (mtx_trylock(&txr->hn_tx_lock)) { int sched; - sched = hn_start_locked(ifp, sc->hn_direct_tx_size); - NV_UNLOCK(sc); + sched = hn_start_locked(txr, txr->hn_direct_tx_size); + mtx_unlock(&txr->hn_tx_lock); if (!sched) return; } do_sched: - taskqueue_enqueue_fast(sc->hn_tx_taskq, &sc->hn_start_task); + taskqueue_enqueue(txr->hn_tx_taskq, &txr->hn_start_task); } static void -hn_start_txeof(struct ifnet *ifp) +hn_start_txeof(struct hn_tx_ring *txr) { - struct hn_softc *sc = ifp->if_softc; + struct hn_softc *sc = txr->hn_sc; + struct ifnet *ifp = sc->hn_ifp; - if (sc->hn_sched_tx) + KASSERT(txr == &sc->hn_tx_ring[0], ("not the first TX ring")); + + if (txr->hn_sched_tx) goto do_sched; - if (NV_TRYLOCK(sc)) { + if (mtx_trylock(&txr->hn_tx_lock)) { int sched; atomic_clear_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); - sched = hn_start_locked(ifp, sc->hn_direct_tx_size); - NV_UNLOCK(sc); + sched = hn_start_locked(txr, txr->hn_direct_tx_size); + mtx_unlock(&txr->hn_tx_lock); if (sched) { - taskqueue_enqueue_fast(sc->hn_tx_taskq, - &sc->hn_start_task); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Jun 13 08:03:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4031AF153B; Mon, 13 Jun 2016 08:03:54 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 96CA62804; Mon, 13 Jun 2016 08:03:54 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5D83rCA099038; Mon, 13 Jun 2016 08:03:53 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5D83rBm099036; Mon, 13 Jun 2016 08:03:53 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606130803.u5D83rBm099036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 13 Jun 2016 08:03:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301862 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 08:03:54 -0000 Author: sephe Date: Mon Jun 13 08:03:53 2016 New Revision: 301862 URL: https://svnweb.freebsd.org/changeset/base/301862 Log: MFC 295748,295792,295793,295794 295748 hyperv/hn: Use buf_ring for txdesc list So one spinlock is avoided, which would be potentially dangerous for virtual machine, if the spinlock holder was scheduled out by the host, as noted by royger. Old spinlock based txdesc list is still kept around, so we could have a safe fallback. No performance regression nor improvement is observed. Reviewed by: adrian Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5290 295792 hyperv/hn: Add option to bind TX taskqueues to the specified CPU It will be used to help tracking host side transmission ring selection issue; and it will be turned on by default, once we have concrete result. Reviewed by: adrian, Jun Su Approved by: adrian (mento) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5316 295793 hyperv/hn: Enable IP header checksum offloading for WIN8 (WinServ2012) Tested on Windows Server 2012. Reviewed by: adrian Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5317 295794 hyperv/hn: Free the txdesc buf_ring when the TX ring is destroyed Reviewed by: adrian Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5318 Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Jun 13 07:30:54 2016 (r301861) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Jun 13 08:03:53 2016 (r301862) @@ -58,6 +58,8 @@ #include +#define HN_USE_TXDESC_BUFRING + MALLOC_DECLARE(M_NETVSC); #define NVSP_INVALID_PROTOCOL_VERSION (0xFFFFFFFF) @@ -990,8 +992,12 @@ typedef struct { hv_bool_uint8_t link_state; } netvsc_device_info; +#ifndef HN_USE_TXDESC_BUFRING struct hn_txdesc; SLIST_HEAD(hn_txdesc_list, hn_txdesc); +#else +struct buf_ring; +#endif struct hn_rx_ring { struct lro_ctrl hn_lro; @@ -1012,8 +1018,12 @@ struct hn_rx_ring { #define HN_TRUST_HCSUM_UDP 0x0004 struct hn_tx_ring { +#ifndef HN_USE_TXDESC_BUFRING struct mtx hn_txlist_spin; struct hn_txdesc_list hn_txlist; +#else + struct buf_ring *hn_txdesc_br; +#endif int hn_txdesc_cnt; int hn_txdesc_avail; int hn_txeof; Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 07:30:54 2016 (r301861) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 08:03:53 2016 (r301862) @@ -66,10 +66,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include +#include #include #include @@ -151,7 +153,9 @@ __FBSDID("$FreeBSD$"); #define HN_DIRECT_TX_SIZE_DEF 128 struct hn_txdesc { +#ifndef HN_USE_TXDESC_BUFRING SLIST_ENTRY(hn_txdesc) link; +#endif struct mbuf *m; struct hn_tx_ring *txr; int refs; @@ -173,7 +177,7 @@ struct hn_txdesc { * later. UDP checksum offloading doesn't work on earlier * Windows releases. */ -#define HN_CSUM_ASSIST_WIN8 (CSUM_TCP) +#define HN_CSUM_ASSIST_WIN8 (CSUM_IP | CSUM_TCP) #define HN_CSUM_ASSIST (CSUM_IP | CSUM_UDP | CSUM_TCP) #define HN_LRO_LENLIM_DEF (25 * ETHERMTU) @@ -258,6 +262,18 @@ SYSCTL_INT(_hw_hn, OID_AUTO, share_tx_ta static struct taskqueue *hn_tx_taskq; +#ifndef HN_USE_TXDESC_BUFRING +static int hn_use_txdesc_bufring = 0; +#else +static int hn_use_txdesc_bufring = 1; +#endif +SYSCTL_INT(_hw_hn, OID_AUTO, use_txdesc_bufring, CTLFLAG_RD, + &hn_use_txdesc_bufring, 0, "Use buf_ring for TX descriptors"); + +static int hn_bind_tx_taskq = -1; +SYSCTL_INT(_hw_hn, OID_AUTO, bind_tx_taskq, CTLFLAG_RDTUN, + &hn_bind_tx_taskq, 0, "Bind TX taskqueue to the specified cpu"); + /* * Forward declarations */ @@ -343,6 +359,19 @@ netvsc_probe(device_t dev) return (ENXIO); } +static void +hn_cpuset_setthread_task(void *xmask, int pending __unused) +{ + cpuset_t *mask = xmask; + int error; + + error = cpuset_setthread(curthread->td_tid, mask); + if (error) { + panic("curthread=%ju: can't pin; error=%d", + (uintmax_t)curthread->td_tid, error); + } +} + /* * Standard attach entry point. * @@ -376,6 +405,19 @@ netvsc_attach(device_t dev) taskqueue_thread_enqueue, &sc->hn_tx_taskq); taskqueue_start_threads(&sc->hn_tx_taskq, 1, PI_NET, "%s tx", device_get_nameunit(dev)); + if (hn_bind_tx_taskq >= 0) { + int cpu = hn_bind_tx_taskq; + struct task cpuset_task; + cpuset_t cpu_set; + + if (cpu > mp_ncpus - 1) + cpu = mp_ncpus - 1; + CPU_SETOF(cpu, &cpu_set); + TASK_INIT(&cpuset_task, 0, hn_cpuset_setthread_task, + &cpu_set); + taskqueue_enqueue(sc->hn_tx_taskq, &cpuset_task); + taskqueue_drain(sc->hn_tx_taskq, &cpuset_task); + } } else { sc->hn_tx_taskq = hn_tx_taskq; } @@ -572,6 +614,7 @@ hn_txdesc_put(struct hn_tx_ring *txr, st txd->flags |= HN_TXD_FLAG_ONLIST; +#ifndef HN_USE_TXDESC_BUFRING mtx_lock_spin(&txr->hn_txlist_spin); KASSERT(txr->hn_txdesc_avail >= 0 && txr->hn_txdesc_avail < txr->hn_txdesc_cnt, @@ -579,6 +622,10 @@ hn_txdesc_put(struct hn_tx_ring *txr, st txr->hn_txdesc_avail++; SLIST_INSERT_HEAD(&txr->hn_txlist, txd, link); mtx_unlock_spin(&txr->hn_txlist_spin); +#else + atomic_add_int(&txr->hn_txdesc_avail, 1); + buf_ring_enqueue(txr->hn_txdesc_br, txd); +#endif return 1; } @@ -588,6 +635,7 @@ hn_txdesc_get(struct hn_tx_ring *txr) { struct hn_txdesc *txd; +#ifndef HN_USE_TXDESC_BUFRING mtx_lock_spin(&txr->hn_txlist_spin); txd = SLIST_FIRST(&txr->hn_txlist); if (txd != NULL) { @@ -597,8 +645,14 @@ hn_txdesc_get(struct hn_tx_ring *txr) SLIST_REMOVE_HEAD(&txr->hn_txlist, link); } mtx_unlock_spin(&txr->hn_txlist_spin); +#else + txd = buf_ring_dequeue_sc(txr->hn_txdesc_br); +#endif if (txd != NULL) { +#ifdef HN_USE_TXDESC_BUFRING + atomic_subtract_int(&txr->hn_txdesc_avail, 1); +#endif KASSERT(txd->m == NULL && txd->refs == 0 && (txd->flags & HN_TXD_FLAG_ONLIST), ("invalid txd")); txd->flags &= ~HN_TXD_FLAG_ONLIST; @@ -2061,13 +2115,20 @@ hn_create_tx_ring(struct hn_softc *sc, i txr->hn_sc = sc; +#ifndef HN_USE_TXDESC_BUFRING mtx_init(&txr->hn_txlist_spin, "hn txlist", NULL, MTX_SPIN); +#endif mtx_init(&txr->hn_tx_lock, "hn tx", NULL, MTX_DEF); txr->hn_txdesc_cnt = HN_TX_DESC_CNT; txr->hn_txdesc = malloc(sizeof(struct hn_txdesc) * txr->hn_txdesc_cnt, M_NETVSC, M_WAITOK | M_ZERO); +#ifndef HN_USE_TXDESC_BUFRING SLIST_INIT(&txr->hn_txlist); +#else + txr->hn_txdesc_br = buf_ring_alloc(txr->hn_txdesc_cnt, M_NETVSC, + M_WAITOK, &txr->hn_tx_lock); +#endif txr->hn_tx_taskq = sc->hn_tx_taskq; TASK_INIT(&txr->hn_start_task, 0, hn_start_taskfunc, txr); @@ -2171,7 +2232,11 @@ hn_create_tx_ring(struct hn_softc *sc, i /* All set, put it to list */ txd->flags |= HN_TXD_FLAG_ONLIST; +#ifndef HN_USE_TXDESC_BUFRING SLIST_INSERT_HEAD(&txr->hn_txlist, txd, link); +#else + buf_ring_enqueue(txr->hn_txdesc_br, txd); +#endif } txr->hn_txdesc_avail = txr->hn_txdesc_cnt; @@ -2204,6 +2269,20 @@ hn_create_tx_ring(struct hn_softc *sc, i } static void +hn_txdesc_dmamap_destroy(struct hn_txdesc *txd) +{ + struct hn_tx_ring *txr = txd->txr; + + KASSERT(txd->m == NULL, ("still has mbuf installed")); + KASSERT((txd->flags & HN_TXD_FLAG_DMAMAP) == 0, ("still dma mapped")); + + bus_dmamap_unload(txr->hn_tx_rndis_dtag, txd->rndis_msg_dmap); + bus_dmamem_free(txr->hn_tx_rndis_dtag, txd->rndis_msg, + txd->rndis_msg_dmap); + bus_dmamap_destroy(txr->hn_tx_data_dtag, txd->data_dmap); +} + +static void hn_destroy_tx_ring(struct hn_tx_ring *txr) { struct hn_txdesc *txd; @@ -2211,28 +2290,31 @@ hn_destroy_tx_ring(struct hn_tx_ring *tx if (txr->hn_txdesc == NULL) return; +#ifndef HN_USE_TXDESC_BUFRING while ((txd = SLIST_FIRST(&txr->hn_txlist)) != NULL) { - KASSERT(txd->m == NULL, ("still has mbuf installed")); - KASSERT((txd->flags & HN_TXD_FLAG_DMAMAP) == 0, - ("still dma mapped")); SLIST_REMOVE_HEAD(&txr->hn_txlist, link); - - bus_dmamap_unload(txr->hn_tx_rndis_dtag, - txd->rndis_msg_dmap); - bus_dmamem_free(txr->hn_tx_rndis_dtag, - txd->rndis_msg, txd->rndis_msg_dmap); - - bus_dmamap_destroy(txr->hn_tx_data_dtag, txd->data_dmap); + hn_txdesc_dmamap_destroy(txd); } +#else + while ((txd = buf_ring_dequeue_sc(txr->hn_txdesc_br)) != NULL) + hn_txdesc_dmamap_destroy(txd); +#endif if (txr->hn_tx_data_dtag != NULL) bus_dma_tag_destroy(txr->hn_tx_data_dtag); if (txr->hn_tx_rndis_dtag != NULL) bus_dma_tag_destroy(txr->hn_tx_rndis_dtag); + +#ifdef HN_USE_TXDESC_BUFRING + buf_ring_free(txr->hn_txdesc_br, M_NETVSC); +#endif + free(txr->hn_txdesc, M_NETVSC); txr->hn_txdesc = NULL; +#ifndef HN_USE_TXDESC_BUFRING mtx_destroy(&txr->hn_txlist_spin); +#endif mtx_destroy(&txr->hn_tx_lock); } @@ -2377,6 +2459,18 @@ hn_tx_taskq_create(void *arg __unused) hn_tx_taskq = taskqueue_create("hn_tx", M_WAITOK, taskqueue_thread_enqueue, &hn_tx_taskq); taskqueue_start_threads(&hn_tx_taskq, 1, PI_NET, "hn tx"); + if (hn_bind_tx_taskq >= 0) { + int cpu = hn_bind_tx_taskq; + struct task cpuset_task; + cpuset_t cpu_set; + + if (cpu > mp_ncpus - 1) + cpu = mp_ncpus - 1; + CPU_SETOF(cpu, &cpu_set); + TASK_INIT(&cpuset_task, 0, hn_cpuset_setthread_task, &cpu_set); + taskqueue_enqueue(hn_tx_taskq, &cpuset_task); + taskqueue_drain(hn_tx_taskq, &cpuset_task); + } } SYSINIT(hn_txtq_create, SI_SUB_DRIVERS, SI_ORDER_FIRST, hn_tx_taskq_create, NULL); From owner-svn-src-all@freebsd.org Mon Jun 13 08:18:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88219AF1866; Mon, 13 Jun 2016 08:18:46 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3ECDD2D10; Mon, 13 Jun 2016 08:18:46 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5D8IjPm002877; Mon, 13 Jun 2016 08:18:45 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5D8IjwX002876; Mon, 13 Jun 2016 08:18:45 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606130818.u5D8IjwX002876@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 13 Jun 2016 08:18:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301863 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 08:18:46 -0000 Author: sephe Date: Mon Jun 13 08:18:45 2016 New Revision: 301863 URL: https://svnweb.freebsd.org/changeset/base/301863 Log: hyperv/hn: Fix mis-merge introduced by r301861. Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 08:03:53 2016 (r301862) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 08:18:45 2016 (r301863) @@ -292,6 +292,9 @@ static int hn_lro_ackcnt_sysctl(SYSCTL_H #endif static int hn_trust_hcsum_sysctl(SYSCTL_HANDLER_ARGS); static int hn_tx_chimney_size_sysctl(SYSCTL_HANDLER_ARGS); +#if __FreeBSD_version < 1100095 +static int hn_rx_stat_int_sysctl(SYSCTL_HANDLER_ARGS); +#endif static int hn_rx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS); static int hn_rx_stat_u64_sysctl(SYSCTL_HANDLER_ARGS); static int hn_tx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS); @@ -1783,6 +1786,34 @@ hn_tx_chimney_size_sysctl(SYSCTL_HANDLER return 0; } +#if __FreeBSD_version < 1100095 +static int +hn_rx_stat_int_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct hn_softc *sc = arg1; + int ofs = arg2, i, error; + struct hn_rx_ring *rxr; + uint64_t stat; + + stat = 0; + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { + rxr = &sc->hn_rx_ring[i]; + stat += *((int *)((uint8_t *)rxr + ofs)); + } + + error = sysctl_handle_64(oidp, &stat, 0, req); + if (error || req->newptr == NULL) + return error; + + /* Zero out this stat. */ + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { + rxr = &sc->hn_rx_ring[i]; + *((int *)((uint8_t *)rxr + ofs)) = 0; + } + return 0; +} +#endif + static int hn_rx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS) { @@ -2031,11 +2062,21 @@ hn_create_rx_data(struct hn_softc *sc) SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_queued", CTLTYPE_U64 | CTLFLAG_RW, sc, __offsetof(struct hn_rx_ring, hn_lro.lro_queued), - hn_rx_stat_u64_sysctl, "LU", "LRO queued"); +#if __FreeBSD_version < 1100095 + hn_rx_stat_int_sysctl, +#else + hn_rx_stat_u64_sysctl, +#endif + "LU", "LRO queued"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_flushed", CTLTYPE_U64 | CTLFLAG_RW, sc, __offsetof(struct hn_rx_ring, hn_lro.lro_flushed), - hn_rx_stat_u64_sysctl, "LU", "LRO flushed"); +#if __FreeBSD_version < 1100095 + hn_rx_stat_int_sysctl, +#else + hn_rx_stat_u64_sysctl, +#endif + "LU", "LRO flushed"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_tried", CTLTYPE_ULONG | CTLFLAG_RW, sc, __offsetof(struct hn_rx_ring, hn_lro_tried), From owner-svn-src-all@freebsd.org Mon Jun 13 08:38:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E74FBAF1E3D; Mon, 13 Jun 2016 08:38:05 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BE712580; Mon, 13 Jun 2016 08:38:05 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5D8c43m009994; Mon, 13 Jun 2016 08:38:04 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5D8c4t7009992; Mon, 13 Jun 2016 08:38:04 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606130838.u5D8c4t7009992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 13 Jun 2016 08:38:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301864 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 08:38:06 -0000 Author: sephe Date: Mon Jun 13 08:38:04 2016 New Revision: 301864 URL: https://svnweb.freebsd.org/changeset/base/301864 Log: MFC 295875,295876,295877,295916,295918 295875 hyperv/hn: Rename TX related function and struct fields a bit Preamble to implement the ifnet.if_transmit method. Reviewed by: adrian Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5344 295876 hyperv/hn: Staticize and rename packet TX done function It is only used in hv_netvsc_drv_freebsd.c; and rename it to hn_tx_done() mainly to reserve "xmit" for ifnet.if_transmit implement. While I'm here, remove unapplied comment. Reviewed by: adrian Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5345 295877 hyperv/hn: Add TX method for txeof processing. Preamble to implement ifnet.if_transmit method. Reviewed by: adrian Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5346 295916 hyperv/hn: Factor out hn_send_pkt() from hn_start_locked() It will be shared w/ the upcoming ifnet.if_transmit method implementation. No functional change. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5385 295918 hyperv/hn: Use IFQ_DRV_PREPEND instead of IF_PREPEND IF_PREPEND promises out-of-order packet sending when the TX desc list is depleted. It was overlooked and copied blindly when the transmission path was partially rewritten. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5386 Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Jun 13 08:18:45 2016 (r301863) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Jun 13 08:38:04 2016 (r301864) @@ -1026,11 +1026,12 @@ struct hn_tx_ring { #endif int hn_txdesc_cnt; int hn_txdesc_avail; - int hn_txeof; + int hn_has_txeof; int hn_sched_tx; + void (*hn_txeof)(struct hn_tx_ring *); struct taskqueue *hn_tx_taskq; - struct task hn_start_task; + struct task hn_tx_task; struct task hn_txeof_task; struct mtx hn_tx_lock; @@ -1087,7 +1088,6 @@ typedef struct hn_softc { extern int hv_promisc_mode; void netvsc_linkstatus_callback(struct hv_device *device_obj, uint32_t status); -void netvsc_xmit_completion(void *context); void hv_nv_on_receive_completion(struct hv_device *device, uint64_t tid, uint32_t status); netvsc_dev *hv_nv_on_device_add(struct hv_device *device, Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 08:18:45 2016 (r301863) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 08:38:04 2016 (r301864) @@ -304,8 +304,8 @@ static int hn_create_tx_ring(struct hn_s static void hn_destroy_tx_ring(struct hn_tx_ring *); static int hn_create_tx_data(struct hn_softc *); static void hn_destroy_tx_data(struct hn_softc *); -static void hn_start_taskfunc(void *xsc, int pending); -static void hn_txeof_taskfunc(void *xsc, int pending); +static void hn_start_taskfunc(void *, int); +static void hn_start_txeof_taskfunc(void *, int); static void hn_stop_tx_tasks(struct hn_softc *); static int hn_encap(struct hn_tx_ring *, struct hn_txdesc *, struct mbuf **); static void hn_create_rx_data(struct hn_softc *sc); @@ -673,17 +673,10 @@ hn_txdesc_hold(struct hn_txdesc *txd) atomic_add_int(&txd->refs, 1); } -/* - * Send completion processing - * - * Note: It looks like offset 0 of buf is reserved to hold the softc - * pointer. The sc pointer is not currently needed in this function, and - * it is not presently populated by the TX function. - */ -void -netvsc_xmit_completion(void *context) +static void +hn_tx_done(void *xpkt) { - netvsc_packet *packet = context; + netvsc_packet *packet = xpkt; struct hn_txdesc *txd; struct hn_tx_ring *txr; @@ -691,7 +684,7 @@ netvsc_xmit_completion(void *context) packet->compl.send.send_completion_tid; txr = txd->txr; - txr->hn_txeof = 1; + txr->hn_has_txeof = 1; hn_txdesc_put(txr, txd); } @@ -711,11 +704,11 @@ netvsc_channel_rollup(struct hv_device * } #endif - if (!txr->hn_txeof) + if (!txr->hn_has_txeof) return; - txr->hn_txeof = 0; - hn_start_txeof(txr); + txr->hn_has_txeof = 0; + txr->hn_txeof(txr); } /* @@ -925,7 +918,7 @@ done: txd->m = m_head; /* Set the completion routine */ - packet->compl.send.on_send_completion = netvsc_xmit_completion; + packet->compl.send.on_send_completion = hn_tx_done; packet->compl.send.send_completion_context = packet; packet->compl.send.send_completion_tid = (uint64_t)(uintptr_t)txd; @@ -933,6 +926,68 @@ done: } /* + * NOTE: + * If this function fails, then txd will be freed, but the mbuf + * associated w/ the txd will _not_ be freed. + */ +static int +hn_send_pkt(struct ifnet *ifp, struct hv_device *device_ctx, + struct hn_tx_ring *txr, struct hn_txdesc *txd) +{ + int error, send_failed = 0; + +again: + /* + * Make sure that txd is not freed before ETHER_BPF_MTAP. + */ + hn_txdesc_hold(txd); + error = hv_nv_on_send(device_ctx, &txd->netvsc_pkt); + if (!error) { + ETHER_BPF_MTAP(ifp, txd->m); + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); + } + hn_txdesc_put(txr, txd); + + if (__predict_false(error)) { + int freed; + + /* + * This should "really rarely" happen. + * + * XXX Too many RX to be acked or too many sideband + * commands to run? Ask netvsc_channel_rollup() + * to kick start later. + */ + txr->hn_has_txeof = 1; + if (!send_failed) { + txr->hn_send_failed++; + send_failed = 1; + /* + * Try sending again after set hn_has_txeof; + * in case that we missed the last + * netvsc_channel_rollup(). + */ + goto again; + } + if_printf(ifp, "send failed\n"); + + /* + * Caller will perform further processing on the + * associated mbuf, so don't free it in hn_txdesc_put(); + * only unload it from the DMA map in hn_txdesc_put(), + * if it was loaded. + */ + txd->m = NULL; + freed = hn_txdesc_put(txr, txd); + KASSERT(freed != 0, + ("fail to free txd upon send error")); + + txr->hn_send_failed++; + } + return error; +} + +/* * Start a transmit of one or more packets */ static int @@ -950,9 +1005,9 @@ hn_start_locked(struct hn_tx_ring *txr, return 0; while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { - int error, send_failed = 0; struct hn_txdesc *txd; struct mbuf *m_head; + int error; IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); if (m_head == NULL) @@ -964,14 +1019,14 @@ hn_start_locked(struct hn_tx_ring *txr, * dispatch this packet sending (and sending of any * following up packets) to tx taskqueue. */ - IF_PREPEND(&ifp->if_snd, m_head); + IFQ_DRV_PREPEND(&ifp->if_snd, m_head); return 1; } txd = hn_txdesc_get(txr); if (txd == NULL) { txr->hn_no_txdescs++; - IF_PREPEND(&ifp->if_snd, m_head); + IFQ_DRV_PREPEND(&ifp->if_snd, m_head); atomic_set_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); break; } @@ -981,53 +1036,11 @@ hn_start_locked(struct hn_tx_ring *txr, /* Both txd and m_head are freed */ continue; } -again: - /* - * Make sure that txd is not freed before ETHER_BPF_MTAP. - */ - hn_txdesc_hold(txd); - error = hv_nv_on_send(device_ctx, &txd->netvsc_pkt); - if (!error) { - ETHER_BPF_MTAP(ifp, m_head); - if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); - } - hn_txdesc_put(txr, txd); + error = hn_send_pkt(ifp, device_ctx, txr, txd); if (__predict_false(error)) { - int freed; - - /* - * This should "really rarely" happen. - * - * XXX Too many RX to be acked or too many sideband - * commands to run? Ask netvsc_channel_rollup() - * to kick start later. - */ - txr->hn_txeof = 1; - if (!send_failed) { - txr->hn_send_failed++; - send_failed = 1; - /* - * Try sending again after set hn_txeof; - * in case that we missed the last - * netvsc_channel_rollup(). - */ - goto again; - } - if_printf(ifp, "send failed\n"); - - /* - * This mbuf will be prepended, don't free it - * in hn_txdesc_put(); only unload it from the - * DMA map in hn_txdesc_put(), if it was loaded. - */ - txd->m = NULL; - freed = hn_txdesc_put(txr, txd); - KASSERT(freed != 0, - ("fail to free txd upon send error")); - - txr->hn_send_failed++; - IF_PREPEND(&ifp->if_snd, m_head); + /* txd is freed, but m_head is not */ + IFQ_DRV_PREPEND(&ifp->if_snd, m_head); atomic_set_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); break; } @@ -1578,7 +1591,7 @@ hn_start(struct ifnet *ifp) return; } do_sched: - taskqueue_enqueue(txr->hn_tx_taskq, &txr->hn_start_task); + taskqueue_enqueue(txr->hn_tx_taskq, &txr->hn_tx_task); } static void @@ -1600,7 +1613,7 @@ hn_start_txeof(struct hn_tx_ring *txr) mtx_unlock(&txr->hn_tx_lock); if (sched) { taskqueue_enqueue(txr->hn_tx_taskq, - &txr->hn_start_task); + &txr->hn_tx_task); } } else { do_sched: @@ -2172,8 +2185,8 @@ hn_create_tx_ring(struct hn_softc *sc, i #endif txr->hn_tx_taskq = sc->hn_tx_taskq; - TASK_INIT(&txr->hn_start_task, 0, hn_start_taskfunc, txr); - TASK_INIT(&txr->hn_txeof_task, 0, hn_txeof_taskfunc, txr); + TASK_INIT(&txr->hn_tx_task, 0, hn_start_taskfunc, txr); + TASK_INIT(&txr->hn_txeof_task, 0, hn_start_txeof_taskfunc, txr); txr->hn_direct_tx_size = hn_direct_tx_size; if (hv_vmbus_protocal_version >= HV_VMBUS_VERSION_WIN8_1) @@ -2187,6 +2200,8 @@ hn_create_tx_ring(struct hn_softc *sc, i */ txr->hn_sched_tx = 1; + txr->hn_txeof = hn_start_txeof; /* TODO: if_transmit */ + parent_dtag = bus_get_dma_tag(sc->hn_dev); /* DMA tag for RNDIS messages. */ @@ -2468,7 +2483,7 @@ hn_start_taskfunc(void *xtxr, int pendin } static void -hn_txeof_taskfunc(void *xtxr, int pending __unused) +hn_start_txeof_taskfunc(void *xtxr, int pending __unused) { struct hn_tx_ring *txr = xtxr; @@ -2486,7 +2501,7 @@ hn_stop_tx_tasks(struct hn_softc *sc) for (i = 0; i < sc->hn_tx_ring_cnt; ++i) { struct hn_tx_ring *txr = &sc->hn_tx_ring[i]; - taskqueue_drain(txr->hn_tx_taskq, &txr->hn_start_task); + taskqueue_drain(txr->hn_tx_taskq, &txr->hn_tx_task); taskqueue_drain(txr->hn_tx_taskq, &txr->hn_txeof_task); } } From owner-svn-src-all@freebsd.org Mon Jun 13 08:44:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A629FAF1FE6; Mon, 13 Jun 2016 08:44:30 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63ECF2962; Mon, 13 Jun 2016 08:44:30 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5D8iTxs013459; Mon, 13 Jun 2016 08:44:29 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5D8iTXx013458; Mon, 13 Jun 2016 08:44:29 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606130844.u5D8iTXx013458@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 13 Jun 2016 08:44:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301865 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 08:44:30 -0000 Author: sephe Date: Mon Jun 13 08:44:29 2016 New Revision: 301865 URL: https://svnweb.freebsd.org/changeset/base/301865 Log: hyperv/hn: Hide unused function Sponsored by: Microsoft OSTC Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 08:38:04 2016 (r301864) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 08:44:29 2016 (r301865) @@ -294,9 +294,10 @@ static int hn_trust_hcsum_sysctl(SYSCTL_ static int hn_tx_chimney_size_sysctl(SYSCTL_HANDLER_ARGS); #if __FreeBSD_version < 1100095 static int hn_rx_stat_int_sysctl(SYSCTL_HANDLER_ARGS); +#else +static int hn_rx_stat_u64_sysctl(SYSCTL_HANDLER_ARGS); #endif static int hn_rx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS); -static int hn_rx_stat_u64_sysctl(SYSCTL_HANDLER_ARGS); static int hn_tx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS); static int hn_tx_conf_int_sysctl(SYSCTL_HANDLER_ARGS); static int hn_check_iplen(const struct mbuf *, int); @@ -1825,56 +1826,57 @@ hn_rx_stat_int_sysctl(SYSCTL_HANDLER_ARG } return 0; } -#endif - +#else static int -hn_rx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS) +hn_rx_stat_u64_sysctl(SYSCTL_HANDLER_ARGS) { struct hn_softc *sc = arg1; int ofs = arg2, i, error; struct hn_rx_ring *rxr; - u_long stat; + uint64_t stat; stat = 0; for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { rxr = &sc->hn_rx_ring[i]; - stat += *((u_long *)((uint8_t *)rxr + ofs)); + stat += *((uint64_t *)((uint8_t *)rxr + ofs)); } - error = sysctl_handle_long(oidp, &stat, 0, req); + error = sysctl_handle_64(oidp, &stat, 0, req); if (error || req->newptr == NULL) return error; /* Zero out this stat. */ for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { rxr = &sc->hn_rx_ring[i]; - *((u_long *)((uint8_t *)rxr + ofs)) = 0; + *((uint64_t *)((uint8_t *)rxr + ofs)) = 0; } return 0; } +#endif + static int -hn_rx_stat_u64_sysctl(SYSCTL_HANDLER_ARGS) +hn_rx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS) { struct hn_softc *sc = arg1; int ofs = arg2, i, error; struct hn_rx_ring *rxr; - uint64_t stat; + u_long stat; stat = 0; for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { rxr = &sc->hn_rx_ring[i]; - stat += *((uint64_t *)((uint8_t *)rxr + ofs)); + stat += *((u_long *)((uint8_t *)rxr + ofs)); } - error = sysctl_handle_64(oidp, &stat, 0, req); + error = sysctl_handle_long(oidp, &stat, 0, req); if (error || req->newptr == NULL) return error; /* Zero out this stat. */ for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { rxr = &sc->hn_rx_ring[i]; - *((uint64_t *)((uint8_t *)rxr + ofs)) = 0; + *((u_long *)((uint8_t *)rxr + ofs)) = 0; } return 0; } From owner-svn-src-all@freebsd.org Mon Jun 13 09:02:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2C2EAF0638; Mon, 13 Jun 2016 09:02:09 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A701420AE; Mon, 13 Jun 2016 09:02:09 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5D928mR020525; Mon, 13 Jun 2016 09:02:08 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5D928h6020518; Mon, 13 Jun 2016 09:02:08 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606130902.u5D928h6020518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 13 Jun 2016 09:02:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301866 - in stable/10/sys: conf dev/hyperv/include dev/hyperv/storvsc dev/hyperv/utilities dev/hyperv/vmbus modules/hyperv/utilities X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 09:02:10 -0000 Author: sephe Date: Mon Jun 13 09:02:08 2016 New Revision: 301866 URL: https://svnweb.freebsd.org/changeset/base/301866 Log: MFC 295919,295958,295964 295919 hyperv/stor: Fix print format Detected by: PVS Static Analysis MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5388 295958 hyperv/utils: Code rearrange and cleanup Split heartbeat, shutdown and timesync out of utils code and name them properly. Submitted by: Jun Su Reviewed by: adrian, sephe, Hongjiang Zhang MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5216 295964 hyperv/vmbus: Use free(9) for interrupt page; it is allocated by malloc(9) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5417 Added: stable/10/sys/dev/hyperv/utilities/hv_heartbeat.c - copied unchanged from r295958, head/sys/dev/hyperv/utilities/hv_heartbeat.c stable/10/sys/dev/hyperv/utilities/hv_shutdown.c - copied unchanged from r295958, head/sys/dev/hyperv/utilities/hv_shutdown.c stable/10/sys/dev/hyperv/utilities/hv_timesync.c - copied unchanged from r295958, head/sys/dev/hyperv/utilities/hv_timesync.c stable/10/sys/dev/hyperv/utilities/hv_util.h - copied unchanged from r295958, head/sys/dev/hyperv/utilities/hv_util.h Modified: stable/10/sys/conf/files.amd64 stable/10/sys/conf/files.i386 stable/10/sys/dev/hyperv/include/hyperv.h stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c stable/10/sys/dev/hyperv/utilities/hv_kvp.c stable/10/sys/dev/hyperv/utilities/hv_kvp.h stable/10/sys/dev/hyperv/utilities/hv_util.c stable/10/sys/dev/hyperv/vmbus/hv_connection.c stable/10/sys/modules/hyperv/utilities/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files.amd64 ============================================================================== --- stable/10/sys/conf/files.amd64 Mon Jun 13 08:44:29 2016 (r301865) +++ stable/10/sys/conf/files.amd64 Mon Jun 13 09:02:08 2016 (r301866) @@ -266,7 +266,10 @@ dev/hyperv/netvsc/hv_netvsc_drv_freebsd. dev/hyperv/netvsc/hv_rndis_filter.c optional hyperv dev/hyperv/stordisengage/hv_ata_pci_disengage.c optional hyperv dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c optional hyperv +dev/hyperv/utilities/hv_heartbeat.c optional hyperv dev/hyperv/utilities/hv_kvp.c optional hyperv +dev/hyperv/utilities/hv_shutdown.c optional hyperv +dev/hyperv/utilities/hv_timesync.c optional hyperv dev/hyperv/utilities/hv_util.c optional hyperv dev/hyperv/vmbus/hv_channel.c optional hyperv dev/hyperv/vmbus/hv_channel_mgmt.c optional hyperv Modified: stable/10/sys/conf/files.i386 ============================================================================== --- stable/10/sys/conf/files.i386 Mon Jun 13 08:44:29 2016 (r301865) +++ stable/10/sys/conf/files.i386 Mon Jun 13 09:02:08 2016 (r301866) @@ -242,7 +242,10 @@ dev/hyperv/netvsc/hv_netvsc_drv_freebsd. dev/hyperv/netvsc/hv_rndis_filter.c optional hyperv dev/hyperv/stordisengage/hv_ata_pci_disengage.c optional hyperv dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c optional hyperv +dev/hyperv/utilities/hv_heartbeat.c optional hyperv dev/hyperv/utilities/hv_kvp.c optional hyperv +dev/hyperv/utilities/hv_shutdown.c optional hyperv +dev/hyperv/utilities/hv_timesync.c optional hyperv dev/hyperv/utilities/hv_util.c optional hyperv dev/hyperv/vmbus/hv_channel.c optional hyperv dev/hyperv/vmbus/hv_channel_mgmt.c optional hyperv Modified: stable/10/sys/dev/hyperv/include/hyperv.h ============================================================================== --- stable/10/sys/dev/hyperv/include/hyperv.h Mon Jun 13 08:44:29 2016 (r301865) +++ stable/10/sys/dev/hyperv/include/hyperv.h Mon Jun 13 09:02:08 2016 (r301866) @@ -919,40 +919,5 @@ hv_get_phys_addr(void *virt) return (ret); } - -/** - * KVP related structures - * - */ -typedef struct hv_vmbus_service { - hv_guid guid; /* Hyper-V GUID */ - char *name; /* name of service */ - boolean_t enabled; /* service enabled */ - void* context; - struct task task; - /* - * function to initialize service - */ - int (*init)(struct hv_vmbus_service *); - - /* - * function to process Hyper-V messages - */ - void (*callback)(void *); - - /* - * function to uninitilize service - */ - int (*uninit)(struct hv_vmbus_service *); -} hv_vmbus_service; - -extern uint8_t* receive_buffer[]; -extern hv_vmbus_service service_table[]; extern uint32_t hv_vmbus_protocal_version; - -void hv_kvp_callback(void *context); -int hv_kvp_init(hv_vmbus_service *serv); -void hv_kvp_deinit(void); - #endif /* __HYPERV_H__ */ - Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Mon Jun 13 08:44:29 2016 (r301865) +++ stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Mon Jun 13 09:02:08 2016 (r301866) @@ -856,8 +856,8 @@ hv_storvsc_rescan_target(struct storvsc_ if (xpt_create_path(&ccb->ccb_h.path, NULL, pathid, targetid, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { - printf("unable to create path for rescan, pathid: %d," - "targetid: %d\n", pathid, targetid); + printf("unable to create path for rescan, pathid: %u," + "targetid: %u\n", pathid, targetid); xpt_free_ccb(ccb); return; } Copied: stable/10/sys/dev/hyperv/utilities/hv_heartbeat.c (from r295958, head/sys/dev/hyperv/utilities/hv_heartbeat.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/hyperv/utilities/hv_heartbeat.c Mon Jun 13 09:02:08 2016 (r301866, copy of r295958, head/sys/dev/hyperv/utilities/hv_heartbeat.c) @@ -0,0 +1,129 @@ +/*- + * Copyright (c) 2014 Microsoft Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include "hv_util.h" + +/* Heartbeat Service */ +static hv_guid service_guid = { .data = + {0x39, 0x4f, 0x16, 0x57, 0x15, 0x91, 0x78, 0x4e, + 0xab, 0x55, 0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d} }; + +/** + * Process heartbeat message + */ +static void +hv_heartbeat_cb(void *context) +{ + uint8_t* buf; + hv_vmbus_channel* channel; + uint32_t recvlen; + uint64_t requestid; + int ret; + + struct hv_vmbus_heartbeat_msg_data* heartbeat_msg; + struct hv_vmbus_icmsg_hdr* icmsghdrp; + hv_util_sc *softc; + + softc = (hv_util_sc*)context; + buf = softc->receive_buffer;; + channel = softc->hv_dev->channel; + + ret = hv_vmbus_channel_recv_packet(channel, buf, PAGE_SIZE, &recvlen, + &requestid); + + if ((ret == 0) && recvlen > 0) { + + icmsghdrp = (struct hv_vmbus_icmsg_hdr *) + &buf[sizeof(struct hv_vmbus_pipe_hdr)]; + + if (icmsghdrp->icmsgtype == HV_ICMSGTYPE_NEGOTIATE) { + hv_negotiate_version(icmsghdrp, NULL, buf); + + } else { + heartbeat_msg = + (struct hv_vmbus_heartbeat_msg_data *) + &buf[sizeof(struct hv_vmbus_pipe_hdr) + + sizeof(struct hv_vmbus_icmsg_hdr)]; + + heartbeat_msg->seq_num += 1; + } + + icmsghdrp->icflags = HV_ICMSGHDRFLAG_TRANSACTION | + HV_ICMSGHDRFLAG_RESPONSE; + + hv_vmbus_channel_send_packet(channel, buf, recvlen, requestid, + HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, 0); + } +} + +static int +hv_heartbeat_probe(device_t dev) +{ + const char *p = vmbus_get_type(dev); + if (!memcmp(p, &service_guid, sizeof(hv_guid))) { + device_set_desc(dev, "Hyper-V Heartbeat Service"); + return BUS_PROBE_DEFAULT; + } + + return ENXIO; +} + +static int +hv_heartbeat_attach(device_t dev) +{ + hv_util_sc *softc = (hv_util_sc*)device_get_softc(dev); + + softc->callback = hv_heartbeat_cb; + + return hv_util_attach(dev); +} + +static device_method_t heartbeat_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, hv_heartbeat_probe), + DEVMETHOD(device_attach, hv_heartbeat_attach), + DEVMETHOD(device_detach, hv_util_detach), + { 0, 0 } +}; + +static driver_t heartbeat_driver = { "hvheartbeat", heartbeat_methods, sizeof(hv_util_sc)}; + +static devclass_t heartbeat_devclass; + +DRIVER_MODULE(hv_heartbeat, vmbus, heartbeat_driver, heartbeat_devclass, NULL, NULL); +MODULE_VERSION(hv_heartbeat, 1); +MODULE_DEPEND(hv_heartbeat, vmbus, 1, 1, 1); Modified: stable/10/sys/dev/hyperv/utilities/hv_kvp.c ============================================================================== --- stable/10/sys/dev/hyperv/utilities/hv_kvp.c Mon Jun 13 08:44:29 2016 (r301865) +++ stable/10/sys/dev/hyperv/utilities/hv_kvp.c Mon Jun 13 09:02:08 2016 (r301866) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include "hv_util.h" #include "unicode.h" #include "hv_kvp.h" @@ -74,8 +75,6 @@ __FBSDID("$FreeBSD$"); /* hv_kvp debug control */ static int hv_kvp_log = 0; -SYSCTL_INT(_dev, OID_AUTO, hv_kvp_log, CTLFLAG_RW, &hv_kvp_log, 0, - "hv_kvp log"); #define hv_kvp_log_error(...) do { \ if (hv_kvp_log > 0) \ @@ -87,6 +86,10 @@ SYSCTL_INT(_dev, OID_AUTO, hv_kvp_log, C log(LOG_INFO, "hv_kvp: " __VA_ARGS__); \ } while (0) +static hv_guid service_guid = { .data = + {0xe7, 0xf4, 0xa0, 0xa9, 0x45, 0x5a, 0x96, 0x4d, + 0xb8, 0x27, 0x8a, 0x84, 0x1e, 0x8c, 0x3, 0xe6} }; + /* character device prototypes */ static d_open_t hv_kvp_dev_open; static d_close_t hv_kvp_dev_close; @@ -94,12 +97,6 @@ static d_read_t hv_kvp_dev_daemon_read; static d_write_t hv_kvp_dev_daemon_write; static d_poll_t hv_kvp_dev_daemon_poll; -/* hv_kvp prototypes */ -static int hv_kvp_req_in_progress(void); -static void hv_kvp_transaction_init(uint32_t, hv_vmbus_channel *, uint64_t, uint8_t *); -static void hv_kvp_send_msg_to_daemon(void); -static void hv_kvp_process_request(void *context, int pending); - /* hv_kvp character device structure */ static struct cdevsw hv_kvp_cdevsw = { @@ -111,67 +108,67 @@ static struct cdevsw hv_kvp_cdevsw = .d_poll = hv_kvp_dev_daemon_poll, .d_name = "hv_kvp_dev", }; -static struct cdev *hv_kvp_dev; -static struct hv_kvp_msg *hv_kvp_dev_buf; -struct proc *daemon_task; -static struct selinfo hv_kvp_selinfo; /* * Global state to track and synchronize multiple * KVP transaction requests from the host. */ -static struct { +typedef struct hv_kvp_sc { + struct hv_util_sc util_sc; - /* Unless specified the pending mutex should be + /* Unless specified the pending mutex should be * used to alter the values of the following paramters: * 1. req_in_progress * 2. req_timed_out - * 3. pending_reqs. */ - struct mtx pending_mutex; - + struct mtx pending_mutex; + + struct task task; + /* To track if transaction is active or not */ - boolean_t req_in_progress; + boolean_t req_in_progress; /* Tracks if daemon did not reply back in time */ - boolean_t req_timed_out; + boolean_t req_timed_out; /* Tracks if daemon is serving a request currently */ boolean_t daemon_busy; - /* Count of KVP requests from Hyper-V. */ - uint64_t pending_reqs; - - - /* Length of host message */ - uint32_t host_msg_len; - /* Pointer to channel */ - hv_vmbus_channel *channelp; + /* Length of host message */ + uint32_t host_msg_len; /* Host message id */ - uint64_t host_msg_id; - + uint64_t host_msg_id; + /* Current kvp message from the host */ - struct hv_kvp_msg *host_kvp_msg; - + struct hv_kvp_msg *host_kvp_msg; + /* Current kvp message for daemon */ - struct hv_kvp_msg daemon_kvp_msg; - + struct hv_kvp_msg daemon_kvp_msg; + /* Rcv buffer for communicating with the host*/ - uint8_t *rcv_buf; - + uint8_t *rcv_buf; + /* Device semaphore to control communication */ - struct sema dev_sema; - + struct sema dev_sema; + /* Indicates if daemon registered with driver */ - boolean_t register_done; - + boolean_t register_done; + /* Character device status */ - boolean_t dev_accessed; -} kvp_globals; + boolean_t dev_accessed; + + struct cdev *hv_kvp_dev; -/* global vars */ -MALLOC_DECLARE(M_HV_KVP_DEV_BUF); -MALLOC_DEFINE(M_HV_KVP_DEV_BUF, "hv_kvp_dev buffer", "buffer for hv_kvp_dev module"); + struct proc *daemon_task; + + struct selinfo hv_kvp_selinfo; +} hv_kvp_sc; + +/* hv_kvp prototypes */ +static int hv_kvp_req_in_progress(hv_kvp_sc *sc); +static void hv_kvp_transaction_init(hv_kvp_sc *sc, uint32_t, uint64_t, uint8_t *); +static void hv_kvp_send_msg_to_daemon(hv_kvp_sc *sc); +static void hv_kvp_process_request(void *context, int pending); /* * hv_kvp low level functions @@ -181,10 +178,10 @@ MALLOC_DEFINE(M_HV_KVP_DEV_BUF, "hv_kvp_ * Check if kvp transaction is in progres */ static int -hv_kvp_req_in_progress(void) +hv_kvp_req_in_progress(hv_kvp_sc *sc) { - return (kvp_globals.req_in_progress); + return (sc->req_in_progress); } @@ -192,18 +189,17 @@ hv_kvp_req_in_progress(void) * This routine is called whenever a message is received from the host */ static void -hv_kvp_transaction_init(uint32_t rcv_len, hv_vmbus_channel *rcv_channel, +hv_kvp_transaction_init(hv_kvp_sc *sc, uint32_t rcv_len, uint64_t request_id, uint8_t *rcv_buf) { - + /* Store all the relevant message details in the global structure */ /* Do not need to use mutex for req_in_progress here */ - kvp_globals.req_in_progress = true; - kvp_globals.host_msg_len = rcv_len; - kvp_globals.channelp = rcv_channel; - kvp_globals.host_msg_id = request_id; - kvp_globals.rcv_buf = rcv_buf; - kvp_globals.host_kvp_msg = (struct hv_kvp_msg *)&rcv_buf[ + sc->req_in_progress = true; + sc->host_msg_len = rcv_len; + sc->host_msg_id = request_id; + sc->rcv_buf = rcv_buf; + sc->host_kvp_msg = (struct hv_kvp_msg *)&rcv_buf[ sizeof(struct hv_vmbus_pipe_hdr) + sizeof(struct hv_vmbus_icmsg_hdr)]; } @@ -255,12 +251,12 @@ hv_kvp_negotiate_version(struct hv_vmbus * Convert ip related info in umsg from utf8 to utf16 and store in hmsg */ static int -hv_kvp_convert_utf8_ipinfo_to_utf16(struct hv_kvp_msg *umsg, +hv_kvp_convert_utf8_ipinfo_to_utf16(struct hv_kvp_msg *umsg, struct hv_kvp_ip_msg *host_ip_msg) { int err_ip, err_subnet, err_gway, err_dns, err_adap; int UNUSED_FLAG = 1; - + utf8_to_utf16((uint16_t *)host_ip_msg->kvp_ip_val.ip_addr, MAX_IP_ADDR_SIZE, (char *)umsg->body.kvp_ip_val.ip_addr, @@ -291,7 +287,7 @@ hv_kvp_convert_utf8_ipinfo_to_utf16(stru strlen((char *)umsg->body.kvp_ip_val.adapter_id), UNUSED_FLAG, &err_adap); - + host_ip_msg->kvp_ip_val.dhcp_enabled = umsg->body.kvp_ip_val.dhcp_enabled; host_ip_msg->kvp_ip_val.addr_family = umsg->body.kvp_ip_val.addr_family; @@ -386,7 +382,7 @@ hv_kvp_convert_utf16_ipinfo_to_utf8(stru MAX_IP_ADDR_SIZE, UNUSED_FLAG, &err_subnet); - + utf16_to_utf8((char *)umsg->body.kvp_ip_val.gate_way, MAX_GATEWAY_SIZE, (uint16_t *)host_ip_msg->kvp_ip_val.gate_way, MAX_GATEWAY_SIZE, @@ -408,16 +404,13 @@ hv_kvp_convert_utf16_ipinfo_to_utf8(stru * Ensure utf16_utf8 takes care of the additional string terminating char!! */ static void -hv_kvp_convert_hostmsg_to_usermsg(void) +hv_kvp_convert_hostmsg_to_usermsg(struct hv_kvp_msg *hmsg, struct hv_kvp_msg *umsg) { int utf_err = 0; uint32_t value_type; - struct hv_kvp_ip_msg *host_ip_msg = (struct hv_kvp_ip_msg *) - kvp_globals.host_kvp_msg; - - struct hv_kvp_msg *hmsg = kvp_globals.host_kvp_msg; - struct hv_kvp_msg *umsg = &kvp_globals.daemon_kvp_msg; + struct hv_kvp_ip_msg *host_ip_msg; + host_ip_msg = (struct hv_kvp_ip_msg*)hmsg; memset(umsg, 0, sizeof(struct hv_kvp_msg)); umsg->kvp_hdr.operation = hmsg->kvp_hdr.operation; @@ -522,14 +515,12 @@ hv_kvp_convert_hostmsg_to_usermsg(void) * Prepare a host kvp msg based on user kvp msg (utf8 to utf16) */ static int -hv_kvp_convert_usermsg_to_hostmsg(void) +hv_kvp_convert_usermsg_to_hostmsg(struct hv_kvp_msg *umsg, struct hv_kvp_msg *hmsg) { int hkey_len = 0, hvalue_len = 0, utf_err = 0; struct hv_kvp_exchg_msg_value *host_exchg_data; char *key_name, *value; - struct hv_kvp_msg *umsg = &kvp_globals.daemon_kvp_msg; - struct hv_kvp_msg *hmsg = kvp_globals.host_kvp_msg; struct hv_kvp_ip_msg *host_ip_msg = (struct hv_kvp_ip_msg *)hmsg; switch (hmsg->kvp_hdr.operation) { @@ -561,7 +552,7 @@ hv_kvp_convert_usermsg_to_hostmsg(void) if ((hkey_len < 0) || (hvalue_len < 0)) return (HV_KVP_E_FAIL); - + return (KVP_SUCCESS); case HV_KVP_OP_GET: @@ -577,9 +568,9 @@ hv_kvp_convert_usermsg_to_hostmsg(void) /* Use values by string */ host_exchg_data->value_type = HV_REG_SZ; - if ((hkey_len < 0) || (hvalue_len < 0)) + if ((hkey_len < 0) || (hvalue_len < 0)) return (HV_KVP_E_FAIL); - + return (KVP_SUCCESS); default: @@ -592,22 +583,22 @@ hv_kvp_convert_usermsg_to_hostmsg(void) * Send the response back to the host. */ static void -hv_kvp_respond_host(int error) +hv_kvp_respond_host(hv_kvp_sc *sc, int error) { struct hv_vmbus_icmsg_hdr *hv_icmsg_hdrp; hv_icmsg_hdrp = (struct hv_vmbus_icmsg_hdr *) - &kvp_globals.rcv_buf[sizeof(struct hv_vmbus_pipe_hdr)]; + &sc->rcv_buf[sizeof(struct hv_vmbus_pipe_hdr)]; if (error) error = HV_KVP_E_FAIL; hv_icmsg_hdrp->status = error; hv_icmsg_hdrp->icflags = HV_ICMSGHDRFLAG_TRANSACTION | HV_ICMSGHDRFLAG_RESPONSE; - - error = hv_vmbus_channel_send_packet(kvp_globals.channelp, - kvp_globals.rcv_buf, - kvp_globals.host_msg_len, kvp_globals.host_msg_id, + + error = hv_vmbus_channel_send_packet(sc->util_sc.hv_dev->channel, + sc->rcv_buf, + sc->host_msg_len, sc->host_msg_id, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, 0); if (error) @@ -621,16 +612,19 @@ hv_kvp_respond_host(int error) * and the host */ static void -hv_kvp_send_msg_to_daemon(void) +hv_kvp_send_msg_to_daemon(hv_kvp_sc *sc) { + struct hv_kvp_msg *hmsg = sc->host_kvp_msg; + struct hv_kvp_msg *umsg = &sc->daemon_kvp_msg; + /* Prepare kvp_msg to be sent to user */ - hv_kvp_convert_hostmsg_to_usermsg(); + hv_kvp_convert_hostmsg_to_usermsg(hmsg, umsg); /* Send the msg to user via function deamon_read - setting sema */ - sema_post(&kvp_globals.dev_sema); + sema_post(&sc->dev_sema); /* We should wake up the daemon, in case it's doing poll() */ - selwakeup(&hv_kvp_selinfo); + selwakeup(&sc->hv_kvp_selinfo); } @@ -642,95 +636,80 @@ static void hv_kvp_process_request(void *context, int pending) { uint8_t *kvp_buf; - hv_vmbus_channel *channel = context; + hv_vmbus_channel *channel; uint32_t recvlen = 0; uint64_t requestid; struct hv_vmbus_icmsg_hdr *icmsghdrp; int ret = 0; - uint64_t pending_cnt = 1; - + hv_kvp_sc *sc; + hv_kvp_log_info("%s: entering hv_kvp_process_request\n", __func__); - kvp_buf = receive_buffer[HV_KVP]; + + sc = (hv_kvp_sc*)context; + kvp_buf = sc->util_sc.receive_buffer;; + channel = sc->util_sc.hv_dev->channel; + ret = hv_vmbus_channel_recv_packet(channel, kvp_buf, 2 * PAGE_SIZE, &recvlen, &requestid); - /* - * We start counting only after the daemon registers - * and therefore there could be requests pending in - * the VMBus that are not reflected in pending_cnt. - * Therefore we continue reading as long as either of - * the below conditions is true. - */ + while ((ret == 0) && (recvlen > 0)) { - while ((pending_cnt>0) || ((ret == 0) && (recvlen > 0))) { + icmsghdrp = (struct hv_vmbus_icmsg_hdr *) + &kvp_buf[sizeof(struct hv_vmbus_pipe_hdr)]; - if ((ret == 0) && (recvlen>0)) { - - icmsghdrp = (struct hv_vmbus_icmsg_hdr *) - &kvp_buf[sizeof(struct hv_vmbus_pipe_hdr)]; - - hv_kvp_transaction_init(recvlen, channel, requestid, kvp_buf); - if (icmsghdrp->icmsgtype == HV_ICMSGTYPE_NEGOTIATE) { - hv_kvp_negotiate_version(icmsghdrp, NULL, kvp_buf); - hv_kvp_respond_host(ret); - - /* - * It is ok to not acquire the mutex before setting - * req_in_progress here because negotiation is the - * first thing that happens and hence there is no - * chance of a race condition. - */ - - kvp_globals.req_in_progress = false; - hv_kvp_log_info("%s :version negotiated\n", __func__); - - } else { - if (!kvp_globals.daemon_busy) { - - hv_kvp_log_info("%s: issuing qury to daemon\n", __func__); - mtx_lock(&kvp_globals.pending_mutex); - kvp_globals.req_timed_out = false; - kvp_globals.daemon_busy = true; - mtx_unlock(&kvp_globals.pending_mutex); - - hv_kvp_send_msg_to_daemon(); - hv_kvp_log_info("%s: waiting for daemon\n", __func__); - } - - /* Wait 5 seconds for daemon to respond back */ - tsleep(&kvp_globals, 0, "kvpworkitem", 5 * hz); - hv_kvp_log_info("%s: came out of wait\n", __func__); + hv_kvp_transaction_init(sc, recvlen, requestid, kvp_buf); + if (icmsghdrp->icmsgtype == HV_ICMSGTYPE_NEGOTIATE) { + hv_kvp_negotiate_version(icmsghdrp, NULL, kvp_buf); + hv_kvp_respond_host(sc, ret); + + /* + * It is ok to not acquire the mutex before setting + * req_in_progress here because negotiation is the + * first thing that happens and hence there is no + * chance of a race condition. + */ + + sc->req_in_progress = false; + hv_kvp_log_info("%s :version negotiated\n", __func__); + + } else { + if (!sc->daemon_busy) { + + hv_kvp_log_info("%s: issuing qury to daemon\n", __func__); + mtx_lock(&sc->pending_mutex); + sc->req_timed_out = false; + sc->daemon_busy = true; + mtx_unlock(&sc->pending_mutex); + + hv_kvp_send_msg_to_daemon(sc); + hv_kvp_log_info("%s: waiting for daemon\n", __func__); } + + /* Wait 5 seconds for daemon to respond back */ + tsleep(sc, 0, "kvpworkitem", 5 * hz); + hv_kvp_log_info("%s: came out of wait\n", __func__); } - mtx_lock(&kvp_globals.pending_mutex); - + mtx_lock(&sc->pending_mutex); + /* Notice that once req_timed_out is set to true * it will remain true until the next request is * sent to the daemon. The response from daemon - * is forwarded to host only when this flag is - * false. + * is forwarded to host only when this flag is + * false. */ - kvp_globals.req_timed_out = true; + sc->req_timed_out = true; /* * Cancel request if so need be. */ - if (hv_kvp_req_in_progress()) { + if (hv_kvp_req_in_progress(sc)) { hv_kvp_log_info("%s: request was still active after wait so failing\n", __func__); - hv_kvp_respond_host(HV_KVP_E_FAIL); - kvp_globals.req_in_progress = false; + hv_kvp_respond_host(sc, HV_KVP_E_FAIL); + sc->req_in_progress = false; } - - /* - * Decrement pending request count and - */ - if (kvp_globals.pending_reqs>0) { - kvp_globals.pending_reqs = kvp_globals.pending_reqs - 1; - } - pending_cnt = kvp_globals.pending_reqs; - - mtx_unlock(&kvp_globals.pending_mutex); + + mtx_unlock(&sc->pending_mutex); /* * Try reading next buffer @@ -738,104 +717,43 @@ hv_kvp_process_request(void *context, in recvlen = 0; ret = hv_vmbus_channel_recv_packet(channel, kvp_buf, 2 * PAGE_SIZE, &recvlen, &requestid); - hv_kvp_log_info("%s: read: context %p, pending_cnt %llu ret =%d, recvlen=%d\n", - __func__, context, (unsigned long long)pending_cnt, ret, recvlen); - } + hv_kvp_log_info("%s: read: context %p, ret =%d, recvlen=%d\n", + __func__, context, ret, recvlen); + } } /* * Callback routine that gets called whenever there is a message from host */ -void +static void hv_kvp_callback(void *context) { - uint64_t pending_cnt = 0; - - if (kvp_globals.register_done == false) { - kvp_globals.channelp = context; - TASK_INIT(&service_table[HV_KVP].task, 0, hv_kvp_process_request, context); - } else { - mtx_lock(&kvp_globals.pending_mutex); - kvp_globals.pending_reqs = kvp_globals.pending_reqs + 1; - pending_cnt = kvp_globals.pending_reqs; - mtx_unlock(&kvp_globals.pending_mutex); - if (pending_cnt == 1) { - hv_kvp_log_info("%s: Queuing work item\n", __func__); - taskqueue_enqueue(taskqueue_thread, &service_table[HV_KVP].task); - } - } -} - - -/* - * This function is called by the hv_kvp_init - - * creates character device hv_kvp_dev - * allocates memory to hv_kvp_dev_buf - * - */ -static int -hv_kvp_dev_init(void) -{ - int error = 0; - - /* initialize semaphore */ - sema_init(&kvp_globals.dev_sema, 0, "hv_kvp device semaphore"); - /* create character device */ - error = make_dev_p(MAKEDEV_CHECKNAME | MAKEDEV_WAITOK, - &hv_kvp_dev, - &hv_kvp_cdevsw, - 0, - UID_ROOT, - GID_WHEEL, - 0640, - "hv_kvp_dev"); - - if (error != 0) - return (error); - + hv_kvp_sc *sc = (hv_kvp_sc*)context; /* - * Malloc with M_WAITOK flag will never fail. - */ - hv_kvp_dev_buf = malloc(sizeof(*hv_kvp_dev_buf), M_HV_KVP_DEV_BUF, M_WAITOK | - M_ZERO); - - return (0); -} - - -/* - * This function is called by the hv_kvp_deinit - - * destroy character device - */ -static void -hv_kvp_dev_destroy(void) -{ - - if (daemon_task != NULL) { - PROC_LOCK(daemon_task); - kern_psignal(daemon_task, SIGKILL); - PROC_UNLOCK(daemon_task); + The first request from host will not be handled until daemon is registered. + when callback is triggered without a registered daemon, callback just return. + When a new daemon gets regsitered, this callbcak is trigged from _write op. + */ + if (sc->register_done) { + hv_kvp_log_info("%s: Queuing work item\n", __func__); + taskqueue_enqueue(taskqueue_thread, &sc->task); } - - destroy_dev(hv_kvp_dev); - free(hv_kvp_dev_buf, M_HV_KVP_DEV_BUF); - return; } - static int hv_kvp_dev_open(struct cdev *dev, int oflags, int devtype, struct thread *td) { - + hv_kvp_sc *sc = (hv_kvp_sc*)dev->si_drv1; + hv_kvp_log_info("%s: Opened device \"hv_kvp_device\" successfully.\n", __func__); - if (kvp_globals.dev_accessed) + if (sc->dev_accessed) return (-EBUSY); - - daemon_task = curproc; - kvp_globals.dev_accessed = true; - kvp_globals.daemon_busy = false; + + sc->daemon_task = curproc; + sc->dev_accessed = true; + sc->daemon_busy = false; return (0); } @@ -844,10 +762,11 @@ static int hv_kvp_dev_close(struct cdev *dev __unused, int fflag __unused, int devtype __unused, struct thread *td __unused) { + hv_kvp_sc *sc = (hv_kvp_sc*)dev->si_drv1; hv_kvp_log_info("%s: Closing device \"hv_kvp_device\".\n", __func__); - kvp_globals.dev_accessed = false; - kvp_globals.register_done = false; + sc->dev_accessed = false; + sc->register_done = false; return (0); } @@ -857,18 +776,21 @@ hv_kvp_dev_close(struct cdev *dev __unus * acts as a send to daemon */ static int -hv_kvp_dev_daemon_read(struct cdev *dev __unused, struct uio *uio, int ioflag __unused) +hv_kvp_dev_daemon_read(struct cdev *dev, struct uio *uio, int ioflag __unused) { size_t amt; int error = 0; + struct hv_kvp_msg *hv_kvp_dev_buf; + hv_kvp_sc *sc = (hv_kvp_sc*)dev->si_drv1; /* Check hv_kvp daemon registration status*/ - if (!kvp_globals.register_done) + if (!sc->register_done) return (KVP_ERROR); - sema_wait(&kvp_globals.dev_sema); + sema_wait(&sc->dev_sema); - memcpy(hv_kvp_dev_buf, &kvp_globals.daemon_kvp_msg, sizeof(struct hv_kvp_msg)); + hv_kvp_dev_buf = malloc(sizeof(*hv_kvp_dev_buf), M_TEMP, M_WAITOK); + memcpy(hv_kvp_dev_buf, &sc->daemon_kvp_msg, sizeof(struct hv_kvp_msg)); amt = MIN(uio->uio_resid, uio->uio_offset >= BUFFERSIZE + 1 ? 0 : BUFFERSIZE + 1 - uio->uio_offset); @@ -876,6 +798,7 @@ hv_kvp_dev_daemon_read(struct cdev *dev if ((error = uiomove(hv_kvp_dev_buf, amt, uio)) != 0) hv_kvp_log_info("%s: hv_kvp uiomove read failed!\n", __func__); + free(hv_kvp_dev_buf, M_TEMP); return (error); } @@ -885,29 +808,30 @@ hv_kvp_dev_daemon_read(struct cdev *dev * acts as a recieve from daemon */ static int -hv_kvp_dev_daemon_write(struct cdev *dev __unused, struct uio *uio, int ioflag __unused) +hv_kvp_dev_daemon_write(struct cdev *dev, struct uio *uio, int ioflag __unused) { size_t amt; int error = 0; + struct hv_kvp_msg *hv_kvp_dev_buf; + hv_kvp_sc *sc = (hv_kvp_sc*)dev->si_drv1; uio->uio_offset = 0; + hv_kvp_dev_buf = malloc(sizeof(*hv_kvp_dev_buf), M_TEMP, M_WAITOK); amt = MIN(uio->uio_resid, BUFFERSIZE); error = uiomove(hv_kvp_dev_buf, amt, uio); - if (error != 0) + if (error != 0) { + free(hv_kvp_dev_buf, M_TEMP); return (error); + } + memcpy(&sc->daemon_kvp_msg, hv_kvp_dev_buf, sizeof(struct hv_kvp_msg)); - memcpy(&kvp_globals.daemon_kvp_msg, hv_kvp_dev_buf, sizeof(struct hv_kvp_msg)); - - if (kvp_globals.register_done == false) { - if (kvp_globals.daemon_kvp_msg.kvp_hdr.operation == HV_KVP_OP_REGISTER) { - - kvp_globals.register_done = true; - if (kvp_globals.channelp) { - - hv_kvp_callback(kvp_globals.channelp); - } + free(hv_kvp_dev_buf, M_TEMP); + if (sc->register_done == false) { + if (sc->daemon_kvp_msg.kvp_hdr.operation == HV_KVP_OP_REGISTER) { + sc->register_done = true; + hv_kvp_callback(dev->si_drv1); } else { hv_kvp_log_info("%s, KVP Registration Failed\n", __func__); @@ -915,18 +839,20 @@ hv_kvp_dev_daemon_write(struct cdev *dev } } else { - mtx_lock(&kvp_globals.pending_mutex); + mtx_lock(&sc->pending_mutex); - if(!kvp_globals.req_timed_out) { - - hv_kvp_convert_usermsg_to_hostmsg(); - hv_kvp_respond_host(KVP_SUCCESS); - wakeup(&kvp_globals); - kvp_globals.req_in_progress = false; + if(!sc->req_timed_out) { + struct hv_kvp_msg *hmsg = sc->host_kvp_msg; + struct hv_kvp_msg *umsg = &sc->daemon_kvp_msg; + + hv_kvp_convert_usermsg_to_hostmsg(umsg, hmsg); + hv_kvp_respond_host(sc, KVP_SUCCESS); + wakeup(sc); + sc->req_in_progress = false; } - kvp_globals.daemon_busy = false; - mtx_unlock(&kvp_globals.pending_mutex); + sc->daemon_busy = false; + mtx_unlock(&sc->pending_mutex); } return (error); @@ -938,53 +864,106 @@ hv_kvp_dev_daemon_write(struct cdev *dev * for daemon to read. */ static int -hv_kvp_dev_daemon_poll(struct cdev *dev __unused, int events, struct thread *td) +hv_kvp_dev_daemon_poll(struct cdev *dev, int events, struct thread *td) { int revents = 0; + hv_kvp_sc *sc = (hv_kvp_sc*)dev->si_drv1; - mtx_lock(&kvp_globals.pending_mutex); + mtx_lock(&sc->pending_mutex); /* * We check global flag daemon_busy for the data availiability for * userland to read. Deamon_busy is set to true before driver has data * for daemon to read. It is set to false after daemon sends * then response back to driver. */ - if (kvp_globals.daemon_busy == true) + if (sc->daemon_busy == true) revents = POLLIN; else - selrecord(td, &hv_kvp_selinfo); + selrecord(td, &sc->hv_kvp_selinfo); - mtx_unlock(&kvp_globals.pending_mutex); + mtx_unlock(&sc->pending_mutex); return (revents); } +static int +hv_kvp_probe(device_t dev) +{ + const char *p = vmbus_get_type(dev); + if (!memcmp(p, &service_guid, sizeof(hv_guid))) { + device_set_desc(dev, "Hyper-V KVP Service"); + return BUS_PROBE_DEFAULT; + } -/* - * hv_kvp initialization function - * called from hv_util service. - * - */ -int -hv_kvp_init(hv_vmbus_service *srv) + return ENXIO; +} + +static int +hv_kvp_attach(device_t dev) { - int error = 0; + int error; + struct sysctl_oid_list *child; + struct sysctl_ctx_list *ctx; - memset(&kvp_globals, 0, sizeof(kvp_globals)); + hv_kvp_sc *sc = (hv_kvp_sc*)device_get_softc(dev); - error = hv_kvp_dev_init(); - mtx_init(&kvp_globals.pending_mutex, "hv-kvp pending mutex", + sc->util_sc.callback = hv_kvp_callback; + sema_init(&sc->dev_sema, 0, "hv_kvp device semaphore"); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Jun 13 09:22:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29F2AAF1024; Mon, 13 Jun 2016 09:22:22 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF17D2D16; Mon, 13 Jun 2016 09:22:21 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5D9ML5d028008; Mon, 13 Jun 2016 09:22:21 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5D9MLup028007; Mon, 13 Jun 2016 09:22:21 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201606130922.u5D9MLup028007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Mon, 13 Jun 2016 09:22:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301867 - head/sys/security/audit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 09:22:22 -0000 Author: rwatson Date: Mon Jun 13 09:22:20 2016 New Revision: 301867 URL: https://svnweb.freebsd.org/changeset/base/301867 Log: Implement AUE_PREAD and AUE_PWRITE BSM conversion support, eliminating console warnings when pread(2) and pwrite(2) are used with full system-call auditing enabled. We audit the same file-descriptor data for these calls as we do read(2) and write(2). Approved by: re (kib) MFC after: 3 days Sponsored by: DARPA, AFRL Modified: head/sys/security/audit/audit_bsm.c Modified: head/sys/security/audit/audit_bsm.c ============================================================================== --- head/sys/security/audit/audit_bsm.c Mon Jun 13 09:02:08 2016 (r301866) +++ head/sys/security/audit/audit_bsm.c Mon Jun 13 09:22:20 2016 (r301867) @@ -952,6 +952,8 @@ kaudit_to_bsm(struct kaudit_record *kar, case AUE_GETDIRENTRIESATTR: case AUE_LSEEK: case AUE_POLL: + case AUE_PREAD: + case AUE_PWRITE: case AUE_READ: case AUE_READV: case AUE_WRITE: From owner-svn-src-all@freebsd.org Mon Jun 13 10:35:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D400AF16CA; Mon, 13 Jun 2016 10:35:13 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F33928A6; Mon, 13 Jun 2016 10:35:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5DAZC0j053870; Mon, 13 Jun 2016 10:35:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5DAZCij053866; Mon, 13 Jun 2016 10:35:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606131035.u5DAZCij053866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 13 Jun 2016 10:35:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301869 - in head: share/misc usr.bin/calendar/calendars usr.sbin/sysrc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 10:35:13 -0000 Author: ngie Date: Mon Jun 13 10:35:11 2016 New Revision: 301869 URL: https://svnweb.freebsd.org/changeset/base/301869 Log: Change my given name from "Garrett" to "Ngie" A legal name change from "Garrett" to "Ngie", as well as a FreeBSD account name change, is pending. Approved by: re (hrs) Modified: head/share/misc/committers-src.dot head/usr.bin/calendar/calendars/calendar.freebsd head/usr.sbin/sysrc/sysrc.8 Directory Properties: head/ (props changed) Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Mon Jun 13 10:30:49 2016 (r301868) +++ head/share/misc/committers-src.dot Mon Jun 13 10:35:11 2016 (r301869) @@ -244,7 +244,7 @@ mp [label="Mark Peek\nmp@FreeBSD.org\n20 mr [label="Michael Reifenberger\nmr@FreeBSD.org\n2001/09/30"] neel [label="Neel Natu\nneel@FreeBSD.org\n2009/09/20"] netchild [label="Alexander Leidinger\nnetchild@FreeBSD.org\n2005/03/31"] -ngie [label="Garrett Cooper\nngie@FreeBSD.org\n2014/07/27"] +ngie [label="Ngie Cooper\nngie@FreeBSD.org\n2014/07/27"] nork [label="Norikatsu Shigemura\nnork@FreeBSD.org\n2009/06/09"] np [label="Navdeep Parhar\nnp@FreeBSD.org\n2009/06/05"] nwhitehorn [label="Nathan Whitehorn\nnwhitehorn@FreeBSD.org\n2008/07/03"] Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Mon Jun 13 10:30:49 2016 (r301868) +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon Jun 13 10:35:11 2016 (r301869) @@ -36,7 +36,7 @@ 01/26 Andrew Gallatin born in Buffalo, New York, United States, 1970 01/27 Nick Sayer born in San Diego, California, United States, 1968 01/27 Jacques Anthony Vidrine born in Baton Rouge, Louisiana, United States, 1971 -01/27 Garrett Cooper born in Seattle, Washington, United States, 1984 +01/27 Ngie Cooper born in Seattle, Washington, United States, 1984 01/31 Hidetoshi Shimokawa born in Yokohama, Kanagawa, Japan, 1970 02/01 Doug Rabson born in London, England, 1966 02/01 Nicola Vitale born in Busto Arsizio, Varese, Italy, 1976 Modified: head/usr.sbin/sysrc/sysrc.8 ============================================================================== --- head/usr.sbin/sysrc/sysrc.8 Mon Jun 13 10:30:49 2016 (r301868) +++ head/usr.sbin/sysrc/sysrc.8 Mon Jun 13 10:35:11 2016 (r301869) @@ -480,6 +480,6 @@ utility first appeared in .Sh AUTHORS .An Devin Teske Aq Mt dteske@FreeBSD.org .Sh THANKS TO -Brandon Gooch, Garrett Cooper, Julian Elischer, Pawel Jakub Dawidek, +Brandon Gooch, Ngie Cooper, Julian Elischer, Pawel Jakub Dawidek, Cyrille Lefevre, Ross West, Stefan Esser, Marco Steinbach, Jilles Tjoelker, Allan Jude, and Lars Engels for suggestions, help, and testing. From owner-svn-src-all@freebsd.org Mon Jun 13 10:53:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 844A9AF1B06; Mon, 13 Jun 2016 10:53:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 56A022288; Mon, 13 Jun 2016 10:53:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5DArYff061294; Mon, 13 Jun 2016 10:53:34 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5DArYFP061293; Mon, 13 Jun 2016 10:53:34 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201606131053.u5DArYFP061293@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 13 Jun 2016 10:53:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301870 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 10:53:35 -0000 Author: avg Date: Mon Jun 13 10:53:34 2016 New Revision: 301870 URL: https://svnweb.freebsd.org/changeset/base/301870 Log: zfs_vptocnp: check for an invalid znode ... which can arise after the receive or rollback and failed zfs_rezget(). Approved by: re (kib) MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Jun 13 10:35:11 2016 (r301869) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Jun 13 10:53:34 2016 (r301870) @@ -7170,16 +7170,24 @@ zfs_vptocnp(struct vop_vptocnp_args *ap) int ltype; int error; + ZFS_ENTER(zfsvfs); + ZFS_VERIFY_ZP(zp); + /* * If we are a snapshot mounted under .zfs, run the operation * on the covered vnode. */ if ((error = sa_lookup(zp->z_sa_hdl, - SA_ZPL_PARENT(zfsvfs), &parent, sizeof (parent))) != 0) + SA_ZPL_PARENT(zfsvfs), &parent, sizeof (parent))) != 0) { + ZFS_EXIT(zfsvfs); return (error); + } - if (zp->z_id != parent || zfsvfs->z_parent == zfsvfs) + if (zp->z_id != parent || zfsvfs->z_parent == zfsvfs) { + ZFS_EXIT(zfsvfs); return (vop_stdvptocnp(ap)); + } + ZFS_EXIT(zfsvfs); covered_vp = vp->v_mount->mnt_vnodecovered; vhold(covered_vp); From owner-svn-src-all@freebsd.org Mon Jun 13 11:19:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67048AF14C5; Mon, 13 Jun 2016 11:19:07 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 36D0E22C1; Mon, 13 Jun 2016 11:19:07 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5DBJ6tt068732; Mon, 13 Jun 2016 11:19:06 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5DBJ60X068731; Mon, 13 Jun 2016 11:19:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201606131119.u5DBJ60X068731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 13 Jun 2016 11:19:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301871 - head/usr.sbin/rpc.lockd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 11:19:07 -0000 Author: ngie Date: Mon Jun 13 11:19:06 2016 New Revision: 301871 URL: https://svnweb.freebsd.org/changeset/base/301871 Log: Add missing break in lock_partialfilelock(..) with NFS_RESERR This will help ensure that the right error is trickled up when the function is called if the lock status is NFS_RESERR Differential Revision: https://reviews.freebsd.org/D6622 Reviewed by: rmacklem Approved by: re (gjb) Tested with: fsx; svn info/svnversion (uses bdb locking); locktests from Bull http://nfsv4.bullopensource.org/tools/tests/locktest.php MFC after: 2 weeks Reported by: Coverity CID: 1008161, 1304956 Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/rpc.lockd/lockd_lock.c Modified: head/usr.sbin/rpc.lockd/lockd_lock.c ============================================================================== --- head/usr.sbin/rpc.lockd/lockd_lock.c Mon Jun 13 10:53:34 2016 (r301870) +++ head/usr.sbin/rpc.lockd/lockd_lock.c Mon Jun 13 11:19:06 2016 (r301871) @@ -1426,6 +1426,7 @@ lock_partialfilelock(struct file_lock *f break; case NFS_RESERR: retval = PFL_NFSRESERR; + break; default: debuglog("Unmatched lnlstatus %d\n"); retval = PFL_NFSDENIED_NOLOCK; From owner-svn-src-all@freebsd.org Mon Jun 13 16:13:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20196AF1466; Mon, 13 Jun 2016 16:13:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 086DF27E0; Mon, 13 Jun 2016 16:13:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 024E01F70; Mon, 13 Jun 2016 16:13:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id A0ABD20AB9; Mon, 13 Jun 2016 16:13:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id jYVMI8xcHuFN; Mon, 13 Jun 2016 16:13:10 +0000 (UTC) Subject: Re: svn commit: r300943 - in head: . lib/libc++ lib/libcxxrt share/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com AB83B20AB1 To: Andreas Tobler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605290620.u4T6KFjT002312@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <019be81b-9f3c-f4c7-620a-b1849f4e82ff@FreeBSD.org> Date: Mon, 13 Jun 2016 09:13:09 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PahxjkGojnXiWvs55iRhV0W3f6DflVNI5" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 16:13:13 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --PahxjkGojnXiWvs55iRhV0W3f6DflVNI5 Content-Type: multipart/mixed; boundary="vwklwn0foAr3edejbmepJEb68Hu8Pfh7l" From: Bryan Drewery To: Andreas Tobler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <019be81b-9f3c-f4c7-620a-b1849f4e82ff@FreeBSD.org> Subject: Re: svn commit: r300943 - in head: . lib/libc++ lib/libcxxrt share/mk References: <201605290620.u4T6KFjT002312@repo.freebsd.org> In-Reply-To: --vwklwn0foAr3edejbmepJEb68Hu8Pfh7l Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 6/12/2016 1:02 PM, Andreas Tobler wrote: > Hi Bryan, >=20 > On 29.05.16 08:20, Bryan Drewery wrote: >> Author: bdrewery >> Date: Sun May 29 06:20:15 2016 >> New Revision: 300943 >> URL: https://svnweb.freebsd.org/changeset/base/300943 >> >> Log: >> GCC External: Revert r300886, r300904, r300917, r300918 >> >> The fix in r300873 is mostly enough. A fix for lib32 will be >> committed.separately. >=20 > Did this commit already happen? >=20 > I still suffer a broken buildworld on powerpc64 for 32-bit with interna= l > tools. >=20 > Unknown option -std=3Dc++11... Can you tee the entire build and send me the log please? --=20 Regards, Bryan Drewery --vwklwn0foAr3edejbmepJEb68Hu8Pfh7l-- --PahxjkGojnXiWvs55iRhV0W3f6DflVNI5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJXXtuZAAoJEDXXcbtuRpfPZmIH/2+5hfmZKubfoxmwraarHA57 hUaP/HLe7Sb0HIqOwEeETgPQdWp7fNZlib0LDo5sZbOTt/giQheTycDOxi0FIM4m j8Tnz/ErrB8XztppqQqiEygTaLlPsUaLEmlQJ1oPF2bttBSqatSZ5KaoQyoDTglM Burx4qQ521faArVpLLUp/KM6l8qDIONwI3J7kSEcFIG8VLlSaOaL+KB7Wr/x+gwW BcrRwgXJYq7e4Z6wgq9qgUxX81GTnOpJxxQKEx22St/dICzYPp6q18PjjqubXD3d ozf/u4MjbUkkv9eB4gOh133/mDU+CZzxKPvLooIG52QFEnpVIf9+nFFZ01PTBxY= =hfzr -----END PGP SIGNATURE----- --PahxjkGojnXiWvs55iRhV0W3f6DflVNI5-- From owner-svn-src-all@freebsd.org Mon Jun 13 16:48:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B452BAF1B86; Mon, 13 Jun 2016 16:48:28 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85A252D16; Mon, 13 Jun 2016 16:48:28 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5DGmRMb089450; Mon, 13 Jun 2016 16:48:27 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5DGmRFb089449; Mon, 13 Jun 2016 16:48:27 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201606131648.u5DGmRFb089449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 13 Jun 2016 16:48:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301872 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 16:48:28 -0000 Author: ian Date: Mon Jun 13 16:48:27 2016 New Revision: 301872 URL: https://svnweb.freebsd.org/changeset/base/301872 Log: Do not define __NO_STRICT_ALIGNMENT for armv6. While the requirements are no longer natural-alignment strict, there are still some restrictions. FreeBSD network code assumes data is naturally-aligned or is running on a platform with no restrictions; pointers are not annotated to indicate the data pointed to may be packed or unaligned. The clang optimizer can sometimes combine the load or store of a pair of adjacent 32-bit values into a single doubleword load/store, and that operation requires at least 4-byte alignment. __NO_STRICT_ALIGNMENT can lead to tcp headers being only 2-byte aligned. Note that alignment faults remain disabled on armv6, this change reverts only the defining of the symbol which leads to some overly-agressive code shortcuts when building common/shared drivers and network code for arm. Approved by: re(kib) Modified: head/sys/arm/include/_types.h Modified: head/sys/arm/include/_types.h ============================================================================== --- head/sys/arm/include/_types.h Mon Jun 13 11:19:06 2016 (r301871) +++ head/sys/arm/include/_types.h Mon Jun 13 16:48:27 2016 (r301872) @@ -43,10 +43,6 @@ #error this file needs sys/cdefs.h as a prerequisite #endif -#if __ARM_ARCH >= 6 -#define __NO_STRICT_ALIGNMENT -#endif - /* * Basic types upon which most other types are built. */ From owner-svn-src-all@freebsd.org Mon Jun 13 18:39:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B640AF22DE; Mon, 13 Jun 2016 18:39:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6CF8B2FE0; Mon, 13 Jun 2016 18:39:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5DIdDcD029839; Mon, 13 Jun 2016 18:39:13 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5DIdDFS029838; Mon, 13 Jun 2016 18:39:13 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201606131839.u5DIdDFS029838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 13 Jun 2016 18:39:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301873 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 18:39:14 -0000 Author: avg Date: Mon Jun 13 18:39:13 2016 New Revision: 301873 URL: https://svnweb.freebsd.org/changeset/base/301873 Log: l2arc: reset b_tmp_cdata to NULL in the case of unset b_daddr The change is in arc_buf_l2_cdata_free(). Without this we can trip the assertion in arc_hdr_realloc() if INVARIANTS option is enabled. Approved by: re (kib) MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Jun 13 16:48:27 2016 (r301872) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Jun 13 18:39:13 2016 (r301873) @@ -2249,6 +2249,7 @@ arc_buf_l2_cdata_free(arc_buf_hdr_t *hdr ASSERT3P(hdr->b_l1hdr.b_tmp_cdata, ==, hdr->b_l1hdr.b_buf->b_data); ASSERT3U(hdr->b_l2hdr.b_compress, ==, ZIO_COMPRESS_OFF); + hdr->b_l1hdr.b_tmp_cdata = NULL; return; } From owner-svn-src-all@freebsd.org Mon Jun 13 21:51:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B5A6AF25D1; Mon, 13 Jun 2016 21:51:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 52B74293A; Mon, 13 Jun 2016 21:51:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 4C4E71374; Mon, 13 Jun 2016 21:51:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 8FA4721433; Mon, 13 Jun 2016 21:51:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id Un2Il1Xn-Uvv; Mon, 13 Jun 2016 21:51:33 +0000 (UTC) Subject: Re: svn commit: r300943 - in head: . lib/libc++ lib/libcxxrt share/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com E7C0B2142D To: Andreas Tobler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605290620.u4T6KFjT002312@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <42af97ed-8cd8-fd2c-3e4f-576885a28ad2@FreeBSD.org> Date: Mon, 13 Jun 2016 14:51:32 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="62poNK4tg28d0pOtgn9pLwC12aj85oJT4" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 21:51:37 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --62poNK4tg28d0pOtgn9pLwC12aj85oJT4 Content-Type: multipart/mixed; boundary="qIE8EXESq1OBspWMfKGebe3IpGm7rtBoQ" From: Bryan Drewery To: Andreas Tobler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <42af97ed-8cd8-fd2c-3e4f-576885a28ad2@FreeBSD.org> Subject: Re: svn commit: r300943 - in head: . lib/libc++ lib/libcxxrt share/mk References: <201605290620.u4T6KFjT002312@repo.freebsd.org> In-Reply-To: --qIE8EXESq1OBspWMfKGebe3IpGm7rtBoQ Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 6/12/2016 1:02 PM, Andreas Tobler wrote: > Hi Bryan, >=20 > On 29.05.16 08:20, Bryan Drewery wrote: >> Author: bdrewery >> Date: Sun May 29 06:20:15 2016 >> New Revision: 300943 >> URL: https://svnweb.freebsd.org/changeset/base/300943 >> >> Log: >> GCC External: Revert r300886, r300904, r300917, r300918 >> >> The fix in r300873 is mostly enough. A fix for lib32 will be >> committed.separately. >=20 > Did this commit already happen? >=20 > I still suffer a broken buildworld on powerpc64 for 32-bit with interna= l > tools. >=20 > Unknown option -std=3Dc++11... Try with this patch please, number of -j doesn't matter. https://people.freebsd.org/~bdrewery/patches/libcompat-xgcc-c++11.diff --=20 Regards, Bryan Drewery --qIE8EXESq1OBspWMfKGebe3IpGm7rtBoQ-- --62poNK4tg28d0pOtgn9pLwC12aj85oJT4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJXXyrkAAoJEDXXcbtuRpfPsiEH+QEfEP0vBl1/iuR6NYL3as24 D+1FVWra4soBc0FjLFi30JtF2nLgo5zStguiQ5XfWMdtge+ouJFBv1n/S6k8y3Ra eLgIc+Tu8bDUfFlU8oSxktJoXR7wkdiM0toxQ41Pq70KIJRQz1YjKumbvR0RO7rk dX75yi07bDIQ7nXk96KHhZnEDMQn9y4wW78rERpi/OJRRVTb8XNj1skPQacUUigS jqM6i8LrUqM6XfYqoC8q7rqcosHeI7l9FOraeXz6NRZw5BID6ewlI20cSL3Bn9hI TE/aJ4mlp3JBXqUW9aULrQe+suKMmW7MPhVqPp7KgSmG3lPFzdzcS+2wZiVcnsQ= =k81+ -----END PGP SIGNATURE----- --62poNK4tg28d0pOtgn9pLwC12aj85oJT4-- From owner-svn-src-all@freebsd.org Mon Jun 13 22:00:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD045AF2949; Mon, 13 Jun 2016 22:00:45 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B0AE20AC; Mon, 13 Jun 2016 22:00:45 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5DM0iXY005945; Mon, 13 Jun 2016 22:00:44 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5DM0i6J005944; Mon, 13 Jun 2016 22:00:44 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201606132200.u5DM0i6J005944@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 13 Jun 2016 22:00:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301874 - head/usr.sbin/extattr/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 22:00:45 -0000 Author: asomers Date: Mon Jun 13 22:00:44 2016 New Revision: 301874 URL: https://svnweb.freebsd.org/changeset/base/301874 Log: Fix usr.sbin/extattr testcases on tmpfs Skip the usr.sbin/extattr testscases if $TMPDIR is tmpfs, which doesn't support extended attributes PR: 210184 Reported by: ngie Reviewed by: ngie Approved by: re (glebius) MFC after: 4 weeks Differential Revision: https://reviews.freebsd.org/D6802 Sponsored by: Spectra Logic Corp Modified: head/usr.sbin/extattr/tests/extattr_test.sh Modified: head/usr.sbin/extattr/tests/extattr_test.sh ============================================================================== --- head/usr.sbin/extattr/tests/extattr_test.sh Mon Jun 13 18:39:13 2016 (r301873) +++ head/usr.sbin/extattr/tests/extattr_test.sh Mon Jun 13 22:00:44 2016 (r301874) @@ -30,6 +30,7 @@ bad_namespace_head() { atf_set "descr" "Can't set attributes for nonexistent namespaces" } bad_namespace_body() { + check_fs touch foo atf_check -s not-exit:0 -e match:"Invalid argument" \ setextattr badnamespace myattr X foo @@ -42,6 +43,7 @@ hex_head() { atf_set "descr" "Set and get attribute values in hexadecimal" } hex_body() { + check_fs touch foo atf_check -s exit:0 -o empty setextattr user myattr XYZ foo atf_check -s exit:0 -o inline:"58 59 5a\n" \ @@ -53,6 +55,7 @@ hex_nonascii_head() { atf_set "descr" "Get binary attribute values in hexadecimal" } hex_nonascii_body() { + check_fs touch foo BINSTUFF=`echo $'\x20\x30\x40\x55\x66\x70\x81\xa2\xb3\xee\xff'` atf_check -s exit:0 -o empty setextattr user myattr "$BINSTUFF" foo @@ -66,6 +69,7 @@ long_name_head() { atf_set "descr" "A maximum length attribute name" } long_name_body() { + check_fs # https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208965 atf_expect_fail "BUG 208965 extattr(2) doesn't allow maxlen attr names" @@ -84,6 +88,7 @@ loud_head() { atf_set "descr" "Loud (non -q) output for each command" } loud_body() { + check_fs touch foo # setextattr(8) and friends print hard tabs. Use printf to convert # them to spaces before checking the output. @@ -101,6 +106,7 @@ noattrs_head() { atf_set "descr" "A file with no extended attributes" } noattrs_body() { + check_fs touch foo atf_check -s exit:0 -o empty lsextattr -q user foo } @@ -110,6 +116,7 @@ nonexistent_file_head() { atf_set "descr" "A file that does not exist" } nonexistent_file_body() { + check_fs atf_check -s exit:1 -e match:"No such file or directory" \ lsextattr user foo atf_check -s exit:1 -e match:"No such file or directory" \ @@ -125,6 +132,7 @@ null_head() { atf_set "descr" "NUL-terminate an attribute value" } null_body() { + check_fs touch foo atf_check -s exit:0 -o empty setextattr -n user myattr myvalue foo atf_check -s exit:0 -o inline:"myvalue\0\n" getextattr -q user myattr foo @@ -135,6 +143,7 @@ one_user_attr_head() { atf_set "descr" "A file with one extended attribute" } one_user_attr_body() { + check_fs touch foo atf_check -s exit:0 -o empty setextattr user myattr myvalue foo atf_check -s exit:0 -o inline:"myattr\n" lsextattr -q user foo @@ -149,6 +158,7 @@ one_system_attr_head() { atf_set "require.user" "root" } one_system_attr_body() { + check_fs touch foo atf_check -s exit:0 -o empty setextattr system myattr myvalue foo atf_check -s exit:0 -o inline:"myattr\n" lsextattr -q system foo @@ -162,6 +172,7 @@ stdin_head() { atf_set "descr" "Set attribute value from stdin" } stdin_body() { + check_fs dd if=/dev/random of=infile bs=1k count=8 touch foo setextattr -i user myattr foo < infile || atf_fail "setextattr failed" @@ -175,6 +186,7 @@ stringify_head() { atf_set "descr" "Stringify the output of getextattr" } stringify_body() { + check_fs touch foo atf_check -s exit:0 -o empty setextattr user myattr "my value" foo atf_check -s exit:0 -o inline:"\"my\\\040value\"\n" \ @@ -186,6 +198,7 @@ symlink_head() { atf_set "descr" "A symlink to an ordinary file" } symlink_body() { + check_fs touch foo ln -s foo foolink atf_check -s exit:0 -o empty setextattr user myattr myvalue foolink @@ -199,6 +212,7 @@ symlink_nofollow_head() { atf_set "descr" "Operating directly on a symlink" } symlink_nofollow_body() { + check_fs touch foo ln -s foo foolink # Check that with -h we can operate directly on the link @@ -221,6 +235,7 @@ system_and_user_attrs_head() { atf_set "require.user" "root" } system_and_user_attrs_body() { + check_fs touch foo atf_check -s exit:0 -o empty setextattr user userattr userval foo atf_check -s exit:0 -o empty setextattr system sysattr sysval foo @@ -240,6 +255,7 @@ two_files_head() { atf_set "descr" "Manipulate two files" } two_files_body() { + check_fs touch foo bar atf_check -s exit:0 -o empty setextattr user myattr myvalue foo bar atf_check -s exit:0 -o inline:"foo\tmyattr\nbar\tmyattr\n" \ @@ -256,6 +272,7 @@ two_files_force_head() { atf_set "descr" "Manipulate two files. The first does not exist" } two_files_force_body() { + check_fs touch bar atf_check -s exit:1 -e match:"No such file or directory" \ setextattr user myattr myvalue foo bar @@ -281,6 +298,7 @@ two_user_attrs_head() { atf_set "descr" "A file with two extended attributes" } two_user_attrs_body() { + check_fs touch foo atf_check -s exit:0 -o empty setextattr user myattr1 myvalue1 foo atf_check -s exit:0 -o empty setextattr user myattr2 myvalue2 foo @@ -305,6 +323,7 @@ unprivileged_user_cannot_set_system_attr atf_set "require.user" "unprivileged" } unprivileged_user_cannot_set_system_attr_body() { + check_fs touch foo atf_check -s exit:1 -e match:"Operation not permitted" \ setextattr system myattr myvalue foo @@ -333,3 +352,11 @@ atf_init_test_cases() { atf_add_test_case two_user_attrs atf_add_test_case unprivileged_user_cannot_set_system_attr } + +check_fs() { + case `df -T . | tail -n 1 | cut -wf 2` in + "ufs") ;; # UFS is fine + "zfs") ;; # ZFS is fine + "tmpfs") atf_skip "tmpfs does not support extended attributes";; + esac +} From owner-svn-src-all@freebsd.org Mon Jun 13 22:31:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 766B4AF2F4D; Mon, 13 Jun 2016 22:31:17 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 38A3C2FDE; Mon, 13 Jun 2016 22:31:17 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5DMVGBF017511; Mon, 13 Jun 2016 22:31:16 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5DMVGnF017509; Mon, 13 Jun 2016 22:31:16 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606132231.u5DMVGnF017509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 13 Jun 2016 22:31:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301875 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 22:31:17 -0000 Author: pfg Date: Mon Jun 13 22:31:16 2016 New Revision: 301875 URL: https://svnweb.freebsd.org/changeset/base/301875 Log: Remove the SIOCSIFALIFETIME_IN6 ioctl. The SIOCSIFALIFETIME_IN6 provided by the kame project is unused, it can't really be used safely and has been completely removed from NetBSD and OpenBSD. Obtained from: NetBSD (kern/35897) PR: 210148 (exp-run) Reviewed by: ae, hrs Relnotes: yes Approved by: re (glebius) Differential Revision: https://reviews.freebsd.org/D5491 Modified: head/sys/netinet6/in6.c head/sys/netinet6/in6_var.h Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Mon Jun 13 22:00:44 2016 (r301874) +++ head/sys/netinet6/in6.c Mon Jun 13 22:31:16 2016 (r301875) @@ -360,7 +360,6 @@ in6_control(struct socket *so, u_long cm case SIOCSPFXFLUSH_IN6: case SIOCSRTRFLUSH_IN6: case SIOCGIFALIFETIME_IN6: - case SIOCSIFALIFETIME_IN6: case SIOCGIFSTAT_IN6: case SIOCGIFSTAT_ICMP6: sa6 = &ifr->ifr_addr; @@ -459,34 +458,6 @@ in6_control(struct socket *so, u_long cm goto out; } break; - - case SIOCSIFALIFETIME_IN6: - { - struct in6_addrlifetime *lt; - - if (td != NULL) { - error = priv_check(td, PRIV_NETINET_ALIFETIME6); - if (error) - goto out; - } - if (ia == NULL) { - error = EADDRNOTAVAIL; - goto out; - } - /* sanity for overflow - beware unsigned */ - lt = &ifr->ifr_ifru.ifru_lifetime; - if (lt->ia6t_vltime != ND6_INFINITE_LIFETIME && - lt->ia6t_vltime + time_uptime < time_uptime) { - error = EINVAL; - goto out; - } - if (lt->ia6t_pltime != ND6_INFINITE_LIFETIME && - lt->ia6t_pltime + time_uptime < time_uptime) { - error = EINVAL; - goto out; - } - break; - } } switch (cmd) { @@ -572,21 +543,6 @@ in6_control(struct socket *so, u_long cm } break; - case SIOCSIFALIFETIME_IN6: - ia->ia6_lifetime = ifr->ifr_ifru.ifru_lifetime; - /* for sanity */ - if (ia->ia6_lifetime.ia6t_vltime != ND6_INFINITE_LIFETIME) { - ia->ia6_lifetime.ia6t_expire = - time_uptime + ia->ia6_lifetime.ia6t_vltime; - } else - ia->ia6_lifetime.ia6t_expire = 0; - if (ia->ia6_lifetime.ia6t_pltime != ND6_INFINITE_LIFETIME) { - ia->ia6_lifetime.ia6t_preferred = - time_uptime + ia->ia6_lifetime.ia6t_pltime; - } else - ia->ia6_lifetime.ia6t_preferred = 0; - break; - case SIOCAIFADDR_IN6: { struct nd_prefixctl pr0; Modified: head/sys/netinet6/in6_var.h ============================================================================== --- head/sys/netinet6/in6_var.h Mon Jun 13 22:00:44 2016 (r301874) +++ head/sys/netinet6/in6_var.h Mon Jun 13 22:31:16 2016 (r301875) @@ -453,7 +453,6 @@ struct in6_rrenumreq { #define SIOCSRTRFLUSH_IN6 _IOWR('i', 80, struct in6_ifreq) #define SIOCGIFALIFETIME_IN6 _IOWR('i', 81, struct in6_ifreq) -#define SIOCSIFALIFETIME_IN6 _IOWR('i', 82, struct in6_ifreq) #define SIOCGIFSTAT_IN6 _IOWR('i', 83, struct in6_ifreq) #define SIOCGIFSTAT_ICMP6 _IOWR('i', 84, struct in6_ifreq) From owner-svn-src-all@freebsd.org Mon Jun 13 23:36:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29559AF0EEE; Mon, 13 Jun 2016 23:36:17 +0000 (UTC) (envelope-from mahrens@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF58020D9; Mon, 13 Jun 2016 23:36:16 +0000 (UTC) (envelope-from mahrens@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5DNaGRo041947; Mon, 13 Jun 2016 23:36:16 GMT (envelope-from mahrens@FreeBSD.org) Received: (from mahrens@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5DNaGvY041946; Mon, 13 Jun 2016 23:36:16 GMT (envelope-from mahrens@FreeBSD.org) Message-Id: <201606132336.u5DNaGvY041946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mahrens set sender to mahrens@FreeBSD.org using -f From: Matthew Ahrens Date: Mon, 13 Jun 2016 23:36:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301876 - head/usr.bin/calendar/calendars X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 23:36:17 -0000 Author: mahrens Date: Mon Jun 13 23:36:15 2016 New Revision: 301876 URL: https://svnweb.freebsd.org/changeset/base/301876 Log: Add myself (mahrens) to calendar.freebsd Approved by: mckusick Approved by: re (gjb) Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Mon Jun 13 22:31:16 2016 (r301875) +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon Jun 13 23:36:15 2016 (r301876) @@ -338,6 +338,7 @@ 10/25 Eric Melville born in Los Gatos, California, United States, 1980 10/25 Julien Laffaye born in Toulouse, France, 1988 10/25 Ashish SHUKLA born in Kanpur, India, 1985 +10/26 Matthew Ahrens born in United States, 1979 10/26 Philip M. Gollucci born in Silver Spring, Maryland, United States, 1979 10/27 Takanori Watanabe born in Numazu, Shizuoka, Japan, 1972 11/05 M. Warner Losh born in Kansas City, Kansas, United States, 1966 From owner-svn-src-all@freebsd.org Tue Jun 14 00:24:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AB6EAF1DE6; Tue, 14 Jun 2016 00:24:17 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 3D87C2C19; Tue, 14 Jun 2016 00:24:17 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 31ABD1AE6; Tue, 14 Jun 2016 00:24:17 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id E014C21708; Tue, 14 Jun 2016 00:24:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id f309ueLNWsQI; Tue, 14 Jun 2016 00:24:13 +0000 (UTC) Subject: Re: svn commit: r301814 - in head/sys: conf modules DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 3F3D121702 To: "Jonathan T. Looney" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201606101906.u5AJ6BVE045417@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <3706c18e-cc5b-d20a-26eb-6914118f9071@FreeBSD.org> Date: Mon, 13 Jun 2016 17:24:12 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <201606101906.u5AJ6BVE045417@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="hEixmUwjJRfNU60a5SIIjMg9uUIEcCPL0" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 00:24:17 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --hEixmUwjJRfNU60a5SIIjMg9uUIEcCPL0 Content-Type: multipart/mixed; boundary="mOJPLKDo8gAaSgeACukMUNeV3clcvCJPI" From: Bryan Drewery To: "Jonathan T. Looney" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <3706c18e-cc5b-d20a-26eb-6914118f9071@FreeBSD.org> Subject: Re: svn commit: r301814 - in head/sys: conf modules References: <201606101906.u5AJ6BVE045417@repo.freebsd.org> In-Reply-To: <201606101906.u5AJ6BVE045417@repo.freebsd.org> --mOJPLKDo8gAaSgeACukMUNeV3clcvCJPI Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 6/10/2016 12:06 PM, Jonathan T. Looney wrote: > Author: jtl > Date: Fri Jun 10 19:06:11 2016 > New Revision: 301814 > URL: https://svnweb.freebsd.org/changeset/base/301814 >=20 > Log: > Change the default build behavior so we don't compile extra TCP modul= es by > default. At least initially, the feature to support multiple TCP stac= ks is > aimed at supporting advanced use cases and TCP development, but it is= not > necessarily aimed at a wide audience. Therefore, there is no need to = build > and install the extra TCP stacks by default. Instead, the people who = are > using or developing this functionality can add the extra option to bu= ild/ > install the extra TCP stacks. > =20 > However, we do want to build the extra TCP stacks as part of test bui= lds > (e.g. LINT or tinderbox) to ensure that developers who are testing th= eir > changes will know that their changes do not break the additional TCP > stack modules. > =20 > After this change, a user will need to add WITH_EXTRA_TCP_STACKS=3D1 = to > make.conf or the kernel config in order to build the extra TCP module= s. > =20 > Differential Revision: https://reviews.freebsd.org/D6795 > Reviewed by: sjg > Approved by: re (kib) >=20 > Modified: > head/sys/conf/kern.opts.mk > head/sys/conf/kern.post.mk > head/sys/modules/Makefile >=20 > Modified: head/sys/conf/kern.opts.mk > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/conf/kern.opts.mk Fri Jun 10 18:47:11 2016 (r301813) > +++ head/sys/conf/kern.opts.mk Fri Jun 10 19:06:11 2016 (r301814) > @@ -45,6 +45,7 @@ __DEFAULT_YES_OPTIONS =3D \ > =20 > __DEFAULT_NO_OPTIONS =3D \ > EISA \ > + EXTRA_TCP_STACKS \ > NAND \ > OFED no description found for WITH_EXTRA_TCP_STACKS, skipping A src.conf.5 handler is needed for this. Please add a WITH_EXTRA_TCP_STACKS file into tools/build/options, svn commit, svn up, and then run from that directory: =2E/makeman > ../../../share/man/man5/src.conf.5 Then commit ../../../share/man/man5/src.conf.5 (That's the process at least, both commits need re@ approval) --=20 Regards, Bryan Drewery --mOJPLKDo8gAaSgeACukMUNeV3clcvCJPI-- --hEixmUwjJRfNU60a5SIIjMg9uUIEcCPL0 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJXX06sAAoJEDXXcbtuRpfP2poH/3+2SCeoTQlWjd8xY1R+eSPU MZt53w3hwwro7zeBfBZdPPM2S5zMyfHKc8ogpKDbu2WNbn69eYPQ3D9XkxKoZyRN bzs4XO99f2BwPPDE6KK0rygWgPXKkaVoZa6sXvbMPinKKcp1ctC2cl423cGDZYD9 c2Wx3raGxj6Xi+Iz/2Y7aGN+ogmAdKW1r8VtAOs95/2v8x7eZPa0k15gdCqWVIj3 hLoFCvXOrsDITRekpdmH0kj9jBPX7VBOPM8EK87dglkbsI+hMkR69ycK25T7iS61 abof8JtK9Y53k7OkPqfl6Y58pjgbUiOfzXWYK/vj2YzrKNU2fn98wyl+wKtbap0= =ASSR -----END PGP SIGNATURE----- --hEixmUwjJRfNU60a5SIIjMg9uUIEcCPL0-- From owner-svn-src-all@freebsd.org Tue Jun 14 01:36:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 980D7AF0BED; Tue, 14 Jun 2016 01:36:42 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-qt0-x22c.google.com (mail-qt0-x22c.google.com [IPv6:2607:f8b0:400d:c0d::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 52C8B2070; Tue, 14 Jun 2016 01:36:42 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: by mail-qt0-x22c.google.com with SMTP id c34so39418028qte.0; Mon, 13 Jun 2016 18:36:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version; bh=qlB8YqasPFoTHMPPH8oVvK3RsHFQQt4nS5bdQKoVzqg=; b=PxJExDvBq2pVHHWhrLbkN7cTHC739jmhiPX5CFmQuE6mO9i46UoMx3ChpARzs1+KpF kfObFFa5WZIT/4ka87jWqmT6O+qPueMcQzDpw8/qbC7IJ0wEZh6iu4m29V31Uds1iIeq wxbQFQ8ytpzA+qihKjg/d3hs0Y0gxQ/UjX+IFxtDX9gUR0mJKN+e4AzSQhYfD4/hqBwX FmGdAVeH6J4o4OnBJBURV69rgWzkmxU154ckL3nqreUx9SA0TG52lKcPU0EezTemoNdD MxewIhu3WpAxVUOU1XuJQoowIz4gue7Y/lIPpbpMlkw9cLOXF8z+AYsUw4yUKce0PbBN aoFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version; bh=qlB8YqasPFoTHMPPH8oVvK3RsHFQQt4nS5bdQKoVzqg=; b=KkYaUUdOA5kFAEygGEAGEwyu8JsgrVUew1ei8up6TyMTSZeWvAfvp5ND597hrLi75i NiZxLIpCiGD6czd6Qp7zi9cqxzDmqcjTmcESiOkELXjL+dM1G5t9jp9BY5fcswQGCiUu 60Z7rCXe3KAkFWi0aOLgPX9y0V+hthNxhXznrKw+q6QbOpCVK6VrddJy19ceAcpxH/gv T9rRB85uRnWV92xZhy04ip4e35HxERyroIumn2/Po8+zxdh6jU6f/+7T9kP+AnmQlJh1 KpiNTVXQVkwr6dlPH98PZxQxQlGLxChsJLJJEjw3SoOtRs+x9yJtpKRfQnczNtkHe/60 HSSA== X-Gm-Message-State: ALyK8tJrNQEsmeKcnNAbblBEneonV5kMImBEUlOUPxKjojloyyxS9CaWfmmJkz9So7jrTg== X-Received: by 10.200.40.197 with SMTP id j5mr17581637qtj.14.1465868201397; Mon, 13 Jun 2016 18:36:41 -0700 (PDT) Received: from kan ([2601:18f:802:4680:226:18ff:fe00:232e]) by smtp.gmail.com with ESMTPSA id 8sm7583813qhm.1.2016.06.13.18.36.40 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 13 Jun 2016 18:36:40 -0700 (PDT) Date: Mon, 13 Jun 2016 21:36:33 -0400 From: Alexander Kabaev To: Adrian Chadd Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301849 - head/sys/mips/mips Message-ID: <20160613213633.7fd1631a@kan> In-Reply-To: <201606130317.u5D3H0Kw091894@repo.freebsd.org> References: <201606130317.u5D3H0Kw091894@repo.freebsd.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/QZ.DN=rCde3_UE2=GrGf4kg"; protocol="application/pgp-signature" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 01:36:42 -0000 --Sig_/QZ.DN=rCde3_UE2=GrGf4kg Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Mon, 13 Jun 2016 03:17:00 +0000 (UTC) Adrian Chadd wrote: > Author: adrian > Date: Mon Jun 13 03:17:00 2016 > New Revision: 301849 > URL: https://svnweb.freebsd.org/changeset/base/301849 >=20 > Log: > [mips] set hardfloat for fpu instruction generation for > gcc/binutils 5.x=20 > This allows -HEAD to be compiled again using the gcc-5 mips port > compiler.=20 > Reviewed by: imp > Approved by: re@ >=20 > Modified: > head/sys/mips/mips/swtch.S >=20 > Modified: head/sys/mips/mips/swtch.S > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/mips/mips/swtch.S Mon Jun 13 03:03:08 2016 > (r301848) +++ head/sys/mips/mips/swtch.S Mon Jun 13 03:17:00 > 2016 (r301849) @@ -400,6 +400,7 @@ END(cpu_switch) > * > *----------------------------------------------------------------------= ------ > */ > +.set hardfloat > LEAF(MipsSwitchFPState) > mfc0 t1, MIPS_COP_0_STATUS # Save old SR > li t0, MIPS_SR_COP_1_BIT # enable the > coprocessor Hi, https://github.com/akabaev/freebsd/commit/5735b8108c8831a5a649815318391789e= 977a198 is a bit more complete version that only enables hardfloat in routines that need it, not in random place of the file and for the rest of it. --=20 Alexander Kabaev --Sig_/QZ.DN=rCde3_UE2=GrGf4kg Content-Type: application/pgp-signature Content-Description: Цифровая подпись OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJXX1+iXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRDNUY3RDk5NTk5QjY0MUUxM0M1MTU2OTEw NzEzMjI5OTkyNzkyRTdFAAoJEAcTIpmSeS5+RGcP/RMpBZdnLA2fessGs5rkyfMW urAT60bL7mYexwAVa3Dtn1kkHwCdrn6lZrkVyfxiEa8xPwuRLb0W/oBUOz5fJgUB EbSrvbcDyaHqHVwgd39hcGZEfm4bxftgws4nEJPUwJQpyYtKKiRvIJ1U9OsQnks4 q1M3m4DV9VU8MLI0b4U0E8KtLhoeAMLjWSCnw4N2ZGSyqkFxhjv+SNCkQ149Guma n5SZ/TX9BAvCmJOgMac+Zjwbk9MkwkyJPh4wxrYkeViKSMQOcCzxI71PJfqyoFd8 e/jDlyB4QEH1lSk4xF8Bu95A4rpoToEo3i+Uv8xXhHLM4WtRKwMkeYRwX70Xrjo9 CYrIzN6/5vF4lUraBCgLsQ+ZlwFA/TOtBaZ9FGtQ97AuOITZ79cxkWferVYA5v6e bkTqlWFavE52Kc5TLgCWx0jC0EiGk5PrCQeGYdpozSYoq6+OdN5ZaTq0KtX/+dWh 0j+QaBa9bDYrHWW+EZ1UaBeIGYcLR1mmx61P19tJTX+YRNzASwYi385ZWvM6rTGK UngA1CmwRw1utHu07GUkNyzMQEiphEL3HO7lhiKHitvgTKdfOQR46T7+mqenjtKH iv7rud+Eo+tR5Ja2w2tWyAzZOy1uJRvDLV/CPp3lPI82/d4qecQppU4pIj3CyX1m EZ2ees+5Ggby4MLF/tWR =Xokx -----END PGP SIGNATURE----- --Sig_/QZ.DN=rCde3_UE2=GrGf4kg-- From owner-svn-src-all@freebsd.org Tue Jun 14 01:48:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0CA4AF0FDE; Tue, 14 Jun 2016 01:48:28 +0000 (UTC) (envelope-from jtl@freebsd.org) Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0112.outbound.protection.outlook.com [207.46.100.112]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 183B625D4; Tue, 14 Jun 2016 01:48:27 +0000 (UTC) (envelope-from jtl@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=junipernetworks.onmicrosoft.com; s=selector1-junipernetworks-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=KfGZ/F7zcNR+p+YKUQz4QnA3sW9SCafiGuxx4t5CloY=; b=f/ceZcTvb3uIkRnZ1qOrHTfVZmanmOfD6XrOH131Ef1ojksFKszv3iy3dNGP9GWsfZgmPfdYh2XGLWOSacDFJvpgeCNgFYlpSjY51Olzg4Kng6lf6vwx4Uw8Bo6bbHbAhmC7O5gFHxIEtsGNFFsOFaQVHtqHlAyxF+m8G7EBd5c= Received: from BY1PR0501CA0009.namprd05.prod.outlook.com (10.162.139.19) by DM2PR0501MB811.namprd05.prod.outlook.com (10.242.115.141) with Microsoft SMTP Server (TLS) id 15.1.517.8; Tue, 14 Jun 2016 01:18:05 +0000 Received: from BL2FFO11FD016.protection.gbl (2a01:111:f400:7c09::198) by BY1PR0501CA0009.outlook.office365.com (2a01:111:e400:4821::19) with Microsoft SMTP Server (TLS) id 15.1.517.8 via Frontend Transport; Tue, 14 Jun 2016 01:18:05 +0000 Authentication-Results: spf=softfail (sender IP is 66.129.239.19) smtp.mailfrom=freebsd.org; freebsd.org; dkim=none (message not signed) header.d=none;freebsd.org; dmarc=none action=none header.from=freebsd.org; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning freebsd.org discourages use of 66.129.239.19 as permitted sender) Received: from P-EMFE01C-SAC.jnpr.net (66.129.239.19) by BL2FFO11FD016.mail.protection.outlook.com (10.173.160.224) with Microsoft SMTP Server (TLS) id 15.1.511.7 via Frontend Transport; Tue, 14 Jun 2016 01:18:04 +0000 Received: from magenta.juniper.net (172.17.27.123) by P-EMFE01C-SAC.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Mon, 13 Jun 2016 18:18:03 -0700 Received: from [172.29.35.241] ([172.29.35.241]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id u5E1I2E93985; Mon, 13 Jun 2016 18:18:02 -0700 (PDT) (envelope-from jtl@freebsd.org) User-Agent: Microsoft-MacOutlook/f.16.0.160506 Date: Mon, 13 Jun 2016 21:18:01 -0400 Subject: Re: svn commit: r301814 - in head/sys: conf modules From: "Jonathan T. Looney" Sender: Jonathan Looney To: Bryan Drewery CC: , , Message-ID: Thread-Topic: svn commit: r301814 - in head/sys: conf modules References: <201606101906.u5AJ6BVE045417@repo.freebsd.org> <3706c18e-cc5b-d20a-26eb-6914118f9071@FreeBSD.org> In-Reply-To: <3706c18e-cc5b-d20a-26eb-6914118f9071@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:66.129.239.19; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(979002)(6009001)(7916002)(2980300002)(199003)(24454002)(51914003)(377454003)(189002)(82746002)(19580395003)(19580405001)(8936002)(106466001)(83506001)(2950100001)(4326007)(69596002)(16796002)(47776003)(105596002)(86362001)(68736007)(11100500001)(6806005)(54356999)(87936001)(76176999)(36756003)(586003)(9686002)(50986999)(50466002)(83716003)(77096005)(33656002)(92566002)(23676002)(189998001)(97736004)(356003)(4001350100001)(450100001)(110136002)(81156014)(2906002)(230700001)(81166006)(8676002)(5820100001)(42262002)(104396002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR0501MB811; H:P-EMFE01C-SAC.jnpr.net; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; A:1; MX:1; CAT:NONE; LANG:en; CAT:NONE; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD016; 1:9pru0jW7EaMFkwhOzXPra1uAE6AbCRZh2u+tu8I5eSkBoW1VNNRyavLuDXoc42rB1eoatSYwsBlBDxb1jV1dDsNrcA08DquXWzquboHGhjh04Tyar0ihCYDYw+2ci7gfCQxlt5ZqfbxRBKAXiRetz8rhrXNC088VVZmhHLFXqfKSpLX1NWC9c5U+SiA3SyrHKlhc3akklyN5yVHzKGCCVmn+olTa4FOoAJf0dZIw0wXBGg0s2oMMlcqxllbIot0fEdWSfyalGR7or3av0cf+75VsLEOfr/hQIVdFGg2XjsJfQ70MYZ/+VZmBnO7GN7Hoifxy7K+GSvd3i6qo7K5ocCEPMN7CfQShmkpf0a4Qr5bhPE/xFqmTxksBR1SaxbmQY3WO7hz7UWJh+WaX4ULncELkOS+LnZ4YopwfQ7j4C0ZA68Y2kqjOYcx1wlhO375XObihncdcOZJzZdu1L3UPcF1H/8vIu+YQTyzLTp0q46lErcZbBR3UGz1zcCPDzXQoZ5/KOAsoAgESNpZeg7juYry7ifm+cF+9vEg7Ctpobk8= X-MS-Office365-Filtering-Correlation-Id: bb475f5c-19fa-4d9c-8b51-08d393f1bc95 X-Microsoft-Exchange-Diagnostics: 1; DM2PR0501MB811; 2:UwVgRdZGt/L4YKaWHJU98Dm7ZN+5NhHLpbq5++hUeGnvNFDejD3vI0xOLJmsXDWVmMvVhiuIOR0DTbk96sWAw2qN9RaW6OKbo891txYiGUN40FvUvgANVlszEEjvFa9I4uA3KbEqiWq8V2QLuhm1DVdvObi/XUgFlYm9QocJO1xAtaEAqc7SyYAElVSqMK9S; 3:Hp9TdK6NMnxbyX+KqIlKp7ViMMo0fpN6I+6FukAzAgTe0p0LXY3ZAsadTSgG+LBdo3KAwzR2aWppH4s1wz+2KFGQYbqygLzG3pscNNWJ8jTT15x1HAAKKNe5w/14CddcStXAzeqlqdGdMmm7ZPSSA2j4PMQzgq3amoFgiUPATo9yYQXAIAH3LQvYoQIOA9+J7eX0SALcXLw5HGU/fGy85rlHAzCpqfvINcustMyeaeE=; 25:XoF7ckuqPRuIPr+tS6880X/3m605gSI8sU6vTwf1HCSVEBxnQ4NkmeM1MVnmBg3ij8UJyfYLoJiDLxM+Tj1G02OJ0dFjh33fyx/qBfCT3Hu8LnrolFxa2UEEn0F6wSCSQfdWs2bGRwo+Huqg6MDJ1Vfe7kFq2gwqbE+US4yIQ9rO4YaRrEMdbWDJAkPt1+r/Jxy6JboF8XQoHbRKfRp4T7CddLYFDm+MxFNdbOhNL4FqrpNQmPPi8RlQ0qBgan9WhKhzavxyfZR2N45rfwcESu5n/d/9l6jk6S7v0Juk06lefV79KNyDYa8R7N7VM0GHg2K0Uv6MiF/ZOay0i2cZZu9B+0fMEkoHAzeK4enE5+A/6PyxBoFRh/fGVTlvz6NKlnyBjA41hZc7IM1ga7Z1ap8rO2MvqFlNIRvrsvFLiPI= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0501MB811; X-JNPR-Received-From: outside X-Microsoft-Exchange-Diagnostics: 1; DM2PR0501MB811; 20:yWilHwLQHMykajL5Q+6DhC0HukFTzXFJGCflyMGQ5Cxmv5aR9uPSGgnvSqFbEe1KdKMvNi4/y2ZjbQj10YJ01kE21p5D3if65OoKqoMpkWEsmZhoehnCoVyRAg9hLhJeq0fxPJtzZNGU1ELpqlMcw7kxoOZXpklxE5aB/K9gxiLchA4Qa7IbYJi0EdaFYcRNXQvaCxY8QOFVG/0uclKDkOmxnzioAhHrtUp3paQUnlaXU9sDNe3YtzGgD/lVTZygAtsIdPgDJFW1prD0l7dRfQB2cpSm3GAftBkbZtPFI9QbUIosgVIsZJWYABebjH8NXvsx5l4Rj4EDOLhuKBSswkJhDBjgcRnjziSpA7yaUimN94fFR9WcdA0Zf8MhgaiNeRxNCylHI+urgbJb0JWi9MxiqwF4qAB9FPvIZrvx6c1N1Dt7soDSUxG4qISjHWd2kWLbAnM6qvlPt1ATzQUOQjAuAyYfy9Ow8m5U+tX/phASbhfFFxcK5bRUFRBwWTJt X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(13015025)(13017025)(13018025)(13024025)(13023025)(3002001)(10201501046)(6055026); SRVR:DM2PR0501MB811; BCL:0; PCL:0; RULEID:; SRVR:DM2PR0501MB811; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0501MB811; 4:2lhWd3hHDFQvdvdp/ME6MSKZodeHf0wQU+wDZSYlnhUyZO7YtLtZD3u64UtcHslwbP2ZJzo6Mslpg8CA67N5BFSkPILPwDO8oP2SYqn2SjZznFl/c89VT3AARyu69OxEqLIHOO1pBtKOes8YO2WTclo/FgZQj8riIxO4ft6beiaCZjukHs2ZDt9VqZH7NZqV9+rVIsm8vT7AoX6Di7EAlmpMr7Zaq4+5SkArnJ/JSKYHhoHqjYroRW95kCOW+yw2rz/iQv/K/9C2QVyhbooi57zHi77kVo7hTgVNvy9sazKpF7QJgc/RGxjBCzNStkLwJPYjavE27+O/BpjXwxNvsqyxFgtYFwppX2gh8y5NuxPt9HXd+gU/BRUSPT+9YdAnRD3S+NNvLCtDJwVwIaqHLthf2ZMVuRycphHKDAC8zPPcH+Gxh82/qwX4et42Bq7xKfJl2M8rEJjiLUJtPcCDkCh6PhcG0Y6JTLX5IaJ9qgk= X-Forefront-PRVS: 09730BD177 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTJQUjA1MDFNQjgxMTsyMzovTXBNSXRBZlM0NkQyTnN2NXp1dWFsY0F3?= =?utf-8?B?YnVVN2xXSlJjMndTbC8vbW1EYmxWVWJlb3B3aGNPWVBKVFBQYVViOVVzVjhu?= =?utf-8?B?eHFyQWs0NEJqd1lod3U5R1RGZjVlQkRQaER6RU12Zkw3SHBoNjEyNUh4OFdK?= =?utf-8?B?UHp6RE9lcVhoY0hwSEo5SHR4TXVEU2lsYzVyVHZtMEFZUUU3QXFVNmRCWHN5?= =?utf-8?B?U0J4bitUdWk2ZzVNc1M0VWhOeEtUNHcvM1RzYWptWmp3NFlnVm1Oai9KbWNx?= =?utf-8?B?cVliL2FTdjlmMWVYUEJkM0hwZ28vZE40VmZjNjQvVG41T3MzTFZCSk5iaE14?= =?utf-8?B?VXFtM09HSW1xNkJ1aXdqU0FOZnhndEh0ajZveHlNRmFNUWVKVkw4eVo4ZVZP?= =?utf-8?B?M2s5ODJ5OU1peXo5RGMra25qS1Zmb0lYdSs0bVk5U1VyM0N0RllCK2pwNmxy?= =?utf-8?B?bjFWWEhkN2tQVytNRHFKRFFPelQ5ZjhPdXYxZnVhTjJ3bWMvTDc3VUVnajRv?= =?utf-8?B?eERmVzBHTkJ6SWJIMjk0WTVzMTd5SWZSNDBTNlpFeTNGVktucnNnQ1N1a204?= =?utf-8?B?aHJWV1RHazI2SnJhMTFDOHk3R0UvdjFKNGxpZzhQRzU1WlRVUDV1bjZnNjNH?= =?utf-8?B?UE1YbW5zN3BabHJ4a0c2KytVaTcwTlRLYjBQRklnQkNWbUFuc1ExbWdXYmNp?= =?utf-8?B?WFBqV3ptTnMrRXV6Wlc3SUpYUE5qWGN6RCthVlhCczE4RktldkZYK01hWC9Y?= =?utf-8?B?cTlVd09mMUNJYUpJRnFzVUlrMmRFOW5tVDVyZFlzcE56dE55a2ZrT1MySzho?= =?utf-8?B?L2lTTmwvU3hOVy9aa1ZOYmt4YmtBNTVDSzlqOCtvc0h1UWNrekIrTk1hLzMv?= =?utf-8?B?bks5em4yMWJyZnRtVjlDTDRSek5kK1BaK21VbmdIS3Y0SzhiRnJqOXA3ZWdT?= =?utf-8?B?OGU1cGJzTmU5TEkyMUhzVzNsTlZjQlBhWUorQStmd1A4MUVZVWJ0d1AzdUhS?= =?utf-8?B?SDRRdnZQMXVEVlVRMVN2NVZwb2dMeXlnaHJHTjd6UzBFSko2NXZMUDA4dmVW?= =?utf-8?B?Y21FSkxhSWFQQzlLTnpETzFWZ0NnOVVhb2lKUGhhNk1BMUhhVUNvUTdXelNi?= =?utf-8?B?RHRNQm1WL1FhUDVNaXY4c1hzTzZRemgrVkFOYUVaUG8wbHE4ZlFqM3NGUUth?= =?utf-8?B?TVYrbndrUnVPaHlDbCttWU5oL0tiTG5KTUpzTkN5Qm1VUmxyVFhoOFNiT1R6?= =?utf-8?B?V1BZSFYrNjQ5U3o4a1A4czhGRlZLK2FkemlxTE5Ocm4yRjQyMDNaUFJUSGZo?= =?utf-8?B?OHVFeEcvb2FMNENTS3NQQzlVc2ZsT2hyTG5xdVZZRzZGZlJ4WDJJdUZ0S0NW?= =?utf-8?B?WHMxMGRZcVZMb25oaWgyWWlHRjZCc29oeGlQSHFzTWdGL2ZzSnBIbHkwN0kw?= =?utf-8?B?QlZJVEpObk1TUHJWcXpJTVRVeHptazV2WUg2SWE0ZFhPRG9zbDh4SkRQOGpU?= =?utf-8?B?aHZkb3F2WWNpby92K1NZc0xudS9KMGVKcDV5MEV1RzYvUlc1S0h1WVlwcUpz?= =?utf-8?B?d1haQ3paeFU4cUZzTG0rcEVOaGlMWTV2YUllOStwa3BObHdRa3VDNHRGakh3?= =?utf-8?B?WWpSbXo0TDhaTzBOVHFvcHEycjdnRzQ2RjFwMFpsWGhqb1dta1hNdU0wRytv?= =?utf-8?B?dndLL29DcXJobytVa050bVI3RGRsaFY0cWhCQVB2QVFmcXRWeVVlSENKam9K?= =?utf-8?B?ejlJdk5uZWl6ejZZc2V5WUo1NU5xQlpCUy9SMS9KT2ZBRTg5OXdHU00yckth?= =?utf-8?B?YlIrWU83aGYydEI0OEhEWmpKS1VLcXN5NTkybzFETWUzR3NHWmVZQzY0b05Z?= =?utf-8?Q?77nvtgrVk68o=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM2PR0501MB811; 6:Z88YTR7dsoAx4+eos51yMsBuO5yRz1rReTSNjRZMDQZ0DiYGt0vqpQc9Kkwor9d3TtQgWO1NNwYTbKPai+4dCudxcEqXoYiqnnqieGfigacZoih16TfPv8HUT/IW/ei4Zd8SYQsX6wpNXMnupaxX1eT5oShLYx8h0cgHr7nCewro2Nli3liNop11k+d6zj8C9QmyFRldRhFe1i9B4wpe2RRj7gHUwnQgVPYB+VnpHEggKH6iRJvgyzYKD5Sg1l8L/MnlorL2SoVDEVXrIf9yjszVlQwgJ46Q1bQTcKrV/cuqBDG7pTT/pkmXKSO5WdTt9MyYDRQ0NS2FsJzQGYnMOA==; 5:Rdoeovz0Y+dQOSRKbRlmDKK9QAAt7csPxhXARLE0kEuOg1/7iRXJ376058/ajQtWy5rppEg3+PDvwxROB+39eJTARmQOifSK0x9V4dbEP/M/sEgRmjmexlpInxnx9GKRVE2AWPGfDsV17T+4+khHxw==; 24:tpxlWkt782a84QkNiw7KB5mZEoxAlXygGIINRSr1+AII2/zDl6MG6YIhlKjlJwZTbLiY75JKZqocQ7LDIu1XT2DA0epM3267zpBPaNb+LTU=; 7:RtMXEac4gSI11VEcjjNongvBBp8rC4ONMyMpLNNAJy5PWy5oBz+m3bTxMvBVtZpXcqe2y/tSKx0TLZ9HyfkbrX23OuUgCZnEryov2E3eEg9NvywuShLJgIU9XqBnzbdlvys5vT76ezLozJa2n6ss3BokxxJ6xWCEvkj1azsnbFgm2dHsED01giokeksSRwe8lohyn8AXWjGqo73/k/8AqiJpmedDuSbWaCsCi+P3444= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2016 01:18:04.6102 (UTC) X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.19]; Helo=[P-EMFE01C-SAC.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0501MB811 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 01:48:29 -0000 On 6/13/16, 8:24 PM, "Bryan Drewery" wrote: >no description found for WITH_EXTRA_TCP_STACKS, skipping >A src.conf.5 handler is needed for this. > > >Please add a WITH_EXTRA_TCP_STACKS file into tools/build/options, svn >commit, svn up, and then >run from that directory: > >./makeman > ../../../share/man/man5/src.conf.5 > >Then commit ../../../share/man/man5/src.conf.5 > >(That's the process at least, both commits need re@ approval) Thanks for the info! I'll add it to our existing "to do" item to add documentation for this feature. (In theory, that will happen in the next week or so.) Jonathan From owner-svn-src-all@freebsd.org Tue Jun 14 03:57:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C994AF2D8D; Tue, 14 Jun 2016 03:57:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2DAFD268B; Tue, 14 Jun 2016 03:57:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5E3v0J6037098; Tue, 14 Jun 2016 03:57:00 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5E3v0G4037097; Tue, 14 Jun 2016 03:57:00 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201606140357.u5E3v0G4037097@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 14 Jun 2016 03:57:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301877 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 03:57:01 -0000 Author: markj Date: Tue Jun 14 03:57:00 2016 New Revision: 301877 URL: https://svnweb.freebsd.org/changeset/base/301877 Log: Add a missing error check for a malloc() call in idr_get(). Submitted by: Matt Joras Approved by: re (gjb) MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/sys/compat/linuxkpi/common/src/linux_idr.c Modified: head/sys/compat/linuxkpi/common/src/linux_idr.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_idr.c Mon Jun 13 23:36:15 2016 (r301876) +++ head/sys/compat/linuxkpi/common/src/linux_idr.c Tue Jun 14 03:57:00 2016 (r301877) @@ -292,7 +292,8 @@ idr_get(struct idr *idr) return (il); } il = malloc(sizeof(*il), M_IDR, M_ZERO | M_NOWAIT); - bitmap_fill(&il->bitmap, IDR_SIZE); + if (il != NULL) + bitmap_fill(&il->bitmap, IDR_SIZE); return (il); } From owner-svn-src-all@freebsd.org Tue Jun 14 04:51:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 592B7AF2B41; Tue, 14 Jun 2016 04:51:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 339462C0C; Tue, 14 Jun 2016 04:51:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 274011822; Tue, 14 Jun 2016 04:51:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 0305721E5A; Tue, 14 Jun 2016 04:51:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 5Vflzt4UxQ-I; Tue, 14 Jun 2016 04:51:35 +0000 (UTC) Subject: Re: svn commit: r300770 - in head: . contrib/libc++/include contrib/libc++/include/experimental contrib/libc++/include/ext contrib/libc++/src contrib/libc++/src/include contrib/libc++/src/support lib/l... DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com D9CF021E52 To: Dimitry Andric , Alan Somers References: <201605261852.u4QIqn5w073953@repo.freebsd.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Bryan Drewery Organization: FreeBSD Message-ID: <0602fe0c-8194-ed6f-fb1d-596b7acad6c0@FreeBSD.org> Date: Mon, 13 Jun 2016 21:51:33 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="UDDvSVvDP4uoce7XVIkEKEv4FXkkuOOHk" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 04:51:39 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --UDDvSVvDP4uoce7XVIkEKEv4FXkkuOOHk Content-Type: multipart/mixed; boundary="bOO6MvPeNk3qsxe8RirmL22clJqIpAOsL" From: Bryan Drewery To: Dimitry Andric , Alan Somers Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: <0602fe0c-8194-ed6f-fb1d-596b7acad6c0@FreeBSD.org> Subject: Re: svn commit: r300770 - in head: . contrib/libc++/include contrib/libc++/include/experimental contrib/libc++/include/ext contrib/libc++/src contrib/libc++/src/include contrib/libc++/src/support lib/l... References: <201605261852.u4QIqn5w073953@repo.freebsd.org> In-Reply-To: --bOO6MvPeNk3qsxe8RirmL22clJqIpAOsL Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 5/27/16 9:19 AM, Dimitry Andric wrote: > This is most likely caused by the option: >=20 > -isystem /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr= /include >=20 > because that forces this path to become before any auto-detected system= > include directory. Note that this option is not needed, since the othe= r > option: >=20 > --sysroot=3D/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32 >=20 > is already taking care of adding the right include directories. It eve= n > warns about the duplicate directory: >=20 > ignoring duplicate directory > "/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include= " Argh, I wish GCC cross-compiler wasn't so dumb. It does require -isystem despite --sysroot. It's working currently due to a mistake of having X_COMPILER_TYPE set even for native GCC builds. This is just a reminder that GCC --sysroot is not nearly as useful and obvious as clang's. I'm unwinding some bugs from this and other related X_COMPILER changes. --=20 Regards, Bryan Drewery --bOO6MvPeNk3qsxe8RirmL22clJqIpAOsL-- --UDDvSVvDP4uoce7XVIkEKEv4FXkkuOOHk Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJXX41WAAoJEDXXcbtuRpfP7RAIAJY74mB8FRvwWnOsrG+uUUTH CavT9z74AnwpQY0hnjD8IQN9ocl8NwzlaYgVk13cG7a1QjhpaMkSgc+uTbjMtVET TNS6qevJoGEJuCgtKN2sm5ot8Tz/BNVVi5fqdykHPlyvf1bMQLmjQdr3WP3dg801 qERY9E1xVmnk5BLtqDZipuqLDGFFKfNH6q4pkGW6ihM9PiaELkiSJVpzZqm4zVb4 0y8IgtA5zZ/+gTahyHokGkmjtwNgJJu0R0C3VrNNaBbAc2/5fmGem93+pGXouIn+ SB6All60NWvtukzNSZluxHmXzDRRJj3aSetwRcr0IfH0QtHuJU9talcDwiDv2NE= =onaI -----END PGP SIGNATURE----- --UDDvSVvDP4uoce7XVIkEKEv4FXkkuOOHk-- From owner-svn-src-all@freebsd.org Tue Jun 14 05:38:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A66FAF24CA; Tue, 14 Jun 2016 05:38:21 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x229.google.com (mail-it0-x229.google.com [IPv6:2607:f8b0:4001:c0b::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 392CA2E93; Tue, 14 Jun 2016 05:38:21 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x229.google.com with SMTP id e5so59193686ith.0; Mon, 13 Jun 2016 22:38:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ah2z3l08QjIA4IO/AEQ2z0TAvoO1GWAwU8UNGntj3rg=; b=mZTasoqq+VyVkzFJE5aozu4ZqJ4AwZnSnvFOyoF74JYPee8DYQSiB9PLMwxZ2M3OZ8 p3atETTC3HwNkro3HrlqM+1qt3KP27asiJdawMcOedZdf0UMQFh19wamTHk0oVD2tpH0 FfVwTMr5D2HEjxIDj9OmIW776Oh4Db8Xaxfd2tkVc287sZjWK4XGiWS/krTE+BbEK+k2 ih9oKQw9fWkT9DsuBDUKDS/phuPusKJMHQ/K8aJeERNKUcl8GyNR8fAdrNufpCqPsYHP bG+vjRizmq31zl0X300EgKVY6FcMkrjrCxB7dWJnSuxZFvbBlZXcYqeiHFV1+pE7lhLY x3HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=ah2z3l08QjIA4IO/AEQ2z0TAvoO1GWAwU8UNGntj3rg=; b=IYY0fPlqeHrbmrW28abnYxao5KC1F+B7g31ReLC/qUQZE6yuZ14csYGMWNLLHlLBnY rWhSNrt/D0c5DfEorfhaEO1eCJSuLkv5tZet8ogonmpADTcegVeWbEiL8jAwd8Q2q3Eq zYW69LULSkXBZZE7Hdmzw7j/y/cLRJvTVRiEXpXQVwQgdB0ZAmrLrBsN5lVqRR1emShl Wr411rXdUO3R6Z61V1Wa8buJNFAZvzLqPTkltDwjjmEsrp70XbAjozRwgjrIareiZMsR oKWTVeP2vIb3tsF3feV8vRYhx/58JTrBYGeDZXco1PFS578gzOGcCKeAzsak3Pm0yRko FymQ== X-Gm-Message-State: ALyK8tKAUhQ9u+PMPr4bjLuWIZ+evT5R5WuWSuGilUZknCzbyQRzVKJbEApmRM3GdIDq0drv+F4z1HWeLY7Seg== X-Received: by 10.36.51.15 with SMTP id k15mr5039536itk.80.1465882700619; Mon, 13 Jun 2016 22:38:20 -0700 (PDT) MIME-Version: 1.0 Sender: adrian.chadd@gmail.com Received: by 10.36.113.3 with HTTP; Mon, 13 Jun 2016 22:38:19 -0700 (PDT) In-Reply-To: <20160613213633.7fd1631a@kan> References: <201606130317.u5D3H0Kw091894@repo.freebsd.org> <20160613213633.7fd1631a@kan> From: Adrian Chadd Date: Mon, 13 Jun 2016 22:38:19 -0700 X-Google-Sender-Auth: 7N1OPYKcdG-9boisCA9c8A_2JXE Message-ID: Subject: Re: svn commit: r301849 - head/sys/mips/mips To: Alexander Kabaev Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 05:38:21 -0000 I'll test that now. Thanks! -a On 13 June 2016 at 18:36, Alexander Kabaev wrote: > On Mon, 13 Jun 2016 03:17:00 +0000 (UTC) > Adrian Chadd wrote: > >> Author: adrian >> Date: Mon Jun 13 03:17:00 2016 >> New Revision: 301849 >> URL: https://svnweb.freebsd.org/changeset/base/301849 >> >> Log: >> [mips] set hardfloat for fpu instruction generation for >> gcc/binutils 5.x >> This allows -HEAD to be compiled again using the gcc-5 mips port >> compiler. >> Reviewed by: imp >> Approved by: re@ >> >> Modified: >> head/sys/mips/mips/swtch.S >> >> Modified: head/sys/mips/mips/swtch.S >> ============================================================================== >> --- head/sys/mips/mips/swtch.S Mon Jun 13 03:03:08 2016 >> (r301848) +++ head/sys/mips/mips/swtch.S Mon Jun 13 03:17:00 >> 2016 (r301849) @@ -400,6 +400,7 @@ END(cpu_switch) >> * >> *---------------------------------------------------------------------------- >> */ >> +.set hardfloat >> LEAF(MipsSwitchFPState) >> mfc0 t1, MIPS_COP_0_STATUS # Save old SR >> li t0, MIPS_SR_COP_1_BIT # enable the >> coprocessor > > Hi, > > https://github.com/akabaev/freebsd/commit/5735b8108c8831a5a649815318391789e977a198 > > is a bit more complete version that only enables hardfloat in routines > that need it, not in random place of the file and for the rest of it. > > -- > Alexander Kabaev From owner-svn-src-all@freebsd.org Tue Jun 14 06:21:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDCDDAF2BF7; Tue, 14 Jun 2016 06:21:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE1EE2F8B; Tue, 14 Jun 2016 06:21:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5E6LpMS091268; Tue, 14 Jun 2016 06:21:51 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5E6Lptr091267; Tue, 14 Jun 2016 06:21:51 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606140621.u5E6Lptr091267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 14 Jun 2016 06:21:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301878 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 06:21:53 -0000 Author: adrian Date: Tue Jun 14 06:21:51 2016 New Revision: 301878 URL: https://svnweb.freebsd.org/changeset/base/301878 Log: [mips] Tidy up setting/clearing the hardfloat flag. Submitted by: kan Approved by: re (delphij) Modified: head/sys/mips/mips/swtch.S Modified: head/sys/mips/mips/swtch.S ============================================================================== --- head/sys/mips/mips/swtch.S Tue Jun 14 03:57:00 2016 (r301877) +++ head/sys/mips/mips/swtch.S Tue Jun 14 06:21:51 2016 (r301878) @@ -400,8 +400,9 @@ END(cpu_switch) * *---------------------------------------------------------------------------- */ -.set hardfloat LEAF(MipsSwitchFPState) + .set push + .set hardfloat mfc0 t1, MIPS_COP_0_STATUS # Save old SR li t0, MIPS_SR_COP_1_BIT # enable the coprocessor mtc0 t0, MIPS_COP_0_STATUS @@ -503,6 +504,7 @@ LEAF(MipsSwitchFPState) ITLBNOPFIX j ra nop + .set pop END(MipsSwitchFPState) /*---------------------------------------------------------------------------- @@ -523,6 +525,8 @@ END(MipsSwitchFPState) *---------------------------------------------------------------------------- */ LEAF(MipsSaveCurFPState) + .set push + .set hardfloat PTR_L a0, TD_PCB(a0) # get pointer to pcb for thread mfc0 t1, MIPS_COP_0_STATUS # Disable interrupts and li t0, MIPS_SR_COP_1_BIT # enable the coprocessor @@ -581,6 +585,7 @@ LEAF(MipsSaveCurFPState) ITLBNOPFIX j ra nop + .set pop END(MipsSaveCurFPState) /* From owner-svn-src-all@freebsd.org Tue Jun 14 12:56:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA547B68888 for ; Tue, 14 Jun 2016 12:56:36 +0000 (UTC) (envelope-from jbeich@vfemail.net) Received: from vfemail.net (onethreetwo.vfemail.net [199.16.11.132]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8DD442F65 for ; Tue, 14 Jun 2016 12:56:36 +0000 (UTC) (envelope-from jbeich@vfemail.net) Received: (qmail 9522 invoked by uid 89); 14 Jun 2016 12:56:27 -0000 Received: from localhost (HELO freequeue.vfemail.net) (127.0.0.1) by localhost with (DHE-RSA-AES256-SHA encrypted) SMTP; 14 Jun 2016 12:56:26 -0000 Received: (qmail 68073 invoked by uid 89); 14 Jun 2016 00:32:38 -0000 Received: by simscan 1.3.1 ppid: 68065, pid: 68069, t: 0.0040s scanners:none Received: from unknown (HELO smtp102-2.vfemail.net) (172.16.100.62) by FreeQueue with SMTP; 14 Jun 2016 00:32:38 -0000 Received: (qmail 3003 invoked by uid 89); 14 Jun 2016 00:32:38 -0000 Received: by simscan 1.4.0 ppid: 2983, pid: 2996, t: 0.7573s scanners:none Received: from unknown (HELO nil) (amJlaWNoQHZmZW1haWwubmV0@172.16.100.27) by mail.vfemail.net with ESMTPA; 14 Jun 2016 00:32:37 -0000 From: Jan Beich To: Alexander Motin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r299448 - in head/sys/cddl/contrib/opensolaris: common/acl uts/common/fs/zfs uts/common/sys References: <201605111343.u4BDhKhp076695@repo.freebsd.org> Date: Tue, 14 Jun 2016 02:32:26 +0200 In-Reply-To: <201605111343.u4BDhKhp076695@repo.freebsd.org> (Alexander Motin's message of "Wed, 11 May 2016 13:43:20 +0000 (UTC)") Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 12:56:36 -0000 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Alexander Motin writes: > Author: mav > Date: Wed May 11 13:43:20 2016 > New Revision: 299448 > URL: https://svnweb.freebsd.org/changeset/base/299448 > > Log: > MFV r299442: 6762 POSIX write should imply DELETE_CHILD on directories = - and > some additional considerations >=20=20=20 > Reviewed by: Gordon Ross > Reviewed by: Yuri Pankov > Author: Kevin Crowe >=20=20=20 > openzfs/openzfs@d316fffc9c361532a482208561bbb614dac7f916 This commit confuses acl_is_trivial_np(3). Notice '+' in ls(1) and 'D' in getfacl(1) outputs. $ ls -ld /etc drwxr-xr-x 28 root wheel 121 Jun 10 11:03 /etc $ getfacl -q /etc owner@:rwxp--aARWcCos:-------:allow group@:r-x---a-R-c--s:-------:allow everyone@:r-x---a-R-c--s:-------:allow $ mkdir /foo $ ls -ld /foo drwxr-xr-x+ 2 root wheel 2 Jun 14 08:17 /foo $ getfacl -q /foo owner@:rwxpD-aARWcCos:-------:allow group@:r-x---a-R-c--s:-------:allow everyone@:r-x---a-R-c--s:-------:allow=20=20 $ zfs get all rootfs | fgrep acl rootfs aclmode discard default rootfs aclinherit restricted default --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQF8BAEBCgBmBQJXX1CaXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXREQjQ0MzY3NEM3RDIzNTc4NkUxNDkyQ0VF NEM3Nzg4MzQ3OURCRERCAAoJEOTHeINHnb3b5tIIAIQKbFxcG50EZP/XOhq/MeSl 0sRwCumNeaZuyLL/b1XOkR06iLb9S/Kw/c/MYIjKNs+HsEYgHBcX8N/QEfwVTJq9 jh+palnDYlWcqwK6Xzwr+R2a2a5KAbhyzO76JYJ9Skgvoi53TsUcFHU4BVzQlvr8 6gnwT3QZizg02/g2TQs9xexUa7dr61SVcBDxZBuo8g/piwdS0LkSeDhvp1P+v4ts mCuCHfVhLyCB7KAlgyK+IZEyPxancqA/nihpcxII/A/M/6pTUQO1AafdeM880NaI edZQXQbO8oop5l+6z+MIlnAc4DBhTsEwYkdTg49y5l1aBSHH6tQ42ugL0YafkNc= =GP8q -----END PGP SIGNATURE----- --=-=-=-- From owner-svn-src-all@freebsd.org Tue Jun 14 14:03:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 281A4AF285C; Tue, 14 Jun 2016 14:03:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7C172F13; Tue, 14 Jun 2016 14:03:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5EE3T5s059808; Tue, 14 Jun 2016 14:03:29 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5EE3Smt059800; Tue, 14 Jun 2016 14:03:28 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201606141403.u5EE3Smt059800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 14 Jun 2016 14:03:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301879 - in head/usr.sbin/makefs: . ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 14:03:30 -0000 Author: emaste Date: Tue Jun 14 14:03:28 2016 New Revision: 301879 URL: https://svnweb.freebsd.org/changeset/base/301879 Log: makefs: Provide a -T option to set timestamps to a consistent value This is taken from the NetBSD versions listed below and adapted to the makefs version in FreeBSD, along with a bug fix from cem@ that will be sent to NetBSD. Reviewed by: pfg Approved by: re (gjb) Obtained from: NetBSD MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D6835 Modified: head/usr.sbin/makefs/cd9660.c head/usr.sbin/makefs/ffs.c head/usr.sbin/makefs/ffs/mkfs.c head/usr.sbin/makefs/ffs/newfs_extern.h head/usr.sbin/makefs/makefs.8 head/usr.sbin/makefs/makefs.c head/usr.sbin/makefs/makefs.h head/usr.sbin/makefs/walk.c Modified: head/usr.sbin/makefs/cd9660.c ============================================================================== --- head/usr.sbin/makefs/cd9660.c Tue Jun 14 06:21:51 2016 (r301878) +++ head/usr.sbin/makefs/cd9660.c Tue Jun 14 14:03:28 2016 (r301879) @@ -442,7 +442,7 @@ cd9660_parse_opts(const char *option, fs */ void cd9660_makefs(const char *image, const char *dir, fsnode *root, - fsinfo_t *fsopts) + fsinfo_t *fsopts) { int64_t startoffset; int numDirectories; @@ -619,7 +619,7 @@ typedef int (*cd9660node_func)(cd9660nod static void cd9660_finalize_PVD(void) { - time_t tim; + time_t tstamp = stampst.st_ino ? stampst.st_mtime : time(NULL); /* root should be a fixed size of 34 bytes since it has no name */ memcpy(diskStructure.primaryDescriptor.root_directory_record, @@ -668,26 +668,26 @@ cd9660_finalize_PVD(void) diskStructure.primaryDescriptor.bibliographic_file_id, 37); /* Setup dates */ - time(&tim); cd9660_time_8426( (unsigned char *)diskStructure.primaryDescriptor.creation_date, - tim); + tstamp); cd9660_time_8426( (unsigned char *)diskStructure.primaryDescriptor.modification_date, - tim); + tstamp); - /* - cd9660_set_date(diskStructure.primaryDescriptor.expiration_date, now); - */ +#if 0 + cd9660_set_date(diskStructure.primaryDescriptor.expiration_date, + tstamp); +#endif memset(diskStructure.primaryDescriptor.expiration_date, '0', 16); diskStructure.primaryDescriptor.expiration_date[16] = 0; cd9660_time_8426( (unsigned char *)diskStructure.primaryDescriptor.effective_date, - tim); + tstamp); /* make this sane */ cd9660_time_915(diskStructure.rootNode->dot_record->isoDirRecord->date, - tim); + tstamp); } static void @@ -808,7 +808,7 @@ cd9660_fill_extended_attribute_record(cd static int cd9660_translate_node_common(cd9660node *newnode) { - time_t tim; + time_t tstamp = stampst.st_ino ? stampst.st_mtime : time(NULL); int test; u_char flag; char temp[ISO_FILENAME_MAXLENGTH_WITH_PADDING]; @@ -829,9 +829,8 @@ cd9660_translate_node_common(cd9660node /* Set the various dates */ /* If we want to use the current date and time */ - time(&tim); - cd9660_time_915(newnode->isoDirRecord->date, tim); + cd9660_time_915(newnode->isoDirRecord->date, tstamp); cd9660_bothendian_dword(newnode->fileDataLength, newnode->isoDirRecord->size); @@ -876,7 +875,8 @@ cd9660_translate_node(fsnode *node, cd96 return 0; /* Finally, overwrite some of the values that are set by default */ - cd9660_time_915(newnode->isoDirRecord->date, node->inode->st.st_mtime); + cd9660_time_915(newnode->isoDirRecord->date, + stampst.st_ino ? stampst.st_mtime : node->inode->st.st_mtime); return 1; } @@ -1261,6 +1261,8 @@ cd9660_rrip_move_directory(cd9660node *d diskStructure.rootNode, dir); if (diskStructure.rr_moved_dir == NULL) return 0; + cd9660_time_915(diskStructure.rr_moved_dir->isoDirRecord->date, + stampst.st_ino ? stampst.st_mtime : start_time.tv_sec); } /* Create a file with the same ORIGINAL name */ Modified: head/usr.sbin/makefs/ffs.c ============================================================================== --- head/usr.sbin/makefs/ffs.c Tue Jun 14 06:21:51 2016 (r301878) +++ head/usr.sbin/makefs/ffs.c Tue Jun 14 14:03:28 2016 (r301879) @@ -482,6 +482,7 @@ ffs_create_image(const char *image, fsin char *buf; int i, bufsize; off_t bufrem; + time_t tstamp; assert (image != NULL); assert (fsopts != NULL); @@ -541,7 +542,15 @@ ffs_create_image(const char *image, fsin /* make the file system */ if (debug & DEBUG_FS_CREATE_IMAGE) printf("calling mkfs(\"%s\", ...)\n", image); - fs = ffs_mkfs(image, fsopts); + + if (stampst.st_ino != 0) + tstamp = stampst.st_ctime; + else + tstamp = start_time.tv_sec; + + srandom(tstamp); + + fs = ffs_mkfs(image, fsopts, tstamp); fsopts->superblock = (void *)fs; if (debug & DEBUG_FS_CREATE_IMAGE) { time_t t; @@ -648,19 +657,12 @@ ffs_build_dinode1(struct ufs1_dinode *di { int slen; void *membuf; + struct stat *st = stampst.st_ino != 0 ? &stampst : &cur->inode->st; memset(dinp, 0, sizeof(*dinp)); dinp->di_mode = cur->inode->st.st_mode; dinp->di_nlink = cur->inode->nlink; dinp->di_size = cur->inode->st.st_size; - dinp->di_atime = cur->inode->st.st_atime; - dinp->di_mtime = cur->inode->st.st_mtime; - dinp->di_ctime = cur->inode->st.st_ctime; -#if HAVE_STRUCT_STAT_ST_MTIMENSEC - dinp->di_atimensec = cur->inode->st.st_atimensec; - dinp->di_mtimensec = cur->inode->st.st_mtimensec; - dinp->di_ctimensec = cur->inode->st.st_ctimensec; -#endif #if HAVE_STRUCT_STAT_ST_FLAGS dinp->di_flags = cur->inode->st.st_flags; #endif @@ -669,6 +671,15 @@ ffs_build_dinode1(struct ufs1_dinode *di #endif dinp->di_uid = cur->inode->st.st_uid; dinp->di_gid = cur->inode->st.st_gid; + + dinp->di_atime = st->st_atime; + dinp->di_mtime = st->st_mtime; + dinp->di_ctime = st->st_ctime; +#if HAVE_STRUCT_STAT_ST_MTIMENSEC + dinp->di_atimensec = st->st_atimensec; + dinp->di_mtimensec = st->st_mtimensec; + dinp->di_ctimensec = st->st_ctimensec; +#endif /* not set: di_db, di_ib, di_blocks, di_spare */ membuf = NULL; @@ -696,31 +707,33 @@ ffs_build_dinode2(struct ufs2_dinode *di { int slen; void *membuf; + struct stat *st = stampst.st_ino != 0 ? &stampst : &cur->inode->st; memset(dinp, 0, sizeof(*dinp)); dinp->di_mode = cur->inode->st.st_mode; dinp->di_nlink = cur->inode->nlink; dinp->di_size = cur->inode->st.st_size; - dinp->di_atime = cur->inode->st.st_atime; - dinp->di_mtime = cur->inode->st.st_mtime; - dinp->di_ctime = cur->inode->st.st_ctime; -#if HAVE_STRUCT_STAT_ST_MTIMENSEC - dinp->di_atimensec = cur->inode->st.st_atimensec; - dinp->di_mtimensec = cur->inode->st.st_mtimensec; - dinp->di_ctimensec = cur->inode->st.st_ctimensec; -#endif #if HAVE_STRUCT_STAT_ST_FLAGS dinp->di_flags = cur->inode->st.st_flags; #endif #if HAVE_STRUCT_STAT_ST_GEN dinp->di_gen = cur->inode->st.st_gen; #endif -#if HAVE_STRUCT_STAT_BIRTHTIME - dinp->di_birthtime = cur->inode->st.st_birthtime; - dinp->di_birthnsec = cur->inode->st.st_birthtimensec; -#endif dinp->di_uid = cur->inode->st.st_uid; dinp->di_gid = cur->inode->st.st_gid; + + dinp->di_atime = st->st_atime; + dinp->di_mtime = st->st_mtime; + dinp->di_ctime = st->st_ctime; +#if HAVE_STRUCT_STAT_ST_MTIMENSEC + dinp->di_atimensec = st->st_atimensec; + dinp->di_mtimensec = st->st_mtimensec; + dinp->di_ctimensec = st->st_ctimensec; +#endif +#if HAVE_STRUCT_STAT_BIRTHTIME + dinp->di_birthtime = st->st_birthtime; + dinp->di_birthnsec = st->st_birthtimensec; +#endif /* not set: di_db, di_ib, di_blocks, di_spare */ membuf = NULL; @@ -1125,11 +1138,6 @@ ffs_write_inode(union dinode *dp, uint32 initediblk < ufs_rw32(cgp->cg_niblk, fsopts->needswap)) { memset(buf, 0, fs->fs_bsize); dip = (struct ufs2_dinode *)buf; - /* - * XXX: Time-based seeds should be avoided for - * reproduceable builds. - */ - srandom(time(NULL)); for (i = 0; i < INOPB(fs); i++) { dip->di_gen = random(); dip++; Modified: head/usr.sbin/makefs/ffs/mkfs.c ============================================================================== --- head/usr.sbin/makefs/ffs/mkfs.c Tue Jun 14 06:21:51 2016 (r301878) +++ head/usr.sbin/makefs/ffs/mkfs.c Tue Jun 14 14:03:28 2016 (r301879) @@ -113,7 +113,7 @@ static int avgfilesize; /* expect static int avgfpdir; /* expected number of files per directory */ struct fs * -ffs_mkfs(const char *fsys, const fsinfo_t *fsopts) +ffs_mkfs(const char *fsys, const fsinfo_t *fsopts, time_t tstamp) { int fragsperinode, optimalfpg, origdensity, minfpg, lastminfpg; int32_t cylno, i, csfrags; @@ -434,7 +434,7 @@ ffs_mkfs(const char *fsys, const fsinfo_ sblock.fs_state = 0; sblock.fs_clean = FS_ISCLEAN; sblock.fs_ronly = 0; - sblock.fs_id[0] = start_time.tv_sec; + sblock.fs_id[0] = tstamp; sblock.fs_id[1] = random(); sblock.fs_fsmnt[0] = '\0'; csfrags = howmany(sblock.fs_cssize, sblock.fs_fsize); @@ -450,9 +450,9 @@ ffs_mkfs(const char *fsys, const fsinfo_ sblock.fs_cstotal.cs_nifree = sblock.fs_ncg * sblock.fs_ipg - ROOTINO; sblock.fs_cstotal.cs_ndir = 0; sblock.fs_dsize -= csfrags; - sblock.fs_time = start_time.tv_sec; + sblock.fs_time = tstamp; if (Oflag <= 1) { - sblock.fs_old_time = start_time.tv_sec; + sblock.fs_old_time = tstamp; sblock.fs_old_dsize = sblock.fs_dsize; sblock.fs_old_csaddr = sblock.fs_csaddr; sblock.fs_old_cstotal.cs_ndir = sblock.fs_cstotal.cs_ndir; @@ -508,7 +508,7 @@ ffs_mkfs(const char *fsys, const fsinfo_ printf("super-block backups (for fsck -b #) at:"); for (cylno = 0; cylno < sblock.fs_ncg; cylno++) { - initcg(cylno, start_time.tv_sec, fsopts); + initcg(cylno, tstamp, fsopts); if (cylno % nprintcols == 0) printf("\n"); printf(" %*lld,", printcolwidth, @@ -521,7 +521,7 @@ ffs_mkfs(const char *fsys, const fsinfo_ * Now construct the initial file system, * then write out the super-block. */ - sblock.fs_time = start_time.tv_sec; + sblock.fs_time = tstamp; if (Oflag <= 1) { sblock.fs_old_cstotal.cs_ndir = sblock.fs_cstotal.cs_ndir; sblock.fs_old_cstotal.cs_nbfree = sblock.fs_cstotal.cs_nbfree; Modified: head/usr.sbin/makefs/ffs/newfs_extern.h ============================================================================== --- head/usr.sbin/makefs/ffs/newfs_extern.h Tue Jun 14 06:21:51 2016 (r301878) +++ head/usr.sbin/makefs/ffs/newfs_extern.h Tue Jun 14 14:03:28 2016 (r301879) @@ -1,4 +1,4 @@ -/* $NetBSD: newfs_extern.h,v 1.3 2009/10/21 01:07:47 snj Exp $ */ +/* $NetBSD: newfs_extern.h,v 1.4 2015/12/21 00:58:08 christos Exp $ */ /* From: NetBSD: extern.h,v 1.3 2000/12/01 12:03:27 simonb Exp $ */ /* @@ -28,7 +28,7 @@ */ /* prototypes */ -struct fs *ffs_mkfs(const char *, const fsinfo_t *); +struct fs *ffs_mkfs(const char *, const fsinfo_t *, time_t); void ffs_write_superblock(struct fs *, const fsinfo_t *); void ffs_rdfs(daddr_t, int, void *, const fsinfo_t *); void ffs_wtfs(daddr_t, int, void *, const fsinfo_t *); Modified: head/usr.sbin/makefs/makefs.8 ============================================================================== --- head/usr.sbin/makefs/makefs.8 Tue Jun 14 06:21:51 2016 (r301878) +++ head/usr.sbin/makefs/makefs.8 Tue Jun 14 14:03:28 2016 (r301879) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 9, 2015 +.Dd June 14, 2016 .Dt MAKEFS 8 .Os .Sh NAME @@ -56,6 +56,7 @@ .Op Fl R Ar roundup-size .Op Fl S Ar sector-size .Op Fl s Ar image-size +.Op Fl T Ar timestamp .Op Fl t Ar fs-type .Ar image-file .Ar directory | manifest @@ -212,6 +213,18 @@ Defaults to 512. .It Fl s Ar image-size Set the size of the file system image to .Ar image-size . +.It Fl T Ar timestamp +Specify a timestamp to be set for all filesystem files and directories +created so that repeatable builds are possible. +The +.Ar timestamp +can be a +.Pa pathname , +where the timestamps are derived from that file, or an integer +value interpreted as the number of seconds from the Epoch. +Note that timestamps specified in an +.Xr mtree 5 +spec file, override the default timestamp. .It Fl t Ar fs-type Create an .Ar fs-type Modified: head/usr.sbin/makefs/makefs.c ============================================================================== --- head/usr.sbin/makefs/makefs.c Tue Jun 14 06:21:51 2016 (r301878) +++ head/usr.sbin/makefs/makefs.c Tue Jun 14 14:03:28 2016 (r301879) @@ -78,8 +78,10 @@ static fstype_t fstypes[] = { u_int debug; int dupsok; struct timespec start_time; +struct stat stampst; static fstype_t *get_fstype(const char *); +static int get_tstamp(const char *, struct stat *); static void usage(void); int main(int, char *[]); @@ -110,13 +112,15 @@ main(int argc, char *argv[]) fstype->prepare_options(&fsoptions); specfile = NULL; - if (gettimeofday(&start, NULL) == -1) - err(1, "Unable to get system time"); - + ch = gettimeofday(&start, NULL); start_time.tv_sec = start.tv_sec; start_time.tv_nsec = start.tv_usec * 1000; - while ((ch = getopt(argc, argv, "B:b:Dd:f:F:M:m:N:o:pR:s:S:t:xZ")) != -1) { + if (ch == -1) + err(1, "Unable to get system time"); + + + while ((ch = getopt(argc, argv, "B:b:Dd:f:F:M:m:N:o:pR:s:S:t:T:xZ")) != -1) { switch (ch) { case 'B': @@ -239,6 +243,12 @@ main(int argc, char *argv[]) fstype->prepare_options(&fsoptions); break; + case 'T': + if (get_tstamp(optarg, &stampst) == -1) + errx(1, "Cannot get timestamp from `%s'", + optarg); + break; + case 'x': fsoptions.onlyspec = 1; break; @@ -360,6 +370,32 @@ get_fstype(const char *type) return (NULL); } +static int +get_tstamp(const char *b, struct stat *st) +{ + time_t when; + char *eb; + long long l; + + if (stat(b, st) != -1) + return 0; + + { + errno = 0; + l = strtoll(b, &eb, 0); + if (b == eb || *eb || errno) + return -1; + when = (time_t)l; + } + + st->st_ino = 1; +#ifdef HAVE_STRUCT_STAT_BIRTHTIME + st->st_birthtime = +#endif + st->st_mtime = st->st_ctime = st->st_atime = when; + return 0; +} + static void usage(void) { @@ -370,7 +406,8 @@ usage(void) "usage: %s [-t fs-type] [-o fs-options] [-d debug-mask] [-B endian]\n" "\t[-S sector-size] [-M minimum-size] [-m maximum-size] [-R roundup-size]\n" "\t[-s image-size] [-b free-blocks] [-f free-files] [-F mtree-specfile]\n" -"\t[-xZ] [-N userdb-dir] image-file directory | manifest [extra-directory ...]\n", +"\t[-xZ] [-N userdb-dir] [-T ]\n" +"\timage-file directory | manifest [extra-directory ...]\n", prog); exit(1); } Modified: head/usr.sbin/makefs/makefs.h ============================================================================== --- head/usr.sbin/makefs/makefs.h Tue Jun 14 06:21:51 2016 (r301878) +++ head/usr.sbin/makefs/makefs.h Tue Jun 14 14:03:28 2016 (r301879) @@ -172,6 +172,7 @@ void cd9660_makefs(const char *, const extern u_int debug; extern int dupsok; extern struct timespec start_time; +extern struct stat stampst; /* * If -x is specified, we want to exclude nodes which do not appear Modified: head/usr.sbin/makefs/walk.c ============================================================================== --- head/usr.sbin/makefs/walk.c Tue Jun 14 06:21:51 2016 (r301878) +++ head/usr.sbin/makefs/walk.c Tue Jun 14 14:03:28 2016 (r301879) @@ -229,6 +229,20 @@ create_fsnode(const char *root, const ch cur->type = stbuf->st_mode & S_IFMT; cur->inode->nlink = 1; cur->inode->st = *stbuf; + if (stampst.st_ino) { + cur->inode->st.st_atime = stampst.st_atime; + cur->inode->st.st_mtime = stampst.st_mtime; + cur->inode->st.st_ctime = stampst.st_ctime; +#if HAVE_STRUCT_STAT_ST_MTIMENSEC + cur->inode->st.st_atimensec = stampst.st_atimensec; + cur->inode->st.st_mtimensec = stampst.st_mtimensec; + cur->inode->st.st_ctimensec = stampst.st_ctimensec; +#endif +#if HAVE_STRUCT_STAT_BIRTHTIME + cur->inode->st.st_birthtime = stampst.st_birthtime; + cur->inode->st.st_birthtimensec = stampst.st_birthtimensec; +#endif + } return (cur); } From owner-svn-src-all@freebsd.org Tue Jun 14 14:46:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 373A6B69632; Tue, 14 Jun 2016 14:46:50 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0358E25A5; Tue, 14 Jun 2016 14:46:50 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x234.google.com with SMTP id z189so79226716itg.0; Tue, 14 Jun 2016 07:46:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=C/ErwcXYUSWwn59gi3EPahjYHpbzO/pA6gB5v0+bOCA=; b=IN8T97AngQQcF4X0Ls4hE/tIA/cEVPfsnpBjC6CHrg8gTRNDbtMAr4fwrTmF1fWp1N ZufkSwgVJwehaA/D3PrzvxPlrgF2/q0JOSrnfRR8m4Z6lUYz9fNDzCGrflgS0BBTSHtL f3AAPhdbAK79JF8bUcxjj8y3qUXr4WEGvL44Fzo/XNQIdLTNeVm8TDTeZ4FQ2WsxBJsz wwsc8YDk5getpkTQ9qEQV+GxAPwuxR/db4R0mBJg5K49+KhK0DANxR2LLtsEUe38eksY IsPA+6OEfrvW5RqNg6RWVkNo1bPYz9Dq6Ln3iqWO8dp1smp6pGugQQrFFJK8IKsqsh1X lfZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=C/ErwcXYUSWwn59gi3EPahjYHpbzO/pA6gB5v0+bOCA=; b=SDlOqaVmPmoveFrXgDV3GHng/nDx+/hySUIMuv1P1AUq4t6Eev9RG1a6qzh5cUeatt d8NQmn3Iy6Af181t14G4kJIpv+P5iyhPrEI1ljKQPcZeR2nJHT05oZhKLWpSNCTqtKHB PKfcI7FX+l+Ax9eD9Fsms0H4ZmTCVz/NO405UgCCB1YZHtJdgg/s6/Eb7pTrag6H9zi5 1ZhrroXwyzLv2lzJTqFoCQGmUzFb8+FMtHO4EgD6Ujq1iPZJQcRnKTEWh6Kj35MQzUUQ 9JlmBRgHWjKQ8M9WX8FunMq4uF1BcLvfJeLsiVN4TZ+xpP1B03apsmBfxZi4ZzbMmyy9 EAow== X-Gm-Message-State: ALyK8tKG8HY/lFFQvOhEcrsushQLRpNsly837DPnlHIi9M2JmcvFP47Zj394yI84xZFDwabYEGQ+Xx3yti8KOw== X-Received: by 10.36.9.14 with SMTP id 14mr8858569itm.68.1465915605362; Tue, 14 Jun 2016 07:46:45 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.27.197 with HTTP; Tue, 14 Jun 2016 07:46:25 -0700 (PDT) In-Reply-To: <201606141403.u5EE3Smt059800@repo.freebsd.org> References: <201606141403.u5EE3Smt059800@repo.freebsd.org> From: Ed Maste Date: Tue, 14 Jun 2016 10:46:25 -0400 X-Google-Sender-Auth: PtsbrdLp8ympQF2f_EDlpBukf5s Message-ID: Subject: Re: svn commit: r301879 - in head/usr.sbin/makefs: . ffs To: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 14:46:50 -0000 On 14 June 2016 at 10:03, Ed Maste wrote: > Author: emaste > Date: Tue Jun 14 14:03:28 2016 > New Revision: 301879 > URL: https://svnweb.freebsd.org/changeset/base/301879 > > Log: > makefs: Provide a -T option to set timestamps to a consistent value > > This is taken from the NetBSD versions listed below and adapted to the > makefs version in FreeBSD, along with a bug fix from cem@ that will be > sent to NetBSD. Oops, I left the NetBSD versions out of the commit message. They are: usr.sbin/makefs/ffs/mkfs.c 1.66 usr.sbin/makefs/ffs/newfs_extern.h 1.33 usr.sbin/makefs/cd9660.c 1.50 1.51 usr.sbin/makefs/ffs.c 1.65 1.68 usr.sbin/makefs/makefs.8 1.54 usr.sbin/makefs/makefs.c 1.51 usr.sbin/makefs/makefs.h 1.36 usr.sbin/makefs/walk.c 1.29 From owner-svn-src-all@freebsd.org Tue Jun 14 16:19:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 783B6B6A6EA; Tue, 14 Jun 2016 16:19:45 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D15F2F5B; Tue, 14 Jun 2016 16:19:45 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5EGJirS007972; Tue, 14 Jun 2016 16:19:44 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5EGJiKd007971; Tue, 14 Jun 2016 16:19:44 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606141619.u5EGJiKd007971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 14 Jun 2016 16:19:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301880 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 16:19:45 -0000 Author: bdrewery Date: Tue Jun 14 16:19:44 2016 New Revision: 301880 URL: https://svnweb.freebsd.org/changeset/base/301880 Log: WITH_META_MODE+WITH_DEBUG_FILES: Fix library symlinks causing bogus rebuilds. A simplified example of the library targets with WITH_DEBUG_FILES is: libgeom.so.5: libgeom.so.5.full cp libgeom.so.5.full libgeom.so.5 libgeom.so.5.full: ln -s libgeom.so.5 libgeom.so cc -o libgeom.so.5.full *.o Before, or without, WITH_DEBUG_FILES it is: libgeom.so.5: ln -s libgeom.so.5 libgeom.so cc -o libgeom.so.5 *.o The problem is that bmake considers the link source for the libgeom.so link in the libgeom.so.5.full target as being a dependency for libgeom.so.5.full. That resolves to libgeom.so.5. Thus a cyclic dependency is created. The result of this is that if libgeom.so.5 is created with a newer timestamp than libgeom.so.5.full, then libgeom.so.5.full will be rebuilt on the next build. This causes a chain reaction of everything in the build relinking, or hitting the problem itself. Moving the link creation to the target that actually creates libgeom.so.5 fixes the problem. The simplest fix here is to just duplicate the logic. Submitted by: sjg Approved by: re (implicit) Modified: head/share/mk/bsd.lib.mk Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Tue Jun 14 14:03:28 2016 (r301879) +++ head/share/mk/bsd.lib.mk Tue Jun 14 16:19:44 2016 (r301880) @@ -244,7 +244,7 @@ CLEANFILES+= ${SHLIB_LINK} ${SHLIB_NAME_FULL}: ${SOBJS} @${ECHO} building shared library ${SHLIB_NAME} @rm -f ${SHLIB_NAME} ${SHLIB_LINK} -.if defined(SHLIB_LINK) && !commands(${SHLIB_LINK:R}.ld) +.if defined(SHLIB_LINK) && !commands(${SHLIB_LINK:R}.ld) && ${MK_DEBUG_FILES} == "no" @${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},development} ${SHLIB_NAME} ${SHLIB_LINK} .endif ${_LD:N${CCACHE_BIN}} ${LDFLAGS} ${SSP_CFLAGS} ${SOLINKOPTS} \ @@ -259,6 +259,9 @@ CLEANFILES+= ${SHLIB_NAME_FULL} ${SHLIB_ ${SHLIB_NAME}: ${SHLIB_NAME_FULL} ${SHLIB_NAME}.debug ${OBJCOPY} --strip-debug --add-gnu-debuglink=${SHLIB_NAME}.debug \ ${SHLIB_NAME_FULL} ${.TARGET} +.if defined(SHLIB_LINK) && !commands(${SHLIB_LINK:R}.ld) + @${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},development} ${SHLIB_NAME} ${SHLIB_LINK} +.endif ${SHLIB_NAME}.debug: ${SHLIB_NAME_FULL} ${OBJCOPY} --only-keep-debug ${SHLIB_NAME_FULL} ${.TARGET} From owner-svn-src-all@freebsd.org Tue Jun 14 16:19:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E2B2B6A723; Tue, 14 Jun 2016 16:19:50 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 125002F89; Tue, 14 Jun 2016 16:19:50 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5EGJn4V008017; Tue, 14 Jun 2016 16:19:49 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5EGJniM008016; Tue, 14 Jun 2016 16:19:49 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606141619.u5EGJniM008016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 14 Jun 2016 16:19:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301881 - head/bin/csh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 16:19:50 -0000 Author: bdrewery Date: Tue Jun 14 16:19:49 2016 New Revision: 301881 URL: https://svnweb.freebsd.org/changeset/base/301881 Log: WITH_META_MODE: Fix bin/csh rebuilding tc.const.h This is the same issue as r297997, but was missed in it. The WARNS value changes between 'build-tools' (MK_WARNS=no) and 'everything' resulting in a rebuild of this file. Approved by: re (implicit) Sponsored by: EMC / Isilon Storage Division Modified: head/bin/csh/Makefile Modified: head/bin/csh/Makefile ============================================================================== --- head/bin/csh/Makefile Tue Jun 14 16:19:44 2016 (r301880) +++ head/bin/csh/Makefile Tue Jun 14 16:19:49 2016 (r301881) @@ -136,7 +136,7 @@ sh.err.h: sh.err.c grep 'ERR_' ${.ALLSRC} | grep '^#define' >> ${.TARGET} @echo '#endif /* _h_sh_err */' >> ${.TARGET} -tc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h +tc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h ${BUILD_TOOLS_META} @rm -f ${.TARGET} @echo '/* Do not edit this file, make creates it. */' > ${.TARGET} @echo '#ifndef _h_tc_const' >> ${.TARGET} From owner-svn-src-all@freebsd.org Tue Jun 14 16:19:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CACB0B6A759; Tue, 14 Jun 2016 16:19:55 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9539920E8; Tue, 14 Jun 2016 16:19:55 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5EGJseD008065; Tue, 14 Jun 2016 16:19:54 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5EGJsqf008064; Tue, 14 Jun 2016 16:19:54 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606141619.u5EGJsqf008064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 14 Jun 2016 16:19:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301882 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 16:19:55 -0000 Author: bdrewery Date: Tue Jun 14 16:19:54 2016 New Revision: 301882 URL: https://svnweb.freebsd.org/changeset/base/301882 Log: WITH_META_MODE: Fix rescue rebuilding build-tools. This is the same issue as r297997. Approved by: re (implicit) Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.crunchgen.mk Modified: head/share/mk/bsd.crunchgen.mk ============================================================================== --- head/share/mk/bsd.crunchgen.mk Tue Jun 14 16:19:49 2016 (r301881) +++ head/share/mk/bsd.crunchgen.mk Tue Jun 14 16:19:54 2016 (r301882) @@ -130,7 +130,7 @@ ${PROG}: ${OUTPUTS} objs .META objs: ${OUTMK} .META ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} \ - ${MAKE} -f ${OUTMK} objs + ${MAKE} -f ${OUTMK} BUILD_TOOLS_META=.NOMETA_CMP objs # Someone should replace the bin/csh and bin/sh build-tools with # shell scripts so we can remove this nonsense. From owner-svn-src-all@freebsd.org Tue Jun 14 16:20:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21528B6A7AD; Tue, 14 Jun 2016 16:20:01 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE068220C; Tue, 14 Jun 2016 16:20:00 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5EGK0En008131; Tue, 14 Jun 2016 16:20:00 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5EGK037008121; Tue, 14 Jun 2016 16:20:00 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606141620.u5EGK037008121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 14 Jun 2016 16:20:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301883 - head/kerberos5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 16:20:01 -0000 Author: bdrewery Date: Tue Jun 14 16:19:59 2016 New Revision: 301883 URL: https://svnweb.freebsd.org/changeset/base/301883 Log: Define targets in same order as .ORDER This is a NOP but is done for style and to reduce confusion. Approved by: re (implicit) Sponsored by: EMC / Isilon Storage Division Modified: head/kerberos5/Makefile.inc Modified: head/kerberos5/Makefile.inc ============================================================================== --- head/kerberos5/Makefile.inc Tue Jun 14 16:19:54 2016 (r301882) +++ head/kerberos5/Makefile.inc Tue Jun 14 16:19:59 2016 (r301883) @@ -36,7 +36,7 @@ ETSRCS= \ .if ${SRCS:M${_ET}.[ch]} != "" .ORDER: ${_ET}.h ${_ET}.c ${_ET}.c: .NOMETA -${_ET}.c ${_ET}.h: ${ET} +${_ET}.h ${_ET}.c: ${ET} compile_et ${.ALLSRC} CLEANFILES+= ${_ET}.h ${_ET}.c .endif From owner-svn-src-all@freebsd.org Tue Jun 14 16:20:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC340B6A7E4; Tue, 14 Jun 2016 16:20:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8EB55243C; Tue, 14 Jun 2016 16:20:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5EGK5uH008184; Tue, 14 Jun 2016 16:20:05 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5EGK5Zs008183; Tue, 14 Jun 2016 16:20:05 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606141620.u5EGK5Zs008183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 14 Jun 2016 16:20:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301884 - head/usr.bin/awk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 16:20:07 -0000 Author: bdrewery Date: Tue Jun 14 16:20:05 2016 New Revision: 301884 URL: https://svnweb.freebsd.org/changeset/base/301884 Log: WITH_META_MODE: Fix rebuilding maketab outside of build-tools. The bsd.dep.mk yacc targets rely on only the .c file getting a .meta file. However the previous code here relying on only the .h file meant that it would be generated with a .meta file. r301285 made it so that the .h file is never expected to get a .meta file. To keep this restriction in place add in an extra dependency on the .c file so that it is generated at this time. It's a hack but the best for the patterns we have at the moment for handling build-tools and side-effect-generated files. Reported by: Mark Millard Approved by: re (implicit) Sponsored by: EMC / Isilon Storage Division Modified: head/usr.bin/awk/Makefile Modified: head/usr.bin/awk/Makefile ============================================================================== --- head/usr.bin/awk/Makefile Tue Jun 14 16:19:59 2016 (r301883) +++ head/usr.bin/awk/Makefile Tue Jun 14 16:20:05 2016 (r301884) @@ -17,8 +17,10 @@ MLINKS= awk.1 nawk.1 CLEANFILES= maketab proctab.c ytab.h -ytab.h: awkgram.h .NOMETA - ln -sf ${.ALLSRC} ${.TARGET} +# XXX: awkgram.c isn't really needed here but it is added to keep +# awkgram.h: .NOMETA respected. +ytab.h: awkgram.c awkgram.h .NOMETA + ln -sf ${.ALLSRC:M*.h} ${.TARGET} proctab.c: maketab ${BTOOLSPATH:U.}/maketab > proctab.c From owner-svn-src-all@freebsd.org Tue Jun 14 16:20:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7C7BB6A807; Tue, 14 Jun 2016 16:20:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 793712520; Tue, 14 Jun 2016 16:20:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5EGK8MM008231; Tue, 14 Jun 2016 16:20:08 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5EGK8jd008230; Tue, 14 Jun 2016 16:20:08 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606141620.u5EGK8jd008230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 14 Jun 2016 16:20:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301885 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 16:20:10 -0000 Author: bdrewery Date: Tue Jun 14 16:20:08 2016 New Revision: 301885 URL: https://svnweb.freebsd.org/changeset/base/301885 Log: Add more missing .PHONY Approved by: re (implicit) Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Tue Jun 14 16:20:05 2016 (r301884) +++ head/Makefile Tue Jun 14 16:20:08 2016 (r301885) @@ -274,7 +274,7 @@ CHECK_TIME!= find ${.CURDIR}/sys/sys/par # not included. One can argue that this target doesn't build everything # then. # -world: upgrade_checks +world: upgrade_checks .PHONY @echo "--------------------------------------------------------------" @echo ">>> make world started on ${STARTTIME}" @echo "--------------------------------------------------------------" @@ -300,7 +300,7 @@ world: upgrade_checks @echo " (started ${STARTTIME})" @echo "--------------------------------------------------------------" .else -world: +world: .PHONY @echo "WARNING: make world will overwrite your existing FreeBSD" @echo "installation without also building and installing a new" @echo "kernel. This can be dangerous. Please read the handbook," @@ -317,13 +317,13 @@ world: # # Short hand for `make buildkernel installkernel' # -kernel: buildkernel installkernel +kernel: buildkernel installkernel .PHONY # # Perform a few tests to determine if the installed tools are adequate # for building the world. # -upgrade_checks: +upgrade_checks: .PHONY .if defined(NEED_MAKE_UPGRADE) @${_+_}(cd ${.CURDIR} && ${MAKE} ${WANT_MAKE:S,^f,,}) .endif @@ -359,19 +359,19 @@ regress: .PHONY tinderbox toolchains kernel-toolchains kernels worlds: upgrade_checks -tinderbox: +tinderbox: .PHONY @cd ${.CURDIR}; ${SUB_MAKE} DOING_TINDERBOX=YES universe -toolchains: +toolchains: .PHONY @cd ${.CURDIR}; ${SUB_MAKE} UNIVERSE_TARGET=toolchain universe -kernel-toolchains: +kernel-toolchains: .PHONY @cd ${.CURDIR}; ${SUB_MAKE} UNIVERSE_TARGET=kernel-toolchain universe -kernels: +kernels: .PHONY @cd ${.CURDIR}; ${SUB_MAKE} UNIVERSE_TARGET=buildkernel universe -worlds: +worlds: .PHONY @cd ${.CURDIR}; ${SUB_MAKE} UNIVERSE_TARGET=buildworld universe # @@ -397,9 +397,9 @@ TARGET_ARCHES_${target}?= ${target} # It does not build with the in-tree linker. .if !exists(/usr/local/aarch64-freebsd/bin/ld) && empty(${TARGETS}) _UNIVERSE_TARGETS:= ${_UNIVERSE_TARGETS:Narm64} -universe: universe_arm64_skip -universe_epilogue: universe_arm64_skip -universe_arm64_skip: universe_prologue +universe: universe_arm64_skip .PHONY +universe_epilogue: universe_arm64_skip .PHONY +universe_arm64_skip: universe_prologue .PHONY @echo ">> arm64 skipped - install aarch64-binutils port or package to build" .endif @@ -437,16 +437,16 @@ universe_prologue: .PHONY .for target in ${_UNIVERSE_TARGETS} universe: universe_${target} universe_epilogue: universe_${target} -universe_${target}: universe_${target}_prologue -universe_${target}_prologue: universe_prologue +universe_${target}: universe_${target}_prologue .PHONY +universe_${target}_prologue: universe_prologue .PHONY @echo ">> ${target} started on `LC_ALL=C date`" -universe_${target}_worlds: +universe_${target}_worlds: .PHONY .if !defined(MAKE_JUST_KERNELS) -universe_${target}_done: universe_${target}_worlds +universe_${target}_done: universe_${target}_worlds .PHONY .for target_arch in ${TARGET_ARCHES_${target}} -universe_${target}_worlds: universe_${target}_${target_arch} -universe_${target}_${target_arch}: universe_${target}_prologue .MAKE +universe_${target}_worlds: universe_${target}_${target_arch} .PHONY +universe_${target}_${target_arch}: universe_${target}_prologue .MAKE .PHONY @echo ">> ${target}.${target_arch} ${UNIVERSE_TARGET} started on `LC_ALL=C date`" @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ ${SUB_MAKE} ${JFLAG} ${UNIVERSE_TARGET} \ @@ -461,9 +461,9 @@ universe_${target}_${target_arch}: unive .endif # !MAKE_JUST_KERNELS .if !defined(MAKE_JUST_WORLDS) -universe_${target}_done: universe_${target}_kernels -universe_${target}_kernels: universe_${target}_worlds -universe_${target}_kernels: universe_${target}_prologue .MAKE +universe_${target}_done: universe_${target}_kernels .PHONY +universe_${target}_kernels: universe_${target}_worlds .PHONY +universe_${target}_kernels: universe_${target}_prologue .MAKE .PHONY .if exists(${KERNSRCDIR}/${target}/conf/NOTES) @(cd ${KERNSRCDIR}/${target}/conf && env __MAKE_CONF=/dev/null \ ${SUB_MAKE} LINT > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \ @@ -479,7 +479,7 @@ universe_${target}: universe_${target}_d universe_${target}_done: @echo ">> ${target} completed on `LC_ALL=C date`" .endfor -universe_kernels: universe_kernconfs +universe_kernels: universe_kernconfs .PHONY .if !defined(TARGET) TARGET!= uname -m .endif @@ -493,7 +493,7 @@ KERNCONFS!= cd ${KERNSRCDIR}/${TARGET}/c -type f -maxdepth 0 \ ! -name DEFAULTS ! -name NOTES | \ ${_THINNER} -universe_kernconfs: +universe_kernconfs: .PHONY .for kernel in ${KERNCONFS} TARGET_ARCH_${kernel}!= cd ${KERNSRCDIR}/${TARGET}/conf && \ config -m ${KERNSRCDIR}/${TARGET}/conf/${kernel} 2> /dev/null | \ @@ -527,7 +527,7 @@ universe_epilogue: .PHONY .endif .endif -buildLINT: +buildLINT: .PHONY ${MAKE} -C ${.CURDIR}/sys/${_TARGET}/conf LINT .if defined(.PARSEDIR) From owner-svn-src-all@freebsd.org Tue Jun 14 16:20:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2CA3B6A837; Tue, 14 Jun 2016 16:20:12 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B658525CE; Tue, 14 Jun 2016 16:20:12 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5EGKBJA008276; Tue, 14 Jun 2016 16:20:11 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5EGKB8h008275; Tue, 14 Jun 2016 16:20:11 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606141620.u5EGKB8h008275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 14 Jun 2016 16:20:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301886 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 16:20:13 -0000 Author: bdrewery Date: Tue Jun 14 16:20:11 2016 New Revision: 301886 URL: https://svnweb.freebsd.org/changeset/base/301886 Log: WITH_META_MODE: Set MK_META_MODE=no with -B. Using -B already sets .MAKE.MODE=compat but it was leaving MK_META_MODE set which could still cause other MK_META_MODE==yes checks to trigger. Approved by: re (implicit) Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/sys.mk Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Tue Jun 14 16:20:08 2016 (r301885) +++ head/share/mk/sys.mk Tue Jun 14 16:20:11 2016 (r301886) @@ -42,9 +42,14 @@ __ENV_ONLY_OPTIONS:= \ .include +# Disable MK_META_MODE with make -B +.if ${MK_META_MODE} == "yes" && defined(.MAKEFLAGS) && ${.MAKEFLAGS:M-B} +MK_META_MODE= no +.endif + .if ${MK_DIRDEPS_BUILD} == "yes" .sinclude -.elif ${MK_META_MODE} == "yes" && defined(.MAKEFLAGS) && ${.MAKEFLAGS:M-B} == "" +.elif ${MK_META_MODE} == "yes" # verbose will show .MAKE.META.PREFIX for each target. META_MODE+= meta verbose .if !defined(NO_META_MISSING) From owner-svn-src-all@freebsd.org Tue Jun 14 16:20:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2891FB6A87C; Tue, 14 Jun 2016 16:20:16 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8129269E; Tue, 14 Jun 2016 16:20:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5EGKFGf008323; Tue, 14 Jun 2016 16:20:15 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5EGKFa1008322; Tue, 14 Jun 2016 16:20:15 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606141620.u5EGKFa1008322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 14 Jun 2016 16:20:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301887 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 16:20:16 -0000 Author: bdrewery Date: Tue Jun 14 16:20:14 2016 New Revision: 301887 URL: https://svnweb.freebsd.org/changeset/base/301887 Log: WITH_META_MODE: Whitelist targets that are meta-mode-safe. META_TGT_WHITELIST is added to define which build targets are safe for meta mode. See comments for more details. This fixes 'make delete-old-libs' to properly show the interactive prompt. Approved by: re (implicit) Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Tue Jun 14 16:20:11 2016 (r301886) +++ head/Makefile Tue Jun 14 16:20:14 2016 (r301887) @@ -133,12 +133,27 @@ TGTS= all all-man buildenv buildenvvars create-world-packages create-kernel-packages create-packages \ packages installconfig real-packages sign-packages package-pkg +# XXX: r156740: This can't work since bsd.subdir.mk is not included ever. +# It will only work for SUBDIR_TARGETS in make.conf. TGTS+= ${SUBDIR_TARGETS} BITGTS= files includes BITGTS:=${BITGTS} ${BITGTS:S/^/build/} ${BITGTS:S/^/install/} TGTS+= ${BITGTS} +# Only some targets are allowed to use meta mode. Others get it +# disabled. In some cases, such as 'install', meta mode can be dangerous +# as a cookie may be used to prevent redundant installations (such as +# for WORLDTMP staging). For DESTDIR=/ we always want to install though. +# For other cases, such as delete-old-libs, meta mode may break +# the interactive tty prompt. The safest route is to just whitelist +# the ones that benefit from it. +META_TGT_WHITELIST+= \ + _* build32 buildfiles buildincludes buildkernel buildsoft \ + buildworld everything kernel-toolchains kernels libraries \ + native-xtools tinderbox toolchain toolchains universe worlds \ + xdev xdev-build + .ORDER: buildworld installworld .ORDER: buildworld distributeworld .ORDER: buildworld buildkernel @@ -194,14 +209,17 @@ SUB_MAKE= ${MAKE} -m ${.CURDIR}/share/mk _MAKE= PATH=${PATH} ${SUB_MAKE} -f Makefile.inc1 TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH} -# Must disable META_MODE when installing to avoid missing anything. The -# main problem is that buildworld will create cookies for install targets -# since they are being installed into WORLDTMP. This avoids unneeded and -# redundant restaging but is dangerous for user install targets. -.if make(distrib*) || make(*install*) +# Only allow meta mode for the whitelisted targets. See META_TGT_WHITELIST +# above. +.for _tgt in ${META_TGT_WHITELIST} +.if make(${_tgt}) +_CAN_USE_META_MODE?= yes +.endif +.endfor +.if !defined(_CAN_USE_META_MODE) _MAKE+= MK_META_MODE=no .unexport META_MODE -.endif +.endif # !defined(_CAN_USE_META_MODE) # Guess machine architecture from machine type, and vice versa. .if !defined(TARGET_ARCH) && defined(TARGET) From owner-svn-src-all@freebsd.org Tue Jun 14 16:20:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64353B6A8D5; Tue, 14 Jun 2016 16:20:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 354FA2830; Tue, 14 Jun 2016 16:20:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5EGKKEA008372; Tue, 14 Jun 2016 16:20:20 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5EGKK5O008368; Tue, 14 Jun 2016 16:20:20 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606141620.u5EGKK5O008368@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 14 Jun 2016 16:20:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301888 - in head: . share/mk tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 16:20:21 -0000 Author: bdrewery Date: Tue Jun 14 16:20:19 2016 New Revision: 301888 URL: https://svnweb.freebsd.org/changeset/base/301888 Log: WITH_META_MODE: Lessen the filemon(4) requirement scope. - Move the sys.mk filemon requirement to bsd.init.mk as a warning. This is intended only to show when building directly in a subdirectory without filemon loaded. - Move the error into Makefile and only apply it when building from the META_TGT_WHITELIST target list. -DNO_FILEMON can be used to suppress both the warning and the error but makes WITH_META_MODE less useful. It will only compare build commands in this mode rather than track all dependencies. This fixes installing from a jail which doesn't need filemon in this phase [1]. Reported by: Nikolai Lifanov [1] Approved by: re (implicit) Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile head/share/mk/bsd.init.mk head/share/mk/sys.mk head/tools/build/options/WITH_META_MODE Modified: head/Makefile ============================================================================== --- head/Makefile Tue Jun 14 16:20:14 2016 (r301887) +++ head/Makefile Tue Jun 14 16:20:19 2016 (r301888) @@ -219,6 +219,13 @@ _CAN_USE_META_MODE?= yes .if !defined(_CAN_USE_META_MODE) _MAKE+= MK_META_MODE=no .unexport META_MODE +.elif ${MK_META_MODE} == "yes" +.if !exists(/dev/filemon) && !defined(NO_FILEMON) && !make(showconfig) +# Require filemon be loaded to provide a working incremental build +.error ${.newline}ERROR: The filemon module (/dev/filemon) is not loaded. \ + ${.newline}ERROR: WITH_META_MODE is enabled but requires filemon for an incremental build. \ + ${.newline}ERROR: 'kldload filemon' or pass -DNO_FILEMON to suppress this error. +.endif # !exists(/dev/filemon) && !defined(NO_FILEMON) .endif # !defined(_CAN_USE_META_MODE) # Guess machine architecture from machine type, and vice versa. Modified: head/share/mk/bsd.init.mk ============================================================================== --- head/share/mk/bsd.init.mk Tue Jun 14 16:20:14 2016 (r301887) +++ head/share/mk/bsd.init.mk Tue Jun 14 16:20:19 2016 (r301888) @@ -28,4 +28,14 @@ _SKIP_BUILD = not building at level 0 .warning ${_SKIP_BUILD} .endif +.if ${MK_META_MODE} == "yes" +.if !exists(/dev/filemon) && \ + ${UPDATE_DEPENDFILE:Uyes:tl} != "no" && !defined(NO_FILEMON) && \ + !make(showconfig) +.warning The filemon module (/dev/filemon) is not loaded. +.warning META_MODE is less useful for incremental builds without filemon. +.warning 'kldload filemon' or pass -DNO_FILEMON to suppress this warning. +.endif +.endif # ${MK_META_MODE} == "yes" + .endif # !target(____) Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Tue Jun 14 16:20:14 2016 (r301887) +++ head/share/mk/sys.mk Tue Jun 14 16:20:19 2016 (r301888) @@ -60,10 +60,6 @@ META_MODE+= missing-meta=yes META_MODE+= silent=yes .endif .if !exists(/dev/filemon) -.if ${UPDATE_DEPENDFILE:Uyes:tl} != "no" && !defined(NO_FILEMON) && \ - !make(showconfig) -.error ${.newline}ERROR: The filemon module (/dev/filemon) is not loaded. -.endif META_MODE+= nofilemon .endif # Require filemon data with bmake Modified: head/tools/build/options/WITH_META_MODE ============================================================================== --- head/tools/build/options/WITH_META_MODE Tue Jun 14 16:20:14 2016 (r301887) +++ head/tools/build/options/WITH_META_MODE Tue Jun 14 16:20:19 2016 (r301888) @@ -7,9 +7,13 @@ using The meta file is created in the OBJDIR as .Pa target.meta . These meta files track the command ran, its output, and the current directory. -When the +The .Xr filemon 4 -module is loaded, any files used by the commands executed will be tracked as +module is required unless +.Va NO_FILEMON +is defined. +When the module is loaded, any files used by the commands executed will be +tracked as dependencies for the target in its meta file. The target will be considered out-of-date and rebuilt if any of the following are true compared to the last build: From owner-svn-src-all@freebsd.org Tue Jun 14 16:20:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FFB9B6A936; Tue, 14 Jun 2016 16:20:27 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FBA629D9; Tue, 14 Jun 2016 16:20:26 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5EGKP8c008421; Tue, 14 Jun 2016 16:20:25 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5EGKPRQ008419; Tue, 14 Jun 2016 16:20:25 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606141620.u5EGKPRQ008419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 14 Jun 2016 16:20:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301889 - in head: share/mk tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 16:20:27 -0000 Author: bdrewery Date: Tue Jun 14 16:20:25 2016 New Revision: 301889 URL: https://svnweb.freebsd.org/changeset/base/301889 Log: WITH_META_MODE: Enable printing of some of make's environment on error. This will print a set of variables from make on error using MAKE_PRINT_VAR_ON_ERROR. It is already enabled for the DIRDEPS_BUILD. It may make sense to enable this in the non-meta mode as well once people are more used to its more verbose error output. This makes it much simpler to see which .meta file is used when a command files so that it may be inspected for the build command. Suggested by: sjg Approved by: re (implicit) Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/local.sys.mk head/tools/build/options/WITH_META_MODE Modified: head/share/mk/local.sys.mk ============================================================================== --- head/share/mk/local.sys.mk Tue Jun 14 16:20:19 2016 (r301888) +++ head/share/mk/local.sys.mk Tue Jun 14 16:20:25 2016 (r301889) @@ -1,6 +1,18 @@ # $FreeBSD$ -.if ${MK_DIRDEPS_BUILD} == "yes" +.if ${MK_DIRDEPS_BUILD} == "yes" || ${MK_META_MODE} == "yes" + +# Not in the below list as it may make sense for non-meta mode +# eventually. meta.sys.mk (DIRDEPS_BUILD) also already adds these in. +.if ${MK_DIRDEPS_BUILD} == "no" && ${MK_META_MODE} == "yes" +MAKE_PRINT_VAR_ON_ERROR += \ + .ERROR_TARGET \ + .ERROR_META_FILE \ + .MAKE.LEVEL \ + MAKEFILE \ + .MAKE.MODE +.endif + MAKE_PRINT_VAR_ON_ERROR+= \ .CURDIR \ .MAKE \ @@ -12,7 +24,7 @@ MAKE_PRINT_VAR_ON_ERROR+= \ MACHINE_ARCH \ MAKEOBJDIRPREFIX \ MAKESYSPATH \ - MAKE_VERSION\ + MAKE_VERSION \ PATH \ SRCTOP \ OBJTOP \ Modified: head/tools/build/options/WITH_META_MODE ============================================================================== --- head/tools/build/options/WITH_META_MODE Tue Jun 14 16:20:19 2016 (r301888) +++ head/tools/build/options/WITH_META_MODE Tue Jun 14 16:20:25 2016 (r301889) @@ -41,6 +41,9 @@ The meta files can also be useful for de The build will hide commands ran unless .Va NO_SILENT is defined. +Errors will cause +.Xr make 1 +to show some of its environment for further debugging. .Pp The build operates as it normally would otherwise. This option originally invoked a different build system but that was renamed From owner-svn-src-all@freebsd.org Tue Jun 14 16:25:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C8E5B6AD5B; Tue, 14 Jun 2016 16:25:20 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qg0-x233.google.com (mail-qg0-x233.google.com [IPv6:2607:f8b0:400d:c04::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 537B12456; Tue, 14 Jun 2016 16:25:20 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qg0-x233.google.com with SMTP id v48so69609668qgd.2; Tue, 14 Jun 2016 09:25:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=gBlsz2sL3Hfl3jijyQNrW4ppux/HDJor0xFTqY0w1R0=; b=wlfSM3VNX2PeK5hQ4xAYyFeZxqyX2Pww97KE4uWVla76kdEyc+TSCQJNDmk1RcDYU+ TBzP9feSb2Te5qpDM0RTQBQ8QqvH6lf1tjb8b0yajjKpF2ufga2MG1U3VdDdc2ocZW4X 6PhvyqdRSbLsANqvA/97/FEWT4PMvyCRmd2J3JFBsb+zkLgM1YBShWz3r6sEnjmHqHCk FS4zNEgN7NNHkTmTsIs9RpZLSgLgicH3W0J+Q88pPnbJq4wNXP/kDcTleoGaN7PAtIbH 4pdqvupM2k8XrXJvCfG/wntro2/gGrlEjdpfoGHswxl+t2C9McOdy7VfzLjpcXe1MzLT E2vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=gBlsz2sL3Hfl3jijyQNrW4ppux/HDJor0xFTqY0w1R0=; b=iEN7Tsd4EpRglnjNjX40HfaecmNz1A2k2WUtOWkLDNjaMLeNjcNLn6L+IX2y3pFWot x7HaJ1fhvAnssvBH+9mcAthuyI7m2wjMigscxiDl/B23HRZkT5Nf5knWfvtebkyggAFt SkEOQwqUYDKvWIIBSwPjgvw30DtMhkxQ8V1uydjOAyrE39IyuXKKUPxTU+iuPCX7q1Uo svKCt2kSmizYcbK+WYzcg+p33y5exeMOrF6dClocJlJkl0fgZk+V9QaitK08NsFr6TCw fAJflEE+Doh1273mobNlCOHxR7SXSAwRlGwzqsz908UPiTgoYxkoH4kGlBL2cGVpTToo wWvQ== X-Gm-Message-State: ALyK8tLYj+le2xKB6asOz6MJpEGUirnYTxBjmpfUK5LhXqh9mvzBbG9xwuvhsuJzgYcKBdjM7T6GpSR/TPVvhQ== X-Received: by 10.140.153.135 with SMTP id 129mr21083608qhz.71.1465921519480; Tue, 14 Jun 2016 09:25:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.55.148.131 with HTTP; Tue, 14 Jun 2016 09:25:19 -0700 (PDT) In-Reply-To: <201606081147.u58BlJ8X099462@repo.freebsd.org> References: <201606081147.u58BlJ8X099462@repo.freebsd.org> From: Ngie Cooper Date: Tue, 14 Jun 2016 09:25:19 -0700 Message-ID: Subject: Re: svn commit: r301602 - in head: . lib/libpam lib/libpam/libpam lib/libpam/libpam/security tools/build/mk To: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 16:25:20 -0000 On Wed, Jun 8, 2016 at 4:47 AM, Dag-Erling Sm=C3=B8rgrav = wrote: > Author: des > Date: Wed Jun 8 11:47:19 2016 > New Revision: 301602 > URL: https://svnweb.freebsd.org/changeset/base/301602 > > Log: > Replace _pam_verbose_error() with a macro. This was the last differenc= e > between our libpam and stock OpenPAM, meaning that it is now possible t= o > replace the base libpam with a hypothetical ports version of OpenPAM. Unfortunately this commit wasn't followed by a bump to __FreeBSD_version, so the package cluster hasn't updated all packages that require libpam.so, like sudo, etc. I can't commit anything for a while (my Macbook Pro is a bit out of commission)... but I'll try and prod someone else to do it. Thanks, -Ngie From owner-svn-src-all@freebsd.org Tue Jun 14 16:37:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D7FFB7214E; Tue, 14 Jun 2016 16:37:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 618772B86; Tue, 14 Jun 2016 16:37:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 53BF018D2; Tue, 14 Jun 2016 16:37:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 1BBFC1DD92; Tue, 14 Jun 2016 16:37:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id sZrGvBSBy9fI; Tue, 14 Jun 2016 16:37:17 +0000 (UTC) Subject: Re: svn commit: r301602 - in head: . lib/libpam lib/libpam/libpam lib/libpam/libpam/security tools/build/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com A89421DD8D To: Ngie Cooper , =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= References: <201606081147.u58BlJ8X099462@repo.freebsd.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <15ae4cc5-c65f-49af-5456-07d2cf476337@FreeBSD.org> Date: Tue, 14 Jun 2016 09:37:17 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="KeaqhvPNSk8MW9FHQcVm2BlulG1bWRDab" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 16:37:21 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --KeaqhvPNSk8MW9FHQcVm2BlulG1bWRDab Content-Type: multipart/mixed; boundary="do8MRQVSlGrB0UTLqHg92jLcGMJvdk13G" From: Bryan Drewery To: Ngie Cooper , =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: <15ae4cc5-c65f-49af-5456-07d2cf476337@FreeBSD.org> Subject: Re: svn commit: r301602 - in head: . lib/libpam lib/libpam/libpam lib/libpam/libpam/security tools/build/mk References: <201606081147.u58BlJ8X099462@repo.freebsd.org> In-Reply-To: --do8MRQVSlGrB0UTLqHg92jLcGMJvdk13G Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 6/14/2016 9:25 AM, Ngie Cooper wrote: > On Wed, Jun 8, 2016 at 4:47 AM, Dag-Erling Sm=C3=B8rgrav wrote: >> Author: des >> Date: Wed Jun 8 11:47:19 2016 >> New Revision: 301602 >> URL: https://svnweb.freebsd.org/changeset/base/301602 >> >> Log: >> Replace _pam_verbose_error() with a macro. This was the last differ= ence >> between our libpam and stock OpenPAM, meaning that it is now possibl= e to >> replace the base libpam with a hypothetical ports version of OpenPAM= =2E >=20 > Unfortunately this commit wasn't followed by a bump to > __FreeBSD_version, so the package cluster hasn't updated all packages > that require libpam.so, like sudo, etc. >=20 > I can't commit anything for a while (my Macbook Pro is a bit out of > commission)... but I'll try and prod someone else to do it. >=20 Note this will also cause the OpenSSL bump in r301271 to break packages. Ports OpenSSL is supposed to be +1 over what is in base but r301271 made it match... thus rebuilding packages will likely cause chaos. We'll need to fix the OpenSSL port first. Also, I sort of consider this a failure on Poudriere/ports/pkg. We should be able to detect that shared libraries were bumped and some packages need to be rebuilt now. Unfortunately pkg doesn't record the dependency. Poudriere could record it and use it. This goes back to my proposal (which has lacked implementation time) about how to auto-detect when the system ABI changes without relying on __FreeBSD_version. Bumped libraries would have to be one of them. --=20 Regards, Bryan Drewery --do8MRQVSlGrB0UTLqHg92jLcGMJvdk13G-- --KeaqhvPNSk8MW9FHQcVm2BlulG1bWRDab Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEbBAEBAgAGBQJXYDK9AAoJEDXXcbtuRpfPZkwH9ifCwcztS+I+Y/KvYtkvbOWu o9Zr7JWQr5lrDYgvOmyx5pwYPYDpelVX7USBy306lkdCZQ6wJyMUVFFr9JsbAVBc FOtfvLOOJCH0pZ4FmQCJKxgXvsSOmX4fqOnAYJlYiQNnfcQtw4tnYZ8EtMLPHRw1 3WXCMSwsjC8wb1UJLiIHe8F7BWg6pSu8NqDnY/9H/PkpRxh3HxbHfLMmhmIrJpYG gZcTHAceLfYOsOxvcLlNrH1fBg2va9aeXYWCGfbhXZHb6cnwGi5vtCHb1L00Ni5t v3La+RISt51r1pbkuFFBSg7/xMUyJ6flSS4kxqXDRYbdandT849iMpWuzEh+nw== =uWbe -----END PGP SIGNATURE----- --KeaqhvPNSk8MW9FHQcVm2BlulG1bWRDab-- From owner-svn-src-all@freebsd.org Tue Jun 14 16:41:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6B96B72335; Tue, 14 Jun 2016 16:41:40 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B63782EE9; Tue, 14 Jun 2016 16:41:40 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5EGfdi3016191; Tue, 14 Jun 2016 16:41:39 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5EGfdwD016190; Tue, 14 Jun 2016 16:41:39 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201606141641.u5EGfdwD016190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 14 Jun 2016 16:41:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301890 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 16:41:41 -0000 Author: andrew Date: Tue Jun 14 16:41:39 2016 New Revision: 301890 URL: https://svnweb.freebsd.org/changeset/base/301890 Log: Move the arm call to intr_pic_init_secondary earlier in the secondary CPU initialisation. This ensures it will complete before signalling to the boot CPU it has booted. This fixes a race with the GIC where the arm_gic_map may not be populated before it is used to bind interrupts leading to some interrupts becoming bound to no CPUs. Approved by: re (kib) Sponsored by: ABT Systems Ltd Modified: head/sys/arm/arm/mp_machdep.c Modified: head/sys/arm/arm/mp_machdep.c ============================================================================== --- head/sys/arm/arm/mp_machdep.c Tue Jun 14 16:20:25 2016 (r301889) +++ head/sys/arm/arm/mp_machdep.c Tue Jun 14 16:41:39 2016 (r301890) @@ -199,6 +199,9 @@ init_secondary(int cpu) vfp_init(); #endif + /* Configure the interrupt controller */ + intr_pic_init_secondary(); + mtx_lock_spin(&ap_boot_mtx); atomic_add_rel_32(&smp_cpus, 1); @@ -237,7 +240,6 @@ init_secondary(int cpu) cpu_initclocks_ap(); CTR0(KTR_SMP, "go into scheduler"); - intr_pic_init_secondary(); /* Enter the scheduler */ sched_throw(NULL); From owner-svn-src-all@freebsd.org Tue Jun 14 16:44:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2827B723AE; Tue, 14 Jun 2016 16:44:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id D615D210F; Tue, 14 Jun 2016 16:44:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id CA7DD1C17; Tue, 14 Jun 2016 16:44:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 94A3D1DE03; Tue, 14 Jun 2016 16:44:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id HPSUGDmdWXyA; Tue, 14 Jun 2016 16:44:02 +0000 (UTC) Subject: Re: svn commit: r301602 - in head: . lib/libpam lib/libpam/libpam lib/libpam/libpam/security tools/build/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com F37461DDFE To: Ngie Cooper , =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= References: <201606081147.u58BlJ8X099462@repo.freebsd.org> <15ae4cc5-c65f-49af-5456-07d2cf476337@FreeBSD.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: Date: Tue, 14 Jun 2016 09:44:01 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <15ae4cc5-c65f-49af-5456-07d2cf476337@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PiSqV81TdtoXERPhCtKkO6iFGqWtRmMAl" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 16:44:06 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --PiSqV81TdtoXERPhCtKkO6iFGqWtRmMAl Content-Type: multipart/mixed; boundary="02q6ChKSXE5g6tLlKFEAVa4cVNC5h4dMc" From: Bryan Drewery To: Ngie Cooper , =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: Subject: Re: svn commit: r301602 - in head: . lib/libpam lib/libpam/libpam lib/libpam/libpam/security tools/build/mk References: <201606081147.u58BlJ8X099462@repo.freebsd.org> <15ae4cc5-c65f-49af-5456-07d2cf476337@FreeBSD.org> In-Reply-To: <15ae4cc5-c65f-49af-5456-07d2cf476337@FreeBSD.org> --02q6ChKSXE5g6tLlKFEAVa4cVNC5h4dMc Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 6/14/2016 9:37 AM, Bryan Drewery wrote: > On 6/14/2016 9:25 AM, Ngie Cooper wrote: >> On Wed, Jun 8, 2016 at 4:47 AM, Dag-Erling Sm=C3=B8rgrav wrote: >>> Author: des >>> Date: Wed Jun 8 11:47:19 2016 >>> New Revision: 301602 >>> URL: https://svnweb.freebsd.org/changeset/base/301602 >>> >>> Log: >>> Replace _pam_verbose_error() with a macro. This was the last diffe= rence >>> between our libpam and stock OpenPAM, meaning that it is now possib= le to >>> replace the base libpam with a hypothetical ports version of OpenPA= M. >> >> Unfortunately this commit wasn't followed by a bump to >> __FreeBSD_version, so the package cluster hasn't updated all packages >> that require libpam.so, like sudo, etc. >> >> I can't commit anything for a while (my Macbook Pro is a bit out of >> commission)... but I'll try and prod someone else to do it. >> >=20 > Note this will also cause the OpenSSL bump in r301271 to break packages= =2E > Ports OpenSSL is supposed to be +1 over what is in base but r301271 > made it match... thus rebuilding packages will likely cause chaos. > We'll need to fix the OpenSSL port first. The port maintainer tells me he only bumps the port on base releases and doesn't consider CURRENT. So whatever @ OpenSSL. >=20 > Also, I sort of consider this a failure on Poudriere/ports/pkg. We > should be able to detect that shared libraries were bumped and some > packages need to be rebuilt now. >=20 > Unfortunately pkg doesn't record the dependency. >=20 > Poudriere could record it and use it. >=20 > This goes back to my proposal (which has lacked implementation time) > about how to auto-detect when the system ABI changes without relying on= > __FreeBSD_version. Bumped libraries would have to be one of them. >=20 >=20 --=20 Regards, Bryan Drewery --02q6ChKSXE5g6tLlKFEAVa4cVNC5h4dMc-- --PiSqV81TdtoXERPhCtKkO6iFGqWtRmMAl Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJXYDRSAAoJEDXXcbtuRpfPI7IH/iqyCTOon9KrfTRbK/NaXzsQ /9ZQj3jtpIUiTXxFmANHGFI6zHCoTAUd9sUWyPQghnRdP//1yOWjdeD+iDwZ3hmk HAQPvpOFSQAdvKx/LltMmo6i8NG0BPGMnwzY6csYsrLkSrudVQaHbUWQwmMkyC2h Am6dhQXl8vYtZlgilUg98AbWonvvODbF5drPw80W7GWCMO1XfzizCW/JOIATJB4K bTRWsg/D0jLxHaug4GvlB8tPwXd4GBBxaxfXmWTyvnlmhigpttNSdcZyGKVaPQrY CZKnII2DBANU8sjp9fe4VFRCIzP5yAOjiAttL0AR9UKb4U56r9siRIvhpCgMCo0= =37rt -----END PGP SIGNATURE----- --PiSqV81TdtoXERPhCtKkO6iFGqWtRmMAl-- From owner-svn-src-all@freebsd.org Tue Jun 14 16:55:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDC1FB7265D; Tue, 14 Jun 2016 16:55:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F61B29B0; Tue, 14 Jun 2016 16:55:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5EGt6Op023231; Tue, 14 Jun 2016 16:55:06 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5EGt53J023220; Tue, 14 Jun 2016 16:55:05 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606141655.u5EGt53J023220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 14 Jun 2016 16:55:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301891 - in head: gnu/usr.bin/groff/src/libs/libbib kerberos5/tools/asn1_compile lib/libclang_rt/asan_cxx lib/libclang_rt/profile lib/libclang_rt/safestack lib/libpam/static_libpam lib... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 16:55:07 -0000 Author: bdrewery Date: Tue Jun 14 16:55:05 2016 New Revision: 301891 URL: https://svnweb.freebsd.org/changeset/base/301891 Log: DIRDEPS_BUILD: Update dependencies Approved by: re (gjb) Sponsored by: EMC / Isilon Storage Division Modified: head/gnu/usr.bin/groff/src/libs/libbib/Makefile.depend head/kerberos5/tools/asn1_compile/Makefile.depend head/lib/libclang_rt/asan_cxx/Makefile.depend head/lib/libclang_rt/profile/Makefile.depend head/lib/libclang_rt/safestack/Makefile.depend head/lib/libpam/static_libpam/Makefile.depend head/libexec/fingerd/Makefile.depend head/libexec/ftpd/Makefile.depend head/libexec/rlogind/Makefile.depend head/libexec/rshd/Makefile.depend head/secure/usr.sbin/sshd/Makefile.depend Modified: head/gnu/usr.bin/groff/src/libs/libbib/Makefile.depend ============================================================================== --- head/gnu/usr.bin/groff/src/libs/libbib/Makefile.depend Tue Jun 14 16:41:39 2016 (r301890) +++ head/gnu/usr.bin/groff/src/libs/libbib/Makefile.depend Tue Jun 14 16:55:05 2016 (r301891) @@ -4,6 +4,7 @@ DIRDEPS = \ include \ include/xlocale \ + lib/libc++ \ .include Modified: head/kerberos5/tools/asn1_compile/Makefile.depend ============================================================================== --- head/kerberos5/tools/asn1_compile/Makefile.depend Tue Jun 14 16:41:39 2016 (r301890) +++ head/kerberos5/tools/asn1_compile/Makefile.depend Tue Jun 14 16:55:05 2016 (r301891) @@ -9,6 +9,7 @@ DIRDEPS = \ include/xlocale \ kerberos5/lib/libroken \ kerberos5/lib/libvers \ + kerberos5/tools/make-roken.host \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ Modified: head/lib/libclang_rt/asan_cxx/Makefile.depend ============================================================================== --- head/lib/libclang_rt/asan_cxx/Makefile.depend Tue Jun 14 16:41:39 2016 (r301890) +++ head/lib/libclang_rt/asan_cxx/Makefile.depend Tue Jun 14 16:55:05 2016 (r301891) @@ -3,6 +3,7 @@ DIRDEPS = \ include \ + lib/libc++ \ .include Modified: head/lib/libclang_rt/profile/Makefile.depend ============================================================================== --- head/lib/libclang_rt/profile/Makefile.depend Tue Jun 14 16:41:39 2016 (r301890) +++ head/lib/libclang_rt/profile/Makefile.depend Tue Jun 14 16:55:05 2016 (r301891) @@ -4,6 +4,7 @@ DIRDEPS = \ include \ include/xlocale \ + lib/libc++ \ .include Modified: head/lib/libclang_rt/safestack/Makefile.depend ============================================================================== --- head/lib/libclang_rt/safestack/Makefile.depend Tue Jun 14 16:41:39 2016 (r301890) +++ head/lib/libclang_rt/safestack/Makefile.depend Tue Jun 14 16:55:05 2016 (r301891) @@ -5,6 +5,7 @@ DIRDEPS = \ include \ include/arpa \ include/xlocale \ + lib/libc++ \ lib/ncurses/ncursesw \ Modified: head/lib/libpam/static_libpam/Makefile.depend ============================================================================== --- head/lib/libpam/static_libpam/Makefile.depend Tue Jun 14 16:41:39 2016 (r301890) +++ head/lib/libpam/static_libpam/Makefile.depend Tue Jun 14 16:55:05 2016 (r301891) @@ -4,7 +4,6 @@ DIRDEPS = \ include \ include/xlocale \ - lib/libpam/libpam \ lib/libpam/modules/pam_chroot \ lib/libpam/modules/pam_deny \ lib/libpam/modules/pam_echo \ Modified: head/libexec/fingerd/Makefile.depend ============================================================================== --- head/libexec/fingerd/Makefile.depend Tue Jun 14 16:41:39 2016 (r301890) +++ head/libexec/fingerd/Makefile.depend Tue Jun 14 16:55:05 2016 (r301891) @@ -8,8 +8,10 @@ DIRDEPS = \ include/arpa \ include/xlocale \ lib/${CSU_DIR} \ + lib/libblacklist \ lib/libc \ lib/libcompiler_rt \ + lib/libthr \ lib/libutil \ Modified: head/libexec/ftpd/Makefile.depend ============================================================================== --- head/libexec/ftpd/Makefile.depend Tue Jun 14 16:41:39 2016 (r301890) +++ head/libexec/ftpd/Makefile.depend Tue Jun 14 16:55:05 2016 (r301891) @@ -8,12 +8,14 @@ DIRDEPS = \ include/arpa \ include/xlocale \ lib/${CSU_DIR} \ + lib/libblacklist \ lib/libc \ lib/libcompiler_rt \ lib/libcrypt \ lib/libmd \ lib/libopie \ lib/libpam/libpam \ + lib/libthr \ lib/libutil \ lib/libxo \ lib/msun \ Modified: head/libexec/rlogind/Makefile.depend ============================================================================== --- head/libexec/rlogind/Makefile.depend Tue Jun 14 16:41:39 2016 (r301890) +++ head/libexec/rlogind/Makefile.depend Tue Jun 14 16:55:05 2016 (r301891) @@ -8,8 +8,10 @@ DIRDEPS = \ include/arpa \ include/xlocale \ lib/${CSU_DIR} \ + lib/libblacklist \ lib/libc \ lib/libcompiler_rt \ + lib/libthr \ lib/libutil \ Modified: head/libexec/rshd/Makefile.depend ============================================================================== --- head/libexec/rshd/Makefile.depend Tue Jun 14 16:41:39 2016 (r301890) +++ head/libexec/rshd/Makefile.depend Tue Jun 14 16:55:05 2016 (r301891) @@ -8,9 +8,11 @@ DIRDEPS = \ include/arpa \ include/xlocale \ lib/${CSU_DIR} \ + lib/libblacklist \ lib/libc \ lib/libcompiler_rt \ lib/libpam/libpam \ + lib/libthr \ lib/libutil \ Modified: head/secure/usr.sbin/sshd/Makefile.depend ============================================================================== --- head/secure/usr.sbin/sshd/Makefile.depend Tue Jun 14 16:41:39 2016 (r301890) +++ head/secure/usr.sbin/sshd/Makefile.depend Tue Jun 14 16:55:05 2016 (r301891) @@ -17,6 +17,7 @@ DIRDEPS = \ kerberos5/lib/libroken \ kerberos5/lib/libwind \ lib/${CSU_DIR} \ + lib/libblacklist \ lib/libbsm \ lib/libc \ lib/libcom_err \ From owner-svn-src-all@freebsd.org Tue Jun 14 17:15:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCEBDB72C07; Tue, 14 Jun 2016 17:15:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89EB725D1; Tue, 14 Jun 2016 17:15:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5EHFa40030983; Tue, 14 Jun 2016 17:15:36 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5EHFaa3030982; Tue, 14 Jun 2016 17:15:36 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606141715.u5EHFaa3030982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 14 Jun 2016 17:15:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301892 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 17:15:37 -0000 Author: bdrewery Date: Tue Jun 14 17:15:36 2016 New Revision: 301892 URL: https://svnweb.freebsd.org/changeset/base/301892 Log: Bump __FreeBSD_version for r301602. Reported by: ngie, Ben Lavery PR: 210229 Approved by: re (gjb) Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue Jun 14 16:55:05 2016 (r301891) +++ head/sys/sys/param.h Tue Jun 14 17:15:36 2016 (r301892) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100116 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100117 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Tue Jun 14 17:23:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5456B72EF2; Tue, 14 Jun 2016 17:23:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6FB262D4D; Tue, 14 Jun 2016 17:23:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5EHNMl6034485; Tue, 14 Jun 2016 17:23:22 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5EHNM2o034484; Tue, 14 Jun 2016 17:23:22 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606141723.u5EHNM2o034484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 14 Jun 2016 17:23:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301893 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 17:23:23 -0000 Author: bdrewery Date: Tue Jun 14 17:23:22 2016 New Revision: 301893 URL: https://svnweb.freebsd.org/changeset/base/301893 Log: Fix build from stable/10 with fmake. This was broken in r301888. fmake does not look in share/mk by default and thus does not yet have MK_META_MODE set with default. Pointyhat to: bdrewery Approved by: re (implicit) Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Tue Jun 14 17:15:36 2016 (r301892) +++ head/Makefile Tue Jun 14 17:23:22 2016 (r301893) @@ -219,7 +219,7 @@ _CAN_USE_META_MODE?= yes .if !defined(_CAN_USE_META_MODE) _MAKE+= MK_META_MODE=no .unexport META_MODE -.elif ${MK_META_MODE} == "yes" +.elif defined(MK_META_MODE) && ${MK_META_MODE} == "yes" .if !exists(/dev/filemon) && !defined(NO_FILEMON) && !make(showconfig) # Require filemon be loaded to provide a working incremental build .error ${.newline}ERROR: The filemon module (/dev/filemon) is not loaded. \ From owner-svn-src-all@freebsd.org Tue Jun 14 17:26:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6595B720D6; Tue, 14 Jun 2016 17:26:05 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qk0-x230.google.com (mail-qk0-x230.google.com [IPv6:2607:f8b0:400d:c09::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6443C2229; Tue, 14 Jun 2016 17:26:05 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qk0-x230.google.com with SMTP id c73so66388669qkg.2; Tue, 14 Jun 2016 10:26:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=P/KZ6+X83T6oJcc/yUe+ZRtM5wjZQhRvPkxxMhx/LNM=; b=llrb5qAJuUgAqa4leNnEfgDHHG+7yZEIxM+yEW1AOVKpoCUmxWPwFxzAx+KupfZzps oHudpQuNIXtlWCNCSSaVZiGLZhnELEQYje/1wnTEa576bYI1NXc2G4iaX2f7Hdu0tmz/ hOlIKpaFxnisCE1z21FvU0tLdZ2B7PF264NmvBsrX6gxWgXw+x82GbKDfhObkGsT2NIP OwYm262gCqRZ25c46UdshNqQGs+18GSrfbjDr+8G3naN70LOd4mr2/gi82n7neQyEa+I Zm6Ez/Cs/n87pHKnW4vlM+MraSkXAVcefGy+j9JVQ+x0X5NrtnE/6uoFFRvFSiJCH3cz xvHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=P/KZ6+X83T6oJcc/yUe+ZRtM5wjZQhRvPkxxMhx/LNM=; b=dZVsn7Yh93PHBI68lLmAWE6UMACkxXub4Up5IHjyNfZkBOX/XYZpR2NamlgVIV5Jma OPafLGjuK54KwZzTHfkbYkxL9qG0oJnSsvWifi1wxBejVDpV3Z9oMbZQVAb1NkQ1Jvrj 2H5abU+YFrDTqtSopWzdafTBei2bVLdCy1hvmdeBDOu8hoDpl4RCaBRyeZ78TxYqN6V7 pwAhLEtonHIukXeGI8ht6SIbgkNhwXQQfuH4ecn8rkwnsbGjsefOXxrMeQQKSf8QQp25 Yhb0nYhX4NoxnIEupmKAAwSFgXbpJ9wUUKDtTNaGxvEBCaFKtCn2jqo+4EpFgPxJfpyf Vcug== X-Gm-Message-State: ALyK8tKrN3cEeV2fUZPZTJUlIbr68hhSDU6IyjTZsjfGPu/hfy6l2ciNWUZC/UZAQUZArMu6HLfs//9Wv2Oe1w== X-Received: by 10.55.73.209 with SMTP id w200mr1968750qka.77.1465925164689; Tue, 14 Jun 2016 10:26:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.55.148.131 with HTTP; Tue, 14 Jun 2016 10:26:04 -0700 (PDT) In-Reply-To: <201606141715.u5EHFaa3030982@repo.freebsd.org> References: <201606141715.u5EHFaa3030982@repo.freebsd.org> From: Ngie Cooper Date: Tue, 14 Jun 2016 10:26:04 -0700 Message-ID: Subject: Re: svn commit: r301892 - head/sys/sys To: Bryan Drewery Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 17:26:05 -0000 On Tue, Jun 14, 2016 at 10:15 AM, Bryan Drewery wrote: > Author: bdrewery > Date: Tue Jun 14 17:15:36 2016 > New Revision: 301892 > URL: https://svnweb.freebsd.org/changeset/base/301892 > > Log: > Bump __FreeBSD_version for r301602. > > Reported by: ngie, Ben Lavery > PR: 210229 > Approved by: re (gjb) Thanks Bryan :)!!! From owner-svn-src-all@freebsd.org Tue Jun 14 17:47:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02E97B7258D; Tue, 14 Jun 2016 17:47:01 +0000 (UTC) (envelope-from ben.lavery@hashbang0.com) Received: from sender163-mail.zoho.com (sender163-mail.zoho.com [74.201.84.163]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E49FE2EBF; Tue, 14 Jun 2016 17:47:00 +0000 (UTC) (envelope-from ben.lavery@hashbang0.com) Received: from talantinc.lan (51.250.113.87.dyn.plus.net [87.113.250.51]) by mx.zohomail.com with SMTPS id 1465926409926783.684557784328; Tue, 14 Jun 2016 10:46:49 -0700 (PDT) Subject: Re: svn commit: r301892 - head/sys/sys Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_8EF860FB-9FEE-4C7E-9D4A-CF5EE3BDB0A9"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.6b2 From: Ben Lavery In-Reply-To: <201606141715.u5EHFaa3030982@repo.freebsd.org> Date: Tue, 14 Jun 2016 18:46:35 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201606141715.u5EHFaa3030982@repo.freebsd.org> To: Bryan Drewery X-Mailer: Apple Mail (2.3124) X-Zoho-Virus-Status: 1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 17:47:01 -0000 --Apple-Mail=_8EF860FB-9FEE-4C7E-9D4A-CF5EE3BDB0A9 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On 14 Jun 2016, at 18:15, Bryan Drewery wrote: >=20 > Author: bdrewery > Date: Tue Jun 14 17:15:36 2016 > New Revision: 301892 > URL: https://svnweb.freebsd.org/changeset/base/301892 >=20 > Log: > Bump __FreeBSD_version for r301602. >=20 > Reported by: ngie, Ben Lavery > PR: 210229 > Approved by: re (gab) Thanks Bryan and those involved. Apologies for not being more specific = in my initial report! --Apple-Mail=_8EF860FB-9FEE-4C7E-9D4A-CF5EE3BDB0A9 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJXYEMEAAoJEB8k5j03kFtxgUQIAJgBjoY2UiKmlBy5JFcZjpja c4aQH8VUojCSco5C9XSQyEooXFwxqpUo96YsLCIMjGbo+Jou4YDsy+3PzasRZ1l0 dtuvFh1GStegE2lWYhTeoXV5SFKFF0Bw4HMWI/cJ1GZvnJ0ANBuyJBRdBVveNGGZ FxGK8CodUdoJxbtoLfIDMJxSNO+rLERuq512XfzPwqzSaptFsNeLZaXhnyWiFxjN yfMKs+sfiR6TKneMWpo5IFGbiU71X/qvU13Q5Pw+SgSB/17LaykZOwVAIy6K0WzY j8LN3fsMGhV3nGm/QmeIo+eXUy2IWvixaVT2VtMkCwLH7JgG+LCEqjEda13Fu2A= =w9G0 -----END PGP SIGNATURE----- --Apple-Mail=_8EF860FB-9FEE-4C7E-9D4A-CF5EE3BDB0A9-- From owner-svn-src-all@freebsd.org Tue Jun 14 18:37:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D397DAF28E2; Tue, 14 Jun 2016 18:37:34 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A52B02FAB; Tue, 14 Jun 2016 18:37:34 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5EIbXXQ060470; Tue, 14 Jun 2016 18:37:33 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5EIbXJI060469; Tue, 14 Jun 2016 18:37:33 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606141837.u5EIbXJI060469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 14 Jun 2016 18:37:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301894 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 18:37:34 -0000 Author: bdrewery Date: Tue Jun 14 18:37:33 2016 New Revision: 301894 URL: https://svnweb.freebsd.org/changeset/base/301894 Log: Fix makeman showing dependency of DIRDEPS_BUILD->META_MODE. This broke in r301887 with the meta mode whitelist. 'make showconfig' still needs WITH_META_MODE support. Approved by: re (implicit) Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Tue Jun 14 17:23:22 2016 (r301893) +++ head/Makefile Tue Jun 14 18:37:33 2016 (r301894) @@ -151,8 +151,8 @@ TGTS+= ${BITGTS} META_TGT_WHITELIST+= \ _* build32 buildfiles buildincludes buildkernel buildsoft \ buildworld everything kernel-toolchains kernels libraries \ - native-xtools tinderbox toolchain toolchains universe worlds \ - xdev xdev-build + native-xtools showconfig tinderbox toolchain toolchains universe \ + worlds xdev xdev-build .ORDER: buildworld installworld .ORDER: buildworld distributeworld From owner-svn-src-all@freebsd.org Tue Jun 14 18:41:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16AF7AF2A81; Tue, 14 Jun 2016 18:41:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BEF8F21CC; Tue, 14 Jun 2016 18:41:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5EIfIXV061492; Tue, 14 Jun 2016 18:41:18 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5EIfIlF061491; Tue, 14 Jun 2016 18:41:18 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606141841.u5EIfIlF061491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 14 Jun 2016 18:41:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301895 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 18:41:20 -0000 Author: bdrewery Date: Tue Jun 14 18:41:18 2016 New Revision: 301895 URL: https://svnweb.freebsd.org/changeset/base/301895 Log: Renegerate for WITH_META_MODE updates. Approved by: re (implicit) Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Tue Jun 14 18:37:33 2016 (r301894) +++ head/share/man/man5/src.conf.5 Tue Jun 14 18:41:18 2016 (r301895) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 292283 2015-12-15 18:42:30Z bdrewery .\" $FreeBSD$ -.Dd June 8, 2016 +.Dd June 14, 2016 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1080,7 +1080,7 @@ Set to not build utilities for manual pa .Xr manctl 8 , and related support files. .It Va WITH_META_MODE -.\" from FreeBSD: head/tools/build/options/WITH_META_MODE 301474 2016-06-05 23:14:06Z bdrewery +.\" from FreeBSD: head/tools/build/options/WITH_META_MODE 301889 2016-06-14 16:20:25Z bdrewery Creates .Xr make 1 meta files when building, which can provide a reliable incremental build when @@ -1089,9 +1089,13 @@ using The meta file is created in the OBJDIR as .Pa target.meta . These meta files track the command ran, its output, and the current directory. -When the +The .Xr filemon 4 -module is loaded, any files used by the commands executed will be tracked as +module is required unless +.Va NO_FILEMON +is defined. +When the module is loaded, any files used by the commands executed will be +tracked as dependencies for the target in its meta file. The target will be considered out-of-date and rebuilt if any of the following are true compared to the last build: @@ -1119,6 +1123,9 @@ The meta files can also be useful for de The build will hide commands ran unless .Va NO_SILENT is defined. +Errors will cause +.Xr make 1 +to show some of its environment for further debugging. .Pp The build operates as it normally would otherwise. This option originally invoked a different build system but that was renamed From owner-svn-src-all@freebsd.org Tue Jun 14 19:16:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97579B720B7; Tue, 14 Jun 2016 19:16:19 +0000 (UTC) (envelope-from fullermd@over-yonder.net) Received: from mail.infocus-llc.com (mail.infocus-llc.com [199.15.120.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 756832124; Tue, 14 Jun 2016 19:16:19 +0000 (UTC) (envelope-from fullermd@over-yonder.net) Received: from draco.over-yonder.net (c-75-65-60-66.hsd1.ms.comcast.net [75.65.60.66]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.tarragon.infocus-llc.com (Postfix) with ESMTPSA id 3rTfJJ4DGVz1QM; Tue, 14 Jun 2016 14:06:24 -0500 (CDT) Received: by draco.over-yonder.net (Postfix, from userid 100) id 3rTfJJ0Zgtz2W6; Tue, 14 Jun 2016 14:06:24 -0500 (CDT) Date: Tue, 14 Jun 2016 14:06:24 -0500 From: "Matthew D. Fuller" To: Bryan Drewery Cc: Ngie Cooper , Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r301602 - in head: . lib/libpam lib/libpam/libpam lib/libpam/libpam/security tools/build/mk Message-ID: <20160614190624.GI89416@over-yonder.net> References: <201606081147.u58BlJ8X099462@repo.freebsd.org> <15ae4cc5-c65f-49af-5456-07d2cf476337@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <15ae4cc5-c65f-49af-5456-07d2cf476337@FreeBSD.org> X-Editor: vi X-OS: FreeBSD X-Virus-Scanned: clamav-milter 0.99 at mail.tarragon.infocus-llc.com X-Virus-Status: Clean User-Agent: Mutt/1.6.1-fullermd.4 (2016-04-27) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 19:16:19 -0000 On Tue, Jun 14, 2016 at 09:37:17AM -0700 I heard the voice of Bryan Drewery, and lo! it spake thus: > > Ports OpenSSL is supposed to be +1 over what is in base but r301271 > made it match... thus rebuilding packages will likely cause chaos. Actually since r290207 (last Oct). It makes life... interesting. -- Matthew Fuller (MF4839) | fullermd@over-yonder.net Systems/Network Administrator | http://www.over-yonder.net/~fullermd/ On the Internet, nobody can hear you scream. From owner-svn-src-all@freebsd.org Tue Jun 14 20:20:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D1C9B72F29; Tue, 14 Jun 2016 20:20:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id C73162195; Tue, 14 Jun 2016 20:20:52 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id XAA19671; Tue, 14 Jun 2016 23:20:50 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1bCupO-0009Ak-82; Tue, 14 Jun 2016 23:20:50 +0300 Subject: Re: svn commit: r301602 - in head: . lib/libpam lib/libpam/libpam lib/libpam/libpam/security tools/build/mk To: Bryan Drewery References: <201606081147.u58BlJ8X099462@repo.freebsd.org> <15ae4cc5-c65f-49af-5456-07d2cf476337@FreeBSD.org> Cc: Ngie Cooper , =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Andriy Gapon Message-ID: Date: Tue, 14 Jun 2016 23:19:48 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <15ae4cc5-c65f-49af-5456-07d2cf476337@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 20:20:54 -0000 On 14/06/2016 19:37, Bryan Drewery wrote: > Note this will also cause the OpenSSL bump in r301271 to break packages. > Ports OpenSSL is supposed to be +1 over what is in base but r301271 I am curious if it is r301271 (change of SHLIB_VERSION_NUMBER C macro) or if it is the actual bump of base's libssl to version 8. And why. So that I know it from now on. -- Andriy Gapon From owner-svn-src-all@freebsd.org Tue Jun 14 20:58:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7866CB72551; Tue, 14 Jun 2016 20:58:06 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B13422D3; Tue, 14 Jun 2016 20:58:06 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5EKw5fC012794; Tue, 14 Jun 2016 20:58:05 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5EKw5ci012793; Tue, 14 Jun 2016 20:58:05 GMT (envelope-from np@FreeBSD.org) Message-Id: <201606142058.u5EKw5ci012793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 14 Jun 2016 20:58:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301896 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 20:58:06 -0000 Author: np Date: Tue Jun 14 20:58:05 2016 New Revision: 301896 URL: https://svnweb.freebsd.org/changeset/base/301896 Log: Fix bug in iwcm that caused a panic in iw_cm_wq when krping is run repeatedly in a tight loop. Approved by: re (gjb@) Obtained from: hselasky@ (part of larger changes in D5791) Modified: head/sys/ofed/drivers/infiniband/core/iwcm.c Modified: head/sys/ofed/drivers/infiniband/core/iwcm.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/iwcm.c Tue Jun 14 18:41:18 2016 (r301895) +++ head/sys/ofed/drivers/infiniband/core/iwcm.c Tue Jun 14 20:58:05 2016 (r301896) @@ -266,9 +266,16 @@ static void add_ref(struct iw_cm_id *cm_ static void rem_ref(struct iw_cm_id *cm_id) { struct iwcm_id_private *cm_id_priv; + int cb_destroy; + cm_id_priv = container_of(cm_id, struct iwcm_id_private, id); - if (iwcm_deref_id(cm_id_priv) && - test_bit(IWCM_F_CALLBACK_DESTROY, &cm_id_priv->flags)) { + + /* + * Test bit before deref in case the cm_id gets freed on another + * thread. + */ + cb_destroy = test_bit(IWCM_F_CALLBACK_DESTROY, &cm_id_priv->flags); + if (iwcm_deref_id(cm_id_priv) && cb_destroy) { BUG_ON(!list_empty(&cm_id_priv->work_list)); free_cm_id(cm_id_priv); } @@ -1157,6 +1164,8 @@ static void cm_work_handler(struct work_ } return; } + if (empty) + return; spin_lock_irqsave(&cm_id_priv->lock, flags); } spin_unlock_irqrestore(&cm_id_priv->lock, flags); From owner-svn-src-all@freebsd.org Tue Jun 14 21:02:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E28EB72692; Tue, 14 Jun 2016 21:02:38 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8BD427B8; Tue, 14 Jun 2016 21:02:37 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5EL2bOZ016382; Tue, 14 Jun 2016 21:02:37 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5EL2bXb016381; Tue, 14 Jun 2016 21:02:37 GMT (envelope-from np@FreeBSD.org) Message-Id: <201606142102.u5EL2bXb016381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 14 Jun 2016 21:02:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301897 - head/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 21:02:38 -0000 Author: np Date: Tue Jun 14 21:02:36 2016 New Revision: 301897 URL: https://svnweb.freebsd.org/changeset/base/301897 Log: iw_cxgbe: Make sure that send_abort results in a TCP RST and not a FIN. Release the hold on ep->com immediately after sending the RST. This fixes a bug that sometimes leaves userspace iWARP tools hung when the user presses ^C. Submitted by: Krishnamraju Eraparaju @ Chelsio Approved by: re (gjb@) Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/cm.c Tue Jun 14 20:58:05 2016 (r301896) +++ head/sys/dev/cxgbe/iw_cxgbe/cm.c Tue Jun 14 21:02:36 2016 (r301897) @@ -760,7 +760,7 @@ process_socket_event(struct c4iw_ep *ep) } /* peer close */ - if ((so->so_rcv.sb_state & SBS_CANTRCVMORE) && state < CLOSING) { + if ((so->so_rcv.sb_state & SBS_CANTRCVMORE) && state <= CLOSING) { process_peer_close(ep); return; } @@ -1223,9 +1223,23 @@ static int send_abort(struct c4iw_ep *ep CTR2(KTR_IW_CXGBE, "%s:abB %p", __func__, ep); abort_socket(ep); - err = close_socket(&ep->com, 0); + + /* + * Since socket options were set as l_onoff=1 and l_linger=0 in in + * abort_socket, invoking soclose here sends a RST (reset) to the peer. + */ + err = close_socket(&ep->com, 1); set_bit(ABORT_CONN, &ep->com.history); CTR2(KTR_IW_CXGBE, "%s:abE %p", __func__, ep); + + /* + * TBD: iw_cgbe driver should receive ABORT reply for every ABORT + * request it has sent. But the current TOE driver is not propagating + * this ABORT reply event (via do_abort_rpl) to iw_cxgbe. So as a work- + * around de-refer 'ep' (which was refered before sending ABORT request) + * here instead of doing it in abort_rpl() handler of iw_cxgbe driver. + */ + c4iw_put_ep(&ep->com); return err; } From owner-svn-src-all@freebsd.org Tue Jun 14 21:09:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D6D6B7271E; Tue, 14 Jun 2016 21:09:02 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D328829AC; Tue, 14 Jun 2016 21:09:01 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5EL91AV016644; Tue, 14 Jun 2016 21:09:01 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5EL91xm016643; Tue, 14 Jun 2016 21:09:01 GMT (envelope-from np@FreeBSD.org) Message-Id: <201606142109.u5EL91xm016643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 14 Jun 2016 21:09:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301898 - head/sys/dev/cxgbe/tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 21:09:02 -0000 Author: np Date: Tue Jun 14 21:09:00 2016 New Revision: 301898 URL: https://svnweb.freebsd.org/changeset/base/301898 Log: cxgbe/t4_tom: Fix inverted assertion in r300895. It is RDMA connections and not others that are allowed to fail the receive window check. Approved by: re (gjb@) Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Jun 14 21:02:36 2016 (r301897) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Jun 14 21:09:00 2016 (r301898) @@ -1418,7 +1418,7 @@ do_rx_data(struct sge_iq *iq, const stru tp->rcv_nxt += len; if (tp->rcv_wnd < len) { - KASSERT(toep->ulp_mode != ULP_MODE_RDMA, + KASSERT(toep->ulp_mode == ULP_MODE_RDMA, ("%s: negative window size", __func__)); } From owner-svn-src-all@freebsd.org Tue Jun 14 23:41:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40C6CAF08F9; Tue, 14 Jun 2016 23:41:09 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0DC462A51; Tue, 14 Jun 2016 23:41:08 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5ENf8PB071916; Tue, 14 Jun 2016 23:41:08 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5ENf81w071915; Tue, 14 Jun 2016 23:41:08 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606142341.u5ENf81w071915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 14 Jun 2016 23:41:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r301899 - in vendor/amd/dist: . amd amq conf/checkmount conf/fh_dref conf/hn_dref conf/mount conf/mtab conf/nfs_prot conf/sa_dref conf/transp conf/trap conf/umount doc fixmount fsinfo h... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 23:41:09 -0000 Author: pfg Date: Tue Jun 14 23:41:07 2016 New Revision: 301899 URL: https://svnweb.freebsd.org/changeset/base/301899 Log: am-utils: Disable keyword expansion. As recommended in the Committers guide section 5.4.4.1.2. Modified: Directory Properties: vendor/amd/dist/AUTHORS (props changed) vendor/amd/dist/BUGS (props changed) vendor/amd/dist/COPYING (props changed) vendor/amd/dist/ChangeLog (props changed) vendor/amd/dist/FAQ (props changed) vendor/amd/dist/INSTALL (props changed) vendor/amd/dist/MIRRORS.html (props changed) vendor/amd/dist/MIRRORS.txt (props changed) vendor/amd/dist/NEWS (props changed) vendor/amd/dist/README (props changed) vendor/amd/dist/README.attrcache (props changed) vendor/amd/dist/README.ldap (props changed) vendor/amd/dist/README.y2k (props changed) vendor/amd/dist/TODO (props changed) vendor/amd/dist/amd/am_ops.c (props changed) vendor/amd/dist/amd/amd.8 (props changed) vendor/amd/dist/amd/amd.c (props changed) vendor/amd/dist/amd/amd.h (props changed) vendor/amd/dist/amd/amfs_auto.c (props changed) vendor/amd/dist/amd/amfs_direct.c (props changed) vendor/amd/dist/amd/amfs_error.c (props changed) vendor/amd/dist/amd/amfs_generic.c (props changed) vendor/amd/dist/amd/amfs_host.c (props changed) vendor/amd/dist/amd/amfs_link.c (props changed) vendor/amd/dist/amd/amfs_linkx.c (props changed) vendor/amd/dist/amd/amfs_nfsl.c (props changed) vendor/amd/dist/amd/amfs_nfsx.c (props changed) vendor/amd/dist/amd/amfs_program.c (props changed) vendor/amd/dist/amd/amfs_root.c (props changed) vendor/amd/dist/amd/amfs_toplvl.c (props changed) vendor/amd/dist/amd/amfs_union.c (props changed) vendor/amd/dist/amd/amq_subr.c (props changed) vendor/amd/dist/amd/amq_svc.c (props changed) vendor/amd/dist/amd/autil.c (props changed) vendor/amd/dist/amd/clock.c (props changed) vendor/amd/dist/amd/conf.c (props changed) vendor/amd/dist/amd/conf_parse.y (props changed) vendor/amd/dist/amd/conf_tok.l (props changed) vendor/amd/dist/amd/get_args.c (props changed) vendor/amd/dist/amd/info_exec.c (props changed) vendor/amd/dist/amd/info_file.c (props changed) vendor/amd/dist/amd/info_hesiod.c (props changed) vendor/amd/dist/amd/info_ldap.c (props changed) vendor/amd/dist/amd/info_ndbm.c (props changed) vendor/amd/dist/amd/info_nis.c (props changed) vendor/amd/dist/amd/info_nisplus.c (props changed) vendor/amd/dist/amd/info_passwd.c (props changed) vendor/amd/dist/amd/info_union.c (props changed) vendor/amd/dist/amd/map.c (props changed) vendor/amd/dist/amd/mapc.c (props changed) vendor/amd/dist/amd/mntfs.c (props changed) vendor/amd/dist/amd/nfs_prot_svc.c (props changed) vendor/amd/dist/amd/nfs_start.c (props changed) vendor/amd/dist/amd/nfs_subr.c (props changed) vendor/amd/dist/amd/ops_TEMPLATE.c (props changed) vendor/amd/dist/amd/ops_autofs.c (props changed) vendor/amd/dist/amd/ops_cachefs.c (props changed) vendor/amd/dist/amd/ops_cdfs.c (props changed) vendor/amd/dist/amd/ops_efs.c (props changed) vendor/amd/dist/amd/ops_lofs.c (props changed) vendor/amd/dist/amd/ops_mfs.c (props changed) vendor/amd/dist/amd/ops_nfs.c (props changed) vendor/amd/dist/amd/ops_nfs3.c (props changed) vendor/amd/dist/amd/ops_nullfs.c (props changed) vendor/amd/dist/amd/ops_pcfs.c (props changed) vendor/amd/dist/amd/ops_tfs.c (props changed) vendor/amd/dist/amd/ops_tmpfs.c (props changed) vendor/amd/dist/amd/ops_ufs.c (props changed) vendor/amd/dist/amd/ops_umapfs.c (props changed) vendor/amd/dist/amd/ops_unionfs.c (props changed) vendor/amd/dist/amd/ops_xfs.c (props changed) vendor/amd/dist/amd/opts.c (props changed) vendor/amd/dist/amd/readdir.c (props changed) vendor/amd/dist/amd/restart.c (props changed) vendor/amd/dist/amd/rpc_fwd.c (props changed) vendor/amd/dist/amd/sched.c (props changed) vendor/amd/dist/amd/srvr_amfs_auto.c (props changed) vendor/amd/dist/amd/srvr_nfs.c (props changed) vendor/amd/dist/amq/amq.8 (props changed) vendor/amd/dist/amq/amq.c (props changed) vendor/amd/dist/amq/amq.h (props changed) vendor/amd/dist/amq/amq_clnt.c (props changed) vendor/amd/dist/amq/amq_xdr.c (props changed) vendor/amd/dist/amq/pawd.1 (props changed) vendor/amd/dist/amq/pawd.c (props changed) vendor/amd/dist/aux_conf.h.in (props changed) vendor/amd/dist/bootstrap (props changed) vendor/amd/dist/conf/checkmount/checkmount_bsd44.c (props changed) vendor/amd/dist/conf/fh_dref/fh_dref_freebsd22.h (props changed) vendor/amd/dist/conf/hn_dref/hn_dref_default.h (props changed) vendor/amd/dist/conf/mount/mount_default.c (props changed) vendor/amd/dist/conf/mount/mount_freebsd3.c (props changed) vendor/amd/dist/conf/mtab/mtab_bsd.c (props changed) vendor/amd/dist/conf/nfs_prot/nfs_prot_aix5_1.h (props changed) vendor/amd/dist/conf/nfs_prot/nfs_prot_darwin.h (props changed) vendor/amd/dist/conf/nfs_prot/nfs_prot_freebsd2.h (props changed) vendor/amd/dist/conf/nfs_prot/nfs_prot_freebsd3.h (props changed) vendor/amd/dist/conf/nfs_prot/nfs_prot_osf5.h (props changed) vendor/amd/dist/conf/nfs_prot/nfs_prot_sunos5_8.h (props changed) vendor/amd/dist/conf/sa_dref/sa_dref_bsd44.h (props changed) vendor/amd/dist/conf/transp/transp_sockets.c (props changed) vendor/amd/dist/conf/trap/trap_default.h (props changed) vendor/amd/dist/conf/trap/trap_freebsd3.h (props changed) vendor/amd/dist/conf/umount/umount_bsd44.c (props changed) vendor/amd/dist/cvs-server.txt (props changed) vendor/amd/dist/doc/am-utils.texi (props changed) vendor/amd/dist/doc/stamp-vti (props changed) vendor/amd/dist/doc/texinfo.tex (props changed) vendor/amd/dist/doc/version.texi (props changed) vendor/amd/dist/fixmount/fixmount.8 (props changed) vendor/amd/dist/fixmount/fixmount.c (props changed) vendor/amd/dist/fsinfo/fsi_analyze.c (props changed) vendor/amd/dist/fsinfo/fsi_data.h (props changed) vendor/amd/dist/fsinfo/fsi_dict.c (props changed) vendor/amd/dist/fsinfo/fsi_gram.y (props changed) vendor/amd/dist/fsinfo/fsi_lex.l (props changed) vendor/amd/dist/fsinfo/fsi_util.c (props changed) vendor/amd/dist/fsinfo/fsinfo.8 (props changed) vendor/amd/dist/fsinfo/fsinfo.c (props changed) vendor/amd/dist/fsinfo/fsinfo.h (props changed) vendor/amd/dist/fsinfo/wr_atab.c (props changed) vendor/amd/dist/fsinfo/wr_bparam.c (props changed) vendor/amd/dist/fsinfo/wr_dumpset.c (props changed) vendor/amd/dist/fsinfo/wr_exportfs.c (props changed) vendor/amd/dist/fsinfo/wr_fstab.c (props changed) vendor/amd/dist/hlfsd/hlfsd.8 (props changed) vendor/amd/dist/hlfsd/hlfsd.c (props changed) vendor/amd/dist/hlfsd/hlfsd.h (props changed) vendor/amd/dist/hlfsd/homedir.c (props changed) vendor/amd/dist/hlfsd/nfs_prot_svc.c (props changed) vendor/amd/dist/hlfsd/stubs.c (props changed) vendor/amd/dist/include/am_compat.h (props changed) vendor/amd/dist/include/am_defs.h (props changed) vendor/amd/dist/include/am_utils.h (props changed) vendor/amd/dist/include/am_xdr_func.h (props changed) vendor/amd/dist/include/amq_defs.h (props changed) vendor/amd/dist/include/mount_headers1.h (props changed) vendor/amd/dist/include/mount_headers2.h (props changed) vendor/amd/dist/ldap-id.ms (props changed) vendor/amd/dist/ldap-id.txt (props changed) vendor/amd/dist/ldap.schema (props changed) vendor/amd/dist/libamu/alloca.c (props changed) vendor/amd/dist/libamu/amu.h (props changed) vendor/amd/dist/libamu/clnt_sperrno.c (props changed) vendor/amd/dist/libamu/hasmntopt.c (props changed) vendor/amd/dist/libamu/misc_rpc.c (props changed) vendor/amd/dist/libamu/mount_fs.c (props changed) vendor/amd/dist/libamu/mtab.c (props changed) vendor/amd/dist/libamu/nfs_prot_xdr.c (props changed) vendor/amd/dist/libamu/strerror.c (props changed) vendor/amd/dist/libamu/strutil.c (props changed) vendor/amd/dist/libamu/wire.c (props changed) vendor/amd/dist/libamu/xdr_func.c (props changed) vendor/amd/dist/libamu/xutil.c (props changed) vendor/amd/dist/mk-amd-map/mk-amd-map.8 (props changed) vendor/amd/dist/mk-amd-map/mk-amd-map.c (props changed) vendor/amd/dist/scripts/Makefile.am (props changed) vendor/amd/dist/scripts/Makefile.in (props changed) vendor/amd/dist/scripts/am-eject.in (props changed) vendor/amd/dist/scripts/amd.conf-sample (props changed) vendor/amd/dist/scripts/amd.conf.5 (props changed) vendor/amd/dist/scripts/amd2ldif.in (props changed) vendor/amd/dist/scripts/amd2sun.in (props changed) vendor/amd/dist/scripts/automount2amd.8 (props changed) vendor/amd/dist/scripts/automount2amd.in (props changed) vendor/amd/dist/scripts/ctl-amd.in (props changed) vendor/amd/dist/scripts/ctl-hlfsd.in (props changed) vendor/amd/dist/scripts/expn.1 (props changed) vendor/amd/dist/scripts/expn.in (props changed) vendor/amd/dist/scripts/fix-amd-map.in (props changed) vendor/amd/dist/scripts/fixrmtab (props changed) vendor/amd/dist/scripts/fixrmtab.in (props changed) vendor/amd/dist/scripts/lostaltmail.conf-sample (props changed) vendor/amd/dist/scripts/lostaltmail.in (props changed) vendor/amd/dist/scripts/redhat-ctl-amd.in (props changed) vendor/amd/dist/scripts/test-attrcache.in (props changed) vendor/amd/dist/scripts/wait4amd.in (props changed) vendor/amd/dist/scripts/wait4amd2die.in (props changed) vendor/amd/dist/tasks (props changed) vendor/amd/dist/vers.m4 (props changed) vendor/amd/dist/wire-test/wire-test.8 (props changed) vendor/amd/dist/wire-test/wire-test.c (props changed) From owner-svn-src-all@freebsd.org Tue Jun 14 23:52:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA4ABAF0AF6; Tue, 14 Jun 2016 23:52:33 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 836022FC0; Tue, 14 Jun 2016 23:52:33 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5ENqWQA078197; Tue, 14 Jun 2016 23:52:32 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5ENqWhP078196; Tue, 14 Jun 2016 23:52:32 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201606142352.u5ENqWhP078196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Tue, 14 Jun 2016 23:52:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301900 - head/contrib/bmake X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 23:52:33 -0000 Author: sjg Date: Tue Jun 14 23:52:32 2016 New Revision: 301900 URL: https://svnweb.freebsd.org/changeset/base/301900 Log: meta_oodate: set needOODATE if oodate due to missing .meta file. Reviewed by: bdrewery Approved by: re Modified: head/contrib/bmake/meta.c Modified: head/contrib/bmake/meta.c ============================================================================== --- head/contrib/bmake/meta.c Tue Jun 14 23:41:07 2016 (r301899) +++ head/contrib/bmake/meta.c Tue Jun 14 23:52:32 2016 (r301900) @@ -1474,6 +1474,7 @@ meta_oodate(GNode *gn, Boolean oodate) if (DEBUG(META)) fprintf(debug_file, "%s: required but missing\n", fname); oodate = TRUE; + needOODATE = TRUE; /* assume the worst */ } } } From owner-svn-src-all@freebsd.org Tue Jun 14 23:58:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A12AAF0D71; Tue, 14 Jun 2016 23:58:04 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 17539215E; Tue, 14 Jun 2016 23:58:04 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5ENw3uJ078457; Tue, 14 Jun 2016 23:58:03 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5ENw3uJ078455; Tue, 14 Jun 2016 23:58:03 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201606142358.u5ENw3uJ078455@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Tue, 14 Jun 2016 23:58:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r301901 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 23:58:04 -0000 Author: gnn Date: Tue Jun 14 23:58:02 2016 New Revision: 301901 URL: https://svnweb.freebsd.org/changeset/base/301901 Log: Add Mike Karels (karels@) with myself as his mentor. Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Tue Jun 14 23:52:32 2016 (r301900) +++ svnadmin/conf/access Tue Jun 14 23:58:02 2016 (r301901) @@ -138,6 +138,7 @@ jwd kadesai kaiw kan +karels ken kensmith kevlo Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Tue Jun 14 23:52:32 2016 (r301900) +++ svnadmin/conf/mentors Tue Jun 14 23:58:02 2016 (r301901) @@ -22,6 +22,7 @@ jkh rwatson jonathan rwatson jwd rmacklem kadesai ken Co-mentor: scottl, ambrisko +karels gnn landonf adrian mahrens mckusick manu andrew Co-mentor: cognet From owner-svn-src-all@freebsd.org Wed Jun 15 01:39:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16824B72622; Wed, 15 Jun 2016 01:39:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB5572987; Wed, 15 Jun 2016 01:39:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5F1diTX014901; Wed, 15 Jun 2016 01:39:44 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5F1di2R014900; Wed, 15 Jun 2016 01:39:44 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201606150139.u5F1di2R014900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 15 Jun 2016 01:39:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301902 - stable/10/sys/dev/ntb/if_ntb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 01:39:45 -0000 Author: mav Date: Wed Jun 15 01:39:43 2016 New Revision: 301902 URL: https://svnweb.freebsd.org/changeset/base/301902 Log: MFC r300610: Re-enable write combining, disabled by default at r295486. if_ntb(4) strongly benefits from WC, improving throughput from 350Mbit/s to 8-10Gbit/s on my tests. Modified: stable/10/sys/dev/ntb/if_ntb/if_ntb.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- stable/10/sys/dev/ntb/if_ntb/if_ntb.c Tue Jun 14 23:58:02 2016 (r301901) +++ stable/10/sys/dev/ntb/if_ntb/if_ntb.c Wed Jun 15 01:39:43 2016 (r301902) @@ -621,6 +621,10 @@ ntb_transport_probe(struct ntb_softc *nt mw->xlat_size = 0; mw->virt_addr = NULL; mw->dma_addr = 0; + + rc = ntb_mw_set_wc(nt->ntb, i, VM_MEMATTR_WRITE_COMBINING); + if (rc) + ntb_printf(0, "Unable to set mw%d caching\n", i); } qp_bitmap = ntb_db_valid_mask(ntb); From owner-svn-src-all@freebsd.org Wed Jun 15 01:41:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E739EB72733; Wed, 15 Jun 2016 01:41:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B83182DA4; Wed, 15 Jun 2016 01:41:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5F1fhmM016268; Wed, 15 Jun 2016 01:41:43 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5F1fhLr016267; Wed, 15 Jun 2016 01:41:43 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201606150141.u5F1fhLr016267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 15 Jun 2016 01:41:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301903 - stable/10/sys/dev/ntb/ntb_hw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 01:41:45 -0000 Author: mav Date: Wed Jun 15 01:41:43 2016 New Revision: 301903 URL: https://svnweb.freebsd.org/changeset/base/301903 Log: MFC r301292: When negotiating MSIX parameters, give other head time to see our NTB_MSIX_RECEIVED status, before making upper layers overwrite it. This is not completely perfect, but now it works better then before. Sponsored by: iXsystems, Inc. Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Wed Jun 15 01:39:43 2016 (r301902) +++ stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Wed Jun 15 01:41:43 2016 (r301903) @@ -2820,6 +2820,8 @@ ntb_exchange_msix(void *ctx) ntb = ctx; + if (ntb->peer_msix_good) + goto msix_good; if (ntb->peer_msix_done) goto msix_done; @@ -2851,16 +2853,21 @@ msix_done: goto reschedule; ntb->peer_msix_good = true; + /* Give peer time to see our NTB_MSIX_RECEIVED. */ + goto reschedule; +msix_good: ntb_poll_link(ntb); ntb_link_event(ntb); return; reschedule: ntb->lnk_sta = pci_read_config(ntb->device, ntb->reg->lnk_sta, 2); - if (_xeon_link_is_up(ntb)) - callout_reset(&ntb->peer_msix_work, hz / 100, ntb_exchange_msix, ntb); - else + if (_xeon_link_is_up(ntb)) { + callout_reset(&ntb->peer_msix_work, + hz * (ntb->peer_msix_good ? 2 : 1) / 100, + ntb_exchange_msix, ntb); + } else ntb_spad_clear(ntb); } From owner-svn-src-all@freebsd.org Wed Jun 15 01:42:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E26D4B72872; Wed, 15 Jun 2016 01:42:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1EC12F93; Wed, 15 Jun 2016 01:42:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5F1grwX018524; Wed, 15 Jun 2016 01:42:53 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5F1grIs018523; Wed, 15 Jun 2016 01:42:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201606150142.u5F1grIs018523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 15 Jun 2016 01:42:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301904 - stable/10/sys/dev/ntb/ntb_hw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 01:42:55 -0000 Author: mav Date: Wed Jun 15 01:42:53 2016 New Revision: 301904 URL: https://svnweb.freebsd.org/changeset/base/301904 Log: MFC r301293: When negotiating NTB_SB01BASE_LOCKUP workaround, don't try to limit the BAR size to 1MB. According to Xeon v3 specifications and my tests, that size register is write-once and so not writeable after BIOS written it. Instead of that, make the code work with BAR of any sufficient size, properly calculating offset within its base. It also simplifies the code. Sponsored by: iXsystems, Inc. Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Wed Jun 15 01:41:43 2016 (r301903) +++ stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Wed Jun 15 01:42:53 2016 (r301904) @@ -75,7 +75,6 @@ __FBSDID("$FreeBSD$"); #define NTB_MSIX_VER_GUARD 0xaabbccdd #define NTB_MSIX_RECEIVED 0xe0f0e0f0 -#define ONE_MB (1024u * 1024) /* * PCI constants could be somewhere more generic, but aren't defined/used in @@ -239,6 +238,7 @@ struct ntb_softc { /* Memory window used to access peer bar0 */ #define B2B_MW_DISABLED UINT8_MAX uint8_t b2b_mw_idx; + uint32_t msix_xlat; uint8_t msix_mw_idx; uint8_t mw_count; @@ -1375,12 +1375,12 @@ ntb_get_msix_info(struct ntb_softc *ntb) laddr = bus_read_4(msix->msix_table_res, offset + PCI_MSIX_ENTRY_LOWER_ADDR); - ntb_printf(2, "local lower MSIX addr(%u): 0x%x\n", i, laddr); + ntb_printf(2, "local MSIX addr(%u): 0x%x\n", i, laddr); KASSERT((laddr & MSI_INTEL_ADDR_BASE) == MSI_INTEL_ADDR_BASE, ("local MSIX addr 0x%x not in MSI base 0x%x", laddr, MSI_INTEL_ADDR_BASE)); - ntb->msix_data[i].nmd_ofs = laddr & ~MSI_INTEL_ADDR_BASE; + ntb->msix_data[i].nmd_ofs = laddr; data = bus_read_4(msix->msix_table_res, offset + PCI_MSIX_ENTRY_DATA); @@ -1674,15 +1674,6 @@ xeon_reset_sbar_size(struct ntb_softc *n bar_sz--; else bar_sz = 0; - } else if (HAS_FEATURE(NTB_SB01BASE_LOCKUP) && - ntb_mw_to_bar(ntb, ntb->msix_mw_idx) == idx) { - /* Restrict LAPIC BAR to 1MB */ - pci_write_config(ntb->device, bar->psz_off, 20, 1); - pci_write_config(ntb->device, bar->ssz_off, 20, 1); - bar_sz = pci_read_config(ntb->device, bar->psz_off, 1); - bar_sz = pci_read_config(ntb->device, bar->ssz_off, 1); - (void)bar_sz; - return; } pci_write_config(ntb->device, bar->ssz_off, bar_sz, 1); bar_sz = pci_read_config(ntb->device, bar->ssz_off, 1); @@ -1693,24 +1684,19 @@ static void xeon_set_sbar_base_and_limit(struct ntb_softc *ntb, uint64_t bar_addr, enum ntb_bar idx, enum ntb_bar regbar) { - uint64_t reg_val, lmt_addr; + uint64_t reg_val; uint32_t base_reg, lmt_reg; bar_get_xlat_params(ntb, idx, &base_reg, NULL, &lmt_reg); if (idx == regbar) bar_addr += ntb->b2b_off; - lmt_addr = bar_addr; - - if (HAS_FEATURE(NTB_SB01BASE_LOCKUP) && - ntb_mw_to_bar(ntb, ntb->msix_mw_idx) == idx) - lmt_addr += ONE_MB; /* * Set limit registers first to avoid an errata where setting the base * registers locks the limit registers. */ if (!bar_is_64bit(ntb, idx)) { - ntb_reg_write(4, lmt_reg, lmt_addr); + ntb_reg_write(4, lmt_reg, bar_addr); reg_val = ntb_reg_read(4, lmt_reg); (void)reg_val; @@ -1718,7 +1704,7 @@ xeon_set_sbar_base_and_limit(struct ntb_ reg_val = ntb_reg_read(4, base_reg); (void)reg_val; } else { - ntb_reg_write(8, lmt_reg, lmt_addr); + ntb_reg_write(8, lmt_reg, bar_addr); reg_val = ntb_reg_read(8, lmt_reg); (void)reg_val; @@ -1747,31 +1733,13 @@ xeon_set_pbar_xlat(struct ntb_softc *ntb static int xeon_setup_msix_bar(struct ntb_softc *ntb) { - struct ntb_pci_bar_info *lapic_bar; enum ntb_bar bar_num; - int rc; if (!HAS_FEATURE(NTB_SB01BASE_LOCKUP)) return (0); bar_num = ntb_mw_to_bar(ntb, ntb->msix_mw_idx); - lapic_bar = &ntb->bar_info[bar_num]; - - /* Restrict LAPIC BAR to 1MB */ - if (lapic_bar->size > ONE_MB) { - rc = bus_adjust_resource(ntb->device, SYS_RES_MEMORY, - lapic_bar->pci_resource, lapic_bar->pbase, - lapic_bar->pbase + ONE_MB - 1); - if (rc == 0) - lapic_bar->size = ONE_MB; - else { - ntb_printf(0, "Failed to shrink LAPIC BAR resource to " - "1 MB: %d\n", rc); - /* Ignore error */ - } - } - - ntb->peer_lapic_bar = lapic_bar; + ntb->peer_lapic_bar = &ntb->bar_info[bar_num]; return (0); } @@ -1882,10 +1850,13 @@ xeon_setup_b2b_mw(struct ntb_softc *ntb, * We point the chosen MSIX MW BAR xlat to remote LAPIC for * workaround */ - if (size == 4) + if (size == 4) { ntb_reg_write(4, xlatoffset, MSI_INTEL_ADDR_BASE); - else + ntb->msix_xlat = ntb_reg_read(4, xlatoffset); + } else { ntb_reg_write(8, xlatoffset, MSI_INTEL_ADDR_BASE); + ntb->msix_xlat = ntb_reg_read(8, xlatoffset); + } } (void)ntb_reg_read(8, XEON_SBAR2XLAT_OFFSET); (void)ntb_reg_read(8, XEON_SBAR4XLAT_OFFSET); @@ -2829,7 +2800,7 @@ ntb_exchange_msix(void *ctx) ntb_peer_spad_write(ntb, NTB_MSIX_DATA0 + i, ntb->msix_data[i].nmd_data); ntb_peer_spad_write(ntb, NTB_MSIX_OFS0 + i, - ntb->msix_data[i].nmd_ofs); + ntb->msix_data[i].nmd_ofs - ntb->msix_xlat); } ntb_peer_spad_write(ntb, NTB_MSIX_GUARD, NTB_MSIX_VER_GUARD); @@ -2839,8 +2810,10 @@ ntb_exchange_msix(void *ctx) for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { ntb_spad_read(ntb, NTB_MSIX_DATA0 + i, &val); + ntb_printf(2, "remote MSIX data(%u): 0x%x\n", i, val); ntb->peer_msix_data[i].nmd_data = val; ntb_spad_read(ntb, NTB_MSIX_OFS0 + i, &val); + ntb_printf(2, "remote MSIX addr(%u): 0x%x\n", i, val); ntb->peer_msix_data[i].nmd_ofs = val; } From owner-svn-src-all@freebsd.org Wed Jun 15 01:49:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E653FB72941; Wed, 15 Jun 2016 01:49:02 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C30152210; Wed, 15 Jun 2016 01:49:02 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5F1n2rU018855; Wed, 15 Jun 2016 01:49:02 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5F1n1eT018853; Wed, 15 Jun 2016 01:49:01 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201606150149.u5F1n1eT018853@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Wed, 15 Jun 2016 01:49:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301905 - in stable/10: lib/libc/sys sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 01:49:03 -0000 Author: jamie Date: Wed Jun 15 01:49:01 2016 New Revision: 301905 URL: https://svnweb.freebsd.org/changeset/base/301905 Log: MFC r300983: Mark jail(2), and the sysctls that it (and only it) uses as deprecated. jail(8) has long used jail_set(2), and those sysctl only cause confusion. Modified: stable/10/lib/libc/sys/jail.2 stable/10/sys/kern/kern_jail.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/jail.2 ============================================================================== --- stable/10/lib/libc/sys/jail.2 Wed Jun 15 01:42:53 2016 (r301904) +++ stable/10/lib/libc/sys/jail.2 Wed Jun 15 01:49:01 2016 (r301905) @@ -106,7 +106,7 @@ pointers can be set to an arrays of IPv4 the prison, or NULL if none. IPv4 addresses must be in network byte order. .Pp -This is equivalent to the +This is equivalent to, and deprecated in favor of, the .Fn jail_set system call (see below), with the parameters .Va path , Modified: stable/10/sys/kern/kern_jail.c ============================================================================== --- stable/10/sys/kern/kern_jail.c Wed Jun 15 01:42:53 2016 (r301904) +++ stable/10/sys/kern/kern_jail.c Wed Jun 15 01:49:01 2016 (r301905) @@ -4306,7 +4306,7 @@ SYSCTL_PROC(_security_jail, OID_AUTO, vn #if defined(INET) || defined(INET6) SYSCTL_UINT(_security_jail, OID_AUTO, jail_max_af_ips, CTLFLAG_RW, &jail_max_af_ips, 0, - "Number of IP addresses a jail may have at most per address family"); + "Number of IP addresses a jail may have at most per address family (deprecated)"); #endif /* @@ -4346,59 +4346,59 @@ sysctl_jail_default_allow(SYSCTL_HANDLER SYSCTL_PROC(_security_jail, OID_AUTO, set_hostname_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_SET_HOSTNAME, sysctl_jail_default_allow, "I", - "Processes in jail can set their hostnames"); + "Processes in jail can set their hostnames (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, socket_unixiproute_only, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, (void *)1, PR_ALLOW_SOCKET_AF, sysctl_jail_default_allow, "I", - "Processes in jail are limited to creating UNIX/IP/route sockets only"); + "Processes in jail are limited to creating UNIX/IP/route sockets only (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, sysvipc_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_SYSVIPC, sysctl_jail_default_allow, "I", - "Processes in jail can use System V IPC primitives"); + "Processes in jail can use System V IPC primitives (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, allow_raw_sockets, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_RAW_SOCKETS, sysctl_jail_default_allow, "I", - "Prison root can create raw sockets"); + "Prison root can create raw sockets (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, chflags_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_CHFLAGS, sysctl_jail_default_allow, "I", - "Processes in jail can alter system file flags"); + "Processes in jail can alter system file flags (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, mount_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_MOUNT, sysctl_jail_default_allow, "I", - "Processes in jail can mount/unmount jail-friendly file systems"); + "Processes in jail can mount/unmount jail-friendly file systems (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, mount_devfs_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_MOUNT_DEVFS, sysctl_jail_default_allow, "I", - "Processes in jail can mount the devfs file system"); + "Processes in jail can mount the devfs file system (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, mount_fdescfs_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_MOUNT_FDESCFS, sysctl_jail_default_allow, "I", - "Processes in jail can mount the fdescfs file system"); + "Processes in jail can mount the fdescfs file system (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, mount_nullfs_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_MOUNT_NULLFS, sysctl_jail_default_allow, "I", - "Processes in jail can mount the nullfs file system"); + "Processes in jail can mount the nullfs file system (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, mount_procfs_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_MOUNT_PROCFS, sysctl_jail_default_allow, "I", - "Processes in jail can mount the procfs file system"); + "Processes in jail can mount the procfs file system (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, mount_linprocfs_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_MOUNT_LINPROCFS, sysctl_jail_default_allow, "I", - "Processes in jail can mount the linprocfs file system"); + "Processes in jail can mount the linprocfs file system (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, mount_linsysfs_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_MOUNT_LINSYSFS, sysctl_jail_default_allow, "I", - "Processes in jail can mount the linsysfs file system"); + "Processes in jail can mount the linsysfs file system (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, mount_tmpfs_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_MOUNT_TMPFS, sysctl_jail_default_allow, "I", - "Processes in jail can mount the tmpfs file system"); + "Processes in jail can mount the tmpfs file system (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, mount_zfs_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_MOUNT_ZFS, sysctl_jail_default_allow, "I", - "Processes in jail can mount the zfs file system"); + "Processes in jail can mount the zfs file system (deprecated)"); static int sysctl_jail_default_level(SYSCTL_HANDLER_ARGS) @@ -4419,13 +4419,13 @@ SYSCTL_PROC(_security_jail, OID_AUTO, en CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, &jail_default_enforce_statfs, offsetof(struct prison, pr_enforce_statfs), sysctl_jail_default_level, "I", - "Processes in jail cannot see all mounted file systems"); + "Processes in jail cannot see all mounted file systems (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, devfs_ruleset, CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, &jail_default_devfs_rsnum, offsetof(struct prison, pr_devfs_rsnum), sysctl_jail_default_level, "I", - "Ruleset for the devfs filesystem in jail"); + "Ruleset for the devfs filesystem in jail (deprecated)"); /* * Nodes to describe jail parameters. Maximum length of string parameters From owner-svn-src-all@freebsd.org Wed Jun 15 01:54:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8FAFB72B8F; Wed, 15 Jun 2016 01:54:18 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B1B92846; Wed, 15 Jun 2016 01:54:18 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5F1sHCl022291; Wed, 15 Jun 2016 01:54:17 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5F1sH8F022290; Wed, 15 Jun 2016 01:54:17 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201606150154.u5F1sH8F022290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Wed, 15 Jun 2016 01:54:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301906 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 01:54:18 -0000 Author: jamie Date: Wed Jun 15 01:54:17 2016 New Revision: 301906 URL: https://svnweb.freebsd.org/changeset/base/301906 Log: MFC r301737: Remove a comment that was part of copied code, and is misleading in the new location. Modified: stable/10/sys/kern/sysv_msg.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/sysv_msg.c ============================================================================== --- stable/10/sys/kern/sysv_msg.c Wed Jun 15 01:49:01 2016 (r301905) +++ stable/10/sys/kern/sysv_msg.c Wed Jun 15 01:54:17 2016 (r301906) @@ -326,12 +326,6 @@ msgunload() #endif for (msqid = 0; msqid < msginfo.msgmni; msqid++) { - /* - * Look for an unallocated and unlocked msqid_ds. - * msqid_ds's can be locked by msgsnd or msgrcv while - * they are copying the message in/out. We can't - * re-use the entry until they release it. - */ msqkptr = &msqids[msqid]; if (msqkptr->u.msg_qbytes != 0 || (msqkptr->u.msg_perm.mode & MSG_LOCKED) != 0) From owner-svn-src-all@freebsd.org Wed Jun 15 01:56:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63435B72C3E; Wed, 15 Jun 2016 01:56:21 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 17EFD29CC; Wed, 15 Jun 2016 01:56:21 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5F1uKQ2022431; Wed, 15 Jun 2016 01:56:20 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5F1uKEq022430; Wed, 15 Jun 2016 01:56:20 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201606150156.u5F1uKEq022430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Wed, 15 Jun 2016 01:56:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301907 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 01:56:21 -0000 Author: jamie Date: Wed Jun 15 01:56:20 2016 New Revision: 301907 URL: https://svnweb.freebsd.org/changeset/base/301907 Log: MFC r301745: Make sure the OSD methods for jail set and remove can't run concurrently, by holding allprison_lock exclusively (even if only for a moment before downgrading) on all paths that call PR_METHOD_REMOVE. Since they may run on a downgraded lock, it's still possible for them to run concurrently with PR_METHOD_GET, which will need to use the prison lock. Modified: stable/10/sys/kern/kern_jail.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_jail.c ============================================================================== --- stable/10/sys/kern/kern_jail.c Wed Jun 15 01:54:17 2016 (r301906) +++ stable/10/sys/kern/kern_jail.c Wed Jun 15 01:56:20 2016 (r301907) @@ -2400,7 +2400,14 @@ sys_jail_attach(struct thread *td, struc if (error) return (error); - sx_slock(&allprison_lock); + /* + * Start with exclusive hold on allprison_lock to ensure that a possible + * PR_METHOD_REMOVE call isn't concurrent with jail_set or jail_remove. + * But then immediately downgrade it since we don't need to stop + * readers. + */ + sx_xlock(&allprison_lock); + sx_downgrade(&allprison_lock); pr = prison_find_child(td->td_ucred->cr_prison, uap->jid); if (pr == NULL) { sx_sunlock(&allprison_lock); @@ -2618,9 +2625,11 @@ prison_complete(void *context, int pendi { struct prison *pr = context; + sx_xlock(&allprison_lock); mtx_lock(&pr->pr_mtx); prison_deref(pr, pr->pr_uref - ? PD_DEREF | PD_DEUREF | PD_LOCKED : PD_LOCKED); + ? PD_DEREF | PD_DEUREF | PD_LOCKED | PD_LIST_XLOCKED + : PD_LOCKED | PD_LIST_XLOCKED); } /* @@ -2664,13 +2673,8 @@ prison_deref(struct prison *pr, int flag */ if (lasturef) { if (!(flags & (PD_LIST_SLOCKED | PD_LIST_XLOCKED))) { - if (ref > 1) { - sx_slock(&allprison_lock); - flags |= PD_LIST_SLOCKED; - } else { - sx_xlock(&allprison_lock); - flags |= PD_LIST_XLOCKED; - } + sx_xlock(&allprison_lock); + flags |= PD_LIST_XLOCKED; } (void)osd_jail_call(pr, PR_METHOD_REMOVE, NULL); mtx_lock(&pr->pr_mtx); From owner-svn-src-all@freebsd.org Wed Jun 15 01:57:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D83F1B72CC3; Wed, 15 Jun 2016 01:57:23 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A56B22B72; Wed, 15 Jun 2016 01:57:23 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5F1vMtJ022518; Wed, 15 Jun 2016 01:57:22 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5F1vMbb022517; Wed, 15 Jun 2016 01:57:22 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201606150157.u5F1vMbb022517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Wed, 15 Jun 2016 01:57:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301908 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 01:57:24 -0000 Author: jamie Date: Wed Jun 15 01:57:22 2016 New Revision: 301908 URL: https://svnweb.freebsd.org/changeset/base/301908 Log: MFC r301758: Clean up some logic in jail error messages, replacing a missing test and a redundant test with a single correct test. Modified: stable/10/sys/kern/kern_jail.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_jail.c ============================================================================== --- stable/10/sys/kern/kern_jail.c Wed Jun 15 01:56:20 2016 (r301907) +++ stable/10/sys/kern/kern_jail.c Wed Jun 15 01:57:22 2016 (r301908) @@ -1943,19 +1943,17 @@ kern_jail_set(struct thread *td, struct vrele(root); done_errmsg: if (error) { - vfs_getopt(opts, "errmsg", (void **)&errmsg, &errmsg_len); - if (errmsg_len > 0) { + if (vfs_getopt(opts, "errmsg", (void **)&errmsg, + &errmsg_len) == 0 && errmsg_len > 0) { errmsg_pos = 2 * vfs_getopt_pos(opts, "errmsg") + 1; - if (errmsg_pos > 0) { - if (optuio->uio_segflg == UIO_SYSSPACE) - bcopy(errmsg, - optuio->uio_iov[errmsg_pos].iov_base, - errmsg_len); - else - copyout(errmsg, - optuio->uio_iov[errmsg_pos].iov_base, - errmsg_len); - } + if (optuio->uio_segflg == UIO_SYSSPACE) + bcopy(errmsg, + optuio->uio_iov[errmsg_pos].iov_base, + errmsg_len); + else + copyout(errmsg, + optuio->uio_iov[errmsg_pos].iov_base, + errmsg_len); } } done_free: From owner-svn-src-all@freebsd.org Wed Jun 15 01:58:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FD0EB72D3E; Wed, 15 Jun 2016 01:58:55 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3231D2CEA; Wed, 15 Jun 2016 01:58:55 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5F1wsUN022631; Wed, 15 Jun 2016 01:58:54 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5F1wsiJ022630; Wed, 15 Jun 2016 01:58:54 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201606150158.u5F1wsiJ022630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Wed, 15 Jun 2016 01:58:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301909 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 01:58:55 -0000 Author: jamie Date: Wed Jun 15 01:58:54 2016 New Revision: 301909 URL: https://svnweb.freebsd.org/changeset/base/301909 Log: MFC r301760: Re-order some jail parameter reading to prevent a vnode leak. Modified: stable/10/sys/kern/kern_jail.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_jail.c ============================================================================== --- stable/10/sys/kern/kern_jail.c Wed Jun 15 01:57:22 2016 (r301908) +++ stable/10/sys/kern/kern_jail.c Wed Jun 15 01:58:54 2016 (r301909) @@ -932,6 +932,46 @@ kern_jail_set(struct thread *td, struct } #endif + error = vfs_getopt(opts, "osrelease", (void **)&osrelstr, &len); + if (error == ENOENT) + osrelstr = NULL; + else if (error != 0) + goto done_free; + else { + if (flags & JAIL_UPDATE) { + error = EINVAL; + vfs_opterror(opts, + "osrelease cannot be changed after creation"); + goto done_errmsg; + } + if (len == 0 || len >= OSRELEASELEN) { + error = EINVAL; + vfs_opterror(opts, + "osrelease string must be 1-%d bytes long", + OSRELEASELEN - 1); + goto done_errmsg; + } + } + + error = vfs_copyopt(opts, "osreldate", &osreldt, sizeof(osreldt)); + if (error == ENOENT) + osreldt = 0; + else if (error != 0) + goto done_free; + else { + if (flags & JAIL_UPDATE) { + error = EINVAL; + vfs_opterror(opts, + "osreldate cannot be changed after creation"); + goto done_errmsg; + } + if (osreldt == 0) { + error = EINVAL; + vfs_opterror(opts, "osreldate cannot be 0"); + goto done_errmsg; + } + } + fullpath_disabled = 0; root = NULL; error = vfs_getopt(opts, "path", (void **)&path, &len); @@ -987,46 +1027,6 @@ kern_jail_set(struct thread *td, struct } } - error = vfs_getopt(opts, "osrelease", (void **)&osrelstr, &len); - if (error == ENOENT) - osrelstr = NULL; - else if (error != 0) - goto done_free; - else { - if (flags & JAIL_UPDATE) { - error = EINVAL; - vfs_opterror(opts, - "osrelease cannot be changed after creation"); - goto done_errmsg; - } - if (len == 0 || len >= OSRELEASELEN) { - error = EINVAL; - vfs_opterror(opts, - "osrelease string must be 1-%d bytes long", - OSRELEASELEN - 1); - goto done_errmsg; - } - } - - error = vfs_copyopt(opts, "osreldate", &osreldt, sizeof(osreldt)); - if (error == ENOENT) - osreldt = 0; - else if (error != 0) - goto done_free; - else { - if (flags & JAIL_UPDATE) { - error = EINVAL; - vfs_opterror(opts, - "osreldate cannot be changed after creation"); - goto done_errmsg; - } - if (osreldt == 0) { - error = EINVAL; - vfs_opterror(opts, "osreldate cannot be 0"); - goto done_errmsg; - } - } - /* * Find the specified jail, or at least its parent. * This abuses the file error codes ENOENT and EEXIST. From owner-svn-src-all@freebsd.org Wed Jun 15 01:59:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80F47B72DA1; Wed, 15 Jun 2016 01:59:56 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4EA1C2E51; Wed, 15 Jun 2016 01:59:56 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5F1xt1r022718; Wed, 15 Jun 2016 01:59:55 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5F1xtxh022717; Wed, 15 Jun 2016 01:59:55 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201606150159.u5F1xtxh022717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Wed, 15 Jun 2016 01:59:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301910 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 01:59:56 -0000 Author: jamie Date: Wed Jun 15 01:59:55 2016 New Revision: 301910 URL: https://svnweb.freebsd.org/changeset/base/301910 Log: MFC r301764: Fix a vnode leak when giving a child jail a too-long path when debug.disablefullpath=1. Modified: stable/10/sys/kern/kern_jail.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_jail.c ============================================================================== --- stable/10/sys/kern/kern_jail.c Wed Jun 15 01:58:54 2016 (r301909) +++ stable/10/sys/kern/kern_jail.c Wed Jun 15 01:59:55 2016 (r301910) @@ -1022,6 +1022,7 @@ kern_jail_set(struct thread *td, struct if (len + (path[0] == '/' && strcmp(mypr->pr_path, "/") ? strlen(mypr->pr_path) : 0) > MAXPATHLEN) { error = ENAMETOOLONG; + vrele(root); goto done_free; } } From owner-svn-src-all@freebsd.org Wed Jun 15 03:17:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20ABAB728A0; Wed, 15 Jun 2016 03:17:07 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F19982FEB; Wed, 15 Jun 2016 03:17:06 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5F3H6ii051850; Wed, 15 Jun 2016 03:17:06 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5F3H5gT051847; Wed, 15 Jun 2016 03:17:05 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606150317.u5F3H5gT051847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 15 Jun 2016 03:17:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301911 - in stable/10/sys/dev/hyperv: netvsc vmbus X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 03:17:07 -0000 Author: sephe Date: Wed Jun 15 03:17:05 2016 New Revision: 301911 URL: https://svnweb.freebsd.org/changeset/base/301911 Log: MFC 296022,296024,296076 296022 hyperv/hn: Implement ifnet.if_transmit method It will be turned on by default later. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5415 296024 hyperv/hn: Hold the TX ring lock then drain TX desc buf_ring Reported by: Hongxiong Xian MFC after: 1 week Sponsored by: Microsoft OSTC 296076 hyperv: Use atomic_fetchadd_int to get GPADL id. Reviewed by: Hongjiang Zhang MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5439 Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c stable/10/sys/dev/hyperv/vmbus/hv_channel.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h Wed Jun 15 01:59:55 2016 (r301910) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h Wed Jun 15 03:17:05 2016 (r301911) @@ -1034,6 +1034,9 @@ struct hn_tx_ring { struct task hn_tx_task; struct task hn_txeof_task; + struct buf_ring *hn_mbuf_br; + int hn_oactive; + struct mtx hn_tx_lock; struct hn_softc *hn_sc; Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Jun 15 01:59:55 2016 (r301910) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Jun 15 03:17:05 2016 (r301911) @@ -274,6 +274,10 @@ static int hn_bind_tx_taskq = -1; SYSCTL_INT(_hw_hn, OID_AUTO, bind_tx_taskq, CTLFLAG_RDTUN, &hn_bind_tx_taskq, 0, "Bind TX taskqueue to the specified cpu"); +static int hn_use_if_start = 1; +SYSCTL_INT(_hw_hn, OID_AUTO, use_if_start, CTLFLAG_RDTUN, + &hn_use_if_start, 0, "Use if_start TX method"); + /* * Forward declarations */ @@ -313,6 +317,13 @@ static void hn_create_rx_data(struct hn_ static void hn_destroy_rx_data(struct hn_softc *sc); static void hn_set_tx_chimney_size(struct hn_softc *, int); +static int hn_transmit(struct ifnet *, struct mbuf *); +static void hn_xmit_qflush(struct ifnet *); +static int hn_xmit(struct hn_tx_ring *, int); +static void hn_xmit_txeof(struct hn_tx_ring *); +static void hn_xmit_taskfunc(void *, int); +static void hn_xmit_txeof_taskfunc(void *, int); + static int hn_ifmedia_upd(struct ifnet *ifp __unused) { @@ -444,13 +455,18 @@ netvsc_attach(device_t dev) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = hn_ioctl; - ifp->if_start = hn_start; ifp->if_init = hn_ifinit; /* needed by hv_rf_on_device_add() code */ ifp->if_mtu = ETHERMTU; - IFQ_SET_MAXLEN(&ifp->if_snd, 512); - ifp->if_snd.ifq_drv_maxlen = 511; - IFQ_SET_READY(&ifp->if_snd); + if (hn_use_if_start) { + ifp->if_start = hn_start; + IFQ_SET_MAXLEN(&ifp->if_snd, 512); + ifp->if_snd.ifq_drv_maxlen = 511; + IFQ_SET_READY(&ifp->if_snd); + } else { + ifp->if_transmit = hn_transmit; + ifp->if_qflush = hn_xmit_qflush; + } ifmedia_init(&sc->hn_media, 0, hn_ifmedia_upd, hn_ifmedia_sts); ifmedia_add(&sc->hn_media, IFM_ETHER | IFM_AUTO, 0, NULL); @@ -946,6 +962,12 @@ again: if (!error) { ETHER_BPF_MTAP(ifp, txd->m); if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); + if (!hn_use_if_start) { + if_inc_counter(ifp, IFCOUNTER_OBYTES, + txd->m->m_pkthdr.len); + if (txd->m->m_flags & M_MCAST) + if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1); + } } hn_txdesc_put(txr, txd); @@ -998,6 +1020,8 @@ hn_start_locked(struct hn_tx_ring *txr, struct ifnet *ifp = sc->hn_ifp; struct hv_device *device_ctx = vmbus_get_devctx(sc->hn_dev); + KASSERT(hn_use_if_start, + ("hn_start_locked is called, when if_start is disabled")); KASSERT(txr == &sc->hn_tx_ring[0], ("not the first TX ring")); mtx_assert(&txr->hn_tx_lock, MA_OWNED); @@ -1555,7 +1579,7 @@ static void hn_stop(hn_softc_t *sc) { struct ifnet *ifp; - int ret; + int ret, i; struct hv_device *device_ctx = vmbus_get_devctx(sc->hn_dev); ifp = sc->hn_ifp; @@ -1565,6 +1589,9 @@ hn_stop(hn_softc_t *sc) atomic_clear_int(&ifp->if_drv_flags, (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)); + for (i = 0; i < sc->hn_tx_ring_cnt; ++i) + sc->hn_tx_ring[i].hn_oactive = 0; + if_link_state_change(ifp, LINK_STATE_DOWN); sc->hn_initdone = 0; @@ -1637,7 +1664,7 @@ hn_ifinit_locked(hn_softc_t *sc) { struct ifnet *ifp; struct hv_device *device_ctx = vmbus_get_devctx(sc->hn_dev); - int ret; + int ret, i; ifp = sc->hn_ifp; @@ -1653,7 +1680,11 @@ hn_ifinit_locked(hn_softc_t *sc) } else { sc->hn_initdone = 1; } + atomic_clear_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); + for (i = 0; i < sc->hn_tx_ring_cnt; ++i) + sc->hn_tx_ring[i].hn_oactive = 0; + atomic_set_int(&ifp->if_drv_flags, IFF_DRV_RUNNING); if_link_state_change(ifp, LINK_STATE_UP); } @@ -2187,8 +2218,18 @@ hn_create_tx_ring(struct hn_softc *sc, i #endif txr->hn_tx_taskq = sc->hn_tx_taskq; - TASK_INIT(&txr->hn_tx_task, 0, hn_start_taskfunc, txr); - TASK_INIT(&txr->hn_txeof_task, 0, hn_start_txeof_taskfunc, txr); + + if (hn_use_if_start) { + txr->hn_txeof = hn_start_txeof; + TASK_INIT(&txr->hn_tx_task, 0, hn_start_taskfunc, txr); + TASK_INIT(&txr->hn_txeof_task, 0, hn_start_txeof_taskfunc, txr); + } else { + txr->hn_txeof = hn_xmit_txeof; + TASK_INIT(&txr->hn_tx_task, 0, hn_xmit_taskfunc, txr); + TASK_INIT(&txr->hn_txeof_task, 0, hn_xmit_txeof_taskfunc, txr); + txr->hn_mbuf_br = buf_ring_alloc(txr->hn_txdesc_cnt, M_NETVSC, + M_WAITOK, &txr->hn_tx_lock); + } txr->hn_direct_tx_size = hn_direct_tx_size; if (hv_vmbus_protocal_version >= HV_VMBUS_VERSION_WIN8_1) @@ -2202,8 +2243,6 @@ hn_create_tx_ring(struct hn_softc *sc, i */ txr->hn_sched_tx = 1; - txr->hn_txeof = hn_start_txeof; /* TODO: if_transmit */ - parent_dtag = bus_get_dma_tag(sc->hn_dev); /* DMA tag for RNDIS messages. */ @@ -2320,6 +2359,11 @@ hn_create_tx_ring(struct hn_softc *sc, i SYSCTL_ADD_INT(ctx, child, OID_AUTO, "txdesc_avail", CTLFLAG_RD, &txr->hn_txdesc_avail, 0, "# of available TX descs"); + if (!hn_use_if_start) { + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "oactive", + CTLFLAG_RD, &txr->hn_oactive, 0, + "over active"); + } } } @@ -2354,8 +2398,10 @@ hn_destroy_tx_ring(struct hn_tx_ring *tx hn_txdesc_dmamap_destroy(txd); } #else + mtx_lock(&txr->hn_tx_lock); while ((txd = buf_ring_dequeue_sc(txr->hn_txdesc_br)) != NULL) hn_txdesc_dmamap_destroy(txd); + mtx_unlock(&txr->hn_tx_lock); #endif if (txr->hn_tx_data_dtag != NULL) @@ -2370,6 +2416,9 @@ hn_destroy_tx_ring(struct hn_tx_ring *tx free(txr->hn_txdesc, M_NETVSC); txr->hn_txdesc = NULL; + if (txr->hn_mbuf_br != NULL) + buf_ring_free(txr->hn_mbuf_br, M_NETVSC); + #ifndef HN_USE_TXDESC_BUFRING mtx_destroy(&txr->hn_txlist_spin); #endif @@ -2383,7 +2432,12 @@ hn_create_tx_data(struct hn_softc *sc) struct sysctl_ctx_list *ctx; int i; - sc->hn_tx_ring_cnt = 1; /* TODO: vRSS */ + if (hn_use_if_start) { + /* ifnet.if_start only needs one TX ring */ + sc->hn_tx_ring_cnt = 1; + } else { + sc->hn_tx_ring_cnt = 1; /* TODO: vRSS */ + } sc->hn_tx_ring = malloc(sizeof(struct hn_tx_ring) * sc->hn_tx_ring_cnt, M_NETVSC, M_WAITOK | M_ZERO); @@ -2508,6 +2562,166 @@ hn_stop_tx_tasks(struct hn_softc *sc) } } +static int +hn_xmit(struct hn_tx_ring *txr, int len) +{ + struct hn_softc *sc = txr->hn_sc; + struct ifnet *ifp = sc->hn_ifp; + struct hv_device *device_ctx = vmbus_get_devctx(sc->hn_dev); + struct mbuf *m_head; + + mtx_assert(&txr->hn_tx_lock, MA_OWNED); + KASSERT(hn_use_if_start == 0, + ("hn_xmit is called, when if_start is enabled")); + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || txr->hn_oactive) + return 0; + + while ((m_head = drbr_peek(ifp, txr->hn_mbuf_br)) != NULL) { + struct hn_txdesc *txd; + int error; + + if (len > 0 && m_head->m_pkthdr.len > len) { + /* + * This sending could be time consuming; let callers + * dispatch this packet sending (and sending of any + * following up packets) to tx taskqueue. + */ + drbr_putback(ifp, txr->hn_mbuf_br, m_head); + return 1; + } + + txd = hn_txdesc_get(txr); + if (txd == NULL) { + txr->hn_no_txdescs++; + drbr_putback(ifp, txr->hn_mbuf_br, m_head); + txr->hn_oactive = 1; + break; + } + + error = hn_encap(txr, txd, &m_head); + if (error) { + /* Both txd and m_head are freed; discard */ + drbr_advance(ifp, txr->hn_mbuf_br); + continue; + } + + error = hn_send_pkt(ifp, device_ctx, txr, txd); + if (__predict_false(error)) { + /* txd is freed, but m_head is not */ + drbr_putback(ifp, txr->hn_mbuf_br, m_head); + txr->hn_oactive = 1; + break; + } + + /* Sent */ + drbr_advance(ifp, txr->hn_mbuf_br); + } + return 0; +} + +static int +hn_transmit(struct ifnet *ifp, struct mbuf *m) +{ + struct hn_softc *sc = ifp->if_softc; + struct hn_tx_ring *txr; + int error; + + /* TODO: vRSS, TX ring selection */ + txr = &sc->hn_tx_ring[0]; + + error = drbr_enqueue(ifp, txr->hn_mbuf_br, m); + if (error) + return error; + + if (txr->hn_oactive) + return 0; + + if (txr->hn_sched_tx) + goto do_sched; + + if (mtx_trylock(&txr->hn_tx_lock)) { + int sched; + + sched = hn_xmit(txr, txr->hn_direct_tx_size); + mtx_unlock(&txr->hn_tx_lock); + if (!sched) + return 0; + } +do_sched: + taskqueue_enqueue(txr->hn_tx_taskq, &txr->hn_tx_task); + return 0; +} + +static void +hn_xmit_qflush(struct ifnet *ifp) +{ + struct hn_softc *sc = ifp->if_softc; + int i; + + for (i = 0; i < sc->hn_tx_ring_cnt; ++i) { + struct hn_tx_ring *txr = &sc->hn_tx_ring[i]; + struct mbuf *m; + + mtx_lock(&txr->hn_tx_lock); + while ((m = buf_ring_dequeue_sc(txr->hn_mbuf_br)) != NULL) + m_freem(m); + mtx_unlock(&txr->hn_tx_lock); + } + if_qflush(ifp); +} + +static void +hn_xmit_txeof(struct hn_tx_ring *txr) +{ + + if (txr->hn_sched_tx) + goto do_sched; + + if (mtx_trylock(&txr->hn_tx_lock)) { + int sched; + + txr->hn_oactive = 0; + sched = hn_xmit(txr, txr->hn_direct_tx_size); + mtx_unlock(&txr->hn_tx_lock); + if (sched) { + taskqueue_enqueue(txr->hn_tx_taskq, + &txr->hn_tx_task); + } + } else { +do_sched: + /* + * Release the oactive earlier, with the hope, that + * others could catch up. The task will clear the + * oactive again with the hn_tx_lock to avoid possible + * races. + */ + txr->hn_oactive = 0; + taskqueue_enqueue(txr->hn_tx_taskq, &txr->hn_txeof_task); + } +} + +static void +hn_xmit_taskfunc(void *xtxr, int pending __unused) +{ + struct hn_tx_ring *txr = xtxr; + + mtx_lock(&txr->hn_tx_lock); + hn_xmit(txr, 0); + mtx_unlock(&txr->hn_tx_lock); +} + +static void +hn_xmit_txeof_taskfunc(void *xtxr, int pending __unused) +{ + struct hn_tx_ring *txr = xtxr; + + mtx_lock(&txr->hn_tx_lock); + txr->hn_oactive = 0; + hn_xmit(txr, 0); + mtx_unlock(&txr->hn_tx_lock); +} + static void hn_tx_taskq_create(void *arg __unused) { Modified: stable/10/sys/dev/hyperv/vmbus/hv_channel.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_channel.c Wed Jun 15 01:59:55 2016 (r301910) +++ stable/10/sys/dev/hyperv/vmbus/hv_channel.c Wed Jun 15 03:17:05 2016 (r301911) @@ -384,17 +384,22 @@ hv_vmbus_channel_establish_gpadl( hv_vmbus_channel_msg_info* curr; uint32_t next_gpadl_handle; - next_gpadl_handle = hv_vmbus_g_connection.next_gpadl_handle; - atomic_add_int((int*) &hv_vmbus_g_connection.next_gpadl_handle, 1); + next_gpadl_handle = atomic_fetchadd_int( + &hv_vmbus_g_connection.next_gpadl_handle, 1); ret = vmbus_channel_create_gpadl_header( contig_buffer, size, &msg_info, &msg_count); - if(ret != 0) { /* if(allocation failed) return immediately */ - /* reverse atomic_add_int above */ - atomic_subtract_int((int*) - &hv_vmbus_g_connection.next_gpadl_handle, 1); - return ret; + if(ret != 0) { + /* + * XXX + * We can _not_ even revert the above incremental, + * if multiple GPADL establishments are running + * parallelly, decrement the global next_gpadl_handle + * is calling for _big_ trouble. A better solution + * is to have a 0-based GPADL id bitmap ... + */ + return ret; } sema_init(&msg_info->wait_sema, 0, "Open Info Sema"); From owner-svn-src-all@freebsd.org Wed Jun 15 03:48:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00742B72EB3; Wed, 15 Jun 2016 03:48:58 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C07632E47; Wed, 15 Jun 2016 03:48:57 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5F3mvAS062862; Wed, 15 Jun 2016 03:48:57 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5F3musq062852; Wed, 15 Jun 2016 03:48:56 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606150348.u5F3musq062852@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 15 Jun 2016 03:48:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301912 - in stable/10/sys/dev/hyperv: include netvsc storvsc vmbus X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 03:48:58 -0000 Author: sephe Date: Wed Jun 15 03:48:55 2016 New Revision: 301912 URL: https://svnweb.freebsd.org/changeset/base/301912 Log: MFC 296083,296084,296085,296086,296087,296088,296089 296083 hyperv: Remove useless channel inbound_lock It serves no purpose. Reviewed by: Hongjiang Zhang MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5450 296084 hyperv: Always set device for channels And unregister hv_device only for primary channels, who own the hv_device. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5451 296085 hyperv/hn: Pass channel as the channel callback argument This is the preamble to pass channel back to hn(4) upon TX/RX done. Reviewed by: Hongjiang Zhang MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5452 296086 hyperv/hn: Pass channel to TX/RX done This is preamble to associate the TX/RX rings to their channel. While I'm here, revoke unused netvsc_recv_rollup. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5453 296087 hyperv/hn: Associate TX/RX ring with channel This fixes the TX/RX ring selection for TX/RX done. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5454 296088 hyperv/hn: Remove the useless num_outstanding_sends We rely on taskqueue draining now. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5456 296089 hyperv/hn: Make transmission path channel aware Chimney sending buffer still needs conversion, which will be done along with the upcoming vRSS support. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5457 Modified: stable/10/sys/dev/hyperv/include/hyperv.h stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c stable/10/sys/dev/hyperv/netvsc/hv_rndis.h stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.h stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c stable/10/sys/dev/hyperv/vmbus/hv_channel.c stable/10/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/include/hyperv.h ============================================================================== --- stable/10/sys/dev/hyperv/include/hyperv.h Wed Jun 15 03:17:05 2016 (r301911) +++ stable/10/sys/dev/hyperv/include/hyperv.h Wed Jun 15 03:48:55 2016 (r301912) @@ -753,8 +753,6 @@ typedef struct hv_vmbus_channel { */ hv_vmbus_ring_buffer_info inbound; - struct mtx inbound_lock; - struct taskqueue * rxq; struct task channel_task; hv_vmbus_pfn_channel_callback on_channel_callback; @@ -824,12 +822,16 @@ typedef struct hv_vmbus_channel { * This will be NULL for the primary channel. */ struct hv_vmbus_channel *primary_channel; + /* - * Support per channel state for use by vmbus drivers. + * Driver private data */ - void *per_channel_state; + void *hv_chan_priv1; + void *hv_chan_priv2; } hv_vmbus_channel; +#define HV_VMBUS_CHAN_ISPRIMARY(chan) ((chan)->primary_channel == NULL) + static inline void hv_set_channel_read_state(hv_vmbus_channel* channel, boolean_t state) { Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c Wed Jun 15 03:17:05 2016 (r301911) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c Wed Jun 15 03:48:55 2016 (r301912) @@ -62,7 +62,8 @@ static int hv_nv_connect_to_vsp(struct static void hv_nv_on_send_completion(netvsc_dev *net_dev, struct hv_device *device, hv_vm_packet_descriptor *pkt); static void hv_nv_on_receive(netvsc_dev *net_dev, - struct hv_device *device, hv_vm_packet_descriptor *pkt); + struct hv_device *device, struct hv_vmbus_channel *chan, + hv_vm_packet_descriptor *pkt); /* * @@ -115,7 +116,7 @@ hv_nv_get_inbound_net_device(struct hv_d * permit incoming packets if and only if there * are outstanding sends. */ - if (net_dev->destroy && net_dev->num_outstanding_sends == 0) { + if (net_dev->destroy) { return (NULL); } @@ -678,7 +679,7 @@ hv_nv_on_device_add(struct hv_device *de */ ret = hv_vmbus_channel_open(device->channel, NETVSC_DEVICE_RING_BUFFER_SIZE, NETVSC_DEVICE_RING_BUFFER_SIZE, - NULL, 0, hv_nv_on_channel_callback, device); + NULL, 0, hv_nv_on_channel_callback, device->channel); if (ret != 0) goto cleanup; @@ -719,14 +720,7 @@ hv_nv_on_device_remove(struct hv_device netvsc_dev *net_dev = sc->net_dev;; /* Stop outbound traffic ie sends and receives completions */ - mtx_lock(&device->channel->inbound_lock); net_dev->destroy = TRUE; - mtx_unlock(&device->channel->inbound_lock); - - /* Wait for all send completions */ - while (net_dev->num_outstanding_sends) { - DELAY(100); - } hv_nv_disconnect_from_vsp(net_dev); @@ -805,8 +799,6 @@ hv_nv_on_send_completion(netvsc_dev *net net_vsc_pkt->compl.send.send_completion_context); } - - atomic_subtract_int(&net_dev->num_outstanding_sends, 1); } } @@ -816,16 +808,11 @@ hv_nv_on_send_completion(netvsc_dev *net * Returns 0 on success, non-zero on failure. */ int -hv_nv_on_send(struct hv_device *device, netvsc_packet *pkt) +hv_nv_on_send(struct hv_vmbus_channel *chan, netvsc_packet *pkt) { - netvsc_dev *net_dev; nvsp_msg send_msg; int ret; - net_dev = hv_nv_get_outbound_net_device(device); - if (!net_dev) - return (ENODEV); - send_msg.hdr.msg_type = nvsp_msg_1_type_send_rndis_pkt; if (pkt->is_data_pkt) { /* 0 is RMC_DATA */ @@ -841,20 +828,16 @@ hv_nv_on_send(struct hv_device *device, pkt->send_buf_section_size; if (pkt->page_buf_count) { - ret = hv_vmbus_channel_send_packet_pagebuffer(device->channel, + ret = hv_vmbus_channel_send_packet_pagebuffer(chan, pkt->page_buffers, pkt->page_buf_count, &send_msg, sizeof(nvsp_msg), (uint64_t)(uintptr_t)pkt); } else { - ret = hv_vmbus_channel_send_packet(device->channel, + ret = hv_vmbus_channel_send_packet(chan, &send_msg, sizeof(nvsp_msg), (uint64_t)(uintptr_t)pkt, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); } - /* Record outstanding send only if send_packet() succeeded */ - if (ret == 0) - atomic_add_int(&net_dev->num_outstanding_sends, 1); - return (ret); } @@ -866,7 +849,7 @@ hv_nv_on_send(struct hv_device *device, */ static void hv_nv_on_receive(netvsc_dev *net_dev, struct hv_device *device, - hv_vm_packet_descriptor *pkt) + struct hv_vmbus_channel *chan, hv_vm_packet_descriptor *pkt) { hv_vm_transfer_page_packet_header *vm_xfer_page_pkt; nvsp_msg *nvsp_msg_pkt; @@ -916,7 +899,7 @@ hv_nv_on_receive(netvsc_dev *net_dev, st net_vsc_pkt->tot_data_buf_len = vm_xfer_page_pkt->ranges[i].byte_count; - hv_rf_on_receive(net_dev, device, net_vsc_pkt); + hv_rf_on_receive(net_dev, device, chan, net_vsc_pkt); if (net_vsc_pkt->status != nvsp_status_success) { status = nvsp_status_failure; } @@ -929,7 +912,6 @@ hv_nv_on_receive(netvsc_dev *net_dev, st */ hv_nv_on_receive_completion(device, vm_xfer_page_pkt->d.transaction_id, status); - hv_rf_receive_rollup(net_dev); } /* @@ -973,9 +955,10 @@ retry_send_cmplt: * Net VSC on channel callback */ static void -hv_nv_on_channel_callback(void *context) +hv_nv_on_channel_callback(void *xchan) { - struct hv_device *device = (struct hv_device *)context; + struct hv_vmbus_channel *chan = xchan; + struct hv_device *device = chan->device; netvsc_dev *net_dev; device_t dev = device->device; uint32_t bytes_rxed; @@ -992,7 +975,7 @@ hv_nv_on_channel_callback(void *context) buffer = net_dev->callback_buf; do { - ret = hv_vmbus_channel_recv_packet_raw(device->channel, + ret = hv_vmbus_channel_recv_packet_raw(chan, buffer, bufferlen, &bytes_rxed, &request_id); if (ret == 0) { if (bytes_rxed > 0) { @@ -1002,7 +985,7 @@ hv_nv_on_channel_callback(void *context) hv_nv_on_send_completion(net_dev, device, desc); break; case HV_VMBUS_PACKET_TYPE_DATA_USING_TRANSFER_PAGES: - hv_nv_on_receive(net_dev, device, desc); + hv_nv_on_receive(net_dev, device, chan, desc); break; default: device_printf(dev, @@ -1036,5 +1019,5 @@ hv_nv_on_channel_callback(void *context) if (bufferlen > NETVSC_PACKET_SIZE) free(buffer, M_NETVSC); - hv_rf_channel_rollup(net_dev); + hv_rf_channel_rollup(chan); } Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h Wed Jun 15 03:17:05 2016 (r301911) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h Wed Jun 15 03:48:55 2016 (r301912) @@ -893,7 +893,6 @@ typedef struct nvsp_msg_ { */ typedef struct netvsc_dev_ { struct hv_device *dev; - int num_outstanding_sends; /* Send buffer allocated by us but manages by NetVSP */ void *send_buf; @@ -1000,6 +999,7 @@ struct buf_ring; #endif struct hn_rx_ring { + struct ifnet *hn_ifp; struct lro_ctrl hn_lro; /* Trust csum verification on host side */ @@ -1017,6 +1017,8 @@ struct hn_rx_ring { #define HN_TRUST_HCSUM_TCP 0x0002 #define HN_TRUST_HCSUM_UDP 0x0004 +struct hv_vmbus_channel; + struct hn_tx_ring { #ifndef HN_USE_TXDESC_BUFRING struct mtx hn_txlist_spin; @@ -1039,6 +1041,7 @@ struct hn_tx_ring { struct mtx hn_tx_lock; struct hn_softc *hn_sc; + struct hv_vmbus_channel *hn_chan; int hn_direct_tx_size; int hn_tx_chimney_size; @@ -1097,7 +1100,7 @@ netvsc_dev *hv_nv_on_device_add(struct h void *additional_info); int hv_nv_on_device_remove(struct hv_device *device, boolean_t destroy_channel); -int hv_nv_on_send(struct hv_device *device, netvsc_packet *pkt); +int hv_nv_on_send(struct hv_vmbus_channel *chan, netvsc_packet *pkt); int hv_nv_get_next_send_section(netvsc_dev *net_dev); #endif /* __HV_NET_VSC_H__ */ Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Jun 15 03:17:05 2016 (r301911) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Jun 15 03:48:55 2016 (r301912) @@ -119,6 +119,8 @@ __FBSDID("$FreeBSD$"); #include "hv_rndis.h" #include "hv_rndis_filter.h" +#define hv_chan_rxr hv_chan_priv1 +#define hv_chan_txr hv_chan_priv2 /* Short for Hyper-V network interface */ #define NETVSC_DEVNAME "hn" @@ -397,6 +399,7 @@ static int netvsc_attach(device_t dev) { struct hv_device *device_ctx = vmbus_get_devctx(dev); + struct hv_vmbus_channel *chan; netvsc_device_info device_info; hn_softc_t *sc; int unit = device_get_unit(dev); @@ -449,6 +452,14 @@ netvsc_attach(device_t dev) hn_create_rx_data(sc); + /* + * Associate the first TX/RX ring w/ the primary channel. + */ + chan = device_ctx->channel; + chan->hv_chan_rxr = &sc->hn_rx_ring[0]; + chan->hv_chan_txr = &sc->hn_tx_ring[0]; + sc->hn_tx_ring[0].hn_chan = chan; + if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_dunit = unit; ifp->if_dname = NETVSC_DEVNAME; @@ -706,12 +717,11 @@ hn_tx_done(void *xpkt) } void -netvsc_channel_rollup(struct hv_device *device_ctx) +netvsc_channel_rollup(struct hv_vmbus_channel *chan) { - struct hn_softc *sc = device_get_softc(device_ctx->device); - struct hn_tx_ring *txr = &sc->hn_tx_ring[0]; /* TODO: vRSS */ + struct hn_tx_ring *txr = chan->hv_chan_txr; #if defined(INET) || defined(INET6) - struct hn_rx_ring *rxr = &sc->hn_rx_ring[0]; /* TODO: vRSS */ + struct hn_rx_ring *rxr = chan->hv_chan_rxr; struct lro_ctrl *lro = &rxr->hn_lro; struct lro_entry *queued; @@ -721,7 +731,12 @@ netvsc_channel_rollup(struct hv_device * } #endif - if (!txr->hn_has_txeof) + /* + * NOTE: + * 'txr' could be NULL, if multiple channels and + * ifnet.if_start method are enabled. + */ + if (txr == NULL || !txr->hn_has_txeof) return; txr->hn_has_txeof = 0; @@ -862,6 +877,8 @@ hn_encap(struct hn_tx_ring *txr, struct /* * Chimney send, if the packet could fit into one chimney buffer. + * + * TODO: vRSS, chimney buffer should be per-channel. */ if (packet->tot_data_buf_len < txr->hn_tx_chimney_size) { netvsc_dev *net_dev = txr->hn_sc->net_dev; @@ -948,8 +965,7 @@ done: * associated w/ the txd will _not_ be freed. */ static int -hn_send_pkt(struct ifnet *ifp, struct hv_device *device_ctx, - struct hn_tx_ring *txr, struct hn_txdesc *txd) +hn_send_pkt(struct ifnet *ifp, struct hn_tx_ring *txr, struct hn_txdesc *txd) { int error, send_failed = 0; @@ -958,7 +974,7 @@ again: * Make sure that txd is not freed before ETHER_BPF_MTAP. */ hn_txdesc_hold(txd); - error = hv_nv_on_send(device_ctx, &txd->netvsc_pkt); + error = hv_nv_on_send(txr->hn_chan, &txd->netvsc_pkt); if (!error) { ETHER_BPF_MTAP(ifp, txd->m); if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); @@ -1018,7 +1034,6 @@ hn_start_locked(struct hn_tx_ring *txr, { struct hn_softc *sc = txr->hn_sc; struct ifnet *ifp = sc->hn_ifp; - struct hv_device *device_ctx = vmbus_get_devctx(sc->hn_dev); KASSERT(hn_use_if_start, ("hn_start_locked is called, when if_start is disabled")); @@ -1062,7 +1077,7 @@ hn_start_locked(struct hn_tx_ring *txr, continue; } - error = hn_send_pkt(ifp, device_ctx, txr, txd); + error = hn_send_pkt(ifp, txr, txd); if (__predict_false(error)) { /* txd is freed, but m_head is not */ IFQ_DRV_PREPEND(&ifp->if_snd, m_head); @@ -1157,26 +1172,16 @@ hv_m_append(struct mbuf *m0, int len, c_ * Note: This is no longer used as a callback */ int -netvsc_recv(struct hv_device *device_ctx, netvsc_packet *packet, +netvsc_recv(struct hv_vmbus_channel *chan, netvsc_packet *packet, rndis_tcp_ip_csum_info *csum_info) { - struct hn_softc *sc = device_get_softc(device_ctx->device); - struct hn_rx_ring *rxr = &sc->hn_rx_ring[0]; /* TODO: vRSS */ + struct hn_rx_ring *rxr = chan->hv_chan_rxr; + struct ifnet *ifp = rxr->hn_ifp; struct mbuf *m_new; - struct ifnet *ifp; int size, do_lro = 0, do_csum = 1; - if (sc == NULL) { - return (0); /* TODO: KYS how can this be! */ - } - - ifp = sc->hn_ifp; - - ifp = sc->arpcom.ac_ifp; - - if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) return (0); - } /* * Bail out if packet contains more data than configured MTU. @@ -1329,11 +1334,6 @@ skip: return (0); } -void -netvsc_recv_rollup(struct hv_device *device_ctx __unused) -{ -} - /* * Rules for using sc->temp_unusable: * 1. sc->temp_unusable can only be read or written while holding NV_LOCK() @@ -2084,6 +2084,7 @@ hn_create_rx_data(struct hn_softc *sc) rxr->hn_trust_hcsum |= HN_TRUST_HCSUM_UDP; if (hn_trust_hostip) rxr->hn_trust_hcsum |= HN_TRUST_HCSUM_IP; + rxr->hn_ifp = sc->hn_ifp; /* * Initialize LRO. @@ -2567,7 +2568,6 @@ hn_xmit(struct hn_tx_ring *txr, int len) { struct hn_softc *sc = txr->hn_sc; struct ifnet *ifp = sc->hn_ifp; - struct hv_device *device_ctx = vmbus_get_devctx(sc->hn_dev); struct mbuf *m_head; mtx_assert(&txr->hn_tx_lock, MA_OWNED); @@ -2606,7 +2606,7 @@ hn_xmit(struct hn_tx_ring *txr, int len) continue; } - error = hn_send_pkt(ifp, device_ctx, txr, txd); + error = hn_send_pkt(ifp, txr, txd); if (__predict_false(error)) { /* txd is freed, but m_head is not */ drbr_putback(ifp, txr->hn_mbuf_br, m_head); Modified: stable/10/sys/dev/hyperv/netvsc/hv_rndis.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_rndis.h Wed Jun 15 03:17:05 2016 (r301911) +++ stable/10/sys/dev/hyperv/netvsc/hv_rndis.h Wed Jun 15 03:48:55 2016 (r301912) @@ -1046,11 +1046,11 @@ typedef struct rndismp_rx_bufs_info_ { /* * Externs */ -int netvsc_recv(struct hv_device *device_ctx, - netvsc_packet *packet, - rndis_tcp_ip_csum_info *csum_info); -void netvsc_recv_rollup(struct hv_device *device_ctx); -void netvsc_channel_rollup(struct hv_device *device_ctx); +struct hv_vmbus_channel; + +int netvsc_recv(struct hv_vmbus_channel *chan, + netvsc_packet *packet, rndis_tcp_ip_csum_info *csum_info); +void netvsc_channel_rollup(struct hv_vmbus_channel *chan); void* hv_set_rppi_data(rndis_msg *rndis_mesg, uint32_t rppi_size, Modified: stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c Wed Jun 15 03:17:05 2016 (r301911) +++ stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c Wed Jun 15 03:48:55 2016 (r301912) @@ -59,6 +59,7 @@ static void hv_rf_receive_response(rndis static void hv_rf_receive_indicate_status(rndis_device *device, rndis_msg *response); static void hv_rf_receive_data(rndis_device *device, rndis_msg *message, + struct hv_vmbus_channel *chan, netvsc_packet *pkt); static int hv_rf_query_device(rndis_device *device, uint32_t oid, void *result, uint32_t *result_size); @@ -250,7 +251,7 @@ hv_rf_send_request(rndis_device *device, NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX; packet->send_buf_section_size = 0; - ret = hv_nv_on_send(device->net_dev->dev, packet); + ret = hv_nv_on_send(device->net_dev->dev->channel, packet); return (ret); } @@ -406,7 +407,8 @@ hv_rf_receive_indicate_status(rndis_devi * RNDIS filter receive data */ static void -hv_rf_receive_data(rndis_device *device, rndis_msg *message, netvsc_packet *pkt) +hv_rf_receive_data(rndis_device *device, rndis_msg *message, + struct hv_vmbus_channel *chan, netvsc_packet *pkt) { rndis_packet *rndis_pkt; ndis_8021q_info *rppi_vlan_info; @@ -444,14 +446,15 @@ hv_rf_receive_data(rndis_device *device, } csum_info = hv_get_ppi_data(rndis_pkt, tcpip_chksum_info); - netvsc_recv(device->net_dev->dev, pkt, csum_info); + netvsc_recv(chan, pkt, csum_info); } /* * RNDIS filter on receive */ int -hv_rf_on_receive(netvsc_dev *net_dev, struct hv_device *device, netvsc_packet *pkt) +hv_rf_on_receive(netvsc_dev *net_dev, struct hv_device *device, + struct hv_vmbus_channel *chan, netvsc_packet *pkt) { rndis_device *rndis_dev; rndis_msg *rndis_hdr; @@ -474,7 +477,7 @@ hv_rf_on_receive(netvsc_dev *net_dev, st /* data message */ case REMOTE_NDIS_PACKET_MSG: - hv_rf_receive_data(rndis_dev, rndis_hdr, pkt); + hv_rf_receive_data(rndis_dev, rndis_hdr, chan, pkt); break; /* completion messages */ case REMOTE_NDIS_INITIALIZE_CMPLT: @@ -958,32 +961,9 @@ hv_rf_on_send_request_halt_completion(vo request->halt_complete_flag = 1; } -/* - * RNDIS filter when "all" reception is done - */ void -hv_rf_receive_rollup(netvsc_dev *net_dev) +hv_rf_channel_rollup(struct hv_vmbus_channel *chan) { - rndis_device *rndis_dev; - - rndis_dev = (rndis_device *)net_dev->extension; - netvsc_recv_rollup(rndis_dev->net_dev->dev); -} -void -hv_rf_channel_rollup(netvsc_dev *net_dev) -{ - rndis_device *rndis_dev; - - rndis_dev = (rndis_device *)net_dev->extension; - - /* - * This could be called pretty early, so we need - * to make sure everything has been setup. - */ - if (rndis_dev == NULL || - rndis_dev->net_dev == NULL || - rndis_dev->net_dev->dev == NULL) - return; - netvsc_channel_rollup(rndis_dev->net_dev->dev); + netvsc_channel_rollup(chan); } Modified: stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.h Wed Jun 15 03:17:05 2016 (r301911) +++ stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.h Wed Jun 15 03:48:55 2016 (r301912) @@ -95,11 +95,12 @@ typedef struct rndis_device_ { /* * Externs */ +struct hv_vmbus_channel; -int hv_rf_on_receive(netvsc_dev *net_dev, - struct hv_device *device, netvsc_packet *pkt); +int hv_rf_on_receive(netvsc_dev *net_dev, struct hv_device *device, + struct hv_vmbus_channel *chan, netvsc_packet *pkt); void hv_rf_receive_rollup(netvsc_dev *net_dev); -void hv_rf_channel_rollup(netvsc_dev *net_dev); +void hv_rf_channel_rollup(struct hv_vmbus_channel *chan); int hv_rf_on_device_add(struct hv_device *device, void *additl_info); int hv_rf_on_device_remove(struct hv_device *device, boolean_t destroy_channel); int hv_rf_on_open(struct hv_device *device); Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Wed Jun 15 03:17:05 2016 (r301911) +++ stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Wed Jun 15 03:48:55 2016 (r301912) @@ -365,7 +365,7 @@ storvsc_handle_sc_creation(void *context int ret = 0; new_channel = (hv_vmbus_channel *)context; - device = new_channel->primary_channel->device; + device = new_channel->device; sc = get_stor_device(device, TRUE); if (sc == NULL) return; @@ -883,12 +883,7 @@ hv_storvsc_on_channel_callback(void *con struct hv_storvsc_request *request; struct vstor_packet *vstor_packet; - if (channel->primary_channel != NULL){ - device = channel->primary_channel->device; - } else { - device = channel->device; - } - + device = channel->device; KASSERT(device, ("device is NULL")); sc = get_stor_device(device, FALSE); @@ -1186,9 +1181,7 @@ storvsc_detach(device_t dev) struct hv_sgl_node *sgl_node = NULL; int j = 0; - mtx_lock(&hv_device->channel->inbound_lock); sc->hs_destroy = TRUE; - mtx_unlock(&hv_device->channel->inbound_lock); /* * At this point, all outbound traffic should be disabled. We Modified: stable/10/sys/dev/hyperv/vmbus/hv_channel.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_channel.c Wed Jun 15 03:17:05 2016 (r301911) +++ stable/10/sys/dev/hyperv/vmbus/hv_channel.c Wed Jun 15 03:48:55 2016 (r301912) @@ -537,13 +537,7 @@ hv_vmbus_channel_close_internal(hv_vmbus */ channel->rxq = NULL; taskqueue_drain(rxq, &channel->channel_task); - /* - * Grab the lock to prevent race condition when a packet received - * and unloading driver is in the process. - */ - mtx_lock(&channel->inbound_lock); channel->on_channel_callback = NULL; - mtx_unlock(&channel->inbound_lock); /** * Send a closing message @@ -920,12 +914,6 @@ VmbusProcessChannelEvent(void* context, * callback to NULL. This closes the window. */ - /* - * Disable the lock due to newly added WITNESS check in r277723. - * Will seek other way to avoid race condition. - * -- whu - */ - // mtx_lock(&channel->inbound_lock); if (channel->on_channel_callback != NULL) { arg = channel->channel_callback_context; is_batched_reading = channel->batched_reading; @@ -952,5 +940,4 @@ VmbusProcessChannelEvent(void* context, bytes_to_read = 0; } while (is_batched_reading && (bytes_to_read != 0)); } - // mtx_unlock(&channel->inbound_lock); } Modified: stable/10/sys/dev/hyperv/vmbus/hv_channel_mgmt.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Wed Jun 15 03:17:05 2016 (r301911) +++ stable/10/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Wed Jun 15 03:48:55 2016 (r301912) @@ -143,9 +143,7 @@ hv_vmbus_allocate_channel(void) M_DEVBUF, M_WAITOK | M_ZERO); - mtx_init(&channel->inbound_lock, "channel inbound", NULL, MTX_DEF); mtx_init(&channel->sc_lock, "vmbus multi channel", NULL, MTX_DEF); - TAILQ_INIT(&channel->sc_list_anchor); return (channel); @@ -158,8 +156,6 @@ void hv_vmbus_free_vmbus_channel(hv_vmbus_channel* channel) { mtx_destroy(&channel->sc_lock); - mtx_destroy(&channel->inbound_lock); - free(channel, M_DEVBUF); } @@ -218,6 +214,7 @@ vmbus_channel_process_offer(hv_vmbus_cha * It is a sub channel offer, process it. */ new_channel->primary_channel = channel; + new_channel->device = channel->device; mtx_lock(&channel->sc_lock); TAILQ_INSERT_TAIL( &channel->sc_list_anchor, @@ -458,7 +455,10 @@ vmbus_channel_on_offer_rescind_internal( hv_vmbus_channel* channel; channel = (hv_vmbus_channel*)context; - hv_vmbus_child_device_unregister(channel->device); + if (HV_VMBUS_CHAN_ISPRIMARY(channel)) { + /* Only primary channel owns the hv_device */ + hv_vmbus_child_device_unregister(channel->device); + } } /** @@ -679,7 +679,10 @@ hv_vmbus_release_unattached_channels(voi TAILQ_REMOVE(&hv_vmbus_g_connection.channel_anchor, channel, list_entry); - hv_vmbus_child_device_unregister(channel->device); + if (HV_VMBUS_CHAN_ISPRIMARY(channel)) { + /* Only primary channel owns the hv_device */ + hv_vmbus_child_device_unregister(channel->device); + } hv_vmbus_free_vmbus_channel(channel); } bzero(hv_vmbus_g_connection.channels, From owner-svn-src-all@freebsd.org Wed Jun 15 05:16:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 140D7B72EBA; Wed, 15 Jun 2016 05:16:39 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF4362BF2; Wed, 15 Jun 2016 05:16:38 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5F5Gc8e095698; Wed, 15 Jun 2016 05:16:38 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5F5Gbvn095696; Wed, 15 Jun 2016 05:16:37 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606150516.u5F5Gbvn095696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 15 Jun 2016 05:16:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301913 - in stable/10/sys: net sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 05:16:39 -0000 Author: sephe Date: Wed Jun 15 05:16:37 2016 New Revision: 301913 URL: https://svnweb.freebsd.org/changeset/base/301913 Log: MFC 296178 buf_ring/drbr: Add buf_ring_peek_clear_sc and use it in drbr_peek Unlike buf_ring_peek, it only supports single consumer mode, and it clears the cons_head if DEBUG_BUFRING/INVARIANTS is defined. The normal use case of drbr_peek for network drivers is: m = drbr_peek(br); err = hw_spec_encap(&m); /* could m_defrag/m_collapse */ (*) if (err) { if (m == NULL) drbr_advance(br); else drbr_putback(br, m); /* break the loop */ } drbr_advance(br); The race is: If hw_spec_encap() m_defrag or m_collapse the mbuf, i.e. the old mbuf was freed, or like the Hyper-V's network driver, that transmission- done does not even require the TX lock; then on the other CPU at the (*) time, the freed mbuf could be recycled and being drbr_enqueue even before the current CPU had the chance to call drbr_{advance,putback}. This triggers a panic in drbr_enqueue duplicated element check, if DEBUG_BUFRING/INVARIANTS is defined. Use buf_ring_peek_clear_sc() in drbr_peek() to fix the above race. This change is a NO-OP, if neither DEBUG_BUFRING nor INVARIANTS are defined. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5416 Modified: stable/10/sys/net/if_var.h stable/10/sys/sys/buf_ring.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/if_var.h ============================================================================== --- stable/10/sys/net/if_var.h Wed Jun 15 03:48:55 2016 (r301912) +++ stable/10/sys/net/if_var.h Wed Jun 15 05:16:37 2016 (r301913) @@ -705,7 +705,7 @@ drbr_peek(struct ifnet *ifp, struct buf_ return (m); } #endif - return(buf_ring_peek(br)); + return(buf_ring_peek_clear_sc(br)); } static __inline void Modified: stable/10/sys/sys/buf_ring.h ============================================================================== --- stable/10/sys/sys/buf_ring.h Wed Jun 15 03:48:55 2016 (r301912) +++ stable/10/sys/sys/buf_ring.h Wed Jun 15 05:16:37 2016 (r301913) @@ -263,6 +263,37 @@ buf_ring_peek(struct buf_ring *br) return (br->br_ring[br->br_cons_head]); } +static __inline void * +buf_ring_peek_clear_sc(struct buf_ring *br) +{ +#ifdef DEBUG_BUFRING + void *ret; + + if (!mtx_owned(br->br_lock)) + panic("lock not held on single consumer dequeue"); +#endif + /* + * I believe it is safe to not have a memory barrier + * here because we control cons and tail is worst case + * a lagging indicator so we worst case we might + * return NULL immediately after a buffer has been enqueued + */ + if (br->br_cons_head == br->br_prod_tail) + return (NULL); + +#ifdef DEBUG_BUFRING + /* + * Single consumer, i.e. cons_head will not move while we are + * running, so atomic_swap_ptr() is not necessary here. + */ + ret = br->br_ring[br->br_cons_head]; + br->br_ring[br->br_cons_head] = NULL; + return (ret); +#else + return (br->br_ring[br->br_cons_head]); +#endif +} + static __inline int buf_ring_full(struct buf_ring *br) { From owner-svn-src-all@freebsd.org Wed Jun 15 05:31:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51E16B720F4; Wed, 15 Jun 2016 05:31:37 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED6672227; Wed, 15 Jun 2016 05:31:36 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5F5Vad4001584; Wed, 15 Jun 2016 05:31:36 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5F5VaDX001583; Wed, 15 Jun 2016 05:31:36 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606150531.u5F5VaDX001583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 15 Jun 2016 05:31:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301914 - stable/10/sys/dev/hyperv/vmbus X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 05:31:37 -0000 Author: sephe Date: Wed Jun 15 05:31:35 2016 New Revision: 301914 URL: https://svnweb.freebsd.org/changeset/base/301914 Log: MFC 296180,297634 296180 hyperv: Use proper fence function to keep store-load order for msgs sfence only makes sure about the store-store order, which is not sufficient here. Use atomic_thread_fence_seq_cst() as suggested jhb and kib (a locked op in the nutshell, which should have the Reviewed by: jhb, kib, Jun Su MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5436 297634 hyperv: Use mb() instead of atomic_thread_fence_seq_cst() Since atomic_thread_fence_seq_cst() will become compiler fence on UP kernel. Reviewed by: kib, Dexuan Cui MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5852 Modified: stable/10/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed Jun 15 05:16:37 2016 (r301913) +++ stable/10/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Wed Jun 15 05:31:35 2016 (r301914) @@ -116,8 +116,12 @@ handled: * message_pending and EOMing. Otherwise, the EOMing will * not deliver any more messages * since there is no empty slot + * + * NOTE: + * mb() is used here, since atomic_thread_fence_seq_cst() + * will become compler fence on UP kernel. */ - wmb(); + mb(); if (msg->header.message_flags.u.message_pending) { /* @@ -186,8 +190,12 @@ hv_vmbus_isr(struct trapframe *frame) * message_pending and EOMing. Otherwise, the EOMing will * not deliver any more messages * since there is no empty slot + * + * NOTE: + * mb() is used here, since atomic_thread_fence_seq_cst() + * will become compler fence on UP kernel. */ - wmb(); + mb(); if (msg->header.message_flags.u.message_pending) { /* From owner-svn-src-all@freebsd.org Wed Jun 15 05:57:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DA3BB72624; Wed, 15 Jun 2016 05:57:08 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A2912C38; Wed, 15 Jun 2016 05:57:08 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5F5v7jZ010545; Wed, 15 Jun 2016 05:57:07 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5F5v7kL010539; Wed, 15 Jun 2016 05:57:07 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606150557.u5F5v7kL010539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 15 Jun 2016 05:57:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301915 - in stable/10/sys/dev/hyperv: netvsc vmbus X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 05:57:08 -0000 Author: sephe Date: Wed Jun 15 05:57:06 2016 New Revision: 301915 URL: https://svnweb.freebsd.org/changeset/base/301915 Log: MFC 296181,296184,296187,296188,296252,296253,296289,296290 296181 hyperv/channel: Add debug sysctl nodes for channel indices It would serve as a debug tool, if the shared buffer ring's indices stopped updating. Submitted by: HongJiang Zhang Reviewed by: sephe, Jun Su Modified by: sephe MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5402 296184 hyperv/hn: Switch to if_transmit by default after r296178 MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5485 296187 hyperv/hn: Utilize mbuf flowid MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5488 296188 hyperv/channel: Add sysctl node for channel owner cpu And add sysctl node for sub-channel's channel id. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5489 296252 hyperv/hn: Set hash per-packet-info for each packet transmission So that the host could dispatch the TX done back to this TX ring's owner channel MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5498 296253 hyperv/channel: Nuke useless stack variable MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5499 296289 hyperv/chan: Add sysctl node to check whether monitor is allocated or not MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5502 296290 hyperv/chan: Function renaming; no functional change The renamed function create a sysctl tree for channel, and many non-statistics nodes exists, so don't claim it only adds sysctl nodes for statistics. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5503 Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c stable/10/sys/dev/hyperv/netvsc/hv_rndis.h stable/10/sys/dev/hyperv/vmbus/hv_channel.c stable/10/sys/dev/hyperv/vmbus/hv_ring_buffer.c stable/10/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h Wed Jun 15 05:31:35 2016 (r301914) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h Wed Jun 15 05:57:06 2016 (r301915) @@ -1000,10 +1000,11 @@ struct buf_ring; struct hn_rx_ring { struct ifnet *hn_ifp; - struct lro_ctrl hn_lro; + int hn_rx_idx; /* Trust csum verification on host side */ int hn_trust_hcsum; /* HN_TRUST_HCSUM_ */ + struct lro_ctrl hn_lro; u_long hn_csum_ip; u_long hn_csum_tcp; @@ -1038,6 +1039,7 @@ struct hn_tx_ring { struct buf_ring *hn_mbuf_br; int hn_oactive; + int hn_tx_idx; struct mtx hn_tx_lock; struct hn_softc *hn_sc; Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Jun 15 05:31:35 2016 (r301914) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Jun 15 05:57:06 2016 (r301915) @@ -140,6 +140,7 @@ __FBSDID("$FreeBSD$"); #define HN_RNDIS_MSG_LEN \ (sizeof(rndis_msg) + \ + RNDIS_HASH_PPI_SIZE + \ RNDIS_VLAN_PPI_SIZE + \ RNDIS_TSO_PPI_SIZE + \ RNDIS_CSUM_PPI_SIZE) @@ -276,7 +277,7 @@ static int hn_bind_tx_taskq = -1; SYSCTL_INT(_hw_hn, OID_AUTO, bind_tx_taskq, CTLFLAG_RDTUN, &hn_bind_tx_taskq, 0, "Bind TX taskqueue to the specified cpu"); -static int hn_use_if_start = 1; +static int hn_use_if_start = 0; SYSCTL_INT(_hw_hn, OID_AUTO, use_if_start, CTLFLAG_RDTUN, &hn_use_if_start, 0, "Use if_start TX method"); @@ -757,6 +758,7 @@ hn_encap(struct hn_tx_ring *txr, struct rndis_msg *rndis_mesg; rndis_packet *rndis_pkt; rndis_per_packet_info *rppi; + struct ndis_hash_info *hash_info; uint32_t rndis_msg_size; packet = &txd->netvsc_pkt; @@ -781,6 +783,18 @@ hn_encap(struct hn_tx_ring *txr, struct rndis_msg_size = RNDIS_MESSAGE_SIZE(rndis_packet); + /* + * Set the hash info for this packet, so that the host could + * dispatch the TX done event for this packet back to this TX + * ring's channel. + */ + rndis_msg_size += RNDIS_HASH_PPI_SIZE; + rppi = hv_set_rppi_data(rndis_mesg, RNDIS_HASH_PPI_SIZE, + nbl_hash_value); + hash_info = (struct ndis_hash_info *)((uint8_t *)rppi + + rppi->per_packet_info_offset); + hash_info->hash = txr->hn_tx_idx; + if (m_head->m_flags & M_VLANTAG) { ndis_8021q_info *rppi_vlan_info; @@ -1307,6 +1321,9 @@ skip: m_new->m_flags |= M_VLANTAG; } + m_new->m_pkthdr.flowid = rxr->hn_rx_idx; + M_HASHTYPE_SET(m_new, M_HASHTYPE_OPAQUE); + /* * Note: Moved RX completion back to hv_nv_on_receive() so all * messages (not just data messages) will trigger a response. @@ -2085,6 +2102,7 @@ hn_create_rx_data(struct hn_softc *sc) if (hn_trust_hostip) rxr->hn_trust_hcsum |= HN_TRUST_HCSUM_IP; rxr->hn_ifp = sc->hn_ifp; + rxr->hn_rx_idx = i; /* * Initialize LRO. @@ -2202,6 +2220,7 @@ hn_create_tx_ring(struct hn_softc *sc, i int error, i; txr->hn_sc = sc; + txr->hn_tx_idx = id; #ifndef HN_USE_TXDESC_BUFRING mtx_init(&txr->hn_txlist_spin, "hn txlist", NULL, MTX_SPIN); @@ -2625,10 +2644,14 @@ hn_transmit(struct ifnet *ifp, struct mb { struct hn_softc *sc = ifp->if_softc; struct hn_tx_ring *txr; - int error; + int error, idx = 0; - /* TODO: vRSS, TX ring selection */ - txr = &sc->hn_tx_ring[0]; + /* + * Select the TX ring based on flowid + */ + if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) + idx = m->m_pkthdr.flowid % sc->hn_tx_ring_cnt; + txr = &sc->hn_tx_ring[idx]; error = drbr_enqueue(ifp, txr->hn_mbuf_br, m); if (error) Modified: stable/10/sys/dev/hyperv/netvsc/hv_rndis.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_rndis.h Wed Jun 15 05:31:35 2016 (r301914) +++ stable/10/sys/dev/hyperv/netvsc/hv_rndis.h Wed Jun 15 05:57:06 2016 (r301915) @@ -608,6 +608,8 @@ typedef enum ndis_per_pkt_infotype_ { max_perpkt_info } ndis_per_pkt_infotype; +#define nbl_hash_value pkt_cancel_id + typedef struct ndis_8021q_info_ { union { struct { @@ -620,6 +622,10 @@ typedef struct ndis_8021q_info_ { } u1; } ndis_8021q_info; +struct ndis_hash_info { + uint32_t hash; +} __packed; + struct rndis_object_header { uint8_t type; uint8_t revision; @@ -713,6 +719,9 @@ typedef struct rndis_tcp_tso_info_ { }; } rndis_tcp_tso_info; +#define RNDIS_HASH_PPI_SIZE (sizeof(rndis_per_packet_info) + \ + sizeof(struct ndis_hash_info)) + #define RNDIS_VLAN_PPI_SIZE (sizeof(rndis_per_packet_info) + \ sizeof(ndis_8021q_info)) Modified: stable/10/sys/dev/hyperv/vmbus/hv_channel.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_channel.c Wed Jun 15 05:31:35 2016 (r301914) +++ stable/10/sys/dev/hyperv/vmbus/hv_channel.c Wed Jun 15 05:57:06 2016 (r301915) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -80,6 +81,90 @@ vmbus_channel_set_event(hv_vmbus_channel } +static int +vmbus_channel_sysctl_monalloc(SYSCTL_HANDLER_ARGS) +{ + struct hv_vmbus_channel *chan = arg1; + int alloc = 0; + + if (chan->offer_msg.monitor_allocated) + alloc = 1; + return sysctl_handle_int(oidp, &alloc, 0, req); +} + +static void +vmbus_channel_sysctl_create(hv_vmbus_channel* channel) +{ + device_t dev; + struct sysctl_oid *devch_sysctl; + struct sysctl_oid *devch_id_sysctl, *devch_sub_sysctl; + struct sysctl_oid *devch_id_in_sysctl, *devch_id_out_sysctl; + struct sysctl_ctx_list *ctx; + uint32_t ch_id; + uint16_t sub_ch_id; + char name[16]; + + hv_vmbus_channel* primary_ch = channel->primary_channel; + + if (primary_ch == NULL) { + dev = channel->device->device; + ch_id = channel->offer_msg.child_rel_id; + } else { + dev = primary_ch->device->device; + ch_id = primary_ch->offer_msg.child_rel_id; + sub_ch_id = channel->offer_msg.offer.sub_channel_index; + } + ctx = device_get_sysctl_ctx(dev); + /* This creates dev.DEVNAME.DEVUNIT.channel tree */ + devch_sysctl = SYSCTL_ADD_NODE(ctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "channel", CTLFLAG_RD, 0, ""); + /* This creates dev.DEVNAME.DEVUNIT.channel.CHANID tree */ + snprintf(name, sizeof(name), "%d", ch_id); + devch_id_sysctl = SYSCTL_ADD_NODE(ctx, + SYSCTL_CHILDREN(devch_sysctl), + OID_AUTO, name, CTLFLAG_RD, 0, ""); + + if (primary_ch != NULL) { + devch_sub_sysctl = SYSCTL_ADD_NODE(ctx, + SYSCTL_CHILDREN(devch_id_sysctl), + OID_AUTO, "sub", CTLFLAG_RD, 0, ""); + snprintf(name, sizeof(name), "%d", sub_ch_id); + devch_id_sysctl = SYSCTL_ADD_NODE(ctx, + SYSCTL_CHILDREN(devch_sub_sysctl), + OID_AUTO, name, CTLFLAG_RD, 0, ""); + + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(devch_id_sysctl), + OID_AUTO, "chanid", CTLFLAG_RD, + &channel->offer_msg.child_rel_id, 0, "channel id"); + } + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(devch_id_sysctl), OID_AUTO, + "cpu", CTLFLAG_RD, &channel->target_cpu, 0, "owner CPU id"); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(devch_id_sysctl), OID_AUTO, + "monitor_allocated", CTLTYPE_INT | CTLFLAG_RD, channel, 0, + vmbus_channel_sysctl_monalloc, "I", + "is monitor allocated to this channel"); + + devch_id_in_sysctl = SYSCTL_ADD_NODE(ctx, + SYSCTL_CHILDREN(devch_id_sysctl), + OID_AUTO, + "in", + CTLFLAG_RD, 0, ""); + devch_id_out_sysctl = SYSCTL_ADD_NODE(ctx, + SYSCTL_CHILDREN(devch_id_sysctl), + OID_AUTO, + "out", + CTLFLAG_RD, 0, ""); + hv_ring_buffer_stat(ctx, + SYSCTL_CHILDREN(devch_id_in_sysctl), + &(channel->inbound), + "inbound ring buffer stats"); + hv_ring_buffer_stat(ctx, + SYSCTL_CHILDREN(devch_id_out_sysctl), + &(channel->outbound), + "outbound ring buffer stats"); +} + /** * @brief Open the specified channel */ @@ -143,6 +228,9 @@ hv_vmbus_channel_open( in, recv_ring_buffer_size); + /* Create sysctl tree for this channel */ + vmbus_channel_sysctl_create(new_channel); + /** * Establish the gpadl for the ring buffer */ @@ -856,7 +944,6 @@ hv_vmbus_channel_recv_packet_raw( { int ret; uint32_t packetLen; - uint32_t userLen; hv_vm_packet_descriptor desc; *buffer_actual_len = 0; @@ -870,8 +957,6 @@ hv_vmbus_channel_recv_packet_raw( return (0); packetLen = desc.length8 << 3; - userLen = packetLen - (desc.data_offset8 << 3); - *buffer_actual_len = packetLen; if (packetLen > buffer_len) Modified: stable/10/sys/dev/hyperv/vmbus/hv_ring_buffer.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_ring_buffer.c Wed Jun 15 05:31:35 2016 (r301914) +++ stable/10/sys/dev/hyperv/vmbus/hv_ring_buffer.c Wed Jun 15 05:57:06 2016 (r301915) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "hv_vmbus_priv.h" @@ -39,6 +40,47 @@ __FBSDID("$FreeBSD$"); #define HV_BYTES_AVAIL_TO_WRITE(r, w, z) ((w) >= (r))? \ ((z) - ((w) - (r))):((r) - (w)) +static int +hv_rbi_sysctl_stats(SYSCTL_HANDLER_ARGS) +{ + hv_vmbus_ring_buffer_info* rbi; + uint32_t read_index, write_index, interrupt_mask, sz; + uint32_t read_avail, write_avail; + char rbi_stats[256]; + + rbi = (hv_vmbus_ring_buffer_info*)arg1; + read_index = rbi->ring_buffer->read_index; + write_index = rbi->ring_buffer->write_index; + interrupt_mask = rbi->ring_buffer->interrupt_mask; + sz = rbi->ring_data_size; + write_avail = HV_BYTES_AVAIL_TO_WRITE(read_index, + write_index, sz); + read_avail = sz - write_avail; + snprintf(rbi_stats, sizeof(rbi_stats), + "r_idx:%d " + "w_idx:%d " + "int_mask:%d " + "r_avail:%d " + "w_avail:%d", + read_index, write_index, interrupt_mask, + read_avail, write_avail); + + return (sysctl_handle_string(oidp, rbi_stats, + sizeof(rbi_stats), req)); +} + +void +hv_ring_buffer_stat( + struct sysctl_ctx_list *ctx, + struct sysctl_oid_list *tree_node, + hv_vmbus_ring_buffer_info *rbi, + const char *desc) +{ + SYSCTL_ADD_PROC(ctx, tree_node, OID_AUTO, + "ring_buffer_stats", + CTLTYPE_STRING|CTLFLAG_RD, rbi, 0, + hv_rbi_sysctl_stats, "A", desc); +} /** * @brief Get number of bytes available to read and to write to * for the specified ring buffer Modified: stable/10/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Wed Jun 15 05:31:35 2016 (r301914) +++ stable/10/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Wed Jun 15 05:57:06 2016 (r301915) @@ -639,6 +639,14 @@ extern hv_vmbus_channel_msg_table_entry /* * Private, VM Bus functions */ +struct sysctl_ctx_list; +struct sysctl_oid_list; + +void hv_ring_buffer_stat( + struct sysctl_ctx_list *ctx, + struct sysctl_oid_list *tree_node, + hv_vmbus_ring_buffer_info *rbi, + const char *desc); int hv_vmbus_ring_buffer_init( hv_vmbus_ring_buffer_info *ring_info, From owner-svn-src-all@freebsd.org Wed Jun 15 06:08:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25A08B7286E; Wed, 15 Jun 2016 06:08:07 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00848217A; Wed, 15 Jun 2016 06:08:06 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5F6864x014183; Wed, 15 Jun 2016 06:08:06 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5F686ZG014182; Wed, 15 Jun 2016 06:08:06 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606150608.u5F686ZG014182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 15 Jun 2016 06:08:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301916 - stable/10/sys/dev/hyperv/vmbus X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 06:08:07 -0000 Author: sephe Date: Wed Jun 15 06:08:05 2016 New Revision: 301916 URL: https://svnweb.freebsd.org/changeset/base/301916 Log: MFC 296291,301109 296291 hyperv/chan: Factor out the vcpu setting And use it for cpu0 assignment; it does not sound right to assume that cpu0 maps to vcpu0. And this factored out function will be exposed to drivers, if driver specific CPU binding is needed, e.g. hn(4). Move default cpu select after saving channel offer message. This makes sure that all useful information of the channel has been setup. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5504 301109 hyperv/channel: Only cpu0 is supported as channel target cpu on WIN7 MFC after: 1 week Sponsored by: Microsoft OSTC Modified: stable/10/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/vmbus/hv_channel_mgmt.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Wed Jun 15 05:57:06 2016 (r301915) +++ stable/10/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Wed Jun 15 06:08:05 2016 (r301916) @@ -277,6 +277,27 @@ vmbus_channel_process_offer(hv_vmbus_cha } } +static void +vmbus_channel_cpu_set(struct hv_vmbus_channel *chan, int cpu) +{ + KASSERT(cpu >= 0 && cpu < mp_ncpus, ("invalid cpu %d", cpu)); + + if (hv_vmbus_protocal_version == HV_VMBUS_VERSION_WS2008 || + hv_vmbus_protocal_version == HV_VMBUS_VERSION_WIN7) { + /* Only cpu0 is supported */ + cpu = 0; + } + + chan->target_cpu = cpu; + chan->target_vcpu = hv_vmbus_g_context.hv_vcpu_index[cpu]; + + if (bootverbose) { + printf("vmbus_chan%u: assigned to cpu%u [vcpu%u]\n", + chan->offer_msg.child_rel_id, + chan->target_cpu, chan->target_vcpu); + } +} + /** * Array of device guids that are performance critical. We try to distribute * the interrupt load for these devices across all online cpus. @@ -309,11 +330,12 @@ static uint32_t next_vcpu; * distributed across all available CPUs. */ static void -vmbus_channel_select_cpu(hv_vmbus_channel *channel, hv_guid *guid) +vmbus_channel_select_defcpu(struct hv_vmbus_channel *channel) { uint32_t current_cpu; int i; boolean_t is_perf_channel = FALSE; + const hv_guid *guid = &channel->offer_msg.offer.interface_type; for (i = PERF_CHN_NIC; i < MAX_PERF_CHN; i++) { if (memcmp(guid->data, high_perf_devices[i].data, @@ -323,24 +345,14 @@ vmbus_channel_select_cpu(hv_vmbus_channe } } - if ((hv_vmbus_protocal_version == HV_VMBUS_VERSION_WS2008) || - (hv_vmbus_protocal_version == HV_VMBUS_VERSION_WIN7) || - (!is_perf_channel)) { - /* Host's view of guest cpu */ - channel->target_vcpu = 0; - /* Guest's own view of cpu */ - channel->target_cpu = 0; + if (!is_perf_channel) { + /* Stick to cpu0 */ + vmbus_channel_cpu_set(channel, 0); return; } /* mp_ncpus should have the number cpus currently online */ current_cpu = (++next_vcpu % mp_ncpus); - channel->target_cpu = current_cpu; - channel->target_vcpu = - hv_vmbus_g_context.hv_vcpu_index[current_cpu]; - if (bootverbose) - printf("VMBUS: Total online cpus %d, assign perf channel %d " - "to vcpu %d, cpu %d\n", mp_ncpus, i, channel->target_vcpu, - current_cpu); + vmbus_channel_cpu_set(channel, current_cpu); } /** @@ -411,17 +423,14 @@ vmbus_channel_on_offer_internal(void* co offer->connection_id; } - /* - * Bind the channel to a chosen cpu. - */ - vmbus_channel_select_cpu(new_channel, - &offer->offer.interface_type); - memcpy(&new_channel->offer_msg, offer, sizeof(hv_vmbus_channel_offer_channel)); new_channel->monitor_group = (uint8_t) offer->monitor_id / 32; new_channel->monitor_bit = (uint8_t) offer->monitor_id % 32; + /* Select default cpu for this channel. */ + vmbus_channel_select_defcpu(new_channel); + vmbus_channel_process_offer(new_channel); free(offer, M_DEVBUF); From owner-svn-src-all@freebsd.org Wed Jun 15 06:14:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4143B729E4; Wed, 15 Jun 2016 06:14:11 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 68E6D25DA; Wed, 15 Jun 2016 06:14:11 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u5F6E5Qm077157 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 15 Jun 2016 09:14:05 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u5F6E5Qm077157 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u5F6E5il077156; Wed, 15 Jun 2016 09:14:05 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 15 Jun 2016 09:14:05 +0300 From: Konstantin Belousov To: "Pedro F. Giffuni" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: Re: svn commit: r301899 - in vendor/amd/dist: . amd amq conf/checkmount conf/fh_dref conf/hn_dref conf/mount conf/mtab conf/nfs_prot conf/sa_dref conf/transp conf/trap conf/umount doc fixmount fsinfo h... Message-ID: <20160615061405.GP38613@kib.kiev.ua> References: <201606142341.u5ENf81w071915@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201606142341.u5ENf81w071915@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 06:14:11 -0000 On Tue, Jun 14, 2016 at 11:41:08PM +0000, Pedro F. Giffuni wrote: > Author: pfg > Date: Tue Jun 14 23:41:07 2016 > New Revision: 301899 > URL: https://svnweb.freebsd.org/changeset/base/301899 > > Log: > am-utils: Disable keyword expansion. > > As recommended in the Committers guide section 5.4.4.1.2. Wouldn't it be better to remove amd before 11 ? From owner-svn-src-all@freebsd.org Wed Jun 15 06:32:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 071ABB84222; Wed, 15 Jun 2016 06:32:02 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BEC686C868; Wed, 15 Jun 2016 06:32:01 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5F6W1ep022505; Wed, 15 Jun 2016 06:32:01 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5F6W0SL022499; Wed, 15 Jun 2016 06:32:00 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606150632.u5F6W0SL022499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 15 Jun 2016 06:32:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301918 - in stable/10/sys/dev/hyperv: include netvsc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 06:32:02 -0000 Author: sephe Date: Wed Jun 15 06:32:00 2016 New Revision: 301918 URL: https://svnweb.freebsd.org/changeset/base/301918 Log: MFC 296293,296296,296297,296305 296293 hyperv/hn: Pass channel to hv_nv_on_receive_completion() While I'm here, staticize this function. Submitted by: Hongjiang Zhang Modified by: sephe MFC after: 1 week Sponsored by: Microsoft OSTC 296296 hyperv/hn: Make read buffer per-channel Submitted by: Hongjiang Zhang Reorganized by: sephe MFC after: 1 week Sponsored by: Microsoft OSTC 296297 hyperv/hn: Fix typo in comment MFC after: 1 week Sponsored by: Microsoft OSTC 296305 hyperv/hn: Make # of rings configurable And since the host may not being able to allocate the # of rings requested by us, save the # of rings allocated by the host in the ring_inuse counters; use ring_inuse counters for run time operation. This paves the way for the upcoming vRSS support. MFC after: 1 week Sponsored by: Microsoft OSTC Modified: stable/10/sys/dev/hyperv/include/hyperv.h stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/include/hyperv.h ============================================================================== --- stable/10/sys/dev/hyperv/include/hyperv.h Wed Jun 15 06:27:43 2016 (r301917) +++ stable/10/sys/dev/hyperv/include/hyperv.h Wed Jun 15 06:32:00 2016 (r301918) @@ -828,6 +828,7 @@ typedef struct hv_vmbus_channel { */ void *hv_chan_priv1; void *hv_chan_priv2; + void *hv_chan_priv3; } hv_vmbus_channel; #define HV_VMBUS_CHAN_ISPRIMARY(chan) ((chan)->primary_channel == NULL) Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c Wed Jun 15 06:27:43 2016 (r301917) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c Wed Jun 15 06:32:00 2016 (r301918) @@ -48,6 +48,9 @@ #include "hv_rndis.h" #include "hv_rndis_filter.h" +/* priv1 and priv2 are consumed by the main driver */ +#define hv_chan_rdbuf hv_chan_priv3 + MALLOC_DEFINE(M_NETVSC, "netvsc", "Hyper-V netvsc driver"); /* @@ -61,6 +64,8 @@ static int hv_nv_destroy_rx_buffer(netv static int hv_nv_connect_to_vsp(struct hv_device *device); static void hv_nv_on_send_completion(netvsc_dev *net_dev, struct hv_device *device, hv_vm_packet_descriptor *pkt); +static void hv_nv_on_receive_completion(struct hv_vmbus_channel *chan, + uint64_t tid, uint32_t status); static void hv_nv_on_receive(netvsc_dev *net_dev, struct hv_device *device, struct hv_vmbus_channel *chan, hv_vm_packet_descriptor *pkt); @@ -663,25 +668,30 @@ hv_nv_disconnect_from_vsp(netvsc_dev *ne netvsc_dev * hv_nv_on_device_add(struct hv_device *device, void *additional_info) { + struct hv_vmbus_channel *chan = device->channel; netvsc_dev *net_dev; int ret = 0; net_dev = hv_nv_alloc_net_device(device); - if (!net_dev) - goto cleanup; + if (net_dev == NULL) + return NULL; /* Initialize the NetVSC channel extension */ sema_init(&net_dev->channel_init_sema, 0, "netdev_sema"); + chan->hv_chan_rdbuf = malloc(NETVSC_PACKET_SIZE, M_NETVSC, M_WAITOK); + /* * Open the channel */ - ret = hv_vmbus_channel_open(device->channel, + ret = hv_vmbus_channel_open(chan, NETVSC_DEVICE_RING_BUFFER_SIZE, NETVSC_DEVICE_RING_BUFFER_SIZE, - NULL, 0, hv_nv_on_channel_callback, device->channel); - if (ret != 0) + NULL, 0, hv_nv_on_channel_callback, chan); + if (ret != 0) { + free(chan->hv_chan_rdbuf, M_NETVSC); goto cleanup; + } /* * Connect with the NetVsp @@ -694,8 +704,8 @@ hv_nv_on_device_add(struct hv_device *de close: /* Now, we can close the channel safely */ - - hv_vmbus_channel_close(device->channel); + free(chan->hv_chan_rdbuf, M_NETVSC); + hv_vmbus_channel_close(chan); cleanup: /* @@ -733,6 +743,7 @@ hv_nv_on_device_remove(struct hv_device HV_CHANNEL_CLOSING_NONDESTRUCTIVE_STATE; } + free(device->channel->hv_chan_rdbuf, M_NETVSC); hv_vmbus_channel_close(device->channel); sema_destroy(&net_dev->channel_init_sema); @@ -910,7 +921,7 @@ hv_nv_on_receive(netvsc_dev *net_dev, st * messages (not just data messages) will trigger a response * message back to the host. */ - hv_nv_on_receive_completion(device, vm_xfer_page_pkt->d.transaction_id, + hv_nv_on_receive_completion(chan, vm_xfer_page_pkt->d.transaction_id, status); } @@ -919,8 +930,8 @@ hv_nv_on_receive(netvsc_dev *net_dev, st * * Send a receive completion packet to RNDIS device (ie NetVsp) */ -void -hv_nv_on_receive_completion(struct hv_device *device, uint64_t tid, +static void +hv_nv_on_receive_completion(struct hv_vmbus_channel *chan, uint64_t tid, uint32_t status) { nvsp_msg rx_comp_msg; @@ -935,7 +946,7 @@ hv_nv_on_receive_completion(struct hv_de retry_send_cmplt: /* Send the completion */ - ret = hv_vmbus_channel_send_packet(device->channel, &rx_comp_msg, + ret = hv_vmbus_channel_send_packet(chan, &rx_comp_msg, sizeof(nvsp_msg), tid, HV_VMBUS_PACKET_TYPE_COMPLETION, 0); if (ret == 0) { /* success */ @@ -972,7 +983,7 @@ hv_nv_on_channel_callback(void *xchan) if (net_dev == NULL) return; - buffer = net_dev->callback_buf; + buffer = chan->hv_chan_rdbuf; do { ret = hv_vmbus_channel_recv_packet_raw(chan, Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h Wed Jun 15 06:27:43 2016 (r301917) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h Wed Jun 15 06:32:00 2016 (r301918) @@ -923,8 +923,6 @@ typedef struct netvsc_dev_ { hv_bool_uint8_t destroy; /* Negotiated NVSP version */ uint32_t nvsp_version; - - uint8_t callback_buf[NETVSC_PACKET_SIZE]; } netvsc_dev; @@ -1081,9 +1079,11 @@ typedef struct hn_softc { netvsc_dev *net_dev; int hn_rx_ring_cnt; + int hn_rx_ring_inuse; struct hn_rx_ring *hn_rx_ring; int hn_tx_ring_cnt; + int hn_tx_ring_inuse; struct hn_tx_ring *hn_tx_ring; int hn_tx_chimney_max; struct taskqueue *hn_tx_taskq; @@ -1096,8 +1096,6 @@ typedef struct hn_softc { extern int hv_promisc_mode; void netvsc_linkstatus_callback(struct hv_device *device_obj, uint32_t status); -void hv_nv_on_receive_completion(struct hv_device *device, - uint64_t tid, uint32_t status); netvsc_dev *hv_nv_on_device_add(struct hv_device *device, void *additional_info); int hv_nv_on_device_remove(struct hv_device *device, Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Jun 15 06:27:43 2016 (r301917) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Jun 15 06:32:00 2016 (r301918) @@ -281,6 +281,14 @@ static int hn_use_if_start = 0; SYSCTL_INT(_hw_hn, OID_AUTO, use_if_start, CTLFLAG_RDTUN, &hn_use_if_start, 0, "Use if_start TX method"); +static int hn_ring_cnt = 1; +SYSCTL_INT(_hw_hn, OID_AUTO, ring_cnt, CTLFLAG_RDTUN, + &hn_ring_cnt, 0, "# of TX/RX rings to used"); + +static int hn_single_tx_ring = 1; +SYSCTL_INT(_hw_hn, OID_AUTO, single_tx_ring, CTLFLAG_RDTUN, + &hn_single_tx_ring, 0, "Use one TX ring"); + /* * Forward declarations */ @@ -310,13 +318,13 @@ static int hn_tx_conf_int_sysctl(SYSCTL_ static int hn_check_iplen(const struct mbuf *, int); static int hn_create_tx_ring(struct hn_softc *, int); static void hn_destroy_tx_ring(struct hn_tx_ring *); -static int hn_create_tx_data(struct hn_softc *); +static int hn_create_tx_data(struct hn_softc *, int); static void hn_destroy_tx_data(struct hn_softc *); static void hn_start_taskfunc(void *, int); static void hn_start_txeof_taskfunc(void *, int); static void hn_stop_tx_tasks(struct hn_softc *); static int hn_encap(struct hn_tx_ring *, struct hn_txdesc *, struct mbuf **); -static void hn_create_rx_data(struct hn_softc *sc); +static void hn_create_rx_data(struct hn_softc *sc, int); static void hn_destroy_rx_data(struct hn_softc *sc); static void hn_set_tx_chimney_size(struct hn_softc *, int); @@ -405,7 +413,7 @@ netvsc_attach(device_t dev) hn_softc_t *sc; int unit = device_get_unit(dev); struct ifnet *ifp = NULL; - int error; + int error, ring_cnt, tx_ring_cnt; #if __FreeBSD_version >= 1100045 int tso_maxlen; #endif @@ -447,11 +455,24 @@ netvsc_attach(device_t dev) ifp = sc->hn_ifp = sc->arpcom.ac_ifp = if_alloc(IFT_ETHER); ifp->if_softc = sc; - error = hn_create_tx_data(sc); + ring_cnt = hn_ring_cnt; + if (ring_cnt <= 0 || ring_cnt >= mp_ncpus) + ring_cnt = mp_ncpus; + + tx_ring_cnt = ring_cnt; + if (hn_single_tx_ring || hn_use_if_start) { + /* + * - Explicitly asked to use single TX ring. + * - ifnet.if_start is used; ifnet.if_start only needs + * one TX ring. + */ + tx_ring_cnt = 1; + } + error = hn_create_tx_data(sc, tx_ring_cnt); if (error) goto failed; - hn_create_rx_data(sc); + hn_create_rx_data(sc, ring_cnt); /* * Associate the first TX/RX ring w/ the primary channel. @@ -498,10 +519,16 @@ netvsc_attach(device_t dev) IFCAP_LRO; ifp->if_hwassist = sc->hn_tx_ring[0].hn_csum_assist | CSUM_TSO; - error = hv_rf_on_device_add(device_ctx, &device_info); + error = hv_rf_on_device_add(device_ctx, &device_info, ring_cnt); if (error) goto failed; + /* TODO: vRSS */ + sc->hn_tx_ring_inuse = 1; + sc->hn_rx_ring_inuse = 1; + device_printf(dev, "%d TX ring, %d RX ring\n", + sc->hn_tx_ring_inuse, sc->hn_rx_ring_inuse); + if (device_info.link_state == 0) { sc->hn_carrier = 1; } @@ -1416,7 +1443,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, if (sc->hn_rx_ring[0].hn_lro.lro_length_lim < HN_LRO_LENLIM_MIN(ifp)) { int i; - for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { + for (i = 0; i < sc->hn_rx_ring_inuse; ++i) { sc->hn_rx_ring[i].hn_lro.lro_length_lim = HN_LRO_LENLIM_MIN(ifp); } @@ -1453,7 +1480,8 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, NV_UNLOCK(sc); break; } - error = hv_rf_on_device_add(hn_dev, &device_info); + error = hv_rf_on_device_add(hn_dev, &device_info, + sc->hn_rx_ring_inuse); if (error) { NV_LOCK(sc); sc->temp_unusable = FALSE; @@ -1606,7 +1634,7 @@ hn_stop(hn_softc_t *sc) atomic_clear_int(&ifp->if_drv_flags, (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)); - for (i = 0; i < sc->hn_tx_ring_cnt; ++i) + for (i = 0; i < sc->hn_tx_ring_inuse; ++i) sc->hn_tx_ring[i].hn_oactive = 0; if_link_state_change(ifp, LINK_STATE_DOWN); @@ -1699,7 +1727,7 @@ hn_ifinit_locked(hn_softc_t *sc) } atomic_clear_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE); - for (i = 0; i < sc->hn_tx_ring_cnt; ++i) + for (i = 0; i < sc->hn_tx_ring_inuse; ++i) sc->hn_tx_ring[i].hn_oactive = 0; atomic_set_int(&ifp->if_drv_flags, IFF_DRV_RUNNING); @@ -1764,7 +1792,7 @@ hn_lro_lenlim_sysctl(SYSCTL_HANDLER_ARGS return EINVAL; NV_LOCK(sc); - for (i = 0; i < sc->hn_rx_ring_cnt; ++i) + for (i = 0; i < sc->hn_rx_ring_inuse; ++i) sc->hn_rx_ring[i].hn_lro.lro_length_lim = lenlim; NV_UNLOCK(sc); return 0; @@ -1794,7 +1822,7 @@ hn_lro_ackcnt_sysctl(SYSCTL_HANDLER_ARGS */ --ackcnt; NV_LOCK(sc); - for (i = 0; i < sc->hn_rx_ring_cnt; ++i) + for (i = 0; i < sc->hn_rx_ring_inuse; ++i) sc->hn_rx_ring[i].hn_lro.lro_ackcnt_lim = ackcnt; NV_UNLOCK(sc); return 0; @@ -1818,7 +1846,7 @@ hn_trust_hcsum_sysctl(SYSCTL_HANDLER_ARG return error; NV_LOCK(sc); - for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { + for (i = 0; i < sc->hn_rx_ring_inuse; ++i) { struct hn_rx_ring *rxr = &sc->hn_rx_ring[i]; if (on) @@ -1858,7 +1886,7 @@ hn_rx_stat_int_sysctl(SYSCTL_HANDLER_ARG uint64_t stat; stat = 0; - for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { + for (i = 0; i < sc->hn_rx_ring_inuse; ++i) { rxr = &sc->hn_rx_ring[i]; stat += *((int *)((uint8_t *)rxr + ofs)); } @@ -1868,7 +1896,7 @@ hn_rx_stat_int_sysctl(SYSCTL_HANDLER_ARG return error; /* Zero out this stat. */ - for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { + for (i = 0; i < sc->hn_rx_ring_inuse; ++i) { rxr = &sc->hn_rx_ring[i]; *((int *)((uint8_t *)rxr + ofs)) = 0; } @@ -1884,7 +1912,7 @@ hn_rx_stat_u64_sysctl(SYSCTL_HANDLER_ARG uint64_t stat; stat = 0; - for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { + for (i = 0; i < sc->hn_rx_ring_inuse; ++i) { rxr = &sc->hn_rx_ring[i]; stat += *((uint64_t *)((uint8_t *)rxr + ofs)); } @@ -1894,7 +1922,7 @@ hn_rx_stat_u64_sysctl(SYSCTL_HANDLER_ARG return error; /* Zero out this stat. */ - for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { + for (i = 0; i < sc->hn_rx_ring_inuse; ++i) { rxr = &sc->hn_rx_ring[i]; *((uint64_t *)((uint8_t *)rxr + ofs)) = 0; } @@ -1938,7 +1966,7 @@ hn_tx_stat_ulong_sysctl(SYSCTL_HANDLER_A u_long stat; stat = 0; - for (i = 0; i < sc->hn_tx_ring_cnt; ++i) { + for (i = 0; i < sc->hn_tx_ring_inuse; ++i) { txr = &sc->hn_tx_ring[i]; stat += *((u_long *)((uint8_t *)txr + ofs)); } @@ -1948,7 +1976,7 @@ hn_tx_stat_ulong_sysctl(SYSCTL_HANDLER_A return error; /* Zero out this stat. */ - for (i = 0; i < sc->hn_tx_ring_cnt; ++i) { + for (i = 0; i < sc->hn_tx_ring_inuse; ++i) { txr = &sc->hn_tx_ring[i]; *((u_long *)((uint8_t *)txr + ofs)) = 0; } @@ -1970,7 +1998,7 @@ hn_tx_conf_int_sysctl(SYSCTL_HANDLER_ARG return error; NV_LOCK(sc); - for (i = 0; i < sc->hn_tx_ring_cnt; ++i) { + for (i = 0; i < sc->hn_tx_ring_inuse; ++i) { txr = &sc->hn_tx_ring[i]; *((int *)((uint8_t *)txr + ofs)) = conf; } @@ -2067,7 +2095,7 @@ hn_dma_map_paddr(void *arg, bus_dma_segm } static void -hn_create_rx_data(struct hn_softc *sc) +hn_create_rx_data(struct hn_softc *sc, int ring_cnt) { struct sysctl_oid_list *child; struct sysctl_ctx_list *ctx; @@ -2079,7 +2107,9 @@ hn_create_rx_data(struct hn_softc *sc) #endif int i; - sc->hn_rx_ring_cnt = 1; /* TODO: vRSS */ + sc->hn_rx_ring_cnt = ring_cnt; + sc->hn_rx_ring_inuse = sc->hn_rx_ring_cnt; + sc->hn_rx_ring = malloc(sizeof(struct hn_rx_ring) * sc->hn_rx_ring_cnt, M_NETVSC, M_WAITOK | M_ZERO); @@ -2190,6 +2220,10 @@ hn_create_rx_data(struct hn_softc *sc) CTLTYPE_ULONG | CTLFLAG_RW, sc, __offsetof(struct hn_rx_ring, hn_small_pkts), hn_rx_stat_ulong_sysctl, "LU", "# of small packets received"); + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "rx_ring_cnt", + CTLFLAG_RD, &sc->hn_rx_ring_cnt, 0, "# created RX rings"); + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "rx_ring_inuse", + CTLFLAG_RD, &sc->hn_rx_ring_inuse, 0, "# used RX rings"); } static void @@ -2210,6 +2244,7 @@ hn_destroy_rx_data(struct hn_softc *sc) sc->hn_rx_ring = NULL; sc->hn_rx_ring_cnt = 0; + sc->hn_rx_ring_inuse = 0; } static int @@ -2446,18 +2481,15 @@ hn_destroy_tx_ring(struct hn_tx_ring *tx } static int -hn_create_tx_data(struct hn_softc *sc) +hn_create_tx_data(struct hn_softc *sc, int ring_cnt) { struct sysctl_oid_list *child; struct sysctl_ctx_list *ctx; int i; - if (hn_use_if_start) { - /* ifnet.if_start only needs one TX ring */ - sc->hn_tx_ring_cnt = 1; - } else { - sc->hn_tx_ring_cnt = 1; /* TODO: vRSS */ - } + sc->hn_tx_ring_cnt = ring_cnt; + sc->hn_tx_ring_inuse = sc->hn_tx_ring_cnt; + sc->hn_tx_ring = malloc(sizeof(struct hn_tx_ring) * sc->hn_tx_ring_cnt, M_NETVSC, M_WAITOK | M_ZERO); @@ -2516,6 +2548,10 @@ hn_create_tx_data(struct hn_softc *sc) hn_tx_conf_int_sysctl, "I", "Always schedule transmission " "instead of doing direct transmission"); + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "tx_ring_cnt", + CTLFLAG_RD, &sc->hn_tx_ring_cnt, 0, "# created TX rings"); + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "tx_ring_inuse", + CTLFLAG_RD, &sc->hn_tx_ring_inuse, 0, "# used TX rings"); return 0; } @@ -2526,7 +2562,7 @@ hn_set_tx_chimney_size(struct hn_softc * int i; NV_LOCK(sc); - for (i = 0; i < sc->hn_tx_ring_cnt; ++i) + for (i = 0; i < sc->hn_tx_ring_inuse; ++i) sc->hn_tx_ring[i].hn_tx_chimney_size = chimney_size; NV_UNLOCK(sc); } @@ -2546,6 +2582,7 @@ hn_destroy_tx_data(struct hn_softc *sc) sc->hn_tx_ring = NULL; sc->hn_tx_ring_cnt = 0; + sc->hn_tx_ring_inuse = 0; } static void @@ -2574,7 +2611,7 @@ hn_stop_tx_tasks(struct hn_softc *sc) { int i; - for (i = 0; i < sc->hn_tx_ring_cnt; ++i) { + for (i = 0; i < sc->hn_tx_ring_inuse; ++i) { struct hn_tx_ring *txr = &sc->hn_tx_ring[i]; taskqueue_drain(txr->hn_tx_taskq, &txr->hn_tx_task); @@ -2650,7 +2687,7 @@ hn_transmit(struct ifnet *ifp, struct mb * Select the TX ring based on flowid */ if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) - idx = m->m_pkthdr.flowid % sc->hn_tx_ring_cnt; + idx = m->m_pkthdr.flowid % sc->hn_tx_ring_inuse; txr = &sc->hn_tx_ring[idx]; error = drbr_enqueue(ifp, txr->hn_mbuf_br, m); @@ -2682,7 +2719,7 @@ hn_xmit_qflush(struct ifnet *ifp) struct hn_softc *sc = ifp->if_softc; int i; - for (i = 0; i < sc->hn_tx_ring_cnt; ++i) { + for (i = 0; i < sc->hn_tx_ring_inuse; ++i) { struct hn_tx_ring *txr = &sc->hn_tx_ring[i]; struct mbuf *m; Modified: stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c Wed Jun 15 06:27:43 2016 (r301917) +++ stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c Wed Jun 15 06:32:00 2016 (r301918) @@ -816,7 +816,8 @@ hv_rf_close_device(rndis_device *device) * RNDIS filter on device add */ int -hv_rf_on_device_add(struct hv_device *device, void *additl_info) +hv_rf_on_device_add(struct hv_device *device, void *additl_info, + int nchan __unused) { int ret; netvsc_dev *net_dev; Modified: stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.h Wed Jun 15 06:27:43 2016 (r301917) +++ stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.h Wed Jun 15 06:32:00 2016 (r301918) @@ -101,7 +101,7 @@ int hv_rf_on_receive(netvsc_dev *net_dev struct hv_vmbus_channel *chan, netvsc_packet *pkt); void hv_rf_receive_rollup(netvsc_dev *net_dev); void hv_rf_channel_rollup(struct hv_vmbus_channel *chan); -int hv_rf_on_device_add(struct hv_device *device, void *additl_info); +int hv_rf_on_device_add(struct hv_device *device, void *additl_info, int nchan); int hv_rf_on_device_remove(struct hv_device *device, boolean_t destroy_channel); int hv_rf_on_open(struct hv_device *device); int hv_rf_on_close(struct hv_device *device); From owner-svn-src-all@freebsd.org Wed Jun 15 06:33:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFACCB842C7; Wed, 15 Jun 2016 06:33:41 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FCB56C937; Wed, 15 Jun 2016 06:33:41 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5F6Xe7o025252; Wed, 15 Jun 2016 06:33:40 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5F6Xe3j025251; Wed, 15 Jun 2016 06:33:40 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201606150633.u5F6Xe3j025251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Wed, 15 Jun 2016 06:33:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301919 - stable/10/bin/setfacl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 06:33:41 -0000 Author: truckman Date: Wed Jun 15 06:33:40 2016 New Revision: 301919 URL: https://svnweb.freebsd.org/changeset/base/301919 Log: MFC r301582 Explicitly NUL terminate the buffer filled by fread(). The fix in r300649 was not sufficient to convince Coverity that the buffer was NUL terminated, even with the buffer pre-zeroed. Swap the size and nmemb arguments to fread() so that a valid lenght is returned, which we can use to terminate the string in the buffer at the correct location. This should also quiet the complaint about the return value of fread() not being checked. Reported by: Coverity CID: 1019054, 1009614 Secur3ty: Sponsore dby: Modified: stable/10/bin/setfacl/file.c Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/setfacl/file.c ============================================================================== --- stable/10/bin/setfacl/file.c Wed Jun 15 06:32:00 2016 (r301918) +++ stable/10/bin/setfacl/file.c Wed Jun 15 06:33:40 2016 (r301919) @@ -43,13 +43,12 @@ acl_t get_acl_from_file(const char *filename) { FILE *file; + size_t len; char buf[BUFSIZ+1]; if (filename == NULL) err(1, "(null) filename in get_acl_from_file()"); - bzero(&buf, sizeof(buf)); - if (strcmp(filename, "-") == 0) { if (have_stdin != 0) err(1, "cannot specify more than one stdin"); @@ -61,7 +60,8 @@ get_acl_from_file(const char *filename) err(1, "fopen() %s failed", filename); } - fread(buf, sizeof(buf) - 1, (size_t)1, file); + len = fread(buf, (size_t)1, sizeof(buf) - 1, file); + buf[len] = '\0'; if (ferror(file) != 0) { fclose(file); err(1, "error reading from %s", filename); From owner-svn-src-all@freebsd.org Wed Jun 15 06:40:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68601B843E1; Wed, 15 Jun 2016 06:40:31 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E9DA6CBCB; Wed, 15 Jun 2016 06:40:31 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5F6eUnE025727; Wed, 15 Jun 2016 06:40:30 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5F6eUaw025726; Wed, 15 Jun 2016 06:40:30 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201606150640.u5F6eUaw025726@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Wed, 15 Jun 2016 06:40:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301920 - stable/10/lib/libc/resolv X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 06:40:31 -0000 Author: truckman Date: Wed Jun 15 06:40:30 2016 New Revision: 301920 URL: https://svnweb.freebsd.org/changeset/base/301920 Log: MFC r301592 Don't leak addrinfo if ai->ai_addrlen <= minsiz test fails. If the ai->ai_addrlen <= minsiz test fails, then freeaddrinfo() does not get called to free the memory just allocated by getaddrinfo(). Fix by moving ai->ai_addrlen <= minsiz to a separate nested if block, and keep freeaddrinfo() in the outer block so that freeaddrinfo() will be called whenever getaddrinfo() succeeds. Reported by: Coverity CID: 1273652 Reviewed by: ume Differential Revision: https://reviews.freebsd.org/D6756 Modified: stable/10/lib/libc/resolv/res_init.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/resolv/res_init.c ============================================================================== --- stable/10/lib/libc/resolv/res_init.c Wed Jun 15 06:33:40 2016 (r301919) +++ stable/10/lib/libc/resolv/res_init.c Wed Jun 15 06:40:30 2016 (r301920) @@ -412,20 +412,21 @@ __res_vinit(res_state statp, int preinit hints.ai_socktype = SOCK_DGRAM; /*dummy*/ hints.ai_flags = AI_NUMERICHOST; sprintf(sbuf, "%u", NAMESERVER_PORT); - if (getaddrinfo(cp, sbuf, &hints, &ai) == 0 && - ai->ai_addrlen <= minsiz) { - if (statp->_u._ext.ext != NULL) { - memcpy(&statp->_u._ext.ext->nsaddrs[nserv], - ai->ai_addr, ai->ai_addrlen); + if (getaddrinfo(cp, sbuf, &hints, &ai) == 0) { + if (ai->ai_addrlen <= minsiz) { + if (statp->_u._ext.ext != NULL) { + memcpy(&statp->_u._ext.ext->nsaddrs[nserv], + ai->ai_addr, ai->ai_addrlen); + } + if (ai->ai_addrlen <= + sizeof(statp->nsaddr_list[nserv])) { + memcpy(&statp->nsaddr_list[nserv], + ai->ai_addr, ai->ai_addrlen); + } else + statp->nsaddr_list[nserv].sin_family = 0; + nserv++; } - if (ai->ai_addrlen <= - sizeof(statp->nsaddr_list[nserv])) { - memcpy(&statp->nsaddr_list[nserv], - ai->ai_addr, ai->ai_addrlen); - } else - statp->nsaddr_list[nserv].sin_family = 0; freeaddrinfo(ai); - nserv++; } } continue; From owner-svn-src-all@freebsd.org Wed Jun 15 06:42:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80710B8457C; Wed, 15 Jun 2016 06:42:31 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 501381313; Wed, 15 Jun 2016 06:42:31 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5F6gUIJ029294; Wed, 15 Jun 2016 06:42:30 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5F6gU4U029293; Wed, 15 Jun 2016 06:42:30 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201606150642.u5F6gU4U029293@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Wed, 15 Jun 2016 06:42:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301921 - stable/10/lib/libc/gen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 06:42:31 -0000 Author: truckman Date: Wed Jun 15 06:42:30 2016 New Revision: 301921 URL: https://svnweb.freebsd.org/changeset/base/301921 Log: MFC r301596 Don't leak olinep if malloc() fails. If malloc() fails to allocate linep, then free olinep (if it exists) before returning to avoid a memory leak. Reported by: Coverity CID: 1016716 Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D6755 Modified: stable/10/lib/libc/gen/getnetgrent.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/getnetgrent.c ============================================================================== --- stable/10/lib/libc/gen/getnetgrent.c Wed Jun 15 06:40:30 2016 (r301920) +++ stable/10/lib/libc/gen/getnetgrent.c Wed Jun 15 06:42:30 2016 (r301921) @@ -615,6 +615,8 @@ read_for_group(const char *group) if (linep == NULL) { free(lp->l_groupname); free(lp); + if (olen > 0) + free(olinep); return (NULL); } if (olen > 0) { From owner-svn-src-all@freebsd.org Wed Jun 15 06:44:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 557D4B845E3; Wed, 15 Jun 2016 06:44:36 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07A4C14FF; Wed, 15 Jun 2016 06:44:35 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5F6RikX021700; Wed, 15 Jun 2016 06:27:44 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5F6Ri4K021699; Wed, 15 Jun 2016 06:27:44 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201606150627.u5F6Ri4K021699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Wed, 15 Jun 2016 06:27:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301917 - stable/10/games/random X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 06:44:36 -0000 Author: truckman Date: Wed Jun 15 06:27:43 2016 New Revision: 301917 URL: https://svnweb.freebsd.org/changeset/base/301917 Log: MFC r299484, r301574 r299484 | cem | 2016-05-11 15:04:28 -0700 (Wed, 11 May 2016) | 13 lines random(6): Fix double-close In the case where a file lacks a trailing newline, there is some "evil" code to reverse goto the tokenizing code ("make_token") for the final token in the file. In this case, 'fd' is closed more than once. Use a negative sentinel value to guard close(2), preventing the double close. Ideally, this code would be restructured to avoid this ugly construction. r301574 | truckman | 2016-06-07 19:14:05 -0700 (Tue, 07 Jun 2016) | 15 lines Fix a (false positive?) Argument cannot be negative coverity defect. Rather than guarding close(fd) with an fd >= 0 test and setting fd to -1 when it is closed to avoid a potential double-close, just move the close() call after the conditional "goto make_token". This moves the close() call totally outside the loop to avoid the possibility of calling it twice. This should also prevent a Coverity warning about checking fd for validity after it was previously passed to read(). Reported by: Coverity CID: 1006123, 1355335 Modified: stable/10/games/random/randomize_fd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/games/random/randomize_fd.c ============================================================================== --- stable/10/games/random/randomize_fd.c Wed Jun 15 06:08:05 2016 (r301916) +++ stable/10/games/random/randomize_fd.c Wed Jun 15 06:27:43 2016 (r301917) @@ -174,7 +174,7 @@ randomize_fd(int fd, int type, int uniqu if ((type == RANDOM_TYPE_LINES && buf[i] == '\n') || (type == RANDOM_TYPE_WORDS && isspace(buf[i])) || (eof && i == buflen - 1)) { - make_token: +make_token: if (numnode == RANDOM_MAX_PLUS1) { errno = EFBIG; err(1, "too many delimiters"); @@ -199,14 +199,14 @@ randomize_fd(int fd, int type, int uniqu } } - (void)close(fd); - /* Necessary evil to compensate for files that don't end with a newline */ if (bufc != i) { i--; goto make_token; } + (void)close(fd); + free(buf); for (i = numnode; i > 0; i--) { From owner-svn-src-all@freebsd.org Wed Jun 15 08:34:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43362A09D82; Wed, 15 Jun 2016 08:34:37 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13AE81740; Wed, 15 Jun 2016 08:34:37 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5F8YaGH070080; Wed, 15 Jun 2016 08:34:36 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5F8Yac1070079; Wed, 15 Jun 2016 08:34:36 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201606150834.u5F8Yac1070079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 15 Jun 2016 08:34:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301922 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 08:34:37 -0000 Author: mjg Date: Wed Jun 15 08:34:36 2016 New Revision: 301922 URL: https://svnweb.freebsd.org/changeset/base/301922 Log: sdt: annotate the probe test as likely to fail This saves a jump in plenty of cases. Approved by: re (kib) MFC after: 1 week Modified: head/sys/sys/sdt.h Modified: head/sys/sys/sdt.h ============================================================================== --- head/sys/sys/sdt.h Wed Jun 15 06:42:30 2016 (r301921) +++ head/sys/sys/sdt.h Wed Jun 15 08:34:36 2016 (r301922) @@ -161,7 +161,7 @@ SET_DECLARE(sdt_argtypes_set, struct sdt extern struct sdt_probe sdt_##prov##_##mod##_##func##_##name[1] #define SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) do { \ - if (sdt_##prov##_##mod##_##func##_##name->id) \ + if (__predict_false(sdt_##prov##_##mod##_##func##_##name->id)) \ (*sdt_probe_func)(sdt_##prov##_##mod##_##func##_##name->id, \ (uintptr_t) arg0, (uintptr_t) arg1, (uintptr_t) arg2, \ (uintptr_t) arg3, (uintptr_t) arg4); \ From owner-svn-src-all@freebsd.org Wed Jun 15 09:08:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A96DA13AA0; Wed, 15 Jun 2016 09:08:15 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DCBD1DE4; Wed, 15 Jun 2016 09:08:15 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5F98EMT082435; Wed, 15 Jun 2016 09:08:14 GMT (envelope-from mat@FreeBSD.org) Received: (from mat@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5F98Egu082434; Wed, 15 Jun 2016 09:08:14 GMT (envelope-from mat@FreeBSD.org) Message-Id: <201606150908.u5F98Egu082434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mat set sender to mat@FreeBSD.org using -f From: Mathieu Arnold Date: Wed, 15 Jun 2016 09:08:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r301923 - svnadmin/hooks/scripts X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 09:08:15 -0000 Author: mat (doc,ports committer) Date: Wed Jun 15 09:08:14 2016 New Revision: 301923 URL: https://svnweb.freebsd.org/changeset/base/301923 Log: Sync all svnadmin hooks to prevent empty messages, and update with current commit hook template lines Modified: svnadmin/hooks/scripts/log-police.py Modified: svnadmin/hooks/scripts/log-police.py ============================================================================== --- svnadmin/hooks/scripts/log-police.py Wed Jun 15 08:34:36 2016 (r301922) +++ svnadmin/hooks/scripts/log-police.py Wed Jun 15 09:08:14 2016 (r301923) @@ -46,13 +46,18 @@ def fix_log_message(log_message): # should check last paragraph for known headers. if line == "PR:": continue if line == "Submitted by:": continue + if line == "Reported by:": continue if line == "Reviewed by:": continue if line == "Approved by:": continue if line == "Obtained from:": continue if line == "MFC after:": continue + if line == "MFH:": continue if line == "Relnotes:": continue if line == "Security:": continue + if line == "Changes:": continue + if line == "With hat:": continue if line == "Sponsored by:": continue + if line == "Differential Revision:": continue s = s + line + "\n" s = s.rstrip() + "\n" return s From owner-svn-src-all@freebsd.org Wed Jun 15 09:39:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3712A1D1CA; Wed, 15 Jun 2016 09:39:42 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB1ED1DEA; Wed, 15 Jun 2016 09:39:42 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5F9df2j093517; Wed, 15 Jun 2016 09:39:41 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5F9dffE093515; Wed, 15 Jun 2016 09:39:41 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606150939.u5F9dffE093515@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 15 Jun 2016 09:39:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301924 - stable/10/sys/dev/hyperv/vmbus X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 09:39:42 -0000 Author: sephe Date: Wed Jun 15 09:39:41 2016 New Revision: 301924 URL: https://svnweb.freebsd.org/changeset/base/301924 Log: MFC 297219 hyperv/vmbus: use a better retry method in hv_vmbus_post_message() Most often, hv_vmbus_post_message() doesn't fail. However, it fails intermittently when GPADLs of large shared memory is to be established with the host, e.g. on the hn(4) attach path: a GPADL of 15MB sendbuf is created, for which lots of messages will be flooded to the host. The host side tries to throttle the message rate by returning HV_STATUS_INSUFFICIENT_BUFFERS. Before this commit, we do several retries for failed messages, but the delay between each retry is pretty/too low, which will cause sporadic message posting failure. We now use large delay (>=1ms) between each retry to fix the message posting failure. Submitted by: Dexuan Cui Reviewed by: sephe MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5715 Modified: stable/10/sys/dev/hyperv/vmbus/hv_connection.c stable/10/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/vmbus/hv_connection.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_connection.c Wed Jun 15 09:08:14 2016 (r301923) +++ stable/10/sys/dev/hyperv/vmbus/hv_connection.c Wed Jun 15 09:39:41 2016 (r301924) @@ -367,31 +367,35 @@ hv_vmbus_on_events(int cpu) /** * Send a msg on the vmbus's message connection */ -int hv_vmbus_post_message(void *buffer, size_t bufferLen) { - int ret = 0; +int hv_vmbus_post_message(void *buffer, size_t bufferLen) +{ hv_vmbus_connection_id connId; - unsigned retries = 0; - - /* NetScaler delays from previous code were consolidated here */ - static int delayAmount[] = {100, 100, 100, 500, 500, 5000, 5000, 5000}; - - /* for(each entry in delayAmount) try to post message, - * delay a little bit before retrying + sbintime_t time = SBT_1MS; + int retries; + int ret; + + connId.as_uint32_t = 0; + connId.u.id = HV_VMBUS_MESSAGE_CONNECTION_ID; + + /* + * We retry to cope with transient failures caused by host side's + * insufficient resources. 20 times should suffice in practice. */ - for (retries = 0; - retries < sizeof(delayAmount)/sizeof(delayAmount[0]); retries++) { - connId.as_uint32_t = 0; - connId.u.id = HV_VMBUS_MESSAGE_CONNECTION_ID; - ret = hv_vmbus_post_msg_via_msg_ipc(connId, 1, buffer, bufferLen); - if (ret != HV_STATUS_INSUFFICIENT_BUFFERS) - break; - /* TODO: KYS We should use a blocking wait call */ - DELAY(delayAmount[retries]); + for (retries = 0; retries < 20; retries++) { + ret = hv_vmbus_post_msg_via_msg_ipc(connId, 1, buffer, + bufferLen); + if (ret == HV_STATUS_SUCCESS) + return (0); + + pause_sbt("pstmsg", time, 0, C_HARDCLOCK); + if (time < SBT_1S * 2) + time *= 2; } - KASSERT(ret == 0, ("Error VMBUS: Message Post Failed\n")); + KASSERT(ret == HV_STATUS_SUCCESS, + ("Error VMBUS: Message Post Failed, ret=%d\n", ret)); - return (ret); + return (EAGAIN); } /** Modified: stable/10/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Wed Jun 15 09:08:14 2016 (r301923) +++ stable/10/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Wed Jun 15 09:39:41 2016 (r301924) @@ -70,6 +70,7 @@ typedef uint16_t hv_vmbus_status; * You did not supply enough message buffers to send a message. */ +#define HV_STATUS_SUCCESS ((uint16_t)0) #define HV_STATUS_INSUFFICIENT_BUFFERS ((uint16_t)0x0013) typedef void (*hv_vmbus_channel_callback)(void *context); From owner-svn-src-all@freebsd.org Wed Jun 15 09:52:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02DC2A1D64C; Wed, 15 Jun 2016 09:52:03 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA13D1737; Wed, 15 Jun 2016 09:52:02 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5F9q1L4000707; Wed, 15 Jun 2016 09:52:01 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5F9q1k6000704; Wed, 15 Jun 2016 09:52:01 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606150952.u5F9q1k6000704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 15 Jun 2016 09:52:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301925 - stable/10/sys/dev/hyperv/vmbus X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 09:52:03 -0000 Author: sephe Date: Wed Jun 15 09:52:01 2016 New Revision: 301925 URL: https://svnweb.freebsd.org/changeset/base/301925 Log: MFC 297635 hyperv/vmbus: Use default mtx for channel message queue First of all sema_post() can't be called w/ spinlock, and the channel message queue processing is not on hot code path, i.e. spinlock is not necessary. Submitted by: Jun Su Reviewed by: sephe, Dexuan Cui MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5812 Modified: stable/10/sys/dev/hyperv/vmbus/hv_channel.c stable/10/sys/dev/hyperv/vmbus/hv_channel_mgmt.c stable/10/sys/dev/hyperv/vmbus/hv_connection.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/vmbus/hv_channel.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_channel.c Wed Jun 15 09:39:41 2016 (r301924) +++ stable/10/sys/dev/hyperv/vmbus/hv_channel.c Wed Jun 15 09:52:01 2016 (r301925) @@ -270,12 +270,12 @@ hv_vmbus_channel_open( if (user_data_len) memcpy(open_msg->user_data, user_data, user_data_len); - mtx_lock_spin(&hv_vmbus_g_connection.channel_msg_lock); + mtx_lock(&hv_vmbus_g_connection.channel_msg_lock); TAILQ_INSERT_TAIL( &hv_vmbus_g_connection.channel_msg_anchor, open_info, msg_list_entry); - mtx_unlock_spin(&hv_vmbus_g_connection.channel_msg_lock); + mtx_unlock(&hv_vmbus_g_connection.channel_msg_lock); ret = hv_vmbus_post_message( open_msg, sizeof(hv_vmbus_channel_open_channel)); @@ -302,12 +302,12 @@ hv_vmbus_channel_open( } cleanup: - mtx_lock_spin(&hv_vmbus_g_connection.channel_msg_lock); + mtx_lock(&hv_vmbus_g_connection.channel_msg_lock); TAILQ_REMOVE( &hv_vmbus_g_connection.channel_msg_anchor, open_info, msg_list_entry); - mtx_unlock_spin(&hv_vmbus_g_connection.channel_msg_lock); + mtx_unlock(&hv_vmbus_g_connection.channel_msg_lock); sema_destroy(&open_info->wait_sema); free(open_info, M_DEVBUF); @@ -496,13 +496,13 @@ hv_vmbus_channel_establish_gpadl( gpadl_msg->child_rel_id = channel->offer_msg.child_rel_id; gpadl_msg->gpadl = next_gpadl_handle; - mtx_lock_spin(&hv_vmbus_g_connection.channel_msg_lock); + mtx_lock(&hv_vmbus_g_connection.channel_msg_lock); TAILQ_INSERT_TAIL( &hv_vmbus_g_connection.channel_msg_anchor, msg_info, msg_list_entry); - mtx_unlock_spin(&hv_vmbus_g_connection.channel_msg_lock); + mtx_unlock(&hv_vmbus_g_connection.channel_msg_lock); ret = hv_vmbus_post_message( gpadl_msg, @@ -541,10 +541,10 @@ hv_vmbus_channel_establish_gpadl( cleanup: - mtx_lock_spin(&hv_vmbus_g_connection.channel_msg_lock); + mtx_lock(&hv_vmbus_g_connection.channel_msg_lock); TAILQ_REMOVE(&hv_vmbus_g_connection.channel_msg_anchor, msg_info, msg_list_entry); - mtx_unlock_spin(&hv_vmbus_g_connection.channel_msg_lock); + mtx_unlock(&hv_vmbus_g_connection.channel_msg_lock); sema_destroy(&msg_info->wait_sema); free(msg_info, M_DEVBUF); @@ -583,10 +583,10 @@ hv_vmbus_channel_teardown_gpdal( msg->child_rel_id = channel->offer_msg.child_rel_id; msg->gpadl = gpadl_handle; - mtx_lock_spin(&hv_vmbus_g_connection.channel_msg_lock); + mtx_lock(&hv_vmbus_g_connection.channel_msg_lock); TAILQ_INSERT_TAIL(&hv_vmbus_g_connection.channel_msg_anchor, info, msg_list_entry); - mtx_unlock_spin(&hv_vmbus_g_connection.channel_msg_lock); + mtx_unlock(&hv_vmbus_g_connection.channel_msg_lock); ret = hv_vmbus_post_message(msg, sizeof(hv_vmbus_channel_gpadl_teardown)); @@ -599,10 +599,10 @@ cleanup: /* * Received a torndown response */ - mtx_lock_spin(&hv_vmbus_g_connection.channel_msg_lock); + mtx_lock(&hv_vmbus_g_connection.channel_msg_lock); TAILQ_REMOVE(&hv_vmbus_g_connection.channel_msg_anchor, info, msg_list_entry); - mtx_unlock_spin(&hv_vmbus_g_connection.channel_msg_lock); + mtx_unlock(&hv_vmbus_g_connection.channel_msg_lock); sema_destroy(&info->wait_sema); free(info, M_DEVBUF); Modified: stable/10/sys/dev/hyperv/vmbus/hv_channel_mgmt.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Wed Jun 15 09:39:41 2016 (r301924) +++ stable/10/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Wed Jun 15 09:52:01 2016 (r301925) @@ -499,7 +499,7 @@ vmbus_channel_on_open_result(hv_vmbus_ch /* * Find the open msg, copy the result and signal/unblock the wait event */ - mtx_lock_spin(&hv_vmbus_g_connection.channel_msg_lock); + mtx_lock(&hv_vmbus_g_connection.channel_msg_lock); TAILQ_FOREACH(msg_info, &hv_vmbus_g_connection.channel_msg_anchor, msg_list_entry) { @@ -517,7 +517,7 @@ vmbus_channel_on_open_result(hv_vmbus_ch } } } - mtx_unlock_spin(&hv_vmbus_g_connection.channel_msg_lock); + mtx_unlock(&hv_vmbus_g_connection.channel_msg_lock); } @@ -541,7 +541,7 @@ vmbus_channel_on_gpadl_created(hv_vmbus_ /* Find the establish msg, copy the result and signal/unblock * the wait event */ - mtx_lock_spin(&hv_vmbus_g_connection.channel_msg_lock); + mtx_lock(&hv_vmbus_g_connection.channel_msg_lock); TAILQ_FOREACH(msg_info, &hv_vmbus_g_connection.channel_msg_anchor, msg_list_entry) { request_header = (hv_vmbus_channel_msg_header*) msg_info->msg; @@ -560,7 +560,7 @@ vmbus_channel_on_gpadl_created(hv_vmbus_ } } } - mtx_unlock_spin(&hv_vmbus_g_connection.channel_msg_lock); + mtx_unlock(&hv_vmbus_g_connection.channel_msg_lock); } /** @@ -585,7 +585,7 @@ vmbus_channel_on_gpadl_torndown(hv_vmbus * wait event. */ - mtx_lock_spin(&hv_vmbus_g_connection.channel_msg_lock); + mtx_lock(&hv_vmbus_g_connection.channel_msg_lock); TAILQ_FOREACH(msg_info, &hv_vmbus_g_connection.channel_msg_anchor, msg_list_entry) { @@ -605,7 +605,7 @@ vmbus_channel_on_gpadl_torndown(hv_vmbus } } } - mtx_unlock_spin(&hv_vmbus_g_connection.channel_msg_lock); + mtx_unlock(&hv_vmbus_g_connection.channel_msg_lock); } /** @@ -625,7 +625,7 @@ vmbus_channel_on_version_response(hv_vmb versionResponse = (hv_vmbus_channel_version_response*)hdr; - mtx_lock_spin(&hv_vmbus_g_connection.channel_msg_lock); + mtx_lock(&hv_vmbus_g_connection.channel_msg_lock); TAILQ_FOREACH(msg_info, &hv_vmbus_g_connection.channel_msg_anchor, msg_list_entry) { requestHeader = (hv_vmbus_channel_msg_header*) msg_info->msg; @@ -639,7 +639,7 @@ vmbus_channel_on_version_response(hv_vmb sema_post(&msg_info->wait_sema); } } - mtx_unlock_spin(&hv_vmbus_g_connection.channel_msg_lock); + mtx_unlock(&hv_vmbus_g_connection.channel_msg_lock); } Modified: stable/10/sys/dev/hyperv/vmbus/hv_connection.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_connection.c Wed Jun 15 09:39:41 2016 (r301924) +++ stable/10/sys/dev/hyperv/vmbus/hv_connection.c Wed Jun 15 09:52:01 2016 (r301925) @@ -99,26 +99,26 @@ hv_vmbus_negotiate_version(hv_vmbus_chan * Add to list before we send the request since we may receive the * response before returning from this routine */ - mtx_lock_spin(&hv_vmbus_g_connection.channel_msg_lock); + mtx_lock(&hv_vmbus_g_connection.channel_msg_lock); TAILQ_INSERT_TAIL( &hv_vmbus_g_connection.channel_msg_anchor, msg_info, msg_list_entry); - mtx_unlock_spin(&hv_vmbus_g_connection.channel_msg_lock); + mtx_unlock(&hv_vmbus_g_connection.channel_msg_lock); ret = hv_vmbus_post_message( msg, sizeof(hv_vmbus_channel_initiate_contact)); if (ret != 0) { - mtx_lock_spin(&hv_vmbus_g_connection.channel_msg_lock); + mtx_lock(&hv_vmbus_g_connection.channel_msg_lock); TAILQ_REMOVE( &hv_vmbus_g_connection.channel_msg_anchor, msg_info, msg_list_entry); - mtx_unlock_spin(&hv_vmbus_g_connection.channel_msg_lock); + mtx_unlock(&hv_vmbus_g_connection.channel_msg_lock); return (ret); } @@ -127,12 +127,12 @@ hv_vmbus_negotiate_version(hv_vmbus_chan */ ret = sema_timedwait(&msg_info->wait_sema, 5 * hz); /* KYS 5 seconds */ - mtx_lock_spin(&hv_vmbus_g_connection.channel_msg_lock); + mtx_lock(&hv_vmbus_g_connection.channel_msg_lock); TAILQ_REMOVE( &hv_vmbus_g_connection.channel_msg_anchor, msg_info, msg_list_entry); - mtx_unlock_spin(&hv_vmbus_g_connection.channel_msg_lock); + mtx_unlock(&hv_vmbus_g_connection.channel_msg_lock); /** * Check if successful @@ -169,7 +169,7 @@ hv_vmbus_connect(void) { TAILQ_INIT(&hv_vmbus_g_connection.channel_msg_anchor); mtx_init(&hv_vmbus_g_connection.channel_msg_lock, "vmbus channel msg", - NULL, MTX_SPIN); + NULL, MTX_DEF); TAILQ_INIT(&hv_vmbus_g_connection.channel_anchor); mtx_init(&hv_vmbus_g_connection.channel_lock, "vmbus channel", From owner-svn-src-all@freebsd.org Wed Jun 15 14:11:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3820A44132; Wed, 15 Jun 2016 14:11:50 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94912197B; Wed, 15 Jun 2016 14:11:50 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5FEBnho092697; Wed, 15 Jun 2016 14:11:49 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5FEBnGc092696; Wed, 15 Jun 2016 14:11:49 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201606151411.u5FEBnGc092696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Wed, 15 Jun 2016 14:11:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301926 - stable/10/usr.sbin/newsyslog X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 14:11:50 -0000 Author: vangyzen Date: Wed Jun 15 14:11:49 2016 New Revision: 301926 URL: https://svnweb.freebsd.org/changeset/base/301926 Log: MFC r301532 newsyslog: Eliminate unnecessary sleep(10) when -R and -s are specified After going through the signal work list, during which do_sigwork() is called and essentially does nothing because -s and -R were specified on the command line, newsyslog will sleep for 10 seconds as the (verbose) code says: "Pause 10 seconds to allow daemon(s) to close log file(s)". However, the man page verbiage for -R (and -s) seems quite clear that this sleep() is unnecessary because the daemon was expected to have already closed the log file before calling newsyslog. PR: 210020 Submitted by: David A. Bright Sponsored by: Dell Inc. Modified: stable/10/usr.sbin/newsyslog/newsyslog.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/10/usr.sbin/newsyslog/newsyslog.c Wed Jun 15 09:52:01 2016 (r301925) +++ stable/10/usr.sbin/newsyslog/newsyslog.c Wed Jun 15 14:11:49 2016 (r301926) @@ -333,13 +333,15 @@ main(int argc, char **argv) printf("Signal all daemon process(es)...\n"); SLIST_FOREACH(stmp, &swhead, sw_nextp) do_sigwork(stmp); - if (noaction) - printf("\tsleep 10\n"); - else { - if (verbose) - printf("Pause 10 seconds to allow daemon(s)" - " to close log file(s)\n"); - sleep(10); + if (!(rotatereq && nosignal)) { + if (noaction) + printf("\tsleep 10\n"); + else { + if (verbose) + printf("Pause 10 seconds to allow " + "daemon(s) to close log file(s)\n"); + sleep(10); + } } } /* From owner-svn-src-all@freebsd.org Wed Jun 15 14:12:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1C39A44196; Wed, 15 Jun 2016 14:12:23 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A14FC1C19; Wed, 15 Jun 2016 14:12:23 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5FECMgQ095508; Wed, 15 Jun 2016 14:12:22 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5FECMY8095507; Wed, 15 Jun 2016 14:12:22 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201606151412.u5FECMY8095507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Wed, 15 Jun 2016 14:12:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301927 - stable/9/usr.sbin/newsyslog X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 14:12:23 -0000 Author: vangyzen Date: Wed Jun 15 14:12:22 2016 New Revision: 301927 URL: https://svnweb.freebsd.org/changeset/base/301927 Log: MFC r301532 newsyslog: Eliminate unnecessary sleep(10) when -R and -s are specified After going through the signal work list, during which do_sigwork() is called and essentially does nothing because -s and -R were specified on the command line, newsyslog will sleep for 10 seconds as the (verbose) code says: "Pause 10 seconds to allow daemon(s) to close log file(s)". However, the man page verbiage for -R (and -s) seems quite clear that this sleep() is unnecessary because the daemon was expected to have already closed the log file before calling newsyslog. PR: 210020 Submitted by: David A. Bright Sponsored by: Dell Inc. Modified: stable/9/usr.sbin/newsyslog/newsyslog.c Directory Properties: stable/9/usr.sbin/newsyslog/ (props changed) Modified: stable/9/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/9/usr.sbin/newsyslog/newsyslog.c Wed Jun 15 14:11:49 2016 (r301926) +++ stable/9/usr.sbin/newsyslog/newsyslog.c Wed Jun 15 14:12:22 2016 (r301927) @@ -330,13 +330,15 @@ main(int argc, char **argv) printf("Signal all daemon process(es)...\n"); SLIST_FOREACH(stmp, &swhead, sw_nextp) do_sigwork(stmp); - if (noaction) - printf("\tsleep 10\n"); - else { - if (verbose) - printf("Pause 10 seconds to allow daemon(s)" - " to close log file(s)\n"); - sleep(10); + if (!(rotatereq && nosignal)) { + if (noaction) + printf("\tsleep 10\n"); + else { + if (verbose) + printf("Pause 10 seconds to allow " + "daemon(s) to close log file(s)\n"); + sleep(10); + } } } /* From owner-svn-src-all@freebsd.org Wed Jun 15 15:55:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EE8AA450CE; Wed, 15 Jun 2016 15:55:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFD1019E3; Wed, 15 Jun 2016 15:55:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5FFtFkK032187; Wed, 15 Jun 2016 15:55:15 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5FFtFZq032186; Wed, 15 Jun 2016 15:55:15 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606151555.u5FFtFZq032186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 15 Jun 2016 15:55:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301928 - head/sys/fs/devfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 15:55:16 -0000 Author: kib Date: Wed Jun 15 15:55:14 2016 New Revision: 301928 URL: https://svnweb.freebsd.org/changeset/base/301928 Log: Another follow-up to r291460. Only access vp->v_rdev for VCHR vnodes in devfs_reclaim(). Reported and tested by: pho Sponsored by: The FreeBSD Foundation Approved by: re (gjb) MFC after: 1 week Modified: head/sys/fs/devfs/devfs_vnops.c Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Wed Jun 15 14:12:22 2016 (r301927) +++ head/sys/fs/devfs/devfs_vnops.c Wed Jun 15 15:55:14 2016 (r301928) @@ -1360,10 +1360,10 @@ devfs_readlink(struct vop_readlink_args static int devfs_reclaim(struct vop_reclaim_args *ap) { - struct vnode *vp = ap->a_vp; + struct vnode *vp; struct devfs_dirent *de; - struct cdev *dev; + vp = ap->a_vp; mtx_lock(&devfs_de_interlock); de = vp->v_data; if (de != NULL) { @@ -1371,24 +1371,31 @@ devfs_reclaim(struct vop_reclaim_args *a vp->v_data = NULL; } mtx_unlock(&devfs_de_interlock); - vnode_destroy_vobject(vp); + return (0); +} + +static int +devfs_reclaim_vchr(struct vop_reclaim_args *ap) +{ + struct vnode *vp; + struct cdev *dev; + + vp = ap->a_vp; + MPASS(vp->v_type == VCHR); + + devfs_reclaim(ap); VI_LOCK(vp); dev_lock(); dev = vp->v_rdev; vp->v_rdev = NULL; - - if (dev == NULL) { - dev_unlock(); - VI_UNLOCK(vp); - return (0); - } - - dev->si_usecount -= vp->v_usecount; + if (dev != NULL) + dev->si_usecount -= vp->v_usecount; dev_unlock(); VI_UNLOCK(vp); - dev_rel(dev); + if (dev != NULL) + dev_rel(dev); return (0); } @@ -1898,7 +1905,7 @@ static struct vop_vector devfs_specops = .vop_readdir = VOP_PANIC, .vop_readlink = VOP_PANIC, .vop_reallocblks = VOP_PANIC, - .vop_reclaim = devfs_reclaim, + .vop_reclaim = devfs_reclaim_vchr, .vop_remove = devfs_remove, .vop_rename = VOP_PANIC, .vop_revoke = devfs_revoke, From owner-svn-src-all@freebsd.org Wed Jun 15 15:56:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4D8AA451C3; Wed, 15 Jun 2016 15:56:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A9E41B71; Wed, 15 Jun 2016 15:56:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5FFu39s032258; Wed, 15 Jun 2016 15:56:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5FFu3pt032257; Wed, 15 Jun 2016 15:56:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606151556.u5FFu3pt032257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 15 Jun 2016 15:56:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301929 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 15:56:04 -0000 Author: kib Date: Wed Jun 15 15:56:03 2016 New Revision: 301929 URL: https://svnweb.freebsd.org/changeset/base/301929 Log: Do not assume that we own the use reference on the covered vnode until we set MNTK_UNMOUNT flag on the mp. Otherwise parallel unmount which wins race with us could dereference the covered vnode, and we are left with the locked freed memory. Reported and tested by: pho Sponsored by: The FreeBSD Foundation Approved by: re (gjb) MFC after: 1 week Modified: head/sys/kern/vfs_mount.c Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Wed Jun 15 15:55:14 2016 (r301928) +++ head/sys/kern/vfs_mount.c Wed Jun 15 15:56:03 2016 (r301929) @@ -1220,7 +1220,6 @@ dounmount(struct mount *mp, int flags, s VI_LOCK(coveredvp); vholdl(coveredvp); vn_lock(coveredvp, LK_EXCLUSIVE | LK_INTERLOCK | LK_RETRY); - vdrop(coveredvp); /* * Check for mp being unmounted while waiting for the * covered vnode lock. @@ -1228,18 +1227,22 @@ dounmount(struct mount *mp, int flags, s if (coveredvp->v_mountedhere != mp || coveredvp->v_mountedhere->mnt_gen != mnt_gen_r) { VOP_UNLOCK(coveredvp, 0); + vdrop(coveredvp); vfs_rel(mp); return (EBUSY); } } + /* * Only privileged root, or (if MNT_USER is set) the user that did the * original mount is permitted to unmount this filesystem. */ error = vfs_suser(mp, td); if (error != 0) { - if (coveredvp) + if (coveredvp != NULL) { VOP_UNLOCK(coveredvp, 0); + vdrop(coveredvp); + } vfs_rel(mp); return (error); } @@ -1249,8 +1252,10 @@ dounmount(struct mount *mp, int flags, s if ((mp->mnt_kern_flag & MNTK_UNMOUNT) != 0 || !TAILQ_EMPTY(&mp->mnt_uppers)) { MNT_IUNLOCK(mp); - if (coveredvp) + if (coveredvp != NULL) { VOP_UNLOCK(coveredvp, 0); + vdrop(coveredvp); + } vn_finished_write(mp); return (EBUSY); } @@ -1283,6 +1288,16 @@ dounmount(struct mount *mp, int flags, s if (mp->mnt_flag & MNT_EXPUBLIC) vfs_setpublicfs(NULL, NULL, NULL); + /* + * From now, we can claim that the use reference on the + * coveredvp is ours, and the ref can be released only by + * successfull unmount by us, or left for later unmount + * attempt. The previously acquired hold reference is no + * longer needed to protect the vnode from reuse. + */ + if (coveredvp != NULL) + vdrop(coveredvp); + vfs_msync(mp, MNT_WAIT); MNT_ILOCK(mp); async_flag = mp->mnt_flag & MNT_ASYNC; From owner-svn-src-all@freebsd.org Wed Jun 15 20:56:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16731A47960; Wed, 15 Jun 2016 20:56:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8D871357; Wed, 15 Jun 2016 20:56:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5FKujHI008381; Wed, 15 Jun 2016 20:56:45 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5FKujOu008377; Wed, 15 Jun 2016 20:56:45 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201606152056.u5FKujOu008377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 15 Jun 2016 20:56:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301930 - in head/sys: dev/cxgbe/tom kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 20:56:47 -0000 Author: jhb Date: Wed Jun 15 20:56:45 2016 New Revision: 301930 URL: https://svnweb.freebsd.org/changeset/base/301930 Log: Move backend-specific fields of kaiocb into a union. This reduces the size of kaiocb slightly. I've also added some generic fields that other backends can use in place of the BIO-specific fields. Change the socket and Chelsio DDP backends to use 'backend3' instead of abusing _aiocb_private.status directly. This confines the use of _aiocb_private to the AIO internals in vfs_aio.c. Reviewed by: kib (earlier version) Approved by: re (gjb) Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D6547 Modified: head/sys/dev/cxgbe/tom/t4_ddp.c head/sys/kern/sys_socket.c head/sys/kern/vfs_aio.c head/sys/sys/aio.h Modified: head/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_ddp.c Wed Jun 15 15:56:03 2016 (r301929) +++ head/sys/dev/cxgbe/tom/t4_ddp.c Wed Jun 15 20:56:45 2016 (r301930) @@ -74,6 +74,12 @@ VNET_DECLARE(int, tcp_autorcvbuf_inc); VNET_DECLARE(int, tcp_autorcvbuf_max); #define V_tcp_autorcvbuf_max VNET(tcp_autorcvbuf_max) +/* + * Use the 'backend3' field in AIO jobs to store the amount of data + * received by the AIO job so far. + */ +#define aio_received backend3 + static void aio_ddp_requeue_task(void *context, int pending); static void ddp_complete_all(struct toepcb *toep, int error); static void t4_aio_cancel_active(struct kaiocb *job); @@ -204,7 +210,7 @@ ddp_complete_one(struct kaiocb *job, int * it was cancelled, report it as a short read rather than an * error. */ - copied = job->uaiocb._aiocb_private.status; + copied = job->aio_received; if (copied != 0 || error == 0) aio_complete(job, copied, 0); else @@ -350,7 +356,7 @@ insert_ddp_data(struct toepcb *toep, uin MPASS((toep->ddp_flags & db_flag) != 0); db = &toep->db[db_idx]; job = db->job; - copied = job->uaiocb._aiocb_private.status; + copied = job->aio_received; placed = n; if (placed > job->uaiocb.aio_nbytes - copied) placed = job->uaiocb.aio_nbytes - copied; @@ -360,7 +366,7 @@ insert_ddp_data(struct toepcb *toep, uin * t4_aio_cancel_active() completes this * request. */ - job->uaiocb._aiocb_private.status += placed; + job->aio_received += placed; } else if (copied + placed != 0) { CTR4(KTR_CXGBE, "%s: completing %p (copied %ld, placed %lu)", @@ -601,16 +607,16 @@ handle_ddp_data(struct toepcb *toep, __b * Update the job's length but defer completion to the * TCB_RPL callback. */ - job->uaiocb._aiocb_private.status += len; + job->aio_received += len; goto out; } else if (!aio_clear_cancel_function(job)) { /* * Update the copied length for when * t4_aio_cancel_active() completes this request. */ - job->uaiocb._aiocb_private.status += len; + job->aio_received += len; } else { - copied = job->uaiocb._aiocb_private.status; + copied = job->aio_received; #ifdef VERBOSE_TRACES CTR4(KTR_CXGBE, "%s: completing %p (copied %ld, placed %d)", __func__, job, copied, len); @@ -698,7 +704,7 @@ handle_ddp_tcb_rpl(struct toepcb *toep, * also take care of updating the tp, etc. */ job = db->job; - copied = job->uaiocb._aiocb_private.status; + copied = job->aio_received; if (copied == 0) { CTR2(KTR_CXGBE, "%s: cancelling %p", __func__, job); aio_cancel(job); @@ -746,7 +752,7 @@ handle_ddp_close(struct toepcb *toep, st MPASS((toep->ddp_flags & db_flag) != 0); db = &toep->db[db_idx]; job = db->job; - copied = job->uaiocb._aiocb_private.status; + copied = job->aio_received; placed = len; if (placed > job->uaiocb.aio_nbytes - copied) placed = job->uaiocb.aio_nbytes - copied; @@ -756,7 +762,7 @@ handle_ddp_close(struct toepcb *toep, st * t4_aio_cancel_active() completes this * request. */ - job->uaiocb._aiocb_private.status += placed; + job->aio_received += placed; } else { CTR4(KTR_CXGBE, "%s: tid %d completed buf %d len %d", __func__, toep->tid, db_idx, placed); @@ -1212,7 +1218,7 @@ aio_ddp_cancel_one(struct kaiocb *job) * it was cancelled, report it as a short read rather than an * error. */ - copied = job->uaiocb._aiocb_private.status; + copied = job->aio_received; if (copied != 0) aio_complete(job, copied, 0); else @@ -1297,7 +1303,7 @@ restart: * a short read and leave the error to be reported by * a future request. */ - copied = job->uaiocb._aiocb_private.status; + copied = job->aio_received; if (copied != 0) { SOCKBUF_UNLOCK(sb); aio_complete(job, copied, 0); @@ -1371,7 +1377,7 @@ restart: SOCKBUF_LOCK(sb); if (so->so_error && sbavail(sb) == 0) { - copied = job->uaiocb._aiocb_private.status; + copied = job->aio_received; if (copied != 0) { SOCKBUF_UNLOCK(sb); recycle_pageset(toep, ps); @@ -1421,9 +1427,9 @@ sbcopy: * copy those mbufs out directly. */ copied = 0; - offset = ps->offset + job->uaiocb._aiocb_private.status; - MPASS(job->uaiocb._aiocb_private.status <= job->uaiocb.aio_nbytes); - resid = job->uaiocb.aio_nbytes - job->uaiocb._aiocb_private.status; + offset = ps->offset + job->aio_received; + MPASS(job->aio_received <= job->uaiocb.aio_nbytes); + resid = job->uaiocb.aio_nbytes - job->aio_received; m = sb->sb_mb; KASSERT(m == NULL || toep->ddp_active_count == 0, ("%s: sockbuf data with active DDP", __func__)); @@ -1451,8 +1457,8 @@ sbcopy: } if (copied != 0) { sbdrop_locked(sb, copied); - job->uaiocb._aiocb_private.status += copied; - copied = job->uaiocb._aiocb_private.status; + job->aio_received += copied; + copied = job->aio_received; inp = sotoinpcb(so); if (!INP_TRY_WLOCK(inp)) { /* @@ -1568,8 +1574,8 @@ sbcopy: * which will keep it open and keep the TCP PCB attached until * after the job is completed. */ - wr = mk_update_tcb_for_ddp(sc, toep, db_idx, ps, - job->uaiocb._aiocb_private.status, ddp_flags, ddp_flags_mask); + wr = mk_update_tcb_for_ddp(sc, toep, db_idx, ps, job->aio_received, + ddp_flags, ddp_flags_mask); if (wr == NULL) { recycle_pageset(toep, ps); aio_ddp_requeue_one(toep, job); @@ -1727,7 +1733,6 @@ t4_aio_queue_ddp(struct socket *so, stru if (!aio_set_cancel_function(job, t4_aio_cancel_queued)) panic("new job was cancelled"); TAILQ_INSERT_TAIL(&toep->ddp_aiojobq, job, list); - job->uaiocb._aiocb_private.status = 0; toep->ddp_waiting_count++; toep->ddp_flags |= DDP_OK; Modified: head/sys/kern/sys_socket.c ============================================================================== --- head/sys/kern/sys_socket.c Wed Jun 15 15:56:03 2016 (r301929) +++ head/sys/kern/sys_socket.c Wed Jun 15 20:56:45 2016 (r301930) @@ -390,6 +390,12 @@ soo_fill_kinfo(struct file *fp, struct k return (0); } +/* + * Use the 'backend3' field in AIO jobs to store the amount of data + * completed by the AIO job so far. + */ +#define aio_done backend3 + static STAILQ_HEAD(, task) soaio_jobs; static struct mtx soaio_jobs_lock; static struct task soaio_kproc_task; @@ -567,7 +573,7 @@ retry: td_savedcred = td->td_ucred; td->td_ucred = job->cred; - done = job->uaiocb._aiocb_private.status; + done = job->aio_done; cnt = job->uaiocb.aio_nbytes - done; iov.iov_base = (void *)((uintptr_t)job->uaiocb.aio_buf + done); iov.iov_len = cnt; @@ -604,7 +610,7 @@ retry: } done += cnt - uio.uio_resid; - job->uaiocb._aiocb_private.status = done; + job->aio_done = done; td->td_ucred = td_savedcred; if (error == EWOULDBLOCK) { @@ -740,7 +746,7 @@ soo_aio_cancel(struct kaiocb *job) sb->sb_flags &= ~SB_AIO; SOCKBUF_UNLOCK(sb); - done = job->uaiocb._aiocb_private.status; + done = job->aio_done; if (done != 0) aio_complete(job, done, 0); else @@ -774,7 +780,6 @@ soo_aio_queue(struct file *fp, struct ka if (!aio_set_cancel_function(job, soo_aio_cancel)) panic("new job was cancelled"); TAILQ_INSERT_TAIL(&sb->sb_aiojobq, job, list); - job->uaiocb._aiocb_private.status = 0; if (!(sb->sb_flags & SB_AIO_RUNNING)) { if (soaio_ready(so, sb)) sowakeup_aio(so, sb); Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Wed Jun 15 15:56:03 2016 (r301929) +++ head/sys/kern/vfs_aio.c Wed Jun 15 20:56:45 2016 (r301930) @@ -520,7 +520,6 @@ aio_free_entry(struct kaiocb *job) sigqueue_take(&job->ksi); PROC_UNLOCK(p); - MPASS(job->bp == NULL); AIO_UNLOCK(ki); /* Modified: head/sys/sys/aio.h ============================================================================== --- head/sys/sys/aio.h Wed Jun 15 15:56:03 2016 (r301929) +++ head/sys/sys/aio.h Wed Jun 15 20:56:45 2016 (r301930) @@ -121,10 +121,6 @@ struct kaiocb { int jobflags; /* (a) job flags */ int inputcharge; /* (*) input blocks */ int outputcharge; /* (*) output blocks */ - struct bio *bp; /* (*) BIO backend BIO pointer */ - struct buf *pbuf; /* (*) BIO backend buffer pointer */ - struct vm_page *pages[btoc(MAXPHYS)+1]; /* BIO backend pages */ - int npages; /* BIO backend number of pages */ struct proc *userproc; /* (*) user process */ struct ucred *cred; /* (*) active credential when created */ struct file *fd_file; /* (*) pointer to file structure */ @@ -134,9 +130,25 @@ struct kaiocb { struct aiocb uaiocb; /* (*) copy of user I/O control block */ ksiginfo_t ksi; /* (a) realtime signal info */ uint64_t seqno; /* (*) job number */ - int pending; /* (a) number of pending I/O, aio_fsync only */ aio_cancel_fn_t *cancel_fn; /* (a) backend cancel function */ aio_handle_fn_t *handle_fn; /* (c) backend handle function */ + union { /* Backend-specific data fields */ + struct { /* BIO backend */ + struct bio *bp; /* (*) BIO pointer */ + struct buf *pbuf; /* (*) buffer pointer */ + struct vm_page *pages[btoc(MAXPHYS)+1]; /* (*) */ + int npages; /* (*) number of pages */ + }; + struct { /* fsync() requests */ + int pending; /* (a) number of pending I/O */ + }; + struct { + void *backend1; + void *backend2; + long backend3; + int backend4; + }; + }; }; struct socket; From owner-svn-src-all@freebsd.org Wed Jun 15 21:01:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4024DA47AF5; Wed, 15 Jun 2016 21:01:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D27F1846; Wed, 15 Jun 2016 21:01:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5FL1rtE011226; Wed, 15 Jun 2016 21:01:53 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5FL1reW011224; Wed, 15 Jun 2016 21:01:53 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201606152101.u5FL1reW011224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 15 Jun 2016 21:01:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301931 - head/tools/tools/decioctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 21:01:54 -0000 Author: jhb Date: Wed Jun 15 21:01:53 2016 New Revision: 301931 URL: https://svnweb.freebsd.org/changeset/base/301931 Log: Add a tool to decode ioctl commands. One or more ioctl command values can be passed as arguments on the command line. For each value, the command is broken down into it's components (direction, group, number, and length). In addition, if a command has a known name it is output via sysdecode_ioctlname(). Reviewed by: kib, emaste, avg Approved by: re (gjb) Differential Revision: https://reviews.freebsd.org/D6851 Added: head/tools/tools/decioctl/ head/tools/tools/decioctl/Makefile (contents, props changed) head/tools/tools/decioctl/decioctl.c (contents, props changed) Added: head/tools/tools/decioctl/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/decioctl/Makefile Wed Jun 15 21:01:53 2016 (r301931) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +PROG= decioctl +SRCS= decioctl.c +MAN= +BINDIR?= /usr/bin + +LIBADD= sysdecode + +.include Added: head/tools/tools/decioctl/decioctl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/decioctl/decioctl.c Wed Jun 15 21:01:53 2016 (r301931) @@ -0,0 +1,94 @@ +/*- + * Copyright (c) 2005-2006,2016 John H. Baldwin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +static void +usage(char **av) +{ + fprintf(stderr, "%s: [ ... ]\n", av[0]); + exit(1); +} + +int +main(int ac, char **av) +{ + unsigned long cmd; + const char *name; + char *cp; + int group, i; + + if (ac < 2) + usage(av); + printf(" command : dir group num len name\n"); + for (i = 1; i < ac; i++) { + errno = 0; + cmd = strtoul(av[i], &cp, 0); + if (*cp != '\0' || errno != 0) { + fprintf(stderr, "Invalid integer: %s\n", av[i]); + usage(av); + } + printf("0x%08lx: ", cmd); + switch (cmd & IOC_DIRMASK) { + case IOC_VOID: + printf("VOID "); + break; + case IOC_OUT: + printf("OUT "); + break; + case IOC_IN: + printf("IN "); + break; + case IOC_INOUT: + printf("INOUT"); + break; + default: + printf("%01lx ???", (cmd & IOC_DIRMASK) >> 29); + break; + } + printf(" "); + group = IOCGROUP(cmd); + if (isprint(group)) + printf(" '%c' ", group); + else + printf(" 0x%02x", group); + printf(" %3lu %4lu", cmd & 0xff, IOCPARM_LEN(cmd)); + name = sysdecode_ioctlname(cmd); + if (name != NULL) + printf(" %s", name); + printf("\n"); + } + return (0); +} From owner-svn-src-all@freebsd.org Wed Jun 15 21:08:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4846A47BCD; Wed, 15 Jun 2016 21:08:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F69D1B09; Wed, 15 Jun 2016 21:08:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5FL8pYk012175; Wed, 15 Jun 2016 21:08:51 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5FL8pcO012174; Wed, 15 Jun 2016 21:08:51 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201606152108.u5FL8pcO012174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 15 Jun 2016 21:08:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301932 - head/sys/dev/cxgbe/tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 21:08:53 -0000 Author: jhb Date: Wed Jun 15 21:08:51 2016 New Revision: 301932 URL: https://svnweb.freebsd.org/changeset/base/301932 Log: Use sbused() instead of sbspace() to avoid signed issues. Inserting a full mbuf with an external cluster into the socket buffer resulted in sbspace() returning -MLEN. However, since sb_hiwat is unsigned, the -MLEN value was converted to unsigned in comparisons. As a result, the socket buffer was never autosized. Note that sb_lowat is signed to permit direct comparisons with sbspace(), but sb_hiwat is unsigned. Follow suit with what tcp_output() does and compare the value of sbused() with sb_hiwat instead. Approved by: re (gjb) Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Wed Jun 15 21:01:53 2016 (r301931) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Wed Jun 15 21:08:51 2016 (r301932) @@ -577,7 +577,7 @@ t4_push_frames(struct adapter *sc, struc struct tcpcb *tp = intotcpcb(inp); struct socket *so = inp->inp_socket; struct sockbuf *sb = &so->so_snd; - int tx_credits, shove, compl, space, sowwakeup; + int tx_credits, shove, compl, sowwakeup; struct ofld_tx_sdesc *txsd = &toep->txsd[toep->txsd_pidx]; INP_WLOCK_ASSERT(inp); @@ -652,9 +652,7 @@ t4_push_frames(struct adapter *sc, struc } } - space = sbspace(sb); - - if (space <= sb->sb_hiwat * 3 / 8 && + if (sbused(sb) > sb->sb_hiwat * 5 / 8 && toep->plen_nocompl + plen >= sb->sb_hiwat / 4) compl = 1; else @@ -663,7 +661,7 @@ t4_push_frames(struct adapter *sc, struc if (sb->sb_flags & SB_AUTOSIZE && V_tcp_do_autosndbuf && sb->sb_hiwat < V_tcp_autosndbuf_max && - space < sb->sb_hiwat / 8) { + sbused(sb) >= sb->sb_hiwat * 7 / 8) { int newsize = min(sb->sb_hiwat + V_tcp_autosndbuf_inc, V_tcp_autosndbuf_max); From owner-svn-src-all@freebsd.org Wed Jun 15 21:50:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A872BA317C8; Wed, 15 Jun 2016 21:50:34 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A74D13B8; Wed, 15 Jun 2016 21:50:34 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id D291CB917; Wed, 15 Jun 2016 17:50:32 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301932 - head/sys/dev/cxgbe/tom Date: Wed, 15 Jun 2016 14:16:54 -0700 Message-ID: <10550858.Wqzuf5sXBE@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201606152108.u5FL8pcO012174@repo.freebsd.org> References: <201606152108.u5FL8pcO012174@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 15 Jun 2016 17:50:32 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 21:50:34 -0000 On Wednesday, June 15, 2016 09:08:51 PM John Baldwin wrote: > Author: jhb > Date: Wed Jun 15 21:08:51 2016 > New Revision: 301932 > URL: https://svnweb.freebsd.org/changeset/base/301932 > > Log: > Use sbused() instead of sbspace() to avoid signed issues. > > Inserting a full mbuf with an external cluster into the socket buffer > resulted in sbspace() returning -MLEN. However, since sb_hiwat is > unsigned, the -MLEN value was converted to unsigned in comparisons. As a > result, the socket buffer was never autosized. Note that sb_lowat is signed > to permit direct comparisons with sbspace(), but sb_hiwat is unsigned. > Follow suit with what tcp_output() does and compare the value of sbused() > with sb_hiwat instead. > > Approved by: re (gjb) > Sponsored by: Chelsio Communications Amusingly (or not), sb_lowat used to be signed as well. Mike Karels changed it to signed in this commit to BSD: https://svnweb.freebsd.org/csrg/sys/sys/socketvar.h?revision=43896 The log reads: add SB_ASYNC in sockbuf, add SB_NOTIFY, SB_NOINTR; make lowat signed for comparison with sbspace (should probably give up and make all fields signed -- John Baldwin From owner-svn-src-all@freebsd.org Wed Jun 15 21:50:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56388A317CC; Wed, 15 Jun 2016 21:50:35 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3817D13BC; Wed, 15 Jun 2016 21:50:35 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 2D8B8B94C; Wed, 15 Jun 2016 17:50:34 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301931 - head/tools/tools/decioctl Date: Wed, 15 Jun 2016 14:12:26 -0700 Message-ID: <13453684.1tT3vNfOUf@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201606152101.u5FL1reW011224@repo.freebsd.org> References: <201606152101.u5FL1reW011224@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 15 Jun 2016 17:50:34 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 21:50:35 -0000 On Wednesday, June 15, 2016 09:01:53 PM John Baldwin wrote: > Author: jhb > Date: Wed Jun 15 21:01:53 2016 > New Revision: 301931 > URL: https://svnweb.freebsd.org/changeset/base/301931 > > Log: > Add a tool to decode ioctl commands. > > One or more ioctl command values can be passed as arguments on the command > line. For each value, the command is broken down into it's components > (direction, group, number, and length). In addition, if a command has a > known name it is output via sysdecode_ioctlname(). > > Reviewed by: kib, emaste, avg > Approved by: re (gjb) > Differential Revision: https://reviews.freebsd.org/D6851 I've had a version of this in a private tree of utilities for several years. I added the sysdecode stuff yesterday though now that it's easy to do so. Sample output: % ./decioctl 0xc4d01902 0xc4e01902 0x4004667f command : dir group num len name 0xc4d01902: INOUT 0x19 2 1232 CAMIOCOMMAND 0xc4e01902: INOUT 0x19 2 1248 0x4004667f: OUT 'f' 127 4 FIONREAD -- John Baldwin From owner-svn-src-all@freebsd.org Wed Jun 15 22:36:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08017A470FD for ; Wed, 15 Jun 2016 22:36:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm41.bullet.mail.bf1.yahoo.com (nm41.bullet.mail.bf1.yahoo.com [216.109.114.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B32A61C1C for ; Wed, 15 Jun 2016 22:36:00 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1466006032; bh=5JnzlqM1JgLbgB/6x1UpVPPDVA9gWBKYLpWTB6fNSfU=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=keztOTHhsHm8iJjW5YnnQ8XSD2d8ijpH77Qp2h0NbjBbjmh10BlFf92FLvXx5utmu9PuxCl7l7W0SSx89n9qlayEUu7JgDhtTCKQs9mhaiMWjOUNaFdjG6OQmGUpBVH67qu+1EX7QTY0Bqfp2TbNxbmzSL/GBUVqrxWr9N9njsiddF2JrQT0CPeNEUsOrSTBX196NAMPDNxAdqVhQhPIEKCpN64jLawsFglhN5H2ODruCch/+OFzWLODmmB87obY5Cg8rp6YiHknpRB5bSJuPsTkO3vc3WFdWUieu9lNPnY28M6IW9ELb6Cb1AxWbbk48yTt/gH5iLS9ydrOuUjPOg== Received: from [98.139.215.140] by nm41.bullet.mail.bf1.yahoo.com with NNFMP; 15 Jun 2016 15:53:52 -0000 Received: from [68.142.230.74] by tm11.bullet.mail.bf1.yahoo.com with NNFMP; 15 Jun 2016 15:53:52 -0000 Received: from [127.0.0.1] by smtp231.mail.bf1.yahoo.com with NNFMP; 15 Jun 2016 15:53:52 -0000 X-Yahoo-Newman-Id: 278477.20707.bm@smtp231.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: _QVOV2oVM1mJnbyI4ojjn8sb19mKnne0msK10KT.iCcJ7xv KvCIfllqYAFk3UdLVvzcDZXnkcFD1C0FvQeTw5sT6pdYUJZCKn6nSODlqybz TcooUHz4xVGYYRKNKWNhxN0Bv7D_dh5..c8_DgkEHlAO3i44fUbla4Ovxr3B mIqQqMylw5IsnAuo7xXBxz_Be.RSCiuNFOkLD2YBlhxGu3ZqJ7sMdtpBmM9M f43AV3nc3YrVrpobvZAxHOUTXnFQlvi016s_1MuIywaS9A..O0h7RpyNod_1 KDIv0ZTrCL806pQgGsGbwIBPWBmpDMsrpHHcQs0x8FVUKmi.0lKO8ASl6Ixs p21WAln65j0EtiF4_OvaY0yjTea03iQF0M79cPOM4xJWhVGonOWRVOgsI6il RBPAc2.HXCRr3WjAhTwquJDnt9HVTkMHlLobN.2xdH9Jg9pNO6KeVJNsgoZe cw4z14XvkgFzVeE4iOFnHEtfiXzYQQRwe1igPchv3fR_h3s8XbcA2WLNtpdr kkDWj_PxFx4_8vNAwj5zBK7O1BTfGKnNA X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r301899 - in vendor/amd/dist: . amd amq conf/checkmount conf/fh_dref conf/hn_dref conf/mount conf/mtab conf/nfs_prot conf/sa_dref conf/transp conf/trap conf/umount doc fixmount fsinfo h... To: Konstantin Belousov References: <201606142341.u5ENf81w071915@repo.freebsd.org> <20160615061405.GP38613@kib.kiev.ua> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org From: Pedro Giffuni Message-ID: <129d6f78-e3c6-5d18-9466-a97ca1b11f76@FreeBSD.org> Date: Wed, 15 Jun 2016 10:53:59 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <20160615061405.GP38613@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 22:36:01 -0000 Hello; On 06/15/16 01:14, Konstantin Belousov wrote: > On Tue, Jun 14, 2016 at 11:41:08PM +0000, Pedro F. Giffuni wrote: >> Author: pfg >> Date: Tue Jun 14 23:41:07 2016 >> New Revision: 301899 >> URL: https://svnweb.freebsd.org/changeset/base/301899 >> >> Log: >> am-utils: Disable keyword expansion. >> >> As recommended in the Committers guide section 5.4.4.1.2. > Wouldn't it be better to remove amd before 11 ? > Yes, that would be better. FWIW, I was only investigating a README.autofs file in the upstream distribution but I have *no* plans to touch any of this, especially not during a code freeze. Pedro. From owner-svn-src-all@freebsd.org Wed Jun 15 23:57:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A358A474DA; Wed, 15 Jun 2016 23:57:34 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CDCA1EEB; Wed, 15 Jun 2016 23:57:33 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5FNvXA5075544; Wed, 15 Jun 2016 23:57:33 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5FNvXIf075542; Wed, 15 Jun 2016 23:57:33 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606152357.u5FNvXIf075542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 15 Jun 2016 23:57:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301933 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 23:57:34 -0000 Author: bdrewery Date: Wed Jun 15 23:57:32 2016 New Revision: 301933 URL: https://svnweb.freebsd.org/changeset/base/301933 Log: Don't truncate OBJS_DEPEND_GUESS.target from Makefile This is important to allow a Makefile to override OBJS_DEPEND_GUESS for handling in META_MODE when its depend files are missing. Approved by: re (implicit) Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk head/share/mk/bsd.lib.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Wed Jun 15 21:08:51 2016 (r301932) +++ head/share/mk/bsd.dep.mk Wed Jun 15 23:57:32 2016 (r301933) @@ -86,7 +86,7 @@ _SKIP_READ_DEPEND= 1 CLEANFILES?= .for _S in ${SRCS:N*.[dhly]} -OBJS_DEPEND_GUESS.${_S:R}.o= ${_S} +OBJS_DEPEND_GUESS.${_S:R}.o+= ${_S} .endfor # Lexical analyzers @@ -94,7 +94,7 @@ OBJS_DEPEND_GUESS.${_S:R}.o= ${_S} .for _LC in ${_LSRC:R}.c ${_LC}: ${_LSRC} ${LEX} ${LFLAGS} -o${.TARGET} ${.ALLSRC} -OBJS_DEPEND_GUESS.${_LC:R}.o= ${_LC} +OBJS_DEPEND_GUESS.${_LC:R}.o+= ${_LC} SRCS:= ${SRCS:S/${_LSRC}/${_LC}/} CLEANFILES+= ${_LC} .endfor @@ -125,7 +125,7 @@ CLEANFILES+= ${_YH} ${_YC}: ${_YSRC} ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC} .endif -OBJS_DEPEND_GUESS.${_YC:R}.o= ${_YC} +OBJS_DEPEND_GUESS.${_YC:R}.o+= ${_YC} .endfor .endfor Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Wed Jun 15 21:08:51 2016 (r301932) +++ head/share/mk/bsd.lib.mk Wed Jun 15 23:57:32 2016 (r301933) @@ -424,13 +424,13 @@ lint: ${SRCS:M*.c} .if defined(LIB) && !empty(LIB) OBJS_DEPEND_GUESS+= ${SRCS:M*.h} .for _S in ${SRCS:N*.[hly]} -OBJS_DEPEND_GUESS.${_S:R}.po= ${_S} +OBJS_DEPEND_GUESS.${_S:R}.po+= ${_S} .endfor .endif .if defined(SHLIB_NAME) || \ defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) .for _S in ${SRCS:N*.[hly]} -OBJS_DEPEND_GUESS.${_S:R}.So= ${_S} +OBJS_DEPEND_GUESS.${_S:R}.So+= ${_S} .endfor .endif From owner-svn-src-all@freebsd.org Wed Jun 15 23:57:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19F4EA4751E; Wed, 15 Jun 2016 23:57:48 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E573911B1; Wed, 15 Jun 2016 23:57:47 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5FNvlxH075594; Wed, 15 Jun 2016 23:57:47 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5FNvkYY075592; Wed, 15 Jun 2016 23:57:46 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606152357.u5FNvkYY075592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 15 Jun 2016 23:57:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301934 - head/gnu/usr.bin/cc/cc_tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 23:57:48 -0000 Author: bdrewery Date: Wed Jun 15 23:57:46 2016 New Revision: 301934 URL: https://svnweb.freebsd.org/changeset/base/301934 Log: Convert to new FAST_DEPEND syntax for guessed dependencies. This OBJS_DEPEND_GUESS is needed since each target gets its own .depend.target.o file but also because it is spelled .meta.target.o with WITH_META_MODE. The OBJS_DEPEND_GUESS will apply the dependency if the required file is missing. Also remove redundant .c files while here to avoid prolems with targets using .ALLSRC and getting multiple source files. Approved by: re (implicit) Sponsored by: EMC / Isilon Storage Division Modified: head/gnu/usr.bin/cc/cc_tools/Makefile head/gnu/usr.bin/cc/cc_tools/Makefile.dep Modified: head/gnu/usr.bin/cc/cc_tools/Makefile ============================================================================== --- head/gnu/usr.bin/cc/cc_tools/Makefile Wed Jun 15 23:57:32 2016 (r301933) +++ head/gnu/usr.bin/cc/cc_tools/Makefile Wed Jun 15 23:57:46 2016 (r301934) @@ -438,9 +438,7 @@ CLEANFILES+= ${GENSRCS} ${GENONLY} ${GEN #----------------------------------------------------------------------- # Manual dependencies. -.if !exists(${DEPENDFILE}) .include "Makefile.dep" -.endif .include # DO NOT DELETE Modified: head/gnu/usr.bin/cc/cc_tools/Makefile.dep ============================================================================== --- head/gnu/usr.bin/cc/cc_tools/Makefile.dep Wed Jun 15 23:57:32 2016 (r301933) +++ head/gnu/usr.bin/cc/cc_tools/Makefile.dep Wed Jun 15 23:57:46 2016 (r301934) @@ -1,131 +1,131 @@ # $FreeBSD$ -errors.o: bconfig.h auto-host.h +OBJS_DEPEND_GUESS.errors.o+= bconfig.h auto-host.h -genattr.o: bconfig.h auto-host.h \ +OBJS_DEPEND_GUESS.genattr.o+= bconfig.h auto-host.h \ tm.h options.h \ insn-modes.h -genattrtab.o: bconfig.h \ +OBJS_DEPEND_GUESS.genattrtab.o+= bconfig.h \ auto-host.h \ tm.h options.h \ insn-modes.h \ gtype-desc.h -genautomata.o: bconfig.h \ +OBJS_DEPEND_GUESS.genautomata.o+= bconfig.h \ auto-host.h \ tm.h options.h \ insn-modes.h -gencheck.o: bconfig.h auto-host.h \ +OBJS_DEPEND_GUESS.gencheck.o+= bconfig.h auto-host.h \ tm.h options.h \ gencheck.h -genchecksum.o: bconfig.h \ +OBJS_DEPEND_GUESS.genchecksum.o+= bconfig.h \ auto-host.h -gencodes.o: bconfig.h auto-host.h \ +OBJS_DEPEND_GUESS.gencodes.o+= bconfig.h auto-host.h \ tm.h options.h \ insn-modes.h -genconditions.o: bconfig.h \ +OBJS_DEPEND_GUESS.genconditions.o+= bconfig.h \ auto-host.h \ tm.h options.h \ insn-modes.h -genconfig.o: bconfig.h auto-host.h \ +OBJS_DEPEND_GUESS.genconfig.o+= bconfig.h auto-host.h \ tm.h options.h \ insn-modes.h -genconstants.o: bconfig.h \ +OBJS_DEPEND_GUESS.genconstants.o+= bconfig.h \ auto-host.h \ tm.h options.h \ insn-modes.h -genemit.o: bconfig.h auto-host.h \ +OBJS_DEPEND_GUESS.genemit.o+= bconfig.h auto-host.h \ tm.h options.h \ insn-modes.h -genextract.o: bconfig.h \ +OBJS_DEPEND_GUESS.genextract.o+= bconfig.h \ auto-host.h \ tm.h options.h \ insn-modes.h \ insn-config.h -genflags.o: bconfig.h auto-host.h \ +OBJS_DEPEND_GUESS.genflags.o+= bconfig.h auto-host.h \ tm.h options.h \ insn-modes.h -gengenrtl.o: bconfig.h auto-host.h +OBJS_DEPEND_GUESS.gengenrtl.o+= bconfig.h auto-host.h -gengtype.o: bconfig.h auto-host.h \ +OBJS_DEPEND_GUESS.gengtype.o+= bconfig.h auto-host.h \ tm.h options.h \ gtyp-gen.h -genmddeps.o: bconfig.h auto-host.h \ +OBJS_DEPEND_GUESS.genmddeps.o+= bconfig.h auto-host.h \ tm.h options.h \ insn-modes.h -genmodes.o: bconfig.h auto-host.h +OBJS_DEPEND_GUESS.genmodes.o+= bconfig.h auto-host.h -genopinit.o: bconfig.h auto-host.h \ +OBJS_DEPEND_GUESS.genopinit.o+= bconfig.h auto-host.h \ tm.h options.h \ insn-modes.h -genoutput.o: bconfig.h auto-host.h \ +OBJS_DEPEND_GUESS.genoutput.o+= bconfig.h auto-host.h \ tm.h options.h \ insn-modes.h -genpeep.o: bconfig.h auto-host.h \ +OBJS_DEPEND_GUESS.genpeep.o+= bconfig.h auto-host.h \ tm.h options.h \ insn-modes.h -genpreds.o: bconfig.h auto-host.h \ +OBJS_DEPEND_GUESS.genpreds.o+= bconfig.h auto-host.h \ tm.h options.h \ insn-modes.h -genrecog.o: bconfig.h auto-host.h \ +OBJS_DEPEND_GUESS.genrecog.o+= bconfig.h auto-host.h \ tm.h options.h \ insn-modes.h -gensupport.o: bconfig.h \ +OBJS_DEPEND_GUESS.gensupport.o+= bconfig.h \ auto-host.h \ tm.h options.h \ insn-modes.h -ggc-none.o: bconfig.h auto-host.h \ +OBJS_DEPEND_GUESS.ggc-none.o+= bconfig.h auto-host.h \ gtype-desc.h -print-rtl.o: bconfig.h auto-host.h \ +OBJS_DEPEND_GUESS.print-rtl.o+= bconfig.h auto-host.h \ tm.h options.h \ insn-modes.h -read-rtl.o: bconfig.h auto-host.h \ +OBJS_DEPEND_GUESS.read-rtl.o+= bconfig.h auto-host.h \ tm.h options.h \ insn-modes.h -rtl.o: bconfig.h auto-host.h \ +OBJS_DEPEND_GUESS.rtl.o+= bconfig.h auto-host.h \ tm.h options.h \ insn-modes.h \ gtype-desc.h -insn-modes.o: insn-modes.c config.h auto-host.h \ +OBJS_DEPEND_GUESS.insn-modes.o+= insn-modes.c config.h auto-host.h \ tm.h options.h \ insn-modes.h -min-insn-modes.o: min-insn-modes.c bconfig.h auto-host.h \ +OBJS_DEPEND_GUESS.min-insn-modes.o+= bconfig.h auto-host.h \ insn-modes.h -gengtype-lex.o: gengtype-lex.c \ +OBJS_DEPEND_GUESS.gengtype-lex.o+= \ bconfig.h auto-host.h \ gengtype-yacc.h -gengtype-yacc+%DIKED.o: gengtype-yacc+%DIKED.c \ +OBJS_DEPEND_GUESS.gengtype-yacc+%DIKED.o+= \ bconfig.h \ auto-host.h \ tm.h options.h \ -insn-conditions.o: insn-conditions.c bconfig.h auto-host.h \ +OBJS_DEPEND_GUESS.insn-conditions.o+= insn-conditions.c bconfig.h auto-host.h \ insn-constants.h \ tm.h options.h \ insn-modes.h \ @@ -133,12 +133,12 @@ insn-conditions.o: insn-conditions.c bco tm-preds.h \ options.h -gencondmd.o: gencondmd.c \ +OBJS_DEPEND_GUESS.gencondmd.o+= \ tm.h options.h tm_p.h \ tm-preds.h tm-constrs.h tree-check.h \ insn-constants.h -gencondmd.o: gencondmd.c bconfig.h auto-host.h \ +OBJS_DEPEND_GUESS.gencondmd.o+= bconfig.h auto-host.h \ tm.h options.h \ insn-constants.h \ insn-modes.h \ @@ -147,7 +147,7 @@ gencondmd.o: gencondmd.c bconfig.h auto- tree-check.h \ tm-constrs.h -vec.o: vec.c bconfig.h auto-host.h \ +OBJS_DEPEND_GUESS.vec.o+= bconfig.h auto-host.h \ insn-modes.h \ tree-check.h \ gtype-desc.h From owner-svn-src-all@freebsd.org Wed Jun 15 23:57:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA1FDA47533; Wed, 15 Jun 2016 23:57:51 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71DAC11C9; Wed, 15 Jun 2016 23:57:51 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5FNvokW075642; Wed, 15 Jun 2016 23:57:50 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5FNvorj075640; Wed, 15 Jun 2016 23:57:50 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606152357.u5FNvorj075640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 15 Jun 2016 23:57:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301935 - in head: share/mk sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 23:57:51 -0000 Author: bdrewery Date: Wed Jun 15 23:57:50 2016 New Revision: 301935 URL: https://svnweb.freebsd.org/changeset/base/301935 Log: WITH_META_MODE: Do include headers for specific guessed dependencies This is a follow-up to r300343. This is important for the OBJS_DEPEND_GUESS usage in gnu/usr.bin/cc/cc_tools. See comments for more details. Approved by: re (implicit) Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk head/sys/conf/kern.post.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Wed Jun 15 23:57:46 2016 (r301934) +++ head/share/mk/bsd.dep.mk Wed Jun 15 23:57:50 2016 (r301935) @@ -221,9 +221,11 @@ ${__obj}: ${OBJS_DEPEND_GUESS.${__obj}} .elif defined(_meta_filemon) # For meta mode we still need to know which file to depend on to avoid # ambiguous suffix transformation rules from .PATH. Meta mode does not -# use .depend files. We really only need source files, not headers. +# use .depend files. We really only need source files, not headers since +# they are typically in SRCS/beforebuild already. For target-specific +# guesses do include headers though since they may not be in SRCS. ${__obj}: ${OBJS_DEPEND_GUESS:N*.h} -${__obj}: ${OBJS_DEPEND_GUESS.${__obj}:N*.h} +${__obj}: ${OBJS_DEPEND_GUESS.${__obj}} .endif .endfor Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Wed Jun 15 23:57:46 2016 (r301934) +++ head/sys/conf/kern.post.mk Wed Jun 15 23:57:50 2016 (r301935) @@ -254,11 +254,13 @@ ${__obj}: ${OBJS_DEPEND_GUESS.${__obj}} .elif defined(_meta_filemon) # For meta mode we still need to know which file to depend on to avoid # ambiguous suffix transformation rules from .PATH. Meta mode does not -# use .depend files. We really only need source files, not headers. +# use .depend files. We really only need source files, not headers since +# they are typically in SRCS/beforebuild already. For target-specific +# guesses do include headers though since they may not be in SRCS. .if ${SYSTEM_OBJS:M${__obj}} ${__obj}: ${OBJS_DEPEND_GUESS:N*.h} .endif -${__obj}: ${OBJS_DEPEND_GUESS.${__obj}:N*.h} +${__obj}: ${OBJS_DEPEND_GUESS.${__obj}} .endif .endfor From owner-svn-src-all@freebsd.org Wed Jun 15 23:57:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 852D0A47567; Wed, 15 Jun 2016 23:57:55 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A04D12C2; Wed, 15 Jun 2016 23:57:55 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5FNvs6a075687; Wed, 15 Jun 2016 23:57:54 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5FNvs6o075686; Wed, 15 Jun 2016 23:57:54 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606152357.u5FNvs6o075686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 15 Jun 2016 23:57:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301936 - head/gnu/usr.bin/cc/cc_tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 23:57:55 -0000 Author: bdrewery Date: Wed Jun 15 23:57:53 2016 New Revision: 301936 URL: https://svnweb.freebsd.org/changeset/base/301936 Log: WITH_META_MODE: Don't expect a .meta file for side-effect generated files. This is the same as r301285. Approved by: re (implicit) Sponsored by: EMC / Isilon Storage Division Modified: head/gnu/usr.bin/cc/cc_tools/Makefile Modified: head/gnu/usr.bin/cc/cc_tools/Makefile ============================================================================== --- head/gnu/usr.bin/cc/cc_tools/Makefile Wed Jun 15 23:57:50 2016 (r301935) +++ head/gnu/usr.bin/cc/cc_tools/Makefile Wed Jun 15 23:57:53 2016 (r301936) @@ -261,7 +261,7 @@ gengtype-lex.c: gengtype-lex.l gengtype-yacc.h: gengtype-yacc.y yacc -d -o gengtype-yacc.c ${.ALLSRC} -gengtype-yacc.c: gengtype-yacc.h +gengtype-yacc.c: gengtype-yacc.h .NOMETA gengtype-yacc+%DIKED.c: gengtype-yacc.c cat ${.ALLSRC} > ${.TARGET} From owner-svn-src-all@freebsd.org Wed Jun 15 23:57:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85EEAA47588; Wed, 15 Jun 2016 23:57:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C32F139B; Wed, 15 Jun 2016 23:57:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5FNvvGZ075735; Wed, 15 Jun 2016 23:57:57 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5FNvvBx075734; Wed, 15 Jun 2016 23:57:57 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606152357.u5FNvvBx075734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 15 Jun 2016 23:57:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301937 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 23:57:58 -0000 Author: bdrewery Date: Wed Jun 15 23:57:57 2016 New Revision: 301937 URL: https://svnweb.freebsd.org/changeset/base/301937 Log: WITH_META_MODE: Keep .MAKE.MODE/META_MODE clean Due to META_MODE being passed into the environment it tends to keep growing with the defaults. Approved by: re (implicit) Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/sys.mk Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Wed Jun 15 23:57:53 2016 (r301936) +++ head/share/mk/sys.mk Wed Jun 15 23:57:57 2016 (r301937) @@ -425,6 +425,10 @@ __MAKE_CONF?=/etc/make.conf # late include for customization .sinclude +.if defined(META_MODE) +META_MODE:= ${META_MODE:O:u} +.endif + .if defined(__MAKE_SHELL) && !empty(__MAKE_SHELL) SHELL= ${__MAKE_SHELL} .SHELL: path=${__MAKE_SHELL} From owner-svn-src-all@freebsd.org Wed Jun 15 23:58:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77F7AA47631; Wed, 15 Jun 2016 23:58:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13B2118D7; Wed, 15 Jun 2016 23:58:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5FNwAXX075924; Wed, 15 Jun 2016 23:58:10 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5FNwAIo075923; Wed, 15 Jun 2016 23:58:10 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606152358.u5FNwAIo075923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 15 Jun 2016 23:58:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301941 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 23:58:11 -0000 Author: bdrewery Date: Wed Jun 15 23:58:09 2016 New Revision: 301941 URL: https://svnweb.freebsd.org/changeset/base/301941 Log: Mark targets with _SUBDIR as .PHONY. This is mostly fixing META_MODE with realinstall wanting a .meta file when it does not need one. These targets really should always run though since they have _SUBDIR on them. Approved by: re (implicit) Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.subdir.mk Modified: head/share/mk/bsd.subdir.mk ============================================================================== --- head/share/mk/bsd.subdir.mk Wed Jun 15 23:58:06 2016 (r301940) +++ head/share/mk/bsd.subdir.mk Wed Jun 15 23:58:09 2016 (r301941) @@ -158,9 +158,9 @@ ${__target}_subdir_${DIRPRFX}${__dir}: . ${_SUBDIR_SH}; .endif .endfor # __dir in ${SUBDIR} -${__target}: ${__subdir_targets} +${__target}: ${__subdir_targets} .PHONY .else -${__target}: _SUBDIR +${__target}: _SUBDIR .PHONY .endif # SUBDIR_PARALLEL || _is_standalone_target .endif # make(${__target}) .endfor # __target in ${SUBDIR_TARGETS} From owner-svn-src-all@freebsd.org Wed Jun 15 23:58:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 187E3A475D0; Wed, 15 Jun 2016 23:58:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA83616D8; Wed, 15 Jun 2016 23:58:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5FNw3lg075833; Wed, 15 Jun 2016 23:58:03 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5FNw3tO075830; Wed, 15 Jun 2016 23:58:03 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606152358.u5FNw3tO075830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 15 Jun 2016 23:58:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301939 - in head: . share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 23:58:05 -0000 Author: bdrewery Date: Wed Jun 15 23:58:03 2016 New Revision: 301939 URL: https://svnweb.freebsd.org/changeset/base/301939 Log: Fix native powerpc64 build of lib32 with in-tree GCC. - This was broken by r300350 and r300885. - Add some comments around the external GCC logic since it is spread out and in need of some cleanup. - The problem was that X_COMPILER_TYPE is always defined from CC->XCC's default, so if /usr/bin/cc is GCC (as it is on native powerpc64) then X_COMPILER_TYPE was getting GCC and triggering the external logic in Makefile.libcompat. It was intended to always provide -isystem with GCC since --sysroot is used into the lib32 sysroot which won't modify the header path without the -isystem. The use of the libc++/std=c++11 override was only intended to be used for external compilers though (more accurately GCC 4.8+ but that's a separate assumption to cleanup). Apply the same logic from Makefile.inc1 to Makefile.libcompat to only add the libc++ override when needed for external compilers. Pointyhat to: bdrewery Tested with: native ppc64 (swills), universe, ppc64 xtoolchain, amd64 xtoolchain, sparc64 cross-build of ppc64 (host GCC 4.2) Reported by: andreast, swills Approved by: re (gjb) Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 head/Makefile.libcompat head/share/mk/src.opts.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Jun 15 23:58:00 2016 (r301938) +++ head/Makefile.inc1 Wed Jun 15 23:58:03 2016 (r301939) @@ -543,9 +543,12 @@ TARGET_ABI= gnueabi .endif .endif .if defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc -# GCC requires -isystem and -L when using a cross-compiler. +# GCC requires -isystem and -L when using a cross-compiler. --sysroot +# won't set header path and -L is used to ensure the base library path +# is added before the port PREFIX library path. XCFLAGS+= -isystem ${WORLDTMP}/usr/include -L${WORLDTMP}/usr/lib # Force using libc++ for external GCC. +# XXX: This should be checking MK_GNUCXX == no XCXXFLAGS+= -isystem ${WORLDTMP}/usr/include/c++/v1 -std=c++11 \ -nostdinc++ -L${WORLDTMP}/../lib/libc++ .else Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Wed Jun 15 23:58:00 2016 (r301938) +++ head/Makefile.libcompat Wed Jun 15 23:58:03 2016 (r301939) @@ -72,13 +72,21 @@ LIBCOMPATCFLAGS+= ${LIBCOMPATCPUFLAGS} \ # -B is needed to find /usr/lib32/crti.o for GCC and /usr/libsoft/crti.o for # Clang/GCC. LIBCOMPATCFLAGS+= -B${LIBCOMPATTMP}/usr/lib${libcompat} + .if defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc -# GCC requires -isystem when using a cross-compiler. +# GCC requires -isystem when using a cross-compiler and --sysroot. Note that +# Makefile.inc1 only applies this with an external compiler but libcompat +# always does since even in-tree GCC 4.2 needs this to override the built-in +# sysroot path which --sysroot does not actually do for headers. LIBCOMPATCFLAGS+= -isystem ${LIBCOMPATTMP}/usr/include # Force using libc++ for external GCC. +# XXX: This should be checking MK_GNUCXX == no +.if ${MK_CROSS_COMPILER} == "no" || \ + (${MK_CLANG_BOOTSTRAP} == "no" && ${MK_GCC_BOOTSTRAP} == "no") LIBCOMPATCXXFLAGS+= -isystem ${LIBCOMPATTMP}/usr/include/c++/v1 -std=c++11 \ -nostdinc++ -L${LIBCOMPAT_OBJTREE}${.CURDIR}/lib/libc++ .endif +.endif # Yes, the flags are redundant. LIBCOMPATWMAKEENV+= MAKEOBJDIRPREFIX=${LIBCOMPAT_OBJTREE} \ Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Wed Jun 15 23:58:00 2016 (r301938) +++ head/share/mk/src.opts.mk Wed Jun 15 23:58:03 2016 (r301939) @@ -419,6 +419,9 @@ MK_LLDB:= no # gcc 4.8 and newer supports libc++, so suppress gnuc++ in that case. # while in theory we could build it with that, we don't want to do # that since it creates too much confusion for too little gain. +# XXX: This is incomplete and needs X_COMPILER_TYPE/VERSION checks too +# to prevent Makefile.inc1 from bootstrapping unneeded dependencies +# and to support 'make delete-old' when supplying an external toolchain. .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 40800 MK_GNUCXX:=no MK_GCC:=no From owner-svn-src-all@freebsd.org Wed Jun 15 23:58:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 568FCA475AD; Wed, 15 Jun 2016 23:58:01 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2166314C3; Wed, 15 Jun 2016 23:58:01 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5FNw0XW075784; Wed, 15 Jun 2016 23:58:00 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5FNw02W075783; Wed, 15 Jun 2016 23:58:00 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606152358.u5FNw02W075783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 15 Jun 2016 23:58:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301938 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 23:58:01 -0000 Author: bdrewery Date: Wed Jun 15 23:58:00 2016 New Revision: 301938 URL: https://svnweb.freebsd.org/changeset/base/301938 Log: tinderbox/universe: Only show arm64 warning if it was in the TARGETS list. This was a flaw in my change in r287903 but also in the original change in r282156 since it used empty(${TARGETS}) rather than empty(TARGETS). Reported by: lidl Approved by: re (gjb) Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Wed Jun 15 23:57:57 2016 (r301937) +++ head/Makefile Wed Jun 15 23:58:00 2016 (r301938) @@ -418,9 +418,9 @@ TARGET_ARCHES_pc98?= i386 TARGET_ARCHES_${target}?= ${target} .endfor -# XXX Add arm64 to universe only if we have an external binutils installed. +# XXX Remove arm64 from universe if the required binutils package is missing. # It does not build with the in-tree linker. -.if !exists(/usr/local/aarch64-freebsd/bin/ld) && empty(${TARGETS}) +.if !exists(/usr/local/aarch64-freebsd/bin/ld) && ${TARGETS:Marm64} _UNIVERSE_TARGETS:= ${_UNIVERSE_TARGETS:Narm64} universe: universe_arm64_skip .PHONY universe_epilogue: universe_arm64_skip .PHONY From owner-svn-src-all@freebsd.org Wed Jun 15 23:58:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D23DA475F8; Wed, 15 Jun 2016 23:58:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C97CE17B8; Wed, 15 Jun 2016 23:58:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5FNw6pL075879; Wed, 15 Jun 2016 23:58:06 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5FNw6o3075878; Wed, 15 Jun 2016 23:58:06 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606152358.u5FNw6o3075878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 15 Jun 2016 23:58:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301940 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 23:58:08 -0000 Author: bdrewery Date: Wed Jun 15 23:58:06 2016 New Revision: 301940 URL: https://svnweb.freebsd.org/changeset/base/301940 Log: WITH_META_MODE: Whitelist 'make kernel' and 'make world'. installkernel is technically META_MODE safe but doesn't need an explicit approval to use it since it's all disabled via .PHONY. world uses 'make -B installworld' which already will disable META_MODE via the -B (.MAKE.MODE=compat) usage. Approved by: re (implicit) Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Wed Jun 15 23:58:03 2016 (r301939) +++ head/Makefile Wed Jun 15 23:58:06 2016 (r301940) @@ -150,9 +150,9 @@ TGTS+= ${BITGTS} # the ones that benefit from it. META_TGT_WHITELIST+= \ _* build32 buildfiles buildincludes buildkernel buildsoft \ - buildworld everything kernel-toolchains kernels libraries \ + buildworld everything kernel-toolchains kernel kernels libraries \ native-xtools showconfig tinderbox toolchain toolchains universe \ - worlds xdev xdev-build + world worlds xdev xdev-build .ORDER: buildworld installworld .ORDER: buildworld distributeworld From owner-svn-src-all@freebsd.org Thu Jun 16 00:38:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AB47A45114; Thu, 16 Jun 2016 00:38:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 344471F3A; Thu, 16 Jun 2016 00:38:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 2DBDF1C85; Thu, 16 Jun 2016 00:38:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id D56DB1DD81; Thu, 16 Jun 2016 00:38:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 8CufENABx5uA; Thu, 16 Jun 2016 00:38:14 +0000 (UTC) Subject: Re: svn commit: r300943 - in head: . lib/libc++ lib/libcxxrt share/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 01E5E1DD79 To: Andreas Tobler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605290620.u4T6KFjT002312@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <1d471fc9-4e32-98cb-3001-83a95f9eae2c@FreeBSD.org> Date: Wed, 15 Jun 2016 17:38:14 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Pe0epEjKBr8umNgmb6nabLA8aik0vumdS" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 00:38:22 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Pe0epEjKBr8umNgmb6nabLA8aik0vumdS Content-Type: multipart/mixed; boundary="rUQpN2ECwLfS2iTURfO0qT0KQ0fiETXdK" From: Bryan Drewery To: Andreas Tobler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <1d471fc9-4e32-98cb-3001-83a95f9eae2c@FreeBSD.org> Subject: Re: svn commit: r300943 - in head: . lib/libc++ lib/libcxxrt share/mk References: <201605290620.u4T6KFjT002312@repo.freebsd.org> In-Reply-To: --rUQpN2ECwLfS2iTURfO0qT0KQ0fiETXdK Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 6/12/2016 1:02 PM, Andreas Tobler wrote: > Hi Bryan, >=20 > On 29.05.16 08:20, Bryan Drewery wrote: >> Author: bdrewery >> Date: Sun May 29 06:20:15 2016 >> New Revision: 300943 >> URL: https://svnweb.freebsd.org/changeset/base/300943 >> >> Log: >> GCC External: Revert r300886, r300904, r300917, r300918 >> >> The fix in r300873 is mostly enough. A fix for lib32 will be >> committed.separately. >=20 > Did this commit already happen? >=20 > I still suffer a broken buildworld on powerpc64 for 32-bit with interna= l > tools. >=20 > Unknown option -std=3Dc++11... Fixed in r301939. --=20 Regards, Bryan Drewery --rUQpN2ECwLfS2iTURfO0qT0KQ0fiETXdK-- --Pe0epEjKBr8umNgmb6nabLA8aik0vumdS Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJXYfT2AAoJEDXXcbtuRpfPDd4IAKy+I4Mzt0qikqQrKqisP/P8 nOR5+YgubdjALY/VwR0ol/bgl1fJOBeLMgW+xjd0b0O8Ah7SD7JkfOs+Py3az9HQ /ZOrFpLlPRGWsxSqXjTzNRK8Btgej71Nnqgsiia+6XSfwbE0fJNzLy86cESRVMT0 r5HPC8mTdlatYzzuNQS//dAnoPZrgEN2QZFdfKr1d1GDHQ2NusmO8jO0ZVZKyLtR fX6YZ6wIuaouQ72BTTixi25EhL2jpyPJDdXxghdb3QBwCpS+YZujcdT5hEs95PJh xdsAoLUei6h3cnqhhQZ2EvRnjKpt3UW5iZ+r39V/CwBDokqv5V7/8rAhrgJfV8g= =dd1T -----END PGP SIGNATURE----- --Pe0epEjKBr8umNgmb6nabLA8aik0vumdS-- From owner-svn-src-all@freebsd.org Thu Jun 16 01:21:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A705DA45D5B; Thu, 16 Jun 2016 01:21:29 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5BAA81744; Thu, 16 Jun 2016 01:21:29 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id DLzkb8XLLEWlrDLzlbkIqF; Wed, 15 Jun 2016 19:21:22 -0600 X-Authority-Analysis: v=2.2 cv=P7p4vWIu c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=pD_ry4oyNxEA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=9EfbjnueN5bFe6Zoxe4A:9 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id C1EBC13753; Wed, 15 Jun 2016 18:21:19 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id u5G1LIPf057835; Wed, 15 Jun 2016 18:21:18 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201606160121.u5G1LIPf057835@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Pedro Giffuni cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: Re: svn commit: r301899 - in vendor/amd/dist: . amd amq conf/checkmount conf/fh_dref conf/hn_dref conf/mount conf/mtab conf/nfs_prot conf/sa_dref conf/transp conf/trap conf/umount doc fixmount fsinfo h... In-Reply-To: Message from Pedro Giffuni of "Wed, 15 Jun 2016 10:53:59 -0500." <129d6f78-e3c6-5d18-9466-a97ca1b11f76@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 15 Jun 2016 18:21:18 -0700 X-CMAE-Envelope: MS4wfFhVT53Fo5H2J+AL0ZXVC0El7UUT9+oQyMjpkbOxsVpMRPu/Dgzc9J+qQpOLW0ZkBKUrbXj0+8dpPhHmJYhEuNqNtarYf+K1bzyYIUcKyWyPPV45WtJv f8qb3dEcBmdB+KidpuGxI1UunE0Vg39Xb3mzjPh/A53VXmG/DGkwPad+HwNx1lvd+8Ee6ew1J63P1L7TO+Nag7hcAVf58fCqV9qT5BJFohuW7798np0WQBRi rMkxCi5dgjMkn/kD0b7a5IzvOGIbOIR6tmWb6Aktb5WY3cvBp6fz73Ym0ev5QTUPLJLabztk4oBGihINhLGqvg== X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 01:21:29 -0000 In message <129d6f78-e3c6-5d18-9466-a97ca1b11f76@FreeBSD.org>, Pedro Giffuni wr ites: > Hello; > > On 06/15/16 01:14, Konstantin Belousov wrote: > > On Tue, Jun 14, 2016 at 11:41:08PM +0000, Pedro F. Giffuni wrote: > >> Author: pfg > >> Date: Tue Jun 14 23:41:07 2016 > >> New Revision: 301899 > >> URL: https://svnweb.freebsd.org/changeset/base/301899 > >> > >> Log: > >> am-utils: Disable keyword expansion. > >> > >> As recommended in the Committers guide section 5.4.4.1.2. > > Wouldn't it be better to remove amd before 11 ? > > > > Yes, that would be better. > > FWIW, I was only investigating a README.autofs file in > the upstream distribution but I have *no* plans to > touch any of this, especially not during a code freeze. It doesn't look like there is anything FreeBSD specific in our amd that is not in am-utils. I spent many years as a Solaris (and many other platforms which don't exist any more) admin. I've always found amd, which I ran on SunOS 4, to be superior to automount as implemented by Sun and currently in use on Linux. (Amd supported NIS but not NIS+). It looks like our autofs is a re-implementation of that. For example, in an NIS (or LDAP) map one could have, * host==cwsys;type:=link;fs:=/export/home/${key} \ host==slippy;type:=link;fs:=/export/home/${key} \ host==oslippy;type:=link;fs:=/export/home/${key} \ host==beastie;rhost:=slippy6;rfs:=/export/home/${key};type:=nfs;fs:=${autodir}/${key} \ host==bob;rhost:=cwsys;rfs:=/export/home/${key};type:=nfs;fs:=${autodir}/${key} \ host==bob;rhost:=cwsys2;rfs:=/export/home/${key};type:=nfs;fs:=${autodir}/${key} \ host==bob;rhost:=slippy;rfs:=/export/home/${key};type:=nfs;fs:=${autodir}/${key} (Hopefully exmh won't munge the above beyond recognition.) The above allows for failover and also allows an admin to specify different mappings for different client systems. Unfortunately automount as originally implemented by Sun never allowed such flexibility unless maps were copied to individual servers, even if multiple servers shared the same maps. I suppose we could extend our automount daemons support this but unfortunately it wouldn't be compatible with anything Solaris or Linux. IIRC many Linux distros have replaced automountd with systemd whereas IMO looking at the direction Solaris is going I'd put money on it being irrelevant in the mid future so, this may not be a big argument against extending our autofs to support this. I will lament the loss of such a powerful tool from base. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Thu Jun 16 01:55:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0901A31C17; Thu, 16 Jun 2016 01:55:11 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-vk0-x234.google.com (mail-vk0-x234.google.com [IPv6:2607:f8b0:400c:c05::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5BEB81EDA; Thu, 16 Jun 2016 01:55:11 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-vk0-x234.google.com with SMTP id d185so54535834vkg.0; Wed, 15 Jun 2016 18:55:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=4sJeafA0tHADY7ib+z6QldPdoUYh+FXYeA/4f+g/ehg=; b=MwXgPQhvxkuYx0jplPCD+bggXsI48Ot78x3mjfNmy1DMJ3eE89eL+zQvAr7e1x2/JF 1PyPKxIe/2+PSNk+bhA/gWQXmh77dZAIIq4edqZaACvV8ghxPIc2rMJha8u8nyNcas6i k9YtLMPX56akr4vX44cvoEOG2McyNC+X5zEEPiLcILeWDQHUykJbpdD7LanVLZ3BV3xa oz00Xl6apgZaqvpn6ePACFgSE4fFdFxwwAWaBJ+lFUPfcDIbI7Wf7v6geWZbAnQZzKkO gxU34mcESo4jQHQhoBUzIvkHBgz4z2pPnXRubUbzKheIQYwoC1KGs7dJUtqfa7wY2X8t WVMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=4sJeafA0tHADY7ib+z6QldPdoUYh+FXYeA/4f+g/ehg=; b=C2Oin1zRPlFeJsz4FUB1k+c7WPid/dp39NWfc9vOxQBhwvNpD9kwhGSbwa3/aGgb+M zftxc90342EIFsvOme8ol+7LKvSR5FK7SSqzx/Pp2yT3aYlL6kNURyYDqZCa7pOlqAuc RmCuY+HieMRWXdwGrZCwf1aiZWuNEfp0uvVVDi+KP4YT2t5dpa17j2OM48yDZFup32IA C0Pkj/YIhvEFCi6/1whQEijuHQzCnX/ImD0PvUoaTln4Vd55DDX1aF01+uG6fhPdFndX 8v2sQWBHszd2PGPQtGtim1iK5GNEk30OdZXP+2uDGLMYCfdsxJaqV+aSr7viAUQCg1bv m0jQ== X-Gm-Message-State: ALyK8tJLPz264KfsYGh0N1LQFo7H6e4U5tYfyNvTDulAWZ/mQivmKFAbqdYS+OsYwIDhGP4ZHFXtOWuDNPL20g== X-Received: by 10.31.168.138 with SMTP id r132mr991717vke.8.1466042110241; Wed, 15 Jun 2016 18:55:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.159.37.1 with HTTP; Wed, 15 Jun 2016 18:55:09 -0700 (PDT) In-Reply-To: <13453684.1tT3vNfOUf@ralph.baldwin.cx> References: <201606152101.u5FL1reW011224@repo.freebsd.org> <13453684.1tT3vNfOUf@ralph.baldwin.cx> From: Sepherosa Ziehau Date: Thu, 16 Jun 2016 09:55:09 +0800 Message-ID: Subject: Re: svn commit: r301931 - head/tools/tools/decioctl To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 01:55:11 -0000 On Thu, Jun 16, 2016 at 5:12 AM, John Baldwin wrote: > On Wednesday, June 15, 2016 09:01:53 PM John Baldwin wrote: >> Author: jhb >> Date: Wed Jun 15 21:01:53 2016 >> New Revision: 301931 >> URL: https://svnweb.freebsd.org/changeset/base/301931 >> >> Log: >> Add a tool to decode ioctl commands. >> >> One or more ioctl command values can be passed as arguments on the command >> line. For each value, the command is broken down into it's components >> (direction, group, number, and length). In addition, if a command has a >> known name it is output via sysdecode_ioctlname(). >> >> Reviewed by: kib, emaste, avg >> Approved by: re (gjb) >> Differential Revision: https://reviews.freebsd.org/D6851 > > I've had a version of this in a private tree of utilities for several years. > I added the sysdecode stuff yesterday though now that it's easy to do so. > > Sample output: > > % ./decioctl 0xc4d01902 0xc4e01902 0x4004667f > command : dir group num len name > 0xc4d01902: INOUT 0x19 2 1232 CAMIOCOMMAND > 0xc4e01902: INOUT 0x19 2 1248 > 0x4004667f: OUT 'f' 127 4 FIONREAD Haha, very nice :D -- Tomorrow Will Never Die From owner-svn-src-all@freebsd.org Thu Jun 16 01:57:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 614CFA31D51; Thu, 16 Jun 2016 01:57:17 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3CD121202; Thu, 16 Jun 2016 01:57:17 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5G1vGbn020947; Thu, 16 Jun 2016 01:57:16 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5G1vGkX020945; Thu, 16 Jun 2016 01:57:16 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606160157.u5G1vGkX020945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 16 Jun 2016 01:57:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301942 - stable/10/sys/dev/hyperv/vmbus X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 01:57:17 -0000 Author: sephe Date: Thu Jun 16 01:57:16 2016 New Revision: 301942 URL: https://svnweb.freebsd.org/changeset/base/301942 Log: MFC 297802,297803(297481),297804 297802 hyperv: Identify Hyper-V features and recommends properly Features bits will be used to detect devices, e.g. timers, which do not have corresponding event channels. Submitted by: Jun Su Reviewed by: sephe, Dexuan Cui Rearranged by: sephe MFC after: 1 week Sponsored by: Microsoft OSTC 279803(297481) hyperv: Register Hyper-V timer early enough for TSC freq calibration The i8254 simulation in Hyper-V is kinda broken and is not available in Generation 2 Hyper-V VMs, so Hyper-V timer must be registered early enough so that it can be used to do the TSC freq calibration. This fixes the notorious warning like this: calcru: runtime went backwards from 50 usec to 25 usec for pid 0 (kernel) Submitted by: Dexuan Cui Reviewed by: kib, sephe Tested by: kib, sephe MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5778 ================= hyperv: Resurrect r297481 This time we make sure that the TIME_REF_COUNT MSR exists. Submitted by: Jun Su Reviewed by: sephe, Dexuan Cui MFC after: 1 week Sponsored by: Microsoft OSTC 297804 hyperv: Declare hyperv_{features,recommends} properly MFC after: 1 week Sponsored by: Microsoft OSTC Modified: stable/10/sys/dev/hyperv/vmbus/hv_hv.c stable/10/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_hv.c Wed Jun 15 23:58:09 2016 (r301941) +++ stable/10/sys/dev/hyperv/vmbus/hv_hv.c Thu Jun 16 01:57:16 2016 (r301942) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -50,6 +51,9 @@ __FBSDID("$FreeBSD$"); static u_int hv_get_timecount(struct timecounter *tc); +u_int hyperv_features; +u_int hyperv_recommends; + /** * Globals */ @@ -207,8 +211,6 @@ hv_vmbus_init(void) hv_vmbus_g_context.hypercall_page = virt_addr; - tc_init(&hv_timecounter); /* register virtual timecount */ - hv_et_init(); return (0); @@ -423,3 +425,93 @@ void hv_vmbus_synic_cleanup(void *arg) wrmsr(HV_X64_MSR_SIEFP, siefp.as_uint64_t); } +static bool +hyperv_identify(void) +{ + u_int regs[4]; + unsigned int maxLeaf; + unsigned int op; + + if (vm_guest != VM_GUEST_HV) + return (false); + + op = HV_CPU_ID_FUNCTION_HV_VENDOR_AND_MAX_FUNCTION; + do_cpuid(op, regs); + maxLeaf = regs[0]; + if (maxLeaf < HV_CPU_ID_FUNCTION_MS_HV_IMPLEMENTATION_LIMITS) + return (false); + + op = HV_CPU_ID_FUNCTION_HV_INTERFACE; + do_cpuid(op, regs); + if (regs[0] != 0x31237648 /* HV#1 */) + return (false); + + op = HV_CPU_ID_FUNCTION_MS_HV_FEATURES; + do_cpuid(op, regs); + if ((regs[0] & HV_FEATURE_MSR_HYPERCALL) == 0) { + /* + * Hyper-V w/o Hypercall is impossible; someone + * is faking Hyper-V. + */ + return (false); + } + hyperv_features = regs[0]; + + op = HV_CPU_ID_FUNCTION_MS_HV_VERSION; + do_cpuid(op, regs); + printf("Hyper-V Version: %d.%d.%d [SP%d]\n", + regs[1] >> 16, regs[1] & 0xffff, regs[0], regs[2]); + + printf(" Features: 0x%b\n", hyperv_features, + "\020" + "\001VPRUNTIME" + "\002TMREFCNT" + "\003SYNCIC" + "\004SYNCTM" + "\005APIC" + "\006HYERCALL" + "\007VPINDEX" + "\010RESET" + "\011STATS" + "\012REFTSC" + "\013IDLE" + "\014TMFREQ" + "\015DEBUG"); + + op = HV_CPU_ID_FUNCTION_MS_HV_ENLIGHTENMENT_INFORMATION; + do_cpuid(op, regs); + hyperv_recommends = regs[0]; + if (bootverbose) + printf(" Recommends: %08x %08x\n", regs[0], regs[1]); + + op = HV_CPU_ID_FUNCTION_MS_HV_IMPLEMENTATION_LIMITS; + do_cpuid(op, regs); + if (bootverbose) { + printf(" Limits: Vcpu:%d Lcpu:%d Int:%d\n", + regs[0], regs[1], regs[2]); + } + + if (maxLeaf >= HV_CPU_ID_FUNCTION_MS_HV_HARDWARE_FEATURE) { + op = HV_CPU_ID_FUNCTION_MS_HV_HARDWARE_FEATURE; + do_cpuid(op, regs); + if (bootverbose) { + printf(" HW Features: %08x AMD: %08x\n", + regs[0], regs[3]); + } + } + + return (true); +} + +static void +hyperv_init(void *dummy __unused) +{ + if (!hyperv_identify()) + return; + + if (hyperv_features & HV_FEATURE_MSR_TIME_REFCNT) { + /* Register virtual timecount */ + tc_init(&hv_timecounter); + } +} +SYSINIT(hyperv_initialize, SI_SUB_HYPERVISOR, SI_ORDER_FIRST, hyperv_init, NULL); Modified: stable/10/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Wed Jun 15 23:58:09 2016 (r301941) +++ stable/10/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Thu Jun 16 01:57:16 2016 (r301942) @@ -470,10 +470,17 @@ typedef enum { HV_CPU_ID_FUNCTION_MS_HV_VERSION = 0x40000002, HV_CPU_ID_FUNCTION_MS_HV_FEATURES = 0x40000003, HV_CPU_ID_FUNCTION_MS_HV_ENLIGHTENMENT_INFORMATION = 0x40000004, - HV_CPU_ID_FUNCTION_MS_HV_IMPLEMENTATION_LIMITS = 0x40000005 - + HV_CPU_ID_FUNCTION_MS_HV_IMPLEMENTATION_LIMITS = 0x40000005, + HV_CPU_ID_FUNCTION_MS_HV_HARDWARE_FEATURE = 0x40000006 } hv_vmbus_cpuid_function; +#define HV_FEATURE_MSR_TIME_REFCNT (1 << 1) +#define HV_FEATURE_MSR_SYNCIC (1 << 2) +#define HV_FEATURE_MSR_STIMER (1 << 3) +#define HV_FEATURE_MSR_APIC (1 << 4) +#define HV_FEATURE_MSR_HYPERCALL (1 << 5) +#define HV_FEATURE_MSR_GUEST_IDLE (1 << 10) + /* * Define the format of the SIMP register */ @@ -627,6 +634,9 @@ typedef enum { extern hv_vmbus_context hv_vmbus_g_context; extern hv_vmbus_connection hv_vmbus_g_connection; +extern u_int hyperv_features; +extern u_int hyperv_recommends; + typedef void (*vmbus_msg_handler)(hv_vmbus_channel_msg_header *msg); typedef struct hv_vmbus_channel_msg_table_entry { From owner-svn-src-all@freebsd.org Thu Jun 16 02:48:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBE5CA47B0D; Thu, 16 Jun 2016 02:48:19 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9151B1C5F; Thu, 16 Jun 2016 02:48:19 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5G2mIWG039220; Thu, 16 Jun 2016 02:48:18 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5G2mIOP039213; Thu, 16 Jun 2016 02:48:18 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606160248.u5G2mIOP039213@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 16 Jun 2016 02:48:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301943 - in stable/10/sys/dev/hyperv: include netvsc vmbus X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 02:48:19 -0000 Author: sephe Date: Thu Jun 16 02:48:18 2016 New Revision: 301943 URL: https://svnweb.freebsd.org/changeset/base/301943 Log: MFC 296379,296380,296381,296593,296594,296595 296379 hyperv/hn: Add multiple channel support, a.k.a. vRSS Each channel contains one RX ring and one TX ring. And we try to distribute the channels to different evenly. Note: Currently we don't have enough information to extract the RSS type and RSS hash value from the received packets. This greatly improves the TX/RX performance for 8 virtual CPU Hyper-V over 10Ge: it can max out 10Ge for TCP when multiple RX/TX rings are enabled. This almost doubles the TX/RX performance for locally connected Hyper-Vs: was 6Gbps w/ 128 TCP streams, now 11Gbps w/ multiple RX/TX rings enabled. It is not enabled by default; it will be switched on after more tests. Collaborated with: Hongjiang Zhang MFC after: 2 week Sponsored by: Microsoft OSTC 296380 hyperv/hn: Pass channel to send done callbacks. Mainly to strigent the data packet send done check. MFC after: 2 weeks Sponsored by: Microsoft OSTC 296381 hyperv/hn: Add per-TX ring stats for # of transmitted packets MFC after: 2 weeks Sponsored by: Microsoft OSTC 296593 hyperv/hn: Move if_initname to an earlier place So that functions shared w/ attach path could use if_printf(). While I'm here, remove unnecessary if_dunit and if_dname assignment. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5576 296594 hyperv/hn: Factor out hn_channel_attach MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5577 296595 hyperv/hn: Make the # of TX rings configurable. Rename the tunables to avoid confusion. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5578 Modified: stable/10/sys/dev/hyperv/include/hyperv.h stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c stable/10/sys/dev/hyperv/netvsc/hv_rndis.h stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.h stable/10/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/include/hyperv.h ============================================================================== --- stable/10/sys/dev/hyperv/include/hyperv.h Thu Jun 16 01:57:16 2016 (r301942) +++ stable/10/sys/dev/hyperv/include/hyperv.h Thu Jun 16 02:48:18 2016 (r301943) @@ -911,6 +911,8 @@ int hv_vmbus_channel_teardown_gpdal( struct hv_vmbus_channel* vmbus_select_outgoing_channel(struct hv_vmbus_channel *promary); +void vmbus_channel_cpu_set(struct hv_vmbus_channel *chan, int cpu); + /** * @brief Get physical address from virtual */ Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c Thu Jun 16 01:57:16 2016 (r301942) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c Thu Jun 16 02:48:18 2016 (r301943) @@ -56,14 +56,14 @@ MALLOC_DEFINE(M_NETVSC, "netvsc", "Hyper /* * Forward declarations */ -static void hv_nv_on_channel_callback(void *context); +static void hv_nv_on_channel_callback(void *xchan); static int hv_nv_init_send_buffer_with_net_vsp(struct hv_device *device); static int hv_nv_init_rx_buffer_with_net_vsp(struct hv_device *device); static int hv_nv_destroy_send_buffer(netvsc_dev *net_dev); static int hv_nv_destroy_rx_buffer(netvsc_dev *net_dev); static int hv_nv_connect_to_vsp(struct hv_device *device); static void hv_nv_on_send_completion(netvsc_dev *net_dev, - struct hv_device *device, hv_vm_packet_descriptor *pkt); + struct hv_device *device, struct hv_vmbus_channel *, hv_vm_packet_descriptor *pkt); static void hv_nv_on_receive_completion(struct hv_vmbus_channel *chan, uint64_t tid, uint32_t status); static void hv_nv_on_receive(netvsc_dev *net_dev, @@ -661,6 +661,34 @@ hv_nv_disconnect_from_vsp(netvsc_dev *ne } /* + * Callback handler for subchannel offer + * @@param context new subchannel + */ +static void +hv_nv_subchan_callback(void *xchan) +{ + struct hv_vmbus_channel *chan = xchan; + netvsc_dev *net_dev; + uint16_t chn_index = chan->offer_msg.offer.sub_channel_index; + struct hv_device *device = chan->device; + hn_softc_t *sc = device_get_softc(device->device); + int ret; + + net_dev = sc->net_dev; + + if (chn_index >= net_dev->num_channel) { + /* Would this ever happen? */ + return; + } + netvsc_subchan_callback(sc, chan); + + chan->hv_chan_rdbuf = malloc(NETVSC_PACKET_SIZE, M_NETVSC, M_WAITOK); + ret = hv_vmbus_channel_open(chan, NETVSC_DEVICE_RING_BUFFER_SIZE, + NETVSC_DEVICE_RING_BUFFER_SIZE, NULL, 0, + hv_nv_on_channel_callback, chan); +} + +/* * Net VSC on device add * * Callback when the device belonging to this driver is added @@ -692,6 +720,7 @@ hv_nv_on_device_add(struct hv_device *de free(chan->hv_chan_rdbuf, M_NETVSC); goto cleanup; } + chan->sc_creation_callback = hv_nv_subchan_callback; /* * Connect with the NetVsp @@ -757,7 +786,8 @@ hv_nv_on_device_remove(struct hv_device */ static void hv_nv_on_send_completion(netvsc_dev *net_dev, - struct hv_device *device, hv_vm_packet_descriptor *pkt) + struct hv_device *device, struct hv_vmbus_channel *chan, + hv_vm_packet_descriptor *pkt) { nvsp_msg *nvsp_msg_pkt; netvsc_packet *net_vsc_pkt; @@ -769,7 +799,9 @@ hv_nv_on_send_completion(netvsc_dev *net || nvsp_msg_pkt->hdr.msg_type == nvsp_msg_1_type_send_rx_buf_complete || nvsp_msg_pkt->hdr.msg_type - == nvsp_msg_1_type_send_send_buf_complete) { + == nvsp_msg_1_type_send_send_buf_complete + || nvsp_msg_pkt->hdr.msg_type + == nvsp_msg5_type_subchannel) { /* Copy the response back */ memcpy(&net_dev->channel_init_packet, nvsp_msg_pkt, sizeof(nvsp_msg)); @@ -806,7 +838,7 @@ hv_nv_on_send_completion(netvsc_dev *net } /* Notify the layer above us */ - net_vsc_pkt->compl.send.on_send_completion( + net_vsc_pkt->compl.send.on_send_completion(chan, net_vsc_pkt->compl.send.send_completion_context); } @@ -963,6 +995,46 @@ retry_send_cmplt: } /* + * Net VSC receiving vRSS send table from VSP + */ +static void +hv_nv_send_table(struct hv_device *device, hv_vm_packet_descriptor *pkt) +{ + netvsc_dev *net_dev; + nvsp_msg *nvsp_msg_pkt; + int i; + uint32_t count, *table; + + net_dev = hv_nv_get_inbound_net_device(device); + if (!net_dev) + return; + + nvsp_msg_pkt = + (nvsp_msg *)((unsigned long)pkt + (pkt->data_offset8 << 3)); + + if (nvsp_msg_pkt->hdr.msg_type != + nvsp_msg5_type_send_indirection_table) { + printf("Netvsc: !Warning! receive msg type not " + "send_indirection_table. type = %d\n", + nvsp_msg_pkt->hdr.msg_type); + return; + } + + count = nvsp_msg_pkt->msgs.vers_5_msgs.send_table.count; + if (count != VRSS_SEND_TABLE_SIZE) { + printf("Netvsc: Received wrong send table size: %u\n", count); + return; + } + + table = (uint32_t *) + ((unsigned long)&nvsp_msg_pkt->msgs.vers_5_msgs.send_table + + nvsp_msg_pkt->msgs.vers_5_msgs.send_table.offset); + + for (i = 0; i < count; i++) + net_dev->vrss_send_table[i] = table[i]; +} + +/* * Net VSC on channel callback */ static void @@ -993,11 +1065,15 @@ hv_nv_on_channel_callback(void *xchan) desc = (hv_vm_packet_descriptor *)buffer; switch (desc->type) { case HV_VMBUS_PACKET_TYPE_COMPLETION: - hv_nv_on_send_completion(net_dev, device, desc); + hv_nv_on_send_completion(net_dev, device, + chan, desc); break; case HV_VMBUS_PACKET_TYPE_DATA_USING_TRANSFER_PAGES: hv_nv_on_receive(net_dev, device, chan, desc); break; + case HV_VMBUS_PACKET_TYPE_DATA_IN_BAND: + hv_nv_send_table(device, desc); + break; default: device_printf(dev, "hv_cb recv unknow type %d " Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Jun 16 01:57:16 2016 (r301942) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Jun 16 02:48:18 2016 (r301943) @@ -86,6 +86,92 @@ MALLOC_DECLARE(M_NETVSC); */ #define NVSP_MAX_PACKETS_PER_RECEIVE 375 +/* vRSS stuff */ +#define RNDIS_OBJECT_TYPE_RSS_CAPABILITIES 0x88 +#define RNDIS_OBJECT_TYPE_RSS_PARAMETERS 0x89 + +#define RNDIS_RECEIVE_SCALE_CAPABILITIES_REVISION_2 2 +#define RNDIS_RECEIVE_SCALE_PARAMETERS_REVISION_2 2 + +struct rndis_obj_header { + uint8_t type; + uint8_t rev; + uint16_t size; +} __packed; + +/* rndis_recv_scale_cap/cap_flag */ +#define RNDIS_RSS_CAPS_MESSAGE_SIGNALED_INTERRUPTS 0x01000000 +#define RNDIS_RSS_CAPS_CLASSIFICATION_AT_ISR 0x02000000 +#define RNDIS_RSS_CAPS_CLASSIFICATION_AT_DPC 0x04000000 +#define RNDIS_RSS_CAPS_USING_MSI_X 0x08000000 +#define RNDIS_RSS_CAPS_RSS_AVAILABLE_ON_PORTS 0x10000000 +#define RNDIS_RSS_CAPS_SUPPORTS_MSI_X 0x20000000 +#define RNDIS_RSS_CAPS_HASH_TYPE_TCP_IPV4 0x00000100 +#define RNDIS_RSS_CAPS_HASH_TYPE_TCP_IPV6 0x00000200 +#define RNDIS_RSS_CAPS_HASH_TYPE_TCP_IPV6_EX 0x00000400 + +/* RNDIS_RECEIVE_SCALE_CAPABILITIES */ +struct rndis_recv_scale_cap { + struct rndis_obj_header hdr; + uint32_t cap_flag; + uint32_t num_int_msg; + uint32_t num_recv_que; + uint16_t num_indirect_tabent; +} __packed; + +/* rndis_recv_scale_param flags */ +#define RNDIS_RSS_PARAM_FLAG_BASE_CPU_UNCHANGED 0x0001 +#define RNDIS_RSS_PARAM_FLAG_HASH_INFO_UNCHANGED 0x0002 +#define RNDIS_RSS_PARAM_FLAG_ITABLE_UNCHANGED 0x0004 +#define RNDIS_RSS_PARAM_FLAG_HASH_KEY_UNCHANGED 0x0008 +#define RNDIS_RSS_PARAM_FLAG_DISABLE_RSS 0x0010 + +/* Hash info bits */ +#define RNDIS_HASH_FUNC_TOEPLITZ 0x00000001 +#define RNDIS_HASH_IPV4 0x00000100 +#define RNDIS_HASH_TCP_IPV4 0x00000200 +#define RNDIS_HASH_IPV6 0x00000400 +#define RNDIS_HASH_IPV6_EX 0x00000800 +#define RNDIS_HASH_TCP_IPV6 0x00001000 +#define RNDIS_HASH_TCP_IPV6_EX 0x00002000 + +#define RNDIS_RSS_INDIRECTION_TABLE_MAX_SIZE_REVISION_2 (128 * 4) +#define RNDIS_RSS_HASH_SECRET_KEY_MAX_SIZE_REVISION_2 40 + +#define ITAB_NUM 128 +#define HASH_KEYLEN RNDIS_RSS_HASH_SECRET_KEY_MAX_SIZE_REVISION_2 + +/* RNDIS_RECEIVE_SCALE_PARAMETERS */ +typedef struct rndis_recv_scale_param_ { + struct rndis_obj_header hdr; + + /* Qualifies the rest of the information */ + uint16_t flag; + + /* The base CPU number to do receive processing. not used */ + uint16_t base_cpu_number; + + /* This describes the hash function and type being enabled */ + uint32_t hashinfo; + + /* The size of indirection table array */ + uint16_t indirect_tabsize; + + /* The offset of the indirection table from the beginning of this + * structure + */ + uint32_t indirect_taboffset; + + /* The size of the hash secret key */ + uint16_t hashkey_size; + + /* The offset of the secret key from the beginning of this structure */ + uint32_t hashkey_offset; + + uint32_t processor_masks_offset; + uint32_t num_processor_masks; + uint32_t processor_masks_entry_size; +} rndis_recv_scale_param; typedef enum nvsp_msg_type_ { nvsp_msg_type_none = 0, @@ -146,6 +232,27 @@ typedef enum nvsp_msg_type_ { nvsp_msg_2_type_alloc_chimney_handle, nvsp_msg_2_type_alloc_chimney_handle_complete, + + nvsp_msg2_max = nvsp_msg_2_type_alloc_chimney_handle_complete, + + /* + * Version 4 Messages + */ + nvsp_msg4_type_send_vf_association, + nvsp_msg4_type_switch_data_path, + nvsp_msg4_type_uplink_connect_state_deprecated, + + nvsp_msg4_max = nvsp_msg4_type_uplink_connect_state_deprecated, + + /* + * Version 5 Messages + */ + nvsp_msg5_type_oid_query_ex, + nvsp_msg5_type_oid_query_ex_comp, + nvsp_msg5_type_subchannel, + nvsp_msg5_type_send_indirection_table, + + nvsp_msg5_max = nvsp_msg5_type_send_indirection_table, } nvsp_msg_type; typedef enum nvsp_status_ { @@ -793,6 +900,39 @@ typedef struct nvsp_2_msg_send_vmq_rndis uint32_t status; } __packed nvsp_2_msg_send_vmq_rndis_pkt_complete; +/* + * Version 5 messages + */ +enum nvsp_subchannel_operation { + NVSP_SUBCHANNEL_NONE = 0, + NVSP_SUBCHANNE_ALLOCATE, + NVSP_SUBCHANNE_MAX +}; + +typedef struct nvsp_5_subchannel_request_ +{ + uint32_t op; + uint32_t num_subchannels; +} __packed nvsp_5_subchannel_request; + +typedef struct nvsp_5_subchannel_complete_ +{ + uint32_t status; + /* Actual number of subchannels allocated */ + uint32_t num_subchannels; +} __packed nvsp_5_subchannel_complete; + +typedef struct nvsp_5_send_indirect_table_ +{ + /* The number of entries in the send indirection table */ + uint32_t count; + /* + * The offset of the send indireciton table from top of + * this struct. The send indirection table tells which channel + * to put the send traffic on. Each entry is a channel number. + */ + uint32_t offset; +} __packed nvsp_5_send_indirect_table; typedef union nvsp_1_msg_uber_ { nvsp_1_msg_send_ndis_version send_ndis_vers; @@ -838,11 +978,18 @@ typedef union nvsp_2_msg_uber_ { nvsp_2_msg_alloc_chimney_handle_complete alloc_chimney_handle_complete; } __packed nvsp_2_msg_uber; +typedef union nvsp_5_msg_uber_ +{ + nvsp_5_subchannel_request subchannel_request; + nvsp_5_subchannel_complete subchn_complete; + nvsp_5_send_indirect_table send_table; +} __packed nvsp_5_msg_uber; typedef union nvsp_all_msgs_ { nvsp_msg_init_uber init_msgs; nvsp_1_msg_uber vers_1_msgs; nvsp_2_msg_uber vers_2_msgs; + nvsp_5_msg_uber vers_5_msgs; } __packed nvsp_all_msgs; /* @@ -883,6 +1030,7 @@ typedef struct nvsp_msg_ { #define NETVSC_MAX_CONFIGURABLE_MTU (9 * 1024) #define NETVSC_PACKET_SIZE PAGE_SIZE +#define VRSS_SEND_TABLE_SIZE 16 /* * Data types @@ -923,10 +1071,15 @@ typedef struct netvsc_dev_ { hv_bool_uint8_t destroy; /* Negotiated NVSP version */ uint32_t nvsp_version; + + uint32_t num_channel; + + uint32_t vrss_send_table[VRSS_SEND_TABLE_SIZE]; } netvsc_dev; +struct hv_vmbus_channel; -typedef void (*pfn_on_send_rx_completion)(void *); +typedef void (*pfn_on_send_rx_completion)(struct hv_vmbus_channel *, void *); #define NETVSC_DEVICE_RING_BUFFER_SIZE (128 * PAGE_SIZE) #define NETVSC_PACKET_MAXPAGE 32 @@ -1010,13 +1163,18 @@ struct hn_rx_ring { u_long hn_csum_trusted; u_long hn_lro_tried; u_long hn_small_pkts; + u_long hn_pkts; + + /* Rarely used stuffs */ + struct sysctl_oid *hn_rx_sysctl_tree; + int hn_rx_flags; } __aligned(CACHE_LINE_SIZE); #define HN_TRUST_HCSUM_IP 0x0001 #define HN_TRUST_HCSUM_TCP 0x0002 #define HN_TRUST_HCSUM_UDP 0x0004 -struct hv_vmbus_channel; +#define HN_RX_FLAG_ATTACHED 0x1 struct hn_tx_ring { #ifndef HN_USE_TXDESC_BUFRING @@ -1053,13 +1211,17 @@ struct hn_tx_ring { u_long hn_txdma_failed; u_long hn_tx_collapsed; u_long hn_tx_chimney; + u_long hn_pkts; /* Rarely used stuffs */ struct hn_txdesc *hn_txdesc; bus_dma_tag_t hn_tx_rndis_dtag; struct sysctl_oid *hn_tx_sysctl_tree; + int hn_tx_flags; } __aligned(CACHE_LINE_SIZE); +#define HN_TX_FLAG_ATTACHED 0x1 + /* * Device-specific softc structure */ @@ -1085,9 +1247,12 @@ typedef struct hn_softc { int hn_tx_ring_cnt; int hn_tx_ring_inuse; struct hn_tx_ring *hn_tx_ring; + + int hn_cpu; int hn_tx_chimney_max; struct taskqueue *hn_tx_taskq; struct sysctl_oid *hn_tx_sysctl_tree; + struct sysctl_oid *hn_rx_sysctl_tree; } hn_softc_t; /* Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Jun 16 01:57:16 2016 (r301942) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Jun 16 02:48:18 2016 (r301943) @@ -281,13 +281,16 @@ static int hn_use_if_start = 0; SYSCTL_INT(_hw_hn, OID_AUTO, use_if_start, CTLFLAG_RDTUN, &hn_use_if_start, 0, "Use if_start TX method"); -static int hn_ring_cnt = 1; -SYSCTL_INT(_hw_hn, OID_AUTO, ring_cnt, CTLFLAG_RDTUN, - &hn_ring_cnt, 0, "# of TX/RX rings to used"); - -static int hn_single_tx_ring = 1; -SYSCTL_INT(_hw_hn, OID_AUTO, single_tx_ring, CTLFLAG_RDTUN, - &hn_single_tx_ring, 0, "Use one TX ring"); +static int hn_chan_cnt = 1; +SYSCTL_INT(_hw_hn, OID_AUTO, chan_cnt, CTLFLAG_RDTUN, + &hn_chan_cnt, 0, + "# of channels to use; each channel has one RX ring and one TX ring"); + +static int hn_tx_ring_cnt = 1; +SYSCTL_INT(_hw_hn, OID_AUTO, tx_ring_cnt, CTLFLAG_RDTUN, + &hn_tx_ring_cnt, 0, "# of TX rings to use"); + +static u_int hn_cpu_index; /* * Forward declarations @@ -327,6 +330,7 @@ static int hn_encap(struct hn_tx_ring *, static void hn_create_rx_data(struct hn_softc *sc, int); static void hn_destroy_rx_data(struct hn_softc *sc); static void hn_set_tx_chimney_size(struct hn_softc *, int); +static void hn_channel_attach(struct hn_softc *, struct hv_vmbus_channel *); static int hn_transmit(struct ifnet *, struct mbuf *); static void hn_xmit_qflush(struct ifnet *); @@ -454,37 +458,46 @@ netvsc_attach(device_t dev) ifp = sc->hn_ifp = sc->arpcom.ac_ifp = if_alloc(IFT_ETHER); ifp->if_softc = sc; + if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ring_cnt = hn_ring_cnt; - if (ring_cnt <= 0 || ring_cnt >= mp_ncpus) + /* + * Figure out the # of RX rings (ring_cnt) and the # of TX rings + * to use (tx_ring_cnt). + * + * NOTE: + * The # of RX rings to use is same as the # of channels to use. + */ + ring_cnt = hn_chan_cnt; + if (ring_cnt <= 0 || ring_cnt > mp_ncpus) ring_cnt = mp_ncpus; - tx_ring_cnt = ring_cnt; - if (hn_single_tx_ring || hn_use_if_start) { - /* - * - Explicitly asked to use single TX ring. - * - ifnet.if_start is used; ifnet.if_start only needs - * one TX ring. - */ + tx_ring_cnt = hn_tx_ring_cnt; + if (tx_ring_cnt <= 0 || tx_ring_cnt > ring_cnt) + tx_ring_cnt = ring_cnt; + if (hn_use_if_start) { + /* ifnet.if_start only needs one TX ring. */ tx_ring_cnt = 1; } + + /* + * Set the leader CPU for channels. + */ + sc->hn_cpu = atomic_fetchadd_int(&hn_cpu_index, ring_cnt) % mp_ncpus; + error = hn_create_tx_data(sc, tx_ring_cnt); if (error) goto failed; - hn_create_rx_data(sc, ring_cnt); /* * Associate the first TX/RX ring w/ the primary channel. */ chan = device_ctx->channel; - chan->hv_chan_rxr = &sc->hn_rx_ring[0]; - chan->hv_chan_txr = &sc->hn_tx_ring[0]; - sc->hn_tx_ring[0].hn_chan = chan; - - if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_dunit = unit; - ifp->if_dname = NETVSC_DEVNAME; + KASSERT(HV_VMBUS_CHAN_ISPRIMARY(chan), ("not primary channel")); + KASSERT(chan->offer_msg.offer.sub_channel_index == 0, + ("primary channel subidx %u", + chan->offer_msg.offer.sub_channel_index)); + hn_channel_attach(sc, chan); ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = hn_ioctl; @@ -522,10 +535,18 @@ netvsc_attach(device_t dev) error = hv_rf_on_device_add(device_ctx, &device_info, ring_cnt); if (error) goto failed; + KASSERT(sc->net_dev->num_channel > 0 && + sc->net_dev->num_channel <= sc->hn_rx_ring_inuse, + ("invalid channel count %u, should be less than %d", + sc->net_dev->num_channel, sc->hn_rx_ring_inuse)); - /* TODO: vRSS */ - sc->hn_tx_ring_inuse = 1; - sc->hn_rx_ring_inuse = 1; + /* + * Set the # of TX/RX rings that could be used according to + * the # of channels that host offered. + */ + if (sc->hn_tx_ring_inuse > sc->net_dev->num_channel) + sc->hn_tx_ring_inuse = sc->net_dev->num_channel; + sc->hn_rx_ring_inuse = sc->net_dev->num_channel; device_printf(dev, "%d TX ring, %d RX ring\n", sc->hn_tx_ring_inuse, sc->hn_rx_ring_inuse); @@ -730,7 +751,7 @@ hn_txdesc_hold(struct hn_txdesc *txd) } static void -hn_tx_done(void *xpkt) +hn_tx_done(struct hv_vmbus_channel *chan, void *xpkt) { netvsc_packet *packet = xpkt; struct hn_txdesc *txd; @@ -740,6 +761,11 @@ hn_tx_done(void *xpkt) packet->compl.send.send_completion_tid; txr = txd->txr; + KASSERT(txr->hn_chan == chan, + ("channel mismatch, on channel%u, should be channel%u", + chan->offer_msg.offer.sub_channel_index, + txr->hn_chan->offer_msg.offer.sub_channel_index)); + txr->hn_has_txeof = 1; hn_txdesc_put(txr, txd); } @@ -1025,6 +1051,7 @@ again: if (txd->m->m_flags & M_MCAST) if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1); } + txr->hn_pkts++; } hn_txdesc_put(txr, txd); @@ -1357,6 +1384,7 @@ skip: */ ifp->if_ipackets++; + rxr->hn_pkts++; if ((ifp->if_capenable & IFCAP_LRO) && do_lro) { #if defined(INET) || defined(INET6) @@ -2122,6 +2150,13 @@ hn_create_rx_data(struct hn_softc *sc, i #endif #endif /* INET || INET6 */ + ctx = device_get_sysctl_ctx(dev); + child = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); + + /* Create dev.hn.UNIT.rx sysctl tree */ + sc->hn_rx_sysctl_tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "rx", + CTLFLAG_RD, 0, ""); + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { struct hn_rx_ring *rxr = &sc->hn_rx_ring[i]; @@ -2149,10 +2184,27 @@ hn_create_rx_data(struct hn_softc *sc, i rxr->hn_lro.lro_ackcnt_lim = HN_LRO_ACKCNT_DEF; #endif #endif /* INET || INET6 */ - } - ctx = device_get_sysctl_ctx(dev); - child = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); + if (sc->hn_rx_sysctl_tree != NULL) { + char name[16]; + + /* + * Create per RX ring sysctl tree: + * dev.hn.UNIT.rx.RINGID + */ + snprintf(name, sizeof(name), "%d", i); + rxr->hn_rx_sysctl_tree = SYSCTL_ADD_NODE(ctx, + SYSCTL_CHILDREN(sc->hn_rx_sysctl_tree), + OID_AUTO, name, CTLFLAG_RD, 0, ""); + + if (rxr->hn_rx_sysctl_tree != NULL) { + SYSCTL_ADD_ULONG(ctx, + SYSCTL_CHILDREN(rxr->hn_rx_sysctl_tree), + OID_AUTO, "packets", CTLFLAG_RW, + &rxr->hn_pkts, "# of packets received"); + } + } + } SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_queued", CTLTYPE_U64 | CTLFLAG_RW, sc, @@ -2419,6 +2471,9 @@ hn_create_tx_ring(struct hn_softc *sc, i CTLFLAG_RD, &txr->hn_oactive, 0, "over active"); } + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "packets", + CTLFLAG_RW, &txr->hn_pkts, + "# of packets transmitted"); } } @@ -2783,6 +2838,55 @@ hn_xmit_txeof_taskfunc(void *xtxr, int p } static void +hn_channel_attach(struct hn_softc *sc, struct hv_vmbus_channel *chan) +{ + struct hn_rx_ring *rxr; + int idx; + + idx = chan->offer_msg.offer.sub_channel_index; + + KASSERT(idx >= 0 && idx < sc->hn_rx_ring_inuse, + ("invalid channel index %d, should > 0 && < %d", + idx, sc->hn_rx_ring_inuse)); + rxr = &sc->hn_rx_ring[idx]; + KASSERT((rxr->hn_rx_flags & HN_RX_FLAG_ATTACHED) == 0, + ("RX ring %d already attached", idx)); + rxr->hn_rx_flags |= HN_RX_FLAG_ATTACHED; + + chan->hv_chan_rxr = rxr; + if_printf(sc->hn_ifp, "link RX ring %d to channel%u\n", + idx, chan->offer_msg.child_rel_id); + + if (idx < sc->hn_tx_ring_inuse) { + struct hn_tx_ring *txr = &sc->hn_tx_ring[idx]; + + KASSERT((txr->hn_tx_flags & HN_TX_FLAG_ATTACHED) == 0, + ("TX ring %d already attached", idx)); + txr->hn_tx_flags |= HN_TX_FLAG_ATTACHED; + + chan->hv_chan_txr = txr; + txr->hn_chan = chan; + if_printf(sc->hn_ifp, "link TX ring %d to channel%u\n", + idx, chan->offer_msg.child_rel_id); + } + + /* Bind channel to a proper CPU */ + vmbus_channel_cpu_set(chan, (sc->hn_cpu + idx) % mp_ncpus); +} + +void +netvsc_subchan_callback(struct hn_softc *sc, struct hv_vmbus_channel *chan) +{ + + KASSERT(!HV_VMBUS_CHAN_ISPRIMARY(chan), + ("subchannel callback on primary channel")); + KASSERT(chan->offer_msg.offer.sub_channel_index > 0, + ("invalid channel subidx %u", + chan->offer_msg.offer.sub_channel_index)); + hn_channel_attach(sc, chan); +} + +static void hn_tx_taskq_create(void *arg __unused) { if (!hn_share_tx_taskq) Modified: stable/10/sys/dev/hyperv/netvsc/hv_rndis.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_rndis.h Thu Jun 16 01:57:16 2016 (r301942) +++ stable/10/sys/dev/hyperv/netvsc/hv_rndis.h Thu Jun 16 02:48:18 2016 (r301943) @@ -167,6 +167,14 @@ #define RNDIS_OID_GEN_MACHINE_NAME 0x0001021A #define RNDIS_OID_GEN_RNDIS_CONFIG_PARAMETER 0x0001021B +/* + * For receive side scale + */ +/* Query only */ +#define RNDIS_OID_GEN_RSS_CAPABILITIES 0x00010203 +/* Query and set */ +#define RNDIS_OID_GEN_RSS_PARAMETERS 0x00010204 + #define RNDIS_OID_GEN_XMIT_OK 0x00020101 #define RNDIS_OID_GEN_RCV_OK 0x00020102 #define RNDIS_OID_GEN_XMIT_ERROR 0x00020103 @@ -1060,6 +1068,8 @@ struct hv_vmbus_channel; int netvsc_recv(struct hv_vmbus_channel *chan, netvsc_packet *packet, rndis_tcp_ip_csum_info *csum_info); void netvsc_channel_rollup(struct hv_vmbus_channel *chan); +void netvsc_subchan_callback(struct hn_softc *sc, + struct hv_vmbus_channel *chan); void* hv_set_rppi_data(rndis_msg *rndis_mesg, uint32_t rppi_size, Modified: stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c Thu Jun 16 01:57:16 2016 (r301942) +++ stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c Thu Jun 16 02:48:18 2016 (r301943) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "hv_net_vsc.h" #include "hv_rndis.h" #include "hv_rndis_filter.h" @@ -69,8 +70,8 @@ static int hv_rf_set_packet_filter(rndi static int hv_rf_init_device(rndis_device *device); static int hv_rf_open_device(rndis_device *device); static int hv_rf_close_device(rndis_device *device); -static void hv_rf_on_send_request_completion(void *context); -static void hv_rf_on_send_request_halt_completion(void *context); +static void hv_rf_on_send_request_completion(struct hv_vmbus_channel *, void *context); +static void hv_rf_on_send_request_halt_completion(struct hv_vmbus_channel *, void *context); int hv_rf_send_offload_request(struct hv_device *device, rndis_offload_params *offloads); @@ -224,6 +225,8 @@ hv_rf_send_request(rndis_device *device, { int ret; netvsc_packet *packet; + netvsc_dev *net_dev = device->net_dev; + int send_buf_section_idx; /* Set up the packet to send it */ packet = &request->pkt; @@ -238,6 +241,20 @@ hv_rf_send_request(rndis_device *device, packet->page_buffers[0].offset = (unsigned long)&request->request_msg & (PAGE_SIZE - 1); + if (packet->page_buffers[0].offset + + packet->page_buffers[0].length > PAGE_SIZE) { + packet->page_buf_count = 2; + packet->page_buffers[0].length = + PAGE_SIZE - packet->page_buffers[0].offset; + packet->page_buffers[1].pfn = + hv_get_phys_addr((char*)&request->request_msg + + packet->page_buffers[0].length) >> PAGE_SHIFT; + packet->page_buffers[1].offset = 0; + packet->page_buffers[1].length = + request->request_msg.msg_len - + packet->page_buffers[0].length; + } + packet->compl.send.send_completion_context = request; /* packet */ if (message_type != REMOTE_NDIS_HALT_MSG) { packet->compl.send.on_send_completion = @@ -247,10 +264,25 @@ hv_rf_send_request(rndis_device *device, hv_rf_on_send_request_halt_completion; } packet->compl.send.send_completion_tid = (unsigned long)device; - packet->send_buf_section_idx = - NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX; + if (packet->tot_data_buf_len < net_dev->send_section_size) { + send_buf_section_idx = hv_nv_get_next_send_section(net_dev); + if (send_buf_section_idx != + NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX) { + char *dest = ((char *)net_dev->send_buf + + send_buf_section_idx * net_dev->send_section_size); + + memcpy(dest, &request->request_msg, request->request_msg.msg_len); + packet->send_buf_section_idx = send_buf_section_idx; + packet->send_buf_section_size = packet->tot_data_buf_len; + packet->page_buf_count = 0; + goto sendit; + } + /* Failed to allocate chimney send buffer; move on */ + } + packet->send_buf_section_idx = NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX; packet->send_buf_section_size = 0; +sendit: ret = hv_nv_on_send(device->net_dev->dev->channel, packet); return (ret); @@ -528,6 +560,19 @@ hv_rf_query_device(rndis_device *device, query->info_buffer_length = 0; query->device_vc_handle = 0; + if (oid == RNDIS_OID_GEN_RSS_CAPABILITIES) { + struct rndis_recv_scale_cap *cap; + + request->request_msg.msg_len += + sizeof(struct rndis_recv_scale_cap); + query->info_buffer_length = sizeof(struct rndis_recv_scale_cap); + cap = (struct rndis_recv_scale_cap *)((unsigned long)query + + query->info_buffer_offset); + cap->hdr.type = RNDIS_OBJECT_TYPE_RSS_CAPABILITIES; + cap->hdr.rev = RNDIS_RECEIVE_SCALE_CAPABILITIES_REVISION_2; + cap->hdr.size = sizeof(struct rndis_recv_scale_cap); + } + ret = hv_rf_send_request(device, request, REMOTE_NDIS_QUERY_MSG); if (ret != 0) { /* Fixme: printf added */ @@ -582,6 +627,114 @@ hv_rf_query_device_link_status(rndis_dev RNDIS_OID_GEN_MEDIA_CONNECT_STATUS, &device->link_status, &size)); } +static uint8_t netvsc_hash_key[HASH_KEYLEN] = { + 0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2, + 0x41, 0x67, 0x25, 0x3d, 0x43, 0xa3, 0x8f, 0xb0, + 0xd0, 0xca, 0x2b, 0xcb, 0xae, 0x7b, 0x30, 0xb4, + 0x77, 0xcb, 0x2d, 0xa3, 0x80, 0x30, 0xf2, 0x0c, + 0x6a, 0x42, 0xb7, 0x3b, 0xbe, 0xac, 0x01, 0xfa +}; + +/* + * RNDIS set vRSS parameters + */ +static int +hv_rf_set_rss_param(rndis_device *device, int num_queue) +{ + rndis_request *request; + rndis_set_request *set; + rndis_set_complete *set_complete; + rndis_recv_scale_param *rssp; + uint32_t extlen = sizeof(rndis_recv_scale_param) + + (4 * ITAB_NUM) + HASH_KEYLEN; + uint32_t *itab, status; + uint8_t *keyp; + int i, ret; + + + request = hv_rndis_request(device, REMOTE_NDIS_SET_MSG, + RNDIS_MESSAGE_SIZE(rndis_set_request) + extlen); + if (request == NULL) { + if (bootverbose) + printf("Netvsc: No memory to set vRSS parameters.\n"); + ret = -1; + goto cleanup; + } + + set = &request->request_msg.msg.set_request; + set->oid = RNDIS_OID_GEN_RSS_PARAMETERS; + set->info_buffer_length = extlen; + set->info_buffer_offset = sizeof(rndis_set_request); + set->device_vc_handle = 0; + + /* Fill out the rssp parameter structure */ + rssp = (rndis_recv_scale_param *)(set + 1); + rssp->hdr.type = RNDIS_OBJECT_TYPE_RSS_PARAMETERS; + rssp->hdr.rev = RNDIS_RECEIVE_SCALE_PARAMETERS_REVISION_2; + rssp->hdr.size = sizeof(rndis_recv_scale_param); + rssp->flag = 0; + rssp->hashinfo = RNDIS_HASH_FUNC_TOEPLITZ | RNDIS_HASH_IPV4 | + RNDIS_HASH_TCP_IPV4 | RNDIS_HASH_IPV6 | RNDIS_HASH_TCP_IPV6; + rssp->indirect_tabsize = 4 * ITAB_NUM; + rssp->indirect_taboffset = sizeof(rndis_recv_scale_param); + rssp->hashkey_size = HASH_KEYLEN; + rssp->hashkey_offset = rssp->indirect_taboffset + + rssp->indirect_tabsize; + + /* Set indirection table entries */ + itab = (uint32_t *)(rssp + 1); + for (i = 0; i < ITAB_NUM; i++) + itab[i] = i % num_queue; + + /* Set hash key values */ + keyp = (uint8_t *)((unsigned long)rssp + rssp->hashkey_offset); + for (i = 0; i < HASH_KEYLEN; i++) + keyp[i] = netvsc_hash_key[i]; + + ret = hv_rf_send_request(device, request, REMOTE_NDIS_SET_MSG); + if (ret != 0) { + goto cleanup; + } + + /* + * Wait for the response from the host. Another thread will signal + * us when the response has arrived. In the failure case, + * sema_timedwait() returns a non-zero status after waiting 5 seconds. + */ + ret = sema_timedwait(&request->wait_sema, 5 * hz); + if (ret == 0) { + /* Response received, check status */ + set_complete = &request->response_msg.msg.set_complete; + status = set_complete->status; + if (status != RNDIS_STATUS_SUCCESS) { + /* Bad response status, return error */ + if (bootverbose) + printf("Netvsc: Failed to set vRSS " + "parameters.\n"); + ret = -2; + } else { + if (bootverbose) + printf("Netvsc: Successfully set vRSS " + "parameters.\n"); + } + } else { + /* + * We cannot deallocate the request since we may still + * receive a send completion for it. + */ + printf("Netvsc: vRSS set timeout, id = %u, ret = %d\n", + request->request_msg.msg.init_request.request_id, ret); + goto exit; + } + +cleanup: + if (request != NULL) { + hv_put_rndis_request(device, request); + } +exit: + return (ret); +} + /* * RNDIS filter set packet filter * Sends an rndis request with the new filter, then waits for a response @@ -817,12 +970,15 @@ hv_rf_close_device(rndis_device *device) */ int hv_rf_on_device_add(struct hv_device *device, void *additl_info, - int nchan __unused) + int nchan) { int ret; netvsc_dev *net_dev; rndis_device *rndis_dev; + nvsp_msg *init_pkt; rndis_offload_params offloads; + struct rndis_recv_scale_cap rsscaps; + uint32_t rsscaps_size = sizeof(struct rndis_recv_scale_cap); netvsc_device_info *dev_info = (netvsc_device_info *)additl_info; device_t dev = device->device; @@ -888,6 +1044,67 @@ hv_rf_on_device_add(struct hv_device *de dev_info->link_state = rndis_dev->link_status; + net_dev->num_channel = 1; + if (net_dev->nvsp_version < NVSP_PROTOCOL_VERSION_5 || nchan == 1) + return (0); + + memset(&rsscaps, 0, rsscaps_size); + ret = hv_rf_query_device(rndis_dev, + RNDIS_OID_GEN_RSS_CAPABILITIES, + &rsscaps, &rsscaps_size); + if ((ret != 0) || (rsscaps.num_recv_que < 2)) { + device_printf(dev, "hv_rf_query_device failed or " + "rsscaps.num_recv_que < 2 \n"); + goto out; + } + device_printf(dev, "channel, offered %u, requested %d\n", + rsscaps.num_recv_que, nchan); + if (nchan > rsscaps.num_recv_que) + nchan = rsscaps.num_recv_que; + net_dev->num_channel = nchan; + + if (net_dev->num_channel == 1) { + device_printf(dev, "net_dev->num_channel == 1 under VRSS\n"); + goto out; + } + + /* request host to create sub channels */ + init_pkt = &net_dev->channel_init_packet; + memset(init_pkt, 0, sizeof(nvsp_msg)); + + init_pkt->hdr.msg_type = nvsp_msg5_type_subchannel; + init_pkt->msgs.vers_5_msgs.subchannel_request.op = + NVSP_SUBCHANNE_ALLOCATE; + init_pkt->msgs.vers_5_msgs.subchannel_request.num_subchannels = + net_dev->num_channel - 1; + + ret = hv_vmbus_channel_send_packet(device->channel, init_pkt, + sizeof(nvsp_msg), (uint64_t)(uintptr_t)init_pkt, + HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, + HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); + if (ret != 0) { + device_printf(dev, "Fail to allocate subchannel\n"); + goto out; + } + + sema_wait(&net_dev->channel_init_sema); + + if (init_pkt->msgs.vers_5_msgs.subchn_complete.status != *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Jun 16 03:00:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B964BA47DA9; Thu, 16 Jun 2016 03:00:11 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7CF981441; Thu, 16 Jun 2016 03:00:11 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5G30AdC042970; Thu, 16 Jun 2016 03:00:10 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5G30AQ8042969; Thu, 16 Jun 2016 03:00:10 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201606160300.u5G30AQ8042969@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 16 Jun 2016 03:00:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301944 - head/share/zoneinfo X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 03:00:11 -0000 Author: gjb Date: Thu Jun 16 03:00:10 2016 New Revision: 301944 URL: https://svnweb.freebsd.org/changeset/base/301944 Log: Fix zoneinfo file packaging. This change fixes 468 of 488 zoneinfo file packaging issues, the rest still to be investigated. Approved by: re (blanket, pkgbase) Sponsored by: The FreeBSD Foundation Modified: head/share/zoneinfo/Makefile Modified: head/share/zoneinfo/Makefile ============================================================================== --- head/share/zoneinfo/Makefile Thu Jun 16 02:48:18 2016 (r301943) +++ head/share/zoneinfo/Makefile Thu Jun 16 03:00:10 2016 (r301944) @@ -82,10 +82,10 @@ zoneinfo: yearistype ${TDATA} beforeinstall: install-zoneinfo install-zoneinfo: cd ${TZBUILDDIR} && \ - find -s * -type f -print -exec ${INSTALL} \ + find -s * -type f -print -exec ${INSTALL} -T ${TAGS} \ -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ \{} ${DESTDIR}/usr/share/zoneinfo/\{} \; - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ + ${INSTALL} -T ${TAGS} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ ${CONTRIBDIR}/zone.tab ${DESTDIR}/usr/share/zoneinfo/ afterinstall: From owner-svn-src-all@freebsd.org Thu Jun 16 03:02:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D233A470C4; Thu, 16 Jun 2016 03:02:28 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B5BA1E90; Thu, 16 Jun 2016 03:02:28 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5G32RvJ047493; Thu, 16 Jun 2016 03:02:27 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5G32RPg047492; Thu, 16 Jun 2016 03:02:27 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201606160302.u5G32RPg047492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 16 Jun 2016 03:02:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301945 - head/release/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 03:02:28 -0000 Author: manu Date: Thu Jun 16 03:02:27 2016 New Revision: 301945 URL: https://svnweb.freebsd.org/changeset/base/301945 Log: Bump /tmp from 30m to 50m for ARM release images. 30m isn't enough for pkg anymore to extract packagesite.txz. 40m is fine for now but let's take a safer way as we don't know when pkg will need more. Reported by: many Approved by: re (gjb), andrew (mentor) Modified: head/release/tools/arm.subr Modified: head/release/tools/arm.subr ============================================================================== --- head/release/tools/arm.subr Thu Jun 16 03:00:10 2016 (r301944) +++ head/release/tools/arm.subr Thu Jun 16 03:02:27 2016 (r301945) @@ -109,7 +109,7 @@ arm_install_base() { >> ${CHROOTDIR}/${DESTDIR}/etc/fstab echo "/dev/msdosfs/MSDOSBOOT /boot/msdos msdosfs rw,noatime 0 0" \ >> ${CHROOTDIR}/${DESTDIR}/etc/fstab - echo "tmpfs /tmp tmpfs rw,mode=1777,size=30m 0 0" \ + echo "tmpfs /tmp tmpfs rw,mode=1777,size=50m 0 0" \ >> ${CHROOTDIR}/${DESTDIR}/etc/fstab local hostname From owner-svn-src-all@freebsd.org Thu Jun 16 03:04:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 788DEA47192; Thu, 16 Jun 2016 03:04:18 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4922A11AD; Thu, 16 Jun 2016 03:04:18 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5G34H3b047599; Thu, 16 Jun 2016 03:04:17 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5G34HKN047592; Thu, 16 Jun 2016 03:04:17 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606160304.u5G34HKN047592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 16 Jun 2016 03:04:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301946 - in stable/10/sys/dev/hyperv: include utilities vmbus X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 03:04:18 -0000 Author: sephe Date: Thu Jun 16 03:04:16 2016 New Revision: 301946 URL: https://svnweb.freebsd.org/changeset/base/301946 Log: MFC 297142,297143,297176,297177,297178,297221 297142 hyperv: Factor out snprinf_hv_guid() Submitted by: Ju Sun Reviewed by: Dexuan Cui , sephe MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5651 297143 hyperv/vmbus: Implement bus_child_pnpinfo_str method Submitted by: Jun Su Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5669 297176 hyperv/evttimer: Use an independent message slot so that it can work Using the same message slot as the other types of the messages has the side effect that the event timer message could be deferred to the swi threads to run (lacking of trapframe and the original code didn't even handle that, so the event timer was actually broken). As of this commit we use an independent message slot for event timer, so that we could handle all of event timer messages in the interrupt handler directly. Note, the message slot for event timer is still bind to the same interrupt vector as the other types of messages. Submitted by: Jun Su Reviewed by: sephe Discussed with: Jun Su , Dexuan Cui MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5696 297177 hyperv/vmbus: Use taskqueue_fast for non-performance critical messages This gets rid of the per-cpu SWIs. Submitted by: Jun Su Reviewed by: Dexuan Cui , sephe MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5215 297178 hyperv/vmbus: Remove NULL check for taskqueue_create_fast(M_WAITOK) Submitted by: Jun Su Reviewed by: Dexuan Cui , sephe MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5215 297221 hyperv/vmbus: Create per-cpu fast taskqueue for msg handling Using one taskqueue does not work, since the EOM MSR must be written on the msg's owner CPU. Noticed by: Jun Su Discussed with: Jun Su , Dexuan Cui MFC after: 1 week Sponsored by: Microsoft OSTC Modified: stable/10/sys/dev/hyperv/include/hyperv.h stable/10/sys/dev/hyperv/utilities/hv_kvp.c stable/10/sys/dev/hyperv/vmbus/hv_et.c stable/10/sys/dev/hyperv/vmbus/hv_hv.c stable/10/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c stable/10/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/include/hyperv.h ============================================================================== --- stable/10/sys/dev/hyperv/include/hyperv.h Thu Jun 16 03:02:27 2016 (r301945) +++ stable/10/sys/dev/hyperv/include/hyperv.h Thu Jun 16 03:04:16 2016 (r301946) @@ -124,6 +124,8 @@ typedef struct hv_guid { unsigned char data[16]; } __packed hv_guid; +int snprintf_hv_guid(char *, size_t, const hv_guid *); + #define HV_NIC_GUID \ .data = {0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46, \ 0x91, 0x3F, 0xF2, 0xD2, 0xF9, 0x65, 0xED, 0x0E} Modified: stable/10/sys/dev/hyperv/utilities/hv_kvp.c ============================================================================== --- stable/10/sys/dev/hyperv/utilities/hv_kvp.c Thu Jun 16 03:02:27 2016 (r301945) +++ stable/10/sys/dev/hyperv/utilities/hv_kvp.c Thu Jun 16 03:04:16 2016 (r301946) @@ -304,28 +304,11 @@ hv_kvp_convert_utf16_ipinfo_to_utf8(stru { int err_ip, err_subnet, err_gway, err_dns, err_adap; int UNUSED_FLAG = 1; - int guid_index; struct hv_device *hv_dev; /* GUID Data Structure */ hn_softc_t *sc; /* hn softc structure */ char if_name[4]; - unsigned char guid_instance[40]; - char *guid_data = NULL; char buf[39]; - struct guid_extract { - char a1[2]; - char a2[2]; - char a3[2]; - char a4[2]; - char b1[2]; - char b2[2]; - char c1[2]; - char c2[2]; - char d[4]; - char e[12]; - }; - - struct guid_extract *id; device_t *devs; int devcnt; @@ -352,17 +335,7 @@ hv_kvp_convert_utf16_ipinfo_to_utf8(stru /* Trying to find GUID of Network Device */ hv_dev = sc->hn_dev_obj; - for (guid_index = 0; guid_index < 16; guid_index++) { - sprintf(&guid_instance[guid_index * 2], "%02x", - hv_dev->device_id.data[guid_index]); - } - - guid_data = (char *)guid_instance; - id = (struct guid_extract *)guid_data; - snprintf(buf, sizeof(buf), "{%.2s%.2s%.2s%.2s-%.2s%.2s-%.2s%.2s-%.4s-%s}", - id->a4, id->a3, id->a2, id->a1, - id->b2, id->b1, id->c2, id->c1, id->d, id->e); - guid_data = NULL; + snprintf_hv_guid(buf, sizeof(buf), &hv_dev->device_id); sprintf(if_name, "%s%d", "hn", device_get_unit(devs[devcnt])); if (strncmp(buf, (char *)umsg->body.kvp_ip_val.adapter_id, 39) == 0) { Modified: stable/10/sys/dev/hyperv/vmbus/hv_et.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_et.c Thu Jun 16 03:02:27 2016 (r301945) +++ stable/10/sys/dev/hyperv/vmbus/hv_et.c Thu Jun 16 03:04:16 2016 (r301946) @@ -60,7 +60,7 @@ hv_et_start(struct eventtimer *et, sbint timer_cfg.as_uint64 = 0; timer_cfg.auto_enable = 1; - timer_cfg.sintx = HV_VMBUS_MESSAGE_SINT; + timer_cfg.sintx = HV_VMBUS_TIMER_SINT; periodticks[curcpu] = sbintime2tick(periodtime); if (firsttime == 0) Modified: stable/10/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_hv.c Thu Jun 16 03:02:27 2016 (r301945) +++ stable/10/sys/dev/hyperv/vmbus/hv_hv.c Thu Jun 16 03:04:16 2016 (r301946) @@ -370,6 +370,9 @@ hv_vmbus_synic_init(void *arg) wrmsr(HV_X64_MSR_SINT0 + HV_VMBUS_MESSAGE_SINT, shared_sint.as_uint64_t); + wrmsr(HV_X64_MSR_SINT0 + HV_VMBUS_TIMER_SINT, + shared_sint.as_uint64_t); + /* Enable the global synic bit */ sctrl.as_uint64_t = rdmsr(HV_X64_MSR_SCONTROL); sctrl.u.enable = 1; @@ -406,12 +409,23 @@ void hv_vmbus_synic_cleanup(void *arg) shared_sint.u.masked = 1; /* - * Disable the interrupt + * Disable the interrupt 0 */ wrmsr( HV_X64_MSR_SINT0 + HV_VMBUS_MESSAGE_SINT, shared_sint.as_uint64_t); + shared_sint.as_uint64_t = rdmsr( + HV_X64_MSR_SINT0 + HV_VMBUS_TIMER_SINT); + + shared_sint.u.masked = 1; + + /* + * Disable the interrupt 1 + */ + wrmsr( + HV_X64_MSR_SINT0 + HV_VMBUS_TIMER_SINT, + shared_sint.as_uint64_t); simp.as_uint64_t = rdmsr(HV_X64_MSR_SIMP); simp.u.simp_enabled = 0; simp.u.base_simp_gpa = 0; Modified: stable/10/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Thu Jun 16 03:02:27 2016 (r301945) +++ stable/10/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Thu Jun 16 03:04:16 2016 (r301946) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "hv_vmbus_priv.h" #include @@ -75,7 +76,7 @@ static char *vmbus_ids[] = { "VMBUS", NU * the hypervisor. */ static void -vmbus_msg_swintr(void *arg) +vmbus_msg_swintr(void *arg, int pending __unused) { int cpu; void* page_addr; @@ -178,12 +179,15 @@ hv_vmbus_isr(struct trapframe *frame) /* Check if there are actual msgs to be process */ page_addr = hv_vmbus_g_context.syn_ic_msg_page[cpu]; - msg = (hv_vmbus_message*) page_addr + HV_VMBUS_MESSAGE_SINT; + msg = (hv_vmbus_message*) page_addr + HV_VMBUS_TIMER_SINT; /* we call eventtimer process the message */ if (msg->header.message_type == HV_MESSAGE_TIMER_EXPIRED) { msg->header.message_type = HV_MESSAGE_TYPE_NONE; + /* call intrrupt handler of event timer */ + hv_et_intr(frame); + /* * Make sure the write to message_type (ie set to * HV_MESSAGE_TYPE_NONE) happens before we read the @@ -204,12 +208,12 @@ hv_vmbus_isr(struct trapframe *frame) */ wrmsr(HV_X64_MSR_EOM, 0); } - hv_et_intr(frame); - return (FILTER_HANDLED); } + msg = (hv_vmbus_message*) page_addr + HV_VMBUS_MESSAGE_SINT; if (msg->header.message_type != HV_MESSAGE_TYPE_NONE) { - swi_sched(hv_vmbus_g_context.msg_swintr[cpu], 0); + taskqueue_enqueue(hv_vmbus_g_context.hv_msg_tq[cpu], + &hv_vmbus_g_context.hv_msg_task[cpu]); } return (FILTER_HANDLED); @@ -287,6 +291,23 @@ vmbus_write_ivar( return (ENOENT); } +static int +vmbus_child_pnpinfo_str(device_t dev, device_t child, char *buf, size_t buflen) +{ + char guidbuf[40]; + struct hv_device *dev_ctx = device_get_ivars(child); + + strlcat(buf, "classid=", buflen); + snprintf_hv_guid(guidbuf, sizeof(guidbuf), &dev_ctx->class_id); + strlcat(buf, guidbuf, buflen); + + strlcat(buf, " deviceid=", buflen); + snprintf_hv_guid(guidbuf, sizeof(guidbuf), &dev_ctx->device_id); + strlcat(buf, guidbuf, buflen); + + return (0); +} + struct hv_device* hv_vmbus_child_device_create( hv_guid type, @@ -308,15 +329,17 @@ hv_vmbus_child_device_create( return (child_dev); } -static void -print_dev_guid(struct hv_device *dev) +int +snprintf_hv_guid(char *buf, size_t sz, const hv_guid *guid) { - int i; - unsigned char guid_name[100]; - for (i = 0; i < 32; i += 2) - sprintf(&guid_name[i], "%02x", dev->class_id.data[i / 2]); - if(bootverbose) - printf("VMBUS: Class ID: %s\n", guid_name); + int cnt; + const unsigned char *d = guid->data; + + cnt = snprintf(buf, sz, + "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", + d[3], d[2], d[1], d[0], d[5], d[4], d[7], d[6], + d[8], d[9], d[10], d[11], d[12], d[13], d[14], d[15]); + return (cnt); } int @@ -325,8 +348,11 @@ hv_vmbus_child_device_register(struct hv device_t child; int ret = 0; - print_dev_guid(child_dev); - + if (bootverbose) { + char name[40]; + snprintf_hv_guid(name, sizeof(name), &child_dev->class_id); + printf("VMBUS: Class ID: %s\n", name); + } child = device_add_child(vmbus_devp, NULL, -1); child_dev->device = child; @@ -506,9 +532,6 @@ vmbus_bus_init(void) setup_args.vector = hv_vmbus_g_context.hv_cb_vector; CPU_FOREACH(j) { - hv_vmbus_g_context.hv_msg_intr_event[j] = NULL; - hv_vmbus_g_context.msg_swintr[j] = NULL; - snprintf(buf, sizeof(buf), "cpu%d:hyperv", j); intrcnt_add(buf, &hv_vmbus_intr_cpu[j]); @@ -527,11 +550,6 @@ vmbus_bus_init(void) */ hv_vmbus_g_context.hv_event_queue[j] = taskqueue_create_fast("hyperv event", M_WAITOK, taskqueue_thread_enqueue, &hv_vmbus_g_context.hv_event_queue[j]); - if (hv_vmbus_g_context.hv_event_queue[j] == NULL) { - if (bootverbose) - printf("VMBUS: failed to setup taskqueue\n"); - goto cleanup1; - } taskqueue_start_threads(&hv_vmbus_g_context.hv_event_queue[j], 1, PI_NET, "hvevent%d", j); @@ -541,29 +559,20 @@ vmbus_bus_init(void) taskqueue_drain(hv_vmbus_g_context.hv_event_queue[j], &cpuset_task); /* - * Setup software interrupt thread and handler for msg handling. + * Setup per-cpu tasks and taskqueues to handle msg. */ - ret = swi_add(&hv_vmbus_g_context.hv_msg_intr_event[j], - "hv_msg", vmbus_msg_swintr, (void *)(long)j, SWI_CLOCK, 0, - &hv_vmbus_g_context.msg_swintr[j]); - if (ret) { - if(bootverbose) - printf("VMBUS: failed to setup msg swi for " - "cpu %d\n", j); - goto cleanup1; - } + hv_vmbus_g_context.hv_msg_tq[j] = taskqueue_create_fast( + "hyperv msg", M_WAITOK, taskqueue_thread_enqueue, + &hv_vmbus_g_context.hv_msg_tq[j]); + taskqueue_start_threads(&hv_vmbus_g_context.hv_msg_tq[j], 1, PI_NET, + "hvmsg%d", j); + TASK_INIT(&hv_vmbus_g_context.hv_msg_task[j], 0, + vmbus_msg_swintr, (void *)(long)j); - /* - * Bind the swi thread to the cpu. - */ - ret = intr_event_bind(hv_vmbus_g_context.hv_msg_intr_event[j], - j); - if (ret) { - if(bootverbose) - printf("VMBUS: failed to bind msg swi thread " - "to cpu %d\n", j); - goto cleanup1; - } + CPU_SETOF(j, &cpu_mask); + TASK_INIT(&cpuset_task, 0, vmbus_cpuset_setthread_task, &cpu_mask); + taskqueue_enqueue(hv_vmbus_g_context.hv_msg_tq[j], &cpuset_task); + taskqueue_drain(hv_vmbus_g_context.hv_msg_tq[j], &cpuset_task); /* * Prepare the per cpu msg and event pages to be called on each cpu. @@ -603,11 +612,10 @@ vmbus_bus_init(void) * remove swi and vmbus callback vector; */ CPU_FOREACH(j) { - if (hv_vmbus_g_context.hv_event_queue[j] != NULL) + if (hv_vmbus_g_context.hv_event_queue[j] != NULL) { taskqueue_free(hv_vmbus_g_context.hv_event_queue[j]); - if (hv_vmbus_g_context.msg_swintr[j] != NULL) - swi_remove(hv_vmbus_g_context.msg_swintr[j]); - hv_vmbus_g_context.hv_msg_intr_event[j] = NULL; + hv_vmbus_g_context.hv_event_queue[j] = NULL; + } } vmbus_vector_free(hv_vmbus_g_context.hv_cb_vector); @@ -672,11 +680,10 @@ vmbus_bus_exit(void) /* remove swi */ CPU_FOREACH(i) { - if (hv_vmbus_g_context.hv_event_queue[i] != NULL) + if (hv_vmbus_g_context.hv_event_queue[i] != NULL) { taskqueue_free(hv_vmbus_g_context.hv_event_queue[i]); - if (hv_vmbus_g_context.msg_swintr[i] != NULL) - swi_remove(hv_vmbus_g_context.msg_swintr[i]); - hv_vmbus_g_context.hv_msg_intr_event[i] = NULL; + hv_vmbus_g_context.hv_event_queue[i] = NULL; + } } vmbus_vector_free(hv_vmbus_g_context.hv_cb_vector); @@ -741,6 +748,7 @@ static device_method_t vmbus_methods[] = DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_read_ivar, vmbus_read_ivar), DEVMETHOD(bus_write_ivar, vmbus_write_ivar), + DEVMETHOD(bus_child_pnpinfo_str, vmbus_child_pnpinfo_str), { 0, 0 } }; Modified: stable/10/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Thu Jun 16 03:02:27 2016 (r301945) +++ stable/10/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Thu Jun 16 03:04:16 2016 (r301946) @@ -181,7 +181,8 @@ enum { HV_VMBUS_EVENT_PORT_ID = 2, HV_VMBUS_MONITOR_CONNECTION_ID = 3, HV_VMBUS_MONITOR_PORT_ID = 3, - HV_VMBUS_MESSAGE_SINT = 2 + HV_VMBUS_MESSAGE_SINT = 2, + HV_VMBUS_TIMER_SINT = 4, }; #define HV_PRESENT_BIT 0x80000000 @@ -204,8 +205,8 @@ typedef struct { * event and msg handling. */ struct taskqueue *hv_event_queue[MAXCPU]; - struct intr_event *hv_msg_intr_event[MAXCPU]; - void *msg_swintr[MAXCPU]; + struct taskqueue *hv_msg_tq[MAXCPU]; + struct task hv_msg_task[MAXCPU]; /* * Host use this vector to intrrupt guest for vmbus channel * event and msg. From owner-svn-src-all@freebsd.org Thu Jun 16 03:16:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 019A9A473AE; Thu, 16 Jun 2016 03:16:45 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D12A816FC; Thu, 16 Jun 2016 03:16:44 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5G3GiLQ051307; Thu, 16 Jun 2016 03:16:44 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5G3Giks051306; Thu, 16 Jun 2016 03:16:44 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606160316.u5G3Giks051306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 16 Jun 2016 03:16:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301947 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 03:16:45 -0000 Author: sephe Date: Thu Jun 16 03:16:43 2016 New Revision: 301947 URL: https://svnweb.freebsd.org/changeset/base/301947 Log: MFC 297180,297181,297182 297180 hyperv/hn: Reduce TCP segment aggregation limit for multiple RX rings This mainly used to improve ACK timeliness when multiple RX rings are enabled. This value gives the best performance in both Azure and Hyper-V environment, w/ both 10Ge and 40Ge using non-{INVARIANTS,WITNESS} kernel. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5691 297181 hyperv/hn: Factor out hn_set_lro_lenlim() MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5692 297182 hyperv/hn: When short of mbufs on the RX path, don't spam the console. Instead, increase the IQDROPS counter. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5693 Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Jun 16 03:04:16 2016 (r301946) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Jun 16 03:16:43 2016 (r301947) @@ -183,6 +183,7 @@ struct hn_txdesc { #define HN_CSUM_ASSIST_WIN8 (CSUM_IP | CSUM_TCP) #define HN_CSUM_ASSIST (CSUM_IP | CSUM_UDP | CSUM_TCP) +#define HN_LRO_LENLIM_MULTIRX_DEF (12 * ETHERMTU) #define HN_LRO_LENLIM_DEF (25 * ETHERMTU) /* YYY 2*MTU is a bit rough, but should be good enough. */ #define HN_LRO_LENLIM_MIN(ifp) (2 * (ifp)->if_mtu) @@ -339,6 +340,17 @@ static void hn_xmit_txeof(struct hn_tx_r static void hn_xmit_taskfunc(void *, int); static void hn_xmit_txeof_taskfunc(void *, int); +#if __FreeBSD_version >= 1100099 +static void +hn_set_lro_lenlim(struct hn_softc *sc, int lenlim) +{ + int i; + + for (i = 0; i < sc->hn_rx_ring_inuse; ++i) + sc->hn_rx_ring[i].hn_lro.lro_length_lim = lenlim; +} +#endif + static int hn_ifmedia_upd(struct ifnet *ifp __unused) { @@ -550,6 +562,16 @@ netvsc_attach(device_t dev) device_printf(dev, "%d TX ring, %d RX ring\n", sc->hn_tx_ring_inuse, sc->hn_rx_ring_inuse); +#if __FreeBSD_version >= 1100099 + if (sc->hn_rx_ring_inuse > 1) { + /* + * Reduce TCP segment aggregation limit for multiple + * RX rings to increase ACK timeliness. + */ + hn_set_lro_lenlim(sc, HN_LRO_LENLIM_MULTIRX_DEF); + } +#endif + if (device_info.link_state == 0) { sc->hn_carrier = 1; } @@ -1258,8 +1280,10 @@ netvsc_recv(struct hv_vmbus_channel *cha return (0); } else if (packet->tot_data_buf_len <= MHLEN) { m_new = m_gethdr(M_NOWAIT, MT_DATA); - if (m_new == NULL) + if (m_new == NULL) { + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); return (0); + } memcpy(mtod(m_new, void *), packet->data, packet->tot_data_buf_len); m_new->m_pkthdr.len = m_new->m_len = packet->tot_data_buf_len; @@ -1279,7 +1303,7 @@ netvsc_recv(struct hv_vmbus_channel *cha m_new = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, size); if (m_new == NULL) { - if_printf(ifp, "alloc mbuf failed.\n"); + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); return (0); } @@ -1469,13 +1493,8 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, */ NV_LOCK(sc); if (sc->hn_rx_ring[0].hn_lro.lro_length_lim < - HN_LRO_LENLIM_MIN(ifp)) { - int i; - for (i = 0; i < sc->hn_rx_ring_inuse; ++i) { - sc->hn_rx_ring[i].hn_lro.lro_length_lim = - HN_LRO_LENLIM_MIN(ifp); - } - } + HN_LRO_LENLIM_MIN(ifp)) + hn_set_lro_lenlim(sc, HN_LRO_LENLIM_MIN(ifp)); NV_UNLOCK(sc); #endif @@ -1808,7 +1827,7 @@ hn_lro_lenlim_sysctl(SYSCTL_HANDLER_ARGS { struct hn_softc *sc = arg1; unsigned int lenlim; - int error, i; + int error; lenlim = sc->hn_rx_ring[0].hn_lro.lro_length_lim; error = sysctl_handle_int(oidp, &lenlim, 0, req); @@ -1820,8 +1839,7 @@ hn_lro_lenlim_sysctl(SYSCTL_HANDLER_ARGS return EINVAL; NV_LOCK(sc); - for (i = 0; i < sc->hn_rx_ring_inuse; ++i) - sc->hn_rx_ring[i].hn_lro.lro_length_lim = lenlim; + hn_set_lro_lenlim(sc, lenlim); NV_UNLOCK(sc); return 0; } From owner-svn-src-all@freebsd.org Thu Jun 16 03:25:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 991B3A47580; Thu, 16 Jun 2016 03:25:27 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A7BA1B45; Thu, 16 Jun 2016 03:25:27 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5G3PQTk054956; Thu, 16 Jun 2016 03:25:26 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5G3PQbl054952; Thu, 16 Jun 2016 03:25:26 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606160325.u5G3PQbl054952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 16 Jun 2016 03:25:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301948 - stable/10/sys/dev/hyperv/utilities X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 03:25:27 -0000 Author: sephe Date: Thu Jun 16 03:25:26 2016 New Revision: 301948 URL: https://svnweb.freebsd.org/changeset/base/301948 Log: MFC 297220 hyperv/utils: Allow hint to disable individual utility Reviewed by: kib, Dexuan Cui MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5714 Modified: stable/10/sys/dev/hyperv/utilities/hv_heartbeat.c stable/10/sys/dev/hyperv/utilities/hv_kvp.c stable/10/sys/dev/hyperv/utilities/hv_shutdown.c stable/10/sys/dev/hyperv/utilities/hv_timesync.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/utilities/hv_heartbeat.c ============================================================================== --- stable/10/sys/dev/hyperv/utilities/hv_heartbeat.c Thu Jun 16 03:16:43 2016 (r301947) +++ stable/10/sys/dev/hyperv/utilities/hv_heartbeat.c Thu Jun 16 03:25:26 2016 (r301948) @@ -94,6 +94,10 @@ static int hv_heartbeat_probe(device_t dev) { const char *p = vmbus_get_type(dev); + + if (resource_disabled("hvheartbeat", 0)) + return ENXIO; + if (!memcmp(p, &service_guid, sizeof(hv_guid))) { device_set_desc(dev, "Hyper-V Heartbeat Service"); return BUS_PROBE_DEFAULT; Modified: stable/10/sys/dev/hyperv/utilities/hv_kvp.c ============================================================================== --- stable/10/sys/dev/hyperv/utilities/hv_kvp.c Thu Jun 16 03:16:43 2016 (r301947) +++ stable/10/sys/dev/hyperv/utilities/hv_kvp.c Thu Jun 16 03:25:26 2016 (r301948) @@ -863,6 +863,10 @@ static int hv_kvp_probe(device_t dev) { const char *p = vmbus_get_type(dev); + + if (resource_disabled("hvkvp", 0)) + return ENXIO; + if (!memcmp(p, &service_guid, sizeof(hv_guid))) { device_set_desc(dev, "Hyper-V KVP Service"); return BUS_PROBE_DEFAULT; Modified: stable/10/sys/dev/hyperv/utilities/hv_shutdown.c ============================================================================== --- stable/10/sys/dev/hyperv/utilities/hv_shutdown.c Thu Jun 16 03:16:43 2016 (r301947) +++ stable/10/sys/dev/hyperv/utilities/hv_shutdown.c Thu Jun 16 03:25:26 2016 (r301948) @@ -116,6 +116,10 @@ static int hv_shutdown_probe(device_t dev) { const char *p = vmbus_get_type(dev); + + if (resource_disabled("hvshutdown", 0)) + return ENXIO; + if (!memcmp(p, &service_guid, sizeof(hv_guid))) { device_set_desc(dev, "Hyper-V Shutdown Service"); return BUS_PROBE_DEFAULT; Modified: stable/10/sys/dev/hyperv/utilities/hv_timesync.c ============================================================================== --- stable/10/sys/dev/hyperv/utilities/hv_timesync.c Thu Jun 16 03:16:43 2016 (r301947) +++ stable/10/sys/dev/hyperv/utilities/hv_timesync.c Thu Jun 16 03:25:26 2016 (r301948) @@ -171,6 +171,10 @@ static int hv_timesync_probe(device_t dev) { const char *p = vmbus_get_type(dev); + + if (resource_disabled("hvtimesync", 0)) + return ENXIO; + if (!memcmp(p, &service_guid, sizeof(hv_guid))) { device_set_desc(dev, "Hyper-V Time Synch Service"); return BUS_PROBE_DEFAULT; From owner-svn-src-all@freebsd.org Thu Jun 16 04:21:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79E33A5349F; Thu, 16 Jun 2016 04:21:28 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47C371653; Thu, 16 Jun 2016 04:21:28 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5G4LROR074329; Thu, 16 Jun 2016 04:21:27 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5G4LRx2074327; Thu, 16 Jun 2016 04:21:27 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606160421.u5G4LRx2074327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 16 Jun 2016 04:21:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301949 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 04:21:28 -0000 Author: sephe Date: Thu Jun 16 04:21:27 2016 New Revision: 301949 URL: https://svnweb.freebsd.org/changeset/base/301949 Log: MFC 297265 tcp/lro: Return TCP_LRO_NO_ENTRIES if we are short of LRO entries. So that callers could react accordingly. Reviewed by: gallatin (no objection) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5695 Modified: stable/10/sys/netinet/tcp_lro.c stable/10/sys/netinet/tcp_lro.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/tcp_lro.c ============================================================================== --- stable/10/sys/netinet/tcp_lro.c Thu Jun 16 03:25:26 2016 (r301948) +++ stable/10/sys/netinet/tcp_lro.c Thu Jun 16 04:21:27 2016 (r301949) @@ -570,7 +570,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m /* Try to find an empty slot. */ if (SLIST_EMPTY(&lc->lro_free)) - return (TCP_LRO_CANNOT); + return (TCP_LRO_NO_ENTRIES); /* Start a new segment chain. */ le = SLIST_FIRST(&lc->lro_free); Modified: stable/10/sys/netinet/tcp_lro.h ============================================================================== --- stable/10/sys/netinet/tcp_lro.h Thu Jun 16 03:25:26 2016 (r301948) +++ stable/10/sys/netinet/tcp_lro.h Thu Jun 16 04:21:27 2016 (r301949) @@ -90,6 +90,7 @@ void tcp_lro_flush_inactive(struct lro_c void tcp_lro_flush(struct lro_ctrl *, struct lro_entry *); int tcp_lro_rx(struct lro_ctrl *, struct mbuf *, uint32_t); +#define TCP_LRO_NO_ENTRIES -2 #define TCP_LRO_CANNOT -1 #define TCP_LRO_NOT_SUPPORTED 1 From owner-svn-src-all@freebsd.org Thu Jun 16 04:32:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95A1FA536C4; Thu, 16 Jun 2016 04:32:12 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 640A21CAB; Thu, 16 Jun 2016 04:32:12 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5G4WBFV080498; Thu, 16 Jun 2016 04:32:11 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5G4WB31080497; Thu, 16 Jun 2016 04:32:11 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606160432.u5G4WB31080497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 16 Jun 2016 04:32:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301950 - stable/10/sys/dev/vt/hw/vga X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 04:32:12 -0000 Author: sephe Date: Thu Jun 16 04:32:11 2016 New Revision: 301950 URL: https://svnweb.freebsd.org/changeset/base/301950 Log: MFC 297334 vt: Use textmode when we're running on hypervisors The graphic mode is noticeably slow on hypervisors, especially on Hyper-V (1 second to each line). Submitted by: Dexuan Cui Reviewed by: kib, sephe, royger (early loader version) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5739 Modified: stable/10/sys/dev/vt/hw/vga/vt_vga.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/vt/hw/vga/vt_vga.c ============================================================================== --- stable/10/sys/dev/vt/hw/vga/vt_vga.c Thu Jun 16 04:21:27 2016 (r301949) +++ stable/10/sys/dev/vt/hw/vga/vt_vga.c Thu Jun 16 04:32:11 2016 (r301950) @@ -1200,7 +1200,6 @@ vga_init(struct vt_device *vd) if (vd->vd_softc == NULL) vd->vd_softc = (void *)&vga_conssoftc; sc = vd->vd_softc; - textmode = 0; #if defined(__amd64__) || defined(__i386__) sc->vga_fb_tag = X86_BUS_SPACE_MEM; @@ -1217,6 +1216,13 @@ vga_init(struct vt_device *vd) bus_space_map(sc->vga_reg_tag, VGA_REG_BASE, VGA_REG_SIZE, 0, &sc->vga_reg_handle); + /* + * If "hw.vga.textmode" is not set and we're running on hypervisor, + * we use text mode by default, this is because when we're on + * hypervisor, vt(4) is usually much slower in graphics mode than + * in text mode, especially when we're on Hyper-V. + */ + textmode = vm_guest != VM_GUEST_NO; TUNABLE_INT_FETCH("hw.vga.textmode", &textmode); if (textmode) { vd->vd_flags |= VDF_TEXTMODE; From owner-svn-src-all@freebsd.org Thu Jun 16 05:12:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 390B0A4704E; Thu, 16 Jun 2016 05:12:30 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 149C01E70; Thu, 16 Jun 2016 05:12:30 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5G5CTkV095228; Thu, 16 Jun 2016 05:12:29 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5G5CTR4095225; Thu, 16 Jun 2016 05:12:29 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606160512.u5G5CTR4095225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 16 Jun 2016 05:12:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301951 - stable/10/sys/dev/hyperv/vmbus X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 05:12:30 -0000 Author: sephe Date: Thu Jun 16 05:12:28 2016 New Revision: 301951 URL: https://svnweb.freebsd.org/changeset/base/301951 Log: MFC 297636,297800,297801,297805,297807,297808 297636 hyperv: Typo in r297634 Noticed by: hiren MFC after: 1 week Sponsored by: Microsoft OSTC 297800 hyperv/vmbus: Nuke unused function MFC after: 1 week Sponsored by: Microsoft OSTC 297801 hyperv/vmbus: Get rid of max_leaf detection; this is actually not used. It will be replaced by a new one. MFC after: 1 week Sponsored by: Microsoft OSTC 297805 hyperv: Break long line MFC after: 1 week Sponsored by: Microsoft OSTC 297807 hyperv: Print more features And add comment about the MSR features. MFC after: 1 week Sponsored by: Microsoft OSTC 297808 hyperv: Define macro for Hyper-V interface Suggested by: rpokala MFC after: 1 week Sponsored by: Microsoft OSTC Modified: stable/10/sys/dev/hyperv/vmbus/hv_hv.c stable/10/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c stable/10/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_hv.c Thu Jun 16 04:32:11 2016 (r301950) +++ stable/10/sys/dev/hyperv/vmbus/hv_hv.c Thu Jun 16 05:12:28 2016 (r301951) @@ -48,12 +48,16 @@ __FBSDID("$FreeBSD$"); #define HV_NANOSECONDS_PER_SEC 1000000000L +#define HYPERV_INTERFACE 0x31237648 /* HV#1 */ static u_int hv_get_timecount(struct timecounter *tc); u_int hyperv_features; u_int hyperv_recommends; +static u_int hyperv_pm_features; +static u_int hyperv_features3; + /** * Globals */ @@ -74,47 +78,6 @@ hv_get_timecount(struct timecounter *tc) } /** - * @brief Query the cpuid for presence of windows hypervisor - */ -int -hv_vmbus_query_hypervisor_presence(void) -{ - if (vm_guest != VM_GUEST_HV) - return (0); - - return (hv_high >= HV_X64_CPUID_MIN && hv_high <= HV_X64_CPUID_MAX); -} - -/** - * @brief Get version of the windows hypervisor - */ -static int -hv_vmbus_get_hypervisor_version(void) -{ - u_int regs[4]; - unsigned int maxLeaf; - unsigned int op; - - /* - * Its assumed that this is called after confirming that - * Viridian is present - * Query id and revision. - */ - op = HV_CPU_ID_FUNCTION_HV_VENDOR_AND_MAX_FUNCTION; - do_cpuid(op, regs); - - maxLeaf = regs[0]; - op = HV_CPU_ID_FUNCTION_HV_INTERFACE; - do_cpuid(op, regs); - - if (maxLeaf >= HV_CPU_ID_FUNCTION_MS_HV_VERSION) { - op = HV_CPU_ID_FUNCTION_MS_HV_VERSION; - do_cpuid(op, regs); - } - return (maxLeaf); -} - -/** * @brief Invoke the specified hypercall */ static uint64_t @@ -163,7 +126,6 @@ hv_vmbus_do_hypercall(uint64_t control, int hv_vmbus_init(void) { - int max_leaf; hv_vmbus_x64_msr_hypercall_contents hypercall_msr; void* virt_addr = 0; @@ -180,8 +142,6 @@ hv_vmbus_init(void) if (vm_guest != VM_GUEST_HV) goto cleanup; - max_leaf = hv_vmbus_get_hypervisor_version(); - /* * Write our OS info */ @@ -457,7 +417,7 @@ hyperv_identify(void) op = HV_CPU_ID_FUNCTION_HV_INTERFACE; do_cpuid(op, regs); - if (regs[0] != 0x31237648 /* HV#1 */) + if (regs[0] != HYPERV_INTERFACE) return (false); op = HV_CPU_ID_FUNCTION_MS_HV_FEATURES; @@ -470,27 +430,50 @@ hyperv_identify(void) return (false); } hyperv_features = regs[0]; + hyperv_pm_features = regs[2]; + hyperv_features3 = regs[3]; op = HV_CPU_ID_FUNCTION_MS_HV_VERSION; do_cpuid(op, regs); printf("Hyper-V Version: %d.%d.%d [SP%d]\n", regs[1] >> 16, regs[1] & 0xffff, regs[0], regs[2]); - printf(" Features: 0x%b\n", hyperv_features, + printf(" Features=0x%b\n", hyperv_features, + "\020" + "\001VPRUNTIME" /* MSR_VP_RUNTIME */ + "\002TMREFCNT" /* MSR_TIME_REF_COUNT */ + "\003SYNIC" /* MSRs for SynIC */ + "\004SYNTM" /* MSRs for SynTimer */ + "\005APIC" /* MSR_{EOI,ICR,TPR} */ + "\006HYERCALL" /* MSR_{GUEST_OS_ID,HYPERCALL} */ + "\007VPINDEX" /* MSR_VP_INDEX */ + "\010RESET" /* MSR_RESET */ + "\011STATS" /* MSR_STATS_ */ + "\012REFTSC" /* MSR_REFERENCE_TSC */ + "\013IDLE" /* MSR_GUEST_IDLE */ + "\014TMFREQ" /* MSR_{TSC,APIC}_FREQUENCY */ + "\015DEBUG"); /* MSR_SYNTH_DEBUG_ */ + printf(" PM Features=max C%u, 0x%b\n", + HV_PM_FEATURE_CSTATE(hyperv_pm_features), + (hyperv_pm_features & ~HV_PM_FEATURE_CSTATE_MASK), + "\020" + "\005C3HPET"); /* HPET is required for C3 state */ + printf(" Features3=0x%b\n", hyperv_features3, "\020" - "\001VPRUNTIME" - "\002TMREFCNT" - "\003SYNCIC" - "\004SYNCTM" - "\005APIC" - "\006HYERCALL" - "\007VPINDEX" - "\010RESET" - "\011STATS" - "\012REFTSC" - "\013IDLE" - "\014TMFREQ" - "\015DEBUG"); + "\001MWAIT" /* MWAIT */ + "\002DEBUG" /* guest debug support */ + "\003PERFMON" /* performance monitor */ + "\004PCPUDPE" /* physical CPU dynamic partition event */ + "\005XMMHC" /* hypercall input through XMM regs */ + "\006IDLE" /* guest idle support */ + "\007SLEEP" /* hypervisor sleep support */ + "\010NUMA" /* NUMA distance query support */ + "\011TMFREQ" /* timer frequency query (TSC, LAPIC) */ + "\012SYNCMC" /* inject synthetic machine checks */ + "\013CRASH" /* MSRs for guest crash */ + "\014DEBUGMSR" /* MSRs for guest debug */ + "\015NPIEP" /* NPIEP */ + "\016HVDIS"); /* disabling hypervisor */ op = HV_CPU_ID_FUNCTION_MS_HV_ENLIGHTENMENT_INFORMATION; do_cpuid(op, regs); @@ -528,4 +511,5 @@ hyperv_init(void *dummy __unused) tc_init(&hv_timecounter); } } -SYSINIT(hyperv_initialize, SI_SUB_HYPERVISOR, SI_ORDER_FIRST, hyperv_init, NULL); +SYSINIT(hyperv_initialize, SI_SUB_HYPERVISOR, SI_ORDER_FIRST, hyperv_init, + NULL); Modified: stable/10/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Thu Jun 16 04:32:11 2016 (r301950) +++ stable/10/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c Thu Jun 16 05:12:28 2016 (r301951) @@ -120,7 +120,7 @@ handled: * * NOTE: * mb() is used here, since atomic_thread_fence_seq_cst() - * will become compler fence on UP kernel. + * will become compiler fence on UP kernel. */ mb(); @@ -197,7 +197,7 @@ hv_vmbus_isr(struct trapframe *frame) * * NOTE: * mb() is used here, since atomic_thread_fence_seq_cst() - * will become compler fence on UP kernel. + * will become compiler fence on UP kernel. */ mb(); Modified: stable/10/sys/dev/hyperv/vmbus/hv_vmbus_priv.h ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Thu Jun 16 04:32:11 2016 (r301950) +++ stable/10/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Thu Jun 16 05:12:28 2016 (r301951) @@ -475,12 +475,23 @@ typedef enum { HV_CPU_ID_FUNCTION_MS_HV_HARDWARE_FEATURE = 0x40000006 } hv_vmbus_cpuid_function; -#define HV_FEATURE_MSR_TIME_REFCNT (1 << 1) -#define HV_FEATURE_MSR_SYNCIC (1 << 2) -#define HV_FEATURE_MSR_STIMER (1 << 3) -#define HV_FEATURE_MSR_APIC (1 << 4) -#define HV_FEATURE_MSR_HYPERCALL (1 << 5) -#define HV_FEATURE_MSR_GUEST_IDLE (1 << 10) +#define HV_FEATURE_MSR_TIME_REFCNT 0x0002 /* MSR_TIME_REF_COUNT */ +#define HV_FEATURE_MSR_SYNIC 0x0004 /* MSRs for SynIC */ +#define HV_FEATURE_MSR_SYNTIMER 0x0008 /* MSRs for SynTimer */ +#define HV_FEATURE_MSR_APIC 0x0010 /* MSR_{EOI,ICR,TPR} */ +#define HV_FEATURE_MSR_HYPERCALL 0x0020 /* MSR_{GUEST_OS_ID,HYPERCALL} */ +#define HV_FEATURE_MSR_GUEST_IDLE 0x0400 /* MSR_GUEST_IDLE */ + +#define HV_PM_FEATURE_CSTATE_MASK 0x000f +#define HV_PM_FEATURE_C3_HPET 0x0010 /* C3 requires HPET */ +#define HV_PM_FEATURE_CSTATE(f) ((f) & HV_PM_FEATURE_CSTATE_MASK) + +#define HV_FEATURE3_MWAIT 0x0001 /* MWAIT */ +#define HV_FEATURE3_XMM_HYPERCALL 0x0010 /* hypercall input through XMM regs */ +#define HV_FEATURE3_GUEST_IDLE 0x0020 /* guest idle support */ +#define HV_FEATURE3_NUMA 0x0080 /* NUMA distance query support */ +#define HV_FEATURE3_TIME_FREQ 0x0100 /* timer frequency query (TSC, LAPIC) */ +#define HV_FEATURE3_MSR_CRASH 0x0400 /* MSRs for guest crash */ /* * Define the format of the SIMP register @@ -714,7 +725,6 @@ uint16_t hv_vmbus_post_msg_via_msg_ipc( uint16_t hv_vmbus_signal_event(void *con_id); void hv_vmbus_synic_init(void *irq_arg); void hv_vmbus_synic_cleanup(void *arg); -int hv_vmbus_query_hypervisor_presence(void); struct hv_device* hv_vmbus_child_device_create( hv_guid device_type, From owner-svn-src-all@freebsd.org Thu Jun 16 05:24:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B600FA4752F; Thu, 16 Jun 2016 05:24:01 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92AF625BC; Thu, 16 Jun 2016 05:24:01 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5G5O0s4098995; Thu, 16 Jun 2016 05:24:00 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5G5O0bg098992; Thu, 16 Jun 2016 05:24:00 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606160524.u5G5O0bg098992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 16 Jun 2016 05:24:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301952 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 05:24:01 -0000 Author: sephe Date: Thu Jun 16 05:24:00 2016 New Revision: 301952 URL: https://svnweb.freebsd.org/changeset/base/301952 Log: MFC 297809,297810,297811 297809 hyperv/hn: Cap default # of rings to 8. 8 gives the best performance in both Azure and local Hyper-V on both 10Ge and 40Ge. More rings are still allowed by manual configuration. Reviewed by: Dexuan Cui MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5879 297810 hyperv/hn: By default enable multiple TX/RX rings, aka vRSS. Reviewed by: Dexuan Cui MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5880 297811 hyperv/hn: Remove unnecessary NULL checks Submitted by: Jun Su Reviewed by: sephe MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5905 Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c Thu Jun 16 05:12:28 2016 (r301951) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c Thu Jun 16 05:24:00 2016 (r301952) @@ -741,10 +741,8 @@ cleanup: * Free the packet buffers on the netvsc device packet queue. * Release other resources. */ - if (net_dev) { - sema_destroy(&net_dev->channel_init_sema); - free(net_dev, M_NETVSC); - } + sema_destroy(&net_dev->channel_init_sema); + free(net_dev, M_NETVSC); return (NULL); } Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Jun 16 05:12:28 2016 (r301951) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Jun 16 05:24:00 2016 (r301952) @@ -138,6 +138,8 @@ __FBSDID("$FreeBSD$"); #define HN_LROENT_CNT_DEF 128 +#define HN_RING_CNT_DEF_MAX 8 + #define HN_RNDIS_MSG_LEN \ (sizeof(rndis_msg) + \ RNDIS_HASH_PPI_SIZE + \ @@ -282,12 +284,12 @@ static int hn_use_if_start = 0; SYSCTL_INT(_hw_hn, OID_AUTO, use_if_start, CTLFLAG_RDTUN, &hn_use_if_start, 0, "Use if_start TX method"); -static int hn_chan_cnt = 1; +static int hn_chan_cnt = 0; SYSCTL_INT(_hw_hn, OID_AUTO, chan_cnt, CTLFLAG_RDTUN, &hn_chan_cnt, 0, "# of channels to use; each channel has one RX ring and one TX ring"); -static int hn_tx_ring_cnt = 1; +static int hn_tx_ring_cnt = 0; SYSCTL_INT(_hw_hn, OID_AUTO, tx_ring_cnt, CTLFLAG_RDTUN, &hn_tx_ring_cnt, 0, "# of TX rings to use"); @@ -480,8 +482,14 @@ netvsc_attach(device_t dev) * The # of RX rings to use is same as the # of channels to use. */ ring_cnt = hn_chan_cnt; - if (ring_cnt <= 0 || ring_cnt > mp_ncpus) + if (ring_cnt <= 0) { + /* Default */ + ring_cnt = mp_ncpus; + if (ring_cnt > HN_RING_CNT_DEF_MAX) + ring_cnt = HN_RING_CNT_DEF_MAX; + } else if (ring_cnt > mp_ncpus) { ring_cnt = mp_ncpus; + } tx_ring_cnt = hn_tx_ring_cnt; if (tx_ring_cnt <= 0 || tx_ring_cnt > ring_cnt) Modified: stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c Thu Jun 16 05:12:28 2016 (r301951) +++ stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c Thu Jun 16 05:24:00 2016 (r301952) @@ -406,8 +406,7 @@ hv_rf_send_offload_request(struct hv_dev } cleanup: - if (request) - hv_put_rndis_request(rndis_dev, request); + hv_put_rndis_request(rndis_dev, request); return (ret); } @@ -908,10 +907,8 @@ hv_rf_halt_device(rndis_device *device) } device->state = RNDIS_DEV_UNINITIALIZED; - - if (request != NULL) { - hv_put_rndis_request(device, request); - } + + hv_put_rndis_request(device, request); return (0); } From owner-svn-src-all@freebsd.org Thu Jun 16 06:26:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A971AA69081; Thu, 16 Jun 2016 06:26:10 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FFAB1E21; Thu, 16 Jun 2016 06:26:10 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5G6Q9LY021150; Thu, 16 Jun 2016 06:26:09 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5G6Q9ac021149; Thu, 16 Jun 2016 06:26:09 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606160626.u5G6Q9ac021149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 16 Jun 2016 06:26:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301953 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 06:26:10 -0000 Author: sephe Date: Thu Jun 16 06:26:09 2016 New Revision: 301953 URL: https://svnweb.freebsd.org/changeset/base/301953 Log: hyperv/hn: ifnet TSO configuration is available on 10-stable. Sponsored by: Microsoft OSTC Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Jun 16 05:24:00 2016 (r301952) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Jun 16 06:26:09 2016 (r301953) @@ -237,12 +237,10 @@ SYSCTL_INT(_hw_hn, OID_AUTO, trust_hosti "Trust ip packet verification on host side, " "when csum info is missing (global setting)"); -#if __FreeBSD_version >= 1100045 /* Limit TSO burst size */ static int hn_tso_maxlen = 0; SYSCTL_INT(_hw_hn, OID_AUTO, tso_maxlen, CTLFLAG_RDTUN, &hn_tso_maxlen, 0, "TSO burst limit"); -#endif /* Limit chimney send size */ static int hn_tx_chimney_size = 0; @@ -432,9 +430,7 @@ netvsc_attach(device_t dev) int unit = device_get_unit(dev); struct ifnet *ifp = NULL; int error, ring_cnt, tx_ring_cnt; -#if __FreeBSD_version >= 1100045 int tso_maxlen; -#endif sc = device_get_softc(dev); if (sc == NULL) { @@ -584,7 +580,6 @@ netvsc_attach(device_t dev) sc->hn_carrier = 1; } -#if __FreeBSD_version >= 1100045 tso_maxlen = hn_tso_maxlen; if (tso_maxlen <= 0 || tso_maxlen > IP_MAXPACKET) tso_maxlen = IP_MAXPACKET; @@ -593,14 +588,11 @@ netvsc_attach(device_t dev) ifp->if_hw_tsomaxsegsize = PAGE_SIZE; ifp->if_hw_tsomax = tso_maxlen - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); -#endif ether_ifattach(ifp, device_info.mac_addr); -#if __FreeBSD_version >= 1100045 if_printf(ifp, "TSO: %u/%u/%u\n", ifp->if_hw_tsomax, ifp->if_hw_tsomaxsegcount, ifp->if_hw_tsomaxsegsize); -#endif sc->hn_tx_chimney_max = sc->net_dev->send_section_size; hn_set_tx_chimney_size(sc, sc->hn_tx_chimney_max); From owner-svn-src-all@freebsd.org Thu Jun 16 06:34:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 476F9A69493; Thu, 16 Jun 2016 06:34:14 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 098E516D7; Thu, 16 Jun 2016 06:34:13 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5G6YDij024904; Thu, 16 Jun 2016 06:34:13 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5G6YDOY024902; Thu, 16 Jun 2016 06:34:13 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201606160634.u5G6YDOY024902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 16 Jun 2016 06:34:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301954 - in stable/10/sys/dev/hyperv: netvsc vmbus X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 06:34:14 -0000 Author: sephe Date: Thu Jun 16 06:34:12 2016 New Revision: 301954 URL: https://svnweb.freebsd.org/changeset/base/301954 Log: MFC 298039,298042 298039 hyperv/vmbus: Put multi-channel offer logging under bootverbose Suggested by: Dexuan Cui MFC after: 1 week Sponsored by: Microsoft OSTC 298042 hyperv/hn: Hide ring to channel linkage message under bootverbose Suggested by: Dexuan Cui MFC after: 1 week Sponsored by: Microsoft OSTC Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c stable/10/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Jun 16 06:26:09 2016 (r301953) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Jun 16 06:34:12 2016 (r301954) @@ -2872,8 +2872,10 @@ hn_channel_attach(struct hn_softc *sc, s rxr->hn_rx_flags |= HN_RX_FLAG_ATTACHED; chan->hv_chan_rxr = rxr; - if_printf(sc->hn_ifp, "link RX ring %d to channel%u\n", - idx, chan->offer_msg.child_rel_id); + if (bootverbose) { + if_printf(sc->hn_ifp, "link RX ring %d to channel%u\n", + idx, chan->offer_msg.child_rel_id); + } if (idx < sc->hn_tx_ring_inuse) { struct hn_tx_ring *txr = &sc->hn_tx_ring[idx]; @@ -2884,8 +2886,10 @@ hn_channel_attach(struct hn_softc *sc, s chan->hv_chan_txr = txr; txr->hn_chan = chan; - if_printf(sc->hn_ifp, "link TX ring %d to channel%u\n", - idx, chan->offer_msg.child_rel_id); + if (bootverbose) { + if_printf(sc->hn_ifp, "link TX ring %d to channel%u\n", + idx, chan->offer_msg.child_rel_id); + } } /* Bind channel to a proper CPU */ Modified: stable/10/sys/dev/hyperv/vmbus/hv_channel_mgmt.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Thu Jun 16 06:26:09 2016 (r301953) +++ stable/10/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Thu Jun 16 06:34:12 2016 (r301954) @@ -222,10 +222,14 @@ vmbus_channel_process_offer(hv_vmbus_cha sc_list_entry); mtx_unlock(&channel->sc_lock); + if (bootverbose) { + printf("VMBUS get multi-channel offer, " + "rel=%u, sub=%u\n", + new_channel->offer_msg.child_rel_id, + new_channel->offer_msg.offer.sub_channel_index); + } + /* Insert new channel into channel_anchor. */ - printf("VMBUS get multi-channel offer, rel=%u,sub=%u\n", - new_channel->offer_msg.child_rel_id, - new_channel->offer_msg.offer.sub_channel_index); mtx_lock(&hv_vmbus_g_connection.channel_lock); TAILQ_INSERT_TAIL(&hv_vmbus_g_connection.channel_anchor, new_channel, list_entry); From owner-svn-src-all@freebsd.org Thu Jun 16 07:45:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD085A4731C; Thu, 16 Jun 2016 07:45:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76D3214C9; Thu, 16 Jun 2016 07:45:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5G7jvDe050453; Thu, 16 Jun 2016 07:45:57 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5G7jvag050452; Thu, 16 Jun 2016 07:45:57 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201606160745.u5G7jvag050452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 16 Jun 2016 07:45:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301955 - head/sys/boot/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 07:45:58 -0000 Author: avg Date: Thu Jun 16 07:45:57 2016 New Revision: 301955 URL: https://svnweb.freebsd.org/changeset/base/301955 Log: fix a zfs boot regression introduced in r300117 by accident There is no reason to return non-zero value from zfs_probe_partition() as that causes following partitions to not be probed for ZFS vdevs. A particular scenario that I encountered is a GPT partitioned disk where several partitions have freebsd-zfs type. A partition with a lower index is used as a cache (l2arc) vdev and in that case case zfs_probe() returned a non-zero status. That status was returned to ptable_iterate() and caused it to abort the iteration. Because of that the subsequent partitions were not probed and a root pool was not discovered resulting in a boot failure. While there fix the style for nearby return statements. Approved by: re (kib) Modified: head/sys/boot/zfs/zfs.c Modified: head/sys/boot/zfs/zfs.c ============================================================================== --- head/sys/boot/zfs/zfs.c Thu Jun 16 06:34:12 2016 (r301954) +++ head/sys/boot/zfs/zfs.c Thu Jun 16 07:45:57 2016 (r301955) @@ -450,7 +450,7 @@ zfs_probe_partition(void *arg, const cha /* Probe only freebsd-zfs and freebsd partitions */ if (part->type != PART_FREEBSD && part->type != PART_FREEBSD_ZFS) - return 0; + return (0); ppa = (struct zfs_probe_args *)arg; strncpy(devname, ppa->devname, strlen(ppa->devname) - 1); @@ -458,10 +458,10 @@ zfs_probe_partition(void *arg, const cha sprintf(devname, "%s%s:", devname, partname); pa.fd = open(devname, O_RDONLY); if (pa.fd == -1) - return 0; + return (0); ret = zfs_probe(pa.fd, ppa->pool_guid); if (ret == 0) - return 0; + return (0); /* Do we have BSD label here? */ if (part->type == PART_FREEBSD) { pa.devname = devname; @@ -470,12 +470,12 @@ zfs_probe_partition(void *arg, const cha table = ptable_open(&pa, part->end - part->start + 1, ppa->secsz, zfs_diskread); if (table != NULL) { - ret = ptable_iterate(table, &pa, zfs_probe_partition); + ptable_iterate(table, &pa, zfs_probe_partition); ptable_close(table); } } close(pa.fd); - return (ret); + return (0); } int From owner-svn-src-all@freebsd.org Thu Jun 16 07:47:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FC3CA473D9 for ; Thu, 16 Jun 2016 07:47:23 +0000 (UTC) (envelope-from se@freebsd.org) Received: from mailout12.t-online.de (mailout12.t-online.de [194.25.134.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailout00.t-online.de", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B6C41174A; Thu, 16 Jun 2016 07:47:22 +0000 (UTC) (envelope-from se@freebsd.org) Received: from fwd25.aul.t-online.de (fwd25.aul.t-online.de [172.20.26.130]) by mailout12.t-online.de (Postfix) with SMTP id 3604941F0C0B; Thu, 16 Jun 2016 09:40:43 +0200 (CEST) Received: from [192.168.119.34] (TEQcxUZVoh1ouvJW-EJfgC3fpFtoBLYQr7JjamnXnCk9bAuFPYv+PYlHtfyM2qWZtp@[84.154.107.192]) by fwd25.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-SHA encrypted) esmtp id 1bDRuq-0izQ7E0; Thu, 16 Jun 2016 09:40:40 +0200 Subject: Re: svn commit: r301944 - head/share/zoneinfo To: svn-src-all@freebsd.org References: <201606160300.u5G30AQ8042969@repo.freebsd.org> From: Stefan Esser Message-ID: Date: Thu, 16 Jun 2016 09:40:32 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <201606160300.u5G30AQ8042969@repo.freebsd.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-ID: TEQcxUZVoh1ouvJW-EJfgC3fpFtoBLYQr7JjamnXnCk9bAuFPYv+PYlHtfyM2qWZtp X-TOI-MSGID: 46e23570-0758-4879-a668-8b7c9e5cbcb7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 07:47:23 -0000 Am 16.06.2016 um 05:00 schrieb Glen Barber: > Author: gjb > Date: Thu Jun 16 03:00:10 2016 > New Revision: 301944 > URL: https://svnweb.freebsd.org/changeset/base/301944 > > Log: > Fix zoneinfo file packaging. > > This change fixes 468 of 488 zoneinfo file packaging issues, > the rest still to be investigated. > > Approved by: re (blanket, pkgbase) > Sponsored by: The FreeBSD Foundation > > Modified: > head/share/zoneinfo/Makefile > > Modified: head/share/zoneinfo/Makefile > ============================================================================== > --- head/share/zoneinfo/Makefile Thu Jun 16 02:48:18 2016 (r301943) > +++ head/share/zoneinfo/Makefile Thu Jun 16 03:00:10 2016 (r301944) > @@ -82,10 +82,10 @@ zoneinfo: yearistype ${TDATA} > beforeinstall: install-zoneinfo > install-zoneinfo: > cd ${TZBUILDDIR} && \ > - find -s * -type f -print -exec ${INSTALL} \ > + find -s * -type f -print -exec ${INSTALL} -T ${TAGS} \ > -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ > \{} ${DESTDIR}/usr/share/zoneinfo/\{} \; > - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ > + ${INSTALL} -T ${TAGS} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ > ${CONTRIBDIR}/zone.tab ${DESTDIR}/usr/share/zoneinfo/ This change breaks installworld for me. ${TAGS} is empty and makes ${INSTALL} fail: ===> share/zoneinfo (install) cd /usr/obj/usr/svn/base/head/share/zoneinfo/builddir && find -s * -type f -print -exec install -T -o root -g wheel -m 444 \{} //usr/share/zoneinfo/\{} \; Africa/Abidjan install: target `//usr/share/zoneinfo/Africa/Abidjan' is not a directory usage: install [-bCcpSsUv] [-f flags] [-g group] [-m mode] [-o owner] [-M log] [-D dest] [-h hash] [-T tags] [-B suffix] [-l linkflags] [-N dbdir] file1 file2 install [-bCcpSsUv] [-f flags] [-g group] [-m mode] [-o owner] [-M log] [-D dest] [-h hash] [-T tags] [-B suffix] [-l linkflags] [-N dbdir] file1 ... fileN directory install -dU [-vU] [-g group] [-m mode] [-N dbdir] [-o owner] [-M log] [-D dest] [-h hash] [-T tags] directory ... ... A simple work-around might be double quotes around ${TAGS} which makes ${INSTALL} happy - it accepts the empty string as parameter for -T without complaints. Regards, STefan From owner-svn-src-all@freebsd.org Thu Jun 16 07:48:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54222A47461; Thu, 16 Jun 2016 07:48:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13C5F17B5; Thu, 16 Jun 2016 07:48:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5G7mMKf050588; Thu, 16 Jun 2016 07:48:22 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5G7mL0E050584; Thu, 16 Jun 2016 07:48:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201606160748.u5G7mL0E050584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 16 Jun 2016 07:48:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301956 - head/lib/libusb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 07:48:23 -0000 Author: hselasky Date: Thu Jun 16 07:48:21 2016 New Revision: 301956 URL: https://svnweb.freebsd.org/changeset/base/301956 Log: Implement libusb_get_version() and update libusb manual page. Approved by: re (glebius) Requested by: swills MFC after: 1 week Modified: head/lib/libusb/Makefile head/lib/libusb/libusb.3 head/lib/libusb/libusb.h head/lib/libusb/libusb10.c Modified: head/lib/libusb/Makefile ============================================================================== --- head/lib/libusb/Makefile Thu Jun 16 07:45:57 2016 (r301955) +++ head/lib/libusb/Makefile Thu Jun 16 07:48:21 2016 (r301956) @@ -65,6 +65,7 @@ CFLAGS+= -I ../../sys .endif # LibUSB v1.0 +MLINKS += libusb.3 libusb_get_version.3 MLINKS += libusb.3 libusb_init.3 MLINKS += libusb.3 libusb_exit.3 MLINKS += libusb.3 libusb_strerror.3 Modified: head/lib/libusb/libusb.3 ============================================================================== --- head/lib/libusb/libusb.3 Thu Jun 16 07:45:57 2016 (r301955) +++ head/lib/libusb/libusb.3 Thu Jun 16 07:48:21 2016 (r301956) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 5, 2014 +.Dd June 16, 2016 .Dt LIBUSB 3 .Os .Sh NAME @@ -43,6 +43,10 @@ The library contains interfaces for directly managing a usb device. The current implementation supports v1.0 of the libusb API. .Sh LIBRARY INITIALISATION AND DEINITIALISATION +.Ft "const struct libusb_version *" +.Fn libusb_get_version "void" +This function returns version information about LibUSB. +.Pp .Ft int .Fn libusb_init "libusb_context **ctx" This function initialises libusb. Modified: head/lib/libusb/libusb.h ============================================================================== --- head/lib/libusb/libusb.h Thu Jun 16 07:45:57 2016 (r301955) +++ head/lib/libusb/libusb.h Thu Jun 16 07:48:21 2016 (r301956) @@ -235,6 +235,15 @@ struct libusb_pollfd { short events; }; +struct libusb_version { + const uint16_t major; + const uint16_t minor; + const uint16_t micro; + const uint16_t nano; + const char *rc; + const char *describe; +}; + typedef struct libusb_context libusb_context; typedef struct libusb_device libusb_device; typedef struct libusb_device_handle libusb_device_handle; @@ -384,6 +393,7 @@ typedef struct libusb_transfer { /* Library initialisation */ void libusb_set_debug(libusb_context * ctx, int level); +const struct libusb_version *libusb_get_version(void); const char *libusb_strerror(int code); const char *libusb_error_name(int code); int libusb_init(libusb_context ** context); Modified: head/lib/libusb/libusb10.c ============================================================================== --- head/lib/libusb/libusb10.c Thu Jun 16 07:45:57 2016 (r301955) +++ head/lib/libusb/libusb10.c Thu Jun 16 07:48:21 2016 (r301956) @@ -69,6 +69,22 @@ static void libusb10_submit_transfer_sub /* Library initialisation / deinitialisation */ +static const struct libusb_version libusb_version = { + .major = 1, + .minor = 0, + .micro = 0, + .nano = 2016, + .rc = "", + .describe = "http://www.freebsd.org" +}; + +const struct libusb_version * +libusb_get_version(void) +{ + + return (&libusb_version); +} + void libusb_set_debug(libusb_context *ctx, int level) { From owner-svn-src-all@freebsd.org Thu Jun 16 11:51:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4D0DA706A4; Thu, 16 Jun 2016 11:51:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81BC21BFB; Thu, 16 Jun 2016 11:51:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5GBpKrO038940; Thu, 16 Jun 2016 11:51:20 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5GBpKJf038939; Thu, 16 Jun 2016 11:51:20 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201606161151.u5GBpKJf038939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 16 Jun 2016 11:51:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301957 - head/lib/libusb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 11:51:21 -0000 Author: hselasky Date: Thu Jun 16 11:51:20 2016 New Revision: 301957 URL: https://svnweb.freebsd.org/changeset/base/301957 Log: Define LIBUSB_API_VERSION. Approved by: re (kostikbel) Requested by: swills MFC after: 1 week Modified: head/lib/libusb/libusb.h Modified: head/lib/libusb/libusb.h ============================================================================== --- head/lib/libusb/libusb.h Thu Jun 16 07:48:21 2016 (r301956) +++ head/lib/libusb/libusb.h Thu Jun 16 11:51:20 2016 (r301957) @@ -33,6 +33,8 @@ #include #endif +#define LIBUSB_API_VERSION 0x01000102 + #define LIBUSB_CALL #ifdef __cplusplus From owner-svn-src-all@freebsd.org Thu Jun 16 11:55:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FB43A708A0; Thu, 16 Jun 2016 11:55:26 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2EE411A6; Thu, 16 Jun 2016 11:55:25 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5GBtPMm042474; Thu, 16 Jun 2016 11:55:25 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5GBtP5j042473; Thu, 16 Jun 2016 11:55:25 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201606161155.u5GBtP5j042473@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 16 Jun 2016 11:55:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301958 - head/share/zoneinfo X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 11:55:26 -0000 Author: gjb Date: Thu Jun 16 11:55:24 2016 New Revision: 301958 URL: https://svnweb.freebsd.org/changeset/base/301958 Log: Revert r301944, which apparently broke zoneinfo install during installworld (although I am not sure why). I'll revisit this change after I further understand the cause of the breakage. Thanks to our secret canary (dhw) for the report. Approved by: re (blanket, pkgbase) Sponsored by: The FreeBSD Foundation Modified: head/share/zoneinfo/Makefile Modified: head/share/zoneinfo/Makefile ============================================================================== --- head/share/zoneinfo/Makefile Thu Jun 16 11:51:20 2016 (r301957) +++ head/share/zoneinfo/Makefile Thu Jun 16 11:55:24 2016 (r301958) @@ -82,10 +82,10 @@ zoneinfo: yearistype ${TDATA} beforeinstall: install-zoneinfo install-zoneinfo: cd ${TZBUILDDIR} && \ - find -s * -type f -print -exec ${INSTALL} -T ${TAGS} \ + find -s * -type f -print -exec ${INSTALL} \ -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ \{} ${DESTDIR}/usr/share/zoneinfo/\{} \; - ${INSTALL} -T ${TAGS} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ + ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ ${CONTRIBDIR}/zone.tab ${DESTDIR}/usr/share/zoneinfo/ afterinstall: From owner-svn-src-all@freebsd.org Thu Jun 16 11:58:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0D8BA709DD; Thu, 16 Jun 2016 11:58:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C11BE13BE; Thu, 16 Jun 2016 11:58:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5GBwkM6042633; Thu, 16 Jun 2016 11:58:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5GBwkd1042632; Thu, 16 Jun 2016 11:58:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606161158.u5GBwkd1042632@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 16 Jun 2016 11:58:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301959 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 11:58:48 -0000 Author: kib Date: Thu Jun 16 11:58:46 2016 New Revision: 301959 URL: https://svnweb.freebsd.org/changeset/base/301959 Log: Remove code duplication. Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (hrs) X-Differential revision: https://reviews.freebsd.org/D6731 Modified: head/sys/kern/kern_thread.c Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Thu Jun 16 11:55:24 2016 (r301958) +++ head/sys/kern/kern_thread.c Thu Jun 16 11:58:46 2016 (r301959) @@ -669,11 +669,6 @@ weed_inhib(int mode, struct thread *td2, wakeup_swapper |= sleepq_abort(td2, EINTR); break; case SINGLE_BOUNDARY: - if (TD_IS_SUSPENDED(td2) && (td2->td_flags & TDF_BOUNDARY) == 0) - wakeup_swapper |= thread_unsuspend_one(td2, p, false); - if (TD_ON_SLEEPQ(td2) && (td2->td_flags & TDF_SINTR) != 0) - wakeup_swapper |= sleepq_abort(td2, ERESTART); - break; case SINGLE_NO_EXIT: if (TD_IS_SUSPENDED(td2) && (td2->td_flags & TDF_BOUNDARY) == 0) wakeup_swapper |= thread_unsuspend_one(td2, p, false); From owner-svn-src-all@freebsd.org Thu Jun 16 12:01:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCCE6A7123C; Thu, 16 Jun 2016 12:01:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A0161C68; Thu, 16 Jun 2016 12:01:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5GC1BOa045345; Thu, 16 Jun 2016 12:01:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5GC1Brq045344; Thu, 16 Jun 2016 12:01:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606161201.u5GC1Brq045344@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 16 Jun 2016 12:01:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301960 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 12:01:12 -0000 Author: kib Date: Thu Jun 16 12:01:11 2016 New Revision: 301960 URL: https://svnweb.freebsd.org/changeset/base/301960 Log: Remove XXX comments from kern_thread.c. In one case, there is no reason for it in modern times. In the other case, expand the comment stating instead of doubting. Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (hrs) X-Differential revision: https://reviews.freebsd.org/D6731 Modified: head/sys/kern/kern_thread.c Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Thu Jun 16 11:58:46 2016 (r301959) +++ head/sys/kern/kern_thread.c Thu Jun 16 12:01:11 2016 (r301960) @@ -480,7 +480,7 @@ thread_exit(void) * architecture specific resources that * would not be on a new untouched process. */ - cpu_thread_exit(td); /* XXXSMP */ + cpu_thread_exit(td); /* * The last thread is left attached to the process @@ -907,8 +907,8 @@ thread_suspend_check(int return_instead) /* * The only suspension in action is a * single-threading. Single threader need not stop. - * XXX Should be safe to access unlocked - * as it can only be set to be true by us. + * It is safe to access p->p_singlethread unlocked + * because it can only be set to our address by us. */ if (p->p_singlethread == td) return (0); /* Exempt from stopping. */ From owner-svn-src-all@freebsd.org Thu Jun 16 12:05:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D833AA71626; Thu, 16 Jun 2016 12:05:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A55EE120A; Thu, 16 Jun 2016 12:05:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5GC5kqc046210; Thu, 16 Jun 2016 12:05:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5GC5jiG046192; Thu, 16 Jun 2016 12:05:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606161205.u5GC5jiG046192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 16 Jun 2016 12:05:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301961 - in head/sys: amd64/amd64 amd64/cloudabi64 arm/arm arm64/arm64 arm64/cloudabi64 compat/linux i386/i386 kern mips/mips powerpc/powerpc riscv/riscv sparc64/sparc64 sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 12:05:47 -0000 Author: kib Date: Thu Jun 16 12:05:44 2016 New Revision: 301961 URL: https://svnweb.freebsd.org/changeset/base/301961 Log: Update comments for the MD functions managing contexts for new threads, to make it less confusing and using modern kernel terms. Rename the functions to reflect current use of the functions, instead of the historic KSE conventions: cpu_set_fork_handler -> cpu_fork_kthread_handler (for kthreads) cpu_set_upcall -> cpu_copy_thread (for forks) cpu_set_upcall_kse -> cpu_set_upcall (for new threads creation) Reviewed by: jhb (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (hrs) Differential revision: https://reviews.freebsd.org/D6731 Modified: head/sys/amd64/amd64/vm_machdep.c head/sys/amd64/cloudabi64/cloudabi64_sysvec.c head/sys/arm/arm/swtch-v6.S head/sys/arm/arm/vm_machdep.c head/sys/arm64/arm64/vm_machdep.c head/sys/arm64/cloudabi64/cloudabi64_sysvec.c head/sys/compat/linux/linux_fork.c head/sys/i386/i386/vm_machdep.c head/sys/kern/init_main.c head/sys/kern/kern_fork.c head/sys/kern/kern_kthread.c head/sys/kern/kern_thr.c head/sys/mips/mips/vm_machdep.c head/sys/powerpc/powerpc/exec_machdep.c head/sys/powerpc/powerpc/vm_machdep.c head/sys/riscv/riscv/vm_machdep.c head/sys/sparc64/sparc64/vm_machdep.c head/sys/sys/proc.h Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Thu Jun 16 12:01:11 2016 (r301960) +++ head/sys/amd64/amd64/vm_machdep.c Thu Jun 16 12:05:44 2016 (r301961) @@ -285,10 +285,7 @@ cpu_fork(td1, p2, td2, flags) * This is needed to make kernel threads stay in kernel mode. */ void -cpu_set_fork_handler(td, func, arg) - struct thread *td; - void (*func)(void *); - void *arg; +cpu_fork_kthread_handler(struct thread *td, void (*func)(void *), void *arg) { /* * Note that the trap frame follows the args, so the function @@ -421,14 +418,14 @@ cpu_set_syscall_retval(struct thread *td } /* - * Initialize machine state (pcb and trap frame) for a new thread about to - * upcall. Put enough state in the new thread's PCB to get it to go back - * userret(), where we can intercept it again to set the return (upcall) - * Address and stack, along with those from upcals that are from other sources - * such as those generated in thread_userret() itself. + * Initialize machine state, mostly pcb and trap frame for a new + * thread, about to return to userspace. Put enough state in the new + * thread's PCB to get it to go back to the fork_return(), which + * finalizes the thread state and handles peculiarities of the first + * return to userspace for the new thread. */ void -cpu_set_upcall(struct thread *td, struct thread *td0) +cpu_copy_thread(struct thread *td, struct thread *td0) { struct pcb *pcb2; @@ -484,13 +481,12 @@ cpu_set_upcall(struct thread *td, struct } /* - * Set that machine state for performing an upcall that has to - * be done in thread_userret() so that those upcalls generated - * in thread_userret() itself can be done as well. + * Set that machine state for performing an upcall that starts + * the entry function with the given argument. */ void -cpu_set_upcall_kse(struct thread *td, void (*entry)(void *), void *arg, - stack_t *stack) +cpu_set_upcall(struct thread *td, void (*entry)(void *), void *arg, + stack_t *stack) { /* @@ -505,7 +501,7 @@ cpu_set_upcall_kse(struct thread *td, vo #ifdef COMPAT_FREEBSD32 if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { /* - * Set the trap frame to point at the beginning of the uts + * Set the trap frame to point at the beginning of the entry * function. */ td->td_frame->tf_rbp = 0; @@ -513,10 +509,7 @@ cpu_set_upcall_kse(struct thread *td, vo (((uintptr_t)stack->ss_sp + stack->ss_size - 4) & ~0x0f) - 4; td->td_frame->tf_rip = (uintptr_t)entry; - /* - * Pass the address of the mailbox for this kse to the uts - * function as a parameter on the stack. - */ + /* Pass the argument to the entry point. */ suword32((void *)(td->td_frame->tf_rsp + sizeof(int32_t)), (uint32_t)(uintptr_t)arg); @@ -539,10 +532,7 @@ cpu_set_upcall_kse(struct thread *td, vo td->td_frame->tf_gs = _ugssel; td->td_frame->tf_flags = TF_HASSEGS; - /* - * Pass the address of the mailbox for this kse to the uts - * function as a parameter on the stack. - */ + /* Pass the argument to the entry point. */ td->td_frame->tf_rdi = (register_t)arg; } Modified: head/sys/amd64/cloudabi64/cloudabi64_sysvec.c ============================================================================== --- head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Thu Jun 16 12:01:11 2016 (r301960) +++ head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Thu Jun 16 12:05:44 2016 (r301961) @@ -172,7 +172,7 @@ cloudabi64_thread_setregs(struct thread /* Perform standard register initialization. */ stack.ss_sp = (void *)attr->stack; stack.ss_size = tcbptr - attr->stack; - cpu_set_upcall_kse(td, (void *)attr->entry_point, NULL, &stack); + cpu_set_upcall(td, (void *)attr->entry_point, NULL, &stack); /* * Pass in the thread ID of the new thread and the argument Modified: head/sys/arm/arm/swtch-v6.S ============================================================================== --- head/sys/arm/arm/swtch-v6.S Thu Jun 16 12:01:11 2016 (r301960) +++ head/sys/arm/arm/swtch-v6.S Thu Jun 16 12:05:44 2016 (r301961) @@ -450,8 +450,8 @@ sw1: /* * Restore all saved registers and return. Note that some saved - * registers can be changed when either cpu_fork(), cpu_set_upcall(), - * cpu_set_fork_handler(), or makectx() was called. + * registers can be changed when either cpu_fork(), cpu_copy_thread(), + * cpu_fork_kthread_handler(), or makectx() was called. */ add r3, r7, #PCB_R4 ldmia r3, {r4-r12, sp, pc} Modified: head/sys/arm/arm/vm_machdep.c ============================================================================== --- head/sys/arm/arm/vm_machdep.c Thu Jun 16 12:01:11 2016 (r301960) +++ head/sys/arm/arm/vm_machdep.c Thu Jun 16 12:05:44 2016 (r301961) @@ -226,14 +226,14 @@ cpu_set_syscall_retval(struct thread *td } /* - * Initialize machine state (pcb and trap frame) for a new thread about to - * upcall. Put enough state in the new thread's PCB to get it to go back - * userret(), where we can intercept it again to set the return (upcall) - * Address and stack, along with those from upcals that are from other sources - * such as those generated in thread_userret() itself. + * Initialize machine state, mostly pcb and trap frame for a new + * thread, about to return to userspace. Put enough state in the new + * thread's PCB to get it to go back to the fork_return(), which + * finalizes the thread state and handles peculiarities of the first + * return to userspace for the new thread. */ void -cpu_set_upcall(struct thread *td, struct thread *td0) +cpu_copy_thread(struct thread *td, struct thread *td0) { bcopy(td0->td_frame, td->td_frame, sizeof(struct trapframe)); @@ -253,12 +253,11 @@ cpu_set_upcall(struct thread *td, struct } /* - * Set that machine state for performing an upcall that has to - * be done in thread_userret() so that those upcalls generated - * in thread_userret() itself can be done as well. + * Set that machine state for performing an upcall that starts + * the entry function with the given argument. */ void -cpu_set_upcall_kse(struct thread *td, void (*entry)(void *), void *arg, +cpu_set_upcall(struct thread *td, void (*entry)(void *), void *arg, stack_t *stack) { struct trapframe *tf = td->td_frame; @@ -327,7 +326,7 @@ cpu_thread_clean(struct thread *td) * This is needed to make kernel threads stay in kernel mode. */ void -cpu_set_fork_handler(struct thread *td, void (*func)(void *), void *arg) +cpu_fork_kthread_handler(struct thread *td, void (*func)(void *), void *arg) { td->td_pcb->pcb_regs.sf_r4 = (register_t)func; /* function */ td->td_pcb->pcb_regs.sf_r5 = (register_t)arg; /* first arg */ Modified: head/sys/arm64/arm64/vm_machdep.c ============================================================================== --- head/sys/arm64/arm64/vm_machdep.c Thu Jun 16 12:01:11 2016 (r301960) +++ head/sys/arm64/arm64/vm_machdep.c Thu Jun 16 12:05:44 2016 (r301961) @@ -153,14 +153,14 @@ cpu_set_syscall_retval(struct thread *td } /* - * Initialize machine state (pcb and trap frame) for a new thread about to - * upcall. Put enough state in the new thread's PCB to get it to go back - * userret(), where we can intercept it again to set the return (upcall) - * Address and stack, along with those from upcals that are from other sources - * such as those generated in thread_userret() itself. + * Initialize machine state, mostly pcb and trap frame for a new + * thread, about to return to userspace. Put enough state in the new + * thread's PCB to get it to go back to the fork_return(), which + * finalizes the thread state and handles peculiarities of the first + * return to userspace for the new thread. */ void -cpu_set_upcall(struct thread *td, struct thread *td0) +cpu_copy_thread(struct thread *td, struct thread *td0) { bcopy(td0->td_frame, td->td_frame, sizeof(struct trapframe)); bcopy(td0->td_pcb, td->td_pcb, sizeof(struct pcb)); @@ -177,12 +177,11 @@ cpu_set_upcall(struct thread *td, struct } /* - * Set that machine state for performing an upcall that has to - * be done in thread_userret() so that those upcalls generated - * in thread_userret() itself can be done as well. + * Set that machine state for performing an upcall that starts + * the entry function with the given argument. */ void -cpu_set_upcall_kse(struct thread *td, void (*entry)(void *), void *arg, +cpu_set_upcall(struct thread *td, void (*entry)(void *), void *arg, stack_t *stack) { struct trapframe *tf = td->td_frame; @@ -238,7 +237,7 @@ cpu_thread_clean(struct thread *td) * This is needed to make kernel threads stay in kernel mode. */ void -cpu_set_fork_handler(struct thread *td, void (*func)(void *), void *arg) +cpu_fork_kthread_handler(struct thread *td, void (*func)(void *), void *arg) { td->td_pcb->pcb_x[8] = (uintptr_t)func; Modified: head/sys/arm64/cloudabi64/cloudabi64_sysvec.c ============================================================================== --- head/sys/arm64/cloudabi64/cloudabi64_sysvec.c Thu Jun 16 12:01:11 2016 (r301960) +++ head/sys/arm64/cloudabi64/cloudabi64_sysvec.c Thu Jun 16 12:05:44 2016 (r301961) @@ -140,7 +140,7 @@ cloudabi64_thread_setregs(struct thread /* Perform standard register initialization. */ stack.ss_sp = (void *)attr->stack; stack.ss_size = attr->stack_size; - cpu_set_upcall_kse(td, (void *)attr->entry_point, NULL, &stack); + cpu_set_upcall(td, (void *)attr->entry_point, NULL, &stack); /* * Pass in the thread ID of the new thread and the argument Modified: head/sys/compat/linux/linux_fork.c ============================================================================== --- head/sys/compat/linux/linux_fork.c Thu Jun 16 12:01:11 2016 (r301960) +++ head/sys/compat/linux/linux_fork.c Thu Jun 16 12:05:44 2016 (r301961) @@ -299,8 +299,8 @@ linux_clone_thread(struct thread *td, st error = kern_thr_alloc(p, 0, &newtd); if (error) goto fail; - - cpu_set_upcall(newtd, td); + + cpu_copy_thread(newtd, td); bzero(&newtd->td_startzero, __rangeof(struct thread, td_startzero, td_endzero)); Modified: head/sys/i386/i386/vm_machdep.c ============================================================================== --- head/sys/i386/i386/vm_machdep.c Thu Jun 16 12:01:11 2016 (r301960) +++ head/sys/i386/i386/vm_machdep.c Thu Jun 16 12:05:44 2016 (r301961) @@ -324,10 +324,7 @@ cpu_fork(td1, p2, td2, flags) * This is needed to make kernel threads stay in kernel mode. */ void -cpu_set_fork_handler(td, func, arg) - struct thread *td; - void (*func)(void *); - void *arg; +cpu_fork_kthread_handler(struct thread *td, void (*func)(void *), void *arg) { /* * Note that the trap frame follows the args, so the function @@ -458,14 +455,14 @@ cpu_set_syscall_retval(struct thread *td } /* - * Initialize machine state (pcb and trap frame) for a new thread about to - * upcall. Put enough state in the new thread's PCB to get it to go back - * userret(), where we can intercept it again to set the return (upcall) - * Address and stack, along with those from upcals that are from other sources - * such as those generated in thread_userret() itself. + * Initialize machine state, mostly pcb and trap frame for a new + * thread, about to return to userspace. Put enough state in the new + * thread's PCB to get it to go back to the fork_return(), which + * finalizes the thread state and handles peculiarities of the first + * return to userspace for the new thread. */ void -cpu_set_upcall(struct thread *td, struct thread *td0) +cpu_copy_thread(struct thread *td, struct thread *td0) { struct pcb *pcb2; @@ -527,13 +524,12 @@ cpu_set_upcall(struct thread *td, struct } /* - * Set that machine state for performing an upcall that has to - * be done in thread_userret() so that those upcalls generated - * in thread_userret() itself can be done as well. + * Set that machine state for performing an upcall that starts + * the entry function with the given argument. */ void -cpu_set_upcall_kse(struct thread *td, void (*entry)(void *), void *arg, - stack_t *stack) +cpu_set_upcall(struct thread *td, void (*entry)(void *), void *arg, + stack_t *stack) { /* @@ -546,7 +542,7 @@ cpu_set_upcall_kse(struct thread *td, vo cpu_thread_clean(td); /* - * Set the trap frame to point at the beginning of the uts + * Set the trap frame to point at the beginning of the entry * function. */ td->td_frame->tf_ebp = 0; @@ -554,10 +550,7 @@ cpu_set_upcall_kse(struct thread *td, vo (((int)stack->ss_sp + stack->ss_size - 4) & ~0x0f) - 4; td->td_frame->tf_eip = (int)entry; - /* - * Pass the address of the mailbox for this kse to the uts - * function as a parameter on the stack. - */ + /* Pass the argument to the entry point. */ suword((void *)(td->td_frame->tf_esp + sizeof(void *)), (int)arg); } Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Thu Jun 16 12:01:11 2016 (r301960) +++ head/sys/kern/init_main.c Thu Jun 16 12:05:44 2016 (r301961) @@ -862,7 +862,8 @@ create_init(const void *udata __unused) PROC_UNLOCK(initproc); sx_xunlock(&proctree_lock); crfree(oldcred); - cpu_set_fork_handler(FIRST_THREAD_IN_PROC(initproc), start_init, NULL); + cpu_fork_kthread_handler(FIRST_THREAD_IN_PROC(initproc), + start_init, NULL); } SYSINIT(init, SI_SUB_CREATE_INIT, SI_ORDER_FIRST, create_init, NULL); Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Thu Jun 16 12:01:11 2016 (r301960) +++ head/sys/kern/kern_fork.c Thu Jun 16 12:05:44 2016 (r301961) @@ -1030,7 +1030,7 @@ fork_exit(void (*callout)(void *, struct thread_unlock(td); /* - * cpu_set_fork_handler intercepts this function call to + * cpu_fork_kthread_handler intercepts this function call to * have this call a non-return function to stay in kernel mode. * initproc has its own fork handler, but it does return. */ Modified: head/sys/kern/kern_kthread.c ============================================================================== --- head/sys/kern/kern_kthread.c Thu Jun 16 12:01:11 2016 (r301960) +++ head/sys/kern/kern_kthread.c Thu Jun 16 12:05:44 2016 (r301961) @@ -124,7 +124,7 @@ kproc_create(void (*func)(void *), void #endif /* call the processes' main()... */ - cpu_set_fork_handler(td, func, arg); + cpu_fork_kthread_handler(td, func, arg); /* Avoid inheriting affinity from a random parent. */ cpuset_setthread(td->td_tid, cpuset_root); @@ -281,14 +281,11 @@ kthread_add(void (*func)(void *), void * vsnprintf(newtd->td_name, sizeof(newtd->td_name), fmt, ap); va_end(ap); - newtd->td_proc = p; /* needed for cpu_set_upcall */ - - /* XXX optimise this probably? */ - /* On x86 (and probably the others too) it is way too full of junk */ - /* Needs a better name */ - cpu_set_upcall(newtd, oldtd); + newtd->td_proc = p; /* needed for cpu_copy_thread */ + /* might be further optimized for kthread */ + cpu_copy_thread(newtd, oldtd); /* put the designated function(arg) as the resume context */ - cpu_set_fork_handler(newtd, func, arg); + cpu_fork_kthread_handler(newtd, func, arg); newtd->td_pflags |= TDP_KTHREAD; thread_cow_get_proc(newtd, p); Modified: head/sys/kern/kern_thr.c ============================================================================== --- head/sys/kern/kern_thr.c Thu Jun 16 12:01:11 2016 (r301960) +++ head/sys/kern/kern_thr.c Thu Jun 16 12:05:44 2016 (r301961) @@ -163,7 +163,7 @@ thr_new_initthr(struct thread *td, void stack.ss_sp = param->stack_base; stack.ss_size = param->stack_size; /* Set upcall address to user thread entry function. */ - cpu_set_upcall_kse(td, param->start_func, param->arg, &stack); + cpu_set_upcall(td, param->start_func, param->arg, &stack); /* Setup user TLS address and TLS pointer register. */ return (cpu_set_user_tls(td, param->tls_base)); } @@ -227,7 +227,7 @@ thread_create(struct thread *td, struct if (error) goto fail; - cpu_set_upcall(newtd, td); + cpu_copy_thread(newtd, td); bzero(&newtd->td_startzero, __rangeof(struct thread, td_startzero, td_endzero)); Modified: head/sys/mips/mips/vm_machdep.c ============================================================================== --- head/sys/mips/mips/vm_machdep.c Thu Jun 16 12:01:11 2016 (r301960) +++ head/sys/mips/mips/vm_machdep.c Thu Jun 16 12:05:44 2016 (r301961) @@ -194,7 +194,7 @@ cpu_fork(register struct thread *td1,reg * This is needed to make kernel threads stay in kernel mode. */ void -cpu_set_fork_handler(struct thread *td, void (*func) __P((void *)), void *arg) +cpu_fork_kthread_handler(struct thread *td, void (*func)(void *), void *arg) { /* * Note that the trap frame follows the args, so the function @@ -352,14 +352,14 @@ cpu_set_syscall_retval(struct thread *td } /* - * Initialize machine state (pcb and trap frame) for a new thread about to - * upcall. Put enough state in the new thread's PCB to get it to go back - * userret(), where we can intercept it again to set the return (upcall) - * Address and stack, along with those from upcalls that are from other sources - * such as those generated in thread_userret() itself. + * Initialize machine state, mostly pcb and trap frame for a new + * thread, about to return to userspace. Put enough state in the new + * thread's PCB to get it to go back to the fork_return(), which + * finalizes the thread state and handles peculiarities of the first + * return to userspace for the new thread. */ void -cpu_set_upcall(struct thread *td, struct thread *td0) +cpu_copy_thread(struct thread *td, struct thread *td0) { struct pcb *pcb2; @@ -415,12 +415,11 @@ cpu_set_upcall(struct thread *td, struct } /* - * Set that machine state for performing an upcall that has to - * be done in thread_userret() so that those upcalls generated - * in thread_userret() itself can be done as well. + * Set that machine state for performing an upcall that starts + * the entry function with the given argument. */ void -cpu_set_upcall_kse(struct thread *td, void (*entry)(void *), void *arg, +cpu_set_upcall(struct thread *td, void (*entry)(void *), void *arg, stack_t *stack) { struct trapframe *tf; Modified: head/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/exec_machdep.c Thu Jun 16 12:01:11 2016 (r301960) +++ head/sys/powerpc/powerpc/exec_machdep.c Thu Jun 16 12:05:44 2016 (r301961) @@ -955,7 +955,7 @@ cpu_set_user_tls(struct thread *td, void } void -cpu_set_upcall(struct thread *td, struct thread *td0) +cpu_copy_thread(struct thread *td, struct thread *td0) { struct pcb *pcb2; struct trapframe *tf; @@ -996,8 +996,8 @@ cpu_set_upcall(struct thread *td, struct } void -cpu_set_upcall_kse(struct thread *td, void (*entry)(void *), void *arg, - stack_t *stack) +cpu_set_upcall(struct thread *td, void (*entry)(void *), void *arg, + stack_t *stack) { struct trapframe *tf; uintptr_t sp; Modified: head/sys/powerpc/powerpc/vm_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/vm_machdep.c Thu Jun 16 12:01:11 2016 (r301960) +++ head/sys/powerpc/powerpc/vm_machdep.c Thu Jun 16 12:05:44 2016 (r301961) @@ -179,7 +179,7 @@ cpu_fork(struct thread *td1, struct proc * This is needed to make kernel threads stay in kernel mode. */ void -cpu_set_fork_handler(struct thread *td, void (*func)(void *), void *arg) +cpu_fork_kthread_handler(struct thread *td, void (*func)(void *), void *arg) { struct callframe *cf; Modified: head/sys/riscv/riscv/vm_machdep.c ============================================================================== --- head/sys/riscv/riscv/vm_machdep.c Thu Jun 16 12:01:11 2016 (r301960) +++ head/sys/riscv/riscv/vm_machdep.c Thu Jun 16 12:05:44 2016 (r301961) @@ -146,14 +146,14 @@ cpu_set_syscall_retval(struct thread *td } /* - * Initialize machine state (pcb and trap frame) for a new thread about to - * upcall. Put enough state in the new thread's PCB to get it to go back - * userret(), where we can intercept it again to set the return (upcall) - * Address and stack, along with those from upcals that are from other sources - * such as those generated in thread_userret() itself. + * Initialize machine state, mostly pcb and trap frame for a new + * thread, about to return to userspace. Put enough state in the new + * thread's PCB to get it to go back to the fork_return(), which + * finalizes the thread state and handles peculiarities of the first + * return to userspace for the new thread. */ void -cpu_set_upcall(struct thread *td, struct thread *td0) +cpu_copy_thread(struct thread *td, struct thread *td0) { bcopy(td0->td_frame, td->td_frame, sizeof(struct trapframe)); @@ -170,12 +170,11 @@ cpu_set_upcall(struct thread *td, struct } /* - * Set that machine state for performing an upcall that has to - * be done in thread_userret() so that those upcalls generated - * in thread_userret() itself can be done as well. + * Set that machine state for performing an upcall that starts + * the entry function with the given argument. */ void -cpu_set_upcall_kse(struct thread *td, void (*entry)(void *), void *arg, +cpu_set_upcall(struct thread *td, void (*entry)(void *), void *arg, stack_t *stack) { struct trapframe *tf = td->td_frame; @@ -231,7 +230,7 @@ cpu_thread_clean(struct thread *td) * This is needed to make kernel threads stay in kernel mode. */ void -cpu_set_fork_handler(struct thread *td, void (*func)(void *), void *arg) +cpu_fork_kthread_handler(struct thread *td, void (*func)(void *), void *arg) { td->td_pcb->pcb_s[0] = (uintptr_t)func; Modified: head/sys/sparc64/sparc64/vm_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/vm_machdep.c Thu Jun 16 12:01:11 2016 (r301960) +++ head/sys/sparc64/sparc64/vm_machdep.c Thu Jun 16 12:05:44 2016 (r301961) @@ -174,7 +174,7 @@ cpu_set_syscall_retval(struct thread *td } void -cpu_set_upcall(struct thread *td, struct thread *td0) +cpu_copy_thread(struct thread *td, struct thread *td0) { struct trapframe *tf; struct frame *fr; @@ -197,7 +197,7 @@ cpu_set_upcall(struct thread *td, struct } void -cpu_set_upcall_kse(struct thread *td, void (*entry)(void *), void *arg, +cpu_set_upcall(struct thread *td, void (*entry)(void *), void *arg, stack_t *stack) { struct trapframe *tf; @@ -360,7 +360,7 @@ cpu_reset(void) * This is needed to make kernel threads stay in kernel mode. */ void -cpu_set_fork_handler(struct thread *td, void (*func)(void *), void *arg) +cpu_fork_kthread_handler(struct thread *td, void (*func)(void *), void *arg) { struct frame *fp; struct pcb *pcb; Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Thu Jun 16 12:01:11 2016 (r301960) +++ head/sys/sys/proc.h Thu Jun 16 12:05:44 2016 (r301961) @@ -1005,12 +1005,12 @@ void userret(struct thread *, struct tra void cpu_exit(struct thread *); void exit1(struct thread *, int, int) __dead2; +void cpu_copy_thread(struct thread *td, struct thread *td0); int cpu_fetch_syscall_args(struct thread *td, struct syscall_args *sa); void cpu_fork(struct thread *, struct proc *, struct thread *, int); -void cpu_set_fork_handler(struct thread *, void (*)(void *), void *); +void cpu_fork_kthread_handler(struct thread *, void (*)(void *), void *); void cpu_set_syscall_retval(struct thread *, int); -void cpu_set_upcall(struct thread *td, struct thread *td0); -void cpu_set_upcall_kse(struct thread *, void (*)(void *), void *, +void cpu_set_upcall(struct thread *, void (*)(void *), void *, stack_t *); int cpu_set_user_tls(struct thread *, void *tls_base); void cpu_thread_alloc(struct thread *); From owner-svn-src-all@freebsd.org Thu Jun 16 12:07:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81403A71714; Thu, 16 Jun 2016 12:07:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5DAFA14DD; Thu, 16 Jun 2016 12:07:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5GC7eRv046480; Thu, 16 Jun 2016 12:07:40 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5GC7ewk046479; Thu, 16 Jun 2016 12:07:40 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606161207.u5GC7ewk046479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 16 Jun 2016 12:07:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301962 - head/sys/dev/cpuctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 12:07:41 -0000 Author: kib Date: Thu Jun 16 12:07:40 2016 New Revision: 301962 URL: https://svnweb.freebsd.org/changeset/base/301962 Log: Always allow loading of cpuctl(4). When a CPU feature is not supported, e.g. CPUID or MSR, return ENODEV from the ioctl which needs that feature. Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (hrs) Modified: head/sys/dev/cpuctl/cpuctl.c Modified: head/sys/dev/cpuctl/cpuctl.c ============================================================================== --- head/sys/dev/cpuctl/cpuctl.c Thu Jun 16 12:05:44 2016 (r301961) +++ head/sys/dev/cpuctl/cpuctl.c Thu Jun 16 12:07:40 2016 (r301962) @@ -67,9 +67,9 @@ static d_ioctl_t cpuctl_ioctl; static int cpuctl_do_msr(int cpu, cpuctl_msr_args_t *data, u_long cmd, struct thread *td); -static void cpuctl_do_cpuid(int cpu, cpuctl_cpuid_args_t *data, +static int cpuctl_do_cpuid(int cpu, cpuctl_cpuid_args_t *data, struct thread *td); -static void cpuctl_do_cpuid_count(int cpu, cpuctl_cpuid_count_args_t *data, +static int cpuctl_do_cpuid_count(int cpu, cpuctl_cpuid_count_args_t *data, struct thread *td); static int cpuctl_do_update(int cpu, cpuctl_update_args_t *data, struct thread *td); @@ -171,8 +171,7 @@ cpuctl_ioctl(struct cdev *dev, u_long cm ret = cpuctl_do_msr(cpu, (cpuctl_msr_args_t *)data, cmd, td); break; case CPUCTL_CPUID: - cpuctl_do_cpuid(cpu, (cpuctl_cpuid_args_t *)data, td); - ret = 0; + ret = cpuctl_do_cpuid(cpu, (cpuctl_cpuid_args_t *)data, td); break; case CPUCTL_UPDATE: ret = priv_check(td, PRIV_CPUCTL_UPDATE); @@ -181,9 +180,8 @@ cpuctl_ioctl(struct cdev *dev, u_long cm ret = cpuctl_do_update(cpu, (cpuctl_update_args_t *)data, td); break; case CPUCTL_CPUID_COUNT: - cpuctl_do_cpuid_count(cpu, (cpuctl_cpuid_count_args_t *)data, - td); - ret = 0; + ret = cpuctl_do_cpuid_count(cpu, + (cpuctl_cpuid_count_args_t *)data, td); break; default: ret = EINVAL; @@ -196,7 +194,7 @@ fail: /* * Actually perform cpuid operation. */ -static void +static int cpuctl_do_cpuid_count(int cpu, cpuctl_cpuid_count_args_t *data, struct thread *td) { @@ -210,23 +208,30 @@ cpuctl_do_cpuid_count(int cpu, cpuctl_cp bzero(data->data, sizeof(data->data)); DPRINTF("[cpuctl,%d]: retrieving cpuid lev %#0x type %#0x for %d cpu\n", __LINE__, data->level, data->level_type, cpu); +#ifdef __i386__ + if (cpu_id == 0) + return (ENODEV); +#endif oldcpu = td->td_oncpu; is_bound = cpu_sched_is_bound(td); set_cpu(cpu, td); cpuid_count(data->level, data->level_type, data->data); restore_cpu(oldcpu, is_bound, td); + return (0); } -static void +static int cpuctl_do_cpuid(int cpu, cpuctl_cpuid_args_t *data, struct thread *td) { cpuctl_cpuid_count_args_t cdata; + int error; cdata.level = data->level; /* Override the level type. */ cdata.level_type = 0; - cpuctl_do_cpuid_count(cpu, &cdata, td); + error = cpuctl_do_cpuid_count(cpu, &cdata, td); bcopy(cdata.data, data->data, sizeof(data->data)); /* Ignore error */ + return (error); } /* @@ -249,6 +254,10 @@ cpuctl_do_msr(int cpu, cpuctl_msr_args_t */ DPRINTF("[cpuctl,%d]: operating on MSR %#0x for %d cpu\n", __LINE__, data->msr, cpu); +#ifdef __i386__ + if ((cpu_feature & CPUID_MSR) == 0) + return (ENODEV); +#endif oldcpu = td->td_oncpu; is_bound = cpu_sched_is_bound(td); set_cpu(cpu, td); @@ -291,7 +300,9 @@ cpuctl_do_update(int cpu, cpuctl_update_ ("[cpuctl,%d]: bad cpu number %d", __LINE__, cpu)); DPRINTF("[cpuctl,%d]: XXX %d", __LINE__, cpu); - cpuctl_do_cpuid(cpu, &args, td); + ret = cpuctl_do_cpuid(cpu, &args, td); + if (ret != 0) + return (ret); ((uint32_t *)vendor)[0] = args.data[1]; ((uint32_t *)vendor)[1] = args.data[3]; ((uint32_t *)vendor)[2] = args.data[2]; @@ -518,11 +529,6 @@ cpuctl_modevent(module_t mod __unused, i switch(type) { case MOD_LOAD: - if ((cpu_feature & CPUID_MSR) == 0) { - if (bootverbose) - printf("cpuctl: not available.\n"); - return (ENODEV); - } if (bootverbose) printf("cpuctl: access to MSR registers/cpuid info.\n"); cpuctl_devs = malloc(sizeof(*cpuctl_devs) * mp_ncpus, M_CPUCTL, From owner-svn-src-all@freebsd.org Thu Jun 16 12:08:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F9D4A71776; Thu, 16 Jun 2016 12:08:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70F22175F; Thu, 16 Jun 2016 12:08:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5GC8PlJ046556; Thu, 16 Jun 2016 12:08:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5GC8P8h046555; Thu, 16 Jun 2016 12:08:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606161208.u5GC8P8h046555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 16 Jun 2016 12:08:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301963 - head/usr.sbin/cpucontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 12:08:26 -0000 Author: kib Date: Thu Jun 16 12:08:25 2016 New Revision: 301963 URL: https://svnweb.freebsd.org/changeset/base/301963 Log: Return usual error indicator to shell. Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (hrs) Modified: head/usr.sbin/cpucontrol/cpucontrol.c Modified: head/usr.sbin/cpucontrol/cpucontrol.c ============================================================================== --- head/usr.sbin/cpucontrol/cpucontrol.c Thu Jun 16 12:07:40 2016 (r301962) +++ head/usr.sbin/cpucontrol/cpucontrol.c Thu Jun 16 12:08:25 2016 (r301963) @@ -481,5 +481,5 @@ main(int argc, char *argv[]) usage(); /* Only one command can be selected. */ } SLIST_FREE(&datadirs, next, free); - return (error); + return (error == 0 ? 0 : 1); } From owner-svn-src-all@freebsd.org Thu Jun 16 12:14:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF164A71A01; Thu, 16 Jun 2016 12:14:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9518F1C97; Thu, 16 Jun 2016 12:14:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5GCEJap050034; Thu, 16 Jun 2016 12:14:19 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5GCEJuP050031; Thu, 16 Jun 2016 12:14:19 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201606161214.u5GCEJuP050031@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 16 Jun 2016 12:14:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301964 - head/lib/libusb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 12:14:21 -0000 Author: hselasky Date: Thu Jun 16 12:14:19 2016 New Revision: 301964 URL: https://svnweb.freebsd.org/changeset/base/301964 Log: Add support for libusb_get_port_number() to the LibUSB v1.0 API. Approved by: re (kostikbel) Requested by: swills MFC after: 1 week Modified: head/lib/libusb/libusb.3 head/lib/libusb/libusb.h head/lib/libusb/libusb10.c Modified: head/lib/libusb/libusb.3 ============================================================================== --- head/lib/libusb/libusb.3 Thu Jun 16 12:08:25 2016 (r301963) +++ head/lib/libusb/libusb.3 Thu Jun 16 12:14:19 2016 (r301964) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 16, 2016 +.Dd June 17, 2016 .Dt LIBUSB 3 .Os .Sh NAME @@ -106,6 +106,12 @@ counter decremented once. Returns the number of the bus contained by the device .Fa dev . .Pp +.Ft uint8_t +.Fn libusb_get_port_number "libusb_device *dev" +Returns the port number which the device given by +.Fa dev +is attached to. +.Pp .Ft int .Fn libusb_get_port_numbers "libusb_device *dev" "uint8_t *buf" "uint8_t bufsize" Stores, in the buffer Modified: head/lib/libusb/libusb.h ============================================================================== --- head/lib/libusb/libusb.h Thu Jun 16 12:08:25 2016 (r301963) +++ head/lib/libusb/libusb.h Thu Jun 16 12:14:19 2016 (r301964) @@ -406,6 +406,7 @@ void libusb_exit(struct libusb_context * ssize_t libusb_get_device_list(libusb_context * ctx, libusb_device *** list); void libusb_free_device_list(libusb_device ** list, int unref_devices); uint8_t libusb_get_bus_number(libusb_device * dev); +uint8_t libusb_get_port_number(libusb_device * dev); int libusb_get_port_numbers(libusb_device *dev, uint8_t *buf, uint8_t bufsize); int libusb_get_port_path(libusb_context *ctx, libusb_device *dev, uint8_t *buf, uint8_t bufsize); uint8_t libusb_get_device_address(libusb_device * dev); Modified: head/lib/libusb/libusb10.c ============================================================================== --- head/lib/libusb/libusb10.c Thu Jun 16 12:08:25 2016 (r301963) +++ head/lib/libusb/libusb10.c Thu Jun 16 12:14:19 2016 (r301964) @@ -308,6 +308,14 @@ libusb_get_bus_number(libusb_device *dev return (libusb20_dev_get_bus_number(dev->os_priv)); } +uint8_t +libusb_get_port_number(libusb_device *dev) +{ + if (dev == NULL) + return (0); /* should not happen */ + return (libusb20_dev_get_parent_port(dev->os_priv)); +} + int libusb_get_port_numbers(libusb_device *dev, uint8_t *buf, uint8_t bufsize) { From owner-svn-src-all@freebsd.org Thu Jun 16 13:34:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36B3FA47401; Thu, 16 Jun 2016 13:34:22 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 065D41F9F; Thu, 16 Jun 2016 13:34:21 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5GDYLbM081310; Thu, 16 Jun 2016 13:34:21 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5GDYLrY081309; Thu, 16 Jun 2016 13:34:21 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201606161334.u5GDYLrY081309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 16 Jun 2016 13:34:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301965 - head/share/zoneinfo X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 13:34:22 -0000 Author: gjb Date: Thu Jun 16 13:34:20 2016 New Revision: 301965 URL: https://svnweb.freebsd.org/changeset/base/301965 Log: Reimplement r301944 using the correct install(1) invocation, which again fixes packaging tzdata/zoneinfo. Thank you to hrs for the pointer on what I did incorrectly. Approved by: re (blanket, pkgbase) Sponsored by: The FreeBSD Foundation Modified: head/share/zoneinfo/Makefile Modified: head/share/zoneinfo/Makefile ============================================================================== --- head/share/zoneinfo/Makefile Thu Jun 16 12:14:19 2016 (r301964) +++ head/share/zoneinfo/Makefile Thu Jun 16 13:34:20 2016 (r301965) @@ -82,10 +82,10 @@ zoneinfo: yearistype ${TDATA} beforeinstall: install-zoneinfo install-zoneinfo: cd ${TZBUILDDIR} && \ - find -s * -type f -print -exec ${INSTALL} \ + find -s * -type f -print -exec ${INSTALL} ${TAG_ARGS} \ -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ \{} ${DESTDIR}/usr/share/zoneinfo/\{} \; - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ + ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ ${CONTRIBDIR}/zone.tab ${DESTDIR}/usr/share/zoneinfo/ afterinstall: From owner-svn-src-all@freebsd.org Thu Jun 16 14:26:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97BBEA47E3C; Thu, 16 Jun 2016 14:26:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59B0A18F0; Thu, 16 Jun 2016 14:26:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5GEQ58A099500; Thu, 16 Jun 2016 14:26:05 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5GEQ5Cr099493; Thu, 16 Jun 2016 14:26:05 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201606161426.u5GEQ5Cr099493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 16 Jun 2016 14:26:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301966 - head/lib/libusb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 14:26:06 -0000 Author: hselasky Date: Thu Jun 16 14:26:04 2016 New Revision: 301966 URL: https://svnweb.freebsd.org/changeset/base/301966 Log: Add support for libusb_set_auto_detach_kernel_driver() to the LibUSB v1.0 API. Approved by: re (kostikbel) Requested by: swills MFC after: 1 week Modified: head/lib/libusb/Makefile head/lib/libusb/libusb.3 head/lib/libusb/libusb.h head/lib/libusb/libusb10.c head/lib/libusb/libusb20.c head/lib/libusb/libusb20_int.h Modified: head/lib/libusb/Makefile ============================================================================== --- head/lib/libusb/Makefile Thu Jun 16 13:34:20 2016 (r301965) +++ head/lib/libusb/Makefile Thu Jun 16 14:26:04 2016 (r301966) @@ -74,6 +74,7 @@ MLINKS += libusb.3 libusb_set_debug.3 MLINKS += libusb.3 libusb_get_device_list.3 MLINKS += libusb.3 libusb_free_device_list.3 MLINKS += libusb.3 libusb_get_bus_number.3 +MLINKS += libusb.3 libusb_get_port_number.3 MLINKS += libusb.3 libusb_get_device_address.3 MLINKS += libusb.3 libusb_get_device_speed.3 MLINKS += libusb.3 libusb_get_max_packet_size.3 @@ -98,6 +99,7 @@ MLINKS += libusb.3 libusb_get_driver_np. MLINKS += libusb.3 libusb_detach_kernel_driver.3 MLINKS += libusb.3 libusb_detach_kernel_driver_np.3 MLINKS += libusb.3 libusb_attach_kernel_driver.3 +MLINKS += libusb.3 libusb_set_auto_detach_kernel_driver.3 MLINKS += libusb.3 libusb_get_device_descriptor.3 MLINKS += libusb.3 libusb_get_active_config_descriptor.3 MLINKS += libusb.3 libusb_get_config_descriptor.3 Modified: head/lib/libusb/libusb.3 ============================================================================== --- head/lib/libusb/libusb.3 Thu Jun 16 13:34:20 2016 (r301965) +++ head/lib/libusb/libusb.3 Thu Jun 16 14:26:04 2016 (r301966) @@ -298,6 +298,18 @@ LIBUSB_ERROR_NO_DEVICE if the device has been disconnected, LIBUSB_ERROR_BUSY if the driver cannot be attached because the interface is claimed by a program or driver and a LIBUSB_ERROR code on failure. +.Pp +.Ft int +.Fn libusb_set_auto_detach_kernel_driver "libusb_device_handle *devh" "int enable" +This function enables automatic kernel interface driver detach when an +interface is claimed. +When the interface is restored the kernel driver is allowed to be re-attached. +If the +.Fa enable +argument is non-zero the feature is enabled. +Else disabled. +Returns 0 on success and a LIBUSB_ERROR code on +failure. .Sh USB DESCRIPTORS .Ft int .Fn libusb_get_device_descriptor "libusb_device *dev" "libusb_device_descriptor *desc" Modified: head/lib/libusb/libusb.h ============================================================================== --- head/lib/libusb/libusb.h Thu Jun 16 13:34:20 2016 (r301965) +++ head/lib/libusb/libusb.h Thu Jun 16 14:26:04 2016 (r301966) @@ -432,6 +432,7 @@ int libusb_get_driver(libusb_device_hand int libusb_detach_kernel_driver_np(libusb_device_handle * devh, int interface); int libusb_detach_kernel_driver(libusb_device_handle * devh, int interface); int libusb_attach_kernel_driver(libusb_device_handle * devh, int interface); +int libusb_set_auto_detach_kernel_driver(libusb_device_handle *dev, int enable); int libusb_set_interface_alt_setting(libusb_device_handle * devh, int interface_number, int alternate_setting); /* USB Descriptors */ Modified: head/lib/libusb/libusb10.c ============================================================================== --- head/lib/libusb/libusb10.c Thu Jun 16 13:34:20 2016 (r301965) +++ head/lib/libusb/libusb10.c Thu Jun 16 14:26:04 2016 (r301966) @@ -637,6 +637,7 @@ int libusb_claim_interface(struct libusb20_device *pdev, int interface_number) { libusb_device *dev; + int err = 0; dev = libusb_get_device(pdev); if (dev == NULL) @@ -645,11 +646,17 @@ libusb_claim_interface(struct libusb20_d if (interface_number < 0 || interface_number > 31) return (LIBUSB_ERROR_INVALID_PARAM); + if (pdev->auto_detach != 0) { + err = libusb_detach_kernel_driver(pdev, interface_number); + if (err != 0) + goto done; + } + CTX_LOCK(dev->ctx); dev->claimed_interfaces |= (1 << interface_number); CTX_UNLOCK(dev->ctx); - - return (0); +done: + return (err); } int @@ -665,13 +672,19 @@ libusb_release_interface(struct libusb20 if (interface_number < 0 || interface_number > 31) return (LIBUSB_ERROR_INVALID_PARAM); + if (pdev->auto_detach != 0) { + err = libusb_attach_kernel_driver(pdev, interface_number); + if (err != 0) + goto done; + } + CTX_LOCK(dev->ctx); if (!(dev->claimed_interfaces & (1 << interface_number))) err = LIBUSB_ERROR_NOT_FOUND; - - if (!err) + else dev->claimed_interfaces &= ~(1 << interface_number); CTX_UNLOCK(dev->ctx); +done: return (err); } @@ -873,6 +886,12 @@ libusb_attach_kernel_driver(struct libus return (0); } +int +libusb_set_auto_detach_kernel_driver(libusb_device_handle *dev, int enable) +{ + dev->auto_detach = (enable ? 1 : 0); +} + /* Asynchronous device I/O */ struct libusb_transfer * Modified: head/lib/libusb/libusb20.c ============================================================================== --- head/lib/libusb/libusb20.c Thu Jun 16 13:34:20 2016 (r301965) +++ head/lib/libusb/libusb20.c Thu Jun 16 14:26:04 2016 (r301966) @@ -601,6 +601,12 @@ libusb20_dev_close(struct libusb20_devic */ pdev->claimed_interface = 0; + /* + * The following variable is only used by the libusb v1.0 + * compat layer: + */ + pdev->auto_detach = 0; + return (error); } Modified: head/lib/libusb/libusb20_int.h ============================================================================== --- head/lib/libusb/libusb20_int.h Thu Jun 16 13:34:20 2016 (r301965) +++ head/lib/libusb/libusb20_int.h Thu Jun 16 14:26:04 2016 (r301966) @@ -213,6 +213,9 @@ struct libusb20_device { /* claimed interface */ uint8_t claimed_interface; + /* auto detach kernel driver */ + uint8_t auto_detach; + /* device file handle */ int file; From owner-svn-src-all@freebsd.org Thu Jun 16 15:25:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5A3FA72EB3; Thu, 16 Jun 2016 15:25:38 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 958E31CAF; Thu, 16 Jun 2016 15:25:38 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5GFPbAi021883; Thu, 16 Jun 2016 15:25:37 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5GFPbkl021882; Thu, 16 Jun 2016 15:25:37 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201606161525.u5GFPbkl021882@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 16 Jun 2016 15:25:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301967 - head/usr.sbin/rpcbind/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 15:25:38 -0000 Author: asomers Date: Thu Jun 16 15:25:37 2016 New Revision: 301967 URL: https://svnweb.freebsd.org/changeset/base/301967 Log: Fix usr.sbin/rpcbind ATF tests on 32-bit platforms usr.sbin/rpcbind/tests/addrmerge_test.c Fix some sizeof calculations that work only by luck on 64-bit platforms. PR: 210314 Reviewed by: ngie Approved by: re (kib) Reported by: Mark Millard MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D6855 Modified: head/usr.sbin/rpcbind/tests/addrmerge_test.c Modified: head/usr.sbin/rpcbind/tests/addrmerge_test.c ============================================================================== --- head/usr.sbin/rpcbind/tests/addrmerge_test.c Thu Jun 16 14:26:04 2016 (r301966) +++ head/usr.sbin/rpcbind/tests/addrmerge_test.c Thu Jun 16 15:25:37 2016 (r301967) @@ -92,15 +92,15 @@ mock_ifaddr4(const char* name, const cha in->sin_family = AF_INET; in->sin_port = 0; - in->sin_len = sizeof(in); + in->sin_len = sizeof(*in); in->sin_addr.s_addr = inet_addr(addr); mask_in->sin_family = AF_INET; mask_in->sin_port = 0; - mask_in->sin_len = sizeof(mask_in); + mask_in->sin_len = sizeof(*mask_in); mask_in->sin_addr.s_addr = inet_addr(mask); bcast_in->sin_family = AF_INET; bcast_in->sin_port = 0; - bcast_in->sin_len = sizeof(bcast_in); + bcast_in->sin_len = sizeof(*bcast_in); bcast_in->sin_addr.s_addr = inet_addr(bcast); *ifaddr = (struct ifaddrs) { .ifa_next = NULL, From owner-svn-src-all@freebsd.org Thu Jun 16 16:17:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BDFFA4721A; Thu, 16 Jun 2016 16:17:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54ED61479; Thu, 16 Jun 2016 16:17:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5GGHTHO040403; Thu, 16 Jun 2016 16:17:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5GGHTjV040397; Thu, 16 Jun 2016 16:17:29 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201606161617.u5GGHTjV040397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 16 Jun 2016 16:17:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301968 - head/lib/libusb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 16:17:30 -0000 Author: hselasky Date: Thu Jun 16 16:17:29 2016 New Revision: 301968 URL: https://svnweb.freebsd.org/changeset/base/301968 Log: Add multiple missing descriptor parsing functions to the LibUSB v1.0 API. Approved by: re (kib) Requested by: swills MFC after: 1 week Modified: head/lib/libusb/Makefile head/lib/libusb/libusb.3 head/lib/libusb/libusb.h head/lib/libusb/libusb10_desc.c Modified: head/lib/libusb/Makefile ============================================================================== --- head/lib/libusb/Makefile Thu Jun 16 15:25:37 2016 (r301967) +++ head/lib/libusb/Makefile Thu Jun 16 16:17:29 2016 (r301968) @@ -109,8 +109,16 @@ MLINKS += libusb.3 libusb_get_string_des MLINKS += libusb.3 libusb_get_string_descriptor_ascii.3 MLINKS += libusb.3 libusb_parse_ss_endpoint_comp.3 MLINKS += libusb.3 libusb_free_ss_endpoint_comp.3 +MLINKS += libusb.3 libusb_get_ss_endpoint_companion_descriptor.3 +MLINKS += libusb.3 libusb_free_ss_endpoint_companion_descriptor.3 MLINKS += libusb.3 libusb_parse_bos_descriptor.3 MLINKS += libusb.3 libusb_free_bos_descriptor.3 +MLINKS += libusb.3 libusb_get_usb_2_0_extension_descriptor.3 +MLINKS += libusb.3 libusb_free_usb_2_0_extension_descriptor.3 +MLINKS += libusb.3 libusb_get_ss_usb_device_capability_descriptor.3 +MLINKS += libusb.3 libusb_free_ss_usb_device_capability_descriptor.3 +MLINKS += libusb.3 libusb_get_container_id_descriptor.3 +MLINKS += libusb.3 libusb_free_container_id_descriptor.3 MLINKS += libusb.3 libusb_alloc_transfer.3 MLINKS += libusb.3 libusb_free_transfer.3 MLINKS += libusb.3 libusb_submit_transfer.3 Modified: head/lib/libusb/libusb.3 ============================================================================== --- head/lib/libusb/libusb.3 Thu Jun 16 15:25:37 2016 (r301967) +++ head/lib/libusb/libusb.3 Thu Jun 16 16:17:29 2016 (r301968) @@ -376,7 +376,31 @@ freed using the libusb_free_ss_endpoint_ .Pp .Ft void .Fn libusb_free_ss_endpoint_comp "libusb_ss_endpoint_companion_descriptor *ep_comp" -This function is NULL safe and frees a parsed USB 3.0 endpoint companion descriptor. +This function is NULL safe and frees a parsed USB 3.0 endpoint companion descriptor given by +.Fa ep_comp . +.Pp +.Ft int +.Fn libusb_get_ss_endpoint_companion_descriptor "struct libusb_context *ctx" "const struct libusb_endpoint_descriptor *endpoint" "struct libusb_ss_endpoint_companion_descriptor **ep_comp" +This function finds and parses the USB 3.0 endpoint companion descriptor given by +.Fa endpoint . +Returns zero on success and a LIBUSB_ERROR code on failure. +On success the parsed USB 3.0 endpoint companion descriptor must be +freed using the libusb_free_ss_endpoint_companion_descriptor function. +.Pp +.Ft void +.Fn libusb_free_ss_endpoint_companion_descriptor "struct libusb_ss_endpoint_companion_descriptor *ep_comp" +This function is NULL safe and frees a parsed USB 3.0 endpoint companion descriptor given by +.Fa ep_comp . +.Pp +.Ft int +.Fn libusb_get_bos_descriptor "libusb_device_handle *handle" "struct libusb_bos_descriptor **bos" +This function queries the USB device given by +.Fa handle +and stores a pointer to a parsed BOS descriptor into +.Fa bos . +Returns zero on success and a LIBUSB_ERROR code on failure. +On success the parsed BOS descriptor must be +freed using the libusb_free_bos_descriptor function. .Pp .Ft int .Fn libusb_parse_bos_descriptor "const void *buf" "int len" "libusb_bos_descriptor **bos" @@ -392,7 +416,53 @@ libusb_free_bos_descriptor function. .Pp .Ft void .Fn libusb_free_bos_descriptor "libusb_bos_descriptor *bos" -This function is NULL safe and frees a parsed BOS descriptor. +This function is NULL safe and frees a parsed BOS descriptor given by +.Fa bos . +.Pp +.Ft int +.Fn libusb_get_usb_2_0_extension_descriptor "struct libusb_context *ctx" "struct libusb_bos_dev_capability_descriptor *dev_cap" "struct libusb_usb_2_0_extension_descriptor **usb_2_0_extension" +This function parses the USB 2.0 extension descriptor from the descriptor given by +.Fa dev_cap +and stores a pointer to the parsed descriptor into +.Fa usb_2_0_extension . +Returns zero on success and a LIBUSB_ERROR code on failure. +On success the parsed USB 2.0 extension descriptor must be freed using the +libusb_free_usb_2_0_extension_descriptor function. +.Pp +.Ft void +.Fn libusb_free_usb_2_0_extension_descriptor "struct libusb_usb_2_0_extension_descriptor *usb_2_0_extension" +This function is NULL safe and frees a parsed USB 2.0 extension descriptor given by +.Fa usb_2_0_extension . +.Pp +.Ft int +.Fn libusb_get_ss_usb_device_capability_descriptor "struct libusb_context *ctx" "struct libusb_bos_dev_capability_descriptor *dev_cap" "struct libusb_ss_usb_device_capability_descriptor **ss_usb_device_capability" +This function parses the SuperSpeed device capability descriptor from the descriptor given by +.Fa dev_cap +and stores a pointer to the parsed descriptor into +.Fa ss_usb_device_capability . +Returns zero on success and a LIBUSB_ERROR code on failure. +On success the parsed SuperSpeed device capability descriptor must be freed using the +libusb_free_ss_usb_device_capability_descriptor function. +.Pp +.Ft void +.Fn libusb_free_ss_usb_device_capability_descriptor "struct libusb_ss_usb_device_capability_descriptor *ss_usb_device_capability" +This function is NULL safe and frees a parsed SuperSpeed device capability descriptor given by +.Fa ss_usb_device_capability . +.Pp +.Ft int +.Fn libusb_get_container_id_descriptor "struct libusb_context *ctx" "struct libusb_bos_dev_capability_descriptor *dev_cap" "struct libusb_container_id_descriptor **container_id" +This function parses the container ID descriptor from the descriptor given by +.Fa dev_cap +and stores a pointer to the parsed descriptor into +.Fa container_id . +Returns zero on success and a LIBUSB_ERROR code on failure. +On success the parsed container ID descriptor must be freed using the +libusb_free_container_id_descriptor function. +.Pp +.Ft void +.Fn libusb_free_container_id_descriptor "struct libusb_container_id_descriptor *container_id" +This function is NULL safe and frees a parsed container ID descriptor given by +.Fa container_id . .Sh USB ASYNCHRONOUS I/O .Ft struct libusb_transfer * .Fn libusb_alloc_transfer "int iso_packets" Modified: head/lib/libusb/libusb.h ============================================================================== --- head/lib/libusb/libusb.h Thu Jun 16 15:25:37 2016 (r301967) +++ head/lib/libusb/libusb.h Thu Jun 16 16:17:29 2016 (r301968) @@ -101,6 +101,10 @@ enum libusb_device_capability_type { #define LIBUSB_USB_2_0_EXTENSION_DEVICE_CAPABILITY_SIZE 7 #define LIBUSB_SS_USB_DEVICE_CAPABILITY_SIZE 10 +#define LIBUSB_BT_USB_2_0_EXTENSION_SIZE 7 +#define LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE 10 +#define LIBUSB_BT_CONTAINER_ID_SIZE 20 + #define LIBUSB_ENDPOINT_ADDRESS_MASK 0x0f #define LIBUSB_ENDPOINT_DIR_MASK 0x80 @@ -165,6 +169,13 @@ enum libusb_iso_usage_type { LIBUSB_ISO_USAGE_TYPE_IMPLICIT = 2, }; +enum libusb_bos_type { + LIBUSB_BT_WIRELESS_USB_DEVICE_CAPABILITY = 1, + LIBUSB_BT_USB_2_0_EXTENSION = 2, + LIBUSB_BT_SS_USB_DEVICE_CAPABILITY = 3, + LIBUSB_BT_CONTAINER_ID = 4, +}; + enum libusb_error { LIBUSB_SUCCESS = 0, LIBUSB_ERROR_IO = -1, @@ -349,6 +360,13 @@ typedef struct libusb_ss_usb_device_capa uint16_t wU2DevExitLat; } libusb_ss_usb_device_capability_descriptor __aligned(sizeof(void *)); +typedef struct libusb_bos_dev_capability_descriptor { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDevCapabilityType; + uint8_t dev_capability_data[0]; +} libusb_bos_dev_capability_descriptor __aligned(sizeof(void *)); + typedef struct libusb_bos_descriptor { uint8_t bLength; uint8_t bDescriptorType; @@ -358,6 +376,21 @@ typedef struct libusb_bos_descriptor { struct libusb_ss_usb_device_capability_descriptor *ss_usb_cap; } libusb_bos_descriptor __aligned(sizeof(void *)); +typedef struct libusb_usb_2_0_extension_descriptor { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDevCapabilityType; + uint32_t bmAttributes; +} libusb_usb_2_0_extension_descriptor __aligned(sizeof(void *)); + +typedef struct libusb_container_id_descriptor { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDevCapabilityType; + uint8_t bReserved; + uint8_t ContainerID[16]; +} libusb_container_id_descriptor __aligned(sizeof(void *)); + typedef struct libusb_control_setup { uint8_t bmRequestType; uint8_t bRequest; @@ -442,6 +475,8 @@ int libusb_get_active_config_descriptor( int libusb_get_config_descriptor(libusb_device * dev, uint8_t config_index, struct libusb_config_descriptor **config); int libusb_get_config_descriptor_by_value(libusb_device * dev, uint8_t bConfigurationValue, struct libusb_config_descriptor **config); void libusb_free_config_descriptor(struct libusb_config_descriptor *config); +int libusb_get_ss_endpoint_companion_descriptor(struct libusb_context *ctx, const struct libusb_endpoint_descriptor *endpoint, struct libusb_ss_endpoint_companion_descriptor **ep_comp); +void libusb_free_ss_endpoint_companion_descriptor(struct libusb_ss_endpoint_companion_descriptor *ep_comp); int libusb_get_string_descriptor(libusb_device_handle * devh, uint8_t desc_index, uint16_t langid, unsigned char *data, int length); int libusb_get_string_descriptor_ascii(libusb_device_handle * devh, uint8_t desc_index, uint8_t *data, int length); int libusb_get_descriptor(libusb_device_handle * devh, uint8_t desc_type, uint8_t desc_index, uint8_t *data, int length); @@ -449,6 +484,13 @@ int libusb_parse_ss_endpoint_comp(const void libusb_free_ss_endpoint_comp(struct libusb_ss_endpoint_companion_descriptor *ep_comp); int libusb_parse_bos_descriptor(const void *buf, int len, struct libusb_bos_descriptor **bos); void libusb_free_bos_descriptor(struct libusb_bos_descriptor *bos); +int libusb_get_bos_descriptor(libusb_device_handle *handle, struct libusb_bos_descriptor **bos); +int libusb_get_usb_2_0_extension_descriptor(struct libusb_context *ctx, struct libusb_bos_dev_capability_descriptor *dev_cap, struct libusb_usb_2_0_extension_descriptor **usb_2_0_extension); +void libusb_free_usb_2_0_extension_descriptor(struct libusb_usb_2_0_extension_descriptor *usb_2_0_extension); +int libusb_get_ss_usb_device_capability_descriptor(struct libusb_context *ctx, struct libusb_bos_dev_capability_descriptor *dev_cap, struct libusb_ss_usb_device_capability_descriptor **ss_usb_device_capability); +void libusb_free_ss_usb_device_capability_descriptor(struct libusb_ss_usb_device_capability_descriptor *ss_usb_device_capability); +int libusb_get_container_id_descriptor(struct libusb_context *ctx, struct libusb_bos_dev_capability_descriptor *dev_cap, struct libusb_container_id_descriptor **container_id); +void libusb_free_container_id_descriptor(struct libusb_container_id_descriptor *container_id); /* Asynchronous device I/O */ Modified: head/lib/libusb/libusb10_desc.c ============================================================================== --- head/lib/libusb/libusb10_desc.c Thu Jun 16 15:25:37 2016 (r301967) +++ head/lib/libusb/libusb10_desc.c Thu Jun 16 16:17:29 2016 (r301968) @@ -410,6 +410,23 @@ libusb_free_ss_endpoint_comp(struct libu } int +libusb_get_ss_endpoint_companion_descriptor(struct libusb_context *ctx, + const struct libusb_endpoint_descriptor *endpoint, + struct libusb_ss_endpoint_companion_descriptor **ep_comp) +{ + if (endpoint == NULL) + return (LIBUSB_ERROR_INVALID_PARAM); + return (libusb_parse_ss_endpoint_comp(endpoint->extra, endpoint->extra_length, ep_comp)); +} + +void +libusb_free_ss_endpoint_companion_descriptor(struct libusb_ss_endpoint_companion_descriptor *ep_comp) +{ + + libusb_free_ss_endpoint_comp(ep_comp); +} + +int libusb_parse_bos_descriptor(const void *buf, int len, struct libusb_bos_descriptor **bos) { @@ -520,3 +537,154 @@ libusb_free_bos_descriptor(struct libusb free(bos); } + +int +libusb_get_bos_descriptor(libusb_device_handle *handle, + struct libusb_bos_descriptor **bos) +{ + uint8_t bos_header[LIBUSB_DT_BOS_SIZE] = {0}; + uint16_t wTotalLength; + uint8_t *bos_data; + int err; + + err = libusb_get_descriptor(handle, LIBUSB_DT_BOS, 0, + bos_header, sizeof(bos_header)); + if (err < 0) + return (err); + + wTotalLength = bos_header[2] | (bos_header[3] << 8); + if (wTotalLength < LIBUSB_DT_BOS_SIZE) + return (LIBUSB_ERROR_INVALID_PARAM); + + bos_data = calloc(wTotalLength, 1); + if (bos_data == NULL) + return (LIBUSB_ERROR_NO_MEM); + + err = libusb_get_descriptor(handle, LIBUSB_DT_BOS, 0, + bos_data, wTotalLength); + if (err < 0) + goto done; + + /* avoid descriptor length mismatches */ + bos_data[2] = (wTotalLength & 0xFF); + bos_data[3] = (wTotalLength >> 8); + + err = libusb_parse_bos_descriptor(bos_data, wTotalLength, bos); +done: + free(bos_data); + return (err); +} + +int +libusb_get_usb_2_0_extension_descriptor(struct libusb_context *ctx, + struct libusb_bos_dev_capability_descriptor *dev_cap, + struct libusb_usb_2_0_extension_descriptor **usb_2_0_extension) +{ + struct libusb_usb_2_0_extension_descriptor *desc; + + if (dev_cap == NULL || usb_2_0_extension == NULL || + dev_cap->bDevCapabilityType != LIBUSB_BT_USB_2_0_EXTENSION) + return (LIBUSB_ERROR_INVALID_PARAM); + if (dev_cap->bLength < LIBUSB_BT_USB_2_0_EXTENSION_SIZE) + return (LIBUSB_ERROR_IO); + + desc = malloc(sizeof(*desc)); + if (desc == NULL) + return (LIBUSB_ERROR_NO_MEM); + + desc->bLength = LIBUSB_BT_USB_2_0_EXTENSION_SIZE; + desc->bDescriptorType = dev_cap->bDescriptorType; + desc->bDevCapabilityType = dev_cap->bDevCapabilityType; + desc->bmAttributes = + (dev_cap->dev_capability_data[0]) | + (dev_cap->dev_capability_data[1] << 8) | + (dev_cap->dev_capability_data[2] << 16) | + (dev_cap->dev_capability_data[3] << 24); + + *usb_2_0_extension = desc; + return (0); +} + +void +libusb_free_usb_2_0_extension_descriptor( + struct libusb_usb_2_0_extension_descriptor *usb_2_0_extension) +{ + + free(usb_2_0_extension); +} + +int +libusb_get_ss_usb_device_capability_descriptor(struct libusb_context *ctx, + struct libusb_bos_dev_capability_descriptor *dev_cap, + struct libusb_ss_usb_device_capability_descriptor **ss_usb_device_capability) +{ + struct libusb_ss_usb_device_capability_descriptor *desc; + + if (dev_cap == NULL || ss_usb_device_capability == NULL || + dev_cap->bDevCapabilityType != LIBUSB_BT_SS_USB_DEVICE_CAPABILITY) + return (LIBUSB_ERROR_INVALID_PARAM); + if (dev_cap->bLength < LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE) + return (LIBUSB_ERROR_IO); + + desc = malloc(sizeof(*desc)); + if (desc == NULL) + return (LIBUSB_ERROR_NO_MEM); + + desc->bLength = LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE; + desc->bDescriptorType = dev_cap->bDescriptorType; + desc->bDevCapabilityType = dev_cap->bDevCapabilityType; + desc->bmAttributes = dev_cap->dev_capability_data[0]; + desc->wSpeedSupported = dev_cap->dev_capability_data[1] | + (dev_cap->dev_capability_data[2] << 8); + desc->bFunctionalitySupport = dev_cap->dev_capability_data[3]; + desc->bU1DevExitLat = dev_cap->dev_capability_data[4]; + desc->wU2DevExitLat = dev_cap->dev_capability_data[5] | + (dev_cap->dev_capability_data[6] << 8); + + *ss_usb_device_capability = desc; + return (0); +} + +void +libusb_free_ss_usb_device_capability_descriptor( + struct libusb_ss_usb_device_capability_descriptor *ss_usb_device_capability) +{ + + free(ss_usb_device_capability); +} + +int +libusb_get_container_id_descriptor(struct libusb_context *ctx, + struct libusb_bos_dev_capability_descriptor *dev_cap, + struct libusb_container_id_descriptor **container_id) +{ + struct libusb_container_id_descriptor *desc; + + if (dev_cap == NULL || container_id == NULL || + dev_cap->bDevCapabilityType != LIBUSB_BT_CONTAINER_ID) + return (LIBUSB_ERROR_INVALID_PARAM); + if (dev_cap->bLength < LIBUSB_BT_CONTAINER_ID_SIZE) + return (LIBUSB_ERROR_IO); + + desc = malloc(sizeof(*desc)); + if (desc == NULL) + return (LIBUSB_ERROR_NO_MEM); + + desc->bLength = LIBUSB_BT_CONTAINER_ID_SIZE; + desc->bDescriptorType = dev_cap->bDescriptorType; + desc->bDevCapabilityType = dev_cap->bDevCapabilityType; + desc->bReserved = dev_cap->dev_capability_data[0]; + memcpy(desc->ContainerID, dev_cap->dev_capability_data + 1, + sizeof(desc->ContainerID)); + + *container_id = desc; + return (0); +} + +void +libusb_free_container_id_descriptor( + struct libusb_container_id_descriptor *container_id) +{ + + free(container_id); +} From owner-svn-src-all@freebsd.org Thu Jun 16 16:26:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1ED31A4771F; Thu, 16 Jun 2016 16:26:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E28F71D4F; Thu, 16 Jun 2016 16:26:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5GGQHNp044170; Thu, 16 Jun 2016 16:26:17 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5GGQHwW044169; Thu, 16 Jun 2016 16:26:17 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201606161626.u5GGQHwW044169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 16 Jun 2016 16:26:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301969 - head/lib/libusb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 16:26:18 -0000 Author: hselasky Date: Thu Jun 16 16:26:16 2016 New Revision: 301969 URL: https://svnweb.freebsd.org/changeset/base/301969 Log: Add missing return statement. Approved by: re (gjb) MFC after: 1 week Modified: head/lib/libusb/libusb10.c Modified: head/lib/libusb/libusb10.c ============================================================================== --- head/lib/libusb/libusb10.c Thu Jun 16 16:17:29 2016 (r301968) +++ head/lib/libusb/libusb10.c Thu Jun 16 16:26:16 2016 (r301969) @@ -890,6 +890,7 @@ int libusb_set_auto_detach_kernel_driver(libusb_device_handle *dev, int enable) { dev->auto_detach = (enable ? 1 : 0); + return (0); } /* Asynchronous device I/O */ From owner-svn-src-all@freebsd.org Thu Jun 16 17:40:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2B6CA76DE2; Thu, 16 Jun 2016 17:40:56 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f173.google.com (mail-io0-f173.google.com [209.85.223.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C7618195E; Thu, 16 Jun 2016 17:40:56 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f173.google.com with SMTP id f30so48605831ioj.2; Thu, 16 Jun 2016 10:40:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=WRb8/wLjfSKBM6KmB2+pzPxcVkcL29LbKAhTrC2tO5Q=; b=m1Na3i/KR+rI9AmGK53rusaGK9eF/uEKG9TqVgUl1qnpznQp46AavjXpxzygQxMmPD pQCn7iNtln5PhR9xFVJ4O2LS1lc4FUq41/fiOTbv1PfGFK3FhQ+lhElWR8BUiJ8iFd/k vQy6ZhFzyd1eZ8S/1Bfse1cOXLMuaJkLM+lm44dDT4A8rrtvbZXmDR6zsjg+ZcN6U/3Z nVS/VXXSiCzy4NY+mnPu5iKHv+A2jZ8/Miwdk7Z4ZInz0G+JZgbdmFyFJcOqpOawvzw2 3clIMoUi4mCjNtO9LsVpgN5QplS8dXb64ssyDQ0OzzYA4VSNZZs7SUCTYFnzSx5uwKp4 rbEg== X-Gm-Message-State: ALyK8tI9ilgSmcl9aiNM0AIPazDleu9u9ks2m1/9pPM8anmE/inadDHgV6lsThyJ+5DqPg== X-Received: by 10.107.180.68 with SMTP id d65mr5138195iof.151.1466097440059; Thu, 16 Jun 2016 10:17:20 -0700 (PDT) Received: from mail-io0-f169.google.com (mail-io0-f169.google.com. [209.85.223.169]) by smtp.gmail.com with ESMTPSA id q184sm2586568itc.17.2016.06.16.10.17.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Jun 2016 10:17:19 -0700 (PDT) Received: by mail-io0-f169.google.com with SMTP id 5so56420391ioy.1; Thu, 16 Jun 2016 10:17:19 -0700 (PDT) X-Received: by 10.107.46.158 with SMTP id u30mr9536067iou.162.1466097439420; Thu, 16 Jun 2016 10:17:19 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.36.205.70 with HTTP; Thu, 16 Jun 2016 10:17:19 -0700 (PDT) In-Reply-To: <201606161158.u5GBwkd1042632@repo.freebsd.org> References: <201606161158.u5GBwkd1042632@repo.freebsd.org> From: Conrad Meyer Date: Thu, 16 Jun 2016 10:17:19 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r301959 - head/sys/kern To: Konstantin Belousov Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 17:40:57 -0000 On Thu, Jun 16, 2016 at 4:58 AM, Konstantin Belousov wrote: > --- head/sys/kern/kern_thread.c Thu Jun 16 11:55:24 2016 (r301958) > +++ head/sys/kern/kern_thread.c Thu Jun 16 11:58:46 2016 (r301959) > @@ -669,11 +669,6 @@ weed_inhib(int mode, struct thread *td2, > wakeup_swapper |= sleepq_abort(td2, EINTR); > break; > case SINGLE_BOUNDARY: > - if (TD_IS_SUSPENDED(td2) && (td2->td_flags & TDF_BOUNDARY) == 0) > - wakeup_swapper |= thread_unsuspend_one(td2, p, false); > - if (TD_ON_SLEEPQ(td2) && (td2->td_flags & TDF_SINTR) != 0) > - wakeup_swapper |= sleepq_abort(td2, ERESTART); > - break; style(9) nit: /* FALLTHROUGH */ Best, Conrad > case SINGLE_NO_EXIT: > if (TD_IS_SUSPENDED(td2) && (td2->td_flags & TDF_BOUNDARY) == 0) > wakeup_swapper |= thread_unsuspend_one(td2, p, false); > From owner-svn-src-all@freebsd.org Thu Jun 16 17:43:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42087A76FAD; Thu, 16 Jun 2016 17:43:56 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x22a.google.com (mail-pf0-x22a.google.com [IPv6:2607:f8b0:400e:c00::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 133ED1E2C; Thu, 16 Jun 2016 17:43:56 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x22a.google.com with SMTP id c2so22057426pfa.2; Thu, 16 Jun 2016 10:43:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=hhWWEch+djOLxYhC5o11VGZndJ2xBCjEKOOG6pWBYOM=; b=c3y1kYwVEe5n9/1RqdP6hY2uz1+irGRzWjBHAa8DaseMsUWw8YJlrhNrp0hdWycLlf CjQ2y5/jAbaH8fGosPinjjcY6C3hlOqHAQZtkiPwRhcB1agYCUmJWp/Iy0gfqAHcfQIU Ef/sB4LnEl9lhEE1Pdh29/aZWe9ujO1Z+fPyXo3ZX+i9feahLnm2gUOxx8D5u+VaEmDc 2DA9RINAvVPZ0PM9LeS9wEBbWLPAQmdwZpe/AFpwMp1XkSYg0ey4/1HiCMLge0rkXG0d dGHo04gxvJtvrQHgZgXuidAKwKq385FNPs2twWfL7rCESMmxfDaWJ32mFlhftIXnYDNM qEjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=hhWWEch+djOLxYhC5o11VGZndJ2xBCjEKOOG6pWBYOM=; b=bGgMwkpneQOi+n0LgIHmJS/2DbTjFxbvpckhLOwyELRFCUEfLXoHulE/InVEjdfWDH tVvNAi/ETNtmVO2ZRa7ZbkPYGV250iN+qMKepO0fV52vLz3vcFMXqp/q4LchoGo1qWk6 //f/2zD8JJ1NymsmH4LcXaFJ84/8Hfnb+O8kqeqvYkWmopsWWCpJ6SUrXlg051hAG6tA 2UHD9dycaI1gkbyqBQSa04P5wPBrpuwj+ZeVsdRvFXP6DRKSGxqdqirdIhnrh3zUInT0 8yyLPz4o7UQiKlTh0NjyR49gGjyUMk2NwZH4C0FGMZwvb77CMqV/Y5Ol/fJ0IyyrPCZs U53Q== X-Gm-Message-State: ALyK8tKjYP13EYEgA64o6IeyZXrl9qoizTLnJrCjvYUVM3oFQb1EQcMTiToHjmpAVW1ugg== X-Received: by 10.98.74.92 with SMTP id x89mr6549377pfa.79.1466099035228; Thu, 16 Jun 2016 10:43:55 -0700 (PDT) Received: from [29.120.49.71] ([172.58.40.150]) by smtp.gmail.com with ESMTPSA id h77sm30008469pfj.86.2016.06.16.10.43.54 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 16 Jun 2016 10:43:54 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r301959 - head/sys/kern From: Ngie Cooper X-Mailer: iPhone Mail (13F69) In-Reply-To: Date: Thu, 16 Jun 2016 10:43:53 -0700 Cc: Konstantin Belousov , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201606161158.u5GBwkd1042632@repo.freebsd.org> To: cem@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 17:43:56 -0000 > On Jun 16, 2016, at 10:17, Conrad Meyer wrote: >=20 >> On Thu, Jun 16, 2016 at 4:58 AM, Konstantin Belousov wr= ote: >> --- head/sys/kern/kern_thread.c Thu Jun 16 11:55:24 2016 (r301958)= >> +++ head/sys/kern/kern_thread.c Thu Jun 16 11:58:46 2016 (r301959)= >> @@ -669,11 +669,6 @@ weed_inhib(int mode, struct thread *td2, >> wakeup_swapper |=3D sleepq_abort(td2, EINTR); >> break; >> case SINGLE_BOUNDARY: >> - if (TD_IS_SUSPENDED(td2) && (td2->td_flags & TDF_BOUNDARY= ) =3D=3D 0) >> - wakeup_swapper |=3D thread_unsuspend_one(td2, p, f= alse); >> - if (TD_ON_SLEEPQ(td2) && (td2->td_flags & TDF_SINTR) !=3D= 0) >> - wakeup_swapper |=3D sleepq_abort(td2, ERESTART); >> - break; >=20 > style(9) nit: /* FALLTHROUGH */ >=20 Also, coverity will complain about the missing break unless that's there... > Best, > Conrad >=20 >> case SINGLE_NO_EXIT: >> if (TD_IS_SUSPENDED(td2) && (td2->td_flags & TDF_BOUNDARY)= =3D=3D 0) >> wakeup_swapper |=3D thread_unsuspend_one(td2, p, f= alse); >=20 From owner-svn-src-all@freebsd.org Thu Jun 16 17:59:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0785A77251; Thu, 16 Jun 2016 17:59:16 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71F2B1886; Thu, 16 Jun 2016 17:59:16 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5GHxFMu077215; Thu, 16 Jun 2016 17:59:15 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5GHxFaX077214; Thu, 16 Jun 2016 17:59:15 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606161759.u5GHxFaX077214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 16 Jun 2016 17:59:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301970 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 17:59:16 -0000 Author: adrian Date: Thu Jun 16 17:59:15 2016 New Revision: 301970 URL: https://svnweb.freebsd.org/changeset/base/301970 Log: [iwm] free RX ring / NVM memory after they're used. * Free RX ring during detach * Free NVM memory after parsing Tested: * 7260, STA mode Submitted by: Imre Vadasz Approved by: re (gjb) Obtained from: dragonflybsd Differential Revision: https://reviews.freebsd.org/D6817 Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jun 16 16:26:16 2016 (r301969) +++ head/sys/dev/iwm/if_iwm.c Thu Jun 16 17:59:15 2016 (r301970) @@ -1823,7 +1823,7 @@ iwm_parse_nvm_data(struct iwm_softc *sc, struct iwm_nvm_section { uint16_t length; - const uint8_t *data; + uint8_t *data; }; static int @@ -1860,6 +1860,8 @@ iwm_nvm_init(struct iwm_softc *sc) "%s: Read NVM\n", __func__); + memset(nvm_sections, 0, sizeof(nvm_sections)); + /* TODO: find correct NVM max size for a section */ nvm_buffer = malloc(IWM_OTP_LOW_IMAGE_SIZE, M_DEVBUF, M_NOWAIT); if (nvm_buffer == NULL) @@ -1883,10 +1885,15 @@ iwm_nvm_init(struct iwm_softc *sc) nvm_sections[section].length = len; } free(nvm_buffer, M_DEVBUF); - if (error) - return error; + if (error == 0) + error = iwm_parse_nvm_sections(sc, nvm_sections); - return iwm_parse_nvm_sections(sc, nvm_sections); + for (i = 0; i < IWM_NVM_NUM_OF_SECTIONS; i++) { + if (nvm_sections[i].data != NULL) + free(nvm_sections[i].data, M_DEVBUF); + } + + return error; } /* @@ -5008,6 +5015,7 @@ iwm_detach_local(struct iwm_softc *sc, i ieee80211_ifdetach(&sc->sc_ic); /* Free descriptor rings */ + iwm_free_rx_ring(sc, &sc->rxq); for (i = 0; i < nitems(sc->txq); i++) iwm_free_tx_ring(sc, &sc->txq[i]); From owner-svn-src-all@freebsd.org Thu Jun 16 18:15:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2EA6A776CE for ; Thu, 16 Jun 2016 18:15:11 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A5AC22B4 for ; Thu, 16 Jun 2016 18:15:11 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 4dc9bd32-33ee-11e6-8929-8ded99d5e9d7 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Thu, 16 Jun 2016 18:15:27 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u5GIF3vH005643; Thu, 16 Jun 2016 12:15:03 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1466100903.51702.5.camel@freebsd.org> Subject: Re: svn commit: r301959 - head/sys/kern From: Ian Lepore To: Ngie Cooper , cem@freebsd.org Cc: Konstantin Belousov , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 16 Jun 2016 12:15:03 -0600 In-Reply-To: References: <201606161158.u5GBwkd1042632@repo.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 18:15:11 -0000 On Thu, 2016-06-16 at 10:43 -0700, Ngie Cooper wrote: > > On Jun 16, 2016, at 10:17, Conrad Meyer wrote: > > > > > On Thu, Jun 16, 2016 at 4:58 AM, Konstantin Belousov < > > > kib@freebsd.org> wrote: > > > --- head/sys/kern/kern_thread.c Thu Jun 16 11:55:24 2016 > > > (r301958) > > > +++ head/sys/kern/kern_thread.c Thu Jun 16 11:58:46 2016 > > > (r301959) > > > @@ -669,11 +669,6 @@ weed_inhib(int mode, struct thread *td2, > > > wakeup_swapper |= sleepq_abort(td2, > > > EINTR); > > > break; > > > case SINGLE_BOUNDARY: > > > - if (TD_IS_SUSPENDED(td2) && (td2->td_flags & > > > TDF_BOUNDARY) == 0) > > > - wakeup_swapper |= > > > thread_unsuspend_one(td2, p, false); > > > - if (TD_ON_SLEEPQ(td2) && (td2->td_flags & > > > TDF_SINTR) != 0) > > > - wakeup_swapper |= sleepq_abort(td2, > > > ERESTART); > > > - break; > > > > style(9) nit: /* FALLTHROUGH */ > > > Also, coverity will complain about the missing break unless that's > there... > If coverity complains about case 1: case 2: statements; break; then it is coverity that needs to be fixed. -- Ian > > Best, > > Conrad > > > > > case SINGLE_NO_EXIT: > > > if (TD_IS_SUSPENDED(td2) && (td2->td_flags & > > > TDF_BOUNDARY) == 0) > > > wakeup_swapper |= > > > thread_unsuspend_one(td2, p, false); > > > > From owner-svn-src-all@freebsd.org Thu Jun 16 19:57:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE695A77CF2; Thu, 16 Jun 2016 19:57:25 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA4F317B3; Thu, 16 Jun 2016 19:57:25 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5GJvPgR021920; Thu, 16 Jun 2016 19:57:25 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5GJvOaZ021916; Thu, 16 Jun 2016 19:57:24 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201606161957.u5GJvOaZ021916@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Thu, 16 Jun 2016 19:57:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301971 - in head/sys/dev/bhnd: . cores/chipc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 19:57:26 -0000 Author: landonf Date: Thu Jun 16 19:57:24 2016 New Revision: 301971 URL: https://svnweb.freebsd.org/changeset/base/301971 Log: bhnd(4): Fix resource allocation issues exposed by chipc PMU support. - Delete all chipc children on attachment failure. - Added missing bhnd_nexus bhnd_bus_deactivate_resource implementation. - Drop a CHIPC_UNLOCK() accidentally left behind after lifting synchronization into the chipc region refcounting API. - Fix re-allocation of chipc resources. Previously, the resource ID was reset to -1 on release, preventing later re-allocation. Approved by: re (gjb), adrian (mentor) Differential Revision: https://reviews.freebsd.org/D6849 Modified: head/sys/dev/bhnd/bhnd_nexus.c head/sys/dev/bhnd/cores/chipc/chipc.c head/sys/dev/bhnd/cores/chipc/chipc_private.h head/sys/dev/bhnd/cores/chipc/chipc_subr.c Modified: head/sys/dev/bhnd/bhnd_nexus.c ============================================================================== --- head/sys/dev/bhnd/bhnd_nexus.c Thu Jun 16 17:59:15 2016 (r301970) +++ head/sys/dev/bhnd/bhnd_nexus.c Thu Jun 16 19:57:24 2016 (r301971) @@ -106,10 +106,26 @@ bhnd_nexus_activate_resource(device_t de return (0); } +static int +bhnd_nexus_deactivate_resource(device_t dev, device_t child, + int type, int rid, struct bhnd_resource *r) +{ + int error; + + /* Always direct */ + KASSERT(r->direct, ("indirect resource delegated to bhnd_nexus\n")); + + if ((error = bus_deactivate_resource(child, type, rid, r->res))) + return (error); + + r->direct = false; + return (0); +} static device_method_t bhnd_nexus_methods[] = { /* bhnd interface */ DEVMETHOD(bhnd_bus_activate_resource, bhnd_nexus_activate_resource), + DEVMETHOD(bhnd_bus_deactivate_resource, bhnd_nexus_deactivate_resource), DEVMETHOD(bhnd_bus_is_hw_disabled, bhnd_nexus_is_hw_disabled), DEVMETHOD(bhnd_bus_get_attach_type, bhnd_nexus_get_attach_type), Modified: head/sys/dev/bhnd/cores/chipc/chipc.c ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipc.c Thu Jun 16 17:59:15 2016 (r301970) +++ head/sys/dev/bhnd/cores/chipc/chipc.c Thu Jun 16 19:57:24 2016 (r301971) @@ -282,6 +282,8 @@ chipc_attach(device_t dev) return (0); failed: + device_delete_children(sc->dev); + if (sc->core_region != NULL) { chipc_release_region(sc, sc->core_region, RF_ALLOCATED|RF_ACTIVE); @@ -878,10 +880,8 @@ chipc_alloc_resource(device_t dev, devic } /* Try to retain a region reference */ - if ((error = chipc_retain_region(sc, cr, RF_ALLOCATED))) { - CHIPC_UNLOCK(sc); + if ((error = chipc_retain_region(sc, cr, RF_ALLOCATED))) return (NULL); - } /* Make our rman reservation */ rv = rman_reserve_resource(rm, start, end, count, flags & ~RF_ACTIVE, Modified: head/sys/dev/bhnd/cores/chipc/chipc_private.h ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipc_private.h Thu Jun 16 17:59:15 2016 (r301970) +++ head/sys/dev/bhnd/cores/chipc/chipc_private.h Thu Jun 16 19:57:24 2016 (r301971) @@ -84,11 +84,13 @@ struct chipc_region { bhnd_addr_t cr_addr; /**< region base address */ bhnd_addr_t cr_end; /**< region end address */ bhnd_size_t cr_count; /**< region count */ - int cr_rid; /**< rid, or -1 if no rid - * is allocated by the bus for - * this region */ + int cr_rid; /**< rid to use when performing + resource allocation, or -1 + if region has no assigned + resource ID */ struct bhnd_resource *cr_res; /**< bus resource, or NULL */ + int cr_res_rid; /**< cr_res RID, if any. */ u_int cr_refs; /**< RF_ALLOCATED refcount */ u_int cr_act_refs; /**< RF_ACTIVE refcount */ Modified: head/sys/dev/bhnd/cores/chipc/chipc_subr.c ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipc_subr.c Thu Jun 16 17:59:15 2016 (r301970) +++ head/sys/dev/bhnd/cores/chipc/chipc_subr.c Thu Jun 16 19:57:24 2016 (r301971) @@ -150,9 +150,10 @@ chipc_alloc_region(struct chipc_softc *s cr->cr_end = cr->cr_addr + cr->cr_count - 1; - /* Note that not all regions have an assigned rid, in which case - * this will return -1 */ + /* Fetch default resource ID for this region. Not all regions have an + * assigned rid, in which case this will return -1 */ cr->cr_rid = bhnd_get_port_rid(sc->dev, type, port, region); + return (cr); failed: @@ -177,7 +178,7 @@ chipc_free_region(struct chipc_softc *sc cr->cr_region_num, cr->cr_refs)); if (cr->cr_res != NULL) { - bhnd_release_resource(sc->dev, SYS_RES_MEMORY, cr->cr_rid, + bhnd_release_resource(sc->dev, SYS_RES_MEMORY, cr->cr_res_rid, cr->cr_res); } @@ -264,10 +265,16 @@ chipc_retain_region(struct chipc_softc * KASSERT(cr->cr_res == NULL, ("non-NULL resource has refcount")); + /* Fetch initial resource ID */ + if ((cr->cr_res_rid = cr->cr_rid) == -1) { + CHIPC_UNLOCK(sc); + return (EINVAL); + } + + /* Allocate resource */ cr->cr_res = bhnd_alloc_resource(sc->dev, - SYS_RES_MEMORY, &cr->cr_rid, cr->cr_addr, + SYS_RES_MEMORY, &cr->cr_res_rid, cr->cr_addr, cr->cr_end, cr->cr_count, 0); - if (cr->cr_res == NULL) { CHIPC_UNLOCK(sc); return (ENXIO); @@ -287,7 +294,7 @@ chipc_retain_region(struct chipc_softc * /* If this is the first reference, activate the resource */ if (cr->cr_act_refs == 0) { error = bhnd_activate_resource(sc->dev, SYS_RES_MEMORY, - cr->cr_rid, cr->cr_res); + cr->cr_res_rid, cr->cr_res); if (error) { /* Drop any allocation reference acquired * above */ @@ -324,6 +331,8 @@ chipc_release_region(struct chipc_softc CHIPC_LOCK(sc); error = 0; + KASSERT(cr->cr_res != NULL, ("release on NULL region resource")); + if (flags & RF_ACTIVE) { KASSERT(cr->cr_act_refs > 0, ("RF_ACTIVE over-released")); KASSERT(cr->cr_act_refs <= cr->cr_refs, @@ -332,7 +341,7 @@ chipc_release_region(struct chipc_softc /* If this is the last reference, deactivate the resource */ if (cr->cr_act_refs == 1) { error = bhnd_deactivate_resource(sc->dev, - SYS_RES_MEMORY, cr->cr_rid, cr->cr_res); + SYS_RES_MEMORY, cr->cr_res_rid, cr->cr_res); if (error) goto done; } @@ -343,16 +352,14 @@ chipc_release_region(struct chipc_softc if (flags & RF_ALLOCATED) { KASSERT(cr->cr_refs > 0, ("overrelease of refs")); - /* If this is the last reference, release the resource */ if (cr->cr_refs == 1) { - error = bhnd_release_resource(sc->dev, - SYS_RES_MEMORY, cr->cr_rid, cr->cr_res); + error = bhnd_release_resource(sc->dev, SYS_RES_MEMORY, + cr->cr_res_rid, cr->cr_res); if (error) goto done; cr->cr_res = NULL; - cr->cr_rid = -1; } /* Drop our allocation refcount */ From owner-svn-src-all@freebsd.org Thu Jun 16 20:04:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B033A77E27; Thu, 16 Jun 2016 20:04:35 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDF471C1D; Thu, 16 Jun 2016 20:04:34 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5GK4Y50025639; Thu, 16 Jun 2016 20:04:34 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5GK4XuR025634; Thu, 16 Jun 2016 20:04:33 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201606162004.u5GK4XuR025634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Thu, 16 Jun 2016 20:04:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301972 - head/sys/dev/bhnd/siba X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 20:04:35 -0000 Author: landonf Date: Thu Jun 16 20:04:33 2016 New Revision: 301972 URL: https://svnweb.freebsd.org/changeset/base/301972 Log: siba(4): Adopt bcma-compatible mapping of bhnd(4) port/region identifiers. Maps Sonics/OCP per-core address spaces to bcma(4)-compatible port/region identifiers. This permits the use of common address map identifiers in bhnd device drivers, independent of the underlying interconnect type. Approved by: re (gjb), adrian (mentor) Differential Revision: https://reviews.freebsd.org/D6850 Modified: head/sys/dev/bhnd/siba/siba.c head/sys/dev/bhnd/siba/siba_subr.c head/sys/dev/bhnd/siba/sibareg.h head/sys/dev/bhnd/siba/sibavar.h Modified: head/sys/dev/bhnd/siba/siba.c ============================================================================== --- head/sys/dev/bhnd/siba/siba.c Thu Jun 16 19:57:24 2016 (r301971) +++ head/sys/dev/bhnd/siba/siba.c Thu Jun 16 20:04:33 2016 (r301972) @@ -70,7 +70,6 @@ siba_attach(device_t dev) for (int i = 0; i < ndevs; i++) { struct siba_addrspace *addrspace; - struct siba_port *port; dinfo = device_get_ivars(devs[i]); @@ -79,14 +78,10 @@ siba_attach(device_t dev) "not be suspended before siba_attach()")); /* Fetch the core register address space */ - port = siba_dinfo_get_port(dinfo, BHND_PORT_DEVICE, 0); - if (port == NULL) { - error = ENXIO; - goto cleanup; - } - - addrspace = siba_find_port_addrspace(port, SIBA_ADDRSPACE_CORE); + addrspace = siba_find_addrspace(dinfo, BHND_PORT_DEVICE, 0, 0); if (addrspace == NULL) { + device_printf(dev, + "missing device registers for core %d\n", i); error = ENXIO; goto cleanup; } @@ -94,7 +89,7 @@ siba_attach(device_t dev) /* * Map the per-core configuration blocks */ - KASSERT(dinfo->core_id.num_cfg_blocks <= SIBA_CFG_NUM_MAX, + KASSERT(dinfo->core_id.num_cfg_blocks <= SIBA_MAX_CFG, ("config block count %u out of range", dinfo->core_id.num_cfg_blocks)); @@ -285,32 +280,25 @@ siba_get_port_count(device_t dev, device type)); dinfo = device_get_ivars(child); - - /* We advertise exactly one port of any type */ - if (siba_dinfo_get_port(dinfo, type, 0) != NULL) - return (1); - - return (0); + return (siba_addrspace_port_count(dinfo)); } static u_int siba_get_region_count(device_t dev, device_t child, bhnd_port_type type, - u_int port_num) + u_int port) { struct siba_devinfo *dinfo; - struct siba_port *port; /* delegate non-bus-attached devices to our parent */ if (device_get_parent(child) != dev) return (BHND_BUS_GET_REGION_COUNT(device_get_parent(dev), child, - type, port_num)); + type, port)); dinfo = device_get_ivars(child); - port = siba_dinfo_get_port(dinfo, type, port_num); - if (port == NULL) + if (!siba_is_port_valid(dinfo, type, port)) return (0); - return (port->sp_num_addrs); + return (siba_addrspace_region_count(dinfo, port)); } static int @@ -318,7 +306,6 @@ siba_get_port_rid(device_t dev, device_t u_int port_num, u_int region_num) { struct siba_devinfo *dinfo; - struct siba_port *port; struct siba_addrspace *addrspace; /* delegate non-bus-attached devices to our parent */ @@ -327,17 +314,11 @@ siba_get_port_rid(device_t dev, device_t port_type, port_num, region_num)); dinfo = device_get_ivars(child); - port = siba_dinfo_get_port(dinfo, port_type, port_num); - if (port == NULL) + addrspace = siba_find_addrspace(dinfo, port_type, port_num, region_num); + if (addrspace == NULL) return (-1); - STAILQ_FOREACH(addrspace, &port->sp_addrs, sa_link) { - if (addrspace->sa_region_num == region_num) - return (addrspace->sa_rid); - } - - /* not found */ - return (-1); + return (addrspace->sa_rid); } static int @@ -345,8 +326,6 @@ siba_decode_port_rid(device_t dev, devic bhnd_port_type *port_type, u_int *port_num, u_int *region_num) { struct siba_devinfo *dinfo; - struct siba_port *port; - struct siba_addrspace *addrspace; /* delegate non-bus-attached devices to our parent */ if (device_get_parent(child) != dev) @@ -359,29 +338,17 @@ siba_decode_port_rid(device_t dev, devic if (type != SYS_RES_MEMORY) return (EINVAL); - /* Starting with the most likely device list, search all three port - * lists */ - bhnd_port_type types[] = { - BHND_PORT_DEVICE, - BHND_PORT_AGENT, - BHND_PORT_BRIDGE - }; - - for (int i = 0; i < nitems(types); i++) { - port = siba_dinfo_get_port(dinfo, types[i], 0); - if (port == NULL) + for (int i = 0; i < dinfo->core_id.num_addrspace; i++) { + if (dinfo->addrspace[i].sa_rid != rid) continue; - - STAILQ_FOREACH(addrspace, &port->sp_addrs, sa_link) { - if (addrspace->sa_rid != rid) - continue; - - *port_type = port->sp_type; - *port_num = port->sp_num; - *region_num = addrspace->sa_region_num; - } + + *port_type = BHND_PORT_DEVICE; + *port_num = siba_addrspace_port(i); + *region_num = siba_addrspace_region(i); + return (0); } + /* Not found */ return (ENOENT); } @@ -390,7 +357,6 @@ siba_get_region_addr(device_t dev, devic u_int port_num, u_int region_num, bhnd_addr_t *addr, bhnd_size_t *size) { struct siba_devinfo *dinfo; - struct siba_port *port; struct siba_addrspace *addrspace; /* delegate non-bus-attached devices to our parent */ @@ -400,20 +366,13 @@ siba_get_region_addr(device_t dev, devic } dinfo = device_get_ivars(child); - port = siba_dinfo_get_port(dinfo, port_type, port_num); - if (port == NULL) + addrspace = siba_find_addrspace(dinfo, port_type, port_num, region_num); + if (addrspace == NULL) return (ENOENT); - STAILQ_FOREACH(addrspace, &port->sp_addrs, sa_link) { - if (addrspace->sa_region_num != region_num) - continue; - - *addr = addrspace->sa_base; - *size = addrspace->sa_size - addrspace->sa_bus_reserved; - return (0); - } - - return (ENOENT); + *addr = addrspace->sa_base; + *size = addrspace->sa_size - addrspace->sa_bus_reserved; + return (0); } @@ -432,26 +391,21 @@ siba_register_addrspaces(device_t dev, s struct siba_core_id *cid; uint32_t addr; uint32_t size; - u_int region_num; int error; cid = &di->core_id; - /* Region numbers must be assigned in order, but our siba address - * space IDs may be sparsely allocated; thus, we track - * the region index separately. */ - region_num = 0; /* Register the device address space entries */ - for (uint8_t sid = 0; sid < di->core_id.num_addrspace; sid++) { + for (uint8_t i = 0; i < di->core_id.num_addrspace; i++) { uint32_t adm; u_int adm_offset; uint32_t bus_reserved; /* Determine the register offset */ - adm_offset = siba_admatch_offset(sid); + adm_offset = siba_admatch_offset(i); if (adm_offset == 0) { - device_printf(dev, "addrspace %hhu is unsupported", sid); + device_printf(dev, "addrspace %hhu is unsupported", i); return (ENODEV); } @@ -469,17 +423,14 @@ siba_register_addrspaces(device_t dev, s * reserve the Sonics configuration register blocks for the * use of our bus. */ bus_reserved = 0; - if (sid == SIBA_ADDRSPACE_CORE) + if (i == SIBA_CORE_ADDRSPACE) bus_reserved = cid->num_cfg_blocks * SIBA_CFG_SIZE; /* Append the region info */ - error = siba_append_dinfo_region(di, BHND_PORT_DEVICE, 0, - region_num, sid, addr, size, bus_reserved); + error = siba_append_dinfo_region(di, i, addr, size, + bus_reserved); if (error) return (error); - - - region_num++; } return (0); Modified: head/sys/dev/bhnd/siba/siba_subr.c ============================================================================== --- head/sys/dev/bhnd/siba/siba_subr.c Thu Jun 16 19:57:24 2016 (r301971) +++ head/sys/dev/bhnd/siba/siba_subr.c Thu Jun 16 20:04:33 2016 (r301972) @@ -106,35 +106,6 @@ siba_parse_core_id(uint32_t idhigh, uint } /** - * Initialize new port descriptor. - * - * @param port_num Port number. - * @param port_type Port type. - */ -static void -siba_init_port(struct siba_port *port, bhnd_port_type port_type, u_int port_num) -{ - port->sp_num = port_num; - port->sp_type = port_type; - port->sp_num_addrs = 0; - STAILQ_INIT(&port->sp_addrs); -} - -/** - * Deallocate all resources associated with the given port descriptor. - * - * @param port Port descriptor to be deallocated. - */ -static void -siba_release_port(struct siba_port *port) { - struct siba_addrspace *as, *as_next; - - STAILQ_FOREACH_SAFE(as, &port->sp_addrs, sa_link, as_next) { - free(as, M_BHND); - } -} - -/** * Allocate and initialize new device info structure, copying the * provided core id. * @@ -157,76 +128,153 @@ siba_alloc_dinfo(device_t bus, const str dinfo->cfg_rid[i] = -1; } - siba_init_port(&dinfo->device_port, BHND_PORT_DEVICE, 0); resource_list_init(&dinfo->resources); return dinfo; } /** - * Return the @p dinfo port instance for @p type, or NULL. + * Map an addrspace index to its corresponding bhnd(4) port number. * - * @param dinfo The siba device info. - * @param type The requested port type. + * @param addrspace Address space index. + */ +u_int +siba_addrspace_port(u_int addrspace) +{ + /* The first addrspace is always mapped to device0; the remainder + * are mapped to device1 */ + if (addrspace == 0) + return (0); + else + return (1); +} + +/** + * Map an addrspace index to its corresponding bhnd(4) region number. * - * @retval siba_port If @p port_type and @p port_num are defined on @p dinfo. - * @retval NULL If the requested port is not defined on @p dinfo. + * @param addrspace Address space index. */ -struct siba_port * -siba_dinfo_get_port(struct siba_devinfo *dinfo, bhnd_port_type port_type, - u_int port_num) +u_int +siba_addrspace_region(u_int addrspace) { - /* We only define a single port for any given type. */ - if (port_num != 0) - return (NULL); + /* The first addrspace is always mapped to device0.0; the remainder + * are mapped to device1.0 + (n - 1) */ + if (addrspace == 0) + return (0); + else + return (addrspace - 1); +} - switch (port_type) { - case BHND_PORT_DEVICE: - return (&dinfo->device_port); - case BHND_PORT_BRIDGE: - return (NULL); - case BHND_PORT_AGENT: - return (NULL); - default: - printf("%s: unknown port_type (%d)\n", - __func__, - port_type); - return (NULL); - } +/** + * Return the number of bhnd(4) ports to advertise for the given + * @p dinfo. + * + * @param dinfo The device info to query. + */ +u_int +siba_addrspace_port_count(struct siba_devinfo *dinfo) +{ + /* 0, 1, or 2 ports */ + return min(dinfo->core_id.num_addrspace, 2); } +/** + * Return the number of bhnd(4) regions to advertise on @p port + * given the provided @p num_addrspace address space count. + * + * @param num_addrspace The number of core-mapped siba(4) Sonics/OCP address + * spaces. + */ +u_int +siba_addrspace_region_count(struct siba_devinfo *dinfo, u_int port) +{ + u_int num_addrspace = dinfo->core_id.num_addrspace; + + /* The first address space, if any, is mapped to device0.0 */ + if (port == 0) + return (min(num_addrspace, 1)); + + /* All remaining address spaces are mapped to device0.(n - 1) */ + if (port == 1 && num_addrspace >= 2) + return (num_addrspace - 1); + + /* No region mapping */ + return (0); +} + +/** + * Return true if @p port is defined on @p dinfo, false otherwise. + * + * Refer to the siba_find_addrspace() function for information on siba's + * mapping of bhnd(4) port and region identifiers. + * + * @param dinfo The device info to verify the port against. + * @param type The bhnd(4) port type. + * @param port The bhnd(4) port number. + */ +bool +siba_is_port_valid(struct siba_devinfo *dinfo, bhnd_port_type type, u_int port) +{ + /* Only device ports are supported */ + if (type != BHND_PORT_DEVICE) + return (false); + + /* Verify the index against the port count */ + if (siba_addrspace_port_count(dinfo) <= port) + return (false); + + return (true); +} /** - * Find an address space with @p sid on @p port. + * Map an bhnd(4) type/port/region triplet to its associated address space + * entry, if any. * - * @param port The port to search for a matching address space. - * @param sid The siba-assigned address space ID to search for. + * For compatibility with bcma(4), we map address spaces to port/region + * identifiers as follows: + * + * [port] [addrspace] + * device0.0 0 + * device1.0 1 + * device1.1 2 + * device1.2 3 + * + * The only supported port type is BHND_PORT_DEVICE. + * + * @param dinfo The device info to search for a matching address space. + * @param type The bhnd(4) port type. + * @param port The bhnd(4) port number. + * @param region The bhnd(4) port region. */ struct siba_addrspace * -siba_find_port_addrspace(struct siba_port *port, uint8_t sid) +siba_find_addrspace(struct siba_devinfo *dinfo, bhnd_port_type type, u_int port, + u_int region) { - struct siba_addrspace *addrspace; + u_int addridx; - STAILQ_FOREACH(addrspace, &port->sp_addrs, sa_link) { - if (addrspace->sa_sid == sid) - return (addrspace); - } + if (!siba_is_port_valid(dinfo, type, port)) + return (NULL); - /* not found */ - return (NULL); + if (port == 0) + addridx = region; + else if (port == 1) + addridx = region + 1; + else + return (NULL); + + /* Out of range? */ + if (addridx >= dinfo->core_id.num_addrspace) + return (NULL); + + /* Found */ + return (&dinfo->addrspace[addridx]); } /** - * Append a new address space entry to @p port_num of type @p port_type - * in @p dinfo. - * - * The range will also be registered in @p dinfo resource list. + * Append an address space entry to @p dinfo. * * @param dinfo The device info entry to update. - * @param port_type The port type. - * @param port_num The port number. - * @param region_num The region index number. - * @param sid The siba-assigned core-unique address space identifier. + * @param addridx The address space index. * @param base The mapping's base address. * @param size The mapping size. * @param bus_reserved Number of bytes to reserve in @p size for bus use @@ -237,12 +285,10 @@ siba_find_port_addrspace(struct siba_por * @retval non-zero An error occurred appending the entry. */ int -siba_append_dinfo_region(struct siba_devinfo *dinfo, bhnd_port_type port_type, - u_int port_num, u_int region_num, uint8_t sid, uint32_t base, uint32_t size, - uint32_t bus_reserved) +siba_append_dinfo_region(struct siba_devinfo *dinfo, uint8_t addridx, + uint32_t base, uint32_t size, uint32_t bus_reserved) { struct siba_addrspace *sa; - struct siba_port *port; rman_res_t r_size; /* Verify that base + size will not overflow */ @@ -257,20 +303,14 @@ siba_append_dinfo_region(struct siba_dev if (size == 0) return (EINVAL); - /* Determine target port */ - port = siba_dinfo_get_port(dinfo, port_type, port_num); - if (port == NULL) + /* Must not exceed addrspace array size */ + if (addridx >= nitems(dinfo->addrspace)) return (EINVAL); - /* Allocate new addrspace entry */ - sa = malloc(sizeof(*sa), M_BHND, M_NOWAIT|M_ZERO); - if (sa == NULL) - return (ENOMEM); - + /* Initialize new addrspace entry */ + sa = &dinfo->addrspace[addridx]; sa->sa_base = base; sa->sa_size = size; - sa->sa_sid = sid; - sa->sa_region_num = region_num; sa->sa_bus_reserved = bus_reserved; /* Populate the resource list */ @@ -278,10 +318,6 @@ siba_append_dinfo_region(struct siba_dev sa->sa_rid = resource_list_add_next(&dinfo->resources, SYS_RES_MEMORY, base, base + (r_size - 1), r_size); - /* Append to target port */ - STAILQ_INSERT_TAIL(&port->sp_addrs, sa, sa_link); - port->sp_num_addrs++; - return (0); } @@ -294,8 +330,6 @@ siba_append_dinfo_region(struct siba_dev void siba_free_dinfo(device_t dev, struct siba_devinfo *dinfo) { - siba_release_port(&dinfo->device_port); - resource_list_free(&dinfo->resources); /* Free all mapped configuration blocks */ Modified: head/sys/dev/bhnd/siba/sibareg.h ============================================================================== --- head/sys/dev/bhnd/siba/sibareg.h Thu Jun 16 19:57:24 2016 (r301971) +++ head/sys/dev/bhnd/siba/sibareg.h Thu Jun 16 20:04:33 2016 (r301972) @@ -51,9 +51,6 @@ #define SIBA_MAX_CORES \ (SIBA_ENUM_SIZE/SIBA_CORE_SIZE) /**< Maximum number of cores */ -#define SIBA_ADDRSPACE_CORE 0 /**< address space identifier of the - core enumeration block. */ - /**< Evaluates to the bus address of the @p idx core register block */ #define SIBA_CORE_ADDR(idx) \ (SIBA_ENUM_ADDR + ((idx) * SIBA_CORE_SIZE)) @@ -175,7 +172,7 @@ #define SIBA_IMCH_BEM_MASK 0xc0 /* bus error mode */ #define SIBA_IMCH_BEM_SHIFT 6 -/* sbadmatch0 */ +/* sbadmatch0-4 */ #define SIBA_AM_TYPE_MASK 0x3 /* address type */ #define SIBA_AM_TYPE_SHIFT 0x0 #define SIBA_AM_AD64 0x4 /* reserved */ Modified: head/sys/dev/bhnd/siba/sibavar.h ============================================================================== --- head/sys/dev/bhnd/siba/sibavar.h Thu Jun 16 19:57:24 2016 (r301971) +++ head/sys/dev/bhnd/siba/sibavar.h Thu Jun 16 20:04:33 2016 (r301972) @@ -47,7 +47,6 @@ struct siba_addrspace; struct siba_devinfo; -struct siba_port; struct siba_core_id; int siba_probe(device_t dev); @@ -69,47 +68,53 @@ struct siba_devinfo *siba_alloc_dinfo(de void siba_free_dinfo(device_t dev, struct siba_devinfo *dinfo); -struct siba_port *siba_dinfo_get_port(struct siba_devinfo *dinfo, - bhnd_port_type port_type, u_int port_num); +u_int siba_addrspace_port_count(struct siba_devinfo *dinfo); +u_int siba_addrspace_region_count(struct siba_devinfo *dinfo, + u_int port); -struct siba_addrspace *siba_find_port_addrspace(struct siba_port *port, - uint8_t sid); +u_int siba_addrspace_port(u_int addrspace); +u_int siba_addrspace_region(u_int addrspace); + +bool siba_is_port_valid(struct siba_devinfo *dinfo, + bhnd_port_type type, u_int port); + +struct siba_addrspace *siba_find_addrspace(struct siba_devinfo *dinfo, + bhnd_port_type type, u_int port, u_int region); int siba_append_dinfo_region(struct siba_devinfo *dinfo, - bhnd_port_type port_type, u_int port_num, - u_int region_num, uint8_t sid, uint32_t base, - uint32_t size, uint32_t bus_reserved); + uint8_t sid, uint32_t base, uint32_t size, + uint32_t bus_reserved); u_int siba_admatch_offset(uint8_t addrspace); int siba_parse_admatch(uint32_t am, uint32_t *addr, uint32_t *size); + /* Sonics configuration register blocks */ #define SIBA_CFG_NUM_2_2 1 /**< sonics <= 2.2 maps SIBA_CFG0. */ #define SIBA_CFG_NUM_2_3 2 /**< sonics <= 2.3 maps SIBA_CFG0 and SIBA_CFG1 */ -#define SIBA_CFG_NUM_MAX SIBA_CFG_NUM_2_3 /**< maximum number of supported config +#define SIBA_MAX_CFG SIBA_CFG_NUM_2_3 /**< maximum number of supported config register blocks */ +/* Sonics/OCP address space mappings */ +#define SIBA_CORE_ADDRSPACE 0 /**< Address space mapping the primary + device registers */ + +#define SIBA_MAX_ADDRSPACE 4 /**< Maximum number of Sonics/OCP + * address space mappings for a + * single core. */ + +/* bhnd(4) (port,region) representation of siba address space mappings */ +#define SIBA_MAX_PORT 2 /**< maximum number of advertised + * bhnd(4) ports */ + /** siba(4) address space descriptor */ struct siba_addrspace { uint32_t sa_base; /**< base address */ uint32_t sa_size; /**< size */ - u_int sa_region_num; /**< bhnd region id */ - uint8_t sa_sid; /**< siba-assigned address space ID */ int sa_rid; /**< bus resource id */ uint32_t sa_bus_reserved;/**< number of bytes at high end of * address space reserved for the bus */ - - STAILQ_ENTRY(siba_addrspace) sa_link; -}; - -/** siba(4) port descriptor */ -struct siba_port { - bhnd_port_type sp_type; /**< port type */ - u_int sp_num; /**< port number */ - u_int sp_num_addrs; /**< number of address space mappings */ - - STAILQ_HEAD(, siba_addrspace) sp_addrs; /**< address spaces mapped to this port */ }; /** @@ -133,16 +138,10 @@ struct siba_core_id { struct siba_devinfo { struct resource_list resources; /**< per-core memory regions. */ struct siba_core_id core_id; /**< core identification info */ + struct siba_addrspace addrspace[SIBA_MAX_ADDRSPACE]; /**< memory map descriptors */ - struct siba_port device_port; /**< device port holding ownership - * of all siba address space - * entries for this core. */ - - /** SIBA_CFG* register blocks */ - struct bhnd_resource *cfg[SIBA_CFG_NUM_MAX]; - - /** SIBA_CFG* resource IDs */ - int cfg_rid[SIBA_CFG_NUM_MAX]; + struct bhnd_resource *cfg[SIBA_MAX_CFG]; /**< SIBA_CFG_* registers */ + int cfg_rid[SIBA_MAX_CFG]; /**< SIBA_CFG_* resource IDs */ }; From owner-svn-src-all@freebsd.org Thu Jun 16 21:14:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50408A77A87; Thu, 16 Jun 2016 21:14:27 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0EB6C16FA; Thu, 16 Jun 2016 21:14:26 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5GLEQZL051171; Thu, 16 Jun 2016 21:14:26 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5GLEPa6051162; Thu, 16 Jun 2016 21:14:25 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201606162114.u5GLEPa6051162@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 16 Jun 2016 21:14:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301973 - in head/usr.sbin/bsdconfig: include networking networking/include networking/share share/media X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 21:14:27 -0000 Author: dteske Date: Thu Jun 16 21:14:25 2016 New Revision: 301973 URL: https://svnweb.freebsd.org/changeset/base/301973 Log: Add bsdconfig `wifi' (aka `wireless' or `wlan') module Approved by: re (gjb) MFC after: 8 weeks Relnotes: yes Added: head/usr.sbin/bsdconfig/networking/wlanconfig (contents, props changed) head/usr.sbin/bsdconfig/share/media/wlan.subr (contents, props changed) Modified: head/usr.sbin/bsdconfig/include/messages.subr head/usr.sbin/bsdconfig/networking/INDEX head/usr.sbin/bsdconfig/networking/Makefile head/usr.sbin/bsdconfig/networking/include/messages.subr head/usr.sbin/bsdconfig/networking/networking head/usr.sbin/bsdconfig/networking/share/device.subr head/usr.sbin/bsdconfig/share/media/Makefile Modified: head/usr.sbin/bsdconfig/include/messages.subr ============================================================================== --- head/usr.sbin/bsdconfig/include/messages.subr Thu Jun 16 20:04:33 2016 (r301972) +++ head/usr.sbin/bsdconfig/include/messages.subr Thu Jun 16 21:14:25 2016 (r301973) @@ -66,9 +66,11 @@ msg_canada="Canada" msg_cancel="Cancel" msg_cancel_exit="Cancel/Exit" msg_cannot_create_permission_denied="%s: cannot create %s: Permission denied" +msg_cannot_edit_wireless_ssid="Cannot edit wireless configuration; no matches for\nSSID \`%s' in wpa_supplicants.conf(5)" msg_cannot_resolve_hostname="Cannot resolve \`%s'! Are you sure that your\nname server, gateway and network interface are correctly configured?" msg_cant_find_distribution="Warning: Can't find the \`%s' distribution on this\nFTP server. You may need to visit a different server for\nthe release you are trying to fetch or go to the Options\nmenu and set the release name to explicitly match what's\navailable on %s (or set to \"any\").\n\nWould you like to select another FTP server?" msg_cant_seem_to_write_out_resolv_conf="Can't seem to write out %s. Net cannot be used." +msg_cant_start_wpa_supplicant="Can't start wpa_supplicant(8). Please create a wlan(4)\ninterface from the \`wlans' option after selecting your\nfavorite wireless adapter (i.e., %s)." msg_cd_dvd="CD/DVD" msg_cdrom="CDROM" msg_checking_access_to="Checking access to\n %s" @@ -85,6 +87,9 @@ msg_client_error="Client error, you coul msg_command_failed_rest_of_script_aborted="Command \`%s' failed - rest of script aborted." msg_comms_desc="Communications utilities." msg_configuration_for_interface="Configuration for Interface" +msg_configured="Configured" +msg_configured_lc="configured" +msg_configured_ssids="Configured SSIDs" msg_converters_desc="Format conversion utilities." msg_could_not_unmount_the_cdrom_dvd="Could not unmount the CDROM/DVD from %s: %s" msg_could_not_unmount_the_dos_partition="Could not unmount the DOS partition from %s: %s" @@ -94,12 +99,15 @@ msg_couldnt_connect_to_ftp_server="Could msg_couldnt_connect_to_proxy="Couldn't connect to proxy" msg_couldnt_connect_to_server="Couldn't connect to server" msg_couldnt_open_ftp_connection="Couldn't open FTP connection to %s:\n %s." +msg_create_new="Create New" msg_created_path="Created %s" msg_czech_republic="Czech Republic" msg_databases_desc="Database software." msg_debugging="Debugging" msg_denmark="Denmark" msg_deskutils_desc="Various Desktop utilities." +msg_destroy="Destroy" +msg_details="Details" msg_devel_desc="Software development utilities and libraries." msg_device_is_not_configured="The %s device is not configured. You will need to do so\nin the Networking configuration menu before proceeding." msg_dhcp="DHCP" @@ -107,6 +115,7 @@ msg_dialog_mixedform_navigation_help="Us msg_directory="Directory" msg_directory_not_found="%s: Directory not found." msg_directory_where_package_temporary_files_go="The directory where package temporary files should go" +msg_discovered_ssids="Discovered SSIDs" msg_dns_desc="Domain Name Service tools." msg_docs_desc="Meta-ports for FreeBSD documentation." msg_done="Done" @@ -129,10 +138,15 @@ msg_exit="Exit" msg_exit_bsdconfig="Exit bsdconfig" msg_extra_options_to_ifconfig="Extra options to ifconfig (usually empty):" msg_failed_to_add_default_route="Failed to add a default route; please check your network configuration" +msg_failed_to_reach_wpa_supplicant="Failed to reach wpa_supplicant: %s" msg_file_system="File System" msg_finance_desc="Monetary, financial and related applications." msg_finland="Finland" msg_floppy="Floppy" +msg_forget_all="Forget All" +msg_forget_all_confirm="WARNING! Are you really sure you want to forget all known networks\nby re-initializing wpa_supplicants.conf(5)? This cannot be undone." +msg_forget_all_help="Reset wpa_supplicant(8) configuration, forgetting all known networks" +msg_found="found" msg_france="France" msg_french_desc="Ported software for French countries." msg_ftp="FTP" @@ -202,12 +216,15 @@ msg_linux_desc="Linux programs that can msg_lisp_desc="Software related to the Lisp language." msg_lithuania="Lithuania" msg_loading_of_dependent_package_failed="Loading of dependent package %s failed" +msg_loading_wireless_menu="Loading Wireless Menu..." msg_logging_in_to_user_at_host="Logging in to %s@%s.." msg_looking_for_keymap_files="Looking for keymap files..." msg_looking_up_host="Looking up host %s" msg_mail_desc="Electronic mail packages and utilities." msg_main_menu="Main Menu" msg_main_site="Main Site" +msg_manually_connect="Manually Connect" +msg_manually_connect_help="Connect to a wireless network that may be unlisted" msg_math_desc="Mathematical computation software." msg_mbone_desc="Applications and utilities for the MBONE." msg_media_timeout="Media Timeout" @@ -271,6 +288,7 @@ msg_parallel_desc="Applications dealing msg_pear_desc="Software related to the Pear PHP framework." msg_perl5_desc="Utilities/modules for the PERL5 language." msg_permission_denied="%s: %s: Permission denied" +msg_pick_an_interface_to_destroy="Pick an interface to destroy" msg_pkg_delete_failed="Warning: pkg-delete(8) of %s failed.\n Run with debugging for details." msg_pkg_install_apparently_did_not_like_the_package="pkg-install(8) apparently did not like the %s package." msg_pkg_not_yet_installed_install_now="pkg(8) not yet installed. Install now?" @@ -319,9 +337,12 @@ msg_reinstall_desc="Mark this package fo msg_release_name="Release Name" msg_required_package_not_found="Warning: %s is a required package but was not found." msg_rerun_bsdconfig_initial_device_probe="Re-run bsdconfig initial device probe" +msg_rescan_wireless="Rescan Wireless" +msg_rescan_wireless_help="Scan for new wireless networks" msg_rescan_devices="Re-scan Devices" msg_reset="RESET!" msg_reset_all_values_to_startup_defaults="Reset all values to startup defaults" +msg_return_to_previous_menu="Return to previous menu" msg_reuse_old_ftp_site_selection_values="Re-use old FTP site selection values?" msg_reuse_old_http_site_settings="Re-use old HTTP site settings?" msg_review="Review" @@ -334,6 +355,7 @@ msg_russia="Russia" msg_russian_desc="Ported software for the Russian market." msg_scanning_for_dhcp_servers="Scanning for DHCP servers..." msg_scanning_for_ra_servers="Scanning for RA servers..." +msg_scanning_wireless_pausing="Scanning Wireless... (pausing for %i seconds)" msg_scheme_desc="Software related to the Scheme language." msg_science_desc="Scientific software." msg_secure_mode_requires_root="Secure-mode requires root-access!" @@ -341,9 +363,18 @@ msg_secure_mode_requires_x11="Secure-mod msg_security_desc="System security software." msg_select="Select" msg_select_a_site_thats_close="Select a site that's close!" +msg_select_the_configuration_you_would_like="Select the configuration you would like to edit:\nAddional network information displayed in help line." +msg_select_wlan_interfaces_for="Select wlan interfaces for %s:" msg_selected="selected" msg_server_error_when_requesting_url="Server error when requesting %s, you could try an other server" msg_shells_desc="Various shells (tcsh, bash, etc)." +msg_show_all="Show All" +msg_show_all_help="Show wireless networks without an SSID and all BSSIDs" +msg_show_configured="Show Configured" +msg_show_configured_help="Show networks configured in wpa_supplicants.conf(5)" +msg_show_scan_results="Show Scan Results" +msg_show_scan_results_help="Show wpa_cli(8) scan results" +msg_skip="Skip" msg_slovak_republic="Slovak Republic" msg_slovenia="Slovenia" msg_sorry_invalid_url="Sorry, %s is an invalid URL!" @@ -378,6 +409,7 @@ msg_unable_to_initialize_media_type_for_ msg_unable_to_make_directory_mountpoint="Unable to make %s directory mountpoint for %s!" msg_unable_to_open="Unable to open %s" msg_unable_to_update_pkg_from_selected_media="Unable to update pkg(8) from selected media." +msg_unconfigured="Unconfigured" msg_uninstall="Uninstall" msg_uninstall_desc="Mark this package for deletion" msg_uninstalling_package_waiting_for_pkg_delete="Uninstalling %s package - waiting for pkg-delete(8)" @@ -397,11 +429,15 @@ msg_using_interface="Using interface %s" msg_using_usb_device="Using USB device: %s" msg_vietnamese_desc="Ported software for the Vietnamese market." msg_view_set_various_media_options="View/Set various media options" +msg_warning_no_wireless_devices="WARNING! No wireless devices found." msg_what_would_you_like_to_do_with="What would you like to do with %s?" msg_which_release_to_attempt_to_load="Which release to attempt to load from installation media" msg_which_text_editor_to_use="Which text editor to use during installation" +msg_wireless_networks_text="Select an unmarked ([ ]) entry to join that network.\nSelect a marked ([X]) entry to edit that configuration." msg_windowmaker_desc="Ports to support the WindowMaker window manager." +msg_wireless_network_configuration_for="Wireless network configuration for SSID \`%s'" msg_would_you_like_to_bring_interface_up="Would you like to bring the %s interface up right now?" +msg_wpa_cli_ping_failed="wpa_cli(8) ping failed" msg_www_desc="Web utilities (browsers, HTTP servers, etc)." msg_x11_clocks_desc="X Window System based clocks." msg_x11_desc="X Window System based utilities." Modified: head/usr.sbin/bsdconfig/networking/INDEX ============================================================================== --- head/usr.sbin/bsdconfig/networking/INDEX Thu Jun 16 20:04:33 2016 (r301972) +++ head/usr.sbin/bsdconfig/networking/INDEX Thu Jun 16 21:14:25 2016 (r301973) @@ -1,5 +1,5 @@ # Copyright (c) 2012 Ron McDowell -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2016 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -50,6 +50,9 @@ menu_selection="defaultrouter|defaultrou menu_selection="hostname|hostname" menu_selection="nameservers|nameservers" menu_selection="netdev|devices" +menu_selection="wireless|wlanconfig" +menu_selection="wlan|wlanconfig" +menu_selection="wifi|wlanconfig" # # ------------ Items below this line do NOT need i18n translation ------------ Modified: head/usr.sbin/bsdconfig/networking/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/networking/Makefile Thu Jun 16 20:04:33 2016 (r301972) +++ head/usr.sbin/bsdconfig/networking/Makefile Thu Jun 16 21:14:25 2016 (r301973) @@ -6,6 +6,7 @@ FILESDIR= ${LIBEXECDIR}/bsdconfig/120.ne FILES= INDEX USAGE SCRIPTSDIR= ${FILESDIR} -SCRIPTS= defaultrouter devices hostname nameservers networking +SCRIPTS= defaultrouter devices hostname nameservers networking \ + wlanconfig .include Modified: head/usr.sbin/bsdconfig/networking/include/messages.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/include/messages.subr Thu Jun 16 20:04:33 2016 (r301972) +++ head/usr.sbin/bsdconfig/networking/include/messages.subr Thu Jun 16 21:14:25 2016 (r301973) @@ -1,4 +1,4 @@ -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2016 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -100,6 +100,8 @@ msg_scanning_for_dhcp="Scanning for DHCP msg_select_network_interface="Select a network interface to configure.\n\n* Interface is marked as \"active\"" msg_supported_media_options="Below is a list of supported media options for the %s interface. Please select the options that you would like to set for the %s network interface" msg_unknown_networking_menu_selection="Unknown networking menu selection" +msg_wireless_networks="Wireless Networks" +msg_wlans="wlans" xmsg_please_enter_fqhn="Please enter your fully qualified hostname (e.g. foo.bar.com).\n The domain portion of the hostname will be configured in resolv.conf(5)." xmsg_please_enter_nameserver_existing="Please enter the new IP address of the DNS nameserver\n(set to the NULL string to remove entry):" xmsg_supported_media_options="Below is a list of supported media options for the %s interface. Please\nselect the options that you would like to set for the %s network interface" Modified: head/usr.sbin/bsdconfig/networking/networking ============================================================================== --- head/usr.sbin/bsdconfig/networking/networking Thu Jun 16 20:04:33 2016 (r301972) +++ head/usr.sbin/bsdconfig/networking/networking Thu Jun 16 21:14:25 2016 (r301973) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2006-2013 Devin Teske +# Copyright (c) 2006-2016 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -53,8 +53,9 @@ dialog_menu_main() 'X' '$msg_exit' '1' '$msg_hostname_domain' '2' '$msg_network_interfaces' - '3' '$msg_default_router' - '4' '$msg_dns_nameservers' + '3' '$msg_wireless_networks' + '4' '$msg_default_router' + '5' '$msg_dns_nameservers' " # END-QUOTE local defaultitem= # Calculated below local hline="$hline_arrows_tab_enter" @@ -124,8 +125,9 @@ while :; do X) break ;; 1) command=hostname ;; # Hostname/Domain 2) command=devices ;; # Network Interfaces - 3) command=defaultrouter ;; # Default Router/Gateway - 4) command=nameservers ;; # DNS nameservers + 3) command=wlanconfig ;; # Wireless Networks + 4) command=defaultrouter ;; # Default Router/Gateway + 5) command=nameservers ;; # DNS nameservers esac if [ "$command" ]; then Modified: head/usr.sbin/bsdconfig/networking/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/device.subr Thu Jun 16 20:04:33 2016 (r301972) +++ head/usr.sbin/bsdconfig/networking/share/device.subr Thu Jun 16 21:14:25 2016 (r301973) @@ -1,6 +1,6 @@ if [ ! "$_NETWORKING_DEVICE_SUBR" ]; then _NETWORKING_DEVICE_SUBR=1 # -# Copyright (c) 2006-2015 Devin Teske +# Copyright (c) 2006-2016 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -34,6 +34,7 @@ f_dprintf "%s: loading includes..." netw f_include $BSDCFG_SHARE/device.subr f_include $BSDCFG_SHARE/dialog.subr f_include $BSDCFG_SHARE/media/tcpip.subr +f_include $BSDCFG_SHARE/media/wlan.subr f_include $BSDCFG_SHARE/networking/common.subr f_include $BSDCFG_SHARE/networking/ipaddr.subr f_include $BSDCFG_SHARE/networking/media.subr @@ -194,15 +195,29 @@ f_dialog_menu_netdev_edit() # to ifconfig(8). # local defaultitem= + local wlans wlan_status while :; do local dhcp_status="$msg_disabled" [ "$dhcp" ] && dhcp_status="$msg_enabled" + if f_device_is_wireless "$interface"; then + wlans=$( f_sysrc_get "wlans_$interface" ) + wlan_status="$msg_unconfigured" + [ -e "$( f_sysrc_get wpa_supplicant_conf_file )" ] && + wlan_status="$msg_configured" + fi + # # Display configuration-edit menu # menu_list=" 'X $msg_save_exit' '$msg_return_to_previous_menu' + " # END-QUOTE + f_device_is_wireless "$interface" && menu_list="$menu_list + 'W $msg_wireless_networks' '$wlan_status' + '1 $msg_wlans' '$wlans' + " # END-QUOTE + menu_list="$menu_list '2 $msg_dhcp' '$dhcp_status' '3 $msg_ipaddr4' '$ipaddr' '4 $msg_netmask' '$netmask' @@ -251,6 +266,9 @@ f_dialog_menu_netdev_edit() # case "$tag" in X\ *) break ;; + W\ *) f_dialog_menu_wireless_edit ;; + 1\ *) f_dialog_menu_wlandev_edit \ + "$interface" "${wlans%%[$IFS]*}" ;; 2\ *) # # Proceed cautiously (confirm with the user) if/when NFS- # mounts are active. If the network on which these mounts Added: head/usr.sbin/bsdconfig/networking/wlanconfig ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/networking/wlanconfig Thu Jun 16 21:14:25 2016 (r301973) @@ -0,0 +1,78 @@ +#!/bin/sh +#- +# Copyright (c) 2011 Nathan Whitehorn +# Copyright (c) 2013 Tom Rhodes +# Copyright (c) 2013-2016 Devin Teske +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# +############################################################ INCLUDES + +# Prevent device.subr (included indirectly) from auto scanning on load +DEVICE_SELF_SCAN_ALL=NO + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_dprintf "%s: loading includes..." "$0" +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/media/wlan.subr +f_include $BSDCFG_SHARE/mustberoot.subr + +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking" +f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr + +f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ipgm && + pgm="${ipgm:-$pgm}" + +############################################################ MAIN + +# Incorporate rc-file if it exists +[ -f "$HOME/.bsdconfigrc" ] && f_include "$HOME/.bsdconfigrc" + +# +# Process command-line arguments +# +while getopts h$GETOPTS_STDARGS flag; do + case "$flag" in + h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm" ;; + esac +done +shift $(( $OPTIND - 1 )) + +# +# Initialize +# +f_dialog_title "$msg_wireless_networks" +f_dialog_backtitle "${ipgm:+bsdconfig }$pgm" +f_mustberoot_init + +# +# Launch the wireless network menu +# +f_dialog_menu_wireless_edit + +################################################################################ +# END +################################################################################ Modified: head/usr.sbin/bsdconfig/share/media/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/share/media/Makefile Thu Jun 16 20:04:33 2016 (r301972) +++ head/usr.sbin/bsdconfig/share/media/Makefile Thu Jun 16 21:14:25 2016 (r301973) @@ -3,6 +3,6 @@ FILESDIR= ${SHAREDIR}/bsdconfig/media FILES= any.subr cdrom.subr common.subr directory.subr dos.subr \ floppy.subr ftp.subr http.subr httpproxy.subr network.subr \ - nfs.subr options.subr tcpip.subr ufs.subr usb.subr + nfs.subr options.subr tcpip.subr ufs.subr usb.subr wlan.subr .include Added: head/usr.sbin/bsdconfig/share/media/wlan.subr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/share/media/wlan.subr Thu Jun 16 21:14:25 2016 (r301973) @@ -0,0 +1,1392 @@ +if [ ! "$_MEDIA_WLAN_SUBR" ]; then _MEDIA_WLAN_SUBR=1 +# +# Copyright (c) 2013-2016 Devin Teske +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# +############################################################ INCLUDES + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_dprintf "%s: loading includes..." media/wlan.subr +f_include $BSDCFG_SHARE/device.subr +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/strings.subr +f_include $BSDCFG_SHARE/sysrc.subr + +BSDCFG_LIBE="/usr/libexec/bsdconfig" +f_include_lang $BSDCFG_LIBE/include/messages.subr + +############################################################ GLOBALS + +NWIRELESS_CONFIGS=0 +NWSCAN_RESULTS=0 + +# +# Settings used while interacting with various dialog(1) menus +# +: ${DIALOG_MENU_WLAN_SCAN_DURATION:=5} +: ${DIALOG_MENU_WLAN_SHOW_ALL=} +: ${DIALOG_MENU_WLAN_SHOW_CONFIGURED=1} +: ${DIALOG_MENU_WLAN_SHOW_SCAN_RESULTS=1} + +# +# Structure to contain the wpa_supplicant.conf(5) default overrides +# +f_struct_define WPA_DEFAULTS \ + ap_scan \ + ctrl_interface \ + ctrl_interface_group \ + eapol_version \ + fast_reauth + +# +# Structure of wpa_supplicant.conf(5) network={ ... } entry +# +f_struct_define WPA_NETWORK \ + anonymous_identity \ + auth_alg \ + bssid \ + ca_cert \ + ca_cert2 \ + client_cert \ + client_cert2 \ + dh_file \ + dh_file2 \ + eap \ + eap_workaround \ + eapol_flags \ + eappsk \ + engine \ + engine_id \ + frequency \ + group \ + identity \ + key_id \ + key_mgmt \ + mixed_cell \ + mode \ + nai \ + pac_file \ + pairwise \ + password \ + pcsc \ + phase1 \ + phase2 \ + pin \ + priority \ + private_key \ + private_key2 \ + private_key2_passwd \ + private_key_passwd \ + proto \ + psk \ + scan_ssid \ + server_nai \ + ssid \ + subject_match \ + subject_match2 \ + wep_key0 \ + wep_key1 \ + wep_key2 \ + wep_key3 \ + wpa_ptk_rekey \ + wep_tx_keyidx + +# +# The following properties are ``Lists'' and as such should not be quoted. +# Everything else should be quoted. +# +WPA_NETWORK_LIST_PROPERTIES=" + auth_algo + eap + group + key_mgmt + pairwise + proto +" # END-QUOTE + +# +# Structure of wpa_cli(8) `scan_results' entry +# +f_struct_define WPA_SCAN_RESULT \ + bssid \ + flags \ + freq \ + siglev \ + ssid + +# +# Structure of a menu item in the wireless editor +# +f_struct_define WLAN_MENU_ITEM \ + letter \ + ssid \ + nconfigs \ + nfound \ + help + +############################################################ FUNCTIONS + +# f_wpa_supplicant_init $file +# +# Initialize $file with basic contents of new wpa_supplicant.conf(5). +# +f_wpa_supplicant_init() +{ + local funcname=f_wpa_supplicant_init + local conf_file="$1" tmpfile + + # Create a temporary file + f_eval_catch -k tmpfile $funcname mktemp 'mktemp -t "%s"' "$pgm" || + return $FAILURE + + # Make it unreadable by anyone but ourselves + f_eval_catch $funcname chmod \ + 'chmod 0600 "%s"' "$tmpfile" || return $FAILURE + + # Make it owned by root/wheel + f_eval_catch $funcname chown \ + 'chown 0:0 "%s"' "$tmpfile" || return $FAILURE + + # Populate it + cat <<-EOF >> "$tmpfile" + ctrl_interface=/var/run/wpa_supplicant + eapol_version=2 + ap_scan=1 + fast_reauth=1 + EOF + echo >> "$tmpfile" + + # Move it into place + f_eval_catch $funcname mv 'mv "%s" "%s"' "$tmpfile" "$conf_file" +} + +# f_wpa_supplicant_parse $file [struct_prefix [count_var]] +# +# Parse wpa_supplicant.conf(5) $file. Default overrides are stored in a struct +# (see struct.subr for additional details) named `{struct_prefix}defaults'. See +# WPA_DEFAULTS struct definition in the GLOBALS section above. +# +# In addition, for each one of the wireless networks we parse from $file, +# create a struct named `struct_prefixN' where `N' is a number starting from 1 +# and ending in $count_var (zero means no networks). See WPA_NETWORK struct +# definition in the GLOBALS section above. +# +# If a `blob-base64-*={ ... }' entry appears, a struct named +# `{struct_prefix}blob_base64_*' is created and the `data' property holds the +# base64 encoded binary data without whitespace. +# +# Custom `*={ ... }' definitions are also supported, but should be unique +# (unlike the `network' definition). A struct named `{struct_prefix}*' is +# created if at least one property is defined in the block. +# +f_wpa_supplicant_parse() +{ + local file="$1" struct_prefix="$2" count_var="$3" + + [ "$count_var" ] && setvar "$count_var" 0 + + [ "$file" ] || file=$( f_sysrc_get wpa_supplicant_conf_file ) + if [ ! -e "$file" ]; then + f_dprintf "%s: No such file or directory" "$file" + return $FAILURE + fi + + local list_properties + f_replaceall "$WPA_NETWORK_LIST_PROPERTIES" "$NL" "" list_properties + eval "$( awk \ + -v count_var="$count_var" \ + -v struct_prefix="$struct_prefix" \ + -v list_properties="$list_properties" ' + BEGIN { + if (!count_var && !struct_prefix) exit + blob = count = custom_struct = network = 0 + split(list_properties, lists, FS) + } + function set_value(struct, prop, value) + { + quoted = substr(value, 0, 1) == "\"" + for (l in lists) if (list = prop == lists[l]) break + # Remove data after whitespace if unquoted and not a list + if (!quoted && !list) sub("[[:space:]].*", "", value) + # Otherwise if quoted and not a list, remove the quotes + # NB: wep_keyN needs to retain quoting if/when present + else if (quoted && !list && prop !~ /^wep_key[[:digit:]]+/) { + sub("^\"", "", value) + sub("\".*", "", value) + } + gsub(/'\''/, "'\''\\'\'\''", value) # Sanitize the value + if (!created[struct]) { + print "debug= f_struct_free", struct + print "debug= f_struct_new WPA_NETWORK", struct + created[struct] = 1 + } + printf "debug= %s set %s '\'%s\''\n", struct, prop, value + } + { + if ($1 ~ /^network={/) { + empty = 1 # We do not increment count unless !empty + network = 1 + next + } else if (match($1, "^blob-base64-[[:alnum:]_./-]+={")) { + blob = 1 + blob_data = "" + struct = struct_prefix "blob_bas64_" + struct = struct substr($1, 13, RLENGTH - 14) + next + } else if (match($1, "^[[:alnum:]_./-]+={")) { + empty = 1 + custom_struct = 1 + struct = struct_prefix substr($1, 0, RLENGTH - 2) + gsub(/[^[:alnum:]_]/, "_", struct) + next + } else if ($1 ~ /^}/) { + if (blob) { + gsub("[[:space:]]", "", blob_data) + set_value(struct, "data", blob_data) + } + blob = custom_struct = network = 0 + next + } else if (!match($0, /^[[:space:]]*[[:alnum:]_]+=/)) + next + + if (blob) { + blob_data = blob_data $0 + next + } else if (network) { + if (empty) { count++; empty = 0 } + struct = struct_prefix count + } else if (!custom_struct) + struct = struct_prefix "defaults" + + if (!struct_prefix) next + + prop = substr($0, 0, RLENGTH - 1) + sub(/^[[:space:]]*/, "", prop) + value = substr($0, RSTART + RLENGTH) + + set_value(struct, prop, value) + } + END { if (count_var) print count_var "=" count }' "$file" )" +} + +# f_wpa_scan_results_parse [struct_prefix [count_var]] +# +# Parse the results of wpa_cli(8) `scan_results' into a series of structs (see +# struct.subr for additional details) named `struct_prefixN' where `N' is a +# number starting from 1 and ending in $count_var (zero means no results). See +# WPA_SCAN_RESULT struct definition in the GLOBALS section above. +# +f_wpa_scan_results_parse() +{ + local struct_prefix="$1" count_var="$2" + + [ "$count_var" ] && setvar "$count_var" 0 + + eval "$( wpa_cli scan_results 2> /dev/null | awk \ + -v count_var="$count_var" \ + -v struct_prefix="$struct_prefix" ' + BEGIN { + if (!count_var && !struct_prefix) exit + count = 0 + seg = "[[:xdigit:]][[:xdigit:]]" + bssid = seg":"seg":"seg":"seg":"seg":"seg + freq = siglev = flags = "[^[:space:]]+" + S = "[[:space:]]+" + line = bssid S freq S siglev S flags + line = "^[[:space:]]*" line "[[:space:]]*" + } + function set_value(struct, prop, value) + { + gsub(/'\''/, "'\''\\'\'\''", value) # Sanitize the value + if (!created[struct]) { + print "debug= f_struct_free", struct + print "debug= f_struct_new WPA_SCAN_RESULT", struct + created[struct] = 1 + } + printf "debug= %s set %s '\'%s\''\n", struct, prop, value + } + { + if (!match($0, line)) next + ssid = substr($0, RLENGTH + 1) + + count++ + if (!struct_prefix) next + + struct = struct_prefix count + set_value(struct, "ssid", ssid) + set_value(struct, "bssid", $1) + set_value(struct, "freq", $2) + set_value(struct, "siglev", $3) + set_value(struct, "flags", $4) + } + END { if (count_var) print count_var "=" count }' )" +} + +# f_wpa_scan_match_network WPA_SCAN_RESULT WPA_NETWORK +# +# Compares a WPA_SCAN_RESULT struct to a WPA_NETWORK struct. If they appear to +# be a match returns success, otherwise failure. +# +f_wpa_scan_match_network() +{ + local scan_struct="$1" wireless_struct="$2" + local cp debug= + + f_struct "$scan_struct" || return $FAILURE + f_struct "$wireless_struct" || return $FAILURE + + local scan_ssid scan_bssid + $scan_struct get ssid scan_ssid + $scan_struct get bssid scan_bssid + local wireless_ssid wireless_bssid + $wireless_struct get ssid wireless_ssid + $wireless_struct get bssid wireless_bssid + + local id_matched= + if [ "$wireless_ssid" -a "$wireless_bssid" ]; then + # Must match both SSID and BSSID + [ "$scan_ssid" = "$wireless_ssid" -a \ + "$scan_bssid" = "$wireless_bssid" ] && id_matched=1 + elif [ "$wireless_ssid" ]; then + # Must match SSID only + [ "$scan_ssid" = "$wireless_ssid" ] && id_matched=1 + elif [ "$wireless_bssid" ]; then + # Must match BSSID only + [ "$scan_bssid" = "$wireless_bssid" ] && id_matched=1 + fi + [ "$id_matched" ] || return $FAILURE + + + # + # Get the scanned flags for the next few comparisons + # + local flags + $scan_struct get flags flags + + # + # Compare configured key management against scanned network + # + if $wireless_struct get key_mgmt cp && [ "$cp" -a "$cp" != "NONE" ] + then + local mgmt mgmt_matched= + for mgmt in $cp; do + local mgmt2="$mgmt" + [ "$mgmt" != "${mgmt#WPA-}" ] && + mgmt2="WPA2${mgmt#WPA}" + case "$flags" in + "$mgmt"|"$mgmt"-*|*-"$mgmt"|*-"$mgmt"-*) + mgmt_matched=1 break ;; + "$mgmt2"|"$mgmt2"-*|*-"$mgmt2"|*-"$mgmt2"-*) + mgmt_matched=1 break ;; + esac + done + [ "$mgmt_matched" ] || return $FAILURE + fi + + local enc type flag + + # + # Compare configured encryption against scanned network + # + for enc in psk:PSK eap:EAP \ + wep_key0:WEP wep_key1:WEP wep_key2:WEP wep_key3:WEP + do + type=${enc%%:*} + flag=${enc#*:} + { debug= $wireless_struct get $type cp && [ "$cp" ]; } || + continue + # Configured network requires encryption + case "$flags" in "[$flag]"|*"-$flag-"*) + break # Success; stop after first match + esac + return $FAILURE + done + cp="" # sensitive info + + # + # Compare scanned network encryption against configuration + # NB: Scanned network flags indicates _one_ of PSK EAP or WEP + # NB: Otherwise, no encryption (so encryption won't match) + # + local enc_wanted= + for enc in -PSK-:psk -EAP-:eap; do + flag=${enc%%:*} + type=${enc#*:} + case "$flags" in *"$flag"*) + enc_wanted=1 + { debug= $wireless_struct get $type cp && + [ "$cp" ]; } || return $FAILURE + break # success + esac + done + case "$flags" in *"[WEP]"*) + enc_wanted=1 + local wep_found= + for type in wep_key0 wep_key1 wep_key2 wep_key3; do + debug= $wireless_struct get $type cp && [ "$cp" ] && + wep_found=1 break + done + [ "$wep_found" ] || return $FAILURE + esac + if [ ! "$enc_wanted" ]; then + # No match if the network specifies encryption + for type in psk eap wep_key0 wep_key1 wep_key2 wep_key3; do + debug= $wireless_struct get $type cp && [ "$cp" ] && + return $FAILURE + done + fi + cp="" # sensitive info + + return $SUCCESS +} + +# f_wpa_scan_find_matches scans_prefix $scans_count \ +# wireless_prefix $wireless_count +# +# For each struct from `{scans_prefix}1' up to `{scans_prefix}$scans_count' +# (see struct.subr for additional details) compare the wireless network info +# (defined as struct WPA_SCAN_RESULT) to that of each configured wireless +# stored in `{wireless_prefix}1' (defined as struct WPA_NETWORK) up to +# `{wireless_prefix}$wireless_count'. +# +# If a scanned network is deemed to be a match to a configured wireless +# network, a new `match' property is set on the WPA_NETWORK struct with a value +# of `{scans_prefix}N' (where N represents the scanned network that matched). +# At the same time, a new `matched' property is set on the WPA_SCAN_RESULT +# struct with a value of 1, indicating that this network has been matched to a +# stored [known] configuration and that it should not be displayed in menus. +# +# NB: If a matching entry is not correct, the user can optionally `Forget' the +# network and that will cause the WPA_SCAN_RESULT to no longer match anything, +# causing it to appear in the menus again. +# +# Return status should be ignored. +# +f_wpa_scan_find_matches() +{ + local scans_prefix="$1" scans_count="$2" + local wireless_prefix="$3" wireless_count="$4" + local matches + + [ "$scans_count" -a "$wireless_count" ] || return $SUCCESS + f_isinteger "$scans_count" || return $FAILURE + f_isinteger "$wireless_count" || return $FAILURE + + # + # Go through and eradicate any flags we set in a prior run, as things + # might have changed on us (either from the config side or scan side) + # + local w=1 + while [ $w -le $wireless_count ]; do + f_struct "$wireless_prefix$w" set matches "" + w=$(( $w + 1 )) + done + + # + # Find matches and set match data on structs + # + local s=1 + while [ $s -le $scans_count ]; do + f_struct "$scans_prefix$s" set matched "" + w=1 + while [ $w -le $wireless_count ]; do + if f_wpa_scan_match_network \ + "$scans_prefix$s" "$wireless_prefix$w" + then + f_struct "$scans_prefix$s" set matched 1 + debug= f_struct "$wireless_prefix$w" \ + get matches matches + matches="$matches${matches:+ }$scans_prefix$s" + f_struct "$wireless_prefix$w" \ + set matches "$matches" + break # to next scan result + fi + w=$(( $w + 1 )) + done + s=$(( $s + 1 )) + done +} + +# f_dialog_menu_wlandev_edit $wlandev [$defaultitem] +# +# Display a list of wireless network devices (wlan*) associated with +# $wlandev (e.g., `iwn0'). Allow the user to create and destroy wlan interfaces +# while selecting ones to be cloned at startup (by setting `wlans_$wlandev'). +# +f_dialog_menu_wlandev_edit() +{ + local funcname=f_dialog_menu_wlandev_edit + local wlandev="$1" defaultitem="$2" + local title="$DIALOG_TITLE" + local btitle="$DIALOG_BACKTITLE" + local prompt # Calculated below + local hline="$hline_arrows_tab_enter" + + [ "$wlandev" ] || return $FAILURE + + f_sprintf prompt "$msg_select_wlan_interfaces_for" "wlandev" + + # + # Initially mark wlan devices with a %parent of $wlandev + # + local dev devs if list_to_save= + f_device_find "" $DEVICE_TYPE_NETWORK devs + for dev in $devs; do + f_struct "$dev" get name if || continue + case "$if" in wlan[0-9]*) + parent=$( sysctl -n net.wlan.${if#wlan}.%parent \ + 2> /dev/null ) + if [ "$parent" = "$if" ]; then + local _wlanmark_$if="X" + list_to_save="$list_to_save $if" + fi + esac + done + list_to_save="${list_to_save# }" + + # + # Operate in a loop so we can create/destroy interfaces from here + # + while :; do + # + # Refresh list of wlan interfaces + # + local wlanlist= + f_device_rescan_network + f_device_find "" $DEVICE_TYPE_NETWORK devs + for dev in $devs; do + f_struct "$dev" get name if || continue + case "$if" in wlan[0-9]*) + wlanlist="$wlanlist $if" + esac + done + + # + # Build menu list of wlan devices + # + local menu_list=" + '> $msg_save_exit' '$msg_return_to_previous_menu' + '> $msg_create_new' 'wlan' + '> $msg_destroy' '...' + " # END-QUOTE + local parent X + for if in $wlanlist; do + f_getvar _wlanmark_$if-" " X + menu_list="$menu_list '[$X] $if' '%parent: $parent'" + [ "$defaultitem" = "$if" ] && defaultitem="[$X] $if" + done + + # + # Ask user to make a choice + # + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$title\" \"\$btitle\" \"\$prompt\" \"\$hline\" \ + $menu_list + local menu_choice + menu_choice=$( eval $DIALOG \ + --title \"\$title\" \ + --backtitle \"\$btitle\" \ + --hline \"\$hline\" \ + --ok-label \"\$msg_select\" \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Jun 16 21:22:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53DC7A77CCF; Thu, 16 Jun 2016 21:22:28 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 083F11CBE; Thu, 16 Jun 2016 21:22:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5GLMRr0054904; Thu, 16 Jun 2016 21:22:27 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5GLMRwK054902; Thu, 16 Jun 2016 21:22:27 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201606162122.u5GLMRwK054902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 16 Jun 2016 21:22:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301974 - head/usr.bin/ar X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 21:22:28 -0000 Author: emaste Date: Thu Jun 16 21:22:26 2016 New Revision: 301974 URL: https://svnweb.freebsd.org/changeset/base/301974 Log: ar: enable reproducible output by default when invoked as 'ar -s' ar output is already deterministic by default for ar -q and ar -r, and when invoked as ranlib. Make ar -s equivalent to ranlib and enable deterministic output by default in that case too. PR: 210330 Reviewed by: bdrewery Approved by: re (gjb) MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6871 Modified: head/usr.bin/ar/ar.1 head/usr.bin/ar/ar.c Modified: head/usr.bin/ar/ar.1 ============================================================================== --- head/usr.bin/ar/ar.1 Thu Jun 16 21:14:25 2016 (r301973) +++ head/usr.bin/ar/ar.1 Thu Jun 16 21:22:26 2016 (r301974) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 24, 2015 +.Dd June 16, 2016 .Dt AR 1 .Os .Sh NAME @@ -205,7 +205,12 @@ When used in combination with the .Fl r or .Fl q -option, insert 0's instead of the real mtime, uid and gid values +option, +with the +.Fl s +option without other options, or when invoked as +.Nm ranlib , +insert 0's instead of the real mtime, uid and gid values and 0644 instead of file mode from the members named by arguments .Ar . This ensures that checksums on the resulting archives are reproducible Modified: head/usr.bin/ar/ar.c ============================================================================== --- head/usr.bin/ar/ar.c Thu Jun 16 21:14:25 2016 (r301973) +++ head/usr.bin/ar/ar.c Thu Jun 16 21:22:26 2016 (r301974) @@ -283,7 +283,8 @@ main(int argc, char **argv) } /* Set determinstic mode for -D, and by default without -U. */ - if (Dflag || (Uflag == 0 && (bsdar->mode == 'q' || bsdar->mode == 'r'))) + if (Dflag || (Uflag == 0 && (bsdar->mode == 'q' || bsdar->mode == 'r' || + (bsdar->mode == '\0' && bsdar->options & AR_S)))) bsdar->options |= AR_D; if (bsdar->options & AR_A) From owner-svn-src-all@freebsd.org Thu Jun 16 21:28:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79E51A77DB9; Thu, 16 Jun 2016 21:28:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 695F11F86; Thu, 16 Jun 2016 21:28:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 61F101C97; Thu, 16 Jun 2016 21:28:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 139D922426; Thu, 16 Jun 2016 21:28:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id fEo7Rc9SxT8Z; Thu, 16 Jun 2016 21:28:30 +0000 (UTC) Subject: Re: svn commit: r301973 - in head/usr.sbin/bsdconfig: include networking networking/include networking/share share/media DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com AF3F52241F To: Devin Teske , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201606162114.u5GLEPa6051162@repo.freebsd.org> From: Bryan Drewery Organization: FreeBSD Message-ID: <4a9ec3a9-5668-f35d-82fc-f936826841db@FreeBSD.org> Date: Thu, 16 Jun 2016 14:28:27 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <201606162114.u5GLEPa6051162@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 21:28:37 -0000 On 6/16/16 2:14 PM, Devin Teske wrote: > Author: dteske > Date: Thu Jun 16 21:14:25 2016 > New Revision: 301973 > URL: https://svnweb.freebsd.org/changeset/base/301973 > > Log: > Add bsdconfig `wifi' (aka `wireless' or `wlan') module > > Approved by: re (gjb) > MFC after: 8 weeks 8 weeks is about August 11. Presumably you think this change is not "stable" enough for the stable/10 branch (note that "stable" has different meanings there). releng/11.0 branch: July 29, 2016 ports/ release tag: August 12, 2016 RC3 build starts: August 12, 2016 [*] RELEASE build starts: August 19, 2016 [*] - If needed Looking at the planned schedule, you won't MFC it to stable/10 (which won't be released for a year?) until nearly the release of 11.0. My question is, does this really belong in head right now for 11.0 or should it wait until after the stable/11 branching? > Relnotes: yes -- Regards, Bryan Drewery From owner-svn-src-all@freebsd.org Fri Jun 17 00:00:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A465A77426; Fri, 17 Jun 2016 00:00:46 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 481A62CF7; Fri, 17 Jun 2016 00:00:46 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5H00j6X011057; Fri, 17 Jun 2016 00:00:45 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5H00jNA011056; Fri, 17 Jun 2016 00:00:45 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201606170000.u5H00jNA011056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 17 Jun 2016 00:00:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301975 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2016 00:00:46 -0000 Author: gjb Date: Fri Jun 17 00:00:45 2016 New Revision: 301975 URL: https://svnweb.freebsd.org/changeset/base/301975 Log: Update 11.0 to -ALPHA4 in preparation of a new set of snapshot builds. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Thu Jun 16 21:22:26 2016 (r301974) +++ head/sys/conf/newvers.sh Fri Jun 17 00:00:45 2016 (r301975) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="11.0" -BRANCH="ALPHA3" +BRANCH="ALPHA4" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Fri Jun 17 01:53:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76507A4751A; Fri, 17 Jun 2016 01:53:24 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67CA3220B; Fri, 17 Jun 2016 01:53:24 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from 50-196-156-133-static.hfc.comcastbusiness.net ([50.196.156.133]:19222 helo=[10.238.228.248]) by shxd.cx with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1bDiHt-000DfT-Nv; Thu, 16 Jun 2016 18:09:33 -0700 Message-ID: <1466124774.1392.54.camel@FreeBSD.org> Subject: Re: svn commit: r301973 - in head/usr.sbin/bsdconfig: include networking networking/include networking/share share/media From: Devin Teske To: Bryan Drewery , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Cc: dteske@freebsd.org Date: Thu, 16 Jun 2016 17:52:54 -0700 In-Reply-To: <4a9ec3a9-5668-f35d-82fc-f936826841db@FreeBSD.org> References: <201606162114.u5GLEPa6051162@repo.freebsd.org> <4a9ec3a9-5668-f35d-82fc-f936826841db@FreeBSD.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: devin@shxd.cx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2016 01:53:24 -0000 On Thu, 2016-06-16 at 14:28 -0700, Bryan Drewery wrote: > On 6/16/16 2:14 PM, Devin Teske wrote: > > Author: dteske > > Date: Thu Jun 16 21:14:25 2016 > > New Revision: 301973 > > URL: https://svnweb.freebsd.org/changeset/base/301973 > > > > Log: > > Add bsdconfig `wifi' (aka `wireless' or `wlan') module > > > > Approved by: re (gjb) > > MFC after: 8 weeks > > 8 weeks is about August 11. > > Presumably you think this change is not "stable" enough for the > stable/10 branch (note that "stable" has different meanings there). > > releng/11.0 branch: July 29, 2016 > ports/ release tag: August 12, 2016 > RC3 build starts: August 12, 2016 [*] > RELEASE build starts: August 19, 2016 > [*] - If needed > > Looking at the planned schedule, you won't MFC it to stable/10 (which > won't be released for a year?) until nearly the release of 11.0. My > question is, does this really belong in head right now for 11.0 or > should it wait until after the stable/11 branching? > > > > Relnotes: yes > > I may never MFC it. The 8 weeks is to remind me to re-think that when I get the reminder from sobomax. It actually cannot be MFC'd without changes. There are some very slight minor differences in 10 and 11. The 8 weeks should not reflect how stable the code is or not, but rather that is a time when I predict I might have the time/energy to integrate it into the older branch(es). -- Devin From owner-svn-src-all@freebsd.org Fri Jun 17 02:29:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BB6CA47A67; Fri, 17 Jun 2016 02:29:57 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E53372D57; Fri, 17 Jun 2016 02:29:56 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5H2TuLZ066899; Fri, 17 Jun 2016 02:29:56 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5H2Tu2F066897; Fri, 17 Jun 2016 02:29:56 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606170229.u5H2Tu2F066897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 17 Jun 2016 02:29:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301976 - in stable/10/contrib/gcclibs: include libiberty X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2016 02:29:57 -0000 Author: pfg Date: Fri Jun 17 02:29:55 2016 New Revision: 301976 URL: https://svnweb.freebsd.org/changeset/base/301976 Log: MFC r301291: libiberty: prevent integer overflow. Take care of very old bug leading to heap-buffer overflow by processing certain file headers via bfd binary. PR: 200888 Obtained from: OpenBSD Modified: stable/10/contrib/gcclibs/include/objalloc.h stable/10/contrib/gcclibs/libiberty/objalloc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/gcclibs/include/objalloc.h ============================================================================== --- stable/10/contrib/gcclibs/include/objalloc.h Fri Jun 17 00:00:45 2016 (r301975) +++ stable/10/contrib/gcclibs/include/objalloc.h Fri Jun 17 02:29:55 2016 (r301976) @@ -1,5 +1,5 @@ /* objalloc.h -- routines to allocate memory for objects - Copyright 1997, 2001 Free Software Foundation, Inc. + Copyright 1997, 2001-2012 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Solutions. This program is free software; you can redistribute it and/or modify it @@ -91,7 +91,7 @@ extern void *_objalloc_alloc (struct obj if (__len == 0) \ __len = 1; \ __len = (__len + OBJALLOC_ALIGN - 1) &~ (OBJALLOC_ALIGN - 1); \ - (__len <= __o->current_space \ + (__len != 0 && __len <= __o->current_space \ ? (__o->current_ptr += __len, \ __o->current_space -= __len, \ (void *) (__o->current_ptr - __len)) \ Modified: stable/10/contrib/gcclibs/libiberty/objalloc.c ============================================================================== --- stable/10/contrib/gcclibs/libiberty/objalloc.c Fri Jun 17 00:00:45 2016 (r301975) +++ stable/10/contrib/gcclibs/libiberty/objalloc.c Fri Jun 17 02:29:55 2016 (r301976) @@ -1,5 +1,5 @@ /* objalloc.c -- routines to allocate memory for objects - Copyright 1997 Free Software Foundation, Inc. + Copyright 1997-2012 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Solutions. This program is free software; you can redistribute it and/or modify it @@ -112,8 +112,10 @@ objalloc_create (void) /* Allocate space from an objalloc structure. */ PTR -_objalloc_alloc (struct objalloc *o, unsigned long len) +_objalloc_alloc (struct objalloc *o, unsigned long original_len) { + unsigned long len = original_len; + /* We avoid confusion from zero sized objects by always allocating at least 1 byte. */ if (len == 0) @@ -121,6 +123,11 @@ _objalloc_alloc (struct objalloc *o, uns len = (len + OBJALLOC_ALIGN - 1) &~ (OBJALLOC_ALIGN - 1); + /* CVE-2012-3509: Check for overflow in the alignment operation above + * and then malloc argument below. */ + if (len + CHUNK_HEADER_SIZE < original_len) + return NULL; + if (len <= o->current_space) { o->current_ptr += len; From owner-svn-src-all@freebsd.org Fri Jun 17 02:31:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EABBA47BD1; Fri, 17 Jun 2016 02:31:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D72D92F3F; Fri, 17 Jun 2016 02:31:19 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5H2VJ6D069652; Fri, 17 Jun 2016 02:31:19 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5H2VIvP069650; Fri, 17 Jun 2016 02:31:18 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201606170231.u5H2VIvP069650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 17 Jun 2016 02:31:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r301977 - in stable/9/contrib/gcclibs: include libiberty X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2016 02:31:20 -0000 Author: pfg Date: Fri Jun 17 02:31:18 2016 New Revision: 301977 URL: https://svnweb.freebsd.org/changeset/base/301977 Log: MFC r301291: libiberty: prevent integer overflow. Take care of very old bug leading to heap-buffer overflow by processing certain file headers via bfd binary. PR: 200888 Obtained from: OpenBSD Modified: stable/9/contrib/gcclibs/include/objalloc.h stable/9/contrib/gcclibs/libiberty/objalloc.c Directory Properties: stable/9/contrib/gcclibs/ (props changed) Modified: stable/9/contrib/gcclibs/include/objalloc.h ============================================================================== --- stable/9/contrib/gcclibs/include/objalloc.h Fri Jun 17 02:29:55 2016 (r301976) +++ stable/9/contrib/gcclibs/include/objalloc.h Fri Jun 17 02:31:18 2016 (r301977) @@ -1,5 +1,5 @@ /* objalloc.h -- routines to allocate memory for objects - Copyright 1997, 2001 Free Software Foundation, Inc. + Copyright 1997, 2001-2012 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Solutions. This program is free software; you can redistribute it and/or modify it @@ -91,7 +91,7 @@ extern void *_objalloc_alloc (struct obj if (__len == 0) \ __len = 1; \ __len = (__len + OBJALLOC_ALIGN - 1) &~ (OBJALLOC_ALIGN - 1); \ - (__len <= __o->current_space \ + (__len != 0 && __len <= __o->current_space \ ? (__o->current_ptr += __len, \ __o->current_space -= __len, \ (void *) (__o->current_ptr - __len)) \ Modified: stable/9/contrib/gcclibs/libiberty/objalloc.c ============================================================================== --- stable/9/contrib/gcclibs/libiberty/objalloc.c Fri Jun 17 02:29:55 2016 (r301976) +++ stable/9/contrib/gcclibs/libiberty/objalloc.c Fri Jun 17 02:31:18 2016 (r301977) @@ -1,5 +1,5 @@ /* objalloc.c -- routines to allocate memory for objects - Copyright 1997 Free Software Foundation, Inc. + Copyright 1997-2012 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Solutions. This program is free software; you can redistribute it and/or modify it @@ -112,8 +112,10 @@ objalloc_create (void) /* Allocate space from an objalloc structure. */ PTR -_objalloc_alloc (struct objalloc *o, unsigned long len) +_objalloc_alloc (struct objalloc *o, unsigned long original_len) { + unsigned long len = original_len; + /* We avoid confusion from zero sized objects by always allocating at least 1 byte. */ if (len == 0) @@ -121,6 +123,11 @@ _objalloc_alloc (struct objalloc *o, uns len = (len + OBJALLOC_ALIGN - 1) &~ (OBJALLOC_ALIGN - 1); + /* CVE-2012-3509: Check for overflow in the alignment operation above + * and then malloc argument below. */ + if (len + CHUNK_HEADER_SIZE < original_len) + return NULL; + if (len <= o->current_space) { o->current_ptr += len; From owner-svn-src-all@freebsd.org Fri Jun 17 02:48:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96B5FA77038; Fri, 17 Jun 2016 02:48:58 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 656211A2E; Fri, 17 Jun 2016 02:48:58 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5H2mvbu074227; Fri, 17 Jun 2016 02:48:57 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5H2mvb4074226; Fri, 17 Jun 2016 02:48:57 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201606170248.u5H2mvb4074226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 17 Jun 2016 02:48:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301978 - stable/10/contrib/ipfilter/man X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2016 02:48:58 -0000 Author: cy Date: Fri Jun 17 02:48:57 2016 New Revision: 301978 URL: https://svnweb.freebsd.org/changeset/base/301978 Log: MFC r301773 & r301775: Clarify the wording to be more accurate. Modified: stable/10/contrib/ipfilter/man/ipf.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/ipfilter/man/ipf.8 ============================================================================== --- stable/10/contrib/ipfilter/man/ipf.8 Fri Jun 17 02:31:18 2016 (r301977) +++ stable/10/contrib/ipfilter/man/ipf.8 Fri Jun 17 02:48:57 2016 (r301978) @@ -35,7 +35,10 @@ which they appear when given to \fBipf\f .SH OPTIONS .TP .B \-6 -This option is required to parse IPv6 rules and to have them loaded. +IPv4 and IPv6 rules are stored in a single table and can be read from a +single file. This option is no longer required to load IPv6 rules. This +option is ignored when specified with the -F option and the -F option +will flush IPv4 rules even if this option is specified. .TP .B \-A Set the list to make changes to the active list (default). From owner-svn-src-all@freebsd.org Fri Jun 17 06:13:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4D4EA78605; Fri, 17 Jun 2016 06:13:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F44E12CB; Fri, 17 Jun 2016 06:13:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u5H6D7sD052353 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 17 Jun 2016 09:13:07 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u5H6D7sD052353 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u5H6D6WC052352; Fri, 17 Jun 2016 09:13:06 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 17 Jun 2016 09:13:06 +0300 From: Konstantin Belousov To: Conrad Meyer Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301959 - head/sys/kern Message-ID: <20160617061306.GS38613@kib.kiev.ua> References: <201606161158.u5GBwkd1042632@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2016 06:13:17 -0000 On Thu, Jun 16, 2016 at 10:17:19AM -0700, Conrad Meyer wrote: > style(9) nit: /* FALLTHROUGH */ FALLTHROUGH is only applicable when there are executable statements for both cases, and first sequence of statements does not end in break. Look at the switch() example right after the FALLTHROUGH requirement in the style(9), which shows case '?'. From owner-svn-src-all@freebsd.org Fri Jun 17 08:54:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1EFEA78BF1; Fri, 17 Jun 2016 08:54:44 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B5462BA9; Fri, 17 Jun 2016 08:54:44 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5H8shYV010906; Fri, 17 Jun 2016 08:54:43 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5H8shDv010905; Fri, 17 Jun 2016 08:54:43 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201606170854.u5H8shDv010905@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 17 Jun 2016 08:54:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301979 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2016 08:54:44 -0000 Author: arybchik Date: Fri Jun 17 08:54:43 2016 New Revision: 301979 URL: https://svnweb.freebsd.org/changeset/base/301979 Log: MFC r301061 sfxge(4): regenerate MCDI headers from firmwaresrc .yml Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/efx_regs_mcdi.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx_regs_mcdi.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_regs_mcdi.h Fri Jun 17 02:48:57 2016 (r301978) +++ stable/10/sys/dev/sfxge/common/efx_regs_mcdi.h Fri Jun 17 08:54:43 2016 (r301979) @@ -5115,16 +5115,20 @@ #define MC_CMD_POLL_BIST_MEM_BUS_MC 0x0 /* enum: CSR IREG bus. */ #define MC_CMD_POLL_BIST_MEM_BUS_CSR 0x1 -/* enum: RX DPCPU bus. */ +/* enum: RX0 DPCPU bus. */ #define MC_CMD_POLL_BIST_MEM_BUS_DPCPU_RX 0x2 /* enum: TX0 DPCPU bus. */ #define MC_CMD_POLL_BIST_MEM_BUS_DPCPU_TX0 0x3 /* enum: TX1 DPCPU bus. */ #define MC_CMD_POLL_BIST_MEM_BUS_DPCPU_TX1 0x4 -/* enum: RX DICPU bus. */ +/* enum: RX0 DICPU bus. */ #define MC_CMD_POLL_BIST_MEM_BUS_DICPU_RX 0x5 /* enum: TX DICPU bus. */ #define MC_CMD_POLL_BIST_MEM_BUS_DICPU_TX 0x6 +/* enum: RX1 DPCPU bus. */ +#define MC_CMD_POLL_BIST_MEM_BUS_DPCPU_RX1 0x7 +/* enum: RX1 DICPU bus. */ +#define MC_CMD_POLL_BIST_MEM_BUS_DICPU_RX1 0x8 /* Pattern written to RAM / register */ #define MC_CMD_POLL_BIST_OUT_MEM_EXPECT_OFST 16 /* Actual value read from RAM / register */ @@ -6094,6 +6098,8 @@ #define MC_CMD_NVRAM_INFO_OUT_PROTECTED_WIDTH 1 #define MC_CMD_NVRAM_INFO_OUT_TLV_LBN 1 #define MC_CMD_NVRAM_INFO_OUT_TLV_WIDTH 1 +#define MC_CMD_NVRAM_INFO_OUT_CMAC_LBN 6 +#define MC_CMD_NVRAM_INFO_OUT_CMAC_WIDTH 1 #define MC_CMD_NVRAM_INFO_OUT_A_B_LBN 7 #define MC_CMD_NVRAM_INFO_OUT_A_B_WIDTH 1 #define MC_CMD_NVRAM_INFO_OUT_PHYSDEV_OFST 16 @@ -6887,6 +6893,8 @@ * the command will fail with MC_CMD_ERR_FILTERS_PRESENT. */ #define MC_CMD_WORKAROUND_BUG26807 0x6 +/* enum: Bug 61265 work around (broken EVQ TMR writes). */ +#define MC_CMD_WORKAROUND_BUG61265 0x7 /* 0 = disable the workaround indicated by TYPE; any non-zero value = enable * the workaround */ @@ -7865,8 +7873,10 @@ #define NVRAM_PARTITION_TYPE_SPARE_1 0x1100 /* enum: Spare partition 2 */ #define NVRAM_PARTITION_TYPE_SPARE_2 0x1200 -/* enum: Spare partition 3 */ -#define NVRAM_PARTITION_TYPE_SPARE_3 0x1300 +/* enum: Manufacturing partition. Used during manufacture to pass information + * between XJTAG and Manftest. + */ +#define NVRAM_PARTITION_TYPE_MANUFACTURING 0x1300 /* enum: Spare partition 4 */ #define NVRAM_PARTITION_TYPE_SPARE_4 0x1400 /* enum: Spare partition 5 */ @@ -7901,6 +7911,8 @@ #define LICENSED_APP_ID_CAPTURE_SOLARSYSTEM 0x40 /* enum: Network Access Control */ #define LICENSED_APP_ID_NETWORK_ACCESS_CONTROL 0x80 +/* enum: TCP Direct */ +#define LICENSED_APP_ID_TCP_DIRECT 0x100 #define LICENSED_APP_ID_ID_LBN 0 #define LICENSED_APP_ID_ID_WIDTH 32 @@ -7957,6 +7969,12 @@ #define LICENSED_V3_APPS_CAPTURE_SOLARSYSTEM_WIDTH 1 #define LICENSED_V3_APPS_NETWORK_ACCESS_CONTROL_LBN 7 #define LICENSED_V3_APPS_NETWORK_ACCESS_CONTROL_WIDTH 1 +#define LICENSED_V3_APPS_TCP_DIRECT_LBN 8 +#define LICENSED_V3_APPS_TCP_DIRECT_WIDTH 1 +#define LICENSED_V3_APPS_LOW_LATENCY_LBN 9 +#define LICENSED_V3_APPS_LOW_LATENCY_WIDTH 1 +#define LICENSED_V3_APPS_SOLARCAPTURE_TAP_LBN 10 +#define LICENSED_V3_APPS_SOLARCAPTURE_TAP_WIDTH 1 #define LICENSED_V3_APPS_MASK_LBN 0 #define LICENSED_V3_APPS_MASK_WIDTH 64 @@ -7985,6 +8003,8 @@ #define LICENSED_V3_FEATURES_TX_SNIFF_WIDTH 1 #define LICENSED_V3_FEATURES_PROXY_FILTER_OPS_LBN 8 #define LICENSED_V3_FEATURES_PROXY_FILTER_OPS_WIDTH 1 +#define LICENSED_V3_FEATURES_EVENT_CUT_THROUGH_LBN 9 +#define LICENSED_V3_FEATURES_EVENT_CUT_THROUGH_WIDTH 1 #define LICENSED_V3_FEATURES_MASK_LBN 0 #define LICENSED_V3_FEATURES_MASK_WIDTH 64 @@ -8142,6 +8162,109 @@ /* Only valid if INTRFLAG was true */ #define MC_CMD_INIT_EVQ_OUT_IRQ_OFST 0 +/* MC_CMD_INIT_EVQ_V2_IN msgrequest */ +#define MC_CMD_INIT_EVQ_V2_IN_LENMIN 44 +#define MC_CMD_INIT_EVQ_V2_IN_LENMAX 548 +#define MC_CMD_INIT_EVQ_V2_IN_LEN(num) (36+8*(num)) +/* Size, in entries */ +#define MC_CMD_INIT_EVQ_V2_IN_SIZE_OFST 0 +/* Desired instance. Must be set to a specific instance, which is a function + * local queue index. + */ +#define MC_CMD_INIT_EVQ_V2_IN_INSTANCE_OFST 4 +/* The initial timer value. The load value is ignored if the timer mode is DIS. + */ +#define MC_CMD_INIT_EVQ_V2_IN_TMR_LOAD_OFST 8 +/* The reload value is ignored in one-shot modes */ +#define MC_CMD_INIT_EVQ_V2_IN_TMR_RELOAD_OFST 12 +/* tbd */ +#define MC_CMD_INIT_EVQ_V2_IN_FLAGS_OFST 16 +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_INTERRUPTING_LBN 0 +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_INTERRUPTING_WIDTH 1 +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_RPTR_DOS_LBN 1 +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_RPTR_DOS_WIDTH 1 +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_INT_ARMD_LBN 2 +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_INT_ARMD_WIDTH 1 +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_CUT_THRU_LBN 3 +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_CUT_THRU_WIDTH 1 +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_RX_MERGE_LBN 4 +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_RX_MERGE_WIDTH 1 +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_TX_MERGE_LBN 5 +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_TX_MERGE_WIDTH 1 +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_USE_TIMER_LBN 6 +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_USE_TIMER_WIDTH 1 +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_LBN 7 +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_WIDTH 4 +/* enum: All initialisation flags specified by host. */ +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_MANUAL 0x0 +/* enum: MEDFORD only. Certain initialisation flags specified by host may be + * over-ridden by firmware based on licenses and firmware variant in order to + * provide the lowest latency achievable. See + * MC_CMD_INIT_EVQ_V2/MC_CMD_INIT_EVQ_V2_OUT/FLAGS for list of affected flags. + */ +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_LOW_LATENCY 0x1 +/* enum: MEDFORD only. Certain initialisation flags specified by host may be + * over-ridden by firmware based on licenses and firmware variant in order to + * provide the best throughput achievable. See + * MC_CMD_INIT_EVQ_V2/MC_CMD_INIT_EVQ_V2_OUT/FLAGS for list of affected flags. + */ +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_THROUGHPUT 0x2 +/* enum: MEDFORD only. Certain initialisation flags may be over-ridden by + * firmware based on licenses and firmware variant. See + * MC_CMD_INIT_EVQ_V2/MC_CMD_INIT_EVQ_V2_OUT/FLAGS for list of affected flags. + */ +#define MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_AUTO 0x3 +#define MC_CMD_INIT_EVQ_V2_IN_TMR_MODE_OFST 20 +/* enum: Disabled */ +#define MC_CMD_INIT_EVQ_V2_IN_TMR_MODE_DIS 0x0 +/* enum: Immediate */ +#define MC_CMD_INIT_EVQ_V2_IN_TMR_IMMED_START 0x1 +/* enum: Triggered */ +#define MC_CMD_INIT_EVQ_V2_IN_TMR_TRIG_START 0x2 +/* enum: Hold-off */ +#define MC_CMD_INIT_EVQ_V2_IN_TMR_INT_HLDOFF 0x3 +/* Target EVQ for wakeups if in wakeup mode. */ +#define MC_CMD_INIT_EVQ_V2_IN_TARGET_EVQ_OFST 24 +/* Target interrupt if in interrupting mode (note union with target EVQ). Use + * MC_CMD_RESOURCE_INSTANCE_ANY unless a specific one required for test + * purposes. + */ +#define MC_CMD_INIT_EVQ_V2_IN_IRQ_NUM_OFST 24 +/* Event Counter Mode. */ +#define MC_CMD_INIT_EVQ_V2_IN_COUNT_MODE_OFST 28 +/* enum: Disabled */ +#define MC_CMD_INIT_EVQ_V2_IN_COUNT_MODE_DIS 0x0 +/* enum: Disabled */ +#define MC_CMD_INIT_EVQ_V2_IN_COUNT_MODE_RX 0x1 +/* enum: Disabled */ +#define MC_CMD_INIT_EVQ_V2_IN_COUNT_MODE_TX 0x2 +/* enum: Disabled */ +#define MC_CMD_INIT_EVQ_V2_IN_COUNT_MODE_RXTX 0x3 +/* Event queue packet count threshold. */ +#define MC_CMD_INIT_EVQ_V2_IN_COUNT_THRSHLD_OFST 32 +/* 64-bit address of 4k of 4k-aligned host memory buffer */ +#define MC_CMD_INIT_EVQ_V2_IN_DMA_ADDR_OFST 36 +#define MC_CMD_INIT_EVQ_V2_IN_DMA_ADDR_LEN 8 +#define MC_CMD_INIT_EVQ_V2_IN_DMA_ADDR_LO_OFST 36 +#define MC_CMD_INIT_EVQ_V2_IN_DMA_ADDR_HI_OFST 40 +#define MC_CMD_INIT_EVQ_V2_IN_DMA_ADDR_MINNUM 1 +#define MC_CMD_INIT_EVQ_V2_IN_DMA_ADDR_MAXNUM 64 + +/* MC_CMD_INIT_EVQ_V2_OUT msgresponse */ +#define MC_CMD_INIT_EVQ_V2_OUT_LEN 8 +/* Only valid if INTRFLAG was true */ +#define MC_CMD_INIT_EVQ_V2_OUT_IRQ_OFST 0 +/* Actual configuration applied on the card */ +#define MC_CMD_INIT_EVQ_V2_OUT_FLAGS_OFST 4 +#define MC_CMD_INIT_EVQ_V2_OUT_FLAG_CUT_THRU_LBN 0 +#define MC_CMD_INIT_EVQ_V2_OUT_FLAG_CUT_THRU_WIDTH 1 +#define MC_CMD_INIT_EVQ_V2_OUT_FLAG_RX_MERGE_LBN 1 +#define MC_CMD_INIT_EVQ_V2_OUT_FLAG_RX_MERGE_WIDTH 1 +#define MC_CMD_INIT_EVQ_V2_OUT_FLAG_TX_MERGE_LBN 2 +#define MC_CMD_INIT_EVQ_V2_OUT_FLAG_TX_MERGE_WIDTH 1 +#define MC_CMD_INIT_EVQ_V2_OUT_FLAG_RXQ_FORCE_EV_MERGING_LBN 3 +#define MC_CMD_INIT_EVQ_V2_OUT_FLAG_RXQ_FORCE_EV_MERGING_WIDTH 1 + /* QUEUE_CRC_MODE structuredef */ #define QUEUE_CRC_MODE_LEN 1 #define QUEUE_CRC_MODE_MODE_LBN 0 @@ -8206,8 +8329,8 @@ #define MC_CMD_INIT_RXQ_IN_FLAG_PREFIX_WIDTH 1 #define MC_CMD_INIT_RXQ_IN_FLAG_DISABLE_SCATTER_LBN 9 #define MC_CMD_INIT_RXQ_IN_FLAG_DISABLE_SCATTER_WIDTH 1 -#define MC_CMD_INIT_RXQ_IN_FLAG_FORCE_EV_MERGING_LBN 10 -#define MC_CMD_INIT_RXQ_IN_FLAG_FORCE_EV_MERGING_WIDTH 1 +#define MC_CMD_INIT_RXQ_IN_UNUSED_LBN 10 +#define MC_CMD_INIT_RXQ_IN_UNUSED_WIDTH 1 /* Owner ID to use if in buffer mode (zero if physical) */ #define MC_CMD_INIT_RXQ_IN_OWNER_ID_OFST 20 /* The port ID associated with the v-adaptor which should contain this DMAQ. */ @@ -10427,6 +10550,12 @@ #define MC_CMD_GET_CAPABILITIES_V2_OUT_EVENT_CUT_THROUGH_WIDTH 1 #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_CUT_THROUGH_LBN 4 #define MC_CMD_GET_CAPABILITIES_V2_OUT_RX_CUT_THROUGH_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_VFIFO_ULL_MODE_LBN 5 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_TX_VFIFO_ULL_MODE_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_MAC_STATS_40G_TX_SIZE_BINS_LBN 6 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_MAC_STATS_40G_TX_SIZE_BINS_WIDTH 1 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_INIT_EVQ_V2_LBN 7 +#define MC_CMD_GET_CAPABILITIES_V2_OUT_INIT_EVQ_V2_WIDTH 1 /* Number of FATSOv2 contexts per datapath supported by this NIC. Not present * on older firmware (check the length). */ @@ -13013,29 +13142,39 @@ #define MC_CMD_0xd4_PRIVILEGE_CTG SRIOV_CTG_GENERAL /* MC_CMD_LICENSED_V3_VALIDATE_APP_IN msgrequest */ -#define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_LEN 72 +#define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_LEN 62 +/* challenge for validation (384 bits) */ +#define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_CHALLENGE_OFST 0 +#define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_CHALLENGE_LEN 48 /* application ID expressed as a single bit mask */ -#define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_APP_ID_OFST 0 +#define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_APP_ID_OFST 48 #define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_APP_ID_LEN 8 -#define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_APP_ID_LO_OFST 0 -#define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_APP_ID_HI_OFST 4 -/* challenge for validation */ -#define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_CHALLENGE_OFST 8 -#define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_CHALLENGE_LEN 64 +#define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_APP_ID_LO_OFST 48 +#define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_APP_ID_HI_OFST 52 +/* MAC address of the calling client MC_CMD_ERR_EPERM is returned if the + * calling client is not allowed to use this MAC address. + */ +#define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_MACADDR_OFST 56 +#define MC_CMD_LICENSED_V3_VALIDATE_APP_IN_MACADDR_LEN 6 /* MC_CMD_LICENSED_V3_VALIDATE_APP_OUT msgresponse */ -#define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_LEN 72 +#define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_LEN 104 +/* validation response to challenge in the form of ECDSA signature consisting + * of two 384-bit integers, r and s, in big-endian order. The signature signs a + * SHA-384 digest of a message constructed from the concatenation of the input + * message and the remaining fields of this output message, e.g. challenge[48 + * bytes] ... expiry_time[4 bytes] ... + */ +#define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_RESPONSE_OFST 0 +#define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_RESPONSE_LEN 96 /* application expiry time */ -#define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_EXPIRY_TIME_OFST 0 +#define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_EXPIRY_TIME_OFST 96 /* application expiry units */ -#define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_EXPIRY_UNITS_OFST 4 +#define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_EXPIRY_UNITS_OFST 100 /* enum: expiry units are accounting units */ #define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_EXPIRY_UNIT_ACC 0x0 /* enum: expiry units are calendar days */ #define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_EXPIRY_UNIT_DAYS 0x1 -/* validation response to challenge */ -#define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_RESPONSE_OFST 8 -#define MC_CMD_LICENSED_V3_VALIDATE_APP_OUT_RESPONSE_LEN 64 /***********************************/ @@ -13066,6 +13205,71 @@ /***********************************/ +/* MC_CMD_LICENSING_V3_TEMPORARY + * Perform operations to support installation of a single temporary license in + * the adapter, in addition to those found in the licensing partition. See + * SF-116124-SW for an overview of how this could be used. The license is + * stored in MC persistent data and so will survive a MC reboot, but will be + * erased when the adapter is power cycled + */ +#define MC_CMD_LICENSING_V3_TEMPORARY 0xd6 +#undef MC_CMD_0xd6_PRIVILEGE_CTG + +#define MC_CMD_0xd6_PRIVILEGE_CTG SRIOV_CTG_GENERAL + +/* MC_CMD_LICENSING_V3_TEMPORARY_IN msgrequest */ +#define MC_CMD_LICENSING_V3_TEMPORARY_IN_LEN 4 +/* operation code */ +#define MC_CMD_LICENSING_V3_TEMPORARY_IN_OP_OFST 0 +/* enum: install a new license, overwriting any existing temporary license. + * This is an asynchronous operation owing to the time taken to validate an + * ECDSA license + */ +#define MC_CMD_LICENSING_V3_TEMPORARY_SET 0x0 +/* enum: clear the license immediately rather than waiting for the next power + * cycle + */ +#define MC_CMD_LICENSING_V3_TEMPORARY_CLEAR 0x1 +/* enum: get the status of the asynchronous MC_CMD_LICENSING_V3_TEMPORARY_SET + * operation + */ +#define MC_CMD_LICENSING_V3_TEMPORARY_STATUS 0x2 + +/* MC_CMD_LICENSING_V3_TEMPORARY_IN_SET msgrequest */ +#define MC_CMD_LICENSING_V3_TEMPORARY_IN_SET_LEN 164 +#define MC_CMD_LICENSING_V3_TEMPORARY_IN_SET_OP_OFST 0 +/* ECDSA license and signature */ +#define MC_CMD_LICENSING_V3_TEMPORARY_IN_SET_LICENSE_OFST 4 +#define MC_CMD_LICENSING_V3_TEMPORARY_IN_SET_LICENSE_LEN 160 + +/* MC_CMD_LICENSING_V3_TEMPORARY_IN_CLEAR msgrequest */ +#define MC_CMD_LICENSING_V3_TEMPORARY_IN_CLEAR_LEN 4 +#define MC_CMD_LICENSING_V3_TEMPORARY_IN_CLEAR_OP_OFST 0 + +/* MC_CMD_LICENSING_V3_TEMPORARY_IN_STATUS msgrequest */ +#define MC_CMD_LICENSING_V3_TEMPORARY_IN_STATUS_LEN 4 +#define MC_CMD_LICENSING_V3_TEMPORARY_IN_STATUS_OP_OFST 0 + +/* MC_CMD_LICENSING_V3_TEMPORARY_OUT_STATUS msgresponse */ +#define MC_CMD_LICENSING_V3_TEMPORARY_OUT_STATUS_LEN 12 +/* status code */ +#define MC_CMD_LICENSING_V3_TEMPORARY_OUT_STATUS_STATUS_OFST 0 +/* enum: finished validating and installing license */ +#define MC_CMD_LICENSING_V3_TEMPORARY_STATUS_OK 0x0 +/* enum: license validation and installation in progress */ +#define MC_CMD_LICENSING_V3_TEMPORARY_STATUS_IN_PROGRESS 0x1 +/* enum: licensing error. More specific error messages are not provided to + * avoid exposing details of the licensing system to the client + */ +#define MC_CMD_LICENSING_V3_TEMPORARY_STATUS_ERROR 0x2 +/* bitmask of licensed features */ +#define MC_CMD_LICENSING_V3_TEMPORARY_OUT_STATUS_LICENSED_FEATURES_OFST 4 +#define MC_CMD_LICENSING_V3_TEMPORARY_OUT_STATUS_LICENSED_FEATURES_LEN 8 +#define MC_CMD_LICENSING_V3_TEMPORARY_OUT_STATUS_LICENSED_FEATURES_LO_OFST 4 +#define MC_CMD_LICENSING_V3_TEMPORARY_OUT_STATUS_LICENSED_FEATURES_HI_OFST 8 + + +/***********************************/ /* MC_CMD_SET_PORT_SNIFF_CONFIG * Configure RX port sniffing for the physical port associated with the calling * function. Only a privileged function may change the port sniffing @@ -13414,6 +13618,8 @@ #define MC_CMD_GET_WORKAROUNDS_OUT_BUG42008 0x20 /* enum: Bug 26807 features present in firmware (multicast filter chaining) */ #define MC_CMD_GET_WORKAROUNDS_OUT_BUG26807 0x40 +/* enum: Bug 61265 work around (broken EVQ TMR writes). */ +#define MC_CMD_GET_WORKAROUNDS_OUT_BUG61265 0x80 /***********************************/ @@ -14342,19 +14548,15 @@ #define MC_CMD_0x118_PRIVILEGE_CTG SRIOV_CTG_ADMIN /* MC_CMD_RX_BALANCING_IN msgrequest */ -#define MC_CMD_RX_BALANCING_IN_LEN 4 +#define MC_CMD_RX_BALANCING_IN_LEN 16 /* The RX port whose upconverter table will be modified */ #define MC_CMD_RX_BALANCING_IN_PORT_OFST 0 -#define MC_CMD_RX_BALANCING_IN_PORT_LEN 1 /* The VLAN priority associated to the table index and vFIFO */ -#define MC_CMD_RX_BALANCING_IN_PRIORITY_OFST 1 -#define MC_CMD_RX_BALANCING_IN_PRIORITY_LEN 1 +#define MC_CMD_RX_BALANCING_IN_PRIORITY_OFST 4 /* The resulting bit of SRC^DST for indexing the table */ -#define MC_CMD_RX_BALANCING_IN_SRC_DST_OFST 2 -#define MC_CMD_RX_BALANCING_IN_SRC_DST_LEN 1 +#define MC_CMD_RX_BALANCING_IN_SRC_DST_OFST 8 /* The RX engine to which the vFIFO in the table entry will point to */ -#define MC_CMD_RX_BALANCING_IN_ENG_OFST 3 -#define MC_CMD_RX_BALANCING_IN_ENG_LEN 1 +#define MC_CMD_RX_BALANCING_IN_ENG_OFST 12 /* MC_CMD_RX_BALANCING_OUT msgresponse */ #define MC_CMD_RX_BALANCING_OUT_LEN 0 @@ -14368,6 +14570,9 @@ * available to host software. */ #define MC_CMD_TSA_BIND 0x119 +#undef MC_CMD_0x119_PRIVILEGE_CTG + +#define MC_CMD_0x119_PRIVILEGE_CTG SRIOV_CTG_ADMIN /* MC_CMD_TSA_BIND_IN msgrequest: Protocol operation code */ #define MC_CMD_TSA_BIND_IN_LEN 4 @@ -14431,9 +14636,11 @@ #define MC_CMD_TSA_BIND_IN_SET_KEY_DATKEY_MAXNUM 248 /* MC_CMD_TSA_BIND_IN_UNBIND msgrequest: Asks for the un-binding procedure */ -#define MC_CMD_TSA_BIND_IN_UNBIND_LEN 6 +#define MC_CMD_TSA_BIND_IN_UNBIND_LEN 10 +/* The operation requested. */ +#define MC_CMD_TSA_BIND_IN_UNBIND_OP_OFST 0 /* TSAN unique identifier for the network adapter */ -#define MC_CMD_TSA_BIND_IN_UNBIND_TSANID_OFST 0 +#define MC_CMD_TSA_BIND_IN_UNBIND_TSANID_OFST 4 #define MC_CMD_TSA_BIND_IN_UNBIND_TSANID_LEN 6 /* MC_CMD_TSA_BIND_OUT_GET_ID msgresponse */ @@ -14550,4 +14757,291 @@ #define MC_CMD_MANAGE_SECURITY_RULESET_CACHE_OUT_VERSION_MINNUM 1 #define MC_CMD_MANAGE_SECURITY_RULESET_CACHE_OUT_VERSION_MAXNUM 248 + +/***********************************/ +/* MC_CMD_NVRAM_PRIVATE_APPEND + * Append a single TLV to the MC_USAGE_TLV partition. Returns MC_CMD_ERR_EEXIST + * if the tag is already present. + */ +#define MC_CMD_NVRAM_PRIVATE_APPEND 0x11c +#undef MC_CMD_0x11c_PRIVILEGE_CTG + +#define MC_CMD_0x11c_PRIVILEGE_CTG SRIOV_CTG_ADMIN + +/* MC_CMD_NVRAM_PRIVATE_APPEND_IN msgrequest */ +#define MC_CMD_NVRAM_PRIVATE_APPEND_IN_LENMIN 9 +#define MC_CMD_NVRAM_PRIVATE_APPEND_IN_LENMAX 252 +#define MC_CMD_NVRAM_PRIVATE_APPEND_IN_LEN(num) (8+1*(num)) +/* The tag to be appended */ +#define MC_CMD_NVRAM_PRIVATE_APPEND_IN_TAG_OFST 0 +/* The length of the data */ +#define MC_CMD_NVRAM_PRIVATE_APPEND_IN_LENGTH_OFST 4 +/* The data to be contained in the TLV structure */ +#define MC_CMD_NVRAM_PRIVATE_APPEND_IN_DATA_BUFFER_OFST 8 +#define MC_CMD_NVRAM_PRIVATE_APPEND_IN_DATA_BUFFER_LEN 1 +#define MC_CMD_NVRAM_PRIVATE_APPEND_IN_DATA_BUFFER_MINNUM 1 +#define MC_CMD_NVRAM_PRIVATE_APPEND_IN_DATA_BUFFER_MAXNUM 244 + +/* MC_CMD_NVRAM_PRIVATE_APPEND_OUT msgresponse */ +#define MC_CMD_NVRAM_PRIVATE_APPEND_OUT_LEN 0 + + +/***********************************/ +/* MC_CMD_XPM_VERIFY_CONTENTS + * Verify that the contents of the XPM memory is correct (Medford only). This + * is used during manufacture to check that the XPM memory has been programmed + * correctly at ATE. + */ +#define MC_CMD_XPM_VERIFY_CONTENTS 0x11b +#undef MC_CMD_0x11b_PRIVILEGE_CTG + +#define MC_CMD_0x11b_PRIVILEGE_CTG SRIOV_CTG_ADMIN + +/* MC_CMD_XPM_VERIFY_CONTENTS_IN msgrequest */ +#define MC_CMD_XPM_VERIFY_CONTENTS_IN_LEN 4 +/* Data type to be checked */ +#define MC_CMD_XPM_VERIFY_CONTENTS_IN_DATA_TYPE_OFST 0 + +/* MC_CMD_XPM_VERIFY_CONTENTS_OUT msgresponse */ +#define MC_CMD_XPM_VERIFY_CONTENTS_OUT_LENMIN 12 +#define MC_CMD_XPM_VERIFY_CONTENTS_OUT_LENMAX 252 +#define MC_CMD_XPM_VERIFY_CONTENTS_OUT_LEN(num) (12+1*(num)) +/* Number of sectors found (test builds only) */ +#define MC_CMD_XPM_VERIFY_CONTENTS_OUT_NUM_SECTORS_OFST 0 +/* Number of bytes found (test builds only) */ +#define MC_CMD_XPM_VERIFY_CONTENTS_OUT_NUM_BYTES_OFST 4 +/* Length of signature */ +#define MC_CMD_XPM_VERIFY_CONTENTS_OUT_SIG_LENGTH_OFST 8 +/* Signature */ +#define MC_CMD_XPM_VERIFY_CONTENTS_OUT_SIGNATURE_OFST 12 +#define MC_CMD_XPM_VERIFY_CONTENTS_OUT_SIGNATURE_LEN 1 +#define MC_CMD_XPM_VERIFY_CONTENTS_OUT_SIGNATURE_MINNUM 0 +#define MC_CMD_XPM_VERIFY_CONTENTS_OUT_SIGNATURE_MAXNUM 240 + + +/***********************************/ +/* MC_CMD_SET_EVQ_TMR + * Update the timer load, timer reload and timer mode values for a given EVQ. + * The requested timer values (in TMR_LOAD_REQ_NS and TMR_RELOAD_REQ_NS) will + * be rounded up to the granularity supported by the hardware, then truncated + * to the range supported by the hardware. The resulting value after the + * rounding and truncation will be returned to the caller (in TMR_LOAD_ACT_NS + * and TMR_RELOAD_ACT_NS). + */ +#define MC_CMD_SET_EVQ_TMR 0x120 +#undef MC_CMD_0x120_PRIVILEGE_CTG + +#define MC_CMD_0x120_PRIVILEGE_CTG SRIOV_CTG_GENERAL + +/* MC_CMD_SET_EVQ_TMR_IN msgrequest */ +#define MC_CMD_SET_EVQ_TMR_IN_LEN 16 +/* Function-relative queue instance */ +#define MC_CMD_SET_EVQ_TMR_IN_INSTANCE_OFST 0 +/* Requested value for timer load (in nanoseconds) */ +#define MC_CMD_SET_EVQ_TMR_IN_TMR_LOAD_REQ_NS_OFST 4 +/* Requested value for timer reload (in nanoseconds) */ +#define MC_CMD_SET_EVQ_TMR_IN_TMR_RELOAD_REQ_NS_OFST 8 +/* Timer mode. Meanings as per EVQ_TMR_REG.TC_TIMER_VAL */ +#define MC_CMD_SET_EVQ_TMR_IN_TMR_MODE_OFST 12 +#define MC_CMD_SET_EVQ_TMR_IN_TIMER_MODE_DIS 0x0 /* enum */ +#define MC_CMD_SET_EVQ_TMR_IN_TIMER_MODE_IMMED_START 0x1 /* enum */ +#define MC_CMD_SET_EVQ_TMR_IN_TIMER_MODE_TRIG_START 0x2 /* enum */ +#define MC_CMD_SET_EVQ_TMR_IN_TIMER_MODE_INT_HLDOFF 0x3 /* enum */ + +/* MC_CMD_SET_EVQ_TMR_OUT msgresponse */ +#define MC_CMD_SET_EVQ_TMR_OUT_LEN 8 +/* Actual value for timer load (in nanoseconds) */ +#define MC_CMD_SET_EVQ_TMR_OUT_TMR_LOAD_ACT_NS_OFST 0 +/* Actual value for timer reload (in nanoseconds) */ +#define MC_CMD_SET_EVQ_TMR_OUT_TMR_RELOAD_ACT_NS_OFST 4 + + +/***********************************/ +/* MC_CMD_GET_EVQ_TMR_PROPERTIES + * Query properties about the event queue timers. + */ +#define MC_CMD_GET_EVQ_TMR_PROPERTIES 0x122 +#undef MC_CMD_0x122_PRIVILEGE_CTG + +#define MC_CMD_0x122_PRIVILEGE_CTG SRIOV_CTG_GENERAL + +/* MC_CMD_GET_EVQ_TMR_PROPERTIES_IN msgrequest */ +#define MC_CMD_GET_EVQ_TMR_PROPERTIES_IN_LEN 0 + +/* MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT msgresponse */ +#define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_LEN 36 +/* Reserved for future use. */ +#define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_FLAGS_OFST 0 +/* For timers updated via writes to EVQ_TMR_REG, this is the time interval (in + * nanoseconds) for each increment of the timer load/reload count. The + * requested duration of a timer is this value multiplied by the timer + * load/reload count. + */ +#define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_TMR_REG_NS_PER_COUNT_OFST 4 +/* For timers updated via writes to EVQ_TMR_REG, this is the maximum value + * allowed for timer load/reload counts. + */ +#define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_TMR_REG_MAX_COUNT_OFST 8 +/* For timers updated via writes to EVQ_TMR_REG, timer load/reload counts not a + * multiple of this step size will be rounded in an implementation defined + * manner. + */ +#define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_TMR_REG_STEP_OFST 12 +/* Maximum timer duration (in nanoseconds) for timers updated via MCDI. Only + * meaningful if MC_CMD_SET_EVQ_TMR is implemented. + */ +#define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_MCDI_TMR_MAX_NS_OFST 16 +/* Timer durations requested via MCDI that are not a multiple of this step size + * will be rounded up. Only meaningful if MC_CMD_SET_EVQ_TMR is implemented. + */ +#define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_MCDI_TMR_STEP_NS_OFST 20 +/* For timers updated using the bug35388 workaround, this is the time interval + * (in nanoseconds) for each increment of the timer load/reload count. The + * requested duration of a timer is this value multiplied by the timer + * load/reload count. This field is only meaningful if the bug35388 workaround + * is enabled. + */ +#define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_BUG35388_TMR_NS_PER_COUNT_OFST 24 +/* For timers updated using the bug35388 workaround, this is the maximum value + * allowed for timer load/reload counts. This field is only meaningful if the + * bug35388 workaround is enabled. + */ +#define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_BUG35388_TMR_MAX_COUNT_OFST 28 +/* For timers updated using the bug35388 workaround, timer load/reload counts + * not a multiple of this step size will be rounded in an implementation + * defined manner. This field is only meaningful if the bug35388 workaround is + * enabled. + */ +#define MC_CMD_GET_EVQ_TMR_PROPERTIES_OUT_BUG35388_TMR_STEP_OFST 32 + + +/***********************************/ +/* MC_CMD_ALLOCATE_TX_VFIFO_CP + * When we use the TX_vFIFO_ULL mode, we can allocate common pools using the + * non used switch buffers. + */ +#define MC_CMD_ALLOCATE_TX_VFIFO_CP 0x11d +#undef MC_CMD_0x11d_PRIVILEGE_CTG + +#define MC_CMD_0x11d_PRIVILEGE_CTG SRIOV_CTG_ADMIN + +/* MC_CMD_ALLOCATE_TX_VFIFO_CP_IN msgrequest */ +#define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_LEN 20 +/* Desired instance. Must be set to a specific instance, which is a function + * local queue index. + */ +#define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_INSTANCE_OFST 0 +/* Will the common pool be used as TX_vFIFO_ULL (1) */ +#define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_MODE_OFST 4 +#define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_ENABLED 0x1 /* enum */ +/* enum: Using this interface without TX_vFIFO_ULL is not supported for now */ +#define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_DISABLED 0x0 +/* Number of buffers to reserve for the common pool */ +#define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_SIZE_OFST 8 +/* TX datapath to which the Common Pool is connected to. */ +#define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_INGRESS_OFST 12 +/* enum: Extracts information from function */ +#define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_USE_FUNCTION_VALUE -0x1 +/* Network port or RX Engine to which the common pool connects. */ +#define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_EGRESS_OFST 16 +/* enum: Extracts information from function */ +/* MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_USE_FUNCTION_VALUE -0x1 */ +#define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_PORT0 0x0 /* enum */ +#define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_PORT1 0x1 /* enum */ +#define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_PORT2 0x2 /* enum */ +#define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_PORT3 0x3 /* enum */ +/* enum: To enable Switch loopback with Rx engine 0 */ +#define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_RX_ENGINE0 0x4 +/* enum: To enable Switch loopback with Rx engine 1 */ +#define MC_CMD_ALLOCATE_TX_VFIFO_CP_IN_RX_ENGINE1 0x5 + +/* MC_CMD_ALLOCATE_TX_VFIFO_CP_OUT msgresponse */ +#define MC_CMD_ALLOCATE_TX_VFIFO_CP_OUT_LEN 4 +/* ID of the common pool allocated */ +#define MC_CMD_ALLOCATE_TX_VFIFO_CP_OUT_CP_ID_OFST 0 + + +/***********************************/ +/* MC_CMD_ALLOCATE_TX_VFIFO_VFIFO + * When we use the TX_vFIFO_ULL mode, we can allocate vFIFOs using the + * previously allocated common pools. + */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO 0x11e +#undef MC_CMD_0x11e_PRIVILEGE_CTG + +#define MC_CMD_0x11e_PRIVILEGE_CTG SRIOV_CTG_ADMIN + +/* MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN msgrequest */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_LEN 20 +/* Common pool previously allocated to which the new vFIFO will be associated + */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_CP_OFST 0 +/* Port or RX engine to associate the vFIFO egress */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_EGRESS_OFST 4 +/* enum: Extracts information from common pool */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_USE_CP_VALUE -0x1 +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_PORT0 0x0 /* enum */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_PORT1 0x1 /* enum */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_PORT2 0x2 /* enum */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_PORT3 0x3 /* enum */ +/* enum: To enable Switch loopback with Rx engine 0 */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_RX_ENGINE0 0x4 +/* enum: To enable Switch loopback with Rx engine 1 */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_RX_ENGINE1 0x5 +/* Minimum number of buffers that the pool must have */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_SIZE_OFST 8 +/* enum: Do not check the space available */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_NO_MINIMUM 0x0 +/* Will the vFIFO be used as TX_vFIFO_ULL */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_MODE_OFST 12 +/* Network priority of the vFIFO,if applicable */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_PRIORITY_OFST 16 +/* enum: Search for the lowest unused priority */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_IN_LOWEST_AVAILABLE -0x1 + +/* MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_OUT msgresponse */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_OUT_LEN 8 +/* Short vFIFO ID */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_OUT_VID_OFST 0 +/* Network priority of the vFIFO */ +#define MC_CMD_ALLOCATE_TX_VFIFO_VFIFO_OUT_PRIORITY_OFST 4 + + +/***********************************/ +/* MC_CMD_TEARDOWN_TX_VFIFO_VF + * This interface clears the configuration of the given vFIFO and leaves it + * ready to be re-used. + */ +#define MC_CMD_TEARDOWN_TX_VFIFO_VF 0x11f +#undef MC_CMD_0x11f_PRIVILEGE_CTG + +#define MC_CMD_0x11f_PRIVILEGE_CTG SRIOV_CTG_ADMIN + +/* MC_CMD_TEARDOWN_TX_VFIFO_VF_IN msgrequest */ +#define MC_CMD_TEARDOWN_TX_VFIFO_VF_IN_LEN 4 +/* Short vFIFO ID */ +#define MC_CMD_TEARDOWN_TX_VFIFO_VF_IN_VFIFO_OFST 0 + +/* MC_CMD_TEARDOWN_TX_VFIFO_VF_OUT msgresponse */ +#define MC_CMD_TEARDOWN_TX_VFIFO_VF_OUT_LEN 0 + + +/***********************************/ +/* MC_CMD_DEALLOCATE_TX_VFIFO_CP + * This interface clears the configuration of the given common pool and leaves + * it ready to be re-used. + */ +#define MC_CMD_DEALLOCATE_TX_VFIFO_CP 0x121 +#undef MC_CMD_0x121_PRIVILEGE_CTG + +#define MC_CMD_0x121_PRIVILEGE_CTG SRIOV_CTG_ADMIN + +/* MC_CMD_DEALLOCATE_TX_VFIFO_CP_IN msgrequest */ +#define MC_CMD_DEALLOCATE_TX_VFIFO_CP_IN_LEN 4 +/* Common pool ID given when pool allocated */ +#define MC_CMD_DEALLOCATE_TX_VFIFO_CP_IN_POOL_ID_OFST 0 + +/* MC_CMD_DEALLOCATE_TX_VFIFO_CP_OUT msgresponse */ +#define MC_CMD_DEALLOCATE_TX_VFIFO_CP_OUT_LEN 0 + #endif /* _SIENA_MC_DRIVER_PCOL_H */ From owner-svn-src-all@freebsd.org Fri Jun 17 08:56:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 416B9A78CBD; Fri, 17 Jun 2016 08:56:03 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C5052D18; Fri, 17 Jun 2016 08:56:03 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5H8u225011036; Fri, 17 Jun 2016 08:56:02 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5H8u1XR011030; Fri, 17 Jun 2016 08:56:01 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201606170856.u5H8u1XR011030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 17 Jun 2016 08:56:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301980 - in stable/10/sys/dev/sfxge: . common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2016 08:56:03 -0000 Author: arybchik Date: Fri Jun 17 08:56:01 2016 New Revision: 301980 URL: https://svnweb.freebsd.org/changeset/base/301980 Log: MFC r301122 sfxge(4): set moderation in efx_ev_qcreate This simplifies setting an initial interrupt moderation value, and avoids most calls to evx_ev_qmoderate from contexts where MCDI is not allowed (MCDI is need for an EVQ timer workaround in a later patch). Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D6673 Modified: stable/10/sys/dev/sfxge/common/ef10_ev.c stable/10/sys/dev/sfxge/common/ef10_impl.h stable/10/sys/dev/sfxge/common/efx.h stable/10/sys/dev/sfxge/common/efx_ev.c stable/10/sys/dev/sfxge/common/efx_impl.h stable/10/sys/dev/sfxge/sfxge_ev.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/common/ef10_ev.c Fri Jun 17 08:54:43 2016 (r301979) +++ stable/10/sys/dev/sfxge/common/ef10_ev.c Fri Jun 17 08:56:01 2016 (r301980) @@ -92,8 +92,10 @@ efx_mcdi_init_evq( __in unsigned int instance, __in efsys_mem_t *esmp, __in size_t nevs, - __in uint32_t irq) + __in uint32_t irq, + __in uint32_t us) { + efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_mcdi_req_t req; uint8_t payload[ MAX(MC_CMD_INIT_EVQ_IN_LEN(EFX_EVQ_NBUFS(EFX_EVQ_MAXNEVS)), @@ -141,10 +143,26 @@ efx_mcdi_init_evq( INIT_EVQ_IN_FLAG_RX_MERGE, 1, INIT_EVQ_IN_FLAG_TX_MERGE, 1); - MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_MODE, - MC_CMD_INIT_EVQ_IN_TMR_MODE_DIS); - MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_LOAD, 0); - MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_RELOAD, 0); + if (us == 0) { + MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_MODE, + MC_CMD_INIT_EVQ_IN_TMR_MODE_DIS); + MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_LOAD, 0); + MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_RELOAD, 0); + } else { + uint32_t timer_val; + + /* Calculate the timer value in quanta */ + timer_val = us * 1000 / encp->enc_evq_timer_quantum_ns; + + /* Moderation value is base 0 so we need to deduct 1 */ + if (timer_val > 0) + timer_val--; + + MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_MODE, + MC_CMD_INIT_EVQ_IN_TMR_INT_HLDOFF); + MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_LOAD, timer_val); + MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_RELOAD, timer_val); + } MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_COUNT_MODE, MC_CMD_INIT_EVQ_IN_COUNT_MODE_DIS); @@ -246,6 +264,7 @@ ef10_ev_qcreate( __in efsys_mem_t *esmp, __in size_t n, __in uint32_t id, + __in uint32_t us, __in efx_evq_t *eep) { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); @@ -266,6 +285,11 @@ ef10_ev_qcreate( goto fail2; } + if (us > encp->enc_evq_timer_max_us) { + rc = EINVAL; + goto fail3; + } + /* Set up the handler table */ eep->ee_rx = ef10_ev_rx; eep->ee_tx = ef10_ev_tx; @@ -280,11 +304,13 @@ ef10_ev_qcreate( * Interrupts may be raised for events immediately after the queue is * created. See bug58606. */ - if ((rc = efx_mcdi_init_evq(enp, index, esmp, n, irq)) != 0) - goto fail3; + if ((rc = efx_mcdi_init_evq(enp, index, esmp, n, irq, us)) != 0) + goto fail4; return (0); +fail4: + EFSYS_PROBE(fail4); fail3: EFSYS_PROBE(fail3); fail2: Modified: stable/10/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- stable/10/sys/dev/sfxge/common/ef10_impl.h Fri Jun 17 08:54:43 2016 (r301979) +++ stable/10/sys/dev/sfxge/common/ef10_impl.h Fri Jun 17 08:56:01 2016 (r301980) @@ -84,6 +84,7 @@ ef10_ev_qcreate( __in efsys_mem_t *esmp, __in size_t n, __in uint32_t id, + __in uint32_t us, __in efx_evq_t *eep); void Modified: stable/10/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx.h Fri Jun 17 08:54:43 2016 (r301979) +++ stable/10/sys/dev/sfxge/common/efx.h Fri Jun 17 08:56:01 2016 (r301980) @@ -1602,6 +1602,7 @@ efx_ev_qcreate( __in efsys_mem_t *esmp, __in size_t n, __in uint32_t id, + __in uint32_t us, __deref_out efx_evq_t **eepp); extern void Modified: stable/10/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_ev.c Fri Jun 17 08:54:43 2016 (r301979) +++ stable/10/sys/dev/sfxge/common/efx_ev.c Fri Jun 17 08:56:01 2016 (r301980) @@ -70,6 +70,7 @@ siena_ev_qcreate( __in efsys_mem_t *esmp, __in size_t n, __in uint32_t id, + __in uint32_t us, __in efx_evq_t *eep); static void @@ -226,6 +227,7 @@ efx_ev_qcreate( __in efsys_mem_t *esmp, __in size_t n, __in uint32_t id, + __in uint32_t us, __deref_out efx_evq_t **eepp) { const efx_ev_ops_t *eevop = enp->en_eevop; @@ -262,7 +264,7 @@ efx_ev_qcreate( enp->en_ev_qcount++; *eepp = eep; - if ((rc = eevop->eevo_qcreate(enp, index, esmp, n, id, eep)) != 0) + if ((rc = eevop->eevo_qcreate(enp, index, esmp, n, id, us, eep)) != 0) goto fail2; return (0); @@ -1257,6 +1259,7 @@ siena_ev_qcreate( __in efsys_mem_t *esmp, __in size_t n, __in uint32_t id, + __in uint32_t us, __in efx_evq_t *eep) { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); @@ -1312,6 +1315,9 @@ siena_ev_qcreate( EFX_BAR_TBL_WRITEO(enp, FR_AZ_EVQ_PTR_TBL, index, &oword, B_TRUE); + /* Set initial interrupt moderation */ + siena_ev_qmoderate(eep, us); + return (0); fail4: Modified: stable/10/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_impl.h Fri Jun 17 08:54:43 2016 (r301979) +++ stable/10/sys/dev/sfxge/common/efx_impl.h Fri Jun 17 08:56:01 2016 (r301980) @@ -95,7 +95,7 @@ typedef struct efx_ev_ops_s { void (*eevo_fini)(efx_nic_t *); efx_rc_t (*eevo_qcreate)(efx_nic_t *, unsigned int, efsys_mem_t *, size_t, uint32_t, - efx_evq_t *); + uint32_t, efx_evq_t *); void (*eevo_qdestroy)(efx_evq_t *); efx_rc_t (*eevo_qprime)(efx_evq_t *, unsigned int); void (*eevo_qpost)(efx_evq_t *, uint16_t); Modified: stable/10/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_ev.c Fri Jun 17 08:54:43 2016 (r301979) +++ stable/10/sys/dev/sfxge/sfxge_ev.c Fri Jun 17 08:56:01 2016 (r301980) @@ -699,14 +699,11 @@ sfxge_ev_qstart(struct sfxge_softc *sc, /* Create the common code event queue. */ if ((rc = efx_ev_qcreate(sc->enp, index, esmp, evq->entries, - evq->buf_base_id, &evq->common)) != 0) + evq->buf_base_id, sc->ev_moderation, &evq->common)) != 0) goto fail; SFXGE_EVQ_LOCK(evq); - /* Set the default moderation */ - (void)efx_ev_qmoderate(evq->common, sc->ev_moderation); - /* Prime the event queue for interrupts */ if ((rc = efx_ev_qprime(evq->common, evq->read_ptr)) != 0) goto fail2; From owner-svn-src-all@freebsd.org Fri Jun 17 08:56:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02A0CA78D18; Fri, 17 Jun 2016 08:56:49 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C54DF2E72; Fri, 17 Jun 2016 08:56:48 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5H8umqj011122; Fri, 17 Jun 2016 08:56:48 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5H8umeg011121; Fri, 17 Jun 2016 08:56:48 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201606170856.u5H8umeg011121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 17 Jun 2016 08:56:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301981 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2016 08:56:49 -0000 Author: arybchik Date: Fri Jun 17 08:56:47 2016 New Revision: 301981 URL: https://svnweb.freebsd.org/changeset/base/301981 Log: MFC r301125 sfxge(4): cleanup: add missing space after if keyword Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/efx_lic.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_lic.c Fri Jun 17 08:56:01 2016 (r301980) +++ stable/10/sys/dev/sfxge/common/efx_lic.c Fri Jun 17 08:56:47 2016 (r301981) @@ -506,7 +506,7 @@ efx_lic_v1v2_find_key( _NOTE(ARGUNUSED(enp)) - if((size_t)buffer_size - offset < EFX_LICENSE_V1V2_HEADER_LENGTH) + if ((size_t)buffer_size - offset < EFX_LICENSE_V1V2_HEADER_LENGTH) goto fail1; tlv_type = __LE_TO_CPU_16(((uint16_t*)&bufferp[offset])[0]); @@ -548,7 +548,7 @@ efx_lic_v1v2_validate_key( tlv_type = __LE_TO_CPU_16(((uint16_t*)keyp)[0]); tlv_length = __LE_TO_CPU_16(((uint16_t*)keyp)[1]); - if(tlv_length > EFX_LICENSE_V1V2_PAYLOAD_LENGTH_MAX) { + if (tlv_length > EFX_LICENSE_V1V2_PAYLOAD_LENGTH_MAX) { goto fail2; } if (tlv_type == 0) { From owner-svn-src-all@freebsd.org Fri Jun 17 08:57:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F980A78DA7; Fri, 17 Jun 2016 08:57:54 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 323412FD4; Fri, 17 Jun 2016 08:57:54 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5H8vrnO011219; Fri, 17 Jun 2016 08:57:53 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5H8vrPY011215; Fri, 17 Jun 2016 08:57:53 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201606170857.u5H8vrPY011215@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 17 Jun 2016 08:57:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301982 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2016 08:57:54 -0000 Author: arybchik Date: Fri Jun 17 08:57:52 2016 New Revision: 301982 URL: https://svnweb.freebsd.org/changeset/base/301982 Log: MFC r301127 sfxge(4): cleanup: remove unused variables in common code Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/efx_ev.c stable/10/sys/dev/sfxge/common/efx_lic.c stable/10/sys/dev/sfxge/common/efx_mcdi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_ev.c Fri Jun 17 08:56:47 2016 (r301981) +++ stable/10/sys/dev/sfxge/common/efx_ev.c Fri Jun 17 08:57:52 2016 (r301982) @@ -349,7 +349,6 @@ efx_ev_qprefetch( __in efx_evq_t *eep, __in unsigned int count) { - efx_nic_t *enp = eep->ee_enp; unsigned int offset; EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC); Modified: stable/10/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_lic.c Fri Jun 17 08:56:47 2016 (r301981) +++ stable/10/sys/dev/sfxge/common/efx_lic.c Fri Jun 17 08:57:52 2016 (r301982) @@ -534,8 +534,6 @@ efx_lic_v1v2_validate_key( __in uint32_t length ) { - const efx_lic_ops_t *elop = enp->en_elop; - efx_rc_t rc; uint16_t tlv_type; uint16_t tlv_length; @@ -658,7 +656,6 @@ efx_lic_v1v2_delete_key( __out uint32_t *deltap ) { - efx_rc_t rc; uint32_t move_start = offset + length; uint32_t move_length = end - move_start; @@ -1158,7 +1155,6 @@ efx_lic_v3_validate_key( ) { // Check key is a valid V3 key - efx_rc_t rc; uint8_t key_type; uint8_t key_length; @@ -1396,8 +1392,6 @@ efx_lic_check_support( efx_lic_fini( __in efx_nic_t *enp) { - const efx_lic_ops_t *elop = enp->en_elop; - EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_LIC); @@ -1573,7 +1567,6 @@ efx_lic_find_key( ) { const efx_lic_ops_t *elop = enp->en_elop; - boolean_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_LIC); @@ -1599,8 +1592,6 @@ efx_lic_validate_key( { const efx_lic_ops_t *elop = enp->en_elop; boolean_t rc; - uint16_t tlv_type; - uint16_t tlv_length; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_LIC); Modified: stable/10/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_mcdi.c Fri Jun 17 08:56:47 2016 (r301981) +++ stable/10/sys/dev/sfxge/common/efx_mcdi.c Fri Jun 17 08:57:52 2016 (r301982) @@ -795,7 +795,6 @@ efx_mcdi_get_proxy_handle( __in efx_mcdi_req_t *emrp, __out uint32_t *handlep) { - efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); efx_rc_t rc; /* From owner-svn-src-all@freebsd.org Fri Jun 17 08:59:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FD9BA78E41; Fri, 17 Jun 2016 08:59:10 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C87A1276; Fri, 17 Jun 2016 08:59:09 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5H8x9TN011326; Fri, 17 Jun 2016 08:59:09 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5H8x8mG011322; Fri, 17 Jun 2016 08:59:08 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201606170859.u5H8x8mG011322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 17 Jun 2016 08:59:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301983 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2016 08:59:10 -0000 Author: arybchik Date: Fri Jun 17 08:59:08 2016 New Revision: 301983 URL: https://svnweb.freebsd.org/changeset/base/301983 Log: MFC r301237 sfxge(4): support EVQ timer workaround via MCDI Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/6675 Modified: stable/10/sys/dev/sfxge/common/ef10_ev.c stable/10/sys/dev/sfxge/common/efx.h stable/10/sys/dev/sfxge/common/hunt_nic.c stable/10/sys/dev/sfxge/common/medford_nic.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/common/ef10_ev.c Fri Jun 17 08:57:52 2016 (r301982) +++ stable/10/sys/dev/sfxge/common/ef10_ev.c Fri Jun 17 08:59:08 2016 (r301983) @@ -87,6 +87,52 @@ ef10_ev_mcdi( static __checkReturn efx_rc_t +efx_mcdi_set_evq_tmr( + __in efx_nic_t *enp, + __in uint32_t instance, + __in uint32_t mode, + __in uint32_t timer_ns) +{ + efx_mcdi_req_t req; + uint8_t payload[MAX(MC_CMD_SET_EVQ_TMR_IN_LEN, + MC_CMD_SET_EVQ_TMR_OUT_LEN)]; + efx_rc_t rc; + + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_SET_EVQ_TMR; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_SET_EVQ_TMR_IN_LEN; + req.emr_out_buf = payload; + req.emr_out_length = MC_CMD_SET_EVQ_TMR_OUT_LEN; + + MCDI_IN_SET_DWORD(req, SET_EVQ_TMR_IN_INSTANCE, instance); + MCDI_IN_SET_DWORD(req, SET_EVQ_TMR_IN_TMR_LOAD_REQ_NS, timer_ns); + MCDI_IN_SET_DWORD(req, SET_EVQ_TMR_IN_TMR_RELOAD_REQ_NS, timer_ns); + MCDI_IN_SET_DWORD(req, SET_EVQ_TMR_IN_TMR_MODE, mode); + + efx_mcdi_execute(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail1; + } + + if (req.emr_out_length_used < MC_CMD_SET_EVQ_TMR_OUT_LEN) { + rc = EMSGSIZE; + goto fail2; + } + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + +static __checkReturn efx_rc_t efx_mcdi_init_evq( __in efx_nic_t *enp, __in unsigned int instance, @@ -437,9 +483,19 @@ ef10_ev_qmoderate( efx_nic_t *enp = eep->ee_enp; efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_dword_t dword; - uint32_t timer_val, mode; + uint32_t timer_ns, timer_val, mode; efx_rc_t rc; + /* Check that hardware and MCDI use the same timer MODE values */ + EFX_STATIC_ASSERT(FFE_CZ_TIMER_MODE_DIS == + MC_CMD_SET_EVQ_TMR_IN_TIMER_MODE_DIS); + EFX_STATIC_ASSERT(FFE_CZ_TIMER_MODE_IMMED_START == + MC_CMD_SET_EVQ_TMR_IN_TIMER_MODE_IMMED_START); + EFX_STATIC_ASSERT(FFE_CZ_TIMER_MODE_TRIG_START == + MC_CMD_SET_EVQ_TMR_IN_TIMER_MODE_TRIG_START); + EFX_STATIC_ASSERT(FFE_CZ_TIMER_MODE_INT_HLDOFF == + MC_CMD_SET_EVQ_TMR_IN_TIMER_MODE_INT_HLDOFF); + if (us > encp->enc_evq_timer_max_us) { rc = EINVAL; goto fail1; @@ -447,37 +503,46 @@ ef10_ev_qmoderate( /* If the value is zero then disable the timer */ if (us == 0) { - timer_val = 0; + timer_ns = 0; mode = FFE_CZ_TIMER_MODE_DIS; } else { + timer_ns = us * 1000u; + mode = FFE_CZ_TIMER_MODE_INT_HLDOFF; + } + + if (encp->enc_bug61265_workaround) { + rc = efx_mcdi_set_evq_tmr(enp, eep->ee_index, mode, timer_ns); + if (rc != 0) + goto fail2; + } else { /* Calculate the timer value in quanta */ - timer_val = us * 1000 / encp->enc_evq_timer_quantum_ns; + timer_val = timer_ns / encp->enc_evq_timer_quantum_ns; /* Moderation value is base 0 so we need to deduct 1 */ if (timer_val > 0) timer_val--; - mode = FFE_CZ_TIMER_MODE_INT_HLDOFF; - } - - if (encp->enc_bug35388_workaround) { - EFX_POPULATE_DWORD_3(dword, - ERF_DD_EVQ_IND_TIMER_FLAGS, - EFE_DD_EVQ_IND_TIMER_FLAGS, - ERF_DD_EVQ_IND_TIMER_MODE, mode, - ERF_DD_EVQ_IND_TIMER_VAL, timer_val); - EFX_BAR_TBL_WRITED(enp, ER_DD_EVQ_INDIRECT, - eep->ee_index, &dword, 0); - } else { - EFX_POPULATE_DWORD_2(dword, - ERF_DZ_TC_TIMER_MODE, mode, - ERF_DZ_TC_TIMER_VAL, timer_val); - EFX_BAR_TBL_WRITED(enp, ER_DZ_EVQ_TMR_REG, - eep->ee_index, &dword, 0); + if (encp->enc_bug35388_workaround) { + EFX_POPULATE_DWORD_3(dword, + ERF_DD_EVQ_IND_TIMER_FLAGS, + EFE_DD_EVQ_IND_TIMER_FLAGS, + ERF_DD_EVQ_IND_TIMER_MODE, mode, + ERF_DD_EVQ_IND_TIMER_VAL, timer_val); + EFX_BAR_TBL_WRITED(enp, ER_DD_EVQ_INDIRECT, + eep->ee_index, &dword, 0); + } else { + EFX_POPULATE_DWORD_2(dword, + ERF_DZ_TC_TIMER_MODE, mode, + ERF_DZ_TC_TIMER_VAL, timer_val); + EFX_BAR_TBL_WRITED(enp, ER_DZ_EVQ_TMR_REG, + eep->ee_index, &dword, 0); + } } return (0); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); Modified: stable/10/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx.h Fri Jun 17 08:57:52 2016 (r301982) +++ stable/10/sys/dev/sfxge/common/efx.h Fri Jun 17 08:59:08 2016 (r301983) @@ -1129,6 +1129,7 @@ typedef struct efx_nic_cfg_s { boolean_t enc_bug26807_workaround; boolean_t enc_bug35388_workaround; boolean_t enc_bug41750_workaround; + boolean_t enc_bug61265_workaround; boolean_t enc_rx_batching_enabled; /* Maximum number of descriptors completed in an rx event. */ uint32_t enc_rx_batch_max; Modified: stable/10/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/hunt_nic.c Fri Jun 17 08:57:52 2016 (r301982) +++ stable/10/sys/dev/sfxge/common/hunt_nic.c Fri Jun 17 08:59:08 2016 (r301983) @@ -291,6 +291,8 @@ hunt_board_cfg( FRF_CZ_TC_TIMER_VAL_WIDTH) / 1000; } + encp->enc_bug61265_workaround = B_FALSE; /* Medford only */ + /* Check capabilities of running datapath firmware */ if ((rc = ef10_get_datapath_caps(enp)) != 0) goto fail12; Modified: stable/10/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/medford_nic.c Fri Jun 17 08:57:52 2016 (r301982) +++ stable/10/sys/dev/sfxge/common/medford_nic.c Fri Jun 17 08:59:08 2016 (r301983) @@ -227,6 +227,23 @@ medford_board_cfg( epp->ep_default_adv_cap_mask = els.els_adv_cap_mask; epp->ep_adv_cap_mask = els.els_adv_cap_mask; + /* + * Enable firmware workarounds for hardware errata. + * Expected responses are: + * - 0 (zero): + * Success: workaround enabled or disabled as requested. + * - MC_CMD_ERR_ENOSYS (reported as ENOTSUP): + * Firmware does not support the MC_CMD_WORKAROUND request. + * (assume that the workaround is not supported). + * - MC_CMD_ERR_ENOENT (reported as ENOENT): + * Firmware does not support the requested workaround. + * - MC_CMD_ERR_EPERM (reported as EACCES): + * Unprivileged function cannot enable/disable workarounds. + * + * See efx_mcdi_request_errcode() for MCDI error translations. + */ + + if (EFX_PCI_FUNCTION_IS_VF(encp)) { /* * Interrupt testing does not work for VFs. See bug50084. @@ -238,9 +255,23 @@ medford_board_cfg( /* Chained multicast is always enabled on Medford */ encp->enc_bug26807_workaround = B_TRUE; + /* + * If the bug61265 workaround is enabled, then interrupt holdoff timers + * cannot be controlled by timer table writes, so MCDI must be used + * (timer table writes can still be used for wakeup timers). + */ + rc = efx_mcdi_set_workaround(enp, MC_CMD_WORKAROUND_BUG61265, B_TRUE, + NULL); + if ((rc == 0) || (rc == EACCES)) + encp->enc_bug61265_workaround = B_TRUE; + else if ((rc == ENOTSUP) || (rc == ENOENT)) + encp->enc_bug61265_workaround = B_FALSE; + else + goto fail8; + /* Get clock frequencies (in MHz). */ if ((rc = efx_mcdi_get_clock(enp, &sysclk, &dpcpu_clk)) != 0) - goto fail8; + goto fail9; /* * The Medford timer quantum is 1536 dpcpu_clk cycles, documented for @@ -252,14 +283,14 @@ medford_board_cfg( /* Check capabilities of running datapath firmware */ if ((rc = ef10_get_datapath_caps(enp)) != 0) - goto fail9; + goto fail10; /* Alignment for receive packet DMA buffers */ encp->enc_rx_buf_align_start = 1; /* Get the RX DMA end padding alignment configuration */ if ((rc = efx_mcdi_get_rxdp_config(enp, &end_padding)) != 0) - goto fail10; + goto fail11; encp->enc_rx_buf_align_end = end_padding; /* Alignment for WPTR updates */ @@ -288,13 +319,13 @@ medford_board_cfg( * can result in time-of-check/time-of-use bugs. */ if ((rc = ef10_get_privilege_mask(enp, &mask)) != 0) - goto fail11; + goto fail12; encp->enc_privilege_mask = mask; /* Get interrupt vector limits */ if ((rc = efx_mcdi_get_vector_cfg(enp, &base, &nvec, NULL)) != 0) { if (EFX_PCI_FUNCTION_IS_PF(encp)) - goto fail12; + goto fail13; /* Ignore error (cannot query vector limits from a VF). */ base = 0; @@ -317,12 +348,14 @@ medford_board_cfg( rc = medford_nic_get_required_pcie_bandwidth(enp, &bandwidth); if (rc != 0) - goto fail13; + goto fail14; encp->enc_required_pcie_bandwidth_mbps = bandwidth; encp->enc_max_pcie_link_gen = EFX_PCIE_LINK_SPEED_GEN3; return (0); +fail14: + EFSYS_PROBE(fail14); fail13: EFSYS_PROBE(fail13); fail12: From owner-svn-src-all@freebsd.org Fri Jun 17 09:01:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13CCCA7811A; Fri, 17 Jun 2016 09:01:13 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E056B14B7; Fri, 17 Jun 2016 09:01:12 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5H91CI2011502; Fri, 17 Jun 2016 09:01:12 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5H91Bm9011496; Fri, 17 Jun 2016 09:01:11 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201606170901.u5H91Bm9011496@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 17 Jun 2016 09:01:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301984 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2016 09:01:13 -0000 Author: arybchik Date: Fri Jun 17 09:01:11 2016 New Revision: 301984 URL: https://svnweb.freebsd.org/changeset/base/301984 Log: MFC r301308 sfxge(4): add helper to compute timer quantum This also adjusts the timer values used to match the Linux net driver implementation: a) non-zero time intervals should result in at least one quantum b) timer load/reload values are only zero biased for Falcon/Siena Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D6704 Modified: stable/10/sys/dev/sfxge/common/ef10_ev.c stable/10/sys/dev/sfxge/common/efx.h stable/10/sys/dev/sfxge/common/efx_ev.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/common/ef10_ev.c Fri Jun 17 08:59:08 2016 (r301983) +++ stable/10/sys/dev/sfxge/common/ef10_ev.c Fri Jun 17 09:01:11 2016 (r301984) @@ -141,7 +141,6 @@ efx_mcdi_init_evq( __in uint32_t irq, __in uint32_t us) { - efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_mcdi_req_t req; uint8_t payload[ MAX(MC_CMD_INIT_EVQ_IN_LEN(EFX_EVQ_NBUFS(EFX_EVQ_MAXNEVS)), @@ -189,25 +188,22 @@ efx_mcdi_init_evq( INIT_EVQ_IN_FLAG_RX_MERGE, 1, INIT_EVQ_IN_FLAG_TX_MERGE, 1); + /* If the value is zero then disable the timer */ if (us == 0) { MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_MODE, MC_CMD_INIT_EVQ_IN_TMR_MODE_DIS); MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_LOAD, 0); MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_RELOAD, 0); } else { - uint32_t timer_val; + unsigned int ticks; - /* Calculate the timer value in quanta */ - timer_val = us * 1000 / encp->enc_evq_timer_quantum_ns; - - /* Moderation value is base 0 so we need to deduct 1 */ - if (timer_val > 0) - timer_val--; + if ((rc = efx_ev_usecs_to_ticks(enp, us, &ticks)) != 0) + goto fail2; MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_MODE, MC_CMD_INIT_EVQ_IN_TMR_INT_HLDOFF); - MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_LOAD, timer_val); - MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_RELOAD, timer_val); + MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_LOAD, ticks); + MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_RELOAD, ticks); } MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_COUNT_MODE, @@ -230,18 +226,20 @@ efx_mcdi_init_evq( if (req.emr_rc != 0) { rc = req.emr_rc; - goto fail2; + goto fail3; } if (req.emr_out_length_used < MC_CMD_INIT_EVQ_OUT_LEN) { rc = EMSGSIZE; - goto fail3; + goto fail4; } /* NOTE: ignore the returned IRQ param as firmware does not set it. */ return (0); +fail4: + EFSYS_PROBE(fail4); fail3: EFSYS_PROBE(fail3); fail2: @@ -483,7 +481,7 @@ ef10_ev_qmoderate( efx_nic_t *enp = eep->ee_enp; efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_dword_t dword; - uint32_t timer_ns, timer_val, mode; + uint32_t mode; efx_rc_t rc; /* Check that hardware and MCDI use the same timer MODE values */ @@ -503,37 +501,35 @@ ef10_ev_qmoderate( /* If the value is zero then disable the timer */ if (us == 0) { - timer_ns = 0; mode = FFE_CZ_TIMER_MODE_DIS; } else { - timer_ns = us * 1000u; mode = FFE_CZ_TIMER_MODE_INT_HLDOFF; } if (encp->enc_bug61265_workaround) { - rc = efx_mcdi_set_evq_tmr(enp, eep->ee_index, mode, timer_ns); + uint32_t ns = us * 1000; + + rc = efx_mcdi_set_evq_tmr(enp, eep->ee_index, mode, ns); if (rc != 0) goto fail2; } else { - /* Calculate the timer value in quanta */ - timer_val = timer_ns / encp->enc_evq_timer_quantum_ns; + unsigned int ticks; - /* Moderation value is base 0 so we need to deduct 1 */ - if (timer_val > 0) - timer_val--; + if ((rc = efx_ev_usecs_to_ticks(enp, us, &ticks)) != 0) + goto fail3; if (encp->enc_bug35388_workaround) { EFX_POPULATE_DWORD_3(dword, ERF_DD_EVQ_IND_TIMER_FLAGS, EFE_DD_EVQ_IND_TIMER_FLAGS, ERF_DD_EVQ_IND_TIMER_MODE, mode, - ERF_DD_EVQ_IND_TIMER_VAL, timer_val); + ERF_DD_EVQ_IND_TIMER_VAL, ticks); EFX_BAR_TBL_WRITED(enp, ER_DD_EVQ_INDIRECT, eep->ee_index, &dword, 0); } else { EFX_POPULATE_DWORD_2(dword, ERF_DZ_TC_TIMER_MODE, mode, - ERF_DZ_TC_TIMER_VAL, timer_val); + ERF_DZ_TC_TIMER_VAL, ticks); EFX_BAR_TBL_WRITED(enp, ER_DZ_EVQ_TMR_REG, eep->ee_index, &dword, 0); } @@ -541,6 +537,8 @@ ef10_ev_qmoderate( return (0); +fail3: + EFSYS_PROBE(fail3); fail2: EFSYS_PROBE(fail2); fail1: Modified: stable/10/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx.h Fri Jun 17 08:59:08 2016 (r301983) +++ stable/10/sys/dev/sfxge/common/efx.h Fri Jun 17 09:01:11 2016 (r301984) @@ -1773,6 +1773,12 @@ efx_ev_qpoll( __in_opt void *arg); extern __checkReturn efx_rc_t +efx_ev_usecs_to_ticks( + __in efx_nic_t *enp, + __in unsigned int usecs, + __out unsigned int *ticksp); + +extern __checkReturn efx_rc_t efx_ev_qmoderate( __in efx_evq_t *eep, __in unsigned int us); Modified: stable/10/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/common/efx_ev.c Fri Jun 17 08:59:08 2016 (r301983) +++ stable/10/sys/dev/sfxge/common/efx_ev.c Fri Jun 17 09:01:11 2016 (r301984) @@ -406,6 +406,27 @@ efx_ev_qpost( } __checkReturn efx_rc_t +efx_ev_usecs_to_ticks( + __in efx_nic_t *enp, + __in unsigned int us, + __out unsigned int *ticksp) +{ + efx_nic_cfg_t *encp = &(enp->en_nic_cfg); + unsigned int ticks; + + /* Convert microseconds to a timer tick count */ + if (us == 0) + ticks = 0; + else if (us * 1000 < encp->enc_evq_timer_quantum_ns) + ticks = 1; /* Never round down to zero */ + else + ticks = us * 1000 / encp->enc_evq_timer_quantum_ns; + + *ticksp = ticks; + return (0); +} + + __checkReturn efx_rc_t efx_ev_qmoderate( __in efx_evq_t *eep, __in unsigned int us) @@ -1224,18 +1245,15 @@ siena_ev_qmoderate( FRF_CZ_TC_TIMER_MODE, FFE_CZ_TIMER_MODE_DIS, FRF_CZ_TC_TIMER_VAL, 0); } else { - uint32_t timer_val; + unsigned int ticks; - /* Calculate the timer value in quanta */ - timer_val = us * 1000 / encp->enc_evq_timer_quantum_ns; - - /* Moderation value is base 0 so we need to deduct 1 */ - if (timer_val > 0) - timer_val--; + if ((rc = efx_ev_usecs_to_ticks(enp, us, &ticks)) != 0) + goto fail2; + EFSYS_ASSERT(ticks > 0); EFX_POPULATE_DWORD_2(dword, FRF_CZ_TC_TIMER_MODE, FFE_CZ_TIMER_MODE_INT_HLDOFF, - FRF_CZ_TC_TIMER_VAL, timer_val); + FRF_CZ_TC_TIMER_VAL, ticks - 1); } locked = (eep->ee_index == 0) ? 1 : 0; @@ -1245,6 +1263,8 @@ siena_ev_qmoderate( return (0); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); From owner-svn-src-all@freebsd.org Fri Jun 17 09:02:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58A7FA78185; Fri, 17 Jun 2016 09:02:53 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F1CE18F3; Fri, 17 Jun 2016 09:02:52 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5H92qEh014935; Fri, 17 Jun 2016 09:02:52 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5H92qfl014931; Fri, 17 Jun 2016 09:02:52 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201606170902.u5H92qfl014931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 17 Jun 2016 09:02:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301985 - in stable/10/sys/dev/sfxge: . common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2016 09:02:53 -0000 Author: arybchik Date: Fri Jun 17 09:02:51 2016 New Revision: 301985 URL: https://svnweb.freebsd.org/changeset/base/301985 Log: MFC r301309 sfxge(4): always be ready to receive batched events When the low-latency firmware variant is running, it is reported as not being capable of batching RX events, but it can still do so if the FORCE_EV_MERGING flag is set on an RXQ. Therefore we need to handle batched RX events even if the capability isn't set. If this bug is fixed in the firmware such that the capability is set even when running the low-latency firmware variant, it will almost always be reported so I don't think we lose much by removing the check. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D6705 Modified: stable/10/sys/dev/sfxge/common/ef10_nic.c stable/10/sys/dev/sfxge/sfxge_ev.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/ef10_nic.c Fri Jun 17 09:01:11 2016 (r301984) +++ stable/10/sys/dev/sfxge/common/ef10_nic.c Fri Jun 17 09:02:51 2016 (r301985) @@ -1003,8 +1003,11 @@ ef10_get_datapath_caps( encp->enc_rx_batching_enabled = CAP_FLAG(flags, RX_BATCHING) ? B_TRUE : B_FALSE; - if (encp->enc_rx_batching_enabled) - encp->enc_rx_batch_max = 16; + /* + * Even if batching isn't reported as supported, we may still get + * batched events. + */ + encp->enc_rx_batch_max = 16; /* Check if the firmware supports disabling scatter on RXQs */ encp->enc_rx_disable_scatter_supported = Modified: stable/10/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_ev.c Fri Jun 17 09:01:11 2016 (r301984) +++ stable/10/sys/dev/sfxge/sfxge_ev.c Fri Jun 17 09:02:51 2016 (r301985) @@ -123,8 +123,7 @@ sfxge_ev_rx(void *arg, uint32_t label, u rxq->pending += delta; if (delta != 1) { - if ((!efx_nic_cfg_get(sc->enp)->enc_rx_batching_enabled) || - (delta <= 0) || + if ((delta <= 0) || (delta > efx_nic_cfg_get(sc->enp)->enc_rx_batch_max)) { evq->exception = B_TRUE; From owner-svn-src-all@freebsd.org Fri Jun 17 09:04:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26EBAA7823B; Fri, 17 Jun 2016 09:04:08 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F29FF1B00; Fri, 17 Jun 2016 09:04:07 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5H947BW015066; Fri, 17 Jun 2016 09:04:07 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5H946E0015063; Fri, 17 Jun 2016 09:04:06 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201606170904.u5H946E0015063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 17 Jun 2016 09:04:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301986 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2016 09:04:08 -0000 Author: arybchik Date: Fri Jun 17 09:04:06 2016 New Revision: 301986 URL: https://svnweb.freebsd.org/changeset/base/301986 Log: MFC r301427 sfxge(4): allow firmware to auto-configure event queues on Medford On Medford, licenses are required to enable RX and event cut through and to disable RX batching. To avoid the need for the driver to make decisions based on the licensing state, the MC_CMD_INIT_EVQ has been extended to allow us to leave the decision to the firmware. If the adapter is licensed for low-latency use, the firmware will choose the optimal settings for latency, otherwise it will use the best settings for throughput. For Huntington we still need to choose the settings ourselves. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D6717 Modified: stable/10/sys/dev/sfxge/common/ef10_ev.c stable/10/sys/dev/sfxge/common/ef10_nic.c stable/10/sys/dev/sfxge/common/efx.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/common/ef10_ev.c Fri Jun 17 09:02:51 2016 (r301985) +++ stable/10/sys/dev/sfxge/common/ef10_ev.c Fri Jun 17 09:04:06 2016 (r301986) @@ -139,7 +139,8 @@ efx_mcdi_init_evq( __in efsys_mem_t *esmp, __in size_t nevs, __in uint32_t irq, - __in uint32_t us) + __in uint32_t us, + __in boolean_t low_latency) { efx_mcdi_req_t req; uint8_t payload[ @@ -149,7 +150,7 @@ efx_mcdi_init_evq( uint64_t addr; int npages; int i; - int supports_rx_batching; + int ev_cut_through; efx_rc_t rc; npages = EFX_EVQ_NBUFS(nevs); @@ -170,21 +171,19 @@ efx_mcdi_init_evq( MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_IRQ_NUM, irq); /* - * On Huntington RX and TX event batching can only be requested - * together (even if the datapath firmware doesn't actually support RX - * batching). - * Cut through is incompatible with RX batching and so enabling cut - * through disables RX batching (but it does not affect TX batching). + * On Huntington RX and TX event batching can only be requested together + * (even if the datapath firmware doesn't actually support RX + * batching). If event cut through is enabled no RX batching will occur. * - * So always enable RX and TX event batching, and enable cut through - * if RX event batching isn't supported (i.e. on low latency firmware). + * So always enable RX and TX event batching, and enable event cut + * through if we want low latency operation. */ - supports_rx_batching = enp->en_nic_cfg.enc_rx_batching_enabled ? 1 : 0; + ev_cut_through = low_latency ? 1 : 0; MCDI_IN_POPULATE_DWORD_6(req, INIT_EVQ_IN_FLAGS, INIT_EVQ_IN_FLAG_INTERRUPTING, 1, INIT_EVQ_IN_FLAG_RPTR_DOS, 0, INIT_EVQ_IN_FLAG_INT_ARMD, 0, - INIT_EVQ_IN_FLAG_CUT_THRU, !supports_rx_batching, + INIT_EVQ_IN_FLAG_CUT_THRU, ev_cut_through, INIT_EVQ_IN_FLAG_RX_MERGE, 1, INIT_EVQ_IN_FLAG_TX_MERGE, 1); @@ -250,6 +249,114 @@ fail1: return (rc); } + +static __checkReturn efx_rc_t +efx_mcdi_init_evq_v2( + __in efx_nic_t *enp, + __in unsigned int instance, + __in efsys_mem_t *esmp, + __in size_t nevs, + __in uint32_t irq, + __in uint32_t us) +{ + efx_mcdi_req_t req; + uint8_t payload[ + MAX(MC_CMD_INIT_EVQ_V2_IN_LEN(EFX_EVQ_NBUFS(EFX_EVQ_MAXNEVS)), + MC_CMD_INIT_EVQ_V2_OUT_LEN)]; + efx_qword_t *dma_addr; + uint64_t addr; + int npages; + int i; + efx_rc_t rc; + + npages = EFX_EVQ_NBUFS(nevs); + if (MC_CMD_INIT_EVQ_V2_IN_LEN(npages) > MC_CMD_INIT_EVQ_V2_IN_LENMAX) { + rc = EINVAL; + goto fail1; + } + + (void) memset(payload, 0, sizeof (payload)); + req.emr_cmd = MC_CMD_INIT_EVQ; + req.emr_in_buf = payload; + req.emr_in_length = MC_CMD_INIT_EVQ_V2_IN_LEN(npages); + req.emr_out_buf = payload; + req.emr_out_length = MC_CMD_INIT_EVQ_V2_OUT_LEN; + + MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_SIZE, nevs); + MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_INSTANCE, instance); + MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_IRQ_NUM, irq); + + MCDI_IN_POPULATE_DWORD_4(req, INIT_EVQ_V2_IN_FLAGS, + INIT_EVQ_V2_IN_FLAG_INTERRUPTING, 1, + INIT_EVQ_V2_IN_FLAG_RPTR_DOS, 0, + INIT_EVQ_V2_IN_FLAG_INT_ARMD, 0, + INIT_EVQ_V2_IN_FLAG_TYPE, MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_AUTO); + + /* If the value is zero then disable the timer */ + if (us == 0) { + MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_TMR_MODE, + MC_CMD_INIT_EVQ_V2_IN_TMR_MODE_DIS); + MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_TMR_LOAD, 0); + MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_TMR_RELOAD, 0); + } else { + unsigned int ticks; + + if ((rc = efx_ev_usecs_to_ticks(enp, us, &ticks)) != 0) + goto fail2; + + MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_TMR_MODE, + MC_CMD_INIT_EVQ_V2_IN_TMR_INT_HLDOFF); + MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_TMR_LOAD, ticks); + MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_TMR_RELOAD, ticks); + } + + MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_COUNT_MODE, + MC_CMD_INIT_EVQ_V2_IN_COUNT_MODE_DIS); + MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_COUNT_THRSHLD, 0); + + dma_addr = MCDI_IN2(req, efx_qword_t, INIT_EVQ_V2_IN_DMA_ADDR); + addr = EFSYS_MEM_ADDR(esmp); + + for (i = 0; i < npages; i++) { + EFX_POPULATE_QWORD_2(*dma_addr, + EFX_DWORD_1, (uint32_t)(addr >> 32), + EFX_DWORD_0, (uint32_t)(addr & 0xffffffff)); + + dma_addr++; + addr += EFX_BUF_SIZE; + } + + efx_mcdi_execute(enp, &req); + + if (req.emr_rc != 0) { + rc = req.emr_rc; + goto fail3; + } + + if (req.emr_out_length_used < MC_CMD_INIT_EVQ_V2_OUT_LEN) { + rc = EMSGSIZE; + goto fail4; + } + + /* NOTE: ignore the returned IRQ param as firmware does not set it. */ + + EFSYS_PROBE1(mcdi_evq_flags, uint32_t, + MCDI_OUT_DWORD(req, INIT_EVQ_V2_OUT_FLAGS)); + + return (0); + +fail4: + EFSYS_PROBE(fail4); +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + static __checkReturn efx_rc_t efx_mcdi_fini_evq( __in efx_nic_t *enp, @@ -348,11 +455,41 @@ ef10_ev_qcreate( * Interrupts may be raised for events immediately after the queue is * created. See bug58606. */ - if ((rc = efx_mcdi_init_evq(enp, index, esmp, n, irq, us)) != 0) - goto fail4; + + if (encp->enc_init_evq_v2_supported) { + /* + * On Medford the low latency license is required to enable RX + * and event cut through and to disable RX batching. We let the + * firmware decide the settings to use. If the adapter has a low + * latency license, it will choose the best settings for low + * latency, otherwise it choose the best settings for + * throughput. + */ + rc = efx_mcdi_init_evq_v2(enp, index, esmp, n, irq, us); + if (rc != 0) + goto fail4; + } else { + /* + * On Huntington we need to specify the settings to use. We + * favour latency if the adapter is running low-latency firmware + * and throughput otherwise, and assume not support RX batching + * implies the adapter is running low-latency firmware. (This + * is how it's been done since Huntington GA. It doesn't make + * much sense with hindsight as the 'low-latency' firmware + * variant is also best for throughput, and does now support RX + * batching). + */ + boolean_t low_latency = encp->enc_rx_batching_enabled ? 0 : 1; + rc = efx_mcdi_init_evq(enp, index, esmp, n, irq, us, + low_latency); + if (rc != 0) + goto fail5; + } return (0); +fail5: + EFSYS_PROBE(fail5); fail4: EFSYS_PROBE(fail4); fail3: Modified: stable/10/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- stable/10/sys/dev/sfxge/common/ef10_nic.c Fri Jun 17 09:02:51 2016 (r301985) +++ stable/10/sys/dev/sfxge/common/ef10_nic.c Fri Jun 17 09:04:06 2016 (r301986) @@ -1025,6 +1025,13 @@ ef10_get_datapath_caps( encp->enc_enhanced_set_mac_supported = CAP_FLAG(flags, SET_MAC_ENHANCED) ? B_TRUE : B_FALSE; + /* + * Check if firmware supports version 2 of MC_CMD_INIT_EVQ, which allows + * us to let the firmware choose the settings to use on an EVQ. + */ + encp->enc_init_evq_v2_supported = + CAP_FLAG2(flags2, INIT_EVQ_V2) ? B_TRUE : B_FALSE; + #undef CAP_FLAG #undef CAP_FLAG2 Modified: stable/10/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/10/sys/dev/sfxge/common/efx.h Fri Jun 17 09:02:51 2016 (r301985) +++ stable/10/sys/dev/sfxge/common/efx.h Fri Jun 17 09:04:06 2016 (r301986) @@ -1148,6 +1148,7 @@ typedef struct efx_nic_cfg_s { boolean_t enc_rx_disable_scatter_supported; boolean_t enc_allow_set_mac_with_installed_filters; boolean_t enc_enhanced_set_mac_supported; + boolean_t enc_init_evq_v2_supported; /* External port identifier */ uint8_t enc_external_port; uint32_t enc_mcdi_max_payload_length; From owner-svn-src-all@freebsd.org Fri Jun 17 09:05:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 796A1A782F1; Fri, 17 Jun 2016 09:05:27 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A0271D5D; Fri, 17 Jun 2016 09:05:27 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5H95QOd015318; Fri, 17 Jun 2016 09:05:26 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5H95QKt015317; Fri, 17 Jun 2016 09:05:26 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201606170905.u5H95QKt015317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 17 Jun 2016 09:05:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301987 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2016 09:05:27 -0000 Author: arybchik Date: Fri Jun 17 09:05:26 2016 New Revision: 301987 URL: https://svnweb.freebsd.org/changeset/base/301987 Log: MFC r301495 sfxge(4): update TX vFIFO ULL tag location to avoid merge conflict Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/ef10_tlv_layout.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/ef10_tlv_layout.h ============================================================================== --- stable/10/sys/dev/sfxge/common/ef10_tlv_layout.h Fri Jun 17 09:04:06 2016 (r301986) +++ stable/10/sys/dev/sfxge/common/ef10_tlv_layout.h Fri Jun 17 09:05:26 2016 (r301987) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012-2015 Solarflare Communications Inc. + * Copyright (c) 2012-2016 Solarflare Communications Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -801,7 +801,7 @@ struct tlv_tx_event_merging_config { * know if the low latency mode is enabled. */ -#define TLV_TAG_TX_VFIFO_ULL_MODE (0x10220000) +#define TLV_TAG_TX_VFIFO_ULL_MODE (0x10270000) struct tlv_tx_vfifo_ull_mode { uint32_t tag; uint32_t length; From owner-svn-src-all@freebsd.org Fri Jun 17 09:06:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01B08A78362; Fri, 17 Jun 2016 09:06:32 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A9C6B1ECA; Fri, 17 Jun 2016 09:06:31 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5H96UKo015433; Fri, 17 Jun 2016 09:06:30 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5H96U9g015432; Fri, 17 Jun 2016 09:06:30 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201606170906.u5H96U9g015432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 17 Jun 2016 09:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301988 - stable/10/sys/dev/sfxge/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2016 09:06:32 -0000 Author: arybchik Date: Fri Jun 17 09:06:30 2016 New Revision: 301988 URL: https://svnweb.freebsd.org/changeset/base/301988 Log: MFC r301604 sfxge(4): cleanup: add missing probes to ef10_nvram_segment_write_tlv Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/common/ef10_nvram.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- stable/10/sys/dev/sfxge/common/ef10_nvram.c Fri Jun 17 09:05:26 2016 (r301987) +++ stable/10/sys/dev/sfxge/common/ef10_nvram.c Fri Jun 17 09:06:30 2016 (r301988) @@ -1658,7 +1658,7 @@ ef10_nvram_partn_write_tlv( * Read a segment from nvram at the given offset into a buffer (segment_data) * and optionally write a new tag to it. */ - static __checkReturn efx_rc_t +static __checkReturn efx_rc_t ef10_nvram_segment_write_tlv( __in efx_nic_t *enp, __in uint32_t partn, @@ -1684,20 +1684,25 @@ ef10_nvram_segment_write_tlv( */ status = ef10_nvram_read_tlv_segment(enp, partn, *partn_offsetp, *seg_datap, *src_remain_lenp); - if (status != 0) - return (EINVAL); + if (status != 0) { + rc = EINVAL; + goto fail1; + } status = ef10_nvram_buf_segment_size(*seg_datap, *src_remain_lenp, &original_segment_size); - if (status != 0) - return (EINVAL); + if (status != 0) { + rc = EINVAL; + goto fail2; + } if (write) { /* Update the contents of the segment in the buffer */ if ((rc = ef10_nvram_buf_write_tlv(*seg_datap, *dest_remain_lenp, tag, data, size, - &modified_segment_size)) != 0) - goto fail1; + &modified_segment_size)) != 0) { + goto fail3; + } *dest_remain_lenp -= modified_segment_size; *seg_datap += modified_segment_size; } else { @@ -1714,6 +1719,10 @@ ef10_nvram_segment_write_tlv( return (0); +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); From owner-svn-src-all@freebsd.org Fri Jun 17 09:07:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 458DAA783BF; Fri, 17 Jun 2016 09:07:28 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 154E2206D; Fri, 17 Jun 2016 09:07:28 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5H97Rsv015529; Fri, 17 Jun 2016 09:07:27 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5H97RF6015528; Fri, 17 Jun 2016 09:07:27 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201606170907.u5H97RF6015528@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 17 Jun 2016 09:07:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301989 - stable/10/sys/dev/sfxge X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2016 09:07:28 -0000 Author: arybchik Date: Fri Jun 17 09:07:27 2016 New Revision: 301989 URL: https://svnweb.freebsd.org/changeset/base/301989 Log: MFC r301607 sfxge(4): host byte order is required for IP ID in TSO descriptors Submitted by: Artem V. Andreev Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Fri Jun 17 09:06:30 2016 (r301988) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Fri Jun 17 09:07:27 2016 (r301989) @@ -973,7 +973,7 @@ static void tso_start(struct sfxge_txq * tso->protocol = TSO_MBUF_PROTO(mbuf); tso->nh_off = mbuf->m_pkthdr.l2hlen; tso->tcph_off = mbuf->m_pkthdr.l3hlen; - tso->packet_id = TSO_MBUF_PACKETID(mbuf); + tso->packet_id = ntohs(TSO_MBUF_PACKETID(mbuf)); #endif #if !SFXGE_TX_PARSE_EARLY @@ -982,7 +982,7 @@ static void tso_start(struct sfxge_txq * KASSERT(tso_iph(tso)->ip_p == IPPROTO_TCP, ("TSO required on non-TCP packet")); tso->tcph_off = tso->nh_off + 4 * tso_iph(tso)->ip_hl; - tso->packet_id = tso_iph(tso)->ip_id; + tso->packet_id = ntohs(tso_iph(tso)->ip_id); } else { KASSERT(tso->protocol == htons(ETHERTYPE_IPV6), ("TSO required on non-IP packet")); From owner-svn-src-all@freebsd.org Fri Jun 17 15:48:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32551A78C32; Fri, 17 Jun 2016 15:48:46 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 079022D45; Fri, 17 Jun 2016 15:48:46 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id F17BA18D2; Fri, 17 Jun 2016 15:48:45 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 9FDF5D4D8; Fri, 17 Jun 2016 15:48:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 83ly0AebFyNO; Fri, 17 Jun 2016 15:48:42 +0000 (UTC) Subject: Re: svn commit: r301973 - in head/usr.sbin/bsdconfig: include networking networking/include networking/share share/media DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 6186ED4D2 To: Devin Teske , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201606162114.u5GLEPa6051162@repo.freebsd.org> <4a9ec3a9-5668-f35d-82fc-f936826841db@FreeBSD.org> <1466124774.1392.54.camel@FreeBSD.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <1e26ffae-d2b4-ee52-12a6-dedc937f1483@FreeBSD.org> Date: Fri, 17 Jun 2016 08:48:43 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <1466124774.1392.54.camel@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="boHHu2aGlBtNMxofD4nVksRRc0qMUmtEI" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2016 15:48:46 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --boHHu2aGlBtNMxofD4nVksRRc0qMUmtEI Content-Type: multipart/mixed; boundary="RogIuKiDB7o9HQ0ojHwIF3Eo3uWjiQXkW" From: Bryan Drewery To: Devin Teske , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <1e26ffae-d2b4-ee52-12a6-dedc937f1483@FreeBSD.org> Subject: Re: svn commit: r301973 - in head/usr.sbin/bsdconfig: include networking networking/include networking/share share/media References: <201606162114.u5GLEPa6051162@repo.freebsd.org> <4a9ec3a9-5668-f35d-82fc-f936826841db@FreeBSD.org> <1466124774.1392.54.camel@FreeBSD.org> In-Reply-To: <1466124774.1392.54.camel@FreeBSD.org> --RogIuKiDB7o9HQ0ojHwIF3Eo3uWjiQXkW Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 6/16/2016 5:52 PM, Devin Teske wrote: > On Thu, 2016-06-16 at 14:28 -0700, Bryan Drewery wrote: >> On 6/16/16 2:14 PM, Devin Teske wrote: >>> Author: dteske >>> Date: Thu Jun 16 21:14:25 2016 >>> New Revision: 301973 >>> URL: https://svnweb.freebsd.org/changeset/base/301973 >>> >>> Log: >>> Add bsdconfig `wifi' (aka `wireless' or `wlan') module >>> =20 >>> Approved by: re (gjb) >>> MFC after: 8 weeks >> >> 8 weeks is about August 11. >> >> Presumably you think this change is not "stable" enough for the >> stable/10 branch (note that "stable" has different meanings there). >> >> releng/11.0 branch: July 29, 2016 >> ports/ release tag: August 12, 2016 >> RC3 build starts: August 12, 2016 [*] >> RELEASE build starts: August 19, 2016 >> [*] - If needed >> >> Looking at the planned schedule, you won't MFC it to stable/10 (which >> won't be released for a year?) until nearly the release of 11.0. My >> question is, does this really belong in head right now for 11.0 or >> should it wait until after the stable/11 branching? >> >> >>> Relnotes: yes >> >> >=20 > I may never MFC it. >=20 > The 8 weeks is to remind me to re-think that when I get the reminder > from sobomax. >=20 > It actually cannot be MFC'd without changes. There are some very slight= > minor differences in 10 and 11. >=20 > The 8 weeks should not reflect how stable the code is or not, but > rather that is a time when I predict I might have the time/energy to > integrate it into the older branch(es). >=20 Thank you for the explanation! Sounds fine. --=20 Regards, Bryan Drewery --RogIuKiDB7o9HQ0ojHwIF3Eo3uWjiQXkW-- --boHHu2aGlBtNMxofD4nVksRRc0qMUmtEI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJXZBvfAAoJEDXXcbtuRpfPq7QIAIX05cDRZjw1sRTVbZ379mDY qwFju6HYp1cgZvRrZ3BLF2C5qEJ3e13IEiTkBJ6j11g0G9efIbeo1mywV1swBbX0 sHQ8dZkj4QCmRM4SZglsWL8f6hrv73q7C0enxvAy/sH5aXbeSbH0Qnxiuxa9LJyH cjQPHk5D8KbMpZo/NAOwRb0jWWQ4X2Yre5TuhGB5TwOM7lS8usYn3xuR+HTdD668 QC58qhjVOQiCHL/YuQItvqLLcF63bXaZLNKelZ41epcfhsuKY+PPGOtQ+5bAeCqS nNTJmq5VoNOw3L6/7X3QhTqYCjFXART2wcW//6ZkyDwmtFxRMoiRyFRjdwVQ2AE= =57OR -----END PGP SIGNATURE----- --boHHu2aGlBtNMxofD4nVksRRc0qMUmtEI-- From owner-svn-src-all@freebsd.org Fri Jun 17 16:34:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3F8EA77C38; Fri, 17 Jun 2016 16:34:26 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94F0D2D2C; Fri, 17 Jun 2016 16:34:26 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5HGYPiU083215; Fri, 17 Jun 2016 16:34:25 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5HGYP22083214; Fri, 17 Jun 2016 16:34:25 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201606171634.u5HGYP22083214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Fri, 17 Jun 2016 16:34:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301991 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2016 16:34:26 -0000 Author: lidl Date: Fri Jun 17 16:34:25 2016 New Revision: 301991 URL: https://svnweb.freebsd.org/changeset/base/301991 Log: Note ipfilter support in blacklist-helper script in relnotes Approved by: re (gjb) Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Jun 17 16:14:42 2016 (r301990) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Jun 17 16:34:25 2016 (r301991) @@ -631,6 +631,9 @@ the &man.ipfw.4; packet filter has been added to the blacklistd-helper script. + Support for + the &man.ipfilter.4; packet filter has been added to the + blacklistd-helper script. From owner-svn-src-all@freebsd.org Fri Jun 17 16:44:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64203A77F9C; Fri, 17 Jun 2016 16:44:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F9B5163B; Fri, 17 Jun 2016 16:44:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5HGiVQ5087017; Fri, 17 Jun 2016 16:44:31 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5HGiVuD087016; Fri, 17 Jun 2016 16:44:31 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606171644.u5HGiVuD087016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 17 Jun 2016 16:44:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301992 - head/contrib/llvm/tools/clang/tools/clang-format X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2016 16:44:32 -0000 Author: bdrewery Date: Fri Jun 17 16:44:31 2016 New Revision: 301992 URL: https://svnweb.freebsd.org/changeset/base/301992 Log: Import ClangFormat.cpp from ^/vendor/clang/clang-release_380-r262564 Discussed with: dim Approved by: re (gjb) Added: head/contrib/llvm/tools/clang/tools/clang-format/ head/contrib/llvm/tools/clang/tools/clang-format/ClangFormat.cpp - copied unchanged from r301991, vendor/clang/clang-release_380-r262564/tools/clang-format/ClangFormat.cpp Copied: head/contrib/llvm/tools/clang/tools/clang-format/ClangFormat.cpp (from r301991, vendor/clang/clang-release_380-r262564/tools/clang-format/ClangFormat.cpp) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/tools/clang/tools/clang-format/ClangFormat.cpp Fri Jun 17 16:44:31 2016 (r301992, copy of r301991, vendor/clang/clang-release_380-r262564/tools/clang-format/ClangFormat.cpp) @@ -0,0 +1,364 @@ +//===-- clang-format/ClangFormat.cpp - Clang format tool ------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +/// +/// \file +/// \brief This file implements a clang-format tool that automatically formats +/// (fragments of) C++ code. +/// +//===----------------------------------------------------------------------===// + +#include "clang/Basic/Diagnostic.h" +#include "clang/Basic/DiagnosticOptions.h" +#include "clang/Basic/FileManager.h" +#include "clang/Basic/SourceManager.h" +#include "clang/Basic/Version.h" +#include "clang/Format/Format.h" +#include "clang/Rewrite/Core/Rewriter.h" +#include "llvm/ADT/StringMap.h" +#include "llvm/Support/CommandLine.h" +#include "llvm/Support/Debug.h" +#include "llvm/Support/FileSystem.h" +#include "llvm/Support/Signals.h" + +using namespace llvm; +using clang::tooling::Replacements; + +static cl::opt Help("h", cl::desc("Alias for -help"), cl::Hidden); + +// Mark all our options with this category, everything else (except for -version +// and -help) will be hidden. +static cl::OptionCategory ClangFormatCategory("Clang-format options"); + +static cl::list + Offsets("offset", + cl::desc("Format a range starting at this byte offset.\n" + "Multiple ranges can be formatted by specifying\n" + "several -offset and -length pairs.\n" + "Can only be used with one input file."), + cl::cat(ClangFormatCategory)); +static cl::list + Lengths("length", + cl::desc("Format a range of this length (in bytes).\n" + "Multiple ranges can be formatted by specifying\n" + "several -offset and -length pairs.\n" + "When only a single -offset is specified without\n" + "-length, clang-format will format up to the end\n" + "of the file.\n" + "Can only be used with one input file."), + cl::cat(ClangFormatCategory)); +static cl::list +LineRanges("lines", cl::desc(": - format a range of\n" + "lines (both 1-based).\n" + "Multiple ranges can be formatted by specifying\n" + "several -lines arguments.\n" + "Can't be used with -offset and -length.\n" + "Can only be used with one input file."), + cl::cat(ClangFormatCategory)); +static cl::opt + Style("style", + cl::desc(clang::format::StyleOptionHelpDescription), + cl::init("file"), cl::cat(ClangFormatCategory)); +static cl::opt +FallbackStyle("fallback-style", + cl::desc("The name of the predefined style used as a\n" + "fallback in case clang-format is invoked with\n" + "-style=file, but can not find the .clang-format\n" + "file to use.\n" + "Use -fallback-style=none to skip formatting."), + cl::init("LLVM"), cl::cat(ClangFormatCategory)); + +static cl::opt +AssumeFileName("assume-filename", + cl::desc("When reading from stdin, clang-format assumes this\n" + "filename to look for a style config file (with\n" + "-style=file) and to determine the language."), + cl::init(""), cl::cat(ClangFormatCategory)); + +static cl::opt Inplace("i", + cl::desc("Inplace edit s, if specified."), + cl::cat(ClangFormatCategory)); + +static cl::opt OutputXML("output-replacements-xml", + cl::desc("Output replacements as XML."), + cl::cat(ClangFormatCategory)); +static cl::opt + DumpConfig("dump-config", + cl::desc("Dump configuration options to stdout and exit.\n" + "Can be used with -style option."), + cl::cat(ClangFormatCategory)); +static cl::opt + Cursor("cursor", + cl::desc("The position of the cursor when invoking\n" + "clang-format from an editor integration"), + cl::init(0), cl::cat(ClangFormatCategory)); + +static cl::opt SortIncludes( + "sort-includes", + cl::desc("If set, overrides the include sorting behavior determined by the " + "SortIncludes style flag"), + cl::cat(ClangFormatCategory)); + +static cl::list FileNames(cl::Positional, cl::desc("[ ...]"), + cl::cat(ClangFormatCategory)); + +namespace clang { +namespace format { + +static FileID createInMemoryFile(StringRef FileName, MemoryBuffer *Source, + SourceManager &Sources, FileManager &Files, + vfs::InMemoryFileSystem *MemFS) { + MemFS->addFileNoOwn(FileName, 0, Source); + return Sources.createFileID(Files.getFile(FileName), SourceLocation(), + SrcMgr::C_User); +} + +// Parses : input to a pair of line numbers. +// Returns true on error. +static bool parseLineRange(StringRef Input, unsigned &FromLine, + unsigned &ToLine) { + std::pair LineRange = Input.split(':'); + return LineRange.first.getAsInteger(0, FromLine) || + LineRange.second.getAsInteger(0, ToLine); +} + +static bool fillRanges(MemoryBuffer *Code, + std::vector &Ranges) { + IntrusiveRefCntPtr InMemoryFileSystem( + new vfs::InMemoryFileSystem); + FileManager Files(FileSystemOptions(), InMemoryFileSystem); + DiagnosticsEngine Diagnostics( + IntrusiveRefCntPtr(new DiagnosticIDs), + new DiagnosticOptions); + SourceManager Sources(Diagnostics, Files); + FileID ID = createInMemoryFile("", Code, Sources, Files, + InMemoryFileSystem.get()); + if (!LineRanges.empty()) { + if (!Offsets.empty() || !Lengths.empty()) { + errs() << "error: cannot use -lines with -offset/-length\n"; + return true; + } + + for (unsigned i = 0, e = LineRanges.size(); i < e; ++i) { + unsigned FromLine, ToLine; + if (parseLineRange(LineRanges[i], FromLine, ToLine)) { + errs() << "error: invalid : pair\n"; + return true; + } + if (FromLine > ToLine) { + errs() << "error: start line should be less than end line\n"; + return true; + } + SourceLocation Start = Sources.translateLineCol(ID, FromLine, 1); + SourceLocation End = Sources.translateLineCol(ID, ToLine, UINT_MAX); + if (Start.isInvalid() || End.isInvalid()) + return true; + unsigned Offset = Sources.getFileOffset(Start); + unsigned Length = Sources.getFileOffset(End) - Offset; + Ranges.push_back(tooling::Range(Offset, Length)); + } + return false; + } + + if (Offsets.empty()) + Offsets.push_back(0); + if (Offsets.size() != Lengths.size() && + !(Offsets.size() == 1 && Lengths.empty())) { + errs() << "error: number of -offset and -length arguments must match.\n"; + return true; + } + for (unsigned i = 0, e = Offsets.size(); i != e; ++i) { + if (Offsets[i] >= Code->getBufferSize()) { + errs() << "error: offset " << Offsets[i] << " is outside the file\n"; + return true; + } + SourceLocation Start = + Sources.getLocForStartOfFile(ID).getLocWithOffset(Offsets[i]); + SourceLocation End; + if (i < Lengths.size()) { + if (Offsets[i] + Lengths[i] > Code->getBufferSize()) { + errs() << "error: invalid length " << Lengths[i] + << ", offset + length (" << Offsets[i] + Lengths[i] + << ") is outside the file.\n"; + return true; + } + End = Start.getLocWithOffset(Lengths[i]); + } else { + End = Sources.getLocForEndOfFile(ID); + } + unsigned Offset = Sources.getFileOffset(Start); + unsigned Length = Sources.getFileOffset(End) - Offset; + Ranges.push_back(tooling::Range(Offset, Length)); + } + return false; +} + +static void outputReplacementXML(StringRef Text) { + // FIXME: When we sort includes, we need to make sure the stream is correct + // utf-8. + size_t From = 0; + size_t Index; + while ((Index = Text.find_first_of("\n\r<&", From)) != StringRef::npos) { + outs() << Text.substr(From, Index - From); + switch (Text[Index]) { + case '\n': + outs() << " "; + break; + case '\r': + outs() << " "; + break; + case '<': + outs() << "<"; + break; + case '&': + outs() << "&"; + break; + default: + llvm_unreachable("Unexpected character encountered!"); + } + From = Index + 1; + } + outs() << Text.substr(From); +} + +static void outputReplacementsXML(const Replacements &Replaces) { + for (const auto &R : Replaces) { + outs() << ""; + outputReplacementXML(R.getReplacementText()); + outs() << "\n"; + } +} + +// Returns true on error. +static bool format(StringRef FileName) { + ErrorOr> CodeOrErr = + MemoryBuffer::getFileOrSTDIN(FileName); + if (std::error_code EC = CodeOrErr.getError()) { + errs() << EC.message() << "\n"; + return true; + } + std::unique_ptr Code = std::move(CodeOrErr.get()); + if (Code->getBufferSize() == 0) + return false; // Empty files are formatted correctly. + std::vector Ranges; + if (fillRanges(Code.get(), Ranges)) + return true; + StringRef AssumedFileName = (FileName == "-") ? AssumeFileName : FileName; + FormatStyle FormatStyle = getStyle(Style, AssumedFileName, FallbackStyle); + if (SortIncludes.getNumOccurrences() != 0) + FormatStyle.SortIncludes = SortIncludes; + unsigned CursorPosition = Cursor; + Replacements Replaces = sortIncludes(FormatStyle, Code->getBuffer(), Ranges, + AssumedFileName, &CursorPosition); + std::string ChangedCode = + tooling::applyAllReplacements(Code->getBuffer(), Replaces); + for (const auto &R : Replaces) + Ranges.push_back({R.getOffset(), R.getLength()}); + + bool IncompleteFormat = false; + Replacements FormatChanges = reformat(FormatStyle, ChangedCode, Ranges, + AssumedFileName, &IncompleteFormat); + Replaces = tooling::mergeReplacements(Replaces, FormatChanges); + if (OutputXML) { + outs() << "\n\n"; + if (Cursor.getNumOccurrences() != 0) + outs() << "" + << tooling::shiftedCodePosition(FormatChanges, CursorPosition) + << "\n"; + + outputReplacementsXML(Replaces); + outs() << "\n"; + } else { + IntrusiveRefCntPtr InMemoryFileSystem( + new vfs::InMemoryFileSystem); + FileManager Files(FileSystemOptions(), InMemoryFileSystem); + DiagnosticsEngine Diagnostics( + IntrusiveRefCntPtr(new DiagnosticIDs), + new DiagnosticOptions); + SourceManager Sources(Diagnostics, Files); + FileID ID = createInMemoryFile(AssumedFileName, Code.get(), Sources, Files, + InMemoryFileSystem.get()); + Rewriter Rewrite(Sources, LangOptions()); + tooling::applyAllReplacements(Replaces, Rewrite); + if (Inplace) { + if (FileName == "-") + errs() << "error: cannot use -i when reading from stdin.\n"; + else if (Rewrite.overwriteChangedFiles()) + return true; + } else { + if (Cursor.getNumOccurrences() != 0) + outs() << "{ \"Cursor\": " + << tooling::shiftedCodePosition(FormatChanges, CursorPosition) + << ", \"IncompleteFormat\": " + << (IncompleteFormat ? "true" : "false") << " }\n"; + Rewrite.getEditBuffer(ID).write(outs()); + } + } + return false; +} + +} // namespace format +} // namespace clang + +static void PrintVersion() { + raw_ostream &OS = outs(); + OS << clang::getClangToolFullVersion("clang-format") << '\n'; +} + +int main(int argc, const char **argv) { + llvm::sys::PrintStackTraceOnErrorSignal(); + + cl::HideUnrelatedOptions(ClangFormatCategory); + + cl::SetVersionPrinter(PrintVersion); + cl::ParseCommandLineOptions( + argc, argv, + "A tool to format C/C++/Java/JavaScript/Objective-C/Protobuf code.\n\n" + "If no arguments are specified, it formats the code from standard input\n" + "and writes the result to the standard output.\n" + "If s are given, it reformats the files. If -i is specified\n" + "together with s, the files are edited in-place. Otherwise, the\n" + "result is written to the standard output.\n"); + + if (Help) + cl::PrintHelpMessage(); + + if (DumpConfig) { + std::string Config = + clang::format::configurationAsText(clang::format::getStyle( + Style, FileNames.empty() ? AssumeFileName : FileNames[0], + FallbackStyle)); + outs() << Config << "\n"; + return 0; + } + + bool Error = false; + switch (FileNames.size()) { + case 0: + Error = clang::format::format("-"); + break; + case 1: + Error = clang::format::format(FileNames[0]); + break; + default: + if (!Offsets.empty() || !Lengths.empty() || !LineRanges.empty()) { + errs() << "error: -offset, -length and -lines can only be used for " + "single file.\n"; + return 1; + } + for (unsigned i = 0; i < FileNames.size(); ++i) + Error |= clang::format::format(FileNames[i]); + break; + } + return Error ? 1 : 0; +} + From owner-svn-src-all@freebsd.org Fri Jun 17 16:47:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E042A7801D; Fri, 17 Jun 2016 16:47:01 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 05C26180B; Fri, 17 Jun 2016 16:47:00 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5HGl0Oo087155; Fri, 17 Jun 2016 16:47:00 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5HGkxN9087141; Fri, 17 Jun 2016 16:46:59 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606171646.u5HGkxN9087141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 17 Jun 2016 16:46:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301993 - in head: lib/clang lib/clang/libclangformat lib/clang/libclangtoolingcore targets/pseudo/clang tools/build/mk usr.bin/clang usr.bin/clang/clang-format X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2016 16:47:01 -0000 Author: bdrewery Date: Fri Jun 17 16:46:58 2016 New Revision: 301993 URL: https://svnweb.freebsd.org/changeset/base/301993 Log: Add clang-format under WITH_CLANG_EXTRAS. Reviewed by: dim Approved by: re (gjb) Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D6856 Added: head/lib/clang/libclangformat/ head/lib/clang/libclangformat/Makefile (contents, props changed) head/lib/clang/libclangformat/Makefile.depend (contents, props changed) head/lib/clang/libclangtoolingcore/ head/lib/clang/libclangtoolingcore/Makefile (contents, props changed) head/lib/clang/libclangtoolingcore/Makefile.depend (contents, props changed) head/usr.bin/clang/clang-format/ head/usr.bin/clang/clang-format/Makefile (contents, props changed) head/usr.bin/clang/clang-format/Makefile.depend (contents, props changed) Modified: head/lib/clang/Makefile head/targets/pseudo/clang/Makefile.depend head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.bin/clang/Makefile Modified: head/lib/clang/Makefile ============================================================================== --- head/lib/clang/Makefile Fri Jun 17 16:44:31 2016 (r301992) +++ head/lib/clang/Makefile Fri Jun 17 16:46:58 2016 (r301993) @@ -90,7 +90,9 @@ SUBDIR= libclanganalysis \ libllvmx86utils .if ${MK_CLANG_EXTRAS} != "no" -SUBDIR+=libllvmdebuginfodwarf \ +SUBDIR+=libclangformat \ + libclangtoolingcore \ + libllvmdebuginfodwarf \ libllvmdebuginfopdb \ libllvmlibdriver \ libllvmlto \ Added: head/lib/clang/libclangformat/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libclangformat/Makefile Fri Jun 17 16:46:58 2016 (r301993) @@ -0,0 +1,20 @@ +# $FreeBSD$ + +.include + +LIB= clangformat + +SRCDIR= tools/clang/lib/Format + +SRCS= BreakableToken.cpp \ + ContinuationIndenter.cpp \ + Format.cpp \ + FormatToken.cpp \ + TokenAnnotator.cpp \ + UnwrappedLineFormatter.cpp \ + UnwrappedLineParser.cpp \ + WhitespaceManager.cpp + +TGHDRS= DiagnosticCommonKinds + +.include "../clang.lib.mk" Added: head/lib/clang/libclangformat/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libclangformat/Makefile.depend Fri Jun 17 16:46:58 2016 (r301993) @@ -0,0 +1,15 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + include \ + include/xlocale \ + lib/libc++ \ + lib/msun \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Added: head/lib/clang/libclangtoolingcore/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libclangtoolingcore/Makefile Fri Jun 17 16:46:58 2016 (r301993) @@ -0,0 +1,19 @@ +# $FreeBSD$ + +.include + +LIB= clangtoolingcore + +SRCDIR= tools/clang/lib/Tooling/Core +CFLAGS+= -I${LLVM_SRCS}/tools +SRCS= Lookup.cpp \ + Replacement.cpp + +TGHDRS= AttrList \ + Attrs \ + CommentCommandList \ + DeclNodes \ + DiagnosticCommonKinds \ + StmtNodes + +.include "../clang.lib.mk" Added: head/lib/clang/libclangtoolingcore/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libclangtoolingcore/Makefile.depend Fri Jun 17 16:46:58 2016 (r301993) @@ -0,0 +1,15 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + include \ + include/xlocale \ + lib/libc++ \ + lib/msun \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif Modified: head/targets/pseudo/clang/Makefile.depend ============================================================================== --- head/targets/pseudo/clang/Makefile.depend Fri Jun 17 16:44:31 2016 (r301992) +++ head/targets/pseudo/clang/Makefile.depend Fri Jun 17 16:46:58 2016 (r301993) @@ -21,6 +21,7 @@ DIRDEPS+= \ .if ${MK_CLANG_EXTRAS} == "yes" DIRDEPS+= \ usr.bin/clang/bugpoint \ + usr.bin/clang/clang-format \ usr.bin/clang/llc \ usr.bin/clang/lli \ usr.bin/clang/llvm-ar \ Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Fri Jun 17 16:44:31 2016 (r301992) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Fri Jun 17 16:46:58 2016 (r301993) @@ -1237,6 +1237,7 @@ OLD_FILES+=usr/share/man/man1/llvm-tblge .if ${MK_CLANG_EXTRAS} == no OLD_FILES+=usr/bin/bugpoint +OLD_FILES+=usr/bin/clang-format OLD_FILES+=usr/bin/llc OLD_FILES+=usr/bin/lli OLD_FILES+=usr/bin/llvm-ar Modified: head/usr.bin/clang/Makefile ============================================================================== --- head/usr.bin/clang/Makefile Fri Jun 17 16:44:31 2016 (r301992) +++ head/usr.bin/clang/Makefile Fri Jun 17 16:46:58 2016 (r301993) @@ -7,6 +7,7 @@ SUBDIR= clang clang-tblgen llvm-tblgen .if !defined(TOOLS_PREFIX) .if ${MK_CLANG_EXTRAS} != "no" SUBDIR+=bugpoint \ + clang-format \ llc \ lli \ llvm-ar \ Added: head/usr.bin/clang/clang-format/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/clang/clang-format/Makefile Fri Jun 17 16:46:58 2016 (r301993) @@ -0,0 +1,23 @@ +# $FreeBSD$ + +MAN= +.include + +PROG_CXX=clang-format + +SRCDIR= tools/clang/tools/clang-format +SRCS= ClangFormat.cpp + +LIBDEPS=clangrewrite \ + clanglex \ + clangformat \ + clangbasic \ + clangast \ + clangtoolingcore \ + llvmmc \ + llvmcore \ + llvmsupport \ + +TGHDRS= DiagnosticCommonKinds + +.include "../clang.prog.mk" Added: head/usr.bin/clang/clang-format/Makefile.depend ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/clang/clang-format/Makefile.depend Fri Jun 17 16:46:58 2016 (r301993) @@ -0,0 +1,32 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/clang/libclangast \ + lib/clang/libclangbasic \ + lib/clang/libclangformat \ + lib/clang/libclanglex \ + lib/clang/libclangrewrite \ + lib/clang/libclangtoolingcore \ + lib/clang/libllvmcore \ + lib/clang/libllvmmc \ + lib/clang/libllvmsupport \ + lib/libc \ + lib/libc++ \ + lib/libcompiler_rt \ + lib/libthr \ + lib/msun \ + lib/ncurses/ncursesw \ + usr.bin/clang/clang-tblgen.host \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif From owner-svn-src-all@freebsd.org Fri Jun 17 16:51:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D54A7A7819C; Fri, 17 Jun 2016 16:51:44 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id AFE6F1B5A; Fri, 17 Jun 2016 16:51:44 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id A965A1E55; Fri, 17 Jun 2016 16:51:44 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 67AE0DAF4; Fri, 17 Jun 2016 16:51:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id EPyeL1eDRzEj; Fri, 17 Jun 2016 16:51:42 +0000 (UTC) Subject: Re: svn commit: r301959 - head/sys/kern DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 8C62EDAEE To: Konstantin Belousov , Conrad Meyer References: <201606161158.u5GBwkd1042632@repo.freebsd.org> <20160617061306.GS38613@kib.kiev.ua> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: Date: Fri, 17 Jun 2016 09:51:45 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160617061306.GS38613@kib.kiev.ua> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Jt34htBudipOAbaTOakPrNd9fq6xiSCE6" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2016 16:51:44 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Jt34htBudipOAbaTOakPrNd9fq6xiSCE6 Content-Type: multipart/mixed; boundary="HObBJ5hGTFws0doCBSAtRQaJrNbb98SSU" From: Bryan Drewery To: Konstantin Belousov , Conrad Meyer Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r301959 - head/sys/kern References: <201606161158.u5GBwkd1042632@repo.freebsd.org> <20160617061306.GS38613@kib.kiev.ua> In-Reply-To: <20160617061306.GS38613@kib.kiev.ua> --HObBJ5hGTFws0doCBSAtRQaJrNbb98SSU Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 6/16/2016 11:13 PM, Konstantin Belousov wrote: > On Thu, Jun 16, 2016 at 10:17:19AM -0700, Conrad Meyer wrote: >> style(9) nit: /* FALLTHROUGH */ >=20 > FALLTHROUGH is only applicable when there are executable statements for= > both cases, and first sequence of statements does not end in break. > Look at the switch() example right after the FALLTHROUGH requirement > in the style(9), which shows case '?'. >=20 Yes the example shows code in both cases, but the text about it is more strict "Elements in a switch statement that cascade should have a FALLTHROUGH comment." --=20 Regards, Bryan Drewery --HObBJ5hGTFws0doCBSAtRQaJrNbb98SSU-- --Jt34htBudipOAbaTOakPrNd9fq6xiSCE6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJXZCqhAAoJEDXXcbtuRpfPsC0H/jOWJXEkMMI689nbH+iWARaj MEv9UVa3KIo7XH1lnWJnUiQ1np/ihKCwMI/7q/aZbfwBkuT7DWu25Beaow6lE6ii 2Cz0gCLYTq366v7mlhEpE60M8YfG3D6k+AcR2vy7iTtbYDNvFeMCBi+2CqzvP4c6 UGGanycqUJZSCdQ7lkcXp45QDoOIsmvXCagHJHevnBB1Nk62xl/EA82jpW55x4PG MYiWqY/DyilInItofqpNX4/7KsxxHx8W+wbhFu+1GIVxwsErHuJPRQeL0VCsJ4LR Zet+LJHbUQ33m9UsYBzo0ArxmxitnldRn70EnSWaUyetgAXMDOpGTqn/8FeQAOg= =0H0+ -----END PGP SIGNATURE----- --Jt34htBudipOAbaTOakPrNd9fq6xiSCE6-- From owner-svn-src-all@freebsd.org Fri Jun 17 16:56:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 599E9A78223; Fri, 17 Jun 2016 16:56:45 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 2DA061E9F; Fri, 17 Jun 2016 16:56:45 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 26DA91045; Fri, 17 Jun 2016 16:56:45 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id D26A9DB0D; Fri, 17 Jun 2016 16:56:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 4El52RSPkeoO; Fri, 17 Jun 2016 16:56:42 +0000 (UTC) Subject: Re: svn commit: r301959 - head/sys/kern DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 3F776DB07 To: Konstantin Belousov , Conrad Meyer References: <201606161158.u5GBwkd1042632@repo.freebsd.org> <20160617061306.GS38613@kib.kiev.ua> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: Date: Fri, 17 Jun 2016 09:56:47 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PenS8IDv3O4uDII91gFuGAbi6G5xBv0sX" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2016 16:56:45 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --PenS8IDv3O4uDII91gFuGAbi6G5xBv0sX Content-Type: multipart/mixed; boundary="MKgwKcVqiIqqrf1iNTc2qvbH3MsFa3js9" From: Bryan Drewery To: Konstantin Belousov , Conrad Meyer Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r301959 - head/sys/kern References: <201606161158.u5GBwkd1042632@repo.freebsd.org> <20160617061306.GS38613@kib.kiev.ua> In-Reply-To: --MKgwKcVqiIqqrf1iNTc2qvbH3MsFa3js9 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 6/17/2016 9:51 AM, Bryan Drewery wrote: > On 6/16/2016 11:13 PM, Konstantin Belousov wrote: >> On Thu, Jun 16, 2016 at 10:17:19AM -0700, Conrad Meyer wrote: >>> style(9) nit: /* FALLTHROUGH */ >> >> FALLTHROUGH is only applicable when there are executable statements fo= r >> both cases, and first sequence of statements does not end in break. >> Look at the switch() example right after the FALLTHROUGH requirement >> in the style(9), which shows case '?'. >> >=20 > Yes the example shows code in both cases, but the text about it is more= > strict "Elements in a switch statement that cascade should have a > FALLTHROUGH comment." >=20 My personal opinion does agree with your interpretation. I think we should clarify style.9 about when to use FALLTHROUGH. --=20 Regards, Bryan Drewery --MKgwKcVqiIqqrf1iNTc2qvbH3MsFa3js9-- --PenS8IDv3O4uDII91gFuGAbi6G5xBv0sX Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJXZCvQAAoJEDXXcbtuRpfPLkYIAKSuGvE4HjTdSq7Xbh3DNH6p AzTLallgZF2NBKgYbkLSmrxLsNg2Nx7u0utcJ9AoHiftpd6nhJqQC5+Uu5j1XRaK T0f15uc14owJnWj4s4jGTVHzDzklHkbDqGq/GczDA9dVqmJyLqDTdyIT0eZjB+es bbGemsUUpigtTq9yGxMn0zA4o71lFCHQLMCKqce3/YABdQQHTX5S2jQEeAtKmeuT xdqh1KFADxPsTaMal9yscH3VEwQ7tq+MLXgxwvPwfw2H1ohUGPdLU/Zjw6R207xs 28mSuOTE8WYMvl7l5mSEzob/99CqmvIIiVpXB7X9chKv77vMmVn//KT05oeE3fE= =Sk26 -----END PGP SIGNATURE----- --PenS8IDv3O4uDII91gFuGAbi6G5xBv0sX-- From owner-svn-src-all@freebsd.org Fri Jun 17 17:01:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26BCAA78363; Fri, 17 Jun 2016 17:01:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ECB00224D; Fri, 17 Jun 2016 17:01:33 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5HH1XqA091613; Fri, 17 Jun 2016 17:01:33 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5HH1XCY091612; Fri, 17 Jun 2016 17:01:33 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606171701.u5HH1XCY091612@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 17 Jun 2016 17:01:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301994 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2016 17:01:34 -0000 Author: adrian Date: Fri Jun 17 17:01:32 2016 New Revision: 301994 URL: https://svnweb.freebsd.org/changeset/base/301994 Log: [ath] don't debug RX EDMA descriptors that are not yet complete. Approved by: re@ (gjb) Modified: head/sys/dev/ath/if_ath_rx_edma.c Modified: head/sys/dev/ath/if_ath_rx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_rx_edma.c Fri Jun 17 16:46:58 2016 (r301993) +++ head/sys/dev/ath/if_ath_rx_edma.c Fri Jun 17 17:01:32 2016 (r301994) @@ -427,6 +427,8 @@ ath_edma_recv_proc_queue(struct ath_soft rs = &bf->bf_status.ds_rxstat; bf->bf_rxstatus = ath_hal_rxprocdesc(ah, ds, bf->bf_daddr, NULL, rs); + if (bf->bf_rxstatus == HAL_EINPROGRESS) + break; #ifdef ATH_DEBUG if (sc->sc_debug & ATH_DEBUG_RECV_DESC) ath_printrxbuf(sc, bf, 0, bf->bf_rxstatus == HAL_OK); @@ -436,8 +438,6 @@ ath_edma_recv_proc_queue(struct ath_soft if_ath_alq_post(&sc->sc_alq, ATH_ALQ_EDMA_RXSTATUS, sc->sc_rx_statuslen, (char *) ds); #endif /* ATH_DEBUG */ - if (bf->bf_rxstatus == HAL_EINPROGRESS) - break; /* * Completed descriptor. From owner-svn-src-all@freebsd.org Fri Jun 17 17:09:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E67EA786E8; Fri, 17 Jun 2016 17:09:24 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3A6B29E5; Fri, 17 Jun 2016 17:09:23 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5HH9Nqa094846; Fri, 17 Jun 2016 17:09:23 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5HH9NB4094845; Fri, 17 Jun 2016 17:09:23 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201606171709.u5HH9NB4094845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 17 Jun 2016 17:09:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301995 - head/sys/boot/efi/libefi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2016 17:09:24 -0000 Author: manu Date: Fri Jun 17 17:09:22 2016 New Revision: 301995 URL: https://svnweb.freebsd.org/changeset/base/301995 Log: Print a message when disks are found but no logical partition are reported by EFI implementation. This address comment on r301714. Approved by: re (gjb), andrew (mentor) Differential Revision: https://reviews.freebsd.org/D6787 Modified: head/sys/boot/efi/libefi/efipart.c Modified: head/sys/boot/efi/libefi/efipart.c ============================================================================== --- head/sys/boot/efi/libefi/efipart.c Fri Jun 17 17:01:32 2016 (r301994) +++ head/sys/boot/efi/libefi/efipart.c Fri Jun 17 17:09:22 2016 (r301995) @@ -82,7 +82,7 @@ efipart_init(void) EFI_HANDLE *hin, *hout, *aliases, handle; EFI_STATUS status; UINTN sz; - u_int n, nin, nout; + u_int n, nin, nout, nrdisk; int err; sz = 0; @@ -103,6 +103,7 @@ efipart_init(void) hout = hin + nin; aliases = hout + nin; nout = 0; + nrdisk = 0; bzero(aliases, nin * sizeof(EFI_HANDLE)); pdinfo = malloc(nin * sizeof(*pdinfo)); @@ -120,8 +121,7 @@ efipart_init(void) if (EFI_ERROR(status)) continue; if (!blkio->Media->LogicalPartition) { - printf("%s%d isn't a logical partition, skipping\n", - efipart_dev.dv_name, n); + nrdisk++; continue; } @@ -156,6 +156,9 @@ efipart_init(void) bcache_add_dev(npdinfo); err = efi_register_handles(&efipart_dev, hout, aliases, nout); free(hin); + + if (nout == 0 && nrdisk > 0) + printf("Found %d disk(s) but no logical partition\n", nrdisk); return (err); } From owner-svn-src-all@freebsd.org Fri Jun 17 17:22:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24849A78A3C; Fri, 17 Jun 2016 17:22:02 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0413F175C; Fri, 17 Jun 2016 17:22:02 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 16AD4B917; Fri, 17 Jun 2016 13:22:01 -0400 (EDT) From: John Baldwin To: Bryan Drewery Cc: Konstantin Belousov , Conrad Meyer , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301959 - head/sys/kern Date: Fri, 17 Jun 2016 10:21:45 -0700 Message-ID: <1585557.0rxbtFOHCR@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: References: <201606161158.u5GBwkd1042632@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 17 Jun 2016 13:22:01 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2016 17:22:02 -0000 On Friday, June 17, 2016 09:56:47 AM Bryan Drewery wrote: > On 6/17/2016 9:51 AM, Bryan Drewery wrote: > > On 6/16/2016 11:13 PM, Konstantin Belousov wrote: > >> On Thu, Jun 16, 2016 at 10:17:19AM -0700, Conrad Meyer wrote: > >>> style(9) nit: /* FALLTHROUGH */ > >> > >> FALLTHROUGH is only applicable when there are executable statements for > >> both cases, and first sequence of statements does not end in break. > >> Look at the switch() example right after the FALLTHROUGH requirement > >> in the style(9), which shows case '?'. > >> > > > > Yes the example shows code in both cases, but the text about it is more > > strict "Elements in a switch statement that cascade should have a > > FALLTHROUGH comment." > > > > My personal opinion does agree with your interpretation. I think we > should clarify style.9 about when to use FALLTHROUGH. As Bruce often notes, the code samples in style(9) trump the prose if there is a conflict. This is the first time I've ever seen anyone suggest that an empty case body warrants a FALLTHROUGH, and I don't recall ever seeing a single example of it in the tree. I had assumed that the Conrad had just misread the diff and assumed there was still a code block there, not that Conrad actually wanted a FALLTHROUGH for an empty block. In that case, I'm not sure changing style.9 would help as the trigger was misreading the diff, not confusion over the FALLTHROUGH convention. -- John Baldwin From owner-svn-src-all@freebsd.org Fri Jun 17 17:33:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1394AA78CF2; Fri, 17 Jun 2016 17:33:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C69DE1F3F; Fri, 17 Jun 2016 17:33:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5HHXPUu005755; Fri, 17 Jun 2016 17:33:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5HHXPCt005753; Fri, 17 Jun 2016 17:33:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606171733.u5HHXPCt005753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 17 Jun 2016 17:33:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301996 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2016 17:33:27 -0000 Author: kib Date: Fri Jun 17 17:33:25 2016 New Revision: 301996 URL: https://svnweb.freebsd.org/changeset/base/301996 Log: Add VFS interface to flush specified amount of free vnodes belonging to mount points with the given filesystem type, specified by mount vfs_ops pointer. Based on patch by: mckusick Reviewed by: avg, mckusick Tested by: allanjude, madpilot Sponsored by: The FreeBSD Foundation Approved by: re (gjb) Modified: head/sys/kern/vfs_subr.c head/sys/sys/vnode.h Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Fri Jun 17 17:09:22 2016 (r301995) +++ head/sys/kern/vfs_subr.c Fri Jun 17 17:33:25 2016 (r301996) @@ -107,7 +107,6 @@ static void v_incr_usecount(struct vnode static void v_incr_usecount_locked(struct vnode *); static void v_incr_devcount(struct vnode *); static void v_decr_devcount(struct vnode *); -static void vnlru_free(int); static void vgonel(struct vnode *); static void vfs_knllock(void *arg); static void vfs_knlunlock(void *arg); @@ -942,15 +941,23 @@ relock_mnt: return done; } +static int max_vnlru_free = 10000; /* limit on vnode free requests per call */ +SYSCTL_INT(_debug, OID_AUTO, max_vnlru_free, CTLFLAG_RW, &max_vnlru_free, + 0, + "limit on vnode free requests per call to the vnlru_free routine"); + /* * Attempt to reduce the free list by the requested amount. */ static void -vnlru_free(int count) +vnlru_free_locked(int count, struct vfsops *mnt_op) { struct vnode *vp; + struct mount *mp; mtx_assert(&vnode_free_list_mtx, MA_OWNED); + if (count > max_vnlru_free) + count = max_vnlru_free; for (; count > 0; count--) { vp = TAILQ_FIRST(&vnode_free_list); /* @@ -966,10 +973,17 @@ vnlru_free(int count) KASSERT((vp->v_iflag & VI_ACTIVE) == 0, ("Mangling active vnode")); TAILQ_REMOVE(&vnode_free_list, vp, v_actfreelist); + /* - * Don't recycle if we can't get the interlock. + * Don't recycle if our vnode is from different type + * of mount point. Note that mp is type-safe, the + * check does not reach unmapped address even if + * vnode is reclaimed. + * Don't recycle if we can't get the interlock without + * blocking. */ - if (!VI_TRYLOCK(vp)) { + if ((mnt_op != NULL && (mp = vp->v_mount) != NULL && + mp->mnt_op != mnt_op) || !VI_TRYLOCK(vp)) { TAILQ_INSERT_TAIL(&vnode_free_list, vp, v_actfreelist); continue; } @@ -1001,6 +1015,16 @@ vnlru_free(int count) } } +void +vnlru_free(int count, struct vfsops *mnt_op) +{ + + mtx_lock(&vnode_free_list_mtx); + vnlru_free_locked(count, mnt_op); + mtx_unlock(&vnode_free_list_mtx); +} + + /* XXX some names and initialization are bad for limits and watermarks. */ static int vspace(void) @@ -1046,8 +1070,8 @@ vnlru_proc(void) * try to reduce it by discarding from the free list. */ if (numvnodes > desiredvnodes && freevnodes > 0) - vnlru_free(ulmin(numvnodes - desiredvnodes, - freevnodes)); + vnlru_free_locked(ulmin(numvnodes - desiredvnodes, + freevnodes), NULL); /* * Sleep if the vnode cache is in a good state. This is * when it is not over-full and has space for about a 4% @@ -1237,7 +1261,7 @@ getnewvnode_wait(int suspended) } /* Post-adjust like the pre-adjust in getnewvnode(). */ if (numvnodes + 1 > desiredvnodes && freevnodes > 1) - vnlru_free(1); + vnlru_free_locked(1, NULL); return (numvnodes >= desiredvnodes ? ENFILE : 0); } @@ -1254,8 +1278,8 @@ getnewvnode_reserve(u_int count) /* XXX no longer so quick, but this part is not racy. */ mtx_lock(&vnode_free_list_mtx); if (numvnodes + count > desiredvnodes && freevnodes > wantfreevnodes) - vnlru_free(ulmin(numvnodes + count - desiredvnodes, - freevnodes - wantfreevnodes)); + vnlru_free_locked(ulmin(numvnodes + count - desiredvnodes, + freevnodes - wantfreevnodes), NULL); mtx_unlock(&vnode_free_list_mtx); td = curthread; @@ -1337,7 +1361,7 @@ getnewvnode(const char *tag, struct moun if (numvnodes + 1 <= desiredvnodes) ; else if (freevnodes > 0) - vnlru_free(1); + vnlru_free_locked(1, NULL); else { error = getnewvnode_wait(mp != NULL && (mp->mnt_kern_flag & MNTK_SUSPEND)); Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Fri Jun 17 17:09:22 2016 (r301995) +++ head/sys/sys/vnode.h Fri Jun 17 17:33:25 2016 (r301996) @@ -603,6 +603,7 @@ struct nstat; struct ucred; struct uio; struct vattr; +struct vfsops; struct vnode; typedef int (*vn_get_ino_t)(struct mount *, void *, int, struct vnode **); @@ -738,6 +739,7 @@ void vfs_timestamp(struct timespec *); void vfs_write_resume(struct mount *mp, int flags); int vfs_write_suspend(struct mount *mp, int flags); int vfs_write_suspend_umnt(struct mount *mp); +void vnlru_free(int, struct vfsops *); int vop_stdbmap(struct vop_bmap_args *); int vop_stdfsync(struct vop_fsync_args *); int vop_stdgetwritemount(struct vop_getwritemount_args *); From owner-svn-src-all@freebsd.org Fri Jun 17 17:34:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A32FA78D4E; Fri, 17 Jun 2016 17:34:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D54720F5; Fri, 17 Jun 2016 17:34:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5HHYTIe005858; Fri, 17 Jun 2016 17:34:29 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5HHYTCb005855; Fri, 17 Jun 2016 17:34:29 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606171734.u5HHYTCb005855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 17 Jun 2016 17:34:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301997 - in head/sys/cddl: compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2016 17:34:30 -0000 Author: kib Date: Fri Jun 17 17:34:28 2016 New Revision: 301997 URL: https://svnweb.freebsd.org/changeset/base/301997 Log: Use vnlru_free(9) to implement dnlc_reduce_cache(). This apparently puts ARC back under the limits after the vnode pressure rework in r291244, in particular due to the kmem exhaustion. Based on patch by: mckusick Reviewed by: avg, mckusick Tested by: allanjude, madpilot Sponsored by: The FreeBSD Foundation Approved by: re (gjb) Modified: head/sys/cddl/compat/opensolaris/sys/dnlc.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Modified: head/sys/cddl/compat/opensolaris/sys/dnlc.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/dnlc.h Fri Jun 17 17:33:25 2016 (r301996) +++ head/sys/cddl/compat/opensolaris/sys/dnlc.h Fri Jun 17 17:34:28 2016 (r301997) @@ -35,6 +35,6 @@ #define dnlc_update(dvp, name, vp) do { } while (0) #define dnlc_remove(dvp, name) do { } while (0) #define dnlc_purge_vfsp(vfsp, count) (0) -#define dnlc_reduce_cache(percent) do { } while (0) +void dnlc_reduce_cache(void *arg); #endif /* !_OPENSOLARIS_SYS_DNLC_H_ */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Jun 17 17:33:25 2016 (r301996) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Jun 17 17:34:28 2016 (r301997) @@ -159,6 +159,10 @@ static kmutex_t arc_user_evicts_lock; static kcondvar_t arc_user_evicts_cv; static boolean_t arc_user_evicts_thread_exit; +static kmutex_t arc_dnlc_evicts_lock; +static kcondvar_t arc_dnlc_evicts_cv; +static boolean_t arc_dnlc_evicts_thread_exit; + uint_t arc_reduce_dnlc_percent = 3; /* @@ -3749,6 +3753,57 @@ arc_user_evicts_thread(void *dummy __unu thread_exit(); } +static u_int arc_dnlc_evicts_arg; +extern struct vfsops zfs_vfsops; + +static void +arc_dnlc_evicts_thread(void *dummy __unused) +{ + callb_cpr_t cpr; + u_int percent; + + CALLB_CPR_INIT(&cpr, &arc_dnlc_evicts_lock, callb_generic_cpr, FTAG); + + mutex_enter(&arc_dnlc_evicts_lock); + while (!arc_dnlc_evicts_thread_exit) { + CALLB_CPR_SAFE_BEGIN(&cpr); + (void) cv_wait(&arc_dnlc_evicts_cv, &arc_dnlc_evicts_lock); + CALLB_CPR_SAFE_END(&cpr, &arc_dnlc_evicts_lock); + if (arc_dnlc_evicts_arg != 0) { + percent = arc_dnlc_evicts_arg; + mutex_exit(&arc_dnlc_evicts_lock); +#ifdef _KERNEL + vnlru_free(desiredvnodes * percent / 100, &zfs_vfsops); +#endif + mutex_enter(&arc_dnlc_evicts_lock); + /* + * Clear our token only after vnlru_free() + * pass is done, to avoid false queueing of + * the requests. + */ + arc_dnlc_evicts_arg = 0; + } + } + arc_dnlc_evicts_thread_exit = FALSE; + cv_broadcast(&arc_dnlc_evicts_cv); + CALLB_CPR_EXIT(&cpr); + thread_exit(); +} + +void +dnlc_reduce_cache(void *arg) +{ + u_int percent; + + percent = (u_int)arg; + mutex_enter(&arc_dnlc_evicts_lock); + if (arc_dnlc_evicts_arg == 0) { + arc_dnlc_evicts_arg = percent; + cv_broadcast(&arc_dnlc_evicts_cv); + } + mutex_exit(&arc_dnlc_evicts_lock); +} + /* * Adapt arc info given the number of bytes we are trying to add and * the state that we are comming from. This function is only called @@ -5311,6 +5366,9 @@ arc_init(void) mutex_init(&arc_user_evicts_lock, NULL, MUTEX_DEFAULT, NULL); cv_init(&arc_user_evicts_cv, NULL, CV_DEFAULT, NULL); + mutex_init(&arc_dnlc_evicts_lock, NULL, MUTEX_DEFAULT, NULL); + cv_init(&arc_dnlc_evicts_cv, NULL, CV_DEFAULT, NULL); + /* Convert seconds to clock ticks */ arc_min_prefetch_lifespan = 1 * hz; @@ -5463,6 +5521,7 @@ arc_init(void) arc_reclaim_thread_exit = FALSE; arc_user_evicts_thread_exit = FALSE; + arc_dnlc_evicts_thread_exit = FALSE; arc_eviction_list = NULL; bzero(&arc_eviction_hdr, sizeof (arc_buf_hdr_t)); @@ -5486,6 +5545,9 @@ arc_init(void) (void) thread_create(NULL, 0, arc_user_evicts_thread, NULL, 0, &p0, TS_RUN, minclsyspri); + (void) thread_create(NULL, 0, arc_dnlc_evicts_thread, NULL, 0, &p0, + TS_RUN, minclsyspri); + arc_dead = FALSE; arc_warm = B_FALSE; @@ -5568,6 +5630,18 @@ arc_fini(void) } mutex_exit(&arc_user_evicts_lock); + mutex_enter(&arc_dnlc_evicts_lock); + arc_dnlc_evicts_thread_exit = TRUE; + /* + * The user evicts thread will set arc_user_evicts_thread_exit + * to FALSE when it is finished exiting; we're waiting for that. + */ + while (arc_dnlc_evicts_thread_exit) { + cv_signal(&arc_dnlc_evicts_cv); + cv_wait(&arc_dnlc_evicts_cv, &arc_dnlc_evicts_lock); + } + mutex_exit(&arc_dnlc_evicts_lock); + /* Use TRUE to ensure *all* buffers are evicted */ arc_flush(NULL, TRUE); @@ -5585,6 +5659,9 @@ arc_fini(void) mutex_destroy(&arc_user_evicts_lock); cv_destroy(&arc_user_evicts_cv); + mutex_destroy(&arc_dnlc_evicts_lock); + cv_destroy(&arc_dnlc_evicts_cv); + refcount_destroy(&arc_anon->arcs_size); refcount_destroy(&arc_mru->arcs_size); refcount_destroy(&arc_mru_ghost->arcs_size); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Fri Jun 17 17:33:25 2016 (r301996) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Fri Jun 17 17:34:28 2016 (r301997) @@ -101,7 +101,7 @@ static int zfs_fhtovp(vfs_t *vfsp, fid_t static void zfs_objset_close(zfsvfs_t *zfsvfs); static void zfs_freevfs(vfs_t *vfsp); -static struct vfsops zfs_vfsops = { +struct vfsops zfs_vfsops = { .vfs_mount = zfs_mount, .vfs_unmount = zfs_umount, .vfs_root = zfs_root, From owner-svn-src-all@freebsd.org Fri Jun 17 18:21:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C228EA787A0; Fri, 17 Jun 2016 18:21:57 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 841DF1B3B; Fri, 17 Jun 2016 18:21:57 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5HILu63021655; Fri, 17 Jun 2016 18:21:56 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5HILudm021649; Fri, 17 Jun 2016 18:21:56 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201606171821.u5HILudm021649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 17 Jun 2016 18:21:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301998 - in head: sbin/pfctl share/man/man5 sys/net sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2016 18:21:57 -0000 Author: kp Date: Fri Jun 17 18:21:55 2016 New Revision: 301998 URL: https://svnweb.freebsd.org/changeset/base/301998 Log: pf: Filter on and set vlan PCP values Adopt the OpenBSD syntax for setting and filtering on VLAN PCP values. This introduces two new keywords: 'set prio' to set the PCP value, and 'prio' to filter on it. Reviewed by: allanjude, araujo Approved by: re (gjb) Obtained from: OpenBSD (mostly) Differential Revision: https://reviews.freebsd.org/D6786 Modified: head/sbin/pfctl/parse.y head/sbin/pfctl/pfctl_parser.c head/share/man/man5/pf.conf.5 head/sys/net/pfvar.h head/sys/netpfil/pf/pf.c head/sys/netpfil/pf/pf_ioctl.c Modified: head/sbin/pfctl/parse.y ============================================================================== --- head/sbin/pfctl/parse.y Fri Jun 17 17:34:28 2016 (r301997) +++ head/sbin/pfctl/parse.y Fri Jun 17 18:21:55 2016 (r301998) @@ -217,6 +217,8 @@ struct filter_opts { #define FOM_TOS 0x04 #define FOM_KEEP 0x08 #define FOM_SRCTRACK 0x10 +#define FOM_SETPRIO 0x0400 +#define FOM_PRIO 0x2000 struct node_uid *uid; struct node_gid *gid; struct { @@ -240,6 +242,8 @@ struct filter_opts { char *match_tag; u_int8_t match_tag_not; u_int rtableid; + u_int8_t prio; + u_int8_t set_prio[2]; struct { struct node_host *addr; u_int16_t port; @@ -453,7 +457,7 @@ int parseport(char *, struct range *r, i %token BITMASK RANDOM SOURCEHASH ROUNDROBIN STATICPORT PROBABILITY %token ALTQ CBQ CODEL PRIQ HFSC FAIRQ BANDWIDTH TBRSIZE LINKSHARE REALTIME %token UPPERLIMIT QUEUE PRIORITY QLIMIT HOGS BUCKETS RTABLE TARGET INTERVAL -%token LOAD RULESET_OPTIMIZATION +%token LOAD RULESET_OPTIMIZATION PRIO %token STICKYADDRESS MAXSRCSTATES MAXSRCNODES SOURCETRACK GLOBAL RULE %token MAXSRCCONN MAXSRCCONNRATE OVERLOAD FLUSH SLOPPY %token TAGGED TAG IFBOUND FLOATING STATEPOLICY STATEDEFAULTS ROUTE SETTOS @@ -468,7 +472,7 @@ int parseport(char *, struct range *r, i %type no dir af fragcache optimizer %type sourcetrack flush unaryop statelock %type action nataction natpasslog scrubaction -%type flags flag blockspec +%type flags flag blockspec prio %type portplain portstar portrange %type hashkey %type proto proto_list proto_item @@ -504,6 +508,7 @@ int parseport(char *, struct range *r, i %type codelopts_list codelopts_item codel_opts %type bandwidth %type filter_opts filter_opt filter_opts_l +%type filter_sets filter_set filter_sets_l %type antispoof_opts antispoof_opt antispoof_opts_l %type queue_opts queue_opt queue_opts_l %type scrub_opts scrub_opt scrub_opts_l @@ -889,6 +894,17 @@ anchorrule : ANCHOR anchorname dir quick YYERROR; } r.match_tag_not = $9.match_tag_not; + if ($9.marker & FOM_PRIO) { + if ($9.prio == 0) + r.prio = PF_PRIO_ZERO; + else + r.prio = $9.prio; + } + if ($9.marker & FOM_SETPRIO) { + r.set_prio[0] = $9.set_prio[0]; + r.set_prio[1] = $9.set_prio[1]; + r.scrub_flags |= PFSTATE_SETPRIO; + } decide_address_family($8.src.host, &r.af); decide_address_family($8.dst.host, &r.af); @@ -2014,6 +2030,18 @@ pfrule : action dir logquick interface r.prob = $9.prob; r.rtableid = $9.rtableid; + if ($9.marker & FOM_PRIO) { + if ($9.prio == 0) + r.prio = PF_PRIO_ZERO; + else + r.prio = $9.prio; + } + if ($9.marker & FOM_SETPRIO) { + r.set_prio[0] = $9.set_prio[0]; + r.set_prio[1] = $9.set_prio[1]; + r.scrub_flags |= PFSTATE_SETPRIO; + } + r.af = $6; if ($9.tag) if (strlcpy(r.tagname, $9.tag, @@ -2434,6 +2462,18 @@ filter_opt : USER uids { filter_opts.marker |= FOM_ICMP; filter_opts.icmpspec = $1; } + | PRIO NUMBER { + if (filter_opts.marker & FOM_PRIO) { + yyerror("prio cannot be redefined"); + YYERROR; + } + if ($2 < 0 || $2 > PF_PRIO_MAX) { + yyerror("prio must be 0 - %u", PF_PRIO_MAX); + YYERROR; + } + filter_opts.marker |= FOM_PRIO; + filter_opts.prio = $2; + } | TOS tos { if (filter_opts.marker & FOM_TOS) { yyerror("tos cannot be redefined"); @@ -2532,6 +2572,42 @@ filter_opt : USER uids { filter_opts.divert.port = 1; /* some random value */ #endif } + | filter_sets + ; + +filter_sets : SET '(' filter_sets_l ')' { $$ = filter_opts; } + | SET filter_set { $$ = filter_opts; } + ; + +filter_sets_l : filter_sets_l comma filter_set + | filter_set + ; + +filter_set : prio { + if (filter_opts.marker & FOM_SETPRIO) { + yyerror("prio cannot be redefined"); + YYERROR; + } + filter_opts.marker |= FOM_SETPRIO; + filter_opts.set_prio[0] = $1.b1; + filter_opts.set_prio[1] = $1.b2; + } +prio : PRIO NUMBER { + if ($2 < 0 || $2 > PF_PRIO_MAX) { + yyerror("prio must be 0 - %u", PF_PRIO_MAX); + YYERROR; + } + $$.b1 = $$.b2 = $2; + } + | PRIO '(' NUMBER comma NUMBER ')' { + if ($3 < 0 || $3 > PF_PRIO_MAX || + $5 < 0 || $5 > PF_PRIO_MAX) { + yyerror("prio must be 0 - %u", PF_PRIO_MAX); + YYERROR; + } + $$.b1 = $3; + $$.b2 = $5; + } ; probability : STRING { @@ -5426,6 +5502,7 @@ lookup(char *s) { "overload", OVERLOAD}, { "pass", PASS}, { "port", PORT}, + { "prio", PRIO}, { "priority", PRIORITY}, { "priq", PRIQ}, { "probability", PROBABILITY}, Modified: head/sbin/pfctl/pfctl_parser.c ============================================================================== --- head/sbin/pfctl/pfctl_parser.c Fri Jun 17 17:34:28 2016 (r301997) +++ head/sbin/pfctl/pfctl_parser.c Fri Jun 17 18:21:55 2016 (r301998) @@ -841,6 +841,21 @@ print_rule(struct pf_rule *r, const char } if (r->tos) printf(" tos 0x%2.2x", r->tos); + if (r->prio) + printf(" prio %u", r->prio == PF_PRIO_ZERO ? 0 : r->prio); + if (r->scrub_flags & PFSTATE_SETMASK) { + char *comma = ""; + printf(" set ("); + if (r->scrub_flags & PFSTATE_SETPRIO) { + if (r->set_prio[0] == r->set_prio[1]) + printf("%s prio %u", comma, r->set_prio[0]); + else + printf("%s prio(%u, %u)", comma, r->set_prio[0], + r->set_prio[1]); + comma = ","; + } + printf(" )"); + } if (!r->keep_state && r->action == PF_PASS && !anchor_call[0]) printf(" no state"); else if (r->keep_state == PF_STATE_NORMAL) Modified: head/share/man/man5/pf.conf.5 ============================================================================== --- head/share/man/man5/pf.conf.5 Fri Jun 17 17:34:28 2016 (r301997) +++ head/share/man/man5/pf.conf.5 Fri Jun 17 18:21:55 2016 (r301998) @@ -28,7 +28,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd July 25, 2015 +.Dd June 9, 2016 .Dt PF.CONF 5 .Os .Sh NAME @@ -1785,6 +1785,25 @@ For example: pass in proto tcp to port 25 queue mail pass in proto tcp to port 22 queue(ssh_bulk, ssh_prio) .Ed +.Pp +.It Cm set prio Ar priority | Pq Ar priority , priority +Packets matching this rule will be assigned a specific queueing priority. +Priorities are assigned as integers 0 through 7. +If the packet is transmitted on a +.Xr vlan 4 +interface, the queueing priority will be written as the priority +code point in the 802.1Q VLAN header. +If two priorities are given, packets which have a TOS of +.Cm lowdelay +and TCP ACKs with no data payload will be assigned to the second one. +.Pp +For example: +.Bd -literal -offset indent +pass in proto tcp to port 25 set prio 2 +pass in proto tcp to port 22 set prio (2, 5) +.Ed +.Pp + .It Ar tag Aq Ar string Packets matching this rule will be tagged with the specified string. @@ -1845,6 +1864,9 @@ For example, the following rule will dro .Bd -literal -offset indent block in proto icmp probability 20% .Ed +.It Ar prio Aq Ar number +Only match packets which have the given queueing priority assigned. +.Pp .El .Sh ROUTING If a packet matches a rule with a route option set, the packet filter will @@ -2831,8 +2853,9 @@ filteropt = user | group | flags | "max-mss" number | "random-id" | "reassemble tcp" | fragmentation | "allow-opts" | "label" string | "tag" string | [ ! ] "tagged" string | + "set prio" ( number | "(" number [ [ "," ] number ] ")" ) | "queue" ( string | "(" string [ [ "," ] string ] ")" ) | - "rtable" number | "probability" number"%" + "rtable" number | "probability" number"%" | "prio" number nat-rule = [ "no" ] "nat" [ "pass" [ "log" [ "(" logopts ")" ] ] ] [ "on" ifspec ] [ af ] Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Fri Jun 17 17:34:28 2016 (r301997) +++ head/sys/net/pfvar.h Fri Jun 17 18:21:55 2016 (r301998) @@ -540,7 +540,7 @@ struct pf_rule { u_int16_t max_mss; u_int16_t tag; u_int16_t match_tag; - u_int16_t spare2; /* netgraph */ + u_int16_t scrub_flags; struct pf_rule_uid uid; struct pf_rule_gid gid; @@ -577,6 +577,10 @@ struct pf_rule { #define PF_FLUSH 0x01 #define PF_FLUSH_GLOBAL 0x02 u_int8_t flush; +#define PF_PRIO_ZERO 0xff /* match "prio 0" packets */ +#define PF_PRIO_MAX 7 + u_int8_t prio; + u_int8_t set_prio[2]; struct { struct pf_addr addr; @@ -739,6 +743,8 @@ struct pf_state { /* was PFSTATE_PFLOW 0x04 */ #define PFSTATE_NOSYNC 0x08 #define PFSTATE_ACK 0x10 +#define PFSTATE_SETPRIO 0x0200 +#define PFSTATE_SETMASK (PFSTATE_SETPRIO) u_int8_t timeout; u_int8_t sync_state; /* PFSYNC_S_x */ Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Fri Jun 17 17:34:28 2016 (r301997) +++ head/sys/netpfil/pf/pf.c Fri Jun 17 18:21:55 2016 (r301998) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -2445,6 +2446,45 @@ pf_send_tcp(struct mbuf *replyto, const pf_send(pfse); } +static int +pf_ieee8021q_setpcp(struct mbuf *m, u_int8_t prio) +{ + struct m_tag *mtag; + + KASSERT(prio <= PF_PRIO_MAX, + ("%s with invalid pcp", __func__)); + + mtag = m_tag_locate(m, MTAG_8021Q, MTAG_8021Q_PCP_OUT, NULL); + if (mtag == NULL) { + mtag = m_tag_alloc(MTAG_8021Q, MTAG_8021Q_PCP_OUT, + sizeof(uint8_t), M_NOWAIT); + if (mtag == NULL) + return (ENOMEM); + m_tag_prepend(m, mtag); + } + + *(uint8_t *)(mtag + 1) = prio; + return (0); +} + +static int +pf_match_ieee8021q_pcp(u_int8_t prio, struct mbuf *m) +{ + struct m_tag *mtag; + u_int8_t mpcp; + + mtag = m_tag_locate(m, MTAG_8021Q, MTAG_8021Q_PCP_IN, NULL); + if (mtag == NULL) + return (0); + + if (prio == PF_PRIO_ZERO) + prio = 0; + + mpcp = *(uint8_t *)(mtag + 1); + + return (mpcp == prio); +} + static void pf_send_icmp(struct mbuf *m, u_int8_t type, u_int8_t code, sa_family_t af, struct pf_rule *r) @@ -3317,6 +3357,9 @@ pf_test_rule(struct pf_rule **rm, struct !pf_match_gid(r->gid.op, r->gid.gid[0], r->gid.gid[1], pd->lookup.gid)) r = TAILQ_NEXT(r, entries); + else if (r->prio && + !pf_match_ieee8021q_pcp(r->prio, m)) + r = TAILQ_NEXT(r, entries); else if (r->prob && r->prob <= arc4random()) r = TAILQ_NEXT(r, entries); @@ -3779,6 +3822,9 @@ pf_test_fragment(struct pf_rule **rm, in pd->proto == IPPROTO_ICMPV6) && (r->type || r->code)) r = TAILQ_NEXT(r, entries); + else if (r->prio && + !pf_match_ieee8021q_pcp(r->prio, m)) + r = TAILQ_NEXT(r, entries); else if (r->prob && r->prob <= (arc4random() % (UINT_MAX - 1) + 1)) r = TAILQ_NEXT(r, entries); @@ -6003,6 +6049,18 @@ done: if (r->rtableid >= 0) M_SETFIB(m, r->rtableid); + if (r->scrub_flags & PFSTATE_SETPRIO) { + if (pd.tos & IPTOS_LOWDELAY) + pqid = 1; + if (pf_ieee8021q_setpcp(m, r->set_prio[pqid])) { + action = PF_DROP; + REASON_SET(&reason, PFRES_MEMORY); + log = 1; + DPFPRINTF(PF_DEBUG_MISC, + ("pf: failed to allocate 802.1q mtag\n")); + } + } + #ifdef ALTQ if (action == PF_PASS && r->qid) { if (pd.pf_mtag == NULL && @@ -6176,7 +6234,7 @@ pf_test6(int dir, struct ifnet *ifp, str struct pf_state *s = NULL; struct pf_ruleset *ruleset = NULL; struct pf_pdesc pd; - int off, terminal = 0, dirndx, rh_cnt = 0; + int off, terminal = 0, dirndx, rh_cnt = 0, pqid = 0; int fwdir = dir; M_ASSERTPKTHDR(m); @@ -6449,6 +6507,18 @@ done: if (r->rtableid >= 0) M_SETFIB(m, r->rtableid); + if (r->scrub_flags & PFSTATE_SETPRIO) { + if (pd.tos & IPTOS_LOWDELAY) + pqid = 1; + if (pf_ieee8021q_setpcp(m, r->set_prio[pqid])) { + action = PF_DROP; + REASON_SET(&reason, PFRES_MEMORY); + log = 1; + DPFPRINTF(PF_DEBUG_MISC, + ("pf: failed to allocate 802.1q mtag\n")); + } + } + #ifdef ALTQ if (action == PF_PASS && r->qid) { if (pd.pf_mtag == NULL && Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Fri Jun 17 17:34:28 2016 (r301997) +++ head/sys/netpfil/pf/pf_ioctl.c Fri Jun 17 18:21:55 2016 (r301998) @@ -1242,6 +1242,10 @@ pfioctl(struct cdev *dev, u_long cmd, ca error = ENOMEM; if (pf_anchor_setup(rule, ruleset, pr->anchor_call)) error = EINVAL; + if (rule->scrub_flags & PFSTATE_SETPRIO && + (rule->set_prio[0] > PF_PRIO_MAX || + rule->set_prio[1] > PF_PRIO_MAX)) + error = EINVAL; TAILQ_FOREACH(pa, &V_pf_pabuf, entries) if (pa->addr.type == PF_ADDR_TABLE) { pa->addr.p.tbl = pfr_attach_table(ruleset, From owner-svn-src-all@freebsd.org Fri Jun 17 18:49:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67448A78CBA; Fri, 17 Jun 2016 18:49:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37F05296D; Fri, 17 Jun 2016 18:49:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5HIngm9032015; Fri, 17 Jun 2016 18:49:42 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5HIngTa032014; Fri, 17 Jun 2016 18:49:42 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201606171849.u5HIngTa032014@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 17 Jun 2016 18:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301999 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2016 18:49:43 -0000 Author: emaste Date: Fri Jun 17 18:49:42 2016 New Revision: 301999 URL: https://svnweb.freebsd.org/changeset/base/301999 Log: mkimg: bump version to 20151211 after r292082 mkimg has had a number of functional additions after the last time the version was incremented. Do so now, to r292082's commit date, so that users can determine what is supported. Reviewed by: marcel Approved by: re (gjb) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6882 Modified: head/usr.bin/mkimg/Makefile Modified: head/usr.bin/mkimg/Makefile ============================================================================== --- head/usr.bin/mkimg/Makefile Fri Jun 17 18:21:55 2016 (r301998) +++ head/usr.bin/mkimg/Makefile Fri Jun 17 18:49:42 2016 (r301999) @@ -6,7 +6,7 @@ PROG= mkimg SRCS= format.c image.c mkimg.c scheme.c MAN= mkimg.1 -MKIMG_VERSION=20150620 +MKIMG_VERSION=20151211 mkimg.o: Makefile CFLAGS+=-DMKIMG_VERSION=${MKIMG_VERSION} From owner-svn-src-all@freebsd.org Fri Jun 17 19:41:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 677DDA78D97; Fri, 17 Jun 2016 19:41:31 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C1F32B65; Fri, 17 Jun 2016 19:41:31 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5HJfUp1054210; Fri, 17 Jun 2016 19:41:30 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5HJfUif054208; Fri, 17 Jun 2016 19:41:30 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201606171941.u5HJfUif054208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 17 Jun 2016 19:41:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302000 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2016 19:41:31 -0000 Author: mjg Date: Fri Jun 17 19:41:30 2016 New Revision: 302000 URL: https://svnweb.freebsd.org/changeset/base/302000 Log: vfs: ifdef out noop vop_* primitives on !DEBUG_VFS_LOCKS kernels This removes calls to empty functions like vop_lock_{pre/post} from common vfs routines. Approved by: re (gjb) Modified: head/sys/kern/vfs_subr.c head/sys/sys/vnode.h Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Fri Jun 17 18:49:42 2016 (r301999) +++ head/sys/kern/vfs_subr.c Fri Jun 17 19:41:30 2016 (r302000) @@ -4529,10 +4529,10 @@ vop_rename_pre(void *ap) vhold(a->a_tvp); } +#ifdef DEBUG_VFS_LOCKS void vop_strategy_pre(void *ap) { -#ifdef DEBUG_VFS_LOCKS struct vop_strategy_args *a; struct buf *bp; @@ -4552,56 +4552,48 @@ vop_strategy_pre(void *ap) if (vfs_badlock_ddb) kdb_enter(KDB_WHY_VFSLOCK, "lock violation"); } -#endif } void vop_lock_pre(void *ap) { -#ifdef DEBUG_VFS_LOCKS struct vop_lock1_args *a = ap; if ((a->a_flags & LK_INTERLOCK) == 0) ASSERT_VI_UNLOCKED(a->a_vp, "VOP_LOCK"); else ASSERT_VI_LOCKED(a->a_vp, "VOP_LOCK"); -#endif } void vop_lock_post(void *ap, int rc) { -#ifdef DEBUG_VFS_LOCKS struct vop_lock1_args *a = ap; ASSERT_VI_UNLOCKED(a->a_vp, "VOP_LOCK"); if (rc == 0 && (a->a_flags & LK_EXCLOTHER) == 0) ASSERT_VOP_LOCKED(a->a_vp, "VOP_LOCK"); -#endif } void vop_unlock_pre(void *ap) { -#ifdef DEBUG_VFS_LOCKS struct vop_unlock_args *a = ap; if (a->a_flags & LK_INTERLOCK) ASSERT_VI_LOCKED(a->a_vp, "VOP_UNLOCK"); ASSERT_VOP_LOCKED(a->a_vp, "VOP_UNLOCK"); -#endif } void vop_unlock_post(void *ap, int rc) { -#ifdef DEBUG_VFS_LOCKS struct vop_unlock_args *a = ap; if (a->a_flags & LK_INTERLOCK) ASSERT_VI_UNLOCKED(a->a_vp, "VOP_UNLOCK"); -#endif } +#endif void vop_create_post(void *ap, int rc) Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Fri Jun 17 18:49:42 2016 (r301999) +++ head/sys/sys/vnode.h Fri Jun 17 19:41:30 2016 (r302000) @@ -781,8 +781,6 @@ void vop_close_post(void *a, int rc); void vop_create_post(void *a, int rc); void vop_deleteextattr_post(void *a, int rc); void vop_link_post(void *a, int rc); -void vop_lock_pre(void *a); -void vop_lock_post(void *a, int rc); void vop_lookup_post(void *a, int rc); void vop_lookup_pre(void *a); void vop_mkdir_post(void *a, int rc); @@ -797,10 +795,21 @@ void vop_rename_pre(void *a); void vop_rmdir_post(void *a, int rc); void vop_setattr_post(void *a, int rc); void vop_setextattr_post(void *a, int rc); -void vop_strategy_pre(void *a); void vop_symlink_post(void *a, int rc); + +#ifdef DEBUG_VFS_LOCKS +void vop_strategy_pre(void *a); +void vop_lock_pre(void *a); +void vop_lock_post(void *a, int rc); void vop_unlock_post(void *a, int rc); void vop_unlock_pre(void *a); +#else +#define vop_strategy_pre(x) do { } while (0) +#define vop_lock_pre(x) do { } while (0) +#define vop_lock_post(x, y) do { } while (0) +#define vop_unlock_post(x, y) do { } while (0) +#define vop_unlock_pre(x) do { } while (0) +#endif void vop_rename_fail(struct vop_rename_args *ap); From owner-svn-src-all@freebsd.org Fri Jun 17 22:40:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0618FA78915; Fri, 17 Jun 2016 22:40:14 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2A04256E; Fri, 17 Jun 2016 22:40:13 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5HMeDl8018575; Fri, 17 Jun 2016 22:40:13 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5HMeB04018557; Fri, 17 Jun 2016 22:40:11 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201606172240.u5HMeB04018557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Fri, 17 Jun 2016 22:40:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r302001 - in stable/10: contrib/libarchive contrib/libarchive/cat contrib/libarchive/cpio contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/libarchive/libarchive/test c... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2016 22:40:14 -0000 Author: mm Date: Fri Jun 17 22:40:10 2016 New Revision: 302001 URL: https://svnweb.freebsd.org/changeset/base/302001 Log: MFC r299529,r299540,r299576,r299896: r299529,r299540: Update libarchive to 3.2.0 New features: - new bsdcat command-line utility - LZ4 compression (in src only via external utility from ports) - Warc format support - 'Raw' format writer - Zip: Support archives >4GB, entries >4GB - Zip: Support encrypting and decrypting entries - Zip: Support experimental streaming extension - Identify encrypted entries in several formats - New --clear-nochange-flags option to bsdtar tries to remove noschg and similar flags before deleting files - New --ignore-zeros option to bsdtar to handle concatenated tar archives - Use multi-threaded LZMA decompression if liblzma supports it - Expose version info for libraries used by libarchive r299576,r299896: Fix broken cpio behavior. Relnotes: yes Added: stable/10/contrib/libarchive/cat/ - copied from r299529, head/contrib/libarchive/cat/ stable/10/contrib/libarchive/cpio/test/test_extract.cpio.lz4.uu - copied unchanged from r299529, head/contrib/libarchive/cpio/test/test_extract.cpio.lz4.uu stable/10/contrib/libarchive/cpio/test/test_extract_cpio_lz4.c - copied unchanged from r299529, head/contrib/libarchive/cpio/test/test_extract_cpio_lz4.c stable/10/contrib/libarchive/cpio/test/test_option_lz4.c - copied unchanged from r299529, head/contrib/libarchive/cpio/test/test_option_lz4.c stable/10/contrib/libarchive/cpio/test/test_option_passphrase.c - copied unchanged from r299529, head/contrib/libarchive/cpio/test/test_option_passphrase.c stable/10/contrib/libarchive/cpio/test/test_option_passphrase.zip.uu - copied unchanged from r299529, head/contrib/libarchive/cpio/test/test_option_passphrase.zip.uu stable/10/contrib/libarchive/libarchive/archive_cryptor.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/archive_cryptor.c stable/10/contrib/libarchive/libarchive/archive_cryptor_private.h - copied unchanged from r299529, head/contrib/libarchive/libarchive/archive_cryptor_private.h stable/10/contrib/libarchive/libarchive/archive_digest.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/archive_digest.c stable/10/contrib/libarchive/libarchive/archive_digest_private.h - copied unchanged from r299529, head/contrib/libarchive/libarchive/archive_digest_private.h stable/10/contrib/libarchive/libarchive/archive_getdate.h - copied unchanged from r299529, head/contrib/libarchive/libarchive/archive_getdate.h stable/10/contrib/libarchive/libarchive/archive_hmac.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/archive_hmac.c stable/10/contrib/libarchive/libarchive/archive_hmac_private.h - copied unchanged from r299529, head/contrib/libarchive/libarchive/archive_hmac_private.h stable/10/contrib/libarchive/libarchive/archive_pack_dev.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/archive_pack_dev.c stable/10/contrib/libarchive/libarchive/archive_pack_dev.h - copied unchanged from r299529, head/contrib/libarchive/libarchive/archive_pack_dev.h stable/10/contrib/libarchive/libarchive/archive_random.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/archive_random.c stable/10/contrib/libarchive/libarchive/archive_random_private.h - copied unchanged from r299529, head/contrib/libarchive/libarchive/archive_random_private.h stable/10/contrib/libarchive/libarchive/archive_read_add_passphrase.3 - copied unchanged from r299529, head/contrib/libarchive/libarchive/archive_read_add_passphrase.3 stable/10/contrib/libarchive/libarchive/archive_read_add_passphrase.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/archive_read_add_passphrase.c stable/10/contrib/libarchive/libarchive/archive_read_extract2.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/archive_read_extract2.c stable/10/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_warc.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/archive_read_support_format_warc.c stable/10/contrib/libarchive/libarchive/archive_write_add_filter_lz4.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/archive_write_add_filter_lz4.c stable/10/contrib/libarchive/libarchive/archive_write_set_format_filter_by_ext.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/archive_write_set_format_filter_by_ext.c stable/10/contrib/libarchive/libarchive/archive_write_set_format_raw.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/archive_write_set_format_raw.c stable/10/contrib/libarchive/libarchive/archive_write_set_format_warc.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/archive_write_set_format_warc.c stable/10/contrib/libarchive/libarchive/archive_write_set_passphrase.3 - copied unchanged from r299529, head/contrib/libarchive/libarchive/archive_write_set_passphrase.3 stable/10/contrib/libarchive/libarchive/archive_write_set_passphrase.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/archive_write_set_passphrase.c stable/10/contrib/libarchive/libarchive/archive_xxhash.h - copied unchanged from r299529, head/contrib/libarchive/libarchive/archive_xxhash.h stable/10/contrib/libarchive/libarchive/test/test_archive_digest.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_archive_digest.c stable/10/contrib/libarchive/libarchive/test/test_archive_read_add_passphrase.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_archive_read_add_passphrase.c stable/10/contrib/libarchive/libarchive/test/test_archive_write_set_format_filter_by_ext.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_archive_write_set_format_filter_by_ext.c stable/10/contrib/libarchive/libarchive/test/test_archive_write_set_passphrase.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_archive_write_set_passphrase.c stable/10/contrib/libarchive/libarchive/test/test_compat_lz4.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_compat_lz4.c stable/10/contrib/libarchive/libarchive/test/test_compat_lz4_1.tar.lz4.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_compat_lz4_1.tar.lz4.uu stable/10/contrib/libarchive/libarchive/test/test_compat_lz4_2.tar.lz4.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_compat_lz4_2.tar.lz4.uu stable/10/contrib/libarchive/libarchive/test/test_compat_lz4_3.tar.lz4.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_compat_lz4_3.tar.lz4.uu stable/10/contrib/libarchive/libarchive/test/test_compat_lz4_B4.tar.lz4.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_compat_lz4_B4.tar.lz4.uu stable/10/contrib/libarchive/libarchive/test/test_compat_lz4_B4BD.tar.lz4.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_compat_lz4_B4BD.tar.lz4.uu stable/10/contrib/libarchive/libarchive/test/test_compat_lz4_B4BDBX.tar.lz4.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_compat_lz4_B4BDBX.tar.lz4.uu stable/10/contrib/libarchive/libarchive/test/test_compat_lz4_B5.tar.lz4.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_compat_lz4_B5.tar.lz4.uu stable/10/contrib/libarchive/libarchive/test/test_compat_lz4_B5BD.tar.lz4.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_compat_lz4_B5BD.tar.lz4.uu stable/10/contrib/libarchive/libarchive/test/test_compat_lz4_B6.tar.lz4.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_compat_lz4_B6.tar.lz4.uu stable/10/contrib/libarchive/libarchive/test/test_compat_lz4_B6BD.tar.lz4.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_compat_lz4_B6BD.tar.lz4.uu stable/10/contrib/libarchive/libarchive/test/test_compat_lz4_B7.tar.lz4.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_compat_lz4_B7.tar.lz4.uu stable/10/contrib/libarchive/libarchive/test/test_compat_lz4_B7BD.tar.lz4.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_compat_lz4_B7BD.tar.lz4.uu stable/10/contrib/libarchive/libarchive/test/test_compat_uudecode_large.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_compat_uudecode_large.c stable/10/contrib/libarchive/libarchive/test/test_compat_uudecode_large.tar.Z.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_compat_uudecode_large.tar.Z.uu stable/10/contrib/libarchive/libarchive/test/test_read_filter_compress.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_filter_compress.c stable/10/contrib/libarchive/libarchive/test/test_read_format_7zip_encryption.7z.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_7zip_encryption.7z.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_7zip_encryption_data.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_7zip_encryption_data.c stable/10/contrib/libarchive/libarchive/test/test_read_format_7zip_encryption_header.7z.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_7zip_encryption_header.7z.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_7zip_encryption_header.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_7zip_encryption_header.c stable/10/contrib/libarchive/libarchive/test/test_read_format_7zip_encryption_partially.7z.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_7zip_encryption_partially.7z.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_7zip_encryption_partially.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_7zip_encryption_partially.c stable/10/contrib/libarchive/libarchive/test/test_read_format_7zip_malformed.7z.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_7zip_malformed.7z.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_7zip_malformed.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_7zip_malformed.c stable/10/contrib/libarchive/libarchive/test/test_read_format_7zip_malformed2.7z.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_7zip_malformed2.7z.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_cpio_bin_le.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_cpio_bin_le.c stable/10/contrib/libarchive/libarchive/test/test_read_format_cpio_bin_le.cpio.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_cpio_bin_le.cpio.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_lha_bugfix_0.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_lha_bugfix_0.c stable/10/contrib/libarchive/libarchive/test/test_read_format_lha_bugfix_0.lzh.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_lha_bugfix_0.lzh.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar_encryption_data.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_rar_encryption_data.c stable/10/contrib/libarchive/libarchive/test/test_read_format_rar_encryption_data.rar.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_rar_encryption_data.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar_encryption_header.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_rar_encryption_header.c stable/10/contrib/libarchive/libarchive/test/test_read_format_rar_encryption_header.rar.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_rar_encryption_header.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar_encryption_partially.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_rar_encryption_partially.c stable/10/contrib/libarchive/libarchive/test/test_read_format_rar_encryption_partially.rar.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_rar_encryption_partially.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_tar_concatenated.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_tar_concatenated.c stable/10/contrib/libarchive/libarchive/test/test_read_format_tar_concatenated.tar.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_tar_concatenated.tar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_tar_empty_pax.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_tar_empty_pax.c stable/10/contrib/libarchive/libarchive/test/test_read_format_tar_empty_pax.tar.Z.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_tar_empty_pax.tar.Z.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_warc.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_warc.c stable/10/contrib/libarchive/libarchive/test/test_read_format_warc.warc.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_warc.warc.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_encryption_data.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_zip_encryption_data.c stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_encryption_data.zip.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_zip_encryption_data.zip.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_encryption_header.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_zip_encryption_header.c stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_encryption_header.zip.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_zip_encryption_header.zip.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_encryption_partially.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_zip_encryption_partially.c stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_encryption_partially.zip.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_zip_encryption_partially.zip.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_malformed.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_zip_malformed.c stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_malformed1.zip.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_zip_malformed1.zip.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_msdos.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_zip_msdos.c stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_msdos.zip.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_zip_msdos.zip.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_nested.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_zip_nested.c stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_nested.zip.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_zip_nested.zip.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_nofiletype.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_zip_nofiletype.c stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_nofiletype.zip.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_zip_nofiletype.zip.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_padded.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_zip_padded.c stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_padded1.zip.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_zip_padded1.zip.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_padded2.zip.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_zip_padded2.zip.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_padded3.zip.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_zip_padded3.zip.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_traditional_encryption_data.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_zip_traditional_encryption_data.c stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_traditional_encryption_data.zip.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_zip_traditional_encryption_data.zip.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes.c stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes128.zip.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes128.zip.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes256.zip.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes256.zip.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes256_large.zip.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes256_large.zip.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes256_stored.zip.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes256_stored.zip.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes_large.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes_large.c stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_zip64.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_zip_zip64.c stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_zip64a.zip.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_zip_zip64a.zip.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_zip64b.zip.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_format_zip_zip64b.zip.uu stable/10/contrib/libarchive/libarchive/test/test_read_too_many_filters.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_too_many_filters.c stable/10/contrib/libarchive/libarchive/test/test_read_too_many_filters.gz.uu - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_read_too_many_filters.gz.uu stable/10/contrib/libarchive/libarchive/test/test_warn_missing_hardlink_target.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_warn_missing_hardlink_target.c stable/10/contrib/libarchive/libarchive/test/test_write_filter_lz4.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_write_filter_lz4.c stable/10/contrib/libarchive/libarchive/test/test_write_format_raw.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_write_format_raw.c stable/10/contrib/libarchive/libarchive/test/test_write_format_raw_b64.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_write_format_raw_b64.c stable/10/contrib/libarchive/libarchive/test/test_write_format_warc.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_write_format_warc.c stable/10/contrib/libarchive/libarchive/test/test_write_format_warc_empty.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_write_format_warc_empty.c stable/10/contrib/libarchive/libarchive/test/test_write_format_zip_compression_store.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_write_format_zip_compression_store.c stable/10/contrib/libarchive/libarchive/test/test_write_format_zip_empty_zip64.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_write_format_zip_empty_zip64.c stable/10/contrib/libarchive/libarchive/test/test_write_format_zip_file.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_write_format_zip_file.c stable/10/contrib/libarchive/libarchive/test/test_write_format_zip_file_zip64.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_write_format_zip_file_zip64.c stable/10/contrib/libarchive/libarchive/test/test_write_format_zip_large.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_write_format_zip_large.c stable/10/contrib/libarchive/libarchive/test/test_write_format_zip_zip64.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_write_format_zip_zip64.c stable/10/contrib/libarchive/libarchive/test/test_write_read_format_zip.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/test/test_write_read_format_zip.c stable/10/contrib/libarchive/libarchive/xxhash.c - copied unchanged from r299529, head/contrib/libarchive/libarchive/xxhash.c stable/10/contrib/libarchive/libarchive_fe/passphrase.c - copied unchanged from r299529, head/contrib/libarchive/libarchive_fe/passphrase.c stable/10/contrib/libarchive/libarchive_fe/passphrase.h - copied unchanged from r299529, head/contrib/libarchive/libarchive_fe/passphrase.h stable/10/contrib/libarchive/tar/test/test_extract.tar.lz4.uu - copied unchanged from r299529, head/contrib/libarchive/tar/test/test_extract.tar.lz4.uu stable/10/contrib/libarchive/tar/test/test_extract_tar_lz4.c - copied unchanged from r299529, head/contrib/libarchive/tar/test/test_extract_tar_lz4.c stable/10/contrib/libarchive/tar/test/test_leading_slash.c - copied unchanged from r299529, head/contrib/libarchive/tar/test/test_leading_slash.c stable/10/contrib/libarchive/tar/test/test_leading_slash.tar.uu - copied unchanged from r299529, head/contrib/libarchive/tar/test/test_leading_slash.tar.uu stable/10/contrib/libarchive/tar/test/test_option_lz4.c - copied unchanged from r299529, head/contrib/libarchive/tar/test/test_option_lz4.c stable/10/contrib/libarchive/tar/test/test_option_passphrase.c - copied unchanged from r299529, head/contrib/libarchive/tar/test/test_option_passphrase.c stable/10/contrib/libarchive/tar/test/test_option_passphrase.zip.uu - copied unchanged from r299529, head/contrib/libarchive/tar/test/test_option_passphrase.zip.uu stable/10/usr.bin/bsdcat/ - copied from r299529, head/usr.bin/bsdcat/ Deleted: stable/10/contrib/libarchive/libarchive/archive_crypto.c stable/10/contrib/libarchive/libarchive/archive_crypto_private.h stable/10/contrib/libarchive/libarchive/test/test_archive_crypto.c stable/10/contrib/libarchive/libarchive/test/test_write_format_zip_no_compression.c stable/10/contrib/libarchive/libarchive/test/test_write_zip_set_compression_store.c Modified: stable/10/contrib/libarchive/COPYING stable/10/contrib/libarchive/FREEBSD-Xlist stable/10/contrib/libarchive/FREEBSD-upgrade stable/10/contrib/libarchive/NEWS stable/10/contrib/libarchive/README stable/10/contrib/libarchive/cpio/bsdcpio.1 stable/10/contrib/libarchive/cpio/cmdline.c stable/10/contrib/libarchive/cpio/cpio.c stable/10/contrib/libarchive/cpio/cpio.h stable/10/contrib/libarchive/cpio/cpio_platform.h stable/10/contrib/libarchive/cpio/test/main.c stable/10/contrib/libarchive/cpio/test/test.h stable/10/contrib/libarchive/cpio/test/test_basic.c stable/10/contrib/libarchive/cpio/test/test_extract_cpio_lzo.c stable/10/contrib/libarchive/cpio/test/test_option_c.c stable/10/contrib/libarchive/cpio/test/test_option_version.c stable/10/contrib/libarchive/libarchive/archive.h stable/10/contrib/libarchive/libarchive/archive_endian.h stable/10/contrib/libarchive/libarchive/archive_entry.3 stable/10/contrib/libarchive/libarchive/archive_entry.c stable/10/contrib/libarchive/libarchive/archive_entry.h stable/10/contrib/libarchive/libarchive/archive_entry_acl.3 stable/10/contrib/libarchive/libarchive/archive_entry_copy_stat.c stable/10/contrib/libarchive/libarchive/archive_entry_paths.3 stable/10/contrib/libarchive/libarchive/archive_entry_perms.3 stable/10/contrib/libarchive/libarchive/archive_entry_private.h stable/10/contrib/libarchive/libarchive/archive_entry_sparse.c stable/10/contrib/libarchive/libarchive/archive_entry_stat.3 stable/10/contrib/libarchive/libarchive/archive_entry_time.3 stable/10/contrib/libarchive/libarchive/archive_entry_xattr.c stable/10/contrib/libarchive/libarchive/archive_getdate.c stable/10/contrib/libarchive/libarchive/archive_match.c stable/10/contrib/libarchive/libarchive/archive_options.c stable/10/contrib/libarchive/libarchive/archive_pathmatch.c stable/10/contrib/libarchive/libarchive/archive_platform.h stable/10/contrib/libarchive/libarchive/archive_private.h stable/10/contrib/libarchive/libarchive/archive_read.3 stable/10/contrib/libarchive/libarchive/archive_read.c stable/10/contrib/libarchive/libarchive/archive_read_append_filter.c stable/10/contrib/libarchive/libarchive/archive_read_data.3 stable/10/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c stable/10/contrib/libarchive/libarchive/archive_read_disk_posix.c stable/10/contrib/libarchive/libarchive/archive_read_disk_private.h stable/10/contrib/libarchive/libarchive/archive_read_disk_set_standard_lookup.c stable/10/contrib/libarchive/libarchive/archive_read_extract.c stable/10/contrib/libarchive/libarchive/archive_read_filter.3 stable/10/contrib/libarchive/libarchive/archive_read_open.3 stable/10/contrib/libarchive/libarchive/archive_read_open_fd.c stable/10/contrib/libarchive/libarchive/archive_read_open_file.c stable/10/contrib/libarchive/libarchive/archive_read_open_filename.c stable/10/contrib/libarchive/libarchive/archive_read_open_memory.c stable/10/contrib/libarchive/libarchive/archive_read_private.h stable/10/contrib/libarchive/libarchive/archive_read_set_options.3 stable/10/contrib/libarchive/libarchive/archive_read_set_options.c stable/10/contrib/libarchive/libarchive/archive_read_support_filter_all.c stable/10/contrib/libarchive/libarchive/archive_read_support_filter_compress.c stable/10/contrib/libarchive/libarchive/archive_read_support_filter_lzop.c stable/10/contrib/libarchive/libarchive/archive_read_support_filter_uu.c stable/10/contrib/libarchive/libarchive/archive_read_support_filter_xz.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_7zip.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_all.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_ar.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_cab.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_cpio.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_empty.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_lha.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_mtree.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_raw.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_tar.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_xar.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_zip.c stable/10/contrib/libarchive/libarchive/archive_string.c stable/10/contrib/libarchive/libarchive/archive_util.c stable/10/contrib/libarchive/libarchive/archive_virtual.c stable/10/contrib/libarchive/libarchive/archive_write.3 stable/10/contrib/libarchive/libarchive/archive_write.c stable/10/contrib/libarchive/libarchive/archive_write_add_filter.c stable/10/contrib/libarchive/libarchive/archive_write_add_filter_by_name.c stable/10/contrib/libarchive/libarchive/archive_write_add_filter_bzip2.c stable/10/contrib/libarchive/libarchive/archive_write_add_filter_grzip.c stable/10/contrib/libarchive/libarchive/archive_write_add_filter_gzip.c stable/10/contrib/libarchive/libarchive/archive_write_add_filter_lrzip.c stable/10/contrib/libarchive/libarchive/archive_write_add_filter_lzop.c stable/10/contrib/libarchive/libarchive/archive_write_add_filter_program.c stable/10/contrib/libarchive/libarchive/archive_write_add_filter_xz.c stable/10/contrib/libarchive/libarchive/archive_write_data.3 stable/10/contrib/libarchive/libarchive/archive_write_disk.3 stable/10/contrib/libarchive/libarchive/archive_write_disk_acl.c stable/10/contrib/libarchive/libarchive/archive_write_disk_posix.c stable/10/contrib/libarchive/libarchive/archive_write_disk_set_standard_lookup.c stable/10/contrib/libarchive/libarchive/archive_write_filter.3 stable/10/contrib/libarchive/libarchive/archive_write_finish_entry.3 stable/10/contrib/libarchive/libarchive/archive_write_format.3 stable/10/contrib/libarchive/libarchive/archive_write_open.3 stable/10/contrib/libarchive/libarchive/archive_write_open_filename.c stable/10/contrib/libarchive/libarchive/archive_write_private.h stable/10/contrib/libarchive/libarchive/archive_write_set_format.c stable/10/contrib/libarchive/libarchive/archive_write_set_format_7zip.c stable/10/contrib/libarchive/libarchive/archive_write_set_format_by_name.c stable/10/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c stable/10/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c stable/10/contrib/libarchive/libarchive/archive_write_set_format_mtree.c stable/10/contrib/libarchive/libarchive/archive_write_set_format_pax.c stable/10/contrib/libarchive/libarchive/archive_write_set_format_shar.c stable/10/contrib/libarchive/libarchive/archive_write_set_format_xar.c stable/10/contrib/libarchive/libarchive/archive_write_set_format_zip.c stable/10/contrib/libarchive/libarchive/archive_write_set_options.3 stable/10/contrib/libarchive/libarchive/libarchive-formats.5 stable/10/contrib/libarchive/libarchive/libarchive.3 stable/10/contrib/libarchive/libarchive/libarchive_internals.3 stable/10/contrib/libarchive/libarchive/tar.5 stable/10/contrib/libarchive/libarchive/test/README stable/10/contrib/libarchive/libarchive/test/main.c stable/10/contrib/libarchive/libarchive/test/read_open_memory.c stable/10/contrib/libarchive/libarchive/test/test.h stable/10/contrib/libarchive/libarchive/test/test_archive_getdate.c stable/10/contrib/libarchive/libarchive/test/test_archive_match_time.c stable/10/contrib/libarchive/libarchive/test/test_archive_pathmatch.c stable/10/contrib/libarchive/libarchive/test/test_archive_string.c stable/10/contrib/libarchive/libarchive/test/test_archive_write_add_filter_by_name.c stable/10/contrib/libarchive/libarchive/test/test_archive_write_set_format_by_name.c stable/10/contrib/libarchive/libarchive/test/test_compat_mac.c stable/10/contrib/libarchive/libarchive/test/test_compat_pax_libarchive_2x.c stable/10/contrib/libarchive/libarchive/test/test_compat_zip.c stable/10/contrib/libarchive/libarchive/test/test_fuzz.c stable/10/contrib/libarchive/libarchive/test/test_gnutar_filename_encoding.c stable/10/contrib/libarchive/libarchive/test/test_pax_filename_encoding.c stable/10/contrib/libarchive/libarchive/test/test_read_data_large.c stable/10/contrib/libarchive/libarchive/test/test_read_disk_directory_traversals.c stable/10/contrib/libarchive/libarchive/test/test_read_format_7zip.c stable/10/contrib/libarchive/libarchive/test/test_read_format_ar.c stable/10/contrib/libarchive/libarchive/test/test_read_format_cab.c stable/10/contrib/libarchive/libarchive/test/test_read_format_cab_filename.c stable/10/contrib/libarchive/libarchive/test/test_read_format_cpio_afio.c stable/10/contrib/libarchive/libarchive/test/test_read_format_cpio_bin.c stable/10/contrib/libarchive/libarchive/test/test_read_format_cpio_bin_Z.c stable/10/contrib/libarchive/libarchive/test/test_read_format_cpio_bin_be.c stable/10/contrib/libarchive/libarchive/test/test_read_format_cpio_bin_bz2.c stable/10/contrib/libarchive/libarchive/test/test_read_format_cpio_bin_gz.c stable/10/contrib/libarchive/libarchive/test/test_read_format_cpio_bin_lzip.c stable/10/contrib/libarchive/libarchive/test/test_read_format_cpio_bin_lzma.c stable/10/contrib/libarchive/libarchive/test/test_read_format_cpio_bin_xz.c stable/10/contrib/libarchive/libarchive/test/test_read_format_cpio_filename.c stable/10/contrib/libarchive/libarchive/test/test_read_format_cpio_odc.c stable/10/contrib/libarchive/libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c stable/10/contrib/libarchive/libarchive/test/test_read_format_cpio_svr4_gzip.c stable/10/contrib/libarchive/libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c stable/10/contrib/libarchive/libarchive/test/test_read_format_cpio_svr4c_Z.c stable/10/contrib/libarchive/libarchive/test/test_read_format_empty.c stable/10/contrib/libarchive/libarchive/test/test_read_format_gtar_filename.c stable/10/contrib/libarchive/libarchive/test/test_read_format_gtar_gz.c stable/10/contrib/libarchive/libarchive/test/test_read_format_gtar_lzma.c stable/10/contrib/libarchive/libarchive/test/test_read_format_gtar_sparse.c stable/10/contrib/libarchive/libarchive/test/test_read_format_gtar_sparse_skip_entry.c stable/10/contrib/libarchive/libarchive/test/test_read_format_iso_Z.c stable/10/contrib/libarchive/libarchive/test/test_read_format_iso_multi_extent.c stable/10/contrib/libarchive/libarchive/test/test_read_format_iso_xorriso.c stable/10/contrib/libarchive/libarchive/test/test_read_format_isojoliet_bz2.c stable/10/contrib/libarchive/libarchive/test/test_read_format_isojoliet_long.c stable/10/contrib/libarchive/libarchive/test/test_read_format_isojoliet_rr.c stable/10/contrib/libarchive/libarchive/test/test_read_format_isojoliet_versioned.c stable/10/contrib/libarchive/libarchive/test/test_read_format_isorr_bz2.c stable/10/contrib/libarchive/libarchive/test/test_read_format_isorr_ce.c stable/10/contrib/libarchive/libarchive/test/test_read_format_isorr_new_bz2.c stable/10/contrib/libarchive/libarchive/test/test_read_format_isorr_rr_moved.c stable/10/contrib/libarchive/libarchive/test/test_read_format_isozisofs_bz2.c stable/10/contrib/libarchive/libarchive/test/test_read_format_lha.c stable/10/contrib/libarchive/libarchive/test/test_read_format_lha_filename.c stable/10/contrib/libarchive/libarchive/test/test_read_format_mtree.c stable/10/contrib/libarchive/libarchive/test/test_read_format_mtree.mtree.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_pax_bz2.c stable/10/contrib/libarchive/libarchive/test/test_read_format_rar.c stable/10/contrib/libarchive/libarchive/test/test_read_format_raw.c stable/10/contrib/libarchive/libarchive/test/test_read_format_tar.c stable/10/contrib/libarchive/libarchive/test/test_read_format_tar_empty_filename.c stable/10/contrib/libarchive/libarchive/test/test_read_format_tar_filename.c stable/10/contrib/libarchive/libarchive/test/test_read_format_tbz.c stable/10/contrib/libarchive/libarchive/test/test_read_format_tgz.c stable/10/contrib/libarchive/libarchive/test/test_read_format_tlz.c stable/10/contrib/libarchive/libarchive/test/test_read_format_txz.c stable/10/contrib/libarchive/libarchive/test/test_read_format_tz.c stable/10/contrib/libarchive/libarchive/test/test_read_format_ustar_filename.c stable/10/contrib/libarchive/libarchive/test/test_read_format_xar.c stable/10/contrib/libarchive/libarchive/test/test_read_format_zip.c stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_comment_stored.c stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_filename.c stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_mac_metadata.c stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_sfx.c stable/10/contrib/libarchive/libarchive/test/test_read_truncated.c stable/10/contrib/libarchive/libarchive/test/test_sparse_basic.c stable/10/contrib/libarchive/libarchive/test/test_ustar_filename_encoding.c stable/10/contrib/libarchive/libarchive/test/test_write_disk_appledouble.c stable/10/contrib/libarchive/libarchive/test/test_write_disk_hfs_compression.c stable/10/contrib/libarchive/libarchive/test/test_write_disk_mac_metadata.c stable/10/contrib/libarchive/libarchive/test/test_write_disk_no_hfs_compression.c stable/10/contrib/libarchive/libarchive/test/test_write_disk_perms.c stable/10/contrib/libarchive/libarchive/test/test_write_disk_secure.c stable/10/contrib/libarchive/libarchive/test/test_write_filter_lzop.c stable/10/contrib/libarchive/libarchive/test/test_write_filter_program.c stable/10/contrib/libarchive/libarchive/test/test_write_format_ar.c stable/10/contrib/libarchive/libarchive/test/test_write_format_cpio_newc.c stable/10/contrib/libarchive/libarchive/test/test_write_format_gnutar.c stable/10/contrib/libarchive/libarchive/test/test_write_format_iso9660.c stable/10/contrib/libarchive/libarchive/test/test_write_format_iso9660_boot.c stable/10/contrib/libarchive/libarchive/test/test_write_format_mtree.c stable/10/contrib/libarchive/libarchive/test/test_write_format_pax.c stable/10/contrib/libarchive/libarchive/test/test_write_format_tar.c stable/10/contrib/libarchive/libarchive/test/test_write_format_tar_sparse.c stable/10/contrib/libarchive/libarchive/test/test_write_format_zip.c stable/10/contrib/libarchive/libarchive/test/test_zip_filename_encoding.c stable/10/contrib/libarchive/libarchive_fe/err.c stable/10/contrib/libarchive/libarchive_fe/err.h stable/10/contrib/libarchive/tar/bsdtar.1 stable/10/contrib/libarchive/tar/bsdtar.c stable/10/contrib/libarchive/tar/bsdtar.h stable/10/contrib/libarchive/tar/bsdtar_platform.h stable/10/contrib/libarchive/tar/cmdline.c stable/10/contrib/libarchive/tar/creation_set.c stable/10/contrib/libarchive/tar/read.c stable/10/contrib/libarchive/tar/subst.c stable/10/contrib/libarchive/tar/test/main.c stable/10/contrib/libarchive/tar/test/test.h stable/10/contrib/libarchive/tar/test/test_option_X_upper.c stable/10/contrib/libarchive/tar/test/test_option_b.c stable/10/contrib/libarchive/tar/test/test_option_s.c stable/10/contrib/libarchive/tar/test/test_version.c stable/10/contrib/libarchive/tar/util.c stable/10/contrib/libarchive/tar/write.c stable/10/etc/mtree/BSD.tests.dist stable/10/lib/libarchive/Makefile stable/10/lib/libarchive/config_freebsd.h stable/10/lib/libarchive/tests/Makefile stable/10/usr.bin/Makefile stable/10/usr.bin/ar/Makefile stable/10/usr.bin/bsdcat/Makefile stable/10/usr.bin/bsdcat/tests/Makefile stable/10/usr.bin/cpio/Makefile stable/10/usr.bin/cpio/tests/Makefile stable/10/usr.bin/tar/Makefile stable/10/usr.bin/tar/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/libarchive/COPYING ============================================================================== --- stable/10/contrib/libarchive/COPYING Fri Jun 17 19:41:30 2016 (r302000) +++ stable/10/contrib/libarchive/COPYING Fri Jun 17 22:40:10 2016 (r302001) @@ -17,12 +17,11 @@ the actual statements in the files are c files for details: libarchive/archive_entry.c libarchive/archive_read_support_filter_compress.c - libarchive/archive_write_set_filter_compress.c + libarchive/archive_write_add_filter_compress.c libarchive/mtree.5 - tar/matching.c * The following source files are in the public domain: - tar/getdate.c + libarchive/archive_getdate.c * The build files---including Makefiles, configure scripts, and auxiliary scripts used as part of the compile process---have Modified: stable/10/contrib/libarchive/FREEBSD-Xlist ============================================================================== --- stable/10/contrib/libarchive/FREEBSD-Xlist Fri Jun 17 19:41:30 2016 (r302000) +++ stable/10/contrib/libarchive/FREEBSD-Xlist Fri Jun 17 22:40:10 2016 (r302001) @@ -1,11 +1,15 @@ .git .gitattributes .gitignore +.travis.yml CMakeLists.txt +CONTRIBUTING.md CTestConfig.cmake INSTALL Makefile.am build +cat/CMakeLists.txt +cat/test/CMakeLists.txt configure.ac contrib cpio/CMakeLists.txt Modified: stable/10/contrib/libarchive/FREEBSD-upgrade ============================================================================== --- stable/10/contrib/libarchive/FREEBSD-upgrade Fri Jun 17 19:41:30 2016 (r302000) +++ stable/10/contrib/libarchive/FREEBSD-upgrade Fri Jun 17 22:40:10 2016 (r302001) @@ -4,13 +4,14 @@ libarchive The source code is pulled with git: - git clone -b release git://github.com/libarchive/libarchive.git + git clone git://github.com/libarchive/libarchive.git For the contrib directory files and directories were pruned by: sh -c 'for F in `cat FREEBSD-Xlist | grep -v FreeBSD`; do rm -rf ./$F ; done' -You may check if there are any new files that we don't need. +You may check if there are any new files that we don't need and add them to +FREEBSD-Xlist. The instructions for importing new release and merging to HEAD can be found at FreeBSD wiki: Modified: stable/10/contrib/libarchive/NEWS ============================================================================== --- stable/10/contrib/libarchive/NEWS Fri Jun 17 19:41:30 2016 (r302000) +++ stable/10/contrib/libarchive/NEWS Fri Jun 17 22:40:10 2016 (r302001) @@ -1,3 +1,35 @@ +Apr 09, 2016: libarchive 3.1.901a released + Another test release in preparation for 3.2.0 + +Feb 13, 2016: libarchive 3.1.900a released + This is a test release in preparation for 3.2.0 + +Oct 21, 2015: Preliminary port to OSF + +Apr 11, 2015: libarchive's issue tracker is now hosted at GitHub. + https://github.com/libarchive/libarchive/issues + +Early 2015: Many fixes to crash and overflow bugs thanks to Hanno Boeck + +Oct 13, 2014: Zip encryption and decryption support + +Aug 13, 2014: Add support for lz4 compression. + +Jun 10, 2014: Add warc format support + +May 3, 2014: Add experimental Zip streaming extension + +Apr 6, 2014: Add bsdcat command-line tool + +Jan 12, 2014: Add Zip64 support + +Dec 1, 2013: Rewrite Zip write logic + +Jul 1, 2013: Add ability to detect encrypted entries for many formats + (This does not add the ability to *decrypt* those entries, however) + +Feb 23, 2013: "raw" write support added + Feb 09, 2013: libarchive 3.1.2 released Jan 28, 2013: libarchive's new website moved to http://www.libarchive.org. Modified: stable/10/contrib/libarchive/README ============================================================================== --- stable/10/contrib/libarchive/README Fri Jun 17 19:41:30 2016 (r302000) +++ stable/10/contrib/libarchive/README Fri Jun 17 22:40:10 2016 (r302001) @@ -5,7 +5,7 @@ Questions? Issues? libarchive development, including documentation, and links to the libarchive mailing lists. * To report an issue, use the issue tracker at - http://code.google.com/p/libarchive/issues/list + https://github.com/libarchive/libarchive/issues * To submit an enhancement to libarchive, please submit a pull request via GitHub. https://github.com/libarchive/libarchive/pulls @@ -13,9 +13,11 @@ Questions? Issues? This distribution bundle includes the following components: * libarchive: a library for reading and writing streaming archives * tar: the 'bsdtar' program is a full-featured 'tar' - replacement built on libarchive + implementation built on libarchive * cpio: the 'bsdcpio' program is a different interface to essentially the same functionality + * cat: the 'bsdcat' program is a simple replacement tool for + zcat, bzcat, xzcat, and such * examples: Some small example programs that you may find useful. * examples/minitar: a compact sample demonstrating use of libarchive. * contrib: Various items sent to me by third parties; @@ -39,6 +41,7 @@ The following files in the top-level dir Guide to Documentation installed by this system: * bsdtar.1 explains the use of the bsdtar program * bsdcpio.1 explains the use of the bsdcpio program + * bsdcat.1 explains the use of the bsdcat program * libarchive.3 gives an overview of the library as a whole * archive_read.3, archive_write.3, archive_write_disk.3, and archive_read_disk.3 provide detailed calling sequences for the read @@ -84,6 +87,8 @@ The library also detects and handles any * bzip2 compression * compress/LZW compression * lzma, lzip, and xz compression + * lz4 compression + * lzop compression The library can create archives in any of the following formats: * POSIX ustar @@ -91,6 +96,7 @@ The library can create archives in any o * "restricted" pax format, which will create ustar archives except for entries that require pax extensions (for long filenames, ACLs, etc). * Old GNU tar format + * Old V7 tar format * POSIX octet-oriented cpio * SVR4 "newc" cpio * shar archives @@ -107,6 +113,8 @@ When creating archives, the result can b * bzip2 compression * compress/LZW compression * lzma, lzip, and xz compression + * lz4 compression + * lzop compression Notes about the library architecture: @@ -123,12 +131,12 @@ Notes about the library architecture: * I've attempted to minimize static link pollution. If you don't explicitly invoke a particular feature (such as support for a - particular compression or format), it won't get pulled in. - In particular, if you don't explicitly enable a particular - compression or decompression support, you won't need to link - against the corresponding compression or decompression libraries. - This also reduces the size of statically-linked binaries in - environments where that matters. + particular compression or format), it won't get pulled in to + statically-linked programs. In particular, if you don't explicitly + enable a particular compression or decompression support, you won't + need to link against the corresponding compression or decompression + libraries. This also reduces the size of statically-linked + binaries in environments where that matters. * On read, the library accepts whatever blocks you hand it. Your read callback is free to pass the library a byte at a time Modified: stable/10/contrib/libarchive/cpio/bsdcpio.1 ============================================================================== --- stable/10/contrib/libarchive/cpio/bsdcpio.1 Fri Jun 17 19:41:30 2016 (r302000) +++ stable/10/contrib/libarchive/cpio/bsdcpio.1 Fri Jun 17 22:40:10 2016 (r302001) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 7, 2012 +.Dd September 16, 2014 .Dt CPIO 1 .Os .Sh NAME @@ -32,17 +32,17 @@ .Nd copy files to and from archives .Sh SYNOPSIS .Nm -.Brq Fl i +.Fl i .Op Ar options .Op Ar pattern ... .Op Ar < archive .Nm -.Brq Fl o +.Fl o .Op Ar options .Ar < name-list .Op Ar > archive .Nm -.Brq Fl p +.Fl p .Op Ar options .Ar dest-dir .Ar < name-list @@ -182,6 +182,11 @@ instead of copying. Compress the resulting archive with .Xr lrzip 1 . In input mode, this option is ignored. +.It Fl Fl lz4 +(o mode only) +Compress the archive with lz4-compatible compression before writing it. +In input mode, this option is ignored; lz4 compression is recognized +automatically on input. .It Fl Fl lzma (o mode only) Compress the file with lzma-compatible compression before writing it. @@ -192,6 +197,15 @@ automatically on input. Compress the resulting archive with .Xr lzop 1 . In input mode, this option is ignored. +.It Fl Fl passphrase Ar passphrase +The +.Pa passphrase +is used to extract or create an encrypted archive. +Currently, zip is only a format that +.Nm +can handle encrypted archives. +You shouldn't use this option unless you realize how insecure +use of this option is. .It Fl m , Fl Fl preserve-modification-time (i and p modes) Set file modification time on created files to match Modified: stable/10/contrib/libarchive/cpio/cmdline.c ============================================================================== --- stable/10/contrib/libarchive/cpio/cmdline.c Fri Jun 17 19:41:30 2016 (r302000) +++ stable/10/contrib/libarchive/cpio/cmdline.c Fri Jun 17 22:40:10 2016 (r302001) @@ -73,6 +73,7 @@ static const struct option { { "link", 0, 'l' }, { "list", 0, 't' }, { "lrzip", 0, OPTION_LRZIP }, + { "lz4", 0, OPTION_LZ4 }, { "lzma", 0, OPTION_LZMA }, { "lzop", 0, OPTION_LZOP }, { "make-directories", 0, 'd' }, @@ -80,6 +81,7 @@ static const struct option { { "null", 0, '0' }, { "numeric-uid-gid", 0, 'n' }, { "owner", 1, 'R' }, + { "passphrase", 1, OPTION_PASSPHRASE }, { "pass-through", 0, 'p' }, { "preserve-modification-time", 0, 'm' }, { "preserve-owner", 0, OPTION_PRESERVE_OWNER }, Modified: stable/10/contrib/libarchive/cpio/cpio.c ============================================================================== --- stable/10/contrib/libarchive/cpio/cpio.c Fri Jun 17 19:41:30 2016 (r302000) +++ stable/10/contrib/libarchive/cpio/cpio.c Fri Jun 17 22:40:10 2016 (r302001) @@ -82,6 +82,7 @@ __FBSDID("$FreeBSD$"); #include "cpio.h" #include "err.h" #include "line_reader.h" +#include "passphrase.h" /* Fixed size of uname/gname caches. */ #define name_cache_size 101 @@ -123,6 +124,8 @@ static int restore_time(struct cpio *, s const char *, int fd); static void usage(void); static void version(void); +static const char * passphrase_callback(struct archive *, void *); +static void passphrase_free(char *); int main(int argc, char *argv[]) @@ -149,20 +152,9 @@ main(int argc, char *argv[]) } #endif - /* Need lafe_progname before calling lafe_warnc. */ - if (*argv == NULL) - lafe_progname = "bsdcpio"; - else { -#if defined(_WIN32) && !defined(__CYGWIN__) - lafe_progname = strrchr(*argv, '\\'); - if (strrchr(*argv, '/') > lafe_progname) -#endif - lafe_progname = strrchr(*argv, '/'); - if (lafe_progname != NULL) - lafe_progname++; - else - lafe_progname = *argv; - } + /* Set lafe_progname before calling lafe_warnc. */ + lafe_setprogname(*argv, "bsdcpio"); + #if HAVE_SETLOCALE if (setlocale(LC_ALL, "") == NULL) lafe_warnc(0, "Failed to set default locale"); @@ -274,6 +266,7 @@ main(int argc, char *argv[]) cpio->option_link = 1; break; case OPTION_LRZIP: + case OPTION_LZ4: case OPTION_LZMA: /* GNU tar, others */ case OPTION_LZOP: /* GNU tar, others */ cpio->compress = opt; @@ -304,6 +297,9 @@ main(int argc, char *argv[]) cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT; cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS; break; + case OPTION_PASSPHRASE: + cpio->passphrase = cpio->argument; + break; case OPTION_PRESERVE_OWNER: cpio->extract_flags |= ARCHIVE_EXTRACT_OWNER; break; @@ -432,6 +428,7 @@ main(int argc, char *argv[]) free_cache(cpio->gname_cache); free_cache(cpio->uname_cache); free(cpio->destdir); + passphrase_free(cpio->ppbuff); return (cpio->return_value); } @@ -440,7 +437,7 @@ usage(void) { const char *p; - p = lafe_progname; + p = lafe_getprogname(); fprintf(stderr, "Brief Usage:\n"); fprintf(stderr, " List: %s -it < archive\n", p); @@ -478,7 +475,7 @@ long_help(void) const char *prog; const char *p; - prog = lafe_progname; + prog = lafe_getprogname(); fflush(stderr); @@ -503,7 +500,7 @@ version(void) { fprintf(stdout,"bsdcpio %s -- %s\n", BSDCPIO_VERSION_STRING, - archive_version_string()); + archive_version_details()); exit(0); } @@ -540,6 +537,9 @@ mode_out(struct cpio *cpio) case OPTION_LRZIP: r = archive_write_add_filter_lrzip(cpio->archive); break; + case OPTION_LZ4: + r = archive_write_add_filter_lz4(cpio->archive); + break; case OPTION_LZMA: r = archive_write_add_filter_lzma(cpio->archive); break; @@ -581,6 +581,14 @@ mode_out(struct cpio *cpio) cpio->linkresolver = archive_entry_linkresolver_new(); archive_entry_linkresolver_set_strategy(cpio->linkresolver, archive_format(cpio->archive)); + if (cpio->passphrase != NULL) + r = archive_write_set_passphrase(cpio->archive, + cpio->passphrase); + else + r = archive_write_set_passphrase_callback(cpio->archive, cpio, + &passphrase_callback); + if (r != ARCHIVE_OK) + lafe_errc(1, 0, "%s", archive_error_string(cpio->archive)); /* * The main loop: Copy each file into the output archive. @@ -947,6 +955,13 @@ mode_in(struct cpio *cpio) lafe_errc(1, 0, "Couldn't allocate archive object"); archive_read_support_filter_all(a); archive_read_support_format_all(a); + if (cpio->passphrase != NULL) + r = archive_read_add_passphrase(a, cpio->passphrase); + else + r = archive_read_set_passphrase_callback(a, cpio, + &passphrase_callback); + if (r != ARCHIVE_OK) + lafe_errc(1, 0, "%s", archive_error_string(a)); if (archive_read_open_filename(a, cpio->filename, cpio->bytes_per_block)) @@ -1050,6 +1065,13 @@ mode_list(struct cpio *cpio) lafe_errc(1, 0, "Couldn't allocate archive object"); archive_read_support_filter_all(a); archive_read_support_format_all(a); + if (cpio->passphrase != NULL) + r = archive_read_add_passphrase(a, cpio->passphrase); + else + r = archive_read_set_passphrase_callback(a, cpio, + &passphrase_callback); + if (r != ARCHIVE_OK) + lafe_errc(1, 0, "%s", archive_error_string(a)); if (archive_read_open_filename(a, cpio->filename, cpio->bytes_per_block)) @@ -1239,8 +1261,10 @@ cpio_rename(const char *name) if (t == NULL) return (name); to = fopen("CONOUT$", "w"); - if (to == NULL) + if (to == NULL) { + fclose(t); return (name); + } fprintf(to, "%s (Enter/./(new name))? ", name); fclose(to); #else @@ -1420,3 +1444,28 @@ cpio_i64toa(int64_t n0) *--p = '-'; return p; } + +#define PPBUFF_SIZE 1024 +static const char * +passphrase_callback(struct archive *a, void *_client_data) +{ + struct cpio *cpio = (struct cpio *)_client_data; + (void)a; /* UNUSED */ + + if (cpio->ppbuff == NULL) { + cpio->ppbuff = malloc(PPBUFF_SIZE); + if (cpio->ppbuff == NULL) + lafe_errc(1, errno, "Out of memory"); + } + return lafe_readpassphrase("Enter passphrase:", + cpio->ppbuff, PPBUFF_SIZE); +} + +static void +passphrase_free(char *ppbuff) +{ + if (ppbuff != NULL) { + memset(ppbuff, 0, PPBUFF_SIZE); + free(ppbuff); + } +} Modified: stable/10/contrib/libarchive/cpio/cpio.h ============================================================================== --- stable/10/contrib/libarchive/cpio/cpio.h Fri Jun 17 19:41:30 2016 (r302000) +++ stable/10/contrib/libarchive/cpio/cpio.h Fri Jun 17 22:40:10 2016 (r302001) @@ -71,6 +71,7 @@ struct cpio { int gid_override; char *gname_override; int day_first; /* true if locale prefers day/mon */ + const char *passphrase; /* If >= 0, then close this when done. */ int fd; @@ -90,6 +91,7 @@ struct cpio { struct archive *matching; char *buff; size_t buff_size; + char *ppbuff; }; const char *owner_parse(const char *, int *, int *); @@ -101,8 +103,10 @@ enum { OPTION_GRZIP, OPTION_INSECURE, OPTION_LRZIP, + OPTION_LZ4, OPTION_LZMA, OPTION_LZOP, + OPTION_PASSPHRASE, OPTION_NO_PRESERVE_OWNER, OPTION_PRESERVE_OWNER, OPTION_QUIET, Modified: stable/10/contrib/libarchive/cpio/cpio_platform.h ============================================================================== --- stable/10/contrib/libarchive/cpio/cpio_platform.h Fri Jun 17 19:41:30 2016 (r302000) +++ stable/10/contrib/libarchive/cpio/cpio_platform.h Fri Jun 17 22:40:10 2016 (r302001) @@ -42,6 +42,10 @@ #include "config.h" #endif +#if defined(_WIN32) && !defined(__CYGWIN__) +#include "cpio_windows.h" +#endif + /* Get a real definition for __FBSDID if we can */ #if HAVE_SYS_CDEFS_H #include @@ -70,8 +74,4 @@ #define __LA_DEAD #endif -#if defined(_WIN32) && !defined(__CYGWIN__) -#include "cpio_windows.h" -#endif - #endif /* !CPIO_PLATFORM_H_INCLUDED */ Modified: stable/10/contrib/libarchive/cpio/test/main.c ============================================================================== --- stable/10/contrib/libarchive/cpio/test/main.c Fri Jun 17 19:41:30 2016 (r302000) +++ stable/10/contrib/libarchive/cpio/test/main.c Fri Jun 17 22:40:10 2016 (r302001) @@ -130,6 +130,16 @@ __FBSDID("$FreeBSD$"); # include #endif +/* Path to working directory for current test */ +const char *testworkdir; +#ifdef PROGRAM +/* Pathname of exe to be tested. */ +const char *testprogfile; +/* Name of exe to use in printf-formatted command strings. */ +/* On Windows, this includes leading/trailing quotes. */ +const char *testprog; +#endif + #if defined(_WIN32) && !defined(__CYGWIN__) static void *GetFunctionKernel32(const char *); static int my_CreateSymbolicLinkA(const char *, const char *, int); @@ -194,7 +204,7 @@ my_GetFileInformationByName(const char * } #endif -#if defined(HAVE__CrtSetReportMode) +#if defined(HAVE__CrtSetReportMode) && !defined(__WATCOMC__) static void invalid_parameter_handler(const wchar_t * expression, const wchar_t * function, const wchar_t * file, @@ -565,10 +575,10 @@ static void strdump(const char *e, const while (*p != '\0') { unsigned int c = 0xff & *p++; switch (c) { - case '\a': printf("\a"); break; - case '\b': printf("\b"); break; - case '\n': printf("\n"); break; - case '\r': printf("\r"); break; + case '\a': logprintf("\\a"); break; + case '\b': logprintf("\\b"); break; + case '\n': logprintf("\\n"); break; + case '\r': logprintf("\\r"); break; default: if (c >= 32 && c < 127) logprintf("%c", c); @@ -771,6 +781,34 @@ assertion_equal_mem(const char *file, in return (0); } +/* Verify that a block of memory is filled with the specified byte. */ +int +assertion_memory_filled_with(const char *file, int line, + const void *_v1, const char *vd, + size_t l, const char *ld, + char b, const char *bd, void *extra) +{ + const char *v1 = (const char *)_v1; + size_t c = 0; + size_t i; + (void)ld; /* UNUSED */ + + assertion_count(file, line); + + for (i = 0; i < l; ++i) { + if (v1[i] == b) { + ++c; + } + } + if (c == l) + return (1); + + failure_start(file, line, "%s (size %d) not filled with %s", vd, (int)l, bd); + logprintf(" Only %d bytes were correct\n", (int)c); + failure_finish(extra); + return (0); +} + /* Verify that the named file exists and is empty. */ int assertion_empty_file(const char *filename, int line, const char *f1) @@ -1036,6 +1074,7 @@ assertion_file_contains_lines_any_order( if (expected == NULL) { failure_start(pathname, line, "Can't allocate memory"); failure_finish(NULL); + free(expected); return (0); } for (i = 0; lines[i] != NULL; ++i) { @@ -1060,7 +1099,8 @@ assertion_file_contains_lines_any_order( free(expected); return (0); } - for (j = 0, p = buff; p < buff + buff_size; p += 1 + strlen(p)) { + for (j = 0, p = buff; p < buff + buff_size; + p += 1 + strlen(p)) { if (*p != '\0') { actual[j] = p; ++j; @@ -1912,6 +1952,18 @@ canGzip(void) * Can this platform run the lrzip program? */ int +canRunCommand(const char *cmd) +{ + static int tested = 0, value = 0; + if (!tested) { + tested = 1; + if (systemf("%s %s", cmd, redirectArgs) == 0) + value = 1; + } + return (value); +} + +int canLrzip(void) { static int tested = 0, value = 0; @@ -1924,6 +1976,21 @@ canLrzip(void) } /* + * Can this platform run the lz4 program? + */ +int +canLz4(void) +{ + static int tested = 0, value = 0; + if (!tested) { + tested = 1; + if (systemf("lz4 -V %s", redirectArgs) == 0) + value = 1; + } + return (value); +} + +/* * Can this platform run the lzip program? */ int @@ -2135,8 +2202,31 @@ slurpfile(size_t * sizep, const char *fm return (p); } +/* + * Slurp a file into memory for ease of comparison and testing. + * Returns size of file in 'sizep' if non-NULL, null-terminates + * data in memory for ease of use. + */ +void +dumpfile(const char *filename, void *data, size_t len) +{ + ssize_t bytes_written; + FILE *f; + + f = fopen(filename, "wb"); + if (f == NULL) { + logprintf("Can't open file %s for writing\n", filename); + return; + } + bytes_written = fwrite(data, 1, len, f); + if (bytes_written < (ssize_t)len) + logprintf("Can't write file %s\n", filename); + fclose(f); +} + /* Read a uuencoded file from the reference directory, decode, and * write the result into the current directory. */ +#define VALID_UUDECODE(c) (c >= 32 && c <= 96) #define UUDECODE(c) (((c) - 0x20) & 0x3f) void extract_reference_file(const char *name) @@ -2160,7 +2250,6 @@ extract_reference_file(const char *name) break; } /* Now, decode the rest and write it. */ - /* Not a lot of error checking here; the input better be right. */ out = fopen(name, "wb"); while (fgets(buff, sizeof(buff), in) != NULL) { char *p = buff; @@ -2174,17 +2263,21 @@ extract_reference_file(const char *name) int n = 0; /* Write out 1-3 bytes from that. */ if (bytes > 0) { + assert(VALID_UUDECODE(p[0])); + assert(VALID_UUDECODE(p[1])); n = UUDECODE(*p++) << 18; n |= UUDECODE(*p++) << 12; fputc(n >> 16, out); --bytes; } if (bytes > 0) { + assert(VALID_UUDECODE(p[0])); n |= UUDECODE(*p++) << 6; fputc((n >> 8) & 0xFF, out); --bytes; } if (bytes > 0) { + assert(VALID_UUDECODE(p[0])); n |= UUDECODE(*p++); fputc(n & 0xFF, out); --bytes; @@ -2195,6 +2288,32 @@ extract_reference_file(const char *name) fclose(in); } +void +copy_reference_file(const char *name) +{ + char buff[1024]; + FILE *in, *out; + size_t rbytes; + + sprintf(buff, "%s/%s", refdir, name); + in = fopen(buff, "rb"); + failure("Couldn't open reference file %s", buff); + assert(in != NULL); + if (in == NULL) + return; + /* Now, decode the rest and write it. */ + /* Not a lot of error checking here; the input better be right. */ + out = fopen(name, "wb"); + while ((rbytes = fread(buff, 1, sizeof(buff), in)) > 0) { + if (fwrite(buff, 1, rbytes, out) != rbytes) { + logprintf("Error: fwrite\n"); + break; + } + } + fclose(out); + fclose(in); +} + int is_LargeInode(const char *file) { @@ -2216,6 +2335,14 @@ is_LargeInode(const char *file) return (ino > 0xffffffff); #endif } + +void +extract_reference_files(const char **names) +{ + while (names && *names) + extract_reference_file(*names++); +} + /* * * TEST management @@ -2245,7 +2372,7 @@ struct test_list_t tests[] = { * Summarize repeated failures in the just-completed test. */ static void -test_summarize(int failed) +test_summarize(int failed, int skips_num) { unsigned int i; @@ -2255,7 +2382,7 @@ test_summarize(int failed) fflush(stdout); break; case VERBOSITY_PASSFAIL: - printf(failed ? "FAIL\n" : "ok\n"); + printf(failed ? "FAIL\n" : skips_num ? "ok (S)\n" : "ok\n"); break; } @@ -2280,13 +2407,14 @@ test_run(int i, const char *tmpdir) char workdir[1024]; char logfilename[64]; int failures_before = failures; + int skips_before = skips; int oldumask; switch (verbosity) { case VERBOSITY_SUMMARY_ONLY: /* No per-test reports at all */ break; case VERBOSITY_PASSFAIL: /* rest of line will include ok/FAIL marker */ - printf("%3d: %-50s", i, tests[i].name); + printf("%3d: %-64s", i, tests[i].name); fflush(stdout); break; default: /* Title of test, details will follow */ @@ -2336,7 +2464,7 @@ test_run(int i, const char *tmpdir) } /* Report per-test summaries. */ tests[i].failures = failures - failures_before; - test_summarize(tests[i].failures); + test_summarize(tests[i].failures, skips - skips_before); /* Close the per-test log file. */ fclose(logfile); logfile = NULL; @@ -2479,6 +2607,7 @@ get_refdir(const char *d) failure: printf("Unable to locate known reference file %s\n", KNOWNREF); printf(" Checked following directories:\n%s\n", tried); + printf("Use -r option to specify full path to reference directory\n"); #if defined(_WIN32) && !defined(__CYGWIN__) && defined(_DEBUG) DebugBreak(); #endif @@ -2515,7 +2644,7 @@ main(int argc, char **argv) while (pwd[strlen(pwd) - 1] == '\n') pwd[strlen(pwd) - 1] = '\0'; -#if defined(HAVE__CrtSetReportMode) +#if defined(HAVE__CrtSetReportMode) && !defined(__WATCOMC__) /* To stop to run the default invalid parameter handler. */ _set_invalid_parameter_handler(invalid_parameter_handler); /* Disable annoying assertion message box. */ @@ -2562,7 +2691,7 @@ main(int argc, char **argv) exit(1); } memmove(testprogdir + strlen(pwd) + 1, testprogdir, - strlen(testprogdir)); + strlen(testprogdir) + 1); memcpy(testprogdir, pwd, strlen(pwd)); testprogdir[strlen(pwd)] = '/'; } Modified: stable/10/contrib/libarchive/cpio/test/test.h ============================================================================== --- stable/10/contrib/libarchive/cpio/test/test.h Fri Jun 17 19:41:30 2016 (r302000) +++ stable/10/contrib/libarchive/cpio/test/test.h Fri Jun 17 22:40:10 2016 (r302001) @@ -66,6 +66,7 @@ #include #include #include +#include #include #ifdef HAVE_UNISTD_H #include @@ -84,12 +85,14 @@ /* Windows (including Visual Studio and MinGW but not Cygwin) */ #if defined(_WIN32) && !defined(__CYGWIN__) #if !defined(__BORLANDC__) +#undef chdir +#define chdir _chdir #define strdup _strdup #endif #endif /* Visual Studio */ -#ifdef _MSC_VER +#if defined(_MSC_VER) && _MSC_VER < 1900 #define snprintf sprintf_s #endif @@ -142,6 +145,9 @@ /* As above, but raw blocks of bytes. */ #define assertEqualMem(v1, v2, l) \ assertion_equal_mem(__FILE__, __LINE__, (v1), #v1, (v2), #v2, (l), #l, NULL) +/* Assert that memory is full of a specified byte */ +#define assertMemoryFilledWith(v1, l, b) \ + assertion_memory_filled_with(__FILE__, __LINE__, (v1), #v1, (l), #l, (b), #b, NULL) /* Assert two files are the same. */ #define assertEqualFile(f1, f2) \ assertion_equal_file(__FILE__, __LINE__, (f1), (f2)) @@ -225,6 +231,7 @@ int assertion_empty_file(const char *, i int assertion_equal_file(const char *, int, const char *, const char *); int assertion_equal_int(const char *, int, long long, const char *, long long, const char *, void *); int assertion_equal_mem(const char *, int, const void *, const char *, const void *, const char *, size_t, const char *, void *); +int assertion_memory_filled_with(const char *, int, const void *, const char *, size_t, const char *, char, const char *, void *); int assertion_equal_string(const char *, int, const char *v1, const char *, const char *v2, const char *, void *, int); int assertion_equal_wstring(const char *, int, const wchar_t *v1, const char *, const wchar_t *v2, const char *, void *); int assertion_file_atime(const char *, int, const char *, long, long); @@ -275,9 +282,15 @@ int canGrzip(void); /* Return true if this platform can run the "gzip" program. */ int canGzip(void); +/* Return true if this platform can run the specified command. */ +int canRunCommand(const char *); + /* Return true if this platform can run the "lrzip" program. */ int canLrzip(void); +/* Return true if this platform can run the "lz4" program. */ +int canLz4(void); + /* Return true if this platform can run the "lzip" program. */ int canLzip(void); @@ -300,21 +313,31 @@ int is_LargeInode(const char *); /* Supports printf-style args: slurpfile(NULL, "%s/myfile", refdir); */ char *slurpfile(size_t *, const char *fmt, ...); +/* Dump block of bytes to a file. */ +void dumpfile(const char *filename, void *, size_t); + /* Extracts named reference file to the current directory. */ void extract_reference_file(const char *); +/* Copies named reference file to the current directory. */ +void copy_reference_file(const char *); + +/* Extracts a list of files to the current directory. + * List must be NULL terminated. + */ +void extract_reference_files(const char **); /* Path to working directory for current test */ -const char *testworkdir; +extern const char *testworkdir; /* * Special interfaces for program test harness. */ /* Pathname of exe to be tested. */ -const char *testprogfile; +extern const char *testprogfile; /* Name of exe to use in printf-formatted command strings. */ /* On Windows, this includes leading/trailing quotes. */ -const char *testprog; +extern const char *testprog; #ifdef USE_DMALLOC #include Modified: stable/10/contrib/libarchive/cpio/test/test_basic.c ============================================================================== --- stable/10/contrib/libarchive/cpio/test/test_basic.c Fri Jun 17 19:41:30 2016 (r302000) +++ stable/10/contrib/libarchive/cpio/test/test_basic.c Fri Jun 17 22:40:10 2016 (r302001) @@ -72,7 +72,7 @@ basic_cpio(const char *target, return; /* Use the cpio program to create an archive. */ - r = systemf("%s -o %s < filelist >%s/archive 2>%s/pack.err", + r = systemf("%s -R 1000:1000 -o %s < filelist >%s/archive 2>%s/pack.err", testprog, pack_options, target, target); failure("Error invoking %s -o %s", testprog, pack_options); assertEqualInt(r, 0); Copied: stable/10/contrib/libarchive/cpio/test/test_extract.cpio.lz4.uu (from r299529, head/contrib/libarchive/cpio/test/test_extract.cpio.lz4.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/libarchive/cpio/test/test_extract.cpio.lz4.uu Fri Jun 17 22:40:10 2016 (r302001, copy of r299529, head/contrib/libarchive/cpio/test/test_extract.cpio.lz4.uu) @@ -0,0 +1,7 @@ +begin 644 test_extract.cpio.lz4 +M!")-&&1PN9$````A,#<"`&`P-#`P,3`!`&`Q,3`P-C8/`#0W-3`&```)``$& +M`,$P,3(P,S(W-#`R,S01`!$V!@```@#Q!3(S9FEL93$`8V]N=&5N=',@;V8@ +M$@`A+@IC``AE`!\R90`4$#2#``YE`!TR90`6,F4`#P(`#@+H``P"`"test.out 2>test.err", testprog, reffile); + if (f == 0 || canLz4()) { + assertEqualInt(0, systemf("%s -i < %s >test.out 2>test.err", + testprog, reffile)); + + assertFileExists("file1"); + assertTextFileContents("contents of file1.\n", "file1"); + assertFileExists("file2"); + assertTextFileContents("contents of file2.\n", "file2"); + assertEmptyFile("test.out"); + assertTextFileContents("1 block\n", "test.err"); + } else { + skipping("It seems lz4 is not supported on this platform"); + } +} Modified: stable/10/contrib/libarchive/cpio/test/test_extract_cpio_lzo.c ============================================================================== --- stable/10/contrib/libarchive/cpio/test/test_extract_cpio_lzo.c Fri Jun 17 19:41:30 2016 (r302000) +++ stable/10/contrib/libarchive/cpio/test/test_extract_cpio_lzo.c Fri Jun 17 22:40:10 2016 (r302001) @@ -27,7 +27,7 @@ __FBSDID("$FreeBSD$"); DEFINE_TEST(test_extract_cpio_lzo) { - const char *reffile = "test_extract.cpio.lrz"; + const char *reffile = "test_extract.cpio.lzo"; int f; extract_reference_file(reffile); Modified: stable/10/contrib/libarchive/cpio/test/test_option_c.c ============================================================================== --- stable/10/contrib/libarchive/cpio/test/test_option_c.c Fri Jun 17 19:41:30 2016 (r302000) +++ stable/10/contrib/libarchive/cpio/test/test_option_c.c Fri Jun 17 22:40:10 2016 (r302001) @@ -65,18 +65,14 @@ DEFINE_TEST(test_option_c) { FILE *filelist; int r; - int uid = -1; - int dev, ino, gid; + int uid = 1000; + int dev, ino, gid = 1000; time_t t, now; char *p, *e; size_t s; assertUmask(0); -#if !defined(_WIN32) - uid = getuid(); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Jun 18 01:23:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4315A77B6B; Sat, 18 Jun 2016 01:23:39 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9554513D7; Sat, 18 Jun 2016 01:23:39 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5I1Nc57090641; Sat, 18 Jun 2016 01:23:38 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5I1Ncur090640; Sat, 18 Jun 2016 01:23:38 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201606180123.u5I1Ncur090640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 18 Jun 2016 01:23:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r302002 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2016 01:23:39 -0000 Author: emaste Date: Sat Jun 18 01:23:38 2016 New Revision: 302002 URL: https://svnweb.freebsd.org/changeset/base/302002 Log: MFC r300231: elf_common.h: add section header flag and dynamic types SHF_COMPRESSED section contains compressed data DT_TLSDESC_PLT Location of PLT entry for TLS descriptor resolver calls DT_TLSDESC_GOT Location of GOT entry used by resolver PLT entry Modified: stable/10/sys/sys/elf_common.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/elf_common.h ============================================================================== --- stable/10/sys/sys/elf_common.h Fri Jun 17 22:40:10 2016 (r302001) +++ stable/10/sys/sys/elf_common.h Sat Jun 18 01:23:38 2016 (r302002) @@ -472,6 +472,7 @@ typedef struct { #define SHF_OS_NONCONFORMING 0x100 /* OS-specific processing required. */ #define SHF_GROUP 0x200 /* Member of section group. */ #define SHF_TLS 0x400 /* Section contains TLS data. */ +#define SHF_COMPRESSED 0x800 /* Section contains compressed data. */ #define SHF_MASKOS 0x0ff00000 /* OS-specific semantics. */ #define SHF_MASKPROC 0xf0000000 /* Processor-specific semantics. */ @@ -607,6 +608,8 @@ typedef struct { */ #define DT_ADDRRNGLO 0x6ffffe00 #define DT_GNU_HASH 0x6ffffef5 /* GNU-style hash table */ +#define DT_TLSDESC_PLT 0x6ffffef6 /* loc. of PLT for tlsdesc resolver */ +#define DT_TLSDESC_GOT 0x6ffffef7 /* loc. of GOT for tlsdesc resolver */ #define DT_GNU_CONFLICT 0x6ffffef8 /* address of conflict section */ #define DT_GNU_LIBLIST 0x6ffffef9 /* address of library list */ #define DT_CONFIG 0x6ffffefa /* configuration information */ From owner-svn-src-all@freebsd.org Sat Jun 18 02:28:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDC06A78CF6; Sat, 18 Jun 2016 02:28:52 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-yw0-x235.google.com (mail-yw0-x235.google.com [IPv6:2607:f8b0:4002:c05::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 757A71F3B; Sat, 18 Jun 2016 02:28:52 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-yw0-x235.google.com with SMTP id z186so86819690ywd.2; Fri, 17 Jun 2016 19:28:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc; bh=Mi7cnszI1OOGMPVZhpDh5XS4NFGJxBrcnz/1mU5+G3Q=; b=l2hF1ZPpLfG9wJFCnKK4a+lRoPwMzAugIPuSKD3N3yH/orExMG1IwMGi4VHYvlpCUh WqLi8aZit0jDtQFMKYJUDl8gd2hDu0qcbmdUt0VyoT5+fJSEdv797ZpalJ6T1w645q6O u7MLoSge/oBbuBpf/LRZ/0LlgFAqi/YdKNkDzRlJINELqnPqREEuISUyjrSidlbZRjM4 iYCWw6vtZYWCcMhrGgUPcYEzAdCqfMjIIYWqdQGRNFlVTZEvI3VTXzta6bDW4SiO0FI0 d/BNxO3VuRv1YAnJq78NizBtNJD9T0aQ8AR055v5o4BVHRsLxjs4AM8J3LZBu9FKaoOf 9KJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc; bh=Mi7cnszI1OOGMPVZhpDh5XS4NFGJxBrcnz/1mU5+G3Q=; b=B3pmu5Lx2olmyCocK9OkyzTKWYb1jMwhcGNVKKE6fUQKOdxiDBIGfNqfqFnUut3JR5 8Tg4w7uPuhD+mz2PkqQ7paubakP3cN9Sne2bR/ENn119W4Ug3kLNzniwkCQ+uX5n32qf 3Vp8rWBki/8RqrhnciB2owk13ug02Hgo1sZfQ6yLa87NMR3Ki6yBk9hYt8bxFO1WbkFx Awxrxm+iWCS8pg+7hK3yw8RJgbg2KKYUZDcsw4NdjDeBRYgNC5aYGSB1qcZ8w3xKAqQu U0327jVRCDsmSwDonp6FdILNd/Or8QiRn1GYP6xkYWiH5folUO/A5jqLv+HYuSHviqLW aIZg== X-Gm-Message-State: ALyK8tLZFj2WQGilKaxLZQOlJ1+o3MbqZ4f3k+FHxASJlvy8RVsWCwQXAGTDuWDvwCKvkB84u+TQh7lDB8U8Tw== MIME-Version: 1.0 X-Received: by 10.37.98.141 with SMTP id w135mr2887985ybb.9.1466216931374; Fri, 17 Jun 2016 19:28:51 -0700 (PDT) Received: by 10.129.10.212 with HTTP; Fri, 17 Jun 2016 19:28:51 -0700 (PDT) Received: by 10.129.10.212 with HTTP; Fri, 17 Jun 2016 19:28:51 -0700 (PDT) Reply-To: araujo@FreeBSD.org In-Reply-To: <201606171821.u5HILudm021649@repo.freebsd.org> References: <201606171821.u5HILudm021649@repo.freebsd.org> Date: Sat, 18 Jun 2016 10:28:51 +0800 Message-ID: Subject: Re: svn commit: r301998 - in head: sbin/pfctl share/man/man5 sys/net sys/netpfil/pf From: Marcelo Araujo To: Kristof Provost Cc: svn-src-head@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2016 02:28:52 -0000 Thanks to work on it Kristof! On Jun 18, 2016 2:22 AM, "Kristof Provost" wrote: > Author: kp > Date: Fri Jun 17 18:21:55 2016 > New Revision: 301998 > URL: https://svnweb.freebsd.org/changeset/base/301998 > > Log: > pf: Filter on and set vlan PCP values > > Adopt the OpenBSD syntax for setting and filtering on VLAN PCP values. > This > introduces two new keywords: 'set prio' to set the PCP value, and 'prio' > to > filter on it. > > Reviewed by: allanjude, araujo > Approved by: re (gjb) > Obtained from: OpenBSD (mostly) > Differential Revision: https://reviews.freebsd.org/D6786 > > Modified: > head/sbin/pfctl/parse.y > head/sbin/pfctl/pfctl_parser.c > head/share/man/man5/pf.conf.5 > head/sys/net/pfvar.h > head/sys/netpfil/pf/pf.c > head/sys/netpfil/pf/pf_ioctl.c > > Modified: head/sbin/pfctl/parse.y > > ============================================================================== > --- head/sbin/pfctl/parse.y Fri Jun 17 17:34:28 2016 (r301997) > +++ head/sbin/pfctl/parse.y Fri Jun 17 18:21:55 2016 (r301998) > @@ -217,6 +217,8 @@ struct filter_opts { > #define FOM_TOS 0x04 > #define FOM_KEEP 0x08 > #define FOM_SRCTRACK 0x10 > +#define FOM_SETPRIO 0x0400 > +#define FOM_PRIO 0x2000 > struct node_uid *uid; > struct node_gid *gid; > struct { > @@ -240,6 +242,8 @@ struct filter_opts { > char *match_tag; > u_int8_t match_tag_not; > u_int rtableid; > + u_int8_t prio; > + u_int8_t set_prio[2]; > struct { > struct node_host *addr; > u_int16_t port; > @@ -453,7 +457,7 @@ int parseport(char *, struct range *r, i > %token BITMASK RANDOM SOURCEHASH ROUNDROBIN STATICPORT PROBABILITY > %token ALTQ CBQ CODEL PRIQ HFSC FAIRQ BANDWIDTH TBRSIZE LINKSHARE REALTIME > %token UPPERLIMIT QUEUE PRIORITY QLIMIT HOGS BUCKETS RTABLE TARGET > INTERVAL > -%token LOAD RULESET_OPTIMIZATION > +%token LOAD RULESET_OPTIMIZATION PRIO > %token STICKYADDRESS MAXSRCSTATES MAXSRCNODES SOURCETRACK GLOBAL RULE > %token MAXSRCCONN MAXSRCCONNRATE OVERLOAD FLUSH SLOPPY > %token TAGGED TAG IFBOUND FLOATING STATEPOLICY STATEDEFAULTS ROUTE SETTOS > @@ -468,7 +472,7 @@ int parseport(char *, struct range *r, i > %type no dir af fragcache optimizer > %type sourcetrack flush unaryop statelock > %type action nataction natpasslog scrubaction > -%type flags flag blockspec > +%type flags flag blockspec prio > %type portplain portstar portrange > %type hashkey > %type proto proto_list proto_item > @@ -504,6 +508,7 @@ int parseport(char *, struct range *r, i > %type codelopts_list codelopts_item codel_opts > %type bandwidth > %type filter_opts filter_opt filter_opts_l > +%type filter_sets filter_set filter_sets_l > %type antispoof_opts antispoof_opt > antispoof_opts_l > %type queue_opts queue_opt queue_opts_l > %type scrub_opts scrub_opt scrub_opts_l > @@ -889,6 +894,17 @@ anchorrule : ANCHOR anchorname dir quick > YYERROR; > } > r.match_tag_not = $9.match_tag_not; > + if ($9.marker & FOM_PRIO) { > + if ($9.prio == 0) > + r.prio = PF_PRIO_ZERO; > + else > + r.prio = $9.prio; > + } > + if ($9.marker & FOM_SETPRIO) { > + r.set_prio[0] = $9.set_prio[0]; > + r.set_prio[1] = $9.set_prio[1]; > + r.scrub_flags |= PFSTATE_SETPRIO; > + } > > decide_address_family($8.src.host, &r.af); > decide_address_family($8.dst.host, &r.af); > @@ -2014,6 +2030,18 @@ pfrule : action dir logquick interface > r.prob = $9.prob; > r.rtableid = $9.rtableid; > > + if ($9.marker & FOM_PRIO) { > + if ($9.prio == 0) > + r.prio = PF_PRIO_ZERO; > + else > + r.prio = $9.prio; > + } > + if ($9.marker & FOM_SETPRIO) { > + r.set_prio[0] = $9.set_prio[0]; > + r.set_prio[1] = $9.set_prio[1]; > + r.scrub_flags |= PFSTATE_SETPRIO; > + } > + > r.af = $6; > if ($9.tag) > if (strlcpy(r.tagname, $9.tag, > @@ -2434,6 +2462,18 @@ filter_opt : USER uids { > filter_opts.marker |= FOM_ICMP; > filter_opts.icmpspec = $1; > } > + | PRIO NUMBER { > + if (filter_opts.marker & FOM_PRIO) { > + yyerror("prio cannot be redefined"); > + YYERROR; > + } > + if ($2 < 0 || $2 > PF_PRIO_MAX) { > + yyerror("prio must be 0 - %u", > PF_PRIO_MAX); > + YYERROR; > + } > + filter_opts.marker |= FOM_PRIO; > + filter_opts.prio = $2; > + } > | TOS tos { > if (filter_opts.marker & FOM_TOS) { > yyerror("tos cannot be redefined"); > @@ -2532,6 +2572,42 @@ filter_opt : USER uids { > filter_opts.divert.port = 1; /* some random > value */ > #endif > } > + | filter_sets > + ; > + > +filter_sets : SET '(' filter_sets_l ')' { $$ = filter_opts; } > + | SET filter_set { $$ = filter_opts; } > + ; > + > +filter_sets_l : filter_sets_l comma filter_set > + | filter_set > + ; > + > +filter_set : prio { > + if (filter_opts.marker & FOM_SETPRIO) { > + yyerror("prio cannot be redefined"); > + YYERROR; > + } > + filter_opts.marker |= FOM_SETPRIO; > + filter_opts.set_prio[0] = $1.b1; > + filter_opts.set_prio[1] = $1.b2; > + } > +prio : PRIO NUMBER { > + if ($2 < 0 || $2 > PF_PRIO_MAX) { > + yyerror("prio must be 0 - %u", > PF_PRIO_MAX); > + YYERROR; > + } > + $$.b1 = $$.b2 = $2; > + } > + | PRIO '(' NUMBER comma NUMBER ')' { > + if ($3 < 0 || $3 > PF_PRIO_MAX || > + $5 < 0 || $5 > PF_PRIO_MAX) { > + yyerror("prio must be 0 - %u", > PF_PRIO_MAX); > + YYERROR; > + } > + $$.b1 = $3; > + $$.b2 = $5; > + } > ; > > probability : STRING { > @@ -5426,6 +5502,7 @@ lookup(char *s) > { "overload", OVERLOAD}, > { "pass", PASS}, > { "port", PORT}, > + { "prio", PRIO}, > { "priority", PRIORITY}, > { "priq", PRIQ}, > { "probability", PROBABILITY}, > > Modified: head/sbin/pfctl/pfctl_parser.c > > ============================================================================== > --- head/sbin/pfctl/pfctl_parser.c Fri Jun 17 17:34:28 2016 > (r301997) > +++ head/sbin/pfctl/pfctl_parser.c Fri Jun 17 18:21:55 2016 > (r301998) > @@ -841,6 +841,21 @@ print_rule(struct pf_rule *r, const char > } > if (r->tos) > printf(" tos 0x%2.2x", r->tos); > + if (r->prio) > + printf(" prio %u", r->prio == PF_PRIO_ZERO ? 0 : r->prio); > + if (r->scrub_flags & PFSTATE_SETMASK) { > + char *comma = ""; > + printf(" set ("); > + if (r->scrub_flags & PFSTATE_SETPRIO) { > + if (r->set_prio[0] == r->set_prio[1]) > + printf("%s prio %u", comma, > r->set_prio[0]); > + else > + printf("%s prio(%u, %u)", comma, > r->set_prio[0], > + r->set_prio[1]); > + comma = ","; > + } > + printf(" )"); > + } > if (!r->keep_state && r->action == PF_PASS && !anchor_call[0]) > printf(" no state"); > else if (r->keep_state == PF_STATE_NORMAL) > > Modified: head/share/man/man5/pf.conf.5 > > ============================================================================== > --- head/share/man/man5/pf.conf.5 Fri Jun 17 17:34:28 2016 > (r301997) > +++ head/share/man/man5/pf.conf.5 Fri Jun 17 18:21:55 2016 > (r301998) > @@ -28,7 +28,7 @@ > .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE > .\" POSSIBILITY OF SUCH DAMAGE. > .\" > -.Dd July 25, 2015 > +.Dd June 9, 2016 > .Dt PF.CONF 5 > .Os > .Sh NAME > @@ -1785,6 +1785,25 @@ For example: > pass in proto tcp to port 25 queue mail > pass in proto tcp to port 22 queue(ssh_bulk, ssh_prio) > .Ed > +.Pp > +.It Cm set prio Ar priority | Pq Ar priority , priority > +Packets matching this rule will be assigned a specific queueing priority. > +Priorities are assigned as integers 0 through 7. > +If the packet is transmitted on a > +.Xr vlan 4 > +interface, the queueing priority will be written as the priority > +code point in the 802.1Q VLAN header. > +If two priorities are given, packets which have a TOS of > +.Cm lowdelay > +and TCP ACKs with no data payload will be assigned to the second one. > +.Pp > +For example: > +.Bd -literal -offset indent > +pass in proto tcp to port 25 set prio 2 > +pass in proto tcp to port 22 set prio (2, 5) > +.Ed > +.Pp > + > .It Ar tag Aq Ar string > Packets matching this rule will be tagged with the > specified string. > @@ -1845,6 +1864,9 @@ For example, the following rule will dro > .Bd -literal -offset indent > block in proto icmp probability 20% > .Ed > +.It Ar prio Aq Ar number > +Only match packets which have the given queueing priority assigned. > +.Pp > .El > .Sh ROUTING > If a packet matches a rule with a route option set, the packet filter will > @@ -2831,8 +2853,9 @@ filteropt = user | group | flags | > "max-mss" number | "random-id" | "reassemble tcp" | > fragmentation | "allow-opts" | > "label" string | "tag" string | [ ! ] "tagged" string | > + "set prio" ( number | "(" number [ [ "," ] number ] ")" > ) | > "queue" ( string | "(" string [ [ "," ] string ] ")" ) | > - "rtable" number | "probability" number"%" > + "rtable" number | "probability" number"%" | "prio" number > > nat-rule = [ "no" ] "nat" [ "pass" [ "log" [ "(" logopts ")" ] ] ] > [ "on" ifspec ] [ af ] > > Modified: head/sys/net/pfvar.h > > ============================================================================== > --- head/sys/net/pfvar.h Fri Jun 17 17:34:28 2016 (r301997) > +++ head/sys/net/pfvar.h Fri Jun 17 18:21:55 2016 (r301998) > @@ -540,7 +540,7 @@ struct pf_rule { > u_int16_t max_mss; > u_int16_t tag; > u_int16_t match_tag; > - u_int16_t spare2; /* > netgraph */ > + u_int16_t scrub_flags; > > struct pf_rule_uid uid; > struct pf_rule_gid gid; > @@ -577,6 +577,10 @@ struct pf_rule { > #define PF_FLUSH 0x01 > #define PF_FLUSH_GLOBAL 0x02 > u_int8_t flush; > +#define PF_PRIO_ZERO 0xff /* match "prio 0" packets > */ > +#define PF_PRIO_MAX 7 > + u_int8_t prio; > + u_int8_t set_prio[2]; > > struct { > struct pf_addr addr; > @@ -739,6 +743,8 @@ struct pf_state { > /* was PFSTATE_PFLOW 0x04 */ > #define PFSTATE_NOSYNC 0x08 > #define PFSTATE_ACK 0x10 > +#define PFSTATE_SETPRIO 0x0200 > +#define PFSTATE_SETMASK (PFSTATE_SETPRIO) > u_int8_t timeout; > u_int8_t sync_state; /* PFSYNC_S_x */ > > > Modified: head/sys/netpfil/pf/pf.c > > ============================================================================== > --- head/sys/netpfil/pf/pf.c Fri Jun 17 17:34:28 2016 (r301997) > +++ head/sys/netpfil/pf/pf.c Fri Jun 17 18:21:55 2016 (r301998) > @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -2445,6 +2446,45 @@ pf_send_tcp(struct mbuf *replyto, const > pf_send(pfse); > } > > +static int > +pf_ieee8021q_setpcp(struct mbuf *m, u_int8_t prio) > +{ > + struct m_tag *mtag; > + > + KASSERT(prio <= PF_PRIO_MAX, > + ("%s with invalid pcp", __func__)); > + > + mtag = m_tag_locate(m, MTAG_8021Q, MTAG_8021Q_PCP_OUT, NULL); > + if (mtag == NULL) { > + mtag = m_tag_alloc(MTAG_8021Q, MTAG_8021Q_PCP_OUT, > + sizeof(uint8_t), M_NOWAIT); > + if (mtag == NULL) > + return (ENOMEM); > + m_tag_prepend(m, mtag); > + } > + > + *(uint8_t *)(mtag + 1) = prio; > + return (0); > +} > + > +static int > +pf_match_ieee8021q_pcp(u_int8_t prio, struct mbuf *m) > +{ > + struct m_tag *mtag; > + u_int8_t mpcp; > + > + mtag = m_tag_locate(m, MTAG_8021Q, MTAG_8021Q_PCP_IN, NULL); > + if (mtag == NULL) > + return (0); > + > + if (prio == PF_PRIO_ZERO) > + prio = 0; > + > + mpcp = *(uint8_t *)(mtag + 1); > + > + return (mpcp == prio); > +} > + > static void > pf_send_icmp(struct mbuf *m, u_int8_t type, u_int8_t code, sa_family_t af, > struct pf_rule *r) > @@ -3317,6 +3357,9 @@ pf_test_rule(struct pf_rule **rm, struct > !pf_match_gid(r->gid.op, r->gid.gid[0], r->gid.gid[1], > pd->lookup.gid)) > r = TAILQ_NEXT(r, entries); > + else if (r->prio && > + !pf_match_ieee8021q_pcp(r->prio, m)) > + r = TAILQ_NEXT(r, entries); > else if (r->prob && > r->prob <= arc4random()) > r = TAILQ_NEXT(r, entries); > @@ -3779,6 +3822,9 @@ pf_test_fragment(struct pf_rule **rm, in > pd->proto == IPPROTO_ICMPV6) && > (r->type || r->code)) > r = TAILQ_NEXT(r, entries); > + else if (r->prio && > + !pf_match_ieee8021q_pcp(r->prio, m)) > + r = TAILQ_NEXT(r, entries); > else if (r->prob && r->prob <= > (arc4random() % (UINT_MAX - 1) + 1)) > r = TAILQ_NEXT(r, entries); > @@ -6003,6 +6049,18 @@ done: > if (r->rtableid >= 0) > M_SETFIB(m, r->rtableid); > > + if (r->scrub_flags & PFSTATE_SETPRIO) { > + if (pd.tos & IPTOS_LOWDELAY) > + pqid = 1; > + if (pf_ieee8021q_setpcp(m, r->set_prio[pqid])) { > + action = PF_DROP; > + REASON_SET(&reason, PFRES_MEMORY); > + log = 1; > + DPFPRINTF(PF_DEBUG_MISC, > + ("pf: failed to allocate 802.1q mtag\n")); > + } > + } > + > #ifdef ALTQ > if (action == PF_PASS && r->qid) { > if (pd.pf_mtag == NULL && > @@ -6176,7 +6234,7 @@ pf_test6(int dir, struct ifnet *ifp, str > struct pf_state *s = NULL; > struct pf_ruleset *ruleset = NULL; > struct pf_pdesc pd; > - int off, terminal = 0, dirndx, rh_cnt = 0; > + int off, terminal = 0, dirndx, rh_cnt = 0, > pqid = 0; > int fwdir = dir; > > M_ASSERTPKTHDR(m); > @@ -6449,6 +6507,18 @@ done: > if (r->rtableid >= 0) > M_SETFIB(m, r->rtableid); > > + if (r->scrub_flags & PFSTATE_SETPRIO) { > + if (pd.tos & IPTOS_LOWDELAY) > + pqid = 1; > + if (pf_ieee8021q_setpcp(m, r->set_prio[pqid])) { > + action = PF_DROP; > + REASON_SET(&reason, PFRES_MEMORY); > + log = 1; > + DPFPRINTF(PF_DEBUG_MISC, > + ("pf: failed to allocate 802.1q mtag\n")); > + } > + } > + > #ifdef ALTQ > if (action == PF_PASS && r->qid) { > if (pd.pf_mtag == NULL && > > Modified: head/sys/netpfil/pf/pf_ioctl.c > > ============================================================================== > --- head/sys/netpfil/pf/pf_ioctl.c Fri Jun 17 17:34:28 2016 > (r301997) > +++ head/sys/netpfil/pf/pf_ioctl.c Fri Jun 17 18:21:55 2016 > (r301998) > @@ -1242,6 +1242,10 @@ pfioctl(struct cdev *dev, u_long cmd, ca > error = ENOMEM; > if (pf_anchor_setup(rule, ruleset, pr->anchor_call)) > error = EINVAL; > + if (rule->scrub_flags & PFSTATE_SETPRIO && > + (rule->set_prio[0] > PF_PRIO_MAX || > + rule->set_prio[1] > PF_PRIO_MAX)) > + error = EINVAL; > TAILQ_FOREACH(pa, &V_pf_pabuf, entries) > if (pa->addr.type == PF_ADDR_TABLE) { > pa->addr.p.tbl = pfr_attach_table(ruleset, > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-all@freebsd.org Sat Jun 18 08:25:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 476A5A799CB; Sat, 18 Jun 2016 08:25:35 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11DAA1527; Sat, 18 Jun 2016 08:25:35 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5I8PY0N047616; Sat, 18 Jun 2016 08:25:34 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5I8PWHo047593; Sat, 18 Jun 2016 08:25:32 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201606180825.u5I8PWHo047593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Sat, 18 Jun 2016 08:25:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r302003 - in vendor/libarchive/dist: . cat/test cpio/test libarchive libarchive/test tar tar/test X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2016 08:25:35 -0000 Author: mm Date: Sat Jun 18 08:25:31 2016 New Revision: 302003 URL: https://svnweb.freebsd.org/changeset/base/302003 Log: Update vendor/libarchive to git d85976e7ff4a062e1de6e04dab7bb78e3344768f Fixed vendor issues: Issue 553: Fix broken decryption for ZIP files Issue 657: Allow up to 8k for the test root directory name Issue 682: Correctly write gnutar filenames of exactly 512 bytes Issue 708: tar should fail if a named input file is missing PR 715: Fix libarchive/archive_read_support_format_mtree.c:1388:11: error: array subscript is above array bounds Added: vendor/libarchive/dist/cpio/test/test_missing_file.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_write_format_gnutar_filenames.c (contents, props changed) vendor/libarchive/dist/tar/test/test_missing_file.c (contents, props changed) Modified: vendor/libarchive/dist/Makefile.am vendor/libarchive/dist/cat/test/main.c vendor/libarchive/dist/configure.ac vendor/libarchive/dist/cpio/test/CMakeLists.txt vendor/libarchive/dist/cpio/test/main.c vendor/libarchive/dist/libarchive/archive_entry_xattr.c vendor/libarchive/dist/libarchive/archive_read_support_format_mtree.c vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c vendor/libarchive/dist/libarchive/archive_write_disk_windows.c vendor/libarchive/dist/libarchive/archive_write_filter.3 vendor/libarchive/dist/libarchive/archive_write_set_format_gnutar.c vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c vendor/libarchive/dist/libarchive/archive_write_set_options.3 vendor/libarchive/dist/libarchive/libarchive-formats.5 vendor/libarchive/dist/libarchive/libarchive_changes.3 vendor/libarchive/dist/libarchive/test/CMakeLists.txt vendor/libarchive/dist/libarchive/test/main.c vendor/libarchive/dist/tar/test/CMakeLists.txt vendor/libarchive/dist/tar/test/main.c vendor/libarchive/dist/tar/write.c Modified: vendor/libarchive/dist/Makefile.am ============================================================================== --- vendor/libarchive/dist/Makefile.am Sat Jun 18 01:23:38 2016 (r302002) +++ vendor/libarchive/dist/Makefile.am Sat Jun 18 08:25:31 2016 (r302003) @@ -533,6 +533,7 @@ libarchive_test_SOURCES= \ libarchive/test/test_write_format_cpio_newc.c \ libarchive/test/test_write_format_cpio_odc.c \ libarchive/test/test_write_format_gnutar.c \ + libarchive/test/test_write_format_gnutar_filenames.c \ libarchive/test/test_write_format_iso9660.c \ libarchive/test/test_write_format_iso9660_boot.c \ libarchive/test/test_write_format_iso9660_empty.c \ @@ -909,6 +910,7 @@ bsdtar_test_SOURCES= \ tar/test/test_format_newc.c \ tar/test/test_help.c \ tar/test/test_leading_slash.c \ + tar/test/test_missing_file.c \ tar/test/test_option_C_upper.c \ tar/test/test_option_H_upper.c \ tar/test/test_option_L_upper.c \ @@ -1064,6 +1066,7 @@ bsdcpio_test_SOURCES= \ cpio/test/test_extract_cpio_xz.c \ cpio/test/test_format_newc.c \ cpio/test/test_gcpio_compat.c \ + cpio/test/test_missing_file.c \ cpio/test/test_option_0.c \ cpio/test/test_option_B_upper.c \ cpio/test/test_option_C_upper.c \ Modified: vendor/libarchive/dist/cat/test/main.c ============================================================================== --- vendor/libarchive/dist/cat/test/main.c Sat Jun 18 01:23:38 2016 (r302002) +++ vendor/libarchive/dist/cat/test/main.c Sat Jun 18 08:25:31 2016 (r302003) @@ -2534,18 +2534,36 @@ usage(const char *program) static char * get_refdir(const char *d) { - char tried[512] = { '\0' }; - char buff[128]; - char *pwd, *p; + size_t tried_size, buff_size; + char *buff, *tried, *pwd = NULL, *p = NULL; + +#ifdef PATH_MAX + buff_size = PATH_MAX; +#else + buff_size = 8192; +#endif + buff = calloc(buff_size, 1); + if (buff == NULL) { + fprintf(stderr, "Unable to allocate memory\n"); + exit(1); + } + + /* Allocate a buffer to hold the various directories we checked. */ + tried_size = buff_size * 2; + tried = calloc(tried_size, 1); + if (tried == NULL) { + fprintf(stderr, "Unable to allocate memory\n"); + exit(1); + } /* If a dir was specified, try that */ if (d != NULL) { pwd = NULL; - snprintf(buff, sizeof(buff), "%s", d); + snprintf(buff, buff_size, "%s", d); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); goto failure; } @@ -2559,48 +2577,48 @@ get_refdir(const char *d) pwd[strlen(pwd) - 1] = '\0'; /* Look for a known file. */ - snprintf(buff, sizeof(buff), "%s", pwd); + snprintf(buff, buff_size, "%s", pwd); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); - snprintf(buff, sizeof(buff), "%s/test", pwd); + snprintf(buff, buff_size, "%s/test", pwd); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); #if defined(LIBRARY) - snprintf(buff, sizeof(buff), "%s/%s/test", pwd, LIBRARY); + snprintf(buff, buff_size, "%s/%s/test", pwd, LIBRARY); #else - snprintf(buff, sizeof(buff), "%s/%s/test", pwd, PROGRAM); + snprintf(buff, buff_size, "%s/%s/test", pwd, PROGRAM); #endif p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); #if defined(PROGRAM_ALIAS) - snprintf(buff, sizeof(buff), "%s/%s/test", pwd, PROGRAM_ALIAS); + snprintf(buff, buff_size, "%s/%s/test", pwd, PROGRAM_ALIAS); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); #endif if (memcmp(pwd, "/usr/obj", 8) == 0) { - snprintf(buff, sizeof(buff), "%s", pwd + 8); + snprintf(buff, buff_size, "%s", pwd + 8); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); - snprintf(buff, sizeof(buff), "%s/test", pwd + 8); + snprintf(buff, buff_size, "%s/test", pwd + 8); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); } failure: @@ -2615,7 +2633,12 @@ failure: success: free(p); free(pwd); - return strdup(buff); + free(tried); + + /* Copy result into a fresh buffer to reduce memory usage. */ + p = strdup(buff); + free(buff); + return p; } int Modified: vendor/libarchive/dist/configure.ac ============================================================================== --- vendor/libarchive/dist/configure.ac Sat Jun 18 01:23:38 2016 (r302002) +++ vendor/libarchive/dist/configure.ac Sat Jun 18 08:25:31 2016 (r302003) @@ -252,7 +252,7 @@ esac # Checks for header files. AC_HEADER_DIRENT AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS([acl/libacl.h attr/xattr.h copyfile.h ctype.h]) +AC_CHECK_HEADERS([copyfile.h ctype.h]) AC_CHECK_HEADERS([errno.h ext2fs/ext2_fs.h fcntl.h grp.h]) AC_CACHE_CHECK([whether EXT2_IOC_GETFLAGS is usable], @@ -272,7 +272,7 @@ AC_CHECK_HEADERS([linux/fiemap.h linux/f AC_CHECK_HEADERS([locale.h paths.h poll.h pthread.h pwd.h]) AC_CHECK_HEADERS([readpassphrase.h signal.h spawn.h]) AC_CHECK_HEADERS([stdarg.h stdint.h stdlib.h string.h]) -AC_CHECK_HEADERS([sys/acl.h sys/cdefs.h sys/extattr.h]) +AC_CHECK_HEADERS([sys/cdefs.h sys/extattr.h]) AC_CHECK_HEADERS([sys/ioctl.h sys/mkdev.h sys/mount.h]) AC_CHECK_HEADERS([sys/param.h sys/poll.h sys/select.h sys/statfs.h sys/statvfs.h]) AC_CHECK_HEADERS([sys/time.h sys/utime.h sys/utsname.h sys/vfs.h]) @@ -644,7 +644,7 @@ AC_CHECK_MEMBER(struct dirent.d_namlen,, # Check for Extended Attributes support AC_ARG_ENABLE([xattr], AS_HELP_STRING([--disable-xattr], - [Enable Extended Attributes support (default: check)])) + [Disable Extended Attributes support (default: check)])) if test "x$enable_xattr" != "xno"; then AC_CHECK_HEADERS([attr/xattr.h]) @@ -670,9 +670,10 @@ fi # AC_ARG_ENABLE([acl], AS_HELP_STRING([--disable-acl], - [Enable ACL support (default: check)])) + [Disable ACL support (default: check)])) if test "x$enable_acl" != "xno"; then + AC_CHECK_HEADERS([acl/libacl.h]) AC_CHECK_HEADERS([sys/acl.h]) AC_CHECK_LIB([acl],[acl_get_file]) AC_CHECK_FUNCS([acl_create_entry acl_init acl_set_fd acl_set_fd_np acl_set_file]) Modified: vendor/libarchive/dist/cpio/test/CMakeLists.txt ============================================================================== --- vendor/libarchive/dist/cpio/test/CMakeLists.txt Sat Jun 18 01:23:38 2016 (r302002) +++ vendor/libarchive/dist/cpio/test/CMakeLists.txt Sat Jun 18 08:25:31 2016 (r302003) @@ -25,6 +25,7 @@ IF(ENABLE_CPIO AND ENABLE_TEST) test_extract_cpio_xz test_format_newc.c test_gcpio_compat.c + test_missing_file.c test_option_0.c test_option_B_upper.c test_option_C_upper.c Modified: vendor/libarchive/dist/cpio/test/main.c ============================================================================== --- vendor/libarchive/dist/cpio/test/main.c Sat Jun 18 01:23:38 2016 (r302002) +++ vendor/libarchive/dist/cpio/test/main.c Sat Jun 18 08:25:31 2016 (r302003) @@ -2535,18 +2535,36 @@ usage(const char *program) static char * get_refdir(const char *d) { - char tried[512] = { '\0' }; - char buff[128]; - char *pwd, *p; + size_t tried_size, buff_size; + char *buff, *tried, *pwd = NULL, *p = NULL; + +#ifdef PATH_MAX + buff_size = PATH_MAX; +#else + buff_size = 8192; +#endif + buff = calloc(buff_size, 1); + if (buff == NULL) { + fprintf(stderr, "Unable to allocate memory\n"); + exit(1); + } + + /* Allocate a buffer to hold the various directories we checked. */ + tried_size = buff_size * 2; + tried = calloc(tried_size, 1); + if (tried == NULL) { + fprintf(stderr, "Unable to allocate memory\n"); + exit(1); + } /* If a dir was specified, try that */ if (d != NULL) { pwd = NULL; - snprintf(buff, sizeof(buff), "%s", d); + snprintf(buff, buff_size, "%s", d); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); goto failure; } @@ -2560,48 +2578,48 @@ get_refdir(const char *d) pwd[strlen(pwd) - 1] = '\0'; /* Look for a known file. */ - snprintf(buff, sizeof(buff), "%s", pwd); + snprintf(buff, buff_size, "%s", pwd); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); - snprintf(buff, sizeof(buff), "%s/test", pwd); + snprintf(buff, buff_size, "%s/test", pwd); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); #if defined(LIBRARY) - snprintf(buff, sizeof(buff), "%s/%s/test", pwd, LIBRARY); + snprintf(buff, buff_size, "%s/%s/test", pwd, LIBRARY); #else - snprintf(buff, sizeof(buff), "%s/%s/test", pwd, PROGRAM); + snprintf(buff, buff_size, "%s/%s/test", pwd, PROGRAM); #endif p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); #if defined(PROGRAM_ALIAS) - snprintf(buff, sizeof(buff), "%s/%s/test", pwd, PROGRAM_ALIAS); + snprintf(buff, buff_size, "%s/%s/test", pwd, PROGRAM_ALIAS); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); #endif if (memcmp(pwd, "/usr/obj", 8) == 0) { - snprintf(buff, sizeof(buff), "%s", pwd + 8); + snprintf(buff, buff_size, "%s", pwd + 8); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); - snprintf(buff, sizeof(buff), "%s/test", pwd + 8); + snprintf(buff, buff_size, "%s/test", pwd + 8); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); } failure: @@ -2616,7 +2634,12 @@ failure: success: free(p); free(pwd); - return strdup(buff); + free(tried); + + /* Copy result into a fresh buffer to reduce memory usage. */ + p = strdup(buff); + free(buff); + return p; } int Added: vendor/libarchive/dist/cpio/test/test_missing_file.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/dist/cpio/test/test_missing_file.c Sat Jun 18 08:25:31 2016 (r302003) @@ -0,0 +1,52 @@ +/*- + * Copyright (c) 2016 Tim Kientzle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_missing_file) +{ + int r; + + assertMakeFile("file1", 0644, "file1"); + assertMakeFile("file2", 0644, "file2"); + + assertMakeFile("filelist1", 0644, "file1\nfile2\n"); + r = systemf("%s -o stdout1 2>stderr1", testprog); + assertEqualInt(r, 0); + assertTextFileContents("1 block\n", "stderr1"); + + assertMakeFile("filelist2", 0644, "file1\nfile2\nfile3\n"); + r = systemf("%s -o stdout2 2>stderr2", testprog); + assert(r != 0); + + assertMakeFile("filelist3", 0644, ""); + r = systemf("%s -o stdout3 2>stderr3", testprog); + assertEqualInt(r, 0); + assertTextFileContents("1 block\n", "stderr3"); + + assertMakeFile("filelist4", 0644, "file3\n"); + r = systemf("%s -o stdout4 2>stderr4", testprog); + assert(r != 0); +} Modified: vendor/libarchive/dist/libarchive/archive_entry_xattr.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_entry_xattr.c Sat Jun 18 01:23:38 2016 (r302002) +++ vendor/libarchive/dist/libarchive/archive_entry_xattr.c Sat Jun 18 08:25:31 2016 (r302003) @@ -91,16 +91,11 @@ archive_entry_xattr_add_entry(struct arc { struct ae_xattr *xp; - for (xp = entry->xattr_head; xp != NULL; xp = xp->next) - ; - if ((xp = (struct ae_xattr *)malloc(sizeof(struct ae_xattr))) == NULL) - /* XXX Error XXX */ - return; + __archive_errx(1, "Out of memory"); if ((xp->name = strdup(name)) == NULL) - /* XXX Error XXX */ - return; + __archive_errx(1, "Out of memory"); if ((xp->value = malloc(size)) != NULL) { memcpy(xp->value, value, size); Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_mtree.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_mtree.c Sat Jun 18 01:23:38 2016 (r302002) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_mtree.c Sat Jun 18 08:25:31 2016 (r302003) @@ -1385,12 +1385,12 @@ parse_device(dev_t *pdev, struct archive "Missing number"); return ARCHIVE_WARN; } - numbers[argc++] = (unsigned long)mtree_atol(&p); - if (argc > MAX_PACK_ARGS) { + if (argc >= MAX_PACK_ARGS) { archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT, "Too many arguments"); return ARCHIVE_WARN; } + numbers[argc++] = (unsigned long)mtree_atol(&p); } if (argc < 2) { archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT, Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c Sat Jun 18 01:23:38 2016 (r302002) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c Sat Jun 18 08:25:31 2016 (r302003) @@ -181,6 +181,14 @@ struct zip { char init_decryption; /* Decryption buffer. */ + /* + * The decrypted data starts at decrypted_ptr and + * extends for decrypted_bytes_remaining. Decryption + * adds new data to the end of this block, data is returned + * to clients from the beginning. When the block hits the + * end of decrypted_buffer, it has to be shuffled back to + * the beginning of the buffer. + */ unsigned char *decrypted_buffer; unsigned char *decrypted_ptr; size_t decrypted_buffer_size; @@ -1293,8 +1301,9 @@ zip_read_data_deflate(struct archive_rea if (zip->tctx_valid || zip->cctx_valid) { if (zip->decrypted_bytes_remaining < (size_t)bytes_avail) { - size_t buff_remaining = zip->decrypted_buffer_size - - (zip->decrypted_ptr - zip->decrypted_buffer); + size_t buff_remaining = + (zip->decrypted_buffer + zip->decrypted_buffer_size) + - (zip->decrypted_ptr + zip->decrypted_bytes_remaining); if (buff_remaining > (size_t)bytes_avail) buff_remaining = (size_t)bytes_avail; Modified: vendor/libarchive/dist/libarchive/archive_write_disk_windows.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_disk_windows.c Sat Jun 18 01:23:38 2016 (r302002) +++ vendor/libarchive/dist/libarchive/archive_write_disk_windows.c Sat Jun 18 08:25:31 2016 (r302003) @@ -468,9 +468,17 @@ permissive_name_w(struct archive_write_d return (-1); archive_wstring_ensure(&(a->_name_data), 4 + l + 1 + wcslen(wn) + 1); a->name = a->_name_data.s; - /* Prepend "\\?\" and drive name. */ - archive_wstrncpy(&(a->_name_data), L"\\\\?\\", 4); - archive_wstrncat(&(a->_name_data), wsp, l); + /* Prepend "\\?\" and drive name if not already added. */ + if (l > 3 && wsp[0] == L'\\' && wsp[1] == L'\\' && + wsp[2] == L'?' && wsp[3] == L'\\') + { + archive_wstrncpy(&(a->_name_data), wsp, l); + } + else + { + archive_wstrncpy(&(a->_name_data), L"\\\\?\\", 4); + archive_wstrncat(&(a->_name_data), wsp, l); + } archive_wstrncat(&(a->_name_data), L"\\", 1); archive_wstrcat(&(a->_name_data), wn); a->name = a->_name_data.s; Modified: vendor/libarchive/dist/libarchive/archive_write_filter.3 ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_filter.3 Sat Jun 18 01:23:38 2016 (r302002) +++ vendor/libarchive/dist/libarchive/archive_write_filter.3 Sat Jun 18 08:25:31 2016 (r302003) @@ -43,6 +43,7 @@ .Nm archive_write_add_filter_program , .Nm archive_write_add_filter_uuencode , .Nm archive_write_add_filter_xz +.Nd functions enabling output filters .Sh LIBRARY Streaming Archive Library (libarchive, -larchive) .Sh SYNOPSIS Modified: vendor/libarchive/dist/libarchive/archive_write_set_format_gnutar.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_set_format_gnutar.c Sat Jun 18 01:23:38 2016 (r302002) +++ vendor/libarchive/dist/libarchive/archive_write_set_format_gnutar.c Sat Jun 18 08:25:31 2016 (r302003) @@ -467,7 +467,7 @@ archive_write_gnutar_header(struct archi } } if (gnutar->linkname_length > GNUTAR_linkname_size) { - size_t todo = gnutar->linkname_length; + size_t length = gnutar->linkname_length + 1; struct archive_entry *temp = archive_entry_new2(&a->archive); /* Uname/gname here don't really matter since no one reads them; @@ -476,7 +476,7 @@ archive_write_gnutar_header(struct archi archive_entry_set_gname(temp, "wheel"); archive_entry_set_pathname(temp, "././@LongLink"); - archive_entry_set_size(temp, gnutar->linkname_length + 1); + archive_entry_set_size(temp, length); ret = archive_format_gnutar_header(a, buff, temp, 'K'); if (ret < ARCHIVE_WARN) goto exit_write_header; @@ -484,11 +484,12 @@ archive_write_gnutar_header(struct archi if(ret < ARCHIVE_WARN) goto exit_write_header; archive_entry_free(temp); - /* Write as many 512 bytes blocks as needed to write full name. */ - ret = __archive_write_output(a, gnutar->linkname, todo); + /* Write name and trailing null byte. */ + ret = __archive_write_output(a, gnutar->linkname, length); if(ret < ARCHIVE_WARN) goto exit_write_header; - ret = __archive_write_nulls(a, 0x1ff & (-(ssize_t)todo)); + /* Pad to 512 bytes */ + ret = __archive_write_nulls(a, 0x1ff & (-(ssize_t)length)); if (ret < ARCHIVE_WARN) goto exit_write_header; } @@ -496,7 +497,7 @@ archive_write_gnutar_header(struct archi /* If pathname is longer than 100 chars we need to add an 'L' header. */ if (gnutar->pathname_length > GNUTAR_name_size) { const char *pathname = gnutar->pathname; - size_t todo = gnutar->pathname_length; + size_t length = gnutar->pathname_length + 1; struct archive_entry *temp = archive_entry_new2(&a->archive); /* Uname/gname here don't really matter since no one reads them; @@ -505,7 +506,7 @@ archive_write_gnutar_header(struct archi archive_entry_set_gname(temp, "wheel"); archive_entry_set_pathname(temp, "././@LongLink"); - archive_entry_set_size(temp, gnutar->pathname_length + 1); + archive_entry_set_size(temp, length); ret = archive_format_gnutar_header(a, buff, temp, 'L'); if (ret < ARCHIVE_WARN) goto exit_write_header; @@ -513,11 +514,12 @@ archive_write_gnutar_header(struct archi if(ret < ARCHIVE_WARN) goto exit_write_header; archive_entry_free(temp); - /* Write as many 512 bytes blocks as needed to write full name. */ - ret = __archive_write_output(a, pathname, todo); + /* Write pathname + trailing null byte. */ + ret = __archive_write_output(a, pathname, length); if(ret < ARCHIVE_WARN) goto exit_write_header; - ret = __archive_write_nulls(a, 0x1ff & (-(ssize_t)todo)); + /* Pad to multiple of 512 bytes. */ + ret = __archive_write_nulls(a, 0x1ff & (-(ssize_t)length)); if (ret < ARCHIVE_WARN) goto exit_write_header; } Modified: vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c Sat Jun 18 01:23:38 2016 (r302002) +++ vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c Sat Jun 18 08:25:31 2016 (r302003) @@ -6225,7 +6225,7 @@ isoent_gen_joliet_identifier(struct arch unsigned char *p; size_t l; int r; - int ffmax, parent_len; + size_t ffmax, parent_len; static const struct archive_rb_tree_ops rb_ops = { isoent_cmp_node_joliet, isoent_cmp_key_joliet }; @@ -6239,7 +6239,7 @@ isoent_gen_joliet_identifier(struct arch else ffmax = 128; - r = idr_start(a, idr, isoent->children.cnt, ffmax, 6, 2, &rb_ops); + r = idr_start(a, idr, isoent->children.cnt, (int)ffmax, 6, 2, &rb_ops); if (r < 0) return (r); @@ -6252,7 +6252,7 @@ isoent_gen_joliet_identifier(struct arch int ext_off, noff, weight; size_t lt; - if ((int)(l = np->file->basename_utf16.length) > ffmax) + if ((l = np->file->basename_utf16.length) > ffmax) l = ffmax; p = malloc((l+1)*2); @@ -6285,7 +6285,7 @@ isoent_gen_joliet_identifier(struct arch /* * Get a length of MBS of a full-pathname. */ - if ((int)np->file->basename_utf16.length > ffmax) { + if (np->file->basename_utf16.length > ffmax) { if (archive_strncpy_l(&iso9660->mbs, (const char *)np->identifier, l, iso9660->sconv_from_utf16be) != 0 && @@ -6302,7 +6302,9 @@ isoent_gen_joliet_identifier(struct arch /* If a length of full-pathname is longer than 240 bytes, * it violates Joliet extensions regulation. */ - if (parent_len + np->mb_len > 240) { + if (parent_len > 240 + || np->mb_len > 240 + || parent_len + np->mb_len > 240) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "The regulation of Joliet extensions;" " A length of a full-pathname of `%s' is " @@ -6314,11 +6316,11 @@ isoent_gen_joliet_identifier(struct arch /* Make an offset of the number which is used to be set * hexadecimal number to avoid duplicate identifier. */ - if ((int)l == ffmax) + if (l == ffmax) noff = ext_off - 6; - else if ((int)l == ffmax-2) + else if (l == ffmax-2) noff = ext_off - 4; - else if ((int)l == ffmax-4) + else if (l == ffmax-4) noff = ext_off - 2; else noff = ext_off; Modified: vendor/libarchive/dist/libarchive/archive_write_set_options.3 ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_set_options.3 Sat Jun 18 01:23:38 2016 (r302002) +++ vendor/libarchive/dist/libarchive/archive_write_set_options.3 Sat Jun 18 08:25:31 2016 (r302003) @@ -32,7 +32,7 @@ .Nm archive_write_set_format_option , .Nm archive_write_set_option , .Nm archive_write_set_options -.Nd functions controlling options for reading archives +.Nd functions controlling options for writing archives .Sh LIBRARY Streaming Archive Library (libarchive, -larchive) .Sh SYNOPSIS Modified: vendor/libarchive/dist/libarchive/libarchive-formats.5 ============================================================================== --- vendor/libarchive/dist/libarchive/libarchive-formats.5 Sat Jun 18 01:23:38 2016 (r302002) +++ vendor/libarchive/dist/libarchive/libarchive-formats.5 Sat Jun 18 08:25:31 2016 (r302003) @@ -65,7 +65,6 @@ Later variants have extended this by eit areas of the header record, extending the header to multiple records, or by storing special entries that modify the interpretation of subsequent entries. -.Pp .Bl -tag -width indent .It Cm gnutar The Modified: vendor/libarchive/dist/libarchive/libarchive_changes.3 ============================================================================== --- vendor/libarchive/dist/libarchive/libarchive_changes.3 Sat Jun 18 01:23:38 2016 (r302002) +++ vendor/libarchive/dist/libarchive/libarchive_changes.3 Sat Jun 18 08:25:31 2016 (r302003) @@ -28,7 +28,7 @@ .Dt LIBARCHIVE_CHANGES 3 .Os .Sh NAME -.Nm changes in libarchive interface +.Nd changes in libarchive interface .\" .Sh CHANGES IN LIBARCHIVE 3 This page describes user-visible changes in libarchive3, and lists Modified: vendor/libarchive/dist/libarchive/test/CMakeLists.txt ============================================================================== --- vendor/libarchive/dist/libarchive/test/CMakeLists.txt Sat Jun 18 01:23:38 2016 (r302002) +++ vendor/libarchive/dist/libarchive/test/CMakeLists.txt Sat Jun 18 08:25:31 2016 (r302003) @@ -222,6 +222,7 @@ IF(ENABLE_TEST) test_write_format_cpio_newc.c test_write_format_cpio_odc.c test_write_format_gnutar.c + test_write_format_gnutar_filenames.c test_write_format_iso9660.c test_write_format_iso9660_boot.c test_write_format_iso9660_empty.c Modified: vendor/libarchive/dist/libarchive/test/main.c ============================================================================== --- vendor/libarchive/dist/libarchive/test/main.c Sat Jun 18 01:23:38 2016 (r302002) +++ vendor/libarchive/dist/libarchive/test/main.c Sat Jun 18 08:25:31 2016 (r302003) @@ -2533,18 +2533,36 @@ usage(const char *program) static char * get_refdir(const char *d) { - char tried[512] = { '\0' }; - char buff[128]; - char *pwd, *p; + size_t tried_size, buff_size; + char *buff, *tried, *pwd = NULL, *p = NULL; + +#ifdef PATH_MAX + buff_size = PATH_MAX; +#else + buff_size = 8192; +#endif + buff = calloc(buff_size, 1); + if (buff == NULL) { + fprintf(stderr, "Unable to allocate memory\n"); + exit(1); + } + + /* Allocate a buffer to hold the various directories we checked. */ + tried_size = buff_size * 2; + tried = calloc(tried_size, 1); + if (tried == NULL) { + fprintf(stderr, "Unable to allocate memory\n"); + exit(1); + } /* If a dir was specified, try that */ if (d != NULL) { pwd = NULL; - snprintf(buff, sizeof(buff), "%s", d); + snprintf(buff, buff_size, "%s", d); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); goto failure; } @@ -2558,48 +2576,48 @@ get_refdir(const char *d) pwd[strlen(pwd) - 1] = '\0'; /* Look for a known file. */ - snprintf(buff, sizeof(buff), "%s", pwd); + snprintf(buff, buff_size, "%s", pwd); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); - snprintf(buff, sizeof(buff), "%s/test", pwd); + snprintf(buff, buff_size, "%s/test", pwd); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); #if defined(LIBRARY) - snprintf(buff, sizeof(buff), "%s/%s/test", pwd, LIBRARY); + snprintf(buff, buff_size, "%s/%s/test", pwd, LIBRARY); #else - snprintf(buff, sizeof(buff), "%s/%s/test", pwd, PROGRAM); + snprintf(buff, buff_size, "%s/%s/test", pwd, PROGRAM); #endif p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); #if defined(PROGRAM_ALIAS) - snprintf(buff, sizeof(buff), "%s/%s/test", pwd, PROGRAM_ALIAS); + snprintf(buff, buff_size, "%s/%s/test", pwd, PROGRAM_ALIAS); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); #endif if (memcmp(pwd, "/usr/obj", 8) == 0) { - snprintf(buff, sizeof(buff), "%s", pwd + 8); + snprintf(buff, buff_size, "%s", pwd + 8); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); - snprintf(buff, sizeof(buff), "%s/test", pwd + 8); + snprintf(buff, buff_size, "%s/test", pwd + 8); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); } failure: @@ -2614,7 +2632,12 @@ failure: success: free(p); free(pwd); - return strdup(buff); + free(tried); + + /* Copy result into a fresh buffer to reduce memory usage. */ + p = strdup(buff); + free(buff); + return p; } int Added: vendor/libarchive/dist/libarchive/test/test_write_format_gnutar_filenames.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/dist/libarchive/test/test_write_format_gnutar_filenames.c Sat Jun 18 08:25:31 2016 (r302003) @@ -0,0 +1,145 @@ +/*- + * Copyright (c) 2016 Tim Kientzle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +/* + * Inspired by Github issue #682, which reported that gnutar filenames + * of exactly 512 bytes weren't getting written correctly. + * + * This writes a filename of every length from 1 to 2000 bytes and + * reads back to verify it. + */ + +static char filename[1024]; + +DEFINE_TEST(test_write_format_gnutar_filenames) +{ + size_t buffsize = 1000000; + char *buff; + struct archive_entry *ae, *template; + struct archive *a; + size_t used; + + buff = malloc(buffsize); /* million bytes of work area */ + assert(buff != NULL); + + /* Create a template entry. */ + assert((template = archive_entry_new()) != NULL); + archive_entry_set_atime(template, 2, 20); + archive_entry_set_birthtime(template, 3, 30); + archive_entry_set_ctime(template, 4, 40); + archive_entry_set_mtime(template, 5, 50); + archive_entry_set_mode(template, S_IFREG | 0755); + archive_entry_set_size(template, 8); + + for (int i = 0; i < 2000; ++i) { + filename[i] = 'a'; + filename[i + 1] = '\0'; + archive_entry_copy_pathname(template, filename); + + /* Write a one-item gnutar format archive. */ + assert((a = archive_write_new()) != NULL); + assertA(0 == archive_write_set_format_gnutar(a)); + assertA(0 == archive_write_add_filter_none(a)); + assertA(0 == archive_write_open_memory(a, buff, buffsize, &used)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, template)); + assertEqualIntA(a, 8, archive_write_data(a, "12345678", 9)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_free(a)); + + + /* Read back and verify the filename. */ + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, 0, archive_read_support_format_all(a)); + assertEqualIntA(a, 0, archive_read_support_filter_all(a)); + assertEqualIntA(a, 0, archive_read_open_memory(a, buff, used)); + + assertEqualIntA(a, 0, archive_read_next_header(a, &ae)); + assertEqualString(filename, archive_entry_pathname(ae)); + assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a)); + } + + archive_entry_free(template); + + free(buff); +} + + +DEFINE_TEST(test_write_format_gnutar_linknames) +{ + size_t buffsize = 1000000; + char *buff; + struct archive_entry *ae, *template; + struct archive *a; + size_t used; + + buff = malloc(buffsize); /* million bytes of work area */ + assert(buff != NULL); + + /* Create a template entry. */ + assert((template = archive_entry_new()) != NULL); + archive_entry_set_atime(template, 2, 20); + archive_entry_set_birthtime(template, 3, 30); + archive_entry_set_ctime(template, 4, 40); + archive_entry_set_mtime(template, 5, 50); + archive_entry_set_mode(template, S_IFLNK | 0755); + archive_entry_copy_pathname(template, "link"); + + for (int i = 0; i < 2000; ++i) { + filename[i] = 'a'; + filename[i + 1] = '\0'; + archive_entry_copy_symlink(template, filename); + + /* Write a one-item gnutar format archive. */ + assert((a = archive_write_new()) != NULL); + assertA(0 == archive_write_set_format_gnutar(a)); + assertA(0 == archive_write_add_filter_none(a)); + assertA(0 == archive_write_open_memory(a, buff, buffsize, &used)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, template)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_free(a)); + + + /* Read back and verify the filename. */ + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, 0, archive_read_support_format_all(a)); + assertEqualIntA(a, 0, archive_read_support_filter_all(a)); + assertEqualIntA(a, 0, archive_read_open_memory(a, buff, used)); + + assertEqualIntA(a, 0, archive_read_next_header(a, &ae)); + assertEqualString("link", archive_entry_pathname(ae)); + assertEqualString(filename, archive_entry_symlink(ae)); + assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a)); + } + + archive_entry_free(template); + + free(buff); +} Modified: vendor/libarchive/dist/tar/test/CMakeLists.txt ============================================================================== --- vendor/libarchive/dist/tar/test/CMakeLists.txt Sat Jun 18 01:23:38 2016 (r302002) +++ vendor/libarchive/dist/tar/test/CMakeLists.txt Sat Jun 18 08:25:31 2016 (r302003) @@ -25,6 +25,7 @@ IF(ENABLE_TAR AND ENABLE_TEST) test_format_newc.c test_help.c test_leading_slash.c + test_missing_file.c test_option_C_upper.c test_option_H_upper.c test_option_L_upper.c Modified: vendor/libarchive/dist/tar/test/main.c ============================================================================== --- vendor/libarchive/dist/tar/test/main.c Sat Jun 18 01:23:38 2016 (r302002) +++ vendor/libarchive/dist/tar/test/main.c Sat Jun 18 08:25:31 2016 (r302003) @@ -2535,18 +2535,36 @@ usage(const char *program) static char * get_refdir(const char *d) { - char tried[512] = { '\0' }; - char buff[128]; - char *pwd, *p; + size_t tried_size, buff_size; + char *buff, *tried, *pwd = NULL, *p = NULL; + +#ifdef PATH_MAX + buff_size = PATH_MAX; +#else + buff_size = 8192; +#endif + buff = calloc(buff_size, 1); + if (buff == NULL) { + fprintf(stderr, "Unable to allocate memory\n"); + exit(1); + } + + /* Allocate a buffer to hold the various directories we checked. */ + tried_size = buff_size * 2; + tried = calloc(tried_size, 1); + if (tried == NULL) { + fprintf(stderr, "Unable to allocate memory\n"); + exit(1); + } /* If a dir was specified, try that */ if (d != NULL) { pwd = NULL; - snprintf(buff, sizeof(buff), "%s", d); + snprintf(buff, buff_size, "%s", d); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); goto failure; } @@ -2560,48 +2578,48 @@ get_refdir(const char *d) pwd[strlen(pwd) - 1] = '\0'; /* Look for a known file. */ - snprintf(buff, sizeof(buff), "%s", pwd); + snprintf(buff, buff_size, "%s", pwd); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Jun 18 12:44:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAFBCA7849F; Sat, 18 Jun 2016 12:44:15 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7BA914D1; Sat, 18 Jun 2016 12:44:15 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5ICiESE043900; Sat, 18 Jun 2016 12:44:14 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5ICiEHX043899; Sat, 18 Jun 2016 12:44:14 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201606181244.u5ICiEHX043899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Sat, 18 Jun 2016 12:44:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r302006 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2016 12:44:16 -0000 Author: ed Date: Sat Jun 18 12:44:14 2016 New Revision: 302006 URL: https://svnweb.freebsd.org/changeset/base/302006 Log: MFC r301406: Don't test for INKERNEL to check whether we're in kernel space. It turns out that actually defines a macro under this name, even when we're not in kernelspace. This causes us to suppress some macro definitions that are used by userspace apps. PR: 210026 Reported by: jbeich@ Modified: stable/10/sys/sys/soundcard.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/soundcard.h ============================================================================== --- stable/10/sys/sys/soundcard.h Sat Jun 18 12:42:49 2016 (r302005) +++ stable/10/sys/sys/soundcard.h Sat Jun 18 12:44:14 2016 (r302006) @@ -1261,7 +1261,7 @@ typedef struct mixer_info { */ #define LOCL_STARTAUDIO 1 -#if (!defined(_KERNEL) && !defined(INKERNEL)) || defined(USE_SEQ_MACROS) +#if !defined(_KERNEL) || defined(USE_SEQ_MACROS) /* * Some convenience macros to simplify programming of the * /dev/sequencer interface From owner-svn-src-all@freebsd.org Sat Jun 18 12:46:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44C3CA78718; Sat, 18 Jun 2016 12:46:51 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16AC91A04; Sat, 18 Jun 2016 12:46:51 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5ICko0v044090; Sat, 18 Jun 2016 12:46:50 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5ICkoA8044089; Sat, 18 Jun 2016 12:46:50 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201606181246.u5ICkoA8044089@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Sat, 18 Jun 2016 12:46:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r302008 - stable/10/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2016 12:46:51 -0000 Author: ed Date: Sat Jun 18 12:46:50 2016 New Revision: 302008 URL: https://svnweb.freebsd.org/changeset/base/302008 Log: MFC r300998: Add missing va_list to . It looks like va_list should always be defined when XSI is enabled. It moved over to the POSIX base in the 2008 edition. Modified: stable/10/include/wchar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/include/wchar.h ============================================================================== --- stable/10/include/wchar.h Sat Jun 18 12:44:22 2016 (r302007) +++ stable/10/include/wchar.h Sat Jun 18 12:46:50 2016 (r302008) @@ -76,6 +76,13 @@ typedef __size_t size_t; #define _SIZE_T_DECLARED #endif +#if __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE +#ifndef _VA_LIST_DECLARED +typedef __va_list va_list; +#define _VA_LIST_DECLARED +#endif +#endif + #ifndef __cplusplus #ifndef _WCHAR_T_DECLARED typedef ___wchar_t wchar_t; From owner-svn-src-all@freebsd.org Sat Jun 18 13:41:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8241CA7817D; Sat, 18 Jun 2016 13:41:01 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 359462EB7; Sat, 18 Jun 2016 13:41:01 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5IDf0HG062467; Sat, 18 Jun 2016 13:41:00 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5IDf0P1062466; Sat, 18 Jun 2016 13:41:00 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201606181341.u5IDf0P1062466@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 18 Jun 2016 13:41:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r302009 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2016 13:41:01 -0000 Author: jilles Date: Sat Jun 18 13:41:00 2016 New Revision: 302009 URL: https://svnweb.freebsd.org/changeset/base/302009 Log: Add mergeinfo missed in r300954. Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-all@freebsd.org Sat Jun 18 13:42:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F126BA78405; Sat, 18 Jun 2016 13:42:34 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CBDF31326; Sat, 18 Jun 2016 13:42:34 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5IDgYH6065891; Sat, 18 Jun 2016 13:42:34 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5IDgXMO065886; Sat, 18 Jun 2016 13:42:33 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201606181342.u5IDgXMO065886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 18 Jun 2016 13:42:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r302010 - in stable/10: lib/libthr share/man/man3 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2016 13:42:35 -0000 Author: jilles Date: Sat Jun 18 13:42:33 2016 New Revision: 302010 URL: https://svnweb.freebsd.org/changeset/base/302010 Log: MFC r300970: Remove non-history libkse references and fix typo "PTHREAD_PROCESSES_PRIVATE". Modified: stable/10/lib/libthr/libthr.3 stable/10/share/man/man3/pthread_barrier_destroy.3 stable/10/share/man/man3/pthread_barrierattr.3 stable/10/share/man/man3/pthread_condattr.3 stable/10/share/man/man3/pthread_spin_init.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libthr/libthr.3 ============================================================================== --- stable/10/lib/libthr/libthr.3 Sat Jun 18 13:41:00 2016 (r302009) +++ stable/10/lib/libthr/libthr.3 Sat Jun 18 13:42:33 2016 (r302010) @@ -47,9 +47,7 @@ library provides a 1:1 implementation of library interfaces for application threading. It has been optimized for use by applications expecting system scope thread -semantics, and can provide significant performance improvements -compared to -.Lb libkse . +semantics. .Pp The library is tightly integrated with the run-time link editor .Xr ld-elf.so.1 1 Modified: stable/10/share/man/man3/pthread_barrier_destroy.3 ============================================================================== --- stable/10/share/man/man3/pthread_barrier_destroy.3 Sat Jun 18 13:41:00 2016 (r302009) +++ stable/10/share/man/man3/pthread_barrier_destroy.3 Sat Jun 18 13:42:33 2016 (r302010) @@ -75,9 +75,7 @@ argument to .Fn pthread_barrier_init . Once the threads have been released the barrier will be reset. .Sh IMPLEMENTATION NOTES -In both -.Lb libkse -and +In .Lb libthr the .Dv PTHREAD_BARRIER_SERIAL_THREAD Modified: stable/10/share/man/man3/pthread_barrierattr.3 ============================================================================== --- stable/10/share/man/man3/pthread_barrierattr.3 Sat Jun 18 13:41:00 2016 (r302009) +++ stable/10/share/man/man3/pthread_barrierattr.3 Sat Jun 18 13:42:33 2016 (r302010) @@ -137,11 +137,9 @@ barriers does not fully conform to .St -p1003.2 because the process-shared attribute is ignored in -.Lb libthr , -and in -.Lb libkse ; +.Lb libthr ; if any value other than -.Dv PTHREAD_PROCESSES_PRIVATE +.Dv PTHREAD_PROCESS_PRIVATE is specified in a call to .Fn pthread_barrierattr_setpshared , it will return Modified: stable/10/share/man/man3/pthread_condattr.3 ============================================================================== --- stable/10/share/man/man3/pthread_condattr.3 Sat Jun 18 13:41:00 2016 (r302009) +++ stable/10/share/man/man3/pthread_condattr.3 Sat Jun 18 13:42:33 2016 (r302010) @@ -167,7 +167,7 @@ does not fully conform to .St -p1003.2 because the process-shared attribute is ignored; if any value other than -.Dv PTHREAD_PROCESSES_PRIVATE +.Dv PTHREAD_PROCESS_PRIVATE is specified in a call to .Fn pthread_condattr_setpshared , it will return Modified: stable/10/share/man/man3/pthread_spin_init.3 ============================================================================== --- stable/10/share/man/man3/pthread_spin_init.3 Sat Jun 18 13:41:00 2016 (r302009) +++ stable/10/share/man/man3/pthread_spin_init.3 Sat Jun 18 13:42:33 2016 (r302010) @@ -129,10 +129,8 @@ does not fully conform to because the .Fa pshared argument is ignored in -.Lb libthr , -and in -.Lb libkse +.Lb libthr ; if any value other than -.Dv PTHREAD_PROCESSES_PRIVATE +.Dv PTHREAD_PROCESS_PRIVATE is specified, it returns .Er EINVAL . From owner-svn-src-all@freebsd.org Sat Jun 18 13:44:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD4FEA78479; Sat, 18 Jun 2016 13:44:11 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61EC114E8; Sat, 18 Jun 2016 13:44:11 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5IDiAvP066045; Sat, 18 Jun 2016 13:44:10 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5IDiAIW066042; Sat, 18 Jun 2016 13:44:10 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201606181344.u5IDiAIW066042@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 18 Jun 2016 13:44:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r302011 - stable/10/share/man/man3 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2016 13:44:11 -0000 Author: jilles Date: Sat Jun 18 13:44:10 2016 New Revision: 302011 URL: https://svnweb.freebsd.org/changeset/base/302011 Log: MFC r301076: Fix typo ESRC -> ESRCH in pthread man pages. Modified: stable/10/share/man/man3/pthread_attr_get_np.3 stable/10/share/man/man3/pthread_resume_np.3 stable/10/share/man/man3/pthread_suspend_np.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man3/pthread_attr_get_np.3 ============================================================================== --- stable/10/share/man/man3/pthread_attr_get_np.3 Sat Jun 18 13:42:33 2016 (r302010) +++ stable/10/share/man/man3/pthread_attr_get_np.3 Sat Jun 18 13:44:10 2016 (r302011) @@ -93,7 +93,7 @@ function will fail if: .Bl -tag -width Er .It Bq Er EINVAL Invalid value for one of given parameters. -.It Bq Er ESRC +.It Bq Er ESRCH No thread could be found corresponding to that specified by the given thread ID. .El Modified: stable/10/share/man/man3/pthread_resume_np.3 ============================================================================== --- stable/10/share/man/man3/pthread_resume_np.3 Sat Jun 18 13:42:33 2016 (r302010) +++ stable/10/share/man/man3/pthread_resume_np.3 Sat Jun 18 13:44:10 2016 (r302011) @@ -57,7 +57,7 @@ function will fail if: The value specified by the .Fa tid argument is invalid. -.It Bq Er ESRC +.It Bq Er ESRCH No thread could be found corresponding to the thread ID specified by the .Fa tid argument. Modified: stable/10/share/man/man3/pthread_suspend_np.3 ============================================================================== --- stable/10/share/man/man3/pthread_suspend_np.3 Sat Jun 18 13:42:33 2016 (r302010) +++ stable/10/share/man/man3/pthread_suspend_np.3 Sat Jun 18 13:44:10 2016 (r302011) @@ -63,7 +63,7 @@ An attempt was made to suspend the curre The value specified by the .Fa tid argument is invalid. -.It Bq Er ESRC +.It Bq Er ESRCH No thread could be found corresponding to the thread ID specified by the .Fa tid argument. From owner-svn-src-all@freebsd.org Sat Jun 18 20:20:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A32D7A78545; Sat, 18 Jun 2016 20:20:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 724A016A6; Sat, 18 Jun 2016 20:20:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5IKK0dD011440; Sat, 18 Jun 2016 20:20:00 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5IKK0sq011439; Sat, 18 Jun 2016 20:20:00 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606182020.u5IKK0sq011439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 18 Jun 2016 20:20:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302012 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2016 20:20:01 -0000 Author: kib Date: Sat Jun 18 20:20:00 2016 New Revision: 302012 URL: https://svnweb.freebsd.org/changeset/base/302012 Log: Fix gcc build. Reported andt tested by: swills Sponsored by: The FreeBSD Foundation Approved by: re (gjb) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Jun 18 13:44:10 2016 (r302011) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Jun 18 20:20:00 2016 (r302012) @@ -3795,7 +3795,7 @@ dnlc_reduce_cache(void *arg) { u_int percent; - percent = (u_int)arg; + percent = (u_int)(uintptr_t)arg; mutex_enter(&arc_dnlc_evicts_lock); if (arc_dnlc_evicts_arg == 0) { arc_dnlc_evicts_arg = percent; From owner-svn-src-all@freebsd.org Sat Jun 18 20:22:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 921EAA786E7; Sat, 18 Jun 2016 20:22:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E8F71A8C; Sat, 18 Jun 2016 20:22:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5IKMrMd015093; Sat, 18 Jun 2016 20:22:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5IKMreS015092; Sat, 18 Jun 2016 20:22:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606182022.u5IKMreS015092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 18 Jun 2016 20:22:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302013 - head/sys/nlm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2016 20:22:54 -0000 Author: kib Date: Sat Jun 18 20:22:53 2016 New Revision: 302013 URL: https://svnweb.freebsd.org/changeset/base/302013 Log: After the vnode unlock, mount point might be destroyed immediately, dropping the reference on mnt_cred. Prevent this by referencing the temporal credentials before unlock. Tested by: pho Reviewed by: dfr Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (gjb) Modified: head/sys/nlm/nlm_advlock.c Modified: head/sys/nlm/nlm_advlock.c ============================================================================== --- head/sys/nlm/nlm_advlock.c Sat Jun 18 20:20:00 2016 (r302012) +++ head/sys/nlm/nlm_advlock.c Sat Jun 18 20:22:53 2016 (r302013) @@ -210,7 +210,7 @@ nlm_advlock_internal(struct vnode *vp, v struct rpc_callextra ext; struct nlm_feedback_arg nf; AUTH *auth; - struct ucred *cred; + struct ucred *cred, *cred1; struct nlm_file_svid *ns; int svid; int error; @@ -240,15 +240,17 @@ nlm_advlock_internal(struct vnode *vp, v else retries = INT_MAX; - if (unlock_vp) - VOP_UNLOCK(vp, 0); - /* * We need to switch to mount-point creds so that we can send - * packets from a privileged port. + * packets from a privileged port. Reference mnt_cred and + * switch to them before unlocking the vnode, since mount + * point could be unmounted right after unlock. */ cred = td->td_ucred; td->td_ucred = vp->v_mount->mnt_cred; + crhold(td->td_ucred); + if (unlock_vp) + VOP_UNLOCK(vp, 0); host = nlm_find_host_by_name(servername, sa, vers); auth = authunix_create(cred); @@ -373,7 +375,9 @@ nlm_advlock_internal(struct vnode *vp, v if (ns) nlm_free_svid(ns); + cred1 = td->td_ucred; td->td_ucred = cred; + crfree(cred1); AUTH_DESTROY(auth); nlm_host_release(host); From owner-svn-src-all@freebsd.org Sat Jun 18 22:06:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2103DA79057; Sat, 18 Jun 2016 22:06:51 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.daemonic.se (cloud.daemonic.se [185.34.0.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8B8E1F68; Sat, 18 Jun 2016 22:06:50 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from cloud.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 3rXB6T6tlqz27LY; Sat, 18 Jun 2016 22:06:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([127.0.0.1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cloud.daemonic.se (mailscanner.daemonic.se [127.0.0.1]) (amavisd-new, port 10587) with ESMTPS id OnrL_A8Amv67; Sat, 18 Jun 2016 22:06:41 +0000 (UTC) Received: from tifa.daemonic.se (tifa.daemonic.se [IPv6:2001:470:dca9:2::5]) by mail.daemonic.se (Postfix) with ESMTPSA id 3rXB6T1R5Xz27C0; Sat, 18 Jun 2016 22:06:40 +0000 (UTC) Subject: Re: svn commit: r288291 - head/etc To: Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201509270403.t8R43B5Z062241@repo.freebsd.org> From: Niclas Zeising Message-ID: <2171b966-35c7-2dad-2c0f-f23061cb677a@freebsd.org> Date: Sun, 19 Jun 2016 00:06:32 +0200 User-Agent: Mutt/1.5.21 MIME-Version: 1.0 In-Reply-To: <201509270403.t8R43B5Z062241@repo.freebsd.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2016 22:06:51 -0000 On 09/27/15 06:03, Adrian Chadd wrote: > Author: adrian > Date: Sun Sep 27 04:03:11 2015 > New Revision: 288291 > URL: https://svnweb.freebsd.org/changeset/base/288291 > > Log: > Enforce consistent limits of daemons run from rc.subr: > > * Allow the user to configure the login class to use in rc.conf > by using {daemon}_login_class, which; > * Use the daemon class by default; > * .. and then use 'limits' to set the login class so it works both > via init at startup (which runs this in 'daemon' class) and via > whichever root environment (eg command line, other daemons, etc.) > > Reviewed by: dteske > Differential Revision: https://reviews.freebsd.org/D3630 > > Modified: > head/etc/rc.subr > > Modified: head/etc/rc.subr > ============================================================================== > --- head/etc/rc.subr Sun Sep 27 03:46:55 2015 (r288290) > +++ head/etc/rc.subr Sun Sep 27 04:03:11 2015 (r288291) > @@ -768,6 +768,8 @@ check_startmsgs() > # > # ${name}_prepend n Command added before ${command}. > # > +# ${name}_login_class n Login class to use, else "daemon". > +# > # ${rc_arg}_cmd n If set, use this as the method when invoked; > # Otherwise, use default command (see below) > # > @@ -942,7 +944,7 @@ run_rc_command() > _nice=\$${name}_nice _user=\$${name}_user \ > _group=\$${name}_group _groups=\$${name}_groups \ > _fib=\$${name}_fib _env=\$${name}_env \ > - _prepend=\$${name}_prepend > + _prepend=\$${name}_prepend _login_class=\${${name}_login_class:-daemon} > > if [ -n "$_user" ]; then # unset $_user if running as that user > if [ "$_user" = "$(eval $IDCMD)" ]; then > @@ -1050,6 +1052,9 @@ $command $rc_flags $command_args" > fi > fi > > + # Prepend default limits > + _doit="limits -C $_login_class $_doit" ^^^^^^^^^^ > + > # run the full command > # > if ! _run_rc_doit "$_doit"; then Apologies for waking so late. This breaks the start of scripts running before file systems are mounted, for example /etc/rc.d/ddb, if / and /usr are on separate partitions. The issue is that limits is /usr/bin/limits, and for obvious reasons can't be found before /usr is mounted. I suggest either move /usr/bin/limits to /bin/limits or avoid using it altogether. Do you want me to open a PR to track this issue? Regards! -- Niclas Zeising From owner-svn-src-all@freebsd.org Sat Jun 18 23:18:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07EE4A79EBB; Sat, 18 Jun 2016 23:18:06 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CCAE41FD6; Sat, 18 Jun 2016 23:18:05 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5INI5JJ079127; Sat, 18 Jun 2016 23:18:05 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5INI5wL079126; Sat, 18 Jun 2016 23:18:05 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201606182318.u5INI5wL079126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Sat, 18 Jun 2016 23:18:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302014 - head/sys/dev/ntb/if_ntb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2016 23:18:06 -0000 Author: vangyzen Date: Sat Jun 18 23:18:04 2016 New Revision: 302014 URL: https://svnweb.freebsd.org/changeset/base/302014 Log: Fix if_ntb interface setup to include IFF_MULTICAST. This allows IPv6 link local addresses (and other IPv6 functionality) to work. PR: 210355 Submitted by: Steve Wahl and David Bright (both at Dell Inc.) Reviewed by: cem, mav Tested by: mav (on Intel hardware) Approved by: re (kib) MFC after: 5 days Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D6885 Modified: head/sys/dev/ntb/if_ntb/if_ntb.c Modified: head/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- head/sys/dev/ntb/if_ntb/if_ntb.c Sat Jun 18 20:22:53 2016 (r302013) +++ head/sys/dev/ntb/if_ntb/if_ntb.c Sat Jun 18 23:18:04 2016 (r302014) @@ -427,7 +427,7 @@ ntb_setup_interface(void) &handlers); ifp->if_init = ntb_net_init; ifp->if_softc = &net_softc; - ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX; + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = ntb_ioctl; ifp->if_start = ntb_start; IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN);