svn commit: r257426 - head/usr.bin/limits

2013-10-31 Thread Konstantin Belousov
Author: kib
Date: Thu Oct 31 08:22:29 2013
New Revision: 257426
URL: http://svnweb.freebsd.org/changeset/base/257426

Log:
  The limit for the swap space is spelled 'swapsize', at least since
  tcsh 6.17.00 import.
  
  Submitted by: Stefan Neudorf
  PR:   bin/183480
  MFC after:1 week

Modified:
  head/usr.bin/limits/limits.c

Modified: head/usr.bin/limits/limits.c
==
--- head/usr.bin/limits/limits.cThu Oct 31 06:36:41 2013
(r257425)
+++ head/usr.bin/limits/limits.cThu Oct 31 08:22:29 2013
(r257426)
@@ -125,7 +125,7 @@ static struct {
  { "limit%s sbsize %s",  ";\n",  1},
  { "limit%s vmemoryuse %s",  ";\n",  1024 },
  { "limit%s pseudoterminals %s", ";\n",  1},
- { "limit%s swapuse %s", ";\n",  1024 },
+ { "limit%s swapsize %s",";\n",  1024 },
  { "limit%s kqueues %s", ";\n",  1},
   }
 },
@@ -160,7 +160,7 @@ static struct {
  { "limit%s sbsize %s",  ";\n",  1},
  { "limit%s vmemoryuse %s",  ";\n",  1024 },
  { "limit%s pseudoterminals %s", ";\n",  1},
- { "limit%s swapuse %s", ";\n",  1024 },
+ { "limit%s swapsize %s",";\n",  1024 },
  { "limit%s kqueues %s", ";\n",  1},
   }
 },
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257427 - head/usr.bin/limits

2013-10-31 Thread Konstantin Belousov
Author: kib
Date: Thu Oct 31 08:58:32 2013
New Revision: 257427
URL: http://svnweb.freebsd.org/changeset/base/257427

Log:
  The limit for the swap space is spelled 'swapsize', at least since
  tcsh 6.17.00 import.
  
  Submitted by: Stefan Neudorf
  PR:   bin/183480
  MFC after:1 week

Modified:
  head/usr.bin/limits/limits.c

Modified: head/usr.bin/limits/limits.c
==
--- head/usr.bin/limits/limits.cThu Oct 31 08:22:29 2013
(r257426)
+++ head/usr.bin/limits/limits.cThu Oct 31 08:58:32 2013
(r257427)
@@ -248,7 +248,7 @@ static struct {
  * to be modified accordingly!
  */
 
-#define RCS_STRING  "tfdscmlunbvpw"
+#define RCS_STRING  "tfdscmlunbvpwk"
 
 static rlim_t resource_num(int which, int ch, const char *str);
 static void usage(void);
@@ -287,7 +287,7 @@ main(int argc, char *argv[])
 
 pid = -1;
 optarg = NULL;
-while ((ch = getopt(argc, argv, 
":EeC:U:BSHP:ab:c:d:f:l:m:n:s:t:u:v:p:w:")) != -1) {
+while ((ch = getopt(argc, argv, 
":EeC:U:BSHP:ab:c:d:f:l:m:n:s:t:u:v:p:w:k:")) != -1) {
switch(ch) {
case 'a':
doall = 1;
@@ -544,7 +544,7 @@ usage(void)
 {
 (void)fprintf(stderr,
"usage: limits [-C class|-P pid|-U user] [-eaSHBE] "
-   "[-bcdflmnstuvpw [val]] [[name=val ...] cmd]\n");
+   "[-bcdflmnstuvpwk [val]] [[name=val ...] cmd]\n");
 exit(EXIT_FAILURE);
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257428 - head/usr.bin/limits

2013-10-31 Thread Konstantin Belousov
Author: kib
Date: Thu Oct 31 09:03:42 2013
New Revision: 257428
URL: http://svnweb.freebsd.org/changeset/base/257428

Log:
  Fix long line and record proper commit message for r257427:
  Add the '-k' option for getopt() call and usage.
  
  Submitted by: Stefan Neudorf
  PR:   bin/183494
  MFC after:1 week

Modified:
  head/usr.bin/limits/limits.c

Modified: head/usr.bin/limits/limits.c
==
--- head/usr.bin/limits/limits.cThu Oct 31 08:58:32 2013
(r257427)
+++ head/usr.bin/limits/limits.cThu Oct 31 09:03:42 2013
(r257428)
@@ -287,7 +287,8 @@ main(int argc, char *argv[])
 
 pid = -1;
 optarg = NULL;
-while ((ch = getopt(argc, argv, 
":EeC:U:BSHP:ab:c:d:f:l:m:n:s:t:u:v:p:w:k:")) != -1) {
+while ((ch = getopt(argc, argv,
+  ":EeC:U:BSHP:ab:c:d:f:l:m:n:s:t:u:v:p:w:k:")) != -1) {
switch(ch) {
case 'a':
doall = 1;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257429 - head/sys/dev/usb/wlan

2013-10-31 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Oct 31 09:20:30 2013
New Revision: 257429
URL: http://svnweb.freebsd.org/changeset/base/257429

Log:
  Fix some types. Compilation for external target complains that "u_int"
  is not idential to "uint32_t" when defining set channel prototype
  functions. The WLAN channel range should be from 0 to 65535
  inclusivly, and u_int should be fine for this purpose.

Modified:
  head/sys/dev/usb/wlan/if_run.c

Modified: head/sys/dev/usb/wlan/if_run.c
==
--- head/sys/dev/usb/wlan/if_run.c  Thu Oct 31 09:03:42 2013
(r257428)
+++ head/sys/dev/usb/wlan/if_run.c  Thu Oct 31 09:20:30 2013
(r257429)
@@ -320,7 +320,7 @@ static usb_callback_t   run_bulk_tx_callba
 static usb_callback_t  run_bulk_tx_callback5;
 
 static voidrun_bulk_tx_callbackN(struct usb_xfer *xfer,
-   usb_error_t error, unsigned int index);
+   usb_error_t error, u_int index);
 static struct ieee80211vap *run_vap_create(struct ieee80211com *,
const char [IFNAMSIZ], int, enum ieee80211_opmode, int,
const uint8_t [IEEE80211_ADDR_LEN],
@@ -426,7 +426,7 @@ static int  run_txrx_enable(struct run_so
 static voidrun_init(void *);
 static voidrun_init_locked(struct run_softc *);
 static voidrun_stop(void *);
-static voidrun_delay(struct run_softc *, unsigned int);
+static voidrun_delay(struct run_softc *, u_int);
 
 static const struct {
uint16_treg;
@@ -2724,7 +2724,7 @@ run_tx_free(struct run_endpoint_queue *p
 }
 
 static void
-run_bulk_tx_callbackN(struct usb_xfer *xfer, usb_error_t error, unsigned int 
index)
+run_bulk_tx_callbackN(struct usb_xfer *xfer, usb_error_t error, u_int index)
 {
struct run_softc *sc = usbd_xfer_softc(xfer);
struct ifnet *ifp = sc->sc_ifp;
@@ -3576,7 +3576,7 @@ run_select_chan_group(struct run_softc *
 }
 
 static void
-run_rt2870_set_chan(struct run_softc *sc, uint32_t chan)
+run_rt2870_set_chan(struct run_softc *sc, u_int chan)
 {
const struct rfprog *rfprog = rt2860_rf2850;
uint32_t r2, r3, r4;
@@ -3631,7 +3631,7 @@ run_rt2870_set_chan(struct run_softc *sc
 }
 
 static void
-run_rt3070_set_chan(struct run_softc *sc, uint32_t chan)
+run_rt3070_set_chan(struct run_softc *sc, u_int chan)
 {
int8_t txpow1, txpow2;
uint8_t rf;
@@ -3868,7 +3868,7 @@ static int
 run_set_chan(struct run_softc *sc, struct ieee80211_channel *c)
 {
struct ieee80211com *ic = sc->sc_ifp->if_l2com;
-   uint32_t chan, group;
+   u_int chan, group;
 
chan = ieee80211_chan2ieee(ic, c);
if (chan == 0 || chan == IEEE80211_CHAN_ANY)
@@ -4310,7 +4310,7 @@ run_rssi2dbm(struct run_softc *sc, uint8
int delta;
 
if (IEEE80211_IS_CHAN_5GHZ(c)) {
-   uint32_t chan = ieee80211_chan2ieee(ic, c);
+   u_int chan = ieee80211_chan2ieee(ic, c);
delta = sc->rssi_5ghz[rxchain];
 
/* determine channel group */
@@ -4974,7 +4974,7 @@ run_stop(void *arg)
 }
 
 static void
-run_delay(struct run_softc *sc, unsigned int ms)
+run_delay(struct run_softc *sc, u_int ms)
 {
usb_pause_mtx(mtx_owned(&sc->sc_mtx) ? 
&sc->sc_mtx : NULL, USB_MS_TO_TICKS(ms));
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257430 - head/usr.bin/limits

2013-10-31 Thread Konstantin Belousov
Author: kib
Date: Thu Oct 31 09:29:37 2013
New Revision: 257430
URL: http://svnweb.freebsd.org/changeset/base/257430

Log:
  Remove the dependency on procfs.  Use sysctl KERN_PROC_PATHNAME and
  KERN_PROC_PID to obtain the parent process pathname and command, used
  to determine the calling shell.
  
  Submitted by: Stefan Neudorf
  PR:   bin/183484
  MFC after:1 week

Modified:
  head/usr.bin/limits/limits.c

Modified: head/usr.bin/limits/limits.c
==
--- head/usr.bin/limits/limits.cThu Oct 31 09:20:30 2013
(r257429)
+++ head/usr.bin/limits/limits.cThu Oct 31 09:29:37 2013
(r257430)
@@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -705,27 +706,32 @@ getshelltype(void)
 pid_t ppid = getppid();
 
 if (ppid != 1) {
-   FILE * fp;
+   struct kinfo_proc kp;
struct stat st;
-   char procdir[MAXPATHLEN], buf[128];
-   int l = sprintf(procdir, "/proc/%ld/", (long)ppid);
+   char path[MAXPATHLEN];
char * shell = getenv("SHELL");
+   int mib[4];
+   size_t len;
+
+   mib[0] = CTL_KERN;
+   mib[1] = KERN_PROC;
+   mib[3] = ppid;
 
if (shell != NULL && stat(shell, &st) != -1) {
struct stat st1;
 
-   strcpy(procdir+l, "file");
-   /* $SHELL is actual shell? */
-   if (stat(procdir, &st1) != -1 && memcmp(&st, &st1, sizeof st) == 0)
-   return getshellbyname(shell);
-   }
-   strcpy(procdir+l, "status");
-   if (stat(procdir, &st) == 0 && (fp = fopen(procdir, "r")) != NULL) {
-   char * p = fgets(buf, sizeof buf, fp)==NULL ? NULL : strtok(buf, " 
\t");
-   fclose(fp);
-   if (p != NULL)
-   return getshellbyname(p);
+   mib[2] = KERN_PROC_PATHNAME;
+   len = sizeof(path);
+   if (sysctl(mib, 4, path, &len, NULL, 0) != -1) {
+   /* $SHELL is actual shell? */
+   if (stat(path, &st1) != -1 && memcmp(&st, &st1, sizeof st) == 0)
+   return getshellbyname(shell);
+   }
}
+   mib[2] = KERN_PROC_PID;
+   len = sizeof(kp);
+   if (sysctl(mib, 4, &kp, &len, NULL, 0) != -1)
+   return getshellbyname(kp.ki_comm);
 }
 return SH_SH;
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r256850 - in head: bin/sh etc lib/libc/sys lib/libutil usr.bin/limits usr.bin/procstat

2013-10-31 Thread Konstantin Belousov
On Wed, Oct 30, 2013 at 10:20:52PM +0100, Jilles Tjoelker wrote:
> On Wed, Oct 30, 2013 at 02:01:57PM +0100, Stefan Neudorf wrote:
> > Konstantin Belousov  writes:
> 
> > > Author: kib
> > > Date: Mon Oct 21 16:46:12 2013
> > > New Revision: 256850
> > > URL: http://svnweb.freebsd.org/changeset/base/256850
> 
> > > Log:
> > >   Add a resource limit for the total number of kqueues available to the
> > >   user.  Kqueue now saves the ucred of the allocating thread, to
> > >   correctly decrement the counter on close.
> 
> > >   Under some specific and not real-world use scenario for kqueue, it is
> > >   possible for the kqueues to consume memory proportional to the square
> > >   of the number of the filedescriptors available to the process.  Limit
> > >   allows administrator to prevent the abuse.
> 
> > >   This is kernel-mode side of the change, with the user-mode enabling
> > >   commit following.
> 
> > >   Reported and tested by: pho
> > >   Discussed with: jmg
> > >   Sponsored by:   The FreeBSD Foundation
> > >   MFC after:  2 weeks
> 
> > > Modified:
> > >   head/bin/sh/miscbltin.c
> > >   head/etc/login.conf
> > >   head/lib/libc/sys/getrlimit.2
> > >   head/lib/libutil/login_class.3
> > >   head/lib/libutil/login_class.c
> > >   head/usr.bin/limits/limits.c
> > >   head/usr.bin/procstat/procstat_rlimit.c
> 
> > kqueues limit isn't documented in sh(1) and limits(1) manpages.
> 
> I can do this in the next few days.
Thank you, appreciated.

> 
> > > Modified: head/bin/sh/miscbltin.c
> > > ==
> > > --- head/bin/sh/miscbltin.c   Mon Oct 21 16:44:53 2013
> > > (r256849)
> > > +++ head/bin/sh/miscbltin.c   Mon Oct 21 16:46:12 2013
> > > (r256850)
> > > @@ -405,6 +405,9 @@ static const struct limits limits[] = {
> > >  #ifdef RLIMIT_NPTS
> > >   { "pseudo-terminals",   (char *)0,  RLIMIT_NPTS,   1, 'p' },
> > >  #endif
> > > +#ifdef RLIMIT_KQUEUES
> > > + { "kqueues",(char *)0,  RLIMIT_KQUEUES,1, 'k' },
> > > +#endif
> > >   { (char *) 0,   (char *)0,  0, 0, '\0' }
> > >  };
> > >  
> 
> > I've submitted a patch to add ulimit -k (kqueue) to zsh but the reviewer
> > asked me to rename -k to -K to avoid conflict with ulimit -k (posixlocks)
> > from DragonFly. Do you anticipate FreeBSD never adds RLIMIT_POSIXLOCKS
> > support or would use incompatible option switch?
> 
> > http://www.zsh.org/mla/workers/2013/msg00984.html
> > http://gitweb.dragonflybsd.org/dragonfly.git?a=search&h=HEAD&st=commit&s=posixlocks
> 
> I think dragonfly has invented its own name here. The usual name for
> RLIMIT_POSIXLOCKS (Linux and Solaris) is RLIMIT_LOCKS and ulimit has it
> under -x (bash) or -L (ksh93). It seems more appropriate for FreeBSD to
> follow one of those. (On the other hand, dash ulimit has it on -w.)
The RLIMIT_LOCKS is for the fcntl(2) locks, right ? It is very strange
for me, and almost misleading, to have the limit called RLIMIT_POSIXLOCKS.
RLIMIT_LOCKS is not much telling as well, RLIMIT_FLOCK would be better
IMHO.

I agree that we better follow Linux there.

> 
> Generally, the namespace for ulimit letters is very small so
> inconsistencies between shells and implementations are to be expected.
> Also, various shell implementations appear to have stopped caring to add
> new rlimits to their ulimit builtin.
> 
> zsh's -N  option avoids the need to modify the shell
> for new rlimits, but is probably too cryptic to use other than via
> limits -e.
> 
> > > Modified: head/usr.bin/limits/limits.c
> > > ==
> > > --- head/usr.bin/limits/limits.c  Mon Oct 21 16:44:53 2013
> > > (r256849)
> > > +++ head/usr.bin/limits/limits.c  Mon Oct 21 16:46:12 2013
> > > (r256850)
> 
> > This adds limits -e support only for sh, csh, tcsh. What about other
> > shells that already support sbsize and swapuse extensions?
> 
> This can be done later; the kqueue rlimit need not be gated on it.

I definitely do not want to go over the {pd,}ksh, zsh, bash, rc and
whatever else. Somebody who cares should contact the projects and
propose the changes.


pgpY6zSNAnYQP.pgp
Description: PGP signature


svn commit: r257435 - head/sys/dev/usb/wlan

2013-10-31 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Oct 31 11:03:36 2013
New Revision: 257435
URL: http://svnweb.freebsd.org/changeset/base/257435

Log:
  Fix a potential memory leak.
  
  MFC after:1 week

Modified:
  head/sys/dev/usb/wlan/if_run.c

Modified: head/sys/dev/usb/wlan/if_run.c
==
--- head/sys/dev/usb/wlan/if_run.c  Thu Oct 31 10:15:22 2013
(r257434)
+++ head/sys/dev/usb/wlan/if_run.c  Thu Oct 31 11:03:36 2013
(r257435)
@@ -2676,6 +2676,7 @@ tr_setup:
m->m_data += 4;
m->m_pkthdr.len = m->m_len -= 4;
run_rx_frame(sc, m, dmalen);
+   m = NULL;   /* don't free source buffer */
break;
}
 
@@ -2697,6 +2698,9 @@ tr_setup:
m->m_pkthdr.len = m->m_len -= dmalen + 8;
}
 
+   /* make sure we free the source buffer, if any */
+   m_freem(m);
+
RUN_LOCK(sc);
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257436 - head/tools/regression/pjdfstest

2013-10-31 Thread Pawel Jakub Dawidek
Author: pjd
Date: Thu Oct 31 11:38:25 2013
New Revision: 257436
URL: http://svnweb.freebsd.org/changeset/base/257436

Log:
  Make lpathconf(2) support optional to make it compile again on Linux.
  
  Submitted by: Hashem Nasarat @riseup.net

Modified:
  head/tools/regression/pjdfstest/Makefile
  head/tools/regression/pjdfstest/pjdfstest.c

Modified: head/tools/regression/pjdfstest/Makefile
==
--- head/tools/regression/pjdfstest/MakefileThu Oct 31 11:03:36 2013
(r257435)
+++ head/tools/regression/pjdfstest/MakefileThu Oct 31 11:38:25 2013
(r257436)
@@ -6,7 +6,7 @@ ${PROG}:${PROG}.c
@OSTYPE=`uname`; \
CFLAGS=-D__OS_$${OSTYPE}__; \
if [ $$OSTYPE = "FreeBSD" ]; then \
-   CFLAGS="$$CFLAGS -DHAS_LCHMOD -DHAS_CHFLAGS -DHAS_FCHFLAGS 
-DHAS_CHFLAGSAT -DHAS_LCHFLAGS -DHAS_FREEBSD_ACL -DHAS_BINDAT -DHAS_CONNECTAT"; 
\
+   CFLAGS="$$CFLAGS -DHAS_LCHMOD -DHAS_CHFLAGS -DHAS_FCHFLAGS 
-DHAS_CHFLAGSAT -DHAS_LCHFLAGS -DHAS_FREEBSD_ACL -DHAS_BINDAT -DHAS_CONNECTAT 
-DHAS_LPATHCONF"; \
elif [ $$OSTYPE = "SunOS" ]; then \
CFLAGS="$$CFLAGS -DHAS_TRUNCATE64 -DHAS_STAT64"; \
CFLAGS="$$CFLAGS -lsocket"; \

Modified: head/tools/regression/pjdfstest/pjdfstest.c
==
--- head/tools/regression/pjdfstest/pjdfstest.c Thu Oct 31 11:03:36 2013
(r257435)
+++ head/tools/regression/pjdfstest/pjdfstest.c Thu Oct 31 11:38:25 2013
(r257436)
@@ -119,7 +119,9 @@ enum action {
ACTION_FSTATAT,
ACTION_PATHCONF,
ACTION_FPATHCONF,
+#ifdef HAS_LPATHCONF
ACTION_LPATHCONF,
+#endif
 #ifdef HAS_FREEBSD_ACL
ACTION_PREPENDACL,
ACTION_READACL,
@@ -200,7 +202,9 @@ static struct syscall_desc syscalls[] = 
{ "fstatat", ACTION_FSTATAT, { TYPE_DESCRIPTOR, TYPE_STRING, 
TYPE_STRING, TYPE_STRING, TYPE_NONE } },
{ "pathconf", ACTION_PATHCONF, { TYPE_STRING, TYPE_STRING, TYPE_NONE } 
},
{ "fpathconf", ACTION_FPATHCONF, { TYPE_DESCRIPTOR, TYPE_STRING, 
TYPE_NONE } },
+#ifdef HAS_LPATHCONF
{ "lpathconf", ACTION_LPATHCONF, { TYPE_STRING, TYPE_STRING, TYPE_NONE 
} },
+#endif
 #ifdef HAS_FREEBSD_ACL
{ "prependacl", ACTION_PREPENDACL, { TYPE_STRING, TYPE_STRING, 
TYPE_NONE } },
{ "readacl", ACTION_READACL, { TYPE_STRING, TYPE_NONE } },
@@ -899,7 +903,9 @@ call_syscall(struct syscall_desc *scall,
break;
case ACTION_PATHCONF:
case ACTION_FPATHCONF:
+#ifdef HAS_LPATHCONF
case ACTION_LPATHCONF:
+#endif
{
long lrval;
 
@@ -916,9 +922,11 @@ call_syscall(struct syscall_desc *scall,
case ACTION_FPATHCONF:
lrval = fpathconf(NUM(0), name);
break;
+#ifdef HAS_LPATHCONF
case ACTION_LPATHCONF:
lrval = lpathconf(STR(0), name);
break;
+#endif
default:
abort();
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257440 - head/tools/build/options

2013-10-31 Thread Baptiste Daroussin
Author: bapt
Date: Thu Oct 31 12:05:37 2013
New Revision: 257440
URL: http://svnweb.freebsd.org/changeset/base/257440

Log:
  Adjust the manpage category for the pkg bootstrap

Modified:
  head/tools/build/options/WITHOUT_PKGBOOTSTRAP

Modified: head/tools/build/options/WITHOUT_PKGBOOTSTRAP
==
--- head/tools/build/options/WITHOUT_PKGBOOTSTRAP   Thu Oct 31 11:59:04 
2013(r257439)
+++ head/tools/build/options/WITHOUT_PKGBOOTSTRAP   Thu Oct 31 12:05:37 
2013(r257440)
@@ -1,4 +1,4 @@
 .\" $FreeBSD$
 Set to not build
-.Xr pkg 1
+.Xr pkg 7
 bootstrap tool
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257444 - in head: . etc/periodic/daily etc/periodic/security etc/periodic/weekly share/man/man5 tools/build/mk tools/build/options usr.sbin usr.sbin/pkg_install

2013-10-31 Thread Baptiste Daroussin
Author: bapt
Date: Thu Oct 31 13:00:35 2013
New Revision: 257444
URL: http://svnweb.freebsd.org/changeset/base/257444

Log:
  After around 20 years of duty it is time for pkg_install to retire

Deleted:
  head/etc/periodic/daily/220.backup-pkgdb
  head/etc/periodic/daily/490.status-pkg-changes
  head/etc/periodic/security/460.chkportsum
  head/etc/periodic/weekly/400.status-pkg
  head/tools/build/options/WITH_PKGTOOLS
  head/usr.sbin/pkg_install/
Modified:
  head/ObsoleteFiles.inc
  head/etc/periodic/daily/Makefile
  head/etc/periodic/security/Makefile
  head/etc/periodic/weekly/Makefile
  head/share/man/man5/src.conf.5
  head/tools/build/mk/OptionalObsoleteFiles.inc
  head/usr.sbin/Makefile

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Thu Oct 31 12:59:25 2013(r257443)
+++ head/ObsoleteFiles.inc  Thu Oct 31 13:00:35 2013(r257444)
@@ -38,6 +38,23 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20131031: pkg_install has been removed
+OLD_FILES+=etc/periodic/daily/220.backup-pkgdb
+OLD_FILES+=etc/periodic/daily/490.status-pkg-changes
+OLD_FILES+=etc/periodic/security/460.chkportsum
+OLD_FILES+=etc/periodic/weekly/400.status-pkg
+OLD_FILES+=usr/sbin/pkg_add
+OLD_FILES+=usr/sbin/pkg_create
+OLD_FILES+=usr/sbin/pkg_delete
+OLD_FILES+=usr/sbin/pkg_info
+OLD_FILES+=usr/sbin/pkg_updating
+OLD_FILES+=usr/sbin/pkg_version
+OLD_FILES+=usr/share/man/man1/pkg_add.1.gz
+OLD_FILES+=usr/share/man/man1/pkg_create.1.gz
+OLD_FILES+=usr/share/man/man1/pkg_delete.1.gz
+OLD_FILES+=usr/share/man/man1/pkg_info.1.gz
+OLD_FILES+=usr/share/man/man1/pkg_updating.1.gz
+OLD_FILES+=usr/share/man/man1/pkg_version.1.gz
 # 20131030: /etc/keys moved to /usr/share/keys
 OLD_DIRS+=etc/keys
 OLD_DIRS+=etc/keys/pkg

Modified: head/etc/periodic/daily/Makefile
==
--- head/etc/periodic/daily/MakefileThu Oct 31 12:59:25 2013
(r257443)
+++ head/etc/periodic/daily/MakefileThu Oct 31 13:00:35 2013
(r257444)
@@ -36,11 +36,6 @@ FILES+=  130.clean-msgs
 FILES+=480.status-ntpd
 .endif
 
-.if ${MK_PKGTOOLS} != "no"
-FILES+=220.backup-pkgdb \
-   490.status-pkg-changes
-.endif
-
 .if ${MK_RCMDS} != "no"
 FILES+=140.clean-rwho \
430.status-rwho

Modified: head/etc/periodic/security/Makefile
==
--- head/etc/periodic/security/Makefile Thu Oct 31 12:59:25 2013
(r257443)
+++ head/etc/periodic/security/Makefile Thu Oct 31 13:00:35 2013
(r257444)
@@ -29,8 +29,4 @@ FILES+=   500.ipfwdenied \
 FILES+=520.pfdenied
 .endif
 
-.if ${MK_PKGTOOLS} != "no"
-FILES+=460.chkportsum
-.endif
-
 .include 

Modified: head/etc/periodic/weekly/Makefile
==
--- head/etc/periodic/weekly/Makefile   Thu Oct 31 12:59:25 2013
(r257443)
+++ head/etc/periodic/weekly/Makefile   Thu Oct 31 13:00:35 2013
(r257444)
@@ -16,8 +16,4 @@ FILES+=   310.locate
 FILES+=320.whatis 330.catman
 .endif
 
-.if ${MK_PKGTOOLS} != "no"
-FILES+=400.status-pkg
-.endif
-
 .include 

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Thu Oct 31 12:59:25 2013
(r257443)
+++ head/share/man/man5/src.conf.5  Thu Oct 31 13:00:35 2013
(r257444)
@@ -1,7 +1,7 @@
 .\" DO NOT EDIT-- this file is automatically generated.
 .\" from FreeBSD: head/tools/build/options/makeman 255964 2013-10-01 07:22:04Z 
des
 .\" $FreeBSD$
-.Dd October 25, 2013
+.Dd October 31, 2013
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -860,15 +860,10 @@ When set, it also enforces the following
 .Va WITHOUT_AUTHPF
 .El
 .It Va WITHOUT_PKGBOOTSTRAP
-.\" from FreeBSD: head/tools/build/options/WITHOUT_PKGBOOTSTRAP 238023 
2012-07-02 20:26:11Z marcel
+.\" $FreeBSD: head/tools/build/options/WITHOUT_PKGBOOTSTRAP 257440 2013-10-31 
12:05:37Z bapt
 Set to not build
-.Xr pkg 1
+.Xr pkg 7
 bootstrap tool
-.It Va WITH_PKGTOOLS
-.\" from FreeBSD: head/tools/build/options/WITH_PKGTOOLS 253305 2013-07-12 
23:11:17Z bapt
-Set to build
-.Xr pkg_add 8
-and related programs.
 .It Va WITHOUT_PMC
 .\" from FreeBSD: head/tools/build/options/WITHOUT_PMC 183242 2008-09-21 
22:02:26Z sam
 Set to not build

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Thu Oct 31 12:59:25 
2013(r257443)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Thu Oct 31 13:00:35 
2013(r257444)
@@ -3613,29 +3613,6 @@ OLD_FILES+=usr/sbin/pkg
 OLD_FILES+=usr/share/man/man7/

svn commit: r257446 - in head/sys/dev/usb: . serial

2013-10-31 Thread Adrian Chadd
Author: adrian
Date: Thu Oct 31 13:54:51 2013
New Revision: 257446
URL: http://svnweb.freebsd.org/changeset/base/257446

Log:
  Allow the Arduino Leonardo to work by supporting CDC=0 devices.
  
  CDC=0 simply means "no command codes", CDC=1 means "AT command codes."
  There's no driver change required!  It's purely to tell the application
  layer whether to speak AT commands or not.  Things are all still serial.
  
  PR:   usb/183505
  Reviewed by:  hps
  MFC after:1 week

Modified:
  head/sys/dev/usb/serial/umodem.c
  head/sys/dev/usb/usb.h

Modified: head/sys/dev/usb/serial/umodem.c
==
--- head/sys/dev/usb/serial/umodem.cThu Oct 31 13:47:39 2013
(r257445)
+++ head/sys/dev/usb/serial/umodem.cThu Oct 31 13:54:51 2013
(r257446)
@@ -128,6 +128,9 @@ static const STRUCT_USB_HOST_ID umodem_d
{USB_IFACE_CLASS(UICLASS_CDC),
USB_IFACE_SUBCLASS(UISUBCLASS_ABSTRACT_CONTROL_MODEL),
USB_IFACE_PROTOCOL(UIPROTO_CDC_AT)},
+   {USB_IFACE_CLASS(UICLASS_CDC),
+   USB_IFACE_SUBCLASS(UISUBCLASS_ABSTRACT_CONTROL_MODEL),
+   USB_IFACE_PROTOCOL(UIPROTO_CDC_NONE)},
/* Huawei Modem class match */
{USB_IFACE_CLASS(UICLASS_CDC),
USB_IFACE_SUBCLASS(UISUBCLASS_ABSTRACT_CONTROL_MODEL),

Modified: head/sys/dev/usb/usb.h
==
--- head/sys/dev/usb/usb.h  Thu Oct 31 13:47:39 2013(r257445)
+++ head/sys/dev/usb/usb.h  Thu Oct 31 13:54:51 2013(r257446)
@@ -441,6 +441,7 @@ typedef struct usb_interface_assoc_descr
 #defineUISUBCLASS_ETHERNET_EMULATION_MODEL 12
 #defineUISUBCLASS_NETWORK_CONTROL_MODEL 13
 
+#defineUIPROTO_CDC_NONE0
 #defineUIPROTO_CDC_AT  1
 
 #defineUICLASS_HID 0x03
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257452 - head/sys/arm/freescale/imx

2013-10-31 Thread Ian Lepore
Author: ian
Date: Thu Oct 31 14:52:06 2013
New Revision: 257452
URL: http://svnweb.freebsd.org/changeset/base/257452

Log:
  Add support for the USB PHY on imx6 SoCs.  Pretty minimal at this point,
  but enough to get usb host mode working.

Added:
  head/sys/arm/freescale/imx/imx6_usbphy.c   (contents, props changed)

Added: head/sys/arm/freescale/imx/imx6_usbphy.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/freescale/imx/imx6_usbphy.cThu Oct 31 14:52:06 2013
(r257452)
@@ -0,0 +1,189 @@
+/*-
+ * Copyright (c) 2013 Ian Lepore 
+ * 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$");
+
+/*
+ * USBPHY driver for Freescale i.MX6 family of SoCs.
+ */
+
+#include "opt_bus.h"
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+
+/*
+ * Hardware register defines.
+ */
+#definePWD_REG 0x
+#defineCTRL_STATUS_REG 0x0030
+#defineCTRL_SET_REG0x0034
+#defineCTRL_CLR_REG0x0038
+#defineCTRL_TOGGLE_REG 0x003c
+#define  CTRL_SFTRST (1 << 31)
+#define  CTRL_CLKGATE(1 << 30)
+#define  CTRL_ENUTMILEVEL3   (1 << 15)
+#define  CTRL_ENUTMILEVEL2   (1 << 14)
+
+struct usbphy_softc {
+   device_tdev;
+   struct resource *mem_res;
+   u_int   phy_num;
+};
+
+static int
+usbphy_detach(device_t dev)
+{
+   struct usbphy_softc *sc;
+
+   sc = device_get_softc(dev);
+
+   if (sc->mem_res != NULL)
+   bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res);
+
+   return (0);
+}
+
+static int
+usbphy_attach(device_t dev)
+{
+   struct usbphy_softc *sc;
+   int err, regoff, rid;
+
+   sc = device_get_softc(dev);
+   err = 0;
+
+   /* Allocate bus_space resources. */
+   rid = 0;
+   sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
+   RF_ACTIVE);
+   if (sc->mem_res == NULL) {
+   device_printf(dev, "Cannot allocate memory resources\n");
+   err = ENXIO;
+   goto out;
+   }
+
+   /*
+* XXX Totally lame way to get the unit number (but not quite as lame as
+* adding an ad-hoc property to the fdt data).  This works as long as
+* this driver is used for imx6 only.
+*/
+   const uint32_t PWD_PHY1_REG_PHYSADDR = 0x020c9000;
+   if (BUS_SPACE_PHYSADDR(sc->mem_res, 0) == PWD_PHY1_REG_PHYSADDR) {
+   sc->phy_num = 0;
+   regoff = 0;
+   } else {
+   sc->phy_num = 1;
+   regoff = 0x60;
+   }
+
+   /*
+* Based on a note in the u-boot source code, disable charger detection
+* to avoid degrading the differential signaling on the DP line.  Note
+* that this disables (by design) both charger detection and contact
+* detection, because of the screwball mix of active-high and active-low
+* bits in this register.
+*/
+   imx6_anatop_write_4(IMX6_ANALOG_USB1_CHRG_DETECT + regoff, 
+   IMX6_ANALOG_USB_CHRG_DETECT_N_ENABLE | 
+   IMX6_ANALOG_USB_CHRG_DETECT_N_CHK_CHRG);
+
+   imx6_anatop_write_4(IMX6_ANALOG_USB1_CHRG_DETECT + regoff, 
+   IMX6_ANALOG_USB_CHRG_DETECT_N_ENABLE | 
+   IMX6_ANALOG_USB_CHRG_DETECT_N_CHK_CHRG);
+
+   /* XXX Configure the overcurrent detection here.

svn commit: r257453 - head/sys/arm/freescale/imx

2013-10-31 Thread Ian Lepore
Author: ian
Date: Thu Oct 31 15:04:23 2013
New Revision: 257453
URL: http://svnweb.freebsd.org/changeset/base/257453

Log:
  Add stubbed-out imx6 support for clocks and power management.  This
  contains little more than a few stub functions required to keep the
  linker happy, but it's enough to let early imx6 development proceed.

Added:
  head/sys/arm/freescale/imx/imx6_anatop.c   (contents, props changed)
  head/sys/arm/freescale/imx/imx6_anatopreg.h   (contents, props changed)
  head/sys/arm/freescale/imx/imx6_anatopvar.h   (contents, props changed)
  head/sys/arm/freescale/imx/imx6_ccm.c   (contents, props changed)
  head/sys/arm/freescale/imx/imx6_ccmreg.h   (contents, props changed)

Added: head/sys/arm/freescale/imx/imx6_anatop.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/freescale/imx/imx6_anatop.cThu Oct 31 15:04:23 2013
(r257453)
@@ -0,0 +1,155 @@
+/*-
+ * Copyright (c) 2013 Ian Lepore 
+ * 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$");
+
+/*
+ * Analog PLL and power regulator driver for Freescale i.MX6 family of SoCs.
+ *
+ * We don't really do anything with analog PLLs, but the registers for
+ * controlling them belong to the same block as the power regulator registers.
+ * Since the newbus hierarchy makes it hard for anyone other than us to get at
+ * them, we just export a couple public functions to allow the imx6 CCM clock
+ * driver to read and write those registers.
+ *
+ * We also don't do anything about power regulation yet, but when the need
+ * arises, this would be the place for that code to live.
+ *
+ * I have no idea where the "anatop" name comes from.  It's in the standard DTS
+ * source describing i.MX6 SoCs, and in the linux and u-boot code which comes
+ * from Freescale, but it's not in the SoC manual.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+
+struct imx6_anatop_softc {
+   device_tdev;
+   struct resource *mem_res;
+};
+
+static struct imx6_anatop_softc *imx6_anatop_sc;
+
+uint32_t
+imx6_anatop_read_4(bus_size_t offset)
+{
+
+   return (bus_read_4(imx6_anatop_sc->mem_res, offset));
+}
+
+void
+imx6_anatop_write_4(bus_size_t offset, uint32_t value)
+{
+
+   bus_write_4(imx6_anatop_sc->mem_res, offset, value);
+}
+
+static int
+imx6_anatop_detach(device_t dev)
+{
+   struct imx6_anatop_softc *sc;
+
+   sc = device_get_softc(dev);
+
+   if (sc->mem_res != NULL)
+   bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res);
+
+   return (0);
+}
+
+static int
+imx6_anatop_attach(device_t dev)
+{
+   struct imx6_anatop_softc *sc;
+   int err, rid;
+
+   sc = device_get_softc(dev);
+
+   /* Allocate bus_space resources. */
+   rid = 0;
+   sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
+   RF_ACTIVE);
+   if (sc->mem_res == NULL) {
+   device_printf(dev, "Cannot allocate memory resources\n");
+   err = ENXIO;
+   goto out;
+   }
+
+   imx6_anatop_sc = sc;
+   err = 0;
+
+out:
+
+   if (err != 0)
+   imx6_anatop_detach(dev);
+
+   return (err);
+}
+
+static int
+imx6_anatop_probe(device_t dev)
+{
+
+if (ofw_bus_is_compatible(dev, "fsl,imx6q-anatop") == 0)
+   return (ENXIO);
+
+   device_set_desc(dev, "Freescale i.MX6 Analog PLLs and Power");
+
+   return (BUS_PROBE_DEFAULT);
+}
+
+static device_method_t imx6_anatop_methods[] = {
+   /* Device interface */
+ 

svn commit: r257454 - head/sys/arm/freescale/imx

2013-10-31 Thread Ian Lepore
Author: ian
Date: Thu Oct 31 15:27:39 2013
New Revision: 257454
URL: http://svnweb.freebsd.org/changeset/base/257454

Log:
  Add sdhci driver glue for imx family SoCs.  This should support both uSDHC
  (newer SoCs) and eSDHC (older SoCs), but the eSDHC support is untested and
  likely to need some tweaking.

Added:
  head/sys/arm/freescale/imx/imx_sdhci.c   (contents, props changed)

Added: head/sys/arm/freescale/imx/imx_sdhci.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/freescale/imx/imx_sdhci.c  Thu Oct 31 15:27:39 2013
(r257454)
@@ -0,0 +1,704 @@
+/*-
+ * Copyright (c) 2013 Ian Lepore 
+ * 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$");
+
+/*
+ * SDHCI driver glue for Freescale i.MX SoC family.
+ *
+ * This supports both eSDHC (earlier SoCs) and uSDHC (more recent SoCs).
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include "sdhci_if.h"
+
+struct imx_sdhci_softc {
+   device_tdev;
+   struct resource *   mem_res;
+   struct resource *   irq_res;
+   void *  intr_cookie;
+   struct sdhci_slot   slot;
+   uint32_tbaseclk_hz;
+   uint32_tsdclockreg_freq_bits;
+   uint32_tcmd_and_mode;
+   uint32_tr1bfix_intmask;
+   uint8_t r1bfix_type;
+   uint8_t hwtype;
+};
+
+#defineR1BFIX_NONE 0   /* No fix needed at next interrupt. */
+#defineR1BFIX_NODATA   1   /* Synthesize DATA_END for R1B w/o 
data. */
+#defineR1BFIX_AC12 2   /* Wait for busy after auto command 12. 
*/
+
+#defineHWTYPE_NONE 0   /* Hardware not recognized/supported. */
+#defineHWTYPE_ESDHC1   /* imx5x and earlier. */
+#defineHWTYPE_USDHC2   /* imx6. */
+
+#defineSDHC_WTMK_LVL   0x44/* Watermark Level register. */
+#defineUSDHC_MIX_CONTROL   0x48/* Mix(ed) Control register. */
+#defineSDHC_VEND_SPEC  0xC0/* Vendor-specific register. */
+#define SDHC_VEND_FRC_SDCLK_ON (1 <<  8)
+#define SDHC_VEND_IPGEN(1 << 11)
+#define SDHC_VEND_HCKEN(1 << 12)
+#define SDHC_VEND_PEREN(1 << 13)
+
+#defineSDHC_PROT_CTRL  0x28
+#define SDHC_PROT_LED  (1 << 0)
+#define SDHC_PROT_WIDTH_1BIT   (0 << 1)
+#define SDHC_PROT_WIDTH_4BIT   (1 << 1)
+#define SDHC_PROT_WIDTH_8BIT   (2 << 1)
+#define SDHC_PROT_WIDTH_MASK   (3 << 1)
+#define SDHC_PROT_D3CD (1 << 3)
+#define SDHC_PROT_EMODE_BIG(0 << 4)
+#define SDHC_PROT_EMODE_HALF   (1 << 4)
+#define SDHC_PROT_EMODE_LITTLE (2 << 4)
+#define SDHC_PROT_EMODE_MASK   (3 << 4)
+#define SDHC_PROT_SDMA (0 << 8)
+#define SDHC_PROT_ADMA1(1 << 8)
+#define SDHC_PROT_ADMA2(2 << 8)
+#define SDHC_PROT_ADMA264  (3 << 8)
+#define SDHC_PROT_DMA_MASK (3 << 8)
+#define SDHC_PROT_CDTL (1 << 6)
+#define SDHC_PROT_CDSS (1 << 7)
+
+#defineSDHC_CLK_IPGEN  (1 << 0)
+#defineSDHC_CLK_HCKEN  (1 << 1)
+#defineSDHC_CLK_PEREN  (1 << 2)
+#defineSDHC_CLK_DIVISOR_MASK   0x00f0
+#defineSDHC_CL

svn commit: r257455 - head/sys/net

2013-10-31 Thread Andre Oppermann
Author: andre
Date: Thu Oct 31 15:46:10 2013
New Revision: 257455
URL: http://svnweb.freebsd.org/changeset/base/257455

Log:
  Make struct ifnet readable and comprehensible again by grouping
  and ordering related variables, fields and locks next to each
  other.  Add more comments to variables.
  
  Over time 'ifnet' has accumlated a lot of additional pointers and
  functionality in an unstructured way making it quite hard to read
  and understand while obfuscating relationships between fields and
  variables.
  
  Quantify the structure size and how bloated it has become.
  
  This is only a mechanical change in preparation for upcoming
  work to make ifnet opaque to drivers and to separate out the
  interface queuing.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/net/if_var.h

Modified: head/sys/net/if_var.h
==
--- head/sys/net/if_var.h   Thu Oct 31 15:27:39 2013(r257454)
+++ head/sys/net/if_var.h   Thu Oct 31 15:46:10 2013(r257455)
@@ -96,19 +96,42 @@ VNET_DECLARE(struct pfil_head, link_pfil
 /*
  * Structure defining a network interface.
  *
- * (Would like to call this struct ``if'', but C isn't PL/1.)
+ * Size ILP32:  592 (approx)
+ *  LP64: 1048 (approx)
  */
-
 struct ifnet {
+   /* General book keeping of interface lists. */
+   TAILQ_ENTRY(ifnet) if_link; /* all struct ifnets are chained */
+   LIST_ENTRY(ifnet) if_clones;/* interfaces of a cloner */
+   TAILQ_HEAD(, ifg_list) if_groups; /* linked list of groups per if */
+   /* protected by if_addr_lock */
+   u_char  if_alloctype;   /* if_type at time of allocation */
+
+   /* Driver and protocol specific information that remains stable. */
void*if_softc;  /* pointer to driver state */
+   void*if_llsoftc;/* link layer softc */
void*if_l2com;  /* pointer to protocol bits */
-   struct vnet *if_vnet;   /* pointer to network stack instance */
-   TAILQ_ENTRY(ifnet) if_link; /* all struct ifnets are chained */
-   charif_xname[IFNAMSIZ]; /* external name (name + unit) */
const char *if_dname;   /* driver name */
int if_dunit;   /* unit or IF_DUNIT_NONE */
+   u_short if_index;   /* numeric abbreviation for this if  */
+   short   if_index_reserved;  /* spare space to grow if_index */
+   charif_xname[IFNAMSIZ]; /* external name (name + unit) */
+   char*if_description;/* interface description */
+
+   /* Variable fields that are touched by the stack and drivers. */
+   int if_flags;   /* up/down, broadcast, etc. */
+   int if_capabilities;/* interface features & capabilities */
+   int if_capenable;   /* enabled features & capabilities */
+   void*if_linkmib;/* link-type-specific MIB data */
+   size_t  if_linkmiblen;  /* length of above data */
+   int if_drv_flags;   /* driver-managed status flags */
u_int   if_refcount;/* reference count */
-   struct  ifaddrhead if_addrhead; /* linked list of addresses per if */
+   struct  ifaltq if_snd;  /* output queue (includes altq) */
+   struct  if_data if_data;/* type information and statistics */
+   struct  task if_linktask;   /* task for link change events */
+
+   /* Addresses of different protocol families assigned to this if. */
+   struct  rwlock if_addr_lock;/* lock to protect address lists */
/*
 * if_addrhead is the list of all addresses associated to
 * an interface.
@@ -119,21 +142,29 @@ struct ifnet {
 * However, access to the AF_LINK address through this
 * field is deprecated. Use if_addr or ifaddr_byindex() instead.
 */
-   int if_pcount;  /* number of promiscuous listeners */
-   struct  carp_if *if_carp;   /* carp interface structure */
-   struct  bpf_if *if_bpf; /* packet filter structure */
-   u_short if_index;   /* numeric abbreviation for this if  */
-   short   if_index_reserved;  /* spare space to grow if_index */
-   struct  ifvlantrunk *if_vlantrunk; /* pointer to 802.1q data */
-   int if_flags;   /* up/down, broadcast, etc. */
-   int if_capabilities;/* interface features & capabilities */
-   int if_capenable;   /* enabled features & capabilities */
-   void*if_linkmib;/* link-type-specific MIB data */
-   size_t  if_linkmiblen;  /* length of above data */
-   struct  if_data if_data;
+   struct  ifaddrhead if_addrhead; /* linked list of addresses per if */
str

Re: svn commit: r257455 - head/sys/net

2013-10-31 Thread Luigi Rizzo
On Thu, Oct 31, 2013 at 03:46:10PM +, Andre Oppermann wrote:
> Author: andre
> Date: Thu Oct 31 15:46:10 2013
> New Revision: 257455
> URL: http://svnweb.freebsd.org/changeset/base/257455
> 
> Log:
>   Make struct ifnet readable and comprehensible again by grouping
>   and ordering related variables, fields and locks next to each
>   other.  Add more comments to variables.


>   Over time 'ifnet' has accumlated a lot of additional pointers and
>   functionality in an unstructured way making it quite hard to read
>   and understand while obfuscating relationships between fields and
>   variables.
>   
>   Quantify the structure size and how bloated it has become.
>   
>   This is only a mechanical change in preparation for upcoming
>   work to make ifnet opaque to drivers and to separate out the
>   interface queuing.

as you do the above I think it would make sense to replace
all int/short/long with fixed-size fields as appropriate
(and large enough) to make it easier to reason about things
such as 'how many flags can i stuff into a field'.

The "large enough" part refers to two things:
- bitfields containing flags or capabilities have a tendency
  to overflow (not just in freebsd, linux has the same)
  requiring KBI changes. We should probably go for 64 bits
  unless there are compelling space reasons (not for ifnet).

- it is useful if certain opaque fields (flow ids, cookies...)
  can store pointers. Once again, make them at least 64 bit helps

cheers
luigi

>   
>   Sponsored by:   The FreeBSD Foundation
> 
> Modified:
>   head/sys/net/if_var.h
> 
> Modified: head/sys/net/if_var.h
> ==
> --- head/sys/net/if_var.h Thu Oct 31 15:27:39 2013(r257454)
> +++ head/sys/net/if_var.h Thu Oct 31 15:46:10 2013(r257455)
> @@ -96,19 +96,42 @@ VNET_DECLARE(struct pfil_head, link_pfil
>  /*
>   * Structure defining a network interface.
>   *
> - * (Would like to call this struct ``if'', but C isn't PL/1.)
> + * Size ILP32:  592 (approx)
> + *LP64: 1048 (approx)
>   */
> -
>  struct ifnet {
> + /* General book keeping of interface lists. */
> + TAILQ_ENTRY(ifnet) if_link; /* all struct ifnets are chained */
> + LIST_ENTRY(ifnet) if_clones;/* interfaces of a cloner */
> + TAILQ_HEAD(, ifg_list) if_groups; /* linked list of groups per if */
> + /* protected by if_addr_lock */
> + u_char  if_alloctype;   /* if_type at time of allocation */
> +
> + /* Driver and protocol specific information that remains stable. */
>   void*if_softc;  /* pointer to driver state */
> + void*if_llsoftc;/* link layer softc */
>   void*if_l2com;  /* pointer to protocol bits */
> - struct vnet *if_vnet;   /* pointer to network stack instance */
> - TAILQ_ENTRY(ifnet) if_link; /* all struct ifnets are chained */
> - charif_xname[IFNAMSIZ]; /* external name (name + unit) */
>   const char *if_dname;   /* driver name */
>   int if_dunit;   /* unit or IF_DUNIT_NONE */
> + u_short if_index;   /* numeric abbreviation for this if  */
> + short   if_index_reserved;  /* spare space to grow if_index */
> + charif_xname[IFNAMSIZ]; /* external name (name + unit) */
> + char*if_description;/* interface description */
> +
> + /* Variable fields that are touched by the stack and drivers. */
> + int if_flags;   /* up/down, broadcast, etc. */
> + int if_capabilities;/* interface features & capabilities */
> + int if_capenable;   /* enabled features & capabilities */
> + void*if_linkmib;/* link-type-specific MIB data */
> + size_t  if_linkmiblen;  /* length of above data */
> + int if_drv_flags;   /* driver-managed status flags */
>   u_int   if_refcount;/* reference count */
> - struct  ifaddrhead if_addrhead; /* linked list of addresses per if */
> + struct  ifaltq if_snd;  /* output queue (includes altq) */
> + struct  if_data if_data;/* type information and statistics */
> + struct  task if_linktask;   /* task for link change events */
> +
> + /* Addresses of different protocol families assigned to this if. */
> + struct  rwlock if_addr_lock;/* lock to protect address lists */
>   /*
>* if_addrhead is the list of all addresses associated to
>* an interface.
> @@ -119,21 +142,29 @@ struct ifnet {
>* However, access to the AF_LINK address through this
>* field is deprecated. Use if_addr or ifaddr_byindex() instead.
>*/
> - int if_pcount;  /* number of promiscuous listeners */
> - struct  carp_if *if_carp;   /* carp inter

svn commit: r257462 - head/lib/libz

2013-10-31 Thread Ed Maste
Author: emaste
Date: Thu Oct 31 18:44:40 2013
New Revision: 257462
URL: http://svnweb.freebsd.org/changeset/base/257462

Log:
  Fix up FreeBSD tag for files not from a vendor branch
  
  Unexpand the tag, remove the fbsd:nokeywords property and add the
  svn:keywords property.  This should eliminate the gratuituous diffs
  that appear on these files in projects branches.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/lib/libz/FREEBSD-upgrade   (contents, props changed)
  head/lib/libz/Makefile   (contents, props changed)
  head/lib/libz/Symbol.map   (contents, props changed)
  head/lib/libz/Versions.def   (contents, props changed)
  head/lib/libz/zopen.c   (contents, props changed)

Modified: head/lib/libz/FREEBSD-upgrade
==
--- head/lib/libz/FREEBSD-upgrade   Thu Oct 31 18:11:50 2013
(r257461)
+++ head/lib/libz/FREEBSD-upgrade   Thu Oct 31 18:44:40 2013
(r257462)
@@ -1,4 +1,4 @@
-$FreeBSD: head/lib/libz/FREEBSD-upgrade 146082 2005-05-11 03:50:50Z kientzle $
+$FreeBSD$
 
 ZLib 1.2.2
 

Modified: head/lib/libz/Makefile
==
--- head/lib/libz/Makefile  Thu Oct 31 18:11:50 2013(r257461)
+++ head/lib/libz/Makefile  Thu Oct 31 18:44:40 2013(r257462)
@@ -1,5 +1,5 @@
 #
-# $FreeBSD: head/lib/libz/Makefile 232263 2012-02-28 18:30:18Z dim $
+# $FreeBSD$
 #
 
 LIB=   z

Modified: head/lib/libz/Symbol.map
==
--- head/lib/libz/Symbol.mapThu Oct 31 18:11:50 2013(r257461)
+++ head/lib/libz/Symbol.mapThu Oct 31 18:44:40 2013(r257462)
@@ -1,5 +1,5 @@
 /*
- * $FreeBSD: head/lib/libz/Symbol.map 206709 2010-04-16 20:07:24Z delphij $
+ * $FreeBSD$
  */
 
 ZLIB_1.2.7.1 {

Modified: head/lib/libz/Versions.def
==
--- head/lib/libz/Versions.def  Thu Oct 31 18:11:50 2013(r257461)
+++ head/lib/libz/Versions.def  Thu Oct 31 18:44:40 2013(r257462)
@@ -1,4 +1,4 @@
-# $FreeBSD: head/lib/libz/Versions.def 205486 2010-03-22 22:12:27Z delphij $
+# $FreeBSD$
 
 ZLIB_1.2.4.0 {
 };

Modified: head/lib/libz/zopen.c
==
--- head/lib/libz/zopen.c   Thu Oct 31 18:11:50 2013(r257461)
+++ head/lib/libz/zopen.c   Thu Oct 31 18:44:40 2013(r257462)
@@ -3,7 +3,7 @@
  */
 
 #include 
-__FBSDID("$FreeBSD: head/lib/libz/zopen.c 84228 2001-09-30 22:39:00Z dillon 
$");
+__FBSDID("$FreeBSD$");
 
 #include 
 #include 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257463 - head/contrib/binutils/binutils

2013-10-31 Thread Sean Bruno
Author: sbruno
Date: Thu Oct 31 18:53:13 2013
New Revision: 257463
URL: http://svnweb.freebsd.org/changeset/base/257463

Log:
  Queisce warning about attempting to add char * together and use explicit
  array indexing to indicate what is meant to be done

Modified:
  head/contrib/binutils/binutils/readelf.c

Modified: head/contrib/binutils/binutils/readelf.c
==
--- head/contrib/binutils/binutils/readelf.cThu Oct 31 18:44:40 2013
(r257462)
+++ head/contrib/binutils/binutils/readelf.cThu Oct 31 18:53:13 2013
(r257463)
@@ -7118,7 +7118,7 @@ process_symbol_table (FILE *file)
 
  n = print_vma (si, DEC_5);
  if (n < 5)
-   fputs (" " + n, stdout);
+   fputs (&" "[n], stdout);
  printf (" %3lu: ", hn);
  print_vma (psym->st_value, LONG_HEX);
  putchar (' ');
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257464 - head/contrib/binutils/opcodes

2013-10-31 Thread Sean Bruno
Author: sbruno
Date: Thu Oct 31 18:53:39 2013
New Revision: 257464
URL: http://svnweb.freebsd.org/changeset/base/257464

Log:
  Queisce warning about attempting to add char * together and use explicit
  array indexing to indicate what is meant to be done

Modified:
  head/contrib/binutils/opcodes/i386-dis.c

Modified: head/contrib/binutils/opcodes/i386-dis.c
==
--- head/contrib/binutils/opcodes/i386-dis.cThu Oct 31 18:53:13 2013
(r257463)
+++ head/contrib/binutils/opcodes/i386-dis.cThu Oct 31 18:53:39 2013
(r257464)
@@ -3474,7 +3474,7 @@ static bfd_vma start_pc;
  * The function returns the length of this instruction in bytes.
  */
 
-static char intel_syntax;
+static int intel_syntax;
 static char open_char;
 static char close_char;
 static char separator_char;
@@ -3547,7 +3547,7 @@ print_insn (bfd_vma pc, disassemble_info
   else
 address_mode = mode_32bit;
 
-  if (intel_syntax == (char) -1)
+  if (intel_syntax == -1)
 intel_syntax = (info->mach == bfd_mach_i386_i386_intel_syntax
|| info->mach == bfd_mach_x86_64_intel_syntax);
 
@@ -4326,7 +4326,7 @@ dofloat (int sizeflag)
 static void
 OP_ST (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
 {
-  oappend ("%st" + intel_syntax);
+  oappend (&"%st"[intel_syntax]);
 }
 
 static void
@@ -4677,32 +4677,32 @@ append_seg (void)
   if (prefixes & PREFIX_CS)
 {
   used_prefixes |= PREFIX_CS;
-  oappend ("%cs:" + intel_syntax);
+  oappend (&"%cs:"[intel_syntax]);
 }
   if (prefixes & PREFIX_DS)
 {
   used_prefixes |= PREFIX_DS;
-  oappend ("%ds:" + intel_syntax);
+  oappend (&"%ds:"[intel_syntax]);
 }
   if (prefixes & PREFIX_SS)
 {
   used_prefixes |= PREFIX_SS;
-  oappend ("%ss:" + intel_syntax);
+  oappend (&"%ss:"[intel_syntax]);
 }
   if (prefixes & PREFIX_ES)
 {
   used_prefixes |= PREFIX_ES;
-  oappend ("%es:" + intel_syntax);
+  oappend (&"%es:"[intel_syntax]);
 }
   if (prefixes & PREFIX_FS)
 {
   used_prefixes |= PREFIX_FS;
-  oappend ("%fs:" + intel_syntax);
+  oappend (&"%fs:"[intel_syntax]);
 }
   if (prefixes & PREFIX_GS)
 {
   used_prefixes |= PREFIX_GS;
-  oappend ("%gs:" + intel_syntax);
+  oappend (&"%gs:"[intel_syntax]);
 }
 }
 
@@ -5474,7 +5474,7 @@ OP_I (int bytemode, int sizeflag)
   op &= mask;
   scratchbuf[0] = '$';
   print_operand_value (scratchbuf + 1, 1, op);
-  oappend (scratchbuf + intel_syntax);
+  oappend (&scratchbuf[intel_syntax]);
   scratchbuf[0] = '\0';
 }
 
@@ -5525,7 +5525,7 @@ OP_I64 (int bytemode, int sizeflag)
   op &= mask;
   scratchbuf[0] = '$';
   print_operand_value (scratchbuf + 1, 1, op);
-  oappend (scratchbuf + intel_syntax);
+  oappend (&scratchbuf[intel_syntax]);
   scratchbuf[0] = '\0';
 }
 
@@ -5575,7 +5575,7 @@ OP_sI (int bytemode, int sizeflag)
 
   scratchbuf[0] = '$';
   print_operand_value (scratchbuf + 1, 1, op);
-  oappend (scratchbuf + intel_syntax);
+  oappend (&scratchbuf[intel_syntax]);
 }
 
 static void
@@ -5755,7 +5755,7 @@ OP_ESreg (int code, int sizeflag)
  intel_operand_size (b_mode, sizeflag);
}
 }
-  oappend ("%es:" + intel_syntax);
+  oappend (&"%es:"[intel_syntax]);
   ptr_reg (code, sizeflag);
 }
 
@@ -5805,7 +5805,7 @@ OP_C (int dummy ATTRIBUTE_UNUSED, int si
   add = 8;
 }
   sprintf (scratchbuf, "%%cr%d", modrm.reg + add);
-  oappend (scratchbuf + intel_syntax);
+  oappend (&scratchbuf[intel_syntax]);
 }
 
 static void
@@ -5826,7 +5826,7 @@ static void
 OP_T (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
 {
   sprintf (scratchbuf, "%%tr%d", modrm.reg);
-  oappend (scratchbuf + intel_syntax);
+  oappend (&scratchbuf[intel_syntax]);
 }
 
 static void
@@ -5852,7 +5852,7 @@ OP_MMX (int bytemode ATTRIBUTE_UNUSED, i
 }
   else
 sprintf (scratchbuf, "%%mm%d", modrm.reg);
-  oappend (scratchbuf + intel_syntax);
+  oappend (&scratchbuf[intel_syntax]);
 }
 
 static void
@@ -5863,7 +5863,7 @@ OP_XMM (int bytemode ATTRIBUTE_UNUSED, i
   if (rex & REX_R)
 add = 8;
   sprintf (scratchbuf, "%%xmm%d", modrm.reg + add);
-  oappend (scratchbuf + intel_syntax);
+  oappend (&scratchbuf[intel_syntax]);
 }
 
 static void
@@ -5895,7 +5895,7 @@ OP_EM (int bytemode, int sizeflag)
 }
   else
 sprintf (scratchbuf, "%%mm%d", modrm.rm);
-  oappend (scratchbuf + intel_syntax);
+  oappend (&scratchbuf[intel_syntax]);
 }
 
 /* cvt* are the only instructions in sse2 which have
@@ -5922,7 +5922,7 @@ OP_EMC (int bytemode, int sizeflag)
   codep++;
   used_prefixes |= (prefixes & PREFIX_DATA);
   sprintf (scratchbuf, "%%mm%d", modrm.rm);
-  oappend (scratchbuf + intel_syntax);
+  oappend (&scratchbuf[intel_syntax]);
 }
 
 static void
@@ -5930,7 +5930,7 @@ OP_MXC (int bytemode ATTRIBUTE_UNUSED, i
 {
   used_prefixes |= (prefixes & PREFIX_DATA);
   sprintf (scratchbuf, "%%mm%d", modrm.reg);
-  oappend (sc

Re: svn commit: r257455 - head/sys/net

2013-10-31 Thread Andre Oppermann

On 31.10.2013 19:03, Luigi Rizzo wrote:

On Thu, Oct 31, 2013 at 03:46:10PM +, Andre Oppermann wrote:

Author: andre
Date: Thu Oct 31 15:46:10 2013
New Revision: 257455
URL: http://svnweb.freebsd.org/changeset/base/257455

Log:
   Make struct ifnet readable and comprehensible again by grouping
   and ordering related variables, fields and locks next to each
   other.  Add more comments to variables.




   Over time 'ifnet' has accumlated a lot of additional pointers and
   functionality in an unstructured way making it quite hard to read
   and understand while obfuscating relationships between fields and
   variables.

   Quantify the structure size and how bloated it has become.

   This is only a mechanical change in preparation for upcoming
   work to make ifnet opaque to drivers and to separate out the
   interface queuing.


as you do the above I think it would make sense to replace
all int/short/long with fixed-size fields as appropriate
(and large enough) to make it easier to reason about things
such as 'how many flags can i stuff into a field'.

The "large enough" part refers to two things:
- bitfields containing flags or capabilities have a tendency
   to overflow (not just in freebsd, linux has the same)
   requiring KBI changes. We should probably go for 64 bits
   unless there are compelling space reasons (not for ifnet).


Gleb will handle most of that and it is going to be part of the making
ifnet opaque to drivers.


- it is useful if certain opaque fields (flow ids, cookies...)
   can store pointers. Once again, make them at least 64 bit helps


A number of mbuf header fields have this property now. :)

--
Andre

___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r257376 - head/usr.bin/netstat

2013-10-31 Thread John Baldwin
On Wednesday, October 30, 2013 4:13:43 am Gleb Smirnoff wrote:
> Author: glebius
> Date: Wed Oct 30 08:13:42 2013
> New Revision: 257376
> URL: http://svnweb.freebsd.org/changeset/base/257376
> 
> Log:
>   'netstat -i' no longer supports working on a vmcore.

Please remove it from crashinfo then.  It would be nice to avoid breaking the 
commands in crashinfo unnecessarily when possible.

-- 
John Baldwin
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r257455 - head/sys/net

2013-10-31 Thread Ian Lepore
On Thu, 2013-10-31 at 20:08 +0100, Andre Oppermann wrote:
> On 31.10.2013 19:03, Luigi Rizzo wrote:
> > On Thu, Oct 31, 2013 at 03:46:10PM +, Andre Oppermann wrote:
> >> Author: andre
> >> Date: Thu Oct 31 15:46:10 2013
> >> New Revision: 257455
> >> URL: http://svnweb.freebsd.org/changeset/base/257455
> >>
> >> Log:
> >>Make struct ifnet readable and comprehensible again by grouping
> >>and ordering related variables, fields and locks next to each
> >>other.  Add more comments to variables.
> >
> >
> >>Over time 'ifnet' has accumlated a lot of additional pointers and
> >>functionality in an unstructured way making it quite hard to read
> >>and understand while obfuscating relationships between fields and
> >>variables.
> >>
> >>Quantify the structure size and how bloated it has become.
> >>
> >>This is only a mechanical change in preparation for upcoming
> >>work to make ifnet opaque to drivers and to separate out the
> >>interface queuing.
> >
> > as you do the above I think it would make sense to replace
> > all int/short/long with fixed-size fields as appropriate
> > (and large enough) to make it easier to reason about things
> > such as 'how many flags can i stuff into a field'.
> >
> > The "large enough" part refers to two things:
> > - bitfields containing flags or capabilities have a tendency
> >to overflow (not just in freebsd, linux has the same)
> >requiring KBI changes. We should probably go for 64 bits
> >unless there are compelling space reasons (not for ifnet).
> 
> Gleb will handle most of that and it is going to be part of the making
> ifnet opaque to drivers.
> 
> > - it is useful if certain opaque fields (flow ids, cookies...)
> >can store pointers. Once again, make them at least 64 bit helps
> 
> A number of mbuf header fields have this property now. :)
> 

Is there any chance all this reworking might get us to a position where
the protocol header in an mbuf doesn't have to be 32-bit aligned
anymore?  We pay a pretty heavy price for that requirement in the
drivers of the least capable hardware we support, the systems that have
the least horsepower to spare to make an extra copy of each packet to
realign it.

-- Ian


___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257465 - head/share/misc

2013-10-31 Thread Mikolaj Golub
Author: trociny
Date: Thu Oct 31 19:55:36 2013
New Revision: 257465
URL: http://svnweb.freebsd.org/changeset/base/257465

Log:
  Add myself as a ports committer
  
  Approved by:  bdrewery (mentor)

Modified:
  head/share/misc/committers-ports.dot

Modified: head/share/misc/committers-ports.dot
==
--- head/share/misc/committers-ports.dotThu Oct 31 18:53:39 2013
(r257464)
+++ head/share/misc/committers-ports.dotThu Oct 31 19:55:36 2013
(r257465)
@@ -207,6 +207,7 @@ tmclaugh [label="Tom McLaughlin\ntmclaug
 tota [label="TAKATSU Tomonari\nt...@freebsd.org\n2009/03/30"]
 trasz [label="Edward Tomasz Napierala\ntr...@freebsd.org\n2007/04/12"]
 trhodes [label="Tom Rhodes\ntrho...@freebsd.org\n2004/07/06"]
+trociny [label="Mikolaj Golub\ntroc...@freebsd.org\n2013/10/17"]
 uqs [label="Ulrich Spoerlein\n...@freebsd.org\n2012/01/19"]
 vd [label="Vasil Dimov\n...@freebsd.org\n2006/01/19"]
 vg [label="Veniamin Gvozdikov\n...@freebsd.org\n2013/06/11"]
@@ -246,6 +247,7 @@ avilla -> jhale
 avilla -> rakuco
 
 bdrewery -> dbn
+bdrewery -> trociny
 
 bapt -> bdrewery
 bapt -> eadler
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r257455 - head/sys/net

2013-10-31 Thread Luigi Rizzo
On Thu, Oct 31, 2013 at 01:27:25PM -0600, Ian Lepore wrote:
...
> Is there any chance all this reworking might get us to a position where
> the protocol header in an mbuf doesn't have to be 32-bit aligned
> anymore?  We pay a pretty heavy price for that requirement in the
> drivers of the least capable hardware we support, the systems that have
> the least horsepower to spare to make an extra copy of each packet to
> realign it.

So are you suggesting to use some 'copy_unaligned_32()' function/macro to
access 32-bit protocol fields in the network stack ?
(16-bit entries should not be an issue)

cheers
luigi
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257466 - in head/contrib/libpcap: . bpf/net pcap

2013-10-31 Thread Sean Bruno
Author: sbruno
Date: Thu Oct 31 20:03:59 2013
New Revision: 257466
URL: http://svnweb.freebsd.org/changeset/base/257466

Log:
  Integrate github revision 0446821e49224c6a29be28760cc9c4cc14f56d8a as
  suggested by upstream
  
  https://github.com/the-tcpdump-group/libpcap/issues/327
  
  Quiesce assignment warnings by use of const

Modified:
  head/contrib/libpcap/bpf/net/bpf_filter.c
  head/contrib/libpcap/bpf_dump.c
  head/contrib/libpcap/bpf_image.c
  head/contrib/libpcap/pcap/bpf.h
  head/contrib/libpcap/pcap/pcap.h

Modified: head/contrib/libpcap/bpf/net/bpf_filter.c
==
--- head/contrib/libpcap/bpf/net/bpf_filter.c   Thu Oct 31 19:55:36 2013
(r257465)
+++ head/contrib/libpcap/bpf/net/bpf_filter.c   Thu Oct 31 20:03:59 2013
(r257466)
@@ -209,8 +209,8 @@ m_xhalf(m, k, err)
  */
 u_int
 bpf_filter(pc, p, wirelen, buflen)
-   register struct bpf_insn *pc;
-   register u_char *p;
+   register const struct bpf_insn *pc;
+   register const u_char *p;
u_int wirelen;
register u_int buflen;
 {

Modified: head/contrib/libpcap/bpf_dump.c
==
--- head/contrib/libpcap/bpf_dump.c Thu Oct 31 19:55:36 2013
(r257465)
+++ head/contrib/libpcap/bpf_dump.c Thu Oct 31 20:03:59 2013
(r257466)
@@ -31,7 +31,7 @@ static const char rcsid[] _U_ =
 #include 
 
 void
-bpf_dump(struct bpf_program *p, int option)
+bpf_dump(const struct bpf_program *p, int option)
 {
const struct bpf_insn *insn;
int i;

Modified: head/contrib/libpcap/bpf_image.c
==
--- head/contrib/libpcap/bpf_image.cThu Oct 31 19:55:36 2013
(r257465)
+++ head/contrib/libpcap/bpf_image.cThu Oct 31 20:03:59 2013
(r257466)
@@ -53,7 +53,7 @@ static const char rcsid[] _U_ =
 
 char *
 bpf_image(p, n)
-   struct bpf_insn *p;
+   const struct bpf_insn *p;
int n;
 {
int v;

Modified: head/contrib/libpcap/pcap/bpf.h
==
--- head/contrib/libpcap/pcap/bpf.h Thu Oct 31 19:55:36 2013
(r257465)
+++ head/contrib/libpcap/pcap/bpf.h Thu Oct 31 20:03:59 2013
(r257466)
@@ -1285,7 +1285,7 @@ struct bpf_insn {
 
 #if __STDC__ || defined(__cplusplus)
 extern int bpf_validate(const struct bpf_insn *, int);
-extern u_int bpf_filter(struct bpf_insn *, u_char *, u_int, u_int);
+extern u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int);
 #else
 extern int bpf_validate();
 extern u_int bpf_filter();

Modified: head/contrib/libpcap/pcap/pcap.h
==
--- head/contrib/libpcap/pcap/pcap.hThu Oct 31 19:55:36 2013
(r257465)
+++ head/contrib/libpcap/pcap/pcap.hThu Oct 31 20:03:59 2013
(r257466)
@@ -409,11 +409,11 @@ const char *pcap_lib_version(void);
  * declared when we build pcap-bpf.c.
  */
 #ifndef __NetBSD__
-u_int  bpf_filter(struct bpf_insn *, u_char *, u_int, u_int); 
+u_int  bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int); 
 #endif
 intbpf_validate(const struct bpf_insn *f, int len);
-char   *bpf_image(struct bpf_insn *, int);
-void   bpf_dump(struct bpf_program *, int);
+char   *bpf_image(const struct bpf_insn *, int);
+void   bpf_dump(const struct bpf_program *, int);
 
 #if defined(WIN32)
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r257455 - head/sys/net

2013-10-31 Thread Ian Lepore
On Thu, 2013-10-31 at 21:05 +0100, Luigi Rizzo wrote:
> On Thu, Oct 31, 2013 at 01:27:25PM -0600, Ian Lepore wrote:
> ...
> > Is there any chance all this reworking might get us to a position where
> > the protocol header in an mbuf doesn't have to be 32-bit aligned
> > anymore?  We pay a pretty heavy price for that requirement in the
> > drivers of the least capable hardware we support, the systems that have
> > the least horsepower to spare to make an extra copy of each packet to
> > realign it.
> 
> So are you suggesting to use some 'copy_unaligned_32()' function/macro to
> access 32-bit protocol fields in the network stack ?
> (16-bit entries should not be an issue)
> 
> cheers
> luigi

Or if not that (I have no idea how frequently those fields are accessed
and what the performance penalty would be on systems moving a LOT of
packets), then a compromise might be a flag the driver can set to say it
may provide unaligned incoming packets.  Then we could have common code
at just one place in the network stack to split the mbuf and
realign-copy just the protocol header part to a new mbuf and attach it
to the front of the chain.  That would minimize both duplicated code and
the amount of data that has to be copied, and would put knowledge like
"how big is the protocol header that needs copying?" in a place that
knows more about protocols.

I know pretty much nothing about what happens in the network stack after
I feed a packet to if_input(), so maybe this is all impractical.  But I
also know that ARM systems with strict alignment constraints spend a lot
of time copying the entire contents of every incoming packet to realign
it, and it would be a lot better if they were able to DMA directly into
an mbuf cluster that can handed up the stack.  Even if "copy the entire
packet" is the only thing if_input() could do, there might still be some
benefit in having one common piece of code for it.

-- Ian


___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257469 - head/usr.sbin/crashinfo

2013-10-31 Thread Gleb Smirnoff
Author: glebius
Date: Thu Oct 31 20:30:56 2013
New Revision: 257469
URL: http://svnweb.freebsd.org/changeset/base/257469

Log:
  Remove 'netstat -i' from crashinfo, as this no longer is supported.

Modified:
  head/usr.sbin/crashinfo/crashinfo.sh

Modified: head/usr.sbin/crashinfo/crashinfo.sh
==
--- head/usr.sbin/crashinfo/crashinfo.shThu Oct 31 20:30:26 2013
(r257468)
+++ head/usr.sbin/crashinfo/crashinfo.shThu Oct 31 20:30:56 2013
(r257469)
@@ -268,12 +268,6 @@ netstat -M $VMCORE -N $KERNEL -m
 echo
 
 echo ""
-echo "netstat -idW"
-echo
-netstat -M $VMCORE -N $KERNEL -idW
-echo
-
-echo ""
 echo "netstat -anr"
 echo
 netstat -M $VMCORE -N $KERNEL -anr
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257472 - head/sys/kern

2013-10-31 Thread Maksim Yevmenkin
Author: emax
Date: Thu Oct 31 20:33:21 2013
New Revision: 257472
URL: http://svnweb.freebsd.org/changeset/base/257472

Log:
  Rate limit (to once per minute) "Listen queue overflow" message in
  sonewconn().
  
  Reviewed by:  scottl, lstewart
  Obtained from:Netflix, Inc
  MFC after:2 weeks

Modified:
  head/sys/kern/uipc_socket.c

Modified: head/sys/kern/uipc_socket.c
==
--- head/sys/kern/uipc_socket.c Thu Oct 31 20:32:11 2013(r257471)
+++ head/sys/kern/uipc_socket.c Thu Oct 31 20:33:21 2013(r257472)
@@ -486,6 +486,10 @@ SYSCTL_INT(_regression, OID_AUTO, sonewc
 struct socket *
 sonewconn(struct socket *head, int connstatus)
 {
+   static struct timeval lastover;
+   static struct timeval overinterval = { 60, 0 };
+   static int overcount;
+
struct socket *so;
int over;
 
@@ -497,9 +501,17 @@ sonewconn(struct socket *head, int conns
 #else
if (over) {
 #endif
-   log(LOG_DEBUG, "%s: pcb %p: Listen queue overflow: "
-   "%i already in queue awaiting acceptance\n",
-   __func__, head->so_pcb, head->so_qlen);
+   overcount++;
+
+   if (ratecheck(&lastover, &overinterval)) {
+   log(LOG_DEBUG, "%s: pcb %p: Listen queue overflow: "
+   "%i already in queue awaiting acceptance "
+   "(%d occurrences)\n",
+   __func__, head->so_pcb, head->so_qlen, overcount);
+
+   overcount = 0;
+   }
+
return (NULL);
}
VNET_ASSERT(head->so_vnet != NULL, ("%s:%d so_vnet is NULL, head=%p",
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257473 - head/sys/powerpc/pseries

2013-10-31 Thread Andreas Tobler
Author: andreast
Date: Thu Oct 31 20:42:47 2013
New Revision: 257473
URL: http://svnweb.freebsd.org/changeset/base/257473

Log:
  Ouch, do the shift properly. An uin64_t needs the right postfix when shifting.

Modified:
  head/sys/powerpc/pseries/mmu_phyp.c

Modified: head/sys/powerpc/pseries/mmu_phyp.c
==
--- head/sys/powerpc/pseries/mmu_phyp.c Thu Oct 31 20:33:21 2013
(r257472)
+++ head/sys/powerpc/pseries/mmu_phyp.c Thu Oct 31 20:42:47 2013
(r257473)
@@ -166,7 +166,7 @@ mphyp_bootstrap(mmu_t mmup, vm_offset_t 
}
}
moea64_large_page_shift = shift;
-   moea64_large_page_size = 1 << shift;
+   moea64_large_page_size = 1ULL << shift;
}
 
moea64_mid_bootstrap(mmup, kernelstart, kernelend);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r257455 - head/sys/net

2013-10-31 Thread John-Mark Gurney
Luigi Rizzo wrote this message on Thu, Oct 31, 2013 at 21:05 +0100:
> On Thu, Oct 31, 2013 at 01:27:25PM -0600, Ian Lepore wrote:
> ...
> > Is there any chance all this reworking might get us to a position where
> > the protocol header in an mbuf doesn't have to be 32-bit aligned
> > anymore?  We pay a pretty heavy price for that requirement in the
> > drivers of the least capable hardware we support, the systems that have
> > the least horsepower to spare to make an extra copy of each packet to
> > realign it.
> 
> So are you suggesting to use some 'copy_unaligned_32()' function/macro to
> access 32-bit protocol fields in the network stack ?
> (16-bit entries should not be an issue)

my idea has been to make a change to the various ip/tcp/udp layers
that is dependant upon __NO_STRICT_ALIGNMENT and if we do require
strict alignment to copy the header to a stack buffer to align the
data...

Apparently someone started work on this and created IP_HDR_ALIGNED_P,
though it's apparently only used in if_bridge, and why it's necessary,
I'm not sure...

I know ARMv4 takes a serious performance hit because of this... Often
the machines that doesn't support unaligned accesses also have bad
DMA engines that can't do DMA to two byte boundaries forcing us to
copy the packet by using bounce pages...

I haven't audited AVILA to see if it has the issue, but I know that
the TS-7200 port I was working on has this issue...

-- 
  John-Mark Gurney  Voice: +1 415 225 5579

 "All that I will do, has been done, All that I have, has not."
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r257455 - head/sys/net

2013-10-31 Thread Luigi Rizzo
On Thu, Oct 31, 2013 at 01:49:16PM -0700, John-Mark Gurney wrote:
> Luigi Rizzo wrote this message on Thu, Oct 31, 2013 at 21:05 +0100:
> > On Thu, Oct 31, 2013 at 01:27:25PM -0600, Ian Lepore wrote:
> > ...
> > > Is there any chance all this reworking might get us to a position where
> > > the protocol header in an mbuf doesn't have to be 32-bit aligned
> > > anymore?  We pay a pretty heavy price for that requirement in the
> > > drivers of the least capable hardware we support, the systems that have
> > > the least horsepower to spare to make an extra copy of each packet to
> > > realign it.
> > 
> > So are you suggesting to use some 'copy_unaligned_32()' function/macro to
> > access 32-bit protocol fields in the network stack ?
> > (16-bit entries should not be an issue)
> 
> my idea has been to make a change to the various ip/tcp/udp layers
> that is dependant upon __NO_STRICT_ALIGNMENT and if we do require
> strict alignment to copy the header to a stack buffer to align the
> data...

I'd rather use accessors functions/macros to read/write
the unaligned headers so we can hide the #ifdefs in only
one place.

The copy to a stack buffer is probably useful even for readability
regardless of alignment (i do this in ipfw so i parse the
packet only once, and those values are used often),
but we should be careful to keep the copy in
sync with the original in places where those headers are modified
(NAT, ipfw fwd, maybe somewhere else ?)

cheers
luigi
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r257455 - head/sys/net

2013-10-31 Thread John-Mark Gurney
Luigi Rizzo wrote this message on Thu, Oct 31, 2013 at 22:13 +0100:
> On Thu, Oct 31, 2013 at 01:49:16PM -0700, John-Mark Gurney wrote:
> > Luigi Rizzo wrote this message on Thu, Oct 31, 2013 at 21:05 +0100:
> > > On Thu, Oct 31, 2013 at 01:27:25PM -0600, Ian Lepore wrote:
> > > ...
> > > > Is there any chance all this reworking might get us to a position where
> > > > the protocol header in an mbuf doesn't have to be 32-bit aligned
> > > > anymore?  We pay a pretty heavy price for that requirement in the
> > > > drivers of the least capable hardware we support, the systems that have
> > > > the least horsepower to spare to make an extra copy of each packet to
> > > > realign it.
> > > 
> > > So are you suggesting to use some 'copy_unaligned_32()' function/macro to
> > > access 32-bit protocol fields in the network stack ?
> > > (16-bit entries should not be an issue)
> > 
> > my idea has been to make a change to the various ip/tcp/udp layers
> > that is dependant upon __NO_STRICT_ALIGNMENT and if we do require
> > strict alignment to copy the header to a stack buffer to align the
> > data...
> 
> I'd rather use accessors functions/macros to read/write
> the unaligned headers so we can hide the #ifdefs in only
> one place.

I am/was trying to prevent massive code curn...

> The copy to a stack buffer is probably useful even for readability

Oh, I also realized I left out another part of it...

void
ip_input(struct mbuf *m)
{
#ifndef __NO_STRICT_ALIGNMENT
struct ip tmpip;
#endif
struct ip *ip = NULL;

#ifndef __NO_STRICT_ALIGNMENT
bcopy(mtod(m, struct ip *), &tmpip, sizeof tmpip);
ip = &tmpip;
#else
ip = mtod(m, struct ip *);
#endif

}
> regardless of alignment (i do this in ipfw so i parse the
> packet only once, and those values are used often),
> but we should be careful to keep the copy in
> sync with the original in places where those headers are modified
> (NAT, ipfw fwd, maybe somewhere else ?)

If you modify the packet, you need to be careful to write back the
data when needed, i.e. passing the mbuf to another layer or
returning..  But that isn't anything too different than other
functions...

Looks like I'll have to revive my TS-7200 port for testing as npe on
AVILA apparently can handle the slightly odd alignment...

-- 
  John-Mark Gurney  Voice: +1 415 225 5579

 "All that I will do, has been done, All that I have, has not."
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r257455 - head/sys/net

2013-10-31 Thread Andre Oppermann

On 31.10.2013 20:27, Ian Lepore wrote:

On Thu, 2013-10-31 at 20:08 +0100, Andre Oppermann wrote:

On 31.10.2013 19:03, Luigi Rizzo wrote:

On Thu, Oct 31, 2013 at 03:46:10PM +, Andre Oppermann wrote:

Author: andre
Date: Thu Oct 31 15:46:10 2013
New Revision: 257455
URL: http://svnweb.freebsd.org/changeset/base/257455

Log:
Make struct ifnet readable and comprehensible again by grouping
and ordering related variables, fields and locks next to each
other.  Add more comments to variables.




Over time 'ifnet' has accumlated a lot of additional pointers and
functionality in an unstructured way making it quite hard to read
and understand while obfuscating relationships between fields and
variables.

Quantify the structure size and how bloated it has become.

This is only a mechanical change in preparation for upcoming
work to make ifnet opaque to drivers and to separate out the
interface queuing.


as you do the above I think it would make sense to replace
all int/short/long with fixed-size fields as appropriate
(and large enough) to make it easier to reason about things
such as 'how many flags can i stuff into a field'.

The "large enough" part refers to two things:
- bitfields containing flags or capabilities have a tendency
to overflow (not just in freebsd, linux has the same)
requiring KBI changes. We should probably go for 64 bits
unless there are compelling space reasons (not for ifnet).


Gleb will handle most of that and it is going to be part of the making
ifnet opaque to drivers.


- it is useful if certain opaque fields (flow ids, cookies...)
can store pointers. Once again, make them at least 64 bit helps


A number of mbuf header fields have this property now. :)


Is there any chance all this reworking might get us to a position where
the protocol header in an mbuf doesn't have to be 32-bit aligned
anymore?  We pay a pretty heavy price for that requirement in the
drivers of the least capable hardware we support, the systems that have
the least horsepower to spare to make an extra copy of each packet to
realign it.


That's a totally different issue.  Here we're talking about kernel
structures including the fields in struct mbuf.  It is totally not
related to any payload packet headers inside the mbuf data section.

The problem you're complaining about is the epic design mistake of
the ethernet header neither being a power of two nor divisible by
4 or 8 bytes.  It is a ridiculous 14 bytes.

Many DMA engines are capable of starting on any byte.  Some (popular)
are not.  If they are, the start of the payload can be by shifted by
two so that the IP headers are 32bit aligned in memory.  If that is
not possible either the payload has to be copy-aligned or direct
payload to structure casting must be disallowed, or indirected through
a macro.

--
Andre

___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r257455 - head/sys/net

2013-10-31 Thread Andre Oppermann

On 31.10.2013 21:15, Ian Lepore wrote:

On Thu, 2013-10-31 at 21:05 +0100, Luigi Rizzo wrote:

On Thu, Oct 31, 2013 at 01:27:25PM -0600, Ian Lepore wrote:
...

Is there any chance all this reworking might get us to a position where
the protocol header in an mbuf doesn't have to be 32-bit aligned
anymore?  We pay a pretty heavy price for that requirement in the
drivers of the least capable hardware we support, the systems that have
the least horsepower to spare to make an extra copy of each packet to
realign it.


So are you suggesting to use some 'copy_unaligned_32()' function/macro to
access 32-bit protocol fields in the network stack ?
(16-bit entries should not be an issue)

cheers
luigi


Or if not that (I have no idea how frequently those fields are accessed
and what the performance penalty would be on systems moving a LOT of
packets), then a compromise might be a flag the driver can set to say it
may provide unaligned incoming packets.  Then we could have common code
at just one place in the network stack to split the mbuf and
realign-copy just the protocol header part to a new mbuf and attach it
to the front of the chain.  That would minimize both duplicated code and
the amount of data that has to be copied, and would put knowledge like
"how big is the protocol header that needs copying?" in a place that
knows more about protocols.


This is a sensible idea and in fact how some of the drivers already do
it internally for strict alignment architectures.


I know pretty much nothing about what happens in the network stack after
I feed a packet to if_input(), so maybe this is all impractical.  But I
also know that ARM systems with strict alignment constraints spend a lot
of time copying the entire contents of every incoming packet to realign
it, and it would be a lot better if they were able to DMA directly into
an mbuf cluster that can handed up the stack.  Even if "copy the entire
packet" is the only thing if_input() could do, there might still be some
benefit in having one common piece of code for it.


We have tons of protocols using direct structure casting into the mbuf
payload.  Changing them all would be a huge task and in many cases also
change the way the code is structured.

--
Andre

___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r257455 - head/sys/net

2013-10-31 Thread Ian Lepore
On Thu, 2013-10-31 at 23:17 +0100, Andre Oppermann wrote:
> On 31.10.2013 20:27, Ian Lepore wrote:
> > On Thu, 2013-10-31 at 20:08 +0100, Andre Oppermann wrote:
> >> On 31.10.2013 19:03, Luigi Rizzo wrote:
> >>> On Thu, Oct 31, 2013 at 03:46:10PM +, Andre Oppermann wrote:
>  Author: andre
>  Date: Thu Oct 31 15:46:10 2013
>  New Revision: 257455
>  URL: http://svnweb.freebsd.org/changeset/base/257455
> 
>  Log:
>  Make struct ifnet readable and comprehensible again by grouping
>  and ordering related variables, fields and locks next to each
>  other.  Add more comments to variables.
> >>>
> >>>
>  Over time 'ifnet' has accumlated a lot of additional pointers and
>  functionality in an unstructured way making it quite hard to read
>  and understand while obfuscating relationships between fields and
>  variables.
> 
>  Quantify the structure size and how bloated it has become.
> 
>  This is only a mechanical change in preparation for upcoming
>  work to make ifnet opaque to drivers and to separate out the
>  interface queuing.
> >>>
> >>> as you do the above I think it would make sense to replace
> >>> all int/short/long with fixed-size fields as appropriate
> >>> (and large enough) to make it easier to reason about things
> >>> such as 'how many flags can i stuff into a field'.
> >>>
> >>> The "large enough" part refers to two things:
> >>> - bitfields containing flags or capabilities have a tendency
> >>> to overflow (not just in freebsd, linux has the same)
> >>> requiring KBI changes. We should probably go for 64 bits
> >>> unless there are compelling space reasons (not for ifnet).
> >>
> >> Gleb will handle most of that and it is going to be part of the making
> >> ifnet opaque to drivers.
> >>
> >>> - it is useful if certain opaque fields (flow ids, cookies...)
> >>> can store pointers. Once again, make them at least 64 bit helps
> >>
> >> A number of mbuf header fields have this property now. :)
> >
> > Is there any chance all this reworking might get us to a position where
> > the protocol header in an mbuf doesn't have to be 32-bit aligned
> > anymore?  We pay a pretty heavy price for that requirement in the
> > drivers of the least capable hardware we support, the systems that have
> > the least horsepower to spare to make an extra copy of each packet to
> > realign it.
> 
> That's a totally different issue.  Here we're talking about kernel
> structures including the fields in struct mbuf.  It is totally not
> related to any payload packet headers inside the mbuf data section.
> 

Of course it is.  The nature of my message was purely "As long as we're
doing big changes...".

> The problem you're complaining about is the epic design mistake of
> the ethernet header neither being a power of two nor divisible by
> 4 or 8 bytes.  It is a ridiculous 14 bytes.
> 

Indeed.

> Many DMA engines are capable of starting on any byte.  Some (popular)
> are not.  If they are, the start of the payload can be by shifted by
> two so that the IP headers are 32bit aligned in memory.  If that is
> not possible either the payload has to be copy-aligned or direct
> payload to structure casting must be disallowed, or indirected through
> a macro.
> 

I know of only one modern ARM SoC that's able to DMA network packets on
a 2-byte boundary (actually even it requires a 4-byte boundary, but it's
willing to stuff the first 16 bits with zeroes and offset everything
that follows accordingly).  I'm sure there are others, but it's the
exception rather than the rule.

-- Ian


___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r257455 - head/sys/net

2013-10-31 Thread Luigi Rizzo
On Thu, Oct 31, 2013 at 03:14:57PM -0700, John-Mark Gurney wrote:
> Luigi Rizzo wrote this message on Thu, Oct 31, 2013 at 22:13 +0100:
> > On Thu, Oct 31, 2013 at 01:49:16PM -0700, John-Mark Gurney wrote:
> > > Luigi Rizzo wrote this message on Thu, Oct 31, 2013 at 21:05 +0100:
> > > > On Thu, Oct 31, 2013 at 01:27:25PM -0600, Ian Lepore wrote:
> > > > ...
> > > > > Is there any chance all this reworking might get us to a position 
> > > > > where
> > > > > the protocol header in an mbuf doesn't have to be 32-bit aligned
> > > > > anymore?  We pay a pretty heavy price for that requirement in the
> > > > > drivers of the least capable hardware we support, the systems that 
> > > > > have
> > > > > the least horsepower to spare to make an extra copy of each packet to
> > > > > realign it.
> > > > 
> > > > So are you suggesting to use some 'copy_unaligned_32()' function/macro 
> > > > to
> > > > access 32-bit protocol fields in the network stack ?
> > > > (16-bit entries should not be an issue)
> > > 
> > > my idea has been to make a change to the various ip/tcp/udp layers
> > > that is dependant upon __NO_STRICT_ALIGNMENT and if we do require
> > > strict alignment to copy the header to a stack buffer to align the
> > > data...
> > 
> > I'd rather use accessors functions/macros to read/write
> > the unaligned headers so we can hide the #ifdefs in only
> > one place.
> 
> I am/was trying to prevent massive code curn...
> 
> > The copy to a stack buffer is probably useful even for readability
> 
> Oh, I also realized I left out another part of it...
> 
> void
> ip_input(struct mbuf *m)
> {
> #ifndef __NO_STRICT_ALIGNMENT
>   struct ip tmpip;
> #endif
>   struct ip *ip = NULL;
> 
> #ifndef __NO_STRICT_ALIGNMENT
>   bcopy(mtod(m, struct ip *), &tmpip, sizeof tmpip);
>   ip = &tmpip;
> #else
>   ip = mtod(m, struct ip *);
> #endif

this is exactly what we shold NOT do.
Apart from the source bloat from conditional blocks,
easily someone will try to use ip to point to options
(which are not copied), etc etc.

Just copy the header unconditionally, or probably just the
source and destination IP which under normal assumptions
(14 byte mac header) are the only ones where alignment breaks.
Then of course options will have similar problems.

This is why I think we should use accessors if we want
to solve this problem.

cheers
luigi
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r257455 - head/sys/net

2013-10-31 Thread Andre Oppermann

On 31.10.2013 23:32, Ian Lepore wrote:

On Thu, 2013-10-31 at 23:17 +0100, Andre Oppermann wrote:

On 31.10.2013 20:27, Ian Lepore wrote:

On Thu, 2013-10-31 at 20:08 +0100, Andre Oppermann wrote:

On 31.10.2013 19:03, Luigi Rizzo wrote:

On Thu, Oct 31, 2013 at 03:46:10PM +, Andre Oppermann wrote:

Author: andre
Date: Thu Oct 31 15:46:10 2013
New Revision: 257455
URL: http://svnweb.freebsd.org/changeset/base/257455

Log:
 Make struct ifnet readable and comprehensible again by grouping
 and ordering related variables, fields and locks next to each
 other.  Add more comments to variables.




 Over time 'ifnet' has accumlated a lot of additional pointers and
 functionality in an unstructured way making it quite hard to read
 and understand while obfuscating relationships between fields and
 variables.

 Quantify the structure size and how bloated it has become.

 This is only a mechanical change in preparation for upcoming
 work to make ifnet opaque to drivers and to separate out the
 interface queuing.


as you do the above I think it would make sense to replace
all int/short/long with fixed-size fields as appropriate
(and large enough) to make it easier to reason about things
such as 'how many flags can i stuff into a field'.

The "large enough" part refers to two things:
- bitfields containing flags or capabilities have a tendency
 to overflow (not just in freebsd, linux has the same)
 requiring KBI changes. We should probably go for 64 bits
 unless there are compelling space reasons (not for ifnet).


Gleb will handle most of that and it is going to be part of the making
ifnet opaque to drivers.


- it is useful if certain opaque fields (flow ids, cookies...)
 can store pointers. Once again, make them at least 64 bit helps


A number of mbuf header fields have this property now. :)


Is there any chance all this reworking might get us to a position where
the protocol header in an mbuf doesn't have to be 32-bit aligned
anymore?  We pay a pretty heavy price for that requirement in the
drivers of the least capable hardware we support, the systems that have
the least horsepower to spare to make an extra copy of each packet to
realign it.


That's a totally different issue.  Here we're talking about kernel
structures including the fields in struct mbuf.  It is totally not
related to any payload packet headers inside the mbuf data section.



Of course it is.  The nature of my message was purely "As long as we're
doing big changes...".


It's in a totally different area, but agreed on the big changes thing. ;)


The problem you're complaining about is the epic design mistake of
the ethernet header neither being a power of two nor divisible by
4 or 8 bytes.  It is a ridiculous 14 bytes.



Indeed.


Many DMA engines are capable of starting on any byte.  Some (popular)
are not.  If they are, the start of the payload can be by shifted by
two so that the IP headers are 32bit aligned in memory.  If that is
not possible either the payload has to be copy-aligned or direct
payload to structure casting must be disallowed, or indirected through
a macro.



I know of only one modern ARM SoC that's able to DMA network packets on
a 2-byte boundary (actually even it requires a 4-byte boundary, but it's
willing to stuff the first 16 bits with zeroes and offset everything
that follows accordingly).  I'm sure there are others, but it's the
exception rather than the rule.


Talk about foot shooting.  I'm afraid that packet copying may still be
the least evil option in the grand scheme of things.  IIRC ARM64 will
be able to do misaligned accesses with only a small performance penalty,
like x86/AMD64.

--
Andre

___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257475 - head/sys/ia64/ia64

2013-10-31 Thread Marcel Moolenaar
Author: marcel
Date: Thu Oct 31 22:46:03 2013
New Revision: 257475
URL: http://svnweb.freebsd.org/changeset/base/257475

Log:
  Respect the kern.smp.disabled tunable. When we're scanning the MADT in
  ia64_probe_sapics(), we also create PCPU structures for any Local SAPICs
  we encounter. When SMP is disabled, this leaves us with partially setup
  PCPU structures, which typically results in panics when we're iterating
  over CPUs. When SMP is disabled, we now prevent the creation of the
  PCPU structures.

Modified:
  head/sys/ia64/ia64/mp_machdep.c

Modified: head/sys/ia64/ia64/mp_machdep.c
==
--- head/sys/ia64/ia64/mp_machdep.c Thu Oct 31 21:16:47 2013
(r257474)
+++ head/sys/ia64/ia64/mp_machdep.c Thu Oct 31 22:46:03 2013
(r257475)
@@ -65,6 +65,8 @@ __FBSDID("$FreeBSD$");
 
 extern uint64_t bdata[];
 
+extern int smp_disabled;
+
 MALLOC_DEFINE(M_SMP, "SMP", "SMP related allocations");
 
 void ia64_ap_startup(void);
@@ -294,6 +296,9 @@ cpu_mp_add(u_int acpi_id, u_int id, u_in
void *dpcpu;
u_int cpuid, sapic_id;
 
+   if (smp_disabled)
+   return;
+
sapic_id = SAPIC_ID_SET(id, eid);
cpuid = (IA64_LID_GET_SAPIC_ID(ia64_get_lid()) == sapic_id)
? 0 : smp_cpus++;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257476 - head/sys/arm/freescale/imx

2013-10-31 Thread Ian Lepore
Author: ian
Date: Thu Oct 31 23:05:05 2013
New Revision: 257476
URL: http://svnweb.freebsd.org/changeset/base/257476

Log:
  Revamp the SoC identity numbering scheme to be more in line with the way
  Freescale numbers the chips in the ID registers.

Modified:
  head/sys/arm/freescale/imx/imx_machdep.h

Modified: head/sys/arm/freescale/imx/imx_machdep.h
==
--- head/sys/arm/freescale/imx/imx_machdep.hThu Oct 31 22:46:03 2013
(r257475)
+++ head/sys/arm/freescale/imx/imx_machdep.hThu Oct 31 23:05:05 2013
(r257476)
@@ -36,24 +36,27 @@
 void imx_devmap_addentry(vm_paddr_t _pa, vm_size_t _sz);
 void imx_wdog_cpu_reset(vm_offset_t _wdcr_phys)  __attribute__((__noreturn__));
 
+/* From here down, routines are implemented in imxNN_machdep.c. */
+
 /*
  * SoC identity.
+ * According to the documentation, there is such a thing as an i.MX6 Dual
+ * (non-lite flavor).  However, Freescale doesn't seem to have assigned it a
+ * number in their code for determining the SoC type in u-boot.
+ *
+ * To-do: put silicon revision numbers into the low-order bits somewhere.
  */
-#defineIMXSOC_51   0x05000100
-#defineIMXSOC_53   0x05000300
-#defineIMXSOC_6S   0x0610
-#defineIMXSOC_6SL  0x0611
-#defineIMXSOC_6D   0x0620
-#defineIMXSOC_6DL  0x0621
-#defineIMXSOC_6Q   0x0640
-#defineIMXSOC_6QL  0x0641
-#defineIMXSOC_FAMSHIFT 24
+#defineIMXSOC_51   0x5100
+#defineIMXSOC_53   0x5300
+#defineIMXSOC_6SL  0x6000
+#defineIMXSOC_6DL  0x6100
+#defineIMXSOC_6S   0x6200
+#defineIMXSOC_6Q   0x6300
+#defineIMXSOC_FAMSHIFT 28
 
 u_int imx_soc_type(void);
 u_int imx_soc_family(void);
 
-/* From here down, routines are implemented in imxNN_machdep.c. */
-
 void imx_devmap_init(void);
 
 /*
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257477 - in head/sys/ia64: ia64 include

2013-10-31 Thread Marcel Moolenaar
Author: marcel
Date: Thu Oct 31 23:06:04 2013
New Revision: 257477
URL: http://svnweb.freebsd.org/changeset/base/257477

Log:
  Purge the translation cache of APs before we unleash them. To that
  end, make pmap_invalidate_all() global and have it only handle the
  local CPU -- i.e. no rendezvous. We do not use pmap_invalidate_all
  other than during initialization.
  Note that the BSP already purges its TC -- it was missing for APs
  only. Nonetheless, this so far seems to eliminate random problems.

Modified:
  head/sys/ia64/ia64/mp_machdep.c
  head/sys/ia64/ia64/pmap.c
  head/sys/ia64/include/pmap.h

Modified: head/sys/ia64/ia64/mp_machdep.c
==
--- head/sys/ia64/ia64/mp_machdep.c Thu Oct 31 23:05:05 2013
(r257476)
+++ head/sys/ia64/ia64/mp_machdep.c Thu Oct 31 23:06:04 2013
(r257477)
@@ -240,6 +240,8 @@ ia64_ap_startup(void)
KASSERT(PCPU_GET(idlethread) != NULL, ("no idle thread"));
PCPU_SET(curthread, PCPU_GET(idlethread));
 
+   pmap_invalidate_all();
+
atomic_add_int(&ia64_ap_state.as_awake, 1);
while (!smp_started)
cpu_spinwait();

Modified: head/sys/ia64/ia64/pmap.c
==
--- head/sys/ia64/ia64/pmap.c   Thu Oct 31 23:05:05 2013(r257476)
+++ head/sys/ia64/ia64/pmap.c   Thu Oct 31 23:06:04 2013(r257477)
@@ -262,7 +262,6 @@ static vm_page_t pmap_pv_reclaim(pmap_t 
 static voidpmap_enter_quick_locked(pmap_t pmap, vm_offset_t va,
vm_page_t m, vm_prot_t prot);
 static voidpmap_free_pte(struct ia64_lpte *pte, vm_offset_t va);
-static voidpmap_invalidate_all(void);
 static int pmap_remove_pte(pmap_t pmap, struct ia64_lpte *pte,
vm_offset_t va, pv_entry_t pv, int freepte);
 static int pmap_remove_vhpt(vm_offset_t va);
@@ -537,13 +536,12 @@ pmap_invalidate_page(vm_offset_t va)
critical_exit();
 }
 
-static void
-pmap_invalidate_all_1(void *arg)
+void
+pmap_invalidate_all(void)
 {
uint64_t addr;
int i, j;
 
-   critical_enter();
addr = pmap_ptc_e_base;
for (i = 0; i < pmap_ptc_e_count1; i++) {
for (j = 0; j < pmap_ptc_e_count2; j++) {
@@ -552,20 +550,7 @@ pmap_invalidate_all_1(void *arg)
}
addr += pmap_ptc_e_stride1;
}
-   critical_exit();
-}
-
-static void
-pmap_invalidate_all(void)
-{
-
-#ifdef SMP
-   if (mp_ncpus > 1) {
-   smp_rendezvous(NULL, pmap_invalidate_all_1, NULL, NULL);
-   return;
-   }
-#endif
-   pmap_invalidate_all_1(NULL);
+   ia64_srlz_i();
 }
 
 static uint32_t

Modified: head/sys/ia64/include/pmap.h
==
--- head/sys/ia64/include/pmap.hThu Oct 31 23:05:05 2013
(r257476)
+++ head/sys/ia64/include/pmap.hThu Oct 31 23:06:04 2013
(r257477)
@@ -122,6 +122,7 @@ extern int pmap_vhpt_log2size;
 
 vm_offset_t pmap_alloc_vhpt(void);
 void   pmap_bootstrap(void);
+void   pmap_invalidate_all(void);
 void   pmap_kenter(vm_offset_t va, vm_offset_t pa);
 vm_paddr_t pmap_kextract(vm_offset_t va);
 void   pmap_kremove(vm_offset_t);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257478 - head/sys/arm/freescale/imx

2013-10-31 Thread Ian Lepore
Author: ian
Date: Thu Oct 31 23:08:30 2013
New Revision: 257478
URL: http://svnweb.freebsd.org/changeset/base/257478

Log:
  Add definitions for the register and data that describes the SoC type.
  This isn't in the chip reference manuals, it was found in u-boot and
  various old mailing list threads.

Modified:
  head/sys/arm/freescale/imx/imx6_anatopreg.h

Modified: head/sys/arm/freescale/imx/imx6_anatopreg.h
==
--- head/sys/arm/freescale/imx/imx6_anatopreg.h Thu Oct 31 23:06:04 2013
(r257477)
+++ head/sys/arm/freescale/imx/imx6_anatopreg.h Thu Oct 31 23:08:30 2013
(r257478)
@@ -122,7 +122,9 @@
 #defineIMX6_ANALOG_USB2_MISC_CLR   0x258
 #defineIMX6_ANALOG_USB2_MISC_TOG   0x25C
 #defineIMX6_ANALOG_DIGPROG 0x260
-
-
+#defineIMX6_ANALOG_DIGPROG_SL  0x280
+#define  IMX6_ANALOG_DIGPROG_SOCTYPE_SHIFT   16
+#define  IMX6_ANALOG_DIGPROG_SOCTYPE_MASK\
+(0xff << IMX6_ANALOG_DIGPROG_SOCTYPE_SHIFT)
 
 #endif
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257480 - head/sys/dev/uart

2013-10-31 Thread Ian Lepore
Author: ian
Date: Thu Oct 31 23:57:33 2013
New Revision: 257480
URL: http://svnweb.freebsd.org/changeset/base/257480

Log:
  Convert the if/else list of compatible devices to the table-driven
  ofw_bus_search_compatible() routine.  In addition to converting existing
  strings to table entries, also add compat strings for the whole imx family.

Modified:
  head/sys/dev/uart/uart_bus_fdt.c

Modified: head/sys/dev/uart/uart_bus_fdt.c
==
--- head/sys/dev/uart/uart_bus_fdt.cThu Oct 31 23:39:31 2013
(r257479)
+++ head/sys/dev/uart/uart_bus_fdt.cThu Oct 31 23:57:33 2013
(r257480)
@@ -61,6 +61,30 @@ static driver_t uart_fdt_driver = {
sizeof(struct uart_softc),
 };
 
+/*
+ * Compatible devices.  Keep this sorted in most- to least-specific order 
first,
+ * alphabetical second.  That is, "zwie,ns16550" should appear before "ns16550"
+ * on the theory that the zwie driver knows how to make better use of the
+ * hardware than the generic driver.  Likewise with chips within a family, the
+ * highest-numbers / most recent models should probably appear earlier.
+ */
+static struct ofw_compat_data compat_data[] = {
+   {"arm,pl011",   (uintptr_t)&uart_pl011_class},
+   {"cadence,uart",(uintptr_t)&uart_cdnc_class},
+   {"exynos",  (uintptr_t)&uart_s3c2410_class},
+   {"fsl,imx6q-uart",  (uintptr_t)&uart_imx_class},
+   {"fsl,imx53-uart",  (uintptr_t)&uart_imx_class},
+   {"fsl,imx51-uart",  (uintptr_t)&uart_imx_class},
+   {"fsl,imx31-uart",  (uintptr_t)&uart_imx_class},
+   {"fsl,imx27-uart",  (uintptr_t)&uart_imx_class},
+   {"fsl,imx25-uart",  (uintptr_t)&uart_imx_class},
+   {"fsl,imx21-uart",  (uintptr_t)&uart_imx_class},
+   {"lpc,uart",(uintptr_t)&uart_lpc_class},
+   {"ti,ns16550",  (uintptr_t)&uart_ti8250_class},
+   {"ns16550", (uintptr_t)&uart_ns8250_class},
+   {NULL,  (uintptr_t)NULL},
+};
+
 static int
 uart_fdt_get_clock(phandle_t node, pcell_t *cell)
 {
@@ -99,25 +123,16 @@ uart_fdt_probe(device_t dev)
phandle_t node;
pcell_t clock, shift;
int err;
+   const struct ofw_compat_data * cd;
 
sc = device_get_softc(dev);
-   if (ofw_bus_is_compatible(dev, "lpc,uart"))
-   sc->sc_class = &uart_lpc_class;
-   else if (ofw_bus_is_compatible(dev, "fsl,imx-uart"))
-   sc->sc_class = &uart_imx_class;
-   else if (ofw_bus_is_compatible(dev, "arm,pl011"))
-   sc->sc_class = &uart_pl011_class;
-   else if (ofw_bus_is_compatible(dev, "exynos"))
-   sc->sc_class = &uart_s3c2410_class;
-   else if (ofw_bus_is_compatible(dev, "cadence,uart"))
-   sc->sc_class = &uart_cdnc_class;
-   else if (ofw_bus_is_compatible(dev, "ti,ns16550"))
-   sc->sc_class = &uart_ti8250_class;
-   else if (ofw_bus_is_compatible(dev, "ns16550"))
-   sc->sc_class = &uart_ns8250_class;
-   else
+
+   cd = ofw_bus_search_compatible(dev, compat_data);
+   if (cd->ocd_data == (uintptr_t)NULL)
return (ENXIO);
 
+   sc->sc_class = (struct uart_class *)cd->ocd_data;
+
node = ofw_bus_get_node(dev);
 
if ((err = uart_fdt_get_clock(node, &clock)) != 0)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257482 - head/sys/cam

2013-10-31 Thread Alexander Motin
Author: mav
Date: Fri Nov  1 00:14:15 2013
New Revision: 257482
URL: http://svnweb.freebsd.org/changeset/base/257482

Log:
  Fix lock recursion, triggered by `smartctl -a /dev/adaX`.

Modified:
  head/sys/cam/cam_xpt.c

Modified: head/sys/cam/cam_xpt.c
==
--- head/sys/cam/cam_xpt.c  Thu Oct 31 23:58:31 2013(r257481)
+++ head/sys/cam/cam_xpt.c  Fri Nov  1 00:14:15 2013(r257482)
@@ -2200,7 +2200,7 @@ xptperiphtraverse(struct cam_ed *device,
for (; periph != NULL; periph = next_periph) {
retval = tr_func(periph, arg);
if (retval == 0) {
-   cam_periph_release(periph);
+   cam_periph_release_locked(periph);
break;
}
xpt_lock_buses();
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257484 - head/sys/ia64/ia64

2013-10-31 Thread Marcel Moolenaar
Author: marcel
Date: Fri Nov  1 00:21:38 2013
New Revision: 257484
URL: http://svnweb.freebsd.org/changeset/base/257484

Log:
  The PAL_PTCE_INFO function returns the counts and strides of the
  outer and inner loop as 32-bit integers mux'd in 64-bit return
  values. Change our data types for the count and stride to match
  and simplify/adjust accordingly.
  Note that with this change the defaults of the ptc.e parameters
  have changed. Since all hardware is supposed to support the PAL
  call, there should be no impact. Even ski is unaffected, because
  the TC is re-initialized without considering the virtual address.
  So, as long as we call ptc.e at least once, we're good. That's
  what the new defaults do.
  Most processor implementations need but a single ptc.e to purge
  the entire TC anyway...

Modified:
  head/sys/ia64/ia64/pmap.c

Modified: head/sys/ia64/ia64/pmap.c
==
--- head/sys/ia64/ia64/pmap.c   Fri Nov  1 00:21:09 2013(r257483)
+++ head/sys/ia64/ia64/pmap.c   Fri Nov  1 00:21:38 2013(r257484)
@@ -195,12 +195,12 @@ extern struct ia64_lpte ***ia64_kptdir;
 
 vm_offset_t kernel_vm_end;
 
-/* Values for ptc.e. XXX values for SKI. */
-static uint64_t pmap_ptc_e_base = 0x1;
-static uint64_t pmap_ptc_e_count1 = 3;
-static uint64_t pmap_ptc_e_count2 = 2;
-static uint64_t pmap_ptc_e_stride1 = 0x2000;
-static uint64_t pmap_ptc_e_stride2 = 0x1;
+/* Defaults for ptc.e. */
+static uint64_t pmap_ptc_e_base = 0;
+static uint32_t pmap_ptc_e_count1 = 1;
+static uint32_t pmap_ptc_e_count2 = 1;
+static uint32_t pmap_ptc_e_stride1 = 0;
+static uint32_t pmap_ptc_e_stride2 = 0;
 
 struct mtx pmap_ptc_mutex;
 
@@ -324,12 +324,12 @@ pmap_bootstrap()
panic("Can't configure ptc.e parameters");
pmap_ptc_e_base = res.pal_result[0];
pmap_ptc_e_count1 = res.pal_result[1] >> 32;
-   pmap_ptc_e_count2 = res.pal_result[1] & ((1L<<32) - 1);
+   pmap_ptc_e_count2 = res.pal_result[1];
pmap_ptc_e_stride1 = res.pal_result[2] >> 32;
-   pmap_ptc_e_stride2 = res.pal_result[2] & ((1L<<32) - 1);
+   pmap_ptc_e_stride2 = res.pal_result[2];
if (bootverbose)
-   printf("ptc.e base=0x%lx, count1=%ld, count2=%ld, "
-  "stride1=0x%lx, stride2=0x%lx\n",
+   printf("ptc.e base=0x%lx, count1=%u, count2=%u, "
+  "stride1=0x%x, stride2=0x%x\n",
   pmap_ptc_e_base,
   pmap_ptc_e_count1,
   pmap_ptc_e_count2,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257483 - head/sys/arm/freescale/imx

2013-10-31 Thread Ian Lepore
Author: ian
Date: Fri Nov  1 00:21:09 2013
New Revision: 257483
URL: http://svnweb.freebsd.org/changeset/base/257483

Log:
  Add the Soc- / machine-dependent parts of imx6 support.

Added:
  head/sys/arm/freescale/imx/files.imx6   (contents, props changed)
  head/sys/arm/freescale/imx/imx6_machdep.c   (contents, props changed)
  head/sys/arm/freescale/imx/imx6_pl310.c   (contents, props changed)
  head/sys/arm/freescale/imx/std.imx6   (contents, props changed)

Added: head/sys/arm/freescale/imx/files.imx6
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/freescale/imx/files.imx6   Fri Nov  1 00:21:09 2013
(r257483)
@@ -0,0 +1,56 @@
+# $FreeBSD$
+
+#
+# Standard ARM support.
+#
+arm/arm/bus_space_asm_generic.Sstandard
+arm/arm/bus_space_generic.cstandard
+arm/arm/cpufunc_asm_arm11.Sstandard
+arm/arm/cpufunc_asm_armv5.Sstandard
+arm/arm/cpufunc_asm_armv7.Sstandard
+arm/arm/irq_dispatch.S standard
+kern/kern_clocksource.cstandard
+
+#
+# Standard imx6 devices and support.
+#
+arm/arm/gic.c  standard
+arm/arm/pl310.cstandard
+arm/freescale/imx/bus_space.c  standard
+arm/freescale/imx/common.c standard
+arm/freescale/imx/imx6_anatop.cstandard
+arm/freescale/imx/imx6_ccm.c   standard
+arm/freescale/imx/imx6_machdep.c   standard
+arm/freescale/imx/imx6_pl310.c standard
+arm/freescale/imx/imx_machdep.cstandard
+arm/freescale/imx/imx_gpt.cstandard
+
+#
+# Optional devices.
+#
+arm/freescale/imx/imx_sdhci.c  optional sdhci
+
+arm/freescale/imx/imx_wdog.c   optional imxwdt
+
+dev/ffec/if_ffec.c optional ffec
+
+dev/uart/uart_dev_imx.coptional uart
+
+dev/usb/controller/ehci_imx.c  optional ehci
+arm/freescale/imx/imx6_usbphy.coptional ehci
+
+#
+# Low-level serial console for debugging early kernel startup.
+#
+#arm/freescale/imx/console.c   standard
+
+#
+# Not ready yet...
+#
+#arm/freescale/imx/imx51_iomux.c   optional iomux
+#arm/freescale/imx/imx51_gpio.coptional gpio
+#dev/ata/chipsets/ata-fsl.coptional imxata
+#arm/freescale/imx/i2c.c   optional fsliic
+#dev/ofw/ofw_iicbus.c  optional fsliic
+#arm/freescale/imx/imx51_ipuv3.c   optional sc
+

Added: head/sys/arm/freescale/imx/imx6_machdep.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/freescale/imx/imx6_machdep.c   Fri Nov  1 00:21:09 2013
(r257483)
@@ -0,0 +1,164 @@
+/*-
+ * Copyright (c) 2013 Ian Lepore 
+ * 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 "opt_platform.h"
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/*
+ * Set up static device mappings.  Note that for imx this is called from
+ * initarm_lastaddr() so that it can return the lowest address used for static
+ * device mapping, maximizing kva space.
+ *
+ * This attempts to cover the most-used devices with 1MB section mappings, 
which
+ * is good for performance (uses fewer TLB entries for device access).
+ *
+ * ARMMP covers the interrupt controller, MPCore timers, global timer, and the
+ * L2 cache controller.  Most of the 1MB range is unused reserved space.
+ *
+ * AIPS1/A

svn commit: r257485 - head/include

2013-10-31 Thread Sean Bruno
Author: sbruno
Date: Fri Nov  1 00:32:26 2013
New Revision: 257485
URL: http://svnweb.freebsd.org/changeset/base/257485

Log:
  Install include files for netpfil/pf when requested by the Makefile
  
  Reviewed by:  glebius

Modified:
  head/include/Makefile

Modified: head/include/Makefile
==
--- head/include/Makefile   Fri Nov  1 00:21:38 2013(r257484)
+++ head/include/Makefile   Fri Nov  1 00:32:26 2013(r257485)
@@ -195,6 +195,11 @@ copies:
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
${DESTDIR}${INCLUDEDIR}/netinet
 .endif
+.if ${MK_PF} != "no"
+   cd ${.CURDIR}/../sys/netpfil/pf; \
+   ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
+   ${DESTDIR}${INCLUDEDIR}/netpfil/pf
+.endif
cd ${.CURDIR}/../sys/crypto; \
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 rijndael/rijndael.h \
${DESTDIR}${INCLUDEDIR}/crypto
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257486 - head/sys/boot/fdt/dts

2013-10-31 Thread Ian Lepore
Author: ian
Date: Fri Nov  1 00:45:08 2013
New Revision: 257486
URL: http://svnweb.freebsd.org/changeset/base/257486

Log:
  Add dts source for imx6 SoCs and for Wandboard boards.
  
  The imx6.dtsi is incomplete, but has enough to support devices that work
  right now.  Eventually it will need to be split into several files that
  account for the differences between SoCs in the imx6 family.
  
  The board config for Wandboard Dual is untested.  Solo and Quad work, but
  one one core is turned on for the quad right now (baby steps).

Added:
  head/sys/boot/fdt/dts/imx6.dtsi   (contents, props changed)
  head/sys/boot/fdt/dts/wandboard-dual.dts   (contents, props changed)
  head/sys/boot/fdt/dts/wandboard-quad.dts   (contents, props changed)
  head/sys/boot/fdt/dts/wandboard-solo.dts   (contents, props changed)

Added: head/sys/boot/fdt/dts/imx6.dtsi
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/boot/fdt/dts/imx6.dtsi Fri Nov  1 00:45:08 2013
(r257486)
@@ -0,0 +1,322 @@
+/*
+ * Copyright (c) 2013 Ian Lepore
+ * Copyright (c) 2012 The FreeBSD Foundation
+ * 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.
+ *
+ * Freescale i.MX6 Common Device Tree Source.
+ * There are enough differences between the Solo, Dual, Quad, and *-lite
+ * flavors of this SoC that eventually we will need a finer-grained breakdown
+ * of some of this stuff.  For now this file works for all of them.  I think.
+ *
+ * $FreeBSD$
+ */
+
+/ {
+   cpus {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   cpu@0 {
+   device_type = "cpu";
+   compatible = "ARM,MCIMX6";
+   reg = <0x0>;
+   d-cache-line-size = <32>;
+   i-cache-line-size = <32>;
+   d-cache-size = <0x8000>;
+   i-cache-size = <0x8000>;
+   /* TODO: describe L2 cache also */
+   timebase-frequency = <0>;
+   bus-frequency = <0>;
+   clock-frequency = <0>;
+   };
+   };
+
+   aliases {
+   soc = &SOC;
+   };
+
+   SOC: soc@ {
+   compatible = "simple-bus";
+   #address-cells = <1>;
+   #size-cells = <1>;
+   interrupt-parent = <&gic>;
+   ranges = <0x 0x 0x1000>;
+
+   gic: generic-interrupt-controller@00a00100 {
+   compatible = "arm,gic";
+   interrupt-controller;
+   #interrupt-cells = <1>;
+   reg = <0x00a01000 0x1000
+  0x00a00100 0x0100>;
+   };
+
+   l2-cache@00a02000 {
+   compatible = "arm,pl310-cache", "arm,pl310";
+   reg = <0xa02000 0x1000>;
+   interrupts = <124>;
+   cache-level = <0x2>;
+   interrupt-parent = < &gic >;
+   };
+
+   aips@0200 { /* AIPS1 */
+   compatible = "fsl,aips-bus", "simple-bus";
+   #address-cells = <1>;
+   #size-cells = <1>;
+   interrupt-parent = <&gic>;
+   reg = <0x0200 0x0010>;
+   ranges;
+
+   /* Required by many devices, so better to stay first */
+   clks: ccm@020c4000 {
+   compatible = "fsl,imx6q-cc

this breaks builds of head on stable/9 (Re: svn commit: r257268 - head/gnu/usr.bin/binutils/ld

2013-10-31 Thread Luigi Rizzo
as per the subject, after this commit building head on stable/9
fails with the error below:

===> lib/libpam/modules/pam_krb5 (all)
make: don't know how to make
/media/bsd10/usr/home/luigi/FreeBSD/head/../usr/obj-pico-amd64/media/bsd10/usr/home/luigi/FreeBSD/head/tmp/usr/lib/libkrb5.a.
Stop

reverting the commit fixes the build.

Any idea how this can be fixed ?

thanks
luigi


On Mon, Oct 28, 2013 at 12:56 PM, Brooks Davis  wrote:

> Author: brooks
> Date: Mon Oct 28 19:56:46 2013
> New Revision: 257268
> URL: http://svnweb.freebsd.org/changeset/base/257268
>
> Log:
>   Enable the --sysroot=/foo option in ld by always building with a sysroot
>   defined. When not building as a cross linker, the sysroot is set to "/".
>
>   Exp-run by:   bdrewery (ports/183206)
>   MFC after:3 days
>
> Modified:
>   head/gnu/usr.bin/binutils/ld/Makefile
>
> Modified: head/gnu/usr.bin/binutils/ld/Makefile
>
> ==
> --- head/gnu/usr.bin/binutils/ld/Makefile   Mon Oct 28 19:46:01 2013
>  (r257267)
> +++ head/gnu/usr.bin/binutils/ld/Makefile   Mon Oct 28 19:56:46 2013
>  (r257268)
> @@ -31,7 +31,7 @@ CFLAGS+= -DTARGET=\"${TARGET_TUPLE}\"
>  CFLAGS+= -DDEFAULT_EMULATION=\"${NATIVE_EMULATION}\"
>  CFLAGS+= -DSCRIPTDIR=\"${TOOLS_PREFIX}/usr/libdata\"
>  CFLAGS+= -DBFD_VERSION_STRING=\"${VERSION}\"
> -CFLAGS+= -DBINDIR=\"${BINDIR}\" -DTARGET_SYSTEM_ROOT=\"${TOOLS_PREFIX}\"
> +CFLAGS+= -DBINDIR=\"${BINDIR}\"
> -DTARGET_SYSTEM_ROOT=\"${TOOLS_PREFIX:U/}\"
>  CFLAGS+= -DTOOLBINDIR=\"${TOOLS_PREFIX}/${BINDIR}/libexec\"
>  CFLAGS+= -D_GNU_SOURCE
>  CFLAGS+= -I${SRCDIR}/ld -I${SRCDIR}/bfd
>



-- 
-+---
 Prof. Luigi RIZZO, ri...@iet.unipi.it  . Dip. di Ing. dell'Informazione
 http://www.iet.unipi.it/~luigi/. Universita` di Pisa
 TEL  +39-050-2211611   . via Diotisalvi 2
 Mobile   +39-338-6809875   . 56122 PISA (Italy)
-+---
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257487 - in head/sys/ia64: ia64 include

2013-10-31 Thread Marcel Moolenaar
Author: marcel
Date: Fri Nov  1 01:32:01 2013
New Revision: 257487
URL: http://svnweb.freebsd.org/changeset/base/257487

Log:
  Use LOG2_ID_PAGE_SIZE again for the identity mapping in regions 6 & 7.
  Make the default translation size the same as the PBVM page size to
  avoid inserting overlapping translations in the TC. That generally is
  very bad.

Modified:
  head/sys/ia64/ia64/machdep.c
  head/sys/ia64/ia64/mp_machdep.c
  head/sys/ia64/include/param.h

Modified: head/sys/ia64/ia64/machdep.c
==
--- head/sys/ia64/ia64/machdep.cFri Nov  1 00:45:08 2013
(r257486)
+++ head/sys/ia64/ia64/machdep.cFri Nov  1 01:32:01 2013
(r257487)
@@ -716,8 +716,8 @@ ia64_init(void)
 * handlers. Here we just make sure that they have the largest
 * possible page size to minimise TLB usage.
 */
-   ia64_set_rr(IA64_RR_BASE(6), (6 << 8) | (PAGE_SHIFT << 2));
-   ia64_set_rr(IA64_RR_BASE(7), (7 << 8) | (PAGE_SHIFT << 2));
+   ia64_set_rr(IA64_RR_BASE(6), (6 << 8) | (LOG2_ID_PAGE_SIZE << 2));
+   ia64_set_rr(IA64_RR_BASE(7), (7 << 8) | (LOG2_ID_PAGE_SIZE << 2));
ia64_srlz_d();
 
/* Initialize/setup physical memory datastructures */

Modified: head/sys/ia64/ia64/mp_machdep.c
==
--- head/sys/ia64/ia64/mp_machdep.c Fri Nov  1 00:45:08 2013
(r257486)
+++ head/sys/ia64/ia64/mp_machdep.c Fri Nov  1 01:32:01 2013
(r257487)
@@ -208,8 +208,8 @@ ia64_ap_startup(void)
ia64_ap_state.as_trace = 0x100;
 
ia64_set_rr(IA64_RR_BASE(5), (5 << 8) | (PAGE_SHIFT << 2) | 1);
-   ia64_set_rr(IA64_RR_BASE(6), (6 << 8) | (PAGE_SHIFT << 2));
-   ia64_set_rr(IA64_RR_BASE(7), (7 << 8) | (PAGE_SHIFT << 2));
+   ia64_set_rr(IA64_RR_BASE(6), (6 << 8) | (LOG2_ID_PAGE_SIZE << 2));
+   ia64_set_rr(IA64_RR_BASE(7), (7 << 8) | (LOG2_ID_PAGE_SIZE << 2));
ia64_srlz_d();
 
pcpup = ia64_ap_state.as_pcpu;

Modified: head/sys/ia64/include/param.h
==
--- head/sys/ia64/include/param.h   Fri Nov  1 00:45:08 2013
(r257486)
+++ head/sys/ia64/include/param.h   Fri Nov  1 01:32:01 2013
(r257487)
@@ -105,6 +105,11 @@
 #endif
 #defineKSTACK_GUARD_PAGES 0/* pages of kstack guard; 0 
disables */
 
+/* The default size of identity mappings in region 6 & 7. */
+#ifndef LOG2_ID_PAGE_SIZE
+#defineLOG2_ID_PAGE_SIZE   16
+#endif
+
 /*
  * Mach derived conversion macros
  */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257489 - head/sys/arm/conf

2013-10-31 Thread Ian Lepore
Author: ian
Date: Fri Nov  1 02:04:05 2013
New Revision: 257489
URL: http://svnweb.freebsd.org/changeset/base/257489

Log:
  Kernel config for Wandboard.

Added:
  head/sys/arm/conf/WANDBOARD-COMMON   (contents, props changed)
  head/sys/arm/conf/WANDBOARD-DUAL   (contents, props changed)
  head/sys/arm/conf/WANDBOARD-QUAD   (contents, props changed)
  head/sys/arm/conf/WANDBOARD-SOLO   (contents, props changed)

Added: head/sys/arm/conf/WANDBOARD-COMMON
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/conf/WANDBOARD-COMMON  Fri Nov  1 02:04:05 2013
(r257489)
@@ -0,0 +1,155 @@
+# Kernel configuration for Wandboard
+#
+# For more information on this file, please read the config(5) manual page,
+# and/or the handbook section on Kernel Configuration Files:
+#
+#
http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html
+#
+# The handbook is also available locally in /usr/share/doc/handbook
+# if you've installed the doc distribution, otherwise always see the
+# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the
+# latest information.
+#
+# An exhaustive list of options and more detailed explanations of the
+# device lines is also present in the ../../conf/NOTES and NOTES files.
+# If you are in doubt as to the purpose or necessity of a line, check first
+# in NOTES.
+#
+# $FreeBSD$
+
+include"../freescale/imx/std.imx6"
+
+optionsHZ=250  # Scheduling quantum is 4 milliseconds.
+optionsSCHED_4BSD  # 4BSD scheduler
+optionsPREEMPTION  # Enable kernel thread preemption
+optionsINET# InterNETworking
+optionsINET6   # IPv6 communications protocols
+#options   SCTP# Stream Control Transmission Protocol
+optionsFFS # Berkeley Fast Filesystem
+optionsSOFTUPDATES # Enable FFS soft updates support
+optionsUFS_ACL # Support for access control lists
+optionsUFS_DIRHASH # Improve performance on big directories
+optionsUFS_GJOURNAL# Enable gjournal-based UFS journaling
+#options   MD_ROOT # MD is a potential root device
+optionsNFSCL   # New Network Filesystem Client
+#options   NFSD# New Network Filesystem Server
+optionsNFSLOCKD# Network Lock Manager
+optionsNFS_ROOT# NFS usable as /, requires NFSCL
+optionsMSDOSFS # MSDOS Filesystem
+optionsCD9660  # ISO 9660 Filesystem
+#options   PROCFS  # Process filesystem (requires PSEUDOFS)
+optionsPSEUDOFS# Pseudo-filesystem framework
+optionsTMPFS   # TMP Memory Filesystem
+optionsGEOM_PART_GPT   # GUID Partition Tables.
+optionsGEOM_LABEL  # Provides labelization
+optionsKTRACE  # ktrace(1) support
+optionsSYSVSHM # SYSV-style shared memory
+optionsSYSVMSG # SYSV-style message queues
+optionsSYSVSEM # SYSV-style semaphores
+options_KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time 
extensions
+optionsINCLUDE_CONFIG_FILE # Include this file in kernel
+
+# Debugging support.  Always need this:
+optionsKDB # Enable kernel debugger support.
+# For minimum debugger support use KDB_TRACE, for interactive use DDB.
+#options   KDB_TRACE   # Print a stack trace for a panic.
+optionsDDB # Support DDB.
+# For full debugger support use this instead:
+#options   GDB # Support remote GDB.
+# Other debugging options...
+makeoptionsDEBUG=-g# Build kernel with gdb(1) debug symbols
+optionsALT_BREAK_TO_DEBUGGER   # Use  to enter 
debugger.
+#options   DEBUG
+#options   DEADLKRES   # Enable the deadlock resolver
+#options   INVARIANTS  # Enable calls of extra sanity checking
+#options   INVARIANT_SUPPORT   # Extra sanity checks of internal 
structures, required by INVARIANTS
+#options   WITNESS # Enable checks to detect deadlocks and 
cycles
+
+# Note that 'bpf' is required for DHCP.
+device bpf # Berkeley packet filter
+
+# Pseudo devices.
+device loop# Network loopback
+device random  # Entropy device
+device vlan# 802.1Q VLAN support
+device tun # Packet tunnel.
+device md  # Memory "disks"
+#devicegif # IPv6 and IPv4 tunneling
+#devicefaith   # IPv6-to-IPv4 rela

Re: this breaks builds of head on stable/9 (Re: svn commit: r257268 - head/gnu/usr.bin/binutils/ld

2013-10-31 Thread Brooks Davis
On Thu, Oct 31, 2013 at 06:02:25PM -0700, Luigi Rizzo wrote:
> as per the subject, after this commit building head on stable/9
> fails with the error below:
> 
> ===> lib/libpam/modules/pam_krb5 (all)
> make: don't know how to make
> /media/bsd10/usr/home/luigi/FreeBSD/head/../usr/obj-pico-amd64/media/bsd10/usr/home/luigi/FreeBSD/head/tmp/usr/lib/libkrb5.a.
> Stop
> 
> reverting the commit fixes the build.
> 
> Any idea how this can be fixed ?

I just built world and kernel with a freshly checked out head on
ref9-amd64 so I supect something in your environment.  This change
should only impact the installed copy of ld which would have no effect
on a 9-stable system.  Any portion of the build system using a version
effected by this change is broken since only the cross build version
should be used and that one will have it's own sysroot value as always
it always has.

-- Brooks

> On Mon, Oct 28, 2013 at 12:56 PM, Brooks Davis  wrote:
> 
> > Author: brooks
> > Date: Mon Oct 28 19:56:46 2013
> > New Revision: 257268
> > URL: http://svnweb.freebsd.org/changeset/base/257268
> >
> > Log:
> >   Enable the --sysroot=/foo option in ld by always building with a sysroot
> >   defined. When not building as a cross linker, the sysroot is set to "/".
> >
> >   Exp-run by:   bdrewery (ports/183206)
> >   MFC after:3 days
> >
> > Modified:
> >   head/gnu/usr.bin/binutils/ld/Makefile
> >
> > Modified: head/gnu/usr.bin/binutils/ld/Makefile
> >
> > ==
> > --- head/gnu/usr.bin/binutils/ld/Makefile   Mon Oct 28 19:46:01 2013
> >  (r257267)
> > +++ head/gnu/usr.bin/binutils/ld/Makefile   Mon Oct 28 19:56:46 2013
> >  (r257268)
> > @@ -31,7 +31,7 @@ CFLAGS+= -DTARGET=\"${TARGET_TUPLE}\"
> >  CFLAGS+= -DDEFAULT_EMULATION=\"${NATIVE_EMULATION}\"
> >  CFLAGS+= -DSCRIPTDIR=\"${TOOLS_PREFIX}/usr/libdata\"
> >  CFLAGS+= -DBFD_VERSION_STRING=\"${VERSION}\"
> > -CFLAGS+= -DBINDIR=\"${BINDIR}\" -DTARGET_SYSTEM_ROOT=\"${TOOLS_PREFIX}\"
> > +CFLAGS+= -DBINDIR=\"${BINDIR}\"
> > -DTARGET_SYSTEM_ROOT=\"${TOOLS_PREFIX:U/}\"
> >  CFLAGS+= -DTOOLBINDIR=\"${TOOLS_PREFIX}/${BINDIR}/libexec\"
> >  CFLAGS+= -D_GNU_SOURCE
> >  CFLAGS+= -I${SRCDIR}/ld -I${SRCDIR}/bfd
> >
> 
> 
> 
> -- 
> -+---
>  Prof. Luigi RIZZO, ri...@iet.unipi.it  . Dip. di Ing. dell'Informazione
>  http://www.iet.unipi.it/~luigi/. Universita` di Pisa
>  TEL  +39-050-2211611   . via Diotisalvi 2
>  Mobile   +39-338-6809875   . 56122 PISA (Italy)
> -+---


pgp8CZRjA03ve.pgp
Description: PGP signature


Re: this breaks builds of head on stable/9 (Re: svn commit: r257268 - head/gnu/usr.bin/binutils/ld

2013-10-31 Thread Bryan Drewery
On 10/31/2013 8:02 PM, Luigi Rizzo wrote:
> as per the subject, after this commit building head on stable/9
> fails with the error below:
> 
> ===> lib/libpam/modules/pam_krb5 (all)
> make: don't know how to make
> /media/bsd10/usr/home/luigi/FreeBSD/head/../usr/obj-pico-amd64/media/bsd10/usr/home/luigi/FreeBSD/head/tmp/usr/lib/libkrb5.a.

I see errors in libkrb5 with -j32 quite often lately. Are you building
with high -j?

> Stop
> 
> reverting the commit fixes the build.
> 
> Any idea how this can be fixed ?
> 
> thanks
> luigi
> 
> 
> On Mon, Oct 28, 2013 at 12:56 PM, Brooks Davis  wrote:
> 
>> Author: brooks
>> Date: Mon Oct 28 19:56:46 2013
>> New Revision: 257268
>> URL: http://svnweb.freebsd.org/changeset/base/257268
>>
>> Log:
>>   Enable the --sysroot=/foo option in ld by always building with a sysroot
>>   defined. When not building as a cross linker, the sysroot is set to "/".
>>
>>   Exp-run by:   bdrewery (ports/183206)
>>   MFC after:3 days
>>
>> Modified:
>>   head/gnu/usr.bin/binutils/ld/Makefile
>>
>> Modified: head/gnu/usr.bin/binutils/ld/Makefile
>>
>> ==
>> --- head/gnu/usr.bin/binutils/ld/Makefile   Mon Oct 28 19:46:01 2013
>>  (r257267)
>> +++ head/gnu/usr.bin/binutils/ld/Makefile   Mon Oct 28 19:56:46 2013
>>  (r257268)
>> @@ -31,7 +31,7 @@ CFLAGS+= -DTARGET=\"${TARGET_TUPLE}\"
>>  CFLAGS+= -DDEFAULT_EMULATION=\"${NATIVE_EMULATION}\"
>>  CFLAGS+= -DSCRIPTDIR=\"${TOOLS_PREFIX}/usr/libdata\"
>>  CFLAGS+= -DBFD_VERSION_STRING=\"${VERSION}\"
>> -CFLAGS+= -DBINDIR=\"${BINDIR}\" -DTARGET_SYSTEM_ROOT=\"${TOOLS_PREFIX}\"
>> +CFLAGS+= -DBINDIR=\"${BINDIR}\"
>> -DTARGET_SYSTEM_ROOT=\"${TOOLS_PREFIX:U/}\"
>>  CFLAGS+= -DTOOLBINDIR=\"${TOOLS_PREFIX}/${BINDIR}/libexec\"
>>  CFLAGS+= -D_GNU_SOURCE
>>  CFLAGS+= -I${SRCDIR}/ld -I${SRCDIR}/bfd
>>
> 
> 
> 


-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r257455 - head/sys/net

2013-10-31 Thread John-Mark Gurney
Luigi Rizzo wrote this message on Thu, Oct 31, 2013 at 23:41 +0100:
> On Thu, Oct 31, 2013 at 03:14:57PM -0700, John-Mark Gurney wrote:
> > Luigi Rizzo wrote this message on Thu, Oct 31, 2013 at 22:13 +0100:
> > > On Thu, Oct 31, 2013 at 01:49:16PM -0700, John-Mark Gurney wrote:
> > > > Luigi Rizzo wrote this message on Thu, Oct 31, 2013 at 21:05 +0100:
> > > > > On Thu, Oct 31, 2013 at 01:27:25PM -0600, Ian Lepore wrote:
> > > > > ...
> > > > > > Is there any chance all this reworking might get us to a position 
> > > > > > where
> > > > > > the protocol header in an mbuf doesn't have to be 32-bit aligned
> > > > > > anymore?  We pay a pretty heavy price for that requirement in the
> > > > > > drivers of the least capable hardware we support, the systems that 
> > > > > > have
> > > > > > the least horsepower to spare to make an extra copy of each packet 
> > > > > > to
> > > > > > realign it.
> > > > > 
> > > > > So are you suggesting to use some 'copy_unaligned_32()' 
> > > > > function/macro to
> > > > > access 32-bit protocol fields in the network stack ?
> > > > > (16-bit entries should not be an issue)
> > > > 
> > > > my idea has been to make a change to the various ip/tcp/udp layers
> > > > that is dependant upon __NO_STRICT_ALIGNMENT and if we do require
> > > > strict alignment to copy the header to a stack buffer to align the
> > > > data...
> > > 
> > > I'd rather use accessors functions/macros to read/write
> > > the unaligned headers so we can hide the #ifdefs in only
> > > one place.
> > 
> > I am/was trying to prevent massive code curn...
> > 
> > > The copy to a stack buffer is probably useful even for readability
> > 
> > Oh, I also realized I left out another part of it...
> > 
> > void
> > ip_input(struct mbuf *m)
> > {
> > #ifndef __NO_STRICT_ALIGNMENT
> > struct ip tmpip;
> > #endif
> > struct ip *ip = NULL;
> > 
> > #ifndef __NO_STRICT_ALIGNMENT
> > bcopy(mtod(m, struct ip *), &tmpip, sizeof tmpip);
> > ip = &tmpip;
> > #else
> > ip = mtod(m, struct ip *);
> > #endif
> 
> this is exactly what we shold NOT do.
> Apart from the source bloat from conditional blocks,
> easily someone will try to use ip to point to options
> (which are not copied), etc etc.
> 
> Just copy the header unconditionally, or probably just the
> source and destination IP which under normal assumptions
> (14 byte mac header) are the only ones where alignment breaks.
> Then of course options will have similar problems.
> 
> This is why I think we should use accessors if we want
> to solve this problem.

Can we get those accessors in ASAP and start requiring new code to
use them?  The longer we wait, the bigger the work when it happens,
and longer that people will put it off...

I've been waiting for 5+ years for this (and time to work on it)...

-- 
  John-Mark Gurney  Voice: +1 415 225 5579

 "All that I will do, has been done, All that I have, has not."
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r257455 - head/sys/net

2013-10-31 Thread John-Mark Gurney
Andre Oppermann wrote this message on Thu, Oct 31, 2013 at 23:41 +0100:
> >I know of only one modern ARM SoC that's able to DMA network packets on
> >a 2-byte boundary (actually even it requires a 4-byte boundary, but it's
> >willing to stuff the first 16 bits with zeroes and offset everything
> >that follows accordingly).  I'm sure there are others, but it's the
> >exception rather than the rule.
> 
> Talk about foot shooting.  I'm afraid that packet copying may still be
> the least evil option in the grand scheme of things.  IIRC ARM64 will
> be able to do misaligned accesses with only a small performance penalty,
> like x86/AMD64.

LOL.

Really?  You really want to say that it's fine for embeded systems to
loose around half their network performance because we can't make this
change?  Because we can't be bothered to handle the code the correct
way?

-- 
  John-Mark Gurney  Voice: +1 415 225 5579

 "All that I will do, has been done, All that I have, has not."
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: this breaks builds of head on stable/9 (Re: svn commit: r257268 - head/gnu/usr.bin/binutils/ld

2013-10-31 Thread Luigi Rizzo
On Thu, Oct 31, 2013 at 09:09:24PM -0500, Brooks Davis wrote:
> On Thu, Oct 31, 2013 at 06:02:25PM -0700, Luigi Rizzo wrote:
> > as per the subject, after this commit building head on stable/9
> > fails with the error below:
> > 
> > ===> lib/libpam/modules/pam_krb5 (all)
> > make: don't know how to make
> > /media/bsd10/usr/home/luigi/FreeBSD/head/../usr/obj-pico-amd64/media/bsd10/usr/home/luigi/FreeBSD/head/tmp/usr/lib/libkrb5.a.
> > Stop
> > 
> > reverting the commit fixes the build.
> > 
> > Any idea how this can be fixed ?
> 
> I just built world and kernel with a freshly checked out head on
> ref9-amd64 so I supect something in your environment.  This change
> should only impact the installed copy of ld which would have no effect
> on a 9-stable system.  Any portion of the build system using a version
> effected by this change is broken since only the cross build version
> should be used and that one will have it's own sysroot value as always
> it always has.

i do not understand the last sentence,
but i am going to try on ref9-amd64 just in case.

Were you building it with CLANG by chance ?

If it matters i get the errors when i start the build with a
stock 'make' (which on 9.2 i believe is FreeBSD's make),
using -j 4 and WITHOUT_CLANG=yes (and related options)

I will try both with and without CLANG and with/without -j,
and it is going to take a while of course...

cheers
luigi
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r257455 - head/sys/net

2013-10-31 Thread Adrian Chadd
On 31 October 2013 20:22, John-Mark Gurney  wrote:
> Andre Oppermann wrote this message on Thu, Oct 31, 2013 at 23:41 +0100:
>> >I know of only one modern ARM SoC that's able to DMA network packets on
>> >a 2-byte boundary (actually even it requires a 4-byte boundary, but it's
>> >willing to stuff the first 16 bits with zeroes and offset everything
>> >that follows accordingly).  I'm sure there are others, but it's the
>> >exception rather than the rule.
>>
>> Talk about foot shooting.  I'm afraid that packet copying may still be
>> the least evil option in the grand scheme of things.  IIRC ARM64 will
>> be able to do misaligned accesses with only a small performance penalty,
>> like x86/AMD64.
>
> LOL.
>
> Really?  You really want to say that it's fine for embeded systems to
> loose around half their network performance because we can't make this
> change?  Because we can't be bothered to handle the code the correct
> way?

We can talk about this some more down the road.

There's .. more complicated crap going on here. Mostly due to pulling
parts of packets apart and gluing them back together in weird and odd
ways. All that encapsulation, decapsulation and re-encapsulation going
on means that we won't really be able to always correctly align things
in the "best" way for these embedded platforms.

So, let's table that as a requirement and start drafting up ways to
try and address this. Sneaking in some stack hack to try and make it
work for one particular specific code path is not (entirely) enough :)


-a
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r257490 - head/sys/dev/msk

2013-10-31 Thread Pyun YongHyeon
Author: yongari
Date: Fri Nov  1 05:03:47 2013
New Revision: 257490
URL: http://svnweb.freebsd.org/changeset/base/257490

Log:
  Perform media change after setting IFF_DRV_RUNNING flag. Without it,
  driver would ignore the first link state update if controller
  already established a link.
  
  Reported by:  bsam
  Tested by:bsam

Modified:
  head/sys/dev/msk/if_msk.c

Modified: head/sys/dev/msk/if_msk.c
==
--- head/sys/dev/msk/if_msk.c   Fri Nov  1 02:04:05 2013(r257489)
+++ head/sys/dev/msk/if_msk.c   Fri Nov  1 05:03:47 2013(r257490)
@@ -4071,12 +4071,12 @@ msk_init_locked(struct msk_if_softc *sc_
CSR_WRITE_4(sc, B0_IMSK, sc->msk_intrmask);
CSR_READ_4(sc, B0_IMSK);
 
-   sc_if->msk_flags &= ~MSK_FLAG_LINK;
-   mii_mediachg(mii);
-
ifp->if_drv_flags |= IFF_DRV_RUNNING;
ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
 
+   sc_if->msk_flags &= ~MSK_FLAG_LINK;
+   mii_mediachg(mii);
+
callout_reset(&sc_if->msk_tick_ch, hz, msk_tick, sc_if);
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: this breaks builds of head on stable/9 (Re: svn commit: r257268 - head/gnu/usr.bin/binutils/ld

2013-10-31 Thread Luigi Rizzo
On Thu, Oct 31, 2013 at 09:09:24PM -0500, Brooks Davis wrote:
> On Thu, Oct 31, 2013 at 06:02:25PM -0700, Luigi Rizzo wrote:
> > as per the subject, after this commit building head on stable/9
> > fails with the error below:
> > 
> > ===> lib/libpam/modules/pam_krb5 (all)
> > make: don't know how to make
> > /media/bsd10/usr/home/luigi/FreeBSD/head/../usr/obj-pico-amd64/media/bsd10/usr/home/luigi/FreeBSD/head/tmp/usr/lib/libkrb5.a.
> > Stop
> > 
> > reverting the commit fixes the build.
> > 
> > Any idea how this can be fixed ?
> 
> I just built world and kernel with a freshly checked out head on
> ref9-amd64 so I supect something in your environment.  This change
> should only impact the installed copy of ld which would have no effect
> on a 9-stable system.  Any portion of the build system using a version
> effected by this change is broken since only the cross build version
> should be used and that one will have it's own sysroot value as always
> it always has.

ok so what happens is the following (trying to build HEAD on 9.2, both amd64)

- WITHOUT_CLANG and related options:
"make toolchain"fails with the error on krb5
"make buildworld"   works, and a subsequent
"make toolchain" also works

- without options (so compiling CLANG)

"make toolchain"fails with the error below

building shared library libc.so.7
/usr/bin/ld: this linker was not configured to use sysroots
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** [libc.so.7] Error code 1
1 error
*** [all] Error code 2
1 error


"make toolchain" on an empty tree used to work until before this commit,
and does work if i revert this single change

So does this mean that 'toolchain' now has some prerequisites ?

cheers
luigi
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"