svn commit: r297911 - head/sys/arm/broadcom/bcm2835

2016-04-12 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Wed Apr 13 05:28:27 2016
New Revision: 297911
URL: https://svnweb.freebsd.org/changeset/base/297911

Log:
  Multiple fixes in VCHI audio driver:
  
  - Pre-buffer audio data to VideoCore so there are no audible glitches when
  driver is too late to provide samples
  - Start actual playback when there is some prebuffered audio,
  it fixes audible noisy click in the beginning of playback
  - Use #defines instead of hardcoded values where appropriate
  - Fix copy-pasted comment
  
  PR:   208678

Modified:
  head/sys/arm/broadcom/bcm2835/bcm2835_audio.c

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_audio.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_audio.c   Wed Apr 13 05:19:16 
2016(r297910)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_audio.c   Wed Apr 13 05:28:27 
2016(r297911)
@@ -46,6 +46,7 @@ SND_DECLARE_FILE("$FreeBSD$");
 
 #defineVCHIQ_AUDIO_PACKET_SIZE 4000
 #defineVCHIQ_AUDIO_BUFFER_SIZE 128000
+#defineVCHIQ_AUDIO_PREBUFFER   10 /* Number of pre-buffered audio 
messages */
 
 #defineVCHIQ_AUDIO_MAX_VOLUME  
 /* volume in terms of 0.01dB */
@@ -91,6 +92,7 @@ struct bcm2835_audio_chinfo {
uint32_t free_buffer;
uint32_t buffered_ptr;
int playback_state;
+   int prebuffered;
 };
 
 struct bcm2835_audio_info {
@@ -170,11 +172,10 @@ bcm2835_audio_callback(void *param, cons
 
ch->complete_pos = (ch->complete_pos + count) % 
sndbuf_getsize(ch->buffer);
ch->free_buffer += count;
+   chn_intr(sc->pch.channel);
 
-   if (perr || ch->free_buffer >= VCHIQ_AUDIO_PACKET_SIZE) {
-   chn_intr(ch->channel);
+   if (perr || ch->free_buffer >= VCHIQ_AUDIO_PACKET_SIZE)
cv_signal(>data_cv);
-   }
} else
printf("%s: unknown m.type: %d\n", __func__, m.type);
 }
@@ -244,6 +245,7 @@ bcm2835_audio_reset_channel(struct bcm28
ch->playback_state = 0;
ch->buffered_ptr = 0;
ch->complete_pos = 0;
+   ch->prebuffered = 0;
 
sndbuf_reset(ch->buffer);
 }
@@ -478,21 +480,29 @@ bcm2835_audio_worker(void *data)
if (sc->unloading)
break;
 
-   if ((ch->playback_state == PLAYBACK_PLAYING) &&
-   (vchiq_unbuffered_bytes(ch) >= VCHIQ_AUDIO_PACKET_SIZE)
-   && (ch->free_buffer >= VCHIQ_AUDIO_PACKET_SIZE)) {
-   bcm2835_audio_write_samples(ch);
-   } else {
-   if (ch->playback_state == PLAYBACK_STOPPING) {
-   bcm2835_audio_reset_channel(>pch);
-   ch->playback_state = PLAYBACK_IDLE;
-   }
-
+   if (ch->playback_state == PLAYBACK_IDLE) {
cv_wait_sig(>data_cv, >data_lock);
+   continue;
+   }
+
+   if (ch->playback_state == PLAYBACK_STOPPING) {
+   bcm2835_audio_reset_channel(>pch);
+   ch->playback_state = PLAYBACK_IDLE;
+   continue;
+   }
+
+   if (ch->free_buffer < vchiq_unbuffered_bytes(ch)) {
+   cv_timedwait_sig(>data_cv, >data_lock, 10);
+   continue;
+   }
+
+
+   bcm2835_audio_write_samples(ch);
 
-   if (ch->playback_state == PLAYBACK_STARTING) {
-   /* Give it initial kick */
-   chn_intr(sc->pch.channel);
+   if (ch->playback_state == PLAYBACK_STARTING) {
+   ch->prebuffered++;
+   if (ch->prebuffered == VCHIQ_AUDIO_PREBUFFER) {
+   bcm2835_audio_start(ch);
ch->playback_state = PLAYBACK_PLAYING;
}
}
@@ -514,7 +524,7 @@ bcm2835_audio_create_worker(struct bcm28
 }
 
 /*  */
-/* channel interface for ESS18xx */
+/* channel interface for VCHI audio */
 static void *
 bcmchan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel 
*c, int dir)
 {
@@ -612,7 +622,6 @@ bcmchan_trigger(kobj_t obj, void *data, 
 
switch (go) {
case PCMTRIG_START:
-   bcm2835_audio_start(ch);
ch->playback_state = PLAYBACK_STARTING;
/* wakeup worker thread */
cv_signal(>data_cv);
@@ -620,7 +629,7 @@ bcmchan_trigger(kobj_t obj, void *data, 
 
case PCMTRIG_STOP:
case PCMTRIG_ABORT:
-   ch->playback_state = 1;
+   ch->playback_state = PLAYBACK_STOPPING;
bcm2835_audio_stop(ch);
break;
 

svn commit: r297910 - head/sys/dev/urtwn

2016-04-12 Thread Adrian Chadd
Author: adrian
Date: Wed Apr 13 05:19:16 2016
New Revision: 297910
URL: https://svnweb.freebsd.org/changeset/base/297910

Log:
  [urtwn] use/track the last good RSSI for a given node, rather than no RSSI.
  
  Now that we're decap'ing A-MPDU frame, the firmware is only giving us
  PHY status information for the whole PPDU, rather than duplicatig it
  per frame.
  
  So, we fake it by maintaining the RSSI that we saw in the node struct
  and reuse it.
  
  This prevents us from getting some pretty garbage looking default RSSI
  values, which shows up as RSSI values of like "3" or "4" when doing
  active traffic.
  
  Tested:
  
  * RTL8188EU, STA mode

Modified:
  head/sys/dev/urtwn/if_urtwn.c
  head/sys/dev/urtwn/if_urtwnvar.h

Modified: head/sys/dev/urtwn/if_urtwn.c
==
--- head/sys/dev/urtwn/if_urtwn.c   Wed Apr 13 04:13:36 2016
(r297909)
+++ head/sys/dev/urtwn/if_urtwn.c   Wed Apr 13 05:19:16 2016
(r297910)
@@ -360,10 +360,10 @@ static void   urtwn_update_aifs(struct ur
 static voidurtwn_set_promisc(struct urtwn_softc *);
 static voidurtwn_update_promisc(struct ieee80211com *);
 static voidurtwn_update_mcast(struct ieee80211com *);
-static struct ieee80211_node *urtwn_r88e_node_alloc(struct ieee80211vap *,
+static struct ieee80211_node *urtwn_node_alloc(struct ieee80211vap *,
const uint8_t mac[IEEE80211_ADDR_LEN]);
-static voidurtwn_r88e_newassoc(struct ieee80211_node *, int);
-static voidurtwn_r88e_node_free(struct ieee80211_node *);
+static voidurtwn_newassoc(struct ieee80211_node *, int);
+static voidurtwn_node_free(struct ieee80211_node *);
 static voidurtwn_set_chan(struct urtwn_softc *,
struct ieee80211_channel *,
struct ieee80211_channel *);
@@ -628,10 +628,10 @@ urtwn_attach(device_t self)
ic->ic_update_promisc = urtwn_update_promisc;
ic->ic_update_mcast = urtwn_update_mcast;
if (sc->chip & URTWN_CHIP_88E) {
-   ic->ic_node_alloc = urtwn_r88e_node_alloc;
-   ic->ic_newassoc = urtwn_r88e_newassoc;
+   ic->ic_node_alloc = urtwn_node_alloc;
+   ic->ic_newassoc = urtwn_newassoc;
sc->sc_node_free = ic->ic_node_free;
-   ic->ic_node_free = urtwn_r88e_node_free;
+   ic->ic_node_free = urtwn_node_free;
}
ic->ic_update_chw = urtwn_update_chw;
ic->ic_ampdu_enable = urtwn_ampdu_enable;
@@ -1025,7 +1025,7 @@ urtwn_rx_frame(struct urtwn_softc *sc, s
struct r92c_rx_stat *stat;
uint32_t rxdw0, rxdw3;
uint8_t rate, cipher;
-   int8_t rssi = URTWN_NOISE_FLOOR + 1;
+   int8_t rssi = -127;
int infosz;
 
stat = mtod(m, struct r92c_rx_stat *);
@@ -1042,6 +1042,7 @@ urtwn_rx_frame(struct urtwn_softc *sc, s
rssi = urtwn_r88e_get_rssi(sc, rate, [1]);
else
rssi = urtwn_get_rssi(sc, rate, [1]);
+   URTWN_DPRINTF(sc, URTWN_DEBUG_RSSI, "%s: rssi=%d\n", __func__, 
rssi);
/* Update our average RSSI. */
urtwn_update_avgrssi(sc, rate, rssi);
}
@@ -1070,6 +1071,8 @@ urtwn_rx_frame(struct urtwn_softc *sc, s
/* Bit 7 set means HT MCS instead of rate. */
tap->wr_rate = 0x80 | (rate - 12);
}
+
+   /* XXX TODO: this isn't right; should use the last good RSSI */
tap->wr_dbm_antsignal = rssi;
tap->wr_dbm_antnoise = URTWN_NOISE_FLOOR;
}
@@ -1135,17 +1138,26 @@ tr_setup:
m->m_next = NULL;
 
ni = urtwn_rx_frame(sc, m, );
+
+   /* Store a global last-good RSSI */
+   if (rssi != -127)
+   sc->last_rssi = rssi;
+
URTWN_UNLOCK(sc);
 
nf = URTWN_NOISE_FLOOR;
if (ni != NULL) {
+   if (rssi != -127)
+   URTWN_NODE(ni)->last_rssi = rssi;
if (ni->ni_flags & IEEE80211_NODE_HT)
m->m_flags |= M_AMPDU;
-   (void)ieee80211_input(ni, m, rssi - nf, nf);
+   (void)ieee80211_input(ni, m,
+   URTWN_NODE(ni)->last_rssi - nf, nf);
ieee80211_free_node(ni);
} else {
-   (void)ieee80211_input_all(ic, m, rssi - nf,
-   nf);
+   /* Use last good global RSSI */
+   (void)ieee80211_input_all(ic, 

Re: svn commit: r297898 - head/sys/dev/bxe

2016-04-12 Thread Sepherosa Ziehau
On Wed, Apr 13, 2016 at 12:15 PM, David Somayajulu
 wrote:
> HI Sepherosa,
> I have checked in the fix. https://svnweb.freebsd.org/changeset/base/297909


Thanks!


>
> Apologies for the screw up earlier. Sorry for the inconvenience.
>
> Cheers
> David S.
>
> -Original Message-
> From: Sepherosa Ziehau [mailto:sepher...@gmail.com]
> Sent: Tuesday, April 12, 2016 8:49 PM
> To: David Somayajulu 
> Cc: David C Somayajulu ; src-committ...@freebsd.org; 
> svn-src-all@freebsd.org; svn-src-h...@freebsd.org
> Subject: Re: svn commit: r297898 - head/sys/dev/bxe
>
> Great!  Thanks!
>
> On Wed, Apr 13, 2016 at 11:48 AM, David Somayajulu 
>  wrote:
>> Hi Sepherosa,
>> I just saw it and am taking a look at it. Give me a few minutes and I will 
>> get back.
>> Thanks
>> David S.
>>
>> -Original Message-
>> From: Sepherosa Ziehau [mailto:sepher...@gmail.com]
>> Sent: Tuesday, April 12, 2016 8:43 PM
>> To: David C Somayajulu 
>> Cc: src-committ...@freebsd.org; svn-src-all@freebsd.org;
>> svn-src-h...@freebsd.org
>> Subject: Re: svn commit: r297898 - head/sys/dev/bxe
>>
>> Hi David,
>>
>> BLOGI(sc, "cdu_context i %d paddr %#jx vaddr %p size 0x%zx\n", i,
>> sc->context[i].vcxt_dma.paddr, sc->context[i].vcxt_dma.vaddr,
>> sc->context[i].size);
>>
>> This breaks i386 building.  I think you need to do (uintmax_t)paddr for %jx:
>>
>> /usr/freebsd-svn/sys/dev/bxe/bxe.c:18746:13: error: format specifies type 
>> 'uintmax_t' (aka 'unsigned long long') but the argument has type 
>> 'bus_addr_t' (aka 'unsigned int') [-Werror,-Wformat]
>> sc->context[i].vcxt_dma.paddr, sc->context[i].vcxt_dma.vaddr,
>> ^
>>
>>
>> On Wed, Apr 13, 2016 at 8:53 AM, David C Somayajulu  
>> wrote:
>>> Author: davidcs
>>> Date: Wed Apr 13 00:53:04 2016
>>> New Revision: 297898
>>> URL: https://svnweb.freebsd.org/changeset/base/297898
>>>
>>> Log:
>>>   1. modify fwdump (a.k.a grcdump) memory is allocated and freed on as 
>>> needed
>>>  basis.
>>>   2. grcdump can be taken at failure points by invoking bxe_grc_dump() when
>>>  trigger_grcdump sysctl flag is set. When grcdump is taken grcdump_done
>>>  sysctl flag is set.
>>>   3. grcdump_done can be monitored by the user to retrieve the grcdump.
>>>
>>>   Submitted by:vaishali.kulka...@qlogic.com
>>>   Approved by:davi...@freebsd.org
>>>   MFC after:5 days
>>>
>>> Modified:
>>>   head/sys/dev/bxe/bxe.c
>>>   head/sys/dev/bxe/bxe.h
>>>   head/sys/dev/bxe/bxe_stats.c
>>>
>>> Modified: head/sys/dev/bxe/bxe.c
>>> ==
>>> --- head/sys/dev/bxe/bxe.c  Wed Apr 13 00:30:42 2016(r297897)
>>> +++ head/sys/dev/bxe/bxe.c  Wed Apr 13 00:53:04 2016(r297898)
>>> @@ -672,7 +672,6 @@ static void bxe_handle_fp_tq(void *conte
>>>
>>>  static int bxe_add_cdev(struct bxe_softc *sc);  static void
>>> bxe_del_cdev(struct bxe_softc *sc); -static int bxe_grc_dump(struct
>>> bxe_softc *sc);  static int bxe_alloc_buf_rings(struct bxe_softc
>>> *sc); static void bxe_free_buf_rings(struct bxe_softc *sc);
>>>
>>> @@ -3449,6 +3448,10 @@ bxe_watchdog(struct bxe_softc*sc,
>>>  }
>>>
>>>  BLOGE(sc, "TX watchdog timeout on fp[%02d], resetting!\n",
>>> fp->index);
>>> +if(sc->trigger_grcdump) {
>>> + /* taking grcdump */
>>> + bxe_grc_dump(sc);
>>> +}
>>>
>>>  BXE_FP_TX_UNLOCK(fp);
>>>
>>> @@ -15637,30 +15640,6 @@ bxe_sysctl_state(SYSCTL_HANDLER_ARGS)
>>>  }
>>>
>>>  static int
>>> -bxe_sysctl_trigger_grcdump(SYSCTL_HANDLER_ARGS)
>>> -{
>>> -struct bxe_softc *sc;
>>> -int error, result;
>>> -
>>> -result = 0;
>>> -error = sysctl_handle_int(oidp, , 0, req);
>>> -
>>> -if (error || !req->newptr) {
>>> -return (error);
>>> -}
>>> -
>>> -if (result == 1) {
>>> -sc = (struct bxe_softc *)arg1;
>>> -
>>> -BLOGI(sc, "... grcdump start ...\n");
>>> -bxe_grc_dump(sc);
>>> -BLOGI(sc, "... grcdump done ...\n");
>>> -}
>>> -
>>> -return (error);
>>> -}
>>> -
>>> -static int
>>>  bxe_sysctl_eth_stat(SYSCTL_HANDLER_ARGS)
>>>  {
>>>  struct bxe_softc *sc = (struct bxe_softc *)arg1; @@ -15811,14
>>> +15790,16 @@ bxe_add_sysctls(struct bxe_softc *sc)
>>>  "debug logging mode");  #endif /* #if
>>> __FreeBSD_version >= 90 */
>>>
>>> -SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "trigger_grcdump",
>>> -CTLTYPE_UINT | CTLFLAG_RW, sc, 0,
>>> -bxe_sysctl_trigger_grcdump, "IU",
>>> -"set by driver when a grcdump is needed");
>>> +sc->trigger_grcdump = 0;
>>> +SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "trigger_grcdump",
>>> +   CTLFLAG_RW, >trigger_grcdump, 0,
>>> +   

Re: svn commit: r297902 - head

2016-04-12 Thread NGie Cooper

> On Apr 12, 2016, at 20:02, Bryan Drewery  wrote:
> 
>> On 4/12/2016 8:00 PM, Steve Wills wrote:
>>> On 04/12/16 09:59 PM, Ian Lepore wrote:
>>> 
>>> More succinctly:
>>> 
>>> .if empty(SVN)
>>> SVN!= which svn || which svnlite
>>> .endif
>> 
>> Fair enough, that's basically the intent. I think we like to avoid !=,
>> at least in ports, and I wanted the logic between src and ports to match
>> in this case.
> 
> Yeah, please avoid != where possible.
> 
> If you switch to this then also add .export SVN after the SVN!= line.
> 
> I somewhat like this version more though since /usr/local/bin may not be
> in the PATH.

Plus it's not set in PATH probably in this portion of the build...
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297909 - head/sys/dev/bxe

2016-04-12 Thread David C Somayajulu
Author: davidcs
Date: Wed Apr 13 04:13:36 2016
New Revision: 297909
URL: https://svnweb.freebsd.org/changeset/base/297909

Log:
  Fix build failure on i386. Need to typecast a bunch of variables to 
(uintmax_t)
  
  MFC after:5 days

Modified:
  head/sys/dev/bxe/bxe.c

Modified: head/sys/dev/bxe/bxe.c
==
--- head/sys/dev/bxe/bxe.c  Wed Apr 13 03:45:39 2016(r297908)
+++ head/sys/dev/bxe/bxe.c  Wed Apr 13 04:13:36 2016(r297909)
@@ -18743,7 +18743,8 @@ bxe_grc_dump(struct bxe_softc *sc)
 for (i = 0, allocated = 0; allocated < context_size; i++) {
 
 BLOGI(sc, "cdu_context i %d paddr %#jx vaddr %p size 0x%zx\n", i,
-sc->context[i].vcxt_dma.paddr, sc->context[i].vcxt_dma.vaddr,
+(uintmax_t)sc->context[i].vcxt_dma.paddr,
+sc->context[i].vcxt_dma.vaddr,
 sc->context[i].size);
 allocated += sc->context[i].size;
 }
@@ -18755,36 +18756,38 @@ bxe_grc_dump(struct bxe_softc *sc)
 (void *)sc->def_sb_dma.paddr, sc->def_sb,
 sizeof(struct host_sp_status_block));
 BLOGI(sc, "event_queue paddr %#jx vaddr %p size 0x%x\n",
-sc->eq_dma.paddr, sc->eq_dma.vaddr, BCM_PAGE_SIZE);
+(uintmax_t)sc->eq_dma.paddr, sc->eq_dma.vaddr, BCM_PAGE_SIZE);
 BLOGI(sc, "slow path paddr %#jx vaddr %p size 0x%lx\n",
-sc->sp_dma.paddr, sc->sp_dma.vaddr, sizeof(struct bxe_slowpath));
+(uintmax_t)sc->sp_dma.paddr, sc->sp_dma.vaddr,
+sizeof(struct bxe_slowpath));
 BLOGI(sc, "slow path queue paddr %#jx vaddr %p size 0x%x\n",
-sc->spq_dma.paddr, sc->spq_dma.vaddr, BCM_PAGE_SIZE);
+(uintmax_t)sc->spq_dma.paddr, sc->spq_dma.vaddr, BCM_PAGE_SIZE);
 BLOGI(sc, "fw_buf paddr %#jx vaddr %p size 0x%x\n",
-sc->gz_buf_dma.paddr, sc->gz_buf_dma.vaddr, FW_BUF_SIZE);
+(uintmax_t)sc->gz_buf_dma.paddr, sc->gz_buf_dma.vaddr,
+FW_BUF_SIZE);
 for (i = 0; i < sc->num_queues; i++) {
 fp = >fp[i];
 BLOGI(sc, "FP status block fp %d paddr %#jx vaddr %p size 0x%lx\n", i,
-fp->sb_dma.paddr, fp->sb_dma.vaddr,
+(uintmax_t)fp->sb_dma.paddr, fp->sb_dma.vaddr,
 sizeof(union bxe_host_hc_status_block));
 BLOGI(sc, "TX BD CHAIN fp %d paddr %#jx vaddr %p size 0x%x\n", i,
-fp->tx_dma.paddr, fp->tx_dma.vaddr,
+(uintmax_t)fp->tx_dma.paddr, fp->tx_dma.vaddr,
 (BCM_PAGE_SIZE * TX_BD_NUM_PAGES));
 BLOGI(sc, "RX BD CHAIN fp %d paddr %#jx vaddr %p size 0x%x\n", i,
-fp->rx_dma.paddr, fp->rx_dma.vaddr,
+(uintmax_t)fp->rx_dma.paddr, fp->rx_dma.vaddr,
 (BCM_PAGE_SIZE * RX_BD_NUM_PAGES));
 BLOGI(sc, "RX RCQ CHAIN fp %d paddr %#jx vaddr %p size 0x%lx\n", i,
-fp->rcq_dma.paddr, fp->rcq_dma.vaddr,
+(uintmax_t)fp->rcq_dma.paddr, fp->rcq_dma.vaddr,
 (BCM_PAGE_SIZE * RCQ_NUM_PAGES));
 BLOGI(sc, "RX SGE CHAIN fp %d paddr %#jx vaddr %p size 0x%x\n", i,
-fp->rx_sge_dma.paddr, fp->rx_sge_dma.vaddr,
+(uintmax_t)fp->rx_sge_dma.paddr, fp->rx_sge_dma.vaddr,
 (BCM_PAGE_SIZE * RX_SGE_NUM_PAGES));
 }
 
 ilt_cli = >clients[1];
 for (i = ilt_cli->start; i <= ilt_cli->end; i++) {
 BLOGI(sc, "ECORE_ILT paddr %#jx vaddr %p size 0x%x\n",
-((struct bxe_dma *)((>lines[i])->page))->paddr,
+(uintmax_t)(((struct bxe_dma *)((>lines[i])->page))->paddr),
 ((struct bxe_dma *)((>lines[i])->page))->vaddr, 
BCM_PAGE_SIZE);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r297898 - head/sys/dev/bxe

2016-04-12 Thread Sepherosa Ziehau
Great!  Thanks!

On Wed, Apr 13, 2016 at 11:48 AM, David Somayajulu
 wrote:
> Hi Sepherosa,
> I just saw it and am taking a look at it. Give me a few minutes and I will 
> get back.
> Thanks
> David S.
>
> -Original Message-
> From: Sepherosa Ziehau [mailto:sepher...@gmail.com]
> Sent: Tuesday, April 12, 2016 8:43 PM
> To: David C Somayajulu 
> Cc: src-committ...@freebsd.org; svn-src-all@freebsd.org; 
> svn-src-h...@freebsd.org
> Subject: Re: svn commit: r297898 - head/sys/dev/bxe
>
> Hi David,
>
> BLOGI(sc, "cdu_context i %d paddr %#jx vaddr %p size 0x%zx\n", i,
> sc->context[i].vcxt_dma.paddr, sc->context[i].vcxt_dma.vaddr,
> sc->context[i].size);
>
> This breaks i386 building.  I think you need to do (uintmax_t)paddr for %jx:
>
> /usr/freebsd-svn/sys/dev/bxe/bxe.c:18746:13: error: format specifies type 
> 'uintmax_t' (aka 'unsigned long long') but the argument has type 'bus_addr_t' 
> (aka 'unsigned int') [-Werror,-Wformat]
> sc->context[i].vcxt_dma.paddr, sc->context[i].vcxt_dma.vaddr,
> ^
>
>
> On Wed, Apr 13, 2016 at 8:53 AM, David C Somayajulu  
> wrote:
>> Author: davidcs
>> Date: Wed Apr 13 00:53:04 2016
>> New Revision: 297898
>> URL: https://svnweb.freebsd.org/changeset/base/297898
>>
>> Log:
>>   1. modify fwdump (a.k.a grcdump) memory is allocated and freed on as needed
>>  basis.
>>   2. grcdump can be taken at failure points by invoking bxe_grc_dump() when
>>  trigger_grcdump sysctl flag is set. When grcdump is taken grcdump_done
>>  sysctl flag is set.
>>   3. grcdump_done can be monitored by the user to retrieve the grcdump.
>>
>>   Submitted by:vaishali.kulka...@qlogic.com
>>   Approved by:davi...@freebsd.org
>>   MFC after:5 days
>>
>> Modified:
>>   head/sys/dev/bxe/bxe.c
>>   head/sys/dev/bxe/bxe.h
>>   head/sys/dev/bxe/bxe_stats.c
>>
>> Modified: head/sys/dev/bxe/bxe.c
>> ==
>> --- head/sys/dev/bxe/bxe.c  Wed Apr 13 00:30:42 2016(r297897)
>> +++ head/sys/dev/bxe/bxe.c  Wed Apr 13 00:53:04 2016(r297898)
>> @@ -672,7 +672,6 @@ static void bxe_handle_fp_tq(void *conte
>>
>>  static int bxe_add_cdev(struct bxe_softc *sc);  static void
>> bxe_del_cdev(struct bxe_softc *sc); -static int bxe_grc_dump(struct
>> bxe_softc *sc);  static int bxe_alloc_buf_rings(struct bxe_softc *sc);
>> static void bxe_free_buf_rings(struct bxe_softc *sc);
>>
>> @@ -3449,6 +3448,10 @@ bxe_watchdog(struct bxe_softc*sc,
>>  }
>>
>>  BLOGE(sc, "TX watchdog timeout on fp[%02d], resetting!\n",
>> fp->index);
>> +if(sc->trigger_grcdump) {
>> + /* taking grcdump */
>> + bxe_grc_dump(sc);
>> +}
>>
>>  BXE_FP_TX_UNLOCK(fp);
>>
>> @@ -15637,30 +15640,6 @@ bxe_sysctl_state(SYSCTL_HANDLER_ARGS)
>>  }
>>
>>  static int
>> -bxe_sysctl_trigger_grcdump(SYSCTL_HANDLER_ARGS)
>> -{
>> -struct bxe_softc *sc;
>> -int error, result;
>> -
>> -result = 0;
>> -error = sysctl_handle_int(oidp, , 0, req);
>> -
>> -if (error || !req->newptr) {
>> -return (error);
>> -}
>> -
>> -if (result == 1) {
>> -sc = (struct bxe_softc *)arg1;
>> -
>> -BLOGI(sc, "... grcdump start ...\n");
>> -bxe_grc_dump(sc);
>> -BLOGI(sc, "... grcdump done ...\n");
>> -}
>> -
>> -return (error);
>> -}
>> -
>> -static int
>>  bxe_sysctl_eth_stat(SYSCTL_HANDLER_ARGS)
>>  {
>>  struct bxe_softc *sc = (struct bxe_softc *)arg1; @@ -15811,14
>> +15790,16 @@ bxe_add_sysctls(struct bxe_softc *sc)
>>  "debug logging mode");  #endif /* #if
>> __FreeBSD_version >= 90 */
>>
>> -SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "trigger_grcdump",
>> -CTLTYPE_UINT | CTLFLAG_RW, sc, 0,
>> -bxe_sysctl_trigger_grcdump, "IU",
>> -"set by driver when a grcdump is needed");
>> +sc->trigger_grcdump = 0;
>> +SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "trigger_grcdump",
>> +   CTLFLAG_RW, >trigger_grcdump, 0,
>> +   "trigger grcdump should be invoked"
>> +   "  before collecting grcdump");
>>
>> +sc->grcdump_started = 0;
>>  sc->grcdump_done = 0;
>>  SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "grcdump_done",
>> -   CTLFLAG_RW, >grcdump_done, 0,
>> +   CTLFLAG_RD, >grcdump_done, 0,
>> "set by driver when grcdump is done");
>>
>>  sc->rx_budget = bxe_rx_budget;
>> @@ -18650,7 +18631,7 @@ bxe_get_preset_regs(struct bxe_softc *sc
>>  return 0;
>>  }
>>
>> -static int
>> +int
>>  bxe_grc_dump(struct bxe_softc *sc)
>>  {
>>  int rval = 0;
>> @@ -18658,12 +18639,53 @@ bxe_grc_dump(struct bxe_softc *sc)
>>  uint8_t *buf;
>>  uint32_t size;
>>  struct  dump_header *d_hdr;
>> +uint32_t i;
>> 

svn commit: r297908 - head/sys/dev/hyperv/vmbus

2016-04-12 Thread Sepherosa Ziehau
Author: sephe
Date: Wed Apr 13 03:45:39 2016
New Revision: 297908
URL: https://svnweb.freebsd.org/changeset/base/297908

Log:
  hyperv/vmbus: Merge duplicated version check for events
  
  Submitted by: Jun Su 
  Reviewed by:  sephe
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D5911

Modified:
  head/sys/dev/hyperv/vmbus/hv_connection.c
  head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c

Modified: head/sys/dev/hyperv/vmbus/hv_connection.c
==
--- head/sys/dev/hyperv/vmbus/hv_connection.c   Wed Apr 13 03:36:34 2016
(r297907)
+++ head/sys/dev/hyperv/vmbus/hv_connection.c   Wed Apr 13 03:45:39 2016
(r297908)
@@ -305,14 +305,18 @@ hv_vmbus_on_events(int cpu)
KASSERT(cpu <= mp_maxid, ("VMBUS: hv_vmbus_on_events: "
"cpu out of range!"));
 
+   page_addr = hv_vmbus_g_context.syn_ic_event_page[cpu];
+   event = (hv_vmbus_synic_event_flags *)
+   page_addr + HV_VMBUS_MESSAGE_SINT;
if ((hv_vmbus_protocal_version == HV_VMBUS_VERSION_WS2008) ||
(hv_vmbus_protocal_version == HV_VMBUS_VERSION_WIN7)) {
maxdword = HV_MAX_NUM_CHANNELS_SUPPORTED >> 5;
/*
 * receive size is 1/2 page and divide that by 4 bytes
 */
-   recv_interrupt_page =
-   hv_vmbus_g_connection.recv_interrupt_page;
+   if (synch_test_and_clear_bit(0, >flags32[0]))
+   recv_interrupt_page =
+   hv_vmbus_g_connection.recv_interrupt_page;
} else {
/*
 * On Host with Win8 or above, the event page can be
@@ -320,9 +324,6 @@ hv_vmbus_on_events(int cpu)
 * that has the pending interrupt.
 */
maxdword = HV_EVENT_FLAGS_DWORD_COUNT;
-   page_addr = hv_vmbus_g_context.syn_ic_event_page[cpu];
-   event = (hv_vmbus_synic_event_flags *)
-   page_addr + HV_VMBUS_MESSAGE_SINT;
recv_interrupt_page = event->flags32;
}
 

Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
==
--- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.cWed Apr 13 03:36:34 
2016(r297907)
+++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.cWed Apr 13 03:45:39 
2016(r297908)
@@ -145,7 +145,6 @@ hv_vmbus_isr(struct trapframe *frame)
 {
int cpu;
hv_vmbus_message*   msg;
-   hv_vmbus_synic_event_flags* event;
void*   page_addr;
 
cpu = PCPU_GET(cpuid);
@@ -156,26 +155,7 @@ hv_vmbus_isr(struct trapframe *frame)
 * in Windows when running as a guest in Hyper-V
 */
 
-   page_addr = hv_vmbus_g_context.syn_ic_event_page[cpu];
-   event = (hv_vmbus_synic_event_flags*)
-   page_addr + HV_VMBUS_MESSAGE_SINT;
-
-   if ((hv_vmbus_protocal_version == HV_VMBUS_VERSION_WS2008) ||
-   (hv_vmbus_protocal_version == HV_VMBUS_VERSION_WIN7)) {
-   /* Since we are a child, we only need to check bit 0 */
-   if (synch_test_and_clear_bit(0, >flags32[0])) {
-   hv_vmbus_on_events(cpu);
-   }
-   } else {
-   /*
-* On host with Win8 or above, we can directly look at
-* the event page. If bit n is set, we have an interrupt 
-* on the channel with id n.
-* Directly schedule the event software interrupt on
-* current cpu.
-*/
-   hv_vmbus_on_events(cpu);
-   }
+   hv_vmbus_on_events(cpu);
 
/* Check if there are actual msgs to be process */
page_addr = hv_vmbus_g_context.syn_ic_msg_page[cpu];
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r297898 - head/sys/dev/bxe

2016-04-12 Thread Sepherosa Ziehau
Hi David,

BLOGI(sc, "cdu_context i %d paddr %#jx vaddr %p size 0x%zx\n", i,
sc->context[i].vcxt_dma.paddr, sc->context[i].vcxt_dma.vaddr,
sc->context[i].size);

This breaks i386 building.  I think you need to do (uintmax_t)paddr for %jx:

/usr/freebsd-svn/sys/dev/bxe/bxe.c:18746:13: error: format specifies
type 'uintmax_t' (aka 'unsigned long long') but the argument has type
'bus_addr_t' (aka 'unsigned int') [-Werror,-Wformat]
sc->context[i].vcxt_dma.paddr, sc->context[i].vcxt_dma.vaddr,
^


On Wed, Apr 13, 2016 at 8:53 AM, David C Somayajulu  wrote:
> Author: davidcs
> Date: Wed Apr 13 00:53:04 2016
> New Revision: 297898
> URL: https://svnweb.freebsd.org/changeset/base/297898
>
> Log:
>   1. modify fwdump (a.k.a grcdump) memory is allocated and freed on as needed
>  basis.
>   2. grcdump can be taken at failure points by invoking bxe_grc_dump() when
>  trigger_grcdump sysctl flag is set. When grcdump is taken grcdump_done
>  sysctl flag is set.
>   3. grcdump_done can be monitored by the user to retrieve the grcdump.
>
>   Submitted by:vaishali.kulka...@qlogic.com
>   Approved by:davi...@freebsd.org
>   MFC after:5 days
>
> Modified:
>   head/sys/dev/bxe/bxe.c
>   head/sys/dev/bxe/bxe.h
>   head/sys/dev/bxe/bxe_stats.c
>
> Modified: head/sys/dev/bxe/bxe.c
> ==
> --- head/sys/dev/bxe/bxe.c  Wed Apr 13 00:30:42 2016(r297897)
> +++ head/sys/dev/bxe/bxe.c  Wed Apr 13 00:53:04 2016(r297898)
> @@ -672,7 +672,6 @@ static void bxe_handle_fp_tq(void *conte
>
>  static int bxe_add_cdev(struct bxe_softc *sc);
>  static void bxe_del_cdev(struct bxe_softc *sc);
> -static int bxe_grc_dump(struct bxe_softc *sc);
>  static int bxe_alloc_buf_rings(struct bxe_softc *sc);
>  static void bxe_free_buf_rings(struct bxe_softc *sc);
>
> @@ -3449,6 +3448,10 @@ bxe_watchdog(struct bxe_softc*sc,
>  }
>
>  BLOGE(sc, "TX watchdog timeout on fp[%02d], resetting!\n", fp->index);
> +if(sc->trigger_grcdump) {
> + /* taking grcdump */
> + bxe_grc_dump(sc);
> +}
>
>  BXE_FP_TX_UNLOCK(fp);
>
> @@ -15637,30 +15640,6 @@ bxe_sysctl_state(SYSCTL_HANDLER_ARGS)
>  }
>
>  static int
> -bxe_sysctl_trigger_grcdump(SYSCTL_HANDLER_ARGS)
> -{
> -struct bxe_softc *sc;
> -int error, result;
> -
> -result = 0;
> -error = sysctl_handle_int(oidp, , 0, req);
> -
> -if (error || !req->newptr) {
> -return (error);
> -}
> -
> -if (result == 1) {
> -sc = (struct bxe_softc *)arg1;
> -
> -BLOGI(sc, "... grcdump start ...\n");
> -bxe_grc_dump(sc);
> -BLOGI(sc, "... grcdump done ...\n");
> -}
> -
> -return (error);
> -}
> -
> -static int
>  bxe_sysctl_eth_stat(SYSCTL_HANDLER_ARGS)
>  {
>  struct bxe_softc *sc = (struct bxe_softc *)arg1;
> @@ -15811,14 +15790,16 @@ bxe_add_sysctls(struct bxe_softc *sc)
>  "debug logging mode");
>  #endif /* #if __FreeBSD_version >= 90 */
>
> -SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "trigger_grcdump",
> -CTLTYPE_UINT | CTLFLAG_RW, sc, 0,
> -bxe_sysctl_trigger_grcdump, "IU",
> -"set by driver when a grcdump is needed");
> +sc->trigger_grcdump = 0;
> +SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "trigger_grcdump",
> +   CTLFLAG_RW, >trigger_grcdump, 0,
> +   "trigger grcdump should be invoked"
> +   "  before collecting grcdump");
>
> +sc->grcdump_started = 0;
>  sc->grcdump_done = 0;
>  SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "grcdump_done",
> -   CTLFLAG_RW, >grcdump_done, 0,
> +   CTLFLAG_RD, >grcdump_done, 0,
> "set by driver when grcdump is done");
>
>  sc->rx_budget = bxe_rx_budget;
> @@ -18650,7 +18631,7 @@ bxe_get_preset_regs(struct bxe_softc *sc
>  return 0;
>  }
>
> -static int
> +int
>  bxe_grc_dump(struct bxe_softc *sc)
>  {
>  int rval = 0;
> @@ -18658,12 +18639,53 @@ bxe_grc_dump(struct bxe_softc *sc)
>  uint8_t *buf;
>  uint32_t size;
>  struct  dump_header *d_hdr;
> +uint32_t i;
> +uint32_t reg_val;
> +uint32_t reg_addr;
> +uint32_t cmd_offset;
> +int context_size;
> +int allocated;
> +struct ecore_ilt *ilt = SC_ILT(sc);
> +struct bxe_fastpath *fp;
> +struct ilt_client_info *ilt_cli;
> +int grc_dump_size;
>
> -if (sc->grcdump_done)
> +
> +if (sc->grcdump_done || sc->grcdump_started)
> return (rval);
>
> +sc->grcdump_started = 1;
> +BLOGI(sc, "Started collecting grcdump\n");
> +
> +grc_dump_size = (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) +
> +sizeof(struct  dump_header);
> +
> +sc->grc_dump = malloc(grc_dump_size, M_DEVBUF, M_NOWAIT);
> +
> +if (sc->grc_dump == 

svn commit: r297907 - head/usr.sbin/ypldap

2016-04-12 Thread Marcelo Araujo
Author: araujo
Date: Wed Apr 13 03:36:34 2016
New Revision: 297907
URL: https://svnweb.freebsd.org/changeset/base/297907

Log:
  Convert ypldap_addr list to a tailq(queue(3)).
  
  Obtained from:OpenBSD r1.11, r1.17 and r1.36

Modified:
  head/usr.sbin/ypldap/ldapclient.c
  head/usr.sbin/ypldap/ypldap.h
  head/usr.sbin/ypldap/ypldap_dns.c

Modified: head/usr.sbin/ypldap/ldapclient.c
==
--- head/usr.sbin/ypldap/ldapclient.c   Wed Apr 13 02:04:09 2016
(r297906)
+++ head/usr.sbin/ypldap/ldapclient.c   Wed Apr 13 03:36:34 2016
(r297907)
@@ -57,18 +57,18 @@ int client_try_idm(struct env *, struct 
 intclient_addr_init(struct idm *);
 intclient_addr_free(struct idm *);
 
-struct aldap   *client_aldap_open(struct ypldap_addr *);
+struct aldap   *client_aldap_open(struct ypldap_addr_list *);
 
 /*
  * dummy wrapper to provide aldap_init with its fd's.
  */
 struct aldap *
-client_aldap_open(struct ypldap_addr *addr)
+client_aldap_open(struct ypldap_addr_list *addr)
 {
int  fd = -1;
struct ypldap_addr   *p;
 
-   for (p = addr; p != NULL; p = p->next) {
+   TAILQ_FOREACH(p, addr, next) {
char hbuf[NI_MAXHOST], sbuf[NI_MAXSERV];
struct sockaddr *sa = (struct sockaddr *)>ss;
 
@@ -99,7 +99,7 @@ client_addr_init(struct idm *idm)
 struct sockaddr_in6 *sa_in6;
 struct ypldap_addr *h;
 
-for (h = idm->idm_addr; h != NULL; h = h->next) {
+   TAILQ_FOREACH(h, >idm_addr, next) {
 switch (h->ss.ss_family) {
 case AF_INET:
 sa_in = (struct sockaddr_in *)>ss;
@@ -125,18 +125,14 @@ client_addr_init(struct idm *idm)
 int
 client_addr_free(struct idm *idm)
 {
-struct ypldap_addr *h, *p;
-
-   if (idm->idm_addr == NULL)
-   return (-1);
+struct ypldap_addr *h;
 
-   for (h = idm->idm_addr; h != NULL; h = p) {
-   p = h->next;
+   while (!TAILQ_EMPTY(>idm_addr)) {
+   h = TAILQ_FIRST(>idm_addr);
+   TAILQ_REMOVE(>idm_addr, h, next);
free(h);
}
 
-   idm->idm_addr = NULL;
-
return (0);
 }
 
@@ -200,8 +196,8 @@ client_dispatch_dns(int fd, short events
log_warnx("IMSG_HOST_DNS with invalid peerID");
break;
}
-   if (idm->idm_addr != NULL) {
-   log_warnx("IMSG_HOST_DNS but addr != NULL!");
+   if (!TAILQ_EMPTY(>idm_addr)) {
+   log_warnx("IMSG_HOST_DNS but addrs set!");
break;
}
 
@@ -213,17 +209,10 @@ client_dispatch_dns(int fd, short events
 
data = (u_char *)imsg.data;
while (dlen >= sizeof(struct sockaddr_storage)) {
-   if ((h = calloc(1, sizeof(struct ypldap_addr))) 
==
-   NULL)
+   if ((h = calloc(1, sizeof(*h))) == NULL)
fatal(NULL);
memcpy(>ss, data, sizeof(h->ss));
-
-   if (idm->idm_addr == NULL)
-   h->next = NULL;
-   else
-   h->next = idm->idm_addr;
-
-   idm->idm_addr = h;
+   TAILQ_INSERT_HEAD(>idm_addr, h, next);
 
data += sizeof(h->ss);
dlen -= sizeof(h->ss);
@@ -588,7 +577,7 @@ client_try_idm(struct env *env, struct i
struct aldap*al;
 
where = "connect";
-   if ((al = client_aldap_open(idm->idm_addr)) == NULL)
+   if ((al = client_aldap_open(>idm_addr)) == NULL)
return (-1);
 
if (idm->idm_flags & F_NEEDAUTH) {

Modified: head/usr.sbin/ypldap/ypldap.h
==
--- head/usr.sbin/ypldap/ypldap.h   Wed Apr 13 02:04:09 2016
(r297906)
+++ head/usr.sbin/ypldap/ypldap.h   Wed Apr 13 03:36:34 2016
(r297907)
@@ -42,9 +42,10 @@ enum imsg_type {
 };
 
 struct ypldap_addr {
-   struct ypldap_addr  *next;
-   struct sockaddr_storage  ss;
+   TAILQ_ENTRY(ypldap_addr)next;
+   struct sockaddr_storage ss;
 };
+TAILQ_HEAD(ypldap_addr_list, ypldap_addr);
 
 enum {
PROC_MAIN,
@@ -91,7 +92,7 @@ struct idm {
enum client_stateidm_state;
u_int32_tidm_flags; /* lower 20 reserved */
u_int32_tidm_list;
-   struct 

Re: svn commit: r297902 - head

2016-04-12 Thread Bryan Drewery
On 4/12/2016 8:00 PM, Steve Wills wrote:
> On 04/12/16 09:59 PM, Ian Lepore wrote:
>>
>> More succinctly:
>>
>> .if empty(SVN)
>> SVN!= which svn || which svnlite
>> .endif
>>
> 
> Fair enough, that's basically the intent. I think we like to avoid !=,
> at least in ports, and I wanted the logic between src and ports to match
> in this case.
> 

Yeah, please avoid != where possible.

If you switch to this then also add .export SVN after the SVN!= line.

I somewhat like this version more though since /usr/local/bin may not be
in the PATH.

-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r297902 - head

2016-04-12 Thread Steve Wills
On 04/12/16 09:59 PM, Ian Lepore wrote:
> 
> More succinctly:
> 
> .if empty(SVN)
> SVN!= which svn || which svnlite
> .endif
> 

Fair enough, that's basically the intent. I think we like to avoid !=,
at least in ports, and I wanted the logic between src and ports to match
in this case.

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


Re: svn commit: r297897 - in head/usr.bin: . resizewin

2016-04-12 Thread Conrad Meyer
On Tue, Apr 12, 2016 at 5:30 PM, Conrad E. Meyer  wrote:
> Author: cem
> Date: Wed Apr 13 00:30:42 2016
> New Revision: 297897
> URL: https://svnweb.freebsd.org/changeset/base/297897
>
> Log:
>   Add a small tool, resizewin(1), to query terminal for window size

Whoops.  The commit message should have included this blurb from the
phabricator review:

This tool is a smaller, less featured version of resize from the xterm port.

It's very useful when accessing systems via serial console that
don't run X (e.g. dev boxes).

Sorry,
Conrad

>   Submitted by: Daniel O'Connor
>   Reviewed by:  kan, wblock, cem
>   Sponsored by: EMC / Isilon Storage Division
>   Differential Revision:https://reviews.freebsd.org/D4438
>
> Added:
>   head/usr.bin/resizewin/
>   head/usr.bin/resizewin/Makefile   (contents, props changed)
>   head/usr.bin/resizewin/resizewin.1   (contents, props changed)
>   head/usr.bin/resizewin/resizewin.c   (contents, props changed)
> Modified:
>   head/usr.bin/Makefile
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r297902 - head

2016-04-12 Thread Ian Lepore
On Wed, 2016-04-13 at 01:47 +, Steve Wills wrote:
> Author: swills (ports committer)
> Date: Wed Apr 13 01:47:04 2016
> New Revision: 297902
> URL: https://svnweb.freebsd.org/changeset/base/297902
> 
> Log:
>   Try harder to find svn
>   
>   While here, elliminate last references to CVS_UPDATE and SUP_UPDATE
>   
>   Reviewed by:gjb
>   Approved by:gjb
> 
> Modified:
>   head/Makefile.inc1
> 
> Modified: head/Makefile.inc1
> =
> =
> --- head/Makefile.inc1Wed Apr 13 01:46:48 2016(r29790
> 1)
> +++ head/Makefile.inc1Wed Apr 13 01:47:04 2016(r29790
> 2)
> @@ -153,7 +153,15 @@ BUILDENV_SHELL?=${SHELL}
>  BUILDENV_SHELL?=/bin/sh
>  .endif
>  
> -SVN?=/usr/local/bin/svn
> +.if !defined(SVN) || empty(SVN)
> +. for _P in /usr/bin /usr/local/bin
> +.  for _S in svn svnlite
> +.   if exists(${_P}/${_S})
> +SVN=   ${_P}/${_S}
> +.   endif
> +.  endfor
> +. endfor
> +.endif
>  SVNFLAGS?=   -r HEAD
>  

More succinctly:

.if empty(SVN)
SVN!= which svn || which svnlite
.endif

-- Ian

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


svn commit: r297905 - head/usr.bin/fmt

2016-04-12 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Apr 13 01:57:06 2016
New Revision: 297905
URL: https://svnweb.freebsd.org/changeset/base/297905

Log:
  fmt(1): for pointers use NULL instead of 0
  
  While here clean excessive not lint comment indentation.

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

Modified: head/usr.bin/fmt/fmt.c
==
--- head/usr.bin/fmt/fmt.c  Wed Apr 13 01:54:36 2016(r297904)
+++ head/usr.bin/fmt/fmt.c  Wed Apr 13 01:57:06 2016(r297905)
@@ -171,8 +171,7 @@
 #ifndef lint
 static const char copyright[] =
 "Copyright (c) 1997 Gareth McCaughan. All rights reserved.\n";
-
-#endif /* not lint */
+#endif /* not lint */
 #include 
 __FBSDID("$FreeBSD$");
 
@@ -248,7 +247,7 @@ static int grok_mail_headers = 0;   /* tre
 static int format_troff = 0;   /* Format troff? */
 
 static int n_errors = 0;   /* Number of failed files. Return on 
exit. */
-static wchar_t *output_buffer = 0; /* Output line will be built here */
+static wchar_t *output_buffer = NULL;  /* Output line will be built here */
 static size_t x;   /* Horizontal position in output line */
 static size_t x0;  /* Ditto, ignoring leading whitespace */
 static size_t output_buffer_length = 0;
@@ -693,7 +692,7 @@ center_stream(FILE *stream, const char *
size_t width;
int cwidth;
 
-   while ((line = get_line(stream, )) != 0) {
+   while ((line = get_line(stream, )) != NULL) {
size_t l = length;
 
while (l > 0 && iswspace(*line)) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297903 - head/usr.sbin/ypldap

2016-04-12 Thread Marcelo Araujo
Author: araujo
Date: Wed Apr 13 01:54:33 2016
New Revision: 297903
URL: https://svnweb.freebsd.org/changeset/base/297903

Log:
  Apply revisions 1.4 and 1.5 from ldapd's ber.c to ypldap's copy, so it can
  deal with messages that haven't been fully read from the server yet.
  
  Obtained from:OpenBSD r1.11

Modified:
  head/usr.sbin/ypldap/ber.c

Modified: head/usr.sbin/ypldap/ber.c
==
--- head/usr.sbin/ypldap/ber.c  Wed Apr 13 01:47:04 2016(r297902)
+++ head/usr.sbin/ypldap/ber.c  Wed Apr 13 01:54:33 2016(r297903)
@@ -1083,6 +1083,15 @@ ber_read_element(struct ber *ber, struct
DPRINTF("ber read element size %zd\n", len);
totlen += r + len;
 
+   /*
+* If using an external buffer and the total size of the element
+* is larger, then the external buffer don't bother to continue.
+*/
+   if (ber->fd == -1 && len > ber->br_rend - ber->br_rptr) {
+   errno = ECANCELED;
+   return -1;
+   }
+
elm->be_type = type;
elm->be_len = len;
elm->be_class = class;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297904 - stable/10/lib/libc/db/hash

2016-04-12 Thread Bryan Drewery
Author: bdrewery
Date: Wed Apr 13 01:54:36 2016
New Revision: 297904
URL: https://svnweb.freebsd.org/changeset/base/297904

Log:
  MFC r297626:
  
Follow-up r295924: Only sync hash-based db files open for writing when
closing.

Modified:
  stable/10/lib/libc/db/hash/hash.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libc/db/hash/hash.c
==
--- stable/10/lib/libc/db/hash/hash.c   Wed Apr 13 01:54:33 2016
(r297903)
+++ stable/10/lib/libc/db/hash/hash.c   Wed Apr 13 01:54:36 2016
(r297904)
@@ -423,7 +423,8 @@ hdestroy(HTAB *hashp)
free(hashp->tmp_buf);
 
if (hashp->fp != -1) {
-   (void)_fsync(hashp->fp);
+   if (hashp->save_file)
+   (void)_fsync(hashp->fp);
(void)_close(hashp->fp);
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r297889 - in vendor/Juniper/libxo/dist: . libxo

2016-04-12 Thread Phil Shafer
NGie Cooper writes:
>> Log:
>>  import libso 0.4.6
>
>I think you meant libxo...

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


svn commit: r297902 - head

2016-04-12 Thread Steve Wills
Author: swills (ports committer)
Date: Wed Apr 13 01:47:04 2016
New Revision: 297902
URL: https://svnweb.freebsd.org/changeset/base/297902

Log:
  Try harder to find svn
  
  While here, elliminate last references to CVS_UPDATE and SUP_UPDATE
  
  Reviewed by:  gjb
  Approved by:  gjb

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Wed Apr 13 01:46:48 2016(r297901)
+++ head/Makefile.inc1  Wed Apr 13 01:47:04 2016(r297902)
@@ -153,7 +153,15 @@ BUILDENV_SHELL?=${SHELL}
 BUILDENV_SHELL?=/bin/sh
 .endif
 
-SVN?=  /usr/local/bin/svn
+.if !defined(SVN) || empty(SVN)
+. for _P in /usr/bin /usr/local/bin
+.  for _S in svn svnlite
+.   if exists(${_P}/${_S})
+SVN=   ${_P}/${_S}
+.   endif
+.  endfor
+. endfor
+.endif
 SVNFLAGS?= -r HEAD
 
 MAKEOBJDIRPREFIX?= /usr/obj
@@ -1210,13 +1218,6 @@ doxygen: .PHONY
 # latest copy.
 #
 update:
-.if (defined(CVS_UPDATE) || defined(SUP_UPDATE)) && !defined(SVN_UPDATE)
-   @echo "--"
-   @echo "CVS_UPDATE and SUP_UPDATE are no longer supported."
-   @echo "Please see: https://wiki.freebsd.org/CvsIsDeprecated;
-   @echo "--"
-   @exit 1
-.endif
 .if defined(SVN_UPDATE)
@echo "--"
@echo ">>> Updating ${.CURDIR} using Subversion"
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297901 - head/usr.bin/fmt

2016-04-12 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Apr 13 01:46:48 2016
New Revision: 297901
URL: https://svnweb.freebsd.org/changeset/base/297901

Log:
  fmt(1): reformat with indent(1).
  
  Failed attempt to get nearer to style(9) and the format from the
  original OpenBSD code. At least it should be readable now.
  
  No functional change.

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

Modified: head/usr.bin/fmt/fmt.c
==
--- head/usr.bin/fmt/fmt.c  Wed Apr 13 01:08:42 2016(r297900)
+++ head/usr.bin/fmt/fmt.c  Wed Apr 13 01:46:48 2016(r297901)
@@ -1,4 +1,4 @@
-/* $OpenBSD: fmt.c,v 1.16 2000/06/25 15:35:42 pjanzen Exp $*/
+/* $OpenBSD: fmt.c,v 1.21 2004/04/01 23:14:19 tedu Exp $   */
 
 /* Sensible version of fmt
  *
@@ -170,8 +170,9 @@
 
 #ifndef lint
 static const char copyright[] =
-  "Copyright (c) 1997 Gareth McCaughan. All rights reserved.\n";
-#endif /* not lint */
+"Copyright (c) 1997 Gareth McCaughan. All rights reserved.\n";
+
+#endif /* not lint */
 #include 
 __FBSDID("$FreeBSD$");
 
@@ -198,57 +199,74 @@ __FBSDID("$FreeBSD$");
  * (returning 0 instead), but we do complain about bad numbers.
  */
 static size_t
-get_positive(const char *s, const char *err_mess, int fussyP) {
-  char *t;
-  long result = strtol(s,,0);
-  if (*t) { if (fussyP) goto Lose; else return 0; }
-  if (result<=0) { Lose: errx(EX_USAGE, "%s", err_mess); }
-  return (size_t) result;
+get_positive(const char *s, const char *err_mess, int fussyP)
+{
+   char *t;
+   long result = strtol(s, , 0);
+
+   if (*t) {
+   if (fussyP)
+   goto Lose;
+   else
+   return 0;
+   }
+   if (result <= 0) {
+Lose:  errx(EX_USAGE, "%s", err_mess);
+   }
+   return (size_t)result;
 }
 
 static size_t
-get_nonnegative(const char *s, const char *err_mess, int fussyP) {
-  char *t;
-  long result = strtol(s,,0);
-  if (*t) { if (fussyP) goto Lose; else return 0; }
-  if (result<0) { Lose: errx(EX_USAGE, "%s", err_mess); }
-  return (size_t) result;
+get_nonnegative(const char *s, const char *err_mess, int fussyP)
+{
+   char *t;
+   long result = strtol(s, , 0);
+
+   if (*t) {
+   if (fussyP)
+   goto Lose;
+   else
+   return 0;
+   }
+   if (result < 0) {
+Lose:  errx(EX_USAGE, "%s", err_mess);
+   }
+   return (size_t)result;
 }
 
 /* Global variables */
 
-static int centerP=0;  /* Try to center lines? */
-static size_t goal_length=0;   /* Target length for output lines */
-static size_t max_length=0;/* Maximum length for output lines */
-static int coalesce_spaces_P=0;/* Coalesce multiple whitespace -> ' ' 
? */
-static int allow_indented_paragraphs=0;/* Can first line have diff. 
ind.? */
-static int tab_width=8;/* Number of spaces per tab stop */
-static size_t output_tab_width=8;  /* Ditto, when squashing leading spaces 
*/
-static const wchar_t *sentence_enders=L".?!";  /* Double-space after these */
-static int grok_mail_headers=0;/* treat embedded mail headers 
magically? */
-static int format_troff=0; /* Format troff? */
-
-static int n_errors=0; /* Number of failed files. Return on exit. */
-static wchar_t *output_buffer=0;   /* Output line will be built here */
-static size_t x;   /* Horizontal position in output line */
-static size_t x0;  /* Ditto, ignoring leading whitespace */
+static int centerP = 0;/* Try to center lines? */
+static size_t goal_length = 0; /* Target length for output lines */
+static size_t max_length = 0;  /* Maximum length for output lines */
+static int coalesce_spaces_P = 0;  /* Coalesce multiple whitespace -> ' ' 
? */
+static int allow_indented_paragraphs = 0;  /* Can first line have diff. 
ind.? */
+static int tab_width = 8;  /* Number of spaces per tab stop */
+static size_t output_tab_width = 8;/* Ditto, when squashing leading spaces 
*/
+static const wchar_t *sentence_enders = L".?!";/* Double-space after 
these */
+static int grok_mail_headers = 0;  /* treat embedded mail headers 
magically? */
+static int format_troff = 0;   /* Format troff? */
+
+static int n_errors = 0;   /* Number of failed files. Return on 
exit. */
+static wchar_t *output_buffer = 0; /* Output line will be built here */
+static size_t x;   /* Horizontal position in output line */
+static size_t x0;  /* Ditto, ignoring leading whitespace */
 static size_t output_buffer_length = 0;
-static size_t pending_spaces;  /* Spaces to add before next word */
-static int output_in_paragraph=0;  /* Any of current para written out yet? 
*/
+static size_t pending_spaces;  /* Spaces to add 

Re: svn commit: r297889 - in vendor/Juniper/libxo/dist: . libxo

2016-04-12 Thread NGie Cooper

> On Apr 12, 2016, at 16:03, Phil Shafer  wrote:
> 
> Author: phil
> Date: Tue Apr 12 23:03:01 2016
> New Revision: 297889
> URL: https://svnweb.freebsd.org/changeset/base/297889
> 
> Log:
>  import libso 0.4.6

I think you meant libxo...

> 
> Added:
>  vendor/Juniper/libxo/dist/libxo/xo_config.h.in   (contents, props changed)
> Modified:
>  vendor/Juniper/libxo/dist/.svnignore
> Directory Properties:
>  vendor/Juniper/libxo/dist/   (props changed)
> 
> Modified: vendor/Juniper/libxo/dist/.svnignore
> ==
> --- vendor/Juniper/libxo/dist/.svnignoreTue Apr 12 22:59:20 2016
> (r297888)
> +++ vendor/Juniper/libxo/dist/.svnignoreTue Apr 12 23:03:01 2016
> (r297889)
> @@ -13,6 +13,6 @@ doc/Makefile.in
> info*
> install-sh
> ltmain.sh
> -m4*
> +m4
> missing
> patches*
> 
> Added: vendor/Juniper/libxo/dist/libxo/xo_config.h.in
> ==
> --- /dev/null00:00:00 1970(empty, because file is newly added)
> +++ vendor/Juniper/libxo/dist/libxo/xo_config.h.inTue Apr 12 23:03:01 
> 2016(r297889)
> @@ -0,0 +1,246 @@
> +/* libxo/xo_config.h.in.  Generated from configure.ac by autoheader.  */
> +
> +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
> +   systems. This function is required for `alloca.c' support on those 
> systems.
> +   */
> +#undef CRAY_STACKSEG_END
> +
> +/* Define to 1 if using `alloca.c'. */
> +#undef C_ALLOCA
> +
> +/* Define to 1 if you have `alloca', as a function or macro. */
> +#undef HAVE_ALLOCA
> +
> +/* Define to 1 if you have  and it should be used (not on Ultrix).
> +   */
> +#undef HAVE_ALLOCA_H
> +
> +/* Define to 1 if you have the `asprintf' function. */
> +#undef HAVE_ASPRINTF
> +
> +/* Define to 1 if you have the `bzero' function. */
> +#undef HAVE_BZERO
> +
> +/* Define to 1 if you have the `ctime' function. */
> +#undef HAVE_CTIME
> +
> +/* Define to 1 if you have the  header file. */
> +#undef HAVE_CTYPE_H
> +
> +/* Define to 1 if you have the declaration of `__isthreaded', and to 0 if you
> +   don't. */
> +#undef HAVE_DECL___ISTHREADED
> +
> +/* Define to 1 if you have the  header file. */
> +#undef HAVE_DLFCN_H
> +
> +/* Define to 1 if you have the `dlfunc' function. */
> +#undef HAVE_DLFUNC
> +
> +/* Define to 1 if you have the  header file. */
> +#undef HAVE_ERRNO_H
> +
> +/* Define to 1 if you have the `fdopen' function. */
> +#undef HAVE_FDOPEN
> +
> +/* Define to 1 if you have the `flock' function. */
> +#undef HAVE_FLOCK
> +
> +/* Define to 1 if you have the `getpass' function. */
> +#undef HAVE_GETPASS
> +
> +/* Define to 1 if you have the `getprogname' function. */
> +#undef HAVE_GETPROGNAME
> +
> +/* Define to 1 if you have the `getrusage' function. */
> +#undef HAVE_GETRUSAGE
> +
> +/* gettext(3) */
> +#undef HAVE_GETTEXT
> +
> +/* Define to 1 if you have the `gettimeofday' function. */
> +#undef HAVE_GETTIMEOFDAY
> +
> +/* humanize_number(3) */
> +#undef HAVE_HUMANIZE_NUMBER
> +
> +/* Define to 1 if you have the  header file. */
> +#undef HAVE_INTTYPES_H
> +
> +/* Define to 1 if you have the `crypto' library (-lcrypto). */
> +#undef HAVE_LIBCRYPTO
> +
> +/* Define to 1 if you have the `m' library (-lm). */
> +#undef HAVE_LIBM
> +
> +/* Define to 1 if you have the  header file. */
> +#undef HAVE_LIBUTIL_H
> +
> +/* Define to 1 if your system has a GNU libc compatible `malloc' function, 
> and
> +   to 0 otherwise. */
> +#undef HAVE_MALLOC
> +
> +/* Define to 1 if you have the `memmove' function. */
> +#undef HAVE_MEMMOVE
> +
> +/* Define to 1 if you have the  header file. */
> +#undef HAVE_MEMORY_H
> +
> +/* Support printflike */
> +#undef HAVE_PRINTFLIKE
> +
> +/* Define to 1 if your system has a GNU libc compatible `realloc' function,
> +   and to 0 otherwise. */
> +#undef HAVE_REALLOC
> +
> +/* Define to 1 if you have the `srand' function. */
> +#undef HAVE_SRAND
> +
> +/* Define to 1 if you have the `sranddev' function. */
> +#undef HAVE_SRANDDEV
> +
> +/* Define to 1 if you have the  header file. */
> +#undef HAVE_STDINT_H
> +
> +/* Define to 1 if you have the  header file. */
> +#undef HAVE_STDIO_EXT_H
> +
> +/* Define to 1 if you have the  header file. */
> +#undef HAVE_STDIO_H
> +
> +/* Define to 1 if you have the  header file. */
> +#undef HAVE_STDLIB_H
> +
> +/* Define to 1 if you have the  header file. */
> +#undef HAVE_STDTIME_TZFILE_H
> +
> +/* Define to 1 if you have the `strchr' function. */
> +#undef HAVE_STRCHR
> +
> +/* Define to 1 if you have the `strcspn' function. */
> +#undef HAVE_STRCSPN
> +
> +/* Define to 1 if you have the `strerror' function. */
> +#undef HAVE_STRERROR
> +
> +/* Define to 1 if you have the  header file. */
> +#undef HAVE_STRINGS_H
> +
> +/* Define to 1 if you have the  header file. */
> +#undef HAVE_STRING_H
> +
> +/* Define to 1 if you have the `strlcpy' function. */
> +#undef HAVE_STRLCPY
> +
> +/* Define to 1 

svn commit: r297898 - head/sys/dev/bxe

2016-04-12 Thread David C Somayajulu
Author: davidcs
Date: Wed Apr 13 00:53:04 2016
New Revision: 297898
URL: https://svnweb.freebsd.org/changeset/base/297898

Log:
  1. modify fwdump (a.k.a grcdump) memory is allocated and freed on as needed
 basis.
  2. grcdump can be taken at failure points by invoking bxe_grc_dump() when
 trigger_grcdump sysctl flag is set. When grcdump is taken grcdump_done
 sysctl flag is set.
  3. grcdump_done can be monitored by the user to retrieve the grcdump.
  
  Submitted by:vaishali.kulka...@qlogic.com
  Approved by:davi...@freebsd.org
  MFC after:5 days

Modified:
  head/sys/dev/bxe/bxe.c
  head/sys/dev/bxe/bxe.h
  head/sys/dev/bxe/bxe_stats.c

Modified: head/sys/dev/bxe/bxe.c
==
--- head/sys/dev/bxe/bxe.c  Wed Apr 13 00:30:42 2016(r297897)
+++ head/sys/dev/bxe/bxe.c  Wed Apr 13 00:53:04 2016(r297898)
@@ -672,7 +672,6 @@ static void bxe_handle_fp_tq(void *conte
 
 static int bxe_add_cdev(struct bxe_softc *sc);
 static void bxe_del_cdev(struct bxe_softc *sc);
-static int bxe_grc_dump(struct bxe_softc *sc);
 static int bxe_alloc_buf_rings(struct bxe_softc *sc);
 static void bxe_free_buf_rings(struct bxe_softc *sc);
 
@@ -3449,6 +3448,10 @@ bxe_watchdog(struct bxe_softc*sc,
 }
 
 BLOGE(sc, "TX watchdog timeout on fp[%02d], resetting!\n", fp->index);
+if(sc->trigger_grcdump) {
+ /* taking grcdump */
+ bxe_grc_dump(sc);
+}
 
 BXE_FP_TX_UNLOCK(fp);
 
@@ -15637,30 +15640,6 @@ bxe_sysctl_state(SYSCTL_HANDLER_ARGS)
 }
 
 static int
-bxe_sysctl_trigger_grcdump(SYSCTL_HANDLER_ARGS)
-{
-struct bxe_softc *sc;
-int error, result;
-
-result = 0;
-error = sysctl_handle_int(oidp, , 0, req);
-
-if (error || !req->newptr) {
-return (error);
-}
-
-if (result == 1) {
-sc = (struct bxe_softc *)arg1;
-
-BLOGI(sc, "... grcdump start ...\n");
-bxe_grc_dump(sc);
-BLOGI(sc, "... grcdump done ...\n");
-}
-
-return (error);
-}
-
-static int
 bxe_sysctl_eth_stat(SYSCTL_HANDLER_ARGS)
 {
 struct bxe_softc *sc = (struct bxe_softc *)arg1;
@@ -15811,14 +15790,16 @@ bxe_add_sysctls(struct bxe_softc *sc)
 "debug logging mode");
 #endif /* #if __FreeBSD_version >= 90 */
 
-SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "trigger_grcdump",
-CTLTYPE_UINT | CTLFLAG_RW, sc, 0,
-bxe_sysctl_trigger_grcdump, "IU",
-"set by driver when a grcdump is needed");
+sc->trigger_grcdump = 0;
+SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "trigger_grcdump",
+   CTLFLAG_RW, >trigger_grcdump, 0,
+   "trigger grcdump should be invoked"
+   "  before collecting grcdump");
 
+sc->grcdump_started = 0;
 sc->grcdump_done = 0;
 SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "grcdump_done",
-   CTLFLAG_RW, >grcdump_done, 0,
+   CTLFLAG_RD, >grcdump_done, 0,
"set by driver when grcdump is done");
 
 sc->rx_budget = bxe_rx_budget;
@@ -18650,7 +18631,7 @@ bxe_get_preset_regs(struct bxe_softc *sc
 return 0;
 }
 
-static int
+int
 bxe_grc_dump(struct bxe_softc *sc)
 {
 int rval = 0;
@@ -18658,12 +18639,53 @@ bxe_grc_dump(struct bxe_softc *sc)
 uint8_t *buf;
 uint32_t size;
 struct  dump_header *d_hdr;
+uint32_t i;
+uint32_t reg_val;
+uint32_t reg_addr;
+uint32_t cmd_offset;
+int context_size;
+int allocated;
+struct ecore_ilt *ilt = SC_ILT(sc);
+struct bxe_fastpath *fp;
+struct ilt_client_info *ilt_cli;
+int grc_dump_size;
 
-if (sc->grcdump_done)
+
+if (sc->grcdump_done || sc->grcdump_started)
return (rval);
 
+sc->grcdump_started = 1;
+BLOGI(sc, "Started collecting grcdump\n");
+
+grc_dump_size = (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) +
+sizeof(struct  dump_header);
+
+sc->grc_dump = malloc(grc_dump_size, M_DEVBUF, M_NOWAIT);
+
+if (sc->grc_dump == NULL) {
+BLOGW(sc, "Unable to allocate memory for grcdump collection\n");
+return(ENOMEM);
+}
+
+
+
+/* Disable parity attentions as long as following dump may
+ * cause false alarms by reading never written registers. We
+ * will re-enable parity attentions right after the dump.
+ */
+
+/* Disable parity on path 0 */
+bxe_pretend_func(sc, 0);
+
 ecore_disable_blocks_parity(sc);
 
+/* Disable parity on path 1 */
+bxe_pretend_func(sc, 1);
+ecore_disable_blocks_parity(sc);
+
+/* Return to current function */
+bxe_pretend_func(sc, SC_ABS_FUNC(sc));
+
 buf = sc->grc_dump;
 d_hdr = sc->grc_dump;
 
@@ -18695,7 +18717,7 @@ bxe_grc_dump(struct bxe_softc *sc)
 (preset_idx == 11))
 continue;
 
-rval = bxe_get_preset_regs(sc, sc->grc_dump, preset_idx);
+rval = bxe_get_preset_regs(sc, 

svn commit: r297897 - in head/usr.bin: . resizewin

2016-04-12 Thread Conrad E. Meyer
Author: cem
Date: Wed Apr 13 00:30:42 2016
New Revision: 297897
URL: https://svnweb.freebsd.org/changeset/base/297897

Log:
  Add a small tool, resizewin(1), to query terminal for window size
  
  Submitted by: Daniel O'Connor
  Reviewed by:  kan, wblock, cem
  Sponsored by: EMC / Isilon Storage Division
  Differential Revision:https://reviews.freebsd.org/D4438

Added:
  head/usr.bin/resizewin/
  head/usr.bin/resizewin/Makefile   (contents, props changed)
  head/usr.bin/resizewin/resizewin.1   (contents, props changed)
  head/usr.bin/resizewin/resizewin.c   (contents, props changed)
Modified:
  head/usr.bin/Makefile

Modified: head/usr.bin/Makefile
==
--- head/usr.bin/Makefile   Wed Apr 13 00:10:42 2016(r297896)
+++ head/usr.bin/Makefile   Wed Apr 13 00:30:42 2016(r297897)
@@ -125,6 +125,7 @@ SUBDIR= alias \
protect \
rctl \
renice \
+   resizewin \
rev \
revoke \
rpcinfo \

Added: head/usr.bin/resizewin/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/resizewin/Makefile Wed Apr 13 00:30:42 2016
(r297897)
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+PROG=  resizewin
+
+.include 
+

Added: head/usr.bin/resizewin/resizewin.1
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/resizewin/resizewin.1  Wed Apr 13 00:30:42 2016
(r297897)
@@ -0,0 +1,64 @@
+.\" resizewin
+.\"
+.\" Query terminal for size and inform the kernel
+.\"
+.\" Copyright 2015 EMC / Isilon Storage Division
+.\"
+.\" 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$
+.\"
+.Dd March 17, 2016
+.Dt RESIZEWIN 1
+.Os
+.Sh NAME
+.Nm resizewin
+.Nd update the kernel window size for the current TTY
+.Sh DESCRIPTION
+Query the terminal emulator window size with the
+.Dv TIOCSWINSZ
+ioctl and set the window size known by the kernel to the new values.
+The terminal is assumed to be VT100/ANSI compatible.
+.Nm
+is functionally similar to
+.Xr resize 1 ,
+which is part of the
+.Xr xterm 1
+distribution.
+However,
+.Nm
+only works with VT100/ANSI-compatible terminals and does
+not emit commands to set environment variables.
+.Pp
+After a terminal window has been resized, running
+.Nm
+updates the kernel's window size to match the new size.
+.Pp
+Note that virtually all modern terninals support VT100/ANSI escape
+sequences, including xterm, konsole, gnome-terminal iTerm,
+Terminal.app, and puTTY.
+.Sh SEE ALSO
+.Xr resize 1 ,
+.Xr stty 1
+.Sh HISTORY
+.Nm
+appeared in FreeBSD 11.

Added: head/usr.bin/resizewin/resizewin.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/resizewin/resizewin.c  Wed Apr 13 00:30:42 2016
(r297897)
@@ -0,0 +1,129 @@
+/*
+ * resizewin
+ *
+ * Query terminal for size and inform the kernel
+ *
+ * Copyright 2015 EMC / Isilon Storage Division
+ *
+ * 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 

Re: svn commit: r297889 - in vendor/Juniper/libxo/dist: . libxo

2016-04-12 Thread Simon J. Gerraty
Bryan Drewery  wrote:
> Are files missing from this? It seems quite small for a release and the
> .svnignore makes me think there's a missing m4 directory.

The m4 directory was deliberately excluded along with some other junk
which is not relevant to FreeBSD.


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


svn commit: r297895 - vendor/Juniper/libxo

2016-04-12 Thread Phil Shafer
Author: phil
Date: Tue Apr 12 23:38:10 2016
New Revision: 297895
URL: https://svnweb.freebsd.org/changeset/base/297895

Log:
  add FreeBSD header to copied files

Modified:
  vendor/Juniper/libxo/import.sh

Modified: vendor/Juniper/libxo/import.sh
==
--- vendor/Juniper/libxo/import.sh  Tue Apr 12 23:30:56 2016
(r297894)
+++ vendor/Juniper/libxo/import.sh  Tue Apr 12 23:38:10 2016
(r297895)
@@ -15,6 +15,9 @@
 PROJECT=libxo
 MAKEOBJDIRPREFIX=/tank/home/phil/work/bsd/base/head/obj/
 export MAKEOBJDIRPREFIX
+EDITOR=vi
+VISUAL=vi
+export EDITOR VISUAL
 
 #"global" vars
 # Set SVN variables
@@ -261,8 +264,8 @@ Cd $CWD/../../../head
 HEAD=`pwd`
 info "HEAD = $HEAD"
 
-run "copying xo_config.h" "cp $CWD/dist/build/libxo/xo_config.h 
$HEAD/lib/libxo/"
-run "copying add.man" "cp $CWD/dist/build/libxo/add.man $HEAD/lib/libxo/"
+run "copying xo_config.h" "(echo '/* \$FreeBSD\$ */' ; cat 
$CWD/dist/build/libxo/xo_config.h ) > $HEAD/lib/libxo/xo_config.h"
+run "copying add.man" "(echo '.\\\" \$FreeBSD\$' ; cat 
$CWD/dist/build/libxo/add.man ) > $HEAD/lib/libxo/add.man"
 
 #BUILDDIRS="lib/libxo usr.bin/xo"
 #for dir in $BUILDDIRS ; do
@@ -309,7 +312,7 @@ run "checking merge issues" "$SVN diff -
 Cd $HEAD
 run "show svn stat for 'head'" "$SVN stat"
 run "show svn diff for 'head'" "$SVN diff --no-diff-deleted"
-run "commit changes to 'head'" "$SVN -m 'Merge $PROJECT $VERSION' commit"
+run "commit changes to 'head'" "$SVN commit"
 run "show svn stat for 'head'" "$SVN stat"
 
 exit 0
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297894 - in head: contrib/libxo contrib/libxo/doc contrib/libxo/libxo contrib/libxo/m4 lib/libxo

2016-04-12 Thread Phil Shafer
Author: phil
Date: Tue Apr 12 23:30:56 2016
New Revision: 297894
URL: https://svnweb.freebsd.org/changeset/base/297894

Log:
  Merge libxo 0.4.6
  
  Reviewed by: sjg
  Approved by: sjg (mentor)

Added:
  head/contrib/libxo/.gitignore
 - copied unchanged from r297891, vendor/Juniper/libxo/dist/.gitignore
  head/contrib/libxo/.svnignore
 - copied unchanged from r297891, vendor/Juniper/libxo/dist/.svnignore
  head/contrib/libxo/doc/libxo-manual.html
 - copied unchanged from r297891, 
vendor/Juniper/libxo/dist/doc/libxo-manual.html
  head/lib/libxo/add.man   (contents, props changed)
Replaced:
  head/contrib/libxo/libxo/xo_config.h.in
 - copied unchanged from r297891, 
vendor/Juniper/libxo/dist/libxo/xo_config.h.in
Deleted:
  head/contrib/libxo/install-sh
  head/contrib/libxo/libxo/add.man
  head/contrib/libxo/m4/libtool.m4
  head/contrib/libxo/m4/ltoptions.m4
  head/contrib/libxo/m4/ltsugar.m4
  head/contrib/libxo/m4/ltversion.m4
  head/contrib/libxo/m4/lt~obsolete.m4
Modified:
  head/contrib/libxo/configure.ac
  head/contrib/libxo/libxo/libxo.c
  head/contrib/libxo/libxo/xo_open_container.3
  head/contrib/libxo/libxo/xo_open_list.3
  head/lib/libxo/xo_config.h
Directory Properties:
  head/contrib/libxo/   (props changed)
  head/contrib/libxo/doc/   (props changed)
  head/contrib/libxo/encoder/   (props changed)
  head/contrib/libxo/encoder/cbor/   (props changed)
  head/contrib/libxo/encoder/test/   (props changed)
  head/contrib/libxo/libxo/   (props changed)
  head/contrib/libxo/tests/   (props changed)
  head/contrib/libxo/tests/core/   (props changed)
  head/contrib/libxo/tests/gettext/   (props changed)
  head/contrib/libxo/tests/xo/   (props changed)
  head/contrib/libxo/xo/   (props changed)
  head/contrib/libxo/xohtml/   (props changed)
  head/contrib/libxo/xolint/   (props changed)
  head/contrib/libxo/xopo/   (props changed)

Copied: head/contrib/libxo/.gitignore (from r297891, 
vendor/Juniper/libxo/dist/.gitignore)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/contrib/libxo/.gitignore   Tue Apr 12 23:30:56 2016
(r297894, copy of r297891, vendor/Juniper/libxo/dist/.gitignore)
@@ -0,0 +1,46 @@
+# Object files
+*.o
+
+# Libraries
+*.lib
+*.a
+
+# Shared objects (inc. Windows DLLs)
+*.dll
+*.so
+*.so.*
+*.dylib
+
+# Executables
+*.exe
+*.app
+
+*~
+*.orig
+
+aclocal.m4
+ar-lib
+autom4te.cache
+build
+compile
+config.guess
+config.h.in
+config.sub
+depcomp
+install-sh
+ltmain.sh
+missing
+m4
+
+Makefile.in
+configure
+.DS_Store
+
+xoconfig.h.in
+xo_config.h.in
+
+.gdbinit
+.gdbinit.local
+xtest
+xtest.dSYM
+tests/w

Copied: head/contrib/libxo/.svnignore (from r297891, 
vendor/Juniper/libxo/dist/.svnignore)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/contrib/libxo/.svnignore   Tue Apr 12 23:30:56 2016
(r297894, copy of r297891, vendor/Juniper/libxo/dist/.svnignore)
@@ -0,0 +1,18 @@
+Makefile.in
+aclocal.m4
+ar-lib
+autom4te.cache
+bin*
+build*
+compile
+configure
+config.guess
+config.sub
+depcomp
+doc/Makefile.in
+info*
+install-sh
+ltmain.sh
+m4
+missing
+patches*

Modified: head/contrib/libxo/configure.ac
==
--- head/contrib/libxo/configure.ac Tue Apr 12 23:22:32 2016
(r297893)
+++ head/contrib/libxo/configure.ac Tue Apr 12 23:30:56 2016
(r297894)
@@ -12,7 +12,7 @@
 #
 
 AC_PREREQ(2.2)
-AC_INIT([libxo], [0.4.5], [p...@juniper.net])
+AC_INIT([libxo], [0.4.6], [p...@juniper.net])
 AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability])
 
 # Support silent build rules.  Requires at least automake-1.11.

Copied: head/contrib/libxo/doc/libxo-manual.html (from r297891, 
vendor/Juniper/libxo/dist/doc/libxo-manual.html)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/contrib/libxo/doc/libxo-manual.htmlTue Apr 12 23:30:56 2016
(r297894, copy of r297891, vendor/Juniper/libxo/dist/doc/libxo-manual.html)
@@ -0,0 +1,27134 @@
+
+
+http://www.w3.org/2006/03/hcard;>
+
+libxo: The Easy Way to Generate text, XML, JSON, and HTML output
+/*
+ * $Id$
+ *
+ * Copyright (c) 2006-2011, Juniper Networks, Inc.
+ * All rights reserved.
+ * This SOFTWARE is licensed under the LICENSE provided in the
+ * ../Copyright file. By downloading, installing, copying, or otherwise
+ * using the SOFTWARE, you agree to be bound by the terms of that
+ * LICENSE.
+ */
+
+#media-inspector {
+display:none
+}
+@media screen {
+#media-inspector { z-index: 1 }
+}
+@media print {
+#media-inspector { z-index: 2 }
+}
+
+pre {
+font-family: Consolas, Menlo, Monaco,Lucida Console, Liberation Mono,
+ DejaVu Sans Mono, Bitstream Vera Sans 

Re: svn commit: r297889 - in vendor/Juniper/libxo/dist: . libxo

2016-04-12 Thread Bryan Drewery
On 4/12/2016 4:03 PM, Phil Shafer wrote:
> Author: phil
> Date: Tue Apr 12 23:03:01 2016
> New Revision: 297889
> URL: https://svnweb.freebsd.org/changeset/base/297889
> 
> Log:
>   import libso 0.4.6
> 
> Added:
>   vendor/Juniper/libxo/dist/libxo/xo_config.h.in   (contents, props changed)
> Modified:
>   vendor/Juniper/libxo/dist/.svnignore
> Directory Properties:
>   vendor/Juniper/libxo/dist/   (props changed)

Are files missing from this? It seems quite small for a release and the
.svnignore makes me think there's a missing m4 directory.

> 
> Modified: vendor/Juniper/libxo/dist/.svnignore
> ==
> --- vendor/Juniper/libxo/dist/.svnignore  Tue Apr 12 22:59:20 2016
> (r297888)
> +++ vendor/Juniper/libxo/dist/.svnignore  Tue Apr 12 23:03:01 2016
> (r297889)
> @@ -13,6 +13,6 @@ doc/Makefile.in
>  info*
>  install-sh
>  ltmain.sh
> -m4*
> +m4
>  missing
>  patches*
> 
> Added: vendor/Juniper/libxo/dist/libxo/xo_config.h.in
> ==
> --- /dev/null 00:00:00 1970   (empty, because file is newly added)
> +++ vendor/Juniper/libxo/dist/libxo/xo_config.h.inTue Apr 12 23:03:01 
> 2016(r297889)
> @@ -0,0 +1,246 @@
> +/* libxo/xo_config.h.in.  Generated from configure.ac by autoheader.  */
> +
> +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
> +   systems. This function is required for `alloca.c' support on those 
> systems.
> +   */
> +#undef CRAY_STACKSEG_END
> +
> +/* Define to 1 if using `alloca.c'. */
> +#undef C_ALLOCA
> +
> +/* Define to 1 if you have `alloca', as a function or macro. */
> +#undef HAVE_ALLOCA
> +
> +/* Define to 1 if you have  and it should be used (not on Ultrix).
> +   */
> +#undef HAVE_ALLOCA_H
> +
> +/* Define to 1 if you have the `asprintf' function. */
> +#undef HAVE_ASPRINTF
> +
> +/* Define to 1 if you have the `bzero' function. */
> +#undef HAVE_BZERO
> +
> +/* Define to 1 if you have the `ctime' function. */
> +#undef HAVE_CTIME
> +
> +/* Define to 1 if you have the  header file. */
> +#undef HAVE_CTYPE_H
> +
> +/* Define to 1 if you have the declaration of `__isthreaded', and to 0 if you
> +   don't. */
> +#undef HAVE_DECL___ISTHREADED
> +
> +/* Define to 1 if you have the  header file. */
> +#undef HAVE_DLFCN_H
> +
> +/* Define to 1 if you have the `dlfunc' function. */
> +#undef HAVE_DLFUNC
> +
> +/* Define to 1 if you have the  header file. */
> +#undef HAVE_ERRNO_H
> +
> +/* Define to 1 if you have the `fdopen' function. */
> +#undef HAVE_FDOPEN
> +
> +/* Define to 1 if you have the `flock' function. */
> +#undef HAVE_FLOCK
> +
> +/* Define to 1 if you have the `getpass' function. */
> +#undef HAVE_GETPASS
> +
> +/* Define to 1 if you have the `getprogname' function. */
> +#undef HAVE_GETPROGNAME
> +
> +/* Define to 1 if you have the `getrusage' function. */
> +#undef HAVE_GETRUSAGE
> +
> +/* gettext(3) */
> +#undef HAVE_GETTEXT
> +
> +/* Define to 1 if you have the `gettimeofday' function. */
> +#undef HAVE_GETTIMEOFDAY
> +
> +/* humanize_number(3) */
> +#undef HAVE_HUMANIZE_NUMBER
> +
> +/* Define to 1 if you have the  header file. */
> +#undef HAVE_INTTYPES_H
> +
> +/* Define to 1 if you have the `crypto' library (-lcrypto). */
> +#undef HAVE_LIBCRYPTO
> +
> +/* Define to 1 if you have the `m' library (-lm). */
> +#undef HAVE_LIBM
> +
> +/* Define to 1 if you have the  header file. */
> +#undef HAVE_LIBUTIL_H
> +
> +/* Define to 1 if your system has a GNU libc compatible `malloc' function, 
> and
> +   to 0 otherwise. */
> +#undef HAVE_MALLOC
> +
> +/* Define to 1 if you have the `memmove' function. */
> +#undef HAVE_MEMMOVE
> +
> +/* Define to 1 if you have the  header file. */
> +#undef HAVE_MEMORY_H
> +
> +/* Support printflike */
> +#undef HAVE_PRINTFLIKE
> +
> +/* Define to 1 if your system has a GNU libc compatible `realloc' function,
> +   and to 0 otherwise. */
> +#undef HAVE_REALLOC
> +
> +/* Define to 1 if you have the `srand' function. */
> +#undef HAVE_SRAND
> +
> +/* Define to 1 if you have the `sranddev' function. */
> +#undef HAVE_SRANDDEV
> +
> +/* Define to 1 if you have the  header file. */
> +#undef HAVE_STDINT_H
> +
> +/* Define to 1 if you have the  header file. */
> +#undef HAVE_STDIO_EXT_H
> +
> +/* Define to 1 if you have the  header file. */
> +#undef HAVE_STDIO_H
> +
> +/* Define to 1 if you have the  header file. */
> +#undef HAVE_STDLIB_H
> +
> +/* Define to 1 if you have the  header file. */
> +#undef HAVE_STDTIME_TZFILE_H
> +
> +/* Define to 1 if you have the `strchr' function. */
> +#undef HAVE_STRCHR
> +
> +/* Define to 1 if you have the `strcspn' function. */
> +#undef HAVE_STRCSPN
> +
> +/* Define to 1 if you have the `strerror' function. */
> +#undef HAVE_STRERROR
> +
> +/* Define to 1 if you have the  header file. */
> +#undef HAVE_STRINGS_H
> +
> +/* Define to 1 if you have the  header file. */
> +#undef HAVE_STRING_H
> +
> +/* 

svn commit: r297893 - vendor/Juniper/libxo

2016-04-12 Thread Phil Shafer
Author: phil
Date: Tue Apr 12 23:22:32 2016
New Revision: 297893
URL: https://svnweb.freebsd.org/changeset/base/297893

Log:
  add "svn up" after tagging

Modified:
  vendor/Juniper/libxo/import.sh

Modified: vendor/Juniper/libxo/import.sh
==
--- vendor/Juniper/libxo/import.sh  Tue Apr 12 23:20:50 2016
(r297892)
+++ vendor/Juniper/libxo/import.sh  Tue Apr 12 23:22:32 2016
(r297893)
@@ -294,6 +294,7 @@ run "show svn diff for 'dist'" "$SVN dif
 
 
 run "tagging repo" "$SVN cp -m 'Tag $PROJECT $VERSION' $url/dist $url/$VERSION"
+run "refresh libxo" "$SVN update"
 
 Cd $HEAD/contrib/$PROJECT
 CONTRIB=`pwd`
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297892 - vendor/Juniper/libxo

2016-04-12 Thread Phil Shafer
Author: phil
Date: Tue Apr 12 23:20:50 2016
New Revision: 297892
URL: https://svnweb.freebsd.org/changeset/base/297892

Log:
  import libxo 0.4.6

Added:
  vendor/Juniper/libxo/.svnignore
Replaced:
  vendor/Juniper/libxo/import.sh
 - copied, changed from r296971, vendor/NetBSD/bmake/import.sh
Modified:
Directory Properties:
  vendor/Juniper/libxo/   (props changed)

Added: vendor/Juniper/libxo/.svnignore
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ vendor/Juniper/libxo/.svnignore Tue Apr 12 23:20:50 2016
(r297892)
@@ -0,0 +1,2 @@
+libxo-0.4.6
+tag.sh

Copied and modified: vendor/Juniper/libxo/import.sh (from r296971, 
vendor/NetBSD/bmake/import.sh)
==
--- vendor/NetBSD/bmake/import.sh   Thu Mar 17 00:46:36 2016
(r296971, copy source)
+++ vendor/Juniper/libxo/import.sh  Tue Apr 12 23:20:50 2016
(r297892)
@@ -1,11 +1,28 @@
-:
+#!/bin/sh
 # $FreeBSD$
+#
+# Import script for libxo.  Typically invoked as:
+#
+#cd work/bsd/base
+#sh ./vendor/Juniper/libxo/import.sh -v 0.4.6
+#
+# Add "-n" to avoid svn actions
+# Add "-d" to generate docs
+#
+# Phil Shafer (phil@), April 2016
+#
+
+PROJECT=libxo
+MAKEOBJDIRPREFIX=/tank/home/phil/work/bsd/base/head/obj/
+export MAKEOBJDIRPREFIX
 
-# "global" vars
-ECHO=
+#"global" vars
 # Set SVN variables
 #  select the local subversion site
 SVN=${SVN:-/usr/local/bin/svn}
+# "Real" SVN, even if "-n"
+RSVN=$SVN
+GMAKE=${GMAKE:-gmake}
 
 # For consistency...
 Error() {
@@ -16,6 +33,46 @@ Error() {
 Cd() {
[ $# -eq 1 ] || Error "Cd() takes a single parameter."
cd $1 || Error "cannot \"cd $1\" from $PWD"
+info "Directory =" `pwd`
+}
+
+run() {
+desc="$1"
+cmd="$2"
+
+if [ "$DOC" = doc ]; then
+echo " == $desc"
+echo " - $cmd"
+echo " "
+else
+echo ""
+echo "Phase: $desc"
+echo "  Run: $cmd"
+okay
+# We need to eval to handle "&&" in commands
+eval $cmd
+okay
+fi
+}
+
+info() {
+echo " -- " "$@"
+}
+
+okay() {
+if [ -z "$OKAY" ]; then
+/bin/echo -n "proceed? "
+read okay
+case "$okay" in
+[QqNn]*) echo "exiting"; exit 1;;
+esac
+fi
+}
+
+spew_words () {
+for i in "$@"; do
+echo $i
+done
 }
 
 # Call this function and then follow it by any specific import script additions
@@ -28,19 +85,25 @@ option_parsing() {
*=*) eval "$1"; shift;;
--) shift; break;;
-a) TARBALL=$2; shift 2;;
-   -n) ECHO=echo; shift;;
+-d) DOC=doc; shift;;
+-D) VENDOR_DIR=$2; shift 2;;
+-f) FETCH=yes; shift;;
+   -n) SVN='echo svn'; shift;;
+-p) PROJECT=$2; shift 2;;
-P) PR=$2; shift 2;;
-r) REVIEWER=$2; shift 2;;
-   -u) url=$2; shift 2;;
+-v) VERS=$2; shift 2;;
+-y) OKAY=yes; shift;;
+
-h) echo "Usage:";
  echo "  "$0 '[-ahnPr] [TARBALL=] [PR=] [REVIEWER=]'
-   echo "  "$0 '-a # (a)rchive'
-   echo "  "$0 '-h   # print usage'
-   echo "  "$0 '-n   # do not import, 
check only.'
-   echo "  "$0 '-P# Use PR'
-   echo "  "$0 '-r   # (r)eviewed by'
-   echo "  "$0 'PR='
-   echo "  "$0 'REVIEWER='
+   echo "  -a   -- name or tarball"
+   echo "  -d -- generate documentation"
+   echo "  -f -- force fetch of tarballs"
+   echo "  -h -- print usage"
+   echo "  -n -- do not import, check only"
+   echo "  -v-- version to import"
+   echo "  -y -- answer 'yes'"
exit 1;;
*) break;;
esac
@@ -53,34 +116,199 @@ option_parsing() {
 option_parsing "$@"
 shift $?
 
-TF=/tmp/.$USER.$$
 Cd `dirname $0`
-test -s ${TARBALL:-/dev/null} || Error need TARBALL
-here=`pwd`
-# thing should match what the TARBALL contains
-thing=`basename $here`
-
-rm -rf $thing
-tar zxf $TARBALL
-
-# steps unique to bmake
-VERSION=`grep '^MAKE_VERSION' bmake/Makefile | sed 's,.*=[[:space:]]*,,'`
-rm -rf bmake/missing
+CWD=`pwd`
+
+if [ -z "$VENDOR_DIR" ]; then
+VENDOR_DIR=`echo $CWD | sed 's:.*/vendor/::'`
+fi
+
+#--
+
+info "CWD = $CWD"
+info "VENDOR_DIR = $VENDOR_DIR"
+info "VERS = $VERS"
+
+[ -z "$VERS" ] && Error "missing version 

svn commit: r297889 - in vendor/Juniper/libxo/dist: . libxo

2016-04-12 Thread Phil Shafer
Author: phil
Date: Tue Apr 12 23:03:01 2016
New Revision: 297889
URL: https://svnweb.freebsd.org/changeset/base/297889

Log:
  import libso 0.4.6

Added:
  vendor/Juniper/libxo/dist/libxo/xo_config.h.in   (contents, props changed)
Modified:
  vendor/Juniper/libxo/dist/.svnignore
Directory Properties:
  vendor/Juniper/libxo/dist/   (props changed)

Modified: vendor/Juniper/libxo/dist/.svnignore
==
--- vendor/Juniper/libxo/dist/.svnignoreTue Apr 12 22:59:20 2016
(r297888)
+++ vendor/Juniper/libxo/dist/.svnignoreTue Apr 12 23:03:01 2016
(r297889)
@@ -13,6 +13,6 @@ doc/Makefile.in
 info*
 install-sh
 ltmain.sh
-m4*
+m4
 missing
 patches*

Added: vendor/Juniper/libxo/dist/libxo/xo_config.h.in
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ vendor/Juniper/libxo/dist/libxo/xo_config.h.in  Tue Apr 12 23:03:01 
2016(r297889)
@@ -0,0 +1,246 @@
+/* libxo/xo_config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
+   systems. This function is required for `alloca.c' support on those systems.
+   */
+#undef CRAY_STACKSEG_END
+
+/* Define to 1 if using `alloca.c'. */
+#undef C_ALLOCA
+
+/* Define to 1 if you have `alloca', as a function or macro. */
+#undef HAVE_ALLOCA
+
+/* Define to 1 if you have  and it should be used (not on Ultrix).
+   */
+#undef HAVE_ALLOCA_H
+
+/* Define to 1 if you have the `asprintf' function. */
+#undef HAVE_ASPRINTF
+
+/* Define to 1 if you have the `bzero' function. */
+#undef HAVE_BZERO
+
+/* Define to 1 if you have the `ctime' function. */
+#undef HAVE_CTIME
+
+/* Define to 1 if you have the  header file. */
+#undef HAVE_CTYPE_H
+
+/* Define to 1 if you have the declaration of `__isthreaded', and to 0 if you
+   don't. */
+#undef HAVE_DECL___ISTHREADED
+
+/* Define to 1 if you have the  header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the `dlfunc' function. */
+#undef HAVE_DLFUNC
+
+/* Define to 1 if you have the  header file. */
+#undef HAVE_ERRNO_H
+
+/* Define to 1 if you have the `fdopen' function. */
+#undef HAVE_FDOPEN
+
+/* Define to 1 if you have the `flock' function. */
+#undef HAVE_FLOCK
+
+/* Define to 1 if you have the `getpass' function. */
+#undef HAVE_GETPASS
+
+/* Define to 1 if you have the `getprogname' function. */
+#undef HAVE_GETPROGNAME
+
+/* Define to 1 if you have the `getrusage' function. */
+#undef HAVE_GETRUSAGE
+
+/* gettext(3) */
+#undef HAVE_GETTEXT
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#undef HAVE_GETTIMEOFDAY
+
+/* humanize_number(3) */
+#undef HAVE_HUMANIZE_NUMBER
+
+/* Define to 1 if you have the  header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `crypto' library (-lcrypto). */
+#undef HAVE_LIBCRYPTO
+
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
+/* Define to 1 if you have the  header file. */
+#undef HAVE_LIBUTIL_H
+
+/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
+   to 0 otherwise. */
+#undef HAVE_MALLOC
+
+/* Define to 1 if you have the `memmove' function. */
+#undef HAVE_MEMMOVE
+
+/* Define to 1 if you have the  header file. */
+#undef HAVE_MEMORY_H
+
+/* Support printflike */
+#undef HAVE_PRINTFLIKE
+
+/* Define to 1 if your system has a GNU libc compatible `realloc' function,
+   and to 0 otherwise. */
+#undef HAVE_REALLOC
+
+/* Define to 1 if you have the `srand' function. */
+#undef HAVE_SRAND
+
+/* Define to 1 if you have the `sranddev' function. */
+#undef HAVE_SRANDDEV
+
+/* Define to 1 if you have the  header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the  header file. */
+#undef HAVE_STDIO_EXT_H
+
+/* Define to 1 if you have the  header file. */
+#undef HAVE_STDIO_H
+
+/* Define to 1 if you have the  header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the  header file. */
+#undef HAVE_STDTIME_TZFILE_H
+
+/* Define to 1 if you have the `strchr' function. */
+#undef HAVE_STRCHR
+
+/* Define to 1 if you have the `strcspn' function. */
+#undef HAVE_STRCSPN
+
+/* Define to 1 if you have the `strerror' function. */
+#undef HAVE_STRERROR
+
+/* Define to 1 if you have the  header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the  header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strlcpy' function. */
+#undef HAVE_STRLCPY
+
+/* Define to 1 if you have the `strspn' function. */
+#undef HAVE_STRSPN
+
+/* Have struct sockaddr_un.sun_len */
+#undef HAVE_SUN_LEN
+
+/* Define to 1 if you have the `sysctlbyname' function. */
+#undef HAVE_SYSCTLBYNAME
+
+/* Define to 1 if you have the  header file. */
+#undef HAVE_SYS_PARAM_H
+
+/* Define to 1 if you have the  header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the  header file. */
+#undef 

svn commit: r297890 - vendor/Juniper/libxo/0.4.6

2016-04-12 Thread Phil Shafer
Author: phil
Date: Tue Apr 12 23:03:37 2016
New Revision: 297890
URL: https://svnweb.freebsd.org/changeset/base/297890

Log:
  Tag libxo 0.4.6

Added:
 - copied from r297889, vendor/Juniper/libxo/dist/
Directory Properties:
  vendor/Juniper/libxo/0.4.6/   (props changed)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297888 - head/lib/libc/gen

2016-04-12 Thread Ed Maste
Author: emaste
Date: Tue Apr 12 22:59:20 2016
New Revision: 297888
URL: https://svnweb.freebsd.org/changeset/base/297888

Log:
  Remove PS_STRINGS fallback from setproctitle
  
  In r103767 the kern.ps_strings sysctl was added as the preferred way to
  locate the ps_strings struct and is available in any FreeBSD release
  supported within the last decade.
  
  Reviewed by:  kib

Modified:
  head/lib/libc/gen/setproctitle.c

Modified: head/lib/libc/gen/setproctitle.c
==
--- head/lib/libc/gen/setproctitle.cTue Apr 12 22:58:40 2016
(r297887)
+++ head/lib/libc/gen/setproctitle.cTue Apr 12 22:59:20 2016
(r297888)
@@ -134,7 +134,7 @@ setproctitle(const char *fmt, ...)
len = sizeof(ul_ps_strings);
if (sysctlbyname("kern.ps_strings", _ps_strings, , NULL,
0) == -1)
-   ul_ps_strings = PS_STRINGS;
+   return;
ps_strings = (struct ps_strings *)ul_ps_strings;
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297886 - head/sbin/fsck_ffs

2016-04-12 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Apr 12 22:55:47 2016
New Revision: 297886
URL: https://svnweb.freebsd.org/changeset/base/297886

Log:
  fsck_ffs for pointers replace 0 with NULL.
  
  Found with devel/coccinelle.
  
  Reviewed by:  mckusick

Modified:
  head/sbin/fsck_ffs/dir.c
  head/sbin/fsck_ffs/fsutil.c
  head/sbin/fsck_ffs/inode.c
  head/sbin/fsck_ffs/main.c
  head/sbin/fsck_ffs/pass1.c
  head/sbin/fsck_ffs/pass1b.c
  head/sbin/fsck_ffs/pass4.c
  head/sbin/fsck_ffs/pass5.c
  head/sbin/fsck_ffs/utilities.c

Modified: head/sbin/fsck_ffs/dir.c
==
--- head/sbin/fsck_ffs/dir.cTue Apr 12 22:54:19 2016(r297885)
+++ head/sbin/fsck_ffs/dir.cTue Apr 12 22:55:47 2016(r297886)
@@ -702,7 +702,7 @@ static struct bufarea *
 getdirblk(ufs2_daddr_t blkno, long size)
 {
 
-   if (pdirbp != 0)
+   if (pdirbp != NULL)
pdirbp->b_flags &= ~B_INUSE;
pdirbp = getdatablk(blkno, size, BT_DIRDATA);
return (pdirbp);

Modified: head/sbin/fsck_ffs/fsutil.c
==
--- head/sbin/fsck_ffs/fsutil.c Tue Apr 12 22:54:19 2016(r297885)
+++ head/sbin/fsck_ffs/fsutil.c Tue Apr 12 22:55:47 2016(r297886)
@@ -184,7 +184,7 @@ bufinit(void)
 
pbp = pdirbp = (struct bufarea *)0;
bufp = Malloc((unsigned int)sblock.fs_bsize);
-   if (bufp == 0)
+   if (bufp == NULL)
errx(EEXIT, "cannot allocate buffer pool");
cgblk.b_un.b_buf = bufp;
initbarea(, BT_CYLGRP);

Modified: head/sbin/fsck_ffs/inode.c
==
--- head/sbin/fsck_ffs/inode.c  Tue Apr 12 22:54:19 2016(r297885)
+++ head/sbin/fsck_ffs/inode.c  Tue Apr 12 22:55:47 2016(r297886)
@@ -290,7 +290,7 @@ ginode(ino_t inumber)
if (startinum == 0 ||
inumber < startinum || inumber >= startinum + INOPB()) {
iblk = ino_to_fsba(, inumber);
-   if (pbp != 0)
+   if (pbp != NULL)
pbp->b_flags &= ~B_INUSE;
pbp = getdatablk(iblk, sblock.fs_bsize, BT_INODES);
startinum = (inumber / INOPB()) * INOPB();
@@ -608,7 +608,7 @@ pinode(ino_t ino)
return;
dp = ginode(ino);
printf(" OWNER=");
-   if ((pw = getpwuid((int)DIP(dp, di_uid))) != 0)
+   if ((pw = getpwuid((int)DIP(dp, di_uid))) != NULL)
printf("%s ", pw->pw_name);
else
printf("%u ", (unsigned)DIP(dp, di_uid));

Modified: head/sbin/fsck_ffs/main.c
==
--- head/sbin/fsck_ffs/main.c   Tue Apr 12 22:54:19 2016(r297885)
+++ head/sbin/fsck_ffs/main.c   Tue Apr 12 22:55:47 2016(r297886)
@@ -349,10 +349,10 @@ checkfilesys(char *filesys)
pfatal(
"CANNOT FIND SNAPSHOT DIRECTORY %s: %s, CANNOT RUN IN BACKGROUND\n",
snapname, strerror(errno));
-   } else if ((grp = getgrnam("operator")) == 0 ||
-   mkdir(snapname, 0770) < 0 ||
-   chown(snapname, -1, grp->gr_gid) < 0 ||
-   chmod(snapname, 0770) < 0) {
+   } else if ((grp = getgrnam("operator")) == NULL 
||
+  mkdir(snapname, 0770) < 0 ||
+  chown(snapname, -1, grp->gr_gid) < 0 
||
+  chmod(snapname, 0770) < 0) {
bkgrdflag = 0;
pfatal(
"CANNOT CREATE SNAPSHOT DIRECTORY %s: %s, CANNOT RUN IN BACKGROUND\n",

Modified: head/sbin/fsck_ffs/pass1.c
==
--- head/sbin/fsck_ffs/pass1.c  Tue Apr 12 22:54:19 2016(r297885)
+++ head/sbin/fsck_ffs/pass1.c  Tue Apr 12 22:55:47 2016(r297886)
@@ -151,7 +151,7 @@ pass1(void)
 */
inostathead[c].il_numalloced = inosused;
if (inosused == 0) {
-   inostathead[c].il_stat = 0;
+   inostathead[c].il_stat = NULL;
continue;
}
info = Calloc((unsigned)inosused, sizeof(struct inostat));
@@ -221,7 +221,7 @@ pass1(void)
inostathead[c].il_numalloced = inosused;
if (inosused == 0) {
free(inostathead[c].il_stat);
-   inostathead[c].il_stat = 0;
+   inostathead[c].il_stat = NULL;
continue;
}
info = Calloc((unsigned)inosused, sizeof(struct inostat));

svn commit: r297885 - in vendor/Juniper/libxo/dist: . doc libxo m4

2016-04-12 Thread Phil Shafer
Author: phil
Date: Tue Apr 12 22:54:19 2016
New Revision: 297885
URL: https://svnweb.freebsd.org/changeset/base/297885

Log:
  Import libxo 0.4.6

Added:
  vendor/Juniper/libxo/dist/.gitignore
  vendor/Juniper/libxo/dist/.svnignore
  vendor/Juniper/libxo/dist/doc/libxo-manual.html   (contents, props changed)
Deleted:
  vendor/Juniper/libxo/dist/install-sh
  vendor/Juniper/libxo/dist/libxo/add.man
  vendor/Juniper/libxo/dist/libxo/xo_config.h.in
  vendor/Juniper/libxo/dist/m4/libtool.m4
  vendor/Juniper/libxo/dist/m4/ltoptions.m4
  vendor/Juniper/libxo/dist/m4/ltsugar.m4
  vendor/Juniper/libxo/dist/m4/ltversion.m4
  vendor/Juniper/libxo/dist/m4/lt~obsolete.m4
Modified:
  vendor/Juniper/libxo/dist/configure.ac
  vendor/Juniper/libxo/dist/libxo/libxo.c
  vendor/Juniper/libxo/dist/libxo/xo_open_container.3
  vendor/Juniper/libxo/dist/libxo/xo_open_list.3
Directory Properties:
  vendor/Juniper/libxo/dist/   (props changed)
  vendor/Juniper/libxo/dist/doc/   (props changed)
  vendor/Juniper/libxo/dist/encoder/   (props changed)
  vendor/Juniper/libxo/dist/encoder/cbor/   (props changed)
  vendor/Juniper/libxo/dist/encoder/test/   (props changed)
  vendor/Juniper/libxo/dist/libxo/   (props changed)
  vendor/Juniper/libxo/dist/tests/   (props changed)
  vendor/Juniper/libxo/dist/tests/core/   (props changed)
  vendor/Juniper/libxo/dist/tests/gettext/   (props changed)
  vendor/Juniper/libxo/dist/tests/xo/   (props changed)
  vendor/Juniper/libxo/dist/xo/   (props changed)
  vendor/Juniper/libxo/dist/xohtml/   (props changed)
  vendor/Juniper/libxo/dist/xolint/   (props changed)
  vendor/Juniper/libxo/dist/xopo/   (props changed)

Added: vendor/Juniper/libxo/dist/.gitignore
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ vendor/Juniper/libxo/dist/.gitignoreTue Apr 12 22:54:19 2016
(r297885)
@@ -0,0 +1,46 @@
+# Object files
+*.o
+
+# Libraries
+*.lib
+*.a
+
+# Shared objects (inc. Windows DLLs)
+*.dll
+*.so
+*.so.*
+*.dylib
+
+# Executables
+*.exe
+*.app
+
+*~
+*.orig
+
+aclocal.m4
+ar-lib
+autom4te.cache
+build
+compile
+config.guess
+config.h.in
+config.sub
+depcomp
+install-sh
+ltmain.sh
+missing
+m4
+
+Makefile.in
+configure
+.DS_Store
+
+xoconfig.h.in
+xo_config.h.in
+
+.gdbinit
+.gdbinit.local
+xtest
+xtest.dSYM
+tests/w

Added: vendor/Juniper/libxo/dist/.svnignore
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ vendor/Juniper/libxo/dist/.svnignoreTue Apr 12 22:54:19 2016
(r297885)
@@ -0,0 +1,18 @@
+Makefile.in
+aclocal.m4
+ar-lib
+autom4te.cache
+bin*
+build*
+compile
+configure
+config.guess
+config.sub
+depcomp
+doc/Makefile.in
+info*
+install-sh
+ltmain.sh
+m4*
+missing
+patches*

Modified: vendor/Juniper/libxo/dist/configure.ac
==
--- vendor/Juniper/libxo/dist/configure.ac  Tue Apr 12 22:31:48 2016
(r297884)
+++ vendor/Juniper/libxo/dist/configure.ac  Tue Apr 12 22:54:19 2016
(r297885)
@@ -12,7 +12,7 @@
 #
 
 AC_PREREQ(2.2)
-AC_INIT([libxo], [0.4.5], [p...@juniper.net])
+AC_INIT([libxo], [0.4.6], [p...@juniper.net])
 AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability])
 
 # Support silent build rules.  Requires at least automake-1.11.

Added: vendor/Juniper/libxo/dist/doc/libxo-manual.html
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ vendor/Juniper/libxo/dist/doc/libxo-manual.html Tue Apr 12 22:54:19 
2016(r297885)
@@ -0,0 +1,27134 @@
+
+
+http://www.w3.org/2006/03/hcard;>
+
+libxo: The Easy Way to Generate text, XML, JSON, and HTML output
+/*
+ * $Id$
+ *
+ * Copyright (c) 2006-2011, Juniper Networks, Inc.
+ * All rights reserved.
+ * This SOFTWARE is licensed under the LICENSE provided in the
+ * ../Copyright file. By downloading, installing, copying, or otherwise
+ * using the SOFTWARE, you agree to be bound by the terms of that
+ * LICENSE.
+ */
+
+#media-inspector {
+display:none
+}
+@media screen {
+#media-inspector { z-index: 1 }
+}
+@media print {
+#media-inspector { z-index: 2 }
+}
+
+pre {
+font-family: Consolas, Menlo, Monaco,Lucida Console, Liberation Mono,
+ DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New,
+ monospace, serif;
+margin-bottom: 10px;
+}
+
+@media screen {
+hr.noprint {
+   display: none;
+}
+
+h1, h2, h3, h4, h5 {
+   font-size: 14pt;
+   color: black;
+   margin: 0;
+   padding: 0;
+}
+h1 a, h2 a, h3 a, h4 a, h5 a {
+   font-size: 12pt;
+   color: black;
+}
+
+div#top {
+   display: table;
+}
+
+div#top-left {
+   display: table-cell;
+   width: 400px;
+   border: 1px solid black;
+  

svn commit: r297884 - head/sys/dev/bxe

2016-04-12 Thread David C Somayajulu
Author: davidcs
Date: Tue Apr 12 22:31:48 2016
New Revision: 297884
URL: https://svnweb.freebsd.org/changeset/base/297884

Log:
  Add support for Flash Update
  
  Submitted 
by:nrapendra.si...@qlogic.com;vaishali.kulka...@qlogic.com;davi...@freebsd.org
  Approved by:davi...@freebsd.org
  MFC after:5 days

Modified:
  head/sys/dev/bxe/bxe.c
  head/sys/dev/bxe/bxe.h
  head/sys/dev/bxe/bxe_ioctl.h

Modified: head/sys/dev/bxe/bxe.c
==
--- head/sys/dev/bxe/bxe.c  Tue Apr 12 22:11:29 2016(r297883)
+++ head/sys/dev/bxe/bxe.c  Tue Apr 12 22:31:48 2016(r297884)
@@ -13653,49 +13653,60 @@ bxe_get_tunable_params(struct bxe_softc 
   sc->udp_rss);
 }
 
-static void
+static int
 bxe_media_detect(struct bxe_softc *sc)
 {
+int port_type;
 uint32_t phy_idx = bxe_get_cur_phy_idx(sc);
+
 switch (sc->link_params.phy[phy_idx].media_type) {
 case ELINK_ETH_PHY_SFPP_10G_FIBER:
 case ELINK_ETH_PHY_XFP_FIBER:
 BLOGI(sc, "Found 10Gb Fiber media.\n");
 sc->media = IFM_10G_SR;
+port_type = PORT_FIBRE;
 break;
 case ELINK_ETH_PHY_SFP_1G_FIBER:
 BLOGI(sc, "Found 1Gb Fiber media.\n");
 sc->media = IFM_1000_SX;
+port_type = PORT_FIBRE;
 break;
 case ELINK_ETH_PHY_KR:
 case ELINK_ETH_PHY_CX4:
 BLOGI(sc, "Found 10GBase-CX4 media.\n");
 sc->media = IFM_10G_CX4;
+port_type = PORT_FIBRE;
 break;
 case ELINK_ETH_PHY_DA_TWINAX:
 BLOGI(sc, "Found 10Gb Twinax media.\n");
 sc->media = IFM_10G_TWINAX;
+port_type = PORT_DA;
 break;
 case ELINK_ETH_PHY_BASE_T:
 if (sc->link_params.speed_cap_mask[0] &
 PORT_HW_CFG_SPEED_CAPABILITY_D0_10G) {
 BLOGI(sc, "Found 10GBase-T media.\n");
 sc->media = IFM_10G_T;
+port_type = PORT_TP;
 } else {
 BLOGI(sc, "Found 1000Base-T media.\n");
 sc->media = IFM_1000_T;
+port_type = PORT_TP;
 }
 break;
 case ELINK_ETH_PHY_NOT_PRESENT:
 BLOGI(sc, "Media not present.\n");
 sc->media = 0;
+port_type = PORT_OTHER;
 break;
 case ELINK_ETH_PHY_UNSPECIFIED:
 default:
 BLOGI(sc, "Unknown media!\n");
 sc->media = 0;
+port_type = PORT_OTHER;
 break;
 }
+return port_type;
 }
 
 #define GET_FIELD(value, fname) \
@@ -18714,6 +18725,14 @@ bxe_add_cdev(struct bxe_softc *sc)
 if (sc->grc_dump == NULL)
 return (-1);
 
+sc->eeprom = malloc(BXE_EEPROM_MAX_DATA_LEN, M_DEVBUF, M_NOWAIT);
+
+if (sc->eeprom == NULL) {
+BLOGW(sc, "Unable to alloc for eeprom size buffer\n");
+free(sc->grc_dump, M_DEVBUF); sc->grc_dump = NULL;
+return (-1);
+}
+
 sc->ioctl_dev = make_dev(_cdevsw,
 sc->ifp->if_dunit,
 UID_ROOT,
@@ -18725,6 +18744,8 @@ bxe_add_cdev(struct bxe_softc *sc)
 if (sc->ioctl_dev == NULL) {
 
 free(sc->grc_dump, M_DEVBUF);
+free(sc->eeprom, M_DEVBUF);
+sc->eeprom = NULL;
 
 return (-1);
 }
@@ -18740,12 +18761,152 @@ bxe_del_cdev(struct bxe_softc *sc)
 if (sc->ioctl_dev != NULL)
 destroy_dev(sc->ioctl_dev);
 
-if (sc->grc_dump == NULL)
+if (sc->grc_dump != NULL)
 free(sc->grc_dump, M_DEVBUF);
 
+if (sc->eeprom != NULL) {
+free(sc->eeprom, M_DEVBUF);
+sc->eeprom = NULL;
+}
+
 return;
 }
 
+static bool bxe_is_nvram_accessible(struct bxe_softc *sc)
+{
+
+if ((if_getdrvflags(sc->ifp) & IFF_DRV_RUNNING) == 0)
+return FALSE;
+
+return TRUE;
+}
+
+
+static int
+bxe_wr_eeprom(struct bxe_softc *sc, void *data, uint32_t offset, uint32_t len)
+{
+int rval = 0;
+
+if(!bxe_is_nvram_accessible(sc)) {
+BLOGW(sc, "Cannot access eeprom when interface is down\n");
+return (-EAGAIN);
+}
+rval = bxe_nvram_write(sc, offset, (uint8_t *)data, len);
+
+
+   return (rval);
+}
+
+static int
+bxe_rd_eeprom(struct bxe_softc *sc, void *data, uint32_t offset, uint32_t len)
+{
+int rval = 0;
+
+if(!bxe_is_nvram_accessible(sc)) {
+BLOGW(sc, "Cannot access eeprom when interface is down\n");
+return (-EAGAIN);
+}
+rval = bxe_nvram_read(sc, offset, (uint8_t *)data, len);
+
+   return (rval);
+}
+
+static int
+bxe_eeprom_rd_wr(struct bxe_softc *sc, bxe_eeprom_t *eeprom)
+{
+int rval = 0;
+
+switch (eeprom->eeprom_cmd) {
+
+case BXE_EEPROM_CMD_SET_EEPROM:
+
+rval = copyin(eeprom->eeprom_data, sc->eeprom,
+   eeprom->eeprom_data_len);
+
+if (rval)
+break;
+
+rval = bxe_wr_eeprom(sc, sc->eeprom, eeprom->eeprom_offset,
+   eeprom->eeprom_data_len);
+break;
+
+case BXE_EEPROM_CMD_GET_EEPROM:
+
+rval = 

svn commit: r297883 - head/sys/dev/cxgbe

2016-04-12 Thread Navdeep Parhar
Author: np
Date: Tue Apr 12 22:11:29 2016
New Revision: 297883
URL: https://svnweb.freebsd.org/changeset/base/297883

Log:
  cxgbe(4): Always dispatch all work requests that have been written to the
  descriptor ring before leaving drain_wrq_wr_list.

Modified:
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/sys/dev/cxgbe/t4_sge.c
==
--- head/sys/dev/cxgbe/t4_sge.c Tue Apr 12 22:07:33 2016(r297882)
+++ head/sys/dev/cxgbe/t4_sge.c Tue Apr 12 22:11:29 2016(r297883)
@@ -1726,7 +1726,8 @@ drain_wrq_wr_list(struct adapter *sc, st
MPASS(TAILQ_EMPTY(>incomplete_wrs));
wr = STAILQ_FIRST(>wr_list);
MPASS(wr != NULL);  /* Must be called with something useful to do */
-   dbdiff = IDXDIFF(eq->pidx, eq->dbidx, eq->sidx);
+   MPASS(eq->pidx == eq->dbidx);
+   dbdiff = 0;
 
do {
eq->cidx = read_hw_cidx(eq);
@@ -1738,7 +1739,7 @@ drain_wrq_wr_list(struct adapter *sc, st
MPASS(wr->wrq == wrq);
n = howmany(wr->wr_len, EQ_ESIZE);
if (available < n)
-   return;
+   break;
 
dst = (void *)>desc[eq->pidx];
if (__predict_true(eq->sidx - eq->pidx > n)) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297880 - head/sys/netinet

2016-04-12 Thread Michael Tuexen
Author: tuexen
Date: Tue Apr 12 21:40:54 2016
New Revision: 297880
URL: https://svnweb.freebsd.org/changeset/base/297880

Log:
  Refactor the handling of ICMP/IPv4 packets for SCTP/IPv4.
  
  This cleansup the code and prepares upcoming handling of ICMP/IPv4 packets
  for SCTP/UDP/IPv4 packets. IPv6 changes will follow...
  
  MFC after:3 days

Modified:
  head/sys/netinet/sctp_usrreq.c

Modified: head/sys/netinet/sctp_usrreq.c
==
--- head/sys/netinet/sctp_usrreq.c  Tue Apr 12 21:34:04 2016
(r297879)
+++ head/sys/netinet/sctp_usrreq.c  Tue Apr 12 21:40:54 2016
(r297880)
@@ -144,102 +144,33 @@ sctp_pathmtu_adjustment(struct sctp_tcb 
 
 #ifdef INET
 static void
-sctp_notify_mbuf(struct sctp_inpcb *inp,
-struct sctp_tcb *stcb,
-struct sctp_nets *net,
-struct ip *ip)
-{
-   struct icmp *icmph;
-   int totsz, tmr_stopped = 0;
-   uint16_t nxtsz;
-
-   /* protection */
-   if ((inp == NULL) || (stcb == NULL) || (net == NULL) || (ip == NULL)) {
-   if (stcb != NULL) {
-   SCTP_TCB_UNLOCK(stcb);
-   }
-   return;
-   }
-   icmph = (struct icmp *)((caddr_t)ip - (sizeof(struct icmp) -
-   sizeof(struct ip)));
-   if (icmph->icmp_type != ICMP_UNREACH) {
-   /* We only care about unreachable */
-   SCTP_TCB_UNLOCK(stcb);
-   return;
-   }
-   if (icmph->icmp_code != ICMP_UNREACH_NEEDFRAG) {
-   /* not a unreachable message due to frag. */
-   SCTP_TCB_UNLOCK(stcb);
-   return;
-   }
-   totsz = ntohs(ip->ip_len);
-
-   nxtsz = ntohs(icmph->icmp_nextmtu);
-   if (nxtsz == 0) {
-   /*
-* old type router that does not tell us what the next size
-* mtu is. Rats we will have to guess (in a educated fashion
-* of course)
-*/
-   nxtsz = sctp_get_prev_mtu(totsz);
-   }
-   /* Stop any PMTU timer */
-   if (SCTP_OS_TIMER_PENDING(>pmtu_timer.timer)) {
-   tmr_stopped = 1;
-   sctp_timer_stop(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net,
-   SCTP_FROM_SCTP_USRREQ + SCTP_LOC_1);
-   }
-   /* Adjust destination size limit */
-   if (net->mtu > nxtsz) {
-   net->mtu = nxtsz;
-   if (net->port) {
-   net->mtu -= sizeof(struct udphdr);
-   }
-   }
-   /* now what about the ep? */
-   if (stcb->asoc.smallest_mtu > nxtsz) {
-   sctp_pathmtu_adjustment(stcb, nxtsz);
-   }
-   if (tmr_stopped)
-   sctp_timer_start(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net);
-
-   SCTP_TCB_UNLOCK(stcb);
-}
-
-static void
 sctp_notify(struct sctp_inpcb *inp,
-struct ip *ip,
-struct sockaddr *to,
 struct sctp_tcb *stcb,
-struct sctp_nets *net)
+struct sctp_nets *net,
+uint8_t icmp_type,
+uint8_t icmp_code,
+uint16_t ip_len,
+uint16_t next_mtu)
 {
 #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
struct socket *so;
 
 #endif
-   struct icmp *icmph;
+   int timer_stopped;
 
-   /* protection */
-   if ((inp == NULL) || (stcb == NULL) || (net == NULL) || (to == NULL)) {
-   if (stcb)
-   SCTP_TCB_UNLOCK(stcb);
-   return;
-   }
-   icmph = (struct icmp *)((caddr_t)ip - (sizeof(struct icmp) -
-   sizeof(struct ip)));
-   if (icmph->icmp_type != ICMP_UNREACH) {
+   if (icmp_type != ICMP_UNREACH) {
/* We only care about unreachable */
SCTP_TCB_UNLOCK(stcb);
return;
}
-   if ((icmph->icmp_code == ICMP_UNREACH_NET) ||
-   (icmph->icmp_code == ICMP_UNREACH_HOST) ||
-   (icmph->icmp_code == ICMP_UNREACH_NET_UNKNOWN) ||
-   (icmph->icmp_code == ICMP_UNREACH_HOST_UNKNOWN) ||
-   (icmph->icmp_code == ICMP_UNREACH_ISOLATED) ||
-   (icmph->icmp_code == ICMP_UNREACH_NET_PROHIB) ||
-   (icmph->icmp_code == ICMP_UNREACH_HOST_PROHIB) ||
-   (icmph->icmp_code == ICMP_UNREACH_FILTER_PROHIB)) {
+   if ((icmp_code == ICMP_UNREACH_NET) ||
+   (icmp_code == ICMP_UNREACH_HOST) ||
+   (icmp_code == ICMP_UNREACH_NET_UNKNOWN) ||
+   (icmp_code == ICMP_UNREACH_HOST_UNKNOWN) ||
+   (icmp_code == ICMP_UNREACH_ISOLATED) ||
+   (icmp_code == ICMP_UNREACH_NET_PROHIB) ||
+   (icmp_code == ICMP_UNREACH_HOST_PROHIB) ||
+   (icmp_code == ICMP_UNREACH_FILTER_PROHIB)) {
 
/*
 * Hmm reachablity problems we must examine closely. If its
@@ -248,7 +179,7 @@ sctp_notify(struct sctp_inpcb *inp,
 * it a OOTB abort.
 */
if (net->dest_state & SCTP_ADDR_REACHABLE) 

svn commit: r297879 - head/sys/contrib/rdma/krping

2016-04-12 Thread Navdeep Parhar
Author: np
Date: Tue Apr 12 21:34:04 2016
New Revision: 297879
URL: https://svnweb.freebsd.org/changeset/base/297879

Log:
  Add fastreg support to krping (ported from upstream).
  
  Submitted by: Krishnamraju Eraparaju @ Chelsio
  Sponsored by: Chelsio Communications
  Differential Revision:https://reviews.freebsd.org/D5777

Modified:
  head/sys/contrib/rdma/krping/krping.c

Modified: head/sys/contrib/rdma/krping/krping.c
==
--- head/sys/contrib/rdma/krping/krping.c   Tue Apr 12 21:29:06 2016
(r297878)
+++ head/sys/contrib/rdma/krping/krping.c   Tue Apr 12 21:34:04 2016
(r297879)
@@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$");
 extern int krping_debug;
 #define DEBUG_LOG(cb, x...) if (krping_debug) krping_printf((cb)->cookie, x)
 #define PRINTF(cb, x...) krping_printf((cb)->cookie, x)
+#define BIND_INFO 1
 
 MODULE_AUTHOR("Steve Wise");
 MODULE_DESCRIPTION("RDMA ping client/server");
@@ -99,7 +100,7 @@ static const struct krping_option krping
{"poll", OPT_NOPARAM, 'P'},
{"local_dma_lkey", OPT_NOPARAM, 'Z'},
{"read_inv", OPT_NOPARAM, 'R'},
-   {"fr", OPT_NOPARAM, 'f'},
+   {"fr", OPT_INT, 'f'},
{NULL, 0, 0}
 };
 
@@ -232,6 +233,7 @@ struct krping_cb {
int txdepth;/* SQ depth */
int local_dma_lkey; /* use 0 for lkey */
int frtest; /* fastreg test */
+   int testnum;
 
/* CM stuff */
struct rdma_cm_id *cm_id;   /* connection on client side,*/
@@ -365,11 +367,7 @@ static void krping_cq_event_handler(stru
PRINTF(cb, "cq completion in ERROR state\n");
return;
}
-   if (cb->frtest) {
-   PRINTF(cb, "cq completion event in frtest!\n");
-   return;
-   }
-   if (!cb->wlat && !cb->rlat && !cb->bw)
+   if (!cb->wlat && !cb->rlat && !cb->bw && !cb->frtest)
ib_req_notify_cq(cb->cq, IB_CQ_NEXT_COMP);
while ((ret = ib_poll_cq(cb->cq, 1, )) == 1) {
if (wc.status) {
@@ -411,7 +409,7 @@ static void krping_cq_event_handler(stru
DEBUG_LOG(cb, "recv completion\n");
cb->stats.recv_bytes += sizeof(cb->recv_buf);
cb->stats.recv_msgs++;
-   if (cb->wlat || cb->rlat || cb->bw)
+   if (cb->wlat || cb->rlat || cb->bw || cb->frtest)
ret = server_recv(cb, );
else
ret = cb->server ? server_recv(cb, ) :
@@ -464,7 +462,7 @@ static int krping_accept(struct krping_c
return ret;
}
 
-   if (!cb->wlat && !cb->rlat && !cb->bw) {
+   if (!cb->wlat && !cb->rlat && !cb->bw && !cb->frtest) {
wait_event_interruptible(cb->sem, cb->state >= CONNECTED);
if (cb->state == ERROR) {
PRINTF(cb, "wait for CONNECTED state %d\n", 
@@ -502,7 +500,7 @@ static void krping_setup_wr(struct krpin
cb->sq_wr.sg_list = >send_sgl;
cb->sq_wr.num_sge = 1;
 
-   if (cb->server || cb->wlat || cb->rlat || cb->bw) {
+   if (cb->server || cb->wlat || cb->rlat || cb->bw || cb->frtest) {
cb->rdma_sgl.addr = cb->rdma_dma_addr;
if (cb->mem == MR)
cb->rdma_sgl.lkey = cb->rdma_mr->lkey;
@@ -531,7 +529,11 @@ static void krping_setup_wr(struct krpin
case MW:
cb->bind_attr.wr_id = 0xabbaabba;
cb->bind_attr.send_flags = 0; /* unsignaled */
+#ifdef BIND_INFO
cb->bind_attr.bind_info.length = cb->size;
+#else
+   cb->bind_attr.length = cb->size;
+#endif
break;
default:
break;
@@ -646,7 +648,7 @@ static int krping_setup_buffers(struct k
buf.size = cb->size;
iovbase = cb->rdma_dma_addr;
cb->rdma_mr = ib_reg_phys_mr(cb->pd, , 1, 
-IB_ACCESS_LOCAL_WRITE|
+   IB_ACCESS_LOCAL_WRITE|
 IB_ACCESS_REMOTE_READ| 
 IB_ACCESS_REMOTE_WRITE, 
 );
@@ -665,7 +667,7 @@ static int krping_setup_buffers(struct k
}
}
 
-   if (!cb->server || cb->wlat || cb->rlat || cb->bw) {
+   if (!cb->server || cb->wlat || cb->rlat || cb->bw || cb->frtest) {
 
cb->start_buf = kmalloc(cb->size, GFP_KERNEL);
if (!cb->start_buf) {
@@ -682,9 +684,9 @@ static int krping_setup_buffers(struct k
if (cb->mem == MR || cb->mem == MW) {
unsigned flags = IB_ACCESS_REMOTE_READ;
 
-   if (cb->wlat || 

svn commit: r297877 - in head/sys/amd64: conf include

2016-04-12 Thread John Baldwin
Author: jhb
Date: Tue Apr 12 21:23:44 2016
New Revision: 297877
URL: https://svnweb.freebsd.org/changeset/base/297877

Log:
  Enable DEVICE_NUMA with up to 8 domains by default on amd64.
  
  8 memory domains should handle a quad-socket board with dual-domain
  processors.
  
  Reviewed by:  kib
  Relnotes: maybe?
  Differential Revision:https://reviews.freebsd.org/D5893

Modified:
  head/sys/amd64/conf/GENERIC
  head/sys/amd64/conf/MINIMAL
  head/sys/amd64/include/param.h

Modified: head/sys/amd64/conf/GENERIC
==
--- head/sys/amd64/conf/GENERIC Tue Apr 12 21:21:06 2016(r297876)
+++ head/sys/amd64/conf/GENERIC Tue Apr 12 21:23:44 2016(r297877)
@@ -93,6 +93,7 @@ options   MALLOC_DEBUG_MAXZONES=8 # Separ
 
 # Make an SMP-capable kernel by default
 optionsSMP # Symmetric MultiProcessor Kernel
+optionsDEVICE_NUMA # I/O Device Affinity
 
 # CPU frequency control
 device cpufreq

Modified: head/sys/amd64/conf/MINIMAL
==
--- head/sys/amd64/conf/MINIMAL Tue Apr 12 21:21:06 2016(r297876)
+++ head/sys/amd64/conf/MINIMAL Tue Apr 12 21:23:44 2016(r297877)
@@ -92,6 +92,7 @@ options   MALLOC_DEBUG_MAXZONES=8 # Separ
 
 # Make an SMP-capable kernel by default
 optionsSMP # Symmetric MultiProcessor Kernel
+optionsDEVICE_NUMA # I/O Device Affinity
 
 # CPU frequency control
 device cpufreq

Modified: head/sys/amd64/include/param.h
==
--- head/sys/amd64/include/param.h  Tue Apr 12 21:21:06 2016
(r297876)
+++ head/sys/amd64/include/param.h  Tue Apr 12 21:23:44 2016
(r297877)
@@ -72,7 +72,7 @@
 #endif
 
 #ifndef MAXMEMDOM
-#defineMAXMEMDOM   1
+#defineMAXMEMDOM   8
 #endif
 
 #defineALIGNBYTES  _ALIGNBYTES
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297875 - head/sys/dev/cxgbe/common

2016-04-12 Thread Navdeep Parhar
Author: np
Date: Tue Apr 12 21:17:19 2016
New Revision: 297875
URL: https://svnweb.freebsd.org/changeset/base/297875

Log:
  cxgbe(4): Always read the entire mailbox into the reply buffer.
  
  The size of the reply can be different from the size of the command in
  case a debug firmware asserts.  fw_asrt() needs the entire reply in
  order to decode the location of the assert.
  
  Sponsored by:   Chelsio Communications

Modified:
  head/sys/dev/cxgbe/common/t4_hw.c

Modified: head/sys/dev/cxgbe/common/t4_hw.c
==
--- head/sys/dev/cxgbe/common/t4_hw.c   Tue Apr 12 21:04:10 2016
(r297874)
+++ head/sys/dev/cxgbe/common/t4_hw.c   Tue Apr 12 21:17:19 2016
(r297875)
@@ -381,7 +381,7 @@ int t4_wr_mbox_meat_timeout(struct adapt
/*
 * Retrieve the command reply and release the mailbox.
 */
-   get_mbox_rpl(adap, cmd_rpl, size/8, data_reg);
+   get_mbox_rpl(adap, cmd_rpl, MBOX_LEN/8, data_reg);
t4_write_reg(adap, ctl_reg, V_MBOWNER(X_MBOWNER_NONE));
 
CH_DUMP_MBOX(adap, mbox, data_reg);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r296548 - in head/sys: dev/agp dev/drm2 dev/drm2/i915 modules/drm2/i915kms

2016-04-12 Thread Oliver Pinter
On 4/12/16, Edward Tomasz Napierała  wrote:
> I have the exact same problem on T420.  Switching consoles back and forth
> works as a workaround.


I have the same issue on my HP Probook 430G1 (Haswell GPU).


>
> On 0411T1633, Adrian Chadd wrote:
>> hiya,
>>
>> My x230 backlight doesn't come back on after I suspend/resume :( Any
>> ideas? does it work fine for you?
>>
>>
>>
>> -adrian
>>
>>
>> On 9 March 2016 at 17:31, Conrad Meyer  wrote:
>> > On Wed, Mar 9, 2016 at 12:48 PM, Adrian Chadd 
>> > wrote:
>> >> Woo!
>> >>
>> >> Just so its' not lost - people in irc have found power consumption has
>> >> jumped dramatically since this commit. :(
>> >
>> > For the record, on X230 (Ivybridge) I actually see lower power
>> > consumption with the new 3.8 kms:
>> >
>> > (All at brightness 100)
>> > Old kernel, no KMS:  11W
>> > Old kernel, KMS:  13W
>> > New kernel, no KMS:  11W
>> > New kernel, KMS:  11W
>> >
>> > With brightness down to minimum (5%):
>> > New kernel, KMS:  8.9W
>> >
>> > Best,
>> > Conrad
>>
> ___
> svn-src-h...@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-head
> To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

svn commit: r297873 - head/sys/dev/bxe

2016-04-12 Thread David C Somayajulu
Author: davidcs
Date: Tue Apr 12 21:00:38 2016
New Revision: 297873
URL: https://svnweb.freebsd.org/changeset/base/297873

Log:
  1. Process tx completions in bxe_periodic_callout_func() and restart
 transmissions if possible.
  2. For SIOCSIFFLAGS call bxe_init_locked() only if !BXE_STATE_DISABLED
  3. remove code not needed in bxe_init_internal_common()
  
  Submitted by:vaishali.kulka...@qlogic.com;venkata.bhavar...@qlogic.com
  Approved by:davi...@freebsd.org
  MFC after:5 days

Modified:
  head/sys/dev/bxe/bxe.c
  head/sys/dev/bxe/bxe_stats.h

Modified: head/sys/dev/bxe/bxe.c
==
--- head/sys/dev/bxe/bxe.c  Tue Apr 12 20:59:25 2016(r297872)
+++ head/sys/dev/bxe/bxe.c  Tue Apr 12 21:00:38 2016(r297873)
@@ -487,7 +487,9 @@ static const struct {
 { STATS_OFFSET32(mbuf_alloc_sge),
 4, STATS_FLAGS_FUNC, "mbuf_alloc_sge"},
 { STATS_OFFSET32(mbuf_alloc_tpa),
-4, STATS_FLAGS_FUNC, "mbuf_alloc_tpa"}
+4, STATS_FLAGS_FUNC, "mbuf_alloc_tpa"},
+{ STATS_OFFSET32(tx_queue_full_return),
+4, STATS_FLAGS_FUNC, "tx_queue_full_return"}
 };
 
 static const struct {
@@ -598,7 +600,9 @@ static const struct {
 { Q_STATS_OFFSET32(mbuf_alloc_sge),
 4, "mbuf_alloc_sge"},
 { Q_STATS_OFFSET32(mbuf_alloc_tpa),
-4, "mbuf_alloc_tpa"}
+4, "mbuf_alloc_tpa"},
+{ Q_STATS_OFFSET32(tx_queue_full_return),
+4, "tx_queue_full_return"}
 };
 
 #define BXE_NUM_ETH_STATS   ARRAY_SIZE(bxe_eth_stats_arr)
@@ -4619,7 +4623,7 @@ bxe_ioctl(if_t ifp,
 if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) {
 /* set the receive mode flags */
 bxe_set_rx_mode(sc);
-} else {
+} else if(sc->state != BXE_STATE_DISABLED) {
bxe_init_locked(sc);
 }
 } else {
@@ -5723,11 +5727,6 @@ bxe_tx_start(if_t ifp)
 return;
 }
 
-if (if_getdrvflags(ifp) & IFF_DRV_OACTIVE) {
-BLOGW(sc, "Interface TX queue is full, ignoring transmit request\n");
-return;
-}
-
 if (!sc->link_vars.link_up) {
 BLOGW(sc, "Interface link is down, ignoring transmit request\n");
 return;
@@ -5735,6 +5734,11 @@ bxe_tx_start(if_t ifp)
 
 fp = >fp[0];
 
+if (ifp->if_drv_flags & IFF_DRV_OACTIVE) {
+fp->eth_q_stats.tx_queue_full_return++;
+return;
+}
+
 BXE_FP_TX_LOCK(fp);
 bxe_tx_start_locked(sc, ifp, fp);
 BXE_FP_TX_UNLOCK(fp);
@@ -9936,21 +9940,6 @@ bxe_init_internal_common(struct bxe_soft
 {
 int i;
 
-if (IS_MF_SI(sc)) {
-/*
- * In switch independent mode, the TSTORM needs to accept
- * packets that failed classification, since approximate match
- * mac addresses aren't written to NIG LLH.
- */
-REG_WR8(sc,
-(BAR_TSTRORM_INTMEM + TSTORM_ACCEPT_CLASSIFY_FAILED_OFFSET),
-2);
-} else if (!CHIP_IS_E1(sc)) { /* 57710 doesn't support MF */
-REG_WR8(sc,
-(BAR_TSTRORM_INTMEM + TSTORM_ACCEPT_CLASSIFY_FAILED_OFFSET),
-0);
-}
-
 /*
  * Zero this manually as its initialization is currently missing
  * in the initTool.
@@ -12269,6 +12258,8 @@ static void
 bxe_periodic_callout_func(void *xsc)
 {
 struct bxe_softc *sc = (struct bxe_softc *)xsc;
+struct bxe_fastpath *fp;
+uint16_t tx_bd_avail;
 int i;
 
 if (!BXE_CORE_TRYLOCK(sc)) {
@@ -12291,6 +12282,48 @@ bxe_periodic_callout_func(void *xsc)
 return;
 }
 
+#if __FreeBSD_version >= 80
+
+FOR_EACH_QUEUE(sc, i) {
+fp = >fp[i];
+
+if (BXE_FP_TX_TRYLOCK(fp)) {
+if_t ifp = sc->ifp;
+/*
+ * If interface was stopped due to unavailable
+ * bds, try to process some tx completions
+ */
+(void) bxe_txeof(sc, fp);
+   
+tx_bd_avail = bxe_tx_avail(sc, fp);
+if (tx_bd_avail >= BXE_TX_CLEANUP_THRESHOLD) {
+bxe_tx_mq_start_locked(sc, ifp, fp, NULL);
+}
+BXE_FP_TX_UNLOCK(fp);
+}
+}
+
+#else
+
+fp = >fp[0];
+if (BXE_FP_TX_TRYLOCK(fp)) {
+struct ifnet *ifp = sc->ifnet;
+/*
+ * If interface was stopped due to unavailable
+ * bds, try to process some tx completions
+ */
+(void) bxe_txeof(sc, fp);
+   
+tx_bd_avail = bxe_tx_avail(sc, fp);
+if (tx_bd_avail >= BXE_TX_CLEANUP_THRESHOLD) {
+bxe_tx_start_locked(sc, ifp, fp);
+}
+ 
+BXE_FP_TX_UNLOCK(fp);
+}
+
+#endif /* #if __FreeBSD_version >= 80 */
+
 /* Check for TX timeouts on any fastpath. */
 FOR_EACH_QUEUE(sc, i) {
 if (bxe_watchdog(sc, >fp[i]) != 0) {
@@ -16137,6 +16170,7 @@ bxe_detach(device_t dev)
 if 

svn commit: r297872 - head/sys/boot/efi/boot1

2016-04-12 Thread Ed Maste
Author: emaste
Date: Tue Apr 12 20:59:25 2016
New Revision: 297872
URL: https://svnweb.freebsd.org/changeset/base/297872

Log:
  boot1: regenerate FAT templates after r297871
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/boot/efi/boot1/Makefile.fat
  head/sys/boot/efi/boot1/fat-amd64.tmpl.bz2.uu
  head/sys/boot/efi/boot1/fat-arm.tmpl.bz2.uu
  head/sys/boot/efi/boot1/fat-arm64.tmpl.bz2.uu
  head/sys/boot/efi/boot1/fat-i386.tmpl.bz2.uu

Modified: head/sys/boot/efi/boot1/Makefile.fat
==
--- head/sys/boot/efi/boot1/Makefile.fatTue Apr 12 20:52:28 2016
(r297871)
+++ head/sys/boot/efi/boot1/Makefile.fatTue Apr 12 20:59:25 2016
(r297872)
@@ -1,3 +1,4 @@
 # This file autogenerated by generate-fat.sh - DO NOT EDIT
 # $FreeBSD$
 BOOT1_OFFSET=0x2d
+BOOT1_MAXSIZE=131072

Modified: head/sys/boot/efi/boot1/fat-amd64.tmpl.bz2.uu
==
--- head/sys/boot/efi/boot1/fat-amd64.tmpl.bz2.uu   Tue Apr 12 20:52:28 
2016(r297871)
+++ head/sys/boot/efi/boot1/fat-amd64.tmpl.bz2.uu   Tue Apr 12 20:59:25 
2016(r297872)
@@ -2,25 +2,25 @@ FAT template boot filesystem created by 
 DO NOT EDIT
 $FreeBSD$
 begin 644 fat-amd64.tmpl.bz2
-M0EIH.3%!62936;D*A>0`#_ZZKJ[_^N_^O^Z_Z[OJ_NJ^JK^KZNKNNJ
-MZ^KNZOJ^P`+\&$`!D#0T:`80&@T#`@`-`:9`:`P"`R::```:8)II@@,FC(-&
-M$`!D,(:9`E5%&3_]*J?ZHC(--&@::#3)HQ#0`,"9,F$::9!D#`F30#3
-M3)H9-&1DTR`R:,3"`&0-#1H!A`:#0,"``T!ID!H#`(#)IH``!I@FFF"`R:,@
-MT80`&0PAID!5)$)Y0@R#3U-I--,@-&0R-&@T-`@9-!IIIH-&1ILHTT
-M#-$\B;1-/2-H93$\4\34Q9ZDM*M:U49"2K6F0C'21$(GD$1$085)7RB(
-M00A7Q'^3"!"$T+]7/"3^:EK7GMDVS9MRWK=+E>.(OG-?ZZMDA:
-MR74C/HR\T0"$,Y+,YBA.JO&6C*K-DV26*@S24I%*E-2I4J5*JH43)*%"A0H4
-M*5-"E)2E2I4J5+!RPP]&&,P(9X]&&.IMKISQPX<.'#AP@0A"$(0A
-M"$(0A"(MX]&&&$(0A"$(0(0A"$(?ME2N'#APX<.'"+EZ,,,($(0A
-M"$0>NEGIM!8-(Y6FM$:.>9*3D219:RJKD^H2>1%9\LD8O.X4EIVM=.HDTT1'B:J=8;[A9NLU
-M"OX%C.X>0U/WZ^E74T))(^U[S\6_?HX;B.,Y*]7SGN@PV*_(O+^9#
-M+^Q,N_S1'42+=METV+CK9;+US'.8#H,%B,9Y*RD-/)TYXB8XQHI(RLF')')<
-MI>OZPZ5:L^\19>>T2K3OA>TUS8M>VJ_;9P7"8;&7&8R51N>F

svn commit: r297871 - head/sys/boot/efi/boot1

2016-04-12 Thread Ed Maste
Author: emaste
Date: Tue Apr 12 20:52:28 2016
New Revision: 297871
URL: https://svnweb.freebsd.org/changeset/base/297871

Log:
  boot1.efifat: provide a fallback startup.nsh
  
  In case the firmware falls through to executing startup.sh, populate it
  with the name of our boot loader. In normal operation this should not be
  necessary but may allow the system to boot if it would otherwise just
  remain at a shell prompt.
  
  Reviewed by:  andrew, imp, smh
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D5878

Modified:
  head/sys/boot/efi/boot1/generate-fat.sh

Modified: head/sys/boot/efi/boot1/generate-fat.sh
==
--- head/sys/boot/efi/boot1/generate-fat.sh Tue Apr 12 20:50:25 2016
(r297870)
+++ head/sys/boot/efi/boot1/generate-fat.sh Tue Apr 12 20:52:28 2016
(r297871)
@@ -44,6 +44,8 @@ mkdir -p stub/efi/boot
 
 # Make a dummy file for boot1
 echo 'Boot1 START' | dd of=stub/efi/boot/$FILENAME cbs=$BOOT1_SIZE count=1 
conv=block
+# Provide a fallback startup.nsh
+echo $FILENAME > stub/efi/boot/startup.nsh
 
 umount stub
 mdconfig -d -u $DEVICE
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297869 - head/sys/fs/nfsserver

2016-04-12 Thread Rick Macklem
Author: rmacklem
Date: Tue Apr 12 20:23:09 2016
New Revision: 297869
URL: https://svnweb.freebsd.org/changeset/base/297869

Log:
  If the VOP_SETATTR() call that saves the exclusive create verifier failed,
  the NFS server would leave the newly created vnode locked. This could
  result in a file system that would not unmount and processes wedged,
  waiting for the file to be unlocked.
  Since this VOP_SETATTR() never fails for most file systems, this bug
  doesn't normally manifest itself. I found it during testing of an
  exported GlusterFS file system, which can fail.
  This patch adds the vput() and changes the error to the correct NFS one.
  
  MFC after:2 weeks

Modified:
  head/sys/fs/nfsserver/nfs_nfsdport.c

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==
--- head/sys/fs/nfsserver/nfs_nfsdport.cTue Apr 12 19:11:14 2016
(r297868)
+++ head/sys/fs/nfsserver/nfs_nfsdport.cTue Apr 12 20:23:09 2016
(r297869)
@@ -794,6 +794,11 @@ nfsvno_createsub(struct nfsrv_descript *
nvap->na_atime.tv_nsec = cverf[1];
error = VOP_SETATTR(ndp->ni_vp,
>na_vattr, nd->nd_cred);
+   if (error != 0) {
+   vput(ndp->ni_vp);
+   ndp->ni_vp = NULL;
+   error = NFSERR_NOTSUPP;
+   }
}
}
/*
@@ -1422,6 +1427,11 @@ nfsvno_open(struct nfsrv_descript *nd, s
nvap->na_atime.tv_nsec = cverf[1];
nd->nd_repstat = VOP_SETATTR(ndp->ni_vp,
>na_vattr, cred);
+   if (nd->nd_repstat != 0) {
+   vput(ndp->ni_vp);
+   ndp->ni_vp = NULL;
+   nd->nd_repstat = NFSERR_NOTSUPP;
+   }
} else {
nfsrv_fixattr(nd, ndp->ni_vp, nvap,
aclp, p, attrbitp, exp);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297868 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-04-12 Thread Alan Somers
Author: asomers
Date: Tue Apr 12 19:11:14 2016
New Revision: 297868
URL: https://svnweb.freebsd.org/changeset/base/297868

Log:
  Fix rare double free in vdev_geom_attrchanged
  
  sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
Don't drop the g_topology_lock before freeing old_physpath. That
opens up a race where one thread can call vdev_geom_attrchanged,
set old_physpath, drop the g_topology_lock, then block trying to
acquire the SCL_STATE lock. Then another thread can come into
vdev_geom_attrchanged, set old_physpath to the same value, and
proceed to free it. When the first thread resumes, it will free
the same location.
  
It turns out that the SCL_STATE lock isn't needed. It was
originally added by gibbs to protect vd->vdev_physpath while
updating the same. However, the update process subsequently was
switched to an atomic operation (a pointer swap). Now, there is
no need for the SCL_STATE lock, and hence no need to drop the
g_topology_lock.
  
  Reviewed by:  delphij
  MFC after:4 weeks
  Sponsored by: Spectra Logic Corp
  Differential Revision:https://reviews.freebsd.org/D5413

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Apr 
12 18:50:37 2016(r297867)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Apr 
12 19:11:14 2016(r297868)
@@ -115,27 +115,14 @@ vdev_geom_attrchanged(struct g_consumer 
if (error == 0) {
char *old_physpath;
 
+   /* g_topology lock ensures that vdev has not been closed */
+   g_topology_assert();
old_physpath = vd->vdev_physpath;
vd->vdev_physpath = spa_strdup(physpath);
spa_async_request(spa, SPA_ASYNC_CONFIG_UPDATE);
 
-   if (old_physpath != NULL) {
-   int held_lock;
-
-   held_lock = spa_config_held(spa, SCL_STATE, RW_WRITER);
-   if (held_lock == 0) {
-   g_topology_unlock();
-   spa_config_enter(spa, SCL_STATE, FTAG,
-   RW_WRITER);
-   }
-
+   if (old_physpath != NULL)
spa_strfree(old_physpath);
-
-   if (held_lock == 0) {
-   spa_config_exit(spa, SCL_STATE, FTAG);
-   g_topology_lock();
-   }
-   }
}
g_free(physpath);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297867 - head/sys/dev/isp

2016-04-12 Thread Alexander Motin
Author: mav
Date: Tue Apr 12 18:50:37 2016
New Revision: 297867
URL: https://svnweb.freebsd.org/changeset/base/297867

Log:
  Make all CT Pass-Through (name server requests) asynchronous.
  
  Previously we had to do it synchronously because we could not drop the lock
  due to potential scratch memory use conflicts.  Previous commits fixed that
  collision, so here it goes -- slower and less reliable external requests
  are executed asynchronously without spinning in tight loop and with more
  safe timeout handling.

Modified:
  head/sys/dev/isp/isp.c

Modified: head/sys/dev/isp/isp.c
==
--- head/sys/dev/isp/isp.c  Tue Apr 12 18:24:02 2016(r297866)
+++ head/sys/dev/isp/isp.c  Tue Apr 12 18:50:37 2016(r297867)
@@ -3078,20 +3078,31 @@ isp_fclink_test(ispsoftc_t *isp, int cha
fcp->isp_fabric_params = mbs.param[7];
fcp->isp_sns_hdl = NPH_SNS_ID;
r = isp_register_fc4_type_24xx(isp, chan);
-   if (r == 0)
-   isp_register_fc4_features_24xx(isp, chan);
-   isp_register_port_name_24xx(isp, chan);
+   if (fcp->isp_loopstate < LOOP_TESTING_LINK)
+   goto abort;
+   if (r != 0)
+   goto not_on_fabric;
+   r = isp_register_fc4_features_24xx(isp, chan);
+   if (fcp->isp_loopstate < LOOP_TESTING_LINK)
+   goto abort;
+   if (r != 0)
+   goto not_on_fabric;
+   r = isp_register_port_name_24xx(isp, chan);
+   if (fcp->isp_loopstate < LOOP_TESTING_LINK)
+   goto abort;
+   if (r != 0)
+   goto not_on_fabric;
isp_register_node_name_24xx(isp, chan);
+   if (fcp->isp_loopstate < LOOP_TESTING_LINK)
+   goto abort;
} else {
fcp->isp_sns_hdl = SNS_ID;
r = isp_register_fc4_type(isp, chan);
-   if (r == 0 && fcp->role == ISP_ROLE_TARGET)
+   if (r != 0)
+   goto not_on_fabric;
+   if (fcp->role == ISP_ROLE_TARGET)
isp_send_change_request(isp, chan);
}
-   if (r) {
-   isp_prt(isp, ISP_LOGWARN|ISP_LOG_SANCFG, "%s: register 
fc4 type failed", __func__);
-   return (-1);
-   }
}
 
 not_on_fabric:
@@ -3505,65 +3516,66 @@ isp_gid_ft_sns(ispsoftc_t *isp, int chan
 static int
 isp_ct_passthru(ispsoftc_t *isp, int chan, uint32_t cmd_bcnt, uint32_t 
rsp_bcnt)
 {
-   mbreg_t mbs;
fcparam *fcp = FCPARAM(isp, chan);
-   union {
-   isp_ct_pt_t plocal;
-   uint8_t q[QENTRY_LEN];
-   } un;
-   isp_ct_pt_t *pt;
-   uint8_t *scp = fcp->isp_scratch;
+   isp_ct_pt_t pt;
+   void *reqp;
+   uint8_t resp[QENTRY_LEN];
 
/*
 * Build a Passthrough IOCB in memory.
 */
-   pt = 
-   ISP_MEMZERO(un.q, QENTRY_LEN);
-   pt->ctp_header.rqs_entry_count = 1;
-   pt->ctp_header.rqs_entry_type = RQSTYPE_CT_PASSTHRU;
-   pt->ctp_handle = 0x;
-   pt->ctp_nphdl = fcp->isp_sns_hdl;
-   pt->ctp_cmd_cnt = 1;
-   pt->ctp_vpidx = ISP_GET_VPIDX(isp, chan);
-   pt->ctp_time = 10;
-   pt->ctp_rsp_cnt = 1;
-   pt->ctp_rsp_bcnt = rsp_bcnt;
-   pt->ctp_cmd_bcnt = cmd_bcnt;
-   pt->ctp_dataseg[0].ds_base = DMA_LO32(fcp->isp_scdma+XTXOFF);
-   pt->ctp_dataseg[0].ds_basehi = DMA_HI32(fcp->isp_scdma+XTXOFF);
-   pt->ctp_dataseg[0].ds_count = cmd_bcnt;
-   pt->ctp_dataseg[1].ds_base = DMA_LO32(fcp->isp_scdma);
-   pt->ctp_dataseg[1].ds_basehi = DMA_HI32(fcp->isp_scdma);
-   pt->ctp_dataseg[1].ds_count = rsp_bcnt;
-   isp_put_ct_pt(isp, pt, (isp_ct_pt_t *)[CTXOFF]);
-   if (isp->isp_dblev & ISP_LOGDEBUG1)
-   isp_print_bytes(isp, "CT IOCB request", QENTRY_LEN, 
[CTXOFF]);
+   ISP_MEMZERO(, sizeof(pt));
+   pt.ctp_header.rqs_entry_count = 1;
+   pt.ctp_header.rqs_entry_type = RQSTYPE_CT_PASSTHRU;
+   pt.ctp_nphdl = fcp->isp_sns_hdl;
+   pt.ctp_cmd_cnt = 1;
+   pt.ctp_vpidx = ISP_GET_VPIDX(isp, chan);
+   pt.ctp_time = 10;
+   pt.ctp_rsp_cnt = 1;
+   pt.ctp_rsp_bcnt = rsp_bcnt;
+   pt.ctp_cmd_bcnt = cmd_bcnt;
+   pt.ctp_dataseg[0].ds_base = DMA_LO32(fcp->isp_scdma+XTXOFF);
+   pt.ctp_dataseg[0].ds_basehi = DMA_HI32(fcp->isp_scdma+XTXOFF);
+   pt.ctp_dataseg[0].ds_count = cmd_bcnt;
+   pt.ctp_dataseg[1].ds_base = DMA_LO32(fcp->isp_scdma);
+   

svn commit: r297866 - head/libexec/bootpd

2016-04-12 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Apr 12 18:24:02 2016
New Revision: 297866
URL: https://svnweb.freebsd.org/changeset/base/297866

Log:
  Restore some comments in previous commit.

Modified:
  head/libexec/bootpd/readfile.c

Modified: head/libexec/bootpd/readfile.c
==
--- head/libexec/bootpd/readfile.c  Tue Apr 12 18:18:26 2016
(r297865)
+++ head/libexec/bootpd/readfile.c  Tue Apr 12 18:24:02 2016
(r297866)
@@ -428,7 +428,7 @@ readtab(force)
if (hp->flags.iaddr) {
nhosts++;
}
-   /* by HW addr if known. */
+   /* Register by HW addr if known. */
if (hp->flags.htype && hp->flags.haddr) {
/* We will either insert it or free it. */
hp->linkcount++;
@@ -441,7 +441,7 @@ readtab(force)
continue;
}
}
-   /* by IP addr if known. */
+   /* Register by IP addr if known. */
if (hp->flags.iaddr) {
hashcode = hash_HashFunction((u_char *) & 
(hp->iaddr.s_addr), 4);
if (hash_Insert(iphashtable, hashcode, nullcmp, hp, hp) 
< 0) {
@@ -452,7 +452,7 @@ readtab(force)
hp->linkcount++;
}
}
-   /* by Name (always known) */
+   /* Register by Name (always known) */
hashcode = hash_HashFunction((u_char *) hp->hostname->string,
 
strlen(hp->hostname->string));
if (hash_Insert(nmhashtable, hashcode, nullcmp,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297865 - in head/libexec/bootpd: . tools/bootptest

2016-04-12 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Apr 12 18:18:26 2016
New Revision: 297865
URL: https://svnweb.freebsd.org/changeset/base/297865

Log:
  bootpd(8): De-register and minor cleanups.
  
  For bootptest(8) also remuve an unused variable and replace
  0 with a NULL for a pointer.

Modified:
  head/libexec/bootpd/getether.c
  head/libexec/bootpd/hash.c
  head/libexec/bootpd/hwaddr.c
  head/libexec/bootpd/readfile.c
  head/libexec/bootpd/rtmsg.c
  head/libexec/bootpd/tools/bootptest/bootptest.c
  head/libexec/bootpd/tools/bootptest/print-bootp.c

Modified: head/libexec/bootpd/getether.c
==
--- head/libexec/bootpd/getether.c  Tue Apr 12 18:13:24 2016
(r297864)
+++ head/libexec/bootpd/getether.c  Tue Apr 12 18:18:26 2016
(r297865)
@@ -124,10 +124,10 @@ getether(ifname, eap)
char *eap;  /* Ether address 
(output) */
 {
int fd, rc = -1;
-   register int n;
+   int n;
struct ifreq ibuf[16];
struct ifconf ifc;
-   register struct ifreq *ifrp, *ifend;
+   struct ifreq *ifrp, *ifend;
 
/* Fetch the interface configuration */
fd = socket(AF_INET, SOCK_DGRAM, 0);

Modified: head/libexec/bootpd/hash.c
==
--- head/libexec/bootpd/hash.c  Tue Apr 12 18:13:24 2016(r297864)
+++ head/libexec/bootpd/hash.c  Tue Apr 12 18:18:26 2016(r297865)
@@ -79,8 +79,8 @@ hash_tbl *
 hash_Init(tablesize)
unsigned tablesize;
 {
-   register hash_tbl *hashtblptr;
-   register unsigned totalsize;
+   hash_tbl *hashtblptr;
+   unsigned totalsize;
 
if (tablesize > 0) {
totalsize = sizeof(hash_tbl)
@@ -169,9 +169,9 @@ hash_Reset(hashtable, free_data)
 unsigned
 hash_HashFunction(string, len)
unsigned char *string;
-   register unsigned len;
+   unsigned len;
 {
-   register unsigned accum;
+   unsigned accum;
 
accum = 0;
for (; len > 0; len--) {
@@ -195,7 +195,7 @@ hash_Exists(hashtable, hashcode, compare
hash_cmpfp compare;
hash_datum *key;
 {
-   register hash_member *memberptr;
+   hash_member *memberptr;
 
memberptr = (hashtable->table)[hashcode % (hashtable->size)];
while (memberptr) {
@@ -345,8 +345,8 @@ hash_datum *
 hash_NextEntry(hashtable)
hash_tbl *hashtable;
 {
-   register unsigned bucket;
-   register hash_member *memberptr;
+   unsigned bucket;
+   hash_member *memberptr;
 
/*
 * First try to pick up where we left off.

Modified: head/libexec/bootpd/hwaddr.c
==
--- head/libexec/bootpd/hwaddr.cTue Apr 12 18:13:24 2016
(r297864)
+++ head/libexec/bootpd/hwaddr.cTue Apr 12 18:18:26 2016
(r297865)
@@ -295,7 +295,7 @@ static u_char conv802table[256] =
 
 void
 haddr_conv802(addr_in, addr_out, len)
-   register u_char *addr_in, *addr_out;
+   u_char *addr_in, *addr_out;
int len;
 {
u_char *lim;

Modified: head/libexec/bootpd/readfile.c
==
--- head/libexec/bootpd/readfile.c  Tue Apr 12 18:13:24 2016
(r297864)
+++ head/libexec/bootpd/readfile.c  Tue Apr 12 18:18:26 2016
(r297865)
@@ -428,7 +428,7 @@ readtab(force)
if (hp->flags.iaddr) {
nhosts++;
}
-   /* Register by HW addr if known. */
+   /* by HW addr if known. */
if (hp->flags.htype && hp->flags.haddr) {
/* We will either insert it or free it. */
hp->linkcount++;
@@ -441,7 +441,7 @@ readtab(force)
continue;
}
}
-   /* Register by IP addr if known. */
+   /* by IP addr if known. */
if (hp->flags.iaddr) {
hashcode = hash_HashFunction((u_char *) & 
(hp->iaddr.s_addr), 4);
if (hash_Insert(iphashtable, hashcode, nullcmp, hp, hp) 
< 0) {
@@ -452,7 +452,7 @@ readtab(force)
hp->linkcount++;
}
}
-   /* Register by Name (always known) */
+   /* by Name (always known) */
hashcode = hash_HashFunction((u_char *) hp->hostname->string,
 
strlen(hp->hostname->string));
if (hash_Insert(nmhashtable, hashcode, nullcmp,
@@ -1305,7 +1305,7 @@ process_generic(src, dest, tagvalue)
 
 PRIVATE boolean
 goodname(hostname)
-   register char *hostname;
+   char *hostname;
 {
do {
if (!isalpha(*hostname++)) {/* First 

svn commit: r297864 - head/sys/kern

2016-04-12 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Apr 12 18:13:24 2016
New Revision: 297864
URL: https://svnweb.freebsd.org/changeset/base/297864

Log:
  Fix overflow checking.
  
  There are some other potential problems related to overflowing racct
  counters; I'll revisit those later.
  
  Submitted by: Pieter de Goeje (earlier version)
  Reviewed by:  emaste@
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/kern_rctl.c

Modified: head/sys/kern/kern_rctl.c
==
--- head/sys/kern/kern_rctl.c   Tue Apr 12 17:44:34 2016(r297863)
+++ head/sys/kern/kern_rctl.c   Tue Apr 12 18:13:24 2016(r297864)
@@ -495,17 +495,11 @@ xadd(uint64_t a, uint64_t b)
 static uint64_t
 xmul(uint64_t a, uint64_t b)
 {
-   uint64_t c;
 
-   if (a == 0 || b == 0)
-   return (0);
-
-   c = a * b;
-
-   if (c < a || c < b)
+   if (b != 0 && a > UINT64_MAX / b)
return (UINT64_MAX);
 
-   return (c);
+   return (a * b);
 }
 
 /*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297863 - head/sys/dev/cxgbe/common

2016-04-12 Thread John Baldwin
Author: jhb
Date: Tue Apr 12 17:44:34 2016
New Revision: 297863
URL: https://svnweb.freebsd.org/changeset/base/297863

Log:
  Rename the 'M_B' macro in t4_regs.h to 'CXGBE_M_B'.
  
  This fixes a conflict with the M_B macro in powerpc's
   exposed by the recent addition of DDB commands
  to the cxgbe driver.
  
  Discussed with:   np
  Reported by:  bz
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/common/t4_regs.h

Modified: head/sys/dev/cxgbe/common/t4_regs.h
==
--- head/sys/dev/cxgbe/common/t4_regs.h Tue Apr 12 17:23:03 2016
(r297862)
+++ head/sys/dev/cxgbe/common/t4_regs.h Tue Apr 12 17:44:34 2016
(r297863)
@@ -47301,9 +47301,9 @@
 #define A_MAC_PORT_PTP_OFFSET_ADJUST_FINE 0x9a4
 
 #define S_B16
-#define M_B0xU
+#define CXGBE_M_B0xU
 #define V_B(x) ((x) << S_B)
-#define G_B(x) (((x) >> S_B) & M_B)
+#define G_B(x) (((x) >> S_B) & CXGBE_M_B)
 
 #define S_A0
 #define M_A0xU
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297862 - in head/sys/dev: mn mpt mrsas mvs nxge/xgehal sound/isa sound/midi sound/pci vxge/vxgehal

2016-04-12 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Apr 12 17:23:03 2016
New Revision: 297862
URL: https://svnweb.freebsd.org/changeset/base/297862

Log:
  Replace 0 with NULL for pointers in misc. device drivers.
  
  Found with devel/coccinelle.

Modified:
  head/sys/dev/mn/if_mn.c
  head/sys/dev/mpt/mpt_raid.c
  head/sys/dev/mrsas/mrsas_ioctl.c
  head/sys/dev/mvs/mvs_pci.c
  head/sys/dev/mvs/mvs_soc.c
  head/sys/dev/nxge/xgehal/xgehal-device.c
  head/sys/dev/sound/isa/ad1816.c
  head/sys/dev/sound/isa/ess.c
  head/sys/dev/sound/isa/mss.c
  head/sys/dev/sound/isa/sb16.c
  head/sys/dev/sound/isa/sb8.c
  head/sys/dev/sound/midi/midi.c
  head/sys/dev/sound/pci/als4000.c
  head/sys/dev/sound/pci/aureal.c
  head/sys/dev/sound/pci/cmi.c
  head/sys/dev/sound/pci/emu10k1.c
  head/sys/dev/sound/pci/emu10kx.c
  head/sys/dev/sound/pci/fm801.c
  head/sys/dev/sound/pci/neomagic.c
  head/sys/dev/sound/pci/solo.c
  head/sys/dev/sound/pci/t4dwave.c
  head/sys/dev/sound/pci/via8233.c
  head/sys/dev/sound/pci/via82c686.c
  head/sys/dev/vxge/vxgehal/vxgehal-fifo.c
  head/sys/dev/vxge/vxgehal/vxgehal-mrpcim.c

Modified: head/sys/dev/mn/if_mn.c
==
--- head/sys/dev/mn/if_mn.c Tue Apr 12 17:00:13 2016(r297861)
+++ head/sys/dev/mn/if_mn.c Tue Apr 12 17:23:03 2016(r297862)
@@ -617,7 +617,7 @@ ngmn_rcvdata(hook_p hook, item_p item)
mn_free_desc(dp);
dp = dp2;
}
-   sc->ch[chan]->xl->vnext = 0;
+   sc->ch[chan]->xl->vnext = NULL;
break;
}
dp->data = vtophys(m2->m_data);
@@ -625,7 +625,7 @@ ngmn_rcvdata(hook_p hook, item_p item)
dp->flags += 1;
len -= m2->m_len;
dp->next = vtophys(dp);
-   dp->vnext = 0;
+   dp->vnext = NULL;
sc->ch[chan]->xl->next = vtophys(dp);
sc->ch[chan]->xl->vnext = dp;
sc->ch[chan]->xl = dp;
@@ -634,7 +634,7 @@ ngmn_rcvdata(hook_p hook, item_p item)
dp->flags |= 0xc000;
dp2->flags &= ~0x4000;
} else {
-   dp->m = 0;
+   dp->m = NULL;
m2 = m2->m_next;
}
} 
@@ -698,7 +698,7 @@ ngmn_connect(hook_p hook)
dp->m = m;
dp->flags = 0xc000 + (1 << 16);
dp->next = vtophys(dp);
-   dp->vnext = 0;
+   dp->vnext = NULL;
dp->data = vtophys(sc->name);
sc->m32_mem.cs[chan].tdesc = vtophys(dp);
sc->ch[chan]->x1 = dp;
@@ -715,7 +715,7 @@ ngmn_connect(hook_p hook)
dp->flags = 0x4000;
dp->flags += 1600 << 16;
dp->next = vtophys(dp);
-   dp->vnext = 0;
+   dp->vnext = NULL;
sc->ch[chan]->rl = dp;
 
for (i = 0; i < (nts + 10); i++) {
@@ -1127,7 +1127,7 @@ mn_rx_intr(struct mn_softc *sc, u_int32_
if (vtophys(dp) == sc->m32_mem.crxd[chan]) 
return;
m = dp->m;
-   dp->m = 0;
+   dp->m = NULL;
m->m_pkthdr.len = m->m_len = (dp->status >> 16) & 0x1fff;
err = (dp->status >> 8) & 0xff;
if (!err) {
@@ -1176,7 +1176,7 @@ mn_rx_intr(struct mn_softc *sc, u_int32_
dp->flags = 0x4000;
dp->flags += 1600 << 16;
dp->next = vtophys(dp);
-   dp->vnext = 0;
+   dp->vnext = NULL;
sc->ch[chan]->rl->next = vtophys(dp);
sc->ch[chan]->rl->vnext = dp;
sc->ch[chan]->rl->flags &= ~0x4000;

Modified: head/sys/dev/mpt/mpt_raid.c
==
--- head/sys/dev/mpt/mpt_raid.c Tue Apr 12 17:00:13 2016(r297861)
+++ head/sys/dev/mpt/mpt_raid.c Tue Apr 12 17:23:03 2016(r297862)
@@ -595,7 +595,7 @@ mpt_issue_raid_req(struct mpt_softc *mpt
rap->Function = MPI_FUNCTION_RAID_ACTION;
rap->VolumeID = vol->config_page->VolumeID;
rap->VolumeBus = vol->config_page->VolumeBus;
-   if (disk != 0)
+   if (disk != NULL)
rap->PhysDiskNum = disk->config_page.PhysDiskNum;
else
rap->PhysDiskNum = 0xFF;

Modified: head/sys/dev/mrsas/mrsas_ioctl.c
==
--- head/sys/dev/mrsas/mrsas_ioctl.cTue Apr 12 17:00:13 2016
(r297861)
+++ head/sys/dev/mrsas/mrsas_ioctl.cTue Apr 12 17:23:03 2016
(r297862)
@@ -86,7 +86,7 @@ mrsas_passthru(struct mrsas_softc *sc, v
bus_addr_t ioctl_data_phys_addr[MAX_IOCTL_SGE];
bus_dma_tag_t ioctl_sense_tag = 0;
bus_dmamap_t ioctl_sense_dmamap = 0;
-   void *ioctl_sense_mem = 0;
+   void 

Re: svn commit: r296548 - in head/sys: dev/agp dev/drm2 dev/drm2/i915 modules/drm2/i915kms

2016-04-12 Thread John Baldwin
On Tuesday, April 12, 2016 08:17:35 AM Adrian Chadd wrote:
> So, if I suspend in /xorg/, it works. but if I suspend now in vt, it
> doesn't work.
> 
> (Yes, vt + i915kms..)

I can confirm the same on my x220 (and this is a regression).  Switching
over to another ttyv and back "fixes" it as trasz@ noted.  I think the issue
isn't that the backlight isn't on; I think it's that the frame buffer contents
aren't restored properly and are left as all black when resuming on the
console.

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


svn commit: r297860 - head/usr.sbin/ctld

2016-04-12 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Apr 12 16:07:41 2016
New Revision: 297860
URL: https://svnweb.freebsd.org/changeset/base/297860

Log:
  Make the usage() mention the -u option added in r295212.
  
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.sbin/ctld/ctld.c

Modified: head/usr.sbin/ctld/ctld.c
==
--- head/usr.sbin/ctld/ctld.c   Tue Apr 12 14:43:17 2016(r297859)
+++ head/usr.sbin/ctld/ctld.c   Tue Apr 12 16:07:41 2016(r297860)
@@ -66,7 +66,7 @@ static void
 usage(void)
 {
 
-   fprintf(stderr, "usage: ctld [-d][-f config-file]\n");
+   fprintf(stderr, "usage: ctld [-d][-u][-f config-file]\n");
exit(1);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r296548 - in head/sys: dev/agp dev/drm2 dev/drm2/i915 modules/drm2/i915kms

2016-04-12 Thread Adrian Chadd
So, if I suspend in /xorg/, it works. but if I suspend now in vt, it
doesn't work.

(Yes, vt + i915kms..)


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


svn commit: r297859 - head/sys/dev/isp

2016-04-12 Thread Alexander Motin
Author: mav
Date: Tue Apr 12 14:43:17 2016
New Revision: 297859
URL: https://svnweb.freebsd.org/changeset/base/297859

Log:
  Switch isp_getpdb() to synchronous IOCB DMA area.
  
  While technically it is not IOCB, it is synchronous and can be called from
  different places, so calling FC_SCRATCH_ACQUIRE() here is inconvenient.

Modified:
  head/sys/dev/isp/isp.c

Modified: head/sys/dev/isp/isp.c
==
--- head/sys/dev/isp/isp.c  Tue Apr 12 14:19:19 2016(r297858)
+++ head/sys/dev/isp/isp.c  Tue Apr 12 14:43:17 2016(r297859)
@@ -2776,7 +2776,6 @@ isp_port_logout(ispsoftc_t *isp, uint16_
 static int
 isp_getpdb(ispsoftc_t *isp, int chan, uint16_t id, isp_pdb_t *pdb)
 {
-   fcparam *fcp = FCPARAM(isp, chan);
mbreg_t mbs;
union {
isp_pdb_21xx_t fred;
@@ -2794,23 +2793,19 @@ isp_getpdb(ispsoftc_t *isp, int chan, ui
} else {
mbs.param[1] = id << 8;
}
-   mbs.param[2] = DMA_WD1(fcp->isp_scdma);
-   mbs.param[3] = DMA_WD0(fcp->isp_scdma);
-   mbs.param[6] = DMA_WD3(fcp->isp_scdma);
-   mbs.param[7] = DMA_WD2(fcp->isp_scdma);
-   if (FC_SCRATCH_ACQUIRE(isp, chan)) {
-   isp_prt(isp, ISP_LOGERR, sacq);
-   return (-1);
-   }
-   MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof(un), chan);
+   mbs.param[2] = DMA_WD1(isp->isp_iocb_dma);
+   mbs.param[3] = DMA_WD0(isp->isp_iocb_dma);
+   mbs.param[6] = DMA_WD3(isp->isp_iocb_dma);
+   mbs.param[7] = DMA_WD2(isp->isp_iocb_dma);
+   MEMORYBARRIER(isp, SYNC_IFORDEV, 0, sizeof(un), chan);
+
isp_mboxcmd(isp, );
-   if (mbs.param[0] != MBOX_COMMAND_COMPLETE) {
-   FC_SCRATCH_RELEASE(isp, chan);
+   if (mbs.param[0] != MBOX_COMMAND_COMPLETE)
return (mbs.param[0] | (mbs.param[1] << 16));
-   }
-   MEMORYBARRIER(isp, SYNC_SFORCPU, 0, sizeof(un), chan);
+
+   MEMORYBARRIER(isp, SYNC_IFORCPU, 0, sizeof(un), chan);
if (IS_24XX(isp)) {
-   isp_get_pdb_24xx(isp, fcp->isp_scratch, );
+   isp_get_pdb_24xx(isp, isp->isp_iocb, );
pdb->handle = un.bill.pdb_handle;
pdb->prli_word3 = un.bill.pdb_prli_svc3;
pdb->portid = BITS2WORD_24XX(un.bill.pdb_portid_bits);
@@ -2822,11 +2817,10 @@ isp_getpdb(ispsoftc_t *isp, int chan, ui
un.bill.pdb_curstate);
if (un.bill.pdb_curstate < PDB2400_STATE_PLOGI_DONE || 
un.bill.pdb_curstate > PDB2400_STATE_LOGGED_IN) {
mbs.param[0] = MBOX_NOT_LOGGED_IN;
-   FC_SCRATCH_RELEASE(isp, chan);
return (mbs.param[0]);
}
} else {
-   isp_get_pdb_21xx(isp, fcp->isp_scratch, );
+   isp_get_pdb_21xx(isp, isp->isp_iocb, );
pdb->handle = un.fred.pdb_loopid;
pdb->prli_word3 = un.fred.pdb_prli_svc3;
pdb->portid = BITS2WORD(un.fred.pdb_portid_bits);
@@ -2835,7 +2829,6 @@ isp_getpdb(ispsoftc_t *isp, int chan, ui
isp_prt(isp, ISP_LOGDEBUG1,
"Chan %d handle 0x%x Port 0x%06x", chan, id, pdb->portid);
}
-   FC_SCRATCH_RELEASE(isp, chan);
return (0);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297858 - head/sys/dev/isp

2016-04-12 Thread Alexander Motin
Author: mav
Date: Tue Apr 12 14:19:19 2016
New Revision: 297858
URL: https://svnweb.freebsd.org/changeset/base/297858

Log:
  Allocate separate DMA area for synchronous IOCB execution.
  
  Usually IOCBs should be put on queue for asynchronous processing and should
  not require additional DMA memory.  But there are some cases like aborts and
  resets that for external reasons has to be synchronous.  Give those cases
  separate 2*64 byte DMA area to decouple them from other DMA scratch area
  users, using it for asynchronous requests.

Modified:
  head/sys/dev/isp/isp.c
  head/sys/dev/isp/isp_freebsd.h
  head/sys/dev/isp/isp_pci.c
  head/sys/dev/isp/ispvar.h

Modified: head/sys/dev/isp/isp.c
==
--- head/sys/dev/isp/isp.c  Tue Apr 12 13:30:39 2016(r297857)
+++ head/sys/dev/isp/isp.c  Tue Apr 12 14:19:19 2016(r297858)
@@ -4667,31 +4667,25 @@ isp_control(ispsoftc_t *isp, ispctl_t ct
tmf->tmf_tidlo = lp->portid;
tmf->tmf_tidhi = lp->portid >> 16;
tmf->tmf_vpidx = ISP_GET_VPIDX(isp, chan);
+   isp_put_24xx_tmf(isp, tmf, isp->isp_iocb);
+   MEMORYBARRIER(isp, SYNC_IFORDEV, 0, QENTRY_LEN, chan);
+   fcp->sendmarker = 1;
+
isp_prt(isp, ISP_LOGALL, "Chan %d Reset N-Port Handle 
0x%04x @ Port 0x%06x", chan, lp->handle, lp->portid);
MBSINIT(, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL,
MBCMD_DEFAULT_TIMEOUT + tmf->tmf_timeout * 100);
mbs.param[1] = QENTRY_LEN;
-   mbs.param[2] = DMA_WD1(fcp->isp_scdma);
-   mbs.param[3] = DMA_WD0(fcp->isp_scdma);
-   mbs.param[6] = DMA_WD3(fcp->isp_scdma);
-   mbs.param[7] = DMA_WD2(fcp->isp_scdma);
-
-   if (FC_SCRATCH_ACQUIRE(isp, chan)) {
-   isp_prt(isp, ISP_LOGERR, sacq);
-   break;
-   }
-   isp_put_24xx_tmf(isp, tmf, fcp->isp_scratch);
-   MEMORYBARRIER(isp, SYNC_SFORDEV, 0, QENTRY_LEN, chan);
-   fcp->sendmarker = 1;
+   mbs.param[2] = DMA_WD1(isp->isp_iocb_dma);
+   mbs.param[3] = DMA_WD0(isp->isp_iocb_dma);
+   mbs.param[6] = DMA_WD3(isp->isp_iocb_dma);
+   mbs.param[7] = DMA_WD2(isp->isp_iocb_dma);
isp_mboxcmd(isp, );
-   if (mbs.param[0] != MBOX_COMMAND_COMPLETE) {
-   FC_SCRATCH_RELEASE(isp, chan);
+   if (mbs.param[0] != MBOX_COMMAND_COMPLETE)
break;
-   }
-   MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, 
QENTRY_LEN, chan);
+
+   MEMORYBARRIER(isp, SYNC_IFORCPU, QENTRY_LEN, 
QENTRY_LEN, chan);
sp = (isp24xx_statusreq_t *) local;
-   isp_get_24xx_response(isp, &((isp24xx_statusreq_t 
*)fcp->isp_scratch)[1], sp);
-   FC_SCRATCH_RELEASE(isp, chan);
+   isp_get_24xx_response(isp, &((isp24xx_statusreq_t 
*)isp->isp_iocb)[1], sp);
if (sp->req_completion_status == 0) {
return (0);
}
@@ -4731,7 +4725,7 @@ isp_control(ispsoftc_t *isp, ispctl_t ct
break;
}
if (IS_24XX(isp)) {
-   isp24xx_abrt_t local, *ab = , *ab2;
+   isp24xx_abrt_t local, *ab = 
fcparam *fcp;
fcportdb_t *lp;
 
@@ -4755,31 +4749,23 @@ isp_control(ispsoftc_t *isp, ispctl_t ct
ab->abrt_tidlo = lp->portid;
ab->abrt_tidhi = lp->portid >> 16;
ab->abrt_vpidx = ISP_GET_VPIDX(isp, chan);
+   isp_put_24xx_abrt(isp, ab, isp->isp_iocb);
+   MEMORYBARRIER(isp, SYNC_IFORDEV, 0, 2 * QENTRY_LEN, 
chan);
 
ISP_MEMZERO(, sizeof (mbs));
MBSINIT(, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 
500);
mbs.param[1] = QENTRY_LEN;
-   mbs.param[2] = DMA_WD1(fcp->isp_scdma);
-   mbs.param[3] = DMA_WD0(fcp->isp_scdma);
-   mbs.param[6] = DMA_WD3(fcp->isp_scdma);
-   mbs.param[7] = DMA_WD2(fcp->isp_scdma);
+   mbs.param[2] = DMA_WD1(isp->isp_iocb_dma);
+   mbs.param[3] = DMA_WD0(isp->isp_iocb_dma);
+   mbs.param[6] = DMA_WD3(isp->isp_iocb_dma);
+   mbs.param[7] = 

svn commit: r297857 - in head/sys: amd64/amd64 i386/i386 x86/include x86/x86

2016-04-12 Thread Andriy Gapon
Author: avg
Date: Tue Apr 12 13:30:39 2016
New Revision: 297857
URL: https://svnweb.freebsd.org/changeset/base/297857

Log:
  re-enable AMD Topology extension on certain models if disabled by BIOS
  
  Some BIOSes disable AMD Topology extension on AMD Family 15h notebook
  processors.  We re-enable the extension, so that we can properly discover
  core and cache topology.  Linux seems to do the same.
  
  Reported by:  Johannes Dieterich 
  Reviewed by:  jhb, kib
  Tested by:Johannes Dieterich 
(earlier version)
  MFC after:3 weeks
  Differential Revision:https://reviews.freebsd.org/D5883

Modified:
  head/sys/amd64/amd64/mp_machdep.c
  head/sys/i386/i386/mp_machdep.c
  head/sys/x86/include/specialreg.h
  head/sys/x86/include/x86_var.h
  head/sys/x86/x86/identcpu.c

Modified: head/sys/amd64/amd64/mp_machdep.c
==
--- head/sys/amd64/amd64/mp_machdep.c   Tue Apr 12 12:31:41 2016
(r297856)
+++ head/sys/amd64/amd64/mp_machdep.c   Tue Apr 12 13:30:39 2016
(r297857)
@@ -247,7 +247,7 @@ init_secondary(void)
wrmsr(MSR_FSBASE, 0);   /* User value */
wrmsr(MSR_GSBASE, (u_int64_t)pc);
wrmsr(MSR_KGSBASE, (u_int64_t)pc);  /* XXX User value while we're 
in the kernel */
-   intel_fix_cpuid();
+   fix_cpuid();
 
lidt(_idt);
 

Modified: head/sys/i386/i386/mp_machdep.c
==
--- head/sys/i386/i386/mp_machdep.c Tue Apr 12 12:31:41 2016
(r297856)
+++ head/sys/i386/i386/mp_machdep.c Tue Apr 12 13:30:39 2016
(r297857)
@@ -242,7 +242,7 @@ init_secondary(void)
pc->pc_prvspace = pc;
pc->pc_curthread = 0;
 
-   intel_fix_cpuid();
+   fix_cpuid();
 
gdt_segs[GPRIV_SEL].ssd_base = (int) pc;
gdt_segs[GPROC0_SEL].ssd_base = (int) >pc_common_tss;

Modified: head/sys/x86/include/specialreg.h
==
--- head/sys/x86/include/specialreg.h   Tue Apr 12 12:31:41 2016
(r297856)
+++ head/sys/x86/include/specialreg.h   Tue Apr 12 13:30:39 2016
(r297857)
@@ -816,6 +816,7 @@
 #defineMSR_P_STATE_CONFIG(n) (0xc0010064 + (n)) /* P-state Config */
 #defineMSR_SMM_ADDR0xc0010112  /* SMM TSEG base address */
 #defineMSR_SMM_MASK0xc0010113  /* SMM TSEG address mask */
+#defineMSR_EXTFEATURES 0xc0011005  /* Extended CPUID Features 
override */
 #defineMSR_IC_CFG  0xc0011021  /* Instruction Cache 
Configuration */
 #defineMSR_K8_UCODE_UPDATE 0xc0010020  /* update microcode */
 #defineMSR_MC0_CTL_MASK0xc0010044

Modified: head/sys/x86/include/x86_var.h
==
--- head/sys/x86/include/x86_var.h  Tue Apr 12 12:31:41 2016
(r297856)
+++ head/sys/x86/include/x86_var.h  Tue Apr 12 13:30:39 2016
(r297857)
@@ -103,7 +103,7 @@ voiddump_drop_page(vm_paddr_t);
 void   identify_cpu(void);
 void   initializecpu(void);
 void   initializecpucache(void);
-bool   intel_fix_cpuid(void);
+bool   fix_cpuid(void);
 void   fillw(int /*u_short*/ pat, void *base, size_t cnt);
 intis_physical_memory(vm_paddr_t addr);
 intisa_nmi(int cd);

Modified: head/sys/x86/x86/identcpu.c
==
--- head/sys/x86/x86/identcpu.c Tue Apr 12 12:31:41 2016(r297856)
+++ head/sys/x86/x86/identcpu.c Tue Apr 12 13:30:39 2016(r297857)
@@ -1342,23 +1342,22 @@ identify_hypervisor(void)
}
 }
 
-/*
- * Clear "Limit CPUID Maxval" bit and return true if the caller should
- * get the largest standard CPUID function number again if it is set
- * from BIOS.  It is necessary for probing correct CPU topology later
- * and for the correct operation of the AVX-aware userspace.
- */
 bool
-intel_fix_cpuid(void)
+fix_cpuid(void)
 {
uint64_t msr;
 
-   if (cpu_vendor_id != CPU_VENDOR_INTEL)
-   return (false);
-   if ((CPUID_TO_FAMILY(cpu_id) == 0xf &&
+   /*
+* Clear "Limit CPUID Maxval" bit and return true if the caller should
+* get the largest standard CPUID function number again if it is set
+* from BIOS.  It is necessary for probing correct CPU topology later
+* and for the correct operation of the AVX-aware userspace.
+*/
+   if (cpu_vendor_id == CPU_VENDOR_INTEL &&
+   ((CPUID_TO_FAMILY(cpu_id) == 0xf &&
CPUID_TO_MODEL(cpu_id) >= 0x3) ||
(CPUID_TO_FAMILY(cpu_id) == 0x6 &&
-   CPUID_TO_MODEL(cpu_id) >= 0xe)) {
+   CPUID_TO_MODEL(cpu_id) >= 0xe))) {
msr = rdmsr(MSR_IA32_MISC_ENABLE);
if ((msr & 

svn commit: r297856 - head/sys/dev/isp

2016-04-12 Thread Alexander Motin
Author: mav
Date: Tue Apr 12 12:31:41 2016
New Revision: 297856
URL: https://svnweb.freebsd.org/changeset/base/297856

Log:
  Reimplement ISP_TSK_MGMT IOCTL via asynchronous request.
  
  I am not sure this code is not completely dead, but it used DMA scratch
  are without good reason and asked to be refactored.

Modified:
  head/sys/dev/isp/isp_freebsd.c

Modified: head/sys/dev/isp/isp_freebsd.c
==
--- head/sys/dev/isp/isp_freebsd.c  Tue Apr 12 11:48:54 2016
(r297855)
+++ head/sys/dev/isp/isp_freebsd.c  Tue Apr 12 12:31:41 2016
(r297856)
@@ -607,9 +607,10 @@ ispioctl(struct cdev *dev, u_long c, cad
nphdl = fct->loopid;
ISP_LOCK(isp);
if (IS_24XX(isp)) {
-   uint8_t local[QENTRY_LEN];
-   isp24xx_tmf_t *tmf;
-   isp24xx_statusreq_t *sp;
+   void *reqp;
+   uint8_t resp[QENTRY_LEN];
+   isp24xx_tmf_t tmf;
+   isp24xx_statusreq_t sp;
fcparam *fcp = FCPARAM(isp, chan);
fcportdb_t *lp;
int i;
@@ -625,39 +626,37 @@ ispioctl(struct cdev *dev, u_long c, cad
ISP_UNLOCK(isp);
break;
}
-   /* XXX VALIDATE LP XXX */
-   tmf = (isp24xx_tmf_t *) local;
-   ISP_MEMZERO(tmf, QENTRY_LEN);
-   tmf->tmf_header.rqs_entry_type = RQSTYPE_TSK_MGMT;
-   tmf->tmf_header.rqs_entry_count = 1;
-   tmf->tmf_nphdl = lp->handle;
-   tmf->tmf_delay = 2;
-   tmf->tmf_timeout = 4;
-   tmf->tmf_tidlo = lp->portid;
-   tmf->tmf_tidhi = lp->portid >> 16;
-   tmf->tmf_vpidx = ISP_GET_VPIDX(isp, chan);
-   tmf->tmf_lun[1] = fct->lun & 0xff;
+   ISP_MEMZERO(, sizeof(tmf));
+   tmf.tmf_header.rqs_entry_type = RQSTYPE_TSK_MGMT;
+   tmf.tmf_header.rqs_entry_count = 1;
+   tmf.tmf_nphdl = lp->handle;
+   tmf.tmf_delay = 2;
+   tmf.tmf_timeout = 4;
+   tmf.tmf_tidlo = lp->portid;
+   tmf.tmf_tidhi = lp->portid >> 16;
+   tmf.tmf_vpidx = ISP_GET_VPIDX(isp, chan);
+   tmf.tmf_lun[1] = fct->lun & 0xff;
if (fct->lun >= 256) {
-   tmf->tmf_lun[0] = 0x40 | (fct->lun >> 8);
+   tmf.tmf_lun[0] = 0x40 | (fct->lun >> 8);
}
switch (fct->action) {
case IPT_CLEAR_ACA:
-   tmf->tmf_flags = ISP24XX_TMF_CLEAR_ACA;
+   tmf.tmf_flags = ISP24XX_TMF_CLEAR_ACA;
break;
case IPT_TARGET_RESET:
-   tmf->tmf_flags = ISP24XX_TMF_TARGET_RESET;
+   tmf.tmf_flags = ISP24XX_TMF_TARGET_RESET;
needmarker = 1;
break;
case IPT_LUN_RESET:
-   tmf->tmf_flags = ISP24XX_TMF_LUN_RESET;
+   tmf.tmf_flags = ISP24XX_TMF_LUN_RESET;
needmarker = 1;
break;
case IPT_CLEAR_TASK_SET:
-   tmf->tmf_flags = ISP24XX_TMF_CLEAR_TASK_SET;
+   tmf.tmf_flags = ISP24XX_TMF_CLEAR_TASK_SET;
needmarker = 1;
break;
case IPT_ABORT_TASK_SET:
-   tmf->tmf_flags = ISP24XX_TMF_ABORT_TASK_SET;
+   tmf.tmf_flags = ISP24XX_TMF_ABORT_TASK_SET;
needmarker = 1;
break;
default:
@@ -668,36 +667,52 @@ ispioctl(struct cdev *dev, u_long c, cad
ISP_UNLOCK(isp);
break;
}
-   MBSINIT(, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL,
-   MBCMD_DEFAULT_TIMEOUT + tmf->tmf_timeout * 100);
-   mbs.param[1] = QENTRY_LEN;
-   mbs.param[2] = DMA_WD1(fcp->isp_scdma);
-   mbs.param[3] = DMA_WD0(fcp->isp_scdma);
-   mbs.param[6] = DMA_WD3(fcp->isp_scdma);
-   mbs.param[7] = DMA_WD2(fcp->isp_scdma);
 
-   

svn commit: r297854 - head/sys/dev/isp

2016-04-12 Thread Alexander Motin
Author: mav
Date: Tue Apr 12 11:48:50 2016
New Revision: 297854
URL: https://svnweb.freebsd.org/changeset/base/297854

Log:
  Add couple missing memory barriers.

Modified:
  head/sys/dev/isp/isp.c

Modified: head/sys/dev/isp/isp.c
==
--- head/sys/dev/isp/isp.c  Tue Apr 12 10:25:44 2016(r297853)
+++ head/sys/dev/isp/isp.c  Tue Apr 12 11:48:50 2016(r297854)
@@ -2802,12 +2802,13 @@ isp_getpdb(ispsoftc_t *isp, int chan, ui
isp_prt(isp, ISP_LOGERR, sacq);
return (-1);
}
-   MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof (un), chan);
+   MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof(un), chan);
isp_mboxcmd(isp, );
if (mbs.param[0] != MBOX_COMMAND_COMPLETE) {
FC_SCRATCH_RELEASE(isp, chan);
return (mbs.param[0] | (mbs.param[1] << 16));
}
+   MEMORYBARRIER(isp, SYNC_SFORCPU, 0, sizeof(un), chan);
if (IS_24XX(isp)) {
isp_get_pdb_24xx(isp, fcp->isp_scratch, );
pdb->handle = un.bill.pdb_handle;
@@ -2875,6 +2876,7 @@ isp_gethandles(ispsoftc_t *isp, int chan
FC_SCRATCH_RELEASE(isp, chan);
return (mbs.param[0] | (mbs.param[1] << 16));
}
+   MEMORYBARRIER(isp, SYNC_SFORCPU, 0, ISP_FC_SCRLEN, chan);
elp1 = fcp->isp_scratch;
elp3 = fcp->isp_scratch;
elp4 = fcp->isp_scratch;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297855 - head/sys/netinet

2016-04-12 Thread Michael Tuexen
Author: tuexen
Date: Tue Apr 12 11:48:54 2016
New Revision: 297855
URL: https://svnweb.freebsd.org/changeset/base/297855

Log:
  When processing an ICMP packet containing an SCTP packet, it
  is required to check the verification tag. However, this
  requires the verification tag to be not 0. Enforce this.
  For packets with a verification tag of 0, we need to
  check it it contains an INIT chunk and use the initiate
  tag for the validation. This will be a separate commit,
  since it touches also other code.
  
  MFC after: 1 week

Modified:
  head/sys/netinet/sctp_usrreq.c
  head/sys/netinet/sctp_var.h

Modified: head/sys/netinet/sctp_usrreq.c
==
--- head/sys/netinet/sctp_usrreq.c  Tue Apr 12 11:48:50 2016
(r297854)
+++ head/sys/netinet/sctp_usrreq.c  Tue Apr 12 11:48:54 2016
(r297855)
@@ -147,26 +147,19 @@ static void
 sctp_notify_mbuf(struct sctp_inpcb *inp,
 struct sctp_tcb *stcb,
 struct sctp_nets *net,
-struct ip *ip,
-struct sctphdr *sh)
+struct ip *ip)
 {
struct icmp *icmph;
int totsz, tmr_stopped = 0;
uint16_t nxtsz;
 
/* protection */
-   if ((inp == NULL) || (stcb == NULL) || (net == NULL) ||
-   (ip == NULL) || (sh == NULL)) {
+   if ((inp == NULL) || (stcb == NULL) || (net == NULL) || (ip == NULL)) {
if (stcb != NULL) {
SCTP_TCB_UNLOCK(stcb);
}
return;
}
-   /* First job is to verify the vtag matches what I would send */
-   if (ntohl(sh->v_tag) != (stcb->asoc.peer_vtag)) {
-   SCTP_TCB_UNLOCK(stcb);
-   return;
-   }
icmph = (struct icmp *)((caddr_t)ip - (sizeof(struct icmp) -
sizeof(struct ip)));
if (icmph->icmp_type != ICMP_UNREACH) {
@@ -213,10 +206,9 @@ sctp_notify_mbuf(struct sctp_inpcb *inp,
SCTP_TCB_UNLOCK(stcb);
 }
 
-void
+static void
 sctp_notify(struct sctp_inpcb *inp,
 struct ip *ip,
-struct sctphdr *sh,
 struct sockaddr *to,
 struct sctp_tcb *stcb,
 struct sctp_nets *net)
@@ -228,17 +220,11 @@ sctp_notify(struct sctp_inpcb *inp,
struct icmp *icmph;
 
/* protection */
-   if ((inp == NULL) || (stcb == NULL) || (net == NULL) ||
-   (sh == NULL) || (to == NULL)) {
+   if ((inp == NULL) || (stcb == NULL) || (net == NULL) || (to == NULL)) {
if (stcb)
SCTP_TCB_UNLOCK(stcb);
return;
}
-   /* First job is to verify the vtag matches what I would send */
-   if (ntohl(sh->v_tag) != (stcb->asoc.peer_vtag)) {
-   SCTP_TCB_UNLOCK(stcb);
-   return;
-   }
icmph = (struct icmp *)((caddr_t)ip - (sizeof(struct icmp) -
sizeof(struct ip)));
if (icmph->icmp_type != ICMP_UNREACH) {
@@ -304,10 +290,7 @@ sctp_notify(struct sctp_inpcb *inp,
 
 #ifdef INET
 void
-sctp_ctlinput(cmd, sa, vip)
-   int cmd;
-   struct sockaddr *sa;
-   void *vip;
+sctp_ctlinput(int cmd, struct sockaddr *sa, void *vip)
 {
struct ip *ip = vip;
struct sctphdr *sh;
@@ -348,14 +331,37 @@ sctp_ctlinput(cmd, sa, vip)
stcb = sctp_findassociation_addr_sa((struct sockaddr *),
(struct sockaddr *),
, , 1, vrf_id);
-   if (stcb != NULL && inp && (inp->sctp_socket != NULL)) {
+   if ((stcb != NULL) &&
+   (inp != NULL) &&
+   (inp->sctp_socket != NULL)) {
+   /* Check the verification tag */
+   if (ntohl(sh->v_tag) != 0) {
+   /*
+* This must be the verification tag used
+* for sending out packets. We don't
+* consider packets reflecting the
+* verification tag.
+*/
+   if (ntohl(sh->v_tag) != (stcb->asoc.peer_vtag)) 
{
+   SCTP_TCB_UNLOCK(stcb);
+   return;
+   }
+   } else {
+   /*
+* In this case we could check if we got an
+* INIT chunk and if the initiate tag
+* matches. But this is not there yet...
+*/
+   SCTP_TCB_UNLOCK(stcb);
+   return;
+   }
if (cmd != PRC_MSGSIZE) {
-   sctp_notify(inp, ip, sh,
+   sctp_notify(inp, ip,
(struct sockaddr *), stcb,
net);

svn commit: r297853 - head/lib/libthr/thread

2016-04-12 Thread Konstantin Belousov
Author: kib
Date: Tue Apr 12 10:25:44 2016
New Revision: 297853
URL: https://svnweb.freebsd.org/changeset/base/297853

Log:
  If off-page lookup failed, there is no memory to perform
  shared_mutex_init() upon.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/lib/libthr/thread/thr_mutex.c

Modified: head/lib/libthr/thread/thr_mutex.c
==
--- head/lib/libthr/thread/thr_mutex.c  Tue Apr 12 07:54:55 2016
(r297852)
+++ head/lib/libthr/thread/thr_mutex.c  Tue Apr 12 10:25:44 2016
(r297853)
@@ -476,7 +476,8 @@ check_and_init_mutex(pthread_mutex_t *mu
*m = __thr_pshared_offpage(mutex, 0);
if (*m == NULL)
ret = EINVAL;
-   shared_mutex_init(*m, NULL);
+   else
+   shared_mutex_init(*m, NULL);
} else if (__predict_false(*m <= THR_MUTEX_DESTROYED)) {
if (*m == THR_MUTEX_DESTROYED) {
ret = EINVAL;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r296548 - in head/sys: dev/agp dev/drm2 dev/drm2/i915 modules/drm2/i915kms

2016-04-12 Thread Edward Tomasz Napierała
I have the exact same problem on T420.  Switching consoles back and forth
works as a workaround.

On 0411T1633, Adrian Chadd wrote:
> hiya,
> 
> My x230 backlight doesn't come back on after I suspend/resume :( Any
> ideas? does it work fine for you?
> 
> 
> 
> -adrian
> 
> 
> On 9 March 2016 at 17:31, Conrad Meyer  wrote:
> > On Wed, Mar 9, 2016 at 12:48 PM, Adrian Chadd  
> > wrote:
> >> Woo!
> >>
> >> Just so its' not lost - people in irc have found power consumption has
> >> jumped dramatically since this commit. :(
> >
> > For the record, on X230 (Ivybridge) I actually see lower power
> > consumption with the new 3.8 kms:
> >
> > (All at brightness 100)
> > Old kernel, no KMS:  11W
> > Old kernel, KMS:  13W
> > New kernel, no KMS:  11W
> > New kernel, KMS:  11W
> >
> > With brightness down to minimum (5%):
> > New kernel, KMS:  8.9W
> >
> > Best,
> > Conrad
> 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r296548 - in head/sys: dev/agp dev/drm2 dev/drm2/i915 modules/drm2/i915kms

2016-04-12 Thread Jean-Sébastien Pédron
On 12/04/2016 01:33, Adrian Chadd wrote:
> hiya,

Hi!

> My x230 backlight doesn't come back on after I suspend/resume :( Any
> ideas? does it work fine for you?

I don't know, I never had a single laptop where suspend/resume worked :(

-- 
Jean-Sébastien Pédron



signature.asc
Description: OpenPGP digital signature


svn commit: r297852 - in stable/10/sys/dev: sound/pci/hda usb/controller

2016-04-12 Thread Alexander Motin
Author: mav
Date: Tue Apr 12 07:54:55 2016
New Revision: 297852
URL: https://svnweb.freebsd.org/changeset/base/297852

Log:
  MFC r297387: Add some device IDs found on AMD FCH shipsets.

Modified:
  stable/10/sys/dev/sound/pci/hda/hdac.c
  stable/10/sys/dev/sound/pci/hda/hdac.h
  stable/10/sys/dev/usb/controller/ehci_pci.c
  stable/10/sys/dev/usb/controller/ohci_pci.c
  stable/10/sys/dev/usb/controller/xhci_pci.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sound/pci/hda/hdac.c
==
--- stable/10/sys/dev/sound/pci/hda/hdac.c  Tue Apr 12 07:54:03 2016
(r297851)
+++ stable/10/sys/dev/sound/pci/hda/hdac.c  Tue Apr 12 07:54:55 2016
(r297852)
@@ -159,6 +159,7 @@ static const struct {
{ HDA_ATI_RV940, "ATI RV940",   0, 0 },
{ HDA_ATI_RV970, "ATI RV970",   0, 0 },
{ HDA_ATI_R1000, "ATI R1000",   0, 0 },
+   { HDA_AMD_HUDSON2,   "AMD Hudson-2",0, 0 },
{ HDA_RDC_M3010, "RDC M3010",   0, 0 },
{ HDA_VIA_VT82XX,"VIA VT8251/8237A",0, 0 },
{ HDA_SIS_966,   "SiS 966", 0, 0 },
@@ -167,6 +168,7 @@ static const struct {
{ HDA_INTEL_ALL,  "Intel",  0, 0 },
{ HDA_NVIDIA_ALL, "NVIDIA", 0, 0 },
{ HDA_ATI_ALL,"ATI",0, 0 },
+   { HDA_AMD_ALL,"AMD",0, 0 },
{ HDA_VIA_ALL,"VIA",0, 0 },
{ HDA_SIS_ALL,"SiS",0, 0 },
{ HDA_ULI_ALL,"ULI",0, 0 },

Modified: stable/10/sys/dev/sound/pci/hda/hdac.h
==
--- stable/10/sys/dev/sound/pci/hda/hdac.h  Tue Apr 12 07:54:03 2016
(r297851)
+++ stable/10/sys/dev/sound/pci/hda/hdac.h  Tue Apr 12 07:54:55 2016
(r297852)
@@ -136,6 +136,10 @@
 #define HDA_ATI_R1000  HDA_MODEL_CONSTRUCT(ATI, 0xaaa0)
 #define HDA_ATI_ALLHDA_MODEL_CONSTRUCT(ATI, 0x)
 
+#define AMD_VENDORID   0x1022
+#define HDA_AMD_HUDSON2HDA_MODEL_CONSTRUCT(AMD, 0x780d)
+#define HDA_AMD_ALLHDA_MODEL_CONSTRUCT(AMD, 0x)
+
 /* RDC */
 #define RDC_VENDORID   0x17f3
 #define HDA_RDC_M3010  HDA_MODEL_CONSTRUCT(RDC, 0x3010)

Modified: stable/10/sys/dev/usb/controller/ehci_pci.c
==
--- stable/10/sys/dev/usb/controller/ehci_pci.c Tue Apr 12 07:54:03 2016
(r297851)
+++ stable/10/sys/dev/usb/controller/ehci_pci.c Tue Apr 12 07:54:55 2016
(r297852)
@@ -112,6 +112,8 @@ ehci_pci_match(device_t self)
 
case 0x20951022:
return ("AMD CS5536 (Geode) USB 2.0 controller");
+   case 0x78081022:
+   return ("AMD FCH USB 2.0 controller");
 
case 0x43451002:
return "ATI SB200 USB 2.0 controller";

Modified: stable/10/sys/dev/usb/controller/ohci_pci.c
==
--- stable/10/sys/dev/usb/controller/ohci_pci.c Tue Apr 12 07:54:03 2016
(r297851)
+++ stable/10/sys/dev/usb/controller/ohci_pci.c Tue Apr 12 07:54:55 2016
(r297852)
@@ -124,9 +124,10 @@ ohci_pci_match(device_t self)
 
case 0x740c1022:
return ("AMD-756 USB Controller");
-
case 0x74141022:
return ("AMD-766 USB Controller");
+   case 0x78071022:
+   return ("AMD FCH USB Controller");
 
case 0x43741002:
return "ATI SB400 USB Controller";

Modified: stable/10/sys/dev/usb/controller/xhci_pci.c
==
--- stable/10/sys/dev/usb/controller/xhci_pci.c Tue Apr 12 07:54:03 2016
(r297851)
+++ stable/10/sys/dev/usb/controller/xhci_pci.c Tue Apr 12 07:54:55 2016
(r297852)
@@ -95,6 +95,9 @@ xhci_pci_match(device_t self)
uint32_t device_id = pci_get_devid(self);
 
switch (device_id) {
+   case 0x78141022:
+   return ("AMD FCH USB 3.0 controller");
+
case 0x01941033:
return ("NEC uPD720200 USB 3.0 controller");
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297851 - in stable/10: share/man/man4 sys/dev/amdsbwd

2016-04-12 Thread Alexander Motin
Author: mav
Date: Tue Apr 12 07:54:03 2016
New Revision: 297851
URL: https://svnweb.freebsd.org/changeset/base/297851

Log:
  MFC r297386: Add support for AMD FCH watchdog timers.

Modified:
  stable/10/share/man/man4/amdsbwd.4
  stable/10/sys/dev/amdsbwd/amdsbwd.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/man/man4/amdsbwd.4
==
--- stable/10/share/man/man4/amdsbwd.4  Tue Apr 12 07:21:22 2016
(r297850)
+++ stable/10/share/man/man4/amdsbwd.4  Tue Apr 12 07:54:03 2016
(r297851)
@@ -25,12 +25,12 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 7, 2011
+.Dd March 29, 2016
 .Dt AMDSBWD 4
 .Os
 .Sh NAME
 .Nm amdsbwd
-.Nd device driver for the AMD SB600/SB7xx/SB8xx watchdog timers
+.Nd device driver for the AMD southbridge watchdog timers
 .Sh SYNOPSIS
 To compile this driver into the kernel,
 place the following line in your
@@ -51,7 +51,7 @@ The
 driver provides
 .Xr watchdog 4
 support for the watchdog timers present on
-AMD SB600, SB7xx and SB8xx southbridges.
+AMD SB600, SB7xx, SB8xx and SB9xx southbridges and Axx FCHs.
 .Sh SEE ALSO
 .Xr watchdog 4 ,
 .Xr watchdog 8 ,

Modified: stable/10/sys/dev/amdsbwd/amdsbwd.c
==
--- stable/10/sys/dev/amdsbwd/amdsbwd.c Tue Apr 12 07:21:22 2016
(r297850)
+++ stable/10/sys/dev/amdsbwd/amdsbwd.c Tue Apr 12 07:54:03 2016
(r297851)
@@ -106,6 +106,8 @@ __FBSDID("$FreeBSD$");
 /* SB7xx RRG 2.3.1.1, SB600 RRG 2.3.1.1, SB8xx RRG 2.3.1.  */
 #defineAMDSB_SMBUS_DEVID   0x43851002
 #defineAMDSB8_SMBUS_REVID  0x40
+#defineAMDHUDSON_SMBUS_DEVID   0x780b1022
+#defineAMDKERNCZ_SMBUS_DEVID   0x790b1022
 
 #defineamdsbwd_verbose_printf(dev, ...)\
do {\
@@ -279,7 +281,9 @@ amdsbwd_identify(driver_t *driver, devic
smb_dev = pci_find_bsf(0, 20, 0);
if (smb_dev == NULL)
return;
-   if (pci_get_devid(smb_dev) != AMDSB_SMBUS_DEVID)
+   if (pci_get_devid(smb_dev) != AMDSB_SMBUS_DEVID &&
+   pci_get_devid(smb_dev) != AMDHUDSON_SMBUS_DEVID &&
+   pci_get_devid(smb_dev) != AMDKERNCZ_SMBUS_DEVID)
return;
 
child = BUS_ADD_CHILD(parent, ISA_ORDER_SPECULATIVE, "amdsbwd", -1);
@@ -309,10 +313,12 @@ amdsbwd_probe_sb7xx(device_t dev, struct
*addr <<= 8;
*addr |= pmio_read(pmres, AMDSB_PM_WDT_BASE_MSB - i);
}
+   *addr &= ~0x07u;
+
/* Set watchdog timer tick to 1s. */
val = pmio_read(pmres, AMDSB_PM_WDT_CTRL);
val &= ~AMDSB_WDT_RES_MASK;
-   val |= AMDSB_WDT_RES_10MS;
+   val |= AMDSB_WDT_RES_1S;
pmio_write(pmres, AMDSB_PM_WDT_CTRL, val);
 
/* Enable watchdog device (in stopped state). */
@@ -372,7 +378,7 @@ amdsbwd_probe_sb8xx(device_t dev, struct
val = pmio_read(pmres, AMDSB8_PM_WDT_EN);
device_printf(dev, "AMDSB8_PM_WDT_EN value = %#02x\n", val);
 #endif
-   device_set_desc(dev, "AMD SB8xx Watchdog Timer");
+   device_set_desc(dev, "AMD SB8xx/SB9xx/Axx Watchdog Timer");
 }
 
 static int
@@ -404,7 +410,8 @@ amdsbwd_probe(device_t dev)
 
smb_dev = pci_find_bsf(0, 20, 0);
KASSERT(smb_dev != NULL, ("can't find SMBus PCI device\n"));
-   if (pci_get_revid(smb_dev) < AMDSB8_SMBUS_REVID)
+   if (pci_get_devid(smb_dev) == AMDSB_SMBUS_DEVID &&
+   pci_get_revid(smb_dev) < AMDSB8_SMBUS_REVID)
amdsbwd_probe_sb7xx(dev, res, );
else
amdsbwd_probe_sb8xx(dev, res, );
@@ -440,10 +447,7 @@ amdsbwd_attach_sb(device_t dev, struct a
 
smb_dev = pci_find_bsf(0, 20, 0);
KASSERT(smb_dev != NULL, ("can't find SMBus PCI device\n"));
-   if (pci_get_revid(smb_dev) < AMDSB8_SMBUS_REVID)
-   sc->ms_per_tick = 10;
-   else
-   sc->ms_per_tick = 1000;
+   sc->ms_per_tick = 1000;
 
sc->res_ctrl = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
>rid_ctrl, RF_ACTIVE);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297850 - head/sys/mips/mediatek

2016-04-12 Thread Stanislav Galabov
Author: sgalabov
Date: Tue Apr 12 07:21:22 2016
New Revision: 297850
URL: https://svnweb.freebsd.org/changeset/base/297850

Log:
  Move Mediatek/Ralink PCIe to NEW_PCIB
  
  This revision fixes minor issues and moves the Mediatek/Ralink PCIe
  support to use NEW_PCIB.
  
  https://svnweb.freebsd.org/changeset/base/297849 is the other part of
  this changeset.
  
  Approved by:  adrian (mentor)
  Sponsored by: Smartcom - Bulgaria AD
  Differential Revision:https://reviews.freebsd.org/D5908

Modified:
  head/sys/mips/mediatek/mtk_pcie.c
  head/sys/mips/mediatek/mtk_pcie.h

Modified: head/sys/mips/mediatek/mtk_pcie.c
==
--- head/sys/mips/mediatek/mtk_pcie.c   Tue Apr 12 07:18:48 2016
(r297849)
+++ head/sys/mips/mediatek/mtk_pcie.c   Tue Apr 12 07:21:22 2016
(r297850)
@@ -21,15 +21,6 @@
  * 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.
- *
- * The pci allocator parts are based on code from sys/dev/arm/mv/:
- *
- * Copyright (c) 2008 MARVELL INTERNATIONAL LTD.
- * Copyright (c) 2010 The FreeBSD Foundation
- * Copyright (c) 2010-2012 Semihalf
- * All rights reserved.
- *
- * Developed by Semihalf.
  */
 #include 
 __FBSDID("$FreeBSD$");
@@ -72,6 +63,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include "ofw_bus_if.h"
 #include "pcib_if.h"
 #include "pic_if.h"
 
@@ -98,7 +90,6 @@ static void mtk_pcie_phy_setup_slots(dev
 struct mtx mtk_pci_mtx;
 MTX_SYSINIT(mtk_pci_mtx, _pci_mtx, "MTK PCIe mutex", MTX_SPIN);
 
-static int mtk_pcib_init(device_t, int, int);
 static int mtk_pci_intr(void *);
 
 static struct mtk_pci_softc *mt_sc = NULL;
@@ -340,9 +331,6 @@ mtk_pci_attach(device_t dev)
}
}
 
-   /* Do generic PCIe initialization and resource allocation */
-   mtk_pcib_init(dev, 0, PCI_SLOTMAX);
-
/* Attach our PCI child so bus enumeration can start */
if (device_add_child(dev, "pci", -1) == NULL) {
device_printf(dev, "could not attach pci bus\n");
@@ -426,6 +414,9 @@ mtk_pci_alloc_resource(device_t bus, dev
struct rman *rm;
 
switch (type) {
+   case PCI_RES_BUS:
+   return pci_domain_alloc_bus(0, child, rid, start, end, count,
+   flags);
case SYS_RES_IRQ:
rm = >sc_irq_rman;
break;
@@ -456,6 +447,47 @@ mtk_pci_alloc_resource(device_t bus, dev
return (rv);
 }
 
+static int
+mtk_pci_release_resource(device_t bus, device_t child, int type, int rid,
+struct resource *res)
+{
+
+   if (type == PCI_RES_BUS)
+   return (pci_domain_release_bus(0, child, rid, res));
+
+   return (bus_generic_release_resource(bus, child, type, rid, res));
+}
+
+static int
+mtk_pci_adjust_resource(device_t bus, device_t child, int type,
+struct resource *res, rman_res_t start, rman_res_t end)
+{
+   struct mtk_pci_softc *sc = device_get_softc(bus);
+   struct rman *rm;
+
+   switch (type) {
+   case PCI_RES_BUS:
+   return pci_domain_adjust_bus(0, child, res, start, end);
+   case SYS_RES_IRQ:
+   rm = >sc_irq_rman;
+   break;
+   case SYS_RES_IOPORT:
+   rm = >sc_io_rman;
+   break;
+   case SYS_RES_MEMORY:
+   rm = >sc_mem_rman;
+   break;
+   default:
+   rm = NULL;
+   break;
+   }
+
+   if (rm != NULL)
+   return (rman_adjust_resource(res, start, end));
+
+   return (bus_generic_adjust_resource(bus, child, type, res, start, end));
+}
+
 static inline int
 mtk_idx_to_irq(int idx)
 {
@@ -643,22 +675,15 @@ mtk_pci_write_config(device_t dev, u_int
mtx_unlock_spin(_pci_mtx);
 }
 
-#if 0
-/* We take care of interrupt routing in the allocator code below */
 static int
 mtk_pci_route_interrupt(device_t pcib, device_t device, int pin)
 {
-   //struct mtk_pci_softc *sc = device_get_softc(pcib);
int bus, sl, dev;
 
-   if (1) return PCI_INVALID_IRQ;
-
bus = pci_get_bus(device);
sl = pci_get_slot(device);
dev = pci_get_device(device);
 
-   printf("%s: for %d:%d:%d, int = %d\n", __FUNCTION__, bus, sl, dev, pin);
-
if (bus != 0)
panic("Unexpected bus number %d\n", bus);
 
@@ -672,7 +697,6 @@ mtk_pci_route_interrupt(device_t pcib, d
 
return (-1);
 }
-#endif
 
 static device_method_t mtk_pci_methods[] = {
/* Device interface */
@@ -686,7 +710,8 @@ static device_method_t mtk_pci_methods[]
DEVMETHOD(bus_read_ivar,mtk_pci_read_ivar),
DEVMETHOD(bus_write_ivar,   mtk_pci_write_ivar),
DEVMETHOD(bus_alloc_resource,   mtk_pci_alloc_resource),
-   DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+   

svn commit: r297849 - head/sys/mips/include

2016-04-12 Thread Stanislav Galabov
Author: sgalabov
Date: Tue Apr 12 07:18:48 2016
New Revision: 297849
URL: https://svnweb.freebsd.org/changeset/base/297849

Log:
  Define PCI_RES_BUS for MIPS.
  
  This is done as part of the work on D5908, but as a separate commit.
  
  Approved by:  adrian (mentor)
  Sponsored by: Smartcom - Bulgaria AD

Modified:
  head/sys/mips/include/resource.h

Modified: head/sys/mips/include/resource.h
==
--- head/sys/mips/include/resource.hTue Apr 12 06:56:35 2016
(r297848)
+++ head/sys/mips/include/resource.hTue Apr 12 07:18:48 2016
(r297849)
@@ -42,5 +42,8 @@
 #defineSYS_RES_DRQ 2   /* isa dma lines */
 #defineSYS_RES_MEMORY  3   /* i/o memory */
 #defineSYS_RES_IOPORT  4   /* i/o ports */
+#ifdef NEW_PCIB
+#definePCI_RES_BUS 5
+#endif
 
 #endif /* !_MACHINE_RESOURCE_H_ */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297848 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-04-12 Thread Andriy Gapon
Author: avg
Date: Tue Apr 12 06:56:35 2016
New Revision: 297848
URL: https://svnweb.freebsd.org/changeset/base/297848

Log:
  l2arc: make sure that all writes honor ashift of a cache device
  
  Previously uncompressed buffers did not obey that rule.
  
  Type of b_asize is changed to uint64_t for consistency,
  given that this is a zeta-byte filesystem.
  
  l2arc_compress_buf is renamed to l2arc_transform_buf to better reflect
  its new utility.  Now not only we ensure that a compressed buffer has
  a size aligned to ashift, but we also allocate a properly sized
  temporary buffer if the original buffer is not compressed and it has
  an odd size.  This ensures that all I/O to the cache device is always
  ashift-aligned, in terms of both a request offset and a request size.
  
  If the aligned data is larger than the original data, then we have to use
  a temporary buffer when reading it as well.
  
  Also, enhance physical zio alignment checks using vdev_logical_ashift.
  On FreeBSD we have this information, so we can make stricter assertions.
  
  Reviewed by: smh, mav
  MFC after:1 month
  Sponsored by: ClusterHQ
  Differential Revision: https://reviews.freebsd.org/D2789

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c   Tue Apr 12 
06:54:18 2016(r297847)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c   Tue Apr 12 
06:56:35 2016(r297848)
@@ -563,6 +563,7 @@ typedef struct arc_stats {
kstat_named_t arcstat_l2_compress_successes;
kstat_named_t arcstat_l2_compress_zeros;
kstat_named_t arcstat_l2_compress_failures;
+   kstat_named_t arcstat_l2_padding_needed;
kstat_named_t arcstat_l2_write_trylock_fail;
kstat_named_t arcstat_l2_write_passed_headroom;
kstat_named_t arcstat_l2_write_spa_mismatch;
@@ -664,6 +665,7 @@ static arc_stats_t arc_stats = {
{ "l2_compress_successes",  KSTAT_DATA_UINT64 },
{ "l2_compress_zeros",  KSTAT_DATA_UINT64 },
{ "l2_compress_failures",   KSTAT_DATA_UINT64 },
+   { "l2_padding_needed",  KSTAT_DATA_UINT64 },
{ "l2_write_trylock_fail",  KSTAT_DATA_UINT64 },
{ "l2_write_passed_headroom",   KSTAT_DATA_UINT64 },
{ "l2_write_spa_mismatch",  KSTAT_DATA_UINT64 },
@@ -837,7 +839,7 @@ typedef struct l1arc_buf_hdr {
refcount_t  b_refcnt;
 
arc_callback_t  *b_acb;
-   /* temporary buffer holder for in-flight compressed data */
+   /* temporary buffer holder for in-flight compressed or padded data */
void*b_tmp_cdata;
 } l1arc_buf_hdr_t;
 
@@ -1098,6 +1100,7 @@ typedef struct l2arc_read_callback {
zbookmark_phys_tl2rcb_zb;   /* original bookmark */
int l2rcb_flags;/* original flags */
enum zio_compress   l2rcb_compress; /* applied compress */
+   void*l2rcb_data;/* temporary buffer */
 } l2arc_read_callback_t;
 
 typedef struct l2arc_write_callback {
@@ -1128,7 +1131,7 @@ static uint32_t arc_bufc_to_flags(arc_bu
 static boolean_t l2arc_write_eligible(uint64_t, arc_buf_hdr_t *);
 static void l2arc_read_done(zio_t *);
 
-static boolean_t l2arc_compress_buf(arc_buf_hdr_t *);
+static boolean_t l2arc_transform_buf(arc_buf_hdr_t *, boolean_t);
 static void l2arc_decompress_zio(zio_t *, arc_buf_hdr_t *, enum zio_compress);
 static void l2arc_release_cdata_buf(arc_buf_hdr_t *);
 
@@ -2215,6 +2218,8 @@ arc_buf_data_free(arc_buf_t *buf, void (
 static void
 arc_buf_l2_cdata_free(arc_buf_hdr_t *hdr)
 {
+   size_t align, asize, len;
+
ASSERT(HDR_HAS_L2HDR(hdr));
ASSERT(MUTEX_HELD(>b_l2hdr.b_dev->l2ad_mtx));
 
@@ -2236,16 +2241,15 @@ arc_buf_l2_cdata_free(arc_buf_hdr_t *hdr
}
 
/*
-* The header does not have compression enabled. This can be due
-* to the buffer not being compressible, or because we're
-* freeing the buffer before the second phase of
-* l2arc_write_buffer() has started (which does the compression
-* step). In either case, b_tmp_cdata does not point to a
-* separately compressed buffer, so there's nothing to free (it
-* points to the same buffer as the arc_buf_t's b_data field).
-*/
-   if (hdr->b_l2hdr.b_compress == ZIO_COMPRESS_OFF) {
-   hdr->b_l1hdr.b_tmp_cdata = NULL;
+* The bufer has been chosen for writing to L2ARC, but it's
+* not being written just yet.  In other words,
+* b_tmp_cdata points to exactly the same buffer as b_data,
+* l2arc_transform_buf hasn't been called.
+*/
+ 

svn commit: r297847 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-04-12 Thread Andriy Gapon
Author: avg
Date: Tue Apr 12 06:54:18 2016
New Revision: 297847
URL: https://svnweb.freebsd.org/changeset/base/297847

Log:
  Revert r297396 Modify "4958 zdb trips assert on pools with ashift >= 0xe"
  
  A better fix is following.

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c   Tue Apr 12 
06:46:54 2016(r297846)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c   Tue Apr 12 
06:54:18 2016(r297847)
@@ -2777,19 +2777,10 @@ zio_vdev_io_start(zio_t *zio)
(void) atomic_cas_64(>spa_last_io, old, new);
}
 
-#ifdef illumos
align = 1ULL << vd->vdev_top->vdev_ashift;
 
if (!(zio->io_flags & ZIO_FLAG_PHYSICAL) &&
P2PHASE(zio->io_size, align) != 0) {
-#else
-   if (zio->io_flags & ZIO_FLAG_PHYSICAL)
-   align = 1ULL << vd->vdev_top->vdev_logical_ashift;
-   else
-   align = 1ULL << vd->vdev_top->vdev_ashift;
-
-   if (P2PHASE(zio->io_size, align) != 0) {
-#endif
/* Transform logical writes to be a full physical block size. */
uint64_t asize = P2ROUNDUP(zio->io_size, align);
char *abuf = NULL;
@@ -2805,7 +2796,6 @@ zio_vdev_io_start(zio_t *zio)
zio_subblock);
}
 
-#ifdef illumos
/*
 * If this is not a physical io, make sure that it is properly aligned
 * before proceeding.
@@ -2821,10 +2811,6 @@ zio_vdev_io_start(zio_t *zio)
ASSERT0(P2PHASE(zio->io_offset, SPA_MINBLOCKSIZE));
ASSERT0(P2PHASE(zio->io_size, SPA_MINBLOCKSIZE));
}
-#else
-   ASSERT0(P2PHASE(zio->io_offset, align));
-   ASSERT0(P2PHASE(zio->io_size, align));
-#endif
 
VERIFY(zio->io_type == ZIO_TYPE_READ || spa_writeable(spa));
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r297846 - head/sys/amd64/amd64

2016-04-12 Thread Andriy Gapon
Author: avg
Date: Tue Apr 12 06:46:54 2016
New Revision: 297846
URL: https://svnweb.freebsd.org/changeset/base/297846

Log:
  [amd64] dtrace_invop handler is to be called only for kernel exceptions
  
  DTrace-related exceptions in userland code are handled elsewhere.
  One practical problem was a crash in dtrace_invop_start() when saved
  %rsp pointed to a virtual address that was not backed.
  
  i386 code already ignored userland exceptions.
  
  Reviewed by: markj, kib
  MFC after:2 weeks
  Differential Revision: https://reviews.freebsd.org/D5906

Modified:
  head/sys/amd64/amd64/exception.S

Modified: head/sys/amd64/amd64/exception.S
==
--- head/sys/amd64/amd64/exception.STue Apr 12 03:55:33 2016
(r297845)
+++ head/sys/amd64/amd64/exception.STue Apr 12 06:46:54 2016
(r297846)
@@ -211,6 +211,8 @@ alltraps_pushregs_no_rdi:
 * interrupt. For all other trap types, just handle them in
 * the usual way.
 */
+   testb   $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */
+   jnz calltrap/* ignore userland traps */
cmpl$T_BPTFLT,TF_TRAPNO(%rsp)
jne calltrap
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"