Re: svn commit: r255130 - in head/sys: arm/conf arm/freescale/imx boot/fdt/dts

2013-09-02 Thread Aleksandr Rybalko
Hello Rui!

On Sun, 1 Sep 2013 20:15:36 + (UTC)
Rui Paulo  wrote:

> Author: rpaulo
> Date: Sun Sep  1 20:15:35 2013
> New Revision: 255130
> URL: http://svnweb.freebsd.org/changeset/base/255130
> 
> Log:
>   Initial support for the Digi ConnectCore(c) i.MX53 / Wi-i.MX53 boards.
>   
>   There are many drivers missing, but we can reach single user mode now.
>   
>   Hardware graciously donated by Douglas Beattie.
> 
> Added:
>   head/sys/arm/conf/DIGI-CCWMX53   (contents, props changed)
>   head/sys/arm/freescale/imx/files.imx53   (contents, props changed)
>   head/sys/arm/freescale/imx/imx53_machdep.c   (contents, props changed)
>   head/sys/arm/freescale/imx/std.imx53   (contents, props changed)
>   head/sys/boot/fdt/dts/digi-ccwmx53.dts   (contents, props changed)
>   head/sys/boot/fdt/dts/imx53x.dtsi   (contents, props changed)
> Modified:
>   head/sys/arm/freescale/imx/imx51_ccm.c
>   head/sys/arm/freescale/imx/imx51_gpio.c
>   head/sys/arm/freescale/imx/imx51_iomux.c
>   head/sys/arm/freescale/imx/imx51_machdep.c
>   head/sys/arm/freescale/imx/imx_gpt.c
>   head/sys/arm/freescale/imx/imx_wdog.c
> 

[[cut]]

> Modified: head/sys/arm/freescale/imx/imx51_machdep.c
> ==
> --- head/sys/arm/freescale/imx/imx51_machdep.cSun Sep  1 19:59:54 
> 2013(r255129)
> +++ head/sys/arm/freescale/imx/imx51_machdep.cSun Sep  1 20:15:35 
> 2013(r255130)
> @@ -107,7 +107,7 @@ platform_devmap_init(void)
>* Map segment where UART1 and UART2 located.
>*/
>   fdt_devmap[0].pd_va = IMX51_DEV_VIRT_BASE + 0x03f0;
> - fdt_devmap[0].pd_pa = 0x73f0;
> + fdt_devmap[0].pd_pa = 0x53f0;

I hope it is just mistake, is it?

>   fdt_devmap[0].pd_size = 0x0010;
>   fdt_devmap[0].pd_prot = VM_PROT_READ | VM_PROT_WRITE;
>   fdt_devmap[0].pd_cache = PTE_NOCACHE;
> 

[[cut]]

And, do you board have own FDT blob?
If it so, then better to try to use it. Otherwise, it is better to
unify compatible property values, instead of do test for growing list.


Thanks a lot for your work!

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


svn commit: r255143 - head/sys/netpfil/pf

2013-09-02 Thread Gleb Smirnoff
Author: glebius
Date: Mon Sep  2 10:14:25 2013
New Revision: 255143
URL: http://svnweb.freebsd.org/changeset/base/255143

Log:
  Merge 1.12 of pf_lb.c from OpenBSD, with some changes. Original commit:
  
date: 2010/02/04 14:10:12;  author: sthen;  state: Exp;  lines: +24 -19;
pf_get_sport() picks a random port from the port range specified in a
nat rule. It should check to see if it's in-use (i.e. matches an existing
PF state), if it is, it cycles sequentially through other ports until
it finds a free one. However the check was being done with the state
keys the wrong way round so it was never actually finding the state
to be in-use.
  
- switch the keys to correct this, avoiding random state collisions
with nat. Fixes PR 6300 and problems reported by robert@ and viq.
  
- check pf_get_sport() return code in pf_test(); if port allocation
fails the packet should be dropped rather than sent out untranslated.
  
Help/ok claudio@.
  
  Some additional changes to 1.12:
  
  - We also need to bzero() the key to zero padding, otherwise key
won't match.
  - Collapse two if blocks into one with ||, since both conditions
lead to the same processing.
  - Only naddr changes in the cycle, so move initialization of other
fields above the cycle.
  - s/u_intXX_t/uintXX_t/g
  
  PR:   kern/181690
  Submitted by: Olivier Cochard-Labbé 
  Sponsored by: Nginx, Inc.

Modified:
  head/sys/netpfil/pf/pf_lb.c

Modified: head/sys/netpfil/pf/pf_lb.c
==
--- head/sys/netpfil/pf/pf_lb.c Mon Sep  2 06:41:54 2013(r255142)
+++ head/sys/netpfil/pf/pf_lb.c Mon Sep  2 10:14:25 2013(r255143)
@@ -58,10 +58,9 @@ static struct pf_rule*pf_match_translat
int, int, struct pfi_kif *,
struct pf_addr *, u_int16_t, struct pf_addr *,
uint16_t, int, struct pf_anchor_stackframe *);
-static int  pf_get_sport(sa_family_t, u_int8_t, struct pf_rule *,
-   struct pf_addr *, struct pf_addr *, u_int16_t,
-   struct pf_addr *, u_int16_t*, u_int16_t, u_int16_t,
-   struct pf_src_node **);
+static int pf_get_sport(sa_family_t, uint8_t, struct pf_rule *,
+struct pf_addr *, uint16_t, struct pf_addr *, uint16_t, struct pf_addr *,
+uint16_t *, uint16_t, uint16_t, struct pf_src_node **);
 
 #define mix(a,b,c) \
do {\
@@ -210,13 +209,13 @@ pf_match_translation(struct pf_pdesc *pd
 
 static int
 pf_get_sport(sa_family_t af, u_int8_t proto, struct pf_rule *r,
-struct pf_addr *saddr, struct pf_addr *daddr, u_int16_t dport,
-struct pf_addr *naddr, u_int16_t *nport, u_int16_t low, u_int16_t high,
-struct pf_src_node **sn)
+struct pf_addr *saddr, uint16_t sport, struct pf_addr *daddr,
+uint16_t dport, struct pf_addr *naddr, uint16_t *nport, uint16_t low,
+uint16_t high, struct pf_src_node **sn)
 {
struct pf_state_key_cmp key;
struct pf_addr  init_addr;
-   u_int16_t   cut;
+   uint16_tcut;
 
bzero(&init_addr, sizeof(init_addr));
if (pf_map_addr(af, r, saddr, naddr, &init_addr, sn))
@@ -227,34 +226,38 @@ pf_get_sport(sa_family_t af, u_int8_t pr
high = 65535;
}
 
+   bzero(&key, sizeof(key));
+   key.af = af;
+   key.proto = proto;
+   key.port[0] = dport;
+   PF_ACPY(&key.addr[0], daddr, key.af);
+
do {
-   key.af = af;
-   key.proto = proto;
-   PF_ACPY(&key.addr[1], daddr, key.af);
-   PF_ACPY(&key.addr[0], naddr, key.af);
-   key.port[1] = dport;
+   PF_ACPY(&key.addr[1], naddr, key.af);
 
/*
 * port search; start random, step;
 * similar 2 portloop in in_pcbbind
 */
if (!(proto == IPPROTO_TCP || proto == IPPROTO_UDP ||
-   proto == IPPROTO_ICMP)) {
-   key.port[0] = dport;
-   if (pf_find_state_all(&key, PF_IN, NULL) == NULL)
-   return (0);
-   } else if (low == 0 && high == 0) {
-   key.port[0] = *nport;
-   if (pf_find_state_all(&key, PF_IN, NULL) == NULL)
+   proto == IPPROTO_ICMP) || (low == 0 && high == 0)) {
+   /*
+* XXX bug: icmp states don't use the id on both sides.
+* (traceroute -I through nat)
+*/
+   key.port[1] = sport;
+   if (pf_find_state_all(&key, PF_IN, NULL) == NULL) {
+   *nport = sport;
return (0);
+   }
 

svn commit: r255144 - head/sys/geom/eli

2013-09-02 Thread Alexander Motin
Author: mav
Date: Mon Sep  2 10:44:54 2013
New Revision: 255144
URL: http://svnweb.freebsd.org/changeset/base/255144

Log:
  Make ELI destruction (including orphanization) less aggressive, making it
  always wait for provider close.  Old algorithm was reported to cause NULL
  dereference panic on attempt to close provider after softc destruction.
  If not global workaroung in GEOM, that could even cause destruction with
  requests still in flight.

Modified:
  head/sys/geom/eli/g_eli.c

Modified: head/sys/geom/eli/g_eli.c
==
--- head/sys/geom/eli/g_eli.c   Mon Sep  2 10:14:25 2013(r255143)
+++ head/sys/geom/eli/g_eli.c   Mon Sep  2 10:44:54 2013(r255144)
@@ -621,21 +621,19 @@ end:
  * to close it when this situation occur.
  */
 static void
-g_eli_last_close(struct g_eli_softc *sc)
+g_eli_last_close(void *arg, int flags __unused)
 {
struct g_geom *gp;
-   struct g_provider *pp;
-   char ppname[64];
+   char gpname[64];
int error;
 
g_topology_assert();
-   gp = sc->sc_geom;
-   pp = LIST_FIRST(&gp->provider);
-   strlcpy(ppname, pp->name, sizeof(ppname));
-   error = g_eli_destroy(sc, TRUE);
+   gp = arg;
+   strlcpy(gpname, gp->name, sizeof(gpname));
+   error = g_eli_destroy(gp->softc, TRUE);
KASSERT(error == 0, ("Cannot detach %s on last close (error=%d).",
-   ppname, error));
-   G_ELI_DEBUG(0, "Detached %s on last close.", ppname);
+   gpname, error));
+   G_ELI_DEBUG(0, "Detached %s on last close.", gpname);
 }
 
 int
@@ -665,7 +663,7 @@ g_eli_access(struct g_provider *pp, int 
 */
if ((sc->sc_flags & G_ELI_FLAG_RW_DETACH) ||
(sc->sc_flags & G_ELI_FLAG_WOPEN)) {
-   g_eli_last_close(sc);
+   g_post_event(g_eli_last_close, gp, M_WAITOK, NULL);
}
return (0);
 }
@@ -916,6 +914,10 @@ g_eli_destroy(struct g_eli_softc *sc, bo
if (force) {
G_ELI_DEBUG(1, "Device %s is still open, so it "
"cannot be definitely removed.", pp->name);
+   sc->sc_flags |= G_ELI_FLAG_RW_DETACH;
+   gp->access = g_eli_access;
+   g_wither_provider(pp, ENXIO);
+   return (EBUSY);
} else {
G_ELI_DEBUG(1,
"Device %s is still open (r%dw%de%d).", pp->name,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r255146 - head/lib/libexecinfo

2013-09-02 Thread Ed Maste
Author: emaste
Date: Mon Sep  2 12:37:33 2013
New Revision: 255146
URL: http://svnweb.freebsd.org/changeset/base/255146

Log:
  libexecinfo compatibility with devel/libexecinfo port
  
  1. Match shlib number
  2. Add libelf dependency
  
  Suggested by: bapt[1]

Modified:
  head/lib/libexecinfo/Makefile

Modified: head/lib/libexecinfo/Makefile
==
--- head/lib/libexecinfo/Makefile   Mon Sep  2 11:35:55 2013
(r255145)
+++ head/lib/libexecinfo/Makefile   Mon Sep  2 12:37:33 2013
(r255146)
@@ -3,12 +3,16 @@
 LIBEXECINFO=   ${.CURDIR}/../../contrib/libexecinfo
 
 LIB=   execinfo
+SHLIB_MAJOR=   1
 
 .PATH: ${LIBEXECINFO}
 
 INCS=  execinfo.h symtab.h unwind.h
 SRCS=  backtrace.c symtab.c unwind.c
 
+DPADD= ${LIBELF}
+LDADD= -lelf
+
 MAN=   backtrace.3
 
 MLINKS+=   backtrace.3 backtrace_symbols.3
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r255149 - svnadmin/conf

2013-09-02 Thread Olivier Houchard
Author: cognet
Date: Mon Sep  2 15:52:48 2013
New Revision: 255149
URL: http://svnweb.freebsd.org/changeset/base/255149

Log:
  Please Welcome Ruslan Bukin (br@) and Zbigniew Bodek (zbb@) to my ever-growing
  army of mentees.
  Ruslan gave us Exynos 5 support, and wrote the hdspe audio driver.
  Zbigniew is known to provide many good patches, mostly in the ARM VM area, is
  most recent work being superpages support.
  
  Approved by:  core

Modified:
  svnadmin/conf/access
  svnadmin/conf/mentors

Modified: svnadmin/conf/access
==
--- svnadmin/conf/accessMon Sep  2 15:06:09 2013(r255148)
+++ svnadmin/conf/accessMon Sep  2 15:52:48 2013(r255149)
@@ -38,6 +38,7 @@ bde
 benl
 benno
 bms
+br
 brian  freebsd-committ...@awfulhak.org
 brooks
 brueffer
@@ -215,5 +216,6 @@ will
 wkoszek
 wollman
 yongari
+zbb
 zec
 zont

Modified: svnadmin/conf/mentors
==
--- svnadmin/conf/mentors   Mon Sep  2 15:06:09 2013(r255148)
+++ svnadmin/conf/mentors   Mon Sep  2 15:52:48 2013(r255149)
@@ -13,6 +13,7 @@
 achim  scottl  Co-mentor: emaste
 asomersken Co-mentor: gibbs, will
 benl   philip  Co-mentor: simon
+br cognet
 carl   jimharris
 cy andre   Co-mentor: glebius
 erimlaier  Co-mentor: thompsa
@@ -27,3 +28,4 @@ monthadar adrian
 peterj jhb Co-mentor: grog
 snbdwmalone
 versus gavin   Co-mentor: fjoe
+zbbcognet
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2013-09-02 Thread Rui Paulo
Author: rpaulo
Date: Mon Sep  2 17:07:46 2013
New Revision: 255151
URL: http://svnweb.freebsd.org/changeset/base/255151

Log:
  Revert accidental commit.

Modified:
  head/sys/arm/freescale/imx/imx51_machdep.c

Modified: head/sys/arm/freescale/imx/imx51_machdep.c
==
--- head/sys/arm/freescale/imx/imx51_machdep.c  Mon Sep  2 16:20:10 2013
(r255150)
+++ head/sys/arm/freescale/imx/imx51_machdep.c  Mon Sep  2 17:07:46 2013
(r255151)
@@ -107,7 +107,7 @@ platform_devmap_init(void)
 * Map segment where UART1 and UART2 located.
 */
fdt_devmap[0].pd_va = IMX51_DEV_VIRT_BASE + 0x03f0;
-   fdt_devmap[0].pd_pa = 0x53f0;
+   fdt_devmap[0].pd_pa = 0x73f0;
fdt_devmap[0].pd_size = 0x0010;
fdt_devmap[0].pd_prot = VM_PROT_READ | VM_PROT_WRITE;
fdt_devmap[0].pd_cache = PTE_NOCACHE;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r255130 - in head/sys: arm/conf arm/freescale/imx boot/fdt/dts

2013-09-02 Thread Rui Paulo
On 2 Sep 2013, at 01:26, Aleksandr Rybalko  wrote:

> Hello Rui!
> 
> On Sun, 1 Sep 2013 20:15:36 + (UTC)
> Rui Paulo  wrote:
> 
>> Author: rpaulo
>> Date: Sun Sep  1 20:15:35 2013
>> New Revision: 255130
>> URL: http://svnweb.freebsd.org/changeset/base/255130
>> 
>> Log:
>>  Initial support for the Digi ConnectCore(c) i.MX53 / Wi-i.MX53 boards.
>> 
>>  There are many drivers missing, but we can reach single user mode now.
>> 
>>  Hardware graciously donated by Douglas Beattie.
>> 
>> Added:
>>  head/sys/arm/conf/DIGI-CCWMX53   (contents, props changed)
>>  head/sys/arm/freescale/imx/files.imx53   (contents, props changed)
>>  head/sys/arm/freescale/imx/imx53_machdep.c   (contents, props changed)
>>  head/sys/arm/freescale/imx/std.imx53   (contents, props changed)
>>  head/sys/boot/fdt/dts/digi-ccwmx53.dts   (contents, props changed)
>>  head/sys/boot/fdt/dts/imx53x.dtsi   (contents, props changed)
>> Modified:
>>  head/sys/arm/freescale/imx/imx51_ccm.c
>>  head/sys/arm/freescale/imx/imx51_gpio.c
>>  head/sys/arm/freescale/imx/imx51_iomux.c
>>  head/sys/arm/freescale/imx/imx51_machdep.c
>>  head/sys/arm/freescale/imx/imx_gpt.c
>>  head/sys/arm/freescale/imx/imx_wdog.c
>> 
> 
> [[cut]]
> 
>> Modified: head/sys/arm/freescale/imx/imx51_machdep.c
>> ==
>> --- head/sys/arm/freescale/imx/imx51_machdep.c   Sun Sep  1 19:59:54 
>> 2013(r255129)
>> +++ head/sys/arm/freescale/imx/imx51_machdep.c   Sun Sep  1 20:15:35 
>> 2013(r255130)
>> @@ -107,7 +107,7 @@ platform_devmap_init(void)
>>   * Map segment where UART1 and UART2 located.
>>   */
>>  fdt_devmap[0].pd_va = IMX51_DEV_VIRT_BASE + 0x03f0;
>> -fdt_devmap[0].pd_pa = 0x73f0;
>> +fdt_devmap[0].pd_pa = 0x53f0;
> 
> I hope it is just mistake, is it?

Yes, fixed.

> 
>>  fdt_devmap[0].pd_size = 0x0010;
>>  fdt_devmap[0].pd_prot = VM_PROT_READ | VM_PROT_WRITE;
>>  fdt_devmap[0].pd_cache = PTE_NOCACHE;
>> 
> 
> [[cut]]
> 
> And, do you board have own FDT blob?
> If it so, then better to try to use it. Otherwise, it is better to
> unify compatible property values, instead of do test for growing list.

The FDT blob is not relevant to this since console.c is not using any FDT 
functions. This is just a debugging aid for the platform bring up until I get 
uart_dev_imx.c working correctly.
That said, eventually this will go away. The i.MX51 port you did has the same 
problem, anyway.

--
Rui Paulo

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


svn commit: r255152 - head/sys/dev/atkbdc

2013-09-02 Thread Eitan Adler
Author: eadler
Date: Mon Sep  2 18:25:18 2013
New Revision: 255152
URL: http://svnweb.freebsd.org/changeset/base/255152

Log:
  synaptics and trackpoint support are stable enough to be on by default.
  
  Eventually both options should be removed.
  
  Reviewed by:  dumbbell

Modified:
  head/sys/dev/atkbdc/psm.c

Modified: head/sys/dev/atkbdc/psm.c
==
--- head/sys/dev/atkbdc/psm.c   Mon Sep  2 17:07:46 2013(r255151)
+++ head/sys/dev/atkbdc/psm.c   Mon Sep  2 18:25:18 2013(r255152)
@@ -375,10 +375,10 @@ static devclass_t psm_devclass;
 static int tap_enabled = -1;
 TUNABLE_INT("hw.psm.tap_enabled", &tap_enabled);
 
-static int synaptics_support = 0;
+static int synaptics_support = 1;
 TUNABLE_INT("hw.psm.synaptics_support", &synaptics_support);
 
-static int trackpoint_support = 0;
+static int trackpoint_support = 1;
 TUNABLE_INT("hw.psm.trackpoint_support", &trackpoint_support);
 
 static int verbose = PSM_DEBUG;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r255153 - in head/sys: dev/atkbdc sys

2013-09-02 Thread Jean-Sebastien Pedron
Author: dumbbell
Date: Mon Sep  2 19:15:20 2013
New Revision: 255153
URL: http://svnweb.freebsd.org/changeset/base/255153

Log:
  psm: Add support for middle and extended buttons on Synaptics touchpads
  
  PR:   kern/170834
  Submitted by: Brandon Gooch 
  Tested by:Artyom Mirgorodskiy 
  MFC after:1 month

Modified:
  head/sys/dev/atkbdc/psm.c
  head/sys/sys/mouse.h

Modified: head/sys/dev/atkbdc/psm.c
==
--- head/sys/dev/atkbdc/psm.c   Mon Sep  2 18:25:18 2013(r255152)
+++ head/sys/dev/atkbdc/psm.c   Mon Sep  2 19:15:20 2013(r255153)
@@ -2601,14 +2601,14 @@ proc_synaptics(struct psm_softc *sc, pac
static int guest_buttons;
int w, x0, y0;
 
-   /* TouchPad PS/2 absolute mode message format
+   /* TouchPad PS/2 absolute mode message format with capFourButtons:
 *
 *  Bits:7   6   5   4   3   2   1   0 (LSB)
 *  
 *  ipacket[0]:  1   0  W3  W2   0  W1   R   L
 *  ipacket[1]: Yb  Ya  Y9  Y8  Xb  Xa  X9  X8
 *  ipacket[2]: Z7  Z6  Z5  Z4  Z3  Z2  Z1  Z0
-*  ipacket[3]:  1   1  Yc  Xc   0  W0   D   U
+*  ipacket[3]:  1   1  Yc  Xc   0  W0 D^R U^L
 *  ipacket[4]: X7  X6  X5  X4  X3  X2  X1  X0
 *  ipacket[5]: Y7  Y6  Y5  Y4  Y3  Y2  Y1  Y0
 *
@@ -2622,6 +2622,21 @@ proc_synaptics(struct psm_softc *sc, pac
 *  Y: y position
 *  Z: pressure
 *
+* Without capFourButtons but with nExtendeButtons and/or capMiddle
+*
+*  Bits:7   6   5   4  3  2  1  0 (LSB)
+*  --
+*  ipacket[3]:  1   1  Yc  Xc  0 W0E^RM^L
+*  ipacket[4]: X7  X6  X5  X4  X3|b7  X2|b5  X1|b3  X0|b1
+*  ipacket[5]: Y7  Y6  Y5  Y4  Y3|b8  Y2|b6  Y1|b4  Y0|b2
+*
+* Legend:
+*  M: Middle physical mouse button
+*  E: Extended mouse buttons reported instead of low bits of X and Y
+*  b1-b8: Extended mouse buttons
+*Only ((nExtendedButtons + 1) >> 1) bits are used in packet
+*4 and 5, for reading X and Y value they should be zeroed.
+*
 * Absolute reportable limits:0 - 6143.
 * Typical bezel limits:   1472 - 5472.
 * Typical edge marings:   1632 - 5312.
@@ -2675,8 +2690,10 @@ proc_synaptics(struct psm_softc *sc, pac
w = 4;
}
 
-   /* Handle packets from the guest device */
-   /* XXX Documentation? */
+   /*
+* Handle packets from the guest device. See:
+* Synaptics PS/2 TouchPad Interfacing Guide, Section 5.1
+*/
if (w == 3 && sc->synhw.capPassthrough) {
*x = ((pb->ipacket[1] & 0x10) ?
pb->ipacket[4] - 256 : pb->ipacket[4]);
@@ -2704,36 +2721,49 @@ proc_synaptics(struct psm_softc *sc, pac
touchpad_buttons |= MOUSE_BUTTON3DOWN;
 
if (sc->synhw.capExtended && sc->synhw.capFourButtons) {
-   if ((pb->ipacket[3] & 0x01) && (pb->ipacket[0] & 0x01) == 0)
+   if ((pb->ipacket[3] ^ pb->ipacket[0]) & 0x01)
touchpad_buttons |= MOUSE_BUTTON4DOWN;
-   if ((pb->ipacket[3] & 0x02) && (pb->ipacket[0] & 0x02) == 0)
+   if ((pb->ipacket[3] ^ pb->ipacket[0]) & 0x02)
touchpad_buttons |= MOUSE_BUTTON5DOWN;
-   }
-
-   /*
-* In newer pads - bit 0x02 in the third byte of
-* the packet indicates that we have an extended
-* button press.
-*/
-   /* XXX Documentation? */
-   if (pb->ipacket[3] & 0x02) {
-   /*
-* if directional_scrolls is not 1, we treat any of
-* the scrolling directions as middle-click.
-*/
-   if (sc->syninfo.directional_scrolls) {
-   if (pb->ipacket[4] & 0x01)
-   touchpad_buttons |= MOUSE_BUTTON4DOWN;
-   if (pb->ipacket[5] & 0x01)
-   touchpad_buttons |= MOUSE_BUTTON5DOWN;
-   if (pb->ipacket[4] & 0x02)
-   touchpad_buttons |= MOUSE_BUTTON6DOWN;
-   if (pb->ipacket[5] & 0x02)
-   touchpad_buttons |= MOUSE_BUTTON7DOWN;
-   } else {
-   if ((pb->ipacket[4] & 0x0F) ||
-   (pb->ipacket[5] & 0x0F))
+   } else if (sc->synhw.capExtended && sc->synhw.capMiddle) {
+   /* Middle Button */
+   if ((pb->ipacket[0] ^ pb->ipacket[3]) & 0x01)
+   touchpad_buttons |= MOUSE_BUTTON2DOWN;
+   } else if (sc->synhw.capExtended && (sc->synhw.nExtendedButtons > 0)) {
+   /* Extended Buttons 

Re: svn commit: r255130 - in head/sys: arm/conf arm/freescale/imx boot/fdt/dts

2013-09-02 Thread Aleksandr Rybalko
On Mon, 2 Sep 2013 10:10:39 -0700
Rui Paulo  wrote:

> On 2 Sep 2013, at 01:26, Aleksandr Rybalko  wrote:
> 
> > Hello Rui!
> > 
> > On Sun, 1 Sep 2013 20:15:36 + (UTC)
> > Rui Paulo  wrote:
> > 
> >> Author: rpaulo
> >> Date: Sun Sep  1 20:15:35 2013
> >> New Revision: 255130
> >> URL: http://svnweb.freebsd.org/changeset/base/255130
> >> 
> >> Log:
> >>  Initial support for the Digi ConnectCore(c) i.MX53 / Wi-i.MX53
> >> boards.
> >> 
> >>  There are many drivers missing, but we can reach single user mode
> >> now.
> >> 
> >>  Hardware graciously donated by Douglas Beattie.
> >> 
> >> Added:
> >>  head/sys/arm/conf/DIGI-CCWMX53   (contents, props changed)
> >>  head/sys/arm/freescale/imx/files.imx53   (contents, props changed)
> >>  head/sys/arm/freescale/imx/imx53_machdep.c   (contents, props
> >> changed) head/sys/arm/freescale/imx/std.imx53   (contents, props
> >> changed) head/sys/boot/fdt/dts/digi-ccwmx53.dts   (contents, props
> >> changed) head/sys/boot/fdt/dts/imx53x.dtsi   (contents, props
> >> changed) Modified:
> >>  head/sys/arm/freescale/imx/imx51_ccm.c
> >>  head/sys/arm/freescale/imx/imx51_gpio.c
> >>  head/sys/arm/freescale/imx/imx51_iomux.c
> >>  head/sys/arm/freescale/imx/imx51_machdep.c
> >>  head/sys/arm/freescale/imx/imx_gpt.c
> >>  head/sys/arm/freescale/imx/imx_wdog.c
> >> 
> > 
> > [[cut]]
> > 
> >> Modified: head/sys/arm/freescale/imx/imx51_machdep.c
> >> ==
> >> --- head/sys/arm/freescale/imx/imx51_machdep.c Sun Sep  1
> >> 19:59:54 2013  (r255129) +++
> >> head/sys/arm/freescale/imx/imx51_machdep.c Sun Sep  1
> >> 20:15:35 2013  (r255130) @@ -107,7 +107,7 @@
> >> platform_devmap_init(void)
> >> * Map segment where UART1 and UART2 located.
> >> */
> >>fdt_devmap[0].pd_va = IMX51_DEV_VIRT_BASE + 0x03f0;
> >> -  fdt_devmap[0].pd_pa = 0x73f0;
> >> +  fdt_devmap[0].pd_pa = 0x53f0;
> > 
> > I hope it is just mistake, is it?
> 
> Yes, fixed.

Thanks

> 
> > 
> >>fdt_devmap[0].pd_size = 0x0010;
> >>fdt_devmap[0].pd_prot = VM_PROT_READ | VM_PROT_WRITE;
> >>fdt_devmap[0].pd_cache = PTE_NOCACHE;
> >> 
> > 
> > [[cut]]
> > 
> > And, do you board have own FDT blob?
> > If it so, then better to try to use it. Otherwise, it is better to
> > unify compatible property values, instead of do test for growing
> > list.
> 
> The FDT blob is not relevant to this since console.c is not using any
> FDT functions. This is just a debugging aid for the platform bring up
> until I get uart_dev_imx.c working correctly. That said, eventually
> this will go away. The i.MX51 port you did has the same problem,
> anyway.

I'm not about console, just want to look what vendors start to supply
with i.mx devices.

> 
> --
> Rui Paulo
> 


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


Re: svn commit: r255153 - in head/sys: dev/atkbdc sys

2013-09-02 Thread Jean-Sébastien Pédron

Le 02/09/2013 21:15, Jean-Sebastien Pedron a écrit :

Author: dumbbell
Date: Mon Sep  2 19:15:20 2013
New Revision: 255153
URL: http://svnweb.freebsd.org/changeset/base/255153

Log:
   psm: Add support for middle and extended buttons on Synaptics touchpads

   PR:  kern/170834
   Submitted by:Brandon Gooch 
   Tested by:   Artyom Mirgorodskiy 
   MFC after:   1 month


Hello Jung-uk,

I had this patch in my working copy for a few days and decided to commit 
it. But as I was about to reply to the thread on freebsd-x11@, I read 
the mail about ABI breakage; a mail I didn't notice before the commit...


And you're right, the structure grows and members are shuffled.

I guess the patch won't make it to 9.2 anyway. But I'd like to see it 
into 10 because it helps several people. Do you think a note in UPDATING 
would be enough?


--
Jean-Sébastien Pédron
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Re: svn commit: r255153 - in head/sys: dev/atkbdc sys

2013-09-02 Thread Adrian Chadd
.. right, so you changed the structure layout without say, just adding to
the end of said structure? :-)

Yeah, I think you need to send out something. The binary packages for x11
need to be updated too or things will be odd.



-adrian


On 2 September 2013 12:24, Jean-Sébastien Pédron wrote:

> Le 02/09/2013 21:15, Jean-Sebastien Pedron a écrit :
>
>  Author: dumbbell
>> Date: Mon Sep  2 19:15:20 2013
>> New Revision: 255153
>> URL: 
>> http://svnweb.freebsd.org/**changeset/base/255153
>>
>> Log:
>>psm: Add support for middle and extended buttons on Synaptics touchpads
>>
>>PR:  kern/170834
>>Submitted by:Brandon Gooch 
>>Tested by:   Artyom Mirgorodskiy 
>>MFC after:   1 month
>>
>
> Hello Jung-uk,
>
> I had this patch in my working copy for a few days and decided to commit
> it. But as I was about to reply to the thread on freebsd-x11@, I read the
> mail about ABI breakage; a mail I didn't notice before the commit...
>
> And you're right, the structure grows and members are shuffled.
>
> I guess the patch won't make it to 9.2 anyway. But I'd like to see it into
> 10 because it helps several people. Do you think a note in UPDATING would
> be enough?
>
> --
> Jean-Sébastien Pédron
>
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r255154 - head/sys/sys

2013-09-02 Thread Jean-Sebastien Pedron
Author: dumbbell
Date: Mon Sep  2 19:49:18 2013
New Revision: 255154
URL: http://svnweb.freebsd.org/changeset/base/255154

Log:
  sys/mouse.h: Move members introduced in r255153 to end of struct synapticshw
  
  I didn't know this structure was public and didn't pay enough attention...

Modified:
  head/sys/sys/mouse.h

Modified: head/sys/sys/mouse.h
==
--- head/sys/sys/mouse.hMon Sep  2 19:15:20 2013(r255153)
+++ head/sys/sys/mouse.hMon Sep  2 19:49:18 2013(r255154)
@@ -101,15 +101,15 @@ typedef struct synapticshw {
int capPen;
int infoSimplC;
int infoGeometry;
-   int nExtendedButtons;
int capExtended;
-   int nExtendedQueries;
-   int capMiddle;
-   int capPassthrough;
int capSleep;
int capFourButtons;
int capMultiFinger;
int capPalmDetect;
+   int capPassthrough;
+   int capMiddle;
+   int nExtendedButtons;
+   int nExtendedQueries;
 } synapticshw_t;
 
 /* iftype */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r255153 - in head/sys: dev/atkbdc sys

2013-09-02 Thread Jean-Sébastien Pédron

Le 02/09/2013 21:29, Adrian Chadd a écrit :

.. right, so you changed the structure layout without say, just adding
to the end of said structure? :-)


Yes, I took the patch as-is from the PR, as I don't have the hardware to 
test it and didn't know this struct was public. And as it worked for 
several people...



Yeah, I think you need to send out something. The binary packages for
x11 need to be updated too or things will be odd.


What's the correct procedure for such changes? After a quick search, 
xf86-input-synaptics is using it.


I need to:
o  add a note to UPDATING, at least mentionning that
   xf86-input-synaptics must be rebuilt
o  send a mail to freebsd-x11@ to warn users
o  what about binary packages?
o  something else?

I see now that the structure is documented in psm(4) too...

--
Jean-Sébastien Pédron
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r255156 - head/usr.sbin/rtadvd

2013-09-02 Thread Hiroki Sato
Author: hrs
Date: Mon Sep  2 20:44:19 2013
New Revision: 255156
URL: http://svnweb.freebsd.org/changeset/base/255156

Log:
  Ignore if the interface is not IPv6-capable.
  
  Spotted by:   rpaulo

Modified:
  head/usr.sbin/rtadvd/if.c

Modified: head/usr.sbin/rtadvd/if.c
==
--- head/usr.sbin/rtadvd/if.c   Mon Sep  2 20:35:39 2013(r255155)
+++ head/usr.sbin/rtadvd/if.c   Mon Sep  2 20:44:19 2013(r255156)
@@ -394,8 +394,8 @@ update_ifinfo_nd_flags(struct ifinfo *if
error = ioctl(s, SIOCGIFINFO_IN6, (caddr_t)&nd);
if (error) {
close(s);
-   syslog(LOG_ERR,
-   "<%s> ioctl() failed.", __func__);
+   if (errno != EPFNOSUPPORT)
+   syslog(LOG_ERR, "<%s> ioctl() failed.", __func__);
return (1);
}
ifi->ifi_nd_flags = nd.ndi.flags;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r255157 - head/bin/sh

2013-09-02 Thread Jilles Tjoelker
Author: jilles
Date: Mon Sep  2 21:57:46 2013
New Revision: 255157
URL: http://svnweb.freebsd.org/changeset/base/255157

Log:
  sh: Fix race condition with signals and wait or set -T.
  
  The change in r23 was incomplete. It was still possible for a trapped
  signal to arrive before the shell went to sleep (sigsuspend()) because a
  check was missing or because the signal arrived before in_waitcmd was set.
  
  On SMP, this bug sometimes caused the builtins/wait4.0 test to take 1 second
  to execute; it then might or might not fail. On UP, the test almost always
  failed.

Modified:
  head/bin/sh/jobs.c
  head/bin/sh/jobs.h
  head/bin/sh/trap.c
  head/bin/sh/trap.h

Modified: head/bin/sh/jobs.c
==
--- head/bin/sh/jobs.c  Mon Sep  2 20:44:19 2013(r255156)
+++ head/bin/sh/jobs.c  Mon Sep  2 21:57:46 2013(r255157)
@@ -83,13 +83,12 @@ static struct job *bgjob = NULL; /* last
 static struct job *jobmru; /* most recently used job list */
 static pid_t initialpgrp;  /* pgrp of shell on invocation */
 #endif
-int in_waitcmd = 0;/* are we in waitcmd()? */
-volatile sig_atomic_t breakwaitcmd = 0;/* should wait be terminated? */
 static int ttyfd = -1;
 
 /* mode flags for dowait */
 #define DOWAIT_BLOCK   0x1 /* wait until a child exits */
-#define DOWAIT_SIG 0x2 /* if DOWAIT_BLOCK, abort on signals */
+#define DOWAIT_SIG 0x2 /* if DOWAIT_BLOCK, abort on SIGINT/SIGQUIT */
+#define DOWAIT_SIG_ANY 0x4 /* if DOWAIT_SIG, abort on any signal */
 
 #if JOBS
 static void restartjob(struct job *);
@@ -484,7 +483,7 @@ waitcmd(int argc __unused, char **argv _
 static int
 waitcmdloop(struct job *job)
 {
-   int status, retval;
+   int status, retval, sig;
struct job *jp;
 
/*
@@ -492,7 +491,6 @@ waitcmdloop(struct job *job)
 * received.
 */
 
-   in_waitcmd++;
do {
if (job != NULL) {
if (job->state == JOBDONE) {
@@ -508,7 +506,6 @@ waitcmdloop(struct job *job)
if (job == bgjob)
bgjob = NULL;
}
-   in_waitcmd--;
return retval;
}
} else {
@@ -524,7 +521,6 @@ waitcmdloop(struct job *job)
}
for (jp = jobtab ; ; jp++) {
if (jp >= jobtab + njobs) { /* no running 
procs */
-   in_waitcmd--;
return 0;
}
if (jp->used && jp->state == 0)
@@ -532,9 +528,10 @@ waitcmdloop(struct job *job)
}
}
} while (dowait(DOWAIT_BLOCK | DOWAIT_SIG, (struct job *)NULL) != -1);
-   in_waitcmd--;
 
-   return pendingsig + 128;
+   sig = pendingsig_waitcmd;
+   pendingsig_waitcmd = 0;
+   return sig + 128;
 }
 
 
@@ -990,7 +987,8 @@ waitforjob(struct job *jp, int *origstat
INTOFF;
TRACE(("waitforjob(%%%td) called\n", jp - jobtab + 1));
while (jp->state == 0)
-   if (dowait(DOWAIT_BLOCK | (Tflag ? DOWAIT_SIG : 0), jp) == -1)
+   if (dowait(DOWAIT_BLOCK | (Tflag ? DOWAIT_SIG |
+   DOWAIT_SIG_ANY : 0), jp) == -1)
dotrap();
 #if JOBS
if (jp->jobctl) {
@@ -1081,12 +1079,17 @@ dowait(int mode, struct job *job)
pid = wait3(&status, wflags, (struct rusage *)NULL);
TRACE(("wait returns %d, status=%d\n", (int)pid, status));
if (pid == 0 && (mode & DOWAIT_SIG) != 0) {
-   sigsuspend(&omask);
pid = -1;
+   if (((mode & DOWAIT_SIG_ANY) != 0 ?
+   pendingsig : pendingsig_waitcmd) != 0) {
+   errno = EINTR;
+   break;
+   }
+   sigsuspend(&omask);
if (int_pending())
break;
}
-   } while (pid == -1 && errno == EINTR && breakwaitcmd == 0);
+   } while (pid == -1 && errno == EINTR);
if (pid == -1 && errno == ECHILD && job != NULL)
job->state = JOBDONE;
if ((mode & DOWAIT_SIG) != 0) {
@@ -1095,11 +1098,6 @@ dowait(int mode, struct job *job)
sigprocmask(SIG_SETMASK, &omask, NULL);
INTON;
}
-   if (breakwaitcmd != 0) {
-   breakwaitcmd = 0;
-   if (pid <= 0)
-   return -1;
-   }
if (pid <= 0)
return pid;
INTOFF;

Modified: head/bin/sh/jobs.h

svn commit: r255158 - head/sys/i386/xen

2013-09-02 Thread Justin T. Gibbs
Author: gibbs
Date: Mon Sep  2 22:22:56 2013
New Revision: 255158
URL: http://svnweb.freebsd.org/changeset/base/255158

Log:
  Better conformance to style(9) and organizational cleanup.
  No functional changes.
  
  sys/i386/xen/mp_machdep.c:
Remove extra newlines.
  
Group externs, forward delarations, local types, and pcpu data.
  
Wrap at 80 columns.
  
Use parens in return statements.
  
Tab indent members of array initializers.
  
  MFC after:2 weeks

Modified:
  head/sys/i386/xen/mp_machdep.c

Modified: head/sys/i386/xen/mp_machdep.c
==
--- head/sys/i386/xen/mp_machdep.c  Mon Sep  2 21:57:46 2013
(r255157)
+++ head/sys/i386/xen/mp_machdep.c  Mon Sep  2 22:22:56 2013
(r255158)
@@ -85,20 +85,46 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-
-
 #include 
 #include 
 #include 
 #include 
 #include 
 
+/* Extern Declarations 
---*/
+extern struct pcpu __pcpu[];
+
+extern void Xhypervisor_callback(void);
+extern void failsafe_callback(void);
+extern void pmap_lazyfix_action(void);
+
+/*--- Forward Declarations 
---*/
+static voidassign_cpu_ids(void);
+static voidset_interrupt_apic_ids(void);
+static int start_all_aps(void);
+static int start_ap(int apic_id);
+static voidrelease_aps(void *dummy);
+
+/* Local Types 
---*/
+typedef void call_data_func_t(uintptr_t , uintptr_t);
+
+/*
+ * Store data from cpu_add() until later in the boot when we actually setup
+ * the APs.
+ */
+struct cpu_info {
+   int cpu_present:1;
+   int cpu_bsp:1;
+   int cpu_disabled:1;
+};
+
+/* Global Data 
---*/
+static u_int   hyperthreading_cpus;
+static cpuset_thyperthreading_cpus_mask;
 
 intmp_naps;/* # of Applications processors */
 intboot_cpu_id = -1;   /* designated BSP */
 
-extern struct pcpu __pcpu[];
-
 static int bootAP;
 static union descriptor *bootAPgdt;
 
@@ -112,8 +138,6 @@ vm_offset_t smp_tlb_addr1;
 vm_offset_t smp_tlb_addr2;
 volatile int smp_tlb_wait;
 
-typedef void call_data_func_t(uintptr_t , uintptr_t);
-
 static u_int logical_cpus;
 static volatile cpuset_t ipi_nmi_pending;
 
@@ -127,11 +151,7 @@ static volatile int aps_ready = 0;
  * Store data from cpu_add() until later in the boot when we actually setup
  * the APs.
  */
-struct cpu_info {
-   int cpu_present:1;
-   int cpu_bsp:1;
-   int cpu_disabled:1;
-} static cpu_info[MAX_APIC_ID + 1];
+static struct cpu_info cpu_info[MAX_APIC_ID + 1];
 int cpu_apic_ids[MAXCPU];
 int apic_cpuids[MAX_APIC_ID + 1];
 
@@ -141,22 +161,11 @@ static volatile u_int cpu_ipi_pending[MA
 static int cpu_logical;
 static int cpu_cores;
 
-static voidassign_cpu_ids(void);
-static voidset_interrupt_apic_ids(void);
-intstart_all_aps(void);
-static int start_ap(int apic_id);
-static voidrelease_aps(void *dummy);
-
-static u_int   hyperthreading_cpus;
-static cpuset_thyperthreading_cpus_mask;
-
-extern void Xhypervisor_callback(void);
-extern void failsafe_callback(void);
-extern void pmap_lazyfix_action(void);
-
+/*--- Per-CPU Data 
---*/
 DPCPU_DEFINE(xen_intr_handle_t, ipi_port[NR_IPIS]);
 DPCPU_DEFINE(struct vcpu_info *, vcpu_info);
 
+/*-- Implementation 
--*/
 struct cpu_group *
 cpu_topo(void)
 {
@@ -353,14 +362,14 @@ iv_lazypmap(uintptr_t a, uintptr_t b)
 /*
  * These start from "IPI offset" APIC_IPI_INTS
  */
-static call_data_func_t *ipi_vectors[6] = 
+static call_data_func_t *ipi_vectors[] = 
 {
-  iv_rendezvous,
-  iv_invltlb,
-  iv_invlpg,
-  iv_invlrng,
-  iv_invlcache,
-  iv_lazypmap,
+   iv_rendezvous,
+   iv_invltlb,
+   iv_invlpg,
+   iv_invlrng,
+   iv_invlcache,
+   iv_lazypmap,
 };
 
 /*
@@ -414,7 +423,8 @@ smp_call_function_interrupt(void *unused
atomic_t *finished = &call_data->finished;
 
/* We only handle function IPIs, not bitmap IPIs */
-   if (call_data->func_id < APIC_IPI_INTS || call_data->func_id > 
IPI_BITMAP_VECTOR)
+   if (call_data->func_id < APIC_IPI_INTS ||
+   call_data->func_id > IPI_BITMAP_VECTOR)
panic("invalid function id %u", call_data->func_id);

func = ipi_vectors[call_data->func_id - APIC_IPI_INTS];
@@ -494,14 +504,14 @@ xen_smp_cpu_init(unsigned int cpu)
printf("[XEN] IPI cpu=%d port=%d vector=CALL_FUNCTION_VECTOR (%d)\n",
cpu, xen_intr_port(irq_handle), CALL_FUNCTION_VECTOR);
 
-   return 0;
+   return (0);
 
  fail:
xen_intr_unbind(DPCPU_ID_GET(cpu, ipi_port[RESCHEDULE_VECTOR]));
DPCPU_ID_SET(cpu, ipi_p

svn commit: r255160 - head/sys/netinet

2013-09-02 Thread Michael Tuexen
Author: tuexen
Date: Mon Sep  2 22:48:41 2013
New Revision: 255160
URL: http://svnweb.freebsd.org/changeset/base/255160

Log:
  All changes affect only SCTP-AUTH:
  * Remove non working code related to SHA224.
  * Remove support for non-standardised HMAC-IDs using SHA384 and SHA512.
  * Prefer SHA256 over SHA1.
  * Minor cleanup.
  
  MFC after: 2 weeks

Modified:
  head/sys/netinet/sctp_auth.c
  head/sys/netinet/sctp_auth.h
  head/sys/netinet/sctp_os_bsd.h
  head/sys/netinet/sctp_uio.h

Modified: head/sys/netinet/sctp_auth.c
==
--- head/sys/netinet/sctp_auth.cMon Sep  2 22:45:49 2013
(r255159)
+++ head/sys/netinet/sctp_auth.cMon Sep  2 22:48:41 2013
(r255160)
@@ -703,15 +703,7 @@ sctp_auth_add_hmacid(sctp_hmaclist_t * l
return (-1);
}
if ((hmac_id != SCTP_AUTH_HMAC_ID_SHA1) &&
-#ifdef HAVE_SHA224
-   (hmac_id != SCTP_AUTH_HMAC_ID_SHA224) &&
-#endif
-#ifdef HAVE_SHA2
-   (hmac_id != SCTP_AUTH_HMAC_ID_SHA256) &&
-   (hmac_id != SCTP_AUTH_HMAC_ID_SHA384) &&
-   (hmac_id != SCTP_AUTH_HMAC_ID_SHA512) &&
-#endif
-   1) {
+   (hmac_id != SCTP_AUTH_HMAC_ID_SHA256)) {
return (-1);
}
/* Now is it already in the list */
@@ -754,8 +746,9 @@ sctp_default_supported_hmaclist(void)
new_list = sctp_alloc_hmaclist(2);
if (new_list == NULL)
return (NULL);
-   (void)sctp_auth_add_hmacid(new_list, SCTP_AUTH_HMAC_ID_SHA1);
+   /* We prefer SHA256, so list it first */
(void)sctp_auth_add_hmacid(new_list, SCTP_AUTH_HMAC_ID_SHA256);
+   (void)sctp_auth_add_hmacid(new_list, SCTP_AUTH_HMAC_ID_SHA1);
return (new_list);
 }
 
@@ -811,19 +804,13 @@ int
 sctp_verify_hmac_param(struct sctp_auth_hmac_algo *hmacs, uint32_t num_hmacs)
 {
uint32_t i;
-   uint16_t hmac_id;
-   uint32_t sha1_supported = 0;
 
for (i = 0; i < num_hmacs; i++) {
-   hmac_id = ntohs(hmacs->hmac_ids[i]);
-   if (hmac_id == SCTP_AUTH_HMAC_ID_SHA1)
-   sha1_supported = 1;
+   if (ntohs(hmacs->hmac_ids[i]) == SCTP_AUTH_HMAC_ID_SHA1) {
+   return (0);
+   }
}
-   /* all HMAC id's are supported */
-   if (sha1_supported == 0)
-   return (-1);
-   else
-   return (0);
+   return (-1);
 }
 
 sctp_authinfo_t *
@@ -877,18 +864,8 @@ sctp_get_hmac_digest_len(uint16_t hmac_a
switch (hmac_algo) {
case SCTP_AUTH_HMAC_ID_SHA1:
return (SCTP_AUTH_DIGEST_LEN_SHA1);
-#ifdef HAVE_SHA224
-   case SCTP_AUTH_HMAC_ID_SHA224:
-   return (SCTP_AUTH_DIGEST_LEN_SHA224);
-#endif
-#ifdef HAVE_SHA2
case SCTP_AUTH_HMAC_ID_SHA256:
return (SCTP_AUTH_DIGEST_LEN_SHA256);
-   case SCTP_AUTH_HMAC_ID_SHA384:
-   return (SCTP_AUTH_DIGEST_LEN_SHA384);
-   case SCTP_AUTH_HMAC_ID_SHA512:
-   return (SCTP_AUTH_DIGEST_LEN_SHA512);
-#endif
default:
/* unknown HMAC algorithm: can't do anything */
return (0);
@@ -900,17 +877,9 @@ sctp_get_hmac_block_len(uint16_t hmac_al
 {
switch (hmac_algo) {
case SCTP_AUTH_HMAC_ID_SHA1:
-#ifdef HAVE_SHA224
-   case SCTP_AUTH_HMAC_ID_SHA224:
-#endif
return (64);
-#ifdef HAVE_SHA2
case SCTP_AUTH_HMAC_ID_SHA256:
return (64);
-   case SCTP_AUTH_HMAC_ID_SHA384:
-   case SCTP_AUTH_HMAC_ID_SHA512:
-   return (128);
-#endif
case SCTP_AUTH_HMAC_ID_RSVD:
default:
/* unknown HMAC algorithm: can't do anything */
@@ -923,23 +892,11 @@ sctp_hmac_init(uint16_t hmac_algo, sctp_
 {
switch (hmac_algo) {
case SCTP_AUTH_HMAC_ID_SHA1:
-   SHA1_Init(&ctx->sha1);
-   break;
-#ifdef HAVE_SHA224
-   case SCTP_AUTH_HMAC_ID_SHA224:
+   SCTP_SHA1_INIT(&ctx->sha1);
break;
-#endif
-#ifdef HAVE_SHA2
case SCTP_AUTH_HMAC_ID_SHA256:
-   SHA256_Init(&ctx->sha256);
-   break;
-   case SCTP_AUTH_HMAC_ID_SHA384:
-   SHA384_Init(&ctx->sha384);
+   SCTP_SHA256_INIT(&ctx->sha256);
break;
-   case SCTP_AUTH_HMAC_ID_SHA512:
-   SHA512_Init(&ctx->sha512);
-   break;
-#endif
case SCTP_AUTH_HMAC_ID_RSVD:
default:
/* unknown HMAC algorithm: can't do anything */
@@ -953,23 +910,11 @@ sctp_hmac_update(uint16_t hmac_algo, sct
 {
switch (hmac_algo) {
case SCTP_AUTH_HMAC_ID_SHA1:
-   SHA1_Update(&ctx->sha1, text, textlen);
+   SCTP_SHA1_UPDATE(&ctx->sha1, text, textlen);
break;
-#ifdef HAVE_SHA224
-   case SCTP_AUTH_HMAC_ID_SHA224:
-   break;
-#endif
-#ifdef HAVE_SHA2
   

svn commit: r255161 - head/sys/cddl/dev/dtrace/powerpc

2013-09-02 Thread Justin Hibbits
Author: jhibbits
Date: Mon Sep  2 23:22:05 2013
New Revision: 255161
URL: http://svnweb.freebsd.org/changeset/base/255161

Log:
  Whitespace cleanup.

Modified:
  head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c

Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c
==
--- head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c  Mon Sep  2 22:48:41 
2013(r255160)
+++ head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c  Mon Sep  2 23:22:05 
2013(r255161)
@@ -213,8 +213,8 @@ dtrace_gethrtime_init(void *arg)
CPU_SET(pc->pc_cpuid, &map);
 
smp_rendezvous_cpus(map, NULL,
-   dtrace_gethrtime_init_cpu,
-   smp_no_rendevous_barrier, (void *)(uintptr_t) 
i);
+   dtrace_gethrtime_init_cpu,
+   smp_no_rendevous_barrier, (void *)(uintptr_t) i);
 
timebase_skew[i] = tgt_cpu_tsc - hst_cpu_tsc;
}
@@ -247,7 +247,7 @@ dtrace_gethrtime()
lo = timebase;
hi = timebase >> 32;
return (((lo * nsec_scale) >> SCALE_SHIFT) +
-   ((hi * nsec_scale) << (32 - SCALE_SHIFT)));
+   ((hi * nsec_scale) << (32 - SCALE_SHIFT)));
 }
 
 uint64_t
@@ -280,34 +280,34 @@ dtrace_trap(struct trapframe *frame, u_i
 * All the rest will be handled in the usual way.
 */
switch (type) {
-   /* Page fault. */
-   case EXC_DSI:
-   case EXC_DSE:
-   /* Flag a bad address. */
-   cpu_core[curcpu].cpuc_dtrace_flags |= 
CPU_DTRACE_BADADDR;
-   cpu_core[curcpu].cpuc_dtrace_illval = 
frame->cpu.aim.dar;
-
-   /*
-* Offset the instruction pointer to the 
instruction
-* following the one causing the fault.
-*/
-   frame->srr0 += sizeof(int);
-   return (1);
-   case EXC_ISI:
-   case EXC_ISE:
-   /* Flag a bad address. */
-   cpu_core[curcpu].cpuc_dtrace_flags |= 
CPU_DTRACE_BADADDR;
-   cpu_core[curcpu].cpuc_dtrace_illval = 
frame->srr0;
-
-   /*
-* Offset the instruction pointer to the 
instruction
-* following the one causing the fault.
-*/
-   frame->srr0 += sizeof(int);
-   return (1);
-   default:
-   /* Handle all other traps in the usual way. */
-   break;
+   /* Page fault. */
+   case EXC_DSI:
+   case EXC_DSE:
+   /* Flag a bad address. */
+   cpu_core[curcpu].cpuc_dtrace_flags |= 
CPU_DTRACE_BADADDR;
+   cpu_core[curcpu].cpuc_dtrace_illval = 
frame->cpu.aim.dar;
+
+   /*
+* Offset the instruction pointer to the instruction
+* following the one causing the fault.
+*/
+   frame->srr0 += sizeof(int);
+   return (1);
+   case EXC_ISI:
+   case EXC_ISE:
+   /* Flag a bad address. */
+   cpu_core[curcpu].cpuc_dtrace_flags |= 
CPU_DTRACE_BADADDR;
+   cpu_core[curcpu].cpuc_dtrace_illval = frame->srr0;
+
+   /*
+* Offset the instruction pointer to the instruction
+* following the one causing the fault.
+*/
+   frame->srr0 += sizeof(int);
+   return (1);
+   default:
+   /* Handle all other traps in the usual way. */
+   break;
}
}
 
@@ -321,29 +321,29 @@ dtrace_probe_error(dtrace_state_t *state
 {
 
dtrace_probe(dtrace_probeid_error, (uint64_t)(uintptr_t)state,
-   (uintptr_t)epid,
-   (uintptr_t)which, (uintptr_t)fault, (uintptr_t)fltoffs);
+   (uintptr_t)epid,
+   (uintptr_t)which, (uintptr_t)fault, (uintptr_t)fltoffs);
 }
 
 static int
 dtrace_invop_start(struct trapframe *frame)
 {
switch (dtrace_invop(frame->srr0, (uintptr_t *)frame, 
frame->fixreg[3])) {
-   case DTRACE_INVOP_JUMP:
-   break;
-   case DTRACE_INVOP_BCTR:
-   frame->srr0 = frame->ctr;
-   break;
-   case DT

svn commit: r255162 - head/sys/netinet

2013-09-02 Thread Michael Tuexen
Author: tuexen
Date: Mon Sep  2 23:27:53 2013
New Revision: 255162
URL: http://svnweb.freebsd.org/changeset/base/255162

Log:
  Use uint16_t instead of in_port_t for consistency with the SCTP code.
  
  MFC after: 1 week

Modified:
  head/sys/netinet/sctp_output.c

Modified: head/sys/netinet/sctp_output.c
==
--- head/sys/netinet/sctp_output.c  Mon Sep  2 23:22:05 2013
(r255161)
+++ head/sys/netinet/sctp_output.c  Mon Sep  2 23:27:53 2013
(r255162)
@@ -3561,7 +3561,7 @@ sctp_process_cmsgs_for_init(struct sctp_
 
 static struct sctp_tcb *
 sctp_findassociation_cmsgs(struct sctp_inpcb **inp_p,
-in_port_t port,
+uint16_t port,
 struct mbuf *control,
 struct sctp_nets **net_p,
 int *error)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r255163 - head/etc/rc.d

2013-09-02 Thread Xin LI
Author: delphij
Date: Mon Sep  2 23:52:25 2013
New Revision: 255163
URL: http://svnweb.freebsd.org/changeset/base/255163

Log:
  Create the default router last.  This allows using an static
  interface route for default routes, which seems to be common
  among many dedicated hosting providers.
  
  Reviewed by:  hrs
  MFC after:2 weeks

Modified:
  head/etc/rc.d/routing

Modified: head/etc/rc.d/routing
==
--- head/etc/rc.d/routing   Mon Sep  2 23:27:53 2013(r255162)
+++ head/etc/rc.d/routing   Mon Sep  2 23:52:25 2013(r255163)
@@ -143,7 +143,7 @@ static_inet()
[Nn][Oo] | '')
;;
*)
-   static_routes="_default ${static_routes}"
+   static_routes="${static_routes} _default"
route__default="default ${defaultrouter}"
;;
esac
@@ -205,7 +205,7 @@ static_inet6()
[Nn][Oo] | '')
;;
*)
-   ipv6_static_routes="_default ${ipv6_static_routes}"
+   ipv6_static_routes="${ipv6_static_routes} _default"
ipv6_route__default="default ${ipv6_defaultrouter}"
;;
esac
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r255164 - in head/sys: dev/hwpmc modules/hwpmc powerpc/include

2013-09-02 Thread Justin Hibbits
Author: jhibbits
Date: Tue Sep  3 00:34:18 2013
New Revision: 255164
URL: http://svnweb.freebsd.org/changeset/base/255164

Log:
  Refactor PowerPC hwpmc(4) driver into generic and specific.  More refactoring
  will likely be done as more drivers are added, since AIM-compatible processors
  have similar PMC configuration logic.

Added:
  head/sys/dev/hwpmc/hwpmc_mpc7xxx.c   (contents, props changed)
  head/sys/dev/hwpmc/hwpmc_powerpc.h   (contents, props changed)
Modified:
  head/sys/dev/hwpmc/hwpmc_powerpc.c
  head/sys/modules/hwpmc/Makefile
  head/sys/powerpc/include/pmc_mdep.h

Added: head/sys/dev/hwpmc/hwpmc_mpc7xxx.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/hwpmc/hwpmc_mpc7xxx.c  Tue Sep  3 00:34:18 2013
(r255164)
@@ -0,0 +1,748 @@
+/*-
+ * Copyright (c) 2011 Justin Hibbits
+ * Copyright (c) 2005, Joseph Koshy
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include "hwpmc_powerpc.h"
+
+#definePOWERPC_PMC_CAPS(PMC_CAP_INTERRUPT | PMC_CAP_USER | 
\
+PMC_CAP_SYSTEM | PMC_CAP_EDGE |\
+PMC_CAP_THRESHOLD | PMC_CAP_READ | \
+PMC_CAP_WRITE | PMC_CAP_INVERT |   \
+PMC_CAP_QUALIFIER)
+
+#define PPC_SET_PMC1SEL(r, x)  ((r & ~(SPR_MMCR0_PMC1SEL(0x3f))) | 
SPR_MMCR0_PMC1SEL(x))
+#define PPC_SET_PMC2SEL(r, x)  ((r & ~(SPR_MMCR0_PMC2SEL(0x3f))) | 
SPR_MMCR0_PMC2SEL(x))
+#define PPC_SET_PMC3SEL(r, x)  ((r & ~(SPR_MMCR1_PMC3SEL(0x1f))) | 
SPR_MMCR1_PMC3SEL(x))
+#define PPC_SET_PMC4SEL(r, x)  ((r & ~(SPR_MMCR1_PMC4SEL(0x1f))) | 
SPR_MMCR1_PMC4SEL(x))
+#define PPC_SET_PMC5SEL(r, x)  ((r & ~(SPR_MMCR1_PMC5SEL(0x1f))) | 
SPR_MMCR1_PMC5SEL(x))
+#define PPC_SET_PMC6SEL(r, x)  ((r & ~(SPR_MMCR1_PMC6SEL(0x3f))) | 
SPR_MMCR1_PMC6SEL(x))
+
+/* Change this when we support more than just the 7450. */
+#define MPC7XXX_MAX_PMCS   6
+
+#define MPC7XXX_PMC_HAS_OVERFLOWED(x) (mpc7xxx_pmcn_read(x) & (0x1 << 31))
+
+/*
+ * Things to improve on this:
+ * - It stops (clears to 0) the PMC and resets it at every context switch
+ *   currently.
+ */
+
+/*
+ * This should work for every 32-bit PowerPC implementation I know of (G3 and 
G4
+ * specifically).
+ */
+
+struct powerpc_event_code_map {
+   enum pmc_event  pe_ev;   /* enum value */
+   uint8_t pe_counter_mask;  /* Which counter this can be counted 
in. */
+   uint8_t pe_code; /* numeric code */
+};
+
+#define PPC_PMC_MASK1  0
+#define PPC_PMC_MASK2  1
+#define PPC_PMC_MASK3  2
+#define PPC_PMC_MASK4  3
+#define PPC_PMC_MASK5  4
+#define PPC_PMC_MASK6  5
+#define PPC_PMC_MASK_ALL   0x3f
+#define PMC_POWERPC_EVENT(id, mask, number) \
+   { .pe_ev = PMC_EV_PPC7450_##id, .pe_counter_mask = mask, .pe_code = 
number }
+
+static struct powerpc_event_code_map powerpc_event_codes[] = {
+   PMC_POWERPC_EVENT(CYCLE,PPC_PMC_MASK_ALL, 1),
+   PMC_POWERPC_EVENT(INSTR_COMPLETED, 0x0f, 2),
+   PMC_POWERPC_EVENT(TLB_BIT_TRANSITIONS, 0x0f, 3),
+   PMC_POWERPC_EVENT(INSTR_DISPATCHED, 0x0f, 4),
+   PMC_POWERPC_EVENT(PMON_EXCEPT, 0x0f, 5),
+   PMC_POWERPC_EVENT(PMON_SIG, 0x0f, 7),
+   PMC_POWERPC_EVENT(VPU_INSTR_COMPLETED, 0x03, 8),
+   PMC_POWERPC_EVENT(VFPU_INSTR_COMPLETED, 0x03, 9),
+   PMC_POWERPC_EVENT(VIU1_INSTR_COMPLETED, 0x03, 10),
+   PMC_POWERPC_EVENT(VIU2_INSTR_COMPLETED, 0x03, 11),
+   PMC_POWERPC_EVENT(MTVSCR_INSTR_

svn commit: r255165 - head/sys/powerpc/aim

2013-09-02 Thread Justin Hibbits
Author: jhibbits
Date: Tue Sep  3 00:42:15 2013
New Revision: 255165
URL: http://svnweb.freebsd.org/changeset/base/255165

Log:
  Enable PMC interrupt handling, and fix a DTrace trap handling bug.

Modified:
  head/sys/powerpc/aim/trap.c

Modified: head/sys/powerpc/aim/trap.c
==
--- head/sys/powerpc/aim/trap.c Tue Sep  3 00:34:18 2013(r255164)
+++ head/sys/powerpc/aim/trap.c Tue Sep  3 00:42:15 2013(r255165)
@@ -197,13 +197,11 @@ trap(struct trapframe *frame)
 
 #ifdef HWPMC_HOOKS
if (type == EXC_PERF && (pmc_intr != NULL)) {
-#ifdef notyet
-   (*pmc_intr)(PCPU_GET(cpuid), frame);
-   if (!user)
+   (*pmc_intr)(PCPU_GET(cpuid), frame);
+   if (user)
+   userret(td, frame);
return;
-#endif
}
-   else
 #endif
 #ifdef KDTRACE_HOOKS
/*
@@ -316,9 +314,11 @@ trap(struct trapframe *frame)
if (*(uintptr_t *)frame->srr0 == 0x7c810808) {
if (dtrace_invop_jump_addr != NULL) {
dtrace_invop_jump_addr(frame);
+   return;
}
}
}
+   break;
 #endif
 #ifdef __powerpc64__
case EXC_DSE:
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r255166 - head/sys/dev/virtio

2013-09-02 Thread Bryan Venteicher
Author: bryanv
Date: Tue Sep  3 02:26:57 2013
New Revision: 255166
URL: http://svnweb.freebsd.org/changeset/base/255166

Log:
  Fix unintended compiler constant folding
  
  Pointed out by:   dim@

Modified:
  head/sys/dev/virtio/virtqueue.c

Modified: head/sys/dev/virtio/virtqueue.c
==
--- head/sys/dev/virtio/virtqueue.c Tue Sep  3 00:42:15 2013
(r255165)
+++ head/sys/dev/virtio/virtqueue.c Tue Sep  3 02:26:57 2013
(r255166)
@@ -449,10 +449,10 @@ virtqueue_postpone_intr(struct virtqueue
 
switch (hint) {
case VQ_POSTPONE_SHORT:
-   ndesc /= 4;
+   ndesc = ndesc / 4;
break;
case VQ_POSTPONE_LONG:
-   ndesc *= 3 / 4;
+   ndesc = (ndesc * 3) / 4;
break;
case VQ_POSTPONE_EMPTIED:
break;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r255167 - head/sys/dev/virtio/network

2013-09-02 Thread Bryan Venteicher
Author: bryanv
Date: Tue Sep  3 02:28:31 2013
New Revision: 255167
URL: http://svnweb.freebsd.org/changeset/base/255167

Log:
  Complete any pending Tx frames before attempting the next transmit
  
  Also complete pending frames in the watchdog function when the
  EVENT_IDX feature was negotiated just in case the completion
  interrupt was postponed.

Modified:
  head/sys/dev/virtio/network/if_vtnet.c
  head/sys/dev/virtio/network/if_vtnetvar.h

Modified: head/sys/dev/virtio/network/if_vtnet.c
==
--- head/sys/dev/virtio/network/if_vtnet.c  Tue Sep  3 02:26:57 2013
(r255166)
+++ head/sys/dev/virtio/network/if_vtnet.c  Tue Sep  3 02:28:31 2013
(r255167)
@@ -592,6 +592,9 @@ vtnet_setup_features(struct vtnet_softc 
 
vtnet_negotiate_features(sc);
 
+   if (virtio_with_feature(dev, VIRTIO_RING_F_EVENT_IDX))
+   sc->vtnet_flags |= VTNET_FLAG_EVENT_IDX;
+
if (virtio_with_feature(dev, VIRTIO_NET_F_MAC)) {
/* This feature should always be negotiated. */
sc->vtnet_flags |= VTNET_FLAG_MAC;
@@ -2155,6 +2158,8 @@ vtnet_start_locked(struct vtnet_txq *txq
sc->vtnet_link_active == 0)
return;
 
+   vtnet_txq_eof(txq);
+
while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) {
if (virtqueue_full(vq))
break;
@@ -2226,6 +2231,8 @@ vtnet_txq_mq_start_locked(struct vtnet_t
return (error);
}
 
+   vtnet_txq_eof(txq);
+
while ((m = drbr_peek(ifp, br)) != NULL) {
error = vtnet_txq_encap(txq, &m);
if (error) {
@@ -2471,6 +2478,8 @@ vtnet_watchdog(struct vtnet_txq *txq)
sc = txq->vtntx_sc;
 
VTNET_TXQ_LOCK(txq);
+   if (sc->vtnet_flags & VTNET_FLAG_EVENT_IDX)
+   vtnet_txq_eof(txq);
if (txq->vtntx_watchdog == 0 || --txq->vtntx_watchdog) {
VTNET_TXQ_UNLOCK(txq);
return (0);

Modified: head/sys/dev/virtio/network/if_vtnetvar.h
==
--- head/sys/dev/virtio/network/if_vtnetvar.h   Tue Sep  3 02:26:57 2013
(r255166)
+++ head/sys/dev/virtio/network/if_vtnetvar.h   Tue Sep  3 02:28:31 2013
(r255167)
@@ -138,6 +138,7 @@ struct vtnet_softc {
 #define VTNET_FLAG_MRG_RXBUFS   0x0080
 #define VTNET_FLAG_LRO_NOMRG0x0100
 #define VTNET_FLAG_MULTIQ   0x0200
+#define VTNET_FLAG_EVENT_IDX0x0400
 
int  vtnet_link_active;
int  vtnet_hdr_size;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r255168 - stable/9/sys/kern

2013-09-02 Thread Konstantin Belousov
Author: kib
Date: Tue Sep  3 05:20:42 2013
New Revision: 255168
URL: http://svnweb.freebsd.org/changeset/base/255168

Log:
  MFC r254945:
  When allocating a pbuf for the cluster write, do not sleep waiting
  for the available pbuf when passed vnode is backing md(4). Other i/o
  directed to the same md device might already hold pbufs, and then we
  could deadlock since only our progress can free a pbuf needed for
  wakeup.

Modified:
  stable/9/sys/kern/vfs_cluster.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/vfs_cluster.c
==
--- stable/9/sys/kern/vfs_cluster.c Tue Sep  3 02:28:31 2013
(r255167)
+++ stable/9/sys/kern/vfs_cluster.c Tue Sep  3 05:20:42 2013
(r255168)
@@ -846,7 +846,9 @@ cluster_wbuild_gb(struct vnode *vp, long
  (tbp->b_bcount != tbp->b_bufsize) ||
  (tbp->b_bcount != size) ||
  (len == 1) ||
- ((bp = getpbuf(&cluster_pbuf_freecnt)) == NULL)) {
+ ((bp = (vp->v_vflag & VV_MD) != 0 ?
+ trypbuf(&cluster_pbuf_freecnt) :
+ getpbuf(&cluster_pbuf_freecnt)) == NULL)) {
totalwritten += tbp->b_bufsize;
bawrite(tbp);
++start_lbn;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"