From owner-svn-src-head@FreeBSD.ORG Sun Apr 28 00:52:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5F2C264D; Sun, 28 Apr 2013 00:52:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 37315110D; Sun, 28 Apr 2013 00:52:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3S0qOKJ044043; Sun, 28 Apr 2013 00:52:24 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3S0qOfL044037; Sun, 28 Apr 2013 00:52:24 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304280052.r3S0qOfL044037@svn.freebsd.org> From: Adrian Chadd Date: Sun, 28 Apr 2013 00:52:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250006 - in head/sys/contrib/dev/ath: . ath_hal X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 00:52:25 -0000 Author: adrian Date: Sun Apr 28 00:52:23 2013 New Revision: 250006 URL: http://svnweb.freebsd.org/changeset/base/250006 Log: Create a placeholder directory for the upcoming ar9300 HAL from qcamain_open_hal. Added: head/sys/contrib/dev/ath/ head/sys/contrib/dev/ath/ath_hal/ From owner-svn-src-head@FreeBSD.ORG Sun Apr 28 00:53:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AB7557C2; Sun, 28 Apr 2013 00:53:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 827B51114; Sun, 28 Apr 2013 00:53:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3S0rVKt044282; Sun, 28 Apr 2013 00:53:31 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3S0rVfd044281; Sun, 28 Apr 2013 00:53:31 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304280053.r3S0rVfd044281@svn.freebsd.org> From: Adrian Chadd Date: Sun, 28 Apr 2013 00:53:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250007 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 00:53:31 -0000 Author: adrian Date: Sun Apr 28 00:53:31 2013 New Revision: 250007 URL: http://svnweb.freebsd.org/changeset/base/250007 Log: Copy the vendor branch ar9300 code from qcamain_open_hal into this directory. Only copy the ar9300 HAL, we don't want to grab everything. Added: head/sys/contrib/dev/ath/ath_hal/ar9300/ - copied from r250006, vendor/qcamain_open_hal/dist/hal/ar9300/ From owner-svn-src-head@FreeBSD.ORG Sun Apr 28 00:57:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 61CC2AE2; Sun, 28 Apr 2013 00:57:51 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 52F171133; Sun, 28 Apr 2013 00:57:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3S0vmVS045089; Sun, 28 Apr 2013 00:57:48 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3S0vlJp045085; Sun, 28 Apr 2013 00:57:47 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304280057.r3S0vlJp045085@svn.freebsd.org> From: Adrian Chadd Date: Sun, 28 Apr 2013 00:57:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250008 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 00:57:51 -0000 Author: adrian Date: Sun Apr 28 00:57:47 2013 New Revision: 250008 URL: http://svnweb.freebsd.org/changeset/base/250008 Log: Bring over my FreeBSD modifications for the AR9300 HAL to make it work in FreeBSD. This is still heavily a work in progress but I'd rather it start shipping in -HEAD sooner rather than later. This doesn't (yet) link it into the build system either for a static kernel or as a module; that will come later (after many, many make universe tests.) Added: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_devid.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd_inc.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.h Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_beacon.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_gpio.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_interrupts.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_keycache.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_paprd.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_phy.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_power.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radar.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radio.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_recv.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_recv_ds.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_timer.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_xmit.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_xmit_ds.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300desc.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300paprd.h Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h Sun Apr 28 00:53:31 2013 (r250007) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h Sun Apr 28 00:57:47 2013 (r250008) @@ -17,11 +17,31 @@ #ifndef _ATH_AR9300_H_ #define _ATH_AR9300_H_ +#include "ar9300_freebsd_inc.h" + +#define AH_BIG_ENDIAN 4321 +#define AH_LITTLE_ENDIAN 1234 + +#if _BYTE_ORDER == _BIG_ENDIAN +#define AH_BYTE_ORDER AH_BIG_ENDIAN +#else +#define AH_BYTE_ORDER AH_LITTLE_ENDIAN +#endif + +/* XXX doesn't belong here */ +#define AR_EEPROM_MODAL_SPURS 5 + +/* + * (a) this should be N(a), + * (b) FreeBSD does define nitems, + * (c) it doesn't have an AH_ prefix, sigh. + */ +#define ARRAY_LENGTH(a) (sizeof(a) / sizeof((a)[0])) + #include "ah_internal.h" #include "ah_eeprom.h" #include "ah_devid.h" #include "ar9300eep.h" /* For Eeprom definitions */ -#include "asf_amem.h" #define AR9300_MAGIC 0x19741014 @@ -117,9 +137,9 @@ typedef struct { /* RF HAL structures */ typedef struct rf_hal_funcs { - HAL_BOOL (*set_channel)(struct ath_hal *, HAL_CHANNEL_INTERNAL *); - HAL_BOOL (*get_chip_power_lim)(struct ath_hal *ah, HAL_CHANNEL *chans, - u_int32_t nchancs); + HAL_BOOL (*set_channel)(struct ath_hal *, struct ieee80211_channel *); + HAL_BOOL (*get_chip_power_lim)(struct ath_hal *ah, + struct ieee80211_channel *chan); } RF_HAL_FUNCS; struct ar9300_ani_default { @@ -143,7 +163,7 @@ struct ar9300_ani_default { * Per-channel ANI state private to the driver. */ struct ar9300_ani_state { - HAL_CHANNEL c; + struct ieee80211_channel c; /* XXX ew? */ HAL_BOOL must_restore; HAL_BOOL ofdms_turn; u_int8_t ofdm_noise_immunity_level; @@ -256,7 +276,7 @@ struct ar9300_ar_state { }; struct ar9300_radar_state { - HAL_CHANNEL_INTERNAL *rs_chan; /* Channel info */ + struct ieee80211_channel *rs_chan; /* Channel info */ u_int8_t rs_chan_index; /* Channel index in radar structure */ u_int32_t rs_num_radar_events; /* Number of radar events */ int32_t rs_firpwr; /* Thresh to check radar sig is gone */ @@ -380,9 +400,15 @@ struct ar9300_paprd_pwr_adjust { u_int32_t sub_db; // offset value unit of dB }; +struct ar9300NfLimits { + int16_t max; + int16_t min; + int16_t nominal; +}; + #define AR9300_MAX_RATES 36 /* legacy(4) + ofdm(8) + HTSS(8) + HTDS(8) + HTTS(8)*/ struct ath_hal_9300 { - struct ath_hal_private_tables ah_priv; /* base class */ + struct ath_hal_private ah_priv; /* base class */ /* * Information retrieved from EEPROM. @@ -582,6 +608,13 @@ struct ath_hal_9300 { /* bb hang detection */ int ah_hang[6]; hal_hw_hangs_t ah_hang_wars; + + /* + * Keytable type table + */ +#define AR_KEYTABLE_SIZE 128 /* XXX! */ + uint8_t ah_keytype[AR_KEYTABLE_SIZE]; +#undef AR_KEYTABLE_SIZE /* * Support for ar9300 multiple INIs */ @@ -647,7 +680,6 @@ struct ath_hal_9300 { /* adjusted power for descriptor-based TPC for 1, 2, or 3 chains */ int16_t txpower[AR9300_MAX_RATES][AR9300_MAX_CHAINS]; - /* adjusted power for descriptor-based TPC for 1, 2, or 3 chains with STBC*/ int16_t txpower_stbc[AR9300_MAX_RATES][AR9300_MAX_CHAINS]; @@ -819,7 +851,33 @@ struct ath_hal_9300 { u_int32_t ah_mcast_filter_l32_set; u_int32_t ah_mcast_filter_u32_set; #endif - HAL_BOOL ah_reduced_self_gen_mask; + HAL_BOOL ah_reduced_self_gen_mask; + + /* Local additions for FreeBSD */ + /* + * These fields are in the top level HAL in the atheros + * codebase; here we place them in the AR9300 HAL and + * access them via accessor methods if the driver requires them. + */ + u_int32_t ah_ob_db1[3]; + u_int32_t ah_db2[3]; + u_int32_t ah_bb_panic_timeout_ms; + u_int32_t ah_bb_panic_last_status; + u_int32_t ah_tx_trig_level; + u_int16_t ath_hal_spur_chans[AR_EEPROM_MODAL_SPURS][2]; + int16_t nf_cw_int_delta; /* diff btwn nominal NF and CW interf threshold */ + int ah_phyrestart_disabled; + HAL_RSSI_TX_POWER green_tx_status; + int green_ap_ps_on; + int ah_enable_keysearch_always; + int ah_fccaifs; + int ah_reset_reason; + int ah_dcs_enable; + + struct ar9300NfLimits nf_2GHz; + struct ar9300NfLimits nf_5GHz; + struct ar9300NfLimits *nfp; + }; #define AH9300(_ah) ((struct ath_hal_9300 *)(_ah)) @@ -830,11 +888,7 @@ struct ath_hal_9300 { #define ar9300_eep_data_in_flash(_ah) \ (!(AH_PRIVATE(_ah)->ah_flags & AH_USE_EEPROM)) -#define IS_5GHZ_FAST_CLOCK_EN(_ah, _c) \ - (IS_CHAN_5GHZ(_c) && \ - ((AH_PRIVATE(_ah))->ah_config.ath_hal_fastClockEnable)) - -#if notyet +#ifdef notyet // Need these additional conditions for IS_5GHZ_FAST_CLOCK_EN when we have valid eeprom contents. && \ ((ar9300_eeprom_get(AH9300(_ah), EEP_MINOR_REV) <= AR9300_EEP_MINOR_VER_16) || \ @@ -880,9 +934,6 @@ struct ath_hal_9300 { " not supported but called from %s\n", (func)) #endif /* AH_ASSERT */ -extern void ar9300_detach(struct ath_hal *ah); -extern void ar9300_get_desc_info(struct ath_hal *ah, HAL_DESC_INFO *desc_info); - /* * Green Tx, Based on different RSSI of Received Beacon thresholds, * using different tx power by modified register tx power related values. @@ -1129,15 +1180,10 @@ extern HAL_BOOL ar9300_rf_attach(struct struct ath_hal; extern struct ath_hal_9300 * ar9300_new_state(u_int16_t devid, - HAL_ADAPTER_HANDLE osdev, HAL_SOFTC sc, - HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_BUS_TYPE bustype, - asf_amem_instance_handle amem_handle, - struct hal_reg_parm *hal_conf_parm, HAL_STATUS *status); + HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata, + HAL_STATUS *status); extern struct ath_hal * ar9300_attach(u_int16_t devid, - HAL_ADAPTER_HANDLE osdev, HAL_SOFTC sc, - HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_BUS_TYPE bustype, - asf_amem_instance_handle amem_handle, - struct hal_reg_parm *hal_conf_parm, + HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata, HAL_STATUS *status); extern void ar9300_detach(struct ath_hal *ah); extern void ar9300_read_revisions(struct ath_hal *ah); @@ -1162,6 +1208,9 @@ extern u_int32_t ar9300_get_intr_mitiga extern u_int32_t ar9300_get_key_cache_size(struct ath_hal *); extern HAL_BOOL ar9300_is_key_cache_entry_valid(struct ath_hal *, u_int16_t entry); extern HAL_BOOL ar9300_reset_key_cache_entry(struct ath_hal *ah, u_int16_t entry); +extern HAL_CHANNEL_INTERNAL * ar9300_check_chan(struct ath_hal *ah, + const struct ieee80211_channel *chan); + extern HAL_BOOL ar9300_set_key_cache_entry_mac(struct ath_hal *, u_int16_t entry, const u_int8_t *mac); extern HAL_BOOL ar9300_set_key_cache_entry(struct ath_hal *ah, u_int16_t entry, @@ -1173,13 +1222,12 @@ extern HAL_BOOL ar9300_set_mac_address( extern void ar9300_get_bss_id_mask(struct ath_hal *ah, u_int8_t *mac); extern HAL_BOOL ar9300_set_bss_id_mask(struct ath_hal *, const u_int8_t *); extern HAL_STATUS ar9300_select_ant_config(struct ath_hal *ah, u_int32_t cfg); -extern u_int32_t ar9300_ant_ctrl_common_get(struct ath_hal *ah, HAL_BOOL is_2ghz); extern HAL_BOOL ar9300_set_regulatory_domain(struct ath_hal *ah, u_int16_t reg_domain, HAL_STATUS *stats); extern u_int ar9300_get_wireless_modes(struct ath_hal *ah); extern void ar9300_enable_rf_kill(struct ath_hal *); -extern HAL_BOOL ar9300_gpio_cfg_output(struct ath_hal *, u_int32_t gpio, HAL_GPIO_OUTPUT_MUX_TYPE signalType); -extern HAL_BOOL ar9300_gpio_cfg_output_led_off(struct ath_hal *, u_int32_t gpio, HAL_GPIO_OUTPUT_MUX_TYPE signalType); +extern HAL_BOOL ar9300_gpio_cfg_output(struct ath_hal *, u_int32_t gpio, HAL_GPIO_MUX_TYPE signalType); +extern HAL_BOOL ar9300_gpio_cfg_output_led_off(struct ath_hal *, u_int32_t gpio, HAL_GPIO_MUX_TYPE signalType); extern HAL_BOOL ar9300_gpio_cfg_input(struct ath_hal *, u_int32_t gpio); extern HAL_BOOL ar9300_gpio_set(struct ath_hal *, u_int32_t gpio, u_int32_t val); extern u_int32_t ar9300_gpio_get(struct ath_hal *ah, u_int32_t gpio); @@ -1200,7 +1248,6 @@ extern int ar9300_ppm_get_trigger(struc extern u_int32_t ar9300_ppm_force(struct ath_hal *); extern void ar9300_ppm_un_force(struct ath_hal *); extern u_int32_t ar9300_ppm_get_force_state(struct ath_hal *); -extern u_int32_t ar9300_ppm_get_force_state(struct ath_hal *); extern void ar9300_set_dcs_mode(struct ath_hal *ah, u_int32_t); extern u_int32_t ar9300_get_dcs_mode(struct ath_hal *ah); extern u_int32_t ar9300_get_tsf32(struct ath_hal *ah); @@ -1219,7 +1266,8 @@ extern u_int32_t ar9300_get_rssi_chain0 extern u_int ar9300_get_def_antenna(struct ath_hal *ah); extern void ar9300_set_def_antenna(struct ath_hal *ah, u_int antenna); extern HAL_BOOL ar9300_set_antenna_switch(struct ath_hal *ah, - HAL_ANT_SETTING settings, HAL_CHANNEL *chan, u_int8_t *, u_int8_t *, u_int8_t *); + HAL_ANT_SETTING settings, const struct ieee80211_channel *chan, + u_int8_t *, u_int8_t *, u_int8_t *); extern HAL_BOOL ar9300_is_sleep_after_beacon_broken(struct ath_hal *ah); extern HAL_BOOL ar9300_set_slot_time(struct ath_hal *, u_int); extern HAL_BOOL ar9300_set_ack_timeout(struct ath_hal *, u_int); @@ -1235,7 +1283,7 @@ extern HAL_BOOL ar9300_get_diag_state(s const void *args, u_int32_t argsize, void **result, u_int32_t *resultsize); extern void ar9300_get_desc_info(struct ath_hal *ah, HAL_DESC_INFO *desc_info); -extern int8_t ar9300_get_11n_ext_busy(struct ath_hal *ah); +extern uint32_t ar9300_get_11n_ext_busy(struct ath_hal *ah); extern void ar9300_set_11n_mac2040(struct ath_hal *ah, HAL_HT_MACMODE mode); extern HAL_HT_RXCLEAR ar9300_get_11n_rx_clear(struct ath_hal *ah); extern void ar9300_set_11n_rx_clear(struct ath_hal *ah, HAL_HT_RXCLEAR rxclear); @@ -1256,7 +1304,7 @@ extern void ar9300_wow_apply_pattern(st u_int8_t *p_ath_mask, int32_t pattern_count, u_int32_t ath_pattern_len); //extern u_int32_t ar9300_wow_wake_up(struct ath_hal *ah,u_int8_t *chipPatternBytes); extern u_int32_t ar9300_wow_wake_up(struct ath_hal *ah, HAL_BOOL offloadEnable); -extern HAL_BOOL ar9300_wow_enable(struct ath_hal *ah, u_int32_t pattern_enable, u_int32_t timeout_in_seconds, int clearbssid, +extern bool ar9300_wow_enable(struct ath_hal *ah, u_int32_t pattern_enable, u_int32_t timeout_in_seconds, int clearbssid, HAL_BOOL offloadEnable); #if ATH_WOW_OFFLOAD /* ARP offload */ @@ -1318,24 +1366,25 @@ extern void ar9300_wowoffload_download_ #endif /* ATH_WOW_OFFLOAD */ #endif -extern HAL_BOOL ar9300_reset(struct ath_hal *ah, HAL_OPMODE opmode, - HAL_CHANNEL *chan, HAL_HT_MACMODE macmode, u_int8_t txchainmask, +extern HAL_BOOL ar9300_reset(struct ath_hal *ah, HAL_OPMODE opmode, + struct ieee80211_channel *chan, HAL_HT_MACMODE macmode, u_int8_t txchainmask, u_int8_t rxchainmask, HAL_HT_EXTPROTSPACING extprotspacing, HAL_BOOL b_channel_change, HAL_STATUS *status, int is_scan); -extern HAL_BOOL ar9300_lean_channel_change(struct ath_hal *ah, HAL_OPMODE opmode, HAL_CHANNEL *chan, +extern HAL_BOOL ar9300_lean_channel_change(struct ath_hal *ah, HAL_OPMODE opmode, struct ieee80211_channel *chan, HAL_HT_MACMODE macmode, u_int8_t txchainmask, u_int8_t rxchainmask); extern HAL_BOOL ar9300_set_reset_reg(struct ath_hal *ah, u_int32_t type); -extern void ar9300_init_pll(struct ath_hal *ah, HAL_CHANNEL *chan); +extern void ar9300_init_pll(struct ath_hal *ah, struct ieee80211_channel *chan); extern void ar9300_green_ap_ps_on_off( struct ath_hal *ah, u_int16_t rxMask); extern u_int16_t ar9300_is_single_ant_power_save_possible(struct ath_hal *ah); extern void ar9300_set_operating_mode(struct ath_hal *ah, int opmode); extern HAL_BOOL ar9300_phy_disable(struct ath_hal *ah); extern HAL_BOOL ar9300_disable(struct ath_hal *ah); -extern HAL_BOOL ar9300_chip_reset(struct ath_hal *ah, HAL_CHANNEL *); -extern HAL_BOOL ar9300_calibration(struct ath_hal *ah, HAL_CHANNEL *chan, +extern HAL_BOOL ar9300_chip_reset(struct ath_hal *ah, struct ieee80211_channel *); +extern HAL_BOOL ar9300_calibration(struct ath_hal *ah, struct ieee80211_channel *chan, u_int8_t rxchainmask, HAL_BOOL longcal, HAL_BOOL *isIQdone, int is_scan, u_int32_t *sched_cals); -extern void ar9300_reset_cal_valid(struct ath_hal *ah, HAL_CHANNEL *chan, - HAL_BOOL *isIQdone, u_int32_t cal_type); +extern void ar9300_reset_cal_valid(struct ath_hal *ah, + const struct ieee80211_channel *chan, + HAL_BOOL *isIQdone, u_int32_t cal_type); extern void ar9300_iq_cal_collect(struct ath_hal *ah, u_int8_t num_chains); extern void ar9300_iq_calibration(struct ath_hal *ah, u_int8_t num_chains); extern void ar9300_temp_comp_cal_collect(struct ath_hal *ah); @@ -1346,7 +1395,7 @@ extern void ar9300_upload_noise_floor(st extern HAL_BOOL ar9300_set_tx_power_limit(struct ath_hal *ah, u_int32_t limit, u_int16_t extra_txpow, u_int16_t tpc_in_db); extern void ar9300_chain_noise_floor(struct ath_hal *ah, int16_t *nf_buf, - HAL_CHANNEL *chan, int is_scan); + struct ieee80211_channel *chan, int is_scan); extern HAL_BOOL ar9300_load_nf(struct ath_hal *ah, int16_t nf[]); extern HAL_RFGAIN ar9300_get_rfgain(struct ath_hal *ah); @@ -1354,11 +1403,14 @@ extern const HAL_RATE_TABLE *ar9300_get_ extern int16_t ar9300_get_rate_txpower(struct ath_hal *ah, u_int mode, u_int8_t rate_index, u_int8_t chainmask, u_int8_t mimo_mode); extern void ar9300_init_rate_txpower(struct ath_hal *ah, u_int mode, - HAL_CHANNEL_INTERNAL *chan, + const struct ieee80211_channel *chan, u_int8_t powerPerRate[], u_int8_t chainmask); extern void ar9300_adjust_reg_txpower_cdd(struct ath_hal *ah, u_int8_t powerPerRate[]); +extern HAL_STATUS ath_hal_get_rate_power_limit_from_eeprom(struct ath_hal *ah, + u_int16_t freq, int8_t *max_rate_power, int8_t *min_rate_power); + extern void ar9300_reset_tx_status_ring(struct ath_hal *ah); extern void ar9300_enable_mib_counters(struct ath_hal *); extern void ar9300_disable_mib_counters(struct ath_hal *); @@ -1371,7 +1423,7 @@ struct ath_rx_status; extern void ar9300_process_mib_intr(struct ath_hal *, const HAL_NODE_STATS *); extern void ar9300_ani_ar_poll(struct ath_hal *, const HAL_NODE_STATS *, - HAL_CHANNEL *, HAL_ANISTATS *); + const struct ieee80211_channel *, HAL_ANISTATS *); extern void ar9300_ani_reset(struct ath_hal *, HAL_BOOL is_scanning); extern void ar9300_ani_init_defaults(struct ath_hal *ah, HAL_HT_MACMODE macmode); extern void ar9300_enable_tpc(struct ath_hal *); @@ -1381,9 +1433,8 @@ extern void ar9300_rx_gain_table_apply(s extern void ar9300_tx_gain_table_apply(struct ath_hal *ah); extern void ar9300_mat_enable(struct ath_hal *ah, int enable); extern void ar9300_dump_keycache(struct ath_hal *ah, int n, u_int32_t *entry); -extern HAL_BOOL ar9300_ant_ctrl_set_lna_div_use_bt_ant(struct ath_hal * ah, HAL_BOOL enable, HAL_CHANNEL * chan); +extern HAL_BOOL ar9300_ant_ctrl_set_lna_div_use_bt_ant(struct ath_hal * ah, HAL_BOOL enable, const struct ieee80211_channel * chan); -#ifdef AH_SUPPORT_AR9300 /* BB Panic Watchdog declarations */ #define HAL_BB_PANIC_WD_TMO 25 /* in ms, 0 to disable */ #define HAL_BB_PANIC_WD_TMO_HORNET 85 @@ -1391,17 +1442,15 @@ extern void ar9300_config_bb_panic_watch extern void ar9300_handle_bb_panic(struct ath_hal *); extern int ar9300_get_bb_panic_info(struct ath_hal *ah, struct hal_bb_panic_info *bb_panic); extern HAL_BOOL ar9300_handle_radar_bb_panic(struct ath_hal *ah); -#endif extern void ar9300_set_hal_reset_reason(struct ath_hal *ah, u_int8_t resetreason); /* DFS declarations */ -#ifdef ATH_SUPPORT_DFS -extern void ar9300_check_dfs(struct ath_hal *ah, HAL_CHANNEL *chan); -extern void ar9300_dfs_found(struct ath_hal *ah, HAL_CHANNEL *chan, +extern void ar9300_check_dfs(struct ath_hal *ah, struct ieee80211_channel *chan); +extern void ar9300_dfs_found(struct ath_hal *ah, struct ieee80211_channel *chan, u_int64_t nolTime); extern void ar9300_enable_dfs(struct ath_hal *ah, HAL_PHYERR_PARAM *pe); extern void ar9300_get_dfs_thresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe); -extern HAL_BOOL ar9300_radar_wait(struct ath_hal *ah, HAL_CHANNEL *chan); +extern HAL_BOOL ar9300_radar_wait(struct ath_hal *ah, struct ieee80211_channel *chan); extern struct dfs_pulse * ar9300_get_dfs_radars(struct ath_hal *ah, u_int32_t dfsdomain, int *numradars, struct dfs_bin5pulse **bin5pulses, int *numb5radars, HAL_PHYERR_PARAM *pe); @@ -1409,9 +1458,8 @@ extern void ar9300_adjust_difs(struct a extern u_int32_t ar9300_dfs_config_fft(struct ath_hal *ah, HAL_BOOL is_enable); extern void ar9300_cac_tx_quiet(struct ath_hal *ah, HAL_BOOL enable); extern void ar9300_dfs_cac_war(struct ath_hal *ah, u_int32_t start); -#endif -extern HAL_CHANNEL * ar9300_get_extension_channel(struct ath_hal *ah); +extern struct ieee80211_channel * ar9300_get_extension_channel(struct ath_hal *ah); extern HAL_BOOL ar9300_is_fast_clock_enabled(struct ath_hal *ah); @@ -1440,16 +1488,16 @@ extern HAL_STATUS ar9300_calc_adc_ref_po extern HAL_STATUS ar9300_get_min_agc_gain(struct ath_hal *ah, int freq_mhz, int32_t *chain_gain, int num_chain_gain); extern HAL_BOOL ar9300_reset_11n(struct ath_hal *ah, HAL_OPMODE opmode, - HAL_CHANNEL *chan, HAL_BOOL b_channel_change, HAL_STATUS *status); + struct ieee80211_channel *chan, HAL_BOOL b_channel_change, HAL_STATUS *status); extern void ar9300_set_coverage_class(struct ath_hal *ah, u_int8_t coverageclass, int now); extern void ar9300_get_channel_centers(struct ath_hal *ah, - HAL_CHANNEL_INTERNAL *chan, + const struct ieee80211_channel *chan, CHAN_CENTERS *centers); extern u_int16_t ar9300_get_ctl_center(struct ath_hal *ah, - HAL_CHANNEL_INTERNAL *chan); + const struct ieee80211_channel *chan); extern u_int16_t ar9300_get_ext_center(struct ath_hal *ah, - HAL_CHANNEL_INTERNAL *chan); + const struct ieee80211_channel *chan); extern u_int32_t ar9300_get_mib_cycle_counts_pct(struct ath_hal *, u_int32_t*, u_int32_t*, u_int32_t*); extern void ar9300_dma_reg_dump(struct ath_hal *); @@ -1485,20 +1533,20 @@ extern void ar9300_chk_rssi_update_tx_pw extern HAL_BOOL ar9300_is_skip_paprd_by_greentx(struct ath_hal *ah); extern void ar9300_control_signals_for_green_tx_mode(struct ath_hal *ah); extern void ar9300_hwgreentx_set_pal_spare(struct ath_hal *ah, int value); +extern HAL_BOOL ar9300_is_ani_noise_spur(struct ath_hal *ah); extern void ar9300_reset_hw_beacon_proc_crc(struct ath_hal *ah); extern int32_t ar9300_get_hw_beacon_rssi(struct ath_hal *ah); extern void ar9300_set_hw_beacon_rssi_threshold(struct ath_hal *ah, u_int32_t rssi_threshold); extern void ar9300_reset_hw_beacon_rssi(struct ath_hal *ah); extern void ar9300_set_hw_beacon_proc(struct ath_hal *ah, HAL_BOOL on); -extern HAL_BOOL ar9300_is_ani_noise_spur(struct ath_hal *ah); extern void ar9300_get_vow_stats(struct ath_hal *ah, HAL_VOWSTATS *p_stats, u_int8_t); extern int ar9300_get_spur_info(struct ath_hal * ah, int *enable, int len, u_int16_t *freq); extern int ar9300_set_spur_info(struct ath_hal * ah, int enable, int len, u_int16_t *freq); extern void ar9300_wow_set_gpio_reset_low(struct ath_hal * ah); -extern void ar9300_get_mib_cycle_counts(struct ath_hal *, HAL_COUNTERS*); +extern HAL_BOOL ar9300_get_mib_cycle_counts(struct ath_hal *, HAL_SURVEY_SAMPLE *); extern void ar9300_clear_mib_counters(struct ath_hal *ah); /* EEPROM interface functions */ @@ -1512,12 +1560,12 @@ extern u_int32_t ar9300_ini_fixup(struc u_int32_t val); extern HAL_STATUS ar9300_eeprom_set_transmit_power(struct ath_hal *ah, - ar9300_eeprom_t *p_eep_data, HAL_CHANNEL_INTERNAL *chan, + ar9300_eeprom_t *p_eep_data, const struct ieee80211_channel *chan, u_int16_t cfg_ctl, u_int16_t twice_antenna_reduction, u_int16_t twice_max_regulatory_power, u_int16_t power_limit); -extern void ar9300_eeprom_set_addac(struct ath_hal *, HAL_CHANNEL_INTERNAL *); +extern void ar9300_eeprom_set_addac(struct ath_hal *, struct ieee80211_channel *); extern HAL_BOOL ar9300_eeprom_set_param(struct ath_hal *ah, EEPROM_PARAM param, u_int32_t value); -extern HAL_BOOL ar9300_eeprom_set_board_values(struct ath_hal *, HAL_CHANNEL_INTERNAL *); +extern HAL_BOOL ar9300_eeprom_set_board_values(struct ath_hal *, const struct ieee80211_channel *); extern HAL_BOOL ar9300_eeprom_read_word(struct ath_hal *, u_int off, u_int16_t *data); extern HAL_BOOL ar9300_eeprom_read(struct ath_hal *ah, long address, u_int8_t *buffer, int many); extern HAL_BOOL ar9300_otp_read(struct ath_hal *ah, u_int off, u_int32_t *data, HAL_BOOL is_wifi); @@ -1526,7 +1574,7 @@ extern HAL_BOOL ar9300_flash_read(struc extern HAL_BOOL ar9300_flash_write(struct ath_hal *, u_int off, u_int16_t data); extern u_int ar9300_eeprom_dump_support(struct ath_hal *ah, void **pp_e); extern u_int8_t ar9300_eeprom_get_num_ant_config(struct ath_hal_9300 *ahp, HAL_FREQ_BAND freq_band); -extern HAL_STATUS ar9300_eeprom_get_ant_cfg(struct ath_hal_9300 *ahp, HAL_CHANNEL_INTERNAL *chan, +extern HAL_STATUS ar9300_eeprom_get_ant_cfg(struct ath_hal_9300 *ahp, const struct ieee80211_channel *chan, u_int8_t index, u_int16_t *config); extern u_int8_t* ar9300_eeprom_get_cust_data(struct ath_hal_9300 *ahp); extern u_int8_t *ar9300_eeprom_get_spur_chans_ptr(struct ath_hal *ah, HAL_BOOL is_2ghz); @@ -1625,7 +1673,7 @@ extern HAL_BOOL ar9300Get3StreamSignatur #ifdef ATH_TX99_DIAG #ifndef ATH_SUPPORT_HTC -extern void ar9300_tx99_channel_pwr_update(struct ath_hal *ah, HAL_CHANNEL *c, u_int32_t txpower); +extern void ar9300_tx99_channel_pwr_update(struct ath_hal *ah, struct ieee80211_channel *c, u_int32_t txpower); extern void ar9300_tx99_chainmsk_setup(struct ath_hal *ah, int tx_chainmask); extern void ar9300_tx99_set_single_carrier(struct ath_hal *ah, int tx_chain_mask, int chtype); extern void ar9300_tx99_start(struct ath_hal *ah, u_int8_t *data); Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c Sun Apr 28 00:53:31 2013 (r250007) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c Sun Apr 28 00:57:47 2013 (r250008) @@ -16,12 +16,10 @@ #include "opt_ah.h" -#ifdef AH_SUPPORT_AR9300 - #include "ah.h" #include "ah_internal.h" #include "ah_desc.h" -#include "ah_pktlog.h" +//#include "ah_pktlog.h" #include "ar9300/ar9300.h" #include "ar9300/ar9300reg.h" @@ -30,7 +28,7 @@ extern void ar9300_set_rx_filter(struct ath_hal *ah, u_int32_t bits); extern u_int32_t ar9300_get_rx_filter(struct ath_hal *ah); -#define HAL_ANI_DEBUG 0 +#define HAL_ANI_DEBUG 1 /* * Anti noise immunity support. We track phy errors and react @@ -47,7 +45,7 @@ extern u_int32_t ar9300_get_rx_filter(s #define HAL_ANI_OFDM_TRIG_LOW 400 /* units are errors per second */ #define HAL_ANI_CCK_TRIG_HIGH 600 /* units are errors per second */ #define HAL_ANI_CCK_TRIG_LOW 300 /* units are errors per second */ -#define HAL_ANI_USE_OFDM_WEAK_SIG true +#define HAL_ANI_USE_OFDM_WEAK_SIG AH_TRUE #define HAL_ANI_ENABLE_MRC_CCK AH_TRUE /* default is enabled */ #define HAL_ANI_DEF_SPUR_IMMUNE_LVL 3 #define HAL_ANI_DEF_FIRSTEP_LVL 2 @@ -177,18 +175,20 @@ ar9300_disable_mib_counters(struct ath_h * ah_ani values and only the channel field needs to be set. */ static int -ar9300_get_ani_channel_index(struct ath_hal *ah, HAL_CHANNEL_INTERNAL *chan) +ar9300_get_ani_channel_index(struct ath_hal *ah, + const struct ieee80211_channel *chan) { struct ath_hal_9300 *ahp = AH9300(ah); int i; for (i = 0; i < ARRAY_LENGTH(ahp->ah_ani); i++) { - if (ahp->ah_ani[i].c.channel == chan->channel) { + /* XXX this doesn't distinguish between 20/40 channels */ + if (ahp->ah_ani[i].c.ic_freq == chan->ic_freq) { return i; } - if (ahp->ah_ani[i].c.channel == 0) { - ahp->ah_ani[i].c.channel = chan->channel; - ahp->ah_ani[i].c.channel_flags = chan->channel_flags; + if (ahp->ah_ani[i].c.ic_freq == 0) { + ahp->ah_ani[i].c.ic_freq = chan->ic_freq; + ahp->ah_ani[i].c.ic_flags = chan->ic_flags; return i; } } @@ -268,7 +268,7 @@ ar9300_ani_attach(struct ath_hal *ah) ar9300_enable_mib_counters(ah); ahp->ah_ani_period = HAL_ANI_PERIOD; - if (AH_PRIVATE(ah)->ah_config.ath_hal_enable_ani) { + if (ah->ah_config.ath_hal_enable_ani) { ahp->ah_proc_phy_err |= HAL_PROCESS_ANI; } } @@ -295,7 +295,7 @@ ar9300_ani_init_defaults(struct ath_hal { struct ath_hal_9300 *ahp = AH9300(ah); struct ar9300_ani_state *ani_state; - HAL_CHANNEL_INTERNAL *chan = AH_PRIVATE(ah)->ah_curchan; + const struct ieee80211_channel *chan = AH_PRIVATE(ah)->ah_curchan; int index; u_int32_t val; @@ -307,7 +307,7 @@ ar9300_ani_init_defaults(struct ath_hal HALDEBUG(ah, HAL_DEBUG_ANI, "%s: ver %d.%d opmode %u chan %d Mhz/0x%x macmode %d\n", __func__, AH_PRIVATE(ah)->ah_macVersion, AH_PRIVATE(ah)->ah_macRev, - AH_PRIVATE(ah)->ah_opmode, chan->channel, chan->channel_flags, macmode); + AH_PRIVATE(ah)->ah_opmode, chan->ic_freq, chan->ic_flags, macmode); val = OS_REG_READ(ah, AR_PHY_SFCORR); ani_state->ini_def.m1_thresh = MS(val, AR_PHY_SFCORR_M1_THRESH); @@ -457,16 +457,16 @@ ar9300_ani_control(struct ath_hal *ah, H { struct ath_hal_9300 *ahp = AH9300(ah); struct ar9300_ani_state *ani_state = ahp->ah_curani; - HAL_CHANNEL_INTERNAL *chan = AH_PRIVATE(ah)->ah_curchan; + const struct ieee80211_channel *chan = AH_PRIVATE(ah)->ah_curchan; int32_t value, value2; u_int level = param; u_int is_on; - if (chan == NULL && cmd != HAL_ANI_MODE) { - HALDEBUG(ah, HAL_DEBUG_UNMASKABLE, + if (chan == NULL && cmd != HAL_ANI_MODE) { + HALDEBUG(ah, HAL_DEBUG_UNMASKABLE, "%s: ignoring cmd 0x%02x - no channel\n", __func__, cmd); - return AH_FALSE; - } + return AH_FALSE; + } switch (cmd & ahp->ah_ani_function) { case HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION: @@ -538,7 +538,7 @@ ar9300_ani_control(struct ath_hal *ah, H if (!is_on != ani_state->ofdm_weak_sig_detect_off) { HALDEBUG(ah, HAL_DEBUG_ANI, "%s: ** ch %d: ofdm weak signal: %s=>%s\n", - __func__, chan->channel, + __func__, chan->ic_freq, !ani_state->ofdm_weak_sig_detect_off ? "on" : "off", is_on ? "on" : "off"); if (is_on) { @@ -592,12 +592,12 @@ ar9300_ani_control(struct ath_hal *ah, H if (level != ani_state->firstep_level) { HALDEBUG(ah, HAL_DEBUG_ANI, "%s: ** ch %d: level %d=>%d[def:%d] firstep[level]=%d ini=%d\n", - __func__, chan->channel, ani_state->firstep_level, level, + __func__, chan->ic_freq, ani_state->firstep_level, level, HAL_ANI_DEF_FIRSTEP_LVL, value, ani_state->ini_def.firstep); HALDEBUG(ah, HAL_DEBUG_ANI, "%s: ** ch %d: level %d=>%d[def:%d] " "firstep_low[level]=%d ini=%d\n", - __func__, chan->channel, ani_state->firstep_level, level, + __func__, chan->ic_freq, ani_state->firstep_level, level, HAL_ANI_DEF_FIRSTEP_LVL, value2, ani_state->ini_def.firstep_low); if (level > ani_state->firstep_level) { @@ -651,13 +651,13 @@ ar9300_ani_control(struct ath_hal *ah, H HALDEBUG(ah, HAL_DEBUG_ANI, "%s: ** ch %d: level %d=>%d[def:%d] " "cycpwr_thr1[level]=%d ini=%d\n", - __func__, chan->channel, ani_state->spur_immunity_level, level, + __func__, chan->ic_freq, ani_state->spur_immunity_level, level, HAL_ANI_DEF_SPUR_IMMUNE_LVL, value, ani_state->ini_def.cycpwr_thr1); HALDEBUG(ah, HAL_DEBUG_ANI, "%s: ** ch %d: level %d=>%d[def:%d] " "cycpwr_thr1_ext[level]=%d ini=%d\n", - __func__, chan->channel, ani_state->spur_immunity_level, level, + __func__, chan->ic_freq, ani_state->spur_immunity_level, level, HAL_ANI_DEF_SPUR_IMMUNE_LVL, value2, ani_state->ini_def.cycpwr_thr1_ext); if (level > ani_state->spur_immunity_level) { @@ -682,7 +682,7 @@ ar9300_ani_control(struct ath_hal *ah, H } if (!is_on != ani_state->mrc_cck_off) { HALDEBUG(ah, HAL_DEBUG_ANI, - "%s: ** ch %d: MRC CCK: %s=>%s\n", __func__, chan->channel, + "%s: ** ch %d: MRC CCK: %s=>%s\n", __func__, chan->ic_freq, !ani_state->mrc_cck_off ? "on" : "off", is_on ? "on" : "off"); if (is_on) { ahp->ah_stats.ast_ani_ccklow++; @@ -857,7 +857,8 @@ ar9300_ani_reset(struct ath_hal *ah, HAL { struct ath_hal_9300 *ahp = AH9300(ah); struct ar9300_ani_state *ani_state; - HAL_CHANNEL_INTERNAL *chan = AH_PRIVATE(ah)->ah_curchan; + const struct ieee80211_channel *chan = AH_PRIVATE(ah)->ah_curchan; + HAL_CHANNEL_INTERNAL *ichan = ath_hal_checkchannel(ah, chan); int index; HALASSERT(chan != AH_NULL); @@ -881,7 +882,7 @@ ar9300_ani_reset(struct ath_hal *ah, HAL /* only allow a subset of functions in AP mode */ if (AH_PRIVATE(ah)->ah_opmode == HAL_M_HOSTAP) { - if (IS_CHAN_2GHZ(chan)) { + if (IS_CHAN_2GHZ(ichan)) { ahp->ah_ani_function = (HAL_ANI_SPUR_IMMUNITY_LEVEL | HAL_ANI_FIRSTEP_LEVEL | HAL_ANI_MRC_CCK); @@ -908,8 +909,8 @@ ar9300_ani_reset(struct ath_hal *ah, HAL HALDEBUG(ah, HAL_DEBUG_ANI, "%s: Restore defaults: opmode %u chan %d Mhz/0x%x " "is_scanning=%d restore=%d ofdm:%d cck:%d\n", - __func__, AH_PRIVATE(ah)->ah_opmode, chan->channel, - chan->channel_flags, is_scanning, ani_state->must_restore, + __func__, AH_PRIVATE(ah)->ah_opmode, chan->ic_freq, + chan->ic_flags, is_scanning, ani_state->must_restore, ani_state->ofdm_noise_immunity_level, ani_state->cck_noise_immunity_level); /* @@ -941,8 +942,8 @@ ar9300_ani_reset(struct ath_hal *ah, HAL HALDEBUG(ah, HAL_DEBUG_ANI, "%s: Restore history: opmode %u chan %d Mhz/0x%x is_scanning=%d " "restore=%d ofdm:%d cck:%d\n", - __func__, AH_PRIVATE(ah)->ah_opmode, chan->channel, - chan->channel_flags, is_scanning, ani_state->must_restore, + __func__, AH_PRIVATE(ah)->ah_opmode, chan->ic_freq, + chan->ic_flags, is_scanning, ani_state->must_restore, ani_state->ofdm_noise_immunity_level, ani_state->cck_noise_immunity_level); ar9300_ani_set_odfm_noise_immunity_level( @@ -1041,7 +1042,8 @@ ar9300_ani_lower_immunity(struct ath_hal } /* convert HW counter values to ms using mode specifix clock rate */ -#define CLOCK_RATE(_ah) (ath_hal_chan_2_clock_rate_mhz(_ah) * 1000) +//#define CLOCK_RATE(_ah) (ath_hal_chan_2_clock_rate_mhz(_ah) * 1000) +#define CLOCK_RATE(_ah) (ath_hal_mac_clks(ah, 1000)) /* * Return an approximation of the time spent ``listening'' by @@ -1098,7 +1100,7 @@ ar9300_ani_get_listen_time(struct ath_ha */ void ar9300_ani_ar_poll(struct ath_hal *ah, const HAL_NODE_STATS *stats, - HAL_CHANNEL *chan, HAL_ANISTATS *ani_stats) + const struct ieee80211_channel *chan, HAL_ANISTATS *ani_stats) { struct ath_hal_9300 *ahp = AH9300(ah); struct ar9300_ani_state *ani_state; @@ -1274,4 +1276,3 @@ ar9300_is_ani_noise_spur(struct ath_hal return ani_state->phy_noise_spur; } -#endif /* AH_SUPPORT_AR9300 */ Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c Sun Apr 28 00:53:31 2013 (r250007) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c Sun Apr 28 00:57:47 2013 (r250008) @@ -16,8 +16,6 @@ #include "opt_ah.h" -#ifdef AH_SUPPORT_AR9300 - #include "ah.h" #include "ah_internal.h" #include "ah_devid.h" @@ -28,6 +26,9 @@ #include "ar9300/ar9300phy.h" #include "ar9300/ar9300paprd.h" +#include "ar9300/ar9300_stub.h" +#include "ar9300/ar9300_stub_funcs.h" + /* Add static register initialization vectors */ #include "ar9300/ar9300_osprey22.ini" @@ -43,16 +44,23 @@ #include "ar9300/ar9300_aphrodite10.ini" +/* Include various freebsd specific HAL methods */ +#include "ar9300/ar9300_freebsd.h" + +/* XXX duplicate in ar9300_radio.c ? */ static HAL_BOOL ar9300_get_chip_power_limits(struct ath_hal *ah, - HAL_CHANNEL *chans, u_int32_t nchans); + struct ieee80211_channel *chan); static inline HAL_STATUS ar9300_init_mac_addr(struct ath_hal *ah); static inline HAL_STATUS ar9300_hw_attach(struct ath_hal *ah); static inline void ar9300_hw_detach(struct ath_hal *ah); static int16_t ar9300_get_nf_adjust(struct ath_hal *ah, const HAL_CHANNEL_INTERNAL *c); +#if 0 int ar9300_get_cal_intervals(struct ath_hal *ah, HAL_CALIBRATION_TIMER **timerp, HAL_CAL_QUERY query); +#endif + #if ATH_TRAFFIC_FAST_RECOVER unsigned long ar9300_get_pll3_sqsum_dvc(struct ath_hal *ah); #endif @@ -69,6 +77,7 @@ static const HAL_PERCAL_DATA iq_cal_sing ar9300_iq_cal_collect, ar9300_iq_calibration}; +#if 0 static HAL_CALIBRATION_TIMER ar9300_cals[] = { {IQ_MISMATCH_CAL, /* Cal type */ 1200000, /* Cal interval */ @@ -79,7 +88,8 @@ static HAL_CALIBRATION_TIMER ar9300_cals 0 }, }; - +#endif + #if ATH_PCIE_ERROR_MONITOR int ar9300_start_pcie_error_monitor(struct ath_hal *ah, int b_auto_stop) @@ -162,6 +172,7 @@ int ar9300_stop_pcie_error_monitor(struc #endif /* ATH_PCIE_ERROR_MONITOR */ +#if 0 /* WIN32 does not support C99 */ static const struct ath_hal_private ar9300hal = { { @@ -526,6 +537,7 @@ static const struct ath_hal_private ar93 ar9300_get_nf_adjust, /* ah_get_nf_adjust */ /* rest is zero'd by compiler */ }; +#endif /* * Read MAC version/revision information from Chip registers and initialize @@ -543,7 +555,7 @@ ar9300_read_revisions(struct ath_hal *ah if (AH_PRIVATE(ah)->ah_devid == AR9300_DEVID_AR9340) { /* XXX: AR_SREV register in Wasp reads 0 */ AH_PRIVATE(ah)->ah_macVersion = AR_SREV_VERSION_WASP; - } else if(AH_PRIVATE(ah)->ah_devid == AR9300_DEVID_AR955X) { + } else if(AH_PRIVATE(ah)->ah_devid == AR9300_DEVID_QCA955X) { /* XXX: AR_SREV register in Scorpion reads 0 */ AH_PRIVATE(ah)->ah_macVersion = AR_SREV_VERSION_SCORPION; } else { @@ -592,10 +604,10 @@ ar9300_read_revisions(struct ath_hal *ah AH_PRIVATE(ah)->ah_macRev = MS(val, AR_SREV_REVISION2); if (AR_SREV_JUPITER(ah) || AR_SREV_APHRODITE(ah)) { - AH_PRIVATE(ah)->ah_is_pci_express = AH_TRUE; + AH_PRIVATE(ah)->ah_ispcie = AH_TRUE; } else { - AH_PRIVATE(ah)->ah_is_pci_express = + AH_PRIVATE(ah)->ah_ispcie = (val & AR_SREV_TYPE2_HOST_MODE) ? 0 : 1; } @@ -605,39 +617,47 @@ ar9300_read_revisions(struct ath_hal *ah * Attach for an AR9300 part. */ struct ath_hal * -ar9300_attach(u_int16_t devid, HAL_ADAPTER_HANDLE osdev, HAL_SOFTC sc, - HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_BUS_TYPE bustype, - asf_amem_instance_handle amem_handle, - struct hal_reg_parm *hal_conf_parm, HAL_STATUS *status) +ar9300_attach(u_int16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st, + HAL_BUS_HANDLE sh, uint16_t *eepromdata, HAL_STATUS *status) { struct ath_hal_9300 *ahp; struct ath_hal *ah; struct ath_hal_private *ahpriv; HAL_STATUS ecode; - HAL_NO_INTERSPERSED_READS; + HAL_NO_INTERSPERSED_READS; /* NB: memory is returned zero'd */ - ahp = ar9300_new_state( - devid, osdev, sc, st, sh, bustype, amem_handle, hal_conf_parm, status); + ahp = ar9300_new_state(devid, sc, st, sh, eepromdata, status); if (ahp == AH_NULL) { return AH_NULL; } - ah = &ahp->ah_priv.priv.h; + ah = &ahp->ah_priv.h; ar9300_init_offsets(ah, devid); ahpriv = AH_PRIVATE(ah); - AH_PRIVATE(ah)->ah_bustype = bustype; +// AH_PRIVATE(ah)->ah_bustype = bustype; + + /* FreeBSD: to make OTP work for now, provide this.. */ + AH9300(ah)->ah_cal_mem = ath_hal_malloc(HOST_CALDATA_SIZE); + + /* XXX FreeBSD: enable RX mitigation */ + ah->ah_config.ath_hal_intr_mitigation_rx = 1; + /* + * XXX what's this do? Check in the qcamain driver code + * as to what it does. + */ + ah->ah_config.ath_hal_ext_atten_margin_cfg = 0; /* interrupt mitigation */ #ifdef AR5416_INT_MITIGATION - if (ahpriv->ah_config.ath_hal_intr_mitigation_rx != 0) { + if (ah->ah_config.ath_hal_intr_mitigation_rx != 0) { ahp->ah_intr_mitigation_rx = AH_TRUE; } #else /* Enable Rx mitigation (default) */ ahp->ah_intr_mitigation_rx = AH_TRUE; - ahpriv->ah_config.ath_hal_intr_mitigation_rx = 1; + ah->ah_config.ath_hal_intr_mitigation_rx = 1; #endif #ifdef HOST_OFFLOAD @@ -645,12 +665,12 @@ ar9300_attach(u_int16_t devid, HAL_ADAPT if (AR_SREV_HORNET(ah)) { ahp->ah_intr_mitigation_rx = AH_FALSE; #ifdef AR5416_INT_MITIGATION - ahpriv->ah_config.ath_hal_intr_mitigation_rx = 0; + ah->ah_config.ath_hal_intr_mitigation_rx = 0; #endif } #endif - if (ahpriv->ah_config.ath_hal_intr_mitigation_tx != 0) { + if (ah->ah_config.ath_hal_intr_mitigation_tx != 0) { ahp->ah_intr_mitigation_tx = AH_TRUE; } @@ -685,9 +705,11 @@ ar9300_attach(u_int16_t devid, HAL_ADAPT #if ATH_SUPPORT_MCI if (AR_SREV_JUPITER(ah) || AR_SREV_APHRODITE(ah)) { +#if 0 ah->ah_bt_coex_set_weights = ar9300_mci_bt_coex_set_weights; ah->ah_bt_coex_disable = ar9300_mci_bt_coex_disable; ah->ah_bt_coex_enable = ar9300_mci_bt_coex_enable; +#endif ahp->ah_mci_ready = AH_FALSE; ahp->ah_mci_bt_state = MCI_BT_SLEEP; ahp->ah_mci_coex_major_version_wlan = MCI_GPM_COEX_MAJOR_VERSION_WLAN; @@ -772,9 +794,9 @@ ar9300_attach(u_int16_t devid, HAL_ADAPT } /* No serialization of Register Accesses needed. */ - ahpriv->ah_config.ath_hal_serialize_reg_mode = SER_REG_MODE_OFF; - HALDEBUG(ah, HAL_DEBUG_RESET, "%s: ath_hal_serialize_reg_mode is %d\n", - __func__, ahpriv->ah_config.ath_hal_serialize_reg_mode); + ah->ah_config.ah_serialise_reg_war = SER_REG_MODE_OFF; + HALDEBUG(ah, HAL_DEBUG_RESET, "%s: ah_serialise_reg_war is %d\n", + __func__, ah->ah_config.ah_serialise_reg_war); /* * Add mac revision check when needed. @@ -798,7 +820,7 @@ ar9300_attach(u_int16_t devid, HAL_ADAPT goto bad; } - ahpriv->ah_phy_rev = OS_REG_READ(ah, AR_PHY_CHIP_ID); + AH_PRIVATE(ah)->ah_phyRev = OS_REG_READ(ah, AR_PHY_CHIP_ID); /* Setup supported calibrations */ ahp->ah_iq_cal_data.cal_data = &iq_cal_single_sample; @@ -858,7 +880,7 @@ ar9300_attach(u_int16_t devid, HAL_ADAPT ar9331_modes_lowest_ob_db_tx_gain_hornet1_2, ARRAY_LENGTH(ar9331_modes_lowest_ob_db_tx_gain_hornet1_2), 5); - ahpriv->ah_config.ath_hal_pcie_power_save_enable = 0; + ah->ah_config.ath_hal_pcie_power_save_enable = 0; /* Japan 2484Mhz CCK settings */ INIT_INI_ARRAY(&ahp->ah_ini_japan2484, @@ -926,7 +948,7 @@ ar9300_attach(u_int16_t devid, HAL_ADAPT ar9331_modes_lowest_ob_db_tx_gain_hornet1_1, ARRAY_LENGTH(ar9331_modes_lowest_ob_db_tx_gain_hornet1_1), 5); - ahpriv->ah_config.ath_hal_pcie_power_save_enable = 0; + ah->ah_config.ath_hal_pcie_power_save_enable = 0; /* Japan 2484Mhz CCK settings */ INIT_INI_ARRAY(&ahp->ah_ini_japan2484, @@ -1003,13 +1025,13 @@ ar9300_attach(u_int16_t devid, HAL_ADAPT ar9485_poseidon1_1_baseband_core_txfir_coeff_japan_2484), 2); /* Load PCIE SERDES settings from INI */ - if (ahpriv->ah_config.ath_hal_pcie_clock_req) { + if (ah->ah_config.ath_hal_pcie_clock_req) { /* Pci-e Clock Request = 1 */ - if (ahpriv->ah_config.ath_hal_pll_pwr_save + if (ah->ah_config.ath_hal_pll_pwr_save & AR_PCIE_PLL_PWRSAVE_CONTROL) { /* Sleep Setting */ - if (ahpriv->ah_config.ath_hal_pll_pwr_save & + if (ah->ah_config.ath_hal_pll_pwr_save & AR_PCIE_PLL_PWRSAVE_ON_D3) { INIT_INI_ARRAY(&ahp->ah_ini_pcie_serdes, @@ -1025,7 +1047,7 @@ ar9300_attach(u_int16_t devid, HAL_ADAPT 2); } /* Awake Setting */ - if (ahpriv->ah_config.ath_hal_pll_pwr_save & + if (ah->ah_config.ath_hal_pll_pwr_save & AR_PCIE_PLL_PWRSAVE_ON_D0) { INIT_INI_ARRAY(&ahp->ah_ini_pcie_serdes_low_power, @@ -1056,11 +1078,11 @@ ar9300_attach(u_int16_t devid, HAL_ADAPT } } else { /* Pci-e Clock Request = 0 */ - if (ahpriv->ah_config.ath_hal_pll_pwr_save + if (ah->ah_config.ath_hal_pll_pwr_save & AR_PCIE_PLL_PWRSAVE_CONTROL) { /* Sleep Setting */ - if (ahpriv->ah_config.ath_hal_pll_pwr_save & + if (ah->ah_config.ath_hal_pll_pwr_save & AR_PCIE_PLL_PWRSAVE_ON_D3) { INIT_INI_ARRAY(&ahp->ah_ini_pcie_serdes, @@ -1076,7 +1098,7 @@ ar9300_attach(u_int16_t devid, HAL_ADAPT 2); } /* Awake Setting */ - if (ahpriv->ah_config.ath_hal_pll_pwr_save & + if (ah->ah_config.ath_hal_pll_pwr_save & AR_PCIE_PLL_PWRSAVE_ON_D0) { INIT_INI_ARRAY(&ahp->ah_ini_pcie_serdes_low_power, @@ -1107,7 +1129,7 @@ ar9300_attach(u_int16_t devid, HAL_ADAPT } } /* pcie ps setting will honor registry setting, default is 0 */ - //ahpriv->ah_config.ath_hal_pciePowerSaveEnable = 0; + //ah->ah_config.ath_hal_pciePowerSaveEnable = 0; } else if (AR_SREV_POSEIDON(ah)) { /* mac */ INIT_INI_ARRAY(&ahp->ah_ini_mac[ATH_INI_PRE], NULL, 0, 0); @@ -1160,13 +1182,13 @@ ar9300_attach(u_int16_t devid, HAL_ADAPT ar9485_poseidon1_0_baseband_core_txfir_coeff_japan_2484), 2); /* Load PCIE SERDES settings from INI */ - if (ahpriv->ah_config.ath_hal_pcie_clock_req) { + if (ah->ah_config.ath_hal_pcie_clock_req) { /* Pci-e Clock Request = 1 */ - if (ahpriv->ah_config.ath_hal_pll_pwr_save + if (ah->ah_config.ath_hal_pll_pwr_save & AR_PCIE_PLL_PWRSAVE_CONTROL) { /* Sleep Setting */ - if (ahpriv->ah_config.ath_hal_pll_pwr_save & + if (ah->ah_config.ath_hal_pll_pwr_save & AR_PCIE_PLL_PWRSAVE_ON_D3) { INIT_INI_ARRAY(&ahp->ah_ini_pcie_serdes, @@ -1182,7 +1204,7 @@ ar9300_attach(u_int16_t devid, HAL_ADAPT 2); } /* Awake Setting */ - if (ahpriv->ah_config.ath_hal_pll_pwr_save & + if (ah->ah_config.ath_hal_pll_pwr_save & AR_PCIE_PLL_PWRSAVE_ON_D0) { INIT_INI_ARRAY(&ahp->ah_ini_pcie_serdes_low_power, @@ -1215,11 +1237,11 @@ ar9300_attach(u_int16_t devid, HAL_ADAPT } } else { /* Pci-e Clock Request = 0 */ - if (ahpriv->ah_config.ath_hal_pll_pwr_save + if (ah->ah_config.ath_hal_pll_pwr_save & AR_PCIE_PLL_PWRSAVE_CONTROL) { /* Sleep Setting */ - if (ahpriv->ah_config.ath_hal_pll_pwr_save & + if (ah->ah_config.ath_hal_pll_pwr_save & AR_PCIE_PLL_PWRSAVE_ON_D3) { INIT_INI_ARRAY(&ahp->ah_ini_pcie_serdes, @@ -1235,7 +1257,7 @@ ar9300_attach(u_int16_t devid, HAL_ADAPT 2); } /* Awake Setting */ - if (ahpriv->ah_config.ath_hal_pll_pwr_save & + if (ah->ah_config.ath_hal_pll_pwr_save & AR_PCIE_PLL_PWRSAVE_ON_D0) { INIT_INI_ARRAY(&ahp->ah_ini_pcie_serdes_low_power, @@ -1268,7 +1290,7 @@ ar9300_attach(u_int16_t devid, HAL_ADAPT } } /* pcie ps setting will honor registry setting, default is 0 */ - /*ahpriv->ah_config.ath_hal_pcie_power_save_enable = 0;*/ + /*ah->ah_config.ath_hal_pcie_power_save_enable = 0;*/ #if 0 /* ATH_WOW */ /* SerDes values during WOW sleep */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Apr 28 01:03:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 49A4BC98; Sun, 28 Apr 2013 01:03:03 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3AC7F1155; Sun, 28 Apr 2013 01:03:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3S130LG047938; Sun, 28 Apr 2013 01:03:00 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3S130A9047932; Sun, 28 Apr 2013 01:03:00 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201304280103.r3S130A9047932@svn.freebsd.org> From: Neel Natu Date: Sun, 28 Apr 2013 01:03:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250009 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 01:03:03 -0000 Author: neel Date: Sun Apr 28 01:02:59 2013 New Revision: 250009 URL: http://svnweb.freebsd.org/changeset/base/250009 Log: Get rid of the 'vsc_rxpend' state - it doesn't serve any purpose because we drop any frames that arrive while the device is starved for receive buffers. This makes the receive path to only execute in context of the receive thread and allows for further simplification. Reviewed by: grehan Modified: head/usr.sbin/bhyve/pci_virtio_net.c Modified: head/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_net.c Sun Apr 28 00:57:47 2013 (r250008) +++ head/usr.sbin/bhyve/pci_virtio_net.c Sun Apr 28 01:02:59 2013 (r250009) @@ -140,7 +140,6 @@ struct pci_vtnet_softc { int vsc_isr; int vsc_tapfd; int vsc_rx_ready; - int vsc_rxpend; int tx_in_progress; int resetting; @@ -323,14 +322,6 @@ pci_vtnet_tap_rx(struct pci_vtnet_softc if (ndescs == 0) { /* - * Need to wait for host notification to read - */ - if (sc->vsc_rxpend == 0) { - WPRINTF(("vtnet: no rx descriptors !\n")); - sc->vsc_rxpend = 1; - } - - /* * Drop the packet and try later */ (void) read(sc->vsc_tapfd, dummybuf, sizeof(dummybuf)); @@ -417,17 +408,6 @@ pci_vtnet_ping_rxq(struct pci_vtnet_soft if (sc->vsc_rx_ready == 0) { sc->vsc_rx_ready = 1; } - - /* - * If the rx queue was empty, attempt to receive a - * packet that was previously blocked due to no rx bufs - * available - */ - if (sc->vsc_rxpend) { - WPRINTF(("vtnet: rx resumed\n\r")); - sc->vsc_rxpend = 0; - pci_vtnet_tap_rx(sc); - } } static void From owner-svn-src-head@FreeBSD.ORG Sun Apr 28 02:23:40 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 75EB024C; Sun, 28 Apr 2013 02:23:40 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6844C1438; Sun, 28 Apr 2013 02:23:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3S2Nees076383; Sun, 28 Apr 2013 02:23:40 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3S2Ne5w076382; Sun, 28 Apr 2013 02:23:40 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304280223.r3S2Ne5w076382@svn.freebsd.org> From: Eitan Adler Date: Sun, 28 Apr 2013 02:23:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250012 - head/share/examples/BSD_daemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 02:23:40 -0000 Author: eadler Date: Sun Apr 28 02:23:39 2013 New Revision: 250012 URL: http://svnweb.freebsd.org/changeset/base/250012 Log: Add an alternate version of beastie to the examples directory. PR: docs/38556 Submitted by: Rahul Siddharthan Submitted on: 25 May 2002 22:49:56 -0000 MFC After: 2 weeks Added: head/share/examples/BSD_daemon/beastie2.eps (contents, props changed) Modified: head/share/examples/BSD_daemon/README Modified: head/share/examples/BSD_daemon/README ============================================================================== --- head/share/examples/BSD_daemon/README Sun Apr 28 02:04:33 2013 (r250011) +++ head/share/examples/BSD_daemon/README Sun Apr 28 02:23:39 2013 (r250012) @@ -35,6 +35,10 @@ beastie.eps Before committing this, clean out the comment brought over from the .fig file to avoid Dollar-FreeBSD-Dollar junk +beastie2.eps + Written by Rahul Siddharthan beaste2.eps is a + smaller, simpler version of the beastie eps graphic. + eps.patch Add some comments about tweakables in the .eps file and set the linecaps to round to improve visual appearance. Added: head/share/examples/BSD_daemon/beastie2.eps ============================================================================== Binary file. No diff available. From owner-svn-src-head@FreeBSD.ORG Sun Apr 28 03:13:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7C519F56; Sun, 28 Apr 2013 03:13:46 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6EE05168F; Sun, 28 Apr 2013 03:13:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3S3DkVO094923; Sun, 28 Apr 2013 03:13:46 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3S3Dkwu094921; Sun, 28 Apr 2013 03:13:46 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201304280313.r3S3Dkwu094921@svn.freebsd.org> From: David Xu Date: Sun, 28 Apr 2013 03:13:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250013 - head/lib/libthr/thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 03:13:46 -0000 Author: davidxu Date: Sun Apr 28 03:13:45 2013 New Revision: 250013 URL: http://svnweb.freebsd.org/changeset/base/250013 Log: Remove extra code for SA_RESETHAND, it is not needed because kernel has already done this. Modified: head/lib/libthr/thread/thr_sig.c Modified: head/lib/libthr/thread/thr_sig.c ============================================================================== --- head/lib/libthr/thread/thr_sig.c Sun Apr 28 02:23:39 2013 (r250012) +++ head/lib/libthr/thread/thr_sig.c Sun Apr 28 03:13:45 2013 (r250013) @@ -336,13 +336,6 @@ check_deferred_signal(struct pthread *cu memcpy(&info, &curthread->deferred_siginfo, sizeof(siginfo_t)); /* remove signal */ curthread->deferred_siginfo.si_signo = 0; - if (act.sa_flags & SA_RESETHAND) { - struct sigaction tact; - - tact = act; - tact.sa_handler = SIG_DFL; - _sigaction(info.si_signo, &tact, NULL); - } handle_signal(&act, info.si_signo, &info, uc); } } From owner-svn-src-head@FreeBSD.ORG Sun Apr 28 05:09:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BD0BFAFC for ; Sun, 28 Apr 2013 05:09:13 +0000 (UTC) (envelope-from ThomasSkibo@sbcglobal.net) Received: from nm26-vm0.access.bullet.mail.mud.yahoo.com (nm26-vm0.access.bullet.mail.mud.yahoo.com [66.94.236.225]) by mx1.freebsd.org (Postfix) with ESMTP id 5634718AA for ; Sun, 28 Apr 2013 05:09:13 +0000 (UTC) Received: from [66.94.237.127] by nm26.access.bullet.mail.mud.yahoo.com with NNFMP; 28 Apr 2013 05:09:06 -0000 Received: from [98.139.221.157] by tm2.access.bullet.mail.mud.yahoo.com with NNFMP; 28 Apr 2013 05:09:06 -0000 Received: from [127.0.0.1] by smtp117.sbc.mail.bf1.yahoo.com with NNFMP; 28 Apr 2013 05:09:06 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sbcglobal.net; s=s1024; t=1367125746; bh=Iln5VCMCZI8e6D2qT3Ng2y5thU1DZwZbVLBHGMs8a1o=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=YVRLUKw8/JeM6B2GjNDrp2uaq38uC2a6zPFdwXkMJ5TQw8WonkJzS32qkDZnPGaawh7jRTlkm9jIy9K2eqkeOPH6bbKGk96CWIughjIaHRvz3Da/PphlOCisfUKIsINXecYUYVV5oO7gAxftUo9hkTZsXfxFKMbgL6vjWF1cXWU= X-Yahoo-Newman-Id: 179916.19110.bm@smtp117.sbc.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: Q5jZ99QVM1lm8RN_JbxNn6s6jAn9vtSJ3E_u9ozynS2SIuY AvswMyD6mwSQR327hOlTh4HSSwzeUMUjgr45C4xro5RZaMzZMSZ6rFTfsxTJ MKiN8UcAmJxctYOnFuu7zVhqyOKRhEYuf1TtCojTMTk1GC7Gj1iDlQ_gWsS. PDyAiZ0hfsRMopeeqHqScrMf_LFdPBWCCgPozKDC4Yoz_CgJmWkAxebkJVhh Ti9ZOaTuh4rqvCOdPa.dbLNhaW7Ngwbv2y2Nf8R02Gq1vFxjKKVVfKNaDvEk wuppIk_GzWVeamJ7y0A1iWY28uoydMEYzpoqYLOtijdLd0LtQpF1h7uwRKQ7 g6Sov1ycyfe6u_R6Um6skAu1QzkYXYLX1_ryFFvJlDU1OfsdAYfhjGUZfpme 0istwj0HYsCVqtWt.BAW153tvP5akng.kNUdV3TGNLMulp1R4F2.7tctvX5v 4KYpsP5LsF3TQ10dJN5_qzfpqCpo1bHzs.ilJT7GPYWk4wR1jUxAe2we7ozD HKzX0Pz0mEJ9nDpZ.c.AVqnPi6KymfxeQvNB8BCCrK8RWbCsGS1Ze_Pn7ReC hzu4ioz0AbZy_JzWn9xuYEv5S6bU5G9DmpI23cmmqVO4eiGGLNWBJa8c- X-Yahoo-SMTP: tUxoRneswBA21azLM.3ybMESf0mC2bFhTbmt0VU5ervH0kqi5lo- X-Rocket-Received: from [192.168.1.9] (ThomasSkibo@71.139.162.8 with plain) by smtp117.sbc.mail.bf1.yahoo.com with SMTP; 28 Apr 2013 05:09:06 +0000 UTC Message-ID: <517CAEF2.3020401@sbcglobal.net> Date: Sat, 27 Apr 2013 22:09:06 -0700 From: Thomas Skibo User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: "Wojciech A. Koszek" Subject: Re: svn commit: r249997 - in head/sys: arm/conf arm/xilinx arm/xilinx/zedboard boot/fdt/dts dev/cadence dev/sdhci References: <201304272238.r3RMcTCm097428@svn.freebsd.org> <20130427233945.GD85673@FreeBSD.org> In-Reply-To: <20130427233945.GD85673@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 05:09:13 -0000 I'm okay with it. On 4/27/13 4:39 PM, Wojciech A. Koszek wrote: > On Sat, Apr 27, 2013 at 10:38:29PM +0000, Wojciech A. Koszek wrote: >> Author: wkoszek >> Date: Sat Apr 27 22:38:29 2013 >> New Revision: 249997 >> URL: http://svnweb.freebsd.org/changeset/base/249997 >> >> Log: >> Add Xilinx Zynq ARM/FPGA SoC support to FreeBSD/arm port. >> >> Submitted by: Thomas Skibo >> Reviewed by: wkoszek, freebsd-arm@ (no objections raised) >> > > Thomas, > > Was 3-clause BSD license in some of the files used purposefully, or it's a > copy&paste thing? If you'd be OK with that, I'd like to fix some stuff with > copyrights: > > http://people.freebsd.org/~wkoszek/patches/zynq_copyright.diff > > Are you OK with that? > -- -------- Thomas Skibo ThomasSkibo@sbcglobal.net From owner-svn-src-head@FreeBSD.ORG Sun Apr 28 06:15:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1AA26174; Sun, 28 Apr 2013 06:15:57 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E75241AE2; Sun, 28 Apr 2013 06:15:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3S6Fui0057399; Sun, 28 Apr 2013 06:15:56 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3S6FuBT057398; Sun, 28 Apr 2013 06:15:56 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201304280615.r3S6FuBT057398@svn.freebsd.org> From: Joel Dahl Date: Sun, 28 Apr 2013 06:15:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250014 - head/share/man/man4/man4.arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 06:15:57 -0000 Author: joel (doc committer) Date: Sun Apr 28 06:15:56 2013 New Revision: 250014 URL: http://svnweb.freebsd.org/changeset/base/250014 Log: mdoc improvements Modified: head/share/man/man4/man4.arm/devcfg.4 Modified: head/share/man/man4/man4.arm/devcfg.4 ============================================================================== --- head/share/man/man4/man4.arm/devcfg.4 Sun Apr 28 03:13:45 2013 (r250013) +++ head/share/man/man4/man4.arm/devcfg.4 Sun Apr 28 06:15:56 2013 (r250014) @@ -37,7 +37,9 @@ The special file .Pa /dev/devcfg can be used to configure the PL (FPGA) section of the Xilinx Zynq-7000. .Pp -On the first write to the character device at file offset 0, the devcfg driver +On the first write to the character device at file offset 0, the +.Nm +driver asserts the top-level PL reset signals, disables the PS-PL level shifters, and clears the PL configuration. Write data is sent to the PCAP (processor configuration access port). @@ -54,16 +56,18 @@ The file should not be confused with the design tools. It is the binary form of the configuration bitstream. The Xilinx -.Pa promgen +.Ic promgen tool can do the conversion: .Bd -literal -offset indent promgen -b -w -p bin -data_width 32 -u 0 design.bit -o design.bit.bin .Ed .Sh SYSCTL VARIABLES -The devcfg driver provides the following +The +.Nm +driver provides the following .Xr sysctl 8 variables: -.Bl -tag -width 12 +.Bl -tag -width 4n .It Va hw.fpga.pl_done .Pp This variable always reflects the status of the PL's DONE signal. @@ -73,15 +77,19 @@ A 1 means the PL section has been proper This variable controls if the PS-PL level shifters are enabled after the PL section has been reconfigured. This variable is 1 by default but setting it to 0 allows the PL section to be -programmed with configurations that don't interface to the PS section of the +programmed with configurations that do not interface to the PS section of the part. Changing this value has no effect on the level shifters until the next device reconfiguration. +.El .Sh FILES -/dev/devcfg Character device for +.Bl -tag -width 12n +.It Pa /dev/devcfg +Character device for the .Nm driver. -.Sh AUTHORS -Thomas Skibo +.El .Sh SEE ALSO Zynq-7000 SoC Technical Reference Manual (Xilinx doc UG585) +.Sh AUTHORS +Thomas Skibo From owner-svn-src-head@FreeBSD.ORG Sun Apr 28 07:00:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BC6F066A; Sun, 28 Apr 2013 07:00:38 +0000 (UTC) (envelope-from wkoszek@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9F9E61B9C; Sun, 28 Apr 2013 07:00:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3S70ccP072039; Sun, 28 Apr 2013 07:00:38 GMT (envelope-from wkoszek@svn.freebsd.org) Received: (from wkoszek@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3S70arA072022; Sun, 28 Apr 2013 07:00:36 GMT (envelope-from wkoszek@svn.freebsd.org) Message-Id: <201304280700.r3S70arA072022@svn.freebsd.org> From: "Wojciech A. Koszek" Date: Sun, 28 Apr 2013 07:00:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250015 - in head/sys: arm/xilinx dev/cadence X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 07:00:38 -0000 Author: wkoszek Date: Sun Apr 28 07:00:36 2013 New Revision: 250015 URL: http://svnweb.freebsd.org/changeset/base/250015 Log: Bring copyright changes with the agreement of Thomas Skibo. Communication on src-commiters, Sat, 27 Apr 2013 22:09:06 -0700, Subject was: "Re: svn commit: r249997" As I'm here, fix the style main block comments in files' headers. Modified: head/sys/arm/xilinx/zy7_devcfg.c head/sys/arm/xilinx/zy7_ehci.c head/sys/arm/xilinx/zy7_gpio.c head/sys/arm/xilinx/zy7_l2cache.c head/sys/arm/xilinx/zy7_machdep.c head/sys/arm/xilinx/zy7_reg.h head/sys/arm/xilinx/zy7_slcr.c head/sys/arm/xilinx/zy7_slcr.h head/sys/dev/cadence/if_cgem.c head/sys/dev/cadence/if_cgem_hw.h Modified: head/sys/arm/xilinx/zy7_devcfg.c ============================================================================== --- head/sys/arm/xilinx/zy7_devcfg.c Sun Apr 28 06:15:56 2013 (r250014) +++ head/sys/arm/xilinx/zy7_devcfg.c Sun Apr 28 07:00:36 2013 (r250015) @@ -1,32 +1,33 @@ /*- - * Copyright (C) 2013, Thomas Skibo. + * Copyright (c) 2013 Thomas Skibo * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * The names of contributors may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * 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 AUTHORS 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 + * 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. + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * + * $FreeBSD$ */ -/* Zynq-7000 Devcfg driver. This allows programming the PL (FPGA) section +/* + * Zynq-7000 Devcfg driver. This allows programming the PL (FPGA) section * of Zynq. * * Reference: Zynq-7000 All Programmable SoC Technical Reference Manual. Modified: head/sys/arm/xilinx/zy7_ehci.c ============================================================================== --- head/sys/arm/xilinx/zy7_ehci.c Sun Apr 28 06:15:56 2013 (r250014) +++ head/sys/arm/xilinx/zy7_ehci.c Sun Apr 28 07:00:36 2013 (r250015) @@ -1,31 +1,33 @@ /*- - * Copyright (C) 2012-2013, Thomas Skibo. + * Copyright (c) 2012-2013 Thomas Skibo * All rights reserved. * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * The names of contributors may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * 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 AUTHORS 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. + * 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$ */ -/* A host-controller driver for Zynq-7000's USB OTG controller. +/* + * A host-controller driver for Zynq-7000's USB OTG controller. * * Reference: Zynq-7000 All Programmable SoC Technical Reference Manual. * (v1.4) November 16, 2012. Xilinx doc UG585. Ch. 15 covers the USB Modified: head/sys/arm/xilinx/zy7_gpio.c ============================================================================== --- head/sys/arm/xilinx/zy7_gpio.c Sun Apr 28 06:15:56 2013 (r250014) +++ head/sys/arm/xilinx/zy7_gpio.c Sun Apr 28 07:00:36 2013 (r250015) @@ -1,32 +1,33 @@ /*- - * Copyright (C) 2013, Thomas Skibo. + * Copyright (c) 2013 Thomas Skibo * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * The names of contributors may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * 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 AUTHORS 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 + * 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. + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * + * $FreeBSD$ */ -/* A GPIO driver for Xilinx Zynq-7000. +/* + * A GPIO driver for Xilinx Zynq-7000. * * The GPIO peripheral on Zynq allows controlling 114 general purpose I/Os. * Modified: head/sys/arm/xilinx/zy7_l2cache.c ============================================================================== --- head/sys/arm/xilinx/zy7_l2cache.c Sun Apr 28 06:15:56 2013 (r250014) +++ head/sys/arm/xilinx/zy7_l2cache.c Sun Apr 28 07:00:36 2013 (r250015) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2013, Thomas Skibo. + * Copyright (c) 2013 Thomas Skibo * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -11,20 +11,24 @@ * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ */ #include __FBSDID("$FreeBSD$"); + #include #include #include Modified: head/sys/arm/xilinx/zy7_machdep.c ============================================================================== --- head/sys/arm/xilinx/zy7_machdep.c Sun Apr 28 06:15:56 2013 (r250014) +++ head/sys/arm/xilinx/zy7_machdep.c Sun Apr 28 07:00:36 2013 (r250015) @@ -1,32 +1,33 @@ /*- - * Copyright (C) 2012-2013, Thomas Skibo. + * Copyright (c) 2013 Thomas Skibo * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * The names of contributors may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * 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 AUTHORS 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 + * 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. + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * + * $FreeBSD$ */ -/* Machine dependent code for Xilinx Zynq-7000 Soc. +/* + * Machine dependent code for Xilinx Zynq-7000 Soc. * * Reference: Zynq-7000 All Programmable SoC Technical Reference Manual. * (v1.4) November 16, 2012. Xilinx doc UG585. Modified: head/sys/arm/xilinx/zy7_reg.h ============================================================================== --- head/sys/arm/xilinx/zy7_reg.h Sun Apr 28 06:15:56 2013 (r250014) +++ head/sys/arm/xilinx/zy7_reg.h Sun Apr 28 07:00:36 2013 (r250015) @@ -1,33 +1,33 @@ /*- - * Copyright (C) 2012-2013, Thomas Skibo. + * Copyright (c) 2012-2013 Thomas Skibo * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * The names of contributors may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * 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 Thomas Skibo 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. + * 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$ */ -/* $FreeBSD$ */ - -/* Address regions of Zynq-7000. +/* + * Address regions of Zynq-7000. * Reference: Zynq-7000 All Programmable SoC Technical Reference Manual. * (v1.4) November 16, 2012. Xilinx doc UG585. */ Modified: head/sys/arm/xilinx/zy7_slcr.c ============================================================================== --- head/sys/arm/xilinx/zy7_slcr.c Sun Apr 28 06:15:56 2013 (r250014) +++ head/sys/arm/xilinx/zy7_slcr.c Sun Apr 28 07:00:36 2013 (r250015) @@ -1,32 +1,33 @@ /*- - * Copyright (C) 2013, Thomas Skibo. + * Copyright (c) 2013 Thomas Skibo * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * The names of contributors may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * 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 AUTHORS 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 + * 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. + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * + * $FreeBSD$ */ -/* Zynq-700 SLCR driver. Provides hooks for cpu_reset and PL control stuff. +/* + * Zynq-700 SLCR driver. Provides hooks for cpu_reset and PL control stuff. * In the future, maybe MIO control, clock control, etc. could go here. * * Reference: Zynq-7000 All Programmable SoC Technical Reference Manual. Modified: head/sys/arm/xilinx/zy7_slcr.h ============================================================================== --- head/sys/arm/xilinx/zy7_slcr.h Sun Apr 28 06:15:56 2013 (r250014) +++ head/sys/arm/xilinx/zy7_slcr.h Sun Apr 28 07:00:36 2013 (r250015) @@ -1,34 +1,33 @@ /*- - * Copyright (C) 2013, Thomas Skibo. + * Copyright (c) 2013 Thomas Skibo * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * The names of contributors may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * 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 AUTHORS 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 + * 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. + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * + * $FreeBSD$ */ -/* $FreeBSD$ */ - -/* Defines for Zynq-7000 SLCR registers. +/* + * Defines for Zynq-7000 SLCR registers. * * Most of these registers are initialized by the First Stage Boot * Loader and are not modified by the kernel. Modified: head/sys/dev/cadence/if_cgem.c ============================================================================== --- head/sys/dev/cadence/if_cgem.c Sun Apr 28 06:15:56 2013 (r250014) +++ head/sys/dev/cadence/if_cgem.c Sun Apr 28 07:00:36 2013 (r250015) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012-2013 Thomas Skibo. + * Copyright (c) 2012-2013 Thomas Skibo * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -24,7 +24,8 @@ * SUCH DAMAGE. */ -/* A network interface driver for Cadence GEM Gigabit Ethernet +/* + * A network interface driver for Cadence GEM Gigabit Ethernet * interface such as the one used in Xilinx Zynq-7000 SoC. * * Reference: Zynq-7000 All Programmable SoC Technical Reference Manual. Modified: head/sys/dev/cadence/if_cgem_hw.h ============================================================================== --- head/sys/dev/cadence/if_cgem_hw.h Sun Apr 28 06:15:56 2013 (r250014) +++ head/sys/dev/cadence/if_cgem_hw.h Sun Apr 28 07:00:36 2013 (r250015) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012-2013 Thomas Skibo. + * Copyright (c) 2012-2013 Thomas Skibo * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -22,10 +22,10 @@ * 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$ */ -/* $FreeBSD$ */ - /* * Hardware and register defines for Cadence GEM Gigabit Ethernet * controller such as the one used in Zynq-7000 SoC. From owner-svn-src-head@FreeBSD.ORG Sun Apr 28 08:29:01 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 67447319; Sun, 28 Apr 2013 08:29:01 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 595771D68; Sun, 28 Apr 2013 08:29:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3S8T1YG003610; Sun, 28 Apr 2013 08:29:01 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3S8T10k003608; Sun, 28 Apr 2013 08:29:01 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201304280829.r3S8T10k003608@svn.freebsd.org> From: Alan Cox Date: Sun, 28 Apr 2013 08:29:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250018 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 08:29:01 -0000 Author: alc Date: Sun Apr 28 08:29:00 2013 New Revision: 250018 URL: http://svnweb.freebsd.org/changeset/base/250018 Log: Eliminate an unneeded call to vm_radix_trimkey() from vm_radix_lookup_le(). This call is clearing bits from the key that will be set again by the next line. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_radix.c Modified: head/sys/vm/vm_radix.c ============================================================================== --- head/sys/vm/vm_radix.c Sun Apr 28 07:52:46 2013 (r250017) +++ head/sys/vm/vm_radix.c Sun Apr 28 08:29:00 2013 (r250018) @@ -666,7 +666,6 @@ restart: */ if (slot > 0) { inc = VM_RADIX_UNITLEVEL(rnode->rn_clev); - index = vm_radix_trimkey(index, rnode->rn_clev); index |= inc - 1; do { index -= inc; From owner-svn-src-head@FreeBSD.ORG Sun Apr 28 09:29:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7A628E71; Sun, 28 Apr 2013 09:29:45 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6C43F1F17; Sun, 28 Apr 2013 09:29:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3S9Tjfe024621; Sun, 28 Apr 2013 09:29:45 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3S9TjEf024620; Sun, 28 Apr 2013 09:29:45 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201304280929.r3S9TjEf024620@svn.freebsd.org> From: Joel Dahl Date: Sun, 28 Apr 2013 09:29:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250019 - head/usr.bin/biff X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 09:29:45 -0000 Author: joel (doc committer) Date: Sun Apr 28 09:29:44 2013 New Revision: 250019 URL: http://svnweb.freebsd.org/changeset/base/250019 Log: Fix EXIT STATUS. biff reports its status when it was invoked. Submitted by: Ryan Kavanagh, Jason McIntyre Obtained from: OpenBSD Modified: head/usr.bin/biff/biff.1 Modified: head/usr.bin/biff/biff.1 ============================================================================== --- head/usr.bin/biff/biff.1 Sun Apr 28 08:29:00 2013 (r250018) +++ head/usr.bin/biff/biff.1 Sun Apr 28 09:29:44 2013 (r250019) @@ -28,7 +28,7 @@ .\" @(#)biff.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd March 20, 2010 +.Dd April 28, 2013 .Dt BIFF 1 .Os .Sh NAME @@ -97,9 +97,9 @@ The utility exits with one of the following values: .Bl -tag -width indent .It 0 -Notification is enabled. +Notification was enabled at the time of invocation. .It 1 -Notification is disabled. +Notification was disabled at the time of invocation. .It >1 An error occurred. .El From owner-svn-src-head@FreeBSD.ORG Sun Apr 28 14:40:30 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 336A5147; Sun, 28 Apr 2013 14:40:30 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2643F17EA; Sun, 28 Apr 2013 14:40:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SEeUqK033361; Sun, 28 Apr 2013 14:40:30 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SEeUKT033360; Sun, 28 Apr 2013 14:40:30 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201304281440.r3SEeUKT033360@svn.freebsd.org> From: Robert Watson Date: Sun, 28 Apr 2013 14:40:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250020 - head/lib/libstand/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 14:40:30 -0000 Author: rwatson Date: Sun Apr 28 14:40:29 2013 New Revision: 250020 URL: http://svnweb.freebsd.org/changeset/base/250020 Log: Merge @228176 from Perforce to fix a bug introduced in r249553: Trim two now-unneeded (and likely harmful) lines from the libstand setjmp/longjmp for MIPS. Spotted by: jmallett MFC after: 3 days Sponsored by: DARPA, AFRL Modified: head/lib/libstand/mips/_setjmp.S Modified: head/lib/libstand/mips/_setjmp.S ============================================================================== --- head/lib/libstand/mips/_setjmp.S Sun Apr 28 09:29:44 2013 (r250019) +++ head/lib/libstand/mips/_setjmp.S Sun Apr 28 14:40:29 2013 (r250020) @@ -72,7 +72,6 @@ LEAF(_setjmp) REG_S s7, ((S7 + 3) * SZREG)(a0) REG_S sp, ((SP + 3) * SZREG)(a0) REG_S s8, ((S8 + 3) * SZREG)(a0) - REG_S v0, ((32 + 38) * SZREG)(a0) j ra move v0, zero END(_setjmp) @@ -96,7 +95,6 @@ LEAF(_longjmp) REG_L s5, ((S5 + 3) * SZREG)(a0) REG_L s6, ((S6 + 3) * SZREG)(a0) REG_L s7, ((S7 + 3) * SZREG)(a0) - REG_L v0, ((32 + 38) * SZREG)(a0) # get fpu status REG_L sp, ((SP + 3) * SZREG)(a0) REG_L s8, ((S8 + 3) * SZREG)(a0) From owner-svn-src-head@FreeBSD.ORG Sun Apr 28 16:20:09 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AB5DC576; Sun, 28 Apr 2013 16:20:09 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9E6931C55; Sun, 28 Apr 2013 16:20:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SGK9iI068619; Sun, 28 Apr 2013 16:20:09 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SGK9nK068618; Sun, 28 Apr 2013 16:20:09 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201304281620.r3SGK9nK068618@svn.freebsd.org> From: Sean Bruno Date: Sun, 28 Apr 2013 16:20:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250021 - head/sys/dev/ciss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 16:20:09 -0000 Author: sbruno Date: Sun Apr 28 16:20:09 2013 New Revision: 250021 URL: http://svnweb.freebsd.org/changeset/base/250021 Log: Its time to retire COMPAQ. I don't think that its coming back. :-) Obtained from: Yahoo! Inc. MFC after: 2 weeks Modified: head/sys/dev/ciss/ciss.c Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Sun Apr 28 14:40:29 2013 (r250020) +++ head/sys/dev/ciss/ciss.c Sun Apr 28 16:20:09 2013 (r250021) @@ -3375,7 +3375,7 @@ ciss_cam_complete_fixup(struct ciss_soft cl = &sc->ciss_logical[bus][target]; - padstr(inq->vendor, "COMPAQ", + padstr(inq->vendor, "HP", SID_VENDOR_SIZE); padstr(inq->product, ciss_name_ldrive_org(cl->cl_ldrive->fault_tolerance), From owner-svn-src-head@FreeBSD.ORG Sun Apr 28 16:35:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 275878FD; Sun, 28 Apr 2013 16:35:24 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 19F231CF4; Sun, 28 Apr 2013 16:35:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SGZNrY074325; Sun, 28 Apr 2013 16:35:23 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SGZNDC074324; Sun, 28 Apr 2013 16:35:23 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201304281635.r3SGZNDC074324@svn.freebsd.org> From: Sean Bruno Date: Sun, 28 Apr 2013 16:35:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250022 - head/sys/dev/ciss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 16:35:24 -0000 Author: sbruno Date: Sun Apr 28 16:35:23 2013 New Revision: 250022 URL: http://svnweb.freebsd.org/changeset/base/250022 Log: Let's align correctly by setting to 17. OpenCISS states that if the value is 0, then the driver should try a value of 31. That's just silly. Set to 17 so that the subtraction for maxio becomes 16 and aligns nicely. Reviewed by: scottl Obtained from: Yahoo! Inc. MFC after: 2 weeks Modified: head/sys/dev/ciss/ciss.c Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Sun Apr 28 16:20:09 2013 (r250021) +++ head/sys/dev/ciss/ciss.c Sun Apr 28 16:35:23 2013 (r250022) @@ -3007,7 +3007,7 @@ ciss_cam_action(struct cam_sim *sim, uni cpi->protocol = PROTO_SCSI; cpi->protocol_version = SCSI_REV_2; if (sc->ciss_cfg->max_sg_length == 0) { - sg_length = 16; + sg_length = 17; } else { /* XXX Fix for ZMR cards that advertise max_sg_length == 32 * Confusing bit here. max_sg_length is usually a power of 2. We always From owner-svn-src-head@FreeBSD.ORG Sun Apr 28 16:35:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F22968FE; Sun, 28 Apr 2013 16:35:24 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E4BEE1CF5; Sun, 28 Apr 2013 16:35:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SGZOfn074364; Sun, 28 Apr 2013 16:35:24 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SGZOst074363; Sun, 28 Apr 2013 16:35:24 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201304281635.r3SGZOst074363@svn.freebsd.org> From: Robert Watson Date: Sun, 28 Apr 2013 16:35:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250023 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 16:35:25 -0000 Author: rwatson Date: Sun Apr 28 16:35:24 2013 New Revision: 250023 URL: http://svnweb.freebsd.org/changeset/base/250023 Log: Enable building string functions as part of libstand on mips; the Makefile is a bit obfuscated here, as ia64 adds string source files elsewhere, so simply exclude it here. Reviewed by: imp MFC after: 3 days Sponsored by: DARPA, AFRL Modified: head/lib/libstand/Makefile Modified: head/lib/libstand/Makefile ============================================================================== --- head/lib/libstand/Makefile Sun Apr 28 16:35:23 2013 (r250022) +++ head/lib/libstand/Makefile Sun Apr 28 16:35:24 2013 (r250023) @@ -54,9 +54,7 @@ SRCS+= ntoh.c # string functions from libc .PATH: ${.CURDIR}/../libc/string -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "powerpc" || \ - ${MACHINE_CPUARCH} == "sparc64" || ${MACHINE_CPUARCH} == "amd64" || \ - ${MACHINE_CPUARCH} == "arm" +.if ${MACHINE_CPUARCH} != "ia64" SRCS+= bcmp.c bcopy.c bzero.c ffs.c memccpy.c memchr.c memcmp.c memcpy.c \ memmove.c memset.c qdivrem.c strcat.c strchr.c strcmp.c strcpy.c \ strcspn.c strlen.c strncat.c strncmp.c strncpy.c strpbrk.c \ From owner-svn-src-head@FreeBSD.ORG Sun Apr 28 17:58:11 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C51C9433; Sun, 28 Apr 2013 17:58:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B7C1A1FA5; Sun, 28 Apr 2013 17:58:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SHwBCm003182; Sun, 28 Apr 2013 17:58:11 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SHwBCC003180; Sun, 28 Apr 2013 17:58:11 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304281758.r3SHwBCC003180@svn.freebsd.org> From: Eitan Adler Date: Sun, 28 Apr 2013 17:58:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250024 - in head: tools/build/mk usr.bin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 17:58:11 -0000 Author: eadler Date: Sun Apr 28 17:58:11 2013 New Revision: 250024 URL: http://svnweb.freebsd.org/changeset/base/250024 Log: When the world is built WITHOUT_OPENSSH also don't install ssh-copy-id. PR: misc/177590 Submitted by: Oleg Ginzburg Reviewed by: imp Modified: head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.bin/Makefile Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sun Apr 28 16:35:24 2013 (r250023) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sun Apr 28 17:58:11 2013 (r250024) @@ -3674,9 +3674,9 @@ OLD_FILES+=usr/share/man/man8/ntptime.8. # to be filled in #.endif -#.if ${MK_OPENSSH} == no -# to be filled in -#.endif +.if ${MK_OPENSSH} == no +OLD_FILES+=usr.bin/ssh-copy-id +.endif #.if ${MK_OPENSSL} == no # to be filled in Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Sun Apr 28 16:35:24 2013 (r250023) +++ head/usr.bin/Makefile Sun Apr 28 17:58:11 2013 (r250024) @@ -148,7 +148,6 @@ SUBDIR= alias \ sockstat \ sort \ split \ - ssh-copy-id \ stat \ stdbuf \ su \ @@ -303,6 +302,10 @@ SUBDIR+= ypmatch SUBDIR+= ypwhich .endif +.if ${MK_OPENSSH} != "no" +SUBDIR+= ssh-copy-id +.endif + .if ${MK_OPENSSL} != "no" SUBDIR+= bc SUBDIR+= chkey From owner-svn-src-head@FreeBSD.ORG Sun Apr 28 18:12:44 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7485ABE2; Sun, 28 Apr 2013 18:12:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 677E01058; Sun, 28 Apr 2013 18:12:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SICi8p009628; Sun, 28 Apr 2013 18:12:44 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SICigh009627; Sun, 28 Apr 2013 18:12:44 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304281812.r3SICigh009627@svn.freebsd.org> From: Alexander Motin Date: Sun, 28 Apr 2013 18:12:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250025 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 18:12:44 -0000 Author: mav Date: Sun Apr 28 18:12:43 2013 New Revision: 250025 URL: http://svnweb.freebsd.org/changeset/base/250025 Log: Add some cam_freeze_devq()'s missed at r249466. This makes number of freezes match the number of releases. Reported by: dim Modified: head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Sun Apr 28 17:58:11 2013 (r250024) +++ head/sys/cam/scsi/scsi_xpt.c Sun Apr 28 18:12:43 2013 (r250025) @@ -883,6 +883,7 @@ again: * routine finish up for us. */ start_ccb->csio.data_ptr = NULL; + cam_freeze_devq(periph->path); probedone(periph, start_ccb); return; } @@ -913,6 +914,7 @@ again: * routine finish up for us. */ start_ccb->csio.data_ptr = NULL; + cam_freeze_devq(periph->path); probedone(periph, start_ccb); return; } @@ -952,6 +954,7 @@ again: * routine finish up for us. */ start_ccb->csio.data_ptr = NULL; + cam_freeze_devq(periph->path); probedone(periph, start_ccb); return; } From owner-svn-src-head@FreeBSD.ORG Sun Apr 28 18:40:55 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 96F25295; Sun, 28 Apr 2013 18:40:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 898EC10E8; Sun, 28 Apr 2013 18:40:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SIetZX019669; Sun, 28 Apr 2013 18:40:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SIetpT019668; Sun, 28 Apr 2013 18:40:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304281840.r3SIetpT019668@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 28 Apr 2013 18:40:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250026 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 18:40:55 -0000 Author: kib Date: Sun Apr 28 18:40:55 2013 New Revision: 250026 URL: http://svnweb.freebsd.org/changeset/base/250026 Log: Convert panic() into KASSERT(). Reviewed by: alc MFC after: 1 week Modified: head/sys/vm/vnode_pager.c Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Sun Apr 28 18:12:43 2013 (r250025) +++ head/sys/vm/vnode_pager.c Sun Apr 28 18:40:55 2013 (r250026) @@ -214,8 +214,7 @@ retry: VM_OBJECT_SLEEP(object, object, PDROP | PVM, "vadead", 0); } - if (vp->v_usecount == 0) - panic("vnode_pager_alloc: no vnode reference"); + KASSERT(vp->v_usecount != 0, ("vnode_pager_alloc: no vnode reference")); if (object == NULL) { /* From owner-svn-src-head@FreeBSD.ORG Sun Apr 28 19:12:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 492E8D8A; Sun, 28 Apr 2013 19:12:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3AF1311C2; Sun, 28 Apr 2013 19:12:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SJC94I030637; Sun, 28 Apr 2013 19:12:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SJC9bL030636; Sun, 28 Apr 2013 19:12:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304281912.r3SJC9bL030636@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 28 Apr 2013 19:12:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250027 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 19:12:10 -0000 Author: kib Date: Sun Apr 28 19:12:09 2013 New Revision: 250027 URL: http://svnweb.freebsd.org/changeset/base/250027 Log: Eliminate the layering violation in the kern_sendfile(). When quering the file size, use VOP_GETATTR() instead of accessing vnode vm_object un_pager.vnp.vnp_size. Take the shared vnode lock earlier to cover the added VOP_GETATTR() call and, as consequence, the whole internal sendfile loop. Reduce vm object lock scope to not protect the local calculations. Note that this is the last misuse of the vnp_size in the tree, the others were removed from the ELF image activator by r230246. Reviewed by: alc Tested by: pho, bf (previous version) MFC after: 1 week Modified: head/sys/kern/uipc_syscalls.c Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Sun Apr 28 18:40:55 2013 (r250026) +++ head/sys/kern/uipc_syscalls.c Sun Apr 28 19:12:09 2013 (r250027) @@ -1902,8 +1902,10 @@ kern_sendfile(struct thread *td, struct struct mbuf *m = NULL; struct sf_buf *sf; struct vm_page *pg; + struct vattr va; off_t off, xfsize, fsbytes = 0, sbytes = 0, rem = 0; int error, hdrlen = 0, mnw = 0; + int bsize; struct sendfile_sync *sfs = NULL; /* @@ -2102,6 +2104,16 @@ retry_space: */ space -= hdrlen; + error = vn_lock(vp, LK_SHARED); + if (error != 0) + goto done; + error = VOP_GETATTR(vp, &va, td->td_ucred); + if (error != 0) { + VOP_UNLOCK(vp, 0); + goto done; + } + bsize = vp->v_mount->mnt_stat.f_iosize; + /* * Loop and construct maximum sized mbuf chain to be bulk * dumped into socket buffer. @@ -2111,7 +2123,6 @@ retry_space: vm_offset_t pgoff; struct mbuf *m0; - VM_OBJECT_WLOCK(obj); /* * Calculate the amount to transfer. * Not to exceed a page, the EOF, @@ -2121,12 +2132,11 @@ retry_space: if (uap->nbytes) rem = (uap->nbytes - fsbytes - loopbytes); else - rem = obj->un_pager.vnp.vnp_size - + rem = va.va_size - uap->offset - fsbytes - loopbytes; xfsize = omin(PAGE_SIZE - pgoff, rem); xfsize = omin(space - loopbytes, xfsize); if (xfsize <= 0) { - VM_OBJECT_WUNLOCK(obj); done = 1; /* all data sent */ break; } @@ -2136,7 +2146,6 @@ retry_space: * Let the outer loop figure out how to handle it. */ if (space <= loopbytes) { - VM_OBJECT_WUNLOCK(obj); done = 0; break; } @@ -2146,6 +2155,7 @@ retry_space: * if not found or wait and loop if busy. */ pindex = OFF_TO_IDX(off); + VM_OBJECT_WLOCK(obj); pg = vm_page_grab(obj, pindex, VM_ALLOC_NOBUSY | VM_ALLOC_NORMAL | VM_ALLOC_WIRED | VM_ALLOC_RETRY); @@ -2163,7 +2173,6 @@ retry_space: else if (uap->flags & SF_NODISKIO) error = EBUSY; else { - int bsize; ssize_t resid; /* @@ -2175,13 +2184,6 @@ retry_space: /* * Get the page from backing store. - */ - error = vn_lock(vp, LK_SHARED); - if (error != 0) - goto after_read; - bsize = vp->v_mount->mnt_stat.f_iosize; - - /* * XXXMAC: Because we don't have fp->f_cred * here, we pass in NOCRED. This is probably * wrong, but is consistent with our original @@ -2191,8 +2193,6 @@ retry_space: trunc_page(off), UIO_NOCOPY, IO_NODELOCKED | IO_VMIO | ((MAXBSIZE / bsize) << IO_SEQSHIFT), td->td_ucred, NOCRED, &resid, td); - VOP_UNLOCK(vp, 0); - after_read: VM_OBJECT_WLOCK(obj); vm_page_io_finish(pg); if (!error) @@ -2281,6 +2281,8 @@ retry_space: } } + VOP_UNLOCK(vp, 0); + /* Add the buffer chain to the socket buffer. */ if (m != NULL) { int mlen, err; From owner-svn-src-head@FreeBSD.ORG Sun Apr 28 19:19:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8D0F0392; Sun, 28 Apr 2013 19:19:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 802FC11F1; Sun, 28 Apr 2013 19:19:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SJJQux031999; Sun, 28 Apr 2013 19:19:26 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SJJQI9031998; Sun, 28 Apr 2013 19:19:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304281919.r3SJJQI9031998@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 28 Apr 2013 19:19:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250028 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 19:19:26 -0000 Author: kib Date: Sun Apr 28 19:19:26 2013 New Revision: 250028 URL: http://svnweb.freebsd.org/changeset/base/250028 Log: Assert that the object type for the vnode' non-NULL v_object, passed to vnode_pager_setsize(), is either OBJT_VNODE, or, if vnode was already reclaimed, OBJT_DEAD. Note that the later is only possible due to some filesystems, in particular, nfsiods from nfs clients, call vnode_pager_setsize() with unlocked vnode. More, if the object is terminated, do not perform the resizing operation. Reviewed by: alc Tested by: pho, bf MFC after: 1 week Modified: head/sys/vm/vnode_pager.c Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Sun Apr 28 19:12:09 2013 (r250027) +++ head/sys/vm/vnode_pager.c Sun Apr 28 19:19:26 2013 (r250028) @@ -380,6 +380,12 @@ vnode_pager_setsize(vp, nsize) return; /* ASSERT_VOP_ELOCKED(vp, "vnode_pager_setsize and not locked vnode"); */ VM_OBJECT_WLOCK(object); + if (object->type == OBJT_DEAD) { + VM_OBJECT_WUNLOCK(object); + return; + } + KASSERT(object->type == OBJT_VNODE, + ("not vnode-backed object %p", object)); if (nsize == object->un_pager.vnp.vnp_size) { /* * Hasn't changed size From owner-svn-src-head@FreeBSD.ORG Sun Apr 28 19:25:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5FF535A8; Sun, 28 Apr 2013 19:25:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 392501223; Sun, 28 Apr 2013 19:25:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SJPAHX034667; Sun, 28 Apr 2013 19:25:10 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SJP9N7034664; Sun, 28 Apr 2013 19:25:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304281925.r3SJP9N7034664@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 28 Apr 2013 19:25:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250029 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 19:25:10 -0000 Author: kib Date: Sun Apr 28 19:25:09 2013 New Revision: 250029 URL: http://svnweb.freebsd.org/changeset/base/250029 Log: Make vm_object_page_clean() and vm_mmap_vnode() tolerate the vnode' v_object of non OBJT_VNODE type. For vm_object_page_clean(), simply do not assert that object type must be OBJT_VNODE, and add a comment explaining how the check for OBJ_MIGHTBEDIRTY prevents the rest of function from operating on such objects. For vm_mmap_vnode(), if the object type is not OBJT_VNODE, require it to be for swap pager (or default), handle the bypass filesystems, and correctly acquire the object reference in this case. Reviewed by: alc Tested by: pho, bf MFC after: 1 week Modified: head/sys/vm/vm_mmap.c head/sys/vm/vm_object.c Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Sun Apr 28 19:19:26 2013 (r250028) +++ head/sys/vm/vm_mmap.c Sun Apr 28 19:25:09 2013 (r250029) @@ -1284,7 +1284,7 @@ vm_mmap_vnode(struct thread *td, vm_size error = EINVAL; goto done; } - if (obj->handle != vp) { + if (obj->type == OBJT_VNODE && obj->handle != vp) { vput(vp); vp = (struct vnode *)obj->handle; /* @@ -1333,7 +1333,14 @@ vm_mmap_vnode(struct thread *td, vm_size objsize = round_page(va.va_size); if (va.va_nlink == 0) flags |= MAP_NOSYNC; - obj = vm_pager_allocate(OBJT_VNODE, vp, objsize, prot, foff, cred); + if (obj->type == OBJT_VNODE) + obj = vm_pager_allocate(OBJT_VNODE, vp, objsize, prot, foff, + cred); + else { + KASSERT(obj->type == OBJT_DEFAULT || obj->type == OBJT_SWAP, + ("wrong object type")); + vm_object_reference(obj); + } if (obj == NULL) { error = ENOMEM; goto done; Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Sun Apr 28 19:19:26 2013 (r250028) +++ head/sys/vm/vm_object.c Sun Apr 28 19:25:09 2013 (r250029) @@ -820,7 +820,12 @@ vm_object_page_clean(vm_object_t object, boolean_t clearobjflags, eio, res; VM_OBJECT_ASSERT_WLOCKED(object); - KASSERT(object->type == OBJT_VNODE, ("Not a vnode object")); + + /* + * The OBJ_MIGHTBEDIRTY flag is only set for OBJT_VNODE + * objects. The check below prevents the function from + * operating on non-vnode objects. + */ if ((object->flags & OBJ_MIGHTBEDIRTY) == 0 || object->resident_page_count == 0) return (TRUE); From owner-svn-src-head@FreeBSD.ORG Sun Apr 28 19:39:01 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5A24BA05; Sun, 28 Apr 2013 19:39:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4C33D1297; Sun, 28 Apr 2013 19:39:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SJd0S3038704; Sun, 28 Apr 2013 19:39:00 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SJd0UA038698; Sun, 28 Apr 2013 19:39:00 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304281939.r3SJd0UA038698@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 28 Apr 2013 19:39:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250030 - in head/sys: fs/tmpfs vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 19:39:01 -0000 Author: kib Date: Sun Apr 28 19:38:59 2013 New Revision: 250030 URL: http://svnweb.freebsd.org/changeset/base/250030 Log: Rework the handling of the tmpfs node backing swap object and tmpfs vnode v_object to avoid double-buffering. Use the same object both as the backing store for tmpfs node and as the v_object. Besides reducing memory use up to 2x times for situation of mapping files from tmpfs, it also makes tmpfs read and write operations copy twice bytes less. VM subsystem was already slightly adapted to tolerate OBJT_SWAP object as v_object. Now the vm_object_deallocate() is modified to not reinstantiate OBJ_ONEMAPPING flag and help the VFS to correctly handle VV_TEXT flag on the last dereference of the tmpfs backing object. Reviewed by: alc Tested by: pho, bf MFC after: 1 month Modified: head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vnops.c head/sys/vm/vm_object.c head/sys/vm/vm_object.h Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Sun Apr 28 19:25:09 2013 (r250029) +++ head/sys/fs/tmpfs/tmpfs_subr.c Sun Apr 28 19:38:59 2013 (r250030) @@ -166,6 +166,7 @@ tmpfs_alloc_node(struct tmpfs_mount *tmp char *target, dev_t rdev, struct tmpfs_node **node) { struct tmpfs_node *nnode; + vm_object_t obj; /* If the root directory of the 'tmp' file system is not yet * allocated, this must be the request to do it. */ @@ -227,9 +228,14 @@ tmpfs_alloc_node(struct tmpfs_mount *tmp break; case VREG: - nnode->tn_reg.tn_aobj = + obj = nnode->tn_reg.tn_aobj = vm_pager_allocate(OBJT_SWAP, NULL, 0, VM_PROT_DEFAULT, 0, NULL /* XXXKIB - tmpfs needs swap reservation */); + VM_OBJECT_WLOCK(obj); + /* OBJ_TMPFS is set together with the setting of vp->v_object */ + vm_object_set_flag(obj, OBJ_NOSPLIT); + vm_object_clear_flag(obj, OBJ_ONEMAPPING); + VM_OBJECT_WUNLOCK(obj); break; default: @@ -434,9 +440,11 @@ int tmpfs_alloc_vp(struct mount *mp, struct tmpfs_node *node, int lkflag, struct vnode **vpp) { - int error = 0; struct vnode *vp; + vm_object_t object; + int error; + error = 0; loop: TMPFS_NODE_LOCK(node); if ((vp = node->tn_vnode) != NULL) { @@ -506,13 +514,22 @@ loop: /* FALLTHROUGH */ case VLNK: /* FALLTHROUGH */ - case VREG: - /* FALLTHROUGH */ case VSOCK: break; case VFIFO: vp->v_op = &tmpfs_fifoop_entries; break; + case VREG: + object = node->tn_reg.tn_aobj; + VM_OBJECT_WLOCK(object); + VI_LOCK(vp); + KASSERT(vp->v_object == NULL, ("Not NULL v_object in tmpfs")); + vp->v_object = object; + object->un_pager.swp.swp_tmpfs = vp; + vm_object_set_flag(object, OBJ_TMPFS); + VI_UNLOCK(vp); + VM_OBJECT_WUNLOCK(object); + break; case VDIR: MPASS(node->tn_dir.tn_parent != NULL); if (node->tn_dir.tn_parent == node) @@ -523,7 +540,6 @@ loop: panic("tmpfs_alloc_vp: type %p %d", node, (int)node->tn_type); } - vnode_pager_setsize(vp, node->tn_size); error = insmntque(vp, mp); if (error) vp = NULL; @@ -1343,7 +1359,6 @@ retry: TMPFS_UNLOCK(tmp); node->tn_size = newsize; - vnode_pager_setsize(vp, newsize); return (0); } Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Sun Apr 28 19:25:09 2013 (r250029) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Sun Apr 28 19:38:59 2013 (r250030) @@ -278,8 +278,6 @@ tmpfs_close(struct vop_close_args *v) { struct vnode *vp = v->a_vp; - MPASS(VOP_ISLOCKED(vp)); - /* Update node times. */ tmpfs_update(vp); @@ -439,7 +437,6 @@ tmpfs_setattr(struct vop_setattr_args *v return error; } -/* --------------------------------------------------------------------- */ static int tmpfs_nocacheread(vm_object_t tobj, vm_pindex_t idx, vm_offset_t offset, size_t tlen, struct uio *uio) @@ -448,12 +445,35 @@ tmpfs_nocacheread(vm_object_t tobj, vm_p int error, rv; VM_OBJECT_WLOCK(tobj); - m = vm_page_grab(tobj, idx, VM_ALLOC_WIRED | - VM_ALLOC_NORMAL | VM_ALLOC_RETRY); + + /* + * The kern_sendfile() code calls vn_rdwr() with the page + * soft-busied. Ignore the soft-busy state here. Parallel + * reads of the page content from disk are prevented by + * VPO_BUSY. + * + * Although the tmpfs vnode lock is held here, it is + * nonetheless safe to sleep waiting for a free page. The + * pageout daemon does not need to acquire the tmpfs vnode + * lock to page out tobj's pages because tobj is a OBJT_SWAP + * type object. + */ + m = vm_page_grab(tobj, idx, VM_ALLOC_NORMAL | VM_ALLOC_RETRY | + VM_ALLOC_IGN_SBUSY); if (m->valid != VM_PAGE_BITS_ALL) { if (vm_pager_has_page(tobj, idx, NULL, NULL)) { rv = vm_pager_get_pages(tobj, &m, 1, 0); + m = vm_page_lookup(tobj, idx); + if (m == NULL) { + printf( + "tmpfs: vm_obj %p idx %jd null lookup rv %d\n", + tobj, idx, rv); + return (EIO); + } if (rv != VM_PAGER_OK) { + printf( + "tmpfs: vm_obj %p idx %jd valid %x pager error %d\n", + tobj, idx, m->valid, rv); vm_page_lock(m); vm_page_free(m); vm_page_unlock(m); @@ -463,127 +483,38 @@ tmpfs_nocacheread(vm_object_t tobj, vm_p } else vm_page_zero_invalid(m, TRUE); } + vm_page_lock(m); + vm_page_hold(m); + vm_page_wakeup(m); + vm_page_unlock(m); VM_OBJECT_WUNLOCK(tobj); error = uiomove_fromphys(&m, offset, tlen, uio); VM_OBJECT_WLOCK(tobj); vm_page_lock(m); - vm_page_unwire(m, TRUE); + vm_page_unhold(m); + vm_page_deactivate(m); + /* Requeue to maintain LRU ordering. */ + vm_page_requeue(m); vm_page_unlock(m); - vm_page_wakeup(m); VM_OBJECT_WUNLOCK(tobj); return (error); } -static __inline int -tmpfs_nocacheread_buf(vm_object_t tobj, vm_pindex_t idx, - vm_offset_t offset, size_t tlen, void *buf) -{ - struct uio uio; - struct iovec iov; - - uio.uio_iovcnt = 1; - uio.uio_iov = &iov; - iov.iov_base = buf; - iov.iov_len = tlen; - - uio.uio_offset = 0; - uio.uio_resid = tlen; - uio.uio_rw = UIO_READ; - uio.uio_segflg = UIO_SYSSPACE; - uio.uio_td = curthread; - - return (tmpfs_nocacheread(tobj, idx, offset, tlen, &uio)); -} - -static int -tmpfs_mappedread(vm_object_t vobj, vm_object_t tobj, size_t len, struct uio *uio) -{ - struct sf_buf *sf; - vm_pindex_t idx; - vm_page_t m; - vm_offset_t offset; - off_t addr; - size_t tlen; - char *ma; - int error; - - addr = uio->uio_offset; - idx = OFF_TO_IDX(addr); - offset = addr & PAGE_MASK; - tlen = MIN(PAGE_SIZE - offset, len); - - VM_OBJECT_WLOCK(vobj); -lookupvpg: - if (((m = vm_page_lookup(vobj, idx)) != NULL) && - vm_page_is_valid(m, offset, tlen)) { - if ((m->oflags & VPO_BUSY) != 0) { - /* - * Reference the page before unlocking and sleeping so - * that the page daemon is less likely to reclaim it. - */ - vm_page_reference(m); - vm_page_sleep(m, "tmfsmr"); - goto lookupvpg; - } - vm_page_busy(m); - VM_OBJECT_WUNLOCK(vobj); - error = uiomove_fromphys(&m, offset, tlen, uio); - VM_OBJECT_WLOCK(vobj); - vm_page_wakeup(m); - VM_OBJECT_WUNLOCK(vobj); - return (error); - } else if (m != NULL && uio->uio_segflg == UIO_NOCOPY) { - KASSERT(offset == 0, - ("unexpected offset in tmpfs_mappedread for sendfile")); - if ((m->oflags & VPO_BUSY) != 0) { - /* - * Reference the page before unlocking and sleeping so - * that the page daemon is less likely to reclaim it. - */ - vm_page_reference(m); - vm_page_sleep(m, "tmfsmr"); - goto lookupvpg; - } - vm_page_busy(m); - VM_OBJECT_WUNLOCK(vobj); - sched_pin(); - sf = sf_buf_alloc(m, SFB_CPUPRIVATE); - ma = (char *)sf_buf_kva(sf); - error = tmpfs_nocacheread_buf(tobj, idx, 0, tlen, ma); - if (error == 0) { - if (tlen != PAGE_SIZE) - bzero(ma + tlen, PAGE_SIZE - tlen); - uio->uio_offset += tlen; - uio->uio_resid -= tlen; - } - sf_buf_free(sf); - sched_unpin(); - VM_OBJECT_WLOCK(vobj); - if (error == 0) - m->valid = VM_PAGE_BITS_ALL; - vm_page_wakeup(m); - VM_OBJECT_WUNLOCK(vobj); - return (error); - } - VM_OBJECT_WUNLOCK(vobj); - error = tmpfs_nocacheread(tobj, idx, offset, tlen, uio); - - return (error); -} - static int tmpfs_read(struct vop_read_args *v) { struct vnode *vp = v->a_vp; struct uio *uio = v->a_uio; - struct tmpfs_node *node; vm_object_t uobj; size_t len; int resid; - int error = 0; + vm_pindex_t idx; + vm_offset_t offset; + off_t addr; + size_t tlen; node = VP_TO_TMPFS_NODE(vp); @@ -607,7 +538,11 @@ tmpfs_read(struct vop_read_args *v) len = MIN(node->tn_size - uio->uio_offset, resid); if (len == 0) break; - error = tmpfs_mappedread(vp->v_object, uobj, len, uio); + addr = uio->uio_offset; + idx = OFF_TO_IDX(addr); + offset = addr & PAGE_MASK; + tlen = MIN(PAGE_SIZE - offset, len); + error = tmpfs_nocacheread(uobj, idx, offset, tlen, uio); if ((error != 0) || (resid == uio->uio_resid)) break; } @@ -620,10 +555,10 @@ out: /* --------------------------------------------------------------------- */ static int -tmpfs_mappedwrite(vm_object_t vobj, vm_object_t tobj, size_t len, struct uio *uio) +tmpfs_mappedwrite(vm_object_t tobj, size_t len, struct uio *uio) { vm_pindex_t idx; - vm_page_t vpg, tpg; + vm_page_t tpg; vm_offset_t offset; off_t addr; size_t tlen; @@ -636,69 +571,47 @@ tmpfs_mappedwrite(vm_object_t vobj, vm_o offset = addr & PAGE_MASK; tlen = MIN(PAGE_SIZE - offset, len); - VM_OBJECT_WLOCK(vobj); -lookupvpg: - if (((vpg = vm_page_lookup(vobj, idx)) != NULL) && - vm_page_is_valid(vpg, offset, tlen)) { - if ((vpg->oflags & VPO_BUSY) != 0) { - /* - * Reference the page before unlocking and sleeping so - * that the page daemon is less likely to reclaim it. - */ - vm_page_reference(vpg); - vm_page_sleep(vpg, "tmfsmw"); - goto lookupvpg; - } - vm_page_busy(vpg); - vm_page_undirty(vpg); - VM_OBJECT_WUNLOCK(vobj); - error = uiomove_fromphys(&vpg, offset, tlen, uio); - } else { - if (vm_page_is_cached(vobj, idx)) - vm_page_cache_free(vobj, idx, idx + 1); - VM_OBJECT_WUNLOCK(vobj); - vpg = NULL; - } VM_OBJECT_WLOCK(tobj); - tpg = vm_page_grab(tobj, idx, VM_ALLOC_WIRED | - VM_ALLOC_NORMAL | VM_ALLOC_RETRY); + tpg = vm_page_grab(tobj, idx, VM_ALLOC_NORMAL | VM_ALLOC_RETRY); if (tpg->valid != VM_PAGE_BITS_ALL) { if (vm_pager_has_page(tobj, idx, NULL, NULL)) { rv = vm_pager_get_pages(tobj, &tpg, 1, 0); + tpg = vm_page_lookup(tobj, idx); + if (tpg == NULL) { + printf( + "tmpfs: vm_obj %p idx %jd null lookup rv %d\n", + tobj, idx, rv); + return (EIO); + } if (rv != VM_PAGER_OK) { + printf( + "tmpfs: vm_obj %p idx %jd valid %x pager error %d\n", + tobj, idx, tpg->valid, rv); vm_page_lock(tpg); vm_page_free(tpg); vm_page_unlock(tpg); - error = EIO; - goto out; + VM_OBJECT_WUNLOCK(tobj); + return (EIO); } } else vm_page_zero_invalid(tpg, TRUE); } + vm_page_lock(tpg); + vm_page_hold(tpg); + vm_page_wakeup(tpg); + vm_page_unlock(tpg); VM_OBJECT_WUNLOCK(tobj); - if (vpg == NULL) - error = uiomove_fromphys(&tpg, offset, tlen, uio); - else { - KASSERT(vpg->valid == VM_PAGE_BITS_ALL, ("parts of vpg invalid")); - pmap_copy_page(vpg, tpg); - } + error = uiomove_fromphys(&tpg, offset, tlen, uio); VM_OBJECT_WLOCK(tobj); - if (error == 0) { - KASSERT(tpg->valid == VM_PAGE_BITS_ALL, - ("parts of tpg invalid")); + if (error == 0) vm_page_dirty(tpg); - } vm_page_lock(tpg); - vm_page_unwire(tpg, TRUE); + vm_page_unhold(tpg); + vm_page_deactivate(tpg); + /* Requeue to maintain LRU ordering. */ + vm_page_requeue(tpg); vm_page_unlock(tpg); - vm_page_wakeup(tpg); -out: VM_OBJECT_WUNLOCK(tobj); - if (vpg != NULL) { - VM_OBJECT_WLOCK(vobj); - vm_page_wakeup(vpg); - VM_OBJECT_WUNLOCK(vobj); - } return (error); } @@ -756,7 +669,7 @@ tmpfs_write(struct vop_write_args *v) len = MIN(node->tn_size - uio->uio_offset, resid); if (len == 0) break; - error = tmpfs_mappedwrite(vp->v_object, uobj, len, uio); + error = tmpfs_mappedwrite(uobj, len, uio); if ((error != 0) || (resid == uio->uio_resid)) break; } @@ -1536,8 +1449,6 @@ tmpfs_inactive(struct vop_inactive_args struct tmpfs_node *node; - MPASS(VOP_ISLOCKED(vp)); - node = VP_TO_TMPFS_NODE(vp); if (node->tn_links == 0) @@ -1555,11 +1466,24 @@ tmpfs_reclaim(struct vop_reclaim_args *v struct tmpfs_mount *tmp; struct tmpfs_node *node; + vm_object_t obj; node = VP_TO_TMPFS_NODE(vp); tmp = VFS_TO_TMPFS(vp->v_mount); - vnode_destroy_vobject(vp); + if (node->tn_type == VREG) { + obj = node->tn_reg.tn_aobj; + if (obj != NULL) { + /* Instead of vnode_destroy_vobject() */ + VM_OBJECT_WLOCK(obj); + VI_LOCK(vp); + vm_object_clear_flag(obj, OBJ_TMPFS); + obj->un_pager.swp.swp_tmpfs = NULL; + VI_UNLOCK(vp); + VM_OBJECT_WUNLOCK(obj); + } + } + vp->v_object = NULL; cache_purge(vp); TMPFS_NODE_LOCK(node); Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Sun Apr 28 19:25:09 2013 (r250029) +++ head/sys/vm/vm_object.c Sun Apr 28 19:38:59 2013 (r250030) @@ -505,6 +505,7 @@ void vm_object_deallocate(vm_object_t object) { vm_object_t temp; + struct vnode *vp; while (object != NULL) { VM_OBJECT_WLOCK(object); @@ -527,15 +528,36 @@ vm_object_deallocate(vm_object_t object) VM_OBJECT_WUNLOCK(object); return; } else if (object->ref_count == 1) { + if (object->type == OBJT_SWAP && + (object->flags & OBJ_TMPFS) != 0) { + vp = object->un_pager.swp.swp_tmpfs; + vhold(vp); + VM_OBJECT_WUNLOCK(object); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + vdrop(vp); + VM_OBJECT_WLOCK(object); + if (object->type == OBJT_DEAD) { + VM_OBJECT_WUNLOCK(object); + VOP_UNLOCK(vp, 0); + return; + } else if ((object->flags & OBJ_TMPFS) != 0) { + if (object->ref_count == 1) + VOP_UNSET_TEXT(vp); + VOP_UNLOCK(vp, 0); + } + } if (object->shadow_count == 0 && object->handle == NULL && (object->type == OBJT_DEFAULT || - object->type == OBJT_SWAP)) { + (object->type == OBJT_SWAP && + (object->flags & OBJ_TMPFS) == 0))) { vm_object_set_flag(object, OBJ_ONEMAPPING); } else if ((object->shadow_count == 1) && (object->handle == NULL) && (object->type == OBJT_DEFAULT || object->type == OBJT_SWAP)) { + KASSERT((object->flags & OBJ_TMPFS) == 0, + ("Shadowed tmpfs v_object")); vm_object_t robject; robject = LIST_FIRST(&object->shadow_head); Modified: head/sys/vm/vm_object.h ============================================================================== --- head/sys/vm/vm_object.h Sun Apr 28 19:25:09 2013 (r250029) +++ head/sys/vm/vm_object.h Sun Apr 28 19:38:59 2013 (r250030) @@ -154,11 +154,21 @@ struct vm_object { /* * Swap pager * + * swp_tmpfs - back-pointer to the tmpfs vnode, + * if any, which uses the vm object + * as backing store. The handle + * cannot be reused for linking, + * because the vnode can be + * reclaimed and recreated, making + * the handle changed and hash-chain + * invalid. + * * swp_bcount - number of swap 'swblock' metablocks, each * contains up to 16 swapblk assignments. * see vm/swap_pager.h */ struct { + void *swp_tmpfs; int swp_bcount; } swp; } un_pager; @@ -179,6 +189,7 @@ struct vm_object { #define OBJ_COLORED 0x1000 /* pg_color is defined */ #define OBJ_ONEMAPPING 0x2000 /* One USE (a single, non-forked) mapping flag */ #define OBJ_DISCONNECTWNT 0x4000 /* disconnect from vnode wanted */ +#define OBJ_TMPFS 0x8000 #define IDX_TO_OFF(idx) (((vm_ooffset_t)(idx)) << PAGE_SHIFT) #define OFF_TO_IDX(off) ((vm_pindex_t)(((vm_ooffset_t)(off)) >> PAGE_SHIFT)) From owner-svn-src-head@FreeBSD.ORG Sun Apr 28 20:46:33 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 57E0D402; Sun, 28 Apr 2013 20:46:33 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4ADEA1446; Sun, 28 Apr 2013 20:46:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SKkXqC062933; Sun, 28 Apr 2013 20:46:33 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SKkXwP062932; Sun, 28 Apr 2013 20:46:33 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201304282046.r3SKkXwP062932@svn.freebsd.org> From: Sean Bruno Date: Sun, 28 Apr 2013 20:46:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250031 - head/sys/dev/ciss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 20:46:33 -0000 Author: sbruno Date: Sun Apr 28 20:46:32 2013 New Revision: 250031 URL: http://svnweb.freebsd.org/changeset/base/250031 Log: The controller does not zero this data structure, ever. Zero it out here so we do not misinterpret the data error. Obtained from: Yahoo! Inc. MFC after: 2 weeks Modified: head/sys/dev/ciss/ciss.c Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Sun Apr 28 19:38:59 2013 (r250030) +++ head/sys/dev/ciss/ciss.c Sun Apr 28 20:46:32 2013 (r250031) @@ -2487,6 +2487,7 @@ ciss_preen_command(struct ciss_request * cc->header.sg_total = 0; cc->header.host_tag = cr->cr_tag << 2; cc->header.host_tag_zeroes = 0; + bzero(&(cc->sg[0]), CISS_COMMAND_ALLOC_SIZE - sizeof(struct ciss_command)); cmdphys = cr->cr_ccphys; cc->error_info.error_info_address = cmdphys + sizeof(struct ciss_command); cc->error_info.error_info_length = CISS_COMMAND_ALLOC_SIZE - sizeof(struct ciss_command); From owner-svn-src-head@FreeBSD.ORG Sun Apr 28 20:55:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 63D7D924; Sun, 28 Apr 2013 20:55:46 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 55B1114A0; Sun, 28 Apr 2013 20:55:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SKtkUO066285; Sun, 28 Apr 2013 20:55:46 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SKtkXk066284; Sun, 28 Apr 2013 20:55:46 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201304282055.r3SKtkXk066284@svn.freebsd.org> From: Sean Bruno Date: Sun, 28 Apr 2013 20:55:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250032 - head/sys/dev/hptrr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 20:55:46 -0000 Author: sbruno Date: Sun Apr 28 20:55:45 2013 New Revision: 250032 URL: http://svnweb.freebsd.org/changeset/base/250032 Log: Silence warning from clang: /home/sbruno/bsd/head/sys/dev/hptrr/hptrr_osm_bsd.c:178:66: warning: for loop has empty body [-Wempty-body] for (order=0, size=PAGE_SIZE; sizesize; order++, size<<=1) ; ^ /home/sbruno/bsd/head/sys/dev/hptrr/hptrr_osm_bsd.c:178:66: note: put the semicolon on a separate line to silence this warning Obtained from: Yahoo! Inc. MFC after: 2 weeks Modified: head/sys/dev/hptrr/hptrr_osm_bsd.c Modified: head/sys/dev/hptrr/hptrr_osm_bsd.c ============================================================================== --- head/sys/dev/hptrr/hptrr_osm_bsd.c Sun Apr 28 20:46:32 2013 (r250031) +++ head/sys/dev/hptrr/hptrr_osm_bsd.c Sun Apr 28 20:55:45 2013 (r250032) @@ -175,7 +175,8 @@ static int hpt_alloc_mem(PVBUS_EXT vbus_ HPT_ASSERT((f->size & (f->alignment-1))==0); - for (order=0, size=PAGE_SIZE; sizesize; order++, size<<=1) ; + for (order=0, size=PAGE_SIZE; sizesize; order++, size<<=1) + ; KdPrint(("%s: %d*%d=%d bytes, order %d", f->tag, f->count, f->size, f->count*f->size, order)); From owner-svn-src-head@FreeBSD.ORG Sun Apr 28 21:14:23 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C966319C; Sun, 28 Apr 2013 21:14:23 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BAE39155E; Sun, 28 Apr 2013 21:14:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SLENgI074017; Sun, 28 Apr 2013 21:14:23 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SLEN1G074015; Sun, 28 Apr 2013 21:14:23 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201304282114.r3SLEN1G074015@svn.freebsd.org> From: Steven Hartland Date: Sun, 28 Apr 2013 21:14:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250033 - in head/sys/cam: ata scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 21:14:23 -0000 Author: smh Date: Sun Apr 28 21:14:23 2013 New Revision: 250033 URL: http://svnweb.freebsd.org/changeset/base/250033 Log: Correct comment typo's Add missing comment Reviewed by: pjd (mentor) Approved by: pjd (mentor) MFC after: 2 weeks Modified: head/sys/cam/ata/ata_da.c head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Sun Apr 28 20:55:45 2013 (r250032) +++ head/sys/cam/ata/ata_da.c Sun Apr 28 21:14:23 2013 (r250033) @@ -1147,7 +1147,7 @@ adaregister(struct cam_periph *periph, v snprintf(announce_buf, sizeof(announce_buf), "kern.cam.ada.%d.write_cache", periph->unit_number); TUNABLE_INT_FETCH(announce_buf, &softc->write_cache); - /* Disable queue sorting for non-rotatational media by default */ + /* Disable queue sorting for non-rotational media by default. */ if (cgd->ident_data.media_rotation_rate == 1) softc->sort_io_queue = 0; else Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Sun Apr 28 20:55:45 2013 (r250032) +++ head/sys/cam/scsi/scsi_da.c Sun Apr 28 21:14:23 2013 (r250033) @@ -3058,6 +3058,10 @@ dadone(struct cam_periph *periph, union bdc = (struct scsi_vpd_block_characteristics *)csio->data_ptr; if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { + /* + * Disable queue sorting for non-rotational media + * by default. + */ if (scsi_2btoul(bdc->medium_rotation_rate) == SVPD_BDC_RATE_NONE_ROTATING) softc->sort_io_queue = 0; @@ -3106,8 +3110,8 @@ dadone(struct cam_periph *periph, union ATA_DSM_BLK_RANGES); } /* - * Disable queue sorting for non-rotatational media - * by default + * Disable queue sorting for non-rotational media + * by default. */ if (ata_params->media_rotation_rate == 1) softc->sort_io_queue = 0; From owner-svn-src-head@FreeBSD.ORG Sun Apr 28 21:44:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 518F8BF2; Sun, 28 Apr 2013 21:44:45 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 42F3D163C; Sun, 28 Apr 2013 21:44:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SLijfj084465; Sun, 28 Apr 2013 21:44:45 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SLijb6084464; Sun, 28 Apr 2013 21:44:45 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <201304282144.r3SLijb6084464@svn.freebsd.org> From: Nick Hibma Date: Sun, 28 Apr 2013 21:44:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250034 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 21:44:45 -0000 Author: n_hibma Date: Sun Apr 28 21:44:44 2013 New Revision: 250034 URL: http://svnweb.freebsd.org/changeset/base/250034 Log: Doing a cpio from /var/empty if dir was not specified or non-existent copies its mode to the destination. This is not desirable. Rephrase this code to be more sensible. PR: 173483 MFC after: 1 week Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Sun Apr 28 21:14:23 2013 (r250033) +++ head/tools/tools/nanobsd/nanobsd.sh Sun Apr 28 21:44:44 2013 (r250034) @@ -413,12 +413,13 @@ populate_slice ( ) ( dir=$2 mnt=$3 lbl=$4 - test -z $2 && dir=${NANO_WORLDDIR}/var/empty - test -d $dir || dir=${NANO_WORLDDIR}/var/empty - echo "Creating ${dev} with ${dir} (mounting on ${mnt})" - newfs_part $dev $mnt $lbl - cd ${dir} - find . -print | grep -Ev '/(CVS|\.svn)' | cpio -dumpv ${mnt} + echo "Creating ${dev} (mounting on ${mnt})" + newfs_part ${dev} ${mnt} ${lbl} + if [ -n "${dir}" -a -d "${dir}" ]; then + echo "Populating ${lbl} from ${dir}" + cd ${dir} + find . -print | grep -Ev '/(CVS|\.svn)' | cpio -dumpv ${mnt} + fi df -i ${mnt} umount ${mnt} ) From owner-svn-src-head@FreeBSD.ORG Sun Apr 28 22:05:01 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B7C75106; Sun, 28 Apr 2013 22:05:01 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AAC6916BF; Sun, 28 Apr 2013 22:05:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SM51dt091553; Sun, 28 Apr 2013 22:05:01 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SM51GT091551; Sun, 28 Apr 2013 22:05:01 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304282205.r3SM51GT091551@svn.freebsd.org> From: Eitan Adler Date: Sun, 28 Apr 2013 22:05:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250035 - head/bin/kill X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 22:05:01 -0000 Author: eadler Date: Sun Apr 28 22:05:01 2013 New Revision: 250035 URL: http://svnweb.freebsd.org/changeset/base/250035 Log: Remove cast that was only required for K&R C. Reviewed by: jilles Modified: head/bin/kill/kill.c Modified: head/bin/kill/kill.c ============================================================================== --- head/bin/kill/kill.c Sun Apr 28 21:44:44 2013 (r250034) +++ head/bin/kill/kill.c Sun Apr 28 22:05:01 2013 (r250035) @@ -156,7 +156,7 @@ signame_to_signum(const char *sig) { int n; - if (!strncasecmp(sig, "SIG", (size_t)3)) + if (strncasecmp(sig, "SIG", 3) == 0) sig += 3; for (n = 1; n < sys_nsig; n++) { if (!strcasecmp(sys_signame[n], sig)) From owner-svn-src-head@FreeBSD.ORG Sun Apr 28 22:12:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6E3A06A3; Sun, 28 Apr 2013 22:12:41 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 46C5E16F2; Sun, 28 Apr 2013 22:12:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SMCfbl095280; Sun, 28 Apr 2013 22:12:41 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SMCfrS095279; Sun, 28 Apr 2013 22:12:41 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <201304282212.r3SMCfrS095279@svn.freebsd.org> From: Nick Hibma Date: Sun, 28 Apr 2013 22:12:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250036 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 22:12:41 -0000 Author: n_hibma Date: Sun Apr 28 22:12:40 2013 New Revision: 250036 URL: http://svnweb.freebsd.org/changeset/base/250036 Log: Replace a silly command sequence with a proper if-then-else. Generate images sparsely. This saves space and time, especially when generating images inside a VM (PR 173482). Add a 'true' statement to last_orders to prevent some version of sh from tripping over an empty function. Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Sun Apr 28 22:05:01 2013 (r250035) +++ head/tools/tools/nanobsd/nanobsd.sh Sun Apr 28 22:12:40 2013 (r250036) @@ -359,8 +359,7 @@ setup_nanobsd ( ) ( echo "mount -o ro /dev/${NANO_DRIVE}s3" > conf/default/etc/remount # Put /tmp on the /var ramdisk (could be symlink already) - rmdir tmp || true - rm tmp || true + test -d tmp && rmdir tmp || rm -f tmp ln -s var/tmp tmp ) > ${NANO_OBJ}/_.dl 2>&1 @@ -541,7 +540,7 @@ create_i386_diskimage ( ) ( if [ $NANO_IMAGES -gt 1 -a $NANO_INIT_IMG2 -gt 0 ] ; then # Duplicate to second image (if present) echo "Duplicating to second image..." - dd if=/dev/${MD}s1 of=/dev/${MD}s2 bs=64k + dd conv=sparse if=/dev/${MD}s1 of=/dev/${MD}s2 bs=64k mount /dev/${MD}s2a ${MNT} for f in ${MNT}/etc/fstab ${MNT}/conf/base/etc/fstab do @@ -565,12 +564,12 @@ create_i386_diskimage ( ) ( if [ "${NANO_MD_BACKING}" = "swap" ] ; then echo "Writing out ${NANO_IMGNAME}..." - dd if=/dev/${MD} of=${IMG} bs=64k + dd conv=sparse if=/dev/${MD} of=${IMG} bs=64k fi if ${do_copyout_partition} ; then echo "Writing out _.disk.image..." - dd if=/dev/${MD}s1 of=${NANO_DISKIMGDIR}/_.disk.image bs=64k + dd conv=sparse if=/dev/${MD}s1 of=${NANO_DISKIMGDIR}/_.disk.image bs=64k fi mdconfig -d -u $MD @@ -589,6 +588,7 @@ last_orders () ( # after the build completed, for instance to copy the finished # image to a more convenient place: # cp ${NANO_DISKIMGDIR}/_.disk.image /home/ftp/pub/nanobsd.disk + true ) ####################################################################### From owner-svn-src-head@FreeBSD.ORG Sun Apr 28 22:52:44 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 645B294B; Sun, 28 Apr 2013 22:52:44 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3B6F2186B; Sun, 28 Apr 2013 22:52:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3SMqikU009206; Sun, 28 Apr 2013 22:52:44 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3SMqiHH009205; Sun, 28 Apr 2013 22:52:44 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304282252.r3SMqiHH009205@svn.freebsd.org> From: Eitan Adler Date: Sun, 28 Apr 2013 22:52:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250037 - head/bin/hostname X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 22:52:44 -0000 Author: eadler Date: Sun Apr 28 22:52:43 2013 New Revision: 250037 URL: http://svnweb.freebsd.org/changeset/base/250037 Log: Mark usage() __dead2 Modified: head/bin/hostname/hostname.c Modified: head/bin/hostname/hostname.c ============================================================================== --- head/bin/hostname/hostname.c Sun Apr 28 22:12:40 2013 (r250036) +++ head/bin/hostname/hostname.c Sun Apr 28 22:52:43 2013 (r250037) @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include -static void usage(void); +static void usage(void) __dead2; int main(int argc, char *argv[]) From owner-svn-src-head@FreeBSD.ORG Sun Apr 28 23:43:21 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 79BD9DE9; Sun, 28 Apr 2013 23:43:21 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pb0-x229.google.com (mail-pb0-x229.google.com [IPv6:2607:f8b0:400e:c01::229]) by mx1.freebsd.org (Postfix) with ESMTP id 45D881BC6; Sun, 28 Apr 2013 23:43:21 +0000 (UTC) Received: by mail-pb0-f41.google.com with SMTP id md4so104272pbc.28 for ; Sun, 28 Apr 2013 16:43:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:x-mailer:from:subject:date :to; bh=RYPPlk7NZ1snAEfN89jvlHnrE6Wa7tN+8flTc7Afr5o=; b=ZjmCE1+gJdJv9YhxjV/9K59zl9WlkgfrWD873SrtRTM8rnImlW4R0MgK8EeIuC9Bz8 h17LcXcCXi0uxgGurmOMtrSj+u5WxtVnSr2qAht7E1l/dv/VKeQBhHmBVgycfDNpCvwA gD3oK1oky3SX9WcDYc3Qj7S+9axRuLk7wwL47D2eE5MyOupa05LlTICUND13ov7iby0d I9FG3pkQpJ8uCealtsY+phlcCXFcFODtdv8F+/Q9B35Fowd3KgT5VO4rTbMvVftTz6vi 9vPuZOPpqWVrTL3UCliZ5pAf6jNY/zb5fnW+jFjFV7grVkK9ThzfHhU1oshPpZyApLVx M43w== X-Received: by 10.66.148.132 with SMTP id ts4mr41010724pab.19.1367192601104; Sun, 28 Apr 2013 16:43:21 -0700 (PDT) Received: from [10.164.125.87] (mobile-166-147-082-058.mycingular.net. [166.147.82.58]) by mx.google.com with ESMTPSA id tx9sm21427411pbc.27.2013.04.28.16.43.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 28 Apr 2013 16:43:20 -0700 (PDT) References: <201304282144.r3SLijb6084464@svn.freebsd.org> Mime-Version: 1.0 (1.0) In-Reply-To: <201304282144.r3SLijb6084464@svn.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: <87DD1BC2-9658-4405-ABC5-BE05C3E6C6B4@gmail.com> X-Mailer: iPhone Mail (10B329) From: Garrett Cooper Subject: Re: svn commit: r250034 - head/tools/tools/nanobsd Date: Sun, 28 Apr 2013 16:43:11 -0700 To: Nick Hibma Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2013 23:43:21 -0000 On Apr 28, 2013, at 2:44 PM, Nick Hibma wrote: > Author: n_hibma > Date: Sun Apr 28 21:44:44 2013 > New Revision: 250034 > URL: http://svnweb.freebsd.org/changeset/base/250034 >=20 > Log: > Doing a cpio from /var/empty if dir was not specified or non-existent > copies its mode to the destination. This is not desirable. > Rephrase this code to be more sensible. >=20 > PR: 173483 > MFC after: 1 week >=20 > Modified: > head/tools/tools/nanobsd/nanobsd.sh >=20 > Modified: head/tools/tools/nanobsd/nanobsd.sh > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/tools/tools/nanobsd/nanobsd.sh Sun Apr 28 21:14:23 2013 (r2= 50033) > +++ head/tools/tools/nanobsd/nanobsd.sh Sun Apr 28 21:44:44 2013 (r2= 50034) > @@ -413,12 +413,13 @@ populate_slice ( ) ( > dir=3D$2 > mnt=3D$3 > lbl=3D$4 > - test -z $2 && dir=3D${NANO_WORLDDIR}/var/empty > - test -d $dir || dir=3D${NANO_WORLDDIR}/var/empty > - echo "Creating ${dev} with ${dir} (mounting on ${mnt})" > - newfs_part $dev $mnt $lbl > - cd ${dir} > - find . -print | grep -Ev '/(CVS|\.svn)' | cpio -dumpv ${mnt} > + echo "Creating ${dev} (mounting on ${mnt})" > + newfs_part ${dev} ${mnt} ${lbl} > + if [ -n "${dir}" -a -d "${dir}" ]; then > + echo "Populating ${lbl} from ${dir}" > + cd ${dir} > + find . -print | grep -Ev '/(CVS|\.svn)' | cpio -dumpv ${mnt} > + fi > df -i ${mnt} > umount ${mnt} > ) Awesome! Would you be interested in ushering in some of the nanobsd PRs in t= he queue, perhaps? Thanks! -Garrett= From owner-svn-src-head@FreeBSD.ORG Mon Apr 29 00:06:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 493103DB; Mon, 29 Apr 2013 00:06:25 +0000 (UTC) (envelope-from hiren.panchasara@gmail.com) Received: from mail-ee0-f41.google.com (mail-ee0-f41.google.com [74.125.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id A5DB71C8E; Mon, 29 Apr 2013 00:06:23 +0000 (UTC) Received: by mail-ee0-f41.google.com with SMTP id c50so2120396eek.28 for ; Sun, 28 Apr 2013 17:06:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=R4LPU2EGJLxVVJMrMZqDsHwM1nuLt0omHiOPp2aaI5M=; b=XR8hxq28ibRObv4asIO7DFSjU9xqT07O1yWzoRYccF0k3C/rO1aQpsfdMIKePH4pK8 7/mv0iVdjepy5GkC8okmyLY2C0tP2EtS0b5K8qPUdRVLMaXFUIVCat9PE6Zm0/Acbx4z GqjCRyb9us/htRvEBHYGJliYcFdwXjgWw3Ei1Qd68A65LSEwwgyEtCLBR2DtXlmCD3hh LXtdz+pCzBoPDEWFmLbSPNYJ9xP6n5wtUYf6hJMRmbM4Q79UN700S4KK6SScHetwDCkl zvwULUfeMn78bose2+Hg0ll/i5HnQb704zg1dZuJuFNP/6AVRdPxHuS0mRiom7xeehBg 6O9w== MIME-Version: 1.0 X-Received: by 10.14.219.8 with SMTP id l8mr16887076eep.40.1367193976535; Sun, 28 Apr 2013 17:06:16 -0700 (PDT) Sender: hiren.panchasara@gmail.com Received: by 10.14.204.200 with HTTP; Sun, 28 Apr 2013 17:06:16 -0700 (PDT) In-Reply-To: References: <201304231302.r3ND2w5V024981@svn.freebsd.org> Date: Sun, 28 Apr 2013 17:06:16 -0700 X-Google-Sender-Auth: kTjpxDkdAATQZH29CKVT3z5SSqQ Message-ID: Subject: Re: svn commit: r249800 - head/sys/dev/bwn From: hiren panchasara To: John Baldwin Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head , Adrian Chadd , src-committers , Eitan Adler , svn-src-all X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 00:06:25 -0000 On Tue, Apr 23, 2013 at 9:46 AM, hiren panchasara wrote: > On Tue, Apr 23, 2013 at 9:34 AM, Eitan Adler wrote: >> On 23 April 2013 12:19, Adrian Chadd wrote: >>> ... you know, even though it doesn't have an active maintainer, do you >>> have test hardware, and why didn't you just bounce a patch to >>> -wireless for review? > > My bad. I proposed this change initially. >>> >>> We don't bite you know! >> >> that you need to emphasize this does not comfort me. ;) >> >> reverted in 249812. > > Will look at john's suggestions and fix it correctly. John, Does this look okay? % svn diff Index: if_bwn.c =================================================================== --- if_bwn.c (revision 250036) +++ if_bwn.c (working copy) @@ -9240,9 +9240,9 @@ BUS_DMASYNC_PREWRITE); /* - * Setup RX buf descriptor + * Restore RX buf descriptor */ - dr->setdesc(dr, desc, paddr, meta->mt_m->m_len - + dr->setdesc(dr, desc, meta->mt_paddr, meta->mt_m->m_len - sizeof(*hdr), 0, 0, 0); return (error); } Thanks, Hiren > > Hiren >> >> -- >> Eitan Adler >> Source, Ports, Doc committer >> Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Mon Apr 29 06:11:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A49FA4D4; Mon, 29 Apr 2013 06:11:19 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 979481814; Mon, 29 Apr 2013 06:11:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3T6BJkY063678; Mon, 29 Apr 2013 06:11:19 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3T6BJw0063677; Mon, 29 Apr 2013 06:11:19 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201304290611.r3T6BJw0063677@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 29 Apr 2013 06:11:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250039 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 06:11:19 -0000 Author: glebius Date: Mon Apr 29 06:11:19 2013 New Revision: 250039 URL: http://svnweb.freebsd.org/changeset/base/250039 Log: Remove useless ifdef KLD_MODULE from dummynet module unload path. This fixes panic on unload. Reported by: pho Modified: head/sys/netpfil/ipfw/ip_dummynet.c Modified: head/sys/netpfil/ipfw/ip_dummynet.c ============================================================================== --- head/sys/netpfil/ipfw/ip_dummynet.c Mon Apr 29 04:38:43 2013 (r250038) +++ head/sys/netpfil/ipfw/ip_dummynet.c Mon Apr 29 06:11:19 2013 (r250039) @@ -2170,7 +2170,6 @@ ip_dn_init(void) getmicrouptime(&dn_cfg.prev_t); } -#ifdef KLD_MODULE static void ip_dn_destroy(int last) { @@ -2194,7 +2193,6 @@ ip_dn_destroy(int last) DN_LOCK_DESTROY(); } -#endif /* KLD_MODULE */ static int dummynet_modevent(module_t mod, int type, void *data) @@ -2210,13 +2208,8 @@ dummynet_modevent(module_t mod, int type ip_dn_io_ptr = dummynet_io; return 0; } else if (type == MOD_UNLOAD) { -#if !defined(KLD_MODULE) - printf("dummynet statically compiled, cannot unload\n"); - return EINVAL ; -#else ip_dn_destroy(1 /* last */); return 0; -#endif } else return EOPNOTSUPP; } From owner-svn-src-head@FreeBSD.ORG Mon Apr 29 07:28:30 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 484BC18D; Mon, 29 Apr 2013 07:28:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3B2041B79; Mon, 29 Apr 2013 07:28:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3T7SUES089165; Mon, 29 Apr 2013 07:28:30 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3T7SU0V089164; Mon, 29 Apr 2013 07:28:30 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304290728.r3T7SU0V089164@svn.freebsd.org> From: Adrian Chadd Date: Mon, 29 Apr 2013 07:28:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250041 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 07:28:30 -0000 Author: adrian Date: Mon Apr 29 07:28:29 2013 New Revision: 250041 URL: http://svnweb.freebsd.org/changeset/base/250041 Log: Debugging changes! * That lock isn't actually held during reset - just the whole TX/RX path is paused. So, remove the assertion. * Log the TX queue status - how many hardware frames are active in the MAC and whether the queue is active. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Mon Apr 29 06:54:01 2013 (r250040) +++ head/sys/dev/ath/if_ath.c Mon Apr 29 07:28:29 2013 (r250041) @@ -4466,10 +4466,12 @@ ath_tx_stopdma(struct ath_softc *sc, str struct ath_hal *ah = sc->sc_ah; DPRINTF(sc, ATH_DEBUG_RESET, - "%s: tx queue [%u] %p, flags 0x%08x, link %p\n", + "%s: tx queue [%u] %p, active=%d, hwpending=%d, flags 0x%08x, link %p\n", __func__, txq->axq_qnum, (caddr_t)(uintptr_t) ath_hal_gettxbuf(ah, txq->axq_qnum), + (int) (!! ath_hal_txqenabled(ah, txq->axq_qnum)), + (int) ath_hal_numtxpending(ah, txq->axq_qnum), txq->axq_flags, txq->axq_link); (void) ath_hal_stoptxdma(ah, txq->axq_qnum); @@ -4511,8 +4513,6 @@ ath_tx_dump(struct ath_softc *sc, struct if (! (sc->sc_debug & ATH_DEBUG_RESET)) return; - ATH_TX_LOCK_ASSERT(sc); - device_printf(sc->sc_dev, "%s: Q%d: begin\n", __func__, txq->axq_qnum); TAILQ_FOREACH(bf, &txq->axq_q, bf_list) { From owner-svn-src-head@FreeBSD.ORG Mon Apr 29 13:10:43 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C911DF8C; Mon, 29 Apr 2013 13:10:43 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 5C5201397; Mon, 29 Apr 2013 13:10:43 +0000 (UTC) Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id A2FC2121426; Mon, 29 Apr 2013 22:43:32 +1000 (EST) Date: Mon, 29 Apr 2013 22:43:28 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Eitan Adler Subject: Re: svn commit: r250037 - head/bin/hostname In-Reply-To: <201304282252.r3SMqiHH009205@svn.freebsd.org> Message-ID: <20130429212227.R1043@besplex.bde.org> References: <201304282252.r3SMqiHH009205@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=Tre+H0rh c=1 sm=1 a=HGXDrXWPGKwA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=S8Dq8nDLOMQA:10 a=L-e4rMQgvTWKUpiW9zgA:9 a=CjuIK1q_8ugA:10 a=TEtd8y5WR3g2ypngnwZWYw==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 13:10:43 -0000 On Sun, 28 Apr 2013, Eitan Adler wrote: > Log: > Mark usage() __dead2 This just adds a style bug. > Modified: head/bin/hostname/hostname.c > ============================================================================== > --- head/bin/hostname/hostname.c Sun Apr 28 22:12:40 2013 (r250036) > +++ head/bin/hostname/hostname.c Sun Apr 28 22:52:43 2013 (r250037) > @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > > -static void usage(void); > +static void usage(void) __dead2; Static functions should never be marked __dead2. The purpose of the markup is to inform the compiler that the function doesn't return. But for static functions, the compiler can see this for itself, at least with -funit-at-a-time in CFLAGS. (-funit-at-a-time is not required (doesn't exist) in C standards, but is now the default. Compilers even use it to look to closely at static functions and automatically inline them even when they are declared after they are used, as is common for usage(), provided they are only used once and -fno-inline-functions-called-once is not used. This mainly breaks debugging and profiling of non-inline functions. The breakage is largest for clang, collaterally with the bug that clang doesn't support either of these flags, so it seems to have no way to turn off this excessive inlining.) The style bug is missing in the example of using usage() in style(9). This style bug is missing in about 259 out of 284 declarations of static void usage(void) in /usr/src/*bin (.c files). Except: - bin/pkill/pkill.c has it in a worse form, with __dead2 hard-coded using __attribute(()) - usr.bin/rlogin/rlogin.c has it in a gratuitously different form, as 'static _Noreturn void usage(void);'. This is bogus since _Noreturn is a wrapper for a new C++ feature, but rlogin is an old C application; for C, it is defined as __dead2, but it isn't clear that it does the same as a normal use of __dead2 since it is used in a syntactically different way. __dead2 only exist because this syntax, which was used for the old __dead (== volatile return type instead of __attribute((__noreturn__))) didn't work. Apparently the syntax of __attribute__() has become less strict, so the more natural (old) syntax works again, and the use of the old syntax here is just a style bug and not a syntax error. I counted these style bugs by grepping for "static.*usage" (318 lines) and then filtering out most that didn't match the normal usage of usage(). There are too many gratuitous differences like taking a 'char *' arg or returning an int. Another popular style bug is a gnu-style declaration with a space after the function name. One declaration is even missing the arg type, so it isn't a prototype. Not all instances of the __dead[2] style bug are new. In 4.4BSD-Lite2, there were 17 instances of __dead in /usr/src/*bin. Only 4 of these were on static functions. Only 2 of them were on usage(), and usage() wasn't declared static in these 2. These 2 were rlogin and mount_nfs. The bug in rlogin persists in a worse form, and the bug in mount_nfs was cloned to many other mount utilities. In FreeBSD-~5.2, there were 43 instances of __dead2 in /usr/src/*bin. 30 of these were on static functions. 22 of these were on usage(). Almost half of these 22 were in mount utilities. Further statistics for -current in /usr/src/*bin: - 60 instances of __dead2 - 57 of these on static functions - at least 26 of these on static.*usage.* - some false/misleading hits for the sloppy patterns: - 1 nonsense declaration in echo/echo.c. __dead2 is placed on the function definition of errexit(), where it ican have no effect except possibly to cause a warning when the function does return. The function actually ends with exit(), so the compiler can see that it doesn't return. There is no forward prototype for this function, but it is placed before it is used, so the compiler can see that it doesn't return even without -funit-at-a-time. - same nonsense declaration in sh/arith_yacc.c:yyerror(). It returns with error() instad of exit(), so its non-returningness is given by __dead2 on error(). - same nonsense declaration in killall/killall.c:usage(). usage() is unsorted at the beginning of the file, so it doesn't need the usual forward prototype, but it has the __dead2 declaration which is not even needed for the prototype. - i2c/i2c.c:usage(). Like killall, except the unsorting is not so close to the beginning of the file. - gbde/gbde.c:usage(). Like i2c. - hastd/primary.c. Like sh (3 functions). - hastctl/hastctl.c. Like i2c. These false hits were only harder to understand because the function definitions are formatted normally, so the function name isn't on the same line as __dead2 so grepping with simple patterns doesn't show what it is. The syntax for all the nonsense declarations is 'static __dead2 \n'. This would have been a syntax error for the original implementation of __dead2. __dead2 is named as it is (with '2' meaning gcc version2 instead of 1) because simply changing the definition of __dead wouldn't have worked due to syntactical problems. The above statistics are all for .c files. __dead2 is used a further 28 times in .h files in /usr/src/*bin in -current. Now all the uses are hopefully useful. But there aren't enough of them to make much difference. System headers are hopefully more careful about this. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Apr 29 14:50:07 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B4188135; Mon, 29 Apr 2013 14:50:07 +0000 (UTC) (envelope-from edschouten@gmail.com) Received: from mail-ve0-x22a.google.com (mail-ve0-x22a.google.com [IPv6:2607:f8b0:400c:c01::22a]) by mx1.freebsd.org (Postfix) with ESMTP id 4278A1910; Mon, 29 Apr 2013 14:50:07 +0000 (UTC) Received: by mail-ve0-f170.google.com with SMTP id 15so3117206vea.15 for ; Mon, 29 Apr 2013 07:50:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=OfPyEZK7mm6QI9BBIy4/Y2X3LpPG8C6C9yOP1sLlrEM=; b=V0b6ZB3Ec+qXShPFsOkd2AE2NjqMSuMwwPgx0m41/BExKobS+qNoLaD3h6klqqOGEj Qq2Cslz9+BFN5Dj0HszPpHK+MJpuNosbNxQRYHVtoL4KccIB47uqI2hGr2a9prJWg8v9 bPZNzSPnjZnzNKi/6eVyCitu/l1aDGk9TL11DslTxomgvOE0J13t+cyBrs/nZUGtTqKk kud1HscJ0FK5OMQutFVNXsz6vxZyCTooU0BJhzt7QwC32ncYXYUxBHeuZgNKVZiZpblF ZA+C79NRb6IWhcenAB80cC4iSAy3ZkOSYWlFCoIVbqe0kWndUDIVs4M0nuiNnhP4YEdQ QRaA== MIME-Version: 1.0 X-Received: by 10.52.25.40 with SMTP id z8mr2505636vdf.7.1367247006856; Mon, 29 Apr 2013 07:50:06 -0700 (PDT) Sender: edschouten@gmail.com Received: by 10.221.10.69 with HTTP; Mon, 29 Apr 2013 07:50:06 -0700 (PDT) In-Reply-To: <20130429212227.R1043@besplex.bde.org> References: <201304282252.r3SMqiHH009205@svn.freebsd.org> <20130429212227.R1043@besplex.bde.org> Date: Mon, 29 Apr 2013 16:50:06 +0200 X-Google-Sender-Auth: 3OF8JXFfBI8914SpnbFljOfw52E Message-ID: Subject: Re: svn commit: r250037 - head/bin/hostname From: Ed Schouten To: Bruce Evans Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Eitan Adler X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 14:50:07 -0000 Hi Bruce, 2013/4/29 Bruce Evans : > - usr.bin/rlogin/rlogin.c has it in a gratuitously different form, as > 'static _Noreturn void usage(void);'. This is bogus since > _Noreturn is a wrapper for a new C++ feature I hate to correct you here, but _Noreturn is not a wrapper for a new C++ feature, it's a keyword that's part of C11. See: http://en.wikipedia.org/wiki/C11_(C_standard_revision)#Changes_from_C99 All C11 keywords can be implemented on top of GCC-specific constructs, with the exception of _Generic. I would strongly prefer it if we used these keywords over our FreeBSD-specific solutions. If the only objection is the spelling of these keywords (underscores, uppercase, etc), be sure to: #include /* For alignas/alignof. */ #include /* For noreturn. */ #include /* For thread_local. */ -- Ed Schouten From owner-svn-src-head@FreeBSD.ORG Mon Apr 29 15:58:04 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EC24C5C9; Mon, 29 Apr 2013 15:58:04 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DEF0B1DAD; Mon, 29 Apr 2013 15:58:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TFw4nT072926; Mon, 29 Apr 2013 15:58:04 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TFw4ge072925; Mon, 29 Apr 2013 15:58:04 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304291558.r3TFw4ge072925@svn.freebsd.org> From: Eitan Adler Date: Mon, 29 Apr 2013 15:58:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250048 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 15:58:05 -0000 Author: eadler Date: Mon Apr 29 15:58:04 2013 New Revision: 250048 URL: http://svnweb.freebsd.org/changeset/base/250048 Log: A transition period of more than two years is more than enough: Remove the compatibility code added in 2011-02-10. This change is not intended for MFC Reviewed by: imp Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Apr 29 11:36:59 2013 (r250047) +++ head/Makefile.inc1 Mon Apr 29 15:58:04 2013 (r250048) @@ -41,13 +41,6 @@ # /usr/share/mk. These include: # obj depend all install clean cleandepend cleanobj -# You are supposed to define both of these when calling Makefile.inc1 -# directly. However, some old scripts don't. Cope for the moment, but -# issue a new warning for a transition period. -.if defined(TARGET) && !defined(TARGET_ARCH) -.warning "You must pass both TARGET and TARGET_ARCH to Makefile.inc1. Setting TARGET_ARCH=${TARGET}." -TARGET_ARCH=${TARGET} -.endif .if !defined(TARGET) || !defined(TARGET_ARCH) .error "Both TARGET and TARGET_ARCH must be defined." .endif From owner-svn-src-head@FreeBSD.ORG Mon Apr 29 16:13:40 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 107E9B44; Mon, 29 Apr 2013 16:13:40 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id DE2D01E45; Mon, 29 Apr 2013 16:13:39 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id D0312B917; Mon, 29 Apr 2013 12:13:32 -0400 (EDT) From: John Baldwin To: hiren panchasara Subject: Re: svn commit: r249800 - head/sys/dev/bwn Date: Mon, 29 Apr 2013 11:23:41 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201304231302.r3ND2w5V024981@svn.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201304291123.41402.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 29 Apr 2013 12:13:32 -0400 (EDT) Cc: svn-src-head , Adrian Chadd , src-committers , Eitan Adler , svn-src-all X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 16:13:40 -0000 On Sunday, April 28, 2013 8:06:16 pm hiren panchasara wrote: > On Tue, Apr 23, 2013 at 9:46 AM, hiren panchasara wrote: > > On Tue, Apr 23, 2013 at 9:34 AM, Eitan Adler wrote: > >> On 23 April 2013 12:19, Adrian Chadd wrote: > >>> ... you know, even though it doesn't have an active maintainer, do you > >>> have test hardware, and why didn't you just bounce a patch to > >>> -wireless for review? > > > > My bad. I proposed this change initially. > >>> > >>> We don't bite you know! > >> > >> that you need to emphasize this does not comfort me. ;) > >> > >> reverted in 249812. > > > > Will look at john's suggestions and fix it correctly. > > John, > > Does this look okay? > > % svn diff > Index: if_bwn.c > =================================================================== > --- if_bwn.c (revision 250036) > +++ if_bwn.c (working copy) > @@ -9240,9 +9240,9 @@ > BUS_DMASYNC_PREWRITE); > > /* > - * Setup RX buf descriptor > + * Restore RX buf descriptor > */ > - dr->setdesc(dr, desc, paddr, meta->mt_m->m_len - > + dr->setdesc(dr, desc, meta->mt_paddr, meta->mt_m->m_len - > sizeof(*hdr), 0, 0, 0); > return (error); > } I would leave the comment alone. In the common case you do allocate a new mbuf so you aren't restoring the descriptor but setting it up with a new address. The code change looks correct. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Apr 29 16:19:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E4E26D66; Mon, 29 Apr 2013 16:19:12 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wi0-x22c.google.com (mail-wi0-x22c.google.com [IPv6:2a00:1450:400c:c05::22c]) by mx1.freebsd.org (Postfix) with ESMTP id AFA6B1E7B; Mon, 29 Apr 2013 16:19:11 +0000 (UTC) Received: by mail-wi0-f172.google.com with SMTP id hm14so2956995wib.5 for ; Mon, 29 Apr 2013 09:19:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=I8Ds3v/llIXlNhzM6734dyXukMNv3G4VlLPiagD+Sqs=; b=tkijf8cN+jnW+O9cK54VwNdLMANkQNpsCZ70e8mI72bQ2bObSWhJU+U9XB7GdMbNP9 Wd57d6VFcllFW9iFdoOst0/smQV0ed9s/Ui4IC7bz0VPeaHSBcO2n8BHDuRQ9FBQC7HT OJTQ4kxxPTG8x6044XMWDBRc7xhB36a2cVB7wueV9hu1OCdtCK9SZXuf5kBNjWhEbDxo bdXNZuTE6H51sG9Qs/3QTN0dNXesGcC0fQ/PcrwwNDZRnRMtvMRtHIb20X29yxb+q+lr sm3LgSdrCw6dK432xvUQfZ0zRRDGH4jGoDvkaMVn6xsfoTCKuGpKKKaZE5z34A05m5+K 1ddw== MIME-Version: 1.0 X-Received: by 10.180.89.140 with SMTP id bo12mr1699154wib.22.1367252350884; Mon, 29 Apr 2013 09:19:10 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.58.138 with HTTP; Mon, 29 Apr 2013 09:19:10 -0700 (PDT) In-Reply-To: <201304291123.41402.jhb@freebsd.org> References: <201304231302.r3ND2w5V024981@svn.freebsd.org> <201304291123.41402.jhb@freebsd.org> Date: Mon, 29 Apr 2013 09:19:10 -0700 X-Google-Sender-Auth: UyFBBmv_Ooyqj-ru8AVAj2pZiZk Message-ID: Subject: Re: svn commit: r249800 - head/sys/dev/bwn From: Adrian Chadd To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head , Eitan Adler , svn-src-all , src-committers , hiren panchasara X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 16:19:13 -0000 On 29 April 2013 08:23, John Baldwin wrote: >> - dr->setdesc(dr, desc, paddr, meta->mt_m->m_len - >> + dr->setdesc(dr, desc, meta->mt_paddr, meta->mt_m->m_len - >> sizeof(*hdr), 0, 0, 0); >> return (error); >> } > > I would leave the comment alone. In the common case you do allocate a new > mbuf so you aren't restoring the descriptor but setting it up with a new > address. The code change looks correct. Does anyone here have bwn hardware that works? Adrian From owner-svn-src-head@FreeBSD.ORG Mon Apr 29 16:44:06 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C9F6E3E8; Mon, 29 Apr 2013 16:44:06 +0000 (UTC) (envelope-from hiren.panchasara@gmail.com) Received: from mail-ee0-f47.google.com (mail-ee0-f47.google.com [74.125.83.47]) by mx1.freebsd.org (Postfix) with ESMTP id 612D91F6B; Mon, 29 Apr 2013 16:44:05 +0000 (UTC) Received: by mail-ee0-f47.google.com with SMTP id b57so2706590eek.20 for ; Mon, 29 Apr 2013 09:44:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=S8XiHZM4iCAAep0KgWL2zW8SaKjgmQUEGZf31E8oCPo=; b=J5GXfNYlA7eR/AzmQJuO74WnYoosgNZUhPjkcIbSv7+bXkX4LY4dBHxKK1eRPtAmHA D5QRP9D2YfacBVzXVSY8P+uKNELoVNb1YQuT6R57VtbmbWS+4jXOFvQNjg7E0VT4nvRQ /Wczo89BgcV+f+iam2fkskJvbPMzTe2ELuoZROS0fZLWuSrgB2RfhsyxMkjJW1DCrg7x KRAokhRhgEINPLzL5Mq1EvSUmmGk3ggd16RhB8be/bfSQLyOa1UXyA7W/OsHQNkeiZxB Mdg6KNQNV7FKNJ9VZwBtJurXp4bMzHRftVRLD2T5yoUlmzv/+MaBDg4gq3fG731FNINo uQcg== MIME-Version: 1.0 X-Received: by 10.15.27.195 with SMTP id p43mr124194688eeu.8.1367253844359; Mon, 29 Apr 2013 09:44:04 -0700 (PDT) Sender: hiren.panchasara@gmail.com Received: by 10.14.204.200 with HTTP; Mon, 29 Apr 2013 09:44:04 -0700 (PDT) In-Reply-To: References: <201304231302.r3ND2w5V024981@svn.freebsd.org> <201304291123.41402.jhb@freebsd.org> Date: Mon, 29 Apr 2013 09:44:04 -0700 X-Google-Sender-Auth: adph2r6gHC0ONIGeDCu_lP9EvJQ Message-ID: Subject: Re: svn commit: r249800 - head/sys/dev/bwn From: hiren panchasara To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head , svn-src-all , src-committers , Eitan Adler , John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 16:44:06 -0000 On Mon, Apr 29, 2013 at 9:19 AM, Adrian Chadd wrote: > On 29 April 2013 08:23, John Baldwin wrote: >>> - dr->setdesc(dr, desc, paddr, meta->mt_m->m_len - >>> + dr->setdesc(dr, desc, meta->mt_paddr, meta->mt_m->m_len - >>> sizeof(*hdr), 0, 0, 0); >>> return (error); >>> } >> >> I would leave the comment alone. In the common case you do allocate a new >> mbuf so you aren't restoring the descriptor but setting it up with a new >> address. The code change looks correct. Alright. Thanks John. > > Does anyone here have bwn hardware that works? I do not. Hiren > > > > Adrian From owner-svn-src-head@FreeBSD.ORG Mon Apr 29 16:46:14 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C5B2D595; Mon, 29 Apr 2013 16:46:14 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 09D6A1F80; Mon, 29 Apr 2013 16:46:14 +0000 (UTC) Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 8DEEB421360; Tue, 30 Apr 2013 02:22:02 +1000 (EST) Date: Tue, 30 Apr 2013 02:22:00 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Schouten Subject: Re: svn commit: r250037 - head/bin/hostname In-Reply-To: Message-ID: <20130430013949.O1819@besplex.bde.org> References: <201304282252.r3SMqiHH009205@svn.freebsd.org> <20130429212227.R1043@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=Gu4aYTJC c=1 sm=1 a=HGXDrXWPGKwA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=S8Dq8nDLOMQA:10 a=ElF3g5Y_1pXU53sFaFAA:9 a=CjuIK1q_8ugA:10 a=TEtd8y5WR3g2ypngnwZWYw==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Eitan Adler , Bruce Evans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 16:46:14 -0000 On Mon, 29 Apr 2013, Ed Schouten wrote: > 2013/4/29 Bruce Evans : >> - usr.bin/rlogin/rlogin.c has it in a gratuitously different form, as >> 'static _Noreturn void usage(void);'. This is bogus since >> _Noreturn is a wrapper for a new C++ feature > > I hate to correct you here, but _Noreturn is not a wrapper for a new > C++ feature, it's a keyword that's part of C11. See: Yes, I misread the ifdef in sys/cdefs.h. So it is a new C feature as well as a new C++ feature. > All C11 keywords can be implemented on top of GCC-specific constructs, > with the exception of _Generic. I would strongly prefer it if we used > these keywords over our FreeBSD-specific solutions. That would mainly churn the source code, and still depend for portability on FreeBSD #defining them in sys/cdefs.h. Just with different spelling. > If the only objection is the spelling of these keywords (underscores, > uppercase, etc), be sure to: > > #include /* For alignas/alignof. */ > #include /* For noreturn. */ > #include /* For thread_local. */ Ideally, new code would just use the new features. Then it would need includes to get the nicer spelling and not depend on FreeBSD features. But it is easier to use the FreeBSD features. I once hoped that the portability hacks in sys/cdefs.h (that is, the whole file) would go away when C became standard. Instead, it grew many more. It is now 7 times larger and many more than 7 times more convoluted than in FreeBSD-1. In FreeBSD-1, it only defined the following macros: __BEGIN_DECLS, __CONCAT(), __END_DECLS, __P(), __STRING(), __dead, __pure, const, inline, signed, volatile where only the last 4 are for corrupting Standard C keywords. `noreturn' (case-insensitive) is now used 9 times in /usr/src/*bin (.c files): - 4 times for hard-coded __attribute__(()) - 3 times in rlogin.c for _Noreturn. I already pointed out some of the syntax problems with these. They are unportable since they give syntax errors with some versions of gcc, while either __dead or __dead2 would not have these syntax errors when correctly placed. I don't know if the C11 keyword can be placed almost anywhere like the attribute can be now. If not, then it would be impossible to replace all the __dead2's by it without changing the syntax, and then it would give syntax errors for the old compilers. - 2 times for NORETURN comments after usage() in fstat. These are just garbage. They are because lint is too stupid to understand __dead2 or _Noreturn, so it needs a comment to tell it that usage() doesn't return. But the comment for this is NOTREACHED, not NORETURN. NORETURN also misdescribes the situtation for human readers, since it is usage() that doesn't return and the code after it that is not reached. I dislike even correct lint comments. Telling the compiler than functions don't return has worked better than telling lint this for more than 20 years. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Apr 29 16:58:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D12A0839; Mon, 29 Apr 2013 16:58:22 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C3EDA1FFD; Mon, 29 Apr 2013 16:58:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TGwMZm094558; Mon, 29 Apr 2013 16:58:22 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TGwMPe094557; Mon, 29 Apr 2013 16:58:22 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201304291658.r3TGwMPe094557@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 29 Apr 2013 16:58:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250049 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 16:58:22 -0000 Author: luigi Date: Mon Apr 29 16:58:21 2013 New Revision: 250049 URL: http://svnweb.freebsd.org/changeset/base/250049 Log: explicitly mark some variables as const Modified: head/sys/dev/netmap/ixgbe_netmap.h Modified: head/sys/dev/netmap/ixgbe_netmap.h ============================================================================== --- head/sys/dev/netmap/ixgbe_netmap.h Mon Apr 29 15:58:04 2013 (r250048) +++ head/sys/dev/netmap/ixgbe_netmap.h Mon Apr 29 16:58:21 2013 (r250049) @@ -226,7 +226,8 @@ ixgbe_netmap_txsync(struct ifnet *ifp, u struct netmap_adapter *na = NA(adapter->ifp); struct netmap_kring *kring = &na->tx_rings[ring_nr]; struct netmap_ring *ring = kring->ring; - u_int j, k = ring->cur, l, n = 0, lim = kring->nkr_num_slots - 1; + u_int j, l, n = 0; + u_int const k = ring->cur, lim = kring->nkr_num_slots - 1; /* * ixgbe can generate an interrupt on every tx packet, but it @@ -393,11 +394,10 @@ ring_reset: if (ix_use_dd) { struct ixgbe_legacy_tx_desc *txd = (struct ixgbe_legacy_tx_desc *)txr->tx_base; - + u_int k1 = netmap_idx_k2n(kring, kring->nr_hwcur); l = txr->next_to_clean; - k = netmap_idx_k2n(kring, kring->nr_hwcur); delta = 0; - while (l != k && + while (l != k1 && txd[l].upper.fields.status & IXGBE_TXD_STAT_DD) { delta++; l = (l == lim) ? 0 : l + 1; From owner-svn-src-head@FreeBSD.ORG Mon Apr 29 16:59:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 73C0C9E8; Mon, 29 Apr 2013 16:59:31 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (unknown [IPv6:2001:610:1108:5012::107]) by mx1.freebsd.org (Postfix) with ESMTP id CF638100D; Mon, 29 Apr 2013 16:59:30 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 936DC1203CB; Mon, 29 Apr 2013 18:59:14 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 6E23028493; Mon, 29 Apr 2013 18:59:14 +0200 (CEST) Date: Mon, 29 Apr 2013 18:59:14 +0200 From: Jilles Tjoelker To: Bruce Evans Subject: Re: svn commit: r249859 - head/lib/libc/sys Message-ID: <20130429165914.GA78757@stack.nl> References: <201304242124.r3OLOZW5034818@svn.freebsd.org> <20130425204458.F1034@besplex.bde.org> <20130426155933.GA24412@stack.nl> <20130427030857.L2680@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130427030857.L2680@besplex.bde.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 16:59:31 -0000 On Sat, Apr 27, 2013 at 04:36:56AM +1000, Bruce Evans wrote: > On Fri, 26 Apr 2013, Jilles Tjoelker wrote: > > On Thu, Apr 25, 2013 at 09:56:01PM +1000, Bruce Evans wrote: > >> On Wed, 24 Apr 2013, Jilles Tjoelker wrote: > >>> Log: > >>> getdtablesize(2): Describe what this function actually does. > >>> ... > >>> .Sh NAME > >>> .Nm getdtablesize > >>> -.Nd get descriptor table size > >>> +.Nd get file descriptor limit > >> Now its name doesn't match its description, and the reason for this is > >> not documented. > > This seems to be the case on most systems that have this function. > No reason not to document it. I can do it if you provide text. > >> This function is almost obsolete. In POSIX, it is spelled {OPEN_MAX} > >> or sysconf(__SC_OPEN_MAX). It is sometimes misspelled OPEN_MAX. > > There is a difference between sysconf(_SC_OPEN_MAX) and getdtablesize(): > > the latter also takes maxfilesperproc and rctl(8) rules into account. > Yes, only sysconf(_SC_OPEN_MAX) (and getrlimit(..., RLIMIT_NOFILE)) are > broken. > I'm not familiar with rctl. It seems to break this some more: in > kern_descrip.c, all the places that use the rlimit clamp it to > maxfileperproc, so the effective rlimit is always the clamped value > and this is what sysconf() and getrlimit() should return too. Now > for rctl, only 1 of these places (namely getdtablesize()) clamps it > further to the RACCT_NOFILE limit. Other places include do_dup(). > do_dup() checks the RACCT_NOFILE much later. I think this gives the > same limit, but at least the errno when the limit RACCT_NOFILE limit > is exceeded but the others aren't is wrong in all cases. (The early > errno for (new >= maxfd) is (flags & DUP_FCNTL ? EINVAL : EBADF). > The later errno for racct_set(... RACCT_NOFILE, new + 1) is always > EMFILE. EMFILE is not even a possible errno for dup2(). Hmm, if we return [EBADF] there, we should also change sysconf(_SC_OPEN_MAX) to return getdtablesize() instead of the soft rlimit. > >> I prepared to remove the broken definition of OPEN_MAX, but never committed > >> the final step. /usr/src has very few misuses of OPEN_MAX now, so removing > >> the definition wouldn't be too hard. Most uses are in compatibility > >> cruft. E.g., the following from > >> crypto/openssh/openbsd-compat/bsd-closefrom.c > >> which is confused about related things: > >> [snip] > > If that code is compiled at all, it is a bug. We have closefrom() and > > OpenSSH should use it. > It almost certainly uses it. However, a quick grep for getdtablesize() > shows many applications using it, and most of them use it to give the > top of a close() loop. These should be converted to use something > like closefrom(). getdtablesize() is used much more than sysconf() > or getrlimit() for this. This is done mostly in old BSD applications. > However, the worst uses that I noticed are in the relatively new ppp > application. There are about 40 calls to getdtablesize() in /usr/src. > 7 of these are in ppp. 1 of the 7 is for the close() loop. 4 of the > 7 are for fcntl(... F_SETFD ...) loops. The other 2 are for a home > made FD_SETSIZE and a home made FD_ZERO(). These essentially initialize > FD_SETSIZE to the variable getdtablesize(). A table of bits of that > size is allocated. A table of bits of that size is cleared. Since > getdtablesize() is variable, buffer overruns and underruns occur if > someone changes getdtablesize() while the process is running (it can > be changed by the maxfileperproc sysctl and now by rctl). But the > huge table is not always passed to select() (its size doesn't seem to > be recorded anywhere, so it can also be overrun or underrun by > FD_SET() on it, where the fd for FD_SET is acquired before or after > getdtablesize() changes). Much of this is in uncommonly used code that is hard to test :( A getdtablesize()/close() loop is not so bad because it is exactly equivalent to closefrom() (modulo bugs in the former) but the fcntl(F_SETFD, 1) loops are harder. There are also various copies of popen in the tree (often slightly modified) that create an array of getdtablesize() elements to track popened file descriptors. This is safe as long as getdtablesize() does not increase while the process is running, but also wasteful. > >> ... in 4.4BSD and FreeBSD, both sysconf(_SC_OPEN_MAX) are just wrappers for > >> the resource limit (sysconf() is a libc wrapper and getdtablesize() is > >> a syscall wrapper). Actually, in FreeBSD, getdtablesize() is not even the > >> rlmint -- it is the min() of the rlimit and the global sysctl integer > >> maxfilesperproc. Here the bug is in the rlimit. For the rlimit, > >> maxfilesperproc is only used when the rlimit is set and when it is used > >> in the kernel. But when the rlimit is returned to userland, via > >> getrlimit(), maxfilesperproc is not used, so the rlimit may be wrong if > >> maxfileperproc was lowered after setting the rlimit. > > I don't like the idea of rlimits changing of "their own will". Changing > > maxfileperproc at run time is going to be a bit nasty in any case but > > seems not as bad as changing rlimits of running processes. > I don't like this either. maxfileperproc wouldn't exist if my axe was > sharper in 1995 when it was committed. rctl is less hackish, but causes > similar problems. > Anyway, since the effective limit does change, getrlimit() should keep up > with the change like getdtablesize() does. Otherwise processes can't tell > what the rlimit actually is, or needs to know that getdtablesize() must > be used instead of getrlimit() to determine the actual limit. I don't think getrlimit() is intended to allow programs to determine an actual limit. There may be other limits than the setrlimit(). > maxfileperproc and the rctl limit are only needed to prevent growth > of the table. Once a large table has been allocated, it is not useful > to prevent dup2() from using a large fd for which space has already > been allocated. But the clamps to maxfileperproc prevent this. Maybe > the clamps to the rctl limit don't prevent this, since they are applied > later and only cause failure if the allocation fails. But then since > they are applied at the same time in getdtablesize(), they prevent > applications from knowing the actual limit in another way. I think this > is now further complicated by sparse tables. Only preventing growth of the table would still allow a process to consume more of kern.maxfiles than is supposed to be possible. > >> Actually, {OPEN_MAX} is guaranteed by POSIX to be at least > >> {_POSIX_OPEN_MAX}, and {_POSIX_OPEN_MAX} is precisely 20. But these > >> guarantees and similar ones for stdio's FOPEN_MAX have always been > >> broken in FreeBSD, since anyone can reduce the rlimit below 20. > >> ... > > Recent versions of POSIX allow {OPEN_MAX} to be based on the rlimit. In > > that case, it may change when the rlimit is changed. > I think this is more or less required (and implicit before). But how > can anything work if it there is no API like closefrom() and there is > no way to determine the maximum open fd. getdtablesize() would be > more useful if it actually returned the table size. Then its old use > of closing all files up to the table size (less 1) would keep working > OK iff the table size is small. Of course, the table must remain large > enough to keep holding the maximum open fd. If getdtablesize() did that, > then it would match its name again. But it hasn't matched since 386BSD > or earlier -- in FreeBSD-1, it returned essentially the same as now: > (just the rlimit, so it doesn't cover the maximum open fd if anyone > reduces the rlimit). Various uses of getdtablesize() are indeed for the limit, and trying to imitate closefrom() is an incorrect and slow use of getdtablesize(). A closefrom() API was explicitly rejected for POSIX in http://www.austingroupbugs.net/view.php?id=149 because closing arbitrary file descriptors could render the application non-conforming (for example, tracing might be implemented using a file descriptor, or if fexecve() is used on an interpreted (#!) file). Instead, it was suggested to allow making all new file descriptors close-on-exec and to require standard functions to make all internal file descriptors close-on-exec. Some of this is already implemented, see https://wiki.freebsd.org/AtomicCloseOnExec . > >>> The > >>> .Fn getdtablesize > >>> -system call returns the size of this table. > >>> +system call returns the maximum number of file descriptors > >>> +that the current process may open. > >> Actually, the process may open more than this number, after raising its > >> (soft) rlimit, if this is possible. > > True, but this requires different function calls than just ones > > allocating file descriptors. > Not too bad if the rlimit can only be changed by the process itself, but > I'd still like this to be documented explicitly. > POSIX doesn't have the complications of maxfileperproc or rctl. These > are harder to document. About all you can say is that the results returned > by getdtablesize(), getrlimit() and sysconf() are volatile so that they > become unusable before they can be used :-(. > >>> +.Xr closefrom 2 , > >>> .Xr dup 2 , > >>> -.Xr open 2 , > >>> -.Xr select 2 > >>> +.Xr getrlimit 2 , > >>> +.Xr sysconf 2 > >>> .Sh HISTORY > >>> The > >>> .Fn getdtablesize > > I suppose rctl(8) can be added here. > dup(2) needs similar changes (I didn't notice if you changed it > recently). It says that `oldd' must be < getdtablesize(), but actually, > `oldd' must just be open. It doesn't say that `newd' must be < > getdtablesize() (modulo complications for the rctl case), except > indirectly in the ERRORS section, it says that EBADF occurs when `newd' > exceeds the maximum allowable descriptor number. Here "allowable" has > a wrong tense ("allowed" would make more sense), and what this maximum > is is not described. POSIX uses better wording for this of course > ("... when `fildes' is greater than or equal to {OPEN_MAX}"). This > would be better still with "greater than or equal" spelled ">=". Probably. To be looked at later. -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Mon Apr 29 17:00:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8C371BE6; Mon, 29 Apr 2013 17:00:26 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7EA301023; Mon, 29 Apr 2013 17:00:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TH0QD8095274; Mon, 29 Apr 2013 17:00:26 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TH0Q7X095272; Mon, 29 Apr 2013 17:00:26 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201304291700.r3TH0Q7X095272@svn.freebsd.org> From: Xin LI Date: Mon, 29 Apr 2013 17:00:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250050 - head/sys/dev/hptiop X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 17:00:26 -0000 Author: delphij Date: Mon Apr 29 17:00:26 2013 New Revision: 250050 URL: http://svnweb.freebsd.org/changeset/base/250050 Log: Add missing braces. Submitted by: Sascha Wildner Obtained from: DragonFly MFC after: 1 week Modified: head/sys/dev/hptiop/hptiop.c Modified: head/sys/dev/hptiop/hptiop.c ============================================================================== --- head/sys/dev/hptiop/hptiop.c Mon Apr 29 16:58:21 2013 (r250049) +++ head/sys/dev/hptiop/hptiop.c Mon Apr 29 17:00:26 2013 (r250050) @@ -1704,10 +1704,11 @@ static int hptiop_internal_memalloc_mvfr hba->u.mvfrey.internal_mem_size, hptiop_mvfrey_map_ctlcfg, hba, 0)) { device_printf(hba->pcidev, "bus_dmamap_load failed!\n"); - if (hba->ctlcfg_dmat) + if (hba->ctlcfg_dmat) { bus_dmamem_free(hba->ctlcfg_dmat, hba->ctlcfg_ptr, hba->ctlcfg_dmamap); bus_dma_tag_destroy(hba->ctlcfg_dmat); + } return -1; } From owner-svn-src-head@FreeBSD.ORG Mon Apr 29 17:42:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 02607E6D; Mon, 29 Apr 2013 17:42:10 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wg0-x234.google.com (mail-wg0-x234.google.com [IPv6:2a00:1450:400c:c00::234]) by mx1.freebsd.org (Postfix) with ESMTP id BE2E01390; Mon, 29 Apr 2013 17:42:08 +0000 (UTC) Received: by mail-wg0-f52.google.com with SMTP id k13so3814960wgh.31 for ; Mon, 29 Apr 2013 10:42:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=BmlY8EANHd8sOflkQGQPZ1Wc/hpzGxt49Fz4ja5InlU=; b=EylkfSWMxCH+LZ/XiIdO1RZZvt6I0w5fHf3S/RLdRogRNhc1bwjYTQeTjlsQgm5V7R g8CH7iHSTleMmzA0bTClRnQhIBL4Fg8jVnkPv0g0AMalMETOKekJ/oTRxUV0bwh19pks fk3mJyBN9pwn7Q8+8Fa9C1mA67oVO0cg67exAmGidhEYjH6BTCK0/J+ERgUsqEXIyNtm M/sHt4TxIkKFMdtR4NSdQTUtFdUE2RS0pvQ7sguexT3TTzDyf/xZVVD1bN32Wk8XGPJy HE8G/6Ub758ejtidE1IPfNgYKuSn7ttH3eDTzjX9+iEBfGcZyNXyMRmII60RlQgPgqjP YKcA== MIME-Version: 1.0 X-Received: by 10.180.107.6 with SMTP id gy6mr19602359wib.22.1367257327990; Mon, 29 Apr 2013 10:42:07 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.58.138 with HTTP; Mon, 29 Apr 2013 10:42:07 -0700 (PDT) In-Reply-To: References: <201304231302.r3ND2w5V024981@svn.freebsd.org> <201304291123.41402.jhb@freebsd.org> Date: Mon, 29 Apr 2013 10:42:07 -0700 X-Google-Sender-Auth: Su8uX3B0baV5n2z9VENY6VzoJxQ Message-ID: Subject: Re: svn commit: r249800 - head/sys/dev/bwn From: Adrian Chadd To: hiren panchasara Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head , svn-src-all , src-committers , Eitan Adler , John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 17:42:10 -0000 On 29 April 2013 09:44, hiren panchasara wrote: >> Does anyone here have bwn hardware that works? > > I do not. Have an expresscard slot? Want some? adrian From owner-svn-src-head@FreeBSD.ORG Mon Apr 29 18:00:16 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 780383E8; Mon, 29 Apr 2013 18:00:16 +0000 (UTC) (envelope-from hiren.panchasara@gmail.com) Received: from mail-ea0-x236.google.com (mail-ea0-x236.google.com [IPv6:2a00:1450:4013:c01::236]) by mx1.freebsd.org (Postfix) with ESMTP id 397A91487; Mon, 29 Apr 2013 18:00:15 +0000 (UTC) Received: by mail-ea0-f182.google.com with SMTP id r16so2672185ead.27 for ; Mon, 29 Apr 2013 11:00:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=bIr87GAoiFZ5i7Ej/WeH+BhhoYR6VIbxffND0uMbWsY=; b=RgG3MhWlseu5kBjFMFZap0HCtqmNqz9QP+LOmJZp4Cuc0WI+HupadNyJJGavE7YHiZ ul0TXViX50Z/BrFDxOyz+Pw+seM6Nt3+sHHLPfc/3s8YTYm82B0xKEnjB6kreSLRzAV3 b0MaFJXZZWEW8Tqt81il3t/sinA1+aWL3taHMpiZtTVrMaqr0j2TfO7iniFHuj1fIYep /+fuDvB1jOIOutZjennRKAqTB2Gq9J/4kapAoB3K0lAB21wpi7N9w6vFZ43e7Z17zE6H FwH8dlh6xPEnSi5KWXXxSvyo5ZhL1c2FjkIOR153868/k77pbAbdQOFY0rsTQlPdotdJ x6UQ== MIME-Version: 1.0 X-Received: by 10.14.22.7 with SMTP id s7mr23785643ees.32.1367258413653; Mon, 29 Apr 2013 11:00:13 -0700 (PDT) Sender: hiren.panchasara@gmail.com Received: by 10.14.204.200 with HTTP; Mon, 29 Apr 2013 11:00:13 -0700 (PDT) In-Reply-To: References: <201304231302.r3ND2w5V024981@svn.freebsd.org> <201304291123.41402.jhb@freebsd.org> Date: Mon, 29 Apr 2013 11:00:13 -0700 X-Google-Sender-Auth: LxZ_4g7s21U3p85TPzRiqan1ggY Message-ID: Subject: Re: svn commit: r249800 - head/sys/dev/bwn From: hiren panchasara To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head , svn-src-all , src-committers , Eitan Adler , John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 18:00:16 -0000 On Mon, Apr 29, 2013 at 10:42 AM, Adrian Chadd wrote: > On 29 April 2013 09:44, hiren panchasara wrote: > >>> Does anyone here have bwn hardware that works? >> >> I do not. > > Have an expresscard slot? Want some? Yes and yes :-) cheers, Hiren > > > > adrian From owner-svn-src-head@FreeBSD.ORG Mon Apr 29 18:00:55 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9F41056E; Mon, 29 Apr 2013 18:00:55 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 80E9714A1; Mon, 29 Apr 2013 18:00:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TI0slL017987; Mon, 29 Apr 2013 18:00:54 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TI0rim017973; Mon, 29 Apr 2013 18:00:53 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201304291800.r3TI0rim017973@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 29 Apr 2013 18:00:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250052 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 18:00:55 -0000 Author: luigi Date: Mon Apr 29 18:00:53 2013 New Revision: 250052 URL: http://svnweb.freebsd.org/changeset/base/250052 Log: whitespace changes: remove $Id$ lines, and add blank lines around some #if / #elif /#endif Modified: head/sys/dev/netmap/if_em_netmap.h head/sys/dev/netmap/if_igb_netmap.h head/sys/dev/netmap/if_lem_netmap.h head/sys/dev/netmap/if_re_netmap.h head/sys/dev/netmap/ixgbe_netmap.h head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_kern.h head/sys/dev/netmap/netmap_mem2.c Modified: head/sys/dev/netmap/if_em_netmap.h ============================================================================== --- head/sys/dev/netmap/if_em_netmap.h Mon Apr 29 17:29:48 2013 (r250051) +++ head/sys/dev/netmap/if_em_netmap.h Mon Apr 29 18:00:53 2013 (r250052) @@ -25,7 +25,6 @@ /* * $FreeBSD$ - * $Id: if_em_netmap.h 10627 2012-02-23 19:37:15Z luigi $ * * netmap support for em. * Modified: head/sys/dev/netmap/if_igb_netmap.h ============================================================================== --- head/sys/dev/netmap/if_igb_netmap.h Mon Apr 29 17:29:48 2013 (r250051) +++ head/sys/dev/netmap/if_igb_netmap.h Mon Apr 29 18:00:53 2013 (r250052) @@ -25,7 +25,6 @@ /* * $FreeBSD$ - * $Id: if_igb_netmap.h 10627 2012-02-23 19:37:15Z luigi $ * * Netmap support for igb, partly contributed by Ahmed Kooli * For details on netmap support please see ixgbe_netmap.h Modified: head/sys/dev/netmap/if_lem_netmap.h ============================================================================== --- head/sys/dev/netmap/if_lem_netmap.h Mon Apr 29 17:29:48 2013 (r250051) +++ head/sys/dev/netmap/if_lem_netmap.h Mon Apr 29 18:00:53 2013 (r250052) @@ -26,7 +26,6 @@ /* * $FreeBSD$ - * $Id: if_lem_netmap.h 10627 2012-02-23 19:37:15Z luigi $ * * netmap support for "lem" * Modified: head/sys/dev/netmap/if_re_netmap.h ============================================================================== --- head/sys/dev/netmap/if_re_netmap.h Mon Apr 29 17:29:48 2013 (r250051) +++ head/sys/dev/netmap/if_re_netmap.h Mon Apr 29 18:00:53 2013 (r250052) @@ -25,7 +25,6 @@ /* * $FreeBSD$ - * $Id: if_re_netmap.h 10609 2012-02-22 19:44:58Z luigi $ * * netmap support for "re" * For details on netmap support please see ixgbe_netmap.h Modified: head/sys/dev/netmap/ixgbe_netmap.h ============================================================================== --- head/sys/dev/netmap/ixgbe_netmap.h Mon Apr 29 17:29:48 2013 (r250051) +++ head/sys/dev/netmap/ixgbe_netmap.h Mon Apr 29 18:00:53 2013 (r250052) @@ -25,7 +25,6 @@ /* * $FreeBSD$ - * $Id: ixgbe_netmap.h 10627 2012-02-23 19:37:15Z luigi $ * * netmap modifications for ixgbe * Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Mon Apr 29 17:29:48 2013 (r250051) +++ head/sys/dev/netmap/netmap.c Mon Apr 29 18:00:53 2013 (r250052) @@ -99,6 +99,7 @@ MALLOC_DEFINE(M_NETMAP, "netmap", "Netwo #include #include +/* XXX the following variables must be deprecated and included in nm_mem */ u_int netmap_total_buffers; u_int netmap_buf_size; char *netmap_buffer_base; /* address of an invalid buffer */ @@ -148,6 +149,8 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, copy, #define NM_BDG_HASH 1024 /* forwarding table entries */ #define NM_BDG_BATCH 1024 /* entries in the forwarding buffer */ #define NM_BRIDGES 4 /* number of bridges */ + + int netmap_bridge = NM_BDG_BATCH; /* bridge batch size */ SYSCTL_INT(_dev_netmap, OID_AUTO, bridge, CTLFLAG_RW, &netmap_bridge, 0 , ""); Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Mon Apr 29 17:29:48 2013 (r250051) +++ head/sys/dev/netmap/netmap_kern.h Mon Apr 29 18:00:53 2013 (r250052) @@ -25,7 +25,6 @@ /* * $FreeBSD$ - * $Id: netmap_kern.h 11829 2012-09-26 04:06:34Z luigi $ * * The header contains the definitions of constants and function * prototypes used only in kernelspace. @@ -35,6 +34,7 @@ #define _NET_NETMAP_KERN_H_ #if defined(__FreeBSD__) + #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) @@ -42,8 +42,10 @@ #define NM_SELINFO_T struct selinfo #define MBUF_LEN(m) ((m)->m_pkthdr.len) #define NM_SEND_UP(ifp, m) ((ifp)->if_input)(ifp, m) + #elif defined (linux) -#define NM_LOCK_T safe_spinlock_t // see bsd_glue.h + +#define NM_LOCK_T safe_spinlock_t // see bsd_glue.h #define NM_SELINFO_T wait_queue_head_t #define MBUF_LEN(m) ((m)->len) #define NM_SEND_UP(ifp, m) netif_rx(m) @@ -65,6 +67,7 @@ #endif #elif defined (__APPLE__) + #warning apple support is incomplete. #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) @@ -74,8 +77,10 @@ #define NM_SEND_UP(ifp, m) ((ifp)->if_input)(ifp, m) #else + #error unsupported platform -#endif + +#endif /* end - platform-specific code */ #define ND(format, ...) #define D(format, ...) \ Modified: head/sys/dev/netmap/netmap_mem2.c ============================================================================== --- head/sys/dev/netmap/netmap_mem2.c Mon Apr 29 17:29:48 2013 (r250051) +++ head/sys/dev/netmap/netmap_mem2.c Mon Apr 29 18:00:53 2013 (r250052) @@ -25,7 +25,6 @@ /* * $FreeBSD$ - * $Id: netmap_mem2.c 11881 2012-10-18 23:24:15Z luigi $ * * (New) memory allocator for netmap */ From owner-svn-src-head@FreeBSD.ORG Mon Apr 29 18:54:32 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5B12AA51; Mon, 29 Apr 2013 18:54:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4CF0A181F; Mon, 29 Apr 2013 18:54:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TIsWpY036204; Mon, 29 Apr 2013 18:54:32 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TIsWHi036203; Mon, 29 Apr 2013 18:54:32 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201304291854.r3TIsWHi036203@svn.freebsd.org> From: John Baldwin Date: Mon, 29 Apr 2013 18:54:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250053 - head/sys/dev/acpi_support X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 18:54:32 -0000 Author: jhb Date: Mon Apr 29 18:54:31 2013 New Revision: 250053 URL: http://svnweb.freebsd.org/changeset/base/250053 Log: Only cleanup CMI-related state on detach if the system supports CMI. PR: kern/163268 MFC after: 1 week Modified: head/sys/dev/acpi_support/acpi_hp.c Modified: head/sys/dev/acpi_support/acpi_hp.c ============================================================================== --- head/sys/dev/acpi_support/acpi_hp.c Mon Apr 29 18:00:53 2013 (r250052) +++ head/sys/dev/acpi_support/acpi_hp.c Mon Apr 29 18:54:31 2013 (r250053) @@ -574,28 +574,26 @@ acpi_hp_attach(device_t dev) static int acpi_hp_detach(device_t dev) { - int ret; + struct acpi_hp_softc *sc; ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__); - struct acpi_hp_softc *sc = device_get_softc(dev); - if (sc->has_cmi && sc->hpcmi_open_pid != 0) { - ret = EBUSY; - } - else { - if (sc->has_notify) { - ACPI_WMI_REMOVE_EVENT_HANDLER(dev, - ACPI_HP_WMI_EVENT_GUID); - } + sc = device_get_softc(dev); + if (sc->has_cmi && sc->hpcmi_open_pid != 0) + return (EBUSY); + + if (sc->has_notify) + ACPI_WMI_REMOVE_EVENT_HANDLER(dev, ACPI_HP_WMI_EVENT_GUID); + + if (sc->has_cmi) { if (sc->hpcmi_bufptr != -1) { sbuf_delete(&sc->hpcmi_sbuf); sc->hpcmi_bufptr = -1; } sc->hpcmi_open_pid = 0; destroy_dev(sc->hpcmi_dev_t); - ret = 0; } - return (ret); + return (0); } static int From owner-svn-src-head@FreeBSD.ORG Mon Apr 29 19:30:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4908A636; Mon, 29 Apr 2013 19:30:36 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3B8B31B15; Mon, 29 Apr 2013 19:30:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TJUaTn049721; Mon, 29 Apr 2013 19:30:36 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TJUa6L049720; Mon, 29 Apr 2013 19:30:36 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201304291930.r3TJUa6L049720@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 29 Apr 2013 19:30:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250054 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 19:30:36 -0000 Author: luigi Date: Mon Apr 29 19:30:35 2013 New Revision: 250054 URL: http://svnweb.freebsd.org/changeset/base/250054 Log: whitespace - document alternative locking under linux Modified: head/sys/dev/netmap/netmap_mem2.c Modified: head/sys/dev/netmap/netmap_mem2.c ============================================================================== --- head/sys/dev/netmap/netmap_mem2.c Mon Apr 29 18:54:31 2013 (r250053) +++ head/sys/dev/netmap/netmap_mem2.c Mon Apr 29 19:30:35 2013 (r250054) @@ -97,6 +97,8 @@ #define NETMAP_BUF_MAX_NUM 20*4096*2 /* large machine */ #ifdef linux +// XXX a mtx would suffice here 20130415 lr +// #define NMA_LOCK_T safe_spinlock_t #define NMA_LOCK_T struct semaphore #define NMA_LOCK_INIT() sema_init(&nm_mem.nm_mtx, 1) #define NMA_LOCK_DESTROY() From owner-svn-src-head@FreeBSD.ORG Mon Apr 29 20:09:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9B6EC537; Mon, 29 Apr 2013 20:09:45 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8DE0C1D04; Mon, 29 Apr 2013 20:09:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TK9j9T062350; Mon, 29 Apr 2013 20:09:45 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TK9jlZ062348; Mon, 29 Apr 2013 20:09:45 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201304292009.r3TK9jlZ062348@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 29 Apr 2013 20:09:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250055 - head/sys/fs/nfsserver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 20:09:45 -0000 Author: des Date: Mon Apr 29 20:09:44 2013 New Revision: 250055 URL: http://svnweb.freebsd.org/changeset/base/250055 Log: Fix a bug that allows NFS clients to issue READDIR on files. PR: kern/178016 Security: CVE-2013-3266 Security: FreeBSD-SA-13:05.nfsserver Modified: head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Mon Apr 29 19:30:35 2013 (r250054) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Mon Apr 29 20:09:44 2013 (r250055) @@ -1574,6 +1574,8 @@ nfsrvd_readdir(struct nfsrv_descript *nd nd->nd_repstat = NFSERR_BAD_COOKIE; #endif } + if (!nd->nd_repstat && vp->v_type != VDIR) + nd->nd_repstat = NFSERR_NOTDIR; if (nd->nd_repstat == 0 && cnt == 0) { if (nd->nd_flag & ND_NFSV2) /* NFSv2 does not have NFSERR_TOOSMALL */ From owner-svn-src-head@FreeBSD.ORG Mon Apr 29 20:13:11 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 67C7281D; Mon, 29 Apr 2013 20:13:11 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 48D331D31; Mon, 29 Apr 2013 20:13:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TKDBsR065137; Mon, 29 Apr 2013 20:13:11 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TKDAxT065129; Mon, 29 Apr 2013 20:13:10 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201304292013.r3TKDAxT065129@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 29 Apr 2013 20:13:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250056 - head/sbin/fsck_ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 20:13:11 -0000 Author: des Date: Mon Apr 29 20:13:09 2013 New Revision: 250056 URL: http://svnweb.freebsd.org/changeset/base/250056 Log: Add a -Z option which zeroes unused blocks. It can be combined with -E, in which case unused blocks are first zeroed and then erased. Reviewed by: mckusick MFC after: 3 weeks Modified: head/sbin/fsck_ffs/fsck.h head/sbin/fsck_ffs/fsck_ffs.8 head/sbin/fsck_ffs/fsutil.c head/sbin/fsck_ffs/main.c head/sbin/fsck_ffs/pass5.c Modified: head/sbin/fsck_ffs/fsck.h ============================================================================== --- head/sbin/fsck_ffs/fsck.h Mon Apr 29 20:09:44 2013 (r250055) +++ head/sbin/fsck_ffs/fsck.h Mon Apr 29 20:13:09 2013 (r250056) @@ -74,6 +74,7 @@ #define MINBUFS 10 /* minimum number of buffers required */ #define MAXBUFS 40 /* maximum space to allocate to buffers */ #define INOBUFSIZE 64*1024 /* size of buffer to read inodes in pass1 */ +#define ZEROBUFSIZE (dev_bsize * 128) /* size of zero buffer used by -Z */ union dinode { struct ufs1_dinode dp1; @@ -306,7 +307,8 @@ char yflag; /* assume a yes response * int bkgrdflag; /* use a snapshot to run on an active system */ int bflag; /* location of alternate super block */ int debug; /* output debugging info */ -int Eflag; /* zero out empty data blocks */ +int Eflag; /* delete empty data blocks */ +int Zflag; /* zero empty data blocks */ int inoopt; /* trim out unused inodes */ char ckclean; /* only do work if not cleanly unmounted */ int cvtlevel; /* convert to newer file system format */ @@ -402,6 +404,7 @@ int blread(int fd, char *buf, ufs2_dadd void bufinit(void); void blwrite(int fd, char *buf, ufs2_daddr_t blk, ssize_t size); void blerase(int fd, ufs2_daddr_t blk, long size); +void blzero(int fd, ufs2_daddr_t blk, long size); void cacheino(union dinode *dp, ino_t inumber); void catch(int); void catchquit(int); Modified: head/sbin/fsck_ffs/fsck_ffs.8 ============================================================================== --- head/sbin/fsck_ffs/fsck_ffs.8 Mon Apr 29 20:09:44 2013 (r250055) +++ head/sbin/fsck_ffs/fsck_ffs.8 Mon Apr 29 20:13:09 2013 (r250056) @@ -38,7 +38,7 @@ .Nd file system consistency check and interactive repair .Sh SYNOPSIS .Nm -.Op Fl BEFfnpry +.Op Fl BEFfnpryZ .Op Fl b Ar block .Op Fl c Ar level .Op Fl m Ar mode @@ -280,6 +280,15 @@ Assume a yes response to all questions a .Nm ; this should be used with great caution as this is a free license to continue after essentially unlimited trouble has been encountered. +.It Fl Z +Similar to +.Fl E , +but overwrites unused blocks with zeroes. +If both +.Fl E +and +.Fl Z +are specified, blocks are first zeroed and then erased. .El .Pp Inconsistencies checked are as follows: Modified: head/sbin/fsck_ffs/fsutil.c ============================================================================== --- head/sbin/fsck_ffs/fsutil.c Mon Apr 29 20:09:44 2013 (r250055) +++ head/sbin/fsck_ffs/fsutil.c Mon Apr 29 20:13:09 2013 (r250056) @@ -618,6 +618,35 @@ blerase(int fd, ufs2_daddr_t blk, long s return; } +void +blzero(int fd, ufs2_daddr_t blk, long size) +{ + static char *zero; + off_t offset, len; + + if (fd < 0) + return; + len = ZEROBUFSIZE; + if (zero == NULL) { + zero = calloc(len, 1); + if (zero == NULL) + errx(EEXIT, "cannot allocate buffer pool"); + } + offset = blk * dev_bsize; + if (lseek(fd, offset, 0) < 0) + rwerror("SEEK BLK", blk); + while (size > 0) { + if (size > len) + size = len; + else + len = size; + if (write(fd, zero, len) != len) + rwerror("WRITE BLK", blk); + blk += len / dev_bsize; + size -= len; + } +} + /* * Verify cylinder group's magic number and other parameters. If the * test fails, offer an option to rebuild the whole cylinder group. Modified: head/sbin/fsck_ffs/main.c ============================================================================== --- head/sbin/fsck_ffs/main.c Mon Apr 29 20:09:44 2013 (r250055) +++ head/sbin/fsck_ffs/main.c Mon Apr 29 20:13:09 2013 (r250056) @@ -82,7 +82,7 @@ main(int argc, char *argv[]) sync(); skipclean = 1; inoopt = 0; - while ((ch = getopt(argc, argv, "b:Bc:CdEfFm:npry")) != -1) { + while ((ch = getopt(argc, argv, "b:Bc:CdEfFm:npryZ")) != -1) { switch (ch) { case 'b': skipclean = 0; @@ -147,6 +147,10 @@ main(int argc, char *argv[]) nflag = 0; break; + case 'Z': + Zflag++; + break; + default: usage(); } Modified: head/sbin/fsck_ffs/pass5.c ============================================================================== --- head/sbin/fsck_ffs/pass5.c Mon Apr 29 20:09:44 2013 (r250055) +++ head/sbin/fsck_ffs/pass5.c Mon Apr 29 20:13:09 2013 (r250056) @@ -252,7 +252,7 @@ pass5(void) frags = 0; for (j = 0; j < fs->fs_frag; j++) { if (testbmap(d + j)) { - if (Eflag && start != -1) { + if ((Eflag || Zflag) && start != -1) { clear_blocks(start, d + j - 1); start = -1; } @@ -274,7 +274,7 @@ pass5(void) ffs_fragacct(fs, blk, newcg->cg_frsum, 1); } } - if (Eflag && start != -1) + if ((Eflag || Zflag) && start != -1) clear_blocks(start, d - 1); if (fs->fs_contigsumsize > 0) { int32_t *sump = cg_clustersum(newcg); @@ -586,6 +586,10 @@ static void clear_blocks(ufs2_daddr_t st if (debug) printf("Zero frags %jd to %jd\n", start, end); - blerase(fswritefd, fsbtodb(&sblock, start), - lfragtosize(&sblock, end - start + 1)); + if (Zflag) + blzero(fswritefd, fsbtodb(&sblock, start), + lfragtosize(&sblock, end - start + 1)); + if (Eflag) + blerase(fswritefd, fsbtodb(&sblock, start), + lfragtosize(&sblock, end - start + 1)); } From owner-svn-src-head@FreeBSD.ORG Mon Apr 29 20:14:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3900799D; Mon, 29 Apr 2013 20:14:12 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 11EAF1D3B; Mon, 29 Apr 2013 20:14:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TKEBT5065384; Mon, 29 Apr 2013 20:14:11 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TKEB6L065383; Mon, 29 Apr 2013 20:14:11 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201304292014.r3TKEB6L065383@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 29 Apr 2013 20:14:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250057 - head/sbin/fsck_ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 20:14:12 -0000 Author: des Date: Mon Apr 29 20:14:11 2013 New Revision: 250057 URL: http://svnweb.freebsd.org/changeset/base/250057 Log: Style nit. Modified: head/sbin/fsck_ffs/pass5.c Modified: head/sbin/fsck_ffs/pass5.c ============================================================================== --- head/sbin/fsck_ffs/pass5.c Mon Apr 29 20:13:09 2013 (r250056) +++ head/sbin/fsck_ffs/pass5.c Mon Apr 29 20:14:11 2013 (r250057) @@ -581,7 +581,8 @@ check_maps( } } -static void clear_blocks(ufs2_daddr_t start, ufs2_daddr_t end) +static void +clear_blocks(ufs2_daddr_t start, ufs2_daddr_t end) { if (debug) From owner-svn-src-head@FreeBSD.ORG Mon Apr 29 21:12:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2D088DA3; Mon, 29 Apr 2013 21:12:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7157112D0; Mon, 29 Apr 2013 21:12:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TLCQ85091168; Mon, 29 Apr 2013 21:12:26 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TLCQQh091167; Mon, 29 Apr 2013 21:12:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304292112.r3TLCQQh091167@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 29 Apr 2013 21:12:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250075 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 21:12:27 -0000 Author: kib Date: Mon Apr 29 21:12:25 2013 New Revision: 250075 URL: http://svnweb.freebsd.org/changeset/base/250075 Log: Properly terminate the result string for intermediate results, to allow the final strcpy() to start at the intended place. Reported and tested by: pgj Pointy hat to: kib MFC after: 3 days Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Mon Apr 29 21:12:18 2013 (r250074) +++ head/libexec/rtld-elf/rtld.c Mon Apr 29 21:12:25 2013 (r250075) @@ -784,7 +784,7 @@ origin_subst_one(char *real, const char /* * Now, execute the substitution loop. */ - for (p = real, resp = res;;) { + for (p = real, resp = res, *resp = '\0';;) { p1 = strstr(p, kw); if (p1 != NULL) { /* Copy the prefix before keyword. */ @@ -793,6 +793,7 @@ origin_subst_one(char *real, const char /* Keyword replacement. */ memcpy(resp, subst, subst_len); resp += subst_len; + *resp = '\0'; p = p1 + kw_len; } else break; From owner-svn-src-head@FreeBSD.ORG Mon Apr 29 22:48:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 65E398F3; Mon, 29 Apr 2013 22:48:54 +0000 (UTC) (envelope-from carl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 47BBE1CE4; Mon, 29 Apr 2013 22:48:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TMmsqW027093; Mon, 29 Apr 2013 22:48:54 GMT (envelope-from carl@svn.freebsd.org) Received: (from carl@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TMmrqT027087; Mon, 29 Apr 2013 22:48:53 GMT (envelope-from carl@svn.freebsd.org) Message-Id: <201304292248.r3TMmrqT027087@svn.freebsd.org> From: Carl Delsey Date: Mon, 29 Apr 2013 22:48:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250079 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/ntb sys/dev/ntb/if_ntb sys/dev/ntb/ntb_hw sys/modules sys/modules/ntb sys/modules/ntb/if_ntb sys/modules/ntb/ntb_hw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 22:48:54 -0000 Author: carl Date: Mon Apr 29 22:48:53 2013 New Revision: 250079 URL: http://svnweb.freebsd.org/changeset/base/250079 Log: Add a new driver to support the Intel Non-Transparent Bridge(NTB). The NTB allows you to connect two systems with this device using a PCI-e link. The driver is made of two modules: - ntb_hw which is a basic hardware abstraction layer for the device. - if_ntb which implements the ntb network device and the communication protocol. The driver is limited at the moment to CPU memcpy instead of using DMA, and only Back-to-Back mode is supported. Also the network device isn't full featured yet. These changes will be coming soon. The DMA change will also bring in the ioat driver from the project branch it is on now. This is an initial port of the GPL/BSD Linux driver contributed by Jon Mason from Intel. Any bugs are my contributions. Sponsored by: Intel Reviewed by: jimharris, joel (man page only) Approved by: jimharris (mentor) Added: head/share/man/man4/ntb.4 (contents, props changed) head/sys/dev/ntb/ head/sys/dev/ntb/if_ntb/ head/sys/dev/ntb/if_ntb/if_ntb.c (contents, props changed) head/sys/dev/ntb/ntb_hw/ head/sys/dev/ntb/ntb_hw/ntb_hw.c (contents, props changed) head/sys/dev/ntb/ntb_hw/ntb_hw.h (contents, props changed) head/sys/dev/ntb/ntb_hw/ntb_regs.h (contents, props changed) head/sys/modules/ntb/ head/sys/modules/ntb/Makefile (contents, props changed) head/sys/modules/ntb/if_ntb/ head/sys/modules/ntb/if_ntb/Makefile (contents, props changed) head/sys/modules/ntb/ntb_hw/ head/sys/modules/ntb/ntb_hw/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/amd64/conf/NOTES head/sys/conf/files.amd64 head/sys/modules/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon Apr 29 21:49:22 2013 (r250078) +++ head/share/man/man4/Makefile Mon Apr 29 22:48:53 2013 (r250079) @@ -333,6 +333,7 @@ MAN= aac.4 \ ng_vlan.4 \ nmdm.4 \ nsp.4 \ + ${_ntb.4} \ null.4 \ ${_nvd.4} \ ${_nve.4} \ @@ -647,6 +648,7 @@ MLINKS+=netintro.4 net.4 \ netintro.4 networking.4 MLINKS+=${_nfe.4} ${_if_nfe.4} MLINKS+=nge.4 if_nge.4 +MLINKS+=${_ntb.4} ${_if_ntb.4} ${_ntb_hw.4} MLINKS+=${_nve.4} ${_if_nve.4} MLINKS+=${_nxge.4} ${_if_nxge.4} MLINKS+=patm.4 if_patm.4 @@ -784,6 +786,9 @@ MLINKS+=lindev.4 full.4 .if ${MACHINE_CPUARCH} == "amd64" _bhyve.4= bhyve.4 +_if_ntb.4= if_ntb.4 +_ntb.4= ntb.4 +_ntb_hw.4= ntb_hw.4 _qlxgb.4= qlxgb.4 _sfxge.4= sfxge.4 Added: head/share/man/man4/ntb.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/ntb.4 Mon Apr 29 22:48:53 2013 (r250079) @@ -0,0 +1,114 @@ +.\" +.\" Copyright (c) 2013 Intel Corporation +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions, and the following disclaimer, +.\" without modification. +.\" 2. Redistributions in binary form must reproduce at minimum a disclaimer +.\" substantially similar to the "NO WARRANTY" disclaimer below +.\" ("Disclaimer") and any redistribution must be conditioned upon +.\" including a substantially similar Disclaimer requirement for further +.\" binary redistribution. +.\" +.\" NO WARRANTY +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR +.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +.\" HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. +.\" +.\" ntb driver man page. +.\" +.\" Author: Carl Delsey +.\" +.\" $FreeBSD$ +.\" +.Dd Apr 11, 2013 +.Dt NTB 4 +.Os +.Sh NAME +.Nm ntb , +.Nm ntb_hw , +.Nm if_ntb +.Nd Intel(R) Non-Transparent Bridge driver +.Sh SYNOPSIS +To compile this driver into your kernel, +place the following lines in your kernel configuration file: +.Bd -ragged -offset indent +.Cd "device ntb_hw" +.Cd "device if_ntb" +.Ed +.Pp +Or, to load the driver as a module at boot, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_ntb_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the Non-Transparent Bridge (NTB) in the Intel S1200, +Xeon E3 and Xeon E5 processor families. +.Pp +The NTB allows you to connect two computer systems using a PCI-e link if they +have the correct equipment and connectors. +.Sh CONFIGURATION +The NTB memory windows need to be configured by the BIOS. +If your BIOS allows you to set their size, you should set the size of both +memory windows to 1 MiB. +This needs to be done on both systems. +.Pp +Each system needs to have a different IP address assigned. +The MAC address is randomly generated. +Also for maximum performance, the MTU should be set to 16 kiB. +This can be down by adding the line below to +.Xr rc.conf 5 : +.Bd -literal -offset indent +ifconfig_ntb0="inet 192.168.1.10 netmask 255.255.255.0 mtu 16384" +.Ed +.Pp +And on the second system : +.Bd -literal -offset indent +ifconfig_ntb0="inet 192.168.1.11 netmask 255.255.255.0 mtu 16384" +.Ed +.Pp +If you are using the UDP protocol, you may want to increase the +.Va net.inet.udp.maxdgram +.Xr sysctl 8 +variable. +.Sh SEE ALSO +.Xr rc.conf 5 , +.Xr sysctl 8 +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was developed by Intel and originally written by +.An Carl Delsey Aq carl@FreeBSD.org. +.Sh BUGS +If the driver is unloaded, it cannot be reloaded without a system reboot. +.Pp +The network support is limited. +It isn't fully configurable yet. +It also isn't integrated into +.Xr netgraph 4 +or +.Xr bpf 4 . +.Pp +NTB to Root Port mode is not yet supported. +.Pp +There is no way to protect your system from malicious behavior on the other +system once the link is brought up. +Anyone with root or kernel access on the other system can read or write to +any location on your system. +In other words, only connect two systems that completely trust each other. Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Mon Apr 29 21:49:22 2013 (r250078) +++ head/sys/amd64/conf/NOTES Mon Apr 29 22:48:53 2013 (r250079) @@ -366,6 +366,10 @@ device iwn6000fw device iwn6050fw device wpifw +# Intel Non-Transparent Bridge (NTB) hardware +device ntb_hw # Hardware Abstraction Layer for the NTB +device if_ntb # Simulated ethernet device using the NTB + # #XXX this stores pointers in a 32bit field that is defined by the hardware #device pst Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Mon Apr 29 21:49:22 2013 (r250078) +++ head/sys/conf/files.amd64 Mon Apr 29 22:48:53 2013 (r250079) @@ -211,6 +211,8 @@ dev/kbd/kbd.c optional atkbd | sc | uk dev/lindev/full.c optional lindev dev/lindev/lindev.c optional lindev dev/nfe/if_nfe.c optional nfe pci +dev/ntb/if_ntb/if_ntb.c optional if_ntb +dev/ntb/ntb_hw/ntb_hw.c optional if_ntb ntb_hw dev/nvd/nvd.c optional nvd nvme dev/nve/if_nve.c optional nve pci dev/nvme/nvme.c optional nvme Added: head/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ntb/if_ntb/if_ntb.c Mon Apr 29 22:48:53 2013 (r250079) @@ -0,0 +1,1366 @@ +/*- + * Copyright (C) 2013 Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../ntb_hw/ntb_hw.h" + +/* + * The Non-Transparent Bridge (NTB) is a device on some Intel processors that + * allows you to connect two systems using a PCI-e link. + * + * This module contains a protocol for sending and receiving messages, and + * exposes that protocol through a simulated ethernet device called ntb. + * + * NOTE: Much of the code in this module is shared with Linux. Any patches may + * be picked up and redistributed in Linux with a dual GPL/BSD license. + */ + +/* TODO: These functions should really be part of the kernel */ +#define test_bit(pos, bitmap_addr) (*(bitmap_addr) & 1UL << (pos)) +#define set_bit(pos, bitmap_addr) *(bitmap_addr) |= 1UL << (pos) +#define clear_bit(pos, bitmap_addr) *(bitmap_addr) &= ~(1UL << (pos)) + +#define KTR_NTB KTR_SPARE3 + +#define NTB_TRANSPORT_VERSION 3 +#define NTB_RX_MAX_PKTS 64 +#define NTB_RXQ_SIZE 300 + +static unsigned int transport_mtu = 0x4000 + ETHER_HDR_LEN + ETHER_CRC_LEN; +static unsigned int max_num_clients = 1; + +STAILQ_HEAD(ntb_queue_list, ntb_queue_entry); + +struct ntb_queue_entry { + /* ntb_queue list reference */ + STAILQ_ENTRY(ntb_queue_entry) entry; + + /* info on data to be transfered */ + void *cb_data; + void *buf; + uint64_t len; + uint64_t flags; +}; + +struct ntb_rx_info { + unsigned int entry; +}; + +struct ntb_transport_qp { + struct ntb_netdev *transport; + struct ntb_softc *ntb; + + void *cb_data; + + bool client_ready; + bool qp_link; + uint8_t qp_num; /* Only 64 QP's are allowed. 0-63 */ + + struct ntb_rx_info *rx_info; + struct ntb_rx_info *remote_rx_info; + + void (*tx_handler) (struct ntb_transport_qp *qp, void *qp_data, + void *data, int len); + struct ntb_queue_list tx_free_q; + struct mtx ntb_tx_free_q_lock; + void *tx_mw; + uint64_t tx_index; + uint64_t tx_max_entry; + uint64_t tx_max_frame; + + void (*rx_handler) (struct ntb_transport_qp *qp, void *qp_data, + void *data, int len); + struct ntb_queue_list rx_pend_q; + struct ntb_queue_list rx_free_q; + struct mtx ntb_rx_pend_q_lock; + struct mtx ntb_rx_free_q_lock; + struct task rx_completion_task; + void *rx_buff; + uint64_t rx_index; + uint64_t rx_max_entry; + uint64_t rx_max_frame; + + void (*event_handler) (void *data, int status); + struct callout link_work; + struct callout queue_full; + struct callout rx_full; + + uint64_t last_rx_no_buf; + + /* Stats */ + uint64_t rx_bytes; + uint64_t rx_pkts; + uint64_t rx_ring_empty; + uint64_t rx_err_no_buf; + uint64_t rx_err_oflow; + uint64_t rx_err_ver; + uint64_t tx_bytes; + uint64_t tx_pkts; + uint64_t tx_ring_full; +}; + +struct ntb_queue_handlers { + void (*rx_handler) (struct ntb_transport_qp *qp, void *qp_data, + void *data, int len); + void (*tx_handler) (struct ntb_transport_qp *qp, void *qp_data, + void *data, int len); + void (*event_handler) (void *data, int status); +}; + + +struct ntb_transport_mw { + size_t size; + void *virt_addr; + vm_paddr_t dma_addr; +}; + +struct ntb_netdev { + struct ntb_softc *ntb; + struct ifnet *ifp; + struct ntb_transport_mw mw[NTB_NUM_MW]; + struct ntb_transport_qp *qps; + uint64_t max_qps; + uint64_t qp_bitmap; + bool transport_link; + struct callout link_work; + struct ntb_transport_qp *qp; + uint64_t bufsize; + u_char eaddr[ETHER_ADDR_LEN]; + struct mtx tx_lock; + struct mtx rx_lock; +}; + +static struct ntb_netdev net_softc; + +enum { + IF_NTB_DESC_DONE_FLAG = 1 << 0, + IF_NTB_LINK_DOWN_FLAG = 1 << 1, +}; + +struct ntb_payload_header { + uint64_t ver; + uint64_t len; + uint64_t flags; +}; + +enum { + IF_NTB_VERSION = 0, + IF_NTB_MW0_SZ, + IF_NTB_MW1_SZ, + IF_NTB_NUM_QPS, + IF_NTB_QP_LINKS, + IF_NTB_MAX_SPAD, +}; + +#define QP_TO_MW(qp) ((qp) % NTB_NUM_MW) +#define NTB_QP_DEF_NUM_ENTRIES 100 +#define NTB_LINK_DOWN_TIMEOUT 10 + +static int ntb_handle_module_events(struct module *m, int what, void *arg); +static int ntb_setup_interface(void); +static int ntb_teardown_interface(void); +static void ntb_net_init(void *arg); +static int ntb_ioctl(struct ifnet *ifp, u_long command, caddr_t data); +static void ntb_start(struct ifnet *ifp); +static void ntb_net_tx_handler(struct ntb_transport_qp *qp, void *qp_data, + void *data, int len); +static void ntb_net_rx_handler(struct ntb_transport_qp *qp, void *qp_data, + void *data, int len); +static void ntb_net_event_handler(void *data, int status); +static int ntb_transport_init(struct ntb_softc *ntb); +static void ntb_transport_free(void *transport); +static void ntb_transport_init_queue(struct ntb_netdev *nt, + unsigned int qp_num); +static void ntb_transport_free_queue(struct ntb_transport_qp *qp); +static struct ntb_transport_qp * ntb_transport_create_queue(void *data, + struct ntb_softc *pdev, const struct ntb_queue_handlers *handlers); +static void ntb_transport_link_up(struct ntb_transport_qp *qp); +static int ntb_transport_tx_enqueue(struct ntb_transport_qp *qp, void *cb, + void *data, unsigned int len); +static int ntb_process_tx(struct ntb_transport_qp *qp, + struct ntb_queue_entry *entry); +static void ntb_tx_copy_task(struct ntb_transport_qp *qp, + struct ntb_queue_entry *entry, void *offset); +static void ntb_qp_full(void *arg); +static void ntb_transport_rxc_db(void *data, int db_num); +static void ntb_rx_pendq_full(void *arg); +static void ntb_transport_rx(struct ntb_transport_qp *qp); +static int ntb_process_rxc(struct ntb_transport_qp *qp); +static void ntb_rx_copy_task(struct ntb_transport_qp *qp, + struct ntb_queue_entry *entry, void *offset); +static void ntb_rx_completion_task(void *arg, int pending); +static void ntb_transport_event_callback(void *data, enum ntb_hw_event event); +static void ntb_transport_link_work(void *arg); +static int ntb_set_mw(struct ntb_netdev *nt, int num_mw, unsigned int size); +static void ntb_transport_setup_qp_mw(struct ntb_netdev *nt, + unsigned int qp_num); +static void ntb_qp_link_work(void *arg); +static void ntb_transport_link_cleanup(struct ntb_netdev *nt); +static void ntb_qp_link_down(struct ntb_transport_qp *qp); +static void ntb_qp_link_cleanup(struct ntb_transport_qp *qp); +static void ntb_transport_link_down(struct ntb_transport_qp *qp); +static void ntb_send_link_down(struct ntb_transport_qp *qp); +static void ntb_list_add(struct mtx *lock, struct ntb_queue_entry *entry, + struct ntb_queue_list *list); +static struct ntb_queue_entry *ntb_list_rm(struct mtx *lock, + struct ntb_queue_list *list); +static void create_random_local_eui48(u_char *eaddr); +static unsigned int ntb_transport_max_size(struct ntb_transport_qp *qp); + +MALLOC_DEFINE(M_NTB_IF, "if_ntb", "ntb network driver"); + +/* Module setup and teardown */ +static int +ntb_handle_module_events(struct module *m, int what, void *arg) +{ + int err = 0; + + switch (what) { + case MOD_LOAD: + err = ntb_setup_interface(); + break; + case MOD_UNLOAD: + err = ntb_teardown_interface(); + break; + default: + err = EOPNOTSUPP; + break; + } + return (err); +} + +static moduledata_t ntb_transport_mod = { + "ntb_transport", + ntb_handle_module_events, + NULL +}; + +DECLARE_MODULE(ntb_transport, ntb_transport_mod, SI_SUB_KLD, SI_ORDER_ANY); +MODULE_DEPEND(ntb_transport, ntb_hw, 1, 1, 1); + +static int +ntb_setup_interface() +{ + struct ifnet *ifp; + struct ntb_queue_handlers handlers = { ntb_net_rx_handler, + ntb_net_tx_handler, ntb_net_event_handler }; + + net_softc.ntb = devclass_get_softc(devclass_find("ntb_hw"), 0); + if (net_softc.ntb == NULL) { + printf("ntb: Can't find devclass\n"); + return (ENXIO); + } + + ntb_transport_init(net_softc.ntb); + + ifp = net_softc.ifp = if_alloc(IFT_ETHER); + if (ifp == NULL) { + printf("ntb: cannot allocate ifnet structure\n"); + return (ENOMEM); + } + + net_softc.qp = ntb_transport_create_queue(ifp, net_softc.ntb, + &handlers); + if_initname(ifp, "ntb", 0); + ifp->if_init = ntb_net_init; + ifp->if_softc = &net_softc; + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX; + ifp->if_ioctl = ntb_ioctl; + ifp->if_start = ntb_start; + IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); + ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; + IFQ_SET_READY(&ifp->if_snd); + create_random_local_eui48(net_softc.eaddr); + ether_ifattach(ifp, net_softc.eaddr); + ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_JUMBO_MTU; + ifp->if_capenable = ifp->if_capabilities; + + ntb_transport_link_up(net_softc.qp); + net_softc.bufsize = ntb_transport_max_size(net_softc.qp) + + sizeof(struct ether_header); + return (0); +} + +static int +ntb_teardown_interface() +{ + struct ifnet *ifp = net_softc.ifp; + + ntb_transport_link_down(net_softc.qp); + + ether_ifdetach(ifp); + if_free(ifp); + ntb_transport_free_queue(net_softc.qp); + ntb_transport_free(&net_softc); + + return (0); +} + +/* Network device interface */ + +static void +ntb_net_init(void *arg) +{ + struct ntb_netdev *ntb_softc = arg; + struct ifnet *ifp = ntb_softc->ifp; + + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + ifp->if_flags |= IFF_UP; + if_link_state_change(ifp, LINK_STATE_UP); +} + +static int +ntb_ioctl(struct ifnet *ifp, u_long command, caddr_t data) +{ + struct ntb_netdev *nt = ifp->if_softc; + struct ifreq *ifr = (struct ifreq *)data; + int error = 0; + + switch (command) { + case SIOCSIFMTU: + { + if (ifr->ifr_mtu > ntb_transport_max_size(nt->qp) - + ETHER_HDR_LEN - ETHER_CRC_LEN) { + error = EINVAL; + break; + } + + ifp->if_mtu = ifr->ifr_mtu; + break; + } + default: + error = ether_ioctl(ifp, command, data); + break; + } + + return (error); +} + + +static void +ntb_start(struct ifnet *ifp) +{ + struct mbuf *m_head; + struct ntb_netdev *nt = ifp->if_softc; + int rc; + + mtx_lock(&nt->tx_lock); + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + CTR0(KTR_NTB, "TX: ntb_start"); + while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { + IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); + CTR1(KTR_NTB, "TX: start mbuf %p", m_head); + rc = ntb_transport_tx_enqueue(nt->qp, m_head, m_head, + m_length(m_head, NULL)); + if (rc != 0) { + CTR1(KTR_NTB, + "TX: couldn't tx mbuf %p. Returning to snd q", + m_head); + if (rc == EAGAIN) { + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + IFQ_DRV_PREPEND(&ifp->if_snd, m_head); + callout_reset(&nt->qp->queue_full, hz / 1000, + ntb_qp_full, ifp); + } + break; + } + + } + mtx_unlock(&nt->tx_lock); +} + +/* Network Device Callbacks */ +static void +ntb_net_tx_handler(struct ntb_transport_qp *qp, void *qp_data, void *data, + int len) +{ + + m_freem(data); + CTR1(KTR_NTB, "TX: tx_handler freeing mbuf %p", data); +} + +static void +ntb_net_rx_handler(struct ntb_transport_qp *qp, void *qp_data, void *data, + int len) +{ + struct mbuf *m = data; + struct ifnet *ifp = qp_data; + + CTR0(KTR_NTB, "RX: rx handler"); + (*ifp->if_input)(ifp, m); +} + +static void +ntb_net_event_handler(void *data, int status) +{ + +} + +/* Transport Init and teardown */ + +static int +ntb_transport_init(struct ntb_softc *ntb) +{ + struct ntb_netdev *nt = &net_softc; + int rc, i; + + nt->max_qps = max_num_clients; + ntb_register_transport(ntb, nt); + mtx_init(&nt->tx_lock, "ntb transport tx", NULL, MTX_DEF); + mtx_init(&nt->rx_lock, "ntb transport rx", NULL, MTX_DEF); + + nt->qps = malloc(nt->max_qps * sizeof(struct ntb_transport_qp), + M_NTB_IF, M_WAITOK|M_ZERO); + + nt->qp_bitmap = ((uint64_t) 1 << nt->max_qps) - 1; + + for (i = 0; i < nt->max_qps; i++) + ntb_transport_init_queue(nt, i); + + callout_init(&nt->link_work, 0); + + rc = ntb_register_event_callback(ntb, + ntb_transport_event_callback); + if (rc != 0) + goto err; + + if (ntb_query_link_status(ntb)) + callout_reset(&nt->link_work, 0, ntb_transport_link_work, nt); + + return (0); + +err: + free(nt->qps, M_NTB_IF); + ntb_unregister_transport(ntb); + return (rc); +} + +static void +ntb_transport_free(void *transport) +{ + struct ntb_netdev *nt = transport; + struct ntb_softc *ntb = nt->ntb; + int i; + + nt->transport_link = NTB_LINK_DOWN; + + callout_drain(&nt->link_work); + + /* verify that all the qp's are freed */ + for (i = 0; i < nt->max_qps; i++) + if (!test_bit(i, &nt->qp_bitmap)) + ntb_transport_free_queue(&nt->qps[i]); + + + ntb_unregister_event_callback(ntb); + + for (i = 0; i < NTB_NUM_MW; i++) + if (nt->mw[i].virt_addr != NULL) + contigfree(nt->mw[i].virt_addr, nt->mw[i].size, + M_NTB_IF); + + free(nt->qps, M_NTB_IF); + ntb_unregister_transport(ntb); +} + +static void +ntb_transport_init_queue(struct ntb_netdev *nt, unsigned int qp_num) +{ + struct ntb_transport_qp *qp; + unsigned int num_qps_mw, tx_size; + uint8_t mw_num = QP_TO_MW(qp_num); + + qp = &nt->qps[qp_num]; + qp->qp_num = qp_num; + qp->transport = nt; + qp->ntb = nt->ntb; + qp->qp_link = NTB_LINK_DOWN; + qp->client_ready = NTB_LINK_DOWN; + qp->event_handler = NULL; + + if (nt->max_qps % NTB_NUM_MW && mw_num < nt->max_qps % NTB_NUM_MW) + num_qps_mw = nt->max_qps / NTB_NUM_MW + 1; + else + num_qps_mw = nt->max_qps / NTB_NUM_MW; + + tx_size = (unsigned int) ntb_get_mw_size(qp->ntb, mw_num) / num_qps_mw; + qp->rx_info = (struct ntb_rx_info *) + ((char *)ntb_get_mw_vbase(qp->ntb, mw_num) + + (qp_num / NTB_NUM_MW * tx_size)); + tx_size -= sizeof(struct ntb_rx_info); + + qp->tx_mw = qp->rx_info + sizeof(struct ntb_rx_info); + qp->tx_max_frame = min(transport_mtu + sizeof(struct ntb_payload_header), + tx_size); + qp->tx_max_entry = tx_size / qp->tx_max_frame; + qp->tx_index = 0; + + callout_init(&qp->link_work, 0); + callout_init(&qp->queue_full, CALLOUT_MPSAFE); + callout_init(&qp->rx_full, CALLOUT_MPSAFE); + + mtx_init(&qp->ntb_rx_pend_q_lock, "ntb rx pend q", NULL, MTX_SPIN); + mtx_init(&qp->ntb_rx_free_q_lock, "ntb rx free q", NULL, MTX_SPIN); + mtx_init(&qp->ntb_tx_free_q_lock, "ntb tx free q", NULL, MTX_SPIN); + TASK_INIT(&qp->rx_completion_task, 0, ntb_rx_completion_task, qp); + + STAILQ_INIT(&qp->rx_pend_q); + STAILQ_INIT(&qp->rx_free_q); + STAILQ_INIT(&qp->tx_free_q); +} + +static void +ntb_transport_free_queue(struct ntb_transport_qp *qp) +{ + struct ntb_queue_entry *entry; + + if (qp == NULL) + return; + + callout_drain(&qp->link_work); + + ntb_unregister_db_callback(qp->ntb, qp->qp_num); + + while ((entry = ntb_list_rm(&qp->ntb_rx_free_q_lock, &qp->rx_free_q))) + free(entry, M_NTB_IF); + + while ((entry = ntb_list_rm(&qp->ntb_rx_pend_q_lock, &qp->rx_pend_q))) + free(entry, M_NTB_IF); + + while ((entry = ntb_list_rm(&qp->ntb_tx_free_q_lock, &qp->tx_free_q))) + free(entry, M_NTB_IF); + + set_bit(qp->qp_num, &qp->transport->qp_bitmap); +} + +/** + * ntb_transport_create_queue - Create a new NTB transport layer queue + * @rx_handler: receive callback function + * @tx_handler: transmit callback function + * @event_handler: event callback function + * + * Create a new NTB transport layer queue and provide the queue with a callback + * routine for both transmit and receive. The receive callback routine will be + * used to pass up data when the transport has received it on the queue. The + * transmit callback routine will be called when the transport has completed the + * transmission of the data on the queue and the data is ready to be freed. + * + * RETURNS: pointer to newly created ntb_queue, NULL on error. + */ +static struct ntb_transport_qp * +ntb_transport_create_queue(void *data, struct ntb_softc *pdev, + const struct ntb_queue_handlers *handlers) +{ + struct ntb_queue_entry *entry; + struct ntb_transport_qp *qp; + struct ntb_netdev *nt; + unsigned int free_queue; + int rc, i; + + nt = ntb_find_transport(pdev); + if (nt == NULL) + goto err; + + free_queue = ffs(nt->qp_bitmap); + if (free_queue == 0) + goto err; + + /* decrement free_queue to make it zero based */ + free_queue--; + + clear_bit(free_queue, &nt->qp_bitmap); + + qp = &nt->qps[free_queue]; + qp->cb_data = data; + qp->rx_handler = handlers->rx_handler; + qp->tx_handler = handlers->tx_handler; + qp->event_handler = handlers->event_handler; + + for (i = 0; i < NTB_QP_DEF_NUM_ENTRIES; i++) { + entry = malloc(sizeof(struct ntb_queue_entry), M_NTB_IF, + M_WAITOK|M_ZERO); + entry->cb_data = nt->ifp; + entry->buf = NULL; + entry->len = transport_mtu; + ntb_list_add(&qp->ntb_rx_pend_q_lock, entry, &qp->rx_pend_q); + } + + for (i = 0; i < NTB_QP_DEF_NUM_ENTRIES; i++) { + entry = malloc(sizeof(struct ntb_queue_entry), M_NTB_IF, + M_WAITOK|M_ZERO); + ntb_list_add(&qp->ntb_tx_free_q_lock, entry, &qp->tx_free_q); + } + + rc = ntb_register_db_callback(qp->ntb, free_queue, qp, + ntb_transport_rxc_db); + if (rc != 0) + goto err1; + + return (qp); + +err1: + while ((entry = ntb_list_rm(&qp->ntb_tx_free_q_lock, &qp->tx_free_q))) + free(entry, M_NTB_IF); + while ((entry = ntb_list_rm(&qp->ntb_rx_free_q_lock, &qp->rx_free_q))) + free(entry, M_NTB_IF); + set_bit(free_queue, &nt->qp_bitmap); +err: + return (NULL); +} + +/** + * ntb_transport_link_up - Notify NTB transport of client readiness to use queue + * @qp: NTB transport layer queue to be enabled + * + * Notify NTB transport layer of client readiness to use queue + */ +static void +ntb_transport_link_up(struct ntb_transport_qp *qp) +{ + + if (qp == NULL) + return; + + qp->client_ready = NTB_LINK_UP; + + if (qp->transport->transport_link == NTB_LINK_UP) + callout_reset(&qp->link_work, 0, ntb_qp_link_work, qp); +} + + + +/* Transport Tx */ + +/** + * ntb_transport_tx_enqueue - Enqueue a new NTB queue entry + * @qp: NTB transport layer queue the entry is to be enqueued on + * @cb: per buffer pointer for callback function to use + * @data: pointer to data buffer that will be sent + * @len: length of the data buffer + * + * Enqueue a new transmit buffer onto the transport queue from which a NTB + * payload will be transmitted. This assumes that a lock is behing held to + * serialize access to the qp. + * + * RETURNS: An appropriate ERRNO error value on error, or zero for success. + */ +static int +ntb_transport_tx_enqueue(struct ntb_transport_qp *qp, void *cb, void *data, + unsigned int len) +{ + struct ntb_queue_entry *entry; + int rc; + + if (qp == NULL || qp->qp_link != NTB_LINK_UP || len == 0) { + CTR0(KTR_NTB, "TX: link not up"); + return (EINVAL); + } + + entry = ntb_list_rm(&qp->ntb_tx_free_q_lock, &qp->tx_free_q); + if (entry == NULL) { + CTR0(KTR_NTB, "TX: couldn't get entry from tx_free_q"); + return (ENOMEM); + } + CTR1(KTR_NTB, "TX: got entry %p from tx_free_q", entry); + + entry->cb_data = cb; + entry->buf = data; + entry->len = len; + entry->flags = 0; + + rc = ntb_process_tx(qp, entry); + if (rc != 0) { + ntb_list_add(&qp->ntb_tx_free_q_lock, entry, &qp->tx_free_q); + CTR1(KTR_NTB, + "TX: process_tx failed. Returning entry %p to tx_free_q", + entry); + } + return (rc); +} + +static int +ntb_process_tx(struct ntb_transport_qp *qp, struct ntb_queue_entry *entry) +{ + void *offset; + + offset = (char *)qp->tx_mw + qp->tx_max_frame * qp->tx_index; + CTR3(KTR_NTB, + "TX: process_tx: tx_pkts=%u, tx_index=%u, remote entry=%u", + qp->tx_pkts, qp->tx_index, qp->remote_rx_info->entry); + if (qp->tx_index == qp->remote_rx_info->entry) { + CTR0(KTR_NTB, "TX: ring full"); + qp->tx_ring_full++; + return (EAGAIN); + } + + if (entry->len > qp->tx_max_frame - sizeof(struct ntb_payload_header)) { + if (qp->tx_handler != NULL) + qp->tx_handler(qp, qp->cb_data, entry->buf, + EIO); + + ntb_list_add(&qp->ntb_tx_free_q_lock, entry, &qp->tx_free_q); + CTR1(KTR_NTB, + "TX: frame too big. returning entry %p to tx_free_q", + entry); + return (0); + } + CTR2(KTR_NTB, "TX: copying entry %p to offset %p", entry, offset); + ntb_tx_copy_task(qp, entry, offset); + + qp->tx_index++; + qp->tx_index %= qp->tx_max_entry; + + qp->tx_pkts++; + + return (0); +} + +static void +ntb_tx_copy_task(struct ntb_transport_qp *qp, struct ntb_queue_entry *entry, + void *offset) +{ + struct ntb_payload_header *hdr; + + CTR2(KTR_NTB, "TX: copying %d bytes to offset %p", entry->len, offset); + if (entry->buf != NULL) + m_copydata((struct mbuf *)entry->buf, 0, entry->len, offset); + + hdr = (struct ntb_payload_header *)((char *)offset + qp->tx_max_frame - + sizeof(struct ntb_payload_header)); + hdr->len = entry->len; /* TODO: replace with bus_space_write */ + hdr->ver = qp->tx_pkts; /* TODO: replace with bus_space_write */ + wmb(); + /* TODO: replace with bus_space_write */ + hdr->flags = entry->flags | IF_NTB_DESC_DONE_FLAG; + + ntb_ring_sdb(qp->ntb, qp->qp_num); + + /* + * The entry length can only be zero if the packet is intended to be a + * "link down" or similar. Since no payload is being sent in these + * cases, there is nothing to add to the completion queue. + */ + if (entry->len > 0) { + qp->tx_bytes += entry->len; + + if (qp->tx_handler) + qp->tx_handler(qp, qp->cb_data, entry->cb_data, + entry->len); + } + + CTR2(KTR_NTB, + "TX: entry %p sent. hdr->ver = %d, Returning to tx_free_q", entry, + hdr->ver); + ntb_list_add(&qp->ntb_tx_free_q_lock, entry, &qp->tx_free_q); +} + +static void +ntb_qp_full(void *arg) +{ + + CTR0(KTR_NTB, "TX: qp_full callout"); + ntb_start(arg); +} + +/* Transport Rx */ +static void +ntb_transport_rxc_db(void *data, int db_num) +{ + struct ntb_transport_qp *qp = data; + + ntb_transport_rx(qp); +} + +static void +ntb_rx_pendq_full(void *arg) +{ + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Apr 29 22:56:42 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C8C44D2F; Mon, 29 Apr 2013 22:56:42 +0000 (UTC) (envelope-from ken@kdm.org) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) by mx1.freebsd.org (Postfix) with ESMTP id 78B551D47; Mon, 29 Apr 2013 22:56:42 +0000 (UTC) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.14.2/8.14.2) with ESMTP id r3TMufS1001935; Mon, 29 Apr 2013 16:56:41 -0600 (MDT) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id r3TMufnd001934; Mon, 29 Apr 2013 16:56:41 -0600 (MDT) (envelope-from ken) Date: Mon, 29 Apr 2013 16:56:41 -0600 From: "Kenneth D. Merry" To: Steven Hartland Subject: Re: svn commit: r249939 - head/sys/cam/scsi Message-ID: <20130429225641.GA1375@nargothrond.kdm.org> References: <201304261617.r3QGH58Q048395@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201304261617.r3QGH58Q048395@svn.freebsd.org> User-Agent: Mutt/1.4.2i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 22:56:42 -0000 On Fri, Apr 26, 2013 at 16:17:05 +0000, Steven Hartland wrote: > Author: smh > Date: Fri Apr 26 16:17:04 2013 > New Revision: 249939 > URL: http://svnweb.freebsd.org/changeset/base/249939 > > Log: > Added available delete methods discovery during device probe, including the > maximum sizes for said methods, which are used when processing BIO_DELETE > requests. This includes updating UNMAP support discovery to be based on > SBC-3 T10/1799-D Revision 31 specification. > > Added ATA TRIM support to cam scsi devices via ATA Pass-Through(16) > > sys/cam/scsi/scsi_da.c: > - Added ATA Data Set Management TRIM support via ATA Pass-Through(16) > as a delete_method > This adds a lot of unnecessary verbosity for devices that don't support ATA passthrough. For example: (da7:iscsi4:0:0:0): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 00 00 00 00 00 00 00 40 ec 00 (da7:iscsi4:0:0:0): CAM status: SCSI Status Error (da7:iscsi4:0:0:0): SCSI status: Check Condition (da7:iscsi4:0:0:0): Retrying command (per sense data) (2:2:0:0): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 00 00 00 00 00 00 00 40 ec 00 (2:2:0:0): Tag: 0x00f6, Type: 1 (2:2:0:0): CTL Status: SCSI Error (2:2:0:0): SCSI Status: Check Condition (2:2:0:0): SCSI sense: ILLEGAL REQUEST asc:20,0 (Invalid command operation code) (2:2:0:0): Command byte 0 is invalid (da8:iscsi4:0:0:1): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 00 00 00 00 00 00 00 40 ec 00 (da8:iscsi4:0:0:1): CAM status: SCSI Status Error (da8:iscsi4:0:0:1): SCSI status: Check Condition (da8:iscsi4:0:0:1): Retrying command (per sense data) (da8:iscsi4:0:0:1): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 00 00 00 00 00 00 00 40 ec 00 (da8:iscsi4:0:0:1): CAM status: SCSI Status Error (da8:iscsi4:0:0:1): SCSI status: Check Condition (da8:iscsi4:0:0:1): Error 5, Retries exhausted That is with CTL and and trasz's new iSCSI initiator, but you should see it with any CTL configuration. (And probably with any controller or device that doesn't support ATA passthrough.) So, please: - Check for the presence of VPD page 0x89 before sending an ATA passthrough command. The spec (sat3r03 in this case) says that it "shall" be implemented, so I think we can count on that. - If the target returns an illegal request sense key, don't retry again. The target will keep returning illegal request Ken -- Kenneth Merry ken@FreeBSD.ORG From owner-svn-src-head@FreeBSD.ORG Mon Apr 29 23:08:14 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 17369F86; Mon, 29 Apr 2013 23:08:14 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 096E41D9F; Mon, 29 Apr 2013 23:08:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TN8DvV034101; Mon, 29 Apr 2013 23:08:13 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TN8Dlj034100; Mon, 29 Apr 2013 23:08:13 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201304292308.r3TN8Dlj034100@svn.freebsd.org> From: "Justin T. Gibbs" Date: Mon, 29 Apr 2013 23:08:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250081 - head/sys/xen/xenstore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 23:08:14 -0000 Author: gibbs Date: Mon Apr 29 23:08:13 2013 New Revision: 250081 URL: http://svnweb.freebsd.org/changeset/base/250081 Log: xenstore/xenstore.c: Prevent access to invalid memory region when listing an empty directory in the XenStore. Reported by: Bei Guan MFC after: 1 week Modified: head/sys/xen/xenstore/xenstore.c Modified: head/sys/xen/xenstore/xenstore.c ============================================================================== --- head/sys/xen/xenstore/xenstore.c Mon Apr 29 22:54:26 2013 (r250080) +++ head/sys/xen/xenstore/xenstore.c Mon Apr 29 23:08:13 2013 (r250081) @@ -307,7 +307,8 @@ split(char *strings, u_int len, u_int *n const char **ret; /* Protect against unterminated buffers. */ - strings[len - 1] = '\0'; + if (len > 0) + strings[len - 1] = '\0'; /* Count the strings. */ *num = extract_strings(strings, /*dest*/NULL, len); From owner-svn-src-head@FreeBSD.ORG Mon Apr 29 23:20:05 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8710F3FA; Mon, 29 Apr 2013 23:20:05 +0000 (UTC) (envelope-from smh@freebsd.org) Received: from smtp1.multiplay.co.uk (smtp1.multiplay.co.uk [85.236.96.35]) by mx1.freebsd.org (Postfix) with ESMTP id 219971E0A; Mon, 29 Apr 2013 23:20:04 +0000 (UTC) Received: by smtp1.multiplay.co.uk (Postfix, from userid 65534) id 0E72C20E7088B; Mon, 29 Apr 2013 23:19:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.multiplay.co.uk X-Spam-Level: ** X-Spam-Status: No, score=2.7 required=8.0 tests=AWL,BAYES_00,DOS_OE_TO_MX, FSL_HELO_NON_FQDN_1,HELO_NO_DOMAIN,RDNS_DYNAMIC,STOX_REPLY_TYPE autolearn=no version=3.3.1 Received: from r2d2 (46-65-172-4.zone16.bethere.co.uk [46.65.172.4]) by smtp1.multiplay.co.uk (Postfix) with ESMTP id C8DC120E70886; Mon, 29 Apr 2013 23:19:31 +0000 (UTC) Message-ID: From: "Steven Hartland" To: "Kenneth D. Merry" References: <201304261617.r3QGH58Q048395@svn.freebsd.org> <20130429225641.GA1375@nargothrond.kdm.org> Subject: Re: svn commit: r249939 - head/sys/cam/scsi Date: Tue, 30 Apr 2013 00:20:07 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 23:20:05 -0000 ----- Original Message ----- From: "Kenneth D. Merry" To: "Steven Hartland" Cc: ; ; Sent: Monday, April 29, 2013 11:56 PM Subject: Re: svn commit: r249939 - head/sys/cam/scsi > On Fri, Apr 26, 2013 at 16:17:05 +0000, Steven Hartland wrote: >> Author: smh >> Date: Fri Apr 26 16:17:04 2013 >> New Revision: 249939 >> URL: http://svnweb.freebsd.org/changeset/base/249939 >> >> Log: >> Added available delete methods discovery during device probe, including the >> maximum sizes for said methods, which are used when processing BIO_DELETE >> requests. This includes updating UNMAP support discovery to be based on >> SBC-3 T10/1799-D Revision 31 specification. >> >> Added ATA TRIM support to cam scsi devices via ATA Pass-Through(16) >> >> sys/cam/scsi/scsi_da.c: >> - Added ATA Data Set Management TRIM support via ATA Pass-Through(16) >> as a delete_method >> > > This adds a lot of unnecessary verbosity for devices that don't support ATA > passthrough. For example: > > (da7:iscsi4:0:0:0): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 00 00 00 00 00 00 00 40 ec 00 > (da7:iscsi4:0:0:0): CAM status: SCSI Status Error > (da7:iscsi4:0:0:0): SCSI status: Check Condition > (da7:iscsi4:0:0:0): Retrying command (per sense data) > (2:2:0:0): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 00 00 00 00 00 00 00 40 ec 00 > (2:2:0:0): Tag: 0x00f6, Type: 1 > (2:2:0:0): CTL Status: SCSI Error > (2:2:0:0): SCSI Status: Check Condition > (2:2:0:0): SCSI sense: ILLEGAL REQUEST asc:20,0 (Invalid command operation code) > (2:2:0:0): Command byte 0 is invalid > > (da8:iscsi4:0:0:1): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 00 00 00 00 00 00 00 40 ec 00 > (da8:iscsi4:0:0:1): CAM status: SCSI Status Error > (da8:iscsi4:0:0:1): SCSI status: Check Condition > (da8:iscsi4:0:0:1): Retrying command (per sense data) > (da8:iscsi4:0:0:1): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 00 00 00 00 00 00 00 40 ec 00 > (da8:iscsi4:0:0:1): CAM status: SCSI Status Error > (da8:iscsi4:0:0:1): SCSI status: Check Condition > (da8:iscsi4:0:0:1): Error 5, Retries exhausted > > That is with CTL and and trasz's new iSCSI initiator, but you should see it > with any CTL configuration. (And probably with any controller or device > that doesn't support ATA passthrough.) > > So, please: > - Check for the presence of VPD page 0x89 before sending an ATA > passthrough command. The spec (sat3r03 in this case) says that > it "shall" be implemented, so I think we can count on that. > - If the target returns an illegal request sense key, don't retry > again. The target will keep returning illegal request Thanks for the report Ken I'll check this on a card I know doesn't support pass-through. Regards Steve From owner-svn-src-head@FreeBSD.ORG Mon Apr 29 23:57:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C856A99C; Mon, 29 Apr 2013 23:57:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B9D561F1F; Mon, 29 Apr 2013 23:57:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3TNvf0m051145; Mon, 29 Apr 2013 23:57:41 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3TNvfQi051144; Mon, 29 Apr 2013 23:57:41 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304292357.r3TNvfQi051144@svn.freebsd.org> From: Adrian Chadd Date: Mon, 29 Apr 2013 23:57:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250082 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2013 23:57:41 -0000 Author: adrian Date: Mon Apr 29 23:57:41 2013 New Revision: 250082 URL: http://svnweb.freebsd.org/changeset/base/250082 Log: Sync from git - ah_config is in 'ath_hal', not 'ath_hal_private' on FreeBSD. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c Mon Apr 29 23:08:13 2013 (r250081) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c Mon Apr 29 23:57:41 2013 (r250082) @@ -704,7 +704,7 @@ ar9300_ani_control(struct ath_hal *ah, H return AH_TRUE; } /* if we're turning off ANI, reset regs back to INI settings */ - if (AH_PRIVATE(ah)->ah_config.ath_hal_enable_ani) { + if (ah->ah_config.ath_hal_enable_ani) { HAL_ANI_CMD savefunc = ahp->ah_ani_function; /* temporarly allow all functions so we can reset */ ahp->ah_ani_function = HAL_ANI_ALL; From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 00:36:16 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C2851F85; Tue, 30 Apr 2013 00:36:16 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B4F301027; Tue, 30 Apr 2013 00:36:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3U0aGQ5065205; Tue, 30 Apr 2013 00:36:16 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3U0aG02065204; Tue, 30 Apr 2013 00:36:16 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201304300036.r3U0aG02065204@svn.freebsd.org> From: Neel Natu Date: Tue, 30 Apr 2013 00:36:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250083 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 00:36:16 -0000 Author: neel Date: Tue Apr 30 00:36:16 2013 New Revision: 250083 URL: http://svnweb.freebsd.org/changeset/base/250083 Log: Use a separate mutex for the receive path instead of overloading the softc mutex for this purpose. Reviewed by: grehan Modified: head/usr.sbin/bhyve/pci_virtio_net.c Modified: head/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_net.c Mon Apr 29 23:57:41 2013 (r250082) +++ head/usr.sbin/bhyve/pci_virtio_net.c Tue Apr 30 00:36:16 2013 (r250083) @@ -140,7 +140,6 @@ struct pci_vtnet_softc { int vsc_isr; int vsc_tapfd; int vsc_rx_ready; - int tx_in_progress; int resetting; uint32_t vsc_features; @@ -149,9 +148,14 @@ struct pci_vtnet_softc { uint64_t vsc_pfn[VTNET_MAXQ]; struct vring_hqueue vsc_hq[VTNET_MAXQ]; uint16_t vsc_msix_table_idx[VTNET_MAXQ]; + + pthread_mutex_t rx_mtx; + int rx_in_progress; + pthread_t tx_tid; pthread_mutex_t tx_mtx; pthread_cond_t tx_cond; + int tx_in_progress; }; #define vtnet_ctx(sc) ((sc)->vsc_pi->pi_vmctx) @@ -220,6 +224,38 @@ pci_vtnet_ring_reset(struct pci_vtnet_so hq->hq_cur_aidx = 0; } +/* + * If the transmit thread is active then stall until it is done. + */ +static void +pci_vtnet_txwait(struct pci_vtnet_softc *sc) +{ + + pthread_mutex_lock(&sc->tx_mtx); + while (sc->tx_in_progress) { + pthread_mutex_unlock(&sc->tx_mtx); + usleep(10000); + pthread_mutex_lock(&sc->tx_mtx); + } + pthread_mutex_unlock(&sc->tx_mtx); +} + +/* + * If the receive thread is active then stall until it is done. + */ +static void +pci_vtnet_rxwait(struct pci_vtnet_softc *sc) +{ + + pthread_mutex_lock(&sc->rx_mtx); + while (sc->rx_in_progress) { + pthread_mutex_unlock(&sc->rx_mtx); + usleep(10000); + pthread_mutex_lock(&sc->rx_mtx); + } + pthread_mutex_unlock(&sc->rx_mtx); +} + static void pci_vtnet_update_status(struct pci_vtnet_softc *sc, uint32_t value) { @@ -227,21 +263,19 @@ pci_vtnet_update_status(struct pci_vtnet if (value == 0) { DPRINTF(("vtnet: device reset requested !\n")); - /* Wait for TX thread to complete pending desc processing */ sc->resetting = 1; - pthread_mutex_lock(&sc->tx_mtx); - while (sc->tx_in_progress) { - pthread_mutex_unlock(&sc->tx_mtx); - usleep(10000); - pthread_mutex_lock(&sc->tx_mtx); - } - - pthread_mutex_unlock(&sc->tx_mtx); - + /* + * Wait for the transmit and receive threads to finish their + * processing. + */ + pci_vtnet_txwait(sc); + pci_vtnet_rxwait(sc); + + sc->vsc_rx_ready = 0; pci_vtnet_ring_reset(sc, VTNET_RXQ); pci_vtnet_ring_reset(sc, VTNET_TXQ); - sc->vsc_rx_ready = 0; + sc->resetting = 0; } @@ -303,9 +337,9 @@ pci_vtnet_tap_rx(struct pci_vtnet_softc /* * But, will be called when the rx ring hasn't yet - * been set up. + * been set up or the guest is resetting the device. */ - if (sc->vsc_rx_ready == 0) { + if (!sc->vsc_rx_ready || sc->resetting) { /* * Drop the packet and try later. */ @@ -393,9 +427,11 @@ pci_vtnet_tap_callback(int fd, enum ev_t { struct pci_vtnet_softc *sc = param; - pthread_mutex_lock(&sc->vsc_mtx); + pthread_mutex_lock(&sc->rx_mtx); + sc->rx_in_progress = 1; pci_vtnet_tap_rx(sc); - pthread_mutex_unlock(&sc->vsc_mtx); + sc->rx_in_progress = 0; + pthread_mutex_unlock(&sc->rx_mtx); } @@ -462,7 +498,6 @@ pci_vtnet_proctx(struct pci_vtnet_softc vu->vu_tlen = tlen; hq->hq_cur_aidx = aidx + 1; *hq->hq_used_idx = uidx + 1; - } static void @@ -706,21 +741,24 @@ pci_vtnet_init(struct vmctx *ctx, struct } pci_emul_alloc_bar(pi, 0, PCIBAR_IO, VTNET_REGSZ); - + + sc->resetting = 0; + + sc->rx_in_progress = 0; + pthread_mutex_init(&sc->rx_mtx, NULL); + /* * Initialize tx semaphore & spawn TX processing thread * As of now, only one thread for TX desc processing is * spawned. */ sc->tx_in_progress = 0; - sc->resetting = 0; pthread_mutex_init(&sc->tx_mtx, NULL); pthread_cond_init(&sc->tx_cond, NULL); pthread_create(&sc->tx_tid, NULL, pci_vtnet_tx_thread, (void *)sc); snprintf(tname, sizeof(tname), "%s vtnet%d tx", vmname, pi->pi_slot); pthread_set_name_np(sc->tx_tid, tname); - return (0); } From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 01:14:55 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1F2F719B; Tue, 30 Apr 2013 01:14:55 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1208B11CE; Tue, 30 Apr 2013 01:14:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3U1EshK079994; Tue, 30 Apr 2013 01:14:54 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3U1EsFw079993; Tue, 30 Apr 2013 01:14:54 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201304300114.r3U1EsFw079993@svn.freebsd.org> From: Neel Natu Date: Tue, 30 Apr 2013 01:14:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250086 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 01:14:55 -0000 Author: neel Date: Tue Apr 30 01:14:54 2013 New Revision: 250086 URL: http://svnweb.freebsd.org/changeset/base/250086 Log: Reset some more softc state when the guest resets the virtio network device. Obtained from: NetApp Modified: head/usr.sbin/bhyve/pci_virtio_net.c Modified: head/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_net.c Tue Apr 30 00:49:30 2013 (r250085) +++ head/usr.sbin/bhyve/pci_virtio_net.c Tue Apr 30 01:14:54 2013 (r250086) @@ -259,6 +259,7 @@ pci_vtnet_rxwait(struct pci_vtnet_softc static void pci_vtnet_update_status(struct pci_vtnet_softc *sc, uint32_t value) { + int i; if (value == 0) { DPRINTF(("vtnet: device reset requested !\n")); @@ -276,6 +277,12 @@ pci_vtnet_update_status(struct pci_vtnet pci_vtnet_ring_reset(sc, VTNET_RXQ); pci_vtnet_ring_reset(sc, VTNET_TXQ); + for (i = 0; i < VTNET_MAXQ; i++) + sc->vsc_msix_table_idx[i] = VIRTIO_MSI_NO_VECTOR; + + sc->vsc_isr = 0; + sc->vsc_features = 0; + sc->resetting = 0; } From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 01:15:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E663B30C; Tue, 30 Apr 2013 01:15:10 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DA14411D3; Tue, 30 Apr 2013 01:15:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3U1FAHd080148; Tue, 30 Apr 2013 01:15:10 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3U1FAVu080147; Tue, 30 Apr 2013 01:15:10 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201304300115.r3U1FAVu080147@svn.freebsd.org> From: Peter Wemm Date: Tue, 30 Apr 2013 01:15:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250087 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 01:15:11 -0000 Author: peter Date: Tue Apr 30 01:15:10 2013 New Revision: 250087 URL: http://svnweb.freebsd.org/changeset/base/250087 Log: Oh wow.. disassociate/disown any connection with cvs. Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Tue Apr 30 01:14:54 2013 (r250086) +++ head/MAINTAINERS Tue Apr 30 01:15:10 2013 (r250087) @@ -64,7 +64,6 @@ linprocfs des Pre-commit review requeste lpr gad Pre-commit review requested, particularly for lpd/recvjob.c and lpd/printjob.c. newsyslog(8) gad Heads-up appreciated. I'm going thru the PR's for it. -cvs peter Heads-up appreciated, try not to break it. nvi peter Try not to break it. libz peter Try not to break it. groff ru Recommends pre-commit review. From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 03:16:21 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BD56891E; Tue, 30 Apr 2013 03:16:21 +0000 (UTC) (envelope-from prvs=18322e35f1=killing@multiplay.co.uk) Received: from mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) by mx1.freebsd.org (Postfix) with ESMTP id B19BA167E; Tue, 30 Apr 2013 03:16:20 +0000 (UTC) Received: from r2d2 ([46.65.172.4]) by mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) (MDaemon PRO v10.0.4) with ESMTP id md50003549993.msg; Tue, 30 Apr 2013 04:16:17 +0100 X-Spam-Processed: mail1.multiplay.co.uk, Tue, 30 Apr 2013 04:16:17 +0100 (not processed: message from valid local sender) X-MDDKIM-Result: neutral (mail1.multiplay.co.uk) X-MDRemoteIP: 46.65.172.4 X-Return-Path: prvs=18322e35f1=killing@multiplay.co.uk X-Envelope-From: killing@multiplay.co.uk Message-ID: <8C38141DA56442218C71EDCBA9790CF8@multiplay.co.uk> From: "Steven Hartland" To: "Steven Hartland" , "Kenneth D. Merry" References: <201304261617.r3QGH58Q048395@svn.freebsd.org> <20130429225641.GA1375@nargothrond.kdm.org> Subject: Re: svn commit: r249939 - head/sys/cam/scsi Date: Tue, 30 Apr 2013 04:16:49 +0100 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0415_01CE4559.890A90E0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 03:16:21 -0000 This is a multi-part message in MIME format. ------=_NextPart_000_0415_01CE4559.890A90E0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit ----- Original Message ----- From: "Steven Hartland" >> On Fri, Apr 26, 2013 at 16:17:05 +0000, Steven Hartland wrote: >>> Author: smh >>> Date: Fri Apr 26 16:17:04 2013 >>> New Revision: 249939 >>> URL: http://svnweb.freebsd.org/changeset/base/249939 >>> >>> Log: >>> Added available delete methods discovery during device probe, including the >>> maximum sizes for said methods, which are used when processing BIO_DELETE >>> requests. This includes updating UNMAP support discovery to be based on >>> SBC-3 T10/1799-D Revision 31 specification. >>> Added ATA TRIM support to cam scsi devices via ATA Pass-Through(16) >>> sys/cam/scsi/scsi_da.c: >>> - Added ATA Data Set Management TRIM support via ATA Pass-Through(16) >>> as a delete_method >>> >> >> This adds a lot of unnecessary verbosity for devices that don't support ATA >> passthrough. For example: >> >> (da7:iscsi4:0:0:0): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 00 00 00 00 00 00 00 40 ec 00 >> (da7:iscsi4:0:0:0): CAM status: SCSI Status Error >> (da7:iscsi4:0:0:0): SCSI status: Check Condition >> (da7:iscsi4:0:0:0): Retrying command (per sense data) >> (2:2:0:0): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 00 00 00 00 00 00 00 40 ec 00 >> (2:2:0:0): Tag: 0x00f6, Type: 1 >> (2:2:0:0): CTL Status: SCSI Error >> (2:2:0:0): SCSI Status: Check Condition >> (2:2:0:0): SCSI sense: ILLEGAL REQUEST asc:20,0 (Invalid command operation code) >> (2:2:0:0): Command byte 0 is invalid >> >> (da8:iscsi4:0:0:1): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 00 00 00 00 00 00 00 40 ec 00 >> (da8:iscsi4:0:0:1): CAM status: SCSI Status Error >> (da8:iscsi4:0:0:1): SCSI status: Check Condition >> (da8:iscsi4:0:0:1): Retrying command (per sense data) >> (da8:iscsi4:0:0:1): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 00 00 00 00 00 00 00 40 ec 00 >> (da8:iscsi4:0:0:1): CAM status: SCSI Status Error >> (da8:iscsi4:0:0:1): SCSI status: Check Condition >> (da8:iscsi4:0:0:1): Error 5, Retries exhausted >> >> That is with CTL and and trasz's new iSCSI initiator, but you should see it >> with any CTL configuration. (And probably with any controller or device >> that doesn't support ATA passthrough.) >> >> So, please: >> - Check for the presence of VPD page 0x89 before sending an ATA >> passthrough command. The spec (sat3r03 in this case) says that >> it "shall" be implemented, so I think we can count on that. >> - If the target returns an illegal request sense key, don't retry >> again. The target will keep returning illegal request > > Thanks for the report Ken I'll check this on a card I know doesn't support > pass-through. I checked with an areca controller, which I know doesn't support pass16, and all is quiet during boot / probe. I can provoke output at the app layer with camcontrol identify da0, which is to be expected, but nothing in /var/log/messages. daerror handler in scsi_da.c definitely has SF_QUIET_IR so Illegal Request should never be output. I can't provoke this using standard CAM devices even when they don't support ATA Pass-Through (16) so I think this is actually an issue with CTL: 1. Being verbose when it shouldn't (ctl_process_done - line 12571?) 2. Retrying Illegal Request commands when it shouldn't (I didn't experince this on r250032) The attached patch implements a check for ATA Information VPD before using ATA Pass-Through (16). It's had limited testing but I have confirmed it eliminates the use of pass16 under CTL and still enables ATA TRIM under on mpt for SATA disks, so looks promising. If you could test and let me know if it works for you Ken that would be appreciated. The test case I used for CTL was:- kldload ctl ctladm create -b ramdisk -s 10485760 ctladm port -o on As a side note while test "kldload ctl" caused kernel panic the once. If anyone's interested the trace was:- #0 doadump (textdump=0) at pcpu.h:231 #1 0xffffffff802f6d6e in db_dump (dummy=, dummy2=0, dummy3=0, dummy4=0x0) at /usr/home/smh/freebsd/base/head/sys/ddb/db_command.c:543 #2 0xffffffff802f683d in db_command (cmd_table=) at /usr/home/smh/freebsd/base/head/sys/ddb/db_command.c:449 #3 0xffffffff802f65b4 in db_command_loop () at /usr/home/smh/freebsd/base/head/sys/ddb/db_command.c:502 #4 0xffffffff802f8f50 in db_trap (type=, code=0) at /usr/home/smh/freebsd/base/head/sys/ddb/db_main.c:231 #5 0xffffffff805c0df3 in kdb_trap (type=9, code=0, tf=) at /usr/home/smh/freebsd/base/head/sys/kern/subr_kdb.c:654 #6 0xffffffff8075580a in trap_fatal (frame=0xffffff823b8dc790, eva=) at /usr/home/smh/freebsd/base/head/sys/amd64/amd64/trap.c:867 #7 0xffffffff807554b7 in trap (frame=) at /usr/home/smh/freebsd/base/head/sys/amd64/amd64/trap.c:224 #8 0xffffffff8073e1f2 in calltrap () at /usr/home/smh/freebsd/base/head/sys/amd64/amd64/exception.S:228 #9 0xffffffff8029c860 in cam_periph_alloc (periph_ctor=0xffffffff802af410 , periph_oninvalidate=0xfffffe0019cfa200, periph_dtor=, periph_start=0xfffffe0015980a90, name=, type=2159638184, path=0xfffffe0015ad79a0, ac_callback=, code=) at /usr/home/smh/freebsd/base/head/sys/cam/cam_periph.c:227 #10 0xffffffff802aed6b in scsi_scan_lun (request_ccb=) at /usr/home/smh/freebsd/base/head/sys/cam/scsi/scsi_xpt.c:2266 #11 0xffffffff802b2859 in scsi_scan_bus (periph=0x0, request_ccb=0xfffffe00234df000) at /usr/home/smh/freebsd/base/head/sys/cam/scsi/scsi_xpt.c:1969 #12 0xffffffff802a66c5 in xpt_scanner_thread (dummy=) at /usr/home/smh/freebsd/base/head/sys/cam/cam_xpt.c:2411 #13 0xffffffff8055cde4 in fork_exit (callout=0xffffffff802a6650 , arg=0x0, frame=0xffffff823b8dcc00) at /usr/home/smh/freebsd/base/head/sys/kern/kern_fork.c:991 #14 0xffffffff8073e72e in fork_trampoline () at /usr/home/smh/freebsd/base/head/sys/amd64/amd64/exception.S:602 #15 0x0000000000000000 in ?? () Regards Steve ================================================ This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337 or return the E.mail to postmaster@multiplay.co.uk. ------=_NextPart_000_0415_01CE4559.890A90E0 Content-Type: application/octet-stream; name="cam-scsi-delete-ata-info.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="cam-scsi-delete-ata-info.patch" Use the existence of ATA Information VPD to determine if we should = attempt=0A= to query ATA functionality via ATA Pass-Through (16) as this page is = defined=0A= as "must" for SATL devices, hence indicating that the device is at least=0A= likely to support Pass-Through (16).=0A= =0A= This eliminates errors produced by CTL when ATA Pass-Through (16) fails.=0A= =0A= Output details about supported and choosen delete method when verbose = booted.=0A= Index: sys/cam/scsi/scsi_all.h=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= --- sys/cam/scsi/scsi_all.h (revision 250032)=0A= +++ sys/cam/scsi/scsi_all.h (working copy)=0A= @@ -1430,6 +1430,12 @@=0A= };=0A= =0A= /*=0A= + * ATA Information VPD Page based on=0A= + * T10/2126-D Revision 04=0A= + */=0A= +#define SVPD_ATA_INFORMATION 0x89=0A= +=0A= +/*=0A= * Block Device Characteristics VPD Page based on=0A= * T10/1799-D Revision 31=0A= */=0A= Index: sys/cam/scsi/scsi_da.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= --- sys/cam/scsi/scsi_da.c (revision 250033)=0A= +++ sys/cam/scsi/scsi_da.c (working copy)=0A= @@ -918,6 +918,7 @@=0A= da_delete_methods delete_method);=0A= static void dadeletemethodchoose(struct da_softc *softc,=0A= da_delete_methods default_method);=0A= +static void dadeletemethodauto(struct cam_periph *periph);=0A= =0A= static periph_ctor_t daregister;=0A= static periph_dtor_t dacleanup;=0A= @@ -1680,6 +1681,47 @@=0A= }=0A= =0A= static void=0A= +dadeletemethodauto(struct cam_periph *periph)=0A= +{=0A= + struct da_softc *softc;=0A= +=0A= + softc =3D (struct da_softc *)periph->softc;=0A= +=0A= + dadeletemethodchoose(softc, DA_DELETE_NONE);=0A= +=0A= + if (bootverbose && (softc->flags & DA_FLAG_PROBED) =3D=3D 0) {=0A= + char buf[80];=0A= + int i, sep;=0A= +=0A= + snprintf(buf, sizeof(buf), "Delete methods: <");=0A= + sep =3D 0;=0A= + for (i =3D DA_DELETE_MIN; i <=3D DA_DELETE_MAX; i++) {=0A= + if (softc->delete_available & (1 << i)) {=0A= + if (sep) {=0A= + strlcat(buf, ",", sizeof(buf));=0A= + } else {=0A= + sep =3D 1;=0A= + }=0A= + strlcat(buf, da_delete_method_names[i],=0A= + sizeof(buf));=0A= + if (i =3D=3D softc->delete_method) {=0A= + strlcat(buf, "(*)", sizeof(buf));=0A= + }=0A= + }=0A= + }=0A= + if (sep =3D=3D 0) {=0A= + if (softc->delete_method =3D=3D DA_DELETE_NONE) =0A= + strlcat(buf, "NONE(*)", sizeof(buf));=0A= + else=0A= + strlcat(buf, "DISABLED(*)", sizeof(buf));=0A= + }=0A= + strlcat(buf, ">", sizeof(buf));=0A= + printf("%s%d: %s\n", periph->periph_name,=0A= + periph->unit_number, buf);=0A= + }=0A= +}=0A= +=0A= +static void=0A= dadeletemethodchoose(struct da_softc *softc, da_delete_methods = default_method)=0A= {=0A= int i, delete_method;=0A= @@ -2457,6 +2499,21 @@=0A= {=0A= struct ata_params *ata_params;=0A= =0A= + if (!scsi_vpd_supported_page(periph, SVPD_ATA_INFORMATION)) {=0A= + dadeletemethodauto(periph);=0A= +=0A= + xpt_release_ccb(start_ccb);=0A= + softc->state =3D DA_STATE_NORMAL;=0A= + daschedule(periph);=0A= + wakeup(&softc->disk->d_mediasize);=0A= + if ((softc->flags & DA_FLAG_PROBED) =3D=3D 0) {=0A= + softc->flags |=3D DA_FLAG_PROBED;=0A= + cam_periph_unhold(periph);=0A= + } else=0A= + cam_periph_release_locked(periph);=0A= + break;=0A= + }=0A= +=0A= ata_params =3D (struct ata_params*)=0A= malloc(sizeof(*ata_params), M_SCSIDA, M_NOWAIT|M_ZERO);=0A= =0A= @@ -3134,7 +3191,7 @@=0A= }=0A= =0A= free(ata_params, M_SCSIDA);=0A= - dadeletemethodchoose(softc, DA_DELETE_NONE);=0A= + dadeletemethodauto(periph);=0A= /*=0A= * Since our peripheral may be invalidated by an error=0A= * above or an external event, we must release our CCB=0A= ------=_NextPart_000_0415_01CE4559.890A90E0-- From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 04:31:58 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 45129AA3; Tue, 30 Apr 2013 04:31:58 +0000 (UTC) (envelope-from tim@kientzle.com) Received: from monday.kientzle.com (99-115-135-74.uvs.sntcca.sbcglobal.net [99.115.135.74]) by mx1.freebsd.org (Postfix) with ESMTP id 250E819F5; Tue, 30 Apr 2013 04:31:57 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.4/8.14.4) id r3U4Vo2F078570; Tue, 30 Apr 2013 04:31:50 GMT (envelope-from tim@kientzle.com) Received: from [192.168.2.123] (CiscoE3000 [192.168.1.65]) by kientzle.com with SMTP id yeciirvewq6xcmjzhd8xfxh3ri; Tue, 30 Apr 2013 04:31:50 +0000 (UTC) (envelope-from tim@kientzle.com) Subject: Re: svn commit: r249774 - head/sys/boot/fdt/dts Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Tim Kientzle In-Reply-To: <201304221853.r3MIram6060889@svn.freebsd.org> Date: Mon, 29 Apr 2013 21:31:50 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <8DA5B1ED-C616-4D2F-9235-E37A89F7EABE@kientzle.com> References: <201304221853.r3MIram6060889@svn.freebsd.org> To: Oleksandr Tymoshenko X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 04:31:58 -0000 On Apr 22, 2013, at 11:53 AM, Oleksandr Tymoshenko wrote: > Author: gonzo > Date: Mon Apr 22 18:53:36 2013 > New Revision: 249774 > URL: http://svnweb.freebsd.org/changeset/base/249774 >=20 > Log: > Split BeagleBone DTS to generic AM335x part and Beagle-bone specific >=20 > Added: > head/sys/boot/fdt/dts/am335x.dtsi (contents, props changed) > Modified: > head/sys/boot/fdt/dts/beaglebone.dts >=20 > Added: head/sys/boot/fdt/dts/am335x.dtsi > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > + > +/ { > + compatible =3D "ti,am335x"; >=20 > Modified: head/sys/boot/fdt/dts/beaglebone.dts > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >=20 > +/include/ "am335x.dtsi" > + > / { > model =3D "beaglebone"; > - compatible =3D "beaglebone", "ti,am335x"; This used to have two "compatible" names; now it only has one. Is there a way to have both again? (Mostly I'm just curious; I'm still learning FDT conventions.) Tim From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 05:08:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6DC746A; Tue, 30 Apr 2013 05:08:18 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 45FC21B30; Tue, 30 Apr 2013 05:08:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3U58IRq062511; Tue, 30 Apr 2013 05:08:18 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3U58If4062510; Tue, 30 Apr 2013 05:08:18 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201304300508.r3U58If4062510@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 30 Apr 2013 05:08:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250088 - head/sys/dev/bktr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 05:08:18 -0000 Author: pluknet Date: Tue Apr 30 05:08:17 2013 New Revision: 250088 URL: http://svnweb.freebsd.org/changeset/base/250088 Log: Pass a format string to kproc_create() [1] and thus fix the build with -DBKTR_NEW_MSP34XX_DRIVER and -Wformat-security. This also allows to eliminates a superfluous malloc/snprintf/free on intermediate buffer. PR: kern/175546 MFC after: 1 week Modified: head/sys/dev/bktr/msp34xx.c Modified: head/sys/dev/bktr/msp34xx.c ============================================================================== --- head/sys/dev/bktr/msp34xx.c Tue Apr 30 01:15:10 2013 (r250087) +++ head/sys/dev/bktr/msp34xx.c Tue Apr 30 05:08:17 2013 (r250088) @@ -134,7 +134,6 @@ struct msp3400c { /* thread */ struct proc *kthread; - char *threaddesc; int active,restart,rmmod; @@ -1147,12 +1146,6 @@ int msp_attach(bktr_ptr_t bktr) msp->bass = 32768; msp->treble = 32768; msp->input = -1; - msp->threaddesc = malloc(15 * sizeof(char), M_DEVBUF, M_NOWAIT); - if (msp->threaddesc == NULL) { - free(msp, M_DEVBUF); - return ENOMEM; - } - snprintf(msp->threaddesc, 14, "%s_msp34xx_thread", bktr->bktr_xname); for (i = 0; i < DFP_COUNT; i++) msp->dfp_regs[i] = -1; @@ -1163,7 +1156,6 @@ int msp_attach(bktr_ptr_t bktr) if (-1 != rev1) rev2 = msp3400c_read(bktr, I2C_MSP3400C_DFP, 0x1f); if ((-1 == rev1) || (0 == rev1 && 0 == rev2)) { - free(msp->threaddesc, M_DEVBUF); free(msp, M_DEVBUF); bktr->msp3400c_info = NULL; printf("%s: msp3400: error while reading chip version\n", bktr_name(bktr)); @@ -1199,10 +1191,9 @@ int msp_attach(bktr_ptr_t bktr) /* startup control thread */ err = kproc_create(msp->simple ? msp3410d_thread : msp3400c_thread, bktr, &msp->kthread, (RFFDG | RFPROC), 0, - msp->threaddesc); + "%s_msp34xx_thread", bktr->bktr_xname); if (err) { printf("%s: Error returned by kproc_create: %d", bktr_name(bktr), err); - free(msp->threaddesc, M_DEVBUF); free(msp, M_DEVBUF); bktr->msp3400c_info = NULL; return ENXIO; From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 05:32:08 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7F43A9E9; Tue, 30 Apr 2013 05:32:08 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 627F91C0F; Tue, 30 Apr 2013 05:32:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3U5W8nE072115; Tue, 30 Apr 2013 05:32:08 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3U5W7DT072106; Tue, 30 Apr 2013 05:32:07 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201304300532.r3U5W7DT072106@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 30 Apr 2013 05:32:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250090 - in head/sys/dev/cxgbe: . common firmware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 05:32:08 -0000 Author: np Date: Tue Apr 30 05:32:07 2013 New Revision: 250090 URL: http://svnweb.freebsd.org/changeset/base/250090 Log: cxgbe(4): Some updates to shared code. Obtained from: Chelsio MFC after: 1 week Modified: head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/firmware/t4fw_interface.h head/sys/dev/cxgbe/osdep.h Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Tue Apr 30 05:30:09 2013 (r250089) +++ head/sys/dev/cxgbe/common/common.h Tue Apr 30 05:32:07 2013 (r250090) @@ -424,7 +424,7 @@ int t4_read_flash(struct adapter *adapte int t4_load_fw(struct adapter *adapter, const u8 *fw_data, unsigned int size); int t4_load_boot(struct adapter *adap, u8 *boot_data, unsigned int boot_addr, unsigned int size); -unsigned int t4_flash_cfg_addr(struct adapter *adapter); +int t4_flash_cfg_addr(struct adapter *adapter); int t4_load_cfg(struct adapter *adapter, const u8 *cfg_data, unsigned int size); int t4_get_fw_version(struct adapter *adapter, u32 *vers); int t4_get_tp_version(struct adapter *adapter, u32 *vers); Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Tue Apr 30 05:30:09 2013 (r250089) +++ head/sys/dev/cxgbe/common/t4_hw.c Tue Apr 30 05:32:07 2013 (r250090) @@ -176,9 +176,7 @@ static void t4_report_fw_error(struct ad u32 pcie_fw; pcie_fw = t4_read_reg(adap, A_PCIE_FW); - if (!(pcie_fw & F_PCIE_FW_ERR)) - CH_ERR(adap, "Firmware error report called with no error\n"); - else + if (pcie_fw & F_PCIE_FW_ERR) CH_ERR(adap, "Firmware reports adapter error: %s\n", reason[G_PCIE_FW_EVAL(pcie_fw)]); } @@ -512,6 +510,7 @@ struct t4_vpd_hdr { #define VPD_BASE_OLD 0 #define VPD_LEN 1024 #define VPD_INFO_FLD_HDR_SIZE 3 +#define CHELSIO_VPD_UNIQUE_ID 0x82 /** * t4_seeprom_read - read a serial EEPROM location @@ -676,7 +675,7 @@ static int get_vpd_params(struct adapter * it at 0. */ ret = t4_seeprom_read(adapter, VPD_BASE, (u32 *)(vpd)); - addr = *vpd == 0x82 ? VPD_BASE : VPD_BASE_OLD; + addr = *vpd == CHELSIO_VPD_UNIQUE_ID ? VPD_BASE : VPD_BASE_OLD; for (i = 0; i < sizeof(vpd); i += 4) { ret = t4_seeprom_read(adapter, addr + i, (u32 *)(vpd + i)); @@ -714,8 +713,10 @@ static int get_vpd_params(struct adapter i = vpd[sn - VPD_INFO_FLD_HDR_SIZE + 2]; memcpy(p->sn, vpd + sn, min(i, SERNUM_LEN)); strstrip(p->sn); + i = vpd[pn - VPD_INFO_FLD_HDR_SIZE + 2]; memcpy(p->pn, vpd + pn, min(i, PN_LEN)); strstrip((char *)p->pn); + i = vpd[na - VPD_INFO_FLD_HDR_SIZE + 2]; memcpy(p->na, vpd + na, min(i, MACADDR_LEN)); strstrip((char *)p->na); @@ -1034,14 +1035,19 @@ static int t4_flash_erase_sectors(struct * @adapter: the adapter * * Return the address within the flash where the Firmware Configuration - * File is stored. + * File is stored, or an error if the device FLASH is too small to contain + * a Firmware Configuration File. */ -unsigned int t4_flash_cfg_addr(struct adapter *adapter) +int t4_flash_cfg_addr(struct adapter *adapter) { - if (adapter->params.sf_size == 0x100000) - return FLASH_FPGA_CFG_START; - else - return FLASH_CFG_START; + /* + * If the device FLASH isn't large enough to hold a Firmware + * Configuration File, return an error. + */ + if (adapter->params.sf_size < FLASH_CFG_START + FLASH_CFG_MAX_SIZE) + return -ENOSPC; + + return FLASH_CFG_START; } /** @@ -1054,12 +1060,16 @@ unsigned int t4_flash_cfg_addr(struct ad */ int t4_load_cfg(struct adapter *adap, const u8 *cfg_data, unsigned int size) { - int ret, i, n; + int ret, i, n, cfg_addr; unsigned int addr; unsigned int flash_cfg_start_sec; unsigned int sf_sec_size = adap->params.sf_size / adap->params.sf_nsec; - addr = t4_flash_cfg_addr(adap); + cfg_addr = t4_flash_cfg_addr(adap); + if (cfg_addr < 0) + return cfg_addr; + + addr = cfg_addr; flash_cfg_start_sec = addr / SF_SEC_SIZE; if (size > FLASH_CFG_MAX_SIZE) { @@ -1839,7 +1849,8 @@ void t4_ulprx_read_la(struct adapter *ad } #define ADVERT_MASK (FW_PORT_CAP_SPEED_100M | FW_PORT_CAP_SPEED_1G |\ - FW_PORT_CAP_SPEED_10G | FW_PORT_CAP_ANEG) + FW_PORT_CAP_SPEED_10G | FW_PORT_CAP_SPEED_40G | \ + FW_PORT_CAP_SPEED_100G | FW_PORT_CAP_ANEG) /** * t4_link_start - apply link configuration to MAC/PHY @@ -2406,8 +2417,13 @@ static void mem_intr_handler(struct adap addr = EDC_REG(A_EDC_INT_CAUSE, idx); cnt_addr = EDC_REG(A_EDC_ECC_STATUS, idx); } else { - addr = A_MC_INT_CAUSE; - cnt_addr = A_MC_ECC_STATUS; + if (is_t4(adapter)) { + addr = A_MC_INT_CAUSE; + cnt_addr = A_MC_ECC_STATUS; + } else { + addr = A_MC_P_INT_CAUSE; + cnt_addr = A_MC_P_ECC_STATUS; + } } v = t4_read_reg(adapter, addr) & MEM_INT_MASK; @@ -2514,12 +2530,19 @@ static void xgmac_intr_handler(struct ad static void pl_intr_handler(struct adapter *adap) { static struct intr_info pl_intr_info[] = { - { F_FATALPERR, "T4 fatal parity error", -1, 1 }, + { F_FATALPERR, "Fatal parity error", -1, 1 }, { F_PERRVFID, "PL VFID_MAP parity error", -1, 1 }, { 0 } }; - if (t4_handle_intr_status(adap, A_PL_PL_INT_CAUSE, pl_intr_info)) + static struct intr_info t5_pl_intr_info[] = { + { F_PL_BUSPERR, "PL bus parity error", -1, 1 }, + { F_FATALPERR, "Fatal parity error", -1, 1 }, + { 0 } + }; + + if (t4_handle_intr_status(adap, A_PL_PL_INT_CAUSE, + is_t4(adap) ? pl_intr_info : t5_pl_intr_info)) t4_fatal_err(adap); } @@ -2652,7 +2675,6 @@ void t4_intr_clear(struct adapter *adapt A_PCIE_CORE_UTL_SYSTEM_BUS_AGENT_STATUS, A_PCIE_CORE_UTL_PCI_EXPRESS_PORT_STATUS, A_PCIE_NONFAT_ERR, A_PCIE_INT_CAUSE, - A_MC_INT_CAUSE, A_MA_INT_WRAP_STATUS, A_MA_PARITY_ERROR_STATUS, A_MA_INT_CAUSE, A_EDC_INT_CAUSE, EDC_REG(A_EDC_INT_CAUSE, 1), A_CIM_HOST_INT_CAUSE, A_CIM_HOST_UPACC_INT_CAUSE, @@ -2672,6 +2694,9 @@ void t4_intr_clear(struct adapter *adapt for (i = 0; i < ARRAY_SIZE(cause_reg); ++i) t4_write_reg(adapter, cause_reg[i], 0xffffffff); + t4_write_reg(adapter, is_t4(adapter) ? A_MC_INT_CAUSE : + A_MC_P_INT_CAUSE, 0xffffffff); + t4_write_reg(adapter, A_PL_INT_CAUSE, GLBL_INTR_MASK); (void) t4_read_reg(adapter, A_PL_INT_CAUSE); /* flush */ } @@ -4666,8 +4691,8 @@ int t4_query_params(struct adapter *adap V_FW_PARAMS_CMD_VFN(vf)); c.retval_len16 = htonl(FW_LEN16(c)); - for (i = 0; i < nparams; i++, p += 2) - *p = htonl(*params++); + for (i = 0; i < nparams; i++, p += 2, params++) + *p = htonl(*params); ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c); if (ret == 0) @@ -4706,8 +4731,10 @@ int t4_set_params(struct adapter *adap, c.retval_len16 = htonl(FW_LEN16(c)); while (nparams--) { - *p++ = htonl(*params++); - *p++ = htonl(*val++); + *p++ = htonl(*params); + params++; + *p++ = htonl(*val); + val++; } return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL); @@ -5299,6 +5326,8 @@ int t4_handle_fw_rpl(struct adapter *ada speed = SPEED_1000; else if (stat & V_FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_10G)) speed = SPEED_10000; + else if (stat & V_FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_40G)) + speed = SPEED_40000; for_each_port(adap, i) { pi = adap2pinfo(adap, i); @@ -5312,6 +5341,7 @@ int t4_handle_fw_rpl(struct adapter *ada lc->link_ok = link_ok; lc->speed = speed; lc->fc = fc; + lc->supported = ntohs(p->u.info.pcap); t4_os_link_changed(adap, i, link_ok); } if (mod != pi->mod_type) { Modified: head/sys/dev/cxgbe/firmware/t4fw_interface.h ============================================================================== --- head/sys/dev/cxgbe/firmware/t4fw_interface.h Tue Apr 30 05:30:09 2013 (r250089) +++ head/sys/dev/cxgbe/firmware/t4fw_interface.h Tue Apr 30 05:32:07 2013 (r250090) @@ -80,6 +80,7 @@ enum fw_retval { ********************************/ enum fw_wr_opcodes { + FW_FRAG_WR = 0x1d, FW_FILTER_WR = 0x02, FW_ULPTX_WR = 0x04, FW_TP_WR = 0x05, @@ -203,6 +204,24 @@ struct fw_wr_hdr { #define V_FW_WR_LEN16(x) ((x) << S_FW_WR_LEN16) #define G_FW_WR_LEN16(x) (((x) >> S_FW_WR_LEN16) & M_FW_WR_LEN16) +struct fw_frag_wr { + __be32 op_to_fragoff16; + __be32 flowid_len16; + __be64 r4; +}; + +#define S_FW_FRAG_WR_EOF 15 +#define M_FW_FRAG_WR_EOF 0x1 +#define V_FW_FRAG_WR_EOF(x) ((x) << S_FW_FRAG_WR_EOF) +#define G_FW_FRAG_WR_EOF(x) (((x) >> S_FW_FRAG_WR_EOF) & M_FW_FRAG_WR_EOF) +#define F_FW_FRAG_WR_EOF V_FW_FRAG_WR_EOF(1U) + +#define S_FW_FRAG_WR_FRAGOFF16 8 +#define M_FW_FRAG_WR_FRAGOFF16 0x7f +#define V_FW_FRAG_WR_FRAGOFF16(x) ((x) << S_FW_FRAG_WR_FRAGOFF16) +#define G_FW_FRAG_WR_FRAGOFF16(x) \ + (((x) >> S_FW_FRAG_WR_FRAGOFF16) & M_FW_FRAG_WR_FRAGOFF16) + /* valid filter configurations for compressed tuple * Encodings: TPL - Compressed TUPLE for filter in addition to 4-tuple * FR - FRAGMENT, FC - FCoE, MT - MPS MATCH TYPE, M - MPS MATCH, @@ -2996,6 +3015,9 @@ enum fw_ldst_addrspc { FW_LDST_ADDRSPC_FUNC_I2C = 0x002A, /* legacy */ FW_LDST_ADDRSPC_LE = 0x0030, FW_LDST_ADDRSPC_I2C = 0x0038, + FW_LDST_ADDRSPC_PCIE_CFGS = 0x0040, + FW_LDST_ADDRSPC_PCIE_DBG = 0x0041, + FW_LDST_ADDRSPC_PCIE_PHY = 0x0042, }; /* @@ -3482,13 +3504,20 @@ enum fw_params_param_dev { FW_PARAMS_PARAM_DEV_INTFVER_ISCSIPDU = 0x08, FW_PARAMS_PARAM_DEV_INTFVER_ISCSI = 0x09, FW_PARAMS_PARAM_DEV_INTFVER_FCOE = 0x0A, - FW_PARAMS_PARAM_DEV_FWREV = 0x0B, - FW_PARAMS_PARAM_DEV_TPREV = 0x0C, - FW_PARAMS_PARAM_DEV_CF = 0x0D, - FW_PARAMS_PARAM_DEV_BYPASS = 0x0E, - FW_PARAMS_PARAM_DEV_PHYFW = 0x0F, - FW_PARAMS_PARAM_DEV_LOAD = 0x10, - FW_PARAMS_PARAM_DEV_DIAG = 0x11, + FW_PARAMS_PARAM_DEV_FWREV = 0x0B, + FW_PARAMS_PARAM_DEV_TPREV = 0x0C, + FW_PARAMS_PARAM_DEV_CF = 0x0D, + FW_PARAMS_PARAM_DEV_BYPASS = 0x0E, + FW_PARAMS_PARAM_DEV_PHYFW = 0x0F, + FW_PARAMS_PARAM_DEV_LOAD = 0x10, + FW_PARAMS_PARAM_DEV_DIAG = 0x11, + FW_PARAMS_PARAM_DEV_UCLK = 0x12, /* uP clock in khz */ + FW_PARAMS_PARAM_DEV_MAXORDIRD_QP = 0x13, /* max supported QP IRD/ORD + */ + FW_PARAMS_PARAM_DEV_MAXIRD_ADAPTER= 0x14,/* max supported ADAPTER IRD + */ + FW_PARAMS_PARAM_DEV_INTFVER_FCOEPDU = 0x15, + FW_PARAMS_PARAM_DEV_MCINIT = 0x16, }; /* @@ -5860,6 +5889,9 @@ enum fw_port_type { FW_PORT_TYPE_SFP = 9, /* No, 1, Yes, No, No, No, 10G */ FW_PORT_TYPE_BP_AP = 10, /* No, 1, No, No, Yes, Yes, 10G, BP ANGE */ FW_PORT_TYPE_BP4_AP = 11, /* No, 4, No, No, Yes, Yes, 10G, BP ANGE */ + FW_PORT_TYPE_QSFP_10G = 12, /* No, 1, Yes, No, No, No, 10G */ + FW_PORT_TYPE_QSFP = 14, /* No, 4, Yes, No, No, No, 40G */ + FW_PORT_TYPE_BP40_BA = 15, /* No, 4, No, No, Yes, Yes, 40G/10G/1G, BP ANGE */ FW_PORT_TYPE_NONE = M_FW_PORT_CMD_PTYPE }; @@ -6783,6 +6815,7 @@ enum fw_devlog_level { */ enum fw_devlog_facility { FW_DEVLOG_FACILITY_CORE = 0x00, + FW_DEVLOG_FACILITY_CF = 0x01, FW_DEVLOG_FACILITY_SCHED = 0x02, FW_DEVLOG_FACILITY_TIMER = 0x04, FW_DEVLOG_FACILITY_RES = 0x06, Modified: head/sys/dev/cxgbe/osdep.h ============================================================================== --- head/sys/dev/cxgbe/osdep.h Tue Apr 30 05:30:09 2013 (r250089) +++ head/sys/dev/cxgbe/osdep.h Tue Apr 30 05:32:07 2013 (r250090) @@ -109,6 +109,7 @@ typedef boolean_t bool; #define SPEED_100 100 #define SPEED_1000 1000 #define SPEED_10000 10000 +#define SPEED_40000 40000 #define DUPLEX_HALF 0 #define DUPLEX_FULL 1 #define AUTONEG_DISABLE 0 From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 05:51:53 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 75427E7D; Tue, 30 Apr 2013 05:51:53 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 689891CAB; Tue, 30 Apr 2013 05:51:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3U5pq73078878; Tue, 30 Apr 2013 05:51:52 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3U5pqpn078875; Tue, 30 Apr 2013 05:51:52 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201304300551.r3U5pqpn078875@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 30 Apr 2013 05:51:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250092 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 05:51:53 -0000 Author: np Date: Tue Apr 30 05:51:52 2013 New Revision: 250092 URL: http://svnweb.freebsd.org/changeset/base/250092 Log: - Provide accurate ifmedia information so that 40G ports/transceivers are displayed properly in ifconfig, etc. - Use the same number of tx and rx queues for a 40G port as for a 10G port. MFC after: 1 week Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Tue Apr 30 05:39:42 2013 (r250091) +++ head/sys/dev/cxgbe/adapter.h Tue Apr 30 05:51:52 2013 (r250092) @@ -757,6 +757,13 @@ is_10G_port(const struct port_info *pi) return ((pi->link_cfg.supported & FW_PORT_CAP_SPEED_10G) != 0); } +static inline bool +is_40G_port(const struct port_info *pi) +{ + + return ((pi->link_cfg.supported & FW_PORT_CAP_SPEED_40G) != 0); +} + static inline int tx_resume_threshold(struct sge_eq *eq) { Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Apr 30 05:39:42 2013 (r250091) +++ head/sys/dev/cxgbe/t4_main.c Tue Apr 30 05:51:52 2013 (r250092) @@ -666,7 +666,7 @@ t4_attach(device_t dev) device_get_nameunit(dev), i); mtx_init(&pi->pi_lock, pi->lockname, 0, MTX_DEF); - if (is_10G_port(pi)) { + if (is_10G_port(pi) || is_40G_port(pi)) { n10g++; pi->tmr_idx = t4_tmr_idx_10g; pi->pktc_idx = t4_pktc_idx_10g; @@ -756,7 +756,7 @@ t4_attach(device_t dev) pi->first_rxq = rqidx; pi->first_txq = tqidx; - if (is_10G_port(pi)) { + if (is_10G_port(pi) || is_40G_port(pi)) { pi->nrxq = iaq.nrxq10g; pi->ntxq = iaq.ntxq10g; } else { @@ -771,7 +771,7 @@ t4_attach(device_t dev) if (is_offload(sc)) { pi->first_ofld_rxq = ofld_rqidx; pi->first_ofld_txq = ofld_tqidx; - if (is_10G_port(pi)) { + if (is_10G_port(pi) || is_40G_port(pi)) { pi->nofldrxq = iaq.nofldrxq10g; pi->nofldtxq = iaq.nofldtxq10g; } else { @@ -2595,16 +2595,47 @@ build_medialist(struct port_info *pi) case FW_PORT_MOD_TYPE_NA: case FW_PORT_MOD_TYPE_ER: default: + device_printf(pi->dev, + "unknown port_type (%d), mod_type (%d)\n", + pi->port_type, pi->mod_type); + ifmedia_add(media, m | IFM_UNKNOWN, data, NULL); + ifmedia_set(media, m | IFM_UNKNOWN); + break; + } + break; + + case FW_PORT_TYPE_QSFP: + switch (pi->mod_type) { + + case FW_PORT_MOD_TYPE_LR: + ifmedia_add(media, m | IFM_40G_LR4, data, NULL); + ifmedia_set(media, m | IFM_40G_LR4); + break; + + case FW_PORT_MOD_TYPE_SR: + ifmedia_add(media, m | IFM_40G_SR4, data, NULL); + ifmedia_set(media, m | IFM_40G_SR4); + break; + case FW_PORT_MOD_TYPE_TWINAX_PASSIVE: + case FW_PORT_MOD_TYPE_TWINAX_ACTIVE: + ifmedia_add(media, m | IFM_40G_CR4, data, NULL); + ifmedia_set(media, m | IFM_40G_CR4); + break; + + default: + device_printf(pi->dev, + "unknown port_type (%d), mod_type (%d)\n", + pi->port_type, pi->mod_type); ifmedia_add(media, m | IFM_UNKNOWN, data, NULL); ifmedia_set(media, m | IFM_UNKNOWN); break; } break; - case FW_PORT_TYPE_KX4: - case FW_PORT_TYPE_KX: - case FW_PORT_TYPE_KR: default: + device_printf(pi->dev, + "unknown port_type (%d), mod_type (%d)\n", pi->port_type, + pi->mod_type); ifmedia_add(media, m | IFM_UNKNOWN, data, NULL); ifmedia_set(media, m | IFM_UNKNOWN); break; From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 06:30:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2D810789; Tue, 30 Apr 2013 06:30:22 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1FBE31DF9; Tue, 30 Apr 2013 06:30:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3U6UMTO092865; Tue, 30 Apr 2013 06:30:22 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3U6ULDH092864; Tue, 30 Apr 2013 06:30:21 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201304300630.r3U6ULDH092864@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 30 Apr 2013 06:30:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250093 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 06:30:22 -0000 Author: np Date: Tue Apr 30 06:30:21 2013 New Revision: 250093 URL: http://svnweb.freebsd.org/changeset/base/250093 Log: Attach to the T580 (2 x 40G) card. MFC after: 1 week. Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Apr 30 05:51:52 2013 (r250092) +++ head/sys/dev/cxgbe/t4_main.c Tue Apr 30 06:30:21 2013 (r250093) @@ -444,6 +444,7 @@ struct { {0x5401, "Chelsio T520-CR"}, {0x5407, "Chelsio T520-SO"}, {0x5408, "Chelsio T520-CX"}, + {0x5410, "Chelsio T580-LP-CR"}, /* 2 x 40G */ {0x5411, "Chelsio T520-LL-CR"}, #ifdef notyet {0x5402, "Chelsio T522-CR"}, @@ -458,7 +459,6 @@ struct { {0x540d, "Chelsio T580-CR"}, {0x540e, "Chelsio T540-LP-CR"}, {0x540f, "Chelsio Amsterdam"}, - {0x5410, "Chelsio T580-LP-CR"}, {0x5412, "Chelsio T560-CR"}, {0x5413, "Chelsio T580-CR"}, #endif From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 07:22:06 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 786E638B; Tue, 30 Apr 2013 07:22:04 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5DE741FFC; Tue, 30 Apr 2013 07:22:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3U7M4I3011366; Tue, 30 Apr 2013 07:22:04 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3U7M4Ks011365; Tue, 30 Apr 2013 07:22:04 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201304300722.r3U7M4Ks011365@svn.freebsd.org> From: Joel Dahl Date: Tue, 30 Apr 2013 07:22:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250095 - head/sbin/dumpon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 07:22:06 -0000 Author: joel (doc committer) Date: Tue Apr 30 07:22:03 2013 New Revision: 250095 URL: http://svnweb.freebsd.org/changeset/base/250095 Log: Adapt to the fact that minidumps are now on by default. PR: 177188 Modified: head/sbin/dumpon/dumpon.8 Modified: head/sbin/dumpon/dumpon.8 ============================================================================== --- head/sbin/dumpon/dumpon.8 Tue Apr 30 06:41:42 2013 (r250094) +++ head/sbin/dumpon/dumpon.8 Tue Apr 30 07:22:03 2013 (r250095) @@ -28,7 +28,7 @@ .\" From: @(#)swapon.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd May 12, 1995 +.Dd April 29, 2013 .Dt DUMPON 8 .Os .Sh NAME @@ -59,14 +59,21 @@ controlled by the variable in the boot time configuration file .Pa /etc/rc.conf . .Pp -For most systems the size of the specified dump device must be at +The default type of kernel crash dump is the mini crash dump. +Mini crash dumps hold only memory pages in use by the kernel. +Alternatively, full memory dumps can be enabled by setting the +.Va debug.minidump +.Xr sysctl 8 +variable to 0. +.Pp +For systems using full memory dumps, the size of the specified dump +device must be at least the size of physical memory. Even though an additional 64 kB header is added to the dump, the BIOS for a platform typically holds back some memory, so it is not usually necessary to size the dump device larger than the actual amount of RAM available in the machine. -.Pp -The +Also, when using full memory dumps, the .Nm utility will refuse to enable a dump device which is smaller than the total amount of physical memory as reported by the From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 08:18:09 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C3D3610C; Tue, 30 Apr 2013 08:18:09 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B6A7E1227; Tue, 30 Apr 2013 08:18:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3U8I9Qd030510; Tue, 30 Apr 2013 08:18:09 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3U8I9wN030508; Tue, 30 Apr 2013 08:18:09 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201304300818.r3U8I9wN030508@svn.freebsd.org> From: Davide Italiano Date: Tue, 30 Apr 2013 08:18:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250096 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 08:18:09 -0000 Author: davide Date: Tue Apr 30 08:18:08 2013 New Revision: 250096 URL: http://svnweb.freebsd.org/changeset/base/250096 Log: Fixup Westmere hwpmc(4) support: add missing CPU flag so that intrucion-retired, llc-misses and llc-reference events can now be allocated. Reviewed by: jimharris, gnn Modified: head/sys/dev/hwpmc/hwpmc_core.c Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Tue Apr 30 07:22:03 2013 (r250095) +++ head/sys/dev/hwpmc/hwpmc_core.c Tue Apr 30 08:18:08 2013 (r250096) @@ -860,9 +860,9 @@ static struct iap_event_descr iap_events IAPDESCR(2EH_01H, 0x2E, 0x01, IAP_F_FM | IAP_F_WM), IAPDESCR(2EH_02H, 0x2E, 0x02, IAP_F_FM | IAP_F_WM), IAPDESCR(2EH_41H, 0x2E, 0x41, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), IAPDESCR(2EH_4FH, 0x2E, 0x4F, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), IAPDESCR(30H, 0x30, IAP_M_CORE | IAP_M_MESI | IAP_M_PREFETCH, IAP_F_ALLCPUSCORE2), @@ -1359,7 +1359,7 @@ static struct iap_event_descr iap_events IAPDESCR(BFH_05H, 0xBF, 0x05, IAP_F_FM | IAP_F_SB | IAP_F_SBX), IAPDESCR(C0H_00H, 0xC0, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2 | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), IAPDESCR(C0H_01H, 0xC0, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 08:33:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D7D4A54A; Tue, 30 Apr 2013 08:33:38 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CA0DB12DF; Tue, 30 Apr 2013 08:33:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3U8XchP036502; Tue, 30 Apr 2013 08:33:38 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3U8XcHB036501; Tue, 30 Apr 2013 08:33:38 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201304300833.r3U8XcHB036501@svn.freebsd.org> From: Davide Italiano Date: Tue, 30 Apr 2013 08:33:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250097 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 08:33:38 -0000 Author: davide Date: Tue Apr 30 08:33:38 2013 New Revision: 250097 URL: http://svnweb.freebsd.org/changeset/base/250097 Log: When hwpmc(4) module is unloaded it reports a double leakage. This happens at least if FreeBSD is ran under VirtualBox. In order to avoid the leakage, properly deallocate structures in case CPU claims that hw performance monitoring counters are not supported. Reported by: hiren Modified: head/sys/dev/hwpmc/hwpmc_intel.c Modified: head/sys/dev/hwpmc/hwpmc_intel.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_intel.c Tue Apr 30 08:18:08 2013 (r250096) +++ head/sys/dev/hwpmc/hwpmc_intel.c Tue Apr 30 08:33:38 2013 (r250097) @@ -87,7 +87,7 @@ pmc_intel_initialize(void) cputype = -1; nclasses = 2; - + error = 0; model = ((cpu_id & 0xF0000) >> 12) | ((cpu_id & 0xF0) >> 4); switch (cpu_id & 0xF00) { @@ -192,10 +192,6 @@ pmc_intel_initialize(void) ncpus = pmc_cpu_max(); - error = pmc_tsc_initialize(pmc_mdep, ncpus); - if (error) - goto error; - switch (cputype) { #if defined(__i386__) || defined(__amd64__) /* @@ -271,10 +267,10 @@ pmc_intel_initialize(void) break; } #endif - + error = pmc_tsc_initialize(pmc_mdep, ncpus); error: if (error) { - free(pmc_mdep, M_PMC); + pmc_mdep_free(pmc_mdep); pmc_mdep = NULL; } From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 09:44:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 66857C3D for ; Tue, 30 Apr 2013 09:44:12 +0000 (UTC) (envelope-from westernunion18920@yahoo.in) Received: from n3-vm2.bullet.mail.ne1.yahoo.com (n3-vm2.bullet.mail.ne1.yahoo.com [98.138.229.226]) by mx1.freebsd.org (Postfix) with ESMTP id 2516615F8 for ; Tue, 30 Apr 2013 09:44:11 +0000 (UTC) Received: from [98.138.101.135] by n3.bullet.mail.ne1.yahoo.com with NNFMP; 30 Apr 2013 09:44:05 -0000 Received: from [98.136.168.83] by t7.bullet.mail.ne1.yahoo.com with NNFMP; 30 Apr 2013 09:44:05 -0000 Received: from [127.0.0.1] by store173.c108.cal.gq1.yahoo.com with NNFMP; 30 Apr 2013 09:44:05 -0000 X-yahoo-newman-expires: 1367318645 Date: Tue, 30 Apr 2013 02:44:05 -0700 (PDT) From: "western. Union" Sender: "western. Union" To: svn-src-head@freebsd.org Message-ID: <1261456747.687326.1367315045036.JavaMail.zimbra@store173.c108.cal.gq1.yahoo.com> Subject: Invitation: From Western union MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_687323_2053989706.1367315045035" X-Yahoo-Newman-Property: calendar-invite X-Yahoo-Newman-Id: westernunion18920:8639c546-5703-4e82-ab89-36fc6db10830:1367315045146:svn-src-head@freebsd.org X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: "western. Union" List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 09:44:12 -0000 ------=_Part_687323_2053989706.1367315045035 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit YAHOO! CALENDAR - YOU'RE INVITED! westernunion18920@yahoo.in has sent an invitation: >From Western union When: Tuesday, 30 April, 2013 11:00 a - 12:00 p (GMT+00:00) Your first payment of $4000 was sent to you today the MTCN NO is 6941311961,sender's name is Mr Edwin Manafa,So kindly reconfirm your Receiver Name,Your Address, and your telephone number,kindly Contact Western union Agent so he can activate the MTCN No to enable you pick up your $4000 from any western union in your country:And you will pay sum of $85 only for the activating fees. E-mail ( westernu.nionbj@live.com ) Contact Person; James Harrison Tel: +229 94351174 Make sure you send your full information so that you can pick up the $4000 from the western union in your country today. Best Regards Mr.William Okwadike *~*~*~*~*~*~*~*~*~* RSVP Now! http://calendar.yahoo.com/westernunion18920/rsvp?e=svn-src-head@freebsd.org&uid=8639c546-5703-4e82-ab89-36fc6db10830&tk=a6awla7x66VksnLk2IZDdy1144M-&hh=Hw18UImpuRJwdmF4G3kWoTyyuOo- ------=_Part_687323_2053989706.1367315045035-- From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 09:44:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0DFCBCA2 for ; Tue, 30 Apr 2013 09:44:28 +0000 (UTC) (envelope-from westernunion18920@yahoo.in) Received: from n8-vm2.bullet.mail.ne1.yahoo.com (n8-vm2.bullet.mail.ne1.yahoo.com [98.138.229.158]) by mx1.freebsd.org (Postfix) with ESMTP id A5F4B15FD for ; Tue, 30 Apr 2013 09:44:27 +0000 (UTC) Received: from [98.138.226.172] by n8.bullet.mail.ne1.yahoo.com with NNFMP; 30 Apr 2013 09:44:21 -0000 Received: from [98.136.168.83] by t1.bullet.mail.ne1.yahoo.com with NNFMP; 30 Apr 2013 09:44:20 -0000 Received: from [127.0.0.1] by store173.c108.cal.gq1.yahoo.com with NNFMP; 30 Apr 2013 09:44:20 -0000 X-yahoo-newman-expires: 1367318660 Date: Tue, 30 Apr 2013 02:44:20 -0700 (PDT) From: "western. Union" Sender: "western. Union" To: svn-src-head@freebsd.org Message-ID: <586376215.688126.1367315060656.JavaMail.zimbra@store173.c108.cal.gq1.yahoo.com> Subject: Cancelled: From Western union MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_688123_721463349.1367315060654" X-Yahoo-Newman-Property: calendar-invite X-Yahoo-Newman-Id: westernunion18920:8639c546-5703-4e82-ab89-36fc6db10830:1367315060758:svn-src-head@freebsd.org X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: "western. Union" List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 09:44:28 -0000 ------=_Part_688123_721463349.1367315060654 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit YAHOO! CALENDAR - CANCELLED EVENT westernunion18920@yahoo.in has cancelled the invitation: >From Western union When: Tuesday, 30 April, 2013 11:00 a - 12:00 p (GMT+00:00) Your first payment of $4000 was sent to you today the MTCN NO is 6941311961,sender's name is Mr Edwin Manafa,So kindly reconfirm your Receiver Name,Your Address, and your telephone number,kindly Contact Western union Agent so he can activate the MTCN No to enable you pick up your $4000 from any western union in your country:And you will pay sum of $85 only for the activating fees. E-mail ( westernu.nionbj@live.com ) Contact Person; James Harrison Tel: +229 94351174 Make sure you send your full information so that you can pick up the $4000 from the western union in your country today. Best Regards Mr.William Okwadike *~*~*~*~*~*~*~*~*~* Delete invite ? http://calendar.yahoo.com/westernunion18920/deleteInvite?e=svn-src-head@freebsd.org&uid=8639c546-5703-4e82-ab89-36fc6db10830&tk=4wfDcYckFSqa_gqzN7ycv346RwE-&hh=Hw18UImpuRJwdmF4G3kWoTyyuOo- ------=_Part_688123_721463349.1367315060654-- From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 09:57:06 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D4ED6198; Tue, 30 Apr 2013 09:57:06 +0000 (UTC) (envelope-from flo@zoidberg.smeets.im) Received: from mail.solomo.de (mail.solomo.de [IPv6:2a01:4f8:162:1142::2]) by mx1.freebsd.org (Postfix) with ESMTP id 94E1D16E0; Tue, 30 Apr 2013 09:57:06 +0000 (UTC) Received: from cpos1.nexxtmobile.de (localhost [127.0.0.1]) by mail.solomo.de (Postfix) with ESMTP id 6A5E01254A; Tue, 30 Apr 2013 11:57:05 +0200 (CEST) X-Virus-Scanned: amavisd-new at nexxtmobile.de Received: from mail.solomo.de ([127.0.0.1]) by cpos1.nexxtmobile.de (cpos1.nexxtmobile.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id G4lPmBQqtZF7; Tue, 30 Apr 2013 11:57:03 +0200 (CEST) Received: from zoidberg.smeets.im (zoidberg.smeets.im [85.214.194.88]) by mail.solomo.de (Postfix) with ESMTP id 8E6FB12542; Tue, 30 Apr 2013 11:57:03 +0200 (CEST) Received: by zoidberg.smeets.im (Postfix, from userid 1001) id 64B0D69F2A; Tue, 30 Apr 2013 11:57:03 +0200 (CEST) Date: Tue, 30 Apr 2013 11:57:03 +0200 From: Florian Smeets To: Carl Delsey Subject: Re: svn commit: r250079 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/ntb sys/dev/ntb/if_ntb sys/dev/ntb/ntb_hw sys/modules sys/modules/ntb sys/modules/ntb/if_ntb sys/modules/ntb/ntb_hw Message-ID: <20130430095703.GC14196@zoidberg.smeets.im> References: <201304292248.r3TMmrqT027087@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="rQ2U398070+RC21q" Content-Disposition: inline In-Reply-To: <201304292248.r3TMmrqT027087@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 09:57:06 -0000 --rQ2U398070+RC21q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 29, 2013 at 10:48:53PM +0000, Carl Delsey wrote: > Author: carl > Date: Mon Apr 29 22:48:53 2013 > New Revision: 250079 > URL: http://svnweb.freebsd.org/changeset/base/250079 >=20 > Log: > Add a new driver to support the Intel Non-Transparent Bridge(NTB). > =20 Hi Carl, This change breaks installworld. /usr/share/man/man4/nve.4.gz -> /usr/share/man/man4/ntb_hw.4.gz install: link /usr/share/man/man4/ntb_hw.4.gz -> /usr/share/man/man4/nve.4.= gz: No such file or directory *** [_maninstall] Error code 71 I think the following patch does what you intended? Index: share/man/man4/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- share/man/man4/Makefile (revision 250097) +++ share/man/man4/Makefile (working copy) @@ -648,7 +648,8 @@ netintro.4 networking.4 MLINKS+=3D${_nfe.4} ${_if_nfe.4} MLINKS+=3Dnge.4 if_nge.4 -MLINKS+=3D${_ntb.4} ${_if_ntb.4} ${_ntb_hw.4} +MLINKS+=3D${_ntb.4} ${_if_ntb.4} \ + ${_ntb.4} ${_ntb_hw.4} MLINKS+=3D${_nve.4} ${_if_nve.4} MLINKS+=3D${_nxge.4} ${_if_nxge.4} MLINKS+=3Dpatm.4 if_patm.4 With this installworld finished as expected. Florian --rQ2U398070+RC21q Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAlF/lW0ACgkQapo8P8lCvwnJpACgxtFsaxuLIgoYT5zCmZMFYd06 GIcAnjoaI5IillYfHj1SkbGH6li2odFL =Azqz -----END PGP SIGNATURE----- --rQ2U398070+RC21q-- From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 13:13:33 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6C95AC48; Tue, 30 Apr 2013 13:13:33 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5F6081245; Tue, 30 Apr 2013 13:13:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UDDXst036848; Tue, 30 Apr 2013 13:13:33 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UDDXGN036847; Tue, 30 Apr 2013 13:13:33 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201304301313.r3UDDXGN036847@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 30 Apr 2013 13:13:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250099 - head/tools/tools/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 13:13:33 -0000 Author: luigi Date: Tue Apr 30 13:13:32 2013 New Revision: 250099 URL: http://svnweb.freebsd.org/changeset/base/250099 Log: sync with my local copy (this file may go away, eventually) Modified: head/tools/tools/netmap/README Modified: head/tools/tools/netmap/README ============================================================================== --- head/tools/tools/netmap/README Tue Apr 30 10:05:47 2013 (r250098) +++ head/tools/tools/netmap/README Tue Apr 30 13:13:32 2013 (r250099) @@ -21,3 +21,4 @@ BSD netmap 0.77 3.82 ports/trafshow (version 5) 0.94 7.7 net-mgmt/ipcad (ip accounting daemon) 0.9 5.0 net-mgmt/darkstat (ip accounting + graphing) + 0.83 2.45 net-mgmt/iftop (curses traffic display) From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 13:20:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 58C7CF8A; Tue, 30 Apr 2013 13:20:12 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 308791299; Tue, 30 Apr 2013 13:20:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UDKCwG038199; Tue, 30 Apr 2013 13:20:12 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UDKBoM038197; Tue, 30 Apr 2013 13:20:11 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201304301320.r3UDKBoM038197@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 30 Apr 2013 13:20:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250100 - in head/release/picobsd/floppy.tree/etc: . ssh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 13:20:12 -0000 Author: luigi Date: Tue Apr 30 13:20:11 2013 New Revision: 250100 URL: http://svnweb.freebsd.org/changeset/base/250100 Log: support for sshd (newer config file location) Added: head/release/picobsd/floppy.tree/etc/ssh/ head/release/picobsd/floppy.tree/etc/ssh/sshd_config - copied unchanged from r243964, head/release/picobsd/floppy.tree/etc/sshd_config Deleted: head/release/picobsd/floppy.tree/etc/sshd_config Modified: head/release/picobsd/floppy.tree/etc/master.passwd Modified: head/release/picobsd/floppy.tree/etc/master.passwd ============================================================================== --- head/release/picobsd/floppy.tree/etc/master.passwd Tue Apr 30 13:13:32 2013 (r250099) +++ head/release/picobsd/floppy.tree/etc/master.passwd Tue Apr 30 13:20:11 2013 (r250100) @@ -5,6 +5,7 @@ daemon:*:1:1::0:0:Owner of many system p operator:*:2:20::0:0:System &:/usr/guest/operator:/bin/csh bin:*:3:7::0:0:Binaries Commands and Source,,,:/:/nonexistent tty:*:4:65533::0:0:Tty Sandbox:/:/nonexistent +sshd:*:22:22::0:0:Secure Shell Daemon:/var/empty:/usr/sbin/nologin nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/nonexistent _dhcp:*:65:65::0:0:dhcp programs:/var/empty:/usr/sbin/nologin user:*:1002:1002:Sample User:0:0:user:/home/user:/bin/sh Copied: head/release/picobsd/floppy.tree/etc/ssh/sshd_config (from r243964, head/release/picobsd/floppy.tree/etc/sshd_config) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/picobsd/floppy.tree/etc/ssh/sshd_config Tue Apr 30 13:20:11 2013 (r250100, copy of r243964, head/release/picobsd/floppy.tree/etc/sshd_config) @@ -0,0 +1,29 @@ +Port 22 +ListenAddress 0.0.0.0 +HostKey /etc/ssh_host_key +RandomSeed /etc/ssh_random_seed +ServerKeyBits 768 +LoginGraceTime 600 +KeyRegenerationInterval 3600 +PermitRootLogin yes +IgnoreRhosts no +StrictModes yes +QuietMode no +X11Forwarding no +X11DisplayOffset 10 +FascistLogging no +PrintMotd yes +KeepAlive yes +SyslogFacility AUTH +RhostsAuthentication no +RhostsRSAAuthentication yes +RSAAuthentication yes +PasswordAuthentication no +PermitEmptyPasswords no +UseLogin no +# CheckMail no +# PidFile /u/zappa/.ssh/pid +# AllowHosts *.our.com friend.other.com +# DenyHosts lowsecurity.theirs.com *.evil.org evil.org +# Umask 022 +# SilentDeny yes From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 14:56:42 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F2413B47; Tue, 30 Apr 2013 14:56:41 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E3DF8177C; Tue, 30 Apr 2013 14:56:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UEufDo072226; Tue, 30 Apr 2013 14:56:41 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UEufcC072225; Tue, 30 Apr 2013 14:56:41 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201304301456.r3UEufcC072225@svn.freebsd.org> From: Davide Italiano Date: Tue, 30 Apr 2013 14:56:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250101 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 14:56:42 -0000 Author: davide Date: Tue Apr 30 14:56:41 2013 New Revision: 250101 URL: http://svnweb.freebsd.org/changeset/base/250101 Log: Complete r250097: Do not change the initialization order in pmc_intel_initialize(). Modified: head/sys/dev/hwpmc/hwpmc_intel.c Modified: head/sys/dev/hwpmc/hwpmc_intel.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_intel.c Tue Apr 30 13:20:11 2013 (r250100) +++ head/sys/dev/hwpmc/hwpmc_intel.c Tue Apr 30 14:56:41 2013 (r250101) @@ -191,7 +191,9 @@ pmc_intel_initialize(void) pmc_mdep->pmd_switch_out = intel_switch_out; ncpus = pmc_cpu_max(); - + error = pmc_tsc_initialize(pmc_mdep, ncpus); + if (error) + goto error; switch (cputype) { #if defined(__i386__) || defined(__amd64__) /* @@ -246,8 +248,10 @@ pmc_intel_initialize(void) KASSERT(0, ("[intel,%d] Unknown CPU type", __LINE__)); } - if (error) + if (error) { + pmc_tsc_finalize(pmc_mdep); goto error; + } /* * Init the uncore class. @@ -267,7 +271,6 @@ pmc_intel_initialize(void) break; } #endif - error = pmc_tsc_initialize(pmc_mdep, ncpus); error: if (error) { pmc_mdep_free(pmc_mdep); From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 15:06:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 12746E6B; Tue, 30 Apr 2013 15:06:31 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 04C4417DE; Tue, 30 Apr 2013 15:06:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UF6USn075892; Tue, 30 Apr 2013 15:06:30 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UF6UDa075891; Tue, 30 Apr 2013 15:06:30 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201304301506.r3UF6UDa075891@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 30 Apr 2013 15:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250102 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 15:06:31 -0000 Author: jilles Date: Tue Apr 30 15:06:30 2013 New Revision: 250102 URL: http://svnweb.freebsd.org/changeset/base/250102 Log: socket: Make shutdown() wake up a blocked accept(). A blocking accept (and some other operations) waits on &so->so_timeo. Once it wakes up, it will detect the SBS_CANTRCVMORE bit. The error from accept() is [ECONNABORTED] which is not the nicest one -- the thread calling accept() needs to know out-of-band what is happening. A spurious wakeup on so->so_timeo appears harmless (sleep retried) except when lingering on close (SO_LINGER, and in that case there is no descriptor to call shutdown() on) so this should be fairly safe. A shutdown() already woke up a blocked accept() for TCP sockets, but not for Unix domain sockets. This fix is generic for all domains. This patch was sent to -hackers@ and -net@ on April 5. MFC after: 2 weeks Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Tue Apr 30 14:56:41 2013 (r250101) +++ head/sys/kern/uipc_socket.c Tue Apr 30 15:06:30 2013 (r250102) @@ -2429,9 +2429,11 @@ soshutdown(struct socket *so, int how) sorflush(so); if (how != SHUT_RD) { error = (*pr->pr_usrreqs->pru_shutdown)(so); + wakeup(&so->so_timeo); CURVNET_RESTORE(); return (error); } + wakeup(&so->so_timeo); CURVNET_RESTORE(); return (0); } From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 15:31:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AF58E782; Tue, 30 Apr 2013 15:31:46 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A1D831A4C; Tue, 30 Apr 2013 15:31:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UFVkcb085542; Tue, 30 Apr 2013 15:31:46 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UFVkC2085540; Tue, 30 Apr 2013 15:31:46 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201304301531.r3UFVkC2085540@svn.freebsd.org> From: Davide Italiano Date: Tue, 30 Apr 2013 15:31:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250103 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 15:31:46 -0000 Author: davide Date: Tue Apr 30 15:31:45 2013 New Revision: 250103 URL: http://svnweb.freebsd.org/changeset/base/250103 Log: The Intel PMC architectural events have encodings which are identical to those of some non-architectural core events. This is not a problem in the general case as long as there's an 1:1 mapping between the two, but there are few exceptions. For example, 3CH_01H on Nehalem/Westmere represents both unhalted-reference-cycles and CPU_CLK_UNHALTED.REF_P. CPU_CLK_UNHALTED.REF_P on the aforementioned architectures does not measure reference (i.e. bus) but TSC, so there's the need to disambiguate. In order to avoid the namespace collision rename all the architectural events in a way they cannot be ambigous and refactor the architectural events handling function to reflect this change. While here, per Jim Harris request, rename iap_architectural_event_is_unsupported() to iap_event_is_architectural(). Discussed with: jimharris Reviewed by: jimharris, gnn Modified: head/sys/dev/hwpmc/hwpmc_core.c head/sys/dev/hwpmc/pmc_events.h Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Tue Apr 30 15:06:30 2013 (r250102) +++ head/sys/dev/hwpmc/hwpmc_core.c Tue Apr 30 15:31:45 2013 (r250103) @@ -60,6 +60,10 @@ __FBSDID("$FreeBSD$"); PMC_CAP_EDGE | PMC_CAP_THRESHOLD | PMC_CAP_READ | PMC_CAP_WRITE | \ PMC_CAP_INVERT | PMC_CAP_QUALIFIER | PMC_CAP_PRECISE) +#define EV_IS_NOTARCH 0 +#define EV_IS_ARCH_SUPP 1 +#define EV_IS_ARCH_NOTSUPP -1 + /* * "Architectural" events defined by Intel. The values of these * symbols correspond to positions in the bitmask returned by @@ -1723,43 +1727,53 @@ iap_pmc_has_overflowed(int ri) /* * Check an event against the set of supported architectural events. * - * Returns 1 if the event is architectural and unsupported on this - * CPU. Returns 0 otherwise. + * If the event is not architectural EV_IS_NOTARCH is returned. + * If the event is architectural and supported on this CPU, the correct + * event+umask mapping is returned in map, and EV_IS_ARCH_SUPP is returned. + * Otherwise, the function returns EV_IS_ARCH_NOTSUPP. */ static int -iap_architectural_event_is_unsupported(enum pmc_event pe) +iap_is_event_architectural(enum pmc_event pe, enum pmc_event *map) { enum core_arch_events ae; switch (pe) { - case PMC_EV_IAP_EVENT_3CH_00H: + case PMC_EV_IAP_ARCH_UNH_COR_CYC: ae = CORE_AE_UNHALTED_CORE_CYCLES; + *map = PMC_EV_IAP_EVENT_C4H_00H; break; - case PMC_EV_IAP_EVENT_C0H_00H: + case PMC_EV_IAP_ARCH_INS_RET: ae = CORE_AE_INSTRUCTION_RETIRED; + *map = PMC_EV_IAP_EVENT_C0H_00H; break; - case PMC_EV_IAP_EVENT_3CH_01H: + case PMC_EV_IAP_ARCH_UNH_REF_CYC: ae = CORE_AE_UNHALTED_REFERENCE_CYCLES; + *map = PMC_EV_IAP_EVENT_3CH_01H; break; - case PMC_EV_IAP_EVENT_2EH_4FH: + case PMC_EV_IAP_ARCH_LLC_REF: ae = CORE_AE_LLC_REFERENCE; + *map = PMC_EV_IAP_EVENT_2EH_4FH; break; - case PMC_EV_IAP_EVENT_2EH_41H: + case PMC_EV_IAP_ARCH_LLC_MIS: ae = CORE_AE_LLC_MISSES; + *map = PMC_EV_IAP_EVENT_2EH_41H; break; - case PMC_EV_IAP_EVENT_C4H_00H: + case PMC_EV_IAP_ARCH_BR_INS_RET: ae = CORE_AE_BRANCH_INSTRUCTION_RETIRED; + *map = PMC_EV_IAP_EVENT_C4H_00H; break; - case PMC_EV_IAP_EVENT_C5H_00H: + case PMC_EV_IAP_ARCH_BR_MIS_RET: ae = CORE_AE_BRANCH_MISSES_RETIRED; + *map = PMC_EV_IAP_EVENT_C5H_00H; break; default: /* Non architectural event. */ - return (0); + return (EV_IS_NOTARCH); } - return ((core_architectural_events & (1 << ae)) == 0); + return (((core_architectural_events & (1 << ae)) == 0) ? + EV_IS_ARCH_NOTSUPP : EV_IS_ARCH_SUPP); } static int @@ -1917,8 +1931,8 @@ static int iap_allocate_pmc(int cpu, int ri, struct pmc *pm, const struct pmc_op_pmcallocate *a) { - int n, model; - enum pmc_event ev; + int arch, n, model; + enum pmc_event ev, map; struct iap_event_descr *ie; uint32_t c, caps, config, cpuflag, evsel, mask; @@ -1932,10 +1946,13 @@ iap_allocate_pmc(int cpu, int ri, struct if ((IAP_PMC_CAPS & caps) != caps) return (EPERM); - ev = pm->pm_event; - - if (iap_architectural_event_is_unsupported(ev)) + arch = iap_is_event_architectural(pm->pm_event, &map); + if (arch == EV_IS_ARCH_NOTSUPP) return (EOPNOTSUPP); + else if (arch == EV_IS_ARCH_SUPP) + ev = map; + else + ev = pm->pm_event; /* * A small number of events are not supported in all the Modified: head/sys/dev/hwpmc/pmc_events.h ============================================================================== --- head/sys/dev/hwpmc/pmc_events.h Tue Apr 30 15:06:30 2013 (r250102) +++ head/sys/dev/hwpmc/pmc_events.h Tue Apr 30 15:31:45 2013 (r250103) @@ -468,6 +468,13 @@ __PMC_EV_ALIAS("unhalted-reference-cycle * the CPU model happens inside hwpmc(4). */ #define __PMC_EV_IAP() \ +__PMC_EV(IAP, ARCH_BR_INS_RET) \ +__PMC_EV(IAP, ARCH_BR_MIS_RET) \ +__PMC_EV(IAP, ARCH_INS_RET) \ +__PMC_EV(IAP, ARCH_LLC_MIS) \ +__PMC_EV(IAP, ARCH_LLC_REF) \ +__PMC_EV(IAP, ARCH_UNH_REF_CYC) \ +__PMC_EV(IAP, ARCH_UNH_COR_CYC) \ __PMC_EV(IAP, EVENT_02H_01H) \ __PMC_EV(IAP, EVENT_02H_81H) \ __PMC_EV(IAP, EVENT_03H_00H) \ @@ -1157,20 +1164,20 @@ __PMC_EV(IAP, EVENT_FDH_10H) \ __PMC_EV(IAP, EVENT_FDH_20H) \ __PMC_EV(IAP, EVENT_FDH_40H) -#define PMC_EV_IAP_FIRST PMC_EV_IAP_EVENT_02H_01H +#define PMC_EV_IAP_FIRST PMC_EV_IAP_ARCH_BR_INS_RET #define PMC_EV_IAP_LAST PMC_EV_IAP_EVENT_FDH_40H /* * Map "architectural" event names to event ids. */ #define __PMC_EV_ALIAS_INTEL_ARCHITECTURAL() \ -__PMC_EV_ALIAS("branch-instruction-retired", IAP_EVENT_C4H_00H) \ -__PMC_EV_ALIAS("branch-misses-retired", IAP_EVENT_C5H_00H) \ -__PMC_EV_ALIAS("instruction-retired", IAP_EVENT_C0H_00H) \ -__PMC_EV_ALIAS("llc-misses", IAP_EVENT_2EH_41H) \ -__PMC_EV_ALIAS("llc-reference", IAP_EVENT_2EH_4FH) \ -__PMC_EV_ALIAS("unhalted-reference-cycles", IAP_EVENT_3CH_01H) \ -__PMC_EV_ALIAS("unhalted-core-cycles", IAP_EVENT_3CH_00H) +__PMC_EV_ALIAS("branch-instruction-retired", IAP_ARCH_BR_INS_RET) \ +__PMC_EV_ALIAS("branch-misses-retired", IAP_ARCH_BR_MIS_RET) \ +__PMC_EV_ALIAS("instruction-retired", IAP_ARCH_INS_RET) \ +__PMC_EV_ALIAS("llc-misses", IAP_ARCH_LLC_MIS) \ +__PMC_EV_ALIAS("llc-reference", IAP_ARCH_LLC_REF) \ +__PMC_EV_ALIAS("unhalted-reference-cycles", IAP_ARCH_UNH_REF_CYC) \ +__PMC_EV_ALIAS("unhalted-core-cycles", IAP_ARCH_UNH_COR_CYC) /* * Aliases for Atom PMCs. From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 15:38:32 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 72D91A03; Tue, 30 Apr 2013 15:38:32 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 625C81A9C; Tue, 30 Apr 2013 15:38:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UFcWNt086773; Tue, 30 Apr 2013 15:38:32 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UFcW1D086772; Tue, 30 Apr 2013 15:38:32 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201304301538.r3UFcW1D086772@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Tue, 30 Apr 2013 15:38:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250104 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 15:38:32 -0000 Author: des Date: Tue Apr 30 15:38:31 2013 New Revision: 250104 URL: http://svnweb.freebsd.org/changeset/base/250104 Log: Forgot to update UPDATING in head last night. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Apr 30 15:31:45 2013 (r250103) +++ head/UPDATING Tue Apr 30 15:38:31 2013 (r250104) @@ -31,6 +31,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20130429: + Fix a bug that allows NFS clients to issue READDIR on files. + 20130426: The WITHOUT_IDEA option has been removed because the IDEA patent expired. From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 15:59:23 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2DA65478; Tue, 30 Apr 2013 15:59:23 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 06BCE1BCB; Tue, 30 Apr 2013 15:59:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UFxM8F094040; Tue, 30 Apr 2013 15:59:22 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UFxM88094038; Tue, 30 Apr 2013 15:59:22 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201304301559.r3UFxM88094038@svn.freebsd.org> From: Davide Italiano Date: Tue, 30 Apr 2013 15:59:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250105 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 15:59:23 -0000 Author: davide Date: Tue Apr 30 15:59:22 2013 New Revision: 250105 URL: http://svnweb.freebsd.org/changeset/base/250105 Log: malloc(9) cannot return NULL if M_WAITOK flag is specified. Modified: head/sys/dev/hwpmc/hwpmc_mod.c head/sys/dev/hwpmc/hwpmc_soft.c Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Tue Apr 30 15:38:31 2013 (r250104) +++ head/sys/dev/hwpmc/hwpmc_mod.c Tue Apr 30 15:59:22 2013 (r250105) @@ -2210,11 +2210,8 @@ pmc_allocate_pmc_descriptor(void) struct pmc *pmc; pmc = malloc(sizeof(struct pmc), M_PMC, M_WAITOK|M_ZERO); - - if (pmc != NULL) { - pmc->pm_owner = NULL; - LIST_INIT(&pmc->pm_targets); - } + pmc->pm_owner = NULL; + LIST_INIT(&pmc->pm_targets); PMCDBG(PMC,ALL,1, "allocate-pmc -> pmc=%p", pmc); @@ -4671,13 +4668,10 @@ pmc_mdep_alloc(int nclasses) n = 1 + nclasses; md = malloc(sizeof(struct pmc_mdep) + n * sizeof(struct pmc_classdep), M_PMC, M_WAITOK|M_ZERO); - if (md != NULL) { - md->pmd_nclass = n; - - /* Add base class. */ - pmc_soft_initialize(md); - } + md->pmd_nclass = n; + /* Add base class. */ + pmc_soft_initialize(md); return md; } @@ -4889,9 +4883,6 @@ pmc_initialize(void) pmc_pmcdisp = malloc(sizeof(enum pmc_mode) * md->pmd_npmc, M_PMC, M_WAITOK|M_ZERO); - KASSERT(pmc_pmcdisp != NULL, - ("[pmc,%d] pmcdisp allocation returned NULL", __LINE__)); - /* mark all PMCs as available */ for (n = 0; n < (int) md->pmd_npmc; n++) PMC_MARK_ROW_FREE(n); Modified: head/sys/dev/hwpmc/hwpmc_soft.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_soft.c Tue Apr 30 15:38:31 2013 (r250104) +++ head/sys/dev/hwpmc/hwpmc_soft.c Tue Apr 30 15:59:22 2013 (r250105) @@ -241,9 +241,6 @@ soft_pcpu_init(struct pmc_mdep *md, int __LINE__)); soft_pc = malloc(sizeof(struct soft_cpu), M_PMC, M_WAITOK|M_ZERO); - if (soft_pc == NULL) - return (ENOMEM); - pc = pmc_pcpu[cpu]; KASSERT(pc != NULL, ("[soft,%d] cpu %d null per-cpu", __LINE__, cpu)); From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 16:00:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3DCF9608; Tue, 30 Apr 2013 16:00:22 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 30EE61BDE; Tue, 30 Apr 2013 16:00:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UG0MTv094419; Tue, 30 Apr 2013 16:00:22 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UG0LOt094416; Tue, 30 Apr 2013 16:00:21 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201304301600.r3UG0LOt094416@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 30 Apr 2013 16:00:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250106 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 16:00:22 -0000 Author: luigi Date: Tue Apr 30 16:00:21 2013 New Revision: 250106 URL: http://svnweb.freebsd.org/changeset/base/250106 Log: remove $Id$ (whitespace change) Modified: head/sys/net/netmap.h head/sys/net/netmap_user.h Modified: head/sys/net/netmap.h ============================================================================== --- head/sys/net/netmap.h Tue Apr 30 15:59:22 2013 (r250105) +++ head/sys/net/netmap.h Tue Apr 30 16:00:21 2013 (r250106) @@ -32,7 +32,6 @@ /* * $FreeBSD$ - * $Id: netmap.h 11997 2013-01-17 21:59:12Z luigi $ * * Definitions of constants and the structures used by the netmap * framework, for the part visible to both kernel and userspace. Modified: head/sys/net/netmap_user.h ============================================================================== --- head/sys/net/netmap_user.h Tue Apr 30 15:59:22 2013 (r250105) +++ head/sys/net/netmap_user.h Tue Apr 30 16:00:21 2013 (r250106) @@ -32,7 +32,6 @@ /* * $FreeBSD$ - * $Id: netmap_user.h 10597 2012-02-21 05:08:32Z luigi $ * * This header contains the macros used to manipulate netmap structures * and packets in userspace. See netmap(4) for more information. From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 16:08:35 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A03BCB69; Tue, 30 Apr 2013 16:08:35 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 840E21C41; Tue, 30 Apr 2013 16:08:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UG8Zi9097993; Tue, 30 Apr 2013 16:08:35 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UG8YhV097989; Tue, 30 Apr 2013 16:08:34 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201304301608.r3UG8YhV097989@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 30 Apr 2013 16:08:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250107 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 16:08:35 -0000 Author: luigi Date: Tue Apr 30 16:08:34 2013 New Revision: 250107 URL: http://svnweb.freebsd.org/changeset/base/250107 Log: Partial cleanup in preparation for upcoming changes: - netmap_rx_irq()/netmap_tx_irq() can now be called by FreeBSD drivers hiding the logic for handling NIC interrupts in netmap mode. This also simplifies the case of NICs attached to VALE switches. Individual drivers will be updated with separate commits. - use the same refcount() API for FreeBSD and linux - plus some comments, typos and formatting fixes Portions contributed by Michio Honda Modified: head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_kern.h Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Tue Apr 30 16:00:21 2013 (r250106) +++ head/sys/dev/netmap/netmap.c Tue Apr 30 16:08:34 2013 (r250107) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011-2012 Matteo Landi, Luigi Rizzo. All rights reserved. + * Copyright (C) 2011-2013 Matteo Landi, Luigi Rizzo. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -123,12 +123,10 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, no_pen int netmap_drop = 0; /* debugging */ int netmap_flags = 0; /* debug flags */ int netmap_fwd = 0; /* force transparent mode */ -int netmap_copy = 0; /* debugging, copy content */ SYSCTL_INT(_dev_netmap, OID_AUTO, drop, CTLFLAG_RW, &netmap_drop, 0 , ""); SYSCTL_INT(_dev_netmap, OID_AUTO, flags, CTLFLAG_RW, &netmap_flags, 0 , ""); SYSCTL_INT(_dev_netmap, OID_AUTO, fwd, CTLFLAG_RW, &netmap_fwd, 0 , ""); -SYSCTL_INT(_dev_netmap, OID_AUTO, copy, CTLFLAG_RW, &netmap_copy, 0 , ""); #ifdef NM_BRIDGE /* support for netmap bridge */ @@ -155,18 +153,27 @@ int netmap_bridge = NM_BDG_BATCH; /* bri SYSCTL_INT(_dev_netmap, OID_AUTO, bridge, CTLFLAG_RW, &netmap_bridge, 0 , ""); #ifdef linux -#define ADD_BDG_REF(ifp) (NA(ifp)->if_refcount++) -#define DROP_BDG_REF(ifp) (NA(ifp)->if_refcount-- <= 1) + +#define refcount_acquire(_a) atomic_add(1, (atomic_t *)_a) +#define refcount_release(_a) atomic_dec_and_test((atomic_t *)_a) + #else /* !linux */ -#define ADD_BDG_REF(ifp) (ifp)->if_refcount++ -#define DROP_BDG_REF(ifp) refcount_release(&(ifp)->if_refcount) + #ifdef __FreeBSD__ #include #include #endif /* __FreeBSD__ */ + #define prefetch(x) __builtin_prefetch(x) + #endif /* !linux */ +/* + * These are used to handle reference counters for bridge ports. + */ +#define ADD_BDG_REF(ifp) refcount_acquire(&NA(ifp)->na_bdg_refcount) +#define DROP_BDG_REF(ifp) refcount_release(&NA(ifp)->na_bdg_refcount) + static void bdg_netmap_attach(struct ifnet *ifp); static int bdg_netmap_reg(struct ifnet *ifp, int onoff); /* per-tx-queue entry */ @@ -183,9 +190,14 @@ struct nm_hash_ent { }; /* - * Interfaces for a bridge are all in ports[]. + * Interfaces for a bridge are all in bdg_ports[]. * The array has fixed size, an empty entry does not terminate - * the search. + * the search. But lookups only occur on attach/detach so we + * don't mind if they are slow. + * + * The bridge is non blocking on the transmit ports. + * + * bdg_lock protects accesses to the bdg_ports array. */ struct nm_bridge { struct ifnet *bdg_ports[NM_BDG_MAXPORTS]; @@ -1668,19 +1680,25 @@ netmap_attach(struct netmap_adapter *arg ND("using default locks for %s", ifp->if_xname); na->nm_lock = netmap_lock_wrapper; } + #ifdef linux - if (ifp->netdev_ops) { - ND("netdev_ops %p", ifp->netdev_ops); - /* prepare a clone of the netdev ops */ - na->nm_ndo = *ifp->netdev_ops; + if (!ifp->netdev_ops) { + D("ouch, we cannot override netdev_ops"); + goto fail; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28) + /* if needed, prepare a clone of the entire netdev ops */ + na->nm_ndo = *ifp->netdev_ops; +#endif /* 2.6.28 and above */ na->nm_ndo.ndo_start_xmit = linux_netmap_start; -#endif +#endif /* linux */ + D("success for %s", ifp->if_xname); return 0; fail: D("fail, arg %p ifp %p na %p", arg, ifp, na); + netmap_detach(ifp); return (na ? EINVAL : ENOMEM); } @@ -1726,17 +1744,18 @@ netmap_start(struct ifnet *ifp, struct m if (netmap_verbose & NM_VERB_HOST) D("%s packet %d len %d from the stack", ifp->if_xname, kring->nr_hwcur + kring->nr_hwavail, len); + if (len > NETMAP_BUF_SIZE) { /* too long for us */ + D("%s from_host, drop packet size %d > %d", ifp->if_xname, + len, NETMAP_BUF_SIZE); + m_freem(m); + return EINVAL; + } na->nm_lock(ifp, NETMAP_CORE_LOCK, 0); if (kring->nr_hwavail >= lim) { if (netmap_verbose) D("stack ring %s full\n", ifp->if_xname); goto done; /* no space */ } - if (len > NETMAP_BUF_SIZE) { - D("%s from_host, drop packet size %d > %d", ifp->if_xname, - len, NETMAP_BUF_SIZE); - goto done; /* too long for us */ - } /* compute the insert position */ i = kring->nr_hwcur + kring->nr_hwavail; @@ -1837,6 +1856,10 @@ netmap_reset(struct netmap_adapter *na, * N rings, separate locks: * lock(i); wake(i); unlock(i); lock(core) wake(N+1) unlock(core) * work_done is non-null on the RX path. + * + * The 'q' argument also includes flag to tell whether the queue is + * already locked on enter, and whether it should remain locked on exit. + * This helps adapting to different defaults in drivers and OSes. */ int netmap_rx_irq(struct ifnet *ifp, int q, int *work_done) @@ -1844,9 +1867,14 @@ netmap_rx_irq(struct ifnet *ifp, int q, struct netmap_adapter *na; struct netmap_kring *r; NM_SELINFO_T *main_wq; + int locktype, unlocktype, lock; if (!(ifp->if_capenable & IFCAP_NETMAP)) return 0; + + lock = q & (NETMAP_LOCKED_ENTER | NETMAP_LOCKED_EXIT); + q = q & NETMAP_RING_MASK; + ND(5, "received %s queue %d", work_done ? "RX" : "TX" , q); na = NA(ifp); if (na->na_flags & NAF_SKIP_INTR) { @@ -1856,32 +1884,42 @@ netmap_rx_irq(struct ifnet *ifp, int q, if (work_done) { /* RX path */ if (q >= na->num_rx_rings) - return 0; // regular queue + return 0; // not a physical queue r = na->rx_rings + q; r->nr_kflags |= NKR_PENDINTR; main_wq = (na->num_rx_rings > 1) ? &na->rx_si : NULL; - } else { /* tx path */ + locktype = NETMAP_RX_LOCK; + unlocktype = NETMAP_RX_UNLOCK; + } else { /* TX path */ if (q >= na->num_tx_rings) - return 0; // regular queue + return 0; // not a physical queue r = na->tx_rings + q; main_wq = (na->num_tx_rings > 1) ? &na->tx_si : NULL; work_done = &q; /* dummy */ + locktype = NETMAP_TX_LOCK; + unlocktype = NETMAP_TX_UNLOCK; } if (na->separate_locks) { - mtx_lock(&r->q_lock); + if (!(lock & NETMAP_LOCKED_ENTER)) + na->nm_lock(ifp, locktype, q); selwakeuppri(&r->si, PI_NET); - mtx_unlock(&r->q_lock); + na->nm_lock(ifp, unlocktype, q); if (main_wq) { - mtx_lock(&na->core_lock); + na->nm_lock(ifp, NETMAP_CORE_LOCK, 0); selwakeuppri(main_wq, PI_NET); - mtx_unlock(&na->core_lock); + na->nm_lock(ifp, NETMAP_CORE_UNLOCK, 0); } + /* lock the queue again if requested */ + if (lock & NETMAP_LOCKED_EXIT) + na->nm_lock(ifp, locktype, q); } else { - mtx_lock(&na->core_lock); + if (!(lock & NETMAP_LOCKED_ENTER)) + na->nm_lock(ifp, NETMAP_CORE_LOCK, 0); selwakeuppri(&r->si, PI_NET); if (main_wq) selwakeuppri(main_wq, PI_NET); - mtx_unlock(&na->core_lock); + if (!(lock & NETMAP_LOCKED_EXIT)) + na->nm_lock(ifp, NETMAP_CORE_UNLOCK, 0); } *work_done = 1; /* do not fire napi again */ return 1; @@ -1902,7 +1940,9 @@ netmap_rx_irq(struct ifnet *ifp, int q, static u_int linux_netmap_poll(struct file * file, struct poll_table_struct *pwait) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28) + int events = POLLIN | POLLOUT; /* XXX maybe... */ +#elif LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0) int events = pwait ? pwait->key : POLLIN | POLLOUT; #else /* in 3.4.0 field 'key' was renamed to '_key' */ int events = pwait ? pwait->_key : POLLIN | POLLOUT; @@ -1942,7 +1982,7 @@ linux_netmap_mmap(struct file *f, struct * vtophys mapping in lut[k] so we use that, scanning * the lut[] array in steps of clustentries, * and we map each cluster (not individual pages, - * it would be overkill). + * it would be overkill -- XXX slow ? 20130415). */ /* Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Tue Apr 30 16:00:21 2013 (r250106) +++ head/sys/dev/netmap/netmap_kern.h Tue Apr 30 16:08:34 2013 (r250107) @@ -210,10 +210,20 @@ struct netmap_adapter { int (*nm_config)(struct ifnet *, u_int *txr, u_int *txd, u_int *rxr, u_int *rxd); + /* + * Bridge support: + * + * bdg_port is the port number used in the bridge; + * na_bdg_refcount is a refcount used for bridge ports, + * when it goes to 0 we can detach+free this port + * (a bridge port is always attached if it exists; + * it is not always registered) + */ int bdg_port; + int na_bdg_refcount; + #ifdef linux struct net_device_ops nm_ndo; - int if_refcount; // XXX additions for bridge #endif /* linux */ }; @@ -248,6 +258,10 @@ enum { #endif }; +/* How to handle locking support in netmap_rx_irq/netmap_tx_irq */ +#define NETMAP_LOCKED_ENTER 0x10000000 /* already locked on enter */ +#define NETMAP_LOCKED_EXIT 0x20000000 /* keep locked on exit */ + /* * The following are support routines used by individual drivers to * support netmap operation. @@ -275,7 +289,7 @@ struct netmap_slot *netmap_reset(struct int netmap_ring_reinit(struct netmap_kring *); extern u_int netmap_buf_size; -#define NETMAP_BUF_SIZE netmap_buf_size +#define NETMAP_BUF_SIZE netmap_buf_size // XXX remove extern int netmap_mitigate; extern int netmap_no_pendintr; extern u_int netmap_total_buffers; @@ -437,7 +451,7 @@ netmap_idx_k2n(struct netmap_kring *kr, /* Entries of the look-up table. */ struct lut_entry { void *vaddr; /* virtual address. */ - vm_paddr_t paddr; /* phisical address. */ + vm_paddr_t paddr; /* physical address. */ }; struct netmap_obj_pool; @@ -470,6 +484,4 @@ PNMB(struct netmap_slot *slot, uint64_t int netmap_rx_irq(struct ifnet *, int, int *); #define netmap_tx_irq(_n, _q) netmap_rx_irq(_n, _q, NULL) - -extern int netmap_copy; #endif /* _NET_NETMAP_KERN_H_ */ From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 16:10:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A00EFCFE; Tue, 30 Apr 2013 16:10:19 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-we0-x22d.google.com (mail-we0-x22d.google.com [IPv6:2a00:1450:400c:c03::22d]) by mx1.freebsd.org (Postfix) with ESMTP id C8D021C54; Tue, 30 Apr 2013 16:10:18 +0000 (UTC) Received: by mail-we0-f173.google.com with SMTP id o7so565286wea.32 for ; Tue, 30 Apr 2013 09:10:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=nowYmetMoTsV+e6sfNaDoaKe30OMj36abn0VrMNb9sY=; b=mtPAP7jBDAP3chqjgl88qeczClgPxCl/TfjAzNaMZwjTycdsCaanuYkkfYdwB3PTYa BuO4seL20XJrgS7SRjU3/yUsxwys6qVY3OKOx/HucWOPCDqBWHKyfKM+YZrs1G8pi0b2 xC4COLqa6JewQ9wyPt9TDX36JtD/Mv8bsJHBUwcYCWsdwIj9dsil1Y1PyhBnvgWhKNjI cncZ000cWkJMPlfUoDioC/1i/ml7CFxI85m0KB0pu6bH4ExluTuF318pMQTzgpJD6nuF 1PvMhcQk745Zm8SkMNmhvdSRSqDA64ilB3j3sCCgY0+Yg6QFy5kwyJwFNRzdZ0uDy87E oLUQ== MIME-Version: 1.0 X-Received: by 10.180.183.50 with SMTP id ej18mr25639597wic.4.1367338217875; Tue, 30 Apr 2013 09:10:17 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.194.29.199 with HTTP; Tue, 30 Apr 2013 09:10:17 -0700 (PDT) In-Reply-To: <201304301559.r3UFxM88094038@svn.freebsd.org> References: <201304301559.r3UFxM88094038@svn.freebsd.org> Date: Tue, 30 Apr 2013 20:10:17 +0400 X-Google-Sender-Auth: ME8zOrcBWu6-cf8vyU2t1AVD1gk Message-ID: Subject: Re: svn commit: r250105 - head/sys/dev/hwpmc From: Sergey Kandaurov To: Davide Italiano Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 16:10:19 -0000 Hi. On 30 April 2013 19:59, Davide Italiano wrote: > Author: davide > Date: Tue Apr 30 15:59:22 2013 > New Revision: 250105 > URL: http://svnweb.freebsd.org/changeset/base/250105 > > Log: > malloc(9) cannot return NULL if M_WAITOK flag is specified. > > Modified: > head/sys/dev/hwpmc/hwpmc_mod.c > head/sys/dev/hwpmc/hwpmc_soft.c > > Modified: head/sys/dev/hwpmc/hwpmc_mod.c > ============================================================================== > --- head/sys/dev/hwpmc/hwpmc_mod.c Tue Apr 30 15:38:31 2013 (r250104) > +++ head/sys/dev/hwpmc/hwpmc_mod.c Tue Apr 30 15:59:22 2013 (r250105) > @@ -2210,11 +2210,8 @@ pmc_allocate_pmc_descriptor(void) > struct pmc *pmc; > > pmc = malloc(sizeof(struct pmc), M_PMC, M_WAITOK|M_ZERO); > - > - if (pmc != NULL) { > - pmc->pm_owner = NULL; > - LIST_INIT(&pmc->pm_targets); > - } > + pmc->pm_owner = NULL; > + LIST_INIT(&pmc->pm_targets); > > PMCDBG(PMC,ALL,1, "allocate-pmc -> pmc=%p", pmc); > It looks like zeroing pm_owner can also be omitted with M_ZERO. -- wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 16:18:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 02817F7D; Tue, 30 Apr 2013 16:18:30 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D774F1CFB; Tue, 30 Apr 2013 16:18:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UGIU48001764; Tue, 30 Apr 2013 16:18:30 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UGIUdK001760; Tue, 30 Apr 2013 16:18:30 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201304301618.r3UGIUdK001760@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 30 Apr 2013 16:18:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250108 - in head/sys/dev: e1000 ixgbe re X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 16:18:31 -0000 Author: luigi Date: Tue Apr 30 16:18:29 2013 New Revision: 250108 URL: http://svnweb.freebsd.org/changeset/base/250108 Log: use netmap_rx_irq() / netmap_tx_irq() to handle interrupts in netmap mode, removing the logic from individual drivers. (note: if_lem.c not updated yet due to some other pending modifications) Modified: head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_igb.c head/sys/dev/ixgbe/ixgbe.c head/sys/dev/re/if_re.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Tue Apr 30 16:08:34 2013 (r250107) +++ head/sys/dev/e1000/if_em.c Tue Apr 30 16:18:29 2013 (r250108) @@ -3828,17 +3828,9 @@ em_txeof(struct tx_ring *txr) EM_TX_LOCK_ASSERT(txr); #ifdef DEV_NETMAP - if (ifp->if_capenable & IFCAP_NETMAP) { - struct netmap_adapter *na = NA(ifp); - - selwakeuppri(&na->tx_rings[txr->me].si, PI_NET); - EM_TX_UNLOCK(txr); - EM_CORE_LOCK(adapter); - selwakeuppri(&na->tx_si, PI_NET); - EM_CORE_UNLOCK(adapter); - EM_TX_LOCK(txr); + if (netmap_tx_irq(ifp, txr->me | + (NETMAP_LOCKED_ENTER | NETMAP_LOCKED_EXIT))) return; - } #endif /* DEV_NETMAP */ /* No work, make sure watchdog is off */ @@ -4440,17 +4432,8 @@ em_rxeof(struct rx_ring *rxr, int count, EM_RX_LOCK(rxr); #ifdef DEV_NETMAP - if (ifp->if_capenable & IFCAP_NETMAP) { - struct netmap_adapter *na = NA(ifp); - - na->rx_rings[rxr->me].nr_kflags |= NKR_PENDINTR; - selwakeuppri(&na->rx_rings[rxr->me].si, PI_NET); - EM_RX_UNLOCK(rxr); - EM_CORE_LOCK(adapter); - selwakeuppri(&na->rx_si, PI_NET); - EM_CORE_UNLOCK(adapter); - return (0); - } + if (netmap_rx_irq(ifp, rxr->me | NETMAP_LOCKED_ENTER, &processed)) + return (FALSE); #endif /* DEV_NETMAP */ for (i = rxr->next_to_check, processed = 0; count != 0;) { Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Tue Apr 30 16:08:34 2013 (r250107) +++ head/sys/dev/e1000/if_igb.c Tue Apr 30 16:18:29 2013 (r250108) @@ -3897,17 +3897,9 @@ igb_txeof(struct tx_ring *txr) IGB_TX_LOCK_ASSERT(txr); #ifdef DEV_NETMAP - if (ifp->if_capenable & IFCAP_NETMAP) { - struct netmap_adapter *na = NA(ifp); - - selwakeuppri(&na->tx_rings[txr->me].si, PI_NET); - IGB_TX_UNLOCK(txr); - IGB_CORE_LOCK(adapter); - selwakeuppri(&na->tx_si, PI_NET); - IGB_CORE_UNLOCK(adapter); - IGB_TX_LOCK(txr); - return FALSE; - } + if (netmap_tx_irq(ifp, txr->me | + (NETMAP_LOCKED_ENTER|NETMAP_LOCKED_EXIT))) + return (FALSE); #endif /* DEV_NETMAP */ if (txr->tx_avail == adapter->num_tx_desc) { txr->queue_status = IGB_QUEUE_IDLE; @@ -4761,17 +4753,8 @@ igb_rxeof(struct igb_queue *que, int cou BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); #ifdef DEV_NETMAP - if (ifp->if_capenable & IFCAP_NETMAP) { - struct netmap_adapter *na = NA(ifp); - - na->rx_rings[rxr->me].nr_kflags |= NKR_PENDINTR; - selwakeuppri(&na->rx_rings[rxr->me].si, PI_NET); - IGB_RX_UNLOCK(rxr); - IGB_CORE_LOCK(adapter); - selwakeuppri(&na->rx_si, PI_NET); - IGB_CORE_UNLOCK(adapter); - return (0); - } + if (netmap_rx_irq(ifp, rxr->me | NETMAP_LOCKED_ENTER, &processed)) + return (FALSE); #endif /* DEV_NETMAP */ /* Main clean loop */ Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Tue Apr 30 16:08:34 2013 (r250107) +++ head/sys/dev/ixgbe/ixgbe.c Tue Apr 30 16:18:29 2013 (r250108) @@ -3597,13 +3597,8 @@ ixgbe_txeof(struct tx_ring *txr) if (!netmap_mitigate || (kring->nr_kflags < kring->nkr_num_slots && txd[kring->nr_kflags].wb.status & IXGBE_TXD_STAT_DD)) { - kring->nr_kflags = kring->nkr_num_slots; - selwakeuppri(&na->tx_rings[txr->me].si, PI_NET); - IXGBE_TX_UNLOCK(txr); - IXGBE_CORE_LOCK(adapter); - selwakeuppri(&na->tx_si, PI_NET); - IXGBE_CORE_UNLOCK(adapter); - IXGBE_TX_LOCK(txr); + netmap_tx_irq(ifp, txr->me | + (NETMAP_LOCKED_ENTER|NETMAP_LOCKED_EXIT)); } return FALSE; } @@ -4388,23 +4383,9 @@ ixgbe_rxeof(struct ix_queue *que) IXGBE_RX_LOCK(rxr); #ifdef DEV_NETMAP - if (ifp->if_capenable & IFCAP_NETMAP) { - /* - * Same as the txeof routine: only wakeup clients on intr. - * NKR_PENDINTR in nr_kflags is used to implement interrupt - * mitigation (ixgbe_rxsync() will not look for new packets - * unless NKR_PENDINTR is set). - */ - struct netmap_adapter *na = NA(ifp); - - na->rx_rings[rxr->me].nr_kflags |= NKR_PENDINTR; - selwakeuppri(&na->rx_rings[rxr->me].si, PI_NET); - IXGBE_RX_UNLOCK(rxr); - IXGBE_CORE_LOCK(adapter); - selwakeuppri(&na->rx_si, PI_NET); - IXGBE_CORE_UNLOCK(adapter); + /* Same as the txeof routine: wakeup clients on intr. */ + if (netmap_rx_irq(ifp, rxr->me | NETMAP_LOCKED_ENTER, &processed)) return (FALSE); - } #endif /* DEV_NETMAP */ for (i = rxr->next_to_check; count != 0;) { struct mbuf *sendmp, *mp; Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Tue Apr 30 16:08:34 2013 (r250107) +++ head/sys/dev/re/if_re.c Tue Apr 30 16:18:29 2013 (r250108) @@ -2112,11 +2112,9 @@ re_rxeof(struct rl_softc *sc, int *rx_np ifp = sc->rl_ifp; #ifdef DEV_NETMAP - if (ifp->if_capenable & IFCAP_NETMAP) { - NA(ifp)->rx_rings[0].nr_kflags |= NKR_PENDINTR; - selwakeuppri(&NA(ifp)->rx_rings[0].si, PI_NET); + if (netmap_rx_irq(ifp, 0 | (NETMAP_LOCKED_ENTER|NETMAP_LOCKED_EXIT), + &rx_npkts)) return 0; - } #endif /* DEV_NETMAP */ if (ifp->if_mtu > RL_MTU && (sc->rl_flags & RL_FLAG_JUMBOV2) != 0) jumbo = 1; @@ -2360,10 +2358,8 @@ re_txeof(struct rl_softc *sc) ifp = sc->rl_ifp; #ifdef DEV_NETMAP - if (ifp->if_capenable & IFCAP_NETMAP) { - selwakeuppri(&NA(ifp)->tx_rings[0].si, PI_NET); + if (netmap_tx_irq(ifp, 0 | (NETMAP_LOCKED_ENTER|NETMAP_LOCKED_EXIT))) return; - } #endif /* DEV_NETMAP */ /* Invalidate the TX descriptor list */ bus_dmamap_sync(sc->rl_ldata.rl_tx_list_tag, From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 16:51:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 00F21A43; Tue, 30 Apr 2013 16:51:58 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E64781E51; Tue, 30 Apr 2013 16:51:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UGpwK9014523; Tue, 30 Apr 2013 16:51:58 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UGpwJ2014522; Tue, 30 Apr 2013 16:51:58 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201304301651.r3UGpwJ2014522@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 30 Apr 2013 16:51:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250109 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 16:51:59 -0000 Author: luigi Date: Tue Apr 30 16:51:58 2013 New Revision: 250109 URL: http://svnweb.freebsd.org/changeset/base/250109 Log: use netmap_rx_irq() and netmap_tx_irq() instead of replicating the logic in the individual driver. Modified: head/sys/dev/e1000/if_lem.c Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Tue Apr 30 16:18:29 2013 (r250108) +++ head/sys/dev/e1000/if_lem.c Tue Apr 30 16:51:58 2013 (r250109) @@ -2980,10 +2980,8 @@ lem_txeof(struct adapter *adapter) EM_TX_LOCK_ASSERT(adapter); #ifdef DEV_NETMAP - if (ifp->if_capenable & IFCAP_NETMAP) { - selwakeuppri(&NA(ifp)->tx_rings[0].si, PI_NET); + if (netmap_tx_irq(ifp, 0 | (NETMAP_LOCKED_ENTER|NETMAP_LOCKED_EXIT))) return; - } #endif /* DEV_NETMAP */ if (adapter->num_tx_desc_avail == adapter->num_tx_desc) return; @@ -3459,13 +3457,8 @@ lem_rxeof(struct adapter *adapter, int c BUS_DMASYNC_POSTREAD); #ifdef DEV_NETMAP - if (ifp->if_capenable & IFCAP_NETMAP) { - struct netmap_adapter *na = NA(ifp); - na->rx_rings[0].nr_kflags |= NKR_PENDINTR; - selwakeuppri(&na->rx_rings[0].si, PI_NET); - EM_RX_UNLOCK(adapter); - return (0); - } + if (netmap_rx_irq(ifp, 0 | NETMAP_LOCKED_ENTER, &rx_sent)) + return (FALSE); #endif /* DEV_NETMAP */ if (!((current_desc->status) & E1000_RXD_STAT_DD)) { From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 16:59:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3B3C8C9F; Tue, 30 Apr 2013 16:59:26 +0000 (UTC) (envelope-from carl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2DE711E9F; Tue, 30 Apr 2013 16:59:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UGxQr1015908; Tue, 30 Apr 2013 16:59:26 GMT (envelope-from carl@svn.freebsd.org) Received: (from carl@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UGxQ1b015907; Tue, 30 Apr 2013 16:59:26 GMT (envelope-from carl@svn.freebsd.org) Message-Id: <201304301659.r3UGxQ1b015907@svn.freebsd.org> From: Carl Delsey Date: Tue, 30 Apr 2013 16:59:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250110 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 16:59:26 -0000 Author: carl Date: Tue Apr 30 16:59:25 2013 New Revision: 250110 URL: http://svnweb.freebsd.org/changeset/base/250110 Log: Fix the man page installation broken in r250079. Pointy hat to me. Thanks to Florian Smeets for pointing this out and providing a patch. Submitted by: Florian Smeets Approved by: jimharris (mentor) Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Tue Apr 30 16:51:58 2013 (r250109) +++ head/share/man/man4/Makefile Tue Apr 30 16:59:25 2013 (r250110) @@ -648,7 +648,8 @@ MLINKS+=netintro.4 net.4 \ netintro.4 networking.4 MLINKS+=${_nfe.4} ${_if_nfe.4} MLINKS+=nge.4 if_nge.4 -MLINKS+=${_ntb.4} ${_if_ntb.4} ${_ntb_hw.4} +MLINKS+=${_ntb.4} ${_if_ntb.4} \ + ${_ntb.4} ${_ntb_hw.4} MLINKS+=${_nve.4} ${_if_nve.4} MLINKS+=${_nxge.4} ${_if_nxge.4} MLINKS+=patm.4 if_patm.4 From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 17:02:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 67648E5E; Tue, 30 Apr 2013 17:02:45 +0000 (UTC) (envelope-from carl@freebsd.org) Received: from mga14.intel.com (mga14.intel.com [143.182.124.37]) by mx1.freebsd.org (Postfix) with ESMTP id 69ADB1EC5; Tue, 30 Apr 2013 17:02:44 +0000 (UTC) Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 30 Apr 2013 10:02:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.87,582,1363158000"; d="asc'?scan'208";a="295529971" Received: from crdelsey-fbsd.ch.intel.com (HELO [10.2.105.127]) ([10.2.105.127]) by azsmga001.ch.intel.com with ESMTP; 30 Apr 2013 10:02:34 -0700 Message-ID: <517FF910.2060600@FreeBSD.org> Date: Tue, 30 Apr 2013 10:02:08 -0700 From: Carl Delsey User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130115 Thunderbird/17.0.2 MIME-Version: 1.0 To: Florian Smeets Subject: Re: svn commit: r250079 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/ntb sys/dev/ntb/if_ntb sys/dev/ntb/ntb_hw sys/modules sys/modules/ntb sys/modules/ntb/if_ntb sys/modules/ntb/ntb_hw References: <201304292248.r3TMmrqT027087@svn.freebsd.org> <20130430095703.GC14196@zoidberg.smeets.im> In-Reply-To: <20130430095703.GC14196@zoidberg.smeets.im> X-Enigmail-Version: 1.4.6 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigA694BFE399D54C07260A4341" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 17:02:45 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigA694BFE399D54C07260A4341 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thanks Florian. Fixed in r250110. On 04/30/13 02:57, Florian Smeets wrote: > On Mon, Apr 29, 2013 at 10:48:53PM +0000, Carl Delsey wrote: >> Author: carl >> Date: Mon Apr 29 22:48:53 2013 >> New Revision: 250079 >> URL: http://svnweb.freebsd.org/changeset/base/250079 >> >> Log: >> Add a new driver to support the Intel Non-Transparent Bridge(NTB). >> =20 > Hi Carl, > > This change breaks installworld. > > /usr/share/man/man4/nve.4.gz -> /usr/share/man/man4/ntb_hw.4.gz > install: link /usr/share/man/man4/ntb_hw.4.gz -> /usr/share/man/man4/nv= e.4.gz: No such file or directory > *** [_maninstall] Error code 71 > > I think the following patch does what you intended? > > Index: share/man/man4/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- share/man/man4/Makefile (revision 250097) > +++ share/man/man4/Makefile (working copy) > @@ -648,7 +648,8 @@ > netintro.4 networking.4 > MLINKS+=3D${_nfe.4} ${_if_nfe.4} > MLINKS+=3Dnge.4 if_nge.4 > -MLINKS+=3D${_ntb.4} ${_if_ntb.4} ${_ntb_hw.4} > +MLINKS+=3D${_ntb.4} ${_if_ntb.4} \ > + ${_ntb.4} ${_ntb_hw.4} > MLINKS+=3D${_nve.4} ${_if_nve.4} > MLINKS+=3D${_nxge.4} ${_if_nxge.4} > MLINKS+=3Dpatm.4 if_patm.4 > > With this installworld finished as expected. > > Florian --------------enigA694BFE399D54C07260A4341 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) Comment: Using GnuPG with undefined - http://www.enigmail.net/ iQIcBAEBAgAGBQJRf/kpAAoJEGAx6WP7O104wjMQAK6PfPy+OpS0sGeCUF85+UAK /bB2K+gk/G+RgZzTyzMdtK9TQDH1ThIkNvGnPK7fdK8vyfoSnsy8WdH3s3ObDbWB 9hnmnla6xySPgpmaK+9A6RY2EcIwn1TsqwsskpQIf3FS7TK1awMtPGegSK+/euqY /o4VkAbDVWOBFHJyPqqgTsPe4co6RFrznTpulbYbjhDjFGkN4SkBC/YxcmALuldE b9118+1Q58pu8yJCWD3X7e0O3BeM44v215EuqYp2ieeNiT/Qbiu5Rw9+3F7+gmRD cAprfWHF/oaIAPCz9YEmp0Kgos4BdOxY6r7vbEutpwphhXeRVCBFGsIYSLIJMr/Q Ta4J0/oi4Dy8j3JSuzR5u53HnrVklmoYy4AzPx9E3UZ/a0iKBil+IjybwhUJI4ai 0HCX/buc69/VALj9N43EPa9H/oaEilwDVyya/JPfWP+vwNXeceZWKfDfZtW+1gAt ASwMpFrs4mjI24L0fcqTkWcNp/j343skF5fCKsbiejqehkrDPpvZg5hbL9Yw6GDc vFMPAyIzGstO2YJAQcVcAGyv++n/FgH7YdloYnXdeA/icayhaaqNFu7nr5d4iTTG 5vbmRltW1cRCPx54QKBpCH0aTVV3f0G4s3ygMy3chytd7krZyHU3W9Hz3FRqPR1h 5G5+LPgBn8INZdG9imz5 =5Wi2 -----END PGP SIGNATURE----- --------------enigA694BFE399D54C07260A4341-- From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 18:14:23 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8AFA84BC; Tue, 30 Apr 2013 18:14:23 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7E01411E0; Tue, 30 Apr 2013 18:14:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UIEN5O044106; Tue, 30 Apr 2013 18:14:23 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UIENr0044105; Tue, 30 Apr 2013 18:14:23 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201304301814.r3UIENr0044105@svn.freebsd.org> From: Brooks Davis Date: Tue, 30 Apr 2013 18:14:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250112 - head/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 18:14:23 -0000 Author: brooks Date: Tue Apr 30 18:14:22 2013 New Revision: 250112 URL: http://svnweb.freebsd.org/changeset/base/250112 Log: Wrap the creation of the ../include link in /usr/lib in !defined(LIBRARIES_ONLY) so it is only created once on architectures with 32-bit compat support. Replace ln -fhs with ${INSTALL_SYMLINK} to the link is logged in the METALOG. Modified: head/lib/Makefile Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Tue Apr 30 18:06:43 2013 (r250111) +++ head/lib/Makefile Tue Apr 30 18:14:22 2013 (r250112) @@ -252,7 +252,9 @@ _libusbhid= libusbhid _libusb= libusb .endif +.if !defined(LIBRARIES_ONLY) afterinstall: - ln -hfs ../include ${DESTDIR}/usr/lib/include + ${INSTALL_SYMLINK} ../include ${DESTDIR}/usr/lib/include +.endif .include From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 18:29:05 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 92120AA2; Tue, 30 Apr 2013 18:29:05 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8397B1285; Tue, 30 Apr 2013 18:29:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UIT5jm048264; Tue, 30 Apr 2013 18:29:05 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UIT5dr048263; Tue, 30 Apr 2013 18:29:05 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201304301829.r3UIT5dr048263@svn.freebsd.org> From: Brooks Davis Date: Tue, 30 Apr 2013 18:29:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250113 - head/sys/dev/altera/jtag_uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 18:29:05 -0000 Author: brooks Date: Tue Apr 30 18:29:05 2013 New Revision: 250113 URL: http://svnweb.freebsd.org/changeset/base/250113 Log: Partial MFC of change 228122: Due to the requirement that tty prefixes be unique per driver, rename the Altera JTAG UART devices to ttyj#. Sponsored by: DARPA, AFRL Modified: head/sys/dev/altera/jtag_uart/altera_jtag_uart.h Modified: head/sys/dev/altera/jtag_uart/altera_jtag_uart.h ============================================================================== --- head/sys/dev/altera/jtag_uart/altera_jtag_uart.h Tue Apr 30 18:14:22 2013 (r250112) +++ head/sys/dev/altera/jtag_uart/altera_jtag_uart.h Tue Apr 30 18:29:05 2013 (r250113) @@ -75,7 +75,7 @@ struct altera_jtag_uart_softc { u_int *ajus_jtag_missedp; }; -#define AJU_TTYNAME "ttyu" +#define AJU_TTYNAME "ttyj" /* * Flag values for ajus_flags. From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 18:33:30 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 56926D2C; Tue, 30 Apr 2013 18:33:30 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2F53E12AB; Tue, 30 Apr 2013 18:33:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UIXUjv050723; Tue, 30 Apr 2013 18:33:30 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UIXTJp050720; Tue, 30 Apr 2013 18:33:29 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201304301833.r3UIXTJp050720@svn.freebsd.org> From: Brooks Davis Date: Tue, 30 Apr 2013 18:33:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250114 - in head/sys: conf dev/cfi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 18:33:30 -0000 Author: brooks Date: Tue Apr 30 18:33:29 2013 New Revision: 250114 URL: http://svnweb.freebsd.org/changeset/base/250114 Log: MFP4 changes 222065 and 222068: Add a simplebus attachment for cfi(4)'s FDT support and move cfi_bus_fdt.c to sys/conf/files so non-ppc architectures are supported. Sponsored by: DARPA, AFRL Modified: head/sys/conf/files head/sys/conf/files.powerpc head/sys/dev/cfi/cfi_bus_fdt.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Apr 30 18:29:05 2013 (r250113) +++ head/sys/conf/files Tue Apr 30 18:33:29 2013 (r250114) @@ -1046,6 +1046,7 @@ dev/cardbus/cardbus.c optional cardbus dev/cardbus/cardbus_cis.c optional cardbus dev/cardbus/cardbus_device.c optional cardbus dev/cas/if_cas.c optional cas +dev/cfi/cfi_bus_fdt.c optional cfi fdt dev/cfi/cfi_bus_nexus.c optional cfi dev/cfi/cfi_core.c optional cfi dev/cfi/cfi_dev.c optional cfi Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Tue Apr 30 18:29:05 2013 (r250113) +++ head/sys/conf/files.powerpc Tue Apr 30 18:33:29 2013 (r250114) @@ -27,7 +27,6 @@ dev/adb/adb_hb_if.m optional adb dev/adb/adb_if.m optional adb dev/adb/adb_buttons.c optional adb dev/agp/agp_apple.c optional agp powermac -dev/cfi/cfi_bus_fdt.c optional cfi fdt dev/fb/fb.c optional sc dev/fdt/fdt_powerpc.c optional fdt dev/hwpmc/hwpmc_powerpc.c optional hwpmc Modified: head/sys/dev/cfi/cfi_bus_fdt.c ============================================================================== --- head/sys/dev/cfi/cfi_bus_fdt.c Tue Apr 30 18:29:05 2013 (r250113) +++ head/sys/dev/cfi/cfi_bus_fdt.c Tue Apr 30 18:33:29 2013 (r250114) @@ -61,6 +61,7 @@ static driver_t cfi_fdt_driver = { }; DRIVER_MODULE (cfi, lbc, cfi_fdt_driver, cfi_devclass, 0, 0); +DRIVER_MODULE (cfi, simplebus, cfi_fdt_driver, cfi_devclass, 0, 0); static int cfi_fdt_probe(device_t dev) From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 18:48:11 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BD669FE7; Tue, 30 Apr 2013 18:48:11 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B06881317; Tue, 30 Apr 2013 18:48:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UImBi2054881; Tue, 30 Apr 2013 18:48:11 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UImBpW054880; Tue, 30 Apr 2013 18:48:11 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201304301848.r3UImBpW054880@svn.freebsd.org> From: Brooks Davis Date: Tue, 30 Apr 2013 18:48:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250115 - head/sys/dev/cfi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 18:48:11 -0000 Author: brooks Date: Tue Apr 30 18:48:11 2013 New Revision: 250115 URL: http://svnweb.freebsd.org/changeset/base/250115 Log: MFP4 change 222060: On Intel devices, put the Factory PPR in kenv. On some FPGA boards it may be the only software accessable unique ID. Sponsored by: DARPA, AFRL Modified: head/sys/dev/cfi/cfi_core.c Modified: head/sys/dev/cfi/cfi_core.c ============================================================================== --- head/sys/dev/cfi/cfi_core.c Tue Apr 30 18:33:29 2013 (r250114) +++ head/sys/dev/cfi/cfi_core.c Tue Apr 30 18:48:11 2013 (r250115) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -261,6 +262,10 @@ cfi_attach(device_t dev) struct cfi_softc *sc; u_int blksz, blocks; u_int r, u; +#ifdef CFI_SUPPORT_STRATAFLASH + uint64_t ppr; + char name[KENV_MNAMELEN], value[32]; +#endif sc = device_get_softc(dev); sc->sc_dev = dev; @@ -312,6 +317,20 @@ cfi_attach(device_t dev) "%s%u", cfi_driver_name, u); sc->sc_nod->si_drv1 = sc; +#ifdef CFI_SUPPORT_STRATAFLASH + /* + * Store the Intel factory PPR in the environment. In some + * cases it is the most unique ID on a board. + */ + if (cfi_intel_get_factory_pr(sc, &ppr) == 0) { + if (snprintf(name, sizeof(name), "%s.factory_ppr", + device_get_nameunit(dev)) < (sizeof(name) - 1) && + snprintf(value, sizeof(value), "0x%016jx", ppr) < + (sizeof(value) - 1)) + (void) setenv(name, value); + } +#endif + device_add_child(dev, "cfid", -1); bus_generic_attach(dev); From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 19:26:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A4A4B6E0; Tue, 30 Apr 2013 19:26:45 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 95F9814BF; Tue, 30 Apr 2013 19:26:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UJQj9h068692; Tue, 30 Apr 2013 19:26:45 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UJQjqx068691; Tue, 30 Apr 2013 19:26:45 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201304301926.r3UJQjqx068691@svn.freebsd.org> From: Brooks Davis Date: Tue, 30 Apr 2013 19:26:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250116 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 19:26:45 -0000 Author: brooks Date: Tue Apr 30 19:26:44 2013 New Revision: 250116 URL: http://svnweb.freebsd.org/changeset/base/250116 Log: Make an attempt to detect missing MTREE files in distrib-dirs. Not perfect, but this is just a developer seatbelt. PR: conf/176897 Submitted by: Garrett Cooper MFC after: 1 week Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Tue Apr 30 18:48:11 2013 (r250115) +++ head/etc/Makefile Tue Apr 30 19:26:44 2013 (r250116) @@ -328,7 +328,7 @@ MTREES+= mtree/BSD.sendmail.dist / MTREES+= ../${mtree} / .endfor -distrib-dirs: +distrib-dirs: ${MTREES:N/*} @set ${MTREES}; \ while test $$# -ge 2; do \ m=${.CURDIR}/$$1; \ From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 19:57:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 803F0BF9; Tue, 30 Apr 2013 19:57:22 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 720B015AE; Tue, 30 Apr 2013 19:57:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UJvMF9078948; Tue, 30 Apr 2013 19:57:22 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UJvMsG078947; Tue, 30 Apr 2013 19:57:22 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201304301957.r3UJvMsG078947@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 30 Apr 2013 19:57:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250117 - head/sys/dev/cxgbe/tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 19:57:22 -0000 Author: np Date: Tue Apr 30 19:57:21 2013 New Revision: 250117 URL: http://svnweb.freebsd.org/changeset/base/250117 Log: Fix DDP breakage introduced in r248925. Bitwise OR has higher precedence than ternary conditional. MFC after: 1 week Modified: head/sys/dev/cxgbe/tom/t4_ddp.c Modified: head/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_ddp.c Tue Apr 30 19:26:44 2013 (r250116) +++ head/sys/dev/cxgbe/tom/t4_ddp.c Tue Apr 30 19:57:21 2013 (r250117) @@ -747,7 +747,13 @@ write_page_pods(struct adapter *sc, stru struct ulptx_idata *ulpsc; struct pagepod *ppod; int i, j, k, n, chunk, len, ddp_pgsz, idx, ppod_addr; + uint32_t cmd; + cmd = htobe32(V_ULPTX_CMD(ULP_TX_MEM_WRITE)); + if (is_t4(sc)) + cmd |= htobe32(F_ULP_MEMIO_ORDER); + else + cmd |= htobe32(F_T5_ULP_MEMIO_IMM); ddp_pgsz = t4_ddp_pgsz[G_PPOD_PGSZ(db->tag)]; ppod_addr = sc->vres.ddp.start + G_PPOD_TAG(db->tag) * PPOD_SIZE; for (i = 0; i < db->nppods; ppod_addr += chunk) { @@ -763,8 +769,7 @@ write_page_pods(struct adapter *sc, stru ulpmc = wrtod(wr); INIT_ULPTX_WR(ulpmc, len, 0, 0); - ulpmc->cmd = htobe32(V_ULPTX_CMD(ULP_TX_MEM_WRITE) | - is_t4(sc) ? F_ULP_MEMIO_ORDER : F_T5_ULP_MEMIO_IMM); + ulpmc->cmd = cmd; ulpmc->dlen = htobe32(V_ULP_MEMIO_DATA_LEN(chunk / 32)); ulpmc->len16 = htobe32(howmany(len - sizeof(ulpmc->wr), 16)); ulpmc->lock_addr = htobe32(V_ULP_MEMIO_ADDR(ppod_addr >> 5)); From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 20:53:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 470D7A2D; Tue, 30 Apr 2013 20:53:29 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 39B6717CE; Tue, 30 Apr 2013 20:53:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UKrTxo099973; Tue, 30 Apr 2013 20:53:29 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UKrTl9099972; Tue, 30 Apr 2013 20:53:29 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201304302053.r3UKrTl9099972@svn.freebsd.org> From: Brooks Davis Date: Tue, 30 Apr 2013 20:53:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250119 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 20:53:29 -0000 Author: brooks Date: Tue Apr 30 20:53:28 2013 New Revision: 250119 URL: http://svnweb.freebsd.org/changeset/base/250119 Log: Add some advice to get past the hurdle of install -l for the common, but non-default (and unsupportable) case of setting INSTALL="install -C" in /etc/make.conf or /etc/src.conf. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Apr 30 20:15:53 2013 (r250118) +++ head/UPDATING Tue Apr 30 20:53:28 2013 (r250119) @@ -104,6 +104,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 while having the GNU version installed as gnupatch, rebuild and install world with the WITH_BSD_PATCH knob set. +20130121: + Due to the use of the new -l option to install(1) during build + and install, you must take care not to directly set the INSTALL + make variable in your /etc/make.conf, /etc/src.conf, or on the + command line. If you with to use the -C flag for all installs + you may be able to add INSTALL+=-C to /etc/make.conf or + /etc/src.conf. + 20130118: The install(1) option -M has changed meaning and now takes an argument that is a file or path to append logs to. In the From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 23:36:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 808B6A2B; Tue, 30 Apr 2013 23:36:46 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 731E41EE2; Tue, 30 Apr 2013 23:36:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UNakbG056930; Tue, 30 Apr 2013 23:36:46 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UNakAB056929; Tue, 30 Apr 2013 23:36:46 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304302336.r3UNakAB056929@svn.freebsd.org> From: Eitan Adler Date: Tue, 30 Apr 2013 23:36:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250123 - head/sys/dev/hptiop X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 23:36:46 -0000 Author: eadler Date: Tue Apr 30 23:36:45 2013 New Revision: 250123 URL: http://svnweb.freebsd.org/changeset/base/250123 Log: Add missing braces Reviewed by: swildner@dragonflybsd.org Reviewed by: delphij Modified: head/sys/dev/hptiop/hptiop.c Modified: head/sys/dev/hptiop/hptiop.c ============================================================================== --- head/sys/dev/hptiop/hptiop.c Tue Apr 30 22:59:09 2013 (r250122) +++ head/sys/dev/hptiop/hptiop.c Tue Apr 30 23:36:45 2013 (r250123) @@ -1642,10 +1642,11 @@ static int hptiop_internal_memalloc_mv(s MVIOP_IOCTLCFG_SIZE, hptiop_mv_map_ctlcfg, hba, 0)) { device_printf(hba->pcidev, "bus_dmamap_load failed!\n"); - if (hba->ctlcfg_dmat) + if (hba->ctlcfg_dmat) { bus_dmamem_free(hba->ctlcfg_dmat, hba->ctlcfg_ptr, hba->ctlcfg_dmamap); bus_dma_tag_destroy(hba->ctlcfg_dmat); + } return -1; } From owner-svn-src-head@FreeBSD.ORG Tue Apr 30 23:36:49 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 29000A2C; Tue, 30 Apr 2013 23:36:49 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1B2FC1EE3; Tue, 30 Apr 2013 23:36:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3UNamlf056970; Tue, 30 Apr 2013 23:36:48 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3UNamXq056968; Tue, 30 Apr 2013 23:36:48 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304302336.r3UNamXq056968@svn.freebsd.org> From: Eitan Adler Date: Tue, 30 Apr 2013 23:36:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250124 - head/sys/dev/hptiop X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 23:36:49 -0000 Author: eadler Date: Tue Apr 30 23:36:48 2013 New Revision: 250124 URL: http://svnweb.freebsd.org/changeset/base/250124 Log: Remove ancient compatibility cruft. Reviewed by: delphij Modified: head/sys/dev/hptiop/hptiop.c head/sys/dev/hptiop/hptiop.h Modified: head/sys/dev/hptiop/hptiop.c ============================================================================== --- head/sys/dev/hptiop/hptiop.c Tue Apr 30 23:36:45 2013 (r250123) +++ head/sys/dev/hptiop/hptiop.c Tue Apr 30 23:36:48 2013 (r250124) @@ -30,12 +30,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#if (__FreeBSD_version >= 500000) #include #include -#else -#include -#endif #include #include @@ -43,11 +39,9 @@ __FBSDID("$FreeBSD$"); #include #include -#if (__FreeBSD_version >= 500000) #include #include #include -#endif #include #include @@ -62,17 +56,9 @@ __FBSDID("$FreeBSD$"); #include #include -#if (__FreeBSD_version >= 500000) #include #include -#else -#include -#include -#endif - -#if (__FreeBSD_version <= 500043) -#include -#endif + #include #include @@ -83,9 +69,6 @@ __FBSDID("$FreeBSD$"); #include #include -#if (__FreeBSD_version < 500043) -#include -#endif #include @@ -177,27 +160,11 @@ static struct cdevsw hptiop_cdevsw = { .d_close = hptiop_close, .d_ioctl = hptiop_ioctl, .d_name = driver_name, -#if __FreeBSD_version>=503000 .d_version = D_VERSION, -#endif -#if (__FreeBSD_version>=503000 && __FreeBSD_version<600034) - .d_flags = D_NEEDGIANT, -#endif -#if __FreeBSD_version<600034 -#if __FreeBSD_version>=501000 - .d_maj = MAJOR_AUTO, -#else - .d_maj = HPT_DEV_MAJOR, -#endif -#endif }; -#if __FreeBSD_version < 503000 -#define hba_from_dev(dev) ((struct hpt_iop_hba *)(dev)->si_drv1) -#else #define hba_from_dev(dev) \ ((struct hpt_iop_hba *)devclass_get_softc(hptiop_devclass, dev2unit(dev))) -#endif #define BUS_SPACE_WRT4_ITL(offset, value) bus_space_write_4(hba->bar0t,\ hba->bar0h, offsetof(struct hpt_iopmu_itl, offset), (value)) @@ -245,9 +212,7 @@ static int hptiop_ioctl(ioctl_dev_t dev, int ret = EFAULT; struct hpt_iop_hba *hba = hba_from_dev(dev); -#if (__FreeBSD_version >= 500000) mtx_lock(&Giant); -#endif switch (cmd) { case HPT_DO_IOCONTROL: @@ -259,9 +224,7 @@ static int hptiop_ioctl(ioctl_dev_t dev, break; } -#if (__FreeBSD_version >= 500000) mtx_unlock(&Giant); -#endif return ret; } @@ -1615,21 +1578,15 @@ static int hptiop_internal_memalloc_mv(s 1, BUS_SPACE_MAXSIZE_32BIT, BUS_DMA_ALLOCNOW, -#if __FreeBSD_version > 502000 NULL, NULL, -#endif &hba->ctlcfg_dmat)) { device_printf(hba->pcidev, "alloc ctlcfg_dmat failed\n"); return -1; } if (bus_dmamem_alloc(hba->ctlcfg_dmat, (void **)&hba->ctlcfg_ptr, -#if __FreeBSD_version>501000 BUS_DMA_WAITOK | BUS_DMA_COHERENT, -#else - BUS_DMA_WAITOK, -#endif &hba->ctlcfg_dmamap) != 0) { device_printf(hba->pcidev, "bus_dmamem_alloc failed!\n"); @@ -1678,21 +1635,15 @@ static int hptiop_internal_memalloc_mvfr 1, BUS_SPACE_MAXSIZE_32BIT, BUS_DMA_ALLOCNOW, -#if __FreeBSD_version > 502000 NULL, NULL, -#endif &hba->ctlcfg_dmat)) { device_printf(hba->pcidev, "alloc ctlcfg_dmat failed\n"); return -1; } if (bus_dmamem_alloc(hba->ctlcfg_dmat, (void **)&hba->ctlcfg_ptr, -#if __FreeBSD_version>501000 BUS_DMA_WAITOK | BUS_DMA_COHERENT, -#else - BUS_DMA_WAITOK, -#endif &hba->ctlcfg_dmamap) != 0) { device_printf(hba->pcidev, "bus_dmamem_alloc failed!\n"); @@ -1937,9 +1888,7 @@ static int hptiop_attach(device_t dev) pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev), hba->ops)); -#if __FreeBSD_version >=440000 pci_enable_busmaster(dev); -#endif hba->pcidev = dev; hba->pciunit = unit; @@ -1951,9 +1900,7 @@ static int hptiop_attach(device_t dev) goto release_pci_res; } -#if (__FreeBSD_version >= 500000) mtx_init(&hba->lock, "hptioplock", NULL, MTX_DEF); -#endif if (bus_dma_tag_create(bus_get_dma_tag(dev),/* PCI parent */ 1, /* alignment */ @@ -1965,10 +1912,8 @@ static int hptiop_attach(device_t dev) BUS_SPACE_UNRESTRICTED, /* nsegments */ BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ 0, /* flags */ -#if __FreeBSD_version>502000 NULL, /* lockfunc */ NULL, /* lockfuncarg */ -#endif &hba->parent_dmat /* tag */)) { device_printf(dev, "alloc parent_dmat failed\n"); @@ -2015,10 +1960,8 @@ static int hptiop_attach(device_t dev) hba->max_sg_count, /* nsegments */ 0x20000, /* maxsegsize */ BUS_DMA_ALLOCNOW, /* flags */ -#if __FreeBSD_version>502000 busdma_lock_mutex, /* lockfunc */ &hba->lock, /* lockfuncarg */ -#endif &hba->io_dmat /* tag */)) { device_printf(dev, "alloc io_dmat failed\n"); @@ -2035,10 +1978,8 @@ static int hptiop_attach(device_t dev) 1, /* nsegments */ BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ 0, /* flags */ -#if __FreeBSD_version>502000 NULL, /* lockfunc */ NULL, /* lockfuncarg */ -#endif &hba->srb_dmat /* tag */)) { device_printf(dev, "alloc srb_dmat failed\n"); @@ -2046,11 +1987,7 @@ static int hptiop_attach(device_t dev) } if (bus_dmamem_alloc(hba->srb_dmat, (void **)&hba->uncached_ptr, -#if __FreeBSD_version>501000 BUS_DMA_WAITOK | BUS_DMA_COHERENT, -#else - BUS_DMA_WAITOK, -#endif &hba->srb_dmamap) != 0) { device_printf(dev, "srb bus_dmamem_alloc failed!\n"); @@ -2071,23 +2008,14 @@ static int hptiop_attach(device_t dev) goto srb_dmamap_unload; } -#if __FreeBSD_version <700000 - hba->sim = cam_sim_alloc(hptiop_action, hptiop_poll, driver_name, - hba, unit, hba->max_requests - 1, 1, devq); -#else hba->sim = cam_sim_alloc(hptiop_action, hptiop_poll, driver_name, hba, unit, &Giant, hba->max_requests - 1, 1, devq); -#endif if (!hba->sim) { device_printf(dev, "cam_sim_alloc failed\n"); cam_simq_free(devq); goto srb_dmamap_unload; } -#if __FreeBSD_version <700000 - if (xpt_bus_register(hba->sim, 0) != CAM_SUCCESS) -#else if (xpt_bus_register(hba->sim, dev, 0) != CAM_SUCCESS) -#endif { device_printf(dev, "xpt_bus_register failed\n"); goto free_cam_sim; @@ -2124,13 +2052,8 @@ static int hptiop_attach(device_t dev) goto free_hba_path; } -#if __FreeBSD_version <700000 - if (bus_setup_intr(hba->pcidev, hba->irq_res, INTR_TYPE_CAM, - hptiop_pci_intr, hba, &hba->irq_handle)) -#else if (bus_setup_intr(hba->pcidev, hba->irq_res, INTR_TYPE_CAM, NULL, hptiop_pci_intr, hba, &hba->irq_handle)) -#endif { device_printf(dev, "allocate intr function failed!\n"); goto free_irq_resource; @@ -2149,9 +2072,6 @@ static int hptiop_attach(device_t dev) UID_ROOT, GID_WHEEL /*GID_OPERATOR*/, S_IRUSR | S_IWUSR, "%s%d", driver_name, unit); -#if __FreeBSD_version < 503000 - hba->ioctl_dev->si_drv1 = hba; -#endif return 0; @@ -2419,15 +2339,7 @@ scsi_done: break; case XPT_CALC_GEOMETRY: -#if __FreeBSD_version >= 500000 cam_calc_geometry(&ccb->ccg, 1); -#else - ccb->ccg.heads = 255; - ccb->ccg.secs_per_track = 63; - ccb->ccg.cylinders = ccb->ccg.volume_size / - (ccb->ccg.heads * ccb->ccg.secs_per_track); - ccb->ccb_h.status = CAM_REQ_CMP; -#endif break; case XPT_PATH_INQ: Modified: head/sys/dev/hptiop/hptiop.h ============================================================================== --- head/sys/dev/hptiop/hptiop.h Tue Apr 30 23:36:45 2013 (r250123) +++ head/sys/dev/hptiop/hptiop.h Tue Apr 30 23:36:48 2013 (r250124) @@ -333,17 +333,9 @@ struct hpt_iop_ioctl_param { #define HPT_IOCTL_FLAG_OPEN 1 #define HPT_CTL_CODE_BSD_TO_IOP(x) ((x)-0xff00) -#if __FreeBSD_version>503000 typedef struct cdev * ioctl_dev_t; -#else -typedef dev_t ioctl_dev_t; -#endif -#if __FreeBSD_version >= 500000 typedef struct thread * ioctl_thread_t; -#else -typedef struct proc * ioctl_thread_t; -#endif struct hpt_iop_hba { struct hptiop_adapter_ops *ops; @@ -425,11 +417,7 @@ struct hpt_iop_hba { struct cam_sim *sim; struct cam_path *path; void *req; -#if (__FreeBSD_version >= 500000) struct mtx lock; -#else - int hpt_splx; -#endif #define HPT_IOCTL_FLAG_OPEN 1 u_int32_t flag; struct hpt_iop_srb* srb[HPT_SRB_MAX_QUEUE_SIZE]; @@ -474,19 +462,8 @@ struct hpt_iop_srb { int index; }; -#if __FreeBSD_version >= 500000 #define hptiop_lock_adapter(hba) mtx_lock(&(hba)->lock) #define hptiop_unlock_adapter(hba) mtx_unlock(&(hba)->lock) -#else -static __inline void hptiop_lock_adapter(struct hpt_iop_hba *hba) -{ - hba->hpt_splx = splcam(); -} -static __inline void hptiop_unlock_adapter(struct hpt_iop_hba *hba) -{ - splx(hba->hpt_splx); -} -#endif #define HPT_OSM_TIMEOUT (20*hz) /* timeout value for OS commands */ @@ -499,24 +476,12 @@ static __inline int hptiop_sleep(struct int retval; -#if __FreeBSD_version >= 500000 retval = msleep(ident, &hba->lock, priority, wmesg, timo); -#else - asleep(ident, priority, wmesg, timo); - hptiop_unlock_adapter(hba); - retval = await(priority, timo); - hptiop_lock_adapter(hba); -#endif return retval; } -#if __FreeBSD_version < 501000 -#define READ_16 0x88 -#define WRITE_16 0x8a -#define SERVICE_ACTION_IN 0x9e -#endif #define HPT_DEV_MAJOR 200 From owner-svn-src-head@FreeBSD.ORG Wed May 1 01:49:01 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5648C3DB; Wed, 1 May 2013 01:49:01 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4753211E0; Wed, 1 May 2013 01:49:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r411n0Da003658; Wed, 1 May 2013 01:49:00 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r411n0Eb003657; Wed, 1 May 2013 01:49:00 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305010149.r411n0Eb003657@svn.freebsd.org> From: Adrian Chadd Date: Wed, 1 May 2013 01:49:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250129 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 01:49:01 -0000 Author: adrian Date: Wed May 1 01:49:00 2013 New Revision: 250129 URL: http://svnweb.freebsd.org/changeset/base/250129 Log: There's no HAL_EEPROM in FreeBSD - use ar9300_eeprom_t instead. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c Wed May 1 00:04:29 2013 (r250128) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c Wed May 1 01:49:00 2013 (r250129) @@ -1138,7 +1138,7 @@ ar9300_get_diag_state(struct ath_hal *ah #ifdef AH_PRIVATE_DIAG case HAL_DIAG_EEPROM: *result = &ahp->ah_eeprom; - *resultsize = sizeof(HAL_EEPROM); + *resultsize = sizeof(ar9300_eeprom_t); return AH_TRUE; #if 0 /* XXX - TODO */ From owner-svn-src-head@FreeBSD.ORG Wed May 1 01:50:33 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D7BDE65A; Wed, 1 May 2013 01:50:33 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CA8EA1210; Wed, 1 May 2013 01:50:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r411oXKh005443; Wed, 1 May 2013 01:50:33 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r411oX8I005442; Wed, 1 May 2013 01:50:33 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305010150.r411oX8I005442@svn.freebsd.org> From: Adrian Chadd Date: Wed, 1 May 2013 01:50:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250130 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 01:50:33 -0000 Author: adrian Date: Wed May 1 01:50:33 2013 New Revision: 250130 URL: http://svnweb.freebsd.org/changeset/base/250130 Log: Disable TXCONT, it's not here in FreeBSD. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c Wed May 1 01:49:00 2013 (r250129) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c Wed May 1 01:50:33 2013 (r250130) @@ -1185,9 +1185,11 @@ ar9300_get_diag_state(struct ath_hal *ah ar9300_ani_control( ah, ((const u_int32_t *)args)[0], ((const u_int32_t *)args)[1]); return AH_TRUE; +#if 0 case HAL_DIAG_TXCONT: /*AR9300_CONTTXMODE(ah, (struct ath_desc *)args, argsize );*/ return AH_TRUE; +#endif /* 0 */ #endif /* AH_PRIVATE_DIAG */ case HAL_DIAG_CHANNELS: #if 0 From owner-svn-src-head@FreeBSD.ORG Wed May 1 03:58:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 03EDAD86; Wed, 1 May 2013 03:58:34 +0000 (UTC) (envelope-from ken@kdm.org) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) by mx1.freebsd.org (Postfix) with ESMTP id B76DA174A; Wed, 1 May 2013 03:58:33 +0000 (UTC) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.14.2/8.14.2) with ESMTP id r413wW1m088660; Tue, 30 Apr 2013 21:58:32 -0600 (MDT) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id r413wWGM088659; Tue, 30 Apr 2013 21:58:32 -0600 (MDT) (envelope-from ken) Date: Tue, 30 Apr 2013 21:58:32 -0600 From: "Kenneth D. Merry" To: Steven Hartland Subject: Re: svn commit: r249939 - head/sys/cam/scsi Message-ID: <20130501035832.GB79864@nargothrond.kdm.org> References: <201304261617.r3QGH58Q048395@svn.freebsd.org> <20130429225641.GA1375@nargothrond.kdm.org> <8C38141DA56442218C71EDCBA9790CF8@multiplay.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8C38141DA56442218C71EDCBA9790CF8@multiplay.co.uk> User-Agent: Mutt/1.4.2i Cc: svn-src-head@freebsd.org, Steven Hartland , src-committers@freebsd.org, trasz@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 03:58:34 -0000 On Tue, Apr 30, 2013 at 04:16:49 +0100, Steven Hartland wrote: > ----- Original Message ----- > From: "Steven Hartland" > >>On Fri, Apr 26, 2013 at 16:17:05 +0000, Steven Hartland wrote: > >>>Author: smh > >>>Date: Fri Apr 26 16:17:04 2013 > >>>New Revision: 249939 > >>>URL: http://svnweb.freebsd.org/changeset/base/249939 > >>> > >>>Log: > >>> Added available delete methods discovery during device probe, > >>> including the > >>> maximum sizes for said methods, which are used when processing > >>> BIO_DELETE > >>> requests. This includes updating UNMAP support discovery to be based on > >>> SBC-3 T10/1799-D Revision 31 specification. > >>> Added ATA TRIM support to cam scsi devices via ATA Pass-Through(16) > >>> sys/cam/scsi/scsi_da.c: > >>> - Added ATA Data Set Management TRIM support via ATA > >>> Pass-Through(16) > >>> as a delete_method > >>> > >> > >>This adds a lot of unnecessary verbosity for devices that don't support > >>ATA > >>passthrough. For example: > >> > >>(da7:iscsi4:0:0:0): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 > >>00 00 00 00 00 00 00 40 ec 00 > >>(da7:iscsi4:0:0:0): CAM status: SCSI Status Error > >>(da7:iscsi4:0:0:0): SCSI status: Check Condition > >>(da7:iscsi4:0:0:0): Retrying command (per sense data) > >>(2:2:0:0): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 00 00 00 > >>00 00 00 00 40 ec 00 > >>(2:2:0:0): Tag: 0x00f6, Type: 1 > >>(2:2:0:0): CTL Status: SCSI Error > >>(2:2:0:0): SCSI Status: Check Condition > >>(2:2:0:0): SCSI sense: ILLEGAL REQUEST asc:20,0 (Invalid command > >>operation code) > >>(2:2:0:0): Command byte 0 is invalid > >> > >>(da8:iscsi4:0:0:1): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 > >>00 00 00 00 00 00 00 40 ec 00 > >>(da8:iscsi4:0:0:1): CAM status: SCSI Status Error > >>(da8:iscsi4:0:0:1): SCSI status: Check Condition > >>(da8:iscsi4:0:0:1): Retrying command (per sense data) > >>(da8:iscsi4:0:0:1): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 > >>00 00 00 00 00 00 00 40 ec 00 > >>(da8:iscsi4:0:0:1): CAM status: SCSI Status Error > >>(da8:iscsi4:0:0:1): SCSI status: Check Condition > >>(da8:iscsi4:0:0:1): Error 5, Retries exhausted > >> > >>That is with CTL and and trasz's new iSCSI initiator, but you should see > >>it > >>with any CTL configuration. (And probably with any controller or device > >>that doesn't support ATA passthrough.) > >> > >>So, please: > >>- Check for the presence of VPD page 0x89 before sending an ATA > >> passthrough command. The spec (sat3r03 in this case) says that > >> it "shall" be implemented, so I think we can count on that. > >>- If the target returns an illegal request sense key, don't retry > >> again. The target will keep returning illegal request > > > >Thanks for the report Ken I'll check this on a card I know doesn't support > >pass-through. > > I checked with an areca controller, which I know doesn't support pass16, and > all is quiet during boot / probe. > > I can provoke output at the app layer with camcontrol identify da0, which is > to be expected, but nothing in /var/log/messages. > > daerror handler in scsi_da.c definitely has SF_QUIET_IR so Illegal Request > should never be output. You're correct, it should not print out any messages. > I can't provoke this using standard CAM devices even when they don't support > ATA Pass-Through (16) so I think this is actually an issue with CTL: > 1. Being verbose when it shouldn't (ctl_process_done - line 12571?) That part at least is by design -- it prints out rate-limited messages so you know when the initiator is sending commands CTL doesn't support. It comes in handy for figuring out initiator problems sometimes. > 2. Retrying Illegal Request commands when it shouldn't (I didn't experince > this on r250032) CTL doesn't do any retries, it leaves that up to the initiator. I finally tracked down the problem. The issue is that the iSCSI initiator wasn't setting the CAM_AUTOSNS_VALID flag in the CCB status field. As a result, only the CAM status and SCSI status fields were being printed. SF_QUIET_IR > The attached patch implements a check for ATA Information VPD before > using ATA Pass-Through (16). It's had limited testing but I have > confirmed it eliminates the use of pass16 under CTL and still enables > ATA TRIM under on mpt for SATA disks, so looks promising. > > If you could test and let me know if it works for you Ken that would > be appreciated. Yes, it does work and eliminates the error message, thanks! I think it is also a better way to go, just in case we run into a target that has an issue with the ATA passthrough CDB. > The test case I used for CTL was:- > kldload ctl > ctladm create -b ramdisk -s 10485760 > ctladm port -o on > > As a side note while test "kldload ctl" caused kernel panic the once. What was the panic message? This doesn't look like a CTL-specific problem (not on the surface), but rather a more general CAM problem: > #8 0xffffffff8073e1f2 in calltrap () at > /usr/home/smh/freebsd/base/head/sys/amd64/amd64/exception.S:228 > #9 0xffffffff8029c860 in cam_periph_alloc (periph_ctor=0xffffffff802af410 > , periph_oninvalidate=0xfffffe0019cfa200, periph_dtor= optimized out>, periph_start=0xfffffe0015980a90, name= out>, type=2159638184, > path=0xfffffe0015ad79a0, ac_callback=, code= optimized out>) at /usr/home/smh/freebsd/base/head/sys/cam/cam_periph.c:227 > #10 0xffffffff802aed6b in scsi_scan_lun (request_ccb=) > at /usr/home/smh/freebsd/base/head/sys/cam/scsi/scsi_xpt.c:2266 > #11 0xffffffff802b2859 in scsi_scan_bus (periph=0x0, > request_ccb=0xfffffe00234df000) at > /usr/home/smh/freebsd/base/head/sys/cam/scsi/scsi_xpt.c:1969 > #12 0xffffffff802a66c5 in xpt_scanner_thread (dummy=) > at /usr/home/smh/freebsd/base/head/sys/cam/cam_xpt.c:2411 > #13 0xffffffff8055cde4 in fork_exit (callout=0xffffffff802a6650 > , arg=0x0, frame=0xffffff823b8dcc00) at > /usr/home/smh/freebsd/base/head/sys/kern/kern_fork.c:991 > #14 0xffffffff8073e72e in fork_trampoline () at > /usr/home/smh/freebsd/base/head/sys/amd64/amd64/exception.S:602 > #15 0x0000000000000000 in ?? () If this is on a stock FreeBSD/head, it looks like it failed on this line in cam_periph_alloc(): cur_periph = TAILQ_FIRST(&(*p_drv)->units); Perhaps there's an issue with the ctl peripheral driver getting added to the list of peripheral drivers (via periphdriver_register()). The topology lock isn't held in periphdriver_register(), so it's possible that the thread was in between the peripheral driver list traversal and the line above when the peripheral was added. It's more likely that the scan request was generated as a result of the CTL ports going online. And that means that the peripheral driver registration should have long since been done. If you can reproduce the problem, you can probably figure out where the issue is. Thanks, Ken -- Kenneth Merry ken@FreeBSD.ORG From owner-svn-src-head@FreeBSD.ORG Wed May 1 04:37:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4E0E42F8; Wed, 1 May 2013 04:37:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 25213182A; Wed, 1 May 2013 04:37:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r414bZ8l064427; Wed, 1 May 2013 04:37:35 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r414bZiJ064423; Wed, 1 May 2013 04:37:35 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305010437.r414bZiJ064423@svn.freebsd.org> From: Eitan Adler Date: Wed, 1 May 2013 04:37:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250131 - in head/sys: arm/broadcom/bcm2835 cam/ctl net netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 04:37:36 -0000 Author: eadler Date: Wed May 1 04:37:34 2013 New Revision: 250131 URL: http://svnweb.freebsd.org/changeset/base/250131 Log: Correct a few sizeof()s Submitted by: swildner@DragonFlyBSD.org Reviewed by: alfred Modified: head/sys/arm/broadcom/bcm2835/bcm2835_dma.c head/sys/cam/ctl/ctl_frontend_internal.c head/sys/net/if_spppsubr.c head/sys/netpfil/ipfw/ip_dummynet.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_dma.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_dma.c Wed May 1 01:50:33 2013 (r250130) +++ head/sys/arm/broadcom/bcm2835/bcm2835_dma.c Wed May 1 04:37:34 2013 (r250131) @@ -198,7 +198,7 @@ bcm_dma_reset(device_t dev, int ch) /* Reset control block */ cb = sc->sc_dma_ch[ch].cb; - bzero(cb, sizeof(cb)); + bzero(cb, sizeof(*cb)); cb->info = INFO_WAIT_RESP; } Modified: head/sys/cam/ctl/ctl_frontend_internal.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_internal.c Wed May 1 01:50:33 2013 (r250130) +++ head/sys/cam/ctl/ctl_frontend_internal.c Wed May 1 04:37:34 2013 (r250131) @@ -248,7 +248,7 @@ cfi_init(void) sizeof(struct cfi_lun_io), CTL_PORT_PRIV_SIZE); } - memset(softc, 0, sizeof(softc)); + memset(softc, 0, sizeof(*softc)); mtx_init(&softc->lock, "CTL frontend mutex", NULL, MTX_DEF); softc->flags |= CTL_FLAG_MASTER_SHELF; Modified: head/sys/net/if_spppsubr.c ============================================================================== --- head/sys/net/if_spppsubr.c Wed May 1 01:50:33 2013 (r250130) +++ head/sys/net/if_spppsubr.c Wed May 1 04:37:34 2013 (r250131) @@ -3596,7 +3596,7 @@ sppp_ipv6cp_RCR(struct sppp *sp, struct continue; } - bzero(&suggestaddr, sizeof(&suggestaddr)); + bzero(&suggestaddr, sizeof(suggestaddr)); if (collision && nohisaddr) { /* collision, hisaddr unknown - Conf-Rej */ type = CONF_REJ; Modified: head/sys/netpfil/ipfw/ip_dummynet.c ============================================================================== --- head/sys/netpfil/ipfw/ip_dummynet.c Wed May 1 01:50:33 2013 (r250130) +++ head/sys/netpfil/ipfw/ip_dummynet.c Wed May 1 04:37:34 2013 (r250131) @@ -618,7 +618,7 @@ fsk_detach(struct dn_fsk *fs, int flags) fs->sched->fp->free_fsk(fs); fs->sched = NULL; if (flags & DN_DELETE_FS) { - bzero(fs, sizeof(fs)); /* safety */ + bzero(fs, sizeof(*fs)); /* safety */ free(fs, M_DUMMYNET); dn_cfg.fsk_count--; } else { From owner-svn-src-head@FreeBSD.ORG Wed May 1 04:37:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C4DB2445; Wed, 1 May 2013 04:37:45 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B857A182B; Wed, 1 May 2013 04:37:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r414bj72064486; Wed, 1 May 2013 04:37:45 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r414bjUx064485; Wed, 1 May 2013 04:37:45 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305010437.r414bjUx064485@svn.freebsd.org> From: Eitan Adler Date: Wed, 1 May 2013 04:37:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250132 - head/sys/contrib/octeon-sdk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 04:37:45 -0000 Author: eadler Date: Wed May 1 04:37:45 2013 New Revision: 250132 URL: http://svnweb.freebsd.org/changeset/base/250132 Log: Fix incorrect sizeof() in bzero() Submitted by: swildner@DragonFlyBSD.org Reviewed by: alfred, jmallett Modified: head/sys/contrib/octeon-sdk/cvmx-usbd.c Modified: head/sys/contrib/octeon-sdk/cvmx-usbd.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-usbd.c Wed May 1 04:37:34 2013 (r250131) +++ head/sys/contrib/octeon-sdk/cvmx-usbd.c Wed May 1 04:37:45 2013 (r250132) @@ -245,7 +245,7 @@ int cvmx_usbd_initialize(cvmx_usbd_state if (cvmx_unlikely(flags & CVMX_USBD_INITIALIZE_FLAGS_DEBUG)) cvmx_dprintf("%s: Called\n", __FUNCTION__); - memset(usb, 0, sizeof(usb)); + memset(usb, 0, sizeof(*usb)); usb->init_flags = flags; usb->index = usb_port_number; From owner-svn-src-head@FreeBSD.ORG Wed May 1 05:15:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 634C0A1D; Wed, 1 May 2013 05:15:00 +0000 (UTC) (envelope-from wkoszek@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 53BA4192C; Wed, 1 May 2013 05:15:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r415F0gp078235; Wed, 1 May 2013 05:15:00 GMT (envelope-from wkoszek@svn.freebsd.org) Received: (from wkoszek@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r415F0iZ078233; Wed, 1 May 2013 05:15:00 GMT (envelope-from wkoszek@svn.freebsd.org) Message-Id: <201305010515.r415F0iZ078233@svn.freebsd.org> From: "Wojciech A. Koszek" Date: Wed, 1 May 2013 05:15:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250133 - head/usr.sbin/config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 05:15:00 -0000 Author: wkoszek Date: Wed May 1 05:14:59 2013 New Revision: 250133 URL: http://svnweb.freebsd.org/changeset/base/250133 Log: Make the internal assertion correct--only fail when '\0' is found in places other than the end of the test section. Otherwise, with kernel compiled with Clang which happens to be setting ELF section alignment differently config(8) was throwing assert() failure unnecessarily Reported by: Kimmo Paasiala Tested by: Kimmo Paasiala MFC after: 10 days Modified: head/usr.sbin/config/main.c Modified: head/usr.sbin/config/main.c ============================================================================== --- head/usr.sbin/config/main.c Wed May 1 04:37:45 2013 (r250132) +++ head/usr.sbin/config/main.c Wed May 1 05:14:59 2013 (r250133) @@ -706,17 +706,11 @@ kernconfdump(const char *file) r = fgetc(fp); if (r == EOF) break; - /* - * If '\0' is present in the middle of the configuration - * string, this means something very weird is happening. - * Make such case very visible. However, some architectures - * pad the length of the section with NULs to a multiple of - * sh_addralign, allow a NUL in that part of the section. - */ - if (r == '\0' && (size - i) < align) + if (r == '\0') { + assert(i == size - 1 && + ("\\0 found in the middle of a file")); break; - assert(r != '\0' && ("Char present in the configuration " - "string mustn't be equal to 0")); + } fputc(r, stdout); } fclose(fp); From owner-svn-src-head@FreeBSD.ORG Wed May 1 05:46:55 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B7E6EF45; Wed, 1 May 2013 05:46:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AB12C1BCB; Wed, 1 May 2013 05:46:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r415ktsg088823; Wed, 1 May 2013 05:46:55 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r415ktrA088822; Wed, 1 May 2013 05:46:55 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201305010546.r415ktrA088822@svn.freebsd.org> From: Warner Losh Date: Wed, 1 May 2013 05:46:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250134 - head/sys/mips/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 05:46:55 -0000 Author: imp Date: Wed May 1 05:46:54 2013 New Revision: 250134 URL: http://svnweb.freebsd.org/changeset/base/250134 Log: Import virgin regdef.h from 4.4 Lite 2's sys/pmax/include/regdef.h, expand the %sccs.include.redist.c% directive with the standard 3-clause license, and add $FreeBSD$ to keep the commit script happy. # This may break some mips stuff, which will be fixed in the next commit. Modified: head/sys/mips/include/regdef.h Modified: head/sys/mips/include/regdef.h ============================================================================== --- head/sys/mips/include/regdef.h Wed May 1 05:14:59 2013 (r250133) +++ head/sys/mips/include/regdef.h Wed May 1 05:46:54 2013 (r250134) @@ -1,86 +1,67 @@ -/*- - * Copyright (c) 2001, Juniper Networks, Inc. - * All rights reserved. - * Truman Joe, February 2001. +/* + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. * - * regdef.h -- MIPS register definitions. + * This code is derived from software contributed to Berkeley by + * Ralph Campbell. This file is derived from the MIPS RISC + * Architecture book by Gerry Kane. * - * JNPR: regdef.h,v 1.3 2006/08/07 05:38:57 katta - * $FreeBSD$ - */ - -#ifndef _MACHINE_REGDEF_H_ -#define _MACHINE_REGDEF_H_ - -#include /* For API selection */ - -#if defined(__ASSEMBLER__) -/* General purpose CPU register names */ -#define zero $0 /* wired zero */ -#define AT $at /* assembler temp */ -#define v0 $2 /* return value */ -#define v1 $3 -#define a0 $4 /* argument registers */ -#define a1 $5 -#define a2 $6 -#define a3 $7 -#if defined(__mips_n32) || defined(__mips_n64) -#define a4 $8 -#define a5 $9 -#define a6 $10 -#define a7 $11 -#define t0 $12 /* Temp regs, not saved accross subroutine calls */ -#define t1 $13 -#define t2 $14 -#define t3 $15 -#else -#define t0 $8 /* caller saved */ -#define t1 $9 -#define t2 $10 -#define t3 $11 -#define t4 $12 /* caller saved - 32 bit env arg reg 64 bit */ -#define t5 $13 -#define t6 $14 -#define t7 $15 -#endif -#define s0 $16 /* callee saved */ -#define s1 $17 -#define s2 $18 -#define s3 $19 -#define s4 $20 -#define s5 $21 -#define s6 $22 -#define s7 $23 -#define t8 $24 /* code generator */ -#define t9 $25 -#define k0 $26 /* kernel temporary */ -#define k1 $27 -#define gp $28 /* global pointer */ -#define sp $29 /* stack pointer */ -#define fp $30 /* frame pointer */ -#define s8 $30 /* callee saved */ -#define ra $31 /* return address */ - -/* - * These are temp registers whose names can be used in either the old - * or new ABI, although they map to different physical registers. In - * the old ABI, they map to t4-t7, and in the new ABI, they map to a4-a7. + * 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. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * - * Because they overlap with the last 4 arg regs in the new ABI, ta0-ta3 - * should be used only when we need more than t0-t3. + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. + * @(#)regdef.h 8.1 (Berkeley) 06/10/93 + * $FreeBSD$ */ -#if defined(__mips_n32) || defined(__mips_n64) -#define ta0 $8 -#define ta1 $9 -#define ta2 $10 -#define ta3 $11 -#else -#define ta0 $12 -#define ta1 $13 -#define ta2 $14 -#define ta3 $15 -#endif /* __mips_n32 || __mips_n64 */ - -#endif /* __ASSEMBLER__ */ -#endif /* !_MACHINE_REGDEF_H_ */ +#define zero $0 /* always zero */ +#define AT $at /* assembler temp */ +#define v0 $2 /* return value */ +#define v1 $3 +#define a0 $4 /* argument registers */ +#define a1 $5 +#define a2 $6 +#define a3 $7 +#define t0 $8 /* temp registers (not saved across subroutine calls) */ +#define t1 $9 +#define t2 $10 +#define t3 $11 +#define t4 $12 +#define t5 $13 +#define t6 $14 +#define t7 $15 +#define s0 $16 /* saved across subroutine calls (callee saved) */ +#define s1 $17 +#define s2 $18 +#define s3 $19 +#define s4 $20 +#define s5 $21 +#define s6 $22 +#define s7 $23 +#define t8 $24 /* two more temp registers */ +#define t9 $25 +#define k0 $26 /* kernel temporary */ +#define k1 $27 +#define gp $28 /* global pointer */ +#define sp $29 /* stack pointer */ +#define s8 $30 /* one more callee saved */ +#define ra $31 /* return address */ From owner-svn-src-head@FreeBSD.ORG Wed May 1 05:48:33 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0E1FE15A; Wed, 1 May 2013 05:48:33 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 01A841BE4; Wed, 1 May 2013 05:48:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r415mWUA089152; Wed, 1 May 2013 05:48:32 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r415mWCw089151; Wed, 1 May 2013 05:48:32 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201305010548.r415mWCw089151@svn.freebsd.org> From: Warner Losh Date: Wed, 1 May 2013 05:48:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250135 - head/sys/mips/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 05:48:33 -0000 Author: imp Date: Wed May 1 05:48:32 2013 New Revision: 250135 URL: http://svnweb.freebsd.org/changeset/base/250135 Log: Add the standard #ifdef header protection. Modified: head/sys/mips/include/regdef.h Modified: head/sys/mips/include/regdef.h ============================================================================== --- head/sys/mips/include/regdef.h Wed May 1 05:46:54 2013 (r250134) +++ head/sys/mips/include/regdef.h Wed May 1 05:48:32 2013 (r250135) @@ -33,6 +33,9 @@ * $FreeBSD$ */ +#ifndef _MIPS_INCLUDE_REGDEF_H_ +#define _MIPS_INCLUDE_REGDEF_H_ + #define zero $0 /* always zero */ #define AT $at /* assembler temp */ #define v0 $2 /* return value */ @@ -65,3 +68,5 @@ #define sp $29 /* stack pointer */ #define s8 $30 /* one more callee saved */ #define ra $31 /* return address */ + +#endif /* _MIPS_INCLUDE_REGDEF_H_ */ From owner-svn-src-head@FreeBSD.ORG Wed May 1 05:55:58 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D5C5B32C for ; Wed, 1 May 2013 05:55:58 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-la0-x235.google.com (mail-la0-x235.google.com [IPv6:2a00:1450:4010:c03::235]) by mx1.freebsd.org (Postfix) with ESMTP id 605D21C1B for ; Wed, 1 May 2013 05:55:58 +0000 (UTC) Received: by mail-la0-f53.google.com with SMTP id eg20so1102142lab.12 for ; Tue, 30 Apr 2013 22:55:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=Gi8ii8ajnVx5+xKoVp+Ajyp/IeihWEn8g7jyvct7OmY=; b=opM//xBoSyKFZ03SGcbLYsy2EfDLWW/RFDp/nJat+T+M+UZ5Ybn5rIYmeZ9NWq+ydq P77nMcRPGaVqvhIh6dyilJ78UczMfObV+AZzI7pZN0lYv9nLwqlhlARd2N3b24nxUfwq x1ytW/6bcrY1ok07M2mP50LoBjfl5uUDVscpo9lzT1Qn6N0+BKiuop6dz91NRzaqp+Ul IV+vb4fRSWSBisk+CymbhgiEmpV8NQycLVjAagNvp4ycJAX2k7mm6kO3gqpV18CiUwFn VG8tX3LZoj4hRupg4jJRkFShgkMinZ9aLabuMvmv6DE3G0OIhsNdNGIv0GY0bXbGGuQF telw== X-Received: by 10.152.3.167 with SMTP id d7mr448341lad.53.1367387756660; Tue, 30 Apr 2013 22:55:56 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.152.28.196 with HTTP; Tue, 30 Apr 2013 22:55:36 -0700 (PDT) In-Reply-To: <201305010546.r415ktrA088822@svn.freebsd.org> References: <201305010546.r415ktrA088822@svn.freebsd.org> From: Juli Mallett Date: Tue, 30 Apr 2013 22:55:36 -0700 X-Google-Sender-Auth: uviF0PlGzwpSMj9EepZqazPPGvQ Message-ID: Subject: Re: svn commit: r250134 - head/sys/mips/include To: Warner Losh Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQn4Yp1Ms/k0I0IuQohRBB1eT2RBXaWD2sRtaja7EQYAMhfa1Iwv63COBrHGz92tAY+c0dOr Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 05:55:58 -0000 Warner, May I ask why you're bringing in the 4.4BSD version and not the NetBSD version, which already contained the appropriate ABI gunk? Do we really need to duplicate their work improving the file since 4.4BSD? Thanks, Juli. On Tue, Apr 30, 2013 at 10:46 PM, Warner Losh wrote: > Author: imp > Date: Wed May 1 05:46:54 2013 > New Revision: 250134 > URL: http://svnweb.freebsd.org/changeset/base/250134 > > Log: > Import virgin regdef.h from 4.4 Lite 2's sys/pmax/include/regdef.h, > expand the %sccs.include.redist.c% directive with the standard > 3-clause license, and add $FreeBSD$ to keep the commit script happy. > > # This may break some mips stuff, which will be fixed in the next commit. > > Modified: > head/sys/mips/include/regdef.h > > Modified: head/sys/mips/include/regdef.h > ============================================================================== > --- head/sys/mips/include/regdef.h Wed May 1 05:14:59 2013 (r250133) > +++ head/sys/mips/include/regdef.h Wed May 1 05:46:54 2013 (r250134) > @@ -1,86 +1,67 @@ > -/*- > - * Copyright (c) 2001, Juniper Networks, Inc. > - * All rights reserved. > - * Truman Joe, February 2001. > +/* > + * Copyright (c) 1992, 1993 > + * The Regents of the University of California. All rights reserved. > * > - * regdef.h -- MIPS register definitions. > + * This code is derived from software contributed to Berkeley by > + * Ralph Campbell. This file is derived from the MIPS RISC > + * Architecture book by Gerry Kane. > * > - * JNPR: regdef.h,v 1.3 2006/08/07 05:38:57 katta > - * $FreeBSD$ > - */ > - > -#ifndef _MACHINE_REGDEF_H_ > -#define _MACHINE_REGDEF_H_ > - > -#include /* For API selection */ > - > -#if defined(__ASSEMBLER__) > -/* General purpose CPU register names */ > -#define zero $0 /* wired zero */ > -#define AT $at /* assembler temp */ > -#define v0 $2 /* return value */ > -#define v1 $3 > -#define a0 $4 /* argument registers */ > -#define a1 $5 > -#define a2 $6 > -#define a3 $7 > -#if defined(__mips_n32) || defined(__mips_n64) > -#define a4 $8 > -#define a5 $9 > -#define a6 $10 > -#define a7 $11 > -#define t0 $12 /* Temp regs, not saved accross subroutine calls */ > -#define t1 $13 > -#define t2 $14 > -#define t3 $15 > -#else > -#define t0 $8 /* caller saved */ > -#define t1 $9 > -#define t2 $10 > -#define t3 $11 > -#define t4 $12 /* caller saved - 32 bit env arg reg 64 bit */ > -#define t5 $13 > -#define t6 $14 > -#define t7 $15 > -#endif > -#define s0 $16 /* callee saved */ > -#define s1 $17 > -#define s2 $18 > -#define s3 $19 > -#define s4 $20 > -#define s5 $21 > -#define s6 $22 > -#define s7 $23 > -#define t8 $24 /* code generator */ > -#define t9 $25 > -#define k0 $26 /* kernel temporary */ > -#define k1 $27 > -#define gp $28 /* global pointer */ > -#define sp $29 /* stack pointer */ > -#define fp $30 /* frame pointer */ > -#define s8 $30 /* callee saved */ > -#define ra $31 /* return address */ > - > -/* > - * These are temp registers whose names can be used in either the old > - * or new ABI, although they map to different physical registers. In > - * the old ABI, they map to t4-t7, and in the new ABI, they map to a4-a7. > + * 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. > + * 4. Neither the name of the University nor the names of its contributors > + * may be used to endorse or promote products derived from this software > + * without specific prior written permission. > * > - * Because they overlap with the last 4 arg regs in the new ABI, ta0-ta3 > - * should be used only when we need more than t0-t3. > + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. > + * @(#)regdef.h 8.1 (Berkeley) 06/10/93 > + * $FreeBSD$ > */ > -#if defined(__mips_n32) || defined(__mips_n64) > -#define ta0 $8 > -#define ta1 $9 > -#define ta2 $10 > -#define ta3 $11 > -#else > -#define ta0 $12 > -#define ta1 $13 > -#define ta2 $14 > -#define ta3 $15 > -#endif /* __mips_n32 || __mips_n64 */ > - > -#endif /* __ASSEMBLER__ */ > > -#endif /* !_MACHINE_REGDEF_H_ */ > +#define zero $0 /* always zero */ > +#define AT $at /* assembler temp */ > +#define v0 $2 /* return value */ > +#define v1 $3 > +#define a0 $4 /* argument registers */ > +#define a1 $5 > +#define a2 $6 > +#define a3 $7 > +#define t0 $8 /* temp registers (not saved across subroutine calls) */ > +#define t1 $9 > +#define t2 $10 > +#define t3 $11 > +#define t4 $12 > +#define t5 $13 > +#define t6 $14 > +#define t7 $15 > +#define s0 $16 /* saved across subroutine calls (callee saved) */ > +#define s1 $17 > +#define s2 $18 > +#define s3 $19 > +#define s4 $20 > +#define s5 $21 > +#define s6 $22 > +#define s7 $23 > +#define t8 $24 /* two more temp registers */ > +#define t9 $25 > +#define k0 $26 /* kernel temporary */ > +#define k1 $27 > +#define gp $28 /* global pointer */ > +#define sp $29 /* stack pointer */ > +#define s8 $30 /* one more callee saved */ > +#define ra $31 /* return address */ From owner-svn-src-head@FreeBSD.ORG Wed May 1 06:00:07 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3F0BB60E for ; Wed, 1 May 2013 06:00:07 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-ie0-x22f.google.com (mail-ie0-x22f.google.com [IPv6:2607:f8b0:4001:c03::22f]) by mx1.freebsd.org (Postfix) with ESMTP id 10FD11C78 for ; Wed, 1 May 2013 06:00:07 +0000 (UTC) Received: by mail-ie0-f175.google.com with SMTP id a11so1606729iee.34 for ; Tue, 30 Apr 2013 23:00:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to:x-mailer:x-gm-message-state; bh=yIK6GE4FZSAhH4lkkivwjmEA+oPQRemaEnA/q2bdGgE=; b=B8gM/2V31rWdZOOKfe02hDMqptEHPUHHRRpEE/hQ/qc6+PIlLjqqA1y4B2CZ2yeHf3 pw7jqJ1RlntJOykEsznhgrO3BODEJjHogKc4QvPevW5aL2Dq12vP+kIbp0b/EpLktqfD M3pCMGXvTw7WwX12/7yDL5Q34P0LwPYGxucfFccuJDXXadE48fWluzS0gt9NAtxabJah 6+a243lstq2fQMZNXnh2s6H2HtBEpOHeiyTWbyYf7MX/GWSCsseSETYioQYwQ1lPa2IA 6I3onhocRKl+97MwrEtKmV2960I3+g2GCHSvWBh+R6PyjpWbstktqnOa/m42XvKGGbcx TSOw== X-Received: by 10.50.17.71 with SMTP id m7mr1097901igd.5.1367388006710; Tue, 30 Apr 2013 23:00:06 -0700 (PDT) Received: from 53.imp.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id c2sm26459842igv.1.2013.04.30.23.00.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 30 Apr 2013 23:00:05 -0700 (PDT) Sender: Warner Losh Subject: Re: svn commit: r250134 - head/sys/mips/include Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Wed, 1 May 2013 00:00:04 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <6739A162-749B-4BDF-B5FA-E36235EF404A@bsdimp.com> References: <201305010546.r415ktrA088822@svn.freebsd.org> To: Juli Mallett X-Mailer: Apple Mail (2.1085) X-Gm-Message-State: ALoCoQnG9OQWqUjqv88a1dKz0LDq3r89sz+LR4eSml7/jLg+Xa46lGxvGDrY7G0G4+tornNovUOQ Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 06:00:07 -0000 On Apr 30, 2013, at 11:55 PM, Juli Mallett wrote: > Warner, >=20 > May I ask why you're bringing in the 4.4BSD version and not the NetBSD > version, which already contained the appropriate ABI gunk? Do we > really need to duplicate their work improving the file since 4.4BSD? The NetBSD version didn't have the CSRG copyright, so I wanted to create = a clear chain of modifications. I'll be done with that within the = hour.... But it turns out I was confused about which file lacked a copyright (I = was also looking at elf_machdep.h), so I'll just bring NetBSD's in now. = Sorry for the churn... Warner > Thanks, > Juli. >=20 > On Tue, Apr 30, 2013 at 10:46 PM, Warner Losh wrote: >> Author: imp >> Date: Wed May 1 05:46:54 2013 >> New Revision: 250134 >> URL: http://svnweb.freebsd.org/changeset/base/250134 >>=20 >> Log: >> Import virgin regdef.h from 4.4 Lite 2's sys/pmax/include/regdef.h, >> expand the %sccs.include.redist.c% directive with the standard >> 3-clause license, and add $FreeBSD$ to keep the commit script happy. >>=20 >> # This may break some mips stuff, which will be fixed in the next = commit. >>=20 >> Modified: >> head/sys/mips/include/regdef.h >>=20 >> Modified: head/sys/mips/include/regdef.h >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/mips/include/regdef.h Wed May 1 05:14:59 2013 = (r250133) >> +++ head/sys/mips/include/regdef.h Wed May 1 05:46:54 2013 = (r250134) >> @@ -1,86 +1,67 @@ >> -/*- >> - * Copyright (c) 2001, Juniper Networks, Inc. >> - * All rights reserved. >> - * Truman Joe, February 2001. >> +/* >> + * Copyright (c) 1992, 1993 >> + * The Regents of the University of California. All rights = reserved. >> * >> - * regdef.h -- MIPS register definitions. >> + * This code is derived from software contributed to Berkeley by >> + * Ralph Campbell. This file is derived from the MIPS RISC >> + * Architecture book by Gerry Kane. >> * >> - * JNPR: regdef.h,v 1.3 2006/08/07 05:38:57 katta >> - * $FreeBSD$ >> - */ >> - >> -#ifndef _MACHINE_REGDEF_H_ >> -#define _MACHINE_REGDEF_H_ >> - >> -#include /* For API selection */ >> - >> -#if defined(__ASSEMBLER__) >> -/* General purpose CPU register names */ >> -#define zero $0 /* wired zero */ >> -#define AT $at /* assembler temp */ >> -#define v0 $2 /* return value */ >> -#define v1 $3 >> -#define a0 $4 /* argument registers */ >> -#define a1 $5 >> -#define a2 $6 >> -#define a3 $7 >> -#if defined(__mips_n32) || defined(__mips_n64) >> -#define a4 $8 >> -#define a5 $9 >> -#define a6 $10 >> -#define a7 $11 >> -#define t0 $12 /* Temp regs, not saved accross = subroutine calls */ >> -#define t1 $13 >> -#define t2 $14 >> -#define t3 $15 >> -#else >> -#define t0 $8 /* caller saved */ >> -#define t1 $9 >> -#define t2 $10 >> -#define t3 $11 >> -#define t4 $12 /* caller saved - 32 bit env arg reg = 64 bit */ >> -#define t5 $13 >> -#define t6 $14 >> -#define t7 $15 >> -#endif >> -#define s0 $16 /* callee saved */ >> -#define s1 $17 >> -#define s2 $18 >> -#define s3 $19 >> -#define s4 $20 >> -#define s5 $21 >> -#define s6 $22 >> -#define s7 $23 >> -#define t8 $24 /* code generator */ >> -#define t9 $25 >> -#define k0 $26 /* kernel temporary */ >> -#define k1 $27 >> -#define gp $28 /* global pointer */ >> -#define sp $29 /* stack pointer */ >> -#define fp $30 /* frame pointer */ >> -#define s8 $30 /* callee saved */ >> -#define ra $31 /* return address */ >> - >> -/* >> - * These are temp registers whose names can be used in either the = old >> - * or new ABI, although they map to different physical registers. = In >> - * the old ABI, they map to t4-t7, and in the new ABI, they map to = a4-a7. >> + * 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. >> + * 4. Neither the name of the University nor the names of its = contributors >> + * may be used to endorse or promote products derived from this = software >> + * without specific prior written permission. >> * >> - * Because they overlap with the last 4 arg regs in the new ABI, = ta0-ta3 >> - * should be used only when we need more than t0-t3. >> + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. >> + * @(#)regdef.h 8.1 (Berkeley) 06/10/93 >> + * $FreeBSD$ >> */ >> -#if defined(__mips_n32) || defined(__mips_n64) >> -#define ta0 $8 >> -#define ta1 $9 >> -#define ta2 $10 >> -#define ta3 $11 >> -#else >> -#define ta0 $12 >> -#define ta1 $13 >> -#define ta2 $14 >> -#define ta3 $15 >> -#endif /* __mips_n32 || __mips_n64 */ >> - >> -#endif /* __ASSEMBLER__ */ >>=20 >> -#endif /* !_MACHINE_REGDEF_H_ */ >> +#define zero $0 /* always zero */ >> +#define AT $at /* assembler temp */ >> +#define v0 $2 /* return value */ >> +#define v1 $3 >> +#define a0 $4 /* argument registers */ >> +#define a1 $5 >> +#define a2 $6 >> +#define a3 $7 >> +#define t0 $8 /* temp registers (not saved across = subroutine calls) */ >> +#define t1 $9 >> +#define t2 $10 >> +#define t3 $11 >> +#define t4 $12 >> +#define t5 $13 >> +#define t6 $14 >> +#define t7 $15 >> +#define s0 $16 /* saved across subroutine calls (callee = saved) */ >> +#define s1 $17 >> +#define s2 $18 >> +#define s3 $19 >> +#define s4 $20 >> +#define s5 $21 >> +#define s6 $22 >> +#define s7 $23 >> +#define t8 $24 /* two more temp registers */ >> +#define t9 $25 >> +#define k0 $26 /* kernel temporary */ >> +#define k1 $27 >> +#define gp $28 /* global pointer */ >> +#define sp $29 /* stack pointer */ >> +#define s8 $30 /* one more callee saved */ >> +#define ra $31 /* return address */ From owner-svn-src-head@FreeBSD.ORG Wed May 1 06:22:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D30E79BC; Wed, 1 May 2013 06:22:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C48F31D36; Wed, 1 May 2013 06:22:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r416MoDZ002402; Wed, 1 May 2013 06:22:50 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r416Mo5L002401; Wed, 1 May 2013 06:22:50 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201305010622.r416Mo5L002401@svn.freebsd.org> From: Warner Losh Date: Wed, 1 May 2013 06:22:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250136 - head/sys/mips/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 06:22:50 -0000 Author: imp Date: Wed May 1 06:22:50 2013 New Revision: 250136 URL: http://svnweb.freebsd.org/changeset/base/250136 Log: Import NetBSD's version, which is perfectly fine. Submitted by: jmallet@ Modified: head/sys/mips/include/regdef.h Modified: head/sys/mips/include/regdef.h ============================================================================== --- head/sys/mips/include/regdef.h Wed May 1 05:48:32 2013 (r250135) +++ head/sys/mips/include/regdef.h Wed May 1 06:22:50 2013 (r250136) @@ -1,6 +1,8 @@ +/* $NetBSD: regdef.h,v 1.12 2005/12/11 12:18:09 christos Exp $ */ + /* * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. + * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Ralph Campbell. This file is derived from the MIPS RISC @@ -14,7 +16,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -29,44 +31,80 @@ * 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. - * @(#)regdef.h 8.1 (Berkeley) 06/10/93 + * + * @(#)regdef.h 8.1 (Berkeley) 6/10/93 * $FreeBSD$ */ -#ifndef _MIPS_INCLUDE_REGDEF_H_ -#define _MIPS_INCLUDE_REGDEF_H_ +#ifndef _MIPS_REGDEF_H +#define _MIPS_REGDEF_H + +#include /* for API selection */ + +#if defined(__ASSEMBLER__) +#define zero $0 /* always zero */ +#define AT $at /* assembler temporary */ +#define v0 $2 /* return value */ +#define v1 $3 +#define a0 $4 /* argument registers */ +#define a1 $5 +#define a2 $6 +#define a3 $7 +#if defined(__mips_n32) || defined(__mips_n64) +#define a4 $8 +#define a5 $9 +#define a6 $10 +#define a7 $11 +#define t0 $12 /* temp registers (not saved across subroutine calls) */ +#define t1 $13 +#define t2 $14 +#define t3 $15 +#else +#define t0 $8 /* temp registers (not saved across subroutine calls) */ +#define t1 $9 +#define t2 $10 +#define t3 $11 +#define t4 $12 +#define t5 $13 +#define t6 $14 +#define t7 $15 +#endif /* __mips_n32 || __mips_n64 */ +#define s0 $16 /* saved across subroutine calls (callee saved) */ +#define s1 $17 +#define s2 $18 +#define s3 $19 +#define s4 $20 +#define s5 $21 +#define s6 $22 +#define s7 $23 +#define t8 $24 /* two more temporary registers */ +#define t9 $25 +#define k0 $26 /* kernel temporary */ +#define k1 $27 +#define gp $28 /* global pointer */ +#define sp $29 /* stack pointer */ +#define s8 $30 /* one more callee saved */ +#define ra $31 /* return address */ -#define zero $0 /* always zero */ -#define AT $at /* assembler temp */ -#define v0 $2 /* return value */ -#define v1 $3 -#define a0 $4 /* argument registers */ -#define a1 $5 -#define a2 $6 -#define a3 $7 -#define t0 $8 /* temp registers (not saved across subroutine calls) */ -#define t1 $9 -#define t2 $10 -#define t3 $11 -#define t4 $12 -#define t5 $13 -#define t6 $14 -#define t7 $15 -#define s0 $16 /* saved across subroutine calls (callee saved) */ -#define s1 $17 -#define s2 $18 -#define s3 $19 -#define s4 $20 -#define s5 $21 -#define s6 $22 -#define s7 $23 -#define t8 $24 /* two more temp registers */ -#define t9 $25 -#define k0 $26 /* kernel temporary */ -#define k1 $27 -#define gp $28 /* global pointer */ -#define sp $29 /* stack pointer */ -#define s8 $30 /* one more callee saved */ -#define ra $31 /* return address */ +/* + * These are temp registers whose names can be used in either the old + * or new ABI, although they map to different physical registers. In + * the old ABI, they map to t4-t7, and in the new ABI, they map to a4-a7. + * + * Because they overlap with the last 4 arg regs in the new ABI, ta0-ta3 + * should be used only when we need more than t0-t3. + */ +#if defined(__mips_n32) || defined(__mips_n64) +#define ta0 $8 +#define ta1 $9 +#define ta2 $10 +#define ta3 $11 +#else +#define ta0 $12 +#define ta1 $13 +#define ta2 $14 +#define ta3 $15 +#endif /* __mips_n32 || __mips_n64 */ -#endif /* _MIPS_INCLUDE_REGDEF_H_ */ +#endif /* __ASSEMBLER__ */ +#endif /* _MIPS_REGDEF_H */ From owner-svn-src-head@FreeBSD.ORG Wed May 1 06:55:14 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 61DD2FA6; Wed, 1 May 2013 06:55:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 534141E61; Wed, 1 May 2013 06:55:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r416tEoW013137; Wed, 1 May 2013 06:55:14 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r416tEAE013136; Wed, 1 May 2013 06:55:14 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201305010655.r416tEAE013136@svn.freebsd.org> From: Warner Losh Date: Wed, 1 May 2013 06:55:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250137 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 06:55:14 -0000 Author: imp Date: Wed May 1 06:55:13 2013 New Revision: 250137 URL: http://svnweb.freebsd.org/changeset/base/250137 Log: Remove asm.h dependency in a hackish way. Fixed comment. Modified: head/sys/mips/mips/vm_machdep.c Modified: head/sys/mips/mips/vm_machdep.c ============================================================================== --- head/sys/mips/mips/vm_machdep.c Wed May 1 06:22:50 2013 (r250136) +++ head/sys/mips/mips/vm_machdep.c Wed May 1 06:55:13 2013 (r250137) @@ -57,7 +57,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -83,6 +82,18 @@ __FBSDID("$FreeBSD$"); #define NSFBUFS (512 + maxusers * 16) #endif +/* Duplicated from asm.h */ +#if defined(__mips_o32) +#define SZREG 4 +#else +#define SZREG 8 +#endif +#if defined(__mips_o32) || defined(__mips_o64) +#define CALLFRAME_SIZ (SZREG * (4 + 2)) +#elif defined(__mips_n32) || defined(__mips_n64) +#define CALLFRAME_SIZ (SZREG * 4) +#endif + #ifndef __mips_n64 static void sf_buf_init(void *arg); SYSINIT(sock_sf, SI_SUB_MBUF, SI_ORDER_ANY, sf_buf_init, NULL); @@ -437,10 +448,11 @@ cpu_set_upcall_kse(struct thread *td, vo register_t sp; /* - * At the point where a function is called, sp must be 8 - * byte aligned[for compatibility with 64-bit CPUs] - * in ``See MIPS Run'' by D. Sweetman, p. 269 - * align stack */ + * At the point where a function is called, sp must be 8 + * byte aligned[for compatibility with 64-bit CPUs] + * in ``See MIPS Run'' by D. Sweetman, p. 269 + * align stack + */ sp = ((register_t)(intptr_t)(stack->ss_sp + stack->ss_size) & ~0x7) - CALLFRAME_SIZ; From owner-svn-src-head@FreeBSD.ORG Wed May 1 06:57:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9FF161E4; Wed, 1 May 2013 06:57:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 80B8E1E8D; Wed, 1 May 2013 06:57:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r416vl48013606; Wed, 1 May 2013 06:57:47 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r416vkwh013600; Wed, 1 May 2013 06:57:46 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201305010657.r416vkwh013600@svn.freebsd.org> From: Warner Losh Date: Wed, 1 May 2013 06:57:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250138 - in head/sys/mips: include mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 06:57:47 -0000 Author: imp Date: Wed May 1 06:57:46 2013 New Revision: 250138 URL: http://svnweb.freebsd.org/changeset/base/250138 Log: Don't include asm.h in non-asm files. Remove #define to get kludges that asm.h used to define Move clever macros to access assembler instructions to trap.c Remove __ASSEMBLER__ ifdefs in regdef.h: they aren't needed anymore. Modified: head/sys/mips/include/asm.h head/sys/mips/include/regdef.h head/sys/mips/mips/db_interface.c head/sys/mips/mips/trap.c Modified: head/sys/mips/include/asm.h ============================================================================== --- head/sys/mips/include/asm.h Wed May 1 06:55:13 2013 (r250137) +++ head/sys/mips/include/asm.h Wed May 1 06:57:46 2013 (r250138) @@ -56,9 +56,7 @@ #ifndef _MACHINE_ASM_H_ #define _MACHINE_ASM_H_ -#ifndef NO_REG_DEFS #include -#endif #include #include @@ -111,26 +109,6 @@ #define WARN_REFERENCES(_sym,_msg) \ .section .gnu.warning. ## _sym ; .ascii _msg ; .text -/* - * These are temp registers whose names can be used in either the old - * or new ABI, although they map to different physical registers. In - * the old ABI, they map to t4-t7, and in the new ABI, they map to a4-a7. - * - * Because they overlap with the last 4 arg regs in the new ABI, ta0-ta3 - * should be used only when we need more than t0-t3. - */ -#if defined(__mips_n32) || defined(__mips_n64) -#define ta0 $8 -#define ta1 $9 -#define ta2 $10 -#define ta3 $11 -#else -#define ta0 $12 -#define ta1 $13 -#define ta2 $14 -#define ta3 $15 -#endif /* __mips_n32 || __mips_n64 */ - #ifdef __ELF__ # define _C_LABEL(x) x #else @@ -674,97 +652,6 @@ _C_LABEL(x): #define USE_ALT_CP(a) .cplocal a #endif /* __mips_n32 || __mips_n64 */ -#define mfc0_macro(data, spr) \ - __asm __volatile ("mfc0 %0, $%1" \ - : "=r" (data) /* outputs */ \ - : "i" (spr)); /* inputs */ - -#define mtc0_macro(data, spr) \ - __asm __volatile ("mtc0 %0, $%1" \ - : /* outputs */ \ - : "r" (data), "i" (spr)); /* inputs */ - -#define cfc0_macro(data, spr) \ - __asm __volatile ("cfc0 %0, $%1" \ - : "=r" (data) /* outputs */ \ - : "i" (spr)); /* inputs */ - -#define ctc0_macro(data, spr) \ - __asm __volatile ("ctc0 %0, $%1" \ - : /* outputs */ \ - : "r" (data), "i" (spr)); /* inputs */ - - -#define lbu_macro(data, addr) \ - __asm __volatile ("lbu %0, 0x0(%1)" \ - : "=r" (data) /* outputs */ \ - : "r" (addr)); /* inputs */ - -#define lb_macro(data, addr) \ - __asm __volatile ("lb %0, 0x0(%1)" \ - : "=r" (data) /* outputs */ \ - : "r" (addr)); /* inputs */ - -#define lwl_macro(data, addr) \ - __asm __volatile ("lwl %0, 0x0(%1)" \ - : "=r" (data) /* outputs */ \ - : "r" (addr)); /* inputs */ - -#define lwr_macro(data, addr) \ - __asm __volatile ("lwr %0, 0x0(%1)" \ - : "=r" (data) /* outputs */ \ - : "r" (addr)); /* inputs */ - -#define ldl_macro(data, addr) \ - __asm __volatile ("ldl %0, 0x0(%1)" \ - : "=r" (data) /* outputs */ \ - : "r" (addr)); /* inputs */ - -#define ldr_macro(data, addr) \ - __asm __volatile ("ldr %0, 0x0(%1)" \ - : "=r" (data) /* outputs */ \ - : "r" (addr)); /* inputs */ - -#define sb_macro(data, addr) \ - __asm __volatile ("sb %0, 0x0(%1)" \ - : /* outputs */ \ - : "r" (data), "r" (addr)); /* inputs */ - -#define swl_macro(data, addr) \ - __asm __volatile ("swl %0, 0x0(%1)" \ - : /* outputs */ \ - : "r" (data), "r" (addr)); /* inputs */ - -#define swr_macro(data, addr) \ - __asm __volatile ("swr %0, 0x0(%1)" \ - : /* outputs */ \ - : "r" (data), "r" (addr)); /* inputs */ - -#define sdl_macro(data, addr) \ - __asm __volatile ("sdl %0, 0x0(%1)" \ - : /* outputs */ \ - : "r" (data), "r" (addr)); /* inputs */ - -#define sdr_macro(data, addr) \ - __asm __volatile ("sdr %0, 0x0(%1)" \ - : /* outputs */ \ - : "r" (data), "r" (addr)); /* inputs */ - -#define mfgr_macro(data, gr) \ - __asm __volatile ("move %0, $%1" \ - : "=r" (data) /* outputs */ \ - : "i" (gr)); /* inputs */ - -#define dmfc0_macro(data, spr) \ - __asm __volatile ("dmfc0 %0, $%1" \ - : "=r" (data) /* outputs */ \ - : "i" (spr)); /* inputs */ - -#define dmtc0_macro(data, spr, sel) \ - __asm __volatile ("dmtc0 %0, $%1, %2" \ - : /* no outputs */ \ - : "r" (data), "i" (spr), "i" (sel)); /* inputs */ - #define GET_CPU_PCPU(reg) \ PTR_L reg, _C_LABEL(pcpup); Modified: head/sys/mips/include/regdef.h ============================================================================== --- head/sys/mips/include/regdef.h Wed May 1 06:55:13 2013 (r250137) +++ head/sys/mips/include/regdef.h Wed May 1 06:57:46 2013 (r250138) @@ -41,7 +41,6 @@ #include /* for API selection */ -#if defined(__ASSEMBLER__) #define zero $0 /* always zero */ #define AT $at /* assembler temporary */ #define v0 $2 /* return value */ @@ -106,5 +105,4 @@ #define ta3 $15 #endif /* __mips_n32 || __mips_n64 */ -#endif /* __ASSEMBLER__ */ #endif /* _MIPS_REGDEF_H */ Modified: head/sys/mips/mips/db_interface.c ============================================================================== --- head/sys/mips/mips/db_interface.c Wed May 1 06:55:13 2013 (r250137) +++ head/sys/mips/mips/db_interface.c Wed May 1 06:57:46 2013 (r250138) @@ -55,8 +55,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define NO_REG_DEFS 1 /* Prevent asm.h from including regdef.h */ -#include #include #include Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Wed May 1 06:55:13 2013 (r250137) +++ head/sys/mips/mips/trap.c Wed May 1 06:57:46 2013 (r250138) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ktrace.h" #include "opt_kdtrace.h" -#define NO_REG_DEFS 1 /* Prevent asm.h from including regdef.h */ #include #include #include @@ -85,7 +84,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #ifdef DDB #include @@ -127,6 +125,61 @@ SYSCTL_INT(_machdep, OID_AUTO, trap_debu &trap_debug, 0, "Debug information on all traps"); #endif +#define lbu_macro(data, addr) \ + __asm __volatile ("lbu %0, 0x0(%1)" \ + : "=r" (data) /* outputs */ \ + : "r" (addr)); /* inputs */ + +#define lb_macro(data, addr) \ + __asm __volatile ("lb %0, 0x0(%1)" \ + : "=r" (data) /* outputs */ \ + : "r" (addr)); /* inputs */ + +#define lwl_macro(data, addr) \ + __asm __volatile ("lwl %0, 0x0(%1)" \ + : "=r" (data) /* outputs */ \ + : "r" (addr)); /* inputs */ + +#define lwr_macro(data, addr) \ + __asm __volatile ("lwr %0, 0x0(%1)" \ + : "=r" (data) /* outputs */ \ + : "r" (addr)); /* inputs */ + +#define ldl_macro(data, addr) \ + __asm __volatile ("ldl %0, 0x0(%1)" \ + : "=r" (data) /* outputs */ \ + : "r" (addr)); /* inputs */ + +#define ldr_macro(data, addr) \ + __asm __volatile ("ldr %0, 0x0(%1)" \ + : "=r" (data) /* outputs */ \ + : "r" (addr)); /* inputs */ + +#define sb_macro(data, addr) \ + __asm __volatile ("sb %0, 0x0(%1)" \ + : /* outputs */ \ + : "r" (data), "r" (addr)); /* inputs */ + +#define swl_macro(data, addr) \ + __asm __volatile ("swl %0, 0x0(%1)" \ + : /* outputs */ \ + : "r" (data), "r" (addr)); /* inputs */ + +#define swr_macro(data, addr) \ + __asm __volatile ("swr %0, 0x0(%1)" \ + : /* outputs */ \ + : "r" (data), "r" (addr)); /* inputs */ + +#define sdl_macro(data, addr) \ + __asm __volatile ("sdl %0, 0x0(%1)" \ + : /* outputs */ \ + : "r" (data), "r" (addr)); /* inputs */ + +#define sdr_macro(data, addr) \ + __asm __volatile ("sdr %0, 0x0(%1)" \ + : /* outputs */ \ + : "r" (data), "r" (addr)); /* inputs */ + static void log_illegal_instruction(const char *, struct trapframe *); static void log_bad_page_fault(char *, struct trapframe *, int); static void log_frame_dump(struct trapframe *frame); From owner-svn-src-head@FreeBSD.ORG Wed May 1 07:13:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 110EE596; Wed, 1 May 2013 07:13:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 03C9E1F14; Wed, 1 May 2013 07:13:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r417Dadg020227; Wed, 1 May 2013 07:13:36 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r417DahS020226; Wed, 1 May 2013 07:13:36 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201305010713.r417DahS020226@svn.freebsd.org> From: Warner Losh Date: Wed, 1 May 2013 07:13:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250139 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 07:13:37 -0000 Author: imp Date: Wed May 1 07:13:36 2013 New Revision: 250139 URL: http://svnweb.freebsd.org/changeset/base/250139 Log: Add a historic footnote. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed May 1 06:57:46 2013 (r250138) +++ head/UPDATING Wed May 1 07:13:36 2013 (r250139) @@ -291,7 +291,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 is now spelled mips64. mipsn32eb is now spelled mipsn32. mipseb is now spelled mips. This is to aid compatibility with third-party software that expects this naming scheme in uname(3). Little-endian - settings are unchanged. + settings are unchanged. If you are updating a big-endian mips64 machine + from before this change, you may need to set MACHINE_ARCH=mips64 in + your environment before the new build system will recognize your machine. 20120306: Disable by default the option VFS_ALLOW_NONMPSAFE for all supported From owner-svn-src-head@FreeBSD.ORG Wed May 1 09:56:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 01C90D6A; Wed, 1 May 2013 09:56:09 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E78ED14F0; Wed, 1 May 2013 09:56:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r419u9MO077407; Wed, 1 May 2013 09:56:09 GMT (envelope-from benno@svn.freebsd.org) Received: (from benno@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r419u996077406; Wed, 1 May 2013 09:56:09 GMT (envelope-from benno@svn.freebsd.org) Message-Id: <201305010956.r419u996077406@svn.freebsd.org> From: Benno Rice Date: Wed, 1 May 2013 09:56:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250143 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 09:56:10 -0000 Author: benno Date: Wed May 1 09:56:09 2013 New Revision: 250143 URL: http://svnweb.freebsd.org/changeset/base/250143 Log: Optimize SUBDIR_OVERRIDE such that SUBDIR isn't automatically defined if SUBDIR_OVERRIDE is defined. PR: conf/174071 Submitted by: Garrett Cooper Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed May 1 09:20:13 2013 (r250142) +++ head/Makefile.inc1 Wed May 1 09:56:09 2013 (r250143) @@ -58,6 +58,9 @@ # use that new version. And the new (dynamically-linked) /bin/sh # will expect to find appropriate libraries in /lib and /libexec. # +.if defined(SUBDIR_OVERRIDE) +SUBDIR= ${SUBDIR_OVERRIDE} +.else SUBDIR= share/info lib libexec SUBDIR+=bin .if ${MK_GAMES} != "no" @@ -96,9 +99,6 @@ SUBDIR+=etc SUBDIR+= ${_DIR} .endif .endfor - -.if defined(SUBDIR_OVERRIDE) -SUBDIR= ${SUBDIR_OVERRIDE} .endif .if defined(NOCLEAN) From owner-svn-src-head@FreeBSD.ORG Wed May 1 10:47:07 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B38C23A3; Wed, 1 May 2013 10:47:07 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id 40A3316A6; Wed, 1 May 2013 10:47:06 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.6/8.14.6) with ESMTP id r41Al4dk019148; Wed, 1 May 2013 14:47:04 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.6/8.14.6/Submit) id r41Al4Xx019147; Wed, 1 May 2013 14:47:04 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 1 May 2013 14:47:04 +0400 From: Gleb Smirnoff To: Sergey Kandaurov Subject: Re: svn commit: r250105 - head/sys/dev/hwpmc Message-ID: <20130501104704.GD15182@FreeBSD.org> References: <201304301559.r3UFxM88094038@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Davide Italiano , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 10:47:07 -0000 On Tue, Apr 30, 2013 at 08:10:17PM +0400, Sergey Kandaurov wrote: S> On 30 April 2013 19:59, Davide Italiano wrote: S> > Author: davide S> > Date: Tue Apr 30 15:59:22 2013 S> > New Revision: 250105 S> > URL: http://svnweb.freebsd.org/changeset/base/250105 S> > S> > Log: S> > malloc(9) cannot return NULL if M_WAITOK flag is specified. S> > S> > Modified: S> > head/sys/dev/hwpmc/hwpmc_mod.c S> > head/sys/dev/hwpmc/hwpmc_soft.c S> > S> > Modified: head/sys/dev/hwpmc/hwpmc_mod.c S> > ============================================================================== S> > --- head/sys/dev/hwpmc/hwpmc_mod.c Tue Apr 30 15:38:31 2013 (r250104) S> > +++ head/sys/dev/hwpmc/hwpmc_mod.c Tue Apr 30 15:59:22 2013 (r250105) S> > @@ -2210,11 +2210,8 @@ pmc_allocate_pmc_descriptor(void) S> > struct pmc *pmc; S> > S> > pmc = malloc(sizeof(struct pmc), M_PMC, M_WAITOK|M_ZERO); S> > - S> > - if (pmc != NULL) { S> > - pmc->pm_owner = NULL; S> > - LIST_INIT(&pmc->pm_targets); S> > - } S> > + pmc->pm_owner = NULL; S> > + LIST_INIT(&pmc->pm_targets); S> > S> > PMCDBG(PMC,ALL,1, "allocate-pmc -> pmc=%p", pmc); S> S> It looks like zeroing pm_owner can also be omitted with M_ZERO. LIST_INIT is also an assignment of zero. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Wed May 1 14:59:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 64CA7C8E; Wed, 1 May 2013 14:59:17 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3F42912E9; Wed, 1 May 2013 14:59:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41ExHqW083230; Wed, 1 May 2013 14:59:17 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41ExH9l083229; Wed, 1 May 2013 14:59:17 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305011459.r41ExH9l083229@svn.freebsd.org> From: Mikolaj Golub Date: Wed, 1 May 2013 14:59:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250145 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 14:59:17 -0000 Author: trociny Date: Wed May 1 14:59:16 2013 New Revision: 250145 URL: http://svnweb.freebsd.org/changeset/base/250145 Log: Introduce a constant, ELF_NOTE_ROUNDSIZE, which evidently declare our intention to use 4-byte padding for elf notes. MFC after: 3 weeks Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Wed May 1 11:10:15 2013 (r250144) +++ head/sys/kern/imgact_elf.c Wed May 1 14:59:16 2013 (r250145) @@ -81,6 +81,7 @@ __FBSDID("$FreeBSD$"); #include #include +#define ELF_NOTE_ROUNDSIZE 4 #define OLD_EI_BRAND 8 static int __elfN(check_header)(const Elf_Ehdr *hdr); @@ -161,7 +162,7 @@ __elfN(freebsd_trans_osrel)(const Elf_No uintptr_t p; p = (uintptr_t)(note + 1); - p += roundup2(note->n_namesz, sizeof(Elf32_Addr)); + p += roundup2(note->n_namesz, ELF_NOTE_ROUNDSIZE); *osrel = *(const int32_t *)(p); return (TRUE); @@ -186,7 +187,7 @@ kfreebsd_trans_osrel(const Elf_Note *not uintptr_t p; p = (uintptr_t)(note + 1); - p += roundup2(note->n_namesz, sizeof(Elf32_Addr)); + p += roundup2(note->n_namesz, ELF_NOTE_ROUNDSIZE); desc = (const Elf32_Word *)p; if (desc[0] != GNU_KFREEBSD_ABI_DESC) @@ -1546,7 +1547,7 @@ __elfN(puthdr)(struct thread *td, void * phdr->p_filesz = notesz; phdr->p_memsz = 0; phdr->p_flags = PF_R; - phdr->p_align = sizeof(Elf32_Size); + phdr->p_align = ELF_NOTE_ROUNDSIZE; phdr++; /* All the writable segments from the program. */ @@ -1574,8 +1575,8 @@ register_note(struct note_info_list *lis return (size); notesize = sizeof(Elf_Note) + /* note header */ - roundup2(8, sizeof(Elf32_Size)) + /* note name ("FreeBSD") */ - roundup2(size, sizeof(Elf32_Size)); /* note description */ + roundup2(8, ELF_NOTE_ROUNDSIZE) + /* note name ("FreeBSD") */ + roundup2(size, ELF_NOTE_ROUNDSIZE); /* note description */ return (notesize); } @@ -1598,12 +1599,12 @@ __elfN(putnote)(struct note_info *ninfo, sbuf_bcat(sb, ¬e, sizeof(note)); sbuf_start_section(sb, &old_len); sbuf_bcat(sb, "FreeBSD", note.n_namesz); - sbuf_end_section(sb, old_len, sizeof(Elf32_Size), 0); + sbuf_end_section(sb, old_len, ELF_NOTE_ROUNDSIZE, 0); if (note.n_descsz == 0) return; sbuf_start_section(sb, &old_len); ninfo->outfunc(ninfo->outarg, sb, &ninfo->outsize); - sbuf_end_section(sb, old_len, sizeof(Elf32_Size), 0); + sbuf_end_section(sb, old_len, ELF_NOTE_ROUNDSIZE, 0); } /* @@ -2004,8 +2005,8 @@ __elfN(parse_notes)(struct image_params nextnote: note = (const Elf_Note *)((const char *)(note + 1) + - roundup2(note->n_namesz, sizeof(Elf32_Addr)) + - roundup2(note->n_descsz, sizeof(Elf32_Addr))); + roundup2(note->n_namesz, ELF_NOTE_ROUNDSIZE) + + roundup2(note->n_descsz, ELF_NOTE_ROUNDSIZE)); } return (FALSE); From owner-svn-src-head@FreeBSD.ORG Wed May 1 15:01:06 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7E594E27; Wed, 1 May 2013 15:01:06 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7058F1302; Wed, 1 May 2013 15:01:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41F16uD085353; Wed, 1 May 2013 15:01:06 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41F16n4085352; Wed, 1 May 2013 15:01:06 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305011501.r41F16n4085352@svn.freebsd.org> From: Mikolaj Golub Date: Wed, 1 May 2013 15:01:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250146 - head/lib/libprocstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 15:01:06 -0000 Author: trociny Date: Wed May 1 15:01:05 2013 New Revision: 250146 URL: http://svnweb.freebsd.org/changeset/base/250146 Log: KVM method support for procstat_getgroups, procstat_getumask, procstat_getrlimit, and procstat_getosrel. MFC after: 3 weeks Modified: head/lib/libprocstat/libprocstat.c Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Wed May 1 14:59:16 2013 (r250145) +++ head/lib/libprocstat/libprocstat.c Wed May 1 15:01:05 2013 (r250146) @@ -39,6 +39,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#define _WANT_UCRED +#include +#undef _WANT_UCRED #include #include #include @@ -141,19 +144,30 @@ static int procstat_get_vnode_info_sysct struct vnstat *vn, char *errbuf); static gid_t *procstat_getgroups_core(struct procstat_core *core, unsigned int *count); +static gid_t * procstat_getgroups_kvm(kvm_t *kd, struct kinfo_proc *kp, + unsigned int *count); static gid_t *procstat_getgroups_sysctl(pid_t pid, unsigned int *count); static struct kinfo_kstack *procstat_getkstack_sysctl(pid_t pid, int *cntp); +static int procstat_getosrel_core(struct procstat_core *core, + int *osrelp); +static int procstat_getosrel_kvm(kvm_t *kd, struct kinfo_proc *kp, + int *osrelp); +static int procstat_getosrel_sysctl(pid_t pid, int *osrelp); static int procstat_getpathname_core(struct procstat_core *core, char *pathname, size_t maxlen); static int procstat_getpathname_sysctl(pid_t pid, char *pathname, size_t maxlen); static int procstat_getrlimit_core(struct procstat_core *core, int which, struct rlimit* rlimit); +static int procstat_getrlimit_kvm(kvm_t *kd, struct kinfo_proc *kp, + int which, struct rlimit* rlimit); static int procstat_getrlimit_sysctl(pid_t pid, int which, struct rlimit* rlimit); static int procstat_getumask_core(struct procstat_core *core, unsigned short *maskp); +static int procstat_getumask_kvm(kvm_t *kd, struct kinfo_proc *kp, + unsigned short *maskp); static int procstat_getumask_sysctl(pid_t pid, unsigned short *maskp); static int vntype2psfsttype(int type); @@ -1790,6 +1804,46 @@ procstat_freevmmap(struct procstat *proc } static gid_t * +procstat_getgroups_kvm(kvm_t *kd, struct kinfo_proc *kp, unsigned int *cntp) +{ + struct proc proc; + struct ucred ucred; + gid_t *groups; + size_t len; + + assert(kd != NULL); + assert(kp != NULL); + if (!kvm_read_all(kd, (unsigned long)kp->ki_paddr, &proc, + sizeof(proc))) { + warnx("can't read proc struct at %p for pid %d", + kp->ki_paddr, kp->ki_pid); + return (NULL); + } + if (proc.p_ucred == NOCRED) + return (NULL); + if (!kvm_read_all(kd, (unsigned long)proc.p_ucred, &ucred, + sizeof(ucred))) { + warnx("can't read ucred struct at %p for pid %d", + proc.p_ucred, kp->ki_pid); + return (NULL); + } + len = ucred.cr_ngroups * sizeof(gid_t); + groups = malloc(len); + if (groups == NULL) { + warn("malloc(%zu)", len); + return (NULL); + } + if (!kvm_read_all(kd, (unsigned long)ucred.cr_groups, groups, len)) { + warnx("can't read groups at %p for pid %d", + ucred.cr_groups, kp->ki_pid); + free(groups); + return (NULL); + } + *cntp = ucred.cr_ngroups; + return (groups); +} + +static gid_t * procstat_getgroups_sysctl(pid_t pid, unsigned int *cntp) { int mib[4]; @@ -1834,8 +1888,7 @@ procstat_getgroups(struct procstat *proc { switch(procstat->type) { case PROCSTAT_KVM: - warnx("kvm method is not supported"); - return (NULL); + return (procstat_getgroups_kvm(procstat->kd, kp, cntp)); case PROCSTAT_SYSCTL: return (procstat_getgroups_sysctl(kp->ki_pid, cntp)); case PROCSTAT_CORE: @@ -1854,6 +1907,24 @@ procstat_freegroups(struct procstat *pro } static int +procstat_getumask_kvm(kvm_t *kd, struct kinfo_proc *kp, unsigned short *maskp) +{ + struct filedesc fd; + + assert(kd != NULL); + assert(kp != NULL); + if (kp->ki_fd == NULL) + return (-1); + if (!kvm_read_all(kd, (unsigned long)kp->ki_fd, &fd, sizeof(fd))) { + warnx("can't read filedesc at %p for pid %d", kp->ki_fd, + kp->ki_pid); + return (-1); + } + *maskp = fd.fd_cmask; + return (0); +} + +static int procstat_getumask_sysctl(pid_t pid, unsigned short *maskp) { int error; @@ -1895,8 +1966,7 @@ procstat_getumask(struct procstat *procs { switch(procstat->type) { case PROCSTAT_KVM: - warnx("kvm method is not supported"); - return (-1); + return (procstat_getumask_kvm(procstat->kd, kp, maskp)); case PROCSTAT_SYSCTL: return (procstat_getumask_sysctl(kp->ki_pid, maskp)); case PROCSTAT_CORE: @@ -1908,6 +1978,33 @@ procstat_getumask(struct procstat *procs } static int +procstat_getrlimit_kvm(kvm_t *kd, struct kinfo_proc *kp, int which, + struct rlimit* rlimit) +{ + struct proc proc; + unsigned long offset; + + assert(kd != NULL); + assert(kp != NULL); + assert(which >= 0 && which < RLIM_NLIMITS); + if (!kvm_read_all(kd, (unsigned long)kp->ki_paddr, &proc, + sizeof(proc))) { + warnx("can't read proc struct at %p for pid %d", + kp->ki_paddr, kp->ki_pid); + return (-1); + } + if (proc.p_limit == NULL) + return (-1); + offset = (unsigned long)proc.p_limit + sizeof(struct rlimit) * which; + if (!kvm_read_all(kd, offset, rlimit, sizeof(*rlimit))) { + warnx("can't read rlimit struct at %p for pid %d", + (void *)offset, kp->ki_pid); + return (-1); + } + return (0); +} + +static int procstat_getrlimit_sysctl(pid_t pid, int which, struct rlimit* rlimit) { int error, name[5]; @@ -1958,8 +2055,8 @@ procstat_getrlimit(struct procstat *proc { switch(procstat->type) { case PROCSTAT_KVM: - warnx("kvm method is not supported"); - return (-1); + return (procstat_getrlimit_kvm(procstat->kd, kp, which, + rlimit)); case PROCSTAT_SYSCTL: return (procstat_getrlimit_sysctl(kp->ki_pid, which, rlimit)); case PROCSTAT_CORE: @@ -2032,6 +2129,23 @@ procstat_getpathname(struct procstat *pr } static int +procstat_getosrel_kvm(kvm_t *kd, struct kinfo_proc *kp, int *osrelp) +{ + struct proc proc; + + assert(kd != NULL); + assert(kp != NULL); + if (!kvm_read_all(kd, (unsigned long)kp->ki_paddr, &proc, + sizeof(proc))) { + warnx("can't read proc struct at %p for pid %d", + kp->ki_paddr, kp->ki_pid); + return (-1); + } + *osrelp = proc.p_osrel; + return (0); +} + +static int procstat_getosrel_sysctl(pid_t pid, int *osrelp) { int error, name[4]; @@ -2071,8 +2185,7 @@ procstat_getosrel(struct procstat *procs { switch(procstat->type) { case PROCSTAT_KVM: - warnx("kvm method is not supported"); - return (-1); + return (procstat_getosrel_kvm(procstat->kd, kp, osrelp)); case PROCSTAT_SYSCTL: return (procstat_getosrel_sysctl(kp->ki_pid, osrelp)); case PROCSTAT_CORE: From owner-svn-src-head@FreeBSD.ORG Wed May 1 15:02:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5C148FBF; Wed, 1 May 2013 15:02:59 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4D69E1313; Wed, 1 May 2013 15:02:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41F2x8Q085761; Wed, 1 May 2013 15:02:59 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41F2xJI085759; Wed, 1 May 2013 15:02:59 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305011502.r41F2xJI085759@svn.freebsd.org> From: Mikolaj Golub Date: Wed, 1 May 2013 15:02:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250147 - head/lib/libprocstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 15:02:59 -0000 Author: trociny Date: Wed May 1 15:02:58 2013 New Revision: 250147 URL: http://svnweb.freebsd.org/changeset/base/250147 Log: procstat_getpathname: for kvm method, instead of returning the error that the method is not supported, return an empty string. This looks more handy for callers like procstat(1), which will not abort after the failed call and still output some useful information. MFC after: 3 weeks Modified: head/lib/libprocstat/libprocstat.c Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Wed May 1 15:01:05 2013 (r250146) +++ head/lib/libprocstat/libprocstat.c Wed May 1 15:02:58 2013 (r250147) @@ -2114,8 +2114,10 @@ procstat_getpathname(struct procstat *pr { switch(procstat->type) { case PROCSTAT_KVM: - warnx("kvm method is not supported"); - return (-1); + /* XXX: Return empty string. */ + if (maxlen > 0) + pathname[0] = '\0'; + return (0); case PROCSTAT_SYSCTL: return (procstat_getpathname_sysctl(kp->ki_pid, pathname, maxlen)); From owner-svn-src-head@FreeBSD.ORG Wed May 1 17:29:43 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 243F1166; Wed, 1 May 2013 17:29:43 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 15D9E1B78; Wed, 1 May 2013 17:29:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41HTgXD036367; Wed, 1 May 2013 17:29:42 GMT (envelope-from zeising@svn.freebsd.org) Received: (from zeising@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41HTgY2036366; Wed, 1 May 2013 17:29:42 GMT (envelope-from zeising@svn.freebsd.org) Message-Id: <201305011729.r41HTgY2036366@svn.freebsd.org> From: Niclas Zeising Date: Wed, 1 May 2013 17:29:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250148 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 17:29:43 -0000 Author: zeising (doc,ports committer) Date: Wed May 1 17:29:42 2013 New Revision: 250148 URL: http://svnweb.freebsd.org/changeset/base/250148 Log: Add OpenBSD 5.3, released today, May 1 2013. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Wed May 1 15:02:58 2013 (r250147) +++ head/share/misc/bsd-family-tree Wed May 1 17:29:42 2013 (r250148) @@ -261,6 +261,10 @@ FreeBSD 5.2 | | | FreeBSD | | | | | 9.1 | | | | | | | | | + | | | OpenBSD 5.3 | + | | | | | + | | | | | + | | | | | FreeBSD 10 -current | NetBSD -current OpenBSD -current | | | | | | v v v v v @@ -558,6 +562,7 @@ NetBSD 6.0 2012-10-17 [NBD] OpenBSD 5.2 2012-11-01 [OBD] DragonFly 3.2.1 2012-11-02 [DFB] FreeBSD 9.1 2012-12-30 [FBD] +OpenBSD 5.3 2013-05-01 [OBD] Bibliography ------------------------ From owner-svn-src-head@FreeBSD.ORG Wed May 1 17:34:44 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CDB9B33C; Wed, 1 May 2013 17:34:44 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BFBDD1BB1; Wed, 1 May 2013 17:34:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41HYiEf038947; Wed, 1 May 2013 17:34:44 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41HYi7u038946; Wed, 1 May 2013 17:34:44 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201305011734.r41HYi7u038946@svn.freebsd.org> From: Davide Italiano Date: Wed, 1 May 2013 17:34:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250149 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 17:34:44 -0000 Author: davide Date: Wed May 1 17:34:44 2013 New Revision: 250149 URL: http://svnweb.freebsd.org/changeset/base/250149 Log: In case ZFS doesn't use UMA for buffers there's no need to waste memory creating zones that will remain empty. Reviewed by: pjd 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 Wed May 1 17:29:42 2013 (r250148) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Wed May 1 17:34:44 2013 (r250149) @@ -154,6 +154,8 @@ zio_init(void) sizeof (zio_t), 0, NULL, NULL, NULL, NULL, NULL, 0); zio_link_cache = kmem_cache_create("zio_link_cache", sizeof (zio_link_t), 0, NULL, NULL, NULL, NULL, NULL, 0); + if (!zio_use_uma) + goto out; /* * For small buffers, we want a cache for each multiple of @@ -217,6 +219,7 @@ zio_init(void) if (zio_data_buf_cache[c - 1] == NULL) zio_data_buf_cache[c - 1] = zio_data_buf_cache[c]; } +out: /* * The zio write taskqs have 1 thread per cpu, allow 1/2 of the taskqs From owner-svn-src-head@FreeBSD.ORG Wed May 1 17:59:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E5C207AF; Wed, 1 May 2013 17:59:41 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D748A1CB0; Wed, 1 May 2013 17:59:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41Hxfg8046485; Wed, 1 May 2013 17:59:41 GMT (envelope-from zeising@svn.freebsd.org) Received: (from zeising@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41HxfCm046484; Wed, 1 May 2013 17:59:41 GMT (envelope-from zeising@svn.freebsd.org) Message-Id: <201305011759.r41HxfCm046484@svn.freebsd.org> From: Niclas Zeising Date: Wed, 1 May 2013 17:59:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250150 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 17:59:42 -0000 Author: zeising (doc,ports committer) Date: Wed May 1 17:59:41 2013 New Revision: 250150 URL: http://svnweb.freebsd.org/changeset/base/250150 Log: Add DragonFly BSD 3.4.1, released April 29 2013. Submitted by: Nikolai Lifanov Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Wed May 1 17:34:44 2013 (r250149) +++ head/share/misc/bsd-family-tree Wed May 1 17:59:41 2013 (r250150) @@ -261,7 +261,7 @@ FreeBSD 5.2 | | | FreeBSD | | | | | 9.1 | | | | | | | | | - | | | OpenBSD 5.3 | + | | | OpenBSD 5.3 DragonFly 3.4.1 | | | | | | | | | | | | | | | @@ -562,6 +562,7 @@ NetBSD 6.0 2012-10-17 [NBD] OpenBSD 5.2 2012-11-01 [OBD] DragonFly 3.2.1 2012-11-02 [DFB] FreeBSD 9.1 2012-12-30 [FBD] +DragonFly 3.4.1 2013-04-29 [DFB] OpenBSD 5.3 2013-05-01 [OBD] Bibliography From owner-svn-src-head@FreeBSD.ORG Wed May 1 20:03:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E04E665C; Wed, 1 May 2013 20:03:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D328D114D; Wed, 1 May 2013 20:03:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41K3oXk091722; Wed, 1 May 2013 20:03:50 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41K3oig091721; Wed, 1 May 2013 20:03:50 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305012003.r41K3oig091721@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 1 May 2013 20:03:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250152 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 20:03:51 -0000 Author: kib Date: Wed May 1 20:03:50 2013 New Revision: 250152 URL: http://svnweb.freebsd.org/changeset/base/250152 Log: The check to ensure that xstate_bv always has XFEATURE_ENABLED_X87 and XFEATURE_ENABLED_SSE bits set is not needed. CPU correctly handles any bitmask which is subset of the enabled bits in %XCR0. More, CPU instructions XSAVE and XSAVEOPT could write the mask without e.g. XFEATURE_ENABLED_SSE, after the VZEROALL. The check prevents the restoration of the otherwise valid FPU save area. In collaboration with: jhb MFC after: 1 week Modified: head/sys/amd64/amd64/fpu.c Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Wed May 1 18:06:53 2013 (r250151) +++ head/sys/amd64/amd64/fpu.c Wed May 1 20:03:50 2013 (r250152) @@ -743,9 +743,6 @@ fpusetxstate(struct thread *td, char *xf */ if (bv & ~xsave_mask) return (EINVAL); - if ((bv & (XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE)) != - (XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE)) - return (EINVAL); hdr = (struct xstate_hdr *)(get_pcb_user_save_td(td) + 1); From owner-svn-src-head@FreeBSD.ORG Wed May 1 20:08:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 03BE9831; Wed, 1 May 2013 20:08:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DA702117B; Wed, 1 May 2013 20:08:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41K8XIA092734; Wed, 1 May 2013 20:08:33 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41K8X6x092733; Wed, 1 May 2013 20:08:33 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305012008.r41K8X6x092733@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 1 May 2013 20:08:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250153 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 20:08:34 -0000 Author: kib Date: Wed May 1 20:08:33 2013 New Revision: 250153 URL: http://svnweb.freebsd.org/changeset/base/250153 Log: Partially saved extended state must be handled always, i.e. for both fpu-owned context, and for pcb-saved one. More, the XSAVE could do partial save, same as XSAVEOPT, so qualifier for the handler should be use_xsave and not use_xsaveopt. Since xsave_area_desc is now needed regardless of the XSAVEOPT use, remove the write-only use_xsaveopt variable. In collaboration with: jhb MFC after: 1 week Modified: head/sys/amd64/amd64/fpu.c Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Wed May 1 20:03:50 2013 (r250152) +++ head/sys/amd64/amd64/fpu.c Wed May 1 20:08:33 2013 (r250153) @@ -132,7 +132,6 @@ static void fpu_clean_state(void); SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD, NULL, 1, "Floating point instructions executed in hardware"); -static int use_xsaveopt; int use_xsave; /* non-static for cpu_switch.S */ uint64_t xsave_mask; /* the same */ static uma_zone_t fpu_save_area_zone; @@ -198,7 +197,6 @@ fpuinit_bsp1(void) * REX byte, and set the bit 4 of the r/m byte. */ ctx_switch_xsave[3] |= 0x10; - use_xsaveopt = 1; } } @@ -296,7 +294,7 @@ fpuinitstate(void *arg __unused) * Create a table describing the layout of the CPU Extended * Save Area. */ - if (use_xsaveopt) { + if (use_xsave) { max_ext_n = flsl(xsave_mask); xsave_area_desc = malloc(max_ext_n * sizeof(struct xsave_area_elm_descr), M_DEVBUF, M_WAITOK | M_ZERO); @@ -661,7 +659,7 @@ fpugetregs(struct thread *td) struct pcb *pcb; uint64_t *xstate_bv, bit; char *sa; - int max_ext_n, i; + int max_ext_n, i, owned; pcb = td->td_pcb; if ((pcb->pcb_flags & PCB_USERFPUINITDONE) == 0) { @@ -675,31 +673,31 @@ fpugetregs(struct thread *td) critical_enter(); if (td == PCPU_GET(fpcurthread) && PCB_USER_FPU(pcb)) { fpusave(get_pcb_user_save_pcb(pcb)); - critical_exit(); - return (_MC_FPOWNED_FPU); + owned = _MC_FPOWNED_FPU; } else { - critical_exit(); - if (use_xsaveopt) { - /* - * Handle partially saved state. - */ - sa = (char *)get_pcb_user_save_pcb(pcb); - xstate_bv = (uint64_t *)(sa + sizeof(struct savefpu) + - offsetof(struct xstate_hdr, xstate_bv)); - max_ext_n = flsl(xsave_mask); - for (i = 0; i < max_ext_n; i++) { - bit = 1 << i; - if ((*xstate_bv & bit) != 0) - continue; - bcopy((char *)fpu_initialstate + - xsave_area_desc[i].offset, - sa + xsave_area_desc[i].offset, - xsave_area_desc[i].size); - *xstate_bv |= bit; - } + owned = _MC_FPOWNED_PCB; + } + critical_exit(); + if (use_xsave) { + /* + * Handle partially saved state. + */ + sa = (char *)get_pcb_user_save_pcb(pcb); + xstate_bv = (uint64_t *)(sa + sizeof(struct savefpu) + + offsetof(struct xstate_hdr, xstate_bv)); + max_ext_n = flsl(xsave_mask); + for (i = 0; i < max_ext_n; i++) { + bit = 1 << i; + if ((*xstate_bv & bit) != 0) + continue; + bcopy((char *)fpu_initialstate + + xsave_area_desc[i].offset, + sa + xsave_area_desc[i].offset, + xsave_area_desc[i].size); + *xstate_bv |= bit; } - return (_MC_FPOWNED_PCB); } + return (owned); } void From owner-svn-src-head@FreeBSD.ORG Wed May 1 20:10:23 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B9D50A5A; Wed, 1 May 2013 20:10:23 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9C4D6118F; Wed, 1 May 2013 20:10:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41KANHW093363; Wed, 1 May 2013 20:10:23 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41KALJt093344; Wed, 1 May 2013 20:10:21 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305012010.r41KALJt093344@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 1 May 2013 20:10:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250154 - in head: lib/libc/sys lib/libthr lib/libthr/thread sys/compat/freebsd32 sys/kern sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 20:10:23 -0000 Author: jilles Date: Wed May 1 20:10:21 2013 New Revision: 250154 URL: http://svnweb.freebsd.org/changeset/base/250154 Log: Add accept4() system call. The accept4() function, compared to accept(), allows setting the new file descriptor atomically close-on-exec and explicitly controlling the non-blocking status on the new socket. (Note that the latter point means that accept() is not equivalent to any form of accept4().) The linuxulator's accept4 implementation leaves a race window where the new file descriptor is not close-on-exec because it calls sys_accept(). This implementation leaves no such race window (by using falloc() flags). The linuxulator could be fixed and simplified by using the new code. Like accept(), accept4() is async-signal-safe, a cancellation point and permitted in capability mode. Modified: head/lib/libc/sys/Makefile.inc head/lib/libc/sys/Symbol.map head/lib/libc/sys/accept.2 head/lib/libthr/pthread.map head/lib/libthr/thread/thr_syscalls.c head/sys/compat/freebsd32/syscalls.master head/sys/kern/capabilities.conf head/sys/kern/syscalls.master head/sys/kern/uipc_syscalls.c head/sys/sys/socket.h head/sys/sys/syscallsubr.h Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Wed May 1 20:08:33 2013 (r250153) +++ head/lib/libc/sys/Makefile.inc Wed May 1 20:10:21 2013 (r250154) @@ -270,6 +270,7 @@ MAN+= sctp_generic_recvmsg.2 \ wait.2 \ write.2 +MLINKS+=accept.2 accept4.2 MLINKS+=access.2 eaccess.2 \ access.2 faccessat.2 MLINKS+=brk.2 sbrk.2 Modified: head/lib/libc/sys/Symbol.map ============================================================================== --- head/lib/libc/sys/Symbol.map Wed May 1 20:08:33 2013 (r250153) +++ head/lib/libc/sys/Symbol.map Wed May 1 20:10:21 2013 (r250154) @@ -378,6 +378,7 @@ FBSD_1.2 { }; FBSD_1.3 { + accept4; bindat; cap_fcntls_get; cap_fcntls_limit; @@ -461,6 +462,8 @@ FBSDprivate_1.0 { __sys_abort2; _accept; __sys_accept; + _accept4; + __sys_accept4; _access; __sys_access; _acct; Modified: head/lib/libc/sys/accept.2 ============================================================================== --- head/lib/libc/sys/accept.2 Wed May 1 20:08:33 2013 (r250153) +++ head/lib/libc/sys/accept.2 Wed May 1 20:10:21 2013 (r250154) @@ -41,6 +41,8 @@ .In sys/socket.h .Ft int .Fn accept "int s" "struct sockaddr * restrict addr" "socklen_t * restrict addrlen" +.Ft int +.Fn accept4 "int s" "struct sockaddr * restrict addr" "socklen_t * restrict addrlen" "int flags" .Sh DESCRIPTION The argument .Fa s @@ -66,6 +68,26 @@ and signals from the original socket .Fa s . .Pp +The +.Fn accept4 +system call is similar, +but the +.Dv O_NONBLOCK +property of the new socket is instead determined by the +.Dv SOCK_NONBLOCK +flag in the +.Fa flags +argument, +the +.Dv O_ASYNC +property is cleared, +the signal destination is cleared +and the close-on-exec flag on the new file descriptor can be set via the +.Dv SOCK_CLOEXEC +flag in the +.Fa flags +argument. +.Pp If no pending connections are present on the queue, and the original socket is not marked as non-blocking, @@ -141,13 +163,15 @@ properties and the signal destination be but should set them explicitly using .Xr fcntl 2 . .Sh RETURN VALUES -The call returns \-1 on error. -If it succeeds, it returns a non-negative +These calls return \-1 on error. +If they succeed, they return a non-negative integer that is a descriptor for the accepted socket. .Sh ERRORS The .Fn accept -system call will fail if: +and +.Fn accept4 +system calls will fail if: .Bl -tag -width Er .It Bq Er EBADF The descriptor is invalid. @@ -176,6 +200,16 @@ are present to be accepted. A connection arrived, but it was closed while waiting on the listen queue. .El +.Pp +The +.Fn accept4 +system call will also fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +The +.Fa flags +argument is invalid. +.El .Sh SEE ALSO .Xr bind 2 , .Xr connect 2 , @@ -190,3 +224,8 @@ The .Fn accept system call appeared in .Bx 4.2 . +.Pp +The +.Fn accept4 +system call appeared in +.Fx 10.0 . Modified: head/lib/libthr/pthread.map ============================================================================== --- head/lib/libthr/pthread.map Wed May 1 20:08:33 2013 (r250153) +++ head/lib/libthr/pthread.map Wed May 1 20:10:21 2013 (r250154) @@ -181,6 +181,7 @@ FBSDprivate_1.0 { ___wait; ___waitpid; __accept; + __accept4; __aio_suspend; __close; __connect; @@ -408,3 +409,7 @@ FBSD_1.2 { setcontext; swapcontext; }; + +FBSD_1.3 { + accept4; +}; Modified: head/lib/libthr/thread/thr_syscalls.c ============================================================================== --- head/lib/libthr/thread/thr_syscalls.c Wed May 1 20:08:33 2013 (r250153) +++ head/lib/libthr/thread/thr_syscalls.c Wed May 1 20:10:21 2013 (r250154) @@ -101,6 +101,7 @@ extern pid_t __waitpid(pid_t, int *, int extern int __sys_aio_suspend(const struct aiocb * const[], int, const struct timespec *); extern int __sys_accept(int, struct sockaddr *, socklen_t *); +extern int __sys_accept4(int, struct sockaddr *, socklen_t *, int); extern int __sys_connect(int, const struct sockaddr *, socklen_t); extern int __sys_fsync(int); extern int __sys_msync(void *, size_t, int); @@ -129,6 +130,7 @@ int ___usleep(useconds_t useconds); pid_t ___wait(int *); pid_t ___waitpid(pid_t, int *, int); int __accept(int, struct sockaddr *, socklen_t *); +int __accept4(int, struct sockaddr *, socklen_t *, int); int __aio_suspend(const struct aiocb * const iocbs[], int, const struct timespec *); int __close(int); @@ -176,6 +178,26 @@ __accept(int s, struct sockaddr *addr, s return (ret); } +__weak_reference(__accept4, accept4); + +/* + * Cancellation behavior: + * If thread is canceled, no socket is created. + */ +int +__accept4(int s, struct sockaddr *addr, socklen_t *addrlen, int flags) +{ + struct pthread *curthread; + int ret; + + curthread = _get_curthread(); + _thr_cancel_enter(curthread); + ret = __sys_accept4(s, addr, addrlen, flags); + _thr_cancel_leave(curthread, ret == -1); + + return (ret); +} + __weak_reference(__aio_suspend, aio_suspend); int Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Wed May 1 20:08:33 2013 (r250153) +++ head/sys/compat/freebsd32/syscalls.master Wed May 1 20:10:21 2013 (r250154) @@ -1022,3 +1022,7 @@ int namelen); } 540 AUE_CHFLAGSAT NOPROTO { int chflagsat(int fd, const char *path, \ u_long flags, int atflag); } +541 AUE_ACCEPT NOPROTO { int accept4(int s, \ + struct sockaddr * __restrict name, \ + __socklen_t * __restrict anamelen, \ + int flags); } Modified: head/sys/kern/capabilities.conf ============================================================================== --- head/sys/kern/capabilities.conf Wed May 1 20:08:33 2013 (r250153) +++ head/sys/kern/capabilities.conf Wed May 1 20:10:21 2013 (r250154) @@ -78,6 +78,7 @@ abort2 ## relies on existing bindings on a socket, subject to capability rights. ## accept +accept4 ## ## Allow AIO operations by file descriptor, subject to capability rights. Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Wed May 1 20:08:33 2013 (r250153) +++ head/sys/kern/syscalls.master Wed May 1 20:10:21 2013 (r250154) @@ -972,5 +972,9 @@ int namelen); } 540 AUE_CHFLAGSAT STD { int chflagsat(int fd, const char *path, \ u_long flags, int atflag); } +541 AUE_ACCEPT STD { int accept4(int s, \ + struct sockaddr * __restrict name, \ + __socklen_t * __restrict anamelen, \ + int flags); } ; Please copy any additions and changes to the following compatability tables: ; sys/compat/freebsd32/syscalls.master Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Wed May 1 20:08:33 2013 (r250153) +++ head/sys/kern/uipc_syscalls.c Wed May 1 20:10:21 2013 (r250154) @@ -97,10 +97,18 @@ __FBSDID("$FreeBSD$"); #endif /* SCTP */ #endif /* INET || INET6 */ +/* + * Flags for accept1() and kern_accept4(), in addition to SOCK_CLOEXEC + * and SOCK_NONBLOCK. + */ +#define ACCEPT4_INHERIT 0x1 +#define ACCEPT4_COMPAT 0x2 + static int sendit(struct thread *td, int s, struct msghdr *mp, int flags); static int recvit(struct thread *td, int s, struct msghdr *mp, void *namelenp); -static int accept1(struct thread *td, struct accept_args *uap, int compat); +static int accept1(struct thread *td, int s, struct sockaddr *uname, + socklen_t *anamelen, int flags); static int do_sendfile(struct thread *td, struct sendfile_args *uap, int compat); static int getsockname1(struct thread *td, struct getsockname_args *uap, int compat); @@ -317,49 +325,46 @@ sys_listen(td, uap) * accept1() */ static int -accept1(td, uap, compat) +accept1(td, s, uname, anamelen, flags) struct thread *td; - struct accept_args /* { - int s; - struct sockaddr * __restrict name; - socklen_t * __restrict anamelen; - } */ *uap; - int compat; + int s; + struct sockaddr *uname; + socklen_t *anamelen; + int flags; { struct sockaddr *name; socklen_t namelen; struct file *fp; int error; - if (uap->name == NULL) - return (kern_accept(td, uap->s, NULL, NULL, NULL)); + if (uname == NULL) + return (kern_accept4(td, s, NULL, NULL, flags, NULL)); - error = copyin(uap->anamelen, &namelen, sizeof (namelen)); + error = copyin(anamelen, &namelen, sizeof (namelen)); if (error) return (error); - error = kern_accept(td, uap->s, &name, &namelen, &fp); + error = kern_accept4(td, s, &name, &namelen, flags, &fp); /* * return a namelen of zero for older code which might * ignore the return value from accept. */ if (error) { - (void) copyout(&namelen, - uap->anamelen, sizeof(*uap->anamelen)); + (void) copyout(&namelen, anamelen, sizeof(*anamelen)); return (error); } - if (error == 0 && name != NULL) { + if (error == 0 && uname != NULL) { #ifdef COMPAT_OLDSOCK - if (compat) + if (flags & ACCEPT4_COMPAT) ((struct osockaddr *)name)->sa_family = name->sa_family; #endif - error = copyout(name, uap->name, namelen); + error = copyout(name, uname, namelen); } if (error == 0) - error = copyout(&namelen, uap->anamelen, + error = copyout(&namelen, anamelen, sizeof(namelen)); if (error) fdclose(td->td_proc->p_fd, fp, td->td_retval[0], td); @@ -372,6 +377,13 @@ int kern_accept(struct thread *td, int s, struct sockaddr **name, socklen_t *namelen, struct file **fp) { + return (kern_accept4(td, s, name, namelen, ACCEPT4_INHERIT, fp)); +} + +int +kern_accept4(struct thread *td, int s, struct sockaddr **name, + socklen_t *namelen, int flags, struct file **fp) +{ struct filedesc *fdp; struct file *headfp, *nfp = NULL; struct sockaddr *sa = NULL; @@ -400,7 +412,7 @@ kern_accept(struct thread *td, int s, st if (error != 0) goto done; #endif - error = falloc(td, &nfp, &fd, 0); + error = falloc(td, &nfp, &fd, (flags & SOCK_CLOEXEC) ? O_CLOEXEC : 0); if (error) goto done; ACCEPT_LOCK(); @@ -441,7 +453,10 @@ kern_accept(struct thread *td, int s, st TAILQ_REMOVE(&head->so_comp, so, so_list); head->so_qlen--; - so->so_state |= (head->so_state & SS_NBIO); + if (flags & ACCEPT4_INHERIT) + so->so_state |= (head->so_state & SS_NBIO); + else + so->so_state |= (flags & SOCK_NONBLOCK) ? SS_NBIO : 0; so->so_qstate &= ~SQ_COMP; so->so_head = NULL; @@ -454,9 +469,15 @@ kern_accept(struct thread *td, int s, st /* connection has been removed from the listen queue */ KNOTE_UNLOCKED(&head->so_rcv.sb_sel.si_note, 0); - pgid = fgetown(&head->so_sigio); - if (pgid != 0) - fsetown(pgid, &so->so_sigio); + if (flags & ACCEPT4_INHERIT) { + pgid = fgetown(&head->so_sigio); + if (pgid != 0) + fsetown(pgid, &so->so_sigio); + } else { + fflag &= ~(FNONBLOCK | FASYNC); + if (flags & SOCK_NONBLOCK) + fflag |= FNONBLOCK; + } finit(nfp, fflag, DTYPE_SOCKET, so, &socketops); /* Sync socket nonblocking/async state with file flags */ @@ -527,7 +548,18 @@ sys_accept(td, uap) struct accept_args *uap; { - return (accept1(td, uap, 0)); + return (accept1(td, uap->s, uap->name, uap->anamelen, ACCEPT4_INHERIT)); +} + +int +sys_accept4(td, uap) + struct thread *td; + struct accept4_args *uap; +{ + if (uap->flags & ~(SOCK_CLOEXEC | SOCK_NONBLOCK)) + return (EINVAL); + + return (accept1(td, uap->s, uap->name, uap->anamelen, uap->flags)); } #ifdef COMPAT_OLDSOCK @@ -537,7 +569,8 @@ oaccept(td, uap) struct accept_args *uap; { - return (accept1(td, uap, 1)); + return (accept1(td, uap->s, uap->name, uap->anamelen, + ACCEPT4_INHERIT | ACCEPT4_COMPAT)); } #endif /* COMPAT_OLDSOCK */ Modified: head/sys/sys/socket.h ============================================================================== --- head/sys/sys/socket.h Wed May 1 20:08:33 2013 (r250153) +++ head/sys/sys/socket.h Wed May 1 20:10:21 2013 (r250154) @@ -634,6 +634,7 @@ int accept(int, struct sockaddr * __rest int bind(int, const struct sockaddr *, socklen_t); int connect(int, const struct sockaddr *, socklen_t); #if __BSD_VISIBLE +int accept4(int, struct sockaddr * __restrict, socklen_t * __restrict, int); int bindat(int, int, const struct sockaddr *, socklen_t); int connectat(int, int, const struct sockaddr *, socklen_t); #endif Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Wed May 1 20:08:33 2013 (r250153) +++ head/sys/sys/syscallsubr.h Wed May 1 20:10:21 2013 (r250154) @@ -60,6 +60,8 @@ int kern___getcwd(struct thread *td, u_c u_int buflen); int kern_accept(struct thread *td, int s, struct sockaddr **name, socklen_t *namelen, struct file **fp); +int kern_accept4(struct thread *td, int s, struct sockaddr **name, + socklen_t *namelen, int flags, struct file **fp); int kern_access(struct thread *td, char *path, enum uio_seg pathseg, int flags); int kern_accessat(struct thread *td, int fd, char *path, From owner-svn-src-head@FreeBSD.ORG Wed May 1 20:13:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EDBE7D6C; Wed, 1 May 2013 20:13:00 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D018011BB; Wed, 1 May 2013 20:13:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41KD05E095495; Wed, 1 May 2013 20:13:00 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41KCwuq095473; Wed, 1 May 2013 20:12:58 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305012012.r41KCwuq095473@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 1 May 2013 20:12:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250155 - in head/sys: compat/freebsd32 kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 20:13:01 -0000 Author: jilles Date: Wed May 1 20:12:58 2013 New Revision: 250155 URL: http://svnweb.freebsd.org/changeset/base/250155 Log: Regenerate files for accept4(). Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c head/sys/kern/init_sysent.c head/sys/kern/syscalls.c head/sys/kern/systrace_args.c head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysproto.h Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Wed May 1 20:10:21 2013 (r250154) +++ head/sys/compat/freebsd32/freebsd32_proto.h Wed May 1 20:12:58 2013 (r250155) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 250154 2013-05-01 20:10:21Z jilles */ #ifndef _FREEBSD32_SYSPROTO_H_ Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Wed May 1 20:10:21 2013 (r250154) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Wed May 1 20:12:58 2013 (r250155) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 250154 2013-05-01 20:10:21Z jilles */ #define FREEBSD32_SYS_syscall 0 @@ -438,4 +438,5 @@ #define FREEBSD32_SYS_bindat 538 #define FREEBSD32_SYS_connectat 539 #define FREEBSD32_SYS_chflagsat 540 -#define FREEBSD32_SYS_MAXSYSCALL 541 +#define FREEBSD32_SYS_accept4 541 +#define FREEBSD32_SYS_MAXSYSCALL 542 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Wed May 1 20:10:21 2013 (r250154) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Wed May 1 20:12:58 2013 (r250155) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 250154 2013-05-01 20:10:21Z jilles */ const char *freebsd32_syscallnames[] = { @@ -564,4 +564,5 @@ const char *freebsd32_syscallnames[] = { "bindat", /* 538 = bindat */ "connectat", /* 539 = connectat */ "chflagsat", /* 540 = chflagsat */ + "accept4", /* 541 = accept4 */ }; Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Wed May 1 20:10:21 2013 (r250154) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Wed May 1 20:12:58 2013 (r250155) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 250154 2013-05-01 20:10:21Z jilles */ #include "opt_compat.h" @@ -601,4 +601,5 @@ struct sysent freebsd32_sysent[] = { { AS(bindat_args), (sy_call_t *)sys_bindat, AUE_BINDAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 538 = bindat */ { AS(connectat_args), (sy_call_t *)sys_connectat, AUE_CONNECTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 539 = connectat */ { AS(chflagsat_args), (sy_call_t *)sys_chflagsat, AUE_CHFLAGSAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 540 = chflagsat */ + { AS(accept4_args), (sy_call_t *)sys_accept4, AUE_ACCEPT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 541 = accept4 */ }; Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Wed May 1 20:10:21 2013 (r250154) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Wed May 1 20:12:58 2013 (r250155) @@ -3160,6 +3160,16 @@ systrace_args(int sysnum, void *params, *n_args = 4; break; } + /* accept4 */ + case 541: { + struct accept4_args *p = params; + iarg[0] = p->s; /* int */ + uarg[1] = (intptr_t) p->name; /* struct sockaddr *__restrict */ + uarg[2] = (intptr_t) p->anamelen; /* __socklen_t *__restrict */ + iarg[3] = p->flags; /* int */ + *n_args = 4; + break; + } default: *n_args = 0; break; @@ -8443,6 +8453,25 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; + /* accept4 */ + case 541: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "struct sockaddr *__restrict"; + break; + case 2: + p = "__socklen_t *__restrict"; + break; + case 3: + p = "int"; + break; + default: + break; + }; + break; default: break; }; @@ -10245,6 +10274,11 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; + /* accept4 */ + case 541: + if (ndx == 0 || ndx == 1) + p = "int"; + break; default: break; }; Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Wed May 1 20:10:21 2013 (r250154) +++ head/sys/kern/init_sysent.c Wed May 1 20:12:58 2013 (r250155) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/kern/syscalls.master 250154 2013-05-01 20:10:21Z jilles */ #include "opt_compat.h" @@ -575,4 +575,5 @@ struct sysent sysent[] = { { AS(bindat_args), (sy_call_t *)sys_bindat, AUE_BINDAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 538 = bindat */ { AS(connectat_args), (sy_call_t *)sys_connectat, AUE_CONNECTAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 539 = connectat */ { AS(chflagsat_args), (sy_call_t *)sys_chflagsat, AUE_CHFLAGSAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 540 = chflagsat */ + { AS(accept4_args), (sy_call_t *)sys_accept4, AUE_ACCEPT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 541 = accept4 */ }; Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Wed May 1 20:10:21 2013 (r250154) +++ head/sys/kern/syscalls.c Wed May 1 20:12:58 2013 (r250155) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/kern/syscalls.master 250154 2013-05-01 20:10:21Z jilles */ const char *syscallnames[] = { @@ -548,4 +548,5 @@ const char *syscallnames[] = { "bindat", /* 538 = bindat */ "connectat", /* 539 = connectat */ "chflagsat", /* 540 = chflagsat */ + "accept4", /* 541 = accept4 */ }; Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Wed May 1 20:10:21 2013 (r250154) +++ head/sys/kern/systrace_args.c Wed May 1 20:12:58 2013 (r250155) @@ -3358,6 +3358,16 @@ systrace_args(int sysnum, void *params, *n_args = 4; break; } + /* accept4 */ + case 541: { + struct accept4_args *p = params; + iarg[0] = p->s; /* int */ + uarg[1] = (intptr_t) p->name; /* struct sockaddr *__restrict */ + uarg[2] = (intptr_t) p->anamelen; /* __socklen_t *__restrict */ + iarg[3] = p->flags; /* int */ + *n_args = 4; + break; + } default: *n_args = 0; break; @@ -8945,6 +8955,25 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; + /* accept4 */ + case 541: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "struct sockaddr *__restrict"; + break; + case 2: + p = "__socklen_t *__restrict"; + break; + case 3: + p = "int"; + break; + default: + break; + }; + break; default: break; }; @@ -10878,6 +10907,11 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; + /* accept4 */ + case 541: + if (ndx == 0 || ndx == 1) + p = "int"; + break; default: break; }; Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Wed May 1 20:10:21 2013 (r250154) +++ head/sys/sys/syscall.h Wed May 1 20:12:58 2013 (r250155) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/kern/syscalls.master 250154 2013-05-01 20:10:21Z jilles */ #define SYS_syscall 0 @@ -460,4 +460,5 @@ #define SYS_bindat 538 #define SYS_connectat 539 #define SYS_chflagsat 540 -#define SYS_MAXSYSCALL 541 +#define SYS_accept4 541 +#define SYS_MAXSYSCALL 542 Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Wed May 1 20:10:21 2013 (r250154) +++ head/sys/sys/syscall.mk Wed May 1 20:12:58 2013 (r250155) @@ -1,7 +1,7 @@ # FreeBSD system call names. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD +# created from FreeBSD: head/sys/kern/syscalls.master 250154 2013-05-01 20:10:21Z jilles MIASM = \ syscall.o \ exit.o \ @@ -408,4 +408,5 @@ MIASM = \ cap_fcntls_get.o \ bindat.o \ connectat.o \ - chflagsat.o + chflagsat.o \ + accept4.o Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Wed May 1 20:10:21 2013 (r250154) +++ head/sys/sys/sysproto.h Wed May 1 20:12:58 2013 (r250155) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/kern/syscalls.master 250154 2013-05-01 20:10:21Z jilles */ #ifndef _SYS_SYSPROTO_H_ @@ -1802,6 +1802,12 @@ struct chflagsat_args { char flags_l_[PADL_(u_long)]; u_long flags; char flags_r_[PADR_(u_long)]; char atflag_l_[PADL_(int)]; int atflag; char atflag_r_[PADR_(int)]; }; +struct accept4_args { + char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)]; + char name_l_[PADL_(struct sockaddr *__restrict)]; struct sockaddr *__restrict name; char name_r_[PADR_(struct sockaddr *__restrict)]; + char anamelen_l_[PADL_(__socklen_t *__restrict)]; __socklen_t *__restrict anamelen; char anamelen_r_[PADR_(__socklen_t *__restrict)]; + char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; +}; int nosys(struct thread *, struct nosys_args *); void sys_sys_exit(struct thread *, struct sys_exit_args *); int sys_fork(struct thread *, struct fork_args *); @@ -2192,6 +2198,7 @@ int sys_cap_fcntls_get(struct thread *, int sys_bindat(struct thread *, struct bindat_args *); int sys_connectat(struct thread *, struct connectat_args *); int sys_chflagsat(struct thread *, struct chflagsat_args *); +int sys_accept4(struct thread *, struct accept4_args *); #ifdef COMPAT_43 @@ -2896,6 +2903,7 @@ int freebsd7_shmctl(struct thread *, str #define SYS_AUE_bindat AUE_BINDAT #define SYS_AUE_connectat AUE_CONNECTAT #define SYS_AUE_chflagsat AUE_CHFLAGSAT +#define SYS_AUE_accept4 AUE_ACCEPT #undef PAD_ #undef PADL_ From owner-svn-src-head@FreeBSD.ORG Wed May 1 22:07:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 961FA8B9; Wed, 1 May 2013 22:07:56 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6EF7115CB; Wed, 1 May 2013 22:07:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41M7uGn034953; Wed, 1 May 2013 22:07:56 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41M7u29034952; Wed, 1 May 2013 22:07:56 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201305012207.r41M7u29034952@svn.freebsd.org> From: Rick Macklem Date: Wed, 1 May 2013 22:07:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250157 - head/sys/kgssapi/krb5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 22:07:56 -0000 Author: rmacklem Date: Wed May 1 22:07:55 2013 New Revision: 250157 URL: http://svnweb.freebsd.org/changeset/base/250157 Log: Isilon reported that sec=krb5p NFS mounts had a problem when m_len == 0 for the last mbuf of the list with an encrypted message. This patch replaces the KASSERT() with code that handles this case. Reported by: john.gemignani@isilon.com Reviewed by: jhb MFC after: 2 weeks Modified: head/sys/kgssapi/krb5/krb5_mech.c Modified: head/sys/kgssapi/krb5/krb5_mech.c ============================================================================== --- head/sys/kgssapi/krb5/krb5_mech.c Wed May 1 21:53:38 2013 (r250156) +++ head/sys/kgssapi/krb5/krb5_mech.c Wed May 1 22:07:55 2013 (r250157) @@ -1585,6 +1585,8 @@ m_trim(struct mbuf *m, int len) struct mbuf *n; int off; + if (m == NULL) + return; n = m_getptr(m, len, &off); if (n) { n->m_len = off; @@ -1600,7 +1602,7 @@ krb5_unwrap_old(struct krb5_context *kc, uint8_t sgn_alg[2], uint8_t seal_alg[2]) { OM_uint32 res; - struct mbuf *m, *mlast, *hm, *cm; + struct mbuf *m, *mlast, *hm, *cm, *n; uint8_t *p, dir; size_t mlen, tlen, elen, datalen, padlen; size_t cklen; @@ -1702,9 +1704,25 @@ krb5_unwrap_old(struct krb5_context *kc, /* * Check the trailing pad bytes. + * RFC1964 specifies between 1<->8 bytes, each with a binary value + * equal to the number of bytes. */ - KASSERT(mlast->m_len > 0, ("Unexpected empty mbuf")); - padlen = mlast->m_data[mlast->m_len - 1]; + if (mlast->m_len > 0) + padlen = mlast->m_data[mlast->m_len - 1]; + else { + n = m_getptr(m, tlen + datalen - 1, &i); + /* + * When the position is exactly equal to the # of data bytes + * in the mbuf list, m_getptr() will return the last mbuf in + * the list and an off == m_len for that mbuf, so that case + * needs to be checked as well as a NULL return. + */ + if (n == NULL || n->m_len == i) + return (GSS_S_DEFECTIVE_TOKEN); + padlen = n->m_data[i]; + } + if (padlen < 1 || padlen > 8 || padlen > tlen + datalen) + return (GSS_S_DEFECTIVE_TOKEN); m_copydata(m, tlen + datalen - padlen, padlen, buf); for (i = 0; i < padlen; i++) { if (buf[i] != padlen) { From owner-svn-src-head@FreeBSD.ORG Wed May 1 22:16:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 902D834F; Wed, 1 May 2013 22:16:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 82A481621; Wed, 1 May 2013 22:16:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41MGT5n038457; Wed, 1 May 2013 22:16:29 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41MGTdT038456; Wed, 1 May 2013 22:16:29 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201305012216.r41MGTdT038456@svn.freebsd.org> From: Rick Macklem Date: Wed, 1 May 2013 22:16:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250158 - head/usr.bin/nfsstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 22:16:29 -0000 Author: rmacklem Date: Wed May 1 22:16:29 2013 New Revision: 250158 URL: http://svnweb.freebsd.org/changeset/base/250158 Log: Document that the NFSv4 server statistics are operation counts and not RPC counts. This is a content change. MFC after: 2 weeks Modified: head/usr.bin/nfsstat/nfsstat.1 Modified: head/usr.bin/nfsstat/nfsstat.1 ============================================================================== --- head/usr.bin/nfsstat/nfsstat.1 Wed May 1 22:07:55 2013 (r250157) +++ head/usr.bin/nfsstat/nfsstat.1 Wed May 1 22:16:29 2013 (r250158) @@ -28,7 +28,7 @@ .\" From: @(#)nfsstat.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd November 14, 2012 +.Dd May 1, 2013 .Dt NFSSTAT 1 .Os .Sh NAME @@ -48,6 +48,10 @@ The command displays statistics kept about .Tn NFS client and server activity. +For the NFSv4 server, the statistics are for operations within the Compound +RPCs and not the count of RPCs. +If you wish to compare RPC counts between NFSv3 and NFSv4, you must use +statistics in the client(s). .Pp The options are as follows: .Bl -tag -width indent From owner-svn-src-head@FreeBSD.ORG Wed May 1 22:42:44 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 75A0214C; Wed, 1 May 2013 22:42:44 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 668441734; Wed, 1 May 2013 22:42:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41Mgiul047989; Wed, 1 May 2013 22:42:44 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41MggOO047980; Wed, 1 May 2013 22:42:42 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305012242.r41MggOO047980@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 1 May 2013 22:42:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250159 - in head: include lib/libc/sys sys/compat/freebsd32 sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 22:42:44 -0000 Author: jilles Date: Wed May 1 22:42:42 2013 New Revision: 250159 URL: http://svnweb.freebsd.org/changeset/base/250159 Log: Add pipe2() system call. The pipe2() function is similar to pipe() but allows setting FD_CLOEXEC and O_NONBLOCK (on both sides) as part of the function. If p points to two writable ints, pipe2(p, 0) is equivalent to pipe(p). If the pointer is not valid, behaviour differs: pipe2() writes into the array from the kernel like socketpair() does, while pipe() writes into the array from an architecture-specific assembler wrapper. Reviewed by: kan, kib Modified: head/include/unistd.h head/lib/libc/sys/Makefile.inc head/lib/libc/sys/Symbol.map head/lib/libc/sys/pipe.2 head/sys/compat/freebsd32/syscalls.master head/sys/kern/capabilities.conf head/sys/kern/sys_pipe.c head/sys/kern/syscalls.master Modified: head/include/unistd.h ============================================================================== --- head/include/unistd.h Wed May 1 22:16:29 2013 (r250158) +++ head/include/unistd.h Wed May 1 22:42:42 2013 (r250159) @@ -533,6 +533,7 @@ char *mktemp(char *); #endif int nfssvc(int, void *); int nlm_syscall(int, int, int, char **); +int pipe2(int *, int); int profil(char *, size_t, vm_offset_t, int); int rcmd(char **, int, const char *, const char *, const char *, int *); int rcmd_af(char **, int, const char *, Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Wed May 1 22:16:29 2013 (r250158) +++ head/lib/libc/sys/Makefile.inc Wed May 1 22:42:42 2013 (r250159) @@ -352,6 +352,7 @@ MLINKS+=pathconf.2 lpathconf.2 MLINKS+=pdfork.2 pdgetpid.2\ pdfork.2 pdkill.2 \ pdfork.2 pdwait4.2 +MLINKS+=pipe.2 pipe2.2 MLINKS+=read.2 pread.2 \ read.2 preadv.2 \ read.2 readv.2 Modified: head/lib/libc/sys/Symbol.map ============================================================================== --- head/lib/libc/sys/Symbol.map Wed May 1 22:16:29 2013 (r250158) +++ head/lib/libc/sys/Symbol.map Wed May 1 22:42:42 2013 (r250159) @@ -393,6 +393,7 @@ FBSD_1.3 { ffclock_getcounter; ffclock_getestimate; ffclock_setestimate; + pipe2; posix_fadvise; wait6; }; Modified: head/lib/libc/sys/pipe.2 ============================================================================== --- head/lib/libc/sys/pipe.2 Wed May 1 22:16:29 2013 (r250158) +++ head/lib/libc/sys/pipe.2 Wed May 1 22:42:42 2013 (r250159) @@ -28,7 +28,7 @@ .\" @(#)pipe.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd January 30, 2006 +.Dd March 31, 2013 .Dt PIPE 2 .Os .Sh NAME @@ -40,6 +40,8 @@ .In unistd.h .Ft int .Fn pipe "int fildes[2]" +.Ft int +.Fn pipe2 "int fildes[2]" "int flags" .Sh DESCRIPTION The .Fn pipe @@ -50,6 +52,29 @@ which is an object allowing bidirectional data flow, and allocates a pair of file descriptors. .Pp +The +.Fn pipe2 +system call allows control over the attributes of the file descriptors +via the +.Fa flags +argument. +Values for +.Fa flags +are constructed by a bitwise-inclusive OR of flags from the following +list, defined in +.In fcntl.h : +.Bl -tag -width ".Dv O_NONBLOCK" +.It Dv O_CLOEXEC +Set the close-on-exec flag for the new file descriptors. +.It Dv O_NONBLOCK +Set the non-blocking flag for the ends of the pipe. +.El +.Pp +If the +.Fa flags +argument is 0, the behavior is identical to a call to +.Fn pipe . +.Pp By convention, the first descriptor is normally used as the .Em read end of the pipe, @@ -88,7 +113,9 @@ pipe in one direction. .Sh ERRORS The .Fn pipe -system call will fail if: +and +.Fn pipe2 +system calls will fail if: .Bl -tag -width Er .It Bq Er EMFILE Too many descriptors are active. @@ -97,6 +124,16 @@ The system file table is full. .It Bq Er ENOMEM Not enough kernel memory to establish a pipe. .El +.Pp +The +.Fn pipe2 +system call will also fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +The +.Fa flags +argument is invalid. +.El .Sh SEE ALSO .Xr sh 1 , .Xr fork 2 , @@ -111,3 +148,8 @@ function appeared in .Pp Bidirectional pipes were first used on .At V.4 . +.Pp +The +.Fn pipe2 +function appeared in +.Fx 10.0 . Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Wed May 1 22:16:29 2013 (r250158) +++ head/sys/compat/freebsd32/syscalls.master Wed May 1 22:42:42 2013 (r250159) @@ -1026,3 +1026,4 @@ struct sockaddr * __restrict name, \ __socklen_t * __restrict anamelen, \ int flags); } +542 AUE_PIPE NOPROTO { int pipe2(int *fildes, int flags); } Modified: head/sys/kern/capabilities.conf ============================================================================== --- head/sys/kern/capabilities.conf Wed May 1 22:16:29 2013 (r250158) +++ head/sys/kern/capabilities.conf Wed May 1 22:42:42 2013 (r250159) @@ -490,6 +490,7 @@ pdkill ## Allow pipe(2). ## pipe +pipe2 ## ## Allow poll(2), which will be scoped by capability rights. Modified: head/sys/kern/sys_pipe.c ============================================================================== --- head/sys/kern/sys_pipe.c Wed May 1 22:16:29 2013 (r250158) +++ head/sys/kern/sys_pipe.c Wed May 1 22:42:42 2013 (r250159) @@ -477,6 +477,24 @@ sys_pipe(struct thread *td, struct pipe_ return (0); } +int +sys_pipe2(struct thread *td, struct pipe2_args *uap) +{ + int error, fildes[2]; + + if (uap->flags & ~(O_CLOEXEC | O_NONBLOCK)) + return (EINVAL); + error = kern_pipe2(td, fildes, uap->flags); + if (error) + return (error); + error = copyout(fildes, uap->fildes, 2 * sizeof(int)); + if (error) { + (void)kern_close(td, fildes[0]); + (void)kern_close(td, fildes[1]); + } + return (error); +} + /* * Allocate kva for pipe circular buffer, the space is pageable * This routine will 'realloc' the size of a pipe safely, if it fails Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Wed May 1 22:16:29 2013 (r250158) +++ head/sys/kern/syscalls.master Wed May 1 22:42:42 2013 (r250159) @@ -976,5 +976,6 @@ struct sockaddr * __restrict name, \ __socklen_t * __restrict anamelen, \ int flags); } +542 AUE_PIPE STD { int pipe2(int *fildes, int flags); } ; Please copy any additions and changes to the following compatability tables: ; sys/compat/freebsd32/syscalls.master From owner-svn-src-head@FreeBSD.ORG Wed May 1 22:45:07 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AE5DD2F1; Wed, 1 May 2013 22:45:07 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 90ACD174B; Wed, 1 May 2013 22:45:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41Mj7Rn048525; Wed, 1 May 2013 22:45:07 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41Mj5SE048511; Wed, 1 May 2013 22:45:05 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305012245.r41Mj5SE048511@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 1 May 2013 22:45:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250160 - in head/sys: compat/freebsd32 kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 22:45:07 -0000 Author: jilles Date: Wed May 1 22:45:04 2013 New Revision: 250160 URL: http://svnweb.freebsd.org/changeset/base/250160 Log: Regenerate files for pipe2(). Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c head/sys/kern/init_sysent.c head/sys/kern/syscalls.c head/sys/kern/systrace_args.c head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysproto.h Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Wed May 1 22:42:42 2013 (r250159) +++ head/sys/compat/freebsd32/freebsd32_proto.h Wed May 1 22:45:04 2013 (r250160) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 250154 2013-05-01 20:10:21Z jilles + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 250159 2013-05-01 22:42:42Z jilles */ #ifndef _FREEBSD32_SYSPROTO_H_ Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Wed May 1 22:42:42 2013 (r250159) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Wed May 1 22:45:04 2013 (r250160) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 250154 2013-05-01 20:10:21Z jilles + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 250159 2013-05-01 22:42:42Z jilles */ #define FREEBSD32_SYS_syscall 0 @@ -439,4 +439,5 @@ #define FREEBSD32_SYS_connectat 539 #define FREEBSD32_SYS_chflagsat 540 #define FREEBSD32_SYS_accept4 541 -#define FREEBSD32_SYS_MAXSYSCALL 542 +#define FREEBSD32_SYS_pipe2 542 +#define FREEBSD32_SYS_MAXSYSCALL 543 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Wed May 1 22:42:42 2013 (r250159) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Wed May 1 22:45:04 2013 (r250160) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 250154 2013-05-01 20:10:21Z jilles + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 250159 2013-05-01 22:42:42Z jilles */ const char *freebsd32_syscallnames[] = { @@ -565,4 +565,5 @@ const char *freebsd32_syscallnames[] = { "connectat", /* 539 = connectat */ "chflagsat", /* 540 = chflagsat */ "accept4", /* 541 = accept4 */ + "pipe2", /* 542 = pipe2 */ }; Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Wed May 1 22:42:42 2013 (r250159) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Wed May 1 22:45:04 2013 (r250160) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 250154 2013-05-01 20:10:21Z jilles + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 250159 2013-05-01 22:42:42Z jilles */ #include "opt_compat.h" @@ -602,4 +602,5 @@ struct sysent freebsd32_sysent[] = { { AS(connectat_args), (sy_call_t *)sys_connectat, AUE_CONNECTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 539 = connectat */ { AS(chflagsat_args), (sy_call_t *)sys_chflagsat, AUE_CHFLAGSAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 540 = chflagsat */ { AS(accept4_args), (sy_call_t *)sys_accept4, AUE_ACCEPT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 541 = accept4 */ + { AS(pipe2_args), (sy_call_t *)sys_pipe2, AUE_PIPE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 542 = pipe2 */ }; Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Wed May 1 22:42:42 2013 (r250159) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Wed May 1 22:45:04 2013 (r250160) @@ -3170,6 +3170,14 @@ systrace_args(int sysnum, void *params, *n_args = 4; break; } + /* pipe2 */ + case 542: { + struct pipe2_args *p = params; + uarg[0] = (intptr_t) p->fildes; /* int * */ + iarg[1] = p->flags; /* int */ + *n_args = 2; + break; + } default: *n_args = 0; break; @@ -8472,6 +8480,19 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; + /* pipe2 */ + case 542: + switch(ndx) { + case 0: + p = "int *"; + break; + case 1: + p = "int"; + break; + default: + break; + }; + break; default: break; }; @@ -10279,6 +10300,11 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; + /* pipe2 */ + case 542: + if (ndx == 0 || ndx == 1) + p = "int"; + break; default: break; }; Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Wed May 1 22:42:42 2013 (r250159) +++ head/sys/kern/init_sysent.c Wed May 1 22:45:04 2013 (r250160) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 250154 2013-05-01 20:10:21Z jilles + * created from FreeBSD: head/sys/kern/syscalls.master 250159 2013-05-01 22:42:42Z jilles */ #include "opt_compat.h" @@ -576,4 +576,5 @@ struct sysent sysent[] = { { AS(connectat_args), (sy_call_t *)sys_connectat, AUE_CONNECTAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 539 = connectat */ { AS(chflagsat_args), (sy_call_t *)sys_chflagsat, AUE_CHFLAGSAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 540 = chflagsat */ { AS(accept4_args), (sy_call_t *)sys_accept4, AUE_ACCEPT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 541 = accept4 */ + { AS(pipe2_args), (sy_call_t *)sys_pipe2, AUE_PIPE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 542 = pipe2 */ }; Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Wed May 1 22:42:42 2013 (r250159) +++ head/sys/kern/syscalls.c Wed May 1 22:45:04 2013 (r250160) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 250154 2013-05-01 20:10:21Z jilles + * created from FreeBSD: head/sys/kern/syscalls.master 250159 2013-05-01 22:42:42Z jilles */ const char *syscallnames[] = { @@ -549,4 +549,5 @@ const char *syscallnames[] = { "connectat", /* 539 = connectat */ "chflagsat", /* 540 = chflagsat */ "accept4", /* 541 = accept4 */ + "pipe2", /* 542 = pipe2 */ }; Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Wed May 1 22:42:42 2013 (r250159) +++ head/sys/kern/systrace_args.c Wed May 1 22:45:04 2013 (r250160) @@ -3368,6 +3368,14 @@ systrace_args(int sysnum, void *params, *n_args = 4; break; } + /* pipe2 */ + case 542: { + struct pipe2_args *p = params; + uarg[0] = (intptr_t) p->fildes; /* int * */ + iarg[1] = p->flags; /* int */ + *n_args = 2; + break; + } default: *n_args = 0; break; @@ -8974,6 +8982,19 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; + /* pipe2 */ + case 542: + switch(ndx) { + case 0: + p = "int *"; + break; + case 1: + p = "int"; + break; + default: + break; + }; + break; default: break; }; @@ -10912,6 +10933,11 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; + /* pipe2 */ + case 542: + if (ndx == 0 || ndx == 1) + p = "int"; + break; default: break; }; Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Wed May 1 22:42:42 2013 (r250159) +++ head/sys/sys/syscall.h Wed May 1 22:45:04 2013 (r250160) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 250154 2013-05-01 20:10:21Z jilles + * created from FreeBSD: head/sys/kern/syscalls.master 250159 2013-05-01 22:42:42Z jilles */ #define SYS_syscall 0 @@ -461,4 +461,5 @@ #define SYS_connectat 539 #define SYS_chflagsat 540 #define SYS_accept4 541 -#define SYS_MAXSYSCALL 542 +#define SYS_pipe2 542 +#define SYS_MAXSYSCALL 543 Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Wed May 1 22:42:42 2013 (r250159) +++ head/sys/sys/syscall.mk Wed May 1 22:45:04 2013 (r250160) @@ -1,7 +1,7 @@ # FreeBSD system call names. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: head/sys/kern/syscalls.master 250154 2013-05-01 20:10:21Z jilles +# created from FreeBSD: head/sys/kern/syscalls.master 250159 2013-05-01 22:42:42Z jilles MIASM = \ syscall.o \ exit.o \ @@ -409,4 +409,5 @@ MIASM = \ bindat.o \ connectat.o \ chflagsat.o \ - accept4.o + accept4.o \ + pipe2.o Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Wed May 1 22:42:42 2013 (r250159) +++ head/sys/sys/sysproto.h Wed May 1 22:45:04 2013 (r250160) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 250154 2013-05-01 20:10:21Z jilles + * created from FreeBSD: head/sys/kern/syscalls.master 250159 2013-05-01 22:42:42Z jilles */ #ifndef _SYS_SYSPROTO_H_ @@ -1808,6 +1808,10 @@ struct accept4_args { char anamelen_l_[PADL_(__socklen_t *__restrict)]; __socklen_t *__restrict anamelen; char anamelen_r_[PADR_(__socklen_t *__restrict)]; char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; }; +struct pipe2_args { + char fildes_l_[PADL_(int *)]; int * fildes; char fildes_r_[PADR_(int *)]; + char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; +}; int nosys(struct thread *, struct nosys_args *); void sys_sys_exit(struct thread *, struct sys_exit_args *); int sys_fork(struct thread *, struct fork_args *); @@ -2199,6 +2203,7 @@ int sys_bindat(struct thread *, struct b int sys_connectat(struct thread *, struct connectat_args *); int sys_chflagsat(struct thread *, struct chflagsat_args *); int sys_accept4(struct thread *, struct accept4_args *); +int sys_pipe2(struct thread *, struct pipe2_args *); #ifdef COMPAT_43 @@ -2904,6 +2909,7 @@ int freebsd7_shmctl(struct thread *, str #define SYS_AUE_connectat AUE_CONNECTAT #define SYS_AUE_chflagsat AUE_CHFLAGSAT #define SYS_AUE_accept4 AUE_ACCEPT +#define SYS_AUE_pipe2 AUE_PIPE #undef PAD_ #undef PADL_ From owner-svn-src-head@FreeBSD.ORG Wed May 1 22:47:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DD6A6479; Wed, 1 May 2013 22:47:47 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CEE251759; Wed, 1 May 2013 22:47:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41Mll0a049001; Wed, 1 May 2013 22:47:47 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41MllDH048999; Wed, 1 May 2013 22:47:47 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305012247.r41MllDH048999@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 1 May 2013 22:47:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250161 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 22:47:47 -0000 Author: jilles Date: Wed May 1 22:47:47 2013 New Revision: 250161 URL: http://svnweb.freebsd.org/changeset/base/250161 Log: accept(2), pipe(2): Fix .Dd. Modified: head/lib/libc/sys/accept.2 head/lib/libc/sys/pipe.2 Modified: head/lib/libc/sys/accept.2 ============================================================================== --- head/lib/libc/sys/accept.2 Wed May 1 22:45:04 2013 (r250160) +++ head/lib/libc/sys/accept.2 Wed May 1 22:47:47 2013 (r250161) @@ -28,7 +28,7 @@ .\" @(#)accept.2 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd April 22, 2013 +.Dd May 1, 2013 .Dt ACCEPT 2 .Os .Sh NAME Modified: head/lib/libc/sys/pipe.2 ============================================================================== --- head/lib/libc/sys/pipe.2 Wed May 1 22:45:04 2013 (r250160) +++ head/lib/libc/sys/pipe.2 Wed May 1 22:47:47 2013 (r250161) @@ -28,7 +28,7 @@ .\" @(#)pipe.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd March 31, 2013 +.Dd May 1, 2013 .Dt PIPE 2 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Wed May 1 22:50:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1B6196B2; Wed, 1 May 2013 22:50:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0E4B317B1; Wed, 1 May 2013 22:50:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41MojAw051125; Wed, 1 May 2013 22:50:45 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41Mojtt051124; Wed, 1 May 2013 22:50:45 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201305012250.r41Mojtt051124@svn.freebsd.org> From: Rick Macklem Date: Wed, 1 May 2013 22:50:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250162 - head/usr.sbin/nfsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 22:50:46 -0000 Author: rmacklem Date: Wed May 1 22:50:45 2013 New Revision: 250162 URL: http://svnweb.freebsd.org/changeset/base/250162 Log: Document the fact that an NFSv4 mount against a volume on the same host can result in a hung NFS server and is not recommended. This is a content change. MFC after: 2 weeks Modified: head/usr.sbin/nfsd/nfsv4.4 Modified: head/usr.sbin/nfsd/nfsv4.4 ============================================================================== --- head/usr.sbin/nfsd/nfsv4.4 Wed May 1 22:47:47 2013 (r250161) +++ head/usr.sbin/nfsd/nfsv4.4 Wed May 1 22:50:45 2013 (r250162) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 23, 2012 +.Dd May 1, 2013 .Dt NFSV4 4 .Os .Sh NAME @@ -287,6 +287,13 @@ and daemons at boot time via the ``nfsuserd_flags'' and ``nfscbd_flags'' .Xr rc.conf 5 variables. +.Pp +NFSv4 mount(s) against exported volume(s) on the same host are not recommended, +since this can result in a hung NFS server. +It occurs when an nfsd thread tries to do an NFSv4 VOP_RECLAIM()/Close RPC +as part of acquiring a new vnode. +If all other nfsd threads are blocked waiting for lock(s) held by this nfsd +thread, then there isn't an nfsd thread to service the Close RPC. .Sh FILES .Bl -tag -width /var/db/nfs-stablerestart.bak -compact .It Pa /var/db/nfs-stablerestart From owner-svn-src-head@FreeBSD.ORG Wed May 1 23:04:30 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 11F4EA4E; Wed, 1 May 2013 23:04:30 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 04ADA1806; Wed, 1 May 2013 23:04:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41N4T2H055388; Wed, 1 May 2013 23:04:29 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41N4TiU055387; Wed, 1 May 2013 23:04:29 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305012304.r41N4TiU055387@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 1 May 2013 23:04:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250163 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 23:04:30 -0000 Author: jilles Date: Wed May 1 23:04:29 2013 New Revision: 250163 URL: http://svnweb.freebsd.org/changeset/base/250163 Log: Bump __FreeBSD_version for accept4() and pipe2(). Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Wed May 1 22:50:45 2013 (r250162) +++ head/sys/sys/param.h Wed May 1 23:04:29 2013 (r250163) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000031 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000032 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@FreeBSD.ORG Wed May 1 23:58:39 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D8247C11; Wed, 1 May 2013 23:58:39 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B123B1AC1; Wed, 1 May 2013 23:58:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r41NwdQ7074236; Wed, 1 May 2013 23:58:39 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r41NwdCB074235; Wed, 1 May 2013 23:58:39 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201305012358.r41NwdCB074235@svn.freebsd.org> From: "Simon J. Gerraty" Date: Wed, 1 May 2013 23:58:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250164 - head/contrib/bmake X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 23:58:39 -0000 Author: sjg Date: Wed May 1 23:58:39 2013 New Revision: 250164 URL: http://svnweb.freebsd.org/changeset/base/250164 Log: Local hack to allow smooth transition for ports. bsd.port.mk can set .MAKE.FreeBSD_UL=yes to cause :L and :U to have their old behavior. This should be reverted when 8.3 is EOL. PR: 173299 Reviewed by: obrien Modified: head/contrib/bmake/var.c Modified: head/contrib/bmake/var.c ============================================================================== --- head/contrib/bmake/var.c Wed May 1 23:04:29 2013 (r250163) +++ head/contrib/bmake/var.c Wed May 1 23:58:39 2013 (r250164) @@ -140,6 +140,17 @@ __RCSID("$NetBSD: var.c,v 1.173 2013/02/ #include "job.h" /* + * XXX transition hack for FreeBSD ports. + * bsd.port.mk can set .MAKE.FreeBSD_UL=yes + * to cause us to treat :[LU] as aliases for :t[lu] + * To be reverted when ports converts to :t[lu] (when 8.3 is EOL) + */ +#define MAKE_FREEBSD_UL ".MAKE.FreeBSD_UL" +#ifdef MAKE_FREEBSD_UL +static int FreeBSD_UL = FALSE; +#endif + +/* * This lets us tell if we have replaced the original environ * (which we cannot free). */ @@ -965,6 +976,11 @@ Var_Set(const char *name, const char *va setenv(MAKE_LEVEL_SAFE, tmp, 1); #endif } +#ifdef MAKE_FREEBSD_UL + if (strcmp(MAKE_FREEBSD_UL, name) == 0) { + FreeBSD_UL = getBoolean(MAKE_FREEBSD_UL, FALSE); + } +#endif out: @@ -2660,8 +2676,24 @@ ApplyModifiers(char *nstr, const char *t free(loop.str); break; } - case 'D': case 'U': +#ifdef MAKE_FREEBSD_UL + if (FreeBSD_UL) { + int nc = tstr[1]; + + /* we have to be careful, since :U is used internally */ + if (nc == ':' || nc == endc) { + char *dp = bmake_strdup(nstr); + for (newStr = dp; *dp; dp++) + *dp = toupper((unsigned char)*dp); + cp = tstr + 1; + termc = *cp; + break; /* yes inside the conditional */ + } + /* FALLTHROUGH */ + } +#endif + case 'D': { Buffer buf; /* Buffer for patterns */ int wantit; /* want data in buffer */ @@ -2721,6 +2753,17 @@ ApplyModifiers(char *nstr, const char *t break; } case 'L': +#ifdef MAKE_FREEBSD_UL + if (FreeBSD_UL) { + char *dp = bmake_strdup(nstr); + for (newStr = dp; *dp; dp++) + *dp = tolower((unsigned char)*dp); + cp = tstr + 1; + termc = *cp; + break; + } + /* FALLTHROUGH */ +#endif { if ((v->flags & VAR_JUNK) != 0) v->flags |= VAR_KEEP; From owner-svn-src-head@FreeBSD.ORG Thu May 2 00:40:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F3C37237; Thu, 2 May 2013 00:40:45 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E61231CA8; Thu, 2 May 2013 00:40:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r420ejOT088910; Thu, 2 May 2013 00:40:45 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r420ejb7088909; Thu, 2 May 2013 00:40:45 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305020040.r420ejb7088909@svn.freebsd.org> From: Adrian Chadd Date: Thu, 2 May 2013 00:40:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250165 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 00:40:46 -0000 Author: adrian Date: Thu May 2 00:40:45 2013 New Revision: 250165 URL: http://svnweb.freebsd.org/changeset/base/250165 Log: Add the AR933x SoC GPIO pin count limitation. Modified: head/sys/mips/atheros/ar71xx_gpio.c Modified: head/sys/mips/atheros/ar71xx_gpio.c ============================================================================== --- head/sys/mips/atheros/ar71xx_gpio.c Wed May 1 23:58:39 2013 (r250164) +++ head/sys/mips/atheros/ar71xx_gpio.c Thu May 2 00:40:45 2013 (r250165) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "gpio_if.h" @@ -136,6 +137,10 @@ ar71xx_gpio_pin_max(device_t dev, int *m case AR71XX_SOC_AR7242: *maxpin = AR724X_GPIO_PINS - 1; break; + case AR71XX_SOC_AR9330: + case AR71XX_SOC_AR9331: + *maxpin = AR933X_GPIO_COUNT - 1; + break; default: *maxpin = AR71XX_GPIO_PINS - 1; } From owner-svn-src-head@FreeBSD.ORG Thu May 2 00:59:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3DEC55CD; Thu, 2 May 2013 00:59:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 169831D4A; Thu, 2 May 2013 00:59:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r420xegF095257; Thu, 2 May 2013 00:59:40 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r420xe3Y095253; Thu, 2 May 2013 00:59:40 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305020059.r420xe3Y095253@svn.freebsd.org> From: Adrian Chadd Date: Thu, 2 May 2013 00:59:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250166 - in head/sys: contrib/dev/ath/ath_hal/ar9300 dev/ath/ath_hal dev/ath/ath_hal/ar9003 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 00:59:41 -0000 Author: adrian Date: Thu May 2 00:59:39 2013 New Revision: 250166 URL: http://svnweb.freebsd.org/changeset/base/250166 Log: Add device identification and probe/attach support for the QCA9565. The QCA9565 is a 1x1 2.4GHz 11n chip with integrated on-chip bluetooth. The AR9300 HAL already has support for this chip; it just wasn't included in the probe/attach path. Tested: * This commit brought to you over a QCA9565 wifi connection from FreeBSD. * .. ie, basic STA, pings, no iperf or antenna diversity checking just yet. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c head/sys/dev/ath/ath_hal/ah.c head/sys/dev/ath/ath_hal/ah_devid.h head/sys/dev/ath/ath_hal/ar9003/ar9300_devid.h Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c Thu May 2 00:40:45 2013 (r250165) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c Thu May 2 00:59:39 2013 (r250166) @@ -4089,6 +4089,8 @@ ar9300_probe(uint16_t vendorid, uint16_t return "Atheros AR933x"; case AR9300_DEVID_QCA955X: /* Scorpion */ return "Qualcomm Atheros QCA955x"; + case AR9300_DEVID_QCA9565: /* Aphrodite */ + return "Qualcomm Atheros AR9565"; default: return AH_NULL; } Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Thu May 2 00:40:45 2013 (r250165) +++ head/sys/dev/ath/ath_hal/ah.c Thu May 2 00:59:39 2013 (r250166) @@ -139,6 +139,9 @@ ath_hal_mac_name(struct ath_hal *ah) return "9550"; case AR_SREV_VERSION_AR9485: return "9485"; + case AR_SREV_VERSION_QCA9565: + /* XXX should say QCA, not AR */ + return "9565"; } return "????"; } Modified: head/sys/dev/ath/ath_hal/ah_devid.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_devid.h Thu May 2 00:40:45 2013 (r250165) +++ head/sys/dev/ath/ath_hal/ah_devid.h Thu May 2 00:59:39 2013 (r250166) @@ -91,6 +91,7 @@ #define AR9300_DEVID_AR9580_PCIE 0x0033 #define AR9300_DEVID_AR946X_PCIE 0x0034 #define AR9300_DEVID_AR9330 0x0035 +#define AR9300_DEVID_QCA9565 0x0036 #define AR9300_DEVID_QCA955X 0x0039 #define AR_SUBVENDOR_ID_NOG 0x0e11 /* No 11G subvendor ID */ Modified: head/sys/dev/ath/ath_hal/ar9003/ar9300_devid.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar9003/ar9300_devid.h Thu May 2 00:40:45 2013 (r250165) +++ head/sys/dev/ath/ath_hal/ar9003/ar9300_devid.h Thu May 2 00:59:39 2013 (r250166) @@ -48,6 +48,7 @@ #define AR_SREV_VERSION_AR9380 0x1C0 #define AR_SREV_VERSION_AR9580 0x1C0 #define AR_SREV_VERSION_AR9460 0x280 +#define AR_SREV_VERSION_QCA9565 0x2c0 #define AR_SREV_VERSION_AR9330 0x200 #define AR_SREV_VERSION_AR9340 0x300 From owner-svn-src-head@FreeBSD.ORG Thu May 2 01:36:53 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DD84FB9A; Thu, 2 May 2013 01:36:53 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D005B1E64; Thu, 2 May 2013 01:36:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r421arKF009392; Thu, 2 May 2013 01:36:53 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r421aqL5009383; Thu, 2 May 2013 01:36:52 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305020136.r421aqL5009383@svn.freebsd.org> From: Eitan Adler Date: Thu, 2 May 2013 01:36:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250168 - in head: share/man/man4 sys/dev/e1000 sys/dev/ixgb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 01:36:53 -0000 Author: eadler Date: Thu May 2 01:36:52 2013 New Revision: 250168 URL: http://svnweb.freebsd.org/changeset/base/250168 Log: Update Intel email address. PR: docs/175349 Submitted by: Lars Eggert Discussed with: jfv Modified: head/share/man/man4/em.4 head/share/man/man4/igb.4 head/share/man/man4/ixgb.4 head/share/man/man4/ixgbe.4 head/sys/dev/e1000/README head/sys/dev/ixgb/README Modified: head/share/man/man4/em.4 ============================================================================== --- head/share/man/man4/em.4 Thu May 2 01:35:02 2013 (r250167) +++ head/share/man/man4/em.4 Thu May 2 01:36:52 2013 (r250168) @@ -260,7 +260,7 @@ go to the Intel support website at: If an issue is identified with the released source code on the supported kernel with a supported adapter, email the specific information related to the issue to -.Aq freebsdnic@mailbox.intel.com . +.Aq freebsd@intel.com . .Sh SEE ALSO .Xr altq 4 , .Xr arp 4 , @@ -280,7 +280,7 @@ device driver first appeared in The .Nm driver was written by -.An Intel Corporation Aq freebsdnic@mailbox.intel.com . +.An Intel Corporation Aq freebsd@intel.com . .Sh BUGS Hardware-assisted VLAN processing is disabled by default. You can enable it on an Modified: head/share/man/man4/igb.4 ============================================================================== --- head/share/man/man4/igb.4 Thu May 2 01:35:02 2013 (r250167) +++ head/share/man/man4/igb.4 Thu May 2 01:36:52 2013 (r250168) @@ -205,7 +205,7 @@ go to the Intel support website at: If an issue is identified with the released source code on the supported kernel with a supported adapter, email the specific information related to the issue to -.Aq freebsdnic@mailbox.intel.com . +.Aq freebsd@intel.com . .Sh SEE ALSO .Xr altq 4 , .Xr arp 4 , @@ -225,4 +225,4 @@ device driver first appeared in The .Nm driver was written by -.An Intel Corporation Aq freebsdnic@mailbox.intel.com . +.An Intel Corporation Aq freebsd@intel.com . Modified: head/share/man/man4/ixgb.4 ============================================================================== --- head/share/man/man4/ixgb.4 Thu May 2 01:35:02 2013 (r250167) +++ head/share/man/man4/ixgb.4 Thu May 2 01:36:52 2013 (r250168) @@ -102,7 +102,7 @@ go to the Intel support website at: If an issue is identified with the released source code on the supported kernel with a supported adapter, email the specific information related to the issue to -.Aq freebsdnic@mailbox.intel.com . +.Aq freebsd@intel.com . .Sh SEE ALSO .Xr arp 4 , .Xr em 4 , @@ -122,4 +122,4 @@ and The .Nm driver was written by -.An Intel Corporation Aq freebsdnic@mailbox.intel.com . +.An Intel Corporation Aq freebsd@intel.com . Modified: head/share/man/man4/ixgbe.4 ============================================================================== --- head/share/man/man4/ixgbe.4 Thu May 2 01:35:02 2013 (r250167) +++ head/share/man/man4/ixgbe.4 Thu May 2 01:36:52 2013 (r250168) @@ -105,7 +105,7 @@ go to the Intel support website at: If an issue is identified with the released source code on the supported kernel with a supported adapter, email the specific information related to the issue to -.Aq freebsdnic@mailbox.intel.com . +.Aq freebsd@intel.com . .Sh SEE ALSO .Xr altq 4 , .Xr arp 4 , @@ -123,4 +123,4 @@ device driver first appeared in The .Nm driver was written by -.An Intel Corporation Aq freebsdnic@mailbox.intel.com . +.An Intel Corporation Aq freebsd@intel.com . Modified: head/sys/dev/e1000/README ============================================================================== --- head/sys/dev/e1000/README Thu May 2 01:35:02 2013 (r250167) +++ head/sys/dev/e1000/README Thu May 2 01:36:52 2013 (r250168) @@ -389,7 +389,7 @@ For general information and support, go http://support.intel.com If an issue is identified, support is through email only at: -freebsdnic@mailbox.intel.com +freebsd@intel.com License Modified: head/sys/dev/ixgb/README ============================================================================== --- head/sys/dev/ixgb/README Thu May 2 01:35:02 2013 (r250167) +++ head/sys/dev/ixgb/README Thu May 2 01:36:52 2013 (r250168) @@ -217,7 +217,7 @@ For general information and support, go If an issue is identified with the released source code on the supported kernel with a supported adapter, email the specific information related to -the issue to freebsdnic@mailbox.intel.com. +the issue to freebsd@intel.com. From owner-svn-src-head@FreeBSD.ORG Thu May 2 03:47:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E9474C52; Thu, 2 May 2013 03:47:25 +0000 (UTC) (envelope-from davidxu@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id DAB08125B; Thu, 2 May 2013 03:47:25 +0000 (UTC) Received: from xyf.my.dom (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.6/8.14.6) with ESMTP id r423lN42004614; Thu, 2 May 2013 03:47:24 GMT (envelope-from davidxu@freebsd.org) Message-ID: <5181E1E7.3090708@freebsd.org> Date: Thu, 02 May 2013 11:47:51 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/20130416 Thunderbird/17.0.5 MIME-Version: 1.0 To: Alan Cox Subject: Re: svn commit: r249605 - head/sys/vm References: <201304180534.r3I5YXK4015577@svn.freebsd.org> In-Reply-To: <201304180534.r3I5YXK4015577@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 03:47:26 -0000 On 2013/04/18 13:34, Alan Cox wrote: > Author: alc > Date: Thu Apr 18 05:34:33 2013 > New Revision: 249605 > URL: http://svnweb.freebsd.org/changeset/base/249605 > > Log: > When calculating the number of reserved nodes, discount the pages that will > be used to store the nodes. > > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/sys/vm/vm_radix.c > > Modified: head/sys/vm/vm_radix.c > ============================================================================== > --- head/sys/vm/vm_radix.c Thu Apr 18 05:12:11 2013 (r249604) > +++ head/sys/vm/vm_radix.c Thu Apr 18 05:34:33 2013 (r249605) > @@ -360,10 +360,17 @@ vm_radix_node_zone_init(void *mem, int s > static void > vm_radix_prealloc(void *arg __unused) > { > + int nodes; > > - if (!uma_zone_reserve_kva(vm_radix_node_zone, cnt.v_page_count)) > + /* > + * Calculate the number of reserved nodes, discounting the pages that > + * are needed to store them. > + */ > + nodes = ((vm_paddr_t)cnt.v_page_count * PAGE_SIZE) / (PAGE_SIZE + > + sizeof(struct vm_radix_node)); > + if (!uma_zone_reserve_kva(vm_radix_node_zone, nodes)) > panic("%s: unable to create new zone", __func__); > - uma_prealloc(vm_radix_node_zone, cnt.v_page_count); > + uma_prealloc(vm_radix_node_zone, nodes); > } > SYSINIT(vm_radix_prealloc, SI_SUB_KMEM, SI_ORDER_SECOND, vm_radix_prealloc, > NULL); > FYI, after this change, my network card no longer works, the driver /sys/dev/if_msk.c reports watchdog timeout, backing out this change works again for me. Regards, David Xu From owner-svn-src-head@FreeBSD.ORG Thu May 2 07:02:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F3C22165; Thu, 2 May 2013 07:02:23 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E5D69183C; Thu, 2 May 2013 07:02:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4272Ndu024589; Thu, 2 May 2013 07:02:23 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4272NdU024588; Thu, 2 May 2013 07:02:23 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305020702.r4272NdU024588@svn.freebsd.org> From: Adrian Chadd Date: Thu, 2 May 2013 07:02:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250172 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 07:02:24 -0000 Author: adrian Date: Thu May 2 07:02:23 2013 New Revision: 250172 URL: http://svnweb.freebsd.org/changeset/base/250172 Log: Fix this code to compile without warnings - AH_DEBUG was pulling in ichan, but OS_MARK was not using it. It only uses it when AH_DEBUG_ALQ is also defined. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radio.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radio.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radio.c Thu May 2 04:23:57 2013 (r250171) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radio.c Thu May 2 07:02:23 2013 (r250172) @@ -86,11 +86,15 @@ ar9300_set_channel(struct ath_hal *ah, s u_int8_t clk_25mhz = AH9300(ah)->clk_25mhz; CHAN_CENTERS centers; int load_synth_channel; -#ifdef AH_DEBUG +#ifdef AH_DEBUG_ALQ HAL_CHANNEL_INTERNAL *ichan = ath_hal_checkchannel(ah, chan); #endif -#ifdef AH_DEBUG + /* + * Put this behind AH_DEBUG_ALQ for now until the Hornet + * channel_sel code below is made to work. + */ +#ifdef AH_DEBUG_ALQ OS_MARK(ah, AH_MARK_SETCHANNEL, ichan->channel); #endif From owner-svn-src-head@FreeBSD.ORG Thu May 2 07:05:35 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 60FE33FE; Thu, 2 May 2013 07:05:35 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 42FC01865; Thu, 2 May 2013 07:05:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4275ZPa025409; Thu, 2 May 2013 07:05:35 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4275YlO025406; Thu, 2 May 2013 07:05:34 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305020705.r4275YlO025406@svn.freebsd.org> From: Adrian Chadd Date: Thu, 2 May 2013 07:05:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250173 - in head/sys: conf modules/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 07:05:35 -0000 Author: adrian Date: Thu May 2 07:05:34 2013 New Revision: 250173 URL: http://svnweb.freebsd.org/changeset/base/250173 Log: Add the AR9300 HAL into the kernel and module builds. Tested: * make universe (honest!) Modified: head/sys/conf/files head/sys/conf/kern.pre.mk head/sys/modules/ath/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu May 2 07:02:23 2013 (r250172) +++ head/sys/conf/files Thu May 2 07:05:34 2013 (r250173) @@ -982,6 +982,54 @@ dev/ath/ath_hal/ar9002/ar9287_cal.c opti dev/ath/ath_hal/ar9002/ar9287_olc.c optional ath_hal | ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" +# ar9300 +contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_beacon.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal ${NO_WCONSTANT_CONVERSION}" +contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_gpio.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_interrupts.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_keycache.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_paprd.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_phy.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_power.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_radar.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_radio.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_recv.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_recv_ds.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal ${NO_WSOMETIMES_UNINITIALIZED}" +contrib/dev/ath/ath_hal/ar9300/ar9300_stub.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_timer.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_xmit.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" +contrib/dev/ath/ath_hal/ar9300/ar9300_xmit_ds.c optional ath_hal | ath_ar9300 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal" + # rf backends dev/ath/ath_hal/ar5212/ar2316.c optional ath_rf2316 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" @@ -1006,6 +1054,7 @@ dev/ath/ath_hal/ar9002/ar9285.c optional compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar9002/ar9287.c optional ath_hal | ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" + # ath rate control algorithms dev/ath/ath_rate/amrr/amrr.c optional ath_rate_amrr \ compile-with "${NORMAL_C} -I$S/dev/ath" Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Thu May 2 07:02:23 2013 (r250172) +++ head/sys/conf/kern.pre.mk Thu May 2 07:05:34 2013 (r250173) @@ -65,7 +65,7 @@ INCLUDES+= -I$S/contrib/altq INCLUDES+= -I$S/contrib/ipfilter # ... and the same for ath -INCLUDES+= -I$S/dev/ath -I$S/dev/ath/ath_hal +INCLUDES+= -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal # ... and the same for the NgATM stuff INCLUDES+= -I$S/contrib/ngatm Modified: head/sys/modules/ath/Makefile ============================================================================== --- head/sys/modules/ath/Makefile Thu May 2 07:02:23 2013 (r250172) +++ head/sys/modules/ath/Makefile Thu May 2 07:05:34 2013 (r250173) @@ -124,13 +124,13 @@ SRCS+= ah_eeprom_9287.c SRCS+= ar9287.c ar9287_reset.c ar9287_attach.c ar9287_cal.c ar9287_olc.c # + AR9300 HAL -# .PATH: ${.CURDIR}/../../contrib/sys/dev/ath/ath_hal/ar9300 -#SRCS+= ar9300_interrupts.c ar9300_radar.c ar9300_ani.c ar9300_keycache.c -#SRCS+= ar9300_radio.c ar9300_xmit.c ar9300_attach.c ar9300_mci.c ar9300_stub.c -#SRCS+= ar9300_xmit_ds.c ar9300_beacon.c ar9300_misc.c ar9300_recv.c -#SRCS+= ar9300_stub_funcs.c ar9300_eeprom.c ar9300_paprd.c ar9300_recv_ds.c -#SRCS+= ar9300_freebsd.c ar9300_phy.c ar9300_reset.c ar9300_gpio.c -#SRCS+= ar9300_power.c ar9300_timer.c +.PATH: ${.CURDIR}/../../contrib/dev/ath/ath_hal/ar9300 +SRCS+= ar9300_interrupts.c ar9300_radar.c ar9300_ani.c ar9300_keycache.c +SRCS+= ar9300_radio.c ar9300_xmit.c ar9300_attach.c ar9300_mci.c ar9300_stub.c +SRCS+= ar9300_xmit_ds.c ar9300_beacon.c ar9300_misc.c ar9300_recv.c +SRCS+= ar9300_stub_funcs.c ar9300_eeprom.c ar9300_paprd.c ar9300_recv_ds.c +SRCS+= ar9300_freebsd.c ar9300_phy.c ar9300_reset.c ar9300_gpio.c +SRCS+= ar9300_power.c ar9300_timer.c # NB: rate control is bound to the driver by symbol names so only pick one .if ${ATH_RATE} == "sample" @@ -149,7 +149,7 @@ SRCS+= amrr.c SRCS+= dfs_null.c CFLAGS+= -I. -I${.CURDIR}/../../dev/ath -I${.CURDIR}/../../dev/ath/ath_hal -# CFLAGS+= -I. -I${.CURDIR}/../../contrib/sys/dev/ath/ath_hal/ +CFLAGS+= -I. -I${.CURDIR}/../../contrib/dev/ath/ath_hal/ .if !defined(KERNBUILDDIR) opt_ah.h: @@ -164,5 +164,5 @@ CWARNFLAGS.if_ath.c= ${NO_WSOMETIMES_UN CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} # AR9300 HAL build overrides, as there's still some code to tidy up -#CWARNFLAGS.ar9300_eeprom.c= ${NO_WCONSTANT_CONVERSION} -#CWARNFLAGS.ar9300_reset.c= ${NO_WSOMETIMES_UNINITIALIZED} +CWARNFLAGS.ar9300_eeprom.c= ${NO_WCONSTANT_CONVERSION} +CWARNFLAGS.ar9300_reset.c= ${NO_WSOMETIMES_UNINITIALIZED} From owner-svn-src-head@FreeBSD.ORG Thu May 2 12:35:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D17508E8; Thu, 2 May 2013 12:35:15 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C417E1842; Thu, 2 May 2013 12:35:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42CZFBA041547; Thu, 2 May 2013 12:35:15 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42CZFSN041546; Thu, 2 May 2013 12:35:15 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201305021235.r42CZFSN041546@svn.freebsd.org> From: Ed Maste Date: Thu, 2 May 2013 12:35:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250175 - head/sys/amd64/vmm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 12:35:15 -0000 Author: emaste Date: Thu May 2 12:35:15 2013 New Revision: 250175 URL: http://svnweb.freebsd.org/changeset/base/250175 Log: Switch to standard copyright license text The initial version of this came from Sandvine but had "PROVIDED BY NETAPP, INC" in the copyright text, presuambly because the license block was copied from another file. Replace it with standard "AUTHOR AND CONTRIBUTORS" form. Approvided by: grehan@ Modified: head/sys/amd64/vmm/vmm_instruction_emul.c Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Thu May 2 07:20:26 2013 (r250174) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Thu May 2 12:35:15 2013 (r250175) @@ -12,10 +12,10 @@ * 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 NETAPP, INC ``AS IS'' AND + * 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 NETAPP, INC OR CONTRIBUTORS BE LIABLE + * 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) From owner-svn-src-head@FreeBSD.ORG Thu May 2 12:43:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 16401BBF; Thu, 2 May 2013 12:43:57 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E2E3A1885; Thu, 2 May 2013 12:43:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42ChuGH044735; Thu, 2 May 2013 12:43:56 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42ChuMH044734; Thu, 2 May 2013 12:43:56 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201305021243.r42ChuMH044734@svn.freebsd.org> From: Rick Macklem Date: Thu, 2 May 2013 12:43:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250176 - head/usr.sbin/gssd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 12:43:57 -0000 Author: rmacklem Date: Thu May 2 12:43:56 2013 New Revision: 250176 URL: http://svnweb.freebsd.org/changeset/base/250176 Log: Fix the getpwuid_r() call in the gssd daemon so that it handles the ERANGE error return case. Without this fix, authentication of users for certain system setups could fail unexpectedly. Reported by: Elias Martenson (lokedhs@gmail.com) Tested by: Elias Martenson (earlier version) MFC after: 2 weeks Modified: head/usr.sbin/gssd/gssd.c Modified: head/usr.sbin/gssd/gssd.c ============================================================================== --- head/usr.sbin/gssd/gssd.c Thu May 2 12:35:15 2013 (r250175) +++ head/usr.sbin/gssd/gssd.c Thu May 2 12:43:56 2013 (r250176) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifndef WITHOUT_KERBEROS #include #endif @@ -557,8 +558,11 @@ gssd_pname_to_uid_1_svc(pname_to_uid_arg { gss_name_t name = gssd_find_resource(argp->pname); uid_t uid; - char buf[128]; + char buf[1024], *bufp; struct passwd pwd, *pw; + size_t buflen; + int error; + static size_t buflen_hint = 1024; memset(result, 0, sizeof(*result)); if (name) { @@ -567,7 +571,24 @@ gssd_pname_to_uid_1_svc(pname_to_uid_arg name, argp->mech, &uid); if (result->major_status == GSS_S_COMPLETE) { result->uid = uid; - getpwuid_r(uid, &pwd, buf, sizeof(buf), &pw); + buflen = buflen_hint; + for (;;) { + pw = NULL; + bufp = buf; + if (buflen > sizeof(buf)) + bufp = malloc(buflen); + if (bufp == NULL) + break; + error = getpwuid_r(uid, &pwd, bufp, buflen, + &pw); + if (error != ERANGE) + break; + if (buflen > sizeof(buf)) + free(bufp); + buflen += 1024; + if (buflen > buflen_hint) + buflen_hint = buflen; + } if (pw) { int len = NGRPS; int groups[NGRPS]; @@ -584,6 +605,8 @@ gssd_pname_to_uid_1_svc(pname_to_uid_arg result->gidlist.gidlist_len = 0; result->gidlist.gidlist_val = NULL; } + if (bufp != NULL && buflen > sizeof(buf)) + free(bufp); } } else { result->major_status = GSS_S_BAD_NAME; From owner-svn-src-head@FreeBSD.ORG Thu May 2 12:52:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0EA54ED2; Thu, 2 May 2013 12:52:50 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DCBC11904; Thu, 2 May 2013 12:52:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42Cqnst047959; Thu, 2 May 2013 12:52:49 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42CqnjQ047958; Thu, 2 May 2013 12:52:49 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201305021252.r42CqnjQ047958@svn.freebsd.org> From: Rick Macklem Date: Thu, 2 May 2013 12:52:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250177 - head/kerberos5/lib/libgssapi_krb5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 12:52:50 -0000 Author: rmacklem Date: Thu May 2 12:52:49 2013 New Revision: 250177 URL: http://svnweb.freebsd.org/changeset/base/250177 Log: Fix the getpwnam_r() call in the pname_to_uid() kerberos library function so that it handles the ERANGE error return case. Without this fix, authentication of users for certain system setups could fail unexpectedly. Reported by: Elias Martenson (lokedhs@gmail.com) Tested by: Elias Martenson (earlier version) MFC after: 2 weeks Modified: head/kerberos5/lib/libgssapi_krb5/pname_to_uid.c Modified: head/kerberos5/lib/libgssapi_krb5/pname_to_uid.c ============================================================================== --- head/kerberos5/lib/libgssapi_krb5/pname_to_uid.c Thu May 2 12:43:56 2013 (r250176) +++ head/kerberos5/lib/libgssapi_krb5/pname_to_uid.c Thu May 2 12:52:49 2013 (r250177) @@ -26,6 +26,7 @@ */ /* $FreeBSD$ */ +#include #include #include "krb5/gsskrb5_locl.h" @@ -37,8 +38,12 @@ _gsskrb5_pname_to_uid(OM_uint32 *minor_s krb5_context context; krb5_const_principal name = (krb5_const_principal) pname; krb5_error_code kret; - char lname[MAXLOGNAME + 1], buf[128]; + char lname[MAXLOGNAME + 1], buf[1024], *bufp; struct passwd pwd, *pw; + size_t buflen; + int error; + OM_uint32 ret; + static size_t buflen_hint = 1024; GSSAPI_KRB5_INIT (&context); @@ -49,11 +54,30 @@ _gsskrb5_pname_to_uid(OM_uint32 *minor_s } *minor_status = 0; - getpwnam_r(lname, &pwd, buf, sizeof(buf), &pw); + buflen = buflen_hint; + for (;;) { + pw = NULL; + bufp = buf; + if (buflen > sizeof(buf)) + bufp = malloc(buflen); + if (bufp == NULL) + break; + error = getpwnam_r(lname, &pwd, bufp, buflen, &pw); + if (error != ERANGE) + break; + if (buflen > sizeof(buf)) + free(bufp); + buflen += 1024; + if (buflen > buflen_hint) + buflen_hint = buflen; + } if (pw) { *uidp = pw->pw_uid; - return (GSS_S_COMPLETE); + ret = GSS_S_COMPLETE; } else { - return (GSS_S_FAILURE); + ret = GSS_S_FAILURE; } + if (bufp != NULL && buflen > sizeof(buf)) + free(bufp); + return (ret); } From owner-svn-src-head@FreeBSD.ORG Thu May 2 14:14:58 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 67FD4AB0; Thu, 2 May 2013 14:14:58 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 487291F1E; Thu, 2 May 2013 14:14:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42EEwCO077563; Thu, 2 May 2013 14:14:58 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42EEwI9077561; Thu, 2 May 2013 14:14:58 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201305021414.r42EEwI9077561@svn.freebsd.org> From: Steven Hartland Date: Thu, 2 May 2013 14:14:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250179 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 14:14:58 -0000 Author: smh Date: Thu May 2 14:14:57 2013 New Revision: 250179 URL: http://svnweb.freebsd.org/changeset/base/250179 Log: Update probe flow so that devices with lbp can also disable disksort. Ensure that delete_available is reset so re-probes after a media change, to one with different delete characteristics, will result in the correct methods being flagged as available. Make all ccb state changes use a consistent flow: * free() * xpt_release_ccb() * softc->state = * xpt_schedule() Reviewed by: mav Approved by: pjd (mentor) MFC after: 1 week Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Thu May 2 13:34:40 2013 (r250178) +++ head/sys/cam/scsi/scsi_da.c Thu May 2 14:14:57 2013 (r250179) @@ -2392,7 +2392,7 @@ out: if (!scsi_vpd_supported_page(periph, SVPD_BLOCK_LIMITS)) { /* Not supported skip to next probe */ - softc->state = DA_STATE_PROBE_ATA; + softc->state = DA_STATE_PROBE_BDC; goto skipstate; } @@ -2734,9 +2734,9 @@ dadone(struct cam_periph *periph, union * with the short version of the command. */ if (maxsector == 0xffffffff) { - softc->state = DA_STATE_PROBE_RC16; free(rdcap, M_SCSIDA); xpt_release_ccb(done_ccb); + softc->state = DA_STATE_PROBE_RC16; xpt_schedule(periph, priority); return; } @@ -2838,9 +2838,9 @@ dadone(struct cam_periph *periph, union (error_code == SSD_CURRENT_ERROR) && (sense_key == SSD_KEY_ILLEGAL_REQUEST)))) { softc->flags &= ~DA_FLAG_CAN_RC16; - softc->state = DA_STATE_PROBE_RC; free(rdcap, M_SCSIDA); xpt_release_ccb(done_ccb); + softc->state = DA_STATE_PROBE_RC; xpt_schedule(periph, priority); return; } else @@ -2897,36 +2897,39 @@ dadone(struct cam_periph *periph, union &softc->sysctl_task); xpt_announce_periph(periph, announce_buf); - if (lbp) { - /* - * Based on older SBC-3 spec revisions - * any of the UNMAP methods "may" be - * available via LBP given this flag so - * we flag all of them as availble and - * then remove those which further - * probes confirm aren't available - * later. - * - * We could also check readcap(16) p_type - * flag to exclude one or more invalid - * write same (X) types here - */ - dadeleteflag(softc, DA_DELETE_WS16, 1); - dadeleteflag(softc, DA_DELETE_WS10, 1); - dadeleteflag(softc, DA_DELETE_ZERO, 1); - dadeleteflag(softc, DA_DELETE_UNMAP, 1); - - softc->state = DA_STATE_PROBE_LBP; - xpt_release_ccb(done_ccb); - xpt_schedule(periph, priority); - return; - } } else { xpt_print(periph->path, "fatal error, " "could not acquire reference count\n"); } } + /* Ensure re-probe doesn't see old delete. */ + softc->delete_available = 0; + if (lbp) { + /* + * Based on older SBC-3 spec revisions + * any of the UNMAP methods "may" be + * available via LBP given this flag so + * we flag all of them as availble and + * then remove those which further + * probes confirm aren't available + * later. + * + * We could also check readcap(16) p_type + * flag to exclude one or more invalid + * write same (X) types here + */ + dadeleteflag(softc, DA_DELETE_WS16, 1); + dadeleteflag(softc, DA_DELETE_WS10, 1); + dadeleteflag(softc, DA_DELETE_ZERO, 1); + dadeleteflag(softc, DA_DELETE_UNMAP, 1); + + xpt_release_ccb(done_ccb); + softc->state = DA_STATE_PROBE_LBP; + xpt_schedule(periph, priority); + return; + } + xpt_release_ccb(done_ccb); softc->state = DA_STATE_PROBE_BDC; xpt_schedule(periph, priority); @@ -2954,8 +2957,8 @@ dadone(struct cam_periph *periph, union if (lbp->flags & SVPD_LBP_UNMAP) { free(lbp, M_SCSIDA); - softc->state = DA_STATE_PROBE_BLK_LIMITS; xpt_release_ccb(done_ccb); + softc->state = DA_STATE_PROBE_BLK_LIMITS; xpt_schedule(periph, priority); return; } @@ -2984,7 +2987,7 @@ dadone(struct cam_periph *periph, union free(lbp, M_SCSIDA); xpt_release_ccb(done_ccb); - softc->state = DA_STATE_PROBE_ATA; + softc->state = DA_STATE_PROBE_BDC; xpt_schedule(periph, priority); return; } @@ -3047,7 +3050,7 @@ dadone(struct cam_periph *periph, union free(block_limits, M_SCSIDA); xpt_release_ccb(done_ccb); - softc->state = DA_STATE_PROBE_ATA; + softc->state = DA_STATE_PROBE_BDC; xpt_schedule(periph, priority); return; } @@ -3084,8 +3087,8 @@ dadone(struct cam_periph *periph, union } free(bdc, M_SCSIDA); - softc->state = DA_STATE_PROBE_ATA; xpt_release_ccb(done_ccb); + softc->state = DA_STATE_PROBE_ATA; xpt_schedule(periph, priority); return; } From owner-svn-src-head@FreeBSD.ORG Thu May 2 14:19:43 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1308C145; Thu, 2 May 2013 14:19:43 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0472F1F6F; Thu, 2 May 2013 14:19:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42EJg1u078502; Thu, 2 May 2013 14:19:42 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42EJgT9078501; Thu, 2 May 2013 14:19:42 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201305021419.r42EJgT9078501@svn.freebsd.org> From: Steven Hartland Date: Thu, 2 May 2013 14:19:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250180 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 14:19:43 -0000 Author: smh Date: Thu May 2 14:19:42 2013 New Revision: 250180 URL: http://svnweb.freebsd.org/changeset/base/250180 Log: Fix probe in progress check in dareprobe Reviewed by: mav Approved by: pjd (mentor) MFC after: 1 week Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Thu May 2 14:14:57 2013 (r250179) +++ head/sys/cam/scsi/scsi_da.c Thu May 2 14:19:42 2013 (r250180) @@ -3200,7 +3200,7 @@ dareprobe(struct cam_periph *periph) softc = (struct da_softc *)periph->softc; /* Probe in progress; don't interfere. */ - if ((softc->flags & DA_FLAG_PROBED) == 0) + if (softc->state != DA_STATE_NORMAL) return; status = cam_periph_acquire(periph); From owner-svn-src-head@FreeBSD.ORG Thu May 2 14:37:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 802EE805; Thu, 2 May 2013 14:37:24 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 61AA11065; Thu, 2 May 2013 14:37:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42EbOfA085187; Thu, 2 May 2013 14:37:24 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42EbOZf085185; Thu, 2 May 2013 14:37:24 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201305021437.r42EbOZf085185@svn.freebsd.org> From: Steven Hartland Date: Thu, 2 May 2013 14:37:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250181 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 14:37:24 -0000 Author: smh Date: Thu May 2 14:37:23 2013 New Revision: 250181 URL: http://svnweb.freebsd.org/changeset/base/250181 Log: Use the existence of ATA Information VPD to determine if we should attempt to query ATA functionality via ATA Pass-Through (16) as this page is defined as "must" for SATL devices, hence indicating that the device is at least likely to support Pass-Through (16). This eliminates errors produced by CTL when ATA Pass-Through (16) fails. Switch ATA probe daerror call to SF_NO_PRINT to avoid errors printing out for devices which return invalid errors. Output details about supported and choosen delete method when verbose booted. Reviewed by: mav Approved by: pjd (mentor) MFC after: 1 week Modified: head/sys/cam/scsi/scsi_all.h head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Thu May 2 14:19:42 2013 (r250180) +++ head/sys/cam/scsi/scsi_all.h Thu May 2 14:37:23 2013 (r250181) @@ -1430,6 +1430,12 @@ struct scsi_diag_page { }; /* + * ATA Information VPD Page based on + * T10/2126-D Revision 04 + */ +#define SVPD_ATA_INFORMATION 0x89 + +/* * Block Device Characteristics VPD Page based on * T10/1799-D Revision 31 */ Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Thu May 2 14:19:42 2013 (r250180) +++ head/sys/cam/scsi/scsi_da.c Thu May 2 14:37:23 2013 (r250181) @@ -918,6 +918,7 @@ static off_t dadeletemaxsize(struct da_ da_delete_methods delete_method); static void dadeletemethodchoose(struct da_softc *softc, da_delete_methods default_method); +static void daprobedone(struct cam_periph *periph, union ccb *ccb); static periph_ctor_t daregister; static periph_dtor_t dacleanup; @@ -1680,6 +1681,65 @@ dadeletemaxsize(struct da_softc *softc, } static void +daprobedone(struct cam_periph *periph, union ccb *ccb) +{ + struct da_softc *softc; + + softc = (struct da_softc *)periph->softc; + + dadeletemethodchoose(softc, DA_DELETE_NONE); + + if (bootverbose && (softc->flags & DA_FLAG_PROBED) == 0) { + char buf[80]; + int i, sep; + + snprintf(buf, sizeof(buf), "Delete methods: <"); + sep = 0; + for (i = DA_DELETE_MIN; i <= DA_DELETE_MAX; i++) { + if (softc->delete_available & (1 << i)) { + if (sep) { + strlcat(buf, ",", sizeof(buf)); + } else { + sep = 1; + } + strlcat(buf, da_delete_method_names[i], + sizeof(buf)); + if (i == softc->delete_method) { + strlcat(buf, "(*)", sizeof(buf)); + } + } + } + if (sep == 0) { + if (softc->delete_method == DA_DELETE_NONE) + strlcat(buf, "NONE(*)", sizeof(buf)); + else + strlcat(buf, "DISABLED(*)", sizeof(buf)); + } + strlcat(buf, ">", sizeof(buf)); + printf("%s%d: %s\n", periph->periph_name, + periph->unit_number, buf); + } + + /* + * Since our peripheral may be invalidated by an error + * above or an external event, we must release our CCB + * before releasing the probe lock on the peripheral. + * The peripheral will only go away once the last lock + * is removed, and we need it around for the CCB release + * operation. + */ + xpt_release_ccb(ccb); + softc->state = DA_STATE_NORMAL; + daschedule(periph); + wakeup(&softc->disk->d_mediasize); + if ((softc->flags & DA_FLAG_PROBED) == 0) { + softc->flags |= DA_FLAG_PROBED; + cam_periph_unhold(periph); + } else + cam_periph_release_locked(periph); +} + +static void dadeletemethodchoose(struct da_softc *softc, da_delete_methods default_method) { int i, delete_method; @@ -2457,6 +2517,11 @@ out: { struct ata_params *ata_params; + if (!scsi_vpd_supported_page(periph, SVPD_ATA_INFORMATION)) { + daprobedone(periph, start_ccb); + break; + } + ata_params = (struct ata_params*) malloc(sizeof(*ata_params), M_SCSIDA, M_NOWAIT|M_ZERO); @@ -3121,7 +3186,7 @@ dadone(struct cam_periph *periph, union } else { int error; error = daerror(done_ccb, CAM_RETRY_SELTO, - SF_RETRY_UA|SF_QUIET_IR); + SF_RETRY_UA|SF_NO_PRINT); if (error == ERESTART) return; else if (error != 0) { @@ -3137,24 +3202,7 @@ dadone(struct cam_periph *periph, union } free(ata_params, M_SCSIDA); - dadeletemethodchoose(softc, DA_DELETE_NONE); - /* - * Since our peripheral may be invalidated by an error - * above or an external event, we must release our CCB - * before releasing the probe lock on the peripheral. - * The peripheral will only go away once the last lock - * is removed, and we need it around for the CCB release - * operation. - */ - xpt_release_ccb(done_ccb); - softc->state = DA_STATE_NORMAL; - daschedule(periph); - wakeup(&softc->disk->d_mediasize); - if ((softc->flags & DA_FLAG_PROBED) == 0) { - softc->flags |= DA_FLAG_PROBED; - cam_periph_unhold(periph); - } else - cam_periph_release_locked(periph); + daprobedone(periph, done_ccb); return; } case DA_CCB_WAITING: From owner-svn-src-head@FreeBSD.ORG Thu May 2 14:55:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5B734E13; Thu, 2 May 2013 14:55:22 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4D6611157; Thu, 2 May 2013 14:55:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42EtMqG091820; Thu, 2 May 2013 14:55:22 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42EtM09091819; Thu, 2 May 2013 14:55:22 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201305021455.r42EtM09091819@svn.freebsd.org> From: Davide Italiano Date: Thu, 2 May 2013 14:55:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250182 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 14:55:22 -0000 Author: davide Date: Thu May 2 14:55:21 2013 New Revision: 250182 URL: http://svnweb.freebsd.org/changeset/base/250182 Log: Suppress a GCC warning. This warning is actually bogus and newer GCC versions than the one in base (dim@ mentioned he tried on 4.7.3 and 4.8.1) do not whine about it, so, at some point this workaround will be reverted. Reported by: ache Discussed with: dim Modified: head/sys/dev/hwpmc/hwpmc_core.c Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Thu May 2 14:37:23 2013 (r250181) +++ head/sys/dev/hwpmc/hwpmc_core.c Thu May 2 14:55:21 2013 (r250182) @@ -1945,7 +1945,7 @@ iap_allocate_pmc(int cpu, int ri, struct caps = a->pm_caps; if ((IAP_PMC_CAPS & caps) != caps) return (EPERM); - + map = 0; /* XXX: silent GCC warning */ arch = iap_is_event_architectural(pm->pm_event, &map); if (arch == EV_IS_ARCH_NOTSUPP) return (EOPNOTSUPP); From owner-svn-src-head@FreeBSD.ORG Thu May 2 15:03:30 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A7D6E12E; Thu, 2 May 2013 15:03:30 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 99B8411B6; Thu, 2 May 2013 15:03:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42F3UwQ095053; Thu, 2 May 2013 15:03:30 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42F3UBU095052; Thu, 2 May 2013 15:03:30 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201305021503.r42F3UBU095052@svn.freebsd.org> From: Steven Hartland Date: Thu, 2 May 2013 15:03:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250183 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 15:03:30 -0000 Author: smh Date: Thu May 2 15:03:30 2013 New Revision: 250183 URL: http://svnweb.freebsd.org/changeset/base/250183 Log: Enable CAM SCSI to choice ATA TRIM during autodetection and correct method names after increasing the priority of ATA TRIM. Reviewed by: mav Approved by: pjd (mentor) MFC after: 1 week Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Thu May 2 14:55:21 2013 (r250182) +++ head/sys/cam/scsi/scsi_da.c Thu May 2 15:03:30 2013 (r250183) @@ -133,14 +133,14 @@ typedef enum { DA_DELETE_WS16, DA_DELETE_WS10, DA_DELETE_ZERO, - DA_DELETE_MIN = DA_DELETE_UNMAP, + DA_DELETE_MIN = DA_DELETE_ATA_TRIM, DA_DELETE_MAX = DA_DELETE_ZERO } da_delete_methods; static const char *da_delete_method_names[] = - { "NONE", "DISABLE", "UNMAP", "ATA_TRIM", "WS16", "WS10", "ZERO" }; + { "NONE", "DISABLE", "ATA_TRIM", "UNMAP", "WS16", "WS10", "ZERO" }; static const char *da_delete_method_desc[] = - { "NONE", "DISABLED", "UNMAP", "ATA TRIM", "WRITE SAME(16) with UNMAP", + { "NONE", "DISABLED", "ATA TRIM", "UNMAP", "WRITE SAME(16) with UNMAP", "WRITE SAME(10) with UNMAP", "ZERO" }; /* Offsets into our private area for storing information */ From owner-svn-src-head@FreeBSD.ORG Thu May 2 16:01:05 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3E57467F; Thu, 2 May 2013 16:01:05 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 306E91604; Thu, 2 May 2013 16:01:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42G15XQ015730; Thu, 2 May 2013 16:01:05 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42G14Lx015724; Thu, 2 May 2013 16:01:04 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201305021601.r42G14Lx015724@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 2 May 2013 16:01:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250184 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 16:01:05 -0000 Author: luigi Date: Thu May 2 16:01:04 2013 New Revision: 250184 URL: http://svnweb.freebsd.org/changeset/base/250184 Log: remove trailing whitespace Modified: head/sys/dev/netmap/if_em_netmap.h head/sys/dev/netmap/if_re_netmap.h head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_mem2.c Modified: head/sys/dev/netmap/if_em_netmap.h ============================================================================== --- head/sys/dev/netmap/if_em_netmap.h Thu May 2 15:03:30 2013 (r250183) +++ head/sys/dev/netmap/if_em_netmap.h Thu May 2 16:01:04 2013 (r250184) @@ -276,7 +276,7 @@ em_netmap_rxsync(struct ifnet *ifp, u_in k = ring->cur; if (k > lim) return netmap_ring_reinit(kring); - + if (do_lock) EM_RX_LOCK(rxr); Modified: head/sys/dev/netmap/if_re_netmap.h ============================================================================== --- head/sys/dev/netmap/if_re_netmap.h Thu May 2 15:03:30 2013 (r250183) +++ head/sys/dev/netmap/if_re_netmap.h Thu May 2 16:01:04 2013 (r250184) @@ -150,7 +150,7 @@ re_netmap_txsync(struct ifnet *ifp, u_in /* update avail to what the kernel knows */ ring->avail = kring->nr_hwavail; - + j = kring->nr_hwcur; if (j != k) { /* we have new packets to send */ l = sc->rl_ldata.rl_tx_prodidx; @@ -169,7 +169,7 @@ re_netmap_txsync(struct ifnet *ifp, u_in // XXX what about prodidx ? return netmap_ring_reinit(kring); } - + if (l == lim) /* mark end of ring */ cmd |= RL_TDESC_CMD_EOR; @@ -334,7 +334,7 @@ re_netmap_rxsync(struct ifnet *ifp, u_in */ static void re_netmap_tx_init(struct rl_softc *sc) -{ +{ struct rl_txdesc *txd; struct rl_desc *desc; int i, n; Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Thu May 2 15:03:30 2013 (r250183) +++ head/sys/dev/netmap/netmap.c Thu May 2 16:01:04 2013 (r250184) @@ -168,10 +168,10 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, bridge #endif /* !linux */ -/* +/* * These are used to handle reference counters for bridge ports. */ -#define ADD_BDG_REF(ifp) refcount_acquire(&NA(ifp)->na_bdg_refcount) +#define ADD_BDG_REF(ifp) refcount_acquire(&NA(ifp)->na_bdg_refcount) #define DROP_BDG_REF(ifp) refcount_release(&NA(ifp)->na_bdg_refcount) static void bdg_netmap_attach(struct ifnet *ifp); @@ -313,7 +313,7 @@ netmap_update_config(struct netmap_adapt txd = na->num_tx_desc; rxr = na->num_rx_rings; rxd = na->num_rx_desc; - } + } if (na->num_tx_rings == txr && na->num_tx_desc == txd && na->num_rx_rings == rxr && na->num_rx_desc == rxd) Modified: head/sys/dev/netmap/netmap_mem2.c ============================================================================== --- head/sys/dev/netmap/netmap_mem2.c Thu May 2 15:03:30 2013 (r250183) +++ head/sys/dev/netmap/netmap_mem2.c Thu May 2 16:01:04 2013 (r250184) @@ -101,7 +101,7 @@ // #define NMA_LOCK_T safe_spinlock_t #define NMA_LOCK_T struct semaphore #define NMA_LOCK_INIT() sema_init(&nm_mem.nm_mtx, 1) -#define NMA_LOCK_DESTROY() +#define NMA_LOCK_DESTROY() #define NMA_LOCK() down(&nm_mem.nm_mtx) #define NMA_UNLOCK() up(&nm_mem.nm_mtx) #else /* !linux */ @@ -527,12 +527,12 @@ netmap_config_obj_allocator(struct netma objsize += LINE_ROUND - i; } if (objsize < p->objminsize || objsize > p->objmaxsize) { - D("requested objsize %d out of range [%d, %d]", + D("requested objsize %d out of range [%d, %d]", objsize, p->objminsize, p->objmaxsize); goto error; } if (objtotal < p->nummin || objtotal > p->nummax) { - D("requested objtotal %d out of range [%d, %d]", + D("requested objtotal %d out of range [%d, %d]", objtotal, p->nummin, p->nummax); goto error; } @@ -693,7 +693,7 @@ netmap_memory_config(void) /* reset previous allocation */ for (i = 0; i < NETMAP_POOLS_NR; i++) { netmap_reset_obj_allocator(&nm_mem.pools[i]); - } + } nm_mem.finalized = 0; } From owner-svn-src-head@FreeBSD.ORG Thu May 2 16:09:07 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3D07298E; Thu, 2 May 2013 16:09:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2F26C16D7; Thu, 2 May 2013 16:09:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42G97st017407; Thu, 2 May 2013 16:09:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42G97oM017406; Thu, 2 May 2013 16:09:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201305021609.r42G97oM017406@svn.freebsd.org> From: Alexander Motin Date: Thu, 2 May 2013 16:09:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250185 - head/sys/dev/ahci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 16:09:07 -0000 Author: mav Date: Thu May 2 16:09:06 2013 New Revision: 250185 URL: http://svnweb.freebsd.org/changeset/base/250185 Log: Add IDs for HighPoint RocketRAID 640L/642L/644L -- new series of 4-port 6Gbps PCIe 2.0 x2 SATA controllers, based on Marvell 88SE9235 chips. MFC after: 1 week Modified: head/sys/dev/ahci/ahci.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Thu May 2 16:01:04 2013 (r250184) +++ head/sys/dev/ahci/ahci.c Thu May 2 16:09:06 2013 (r250185) @@ -223,6 +223,9 @@ static struct { {0x06401b4b, 0x00, "HighPoint RocketRAID 640", AHCI_Q_NOBSYRES}, {0x06441103, 0x00, "HighPoint RocketRAID 644", AHCI_Q_NOBSYRES}, {0x06441b4b, 0x00, "HighPoint RocketRAID 644", AHCI_Q_NOBSYRES}, + {0x06411103, 0x00, "HighPoint RocketRAID 640L", AHCI_Q_NOBSYRES}, + {0x06421103, 0x00, "HighPoint RocketRAID 642L", AHCI_Q_NOBSYRES}, + {0x06451103, 0x00, "HighPoint RocketRAID 644L", AHCI_Q_NOBSYRES}, {0x044c10de, 0x00, "NVIDIA MCP65", AHCI_Q_NOAA}, {0x044d10de, 0x00, "NVIDIA MCP65", AHCI_Q_NOAA}, {0x044e10de, 0x00, "NVIDIA MCP65", AHCI_Q_NOAA}, From owner-svn-src-head@FreeBSD.ORG Thu May 2 17:02:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0D961947; Thu, 2 May 2013 17:02:52 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F39EE1A85; Thu, 2 May 2013 17:02:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42H2oOO036780; Thu, 2 May 2013 17:02:50 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42H2o5n036779; Thu, 2 May 2013 17:02:50 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305021702.r42H2o5n036779@svn.freebsd.org> From: Eitan Adler Date: Thu, 2 May 2013 17:02:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250186 - head/sbin/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 17:02:52 -0000 Author: eadler Date: Thu May 2 17:02:50 2013 New Revision: 250186 URL: http://svnweb.freebsd.org/changeset/base/250186 Log: Prefer using the C++ version of the standard headers. These place the names within the std namespace (and possibly within the global namespace). The main advantage is that the C++ versions can provide optimized versions or simplified interfaces. Modified: head/sbin/devd/devd.cc Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Thu May 2 16:09:06 2013 (r250185) +++ head/sbin/devd/devd.cc Thu May 2 17:02:50 2013 (r250186) @@ -73,19 +73,20 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include +#include +#include +#include +#include +#include + #include -#include #include #include #include #include #include #include -#include -#include -#include -#include #include #include From owner-svn-src-head@FreeBSD.ORG Thu May 2 17:09:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B9C33B51; Thu, 2 May 2013 17:09:00 +0000 (UTC) (envelope-from prvs=1834ac79c3=killing@multiplay.co.uk) Received: from mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) by mx1.freebsd.org (Postfix) with ESMTP id ADC791AC5; Thu, 2 May 2013 17:08:59 +0000 (UTC) Received: from r2d2 ([46.65.172.4]) by mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) (MDaemon PRO v10.0.4) with ESMTP id md50003607436.msg; Thu, 02 May 2013 18:08:51 +0100 X-Spam-Processed: mail1.multiplay.co.uk, Thu, 02 May 2013 18:08:51 +0100 (not processed: message from valid local sender) X-MDDKIM-Result: neutral (mail1.multiplay.co.uk) X-MDRemoteIP: 46.65.172.4 X-Return-Path: prvs=1834ac79c3=killing@multiplay.co.uk X-Envelope-From: killing@multiplay.co.uk Message-ID: <8323FBAA5BD84C7D948801DB8E15D12D@multiplay.co.uk> From: "Steven Hartland" To: "Kenneth D. Merry" References: <201304261617.r3QGH58Q048395@svn.freebsd.org> <20130429225641.GA1375@nargothrond.kdm.org> <8C38141DA56442218C71EDCBA9790CF8@multiplay.co.uk> <20130501035832.GB79864@nargothrond.kdm.org> Subject: Re: svn commit: r249939 - head/sys/cam/scsi Date: Thu, 2 May 2013 18:09:29 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, trasz@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 17:09:00 -0000 ----- Original Message ----- From: "Kenneth D. Merry" > On Tue, Apr 30, 2013 at 04:16:49 +0100, Steven Hartland wrote: >> ----- Original Message ----- >> From: "Steven Hartland" >> >>On Fri, Apr 26, 2013 at 16:17:05 +0000, Steven Hartland wrote: >> >>>Author: smh >> >>>Date: Fri Apr 26 16:17:04 2013 >> >>>New Revision: 249939 >> >>>URL: http://svnweb.freebsd.org/changeset/base/249939 >> >>> >> >>>Log: >> >>> Added available delete methods discovery during device probe, >> >>> including the >> >>> maximum sizes for said methods, which are used when processing >> >>> BIO_DELETE >> >>> requests. This includes updating UNMAP support discovery to be based on >> >>> SBC-3 T10/1799-D Revision 31 specification. >> >>> Added ATA TRIM support to cam scsi devices via ATA Pass-Through(16) >> >>> sys/cam/scsi/scsi_da.c: >> >>> - Added ATA Data Set Management TRIM support via ATA >> >>> Pass-Through(16) >> >>> as a delete_method >> >>> >> >> >> >>This adds a lot of unnecessary verbosity for devices that don't support >> >>ATA >> >>passthrough. For example: >> >> >> >>(da7:iscsi4:0:0:0): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 >> >>00 00 00 00 00 00 00 40 ec 00 >> >>(da7:iscsi4:0:0:0): CAM status: SCSI Status Error >> >>(da7:iscsi4:0:0:0): SCSI status: Check Condition >> >>(da7:iscsi4:0:0:0): Retrying command (per sense data) >> >>(2:2:0:0): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 00 00 00 >> >>00 00 00 00 40 ec 00 >> >>(2:2:0:0): Tag: 0x00f6, Type: 1 >> >>(2:2:0:0): CTL Status: SCSI Error >> >>(2:2:0:0): SCSI Status: Check Condition >> >>(2:2:0:0): SCSI sense: ILLEGAL REQUEST asc:20,0 (Invalid command >> >>operation code) >> >>(2:2:0:0): Command byte 0 is invalid >> >> >> >>(da8:iscsi4:0:0:1): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 >> >>00 00 00 00 00 00 00 40 ec 00 >> >>(da8:iscsi4:0:0:1): CAM status: SCSI Status Error >> >>(da8:iscsi4:0:0:1): SCSI status: Check Condition >> >>(da8:iscsi4:0:0:1): Retrying command (per sense data) >> >>(da8:iscsi4:0:0:1): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 >> >>00 00 00 00 00 00 00 40 ec 00 >> >>(da8:iscsi4:0:0:1): CAM status: SCSI Status Error >> >>(da8:iscsi4:0:0:1): SCSI status: Check Condition >> >>(da8:iscsi4:0:0:1): Error 5, Retries exhausted >> >> >> >>That is with CTL and and trasz's new iSCSI initiator, but you should see >> >>it >> >>with any CTL configuration. (And probably with any controller or device >> >>that doesn't support ATA passthrough.) >> >> >> >>So, please: >> >>- Check for the presence of VPD page 0x89 before sending an ATA >> >> passthrough command. The spec (sat3r03 in this case) says that >> >> it "shall" be implemented, so I think we can count on that. >> >>- If the target returns an illegal request sense key, don't retry >> >> again. The target will keep returning illegal request >> > >> >Thanks for the report Ken I'll check this on a card I know doesn't support >> >pass-through. >> >> I checked with an areca controller, which I know doesn't support pass16, and >> all is quiet during boot / probe. >> >> I can provoke output at the app layer with camcontrol identify da0, which is >> to be expected, but nothing in /var/log/messages. >> >> daerror handler in scsi_da.c definitely has SF_QUIET_IR so Illegal Request >> should never be output. > > You're correct, it should not print out any messages. > >> I can't provoke this using standard CAM devices even when they don't support >> ATA Pass-Through (16) so I think this is actually an issue with CTL: >> 1. Being verbose when it shouldn't (ctl_process_done - line 12571?) > > That part at least is by design -- it prints out rate-limited messages so > you know when the initiator is sending commands CTL doesn't support. It > comes in handy for figuring out initiator problems sometimes. > >> 2. Retrying Illegal Request commands when it shouldn't (I didn't experince >> this on r250032) > > CTL doesn't do any retries, it leaves that up to the initiator. > > I finally tracked down the problem. The issue is that the iSCSI initiator > wasn't setting the CAM_AUTOSNS_VALID flag in the CCB status field. As a > result, only the CAM status and SCSI status fields were being printed. > SF_QUIET_IR > >> The attached patch implements a check for ATA Information VPD before >> using ATA Pass-Through (16). It's had limited testing but I have >> confirmed it eliminates the use of pass16 under CTL and still enables >> ATA TRIM under on mpt for SATA disks, so looks promising. >> >> If you could test and let me know if it works for you Ken that would >> be appreciated. > > Yes, it does work and eliminates the error message, thanks! I think it is > also a better way to go, just in case we run into a target that has an > issue with the ATA passthrough CDB. A slightly modified version of this is now in the current r250181 http://svnweb.freebsd.org/changeset/base/250181 >> The test case I used for CTL was:- >> kldload ctl >> ctladm create -b ramdisk -s 10485760 >> ctladm port -o on >> >> As a side note while test "kldload ctl" caused kernel panic the once. > > What was the panic message? Unread portion of the kernel message buffer: ctl: CAM Target Layer loaded Fatal trap 9: general protection fault while in kernel mode cpuid = 0; apic id = 00 instruction pointer = 0x20:0xffffffff8029c860 stack pointer = 0x28:0xffffff823b8dc840 frame pointer = 0x28:0xffffff823b8dc910 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 4 (xpt_thrd) > This doesn't look like a CTL-specific problem (not on the surface), but > rather a more general CAM problem: > >> #8 0xffffffff8073e1f2 in calltrap () at >> /usr/home/smh/freebsd/base/head/sys/amd64/amd64/exception.S:228 >> #9 0xffffffff8029c860 in cam_periph_alloc (periph_ctor=0xffffffff802af410 >> , periph_oninvalidate=0xfffffe0019cfa200, periph_dtor=> optimized out>, periph_start=0xfffffe0015980a90, name=> out>, type=2159638184, >> path=0xfffffe0015ad79a0, ac_callback=, code=> optimized out>) at /usr/home/smh/freebsd/base/head/sys/cam/cam_periph.c:227 >> #10 0xffffffff802aed6b in scsi_scan_lun (request_ccb=) >> at /usr/home/smh/freebsd/base/head/sys/cam/scsi/scsi_xpt.c:2266 >> #11 0xffffffff802b2859 in scsi_scan_bus (periph=0x0, >> request_ccb=0xfffffe00234df000) at >> /usr/home/smh/freebsd/base/head/sys/cam/scsi/scsi_xpt.c:1969 >> #12 0xffffffff802a66c5 in xpt_scanner_thread (dummy=) >> at /usr/home/smh/freebsd/base/head/sys/cam/cam_xpt.c:2411 >> #13 0xffffffff8055cde4 in fork_exit (callout=0xffffffff802a6650 >> , arg=0x0, frame=0xffffff823b8dcc00) at >> /usr/home/smh/freebsd/base/head/sys/kern/kern_fork.c:991 >> #14 0xffffffff8073e72e in fork_trampoline () at >> /usr/home/smh/freebsd/base/head/sys/amd64/amd64/exception.S:602 >> #15 0x0000000000000000 in ?? () > > If this is on a stock FreeBSD/head, it looks like it failed on this line in > cam_periph_alloc(): Apart from those patches yes stock FreeBSD/head. > cur_periph = TAILQ_FIRST(&(*p_drv)->units); > > Perhaps there's an issue with the ctl peripheral driver getting added to > the list of peripheral drivers (via periphdriver_register()). The topology > lock isn't held in periphdriver_register(), so it's possible that the > thread was in between the peripheral driver list traversal and the line > above when the peripheral was added. > > It's more likely that the scan request was generated as a result of the CTL > ports going online. And that means that the peripheral driver registration > should have long since been done. > > If you can reproduce the problem, you can probably figure out where the > issue is. I've not been able to reproduce I'm afraid, seems you cant kldunload ctl so needs a reboot between loads, tried 3 times but nothing. I did however notice the following after turning ports off, which may indicated a reference leak:- May 2 17:06:25 head kernel: (da2:ctl2cam0:0:1:0): lost device - 0 outstanding, 2 refs May 2 17:06:25 head kernel: (pass6:ctl2cam0:0:1:0): lost device May 2 17:06:25 head kernel: (pass6:ctl2cam0:0:1:0): removing device entry May 2 17:06:25 head kernel: (da2:ctl2cam0:0:1:0): removing device entry Regards Steve ================================================ This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337 or return the E.mail to postmaster@multiplay.co.uk. From owner-svn-src-head@FreeBSD.ORG Thu May 2 17:16:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 57DB91000; Thu, 2 May 2013 17:16:56 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pp1.rice.edu (proofpoint1.mail.rice.edu [128.42.201.100]) by mx1.freebsd.org (Postfix) with ESMTP id 287991B28; Thu, 2 May 2013 17:16:55 +0000 (UTC) Received: from pps.filterd (pp1.rice.edu [127.0.0.1]) by pp1.rice.edu (8.14.5/8.14.5) with SMTP id r42AnAI9020295; Thu, 2 May 2013 12:16:54 -0500 Received: from mh3.mail.rice.edu (mh3.mail.rice.edu [128.42.199.10]) by pp1.rice.edu with ESMTP id 1c3847gh73-1; Thu, 02 May 2013 12:16:54 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh3.mail.rice.edu, auth channel Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh3.mail.rice.edu (Postfix) with ESMTPSA id 3EBF14041F; Thu, 2 May 2013 12:16:53 -0500 (CDT) Message-ID: <51829F82.6050402@rice.edu> Date: Thu, 02 May 2013 12:16:50 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/20130127 Thunderbird/17.0.2 MIME-Version: 1.0 To: David Xu Subject: Re: svn commit: r249605 - head/sys/vm References: <201304180534.r3I5YXK4015577@svn.freebsd.org> <5181E1E7.3090708@freebsd.org> In-Reply-To: <5181E1E7.3090708@freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Alan Cox , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 17:16:56 -0000 On 05/01/2013 22:47, David Xu wrote: > On 2013/04/18 13:34, Alan Cox wrote: >> Author: alc >> Date: Thu Apr 18 05:34:33 2013 >> New Revision: 249605 >> URL: http://svnweb.freebsd.org/changeset/base/249605 >> >> Log: >> When calculating the number of reserved nodes, discount the pages >> that will >> be used to store the nodes. >> >> Sponsored by: EMC / Isilon Storage Division >> >> Modified: >> head/sys/vm/vm_radix.c >> >> Modified: head/sys/vm/vm_radix.c >> ============================================================================== >> >> --- head/sys/vm/vm_radix.c Thu Apr 18 05:12:11 2013 (r249604) >> +++ head/sys/vm/vm_radix.c Thu Apr 18 05:34:33 2013 (r249605) >> @@ -360,10 +360,17 @@ vm_radix_node_zone_init(void *mem, int s >> static void >> vm_radix_prealloc(void *arg __unused) >> { >> + int nodes; >> >> - if (!uma_zone_reserve_kva(vm_radix_node_zone, cnt.v_page_count)) >> + /* >> + * Calculate the number of reserved nodes, discounting the pages >> that >> + * are needed to store them. >> + */ >> + nodes = ((vm_paddr_t)cnt.v_page_count * PAGE_SIZE) / (PAGE_SIZE + >> + sizeof(struct vm_radix_node)); >> + if (!uma_zone_reserve_kva(vm_radix_node_zone, nodes)) >> panic("%s: unable to create new zone", __func__); >> - uma_prealloc(vm_radix_node_zone, cnt.v_page_count); >> + uma_prealloc(vm_radix_node_zone, nodes); >> } >> SYSINIT(vm_radix_prealloc, SI_SUB_KMEM, SI_ORDER_SECOND, >> vm_radix_prealloc, >> NULL); >> > > FYI, after this change, my network card no longer works, the > driver /sys/dev/if_msk.c reports watchdog timeout, backing out > this change works again for me. The only effect of this change should be to reduce the amount of kernel virtual and physical memory preallocated for radix tree nodes by a few percent. I really can't imagine how that impacts the operation of the if_msk.c driver. Can you send me additional info on the affected machine off list? Also, if possible, I'd like to know the values of "nodes" and "cnt.v_page_count". Alan From owner-svn-src-head@FreeBSD.ORG Thu May 2 17:23:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0F91D299; Thu, 2 May 2013 17:23:26 +0000 (UTC) (envelope-from ken@kdm.org) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) by mx1.freebsd.org (Postfix) with ESMTP id A3B771B9B; Thu, 2 May 2013 17:23:25 +0000 (UTC) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.14.2/8.14.2) with ESMTP id r42HNJ3M006724; Thu, 2 May 2013 11:23:19 -0600 (MDT) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id r42HNJKu006723; Thu, 2 May 2013 11:23:19 -0600 (MDT) (envelope-from ken) Date: Thu, 2 May 2013 11:23:19 -0600 From: "Kenneth D. Merry" To: Steven Hartland Subject: Re: svn commit: r249939 - head/sys/cam/scsi Message-ID: <20130502172319.GA6226@nargothrond.kdm.org> References: <201304261617.r3QGH58Q048395@svn.freebsd.org> <20130429225641.GA1375@nargothrond.kdm.org> <8C38141DA56442218C71EDCBA9790CF8@multiplay.co.uk> <20130501035832.GB79864@nargothrond.kdm.org> <8323FBAA5BD84C7D948801DB8E15D12D@multiplay.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8323FBAA5BD84C7D948801DB8E15D12D@multiplay.co.uk> User-Agent: Mutt/1.4.2i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, trasz@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 17:23:26 -0000 On Thu, May 02, 2013 at 18:09:29 +0100, Steven Hartland wrote: > > ----- Original Message ----- > From: "Kenneth D. Merry" > > >On Tue, Apr 30, 2013 at 04:16:49 +0100, Steven Hartland wrote: > >>----- Original Message ----- > >>From: "Steven Hartland" > >>>>On Fri, Apr 26, 2013 at 16:17:05 +0000, Steven Hartland wrote: > >>>>>Author: smh > >>>>>Date: Fri Apr 26 16:17:04 2013 > >>>>>New Revision: 249939 > >>>>>URL: http://svnweb.freebsd.org/changeset/base/249939 > >>>>> > >>>>>Log: > >>>>> Added available delete methods discovery during device probe, > >>>>> including the > >>>>> maximum sizes for said methods, which are used when processing > >>>>> BIO_DELETE > >>>>> requests. This includes updating UNMAP support discovery to be based > >>on > >>>>> SBC-3 T10/1799-D Revision 31 specification. > >>>>> Added ATA TRIM support to cam scsi devices via ATA Pass-Through(16) > >>>>> sys/cam/scsi/scsi_da.c: > >>>>> - Added ATA Data Set Management TRIM support via ATA > >>>>> Pass-Through(16) > >>>>> as a delete_method > >>>>> > >>>> > >>>>This adds a lot of unnecessary verbosity for devices that don't support > >>>>ATA > >>>>passthrough. For example: > >>>> > >>>>(da7:iscsi4:0:0:0): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 > >>02 >>00 00 00 00 00 00 00 40 ec 00 > >>>>(da7:iscsi4:0:0:0): CAM status: SCSI Status Error > >>>>(da7:iscsi4:0:0:0): SCSI status: Check Condition > >>>>(da7:iscsi4:0:0:0): Retrying command (per sense data) > >>>>(2:2:0:0): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 02 00 00 > >>00 >>00 00 00 00 40 ec 00 > >>>>(2:2:0:0): Tag: 0x00f6, Type: 1 > >>>>(2:2:0:0): CTL Status: SCSI Error > >>>>(2:2:0:0): SCSI Status: Check Condition > >>>>(2:2:0:0): SCSI sense: ILLEGAL REQUEST asc:20,0 (Invalid command > >>>>operation code) > >>>>(2:2:0:0): Command byte 0 is invalid > >>>> > >>>>(da8:iscsi4:0:0:1): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 > >>02 >>00 00 00 00 00 00 00 40 ec 00 > >>>>(da8:iscsi4:0:0:1): CAM status: SCSI Status Error > >>>>(da8:iscsi4:0:0:1): SCSI status: Check Condition > >>>>(da8:iscsi4:0:0:1): Retrying command (per sense data) > >>>>(da8:iscsi4:0:0:1): ATA COMMAND PASS THROUGH(16). CDB: 85 08 0a 00 00 > >>02 >>00 00 00 00 00 00 00 40 ec 00 > >>>>(da8:iscsi4:0:0:1): CAM status: SCSI Status Error > >>>>(da8:iscsi4:0:0:1): SCSI status: Check Condition > >>>>(da8:iscsi4:0:0:1): Error 5, Retries exhausted > >>>> > >>>>That is with CTL and and trasz's new iSCSI initiator, but you should > >>see >>it > >>>>with any CTL configuration. (And probably with any controller or device > >>>>that doesn't support ATA passthrough.) > >>>> > >>>>So, please: > >>>>- Check for the presence of VPD page 0x89 before sending an ATA > >>>> passthrough command. The spec (sat3r03 in this case) says that > >>>> it "shall" be implemented, so I think we can count on that. > >>>>- If the target returns an illegal request sense key, don't retry > >>>> again. The target will keep returning illegal request > >>> > >>>Thanks for the report Ken I'll check this on a card I know doesn't > >>support > >>>pass-through. > >> > >>I checked with an areca controller, which I know doesn't support pass16, > >>and > >>all is quiet during boot / probe. > >> > >>I can provoke output at the app layer with camcontrol identify da0, which > >>is > >>to be expected, but nothing in /var/log/messages. > >> > >>daerror handler in scsi_da.c definitely has SF_QUIET_IR so Illegal Request > >>should never be output. > > > >You're correct, it should not print out any messages. > > > >>I can't provoke this using standard CAM devices even when they don't > >>support > >>ATA Pass-Through (16) so I think this is actually an issue with CTL: > >>1. Being verbose when it shouldn't (ctl_process_done - line 12571?) > > > >That part at least is by design -- it prints out rate-limited messages so > >you know when the initiator is sending commands CTL doesn't support. It > >comes in handy for figuring out initiator problems sometimes. > > > >>2. Retrying Illegal Request commands when it shouldn't (I didn't experince > >>this on r250032) > > > >CTL doesn't do any retries, it leaves that up to the initiator. > > > >I finally tracked down the problem. The issue is that the iSCSI initiator > >wasn't setting the CAM_AUTOSNS_VALID flag in the CCB status field. As a > >result, only the CAM status and SCSI status fields were being printed. > >SF_QUIET_IR > > > >>The attached patch implements a check for ATA Information VPD before > >>using ATA Pass-Through (16). It's had limited testing but I have > >>confirmed it eliminates the use of pass16 under CTL and still enables > >>ATA TRIM under on mpt for SATA disks, so looks promising. > >> > >>If you could test and let me know if it works for you Ken that would > >>be appreciated. > > > >Yes, it does work and eliminates the error message, thanks! I think it is > >also a better way to go, just in case we run into a target that has an > >issue with the ATA passthrough CDB. > > A slightly modified version of this is now in the current r250181 > http://svnweb.freebsd.org/changeset/base/250181 > > >>The test case I used for CTL was:- > >>kldload ctl > >>ctladm create -b ramdisk -s 10485760 > >>ctladm port -o on > >> > >>As a side note while test "kldload ctl" caused kernel panic the once. > > > >What was the panic message? > > Unread portion of the kernel message buffer: > ctl: CAM Target Layer loaded > > Fatal trap 9: general protection fault while in kernel mode > cpuid = 0; apic id = 00 > instruction pointer = 0x20:0xffffffff8029c860 > stack pointer = 0x28:0xffffff823b8dc840 > frame pointer = 0x28:0xffffff823b8dc910 > code segment = base 0x0, limit 0xfffff, type 0x1b > = DPL 0, pres 1, long 1, def32 0, gran 1 > processor eflags = interrupt enabled, resume, IOPL = 0 > current process = 4 (xpt_thrd) > > >This doesn't look like a CTL-specific problem (not on the surface), but > >rather a more general CAM problem: > > > >>#8 0xffffffff8073e1f2 in calltrap () at > >>/usr/home/smh/freebsd/base/head/sys/amd64/amd64/exception.S:228 > >>#9 0xffffffff8029c860 in cam_periph_alloc > >>(periph_ctor=0xffffffff802af410 , > >>periph_oninvalidate=0xfffffe0019cfa200, periph_dtor= >>out>, periph_start=0xfffffe0015980a90, name=, > >>type=2159638184, > >> path=0xfffffe0015ad79a0, ac_callback=, > >> code=) at > >> /usr/home/smh/freebsd/base/head/sys/cam/cam_periph.c:227 > >>#10 0xffffffff802aed6b in scsi_scan_lun (request_ccb= >>out>) at /usr/home/smh/freebsd/base/head/sys/cam/scsi/scsi_xpt.c:2266 > >>#11 0xffffffff802b2859 in scsi_scan_bus (periph=0x0, > >>request_ccb=0xfffffe00234df000) at > >>/usr/home/smh/freebsd/base/head/sys/cam/scsi/scsi_xpt.c:1969 > >>#12 0xffffffff802a66c5 in xpt_scanner_thread (dummy= >>out>) at /usr/home/smh/freebsd/base/head/sys/cam/cam_xpt.c:2411 > >>#13 0xffffffff8055cde4 in fork_exit (callout=0xffffffff802a6650 > >>, arg=0x0, frame=0xffffff823b8dcc00) at > >>/usr/home/smh/freebsd/base/head/sys/kern/kern_fork.c:991 > >>#14 0xffffffff8073e72e in fork_trampoline () at > >>/usr/home/smh/freebsd/base/head/sys/amd64/amd64/exception.S:602 > >>#15 0x0000000000000000 in ?? () > > > >If this is on a stock FreeBSD/head, it looks like it failed on this line in > >cam_periph_alloc(): > > Apart from those patches yes stock FreeBSD/head. Okay. > > cur_periph = TAILQ_FIRST(&(*p_drv)->units); > > > >Perhaps there's an issue with the ctl peripheral driver getting added to > >the list of peripheral drivers (via periphdriver_register()). The topology > >lock isn't held in periphdriver_register(), so it's possible that the > >thread was in between the peripheral driver list traversal and the line > >above when the peripheral was added. > > > >It's more likely that the scan request was generated as a result of the CTL > >ports going online. And that means that the peripheral driver registration > >should have long since been done. > > > >If you can reproduce the problem, you can probably figure out where the > >issue is. > > I've not been able to reproduce I'm afraid, seems you cant kldunload ctl > so needs a reboot between loads, tried 3 times but nothing. Thanks for trying, I'll be on the lookout for any other reports. > I did however notice the following after turning ports off, which may > indicated a reference leak:- > > May 2 17:06:25 head kernel: (da2:ctl2cam0:0:1:0): lost device - 0 > outstanding, 2 refs > May 2 17:06:25 head kernel: (pass6:ctl2cam0:0:1:0): lost device > May 2 17:06:25 head kernel: (pass6:ctl2cam0:0:1:0): removing device entry > May 2 17:06:25 head kernel: (da2:ctl2cam0:0:1:0): removing device entry The references are normal. The da(4) driver keeps one reference for GEOM until GEOM calls it back after cleaning up its resources. (That's the reference released in dadiskgonecb().) It also has a reference for each open call, and acquires references during probe for things like the sysctl variable initialization. The key thing is the last line, "removing device entry", since it means that every context that has a reference into the da(4) driver has cleaned it up so it can be removed. Ken -- Kenneth Merry ken@FreeBSD.ORG From owner-svn-src-head@FreeBSD.ORG Thu May 2 18:08:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 02E29EE0; Thu, 2 May 2013 18:08:34 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-ee0-f43.google.com (mail-ee0-f43.google.com [74.125.83.43]) by mx1.freebsd.org (Postfix) with ESMTP id 130A51DE5; Thu, 2 May 2013 18:08:32 +0000 (UTC) Received: by mail-ee0-f43.google.com with SMTP id b15so430257eek.16 for ; Thu, 02 May 2013 11:08:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:subject:mime-version:content-type:from:x-priority :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to:x-mailer; bh=TBoPVqo5wJRnPvoMpRJy6mbQoEetwN0uRnkrvRDef/c=; b=x14aiWiEpUFOpkWYJ42mrTePVFZjsZNdBkfXMdfVgPF85EJvsvfk/WfBclqeXUg1UV f9WoYu7yraXqE+I6c8LebhLdzdR10gJMiXGs6Uyj5zQ9b90TeTTfNTsGVXylUMMYoV3t ZpxCJGUVFvg8/A3t6tHxkM4oDc2u3P7cRDImlNI+IHUpRPBH/aiG2y4uO7yva+Ewk3PH AMBIFdBNhGW5u5tbBm8xJfZ2DEArMmn7DDenNgHhoQ+Q7OdNJB5p+ywzvd/qg+7PP7e3 3R8aBYPxoWouc5OSQDvcEfqyIoZEJklykO+MttaoIQYlFzuQreHQ3Az/y3jwOJkr0PgO +ZIQ== X-Received: by 10.15.31.197 with SMTP id y45mr22260748eeu.18.1367518106340; Thu, 02 May 2013 11:08:26 -0700 (PDT) Received: from [192.168.1.104] (45.81.datacomsa.pl. [195.34.81.45]) by mx.google.com with ESMTPSA id bp51sm9289779eeb.5.2013.05.02.11.08.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 02 May 2013 11:08:25 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Subject: Re: svn commit: r249939 - head/sys/cam/scsi Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=iso-8859-2 From: =?iso-8859-2?Q?Edward_Tomasz_Napiera=B3a?= X-Priority: 3 In-Reply-To: <8C38141DA56442218C71EDCBA9790CF8@multiplay.co.uk> Date: Thu, 2 May 2013 20:08:22 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201304261617.r3QGH58Q048395@svn.freebsd.org> <20130429225641.GA1375@nargothrond.kdm.org> <8C38141DA56442218C71EDCBA9790CF8@multiplay.co.uk> To: Steven Hartland X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@FreeBSD.org, Steven Hartland , "Kenneth D. Merry" , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 18:08:34 -0000 Wiadomo=B6=E6 napisana przez Steven Hartland w dniu 30 kwi 2013, o godz. = 05:16: [..] > If anyone's interested the trace was:- > #0 doadump (textdump=3D0) at pcpu.h:231 > #1 0xffffffff802f6d6e in db_dump (dummy=3D, = dummy2=3D0, dummy3=3D0, dummy4=3D0x0) at = /usr/home/smh/freebsd/base/head/sys/ddb/db_command.c:543 > #2 0xffffffff802f683d in db_command (cmd_table=3D) at /usr/home/smh/freebsd/base/head/sys/ddb/db_command.c:449 > #3 0xffffffff802f65b4 in db_command_loop () at = /usr/home/smh/freebsd/base/head/sys/ddb/db_command.c:502 > #4 0xffffffff802f8f50 in db_trap (type=3D, = code=3D0) at /usr/home/smh/freebsd/base/head/sys/ddb/db_main.c:231 > #5 0xffffffff805c0df3 in kdb_trap (type=3D9, code=3D0, tf=3D) at = /usr/home/smh/freebsd/base/head/sys/kern/subr_kdb.c:654 > #6 0xffffffff8075580a in trap_fatal (frame=3D0xffffff823b8dc790, = eva=3D) at = /usr/home/smh/freebsd/base/head/sys/amd64/amd64/trap.c:867 > #7 0xffffffff807554b7 in trap (frame=3D) at = /usr/home/smh/freebsd/base/head/sys/amd64/amd64/trap.c:224 > #8 0xffffffff8073e1f2 in calltrap () at = /usr/home/smh/freebsd/base/head/sys/amd64/amd64/exception.S:228 > #9 0xffffffff8029c860 in cam_periph_alloc = (periph_ctor=3D0xffffffff802af410 , = periph_oninvalidate=3D0xfffffe0019cfa200, periph_dtor=3D, periph_start=3D0xfffffe0015980a90, name=3D, = type=3D2159638184, > path=3D0xfffffe0015ad79a0, ac_callback=3D, = code=3D) at = /usr/home/smh/freebsd/base/head/sys/cam/cam_periph.c:227 > #10 0xffffffff802aed6b in scsi_scan_lun (request_ccb=3D) at = /usr/home/smh/freebsd/base/head/sys/cam/scsi/scsi_xpt.c:2266 > #11 0xffffffff802b2859 in scsi_scan_bus (periph=3D0x0, = request_ccb=3D0xfffffe00234df000) at = /usr/home/smh/freebsd/base/head/sys/cam/scsi/scsi_xpt.c:1969 > #12 0xffffffff802a66c5 in xpt_scanner_thread (dummy=3D) at /usr/home/smh/freebsd/base/head/sys/cam/cam_xpt.c:2411 I've seen a panic which is slightly different, but perhaps could be = related: #11 0xffffffff8085fde2 in __mtx_assert (c=3D0xffffff81aeccd8c0,=20 what=3D,=20 file=3D0xffffffff80e6b0aa = "/home/trasz/p4/iscsi/sys/kern/kern_cons.c",=20 line=3D128) at /home/trasz/p4/iscsi/sys/kern/kern_mutex.c:788 #12 0xffffffff802cc8e1 in xpt_compile_path (new_path=3D0xfffffe00150d7180,= =20 perph=3D0xfffffe00112e1e00, path_id=3D, = target_id=3D0,=20 lun_id=3D0) at /home/trasz/p4/iscsi/sys/cam/cam_xpt.c:4664 #13 0xffffffff802cba1b in xpt_create_path = (new_path_ptr=3D0xffffff81aeccdb50,=20 perph=3D0xfffffe00112e1e00, path_id=3D2, target_id=3D0, lun_id=3D0) at /home/trasz/p4/iscsi/sys/cam/cam_xpt.c:3398 #14 0xffffffff802dcca3 in scsi_scan_bus (periph=3D,=20= request_ccb=3D0xfffffe00157e4800) at /home/trasz/p4/iscsi/sys/cam/scsi/scsi_xpt.c:1955 #15 0xffffffff802d0ca4 in xpt_scanner_thread (dummy=3D) at /home/trasz/p4/iscsi/sys/cam/cam_xpt.c:841 It looks like it's impossible for the lock to be not owned in that code path, so it suggests some kind of memory corruption. It can be easily reproduced by creating several SIMs at the exact same time. [..] --=20 If you cut off my head, what would I say? Me and my head, or me and my = body? From owner-svn-src-head@FreeBSD.ORG Thu May 2 18:35:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8A030AA4; Thu, 2 May 2013 18:35:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7C89B1F63; Thu, 2 May 2013 18:35:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42IZCun069058; Thu, 2 May 2013 18:35:12 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42IZCe0069057; Thu, 2 May 2013 18:35:12 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305021835.r42IZCe0069057@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 2 May 2013 18:35:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250187 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 18:35:13 -0000 Author: kib Date: Thu May 2 18:35:12 2013 New Revision: 250187 URL: http://svnweb.freebsd.org/changeset/base/250187 Log: Add a hint suggesting why tmpfs does not need a special case there. Modified: head/sys/vm/vm_mmap.c Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Thu May 2 17:02:50 2013 (r250186) +++ head/sys/vm/vm_mmap.c Thu May 2 18:35:12 2013 (r250187) @@ -1289,7 +1289,7 @@ vm_mmap_vnode(struct thread *td, vm_size vp = (struct vnode *)obj->handle; /* * Bypass filesystems obey the mpsafety of the - * underlying fs. + * underlying fs. Tmpfs never bypasses. */ error = vget(vp, locktype, td); if (error != 0) From owner-svn-src-head@FreeBSD.ORG Thu May 2 18:36:53 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 298E5C25; Thu, 2 May 2013 18:36:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1C2C81F71; Thu, 2 May 2013 18:36:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42Iaqmv069376; Thu, 2 May 2013 18:36:52 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42IaqZJ069375; Thu, 2 May 2013 18:36:52 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305021836.r42IaqZJ069375@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 2 May 2013 18:36:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250188 - head/sys/fs/tmpfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 18:36:53 -0000 Author: kib Date: Thu May 2 18:36:52 2013 New Revision: 250188 URL: http://svnweb.freebsd.org/changeset/base/250188 Log: The page read or written could be wired. Do not requeue if the page is not on a queue. Reported and tested by: pho Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Thu May 2 18:35:12 2013 (r250187) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Thu May 2 18:36:52 2013 (r250188) @@ -494,7 +494,8 @@ tmpfs_nocacheread(vm_object_t tobj, vm_p vm_page_unhold(m); vm_page_deactivate(m); /* Requeue to maintain LRU ordering. */ - vm_page_requeue(m); + if (m->queue != PQ_NONE) + vm_page_requeue(m); vm_page_unlock(m); VM_OBJECT_WUNLOCK(tobj); @@ -609,7 +610,8 @@ tmpfs_mappedwrite(vm_object_t tobj, size vm_page_unhold(tpg); vm_page_deactivate(tpg); /* Requeue to maintain LRU ordering. */ - vm_page_requeue(tpg); + if (tpg->queue != PQ_NONE) + vm_page_requeue(tpg); vm_page_unlock(tpg); VM_OBJECT_WUNLOCK(tobj); From owner-svn-src-head@FreeBSD.ORG Thu May 2 18:44:32 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E2AD2FDF; Thu, 2 May 2013 18:44:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D3A2A2000; Thu, 2 May 2013 18:44:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42IiWEO072438; Thu, 2 May 2013 18:44:32 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42IiWL1072432; Thu, 2 May 2013 18:44:32 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305021844.r42IiWL1072432@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 2 May 2013 18:44:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250189 - head/sys/fs/tmpfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 18:44:33 -0000 Author: kib Date: Thu May 2 18:44:31 2013 New Revision: 250189 URL: http://svnweb.freebsd.org/changeset/base/250189 Log: For the new regular tmpfs vnode, v_object is initialized before insmntque() is called. The standard insmntque destructor resets the vop vector to deadfs one, and calls vgone() on the vnode. As result, v_object is kept unchanged, which triggers an assertion in the reclaim code, on instmntque() failure. Also, in this case, OBJ_TMPFS flag on the backed vm object is not cleared. Provide the tmpfs insmntque() destructor which properly clears OBJ_TMPFS flag and resets v_object. Reported and tested by: pho Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/tmpfs/tmpfs.h head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs.h Thu May 2 18:36:52 2013 (r250188) +++ head/sys/fs/tmpfs/tmpfs.h Thu May 2 18:44:31 2013 (r250189) @@ -402,6 +402,7 @@ int tmpfs_alloc_dirent(struct tmpfs_moun const char *, u_int, struct tmpfs_dirent **); void tmpfs_free_dirent(struct tmpfs_mount *, struct tmpfs_dirent *); void tmpfs_dirent_init(struct tmpfs_dirent *, const char *, u_int); +void tmpfs_destroy_vobject(struct vnode *vp, vm_object_t obj); int tmpfs_alloc_vp(struct mount *, struct tmpfs_node *, int, struct vnode **); void tmpfs_free_vp(struct vnode *); Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Thu May 2 18:36:52 2013 (r250188) +++ head/sys/fs/tmpfs/tmpfs_subr.c Thu May 2 18:44:31 2013 (r250189) @@ -429,6 +429,36 @@ tmpfs_free_dirent(struct tmpfs_mount *tm /* --------------------------------------------------------------------- */ +void +tmpfs_destroy_vobject(struct vnode *vp, vm_object_t obj) +{ + + if (vp->v_type != VREG || obj == NULL) + return; + + VM_OBJECT_WLOCK(obj); + VI_LOCK(vp); + vm_object_clear_flag(obj, OBJ_TMPFS); + obj->un_pager.swp.swp_tmpfs = NULL; + VI_UNLOCK(vp); + VM_OBJECT_WUNLOCK(obj); +} + +/* + * Need to clear v_object for insmntque failure. + */ +static void +tmpfs_insmntque_dtr(struct vnode *vp, void *dtr_arg) +{ + + tmpfs_destroy_vobject(vp, vp->v_object); + vp->v_object = NULL; + vp->v_data = NULL; + vp->v_op = &dead_vnodeops; + vgone(vp); + vput(vp); +} + /* * Allocates a new vnode for the node node or returns a new reference to * an existing one if the node had already a vnode referencing it. The @@ -540,7 +570,7 @@ loop: panic("tmpfs_alloc_vp: type %p %d", node, (int)node->tn_type); } - error = insmntque(vp, mp); + error = insmntque1(vp, mp, tmpfs_insmntque_dtr, NULL); if (error) vp = NULL; Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Thu May 2 18:36:52 2013 (r250188) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Thu May 2 18:44:31 2013 (r250189) @@ -1468,23 +1468,12 @@ tmpfs_reclaim(struct vop_reclaim_args *v struct tmpfs_mount *tmp; struct tmpfs_node *node; - vm_object_t obj; node = VP_TO_TMPFS_NODE(vp); tmp = VFS_TO_TMPFS(vp->v_mount); - if (node->tn_type == VREG) { - obj = node->tn_reg.tn_aobj; - if (obj != NULL) { - /* Instead of vnode_destroy_vobject() */ - VM_OBJECT_WLOCK(obj); - VI_LOCK(vp); - vm_object_clear_flag(obj, OBJ_TMPFS); - obj->un_pager.swp.swp_tmpfs = NULL; - VI_UNLOCK(vp); - VM_OBJECT_WUNLOCK(obj); - } - } + if (vp->v_type == VREG) + tmpfs_destroy_vobject(vp, node->tn_reg.tn_aobj); vp->v_object = NULL; cache_purge(vp); From owner-svn-src-head@FreeBSD.ORG Thu May 2 18:46:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BA5C01F6; Thu, 2 May 2013 18:46:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AD4A6101B; Thu, 2 May 2013 18:46:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42IkVh3072863; Thu, 2 May 2013 18:46:31 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42IkVaO072862; Thu, 2 May 2013 18:46:31 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305021846.r42IkVaO072862@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 2 May 2013 18:46:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250190 - head/sys/fs/tmpfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 18:46:31 -0000 Author: kib Date: Thu May 2 18:46:31 2013 New Revision: 250190 URL: http://svnweb.freebsd.org/changeset/base/250190 Log: Fix the v_object leak for non-regular tmpfs vnodes. Reported and tested by: pho Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Thu May 2 18:44:31 2013 (r250189) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Thu May 2 18:46:31 2013 (r250190) @@ -264,6 +264,7 @@ tmpfs_open(struct vop_open_args *v) error = EPERM; else { error = 0; + /* For regular files, the call below is nop. */ vnode_create_vobject(vp, node->tn_size, v->a_td); } @@ -1474,6 +1475,8 @@ tmpfs_reclaim(struct vop_reclaim_args *v if (vp->v_type == VREG) tmpfs_destroy_vobject(vp, node->tn_reg.tn_aobj); + else + vnode_destroy_vobject(vp); vp->v_object = NULL; cache_purge(vp); From owner-svn-src-head@FreeBSD.ORG Thu May 2 19:45:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 43807171; Thu, 2 May 2013 19:45:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 346D11292; Thu, 2 May 2013 19:45:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42JjsMu094441; Thu, 2 May 2013 19:45:54 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42JjrfX094437; Thu, 2 May 2013 19:45:53 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201305021945.r42JjrfX094437@svn.freebsd.org> From: Warner Losh Date: Thu, 2 May 2013 19:45:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250191 - head/sys/contrib/octeon-sdk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 19:45:54 -0000 Author: imp Date: Thu May 2 19:45:53 2013 New Revision: 250191 URL: http://svnweb.freebsd.org/changeset/base/250191 Log: Expose cvmx_mgmt_port_num_ports() as a wrapper to the static __cvmx_mgmt_port_num_ports() mostly to avoid exporting a function starting with __. Modified: head/sys/contrib/octeon-sdk/cvmx-mgmt-port.c head/sys/contrib/octeon-sdk/cvmx-mgmt-port.h Modified: head/sys/contrib/octeon-sdk/cvmx-mgmt-port.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-mgmt-port.c Thu May 2 18:46:31 2013 (r250190) +++ head/sys/contrib/octeon-sdk/cvmx-mgmt-port.c Thu May 2 19:45:53 2013 (r250191) @@ -126,6 +126,17 @@ static int __cvmx_mgmt_port_num_ports(vo /** + * Return the number of management ports supported on this board. + * + * @return Number of ports + */ +int cvmx_mgmt_port_num_ports(void) +{ + return __cvmx_mgmt_port_num_ports(); +} + + +/** * Called to initialize a management port for use. Multiple calls * to this function across applications is safe. * Modified: head/sys/contrib/octeon-sdk/cvmx-mgmt-port.h ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-mgmt-port.h Thu May 2 18:46:31 2013 (r250190) +++ head/sys/contrib/octeon-sdk/cvmx-mgmt-port.h Thu May 2 19:45:53 2013 (r250191) @@ -223,6 +223,13 @@ extern cvmx_helper_link_info_t cvmx_mgmt */ extern int cvmx_mgmt_port_link_set(int port, cvmx_helper_link_info_t link_info); +/** + * Return the number of management ports supported on this board. + * + * @return Number of ports + */ +extern int cvmx_mgmt_port_num_ports(void); + #ifdef __cplusplus } #endif From owner-svn-src-head@FreeBSD.ORG Thu May 2 19:47:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 72EBD2FD; Thu, 2 May 2013 19:47:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4BC8712A1; Thu, 2 May 2013 19:47:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42JlbqG094780; Thu, 2 May 2013 19:47:37 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42Jlaf3094778; Thu, 2 May 2013 19:47:36 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201305021947.r42Jlaf3094778@svn.freebsd.org> From: Warner Losh Date: Thu, 2 May 2013 19:47:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250192 - head/sys/mips/cavium/octe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 19:47:37 -0000 Author: imp Date: Thu May 2 19:47:36 2013 New Revision: 250192 URL: http://svnweb.freebsd.org/changeset/base/250192 Log: Use cvmx_mgmt_port_num_ports() instead of the inlined copy of a previous version of this function. Modified: head/sys/mips/cavium/octe/ethernet-common.c head/sys/mips/cavium/octe/wrapper-cvmx-includes.h Modified: head/sys/mips/cavium/octe/ethernet-common.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-common.c Thu May 2 19:45:53 2013 (r250191) +++ head/sys/mips/cavium/octe/ethernet-common.c Thu May 2 19:47:36 2013 (r250192) @@ -107,22 +107,7 @@ int cvm_assign_mac_address(uint64_t *mac if (cvm_oct_mac_addr == 0) return ENXIO; - /* - * The offset from mac_addr_base that should be used for the next port - * that is configured. By convention, if any mgmt ports exist on the - * chip, they get the first mac addresses. The ports controlled by - * driver that use this function are numbered sequencially following - * any mgmt addresses that may exist. - * - * XXX Would be nice if __cvmx_mgmt_port_num_ports() were - * not static to cvmx-mgmt-port.c. - */ - if (OCTEON_IS_MODEL(OCTEON_CN56XX)) - cvm_oct_mac_addr_offset = 1; - else if (OCTEON_IS_MODEL(OCTEON_CN52XX) || OCTEON_IS_MODEL(OCTEON_CN63XX)) - cvm_oct_mac_addr_offset = 2; - else - cvm_oct_mac_addr_offset = 0; + cvm_oct_mac_addr_offset = cvmx_mgmt_port_num_ports(); cvm_oct_mac_addr += cvm_oct_mac_addr_offset; } Modified: head/sys/mips/cavium/octe/wrapper-cvmx-includes.h ============================================================================== --- head/sys/mips/cavium/octe/wrapper-cvmx-includes.h Thu May 2 19:45:53 2013 (r250191) +++ head/sys/mips/cavium/octe/wrapper-cvmx-includes.h Thu May 2 19:47:36 2013 (r250192) @@ -44,6 +44,7 @@ AND WITH ALL FAULTS AND CAVIUM NETWORKS #include #include #include +#include #include #include From owner-svn-src-head@FreeBSD.ORG Thu May 2 20:00:11 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C1538681; Thu, 2 May 2013 20:00:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B3DCD1302; Thu, 2 May 2013 20:00:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r42K0B18098969; Thu, 2 May 2013 20:00:11 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r42K0Bdk098965; Thu, 2 May 2013 20:00:11 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305022000.r42K0Bdk098965@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 2 May 2013 20:00:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250193 - head/sys/fs/msdosfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 20:00:11 -0000 Author: kib Date: Thu May 2 20:00:11 2013 New Revision: 250193 URL: http://svnweb.freebsd.org/changeset/base/250193 Log: The fsync(2) call should sync the vnode in such way that even after system crash which happen after successfull fsync() return, the data is accessible. For msdosfs, this means that FAT entries for the file must be written. Since we do not track the FAT blocks containing entries for the current file, just do a sloppy sync of the devvp vnode for the mount, which buffers, among other things, contain FAT blocks. Simultaneously, for deupdat(): - optimize by clearing the modified flags before short-circuiting a return, if the mount is read-only; - only ignore the rest of the function for denode with DE_MODIFIED flag clear when the waitfor argument is false. The directory buffer for the entry might be of delayed write; - microoptimize by comparing the updated directory entry with the current block content; - try to cluster the write, fall back to bawrite() if low on resources. Based on the submission by: bde MFC after: 2 weeks Modified: head/sys/fs/msdosfs/msdosfs_denode.c head/sys/fs/msdosfs/msdosfs_vnops.c Modified: head/sys/fs/msdosfs/msdosfs_denode.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_denode.c Thu May 2 19:47:36 2013 (r250192) +++ head/sys/fs/msdosfs/msdosfs_denode.c Thu May 2 20:00:11 2013 (r250193) @@ -288,16 +288,20 @@ deupdat(dep, waitfor) struct denode *dep; int waitfor; { - int error; + struct direntry dir; + struct timespec ts; struct buf *bp; struct direntry *dirp; - struct timespec ts; + int error; - if (DETOV(dep)->v_mount->mnt_flag & MNT_RDONLY) + if (DETOV(dep)->v_mount->mnt_flag & MNT_RDONLY) { + dep->de_flag &= ~(DE_UPDATE | DE_CREATE | DE_ACCESS | + DE_MODIFIED); return (0); + } getnanotime(&ts); DETIMES(dep, &ts, &ts, &ts); - if ((dep->de_flag & DE_MODIFIED) == 0) + if ((dep->de_flag & DE_MODIFIED) == 0 && waitfor == 0) return (0); dep->de_flag &= ~DE_MODIFIED; if (dep->de_Attributes & ATTR_DIRECTORY) @@ -307,13 +311,23 @@ deupdat(dep, waitfor) error = readde(dep, &bp, &dirp); if (error) return (error); - DE_EXTERNALIZE(dirp, dep); + DE_EXTERNALIZE(&dir, dep); + if (bcmp(dirp, &dir, sizeof(dir)) == 0) { + if (waitfor == 0 || (bp->b_flags & B_DELWRI) == 0) { + brelse(bp); + return (0); + } + } else + *dirp = dir; + if ((DETOV(dep)->v_mount->mnt_flag & MNT_NOCLUSTERW) == 0) + bp->b_flags |= B_CLUSTEROK; if (waitfor) - return (bwrite(bp)); - else { + error = bwrite(bp); + else if (vm_page_count_severe() || buf_dirty_count_severe()) + bawrite(bp); + else bdwrite(bp); - return (0); - } + return (error); } /* Modified: head/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vnops.c Thu May 2 19:47:36 2013 (r250192) +++ head/sys/fs/msdosfs/msdosfs_vnops.c Thu May 2 20:00:11 2013 (r250193) @@ -850,9 +850,6 @@ errexit: /* * Flush the blocks of a file to disk. - * - * This function is worthless for vnodes that represent directories. Maybe we - * could just do a sync if they try an fsync on a directory file. */ static int msdosfs_fsync(ap) @@ -863,9 +860,35 @@ msdosfs_fsync(ap) struct thread *a_td; } */ *ap; { + struct vnode *devvp; + int allerror, error; vop_stdfsync(ap); - return (deupdat(VTODE(ap->a_vp), ap->a_waitfor == MNT_WAIT)); + + /* + * If the syncing request comes from fsync(2), sync the entire + * FAT and any other metadata that happens to be on devvp. We + * need this mainly for the FAT. We write the FAT sloppily, and + * syncing it all now is the best we can easily do to get all + * directory entries associated with the file (not just the file) + * fully synced. The other metadata includes critical metadata + * for all directory entries, but only in the MNT_ASYNC case. We + * will soon sync all metadata in the file's directory entry. + * Non-critical metadata for associated directory entries only + * gets synced accidentally, as in most file systems. + */ + if (ap->a_waitfor == MNT_WAIT) { + devvp = VTODE(ap->a_vp)->de_pmp->pm_devvp; + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); + allerror = VOP_FSYNC(devvp, MNT_WAIT, ap->a_td); + VOP_UNLOCK(devvp, 0); + } else + allerror = 0; + + error = deupdat(VTODE(ap->a_vp), ap->a_waitfor == MNT_WAIT); + if (allerror == 0) + allerror = error; + return (allerror); } static int From owner-svn-src-head@FreeBSD.ORG Fri May 3 01:16:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 74DF3EF9; Fri, 3 May 2013 01:16:19 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 67CF11F83; Fri, 3 May 2013 01:16:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r431GJai014835; Fri, 3 May 2013 01:16:19 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r431GJPi014829; Fri, 3 May 2013 01:16:19 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201305030116.r431GJPi014829@svn.freebsd.org> From: Neel Natu Date: Fri, 3 May 2013 01:16:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250197 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 01:16:19 -0000 Author: neel Date: Fri May 3 01:16:18 2013 New Revision: 250197 URL: http://svnweb.freebsd.org/changeset/base/250197 Log: Implement the NOTIFY_ON_EMPTY capability in the virtio-net device. If this capability is negotiated by the guest then the device will generate an interrupt when it runs out of available tx/rx descriptors. Reviewed by: grehan Obtained from: NetApp Modified: head/usr.sbin/bhyve/pci_virtio_net.c head/usr.sbin/bhyve/virtio.h Modified: head/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_net.c Thu May 2 21:51:57 2013 (r250196) +++ head/usr.sbin/bhyve/pci_virtio_net.c Fri May 3 01:16:18 2013 (r250197) @@ -78,7 +78,8 @@ __FBSDID("$FreeBSD$"); #define VTNET_S_HOSTCAPS \ ( 0x00000020 | /* host supplies MAC */ \ 0x00008000 | /* host can merge Rx buffers */ \ - 0x00010000 ) /* config status available */ + 0x00010000 | /* config status available */ \ + VIRTIO_F_NOTIFY_ON_EMPTY) /* * Queue definitions. @@ -157,7 +158,8 @@ struct pci_vtnet_softc { pthread_cond_t tx_cond; int tx_in_progress; }; -#define vtnet_ctx(sc) ((sc)->vsc_pi->pi_vmctx) +#define vtnet_ctx(sc) ((sc)->vsc_pi->pi_vmctx) +#define notify_on_empty(sc) ((sc)->vsc_features & VIRTIO_F_NOTIFY_ON_EMPTY) /* * Return the size of IO BAR that maps virtio header and device specific @@ -289,6 +291,18 @@ pci_vtnet_update_status(struct pci_vtnet sc->vsc_status = value; } +static void +vtnet_generate_interrupt(struct pci_vtnet_softc *sc, int qidx) +{ + + if (use_msix) { + pci_generate_msix(sc->vsc_pi, sc->vsc_msix_table_idx[qidx]); + } else { + sc->vsc_isr |= 1; + pci_generate_msi(sc->vsc_pi, 0); + } +} + /* * Called to send a buffer chain out to the tap device */ @@ -366,6 +380,10 @@ pci_vtnet_tap_rx(struct pci_vtnet_softc * Drop the packet and try later */ (void) read(sc->vsc_tapfd, dummybuf, sizeof(dummybuf)); + + if (notify_on_empty(sc)) + vtnet_generate_interrupt(sc, VTNET_RXQ); + return; } @@ -418,15 +436,8 @@ pci_vtnet_tap_rx(struct pci_vtnet_softc *hq->hq_used_idx = uidx; hq->hq_cur_aidx = aidx; - if ((*hq->hq_avail_flags & VRING_AVAIL_F_NO_INTERRUPT) == 0) { - if (use_msix) { - pci_generate_msix(sc->vsc_pi, - sc->vsc_msix_table_idx[VTNET_RXQ]); - } else { - sc->vsc_isr |= 1; - pci_generate_msi(sc->vsc_pi, 0); - } - } + if ((*hq->hq_avail_flags & VRING_AVAIL_F_NO_INTERRUPT) == 0) + vtnet_generate_interrupt(sc, VTNET_RXQ); } static void @@ -536,9 +547,8 @@ pci_vtnet_tx_thread(void *param) { struct pci_vtnet_softc *sc = (struct pci_vtnet_softc *) param; struct vring_hqueue *hq; - int i, ndescs, needintr,error; + int i, ndescs, error; - needintr = 0; hq = &sc->vsc_hq[VTNET_TXQ]; /* @@ -552,31 +562,14 @@ pci_vtnet_tx_thread(void *param) for (;;) { pthread_mutex_lock(&sc->tx_mtx); for (;;) { - if (sc->resetting) { + if (sc->resetting) ndescs = 0; - needintr = 0; - } else + else ndescs = hq_num_avail(hq); if (ndescs != 0) break; - - if (needintr) { - /* - * Generate an interrupt if able - */ - if ((*hq->hq_avail_flags & - VRING_AVAIL_F_NO_INTERRUPT) == 0) { - if (use_msix) { - pci_generate_msix(sc->vsc_pi, - sc->vsc_msix_table_idx[VTNET_TXQ]); - } else { - sc->vsc_isr |= 1; - pci_generate_msi(sc->vsc_pi, 0); - } - } - } - needintr = 0; + sc->tx_in_progress = 0; error = pthread_cond_wait(&sc->tx_cond, &sc->tx_mtx); assert(error == 0); @@ -591,9 +584,16 @@ pci_vtnet_tx_thread(void *param) */ for (i = 0; i < ndescs; i++) pci_vtnet_proctx(sc, hq); - needintr = 1; + ndescs = hq_num_avail(hq); } + + /* + * Generate an interrupt if needed. + */ + if (notify_on_empty(sc) || + (*hq->hq_avail_flags & VRING_AVAIL_F_NO_INTERRUPT) == 0) + vtnet_generate_interrupt(sc, VTNET_TXQ); } } Modified: head/usr.sbin/bhyve/virtio.h ============================================================================== --- head/usr.sbin/bhyve/virtio.h Thu May 2 21:51:57 2013 (r250196) +++ head/usr.sbin/bhyve/virtio.h Fri May 3 01:16:18 2013 (r250197) @@ -85,6 +85,9 @@ struct virtio_used { #define VTCFG_R_CFG1 24 /* With MSI-X */ #define VTCFG_R_MSIX 20 +/* Feature flags */ +#define VIRTIO_F_NOTIFY_ON_EMPTY (1 << 24) + /* From section 2.3, "Virtqueue Configuration", of the virtio specification */ static inline u_int vring_size(u_int qsz) From owner-svn-src-head@FreeBSD.ORG Fri May 3 02:03:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6FF36427; Fri, 3 May 2013 02:03:36 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C87B81095; Fri, 3 May 2013 02:03:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4323Zr0031701; Fri, 3 May 2013 02:03:35 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4323ZHZ031700; Fri, 3 May 2013 02:03:35 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201305030203.r4323ZHZ031700@svn.freebsd.org> From: Edwin Groothuis Date: Fri, 3 May 2013 02:03:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250198 - head/usr.bin/calendar/calendars X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 02:03:36 -0000 Author: edwin Date: Fri May 3 02:03:35 2013 New Revision: 250198 URL: http://svnweb.freebsd.org/changeset/base/250198 Log: Op 30 April 2013 trad koninging Beatrix af en werd kroonprins Willem Alexander de nieuwe koning. Koningsdag is op 27 April. On 30 April 2013 queen Beatrix resigned and crownprince Willem Alexander became the new king. King's day is on 27 April. MFC after: 1 week Modified: head/usr.bin/calendar/calendars/calendar.dutch Modified: head/usr.bin/calendar/calendars/calendar.dutch ============================================================================== --- head/usr.bin/calendar/calendars/calendar.dutch Fri May 3 01:16:18 2013 (r250197) +++ head/usr.bin/calendar/calendars/calendar.dutch Fri May 3 02:03:35 2013 (r250198) @@ -13,7 +13,7 @@ Easter=Pasen jan/01 Nieuwjaar jan/06 Driekoningen apr/01 1 april -apr/30 Koninginnedag +apr/27 Koningsdag mei/01 Dag van de Arbeid mei/04 Dodenherdenking mei/05 Bevrijdingsdag @@ -60,13 +60,13 @@ sep/TueThird Prinsjesdag * Het koningshuis */ jan/19 Prinses Margriet (1943) -jan/31 Koningin Beatrix (1938) +jan/31 Prinses Beatrix (1938) feb/17 Prins Willem III (1817 - 1890) feb/18 Prinses Christina (1947) apr/10 Prinses Ariane (2007) apr/19 Prins Hendrik (1876 - 1934) -apr/27 Kroonprins Willem Alexander (1967) -apr/30 Koningin Juliana (1909 - 2004) +apr/27 Koning Willem Alexander (1967) +apr/30 Prinses Juliana (1909 - 2004) apr/30 Mr. Pieter van Vollenhoven (1939) mei/17 Prinses Maxima (1971) jun/26 Prinses Alexia (2005) From owner-svn-src-head@FreeBSD.ORG Fri May 3 07:45:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 49D03BD7; Fri, 3 May 2013 07:45:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3C49E1BBC; Fri, 3 May 2013 07:45:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r437j0IB051331; Fri, 3 May 2013 07:45:00 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r437iwXr051308; Fri, 3 May 2013 07:44:58 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201305030744.r437iwXr051308@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 3 May 2013 07:44:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250201 - in head: lib/libusb sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 07:45:00 -0000 Author: hselasky Date: Fri May 3 07:44:58 2013 New Revision: 250201 URL: http://svnweb.freebsd.org/changeset/base/250201 Log: Add new USB API to get the port path of a USB device. MFC after: 2 weeks Requested by: emaste @ Modified: head/lib/libusb/Makefile head/lib/libusb/libusb20.3 head/lib/libusb/libusb20.c head/lib/libusb/libusb20.h head/lib/libusb/libusb20_int.h head/lib/libusb/libusb20_ugen20.c head/sys/dev/usb/usb_generic.c head/sys/dev/usb/usb_ioctl.h Modified: head/lib/libusb/Makefile ============================================================================== --- head/lib/libusb/Makefile Fri May 3 02:07:02 2013 (r250200) +++ head/lib/libusb/Makefile Fri May 3 07:44:58 2013 (r250201) @@ -203,6 +203,7 @@ MLINKS += libusb20.3 libusb20_dev_reset. MLINKS += libusb20.3 libusb20_dev_check_connected.3 MLINKS += libusb20.3 libusb20_dev_set_power_mode.3 MLINKS += libusb20.3 libusb20_dev_get_power_mode.3 +MLINKS += libusb20.3 libusb20_dev_get_port_path.3 MLINKS += libusb20.3 libusb20_dev_get_power_usage.3 MLINKS += libusb20.3 libusb20_dev_set_alt_index.3 MLINKS += libusb20.3 libusb20_dev_get_device_desc.3 Modified: head/lib/libusb/libusb20.3 ============================================================================== --- head/lib/libusb/libusb20.3 Fri May 3 02:07:02 2013 (r250200) +++ head/lib/libusb/libusb20.3 Fri May 3 07:44:58 2013 (r250201) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 14, 2013 +.Dd May 3, 2013 .Dt LIBUSB20 3 .Os .Sh NAME @@ -114,6 +114,8 @@ USB access library (libusb -lusb) .Ft const char * .Fn libusb20_dev_get_backend_name "struct libusb20_device *" .Ft int +.Fn libusb20_dev_get_port_path "struct libusb20_device *pdev" "uint8_t *buf" "uint8_t bufsize" +.Ft int .Fn libusb20_dev_get_info "struct libusb20_device *pdev" "struct usb_device_info *pinfo" .Ft int .Fn libusb20_dev_get_iface_desc "struct libusb20_device *pdev" "uint8_t iface_index" "char *buf" "uint8_t len" @@ -552,6 +554,20 @@ returns a zero terminated string describ . .Pp . +.Fn libusb20_dev_get_port_path +retrieves the list of USB port numbers which the datastream for a given USB device follows. +The first port number is the Root HUB port number. +Then children port numbers follow. +The Root HUB device itself has a port path length of zero. +Valid port numbers start at one and range until and including 255. +Typically there should not be more than 16 levels, due to electrical and protocol limitations. +This functions returns the number of actual port levels upon success +else a LIBUSB20_ERROR value is returned which are always negative. +If the actual number of port levels is greater than the maximum +specified, a LIBUSB20_ERROR value is returned. +. +.Pp +. .Fn libusb20_dev_get_info retrieves the BSD specific usb_device_info structure into the memory location given by .Fa pinfo . Modified: head/lib/libusb/libusb20.c ============================================================================== --- head/lib/libusb/libusb20.c Fri May 3 02:07:02 2013 (r250200) +++ head/lib/libusb/libusb20.c Fri May 3 07:44:58 2013 (r250201) @@ -75,6 +75,7 @@ dummy_callback(struct libusb20_transfer #define dummy_check_connected (void *)dummy_int #define dummy_set_power_mode (void *)dummy_int #define dummy_get_power_mode (void *)dummy_int +#define dummy_get_port_path (void *)dummy_int #define dummy_get_power_usage (void *)dummy_int #define dummy_kernel_driver_active (void *)dummy_int #define dummy_detach_kernel_driver (void *)dummy_int @@ -722,6 +723,12 @@ libusb20_dev_get_power_mode(struct libus return (power_mode); } +int +libusb20_dev_get_port_path(struct libusb20_device *pdev, uint8_t *buf, uint8_t bufsize) +{ + return (pdev->methods->get_port_path(pdev, buf, bufsize)); +} + uint16_t libusb20_dev_get_power_usage(struct libusb20_device *pdev) { Modified: head/lib/libusb/libusb20.h ============================================================================== --- head/lib/libusb/libusb20.h Fri May 3 02:07:02 2013 (r250200) +++ head/lib/libusb/libusb20.h Fri May 3 07:44:58 2013 (r250201) @@ -251,6 +251,7 @@ int libusb20_dev_reset(struct libusb20_d int libusb20_dev_check_connected(struct libusb20_device *pdev); int libusb20_dev_set_power_mode(struct libusb20_device *pdev, uint8_t power_mode); uint8_t libusb20_dev_get_power_mode(struct libusb20_device *pdev); +int libusb20_dev_get_port_path(struct libusb20_device *pdev, uint8_t *buf, uint8_t bufsize); uint16_t libusb20_dev_get_power_usage(struct libusb20_device *pdev); int libusb20_dev_set_alt_index(struct libusb20_device *pdev, uint8_t iface_index, uint8_t alt_index); int libusb20_dev_get_info(struct libusb20_device *pdev, struct usb_device_info *pinfo); Modified: head/lib/libusb/libusb20_int.h ============================================================================== --- head/lib/libusb/libusb20_int.h Fri May 3 02:07:02 2013 (r250200) +++ head/lib/libusb/libusb20_int.h Fri May 3 07:44:58 2013 (r250201) @@ -105,6 +105,7 @@ typedef int (libusb20_process_t)(struct typedef int (libusb20_reset_device_t)(struct libusb20_device *pdev); typedef int (libusb20_set_power_mode_t)(struct libusb20_device *pdev, uint8_t power_mode); typedef int (libusb20_get_power_mode_t)(struct libusb20_device *pdev, uint8_t *power_mode); +typedef int (libusb20_get_port_path_t)(struct libusb20_device *pdev, uint8_t *buf, uint8_t bufsize); typedef int (libusb20_get_power_usage_t)(struct libusb20_device *pdev, uint16_t *power_usage); typedef int (libusb20_set_alt_index_t)(struct libusb20_device *pdev, uint8_t iface_index, uint8_t alt_index); typedef int (libusb20_set_config_index_t)(struct libusb20_device *pdev, uint8_t index); @@ -128,6 +129,7 @@ typedef void (libusb20_tr_cancel_async_t m(n, check_connected) \ m(n, set_power_mode) \ m(n, get_power_mode) \ + m(n, get_port_path) \ m(n, get_power_usage) \ m(n, set_alt_index) \ m(n, set_config_index) \ Modified: head/lib/libusb/libusb20_ugen20.c ============================================================================== --- head/lib/libusb/libusb20_ugen20.c Fri May 3 02:07:02 2013 (r250200) +++ head/lib/libusb/libusb20_ugen20.c Fri May 3 07:44:58 2013 (r250201) @@ -73,6 +73,7 @@ static libusb20_reset_device_t ugen20_re static libusb20_check_connected_t ugen20_check_connected; static libusb20_set_power_mode_t ugen20_set_power_mode; static libusb20_get_power_mode_t ugen20_get_power_mode; +static libusb20_get_port_path_t ugen20_get_port_path; static libusb20_get_power_usage_t ugen20_get_power_usage; static libusb20_kernel_driver_active_t ugen20_kernel_driver_active; static libusb20_detach_kernel_driver_t ugen20_detach_kernel_driver; @@ -644,6 +645,22 @@ ugen20_get_power_mode(struct libusb20_de } static int +ugen20_get_port_path(struct libusb20_device *pdev, uint8_t *buf, uint8_t bufsize) +{ + struct usb_device_port_path udpp; + + if (ioctl(pdev->file_ctrl, USB_GET_DEV_PORT_PATH, &udpp)) + return (LIBUSB20_ERROR_OTHER); + + if (udpp.udp_port_level > bufsize) + return (LIBUSB20_ERROR_OVERFLOW); + + memcpy(buf, udpp.udp_port_no, udpp.udp_port_level); + + return (udpp.udp_port_level); /* success */ +} + +static int ugen20_get_power_usage(struct libusb20_device *pdev, uint16_t *power_usage) { int temp; Modified: head/sys/dev/usb/usb_generic.c ============================================================================== --- head/sys/dev/usb/usb_generic.c Fri May 3 02:07:02 2013 (r250200) +++ head/sys/dev/usb/usb_generic.c Fri May 3 07:44:58 2013 (r250201) @@ -1841,6 +1841,46 @@ ugen_get_power_mode(struct usb_fifo *f) } static int +ugen_get_port_path(struct usb_fifo *f, struct usb_device_port_path *dpp) +{ + struct usb_device *udev = f->udev; + struct usb_device *next; + unsigned int nlevel = 0; + + if (udev == NULL) + goto error; + + dpp->udp_bus = device_get_unit(udev->bus->bdev); + dpp->udp_index = udev->device_index; + + /* count port levels */ + next = udev; + while (next->parent_hub != NULL) { + nlevel++; + next = next->parent_hub; + } + + /* check if too many levels */ + if (nlevel > USB_DEVICE_PORT_PATH_MAX) + goto error; + + /* store port index array */ + next = udev; + while (next->parent_hub != NULL) { + nlevel--; + + dpp->udp_port_no[nlevel] = next->port_no; + dpp->udp_port_level = nlevel; + + next = next->parent_hub; + } + return (0); /* success */ + +error: + return (EINVAL); /* failure */ +} + +static int ugen_get_power_usage(struct usb_fifo *f) { struct usb_device *udev = f->udev; @@ -2041,6 +2081,7 @@ ugen_ioctl_post(struct usb_fifo *f, u_lo struct usb_device_stats *stat; struct usb_fs_init *pinit; struct usb_fs_uninit *puninit; + struct usb_device_port_path *dpp; uint32_t *ptime; void *addr; int *pint; @@ -2213,6 +2254,10 @@ ugen_ioctl_post(struct usb_fifo *f, u_lo *u.pint = ugen_get_power_mode(f); break; + case USB_GET_DEV_PORT_PATH: + error = ugen_get_port_path(f, u.dpp); + break; + case USB_GET_POWER_USAGE: *u.pint = ugen_get_power_usage(f); break; Modified: head/sys/dev/usb/usb_ioctl.h ============================================================================== --- head/sys/dev/usb/usb_ioctl.h Fri May 3 02:07:02 2013 (r250200) +++ head/sys/dev/usb/usb_ioctl.h Fri May 3 07:44:58 2013 (r250201) @@ -131,6 +131,15 @@ struct usb_device_info { char udi_release[8]; }; +#define USB_DEVICE_PORT_PATH_MAX 32 + +struct usb_device_port_path { + uint8_t udp_bus; /* which bus we are on */ + uint8_t udp_index; /* which device index */ + uint8_t udp_port_level; /* how many levels: 0, 1, 2 ... */ + uint8_t udp_port_no[USB_DEVICE_PORT_PATH_MAX]; +}; + struct usb_device_stats { uint32_t uds_requests_ok[4]; /* Indexed by transfer type UE_XXX */ uint32_t uds_requests_fail[4]; /* Indexed by transfer type UE_XXX */ @@ -277,7 +286,8 @@ struct usb_gen_quirk { #define USB_IFACE_DRIVER_DETACH _IOW ('U', 125, int) #define USB_GET_PLUGTIME _IOR ('U', 126, uint32_t) #define USB_READ_DIR _IOW ('U', 127, struct usb_read_dir) -/* 128 - 134 unused */ +/* 128 - 133 unused */ +#define USB_GET_DEV_PORT_PATH _IOR ('U', 134, struct usb_device_port_path) #define USB_GET_POWER_USAGE _IOR ('U', 135, int) #define USB_SET_TX_FORCE_SHORT _IOW ('U', 136, int) #define USB_SET_TX_TIMEOUT _IOW ('U', 137, int) From owner-svn-src-head@FreeBSD.ORG Fri May 3 08:19:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 366627B1; Fri, 3 May 2013 08:19:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 295B81D8B; Fri, 3 May 2013 08:19:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r438JAcF063171; Fri, 3 May 2013 08:19:10 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r438J9rB063169; Fri, 3 May 2013 08:19:09 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201305030819.r438J9rB063169@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 3 May 2013 08:19:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250202 - in head/sys: conf dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 08:19:10 -0000 Author: hselasky Date: Fri May 3 08:19:09 2013 New Revision: 250202 URL: http://svnweb.freebsd.org/changeset/base/250202 Log: Allow the default USB template to be specified at compile time. Modified: head/sys/conf/options head/sys/dev/usb/usb_device.c Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Fri May 3 07:44:58 2013 (r250201) +++ head/sys/conf/options Fri May 3 08:19:09 2013 (r250202) @@ -644,6 +644,7 @@ BUS_DEBUG opt_bus.h USB_DEBUG opt_usb.h USB_HOST_ALIGN opt_usb.h USB_REQ_DEBUG opt_usb.h +USB_TEMPLATE opt_usb.h USB_VERBOSE opt_usb.h USB_EHCI_BIG_ENDIAN_DESC opt_usb.h U3G_DEBUG opt_u3g.h Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Fri May 3 07:44:58 2013 (r250201) +++ head/sys/dev/usb/usb_device.c Fri May 3 08:19:09 2013 (r250202) @@ -112,7 +112,11 @@ static void usb_cdev_free(struct usb_dev /* This variable is global to allow easy access to it: */ -int usb_template = 0; +#ifdef USB_TEMPLATE +int usb_template = USB_TEMPLATE; +#else +int usb_template; +#endif TUNABLE_INT("hw.usb.usb_template", &usb_template); SYSCTL_INT(_hw_usb, OID_AUTO, template, CTLFLAG_RW | CTLFLAG_TUN, From owner-svn-src-head@FreeBSD.ORG Fri May 3 08:20:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C852192E; Fri, 3 May 2013 08:20:10 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BB6EA1D96; Fri, 3 May 2013 08:20:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r438KAlO063424; Fri, 3 May 2013 08:20:10 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r438KAaI063423; Fri, 3 May 2013 08:20:10 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201305030820.r438KAaI063423@svn.freebsd.org> From: Ulrich Spoerlein Date: Fri, 3 May 2013 08:20:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250203 - head/lib/libpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 08:20:10 -0000 Author: uqs Date: Fri May 3 08:20:10 2013 New Revision: 250203 URL: http://svnweb.freebsd.org/changeset/base/250203 Log: Always install pmc.foo(3) manpages. There is no point in hiding, e.g. pmc.xscale(3) from a developer running on amd64, when the target arch in question will probably never have manual pages installed at all. Reviewed by: sbruno, hiren Modified: head/lib/libpmc/Makefile Modified: head/lib/libpmc/Makefile ============================================================================== --- head/lib/libpmc/Makefile Fri May 3 08:19:09 2013 (r250202) +++ head/lib/libpmc/Makefile Fri May 3 08:20:10 2013 (r250203) @@ -23,35 +23,31 @@ MAN+= pmclog.3 MAN+= pmc.soft.3 # PMC-dependent manual pages -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" MAN+= pmc.atom.3 MAN+= pmc.core.3 MAN+= pmc.core2.3 +MAN+= pmc.corei7.3 +MAN+= pmc.corei7uc.3 MAN+= pmc.haswell.3 MAN+= pmc.haswelluc.3 MAN+= pmc.iaf.3 MAN+= pmc.ivybridge.3 MAN+= pmc.ivybridgexeon.3 -MAN+= pmc.ucf.3 MAN+= pmc.k7.3 MAN+= pmc.k8.3 +MAN+= pmc.mips24k.3 +MAN+= pmc.octeon.3 MAN+= pmc.p4.3 MAN+= pmc.p5.3 MAN+= pmc.p6.3 -MAN+= pmc.corei7.3 -MAN+= pmc.corei7uc.3 MAN+= pmc.sandybridge.3 -MAN+= pmc.sandybridgeuc.3 -MAN+= pmc.sandybridgexeon.3 +MAN+= pmc.sandybridgeuc.3 +MAN+= pmc.sandybridgexeon.3 +MAN+= pmc.tsc.3 +MAN+= pmc.ucf.3 MAN+= pmc.westmere.3 MAN+= pmc.westmereuc.3 -MAN+= pmc.tsc.3 -.elif ${MACHINE_CPUARCH} == "arm" MAN+= pmc.xscale.3 -.elif ${MACHINE_CPUARCH} == "mips" -MAN+= pmc.mips24k.3 -MAN+= pmc.octeon.3 -.endif MLINKS+= \ pmc_allocate.3 pmc_release.3 \ From owner-svn-src-head@FreeBSD.ORG Fri May 3 09:23:08 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 849F2C1B; Fri, 3 May 2013 09:23:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 683C7110A; Fri, 3 May 2013 09:23:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r439N8XD086665; Fri, 3 May 2013 09:23:08 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r439N7cp086657; Fri, 3 May 2013 09:23:07 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201305030923.r439N7cp086657@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 3 May 2013 09:23:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250204 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 09:23:08 -0000 Author: hselasky Date: Fri May 3 09:23:06 2013 New Revision: 250204 URL: http://svnweb.freebsd.org/changeset/base/250204 Log: Add some defines to limit USB memory usage in reduced memory systems. Modified: head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_device.h head/sys/dev/usb/usb_freebsd.h head/sys/dev/usb/usb_freebsd_loader.h head/sys/dev/usb/usb_parse.c head/sys/dev/usb/usb_request.c Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Fri May 3 08:20:10 2013 (r250203) +++ head/sys/dev/usb/usb_device.c Fri May 3 09:23:06 2013 (r250204) @@ -729,10 +729,6 @@ usb_config_parse(struct usb_device *udev while ((id = usb_idesc_foreach(udev->cdesc, &ips))) { - /* check for interface overflow */ - if (ips.iface_index == USB_IFACE_MAX) - break; /* crazy */ - iface = udev->ifaces + ips.iface_index; /* check for specific interface match */ @@ -779,8 +775,11 @@ usb_config_parse(struct usb_device *udev /* iterate all the endpoint descriptors */ while ((ed = usb_edesc_foreach(udev->cdesc, ed))) { - if (temp == USB_EP_MAX) - break; /* crazy */ + /* check if endpoint limit has been reached */ + if (temp >= USB_MAX_EP_UNITS) { + DPRINTF("Endpoint limit reached\n"); + break; + } ep = udev->endpoints + temp; @@ -810,6 +809,7 @@ usb_config_parse(struct usb_device *udev if (cmd == USB_CFG_ALLOC) { udev->ifaces_max = ips.iface_index; +#if (USB_HAVE_FIXED_IFACE == 0) udev->ifaces = NULL; if (udev->ifaces_max != 0) { udev->ifaces = malloc(sizeof(*iface) * udev->ifaces_max, @@ -819,6 +819,8 @@ usb_config_parse(struct usb_device *udev goto done; } } +#endif +#if (USB_HAVE_FIXED_ENDPOINT == 0) if (ep_max != 0) { udev->endpoints = malloc(sizeof(*ep) * ep_max, M_USB, M_WAITOK | M_ZERO); @@ -829,6 +831,7 @@ usb_config_parse(struct usb_device *udev } else { udev->endpoints = NULL; } +#endif USB_BUS_LOCK(udev->bus); udev->endpoints_max = ep_max; /* reset any ongoing clear-stall */ @@ -846,14 +849,14 @@ cleanup: udev->ep_curr = NULL; USB_BUS_UNLOCK(udev->bus); - /* cleanup */ - if (udev->ifaces != NULL) - free(udev->ifaces, M_USB); - if (udev->endpoints != NULL) - free(udev->endpoints, M_USB); - +#if (USB_HAVE_FIXED_IFACE == 0) + free(udev->ifaces, M_USB); udev->ifaces = NULL; +#endif +#if (USB_HAVE_FIXED_ENDPOINT == 0) + free(udev->endpoints, M_USB); udev->endpoints = NULL; +#endif udev->ifaces_max = 0; } } Modified: head/sys/dev/usb/usb_device.h ============================================================================== --- head/sys/dev/usb/usb_device.h Fri May 3 08:20:10 2013 (r250203) +++ head/sys/dev/usb/usb_device.h Fri May 3 09:23:06 2013 (r250204) @@ -186,9 +186,17 @@ struct usb_device { struct mtx device_mtx; struct cv ctrlreq_cv; struct cv ref_cv; +#if (USB_HAVE_FIXED_IFACE == 0) struct usb_interface *ifaces; +#else + struct usb_interface ifaces[USB_IFACE_MAX]; +#endif struct usb_endpoint ctrl_ep; /* Control Endpoint 0 */ +#if (USB_HAVE_FIXED_ENDPOINT == 0) struct usb_endpoint *endpoints; +#else + struct usb_endpoint endpoints[USB_MAX_EP_UNITS]; +#endif struct usb_power_save pwr_save;/* power save data */ struct usb_bus *bus; /* our USB BUS */ device_t parent_dev; /* parent device */ Modified: head/sys/dev/usb/usb_freebsd.h ============================================================================== --- head/sys/dev/usb/usb_freebsd.h Fri May 3 08:20:10 2013 (r250203) +++ head/sys/dev/usb/usb_freebsd.h Fri May 3 09:23:06 2013 (r250204) @@ -45,6 +45,8 @@ #define USB_HAVE_ROOT_MOUNT_HOLD 1 #define USB_HAVE_ID_SECTION 1 #define USB_HAVE_PER_BUS_PROCESS 1 +#define USB_HAVE_FIXED_ENDPOINT 0 +#define USB_HAVE_FIXED_IFACE 0 #define USB_TD_GET_PROC(td) (td)->td_proc #define USB_PROC_GET_GID(td) (td)->p_pgid @@ -61,9 +63,11 @@ #define USB_FS_ISOC_UFRAME_MAX 4 /* exclusive unit */ #define USB_BUS_MAX 256 /* units */ #define USB_MAX_DEVICES 128 /* units */ +#define USB_CONFIG_MAX 65535 /* bytes */ #define USB_IFACE_MAX 32 /* units */ #define USB_FIFO_MAX 128 /* units */ #define USB_MAX_EP_STREAMS 8 /* units */ +#define USB_MAX_EP_UNITS 32 /* units */ #define USB_MAX_FS_ISOC_FRAMES_PER_XFER (120) /* units */ #define USB_MAX_HS_ISOC_FRAMES_PER_XFER (8*120) /* units */ Modified: head/sys/dev/usb/usb_freebsd_loader.h ============================================================================== --- head/sys/dev/usb/usb_freebsd_loader.h Fri May 3 08:20:10 2013 (r250203) +++ head/sys/dev/usb/usb_freebsd_loader.h Fri May 3 09:23:06 2013 (r250204) @@ -45,6 +45,8 @@ #define USB_HAVE_ROOT_MOUNT_HOLD 0 #define USB_HAVE_ID_SECTION 0 #define USB_HAVE_PER_BUS_PROCESS 0 +#define USB_HAVE_FIXED_ENDPOINT 0 +#define USB_HAVE_FIXED_IFACE 0 #define USB_TD_GET_PROC(td) (td)->td_proc #define USB_PROC_GET_GID(td) (td)->p_pgid @@ -61,8 +63,10 @@ #define USB_FS_ISOC_UFRAME_MAX 4 /* exclusive unit */ #define USB_BUS_MAX 256 /* units */ #define USB_MAX_DEVICES 128 /* units */ +#define USB_CONFIG_MAX 65535 /* bytes */ #define USB_IFACE_MAX 32 /* units */ #define USB_FIFO_MAX 128 /* units */ +#define USB_MAX_EP_UNITS 32 /* units */ #define USB_MAX_EP_STREAMS 8 /* units */ #define USB_MAX_FS_ISOC_FRAMES_PER_XFER (120) /* units */ Modified: head/sys/dev/usb/usb_parse.c ============================================================================== --- head/sys/dev/usb/usb_parse.c Fri May 3 08:20:10 2013 (r250203) +++ head/sys/dev/usb/usb_parse.c Fri May 3 09:23:06 2013 (r250204) @@ -49,6 +49,11 @@ #include #include #include + +#define USB_DEBUG_VAR usb_debug + +#include +#include #endif /* USB_GLOBAL_INCLUDE_FILE */ /*------------------------------------------------------------------------* @@ -142,7 +147,7 @@ usb_idesc_foreach(struct usb_config_desc } if (ps->desc == NULL) { - /* first time */ + /* first time or zero descriptors */ } else if (new_iface) { /* new interface */ ps->iface_index ++; @@ -151,6 +156,14 @@ usb_idesc_foreach(struct usb_config_desc /* new alternate interface */ ps->iface_index_alt ++; } +#if (USB_IFACE_MAX <= 0) +#error "USB_IFACE_MAX must be defined greater than zero" +#endif + /* check for too many interfaces */ + if (ps->iface_index >= USB_IFACE_MAX) { + DPRINTF("Interface limit reached\n"); + id = NULL; + } /* store and return current descriptor */ ps->desc = (struct usb_descriptor *)id; Modified: head/sys/dev/usb/usb_request.c ============================================================================== --- head/sys/dev/usb/usb_request.c Fri May 3 08:20:10 2013 (r250203) +++ head/sys/dev/usb/usb_request.c Fri May 3 09:23:06 2013 (r250204) @@ -1276,7 +1276,7 @@ usbd_req_get_config_desc_full(struct usb { struct usb_config_descriptor cd; struct usb_config_descriptor *cdesc; - uint16_t len; + uint32_t len; usb_error_t err; DPRINTFN(4, "index=%d\n", index); @@ -1284,19 +1284,21 @@ usbd_req_get_config_desc_full(struct usb *ppcd = NULL; err = usbd_req_get_config_desc(udev, mtx, &cd, index); - if (err) { + if (err) return (err); - } + /* get full descriptor */ len = UGETW(cd.wTotalLength); - if (len < sizeof(*cdesc)) { + if (len < (uint32_t)sizeof(*cdesc)) { /* corrupt descriptor */ return (USB_ERR_INVAL); + } else if (len > USB_CONFIG_MAX) { + DPRINTF("Configuration descriptor was truncated\n"); + len = USB_CONFIG_MAX; } cdesc = malloc(len, mtype, M_WAITOK); - if (cdesc == NULL) { + if (cdesc == NULL) return (USB_ERR_NOMEM); - } err = usbd_req_get_desc(udev, mtx, NULL, cdesc, len, len, 0, UDESC_CONFIG, index, 3); if (err) { From owner-svn-src-head@FreeBSD.ORG Fri May 3 10:13:30 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 409D9C1F; Fri, 3 May 2013 10:13:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 33AEA15A0; Fri, 3 May 2013 10:13:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43ADUXh004612; Fri, 3 May 2013 10:13:30 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43ADUg4004611; Fri, 3 May 2013 10:13:30 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201305031013.r43ADUg4004611@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 3 May 2013 10:13:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250205 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 10:13:30 -0000 Author: hselasky Date: Fri May 3 10:13:29 2013 New Revision: 250205 URL: http://svnweb.freebsd.org/changeset/base/250205 Log: Always put space before the comma before ##__VA_ARGS__ due to subtle compiler differences. Modified: head/sys/dev/usb/usb_debug.h Modified: head/sys/dev/usb/usb_debug.h ============================================================================== --- head/sys/dev/usb/usb_debug.h Fri May 3 09:23:06 2013 (r250204) +++ head/sys/dev/usb/usb_debug.h Fri May 3 10:13:29 2013 (r250205) @@ -38,7 +38,7 @@ extern int usb_debug; #define DPRINTFN(n,fmt,...) do { \ if ((USB_DEBUG_VAR) >= (n)) { \ printf("%s: " fmt, \ - __FUNCTION__,## __VA_ARGS__); \ + __FUNCTION__ ,##__VA_ARGS__); \ } \ } while (0) #define DPRINTF(...) DPRINTFN(1, __VA_ARGS__) From owner-svn-src-head@FreeBSD.ORG Fri May 3 10:37:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9403AFB9; Fri, 3 May 2013 10:37:59 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 85D691670; Fri, 3 May 2013 10:37:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43AbxK7012184; Fri, 3 May 2013 10:37:59 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43AbxDr012183; Fri, 3 May 2013 10:37:59 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201305031037.r43AbxDr012183@svn.freebsd.org> From: Steven Hartland Date: Fri, 3 May 2013 10:37:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250206 - head/sys/dev/mps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 10:37:59 -0000 Author: smh Date: Fri May 3 10:37:59 2013 New Revision: 250206 URL: http://svnweb.freebsd.org/changeset/base/250206 Log: Fix uninitialized warning in mps Reviewed by: pjd (mentor) Approved by: pjd (mentor) MFC after: 2 weeks Modified: head/sys/dev/mps/mps_mapping.c Modified: head/sys/dev/mps/mps_mapping.c ============================================================================== --- head/sys/dev/mps/mps_mapping.c Fri May 3 10:13:29 2013 (r250205) +++ head/sys/dev/mps/mps_mapping.c Fri May 3 10:37:59 2013 (r250206) @@ -331,6 +331,8 @@ _mapping_get_high_missing_mt_idx(struct u16 ioc_pg8_flags = le16toh(sc->ioc_pg8.Flags); start_idx = 0; + start_idx_ir = 0; + end_idx_ir = 0; end_idx = sc->max_devices; if (ioc_pg8_flags & MPI2_IOCPAGE8_FLAGS_RESERVED_TARGETID_0) start_idx = 1; From owner-svn-src-head@FreeBSD.ORG Fri May 3 11:10:06 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EC39B862; Fri, 3 May 2013 11:10:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CEC77179D; Fri, 3 May 2013 11:10:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43BA6Sv023519; Fri, 3 May 2013 11:10:06 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43BA4Rx023357; Fri, 3 May 2013 11:10:04 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201305031110.r43BA4Rx023357@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 3 May 2013 11:10:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250207 - in head/sys/dev/usb: . template X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 11:10:07 -0000 Author: hselasky Date: Fri May 3 11:10:04 2013 New Revision: 250207 URL: http://svnweb.freebsd.org/changeset/base/250207 Log: - Add more defines to limit USB memory usage and number of allocations in reduced memory systems. - Split allocation and freeing of the configuration descriptor into a separate function, so that the configuration descriptor can be made fixed size to save memory allocations. This applies for both device and host mode. Modified: head/sys/dev/usb/template/usb_template.c head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_device.h head/sys/dev/usb/usb_dynamic.c head/sys/dev/usb/usb_freebsd.h head/sys/dev/usb/usb_freebsd_loader.h head/sys/dev/usb/usb_generic.c head/sys/dev/usb/usb_hub.c head/sys/dev/usb/usb_hub.h head/sys/dev/usb/usb_request.c head/sys/dev/usb/usb_request.h Modified: head/sys/dev/usb/template/usb_template.c ============================================================================== --- head/sys/dev/usb/template/usb_template.c Fri May 3 10:37:59 2013 (r250206) +++ head/sys/dev/usb/template/usb_template.c Fri May 3 11:10:04 2013 (r250207) @@ -69,6 +69,7 @@ #include #include +#include #include #endif /* USB_GLOBAL_INCLUDE_FILE */ @@ -1267,7 +1268,7 @@ usb_temp_setup(struct usb_device *udev, goto done; } /* allocate zeroed memory */ - uts->buf = malloc(uts->size, M_USB, M_WAITOK | M_ZERO); + uts->buf = usbd_alloc_config_desc(udev, uts->size); /* * Allow malloc() to return NULL regardless of M_WAITOK flag. * This helps when porting the software to non-FreeBSD @@ -1336,12 +1337,8 @@ done: void usb_temp_unsetup(struct usb_device *udev) { - if (udev->usb_template_ptr) { - - free(udev->usb_template_ptr, M_USB); - - udev->usb_template_ptr = NULL; - } + usbd_free_config_desc(udev, udev->usb_template_ptr); + udev->usb_template_ptr = NULL; } static usb_error_t Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Fri May 3 10:37:59 2013 (r250206) +++ head/sys/dev/usb/usb_device.c Fri May 3 11:10:04 2013 (r250207) @@ -493,7 +493,7 @@ usb_unconfigure(struct usb_device *udev, /* free "cdesc" after "ifaces" and "endpoints", if any */ if (udev->cdesc != NULL) { if (udev->flags.usb_mode != USB_MODE_DEVICE) - free(udev->cdesc, M_USB); + usbd_free_config_desc(udev, udev->cdesc); udev->cdesc = NULL; } /* set unconfigured state */ @@ -552,7 +552,7 @@ usbd_set_config_index(struct usb_device } else { /* normal request */ err = usbd_req_get_config_desc_full(udev, - NULL, &cdp, M_USB, index); + NULL, &cdp, index); } if (err) { goto done; Modified: head/sys/dev/usb/usb_device.h ============================================================================== --- head/sys/dev/usb/usb_device.h Fri May 3 10:37:59 2013 (r250206) +++ head/sys/dev/usb/usb_device.h Fri May 3 11:10:04 2013 (r250207) @@ -267,6 +267,10 @@ struct usb_device { uint32_t clear_stall_errors; /* number of clear-stall failures */ union usb_device_scratch scratch; + +#if (USB_HAVE_FIXED_CONFIG != 0) + uint32_t config_data[(USB_CONFIG_MAX + 3) / 4]; +#endif }; /* globals */ Modified: head/sys/dev/usb/usb_dynamic.c ============================================================================== --- head/sys/dev/usb/usb_dynamic.c Fri May 3 10:37:59 2013 (r250206) +++ head/sys/dev/usb/usb_dynamic.c Fri May 3 11:10:04 2013 (r250207) @@ -53,6 +53,7 @@ #include #include #include +#include #endif /* USB_GLOBAL_INCLUDE_FILE */ /* function prototypes */ @@ -98,12 +99,8 @@ usb_temp_get_desc_w(struct usb_device *u static void usb_temp_unsetup_w(struct usb_device *udev) { - if (udev->usb_template_ptr) { - - free(udev->usb_template_ptr, M_USB); - - udev->usb_template_ptr = NULL; - } + usbd_free_config_desc(udev, udev->usb_template_ptr); + udev->usb_template_ptr = NULL; } void Modified: head/sys/dev/usb/usb_freebsd.h ============================================================================== --- head/sys/dev/usb/usb_freebsd.h Fri May 3 10:37:59 2013 (r250206) +++ head/sys/dev/usb/usb_freebsd.h Fri May 3 11:10:04 2013 (r250207) @@ -47,6 +47,8 @@ #define USB_HAVE_PER_BUS_PROCESS 1 #define USB_HAVE_FIXED_ENDPOINT 0 #define USB_HAVE_FIXED_IFACE 0 +#define USB_HAVE_FIXED_CONFIG 0 +#define USB_HAVE_FIXED_PORT 0 #define USB_TD_GET_PROC(td) (td)->td_proc #define USB_PROC_GET_GID(td) (td)->p_pgid @@ -68,6 +70,7 @@ #define USB_FIFO_MAX 128 /* units */ #define USB_MAX_EP_STREAMS 8 /* units */ #define USB_MAX_EP_UNITS 32 /* units */ +#define USB_MAX_PORTS 255 /* units */ #define USB_MAX_FS_ISOC_FRAMES_PER_XFER (120) /* units */ #define USB_MAX_HS_ISOC_FRAMES_PER_XFER (8*120) /* units */ Modified: head/sys/dev/usb/usb_freebsd_loader.h ============================================================================== --- head/sys/dev/usb/usb_freebsd_loader.h Fri May 3 10:37:59 2013 (r250206) +++ head/sys/dev/usb/usb_freebsd_loader.h Fri May 3 11:10:04 2013 (r250207) @@ -47,6 +47,8 @@ #define USB_HAVE_PER_BUS_PROCESS 0 #define USB_HAVE_FIXED_ENDPOINT 0 #define USB_HAVE_FIXED_IFACE 0 +#define USB_HAVE_FIXED_CONFIG 0 +#define USB_HAVE_FIXED_PORT 0 #define USB_TD_GET_PROC(td) (td)->td_proc #define USB_PROC_GET_GID(td) (td)->p_pgid @@ -68,6 +70,7 @@ #define USB_FIFO_MAX 128 /* units */ #define USB_MAX_EP_UNITS 32 /* units */ #define USB_MAX_EP_STREAMS 8 /* units */ +#define USB_MAX_PORTS 255 /* units */ #define USB_MAX_FS_ISOC_FRAMES_PER_XFER (120) /* units */ #define USB_MAX_HS_ISOC_FRAMES_PER_XFER (8*120) /* units */ Modified: head/sys/dev/usb/usb_generic.c ============================================================================== --- head/sys/dev/usb/usb_generic.c Fri May 3 10:37:59 2013 (r250206) +++ head/sys/dev/usb/usb_generic.c Fri May 3 11:10:04 2013 (r250207) @@ -688,18 +688,21 @@ ugen_get_cdesc(struct usb_fifo *f, struc if ((ugd->ugd_config_index == USB_UNCONFIG_INDEX) || (ugd->ugd_config_index == udev->curr_config_index)) { cdesc = usbd_get_config_descriptor(udev); - if (cdesc == NULL) { + if (cdesc == NULL) return (ENXIO); - } free_data = 0; } else { +#if (USB_HAVE_FIXED_CONFIG == 0) if (usbd_req_get_config_desc_full(udev, - NULL, &cdesc, M_USBDEV, - ugd->ugd_config_index)) { + NULL, &cdesc, ugd->ugd_config_index)) { return (ENXIO); } free_data = 1; +#else + /* configuration descriptor data is shared */ + return (EINVAL); +#endif } len = UGETW(cdesc->wTotalLength); @@ -713,9 +716,9 @@ ugen_get_cdesc(struct usb_fifo *f, struc error = copyout(cdesc, ugd->ugd_data, len); - if (free_data) { - free(cdesc, M_USBDEV); - } + if (free_data) + usbd_free_config_desc(udev, cdesc); + return (error); } Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Fri May 3 10:37:59 2013 (r250206) +++ head/sys/dev/usb/usb_hub.c Fri May 3 11:10:04 2013 (r250207) @@ -100,6 +100,9 @@ struct uhub_current_state { struct uhub_softc { struct uhub_current_state sc_st;/* current state */ +#if (USB_HAVE_FIXED_PORT != 0) + struct usb_hub sc_hub; +#endif device_t sc_dev; /* base device */ struct mtx sc_mtx; /* our mutex */ struct usb_device *sc_udev; /* USB device */ @@ -922,8 +925,8 @@ uhub_attach(device_t dev) struct usb_hub_descriptor hubdesc20; struct usb_hub_ss_descriptor hubdesc30; uint16_t pwrdly; + uint16_t nports; uint8_t x; - uint8_t nports; uint8_t portno; uint8_t removable; uint8_t iface_index; @@ -1067,12 +1070,19 @@ uhub_attach(device_t dev) DPRINTFN(0, "portless HUB\n"); goto error; } + if (nports > USB_MAX_PORTS) { + DPRINTF("Port limit exceeded\n"); + goto error; + } +#if (USB_HAVE_FIXED_PORT == 0) hub = malloc(sizeof(hub[0]) + (sizeof(hub->ports[0]) * nports), M_USBDEV, M_WAITOK | M_ZERO); - if (hub == NULL) { + if (hub == NULL) goto error; - } +#else + hub = &sc->sc_hub; +#endif udev->hub = hub; /* initialize HUB structure */ @@ -1197,10 +1207,10 @@ uhub_attach(device_t dev) error: usbd_transfer_unsetup(sc->sc_xfer, UHUB_N_TRANSFER); - if (udev->hub) { - free(udev->hub, M_USBDEV); - udev->hub = NULL; - } +#if (USB_HAVE_FIXED_PORT == 0) + free(udev->hub, M_USBDEV); +#endif + udev->hub = NULL; mtx_destroy(&sc->sc_mtx); @@ -1240,7 +1250,9 @@ uhub_detach(device_t dev) usb_free_device(child, 0); } +#if (USB_HAVE_FIXED_PORT == 0) free(hub, M_USBDEV); +#endif sc->sc_udev->hub = NULL; mtx_destroy(&sc->sc_mtx); Modified: head/sys/dev/usb/usb_hub.h ============================================================================== --- head/sys/dev/usb/usb_hub.h Fri May 3 10:37:59 2013 (r250206) +++ head/sys/dev/usb/usb_hub.h Fri May 3 11:10:04 2013 (r250207) @@ -48,7 +48,11 @@ struct usb_hub { uint16_t portpower; /* mA per USB port */ uint8_t isoc_last_time; uint8_t nports; +#if (USB_HAVE_FIXED_PORT == 0) struct usb_port ports[0]; +#else + struct usb_port ports[USB_MAX_PORTS]; +#endif }; /* function prototypes */ Modified: head/sys/dev/usb/usb_request.c ============================================================================== --- head/sys/dev/usb/usb_request.c Fri May 3 10:37:59 2013 (r250206) +++ head/sys/dev/usb/usb_request.c Fri May 3 11:10:04 2013 (r250207) @@ -1260,10 +1260,49 @@ done: } /*------------------------------------------------------------------------* + * usbd_alloc_config_desc + * + * This function is used to allocate a zeroed configuration + * descriptor. + * + * Returns: + * NULL: Failure + * Else: Success + *------------------------------------------------------------------------*/ +void * +usbd_alloc_config_desc(struct usb_device *udev, uint32_t size) +{ + if (size > USB_CONFIG_MAX) { + DPRINTF("Configuration descriptor too big\n"); + return (NULL); + } +#if (USB_HAVE_FIXED_CONFIG == 0) + return (malloc(size, M_USBDEV, M_ZERO | M_WAITOK)); +#else + memset(udev->config_data, 0, sizeof(udev->config_data)); + return (udev->config_data); +#endif +} + +/*------------------------------------------------------------------------* + * usbd_alloc_config_desc + * + * This function is used to free a configuration descriptor. + *------------------------------------------------------------------------*/ +void +usbd_free_config_desc(struct usb_device *udev, void *ptr) +{ +#if (USB_HAVE_FIXED_CONFIG == 0) + free(ptr, M_USBDEV); +#endif +} + +/*------------------------------------------------------------------------* * usbd_req_get_config_desc_full * * This function gets the complete USB configuration descriptor and - * ensures that "wTotalLength" is correct. + * ensures that "wTotalLength" is correct. The returned configuration + * descriptor is freed by calling "usbd_free_config_desc()". * * Returns: * 0: Success @@ -1271,8 +1310,7 @@ done: *------------------------------------------------------------------------*/ usb_error_t usbd_req_get_config_desc_full(struct usb_device *udev, struct mtx *mtx, - struct usb_config_descriptor **ppcd, struct malloc_type *mtype, - uint8_t index) + struct usb_config_descriptor **ppcd, uint8_t index) { struct usb_config_descriptor cd; struct usb_config_descriptor *cdesc; @@ -1296,13 +1334,13 @@ usbd_req_get_config_desc_full(struct usb DPRINTF("Configuration descriptor was truncated\n"); len = USB_CONFIG_MAX; } - cdesc = malloc(len, mtype, M_WAITOK); + cdesc = usbd_alloc_config_desc(udev, len); if (cdesc == NULL) return (USB_ERR_NOMEM); err = usbd_req_get_desc(udev, mtx, NULL, cdesc, len, len, 0, UDESC_CONFIG, index, 3); if (err) { - free(cdesc, mtype); + usbd_free_config_desc(udev, cdesc); return (err); } /* make sure that the device is not fooling us: */ Modified: head/sys/dev/usb/usb_request.h ============================================================================== --- head/sys/dev/usb/usb_request.h Fri May 3 10:37:59 2013 (r250206) +++ head/sys/dev/usb/usb_request.h Fri May 3 11:10:04 2013 (r250207) @@ -44,7 +44,7 @@ usb_error_t usbd_req_get_config_desc(str struct usb_config_descriptor *d, uint8_t conf_index); usb_error_t usbd_req_get_config_desc_full(struct usb_device *udev, struct mtx *mtx, struct usb_config_descriptor **ppcd, - struct malloc_type *mtype, uint8_t conf_index); + uint8_t conf_index); usb_error_t usbd_req_get_desc(struct usb_device *udev, struct mtx *mtx, uint16_t *actlen, void *desc, uint16_t min_len, uint16_t max_len, uint16_t id, uint8_t type, @@ -94,4 +94,7 @@ usb_error_t usbd_req_set_port_link_state usb_error_t usbd_req_set_lpm_info(struct usb_device *udev, struct mtx *mtx, uint8_t port, uint8_t besl, uint8_t addr, uint8_t rwe); +void * usbd_alloc_config_desc(struct usb_device *, uint32_t); +void usbd_free_config_desc(struct usb_device *, void *); + #endif /* _USB_REQUEST_H_ */ From owner-svn-src-head@FreeBSD.ORG Fri May 3 11:53:07 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 182CE35A; Fri, 3 May 2013 11:53:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EED7F1B76; Fri, 3 May 2013 11:53:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43Br66B039156; Fri, 3 May 2013 11:53:06 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43Br6ET039155; Fri, 3 May 2013 11:53:06 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201305031153.r43Br6ET039155@svn.freebsd.org> From: Alexander Motin Date: Fri, 3 May 2013 11:53:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250208 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 11:53:07 -0000 Author: mav Date: Fri May 3 11:53:06 2013 New Revision: 250208 URL: http://svnweb.freebsd.org/changeset/base/250208 Log: Tune support for removable media in da driver: - remove DA_FLAG_SAW_MEDIA flag, almost opposite to DA_FLAG_PACK_INVALID, using the last instead. - allow opening device with no media present, reporting zero media size and non-zero sector size, as geom/notes suggests. That allow to read device attributes and potentially do other things, not related to media. Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Fri May 3 11:10:04 2013 (r250207) +++ head/sys/cam/scsi/scsi_da.c Fri May 3 11:53:06 2013 (r250208) @@ -82,7 +82,6 @@ typedef enum { DA_FLAG_NEW_PACK = 0x002, DA_FLAG_PACK_LOCKED = 0x004, DA_FLAG_PACK_REMOVABLE = 0x008, - DA_FLAG_SAW_MEDIA = 0x010, DA_FLAG_NEED_OTAG = 0x020, DA_FLAG_WENT_IDLE = 0x040, DA_FLAG_RETRY_UA = 0x080, @@ -1026,9 +1025,6 @@ daopen(struct disk *dp) ("daopen\n")); softc = (struct da_softc *)periph->softc; - softc->flags |= DA_FLAG_OPEN; - softc->flags &= ~DA_FLAG_PACK_INVALID; - dareprobe(periph); /* Wait for the disk size update. */ @@ -1037,25 +1033,23 @@ daopen(struct disk *dp) if (error != 0) xpt_print(periph->path, "unable to retrieve capacity data"); - if (periph->flags & CAM_PERIPH_INVALID || - softc->disk->d_sectorsize == 0 || - softc->disk->d_mediasize == 0) + if (periph->flags & CAM_PERIPH_INVALID) error = ENXIO; if (error == 0 && (softc->flags & DA_FLAG_PACK_REMOVABLE) != 0 && (softc->quirks & DA_Q_NO_PREVENT) == 0) daprevent(periph, PR_PREVENT); - if (error == 0) - softc->flags |= DA_FLAG_SAW_MEDIA; + if (error == 0) { + softc->flags &= ~DA_FLAG_PACK_INVALID; + softc->flags |= DA_FLAG_OPEN; + } cam_periph_unhold(periph); cam_periph_unlock(periph); - if (error != 0) { - softc->flags &= ~DA_FLAG_OPEN; + if (error != 0) cam_periph_release(periph); - } return (error); } @@ -2818,9 +2812,10 @@ dadone(struct cam_periph *periph, union * here. */ if (block_size == 0 && maxsector == 0) { - snprintf(announce_buf, sizeof(announce_buf), - "0MB (no media?)"); - } else if (block_size >= MAXPHYS || block_size == 0) { + block_size = 512; + maxsector = -1; + } + if (block_size >= MAXPHYS || block_size == 0) { xpt_print(periph->path, "unsupportable block size %ju\n", (uintmax_t) block_size); @@ -2920,6 +2915,7 @@ dadone(struct cam_periph *periph, union const char *sense_key_desc; const char *asc_desc; + dasetgeom(periph, 512, -1, NULL, 0); scsi_sense_desc(sense_key, asc, ascq, &cgd.inq_data, &sense_key_desc, @@ -3297,8 +3293,8 @@ daerror(union ccb *ccb, u_int32_t cam_fl asc == 0x28 && ascq == 0x00) disk_media_changed(softc->disk, M_NOWAIT); else if (sense_key == SSD_KEY_NOT_READY && - asc == 0x3a && (softc->flags & DA_FLAG_SAW_MEDIA)) { - softc->flags &= ~DA_FLAG_SAW_MEDIA; + asc == 0x3a && (softc->flags & DA_FLAG_PACK_INVALID) == 0) { + softc->flags |= DA_FLAG_PACK_INVALID; disk_media_gone(softc->disk, M_NOWAIT); } } From owner-svn-src-head@FreeBSD.ORG Fri May 3 12:42:44 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 82FC41CF; Fri, 3 May 2013 12:42:44 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 746A41E6A; Fri, 3 May 2013 12:42:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43CgieC056959; Fri, 3 May 2013 12:42:44 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43Cgiak056958; Fri, 3 May 2013 12:42:44 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201305031242.r43Cgiak056958@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 3 May 2013 12:42:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250209 - head/lib/libc/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 12:42:44 -0000 Author: pluknet Date: Fri May 3 12:42:43 2013 New Revision: 250209 URL: http://svnweb.freebsd.org/changeset/base/250209 Log: Remove the STANDARDS section. querylocale is not part of IEEE Std 1003.1-2008. MFC after: 3 days Modified: head/lib/libc/locale/querylocale.3 Modified: head/lib/libc/locale/querylocale.3 ============================================================================== --- head/lib/libc/locale/querylocale.3 Fri May 3 11:53:06 2013 (r250208) +++ head/lib/libc/locale/querylocale.3 Fri May 3 12:42:43 2013 (r250209) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 17 2011 +.Dd May 3, 2013 .Dt QUERYLOCALE 3 .Os .Sh NAME @@ -52,6 +52,3 @@ If more than one bit in the mask is set, .Xr newlocale 3 , .Xr uselocale 3 , .Xr xlocale 3 -.Sh STANDARDS -This function, conforms to -.St -p1003.1-2008 From owner-svn-src-head@FreeBSD.ORG Fri May 3 12:45:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7689937E; Fri, 3 May 2013 12:45:46 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 68E661E90; Fri, 3 May 2013 12:45:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43CjkoE057584; Fri, 3 May 2013 12:45:46 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43Cjj9N057581; Fri, 3 May 2013 12:45:45 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201305031245.r43Cjj9N057581@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 3 May 2013 12:45:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250210 - head/lib/libc/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 12:45:46 -0000 Author: pluknet Date: Fri May 3 12:45:45 2013 New Revision: 250210 URL: http://svnweb.freebsd.org/changeset/base/250210 Log: Remove an extra comma. Modified: head/lib/libc/locale/duplocale.3 head/lib/libc/locale/freelocale.3 head/lib/libc/locale/newlocale.3 Modified: head/lib/libc/locale/duplocale.3 ============================================================================== --- head/lib/libc/locale/duplocale.3 Fri May 3 12:42:43 2013 (r250209) +++ head/lib/libc/locale/duplocale.3 Fri May 3 12:45:45 2013 (r250210) @@ -66,7 +66,7 @@ The locale returned by this call must be .Xr uselocale 3 , .Xr xlocale 3 .Sh STANDARDS -This function, conforms to +This function conforms to .St -p1003.1-2008 .Sh BUGS Ideally, Modified: head/lib/libc/locale/freelocale.3 ============================================================================== --- head/lib/libc/locale/freelocale.3 Fri May 3 12:42:43 2013 (r250209) +++ head/lib/libc/locale/freelocale.3 Fri May 3 12:45:45 2013 (r250210) @@ -57,5 +57,5 @@ Returns 0 on success or -1 on error. .Xr uselocale 3 , .Xr xlocale 3 .Sh STANDARDS -This function, conforms to +This function conforms to .St -p1003.1-2008 . Modified: head/lib/libc/locale/newlocale.3 ============================================================================== --- head/lib/libc/locale/newlocale.3 Fri May 3 12:42:43 2013 (r250209) +++ head/lib/libc/locale/newlocale.3 Fri May 3 12:45:45 2013 (r250210) @@ -108,5 +108,5 @@ You must free the returned locale with .Xr uselocale 3 , .Xr xlocale 3 .Sh STANDARDS -This function, conforms to +This function conforms to .St -p1003.1-2008 From owner-svn-src-head@FreeBSD.ORG Fri May 3 13:27:14 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0E6E6DD7; Fri, 3 May 2013 13:27:14 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 004F81090; Fri, 3 May 2013 13:27:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43DRDT6072205; Fri, 3 May 2013 13:27:13 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43DRDAr072202; Fri, 3 May 2013 13:27:13 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201305031327.r43DRDAr072202@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 3 May 2013 13:27:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250211 - head/lib/libc/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 13:27:14 -0000 Author: pluknet Date: Fri May 3 13:27:13 2013 New Revision: 250211 URL: http://svnweb.freebsd.org/changeset/base/250211 Log: Also, add a missing period. Modified: head/lib/libc/locale/duplocale.3 head/lib/libc/locale/newlocale.3 head/lib/libc/locale/uselocale.3 Modified: head/lib/libc/locale/duplocale.3 ============================================================================== --- head/lib/libc/locale/duplocale.3 Fri May 3 12:45:45 2013 (r250210) +++ head/lib/libc/locale/duplocale.3 Fri May 3 13:27:13 2013 (r250211) @@ -67,7 +67,7 @@ The locale returned by this call must be .Xr xlocale 3 .Sh STANDARDS This function conforms to -.St -p1003.1-2008 +.St -p1003.1-2008 . .Sh BUGS Ideally, .Xr uselocale 3 Modified: head/lib/libc/locale/newlocale.3 ============================================================================== --- head/lib/libc/locale/newlocale.3 Fri May 3 12:45:45 2013 (r250210) +++ head/lib/libc/locale/newlocale.3 Fri May 3 13:27:13 2013 (r250211) @@ -109,4 +109,4 @@ You must free the returned locale with .Xr xlocale 3 .Sh STANDARDS This function conforms to -.St -p1003.1-2008 +.St -p1003.1-2008 . Modified: head/lib/libc/locale/uselocale.3 ============================================================================== --- head/lib/libc/locale/uselocale.3 Fri May 3 12:45:45 2013 (r250210) +++ head/lib/libc/locale/uselocale.3 Fri May 3 13:27:13 2013 (r250211) @@ -57,4 +57,4 @@ or LC_GLOBAL_LOCALE if this thread has n .Xr xlocale 3 .Sh STANDARDS This function conforms to -.St -p1003.1-2008 +.St -p1003.1-2008 . From owner-svn-src-head@FreeBSD.ORG Fri May 3 13:33:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 24868130; Fri, 3 May 2013 13:33:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1760110DB; Fri, 3 May 2013 13:33:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43DXarv075099; Fri, 3 May 2013 13:33:36 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43DXaX7075098; Fri, 3 May 2013 13:33:36 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201305031333.r43DXaX7075098@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 3 May 2013 13:33:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250212 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 13:33:37 -0000 Author: hselasky Date: Fri May 3 13:33:36 2013 New Revision: 250212 URL: http://svnweb.freebsd.org/changeset/base/250212 Log: Fix compile warning. Modified: head/sys/dev/usb/usb_device.c Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Fri May 3 13:27:13 2013 (r250211) +++ head/sys/dev/usb/usb_device.c Fri May 3 13:33:36 2013 (r250212) @@ -838,8 +838,9 @@ usb_config_parse(struct usb_device *udev udev->ep_curr = NULL; USB_BUS_UNLOCK(udev->bus); } - +#if (USB_HAVE_FIXED_IFACE == 0) || (USB_HAVE_FIXED_ENDPOINT == 0) done: +#endif if (err) { if (cmd == USB_CFG_ALLOC) { cleanup: From owner-svn-src-head@FreeBSD.ORG Fri May 3 15:28:32 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AE8F2893; Fri, 3 May 2013 15:28:32 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A0E3A189E; Fri, 3 May 2013 15:28:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43FSWdl015559; Fri, 3 May 2013 15:28:32 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43FSVfj015555; Fri, 3 May 2013 15:28:31 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305031528.r43FSVfj015555@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 3 May 2013 15:28:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250214 - in head: bin/sh tools/regression/bin/sh/builtins X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 15:28:32 -0000 Author: jilles Date: Fri May 3 15:28:31 2013 New Revision: 250214 URL: http://svnweb.freebsd.org/changeset/base/250214 Log: sh: Improve error handling in read builtin: * If read -t times out, return status as if interrupted by SIGALRM (formerly 1). * If a trapped signal interrupts read, return status 128+sig (formerly 1). * If [EINTR] occurs but there is no trap, retry the read (for example because of a SIGWINCH in interactive mode). * If a read error occurs, write an error message and return status 2. As before, a variable assignment error returns 2 and discards the remaining data read. Added: head/tools/regression/bin/sh/builtins/read7.0 (contents, props changed) head/tools/regression/bin/sh/builtins/read8.0 (contents, props changed) Modified: head/bin/sh/miscbltin.c head/bin/sh/sh.1 Modified: head/bin/sh/miscbltin.c ============================================================================== --- head/bin/sh/miscbltin.c Fri May 3 14:59:32 2013 (r250213) +++ head/bin/sh/miscbltin.c Fri May 3 15:28:31 2013 (r250214) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include "error.h" #include "mystring.h" #include "syntax.h" +#include "trap.h" #undef eflag @@ -102,6 +103,8 @@ readcmd(int argc __unused, char **argv _ struct timeval tv; char *tvptr; fd_set ifds; + ssize_t nread; + int sig; rflag = 0; prompt = NULL; @@ -156,8 +159,10 @@ readcmd(int argc __unused, char **argv _ /* * If there's nothing ready, return an error. */ - if (status <= 0) - return(1); + if (status <= 0) { + sig = pendingsig; + return (128 + (sig != 0 ? sig : SIGALRM)); + } } status = 0; @@ -165,7 +170,19 @@ readcmd(int argc __unused, char **argv _ backslash = 0; STARTSTACKSTR(p); for (;;) { - if (read(STDIN_FILENO, &c, 1) != 1) { + nread = read(STDIN_FILENO, &c, 1); + if (nread == -1) { + if (errno == EINTR) { + sig = pendingsig; + if (sig == 0) + continue; + status = 128 + sig; + break; + } + warning("read error: %s", strerror(errno)); + status = 2; + break; + } else if (nread != 1) { status = 1; break; } Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Fri May 3 14:59:32 2013 (r250213) +++ head/bin/sh/sh.1 Fri May 3 15:28:31 2013 (r250214) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd April 21, 2013 +.Dd May 3, 2013 .Dt SH 1 .Os .Sh NAME @@ -2372,7 +2372,9 @@ option is specified and the elapses before a complete line of input is supplied, the .Ic read -command will return an exit status of 1 without assigning any values. +command will return an exit status as if terminated by +.Dv SIGALRM +without assigning any values. The .Ar timeout value may optionally be followed by one of @@ -2388,6 +2390,11 @@ is assumed. The .Fl e option exists only for backward compatibility with older scripts. +.Pp +The exit status is 0 on success, 1 on end of file, +between 2 and 128 if an error occurs +and greater than 128 if a trapped signal interrupts +.Ic read . .It Ic readonly Oo Fl p Oc Op Ar name ... Each specified .Ar name Added: head/tools/regression/bin/sh/builtins/read7.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/read7.0 Fri May 3 15:28:31 2013 (r250214) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +{ errmsg=`read x <&- 2>&1 >&3`; } 3>&1 +r=$? +[ "$r" -ge 2 ] && [ "$r" -le 128 ] && [ -n "$errmsg" ] Added: head/tools/regression/bin/sh/builtins/read8.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/read8.0 Fri May 3 15:28:31 2013 (r250214) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +T=`mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX` +trap 'rm -rf $T' 0 +cd $T || exit 3 +mkfifo fifo1 +trapped= +trap trapped=1 QUIT +{ kill -QUIT $$; sleep 1; exit 4; } >fifo1 & +read dummy Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 16E01EE3; Fri, 3 May 2013 16:29:52 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 08F341EA0; Fri, 3 May 2013 16:29:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43GTpTv036697; Fri, 3 May 2013 16:29:51 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43GTpO3036696; Fri, 3 May 2013 16:29:51 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201305031629.r43GTpO3036696@svn.freebsd.org> From: Dimitry Andric Date: Fri, 3 May 2013 16:29:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250217 - head/lib/clang/include/llvm/Config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 16:29:52 -0000 Author: dim Date: Fri May 3 16:29:51 2013 New Revision: 250217 URL: http://svnweb.freebsd.org/changeset/base/250217 Log: Allow building clang on older FreeBSD releases, where log2() does not exist yet. With this change, I have verified that building head on 8.1-RELEASE works. Noticed by: Ryan Stone Modified: head/lib/clang/include/llvm/Config/config.h Modified: head/lib/clang/include/llvm/Config/config.h ============================================================================== --- head/lib/clang/include/llvm/Config/config.h Fri May 3 15:54:13 2013 (r250216) +++ head/lib/clang/include/llvm/Config/config.h Fri May 3 16:29:51 2013 (r250217) @@ -5,6 +5,9 @@ #ifndef CONFIG_H #define CONFIG_H +/* Get __FreeBSD_version. */ +#include + /* Bug report URL. */ #define BUG_REPORT_URL "http://llvm.org/bugs/" @@ -248,7 +251,9 @@ #define HAVE_LOG10 1 /* Define to 1 if you have the `log2' function. */ +#if __FreeBSD_version >= 900027 || (__FreeBSD_version < 900000 && __FreeBSD_version >= 802502) #define HAVE_LOG2 1 +#endif /* Define to 1 if you have the `longjmp' function. */ #define HAVE_LONGJMP 1 From owner-svn-src-head@FreeBSD.ORG Fri May 3 17:20:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 813C7493; Fri, 3 May 2013 17:20:19 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id 5F99C12D1; Fri, 3 May 2013 17:20:19 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id ACE7AB990; Fri, 3 May 2013 13:20:18 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Subject: Re: svn commit: r250193 - head/sys/fs/msdosfs Date: Fri, 3 May 2013 11:55:47 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201305022000.r42K0Bdk098965@svn.freebsd.org> In-Reply-To: <201305022000.r42K0Bdk098965@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201305031155.47559.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 03 May 2013 13:20:18 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 17:20:19 -0000 On Thursday, May 02, 2013 4:00:11 pm Konstantin Belousov wrote: > Author: kib > Date: Thu May 2 20:00:11 2013 > New Revision: 250193 > URL: http://svnweb.freebsd.org/changeset/base/250193 > > Log: > The fsync(2) call should sync the vnode in such way that even after > system crash which happen after successfull fsync() return, the data > is accessible. For msdosfs, this means that FAT entries for the file > must be written. > > Since we do not track the FAT blocks containing entries for the > current file, just do a sloppy sync of the devvp vnode for the mount, > which buffers, among other things, contain FAT blocks. > > Simultaneously, for deupdat(): > - optimize by clearing the modified flags before short-circuiting a > return, if the mount is read-only; > - only ignore the rest of the function for denode with DE_MODIFIED > flag clear when the waitfor argument is false. The directory buffer > for the entry might be of delayed write; > - microoptimize by comparing the updated directory entry with the > current block content; > - try to cluster the write, fall back to bawrite() if low on > resources. > > Based on the submission by: bde > MFC after: 2 weeks Does this fix kern/62762? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri May 3 18:37:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 21D40EB1; Fri, 3 May 2013 18:37:51 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 12FEA1BF6; Fri, 3 May 2013 18:37:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43IboiW083482; Fri, 3 May 2013 18:37:50 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43Iboth083479; Fri, 3 May 2013 18:37:50 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201305031837.r43Iboth083479@svn.freebsd.org> From: Navdeep Parhar Date: Fri, 3 May 2013 18:37:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250218 - head/sys/dev/cxgbe/tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 18:37:51 -0000 Author: np Date: Fri May 3 18:37:50 2013 New Revision: 250218 URL: http://svnweb.freebsd.org/changeset/base/250218 Log: cxgbe/tom: Do not use M_PROTO1 to mark rx zero-copy mbufs as special. All the M_PROTOn flags are clobbered when an mbuf is appended to the socket buffer. MFC after: 1 week Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_ddp.c head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Fri May 3 16:29:51 2013 (r250217) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Fri May 3 18:37:50 2013 (r250218) @@ -827,15 +827,8 @@ do_peer_close(struct sge_iq *iq, const s sb = &so->so_rcv; SOCKBUF_LOCK(sb); if (__predict_false(toep->ddp_flags & (DDP_BUF0_ACTIVE | DDP_BUF1_ACTIVE))) { - m = m_get(M_NOWAIT, MT_DATA); - if (m == NULL) - CXGBE_UNIMPLEMENTED("mbuf alloc failure"); - - m->m_len = be32toh(cpl->rcv_nxt) - tp->rcv_nxt; - m->m_flags |= M_DDP; /* Data is already where it should be */ - m->m_data = "nothing to see here"; + m = get_ddp_mbuf(be32toh(cpl->rcv_nxt) - tp->rcv_nxt); tp->rcv_nxt = be32toh(cpl->rcv_nxt); - toep->ddp_flags &= ~(DDP_BUF0_ACTIVE | DDP_BUF1_ACTIVE); KASSERT(toep->sb_cc >= sb->sb_cc, Modified: head/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_ddp.c Fri May 3 16:29:51 2013 (r250217) +++ head/sys/dev/cxgbe/tom/t4_ddp.c Fri May 3 18:37:50 2013 (r250218) @@ -217,13 +217,7 @@ insert_ddp_data(struct toepcb *toep, uin INP_WLOCK_ASSERT(inp); SOCKBUF_LOCK_ASSERT(sb); - m = m_get(M_NOWAIT, MT_DATA); - if (m == NULL) - CXGBE_UNIMPLEMENTED("mbuf alloc failure"); - m->m_len = n; - m->m_flags |= M_DDP; /* Data is already where it should be */ - m->m_data = "nothing to see here"; - + m = get_ddp_mbuf(n); tp->rcv_nxt += n; #ifndef USE_DDP_RX_FLOW_CONTROL KASSERT(tp->rcv_wnd >= n, ("%s: negative window size", __func__)); @@ -457,13 +451,7 @@ handle_ddp_data(struct toepcb *toep, __b KASSERT(tp->rcv_wnd >= len, ("%s: negative window size", __func__)); tp->rcv_wnd -= len; #endif - - m = m_get(M_NOWAIT, MT_DATA); - if (m == NULL) - CXGBE_UNIMPLEMENTED("mbuf alloc failure"); - m->m_len = len; - m->m_flags |= M_DDP; /* Data is already where it should be */ - m->m_data = "nothing to see here"; + m = get_ddp_mbuf(len); SOCKBUF_LOCK(sb); if (report & F_DDP_BUF_COMPLETE) @@ -1022,6 +1010,29 @@ soreceive_rcvoob(struct socket *so, stru CXGBE_UNIMPLEMENTED(__func__); } +static char ddp_magic_str[] = "nothing to see here"; + +struct mbuf * +get_ddp_mbuf(int len) +{ + struct mbuf *m; + + m = m_get(M_NOWAIT, MT_DATA); + if (m == NULL) + CXGBE_UNIMPLEMENTED("mbuf alloc failure"); + m->m_len = len; + m->m_data = &ddp_magic_str[0]; + + return (m); +} + +static inline int +is_ddp_mbuf(struct mbuf *m) +{ + + return (m->m_data == &ddp_magic_str[0]); +} + /* * Copy an mbuf chain into a uio limited by len if set. */ @@ -1040,7 +1051,7 @@ m_mbuftouio_ddp(struct uio *uio, struct for (; m != NULL; m = m->m_next) { length = min(m->m_len, total - progress); - if (m->m_flags & M_DDP) { + if (is_ddp_mbuf(m)) { enum uio_seg segflag = uio->uio_segflg; uio->uio_segflg = UIO_NOCOPY; Modified: head/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.h Fri May 3 16:29:51 2013 (r250217) +++ head/sys/dev/cxgbe/tom/t4_tom.h Fri May 3 18:37:50 2013 (r250218) @@ -49,8 +49,6 @@ #define DDP_RSVD_WIN (16 * 1024U) #define SB_DDP_INDICATE SB_IN_TOE /* soreceive must respond to indicate */ -#define M_DDP M_PROTO1 - #define USE_DDP_RX_FLOW_CONTROL /* TOE PCB flags */ @@ -279,6 +277,7 @@ void t4_init_ddp(struct adapter *, struc void t4_uninit_ddp(struct adapter *, struct tom_data *); int t4_soreceive_ddp(struct socket *, struct sockaddr **, struct uio *, struct mbuf **, struct mbuf **, int *); +struct mbuf *get_ddp_mbuf(int); void enable_ddp(struct adapter *, struct toepcb *toep); void release_ddp_resources(struct toepcb *toep); void insert_ddp_data(struct toepcb *, uint32_t); From owner-svn-src-head@FreeBSD.ORG Fri May 3 18:54:01 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DAEE04AF; Fri, 3 May 2013 18:54:01 +0000 (UTC) (envelope-from gonzo@id.bluezbox.com) Received: from id.bluezbox.com (id.bluezbox.com [88.198.91.248]) by mx1.freebsd.org (Postfix) with ESMTP id 8B3181D81; Fri, 3 May 2013 18:54:01 +0000 (UTC) Received: from [88.198.91.248] (helo=[IPv6:::1]) by id.bluezbox.com with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1UYL7A-00070M-8k; Fri, 03 May 2013 11:53:54 -0700 Message-ID: <518407BE.2020501@freebsd.org> Date: Fri, 03 May 2013 11:53:50 -0700 From: Oleksandr Tymoshenko User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: Tim Kientzle Subject: Re: svn commit: r249774 - head/sys/boot/fdt/dts References: <201304221853.r3MIram6060889@svn.freebsd.org> <8DA5B1ED-C616-4D2F-9235-E37A89F7EABE@kientzle.com> In-Reply-To: <8DA5B1ED-C616-4D2F-9235-E37A89F7EABE@kientzle.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: gonzo@id.bluezbox.com X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: On 4/29/2013 9:31 PM, Tim Kientzle wrote: > On Apr 22, 2013, at 11:53 AM, Oleksandr Tymoshenko wrote: > >> Author: gonzo >> Date: Mon Apr 22 18:53:36 2013 >> New Revision: 249774 >> URL: http://svnweb.freebsd.org/changeset/base/249774 >> >> Log: >> Split BeagleBone DTS to generic AM335x part and Beagle-bone specific >> >> Added: >> head/sys/boot/fdt/dts/am335x.dtsi (contents, props changed) >> Modified: >> head/sys/boot/fdt/dts/beaglebone.dts >> >> Added: head/sys/boot/fdt/dts/am335x.dtsi >> ============================================================================== >> + >> +/ { >> + compatible = "ti,am335x"; >> >> Modified: head/sys/boot/fdt/dts/beaglebone.dts >> ============================================================================== >> >> +/include/ "am335x.dtsi" >> + >> / { >> model = "beaglebone"; >> - compatible = "beaglebone", "ti,am335x"; > > This used to have two "compatible" names; now it only has one. > > Is there a way to have both again? > > (Mostly I'm just curious; I'm still learning FDT conventions.) > [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 18:54:01 -0000 On 4/29/2013 9:31 PM, Tim Kientzle wrote: > On Apr 22, 2013, at 11:53 AM, Oleksandr Tymoshenko wrote: > >> Author: gonzo >> Date: Mon Apr 22 18:53:36 2013 >> New Revision: 249774 >> URL: http://svnweb.freebsd.org/changeset/base/249774 >> >> Log: >> Split BeagleBone DTS to generic AM335x part and Beagle-bone specific >> >> Added: >> head/sys/boot/fdt/dts/am335x.dtsi (contents, props changed) >> Modified: >> head/sys/boot/fdt/dts/beaglebone.dts >> >> Added: head/sys/boot/fdt/dts/am335x.dtsi >> ============================================================================== >> + >> +/ { >> + compatible = "ti,am335x"; >> >> Modified: head/sys/boot/fdt/dts/beaglebone.dts >> ============================================================================== >> >> +/include/ "am335x.dtsi" >> + >> / { >> model = "beaglebone"; >> - compatible = "beaglebone", "ti,am335x"; > > This used to have two "compatible" names; now it only has one. > > Is there a way to have both again? > > (Mostly I'm just curious; I'm still learning FDT conventions.) > I think it was wrong of me to move compatible property to dtsi. I'll move it back to main .dts file. Thanks for spotting. From owner-svn-src-head@FreeBSD.ORG Fri May 3 18:58:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 56A1F98F; Fri, 3 May 2013 18:58:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4829B1DF9; Fri, 3 May 2013 18:58:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43Iwcgf090427; Fri, 3 May 2013 18:58:38 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43IwcAv090426; Fri, 3 May 2013 18:58:38 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201305031858.r43IwcAv090426@svn.freebsd.org> From: John Baldwin Date: Fri, 3 May 2013 18:58:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250219 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 18:58:38 -0000 Author: jhb Date: Fri May 3 18:58:37 2013 New Revision: 250219 URL: http://svnweb.freebsd.org/changeset/base/250219 Log: Fix two bugs in the current NUMA-aware allocation code: - vm_phys_alloc_freelist_pages() can be called by vm_page_alloc_freelist() to allocate a page from a specific freelist. In the NUMA case it did not properly map the public VM_FREELIST_* constants to the correct backing freelists, nor did it try all NUMA domains for allocations from VM_FREELIST_DEFAULT. - vm_phys_alloc_pages() did not pin the thread and each call to vm_phys_alloc_freelist_pages() fetched the current domain to choose which freelist to use. If a thread migrated domains during the loop in vm_phys_alloc_pages() it could skip one of the freelists. If the other freelists were out of memory then it is possible that vm_phys_alloc_pages() would fail to allocate a page even though pages were available resulting in a panic in vm_page_alloc(). Reviewed by: alc MFC after: 1 week Modified: head/sys/vm/vm_phys.c Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Fri May 3 18:37:50 2013 (r250218) +++ head/sys/vm/vm_phys.c Fri May 3 18:58:37 2013 (r250219) @@ -122,6 +122,8 @@ SYSCTL_OID(_vm, OID_AUTO, phys_lookup_li NULL, 0, sysctl_vm_phys_lookup_lists, "A", "Phys Lookup Lists"); #endif +static vm_page_t vm_phys_alloc_domain_pages(int domain, int flind, int pool, + int order); static void _vm_phys_create_seg(vm_paddr_t start, vm_paddr_t end, int flind, int domain); static void vm_phys_create_seg(vm_paddr_t start, vm_paddr_t end, int flind); @@ -435,10 +437,20 @@ vm_page_t vm_phys_alloc_pages(int pool, int order) { vm_page_t m; - int flind; + int domain, flind; + + KASSERT(pool < VM_NFREEPOOL, + ("vm_phys_alloc_pages: pool %d is out of range", pool)); + KASSERT(order < VM_NFREEORDER, + ("vm_phys_alloc_pages: order %d is out of range", order)); +#if VM_NDOMAIN > 1 + domain = PCPU_GET(domain); +#else + domain = 0; +#endif for (flind = 0; flind < vm_nfreelists; flind++) { - m = vm_phys_alloc_freelist_pages(flind, pool, order); + m = vm_phys_alloc_domain_pages(domain, flind, pool, order); if (m != NULL) return (m); } @@ -451,11 +463,12 @@ vm_phys_alloc_pages(int pool, int order) */ vm_page_t vm_phys_alloc_freelist_pages(int flind, int pool, int order) -{ - struct vm_freelist *fl; - struct vm_freelist *alt; - int domain, oind, pind; +{ +#if VM_NDOMAIN > 1 vm_page_t m; + int i, ndomains; +#endif + int domain; KASSERT(flind < VM_NFREELIST, ("vm_phys_alloc_freelist_pages: freelist %d is out of range", flind)); @@ -465,10 +478,39 @@ vm_phys_alloc_freelist_pages(int flind, ("vm_phys_alloc_freelist_pages: order %d is out of range", order)); #if VM_NDOMAIN > 1 + /* + * This routine expects to be called with a VM_FREELIST_* constant. + * On a system with multiple domains we need to adjust the flind + * appropriately. If it is for VM_FREELIST_DEFAULT we need to + * iterate over the per-domain lists. + */ domain = PCPU_GET(domain); + ndomains = vm_nfreelists - VM_NFREELIST + 1; + if (flind == VM_FREELIST_DEFAULT) { + m = NULL; + for (i = 0; i < ndomains; i++, flind++) { + m = vm_phys_alloc_domain_pages(domain, flind, pool, + order); + if (m != NULL) + break; + } + return (m); + } else if (flind > VM_FREELIST_DEFAULT) + flind += ndomains - 1; #else domain = 0; #endif + return (vm_phys_alloc_domain_pages(domain, flind, pool, order)); +} + +static vm_page_t +vm_phys_alloc_domain_pages(int domain, int flind, int pool, int order) +{ + struct vm_freelist *fl; + struct vm_freelist *alt; + int oind, pind; + vm_page_t m; + mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); fl = (*vm_phys_lookup_lists[domain][flind])[pool]; for (oind = order; oind < VM_NFREEORDER; oind++) { From owner-svn-src-head@FreeBSD.ORG Fri May 3 19:08:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7108F115; Fri, 3 May 2013 19:08:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 62BC11E95; Fri, 3 May 2013 19:08:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43J8xkB094419; Fri, 3 May 2013 19:08:59 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43J8xnI094418; Fri, 3 May 2013 19:08:59 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201305031908.r43J8xnI094418@svn.freebsd.org> From: John Baldwin Date: Fri, 3 May 2013 19:08:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250220 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 19:08:59 -0000 Author: jhb Date: Fri May 3 19:08:58 2013 New Revision: 250220 URL: http://svnweb.freebsd.org/changeset/base/250220 Log: Fix FIONREAD on regular files. The computed result was being ignored and it was being passed down to VOP_IOCTL() where it promptly resulted in ENOTTY due to a missing else for the past 8 years. While here, use a shared vnode lock while fetching the current file's size. MFC after: 1 week Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Fri May 3 18:58:37 2013 (r250219) +++ head/sys/kern/vfs_vnops.c Fri May 3 19:08:58 2013 (r250220) @@ -1364,13 +1364,12 @@ vn_ioctl(fp, com, data, active_cred, td) case VREG: case VDIR: if (com == FIONREAD) { - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(vp, LK_SHARED | LK_RETRY); error = VOP_GETATTR(vp, &vattr, active_cred); VOP_UNLOCK(vp, 0); if (!error) *(int *)data = vattr.va_size - fp->f_offset; - } - if (com == FIONBIO || com == FIOASYNC) /* XXX */ + } else if (com == FIONBIO || com == FIOASYNC) /* XXX */ error = 0; else error = VOP_IOCTL(vp, com, data, fp->f_flag, From owner-svn-src-head@FreeBSD.ORG Fri May 3 20:09:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BC4C1C6; Fri, 3 May 2013 20:09:18 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E1D55113B; Fri, 3 May 2013 20:09:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43K9HNO015643; Fri, 3 May 2013 20:09:17 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43K9HQM015642; Fri, 3 May 2013 20:09:17 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201305032009.r43K9HQM015642@svn.freebsd.org> From: Navdeep Parhar Date: Fri, 3 May 2013 20:09:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250221 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 20:09:18 -0000 Author: np Date: Fri May 3 20:09:17 2013 New Revision: 250221 URL: http://svnweb.freebsd.org/changeset/base/250221 Log: cxgbe: Switch to a better way to install firmware. MFC after: 1 week Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Fri May 3 19:08:58 2013 (r250220) +++ head/sys/dev/cxgbe/t4_main.c Fri May 3 20:09:17 2013 (r250221) @@ -2037,7 +2037,7 @@ prep_firmware(struct adapter *sc) should_install_kld_fw(sc, card_fw_usable, be32toh(kld_fw->fw_ver), be32toh(card_fw->fw_ver))) { - rc = -t4_load_fw(sc, fw->data, fw->datasize); + rc = -t4_fw_upgrade(sc, sc->mbox, fw->data, fw->datasize, 0); if (rc != 0) { device_printf(sc->dev, "failed to install firmware: %d\n", rc); From owner-svn-src-head@FreeBSD.ORG Fri May 3 20:35:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 04A42E07; Fri, 3 May 2013 20:35:50 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 6F36612B8; Fri, 3 May 2013 20:35:49 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id r43KZfUB000628; Fri, 3 May 2013 23:35:41 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.2 kib.kiev.ua r43KZfUB000628 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id r43KZflx000627; Fri, 3 May 2013 23:35:41 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 3 May 2013 23:35:41 +0300 From: Konstantin Belousov To: John Baldwin Subject: Re: svn commit: r250193 - head/sys/fs/msdosfs Message-ID: <20130503203541.GS3047@kib.kiev.ua> References: <201305022000.r42K0Bdk098965@svn.freebsd.org> <201305031155.47559.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4YkaNtrv9TjfxRWe" Content-Disposition: inline In-Reply-To: <201305031155.47559.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 20:35:50 -0000 --4YkaNtrv9TjfxRWe Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 03, 2013 at 11:55:47AM -0400, John Baldwin wrote: > On Thursday, May 02, 2013 4:00:11 pm Konstantin Belousov wrote: > > Author: kib > > Date: Thu May 2 20:00:11 2013 > > New Revision: 250193 > > URL: http://svnweb.freebsd.org/changeset/base/250193 > >=20 > > Log: > > The fsync(2) call should sync the vnode in such way that even after > > system crash which happen after successfull fsync() return, the data > > is accessible. For msdosfs, this means that FAT entries for the file > > must be written. > > =20 > > Since we do not track the FAT blocks containing entries for the > > current file, just do a sloppy sync of the devvp vnode for the mount, > > which buffers, among other things, contain FAT blocks. =2E.. > Does this fix kern/62762? >=20 Supposedly yes, I even possibly have seen this PR before. At least, it is understandable why do you remember about it now. I definitely do not want to take the approach of precisely calculating the list of FAT blocks which needs to be synced. --4YkaNtrv9TjfxRWe Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJRhB+cAAoJEJDCuSvBvK1BvD8P/Rww9IT+1xhgWqaLRdEix/TW LtOU7gVduHTu2u0V7IQ1I7Eh8sa12+TgGGAM5a48oe9HoZrefMRDXiOZyJtuXTkR UZWDvTMS8XbDMH7jBpkr7KPwwMLls4ab/9FZ2aj2yi0FaYm6YfwKi0bglw4LsxOt sOvafc34kw3WhKgGAeaoagVUXRyHIrC6JbkjolSi/dE44pwpjd13/WacSE4ZXBAj 7nk3+koUCrSDoGyJePHvYNr5u8wE+5LPYrGpL5HG3XA+35G2wiAcVv0DSM+HmxXf C8d2se7IGwkWmOwqyxLBYdGXYAtf2M6VlgYwMK7kC/siprV7OhAJ/MN5i2FYVShZ JcN6IkacgqKzC2ER38I4FYrYrXYGvpu9bkxXbLpAwwccnaWMIkyMWkMqChZOPDvJ OI0XTOEHv+8xJGdDyJQnLr2i6lj86L6BBKyx3rL9c6BLppvJRfmxgu3A09W7vQh9 MSGgISgdFMHNHqlN7UD7EOS8lpQPmErTyPp34/7rpRCYGnynWOjzWSA9GS2kuqi8 wB8p+UywJ9RS9Hgq3kYSb202/4s7MfgQQs91ePLuPEg1oH2OCZsU049lBOw/gvJI LdTklxD8qEwQEmyoNHh5exFYcCupbpAvTC30LD3kx79DXDfSa2w9hEakKmazrsvu XmhdIpQ4havDnFuXao3Q =RkOO -----END PGP SIGNATURE----- --4YkaNtrv9TjfxRWe-- From owner-svn-src-head@FreeBSD.ORG Fri May 3 20:39:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 80B4D2DB; Fri, 3 May 2013 20:39:54 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 590D112ED; Fri, 3 May 2013 20:39:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43Kdsa8026588; Fri, 3 May 2013 20:39:54 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43KdsZp026587; Fri, 3 May 2013 20:39:54 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305032039.r43KdsZp026587@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 3 May 2013 20:39:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250222 - head/tools/regression/bin/sh/builtins X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 20:39:54 -0000 Author: jilles Date: Fri May 3 20:39:53 2013 New Revision: 250222 URL: http://svnweb.freebsd.org/changeset/base/250222 Log: sh: Remove racy test case for read builtin. This test case sometimes fails because of an EINTR-related race condition. Fixing this race condition likely requires an extra system call per byte, which would make the read builtin even slower than it already is, or very complicated trickery. Therefore, remove the test case for now. Deleted: head/tools/regression/bin/sh/builtins/read8.0 From owner-svn-src-head@FreeBSD.ORG Fri May 3 20:54:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B92CA4B0; Fri, 3 May 2013 20:54:51 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id 97B9613B9; Fri, 3 May 2013 20:54:51 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id DB876B939; Fri, 3 May 2013 16:54:50 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Subject: Re: svn commit: r250219 - head/sys/vm Date: Fri, 3 May 2013 16:47:11 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201305031858.r43IwcAv090426@svn.freebsd.org> In-Reply-To: <201305031858.r43IwcAv090426@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201305031647.11408.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 03 May 2013 16:54:51 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 20:54:51 -0000 On Friday, May 03, 2013 2:58:38 pm John Baldwin wrote: > Author: jhb > Date: Fri May 3 18:58:37 2013 > New Revision: 250219 > URL: http://svnweb.freebsd.org/changeset/base/250219 > > Log: > Fix two bugs in the current NUMA-aware allocation code: > - vm_phys_alloc_freelist_pages() can be called by vm_page_alloc_freelist() > to allocate a page from a specific freelist. In the NUMA case it did not > properly map the public VM_FREELIST_* constants to the correct backing > freelists, nor did it try all NUMA domains for allocations from > VM_FREELIST_DEFAULT. In practice this should never occur as only mips uses this function and the mips code doesn't support multiple domains yet. > - vm_phys_alloc_pages() did not pin the thread and each call to > vm_phys_alloc_freelist_pages() fetched the current domain to choose > which freelist to use. If a thread migrated domains during the loop > in vm_phys_alloc_pages() it could skip one of the freelists. If the > other freelists were out of memory then it is possible that > vm_phys_alloc_pages() would fail to allocate a page even though pages > were available resulting in a panic in vm_page_alloc(). I have seen multiple instances of this panic in production loads however. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri May 3 20:54:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8D9BC4B2; Fri, 3 May 2013 20:54:54 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id 6A4A613BA; Fri, 3 May 2013 20:54:54 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 914E8B945; Fri, 3 May 2013 16:54:53 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Subject: Re: svn commit: r250193 - head/sys/fs/msdosfs Date: Fri, 3 May 2013 16:50:12 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201305022000.r42K0Bdk098965@svn.freebsd.org> <201305031155.47559.jhb@freebsd.org> <20130503203541.GS3047@kib.kiev.ua> In-Reply-To: <20130503203541.GS3047@kib.kiev.ua> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201305031650.12397.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 03 May 2013 16:54:53 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 20:54:54 -0000 On Friday, May 03, 2013 4:35:41 pm Konstantin Belousov wrote: > On Fri, May 03, 2013 at 11:55:47AM -0400, John Baldwin wrote: > > On Thursday, May 02, 2013 4:00:11 pm Konstantin Belousov wrote: > > > Author: kib > > > Date: Thu May 2 20:00:11 2013 > > > New Revision: 250193 > > > URL: http://svnweb.freebsd.org/changeset/base/250193 > > > > > > Log: > > > The fsync(2) call should sync the vnode in such way that even after > > > system crash which happen after successfull fsync() return, the data > > > is accessible. For msdosfs, this means that FAT entries for the file > > > must be written. > > > > > > Since we do not track the FAT blocks containing entries for the > > > current file, just do a sloppy sync of the devvp vnode for the mount, > > > which buffers, among other things, contain FAT blocks. > ... > > > Does this fix kern/62762? > > > > Supposedly yes, I even possibly have seen this PR before. > At least, it is understandable why do you remember about it now. > > I definitely do not want to take the approach of precisely calculating > the list of FAT blocks which needs to be synced. No, that seems too painful. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri May 3 21:11:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A92B58B9; Fri, 3 May 2013 21:11:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9AB63151E; Fri, 3 May 2013 21:11:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43LBxZx040522; Fri, 3 May 2013 21:11:59 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43LBvZ3040508; Fri, 3 May 2013 21:11:57 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201305032111.r43LBvZ3040508@svn.freebsd.org> From: John Baldwin Date: Fri, 3 May 2013 21:11:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250223 - in head: lib/libprocstat sys/kern sys/sys usr.bin/fstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 21:11:59 -0000 Author: jhb Date: Fri May 3 21:11:57 2013 New Revision: 250223 URL: http://svnweb.freebsd.org/changeset/base/250223 Log: Similar to 233760 and 236717, export some more useful info about the kernel-based POSIX semaphore descriptors to userland via procstat(1) and fstat(1): - Change sem file descriptors to track the pathname they are associated with and add a ksem_info() method to copy the path out to a caller-supplied buffer. - Use the fo_stat() method of shared memory objects and ksem_info() to export the path, mode, and value of a semaphore via struct kinfo_file. - Add a struct semstat to the libprocstat(3) interface along with a procstat_get_sem_info() to export the mode and value of a semaphore. - Teach fstat about semaphores and to display their path, mode, and value. MFC after: 2 weeks Modified: head/lib/libprocstat/Symbol.map head/lib/libprocstat/libprocstat.3 head/lib/libprocstat/libprocstat.c head/lib/libprocstat/libprocstat.h head/sys/kern/kern_descrip.c head/sys/kern/uipc_sem.c head/sys/sys/ksem.h head/sys/sys/user.h head/usr.bin/fstat/fstat.1 head/usr.bin/fstat/fstat.c Modified: head/lib/libprocstat/Symbol.map ============================================================================== --- head/lib/libprocstat/Symbol.map Fri May 3 20:39:53 2013 (r250222) +++ head/lib/libprocstat/Symbol.map Fri May 3 21:11:57 2013 (r250223) @@ -22,6 +22,7 @@ FBSD_1.3 { procstat_freegroups; procstat_freekstack; procstat_freevmmap; + procstat_get_sem_info; procstat_get_shm_info; procstat_getargv; procstat_getauxv; Modified: head/lib/libprocstat/libprocstat.3 ============================================================================== --- head/lib/libprocstat/libprocstat.3 Fri May 3 20:39:53 2013 (r250222) +++ head/lib/libprocstat/libprocstat.3 Fri May 3 21:11:57 2013 (r250223) @@ -53,6 +53,7 @@ .Nm procstat_freevmmap , .Nm procstat_get_pipe_info , .Nm procstat_get_pts_info , +.Nm procstat_get_sem_info , .Nm procstat_get_shm_info , .Nm procstat_get_socket_info , .Nm procstat_get_vnode_info @@ -115,6 +116,13 @@ .Fa "char *errbuf" .Fc .Ft int +.Fo procstat_get_sem_info +.Fa "struct procstat *procstat" +.Fa "struct filestat *fst" +.Fa "struct semstat *sem" +.Fa "char *errbuf" +.Fc +.Ft int .Fo procstat_get_shm_info .Fa "struct procstat *procstat" .Fa "struct filestat *fst" @@ -463,12 +471,13 @@ function call. The .Fn procstat_get_pipe_info , .Fn procstat_get_pts_info , +.Fn procstat_get_sem_info , .Fn procstat_get_shm_info , .Fn procstat_get_socket_info and .Fn procstat_get_vnode_info functions are used to retrieve information about pipes, pseudo-terminals, -shared memory objects, +semaphores, shared memory objects, sockets, and vnodes, respectively. Each of them have a similar interface API. The @@ -505,6 +514,8 @@ argument indicates an actual error messa .Nm procstat_get_pipe_info .It Li PS_FST_TYPE_PTS .Nm procstat_get_pts_info +.It Li PS_FST_TYPE_SEM +.Nm procstat_get_sem_info .It Li PS_FST_TYPE_SHM .Nm procstat_get_shm_info .El @@ -517,6 +528,7 @@ argument indicates an actual error messa .Xr elf 3 , .Xr kvm 3 , .Xr queue 3 , +.Xr sem_open 3 , .Xr sysctl 3 , .Xr pts 4 , .Xr core 5 , Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Fri May 3 20:39:53 2013 (r250222) +++ head/lib/libprocstat/libprocstat.c Fri May 3 21:11:57 2013 (r250223) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #define _WANT_FILE #include #include +#include #include #define _KERNEL #include @@ -129,6 +130,10 @@ static int procstat_get_pts_info_sysctl( struct ptsstat *pts, char *errbuf); static int procstat_get_pts_info_kvm(kvm_t *kd, struct filestat *fst, struct ptsstat *pts, char *errbuf); +static int procstat_get_sem_info_sysctl(struct filestat *fst, + struct semstat *sem, char *errbuf); +static int procstat_get_sem_info_kvm(kvm_t *kd, struct filestat *fst, + struct semstat *sem, char *errbuf); static int procstat_get_shm_info_sysctl(struct filestat *fst, struct shmstat *shm, char *errbuf); static int procstat_get_shm_info_kvm(kvm_t *kd, struct filestat *fst, @@ -556,6 +561,10 @@ procstat_getfiles_kvm(struct procstat *p data = file.f_data; break; #endif + case DTYPE_SEM: + type = PS_FST_TYPE_SEM; + data = file.f_data; + break; case DTYPE_SHM: type = PS_FST_TYPE_SHM; data = file.f_data; @@ -1003,6 +1012,87 @@ procstat_get_pts_info_sysctl(struct file } int +procstat_get_sem_info(struct procstat *procstat, struct filestat *fst, + struct semstat *sem, char *errbuf) +{ + + assert(sem); + if (procstat->type == PROCSTAT_KVM) { + return (procstat_get_sem_info_kvm(procstat->kd, fst, sem, + errbuf)); + } else if (procstat->type == PROCSTAT_SYSCTL || + procstat->type == PROCSTAT_CORE) { + return (procstat_get_sem_info_sysctl(fst, sem, errbuf)); + } else { + warnx("unknown access method: %d", procstat->type); + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + return (1); + } +} + +static int +procstat_get_sem_info_kvm(kvm_t *kd, struct filestat *fst, + struct semstat *sem, char *errbuf) +{ + struct ksem ksem; + void *ksemp; + char *path; + int i; + + assert(kd); + assert(sem); + assert(fst); + bzero(sem, sizeof(*sem)); + ksemp = fst->fs_typedep; + if (ksemp == NULL) + goto fail; + if (!kvm_read_all(kd, (unsigned long)ksemp, &ksem, + sizeof(struct ksem))) { + warnx("can't read ksem at %p", (void *)ksemp); + goto fail; + } + sem->mode = S_IFREG | ksem.ks_mode; + sem->value = ksem.ks_value; + if (fst->fs_path == NULL && ksem.ks_path != NULL) { + path = malloc(MAXPATHLEN); + for (i = 0; i < MAXPATHLEN - 1; i++) { + if (!kvm_read_all(kd, (unsigned long)ksem.ks_path + i, + path + i, 1)) + break; + if (path[i] == '\0') + break; + } + path[i] = '\0'; + if (i == 0) + free(path); + else + fst->fs_path = path; + } + return (0); + +fail: + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + return (1); +} + +static int +procstat_get_sem_info_sysctl(struct filestat *fst, struct semstat *sem, + char *errbuf __unused) +{ + struct kinfo_file *kif; + + assert(sem); + assert(fst); + bzero(sem, sizeof(*sem)); + kif = fst->fs_typedep; + if (kif == NULL) + return (0); + sem->value = kif->kf_un.kf_sem.kf_sem_value; + sem->mode = kif->kf_un.kf_sem.kf_sem_mode; + return (0); +} + +int procstat_get_shm_info(struct procstat *procstat, struct filestat *fst, struct shmstat *shm, char *errbuf) { Modified: head/lib/libprocstat/libprocstat.h ============================================================================== --- head/lib/libprocstat/libprocstat.h Fri May 3 20:39:53 2013 (r250222) +++ head/lib/libprocstat/libprocstat.h Fri May 3 21:11:57 2013 (r250223) @@ -133,6 +133,10 @@ struct pipestat { uint64_t addr; uint64_t peer; }; +struct semstat { + uint32_t value; + uint16_t mode; +}; struct shmstat { uint64_t size; uint16_t mode; @@ -177,6 +181,8 @@ int procstat_get_pipe_info(struct procst struct pipestat *pipe, char *errbuf); int procstat_get_pts_info(struct procstat *procstat, struct filestat *fst, struct ptsstat *pts, char *errbuf); +int procstat_get_sem_info(struct procstat *procstat, struct filestat *fst, + struct semstat *sem, char *errbuf); int procstat_get_shm_info(struct procstat *procstat, struct filestat *fst, struct shmstat *shm, char *errbuf); int procstat_get_socket_info(struct procstat *procstat, struct filestat *fst, Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Fri May 3 20:39:53 2013 (r250222) +++ head/sys/kern/kern_descrip.c Fri May 3 21:11:57 2013 (r250223) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -111,6 +112,7 @@ MALLOC_DECLARE(M_FADVISE); static uma_zone_t file_zone; +void (*ksem_info)(struct ksem *ks, char *path, size_t size, uint32_t *value); static int closefp(struct filedesc *fdp, int fd, struct file *fp, struct thread *td, int holdleaders); @@ -123,6 +125,7 @@ static int fill_pipe_info(struct pipe *p static int fill_procdesc_info(struct procdesc *pdp, struct kinfo_file *kif); static int fill_pts_info(struct tty *tp, struct kinfo_file *kif); +static int fill_sem_info(struct file *fp, struct kinfo_file *kif); static int fill_shm_info(struct file *fp, struct kinfo_file *kif); static int fill_socket_info(struct socket *so, struct kinfo_file *kif); static int fill_vnode_info(struct vnode *vp, struct kinfo_file *kif); @@ -2968,6 +2971,7 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLE struct shmfd *shmfd; struct socket *so; struct vnode *vp; + struct ksem *ks; struct file *fp; struct proc *p; struct tty *tp; @@ -2996,6 +3000,7 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLE continue; bzero(kif, sizeof(*kif)); kif->kf_structsize = sizeof(*kif); + ks = NULL; vp = NULL; so = NULL; tp = NULL; @@ -3041,6 +3046,7 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLE case DTYPE_SEM: kif->kf_type = KF_TYPE_SEM; + ks = fp->f_data; break; case DTYPE_PTS: @@ -3150,6 +3156,8 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLE } if (shmfd != NULL) shm_path(shmfd, kif->kf_path, sizeof(kif->kf_path)); + if (ks != NULL && ksem_info != NULL) + ksem_info(ks, kif->kf_path, sizeof(kif->kf_path), NULL); error = SYSCTL_OUT(req, kif, sizeof(*kif)); if (error) break; @@ -3220,6 +3228,9 @@ export_fd_to_sb(void *data, int type, in case KF_TYPE_PROCDESC: error = fill_procdesc_info((struct procdesc *)data, kif); break; + case KF_TYPE_SEM: + error = fill_sem_info((struct file *)data, kif); + break; case KF_TYPE_SHM: error = fill_shm_info((struct file *)data, kif); break; @@ -3387,6 +3398,7 @@ kern_proc_filedesc_out(struct proc *p, case DTYPE_SEM: type = KF_TYPE_SEM; + data = fp; break; case DTYPE_PTS: @@ -3621,6 +3633,25 @@ fill_procdesc_info(struct procdesc *pdp, } static int +fill_sem_info(struct file *fp, struct kinfo_file *kif) +{ + struct thread *td; + struct stat sb; + + td = curthread; + if (fp->f_data == NULL) + return (1); + if (fo_stat(fp, &sb, td->td_ucred, td) != 0) + return (1); + if (ksem_info == NULL) + return (1); + ksem_info(fp->f_data, kif->kf_path, sizeof(kif->kf_path), + &kif->kf_un.kf_sem.kf_sem_value); + kif->kf_un.kf_sem.kf_sem_mode = sb.st_mode; + return (0); +} + +static int fill_shm_info(struct file *fp, struct kinfo_file *kif) { struct thread *td; Modified: head/sys/kern/uipc_sem.c ============================================================================== --- head/sys/kern/uipc_sem.c Fri May 3 20:39:53 2013 (r250222) +++ head/sys/kern/uipc_sem.c Fri May 3 21:11:57 2013 (r250223) @@ -71,7 +71,6 @@ FEATURE(p1003_1b_semaphores, "POSIX P100 * TODO * * - Resource limits? - * - Update fstat(1) * - Replace global sem_lock with mtx_pool locks? * - Add a MAC check_create() hook for creating new named semaphores. */ @@ -407,6 +406,7 @@ ksem_insert(char *path, Fnv32_t fnv, str map->km_path = path; map->km_fnv = fnv; map->km_ksem = ksem_hold(ks); + ks->ks_path = path; LIST_INSERT_HEAD(KSEM_HASH(fnv), map, km_link); } @@ -428,6 +428,7 @@ ksem_remove(char *path, Fnv32_t fnv, str error = ksem_access(map->km_ksem, ucred); if (error) return (error); + map->km_ksem->ks_path = NULL; LIST_REMOVE(map, km_link); ksem_drop(map->km_ksem); free(map->km_path, M_KSEM); @@ -439,6 +440,20 @@ ksem_remove(char *path, Fnv32_t fnv, str return (ENOENT); } +static void +ksem_info_impl(struct ksem *ks, char *path, size_t size, uint32_t *value) +{ + + if (ks->ks_path == NULL) + return; + sx_slock(&ksem_dict_lock); + if (ks->ks_path != NULL) + strlcpy(path, ks->ks_path, size); + if (value != NULL) + *value = ks->ks_value; + sx_sunlock(&ksem_dict_lock); +} + static int ksem_create_copyout_semid(struct thread *td, semid_t *semidp, int fd, int compat32) @@ -1014,6 +1029,7 @@ ksem_module_init(void) p31b_setcfg(CTL_P1003_1B_SEMAPHORES, 200112L); p31b_setcfg(CTL_P1003_1B_SEM_NSEMS_MAX, SEM_MAX); p31b_setcfg(CTL_P1003_1B_SEM_VALUE_MAX, SEM_VALUE_MAX); + ksem_info = ksem_info_impl; error = syscall_helper_register(ksem_syscalls); if (error) @@ -1035,6 +1051,7 @@ ksem_module_destroy(void) #endif syscall_helper_unregister(ksem_syscalls); + ksem_info = NULL; p31b_setcfg(CTL_P1003_1B_SEMAPHORES, 0); hashdestroy(ksem_dictionary, M_KSEM, ksem_hash); sx_destroy(&ksem_dict_lock); Modified: head/sys/sys/ksem.h ============================================================================== --- head/sys/sys/ksem.h Fri May 3 20:39:53 2013 (r250222) +++ head/sys/sys/ksem.h Fri May 3 21:11:57 2013 (r250223) @@ -29,7 +29,7 @@ #ifndef _POSIX4_KSEM_H_ #define _POSIX4_KSEM_H_ -#ifndef _KERNEL +#if !defined(_KERNEL) && !defined(_WANT_FILE) #error "no user-servicable parts inside" #endif @@ -57,9 +57,15 @@ struct ksem { struct timespec ks_birthtime; struct label *ks_label; /* MAC label */ + const char *ks_path; }; #define KS_ANONYMOUS 0x0001 /* Anonymous (unnamed) semaphore. */ #define KS_DEAD 0x0002 /* No new waiters allowed. */ +#ifdef _KERNEL +extern void (*ksem_info)(struct ksem *ks, char *path, size_t size, + uint32_t *value); +#endif + #endif /* !_POSIX4_KSEM_H_ */ Modified: head/sys/sys/user.h ============================================================================== --- head/sys/sys/user.h Fri May 3 20:39:53 2013 (r250222) +++ head/sys/sys/user.h Fri May 3 21:11:57 2013 (r250223) @@ -365,6 +365,10 @@ struct kinfo_file { uint32_t kf_file_pad1; } kf_file; struct { + uint32_t kf_sem_value; + uint16_t kf_sem_mode; + } kf_sem; + struct { uint64_t kf_pipe_addr; uint64_t kf_pipe_peer; uint32_t kf_pipe_buffer_cnt; Modified: head/usr.bin/fstat/fstat.1 ============================================================================== --- head/usr.bin/fstat/fstat.1 Fri May 3 20:39:53 2013 (r250222) +++ head/usr.bin/fstat/fstat.1 Fri May 3 21:11:57 2013 (r250223) @@ -155,6 +155,8 @@ using a symbolic format (see otherwise, the mode is printed as an octal number. .It Li SZ\&|DV +If the file is a semaphore, +prints the current value of the semaphore. If the file is not a character or block special, prints the size of the file in bytes. Otherwise, if the Modified: head/usr.bin/fstat/fstat.c ============================================================================== --- head/usr.bin/fstat/fstat.c Fri May 3 20:39:53 2013 (r250222) +++ head/usr.bin/fstat/fstat.c Fri May 3 21:11:57 2013 (r250223) @@ -84,6 +84,8 @@ static void print_pipe_info(struct procs struct filestat *fst); static void print_pts_info(struct procstat *procstat, struct filestat *fst); +static void print_sem_info(struct procstat *procstat, + struct filestat *fst); static void print_shm_info(struct procstat *procstat, struct filestat *fst); static void print_socket_info(struct procstat *procstat, @@ -294,6 +296,9 @@ print_file_info(struct procstat *procsta case PS_FST_TYPE_SHM: print_shm_info(procstat, fst); break; + case PS_FST_TYPE_SEM: + print_sem_info(procstat, fst); + break; default: if (vflg) fprintf(stderr, @@ -424,6 +429,30 @@ print_pts_info(struct procstat *procstat } static void +print_sem_info(struct procstat *procstat, struct filestat *fst) +{ + struct semstat sem; + char errbuf[_POSIX2_LINE_MAX]; + char mode[15]; + int error; + + error = procstat_get_sem_info(procstat, fst, &sem, errbuf); + if (error != 0) { + printf("* error"); + return; + } + if (nflg) { + printf(" "); + (void)snprintf(mode, sizeof(mode), "%o", sem.mode); + } else { + printf(" %-15s", fst->fs_path != NULL ? fst->fs_path : "-"); + strmode(sem.mode, mode); + } + printf(" %10s %6u", mode, sem.value); + print_access_flags(fst->fs_fflags); +} + +static void print_shm_info(struct procstat *procstat, struct filestat *fst) { struct shmstat shm; From owner-svn-src-head@FreeBSD.ORG Fri May 3 21:17:33 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E9D8EB73; Fri, 3 May 2013 21:17:33 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id C8A7F1563; Fri, 3 May 2013 21:17:33 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 1F2A1B939; Fri, 3 May 2013 17:17:33 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Subject: Re: svn commit: r250223 - in head: lib/libprocstat sys/kern sys/sys usr.bin/fstat Date: Fri, 3 May 2013 17:17:13 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201305032111.r43LBvZ3040508@svn.freebsd.org> In-Reply-To: <201305032111.r43LBvZ3040508@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201305031717.13612.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 03 May 2013 17:17:33 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 21:17:34 -0000 On Friday, May 03, 2013 5:11:57 pm John Baldwin wrote: > Author: jhb > Date: Fri May 3 21:11:57 2013 > New Revision: 250223 > URL: http://svnweb.freebsd.org/changeset/base/250223 > > Log: > Similar to 233760 and 236717, export some more useful info about the > kernel-based POSIX semaphore descriptors to userland via procstat(1) and > fstat(1): > - Change sem file descriptors to track the pathname they are associated > with and add a ksem_info() method to copy the path out to a > caller-supplied buffer. > - Use the fo_stat() method of shared memory objects and ksem_info() to > export the path, mode, and value of a semaphore via struct kinfo_file. > - Add a struct semstat to the libprocstat(3) interface along with a > procstat_get_sem_info() to export the mode and value of a semaphore. > - Teach fstat about semaphores and to display their path, mode, and value. > > MFC after: 2 weeks I do realize that the POSIX semaphore API only uses these descriptors for 8.x and earlier, but this is still useful info if you are using 8.x (where I will MFC this), or if you are using an 8.x world or chroot with a newer kernel. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri May 3 23:29:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F309D288; Fri, 3 May 2013 23:29:40 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E43EE1B36; Fri, 3 May 2013 23:29:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43NTewx089008; Fri, 3 May 2013 23:29:40 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43NTc3j088990; Fri, 3 May 2013 23:29:38 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201305032329.r43NTc3j088990@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 3 May 2013 23:29:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250226 - in head/usr.bin/m4: . TEST X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 23:29:41 -0000 Author: jkim Date: Fri May 3 23:29:38 2013 New Revision: 250226 URL: http://svnweb.freebsd.org/changeset/base/250226 Log: Reduce diff with upstream. Modified: head/usr.bin/m4/TEST/ack.m4 head/usr.bin/m4/TEST/hanoi.m4 head/usr.bin/m4/TEST/hash.m4 head/usr.bin/m4/TEST/sqroot.m4 head/usr.bin/m4/TEST/string.m4 head/usr.bin/m4/TEST/test.m4 head/usr.bin/m4/eval.c head/usr.bin/m4/extern.h head/usr.bin/m4/m4.1 head/usr.bin/m4/main.c head/usr.bin/m4/parser.y head/usr.bin/m4/tokenizer.l Modified: head/usr.bin/m4/TEST/ack.m4 ============================================================================== --- head/usr.bin/m4/TEST/ack.m4 Fri May 3 22:33:41 2013 (r250225) +++ head/usr.bin/m4/TEST/ack.m4 Fri May 3 23:29:38 2013 (r250226) @@ -1,4 +1,4 @@ -# $OpenBSD: ack.m4,v 1.2 1996/06/26 05:36:18 deraadt Exp $ +# $OpenBSD: ack.m4,v 1.3 2003/06/03 02:56:11 millert Exp $ # $NetBSD: ack.m4,v 1.4 1995/09/28 05:37:54 tls Exp $ # # Copyright (c) 1989, 1993 @@ -15,7 +15,7 @@ # 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. -# 4. Neither the name of the University nor the names of its contributors +# 3. Neither the name of the University nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # Modified: head/usr.bin/m4/TEST/hanoi.m4 ============================================================================== --- head/usr.bin/m4/TEST/hanoi.m4 Fri May 3 22:33:41 2013 (r250225) +++ head/usr.bin/m4/TEST/hanoi.m4 Fri May 3 23:29:38 2013 (r250226) @@ -1,4 +1,4 @@ -# $OpenBSD: hanoi.m4,v 1.2 1996/06/26 05:36:19 deraadt Exp $ +# $OpenBSD: hanoi.m4,v 1.3 2003/06/03 02:56:11 millert Exp $ # $NetBSD: hanoi.m4,v 1.4 1995/09/28 05:37:56 tls Exp $ # # Copyright (c) 1989, 1993 @@ -15,7 +15,7 @@ # 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. -# 4. Neither the name of the University nor the names of its contributors +# 3. Neither the name of the University nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # Modified: head/usr.bin/m4/TEST/hash.m4 ============================================================================== --- head/usr.bin/m4/TEST/hash.m4 Fri May 3 22:33:41 2013 (r250225) +++ head/usr.bin/m4/TEST/hash.m4 Fri May 3 23:29:38 2013 (r250226) @@ -1,4 +1,4 @@ -# $OpenBSD: hash.m4,v 1.2 1996/06/26 05:36:19 deraadt Exp $ +# $OpenBSD: hash.m4,v 1.3 2003/06/03 02:56:11 millert Exp $ # $NetBSD: hash.m4,v 1.4 1995/09/28 05:37:58 tls Exp $ # # Copyright (c) 1989, 1993 @@ -15,7 +15,7 @@ # 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. -# 4. Neither the name of the University nor the names of its contributors +# 3. Neither the name of the University nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # Modified: head/usr.bin/m4/TEST/sqroot.m4 ============================================================================== --- head/usr.bin/m4/TEST/sqroot.m4 Fri May 3 22:33:41 2013 (r250225) +++ head/usr.bin/m4/TEST/sqroot.m4 Fri May 3 23:29:38 2013 (r250226) @@ -1,4 +1,4 @@ -# $OpenBSD: sqroot.m4,v 1.2 1996/06/26 05:36:20 deraadt Exp $ +# $OpenBSD: sqroot.m4,v 1.3 2003/06/03 02:56:11 millert Exp $ # $NetBSD: sqroot.m4,v 1.4 1995/09/28 05:38:01 tls Exp $ # # Copyright (c) 1989, 1993 @@ -15,7 +15,7 @@ # 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. -# 4. Neither the name of the University nor the names of its contributors +# 3. Neither the name of the University nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # Modified: head/usr.bin/m4/TEST/string.m4 ============================================================================== --- head/usr.bin/m4/TEST/string.m4 Fri May 3 22:33:41 2013 (r250225) +++ head/usr.bin/m4/TEST/string.m4 Fri May 3 23:29:38 2013 (r250226) @@ -1,4 +1,4 @@ -# $OpenBSD: string.m4,v 1.2 1996/06/26 05:36:20 deraadt Exp $ +# $OpenBSD: string.m4,v 1.3 2003/06/03 02:56:11 millert Exp $ # $NetBSD: string.m4,v 1.4 1995/09/28 05:38:03 tls Exp $ # # Copyright (c) 1989, 1993 @@ -15,7 +15,7 @@ # 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. -# 4. Neither the name of the University nor the names of its contributors +# 3. Neither the name of the University nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # Modified: head/usr.bin/m4/TEST/test.m4 ============================================================================== --- head/usr.bin/m4/TEST/test.m4 Fri May 3 22:33:41 2013 (r250225) +++ head/usr.bin/m4/TEST/test.m4 Fri May 3 23:29:38 2013 (r250226) @@ -1,4 +1,4 @@ -# $OpenBSD: test.m4,v 1.2 1996/06/26 05:36:21 deraadt Exp $ +# $OpenBSD: test.m4,v 1.3 2003/06/03 02:56:11 millert Exp $ # $NetBSD: test.m4,v 1.4 1995/09/28 05:38:05 tls Exp $ # # Copyright (c) 1989, 1993 @@ -15,7 +15,7 @@ # 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. -# 4. Neither the name of the University nor the names of its contributors +# 3. Neither the name of the University nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # Modified: head/usr.bin/m4/eval.c ============================================================================== --- head/usr.bin/m4/eval.c Fri May 3 22:33:41 2013 (r250225) +++ head/usr.bin/m4/eval.c Fri May 3 23:29:38 2013 (r250226) @@ -1,4 +1,4 @@ -/* $OpenBSD: eval.c,v 1.69 2011/03/24 11:23:08 espie Exp $ */ +/* $OpenBSD: eval.c,v 1.70 2012/04/12 17:00:11 espie Exp $ */ /* $NetBSD: eval.c,v 1.7 1996/11/10 21:21:29 pk Exp $ */ /* Modified: head/usr.bin/m4/extern.h ============================================================================== --- head/usr.bin/m4/extern.h Fri May 3 22:33:41 2013 (r250225) +++ head/usr.bin/m4/extern.h Fri May 3 23:29:38 2013 (r250226) @@ -1,4 +1,4 @@ -/* $OpenBSD: extern.h,v 1.51 2011/09/27 07:24:02 espie Exp $ */ +/* $OpenBSD: extern.h,v 1.52 2012/04/12 17:00:11 espie Exp $ */ /* $NetBSD: extern.h,v 1.3 1996/01/13 23:25:24 pk Exp $ */ /*- Modified: head/usr.bin/m4/m4.1 ============================================================================== --- head/usr.bin/m4/m4.1 Fri May 3 22:33:41 2013 (r250225) +++ head/usr.bin/m4/m4.1 Fri May 3 23:29:38 2013 (r250226) @@ -1,5 +1,5 @@ -.\" $NetBSD: m4.1,v 1.22 2010/05/14 17:14:28 joerg Exp $ -.\" @(#) $OpenBSD: m4.1,v 1.56 2009/10/14 17:19:47 sthen Exp $ +.\" $NetBSD: m4.1,v 1.23 2012/04/08 22:00:39 wiz Exp $ +.\" @(#) $OpenBSD: m4.1,v 1.59 2010/10/21 13:20:51 jmc Exp $ .\" .\" Copyright (c) 1989, 1993 .\" The Regents of the University of California. All rights reserved. @@ -33,14 +33,14 @@ .\" .\" $FreeBSD$ .\" -.Dd October 14, 2009 +.Dd October 21, 2010 .Dt M4 1 .Os .Sh NAME .Nm m4 .Nd macro language processor .Sh SYNOPSIS -.Nm m4 +.Nm .Op Fl gPs .Oo .Sm off @@ -50,18 +50,16 @@ .Op Fl d Ar flags .Op Fl I Ar dirname .Op Fl o Ar filename -.Bk -words .Op Fl t Ar macro .Op Fl U Ns Ar name .Op Ar -.Ek .Sh DESCRIPTION The -.Nm m4 +.Nm utility is a macro processor that can be used as a front end to any language (e.g., C, ratfor, fortran, lex, and yacc). If no input files are given, -.Nm m4 +.Nm reads from the standard input, otherwise files specified on the command line are processed in the given order. @@ -69,7 +67,7 @@ Input files can be regular files, files single dash .Pq Sq - , denoting standard input. -.Nm m4 +.Nm writes the processed text to the standard output, unless told otherwise. .Pp @@ -77,7 +75,7 @@ Macro calls have the form name(argument1 .Pp There cannot be any space following the macro name and the open parenthesis -.Sq \&( . +.Pq Sq \&( . If the macro name is not followed by an open parenthesis it is processed with no arguments. .Pp @@ -169,7 +167,7 @@ Undefine the symbol .Ar name . .El .Sh SYNTAX -.Nm m4 +.Nm provides the following built-in macros. They may be redefined, losing their original meaning. Return values are null unless otherwise stated. @@ -240,7 +238,7 @@ macro definitions (even for built-in mac .It Fn divert num There are 10 output queues (numbered 0-9). At the end of processing -.Nm m4 +.Nm concatenates all the queues in numerical order to produce the final output. Initially the output queue is 0. @@ -259,7 +257,7 @@ Prints the first argument on the standar .It Fn esyscmd cmd Passes its first argument to a shell and returns the shell's standard output. Note that the shell shares its standard input and standard error with -.Nm m4 . +.Nm . .It Fn eval expr Computes the first argument as an arithmetic expression using 32-bit arithmetic. @@ -348,6 +346,9 @@ Multiple calls to get inserted in sequence at the final .Dv EOF . .It Fn maketemp template +Like +.Ic mkstemp . +.It Fn mkstemp template Invokes .Xr mkstemp 3 on the first argument, and returns the modified string. @@ -431,10 +432,16 @@ Returns the current file's line number. .It Ic __file__ Returns the current file's name. .El +.Sh EXIT STATUS +.Ex -std m4 +.Pp +But note that the +.Ic m4exit +macro can modify the exit status. .Sh STANDARDS The .Nm -utility is compliant with the +utility is mostly compliant with the .St -p1003.1-2008 specification. .Pp @@ -456,6 +463,12 @@ and .Ic __file__ are extensions to that specification. .Pp +.Ic maketemp +is not supposed to be a synonym for +.Ic mkstemp , +but instead to be an insecure temporary file name creation function. +The change causes no known compatibility issues. +.Pp The output format of tracing and of .Ic dumpdef are not specified in any standard, @@ -480,7 +493,7 @@ replaces the top-most definition only. Other implementations may erase all definitions on the stack instead. .Pp All built-ins do expand without arguments in many other -.Nm m4 . +.Nm . .Pp Many other .Nm Modified: head/usr.bin/m4/main.c ============================================================================== --- head/usr.bin/m4/main.c Fri May 3 22:33:41 2013 (r250225) +++ head/usr.bin/m4/main.c Fri May 3 23:29:38 2013 (r250226) @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.80 2011/09/27 07:24:02 espie Exp $ */ +/* $OpenBSD: main.c,v 1.81 2012/04/12 17:00:11 espie Exp $ */ /* $NetBSD: main.c,v 1.12 1997/02/08 23:54:49 cgd Exp $ */ /*- Modified: head/usr.bin/m4/parser.y ============================================================================== --- head/usr.bin/m4/parser.y Fri May 3 22:33:41 2013 (r250225) +++ head/usr.bin/m4/parser.y Fri May 3 23:29:38 2013 (r250226) @@ -1,5 +1,5 @@ %{ -/* $OpenBSD: parser.y,v 1.6 2008/08/21 21:00:14 espie Exp $ */ +/* $OpenBSD: parser.y,v 1.7 2012/04/12 17:00:11 espie Exp $ */ /* * Copyright (c) 2004 Marc Espie * Modified: head/usr.bin/m4/tokenizer.l ============================================================================== --- head/usr.bin/m4/tokenizer.l Fri May 3 22:33:41 2013 (r250225) +++ head/usr.bin/m4/tokenizer.l Fri May 3 23:29:38 2013 (r250226) @@ -1,6 +1,6 @@ %option nounput noinput %{ -/* $OpenBSD: tokenizer.l,v 1.7 2010/03/22 20:40:44 espie Exp $ */ +/* $OpenBSD: tokenizer.l,v 1.8 2012/04/12 17:00:11 espie Exp $ */ /* * Copyright (c) 2004 Marc Espie * From owner-svn-src-head@FreeBSD.ORG Fri May 3 23:51:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 04DC6732; Fri, 3 May 2013 23:51:36 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D99B71BE3; Fri, 3 May 2013 23:51:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r43NpZCd097827; Fri, 3 May 2013 23:51:35 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r43NpXGH097804; Fri, 3 May 2013 23:51:33 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201305032351.r43NpXGH097804@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 3 May 2013 23:51:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250227 - in head: contrib/binutils/binutils contrib/binutils/ld lib/libc/net lib/libipsec sbin/devd usr.bin/ar usr.bin/csup usr.bin/xlint/lint1 usr.sbin/apmd usr.sbin/config usr.sbin/j... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 23:51:36 -0000 Author: jkim Date: Fri May 3 23:51:32 2013 New Revision: 250227 URL: http://svnweb.freebsd.org/changeset/base/250227 Log: Improve compatibility with recent flex from flex.sourceforge.net. Modified: head/contrib/binutils/binutils/arlex.l head/contrib/binutils/ld/ldlex.l head/lib/libc/net/nslexer.l head/lib/libipsec/policy_token.l head/sbin/devd/token.l head/usr.bin/ar/acplex.l head/usr.bin/csup/token.l head/usr.bin/xlint/lint1/scan.l head/usr.sbin/apmd/apmdlex.l head/usr.sbin/config/lang.l head/usr.sbin/jail/jaillex.l head/usr.sbin/kbdcontrol/lex.l head/usr.sbin/ndiscvt/inf-token.l head/usr.sbin/rrenumd/lexer.l Modified: head/contrib/binutils/binutils/arlex.l ============================================================================== --- head/contrib/binutils/binutils/arlex.l Fri May 3 23:29:38 2013 (r250226) +++ head/contrib/binutils/binutils/arlex.l Fri May 3 23:51:32 2013 (r250227) @@ -28,13 +28,13 @@ Foundation, Inc., 51 Franklin Street - F #include "libiberty.h" #include "arparse.h" -#define YY_NO_UNPUT - extern int yylex (void); int linenumber; %} +%option nounput + %a 10000 %o 25000 Modified: head/contrib/binutils/ld/ldlex.l ============================================================================== --- head/contrib/binutils/ld/ldlex.l Fri May 3 23:29:38 2013 (r250226) +++ head/contrib/binutils/ld/ldlex.l Fri May 3 23:51:32 2013 (r250227) @@ -63,8 +63,6 @@ const char *lex_string = NULL; #undef YY_INPUT #define YY_INPUT(buf,result,max_size) yy_input (buf, &result, max_size) -#define YY_NO_UNPUT - #define MAX_INCLUDE_DEPTH 10 static YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH]; static const char *file_name_stack[MAX_INCLUDE_DEPTH]; @@ -72,7 +70,7 @@ static unsigned int lineno_stack[MAX_INC static unsigned int include_stack_ptr = 0; static int vers_node_nesting = 0; -static void yy_input (char *, int *, int); +static void yy_input (char *, yy_size_t *, yy_size_t); static void comment (void); static void lex_warn_invalid (char *where, char *what); @@ -94,6 +92,8 @@ int yywrap (void) { return 1; } #endif %} +%option nounput + %a 4000 %o 5000 @@ -612,7 +612,7 @@ ldlex_popstate (void) either the number of characters read, or 0 to indicate EOF. */ static void -yy_input (char *buf, int *result, int max_size) +yy_input (char *buf, yy_size_t *result, yy_size_t max_size) { *result = 0; if (YY_CURRENT_BUFFER->yy_input_file) Modified: head/lib/libc/net/nslexer.l ============================================================================== --- head/lib/libc/net/nslexer.l Fri May 3 23:29:38 2013 (r250226) +++ head/lib/libc/net/nslexer.l Fri May 3 23:51:32 2013 (r250227) @@ -53,11 +53,10 @@ static char *rcsid = #include "nsparser.h" -#define YY_NO_INPUT -#define YY_NO_UNPUT - %} +%option noinput +%option nounput %option yylineno BLANK [ \t] Modified: head/lib/libipsec/policy_token.l ============================================================================== --- head/lib/libipsec/policy_token.l Fri May 3 23:29:38 2013 (r250226) +++ head/lib/libipsec/policy_token.l Fri May 3 23:51:32 2013 (r250227) @@ -139,8 +139,8 @@ void __policy__strbuffer__init__(msg) char *msg; { - if (yy_current_buffer) - yy_delete_buffer(yy_current_buffer); + if (YY_CURRENT_BUFFER) + yy_delete_buffer(YY_CURRENT_BUFFER); strbuffer = (YY_BUFFER_STATE)yy_scan_string(msg); yy_switch_to_buffer(strbuffer); Modified: head/sbin/devd/token.l ============================================================================== --- head/sbin/devd/token.l Fri May 3 23:29:38 2013 (r250226) +++ head/sbin/devd/token.l Fri May 3 23:51:32 2013 (r250227) @@ -37,8 +37,6 @@ #include "y.tab.h" int lineno = 1; -#define YY_NO_UNPUT -#define YY_NO_INPUT static void update_lineno(const char *cp) @@ -50,6 +48,9 @@ update_lineno(const char *cp) %} +%option nounput +%option noinput + %% [ \t]+ ; Modified: head/usr.bin/ar/acplex.l ============================================================================== --- head/usr.bin/ar/acplex.l Fri May 3 23:29:38 2013 (r250226) +++ head/usr.bin/ar/acplex.l Fri May 3 23:51:32 2013 (r250227) @@ -36,14 +36,14 @@ __FBSDID("$FreeBSD$"); #include "y.tab.h" -#define YY_NO_UNPUT -#define YY_NO_INPUT int lineno = 1; int yylex(void); %} +%option nounput +%option noinput %option noyywrap %% Modified: head/usr.bin/csup/token.l ============================================================================== --- head/usr.bin/csup/token.l Fri May 3 23:29:38 2013 (r250226) +++ head/usr.bin/csup/token.l Fri May 3 23:51:32 2013 (r250227) @@ -35,12 +35,11 @@ #include "misc.h" #include "token.h" -#define YY_NO_UNPUT - int lineno = 1; %} +%option nounput %option noyywrap %% Modified: head/usr.bin/xlint/lint1/scan.l ============================================================================== --- head/usr.bin/xlint/lint1/scan.l Fri May 3 23:29:38 2013 (r250226) +++ head/usr.bin/xlint/lint1/scan.l Fri May 3 23:51:32 2013 (r250227) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include "cgram.h" #define CHAR_MASK (~(~0 << CHAR_BIT)) -#define YY_NO_UNPUT /* Current position (its also updated when an included file is parsed) */ pos_t curr_pos = { 1, "", 0 }; @@ -86,6 +85,8 @@ static int wcstrg(void); %} +%option nounput + L [_A-Za-z] D [0-9] NZD [1-9] Modified: head/usr.sbin/apmd/apmdlex.l ============================================================================== --- head/usr.sbin/apmd/apmdlex.l Fri May 3 23:29:38 2013 (r250226) +++ head/usr.sbin/apmd/apmdlex.l Fri May 3 23:51:32 2013 (r250227) @@ -36,14 +36,14 @@ #include "apmd.h" #include "y.tab.h" -/* We don't need it, avoid the warning. */ -#define YY_NO_UNPUT -#define YY_NO_INPUT - int lineno; int first_time; %} +/* We don't need it, avoid the warning. */ +%option nounput +%option noinput + %s TOP %% Modified: head/usr.sbin/config/lang.l ============================================================================== --- head/usr.sbin/config/lang.l Fri May 3 23:29:38 2013 (r250226) +++ head/usr.sbin/config/lang.l Fri May 3 23:51:32 2013 (r250227) @@ -38,9 +38,6 @@ #include "y.tab.h" #include "config.h" -#define YY_NO_UNPUT -#define YY_NO_INPUT - /* * Data for returning to previous files from include files. */ @@ -97,6 +94,10 @@ unsigned int hex(const char *); int yyerror(const char *); %} + +%option nounput +%option noinput + ID [A-Za-z_][-A-Za-z_0-9]* PATH [./][-/.%^A-Za-z_0-9]+ %START TOEOL Modified: head/usr.sbin/jail/jaillex.l ============================================================================== --- head/usr.sbin/jail/jaillex.l Fri May 3 23:29:38 2013 (r250226) +++ head/usr.sbin/jail/jaillex.l Fri May 3 23:51:32 2013 (r250227) @@ -36,9 +36,6 @@ __FBSDID("$FreeBSD$"); #include "jailp.h" #include "y.tab.h" -#define YY_NO_INPUT -#define YY_NO_UNPUT - extern int yynerrs; static ssize_t text2lval(size_t triml, size_t trimr, int tovar); @@ -47,6 +44,9 @@ static int instr; static int lineno = 1; %} +%option noinput +%option nounput + %start _ DQ %% Modified: head/usr.sbin/kbdcontrol/lex.l ============================================================================== --- head/usr.sbin/kbdcontrol/lex.l Fri May 3 23:29:38 2013 (r250226) +++ head/usr.sbin/kbdcontrol/lex.l Fri May 3 23:51:32 2013 (r250227) @@ -31,11 +31,12 @@ %{ #include "lex.h" -#define YY_NO_UNPUT -#define YY_NO_INPUT %} +%option nounput +%option noinput + D [0-9] X [0-9a-fA-F] A . Modified: head/usr.sbin/ndiscvt/inf-token.l ============================================================================== --- head/usr.sbin/ndiscvt/inf-token.l Fri May 3 23:29:38 2013 (r250226) +++ head/usr.sbin/ndiscvt/inf-token.l Fri May 3 23:51:32 2013 (r250227) @@ -43,8 +43,6 @@ __FBSDID("$FreeBSD$"); #include "y.tab.h" int lineno = 1; -#define YY_NO_UNPUT -#define YY_NO_INPUT int yylex(void); void yyerror(const char *); @@ -59,6 +57,9 @@ update_lineno(const char *cp) %} +%option nounput +%option noinput + %% [ \t]+ ; Modified: head/usr.sbin/rrenumd/lexer.l ============================================================================== --- head/usr.sbin/rrenumd/lexer.l Fri May 3 23:29:38 2013 (r250226) +++ head/usr.sbin/rrenumd/lexer.l Fri May 3 23:51:32 2013 (r250227) @@ -32,8 +32,6 @@ */ %{ -#define YY_NO_UNPUT - #include #include #include @@ -64,6 +62,8 @@ void yyerror(const char *); int yylex(void); %} +%option nounput + /* common section */ nl \n ws [ \t]+ From owner-svn-src-head@FreeBSD.ORG Sat May 4 04:03:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 851B521E; Sat, 4 May 2013 04:03:51 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5E44A1259; Sat, 4 May 2013 04:03:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4443pno086623; Sat, 4 May 2013 04:03:51 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4443px0086622; Sat, 4 May 2013 04:03:51 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305040403.r4443px0086622@svn.freebsd.org> From: Adrian Chadd Date: Sat, 4 May 2013 04:03:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250229 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 04:03:51 -0000 Author: adrian Date: Sat May 4 04:03:50 2013 New Revision: 250229 URL: http://svnweb.freebsd.org/changeset/base/250229 Log: The holding buffer logic needs to be used for _all_ transmission, not just "when the queue is busy." After talking with the MAC team, it turns out that the linked list implementation sometimes will not accept a TxDP update and will instead re-read the link pointer. So even if the hardware has finished transmitting a chain and has hit EOL/VEOL, it may still re-read the link pointer to begin transmitting again. So, always set ATH_BUF_BUSY on the last buffer in the chain (to mark the last descriptor as the holding descriptor) and never blank the axq_link pointer. Tested: * AR5416, STA mode TODO: * much more thorough testing with the pre-11n NICs, just to verify that they behave the same way. * test TDMA on the 11n and non-11n hardware. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sat May 4 00:31:41 2013 (r250228) +++ head/sys/dev/ath/if_ath.c Sat May 4 04:03:50 2013 (r250229) @@ -3928,19 +3928,20 @@ ath_tx_processq(struct ath_softc *sc, st break; } ATH_TXQ_REMOVE(txq, bf, bf_list); - if (txq->axq_depth > 0) { - /* - * More frames follow. Mark the buffer busy - * so it's not re-used while the hardware may - * still re-read the link field in the descriptor. - * - * Use the last buffer in an aggregate as that - * is where the hardware may be - intermediate - * descriptors won't be "busy". - */ - bf->bf_last->bf_flags |= ATH_BUF_BUSY; - } else - txq->axq_link = NULL; + + /* + * Always mark the last buffer in this list as busy. + * + * The hardware may re-read the holding descriptor + * even if we hit the end of the list and try writing + * a new TxDP. + * + * If there's no holding descriptor then this is the + * last buffer in the list of buffers after a fresh + * reset; it'll soon become the holding buffer. + */ + bf->bf_last->bf_flags |= ATH_BUF_BUSY; + if (bf->bf_state.bfs_aggr) txq->axq_aggr_depth--; From owner-svn-src-head@FreeBSD.ORG Sat May 4 11:26:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1C29876D; Sat, 4 May 2013 11:26:17 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0F3B511C2; Sat, 4 May 2013 11:26:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r449lqpP005675; Sat, 4 May 2013 09:47:52 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r449lqMf005674; Sat, 4 May 2013 09:47:52 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305040947.r449lqMf005674@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 4 May 2013 09:47:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250230 - head/lib/libkvm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 11:26:17 -0000 Author: jilles Date: Sat May 4 09:47:51 2013 New Revision: 250230 URL: http://svnweb.freebsd.org/changeset/base/250230 Log: libkvm: Use O_CLOEXEC instead of separate fcntl(F_SETFD) call. MFC after: 1 week Modified: head/lib/libkvm/kvm.c Modified: head/lib/libkvm/kvm.c ============================================================================== --- head/lib/libkvm/kvm.c Sat May 4 04:03:50 2013 (r250229) +++ head/lib/libkvm/kvm.c Sat May 4 09:47:51 2013 (r250230) @@ -166,7 +166,7 @@ _kvm_open(kvm_t *kd, const char *uf, con if (mf == 0) mf = _PATH_MEM; - if ((kd->pmfd = open(mf, flag, 0)) < 0) { + if ((kd->pmfd = open(mf, flag | O_CLOEXEC, 0)) < 0) { _kvm_syserr(kd, kd->program, "%s", mf); goto failed; } @@ -179,10 +179,6 @@ _kvm_open(kvm_t *kd, const char *uf, con _kvm_syserr(kd, kd->program, "empty file"); goto failed; } - if (fcntl(kd->pmfd, F_SETFD, FD_CLOEXEC) < 0) { - _kvm_syserr(kd, kd->program, "%s", mf); - goto failed; - } if (S_ISCHR(st.st_mode)) { /* * If this is a character special device, then check that @@ -194,11 +190,8 @@ _kvm_open(kvm_t *kd, const char *uf, con kd->vmfd = open(_PATH_DEVNULL, O_RDONLY); return (kd); } else if (strcmp(mf, _PATH_MEM) == 0) { - if ((kd->vmfd = open(_PATH_KMEM, flag)) < 0) { - _kvm_syserr(kd, kd->program, "%s", _PATH_KMEM); - goto failed; - } - if (fcntl(kd->vmfd, F_SETFD, FD_CLOEXEC) < 0) { + if ((kd->vmfd = open(_PATH_KMEM, flag | O_CLOEXEC)) < + 0) { _kvm_syserr(kd, kd->program, "%s", _PATH_KMEM); goto failed; } @@ -210,11 +203,7 @@ _kvm_open(kvm_t *kd, const char *uf, con * Initialize the virtual address translation machinery, * but first setup the namelist fd. */ - if ((kd->nlfd = open(uf, O_RDONLY, 0)) < 0) { - _kvm_syserr(kd, kd->program, "%s", uf); - goto failed; - } - if (fcntl(kd->nlfd, F_SETFD, FD_CLOEXEC) < 0) { + if ((kd->nlfd = open(uf, O_RDONLY | O_CLOEXEC, 0)) < 0) { _kvm_syserr(kd, kd->program, "%s", uf); goto failed; } From owner-svn-src-head@FreeBSD.ORG Sat May 4 11:45:49 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 500C16C; Sat, 4 May 2013 11:45:49 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 42C141512; Sat, 4 May 2013 11:45:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44BjnGk046876; Sat, 4 May 2013 11:45:49 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44Bjn64046875; Sat, 4 May 2013 11:45:49 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305041145.r44Bjn64046875@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 4 May 2013 11:45:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250231 - head/lib/libkvm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 11:45:49 -0000 Author: jilles Date: Sat May 4 11:45:48 2013 New Revision: 250231 URL: http://svnweb.freebsd.org/changeset/base/250231 Log: libkvm: Make second /dev/null file descriptor close-on-exec as well. MFC after: 1 week Modified: head/lib/libkvm/kvm.c Modified: head/lib/libkvm/kvm.c ============================================================================== --- head/lib/libkvm/kvm.c Sat May 4 09:47:51 2013 (r250230) +++ head/lib/libkvm/kvm.c Sat May 4 11:45:48 2013 (r250231) @@ -187,7 +187,7 @@ _kvm_open(kvm_t *kd, const char *uf, con * case you're working with a live kernel.) */ if (strcmp(mf, _PATH_DEVNULL) == 0) { - kd->vmfd = open(_PATH_DEVNULL, O_RDONLY); + kd->vmfd = open(_PATH_DEVNULL, O_RDONLY | O_CLOEXEC); return (kd); } else if (strcmp(mf, _PATH_MEM) == 0) { if ((kd->vmfd = open(_PATH_KMEM, flag | O_CLOEXEC)) < From owner-svn-src-head@FreeBSD.ORG Sat May 4 12:41:04 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 391228B6; Sat, 4 May 2013 12:41:04 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-we0-x229.google.com (mail-we0-x229.google.com [IPv6:2a00:1450:400c:c03::229]) by mx1.freebsd.org (Postfix) with ESMTP id 50566186C; Sat, 4 May 2013 12:41:03 +0000 (UTC) Received: by mail-we0-f169.google.com with SMTP id x51so1984272wey.0 for ; Sat, 04 May 2013 05:41:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=0mE7dYBuu4KpFnO0RB65EE2grqgRnkEWmiip/Gjkubo=; b=UpvyOEH8vdn0Km5z/CNIzQGZh3X/Qa7soN9PKj0LhZ82oZPfjL8tqKE42LqaFud/Hn 4BkFNeugePP0fpIccJGw88MLhc4kSuZnGoCbHg5IeYY0HqDNASTg3pVDaHNpPQoCkyjl 34Lt1rHrVHbmOMykcTx5s/mHxTUYH/pkyVl1hB4u6iUeE2T2OwaS92oPPG+UhKixzdan i6KnkHeBwNmIAcybdjHrozA8w5XaThbgr8sz6bmFedYzWSSgHNtmxYqi7pX5/agDQNUf wAQT3Ne6X+4CU6l4GFDb74tIcoZVymtWiuyIJuHXxNCmpmjjT0Y+hiZyPUwhBfe9rwqc Ui7g== X-Received: by 10.194.63.109 with SMTP id f13mr17476569wjs.11.1367650773267; Fri, 03 May 2013 23:59:33 -0700 (PDT) Received: from ithaqua.etoilebsd.net (ithaqua.etoilebsd.net. [37.59.37.188]) by mx.google.com with ESMTPSA id o3sm1425687wia.2.2013.05.03.23.59.31 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 03 May 2013 23:59:32 -0700 (PDT) Sender: Baptiste Daroussin Date: Sat, 4 May 2013 08:59:29 +0200 From: Baptiste Daroussin To: Jung-uk Kim Subject: Re: svn commit: r250226 - in head/usr.bin/m4: . TEST Message-ID: <20130504065929.GU12114@ithaqua.etoilebsd.net> References: <201305032329.r43NTc3j088990@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GVLQrlG8+/jMfW4X" Content-Disposition: inline In-Reply-To: <201305032329.r43NTc3j088990@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 12:41:04 -0000 --GVLQrlG8+/jMfW4X Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 03, 2013 at 11:29:38PM +0000, Jung-uk Kim wrote: > Author: jkim > Date: Fri May 3 23:29:38 2013 > New Revision: 250226 > URL: http://svnweb.freebsd.org/changeset/base/250226 >=20 > Log: > Reduce diff with upstream. >=20 > Modified: > head/usr.bin/m4/TEST/ack.m4 > head/usr.bin/m4/TEST/hanoi.m4 > head/usr.bin/m4/TEST/hash.m4 > head/usr.bin/m4/TEST/sqroot.m4 > head/usr.bin/m4/TEST/string.m4 > head/usr.bin/m4/TEST/test.m4 The above should go into tools/regression/usr.bin/m4 this where I put the o= ther regression tests. > head/usr.bin/m4/eval.c > head/usr.bin/m4/extern.h > head/usr.bin/m4/m4.1 > head/usr.bin/m4/main.c > head/usr.bin/m4/parser.y > head/usr.bin/m4/tokenizer.l >=20 thx I forgot to sync the headers because the last code in m4 was first writ= ten and committed in freebsd when I planned to update our flex to spirceforge version of flex ;) regards, Bapt --GVLQrlG8+/jMfW4X Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlGEsdEACgkQ8kTtMUmk6Ewd4QCeNyaELMPPf6Pc7xfrkQhzds9t rtYAnjlU0li1msy+hH9B8yJAz57fFt3d =+bPJ -----END PGP SIGNATURE----- --GVLQrlG8+/jMfW4X-- From owner-svn-src-head@FreeBSD.ORG Sat May 4 12:44:01 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 42689A76; Sat, 4 May 2013 12:44:01 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1B9321889; Sat, 4 May 2013 12:44:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44Ci0D4067342; Sat, 4 May 2013 12:44:00 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44Ci0fg067341; Sat, 4 May 2013 12:44:00 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201305041244.r44Ci0fg067341@svn.freebsd.org> From: Sergey Kandaurov Date: Sat, 4 May 2013 12:44:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250233 - head/lib/libprocstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 12:44:01 -0000 Author: pluknet Date: Sat May 4 12:44:00 2013 New Revision: 250233 URL: http://svnweb.freebsd.org/changeset/base/250233 Log: Bump date. Modified: head/lib/libprocstat/libprocstat.3 Modified: head/lib/libprocstat/libprocstat.3 ============================================================================== --- head/lib/libprocstat/libprocstat.3 Sat May 4 11:49:02 2013 (r250232) +++ head/lib/libprocstat/libprocstat.3 Sat May 4 12:44:00 2013 (r250233) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 20, 2013 +.Dd May 3, 2013 .Dt LIBPROCSTAT 3 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Sat May 4 12:56:14 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0A72EFF7; Sat, 4 May 2013 12:56:14 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx08.syd.optusnet.com.au (fallbackmx08.syd.optusnet.com.au [211.29.132.10]) by mx1.freebsd.org (Postfix) with ESMTP id 9F7871924; Sat, 4 May 2013 12:56:12 +0000 (UTC) Received: from mail35.syd.optusnet.com.au (mail35.syd.optusnet.com.au [211.29.133.51]) by fallbackmx08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r448mGXj031476; Sat, 4 May 2013 18:48:17 +1000 Received: from etaplex.bde.org ([139.218.225.48]) (authenticated sender brde) by mail35.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r448lfjp003183 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 4 May 2013 18:48:12 +1000 Date: Sat, 4 May 2013 18:47:43 +1000 (EST) From: Bruce Evans X-X-Sender: bde@etaplex.bde.org To: jhb@FreeBSD.org Subject: Re: svn commit: r250220 - head/sys/kern In-Reply-To: <201305031908.r43J8xnI094418@svn.freebsd.org> Message-ID: <20130504184721.E619@etaplex.bde.org> References: <201305031908.r43J8xnI094418@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=QtMGRiOd c=1 sm=1 a=5CeyE4nVUmB46QZCKVgZLQ==:17 a=8aH1kwsY6JcA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=M4roAWbnUW4A:10 a=wdVBXaQ1PWgcX4Dgn0YA:9 a=CjuIK1q_8ugA:10 a=5CeyE4nVUmB46QZCKVgZLQ==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 12:56:14 -0000 > Log: > Fix FIONREAD on regular files. The computed result was being ignored and > it was being passed down to VOP_IOCTL() where it promptly resulted in > ENOTTY due to a missing else for the past 8 years. While here, use a > shared vnode lock while fetching the current file's size. In another thread I complained to kib about using the bad style of not returning as soon as possible, but instead sometimes returning and sometimes falling through a complicated if-else ladder to get to the return at the end. > Modified: head/sys/kern/vfs_vnops.c > ============================================================================== > --- head/sys/kern/vfs_vnops.c Fri May 3 18:58:37 2013 (r250219) > +++ head/sys/kern/vfs_vnops.c Fri May 3 19:08:58 2013 (r250220) > @@ -1364,13 +1364,12 @@ vn_ioctl(fp, com, data, active_cred, td) > case VREG: > case VDIR: > if (com == FIONREAD) { > - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); > + vn_lock(vp, LK_SHARED | LK_RETRY); > error = VOP_GETATTR(vp, &vattr, active_cred); > VOP_UNLOCK(vp, 0); > if (!error) > *(int *)data = vattr.va_size - fp->f_offset; Old versions were missing the bug because they just returned here. > - } > - if (com == FIONBIO || com == FIOASYNC) /* XXX */ > + } else if (com == FIONBIO || com == FIOASYNC) /* XXX */ > error = 0; This depended on the FIONREAD clause always returning. This was simpler since it just returned 0 instead of setting error and falling through a not-so-complicated if-else ladder to the return statement. But old versions used the bad style of falling through the default case for the VREG and VDIR cases. > else > error = VOP_IOCTL(vp, com, data, fp->f_flag, Better yet, in the old versions the default case was intended to return ENOTTY, but this was hacked out, so the VREG and VDIR cases that didn't already return fell through the null default statement into the VFIFO+VCHR+VBLK case that did essentially this ioctl, because a few file systems like cd9660 have some magic ioctls. So the old versions needed the earlier returns even more, to avoid special cases on falling through. The default case is now obfuscated by setting error to ENOTTY at the start of the function. After this fix, that setting applies only to the default case. The setting is missing the style bug if initializing error in its declaration. Only the initialization of vp has that bug. Bruce From owner-svn-src-head@FreeBSD.ORG Sat May 4 12:57:21 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AB4A5DD; Sat, 4 May 2013 12:57:21 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8554E192F; Sat, 4 May 2013 12:57:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44CvLCJ071810; Sat, 4 May 2013 12:57:21 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44CvLsT071809; Sat, 4 May 2013 12:57:21 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201305041257.r44CvLsT071809@svn.freebsd.org> From: Sergey Kandaurov Date: Sat, 4 May 2013 12:57:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250234 - head/lib/libc/nls X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 12:57:21 -0000 Author: pluknet Date: Sat May 4 12:57:21 2013 New Revision: 250234 URL: http://svnweb.freebsd.org/changeset/base/250234 Log: Add entry for errno ECAPMODE. MFC after: 3 days Modified: head/lib/libc/nls/C.msg Modified: head/lib/libc/nls/C.msg ============================================================================== --- head/lib/libc/nls/C.msg Sat May 4 12:44:00 2013 (r250233) +++ head/lib/libc/nls/C.msg Sat May 4 12:57:21 2013 (r250234) @@ -191,6 +191,8 @@ $ EPROTO 92 Protocol error $ ENOTCAPABLE 93 Capabilities insufficient +$ ECAPMODE +94 Not permitted in capability mode $ $ strsignal() support catalog $ From owner-svn-src-head@FreeBSD.ORG Sat May 4 14:00:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A7A8DDA3; Sat, 4 May 2013 14:00:17 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 81D151C3E; Sat, 4 May 2013 14:00:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44E0Hs0093601; Sat, 4 May 2013 14:00:17 GMT (envelope-from crees@svn.freebsd.org) Received: (from crees@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44E0GvD093597; Sat, 4 May 2013 14:00:16 GMT (envelope-from crees@svn.freebsd.org) Message-Id: <201305041400.r44E0GvD093597@svn.freebsd.org> From: Chris Rees Date: Sat, 4 May 2013 14:00:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250235 - in head: etc/rc.d sbin/mount X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 14:00:17 -0000 Author: crees (ports committer) Date: Sat May 4 14:00:16 2013 New Revision: 250235 URL: http://svnweb.freebsd.org/changeset/base/250235 Log: Introduce and use new flag -L to mount for mounting only late filesystems. Previously, rc.d/mountlate mounted *all* filesystems, causing problems with background NFS mounts being mounted twice. PR: conf/137629 Submitted by: eadler (original concept) Reviewed by: mjg Approved by: hrs Modified: head/etc/rc.d/mountlate head/sbin/mount/mount.8 head/sbin/mount/mount.c Modified: head/etc/rc.d/mountlate ============================================================================== --- head/etc/rc.d/mountlate Sat May 4 12:57:21 2013 (r250234) +++ head/etc/rc.d/mountlate Sat May 4 14:00:16 2013 (r250235) @@ -21,19 +21,10 @@ mountlate_start() # Mount "late" filesystems. # err=0 - latefs= - # / (root) fs is always remounted, so remove from list - latefs="`/sbin/mount -d -a -l | grep -v ' /$'`" - case ${latefs} in - '') - ;; - *) - echo -n 'Mounting late file systems:' - mount -a -l - err=$? - echo '.' - ;; - esac + echo -n 'Mounting late file systems:' + mount -a -L + err=$? + echo '.' case ${err} in 0) Modified: head/sbin/mount/mount.8 ============================================================================== --- head/sbin/mount/mount.8 Sat May 4 12:57:21 2013 (r250234) +++ head/sbin/mount/mount.8 Sat May 4 14:00:16 2013 (r250235) @@ -106,6 +106,13 @@ a file system mount status from read-wri Also forces the R/W mount of an unclean file system (dangerous; use with caution). +.It Fl L +When used in conjunction with the +.Fl a +option, mount +.Em only +those file systems which are marked as +.Dq Li late . .It Fl l When used in conjunction with the .Fl a Modified: head/sbin/mount/mount.c ============================================================================== --- head/sbin/mount/mount.c Sat May 4 12:57:21 2013 (r250234) +++ head/sbin/mount/mount.c Sat May 4 14:00:16 2013 (r250235) @@ -245,14 +245,15 @@ main(int argc, char *argv[]) struct fstab *fs; struct statfs *mntbuf; int all, ch, i, init_flags, late, failok, mntsize, rval, have_fstab, ro; + int onlylate; char *cp, *ep, *options; - all = init_flags = late = 0; + all = init_flags = late = onlylate = 0; ro = 0; options = NULL; vfslist = NULL; vfstype = "ufs"; - while ((ch = getopt(argc, argv, "adF:flo:prt:uvw")) != -1) + while ((ch = getopt(argc, argv, "adF:fLlo:prt:uvw")) != -1) switch (ch) { case 'a': all = 1; @@ -266,6 +267,10 @@ main(int argc, char *argv[]) case 'f': init_flags |= MNT_FORCE; break; + case 'L': + onlylate = 1; + late = 1; + break; case 'l': late = 1; break; @@ -327,6 +332,8 @@ main(int argc, char *argv[]) continue; if (hasopt(fs->fs_mntops, "noauto")) continue; + if (!hasopt(fs->fs_mntops, "late") && onlylate) + continue; if (hasopt(fs->fs_mntops, "late") && !late) continue; if (hasopt(fs->fs_mntops, "failok")) From owner-svn-src-head@FreeBSD.ORG Sat May 4 14:03:20 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 73853F31; Sat, 4 May 2013 14:03:20 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6504A1C50; Sat, 4 May 2013 14:03:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44E3KvG095839; Sat, 4 May 2013 14:03:20 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44E3JNJ095829; Sat, 4 May 2013 14:03:19 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201305041403.r44E3JNJ095829@svn.freebsd.org> From: Davide Italiano Date: Sat, 4 May 2013 14:03:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250236 - in head: contrib/smbfs/lib/smb contrib/smbfs/mount_smbfs sys/fs/smbfs sys/netsmb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 14:03:20 -0000 Author: davide Date: Sat May 4 14:03:18 2013 New Revision: 250236 URL: http://svnweb.freebsd.org/changeset/base/250236 Log: Completely rewrite the interface to smbdev switching from dev_clone to cdevpriv(9). This commit changes the semantic of mount_smbfs in userland as well, which now passes file descriptor in order to to mount a specific filesystem istance. Reviewed by: attilio, ed Tested by: martymac Modified: head/contrib/smbfs/lib/smb/ctx.c head/contrib/smbfs/mount_smbfs/mount_smbfs.c head/sys/fs/smbfs/smbfs.h head/sys/fs/smbfs/smbfs_vfsops.c head/sys/netsmb/smb_dev.c head/sys/netsmb/smb_dev.h Modified: head/contrib/smbfs/lib/smb/ctx.c ============================================================================== --- head/contrib/smbfs/lib/smb/ctx.c Sat May 4 14:00:16 2013 (r250235) +++ head/contrib/smbfs/lib/smb/ctx.c Sat May 4 14:03:18 2013 (r250236) @@ -602,40 +602,12 @@ smb_ctx_gethandle(struct smb_ctx *ctx) int fd, i; char buf[20]; - /* - * First, try to open as cloned device - */ fd = open("/dev/"NSMB_NAME, O_RDWR); if (fd >= 0) { ctx->ct_fd = fd; return 0; } - /* - * well, no clone capabilities available - we have to scan - * all devices in order to get free one - */ - for (i = 0; i < 1024; i++) { - snprintf(buf, sizeof(buf), "/dev/%s%d", NSMB_NAME, i); - fd = open(buf, O_RDWR); - if (fd >= 0) { - ctx->ct_fd = fd; - return 0; - } - } - /* - * This is a compatibility with old /dev/net/nsmb device - */ - for (i = 0; i < 1024; i++) { - snprintf(buf, sizeof(buf), "/dev/net/%s%d", NSMB_NAME, i); - fd = open(buf, O_RDWR); - if (fd >= 0) { - ctx->ct_fd = fd; - return 0; - } - if (errno == ENOENT) - return ENOENT; - } - return ENOENT; + return ENOENT; } int Modified: head/contrib/smbfs/mount_smbfs/mount_smbfs.c ============================================================================== --- head/contrib/smbfs/mount_smbfs/mount_smbfs.c Sat May 4 14:00:16 2013 (r250235) +++ head/contrib/smbfs/mount_smbfs/mount_smbfs.c Sat May 4 14:03:18 2013 (r250236) @@ -82,7 +82,7 @@ main(int argc, char *argv[]) struct xvfsconf vfc; #endif char *next; - int opt, error, mntflags, caseopt, dev; + int opt, error, mntflags, caseopt, fd; uid_t uid; gid_t gid; mode_t dir_mode, file_mode; @@ -90,7 +90,7 @@ main(int argc, char *argv[]) iov = NULL; iovlen = 0; - dev = 0; + fd = 0; uid = (uid_t)-1; gid = (gid_t)-1; caseopt = 0; @@ -266,11 +266,11 @@ main(int argc, char *argv[]) exit(1); } - dev = ctx->ct_fd; + fd = ctx->ct_fd; build_iovec(&iov, &iovlen, "fstype", strdup("smbfs"), -1); build_iovec(&iov, &iovlen, "fspath", mount_point, -1); - build_iovec_argf(&iov, &iovlen, "dev", "%d", dev); + build_iovec_argf(&iov, &iovlen, "fd", "%d", fd); build_iovec(&iov, &iovlen, "mountpoint", mount_point, -1); build_iovec_argf(&iov, &iovlen, "uid", "%d", uid); build_iovec_argf(&iov, &iovlen, "gid", "%d", gid); Modified: head/sys/fs/smbfs/smbfs.h ============================================================================== --- head/sys/fs/smbfs/smbfs.h Sat May 4 14:00:16 2013 (r250235) +++ head/sys/fs/smbfs/smbfs.h Sat May 4 14:03:18 2013 (r250236) @@ -75,6 +75,7 @@ struct smbmount { mode_t sm_dir_mode; struct mount * sm_mp; struct smbnode * sm_root; + struct smb_dev * sm_dev; struct ucred * sm_owner; uint64_t sm_flags; long sm_nextino; Modified: head/sys/fs/smbfs/smbfs_vfsops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vfsops.c Sat May 4 14:00:16 2013 (r250235) +++ head/sys/fs/smbfs/smbfs_vfsops.c Sat May 4 14:03:18 2013 (r250236) @@ -122,7 +122,7 @@ smbfs_cmount(struct mntarg *ma, void * d } static const char *smbfs_opts[] = { - "dev", "soft", "intr", "strong", "have_nls", "long", + "fd", "soft", "intr", "strong", "have_nls", "long", "mountpoint", "rootpath", "uid", "gid", "file_mode", "dir_mode", "caseopt", "errmsg", NULL }; @@ -135,10 +135,12 @@ smbfs_mount(struct mount *mp) struct smb_share *ssp = NULL; struct vnode *vp; struct thread *td; + struct smb_dev *dev; struct smb_cred *scred; int error, v; char *pc, *pe; + dev = NULL; td = curthread; if (mp->mnt_flag & (MNT_UPDATE | MNT_ROOTFS)) return EOPNOTSUPP; @@ -150,26 +152,29 @@ smbfs_mount(struct mount *mp) scred = smbfs_malloc_scred(); smb_makescred(scred, td, td->td_ucred); - if (1 != vfs_scanopt(mp->mnt_optnew, "dev", "%d", &v)) { - vfs_mount_error(mp, "No dev option"); + + /* Ask userspace of `fd`, the file descriptor of this session */ + if (1 != vfs_scanopt(mp->mnt_optnew, "fd", "%d", &v)) { + vfs_mount_error(mp, "No fd option"); smbfs_free_scred(scred); return (EINVAL); } - error = smb_dev2share(v, SMBM_EXEC, scred, &ssp); + error = smb_dev2share(v, SMBM_EXEC, scred, &ssp, &dev); + smp = malloc(sizeof(*smp), M_SMBFSDATA, M_WAITOK | M_ZERO); if (error) { printf("invalid device handle %d (%d)\n", v, error); - vfs_mount_error(mp, "invalid device handle %d (%d)\n", v, error); + vfs_mount_error(mp, "invalid device handle %d %d\n", v, error); smbfs_free_scred(scred); + free(smp, M_SMBFSDATA); return error; } vcp = SSTOVC(ssp); smb_share_unlock(ssp, 0); mp->mnt_stat.f_iosize = SSTOVC(ssp)->vc_txmax; - - smp = malloc(sizeof(*smp), M_SMBFSDATA, M_WAITOK | M_ZERO); - mp->mnt_data = smp; + mp->mnt_data = smp; smp->sm_share = ssp; smp->sm_root = NULL; + smp->sm_dev = dev; if (1 != vfs_scanopt(mp->mnt_optnew, "caseopt", "%d", &smp->sm_caseopt)) { vfs_mount_error(mp, "Invalid caseopt"); @@ -238,8 +243,15 @@ smbfs_mount(struct mount *mp) bad: if (ssp) smb_share_put(ssp, scred); - smbfs_free_scred(scred); - return error; + smbfs_free_scred(scred); + SMB_LOCK(); + if (error && smp->sm_dev == dev) { + smp->sm_dev = NULL; + sdp_trydestroy(dev); + } + SMB_UNLOCK(); + free(smp, M_SMBFSDATA); + return error; } /* Unmount the filesystem described by mp. */ @@ -249,6 +261,7 @@ smbfs_unmount(struct mount *mp, int mntf struct thread *td; struct smbmount *smp = VFSTOSMBFS(mp); struct smb_cred *scred; + struct smb_dev *dev; int error, flags; SMBVDEBUG("smbfs_unmount: flags=%04x\n", mntflags); @@ -277,7 +290,13 @@ smbfs_unmount(struct mount *mp, int mntf if (error) goto out; smb_share_put(smp->sm_share, scred); + SMB_LOCK(); + dev = smp->sm_dev; + if (!dev) + panic("No private data for mount point"); + sdp_trydestroy(dev); mp->mnt_data = NULL; + SMB_UNLOCK(); free(smp, M_SMBFSDATA); MNT_ILOCK(mp); mp->mnt_flag &= ~MNT_LOCAL; Modified: head/sys/netsmb/smb_dev.c ============================================================================== --- head/sys/netsmb/smb_dev.c Sat May 4 14:00:16 2013 (r250235) +++ head/sys/netsmb/smb_dev.c Sat May 4 14:03:18 2013 (r250236) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -55,20 +56,16 @@ __FBSDID("$FreeBSD$"); #include #include -#define SMB_GETDEV(dev) ((struct smb_dev*)(dev)->si_drv1) -#define SMB_CHECKMINOR(dev) do { \ - sdp = SMB_GETDEV(dev); \ - if (sdp == NULL) return ENXIO; \ - } while(0) +static struct cdev *nsmb_dev; static d_open_t nsmb_dev_open; -static d_close_t nsmb_dev_close; static d_ioctl_t nsmb_dev_ioctl; MODULE_DEPEND(netsmb, libiconv, 1, 1, 2); MODULE_VERSION(netsmb, NSMB_VERSION); static int smb_version = NSMB_VERSION; +struct sx smb_lock; SYSCTL_DECL(_net_smb); @@ -76,110 +73,97 @@ SYSCTL_INT(_net_smb, OID_AUTO, version, static MALLOC_DEFINE(M_NSMBDEV, "NETSMBDEV", "NET/SMB device"); - -/* -int smb_dev_queue(struct smb_dev *ndp, struct smb_rq *rqp, int prio); -*/ - static struct cdevsw nsmb_cdevsw = { .d_version = D_VERSION, - .d_flags = D_NEEDGIANT | D_NEEDMINOR, .d_open = nsmb_dev_open, - .d_close = nsmb_dev_close, .d_ioctl = nsmb_dev_ioctl, .d_name = NSMB_NAME }; -static eventhandler_tag nsmb_dev_tag; -static struct clonedevs *nsmb_clones; - -static void -nsmb_dev_clone(void *arg, struct ucred *cred, char *name, int namelen, - struct cdev **dev) +static int +nsmb_dev_init(void) { - int i, u; - if (*dev != NULL) - return; + nsmb_dev = make_dev(&nsmb_cdevsw, 0, UID_ROOT, GID_OPERATOR, + 0600, "nsmb"); + if (nsmb_dev == NULL) + return (ENOMEM); + return (0); +} - if (strcmp(name, NSMB_NAME) == 0) - u = -1; - else if (dev_stdclone(name, NULL, NSMB_NAME, &u) != 1) - return; - i = clone_create(&nsmb_clones, &nsmb_cdevsw, &u, dev, 0); - if (i) - *dev = make_dev_credf(MAKEDEV_REF, &nsmb_cdevsw, u, cred, - UID_ROOT, GID_WHEEL, 0600, "%s%d", NSMB_NAME, u); +static void +nsmb_dev_destroy(void) +{ + + MPASS(nsmb_dev != NULL); + destroy_dev(nsmb_dev); + nsmb_dev = NULL; } -static int -nsmb_dev_open(struct cdev *dev, int oflags, int devtype, struct thread *td) +static struct smb_dev * +smbdev_alloc(struct cdev *dev) { struct smb_dev *sdp; - struct ucred *cred = td->td_ucred; - int s; - sdp = SMB_GETDEV(dev); - if (sdp && (sdp->sd_flags & NSMBFL_OPEN)) - return EBUSY; - if (sdp == NULL) { - sdp = malloc(sizeof(*sdp), M_NSMBDEV, M_WAITOK); - dev->si_drv1 = (void*)sdp; - } - /* - * XXX: this is just crazy - make a device for an already passed device... - * someone should take care of it. - */ - if ((dev->si_flags & SI_NAMED) == 0) - make_dev(&nsmb_cdevsw, dev2unit(dev), cred->cr_uid, - cred->cr_gid, 0700, NSMB_NAME"%d", dev2unit(dev)); - bzero(sdp, sizeof(*sdp)); -/* - STAILQ_INIT(&sdp->sd_rqlist); - STAILQ_INIT(&sdp->sd_rplist); - bzero(&sdp->sd_pollinfo, sizeof(struct selinfo)); -*/ - s = splimp(); + sdp = malloc(sizeof(struct smb_dev), M_NSMBDEV, M_WAITOK | M_ZERO); + sdp->dev = dev; sdp->sd_level = -1; sdp->sd_flags |= NSMBFL_OPEN; - splx(s); - return 0; + sdp->refcount = 1; + return (sdp); +} + +void +sdp_dtor(void *arg) +{ + struct smb_dev *dev; + + dev = (struct smb_dev *)arg; + SMB_LOCK(); + sdp_trydestroy(dev); + SMB_UNLOCK(); } static int -nsmb_dev_close(struct cdev *dev, int flag, int fmt, struct thread *td) +nsmb_dev_open(struct cdev *dev, int oflags, int devtype, struct thread *td) { struct smb_dev *sdp; + int error; + + sdp = smbdev_alloc(dev); + error = devfs_set_cdevpriv(sdp, sdp_dtor); + if (error) { + free(sdp, M_NSMBDEV); + return (error); + } + return (0); +} + +void +sdp_trydestroy(struct smb_dev *sdp) +{ struct smb_vc *vcp; struct smb_share *ssp; struct smb_cred *scred; - int s; + SMB_LOCKASSERT(); + if (!sdp) + panic("No smb_dev upon device close"); + MPASS(sdp->refcount > 0); + sdp->refcount--; + if (sdp->refcount) + return; scred = malloc(sizeof(struct smb_cred), M_NSMBDEV, M_WAITOK); - SMB_CHECKMINOR(dev); - s = splimp(); - if ((sdp->sd_flags & NSMBFL_OPEN) == 0) { - splx(s); - free(scred, M_NSMBDEV); - return EBADF; - } - smb_makescred(scred, td, NULL); + smb_makescred(scred, curthread, NULL); ssp = sdp->sd_share; if (ssp != NULL) smb_share_rele(ssp, scred); vcp = sdp->sd_vc; if (vcp != NULL) smb_vc_rele(vcp, scred); -/* - smb_flushq(&sdp->sd_rqlist); - smb_flushq(&sdp->sd_rplist); -*/ - dev->si_drv1 = NULL; - free(sdp, M_NSMBDEV); - destroy_dev_sched(dev); - splx(s); free(scred, M_NSMBDEV); - return 0; + free(sdp, M_NSMBDEV); + return; } @@ -192,11 +176,11 @@ nsmb_dev_ioctl(struct cdev *dev, u_long struct smb_cred *scred; int error = 0; - SMB_CHECKMINOR(dev); - if ((sdp->sd_flags & NSMBFL_OPEN) == 0) - return EBADF; - + error = devfs_get_cdevpriv((void **)&sdp); + if (error) + return (error); scred = malloc(sizeof(struct smb_cred), M_NSMBDEV, M_WAITOK); + SMB_LOCK(); smb_makescred(scred, td, NULL); switch (cmd) { case SMBIOC_OPENSESSION: @@ -345,6 +329,7 @@ nsmb_dev_ioctl(struct cdev *dev, u_long } out: free(scred, M_NSMBDEV); + SMB_UNLOCK(); return error; } @@ -363,18 +348,18 @@ nsmb_dev_load(module_t mod, int cmd, voi smb_sm_done(); break; } - clone_setup(&nsmb_clones); - nsmb_dev_tag = EVENTHANDLER_REGISTER(dev_clone, nsmb_dev_clone, 0, 1000); + error = nsmb_dev_init(); + if (error) + break; + sx_init(&smb_lock, "samba device lock"); break; case MOD_UNLOAD: smb_iod_done(); error = smb_sm_done(); if (error) break; - EVENTHANDLER_DEREGISTER(dev_clone, nsmb_dev_tag); - drain_dev_clone_events(); - clone_cleanup(&nsmb_clones); - destroy_dev_drain(&nsmb_cdevsw); + nsmb_dev_destroy(); + sx_destroy(&smb_lock); break; default: error = EINVAL; @@ -385,58 +370,40 @@ nsmb_dev_load(module_t mod, int cmd, voi DEV_MODULE (dev_netsmb, nsmb_dev_load, 0); -/* - * Convert a file descriptor to appropriate smb_share pointer - */ -static struct file* -nsmb_getfp(struct filedesc* fdp, int fd, int flag) -{ - struct file* fp; - - FILEDESC_SLOCK(fdp); - if ((fp = fget_locked(fdp, fd)) == NULL || (fp->f_flag & flag) == 0) { - FILEDESC_SUNLOCK(fdp); - return (NULL); - } - fhold(fp); - FILEDESC_SUNLOCK(fdp); - return (fp); -} - int smb_dev2share(int fd, int mode, struct smb_cred *scred, - struct smb_share **sspp) + struct smb_share **sspp, struct smb_dev **ssdp) { - struct file *fp; - struct vnode *vp; + struct file *fp, *fptmp; struct smb_dev *sdp; struct smb_share *ssp; - struct cdev *dev; + struct thread *td; int error; - fp = nsmb_getfp(scred->scr_td->td_proc->p_fd, fd, FREAD | FWRITE); - if (fp == NULL) - return EBADF; - vp = fp->f_vnode; - if (vp == NULL) { - fdrop(fp, curthread); - return EBADF; - } - if (vp->v_type != VCHR) { - fdrop(fp, curthread); - return EBADF; - } - dev = vp->v_rdev; - SMB_CHECKMINOR(dev); + td = curthread; + error = fget(td, fd, CAP_READ, &fp); + if (error) + return (error); + fptmp = td->td_fpop; + td->td_fpop = fp; + error = devfs_get_cdevpriv((void **)&sdp); + td->td_fpop = fptmp; + fdrop(fp, td); + if (error || sdp == NULL) + return (error); + SMB_LOCK(); + *ssdp = sdp; ssp = sdp->sd_share; if (ssp == NULL) { - fdrop(fp, curthread); - return ENOTCONN; + SMB_UNLOCK(); + return (ENOTCONN); } error = smb_share_get(ssp, LK_EXCLUSIVE, scred); - if (error == 0) + if (error == 0) { + sdp->refcount++; *sspp = ssp; - fdrop(fp, curthread); + } + SMB_UNLOCK(); return error; } Modified: head/sys/netsmb/smb_dev.h ============================================================================== --- head/sys/netsmb/smb_dev.h Sat May 4 14:00:16 2013 (r250235) +++ head/sys/netsmb/smb_dev.h Sat May 4 14:03:18 2013 (r250236) @@ -155,22 +155,28 @@ struct smbioc_rw { STAILQ_HEAD(smbrqh, smb_rq); struct smb_dev { + struct cdev * dev; int sd_opened; int sd_level; struct smb_vc * sd_vc; /* reference to VC */ struct smb_share *sd_share; /* reference to share if any */ int sd_poll; int sd_seq; -/* struct ifqueue sd_rdqueue; - struct ifqueue sd_wrqueue; - struct selinfo sd_pollinfo; - struct smbrqh sd_rqlist; - struct smbrqh sd_rplist; - struct ucred *sd_owner;*/ int sd_flags; + int refcount; + int usecount; }; +extern struct sx smb_lock; +#define SMB_LOCK() sx_xlock(&smb_lock) +#define SMB_UNLOCK() sx_unlock(&smb_lock) +#define SMB_LOCKASSERT() sx_assert(&smb_lock, SA_XLOCKED) + struct smb_cred; + +void sdp_dtor(void *arg); +void sdp_trydestroy(struct smb_dev *dev); + /* * Compound user interface */ @@ -185,7 +191,7 @@ int smb_usr_simplerequest(struct smb_sh int smb_usr_t2request(struct smb_share *ssp, struct smbioc_t2rq *data, struct smb_cred *scred); int smb_dev2share(int fd, int mode, struct smb_cred *scred, - struct smb_share **sspp); + struct smb_share **sspp, struct smb_dev **ssdp); #endif /* _KERNEL */ From owner-svn-src-head@FreeBSD.ORG Sat May 4 14:18:11 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DFE6A7A1; Sat, 4 May 2013 14:18:11 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D21F61CF4; Sat, 4 May 2013 14:18:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44EIBIg001218; Sat, 4 May 2013 14:18:11 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44EIB0i001211; Sat, 4 May 2013 14:18:11 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201305041418.r44EIB0i001211@svn.freebsd.org> From: Davide Italiano Date: Sat, 4 May 2013 14:18:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250237 - in head/sys: fs/smbfs netsmb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 14:18:12 -0000 Author: davide Date: Sat May 4 14:18:10 2013 New Revision: 250237 URL: http://svnweb.freebsd.org/changeset/base/250237 Log: Overhaul locking in netsmb, getting rid of the obsolete lockmgr() primitive. This solves a long standing LOR between smb_conn and smb_vc. Tested by: martymac, pho (previous version) Modified: head/sys/fs/smbfs/smbfs_vfsops.c head/sys/netsmb/smb_conn.c head/sys/netsmb/smb_conn.h head/sys/netsmb/smb_dev.c Modified: head/sys/fs/smbfs/smbfs_vfsops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vfsops.c Sat May 4 14:03:18 2013 (r250236) +++ head/sys/fs/smbfs/smbfs_vfsops.c Sat May 4 14:18:10 2013 (r250237) @@ -169,7 +169,7 @@ smbfs_mount(struct mount *mp) return error; } vcp = SSTOVC(ssp); - smb_share_unlock(ssp, 0); + smb_share_unlock(ssp); mp->mnt_stat.f_iosize = SSTOVC(ssp)->vc_txmax; mp->mnt_data = smp; smp->sm_share = ssp; @@ -286,7 +286,7 @@ smbfs_unmount(struct mount *mp, int mntf return error; scred = smbfs_malloc_scred(); smb_makescred(scred, td, td->td_ucred); - error = smb_share_lock(smp->sm_share, LK_EXCLUSIVE); + error = smb_share_lock(smp->sm_share); if (error) goto out; smb_share_put(smp->sm_share, scred); Modified: head/sys/netsmb/smb_conn.c ============================================================================== --- head/sys/netsmb/smb_conn.c Sat May 4 14:03:18 2013 (r250236) +++ head/sys/netsmb/smb_conn.c Sat May 4 14:18:10 2013 (r250237) @@ -59,8 +59,6 @@ static MALLOC_DEFINE(M_SMBCONN, "smb_con static void smb_co_init(struct smb_connobj *cp, int level, char *ilockname, char *lockname); static void smb_co_done(struct smb_connobj *cp); -static int smb_co_lockstatus(struct smb_connobj *cp); - static int smb_vc_disconnect(struct smb_vc *vcp); static void smb_vc_free(struct smb_connobj *cp); static void smb_vc_gone(struct smb_connobj *cp, struct smb_cred *scred); @@ -77,7 +75,9 @@ smb_sm_init(void) { smb_co_init(&smb_vclist, SMBL_SM, "smbsm ilock", "smbsm"); - smb_co_unlock(&smb_vclist, 0); + sx_xlock(&smb_vclist.co_interlock); + smb_co_unlock(&smb_vclist); + sx_unlock(&smb_vclist.co_interlock); return 0; } @@ -90,23 +90,29 @@ smb_sm_done(void) SMBERROR("%d connections still active\n", smb_vclist.co_usecount - 1); return EBUSY; } - lockmgr(&smb_vclist.co_lock, LK_DRAIN, NULL); smb_co_done(&smb_vclist); return 0; } static int -smb_sm_lockvclist(int flags) +smb_sm_lockvclist(void) { + int error; + + sx_xlock(&smb_vclist.co_interlock); + error = smb_co_lock(&smb_vclist); + sx_unlock(&smb_vclist.co_interlock); - return smb_co_lock(&smb_vclist, flags | LK_CANRECURSE); + return error; } static void smb_sm_unlockvclist(void) { - smb_co_unlock(&smb_vclist, LK_RELEASE); + sx_xlock(&smb_vclist.co_interlock); + smb_co_unlock(&smb_vclist); + sx_unlock(&smb_vclist.co_interlock); } static int @@ -123,7 +129,7 @@ smb_sm_lookupint(struct smb_vcspec *vcsp vcp = NULL; SMBCO_FOREACH(scp, &smb_vclist) { vcp = (struct smb_vc *)scp; - error = smb_vc_lock(vcp, LK_EXCLUSIVE); + error = smb_vc_lock(vcp); if (error) continue; @@ -160,7 +166,7 @@ smb_sm_lookupint(struct smb_vcspec *vcsp err1: error = 1; fail: - smb_vc_unlock(vcp, 0); + smb_vc_unlock(vcp); } if (vcp) { smb_vc_ref(vcp); @@ -179,7 +185,7 @@ smb_sm_lookup(struct smb_vcspec *vcspec, *vcpp = vcp = NULL; - error = smb_sm_lockvclist(LK_EXCLUSIVE); + error = smb_sm_lockvclist(); if (error) return error; error = smb_sm_lookupint(vcspec, shspec, scred, vcpp); @@ -211,7 +217,7 @@ out: if (error == 0) *vcpp = vcp; else if (vcp) { - smb_vc_lock(vcp, LK_EXCLUSIVE); + smb_vc_lock(vcp); smb_vc_put(vcp, scred); } return error; @@ -224,20 +230,26 @@ static void smb_co_init(struct smb_connobj *cp, int level, char *ilockname, char *lockname) { SLIST_INIT(&cp->co_children); - smb_sl_init(&cp->co_interlock, ilockname); - lockinit(&cp->co_lock, PZERO, lockname, 0, 0); + sx_init_flags(&cp->co_interlock, ilockname, SX_RECURSE); + cv_init(&cp->co_lock, "smblock"); + cp->co_lockcnt = 0; + cp->co_locker = NULL; cp->co_level = level; cp->co_usecount = 1; - if (smb_co_lock(cp, LK_EXCLUSIVE) != 0) - panic("smb_co_init: lock failed"); + sx_xlock(&cp->co_interlock); + smb_co_lock(cp); + sx_unlock(&cp->co_interlock); } static void smb_co_done(struct smb_connobj *cp) { - smb_sl_destroy(&cp->co_interlock); - lockmgr(&cp->co_lock, LK_RELEASE, NULL); - lockdestroy(&cp->co_lock); + + sx_destroy(&cp->co_interlock); + cv_destroy(&cp->co_lock); + cp->co_locker = NULL; + cp->co_flags = 0; + cp->co_lockcnt = 0; } static void @@ -249,7 +261,9 @@ smb_co_gone(struct smb_connobj *cp, stru cp->co_gone(cp, scred); parent = cp->co_parent; if (parent) { - smb_co_lock(parent, LK_EXCLUSIVE); + sx_xlock(&parent->co_interlock); + smb_co_lock(parent); + sx_unlock(&parent->co_interlock); SLIST_REMOVE(&parent->co_children, cp, smb_connobj, co_next); smb_co_put(parent, scred); } @@ -261,56 +275,51 @@ void smb_co_ref(struct smb_connobj *cp) { - SMB_CO_LOCK(cp); + sx_xlock(&cp->co_interlock); cp->co_usecount++; - SMB_CO_UNLOCK(cp); + sx_unlock(&cp->co_interlock); } void smb_co_rele(struct smb_connobj *cp, struct smb_cred *scred) { - SMB_CO_LOCK(cp); + sx_xlock(&cp->co_interlock); + smb_co_unlock(cp); if (cp->co_usecount > 1) { cp->co_usecount--; - SMB_CO_UNLOCK(cp); + sx_unlock(&cp->co_interlock); return; } if (cp->co_usecount == 0) { SMBERROR("negative use_count for object %d", cp->co_level); - SMB_CO_UNLOCK(cp); + sx_unlock(&cp->co_interlock); return; } cp->co_usecount--; cp->co_flags |= SMBO_GONE; - - lockmgr(&cp->co_lock, LK_DRAIN | LK_INTERLOCK, &cp->co_interlock); + sx_unlock(&cp->co_interlock); smb_co_gone(cp, scred); } int -smb_co_get(struct smb_connobj *cp, int flags, struct smb_cred *scred) +smb_co_get(struct smb_connobj *cp, struct smb_cred *scred) { int error; - if ((flags & LK_INTERLOCK) == 0) - SMB_CO_LOCK(cp); + MPASS(sx_xholder(&cp->co_interlock) == curthread); cp->co_usecount++; - error = smb_co_lock(cp, flags | LK_INTERLOCK); - if (error) { - SMB_CO_LOCK(cp); + error = smb_co_lock(cp); + if (error) cp->co_usecount--; - SMB_CO_UNLOCK(cp); - return error; - } - return 0; + return error; } void smb_co_put(struct smb_connobj *cp, struct smb_cred *scred) { - SMB_CO_LOCK(cp); + sx_xlock(&cp->co_interlock); if (cp->co_usecount > 1) { cp->co_usecount--; } else if (cp->co_usecount == 1) { @@ -319,50 +328,51 @@ smb_co_put(struct smb_connobj *cp, struc } else { SMBERROR("negative usecount"); } - lockmgr(&cp->co_lock, LK_RELEASE | LK_INTERLOCK, &cp->co_interlock); + smb_co_unlock(cp); + sx_unlock(&cp->co_interlock); if ((cp->co_flags & SMBO_GONE) == 0) return; - lockmgr(&cp->co_lock, LK_DRAIN, NULL); smb_co_gone(cp, scred); } int -smb_co_lockstatus(struct smb_connobj *cp) +smb_co_lock(struct smb_connobj *cp) { - return lockstatus(&cp->co_lock); -} -int -smb_co_lock(struct smb_connobj *cp, int flags) -{ - - if (cp->co_flags & SMBO_GONE) - return EINVAL; - if ((flags & LK_TYPE_MASK) == 0) - flags |= LK_EXCLUSIVE; - if (smb_co_lockstatus(cp) == LK_EXCLUSIVE && - (flags & LK_CANRECURSE) == 0) { - SMBERROR("recursive lock for object %d\n", cp->co_level); - return 0; + MPASS(sx_xholder(&cp->co_interlock) == curthread); + for (;;) { + if (cp->co_flags & SMBO_GONE) + return EINVAL; + if (cp->co_locker == NULL) { + cp->co_locker = curthread; + return 0; + } + if (cp->co_locker == curthread) { + cp->co_lockcnt++; + return 0; + } + cv_wait(&cp->co_lock, &cp->co_interlock); } - return lockmgr(&cp->co_lock, flags, &cp->co_interlock); } void -smb_co_unlock(struct smb_connobj *cp, int flags) +smb_co_unlock(struct smb_connobj *cp) { - (void)lockmgr(&cp->co_lock, flags | LK_RELEASE, &cp->co_interlock); + + MPASS(sx_xholder(&cp->co_interlock) == curthread); + MPASS(cp->co_locker == curthread); + if (cp->co_lockcnt != 0) { + cp->co_lockcnt--; + return; + } + cp->co_locker = NULL; + cv_signal(&cp->co_lock); } static void smb_co_addchild(struct smb_connobj *parent, struct smb_connobj *child) { - KASSERT(smb_co_lockstatus(parent) == LK_EXCLUSIVE, - ("smb_co_addchild: parent not locked")); - KASSERT(smb_co_lockstatus(child) == LK_EXCLUSIVE, - ("smb_co_addchild: child not locked")); - smb_co_ref(parent); SLIST_INSERT_HEAD(&parent->co_children, child, co_next); child->co_parent = parent; @@ -543,9 +553,16 @@ smb_vc_rele(struct smb_vc *vcp, struct s } int -smb_vc_get(struct smb_vc *vcp, int flags, struct smb_cred *scred) +smb_vc_get(struct smb_vc *vcp, struct smb_cred *scred) { - return smb_co_get(VCTOCP(vcp), flags, scred); + struct smb_connobj *cp; + int error; + + cp = VCTOCP(vcp); + sx_xlock(&cp->co_interlock); + error = smb_co_get(cp, scred); + sx_unlock(&cp->co_interlock); + return error; } void @@ -555,15 +572,28 @@ smb_vc_put(struct smb_vc *vcp, struct sm } int -smb_vc_lock(struct smb_vc *vcp, int flags) +smb_vc_lock(struct smb_vc *vcp) { - return smb_co_lock(VCTOCP(vcp), flags); + struct smb_connobj *cp; + int error; + + cp = VCTOCP(vcp); + sx_xlock(&cp->co_interlock); + error = smb_co_lock(cp); + sx_unlock(&cp->co_interlock); + return error; } void -smb_vc_unlock(struct smb_vc *vcp, int flags) +smb_vc_unlock(struct smb_vc *vcp) { - smb_co_unlock(VCTOCP(vcp), flags); + + struct smb_connobj *cp; + + cp = VCTOCP(vcp); + sx_xlock(&cp->co_interlock); + smb_co_unlock(cp); + sx_unlock(&cp->co_interlock); } int @@ -623,12 +653,12 @@ smb_vc_lookupshare(struct smb_vc *vcp, s dp->scred = scred; SMBCO_FOREACH(scp, VCTOCP(vcp)) { ssp = (struct smb_share *)scp; - error = smb_share_lock(ssp, LK_EXCLUSIVE); + error = smb_share_lock(ssp); if (error) continue; if (smb_vc_cmpshare(ssp, dp) == 0) break; - smb_share_unlock(ssp, 0); + smb_share_unlock(ssp); } if (ssp) { smb_share_ref(ssp); @@ -690,10 +720,10 @@ u_short smb_vc_nextmid(struct smb_vc *vcp) { u_short r; - - SMB_CO_LOCK(&vcp->obj); + + sx_xlock(&vcp->obj.co_interlock); r = vcp->vc_mid++; - SMB_CO_UNLOCK(&vcp->obj); + sx_unlock(&vcp->obj.co_interlock); return r; } @@ -784,27 +814,46 @@ smb_share_rele(struct smb_share *ssp, st } int -smb_share_get(struct smb_share *ssp, int flags, struct smb_cred *scred) +smb_share_get(struct smb_share *ssp, struct smb_cred *scred) { - return smb_co_get(SSTOCP(ssp), flags, scred); + struct smb_connobj *cp = SSTOCP(ssp); + int error; + + sx_xlock(&cp->co_interlock); + error = smb_co_get(cp, scred); + sx_unlock(&cp->co_interlock); + return error; } void smb_share_put(struct smb_share *ssp, struct smb_cred *scred) { + smb_co_put(SSTOCP(ssp), scred); } int -smb_share_lock(struct smb_share *ssp, int flags) +smb_share_lock(struct smb_share *ssp) { - return smb_co_lock(SSTOCP(ssp), flags); + struct smb_connobj *cp; + int error; + + cp = SSTOCP(ssp); + sx_xlock(&cp->co_interlock); + error = smb_co_lock(cp); + sx_unlock(&cp->co_interlock); + return error; } void -smb_share_unlock(struct smb_share *ssp, int flags) +smb_share_unlock(struct smb_share *ssp) { - smb_co_unlock(SSTOCP(ssp), flags); + struct smb_connobj *cp; + + cp = SSTOCP(ssp); + sx_xlock(&cp->co_interlock); + smb_co_unlock(cp); + sx_unlock(&cp->co_interlock); } int @@ -878,34 +927,34 @@ smb_sysctl_treedump(SYSCTL_HANDLER_ARGS) error = sysctl_wire_old_buffer(req, 0); if (error) return (error); - error = smb_sm_lockvclist(LK_SHARED); + error = smb_sm_lockvclist(); if (error) return error; SMBCO_FOREACH(scp1, &smb_vclist) { vcp = (struct smb_vc *)scp1; - error = smb_vc_lock(vcp, LK_SHARED); + error = smb_vc_lock(vcp); if (error) continue; smb_vc_getinfo(vcp, &vci); error = SYSCTL_OUT(req, &vci, sizeof(struct smb_vc_info)); if (error) { - smb_vc_unlock(vcp, 0); + smb_vc_unlock(vcp); break; } SMBCO_FOREACH(scp2, VCTOCP(vcp)) { ssp = (struct smb_share *)scp2; - error = smb_share_lock(ssp, LK_SHARED); + error = smb_share_lock(ssp); if (error) { error = 0; continue; } smb_share_getinfo(ssp, &ssi); - smb_share_unlock(ssp, 0); + smb_share_unlock(ssp); error = SYSCTL_OUT(req, &ssi, sizeof(struct smb_share_info)); if (error) break; } - smb_vc_unlock(vcp, 0); + smb_vc_unlock(vcp); if (error) break; } Modified: head/sys/netsmb/smb_conn.h ============================================================================== --- head/sys/netsmb/smb_conn.h Sat May 4 14:03:18 2013 (r250236) +++ head/sys/netsmb/smb_conn.h Sat May 4 14:18:10 2013 (r250237) @@ -158,9 +158,11 @@ struct smb_share_info { #ifdef _KERNEL -#include -#include #include +#include +#include +#include +#include #define CONNADDREQ(a1,a2) ((a1)->sa_len == (a2)->sa_len && \ bcmp(a1, a2, (a1)->sa_len) == 0) @@ -190,14 +192,13 @@ struct smb_connobj; typedef void smb_co_gone_t (struct smb_connobj *cp, struct smb_cred *scred); typedef void smb_co_free_t (struct smb_connobj *cp); -#define SMB_CO_LOCK(cp) smb_sl_lock(&(cp)->co_interlock) -#define SMB_CO_UNLOCK(cp) smb_sl_unlock(&(cp)->co_interlock) - struct smb_connobj { + struct cv co_lock; + struct thread *co_locker; + struct sx co_interlock; + int co_lockcnt; int co_level; /* SMBL_ */ int co_flags; - struct lock co_lock; - struct smb_slock co_interlock; int co_usecount; struct smb_connobj * co_parent; SLIST_HEAD(,smb_connobj)co_children; @@ -225,7 +226,6 @@ struct smb_connobj { #define SMBC_ST_LOCK(vcp) smb_sl_lock(&(vcp)->vc_stlock) #define SMBC_ST_UNLOCK(vcp) smb_sl_unlock(&(vcp)->vc_stlock) - struct smb_vc { struct smb_connobj obj; char * vc_srvname; @@ -361,10 +361,10 @@ int smb_sm_lookup(struct smb_vcspec *vc */ void smb_co_ref(struct smb_connobj *cp); void smb_co_rele(struct smb_connobj *cp, struct smb_cred *scred); -int smb_co_get(struct smb_connobj *cp, int flags, struct smb_cred *scred); +int smb_co_get(struct smb_connobj *cp, struct smb_cred *scred); void smb_co_put(struct smb_connobj *cp, struct smb_cred *scred); -int smb_co_lock(struct smb_connobj *cp, int flags); -void smb_co_unlock(struct smb_connobj *cp, int flags); +int smb_co_lock(struct smb_connobj *cp); +void smb_co_unlock(struct smb_connobj *cp); /* * session level functions @@ -373,12 +373,12 @@ int smb_vc_create(struct smb_vcspec *vc struct smb_cred *scred, struct smb_vc **vcpp); int smb_vc_connect(struct smb_vc *vcp, struct smb_cred *scred); int smb_vc_access(struct smb_vc *vcp, struct smb_cred *scred, mode_t mode); -int smb_vc_get(struct smb_vc *vcp, int flags, struct smb_cred *scred); +int smb_vc_get(struct smb_vc *vcp, struct smb_cred *scred); void smb_vc_put(struct smb_vc *vcp, struct smb_cred *scred); void smb_vc_ref(struct smb_vc *vcp); void smb_vc_rele(struct smb_vc *vcp, struct smb_cred *scred); -int smb_vc_lock(struct smb_vc *vcp, int flags); -void smb_vc_unlock(struct smb_vc *vcp, int flags); +int smb_vc_lock(struct smb_vc *vcp); +void smb_vc_unlock(struct smb_vc *vcp); int smb_vc_lookupshare(struct smb_vc *vcp, struct smb_sharespec *shspec, struct smb_cred *scred, struct smb_share **sspp); const char * smb_vc_getpass(struct smb_vc *vcp); @@ -392,10 +392,10 @@ int smb_share_create(struct smb_vc *vcp int smb_share_access(struct smb_share *ssp, struct smb_cred *scred, mode_t mode); void smb_share_ref(struct smb_share *ssp); void smb_share_rele(struct smb_share *ssp, struct smb_cred *scred); -int smb_share_get(struct smb_share *ssp, int flags, struct smb_cred *scred); +int smb_share_get(struct smb_share *ssp, struct smb_cred *scred); void smb_share_put(struct smb_share *ssp, struct smb_cred *scred); -int smb_share_lock(struct smb_share *ssp, int flags); -void smb_share_unlock(struct smb_share *ssp, int flags); +int smb_share_lock(struct smb_share *ssp); +void smb_share_unlock(struct smb_share *ssp); void smb_share_invalidate(struct smb_share *ssp); int smb_share_valid(struct smb_share *ssp); const char * smb_share_getpass(struct smb_share *ssp); Modified: head/sys/netsmb/smb_dev.c ============================================================================== --- head/sys/netsmb/smb_dev.c Sat May 4 14:03:18 2013 (r250236) +++ head/sys/netsmb/smb_dev.c Sat May 4 14:18:10 2013 (r250237) @@ -156,11 +156,15 @@ sdp_trydestroy(struct smb_dev *sdp) scred = malloc(sizeof(struct smb_cred), M_NSMBDEV, M_WAITOK); smb_makescred(scred, curthread, NULL); ssp = sdp->sd_share; - if (ssp != NULL) + if (ssp != NULL) { + smb_share_lock(ssp); smb_share_rele(ssp, scred); + } vcp = sdp->sd_vc; - if (vcp != NULL) + if (vcp != NULL) { + smb_vc_lock(vcp); smb_vc_rele(vcp, scred); + } free(scred, M_NSMBDEV); free(sdp, M_NSMBDEV); return; @@ -193,7 +197,7 @@ nsmb_dev_ioctl(struct cdev *dev, u_long if (error) break; sdp->sd_vc = vcp; - smb_vc_unlock(vcp, 0); + smb_vc_unlock(vcp); sdp->sd_level = SMBL_VC; break; case SMBIOC_OPENSHARE: @@ -210,7 +214,7 @@ nsmb_dev_ioctl(struct cdev *dev, u_long if (error) break; sdp->sd_share = ssp; - smb_share_unlock(ssp, 0); + smb_share_unlock(ssp); sdp->sd_level = SMBL_SHARE; break; case SMBIOC_REQUEST: @@ -240,7 +244,7 @@ nsmb_dev_ioctl(struct cdev *dev, u_long error = ENOTCONN; goto out; } - error = smb_vc_get(vcp, LK_EXCLUSIVE, scred); + error = smb_vc_get(vcp, scred); if (error) break; if (on && (vcp->obj.co_flags & SMBV_PERMANENT) == 0) { @@ -260,7 +264,7 @@ nsmb_dev_ioctl(struct cdev *dev, u_long error = ENOTCONN; goto out; } - error = smb_share_get(ssp, LK_EXCLUSIVE, scred); + error = smb_share_get(ssp, scred); if (error) break; if (on && (ssp->obj.co_flags & SMBS_PERMANENT) == 0) { @@ -290,12 +294,12 @@ nsmb_dev_ioctl(struct cdev *dev, u_long break; if (vcp) { sdp->sd_vc = vcp; - smb_vc_unlock(vcp, 0); + smb_vc_unlock(vcp); sdp->sd_level = SMBL_VC; } if (ssp) { sdp->sd_share = ssp; - smb_share_unlock(ssp, 0); + smb_share_unlock(ssp); sdp->sd_level = SMBL_SHARE; } break; @@ -398,7 +402,7 @@ smb_dev2share(int fd, int mode, struct s SMB_UNLOCK(); return (ENOTCONN); } - error = smb_share_get(ssp, LK_EXCLUSIVE, scred); + error = smb_share_get(ssp, scred); if (error == 0) { sdp->refcount++; *sspp = ssp; From owner-svn-src-head@FreeBSD.ORG Sat May 4 14:27:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 79D50C31; Sat, 4 May 2013 14:27:29 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 513C21D34; Sat, 4 May 2013 14:27:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44ERTQo004466; Sat, 4 May 2013 14:27:29 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44ERTRT004465; Sat, 4 May 2013 14:27:29 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201305041427.r44ERTRT004465@svn.freebsd.org> From: Davide Italiano Date: Sat, 4 May 2013 14:27:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250238 - head/sys/fs/smbfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 14:27:29 -0000 Author: davide Date: Sat May 4 14:27:28 2013 New Revision: 250238 URL: http://svnweb.freebsd.org/changeset/base/250238 Log: Change VM_OBJECT_LOCK/UNLOCK() -> VM_OBJECT_WLOCK/WUNLOCK() to reflect the recent switch of the vm object lock to a rwlock. Reported by: attilio Modified: head/sys/fs/smbfs/smbfs_io.c Modified: head/sys/fs/smbfs/smbfs_io.c ============================================================================== --- head/sys/fs/smbfs/smbfs_io.c Sat May 4 14:18:10 2013 (r250237) +++ head/sys/fs/smbfs/smbfs_io.c Sat May 4 14:27:28 2013 (r250238) @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -460,7 +461,7 @@ smbfs_getpages(ap) */ m = pages[reqpage]; - VM_OBJECT_LOCK(object); + VM_OBJECT_WLOCK(object); if (m->valid != 0) { for (i = 0; i < npages; ++i) { if (i != reqpage) { @@ -469,10 +470,10 @@ smbfs_getpages(ap) vm_page_unlock(pages[i]); } } - VM_OBJECT_UNLOCK(object); + VM_OBJECT_WUNLOCK(object); return 0; } - VM_OBJECT_UNLOCK(object); + VM_OBJECT_WUNLOCK(object); scred = smbfs_malloc_scred(); smb_makescred(scred, td, cred); @@ -500,7 +501,7 @@ smbfs_getpages(ap) relpbuf(bp, &smbfs_pbuf_freecnt); - VM_OBJECT_LOCK(object); + VM_OBJECT_WLOCK(object); if (error && (uio.uio_resid == count)) { printf("smbfs_getpages: error %d\n",error); for (i = 0; i < npages; i++) { @@ -510,7 +511,7 @@ smbfs_getpages(ap) vm_page_unlock(pages[i]); } } - VM_OBJECT_UNLOCK(object); + VM_OBJECT_WUNLOCK(object); return VM_PAGER_ERROR; } @@ -548,7 +549,7 @@ smbfs_getpages(ap) if (i != reqpage) vm_page_readahead_finish(m); } - VM_OBJECT_UNLOCK(object); + VM_OBJECT_WUNLOCK(object); return 0; #endif /* SMBFS_RWGENERIC */ } @@ -667,9 +668,9 @@ smbfs_vinvalbuf(struct vnode *vp, struct np->n_flag |= NFLUSHINPROG; if (vp->v_bufobj.bo_object != NULL) { - VM_OBJECT_LOCK(vp->v_bufobj.bo_object); + VM_OBJECT_WLOCK(vp->v_bufobj.bo_object); vm_object_page_clean(vp->v_bufobj.bo_object, 0, 0, OBJPC_SYNC); - VM_OBJECT_UNLOCK(vp->v_bufobj.bo_object); + VM_OBJECT_WUNLOCK(vp->v_bufobj.bo_object); } error = vinvalbuf(vp, V_SAVE, PCATCH, 0); From owner-svn-src-head@FreeBSD.ORG Sat May 4 15:10:01 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B36DE4C5; Sat, 4 May 2013 15:10:01 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A56AC1EE6; Sat, 4 May 2013 15:10:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44FA1G3019097; Sat, 4 May 2013 15:10:01 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44FA1kB019096; Sat, 4 May 2013 15:10:01 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201305041510.r44FA1kB019096@svn.freebsd.org> From: Gavin Atkinson Date: Sat, 4 May 2013 15:10:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250239 - head/share/man/man4/man4.i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 15:10:01 -0000 Author: gavin Date: Sat May 4 15:10:01 2013 New Revision: 250239 URL: http://svnweb.freebsd.org/changeset/base/250239 Log: Kill yet another reference to UserConfig Modified: head/share/man/man4/man4.i386/npx.4 Modified: head/share/man/man4/man4.i386/npx.4 ============================================================================== --- head/share/man/man4/man4.i386/npx.4 Sat May 4 14:27:28 2013 (r250238) +++ head/share/man/man4/man4.i386/npx.4 Sat May 4 15:10:01 2013 (r250239) @@ -99,7 +99,7 @@ The flags can be used to control cases where it does not work or is slower. Setting them at boot time -using userconfig works correctly +using hints works correctly (the optimizations are not used until later in the bootstrap when From owner-svn-src-head@FreeBSD.ORG Sat May 4 15:42:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6933AAD8; Sat, 4 May 2013 15:42:56 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4AB28128; Sat, 4 May 2013 15:42:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44Fgucs031526; Sat, 4 May 2013 15:42:56 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44FguPv031525; Sat, 4 May 2013 15:42:56 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201305041542.r44FguPv031525@svn.freebsd.org> From: Hiroki Sato Date: Sat, 4 May 2013 15:42:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250240 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 15:42:56 -0000 Author: hrs Date: Sat May 4 15:42:55 2013 New Revision: 250240 URL: http://svnweb.freebsd.org/changeset/base/250240 Log: - Fix exit status when ip6addrctl_verbose=yes [*] - Use the absolute pathname for ip6addrctl. - Use "install" instead of "add" to reduce the number of invocations. Reported by: Tatsuki Makino [*] PR: conf/175006 [*] MFC after: 1 week Modified: head/etc/rc.d/ip6addrctl Modified: head/etc/rc.d/ip6addrctl ============================================================================== --- head/etc/rc.d/ip6addrctl Sat May 4 15:10:01 2013 (r250239) +++ head/etc/rc.d/ip6addrctl Sat May 4 15:42:55 2013 (r250240) @@ -24,38 +24,42 @@ config_file="/etc/ip6addrctl.conf" set_rcvar_obsolete ipv6_enable ipv6_activate_all_interfaces set_rcvar_obsolete ipv6_prefer ip6addrctl_policy +IP6ADDRCTL_CMD="/usr/sbin/ip6addrctl" + ip6addrctl_prefer_ipv6() { afexists inet6 || return 0 - ip6addrctl flush >/dev/null 2>&1 - ip6addrctl add ::1/128 50 0 - ip6addrctl add ::/0 40 1 - ip6addrctl add ::ffff:0:0/96 35 4 - ip6addrctl add 2002::/16 30 2 - ip6addrctl add 2001::/32 5 5 - ip6addrctl add fc00::/7 3 13 - ip6addrctl add ::/96 1 3 - ip6addrctl add fec0::/10 1 11 - ip6addrctl add 3ffe::/16 1 12 - checkyesno ip6addrctl_verbose && ip6addrctl + ${IP6ADDRCTL_CMD} flush >/dev/null 2>&1 + cat </dev/null 2>&1 - ip6addrctl add ::1/128 50 0 - ip6addrctl add ::/0 40 1 - ip6addrctl add ::ffff:0:0/96 100 4 - ip6addrctl add 2002::/16 30 2 - ip6addrctl add 2001::/32 5 5 - ip6addrctl add fc00::/7 3 13 - ip6addrctl add ::/96 1 3 - ip6addrctl add fec0::/10 1 11 - ip6addrctl add 3ffe::/16 1 12 - checkyesno ip6addrctl_verbose && ip6addrctl + ${IP6ADDRCTL_CMD} flush >/dev/null 2>&1 + cat </dev/null 2>&1 - ip6addrctl install "${config_file}" - checkyesno ip6addrctl_verbose && ip6addrctl + ${IP6ADDRCTL_CMD} flush >/dev/null 2>&1 + ${IP6ADDRCTL_CMD} install "${config_file}" else if checkyesno ipv6_activate_all_interfaces; then ip6addrctl_prefer_ipv6 @@ -92,7 +95,7 @@ ip6addrctl_start() ip6addrctl_prefer_ipv4 ;; [Nn][Oo][Nn][Ee]) - ip6addrctl flush >/dev/null 2>&1 + ${IP6ADDRCTL_CMD} flush >/dev/null 2>&1 ;; *) warn "\$ip6addrctl_policy is invalid: ${ip6addrctl_policy}. " \ @@ -100,6 +103,11 @@ ip6addrctl_start() ip6addrctl_prefer_ipv4 ;; esac + + if checkyesno ip6addrctl_verbose; then + echo 'Address selection policy table for IPv4 and IPv6:' + ${IP6ADDRCTL_CMD} + fi } ip6addrctl_stop() From owner-svn-src-head@FreeBSD.ORG Sat May 4 16:41:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 667CB4C2; Sat, 4 May 2013 16:41:17 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 48C0E327; Sat, 4 May 2013 16:41:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44GfGk7052044; Sat, 4 May 2013 16:41:16 GMT (envelope-from stefanf@svn.freebsd.org) Received: (from stefanf@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44GfEKJ052029; Sat, 4 May 2013 16:41:14 GMT (envelope-from stefanf@svn.freebsd.org) Message-Id: <201305041641.r44GfEKJ052029@svn.freebsd.org> From: Stefan Farfeleder Date: Sat, 4 May 2013 16:41:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250242 - head/tools/regression/usr.bin/xargs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 16:41:17 -0000 Author: stefanf Date: Sat May 4 16:41:14 2013 New Revision: 250242 URL: http://svnweb.freebsd.org/changeset/base/250242 Log: Add a few xargs tests related to -0, -n and quoting. Added: head/tools/regression/usr.bin/xargs/regress.0.in (contents, props changed) head/tools/regression/usr.bin/xargs/regress.0.out (contents, props changed) head/tools/regression/usr.bin/xargs/regress.0I.out (contents, props changed) head/tools/regression/usr.bin/xargs/regress.0J.out (contents, props changed) head/tools/regression/usr.bin/xargs/regress.0L.out (contents, props changed) head/tools/regression/usr.bin/xargs/regress.n1.out (contents, props changed) head/tools/regression/usr.bin/xargs/regress.n2.out (contents, props changed) head/tools/regression/usr.bin/xargs/regress.n3.out (contents, props changed) head/tools/regression/usr.bin/xargs/regress.quotes.in (contents, props changed) head/tools/regression/usr.bin/xargs/regress.quotes.out (contents, props changed) Modified: head/tools/regression/usr.bin/xargs/regress.sh Added: head/tools/regression/usr.bin/xargs/regress.0.in ============================================================================== Binary file. No diff available. Added: head/tools/regression/usr.bin/xargs/regress.0.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/xargs/regress.0.out Sat May 4 16:41:14 2013 (r250242) @@ -0,0 +1,8 @@ +quick ' brown +fox jumped +over "the lazy +dog +quick brown fox +jumped over the +lazy dog + Added: head/tools/regression/usr.bin/xargs/regress.0I.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/xargs/regress.0I.out Sat May 4 16:41:14 2013 (r250242) @@ -0,0 +1,18 @@ +The quick ' brown quick ' brownquick ' brown quick ' brown +The fox jumped +over "the lazy fox jumped +over "the lazyfox jumped +over "the lazy fox jumped +over "the lazy +The +The dog +quick brown fox dog +quick brown foxdog +quick brown fox dog +quick brown fox +The jumped over the jumped over thejumped over the jumped over the +The lazy dog + lazy dog +lazy dog + lazy dog + Added: head/tools/regression/usr.bin/xargs/regress.0J.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/xargs/regress.0J.out Sat May 4 16:41:14 2013 (r250242) @@ -0,0 +1,4 @@ +The quick ' brown fox jumped +over "the lazy dog +quick brown fox jumped over the lazy dog + again. Added: head/tools/regression/usr.bin/xargs/regress.0L.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/xargs/regress.0L.out Sat May 4 16:41:14 2013 (r250242) @@ -0,0 +1,6 @@ +quick ' brown fox jumped +over "the lazy +dog +quick brown fox +jumped over the lazy dog + Added: head/tools/regression/usr.bin/xargs/regress.n1.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/xargs/regress.n1.out Sat May 4 16:41:14 2013 (r250242) @@ -0,0 +1,8 @@ +quick +brown +fox +jumped +over +the +lazy +dog Added: head/tools/regression/usr.bin/xargs/regress.n2.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/xargs/regress.n2.out Sat May 4 16:41:14 2013 (r250242) @@ -0,0 +1,4 @@ +quick brown +fox jumped +over the +lazy dog Added: head/tools/regression/usr.bin/xargs/regress.n3.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/xargs/regress.n3.out Sat May 4 16:41:14 2013 (r250242) @@ -0,0 +1,3 @@ +quick brown fox +jumped over the +lazy dog Added: head/tools/regression/usr.bin/xargs/regress.quotes.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/xargs/regress.quotes.in Sat May 4 16:41:14 2013 (r250242) @@ -0,0 +1,4 @@ +a 'b "c' \'d +e\ f "g ' h" +i\ +j Added: head/tools/regression/usr.bin/xargs/regress.quotes.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/xargs/regress.quotes.out Sat May 4 16:41:14 2013 (r250242) @@ -0,0 +1,7 @@ +a +b "c +'d +e f +g ' h +i +j Modified: head/tools/regression/usr.bin/xargs/regress.sh ============================================================================== --- head/tools/regression/usr.bin/xargs/regress.sh Sat May 4 15:43:09 2013 (r250241) +++ head/tools/regression/usr.bin/xargs/regress.sh Sat May 4 16:41:14 2013 (r250242) @@ -1,6 +1,6 @@ # $FreeBSD$ -echo 1..5 +echo 1..13 REGRESSION_START($1) @@ -9,5 +9,13 @@ REGRESSION_TEST(`I', `xargs -I% echo The REGRESSION_TEST(`J', `xargs -J% echo The % again. < regress.in') REGRESSION_TEST(`L', `xargs -L3 echo < regress.in') REGRESSION_TEST(`R', `xargs -I% -R1 echo The % % % %% % % < regress.in') +REGRESSION_TEST(`n1', `xargs -n1 echo < regress.in') +REGRESSION_TEST(`n2', `xargs -n2 echo < regress.in') +REGRESSION_TEST(`n3', `xargs -n3 echo < regress.in') +REGRESSION_TEST(`0', `xargs -0 -n1 echo < regress.0.in') +REGRESSION_TEST(`0I', `xargs -0 -I% echo The % %% % < regress.0.in') +REGRESSION_TEST(`0J', `xargs -0 -J% echo The % again. < regress.0.in') +REGRESSION_TEST(`0L', `xargs -0 -L2 echo < regress.0.in') +REGRESSION_TEST(`quotes', `xargs -n1 echo < regress.quotes.in') REGRESSION_END() From owner-svn-src-head@FreeBSD.ORG Sat May 4 16:55:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C20699F2; Sat, 4 May 2013 16:55:48 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B52923E9; Sat, 4 May 2013 16:55:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44Gtm83056333; Sat, 4 May 2013 16:55:48 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44Gtm6W056332; Sat, 4 May 2013 16:55:48 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201305041655.r44Gtm6W056332@svn.freebsd.org> From: Davide Italiano Date: Sat, 4 May 2013 16:55:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250243 - head/sys/netsmb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 16:55:48 -0000 Author: davide Date: Sat May 4 16:55:48 2013 New Revision: 250243 URL: http://svnweb.freebsd.org/changeset/base/250243 Log: If the kernel is compiled with VMIMAGE support, the first attempt of mounting smbfs share will cause a panic. Fix setting setting/restoring vnet context when needed. PR: kern/168077 Submitted by: dteske Modified: head/sys/netsmb/smb_trantcp.c Modified: head/sys/netsmb/smb_trantcp.c ============================================================================== --- head/sys/netsmb/smb_trantcp.c Sat May 4 16:41:14 2013 (r250242) +++ head/sys/netsmb/smb_trantcp.c Sat May 4 16:55:48 2013 (r250243) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -79,13 +80,17 @@ static int nb_setsockopt_int(struct socket *so, int level, int name, int val) { struct sockopt sopt; + int error; bzero(&sopt, sizeof(sopt)); sopt.sopt_level = level; sopt.sopt_name = name; sopt.sopt_val = &val; sopt.sopt_valsize = sizeof(val); - return sosetopt(so, &sopt); + CURVNET_SET(so->so_vnet); + error = sosetopt(so, &sopt); + CURVNET_RESTORE(); + return error; } static int @@ -299,8 +304,10 @@ nbssn_recvhdr(struct nbpcb *nbp, int *le auio.uio_offset = 0; auio.uio_resid = sizeof(len); auio.uio_td = td; + CURVNET_SET(so->so_vnet); error = soreceive(so, (struct sockaddr **)NULL, &auio, (struct mbuf **)NULL, (struct mbuf **)NULL, &flags); + CURVNET_RESTORE(); if (error) return error; if (auio.uio_resid > 0) { @@ -384,8 +391,10 @@ nbssn_recv(struct nbpcb *nbp, struct mbu */ do { rcvflg = MSG_WAITALL; + CURVNET_SET(so->so_vnet); error = soreceive(so, (struct sockaddr **)NULL, &auio, &tm, (struct mbuf **)NULL, &rcvflg); + CURVNET_RESTORE(); } while (error == EWOULDBLOCK || error == EINTR || error == ERESTART); if (error) From owner-svn-src-head@FreeBSD.ORG Sat May 4 17:00:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5B688CD9; Sat, 4 May 2013 17:00:12 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-ie0-x235.google.com (mail-ie0-x235.google.com [IPv6:2607:f8b0:4001:c03::235]) by mx1.freebsd.org (Postfix) with ESMTP id 167A15F5; Sat, 4 May 2013 17:00:12 +0000 (UTC) Received: by mail-ie0-f181.google.com with SMTP id x12so2869721ief.12 for ; Sat, 04 May 2013 10:00:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=4hENH6PAExYQM/32EQK4cBeP6Z+FRRrUyRRSwGgCgJw=; b=mK6e9fKAaQ9rmHMaPYbtgNBedbLDI3QkaGnVAm4hQzhMeK7/WJgu3N7xipl1tc6XuH fst8FUEHNtTCLk6CUYgu14BnA2kGHaz+JX1KFlfAOtAeLioIk5ocJNr+nUItduMIYr/p tQD1SBR9YMo9dmNzK3PQT9sCMej8po8bTxGvDb4leIffoiYyU/gytMwTZ6so8tBUpdg3 jkTmHdWmLVJHIsuAzJhZmuRy0FvIRc3y4W3hHJGD77grA9LZRyPPwUJhoX8jd/ebxrld oykDKZVXh5OCZ8BDhx2CBFtZrdQ+sm7LX99Nj1/VF5HN6RBuoyUdNowl5XvdlO0pWZue 42Uw== MIME-Version: 1.0 X-Received: by 10.50.40.66 with SMTP id v2mr794328igk.100.1367686811725; Sat, 04 May 2013 10:00:11 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.42.117.134 with HTTP; Sat, 4 May 2013 10:00:11 -0700 (PDT) In-Reply-To: <201305041418.r44EIB0i001211@svn.freebsd.org> References: <201305041418.r44EIB0i001211@svn.freebsd.org> Date: Sat, 4 May 2013 19:00:11 +0200 X-Google-Sender-Auth: iGBgrf5xbJsLdx9tZOe6p3TmwbE Message-ID: Subject: Re: svn commit: r250237 - in head/sys: fs/smbfs netsmb From: Attilio Rao To: Davide Italiano Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 17:00:12 -0000 On Sat, May 4, 2013 at 4:18 PM, Davide Italiano wrote: > Author: davide > Date: Sat May 4 14:18:10 2013 > New Revision: 250237 > URL: http://svnweb.freebsd.org/changeset/base/250237 > > Log: > Overhaul locking in netsmb, getting rid of the obsolete lockmgr() primitive. > This solves a long standing LOR between smb_conn and smb_vc. I've only skimmed through the patch so I may be missing something important, but can you please clarify how did you replace LK_DRAIN in, for example, smb_co_rele()? Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Sat May 4 17:06:49 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 01851F00; Sat, 4 May 2013 17:06:49 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CEC6C658; Sat, 4 May 2013 17:06:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44H6m4Y060230; Sat, 4 May 2013 17:06:48 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44H6lrD060222; Sat, 4 May 2013 17:06:47 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201305041706.r44H6lrD060222@svn.freebsd.org> From: Sergey Kandaurov Date: Sat, 4 May 2013 17:06:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250244 - head/lib/libc/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 17:06:49 -0000 Author: pluknet Date: Sat May 4 17:06:47 2013 New Revision: 250244 URL: http://svnweb.freebsd.org/changeset/base/250244 Log: mdoc: missing comma in .Dd macro. Modified: head/lib/libc/locale/duplocale.3 head/lib/libc/locale/freelocale.3 head/lib/libc/locale/newlocale.3 head/lib/libc/locale/uselocale.3 head/lib/libc/locale/xlocale.3 Modified: head/lib/libc/locale/duplocale.3 ============================================================================== --- head/lib/libc/locale/duplocale.3 Sat May 4 16:55:48 2013 (r250243) +++ head/lib/libc/locale/duplocale.3 Sat May 4 17:06:47 2013 (r250244) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 17 2011 +.Dd September 17, 2011 .Dt DUPLOCALE 3 .Os .Sh NAME Modified: head/lib/libc/locale/freelocale.3 ============================================================================== --- head/lib/libc/locale/freelocale.3 Sat May 4 16:55:48 2013 (r250243) +++ head/lib/libc/locale/freelocale.3 Sat May 4 17:06:47 2013 (r250244) @@ -26,7 +26,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd September 17 2011 +.Dd September 17, 2011 .Dt FREELOCALE 3 .Os .Sh NAME Modified: head/lib/libc/locale/newlocale.3 ============================================================================== --- head/lib/libc/locale/newlocale.3 Sat May 4 16:55:48 2013 (r250243) +++ head/lib/libc/locale/newlocale.3 Sat May 4 17:06:47 2013 (r250244) @@ -26,7 +26,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd September 17 2011 +.Dd September 17, 2011 .Dt NEWLOCALE 3 .Os .Sh NAME Modified: head/lib/libc/locale/uselocale.3 ============================================================================== --- head/lib/libc/locale/uselocale.3 Sat May 4 16:55:48 2013 (r250243) +++ head/lib/libc/locale/uselocale.3 Sat May 4 17:06:47 2013 (r250244) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 17 2011 +.Dd September 17, 2011 .Dt USELOCALE 3 .Os .Sh NAME Modified: head/lib/libc/locale/xlocale.3 ============================================================================== --- head/lib/libc/locale/xlocale.3 Sat May 4 16:55:48 2013 (r250243) +++ head/lib/libc/locale/xlocale.3 Sat May 4 17:06:47 2013 (r250244) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 17 2011 +.Dd September 17, 2011 .Dt XLOCALE 3 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Sat May 4 17:21:44 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D9B4F306; Sat, 4 May 2013 17:21:44 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CC60F6DC; Sat, 4 May 2013 17:21:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44HLihs066292; Sat, 4 May 2013 17:21:44 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44HLiXb066291; Sat, 4 May 2013 17:21:44 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201305041721.r44HLiXb066291@svn.freebsd.org> From: Sergey Kandaurov Date: Sat, 4 May 2013 17:21:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250245 - head/lib/libc/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 17:21:44 -0000 Author: pluknet Date: Sat May 4 17:21:44 2013 New Revision: 250245 URL: http://svnweb.freebsd.org/changeset/base/250245 Log: Document that the return type is different from 1003.1-2008. MFC after: 1 week Modified: head/lib/libc/locale/freelocale.3 Modified: head/lib/libc/locale/freelocale.3 ============================================================================== --- head/lib/libc/locale/freelocale.3 Sat May 4 17:06:47 2013 (r250244) +++ head/lib/libc/locale/freelocale.3 Sat May 4 17:21:44 2013 (r250245) @@ -57,5 +57,12 @@ Returns 0 on success or -1 on error. .Xr uselocale 3 , .Xr xlocale 3 .Sh STANDARDS -This function conforms to -.St -p1003.1-2008 . +The +.Fn freelocale +function +differs from +.St -p1003.1-2008 +in that its return type is +.Vt int +rather than +.Vt void . From owner-svn-src-head@FreeBSD.ORG Sat May 4 18:24:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 236C8630; Sat, 4 May 2013 18:24:31 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 054279F5; Sat, 4 May 2013 18:24:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44IOUK2087897; Sat, 4 May 2013 18:24:30 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44IOUUO087896; Sat, 4 May 2013 18:24:30 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201305041824.r44IOUUO087896@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sat, 4 May 2013 18:24:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250246 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 18:24:31 -0000 Author: melifaro Date: Sat May 4 18:24:30 2013 New Revision: 250246 URL: http://svnweb.freebsd.org/changeset/base/250246 Log: Use unified method for accessing / updating cached rule pointers. MFC after: 2 weeks Modified: head/sys/netpfil/ipfw/ip_fw2.c Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Sat May 4 17:21:44 2013 (r250245) +++ head/sys/netpfil/ipfw/ip_fw2.c Sat May 4 18:24:30 2013 (r250246) @@ -780,6 +780,38 @@ set_match(struct ip_fw_args *args, int s } /* + * Helper function to enable cached rule lookups using + * x_next and next_rule fields in ipfw rule. + */ +static int +jump_fast(struct ip_fw_chain *chain, struct ip_fw *f, int num, + int tablearg, int jump_backwards) +{ + int f_pos; + + /* If possible use cached f_pos (in f->next_rule), + * whose version is written in f->next_rule + * (horrible hacks to avoid changing the ABI). + */ + if (num != IP_FW_TABLEARG && (uintptr_t)f->x_next == chain->id) + f_pos = (uintptr_t)f->next_rule; + else { + int i = IP_FW_ARG_TABLEARG(num); + /* make sure we do not jump backward */ + if (jump_backwards == 0 && i <= f->rulenum) + i = f->rulenum + 1; + f_pos = ipfw_find_rule(chain, i, 0); + /* update the cache */ + if (num != IP_FW_TABLEARG) { + f->next_rule = (void *)(uintptr_t)f_pos; + f->x_next = (void *)(uintptr_t)chain->id; + } + } + + return (f_pos); +} + +/* * The main check routine for the firewall. * * All arguments are in args so we can modify them and return them @@ -2123,27 +2155,7 @@ do { \ case O_SKIPTO: IPFW_INC_RULE_COUNTER(f, pktlen); - /* If possible use cached f_pos (in f->next_rule), - * whose version is written in f->next_rule - * (horrible hacks to avoid changing the ABI). - */ - if (cmd->arg1 != IP_FW_TABLEARG && - (uintptr_t)f->x_next == chain->id) { - f_pos = (uintptr_t)f->next_rule; - } else { - int i = IP_FW_ARG_TABLEARG(cmd->arg1); - /* make sure we do not jump backward */ - if (i <= f->rulenum) - i = f->rulenum + 1; - f_pos = ipfw_find_rule(chain, i, 0); - /* update the cache */ - if (cmd->arg1 != IP_FW_TABLEARG) { - f->next_rule = - (void *)(uintptr_t)f_pos; - f->x_next = - (void *)(uintptr_t)chain->id; - } - } + f_pos = jump_fast(chain, f, cmd->arg1, tablearg, 0); /* * Skip disabled rules, and re-enter * the inner loop with the correct @@ -2232,25 +2244,8 @@ do { \ if (IS_CALL) { stack[mtag->m_tag_id] = f->rulenum; mtag->m_tag_id++; - if (cmd->arg1 != IP_FW_TABLEARG && - (uintptr_t)f->x_next == chain->id) { - f_pos = (uintptr_t)f->next_rule; - } else { - jmpto = IP_FW_ARG_TABLEARG( - cmd->arg1); - f_pos = ipfw_find_rule(chain, - jmpto, 0); - /* update the cache */ - if (cmd->arg1 != - IP_FW_TABLEARG) { - f->next_rule = - (void *)(uintptr_t) - f_pos; - f->x_next = - (void *)(uintptr_t) - chain->id; - } - } + f_pos = jump_fast(chain, f, cmd->arg1, + tablearg, 1); } else { /* `return' action */ mtag->m_tag_id--; jmpto = stack[mtag->m_tag_id] + 1; From owner-svn-src-head@FreeBSD.ORG Sat May 4 18:38:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0B5E4A1A; Sat, 4 May 2013 18:38:17 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F1B0BA48; Sat, 4 May 2013 18:38:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44IcGRw092010; Sat, 4 May 2013 18:38:16 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44IcG0b092009; Sat, 4 May 2013 18:38:16 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201305041838.r44IcG0b092009@svn.freebsd.org> From: Matthew D Fleming Date: Sat, 4 May 2013 18:38:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250247 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 18:38:17 -0000 Author: mdf Date: Sat May 4 18:38:16 2013 New Revision: 250247 URL: http://svnweb.freebsd.org/changeset/base/250247 Log: Add missing vdrop() in error case. Submitted by: Fahad (mohd.fahadullah@isilon.com) MFC after: 1 week Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sat May 4 18:24:30 2013 (r250246) +++ head/sys/kern/vfs_subr.c Sat May 4 18:38:16 2013 (r250247) @@ -731,6 +731,7 @@ vlrureclaim(struct mount *mp) (vp->v_object != NULL && vp->v_object->resident_page_count > trigger)) { VOP_UNLOCK(vp, LK_INTERLOCK); + vdrop(vp); goto next_iter_mntunlocked; } KASSERT((vp->v_iflag & VI_DOOMED) == 0, From owner-svn-src-head@FreeBSD.ORG Sat May 4 18:54:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D98AF1B2; Sat, 4 May 2013 18:54:31 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-ee0-f43.google.com (mail-ee0-f43.google.com [74.125.83.43]) by mx1.freebsd.org (Postfix) with ESMTP id ED5F5AAA; Sat, 4 May 2013 18:54:30 +0000 (UTC) Received: by mail-ee0-f43.google.com with SMTP id b15so1222069eek.2 for ; Sat, 04 May 2013 11:54:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=eblBClD65oIY+6oG6qcWfJbs3zzvdjGTqP0pX8SMMkE=; b=h7dvl/xO3h2twape04jnfPcI9pMhWCBlB8g9lwkuPCOdJjA1rbuLmbU1YsFkXI6OYD KE3FrIhRjRwaC4OatXoxZEZNbcFFu+sbUbxISCvircwuVZR/hTH7p0/bbImwXy+1gAl2 ttr37Ia5PSPpEgB/SXYhjk8ZbmWjLYicdwijtj+eIS9m1BMbJBPunWSIqaFgGILyHwyh 5CttxDGD7gTmqQneV9neEy3TCAAGwb9eYQxj+XzfkacnEKlKd6nqgFFoQ/Kp3ZHnVb7k IGkwpqHoMq/pLR8rODJXifQISKQRNc92Ck6Su6B8gYA3OfKMnMOv64odbFdiHikfuyQ5 iylA== X-Received: by 10.14.127.5 with SMTP id c5mr26733377eei.45.1367693663755; Sat, 04 May 2013 11:54:23 -0700 (PDT) Received: from localhost ([178.150.115.244]) by mx.google.com with ESMTPSA id bn53sm23205068eeb.7.2013.05.04.11.54.21 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 04 May 2013 11:54:22 -0700 (PDT) Sender: Mikolaj Golub Date: Sat, 4 May 2013 21:54:20 +0300 From: Mikolaj Golub To: John Baldwin Subject: Re: svn commit: r250223 - in head: lib/libprocstat sys/kern sys/sys usr.bin/fstat Message-ID: <20130504185419.GA32075@gmail.com> References: <201305032111.r43LBvZ3040508@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201305032111.r43LBvZ3040508@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 18:54:31 -0000 On Fri, May 03, 2013 at 09:11:57PM +0000, John Baldwin wrote: > +static int > +procstat_get_sem_info_kvm(kvm_t *kd, struct filestat *fst, > + struct semstat *sem, char *errbuf) > +{ > + struct ksem ksem; > + void *ksemp; > + char *path; > + int i; > + > + assert(kd); > + assert(sem); > + assert(fst); > + bzero(sem, sizeof(*sem)); > + ksemp = fst->fs_typedep; > + if (ksemp == NULL) > + goto fail; > + if (!kvm_read_all(kd, (unsigned long)ksemp, &ksem, > + sizeof(struct ksem))) { > + warnx("can't read ksem at %p", (void *)ksemp); > + goto fail; > + } > + sem->mode = S_IFREG | ksem.ks_mode; > + sem->value = ksem.ks_value; > + if (fst->fs_path == NULL && ksem.ks_path != NULL) { > + path = malloc(MAXPATHLEN); > + for (i = 0; i < MAXPATHLEN - 1; i++) { > + if (!kvm_read_all(kd, (unsigned long)ksem.ks_path + i, > + path + i, 1)) > + break; > + if (path[i] == '\0') > + break; > + } > + path[i] = '\0'; > + if (i == 0) > + free(path); > + else > + fst->fs_path = path; > + } > + return (0); > + > +fail: > + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); > + return (1); > +} I would like to make errbuf optional (for all libprocstat functions that provide it) adding a check before printing to errbuf: if (errbuf != NULL) snprintf(errbuf, ... It looks like there are callers who are not interested in errbuf content. E.g. currently procstat(1) passes NULL when calling functions that require errbuf, namely procstat_get_socket_info and procstat_get_vnode_info, potentially crashing here if an error occurs. Do you (anyone) have objections? -- Mikolaj Golub From owner-svn-src-head@FreeBSD.ORG Sat May 4 19:07:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3683557B; Sat, 4 May 2013 19:07:24 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0D3CBAF3; Sat, 4 May 2013 19:07:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44J7NLx002533; Sat, 4 May 2013 19:07:23 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44J7N0T002529; Sat, 4 May 2013 19:07:23 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201305041907.r44J7N0T002529@svn.freebsd.org> From: Sergey Kandaurov Date: Sat, 4 May 2013 19:07:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250250 - in head: lib/libc/gen lib/libc/nls lib/libc/sys sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 19:07:24 -0000 Author: pluknet Date: Sat May 4 19:07:22 2013 New Revision: 250250 URL: http://svnweb.freebsd.org/changeset/base/250250 Log: POSIX 1003.1-2008: add ENOTRECOVERABLE, EOWNERDEAD errnos. Modified: head/lib/libc/gen/errlst.c head/lib/libc/nls/C.msg head/lib/libc/sys/intro.2 head/sys/sys/errno.h Modified: head/lib/libc/gen/errlst.c ============================================================================== --- head/lib/libc/gen/errlst.c Sat May 4 18:49:04 2013 (r250249) +++ head/lib/libc/gen/errlst.c Sat May 4 19:07:22 2013 (r250250) @@ -152,5 +152,7 @@ const char *const sys_errlist[] = { "Protocol error", /* 92 - EPROTO */ "Capabilities insufficient", /* 93 - ENOTCAPABLE */ "Not permitted in capability mode", /* 94 - ECAPMODE */ + "State not recoverable", /* 95 - ENOTRECOVERABLE */ + "Previous owner died", /* 96 - EOWNERDEAD */ }; const int sys_nerr = sizeof(sys_errlist) / sizeof(sys_errlist[0]); Modified: head/lib/libc/nls/C.msg ============================================================================== --- head/lib/libc/nls/C.msg Sat May 4 18:49:04 2013 (r250249) +++ head/lib/libc/nls/C.msg Sat May 4 19:07:22 2013 (r250250) @@ -193,6 +193,10 @@ $ ENOTCAPABLE 93 Capabilities insufficient $ ECAPMODE 94 Not permitted in capability mode +$ ENOTRECOVERABLE +95 State not recoverable +$ EOWNERDEAD +96 Previous owner died $ $ strsignal() support catalog $ Modified: head/lib/libc/sys/intro.2 ============================================================================== --- head/lib/libc/sys/intro.2 Sat May 4 18:49:04 2013 (r250249) +++ head/lib/libc/sys/intro.2 Sat May 4 19:07:22 2013 (r250250) @@ -28,7 +28,7 @@ .\" @(#)intro.2 8.5 (Berkeley) 2/27/95 .\" $FreeBSD$ .\" -.Dd April 27, 2013 +.Dd May 4, 2013 .Dt INTRO 2 .Os .Sh NAME @@ -470,6 +470,10 @@ An operation on a capability file descri the capability allows. .It Er 94 ECAPMODE Em "Not permitted in capability mode" . The system call or operation is not permitted for capability mode processes. +.It Er 95 ENOTRECOVERABLE Em "State not recoverable" . +The state protected by a robust mutex is not recoverable. +.It Er 96 EOWNERDEAD Em "Previous owner died" . +The owner of a robust mutex terminated while holding the mutex lock. .El .Sh DEFINITIONS .Bl -tag -width Ds Modified: head/sys/sys/errno.h ============================================================================== --- head/sys/sys/errno.h Sat May 4 18:49:04 2013 (r250249) +++ head/sys/sys/errno.h Sat May 4 19:07:22 2013 (r250250) @@ -176,10 +176,12 @@ __END_DECLS #ifndef _POSIX_SOURCE #define ENOTCAPABLE 93 /* Capabilities insufficient */ #define ECAPMODE 94 /* Not permitted in capability mode */ +#define ENOTRECOVERABLE 95 /* State not recoverable */ +#define EOWNERDEAD 96 /* Previous owner died */ #endif /* _POSIX_SOURCE */ #ifndef _POSIX_SOURCE -#define ELAST 94 /* Must be equal largest errno */ +#define ELAST 96 /* Must be equal largest errno */ #endif /* _POSIX_SOURCE */ #ifdef _KERNEL From owner-svn-src-head@FreeBSD.ORG Sat May 4 19:16:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 94C188A9; Sat, 4 May 2013 19:16:28 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 77931B40; Sat, 4 May 2013 19:16:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44JGSLU006056; Sat, 4 May 2013 19:16:28 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44JGROb006042; Sat, 4 May 2013 19:16:27 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201305041916.r44JGROb006042@svn.freebsd.org> From: Hiroki Sato Date: Sat, 4 May 2013 19:16:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250251 - in head: sbin/ping6 sys/netinet sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 19:16:28 -0000 Author: hrs Date: Sat May 4 19:16:26 2013 New Revision: 250251 URL: http://svnweb.freebsd.org/changeset/base/250251 Log: Use FF02:0:0:0:0:2:FF00::/104 prefix for IPv6 Node Information Group Address. Although KAME implementation used FF02:0:0:0:0:2::/96 based on older versions of draft-ietf-ipngwg-icmp-name-lookup, it has been changed in RFC 4620. The kernel always joins the /104-prefixed address, and additionally does /96-prefixed one only when net.inet6.icmp6.nodeinfo_oldmcprefix=1. The default value of the sysctl is 1. ping6(8) -N flag now uses /104-prefixed one. When this flag is specified twice, it uses /96-prefixed one instead. Reviewed by: ume Based on work by: Thomas Scheffler PR: conf/174957 MFC after: 2 weeks Modified: head/sbin/ping6/ping6.8 head/sbin/ping6/ping6.c head/sys/netinet/icmp6.h head/sys/netinet6/in6.c head/sys/netinet6/in6_ifattach.c head/sys/netinet6/in6_ifattach.h head/sys/netinet6/in6_proto.c Modified: head/sbin/ping6/ping6.8 ============================================================================== --- head/sbin/ping6/ping6.8 Sat May 4 19:07:22 2013 (r250250) +++ head/sbin/ping6/ping6.8 Sat May 4 19:16:26 2013 (r250251) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 20, 2010 +.Dd May 5, 2013 .Dt PING6 8 .Os .Sh NAME @@ -215,8 +215,8 @@ unicast and multicast packets. Numeric output only. No attempt will be made to lookup symbolic names from addresses in the reply. .It Fl N -Probe node information multicast group -.Pq Li ff02::2:xxxx:xxxx . +Probe node information multicast group address +.Pq Li ff02::2:ffxx:xxxx . .Ar host must be string hostname of the target (must not be a numeric IPv6 address). @@ -227,6 +227,15 @@ Since node information multicast group i outgoing interface needs to be specified by .Fl I option. +.Pp +When specified twice, the address +.Pq Li ff02::2:xxxx:xxxx +is used instead. +The former is in RFC 4620, the latter is in an old Internet Draft +draft-ietf-ipngwg-icmp-name-lookup. +Note that KAME-derived implementations including +.Fx +use the latter. .It Fl o Exit successfully after receiving one reply packet. .It Fl p Ar pattern Modified: head/sbin/ping6/ping6.c ============================================================================== --- head/sbin/ping6/ping6.c Sat May 4 19:07:22 2013 (r250250) +++ head/sbin/ping6/ping6.c Sat May 4 19:16:26 2013 (r250251) @@ -287,7 +287,7 @@ void pr_retip(struct ip6_hdr *, u_char void summary(void); void tvsub(struct timeval *, struct timeval *); int setpolicy(int, char *); -char *nigroup(char *); +char *nigroup(char *, int); void usage(void); int @@ -306,6 +306,7 @@ main(int argc, char *argv[]) struct addrinfo hints; int cc, i; int ch, hold, packlen, preload, optval, ret_ga; + int nig_oldmcprefix = -1; u_char *datap; char *e, *target, *ifname = NULL, *gateway = NULL; int ip6optlen = 0; @@ -490,6 +491,7 @@ main(int argc, char *argv[]) break; case 'N': options |= F_NIGROUP; + nig_oldmcprefix++; break; case 'o': options |= F_ONCE; @@ -605,7 +607,7 @@ main(int argc, char *argv[]) } if (options & F_NIGROUP) { - target = nigroup(argv[argc - 1]); + target = nigroup(argv[argc - 1], nig_oldmcprefix); if (target == NULL) { usage(); /*NOTREACHED*/ @@ -2723,7 +2725,7 @@ setpolicy(int so __unused, char *policy) #endif char * -nigroup(char *name) +nigroup(char *name, int nig_oldmcprefix) { char *p; char *q; @@ -2733,6 +2735,7 @@ nigroup(char *name) size_t l; char hbuf[NI_MAXHOST]; struct in6_addr in6; + int valid; p = strchr(name, '.'); if (!p) @@ -2748,7 +2751,7 @@ nigroup(char *name) *q = tolower(*(unsigned char *)q); } - /* generate 8 bytes of pseudo-random value. */ + /* generate 16 bytes of pseudo-random value. */ memset(&ctxt, 0, sizeof(ctxt)); MD5Init(&ctxt); c = l & 0xff; @@ -2756,9 +2759,23 @@ nigroup(char *name) MD5Update(&ctxt, (unsigned char *)name, l); MD5Final(digest, &ctxt); - if (inet_pton(AF_INET6, "ff02::2:0000:0000", &in6) != 1) + if (nig_oldmcprefix) { + /* draft-ietf-ipngwg-icmp-name-lookup */ + valid = inet_pton(AF_INET6, "ff02::2:0000:0000", &in6); + } else { + /* RFC 4620 */ + valid = inet_pton(AF_INET6, "ff02::2:ff00:0000", &in6); + } + if (valid != 1) return NULL; /*XXX*/ - bcopy(digest, &in6.s6_addr[12], 4); + + if (nig_oldmcprefix) { + /* draft-ietf-ipngwg-icmp-name-lookup */ + bcopy(digest, &in6.s6_addr[12], 4); + } else { + /* RFC 4620 */ + bcopy(digest, &in6.s6_addr[13], 3); + } if (inet_ntop(AF_INET6, &in6, hbuf, sizeof(hbuf)) == NULL) return NULL; Modified: head/sys/netinet/icmp6.h ============================================================================== --- head/sys/netinet/icmp6.h Sat May 4 19:07:22 2013 (r250250) +++ head/sys/netinet/icmp6.h Sat May 4 19:16:26 2013 (r250251) @@ -659,7 +659,8 @@ void kmod_icmp6stat_inc(int statnum); #define ICMPV6CTL_MLD_SOMAXSRC 22 #define ICMPV6CTL_MLD_VERSION 23 #define ICMPV6CTL_ND6_MAXQLEN 24 -#define ICMPV6CTL_MAXID 25 +#define ICMPV6CTL_NODEINFO_OLDMCPREFIX 25 +#define ICMPV6CTL_MAXID 26 #define RTF_PROBEMTU RTF_PROTO1 Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Sat May 4 19:07:22 2013 (r250250) +++ head/sys/netinet6/in6.c Sat May 4 19:16:26 2013 (r250251) @@ -106,6 +106,9 @@ __FBSDID("$FreeBSD$"); #include #include +VNET_DECLARE(int, icmp6_nodeinfo_oldmcprefix); +#define V_icmp6_nodeinfo_oldmcprefix VNET(icmp6_nodeinfo_oldmcprefix) + /* * Definitions of some costant IP6 addresses. */ @@ -947,6 +950,17 @@ in6_update_ifa_join_mc(struct ifnet *ifp else LIST_INSERT_HEAD(&ia->ia6_memberships, imm, i6mm_chain); } + if (V_icmp6_nodeinfo_oldmcprefix && + in6_nigroup_oldmcprefix(ifp, NULL, -1, &mltaddr.sin6_addr) == 0) { + imm = in6_joingroup(ifp, &mltaddr.sin6_addr, &error, delay); + if (imm == NULL) + nd6log((LOG_WARNING, "%s: addmulti failed for %s on %s " + "(errno=%d)\n", __func__, ip6_sprintf(ip6buf, + &mltaddr.sin6_addr), if_name(ifp), error)); + /* XXX not very fatal, go on... */ + else + LIST_INSERT_HEAD(&ia->ia6_memberships, imm, i6mm_chain); + } /* * Join interface-local all-nodes address. Modified: head/sys/netinet6/in6_ifattach.c ============================================================================== --- head/sys/netinet6/in6_ifattach.c Sat May 4 19:07:22 2013 (r250250) +++ head/sys/netinet6/in6_ifattach.c Sat May 4 19:16:26 2013 (r250251) @@ -616,13 +616,16 @@ in6_ifattach_loopback(struct ifnet *ifp) /* * compute NI group address, based on the current hostname setting. - * see draft-ietf-ipngwg-icmp-name-lookup-* (04 and later). + * see RFC 4620. * * when ifp == NULL, the caller is responsible for filling scopeid. + * + * If oldmcprefix == 1, FF02:0:0:0:0:2::/96 is used for NI group address + * while it is FF02:0:0:0:0:2:FF00::/104 in RFC 4620. */ -int -in6_nigroup(struct ifnet *ifp, const char *name, int namelen, - struct in6_addr *in6) +static int +in6_nigroup0(struct ifnet *ifp, const char *name, int namelen, + struct in6_addr *in6, int oldmcprefix) { struct prison *pr; const char *p; @@ -667,7 +670,7 @@ in6_nigroup(struct ifnet *ifp, const cha *q = *q - 'A' + 'a'; } - /* generate 8 bytes of pseudo-random value. */ + /* generate 16 bytes of pseudo-random value. */ bzero(&ctxt, sizeof(ctxt)); MD5Init(&ctxt); MD5Update(&ctxt, &l, sizeof(l)); @@ -677,13 +680,36 @@ in6_nigroup(struct ifnet *ifp, const cha bzero(in6, sizeof(*in6)); in6->s6_addr16[0] = IPV6_ADDR_INT16_MLL; in6->s6_addr8[11] = 2; - bcopy(digest, &in6->s6_addr32[3], sizeof(in6->s6_addr32[3])); + if (oldmcprefix == 0) { + in6->s6_addr8[12] = 0xff; + /* Copy the first 24 bits of 128-bit hash into the address. */ + bcopy(digest, &in6->s6_addr8[13], 3); + } else { + /* Copy the first 32 bits of 128-bit hash into the address. */ + bcopy(digest, &in6->s6_addr32[3], sizeof(in6->s6_addr32[3])); + } if (in6_setscope(in6, ifp, NULL)) return (-1); /* XXX: should not fail */ return 0; } +int +in6_nigroup(struct ifnet *ifp, const char *name, int namelen, + struct in6_addr *in6) +{ + + return (in6_nigroup0(ifp, name, namelen, in6, 0)); +} + +int +in6_nigroup_oldmcprefix(struct ifnet *ifp, const char *name, int namelen, + struct in6_addr *in6) +{ + + return (in6_nigroup0(ifp, name, namelen, in6, 1)); +} + /* * XXX multiple loopback interface needs more care. for instance, * nodelocal address needs to be configured onto only one of them. Modified: head/sys/netinet6/in6_ifattach.h ============================================================================== --- head/sys/netinet6/in6_ifattach.h Sat May 4 19:07:22 2013 (r250250) +++ head/sys/netinet6/in6_ifattach.h Sat May 4 19:16:26 2013 (r250251) @@ -40,6 +40,7 @@ int in6_get_tmpifid(struct ifnet *, u_in void in6_tmpaddrtimer(void *); int in6_get_hw_ifid(struct ifnet *, struct in6_addr *); int in6_nigroup(struct ifnet *, const char *, int, struct in6_addr *); +int in6_nigroup_oldmcprefix(struct ifnet *, const char *, int, struct in6_addr *); #endif /* _KERNEL */ #endif /* _NETINET6_IN6_IFATTACH_H_ */ Modified: head/sys/netinet6/in6_proto.c ============================================================================== --- head/sys/netinet6/in6_proto.c Sat May 4 19:07:22 2013 (r250250) +++ head/sys/netinet6/in6_proto.c Sat May 4 19:16:26 2013 (r250251) @@ -438,6 +438,7 @@ VNET_DEFINE(int, icmp6errppslim) = 100; /* control how to respond to NI queries */ VNET_DEFINE(int, icmp6_nodeinfo) = (ICMP6_NODEINFO_FQDNOK|ICMP6_NODEINFO_NODEADDROK); +VNET_DEFINE(int, icmp6_nodeinfo_oldmcprefix) = 1; /* * sysctl related items. @@ -602,6 +603,11 @@ SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6 CTLFLAG_RW, &VNET_NAME(nd6_useloopback), 0, ""); SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_NODEINFO, nodeinfo, CTLFLAG_RW, &VNET_NAME(icmp6_nodeinfo), 0, ""); +SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_NODEINFO_OLDMCPREFIX, + nodeinfo_oldmcprefix, CTLFLAG_RW, + &VNET_NAME(icmp6_nodeinfo_oldmcprefix), 0, + "Join old IPv6 NI group address in draft-ietf-ipngwg-icmp-name-lookup" + " for compatibility with KAME implememtation."); SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_ERRPPSLIMIT, errppslimit, CTLFLAG_RW, &VNET_NAME(icmp6errppslim), 0, ""); SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_MAXNUDHINT, nd6_maxnudhint, From owner-svn-src-head@FreeBSD.ORG Sat May 4 19:50:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 81ED694; Sat, 4 May 2013 19:50:51 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 72E62D48; Sat, 4 May 2013 19:50:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44Jop35018758; Sat, 4 May 2013 19:50:51 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44JopMp018757; Sat, 4 May 2013 19:50:51 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201305041950.r44JopMp018757@svn.freebsd.org> From: Ian Lepore Date: Sat, 4 May 2013 19:50:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250252 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 19:50:51 -0000 Author: ian Date: Sat May 4 19:50:50 2013 New Revision: 250252 URL: http://svnweb.freebsd.org/changeset/base/250252 Log: EABI unwinder enhancements... When it's time to stop unwinding, don't exit the loop until after printing info about the current frame. Also, if executing the unwind function for a frame doesn't change the values of any registers, log that and exit the loop rather than looping endlessly. Modified: head/sys/arm/arm/db_trace.c Modified: head/sys/arm/arm/db_trace.c ============================================================================== --- head/sys/arm/arm/db_trace.c Sat May 4 19:16:26 2013 (r250251) +++ head/sys/arm/arm/db_trace.c Sat May 4 19:50:50 2013 (r250252) @@ -342,8 +342,11 @@ db_stack_trace_cmd(struct unwind_state * c_db_sym_t sym; u_int reg, i; char *sep; + uint16_t upd_mask; + bool finished; - while (1) { + finished = false; + while (!finished) { /* Reset the mask of updated registers */ state->update_mask = 0; @@ -353,28 +356,20 @@ db_stack_trace_cmd(struct unwind_state * /* Find the item to run */ index = db_find_index(state->start_pc); - if (index->insn == EXIDX_CANTUNWIND) { - db_printf("Unable to unwind\n"); - break; - } else if (index->insn & (1 << 31)) { - /* The data is within the instruction */ - state->insn = &index->insn; - } else { - /* We have a prel31 offset to the unwind table */ - uint32_t prel31_tbl = db_expand_prel31(index->insn); - - state->insn = (uint32_t *)((uintptr_t)&index->insn + - prel31_tbl); + if (index->insn != EXIDX_CANTUNWIND) { + if (index->insn & (1 << 31)) { + /* The data is within the instruction */ + state->insn = &index->insn; + } else { + /* A prel31 offset to the unwind table */ + state->insn = (uint32_t *) + ((uintptr_t)&index->insn + + db_expand_prel31(index->insn)); + } + /* Run the unwind function */ + finished = db_unwind_tab(state); } - /* Run the unwind function */ - if (db_unwind_tab(state) != 0) - break; - - /* This is not a kernel address, stop processing */ - if (state->registers[PC] < VM_MIN_KERNEL_ADDRESS) - break; - /* Print the frame details */ sym = db_search_symbol(state->start_pc, DB_STGY_ANY, &offset); if (sym == C_DB_SYM_NULL) { @@ -393,12 +388,11 @@ db_stack_trace_cmd(struct unwind_state * state->registers[SP], state->registers[FP]); /* Don't print the registers we have already printed */ - state->update_mask &= ~((1 << SP) | (1 << FP) | (1 << LR) | - (1 << PC)); + upd_mask = state->update_mask & + ~((1 << SP) | (1 << FP) | (1 << LR) | (1 << PC)); sep = "\n\t"; - for (i = 0, reg = 0; state->update_mask != 0; - state->update_mask >>= 1, reg++) { - if ((state->update_mask & 1) != 0) { + for (i = 0, reg = 0; upd_mask != 0; upd_mask >>= 1, reg++) { + if ((upd_mask & 1) != 0) { db_printf("%s%sr%d = 0x%08x", sep, (reg < 10) ? " " : "", reg, state->registers[reg]); @@ -412,6 +406,25 @@ db_stack_trace_cmd(struct unwind_state * } } db_printf("\n"); + + /* Stop if directed to do so, or if we've unwound back to the + * kernel entry point, or if the unwind function didn't change + * anything (to avoid getting stuck in this loop forever). + * If the latter happens, it's an indication that the unwind + * information is incorrect somehow for the function named in + * the last frame printed before you see the unwind failure + * message (maybe it needs a STOP_UNWINDING). + */ + if (index->insn == EXIDX_CANTUNWIND) { + db_printf("Unable to unwind further\n"); + finished = true; + } else if (state->registers[PC] < VM_MIN_KERNEL_ADDRESS) { + db_printf("Unable to unwind into user mode\n"); + finished = true; + } else if (state->update_mask == 0) { + db_printf("Unwind failure (no registers changed)\n"); + finished = true; + } } } #endif From owner-svn-src-head@FreeBSD.ORG Sat May 4 19:59:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9B66A402; Sat, 4 May 2013 19:59:36 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 73CB3D72; Sat, 4 May 2013 19:59:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44JxaFl020438; Sat, 4 May 2013 19:59:36 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44JxZDg020435; Sat, 4 May 2013 19:59:35 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201305041959.r44JxZDg020435@svn.freebsd.org> From: Ian Lepore Date: Sat, 4 May 2013 19:59:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250253 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 19:59:36 -0000 Author: ian Date: Sat May 4 19:59:35 2013 New Revision: 250253 URL: http://svnweb.freebsd.org/changeset/base/250253 Log: Insert STOP_UNWINDING directives in the _start (kernel entry point) and fork_trampoline (thread entry point) assembler routines, because it's not possible to unwind beyond those points. Also insert STOP_UNWINDING in the exception_exit routine, to prevent an unwind-loop at that point. This is just a stopgap until we get around to instrumenting all assembler functions with proper unwind metadata. Modified: head/sys/arm/arm/exception.S head/sys/arm/arm/locore.S head/sys/arm/arm/swtch.S Modified: head/sys/arm/arm/exception.S ============================================================================== --- head/sys/arm/arm/exception.S Sat May 4 19:50:50 2013 (r250252) +++ head/sys/arm/arm/exception.S Sat May 4 19:59:35 2013 (r250253) @@ -196,15 +196,20 @@ END(address_exception_entry) * Interrupts are disabled at suitable points to avoid ASTs * being posted between testing and exit to user mode. * - * This function uses PULLFRAMEFROMSVCANDEXIT and - * DO_AST - * only be called if the exception handler used PUSHFRAMEINSVC + * This function uses PULLFRAMEFROMSVCANDEXIT and DO_AST and can + * only be called if the exception handler used PUSHFRAMEINSVC. * + * For EABI, don't try to unwind any further than this. This is a + * stopgap measure to avoid getting stuck in a loop in the unwinder, + * which happens because we don't yet provide the proper unwind info + * here that describes which registers are being restored. */ -exception_exit: +ASENTRY_NP(exception_exit) + STOP_UNWINDING DO_AST PULLFRAMEFROMSVCANDEXIT +END(exception_exit) /* * undefined_entry: Modified: head/sys/arm/arm/locore.S ============================================================================== --- head/sys/arm/arm/locore.S Sat May 4 19:50:50 2013 (r250252) +++ head/sys/arm/arm/locore.S Sat May 4 19:59:35 2013 (r250253) @@ -77,6 +77,8 @@ __FBSDID("$FreeBSD$"); */ ENTRY_NP(btext) ASENTRY_NP(_start) + STOP_UNWINDING /* Can't unwind into the bootloader! */ + mov r9, r0 /* 0 or boot mode from boot2 */ mov r8, r1 /* Save Machine type */ mov ip, r2 /* Save meta data */ Modified: head/sys/arm/arm/swtch.S ============================================================================== --- head/sys/arm/arm/swtch.S Sat May 4 19:50:50 2013 (r250252) +++ head/sys/arm/arm/swtch.S Sat May 4 19:59:35 2013 (r250253) @@ -540,6 +540,7 @@ ENTRY(savectx) END(savectx) ENTRY(fork_trampoline) + STOP_UNWINDING /* Can't unwind beyond the thread enty point */ mov r1, r5 mov r2, sp mov r0, r4 From owner-svn-src-head@FreeBSD.ORG Sat May 4 20:02:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D292874A; Sat, 4 May 2013 20:02:34 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C3F11D8F; Sat, 4 May 2013 20:02:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44K2YJt022997; Sat, 4 May 2013 20:02:34 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44K2YWi022996; Sat, 4 May 2013 20:02:34 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201305042002.r44K2YWi022996@svn.freebsd.org> From: Ian Lepore Date: Sat, 4 May 2013 20:02:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250254 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 20:02:34 -0000 Author: ian Date: Sat May 4 20:02:34 2013 New Revision: 250254 URL: http://svnweb.freebsd.org/changeset/base/250254 Log: Fix comment block formatting. Modified: head/sys/arm/arm/db_trace.c Modified: head/sys/arm/arm/db_trace.c ============================================================================== --- head/sys/arm/arm/db_trace.c Sat May 4 19:59:35 2013 (r250253) +++ head/sys/arm/arm/db_trace.c Sat May 4 20:02:34 2013 (r250254) @@ -407,7 +407,8 @@ db_stack_trace_cmd(struct unwind_state * } db_printf("\n"); - /* Stop if directed to do so, or if we've unwound back to the + /* + * Stop if directed to do so, or if we've unwound back to the * kernel entry point, or if the unwind function didn't change * anything (to avoid getting stuck in this loop forever). * If the latter happens, it's an indication that the unwind From owner-svn-src-head@FreeBSD.ORG Sat May 4 21:26:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 145A72EF; Sat, 4 May 2013 21:26:12 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 06B0899; Sat, 4 May 2013 21:26:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44LQBPE052399; Sat, 4 May 2013 21:26:11 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44LQBoX052398; Sat, 4 May 2013 21:26:11 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201305042126.r44LQBoX052398@svn.freebsd.org> From: Tim Kientzle Date: Sat, 4 May 2013 21:26:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250255 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 21:26:12 -0000 Author: kientzle Date: Sat May 4 21:26:11 2013 New Revision: 250255 URL: http://svnweb.freebsd.org/changeset/base/250255 Log: Make a debugging printf a little more useful. Modified: head/sys/arm/arm/trap.c Modified: head/sys/arm/arm/trap.c ============================================================================== --- head/sys/arm/arm/trap.c Sat May 4 20:02:34 2013 (r250254) +++ head/sys/arm/arm/trap.c Sat May 4 21:26:11 2013 (r250255) @@ -240,8 +240,8 @@ data_abort_handler(trapframe_t *tf) far = cpu_faultaddress(); fsr = cpu_faultstatus(); #if 0 - printf("data abort: %p (from %p %p)\n", (void*)far, (void*)tf->tf_pc, - (void*)tf->tf_svc_lr); + printf("data abort: fault address=%p (from pc=%p lr=%p)\n", + (void*)far, (void*)tf->tf_pc, (void*)tf->tf_svc_lr); #endif /* Update vmmeter statistics */ From owner-svn-src-head@FreeBSD.ORG Sat May 4 22:50:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E76139B8; Sat, 4 May 2013 22:50:15 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C56453F6; Sat, 4 May 2013 22:50:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44MoFKv083373; Sat, 4 May 2013 22:50:15 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44MoFE3083372; Sat, 4 May 2013 22:50:15 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201305042250.r44MoFE3083372@svn.freebsd.org> From: Alan Cox Date: Sat, 4 May 2013 22:50:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250259 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 22:50:16 -0000 Author: alc Date: Sat May 4 22:50:15 2013 New Revision: 250259 URL: http://svnweb.freebsd.org/changeset/base/250259 Log: Optimize vm_radix_lookup_ge() and vm_radix_lookup_le(). Specifically, change the way that these functions ascend the tree when the search for a matching leaf fails at an interior node. Rather than returning to the root of the tree and repeating the lookup with an updated key, maintain a stack of interior nodes that were visited during the descent and use that stack to resume the lookup at the closest ancestor that might have a matching descendant. Sponsored by: EMC / Isilon Storage Division Reviewed by: attilio Tested by: pho Modified: head/sys/vm/vm_radix.c Modified: head/sys/vm/vm_radix.c ============================================================================== --- head/sys/vm/vm_radix.c Sat May 4 22:05:43 2013 (r250258) +++ head/sys/vm/vm_radix.c Sat May 4 22:50:15 2013 (r250259) @@ -257,54 +257,6 @@ vm_radix_keybarr(struct vm_radix_node *r } /* - * Adjusts the idx key to the first upper level available, based on a valid - * initial level and map of available levels. - * Returns a value bigger than 0 to signal that there are not valid levels - * available. - */ -static __inline int -vm_radix_addlev(vm_pindex_t *idx, boolean_t *levels, uint16_t ilev) -{ - - for (; levels[ilev] == FALSE || - vm_radix_slot(*idx, ilev) == (VM_RADIX_COUNT - 1); ilev--) - if (ilev == 0) - return (1); - - /* - * The following computation cannot overflow because *idx's slot at - * ilev is less than VM_RADIX_COUNT - 1. - */ - *idx = vm_radix_trimkey(*idx, ilev); - *idx += VM_RADIX_UNITLEVEL(ilev); - return (0); -} - -/* - * Adjusts the idx key to the first lower level available, based on a valid - * initial level and map of available levels. - * Returns a value bigger than 0 to signal that there are not valid levels - * available. - */ -static __inline int -vm_radix_declev(vm_pindex_t *idx, boolean_t *levels, uint16_t ilev) -{ - - for (; levels[ilev] == FALSE || - vm_radix_slot(*idx, ilev) == 0; ilev--) - if (ilev == 0) - return (1); - - /* - * The following computation cannot overflow because *idx's slot at - * ilev is greater than 0. - */ - *idx = vm_radix_trimkey(*idx, ilev); - *idx -= 1; - return (0); -} - -/* * Internal helper for vm_radix_reclaim_allnodes(). * This function is recursive. */ @@ -499,15 +451,14 @@ vm_radix_lookup(struct vm_radix *rtree, vm_page_t vm_radix_lookup_ge(struct vm_radix *rtree, vm_pindex_t index) { + struct vm_radix_node *stack[VM_RADIX_LIMIT]; vm_pindex_t inc; vm_page_t m; struct vm_radix_node *child, *rnode; - int slot; - uint16_t difflev; - boolean_t maplevels[VM_RADIX_LIMIT + 1]; #ifdef INVARIANTS int loops = 0; #endif + int slot, tos; rnode = vm_radix_getroot(rtree); if (rnode == NULL) @@ -519,34 +470,45 @@ vm_radix_lookup_ge(struct vm_radix *rtre else return (NULL); } -restart: - KASSERT(++loops < 1000, ("%s: too many loops", __func__)); - for (difflev = 0; difflev < (VM_RADIX_LIMIT + 1); difflev++) - maplevels[difflev] = FALSE; + tos = 0; for (;;) { - maplevels[rnode->rn_clev] = TRUE; - /* * If the keys differ before the current bisection node, * then the search key might rollback to the earliest * available bisection node or to the smallest key * in the current node (if the owner is bigger than the * search key). - * The maplevels array records any node has been seen - * at a given level. This aids the search for a valid - * bisection node. */ if (vm_radix_keybarr(rnode, index)) { if (index > rnode->rn_owner) { - difflev = vm_radix_keydiff(index, - rnode->rn_owner); - if (vm_radix_addlev(&index, maplevels, - difflev) > 0) - break; - rnode = vm_radix_getroot(rtree); - goto restart; +ascend: + KASSERT(++loops < 1000, + ("vm_radix_lookup_ge: too many loops")); + + /* + * Pop nodes from the stack until either the + * stack is empty or a node that could have a + * matching descendant is found. + */ + do { + if (tos == 0) + return (NULL); + rnode = stack[--tos]; + } while (vm_radix_slot(index, + rnode->rn_clev) == (VM_RADIX_COUNT - 1)); + + /* + * The following computation cannot overflow + * because index's slot at the current level + * is less than VM_RADIX_COUNT - 1. + */ + index = vm_radix_trimkey(index, + rnode->rn_clev); + index += VM_RADIX_UNITLEVEL(rnode->rn_clev); } else index = rnode->rn_owner; + KASSERT(!vm_radix_keybarr(rnode, index), + ("vm_radix_lookup_ge: keybarr failed")); } slot = vm_radix_slot(index, rnode->rn_clev); child = rnode->rn_child[slot]; @@ -580,18 +542,18 @@ restart: ("vm_radix_lookup_ge: child is radix node")); /* - * If a valid page or edge bigger than the search slot is - * found in the traversal, skip to the next higher-level key. + * If a page or edge bigger than the search slot is not found + * in the current node, ascend to the next higher-level node. */ - if (rnode->rn_clev == 0 || vm_radix_addlev(&index, maplevels, - rnode->rn_clev - 1) > 0) - break; - rnode = vm_radix_getroot(rtree); - goto restart; + goto ascend; descend: + KASSERT(rnode->rn_clev < VM_RADIX_LIMIT, + ("vm_radix_lookup_ge: pushing leaf's parent")); + KASSERT(tos < VM_RADIX_LIMIT, + ("vm_radix_lookup_ge: stack overflow")); + stack[tos++] = rnode; rnode = child; } - return (NULL); } /* @@ -600,15 +562,14 @@ descend: vm_page_t vm_radix_lookup_le(struct vm_radix *rtree, vm_pindex_t index) { + struct vm_radix_node *stack[VM_RADIX_LIMIT]; vm_pindex_t inc; vm_page_t m; struct vm_radix_node *child, *rnode; - int slot; - uint16_t difflev; - boolean_t maplevels[VM_RADIX_LIMIT + 1]; #ifdef INVARIANTS int loops = 0; #endif + int slot, tos; rnode = vm_radix_getroot(rtree); if (rnode == NULL) @@ -620,36 +581,47 @@ vm_radix_lookup_le(struct vm_radix *rtre else return (NULL); } -restart: - KASSERT(++loops < 1000, ("%s: too many loops", __func__)); - for (difflev = 0; difflev < (VM_RADIX_LIMIT + 1); difflev++) - maplevels[difflev] = FALSE; + tos = 0; for (;;) { - maplevels[rnode->rn_clev] = TRUE; - /* * If the keys differ before the current bisection node, * then the search key might rollback to the earliest * available bisection node or to the largest key * in the current node (if the owner is smaller than the * search key). - * The maplevels array records any node has been seen - * at a given level. This aids the search for a valid - * bisection node. */ if (vm_radix_keybarr(rnode, index)) { if (index > rnode->rn_owner) { index = rnode->rn_owner + VM_RADIX_COUNT * - VM_RADIX_UNITLEVEL(rnode->rn_clev) - 1; + VM_RADIX_UNITLEVEL(rnode->rn_clev); } else { - difflev = vm_radix_keydiff(index, - rnode->rn_owner); - if (vm_radix_declev(&index, maplevels, - difflev) > 0) - break; - rnode = vm_radix_getroot(rtree); - goto restart; +ascend: + KASSERT(++loops < 1000, + ("vm_radix_lookup_le: too many loops")); + + /* + * Pop nodes from the stack until either the + * stack is empty or a node that could have a + * matching descendant is found. + */ + do { + if (tos == 0) + return (NULL); + rnode = stack[--tos]; + } while (vm_radix_slot(index, + rnode->rn_clev) == 0); + + /* + * The following computation cannot overflow + * because index's slot at the current level + * is greater than 0. + */ + index = vm_radix_trimkey(index, + rnode->rn_clev); } + index--; + KASSERT(!vm_radix_keybarr(rnode, index), + ("vm_radix_lookup_le: keybarr failed")); } slot = vm_radix_slot(index, rnode->rn_clev); child = rnode->rn_child[slot]; @@ -683,18 +655,18 @@ restart: ("vm_radix_lookup_le: child is radix node")); /* - * If a valid page or edge smaller than the search slot is - * found in the traversal, skip to the next higher-level key. + * If a page or edge smaller than the search slot is not found + * in the current node, ascend to the next higher-level node. */ - if (rnode->rn_clev == 0 || vm_radix_declev(&index, maplevels, - rnode->rn_clev - 1) > 0) - break; - rnode = vm_radix_getroot(rtree); - goto restart; + goto ascend; descend: + KASSERT(rnode->rn_clev < VM_RADIX_LIMIT, + ("vm_radix_lookup_le: pushing leaf's parent")); + KASSERT(tos < VM_RADIX_LIMIT, + ("vm_radix_lookup_le: stack overflow")); + stack[tos++] = rnode; rnode = child; } - return (NULL); } /*