Re: svn commit: r233773 - head/usr.sbin/arp

2012-04-10 Thread Gleb Smirnoff
  Qing,

On Mon, Apr 09, 2012 at 02:26:06PM -0700, Qing Li wrote:
Q You missed my points.
Q 
Q That if check as part of r201282 was meant to resolve a couple of
Q issues related
Q to PPP links, as noted in my commit message. In this PPP/proxy
Q resolution context
Q the error message applies, which is why I actually used the word context 
in my
Q previous reply.
Q 
Q Your removing of that code will break the fixes committed in r201282.

Can you please provide example of PPP link configuration, that was
broken by r233773.

Q I can't quite decipher the example you described in this email.

Okay, here it is more verbose:

My list of interfaces:

# ifconfig -l
em0 wlan0 iwn0 lo0

My only configured interface:

# ifconfig em0
em0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST metric 0 mtu 1500
       
options=4219bRXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MAGIC,VLAN_HWTSO
       ether f0:de:f1:6c:5b:fa
       inet x.x.x.111 netmask 0xffe0 broadcast x.x.x.127
       nd6 options=29PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL
       media: Ethernet autoselect (100baseTX full-duplex)
       status: active

My arp table:

# arp -an
? (x.x.x.97) at 00:00:5e:00:01:61 on em0 expires in 1198 seconds [ethernet]
? (x.x.x.101) at 00:e0:81:5a:22:49 on em0 expires in 618 seconds [ethernet]
? (x.x.x.111) at f0:de:f1:6c:5b:fa on em0 permanent [ethernet]
? (x.x.x.116) at 00:26:18:6a:ea:02 on em0 expires in 1128 seconds [ethernet]

Now I'm trying to set ARP entry for network address. And I get error:

# arp -s 81.19.64.96 0:0:0:0:0:0
set: proxy entry exists for non 802 device

Questions: where is the proxy entry mentioned in the above ARP table? I don't
see one. Where is the non 802 device in the above list of my interfaces?

Q Could you please give me a bit more information in a private email so I can 
have
Q a better look at the issue, and possibly make a suggestion for an alternative
Q patch ?

I have mailed you 8 March 2012 with msg-id 
20120308173642.gw13...@glebius.int.ru,
and didn't got any reply since. That's why I proceeded with commit.

P.S. And please, can you avoid top quoting when discussing on technical FreeBSD
lists? This isn't my personal wish but explicitly documented etiquette:

http://www.freebsd.org/doc/en_US.ISO8859-1/articles/mailing-list-faq/etiquette.html#ETIQUETTE-REPLYING

-- 
Totus tuus, Glebius.
___
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: r234085 - head/sys/dev/ath

2012-04-10 Thread Adrian Chadd
Author: adrian
Date: Tue Apr 10 06:25:11 2012
New Revision: 234085
URL: http://svn.freebsd.org/changeset/base/234085

Log:
  * Since the API changed along the -CURRENT path (december 2011),
add a FreeBSD_version check.  It should work fine for compiling
on -HEAD, 9.x and 8.x.
  
  * Conditionally compile the 11n options only when 11n is enabled.
  
  The above changes allow the ath(4) driver to compile and run on
  8.1-RELEASE (Hi old PC-BSD!) but with the 11n stuff disabled.
  
  I've done a test against the net80211 and tools in 8.1-RELEASE.
  The NIC used in testing is the AR2427 in an EEEPC.
  
  Just to be clear - this change is to allow the -HEAD ath/hal/rate
  code to run on 9.x _and_ 8.x with no source changes. However,
  when running on earlier kernels, it should only be used for legacy
  mode. (Don't define ATH_ENABLE_11N.)

Modified:
  head/sys/dev/ath/if_ath.c

Modified: head/sys/dev/ath/if_ath.c
==
--- head/sys/dev/ath/if_ath.c   Tue Apr 10 05:42:48 2012(r234084)
+++ head/sys/dev/ath/if_ath.c   Tue Apr 10 06:25:11 2012(r234085)
@@ -131,10 +131,17 @@ __FBSDID($FreeBSD$);
  */
 CTASSERT(ATH_BCBUF = 8);
 
+#if __FreeBSD_version  103
 static struct ieee80211vap *ath_vap_create(struct ieee80211com *,
const char [IFNAMSIZ], int, enum ieee80211_opmode, int,
const uint8_t [IEEE80211_ADDR_LEN],
const uint8_t [IEEE80211_ADDR_LEN]);
+#else
+static struct ieee80211vap *ath_vap_create(struct ieee80211com *,
+   const char [IFNAMSIZ], int, int, int,
+   const uint8_t [IEEE80211_ADDR_LEN],
+   const uint8_t [IEEE80211_ADDR_LEN]);
+#endif
 static voidath_vap_delete(struct ieee80211vap *);
 static voidath_init(void *);
 static voidath_stop_locked(struct ifnet *);
@@ -200,7 +207,9 @@ static void ath_chan_change(struct ath_s
 static voidath_scan_start(struct ieee80211com *);
 static voidath_scan_end(struct ieee80211com *);
 static voidath_set_channel(struct ieee80211com *);
+#ifdef ATH_ENABLE_11N
 static voidath_update_chw(struct ieee80211com *);
+#endif /* ATH_ENABLE_11N */
 static voidath_calibrate(void *);
 static int ath_newstate(struct ieee80211vap *, enum ieee80211_state, int);
 static voidath_setup_stationkey(struct ieee80211_node *);
@@ -804,8 +813,7 @@ ath_attach(u_int16_t devid, struct ath_s
ic-ic_scan_start = ath_scan_start;
ic-ic_scan_end = ath_scan_end;
ic-ic_set_channel = ath_set_channel;
-   ic-ic_update_chw = ath_update_chw;
-
+#ifdef ATH_ENABLE_11N
/* 802.11n specific - but just override anyway */
sc-sc_addba_request = ic-ic_addba_request;
sc-sc_addba_response = ic-ic_addba_response;
@@ -819,6 +827,9 @@ ath_attach(u_int16_t devid, struct ath_s
ic-ic_addba_stop = ath_addba_stop;
ic-ic_bar_response = ath_bar_response;
 
+   ic-ic_update_chw = ath_update_chw;
+#endif /* ATH_ENABLE_11N */
+
ieee80211_radiotap_attach(ic,
sc-sc_tx_th.wt_ihdr, sizeof(sc-sc_tx_th),
ATH_TX_RADIOTAP_PRESENT,
@@ -955,11 +966,18 @@ assign_bslot(struct ath_softc *sc)
return free;
 }
 
+#if __FreeBSD_version  103
 static struct ieee80211vap *
 ath_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], int unit,
 enum ieee80211_opmode opmode, int flags,
 const uint8_t bssid[IEEE80211_ADDR_LEN],
 const uint8_t mac0[IEEE80211_ADDR_LEN])
+#else
+static struct ieee80211vap *
+ath_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], int unit,
+int opmode, int flags, const uint8_t bssid[IEEE80211_ADDR_LEN],
+const uint8_t mac0[IEEE80211_ADDR_LEN])
+#endif
 {
struct ath_softc *sc = ic-ic_ifp-if_softc;
struct ath_vap *avp;
@@ -5766,6 +5784,7 @@ ath_scan_end(struct ieee80211com *ic)
 sc-sc_curaid);
 }
 
+#ifdef ATH_ENABLE_11N
 /*
  * For now, just do a channel change.
  *
@@ -5790,6 +5809,7 @@ ath_update_chw(struct ieee80211com *ic)
DPRINTF(sc, ATH_DEBUG_STATE, %s: called\n, __func__);
ath_set_channel(ic);
 }
+#endif /* ATH_ENABLE_11N */
 
 static void
 ath_set_channel(struct ieee80211com *ic)
___
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: r234086 - head/sys/dev/sfxge

2012-04-10 Thread Gleb Smirnoff
Author: glebius
Date: Tue Apr 10 06:52:21 2012
New Revision: 234086
URL: http://svn.freebsd.org/changeset/base/234086

Log:
  M_DONTWAIT is a flag from historical mbuf(9)
  allocator, not malloc(9) or uma(9) flag.

Modified:
  head/sys/dev/sfxge/sfxge_rx.c

Modified: head/sys/dev/sfxge/sfxge_rx.c
==
--- head/sys/dev/sfxge/sfxge_rx.c   Tue Apr 10 06:25:11 2012
(r234085)
+++ head/sys/dev/sfxge/sfxge_rx.c   Tue Apr 10 06:52:21 2012
(r234086)
@@ -176,10 +176,10 @@ static inline struct mbuf *sfxge_rx_allo
/* Allocate mbuf structure */
args.flags = M_PKTHDR;
args.type = MT_DATA;
-   m = (struct mbuf *)uma_zalloc_arg(zone_mbuf, args, M_DONTWAIT);
+   m = (struct mbuf *)uma_zalloc_arg(zone_mbuf, args, M_NOWAIT);
 
/* Allocate (and attach) packet buffer */
-   if (m  !uma_zalloc_arg(sc-rx_buffer_zone, m, M_DONTWAIT)) {
+   if (m  !uma_zalloc_arg(sc-rx_buffer_zone, m, M_NOWAIT)) {
uma_zfree(zone_mbuf, m);
m = NULL;
}
@@ -586,7 +586,7 @@ static void sfxge_lro_new_conn(struct sf
c = TAILQ_FIRST(st-free_conns);
TAILQ_REMOVE(st-free_conns, c, link);
} else {
-   c = malloc(sizeof(*c), M_SFXGE, M_DONTWAIT);
+   c = malloc(sizeof(*c), M_SFXGE, M_NOWAIT);
if (c == NULL)
return;
c-mbuf = NULL;
___
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: r234087 - head/sys/netinet

2012-04-10 Thread Gleb Smirnoff
Author: glebius
Date: Tue Apr 10 06:52:39 2012
New Revision: 234087
URL: http://svn.freebsd.org/changeset/base/234087

Log:
  M_DONTWAIT is a flag from historical mbuf(9)
  allocator, not malloc(9) or uma(9) flag.

Modified:
  head/sys/netinet/in.c

Modified: head/sys/netinet/in.c
==
--- head/sys/netinet/in.c   Tue Apr 10 06:52:21 2012(r234086)
+++ head/sys/netinet/in.c   Tue Apr 10 06:52:39 2012(r234087)
@@ -1279,7 +1279,7 @@ in_lltable_new(const struct sockaddr *l3
 {
struct in_llentry *lle;
 
-   lle = malloc(sizeof(struct in_llentry), M_LLTABLE, M_DONTWAIT | M_ZERO);
+   lle = malloc(sizeof(struct in_llentry), M_LLTABLE, M_NOWAIT | M_ZERO);
if (lle == NULL)/* NB: caller generates msg */
return NULL;
 
___
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: r234088 - in head/sys/dev/ath/ath_hal: . ar5416

2012-04-10 Thread Adrian Chadd
Author: adrian
Date: Tue Apr 10 07:11:33 2012
New Revision: 234088
URL: http://svn.freebsd.org/changeset/base/234088

Log:
  Squirrel away the SYNC interrupt in case we're doing interrupt debugging.

Modified:
  head/sys/dev/ath/ath_hal/ah.h
  head/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c

Modified: head/sys/dev/ath/ath_hal/ah.h
==
--- head/sys/dev/ath/ath_hal/ah.h   Tue Apr 10 06:52:39 2012
(r234087)
+++ head/sys/dev/ath/ath_hal/ah.h   Tue Apr 10 07:11:33 2012
(r234088)
@@ -815,6 +815,7 @@ struct ath_hal {
uint16_t*ah_eepromdata; /* eeprom buffer, if needed */
 
uint32_tah_intrstate[8];/* last int state */
+   uint32_tah_syncstate;   /* last sync intr state */
 
HAL_OPS_CONFIG ah_config;
const HAL_RATE_TABLE *__ahdecl(*ah_getRateTable)(struct ath_hal *,

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c
==
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c Tue Apr 10 06:52:39 
2012(r234087)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c Tue Apr 10 07:11:33 
2012(r234088)
@@ -75,6 +75,7 @@ ar5416GetPendingInterrupts(struct ath_ha
 * Blank the interrupt debugging area regardless.
 */
bzero(ah-ah_intrstate, sizeof(ah-ah_intrstate));
+   ah-ah_syncstate = 0;
 #endif
 
/*
@@ -89,6 +90,9 @@ ar5416GetPendingInterrupts(struct ath_ha
isr = OS_REG_READ(ah, AR_ISR);
else
isr = 0;
+#ifdef AH_INTERRUPT_DEBUGGING
+   ah-ah_syncstate =
+#endif
o_sync_cause = sync_cause = OS_REG_READ(ah, AR_INTR_SYNC_CAUSE);
sync_cause = AR_INTR_SYNC_DEFAULT;
*masked = 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: r234089 - head/sys/dev/ath

2012-04-10 Thread Adrian Chadd
Author: adrian
Date: Tue Apr 10 07:16:28 2012
New Revision: 234089
URL: http://svn.freebsd.org/changeset/base/234089

Log:
  Revert this for now - it may work for -8 and -9 and -HEAD, but not
  -HEAD driver + net80211 on -9 kernel.
  
  I'll figure this out at some later stage.

Modified:
  head/sys/dev/ath/if_ath.c

Modified: head/sys/dev/ath/if_ath.c
==
--- head/sys/dev/ath/if_ath.c   Tue Apr 10 07:11:33 2012(r234088)
+++ head/sys/dev/ath/if_ath.c   Tue Apr 10 07:16:28 2012(r234089)
@@ -131,17 +131,10 @@ __FBSDID($FreeBSD$);
  */
 CTASSERT(ATH_BCBUF = 8);
 
-#if __FreeBSD_version  103
 static struct ieee80211vap *ath_vap_create(struct ieee80211com *,
const char [IFNAMSIZ], int, enum ieee80211_opmode, int,
const uint8_t [IEEE80211_ADDR_LEN],
const uint8_t [IEEE80211_ADDR_LEN]);
-#else
-static struct ieee80211vap *ath_vap_create(struct ieee80211com *,
-   const char [IFNAMSIZ], int, int, int,
-   const uint8_t [IEEE80211_ADDR_LEN],
-   const uint8_t [IEEE80211_ADDR_LEN]);
-#endif
 static voidath_vap_delete(struct ieee80211vap *);
 static voidath_init(void *);
 static voidath_stop_locked(struct ifnet *);
@@ -966,18 +959,11 @@ assign_bslot(struct ath_softc *sc)
return free;
 }
 
-#if __FreeBSD_version  103
 static struct ieee80211vap *
 ath_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], int unit,
 enum ieee80211_opmode opmode, int flags,
 const uint8_t bssid[IEEE80211_ADDR_LEN],
 const uint8_t mac0[IEEE80211_ADDR_LEN])
-#else
-static struct ieee80211vap *
-ath_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], int unit,
-int opmode, int flags, const uint8_t bssid[IEEE80211_ADDR_LEN],
-const uint8_t mac0[IEEE80211_ADDR_LEN])
-#endif
 {
struct ath_softc *sc = ic-ic_ifp-if_softc;
struct ath_vap *avp;
___
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: r234090 - head/sys/dev/ath

2012-04-10 Thread Adrian Chadd
Author: adrian
Date: Tue Apr 10 07:23:37 2012
New Revision: 234090
URL: http://svn.freebsd.org/changeset/base/234090

Log:
  Squirrel away SYNC interrupt debugging if it's enabled in the HAL.
  
  Bus errors will show up as various SYNC interrupts which will be passed
  back up to ath_intr().

Modified:
  head/sys/dev/ath/if_ath.c
  head/sys/dev/ath/if_ath_sysctl.c
  head/sys/dev/ath/if_athioctl.h
  head/sys/dev/ath/if_athvar.h

Modified: head/sys/dev/ath/if_ath.c
==
--- head/sys/dev/ath/if_ath.c   Tue Apr 10 07:16:28 2012(r234089)
+++ head/sys/dev/ath/if_ath.c   Tue Apr 10 07:23:37 2012(r234090)
@@ -1495,6 +1495,15 @@ ath_intr(void *arg)
ah-ah_intrstate[3],
ah-ah_intrstate[6]);
 #endif
+
+   /* Squirrel away SYNC interrupt debugging */
+   if (ah-ah_syncstate != 0) {
+   int i;
+   for (i = 0; i  32; i++)
+   if (ah-ah_syncstate  (i  i))
+   sc-sc_intr_stats.sync_intr[i]++;
+   }
+
status = sc-sc_imask; /* discard unasked for bits */
 
/* Short-circuit un-handled interrupts */
@@ -6476,8 +6485,11 @@ ath_ioctl(struct ifnet *ifp, u_long cmd,
ifr-ifr_data, sizeof (sc-sc_stats));
case SIOCZATHSTATS:
error = priv_check(curthread, PRIV_DRIVER);
-   if (error == 0)
+   if (error == 0) {
memset(sc-sc_stats, 0, sizeof(sc-sc_stats));
+   memset(sc-sc_intr_stats, 0,
+   sizeof(sc-sc_intr_stats));
+   }
break;
 #ifdef ATH_DIAGAPI
case SIOCGATHDIAG:

Modified: head/sys/dev/ath/if_ath_sysctl.c
==
--- head/sys/dev/ath/if_ath_sysctl.cTue Apr 10 07:16:28 2012
(r234089)
+++ head/sys/dev/ath/if_ath_sysctl.cTue Apr 10 07:23:37 2012
(r234090)
@@ -655,6 +655,7 @@ ath_sysctl_clearstats(SYSCTL_HANDLER_ARG
return 0;   /* Not clearing the stats is still valid */
memset(sc-sc_stats, 0, sizeof(sc-sc_stats));
memset(sc-sc_aggr_stats, 0, sizeof(sc-sc_aggr_stats));
+   memset(sc-sc_intr_stats, 0, sizeof(sc-sc_intr_stats));
 
val = 0;
return 0;
@@ -677,6 +678,26 @@ ath_sysctl_stats_attach_rxphyerr(struct 
}
 }
 
+static void
+ath_sysctl_stats_attach_intr(struct ath_softc *sc,
+struct sysctl_oid_list *parent)
+{
+   struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(sc-sc_dev);
+   struct sysctl_oid *tree = device_get_sysctl_tree(sc-sc_dev);
+   struct sysctl_oid_list *child = SYSCTL_CHILDREN(tree);
+   int i;
+   char sn[8];
+
+   tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, sync_intr,
+   CTLFLAG_RD, NULL, Sync interrupt statistics);
+   child = SYSCTL_CHILDREN(tree);
+   for (i = 0; i  32; i++) {
+   snprintf(sn, sizeof(sn), %d, i);
+   SYSCTL_ADD_UINT(ctx, child, OID_AUTO, sn, CTLFLAG_RD,
+   sc-sc_intr_stats.sync_intr[i], 0, );
+   }
+}
+
 void
 ath_sysctl_stats_attach(struct ath_softc *sc)
 {
@@ -904,6 +925,9 @@ ath_sysctl_stats_attach(struct ath_softc

/* Attach the RX phy error array */
ath_sysctl_stats_attach_rxphyerr(sc, child);
+
+   /* Attach the interrupt statistics array */
+   ath_sysctl_stats_attach_intr(sc, child);
 }
 
 /*

Modified: head/sys/dev/ath/if_athioctl.h
==
--- head/sys/dev/ath/if_athioctl.h  Tue Apr 10 07:16:28 2012
(r234089)
+++ head/sys/dev/ath/if_athioctl.h  Tue Apr 10 07:23:37 2012
(r234090)
@@ -46,6 +46,10 @@ struct ath_tx_aggr_stats {
u_int32_t   aggr_rts_aggr_limited;
 };
 
+struct ath_intr_stats {
+   u_int32_t   sync_intr[32];
+};
+
 struct ath_stats {
u_int32_t   ast_watchdog;   /* device reset by watchdog */
u_int32_t   ast_hardware;   /* fatal hardware error interrupts */

Modified: head/sys/dev/ath/if_athvar.h
==
--- head/sys/dev/ath/if_athvar.hTue Apr 10 07:16:28 2012
(r234089)
+++ head/sys/dev/ath/if_athvar.hTue Apr 10 07:23:37 2012
(r234090)
@@ -349,6 +349,7 @@ struct ath_softc {
struct ifnet*sc_ifp;/* interface common */
struct ath_statssc_stats;   /* interface statistics */
struct ath_tx_aggr_statssc_aggr_stats;
+   struct ath_intr_stats   sc_intr_stats;
int sc_debug;
int sc_nvaps;   /* # vaps */
int sc_nstavaps;/* # station vaps */
___
svn-src-head@freebsd.org 

svn commit: r234091 - head/sys/dev/ath

2012-04-10 Thread Adrian Chadd
Author: adrian
Date: Tue Apr 10 07:27:42 2012
New Revision: 234091
URL: http://svn.freebsd.org/changeset/base/234091

Log:
  Blank the aggregate stats whenever the zero ioctl is called.

Modified:
  head/sys/dev/ath/if_ath.c

Modified: head/sys/dev/ath/if_ath.c
==
--- head/sys/dev/ath/if_ath.c   Tue Apr 10 07:23:37 2012(r234090)
+++ head/sys/dev/ath/if_ath.c   Tue Apr 10 07:27:42 2012(r234091)
@@ -6487,6 +6487,8 @@ ath_ioctl(struct ifnet *ifp, u_long cmd,
error = priv_check(curthread, PRIV_DRIVER);
if (error == 0) {
memset(sc-sc_stats, 0, sizeof(sc-sc_stats));
+   memset(sc-sc_aggr_stats, 0,
+   sizeof(sc-sc_aggr_stats));
memset(sc-sc_intr_stats, 0,
sizeof(sc-sc_intr_stats));
}
___
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: r234093 - in head/etc: defaults rc.d

2012-04-10 Thread Stanislav Sedov
Author: stas
Date: Tue Apr 10 09:27:41 2012
New Revision: 234093
URL: http://svn.freebsd.org/changeset/base/234093

Log:
  - Add rc.d script for kfd, kerberos forwarded tickets daemon.

Added:
  head/etc/rc.d/kfd   (contents, props changed)
Modified:
  head/etc/defaults/rc.conf
  head/etc/rc.d/Makefile

Modified: head/etc/defaults/rc.conf
==
--- head/etc/defaults/rc.conf   Tue Apr 10 07:38:58 2012(r234092)
+++ head/etc/defaults/rc.conf   Tue Apr 10 09:27:41 2012(r234093)
@@ -297,6 +297,8 @@ kadmind5_server_enable=NO # Run kadmin
 kadmind5_server=/usr/libexec/kadmind # path to kerberos 5 admin daemon
 kpasswdd_server_enable=NO# Run kpasswdd (or NO)
 kpasswdd_server=/usr/libexec/kpasswdd# path to kerberos 5 passwd 
daemon
+kfd_server_enable=NO # Run kfd (or NO)
+kfd_server=/usr/libexec/kfd  # path to kerberos 5 kfd daemon
 
 gssd_enable=NO   # Run the gssd daemon (or NO).
 gssd_flags=  # Flags for gssd.

Modified: head/etc/rc.d/Makefile
==
--- head/etc/rc.d/Makefile  Tue Apr 10 07:38:58 2012(r234092)
+++ head/etc/rc.d/Makefile  Tue Apr 10 09:27:41 2012(r234093)
@@ -66,6 +66,7 @@ FILES=DAEMON \
kadmind \
kerberos \
keyserv \
+   kfd \
kld \
kldxref \
kpasswdd \

Added: head/etc/rc.d/kfd
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/etc/rc.d/kfd   Tue Apr 10 09:27:41 2012(r234093)
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: kfd
+# BEFORE: DAEMON
+
+. /etc/rc.subr
+
+name=kfd
+load_rc_config $name
+rcvar=kfd_server_enable
+unset start_cmd
+command=${kfd_server}
+kfd_flags=-i
+command_args=
+
+run_rc_command $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


Re: svn commit: r234014 - head/lib/libc/arm/gen

2012-04-10 Thread Andrew Turner
On Mon, 9 Apr 2012 09:39:23 -0700
Juli Mallett jmall...@freebsd.org wrote:

 On Mon, Apr 9, 2012 at 01:44, Andrew Turner and...@fubar.geek.nz
 wrote:
  How does the attached (untested) patch look. It explicitly loads
  ARM_TP_ADDRESS into a r0 to ensure r1-3 are not touched.
 
 The example file I pointed at was for the kernel, where the
 LOCORE-related ifdefs (almost) make sense, but for userland you
 probably want to conditionalize on __ASSEMBLER__.

How does the attached patch look? I've updated it to use __ASSEMBLER__
where required.

Andrew
Index: lib/libc/arm/gen/Makefile.inc
===
--- lib/libc/arm/gen/Makefile.inc	(revision 234093)
+++ lib/libc/arm/gen/Makefile.inc	(working copy)
@@ -3,4 +3,4 @@
 
 SRCS+=	_ctx_start.S _setjmp.S _set_tp.c alloca.S fabs.c \
 	getcontextx.c infinity.c ldexp.c makecontext.c \
-	__aeabi_read_tp.c setjmp.S signalcontext.c sigsetjmp.S divsi3.S flt_rounds.c
+	__aeabi_read_tp.S setjmp.S signalcontext.c sigsetjmp.S divsi3.S flt_rounds.c
Index: lib/libc/arm/gen/__aeabi_read_tp.S
===
--- lib/libc/arm/gen/__aeabi_read_tp.S	(revision 0)
+++ lib/libc/arm/gen/__aeabi_read_tp.S	(working copy)
@@ -0,0 +1,40 @@
+/*-
+ * Copyright (c) 2012 Oleksandr Tymoshenko
+ * Copyright (c) 2012 Andrew Turner
+ * 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 machine/asm.h
+__FBSDID($FreeBSD$);
+
+#include machine/sysarch.h
+
+ENTRY(__aeabi_read_tp)
+	ldr	r0, .Larm_tp_address
+	ldr	r0, [r0]
+	RET
+
+.Larm_tp_address:
+	.word ARM_TP_ADDRESS
+
Index: lib/libc/arm/gen/__aeabi_read_tp.c
===
--- lib/libc/arm/gen/__aeabi_read_tp.c	(revision 234093)
+++ lib/libc/arm/gen/__aeabi_read_tp.c	(working copy)
@@ -1,45 +0,0 @@
-/*-
- * Copyright (c) 2012 Oleksandr Tymoshenko
- * Copyright (c) 2012 Andrew Turner
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *notice, this list of conditions and the following disclaimer in the
- *documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *	$FreeBSD$
- */
-
-#include sys/cdefs.h
-__FBSDID($FreeBSD$);
-
-#include sys/types.h
-
-#include machine/sysarch.h
-
-void *
-__aeabi_read_tp()
-{
-	void *_tp;
-
-	asm(ldr %0, [%1]\n : =r(_tp) : r(ARM_TP_ADDRESS));
-
-	return _tp;
-}
Index: sys/arm/include/sysarch.h
===
--- sys/arm/include/sysarch.h	(revision 234093)
+++ sys/arm/include/sysarch.h	(working copy)
@@ 

Re: svn commit: r234074 - in head/sys: amd64/amd64 i386/i386

2012-04-10 Thread Marius Strobl
On Tue, Apr 10, 2012 at 01:03:56AM +0100, Attilio Rao wrote:
 Il 10 aprile 2012 00:09, Marius Strobl mar...@alchemy.franken.de ha scritto:
  On Mon, Apr 09, 2012 at 10:41:19PM +, Attilio Rao wrote:
  Author: attilio
  Date: Mon Apr ??9 22:41:19 2012
  New Revision: 234074
  URL: http://svn.freebsd.org/changeset/base/234074
 
  Log:
  ?? BSP is not added to the mask of valid target CPUs for interrupts
  ?? in set_apic_interrupt_ids(). Besides, set_apic_interrupts_ids() is not
  ?? called in the !SMP case too.
  ?? Fix this by:
  ?? - Adding the BSP as an interrupt target directly in cpu_startup().
  ?? - Remove an obsolete optimization where the BSP are skipped in
  ?? ?? set_apic_interrupt_ids().
 
  ?? Reported by: ?? ?? ?? ??jh
  ?? Reviewed by: ?? ?? ?? ??jhb
  ?? MFC after: ??3 days
  ?? X-MFC: ?? ?? ?? ?? ?? ?? ??r233961
  ?? Pointy hat to: ?? ?? ??me
 
  Modified:
  ?? head/sys/amd64/amd64/machdep.c
  ?? head/sys/amd64/amd64/mp_machdep.c
  ?? head/sys/i386/i386/machdep.c
  ?? head/sys/i386/i386/mp_machdep.c
 
  Modified: head/sys/amd64/amd64/machdep.c
  ==
  --- head/sys/amd64/amd64/machdep.c ?? ??Mon Apr ??9 22:01:43 2012 ?? ?? ?? 
  ??(r234073)
  +++ head/sys/amd64/amd64/machdep.c ?? ??Mon Apr ??9 22:41:19 2012 ?? ?? ?? 
  ??(r234074)
  @@ -295,6 +295,11 @@ cpu_startup(dummy)
  ?? ?? ?? vm_pager_bufferinit();
 
  ?? ?? ?? cpu_setregs();
  +
  + ?? ?? /*
  + ?? ?? ??* Add BSP as an interrupt target.
  + ?? ?? ??*/
  + ?? ?? intr_add_cpu(0);
  ??}
 
  If I'm not mistaken, intr_add_cpu() is under #ifdef SMP, so it should be
  here as well.
 
 You are right, sorry, I did forgot to test without SMP.
 I think we still need intr_add_cpu() on cpu_startup() because of the
 case smp_disabled = 1.
 I think the attached patch should make its dirty job, opinion?

I currently fail to see why the latter approach would be necessary,
i.e. IMO wrapping the intr_add_cpu() calls in cpu_startup() should
be sufficient. In case the kernel is compiled without SMP support,
interrupt balancing support isn't available in the first place and
the BSP is always the only available target (see the UP version of
intr_next_cpu() at the end of x86/x86/intr_machdep.c), so there's
no need to add the BSP as a valid target. If an SMP kernel is run
on a UP machine or with SMP disabled, interrupt balancing support
is available but the intr_add_cpu() calls in cpu_startup() will add
the BSP as (the only) target, so everything should be fine. Maybe
you can elaborate on why you think an SMP kernel with SMP disabled
needs special handling.

Marius

___
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: r234074 - in head/sys: amd64/amd64 i386/i386

2012-04-10 Thread Attilio Rao
Il 10 aprile 2012 12:41, Marius Strobl mar...@alchemy.franken.de ha scritto:
 On Tue, Apr 10, 2012 at 01:03:56AM +0100, Attilio Rao wrote:
 Il 10 aprile 2012 00:09, Marius Strobl mar...@alchemy.franken.de ha 
 scritto:
  On Mon, Apr 09, 2012 at 10:41:19PM +, Attilio Rao wrote:
  Author: attilio
  Date: Mon Apr ??9 22:41:19 2012
  New Revision: 234074
  URL: http://svn.freebsd.org/changeset/base/234074
 
  Log:
  ?? BSP is not added to the mask of valid target CPUs for interrupts
  ?? in set_apic_interrupt_ids(). Besides, set_apic_interrupts_ids() is not
  ?? called in the !SMP case too.
  ?? Fix this by:
  ?? - Adding the BSP as an interrupt target directly in cpu_startup().
  ?? - Remove an obsolete optimization where the BSP are skipped in
  ?? ?? set_apic_interrupt_ids().
 
  ?? Reported by: ?? ?? ?? ??jh
  ?? Reviewed by: ?? ?? ?? ??jhb
  ?? MFC after: ??3 days
  ?? X-MFC: ?? ?? ?? ?? ?? ?? ??r233961
  ?? Pointy hat to: ?? ?? ??me
 
  Modified:
  ?? head/sys/amd64/amd64/machdep.c
  ?? head/sys/amd64/amd64/mp_machdep.c
  ?? head/sys/i386/i386/machdep.c
  ?? head/sys/i386/i386/mp_machdep.c
 
  Modified: head/sys/amd64/amd64/machdep.c
  ==
  --- head/sys/amd64/amd64/machdep.c ?? ??Mon Apr ??9 22:01:43 2012 ?? ?? 
  ?? ??(r234073)
  +++ head/sys/amd64/amd64/machdep.c ?? ??Mon Apr ??9 22:41:19 2012 ?? ?? 
  ?? ??(r234074)
  @@ -295,6 +295,11 @@ cpu_startup(dummy)
  ?? ?? ?? vm_pager_bufferinit();
 
  ?? ?? ?? cpu_setregs();
  +
  + ?? ?? /*
  + ?? ?? ??* Add BSP as an interrupt target.
  + ?? ?? ??*/
  + ?? ?? intr_add_cpu(0);
  ??}
 
  If I'm not mistaken, intr_add_cpu() is under #ifdef SMP, so it should be
  here as well.

 You are right, sorry, I did forgot to test without SMP.
 I think we still need intr_add_cpu() on cpu_startup() because of the
 case smp_disabled = 1.
 I think the attached patch should make its dirty job, opinion?

 I currently fail to see why the latter approach would be necessary,
 i.e. IMO wrapping the intr_add_cpu() calls in cpu_startup() should
 be sufficient. In case the kernel is compiled without SMP support,
 interrupt balancing support isn't available in the first place and
 the BSP is always the only available target (see the UP version of
 intr_next_cpu() at the end of x86/x86/intr_machdep.c), so there's
 no need to add the BSP as a valid target. If an SMP kernel is run
 on a UP machine or with SMP disabled, interrupt balancing support
 is available but the intr_add_cpu() calls in cpu_startup() will add
 the BSP as (the only) target, so everything should be fine. Maybe
 you can elaborate on why you think an SMP kernel with SMP disabled
 needs special handling.

I do not understand what you mean.
Right now there is a compile time issue where for !SMP kernel it won't
compile and this is what I'm trying to fix now, so I don't understand
what do you mean here.

Attilio


-- 
Peace can only be achieved by understanding - A. Einstein
___
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: r234074 - in head/sys: amd64/amd64 i386/i386

2012-04-10 Thread Marius Strobl
On Tue, Apr 10, 2012 at 01:55:31PM +0100, Attilio Rao wrote:
 Il 10 aprile 2012 12:41, Marius Strobl mar...@alchemy.franken.de ha scritto:
  On Tue, Apr 10, 2012 at 01:03:56AM +0100, Attilio Rao wrote:
  Il 10 aprile 2012 00:09, Marius Strobl mar...@alchemy.franken.de ha 
  scritto:
   On Mon, Apr 09, 2012 at 10:41:19PM +, Attilio Rao wrote:
   Author: attilio
   Date: Mon Apr ??9 22:41:19 2012
   New Revision: 234074
   URL: http://svn.freebsd.org/changeset/base/234074
  
   Log:
   ?? BSP is not added to the mask of valid target CPUs for interrupts
   ?? in set_apic_interrupt_ids(). Besides, set_apic_interrupts_ids() is 
   not
   ?? called in the !SMP case too.
   ?? Fix this by:
   ?? - Adding the BSP as an interrupt target directly in cpu_startup().
   ?? - Remove an obsolete optimization where the BSP are skipped in
   ?? ?? set_apic_interrupt_ids().
  
   ?? Reported by: ?? ?? ?? ??jh
   ?? Reviewed by: ?? ?? ?? ??jhb
   ?? MFC after: ??3 days
   ?? X-MFC: ?? ?? ?? ?? ?? ?? ??r233961
   ?? Pointy hat to: ?? ?? ??me
  
   Modified:
   ?? head/sys/amd64/amd64/machdep.c
   ?? head/sys/amd64/amd64/mp_machdep.c
   ?? head/sys/i386/i386/machdep.c
   ?? head/sys/i386/i386/mp_machdep.c
  
   Modified: head/sys/amd64/amd64/machdep.c
   ==
   --- head/sys/amd64/amd64/machdep.c ?? ??Mon Apr ??9 22:01:43 2012 ?? ?? 
   ?? ??(r234073)
   +++ head/sys/amd64/amd64/machdep.c ?? ??Mon Apr ??9 22:41:19 2012 ?? ?? 
   ?? ??(r234074)
   @@ -295,6 +295,11 @@ cpu_startup(dummy)
   ?? ?? ?? vm_pager_bufferinit();
  
   ?? ?? ?? cpu_setregs();
   +
   + ?? ?? /*
   + ?? ?? ??* Add BSP as an interrupt target.
   + ?? ?? ??*/
   + ?? ?? intr_add_cpu(0);
   ??}
  
   If I'm not mistaken, intr_add_cpu() is under #ifdef SMP, so it should be
   here as well.
 
  You are right, sorry, I did forgot to test without SMP.
  I think we still need intr_add_cpu() on cpu_startup() because of the
  case smp_disabled = 1.
  I think the attached patch should make its dirty job, opinion?
 
  I currently fail to see why the latter approach would be necessary,
  i.e. IMO wrapping the intr_add_cpu() calls in cpu_startup() should
  be sufficient. In case the kernel is compiled without SMP support,
  interrupt balancing support isn't available in the first place and
  the BSP is always the only available target (see the UP version of
  intr_next_cpu() at the end of x86/x86/intr_machdep.c), so there's
  no need to add the BSP as a valid target. If an SMP kernel is run
  on a UP machine or with SMP disabled, interrupt balancing support
  is available but the intr_add_cpu() calls in cpu_startup() will add
  the BSP as (the only) target, so everything should be fine. Maybe
  you can elaborate on why you think an SMP kernel with SMP disabled
  needs special handling.
 
 I do not understand what you mean.

Well, so we are at least in the same boat :)

 Right now there is a compile time issue where for !SMP kernel it won't
 compile and this is what I'm trying to fix now, so I don't understand
 what do you mean here.
 

AFAICT the below patch should take care of UP in both the compile-time
and run-time cases.

Marius

Index: amd64/amd64/machdep.c
===
--- amd64/amd64/machdep.c   (revision 234095)
+++ amd64/amd64/machdep.c   (working copy)
@@ -296,10 +296,12 @@ cpu_startup(dummy)
 
cpu_setregs();
 
+#ifdef SMP
/*
 * Add BSP as an interrupt target.
 */
intr_add_cpu(0);
+#endif
 }
 
 /*
Index: i386/i386/machdep.c
===
--- i386/i386/machdep.c (revision 234095)
+++ i386/i386/machdep.c (working copy)
@@ -337,10 +337,12 @@ cpu_startup(dummy)
cpu_setregs();
 #endif
 
+#ifdef SMP
/*
 * Add BSP as an interrupt target.
 */
intr_add_cpu(0);
+#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


Re: svn commit: r234074 - in head/sys: amd64/amd64 i386/i386

2012-04-10 Thread Attilio Rao
Il 10 aprile 2012 14:25, Marius Strobl mar...@alchemy.franken.de ha scritto:
 On Tue, Apr 10, 2012 at 01:55:31PM +0100, Attilio Rao wrote:
 Il 10 aprile 2012 12:41, Marius Strobl mar...@alchemy.franken.de ha 
 scritto:
  On Tue, Apr 10, 2012 at 01:03:56AM +0100, Attilio Rao wrote:
  Il 10 aprile 2012 00:09, Marius Strobl mar...@alchemy.franken.de ha 
  scritto:
   On Mon, Apr 09, 2012 at 10:41:19PM +, Attilio Rao wrote:
   Author: attilio
   Date: Mon Apr ??9 22:41:19 2012
   New Revision: 234074
   URL: http://svn.freebsd.org/changeset/base/234074
  
   Log:
   ?? BSP is not added to the mask of valid target CPUs for interrupts
   ?? in set_apic_interrupt_ids(). Besides, set_apic_interrupts_ids() is 
   not
   ?? called in the !SMP case too.
   ?? Fix this by:
   ?? - Adding the BSP as an interrupt target directly in cpu_startup().
   ?? - Remove an obsolete optimization where the BSP are skipped in
   ?? ?? set_apic_interrupt_ids().
  
   ?? Reported by: ?? ?? ?? ??jh
   ?? Reviewed by: ?? ?? ?? ??jhb
   ?? MFC after: ??3 days
   ?? X-MFC: ?? ?? ?? ?? ?? ?? ??r233961
   ?? Pointy hat to: ?? ?? ??me
  
   Modified:
   ?? head/sys/amd64/amd64/machdep.c
   ?? head/sys/amd64/amd64/mp_machdep.c
   ?? head/sys/i386/i386/machdep.c
   ?? head/sys/i386/i386/mp_machdep.c
  
   Modified: head/sys/amd64/amd64/machdep.c
   ==
   --- head/sys/amd64/amd64/machdep.c ?? ??Mon Apr ??9 22:01:43 2012 ?? 
   ?? ?? ??(r234073)
   +++ head/sys/amd64/amd64/machdep.c ?? ??Mon Apr ??9 22:41:19 2012 ?? 
   ?? ?? ??(r234074)
   @@ -295,6 +295,11 @@ cpu_startup(dummy)
   ?? ?? ?? vm_pager_bufferinit();
  
   ?? ?? ?? cpu_setregs();
   +
   + ?? ?? /*
   + ?? ?? ??* Add BSP as an interrupt target.
   + ?? ?? ??*/
   + ?? ?? intr_add_cpu(0);
   ??}
  
   If I'm not mistaken, intr_add_cpu() is under #ifdef SMP, so it should be
   here as well.
 
  You are right, sorry, I did forgot to test without SMP.
  I think we still need intr_add_cpu() on cpu_startup() because of the
  case smp_disabled = 1.
  I think the attached patch should make its dirty job, opinion?
 
  I currently fail to see why the latter approach would be necessary,
  i.e. IMO wrapping the intr_add_cpu() calls in cpu_startup() should
  be sufficient. In case the kernel is compiled without SMP support,
  interrupt balancing support isn't available in the first place and
  the BSP is always the only available target (see the UP version of
  intr_next_cpu() at the end of x86/x86/intr_machdep.c), so there's
  no need to add the BSP as a valid target. If an SMP kernel is run
  on a UP machine or with SMP disabled, interrupt balancing support
  is available but the intr_add_cpu() calls in cpu_startup() will add
  the BSP as (the only) target, so everything should be fine. Maybe
  you can elaborate on why you think an SMP kernel with SMP disabled
  needs special handling.

 I do not understand what you mean.

 Well, so we are at least in the same boat :)

 Right now there is a compile time issue where for !SMP kernel it won't
 compile and this is what I'm trying to fix now, so I don't understand
 what do you mean here.


 AFAICT the below patch should take care of UP in both the compile-time
 and run-time cases.

Not sure why, I was convinced that this patch was going to break the
SMP + smp_disabled=1 case but of course it is not.

Please go ahead and commit it, thanks.

Attilio


-- 
Peace can only be achieved by understanding - A. Einstein
___
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: r234074 - in head/sys: amd64/amd64 i386/i386

2012-04-10 Thread John Baldwin
On Monday, April 09, 2012 7:09:49 pm Marius Strobl wrote:
 On Mon, Apr 09, 2012 at 10:41:19PM +, Attilio Rao wrote:
  Author: attilio
  Date: Mon Apr  9 22:41:19 2012
  New Revision: 234074
  URL: http://svn.freebsd.org/changeset/base/234074
  
  Log:
BSP is not added to the mask of valid target CPUs for interrupts
in set_apic_interrupt_ids(). Besides, set_apic_interrupts_ids() is not
called in the !SMP case too.
Fix this by:
- Adding the BSP as an interrupt target directly in cpu_startup().
- Remove an obsolete optimization where the BSP are skipped in
  set_apic_interrupt_ids().

Reported by:  jh
Reviewed by:  jhb
MFC after:3 days
X-MFC:r233961
Pointy hat to:me
  
  Modified:
head/sys/amd64/amd64/machdep.c
head/sys/amd64/amd64/mp_machdep.c
head/sys/i386/i386/machdep.c
head/sys/i386/i386/mp_machdep.c
  
  Modified: head/sys/amd64/amd64/machdep.c
  
==
  --- head/sys/amd64/amd64/machdep.c  Mon Apr  9 22:01:43 2012
  (r234073)
  +++ head/sys/amd64/amd64/machdep.c  Mon Apr  9 22:41:19 2012
  (r234074)
  @@ -295,6 +295,11 @@ cpu_startup(dummy)
  vm_pager_bufferinit();
   
  cpu_setregs();
  +
  +   /*
  +* Add BSP as an interrupt target.
  +*/
  +   intr_add_cpu(0);
   }
 
 If I'm not mistaken, intr_add_cpu() is under #ifdef SMP, so it should be
 here as well.

Correct.  This is why I had put it in intr_machdep.c in the big #ifdef SMP 
block where all the interrupt target stuff lives.  Adding #ifdef's here is
fine as well though.

-- 
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


svn commit: r234098 - head/sys/net

2012-04-10 Thread John Baldwin
Author: jhb
Date: Tue Apr 10 13:59:35 2012
New Revision: 234098
URL: http://svn.freebsd.org/changeset/base/234098

Log:
  Add media types for 40G media that might be used with FreeBSD.
  
  Reviewed by:  bz
  MFC after:2 weeks

Modified:
  head/sys/net/if_media.h

Modified: head/sys/net/if_media.h
==
--- head/sys/net/if_media.h Tue Apr 10 13:37:43 2012(r234097)
+++ head/sys/net/if_media.h Tue Apr 10 13:59:35 2012(r234098)
@@ -150,6 +150,9 @@ uint64_tifmedia_baudrate(int);
 #defineIFM_10G_LRM 24  /* 10GBase-LRM 850nm Multi-mode 
*/
 #defineIFM_UNKNOWN 25  /* media types not defined yet 
*/
 #defineIFM_10G_T   26  /* 10GBase-T - RJ45 */
+#defineIFM_40G_CR4 27  /* 40GBase-CR4 */
+#defineIFM_40G_SR4 28  /* 40GBase-SR4 */
+#defineIFM_40G_LR4 29  /* 40GBase-LR4 */
 
 /* note 31 is the max! */
 
@@ -360,6 +363,9 @@ struct ifmedia_description {
{ IFM_10G_TWINAX_LONG,  10Gbase-Twinax-Long },\
{ IFM_UNKNOWN,  Unknown },\
{ IFM_10G_T,10Gbase-T },  \
+   { IFM_40G_CR4,  40Gbase-CR4 },\
+   { IFM_40G_SR4,  40Gbase-SR4 },\
+   { IFM_40G_LR4,  40Gbase-LR4 },\
{ 0, NULL },\
 }
 
@@ -658,6 +664,9 @@ struct ifmedia_baudrate {
{ IFM_ETHER | IFM_10G_TWINAX_LONG,  IF_Gbps(10ULL) },   \
{ IFM_ETHER | IFM_10G_LRM,  IF_Gbps(10ULL) },   \
{ IFM_ETHER | IFM_10G_T,IF_Gbps(10ULL) },   \
+   { IFM_ETHER | IFM_40G_CR4,  IF_Gbps(40ULL) },   \
+   { IFM_ETHER | IFM_40G_SR4,  IF_Gbps(40ULL) },   \
+   { IFM_ETHER | IFM_40G_LR4,  IF_Gbps(40ULL) },   \
\
{ IFM_TOKEN | IFM_TOK_STP4, IF_Mbps(4) },   \
{ IFM_TOKEN | IFM_TOK_STP16,IF_Mbps(16) },  \
___
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: r234099 - head/sys/ofed/drivers/net/mlx4

2012-04-10 Thread John Baldwin
Author: jhb
Date: Tue Apr 10 14:01:09 2012
New Revision: 234099
URL: http://svn.freebsd.org/changeset/base/234099

Log:
  Properly parse 40G media types from newer Mellanox adapters that are
  40G capable.  For now, map all 40G links to 40GBase-CR4.
  
  MFC after:2 weeks

Modified:
  head/sys/ofed/drivers/net/mlx4/en_netdev.c
  head/sys/ofed/drivers/net/mlx4/en_port.c
  head/sys/ofed/drivers/net/mlx4/en_port.h

Modified: head/sys/ofed/drivers/net/mlx4/en_netdev.c
==
--- head/sys/ofed/drivers/net/mlx4/en_netdev.c  Tue Apr 10 13:59:35 2012
(r234098)
+++ head/sys/ofed/drivers/net/mlx4/en_netdev.c  Tue Apr 10 14:01:09 2012
(r234099)
@@ -991,12 +991,20 @@ static int mlx4_en_calc_media(struct mlx
active |= IFM_FDX;
trans_type = priv-port_state.transciver;
/* XXX I don't know all of the transceiver values. */
-   if (priv-port_state.link_speed == 1000)
+   switch (priv-port_state.link_speed) {
+   case 1000:
active |= IFM_1000_T;
-   else if (trans_type  0  trans_type = 0xC)
-   active |= IFM_10G_SR;
-   else if (trans_type == 0x80 || trans_type == 0)
-   active |= IFM_10G_CX4;
+   break;
+   case 1:
+   if (trans_type  0  trans_type = 0xC)
+   active |= IFM_10G_SR;
+   else if (trans_type == 0x80 || trans_type == 0)
+   active |= IFM_10G_CX4;
+   break;
+   case 4:
+   active |= IFM_40G_CR4;
+   break;
+   }
if (priv-prof-tx_pause)
active |= IFM_ETH_TXPAUSE;
if (priv-prof-rx_pause)

Modified: head/sys/ofed/drivers/net/mlx4/en_port.c
==
--- head/sys/ofed/drivers/net/mlx4/en_port.cTue Apr 10 13:59:35 2012
(r234098)
+++ head/sys/ofed/drivers/net/mlx4/en_port.cTue Apr 10 14:01:09 2012
(r234099)
@@ -152,11 +152,21 @@ int mlx4_en_QUERY_PORT(struct mlx4_en_de
/* This command is always accessed from Ethtool context
 * already synchronized, no need in locking */
state-link_state = !!(qport_context-link_up  MLX4_EN_LINK_UP_MASK);
-   if ((qport_context-link_speed  MLX4_EN_SPEED_MASK) ==
-   MLX4_EN_1G_SPEED)
+   switch (qport_context-link_speed  MLX4_EN_SPEED_MASK) {
+   case MLX4_EN_1G_SPEED:
state-link_speed = 1000;
-   else
+   break;
+   case MLX4_EN_10G_SPEED_XAUI:
+   case MLX4_EN_10G_SPEED_XFI:
state-link_speed = 1;
+   break;
+   case MLX4_EN_40G_SPEED:
+   state-link_speed = 4;
+   break;
+   default:
+   state-link_speed = -1;
+   break;
+   }
state-transciver = qport_context-transceiver;
if (be32_to_cpu(qport_context-transceiver_code_hi)  0x400)
state-transciver = 0x80;

Modified: head/sys/ofed/drivers/net/mlx4/en_port.h
==
--- head/sys/ofed/drivers/net/mlx4/en_port.hTue Apr 10 13:59:35 2012
(r234098)
+++ head/sys/ofed/drivers/net/mlx4/en_port.hTue Apr 10 14:01:09 2012
(r234099)
@@ -85,6 +85,14 @@ enum {
MLX4_MCAST_ENABLE   = 2,
 };
 
+enum {
+   MLX4_EN_1G_SPEED= 0x02,
+   MLX4_EN_10G_SPEED_XFI   = 0x01,
+   MLX4_EN_10G_SPEED_XAUI  = 0x00,
+   MLX4_EN_40G_SPEED   = 0x40,
+   MLX4_EN_OTHER_SPEED = 0x0f,
+};
+
 struct mlx4_en_query_port_context {
u8 link_up;
 #define MLX4_EN_LINK_UP_MASK   0x80
@@ -92,8 +100,7 @@ struct mlx4_en_query_port_context {
__be16 mtu;
u8 reserved2;
u8 link_speed;
-#define MLX4_EN_SPEED_MASK 0x3
-#define MLX4_EN_1G_SPEED   0x2
+#define MLX4_EN_SPEED_MASK 0x43
u16 reserved3[5];
__be64 mac;
u8 transceiver;
___
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: r234101 - head/usr.bin/lex

2012-04-10 Thread Jens Schweikhardt
Author: schweikh
Date: Tue Apr 10 15:29:28 2012
New Revision: 234101
URL: http://svn.freebsd.org/changeset/base/234101

Log:
  Parenthesize args in yyless() and unput() replacement text
  so they are safer when used with expressions.
  
  MFC after:1 week

Modified:
  head/usr.bin/lex/flex.skl

Modified: head/usr.bin/lex/flex.skl
==
--- head/usr.bin/lex/flex.skl   Tue Apr 10 14:29:56 2012(r234100)
+++ head/usr.bin/lex/flex.skl   Tue Apr 10 15:29:28 2012(r234101)
@@ -122,7 +122,7 @@ extern FILE *yyin, *yyout;
 #define EOB_ACT_LAST_MATCH 2
 
 /* The funky do-while in the following #define is used to turn the definition
- * int a single C statement (which needs a semi-colon terminator).  This
+ * into a single C statement (which needs a semi-colon terminator).  This
  * avoids problems with code like:
  *
  * if ( condition_holds )
@@ -143,12 +143,12 @@ extern FILE *yyin, *yyout;
/* Undo effects of setting up yytext. */ \
*yy_cp = yy_hold_char; \
YY_RESTORE_YY_MORE_OFFSET \
-   yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
+   yy_c_buf_p = yy_cp = yy_bp + (n) - YY_MORE_ADJ; \
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
} \
while ( 0 )
 
-#define unput(c) yyunput( c, yytext_ptr )
+#define unput(c) yyunput( (c), yytext_ptr )
 
 /* The following is because we cannot portably get our hands on size_t
  * (without autoconf's help, which isn't available because we want
___
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: r234103 - in head: lib/libc/sys sys/ufs/ufs

2012-04-10 Thread Jaakko Heinonen
Author: jh
Date: Tue Apr 10 15:59:37 2012
New Revision: 234103
URL: http://svn.freebsd.org/changeset/base/234103

Log:
  - Return EPERM from ufs_setattr() when an user without PRIV_VFS_SYSFLAGS
privilege attempts to toggle SF_SETTABLE flags.
  - Use the '^' operator in the SF_SNAPSHOT anti-toggling check.
  
  Flags are now stored to ip-i_flags in one place after all checks.
  
  Submitted by: bde

Modified:
  head/lib/libc/sys/chflags.2
  head/sys/ufs/ufs/ufs_vnops.c

Modified: head/lib/libc/sys/chflags.2
==
--- head/lib/libc/sys/chflags.2 Tue Apr 10 15:58:22 2012(r234102)
+++ head/lib/libc/sys/chflags.2 Tue Apr 10 15:59:37 2012(r234103)
@@ -28,7 +28,7 @@
 .\@(#)chflags.2   8.3 (Berkeley) 5/2/95
 .\ $FreeBSD$
 .\
-.Dd Oct 29, 2010
+.Dd Apr 10, 2012
 .Dt CHFLAGS 2
 .Os
 .Sh NAME
@@ -114,8 +114,7 @@ The
 and
 .Dv SF_ARCHIVED
 flags may only be set or unset by the super-user.
-Attempts to set these flags by non-super-users are rejected, attempts by
-non-superusers to clear flags that are already unset are silently ignored.
+Attempts to toggle these flags by non-super-users are rejected.
 These flags may be set at any time, but normally may only be unset when
 the system is in single-user mode.
 (See

Modified: head/sys/ufs/ufs/ufs_vnops.c
==
--- head/sys/ufs/ufs/ufs_vnops.cTue Apr 10 15:58:22 2012
(r234102)
+++ head/sys/ufs/ufs/ufs_vnops.cTue Apr 10 15:59:37 2012
(r234103)
@@ -555,23 +555,17 @@ ufs_setattr(ap)
if (error)
return (error);
}
-   /* Snapshot flag cannot be set or cleared */
-   if (((vap-va_flags  SF_SNAPSHOT) != 0 
-(ip-i_flags  SF_SNAPSHOT) == 0) ||
-   ((vap-va_flags  SF_SNAPSHOT) == 0 
-(ip-i_flags  SF_SNAPSHOT) != 0))
+   /* The snapshot flag cannot be toggled. */
+   if ((vap-va_flags ^ ip-i_flags)  SF_SNAPSHOT)
return (EPERM);
-   ip-i_flags = vap-va_flags;
-   DIP_SET(ip, i_flags, vap-va_flags);
} else {
if (ip-i_flags 
(SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND) ||
-   (vap-va_flags  UF_SETTABLE) != vap-va_flags)
+   ((vap-va_flags ^ ip-i_flags)  SF_SETTABLE))
return (EPERM);
-   ip-i_flags = SF_SETTABLE;
-   ip-i_flags |= (vap-va_flags  UF_SETTABLE);
-   DIP_SET(ip, i_flags, ip-i_flags);
}
+   ip-i_flags = vap-va_flags;
+   DIP_SET(ip, i_flags, vap-va_flags);
ip-i_flag |= IN_CHANGE;
error = UFS_UPDATE(vp, 0);
if (ip-i_flags  (IMMUTABLE | APPEND))
___
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: r234104 - head/sys/fs/ext2fs

2012-04-10 Thread Jaakko Heinonen
Author: jh
Date: Tue Apr 10 16:05:52 2012
New Revision: 234104
URL: http://svn.freebsd.org/changeset/base/234104

Log:
  Apply changes from r233787 to ext2fs:
  
  - Use more natural ip-i_flags instead of vap-va_flags in the final
flags check.
  - Style improvements.
  
  No functional change intended.
  
  MFC after:2 weeks

Modified:
  head/sys/fs/ext2fs/ext2_vnops.c

Modified: head/sys/fs/ext2fs/ext2_vnops.c
==
--- head/sys/fs/ext2fs/ext2_vnops.c Tue Apr 10 15:59:37 2012
(r234103)
+++ head/sys/fs/ext2fs/ext2_vnops.c Tue Apr 10 16:05:52 2012
(r234104)
@@ -407,7 +407,6 @@ ext2_setattr(ap)
/* Disallow flags not supported by ext2fs. */
if(vap-va_flags  ~(SF_APPEND | SF_IMMUTABLE | UF_NODUMP))
return (EOPNOTSUPP);
-
if (vp-v_mount-mnt_flag  MNT_RDONLY)
return (EROFS);
/*
@@ -424,23 +423,23 @@ ext2_setattr(ap)
 * if securelevel  0 and any existing system flags are set.
 */
if (!priv_check_cred(cred, PRIV_VFS_SYSFLAGS, 0)) {
-   if (ip-i_flags
-(SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND)) {
+   if (ip-i_flags 
+   (SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND)) {
error = securelevel_gt(cred, 0);
if (error)
return (error);
}
ip-i_flags = vap-va_flags;
} else {
-   if (ip-i_flags
-(SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND) ||
+   if (ip-i_flags 
+   (SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND) ||
(vap-va_flags  UF_SETTABLE) != vap-va_flags)
return (EPERM);
ip-i_flags = SF_SETTABLE;
ip-i_flags |= (vap-va_flags  UF_SETTABLE);
}
ip-i_flag |= IN_CHANGE;
-   if (vap-va_flags  (IMMUTABLE | APPEND))
+   if (ip-i_flags  (IMMUTABLE | APPEND))
return (0);
}
if (ip-i_flags  (IMMUTABLE | APPEND))
___
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: r234105 - in head/sys: amd64/amd64 i386/i386

2012-04-10 Thread Marius Strobl
Author: marius
Date: Tue Apr 10 16:08:46 2012
New Revision: 234105
URL: http://svn.freebsd.org/changeset/base/234105

Log:
  Fix !SMP build after r234074.
  
  Reviewed by:  attilio, jhb

Modified:
  head/sys/amd64/amd64/machdep.c
  head/sys/i386/i386/machdep.c

Modified: head/sys/amd64/amd64/machdep.c
==
--- head/sys/amd64/amd64/machdep.c  Tue Apr 10 16:05:52 2012
(r234104)
+++ head/sys/amd64/amd64/machdep.c  Tue Apr 10 16:08:46 2012
(r234105)
@@ -296,10 +296,12 @@ cpu_startup(dummy)
 
cpu_setregs();
 
+#ifdef SMP
/*
 * Add BSP as an interrupt target.
 */
intr_add_cpu(0);
+#endif
 }
 
 /*

Modified: head/sys/i386/i386/machdep.c
==
--- head/sys/i386/i386/machdep.cTue Apr 10 16:05:52 2012
(r234104)
+++ head/sys/i386/i386/machdep.cTue Apr 10 16:08:46 2012
(r234105)
@@ -337,10 +337,12 @@ cpu_startup(dummy)
cpu_setregs();
 #endif
 
+#ifdef SMP
/*
 * Add BSP as an interrupt target.
 */
intr_add_cpu(0);
+#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: r234106 - head/sys/dev/isci

2012-04-10 Thread Jim Harris
Author: jimharris
Date: Tue Apr 10 16:33:19 2012
New Revision: 234106
URL: http://svn.freebsd.org/changeset/base/234106

Log:
  Queue CCBs internally instead of using CAM_REQUEUE_REQ status.  This fixes
  problem where userspace apps such as smartctl fail due to CAM_REQUEUE_REQ
  status getting returned when tagged commands are outstanding when smartctl
  sends its I/O using the pass(4) interface.
  
  Sponsored by: Intel
  Found and tested by: Ravi Pokala rpokala at panasas dot com
  Reviewed by: scottl
  Approved by: scottl
  MFC after: 1 week

Modified:
  head/sys/dev/isci/isci.h
  head/sys/dev/isci/isci_controller.c
  head/sys/dev/isci/isci_io_request.c
  head/sys/dev/isci/isci_remote_device.c

Modified: head/sys/dev/isci/isci.h
==
--- head/sys/dev/isci/isci.hTue Apr 10 16:08:46 2012(r234105)
+++ head/sys/dev/isci/isci.hTue Apr 10 16:33:19 2012(r234106)
@@ -86,6 +86,7 @@ struct ISCI_REMOTE_DEVICE {
BOOLis_resetting;
uint32_tfrozen_lun_mask;
SCI_FAST_LIST_ELEMENT_T pending_device_reset_element;
+   TAILQ_HEAD(,ccb_hdr)queued_ccbs;
 };
 
 struct ISCI_DOMAIN {

Modified: head/sys/dev/isci/isci_controller.c
==
--- head/sys/dev/isci/isci_controller.c Tue Apr 10 16:08:46 2012
(r234105)
+++ head/sys/dev/isci/isci_controller.c Tue Apr 10 16:33:19 2012
(r234106)
@@ -430,6 +430,7 @@ int isci_controller_allocate_memory(stru
remote_device-frozen_lun_mask = 0;
sci_fast_list_element_init(remote_device,
remote_device-pending_device_reset_element);
+   TAILQ_INIT(remote_device-queued_ccbs);
 
/*
 * For the first SCI_MAX_DOMAINS device objects, do not put

Modified: head/sys/dev/isci/isci_io_request.c
==
--- head/sys/dev/isci/isci_io_request.c Tue Apr 10 16:08:46 2012
(r234105)
+++ head/sys/dev/isci/isci_io_request.c Tue Apr 10 16:33:19 2012
(r234106)
@@ -85,7 +85,9 @@ isci_io_request_complete(SCI_CONTROLLER_
struct ISCI_CONTROLLER *isci_controller;
struct ISCI_REMOTE_DEVICE *isci_remote_device;
union ccb *ccb;
+   BOOL complete_ccb;
 
+   complete_ccb = TRUE;
isci_controller = (struct ISCI_CONTROLLER *) 
sci_object_get_association(scif_controller);
isci_remote_device =
(struct ISCI_REMOTE_DEVICE *) 
sci_object_get_association(remote_device);
@@ -163,9 +165,7 @@ isci_io_request_complete(SCI_CONTROLLER_
 
case SCI_IO_FAILURE_INVALID_STATE:
case SCI_IO_FAILURE_INSUFFICIENT_RESOURCES:
-   ccb-ccb_h.status |= CAM_REQUEUE_REQ;
-   isci_remote_device_freeze_lun_queue(isci_remote_device,
-   ccb-ccb_h.target_lun);
+   complete_ccb = FALSE;
break;
 
case SCI_IO_FAILURE_INVALID_REMOTE_DEVICE:
@@ -189,7 +189,7 @@ isci_io_request_complete(SCI_CONTROLLER_

scif_remote_device_get_max_queue_depth(remote_device);
xpt_action((union ccb *)ccb_relsim);
xpt_free_path(path);
-   ccb-ccb_h.status |= CAM_REQUEUE_REQ;
+   complete_ccb = FALSE;
}
break;
 
@@ -209,17 +209,6 @@ isci_io_request_complete(SCI_CONTROLLER_
break;
}
 
-   if (ccb-ccb_h.status != CAM_REQ_CMP) {
-   /* ccb will be completed with some type of non-success
-*  status.  So temporarily freeze the queue until the
-*  upper layers can act on the status.  The CAM_DEV_QFRZN
-*  flag will then release the queue after the status is
-*  acted upon.
-*/
-   ccb-ccb_h.status |= CAM_DEV_QFRZN;
-   xpt_freeze_devq(ccb-ccb_h.path, 1);
-   }
-
callout_stop(isci_request-parent.timer);
bus_dmamap_sync(isci_request-parent.dma_tag,
isci_request-parent.dma_map,
@@ -228,20 +217,43 @@ isci_io_request_complete(SCI_CONTROLLER_
bus_dmamap_unload(isci_request-parent.dma_tag,
isci_request-parent.dma_map);
 
-   if (isci_remote_device-frozen_lun_mask != 0 
-   !(ccb-ccb_h.status  CAM_REQUEUE_REQ))
-   isci_remote_device_release_device_queue(isci_remote_device);
-
-   xpt_done(ccb);
isci_request-ccb = NULL;
 
-   if (isci_controller-is_frozen == TRUE) {
-   isci_controller-is_frozen = FALSE;
-   xpt_release_simq(isci_controller-sim, TRUE);
-   }
-
sci_pool_put(isci_controller-request_pool,
(struct ISCI_REQUEST *)isci_request);
+
+   if 

svn commit: r234107 - head/lib/libgeom

2012-04-10 Thread Juli Mallett
Author: jmallett
Date: Tue Apr 10 17:37:24 2012
New Revision: 234107
URL: http://svn.freebsd.org/changeset/base/234107

Log:
  Back out r233646.  Although it fixed most libgeom consumers under 32-bit
  compatibility, it broke programs using devstat, under 32-bit compatibility and
  not.
  
  It's very difficult to fix the identifiers used by devstat, so this change is
  simply being backed out.  Since changes to 3rd-party code seem likely, and 
may be
  necessary to properly fix 32-bit binaries on 64-bit kernel, it would seem 
better
  to make more invasive changes to fix GEOM's problems with 32-bit 
compatibility in
  general.
  
  The right thing to do is to replace all of the use of pointers as opaque
  identifiers with a fixed-size (64-bit or even 32-bit should be enough for 
tracking
  unique GEOM elments) field.  That probably maintains source compatibility with
  most GEOM consumers, and allows xml2tree to make better assumptions about how 
to
  decode the identifiers.
  
  Submitted by: Anton Yuzhaninov

Modified:
  head/lib/libgeom/geom_xml2tree.c
  head/lib/libgeom/libgeom.h

Modified: head/lib/libgeom/geom_xml2tree.c
==
--- head/lib/libgeom/geom_xml2tree.cTue Apr 10 16:33:19 2012
(r234106)
+++ head/lib/libgeom/geom_xml2tree.cTue Apr 10 17:37:24 2012
(r234107)
@@ -55,56 +55,9 @@ struct mystate {
int level;
struct sbuf *sbuf[20];
struct gconf*config;
-   unsignednident;
+   int nident;
 };
 
-static void *
-internalize_ident(struct mystate *mt, const char *element, const char *str)
-{
-   struct gident *gip;
-   unsigned i;
-
-   if (mt-nident != 0  mt-mesh-lg_ident == NULL) {
-   warn(Cannot continue due to previous memory exhaustion.);
-   return (NULL);
-   }
-
-   for (i = 0; i  mt-nident; i++) {
-   if (strcmp(mt-mesh-lg_ident[i].lg_id, str) != 0)
-   continue;
-   return ((void *)(uintptr_t)(i + 1));
-   }
-
-   i = mt-nident;
-   mt-nident++;
-   mt-mesh-lg_ident = reallocf(mt-mesh-lg_ident, (mt-nident + 1) * 
sizeof mt-mesh-lg_ident[0]);
-   if (mt-mesh-lg_ident == NULL) {
-   warn(Cannot allocate memory during processing of '%s' 
-   element for identifier '%s', element, str);
-   return (NULL);
-   }
-
-   gip = mt-mesh-lg_ident[i];
-   gip-lg_id = strdup(str);
-   if (gip-lg_id == NULL) {
-   free(mt-mesh-lg_ident);
-   mt-mesh-lg_ident = NULL;
-   warn(Cannot allocate memory during processing of '%s' 
-   element for identifier '%s', element, str);
-   return (NULL);
-   }
-   gip-lg_ptr = NULL;
-   gip-lg_what = ISUNRESOLVED;
-
-   /* Terminator entry.  */
-   gip = mt-mesh-lg_ident[i + 1];
-   gip-lg_id = NULL;
-   gip-lg_ptr = NULL;
-   gip-lg_what = ISUNRESOLVED;
-
-   return ((void *)(uintptr_t)(i + 1));
-}
-
 static void
 StartElement(void *userData, const char *name, const char **attr)
 {
@@ -120,9 +73,10 @@ StartElement(void *userData, const char 
ref = NULL;
for (i = 0; attr[i] != NULL; i += 2) {
if (!strcmp(attr[i], id)) {
-   id = internalize_ident(mt, name, attr[i + 1]);
+   id = (void *)strtoul(attr[i + 1], NULL, 0);
+   mt-nident++;
} else if (!strcmp(attr[i], ref)) {
-   ref = internalize_ident(mt, name, attr[i + 1]);
+   ref = (void *)strtoul(attr[i + 1], NULL, 0);
} else
printf(%*.*s[%s = %s]\n,
mt-level + 1, mt-level + 1, ,
@@ -363,16 +317,11 @@ CharData(void *userData , const XML_Char
 struct gident *
 geom_lookupid(struct gmesh *gmp, const void *id)
 {
-   unsigned i;
-
-   if (gmp-lg_ident == NULL)
-   return (NULL);
+   struct gident *gip;
 
-   for (i = 0; gmp-lg_ident[i].lg_id != NULL; i++) {
-   if (i + 1 != (unsigned)(uintptr_t)id)
-   continue;
-   return (gmp-lg_ident[i]);
-   }
+   for (gip = gmp-lg_ident; gip-lg_id != NULL; gip++)
+   if (gip-lg_id == id)
+   return (gip);
return (NULL);
 }
 
@@ -385,7 +334,6 @@ geom_xml2tree(struct gmesh *gmp, char *p
struct ggeom *ge;
struct gprovider *pr;
struct gconsumer *co;
-   struct gident *gip;
int i;
 
memset(gmp, 0, sizeof *gmp);
@@ -408,30 +356,33 @@ geom_xml2tree(struct gmesh *gmp, char *p
free(mt);
return (-1);
}
-   if (gmp-lg_ident == NULL  mt-nident != 0) {
-   free(mt);
-   return (ENOMEM);
-   

svn commit: r234109 - head/sys/dev/ath

2012-04-10 Thread Adrian Chadd
Author: adrian
Date: Tue Apr 10 19:25:43 2012
New Revision: 234109
URL: http://svn.freebsd.org/changeset/base/234109

Log:
  Convert the flags over to a set of bit flags.

Modified:
  head/sys/dev/ath/if_athvar.h

Modified: head/sys/dev/ath/if_athvar.h
==
--- head/sys/dev/ath/if_athvar.hTue Apr 10 19:11:09 2012
(r234108)
+++ head/sys/dev/ath/if_athvar.hTue Apr 10 19:25:43 2012
(r234109)
@@ -206,18 +206,19 @@ struct ath_buf {
uint16_t bfs_nframes;   /* number of frames in aggregate */
uint16_t bfs_ndelim;/* number of delims for padding */
 
-   int bfs_aggr:1; /* part of aggregate? */
-   int bfs_aggrburst:1;/* part of aggregate burst? */
-   int bfs_isretried:1;/* retried frame? */
-   int bfs_dobaw:1;/* actually check against BAW? */
-   int bfs_addedbaw:1; /* has been added to the BAW */
-   int bfs_shpream:1;  /* use short preamble */
-   int bfs_istxfrag:1; /* is fragmented */
-   int bfs_ismrr:1;/* do multi-rate TX retry */
-   int bfs_doprot:1;   /* do RTS/CTS based protection */
-   int bfs_doratelookup:1; /* do rate lookup before each TX */
-   int bfs_need_seqno:1;   /* need to assign a seqno for 
aggregation */
-   int bfs_seqno_assigned:1;   /* seqno has been assigned */
+   u_int32_t bfs_aggr:1,   /* part of aggregate? */
+   bfs_aggrburst:1,/* part of aggregate burst? */
+   bfs_isretried:1,/* retried frame? */
+   bfs_dobaw:1,/* actually check against BAW? */
+   bfs_addedbaw:1, /* has been added to the BAW */
+   bfs_shpream:1,  /* use short preamble */
+   bfs_istxfrag:1, /* is fragmented */
+   bfs_ismrr:1,/* do multi-rate TX retry */
+   bfs_doprot:1,   /* do RTS/CTS based protection */
+   bfs_doratelookup:1, /* do rate lookup before each TX */
+   bfs_need_seqno:1,   /* need to assign a seqno for aggr */
+   bfs_seqno_assigned:1;   /* seqno has been assigned */
+
int bfs_nfl;/* next fragment length */
 
/*
___
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: r233925 - in head: sys/kern sys/sys sys/vm usr.bin/kdump usr.bin/ktrace

2012-04-10 Thread Andrey Zonov

On 05.04.2012 21:13, John Baldwin wrote:

Author: jhb
Date: Thu Apr  5 17:13:14 2012
New Revision: 233925
URL: http://svn.freebsd.org/changeset/base/233925

Log:
   Add new ktrace records for the start and end of VM faults.  This gives
   a pair of records similar to syscall entry and return that a user can
   use to determine how long page faults take.  The new ktrace records are
   enabled via the 'p' trace type, and are enabled in the default set of
   trace points.

   Reviewed by: kib
   MFC after:   2 weeks



Hi John,

Thanks a lot, this change is very useful!

And while you are here I would like to show you a patch which adds a 
wmesg to the context switch tracing.  It is not finished, it's just a 
concept.  Please review it and if you are interesting in that I'll 
finish it and will test more widely.


--
Andrey Zonov
Index: usr.bin/kdump/kdump.c
===
--- usr.bin/kdump/kdump.c   (revision 233925)
+++ usr.bin/kdump/kdump.c   (working copy)
@@ -1247,8 +1247,8 @@ ktrpsig(struct ktr_psig *psig)
 void
 ktrcsw(struct ktr_csw *cs)
 {
-   printf(%s %s\n, cs-out ? stop : resume,
-   cs-user ? user : kernel);
+   printf(%s %s \%s\\n, cs-out ? stop : resume,
+   cs-user ? user : kernel, cs-wmesg ? cs-wmesg : );
 }
 
 #defineUTRACE_DLOPEN_START 1
Index: sys/sys/ktrace.h
===
--- sys/sys/ktrace.h(revision 233925)
+++ sys/sys/ktrace.h(working copy)
@@ -138,6 +138,7 @@ struct ktr_psig {
 struct ktr_csw {
int out;/* 1 if switch out, 0 if switch in */
int user;   /* 1 if usermode (ivcsw), 0 if kernel (vcsw) */
+   charwmesg[8];
 };
 
 /*
@@ -244,7 +245,7 @@ struct ktr_faultend {
 
 #ifdef _KERNEL
 void   ktrnamei(char *);
-void   ktrcsw(int, int);
+void   ktrcsw(int, int, const char *);
 void   ktrpsig(int, sig_t, sigset_t *, int);
 void   ktrfault(vm_offset_t, int);
 void   ktrfaultend(int);
Index: sys/kern/kern_ktrace.c
===
--- sys/kern/kern_ktrace.c  (revision 233925)
+++ sys/kern/kern_ktrace.c  (working copy)
@@ -733,8 +733,9 @@ ktrpsig(sig, action, mask, code)
 }
 
 void
-ktrcsw(out, user)
+ktrcsw(out, user, wmesg)
int out, user;
+   const char *wmesg;
 {
struct thread *td = curthread;
struct ktr_request *req;
@@ -746,6 +747,8 @@ void
kc = req-ktr_data.ktr_csw;
kc-out = out;
kc-user = user;
+   if (wmesg != NULL)
+   strncpy(kc-wmesg, wmesg, sizeof(kc-wmesg));
ktr_enqueuerequest(td, req);
ktrace_exit(td);
 }
Index: sys/kern/subr_trap.c
===
--- sys/kern/subr_trap.c(revision 233925)
+++ sys/kern/subr_trap.c(working copy)
@@ -219,7 +219,7 @@ ast(struct trapframe *framep)
if (flags  TDF_NEEDRESCHED) {
 #ifdef KTRACE
if (KTRPOINT(td, KTR_CSW))
-   ktrcsw(1, 1);
+   ktrcsw(1, 1, NULL);
 #endif
thread_lock(td);
sched_prio(td, td-td_user_pri);
@@ -227,7 +227,7 @@ ast(struct trapframe *framep)
thread_unlock(td);
 #ifdef KTRACE
if (KTRPOINT(td, KTR_CSW))
-   ktrcsw(0, 1);
+   ktrcsw(0, 1, NULL);
 #endif
}
 
Index: sys/kern/kern_condvar.c
===
--- sys/kern/kern_condvar.c (revision 233925)
+++ sys/kern/kern_condvar.c (working copy)
@@ -103,7 +103,7 @@ _cv_wait(struct cv *cvp, struct lock_object *lock)
lock_state = 0;
 #ifdef KTRACE
if (KTRPOINT(td, KTR_CSW))
-   ktrcsw(1, 0);
+   ktrcsw(1, 0, NULL);
 #endif
CV_ASSERT(cvp, lock, td);
WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock,
@@ -140,7 +140,7 @@ _cv_wait(struct cv *cvp, struct lock_object *lock)
 
 #ifdef KTRACE
if (KTRPOINT(td, KTR_CSW))
-   ktrcsw(0, 0);
+   ktrcsw(0, 0, NULL);
 #endif
PICKUP_GIANT();
if (lock != Giant.lock_object) {
@@ -162,7 +162,7 @@ _cv_wait_unlock(struct cv *cvp, struct lock_object
td = curthread;
 #ifdef KTRACE
if (KTRPOINT(td, KTR_CSW))
-   ktrcsw(1, 0);
+   ktrcsw(1, 0, NULL);
 #endif
CV_ASSERT(cvp, lock, td);
WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock,
@@ -197,7 +197,7 @@ _cv_wait_unlock(struct cv *cvp, struct lock_object
 
 #ifdef KTRACE
if (KTRPOINT(td, KTR_CSW))
-   ktrcsw(0, 0);
+   ktrcsw(0, 0, NULL);
 #endif
PICKUP_GIANT();
 }
@@ -220,7 +220,7 @@ _cv_wait_sig(struct cv *cvp, struct lock_object *l
lock_state = 0;
 #ifdef KTRACE
if (KTRPOINT(td, KTR_CSW))
-   ktrcsw(1, 0);
+   ktrcsw(1, 0, 

svn commit: r234110 - head/sys/dev/ath

2012-04-10 Thread Adrian Chadd
Author: adrian
Date: Tue Apr 10 19:47:44 2012
New Revision: 234110
URL: http://svn.freebsd.org/changeset/base/234110

Log:
  Fix compilation with IEEE80211_ENABLE_SUPERG defined.
  
  PR:   kern/164951

Modified:
  head/sys/dev/ath/if_ath.c

Modified: head/sys/dev/ath/if_ath.c
==
--- head/sys/dev/ath/if_ath.c   Tue Apr 10 19:25:43 2012(r234109)
+++ head/sys/dev/ath/if_ath.c   Tue Apr 10 19:47:44 2012(r234110)
@@ -4906,6 +4906,7 @@ ath_tx_processq(struct ath_softc *sc, st
struct ath_tx_status *ts;
struct ieee80211_node *ni;
struct ath_node *an;
+   struct ieee80211com *ic = sc-sc_ifp-if_l2com;
int nacked;
HAL_STATUS status;
 
___
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: r234106 - head/sys/dev/isci

2012-04-10 Thread Andriy Gapon
on 10/04/2012 19:33 Jim Harris said the following:
 Author: jimharris
 Date: Tue Apr 10 16:33:19 2012
 New Revision: 234106
 URL: http://svn.freebsd.org/changeset/base/234106
 
 Log:
   Queue CCBs internally instead of using CAM_REQUEUE_REQ status.  This fixes
   problem where userspace apps such as smartctl fail due to CAM_REQUEUE_REQ
   status getting returned when tagged commands are outstanding when smartctl
   sends its I/O using the pass(4) interface.
   
   Sponsored by: Intel
   Found and tested by: Ravi Pokala rpokala at panasas dot com
   Reviewed by: scottl
   Approved by: scottl
   MFC after: 1 week

Once upon a time I had an idea that CAM_REQUEUE_REQ should never be leaked to
userland and always re-queued.  But our SCSI experts were against that.  (I
don't recall the exact argument, but I think that it was something about target
emulation).
So there is at least one other driver that likely needs the same kind of change.
Maybe we should have some common infrastructure to support really re-queue this
CCB case, so that each driver doesn't have to re-implement it?  Or maybe
CAM_REQUEUE_REQ should become that kind of command, after all.

[Just thinking out loud]

-- 
Andriy Gapon
___
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: r234115 - in head: lib/libc/powerpc/gen lib/libc/powerpc64/gen sys/powerpc/powerpc

2012-04-10 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Wed Apr 11 00:00:40 2012
New Revision: 234115
URL: http://svn.freebsd.org/changeset/base/234115

Log:
  Do not restore the register holding the TLS pointer when doing various
  usermode context switches (long jumps and ucontext operations). If these
  are used across threads, multiple threads can end up with the same TLS base.
  Madness will then result.
  
  This makes behavior on PPC match that on x86 systems and on Linux.
  
  MFC after:10 days

Modified:
  head/lib/libc/powerpc/gen/_setjmp.S
  head/lib/libc/powerpc/gen/setjmp.S
  head/lib/libc/powerpc/gen/sigsetjmp.S
  head/lib/libc/powerpc64/gen/_setjmp.S
  head/lib/libc/powerpc64/gen/setjmp.S
  head/lib/libc/powerpc64/gen/sigsetjmp.S
  head/sys/powerpc/powerpc/exec_machdep.c

Modified: head/lib/libc/powerpc/gen/_setjmp.S
==
--- head/lib/libc/powerpc/gen/_setjmp.S Tue Apr 10 22:46:40 2012
(r234114)
+++ head/lib/libc/powerpc/gen/_setjmp.S Wed Apr 11 00:00:40 2012
(r234115)
@@ -63,7 +63,6 @@ ENTRY(_longjmp)
lmw %r9,20(%r3)
mtlr%r11
mtcr%r12
-   mr  %r2,%r9
mr  %r1,%r10
or. %r3,%r4,%r4
bnelr

Modified: head/lib/libc/powerpc/gen/setjmp.S
==
--- head/lib/libc/powerpc/gen/setjmp.S  Tue Apr 10 22:46:40 2012
(r234114)
+++ head/lib/libc/powerpc/gen/setjmp.S  Wed Apr 11 00:00:40 2012
(r234115)
@@ -75,7 +75,6 @@ ENTRY(__longjmp)
mr  %r6,%r4 /* save val param */
mtlr%r11/* r11 - link reg */
mtcr%r12/* r12 - condition reg */
-   mr  %r2,%r9 /* r9  - global ptr */
mr  %r1,%r10/* r10 - stackptr */
mr  %r4,%r3
li  %r3,3   /* SIG_SETMASK */

Modified: head/lib/libc/powerpc/gen/sigsetjmp.S
==
--- head/lib/libc/powerpc/gen/sigsetjmp.S   Tue Apr 10 22:46:40 2012
(r234114)
+++ head/lib/libc/powerpc/gen/sigsetjmp.S   Wed Apr 11 00:00:40 2012
(r234115)
@@ -80,7 +80,6 @@ ENTRY(siglongjmp)
mr  %r6,%r4
mtlr%r11
mtcr%r12
-   mr  %r2,%r9
mr  %r1,%r10
or. %r7,%r7,%r7
beq 1f

Modified: head/lib/libc/powerpc64/gen/_setjmp.S
==
--- head/lib/libc/powerpc64/gen/_setjmp.S   Tue Apr 10 22:46:40 2012
(r234114)
+++ head/lib/libc/powerpc64/gen/_setjmp.S   Wed Apr 11 00:00:40 2012
(r234115)
@@ -86,7 +86,6 @@ ENTRY(_longjmp)
ld  %r10,40 + 1*8(%r3)
ld  %r11,40 + 2*8(%r3)
ld  %r12,40 + 3*8(%r3)
-   ld  %r13,40 + 4*8(%r3)
ld  %r14,40 + 5*8(%r3)
ld  %r15,40 + 6*8(%r3)
ld  %r16,40 + 7*8(%r3)

Modified: head/lib/libc/powerpc64/gen/setjmp.S
==
--- head/lib/libc/powerpc64/gen/setjmp.STue Apr 10 22:46:40 2012
(r234114)
+++ head/lib/libc/powerpc64/gen/setjmp.SWed Apr 11 00:00:40 2012
(r234115)
@@ -99,7 +99,6 @@ ENTRY(__longjmp)
ld  %r10,40 + 1*8(%r3)
ld  %r11,40 + 2*8(%r3)
ld  %r12,40 + 3*8(%r3)
-   ld  %r13,40 + 4*8(%r3)
ld  %r14,40 + 5*8(%r3)
ld  %r15,40 + 6*8(%r3)
ld  %r16,40 + 7*8(%r3)

Modified: head/lib/libc/powerpc64/gen/sigsetjmp.S
==
--- head/lib/libc/powerpc64/gen/sigsetjmp.S Tue Apr 10 22:46:40 2012
(r234114)
+++ head/lib/libc/powerpc64/gen/sigsetjmp.S Wed Apr 11 00:00:40 2012
(r234115)
@@ -103,7 +103,6 @@ ENTRY(siglongjmp)
ld  %r10,40 + 1*8(%r3)
ld  %r11,40 + 2*8(%r3)
ld  %r12,40 + 3*8(%r3)
-   ld  %r13,40 + 4*8(%r3)
ld  %r14,40 + 5*8(%r3)
ld  %r15,40 + 6*8(%r3)
ld  %r16,40 + 7*8(%r3)

Modified: head/sys/powerpc/powerpc/exec_machdep.c
==
--- head/sys/powerpc/powerpc/exec_machdep.c Tue Apr 10 22:46:40 2012
(r234114)
+++ head/sys/powerpc/powerpc/exec_machdep.c Wed Apr 11 00:00:40 2012
(r234115)
@@ -441,6 +441,7 @@ set_mcontext(struct thread *td, const mc
 {
struct pcb *pcb;
struct trapframe *tf;
+   register_t tls;
 
pcb = td-td_pcb;
tf = td-td_frame;
@@ -448,16 +449,25 @@ set_mcontext(struct thread *td, const mc
if (mcp-mc_vers != _MC_VERSION || mcp-mc_len != sizeof(*mcp))
return (EINVAL);
 
-   #ifdef AIM
+#ifdef AIM
/*
 * Don't let 

Re: svn commit: r234103 - in head: lib/libc/sys sys/ufs/ufs

2012-04-10 Thread Bruce Evans

On Tue, 10 Apr 2012, Jaakko Heinonen wrote:


Log:
 - Return EPERM from ufs_setattr() when an user without PRIV_VFS_SYSFLAGS
   privilege attempts to toggle SF_SETTABLE flags.
 - Use the '^' operator in the SF_SNAPSHOT anti-toggling check.

 Flags are now stored to ip-i_flags in one place after all checks.

 Submitted by:  bde


Thanks.

The first point fixes longstanding brokenness of chflags(2).


...
Modified: head/lib/libc/sys/chflags.2
==
--- head/lib/libc/sys/chflags.2 Tue Apr 10 15:58:22 2012(r234102)
+++ head/lib/libc/sys/chflags.2 Tue Apr 10 15:59:37 2012(r234103)
@@ -28,7 +28,7 @@
.\@(#)chflags.2   8.3 (Berkeley) 5/2/95
.\ $FreeBSD$
.\
-.Dd Oct 29, 2010
+.Dd Apr 10, 2012
.Dt CHFLAGS 2
.Os
.Sh NAME
@@ -114,8 +114,7 @@ The
and
.Dv SF_ARCHIVED
flags may only be set or unset by the super-user.
-Attempts to set these flags by non-super-users are rejected, attempts by
-non-superusers to clear flags that are already unset are silently ignored.
+Attempts to toggle these flags by non-super-users are rejected.
These flags may be set at any time, but normally may only be unset when
the system is in single-user mode.
(See


The fixed semantics are documented here.  Previously, normal read-modify-
write didn't work for non-super-users when trying to change user flags
while preserving system flags that don't prevent user changes (SF_ARCHIVED
and SF_SNAPSHOT).  Naive programs like chflags(1) didn't understand the
complications and just did a normal read-modify-write.

A few more changes in the man page are needed.  Quoting
man ./chflags.2 | col -bx:

%  ERRORS
%   The chflags() system call will fail if:
%  ...
%   [EPERM]A non-super-user tries to set one of SF_ARCHIVED,
%  SF_IMMUTABLE, SF_APPEND, or SF_NOUNLINK.

s/set/toggle/

s/tries to/attempted to/

This fixes this part of the man page not being as formal as the rest.
This is the only man page in all of libc/sys that uses the expression
tries to.  3 lines use the correct tense tried to.  14 lines use
attempted to.  I got the changed wording mostly from getpriority.2.
The other (mostly worse) variations with attempt and super are:

% clock_gettime.2:A user other than the super-user attempted to set the time.
% ffclock.2:A user other than the super-user attempted to set the feed-forward 
clock
% getpriority.2:A non super-user attempted to lower a process priority.
% gettimeofday.2:A user other than the super-user attempted to set the time.
% jail.2:A user other than the super-user attempted to attach to or remove a 
jail.
% kenv.2:a user other than the superuser attempted to set or unset a kernel

Most of these presume that there is only 1 super-user.  non-super-user
avoids this and is shorter.  Apparently, non-super-user should be
hyhenated after non, since 5 lines do it and only the above line in
getpriority.2 doesn't do it.  kenv.2 is also missing capitalization of
the sentence and hyphenation of super-user.  99 lines hyphenate
super-user, and only 16 don't.

% 
%   [EPERM]User tries to set or remove the SF_SNAPSHOT flag.


s/User tries to set or remove/An attempt was made to toggle/

This sentence had many more bugs:
- missing article before User
- but User was just misleading -- the error applies to all callers
- tries to was informal
- set or remove was less clear than toggle.

%  ...
%   The fchflags() system call will fail if:
%  ...
%   [EPERM]A non-super-user tries to set one of SF_ARCHIVED,
%  SF_IMMUTABLE, SF_APPEND, or SF_NOUNLINK.
% 
%   [EPERM]User tries to set or remove the SF_SNAPSHOT flag.


As above.

Reviewing all other FreeBSD changes to chflags.2 showed a few more
problems:
- the description of SF_SNAPSHOT says cannot be changed.  cannot be
  toggled would be clearer.  It also says by any user, and as above,
  user is just misleading.  It is this syscall that cannot change
  SF_SNAPSHOT.
- the main description and the 2 EPERM error descriptions of SF_IMMUTABLE,
  etc., presume only 1 super-user
- the EOPNOTSUPP error description still says the underlying file system
  does not support file flags, but this error can now happen even for
  ffs when the underlying file system doesn't support at least one of the
  flags that the syscall attempted to set
- lchflags() is missing in HISTORY.

Bruce
___
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: r234117 - head/sys/dev/ath

2012-04-10 Thread Adrian Chadd
Author: adrian
Date: Wed Apr 11 02:34:32 2012
New Revision: 234117
URL: http://svn.freebsd.org/changeset/base/234117

Log:
  Fix the default, non-superg compile.
  
  Pointy-hat-to:adrian

Modified:
  head/sys/dev/ath/if_ath.c

Modified: head/sys/dev/ath/if_ath.c
==
--- head/sys/dev/ath/if_ath.c   Wed Apr 11 00:28:44 2012(r234116)
+++ head/sys/dev/ath/if_ath.c   Wed Apr 11 02:34:32 2012(r234117)
@@ -4906,7 +4906,9 @@ ath_tx_processq(struct ath_softc *sc, st
struct ath_tx_status *ts;
struct ieee80211_node *ni;
struct ath_node *an;
+#ifdef IEEE80211_SUPPORT_SUPERG
struct ieee80211com *ic = sc-sc_ifp-if_l2com;
+#endif /* IEEE80211_SUPPORT_SUPERG */
int nacked;
HAL_STATUS status;
 
___
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: r234118 - in head/sys: conf dev/uart

2012-04-10 Thread Marcel Moolenaar
Author: marcel
Date: Wed Apr 11 02:42:01 2012
New Revision: 234118
URL: http://svn.freebsd.org/changeset/base/234118

Log:
  uart_cpu_amd64.c and uart_cpu_i386.c (under sys/dev/uart) are
  identical now that the bus spaces are unified under sys/x86.
  Replace them with a single uart_cpu_x86.c.
  o   delete uart_cpu_i386.c
  o   move uart_cpu_amd64.c to uart_cpu_x86.c
  o   update files.amd64 and files.i386 accordingly.

Added:
  head/sys/dev/uart/uart_cpu_x86.c
 - copied unchanged from r234116, head/sys/dev/uart/uart_cpu_amd64.c
Deleted:
  head/sys/dev/uart/uart_cpu_amd64.c
  head/sys/dev/uart/uart_cpu_i386.c
Modified:
  head/sys/conf/files.amd64
  head/sys/conf/files.i386

Modified: head/sys/conf/files.amd64
==
--- head/sys/conf/files.amd64   Wed Apr 11 02:34:32 2012(r234117)
+++ head/sys/conf/files.amd64   Wed Apr 11 02:42:01 2012(r234118)
@@ -267,7 +267,7 @@ dev/syscons/scvtb.c optionalsc
 dev/tpm/tpm.c  optionaltpm
 dev/tpm/tpm_acpi.c optionaltpm acpi
 dev/tpm/tpm_isa.c  optionaltpm isa
-dev/uart/uart_cpu_amd64.c  optionaluart
+dev/uart/uart_cpu_x86.coptionaluart
 dev/viawd/viawd.c  optionalviawd
 dev/wbwd/wbwd.coptionalwbwd
 dev/wpi/if_wpi.c   optionalwpi

Modified: head/sys/conf/files.i386
==
--- head/sys/conf/files.i386Wed Apr 11 02:34:32 2012(r234117)
+++ head/sys/conf/files.i386Wed Apr 11 02:42:01 2012(r234118)
@@ -244,7 +244,7 @@ dev/syscons/scvtb.c optional sc
 dev/tpm/tpm.c  optional tpm
 dev/tpm/tpm_acpi.c optional tpm acpi
 dev/tpm/tpm_isa.c  optional tpm isa
-dev/uart/uart_cpu_i386.c   optional uart
+dev/uart/uart_cpu_x86.coptional uart
 dev/viawd/viawd.c  optional viawd
 dev/acpica/acpi_if.m   standard
 dev/acpi_support/acpi_wmi_if.m standard

Copied: head/sys/dev/uart/uart_cpu_x86.c (from r234116, 
head/sys/dev/uart/uart_cpu_amd64.c)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/uart/uart_cpu_x86.cWed Apr 11 02:42:01 2012
(r234118, copy of r234116, head/sys/dev/uart/uart_cpu_amd64.c)
@@ -0,0 +1,107 @@
+/*-
+ * Copyright (c) 2003, 2004 Marcel Moolenaar
+ * 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 ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include sys/cdefs.h
+__FBSDID($FreeBSD$);
+
+#include sys/param.h
+#include sys/systm.h
+#include sys/bus.h
+
+#include machine/bus.h
+
+#include dev/uart/uart.h
+#include dev/uart/uart_cpu.h
+
+bus_space_tag_t uart_bus_space_io = X86_BUS_SPACE_IO;
+bus_space_tag_t uart_bus_space_mem = X86_BUS_SPACE_MEM;
+
+int
+uart_cpu_eqres(struct uart_bas *b1, struct uart_bas *b2)
+{
+
+   return ((b1-bsh == b2-bsh  b1-bst == b2-bst) ? 1 : 0);
+}
+
+int
+uart_cpu_getdev(int devtype, struct uart_devinfo *di)
+{
+   struct uart_class *class;
+   unsigned int i, ivar;
+
+   class = uart_ns8250_class;
+   if (class == NULL)
+   return (ENXIO);
+
+   /* Check the environment. */
+   if (uart_getenv(devtype, di, class) == 0)
+   return (0);
+
+   /*
+* Scan the hints. We only try units 0 to 3 (inclusive). This
+* covers the ISA legacy where 4 UARTs had their resources
+* predefined.
+*/
+   for (i = 0; i  4; i++) {
+   if (resource_int_value(uart, i, flags, ivar))
+