svn commit: r310675 - head/usr.sbin/bsnmpd/modules/snmp_hostres

2016-12-28 Thread Ngie Cooper
Author: ngie
Date: Wed Dec 28 08:11:41 2016
New Revision: 310675
URL: https://svnweb.freebsd.org/changeset/base/310675

Log:
  Fix the build by moving the initializers for len/nswapdev down below the
  declarations
  
  MFC after:3 days
  Pointyhat to: ngie

Modified:
  head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c

Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c
==
--- head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c Wed Dec 
28 07:37:26 2016(r310674)
+++ head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c Wed Dec 
28 08:11:41 2016(r310675)
@@ -376,8 +376,11 @@ storage_OS_get_swap(void)
 {
struct storage_entry *entry;
char swap_w_prefix[SE_DESC_MLEN];
-   size_t len = sizeof(nswapdev);
-   int nswapdev = 0;
+   size_t len;
+   int nswapdev;
+
+   len = sizeof(nswapdev);
+   nswapdev = 0;
 
if (sysctlbyname("vm.nswapdev", &nswapdev, &len, NULL,0 ) < 0) {
syslog(LOG_ERR,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2016-12-28 Thread Andriy Voskoboinyk
Author: avos
Date: Wed Dec 28 09:32:02 2016
New Revision: 310676
URL: https://svnweb.freebsd.org/changeset/base/310676

Log:
  rum.4, run.4, runfw.4, zyd.4: do not install when MK_USB == no.
  
  While here, add missing if_rtwn_usb.4.gz symlink into
  OptionalObsoleteFiles.inc

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

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileWed Dec 28 08:11:41 2016
(r310675)
+++ head/share/man/man4/MakefileWed Dec 28 09:32:02 2016
(r310676)
@@ -438,9 +438,6 @@ MAN=aac.4 \
rtwnfw.4 \
rtwn_pci.4 \
rue.4 \
-   rum.4 \
-   run.4 \
-   runfw.4 \
sa.4 \
safe.4 \
sbp.4 \
@@ -574,8 +571,7 @@ MAN=aac.4 \
xl.4 \
${_xnb.4} \
xpt.4 \
-   zero.4 \
-   zyd.4
+   zero.4
 
 MLINKS=ae.4 if_ae.4
 MLINKS+=age.4 if_age.4
@@ -710,8 +706,6 @@ MLINKS+=rl.4 if_rl.4
 MLINKS+=rtwn.4 if_rtwn.4
 MLINKS+=rtwn_pci.4 if_rtwn_pci.4
 MLINKS+=rue.4 if_rue.4
-MLINKS+=rum.4 if_rum.4
-MLINKS+=run.4 if_run.4
 MLINKS+=scsi.4 CAM.4 \
scsi.4 cam.4 \
scsi.4 scbus.4 \
@@ -756,7 +750,6 @@ MLINKS+=wi.4 if_wi.4
 MLINKS+=${_wpi.4} ${_if_wpi.4}
 MLINKS+=xe.4 if_xe.4
 MLINKS+=xl.4 if_xl.4
-MLINKS+=zyd.4 if_zyd.4
 
 .if ${MACHINE_CPUARCH} == "aarch64"
 _armv8crypto.4=armv8crypto.4
@@ -915,6 +908,9 @@ MAN+=   \
rsu.4 \
rsufw.4 \
rtwn_usb.4 \
+   rum.4 \
+   run.4 \
+   runfw.4 \
u3g.4 \
uark.4 \
uart.4 \
@@ -965,10 +961,13 @@ MAN+= \
utopia.4 \
uvisor.4 \
uvscom.4 \
+   zyd.4
 
 MLINKS+=otus.4 if_otus.4
 MLINKS+=rsu.4 if_rsu.4
 MLINKS+=rtwn_usb.4 if_rtwn_usb.4
+MLINKS+=rum.4 if_rum.4
+MLINKS+=run.4 if_run.4
 MLINKS+=u3g.4 u3gstub.4
 MLINKS+=uath.4 if_uath.4
 MLINKS+=udav.4 if_udav.4
@@ -976,6 +975,7 @@ MLINKS+=upgt.4 if_upgt.4
 MLINKS+=ural.4 if_ural.4
 MLINKS+=urndis.4 if_urndis.4
 MLINKS+=${_urtw.4} ${_if_urtw.4}
+MLINKS+=zyd.4 if_zyd.4
 .endif
 
 .include 

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Wed Dec 28 08:11:41 
2016(r310675)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Wed Dec 28 09:32:02 
2016(r310676)
@@ -8870,11 +8870,18 @@ OLD_FILES+=usr/share/man/man3/usb_strerr
 OLD_FILES+=usr/share/man/man3/usbhid.3.gz
 OLD_FILES+=usr/share/man/man4/if_otus.4.gz
 OLD_FILES+=usr/share/man/man4/if_rsu.4.gz
+OLD_FILES+=usr/share/man/man4/if_rtwn_usb.4.gz
+OLD_FILES+=usr/share/man/man4/if_rum.4.gz
+OLD_FILES+=usr/share/man/man4/if_run.4.gz
+OLD_FILES+=usr/share/man/man4/if_zyd.4.gz
 OLD_FILES+=usr/share/man/man4/otus.4.gz
 OLD_FILES+=usr/share/man/man4/otusfw.4.gz
 OLD_FILES+=usr/share/man/man4/rsu.4.gz
 OLD_FILES+=usr/share/man/man4/rsufw.4.gz
 OLD_FILES+=usr/share/man/man4/rtwn_usb.4.gz
+OLD_FILES+=usr/share/man/man4/rum.4.gz
+OLD_FILES+=usr/share/man/man4/run.4.gz
+OLD_FILES+=usr/share/man/man4/runfw.4.gz
 OLD_FILES+=usr/share/man/man4/u3g.4.gz
 OLD_FILES+=usr/share/man/man4/u3gstub.4.gz
 OLD_FILES+=usr/share/man/man4/uark.4.gz
@@ -8924,6 +8931,7 @@ OLD_FILES+=usr/share/man/man4/uslcom.4.g
 OLD_FILES+=usr/share/man/man4/utopia.4.gz
 OLD_FILES+=usr/share/man/man4/uvisor.4.gz
 OLD_FILES+=usr/share/man/man4/uvscom.4.gz
+OLD_FILES+=usr/share/man/man4/zyd.4.gz
 OLD_FILES+=usr/share/man/man8/uathload.8.gz
 OLD_FILES+=usr/share/man/man8/usbconfig.8.gz
 OLD_FILES+=usr/share/man/man8/usbdump.8.gz
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310677 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 28 10:39:11 2016
New Revision: 310677
URL: https://svnweb.freebsd.org/changeset/base/310677

Log:
  sfxge(4): cleanup: fix typo in siena_mac_loopback_set() instrumentation
  
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days

Modified:
  head/sys/dev/sfxge/common/siena_mac.c

Modified: head/sys/dev/sfxge/common/siena_mac.c
==
--- head/sys/dev/sfxge/common/siena_mac.c   Wed Dec 28 09:32:02 2016
(r310676)
+++ head/sys/dev/sfxge/common/siena_mac.c   Wed Dec 28 10:39:11 2016
(r310677)
@@ -223,7 +223,7 @@ siena_mac_loopback_set(
return (0);
 
 fail1:
-   EFSYS_PROBE(fail2);
+   EFSYS_PROBE1(fail1, efx_rc_t, rc);
 
epp->ep_loopback_type = old_loopback_type;
epp->ep_loopback_link_mode = old_loopback_link_mode;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310678 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 28 10:40:21 2016
New Revision: 310678
URL: https://svnweb.freebsd.org/changeset/base/310678

Log:
  sfxge(4): cleanup: remove trailing whitespace
  
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days

Modified:
  head/sys/dev/sfxge/common/efx_types.h

Modified: head/sys/dev/sfxge/common/efx_types.h
==
--- head/sys/dev/sfxge/common/efx_types.h   Wed Dec 28 10:39:11 2016
(r310677)
+++ head/sys/dev/sfxge/common/efx_types.h   Wed Dec 28 10:40:21 2016
(r310678)
@@ -1310,7 +1310,7 @@ extern int fix_lint;
 /*
  * Set or clear a numbered bit within an octword.
  */
- 
+
 #defineEFX_SHIFT64(_bit, _base)
\
(((_bit) >= (_base) && (_bit) < (_base) + 64) ? \
((uint64_t)1 << ((_bit) - (_base))) :   \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310679 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 28 10:43:04 2016
New Revision: 310679
URL: https://svnweb.freebsd.org/changeset/base/310679

Log:
  sfxge(4): cleanup: fix wrong indent
  
  Found by DPDK checkpatch.sh
  
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days

Modified:
  head/sys/dev/sfxge/common/efx_tx.c

Modified: head/sys/dev/sfxge/common/efx_tx.c
==
--- head/sys/dev/sfxge/common/efx_tx.c  Wed Dec 28 10:40:21 2016
(r310678)
+++ head/sys/dev/sfxge/common/efx_tx.c  Wed Dec 28 10:43:04 2016
(r310679)
@@ -329,7 +329,7 @@ efx_tx_qcreate(
 
if ((rc = etxop->etxo_qcreate(enp, index, label, esmp,
n, id, flags, eep, etp, addedp)) != 0)
-   goto fail2;
+   goto fail2;
 
enp->en_tx_qcount++;
*etpp = etp;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310680 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 28 10:44:03 2016
New Revision: 310680
URL: https://svnweb.freebsd.org/changeset/base/310680

Log:
  sfxge(4): cleanup: use spaces around binary arithmetic operations
  
  Found by DPDK checkpatch.sh
  
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days

Modified:
  head/sys/dev/sfxge/common/efx_lic.c

Modified: head/sys/dev/sfxge/common/efx_lic.c
==
--- head/sys/dev/sfxge/common/efx_lic.c Wed Dec 28 10:43:04 2016
(r310679)
+++ head/sys/dev/sfxge/common/efx_lic.c Wed Dec 28 10:44:03 2016
(r310680)
@@ -456,7 +456,7 @@ fail1:
  *  Value (V):  L bytes - payload
  */
 #define EFX_LICENSE_V1V2_PAYLOAD_LENGTH_MAX(256)
-#define EFX_LICENSE_V1V2_HEADER_LENGTH (2*sizeof(uint16_t))
+#define EFX_LICENSE_V1V2_HEADER_LENGTH (2 * sizeof(uint16_t))
 
__checkReturn   efx_rc_t
 efx_lic_v1v2_find_start(
@@ -1082,9 +1082,10 @@ efx_mcdi_licensing_v3_get_id(
} else {
/* Shift ID down to start of buffer */
memmove(bufferp,
- bufferp+MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_OFST,
- *lengthp);
-   memset(bufferp+(*lengthp), 0, 
MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_OFST);
+   bufferp + MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_OFST,
+   *lengthp);
+   memset(bufferp + (*lengthp), 0,
+   MC_CMD_LICENSING_GET_ID_V3_OUT_LICENSE_ID_OFST);
}
 
return (0);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310681 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 28 10:45:14 2016
New Revision: 310681
URL: https://svnweb.freebsd.org/changeset/base/310681

Log:
  sfxge(4): cleanup: remove unnecessary spaces
  
  Found by DPDK checkpatch.sh
  
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days

Modified:
  head/sys/dev/sfxge/common/efx_impl.h
  head/sys/dev/sfxge/common/efx_lic.c

Modified: head/sys/dev/sfxge/common/efx_impl.h
==
--- head/sys/dev/sfxge/common/efx_impl.hWed Dec 28 10:44:03 2016
(r310680)
+++ head/sys/dev/sfxge/common/efx_impl.hWed Dec 28 10:45:14 2016
(r310681)
@@ -564,7 +564,7 @@ typedef struct efx_lic_ops_s {
efx_rc_t(*elo_find_start)
(efx_nic_t *, caddr_t, size_t, uint32_t *);
efx_rc_t(*elo_find_end)(efx_nic_t *, caddr_t, size_t,
-   uint32_t , uint32_t *);
+   uint32_t, uint32_t *);
boolean_t   (*elo_find_key)(efx_nic_t *, caddr_t, size_t,
uint32_t, uint32_t *, uint32_t *);
boolean_t   (*elo_validate_key)(efx_nic_t *,

Modified: head/sys/dev/sfxge/common/efx_lic.c
==
--- head/sys/dev/sfxge/common/efx_lic.c Wed Dec 28 10:44:03 2016
(r310680)
+++ head/sys/dev/sfxge/common/efx_lic.c Wed Dec 28 10:45:14 2016
(r310681)
@@ -627,7 +627,7 @@ efx_lic_v1v2_write_key(
 
// Ensure space for terminator remains
if ((offset + length) >
-   (buffer_size - EFX_LICENSE_V1V2_HEADER_LENGTH) ) {
+   (buffer_size - EFX_LICENSE_V1V2_HEADER_LENGTH)) {
rc = ENOSPC;
goto fail1;
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310682 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 28 10:47:04 2016
New Revision: 310682
URL: https://svnweb.freebsd.org/changeset/base/310682

Log:
  sfxge(4): cleanup: avoid C99 // comments
  
  Found by DPDK checkpatch.sh
  
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days

Modified:
  head/sys/dev/sfxge/common/ef10_ev.c
  head/sys/dev/sfxge/common/ef10_nvram.c
  head/sys/dev/sfxge/common/efx_lic.c

Modified: head/sys/dev/sfxge/common/ef10_ev.c
==
--- head/sys/dev/sfxge/common/ef10_ev.c Wed Dec 28 10:45:14 2016
(r310681)
+++ head/sys/dev/sfxge/common/ef10_ev.c Wed Dec 28 10:47:04 2016
(r310682)
@@ -800,7 +800,7 @@ ef10_ev_rx(
 * or headers that are too long for the parser.
 * Headers and checksums must be validated by the host.
 */
-   // TODO: EFX_EV_QSTAT_INCR(eep, EV_RX_PARSE_INCOMPLETE);
+   /* TODO: EFX_EV_QSTAT_INCR(eep, EV_RX_PARSE_INCOMPLETE); */
goto deliver;
}
 

Modified: head/sys/dev/sfxge/common/ef10_nvram.c
==
--- head/sys/dev/sfxge/common/ef10_nvram.c  Wed Dec 28 10:45:14 2016
(r310681)
+++ head/sys/dev/sfxge/common/ef10_nvram.c  Wed Dec 28 10:47:04 2016
(r310682)
@@ -852,7 +852,7 @@ ef10_nvram_buffer_find_item_start(
__insize_t buffer_size,
__out   uint32_t *startp)
 {
-   // Read past partition header to find start address of the first key
+   /* Read past partition header to find start address of the first key */
tlv_cursor_t cursor;
efx_rc_t rc;
 
@@ -898,7 +898,7 @@ ef10_nvram_buffer_find_end(
__inuint32_t offset,
__out   uint32_t *endp)
 {
-   // Read to end of partition
+   /* Read to end of partition */
tlv_cursor_t cursor;
efx_rc_t rc;
uint32_t *segment_used;
@@ -956,7 +956,7 @@ ef10_nvram_buffer_find_item(
__out   uint32_t *startp,
__out   uint32_t *lengthp)
 {
-   // Find TLV at offset and return key start and length
+   /* Find TLV at offset and return key start and length */
tlv_cursor_t cursor;
uint8_t *key;
uint32_t tag;

Modified: head/sys/dev/sfxge/common/efx_lic.c
==
--- head/sys/dev/sfxge/common/efx_lic.c Wed Dec 28 10:45:14 2016
(r310681)
+++ head/sys/dev/sfxge/common/efx_lic.c Wed Dec 28 10:47:04 2016
(r310682)
@@ -625,7 +625,7 @@ efx_lic_v1v2_write_key(
EFSYS_ASSERT(length <= (EFX_LICENSE_V1V2_PAYLOAD_LENGTH_MAX +
EFX_LICENSE_V1V2_HEADER_LENGTH));
 
-   // Ensure space for terminator remains
+   /* Ensure space for terminator remains */
if ((offset + length) >
(buffer_size - EFX_LICENSE_V1V2_HEADER_LENGTH)) {
rc = ENOSPC;
@@ -662,7 +662,7 @@ efx_lic_v1v2_delete_key(
_NOTE(ARGUNUSED(enp))
EFSYS_ASSERT(end <= buffer_size);
 
-   // Shift everything after the key down
+   /* Shift everything after the key down */
memmove(bufferp + offset, bufferp + move_start, move_length);
 
*deltap = length;
@@ -681,7 +681,7 @@ efx_lic_v1v2_create_partition(
_NOTE(ARGUNUSED(enp))
EFSYS_ASSERT(EFX_LICENSE_V1V2_HEADER_LENGTH <= buffer_size);
 
-   // Write terminator
+   /* Write terminator */
memset(bufferp, '\0', EFX_LICENSE_V1V2_HEADER_LENGTH);
return (0);
 }
@@ -1155,7 +1155,7 @@ efx_lic_v3_validate_key(
__inuint32_t length
)
 {
-   // Check key is a valid V3 key
+   /* Check key is a valid V3 key */
uint8_t key_type;
uint8_t key_length;
 
@@ -1272,7 +1272,7 @@ efx_lic_v3_create_partition(
 {
efx_rc_t rc;
 
-   // Construct empty partition
+   /* Construct empty partition */
if ((rc = ef10_nvram_buffer_create(enp,
NVRAM_PARTITION_TYPE_LICENSE,
bufferp, buffer_size)) != 0) {
@@ -1303,7 +1303,7 @@ efx_lic_v3_finish_partition(
goto fail1;
}
 
-   // Validate completed partition
+   /* Validate completed partition */
if ((rc = ef10_nvram_buffer_validate(enp, NVRAM_PARTITION_TYPE_LICENSE,
bufferp, buffer_size)) != 0) {
goto fail2;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310683 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 28 10:48:15 2016
New Revision: 310683
URL: https://svnweb.freebsd.org/changeset/base/310683

Log:
  sfxge(4): cleanup: pointer symbol should go together with struct member name
  
  Found by DPDK checkpatch.sh
  
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days

Modified:
  head/sys/dev/sfxge/common/ef10_impl.h

Modified: head/sys/dev/sfxge/common/ef10_impl.h
==
--- head/sys/dev/sfxge/common/ef10_impl.h   Wed Dec 28 10:47:04 2016
(r310682)
+++ head/sys/dev/sfxge/common/ef10_impl.h   Wed Dec 28 10:48:15 2016
(r310683)
@@ -950,7 +950,7 @@ typedef struct ef10_filter_entry_s {
 
 typedef struct ef10_filter_table_s {
ef10_filter_entry_t eft_entry[EFX_EF10_FILTER_TBL_ROWS];
-   efx_rxq_t * eft_default_rxq;
+   efx_rxq_t   *eft_default_rxq;
boolean_t   eft_using_rss;
uint32_teft_unicst_filter_indexes[
EFX_EF10_FILTER_UNICAST_FILTERS_MAX];
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310684 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 28 10:49:41 2016
New Revision: 310684
URL: https://svnweb.freebsd.org/changeset/base/310684

Log:
  sfxge(4): cleanup: remove trailing whitespaces
  
  Found by DPDK checkpatch.sh
  
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days

Modified:
  head/sys/dev/sfxge/common/efx_types.h

Modified: head/sys/dev/sfxge/common/efx_types.h
==
--- head/sys/dev/sfxge/common/efx_types.h   Wed Dec 28 10:48:15 2016
(r310683)
+++ head/sys/dev/sfxge/common/efx_types.h   Wed Dec 28 10:49:41 2016
(r310684)
@@ -238,7 +238,7 @@ typedef union efx_oword_u {
 #endif
 #if EFSYS_HAS_UINT64
uint64_t eo_u64[2];
-#endif 
+#endif
uint32_t eo_u32[4];
uint16_t eo_u16[8];
uint8_t eo_u8[16];
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310685 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 28 10:52:04 2016
New Revision: 310685
URL: https://svnweb.freebsd.org/changeset/base/310685

Log:
  sfxge(4): cleanup: open brace should be on a type name line
  
  Found by DPDK checkpatch.sh
  
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days

Modified:
  head/sys/dev/sfxge/common/efx.h
  head/sys/dev/sfxge/common/efx_mcdi.c

Modified: head/sys/dev/sfxge/common/efx.h
==
--- head/sys/dev/sfxge/common/efx.h Wed Dec 28 10:49:41 2016
(r310684)
+++ head/sys/dev/sfxge/common/efx.h Wed Dec 28 10:52:04 2016
(r310685)
@@ -212,8 +212,7 @@ typedef enum efx_mcdi_exception_e {
 } efx_mcdi_exception_t;
 
 #if EFSYS_OPT_MCDI_LOGGING
-typedef enum efx_log_msg_e
-{
+typedef enum efx_log_msg_e {
EFX_LOG_INVALID,
EFX_LOG_MCDI_REQUEST,
EFX_LOG_MCDI_RESPONSE,
@@ -1172,8 +1171,7 @@ efx_nic_cfg_get(
__inefx_nic_t *enp);
 
 /* Driver resource limits (minimum required/maximum usable). */
-typedef struct efx_drv_limits_s
-{
+typedef struct efx_drv_limits_s {
uint32_tedl_min_evq_count;
uint32_tedl_max_evq_count;
 

Modified: head/sys/dev/sfxge/common/efx_mcdi.c
==
--- head/sys/dev/sfxge/common/efx_mcdi.cWed Dec 28 10:49:41 2016
(r310684)
+++ head/sys/dev/sfxge/common/efx_mcdi.cWed Dec 28 10:52:04 2016
(r310685)
@@ -1728,8 +1728,7 @@ fail1:
 
 #if EFSYS_OPT_MAC_STATS
 
-typedef enum efx_stats_action_e
-{
+typedef enum efx_stats_action_e {
EFX_STATS_CLEAR,
EFX_STATS_UPLOAD,
EFX_STATS_ENABLE_NOEVENTS,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310686 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 28 10:53:53 2016
New Revision: 310686
URL: https://svnweb.freebsd.org/changeset/base/310686

Log:
  sfxge(4): cleanup: add missing space between type and pointer symbol
  
  Found by DPDK checkpatch.sh
  
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days

Modified:
  head/sys/dev/sfxge/common/efx.h
  head/sys/dev/sfxge/common/efx_lic.c

Modified: head/sys/dev/sfxge/common/efx.h
==
--- head/sys/dev/sfxge/common/efx.h Wed Dec 28 10:52:04 2016
(r310685)
+++ head/sys/dev/sfxge/common/efx.h Wed Dec 28 10:53:53 2016
(r310686)
@@ -435,7 +435,7 @@ typedef enum efx_link_mode_e {
 
 #defineEFX_MAC_ADDR_LEN 6
 
-#defineEFX_MAC_ADDR_IS_MULTICAST(_address) (((uint8_t*)_address)[0] & 
0x01)
+#defineEFX_MAC_ADDR_IS_MULTICAST(_address) (((uint8_t *)_address)[0] & 
0x01)
 
 #defineEFX_MAC_MULTICAST_LIST_MAX  256
 

Modified: head/sys/dev/sfxge/common/efx_lic.c
==
--- head/sys/dev/sfxge/common/efx_lic.c Wed Dec 28 10:52:04 2016
(r310685)
+++ head/sys/dev/sfxge/common/efx_lic.c Wed Dec 28 10:53:53 2016
(r310686)
@@ -509,8 +509,8 @@ efx_lic_v1v2_find_key(
if ((size_t)buffer_size - offset < EFX_LICENSE_V1V2_HEADER_LENGTH)
goto fail1;
 
-   tlv_type = __LE_TO_CPU_16(((uint16_t*)&bufferp[offset])[0]);
-   tlv_length = __LE_TO_CPU_16(((uint16_t*)&bufferp[offset])[1]);
+   tlv_type = __LE_TO_CPU_16(((uint16_t *)&bufferp[offset])[0]);
+   tlv_length = __LE_TO_CPU_16(((uint16_t *)&bufferp[offset])[1]);
if ((tlv_length > EFX_LICENSE_V1V2_PAYLOAD_LENGTH_MAX) ||
(tlv_type == 0 && tlv_length == 0)) {
found = B_FALSE;
@@ -543,8 +543,8 @@ efx_lic_v1v2_validate_key(
goto fail1;
}
 
-   tlv_type = __LE_TO_CPU_16(((uint16_t*)keyp)[0]);
-   tlv_length = __LE_TO_CPU_16(((uint16_t*)keyp)[1]);
+   tlv_type = __LE_TO_CPU_16(((uint16_t *)keyp)[0]);
+   tlv_length = __LE_TO_CPU_16(((uint16_t *)keyp)[1]);
 
if (tlv_length > EFX_LICENSE_V1V2_PAYLOAD_LENGTH_MAX) {
goto fail2;
@@ -1169,8 +1169,8 @@ efx_lic_v3_validate_key(
goto fail2;
}
 
-   key_type = ((uint8_t*)keyp)[0];
-   key_length = ((uint8_t*)keyp)[1];
+   key_type = ((uint8_t *)keyp)[0];
+   key_length = ((uint8_t *)keyp)[1];
 
if (key_type < 3) {
goto fail3;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310687 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 28 11:01:01 2016
New Revision: 310687
URL: https://svnweb.freebsd.org/changeset/base/310687

Log:
  sfxge(4): cleanup: use TAB to indent
  
  Found by DPDK checkpatch.sh
  
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days

Modified:
  head/sys/dev/sfxge/common/efx.h
  head/sys/dev/sfxge/common/efx_impl.h
  head/sys/dev/sfxge/common/efx_phy.c
  head/sys/dev/sfxge/common/hunt_nic.c
  head/sys/dev/sfxge/common/mcdi_mon.c
  head/sys/dev/sfxge/common/medford_nic.c
  head/sys/dev/sfxge/common/siena_flash.h
  head/sys/dev/sfxge/common/siena_impl.h

Modified: head/sys/dev/sfxge/common/efx.h
==
--- head/sys/dev/sfxge/common/efx.h Wed Dec 28 10:53:53 2016
(r310686)
+++ head/sys/dev/sfxge/common/efx.h Wed Dec 28 11:01:01 2016
(r310687)
@@ -847,7 +847,7 @@ typedef enum efx_phy_cap_type_e {
 extern void
 efx_phy_adv_cap_get(
__inefx_nic_t *enp,
-   __inuint32_t flag,
+   __inuint32_t flag,
__out   uint32_t *maskp);
 
 extern __checkReturn   efx_rc_t
@@ -1132,20 +1132,20 @@ typedef struct efx_nic_cfg_s {
boolean_t   enc_rx_batching_enabled;
/* Maximum number of descriptors completed in an rx event. */
uint32_tenc_rx_batch_max;
-/* Number of rx descriptors the hardware requires for a push. */
-uint32_t   enc_rx_push_align;
+   /* Number of rx descriptors the hardware requires for a push. */
+   uint32_tenc_rx_push_align;
/*
 * Maximum number of bytes into the packet the TCP header can start for
 * the hardware to apply TSO packet edits.
 */
-   uint32_tenc_tx_tso_tcp_header_offset_limit;
-   boolean_t   enc_fw_assisted_tso_enabled;
-   boolean_t   enc_fw_assisted_tso_v2_enabled;
-   boolean_t   enc_hw_tx_insert_vlan_enabled;
+   uint32_tenc_tx_tso_tcp_header_offset_limit;
+   boolean_t   enc_fw_assisted_tso_enabled;
+   boolean_t   enc_fw_assisted_tso_v2_enabled;
+   boolean_t   enc_hw_tx_insert_vlan_enabled;
/* Datapath firmware vadapter/vport/vswitch support */
boolean_t   enc_datapath_cap_evb;
-   boolean_t   enc_rx_disable_scatter_supported;
-   boolean_t   enc_allow_set_mac_with_installed_filters;
+   boolean_t   enc_rx_disable_scatter_supported;
+   boolean_t   enc_allow_set_mac_with_installed_filters;
boolean_t   enc_enhanced_set_mac_supported;
boolean_t   enc_init_evq_v2_supported;
/* External port identifier */
@@ -1846,8 +1846,8 @@ typedef enum efx_rx_hash_support_e {
 } efx_rx_hash_support_t;
 
 #defineEFX_RSS_TBL_SIZE128 /* Rows in RX indirection table 
*/
-#defineEFX_MAXRSS  64  /* RX indirection entry range */
-#defineEFX_MAXRSS_LEGACY   16  /* See bug16611 and bug17213 */
+#defineEFX_MAXRSS  64  /* RX indirection entry range */
+#defineEFX_MAXRSS_LEGACY   16  /* See bug16611 and bug17213 */
 
 typedef enum efx_rx_scale_support_e {
EFX_RX_SCALE_UNAVAILABLE = 0,   /* Not supported */
@@ -2059,7 +2059,7 @@ efx_tx_qpio_write(
__inefx_txq_t *etp,
__in_ecount(buf_length) uint8_t *buffer,
__insize_t buf_length,
-   __insize_t pio_buf_offset);
+   __insize_t pio_buf_offset);
 
 extern __checkReturn   efx_rc_t
 efx_tx_qpio_post(

Modified: head/sys/dev/sfxge/common/efx_impl.h
==
--- head/sys/dev/sfxge/common/efx_impl.hWed Dec 28 10:53:53 2016
(r310686)
+++ head/sys/dev/sfxge/common/efx_impl.hWed Dec 28 11:01:01 2016
(r310687)
@@ -252,7 +252,7 @@ efx_filter_reconfigure(
 
 typedef struct efx_port_s {
efx_mac_type_t  ep_mac_type;
-   uint32_tep_phy_type;
+   uint32_tep_phy_type;
uint8_t ep_port;
uint32_tep_mac_pdu;
uint8_t ep_mac_addr[6];
@@ -600,7 +600,7 @@ struct efx_nic_s {
uint32_ten_features;
efsys_identifier_t  *en_esip;
efsys_lock_t*en_eslp;
-   efsys_bar_t *en_esbp;
+   efsys_bar_t *en_esbp;
unsigned inten_mod_flags;
unsigned inten_reset_flags;
efx_nic_cfg_t   en_nic_cfg;

Modified: head/sys/dev/sfxge/common/efx_phy.c
===

svn commit: r310688 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 28 11:03:06 2016
New Revision: 310688
URL: https://svnweb.freebsd.org/changeset/base/310688

Log:
  sfxge(4): cleanup: avoid space just before TAB in efx_types.h
  
  Found by DPDK checkpatch.sh
  
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days

Modified:
  head/sys/dev/sfxge/common/efx_types.h

Modified: head/sys/dev/sfxge/common/efx_types.h
==
--- head/sys/dev/sfxge/common/efx_types.h   Wed Dec 28 11:01:01 2016
(r310687)
+++ head/sys/dev/sfxge/common/efx_types.h   Wed Dec 28 11:03:06 2016
(r310688)
@@ -688,21 +688,21 @@ extern int fix_lint;
_field7, _value7, _field8, _value8, _field9, _value9,   \
_field10, _value10) \
do {\
-   _NOTE(CONSTANTCONDITION)\
+   _NOTE(CONSTANTCONDITION)\
(_oword).eo_u64[0] = EFX_INSERT_FIELDS64(0, 63, \
_field1, _value1, _field2, _value2, \
_field3, _value3, _field4, _value4, \
_field5, _value5, _field6, _value6, \
_field7, _value7, _field8, _value8, \
_field9, _value9, _field10, _value10);  \
-   _NOTE(CONSTANTCONDITION)\
+   _NOTE(CONSTANTCONDITION)\
(_oword).eo_u64[1] = EFX_INSERT_FIELDS64(64, 127,   \
_field1, _value1, _field2, _value2, \
_field3, _value3, _field4, _value4, \
_field5, _value5, _field6, _value6, \
_field7, _value7, _field8, _value8, \
_field9, _value9, _field10, _value10);  \
-   _NOTE(CONSTANTCONDITION)\
+   _NOTE(CONSTANTCONDITION)\
} while (B_FALSE)
 
 #defineEFX_POPULATE_OWORD32(_oword,
\
@@ -711,35 +711,35 @@ extern int fix_lint;
_field7, _value7, _field8, _value8, _field9, _value9,   \
_field10, _value10) \
do {\
-   _NOTE(CONSTANTCONDITION)\
+   _NOTE(CONSTANTCONDITION)\
(_oword).eo_u32[0] = EFX_INSERT_FIELDS32(0, 31, \
_field1, _value1, _field2, _value2, \
_field3, _value3, _field4, _value4, \
_field5, _value5, _field6, _value6, \
_field7, _value7, _field8, _value8, \
_field9, _value9, _field10, _value10);  \
-   _NOTE(CONSTANTCONDITION)\
+   _NOTE(CONSTANTCONDITION)\
(_oword).eo_u32[1] = EFX_INSERT_FIELDS32(32, 63,\
_field1, _value1, _field2, _value2, \
_field3, _value3, _field4, _value4, \
_field5, _value5, _field6, _value6, \
_field7, _value7, _field8, _value8, \
_field9, _value9, _field10, _value10);  \
-   _NOTE(CONSTANTCONDITION)\
+   _NOTE(CONSTANTCONDITION)\
(_oword).eo_u32[2] = EFX_INSERT_FIELDS32(64, 95,\
_field1, _value1, _field2, _value2, \
_field3, _value3, _field4, _value4, \
_field5, _value5, _field6, _value6, \
_field7, _value7, _field8, _value8, \
_field9, _value9, _field10, _value10);  \
-   _NOTE(CONSTANTCONDITION)\
+   _NOTE(CONSTANTCONDITION)\
(_oword).eo_u32[3] = EFX_INSERT_FIELDS32(96, 127,   \
_field1, _value1, _field2, _value2, \
_field3, _value3, _field4, _value4, \
_field5, _value5, _field6, _value6, \
_field7, _value7, _field8, _value8, \
_field9, _value9, _field10, _value10); 

svn commit: r310689 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 28 11:04:36 2016
New Revision: 310689
URL: https://svnweb.freebsd.org/changeset/base/310689

Log:
  sfxge(4): cleanup: avoid spaces before TAB
  
  Found by DPDK checkpatch.sh
  
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days

Modified:
  head/sys/dev/sfxge/common/efx.h
  head/sys/dev/sfxge/common/efx_impl.h
  head/sys/dev/sfxge/common/efx_types.h
  head/sys/dev/sfxge/common/siena_phy.c

Modified: head/sys/dev/sfxge/common/efx.h
==
--- head/sys/dev/sfxge/common/efx.h Wed Dec 28 11:03:06 2016
(r310688)
+++ head/sys/dev/sfxge/common/efx.h Wed Dec 28 11:04:36 2016
(r310689)
@@ -169,7 +169,7 @@ extern  void
 efx_nic_unprobe(
__inefx_nic_t *enp);
 
-extern void
+extern void
 efx_nic_destroy(
__inefx_nic_t *enp);
 
@@ -286,21 +286,21 @@ efx_intr_init(
__inefx_intr_type_t type,
__inefsys_mem_t *esmp);
 
-extern void
+extern void
 efx_intr_enable(
__inefx_nic_t *enp);
 
-extern void
+extern void
 efx_intr_disable(
__inefx_nic_t *enp);
 
-extern void
+extern void
 efx_intr_disable_unlocked(
__inefx_nic_t *enp);
 
 #defineEFX_INTR_NEVQS  32
 
-extern __checkReturn   efx_rc_t
+extern __checkReturn   efx_rc_t
 efx_intr_trigger(
__inefx_nic_t *enp,
__inunsigned int level);
@@ -819,7 +819,7 @@ efx_port_poll(
__inefx_nic_t *enp,
__out_opt   efx_link_mode_t *link_modep);
 
-extern void
+extern void
 efx_port_fini(
__inefx_nic_t *enp);
 
@@ -1253,7 +1253,7 @@ efx_vpd_verify(
__in_bcount(size)   caddr_t data,
__insize_t size);
 
-extern  __checkReturn  efx_rc_t
+extern __checkReturn   efx_rc_t
 efx_vpd_reinit(
__inefx_nic_t *enp,
__in_bcount(size)   caddr_t data,
@@ -1281,7 +1281,7 @@ efx_vpd_next(
__out   efx_vpd_value_t *evvp,
__inout unsigned int *contp);
 
-extern __checkReturn   efx_rc_t
+extern __checkReturn   efx_rc_t
 efx_vpd_write(
__inefx_nic_t *enp,
__in_bcount(size)   caddr_t data,
@@ -1499,7 +1499,7 @@ typedef enum efx_pattern_type_t {
EFX_PATTERN_NTYPES
 } efx_pattern_type_t;
 
-typedefvoid
+typedefvoid
 (*efx_sram_pattern_fn_t)(
__insize_t row,
__inboolean_t negate,

Modified: head/sys/dev/sfxge/common/efx_impl.h
==
--- head/sys/dev/sfxge/common/efx_impl.hWed Dec 28 11:03:06 2016
(r310688)
+++ head/sys/dev/sfxge/common/efx_impl.hWed Dec 28 11:04:36 2016
(r310689)
@@ -913,7 +913,7 @@ struct efx_txq_s {
uint32_t, (_edp)->ed_u32[0]);   \
EFSYS_BAR_WRITED((_enp)->en_esbp,   \
(_reg ## _OFST +\
-   (2 * sizeof (efx_dword_t)) +\
+   (2 * sizeof (efx_dword_t)) +\
((_index) * _reg ## _STEP)),\
(_edp), (_lock));   \
_NOTE(CONSTANTCONDITION)\
@@ -928,7 +928,7 @@ struct efx_txq_s {
uint32_t, (_edp)->ed_u32[0]);   \
EFSYS_BAR_WRITED((_enp)->en_esbp,   \
(_reg ## _OFST +\
-   (3 * sizeof (efx_dword_t)) +\
+   (3 * sizeof (efx_dword_t)) +\
((_index) * _reg ## _STEP)),\
(_edp), (_lock));   \
_NOTE(CONSTANTCONDITION)\

Modified: head/sys/dev/sfxge/common/efx_types.h
==
--- head/sys/dev/sfxge/common/efx_types.h   Wed Dec 28 11:03:06 2016
(r310688)
+++ head/sys/dev/sfxge/common/efx_types.h   Wed Dec 28 11:04:36 2016
(r310689)
@@ -246,7 +246,7 @@ typedef union efx_oword_u {
 
 #pragma pack()
 
-#define__SWAP16(_x)\
+#define__SWAP16(_x)\
_x) & 0xff) << 8) | \
(((_x) >> 8) & 0xff))
 
@@ 

svn commit: r310690 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 28 11:07:34 2016
New Revision: 310690
URL: https://svnweb.freebsd.org/changeset/base/310690

Log:
  sfxge(4): cleanup: add const qualifier to const array pointer
  
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days

Modified:
  head/sys/dev/sfxge/common/efx_ev.c
  head/sys/dev/sfxge/common/efx_mac.c
  head/sys/dev/sfxge/common/efx_mon.c
  head/sys/dev/sfxge/common/efx_phy.c
  head/sys/dev/sfxge/common/efx_tx.c

Modified: head/sys/dev/sfxge/common/efx_ev.c
==
--- head/sys/dev/sfxge/common/efx_ev.c  Wed Dec 28 11:04:36 2016
(r310689)
+++ head/sys/dev/sfxge/common/efx_ev.c  Wed Dec 28 11:07:34 2016
(r310690)
@@ -1357,8 +1357,8 @@ fail1:
 
 #if EFSYS_OPT_QSTATS
 #if EFSYS_OPT_NAMES
-/* START MKCONFIG GENERATED EfxEventQueueStatNamesBlock b693ddf85aee1bfd */
-static const char  *__efx_ev_qstat_name[] = {
+/* START MKCONFIG GENERATED EfxEventQueueStatNamesBlock c0f3bc5083b40532 */
+static const char * const __efx_ev_qstat_name[] = {
"all",
"rx",
"rx_ok",

Modified: head/sys/dev/sfxge/common/efx_mac.c
==
--- head/sys/dev/sfxge/common/efx_mac.c Wed Dec 28 11:04:36 2016
(r310689)
+++ head/sys/dev/sfxge/common/efx_mac.c Wed Dec 28 11:07:34 2016
(r310690)
@@ -515,8 +515,8 @@ efx_mac_filter_default_rxq_clear(
 
 #if EFSYS_OPT_NAMES
 
-/* START MKCONFIG GENERATED EfxMacStatNamesBlock 054d43a31d2d7a45 */
-static const char  *__efx_mac_stat_name[] = {
+/* START MKCONFIG GENERATED EfxMacStatNamesBlock c11b91b42f922516 */
+static const char * const __efx_mac_stat_name[] = {
"rx_octets",
"rx_pkts",
"rx_unicst_pkts",

Modified: head/sys/dev/sfxge/common/efx_mon.c
==
--- head/sys/dev/sfxge/common/efx_mon.c Wed Dec 28 11:04:36 2016
(r310689)
+++ head/sys/dev/sfxge/common/efx_mon.c Wed Dec 28 11:07:34 2016
(r310690)
@@ -126,8 +126,8 @@ fail1:
 
 #if EFSYS_OPT_NAMES
 
-/* START MKCONFIG GENERATED MonitorStatNamesBlock 31f437eafb0b0437 */
-static const char  *__mon_stat_name[] = {
+/* START MKCONFIG GENERATED MonitorStatNamesBlock 5daa2a5725ba734b */
+static const char * const __mon_stat_name[] = {
"value_2_5v",
"value_vccp1",
"value_vcc",

Modified: head/sys/dev/sfxge/common/efx_phy.c
==
--- head/sys/dev/sfxge/common/efx_phy.c Wed Dec 28 11:04:36 2016
(r310689)
+++ head/sys/dev/sfxge/common/efx_phy.c Wed Dec 28 11:07:34 2016
(r310690)
@@ -336,8 +336,8 @@ fail1:
 
 #if EFSYS_OPT_NAMES
 
-/* START MKCONFIG GENERATED PhyStatNamesBlock d5f79b4bc2c050fe */
-static const char  *__efx_phy_stat_name[] = {
+/* START MKCONFIG GENERATED PhyStatNamesBlock af9ffa24da3bc100 */
+static const char * const __efx_phy_stat_name[] = {
"oui",
"pma_pmd_link_up",
"pma_pmd_rx_fault",

Modified: head/sys/dev/sfxge/common/efx_tx.c
==
--- head/sys/dev/sfxge/common/efx_tx.c  Wed Dec 28 11:04:36 2016
(r310689)
+++ head/sys/dev/sfxge/common/efx_tx.c  Wed Dec 28 11:07:34 2016
(r310690)
@@ -1029,8 +1029,8 @@ siena_tx_qdesc_dma_create(
 
 #if EFSYS_OPT_QSTATS
 #if EFSYS_OPT_NAMES
-/* START MKCONFIG GENERATED EfxTransmitQueueStatNamesBlock 9d8d26a0a5e2c453 */
-static const char  *__efx_tx_qstat_name[] = {
+/* START MKCONFIG GENERATED EfxTransmitQueueStatNamesBlock 2866874ecd7a363b */
+static const char * const __efx_tx_qstat_name[] = {
"post",
"post_pio",
 };
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310691 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 28 11:09:45 2016
New Revision: 310691
URL: https://svnweb.freebsd.org/changeset/base/310691

Log:
  sfxge(4): make strings array pointer itself immutable
  
  Found by DPDK checkpatches.sh
  
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days

Modified:
  head/sys/dev/sfxge/common/efx_mon.c
  head/sys/dev/sfxge/common/efx_port.c

Modified: head/sys/dev/sfxge/common/efx_mon.c
==
--- head/sys/dev/sfxge/common/efx_mon.c Wed Dec 28 11:07:34 2016
(r310690)
+++ head/sys/dev/sfxge/common/efx_mon.c Wed Dec 28 11:09:45 2016
(r310691)
@@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$");
 
 #if EFSYS_OPT_NAMES
 
-static const char  *__efx_mon_name[] = {
+static const char * const __efx_mon_name[] = {
"",
"sfx90x0",
"sfx91x0",

Modified: head/sys/dev/sfxge/common/efx_port.c
==
--- head/sys/dev/sfxge/common/efx_port.cWed Dec 28 11:07:34 2016
(r310690)
+++ head/sys/dev/sfxge/common/efx_port.cWed Dec 28 11:09:45 2016
(r310691)
@@ -172,7 +172,7 @@ fail1:
 
 #if EFSYS_OPT_NAMES
 
-static const char  *__efx_loopback_type_name[] = {
+static const char * const __efx_loopback_type_name[] = {
"OFF",
"DATA",
"GMAC",
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310692 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 28 11:11:15 2016
New Revision: 310692
URL: https://svnweb.freebsd.org/changeset/base/310692

Log:
  sfxge(4): enclose macro complex value in parenthesis
  
  Found by DPDK checkpatches.sh
  
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days

Modified:
  head/sys/dev/sfxge/common/efx_bootcfg.c
  head/sys/dev/sfxge/common/efx_types.h
  head/sys/dev/sfxge/common/mcdi_mon.c

Modified: head/sys/dev/sfxge/common/efx_bootcfg.c
==
--- head/sys/dev/sfxge/common/efx_bootcfg.c Wed Dec 28 11:09:45 2016
(r310691)
+++ head/sys/dev/sfxge/common/efx_bootcfg.c Wed Dec 28 11:11:15 2016
(r310692)
@@ -43,8 +43,8 @@ __FBSDID("$FreeBSD$");
  */
 #defineBOOTCFG_MAX_SIZE 0x1000
 
-#defineDHCP_END (uint8_t)0xff
-#defineDHCP_PAD (uint8_t)0
+#defineDHCP_END ((uint8_t)0xff)
+#defineDHCP_PAD ((uint8_t)0)
 
 static __checkReturn   uint8_t
 efx_bootcfg_csum(

Modified: head/sys/dev/sfxge/common/efx_types.h
==
--- head/sys/dev/sfxge/common/efx_types.h   Wed Dec 28 11:09:45 2016
(r310691)
+++ head/sys/dev/sfxge/common/efx_types.h   Wed Dec 28 11:11:15 2016
(r310692)
@@ -264,37 +264,37 @@ typedef union efx_oword_u {
 
 #if EFSYS_IS_BIG_ENDIAN
 
-#define__CPU_TO_LE_16(_x)  (uint16_t)__SWAP16(_x)
-#define__LE_TO_CPU_16(_x)  (uint16_t)__SWAP16(_x)
-#define__CPU_TO_BE_16(_x)  (uint16_t)__NOSWAP16(_x)
-#define__BE_TO_CPU_16(_x)  (uint16_t)__NOSWAP16(_x)
-
-#define__CPU_TO_LE_32(_x)  (uint32_t)__SWAP32(_x)
-#define__LE_TO_CPU_32(_x)  (uint32_t)__SWAP32(_x)
-#define__CPU_TO_BE_32(_x)  (uint32_t)__NOSWAP32(_x)
-#define__BE_TO_CPU_32(_x)  (uint32_t)__NOSWAP32(_x)
-
-#define__CPU_TO_LE_64(_x)  (uint64_t)__SWAP64(_x)
-#define__LE_TO_CPU_64(_x)  (uint64_t)__SWAP64(_x)
-#define__CPU_TO_BE_64(_x)  (uint64_t)__NOSWAP64(_x)
-#define__BE_TO_CPU_64(_x)  (uint64_t)__NOSWAP64(_x)
+#define__CPU_TO_LE_16(_x)  ((uint16_t)__SWAP16(_x))
+#define__LE_TO_CPU_16(_x)  ((uint16_t)__SWAP16(_x))
+#define__CPU_TO_BE_16(_x)  ((uint16_t)__NOSWAP16(_x))
+#define__BE_TO_CPU_16(_x)  ((uint16_t)__NOSWAP16(_x))
+
+#define__CPU_TO_LE_32(_x)  ((uint32_t)__SWAP32(_x))
+#define__LE_TO_CPU_32(_x)  ((uint32_t)__SWAP32(_x))
+#define__CPU_TO_BE_32(_x)  ((uint32_t)__NOSWAP32(_x))
+#define__BE_TO_CPU_32(_x)  ((uint32_t)__NOSWAP32(_x))
+
+#define__CPU_TO_LE_64(_x)  ((uint64_t)__SWAP64(_x))
+#define__LE_TO_CPU_64(_x)  ((uint64_t)__SWAP64(_x))
+#define__CPU_TO_BE_64(_x)  ((uint64_t)__NOSWAP64(_x))
+#define__BE_TO_CPU_64(_x)  ((uint64_t)__NOSWAP64(_x))
 
 #elif EFSYS_IS_LITTLE_ENDIAN
 
-#define__CPU_TO_LE_16(_x)  (uint16_t)__NOSWAP16(_x)
-#define__LE_TO_CPU_16(_x)  (uint16_t)__NOSWAP16(_x)
-#define__CPU_TO_BE_16(_x)  (uint16_t)__SWAP16(_x)
-#define__BE_TO_CPU_16(_x)  (uint16_t)__SWAP16(_x)
-
-#define__CPU_TO_LE_32(_x)  (uint32_t)__NOSWAP32(_x)
-#define__LE_TO_CPU_32(_x)  (uint32_t)__NOSWAP32(_x)
-#define__CPU_TO_BE_32(_x)  (uint32_t)__SWAP32(_x)
-#define__BE_TO_CPU_32(_x)  (uint32_t)__SWAP32(_x)
-
-#define__CPU_TO_LE_64(_x)  (uint64_t)__NOSWAP64(_x)
-#define__LE_TO_CPU_64(_x)  (uint64_t)__NOSWAP64(_x)
-#define__CPU_TO_BE_64(_x)  (uint64_t)__SWAP64(_x)
-#define__BE_TO_CPU_64(_x)  (uint64_t)__SWAP64(_x)
+#define__CPU_TO_LE_16(_x)  ((uint16_t)__NOSWAP16(_x))
+#define__LE_TO_CPU_16(_x)  ((uint16_t)__NOSWAP16(_x))
+#define__CPU_TO_BE_16(_x)  ((uint16_t)__SWAP16(_x))
+#define__BE_TO_CPU_16(_x)  ((uint16_t)__SWAP16(_x))
+
+#define__CPU_TO_LE_32(_x)  ((uint32_t)__NOSWAP32(_x))
+#define__LE_TO_CPU_32(_x)  ((uint32_t)__NOSWAP32(_x))
+#define__CPU_TO_BE_32(_x)  ((uint32_t)__SWAP32(_x))
+#define__BE_TO_CPU_32(_x)  ((uint32_t)__SWAP32(_x))
+
+#define__CPU_TO_LE_64(_x)  ((uint64_t)__NOSWAP64(_x))
+#define__LE_TO_CPU_64(_x)  ((uint64_t)__NOSWAP64(_x))
+#define__CPU_TO_BE_64(_x)  ((uint64_t)__SWAP64(_x))
+#define__BE_TO_CPU_64(_x)  ((uint64_t)__SWAP64(_x))
 
 #else
 

Modified: head/sys/dev/sfxge/common/mcdi_mon.c
==
--- head/sys/dev/sfxge/common/mcdi_mon.cWed Dec 28 11:09:45 2016
(r310691)
+++ head/sys/dev/sfxge/common/mcdi_mon.cWed Dec 28 11:11:15 2016
(r310692)
@@ -38,8 +38,8 @@ __FBSDID("$FreeBSD$");
 
 #if EFSYS_OPT_MON_STATS
 
-#defi

svn commit: r310693 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 28 11:19:54 2016
New Revision: 310693
URL: https://svnweb.freebsd.org/changeset/base/310693

Log:
  sfxge(4): cleanup: avoid unspecified unsigned
  
  Found by DPDK checkpatch.sh
  
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days

Modified:
  head/sys/dev/sfxge/common/ef10_ev.c
  head/sys/dev/sfxge/common/ef10_filter.c
  head/sys/dev/sfxge/common/ef10_nvram.c
  head/sys/dev/sfxge/common/efx_ev.c
  head/sys/dev/sfxge/common/efx_filter.c
  head/sys/dev/sfxge/common/siena_vpd.c

Modified: head/sys/dev/sfxge/common/ef10_ev.c
==
--- head/sys/dev/sfxge/common/ef10_ev.c Wed Dec 28 11:11:15 2016
(r310692)
+++ head/sys/dev/sfxge/common/ef10_ev.c Wed Dec 28 11:19:54 2016
(r310693)
@@ -990,7 +990,7 @@ ef10_ev_mcdi(
__in_optvoid *arg)
 {
efx_nic_t *enp = eep->ee_enp;
-   unsigned code;
+   unsigned int code;
boolean_t should_abort = B_FALSE;
 
EFX_EV_QSTAT_INCR(eep, EV_MCDI_RESPONSE);

Modified: head/sys/dev/sfxge/common/ef10_filter.c
==
--- head/sys/dev/sfxge/common/ef10_filter.c Wed Dec 28 11:11:15 2016
(r310692)
+++ head/sys/dev/sfxge/common/ef10_filter.c Wed Dec 28 11:19:54 2016
(r310693)
@@ -1246,7 +1246,7 @@ ef10_filter_reconfigure(
efx_nic_cfg_t *encp = &enp->en_nic_cfg;
ef10_filter_table_t *table = enp->en_filter.ef_ef10_filter_table;
efx_filter_flag_t filter_flags;
-   unsigned i;
+   unsigned int i;
efx_rc_t all_unicst_rc = 0;
efx_rc_t all_mulcst_rc = 0;
efx_rc_t rc;

Modified: head/sys/dev/sfxge/common/ef10_nvram.c
==
--- head/sys/dev/sfxge/common/ef10_nvram.c  Wed Dec 28 11:11:15 2016
(r310692)
+++ head/sys/dev/sfxge/common/ef10_nvram.c  Wed Dec 28 11:19:54 2016
(r310693)
@@ -772,7 +772,7 @@ ef10_nvram_buffer_create(
struct tlv_partition_header header;
struct tlv_partition_trailer trailer;
 
-   unsigned min_buf_size = sizeof (struct tlv_partition_header) +
+   unsigned int min_buf_size = sizeof (struct tlv_partition_header) +
sizeof (struct tlv_partition_trailer);
if (partn_size < min_buf_size) {
rc = EINVAL;

Modified: head/sys/dev/sfxge/common/efx_ev.c
==
--- head/sys/dev/sfxge/common/efx_ev.c  Wed Dec 28 11:11:15 2016
(r310692)
+++ head/sys/dev/sfxge/common/efx_ev.c  Wed Dec 28 11:19:54 2016
(r310693)
@@ -953,7 +953,7 @@ siena_ev_mcdi(
__in_optvoid *arg)
 {
efx_nic_t *enp = eep->ee_enp;
-   unsigned code;
+   unsigned int code;
boolean_t should_abort = B_FALSE;
 
EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_SIENA);

Modified: head/sys/dev/sfxge/common/efx_filter.c
==
--- head/sys/dev/sfxge/common/efx_filter.c  Wed Dec 28 11:11:15 2016
(r310692)
+++ head/sys/dev/sfxge/common/efx_filter.c  Wed Dec 28 11:19:54 2016
(r310693)
@@ -970,7 +970,7 @@ siena_filter_search(
__out   int *filter_index,
__out   unsigned int *depth_required)
 {
-   unsigned hash, incr, filter_idx, depth;
+   unsigned int hash, incr, filter_idx, depth;
 
hash = siena_filter_tbl_hash(key);
incr = siena_filter_tbl_increment(key);

Modified: head/sys/dev/sfxge/common/siena_vpd.c
==
--- head/sys/dev/sfxge/common/siena_vpd.c   Wed Dec 28 11:11:15 2016
(r310692)
+++ head/sys/dev/sfxge/common/siena_vpd.c   Wed Dec 28 11:19:54 2016
(r310693)
@@ -160,7 +160,7 @@ siena_vpd_init(
 {
efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
caddr_t svpd = NULL;
-   unsigned partn;
+   unsigned int partn;
size_t size = 0;
efx_rc_t rc;
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310694 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 28 11:25:17 2016
New Revision: 310694
URL: https://svnweb.freebsd.org/changeset/base/310694

Log:
  sfxge(4): cleanup: add missing spaces
  
  Found by DPDK checkpatch.sh
  
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days

Modified:
  head/sys/dev/sfxge/common/efx_impl.h
  head/sys/dev/sfxge/common/efx_mcdi.c
  head/sys/dev/sfxge/common/medford_nic.c

Modified: head/sys/dev/sfxge/common/efx_impl.h
==
--- head/sys/dev/sfxge/common/efx_impl.hWed Dec 28 11:19:54 2016
(r310693)
+++ head/sys/dev/sfxge/common/efx_impl.hWed Dec 28 11:25:17 2016
(r310694)
@@ -124,7 +124,7 @@ typedef struct efx_tx_ops_s {
void(*etxo_qenable)(efx_txq_t *);
efx_rc_t(*etxo_qpio_enable)(efx_txq_t *);
void(*etxo_qpio_disable)(efx_txq_t *);
-   efx_rc_t(*etxo_qpio_write)(efx_txq_t *,uint8_t *, size_t,
+   efx_rc_t(*etxo_qpio_write)(efx_txq_t *, uint8_t *, size_t,
   size_t);
efx_rc_t(*etxo_qpio_post)(efx_txq_t *, size_t, unsigned int,
   unsigned int *);
@@ -801,7 +801,7 @@ struct efx_txq_s {
 #else
 #defineEFX_CHECK_REG(_enp, _reg) do {  
\
_NOTE(CONSTANTCONDITION)\
-   } while(B_FALSE)
+   } while (B_FALSE)
 #endif
 
 #defineEFX_BAR_READD(_enp, _reg, _edp, _lock)  
\

Modified: head/sys/dev/sfxge/common/efx_mcdi.c
==
--- head/sys/dev/sfxge/common/efx_mcdi.cWed Dec 28 11:19:54 2016
(r310693)
+++ head/sys/dev/sfxge/common/efx_mcdi.cWed Dec 28 11:25:17 2016
(r310694)
@@ -1765,7 +1765,7 @@ efx_mcdi_mac_stats(
MAC_STATS_IN_PERIODIC_CHANGE, enable | events | disable,
MAC_STATS_IN_PERIODIC_ENABLE, enable | events,
MAC_STATS_IN_PERIODIC_NOEVENT, !events,
-   MAC_STATS_IN_PERIOD_MS, (enable | events) ? 1000: 0);
+   MAC_STATS_IN_PERIOD_MS, (enable | events) ? 1000 : 0);
 
if (esmp != NULL) {
int bytes = MC_CMD_MAC_NSTATS * sizeof (uint64_t);

Modified: head/sys/dev/sfxge/common/medford_nic.c
==
--- head/sys/dev/sfxge/common/medford_nic.c Wed Dec 28 11:19:54 2016
(r310693)
+++ head/sys/dev/sfxge/common/medford_nic.c Wed Dec 28 11:25:17 2016
(r310694)
@@ -66,7 +66,7 @@ efx_mcdi_get_rxdp_config(
/* RX DMA end padding is disabled */
end_padding = 0;
} else {
-   switch(MCDI_OUT_DWORD_FIELD(req, GET_RXDP_CONFIG_OUT_DATA,
+   switch (MCDI_OUT_DWORD_FIELD(req, GET_RXDP_CONFIG_OUT_DATA,
GET_RXDP_CONFIG_OUT_PAD_HOST_LEN)) {
case MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_64:
end_padding = 64;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310695 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 28 11:28:16 2016
New Revision: 310695
URL: https://svnweb.freebsd.org/changeset/base/310695

Log:
  sfxge(4): fix defined-but-not-used warning if neither VPD nor NVRAM opt 
enabled
  
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days

Modified:
  head/sys/dev/sfxge/common/siena_nic.c

Modified: head/sys/dev/sfxge/common/siena_nic.c
==
--- head/sys/dev/sfxge/common/siena_nic.c   Wed Dec 28 11:25:17 2016
(r310694)
+++ head/sys/dev/sfxge/common/siena_nic.c   Wed Dec 28 11:28:16 2016
(r310695)
@@ -37,6 +37,8 @@ __FBSDID("$FreeBSD$");
 
 #if EFSYS_OPT_SIENA
 
+#if EFSYS_OPT_VPD || EFSYS_OPT_NVRAM
+
 static __checkReturn   efx_rc_t
 siena_nic_get_partn_mask(
__inefx_nic_t *enp,
@@ -78,6 +80,8 @@ fail1:
return (rc);
 }
 
+#endif /* EFSYS_OPT_VPD || EFSYS_OPT_NVRAM */
+
 static __checkReturn   efx_rc_t
 siena_board_cfg(
__inefx_nic_t *enp)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310696 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 28 11:43:11 2016
New Revision: 310696
URL: https://svnweb.freebsd.org/changeset/base/310696

Log:
  sfxge(4): cleanup: improve prefast annotations
  
  Submitted by:   Andy Moreton 
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days

Modified:
  head/sys/dev/sfxge/common/ef10_impl.h
  head/sys/dev/sfxge/common/ef10_mcdi.c
  head/sys/dev/sfxge/common/siena_impl.h
  head/sys/dev/sfxge/common/siena_mcdi.c

Modified: head/sys/dev/sfxge/common/ef10_impl.h
==
--- head/sys/dev/sfxge/common/ef10_impl.h   Wed Dec 28 11:28:16 2016
(r310695)
+++ head/sys/dev/sfxge/common/ef10_impl.h   Wed Dec 28 11:43:11 2016
(r310696)
@@ -296,11 +296,11 @@ ef10_mcdi_fini(
 
 extern void
 ef10_mcdi_send_request(
-   __inefx_nic_t *enp,
-   __invoid *hdrp,
-   __insize_t hdr_len,
-   __invoid *sdup,
-   __insize_t sdu_len);
+   __inefx_nic_t *enp,
+   __in_bcount(hdr_len)void *hdrp,
+   __insize_t hdr_len,
+   __in_bcount(sdu_len)void *sdup,
+   __insize_t sdu_len);
 
 extern __checkReturn   boolean_t
 ef10_mcdi_poll_response(

Modified: head/sys/dev/sfxge/common/ef10_mcdi.c
==
--- head/sys/dev/sfxge/common/ef10_mcdi.c   Wed Dec 28 11:28:16 2016
(r310695)
+++ head/sys/dev/sfxge/common/ef10_mcdi.c   Wed Dec 28 11:43:11 2016
(r310696)
@@ -110,11 +110,11 @@ ef10_mcdi_fini(
 
void
 ef10_mcdi_send_request(
-   __inefx_nic_t *enp,
-   __invoid *hdrp,
-   __insize_t hdr_len,
-   __invoid *sdup,
-   __insize_t sdu_len)
+   __inefx_nic_t *enp,
+   __in_bcount(hdr_len)void *hdrp,
+   __insize_t hdr_len,
+   __in_bcount(sdu_len)void *sdup,
+   __insize_t sdu_len)
 {
const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp;
efsys_mem_t *esmp = emtp->emt_dma_mem;

Modified: head/sys/dev/sfxge/common/siena_impl.h
==
--- head/sys/dev/sfxge/common/siena_impl.h  Wed Dec 28 11:28:16 2016
(r310695)
+++ head/sys/dev/sfxge/common/siena_impl.h  Wed Dec 28 11:43:11 2016
(r310696)
@@ -96,11 +96,11 @@ siena_mcdi_init(
 
 extern void
 siena_mcdi_send_request(
-   __inefx_nic_t *enp,
-   __invoid *hdrp,
-   __insize_t hdr_len,
-   __invoid *sdup,
-   __insize_t sdu_len);
+   __inefx_nic_t *enp,
+   __in_bcount(hdr_len)void *hdrp,
+   __insize_t hdr_len,
+   __in_bcount(sdu_len)void *sdup,
+   __insize_t sdu_len);
 
 extern __checkReturn   boolean_t
 siena_mcdi_poll_response(

Modified: head/sys/dev/sfxge/common/siena_mcdi.c
==
--- head/sys/dev/sfxge/common/siena_mcdi.c  Wed Dec 28 11:28:16 2016
(r310695)
+++ head/sys/dev/sfxge/common/siena_mcdi.c  Wed Dec 28 11:43:11 2016
(r310696)
@@ -54,11 +54,11 @@ __FBSDID("$FreeBSD$");
 
void
 siena_mcdi_send_request(
-   __inefx_nic_t *enp,
-   __invoid *hdrp,
-   __insize_t hdr_len,
-   __invoid *sdup,
-   __insize_t sdu_len)
+   __inefx_nic_t *enp,
+   __in_bcount(hdr_len)void *hdrp,
+   __insize_t hdr_len,
+   __in_bcount(sdu_len)void *sdup,
+   __insize_t sdu_len)
 {
efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
efx_dword_t dword;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310698 - head/usr.bin/netstat

2016-12-28 Thread Marcelo Araujo
Author: araujo
Date: Wed Dec 28 13:11:22 2016
New Revision: 310698
URL: https://svnweb.freebsd.org/changeset/base/310698

Log:
  Print hostcache usage counts with TCP statistics.
  
  PR:   196252
  Submitted by: Anton Yuzhaninov 
  MFC after:3 weeks.

Modified:
  head/usr.bin/netstat/inet.c

Modified: head/usr.bin/netstat/inet.c
==
--- head/usr.bin/netstat/inet.c Wed Dec 28 12:23:16 2016(r310697)
+++ head/usr.bin/netstat/inet.c Wed Dec 28 13:11:22 2016(r310698)
@@ -751,6 +751,12 @@ tcp_stats(u_long off, const char *name, 
"{N:/ignored RSTs in the window%s}\n");
p(tcps_connects, "\t{:connections-established/%ju} "
"{N:/connection%s established (including accepts)}\n");
+   p(tcps_usedrtt, "\t\t{:connections-hostcache-rtt/%ju} "
+   "{N:/time%s used RTT from hostcache}\n");
+   p(tcps_usedrttvar, "\t\t{:connections-hostcache-rttvar/%ju} "
+   "{N:/time%s used RTT variance from hostcache}\n");
+   p(tcps_usedssthresh, "\t\t{:connections-hostcache-ssthresh/%ju} "
+   "{N:/time%s used slow-start threshold from hostcache}\n");
p2(tcps_closed, tcps_drops, "\t{:connections-closed/%ju} "
"{N:/connection%s closed (including} "
"{:connection-drops/%ju} {N:/drop%s})\n");
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310699 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 28 13:28:44 2016
New Revision: 310699
URL: https://svnweb.freebsd.org/changeset/base/310699

Log:
  sfxge(4): rename hunt_bist_* methods to ef10_bist_*
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days

Modified:
  head/sys/dev/sfxge/common/efx_phy.c
  head/sys/dev/sfxge/common/hunt_impl.h
  head/sys/dev/sfxge/common/hunt_phy.c

Modified: head/sys/dev/sfxge/common/efx_phy.c
==
--- head/sys/dev/sfxge/common/efx_phy.c Wed Dec 28 13:11:22 2016
(r310698)
+++ head/sys/dev/sfxge/common/efx_phy.c Wed Dec 28 13:28:44 2016
(r310699)
@@ -65,11 +65,10 @@ static const efx_phy_ops_t  __efx_phy_ef1
ef10_phy_stats_update,  /* epo_stats_update */
 #endif /* EFSYS_OPT_PHY_STATS */
 #if EFSYS_OPT_BIST
-   /* FIXME: Are these BIST methods appropriate for Medford? */
-   hunt_bist_enable_offline,   /* epo_bist_enable_offline */
-   hunt_bist_start,/* epo_bist_start */
-   hunt_bist_poll, /* epo_bist_poll */
-   hunt_bist_stop, /* epo_bist_stop */
+   ef10_bist_enable_offline,   /* epo_bist_enable_offline */
+   ef10_bist_start,/* epo_bist_start */
+   ef10_bist_poll, /* epo_bist_poll */
+   ef10_bist_stop, /* epo_bist_stop */
 #endif /* EFSYS_OPT_BIST */
 };
 #endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */

Modified: head/sys/dev/sfxge/common/hunt_impl.h
==
--- head/sys/dev/sfxge/common/hunt_impl.h   Wed Dec 28 13:11:22 2016
(r310698)
+++ head/sys/dev/sfxge/common/hunt_impl.h   Wed Dec 28 13:28:44 2016
(r310699)
@@ -75,16 +75,16 @@ hunt_board_cfg(
 #if EFSYS_OPT_BIST
 
 extern __checkReturn   efx_rc_t
-hunt_bist_enable_offline(
+ef10_bist_enable_offline(
__inefx_nic_t *enp);
 
 extern __checkReturn   efx_rc_t
-hunt_bist_start(
+ef10_bist_start(
__inefx_nic_t *enp,
__inefx_bist_type_t type);
 
 extern __checkReturn   efx_rc_t
-hunt_bist_poll(
+ef10_bist_poll(
__inefx_nic_t *enp,
__inefx_bist_type_t type,
__out   efx_bist_result_t *resultp,
@@ -95,7 +95,7 @@ hunt_bist_poll(
__insize_t count);
 
 extern void
-hunt_bist_stop(
+ef10_bist_stop(
__inefx_nic_t *enp,
__inefx_bist_type_t type);
 

Modified: head/sys/dev/sfxge/common/hunt_phy.c
==
--- head/sys/dev/sfxge/common/hunt_phy.cWed Dec 28 13:11:22 2016
(r310698)
+++ head/sys/dev/sfxge/common/hunt_phy.cWed Dec 28 13:28:44 2016
(r310699)
@@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$");
 #if EFSYS_OPT_BIST
 
__checkReturn   efx_rc_t
-hunt_bist_enable_offline(
+ef10_bist_enable_offline(
__inefx_nic_t *enp)
 {
efx_rc_t rc;
@@ -56,7 +56,7 @@ fail1:
 }
 
__checkReturn   efx_rc_t
-hunt_bist_start(
+ef10_bist_start(
__inefx_nic_t *enp,
__inefx_bist_type_t type)
 {
@@ -74,7 +74,7 @@ fail1:
 }
 
__checkReturn   efx_rc_t
-hunt_bist_poll(
+ef10_bist_poll(
__inefx_nic_t *enp,
__inefx_bist_type_t type,
__out   efx_bist_result_t *resultp,
@@ -179,11 +179,11 @@ fail1:
 }
 
void
-hunt_bist_stop(
+ef10_bist_stop(
__inefx_nic_t *enp,
__inefx_bist_type_t type)
 {
-   /* There is no way to stop BIST on Huntinton. */
+   /* There is no way to stop BIST on EF10. */
_NOTE(ARGUNUSED(enp, type))
 }
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r310650 - in head/sys/mips: include mips

2016-12-28 Thread Alexander Kabaev
On Tue, 27 Dec 2016 21:50:32 -0800
Adrian Chadd  wrote:

> hiya,
> 
> so I dug into the mips24k definition of this. It says this:
> 
> "
> 3.4.3 Uncached accelerated writes
> The 24K core permits memory regions to be marked as "uncached
> accelerated". This type of region is useful to hard-
> ware which is "write only" - perhaps video frame buffers, or some
> other hardware stream. Sequential word stores in
> such regions are gathered into cache-line-sized chunks, before being
> written with a single burst cycle on the CPU
> interface.
> Such regions are uncached for read, and partial-word or
> out-of-sequence writes have "unpredictable" effects - don't
> do them. The burst write is normally performed when software writes to
> the last location in the memory block or does
> an uncached-accelerated write to some other block; but it can also be
> triggered by a
> sync instruction, a pref nudge, a matching load or any exception. If
> the block is not completely written by the time it's pushed out, it
> will be written using a series of doubleword or smaller write cycles
> over the 24K core's 64-bit memory interface.
> "
> 
> So, question is - is our write combining page attribute in the VM
> suitable for this? Is it defined as "only do full sequential word
> writes"? Or do we risk having some other platform use it in a less
> "don't do this" way and then MIPS is the one at fault again? :)
> 
> 
> -adrian
> 
> 

FWIW, this is more or less standard verbiage for memory mapped devices
and devices is where one would expect framebuffer to reside, so I would
not read too much into it. I committed change that does not map UA to
WC unconditionally and will let people who need write combining to
enable it on a case by case basis. For now, only Ingenic XBursts are
doing so as these are ones I have tested.


-- 
Alexander Kabaev


pgp4owHqbim3S.pgp
Description: Цифровая подпись OpenPGP


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

2016-12-28 Thread Alexander Kabaev
Author: kan
Date: Wed Dec 28 13:48:00 2016
New Revision: 310700
URL: https://svnweb.freebsd.org/changeset/base/310700

Log:
  Be more conservative when enabling write-combining on MIPS
  
  Some MIPS revisions do implement uncached-accelerate caching
  attribute, but place extra requirement on access, such as
  partial-word or out-of-sequence writes potentially having an
  “unpredictable” effects.

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

Modified: head/sys/mips/include/cpuregs.h
==
--- head/sys/mips/include/cpuregs.h Wed Dec 28 13:28:44 2016
(r310699)
+++ head/sys/mips/include/cpuregs.h Wed Dec 28 13:48:00 2016
(r310700)
@@ -173,6 +173,7 @@
 
 #if defined(CPU_XBURST)
 #defineMIPS_CCA_UA 0x01
+#defineMIPS_CCA_WC MIPS_CCA_UA
 #endif
 
 #ifndefMIPS_CCA_UNCACHED
@@ -192,16 +193,6 @@
 #endif
 #endif
 
-/*
- * Use uncached-accelerated mode for write-combining maps, if one is defined,
- * otherwise fall back to uncached
- */
-#ifndef MIPS_CCA_WC
-#ifdef MIPS_CCA_UA
-#defineMIPS_CCA_WC MIPS_CCA_UA
-#endif
-#endif
-
 #defineMIPS_PHYS_TO_XKPHYS(cca,x) \
((0x2ULL << 62) | ((unsigned long long)(cca) << 59) | (x))
 #defineMIPS_PHYS_TO_XKPHYS_CACHED(x) \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

svn commit: r310701 - head/sys/dev/altera/atse

2016-12-28 Thread Ruslan Bukin
Author: br
Date: Wed Dec 28 14:10:33 2016
New Revision: 310701
URL: https://svnweb.freebsd.org/changeset/base/310701

Log:
  o Fix style.
  o Remove set but not used variable.
  
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/dev/altera/atse/if_atse.c

Modified: head/sys/dev/altera/atse/if_atse.c
==
--- head/sys/dev/altera/atse/if_atse.c  Wed Dec 28 13:48:00 2016
(r310700)
+++ head/sys/dev/altera/atse/if_atse.c  Wed Dec 28 14:10:33 2016
(r310701)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2012,2013 Bjoern A. Zeeb
+ * Copyright (c) 2012, 2013 Bjoern A. Zeeb
  * Copyright (c) 2014 Robert N. M. Watson
  * All rights reserved.
  *
@@ -135,6 +135,7 @@ a_onchip_fifo_mem_core_write(struct reso
DPRINTF("[%s:%d] FIFOW %s 0x%08x = 0x%08x\n", f, l, desc, off, val4);
bus_write_4(res, off, val4);
 }
+
 static inline uint32_t
 a_onchip_fifo_mem_core_read(struct resource *res, uint32_t off,
 const char *desc, const char *f, const int l)
@@ -143,6 +144,7 @@ a_onchip_fifo_mem_core_read(struct resou
 
val4 = le32toh(bus_read_4(res, off));
DPRINTF("[%s:%d] FIFOR %s 0x%08x = 0x%08x\n", f, l, desc, off, val4);
+
return (val4);
 }
 
@@ -285,6 +287,7 @@ csr_read_4(struct atse_softc *sc, uint32
val4 = le32toh(bus_read_4(sc->atse_mem_res, reg * 4));
DPRINTF("[%s:%d] CSR R %s 0x%08x (0x%08x) = 0x%08x\n", f, l, 
"atse_mem_res", reg, reg * 4, val4);
+
return (val4);
 }
 
@@ -315,6 +318,7 @@ pxx_read_2(struct atse_softc *sc, bus_ad
val = le32toh(val4) & 0x;
DPRINTF("[%s:%d] %s R %s 0x%08x (0x%08jx) = 0x%04x\n", f, l, s,
"atse_mem_res", reg, (bmcr + reg) * 4, val);
+
return (val);
 }
 
@@ -343,6 +347,7 @@ atse_tx_locked(struct atse_softc *sc, in
 {
struct mbuf *m;
uint32_t val4, fill_level;
+   int leftm;
int c;
 
ATSE_LOCK_ASSERT(sc);
@@ -393,15 +398,13 @@ atse_tx_locked(struct atse_softc *sc, in
/* Set EOP *before* writing the last symbol. */
if (sc->atse_tx_m_offset >= (sc->atse_tx_buf_len - 4) &&
fill_level < AVALON_FIFO_TX_BASIC_OPTS_DEPTH) {
-   int leftm;
-   uint32_t x;
 
/* Set EndOfPacket. */
val4 = A_ONCHIP_FIFO_MEM_CORE_EOP;
+
/* Set EMPTY. */
leftm = sc->atse_tx_buf_len - sc->atse_tx_m_offset;
val4 |= ((4 - leftm) << A_ONCHIP_FIFO_MEM_CORE_EMPTY_SHIFT);
-   x = val4;
ATSE_TX_META_WRITE(sc, val4);
 
/* Write last symbol. */
@@ -440,7 +443,7 @@ atse_start_locked(struct ifnet *ifp)
return;
 
 #if 1
-   /* 
+   /*
 * Disable the watchdog while sending, we are batching packets.
 * Though we should never reach 5 seconds, and are holding the lock,
 * but who knows.
@@ -485,8 +488,8 @@ atse_start(struct ifnet *ifp)
 static int
 atse_stop_locked(struct atse_softc *sc)
 {
-   struct ifnet *ifp;
uint32_t mask, val4;
+   struct ifnet *ifp;
int i;
 
ATSE_LOCK_ASSERT(sc);
@@ -527,8 +530,8 @@ atse_stop_locked(struct atse_softc *sc)
 static uint8_t
 atse_mchash(struct atse_softc *sc __unused, const uint8_t *addr)
 {
-   int i, j;
uint8_t x, y;
+   int i, j;
 
x = 0;
for (i = 0; i < ETHER_ADDR_LEN; i++) {
@@ -537,14 +540,15 @@ atse_mchash(struct atse_softc *sc __unus
y ^= (addr[i] >> j) & 0x01;
x |= (y << i);
}
+
return (x);
 }
 
 static int
 atse_rxfilter_locked(struct atse_softc *sc)
 {
-   struct ifnet *ifp;
struct ifmultiaddr *ifma;
+   struct ifnet *ifp;
uint32_t val4;
int i;
 
@@ -567,7 +571,7 @@ atse_rxfilter_locked(struct atse_softc *
for (i = 0; i <= MHASH_LEN; i++)
CSR_WRITE_4(sc, MHASH_START + i, 0x1);
} else {
-   /* 
+   /*
 * Can hold MHASH_LEN entries.
 * XXX-BZ bitstring.h would be more general.
 */
@@ -634,8 +638,9 @@ atse_ethernet_option_bits_read(device_t 
error = atse_ethernet_option_bits_read_fdt(dev);
if (error == 0)
return (0);
-   
+
device_printf(dev, "Cannot read Ethernet addresses from flash.\n");
+
return (error);
 }
 
@@ -789,9 +794,9 @@ atse_set_eth_address(struct atse_softc *
 static int
 atse_reset(struct atse_softc *sc)
 {
-   int i;
uint32_t val4, mask;
uint16_t val;
+   int i;
 
/* 1. External PHY Initialization using MDIO. */
/*
@@ -820,6 +825,7 @@ atse_reset(struct atse_softc *sc)
val = PCS_READ_2(sc, PCS_CONTROL);
val |= PCS_CONTROL_RESET;
PCS_WRITE_2(sc, PCS_CONTROL, val);
+
/* Wait for reset bit to clear; i=100 is excessive. */
for (i = 0

svn commit: r310702 - head/sys/boot/i386/btx/btxldr

2016-12-28 Thread Ed Maste
Author: emaste
Date: Wed Dec 28 14:25:04 2016
New Revision: 310702
URL: https://svnweb.freebsd.org/changeset/base/310702

Log:
  btxldr: process all PT_LOAD segments, not just the first two
  
  With default settings GNU ld generates two PT_LOADs for loader.sym while
  LLD generates three, because it creates a rodata segment. Previously
  btxldr terminated phdr processing after two PT_LOADs. Remove the early
  termination to process all PT_LOADs.
  
  Reviewed by:  kib, tsoome
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D8929

Modified:
  head/sys/boot/i386/btx/btxldr/btxldr.S

Modified: head/sys/boot/i386/btx/btxldr/btxldr.S
==
--- head/sys/boot/i386/btx/btxldr/btxldr.S  Wed Dec 28 14:10:33 2016
(r310701)
+++ head/sys/boot/i386/btx/btxldr/btxldr.S  Wed Dec 28 14:25:04 2016
(r310702)
@@ -198,7 +198,6 @@ start.3:
call putstr #  message
movl $m_segs,%esi   # Format string
 #endif
-   movl $0x2,%edi  # Segment count
movl 0x1c(%ebx),%edx# Get e_phoff
addl %ebx,%edx  # To pointer
movzwl 0x2c(%ebx),%ecx  # Get e_phnum
@@ -216,8 +215,7 @@ start.4:cmpl $0x1,(%edx)# Is p_type P
call putstr # End message
 #endif
pushl %esi  # Save
-   pushl %edi  #  working
-   pushl %ecx  #  registers
+   pushl %ecx  #  working registers
movl 0x4(%edx),%esi # Get p_offset
addl %ebx,%esi  #  as pointer
movl 0x8(%edx),%edi # Get p_vaddr
@@ -232,13 +230,9 @@ start.4:   cmpl $0x1,(%edx)# Is p_type P
rep #  zero
stosb   #  them
 start.5:   popl %ecx   # Restore
-   popl %edi   #  working
popl %esi   #  registers
-   decl %edi   # Segments to do
-   je start.7  # If none
 start.6:   addl $0x20,%edx # To next entry
loop start.4# Till done
-start.7:
 #ifdef BTXLDR_VERBOSE
movl $m_done,%esi   # Display done
call putstr #  message
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310703 - head/sys/dev/isci

2016-12-28 Thread Alexander Motin
Author: mav
Date: Wed Dec 28 14:50:39 2016
New Revision: 310703
URL: https://svnweb.freebsd.org/changeset/base/310703

Log:
  Pass proper arguments (handles, not directly structure pointers) to
  scif_cb_domain_device_removed().
  
  This should fix NULL dereference on task management function timeout.
  
  Reviewed by:  jimharris
  MFC after:2 weeks

Modified:
  head/sys/dev/isci/isci_task_request.c

Modified: head/sys/dev/isci/isci_task_request.c
==
--- head/sys/dev/isci/isci_task_request.c   Wed Dec 28 14:25:04 2016
(r310702)
+++ head/sys/dev/isci/isci_task_request.c   Wed Dec 28 14:50:39 2016
(r310703)
@@ -210,8 +210,9 @@ isci_task_request_complete(SCI_CONTROLLE
retry_task = FALSE;
isci_log_message(0, "ISCI",
"task timeout - not retrying\n");
-   scif_cb_domain_device_removed(isci_controller,
-   isci_remote_device->domain, isci_remote_device);
+   scif_cb_domain_device_removed(scif_controller,
+   isci_remote_device->domain->sci_object,
+   remote_device);
} else {
retry_task = TRUE;
isci_log_message(0, "ISCI",
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310704 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 28 15:24:44 2016
New Revision: 310704
URL: https://svnweb.freebsd.org/changeset/base/310704

Log:
  sfxge(4): translate MC_CMD_ERR_ERANGE to host errno value
  
  This is needed because MCDI command MC_CMD_REKEY can return
  MC_CMD_ERR_ERANGE.
  
  Submitted by:   Tom Millington 
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days

Modified:
  head/sys/dev/sfxge/common/efx_mcdi.c

Modified: head/sys/dev/sfxge/common/efx_mcdi.c
==
--- head/sys/dev/sfxge/common/efx_mcdi.cWed Dec 28 14:50:39 2016
(r310703)
+++ head/sys/dev/sfxge/common/efx_mcdi.cWed Dec 28 15:24:44 2016
(r310704)
@@ -646,6 +646,8 @@ efx_mcdi_request_errcode(
case MC_CMD_ERR_ENOSPC:
return (ENOSPC);
 #endif
+   case MC_CMD_ERR_ERANGE:
+   return (ERANGE);
 
case MC_CMD_ERR_ALLOC_FAIL:
return (ENOMEM);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310705 - head/sys/fs/ext2fs

2016-12-28 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Dec 28 15:43:17 2016
New Revision: 310705
URL: https://svnweb.freebsd.org/changeset/base/310705

Log:
  style(9) cleanups.
  
  Just to reduce some of the issues found with indent(1).
  
  MFC after:1 week

Modified:
  head/sys/fs/ext2fs/ext2_alloc.c
  head/sys/fs/ext2fs/ext2_balloc.c
  head/sys/fs/ext2fs/ext2_bmap.c
  head/sys/fs/ext2fs/ext2_dir.h
  head/sys/fs/ext2fs/ext2_extents.c
  head/sys/fs/ext2fs/ext2_extents.h
  head/sys/fs/ext2fs/ext2_extern.h
  head/sys/fs/ext2fs/ext2_hash.c
  head/sys/fs/ext2fs/ext2_htree.c
  head/sys/fs/ext2fs/ext2_inode.c
  head/sys/fs/ext2fs/ext2_inode_cnv.c
  head/sys/fs/ext2fs/ext2_lookup.c
  head/sys/fs/ext2fs/ext2_mount.h
  head/sys/fs/ext2fs/ext2_subr.c
  head/sys/fs/ext2fs/ext2_vfsops.c
  head/sys/fs/ext2fs/ext2_vnops.c
  head/sys/fs/ext2fs/ext2fs.h
  head/sys/fs/ext2fs/fs.h
  head/sys/fs/ext2fs/htree.h
  head/sys/fs/ext2fs/inode.h

Modified: head/sys/fs/ext2fs/ext2_alloc.c
==
--- head/sys/fs/ext2fs/ext2_alloc.c Wed Dec 28 15:24:44 2016
(r310704)
+++ head/sys/fs/ext2fs/ext2_alloc.c Wed Dec 28 15:43:17 2016
(r310705)
@@ -81,12 +81,13 @@ static daddr_t  ext2_mapsearch(struct m_
  */
 int
 ext2_alloc(struct inode *ip, daddr_t lbn, e4fs_daddr_t bpref, int size,
-struct ucred *cred, e4fs_daddr_t *bnp)
+struct ucred *cred, e4fs_daddr_t *bnp)
 {
struct m_ext2fs *fs;
struct ext2mount *ump;
int32_t bno;
-   int cg; 
+   int cg;
+
*bnp = 0;
fs = ip->i_e2fs;
ump = ip->i_ump;
@@ -99,11 +100,11 @@ ext2_alloc(struct inode *ip, daddr_t lbn
}
if (cred == NOCRED)
panic("ext2_alloc: missing credential");
-#endif /* INVARIANTS */
+#endif /* INVARIANTS */
if (size == fs->e2fs_bsize && fs->e2fs->e2fs_fbcount == 0)
goto nospace;
-   if (cred->cr_uid != 0 && 
-   fs->e2fs->e2fs_fbcount < fs->e2fs->e2fs_rbcount)
+   if (cred->cr_uid != 0 &&
+   fs->e2fs->e2fs_fbcount < fs->e2fs->e2fs_rbcount)
goto nospace;
if (bpref >= fs->e2fs->e2fs_bcount)
bpref = 0;
@@ -112,7 +113,7 @@ ext2_alloc(struct inode *ip, daddr_t lbn
else
cg = dtog(fs, bpref);
bno = (daddr_t)ext2_hashalloc(ip, cg, bpref, fs->e2fs_bsize,
- ext2_alloccg);
+   ext2_alloccg);
if (bno > 0) {
/* set next_alloc fields as done in block_getblk */
ip->i_next_alloc_block = lbn;
@@ -148,10 +149,12 @@ nospace:
 static SYSCTL_NODE(_vfs, OID_AUTO, ext2fs, CTLFLAG_RW, 0, "EXT2FS filesystem");
 
 static int doasyncfree = 1;
+
 SYSCTL_INT(_vfs_ext2fs, OID_AUTO, doasyncfree, CTLFLAG_RW, &doasyncfree, 0,
 "Use asychronous writes to update block pointers when freeing blocks");
 
 static int doreallocblks = 1;
+
 SYSCTL_INT(_vfs_ext2fs, OID_AUTO, doreallocblks, CTLFLAG_RW, &doreallocblks, 
0, "");
 
 int
@@ -171,7 +174,7 @@ ext2_reallocblks(struct vop_reallocblks_
int i, len, start_lvl, end_lvl, pref, ssize;
 
if (doreallocblks == 0)
- return (ENOSPC);
+   return (ENOSPC);
 
vp = ap->a_vp;
ip = VTOI(vp);
@@ -236,7 +239,7 @@ ext2_reallocblks(struct vop_reallocblks_
ssize = len;
} else {
 #ifdef INVARIANTS
-   if (start_ap[start_lvl-1].in_lbn == idp->in_lbn)
+   if (start_ap[start_lvl - 1].in_lbn == idp->in_lbn)
panic("ext2_reallocblks: start == end");
 #endif
ssize = len - (idp->in_off + 1);
@@ -253,10 +256,10 @@ ext2_reallocblks(struct vop_reallocblks_
 * Search the block map looking for an allocation of the desired size.
 */
if ((newblk = (e2fs_daddr_t)ext2_hashalloc(ip, dtog(fs, pref), pref,
-   len, ext2_clusteralloc)) == 0){
+   len, ext2_clusteralloc)) == 0) {
EXT2_UNLOCK(ump);
goto fail;
-   }   
+   }
/*
 * We have found a new contiguous block.
 *
@@ -267,7 +270,7 @@ ext2_reallocblks(struct vop_reallocblks_
 #ifdef DEBUG
printf("realloc: ino %ju, lbns %jd-%jd\n\told:",
(uintmax_t)ip->i_number, (intmax_t)start_lbn, (intmax_t)end_lbn);
-#endif /* DEBUG */
+#endif /* DEBUG */
blkno = newblk;
for (bap = &sbap[soff], i = 0; i < len; i++, blkno += fs->e2fs_fpb) {
if (i == ssize) {
@@ -279,15 +282,15 @@ ext2_reallocblks(struct vop_reallocblks_
panic("ext2_reallocblks: alloc mismatch");
 #endif
 #ifdef DEBUG
-   printf(" %d,", *bap);
-#endif /* DEBUG */
+   printf(" %d,", *bap);
+#endif /* DEBUG */
*bap++ = blkno;
}
/*
 * Next we must write out the modified inode and indirect blocks.
 * For strict correctness, the writes should

Re: svn commit: r310705 - head/sys/fs/ext2fs

2016-12-28 Thread Konstantin Belousov
On Wed, Dec 28, 2016 at 03:43:17PM +, Pedro F. Giffuni wrote:
> Author: pfg
> Date: Wed Dec 28 15:43:17 2016
> New Revision: 310705
> URL: https://svnweb.freebsd.org/changeset/base/310705
> 
> Log:
>   style(9) cleanups.
>   
>   Just to reduce some of the issues found with indent(1).
>   
> @@ -81,12 +81,13 @@ static daddr_t  ext2_mapsearch(struct m_
>   */
>  int
>  ext2_alloc(struct inode *ip, daddr_t lbn, e4fs_daddr_t bpref, int size,
> -struct ucred *cred, e4fs_daddr_t *bnp)
> +struct ucred *cred, e4fs_daddr_t *bnp)
This is wrong.  Indent of the continuation line should be 4 spaces.

>  {
>   struct m_ext2fs *fs;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r310705 - head/sys/fs/ext2fs

2016-12-28 Thread Pedro Giffuni



On 12/28/16 10:57, Konstantin Belousov wrote:

On Wed, Dec 28, 2016 at 03:43:17PM +, Pedro F. Giffuni wrote:

Author: pfg
Date: Wed Dec 28 15:43:17 2016
New Revision: 310705
URL: https://svnweb.freebsd.org/changeset/base/310705

Log:
  style(9) cleanups.

  Just to reduce some of the issues found with indent(1).

@@ -81,12 +81,13 @@ static daddr_t  ext2_mapsearch(struct m_
  */
 int
 ext2_alloc(struct inode *ip, daddr_t lbn, e4fs_daddr_t bpref, int size,
-struct ucred *cred, e4fs_daddr_t *bnp)
+struct ucred *cred, e4fs_daddr_t *bnp)

This is wrong.  Indent of the continuation line should be 4 spaces.


 {
struct m_ext2fs *fs;




Thanks, it's easy to miss such cases :(.

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


svn commit: r310706 - head/sys/fs/ext2fs

2016-12-28 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Dec 28 16:16:36 2016
New Revision: 310706
URL: https://svnweb.freebsd.org/changeset/base/310706

Log:
  Undo small wrong style change.
  
  Reported by:  kib

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

Modified: head/sys/fs/ext2fs/ext2_alloc.c
==
--- head/sys/fs/ext2fs/ext2_alloc.c Wed Dec 28 15:43:17 2016
(r310705)
+++ head/sys/fs/ext2fs/ext2_alloc.c Wed Dec 28 16:16:36 2016
(r310706)
@@ -81,7 +81,7 @@ static daddr_t  ext2_mapsearch(struct m_
  */
 int
 ext2_alloc(struct inode *ip, daddr_t lbn, e4fs_daddr_t bpref, int size,
-struct ucred *cred, e4fs_daddr_t *bnp)
+struct ucred *cred, e4fs_daddr_t *bnp)
 {
struct m_ext2fs *fs;
struct ext2mount *ump;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310707 - head/sbin/pfctl

2016-12-28 Thread Luiz Otavio O Souza
Author: loos
Date: Wed Dec 28 16:16:48 2016
New Revision: 310707
URL: https://svnweb.freebsd.org/changeset/base/310707

Log:
  Fix the parsing of NPt binat rules.
  
  In this specific case the src address can be set to any, which was not
  accepted prior to this commit.
  
  pfSense bug report:   https://redmine.pfsense.org/issues/6985
  Reviewed by:  kp
  Obtained from:pfSense
  MFC after:2 weeks
  Sponsored by: Rubicon Communications, LLC (Netgate)

Modified:
  head/sbin/pfctl/parse.y

Modified: head/sbin/pfctl/parse.y
==
--- head/sbin/pfctl/parse.y Wed Dec 28 16:16:36 2016(r310706)
+++ head/sbin/pfctl/parse.y Wed Dec 28 16:16:48 2016(r310707)
@@ -4195,7 +4195,7 @@ natrule   : nataction interface af proto 
}
;
 
-binatrule  : no BINAT natpasslog interface af proto FROM host toipspec tag
+binatrule  : no BINAT natpasslog interface af proto FROM ipspec toipspec 
tag
tagged rtable redirection
{
struct pf_rule  binat;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310708 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 28 16:21:46 2016
New Revision: 310708
URL: https://svnweb.freebsd.org/changeset/base/310708

Log:
  sfxge(4): do not initialize enumerated type variable to another type
  
  Fix build warning generated by ICC.
  
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days

Modified:
  head/sys/dev/sfxge/common/efx_nic.c

Modified: head/sys/dev/sfxge/common/efx_nic.c
==
--- head/sys/dev/sfxge/common/efx_nic.c Wed Dec 28 16:16:48 2016
(r310707)
+++ head/sys/dev/sfxge/common/efx_nic.c Wed Dec 28 16:21:46 2016
(r310708)
@@ -556,7 +556,7 @@ efx_nic_destroy(
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, ==, 0);
 
-   enp->en_family = 0;
+   enp->en_family = EFX_FAMILY_INVALID;
enp->en_esip = NULL;
enp->en_esbp = NULL;
enp->en_eslp = NULL;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310709 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 28 16:28:09 2016
New Revision: 310709
URL: https://svnweb.freebsd.org/changeset/base/310709

Log:
  sfxge(4): fix invalid type of eft_unicst_filter_count
  
  Found by clang when boolean_t is defined as bool for DPDK PMD.
  
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days

Modified:
  head/sys/dev/sfxge/common/ef10_impl.h

Modified: head/sys/dev/sfxge/common/ef10_impl.h
==
--- head/sys/dev/sfxge/common/ef10_impl.h   Wed Dec 28 16:21:46 2016
(r310708)
+++ head/sys/dev/sfxge/common/ef10_impl.h   Wed Dec 28 16:28:09 2016
(r310709)
@@ -954,7 +954,7 @@ typedef struct ef10_filter_table_s {
boolean_t   eft_using_rss;
uint32_teft_unicst_filter_indexes[
EFX_EF10_FILTER_UNICAST_FILTERS_MAX];
-   boolean_t   eft_unicst_filter_count;
+   uint32_teft_unicst_filter_count;
uint32_teft_mulcst_filter_indexes[
EFX_EF10_FILTER_MULTICAST_FILTERS_MAX];
uint32_teft_mulcst_filter_count;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310711 - head/usr.sbin/bsnmpd/bsnmpd

2016-12-28 Thread Ngie Cooper
Author: ngie
Date: Wed Dec 28 16:34:49 2016
New Revision: 310711
URL: https://svnweb.freebsd.org/changeset/base/310711

Log:
  Don't explicitly build tcp wrappers support into bsnmpd; make it conditional
  on MK_TCP_WRAPPERS != "no"
  
  This likely fixes an issue seen where some of the USE_TCPWRAPPERS code didn't
  work as advertised
  
  MFC after:1 week

Modified:
  head/usr.sbin/bsnmpd/bsnmpd/Makefile

Modified: head/usr.sbin/bsnmpd/bsnmpd/Makefile
==
--- head/usr.sbin/bsnmpd/bsnmpd/MakefileWed Dec 28 16:30:08 2016
(r310710)
+++ head/usr.sbin/bsnmpd/bsnmpd/MakefileWed Dec 28 16:34:49 2016
(r310711)
@@ -125,9 +125,8 @@ DEFSDIR= ${SHAREDIR}/snmp/defs
 
 CFLAGS+= -DSNMPTREE_TYPES
 CFLAGS+= -I${CONTRIB}/lib -I${CONTRIB}/snmpd -I. -DUSE_LIBBEGEMOT
-CFLAGS+= -DUSE_TCPWRAPPERS
 CFLAGS+= -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DHAVE_ERR_H -DHAVE_STRLCPY
-LIBADD=begemot bsnmp wrap
+LIBADD=begemot bsnmp
 
 LDFLAGS= -Wl,-export-dynamic
 
@@ -135,6 +134,11 @@ LDFLAGS= -Wl,-export-dynamic
 CFLAGS+= -DHAVE_LIBCRYPTO
 .endif
 
+.if ${MK_TCP_WRAPPERS} != "no"
+CFLAGS+=   -DUSE_TCPWRAPPERS
+LIBADD+=   wrap
+.endif
+
 oid.h: tree.def Makefile
gensnmptree -e ${XSYM} < ${.ALLSRC:M*.def} > ${.TARGET}
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310712 - head/usr.bin/sort

2016-12-28 Thread Marius Strobl
Author: marius
Date: Wed Dec 28 17:13:03 2016
New Revision: 310712
URL: https://svnweb.freebsd.org/changeset/base/310712

Log:
  - Use correct offsets into the keys set array. As the elements of this
zero-length array are dynamically sized at run-time based on the use
of hints, compilers can't be expected to figure out these offsets on
their own. [1]
  - Fix incorrect comparison in cmp_nans(). [2]
  
  PR:   204571 [1], 202301 [2]
  Submitted by: David Binderman [2]
  MFC after:3 days

Modified:
  head/usr.bin/sort/coll.c
  head/usr.bin/sort/coll.h
  head/usr.bin/sort/radixsort.c

Modified: head/usr.bin/sort/coll.c
==
--- head/usr.bin/sort/coll.cWed Dec 28 16:34:49 2016(r310711)
+++ head/usr.bin/sort/coll.cWed Dec 28 17:13:03 2016(r310712)
@@ -105,14 +105,29 @@ clean_keys_array(const struct bwstring *
 {
 
if (ka) {
-   for (size_t i = 0; i < keys_num; ++i)
-   if (ka->key[i].k && ka->key[i].k != s)
-   bwsfree(ka->key[i].k);
+   for (size_t i = 0; i < keys_num; ++i) {
+   const struct key_value *kv;
+
+   kv = get_key_from_keys_array(ka, i);
+   if (kv->k && kv->k != s)
+   bwsfree(kv->k);
+   }
memset(ka, 0, keys_array_size());
}
 }
 
 /*
+ * Get pointer to a key value in the keys set
+ */
+struct key_value *
+get_key_from_keys_array(struct keys_array *ka, size_t ind)
+{
+
+   return ((struct key_value *)((caddr_t)ka->key +
+   ind * (sizeof(struct key_value) + key_hint_size(;
+}
+
+/*
  * Set value of a key in the keys set
  */
 void
@@ -122,7 +137,7 @@ set_key_on_keys_array(struct keys_array 
if (ka && keys_num > ind) {
struct key_value *kv;
 
-   kv = &(ka->key[ind]);
+   kv = get_key_from_keys_array(ka, ind);
 
if (kv->k && kv->k != s)
bwsfree(kv->k);
@@ -156,9 +171,9 @@ sort_list_item_size(struct sort_list_ite
if (si->str)
ret += bws_memsize(si->str);
for (size_t i = 0; i < keys_num; ++i) {
-   struct key_value *kv;
+   const struct key_value *kv;
 
-   kv = &(si->ka.key[i]);
+   kv = get_key_from_keys_array(&si->ka, i);
 
if (kv->k != si->str)
ret += bws_memsize(kv->k);
@@ -475,16 +490,19 @@ get_sort_func(struct sort_mods *sm)
 int
 key_coll(struct keys_array *ps1, struct keys_array *ps2, size_t offset)
 {
+   struct key_value *kv1, *kv2;
struct sort_mods *sm;
int res = 0;
 
for (size_t i = 0; i < keys_num; ++i) {
+   kv1 = get_key_from_keys_array(ps1, i);
+   kv2 = get_key_from_keys_array(ps2, i);
sm = &(keys[i].sm);
 
if (sm->rflag)
-   res = sm->func(&(ps2->key[i]), &(ps1->key[i]), offset);
+   res = sm->func(kv2, kv1, offset);
else
-   res = sm->func(&(ps1->key[i]), &(ps2->key[i]), offset);
+   res = sm->func(kv1, kv2, offset);
 
if (res)
break;
@@ -1087,7 +1105,7 @@ cmp_nans(double d1, double d2)
 
if (d1 < d2)
return (-1);
-   if (d2 > d2)
+   if (d1 > d2)
return (+1);
return (0);
 }

Modified: head/usr.bin/sort/coll.h
==
--- head/usr.bin/sort/coll.hWed Dec 28 16:34:49 2016(r310711)
+++ head/usr.bin/sort/coll.hWed Dec 28 17:13:03 2016(r310712)
@@ -91,7 +91,7 @@ struct key_value
 {
struct bwstring *k; /* key string */
struct key_hint  hint[0]; /* key sort hint */
-};
+} __packed;
 
 /*
  * Set of keys container object.
@@ -146,6 +146,7 @@ cmpcoll_t get_sort_func(struct sort_mods
 
 struct keys_array *keys_array_alloc(void);
 size_t keys_array_size(void);
+struct key_value *get_key_from_keys_array(struct keys_array *ka, size_t ind);
 void set_key_on_keys_array(struct keys_array *ka, struct bwstring *s, size_t 
ind);
 void clean_keys_array(const struct bwstring *s, struct keys_array *ka);
 

Modified: head/usr.bin/sort/radixsort.c
==
--- head/usr.bin/sort/radixsort.c   Wed Dec 28 16:34:49 2016
(r310711)
+++ head/usr.bin/sort/radixsort.c   Wed Dec 28 17:13:03 2016
(r310712)
@@ -243,9 +243,11 @@ add_leaf(struct sort_level *sl, struct s
 static inline int
 get_wc_index(struct sort_list_item *sli, size_t level)
 {
+   const struct key_value *kv;
const struct bwstring *bws;
 
- 

Re: svn commit: r310650 - in head/sys/mips: include mips

2016-12-28 Thread John Baldwin
On Tuesday, December 27, 2016 09:50:32 PM Adrian Chadd wrote:
> hiya,
> 
> so I dug into the mips24k definition of this. It says this:
> 
> "
> 3.4.3 Uncached accelerated writes
> The 24K core permits memory regions to be marked as “uncached
> accelerated”. This type of region is useful to hard-
> ware which is “write only” - perhaps video frame buffers, or some
> other hardware stream. Sequential word stores in
> such regions are gathered into cache-line-sized chunks, before being
> written with a single burst cycle on the CPU
> interface.
> Such regions are uncached for read, and partial-word or
> out-of-sequence writes have “unpredictable” effects - don’t
> do them. The burst write is normally performed when software writes to
> the last location in the memory block or does
> an uncached-accelerated write to some other block; but it can also be
> triggered by a
> sync instruction, a pref nudge, a matching load or any exception. If
> the block is not completely written by the time it’s pushed out, it
> will be written using a series of doubleword or smaller write cycles
> over the 24K core’s 64-bit memory interface.
> "
> 
> So, question is - is our write combining page attribute in the VM
> suitable for this? Is it defined as "only do full sequential word
> writes"? Or do we risk having some other platform use it in a less
> "don't do this" way and then MIPS is the one at fault again? :)

The description of WC in the Intel SDM appears to be more forgiving.
If you do out-of-sequence writes it won't "lose" the data, but there
isn't a strong ordering of when the different regions of a cache line
are finally written.  Also, different WC store buffers may be written
out-of-order (e.g. if you partially fill one line, then fully fill a
second line, the second line may be written out, but the first one will
be held for a bit to see if it will be fully filled).  However, you
never lose the data, and the last thing written will eventually end up
being written to the bus.

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

svn commit: r310713 - in head/sys/dev/sfxge: . common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 28 17:45:52 2016
New Revision: 310713
URL: https://svnweb.freebsd.org/changeset/base/310713

Log:
  sfxge(4): add possibility to control event queue performance profile
  
  It is ignored on SFN5xxx/6xxx (aka Siena).
  
  Reviewed by:gnn
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days
  Differential Revision:  https://reviews.freebsd.org/D8931

Modified:
  head/sys/dev/sfxge/common/ef10_ev.c
  head/sys/dev/sfxge/common/ef10_impl.h
  head/sys/dev/sfxge/common/efx.h
  head/sys/dev/sfxge/common/efx_ev.c
  head/sys/dev/sfxge/common/efx_impl.h
  head/sys/dev/sfxge/sfxge_ev.c

Modified: head/sys/dev/sfxge/common/ef10_ev.c
==
--- head/sys/dev/sfxge/common/ef10_ev.c Wed Dec 28 17:13:03 2016
(r310712)
+++ head/sys/dev/sfxge/common/ef10_ev.c Wed Dec 28 17:45:52 2016
(r310713)
@@ -140,6 +140,7 @@ efx_mcdi_init_evq(
__insize_t nevs,
__inuint32_t irq,
__inuint32_t us,
+   __inuint32_t flags,
__inboolean_t low_latency)
 {
efx_mcdi_req_t req;
@@ -178,7 +179,20 @@ efx_mcdi_init_evq(
 * So always enable RX and TX event batching, and enable event cut
 * through if we want low latency operation.
 */
-   ev_cut_through = low_latency ? 1 : 0;
+   switch (flags & EFX_EVQ_FLAGS_TYPE_MASK) {
+   case EFX_EVQ_FLAGS_TYPE_AUTO:
+   ev_cut_through = low_latency ? 1 : 0;
+   break;
+   case EFX_EVQ_FLAGS_TYPE_THROUGHPUT:
+   ev_cut_through = 0;
+   break;
+   case EFX_EVQ_FLAGS_TYPE_LOW_LATENCY:
+   ev_cut_through = 1;
+   break;
+   default:
+   rc = EINVAL;
+   goto fail2;
+   }
MCDI_IN_POPULATE_DWORD_6(req, INIT_EVQ_IN_FLAGS,
INIT_EVQ_IN_FLAG_INTERRUPTING, 1,
INIT_EVQ_IN_FLAG_RPTR_DOS, 0,
@@ -197,7 +211,7 @@ efx_mcdi_init_evq(
unsigned int ticks;
 
if ((rc = efx_ev_usecs_to_ticks(enp, us, &ticks)) != 0)
-   goto fail2;
+   goto fail3;
 
MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_MODE,
MC_CMD_INIT_EVQ_IN_TMR_INT_HLDOFF);
@@ -225,18 +239,20 @@ efx_mcdi_init_evq(
 
if (req.emr_rc != 0) {
rc = req.emr_rc;
-   goto fail3;
+   goto fail4;
}
 
if (req.emr_out_length_used < MC_CMD_INIT_EVQ_OUT_LEN) {
rc = EMSGSIZE;
-   goto fail4;
+   goto fail5;
}
 
/* NOTE: ignore the returned IRQ param as firmware does not set it. */
 
return (0);
 
+fail5:
+   EFSYS_PROBE(fail5);
 fail4:
EFSYS_PROBE(fail4);
 fail3:
@@ -257,12 +273,14 @@ efx_mcdi_init_evq_v2(
__inefsys_mem_t *esmp,
__insize_t nevs,
__inuint32_t irq,
-   __inuint32_t us)
+   __inuint32_t us,
+   __inuint32_t flags)
 {
efx_mcdi_req_t req;
uint8_t payload[
MAX(MC_CMD_INIT_EVQ_V2_IN_LEN(EFX_EVQ_NBUFS(EFX_EVQ_MAXNEVS)),
MC_CMD_INIT_EVQ_V2_OUT_LEN)];
+   unsigned int evq_type;
efx_qword_t *dma_addr;
uint64_t addr;
int npages;
@@ -286,11 +304,25 @@ efx_mcdi_init_evq_v2(
MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_INSTANCE, instance);
MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_IRQ_NUM, irq);
 
+   switch (flags & EFX_EVQ_FLAGS_TYPE_MASK) {
+   case EFX_EVQ_FLAGS_TYPE_AUTO:
+   evq_type = MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_AUTO;
+   break;
+   case EFX_EVQ_FLAGS_TYPE_THROUGHPUT:
+   evq_type = MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_THROUGHPUT;
+   break;
+   case EFX_EVQ_FLAGS_TYPE_LOW_LATENCY:
+   evq_type = MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_LOW_LATENCY;
+   break;
+   default:
+   rc = EINVAL;
+   goto fail2;
+   }
MCDI_IN_POPULATE_DWORD_4(req, INIT_EVQ_V2_IN_FLAGS,
INIT_EVQ_V2_IN_FLAG_INTERRUPTING, 1,
INIT_EVQ_V2_IN_FLAG_RPTR_DOS, 0,
INIT_EVQ_V2_IN_FLAG_INT_ARMD, 0,
-   INIT_EVQ_V2_IN_FLAG_TYPE, MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_AUTO);
+   INIT_EVQ_V2_IN_FLAG_TYPE, evq_type);
 
/* If the value is zero then disable the timer */
if (us == 0) {
@@ -302,7 +334,7 @@ efx_mcdi_init_evq_v2(
unsigned int ticks;
 
if ((rc = efx_ev_usecs_to_ticks(enp, us, &ticks)) != 0)
-   goto fail2;
+   goto fail3;
 
MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_TMR_MODE,
MC_CMD_INIT_EVQ_V2_IN_TMR_INT_HLDOFF);
@@ -330,12 +362,12 @@ efx_mcdi_init_evq_v2(
 
if (req.emr_rc != 0

svn commit: r310714 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 28 17:49:33 2016
New Revision: 310714
URL: https://svnweb.freebsd.org/changeset/base/310714

Log:
  sfxge(4): support Medford bootcfg partition layout in common code
  
  For Siena and Huntington, the per-port bootcfg (aka expcfg) is
  stored in a dedicated 4Kbyte partition for each port.
  
  For Medford, the per-PF bootcfg is stored in a 2Kbyte sector
  within a single shared partition. Update the common code to support
  the new bootcfg layout.
  
  Submitted by:   Andy Moreton 
  Reviewed by:gnn
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days
  Differential Revision:  https://reviews.freebsd.org/D8932

Modified:
  head/sys/dev/sfxge/common/efx_bootcfg.c

Modified: head/sys/dev/sfxge/common/efx_bootcfg.c
==
--- head/sys/dev/sfxge/common/efx_bootcfg.c Wed Dec 28 17:45:52 2016
(r310713)
+++ head/sys/dev/sfxge/common/efx_bootcfg.c Wed Dec 28 17:49:33 2016
(r310714)
@@ -38,14 +38,69 @@ __FBSDID("$FreeBSD$");
 
 /*
  * Maximum size of BOOTCFG block across all nics as understood by SFCgPXE.
- * A multiple of 0x100 so trailing 0xff characters don't contrinbute to the
- * checksum.
+ * NOTE: This is larger than the Medford per-PF bootcfg sector.
  */
 #defineBOOTCFG_MAX_SIZE 0x1000
 
 #defineDHCP_END ((uint8_t)0xff)
 #defineDHCP_PAD ((uint8_t)0)
 
+
+/* Report size and offset of bootcfg sector in NVRAM partition. */
+static __checkReturn   efx_rc_t
+efx_bootcfg_sector(
+   __inefx_nic_t *enp,
+   __out   size_t *offsetp,
+   __out   size_t *max_sizep)
+{
+   size_t max_size;
+   size_t offset;
+   int rc;
+
+   switch (enp->en_family) {
+#if EFSYS_OPT_SIENA
+   case EFX_FAMILY_SIENA:
+   max_size = BOOTCFG_MAX_SIZE;
+   offset = 0;
+   break;
+#endif /* EFSYS_OPT_SIENA */
+
+#if EFSYS_OPT_HUNTINGTON
+   case EFX_FAMILY_HUNTINGTON:
+   max_size = BOOTCFG_MAX_SIZE;
+   offset = 0;
+   break;
+#endif /* EFSYS_OPT_HUNTINGTON */
+
+#if EFSYS_OPT_MEDFORD
+   case EFX_FAMILY_MEDFORD: {
+   efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
+
+   /* Shared partition (array indexed by PF) */
+   max_size = 0x0800;
+   offset = max_size * encp->enc_pf;
+   break;
+   }
+#endif /* EFSYS_OPT_MEDFORD */
+
+   default:
+   EFSYS_ASSERT(0);
+   rc = ENOTSUP;
+   goto fail1;
+   }
+   EFSYS_ASSERT3U(max_size, <=, BOOTCFG_MAX_SIZE);
+
+   *offsetp = offset;
+   *max_sizep = max_size;
+
+   return (0);
+
+fail1:
+   EFSYS_PROBE1(fail1, efx_rc_t, rc);
+   return (rc);
+}
+
+
 static __checkReturn   uint8_t
 efx_bootcfg_csum(
__inefx_nic_t *enp,
@@ -136,40 +191,54 @@ efx_bootcfg_read(
 {
uint8_t *payload = NULL;
size_t used_bytes;
+   size_t partn_length;
size_t sector_length;
+   size_t sector_offset;
efx_rc_t rc;
 
-   rc = efx_nvram_size(enp, EFX_NVRAM_BOOTROM_CFG, §or_length);
+   rc = efx_nvram_size(enp, EFX_NVRAM_BOOTROM_CFG, &partn_length);
if (rc != 0)
goto fail1;
 
+   /* The bootcfg sector may be stored in a (larger) shared partition */
+   rc = efx_bootcfg_sector(enp, §or_offset, §or_length);
+   if (rc != 0)
+   goto fail2;
+
+   if (sector_length > BOOTCFG_MAX_SIZE)
+   sector_length = BOOTCFG_MAX_SIZE;
+
+   if (sector_offset + sector_length > partn_length) {
+   /* Partition is too small */
+   rc = EFBIG;
+   goto fail3;
+   }
+
/*
-* We need to read the entire BOOTCFG area to ensure we read all the
+* We need to read the entire BOOTCFG sector to ensure we read all the
 * tags, because legacy bootcfg sectors are not guaranteed to end with
 * a DHCP_END character. If the user hasn't supplied a sufficiently
 * large buffer then use our own buffer.
 */
-   if (sector_length > BOOTCFG_MAX_SIZE)
-   sector_length = BOOTCFG_MAX_SIZE;
if (sector_length > size) {
EFSYS_KMEM_ALLOC(enp->en_esip, sector_length, payload);
if (payload == NULL) {
rc = ENOMEM;
-   goto fail2;
+   goto fail4;
}
} else
payload = (uint8_t *)data;
 
if ((rc = efx_nvram_rw_start(enp, EFX_NVRAM_BOOTROM_CFG, NULL)) != 0)
-   goto fail3;
+   goto fail5;
 
-   rc = efx_nvram_read_chunk(enp, EFX_NVRAM_BOOTROM_CFG, 0,
+   rc = efx_nvram_read_chunk(enp, EFX_NVRAM_BOOTROM_CFG, sector_offset,
(caddr_t)payload, sec

svn commit: r310715 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 28 17:50:48 2016
New Revision: 310715
URL: https://svnweb.freebsd.org/changeset/base/310715

Log:
  sfxge(4): fix GET_RXDP_CONFIG usage for multi-PF on Medford
  
  On Medford, using MC_CMD_GET_RXDP_CONFIG to query the RX end
  padding setting is in the ADMIN group, and so fails for
  unprivileged functions. In that case, assume the largest size
  supported by Medford hardware (256bytes) to prevent overrun.
  
  Submitted by:   Andy Moreton 
  Reviewed by:gnn
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days
  Differential Revision:  https://reviews.freebsd.org/D8933

Modified:
  head/sys/dev/sfxge/common/medford_nic.c

Modified: head/sys/dev/sfxge/common/medford_nic.c
==
--- head/sys/dev/sfxge/common/medford_nic.c Wed Dec 28 17:49:33 2016
(r310714)
+++ head/sys/dev/sfxge/common/medford_nic.c Wed Dec 28 17:50:48 2016
(r310715)
@@ -289,8 +289,13 @@ medford_board_cfg(
encp->enc_rx_buf_align_start = 1;
 
/* Get the RX DMA end padding alignment configuration */
-   if ((rc = efx_mcdi_get_rxdp_config(enp, &end_padding)) != 0)
-   goto fail11;
+   if ((rc = efx_mcdi_get_rxdp_config(enp, &end_padding)) != 0) {
+   if (rc != EACCES)
+   goto fail11;
+
+   /* Assume largest tail padding size supported by hardware */
+   end_padding = 256;
+   }
encp->enc_rx_buf_align_end = end_padding;
 
/* Alignment for WPTR updates */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310716 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 28 17:52:24 2016
New Revision: 310716
URL: https://svnweb.freebsd.org/changeset/base/310716

Log:
  sfxge(4): add UEFI ROM support to the common code
  
  Submitted by:   Andrew Lee 
  Reviewed by:gnn
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days
  Differential Revision:  https://reviews.freebsd.org/D8934

Modified:
  head/sys/dev/sfxge/common/ef10_nvram.c
  head/sys/dev/sfxge/common/efx.h

Modified: head/sys/dev/sfxge/common/ef10_nvram.c
==
--- head/sys/dev/sfxge/common/ef10_nvram.c  Wed Dec 28 17:50:48 2016
(r310715)
+++ head/sys/dev/sfxge/common/ef10_nvram.c  Wed Dec 28 17:52:24 2016
(r310716)
@@ -2175,7 +2175,11 @@ static ef10_parttbl_entry_t medford_part
{NVRAM_PARTITION_TYPE_LICENSE, 1, EFX_NVRAM_LICENSE},
{NVRAM_PARTITION_TYPE_LICENSE, 2, EFX_NVRAM_LICENSE},
{NVRAM_PARTITION_TYPE_LICENSE, 3, EFX_NVRAM_LICENSE},
-   {NVRAM_PARTITION_TYPE_LICENSE, 4, EFX_NVRAM_LICENSE}
+   {NVRAM_PARTITION_TYPE_LICENSE, 4, EFX_NVRAM_LICENSE},
+   {NVRAM_PARTITION_TYPE_EXPANSION_UEFI,  1, EFX_NVRAM_UEFIROM},
+   {NVRAM_PARTITION_TYPE_EXPANSION_UEFI,  2, EFX_NVRAM_UEFIROM},
+   {NVRAM_PARTITION_TYPE_EXPANSION_UEFI,  3, EFX_NVRAM_UEFIROM},
+   {NVRAM_PARTITION_TYPE_EXPANSION_UEFI,  4, EFX_NVRAM_UEFIROM}
 };
 
 static __checkReturn   efx_rc_t

Modified: head/sys/dev/sfxge/common/efx.h
==
--- head/sys/dev/sfxge/common/efx.h Wed Dec 28 17:50:48 2016
(r310715)
+++ head/sys/dev/sfxge/common/efx.h Wed Dec 28 17:52:24 2016
(r310716)
@@ -1311,6 +1311,7 @@ typedef enum efx_nvram_type_e {
EFX_NVRAM_FPGA_BACKUP,
EFX_NVRAM_DYNAMIC_CFG,
EFX_NVRAM_LICENSE,
+   EFX_NVRAM_UEFIROM,
EFX_NVRAM_NTYPES,
 } efx_nvram_type_t;
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310717 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 28 17:56:03 2016
New Revision: 310717
URL: https://svnweb.freebsd.org/changeset/base/310717

Log:
  sfxge(4): move BIST methods from hunt_phy.c to ef10_phy.c
  
  Submitted by:   Mark Spender 
  Reviewed by:gnn
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days
  Differential Revision:  https://reviews.freebsd.org/D8935

Modified:
  head/sys/dev/sfxge/common/ef10_impl.h
  head/sys/dev/sfxge/common/ef10_phy.c
  head/sys/dev/sfxge/common/hunt_impl.h
  head/sys/dev/sfxge/common/hunt_phy.c

Modified: head/sys/dev/sfxge/common/ef10_impl.h
==
--- head/sys/dev/sfxge/common/ef10_impl.h   Wed Dec 28 17:52:24 2016
(r310716)
+++ head/sys/dev/sfxge/common/ef10_impl.h   Wed Dec 28 17:56:03 2016
(r310717)
@@ -602,6 +602,34 @@ ef10_phy_stats_update(
 
 #endif /* EFSYS_OPT_PHY_STATS */
 
+#if EFSYS_OPT_BIST
+
+extern __checkReturn   efx_rc_t
+ef10_bist_enable_offline(
+   __inefx_nic_t *enp);
+
+extern __checkReturn   efx_rc_t
+ef10_bist_start(
+   __inefx_nic_t *enp,
+   __inefx_bist_type_t type);
+
+extern __checkReturn   efx_rc_t
+ef10_bist_poll(
+   __inefx_nic_t *enp,
+   __inefx_bist_type_t type,
+   __out   efx_bist_result_t *resultp,
+   __out_opt __drv_when(count > 0, __notnull)
+   uint32_t*value_maskp,
+   __out_ecount_opt(count) __drv_when(count > 0, __notnull)
+   unsigned long   *valuesp,
+   __insize_t count);
+
+extern void
+ef10_bist_stop(
+   __inefx_nic_t *enp,
+   __inefx_bist_type_t type);
+
+#endif /* EFSYS_OPT_BIST */
 
 /* TX */
 

Modified: head/sys/dev/sfxge/common/ef10_phy.c
==
--- head/sys/dev/sfxge/common/ef10_phy.cWed Dec 28 17:52:24 2016
(r310716)
+++ head/sys/dev/sfxge/common/ef10_phy.cWed Dec 28 17:56:03 2016
(r310717)
@@ -474,4 +474,157 @@ ef10_phy_stats_update(
 
 #endif /* EFSYS_OPT_PHY_STATS */
 
+#if EFSYS_OPT_BIST
+
+   __checkReturn   efx_rc_t
+ef10_bist_enable_offline(
+   __inefx_nic_t *enp)
+{
+   efx_rc_t rc;
+
+   if ((rc = efx_mcdi_bist_enable_offline(enp)) != 0)
+   goto fail1;
+
+   return (0);
+
+fail1:
+   EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+   return (rc);
+}
+
+   __checkReturn   efx_rc_t
+ef10_bist_start(
+   __inefx_nic_t *enp,
+   __inefx_bist_type_t type)
+{
+   efx_rc_t rc;
+
+   if ((rc = efx_mcdi_bist_start(enp, type)) != 0)
+   goto fail1;
+
+   return (0);
+
+fail1:
+   EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+   return (rc);
+}
+
+   __checkReturn   efx_rc_t
+ef10_bist_poll(
+   __inefx_nic_t *enp,
+   __inefx_bist_type_t type,
+   __out   efx_bist_result_t *resultp,
+   __out_opt __drv_when(count > 0, __notnull)
+   uint32_t *value_maskp,
+   __out_ecount_opt(count) __drv_when(count > 0, __notnull)
+   unsigned long *valuesp,
+   __insize_t count)
+{
+   efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
+   efx_mcdi_req_t req;
+   uint8_t payload[MAX(MC_CMD_POLL_BIST_IN_LEN,
+   MCDI_CTL_SDU_LEN_MAX)];
+   uint32_t value_mask = 0;
+   uint32_t result;
+   efx_rc_t rc;
+
+   _NOTE(ARGUNUSED(type))
+
+   (void) memset(payload, 0, sizeof (payload));
+   req.emr_cmd = MC_CMD_POLL_BIST;
+   req.emr_in_buf = payload;
+   req.emr_in_length = MC_CMD_POLL_BIST_IN_LEN;
+   req.emr_out_buf = payload;
+   req.emr_out_length = MCDI_CTL_SDU_LEN_MAX;
+
+   efx_mcdi_execute(enp, &req);
+
+   if (req.emr_rc != 0) {
+   rc = req.emr_rc;
+   goto fail1;
+   }
+
+   if (req.emr_out_length_used < MC_CMD_POLL_BIST_OUT_RESULT_OFST + 4) {
+   rc = EMSGSIZE;
+   goto fail2;
+   }
+
+   if (count > 0)
+   (void) memset(valuesp, '\0', count * sizeof (unsigned long));
+
+   result = MCDI_OUT_DWORD(req, POLL_BIST_OUT_RESULT);
+
+   if (result == MC_CMD_POLL_BIST_FAILED &&
+   req.emr_out_length >= MC_CMD_POLL_BIST_OUT_MEM_LEN &&
+   count > EFX_BIST_MEM_ECC_FATAL) {
+   if (valuesp != NULL) {
+   valuesp[EFX_BIST_MEM_TEST] =
+   MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_TEST);
+   valuesp[EFX_BIST_MEM_ADDR] =
+   MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_ADDR);
+   valuesp[EFX_BIST_MEM_BUS] =

svn commit: r310718 - head/contrib/bzip2

2016-12-28 Thread Dmitry Marakasov
Author: amdmi3 (ports committer)
Date: Wed Dec 28 18:04:18 2016
New Revision: 310718
URL: https://svnweb.freebsd.org/changeset/base/310718

Log:
  bzip2 does not exit after showing license as requested with --version
  or --license as most apps would do, instead it waits for data to
  compress on stdin. Because of that, if `bzip2 --version' is called,
  bogus `bzip2: I won't write compressed data to a terminal' error
  message will be displayed, and checking for bzip2 version in scripts
  as in
  
  bzip2 --version 2>&1 | grep -o "Version [^,]*"
  
  will hand as bzip2 would wait for data to compress on stdin. Fix
  this by exiting right after showing version/license text.
  
  I've tried to push this upstream for more than a year, but author
  is unresponsive, so upstream may be considered dead.
  
  Ubuntu applies similar fix, for the note.
  
  PR:   199443
  Approved by:  dim, bapt
  MFC after:2 weeks
  Differential Revision:D8924

Modified:
  head/contrib/bzip2/bzip2.c

Modified: head/contrib/bzip2/bzip2.c
==
--- head/contrib/bzip2/bzip2.c  Wed Dec 28 17:56:03 2016(r310717)
+++ head/contrib/bzip2/bzip2.c  Wed Dec 28 18:04:18 2016(r310718)
@@ -1890,7 +1890,9 @@ IntNative main ( IntNative argc, Char *a
case '8': blockSize100k= 8; break;
case '9': blockSize100k= 9; break;
case 'V':
-   case 'L': license();break;
+   case 'L': license();
+ exit ( 0 );
+ break;
case 'v': verbosity++; break;
case 'h': usage ( progName );
  exit ( 0 );
@@ -1916,8 +1918,8 @@ IntNative main ( IntNative argc, Char *a
   if (ISFLAG("--keep"))  keepInputFiles   = True;else
   if (ISFLAG("--small")) smallMode= True;else
   if (ISFLAG("--quiet")) noisy= False;   else
-  if (ISFLAG("--version"))   license();  else
-  if (ISFLAG("--license"))   license();  else
+  if (ISFLAG("--version"))   { license(); exit ( 0 ); }  else
+  if (ISFLAG("--license"))   { license(); exit ( 0 ); }  else
   if (ISFLAG("--exponential"))   workFactor = 1; else 
   if (ISFLAG("--repetitive-best"))   redundant(aa->name);else
   if (ISFLAG("--repetitive-fast"))   redundant(aa->name);else
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310719 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 28 18:07:17 2016
New Revision: 310719
URL: https://svnweb.freebsd.org/changeset/base/310719

Log:
  sfxge(4): cleanup: remove last use of deprecated function flags with 
privilege check
  
  The function flags were changed to mirror the privileges, but
  the privileges are preferred.
  
  Submitted by:   Mark Spender 
  Reviewed by:gnn
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days
  Differential Revision:  https://reviews.freebsd.org/D8936

Modified:
  head/sys/dev/sfxge/common/ef10_phy.c

Modified: head/sys/dev/sfxge/common/ef10_phy.c
==
--- head/sys/dev/sfxge/common/ef10_phy.cWed Dec 28 18:04:18 2016
(r310718)
+++ head/sys/dev/sfxge/common/ef10_phy.cWed Dec 28 18:07:17 2016
(r310719)
@@ -278,7 +278,6 @@ fail1:
 ef10_phy_reconfigure(
__inefx_nic_t *enp)
 {
-   efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
efx_port_t *epp = &(enp->en_port);
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_SET_LINK_IN_LEN,
@@ -286,9 +285,12 @@ ef10_phy_reconfigure(
uint32_t cap_mask;
unsigned int led_mode;
unsigned int speed;
+   boolean_t supported;
efx_rc_t rc;
 
-   if (~encp->enc_func_flags & EFX_NIC_FUNC_LINKCTRL)
+   if ((rc = efx_mcdi_link_control_supported(enp, &supported)) != 0)
+   goto fail1;
+   if (supported == B_FALSE)
goto out;
 
(void) memset(payload, 0, sizeof (payload));
@@ -349,7 +351,7 @@ ef10_phy_reconfigure(
 
if (req.emr_rc != 0) {
rc = req.emr_rc;
-   goto fail1;
+   goto fail2;
}
 
/* And set the blink mode */
@@ -385,11 +387,13 @@ ef10_phy_reconfigure(
 
if (req.emr_rc != 0) {
rc = req.emr_rc;
-   goto fail2;
+   goto fail3;
}
 out:
return (0);
 
+fail3:
+   EFSYS_PROBE(fail3);
 fail2:
EFSYS_PROBE(fail2);
 fail1:
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310720 - head/sys/vm

2016-12-28 Thread Alan Cox
Author: alc
Date: Wed Dec 28 18:32:13 2016
New Revision: 310720
URL: https://svnweb.freebsd.org/changeset/base/310720

Log:
  Relax the object type restrictions on vm_page_alloc_contig().  Specifically,
  add support for object types that were previously prohibited because they
  could contain PG_CACHED pages.
  
  Roughly halve the number of radix trie operations performed by
  vm_page_alloc_contig() using the same approach that is employed by
  vm_page_alloc().  Also, eliminate the radix trie lookup performed with the
  free page queues lock held.
  
  Tidy up the handling of radix trie insert failures in vm_page_alloc() and
  vm_page_alloc_contig().
  
  Reviewed by:  kib, markj
  Tested by:pho
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D8878

Modified:
  head/sys/vm/vm_page.c
  head/sys/vm/vm_reserv.c
  head/sys/vm/vm_reserv.h

Modified: head/sys/vm/vm_page.c
==
--- head/sys/vm/vm_page.c   Wed Dec 28 18:07:17 2016(r310719)
+++ head/sys/vm/vm_page.c   Wed Dec 28 18:32:13 2016(r310720)
@@ -1486,13 +1486,12 @@ vm_page_alloc(vm_object_t object, vm_pin
vm_page_t m, mpred;
int flags, req_class;
 
-   mpred = 0;  /* XXX: pacify gcc */
+   mpred = NULL;   /* XXX: pacify gcc */
KASSERT((object != NULL) == ((req & VM_ALLOC_NOOBJ) == 0) &&
(object != NULL || (req & VM_ALLOC_SBUSY) == 0) &&
((req & (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)) !=
(VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)),
-   ("vm_page_alloc: inconsistent object(%p)/req(%x)", (void *)object,
-   req));
+   ("vm_page_alloc: inconsistent object(%p)/req(%x)", object, req));
if (object != NULL)
VM_OBJECT_ASSERT_WLOCKED(object);
 
@@ -1596,10 +1595,11 @@ vm_page_alloc(vm_object_t object, vm_pin
atomic_subtract_int(&vm_cnt.v_wire_count, 1);
m->wire_count = 0;
}
-   m->object = NULL;
+   KASSERT(m->object == NULL, ("page %p has object", m));
m->oflags = VPO_UNMANAGED;
m->busy_lock = VPB_UNBUSIED;
-   vm_page_free(m);
+   /* Don't change PG_ZERO. */
+   vm_page_free_toq(m);
return (NULL);
}
 
@@ -1641,6 +1641,8 @@ vm_page_alloc(vm_object_t object, vm_pin
  * memory attribute setting for the physical pages cannot be configured
  * to VM_MEMATTR_DEFAULT.
  *
+ * The specified object may not contain fictitious pages.
+ *
  * The caller must always specify an allocation class.
  *
  * allocation classes:
@@ -1664,20 +1666,21 @@ vm_page_alloc_contig(vm_object_t object,
 u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment,
 vm_paddr_t boundary, vm_memattr_t memattr)
 {
-   vm_page_t m, m_tmp, m_ret;
-   u_int flags;
+   vm_page_t m, m_ret, mpred;
+   u_int busy_lock, flags, oflags;
int req_class;
 
+   mpred = NULL;   /* XXX: pacify gcc */
KASSERT((object != NULL) == ((req & VM_ALLOC_NOOBJ) == 0) &&
(object != NULL || (req & VM_ALLOC_SBUSY) == 0) &&
((req & (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)) !=
(VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)),
-   ("vm_page_alloc: inconsistent object(%p)/req(%x)", (void *)object,
+   ("vm_page_alloc_contig: inconsistent object(%p)/req(%x)", object,
req));
if (object != NULL) {
VM_OBJECT_ASSERT_WLOCKED(object);
-   KASSERT(object->type == OBJT_PHYS,
-   ("vm_page_alloc_contig: object %p isn't OBJT_PHYS",
+   KASSERT((object->flags & OBJ_FICTITIOUS) == 0,
+   ("vm_page_alloc_contig: object %p has fictitious pages",
object));
}
KASSERT(npages > 0, ("vm_page_alloc_contig: npages is zero"));
@@ -1689,18 +1692,34 @@ vm_page_alloc_contig(vm_object_t object,
if (curproc == pageproc && req_class != VM_ALLOC_INTERRUPT)
req_class = VM_ALLOC_SYSTEM;
 
+   if (object != NULL) {
+   mpred = vm_radix_lookup_le(&object->rtree, pindex);
+   KASSERT(mpred == NULL || mpred->pindex != pindex,
+   ("vm_page_alloc_contig: pindex already allocated"));
+   }
+
+   /*
+* Can we allocate the pages without the number of free pages falling
+* below the lower bound for the allocation class?
+*/
mtx_lock(&vm_page_queue_free_mtx);
if (vm_cnt.v_free_count >= npages + vm_cnt.v_free_reserved ||
(req_class == VM_ALLOC_SYSTEM &&
vm_cnt.v_free_count >= npages + vm_cnt.v_interrupt_free_min) ||
(req_class == VM_ALLOC_INTERRUPT &&
vm_cnt.v_fre

svn commit: r310721 - head/sys/conf

2016-12-28 Thread John Baldwin
Author: jhb
Date: Wed Dec 28 18:42:43 2016
New Revision: 310721
URL: https://svnweb.freebsd.org/changeset/base/310721

Log:
  Mention T6 and 100GbE in description of cxgbe.
  
  MFC after:3 days

Modified:
  head/sys/conf/NOTES

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Wed Dec 28 18:32:13 2016(r310720)
+++ head/sys/conf/NOTES Wed Dec 28 18:42:43 2016(r310721)
@@ -1956,8 +1956,9 @@ devicexmphy   # XaQti XMAC II
 # cm:  Arcnet SMC COM90c26 / SMC COM90c56
 #  (and SMC COM90c66 in '56 compatibility mode) adapters.
 # cxgb: Chelsio T3 based 1GbE/10GbE PCIe Ethernet adapters.
-# cxgbe:Chelsio T4 and T5 based 1GbE/10GbE/40GbE PCIe Ethernet adapters.
-# cxgbev: Chelsio T4 and T5 based PCIe Virtual Functions.
+# cxgbe:Chelsio T4, T5, and T6-based 1GbE/10GbE/40GbE/100GbE PCIe Ethernet
+#  adapters.
+# cxgbev: Chelsio T4, T5, and T6-based PCIe Virtual Functions.
 # dc:   Support for PCI fast ethernet adapters based on the DEC/Intel 21143
 #   and various workalikes including:
 #   the ADMtek AL981 Comet and AN985 Centaur, the ASIX Electronics
@@ -2140,8 +2141,8 @@ devicexl  # 3Com 3c90x 
(``Boomerang'',
 # PCI Ethernet NICs.
 device cxgb# Chelsio T3 10 Gigabit Ethernet
 device cxgb_t3fw   # Chelsio T3 10 Gigabit Ethernet firmware
-device cxgbe   # Chelsio T4 and T5 1GbE/10GbE/40GbE
-device cxgbev  # Chelsio T4 and T5 1GbE/10GbE/40GbE VF
+device cxgbe   # Chelsio T4, T5, and T6 1GbE/10GbE/40GbE/100GbE
+device cxgbev  # Chelsio T4, T5, and T6 VF
 device de  # DEC/Intel DC21x4x (``Tulip'')
 device em  # Intel Pro/1000 Gigabit Ethernet
 device igb # Intel Pro/1000 PCIE Gigabit Ethernet
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310722 - head/sys/mips/ingenic

2016-12-28 Thread Alexander Kabaev
Author: kan
Date: Wed Dec 28 19:40:59 2016
New Revision: 310722
URL: https://svnweb.freebsd.org/changeset/base/310722

Log:
  Do not use read-modify-write on MSC control register.
  
  The register is write-only, so just write only bits we want.
  
  Submitted by: jmcneill

Modified:
  head/sys/mips/ingenic/jz4780_mmc.c

Modified: head/sys/mips/ingenic/jz4780_mmc.c
==
--- head/sys/mips/ingenic/jz4780_mmc.c  Wed Dec 28 18:42:43 2016
(r310721)
+++ head/sys/mips/ingenic/jz4780_mmc.c  Wed Dec 28 19:40:59 2016
(r310722)
@@ -412,13 +412,9 @@ static int
 jz4780_mmc_reset(struct jz4780_mmc_softc *sc)
 {
int timeout;
-   int reg;
 
/* Stop the clock */
-   reg = JZ_MMC_READ_4(sc, JZ_MSC_CTRL);
-   reg &= ~(JZ_CLOCK_CTRL_M);
-   reg |= JZ_CLOCK_STOP;
-   JZ_MMC_WRITE_4(sc, JZ_MSC_CTRL, reg);
+   JZ_MMC_WRITE_4(sc, JZ_MSC_CTRL, JZ_CLOCK_STOP);
 
timeout = 1000;
while (--timeout > 0) {
@@ -432,9 +428,7 @@ jz4780_mmc_reset(struct jz4780_mmc_softc
}
 
/* Reset */
-   reg = JZ_MMC_READ_4(sc, JZ_MSC_CTRL);
-   reg |= JZ_RESET;
-   JZ_MMC_WRITE_4(sc, JZ_MSC_CTRL, reg);
+   JZ_MMC_WRITE_4(sc, JZ_MSC_CTRL, JZ_RESET);
 
timeout = 10;
while (--timeout > 0) {
@@ -647,7 +641,7 @@ jz4780_mmc_request(device_t bus, device_
 {
struct jz4780_mmc_softc *sc;
struct mmc_command *cmd;
-   uint32_t cmdat, ctrl, iwait;
+   uint32_t cmdat, iwait;
int blksz;
 
sc = device_get_softc(bus);
@@ -731,9 +725,7 @@ jz4780_mmc_request(device_t bus, device_
JZ_MMC_WRITE_4(sc, JZ_MSC_CMD, cmd->opcode);
JZ_MMC_WRITE_4(sc, JZ_MSC_CMDAT, cmdat);
 
-   ctrl = JZ_MMC_READ_4(sc, JZ_MSC_CTRL);
-   ctrl |= JZ_START_OP | JZ_CLOCK_START;
-   JZ_MMC_WRITE_4(sc, JZ_MSC_CTRL, ctrl);
+   JZ_MMC_WRITE_4(sc, JZ_MSC_CTRL, JZ_START_OP | JZ_CLOCK_START);
 
callout_reset(&sc->sc_timeoutc, sc->sc_timeout * hz,
jz4780_mmc_timeout, sc);
@@ -853,8 +845,7 @@ jz4780_mmc_disable_clock(struct jz4780_m
 {
int timeout;
 
-   JZ_MMC_WRITE_4(sc, JZ_MSC_CTRL,
-   JZ_MMC_READ_4(sc, JZ_MSC_CTRL) | JZ_CLOCK_STOP);
+   JZ_MMC_WRITE_4(sc, JZ_MSC_CTRL, JZ_CLOCK_STOP);
 
for (timeout = 1000; timeout > 0; timeout--)
if ((JZ_MMC_READ_4(sc, JZ_MSC_STAT) & JZ_CLK_EN) == 0)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310724 - head/contrib/elftoolchain/libdwarf

2016-12-28 Thread Mark Johnston
Author: markj
Date: Wed Dec 28 21:54:33 2016
New Revision: 310724
URL: https://svnweb.freebsd.org/changeset/base/310724

Log:
  Follow DW_AT_specification when looking up DW_AT_type attributes.
  
  dwarf_attrval_*() will search the parent DIE referenced by a
  DW_AT_abstract_origin attribute for the value of the DW_AT_type attribute.
  Do the same thing for the DW_AT_specification attributes in variable
  definitions emitted by GCC 6.2, and ensure that we return an error rather
  than crashing if neither DW_AT_abstract_origin or DW_AT_specification is
  found when looking for the value of the DW_AT_type attribute.
  
  PR:   215350, 215395
  Reviewed by:  emaste
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D8920

Modified:
  head/contrib/elftoolchain/libdwarf/dwarf_attrval.c
  head/contrib/elftoolchain/libdwarf/dwarf_attrval_signed.3

Modified: head/contrib/elftoolchain/libdwarf/dwarf_attrval.c
==
--- head/contrib/elftoolchain/libdwarf/dwarf_attrval.c  Wed Dec 28 21:45:41 
2016(r310723)
+++ head/contrib/elftoolchain/libdwarf/dwarf_attrval.c  Wed Dec 28 21:54:33 
2016(r310724)
@@ -145,6 +145,7 @@ dwarf_attrval_unsigned(Dwarf_Die die, Dw
Dwarf_Die die1;
Dwarf_Unsigned val;
Dwarf_Debug dbg;
+   int first;
 
dbg = die != NULL ? die->die_dbg : NULL;
 
@@ -155,14 +156,16 @@ dwarf_attrval_unsigned(Dwarf_Die die, Dw
 
*valp = 0;
 
-   if ((at = _dwarf_attr_find(die, attr)) == NULL && attr != DW_AT_type) {
-   DWARF_SET_ERROR(dbg, err, DW_DLE_NO_ENTRY);
-   return (DW_DLV_NO_ENTRY);
-   }
-
die1 = NULL;
-   if (at == NULL &&
-   (at = _dwarf_attr_find(die, DW_AT_abstract_origin)) != NULL) {
+   for (;;) {
+   if ((at = _dwarf_attr_find(die, attr)) != NULL ||
+   attr != DW_AT_type)
+   break;
+   if ((at = _dwarf_attr_find(die, DW_AT_abstract_origin)) ==
+   NULL &&
+   (at = _dwarf_attr_find(die, DW_AT_specification)) == NULL)
+   break;
+
switch (at->at_form) {
case DW_FORM_ref1:
case DW_FORM_ref2:
@@ -170,13 +173,15 @@ dwarf_attrval_unsigned(Dwarf_Die die, Dw
case DW_FORM_ref8:
case DW_FORM_ref_udata:
val = at->u[0].u64;
-   if ((die1 = _dwarf_die_find(die, val)) == NULL ||
-   (at = _dwarf_attr_find(die1, attr)) == NULL) {
-   if (die1 != NULL)
-   dwarf_dealloc(dbg, die1, DW_DLA_DIE);
+   first = (die1 == NULL);
+   die1 = _dwarf_die_find(die, val);
+   if (!first)
+   dwarf_dealloc(dbg, die, DW_DLA_DIE);
+   if (die1 == NULL) {
DWARF_SET_ERROR(dbg, err, DW_DLE_NO_ENTRY);
return (DW_DLV_NO_ENTRY);
}
+   die = die1;
break;
default:
DWARF_SET_ERROR(dbg, err, DW_DLE_ATTR_FORM_BAD);
@@ -184,6 +189,11 @@ dwarf_attrval_unsigned(Dwarf_Die die, Dw
}
}
 
+   if (at == NULL) {
+   DWARF_SET_ERROR(dbg, err, DW_DLE_NO_ENTRY);
+   return (DW_DLV_NO_ENTRY);
+   }
+
switch (at->at_form) {
case DW_FORM_addr:
case DW_FORM_data1:

Modified: head/contrib/elftoolchain/libdwarf/dwarf_attrval_signed.3
==
--- head/contrib/elftoolchain/libdwarf/dwarf_attrval_signed.3   Wed Dec 28 
21:45:41 2016(r310723)
+++ head/contrib/elftoolchain/libdwarf/dwarf_attrval_signed.3   Wed Dec 28 
21:54:33 2016(r310724)
@@ -24,7 +24,7 @@
 .\"
 .\" $Id: dwarf_attrval_signed.3 2980 2014-01-21 20:15:54Z kaiwang27 $
 .\"
-.Dd January 18, 2014
+.Dd December 26, 2016
 .Os
 .Dt DWARF_ATTRVAL_SIGNED 3
 .Sh NAME
@@ -168,17 +168,22 @@ or
 .Pp
 If the attribute named by argument
 .Ar attr
-is not present in the debugging information entry referenced by
-argument
+is
+.Dv DW_AT_type
+and is not present in the debugging information entry referenced by argument
 .Ar die ,
 and if a
 .Dv DW_AT_abstract_origin
+or
+.Dv DW_AT_specification
 attribute is present in the debugging information entry,
 function
 .Fn dwarf_attrval_unsigned
 will search for the named attribute in the debugging information entry
 referenced by the
 .Dv DW_AT_abstract_origin
+or
+.Dv DW_AT_specification
 attribute.
 .Sh RETURN VALUES
 On success, these functions returns
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/sv

svn commit: r310726 - head/sys/boot/i386/cdboot

2016-12-28 Thread Ed Maste
Author: emaste
Date: Wed Dec 28 23:02:01 2016
New Revision: 310726
URL: https://svnweb.freebsd.org/changeset/base/310726

Log:
  cdboot: add explict suffix to ambiguous or instruction
  
  Clang disallows ambiguous instructions (GNU as has a default based on
  chosen .code setting). We only need 'orb' here because KARGS_FLAGS_PXE
  fits in a byte; this is the same as done in bxeboot.
  
  Reviewed by:  kib
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D8959

Modified:
  head/sys/boot/i386/cdboot/cdboot.S

Modified: head/sys/boot/i386/cdboot/cdboot.S
==
--- head/sys/boot/i386/cdboot/cdboot.S  Wed Dec 28 21:58:20 2016
(r310725)
+++ head/sys/boot/i386/cdboot/cdboot.S  Wed Dec 28 23:02:01 2016
(r310726)
@@ -127,7 +127,7 @@ start:  cld # 
string ops inc
stosl   #  to zero
mov drive,%dl   # Store BIOS boot device
mov %dl,0x4(%bx)#  in kargs->bootdev
-   or $KARGS_FLAGS_CD,0x8(%bx) # kargs->bootflags |=
+   orb $KARGS_FLAGS_CD,0x8(%bx)# kargs->bootflags |=
#  KARGS_FLAGS_CD
 #
 # Load Volume Descriptor
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310727 - head/sbin/ipfw

2016-12-28 Thread Marius Strobl
Author: marius
Date: Wed Dec 28 23:34:28 2016
New Revision: 310727
URL: https://svnweb.freebsd.org/changeset/base/310727

Log:
  Fix a bug in r272840; given that the optlen parameter of setsockopt(2)
  is a 32-bit socklen_t, do_get3() passes the kernel to access the wrong
  32-bit half on big-endian LP64 machines when simply casting the 64-bit
  size_t optlen to a socklen_t pointer.
  While at it and given that the intention of do_get3() apparently is to
  hide/wrap the fact that socket options are used for communication with
  ipfw(4), change the optlen parameter of do_set3() to be of type size_t
  and as such more appropriate than uintptr_t, too.
  
  MFC after:3 days

Modified:
  head/sbin/ipfw/ipfw2.c
  head/sbin/ipfw/ipfw2.h

Modified: head/sbin/ipfw/ipfw2.c
==
--- head/sbin/ipfw/ipfw2.c  Wed Dec 28 23:02:01 2016(r310726)
+++ head/sbin/ipfw/ipfw2.c  Wed Dec 28 23:34:28 2016(r310727)
@@ -591,7 +591,7 @@ do_cmd(int optname, void *optval, uintpt
  * Returns 0 on success or errno otherwise.
  */
 int
-do_set3(int optname, ip_fw3_opheader *op3, uintptr_t optlen)
+do_set3(int optname, ip_fw3_opheader *op3, size_t optlen)
 {
 
if (co.test_only)
@@ -621,6 +621,7 @@ int
 do_get3(int optname, ip_fw3_opheader *op3, size_t *optlen)
 {
int error;
+   socklen_t len;
 
if (co.test_only)
return (0);
@@ -632,8 +633,9 @@ do_get3(int optname, ip_fw3_opheader *op
 
op3->opcode = optname;
 
-   error = getsockopt(ipfw_socket, IPPROTO_IP, IP_FW3, op3,
-   (socklen_t *)optlen);
+   len = *optlen;
+   error = getsockopt(ipfw_socket, IPPROTO_IP, IP_FW3, op3, &len);
+   *optlen = len;
 
return (error);
 }

Modified: head/sbin/ipfw/ipfw2.h
==
--- head/sbin/ipfw/ipfw2.h  Wed Dec 28 23:02:01 2016(r310726)
+++ head/sbin/ipfw/ipfw2.h  Wed Dec 28 23:34:28 2016(r310727)
@@ -329,7 +329,7 @@ void print_flags_buffer(char *buf, size_
 
 struct _ip_fw3_opheader;
 int do_cmd(int optname, void *optval, uintptr_t optlen);
-int do_set3(int optname, struct _ip_fw3_opheader *op3, uintptr_t optlen);
+int do_set3(int optname, struct _ip_fw3_opheader *op3, size_t optlen);
 int do_get3(int optname, struct _ip_fw3_opheader *op3, size_t *optlen);
 
 struct in6_addr;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310728 - in head: lib/libbsnmp/libbsnmp tools/build/mk

2016-12-28 Thread Ngie Cooper
Author: ngie
Date: Wed Dec 28 23:55:18 2016
New Revision: 310728
URL: https://svnweb.freebsd.org/changeset/base/310728

Log:
  Install {asn1,bsnmpagent,bsnmpclient,bsnmplib}.3 as all of the APIs
  they document
  
  Also, alphabetically sort MAN
  
  MFC after:3 days

Modified:
  head/lib/libbsnmp/libbsnmp/Makefile
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/lib/libbsnmp/libbsnmp/Makefile
==
--- head/lib/libbsnmp/libbsnmp/Makefile Wed Dec 28 23:34:28 2016
(r310727)
+++ head/lib/libbsnmp/libbsnmp/Makefile Wed Dec 28 23:55:18 2016
(r310728)
@@ -20,7 +20,97 @@ LIBADD=  crypto
 .endif
 
 SRCS=  asn1.c snmp.c snmpagent.c snmpclient.c snmpcrypto.c support.c
-INCS=  asn1.h snmp.h snmpagent.h snmpclient.h 
-MAN=   asn1.3 bsnmplib.3 bsnmpclient.3 bsnmpagent.3
+INCS=  asn1.h snmp.h snmpagent.h snmpclient.h
+MAN=   asn1.3 bsnmpagent.3 bsnmpclient.3 bsnmplib.3
+
+MLINKS+=   asn1.3  asn_append_oid.3
+MLINKS+=   asn1.3  asn_commit_header.3
+MLINKS+=   asn1.3  asn_compare_oid.3
+MLINKS+=   asn1.3  asn_get_counter64_raw.3
+MLINKS+=   asn1.3  asn_get_header.3
+MLINKS+=   asn1.3  asn_get_integer.3
+MLINKS+=   asn1.3  asn_get_integer_raw.3
+MLINKS+=   asn1.3  asn_get_ipaddress.3
+MLINKS+=   asn1.3  asn_get_ipaddress_raw.3
+MLINKS+=   asn1.3  asn_get_null.3
+MLINKS+=   asn1.3  asn_get_null_raw.3
+MLINKS+=   asn1.3  asn_get_objid.3
+MLINKS+=   asn1.3  asn_get_objid_raw.3
+MLINKS+=   asn1.3  asn_get_octetstring.3
+MLINKS+=   asn1.3  asn_get_octetstring_raw.3
+MLINKS+=   asn1.3  asn_get_sequence.3
+MLINKS+=   asn1.3  asn_get_timeticks.3
+MLINKS+=   asn1.3  asn_get_uint32_raw.3
+MLINKS+=   asn1.3  asn_is_suboid.3
+MLINKS+=   asn1.3  asn_oid2str.3
+MLINKS+=   asn1.3  asn_oid2str_r.3
+MLINKS+=   asn1.3  asn_put_counter64.3
+MLINKS+=   asn1.3  asn_put_exception.3
+MLINKS+=   asn1.3  asn_put_header.3
+MLINKS+=   asn1.3  asn_put_integer.3
+MLINKS+=   asn1.3  asn_put_ipaddress.3
+MLINKS+=   asn1.3  asn_put_null.3
+MLINKS+=   asn1.3  asn_put_objid.3
+MLINKS+=   asn1.3  asn_put_octetstring.3
+MLINKS+=   asn1.3  asn_put_temp_header.3
+MLINKS+=   asn1.3  asn_put_timeticks.3
+MLINKS+=   asn1.3  asn_put_uint32.3
+MLINKS+=   asn1.3  asn_skip.3
+MLINKS+=   asn1.3  asn_slice_oid.3
+
+MLINKS+=   bsnmpagent.3snmp_debug.3
+MLINKS+=   bsnmpagent.3snmp_dep_commit.3
+MLINKS+=   bsnmpagent.3snmp_dep_finish.3
+MLINKS+=   bsnmpagent.3snmp_dep_lookup.3
+MLINKS+=   bsnmpagent.3snmp_dep_rollback.3
+MLINKS+=   bsnmpagent.3snmp_depop_t.3
+MLINKS+=   bsnmpagent.3snmp_get.3
+MLINKS+=   bsnmpagent.3snmp_getbulk.3
+MLINKS+=   bsnmpagent.3snmp_getnext.3
+MLINKS+=   bsnmpagent.3snmp_init_context.3
+MLINKS+=   bsnmpagent.3snmp_make_errresp.3
+MLINKS+=   bsnmpagent.3snmp_op_t.3
+MLINKS+=   bsnmpagent.3snmp_set.3
+MLINKS+=   bsnmpagent.3snmp_trace.3
+MLINKS+=   bsnmpagent.3tree.3
+MLINKS+=   bsnmpagent.3tree_size.3
+
+MLINKS+=   bsnmpclient.3   snmp_add_binding.3
+MLINKS+=   bsnmpclient.3   snmp_client.3
+MLINKS+=   bsnmpclient.3   snmp_close.3
+MLINKS+=   bsnmpclient.3   snmp_dialog.3
+MLINKS+=   bsnmpclient.3   snmp_discover_engine.3
+MLINKS+=   bsnmpclient.3   snmp_oid_append.3
+MLINKS+=   bsnmpclient.3   snmp_open.3
+MLINKS+=   bsnmpclient.3   snmp_parse_server.3
+MLINKS+=   bsnmpclient.3   snmp_pdu_check.3
+MLINKS+=   bsnmpclient.3   snmp_pdu_create.3
+MLINKS+=   bsnmpclient.3   snmp_pdu_send.3
+MLINKS+=   bsnmpclient.3   snmp_receive.3
+MLINKS+=   bsnmpclient.3   snmp_send_cb_f.3
+MLINKS+=   bsnmpclient.3   snmp_table_cb_f.3
+MLINKS+=   bsnmpclient.3   snmp_table_fetch.3
+MLINKS+=   bsnmpclient.3   snmp_table_fetch_async.3
+MLINKS+=   bsnmpclient.3   snmp_timeout_cb_f.3
+MLINKS+=   bsnmpclient.3   snmp_timeout_start_f.3
+MLINKS+=   bsnmpclient.3   snmp_timeout_stop_f.3
+
+MLINKS+=   bsnmplib.3  TRUTH_GET.3
+MLINKS+=   bsnmplib.3  TRUTH_MK.3
+MLINKS+=   bsnmplib.3  TRUTH_OK.3
+MLINKS+=   bsnmplib.3  snmp_calc_keychange.3
+MLINKS+=   bsnmplib.3  snmp_get_local_keys.3
+MLINKS+=   bsnmplib.3  snmp_passwd_to_keys.3
+MLINKS+=   bsnmplib.3  snmp_pdu_decode.3
+MLINKS+=   bsnmplib.3  snmp_pdu_decode_header.3
+MLINKS+=   bsnmplib.3  snmp_pdu_decode_scoped.3
+MLINKS+=   bsnmplib.3  snmp_pdu_decode_secmode.3
+MLINKS+=   bsnmplib.3  snmp_pdu_dump.3
+MLINKS+=   bsnmplib.3  snmp_pdu_encode.3
+MLINKS+=   bsnmplib.3  snmp_pdu_free.3
+MLINKS+=   bsnmplib.3  snmp_pdu_init_secparams.3
+MLINKS+=   bsnmplib.3  snmp_value_copy.3
+MLINKS+=   bsnmplib.3  snmp_value_free.3
+MLINKS+=   bsnmplib.3  snmp_

svn commit: r310729 - head/contrib/bsnmp/lib

2016-12-28 Thread Ngie Cooper
Author: ngie
Date: Thu Dec 29 00:20:03 2016
New Revision: 310729
URL: https://svnweb.freebsd.org/changeset/base/310729

Log:
  Prevent improper memory accesses after calling snmp_pdu_free and 
snmp_value_free
  
  snmp_pdu_free: set pdu->nbindings to 0 to limit the damage that
  could happen if a pdu was reused after calling the function, and
  as both stack and heap allocation types are used in contrib/bsnmp
  and usr.sbin/bsnmpd.
  
  snmp_value_free: NULL out value->v.octetstring.octets after calling
  free on it to prevent a double-free from occurring.
  
  MFC after:  2 weeks

Modified:
  head/contrib/bsnmp/lib/snmp.c

Modified: head/contrib/bsnmp/lib/snmp.c
==
--- head/contrib/bsnmp/lib/snmp.c   Wed Dec 28 23:55:18 2016
(r310728)
+++ head/contrib/bsnmp/lib/snmp.c   Thu Dec 29 00:20:03 2016
(r310729)
@@ -1154,8 +1154,11 @@ snmp_pdu_dump(const struct snmp_pdu *pdu
 void
 snmp_value_free(struct snmp_value *value)
 {
-   if (value->syntax == SNMP_SYNTAX_OCTETSTRING)
+
+   if (value->syntax == SNMP_SYNTAX_OCTETSTRING) {
free(value->v.octetstring.octets);
+   value->v.octetstring.octets = NULL;
+   }
value->syntax = SNMP_SYNTAX_NULL;
 }
 
@@ -1216,6 +1219,7 @@ snmp_pdu_free(struct snmp_pdu *pdu)
 
for (i = 0; i < pdu->nbindings; i++)
snmp_value_free(&pdu->bindings[i]);
+   pdu->nbindings = 0;
 }
 
 /*
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310734 - head/sys/conf

2016-12-28 Thread John Baldwin
Author: jhb
Date: Thu Dec 29 01:11:57 2016
New Revision: 310734
URL: https://svnweb.freebsd.org/changeset/base/310734

Log:
  Note that the Chelsio T6 also supports 25Gbps.
  
  To avoid overflowing 80 columns, condense the cxgbe description a bit.
  
  Reviewed by:  np

Modified:
  head/sys/conf/NOTES

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Thu Dec 29 00:26:27 2016(r310733)
+++ head/sys/conf/NOTES Thu Dec 29 01:11:57 2016(r310734)
@@ -1956,7 +1956,7 @@ devicexmphy   # XaQti XMAC II
 # cm:  Arcnet SMC COM90c26 / SMC COM90c56
 #  (and SMC COM90c66 in '56 compatibility mode) adapters.
 # cxgb: Chelsio T3 based 1GbE/10GbE PCIe Ethernet adapters.
-# cxgbe:Chelsio T4, T5, and T6-based 1GbE/10GbE/40GbE/100GbE PCIe Ethernet
+# cxgbe:Chelsio T4, T5, and T6-based 1/10/25/40/100GbE PCIe Ethernet
 #  adapters.
 # cxgbev: Chelsio T4, T5, and T6-based PCIe Virtual Functions.
 # dc:   Support for PCI fast ethernet adapters based on the DEC/Intel 21143
@@ -2141,8 +2141,8 @@ devicexl  # 3Com 3c90x 
(``Boomerang'',
 # PCI Ethernet NICs.
 device cxgb# Chelsio T3 10 Gigabit Ethernet
 device cxgb_t3fw   # Chelsio T3 10 Gigabit Ethernet firmware
-device cxgbe   # Chelsio T4, T5, and T6 1GbE/10GbE/40GbE/100GbE
-device cxgbev  # Chelsio T4, T5, and T6 VF
+device cxgbe   # Chelsio T4-T6 1/10/25/40/100 Gigabit Ethernet
+device cxgbev  # Chelsio T4-T6 Virtual Functions
 device de  # DEC/Intel DC21x4x (``Tulip'')
 device em  # Intel Pro/1000 Gigabit Ethernet
 device igb # Intel Pro/1000 PCIE Gigabit Ethernet
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r310234 - head/sys/vm

2016-12-28 Thread Adrian Chadd
hi,

I've bisected a boot failure on mips24k (carambola2) to this commit.
Nothing useful is printed - it hangs at startup time.

Any ideas?


-adrian


On 18 December 2016 at 12:56, Konstantin Belousov  wrote:
> Author: kib
> Date: Sun Dec 18 20:56:14 2016
> New Revision: 310234
> URL: https://svnweb.freebsd.org/changeset/base/310234
>
> Log:
>   Improve vm_object_scan_all_shadowed() to also check swap backing objects.
>
>   As noted in the removed comment, it is possible and not prohibitively
>   costly to look up the swap blocks for the given page index.  Implement
>   a swap_pager_find_least() function to do that, and use it to iterate
>   simultaneously over both backing object page queue and swap
>   allocations when looking for shadowed pages.
>
>   Testing shows that number of new succesful scans, enabled by this
>   addition, is small but non-zero.  When worked out, the change both
>   further reduces the depth of the shadow object chain, and frees unused
>   but allocated swap and memory.
>
>   Suggested and reviewed by:alc
>   Tested by:pho (previous version)
>   Sponsored by: The FreeBSD Foundation
>   MFC after:2 weeks
>
> Modified:
>   head/sys/vm/swap_pager.c
>   head/sys/vm/swap_pager.h
>   head/sys/vm/vm_object.c
>
> Modified: head/sys/vm/swap_pager.c
> ==
> --- head/sys/vm/swap_pager.cSun Dec 18 20:40:22 2016(r310233)
> +++ head/sys/vm/swap_pager.cSun Dec 18 20:56:14 2016(r310234)
> @@ -2013,6 +2013,44 @@ swp_pager_meta_ctl(vm_object_t object, v
>  }
>
>  /*
> + * Returns the least page index which is greater than or equal to the
> + * parameter pindex and for which there is a swap block allocated.
> + * Returns object's size if the object's type is not swap or if there
> + * are no allocated swap blocks for the object after the requested
> + * pindex.
> + */
> +vm_pindex_t
> +swap_pager_find_least(vm_object_t object, vm_pindex_t pindex)
> +{
> +   struct swblock **pswap, *swap;
> +   vm_pindex_t i, j, lim;
> +   int idx;
> +
> +   VM_OBJECT_ASSERT_LOCKED(object);
> +   if (object->type != OBJT_SWAP || object->un_pager.swp.swp_bcount == 0)
> +   return (object->size);
> +
> +   mtx_lock(&swhash_mtx);
> +   for (j = pindex; j < object->size; j = lim) {
> +   pswap = swp_pager_hash(object, j);
> +   lim = rounddown2(j + SWAP_META_PAGES, SWAP_META_PAGES);
> +   if (lim > object->size)
> +   lim = object->size;
> +   if ((swap = *pswap) != NULL) {
> +   for (idx = j & SWAP_META_MASK, i = j; i < lim;
> +   i++, idx++) {
> +   if (swap->swb_pages[idx] != SWAPBLK_NONE)
> +   goto found;
> +   }
> +   }
> +   }
> +   i = object->size;
> +found:
> +   mtx_unlock(&swhash_mtx);
> +   return (i);
> +}
> +
> +/*
>   * System call swapon(name) enables swapping on device name,
>   * which must be in the swdevsw.  Return EBUSY
>   * if already swapping on this device.
>
> Modified: head/sys/vm/swap_pager.h
> ==
> --- head/sys/vm/swap_pager.hSun Dec 18 20:40:22 2016(r310233)
> +++ head/sys/vm/swap_pager.hSun Dec 18 20:56:14 2016(r310234)
> @@ -79,6 +79,7 @@ extern int swap_pager_avail;
>  struct xswdev;
>  int swap_dev_info(int name, struct xswdev *xs, char *devname, size_t len);
>  void swap_pager_copy(vm_object_t, vm_object_t, vm_pindex_t, int);
> +vm_pindex_t swap_pager_find_least(vm_object_t object, vm_pindex_t pindex);
>  void swap_pager_freespace(vm_object_t, vm_pindex_t, vm_size_t);
>  void swap_pager_swap_init(void);
>  int swap_pager_isswapped(vm_object_t, struct swdevt *);
>
> Modified: head/sys/vm/vm_object.c
> ==
> --- head/sys/vm/vm_object.c Sun Dec 18 20:40:22 2016(r310233)
> +++ head/sys/vm/vm_object.c Sun Dec 18 20:56:14 2016(r310234)
> @@ -1436,36 +1436,40 @@ vm_object_scan_all_shadowed(vm_object_t
>  {
> vm_object_t backing_object;
> vm_page_t p, pp;
> -   vm_pindex_t backing_offset_index, new_pindex;
> +   vm_pindex_t backing_offset_index, new_pindex, pi, ps;
>
> VM_OBJECT_ASSERT_WLOCKED(object);
> VM_OBJECT_ASSERT_WLOCKED(object->backing_object);
>
> backing_object = object->backing_object;
>
> -   /*
> -* Initial conditions:
> -*
> -* We do not want to have to test for the existence of swap
> -* pages in the backing object.  XXX but with the new swapper this
> -* would be pretty easy to do.
> -*/
> -   if (backing_object->type != OBJT_DEFAULT)
> +   if (backing_object->type != OBJT_DEFAULT &&
> +   backing_

svn commit: r310741 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Thu Dec 29 06:46:20 2016
New Revision: 310741
URL: https://svnweb.freebsd.org/changeset/base/310741

Log:
  sfxge(4): fix misuse of siena_build_filter in common code
  
  Submitted by:   Andy Moreton 
  Reviewed by:gnn
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days
  Differential Revision:  https://reviews.freebsd.org/D8937

Modified:
  head/sys/dev/sfxge/common/efx_filter.c

Modified: head/sys/dev/sfxge/common/efx_filter.c
==
--- head/sys/dev/sfxge/common/efx_filter.c  Thu Dec 29 06:45:36 2016
(r310740)
+++ head/sys/dev/sfxge/common/efx_filter.c  Thu Dec 29 06:46:20 2016
(r310741)
@@ -1179,6 +1179,7 @@ siena_filter_restore(
efx_oword_t filter;
int filter_idx;
int state;
+   uint32_t key;
efx_rc_t rc;
 
EFSYS_LOCK(enp->en_eslp, state);
@@ -1192,8 +1193,10 @@ siena_filter_restore(
continue;
 
spec = &sftp->sft_spec[filter_idx];
-   if ((rc = siena_filter_build(&filter, spec)) != 0)
+   if ((key = siena_filter_build(&filter, spec)) == 0) {
+   rc = EINVAL;
goto fail1;
+   }
if ((rc = siena_filter_push_entry(enp,
spec->sfs_type, filter_idx, &filter)) != 0)
goto fail2;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310742 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Thu Dec 29 06:47:53 2016
New Revision: 310742
URL: https://svnweb.freebsd.org/changeset/base/310742

Log:
  sfxge(4): fix common code for non-Siena builds
  
  Submitted by:   Andy Moreton 
  Reviewed by:gnn
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days
  Differential Revision:  https://reviews.freebsd.org/D8938

Modified:
  head/sys/dev/sfxge/common/efx.h

Modified: head/sys/dev/sfxge/common/efx.h
==
--- head/sys/dev/sfxge/common/efx.h Thu Dec 29 06:46:20 2016
(r310741)
+++ head/sys/dev/sfxge/common/efx.h Thu Dec 29 06:47:53 2016
(r310742)
@@ -1105,18 +1105,16 @@ typedef struct efx_nic_cfg_s {
 #if EFSYS_OPT_PHY_STATS
uint64_tenc_phy_stat_mask;
 #endif /* EFSYS_OPT_PHY_STATS */
-#if EFSYS_OPT_SIENA
+#if EFSYS_OPT_MCDI
uint8_t enc_mcdi_mdio_channel;
 #if EFSYS_OPT_PHY_STATS
uint32_tenc_mcdi_phy_stat_mask;
 #endif /* EFSYS_OPT_PHY_STATS */
-#endif /* EFSYS_OPT_SIENA */
-#if (EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
 #if EFSYS_OPT_MON_STATS
uint32_t*enc_mcdi_sensor_maskp;
uint32_tenc_mcdi_sensor_mask_size;
 #endif /* EFSYS_OPT_MON_STATS */
-#endif /* (EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) */
+#endif /* EFSYS_OPT_MCDI */
 #if EFSYS_OPT_BIST
uint32_tenc_bist_mask;
 #endif /* EFSYS_OPT_BIST */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310744 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Thu Dec 29 06:49:32 2016
New Revision: 310744
URL: https://svnweb.freebsd.org/changeset/base/310744

Log:
  sfxge(4): fix efx_ev_qpoll for non-Siena builds
  
  Both Siena and EF10 use the siena_ev_qpoll() implementation, but this
  function is not defined in builds without EFSYS_OPT_SIENA.
  
  Remove siena_ev_qpoll and inline it into efx_ev_qpoll to allow it
  to be used in non-Siena builds.
  
  Also remove outdated FIXME comment, as EF10 event batching/merging has
  been implemented long ago without needing to modify this code.
  
  Submitted by:   Andy Moreton 
  Reviewed by:gnn
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  1 week
  Differential Revision:  https://reviews.freebsd.org/D8939

Modified:
  head/sys/dev/sfxge/common/efx_ev.c

Modified: head/sys/dev/sfxge/common/efx_ev.c
==
--- head/sys/dev/sfxge/common/efx_ev.c  Thu Dec 29 06:48:10 2016
(r310743)
+++ head/sys/dev/sfxge/common/efx_ev.c  Thu Dec 29 06:49:32 2016
(r310744)
@@ -84,13 +84,6 @@ siena_ev_qprime(
__inunsigned int count);
 
 static void
-siena_ev_qpoll(
-   __inefx_evq_t *eep,
-   __inout unsigned int *countp,
-   __inconst efx_ev_callbacks_t *eecp,
-   __in_optvoid *arg);
-
-static void
 siena_ev_qpost(
__inefx_evq_t *eep,
__inuint16_t data);
@@ -362,6 +355,8 @@ efx_ev_qprefetch(
 
 #endif /* EFSYS_OPT_EV_PREFETCH */
 
+#defineEFX_EV_BATCH8
+
void
 efx_ev_qpoll(
__inefx_evq_t *eep,
@@ -369,14 +364,14 @@ efx_ev_qpoll(
__inconst efx_ev_callbacks_t *eecp,
__in_optvoid *arg)
 {
-   EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC);
+   efx_qword_t ev[EFX_EV_BATCH];
+   unsigned int batch;
+   unsigned int total;
+   unsigned int count;
+   unsigned int index;
+   size_t offset;
 
-   /*
-* FIXME: Huntington will require support for hardware event batching
-* and merging, which will need a different ev_qpoll implementation.
-*
-* Without those features the Falcon/Siena code can be used unchanged.
-*/
+   /* Ensure events codes match for EF10 (Huntington/Medford) and Siena */
EFX_STATIC_ASSERT(ESF_DZ_EV_CODE_LBN == FSF_AZ_EV_CODE_LBN);
EFX_STATIC_ASSERT(ESF_DZ_EV_CODE_WIDTH == FSF_AZ_EV_CODE_WIDTH);
 
@@ -389,7 +384,125 @@ efx_ev_qpoll(
EFX_STATIC_ASSERT(ESE_DZ_EV_CODE_MCDI_EV ==
FSE_AZ_EV_CODE_MCDI_EVRESPONSE);
 #endif
-   siena_ev_qpoll(eep, countp, eecp, arg);
+
+   EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC);
+   EFSYS_ASSERT(countp != NULL);
+   EFSYS_ASSERT(eecp != NULL);
+
+   count = *countp;
+   do {
+   /* Read up until the end of the batch period */
+   batch = EFX_EV_BATCH - (count & (EFX_EV_BATCH - 1));
+   offset = (count & eep->ee_mask) * sizeof (efx_qword_t);
+   for (total = 0; total < batch; ++total) {
+   EFSYS_MEM_READQ(eep->ee_esmp, offset, &(ev[total]));
+
+   if (!EFX_EV_PRESENT(ev[total]))
+   break;
+
+   EFSYS_PROBE3(event, unsigned int, eep->ee_index,
+   uint32_t, EFX_QWORD_FIELD(ev[total], EFX_DWORD_1),
+   uint32_t, EFX_QWORD_FIELD(ev[total], EFX_DWORD_0));
+
+   offset += sizeof (efx_qword_t);
+   }
+
+#if EFSYS_OPT_EV_PREFETCH && (EFSYS_OPT_EV_PREFETCH_PERIOD > 1)
+   /*
+* Prefetch the next batch when we get within PREFETCH_PERIOD
+* of a completed batch. If the batch is smaller, then prefetch
+* immediately.
+*/
+   if (total == batch && total < EFSYS_OPT_EV_PREFETCH_PERIOD)
+   EFSYS_MEM_PREFETCH(eep->ee_esmp, offset);
+#endif /* EFSYS_OPT_EV_PREFETCH */
+
+   /* Process the batch of events */
+   for (index = 0; index < total; ++index) {
+   boolean_t should_abort;
+   uint32_t code;
+
+#if EFSYS_OPT_EV_PREFETCH
+   /* Prefetch if we've now reached the batch period */
+   if (total == batch &&
+   index + EFSYS_OPT_EV_PREFETCH_PERIOD == total) {
+   offset = (count + batch) & eep->ee_mask;
+   offset *= sizeof (efx_qword_t);
+
+   EFSYS_MEM_PREFETCH(eep->ee_esmp, offset);
+   }
+#endif /* EFSYS_OPT_EV_PREFETCH */
+
+   EFX_EV_QSTAT_INCR(eep, EV_ALL);
+
+   code = EFX_QWORD_FIELD(ev[index], FSF_AZ_EV_CODE);
+  

svn commit: r310745 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Thu Dec 29 06:51:06 2016
New Revision: 310745
URL: https://svnweb.freebsd.org/changeset/base/310745

Log:
  sfxge(4): make the common code retrieve the number of FATSOv2 contexts
  
  Submitted by:   Ivan Malov 
  Reviewed by:gnn
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days
  Differential Revision:  https://reviews.freebsd.org/D8940

Modified:
  head/sys/dev/sfxge/common/ef10_nic.c
  head/sys/dev/sfxge/common/efx.h
  head/sys/dev/sfxge/common/siena_nic.c

Modified: head/sys/dev/sfxge/common/ef10_nic.c
==
--- head/sys/dev/sfxge/common/ef10_nic.cThu Dec 29 06:49:32 2016
(r310744)
+++ head/sys/dev/sfxge/common/ef10_nic.cThu Dec 29 06:51:06 2016
(r310745)
@@ -497,7 +497,8 @@ static  __checkReturn   efx_rc_t
 efx_mcdi_get_capabilities(
__inefx_nic_t *enp,
__out   uint32_t *flagsp,
-   __out   uint32_t *flags2p)
+   __out   uint32_t *flags2p,
+   __out   uint32_t *tso2ncp)
 {
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_GET_CAPABILITIES_IN_LEN,
@@ -525,10 +526,14 @@ efx_mcdi_get_capabilities(
 
*flagsp = MCDI_OUT_DWORD(req, GET_CAPABILITIES_OUT_FLAGS1);
 
-   if (req.emr_out_length_used < MC_CMD_GET_CAPABILITIES_V2_OUT_LEN)
+   if (req.emr_out_length_used < MC_CMD_GET_CAPABILITIES_V2_OUT_LEN) {
*flags2p = 0;
-   else
+   *tso2ncp = 0;
+   } else {
*flags2p = MCDI_OUT_DWORD(req, GET_CAPABILITIES_V2_OUT_FLAGS2);
+   *tso2ncp = MCDI_OUT_WORD(req,
+   GET_CAPABILITIES_V2_OUT_TX_TSO_V2_N_CONTEXTS);
+   }
 
return (0);
 
@@ -963,9 +968,11 @@ ef10_get_datapath_caps(
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
uint32_t flags;
uint32_t flags2;
+   uint32_t tso2nc;
efx_rc_t rc;
 
-   if ((rc = efx_mcdi_get_capabilities(enp, &flags, &flags2)) != 0)
+   if ((rc = efx_mcdi_get_capabilities(enp, &flags, &flags2,
+   &tso2nc)) != 0)
goto fail1;
 
 #defineCAP_FLAG(flags1, field) \
@@ -992,6 +999,10 @@ ef10_get_datapath_caps(
encp->enc_fw_assisted_tso_v2_enabled =
CAP_FLAG2(flags2, TX_TSO_V2) ? B_TRUE : B_FALSE;
 
+   /* Get the number of TSO contexts (FATSOv2) */
+   encp->enc_fw_assisted_tso_v2_n_contexts =
+   CAP_FLAG2(flags2, TX_TSO_V2) ? tso2nc : 0;
+
/* Check if the firmware has vadapter/vport/vswitch support */
encp->enc_datapath_cap_evb =
CAP_FLAG(flags, EVB) ? B_TRUE : B_FALSE;

Modified: head/sys/dev/sfxge/common/efx.h
==
--- head/sys/dev/sfxge/common/efx.h Thu Dec 29 06:49:32 2016
(r310744)
+++ head/sys/dev/sfxge/common/efx.h Thu Dec 29 06:51:06 2016
(r310745)
@@ -1139,6 +1139,8 @@ typedef struct efx_nic_cfg_s {
uint32_tenc_tx_tso_tcp_header_offset_limit;
boolean_t   enc_fw_assisted_tso_enabled;
boolean_t   enc_fw_assisted_tso_v2_enabled;
+   /* Number of TSO contexts on the NIC (FATSOv2) */
+   uint32_tenc_fw_assisted_tso_v2_n_contexts;
boolean_t   enc_hw_tx_insert_vlan_enabled;
/* Datapath firmware vadapter/vport/vswitch support */
boolean_t   enc_datapath_cap_evb;

Modified: head/sys/dev/sfxge/common/siena_nic.c
==
--- head/sys/dev/sfxge/common/siena_nic.c   Thu Dec 29 06:49:32 2016
(r310744)
+++ head/sys/dev/sfxge/common/siena_nic.c   Thu Dec 29 06:51:06 2016
(r310745)
@@ -152,6 +152,7 @@ siena_board_cfg(
encp->enc_hw_tx_insert_vlan_enabled = B_FALSE;
encp->enc_fw_assisted_tso_enabled = B_FALSE;
encp->enc_fw_assisted_tso_v2_enabled = B_FALSE;
+   encp->enc_fw_assisted_tso_v2_n_contexts = 0;
encp->enc_allow_set_mac_with_installed_filters = B_TRUE;
 
/* Siena supports two 10G ports, and 8 lanes of PCIe Gen2 */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310746 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Thu Dec 29 06:52:42 2016
New Revision: 310746
URL: https://svnweb.freebsd.org/changeset/base/310746

Log:
  sfxge(4): make the common code determine the number of PFs
  
  Submitted by:   Ivan Malov 
  Reviewed by:gnn
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days
  Differential Revision:  https://reviews.freebsd.org/D8941

Modified:
  head/sys/dev/sfxge/common/ef10_nic.c
  head/sys/dev/sfxge/common/efx.h
  head/sys/dev/sfxge/common/siena_nic.c

Modified: head/sys/dev/sfxge/common/ef10_nic.c
==
--- head/sys/dev/sfxge/common/ef10_nic.cThu Dec 29 06:51:06 2016
(r310745)
+++ head/sys/dev/sfxge/common/ef10_nic.cThu Dec 29 06:52:42 2016
(r310746)
@@ -961,6 +961,50 @@ ef10_nic_pio_unlink(
return (efx_mcdi_unlink_piobuf(enp, vi_index));
 }
 
+static __checkReturn   efx_rc_t
+ef10_mcdi_get_pf_count(
+   __inefx_nic_t *enp,
+   __out   uint32_t *pf_countp)
+{
+   efx_mcdi_req_t req;
+   uint8_t payload[MAX(MC_CMD_GET_PF_COUNT_IN_LEN,
+   MC_CMD_GET_PF_COUNT_OUT_LEN)];
+   efx_rc_t rc;
+
+   (void) memset(payload, 0, sizeof (payload));
+   req.emr_cmd = MC_CMD_GET_PF_COUNT;
+   req.emr_in_buf = payload;
+   req.emr_in_length = MC_CMD_GET_PF_COUNT_IN_LEN;
+   req.emr_out_buf = payload;
+   req.emr_out_length = MC_CMD_GET_PF_COUNT_OUT_LEN;
+
+   efx_mcdi_execute(enp, &req);
+
+   if (req.emr_rc != 0) {
+   rc = req.emr_rc;
+   goto fail1;
+   }
+
+   if (req.emr_out_length_used < MC_CMD_GET_PF_COUNT_OUT_LEN) {
+   rc = EMSGSIZE;
+   goto fail2;
+   }
+
+   *pf_countp = *MCDI_OUT(req, uint8_t,
+   MC_CMD_GET_PF_COUNT_OUT_PF_COUNT_OFST);
+
+   EFSYS_ASSERT(*pf_countp != 0);
+
+   return (0);
+
+fail2:
+   EFSYS_PROBE(fail2);
+fail1:
+   EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+   return (rc);
+}
+
__checkReturn   efx_rc_t
 ef10_get_datapath_caps(
__inefx_nic_t *enp)
@@ -975,6 +1019,9 @@ ef10_get_datapath_caps(
&tso2nc)) != 0)
goto fail1;
 
+   if ((rc = ef10_mcdi_get_pf_count(enp, &encp->enc_hw_pf_count)) != 0)
+   goto fail1;
+
 #defineCAP_FLAG(flags1, field) \
((flags1) & (1 << (MC_CMD_GET_CAPABILITIES_V2_OUT_ ## field ## _LBN)))
 

Modified: head/sys/dev/sfxge/common/efx.h
==
--- head/sys/dev/sfxge/common/efx.h Thu Dec 29 06:51:06 2016
(r310745)
+++ head/sys/dev/sfxge/common/efx.h Thu Dec 29 06:52:42 2016
(r310746)
@@ -1142,6 +1142,8 @@ typedef struct efx_nic_cfg_s {
/* Number of TSO contexts on the NIC (FATSOv2) */
uint32_tenc_fw_assisted_tso_v2_n_contexts;
boolean_t   enc_hw_tx_insert_vlan_enabled;
+   /* Number of PFs on the NIC */
+   uint32_tenc_hw_pf_count;
/* Datapath firmware vadapter/vport/vswitch support */
boolean_t   enc_datapath_cap_evb;
boolean_t   enc_rx_disable_scatter_supported;

Modified: head/sys/dev/sfxge/common/siena_nic.c
==
--- head/sys/dev/sfxge/common/siena_nic.c   Thu Dec 29 06:51:06 2016
(r310745)
+++ head/sys/dev/sfxge/common/siena_nic.c   Thu Dec 29 06:52:42 2016
(r310746)
@@ -105,6 +105,13 @@ siena_board_cfg(
 
encp->enc_board_type = board_type;
 
+   /*
+* There is no possibility to determine the number of PFs on Siena
+* by issuing MCDI request, and it is not an easy task to find the
+* value based on the board type, so 'enc_hw_pf_count' is set to 1
+*/
+   encp->enc_hw_pf_count = 1;
+
/* Additional capabilities */
encp->enc_clk_mult = 1;
if (EFX_DWORD_FIELD(capabilities, MC_CMD_CAPABILITIES_TURBO)) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310747 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Thu Dec 29 06:54:40 2016
New Revision: 310747
URL: https://svnweb.freebsd.org/changeset/base/310747

Log:
  sfxge(4): provide a way to find out which MAC stats are supported
  
  Reviewed by:gnn
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days
  Differential Revision:  https://reviews.freebsd.org/D8944

Modified:
  head/sys/dev/sfxge/common/ef10_impl.h
  head/sys/dev/sfxge/common/ef10_mac.c
  head/sys/dev/sfxge/common/ef10_nic.c
  head/sys/dev/sfxge/common/efx.h
  head/sys/dev/sfxge/common/efx_impl.h
  head/sys/dev/sfxge/common/efx_mac.c
  head/sys/dev/sfxge/common/siena_impl.h
  head/sys/dev/sfxge/common/siena_mac.c

Modified: head/sys/dev/sfxge/common/ef10_impl.h
==
--- head/sys/dev/sfxge/common/ef10_impl.h   Thu Dec 29 06:52:42 2016
(r310746)
+++ head/sys/dev/sfxge/common/ef10_impl.h   Thu Dec 29 06:54:40 2016
(r310747)
@@ -273,6 +273,12 @@ ef10_mac_loopback_set(
 #if EFSYS_OPT_MAC_STATS
 
 extern __checkReturn   efx_rc_t
+ef10_mac_stats_get_mask(
+   __inefx_nic_t *enp,
+   __inout_bcount(mask_size)   uint32_t *maskp,
+   __insize_t mask_size);
+
+extern __checkReturn   efx_rc_t
 ef10_mac_stats_update(
__inefx_nic_t *enp,
__inefsys_mem_t *esmp,

Modified: head/sys/dev/sfxge/common/ef10_mac.c
==
--- head/sys/dev/sfxge/common/ef10_mac.cThu Dec 29 06:52:42 2016
(r310746)
+++ head/sys/dev/sfxge/common/ef10_mac.cThu Dec 29 06:54:40 2016
(r310747)
@@ -484,6 +484,89 @@ fail1:
 
 #if EFSYS_OPT_MAC_STATS
 
+   __checkReturn   efx_rc_t
+ef10_mac_stats_get_mask(
+   __inefx_nic_t *enp,
+   __inout_bcount(mask_size)   uint32_t *maskp,
+   __insize_t mask_size)
+{
+   const struct efx_mac_stats_range ef10_common[] = {
+   { EFX_MAC_RX_OCTETS, EFX_MAC_RX_GE_15XX_PKTS },
+   { EFX_MAC_RX_FCS_ERRORS, EFX_MAC_RX_DROP_EVENTS },
+   { EFX_MAC_RX_JABBER_PKTS, EFX_MAC_RX_JABBER_PKTS },
+   { EFX_MAC_RX_NODESC_DROP_CNT, EFX_MAC_TX_PAUSE_PKTS },
+   };
+   const struct efx_mac_stats_range ef10_tx_size_bins[] = {
+   { EFX_MAC_TX_LE_64_PKTS, EFX_MAC_TX_GE_15XX_PKTS },
+   };
+   efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
+   efx_port_t *epp = &(enp->en_port);
+   efx_rc_t rc;
+
+   if ((rc = efx_mac_stats_mask_add_ranges(maskp, mask_size,
+   ef10_common, EFX_ARRAY_SIZE(ef10_common))) != 0)
+   goto fail1;
+
+   if (epp->ep_phy_cap_mask & (1 << MC_CMD_PHY_CAP_4FDX_LBN)) {
+   const struct efx_mac_stats_range ef10_40g_extra[] = {
+   { EFX_MAC_RX_ALIGN_ERRORS, EFX_MAC_RX_ALIGN_ERRORS },
+   };
+
+   if ((rc = efx_mac_stats_mask_add_ranges(maskp, mask_size,
+   ef10_40g_extra, EFX_ARRAY_SIZE(ef10_40g_extra))) != 0)
+   goto fail2;
+
+   if (encp->enc_mac_stats_40g_tx_size_bins) {
+   if ((rc = efx_mac_stats_mask_add_ranges(maskp,
+   mask_size, ef10_tx_size_bins,
+   EFX_ARRAY_SIZE(ef10_tx_size_bins))) != 0)
+   goto fail3;
+   }
+   } else {
+   if ((rc = efx_mac_stats_mask_add_ranges(maskp, mask_size,
+   ef10_tx_size_bins, EFX_ARRAY_SIZE(ef10_tx_size_bins))) != 0)
+   goto fail4;
+   }
+
+   if (encp->enc_pm_and_rxdp_counters) {
+   const struct efx_mac_stats_range ef10_pm_and_rxdp[] = {
+   { EFX_MAC_PM_TRUNC_BB_OVERFLOW, EFX_MAC_RXDP_HLB_WAIT },
+   };
+
+   if ((rc = efx_mac_stats_mask_add_ranges(maskp, mask_size,
+   ef10_pm_and_rxdp, EFX_ARRAY_SIZE(ef10_pm_and_rxdp))) != 0)
+   goto fail5;
+   }
+
+   if (encp->enc_datapath_cap_evb) {
+   const struct efx_mac_stats_range ef10_vadaptor[] = {
+   { EFX_MAC_VADAPTER_RX_UNICAST_PACKETS,
+   EFX_MAC_VADAPTER_TX_OVERFLOW },
+   };
+
+   if ((rc = efx_mac_stats_mask_add_ranges(maskp, mask_size,
+   ef10_vadaptor, EFX_ARRAY_SIZE(ef10_vadaptor))) != 0)
+   goto fail6;
+   }
+
+   return (0);
+
+fail6:
+   EFSYS_PROBE(fail6);
+fail5:
+   EFSYS_PROBE(fail5);
+fail4:
+   EFSYS_PROBE(fail4);
+fail3:
+   EFSYS_PROBE(fail3);
+fail2:
+   EFSYS_PROBE(fail2);
+fail1:
+   EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+   return (rc);
+}
+
 #define 

svn commit: r310748 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Thu Dec 29 06:56:18 2016
New Revision: 310748
URL: https://svnweb.freebsd.org/changeset/base/310748

Log:
  sfxge(4): cleanup: simplify disable scatter logic in ef10_rx_qcreate
  
  Reviewed by:gnn
  Submitted by:   Andy Moreton 
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days
  Differential Revision:  https://reviews.freebsd.org/D8945

Modified:
  head/sys/dev/sfxge/common/ef10_rx.c

Modified: head/sys/dev/sfxge/common/ef10_rx.c
==
--- head/sys/dev/sfxge/common/ef10_rx.c Thu Dec 29 06:54:40 2016
(r310747)
+++ head/sys/dev/sfxge/common/ef10_rx.c Thu Dec 29 06:56:18 2016
(r310748)
@@ -769,12 +769,10 @@ ef10_rx_qcreate(
}
 
/* Scatter can only be disabled if the firmware supports doing so */
-   if ((type != EFX_RXQ_TYPE_SCATTER) &&
-   enp->en_nic_cfg.enc_rx_disable_scatter_supported) {
-   disable_scatter = B_TRUE;
-   } else {
+   if (type == EFX_RXQ_TYPE_SCATTER)
disable_scatter = B_FALSE;
-   }
+   else
+   disable_scatter = encp->enc_rx_disable_scatter_supported;
 
if ((rc = efx_mcdi_init_rxq(enp, n, eep->ee_index, label, index,
esmp, disable_scatter)) != 0)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310749 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Thu Dec 29 06:57:36 2016
New Revision: 310749
URL: https://svnweb.freebsd.org/changeset/base/310749

Log:
  sfxge(4): use correct port number in sensor decoding
  
  The port mask used for per-port sensors in mcdi_sensor_map
  assumes zero-based port numbering. The port mask used in
  the code is based on the one-based MCDI port number.
  
  Fix this to lookup the correct per-port sensors, and to
  allow reporting of sensor events from higher port numbers.
  
  Submitted by:   Andy Moreton 
  Reviewed by:gnn
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days
  Differential Revision:  https://reviews.freebsd.org/D8947

Modified:
  head/sys/dev/sfxge/common/mcdi_mon.c

Modified: head/sys/dev/sfxge/common/mcdi_mon.c
==
--- head/sys/dev/sfxge/common/mcdi_mon.cThu Dec 29 06:56:18 2016
(r310748)
+++ head/sys/dev/sfxge/common/mcdi_mon.cThu Dec 29 06:57:36 2016
(r310749)
@@ -50,6 +50,9 @@ __FBSDID("$FreeBSD$");
 #defineMCDI_MON_PORT_P4(0x08)
 #defineMCDI_MON_PORT_Px(0x)
 
+/* Get port mask from one-based MCDI port number */
+#defineMCDI_MON_PORT_MASK(_emip) (1U << ((_emip)->emi_port - 1))
+
 /* Entry for MCDI sensor in sensor map */
 #defineSTAT(portmask, stat)\
{ (MCDI_MON_PORT_##portmask), (EFX_MON_STAT_##stat) }
@@ -166,10 +169,10 @@ static const struct mcdi_sensor_map_s {
 static void
 mcdi_mon_decode_stats(
__inefx_nic_t *enp,
-   __in_ecount(sensor_mask_size)   uint32_t *sensor_mask,
+   __in_bcount(sensor_mask_size)   uint32_t *sensor_mask,
__insize_t sensor_mask_size,
__in_optefsys_mem_t *esmp,
-   __out_ecount_opt(sensor_mask_size)  uint32_t *stat_maskp,
+   __out_bcount_opt(sensor_mask_size)  uint32_t *stat_maskp,
__inout_ecount_opt(EFX_MON_NSTATS)  efx_mon_stat_value_t *stat)
 {
efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
@@ -192,7 +195,8 @@ mcdi_mon_decode_stats(
sensor_max =
MIN((8 * sensor_mask_size), EFX_ARRAY_SIZE(mcdi_sensor_map));
 
-   port_mask = 1U << emip->emi_port;
+   EFSYS_ASSERT(emip->emi_port > 0); /* MCDI port number is one-based */
+   port_mask = MCDI_MON_PORT_MASK(emip);
 
memset(stat_mask, 0, sizeof (stat_mask));
 
@@ -269,9 +273,8 @@ mcdi_mon_ev(
efx_mon_stat_t id;
efx_rc_t rc;
 
-   port_mask = (emip->emi_port == 1)
-   ? MCDI_MON_PORT_P1
-   : MCDI_MON_PORT_P2;
+   EFSYS_ASSERT(emip->emi_port > 0); /* MCDI port number is one-based */
+   port_mask = MCDI_MON_PORT_MASK(emip);
 
sensor = (uint16_t)MCDI_EV_FIELD(eqp, SENSOREVT_MONITOR);
state = (uint16_t)MCDI_EV_FIELD(eqp, SENSOREVT_STATE);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310750 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Thu Dec 29 06:58:51 2016
New Revision: 310750
URL: https://svnweb.freebsd.org/changeset/base/310750

Log:
  sfxge(4): add missing barrier in common code MCDI response handling
  
  The semantics of the MCDI interfacve require reading the first
  dword of the header before any other data in the buffer. Add
  a barrier to the common code MCDI handler to enforce this.
  
  Submitted by:   Andy Moreton 
  Reviewed by:gnn
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  1 week
  Differential Revision:  https://reviews.freebsd.org/D8949

Modified:
  head/sys/dev/sfxge/common/ef10_mcdi.c

Modified: head/sys/dev/sfxge/common/ef10_mcdi.c
==
--- head/sys/dev/sfxge/common/ef10_mcdi.c   Thu Dec 29 06:57:36 2016
(r310749)
+++ head/sys/dev/sfxge/common/ef10_mcdi.c   Thu Dec 29 06:58:51 2016
(r310750)
@@ -159,6 +159,8 @@ ef10_mcdi_poll_response(
efx_dword_t hdr;
 
EFSYS_MEM_READD(esmp, 0, &hdr);
+   EFSYS_MEM_READ_BARRIER();
+
return (EFX_DWORD_FIELD(hdr, MCDI_HEADER_RESPONSE) ? B_TRUE : B_FALSE);
 }
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310752 - in head/sys/dev/sfxge: . common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Thu Dec 29 07:00:26 2016
New Revision: 310752
URL: https://svnweb.freebsd.org/changeset/base/310752

Log:
  sfxge(4): allow to have no NIC handle on Rx datapath in DPDK PMD
  
  It is required to minimize RxQ context in the driver or avoid chaising
  for the NIC handle in adapter (global per-interface) structure.
  
  Reviewed by:gnn
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days
  Differential Revision:  https://reviews.freebsd.org/D8950

Modified:
  head/sys/dev/sfxge/common/efx.h
  head/sys/dev/sfxge/common/efx_rx.c
  head/sys/dev/sfxge/sfxge_rx.c

Modified: head/sys/dev/sfxge/common/efx.h
==
--- head/sys/dev/sfxge/common/efx.h Thu Dec 29 06:59:24 2016
(r310751)
+++ head/sys/dev/sfxge/common/efx.h Thu Dec 29 07:00:26 2016
(r310752)
@@ -1921,7 +1921,7 @@ efx_rx_scale_key_set(
 
 extern __checkReturn   uint32_t
 efx_psuedo_hdr_hash_get(
-   __inefx_nic_t *enp,
+   __inefx_rxq_t *erp,
__inefx_rx_hash_alg_t func,
__inuint8_t *buffer);
 
@@ -1929,7 +1929,7 @@ efx_psuedo_hdr_hash_get(
 
 extern __checkReturn   efx_rc_t
 efx_psuedo_hdr_pkt_length_get(
-   __inefx_nic_t *enp,
+   __inefx_rxq_t *erp,
__inuint8_t *buffer,
__out   uint16_t *pkt_lengthp);
 

Modified: head/sys/dev/sfxge/common/efx_rx.c
==
--- head/sys/dev/sfxge/common/efx_rx.c  Thu Dec 29 06:59:24 2016
(r310751)
+++ head/sys/dev/sfxge/common/efx_rx.c  Thu Dec 29 07:00:26 2016
(r310752)
@@ -541,24 +541,30 @@ efx_rx_qdestroy(
 
__checkReturn   efx_rc_t
 efx_psuedo_hdr_pkt_length_get(
-   __inefx_nic_t *enp,
+   __inefx_rxq_t *erp,
__inuint8_t *buffer,
__out   uint16_t *lengthp)
 {
+   efx_nic_t *enp = erp->er_enp;
const efx_rx_ops_t *erxop = enp->en_erxop;
 
+   EFSYS_ASSERT3U(erp->er_magic, ==, EFX_RXQ_MAGIC);
+
return (erxop->erxo_prefix_pktlen(enp, buffer, lengthp));
 }
 
 #if EFSYS_OPT_RX_SCALE
__checkReturn   uint32_t
 efx_psuedo_hdr_hash_get(
-   __inefx_nic_t *enp,
+   __inefx_rxq_t *erp,
__inefx_rx_hash_alg_t func,
__inuint8_t *buffer)
 {
+   efx_nic_t *enp = erp->er_enp;
const efx_rx_ops_t *erxop = enp->en_erxop;
 
+   EFSYS_ASSERT3U(erp->er_magic, ==, EFX_RXQ_MAGIC);
+
EFSYS_ASSERT3U(enp->en_hash_support, ==, EFX_RX_HASH_AVAILABLE);
return (erxop->erxo_prefix_hash(enp, func, buffer));
 }

Modified: head/sys/dev/sfxge/sfxge_rx.c
==
--- head/sys/dev/sfxge/sfxge_rx.c   Thu Dec 29 06:59:24 2016
(r310751)
+++ head/sys/dev/sfxge/sfxge_rx.c   Thu Dec 29 07:00:26 2016
(r310752)
@@ -330,8 +330,9 @@ static void __sfxge_rx_deliver(struct sf
 }
 
 static void
-sfxge_rx_deliver(struct sfxge_softc *sc, struct sfxge_rx_sw_desc *rx_desc)
+sfxge_rx_deliver(struct sfxge_rxq *rxq, struct sfxge_rx_sw_desc *rx_desc)
 {
+   struct sfxge_softc *sc = rxq->sc;
struct mbuf *m = rx_desc->mbuf;
int flags = rx_desc->flags;
int csum_flags;
@@ -344,7 +345,7 @@ sfxge_rx_deliver(struct sfxge_softc *sc,
 
if (flags & (EFX_PKT_IPV4 | EFX_PKT_IPV6)) {
m->m_pkthdr.flowid =
-   efx_psuedo_hdr_hash_get(sc->enp,
+   efx_psuedo_hdr_hash_get(rxq->common,
EFX_RX_HASHALG_TOEPLITZ,
mtod(m, uint8_t *));
/* The hash covers a 4-tuple for TCP only */
@@ -423,7 +424,7 @@ static void sfxge_lro_drop(struct sfxge_
KASSERT(!c->mbuf, ("found orphaned mbuf"));
 
if (c->next_buf.mbuf != NULL) {
-   sfxge_rx_deliver(rxq->sc, &c->next_buf);
+   sfxge_rx_deliver(rxq, &c->next_buf);
LIST_REMOVE(c, active_link);
}
 
@@ -618,7 +619,7 @@ sfxge_lro_try_merge(struct sfxge_rxq *rx
return (1);
 
  deliver_buf_out:
-   sfxge_rx_deliver(rxq->sc, rx_buf);
+   sfxge_rx_deliver(rxq, rx_buf);
return (1);
 }
 
@@ -679,7 +680,7 @@ sfxge_lro(struct sfxge_rxq *rxq, struct 
unsigned bucket;
 
/* Get the hardware hash */
-   conn_hash = efx_psuedo_hdr_hash_get(sc->enp,
+   conn_hash = efx_psuedo_hdr_hash_get(rxq->common,
EFX_RX_HASHALG_TOEPLITZ,
mtod(m, uint8_t *));
 
@@ -765,7 +766,7 @@ sfxge_lro(struct sfxge_rxq *rxq, struct 
 
sfxge_lro_new_conn(&rxq->lro, conn_hash, l2_id, nh, th);
  deliver_now:
-   sfxge_rx_deliver(sc, 

svn commit: r310753 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Thu Dec 29 07:02:32 2016
New Revision: 310753
URL: https://svnweb.freebsd.org/changeset/base/310753

Log:
  sfxge(4): split EFX_FILTER_MATCH_LOC_MAC_IG back into separate flags
  
  The flag EFX_FILTER_MATCH_LOC_MAC_IG to represent filtering on the
  individual/group bit of the MAC address (with the two cases being
  distingusished by the MAC address in the filter specification) was
  introduced to mirror the Linux driver filtering code, but the
  implementations are different enough anyway that it isn't of much value.
  
  Having separate flags for unknown unicast and multicast simplifies
  the code and allows the set of flags to match those used by MCDI.
  
  It will also makes it easier to report whether these filters are
  supported.
  
  In the MCDI definitions, the unknown multicast and unicast flags have
  the values 0x4000 and 0x8000 respectively, and so using the
  same values for simplicity requires 32 bits in the filter specification
  to store the flags. This means the structure is now a little bigger
  than 64 bytes, but filters are not often used on critical paths so this
  shouldn't have much impact - on Linux they are also bigger than they
  used to be.
  
  Submitted by:   Mark Spender 
  Reviewed by:gnn
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  1 week
  Differential Revision:  https://reviews.freebsd.org/D8951

Modified:
  head/sys/dev/sfxge/common/ef10_filter.c
  head/sys/dev/sfxge/common/efx.h
  head/sys/dev/sfxge/common/efx_filter.c

Modified: head/sys/dev/sfxge/common/ef10_filter.c
==
--- head/sys/dev/sfxge/common/ef10_filter.c Thu Dec 29 07:00:26 2016
(r310752)
+++ head/sys/dev/sfxge/common/ef10_filter.c Thu Dec 29 07:02:32 2016
(r310753)
@@ -145,6 +145,10 @@ ef10_filter_init(
MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_OUTER_VLAN));
EFX_STATIC_ASSERT(EFX_FILTER_MATCH_IP_PROTO ==
MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_IP_PROTO));
+   EFX_STATIC_ASSERT(EFX_FILTER_MATCH_UNKNOWN_MCAST_DST ==
+   MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_MCAST_DST));
+   EFX_STATIC_ASSERT((uint32_t)EFX_FILTER_MATCH_UNKNOWN_UCAST_DST ==
+   MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_UCAST_DST));
 #undef MATCH_MASK
 
EFSYS_KMEM_ALLOC(enp->en_esip, sizeof (ef10_filter_table_t), eftp);
@@ -187,7 +191,6 @@ efx_mcdi_filter_op_add(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_FILTER_OP_IN_LEN,
MC_CMD_FILTER_OP_OUT_LEN)];
-   uint32_t match_fields = 0;
efx_rc_t rc;
 
memset(payload, 0, sizeof (payload));
@@ -214,26 +217,10 @@ efx_mcdi_filter_op_add(
goto fail1;
}
 
-   if (spec->efs_match_flags & EFX_FILTER_MATCH_LOC_MAC_IG) {
-   /*
-* The LOC_MAC_IG match flag can represent unknown unicast
-*  or multicast filters - use the MAC address to distinguish
-*  them.
-*/
-   if (EFX_MAC_ADDR_IS_MULTICAST(spec->efs_loc_mac))
-   match_fields |= 1U <<
-   MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_MCAST_DST_LBN;
-   else
-   match_fields |= 1U <<
-   MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_UCAST_DST_LBN;
-   }
-
-   match_fields |= spec->efs_match_flags & (~EFX_FILTER_MATCH_LOC_MAC_IG);
-
MCDI_IN_SET_DWORD(req, FILTER_OP_IN_PORT_ID,
EVB_PORT_ID_ASSIGNED);
MCDI_IN_SET_DWORD(req, FILTER_OP_IN_MATCH_FIELDS,
-   match_fields);
+   spec->efs_match_flags);
MCDI_IN_SET_DWORD(req, FILTER_OP_IN_RX_DEST,
MC_CMD_FILTER_OP_IN_RX_DEST_HOST);
MCDI_IN_SET_DWORD(req, FILTER_OP_IN_RX_QUEUE,
@@ -892,9 +879,6 @@ efx_mcdi_get_parser_disp_info(
uint8_t payload[MAX(MC_CMD_GET_PARSER_DISP_INFO_IN_LEN,
MC_CMD_GET_PARSER_DISP_INFO_OUT_LENMAX)];
efx_rc_t rc;
-   uint32_t i;
-   boolean_t support_unknown_ucast = B_FALSE;
-   boolean_t support_unknown_mcast = B_FALSE;
 
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_GET_PARSER_DISP_INFO;
@@ -930,28 +914,6 @@ efx_mcdi_get_parser_disp_info(
EFX_STATIC_ASSERT(sizeof (uint32_t) ==
MC_CMD_GET_PARSER_DISP_INFO_OUT_SUPPORTED_MATCHES_LEN);
 
-   /*
-* Remove UNKNOWN UCAST and MCAST flags, and if both are present, change
-* the lower priority one to LOC_MAC_IG.
-*/
-   for (i = 0; i < *length; i++) {
-   if (list[i] & MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_UCAST_DST_LBN) {
-   list[i] &=
-   (~MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_UCAST_DST_LBN);
-   support_unknown_ucast = B_TRUE;
-   }
-   if (list[i] & MC_CMD_FI

svn commit: r310754 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Thu Dec 29 07:04:26 2016
New Revision: 310754
URL: https://svnweb.freebsd.org/changeset/base/310754

Log:
  sfxge(4): don't use Tx descriptor push with TSO option descriptors
  
  It is not safe to push TSO option descriptors if pacer bypass is
  enabled, so to make sure that doesn't happen never push TSO option
  descriptors.
  
  Submitted by:   Mark Spender 
  Reviewed by:gnn
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days
  Differential Revision:  https://reviews.freebsd.org/D8952

Modified:
  head/sys/dev/sfxge/common/ef10_tx.c

Modified: head/sys/dev/sfxge/common/ef10_tx.c
==
--- head/sys/dev/sfxge/common/ef10_tx.c Thu Dec 29 07:02:32 2016
(r310753)
+++ head/sys/dev/sfxge/common/ef10_tx.c Thu Dec 29 07:04:26 2016
(r310754)
@@ -470,9 +470,9 @@ fail1:
 }
 
 /*
- * This improves performance by pushing a TX descriptor at the same time as the
- * doorbell. The descriptor must be added to the TXQ, so that can be used if 
the
- * hardware decides not to use the pushed descriptor.
+ * This improves performance by, when possible, pushing a TX descriptor at the
+ * same time as the doorbell. The descriptor must be added to the TXQ, so that
+ * can be used if the hardware decides not to use the pushed descriptor.
  */
void
 ef10_tx_qpush(
@@ -492,16 +492,46 @@ ef10_tx_qpush(
offset = id * sizeof (efx_qword_t);
 
EFSYS_MEM_READQ(etp->et_esmp, offset, &desc);
-   EFX_POPULATE_OWORD_3(oword,
-   ERF_DZ_TX_DESC_WPTR, wptr,
-   ERF_DZ_TX_DESC_HWORD, EFX_QWORD_FIELD(desc, EFX_DWORD_1),
-   ERF_DZ_TX_DESC_LWORD, EFX_QWORD_FIELD(desc, EFX_DWORD_0));
-
-   /* Guarantee ordering of memory (descriptors) and PIO (doorbell) */
-   EFX_DMA_SYNC_QUEUE_FOR_DEVICE(etp->et_esmp, etp->et_mask + 1, wptr, id);
-   EFSYS_PIO_WRITE_BARRIER();
-   EFX_BAR_TBL_DOORBELL_WRITEO(enp, ER_DZ_TX_DESC_UPD_REG, etp->et_index,
-   &oword);
+
+   /*
+* SF Bug 65776: TSO option descriptors cannot be pushed if pacer bypass
+* is enabled on the event queue this transmit queue is attached to.
+*
+* To ensure the code is safe, it is easiest to simply test the type of
+* the descriptor to push, and only push it is if it not a TSO option
+* descriptor.
+*/
+   if ((EFX_QWORD_FIELD(desc, ESF_DZ_TX_DESC_IS_OPT) != 1) ||
+   (EFX_QWORD_FIELD(desc, ESF_DZ_TX_OPTION_TYPE) !=
+   ESE_DZ_TX_OPTION_DESC_TSO)) {
+   /* Push the descriptor and update the wptr. */
+   EFX_POPULATE_OWORD_3(oword, ERF_DZ_TX_DESC_WPTR, wptr,
+   ERF_DZ_TX_DESC_HWORD, EFX_QWORD_FIELD(desc, EFX_DWORD_1),
+   ERF_DZ_TX_DESC_LWORD, EFX_QWORD_FIELD(desc, EFX_DWORD_0));
+
+   /* Ensure ordering of memory (descriptors) and PIO (doorbell) */
+   EFX_DMA_SYNC_QUEUE_FOR_DEVICE(etp->et_esmp, etp->et_mask + 1,
+   wptr, id);
+   EFSYS_PIO_WRITE_BARRIER();
+   EFX_BAR_TBL_DOORBELL_WRITEO(enp, ER_DZ_TX_DESC_UPD_REG,
+   etp->et_index, &oword);
+   } else {
+   efx_dword_t dword;
+
+   /*
+* Only update the wptr. This is signalled to the hardware by
+* only writing one DWORD of the doorbell register.
+*/
+   EFX_POPULATE_OWORD_1(oword, ERF_DZ_TX_DESC_WPTR, wptr);
+   dword = oword.eo_dword[2];
+
+   /* Ensure ordering of memory (descriptors) and PIO (doorbell) */
+   EFX_DMA_SYNC_QUEUE_FOR_DEVICE(etp->et_esmp, etp->et_mask + 1,
+   wptr, id);
+   EFSYS_PIO_WRITE_BARRIER();
+   EFX_BAR_TBL_WRITED2(enp, ER_DZ_TX_DESC_UPD_REG,
+   etp->et_index, &dword, B_FALSE);
+   }
 }
 
__checkReturn   efx_rc_t
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310755 - head/sys/dev/sfxge/common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Thu Dec 29 07:05:47 2016
New Revision: 310755
URL: https://svnweb.freebsd.org/changeset/base/310755

Log:
  sfxge(4): do not use enum for filter flags
  
  It is not 100% correct to assign non-enum values to enum type
  variables.
  
  Found by ICC build (DPDK PMD upstreaming).
  
  Reviewed by:gnn
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days
  Differential Revision:  https://reviews.freebsd.org/D8953

Modified:
  head/sys/dev/sfxge/common/ef10_filter.c
  head/sys/dev/sfxge/common/efx.h
  head/sys/dev/sfxge/common/efx_filter.c

Modified: head/sys/dev/sfxge/common/ef10_filter.c
==
--- head/sys/dev/sfxge/common/ef10_filter.c Thu Dec 29 07:04:26 2016
(r310754)
+++ head/sys/dev/sfxge/common/ef10_filter.c Thu Dec 29 07:05:47 2016
(r310755)
@@ -947,7 +947,7 @@ static  __checkReturn   efx_rc_t
 ef10_filter_insert_unicast(
__inefx_nic_t *enp,
__in_ecount(6)  uint8_t const *addr,
-   __inefx_filter_flag_t filter_flags)
+   __inefx_filter_flags_t filter_flags)
 {
ef10_filter_table_t *eftp = enp->en_filter.ef_ef10_filter_table;
efx_filter_spec_t spec;
@@ -978,7 +978,7 @@ fail1:
 static __checkReturn   efx_rc_t
 ef10_filter_insert_all_unicast(
__inefx_nic_t *enp,
-   __inefx_filter_flag_t filter_flags)
+   __inefx_filter_flags_t filter_flags)
 {
ef10_filter_table_t *eftp = enp->en_filter.ef_ef10_filter_table;
efx_filter_spec_t spec;
@@ -1012,7 +1012,7 @@ ef10_filter_insert_multicast_list(
__inboolean_t brdcst,
__in_ecount(6*count)uint8_t const *addrs,
__inuint32_t count,
-   __inefx_filter_flag_t filter_flags,
+   __inefx_filter_flags_t filter_flags,
__inboolean_t rollback)
 {
ef10_filter_table_t *eftp = enp->en_filter.ef_ef10_filter_table;
@@ -1105,7 +1105,7 @@ fail1:
 static __checkReturn   efx_rc_t
 ef10_filter_insert_all_multicast(
__inefx_nic_t *enp,
-   __inefx_filter_flag_t filter_flags)
+   __inefx_filter_flags_t filter_flags)
 {
ef10_filter_table_t *eftp = enp->en_filter.ef_ef10_filter_table;
efx_filter_spec_t spec;
@@ -1207,7 +1207,7 @@ ef10_filter_reconfigure(
 {
efx_nic_cfg_t *encp = &enp->en_nic_cfg;
ef10_filter_table_t *table = enp->en_filter.ef_ef10_filter_table;
-   efx_filter_flag_t filter_flags;
+   efx_filter_flags_t filter_flags;
unsigned int i;
efx_rc_t all_unicst_rc = 0;
efx_rc_t all_mulcst_rc = 0;

Modified: head/sys/dev/sfxge/common/efx.h
==
--- head/sys/dev/sfxge/common/efx.h Thu Dec 29 07:04:26 2016
(r310754)
+++ head/sys/dev/sfxge/common/efx.h Thu Dec 29 07:05:47 2016
(r310755)
@@ -2180,20 +2180,22 @@ efx_tx_qdestroy(
 #defineEFX_IPPROTO_TCP 6
 #defineEFX_IPPROTO_UDP 17
 
-typedef enum efx_filter_flag_e {
-   EFX_FILTER_FLAG_RX_RSS = 0x01,  /* use RSS to spread across
-* multiple queues */
-   EFX_FILTER_FLAG_RX_SCATTER = 0x02,  /* enable RX scatter */
-   EFX_FILTER_FLAG_RX_OVER_AUTO = 0x04,/* Override an automatic filter
-* (priority 
EFX_FILTER_PRI_AUTO).
-* May only be set by the filter
-* implementation for each type.
-* A removal request will
-* restore the automatic filter
-* in its place. */
-   EFX_FILTER_FLAG_RX = 0x08,  /* Filter is for RX */
-   EFX_FILTER_FLAG_TX = 0x10,  /* Filter is for TX */
-} efx_filter_flag_t;
+/* Use RSS to spread across multiple queues */
+#defineEFX_FILTER_FLAG_RX_RSS  0x01
+/* Enable RX scatter */
+#defineEFX_FILTER_FLAG_RX_SCATTER  0x02
+/*
+ * Override an automatic filter (priority EFX_FILTER_PRI_AUTO).
+ * May only be set by the filter implementation for each type.
+ * A removal request will restore the automatic filter in its place.
+ */
+#defineEFX_FILTER_FLAG_RX_OVER_AUTO0x04
+/* Filter is for RX */
+#defineEFX_FILTER_FLAG_RX  0x08
+/* Filter is for TX */
+#defineEFX_FILTER_FLAG_TX  0x10
+
+typedef u

svn commit: r310756 - in head/sys/dev/sfxge: . common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Thu Dec 29 07:06:49 2016
New Revision: 310756
URL: https://svnweb.freebsd.org/changeset/base/310756

Log:
  sfxge(4): do not use enum type when values are bitmask
  
  ICC complains that enumerated type mixed with another type.
  
  Found by DPDK upstream build sanity check.
  
  Reviewed by:gnn
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days
  Differential Revision:  https://reviews.freebsd.org/D8954

Modified:
  head/sys/dev/sfxge/common/ef10_rx.c
  head/sys/dev/sfxge/common/efx.h
  head/sys/dev/sfxge/common/efx_rx.c
  head/sys/dev/sfxge/sfxge_rx.c

Modified: head/sys/dev/sfxge/common/ef10_rx.c
==
--- head/sys/dev/sfxge/common/ef10_rx.c Thu Dec 29 07:05:47 2016
(r310755)
+++ head/sys/dev/sfxge/common/ef10_rx.c Thu Dec 29 07:06:49 2016
(r310756)
@@ -297,13 +297,13 @@ efx_mcdi_rss_context_set_flags(
 
MCDI_IN_POPULATE_DWORD_4(req, RSS_CONTEXT_SET_FLAGS_IN_FLAGS,
RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV4_EN,
-   (type & (1U << EFX_RX_HASH_IPV4)) ? 1 : 0,
+   (type & EFX_RX_HASH_IPV4) ? 1 : 0,
RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_TCPV4_EN,
-   (type & (1U << EFX_RX_HASH_TCPIPV4)) ? 1 : 0,
+   (type & EFX_RX_HASH_TCPIPV4) ? 1 : 0,
RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV6_EN,
-   (type & (1U << EFX_RX_HASH_IPV6)) ? 1 : 0,
+   (type & EFX_RX_HASH_IPV6) ? 1 : 0,
RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_TCPV6_EN,
-   (type & (1U << EFX_RX_HASH_TCPIPV6)) ? 1 : 0);
+   (type & EFX_RX_HASH_TCPIPV6) ? 1 : 0);
 
efx_mcdi_execute(enp, &req);
 

Modified: head/sys/dev/sfxge/common/efx.h
==
--- head/sys/dev/sfxge/common/efx.h Thu Dec 29 07:05:47 2016
(r310755)
+++ head/sys/dev/sfxge/common/efx.h Thu Dec 29 07:06:49 2016
(r310756)
@@ -1867,12 +1867,12 @@ typedef enum efx_rx_hash_alg_e {
EFX_RX_HASHALG_TOEPLITZ
 } efx_rx_hash_alg_t;
 
-typedef enum efx_rx_hash_type_e {
-   EFX_RX_HASH_IPV4 = 0,
-   EFX_RX_HASH_TCPIPV4,
-   EFX_RX_HASH_IPV6,
-   EFX_RX_HASH_TCPIPV6,
-} efx_rx_hash_type_t;
+#defineEFX_RX_HASH_IPV4(1U << 0)
+#defineEFX_RX_HASH_TCPIPV4 (1U << 1)
+#defineEFX_RX_HASH_IPV6(1U << 2)
+#defineEFX_RX_HASH_TCPIPV6 (1U << 3)
+
+typedef unsigned int efx_rx_hash_type_t;
 
 typedef enum efx_rx_hash_support_e {
EFX_RX_HASH_UNAVAILABLE = 0,/* Hardware hash not inserted */

Modified: head/sys/dev/sfxge/common/efx_rx.c
==
--- head/sys/dev/sfxge/common/efx_rx.c  Thu Dec 29 07:05:47 2016
(r310755)
+++ head/sys/dev/sfxge/common/efx_rx.c  Thu Dec 29 07:06:49 2016
(r310756)
@@ -731,12 +731,12 @@ siena_rx_scale_mode_set(
 
case EFX_RX_HASHALG_TOEPLITZ:
EFX_RX_TOEPLITZ_IPV4_HASH(enp, insert,
-   type & (1 << EFX_RX_HASH_IPV4),
-   type & (1 << EFX_RX_HASH_TCPIPV4));
+   type & EFX_RX_HASH_IPV4,
+   type & EFX_RX_HASH_TCPIPV4);
 
EFX_RX_TOEPLITZ_IPV6_HASH(enp,
-   type & (1 << EFX_RX_HASH_IPV6),
-   type & (1 << EFX_RX_HASH_TCPIPV6),
+   type & EFX_RX_HASH_IPV6,
+   type & EFX_RX_HASH_TCPIPV6,
rc);
if (rc != 0)
goto fail1;

Modified: head/sys/dev/sfxge/sfxge_rx.c
==
--- head/sys/dev/sfxge/sfxge_rx.c   Thu Dec 29 07:05:47 2016
(r310755)
+++ head/sys/dev/sfxge/sfxge_rx.c   Thu Dec 29 07:06:49 2016
(r310756)
@@ -1140,8 +1140,8 @@ sfxge_rx_start(struct sfxge_softc *sc)
   nitems(sc->rx_indir_table))) != 0)
goto fail;
(void)efx_rx_scale_mode_set(sc->enp, EFX_RX_HASHALG_TOEPLITZ,
-   (1 << EFX_RX_HASH_IPV4) | (1 << EFX_RX_HASH_TCPIPV4) |
-   (1 << EFX_RX_HASH_IPV6) | (1 << EFX_RX_HASH_TCPIPV6), B_TRUE);
+   EFX_RX_HASH_IPV4 | EFX_RX_HASH_TCPIPV4 |
+   EFX_RX_HASH_IPV6 | EFX_RX_HASH_TCPIPV6, B_TRUE);
 
 #ifdef RSS
rss_getkey(toep_key);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310758 - in head/sys: conf dev/sfxge/common modules/sfxge

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Thu Dec 29 07:10:25 2016
New Revision: 310758
URL: https://svnweb.freebsd.org/changeset/base/310758

Log:
  sfxge(4): delete hunt_phy.c
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days

Deleted:
  head/sys/dev/sfxge/common/hunt_phy.c
Modified:
  head/sys/conf/files.amd64
  head/sys/modules/sfxge/Makefile

Modified: head/sys/conf/files.amd64
==
--- head/sys/conf/files.amd64   Thu Dec 29 07:07:16 2016(r310757)
+++ head/sys/conf/files.amd64   Thu Dec 29 07:10:25 2016(r310758)
@@ -385,7 +385,6 @@ dev/sfxge/common/efx_tx.c   optionalsfxge
 dev/sfxge/common/efx_vpd.c optionalsfxge pci
 dev/sfxge/common/efx_wol.c optionalsfxge pci
 dev/sfxge/common/hunt_nic.coptionalsfxge pci
-dev/sfxge/common/hunt_phy.coptionalsfxge pci
 dev/sfxge/common/mcdi_mon.coptionalsfxge pci
 dev/sfxge/common/medford_nic.c optionalsfxge pci
 dev/sfxge/common/siena_mac.c   optionalsfxge pci

Modified: head/sys/modules/sfxge/Makefile
==
--- head/sys/modules/sfxge/Makefile Thu Dec 29 07:07:16 2016
(r310757)
+++ head/sys/modules/sfxge/Makefile Thu Dec 29 07:10:25 2016
(r310758)
@@ -33,7 +33,7 @@ SRCS+=ef10_ev.c ef10_filter.c ef10_intr
 SRCS+= ef10_nvram.c ef10_phy.c ef10_rx.c ef10_tx.c ef10_vpd.c
 SRCS+= ef10_impl.h
 
-SRCS+= hunt_nic.c hunt_phy.c
+SRCS+= hunt_nic.c
 SRCS+= hunt_impl.h
 
 SRCS+= medford_nic.c
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r310760 - in head/sys/dev/sfxge: . common

2016-12-28 Thread Andrew Rybchenko
Author: arybchik
Date: Thu Dec 29 07:20:53 2016
New Revision: 310760
URL: https://svnweb.freebsd.org/changeset/base/310760

Log:
  sfxge(4): fix typo in pseudo header accessor function names
  
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days

Modified:
  head/sys/dev/sfxge/common/efx.h
  head/sys/dev/sfxge/common/efx_rx.c
  head/sys/dev/sfxge/sfxge_rx.c

Modified: head/sys/dev/sfxge/common/efx.h
==
--- head/sys/dev/sfxge/common/efx.h Thu Dec 29 07:11:20 2016
(r310759)
+++ head/sys/dev/sfxge/common/efx.h Thu Dec 29 07:20:53 2016
(r310760)
@@ -1920,7 +1920,7 @@ efx_rx_scale_key_set(
__insize_t n);
 
 extern __checkReturn   uint32_t
-efx_psuedo_hdr_hash_get(
+efx_pseudo_hdr_hash_get(
__inefx_rxq_t *erp,
__inefx_rx_hash_alg_t func,
__inuint8_t *buffer);
@@ -1928,7 +1928,7 @@ efx_psuedo_hdr_hash_get(
 #endif /* EFSYS_OPT_RX_SCALE */
 
 extern __checkReturn   efx_rc_t
-efx_psuedo_hdr_pkt_length_get(
+efx_pseudo_hdr_pkt_length_get(
__inefx_rxq_t *erp,
__inuint8_t *buffer,
__out   uint16_t *pkt_lengthp);

Modified: head/sys/dev/sfxge/common/efx_rx.c
==
--- head/sys/dev/sfxge/common/efx_rx.c  Thu Dec 29 07:11:20 2016
(r310759)
+++ head/sys/dev/sfxge/common/efx_rx.c  Thu Dec 29 07:20:53 2016
(r310760)
@@ -540,7 +540,7 @@ efx_rx_qdestroy(
 }
 
__checkReturn   efx_rc_t
-efx_psuedo_hdr_pkt_length_get(
+efx_pseudo_hdr_pkt_length_get(
__inefx_rxq_t *erp,
__inuint8_t *buffer,
__out   uint16_t *lengthp)
@@ -555,7 +555,7 @@ efx_psuedo_hdr_pkt_length_get(
 
 #if EFSYS_OPT_RX_SCALE
__checkReturn   uint32_t
-efx_psuedo_hdr_hash_get(
+efx_pseudo_hdr_hash_get(
__inefx_rxq_t *erp,
__inefx_rx_hash_alg_t func,
__inuint8_t *buffer)
@@ -949,11 +949,11 @@ fail1:
 #endif
 
 /*
- * Falcon/Siena psuedo-header
+ * Falcon/Siena pseudo-header
  * --
  *
  * Receive packets are prefixed by an optional 16 byte pseudo-header.
- * The psuedo-header is a byte array of one of the forms:
+ * The pseudo-header is a byte array of one of the forms:
  *
  *  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
  * xx.xx.xx.xx.xx.xx.xx.xx.xx.xx.xx.xx.TT.TT.TT.TT

Modified: head/sys/dev/sfxge/sfxge_rx.c
==
--- head/sys/dev/sfxge/sfxge_rx.c   Thu Dec 29 07:11:20 2016
(r310759)
+++ head/sys/dev/sfxge/sfxge_rx.c   Thu Dec 29 07:20:53 2016
(r310760)
@@ -345,7 +345,7 @@ sfxge_rx_deliver(struct sfxge_rxq *rxq, 
 
if (flags & (EFX_PKT_IPV4 | EFX_PKT_IPV6)) {
m->m_pkthdr.flowid =
-   efx_psuedo_hdr_hash_get(rxq->common,
+   efx_pseudo_hdr_hash_get(rxq->common,
EFX_RX_HASHALG_TOEPLITZ,
mtod(m, uint8_t *));
/* The hash covers a 4-tuple for TCP only */
@@ -680,7 +680,7 @@ sfxge_lro(struct sfxge_rxq *rxq, struct 
unsigned bucket;
 
/* Get the hardware hash */
-   conn_hash = efx_psuedo_hdr_hash_get(rxq->common,
+   conn_hash = efx_pseudo_hdr_hash_get(rxq->common,
EFX_RX_HASHALG_TOEPLITZ,
mtod(m, uint8_t *));
 
@@ -843,7 +843,7 @@ sfxge_rx_qcomplete(struct sfxge_rxq *rxq
if (rx_desc->flags & EFX_PKT_PREFIX_LEN) {
uint16_t tmp_size;
int rc;
-   rc = efx_psuedo_hdr_pkt_length_get(rxq->common,
+   rc = efx_pseudo_hdr_pkt_length_get(rxq->common,
   mtod(m, uint8_t *),
   &tmp_size);
KASSERT(rc == 0, ("cannot get packet length: %d", rc));
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"