svn commit: r318221 - head/sys/dev/iwm

2017-05-11 Thread Adrian Chadd
Author: adrian
Date: Fri May 12 05:53:28 2017
New Revision: 318221
URL: https://svnweb.freebsd.org/changeset/base/318221

Log:
  [iwm] Deduplicate code in iwm_auth() from an if condition.
  
  Obtained from:dragonflybsd.git 
03c6e6970115727c9d39f9358e0500ab4f4634cd

Modified:
  head/sys/dev/iwm/if_iwm.c

Modified: head/sys/dev/iwm/if_iwm.c
==
--- head/sys/dev/iwm/if_iwm.c   Fri May 12 05:51:50 2017(r318220)
+++ head/sys/dev/iwm/if_iwm.c   Fri May 12 05:53:28 2017(r318221)
@@ -4152,24 +4152,6 @@ iwm_auth(struct ieee80211vap *vap, struc
"%s: failed to update MAC\n", __func__);
goto out;
}
-   if ((error = iwm_mvm_phy_ctxt_changed(sc, >sc_phyctxt[0],
-   in->in_ni.ni_chan, 1, 1)) != 0) {
-   device_printf(sc->sc_dev,
-   "%s: failed update phy ctxt\n", __func__);
-   goto out;
-   }
-   iv->phy_ctxt = >sc_phyctxt[0];
-
-   if ((error = iwm_mvm_binding_add_vif(sc, iv)) != 0) {
-   device_printf(sc->sc_dev,
-   "%s: binding update cmd\n", __func__);
-   goto out;
-   }
-   if ((error = iwm_mvm_add_sta(sc, in)) != 0) {
-   device_printf(sc->sc_dev,
-   "%s: failed to add sta\n", __func__);
-   goto out;
-   }
} else {
if ((error = iwm_mvm_mac_ctxt_add(sc, vap)) != 0) {
device_printf(sc->sc_dev,
@@ -4182,25 +4164,25 @@ iwm_auth(struct ieee80211vap *vap, struc
__func__);
goto out;
}
-   if ((error = iwm_mvm_phy_ctxt_changed(sc, >sc_phyctxt[0],
-   in->in_ni.ni_chan, 1, 1)) != 0) {
-   device_printf(sc->sc_dev,
-   "%s: failed add phy ctxt!\n", __func__);
-   error = ETIMEDOUT;
-   goto out;
-   }
-   iv->phy_ctxt = >sc_phyctxt[0];
+   }
 
-   if ((error = iwm_mvm_binding_add_vif(sc, iv)) != 0) {
-   device_printf(sc->sc_dev,
-   "%s: binding add cmd\n", __func__);
-   goto out;
-   }
-   if ((error = iwm_mvm_add_sta(sc, in)) != 0) {
-   device_printf(sc->sc_dev,
-   "%s: failed to add sta\n", __func__);
-   goto out;
-   }
+   if ((error = iwm_mvm_phy_ctxt_changed(sc, >sc_phyctxt[0],
+   in->in_ni.ni_chan, 1, 1)) != 0) {
+   device_printf(sc->sc_dev,
+   "%s: failed update phy ctxt\n", __func__);
+   goto out;
+   }
+   iv->phy_ctxt = >sc_phyctxt[0];
+
+   if ((error = iwm_mvm_binding_add_vif(sc, iv)) != 0) {
+   device_printf(sc->sc_dev,
+   "%s: binding update cmd\n", __func__);
+   goto out;
+   }
+   if ((error = iwm_mvm_add_sta(sc, in)) != 0) {
+   device_printf(sc->sc_dev,
+   "%s: failed to add sta\n", __func__);
+   goto out;
}
 
/*
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318220 - head/sys/dev/iwm

2017-05-11 Thread Adrian Chadd
Author: adrian
Date: Fri May 12 05:51:50 2017
New Revision: 318220
URL: https://svnweb.freebsd.org/changeset/base/318220

Log:
  [iwm] No need for iwm_assoc() in AUTH->ASSOC transition.
  
  * Hence no need to keep stuff in separate iwm_assoc() function, just
inline the stuff into iwm_newstate().
  
  Obtained from:dragonflybsd.git 
e8f7d88e0d030f138f95ecdb7c1a729d9fb0d6ab

Modified:
  head/sys/dev/iwm/if_iwm.c

Modified: head/sys/dev/iwm/if_iwm.c
==
--- head/sys/dev/iwm/if_iwm.c   Fri May 12 05:50:38 2017(r318219)
+++ head/sys/dev/iwm/if_iwm.c   Fri May 12 05:51:50 2017(r318220)
@@ -359,7 +359,6 @@ static int  iwm_mvm_add_int_sta_common(st
 static int iwm_mvm_add_aux_sta(struct iwm_softc *);
 static int iwm_mvm_update_quotas(struct iwm_softc *, struct iwm_vap *);
 static int iwm_auth(struct ieee80211vap *, struct iwm_softc *);
-static int iwm_assoc(struct ieee80211vap *, struct iwm_softc *);
 static int iwm_release(struct iwm_softc *, struct iwm_node *);
 static struct ieee80211_node *
iwm_node_alloc(struct ieee80211vap *,
@@ -4166,9 +4165,9 @@ iwm_auth(struct ieee80211vap *vap, struc
"%s: binding update cmd\n", __func__);
goto out;
}
-   if ((error = iwm_mvm_update_sta(sc, in)) != 0) {
+   if ((error = iwm_mvm_add_sta(sc, in)) != 0) {
device_printf(sc->sc_dev,
-   "%s: failed to update sta\n", __func__);
+   "%s: failed to add sta\n", __func__);
goto out;
}
} else {
@@ -4220,28 +4219,6 @@ out:
 }
 
 static int
-iwm_assoc(struct ieee80211vap *vap, struct iwm_softc *sc)
-{
-   struct iwm_node *in = IWM_NODE(vap->iv_bss);
-   int error;
-
-   if ((error = iwm_mvm_update_sta(sc, in)) != 0) {
-   device_printf(sc->sc_dev,
-   "%s: failed to update STA\n", __func__);
-   return error;
-   }
-
-   in->in_assoc = 1;
-   if ((error = iwm_mvm_mac_ctxt_changed(sc, vap)) != 0) {
-   device_printf(sc->sc_dev,
-   "%s: failed to update MAC\n", __func__);
-   return error;
-   }
-
-   return 0;
-}
-
-static int
 iwm_release(struct iwm_softc *sc, struct iwm_node *in)
 {
uint32_t tfd_msk;
@@ -4556,7 +4533,6 @@ iwm_newstate(struct ieee80211vap *vap, e
device_printf(sc->sc_dev,
"%s: could not move to auth state: %d\n",
__func__, error);
-   break;
}
break;
 
@@ -4565,13 +4541,7 @@ iwm_newstate(struct ieee80211vap *vap, e
 * EBS may be disabled due to previous failures reported by FW.
 * Reset EBS status here assuming environment has been changed.
 */
-sc->last_ebs_successful = TRUE;
-   if ((error = iwm_assoc(vap, sc)) != 0) {
-   device_printf(sc->sc_dev,
-   "%s: failed to associate: %d\n", __func__,
-   error);
-   break;
-   }
+   sc->last_ebs_successful = TRUE;
break;
 
case IEEE80211_S_RUN:
@@ -4582,18 +4552,24 @@ iwm_newstate(struct ieee80211vap *vap, e
.flags = IWM_CMD_SYNC,
};
 
+   in = IWM_NODE(vap->iv_bss);
/* Update the association state, now we have it all */
/* (eg associd comes in at this point */
-   error = iwm_assoc(vap, sc);
+   error = iwm_mvm_update_sta(sc, in);
if (error != 0) {
device_printf(sc->sc_dev,
-   "%s: failed to update association state: %d\n",
-   __func__,
-   error);
-   break;
+   "%s: failed to update STA\n", __func__);
+   IWM_UNLOCK(sc);
+   IEEE80211_LOCK(ic);
+   return error;
+   }
+   in->in_assoc = 1;
+   error = iwm_mvm_mac_ctxt_changed(sc, vap);
+   if (error != 0) {
+   device_printf(sc->sc_dev,
+   "%s: failed to update MAC: %d\n", __func__, error);
}
 
-   in = IWM_NODE(vap->iv_bss);
iwm_mvm_enable_beacon_filter(sc, in);
iwm_mvm_power_update_mac(sc);
iwm_mvm_update_quotas(sc, ivp);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to 

svn commit: r318219 - head/sys/dev/iwm

2017-05-11 Thread Adrian Chadd
Author: adrian
Date: Fri May 12 05:50:38 2017
New Revision: 318219
URL: https://svnweb.freebsd.org/changeset/base/318219

Log:
  [iwm] Properly implement iwm_wme_update callback function.
  
  * Inspired by iwn(4) and Linux iwlwifi.
  
  * Read wme parameters into a buffer within struct iwm_vap in
iwm_wme_update().
  
  * If we aren't associated yet, the new settings will soon be sent
by iwm_mvm_mac_ctxt_changed() during association.
  
  * If we are already associated, explicitly call iwm_mvm_mac_ctxt_changed()
from iwm_wme_update() to send the new settings to the firmware.
  
  * Change iwm_mvm_ac_to_tx_fifo mapping, to fit the freebsd net80211
WME stream class numbering, instead of Linux's enum ieee80211_ac_numbers.
  
  Obtained from:dragonflybsd.git 
b8bd6cd746d1f45e616ccfcbeed06dfe452a1108

Modified:
  head/sys/dev/iwm/if_iwm.c
  head/sys/dev/iwm/if_iwm_mac_ctxt.c
  head/sys/dev/iwm/if_iwm_mac_ctxt.h
  head/sys/dev/iwm/if_iwmvar.h

Modified: head/sys/dev/iwm/if_iwm.c
==
--- head/sys/dev/iwm/if_iwm.c   Fri May 12 05:49:24 2017(r318218)
+++ head/sys/dev/iwm/if_iwm.c   Fri May 12 05:50:38 2017(r318219)
@@ -1533,13 +1533,6 @@ iwm_nic_init(struct iwm_softc *sc)
return 0;
 }
 
-const uint8_t iwm_mvm_ac_to_tx_fifo[] = {
-   IWM_MVM_TX_FIFO_VO,
-   IWM_MVM_TX_FIFO_VI,
-   IWM_MVM_TX_FIFO_BE,
-   IWM_MVM_TX_FIFO_BK,
-};
-
 static int
 iwm_enable_txq(struct iwm_softc *sc, int sta_id, int qid, int fifo)
 {
@@ -4258,7 +4251,7 @@ iwm_release(struct iwm_softc *sc, struct
 * from RUN back to SCAN is:
 *
 * iwm_mvm_power_mac_disable(sc, in);
-* iwm_mvm_mac_ctxt_changed(sc, in);
+* iwm_mvm_mac_ctxt_changed(sc, vap);
 * iwm_mvm_rm_sta(sc, in);
 * iwm_mvm_update_quotas(sc, NULL);
 * iwm_mvm_mac_ctxt_changed(sc, in);
@@ -4295,7 +4288,7 @@ iwm_release(struct iwm_softc *sc, struct
 
iwm_mvm_power_mac_disable(sc, in);
 
-   if ((error = iwm_mvm_mac_ctxt_changed(sc, in)) != 0) {
+   if ((error = iwm_mvm_mac_ctxt_changed(sc, vap)) != 0) {
device_printf(sc->sc_dev, "mac ctxt change fail 1 %d\n", error);
return error;
}
@@ -4307,7 +4300,7 @@ iwm_release(struct iwm_softc *sc, struct
error = iwm_mvm_rm_sta(sc, in);
in->in_assoc = 0;
iwm_mvm_update_quotas(sc, NULL);
-   if ((error = iwm_mvm_mac_ctxt_changed(sc, in)) != 0) {
+   if ((error = iwm_mvm_mac_ctxt_changed(sc, vap)) != 0) {
device_printf(sc->sc_dev, "mac ctxt change fail 2 %d\n", error);
return error;
}
@@ -6260,12 +6253,47 @@ iwm_is_valid_ether_addr(uint8_t *addr)
 }
 
 static int
-iwm_update_edca(struct ieee80211com *ic)
+iwm_wme_update(struct ieee80211com *ic)
 {
+#define IWM_EXP2(x)((1 << (x)) - 1)/* CWmin = 2^ECWmin - 1 */
struct iwm_softc *sc = ic->ic_softc;
+   struct ieee80211vap *vap = TAILQ_FIRST(>ic_vaps);
+   struct iwm_vap *ivp = IWM_VAP(vap);
+   struct iwm_node *in;
+   struct wmeParams tmp[WME_NUM_AC];
+   int aci, error;
+
+   if (vap == NULL)
+   return (0);
+
+   IEEE80211_LOCK(ic);
+   for (aci = 0; aci < WME_NUM_AC; aci++)
+   tmp[aci] = ic->ic_wme.wme_chanParams.cap_wmeParams[aci];
+   IEEE80211_UNLOCK(ic);
+
+   IWM_LOCK(sc);
+   for (aci = 0; aci < WME_NUM_AC; aci++) {
+   const struct wmeParams *ac = [aci];
+   ivp->queue_params[aci].aifsn = ac->wmep_aifsn;
+   ivp->queue_params[aci].cw_min = IWM_EXP2(ac->wmep_logcwmin);
+   ivp->queue_params[aci].cw_max = IWM_EXP2(ac->wmep_logcwmax);
+   ivp->queue_params[aci].edca_txop =
+   IEEE80211_TXOP_TO_US(ac->wmep_txopLimit);
+   }
+   ivp->have_wme = TRUE;
+   if (ivp->is_uploaded && vap->iv_bss != NULL) {
+   in = IWM_NODE(vap->iv_bss);
+   if (in->in_assoc) {
+   if ((error = iwm_mvm_mac_ctxt_changed(sc, vap)) != 0) {
+   device_printf(sc->sc_dev,
+   "%s: failed to update MAC\n", __func__);
+   }
+   }
+   }
+   IWM_UNLOCK(sc);
 
-   device_printf(sc->sc_dev, "%s: called\n", __func__);
return (0);
+#undef IWM_EXP2
 }
 
 static void
@@ -6322,7 +6350,7 @@ iwm_preinit(void *arg)
ic->ic_set_channel = iwm_set_channel;
ic->ic_scan_curchan = iwm_scan_curchan;
ic->ic_scan_mindwell = iwm_scan_mindwell;
-   ic->ic_wme.wme_update = iwm_update_edca;
+   ic->ic_wme.wme_update = iwm_wme_update;
ic->ic_parent = iwm_parent;
ic->ic_transmit = iwm_transmit;
iwm_radiotap_attach(sc);
@@ -6380,6 +6408,8 @@ iwm_vap_create(struct ieee80211com *ic, 
ivp->id = IWM_DEFAULT_MACID;
ivp->color = 

svn commit: r318218 - head/sys/dev/iwm

2017-05-11 Thread Adrian Chadd
Author: adrian
Date: Fri May 12 05:49:24 2017
New Revision: 318218
URL: https://svnweb.freebsd.org/changeset/base/318218

Log:
  [iwm] Process multiple frames per RX buffer.
  
  * Factor out iwm_handle_rxb() function from iwm_notif_intr().
  
  * Removing the IWM_FH_RCSR_CHNL0_RX_CONFIG_SINGLE_FRAME_MSK flag allows
the device to put multiple frames (both command responses and 80211
frames) into a single RX buffer.
  
  * Uses m_copym() to split up the receive buffers when multiple 80211
frames are received in one RX buffer. The effect is basically the same
as when using m_split(), but we want to keep the original mbuf around
when calling iwm_mvm_rx_rx_mpdu() to make error handling a bit easier
for now.
  
  * Contains a small optimization to avoid the m_copym() when only a single
80211 frame is received in one RX buffer (i.e. matching the existing
behaviour).
  
  Obtained from:dragonflybsd.git 
b5eb43f0280bbcfd26af51cf5a4b8e8ff3590b67

Modified:
  head/sys/dev/iwm/if_iwm.c
  head/sys/dev/iwm/if_iwmreg.h
  head/sys/dev/iwm/if_iwmvar.h

Modified: head/sys/dev/iwm/if_iwm.c
==
--- head/sys/dev/iwm/if_iwm.c   Fri May 12 05:30:01 2017(r318217)
+++ head/sys/dev/iwm/if_iwm.c   Fri May 12 05:49:24 2017(r318218)
@@ -169,6 +169,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+/* From DragonflyBSD */
+#define mtodoff(m, t, off)  ((t)((m)->m_data + (off)))
+
 const uint8_t iwm_nvm_channels[] = {
/* 2.4 GHz */
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
@@ -320,16 +323,15 @@ static intiwm_rx_addbuf(struct iwm_soft
 static int iwm_mvm_get_signal_strength(struct iwm_softc *,
struct iwm_rx_phy_info *);
 static voidiwm_mvm_rx_rx_phy_cmd(struct iwm_softc *,
-  struct iwm_rx_packet *,
-  struct iwm_rx_data *);
+  struct iwm_rx_packet *);
 static int iwm_get_noise(struct iwm_softc *sc,
const struct iwm_mvm_statistics_rx_non_phy *);
-static voidiwm_mvm_rx_rx_mpdu(struct iwm_softc *, struct mbuf *);
+static boolean_t iwm_mvm_rx_rx_mpdu(struct iwm_softc *, struct mbuf *,
+   uint32_t, boolean_t);
 static int iwm_mvm_rx_tx_cmd_single(struct iwm_softc *,
  struct iwm_rx_packet *,
 struct iwm_node *);
-static voidiwm_mvm_rx_tx_cmd(struct iwm_softc *, struct iwm_rx_packet *,
-  struct iwm_rx_data *);
+static voidiwm_mvm_rx_tx_cmd(struct iwm_softc *, struct iwm_rx_packet *);
 static voidiwm_cmd_done(struct iwm_softc *, struct iwm_rx_packet *);
 #if 0
 static voidiwm_update_sched(struct iwm_softc *, int, int, uint8_t,
@@ -385,6 +387,7 @@ static const char *
 static voidiwm_nic_error(struct iwm_softc *);
 static voidiwm_nic_umac_error(struct iwm_softc *);
 #endif
+static voidiwm_handle_rxb(struct iwm_softc *, struct mbuf *);
 static voidiwm_notif_intr(struct iwm_softc *);
 static voidiwm_intr(void *);
 static int iwm_attach(device_t);
@@ -1432,14 +1435,21 @@ iwm_nic_rx_init(struct iwm_softc *sc)
IWM_WRITE(sc,
IWM_FH_RSCSR_CHNL0_STTS_WPTR_REG, sc->rxq.stat_dma.paddr >> 4);
 
-   /* Enable RX. */
+   /* Enable Rx DMA
+* XXX 5000 HW isn't supported by the iwm(4) driver.
+* IWM_FH_RCSR_CHNL0_RX_IGNORE_RXF_EMPTY is set because of HW bug in
+*  the credit mechanism in 5000 HW RX FIFO
+* Direct rx interrupts to hosts
+* Rx buffer size 4 or 8k or 12k
+* RB timeout 0x10
+* 256 RBDs
+*/
IWM_WRITE(sc, IWM_FH_MEM_RCSR_CHNL0_CONFIG_REG,
IWM_FH_RCSR_RX_CONFIG_CHNL_EN_ENABLE_VAL|
IWM_FH_RCSR_CHNL0_RX_IGNORE_RXF_EMPTY   |  /* HW bug */
IWM_FH_RCSR_CHNL0_RX_CONFIG_IRQ_DEST_INT_HOST_VAL   |
-   IWM_FH_RCSR_CHNL0_RX_CONFIG_SINGLE_FRAME_MSK|
-   (IWM_RX_RB_TIMEOUT << IWM_FH_RCSR_RX_CONFIG_REG_IRQ_RBTH_POS) |
IWM_FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_4K|
+   (IWM_RX_RB_TIMEOUT << IWM_FH_RCSR_RX_CONFIG_REG_IRQ_RBTH_POS) |
IWM_RX_QUEUE_SIZE_LOG << IWM_FH_RCSR_RX_CONFIG_RBDCB_SIZE_POS);
 
IWM_WRITE_1(sc, IWM_CSR_INT_COALESCING, IWM_HOST_INT_TIMEOUT_DEF);
@@ -3126,13 +3136,11 @@ iwm_mvm_get_signal_strength(struct iwm_s
 }
 
 static void
-iwm_mvm_rx_rx_phy_cmd(struct iwm_softc *sc,
-   struct iwm_rx_packet *pkt, struct iwm_rx_data *data)
+iwm_mvm_rx_rx_phy_cmd(struct iwm_softc *sc, struct iwm_rx_packet *pkt)
 {
struct iwm_rx_phy_info *phy_info = (void *)pkt->data;
 
IWM_DPRINTF(sc, IWM_DEBUG_RECV, "received PHY stats\n");
-   bus_dmamap_sync(sc->rxq.data_dmat, data->map, 

svn commit: r318217 - head/sys/dev/iwm

2017-05-11 Thread Adrian Chadd
Author: adrian
Date: Fri May 12 05:30:01 2017
New Revision: 318217
URL: https://svnweb.freebsd.org/changeset/base/318217

Log:
  [iwm] Change UCODE_TLV_API #define-s from bitmasks to indexes.
  
  * Fixes oversight from commit 757eecf0e6c92745aa2eee95811e573c8300850e.
fw_has_api now uses the isset macro instead of a simple logical-and.
  
  Obtained from:dragonflybsd.git 
c00575de8491dc402abf52c8c7e1cca1ef79e257

Modified:
  head/sys/dev/iwm/if_iwmreg.h

Modified: head/sys/dev/iwm/if_iwmreg.h
==
--- head/sys/dev/iwm/if_iwmreg.hFri May 12 05:28:49 2017
(r318216)
+++ head/sys/dev/iwm/if_iwmreg.hFri May 12 05:30:01 2017
(r318217)
@@ -669,12 +669,12 @@ P2P_PS_SCM\31UAPSD_SUPPORT\32EBS\33P2P_P
  * @IWM_NUM_UCODE_TLV_API: number of bits used
  */
 enum iwm_ucode_tlv_api {
-   IWM_UCODE_TLV_API_FRAGMENTED_SCAN   = (1 << 8),
-   IWM_UCODE_TLV_API_WIFI_MCC_UPDATE   = (1 << 9),
-   IWM_UCODE_TLV_API_WIDE_CMD_HDR  = (1 << 14),
-   IWM_UCODE_TLV_API_LQ_SS_PARAMS  = (1 << 18),
-   IWM_UCODE_TLV_API_EXT_SCAN_PRIORITY = (1 << 24),
-   IWM_UCODE_TLV_API_TX_POWER_CHAIN= (1 << 27),
+   IWM_UCODE_TLV_API_FRAGMENTED_SCAN   = 8,
+   IWM_UCODE_TLV_API_WIFI_MCC_UPDATE   = 9,
+   IWM_UCODE_TLV_API_WIDE_CMD_HDR  = 14,
+   IWM_UCODE_TLV_API_LQ_SS_PARAMS  = 18,
+   IWM_UCODE_TLV_API_EXT_SCAN_PRIORITY = 24,
+   IWM_UCODE_TLV_API_TX_POWER_CHAIN= 27,
 
IWM_NUM_UCODE_TLV_API = 32
 };
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318216 - head/sys/dev/iwm

2017-05-11 Thread Adrian Chadd
Author: adrian
Date: Fri May 12 05:28:49 2017
New Revision: 318216
URL: https://svnweb.freebsd.org/changeset/base/318216

Log:
  [iwm] Sync iwm_read_firmware()'s loop to iwlwifi's code.
  
  Obtained from:dragonflybsd.git 
d1c10ccfcf2d6d2a664f17197add0b4f9181

Modified:
  head/sys/dev/iwm/if_iwm.c

Modified: head/sys/dev/iwm/if_iwm.c
==
--- head/sys/dev/iwm/if_iwm.c   Fri May 12 05:22:29 2017(r318215)
+++ head/sys/dev/iwm/if_iwm.c   Fri May 12 05:28:49 2017(r318216)
@@ -549,12 +549,14 @@ iwm_read_firmware(struct iwm_softc *sc, 
 {
struct iwm_fw_info *fw = >sc_fw;
const struct iwm_tlv_ucode_header *uhdr;
-   struct iwm_ucode_tlv tlv;
+   const struct iwm_ucode_tlv *tlv;
struct iwm_ucode_capabilities *capa = >ucode_capa;
enum iwm_ucode_tlv_type tlv_type;
const struct firmware *fwp;
const uint8_t *data;
+   uint32_t tlv_len;
uint32_t usniffer_img;
+   const uint8_t *tlv_data;
uint32_t paging_mem_size;
int num_of_cpus;
int error = 0;
@@ -607,24 +609,20 @@ iwm_read_firmware(struct iwm_softc *sc, 
goto out;
}
 
-   snprintf(sc->sc_fwver, sizeof(sc->sc_fwver), "%d.%d (API ver %d)",
+   snprintf(sc->sc_fwver, sizeof(sc->sc_fwver), "%u.%u (API ver %u)",
IWM_UCODE_MAJOR(le32toh(uhdr->ver)),
IWM_UCODE_MINOR(le32toh(uhdr->ver)),
IWM_UCODE_API(le32toh(uhdr->ver)));
data = uhdr->data;
len = fw->fw_fp->datasize - sizeof(*uhdr);
 
-   while (len >= sizeof(tlv)) {
-   size_t tlv_len;
-   const void *tlv_data;
-
-   memcpy(, data, sizeof(tlv));
-   tlv_len = le32toh(tlv.length);
-   tlv_type = le32toh(tlv.type);
-
-   len -= sizeof(tlv);
-   data += sizeof(tlv);
-   tlv_data = data;
+   while (len >= sizeof(*tlv)) {
+   len -= sizeof(*tlv);
+   tlv = (const void *)data;
+
+   tlv_len = le32toh(tlv->length);
+   tlv_type = le32toh(tlv->type);
+   tlv_data = tlv->data;
 
if (len < tlv_len) {
device_printf(sc->sc_dev,
@@ -633,19 +631,21 @@ iwm_read_firmware(struct iwm_softc *sc, 
error = EINVAL;
goto parse_out;
}
+   len -= roundup2(tlv_len, 4);
+   data += sizeof(tlv) + roundup2(tlv_len, 4);
 
switch ((int)tlv_type) {
case IWM_UCODE_TLV_PROBE_MAX_LEN:
-   if (tlv_len < sizeof(uint32_t)) {
+   if (tlv_len != sizeof(uint32_t)) {
device_printf(sc->sc_dev,
-   "%s: PROBE_MAX_LEN (%d) < 
sizeof(uint32_t)\n",
+   "%s: PROBE_MAX_LEN (%d) != 
sizeof(uint32_t)\n",
__func__,
(int) tlv_len);
error = EINVAL;
goto parse_out;
}
capa->max_probe_length =
-   le32toh(*(const uint32_t *)tlv_data);
+   le32_to_cpup((const uint32_t *)tlv_data);
/* limit it to something sensible */
if (capa->max_probe_length >
IWM_SCAN_OFFLOAD_PROBE_REQ_SIZE) {
@@ -676,6 +676,14 @@ iwm_read_firmware(struct iwm_softc *sc, 
error = EINVAL;
goto parse_out;
}
+   if (tlv_len % sizeof(uint32_t)) {
+   device_printf(sc->sc_dev,
+   "%s: IWM_UCODE_TLV_FLAGS: tlv_len (%d) %% 
sizeof(uint32_t)\n",
+   __func__,
+   (int) tlv_len);
+   error = EINVAL;
+   goto parse_out;
+   }
/*
 * Apparently there can be many flags, but Linux driver
 * parses only the first one, and so do we.
@@ -687,7 +695,7 @@ iwm_read_firmware(struct iwm_softc *sc, 
 *  2) TLV_FLAGS contains TLV_FLAGS_PAN
 * ==> this resets TLV_PAN to itself... hnnnk
 */
-   capa->flags = le32toh(*(const uint32_t *)tlv_data);
+   capa->flags = le32_to_cpup((const uint32_t *)tlv_data);
break;
case IWM_UCODE_TLV_CSCHEME:
if ((error = iwm_store_cscheme(sc,
@@ -708,7 +716,7 @@ iwm_read_firmware(struct iwm_softc *sc, 

svn commit: r318215 - head/sys/dev/iwm

2017-05-11 Thread Adrian Chadd
Author: adrian
Date: Fri May 12 05:22:29 2017
New Revision: 318215
URL: https://svnweb.freebsd.org/changeset/base/318215

Log:
  [iwm] change the check for ADD_STA status, use IWM_ADD_STA_STATUS_MASK.
  
  Obtained from:dragonflybsd.git 
74d41163ddac72b0d7ea7b7873d53fe134723a12

Modified:
  head/sys/dev/iwm/if_iwm.c

Modified: head/sys/dev/iwm/if_iwm.c
==
--- head/sys/dev/iwm/if_iwm.c   Fri May 12 05:21:50 2017(r318214)
+++ head/sys/dev/iwm/if_iwm.c   Fri May 12 05:22:29 2017(r318215)
@@ -3925,7 +3925,7 @@ iwm_mvm_sta_send_to_fw(struct iwm_softc 
if (ret)
return ret;
 
-   switch (status) {
+   switch (status & IWM_ADD_STA_STATUS_MASK) {
case IWM_ADD_STA_SUCCESS:
break;
default:
@@ -3971,7 +3971,7 @@ iwm_mvm_add_int_sta_common(struct iwm_so
if (ret)
return ret;
 
-   switch (status) {
+   switch (status & IWM_ADD_STA_STATUS_MASK) {
case IWM_ADD_STA_SUCCESS:
IWM_DPRINTF(sc, IWM_DEBUG_RESET,
"%s: Internal station added.\n", __func__);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318214 - head/sys/dev/iwm

2017-05-11 Thread Adrian Chadd
Author: adrian
Date: Fri May 12 05:21:50 2017
New Revision: 318214
URL: https://svnweb.freebsd.org/changeset/base/318214

Log:
  [iwm] Sanity check channel for IEEE80211_CHAN_ANYC in if_iwm_mac_ctxt.c.
  
  * This avoids panicing in some broken vap state handling cases.
  
  Obtained from:dragonflybsd.git 
10d5b77b5421e7cbcc426160edbe858d1d610a29

Modified:
  head/sys/dev/iwm/if_iwm_mac_ctxt.c

Modified: head/sys/dev/iwm/if_iwm_mac_ctxt.c
==
--- head/sys/dev/iwm/if_iwm_mac_ctxt.c  Fri May 12 05:21:02 2017
(r318213)
+++ head/sys/dev/iwm/if_iwm_mac_ctxt.c  Fri May 12 05:21:50 2017
(r318214)
@@ -308,7 +308,7 @@ iwm_mvm_mac_ctxt_cmd_common(struct iwm_s
/*
 * Default to 2ghz if no node information is given.
 */
-   if (in) {
+   if (in && in->in_ni.ni_chan != IEEE80211_CHAN_ANYC) {
is2ghz = !! IEEE80211_IS_CHAN_2GHZ(in->in_ni.ni_chan);
} else {
is2ghz = 1;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318213 - head/sys/dev/iwm

2017-05-11 Thread Adrian Chadd
Author: adrian
Date: Fri May 12 05:21:02 2017
New Revision: 318213
URL: https://svnweb.freebsd.org/changeset/base/318213

Log:
  [if_iwm] Get rid of another usage of the IWM_DEFAULT_MACID/_COLOR constant.
  
  Obtained from:dragonflybsd.git 
c009badecf7b1389cd86adde9fd35f6113c75b5b

Modified:
  head/sys/dev/iwm/if_iwm.c

Modified: head/sys/dev/iwm/if_iwm.c
==
--- head/sys/dev/iwm/if_iwm.c   Fri May 12 05:19:08 2017(r318212)
+++ head/sys/dev/iwm/if_iwm.c   Fri May 12 05:21:02 2017(r318213)
@@ -3895,6 +3895,7 @@ iwm_mvm_send_add_sta_cmd_status(struct i
 static int
 iwm_mvm_sta_send_to_fw(struct iwm_softc *sc, struct iwm_node *in, int update)
 {
+   struct iwm_vap *ivp = IWM_VAP(in->in_ni.ni_vap);
struct iwm_mvm_add_sta_cmd add_sta_cmd;
int ret;
uint32_t status;
@@ -3903,8 +3904,7 @@ iwm_mvm_sta_send_to_fw(struct iwm_softc 
 
add_sta_cmd.sta_id = IWM_STATION_ID;
add_sta_cmd.mac_id_n_color
-   = htole32(IWM_FW_CMD_ID_AND_COLOR(IWM_DEFAULT_MACID,
-   IWM_DEFAULT_COLOR));
+   = htole32(IWM_FW_CMD_ID_AND_COLOR(ivp->id, ivp->color));
if (!update) {
int ac;
for (ac = 0; ac < WME_NUM_AC; ac++) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318212 - head/sys/dev/iwm

2017-05-11 Thread Adrian Chadd
Author: adrian
Date: Fri May 12 05:19:08 2017
New Revision: 318212
URL: https://svnweb.freebsd.org/changeset/base/318212

Log:
  [if_iwm] Partly sync if_iwm_binding.c to Linux iwlwifi code.
  
  * Store macid and color values in struct iwm_vap, to avoid hardcoded
constants a bit.
  
  * Add iwm_mvm_binding_remove_vif() function (will be used in disconnecting
from an access point without resetting the whole device).
  
  * Not adding code from Linux iwlwifi yet, to handle one PHY context to
be bound to several VAPs/virtual-interfaces, it's definitely not needed
in the near future.
  
  Obtained from:dragonflybsd.git 
f16ef74977e51e1bfc7a625dd18b98b02158e0e5

Modified:
  head/sys/dev/iwm/if_iwm.c
  head/sys/dev/iwm/if_iwm_binding.c
  head/sys/dev/iwm/if_iwm_binding.h
  head/sys/dev/iwm/if_iwm_mac_ctxt.c
  head/sys/dev/iwm/if_iwm_power.c
  head/sys/dev/iwm/if_iwm_time_event.c
  head/sys/dev/iwm/if_iwm_time_event.h
  head/sys/dev/iwm/if_iwmvar.h

Modified: head/sys/dev/iwm/if_iwm.c
==
--- head/sys/dev/iwm/if_iwm.c   Fri May 12 05:17:49 2017(r318211)
+++ head/sys/dev/iwm/if_iwm.c   Fri May 12 05:19:08 2017(r318212)
@@ -4156,7 +4156,7 @@ iwm_auth(struct ieee80211vap *vap, struc
}
iv->phy_ctxt = >sc_phyctxt[0];
 
-   if ((error = iwm_mvm_binding_update(sc, iv)) != 0) {
+   if ((error = iwm_mvm_binding_add_vif(sc, iv)) != 0) {
device_printf(sc->sc_dev,
"%s: binding update cmd\n", __func__);
goto out;
@@ -4205,7 +4205,7 @@ iwm_auth(struct ieee80211vap *vap, struc
 */
/* XXX duration is in units of TU, not MS */
duration = IWM_MVM_TE_SESSION_PROTECTION_MAX_TIME_MS;
-   iwm_mvm_protect_session(sc, in, duration, 500 /* XXX magic number */);
+   iwm_mvm_protect_session(sc, iv, duration, 500 /* XXX magic number */);
DELAY(100);
 
error = 0;
@@ -4250,7 +4250,7 @@ iwm_release(struct iwm_softc *sc, struct
 * iwm_mvm_rm_sta(sc, in);
 * iwm_mvm_update_quotas(sc, NULL);
 * iwm_mvm_mac_ctxt_changed(sc, in);
-* iwm_mvm_binding_remove_vif(sc, in);
+* iwm_mvm_binding_remove_vif(sc, IWM_VAP(in->in_ni.ni_vap));
 * iwm_mvm_mac_ctxt_remove(sc, in);
 *
 * However, that freezes the device not matter which permutations
@@ -4299,7 +4299,7 @@ iwm_release(struct iwm_softc *sc, struct
device_printf(sc->sc_dev, "mac ctxt change fail 2 %d\n", error);
return error;
}
-   iwm_mvm_binding_remove_vif(sc, in);
+   iwm_mvm_binding_remove_vif(sc, IWM_VAP(in->in_ni.ni_vap));
 
iwm_mvm_mac_ctxt_remove(sc, in);
 
@@ -6303,6 +6303,9 @@ iwm_vap_create(struct ieee80211com *ic, 
ivp->iv_newstate = vap->iv_newstate;
vap->iv_newstate = iwm_newstate;
 
+   ivp->id = IWM_DEFAULT_MACID;
+   ivp->color = IWM_DEFAULT_COLOR;
+
ieee80211_ratectl_init(vap);
/* Complete setup. */
ieee80211_vap_attach(vap, iwm_media_change, ieee80211_media_status,

Modified: head/sys/dev/iwm/if_iwm_binding.c
==
--- head/sys/dev/iwm/if_iwm_binding.c   Fri May 12 05:17:49 2017
(r318211)
+++ head/sys/dev/iwm/if_iwm_binding.c   Fri May 12 05:19:08 2017
(r318212)
@@ -31,7 +31,7 @@
  *
  * GPL LICENSE SUMMARY
  *
- * Copyright(c) 2007 - 2013 Intel Corporation. All rights reserved.
+ * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of version 2 of the GNU General Public License as
@@ -51,13 +51,12 @@
  * in the file called COPYING.
  *
  * Contact Information:
- *  Intel Linux Wireless 
+ *  Intel Linux Wireless 
  * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  *
- *
  * BSD LICENSE
  *
- * Copyright(c) 2005 - 2013 Intel Corporation. All rights reserved.
+ * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -87,21 +86,6 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*-
- * Copyright (c) 2007-2010 Damien Bergamini 
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, 

svn commit: r318211 - head/contrib/netbsd-tests/lib/libc/ssp

2017-05-11 Thread Ngie Cooper
Author: ngie
Date: Fri May 12 05:17:49 2017
New Revision: 318211
URL: https://svnweb.freebsd.org/changeset/base/318211

Log:
  Fix up previous commit
  
  - Apply the logic to the FreeBSD block
  - Fix a typo with the getconf(1) call that I would have caught, were
it not for the fact that I got the blocks wrong.
  - Consolidate the hardcoded buffer sizes to the NetBSD block.
  
  This would have been discovered had I run the test on a system where
  PATH_MAX != 1024 (I don't have that at my disposal right at this moment).
  
  MFC after:3 weeks
  MFC with: r318210
  Sponsored by: Dell EMC Isilon

Modified:
  head/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh

Modified: head/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh
==
--- head/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh Fri May 12 05:06:48 
2017(r318210)
+++ head/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh Fri May 12 05:17:49 
2017(r318211)
@@ -386,14 +386,15 @@ read_body()
 {
prog="$(atf_get_srcdir)/h_read"
 
-   h_pass "$prog 1024" "echo foo |"
# Begin FreeBSD
if true; then
-   h_fail "$prog 1027" "echo bar |"
+   MAX_PATH=$(getconf _XOPEN_PATH_MAX) || atf_fail "getconf failed"
+   h_pass "$prog $MAX_PATH" "echo foo |"
+   h_fail "$prog $(( $MAX_PATH + 3 ))" "echo bar |"
else
# End FreeBSD
-   MAX_PATH=$(getconf _XOPEN_MAX_PATH) || atf_fail "getconf failed"
-   h_fail "$prog $(( $MAX_PATH + 1))" "echo bar |"
+   h_pass "$prog 1024" "echo foo |"
+   h_fail "$prog 1025" "echo bar |"
# Begin FreeBSD
fi
# End FreeBSD
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318210 - head/contrib/netbsd-tests/lib/libc/ssp

2017-05-11 Thread Ngie Cooper
Author: ngie
Date: Fri May 12 05:06:48 2017
New Revision: 318210
URL: https://svnweb.freebsd.org/changeset/base/318210

Log:
  ssp_test:read:: query the value of MAXPATHLEN via getconf(1)
  
  In the event the value of PATH_MAX was changed, the assumption that
  MAXPATHLEN is 1024 (and hence the buffer length required to trigger
  SSP to fail for read(2)) would be invalidated. Query getconf(1) for
  the actual value of MAXPATHLEN via _XOPEN_PATH_MAX instead, and
  increment the value by 1 to ensure that the SSP support tests the
  stack smashing support properly.
  
  MFC after:3 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh

Modified: head/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh
==
--- head/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh Fri May 12 04:10:02 
2017(r318209)
+++ head/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh Fri May 12 05:06:48 
2017(r318210)
@@ -392,7 +392,8 @@ read_body()
h_fail "$prog 1027" "echo bar |"
else
# End FreeBSD
-   h_fail "$prog 1025" "echo bar |"
+   MAX_PATH=$(getconf _XOPEN_MAX_PATH) || atf_fail "getconf failed"
+   h_fail "$prog $(( $MAX_PATH + 1))" "echo bar |"
# Begin FreeBSD
fi
# End FreeBSD
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318209 - head/sys/dev/dpaa

2017-05-11 Thread Justin Hibbits
Author: jhibbits
Date: Fri May 12 04:10:02 2017
New Revision: 318209
URL: https://svnweb.freebsd.org/changeset/base/318209

Log:
  Use UMA_ALIGN_PTR to specify pointer alignment
  
  Suggested by: jhb

Modified:
  head/sys/dev/dpaa/if_dtsec_rm.c

Modified: head/sys/dev/dpaa/if_dtsec_rm.c
==
--- head/sys/dev/dpaa/if_dtsec_rm.c Fri May 12 03:44:20 2017
(r318208)
+++ head/sys/dev/dpaa/if_dtsec_rm.c Fri May 12 04:10:02 2017
(r318209)
@@ -115,7 +115,7 @@ dtsec_rm_fi_pool_init(struct dtsec_softc
 
sc->sc_fi_zone = uma_zcreate(sc->sc_fi_zname,
sizeof(struct dtsec_rm_frame_info), NULL, NULL, NULL, NULL,
-   sizeof(void *) - 1, 0);
+   UMA_ALIGN_PTR, 0);
if (sc->sc_fi_zone == NULL)
return (EIO);
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318202 - head/contrib/ipfilter/lib

2017-05-11 Thread Cy Schubert
Author: cy
Date: Fri May 12 01:09:24 2017
New Revision: 318202
URL: https://svnweb.freebsd.org/changeset/base/318202

Log:
  Add missing linefeed in debug output.

Modified:
  head/contrib/ipfilter/lib/printpoolnode.c

Modified: head/contrib/ipfilter/lib/printpoolnode.c
==
--- head/contrib/ipfilter/lib/printpoolnode.c   Thu May 11 23:49:53 2017
(r318201)
+++ head/contrib/ipfilter/lib/printpoolnode.c   Fri May 12 01:09:24 2017
(r318202)
@@ -52,7 +52,7 @@ printpoolnode(np, opts, fields)
PRINTF("\tAddress: %s%s", np->ipn_info ? "! " : "",
inet_ntoa(np->ipn_addr.adf_addr.in4));
} else {
-   PRINTF("\tAddress: family: %d",
+   PRINTF("\tAddress: family: %d\n",
np->ipn_addr.adf_family);
 #ifdef AF_INET6
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318194 - head/share/mk

2017-05-11 Thread Simon J. Gerraty
Author: sjg
Date: Thu May 11 19:49:22 2017
New Revision: 318194
URL: https://svnweb.freebsd.org/changeset/base/318194

Log:
  Tell bmake (meta mode) to ignore changes to /usr/local/etc/libmap.d/*
  
  Differential Revision:D10685
  Reviewed by:  bdrewery

Modified:
  head/share/mk/local.meta.sys.mk

Modified: head/share/mk/local.meta.sys.mk
==
--- head/share/mk/local.meta.sys.mk Thu May 11 18:53:28 2017
(r318193)
+++ head/share/mk/local.meta.sys.mk Thu May 11 19:49:22 2017
(r318194)
@@ -283,3 +283,6 @@ META_MODE+= missing-meta=yes
 .if empty(META_MODE:Mnofilemon)
 META_MODE+=missing-filemon=yes
 .endif
+# We do not want everything out-of-date just because
+# some unrelated shared lib updated this.
+.MAKE.META.IGNORE_PATHS+= /usr/local/etc/libmap.d
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318193 - head/sys/boot/efi/loader

2017-05-11 Thread Mark Johnston
Author: markj
Date: Thu May 11 18:53:28 2017
New Revision: 318193
URL: https://svnweb.freebsd.org/changeset/base/318193

Log:
  Set the right variable when overriding the default console speed.
  
  MFC after:1 week

Modified:
  head/sys/boot/efi/loader/main.c

Modified: head/sys/boot/efi/loader/main.c
==
--- head/sys/boot/efi/loader/main.c Thu May 11 17:26:34 2017
(r318192)
+++ head/sys/boot/efi/loader/main.c Thu May 11 18:53:28 2017
(r318193)
@@ -391,7 +391,7 @@ main(int argc, CHAR16 *argv[])
} else {
cpy16to8([i + 
1][0], var,
sizeof(var));
-   
setenv("comconsole_speedspeed", var, 1);
+   
setenv("comconsole_speed", var, 1);
}
i++;
break;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r318171 - head/sys/dev/dpaa

2017-05-11 Thread John Baldwin
On Thursday, May 11, 2017 03:47:58 AM Justin Hibbits wrote:
> Author: jhibbits
> Date: Thu May 11 03:47:58 2017
> New Revision: 318171
> URL: https://svnweb.freebsd.org/changeset/base/318171
> 
> Log:
>   Fix uma_zcreate() align argument, now that the constraint is asserted.
>   
>   The alignment argument is the mask of low bits to mask off when allocating
>   items in a zone, not the block-size alignment.

The first one should probably be using UMA_ALIGN_PTR instead.

However, I do wonder if we shouldn't fix the API.  All of the other APIs in
the kernel for memory allocation use the size for alignment (contigmalloc,
kmem_*, bus_dma, etc.).

We could support a transition for uma by doing something like this in the
implementation:

if (alignment == 0)
zone->align = 0;
else if (powerof2(alignment))
zone->align = alignment - 1;
else {
KASSERT(powerof2(alignment + 1), ...);
printf("WARNING: UMA zone %s using old alignment\n");
zone->alignment = alignment;
}

Along with updating the UMA_ALIGN_* constants which should fix most of the
zones in the tree to use the new strategy.  In 13 we would turn the printf()
into a panic() / KASSERT.

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


svn commit: r318191 - head/sys/kern

2017-05-11 Thread Mark Johnston
Author: markj
Date: Thu May 11 17:03:45 2017
New Revision: 318191
URL: https://svnweb.freebsd.org/changeset/base/318191

Log:
  Let ptracestop() suspend threads sleeping in an SBDRY section.
  
  When a thread enters ptracestop(), for example because it had received
  SIGSTOP from ptrace(PT_ATTACH), it attempts to suspend other threads in
  the same process. In the case of a thread sleeping interruptibly in an
  SBDRY section, sig_suspend_threads() must wake the thread and allow it to
  reach the user-mode boundary. However, sig_suspend_threads() would
  erroneously avoid waking up such threads, resulting in an apparent hang.
  
  Reviewed by:  kib
  Tested by:pho
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/kern/kern_sig.c

Modified: head/sys/kern/kern_sig.c
==
--- head/sys/kern/kern_sig.cThu May 11 16:37:29 2017(r318190)
+++ head/sys/kern/kern_sig.cThu May 11 17:03:45 2017(r318191)
@@ -2477,6 +2477,7 @@ sig_suspend_threads(struct thread *td, s
 
PROC_LOCK_ASSERT(p, MA_OWNED);
PROC_SLOCK_ASSERT(p, MA_OWNED);
+   MPASS(sending || td == curthread);
 
wakeup_swapper = 0;
FOREACH_THREAD_IN_PROC(p, td2) {
@@ -2493,10 +2494,9 @@ sig_suspend_threads(struct thread *td, s
 */
KASSERT(!TD_IS_SUSPENDED(td2),
("thread with deferred stops suspended"));
-   if (TD_SBDRY_INTR(td2) && sending) {
+   if (TD_SBDRY_INTR(td2))
wakeup_swapper |= sleepq_abort(td2,
TD_SBDRY_ERRNO(td2));
-   }
} else if (!TD_IS_SUSPENDED(td2)) {
thread_suspend_one(td2);
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318190 - head/release/scripts

2017-05-11 Thread Glen Barber
Author: gjb
Date: Thu May 11 16:37:29 2017
New Revision: 318190
URL: https://svnweb.freebsd.org/changeset/base/318190

Log:
  Update release/scripts/atlas-upload.sh to account for API changes
  made recently by Atlas Hashicorp.  The data returned from GET and
  POST requests has changed, which caused a number of regex patterns
  to fail to be properly identified as 'success' or 'failure', which
  ended up in upload/publish failures.
  
  Tested with:  12-CURRENT
  MFC after:3 days
  Sponsored by: The FreeBSD Foundation

Modified:
  head/release/scripts/atlas-upload.sh

Modified: head/release/scripts/atlas-upload.sh
==
--- head/release/scripts/atlas-upload.shThu May 11 16:26:56 2017
(r318189)
+++ head/release/scripts/atlas-upload.shThu May 11 16:37:29 2017
(r318190)
@@ -132,20 +132,20 @@ main () {
echo "Failed to get the token from the API"
exit 2;
fi
-   echo ${TOKENRESULT} | grep "\"token\":" > /dev/null
+   echo ${TOKENRESULT} | grep -E "\"(token|upload_path)\":" > /dev/null
if [ $? != 0 ]; then
echo "No token found from the API"
exit 2
else
-   TOKEN=$(echo $TOKENRESULT | sed -e 's/.*token":"//' -e 
's/".*//')
+   TOKEN=$(echo $TOKENRESULT | sed -e 's/.*token":"//' -e 
's/.*upload_path":"//' -e 's/}$//g' -e 's/"//g')
echo "Uploading to Atlas"
-   UPLOADRESULT=$(/usr/local/bin/curl -s -X PUT --upload-file 
${FILE} ${ATLAS_UPLOAD_URL}/${TOKEN})
+   UPLOADRESULT=$(/usr/local/bin/curl -s -X PUT --upload-file 
${FILE} ${TOKEN})
 
# Validate the Upload
echo "Validating"
VALIDRESULT=$(/usr/local/bin/curl -s 
"https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION}/provider/${PROVIDER}?access_token=${KEY};)
-   HOSTED_TOKEN=$(echo $VALIDRESULT | sed -e 
's/.*hosted_token":"//' -e 's/".*//')
-   if [ ! -z ${HOSTED_TOKEN} -a ! -z ${TOKEN} -a ${HOSTED_TOKEN} 
!= ${TOKEN} ]; then
+   HOSTED_TOKEN=$(echo $VALIDRESULT | sed -e 's/.*"hosted"://' -e 
's/,.*$//')
+   if [ ! -z ${TOKEN} -a "${HOSTED_TOKEN}" != "true" ]; then
echo "Upload failed, try again."
exit 2
fi
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2017-05-11 Thread Alan Somers
Author: asomers
Date: Thu May 11 16:26:56 2017
New Revision: 318189
URL: https://svnweb.freebsd.org/changeset/base/318189

Log:
  vdev_geom may associate multiple vdevs per g_consumer
  
  vdev_geom.c currently uses the g_consumer's private field to point to a
  vdev_t. That way, a GEOM event can cause a change to a ZFS vdev. For
  example, when you remove a disk, the vdev's status will change to REMOVED.
  However, vdev_geom will sometimes attach multiple vdevs to the same GEOM
  consumer. If this happens, then geom events will only be propagated to one
  of the vdevs.
  
  Fix this by storing a linked list of vdevs in g_consumer's private field.
  
  sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
  
  * g_consumer.private now stores a linked list of vdev pointers associated
with the consumer instead of just a single vdev pointer.
  
  * Change vdev_geom_set_physpath's signature to more closely match
vdev_geom_set_rotation_rate
  
  * Don't bother calling g_access in vdev_geom_set_physpath. It's guaranteed
that we've already accessed the consumer by the time we get here.
  
  * Don't call vdev_geom_set_physpath in vdev_geom_attach. Instead, call it
in vdev_geom_open, after we know that the open has succeeded.
  
  PR:   218634
  Reviewed by:  gibbs
  MFC after:1 week
  Sponsored by: Spectra Logic Corp
  Differential Revision:https://reviews.freebsd.org/D10391

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 Thu May 
11 15:19:04 2017(r318188)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Thu May 
11 16:26:56 2017(r318189)
@@ -49,6 +49,16 @@ struct g_class zfs_vdev_class = {
.attrchanged = vdev_geom_attrchanged,
 };
 
+struct consumer_vdev_elem {
+   SLIST_ENTRY(consumer_vdev_elem) elems;
+   vdev_t  *vd;
+};
+
+SLIST_HEAD(consumer_priv_t, consumer_vdev_elem);
+_Static_assert(sizeof(((struct g_consumer*)NULL)->private)
+== sizeof(struct consumer_priv_t*),
+"consumer_priv_t* can't be stored in g_consumer.private");
+
 DECLARE_GEOM_CLASS(zfs_vdev_class, zfs_vdev);
 
 SYSCTL_DECL(_vfs_zfs_vdev);
@@ -85,21 +95,16 @@ vdev_geom_set_rotation_rate(vdev_t *vd, 
 }
 
 static void
-vdev_geom_set_physpath(struct g_consumer *cp, boolean_t do_null_update)
+vdev_geom_set_physpath(vdev_t *vd, struct g_consumer *cp,
+  boolean_t do_null_update)
 {
boolean_t needs_update = B_FALSE;
-   vdev_t *vd;
char *physpath;
int error, physpath_len;
 
-   if (g_access(cp, 1, 0, 0) != 0)
-   return;
-
-   vd = cp->private;
physpath_len = MAXPATHLEN;
physpath = g_malloc(physpath_len, M_WAITOK|M_ZERO);
error = g_io_getattr("GEOM::physpath", cp, _len, physpath);
-   g_access(cp, -1, 0, 0);
if (error == 0) {
char *old_physpath;
 
@@ -130,37 +135,40 @@ vdev_geom_set_physpath(struct g_consumer
 static void
 vdev_geom_attrchanged(struct g_consumer *cp, const char *attr)
 {
-   vdev_t *vd;
char *old_physpath;
+   struct consumer_priv_t *priv;
+   struct consumer_vdev_elem *elem;
int error;
 
-   vd = cp->private;
-   if (vd == NULL)
+   priv = (struct consumer_priv_t*)>private;
+   if (SLIST_EMPTY(priv))
return;
 
-   if (strcmp(attr, "GEOM::rotation_rate") == 0) {
-   vdev_geom_set_rotation_rate(vd, cp);
-   return;
-   }
-
-   if (strcmp(attr, "GEOM::physpath") == 0) {
-   vdev_geom_set_physpath(cp, /*do_null_update*/B_TRUE);
-   return;
+   SLIST_FOREACH(elem, priv, elems) {
+   vdev_t *vd = elem->vd;
+   if (strcmp(attr, "GEOM::rotation_rate") == 0) {
+   vdev_geom_set_rotation_rate(vd, cp);
+   return;
+   }
+   if (strcmp(attr, "GEOM::physpath") == 0) {
+   vdev_geom_set_physpath(vd, cp, /*null_update*/B_TRUE);
+   return;
+   }
}
 }
 
 static void
 vdev_geom_orphan(struct g_consumer *cp)
 {
-   vdev_t *vd;
+   struct consumer_priv_t *priv;
+   struct consumer_vdev_elem *elem;
 
g_topology_assert();
 
-   vd = cp->private;
-   if (vd == NULL) {
+   priv = (struct consumer_priv_t*)>private;
+   if (SLIST_EMPTY(priv))
/* Vdev close in progress.  Ignore the event. */
return;
-   }
 
/*
 * Orphan callbacks occur from the GEOM event thread.
@@ -176,8 +184,12 @@ vdev_geom_orphan(struct g_consumer *cp)
 * async removal support to invoke a close on this
 * vdev once it is 

svn commit: r318188 - in head/sys/dev: mpr mps

2017-05-11 Thread Scott Long
Author: scottl
Date: Thu May 11 15:19:04 2017
New Revision: 318188
URL: https://svnweb.freebsd.org/changeset/base/318188

Log:
  Improve error messages during command timeout for the mpr and mps
  drivers.
  
  Sponsored by: Netflix

Modified:
  head/sys/dev/mpr/mpr_sas.c
  head/sys/dev/mps/mps_sas.c

Modified: head/sys/dev/mpr/mpr_sas.c
==
--- head/sys/dev/mpr/mpr_sas.c  Thu May 11 13:50:16 2017(r318187)
+++ head/sys/dev/mpr/mpr_sas.c  Thu May 11 15:19:04 2017(r318188)
@@ -1562,7 +1562,7 @@ mprsas_send_abort(struct mpr_softc *sc, 
return -1;
}
 
-   mprsas_log_command(tm, MPR_RECOVERY|MPR_INFO,
+   mprsas_log_command(cm, MPR_RECOVERY|MPR_INFO,
"Aborting command %p\n", cm);
 
req = (MPI2_SCSI_TASK_MANAGE_REQUEST *)tm->cm_req;
@@ -1594,7 +1594,7 @@ mprsas_send_abort(struct mpr_softc *sc, 
 
err = mpr_map_command(sc, tm);
if (err)
-   mprsas_log_command(tm, MPR_RECOVERY,
+   mpr_dprint(sc, MPR_RECOVERY,
"error %d sending abort for cm %p SMID %u\n",
err, cm, req->TaskMID);
return err;
@@ -1635,8 +1635,9 @@ mprsas_scsiio_timeout(void *data)
targ = cm->cm_targ;
targ->timeouts++;
 
-   mprsas_log_command(cm, MPR_ERROR, "command timeout cm %p ccb %p target "
-   "%u, handle(0x%04x)\n", cm, cm->cm_ccb, targ->tid, targ->handle);
+   mprsas_log_command(cm, MPR_ERROR, "command timeout %d cm %p target "
+   "%u, handle(0x%04x)\n", cm->cm_ccb->ccb_h.timeout, cm,  targ->tid,
+   targ->handle);
if (targ->encl_level_valid) {
mpr_dprint(sc, MPR_ERROR, "At enclosure level %d, slot %d, "
"connector name (%4s)\n", targ->encl_level, targ->encl_slot,

Modified: head/sys/dev/mps/mps_sas.c
==
--- head/sys/dev/mps/mps_sas.c  Thu May 11 13:50:16 2017(r318187)
+++ head/sys/dev/mps/mps_sas.c  Thu May 11 15:19:04 2017(r318188)
@@ -1505,7 +1505,7 @@ mpssas_send_abort(struct mps_softc *sc, 
return -1;
}
 
-   mpssas_log_command(tm, MPS_RECOVERY|MPS_INFO,
+   mpssas_log_command(cm, MPS_RECOVERY|MPS_INFO,
"Aborting command %p\n", cm);
 
req = (MPI2_SCSI_TASK_MANAGE_REQUEST *)tm->cm_req;
@@ -1536,7 +1536,7 @@ mpssas_send_abort(struct mps_softc *sc, 
 
err = mps_map_command(sc, tm);
if (err)
-   mpssas_log_command(tm, MPS_RECOVERY,
+   mps_dprint(sc, MPS_RECOVERY,
"error %d sending abort for cm %p SMID %u\n",
err, cm, req->TaskMID);
return err;
@@ -1574,12 +1574,13 @@ mpssas_scsiio_timeout(void *data)
return;
}
 
-   mpssas_log_command(cm, MPS_INFO, "command timeout cm %p ccb %p\n", 
-   cm, cm->cm_ccb);
-
targ = cm->cm_targ;
targ->timeouts++;
 
+   mpssas_log_command(cm, MPS_ERROR, "command timeout %d cm %p target "
+   "%u, handle(0x%04x)\n", cm->cm_ccb->ccb_h.timeout, cm,  targ->tid,
+   targ->handle);
+
/* XXX first, check the firmware state, to see if it's still
 * operational.  if not, do a diag reset.
 */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318185 - in head: lib/libmt usr.bin/mt

2017-05-11 Thread Kenneth D. Merry
Author: ken
Date: Thu May 11 13:46:30 2017
New Revision: 318185
URL: https://svnweb.freebsd.org/changeset/base/318185

Log:
  Add LTO-8 density codes.
  
  lib/libmt/mtlib.c:
Add the LTO-8 density code to the density table in libmt.
  
  usr.bin/mt/mt.1:
Add the LTO-8 density code, tracks, bpmm, and bpi to the density
table in the mt(1) man page.
  
  MFC after:3 days
  Sponsored by: Spectra Logic

Modified:
  head/lib/libmt/mtlib.c
  head/usr.bin/mt/mt.1

Modified: head/lib/libmt/mtlib.c
==
--- head/lib/libmt/mtlib.c  Thu May 11 11:13:02 2017(r318184)
+++ head/lib/libmt/mtlib.c  Thu May 11 13:46:30 2017(r318185)
@@ -644,6 +644,7 @@ static struct densities {
{ 0x58, 15142,  384607, "LTO-5" },
{ 0x5A, 15142,  384607, "LTO-6" },
{ 0x5C, 19107,  485318, "LTO-7" },
+   { 0x5E, 20669,  524993, "LTO-8" },
{ 0x71, 11800,  299720, "3592A1 (encrypted)" },
{ 0x72, 11800,  299720, "3592A2 (encrypted)" },
{ 0x73, 13452,  341681, "3592A3 (encrypted)" },

Modified: head/usr.bin/mt/mt.1
==
--- head/usr.bin/mt/mt.1Thu May 11 11:13:02 2017(r318184)
+++ head/usr.bin/mt/mt.1Thu May 11 13:46:30 2017(r318185)
@@ -29,7 +29,7 @@
 .\"@(#)mt.18.1 (Berkeley) 6/6/93
 .\" $FreeBSD$
 .\"
-.Dd May 5, 2017
+.Dd May 11, 2017
 .Dt MT 1
 .Os
 .Sh NAME
@@ -521,6 +521,7 @@ Value  WidthTracksDensity   
 0x58   12.7  (0.5) 1280  15,142 (384,607)   C   LTO-5
 0x5A   12.7  (0.5) 2176  15,142 (384,607)   C   LTO-6
 0x5C   12.7  (0.5) 3584  19,107 (485,318)   C   LTO-7
+0x5E   12.7  (0.5) 6656  20,669 (524,993)   C   LTO-8
 0x71   12.7  (0.5)  512  11,800 (299,720)   C   3592A1 (encrypted)
 0x72   12.7  (0.5)  896  11,800 (299,720)   C   3592A2 (encrypted)
 0x73   12.7  (0.5) 1152  13,452 (341,681)   C   3592A3 (encrypted)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r318161 - head/contrib/bmake

2017-05-11 Thread Renato Botelho
On 10/05/17 19:35, Ngie Cooper wrote:
> On Wed, May 10, 2017 at 3:31 PM, Ngie Cooper  wrote:
>> On Wed, May 10, 2017 at 3:24 PM, Simon J. Gerraty  wrote:
>>> Author: sjg
>>> Date: Wed May 10 22:24:09 2017
>>> New Revision: 318161
>>> URL: https://svnweb.freebsd.org/changeset/base/318161
>>>
>>> Log:
>>>   Ensure buf2 is in scope
>>
>> I think this is the proper fix for the issue that Bryan, Ravi, and I
> 
> Ravi -> Renato
> 
>> reported.. also reported as Coverity CID: 1374641.

Yeah, it fixed the problem to me.

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


svn commit: r318182 - head/share/man/man7

2017-05-11 Thread Edward Tomasz Napierala
Author: trasz
Date: Thu May 11 08:39:55 2017
New Revision: 318182
URL: https://svnweb.freebsd.org/changeset/base/318182

Log:
  Improve build(7): add missing "buildkernel" and "installkernel"
  to the example, change the architectures to something more common,
  and improve description of defaults for TARGET.
  
  Reviewed by:  bdrewery, ngie, imp (older revisions)
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D10654

Modified:
  head/share/man/man7/build.7

Modified: head/share/man/man7/build.7
==
--- head/share/man/man7/build.7 Thu May 11 08:22:01 2017(r318181)
+++ head/share/man/man7/build.7 Thu May 11 08:39:55 2017(r318182)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 22, 2017
+.Dd May 11, 2017
 .Dt BUILD 7
 .Os
 .Sh NAME
@@ -528,7 +528,10 @@ and
 .Va TARGET Ns = Ns Li arm64 .
 If not set,
 .Va TARGET
-defaults to the current hardware platform.
+defaults to the current hardware platform, unless
+.Va TARGET_ARCH
+is also set, in which case it defaults to the appropriate
+value for that architecture.
 .It Va TARGET_ARCH
 The target machine processor architecture.
 This is analogous to the
@@ -689,11 +692,11 @@ section in
 .Pa src/UPDATING .
 .Pp
 The following sequence of commands can be used to cross-build the
-system for the sparc64 architecture on an i386 host:
+system for the armv6 architecture on an amd64 host:
 .Bd -literal -offset indent
 cd /usr/src
-make TARGET=sparc64 buildworld
-make TARGET=sparc64 DESTDIR=/clients/sparc64 installworld
+make TARGET_ARCH=armv6 buildworld buildkernel
+make TARGET_ARCH=armv6 DESTDIR=/clients/arm64 installworld installkernel
 .Ed
 .Sh SEE ALSO
 .Xr cc 1 ,
@@ -702,6 +705,7 @@ make TARGET=sparc64 DESTDIR=/clients/spa
 .Xr svn 1 ,
 .Xr make.conf 5 ,
 .Xr src.conf 5 ,
+.Xr arch 7 ,
 .Xr ports 7 ,
 .Xr release 7 ,
 .Xr tests 7 ,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318181 - head/contrib/libarchive/cpio/test

2017-05-11 Thread Ngie Cooper
Author: ngie
Date: Thu May 11 08:22:01 2017
New Revision: 318181
URL: https://svnweb.freebsd.org/changeset/base/318181

Log:
  cpio/tests/test_option_lz4: fix a use after free in the failure case
  
  This change will be upstreamed to the libarchive project.
  
  MFC after:6 days
  MFC with: r317782
  Reported by:  Coverity
  Sponsored by: Dell EMC Isilon

Modified:
  head/contrib/libarchive/cpio/test/test_option_lz4.c

Modified: head/contrib/libarchive/cpio/test/test_option_lz4.c
==
--- head/contrib/libarchive/cpio/test/test_option_lz4.c Thu May 11 08:06:46 
2017(r318180)
+++ head/contrib/libarchive/cpio/test/test_option_lz4.c Thu May 11 08:22:01 
2017(r318181)
@@ -74,8 +74,8 @@ DEFINE_TEST(test_option_lz4)
free(p);
return;
}
-   free(p);
failure("--lz4 option is broken: %s", p);
+   free(p);
assertEqualInt(r, 0);
return;
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318180 - head/tests/sys/aio

2017-05-11 Thread Ngie Cooper
Author: ngie
Date: Thu May 11 08:06:46 2017
New Revision: 318180
URL: https://svnweb.freebsd.org/changeset/base/318180

Log:
  Mark all md tests as requiring unsafe AIO in order to function
  
  These tests have been flapping (failing<->passing) on Jenkins for months.
  It passes reliably for me if unsafe AIO is permitted, but it doesn't
  pass on Jenkins reliably if unsafe AIO is disabled (the current default).
  
  Mark the tests as requiring unsafe AIO to mitigate the intermittent
  failures when unsafe AIO isn't permitted. If the kernel code is changed
  to reliably function with md(4) devices using unsafe AIO, this commit can
  be reverted.
  
  MFC after:2 months
  PR:   217261
  Reported by:  Jenkins
  Sponsored by: Dell EMC Isilon

Modified:
  head/tests/sys/aio/aio_test.c

Modified: head/tests/sys/aio/aio_test.c
==
--- head/tests/sys/aio/aio_test.c   Thu May 11 07:58:04 2017
(r318179)
+++ head/tests/sys/aio/aio_test.c   Thu May 11 08:06:46 2017
(r318180)
@@ -735,6 +735,7 @@ aio_md_test(completion comp)
struct md_ioctl mdio;
 
ATF_REQUIRE_KERNEL_MODULE("aio");
+   ATF_REQUIRE_UNSAFE_AIO();
 
mdctl_fd = open("/dev/" MDCTL_NAME, O_RDWR, 0);
ATF_REQUIRE_MSG(mdctl_fd != -1,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318179 - head/usr.bin/procstat

2017-05-11 Thread Ngie Cooper
Author: ngie
Date: Thu May 11 07:58:04 2017
New Revision: 318179
URL: https://svnweb.freebsd.org/changeset/base/318179

Log:
  procstat(1): also reference icmp(4) and sctp(4)
  
  This was missed in the previous commit by accident.
  
  MFC after:3 weeks
  MFC with: r318178
  Sponsored by: Dell EMC Isilon

Modified:
  head/usr.bin/procstat/procstat.1

Modified: head/usr.bin/procstat/procstat.1
==
--- head/usr.bin/procstat/procstat.1Thu May 11 07:55:38 2017
(r318178)
+++ head/usr.bin/procstat/procstat.1Thu May 11 07:58:04 2017
(r318179)
@@ -602,7 +602,9 @@ auxiliary vector value
 .Xr xo_parse_args 3 ,
 .Xr ddb 4 ,
 .Xr divert 4 ,
+.Xr icmp 4 ,
 .Xr ip 4 ,
+.Xr sctp 4 ,
 .Xr tcp 4 ,
 .Xr udp 4 ,
 .Xr stack 9
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318178 - head/usr.bin/procstat

2017-05-11 Thread Ngie Cooper
Author: ngie
Date: Thu May 11 07:55:38 2017
New Revision: 318178
URL: https://svnweb.freebsd.org/changeset/base/318178

Log:
  procstat(1): document all possible `PRO` (network protocol) values
  
  Reference the appropriate section 4 manpages for networking
  protocols.
  
  MFC after:3 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/usr.bin/procstat/procstat.1

Modified: head/usr.bin/procstat/procstat.1
==
--- head/usr.bin/procstat/procstat.1Thu May 11 06:57:20 2017
(r318177)
+++ head/usr.bin/procstat/procstat.1Thu May 11 07:55:38 2017
(r318178)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 10, 2017
+.Dd May 11, 2017
 .Dt PROCSTAT 1
 .Os
 .Sh NAME
@@ -271,6 +271,60 @@ omitted, and a new capabilities field wi
 as described in
 .Xr cap_rights_limit 2 ,
 present for each capability descriptor.
+.Pp
+The following network protocols may be displayed (grouped by address family):
+.Pp
+.Dv AF_INET ,
+.Dv AF_INET6
+.Pp
+.Bl -tag -width indent -compact
+.It ICM
+.Dv IPPROTO_ICMP ;
+see
+.Xr icmp 4 .
+.It IPD
+.Dv IPPROTO_DIVERT ;
+see
+.Xr divert 4 .
+.It IP\?
+unknown protocol.
+.It RAW
+.Dv IPPROTO_RAW ;
+see
+.Xr ip 4 .
+.It SCT
+.Dv IPPROTO_SCTP ;
+see
+.Xr sctp 4 .
+.It TCP
+.Dv IPPROTO_TCP ;
+see
+.Xr tcp 4 .
+.It UDP
+.Dv IPPROTO_UDP ;
+see
+.Xr udp 4 .
+.El
+.Pp
+.Dv AF_LOCAL
+.Pp
+.Bl -tag -width indent -compact
+.It UDD
+.Dv IPPROTO_UDP ;
+see
+.Xr udp 4 .
+.It UDS
+.Dv IPPROTO_TCP ;
+see
+.Xr tcp 4 .
+.It UD\?
+unknown protocol.
+.El
+.Pp
+.Bl -tag -width indent -compact
+.It \?
+unknown address family.
+.El
 .Ss Signal Disposition Information
 Display signal pending and disposition for a process:
 .Pp
@@ -547,6 +601,10 @@ auxiliary vector value
 .Xr signal 3 ,
 .Xr xo_parse_args 3 ,
 .Xr ddb 4 ,
+.Xr divert 4 ,
+.Xr ip 4 ,
+.Xr tcp 4 ,
+.Xr udp 4 ,
 .Xr stack 9
 .Sh AUTHORS
 .An Robert N M Watson Aq Mt rwat...@freebsd.org .
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318177 - in head: share/man/man4 tools/build/mk

2017-05-11 Thread Ngie Cooper
Author: ngie
Date: Thu May 11 06:57:20 2017
New Revision: 318177
URL: https://svnweb.freebsd.org/changeset/base/318177

Log:
  Unconditionally install udp(4) and udplite(4) again
  
  I added this to the MK_USB != no block in error in r278202.
  
  MFC after:3 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/share/man/man4/Makefile
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileThu May 11 06:46:39 2017
(r318176)
+++ head/share/man/man4/MakefileThu May 11 06:57:20 2017
(r318177)
@@ -528,6 +528,8 @@ MAN=aac.4 \
tws.4 \
tx.4 \
txp.4 \
+   udp.4 \
+   udplite.4 \
ure.4 \
vale.4 \
vga.4 \
@@ -924,8 +926,6 @@ MAN+=   \
ucycom.4 \
udav.4 \
udbp.4 \
-   udp.4 \
-   udplite.4 \
udl.4 \
uep.4 \
ufm.4 \

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Thu May 11 06:46:39 
2017(r318176)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Thu May 11 06:57:20 
2017(r318177)
@@ -9342,8 +9342,6 @@ OLD_FILES+=usr/share/man/man4/ucom.4.gz
 OLD_FILES+=usr/share/man/man4/ucycom.4.gz
 OLD_FILES+=usr/share/man/man4/udav.4.gz
 OLD_FILES+=usr/share/man/man4/udbp.4.gz
-OLD_FILES+=usr/share/man/man4/udp.4.gz
-OLD_FILES+=usr/share/man/man4/udplite.4.gz
 OLD_FILES+=usr/share/man/man4/uep.4.gz
 OLD_FILES+=usr/share/man/man4/ufm.4.gz
 OLD_FILES+=usr/share/man/man4/ufoma.4.gz
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r318160 - in head: sbin/ifconfig sys/net sys/sys

2017-05-11 Thread Ravi Pokala
Fixed in r318176. Sorry for the breakage everyone. :-p

-Ravi (rpokala@)

-Original Message-
From: Ravi Pokala 
Date: 2017-05-10, Wednesday at 22:47
To: Kristof Provost 
Cc: , , 

Subject: Re: svn commit: r318160 - in head: sbin/ifconfig sys/net sys/sys

-Original Message-
> From:  on behalf of Kristof Provost 
> 
> Date: 2017-05-10, Wednesday at 22:38
> To: Ravi Pokala 
> Cc: , , 
> 
> Subject: Re: svn commit: r318160 - in head: sbin/ifconfig sys/net sys/sys
> 
> On 11 May 2017, at 11:05, Kristof Provost wrote:
>> On 11 May 2017, at 3:43, Ravi Pokala wrote:
>>> Author: rpokala
>>> Date: Wed May 10 22:13:47 2017
>>> New Revision: 318160
>>> URL: https://svnweb.freebsd.org/changeset/base/318160
>>>
>>> Log:
>>>   Persistently store NIC's hardware MAC address, and add a way to 
>>> retrive it
>>>
>>
>> This seems to cause panics when I create a bridge interface:
>>
>> #10 0x80ef9304 in bcopy () at 
>> /usr/src/sys/amd64/amd64/support.S:139
>> #11 0x80b57a80 in ether_ifattach (ifp=0xf80035663000, 
>> lla=0xf800090e13f8 "\002k") at /usr/src/sys/net/if_ethersubr.c:919
>> #12 0x8325dc67 in bridge_clone_create (ifc=> out>, unit=, params=) at 
>> /usr/src/sys/net/if_bridge.c:704
>> ...
>>
>> ifp->if_hw_addr is NULL here:
>> (kgdb) fr 11
>> #11 0x80b57a80 in ether_ifattach (ifp=0xf80035663000, 
>> lla=0xf800090e13f8 "\002k") at /usr/src/sys/net/if_ethersubr.c:919
>> 919 bcopy(lla, ifp->if_hw_addr, ifp->if_addrlen);
>> (kgdb) p ifp->if_hw_addr
>> $1 = (void *) 0x0
>>
> 
> This may be because I’ve not yet updated world, just the kernel, but 
> clearly that still shouldn’t cause panics.
> 
> Regards,
> Kristof

No, this is purely a kernel mistake -- I forgot to add a NULL-check in 
ether_ifattach(). :-p

Fixing now...

-Ravi (rpokala@)



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

svn commit: r318176 - head/sys/net

2017-05-11 Thread Ravi Pokala
Author: rpokala
Date: Thu May 11 06:46:39 2017
New Revision: 318176
URL: https://svnweb.freebsd.org/changeset/base/318176

Log:
  Persistently store NIC's hardware MAC address, and add a way to retrive it
  
  An earlier version of r318160 allocated if_hw_addr unconditionally; when it
  became conditional, I forgot to check for NULL in ether_ifattach().
  
  Reviewed by:  kp
  MFC after:1 week
  MFC with: r318160
  Sponsored by: Panasas
  Differential Revision:https://reviews.freebsd.org/D10678
  Pointy-hat to:rpokala

Modified:
  head/sys/net/if_ethersubr.c

Modified: head/sys/net/if_ethersubr.c
==
--- head/sys/net/if_ethersubr.c Thu May 11 06:35:23 2017(r318175)
+++ head/sys/net/if_ethersubr.c Thu May 11 06:46:39 2017(r318176)
@@ -916,7 +916,8 @@ ether_ifattach(struct ifnet *ifp, const 
sdl->sdl_alen = ifp->if_addrlen;
bcopy(lla, LLADDR(sdl), ifp->if_addrlen);
 
-   bcopy(lla, ifp->if_hw_addr, ifp->if_addrlen);
+   if (ifp->if_hw_addr != NULL)
+   bcopy(lla, ifp->if_hw_addr, ifp->if_addrlen);
 
bpfattach(ifp, DLT_EN10MB, ETHER_HDR_LEN);
if (ng_ether_attach_p != NULL)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318175 - head/usr.bin/procstat

2017-05-11 Thread Ngie Cooper
Author: ngie
Date: Thu May 11 06:35:23 2017
New Revision: 318175
URL: https://svnweb.freebsd.org/changeset/base/318175

Log:
  procstat(1): clarify the Signal Disposition section
  
  - Fix a typo (SIGIGN -> SIG_IGN). Use .Dv when referencing SIG_IGN.
  - Use semi-colons as soft breaks when separating sentences for
the FLAGS section.
  - Tweak wording for C slightly to flow better and to be a bit
more technically correct (signals with handlers installed will
be caught by the target program).
  - Reference signal(3) in the SEE ALSO section.
  
  MFC after:3 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/usr.bin/procstat/procstat.1

Modified: head/usr.bin/procstat/procstat.1
==
--- head/usr.bin/procstat/procstat.1Thu May 11 06:24:57 2017
(r318174)
+++ head/usr.bin/procstat/procstat.1Thu May 11 06:35:23 2017
(r318175)
@@ -285,11 +285,13 @@ signal name
 process signal disposition details, three symbols
 .Bl -tag -width X -compact
 .It P
-if signal is pending in the global process queue, - otherwise
+if signal is pending in the global process queue; - otherwise.
 .It I
-if signal delivery disposition is SIGIGN, - otherwise
+if signal delivery disposition is
+.Dv SIG_IGN;
+- otherwise.
 .It C
-if signal delivery is to catch it, - otherwise
+if the signal will be caught; - otherwise.
 .El
 .El
 .Pp
@@ -542,6 +544,7 @@ auxiliary vector value
 .Xr cap_rights_limit 2 ,
 .Xr libprocstat 3 ,
 .Xr libxo 3 ,
+.Xr signal 3 ,
 .Xr xo_parse_args 3 ,
 .Xr ddb 4 ,
 .Xr stack 9
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318174 - head/usr.bin/procstat

2017-05-11 Thread Ngie Cooper
Author: ngie
Date: Thu May 11 06:24:57 2017
New Revision: 318174
URL: https://svnweb.freebsd.org/changeset/base/318174

Log:
  procstat(1): fix a typo (it's -> its)
  
  MFC after:3 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/usr.bin/procstat/procstat.1

Modified: head/usr.bin/procstat/procstat.1
==
--- head/usr.bin/procstat/procstat.1Thu May 11 04:39:11 2017
(r318173)
+++ head/usr.bin/procstat/procstat.1Thu May 11 06:24:57 2017
(r318174)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 5, 2015
+.Dd May 10, 2017
 .Dt PROCSTAT 1
 .Os
 .Sh NAME
@@ -80,7 +80,7 @@ printed.
 .It Fl l
 Display resource limits for the process.
 .It Fl L
-Display LWP info for the process pertaining to it's signal driven exit.
+Display LWP info for the process pertaining to its signal driven exit.
 .It Fl r
 Display resource usage information for the process.
 .It Fl s
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"