svn commit: r350412 - stable/11/sys/dev/sfxge/common

2019-07-29 Thread Andrew Rybchenko
Author: arybchik
Date: Mon Jul 29 10:44:04 2019
New Revision: 350412
URL: https://svnweb.freebsd.org/changeset/base/350412

Log:
  MFC r350371
  
  sfxge(4): unify power of 2 alignment check macro
  
  Substitute driver-defined IS_P2ALIGNED() with EFX_IS_P2ALIGNED()
  defined in libefx.
  
  Add type argument and cast value and alignment to one specified type.
  
  Reported by:Andrea Valsania 
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/11/sys/dev/sfxge/common/efsys.h
  stable/11/sys/dev/sfxge/common/efx.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efsys.h
==
--- stable/11/sys/dev/sfxge/common/efsys.h  Mon Jul 29 10:42:21 2019
(r350411)
+++ stable/11/sys/dev/sfxge/common/efsys.h  Mon Jul 29 10:44:04 2019
(r350412)
@@ -87,10 +87,6 @@ extern "C" {
 #defineB_TRUE  TRUE
 #endif
 
-#ifndef IS_P2ALIGNED
-#defineIS_P2ALIGNED(v, a)  uintptr_t)(v)) & ((uintptr_t)(a) - 
1)) == 0)
-#endif
-
 #ifndef IS2P
 #defineISP2(x) (((x) & ((x) - 1)) == 0)
 #endif
@@ -392,7 +388,8 @@ typedef struct efsys_mem_s {
uint32_t *addr; \
\
_NOTE(CONSTANTCONDITION)\
-   KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_dword_t)),\
+   KASSERT(EFX_IS_P2ALIGNED(size_t, _offset,   \
+   sizeof (efx_dword_t)),  \
("not power of 2 aligned"));\
\
addr = (void *)((_esmp)->esm_base + (_offset)); \
@@ -411,7 +408,8 @@ typedef struct efsys_mem_s {
uint64_t *addr; \
\
_NOTE(CONSTANTCONDITION)\
-   KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_qword_t)),\
+   KASSERT(EFX_IS_P2ALIGNED(size_t, _offset,   \
+   sizeof (efx_qword_t)),  \
("not power of 2 aligned"));\
\
addr = (void *)((_esmp)->esm_base + (_offset)); \
@@ -430,7 +428,8 @@ typedef struct efsys_mem_s {
uint32_t *addr; \
\
_NOTE(CONSTANTCONDITION)\
-   KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_qword_t)),\
+   KASSERT(EFX_IS_P2ALIGNED(size_t, _offset,   \
+   sizeof (efx_qword_t)),  \
("not power of 2 aligned"));\
\
addr = (void *)((_esmp)->esm_base + (_offset)); \
@@ -452,7 +451,8 @@ typedef struct efsys_mem_s {
uint64_t *addr; \
\
_NOTE(CONSTANTCONDITION)\
-   KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_oword_t)),\
+   KASSERT(EFX_IS_P2ALIGNED(size_t, _offset,   \
+   sizeof (efx_oword_t)),  \
("not power of 2 aligned"));\
\
addr = (void *)((_esmp)->esm_base + (_offset)); \
@@ -474,7 +474,8 @@ typedef struct efsys_mem_s {
uint32_t *addr; \
\
_NOTE(CONSTANTCONDITION)\
-   KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_oword_t)),\
+   KASSERT(EFX_IS_P2ALIGNED(size_t, _offset,   \
+   sizeof (efx_oword_t)),  \
("not power of 2 aligned"));\
\
addr = (void *)((_esmp)->esm_base + (_offset)); \
@@ -499,7 +500,8 @@ typedef struct efsys_mem_s {
uint32_t *addr; \
\
_NOTE(CONSTANTCONDITION) 

svn commit: r350411 - stable/11/sys/dev/sfxge/common

2019-07-29 Thread Andrew Rybchenko
Author: arybchik
Date: Mon Jul 29 10:42:21 2019
New Revision: 350411
URL: https://svnweb.freebsd.org/changeset/base/350411

Log:
  MFC r350370
  
  sfxge(4): fix align to power of 2 when align has smaller type
  
  Substitute driver-defined P2ALIGN() with EFX_P2ALIGN() defined in
  libefx.
  
  Cast value and alignment to one specified type to guarantee result
  correctness.
  
  Reported by:Andrea Valsania 
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/11/sys/dev/sfxge/common/ef10_rx.c
  stable/11/sys/dev/sfxge/common/efsys.h
  stable/11/sys/dev/sfxge/common/efx.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/ef10_rx.c
==
--- stable/11/sys/dev/sfxge/common/ef10_rx.cMon Jul 29 10:42:15 2019
(r350410)
+++ stable/11/sys/dev/sfxge/common/ef10_rx.cMon Jul 29 10:42:21 2019
(r350411)
@@ -689,7 +689,7 @@ ef10_rx_qpush(
efx_dword_t dword;
 
/* Hardware has alignment restriction for WPTR */
-   wptr = P2ALIGN(added, EF10_RX_WPTR_ALIGN);
+   wptr = EFX_P2ALIGN(unsigned int, added, EF10_RX_WPTR_ALIGN);
if (pushed == wptr)
return;
 

Modified: stable/11/sys/dev/sfxge/common/efsys.h
==
--- stable/11/sys/dev/sfxge/common/efsys.h  Mon Jul 29 10:42:15 2019
(r350410)
+++ stable/11/sys/dev/sfxge/common/efsys.h  Mon Jul 29 10:42:21 2019
(r350411)
@@ -91,10 +91,6 @@ extern "C" {
 #defineIS_P2ALIGNED(v, a)  uintptr_t)(v)) & ((uintptr_t)(a) - 
1)) == 0)
 #endif
 
-#ifndef P2ALIGN
-#defineP2ALIGN(_x, _a) ((_x) & -(_a))
-#endif
-
 #ifndef IS2P
 #defineISP2(x) (((x) & ((x) - 1)) == 0)
 #endif

Modified: stable/11/sys/dev/sfxge/common/efx.h
==
--- stable/11/sys/dev/sfxge/common/efx.hMon Jul 29 10:42:15 2019
(r350410)
+++ stable/11/sys/dev/sfxge/common/efx.hMon Jul 29 10:42:21 2019
(r350411)
@@ -54,6 +54,10 @@ extern "C" {
 #defineEFX_P2ROUNDUP(_type, _value, _align)\
(-(-(_type)(_value) & -(_type)(_align)))
 
+/* Align value down to the nearest power of two. */
+#defineEFX_P2ALIGN(_type, _value, _align)  \
+   ((_type)(_value) & -(_type)(_align))
+
 /* Return codes */
 
 typedef __success(return == 0) int efx_rc_t;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r350409 - in stable/11/sys/dev/sfxge: . common

2019-07-29 Thread Andrew Rybchenko
Author: arybchik
Date: Mon Jul 29 10:41:21 2019
New Revision: 350409
URL: https://svnweb.freebsd.org/changeset/base/350409

Log:
  MFC r350369
  
  sfxge(4): fix power of 2 round up when align has smaller type
  
  Substitute driver-defined P2ROUNDUP() h with EFX_P2ROUNDUP()
  defined in libefx.
  
  Cast value and alignment to one specified type to guarantee result
  correctness.
  
  Reported by:Andrea Valsania 
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/11/sys/dev/sfxge/common/ef10_nvram.c
  stable/11/sys/dev/sfxge/common/efsys.h
  stable/11/sys/dev/sfxge/common/efx.h
  stable/11/sys/dev/sfxge/common/efx_mcdi.h
  stable/11/sys/dev/sfxge/common/efx_tx.c
  stable/11/sys/dev/sfxge/sfxge_rx.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/ef10_nvram.c
==
--- stable/11/sys/dev/sfxge/common/ef10_nvram.c Mon Jul 29 10:40:51 2019
(r350408)
+++ stable/11/sys/dev/sfxge/common/ef10_nvram.c Mon Jul 29 10:41:21 2019
(r350409)
@@ -394,7 +394,8 @@ tlv_write(
if (len > 0) {
ptr[(len - 1) / sizeof (uint32_t)] = 0;
memcpy(ptr, data, len);
-   ptr += P2ROUNDUP(len, sizeof (uint32_t)) / sizeof (*ptr);
+   ptr += EFX_P2ROUNDUP(uint32_t, len,
+   sizeof (uint32_t)) / sizeof (*ptr);
}
 
return (ptr);

Modified: stable/11/sys/dev/sfxge/common/efsys.h
==
--- stable/11/sys/dev/sfxge/common/efsys.h  Mon Jul 29 10:40:51 2019
(r350408)
+++ stable/11/sys/dev/sfxge/common/efsys.h  Mon Jul 29 10:41:21 2019
(r350409)
@@ -91,10 +91,6 @@ extern "C" {
 #defineIS_P2ALIGNED(v, a)  uintptr_t)(v)) & ((uintptr_t)(a) - 
1)) == 0)
 #endif
 
-#ifndef P2ROUNDUP
-#defineP2ROUNDUP(x, align) (-(-(x) & -(align)))
-#endif
-
 #ifndef P2ALIGN
 #defineP2ALIGN(_x, _a) ((_x) & -(_a))
 #endif

Modified: stable/11/sys/dev/sfxge/common/efx.h
==
--- stable/11/sys/dev/sfxge/common/efx.hMon Jul 29 10:40:51 2019
(r350408)
+++ stable/11/sys/dev/sfxge/common/efx.hMon Jul 29 10:41:21 2019
(r350409)
@@ -50,6 +50,10 @@ extern "C" {
 #defineEFX_FIELD_OFFSET(_type, _field) \
((size_t) &(((_type *)0)->_field))
 
+/* Round value up to the nearest power of two. */
+#defineEFX_P2ROUNDUP(_type, _value, _align)\
+   (-(-(_type)(_value) & -(_type)(_align)))
+
 /* Return codes */
 
 typedef __success(return == 0) int efx_rc_t;
@@ -449,10 +453,10 @@ typedef enum efx_link_mode_e {
+ /* bug16011 */ 16)\
 
 #defineEFX_MAC_PDU(_sdu)   \
-   P2ROUNDUP((_sdu) + EFX_MAC_PDU_ADJUSTMENT, 8)
+   EFX_P2ROUNDUP(size_t, (_sdu) + EFX_MAC_PDU_ADJUSTMENT, 8)
 
 /*
- * Due to the P2ROUNDUP in EFX_MAC_PDU(), EFX_MAC_SDU_FROM_PDU() may give
+ * Due to the EFX_P2ROUNDUP in EFX_MAC_PDU(), EFX_MAC_SDU_FROM_PDU() may give
  * the SDU rounded up slightly.
  */
 #defineEFX_MAC_SDU_FROM_PDU(_pdu)  ((_pdu) - 
EFX_MAC_PDU_ADJUSTMENT)
@@ -538,8 +542,9 @@ efx_mac_stat_name(
 
 #defineEFX_MAC_STATS_MASK_BITS_PER_PAGE(8 * sizeof (uint32_t))
 
-#defineEFX_MAC_STATS_MASK_NPAGES   \
-   (P2ROUNDUP(EFX_MAC_NSTATS, EFX_MAC_STATS_MASK_BITS_PER_PAGE) / \
+#defineEFX_MAC_STATS_MASK_NPAGES   \
+   (EFX_P2ROUNDUP(uint32_t, EFX_MAC_NSTATS,\
+  EFX_MAC_STATS_MASK_BITS_PER_PAGE) /  \
EFX_MAC_STATS_MASK_BITS_PER_PAGE)
 
 /*

Modified: stable/11/sys/dev/sfxge/common/efx_mcdi.h
==
--- stable/11/sys/dev/sfxge/common/efx_mcdi.h   Mon Jul 29 10:40:51 2019
(r350408)
+++ stable/11/sys/dev/sfxge/common/efx_mcdi.h   Mon Jul 29 10:41:21 2019
(r350409)
@@ -393,6 +393,11 @@ efx_mcdi_phy_module_get_info(
(((mask) & (MC_CMD_PRIVILEGE_MASK_IN_GRP_ ## priv)) ==  \
(MC_CMD_PRIVILEGE_MASK_IN_GRP_ ## priv))
 
+#defineEFX_MCDI_BUF_SIZE(_in_len, _out_len)
\
+   EFX_P2ROUNDUP(size_t,   \
+   MAX(MAX(_in_len, _out_len), (2 * sizeof (efx_dword_t))),\
+   sizeof (efx_dword_t))
+
 /*
  * The buffer size must be a multiple of dword to ensure that MCDI works
  * properly with Siena based boards (which use on-chip buffer). Also, it
@@ -400,9 +405,7 @@ efx_mcdi_phy_module_get_info(
  * error responses if the request/response buffer sizes are smaller.
  */
 #define EFX_MCDI_DECLARE_BUF(_name, _in_len, _out_len) \
-   uint8_t _name[P2ROUNDUP(MAX

svn commit: r350407 - stable/12/sys/dev/sfxge/common

2019-07-29 Thread Andrew Rybchenko
Author: arybchik
Date: Mon Jul 29 09:34:47 2019
New Revision: 350407
URL: https://svnweb.freebsd.org/changeset/base/350407

Log:
  MFC r350371
  
  sfxge(4): unify power of 2 alignment check macro
  
  Substitute driver-defined IS_P2ALIGNED() with EFX_IS_P2ALIGNED()
  defined in libefx.
  
  Add type argument and cast value and alignment to one specified type.
  
  Reported by:Andrea Valsania 
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/12/sys/dev/sfxge/common/efsys.h
  stable/12/sys/dev/sfxge/common/efx.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/sfxge/common/efsys.h
==
--- stable/12/sys/dev/sfxge/common/efsys.h  Mon Jul 29 09:26:55 2019
(r350406)
+++ stable/12/sys/dev/sfxge/common/efsys.h  Mon Jul 29 09:34:47 2019
(r350407)
@@ -89,10 +89,6 @@ extern "C" {
 #defineB_TRUE  TRUE
 #endif
 
-#ifndef IS_P2ALIGNED
-#defineIS_P2ALIGNED(v, a)  uintptr_t)(v)) & ((uintptr_t)(a) - 
1)) == 0)
-#endif
-
 #ifndef IS2P
 #defineISP2(x) (((x) & ((x) - 1)) == 0)
 #endif
@@ -394,7 +390,8 @@ typedef struct efsys_mem_s {
uint32_t *addr; \
\
_NOTE(CONSTANTCONDITION)\
-   KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_dword_t)),\
+   KASSERT(EFX_IS_P2ALIGNED(size_t, _offset,   \
+   sizeof (efx_dword_t)),  \
("not power of 2 aligned"));\
\
addr = (void *)((_esmp)->esm_base + (_offset)); \
@@ -413,7 +410,8 @@ typedef struct efsys_mem_s {
uint64_t *addr; \
\
_NOTE(CONSTANTCONDITION)\
-   KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_qword_t)),\
+   KASSERT(EFX_IS_P2ALIGNED(size_t, _offset,   \
+   sizeof (efx_qword_t)),  \
("not power of 2 aligned"));\
\
addr = (void *)((_esmp)->esm_base + (_offset)); \
@@ -432,7 +430,8 @@ typedef struct efsys_mem_s {
uint32_t *addr; \
\
_NOTE(CONSTANTCONDITION)\
-   KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_qword_t)),\
+   KASSERT(EFX_IS_P2ALIGNED(size_t, _offset,   \
+   sizeof (efx_qword_t)),  \
("not power of 2 aligned"));\
\
addr = (void *)((_esmp)->esm_base + (_offset)); \
@@ -454,7 +453,8 @@ typedef struct efsys_mem_s {
uint64_t *addr; \
\
_NOTE(CONSTANTCONDITION)\
-   KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_oword_t)),\
+   KASSERT(EFX_IS_P2ALIGNED(size_t, _offset,   \
+   sizeof (efx_oword_t)),  \
("not power of 2 aligned"));\
\
addr = (void *)((_esmp)->esm_base + (_offset)); \
@@ -476,7 +476,8 @@ typedef struct efsys_mem_s {
uint32_t *addr; \
\
_NOTE(CONSTANTCONDITION)\
-   KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_oword_t)),\
+   KASSERT(EFX_IS_P2ALIGNED(size_t, _offset,   \
+   sizeof (efx_oword_t)),  \
("not power of 2 aligned"));\
\
addr = (void *)((_esmp)->esm_base + (_offset)); \
@@ -501,7 +502,8 @@ typedef struct efsys_mem_s {
uint32_t *addr; \
\
_NOTE(CONSTANTCONDITION) 

svn commit: r350406 - stable/12/sys/dev/sfxge/common

2019-07-29 Thread Andrew Rybchenko
Author: arybchik
Date: Mon Jul 29 09:26:55 2019
New Revision: 350406
URL: https://svnweb.freebsd.org/changeset/base/350406

Log:
  MFC r350370
  
  sfxge(4): fix align to power of 2 when align has smaller type
  
  Substitute driver-defined P2ALIGN() with EFX_P2ALIGN() defined in
  libefx.
  
  Cast value and alignment to one specified type to guarantee result
  correctness.
  
  Reported by:Andrea Valsania 
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/12/sys/dev/sfxge/common/ef10_rx.c
  stable/12/sys/dev/sfxge/common/efsys.h
  stable/12/sys/dev/sfxge/common/efx.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/sfxge/common/ef10_rx.c
==
--- stable/12/sys/dev/sfxge/common/ef10_rx.cMon Jul 29 09:25:16 2019
(r350405)
+++ stable/12/sys/dev/sfxge/common/ef10_rx.cMon Jul 29 09:26:55 2019
(r350406)
@@ -689,7 +689,7 @@ ef10_rx_qpush(
efx_dword_t dword;
 
/* Hardware has alignment restriction for WPTR */
-   wptr = P2ALIGN(added, EF10_RX_WPTR_ALIGN);
+   wptr = EFX_P2ALIGN(unsigned int, added, EF10_RX_WPTR_ALIGN);
if (pushed == wptr)
return;
 

Modified: stable/12/sys/dev/sfxge/common/efsys.h
==
--- stable/12/sys/dev/sfxge/common/efsys.h  Mon Jul 29 09:25:16 2019
(r350405)
+++ stable/12/sys/dev/sfxge/common/efsys.h  Mon Jul 29 09:26:55 2019
(r350406)
@@ -93,10 +93,6 @@ extern "C" {
 #defineIS_P2ALIGNED(v, a)  uintptr_t)(v)) & ((uintptr_t)(a) - 
1)) == 0)
 #endif
 
-#ifndef P2ALIGN
-#defineP2ALIGN(_x, _a) ((_x) & -(_a))
-#endif
-
 #ifndef IS2P
 #defineISP2(x) (((x) & ((x) - 1)) == 0)
 #endif

Modified: stable/12/sys/dev/sfxge/common/efx.h
==
--- stable/12/sys/dev/sfxge/common/efx.hMon Jul 29 09:25:16 2019
(r350405)
+++ stable/12/sys/dev/sfxge/common/efx.hMon Jul 29 09:26:55 2019
(r350406)
@@ -56,6 +56,10 @@ extern "C" {
 #defineEFX_P2ROUNDUP(_type, _value, _align)\
(-(-(_type)(_value) & -(_type)(_align)))
 
+/* Align value down to the nearest power of two. */
+#defineEFX_P2ALIGN(_type, _value, _align)  \
+   ((_type)(_value) & -(_type)(_align))
+
 /* Return codes */
 
 typedef __success(return == 0) int efx_rc_t;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r350405 - in stable/12/sys/dev/sfxge: . common

2019-07-29 Thread Andrew Rybchenko
Author: arybchik
Date: Mon Jul 29 09:25:16 2019
New Revision: 350405
URL: https://svnweb.freebsd.org/changeset/base/350405

Log:
  MFC r350369
  
  sfxge(4): fix power of 2 round up when align has smaller type
  
  Substitute driver-defined P2ROUNDUP() h with EFX_P2ROUNDUP()
  defined in libefx.
  
  Cast value and alignment to one specified type to guarantee result
  correctness.
  
  Reported by:Andrea Valsania 
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/12/sys/dev/sfxge/common/ef10_nvram.c
  stable/12/sys/dev/sfxge/common/efsys.h
  stable/12/sys/dev/sfxge/common/efx.h
  stable/12/sys/dev/sfxge/common/efx_mcdi.h
  stable/12/sys/dev/sfxge/common/efx_tx.c
  stable/12/sys/dev/sfxge/sfxge_rx.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/sfxge/common/ef10_nvram.c
==
--- stable/12/sys/dev/sfxge/common/ef10_nvram.c Mon Jul 29 09:19:48 2019
(r350404)
+++ stable/12/sys/dev/sfxge/common/ef10_nvram.c Mon Jul 29 09:25:16 2019
(r350405)
@@ -394,7 +394,8 @@ tlv_write(
if (len > 0) {
ptr[(len - 1) / sizeof (uint32_t)] = 0;
memcpy(ptr, data, len);
-   ptr += P2ROUNDUP(len, sizeof (uint32_t)) / sizeof (*ptr);
+   ptr += EFX_P2ROUNDUP(uint32_t, len,
+   sizeof (uint32_t)) / sizeof (*ptr);
}
 
return (ptr);

Modified: stable/12/sys/dev/sfxge/common/efsys.h
==
--- stable/12/sys/dev/sfxge/common/efsys.h  Mon Jul 29 09:19:48 2019
(r350404)
+++ stable/12/sys/dev/sfxge/common/efsys.h  Mon Jul 29 09:25:16 2019
(r350405)
@@ -93,10 +93,6 @@ extern "C" {
 #defineIS_P2ALIGNED(v, a)  uintptr_t)(v)) & ((uintptr_t)(a) - 
1)) == 0)
 #endif
 
-#ifndef P2ROUNDUP
-#defineP2ROUNDUP(x, align) (-(-(x) & -(align)))
-#endif
-
 #ifndef P2ALIGN
 #defineP2ALIGN(_x, _a) ((_x) & -(_a))
 #endif

Modified: stable/12/sys/dev/sfxge/common/efx.h
==
--- stable/12/sys/dev/sfxge/common/efx.hMon Jul 29 09:19:48 2019
(r350404)
+++ stable/12/sys/dev/sfxge/common/efx.hMon Jul 29 09:25:16 2019
(r350405)
@@ -52,6 +52,10 @@ extern "C" {
 #defineEFX_FIELD_OFFSET(_type, _field) \
((size_t) &(((_type *)0)->_field))
 
+/* Round value up to the nearest power of two. */
+#defineEFX_P2ROUNDUP(_type, _value, _align)\
+   (-(-(_type)(_value) & -(_type)(_align)))
+
 /* Return codes */
 
 typedef __success(return == 0) int efx_rc_t;
@@ -451,10 +455,10 @@ typedef enum efx_link_mode_e {
+ /* bug16011 */ 16)\
 
 #defineEFX_MAC_PDU(_sdu)   \
-   P2ROUNDUP((_sdu) + EFX_MAC_PDU_ADJUSTMENT, 8)
+   EFX_P2ROUNDUP(size_t, (_sdu) + EFX_MAC_PDU_ADJUSTMENT, 8)
 
 /*
- * Due to the P2ROUNDUP in EFX_MAC_PDU(), EFX_MAC_SDU_FROM_PDU() may give
+ * Due to the EFX_P2ROUNDUP in EFX_MAC_PDU(), EFX_MAC_SDU_FROM_PDU() may give
  * the SDU rounded up slightly.
  */
 #defineEFX_MAC_SDU_FROM_PDU(_pdu)  ((_pdu) - 
EFX_MAC_PDU_ADJUSTMENT)
@@ -540,8 +544,9 @@ efx_mac_stat_name(
 
 #defineEFX_MAC_STATS_MASK_BITS_PER_PAGE(8 * sizeof (uint32_t))
 
-#defineEFX_MAC_STATS_MASK_NPAGES   \
-   (P2ROUNDUP(EFX_MAC_NSTATS, EFX_MAC_STATS_MASK_BITS_PER_PAGE) / \
+#defineEFX_MAC_STATS_MASK_NPAGES   \
+   (EFX_P2ROUNDUP(uint32_t, EFX_MAC_NSTATS,\
+  EFX_MAC_STATS_MASK_BITS_PER_PAGE) /  \
EFX_MAC_STATS_MASK_BITS_PER_PAGE)
 
 /*

Modified: stable/12/sys/dev/sfxge/common/efx_mcdi.h
==
--- stable/12/sys/dev/sfxge/common/efx_mcdi.h   Mon Jul 29 09:19:48 2019
(r350404)
+++ stable/12/sys/dev/sfxge/common/efx_mcdi.h   Mon Jul 29 09:25:16 2019
(r350405)
@@ -395,6 +395,11 @@ efx_mcdi_phy_module_get_info(
(((mask) & (MC_CMD_PRIVILEGE_MASK_IN_GRP_ ## priv)) ==  \
(MC_CMD_PRIVILEGE_MASK_IN_GRP_ ## priv))
 
+#defineEFX_MCDI_BUF_SIZE(_in_len, _out_len)
\
+   EFX_P2ROUNDUP(size_t,   \
+   MAX(MAX(_in_len, _out_len), (2 * sizeof (efx_dword_t))),\
+   sizeof (efx_dword_t))
+
 /*
  * The buffer size must be a multiple of dword to ensure that MCDI works
  * properly with Siena based boards (which use on-chip buffer). Also, it
@@ -402,9 +407,7 @@ efx_mcdi_phy_module_get_info(
  * error responses if the request/response buffer sizes are smaller.
  */
 #define EFX_MCDI_DECLARE_BUF(_name, _in_len, _out_len) \
-   uint8_t _name[P2ROUNDUP(MAX

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

2019-07-27 Thread Andrew Rybchenko
Author: arybchik
Date: Sat Jul 27 09:36:36 2019
New Revision: 350370
URL: https://svnweb.freebsd.org/changeset/base/350370

Log:
  sfxge(4): fix align to power of 2 when align has smaller type
  
  Substitute driver-defined P2ALIGN() with EFX_P2ALIGN() defined in
  libefx.
  
  Cast value and alignment to one specified type to guarantee result
  correctness.
  
  Reported by:Andrea Valsania 
  Reviewed by:  philip
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days
  Differential Revision:  https://reviews.freebsd.org/D21075

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

Modified: head/sys/dev/sfxge/common/ef10_rx.c
==
--- head/sys/dev/sfxge/common/ef10_rx.c Sat Jul 27 09:36:27 2019
(r350369)
+++ head/sys/dev/sfxge/common/ef10_rx.c Sat Jul 27 09:36:36 2019
(r350370)
@@ -869,7 +869,7 @@ ef10_rx_qpush(
efx_dword_t dword;
 
/* Hardware has alignment restriction for WPTR */
-   wptr = P2ALIGN(added, EF10_RX_WPTR_ALIGN);
+   wptr = EFX_P2ALIGN(unsigned int, added, EF10_RX_WPTR_ALIGN);
if (pushed == wptr)
return;
 

Modified: head/sys/dev/sfxge/common/efsys.h
==
--- head/sys/dev/sfxge/common/efsys.h   Sat Jul 27 09:36:27 2019
(r350369)
+++ head/sys/dev/sfxge/common/efsys.h   Sat Jul 27 09:36:36 2019
(r350370)
@@ -88,10 +88,6 @@ extern "C" {
 #defineIS_P2ALIGNED(v, a)  uintptr_t)(v)) & ((uintptr_t)(a) - 
1)) == 0)
 #endif
 
-#ifndef P2ALIGN
-#defineP2ALIGN(_x, _a) ((_x) & -(_a))
-#endif
-
 #ifndef IS2P
 #defineISP2(x) (((x) & ((x) - 1)) == 0)
 #endif

Modified: head/sys/dev/sfxge/common/efx.h
==
--- head/sys/dev/sfxge/common/efx.h Sat Jul 27 09:36:27 2019
(r350369)
+++ head/sys/dev/sfxge/common/efx.h Sat Jul 27 09:36:36 2019
(r350370)
@@ -60,6 +60,10 @@ extern "C" {
 #defineEFX_P2ROUNDUP(_type, _value, _align)\
(-(-(_type)(_value) & -(_type)(_align)))
 
+/* Align value down to the nearest power of two. */
+#defineEFX_P2ALIGN(_type, _value, _align)  \
+   ((_type)(_value) & -(_type)(_align))
+
 /* Return codes */
 
 typedef __success(return == 0) int efx_rc_t;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2019-07-27 Thread Andrew Rybchenko
Author: arybchik
Date: Sat Jul 27 09:36:45 2019
New Revision: 350371
URL: https://svnweb.freebsd.org/changeset/base/350371

Log:
  sfxge(4): unify power of 2 alignment check macro
  
  Substitute driver-defined IS_P2ALIGNED() with EFX_IS_P2ALIGNED()
  defined in libefx.
  
  Add type argument and cast value and alignment to one specified type.
  
  Reported by:Andrea Valsania 
  Reviewed by:philip
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days
  Differential Revision:  https://reviews.freebsd.org/D21076

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

Modified: head/sys/dev/sfxge/common/ef10_rx.c
==
--- head/sys/dev/sfxge/common/ef10_rx.c Sat Jul 27 09:36:36 2019
(r350370)
+++ head/sys/dev/sfxge/common/ef10_rx.c Sat Jul 27 09:36:45 2019
(r350371)
@@ -1131,12 +1131,12 @@ ef10_rx_qcreate(
rc = ENOTSUP;
goto fail9;
}
-   if (!IS_P2ALIGNED(es_max_dma_len,
+   if (!EFX_IS_P2ALIGNED(uint32_t, es_max_dma_len,
EFX_RX_ES_SUPER_BUFFER_BUF_ALIGNMENT)) {
rc = EINVAL;
goto fail10;
}
-   if (!IS_P2ALIGNED(es_buf_stride,
+   if (!EFX_IS_P2ALIGNED(uint32_t, es_buf_stride,
EFX_RX_ES_SUPER_BUFFER_BUF_ALIGNMENT)) {
rc = EINVAL;
goto fail11;

Modified: head/sys/dev/sfxge/common/efsys.h
==
--- head/sys/dev/sfxge/common/efsys.h   Sat Jul 27 09:36:36 2019
(r350370)
+++ head/sys/dev/sfxge/common/efsys.h   Sat Jul 27 09:36:45 2019
(r350371)
@@ -84,10 +84,6 @@ extern "C" {
 #defineB_TRUE  TRUE
 #endif
 
-#ifndef IS_P2ALIGNED
-#defineIS_P2ALIGNED(v, a)  uintptr_t)(v)) & ((uintptr_t)(a) - 
1)) == 0)
-#endif
-
 #ifndef IS2P
 #defineISP2(x) (((x) & ((x) - 1)) == 0)
 #endif
@@ -375,7 +371,8 @@ typedef struct efsys_mem_s {
uint32_t *addr; \
\
_NOTE(CONSTANTCONDITION)\
-   KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_dword_t)),\
+   KASSERT(EFX_IS_P2ALIGNED(size_t, _offset,   \
+   sizeof (efx_dword_t)),  \
("not power of 2 aligned"));\
\
addr = (void *)((_esmp)->esm_base + (_offset)); \
@@ -394,7 +391,8 @@ typedef struct efsys_mem_s {
uint64_t *addr; \
\
_NOTE(CONSTANTCONDITION)\
-   KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_qword_t)),\
+   KASSERT(EFX_IS_P2ALIGNED(size_t, _offset,   \
+   sizeof (efx_qword_t)),  \
("not power of 2 aligned"));\
\
addr = (void *)((_esmp)->esm_base + (_offset)); \
@@ -413,7 +411,8 @@ typedef struct efsys_mem_s {
uint32_t *addr; \
\
_NOTE(CONSTANTCONDITION)\
-   KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_qword_t)),\
+   KASSERT(EFX_IS_P2ALIGNED(size_t, _offset,   \
+   sizeof (efx_qword_t)),  \
("not power of 2 aligned"));\
\
addr = (void *)((_esmp)->esm_base + (_offset)); \
@@ -435,7 +434,8 @@ typedef struct efsys_mem_s {
uint64_t *addr; \
\
_NOTE(CONSTANTCONDITION)\
-   KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_oword_t)),\
+   KASSERT(EFX_IS_P2ALIGNED(size_t, _offset,   \
+   sizeof (efx_oword_t)),  \
("not power of 2 aligned"));\
\
addr = (

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

2019-07-27 Thread Andrew Rybchenko
Author: arybchik
Date: Sat Jul 27 09:36:27 2019
New Revision: 350369
URL: https://svnweb.freebsd.org/changeset/base/350369

Log:
  sfxge(4): fix power of 2 round up when align has smaller type
  
  Substitute driver-defined P2ROUNDUP() h with EFX_P2ROUNDUP()
  defined in libefx.
  
  Cast value and alignment to one specified type to guarantee result
  correctness.
  
  Reported by:  Andrea Valsania 
  Reviewed by:philip
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days
  Differential Revision:  https://reviews.freebsd.org/D21074

Modified:
  head/sys/dev/sfxge/common/ef10_impl.h
  head/sys/dev/sfxge/common/ef10_nvram.c
  head/sys/dev/sfxge/common/ef10_rx.c
  head/sys/dev/sfxge/common/efsys.h
  head/sys/dev/sfxge/common/efx.h
  head/sys/dev/sfxge/common/efx_mcdi.h
  head/sys/dev/sfxge/common/efx_tx.c
  head/sys/dev/sfxge/sfxge_port.c
  head/sys/dev/sfxge/sfxge_rx.c

Modified: head/sys/dev/sfxge/common/ef10_impl.h
==
--- head/sys/dev/sfxge/common/ef10_impl.h   Sat Jul 27 02:23:05 2019
(r350368)
+++ head/sys/dev/sfxge/common/ef10_impl.h   Sat Jul 27 09:36:27 2019
(r350369)
@@ -1269,10 +1269,11 @@ efx_mcdi_set_nic_global(
 #defineEFX_RX_PACKED_STREAM_RX_PREFIX_SIZE 8
 
 /* Minimum space for packet in packed stream mode */
-#defineEFX_RX_PACKED_STREAM_MIN_PACKET_SPACE\
-   P2ROUNDUP(EFX_RX_PACKED_STREAM_RX_PREFIX_SIZE +  \
-   EFX_MAC_PDU_MIN +\
-   EFX_RX_PACKED_STREAM_ALIGNMENT,  \
+#defineEFX_RX_PACKED_STREAM_MIN_PACKET_SPACE   \
+   EFX_P2ROUNDUP(size_t,   \
+   EFX_RX_PACKED_STREAM_RX_PREFIX_SIZE +   \
+   EFX_MAC_PDU_MIN +   \
+   EFX_RX_PACKED_STREAM_ALIGNMENT, \
EFX_RX_PACKED_STREAM_ALIGNMENT)
 
 /* Maximum number of credits */

Modified: head/sys/dev/sfxge/common/ef10_nvram.c
==
--- head/sys/dev/sfxge/common/ef10_nvram.c  Sat Jul 27 02:23:05 2019
(r350368)
+++ head/sys/dev/sfxge/common/ef10_nvram.c  Sat Jul 27 09:36:27 2019
(r350369)
@@ -394,7 +394,8 @@ tlv_write(
if (len > 0) {
ptr[(len - 1) / sizeof (uint32_t)] = 0;
memcpy(ptr, data, len);
-   ptr += P2ROUNDUP(len, sizeof (uint32_t)) / sizeof (*ptr);
+   ptr += EFX_P2ROUNDUP(uint32_t, len,
+   sizeof (uint32_t)) / sizeof (*ptr);
}
 
return (ptr);

Modified: head/sys/dev/sfxge/common/ef10_rx.c
==
--- head/sys/dev/sfxge/common/ef10_rx.c Sat Jul 27 02:23:05 2019
(r350368)
+++ head/sys/dev/sfxge/common/ef10_rx.c Sat Jul 27 09:36:27 2019
(r350369)
@@ -957,8 +957,9 @@ ef10_rx_qps_packet_info(
*lengthp   = EFX_QWORD_FIELD(*qwordp, ES_DZ_PS_RX_PREFIX_ORIG_LEN);
buf_len= EFX_QWORD_FIELD(*qwordp, ES_DZ_PS_RX_PREFIX_CAP_LEN);
 
-   buf_len = P2ROUNDUP(buf_len + EFX_RX_PACKED_STREAM_RX_PREFIX_SIZE,
-   EFX_RX_PACKED_STREAM_ALIGNMENT);
+   buf_len = EFX_P2ROUNDUP(uint16_t,
+   buf_len + EFX_RX_PACKED_STREAM_RX_PREFIX_SIZE,
+   EFX_RX_PACKED_STREAM_ALIGNMENT);
*next_offsetp =
current_offset + buf_len + EFX_RX_PACKED_STREAM_ALIGNMENT;
 

Modified: head/sys/dev/sfxge/common/efsys.h
==
--- head/sys/dev/sfxge/common/efsys.h   Sat Jul 27 02:23:05 2019
(r350368)
+++ head/sys/dev/sfxge/common/efsys.h   Sat Jul 27 09:36:27 2019
(r350369)
@@ -88,10 +88,6 @@ extern "C" {
 #defineIS_P2ALIGNED(v, a)  uintptr_t)(v)) & ((uintptr_t)(a) - 
1)) == 0)
 #endif
 
-#ifndef P2ROUNDUP
-#defineP2ROUNDUP(x, align) (-(-(x) & -(align)))
-#endif
-
 #ifndef P2ALIGN
 #defineP2ALIGN(_x, _a) ((_x) & -(_a))
 #endif

Modified: head/sys/dev/sfxge/common/efx.h
==
--- head/sys/dev/sfxge/common/efx.h Sat Jul 27 02:23:05 2019
(r350368)
+++ head/sys/dev/sfxge/common/efx.h Sat Jul 27 09:36:27 2019
(r350369)
@@ -56,6 +56,10 @@ extern "C" {
 /* The macro expands divider twice */
 #defineEFX_DIV_ROUND_UP(_n, _d)(((_n) + (_d) - 1) / 
(_d))
 
+/* Round value up to the nearest power of two. */
+#defineEFX_P2ROUNDUP(_type, _value, _align)\
+   (-(-(_type)(_value) & -(_type)(_align)))
+
 /* Return codes */
 
 typedef __success(return == 0) int efx_rc_t;
@@ -522,10 +526,10 @@ typedef enum efx_link_mode_e {
+ /* bug16011 */ 16)\
 
 #defineEFX_MAC_PDU(_sdu)  

svn commit: r342529 - stable/10/sys/dev/sfxge

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:39:34 2018
New Revision: 342529
URL: https://svnweb.freebsd.org/changeset/base/342529

Log:
  MFC r341785
  
  sfxge(4): use n Tx queues instead of n + 2 on EF10 HW
  
  On EF10 HW we can avoid sending packets without checksum offload
  or with IP-only checksum offload to dedicated queues. Instead, we
  can use option descriptors to change offload policy on any queue
  during runtime. Thus, we don't need to create two dedicated queues.
  
  Submitted by:   Ivan Malov 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18390

Modified:
  stable/10/sys/dev/sfxge/sfxge.c
  stable/10/sys/dev/sfxge/sfxge.h
  stable/10/sys/dev/sfxge/sfxge_ev.c
  stable/10/sys/dev/sfxge/sfxge_tx.c
  stable/10/sys/dev/sfxge/sfxge_tx.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/sfxge.c
==
--- stable/10/sys/dev/sfxge/sfxge.c Wed Dec 26 10:39:22 2018
(r342528)
+++ stable/10/sys/dev/sfxge/sfxge.c Wed Dec 26 10:39:34 2018
(r342529)
@@ -754,6 +754,11 @@ sfxge_create(struct sfxge_softc *sc)
}
sc->rxq_entries = sfxge_rx_ring_entries;
 
+   if (efx_nic_cfg_get(enp)->enc_features & EFX_FEATURE_TXQ_CKSUM_OP_DESC)
+   sc->txq_dynamic_cksum_toggle_supported = B_TRUE;
+   else
+   sc->txq_dynamic_cksum_toggle_supported = B_FALSE;
+
if (!ISP2(sfxge_tx_ring_entries) ||
(sfxge_tx_ring_entries < EFX_TXQ_MINNDESCS) ||
(sfxge_tx_ring_entries > efx_nic_cfg_get(enp)->enc_txq_max_ndescs)) 
{

Modified: stable/10/sys/dev/sfxge/sfxge.h
==
--- stable/10/sys/dev/sfxge/sfxge.h Wed Dec 26 10:39:22 2018
(r342528)
+++ stable/10/sys/dev/sfxge/sfxge.h Wed Dec 26 10:39:34 2018
(r342529)
@@ -289,6 +289,8 @@ struct sfxge_softc {
efx_nic_t   *enp;
efsys_lock_tenp_lock;
 
+   boolean_t   txq_dynamic_cksum_toggle_supported;
+
unsigned intrxq_entries;
unsigned inttxq_entries;
 

Modified: stable/10/sys/dev/sfxge/sfxge_ev.c
==
--- stable/10/sys/dev/sfxge/sfxge_ev.c  Wed Dec 26 10:39:22 2018
(r342528)
+++ stable/10/sys/dev/sfxge/sfxge_ev.c  Wed Dec 26 10:39:34 2018
(r342529)
@@ -262,8 +262,11 @@ sfxge_get_txq_by_label(struct sfxge_evq *evq, enum sfx
 {
unsigned int index;
 
-   KASSERT((evq->index == 0 && label < SFXGE_EVQ0_N_TXQ(evq->sc)) ||
-   (label == SFXGE_TXQ_IP_TCP_UDP_CKSUM), ("unexpected txq label"));
+   KASSERT((evq->sc->txq_dynamic_cksum_toggle_supported) ? (label == 0) :
+   ((evq->index == 0 && label < SFXGE_TXQ_NTYPES) ||
+(label == SFXGE_TXQ_IP_TCP_UDP_CKSUM)),
+   ("unexpected txq label"));
+
index = (evq->index == 0) ?
label : (evq->index - 1 + SFXGE_EVQ0_N_TXQ(evq->sc));
return (evq->sc->txq[index]);

Modified: stable/10/sys/dev/sfxge/sfxge_tx.c
==
--- stable/10/sys/dev/sfxge/sfxge_tx.c  Wed Dec 26 10:39:22 2018
(r342528)
+++ stable/10/sys/dev/sfxge/sfxge_tx.c  Wed Dec 26 10:39:34 2018
(r342529)
@@ -33,7 +33,7 @@
 
 /* Theory of operation:
  *
- * Tx queues allocation and mapping
+ * Tx queues allocation and mapping on Siena
  *
  * One Tx queue with enabled checksum offload is allocated per Rx channel
  * (event queue).  Also 2 Tx queues (one without checksum offload and one
@@ -44,6 +44,17 @@
  * if event queue index is 0, TxQ-index = TxQ-label * [0..SFXGE_TXQ_NTYPES)
  * else TxQ-index = SFXGE_TXQ_NTYPES + EvQ-index - 1
  * See sfxge_get_txq_by_label() sfxge_ev.c
+ *
+ * Tx queue allocation and mapping on EF10
+ *
+ * One Tx queue with enabled checksum offload is allocated per Rx
+ * channel (event queue). Checksum offload on all Tx queues is enabled or
+ * disabled dynamically by inserting option descriptors, so the additional
+ * queues used on Siena are not required.
+ *
+ * TxQ label is always set to zero on EF10 hardware.
+ * So, event queue to Tx queue mapping is simple:
+ * TxQ-index = EvQ-index
  */
 
 #include 
@@ -130,38 +141,75 @@ static void sfxge_tx_qlist_post(struct sfxge_txq *txq)
 static void sfxge_tx_qunblock(struct sfxge_txq *txq);
 static int sfxge_tx_queue_tso(struct sfxge_txq *txq, struct mbuf *mbuf,
  const bus_dma_segment_t *dma_seg, int n_dma_seg,
- int vlan_tagged);
+ int n_extra_descs);
 
+static inline void
+sfxge_next_stmp(struct sfxge_txq *txq, struct sfxge_tx_mapping **pstmp)
+{
+   KASSERT((*pstmp)->flags == 

svn commit: r342527 - stable/10/sys/dev/sfxge

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:38:51 2018
New Revision: 342527
URL: https://svnweb.freebsd.org/changeset/base/342527

Log:
  MFC r341784
  
  sfxge(4): prepare the number of Tx queues on event queue 0 to become
  variable
  
  The number of Tx queues on event queue 0 can depend on the NIC family
  type, and this property will be leveraged by future patches.
  This patch prepares the code for this change.
  
  Submitted by:   Ivan Malov 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18389

Modified:
  stable/10/sys/dev/sfxge/sfxge.c
  stable/10/sys/dev/sfxge/sfxge_ev.c
  stable/10/sys/dev/sfxge/sfxge_tx.c
  stable/10/sys/dev/sfxge/sfxge_tx.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/sfxge.c
==
--- stable/10/sys/dev/sfxge/sfxge.c Wed Dec 26 10:38:12 2018
(r342526)
+++ stable/10/sys/dev/sfxge/sfxge.c Wed Dec 26 10:38:51 2018
(r342527)
@@ -134,8 +134,8 @@ sfxge_estimate_rsrc_limits(struct sfxge_softc *sc)
 
limits.edl_min_evq_count = 1;
limits.edl_max_evq_count = evq_max;
-   limits.edl_min_txq_count = SFXGE_TXQ_NTYPES;
-   limits.edl_max_txq_count = evq_max + SFXGE_TXQ_NTYPES - 1;
+   limits.edl_min_txq_count = SFXGE_EVQ0_N_TXQ(sc);
+   limits.edl_max_txq_count = evq_max + SFXGE_EVQ0_N_TXQ(sc) - 1;
limits.edl_min_rxq_count = 1;
limits.edl_max_rxq_count = evq_max;
 
@@ -151,12 +151,12 @@ sfxge_estimate_rsrc_limits(struct sfxge_softc *sc)
return (rc);
}
 
-   KASSERT(txq_allocated >= SFXGE_TXQ_NTYPES,
-   ("txq_allocated < SFXGE_TXQ_NTYPES"));
+   KASSERT(txq_allocated >= SFXGE_EVQ0_N_TXQ(sc),
+   ("txq_allocated < %u", SFXGE_EVQ0_N_TXQ(sc)));
 
sc->evq_max = MIN(evq_allocated, evq_max);
sc->evq_max = MIN(rxq_allocated, sc->evq_max);
-   sc->evq_max = MIN(txq_allocated - (SFXGE_TXQ_NTYPES - 1),
+   sc->evq_max = MIN(txq_allocated - (SFXGE_EVQ0_N_TXQ(sc) - 1),
  sc->evq_max);
 
KASSERT(sc->evq_max <= evq_max,
@@ -180,7 +180,7 @@ sfxge_set_drv_limits(struct sfxge_softc *sc)
limits.edl_min_evq_count = limits.edl_max_evq_count =
sc->intr.n_alloc;
limits.edl_min_txq_count = limits.edl_max_txq_count =
-   sc->intr.n_alloc + SFXGE_TXQ_NTYPES - 1;
+   sc->intr.n_alloc + SFXGE_EVQ0_N_TXQ(sc) - 1;
limits.edl_min_rxq_count = limits.edl_max_rxq_count =
sc->intr.n_alloc;
 

Modified: stable/10/sys/dev/sfxge/sfxge_ev.c
==
--- stable/10/sys/dev/sfxge/sfxge_ev.c  Wed Dec 26 10:38:12 2018
(r342526)
+++ stable/10/sys/dev/sfxge/sfxge_ev.c  Wed Dec 26 10:38:51 2018
(r342527)
@@ -262,9 +262,10 @@ sfxge_get_txq_by_label(struct sfxge_evq *evq, enum sfx
 {
unsigned int index;
 
-   KASSERT((evq->index == 0 && label < SFXGE_TXQ_NTYPES) ||
+   KASSERT((evq->index == 0 && label < SFXGE_EVQ0_N_TXQ(evq->sc)) ||
(label == SFXGE_TXQ_IP_TCP_UDP_CKSUM), ("unexpected txq label"));
-   index = (evq->index == 0) ? label : (evq->index - 1 + SFXGE_TXQ_NTYPES);
+   index = (evq->index == 0) ?
+   label : (evq->index - 1 + SFXGE_EVQ0_N_TXQ(evq->sc));
return (evq->sc->txq[index]);
 }
 

Modified: stable/10/sys/dev/sfxge/sfxge_tx.c
==
--- stable/10/sys/dev/sfxge/sfxge_tx.c  Wed Dec 26 10:38:12 2018
(r342526)
+++ stable/10/sys/dev/sfxge/sfxge_tx.c  Wed Dec 26 10:38:51 2018
(r342527)
@@ -1957,7 +1957,7 @@ sfxge_tx_init(struct sfxge_softc *sc)
goto fail_tx_dpl_put_max;
}
 
-   sc->txq_count = SFXGE_TXQ_NTYPES - 1 + sc->intr.n_alloc;
+   sc->txq_count = SFXGE_EVQ0_N_TXQ(sc) - 1 + sc->intr.n_alloc;
 
sc->tso_fw_assisted = sfxge_tso_fw_assisted;
if ((~encp->enc_features & EFX_FEATURE_FW_ASSISTED_TSO) ||
@@ -1986,9 +1986,9 @@ sfxge_tx_init(struct sfxge_softc *sc)
goto fail2;
 
for (index = 0;
-index < sc->txq_count - SFXGE_TXQ_NTYPES + 1;
+index < sc->txq_count - SFXGE_EVQ0_N_TXQ(sc) + 1;
 index++) {
-   if ((rc = sfxge_tx_qinit(sc, SFXGE_TXQ_NTYPES - 1 + index,
+   if ((rc = sfxge_tx_qinit(sc, SFXGE_EVQ0_N_TXQ(sc) - 1 + index,
SFXGE_TXQ_IP_TCP_UDP_CKSUM, index)) != 0)
goto fail3;
}

Modified: stable/10/sys/dev/sfxge/sfxge_tx.h
==
--- stable/10/sys/dev/sfxge/sfxge_tx.h  Wed Dec 26 10:38:12 2018
(r342526)
+++ stable/10/sys/dev/sfxge/sfxge_tx.h  Wed Dec 26 10:38:51 2018
(r342527)
@@ -137,6 +137,8 @@ enum sfxge_txq_type {
   

svn commit: r342524 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:37:06 2018
New Revision: 342524
URL: https://svnweb.freebsd.org/changeset/base/342524

Log:
  MFC r341783
  
  sfxge(4): report support for Tx checksum op descriptors
  
  FreeBSD driver needs a patch to provide a means for packets
  which do not need checksum offload but have flow ID set
  to avoid hitting only the first Tx queue (which has been used
  for packets not needing checksum offload).
  
  This should be possible on Huntington, Medford or Medford2 chips
  since these support toggling checksum offload on any given queue
  dynamically by means of pushing option descriptors.
  
  The patch for FreeBSD driver will then need a means to figure out
  whether the feature can be used, and testing adapter family might
  not be a good solution.
  
  This patch adds a feature bit specifically to indicate support
  for checksum option descriptors. The new feature bits may have
  more users in future, apart from the mentioned FreeBSD patch.
  
  Submitted by:   Ivan Malov 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18388

Modified:
  stable/10/sys/dev/sfxge/common/efx.h
  stable/10/sys/dev/sfxge/common/efx_nic.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx.h
==
--- stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 10:35:41 2018
(r342523)
+++ stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 10:37:06 2018
(r342524)
@@ -1084,6 +1084,7 @@ efx_bist_stop(
 #defineEFX_FEATURE_PIO_BUFFERS 0x0800
 #defineEFX_FEATURE_FW_ASSISTED_TSO 0x1000
 #defineEFX_FEATURE_FW_ASSISTED_TSO_V2  0x2000
+#defineEFX_FEATURE_TXQ_CKSUM_OP_DESC   0x8000
 
 typedef enum efx_tunnel_protocol_e {
EFX_TUNNEL_PROTOCOL_NONE = 0,

Modified: stable/10/sys/dev/sfxge/common/efx_nic.c
==
--- stable/10/sys/dev/sfxge/common/efx_nic.cWed Dec 26 10:35:41 2018
(r342523)
+++ stable/10/sys/dev/sfxge/common/efx_nic.cWed Dec 26 10:37:06 2018
(r342524)
@@ -215,7 +215,8 @@ efx_nic_create(
EFX_FEATURE_MCDI_DMA |
EFX_FEATURE_PIO_BUFFERS |
EFX_FEATURE_FW_ASSISTED_TSO |
-   EFX_FEATURE_FW_ASSISTED_TSO_V2;
+   EFX_FEATURE_FW_ASSISTED_TSO_V2 |
+   EFX_FEATURE_TXQ_CKSUM_OP_DESC;
break;
 #endif /* EFSYS_OPT_HUNTINGTON */
 
@@ -234,7 +235,8 @@ efx_nic_create(
EFX_FEATURE_MAC_HEADER_FILTERS |
EFX_FEATURE_MCDI_DMA |
EFX_FEATURE_PIO_BUFFERS |
-   EFX_FEATURE_FW_ASSISTED_TSO_V2;
+   EFX_FEATURE_FW_ASSISTED_TSO_V2 |
+   EFX_FEATURE_TXQ_CKSUM_OP_DESC;
break;
 #endif /* EFSYS_OPT_MEDFORD */
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342523 - stable/10/sys/dev/sfxge

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:35:41 2018
New Revision: 342523
URL: https://svnweb.freebsd.org/changeset/base/342523

Log:
  MFC r341782
  
  sfxge(4): populate per-event queue stats in sysctl
  
  In order to find out why the first event queue and corresponding
  interrupt is triggered more frequent, it is useful to know which
  events go to each event queue.
  
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18418

Modified:
  stable/10/sys/dev/sfxge/sfxge.h
  stable/10/sys/dev/sfxge/sfxge_ev.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/sfxge.h
==
--- stable/10/sys/dev/sfxge/sfxge.h Wed Dec 26 10:28:43 2018
(r342522)
+++ stable/10/sys/dev/sfxge/sfxge.h Wed Dec 26 10:35:41 2018
(r342523)
@@ -181,6 +181,10 @@ struct sfxge_evq {
unsigned intbuf_base_id;
unsigned intentries;
charlock_name[SFXGE_LOCK_NAME_MAX];
+#if EFSYS_OPT_QSTATS
+   clock_t stats_update_time;
+   uint64_tstats[EV_NQSTATS];
+#endif
 } __aligned(CACHE_LINE_SIZE);
 
 #defineSFXGE_NDESCS1024
@@ -272,6 +276,9 @@ struct sfxge_softc {
struct ifnet*ifnet;
unsigned intif_flags;
struct sysctl_oid   *stats_node;
+#if EFSYS_OPT_QSTATS
+   struct sysctl_oid   *evqs_stats_node;
+#endif
struct sysctl_oid   *txqs_node;
 
struct task task_reset;

Modified: stable/10/sys/dev/sfxge/sfxge_ev.c
==
--- stable/10/sys/dev/sfxge/sfxge_ev.c  Wed Dec 26 10:28:43 2018
(r342522)
+++ stable/10/sys/dev/sfxge/sfxge_ev.c  Wed Dec 26 10:35:41 2018
(r342523)
@@ -436,29 +436,94 @@ sfxge_ev_wake_up(void *arg, uint32_t index)
 #if EFSYS_OPT_QSTATS
 
 static void
+sfxge_evq_stat_update(struct sfxge_evq *evq)
+{
+   clock_t now;
+
+   SFXGE_EVQ_LOCK(evq);
+
+   if (__predict_false(evq->init_state != SFXGE_EVQ_STARTED))
+   goto out;
+
+   now = ticks;
+   if ((unsigned int)(now - evq->stats_update_time) < (unsigned int)hz)
+   goto out;
+
+   evq->stats_update_time = now;
+   efx_ev_qstats_update(evq->common, evq->stats);
+
+out:
+   SFXGE_EVQ_UNLOCK(evq);
+}
+
+static int
+sfxge_evq_stat_handler(SYSCTL_HANDLER_ARGS)
+{
+   struct sfxge_evq *evq = arg1;
+   struct sfxge_softc *sc = evq->sc;
+   unsigned int id = arg2;
+
+   SFXGE_ADAPTER_LOCK(sc);
+
+   sfxge_evq_stat_update(evq);
+
+   SFXGE_ADAPTER_UNLOCK(sc);
+
+   return (SYSCTL_OUT(req, &evq->stats[id], sizeof(evq->stats[id])));
+}
+
+static int
+sfxge_evq_stat_init(struct sfxge_evq *evq)
+{
+   struct sfxge_softc *sc = evq->sc;
+   struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(sc->dev);
+   char name[16];
+   struct sysctl_oid *evq_stats_node;
+   unsigned int id;
+
+   snprintf(name, sizeof(name), "%u", evq->index);
+   evq_stats_node = SYSCTL_ADD_NODE(ctx,
+SYSCTL_CHILDREN(sc->evqs_stats_node),
+OID_AUTO, name, CTLFLAG_RD, NULL, "");
+   if (evq_stats_node == NULL)
+   return (ENOMEM);
+
+   for (id = 0; id < EV_NQSTATS; id++) {
+   SYSCTL_ADD_PROC(
+   ctx, SYSCTL_CHILDREN(evq_stats_node),
+   OID_AUTO, efx_ev_qstat_name(sc->enp, id),
+   CTLTYPE_U64|CTLFLAG_RD,
+   evq, id, sfxge_evq_stat_handler, "Q",
+   "");
+   }
+
+   return (0);
+}
+
+static void
 sfxge_ev_stat_update(struct sfxge_softc *sc)
 {
struct sfxge_evq *evq;
unsigned int index;
clock_t now;
+   unsigned int id;
 
SFXGE_ADAPTER_LOCK(sc);
 
-   if (__predict_false(sc->evq[0]->init_state != SFXGE_EVQ_STARTED))
-   goto out;
-
now = ticks;
if ((unsigned int)(now - sc->ev_stats_update_time) < (unsigned int)hz)
goto out;
 
sc->ev_stats_update_time = now;
 
-   /* Add event counts from each event queue in turn */
+   memset(sc->ev_stats, 0, sizeof(sc->ev_stats));
+
+   /* Update and add event counts from each event queue in turn */
for (index = 0; index < sc->evq_count; index++) {
evq = sc->evq[index];
-   SFXGE_EVQ_LOCK(evq);
-   efx_ev_qstats_update(evq->common, sc->ev_stats);
-   SFXGE_EVQ_UNLOCK(evq);
+   sfxge_evq_stat_update(evq);
+   for (id = 0; id < EV_NQSTATS; id++)
+   sc->ev_stats[id] += evq->stats[id];
}
 out:
SFXGE_ADAPTER_UNLOCK(sc);
@@ -665,7 +

svn commit: r342521 - stable/10/sys/dev/sfxge/common

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

Log:
  MFC r341326
  
  sfxge(4): ensure EvQ poll stops when abort is requested
  
  If an event handler requested an abort, only the inner loop was
  guarenteed to be broken out of - the outer loop could continue
  if total == batch.
  
  Fix this by poisoning batch to ensure it is different to total.
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18287

Modified:
  stable/10/sys/dev/sfxge/common/efx_ev.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_ev.c
==
--- stable/10/sys/dev/sfxge/common/efx_ev.c Wed Dec 26 10:27:24 2018
(r342520)
+++ stable/10/sys/dev/sfxge/common/efx_ev.c Wed Dec 26 10:28:03 2018
(r342521)
@@ -501,6 +501,14 @@ efx_ev_qpoll(
if (should_abort) {
/* Ignore subsequent events */
total = index + 1;
+
+   /*
+* Poison batch to ensure the outer
+* loop is broken out of.
+*/
+   EFSYS_ASSERT(batch <= EFX_EV_BATCH);
+   batch += (EFX_EV_BATCH << 1);
+   EFSYS_ASSERT(total != batch);
break;
}
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342522 - stable/10/sys/dev/sfxge

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

Log:
  MFC r341327
  
  sfxge(4): rollback last seen VLAN TCI if Tx packet is dropped
  
  Early processing of a packet on transmit may change last seen
  VLAN TCI in the queue context. If such a packet is eventually
  dropped, last seen VLAN TCI must be set to its previous value.
  
  Submitted by:   Ivan Malov 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18288

Modified:
  stable/10/sys/dev/sfxge/sfxge_tx.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/sfxge_tx.c
==
--- stable/10/sys/dev/sfxge/sfxge_tx.c  Wed Dec 26 10:28:03 2018
(r342521)
+++ stable/10/sys/dev/sfxge/sfxge_tx.c  Wed Dec 26 10:28:43 2018
(r342522)
@@ -352,6 +352,7 @@ static int sfxge_tx_queue_mbuf(struct sfxge_txq *txq, 
int rc;
int i;
int eop;
+   uint16_t hw_vlan_tci_prev;
int vlan_tagged;
 
KASSERT(!txq->blocked, ("txq->blocked"));
@@ -403,6 +404,8 @@ static int sfxge_tx_queue_mbuf(struct sfxge_txq *txq, 
 
used_map = &stmp->map;
 
+   hw_vlan_tci_prev = txq->hw_vlan_tci;
+
vlan_tagged = sfxge_tx_maybe_insert_tag(txq, mbuf);
if (vlan_tagged) {
sfxge_next_stmp(txq, &stmp);
@@ -454,6 +457,7 @@ static int sfxge_tx_queue_mbuf(struct sfxge_txq *txq, 
return (0);
 
 reject_mapped:
+   txq->hw_vlan_tci = hw_vlan_tci_prev;
bus_dmamap_unload(txq->packet_dma_tag, *used_map);
 reject:
/* Drop the packet on the floor. */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342519 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:26:58 2018
New Revision: 342519
URL: https://svnweb.freebsd.org/changeset/base/342519

Log:
  MFC r341309
  
  sfxge(4): fix MAC Tx stats for less or equal to 64 bytes
  
  This statistic should include 64byte and smaller frames.
  Fix EF10 calculation to match Siena code.
  
  Submitted by:   Andy Moreton 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18271

Modified:
  stable/10/sys/dev/sfxge/common/ef10_mac.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_mac.c
==
--- stable/10/sys/dev/sfxge/common/ef10_mac.c   Wed Dec 26 10:26:24 2018
(r342518)
+++ stable/10/sys/dev/sfxge/common/ef10_mac.c   Wed Dec 26 10:26:58 2018
(r342519)
@@ -611,7 +611,7 @@ ef10_mac_stats_update(
EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_LT64_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_LE_64_PKTS]), &value);
EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_64_PKTS, &value);
-   EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_LE_64_PKTS]), &value);
+   EFSYS_STAT_INCR_QWORD(&(stat[EFX_MAC_TX_LE_64_PKTS]), &value);
 
EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_65_TO_127_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_65_TO_127_PKTS]), &value);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342520 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:27:24 2018
New Revision: 342520
URL: https://svnweb.freebsd.org/changeset/base/342520

Log:
  MFC r341311
  
  sfxge(4): make last byte of module information available
  
  Adjust bounds so the interface supports reading
  the last available byte of data.
  
  Submitted by:   Richard Houldsworth 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18273

Modified:
  stable/10/sys/dev/sfxge/common/efx_phy.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_phy.c
==
--- stable/10/sys/dev/sfxge/common/efx_phy.cWed Dec 26 10:26:58 2018
(r342519)
+++ stable/10/sys/dev/sfxge/common/efx_phy.cWed Dec 26 10:27:24 2018
(r342520)
@@ -312,7 +312,7 @@ efx_phy_module_get_info(
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT(data != NULL);
 
-   if ((uint32_t)offset + len > 0xff) {
+   if ((uint32_t)offset + len > 0x100) {
rc = EINVAL;
goto fail1;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342518 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:26:24 2018
New Revision: 342518
URL: https://svnweb.freebsd.org/changeset/base/342518

Log:
  MFC r341302
  
  sfxge(4): fix a typo in unicast filter insertion comment
  
  Submitted by:   Ivan Malov 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18264

Modified:
  stable/10/sys/dev/sfxge/common/ef10_filter.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_filter.c
==
--- stable/10/sys/dev/sfxge/common/ef10_filter.cWed Dec 26 10:25:55 
2018(r342517)
+++ stable/10/sys/dev/sfxge/common/ef10_filter.cWed Dec 26 10:26:24 
2018(r342518)
@@ -1488,7 +1488,7 @@ ef10_filter_reconfigure(
/*
 * Insert or renew unicast filters.
 *
-* Frimware does not perform chaining on unicast filters. As traffic is
+* Firmware does not perform chaining on unicast filters. As traffic is
 * therefore only delivered to the first matching filter, we should
 * always insert the specific filter for our MAC address, to try and
 * ensure we get that traffic.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342517 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:25:55 2018
New Revision: 342517
URL: https://svnweb.freebsd.org/changeset/base/342517

Log:
  MFC r341301
  
  sfxge(4): prevent access to the NIC config before probe
  
  NIC config is initialized during NIC probe.
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18263

Modified:
  stable/10/sys/dev/sfxge/common/efx_nic.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_nic.c
==
--- stable/10/sys/dev/sfxge/common/efx_nic.cWed Dec 26 10:25:01 2018
(r342516)
+++ stable/10/sys/dev/sfxge/common/efx_nic.cWed Dec 26 10:25:55 2018
(r342517)
@@ -541,6 +541,7 @@ efx_nic_cfg_get(
__inefx_nic_t *enp)
 {
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+   EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
 
return (&(enp->en_nic_cfg));
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342515 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:23:16 2018
New Revision: 342515
URL: https://svnweb.freebsd.org/changeset/base/342515

Log:
  MFC r341295
  
  sfxge(4): avoid usage of too big arrays on stack
  
  Found by PreFAST static analysis.
  
  Submitted by:   Martin Harvey 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18257

Modified:
  stable/10/sys/dev/sfxge/common/ef10_phy.c
  stable/10/sys/dev/sfxge/common/efx_nvram.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_phy.c
==
--- stable/10/sys/dev/sfxge/common/ef10_phy.c   Wed Dec 26 10:22:49 2018
(r342514)
+++ stable/10/sys/dev/sfxge/common/ef10_phy.c   Wed Dec 26 10:23:16 2018
(r342515)
@@ -528,14 +528,26 @@ ef10_bist_poll(
unsigned long *valuesp,
__insize_t count)
 {
+   /*
+* MCDI_CTL_SDU_LEN_MAX_V1 is large enough cover all BIST results,
+* whilst not wasting stack.
+*/
+   uint8_t payload[MAX(MC_CMD_POLL_BIST_IN_LEN, MCDI_CTL_SDU_LEN_MAX_V1)];
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;
 
+   EFX_STATIC_ASSERT(MC_CMD_POLL_BIST_OUT_LEN <=
+   MCDI_CTL_SDU_LEN_MAX_V1);
+   EFX_STATIC_ASSERT(MC_CMD_POLL_BIST_OUT_SFT9001_LEN <=
+   MCDI_CTL_SDU_LEN_MAX_V1);
+   EFX_STATIC_ASSERT(MC_CMD_POLL_BIST_OUT_MRSFP_LEN <=
+   MCDI_CTL_SDU_LEN_MAX_V1);
+   EFX_STATIC_ASSERT(MC_CMD_POLL_BIST_OUT_MEM_LEN <=
+   MCDI_CTL_SDU_LEN_MAX_V1);
+
_NOTE(ARGUNUSED(type))
 
(void) memset(payload, 0, sizeof (payload));
@@ -543,7 +555,7 @@ ef10_bist_poll(
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;
+   req.emr_out_length = MCDI_CTL_SDU_LEN_MAX_V1;
 
efx_mcdi_execute(enp, &req);
 

Modified: stable/10/sys/dev/sfxge/common/efx_nvram.c
==
--- stable/10/sys/dev/sfxge/common/efx_nvram.c  Wed Dec 26 10:22:49 2018
(r342514)
+++ stable/10/sys/dev/sfxge/common/efx_nvram.c  Wed Dec 26 10:23:16 2018
(r342515)
@@ -862,23 +862,27 @@ efx_mcdi_nvram_write(
__insize_t size)
 {
efx_mcdi_req_t req;
-   uint8_t payload[MAX(MCDI_CTL_SDU_LEN_MAX_V1,
-   MCDI_CTL_SDU_LEN_MAX_V2)];
+   uint8_t *payload;
efx_rc_t rc;
size_t max_data_size;
+   size_t payload_len = enp->en_nic_cfg.enc_mcdi_max_payload_length;
 
-   max_data_size = enp->en_nic_cfg.enc_mcdi_max_payload_length
-   - MC_CMD_NVRAM_WRITE_IN_LEN(0);
-   EFSYS_ASSERT3U(enp->en_nic_cfg.enc_mcdi_max_payload_length, >, 0);
-   EFSYS_ASSERT3U(max_data_size, <,
-   enp->en_nic_cfg.enc_mcdi_max_payload_length);
+   max_data_size = payload_len - MC_CMD_NVRAM_WRITE_IN_LEN(0);
+   EFSYS_ASSERT3U(payload_len, >, 0);
+   EFSYS_ASSERT3U(max_data_size, <, payload_len);
 
if (size > max_data_size) {
rc = EINVAL;
goto fail1;
}
 
-   (void) memset(payload, 0, sizeof (payload));
+   EFSYS_KMEM_ALLOC(enp->en_esip, payload_len, payload);
+   if (payload == NULL) {
+   rc = ENOMEM;
+   goto fail2;
+   }
+
+   (void) memset(payload, 0, payload_len);
req.emr_cmd = MC_CMD_NVRAM_WRITE;
req.emr_in_buf = payload;
req.emr_in_length = MC_CMD_NVRAM_WRITE_IN_LEN(size);
@@ -896,11 +900,16 @@ efx_mcdi_nvram_write(
 
if (req.emr_rc != 0) {
rc = req.emr_rc;
-   goto fail2;
+   goto fail3;
}
 
+   EFSYS_KMEM_FREE(enp->en_esip, payload_len, payload);
+
return (0);
 
+fail3:
+   EFSYS_PROBE(fail3);
+   EFSYS_KMEM_FREE(enp->en_esip, payload_len, payload);
 fail2:
EFSYS_PROBE(fail2);
 fail1:
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342513 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:22:18 2018
New Revision: 342513
URL: https://svnweb.freebsd.org/changeset/base/342513

Log:
  MFC r341215
  
  sfxge(4): fix build because of no declaration
  
  Functions declared in mcdi_mon.h are implemented in mcdi_mon.c.
  The build fails if compiler options require declaration before
  definition.
  
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18246

Modified:
  stable/10/sys/dev/sfxge/common/mcdi_mon.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/mcdi_mon.c
==
--- stable/10/sys/dev/sfxge/common/mcdi_mon.c   Wed Dec 26 10:21:40 2018
(r342512)
+++ stable/10/sys/dev/sfxge/common/mcdi_mon.c   Wed Dec 26 10:22:18 2018
(r342513)
@@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$");
 
 #include "efx.h"
 #include "efx_impl.h"
+#include "mcdi_mon.h"
 
 #if EFSYS_OPT_MON_MCDI
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342516 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:25:01 2018
New Revision: 342516
URL: https://svnweb.freebsd.org/changeset/base/342516

Log:
  MFC r341297
  
  sfxge(4): fix out of bounds read when dereferencing sdup
  
  Introduce and use macro to make sure that MCDI buffers allocated
  on stack are rounded up properly.
  
  Submitted by:   Gautam Dawar 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18259

Modified:
  stable/10/sys/dev/sfxge/common/ef10_ev.c
  stable/10/sys/dev/sfxge/common/ef10_filter.c
  stable/10/sys/dev/sfxge/common/ef10_intr.c
  stable/10/sys/dev/sfxge/common/ef10_mac.c
  stable/10/sys/dev/sfxge/common/ef10_nic.c
  stable/10/sys/dev/sfxge/common/ef10_phy.c
  stable/10/sys/dev/sfxge/common/ef10_rx.c
  stable/10/sys/dev/sfxge/common/ef10_tx.c
  stable/10/sys/dev/sfxge/common/efx_lic.c
  stable/10/sys/dev/sfxge/common/efx_mcdi.c
  stable/10/sys/dev/sfxge/common/efx_mcdi.h
  stable/10/sys/dev/sfxge/common/efx_nic.c
  stable/10/sys/dev/sfxge/common/efx_nvram.c
  stable/10/sys/dev/sfxge/common/mcdi_mon.c
  stable/10/sys/dev/sfxge/common/medford_nic.c
  stable/10/sys/dev/sfxge/common/siena_mac.c
  stable/10/sys/dev/sfxge/common/siena_nic.c
  stable/10/sys/dev/sfxge/common/siena_nvram.c
  stable/10/sys/dev/sfxge/common/siena_phy.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_ev.c
==
--- stable/10/sys/dev/sfxge/common/ef10_ev.cWed Dec 26 10:23:16 2018
(r342515)
+++ stable/10/sys/dev/sfxge/common/ef10_ev.cWed Dec 26 10:25:01 2018
(r342516)
@@ -100,11 +100,10 @@ efx_mcdi_set_evq_tmr(
__inuint32_t timer_ns)
 {
efx_mcdi_req_t req;
-   uint8_t payload[MAX(MC_CMD_SET_EVQ_TMR_IN_LEN,
-   MC_CMD_SET_EVQ_TMR_OUT_LEN)];
+   EFX_MCDI_DECLARE_BUF(payload, MC_CMD_SET_EVQ_TMR_IN_LEN,
+   MC_CMD_SET_EVQ_TMR_OUT_LEN);
efx_rc_t rc;
 
-   (void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_SET_EVQ_TMR;
req.emr_in_buf = payload;
req.emr_in_length = MC_CMD_SET_EVQ_TMR_IN_LEN;
@@ -150,9 +149,9 @@ efx_mcdi_init_evq(
__inboolean_t low_latency)
 {
efx_mcdi_req_t req;
-   uint8_t payload[
-   MAX(MC_CMD_INIT_EVQ_IN_LEN(EFX_EVQ_NBUFS(EFX_EVQ_MAXNEVS)),
-   MC_CMD_INIT_EVQ_OUT_LEN)];
+   EFX_MCDI_DECLARE_BUF(payload,
+   MC_CMD_INIT_EVQ_IN_LEN(EFX_EVQ_NBUFS(EFX_EVQ_MAXNEVS)),
+   MC_CMD_INIT_EVQ_OUT_LEN);
efx_qword_t *dma_addr;
uint64_t addr;
int npages;
@@ -167,7 +166,6 @@ efx_mcdi_init_evq(
goto fail1;
}
 
-   (void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_INIT_EVQ;
req.emr_in_buf = payload;
req.emr_in_length = MC_CMD_INIT_EVQ_IN_LEN(npages);
@@ -287,9 +285,9 @@ efx_mcdi_init_evq_v2(
__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)];
+   EFX_MCDI_DECLARE_BUF(payload,
+   MC_CMD_INIT_EVQ_V2_IN_LEN(EFX_EVQ_NBUFS(EFX_EVQ_MAXNEVS)),
+   MC_CMD_INIT_EVQ_V2_OUT_LEN);
boolean_t interrupting;
unsigned int evq_type;
efx_qword_t *dma_addr;
@@ -304,7 +302,6 @@ efx_mcdi_init_evq_v2(
goto fail1;
}
 
-   (void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_INIT_EVQ;
req.emr_in_buf = payload;
req.emr_in_length = MC_CMD_INIT_EVQ_V2_IN_LEN(npages);
@@ -411,11 +408,10 @@ efx_mcdi_fini_evq(
__inuint32_t instance)
 {
efx_mcdi_req_t req;
-   uint8_t payload[MAX(MC_CMD_FINI_EVQ_IN_LEN,
-   MC_CMD_FINI_EVQ_OUT_LEN)];
+   EFX_MCDI_DECLARE_BUF(payload, MC_CMD_FINI_EVQ_IN_LEN,
+   MC_CMD_FINI_EVQ_OUT_LEN);
efx_rc_t rc;
 
-   (void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_FINI_EVQ;
req.emr_in_buf = payload;
req.emr_in_length = MC_CMD_FINI_EVQ_IN_LEN;
@@ -627,8 +623,8 @@ efx_mcdi_driver_event(
__inefx_qword_t data)
 {
efx_mcdi_req_t req;
-   uint8_t payload[MAX(MC_CMD_DRIVER_EVENT_IN_LEN,
-   MC_CMD_DRIVER_EVENT_OUT_LEN)];
+   EFX_MCDI_DECLARE_BUF(payload, MC_CMD_DRIVER_EVENT_IN_LEN,
+   MC_CMD_DRIVER_EVENT_OUT_LEN);
efx_rc_t rc;
 
req.emr_cmd = MC_CMD_DRIVER_EVENT;

Modified: stable/10/sys/dev/sfxge/common/ef10_filter.c
==
--- stable/10/sys/dev/sfxge/common/ef10_filter.cWed Dec 26 10:23:16 
2018(r342515)
+++ stable/10/sys/dev/sfxge/common/ef10_filter.cWed Dec 

svn commit: r342514 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:22:49 2018
New Revision: 342514
URL: https://svnweb.freebsd.org/changeset/base/342514

Log:
  MFC r341290
  
  sfxge(4): check size of memory to read sensors data to
  
  Size of provided memory should be consistent with specified size.
  
  Submitted by:   Martin Harvey 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18252

Modified:
  stable/10/sys/dev/sfxge/common/mcdi_mon.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/mcdi_mon.c
==
--- stable/10/sys/dev/sfxge/common/mcdi_mon.c   Wed Dec 26 10:22:18 2018
(r342513)
+++ stable/10/sys/dev/sfxge/common/mcdi_mon.c   Wed Dec 26 10:22:49 2018
(r342514)
@@ -322,7 +322,13 @@ efx_mcdi_read_sensors(
uint8_t payload[MAX(MC_CMD_READ_SENSORS_EXT_IN_LEN,
MC_CMD_READ_SENSORS_EXT_OUT_LEN)];
uint32_t addr_lo, addr_hi;
+   efx_rc_t rc;
 
+   if (EFSYS_MEM_SIZE(esmp) < size) {
+   rc = EINVAL;
+   goto fail1;
+   }
+
req.emr_cmd = MC_CMD_READ_SENSORS;
req.emr_in_buf = payload;
req.emr_in_length = MC_CMD_READ_SENSORS_EXT_IN_LEN;
@@ -339,6 +345,11 @@ efx_mcdi_read_sensors(
efx_mcdi_execute(enp, &req);
 
return (req.emr_rc);
+
+fail1:
+   EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+   return (rc);
 }
 
 static __checkReturn   efx_rc_t
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342511 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:20:54 2018
New Revision: 342511
URL: https://svnweb.freebsd.org/changeset/base/342511

Log:
  MFC r341213
  
  sfxge(4): fix PreFAST warnings because of unused return
  
  Submitted by:   Martin Harvey 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18244

Modified:
  stable/10/sys/dev/sfxge/common/ef10_filter.c
  stable/10/sys/dev/sfxge/common/ef10_mac.c
  stable/10/sys/dev/sfxge/common/ef10_nic.c
  stable/10/sys/dev/sfxge/common/ef10_nvram.c
  stable/10/sys/dev/sfxge/common/ef10_tx.c
  stable/10/sys/dev/sfxge/common/efx_port.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_filter.c
==
--- stable/10/sys/dev/sfxge/common/ef10_filter.cWed Dec 26 10:20:02 
2018(r342510)
+++ stable/10/sys/dev/sfxge/common/ef10_filter.cWed Dec 26 10:20:54 
2018(r342511)
@@ -1054,12 +1054,15 @@ ef10_filter_insert_unicast(
efx_filter_spec_init_rx(&spec, EFX_FILTER_PRI_AUTO,
filter_flags,
eftp->eft_default_rxq);
-   efx_filter_spec_set_eth_local(&spec, EFX_FILTER_SPEC_VID_UNSPEC, addr);
+   rc = efx_filter_spec_set_eth_local(&spec, EFX_FILTER_SPEC_VID_UNSPEC,
+   addr);
+   if (rc != 0)
+   goto fail1;
 
rc = ef10_filter_add_internal(enp, &spec, B_TRUE,
&eftp->eft_unicst_filter_indexes[eftp->eft_unicst_filter_count]);
if (rc != 0)
-   goto fail1;
+   goto fail2;
 
eftp->eft_unicst_filter_count++;
EFSYS_ASSERT(eftp->eft_unicst_filter_count <=
@@ -1067,6 +1070,8 @@ ef10_filter_insert_unicast(
 
return (0);
 
+fail2:
+   EFSYS_PROBE(fail2);
 fail1:
EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
@@ -1085,11 +1090,13 @@ ef10_filter_insert_all_unicast(
efx_filter_spec_init_rx(&spec, EFX_FILTER_PRI_AUTO,
filter_flags,
eftp->eft_default_rxq);
-   efx_filter_spec_set_uc_def(&spec);
+   rc = efx_filter_spec_set_uc_def(&spec);
+   if (rc != 0)
+   goto fail1;
rc = ef10_filter_add_internal(enp, &spec, B_TRUE,
&eftp->eft_unicst_filter_indexes[eftp->eft_unicst_filter_count]);
if (rc != 0)
-   goto fail1;
+   goto fail2;
 
eftp->eft_unicst_filter_count++;
EFSYS_ASSERT(eftp->eft_unicst_filter_count <=
@@ -1097,6 +1104,8 @@ ef10_filter_insert_all_unicast(
 
return (0);
 
+fail2:
+   EFSYS_PROBE(fail2);
 fail1:
EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
@@ -1138,9 +1147,21 @@ ef10_filter_insert_multicast_list(
filter_flags,
eftp->eft_default_rxq);
 
-   efx_filter_spec_set_eth_local(&spec,
+   rc = efx_filter_spec_set_eth_local(&spec,
EFX_FILTER_SPEC_VID_UNSPEC,
&addrs[i * EFX_MAC_ADDR_LEN]);
+   if (rc != 0) {
+   if (rollback == B_TRUE) {
+   /* Only stop upon failure if told to rollback */
+   goto rollback;
+   } else {
+   /*
+* Don't try to add a filter with a corrupt
+* specification.
+*/
+   continue;
+   }
+   }
 
rc = ef10_filter_add_internal(enp, &spec, B_TRUE,
&filter_index);
@@ -1163,8 +1184,12 @@ ef10_filter_insert_multicast_list(
eftp->eft_default_rxq);
 
EFX_MAC_BROADCAST_ADDR_SET(addr);
-   efx_filter_spec_set_eth_local(&spec, EFX_FILTER_SPEC_VID_UNSPEC,
-   addr);
+   rc = efx_filter_spec_set_eth_local(&spec,
+   EFX_FILTER_SPEC_VID_UNSPEC, addr);
+   if ((rc != 0) && (rollback == B_TRUE)) {
+   /* Only stop upon failure if told to rollback */
+   goto rollback;
+   }
 
rc = ef10_filter_add_internal(enp, &spec, B_TRUE,
&filter_index);
@@ -1212,12 +1237,14 @@ ef10_filter_insert_all_multicast(
efx_filter_spec_init_rx(&spec, EFX_FILTER_PRI_AUTO,
filter_flags,
eftp->eft_default_rxq);
-   efx_filter_spec_set_mc_def(&spec);
+   rc = efx_filter_spec_set_mc_def(&spec);
+   if (rc != 0)
+   goto fail1;
 
rc = ef10_filter_add_internal(enp, &spec, B_TRUE,
&eftp->eft_mulcst_filter_indexes[0]);
if (rc != 0)
-   goto fail1;
+   goto fail2;
 
eftp->eft_mulcst_filter_count = 1;
eftp->eft_using_all_mulc

svn commit: r342512 - stable/10/sys/dev/sfxge/common

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

Log:
  MFC r341214
  
  sfxge(4): fix SAL annotation for input buffers
  
  Submitted by:   Martin Harvey 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18245

Modified:
  stable/10/sys/dev/sfxge/common/ef10_impl.h
  stable/10/sys/dev/sfxge/common/ef10_nvram.c
  stable/10/sys/dev/sfxge/common/efx_impl.h
  stable/10/sys/dev/sfxge/common/efx_nvram.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_impl.h
==
--- stable/10/sys/dev/sfxge/common/ef10_impl.h  Wed Dec 26 10:20:54 2018
(r342511)
+++ stable/10/sys/dev/sfxge/common/ef10_impl.h  Wed Dec 26 10:21:40 2018
(r342512)
@@ -440,7 +440,7 @@ ef10_nvram_partn_read(
__inefx_nic_t *enp,
__inuint32_t partn,
__inunsigned int offset,
-   __out_bcount(size)  caddr_t data,
+   __in_bcount(size)   caddr_t data,
__insize_t size);
 
 extern __checkReturn   efx_rc_t

Modified: stable/10/sys/dev/sfxge/common/ef10_nvram.c
==
--- stable/10/sys/dev/sfxge/common/ef10_nvram.c Wed Dec 26 10:20:54 2018
(r342511)
+++ stable/10/sys/dev/sfxge/common/ef10_nvram.c Wed Dec 26 10:21:40 2018
(r342512)
@@ -2000,7 +2000,7 @@ ef10_nvram_partn_write(
__inefx_nic_t *enp,
__inuint32_t partn,
__inunsigned int offset,
-   __out_bcount(size)  caddr_t data,
+   __in_bcount(size)   caddr_t data,
__insize_t size)
 {
size_t chunk;

Modified: stable/10/sys/dev/sfxge/common/efx_impl.h
==
--- stable/10/sys/dev/sfxge/common/efx_impl.h   Wed Dec 26 10:20:54 2018
(r342511)
+++ stable/10/sys/dev/sfxge/common/efx_impl.h   Wed Dec 26 10:21:40 2018
(r342512)
@@ -538,7 +538,7 @@ efx_mcdi_nvram_write(
__inefx_nic_t *enp,
__inuint32_t partn,
__inuint32_t offset,
-   __out_bcount(size)  caddr_t data,
+   __in_bcount(size)   caddr_t data,
__insize_t size);
 
__checkReturn   efx_rc_t

Modified: stable/10/sys/dev/sfxge/common/efx_nvram.c
==
--- stable/10/sys/dev/sfxge/common/efx_nvram.c  Wed Dec 26 10:20:54 2018
(r342511)
+++ stable/10/sys/dev/sfxge/common/efx_nvram.c  Wed Dec 26 10:21:40 2018
(r342512)
@@ -858,7 +858,7 @@ efx_mcdi_nvram_write(
__inefx_nic_t *enp,
__inuint32_t partn,
__inuint32_t offset,
-   __out_bcount(size)  caddr_t data,
+   __in_bcount(size)   caddr_t data,
__insize_t size)
 {
efx_mcdi_req_t req;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342510 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:20:02 2018
New Revision: 342510
URL: https://svnweb.freebsd.org/changeset/base/342510

Log:
  MFC r341197
  
  sfxge(4): fix comparison always true warning
  
  Loopback type used as bit index has efx_loopback_type_t type
  which is enum. clang complains that it is always true when it
  is compared with qword (64 bit) bits number boundary.
  
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18228

Modified:
  stable/10/sys/dev/sfxge/common/efx_port.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_port.c
==
--- stable/10/sys/dev/sfxge/common/efx_port.c   Wed Dec 26 10:19:12 2018
(r342509)
+++ stable/10/sys/dev/sfxge/common/efx_port.c   Wed Dec 26 10:20:02 2018
(r342510)
@@ -147,7 +147,7 @@ efx_port_loopback_set(
EFSYS_ASSERT(link_mode < EFX_LINK_NMODES);
 
if (EFX_TEST_QWORD_BIT(encp->enc_loopback_types[link_mode],
-   loopback_type) == 0) {
+   (int)loopback_type) == 0) {
rc = ENOTSUP;
goto fail1;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342509 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:19:12 2018
New Revision: 342509
URL: https://svnweb.freebsd.org/changeset/base/342509

Log:
  MFC r341038
  
  sfxge(4): add method to make checksum option descriptors
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18160

Modified:
  stable/10/sys/dev/sfxge/common/ef10_impl.h
  stable/10/sys/dev/sfxge/common/ef10_tx.c
  stable/10/sys/dev/sfxge/common/efx.h
  stable/10/sys/dev/sfxge/common/efx_impl.h
  stable/10/sys/dev/sfxge/common/efx_tx.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_impl.h
==
--- stable/10/sys/dev/sfxge/common/ef10_impl.h  Wed Dec 26 10:17:44 2018
(r342508)
+++ stable/10/sys/dev/sfxge/common/ef10_impl.h  Wed Dec 26 10:19:12 2018
(r342509)
@@ -759,6 +759,11 @@ ef10_tx_qdesc_vlantci_create(
__inuint16_t vlan_tci,
__out   efx_desc_t *edp);
 
+extern void
+ef10_tx_qdesc_checksum_create(
+   __inefx_txq_t *etp,
+   __inuint16_t flags,
+   __out   efx_desc_t *edp);
 
 #if EFSYS_OPT_QSTATS
 

Modified: stable/10/sys/dev/sfxge/common/ef10_tx.c
==
--- stable/10/sys/dev/sfxge/common/ef10_tx.cWed Dec 26 10:17:44 2018
(r342508)
+++ stable/10/sys/dev/sfxge/common/ef10_tx.cWed Dec 26 10:19:12 2018
(r342509)
@@ -203,7 +203,7 @@ ef10_tx_qcreate(
 {
efx_nic_cfg_t *encp = &enp->en_nic_cfg;
uint16_t inner_csum;
-   efx_qword_t desc;
+   efx_desc_t desc;
efx_rc_t rc;
 
_NOTE(ARGUNUSED(id))
@@ -228,19 +228,9 @@ ef10_tx_qcreate(
 * a no-op TX option descriptor. See bug29981 for details.
 */
*addedp = 1;
-   EFX_POPULATE_QWORD_6(desc,
-   ESF_DZ_TX_DESC_IS_OPT, 1,
-   ESF_DZ_TX_OPTION_TYPE, ESE_DZ_TX_OPTION_DESC_CRC_CSUM,
-   ESF_DZ_TX_OPTION_UDP_TCP_CSUM,
-   (flags & EFX_TXQ_CKSUM_TCPUDP) ? 1 : 0,
-   ESF_DZ_TX_OPTION_IP_CSUM,
-   (flags & EFX_TXQ_CKSUM_IPV4) ? 1 : 0,
-   ESF_DZ_TX_OPTION_INNER_UDP_TCP_CSUM,
-   (flags & EFX_TXQ_CKSUM_INNER_TCPUDP) ? 1 : 0,
-   ESF_DZ_TX_OPTION_INNER_IP_CSUM,
-   (flags & EFX_TXQ_CKSUM_INNER_IPV4) ? 1 : 0);
+   ef10_tx_qdesc_checksum_create(etp, flags, &desc);
 
-   EFSYS_MEM_WRITEQ(etp->et_esmp, 0, &desc);
+   EFSYS_MEM_WRITEQ(etp->et_esmp, 0, &desc.ed_eq);
ef10_tx_qpush(etp, *addedp, 0);
 
return (0);
@@ -700,6 +690,30 @@ ef10_tx_qdesc_vlantci_create(
ESE_DZ_TX_OPTION_DESC_VLAN,
ESF_DZ_TX_VLAN_OP, tci ? 1 : 0,
ESF_DZ_TX_VLAN_TAG1, tci);
+}
+
+   void
+ef10_tx_qdesc_checksum_create(
+   __inefx_txq_t *etp,
+   __inuint16_t flags,
+   __out   efx_desc_t *edp)
+{
+   _NOTE(ARGUNUSED(etp));
+
+   EFSYS_PROBE2(tx_desc_checksum_create, unsigned int, etp->et_index,
+   uint32_t, flags);
+
+   EFX_POPULATE_QWORD_6(edp->ed_eq,
+   ESF_DZ_TX_DESC_IS_OPT, 1,
+   ESF_DZ_TX_OPTION_TYPE, ESE_DZ_TX_OPTION_DESC_CRC_CSUM,
+   ESF_DZ_TX_OPTION_UDP_TCP_CSUM,
+   (flags & EFX_TXQ_CKSUM_TCPUDP) ? 1 : 0,
+   ESF_DZ_TX_OPTION_IP_CSUM,
+   (flags & EFX_TXQ_CKSUM_IPV4) ? 1 : 0,
+   ESF_DZ_TX_OPTION_INNER_UDP_TCP_CSUM,
+   (flags & EFX_TXQ_CKSUM_INNER_TCPUDP) ? 1 : 0,
+   ESF_DZ_TX_OPTION_INNER_IP_CSUM,
+   (flags & EFX_TXQ_CKSUM_INNER_IPV4) ? 1 : 0);
 }
 
 

Modified: stable/10/sys/dev/sfxge/common/efx.h
==
--- stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 10:17:44 2018
(r342508)
+++ stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 10:19:12 2018
(r342509)
@@ -2110,6 +2110,12 @@ efx_tx_qdesc_vlantci_create(
__inuint16_t tci,
__out   efx_desc_t *edp);
 
+extern void
+efx_tx_qdesc_checksum_create(
+   __inefx_txq_t *etp,
+   __inuint16_t flags,
+   __out   efx_desc_t *edp);
+
 #if EFSYS_OPT_QSTATS
 
 #if EFSYS_OPT_NAMES

Modified: stable/10/sys/dev/sfxge/common/efx_impl.h
==
--- stable/10/sys/dev/sfxge/common/efx_impl.h   Wed Dec 26 10:17:44 2018
(r342508)
+++ stable/10/sys/dev/sfxge/common/efx_impl.h   Wed Dec 26 10:19:12 2018
(r342509)
@@ -141,6 +141,8 @@ typedef struct efx_tx_ops_s {
efx_desc_t *, int);
void(*etxo_qdesc_vlantci_create)(efx_txq_t *, uint16_t,
efx_desc_t *);
+   void(*etxo_qdesc_checksum_create)(efx_txq_t *, uint16_t,
+  

svn commit: r342508 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:17:44 2018
New Revision: 342508
URL: https://svnweb.freebsd.org/changeset/base/342508

Log:
  MFC r340896
  
  sfxge(4): remove Falcon-specific concurrency check
  
  Falcon support has been withdrawn from libefx, however, there is still
  an obsolete Falcon-specific assertion that efx_mac_stats_upload()
  and efx_port_poll() aren't concurrent. To be consistent with an overall
  Falcon support revocation it's desirable to remove it.
  
  Fix debug build invalid assertion failure.
  
  Submitted by:   Ivan Malov 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D1813

Modified:
  stable/10/sys/dev/sfxge/common/efx_impl.h
  stable/10/sys/dev/sfxge/common/efx_mac.c
  stable/10/sys/dev/sfxge/common/efx_port.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_impl.h
==
--- stable/10/sys/dev/sfxge/common/efx_impl.h   Wed Dec 26 10:16:48 2018
(r342507)
+++ stable/10/sys/dev/sfxge/common/efx_impl.h   Wed Dec 26 10:17:44 2018
(r342508)
@@ -285,7 +285,6 @@ typedef struct efx_port_s {
uint32_tep_default_adv_cap_mask;
uint32_tep_phy_cap_mask;
boolean_t   ep_mac_drain;
-   boolean_t   ep_mac_stats_pending;
 #if EFSYS_OPT_BIST
efx_bist_type_t ep_current_bist;
 #endif

Modified: stable/10/sys/dev/sfxge/common/efx_mac.c
==
--- stable/10/sys/dev/sfxge/common/efx_mac.cWed Dec 26 10:16:48 2018
(r342507)
+++ stable/10/sys/dev/sfxge/common/efx_mac.cWed Dec 26 10:17:44 2018
(r342508)
@@ -729,16 +729,9 @@ efx_mac_stats_upload(
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);
EFSYS_ASSERT(emop != NULL);
 
-   /*
-* Don't assert !ep_mac_stats_pending, because the client might
-* have failed to finalise statistics when previously stopping
-* the port.
-*/
if ((rc = emop->emo_stats_upload(enp, esmp)) != 0)
goto fail1;
 
-   epp->ep_mac_stats_pending = B_TRUE;
-
return (0);
 
 fail1:
@@ -798,8 +791,6 @@ efx_mac_stats_update(
EFSYS_ASSERT(emop != NULL);
 
rc = emop->emo_stats_update(enp, esmp, essp, generationp);
-   if (rc == 0)
-   epp->ep_mac_stats_pending = B_FALSE;
 
return (rc);
 }

Modified: stable/10/sys/dev/sfxge/common/efx_port.c
==
--- stable/10/sys/dev/sfxge/common/efx_port.c   Wed Dec 26 10:16:48 2018
(r342507)
+++ stable/10/sys/dev/sfxge/common/efx_port.c   Wed Dec 26 10:17:44 2018
(r342508)
@@ -112,7 +112,6 @@ efx_port_poll(
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);
 
EFSYS_ASSERT(emop != NULL);
-   EFSYS_ASSERT(!epp->ep_mac_stats_pending);
 
if (link_modep == NULL)
link_modep = &ignore_link_mode;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342507 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:16:48 2018
New Revision: 342507
URL: https://svnweb.freebsd.org/changeset/base/342507

Log:
  MFC r340895
  
  sfxge(4): move BIU test code into Siena-specific file
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18129

Modified:
  stable/10/sys/dev/sfxge/common/efx_impl.h
  stable/10/sys/dev/sfxge/common/efx_nic.c
  stable/10/sys/dev/sfxge/common/siena_nic.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_impl.h
==
--- stable/10/sys/dev/sfxge/common/efx_impl.h   Wed Dec 26 10:16:11 2018
(r342506)
+++ stable/10/sys/dev/sfxge/common/efx_impl.h   Wed Dec 26 10:16:48 2018
(r342507)
@@ -1048,10 +1048,6 @@ struct efx_txq_s {
} while (B_FALSE)
 
 extern __checkReturn   efx_rc_t
-efx_nic_biu_test(
-   __inefx_nic_t *enp);
-
-extern __checkReturn   efx_rc_t
 efx_mac_select(
__inefx_nic_t *enp);
 

Modified: stable/10/sys/dev/sfxge/common/efx_nic.c
==
--- stable/10/sys/dev/sfxge/common/efx_nic.cWed Dec 26 10:16:11 2018
(r342506)
+++ stable/10/sys/dev/sfxge/common/efx_nic.cWed Dec 26 10:16:48 2018
(r342507)
@@ -105,78 +105,6 @@ efx_family(
return (ENOTSUP);
 }
 
-
-#defineEFX_BIU_MAGIC0  0x01234567
-#defineEFX_BIU_MAGIC1  0xfedcba98
-
-   __checkReturn   efx_rc_t
-efx_nic_biu_test(
-   __inefx_nic_t *enp)
-{
-   efx_oword_t oword;
-   efx_rc_t rc;
-
-   /*
-* Write magic values to scratch registers 0 and 1, then
-* verify that the values were written correctly.  Interleave
-* the accesses to ensure that the BIU is not just reading
-* back the cached value that was last written.
-*/
-   EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, EFX_BIU_MAGIC0);
-   EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE);
-
-   EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, EFX_BIU_MAGIC1);
-   EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE);
-
-   EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE);
-   if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != EFX_BIU_MAGIC0) {
-   rc = EIO;
-   goto fail1;
-   }
-
-   EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE);
-   if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != EFX_BIU_MAGIC1) {
-   rc = EIO;
-   goto fail2;
-   }
-
-   /*
-* Perform the same test, with the values swapped.  This
-* ensures that subsequent tests don't start with the correct
-* values already written into the scratch registers.
-*/
-   EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, EFX_BIU_MAGIC1);
-   EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE);
-
-   EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, EFX_BIU_MAGIC0);
-   EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE);
-
-   EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE);
-   if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != EFX_BIU_MAGIC1) {
-   rc = EIO;
-   goto fail3;
-   }
-
-   EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE);
-   if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != EFX_BIU_MAGIC0) {
-   rc = EIO;
-   goto fail4;
-   }
-
-   return (0);
-
-fail4:
-   EFSYS_PROBE(fail4);
-fail3:
-   EFSYS_PROBE(fail3);
-fail2:
-   EFSYS_PROBE(fail2);
-fail1:
-   EFSYS_PROBE1(fail1, efx_rc_t, rc);
-
-   return (rc);
-}
-
 #if EFSYS_OPT_SIENA
 
 static const efx_nic_ops_t __efx_nic_siena_ops = {

Modified: stable/10/sys/dev/sfxge/common/siena_nic.c
==
--- stable/10/sys/dev/sfxge/common/siena_nic.c  Wed Dec 26 10:16:11 2018
(r342506)
+++ stable/10/sys/dev/sfxge/common/siena_nic.c  Wed Dec 26 10:16:48 2018
(r342507)
@@ -211,6 +211,77 @@ fail1:
return (rc);
 }
 
+#defineSIENA_BIU_MAGIC00x01234567
+#defineSIENA_BIU_MAGIC10xfedcba98
+
+static __checkReturn   efx_rc_t
+siena_nic_biu_test(
+   __inefx_nic_t *enp)
+{
+   efx_oword_t oword;
+   efx_rc_t rc;
+
+   /*
+* Write magic values to scratch registers 0 and 1, then
+* verify that the values were written correctly.  Interleave
+* the accesses to ensure that the BIU is not just reading
+* back the cached value that was last written.
+*/
+   EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, SIENA_BIU_MAGIC0);
+   EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE);
+
+   EFX_POPULAT

svn commit: r342506 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:16:11 2018
New Revision: 342506
URL: https://svnweb.freebsd.org/changeset/base/342506

Log:
  MFC r340894
  
  sfxge(4): fix PreFAST static analysis warning (C6001)
  
  Fix warning
  "C6001: Using uninitialized memory '*sensor_maskp'"
  which could occur when the npages argument to efx_mcdi_sensor_info()
  is less than or equal to zero.
  
  Submitted by:   Andrew Lee 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18128

Modified:
  stable/10/sys/dev/sfxge/common/mcdi_mon.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/mcdi_mon.c
==
--- stable/10/sys/dev/sfxge/common/mcdi_mon.c   Wed Dec 26 10:15:31 2018
(r342505)
+++ stable/10/sys/dev/sfxge/common/mcdi_mon.c   Wed Dec 26 10:16:11 2018
(r342506)
@@ -397,6 +397,11 @@ efx_mcdi_sensor_info(
 
EFSYS_ASSERT(sensor_maskp != NULL);
 
+   if (npages < 1) {
+   rc = EINVAL;
+   goto fail1;
+   }
+
for (page = 0; page < npages; page++) {
uint32_t mask;
 
@@ -413,7 +418,7 @@ efx_mcdi_sensor_info(
 
if (req.emr_rc != 0) {
rc = req.emr_rc;
-   goto fail1;
+   goto fail2;
}
 
mask = MCDI_OUT_DWORD(req, SENSOR_INFO_OUT_MASK);
@@ -421,18 +426,20 @@ efx_mcdi_sensor_info(
if ((page != (npages - 1)) &&
((mask & (1U << MC_CMD_SENSOR_PAGE0_NEXT)) == 0)) {
rc = EINVAL;
-   goto fail2;
+   goto fail3;
}
sensor_maskp[page] = mask;
}
 
if (sensor_maskp[npages - 1] & (1U << MC_CMD_SENSOR_PAGE0_NEXT)) {
rc = EINVAL;
-   goto fail3;
+   goto fail4;
}
 
return (0);
 
+fail4:
+   EFSYS_PROBE(fail4);
 fail3:
EFSYS_PROBE(fail3);
 fail2:
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342505 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:15:31 2018
New Revision: 342505
URL: https://svnweb.freebsd.org/changeset/base/342505

Log:
  MFC r340892
  
  sfxge(4): remove obsolete check for pre-Siena hardware
  
  The fail4 label was used twice, so it doesn't need removing.
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18126

Modified:
  stable/10/sys/dev/sfxge/common/efx_rx.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_rx.c
==
--- stable/10/sys/dev/sfxge/common/efx_rx.c Wed Dec 26 10:14:29 2018
(r342504)
+++ stable/10/sys/dev/sfxge/common/efx_rx.c Wed Dec 26 10:15:31 2018
(r342505)
@@ -1164,10 +1164,6 @@ siena_rx_qcreate(
 
 #if EFSYS_OPT_RX_SCATTER
case EFX_RXQ_TYPE_SCATTER:
-   if (enp->en_family < EFX_FAMILY_SIENA) {
-   rc = EINVAL;
-   goto fail4;
-   }
jumbo = B_TRUE;
break;
 #endif /* EFSYS_OPT_RX_SCATTER */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342504 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:14:29 2018
New Revision: 342504
URL: https://svnweb.freebsd.org/changeset/base/342504

Log:
  MFC r340891
  
  sfxge(4): fix warnings from VS2015 C compiler (C4214)
  
  Fix multiple level 4 warnings
  "C4214: nonstandard extension used: bit field types other than int";
  no functional changes.
  
  Submitted by:   Andrew Lee 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18125

Modified:
  stable/10/sys/dev/sfxge/common/efx.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx.h
==
--- stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 10:13:42 2018
(r342503)
+++ stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 10:14:29 2018
(r342504)
@@ -2159,7 +2159,7 @@ efx_tx_qdestroy(
 /* Filter is for TX */
 #defineEFX_FILTER_FLAG_TX  0x10
 
-typedef unsigned int efx_filter_flags_t;
+typedef uint8_t efx_filter_flags_t;
 
 /*
  * Flags which specify the fields to match on. The values are the same as in 
the
@@ -2216,22 +2216,22 @@ typedef enum efx_filter_priority_s {
  */
 
 typedef struct efx_filter_spec_s {
-   uint32_tefs_match_flags;
-   uint32_tefs_priority:2;
-   uint32_tefs_flags:6;
-   uint32_tefs_dmaq_id:12;
-   uint32_tefs_rss_context;
-   uint16_tefs_outer_vid;
-   uint16_tefs_inner_vid;
-   uint8_t efs_loc_mac[EFX_MAC_ADDR_LEN];
-   uint8_t efs_rem_mac[EFX_MAC_ADDR_LEN];
-   uint16_tefs_ether_type;
-   uint8_t efs_ip_proto;
-   efx_tunnel_protocol_t   efs_encap_type;
-   uint16_tefs_loc_port;
-   uint16_tefs_rem_port;
-   efx_oword_t efs_rem_host;
-   efx_oword_t efs_loc_host;
+   efx_filter_match_flags_tefs_match_flags;
+   uint8_t efs_priority;
+   efx_filter_flags_t  efs_flags;
+   uint16_tefs_dmaq_id;
+   uint32_tefs_rss_context;
+   uint16_tefs_outer_vid;
+   uint16_tefs_inner_vid;
+   uint8_t efs_loc_mac[EFX_MAC_ADDR_LEN];
+   uint8_t efs_rem_mac[EFX_MAC_ADDR_LEN];
+   uint16_tefs_ether_type;
+   uint8_t efs_ip_proto;
+   efx_tunnel_protocol_t   efs_encap_type;
+   uint16_tefs_loc_port;
+   uint16_tefs_rem_port;
+   efx_oword_t efs_rem_host;
+   efx_oword_t efs_loc_host;
 } efx_filter_spec_t;
 
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342503 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:13:42 2018
New Revision: 342503
URL: https://svnweb.freebsd.org/changeset/base/342503

Log:
  MFC r340890
  
  sfxge(4): fix warnings from VS2015 C compiler (C4057)
  
  Fix two level 4 warnings
  "C4057: 'function': 'const uint8_t *' differs in indirection to
  slightly different base types from 'caddr_t'"; no functional changes.
  
  Submitted by:   Andrew Lee 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18124

Modified:
  stable/10/sys/dev/sfxge/common/efx.h
  stable/10/sys/dev/sfxge/common/efx_bootcfg.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx.h
==
--- stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 10:12:15 2018
(r342502)
+++ stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 10:13:42 2018
(r342503)
@@ -1464,13 +1464,13 @@ efx_bootcfg_copy_sector(
 extern efx_rc_t
 efx_bootcfg_read(
__inefx_nic_t *enp,
-   __out_bcount(size)  caddr_t data,
+   __out_bcount(size)  uint8_t *data,
__insize_t size);
 
 extern efx_rc_t
 efx_bootcfg_write(
__inefx_nic_t *enp,
-   __in_bcount(size)   caddr_t data,
+   __in_bcount(size)   uint8_t *data,
__insize_t size);
 
 #endif /* EFSYS_OPT_BOOTCFG */

Modified: stable/10/sys/dev/sfxge/common/efx_bootcfg.c
==
--- stable/10/sys/dev/sfxge/common/efx_bootcfg.cWed Dec 26 10:12:15 
2018(r342502)
+++ stable/10/sys/dev/sfxge/common/efx_bootcfg.cWed Dec 26 10:13:42 
2018(r342503)
@@ -293,7 +293,7 @@ fail1:
efx_rc_t
 efx_bootcfg_read(
__inefx_nic_t *enp,
-   __out_bcount(size)  caddr_t data,
+   __out_bcount(size)  uint8_t *data,
__insize_t size)
 {
uint8_t *payload = NULL;
@@ -356,7 +356,7 @@ efx_bootcfg_read(
goto fail7;
 
/* Verify that the area is correctly formatted and checksummed */
-   rc = efx_bootcfg_verify(enp, (caddr_t)payload, sector_length,
+   rc = efx_bootcfg_verify(enp, payload, sector_length,
&used_bytes);
if (rc != 0 || used_bytes == 0) {
payload[0] = (uint8_t)(~DHCP_END & 0xff);
@@ -433,7 +433,7 @@ fail1:
efx_rc_t
 efx_bootcfg_write(
__inefx_nic_t *enp,
-   __in_bcount(size)   caddr_t data,
+   __in_bcount(size)   uint8_t *data,
__insize_t size)
 {
uint8_t *partn_data;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342502 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:12:15 2018
New Revision: 342502
URL: https://svnweb.freebsd.org/changeset/base/342502

Log:
  MFC r340889
  
  sfxge(4): fix warnings from VS2015 C compiler (C4189)
  
  Fix multiple level 4 warnings
  "C4189: 'xxx': local variable is initialized but not referenced";
  no functional changes.
  
  Submitted by:   Andrew Lee 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18123

Modified:
  stable/10/sys/dev/sfxge/common/ef10_ev.c
  stable/10/sys/dev/sfxge/common/efx_ev.c
  stable/10/sys/dev/sfxge/common/efx_tx.c
  stable/10/sys/dev/sfxge/common/mcdi_mon.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_ev.c
==
--- stable/10/sys/dev/sfxge/common/ef10_ev.cWed Dec 26 10:09:53 2018
(r342501)
+++ stable/10/sys/dev/sfxge/common/ef10_ev.cWed Dec 26 10:12:15 2018
(r342502)
@@ -576,7 +576,7 @@ ef10_ev_qdestroy(
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
enp->en_family == EFX_FAMILY_MEDFORD);
 
-   (void) efx_mcdi_fini_evq(eep->ee_enp, eep->ee_index);
+   (void) efx_mcdi_fini_evq(enp, eep->ee_index);
 }
 
__checkReturn   efx_rc_t

Modified: stable/10/sys/dev/sfxge/common/efx_ev.c
==
--- stable/10/sys/dev/sfxge/common/efx_ev.c Wed Dec 26 10:09:53 2018
(r342501)
+++ stable/10/sys/dev/sfxge/common/efx_ev.c Wed Dec 26 10:12:15 2018
(r342502)
@@ -226,14 +226,14 @@ efx_ev_qcreate(
__deref_out efx_evq_t **eepp)
 {
const efx_ev_ops_t *eevop = enp->en_eevop;
-   efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
efx_evq_t *eep;
efx_rc_t rc;
 
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_EV);
 
-   EFSYS_ASSERT3U(enp->en_ev_qcount + 1, <, encp->enc_evq_limit);
+   EFSYS_ASSERT3U(enp->en_ev_qcount + 1, <,
+   enp->en_nic_cfg.enc_evq_limit);
 
switch (flags & EFX_EVQ_FLAGS_NOTIFY_MASK) {
case EFX_EVQ_FLAGS_NOTIFY_INTERRUPT:

Modified: stable/10/sys/dev/sfxge/common/efx_tx.c
==
--- stable/10/sys/dev/sfxge/common/efx_tx.c Wed Dec 26 10:09:53 2018
(r342501)
+++ stable/10/sys/dev/sfxge/common/efx_tx.c Wed Dec 26 10:12:15 2018
(r342502)
@@ -301,14 +301,14 @@ efx_tx_qcreate(
__out   unsigned int *addedp)
 {
const efx_tx_ops_t *etxop = enp->en_etxop;
-   efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
efx_txq_t *etp;
efx_rc_t rc;
 
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_TX);
 
-   EFSYS_ASSERT3U(enp->en_tx_qcount + 1, <, encp->enc_txq_limit);
+   EFSYS_ASSERT3U(enp->en_tx_qcount + 1, <,
+   enp->en_nic_cfg.enc_txq_limit);
 
/* Allocate an TXQ object */
EFSYS_KMEM_ALLOC(enp->en_esip, sizeof (efx_txq_t), etp);

Modified: stable/10/sys/dev/sfxge/common/mcdi_mon.c
==
--- stable/10/sys/dev/sfxge/common/mcdi_mon.c   Wed Dec 26 10:09:53 2018
(r342501)
+++ stable/10/sys/dev/sfxge/common/mcdi_mon.c   Wed Dec 26 10:12:15 2018
(r342502)
@@ -265,7 +265,6 @@ mcdi_mon_ev(
__out   efx_mon_stat_value_t *valuep)
 {
efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
-   efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
uint16_t port_mask;
uint16_t sensor;
uint16_t state;
@@ -281,11 +280,13 @@ mcdi_mon_ev(
value = (uint16_t)MCDI_EV_FIELD(eqp, SENSOREVT_VALUE);
 
/* Hardware must support this MCDI sensor */
-   EFSYS_ASSERT3U(sensor, <, (8 * encp->enc_mcdi_sensor_mask_size));
+   EFSYS_ASSERT3U(sensor, <,
+   (8 * enp->en_nic_cfg.enc_mcdi_sensor_mask_size));
EFSYS_ASSERT((sensor % MCDI_MON_PAGE_SIZE) != MC_CMD_SENSOR_PAGE0_NEXT);
-   EFSYS_ASSERT(encp->enc_mcdi_sensor_maskp != NULL);
-   EFSYS_ASSERT((encp->enc_mcdi_sensor_maskp[sensor / MCDI_MON_PAGE_SIZE] &
-   (1U << (sensor % MCDI_MON_PAGE_SIZE))) != 0);
+   EFSYS_ASSERT(enp->en_nic_cfg.enc_mcdi_sensor_maskp != NULL);
+   EFSYS_ASSERT(
+   (enp->en_nic_cfg.enc_mcdi_sensor_maskp[sensor/MCDI_MON_PAGE_SIZE] &
+   (1U << (sensor % MCDI_MON_PAGE_SIZE))) != 0);
 
/* But we don't have to understand it */
if (sensor >= EFX_ARRAY_SIZE(mcdi_sensor_map)) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342501 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:09:53 2018
New Revision: 342501
URL: https://svnweb.freebsd.org/changeset/base/342501

Log:
  MFC r340888
  
  sfxge(4): fix warnings from VS2015 C compiler (C4100)
  
  Fix multiple level 4 warnings
  "C4100: 'xxx': unreferenced formal parameter"
  no functional changes.
  
  The _NOTE(ARGUNUSED(xxx)) annotations are being exposed to the Visual
  Studio 2015 C compiler with the following:
  
#define _NOTE_ARGUNUSED(...) UNREFERENCED_PARAMETER((__VA_ARGS__));
#define _NOTE(_annotation)   _NOTE_ ## _annotation
  
  Submitted by:   Andrew Lee 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18122

Modified:
  stable/10/sys/dev/sfxge/common/ef10_nvram.c
  stable/10/sys/dev/sfxge/common/ef10_rx.c
  stable/10/sys/dev/sfxge/common/ef10_tx.c
  stable/10/sys/dev/sfxge/common/efx_ev.c
  stable/10/sys/dev/sfxge/common/efx_lic.c
  stable/10/sys/dev/sfxge/common/efx_mcdi.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_nvram.c
==
--- stable/10/sys/dev/sfxge/common/ef10_nvram.c Wed Dec 26 10:08:28 2018
(r342500)
+++ stable/10/sys/dev/sfxge/common/ef10_nvram.c Wed Dec 26 10:09:53 2018
(r342501)
@@ -675,6 +675,7 @@ ef10_nvram_buffer_validate(
int pos;
efx_rc_t rc;
 
+   _NOTE(ARGUNUSED(enp, partn))
EFX_STATIC_ASSERT(sizeof (*header) <= EF10_NVRAM_CHUNK);
 
if ((partn_data == NULL) || (partn_size == 0)) {
@@ -1284,6 +1285,8 @@ ef10_nvram_buf_read_tlv(
size_t length;
caddr_t value;
efx_rc_t rc;
+
+   _NOTE(ARGUNUSED(enp))
 
if ((seg_data == NULL) || (max_seg_size == 0)) {
rc = EINVAL;

Modified: stable/10/sys/dev/sfxge/common/ef10_rx.c
==
--- stable/10/sys/dev/sfxge/common/ef10_rx.cWed Dec 26 10:08:28 2018
(r342500)
+++ stable/10/sys/dev/sfxge/common/ef10_rx.cWed Dec 26 10:09:53 2018
(r342501)
@@ -657,6 +657,8 @@ ef10_rx_qpost(
unsigned int offset;
unsigned int id;
 
+   _NOTE(ARGUNUSED(completed))
+
/* The client driver must not overfill the queue */
EFSYS_ASSERT3U(added - completed + n, <=,
EFX_RXQ_LIMIT(erp->er_mask + 1));

Modified: stable/10/sys/dev/sfxge/common/ef10_tx.c
==
--- stable/10/sys/dev/sfxge/common/ef10_tx.cWed Dec 26 10:08:28 2018
(r342500)
+++ stable/10/sys/dev/sfxge/common/ef10_tx.cWed Dec 26 10:09:53 2018
(r342501)
@@ -609,6 +609,8 @@ ef10_tx_qdesc_dma_create(
__inboolean_t eop,
__out   efx_desc_t *edp)
 {
+   _NOTE(ARGUNUSED(etp))
+
/* No limitations on boundary crossing */
EFSYS_ASSERT(size <= etp->et_enp->en_nic_cfg.enc_tx_dma_desc_size_max);
 
@@ -632,6 +634,8 @@ ef10_tx_qdesc_tso_create(
__inuint8_t  tcp_flags,
__out   efx_desc_t *edp)
 {
+   _NOTE(ARGUNUSED(etp))
+
EFSYS_PROBE4(tx_desc_tso_create, unsigned int, etp->et_index,
uint16_t, ipv4_id, uint32_t, tcp_seq,
uint8_t, tcp_flags);
@@ -654,6 +658,8 @@ ef10_tx_qdesc_tso2_create(
__out_ecount(count) efx_desc_t *edp,
__inint count)
 {
+   _NOTE(ARGUNUSED(etp, count))
+
EFSYS_PROBE4(tx_desc_tso2_create, unsigned int, etp->et_index,
uint16_t, ipv4_id, uint32_t, tcp_seq,
uint16_t, tcp_mss);
@@ -683,6 +689,8 @@ ef10_tx_qdesc_vlantci_create(
__inuint16_t  tci,
__out   efx_desc_t *edp)
 {
+   _NOTE(ARGUNUSED(etp))
+
EFSYS_PROBE2(tx_desc_vlantci_create, unsigned int, etp->et_index,
uint16_t, tci);
 

Modified: stable/10/sys/dev/sfxge/common/efx_ev.c
==
--- stable/10/sys/dev/sfxge/common/efx_ev.c Wed Dec 26 10:08:28 2018
(r342500)
+++ stable/10/sys/dev/sfxge/common/efx_ev.c Wed Dec 26 10:09:53 2018
(r342501)
@@ -1419,6 +1419,8 @@ efx_ev_qstat_name(
__inefx_nic_t *enp,
__inunsigned int id)
 {
+   _NOTE(ARGUNUSED(enp))
+
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(id, <, EV_NQSTATS);
 

Modified: stable/10/sys/dev/sfxge/common/efx_lic.c
==
--- stable/10/sys/dev/sfxge/common/efx_lic.cWed Dec 26 10:08:28 2018
(r342500)
+++ stable/10/sys/dev/sfxge/common/efx_lic.cWed Dec 26 10:09:53 2018
(r342501)
@@ -587,7 +587,7 @@ efx_lic_v1v2_read_key(
 {
efx_rc_t rc;
 
-   _NOTE(ARGUNUSED(enp))
+   _NOTE(ARGUNUSED(enp, buffer_size))
EFSYS_ASSERT(length <= (EFX_LICENS

svn commit: r342500 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:08:28 2018
New Revision: 342500
URL: https://svnweb.freebsd.org/changeset/base/342500

Log:
  MFC r340887
  
  sfxge(4): fix warnings from VS2015 C compiler (C4245)
  
  Fix level 4 warning
  "C4245: 'initializing': conversion from 'int' to 'uint32_t',
  signed/unsigned mismatch" warning; no functional changes.
  
  Submitted by:   Andrew Lee 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18121

Modified:
  stable/10/sys/dev/sfxge/common/ef10_filter.c
  stable/10/sys/dev/sfxge/common/efx.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_filter.c
==
--- stable/10/sys/dev/sfxge/common/ef10_filter.cWed Dec 26 10:07:30 
2018(r342499)
+++ stable/10/sys/dev/sfxge/common/ef10_filter.cWed Dec 26 10:08:28 
2018(r342500)
@@ -992,7 +992,7 @@ ef10_filter_supported_filters(
size_t list_length;
uint32_t i;
efx_rc_t rc;
-   uint32_t all_filter_flags =
+   efx_filter_match_flags_t all_filter_flags =
(EFX_FILTER_MATCH_REM_HOST | EFX_FILTER_MATCH_LOC_HOST |
EFX_FILTER_MATCH_REM_MAC | EFX_FILTER_MATCH_REM_PORT |
EFX_FILTER_MATCH_LOC_MAC | EFX_FILTER_MATCH_LOC_PORT |

Modified: stable/10/sys/dev/sfxge/common/efx.h
==
--- stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 10:07:30 2018
(r342499)
+++ stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 10:08:28 2018
(r342500)
@@ -2165,29 +2165,37 @@ typedef unsigned int efx_filter_flags_t;
  * Flags which specify the fields to match on. The values are the same as in 
the
  * MC_CMD_FILTER_OP/MC_CMD_FILTER_OP_EXT commands.
  */
-typedef enum efx_filter_match_flags_e {
-   EFX_FILTER_MATCH_REM_HOST = 0x0001, /* Match by remote IP host
-* address */
-   EFX_FILTER_MATCH_LOC_HOST = 0x0002, /* Match by local IP host
-* address */
-   EFX_FILTER_MATCH_REM_MAC = 0x0004,  /* Match by remote MAC address 
*/
-   EFX_FILTER_MATCH_REM_PORT = 0x0008, /* Match by remote TCP/UDP port 
*/
-   EFX_FILTER_MATCH_LOC_MAC = 0x0010,  /* Match by remote TCP/UDP port 
*/
-   EFX_FILTER_MATCH_LOC_PORT = 0x0020, /* Match by local TCP/UDP port 
*/
-   EFX_FILTER_MATCH_ETHER_TYPE = 0x0040,   /* Match by Ether-type */
-   EFX_FILTER_MATCH_INNER_VID = 0x0080,/* Match by inner VLAN ID */
-   EFX_FILTER_MATCH_OUTER_VID = 0x0100,/* Match by outer VLAN ID */
-   EFX_FILTER_MATCH_IP_PROTO = 0x0200, /* Match by IP transport
-* protocol */
-   /* For encapsulated packets, match all multicast inner frames */
-   EFX_FILTER_MATCH_IFRM_UNKNOWN_MCAST_DST = 0x0100,
-   /* For encapsulated packets, match all unicast inner frames */
-   EFX_FILTER_MATCH_IFRM_UNKNOWN_UCAST_DST = 0x0200,
-   /* Match otherwise-unmatched multicast and broadcast packets */
-   EFX_FILTER_MATCH_UNKNOWN_MCAST_DST = 0x4000,
-   /* Match otherwise-unmatched unicast packets */
-   EFX_FILTER_MATCH_UNKNOWN_UCAST_DST = 0x8000,
-} efx_filter_match_flags_t;
+
+/* Match by remote IP host address */
+#defineEFX_FILTER_MATCH_REM_HOST   0x0001
+/* Match by local IP host address */
+#defineEFX_FILTER_MATCH_LOC_HOST   0x0002
+/* Match by remote MAC address */
+#defineEFX_FILTER_MATCH_REM_MAC0x0004
+/* Match by remote TCP/UDP port */
+#defineEFX_FILTER_MATCH_REM_PORT   0x0008
+/* Match by remote TCP/UDP port */
+#defineEFX_FILTER_MATCH_LOC_MAC0x0010
+/* Match by local TCP/UDP port */
+#defineEFX_FILTER_MATCH_LOC_PORT   0x0020
+/* Match by Ether-type */
+#defineEFX_FILTER_MATCH_ETHER_TYPE 0x0040
+/* Match by inner VLAN ID */
+#defineEFX_FILTER_MATCH_INNER_VID  0x0080
+/* Match by outer VLAN ID */
+#defineEFX_FILTER_MATCH_OUTER_VID  0x0100
+/* Match by IP transport protocol */
+#defineEFX_FILTER_MATCH_IP_PROTO   0x0200
+/* For encapsulated packets, match all multicast inner frames */
+#defineEFX_FILTER_MATCH_IFRM_UNKNOWN_MCAST_DST 0x0100
+/* For encapsulated packets, match all unicast inner frames */
+#defineEFX_FILTER_MATCH_IFRM_UNKNOWN_UCAST_DST 0x0200
+/* Match otherwise-unmatched multicast and broadcast packets */
+#defineEFX_FILTER_MATCH_UNKNOWN_MCAST_DST  0x4000
+/* Match otherwise-unmatched unicast packets */
+#defineEFX_FILTER_MATCH_UNKNOWN_UCAST_DST  0x8000
+
+typedef uint32_

svn commit: r342499 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:07:30 2018
New Revision: 342499
URL: https://svnweb.freebsd.org/changeset/base/342499

Log:
  MFC r340886
  
  sfxge(4): fix warnings from VS2015 C compiler (C4244)
  
  Fix level 4 warning
  "C4244: '+=': conversion from 'unsigned int' to 'uint16_t', possible
  loss
  of data"; no functional changes.
  
  Submitted by:   Andrew Lee 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18120

Modified:
  stable/10/sys/dev/sfxge/common/efx_vpd.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_vpd.c
==
--- stable/10/sys/dev/sfxge/common/efx_vpd.cWed Dec 26 10:06:14 2018
(r342498)
+++ stable/10/sys/dev/sfxge/common/efx_vpd.cWed Dec 26 10:07:30 2018
(r342499)
@@ -931,7 +931,7 @@ efx_vpd_hunk_set(
}
 
/* Modify tag length (large resource type) */
-   taglen += (dest - source);
+   taglen += (uint16_t)(dest - source);
EFX_POPULATE_WORD_1(word, EFX_WORD_0, taglen);
data[offset - 2] = EFX_WORD_FIELD(word, EFX_BYTE_0);
data[offset - 1] = EFX_WORD_FIELD(word, EFX_BYTE_1);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342498 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:06:14 2018
New Revision: 342498
URL: https://svnweb.freebsd.org/changeset/base/342498

Log:
  MFC r340885
  
  sfxge(4): fix warnings from VS2015 C compiler (C4310)
  
  Fix level 4 warning
  "C4310: cast truncates constant value";
  no functional changes.
  
  Submitted by:   Andrew Lee 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18119

Modified:
  stable/10/sys/dev/sfxge/common/efx_bootcfg.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_bootcfg.c
==
--- stable/10/sys/dev/sfxge/common/efx_bootcfg.cWed Dec 26 10:05:36 
2018(r342497)
+++ stable/10/sys/dev/sfxge/common/efx_bootcfg.cWed Dec 26 10:06:14 
2018(r342498)
@@ -359,7 +359,7 @@ efx_bootcfg_read(
rc = efx_bootcfg_verify(enp, (caddr_t)payload, sector_length,
&used_bytes);
if (rc != 0 || used_bytes == 0) {
-   payload[0] = (uint8_t)~DHCP_END;
+   payload[0] = (uint8_t)(~DHCP_END & 0xff);
payload[1] = DHCP_END;
used_bytes = 2;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342496 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:05:03 2018
New Revision: 342496
URL: https://svnweb.freebsd.org/changeset/base/342496

Log:
  MFC r340883
  
  sfxge(4): fix diagnostics support build without Siena
  
  The compilation failed because __efx_sram_pattern_fns was used in
  efx_nic.c, but defined in efx_sram.c which is only needed when
  supporting Siena.
  
  To fix it move all the code using __efx_sram_pattern_fns into
  Siena-specific files (except for the definition in efx_sram.c itself,
  as that file only needs to be included in Siena-supporting builds
  anyway).
  
  The functions to test registers and tables are unlikely to apply to any
  new hardware and so can be moved into Siena files. Since Huntington
  such tests have been implemented in firmware.
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18117

Modified:
  stable/10/sys/dev/sfxge/common/efx_impl.h
  stable/10/sys/dev/sfxge/common/efx_nic.c
  stable/10/sys/dev/sfxge/common/siena_impl.h
  stable/10/sys/dev/sfxge/common/siena_nic.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_impl.h
==
--- stable/10/sys/dev/sfxge/common/efx_impl.h   Wed Dec 26 10:03:59 2018
(r342495)
+++ stable/10/sys/dev/sfxge/common/efx_impl.h   Wed Dec 26 10:05:03 2018
(r342496)
@@ -1119,32 +1119,6 @@ efx_vpd_hunk_set(
 
 #endif /* EFSYS_OPT_VPD */
 
-#if EFSYS_OPT_DIAG
-
-extern efx_sram_pattern_fn_t   __efx_sram_pattern_fns[];
-
-typedef struct efx_register_set_s {
-   unsigned intaddress;
-   unsigned intstep;
-   unsigned introws;
-   efx_oword_t mask;
-} efx_register_set_t;
-
-extern __checkReturn   efx_rc_t
-efx_nic_test_registers(
-   __inefx_nic_t *enp,
-   __inefx_register_set_t *rsp,
-   __insize_t count);
-
-extern __checkReturn   efx_rc_t
-efx_nic_test_tables(
-   __inefx_nic_t *enp,
-   __inefx_register_set_t *rsp,
-   __inefx_pattern_type_t pattern,
-   __insize_t count);
-
-#endif /* EFSYS_OPT_DIAG */
-
 #if EFSYS_OPT_MCDI
 
 extern __checkReturn   efx_rc_t

Modified: stable/10/sys/dev/sfxge/common/efx_nic.c
==
--- stable/10/sys/dev/sfxge/common/efx_nic.cWed Dec 26 10:03:59 2018
(r342495)
+++ stable/10/sys/dev/sfxge/common/efx_nic.cWed Dec 26 10:05:03 2018
(r342496)
@@ -641,139 +641,6 @@ fail1:
return (rc);
 }
 
-   __checkReturn   efx_rc_t
-efx_nic_test_registers(
-   __inefx_nic_t *enp,
-   __inefx_register_set_t *rsp,
-   __insize_t count)
-{
-   unsigned int bit;
-   efx_oword_t original;
-   efx_oword_t reg;
-   efx_oword_t buf;
-   efx_rc_t rc;
-
-   while (count > 0) {
-   /* This function is only suitable for registers */
-   EFSYS_ASSERT(rsp->rows == 1);
-
-   /* bit sweep on and off */
-   EFSYS_BAR_READO(enp->en_esbp, rsp->address, &original,
-   B_TRUE);
-   for (bit = 0; bit < 128; bit++) {
-   /* Is this bit in the mask? */
-   if (~(rsp->mask.eo_u32[bit >> 5]) & (1 << bit))
-   continue;
-
-   /* Test this bit can be set in isolation */
-   reg = original;
-   EFX_AND_OWORD(reg, rsp->mask);
-   EFX_SET_OWORD_BIT(reg, bit);
-
-   EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, ®,
-   B_TRUE);
-   EFSYS_BAR_READO(enp->en_esbp, rsp->address, &buf,
-   B_TRUE);
-
-   EFX_AND_OWORD(buf, rsp->mask);
-   if (memcmp(®, &buf, sizeof (reg))) {
-   rc = EIO;
-   goto fail1;
-   }
-
-   /* Test this bit can be cleared in isolation */
-   EFX_OR_OWORD(reg, rsp->mask);
-   EFX_CLEAR_OWORD_BIT(reg, bit);
-
-   EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, ®,
-   B_TRUE);
-   EFSYS_BAR_READO(enp->en_esbp, rsp->address, &buf,
-   B_TRUE);
-
-   EFX_AND_OWORD(buf, rsp->mask);
-   if (memcmp(®, &buf, sizeof (reg))) {
-   rc = EIO;
-   goto fail2;
-   }
-   }
-
-   /* Restore the old value */
-   EFSYS_BAR_WRITEO(enp

svn commit: r342495 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:03:59 2018
New Revision: 342495
URL: https://svnweb.freebsd.org/changeset/base/342495

Log:
  MFC r340875
  
  sfxge(4): fix build issue with PHY LED control enabled
  
  Fixed build issue with the EFSYS_OPT_PHY_LED_CONTROL for Huntigton and
  Medford.
  
  Submitted by:   Vijay Srivastava 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18110

Modified:
  stable/10/sys/dev/sfxge/common/ef10_phy.c
  stable/10/sys/dev/sfxge/common/efx_check.h
  stable/10/sys/dev/sfxge/common/siena_nic.c
  stable/10/sys/dev/sfxge/common/siena_phy.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_phy.c
==
--- stable/10/sys/dev/sfxge/common/ef10_phy.c   Wed Dec 26 10:03:11 2018
(r342494)
+++ stable/10/sys/dev/sfxge/common/ef10_phy.c   Wed Dec 26 10:03:59 2018
(r342495)
@@ -283,7 +283,9 @@ ef10_phy_reconfigure(
uint8_t payload[MAX(MC_CMD_SET_LINK_IN_LEN,
MC_CMD_SET_LINK_OUT_LEN)];
uint32_t cap_mask;
+#if EFSYS_OPT_PHY_LED_CONTROL
unsigned int led_mode;
+#endif
unsigned int speed;
boolean_t supported;
efx_rc_t rc;

Modified: stable/10/sys/dev/sfxge/common/efx_check.h
==
--- stable/10/sys/dev/sfxge/common/efx_check.h  Wed Dec 26 10:03:11 2018
(r342494)
+++ stable/10/sys/dev/sfxge/common/efx_check.h  Wed Dec 26 10:03:59 2018
(r342495)
@@ -226,8 +226,8 @@
 
 /* Support for PHY LED control */
 #if EFSYS_OPT_PHY_LED_CONTROL
-# if !EFSYS_OPT_SIENA
-#  error "PHY_LED_CONTROL requires SIENA"
+# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
+#  error "PHY_LED_CONTROL requires SIENA or HUNTINGTON or MEDFORD"
 # endif
 #endif /* EFSYS_OPT_PHY_LED_CONTROL */
 

Modified: stable/10/sys/dev/sfxge/common/siena_nic.c
==
--- stable/10/sys/dev/sfxge/common/siena_nic.c  Wed Dec 26 10:03:11 2018
(r342494)
+++ stable/10/sys/dev/sfxge/common/siena_nic.c  Wed Dec 26 10:03:59 2018
(r342495)
@@ -188,7 +188,9 @@ static  __checkReturn   efx_rc_t
 siena_phy_cfg(
__inefx_nic_t *enp)
 {
+#if EFSYS_OPT_PHY_STATS
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
+#endif /* EFSYS_OPT_PHY_STATS */
efx_rc_t rc;
 
/* Fill out fields in enp->en_port and enp->en_nic_cfg from MCDI */

Modified: stable/10/sys/dev/sfxge/common/siena_phy.c
==
--- stable/10/sys/dev/sfxge/common/siena_phy.c  Wed Dec 26 10:03:11 2018
(r342494)
+++ stable/10/sys/dev/sfxge/common/siena_phy.c  Wed Dec 26 10:03:59 2018
(r342495)
@@ -276,7 +276,9 @@ siena_phy_reconfigure(
MAX(MC_CMD_SET_LINK_IN_LEN,
MC_CMD_SET_LINK_OUT_LEN))];
uint32_t cap_mask;
+#if EFSYS_OPT_PHY_LED_CONTROL
unsigned int led_mode;
+#endif
unsigned int speed;
efx_rc_t rc;
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342497 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:05:36 2018
New Revision: 342497
URL: https://svnweb.freebsd.org/changeset/base/342497

Log:
  MFC r340884
  
  sfxge(4): fix probes in licensing support
  
  EFSYS_PROBE1 takes one typed value (in addition to the probe name),
  whereas EFSYS_PROBE has just the probe name.
  
  Which to use is determined by the probe name - "fail1" probes are
  expected to include the function result.
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18118

Modified:
  stable/10/sys/dev/sfxge/common/efx_lic.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_lic.c
==
--- stable/10/sys/dev/sfxge/common/efx_lic.cWed Dec 26 10:05:03 2018
(r342496)
+++ stable/10/sys/dev/sfxge/common/efx_lic.cWed Dec 26 10:05:36 2018
(r342497)
@@ -522,7 +522,7 @@ efx_lic_v1v2_find_key(
return (found);
 
 fail1:
-   EFSYS_PROBE(fail1);
+   EFSYS_PROBE1(fail1, boolean_t, B_FALSE);
 
return (B_FALSE);
 }
@@ -565,7 +565,7 @@ fail3:
 fail2:
EFSYS_PROBE(fail2);
 fail1:
-   EFSYS_PROBE(fail1);
+   EFSYS_PROBE1(fail1, boolean_t, B_FALSE);
 
return (B_FALSE);
 }
@@ -1187,7 +1187,7 @@ fail3:
 fail2:
EFSYS_PROBE(fail2);
 fail1:
-   EFSYS_PROBE(fail1);
+   EFSYS_PROBE1(fail1, boolean_t, B_FALSE);
 
return (B_FALSE);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342494 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:03:11 2018
New Revision: 342494
URL: https://svnweb.freebsd.org/changeset/base/342494

Log:
  MFC r340833
  
  sfxge(4): support inner checksum offload on transmit
  
  Inner checksum offloads may be used only if firmware supports
  these tunnels.
  
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18102

Modified:
  stable/10/sys/dev/sfxge/common/ef10_tx.c
  stable/10/sys/dev/sfxge/common/efx.h
  stable/10/sys/dev/sfxge/common/efx_tx.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_tx.c
==
--- stable/10/sys/dev/sfxge/common/ef10_tx.cWed Dec 26 10:02:05 2018
(r342493)
+++ stable/10/sys/dev/sfxge/common/ef10_tx.cWed Dec 26 10:03:11 2018
(r342494)
@@ -87,12 +87,16 @@ efx_mcdi_init_txq(
MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_LABEL, label);
MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_INSTANCE, instance);
 
-   MCDI_IN_POPULATE_DWORD_7(req, INIT_TXQ_IN_FLAGS,
+   MCDI_IN_POPULATE_DWORD_9(req, INIT_TXQ_IN_FLAGS,
INIT_TXQ_IN_FLAG_BUFF_MODE, 0,
INIT_TXQ_IN_FLAG_IP_CSUM_DIS,
(flags & EFX_TXQ_CKSUM_IPV4) ? 0 : 1,
INIT_TXQ_IN_FLAG_TCP_CSUM_DIS,
(flags & EFX_TXQ_CKSUM_TCPUDP) ? 0 : 1,
+   INIT_TXQ_EXT_IN_FLAG_INNER_IP_CSUM_EN,
+   (flags & EFX_TXQ_CKSUM_INNER_IPV4) ? 1 : 0,
+   INIT_TXQ_EXT_IN_FLAG_INNER_TCP_CSUM_EN,
+   (flags & EFX_TXQ_CKSUM_INNER_TCPUDP) ? 1 : 0,
INIT_TXQ_EXT_IN_FLAG_TSOV2_EN, (flags & EFX_TXQ_FATSOV2) ? 1 : 0,
INIT_TXQ_IN_FLAG_TCP_UDP_ONLY, 0,
INIT_TXQ_IN_CRC_MODE, 0,
@@ -197,14 +201,23 @@ ef10_tx_qcreate(
__inefx_txq_t *etp,
__out   unsigned int *addedp)
 {
+   efx_nic_cfg_t *encp = &enp->en_nic_cfg;
+   uint16_t inner_csum;
efx_qword_t desc;
efx_rc_t rc;
 
_NOTE(ARGUNUSED(id))
 
+   inner_csum = EFX_TXQ_CKSUM_INNER_IPV4 | EFX_TXQ_CKSUM_INNER_TCPUDP;
+   if (((flags & inner_csum) != 0) &&
+   (encp->enc_tunnel_encapsulations_supported == 0)) {
+   rc = EINVAL;
+   goto fail1;
+   }
+
if ((rc = efx_mcdi_init_txq(enp, n, eep->ee_index, label, index, flags,
esmp)) != 0)
-   goto fail1;
+   goto fail2;
 
/*
 * A previous user of this TX queue may have written a descriptor to the
@@ -215,19 +228,25 @@ ef10_tx_qcreate(
 * a no-op TX option descriptor. See bug29981 for details.
 */
*addedp = 1;
-   EFX_POPULATE_QWORD_4(desc,
+   EFX_POPULATE_QWORD_6(desc,
ESF_DZ_TX_DESC_IS_OPT, 1,
ESF_DZ_TX_OPTION_TYPE, ESE_DZ_TX_OPTION_DESC_CRC_CSUM,
ESF_DZ_TX_OPTION_UDP_TCP_CSUM,
(flags & EFX_TXQ_CKSUM_TCPUDP) ? 1 : 0,
ESF_DZ_TX_OPTION_IP_CSUM,
-   (flags & EFX_TXQ_CKSUM_IPV4) ? 1 : 0);
+   (flags & EFX_TXQ_CKSUM_IPV4) ? 1 : 0,
+   ESF_DZ_TX_OPTION_INNER_UDP_TCP_CSUM,
+   (flags & EFX_TXQ_CKSUM_INNER_TCPUDP) ? 1 : 0,
+   ESF_DZ_TX_OPTION_INNER_IP_CSUM,
+   (flags & EFX_TXQ_CKSUM_INNER_IPV4) ? 1 : 0);
 
EFSYS_MEM_WRITEQ(etp->et_esmp, 0, &desc);
ef10_tx_qpush(etp, *addedp, 0);
 
return (0);
 
+fail2:
+   EFSYS_PROBE(fail2);
 fail1:
EFSYS_PROBE1(fail1, efx_rc_t, rc);
 

Modified: stable/10/sys/dev/sfxge/common/efx.h
==
--- stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 10:02:05 2018
(r342493)
+++ stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 10:03:11 2018
(r342494)
@@ -1997,9 +1997,11 @@ efx_tx_fini(
 
 #defineEFX_TXQ_MAX_BUFS 8 /* Maximum independent of 
EFX_BUG35388_WORKAROUND. */
 
-#defineEFX_TXQ_CKSUM_IPV4  0x0001
-#defineEFX_TXQ_CKSUM_TCPUDP0x0002
-#defineEFX_TXQ_FATSOV2 0x0004
+#defineEFX_TXQ_CKSUM_IPV4  0x0001
+#defineEFX_TXQ_CKSUM_TCPUDP0x0002
+#defineEFX_TXQ_FATSOV2 0x0004
+#defineEFX_TXQ_CKSUM_INNER_IPV40x0008
+#defineEFX_TXQ_CKSUM_INNER_TCPUDP  0x0010
 
 extern __checkReturn   efx_rc_t
 efx_tx_qcreate(

Modified: stable/10/sys/dev/sfxge/common/efx_tx.c
==
--- stable/10/sys/dev/sfxge/common/efx_tx.c Wed Dec 26 10:02:05 2018
(r342493)
+++ stable/10/sys/dev/sfxge/common/efx_tx.c Wed Dec 26 10:03:11 2018
(r342494)
@@ -903,6 +903,7 @@ siena_tx_qcreate(
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
efx_oword_t oword;
uint32_t size;
+   uint16_t inner_csum;
efx_rc_t rc;
 
_NOTE(ARGUNUSED(esmp))
@@ -932,6 +933,12 @@ 

svn commit: r342493 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:02:05 2018
New Revision: 342493
URL: https://svnweb.freebsd.org/changeset/base/342493

Log:
  MFC r340831
  
  sfxge(4): make MAC naming consistent with other modules
  
  Submitted by:   Andy Moreton 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18101

Modified:
  stable/10/sys/dev/sfxge/common/efx_mac.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_mac.c
==
--- stable/10/sys/dev/sfxge/common/efx_mac.cWed Dec 26 10:01:25 2018
(r342492)
+++ stable/10/sys/dev/sfxge/common/efx_mac.cWed Dec 26 10:02:05 2018
(r342493)
@@ -43,7 +43,7 @@ siena_mac_multicast_list_set(
 #endif /* EFSYS_OPT_SIENA */
 
 #if EFSYS_OPT_SIENA
-static const efx_mac_ops_t __efx_siena_mac_ops = {
+static const efx_mac_ops_t __efx_mac_siena_ops = {
siena_mac_poll, /* emo_poll */
siena_mac_up,   /* emo_up */
siena_mac_reconfigure,  /* emo_addr_set */
@@ -66,7 +66,7 @@ static const efx_mac_ops_t__efx_siena_mac_ops = {
 #endif /* EFSYS_OPT_SIENA */
 
 #if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD
-static const efx_mac_ops_t __efx_ef10_mac_ops = {
+static const efx_mac_ops_t __efx_mac_ef10_ops = {
ef10_mac_poll,  /* emo_poll */
ef10_mac_up,/* emo_up */
ef10_mac_addr_set,  /* emo_addr_set */
@@ -818,21 +818,21 @@ efx_mac_select(
switch (enp->en_family) {
 #if EFSYS_OPT_SIENA
case EFX_FAMILY_SIENA:
-   emop = &__efx_siena_mac_ops;
+   emop = &__efx_mac_siena_ops;
type = EFX_MAC_SIENA;
break;
 #endif /* EFSYS_OPT_SIENA */
 
 #if EFSYS_OPT_HUNTINGTON
case EFX_FAMILY_HUNTINGTON:
-   emop = &__efx_ef10_mac_ops;
+   emop = &__efx_mac_ef10_ops;
type = EFX_MAC_HUNTINGTON;
break;
 #endif /* EFSYS_OPT_HUNTINGTON */
 
 #if EFSYS_OPT_MEDFORD
case EFX_FAMILY_MEDFORD:
-   emop = &__efx_ef10_mac_ops;
+   emop = &__efx_mac_ef10_ops;
type = EFX_MAC_MEDFORD;
break;
 #endif /* EFSYS_OPT_MEDFORD */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342492 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:01:25 2018
New Revision: 342492
URL: https://svnweb.freebsd.org/changeset/base/342492

Log:
  MFC r340826
  
  sfxge(4): fix ignoring function return value
  
  fix PreFAST issue, add missing annotation that function return value
  should not be ignored. Fix alignment.
  
  Submitted by:   Andy Moreton 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18096

Modified:
  stable/10/sys/dev/sfxge/common/efx.h
  stable/10/sys/dev/sfxge/common/efx_phy.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx.h
==
--- stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 10:00:25 2018
(r342491)
+++ stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 10:01:25 2018
(r342492)
@@ -911,13 +911,13 @@ efx_phy_media_type_get(
__inefx_nic_t *enp,
__out   efx_phy_media_type_t *typep);
 
-extern efx_rc_t
+extern __checkReturn   efx_rc_t
 efx_phy_module_get_info(
-   __inefx_nic_t *enp,
-   __inuint8_t dev_addr,
-   __inuint8_t offset,
-   __inuint8_t len,
-   __out_bcount(len)   uint8_t *data);
+   __inefx_nic_t *enp,
+   __inuint8_t dev_addr,
+   __inuint8_t offset,
+   __inuint8_t len,
+   __out_bcount(len)   uint8_t *data);
 
 #if EFSYS_OPT_PHY_STATS
 

Modified: stable/10/sys/dev/sfxge/common/efx_phy.c
==
--- stable/10/sys/dev/sfxge/common/efx_phy.cWed Dec 26 10:00:25 2018
(r342491)
+++ stable/10/sys/dev/sfxge/common/efx_phy.cWed Dec 26 10:01:25 2018
(r342492)
@@ -299,7 +299,7 @@ efx_phy_media_type_get(
*typep = epp->ep_fixed_port_type;
 }
 
-   __checkReturn   efx_rc_t
+   __checkReturn   efx_rc_t
 efx_phy_module_get_info(
__inefx_nic_t *enp,
__inuint8_t dev_addr,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342491 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 10:00:25 2018
New Revision: 342491
URL: https://svnweb.freebsd.org/changeset/base/342491

Log:
  MFC r340822
  
  sfxge(4): fix check in NVRAM validate
  
  Submitted by:   Andy Moreton 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18092

Modified:
  stable/10/sys/dev/sfxge/common/efx_nvram.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_nvram.c
==
--- stable/10/sys/dev/sfxge/common/efx_nvram.c  Wed Dec 26 09:59:24 2018
(r342490)
+++ stable/10/sys/dev/sfxge/common/efx_nvram.c  Wed Dec 26 10:00:25 2018
(r342491)
@@ -460,10 +460,11 @@ efx_nvram_validate(
if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0)
goto fail1;
 
-   if (envop->envo_type_to_partn != NULL &&
-   ((rc = envop->envo_buffer_validate(enp, partn,
-   partn_data, partn_size)) != 0))
-   goto fail2;
+   if (envop->envo_buffer_validate != NULL) {
+   if ((rc = envop->envo_buffer_validate(enp, partn,
+   partn_data, partn_size)) != 0)
+   goto fail2;
+   }
 
return (0);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342490 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 09:59:24 2018
New Revision: 342490
URL: https://svnweb.freebsd.org/changeset/base/342490

Log:
  MFC r340814
  
  sfxge(4): fix result code in MCDI NVRAM update finish
  
  Submitted by:   Andy Moreton 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18084

Modified:
  stable/10/sys/dev/sfxge/common/efx_nvram.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_nvram.c
==
--- stable/10/sys/dev/sfxge/common/efx_nvram.c  Wed Dec 26 09:44:08 2018
(r342489)
+++ stable/10/sys/dev/sfxge/common/efx_nvram.c  Wed Dec 26 09:59:24 2018
(r342490)
@@ -924,7 +924,7 @@ efx_mcdi_nvram_update_finish(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_NVRAM_UPDATE_FINISH_V2_IN_LEN,
MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT_LEN)];
-   uint32_t result = 0; /* FIXME: use MC_CMD_NVRAM_VERIFY_RC_UNKNOWN */
+   uint32_t result = MC_CMD_NVRAM_VERIFY_RC_UNKNOWN;
efx_rc_t rc;
 
(void) memset(payload, 0, sizeof (payload));
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342489 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 09:44:08 2018
New Revision: 342489
URL: https://svnweb.freebsd.org/changeset/base/342489

Log:
  MFC r340806
  
  sfxge(4): fix default RSS context check on Siena
  
  Default RSS context check is carried out during filter
  insertion on Siena and it needs to be fixed
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18076

Modified:
  stable/10/sys/dev/sfxge/common/efx_filter.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_filter.c
==
--- stable/10/sys/dev/sfxge/common/efx_filter.c Wed Dec 26 09:43:38 2018
(r342488)
+++ stable/10/sys/dev/sfxge/common/efx_filter.c Wed Dec 26 09:44:08 2018
(r342489)
@@ -525,9 +525,9 @@ siena_filter_spec_from_gen_spec(
else
EFSYS_ASSERT3U(gen_spec->efs_flags, &, EFX_FILTER_FLAG_RX);
 
-   /* Falconsiena only has one RSS context */
+   /* Siena only has one RSS context */
if ((gen_spec->efs_flags & EFX_FILTER_FLAG_RX_RSS) &&
-   gen_spec->efs_rss_context != 0) {
+   gen_spec->efs_rss_context != EFX_RSS_CONTEXT_DEFAULT) {
rc = EINVAL;
goto fail1;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342488 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 09:43:38 2018
New Revision: 342488
URL: https://svnweb.freebsd.org/changeset/base/342488

Log:
  MFC r340805
  
  sfxge(4): define a handle to denote default RSS context
  
  Make the existing filter-specific define more general.
  This is the same as MC_CMD_RSS_CONTEXT_ALLOC_OUT_RSS_CONTEXT_ID_INVALID.
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18075

Modified:
  stable/10/sys/dev/sfxge/common/efx.h
  stable/10/sys/dev/sfxge/common/efx_filter.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx.h
==
--- stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 09:42:40 2018
(r342487)
+++ stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 09:43:38 2018
(r342488)
@@ -1824,6 +1824,9 @@ efx_rx_scatter_enable(
__inunsigned int buf_size);
 #endif /* EFSYS_OPT_RX_SCATTER */
 
+/* Handle to represent use of the default RSS context. */
+#defineEFX_RSS_CONTEXT_DEFAULT 0x
+
 #if EFSYS_OPT_RX_SCALE
 
 typedef enum efx_rx_hash_alg_e {
@@ -2223,7 +2226,6 @@ typedef struct efx_filter_spec_s {
 
 
 /* Default values for use in filter specifications */
-#defineEFX_FILTER_SPEC_RSS_CONTEXT_DEFAULT 0x
 #defineEFX_FILTER_SPEC_RX_DMAQ_ID_DROP 0xfff
 #defineEFX_FILTER_SPEC_VID_UNSPEC  0x
 

Modified: stable/10/sys/dev/sfxge/common/efx_filter.c
==
--- stable/10/sys/dev/sfxge/common/efx_filter.c Wed Dec 26 09:42:40 2018
(r342487)
+++ stable/10/sys/dev/sfxge/common/efx_filter.c Wed Dec 26 09:43:38 2018
(r342488)
@@ -305,7 +305,7 @@ efx_filter_spec_init_rx(
memset(spec, 0, sizeof (*spec));
spec->efs_priority = priority;
spec->efs_flags = EFX_FILTER_FLAG_RX | flags;
-   spec->efs_rss_context = EFX_FILTER_SPEC_RSS_CONTEXT_DEFAULT;
+   spec->efs_rss_context = EFX_RSS_CONTEXT_DEFAULT;
spec->efs_dmaq_id = (uint16_t)erp->er_index;
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342487 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 09:42:40 2018
New Revision: 342487
URL: https://svnweb.freebsd.org/changeset/base/342487

Log:
  MFC r340804
  
  sfxge(4): insert filters for encapsulated packets
  
  On Medford, with full-featured firmware running, encapsulated
  packets may not be delivered unless filters are inserted for
  them, as ordinary filters are not applied to encapsulated
  packets. So filters for encapsulated packets need to be
  inserted for each class of encapsulated packet. For simplicity,
  catch-all filters are always inserted. These may match more
  packets than the OS has asked for, but trying to insert more
  precise filters increases complexity for little gain.
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18074

Modified:
  stable/10/sys/dev/sfxge/common/ef10_filter.c
  stable/10/sys/dev/sfxge/common/ef10_impl.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_filter.c
==
--- stable/10/sys/dev/sfxge/common/ef10_filter.cWed Dec 26 09:41:04 
2018(r342486)
+++ stable/10/sys/dev/sfxge/common/ef10_filter.cWed Dec 26 09:42:40 
2018(r342487)
@@ -1234,6 +1234,108 @@ fail1:
return (rc);
 }
 
+typedef struct ef10_filter_encap_entry_s {
+   uint16_tether_type;
+   efx_tunnel_protocol_t   encap_type;
+   uint32_tinner_frame_match;
+} ef10_filter_encap_entry_t;
+
+#define EF10_ENCAP_FILTER_ENTRY(ipv, encap_type, inner_frame_match)\
+   { EFX_ETHER_TYPE_##ipv, EFX_TUNNEL_PROTOCOL_##encap_type,   
\
+   EFX_FILTER_INNER_FRAME_MATCH_UNKNOWN_##inner_frame_match }
+
+static ef10_filter_encap_entry_t ef10_filter_encap_list[] = {
+   EF10_ENCAP_FILTER_ENTRY(IPV4, VXLAN, UCAST_DST),
+   EF10_ENCAP_FILTER_ENTRY(IPV4, VXLAN, MCAST_DST),
+   EF10_ENCAP_FILTER_ENTRY(IPV6, VXLAN, UCAST_DST),
+   EF10_ENCAP_FILTER_ENTRY(IPV6, VXLAN, MCAST_DST),
+
+   EF10_ENCAP_FILTER_ENTRY(IPV4, GENEVE, UCAST_DST),
+   EF10_ENCAP_FILTER_ENTRY(IPV4, GENEVE, MCAST_DST),
+   EF10_ENCAP_FILTER_ENTRY(IPV6, GENEVE, UCAST_DST),
+   EF10_ENCAP_FILTER_ENTRY(IPV6, GENEVE, MCAST_DST),
+
+   EF10_ENCAP_FILTER_ENTRY(IPV4, NVGRE, UCAST_DST),
+   EF10_ENCAP_FILTER_ENTRY(IPV4, NVGRE, MCAST_DST),
+   EF10_ENCAP_FILTER_ENTRY(IPV6, NVGRE, UCAST_DST),
+   EF10_ENCAP_FILTER_ENTRY(IPV6, NVGRE, MCAST_DST),
+};
+
+#undef EF10_ENCAP_FILTER_ENTRY
+
+static __checkReturn   efx_rc_t
+ef10_filter_insert_encap_filters(
+   __inefx_nic_t *enp,
+   __inboolean_t mulcst,
+   __inefx_filter_flags_t filter_flags)
+{
+   ef10_filter_table_t *table = enp->en_filter.ef_ef10_filter_table;
+   uint32_t i;
+   efx_rc_t rc;
+
+   EFX_STATIC_ASSERT(EFX_ARRAY_SIZE(ef10_filter_encap_list) <=
+   EFX_ARRAY_SIZE(table->eft_encap_filter_indexes));
+
+   /*
+* On Medford, full-featured firmware can identify packets as being
+* tunnel encapsulated, even if no encapsulated packet offloads are in
+* use. When packets are identified as such, ordinary filters are not
+* applied, only ones specific to encapsulated packets. Hence we need to
+* insert filters for encapsulated packets in order to receive them.
+*
+* Separate filters need to be inserted for each ether type,
+* encapsulation type, and inner frame type (unicast or multicast). To
+* keep things simple and reduce the number of filters needed, catch-all
+* filters for all combinations of types are inserted, even if
+* all_unicst or all_mulcst have not been set. (These catch-all filters
+* may well, however, fail to insert on unprivileged functions.)
+*/
+   table->eft_encap_filter_count = 0;
+   for (i = 0; i < EFX_ARRAY_SIZE(ef10_filter_encap_list); i++) {
+   efx_filter_spec_t spec;
+   ef10_filter_encap_entry_t *encap_filter =
+   &ef10_filter_encap_list[i];
+
+   /*
+* Skip multicast filters if we've not been asked for
+* any multicast traffic.
+*/
+   if ((mulcst == B_FALSE) &&
+   (encap_filter->inner_frame_match ==
+EFX_FILTER_INNER_FRAME_MATCH_UNKNOWN_MCAST_DST))
+   continue;
+
+   efx_filter_spec_init_rx(&spec, EFX_FILTER_PRI_AUTO,
+   filter_flags,
+   table->eft_default_rxq);
+   efx_filter_spec_set_ether_type(&spec, encap_filter->ether_type);
+   rc = efx_filter_spec_set_encap_type(&spec,
+   encap_filter->encap_

svn commit: r342486 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 09:41:04 2018
New Revision: 342486
URL: https://svnweb.freebsd.org/changeset/base/342486

Log:
  MFC r340803
  
  sfxge(4): support filters for encapsulated packets
  
  This supports filters which match all unicast or multicast
  inner frames in VXLAN, GENEVE, or NVGRE packets.
  (Additional fields to match on can be added easily.)
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18073

Modified:
  stable/10/sys/dev/sfxge/common/ef10_filter.c
  stable/10/sys/dev/sfxge/common/efx.h
  stable/10/sys/dev/sfxge/common/efx_filter.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_filter.c
==
--- stable/10/sys/dev/sfxge/common/ef10_filter.cWed Dec 26 09:40:13 
2018(r342485)
+++ stable/10/sys/dev/sfxge/common/ef10_filter.cWed Dec 26 09:41:04 
2018(r342486)
@@ -145,6 +145,10 @@ ef10_filter_init(
MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_OUTER_VLAN));
EFX_STATIC_ASSERT(EFX_FILTER_MATCH_IP_PROTO ==
MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_IP_PROTO));
+   EFX_STATIC_ASSERT(EFX_FILTER_MATCH_IFRM_UNKNOWN_MCAST_DST ==
+   MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_UNKNOWN_MCAST_DST));
+   EFX_STATIC_ASSERT(EFX_FILTER_MATCH_IFRM_UNKNOWN_UCAST_DST ==
+   MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_UNKNOWN_UCAST_DST));
EFX_STATIC_ASSERT(EFX_FILTER_MATCH_UNKNOWN_MCAST_DST ==
MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_UNKNOWN_MCAST_DST));
EFX_STATIC_ASSERT((uint32_t)EFX_FILTER_MATCH_UNKNOWN_UCAST_DST ==
@@ -274,18 +278,47 @@ efx_mcdi_filter_op_add(
memcpy(MCDI_IN2(req, uint8_t, FILTER_OP_EXT_IN_DST_IP),
&spec->efs_loc_host.eo_byte[0],
MC_CMD_FILTER_OP_EXT_IN_DST_IP_LEN);
+
+   /*
+* On Medford, filters for encapsulated packets match based on
+* the ether type and IP protocol in the outer frame.  In
+* addition we need to fill in the VNI or VSID type field.
+*/
+   switch (spec->efs_encap_type) {
+   case EFX_TUNNEL_PROTOCOL_NONE:
+   break;
+   case EFX_TUNNEL_PROTOCOL_VXLAN:
+   case EFX_TUNNEL_PROTOCOL_GENEVE:
+   MCDI_IN_POPULATE_DWORD_1(req,
+   FILTER_OP_EXT_IN_VNI_OR_VSID,
+   FILTER_OP_EXT_IN_VNI_TYPE,
+   spec->efs_encap_type == EFX_TUNNEL_PROTOCOL_VXLAN ?
+   MC_CMD_FILTER_OP_EXT_IN_VNI_TYPE_VXLAN :
+   MC_CMD_FILTER_OP_EXT_IN_VNI_TYPE_GENEVE);
+   break;
+   case EFX_TUNNEL_PROTOCOL_NVGRE:
+   MCDI_IN_POPULATE_DWORD_1(req,
+   FILTER_OP_EXT_IN_VNI_OR_VSID,
+   FILTER_OP_EXT_IN_VSID_TYPE,
+   MC_CMD_FILTER_OP_EXT_IN_VSID_TYPE_NVGRE);
+   break;
+   default:
+   EFSYS_ASSERT(0);
+   rc = EINVAL;
+   goto fail2;
+   }
}
 
efx_mcdi_execute(enp, &req);
 
if (req.emr_rc != 0) {
rc = req.emr_rc;
-   goto fail2;
+   goto fail3;
}
 
if (req.emr_out_length_used < MC_CMD_FILTER_OP_EXT_OUT_LEN) {
rc = EMSGSIZE;
-   goto fail3;
+   goto fail4;
}
 
handle->efh_lo = MCDI_OUT_DWORD(req, FILTER_OP_EXT_OUT_HANDLE_LO);
@@ -293,6 +326,8 @@ efx_mcdi_filter_op_add(
 
return (0);
 
+fail4:
+   EFSYS_PROBE(fail4);
 fail3:
EFSYS_PROBE(fail3);
 fail2:
@@ -392,6 +427,8 @@ ef10_filter_equal(
if (left->efs_ether_type != right->efs_ether_type)
return (B_FALSE);
if (left->efs_ip_proto != right->efs_ip_proto)
+   return (B_FALSE);
+   if (left->efs_encap_type != right->efs_encap_type)
return (B_FALSE);
 
return (B_TRUE);

Modified: stable/10/sys/dev/sfxge/common/efx.h
==
--- stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 09:40:13 2018
(r342485)
+++ stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 09:41:04 2018
(r342486)
@@ -2137,6 +2137,7 @@ efx_tx_qdestroy(
 
 #defineEFX_IPPROTO_TCP 6
 #defineEFX_IPPROTO_UDP 17
+#defineEFX_IPPROTO_GRE 47
 
 /* Use RSS to spread across multiple queues */
 #defineEFX_FILTER_FLAG_RX_RSS  0x01
@@ -2155,6 +2156,10 @@ efx_tx_qdestroy(
 
 typedef unsigned int efx_filter_flags_t;
 
+/*
+ * Flags which specify the fiel

svn commit: r342485 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 09:40:13 2018
New Revision: 342485
URL: https://svnweb.freebsd.org/changeset/base/342485

Log:
  MFC r340802
  
  sfxge(4): use proper MCDI command for encap filters
  
  MC_CMD_FILTER_OP_IN_EXT is needed to set filters for encapsulated
  packets.
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18072

Modified:
  stable/10/sys/dev/sfxge/common/ef10_filter.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_filter.c
==
--- stable/10/sys/dev/sfxge/common/ef10_filter.cWed Dec 26 09:38:50 
2018(r342484)
+++ stable/10/sys/dev/sfxge/common/ef10_filter.cWed Dec 26 09:40:13 
2018(r342485)
@@ -126,29 +126,29 @@ ef10_filter_init(
 
 #defineMATCH_MASK(match) (EFX_MASK32(match) << EFX_LOW_BIT(match))
EFX_STATIC_ASSERT(EFX_FILTER_MATCH_REM_HOST ==
-   MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_SRC_IP));
+   MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_SRC_IP));
EFX_STATIC_ASSERT(EFX_FILTER_MATCH_LOC_HOST ==
-   MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_DST_IP));
+   MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_DST_IP));
EFX_STATIC_ASSERT(EFX_FILTER_MATCH_REM_MAC ==
-   MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_SRC_MAC));
+   MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_SRC_MAC));
EFX_STATIC_ASSERT(EFX_FILTER_MATCH_REM_PORT ==
-   MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_SRC_PORT));
+   MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_SRC_PORT));
EFX_STATIC_ASSERT(EFX_FILTER_MATCH_LOC_MAC ==
-   MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_DST_MAC));
+   MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_DST_MAC));
EFX_STATIC_ASSERT(EFX_FILTER_MATCH_LOC_PORT ==
-   MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_DST_PORT));
+   MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_DST_PORT));
EFX_STATIC_ASSERT(EFX_FILTER_MATCH_ETHER_TYPE ==
-   MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_ETHER_TYPE));
+   MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_ETHER_TYPE));
EFX_STATIC_ASSERT(EFX_FILTER_MATCH_INNER_VID ==
-   MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_INNER_VLAN));
+   MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_INNER_VLAN));
EFX_STATIC_ASSERT(EFX_FILTER_MATCH_OUTER_VID ==
-   MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_OUTER_VLAN));
+   MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_OUTER_VLAN));
EFX_STATIC_ASSERT(EFX_FILTER_MATCH_IP_PROTO ==
-   MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_IP_PROTO));
+   MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_IP_PROTO));
EFX_STATIC_ASSERT(EFX_FILTER_MATCH_UNKNOWN_MCAST_DST ==
-   MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_MCAST_DST));
+   MATCH_MASK(MC_CMD_FILTER_OP_EXT_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));
+   MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_UNKNOWN_UCAST_DST));
 #undef MATCH_MASK
 
EFSYS_KMEM_ALLOC(enp->en_esip, sizeof (ef10_filter_table_t), eftp);
@@ -189,27 +189,27 @@ efx_mcdi_filter_op_add(
__inout ef10_filter_handle_t *handle)
 {
efx_mcdi_req_t req;
-   uint8_t payload[MAX(MC_CMD_FILTER_OP_IN_LEN,
-   MC_CMD_FILTER_OP_OUT_LEN)];
+   uint8_t payload[MAX(MC_CMD_FILTER_OP_EXT_IN_LEN,
+   MC_CMD_FILTER_OP_EXT_OUT_LEN)];
efx_rc_t rc;
 
memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_FILTER_OP;
req.emr_in_buf = payload;
-   req.emr_in_length = MC_CMD_FILTER_OP_IN_LEN;
+   req.emr_in_length = MC_CMD_FILTER_OP_EXT_IN_LEN;
req.emr_out_buf = payload;
-   req.emr_out_length = MC_CMD_FILTER_OP_OUT_LEN;
+   req.emr_out_length = MC_CMD_FILTER_OP_EXT_OUT_LEN;
 
switch (filter_op) {
case MC_CMD_FILTER_OP_IN_OP_REPLACE:
-   MCDI_IN_SET_DWORD(req, FILTER_OP_IN_HANDLE_LO,
+   MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_HANDLE_LO,
handle->efh_lo);
-   MCDI_IN_SET_DWORD(req, FILTER_OP_IN_HANDLE_HI,
+   MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_HANDLE_HI,
handle->efh_hi);
/* Fall through */
case MC_CMD_FILTER_OP_IN_OP_INSERT:
case MC_CMD_FILTER_OP_IN_OP_SUBSCRIBE:
-   MCDI_IN_SET_DWORD(req, FILTER_OP_IN_OP, filter_op);
+   MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_OP, filter_op);
break;
default:
EFSYS_ASSERT(0);
@@ -217,63 +217,63 @@ efx_mcdi_filter_op_add(
goto fail1;
}
 
-   MCDI_IN_SET_DWORD(req, FILTER_OP_IN_PORT_ID,
+   MCDI_IN_SET_DWORD(r

svn commit: r342484 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 09:38:50 2018
New Revision: 342484
URL: https://svnweb.freebsd.org/changeset/base/342484

Log:
  MFC r340801
  
  sfxge(4): provide information about supported tunnels
  
  VXLAN/NVGRE (and Geneve) support is available on SFN8xxx with
  full-feature firmware variant running.
  
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18071

Modified:
  stable/10/sys/dev/sfxge/common/ef10_nic.c
  stable/10/sys/dev/sfxge/common/efx.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_nic.c
==
--- stable/10/sys/dev/sfxge/common/ef10_nic.c   Wed Dec 26 09:37:30 2018
(r342483)
+++ stable/10/sys/dev/sfxge/common/ef10_nic.c   Wed Dec 26 09:38:50 2018
(r342484)
@@ -1117,6 +1117,16 @@ ef10_get_datapath_caps(
encp->enc_mac_stats_40g_tx_size_bins =
CAP_FLAG2(flags2, MAC_STATS_40G_TX_SIZE_BINS) ? B_TRUE : B_FALSE;
 
+   /*
+* Check if firmware supports VXLAN and NVGRE tunnels.
+* The capability indicates Geneve protocol support as well.
+*/
+   if (CAP_FLAG(flags, VXLAN_NVGRE))
+   encp->enc_tunnel_encapsulations_supported =
+   (1u << EFX_TUNNEL_PROTOCOL_VXLAN) |
+   (1u << EFX_TUNNEL_PROTOCOL_GENEVE) |
+   (1u << EFX_TUNNEL_PROTOCOL_NVGRE);
+
 #undef CAP_FLAG
 #undef CAP_FLAG2
 

Modified: stable/10/sys/dev/sfxge/common/efx.h
==
--- stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 09:37:30 2018
(r342483)
+++ stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 09:38:50 2018
(r342484)
@@ -1085,6 +1085,14 @@ efx_bist_stop(
 #defineEFX_FEATURE_FW_ASSISTED_TSO 0x1000
 #defineEFX_FEATURE_FW_ASSISTED_TSO_V2  0x2000
 
+typedef enum efx_tunnel_protocol_e {
+   EFX_TUNNEL_PROTOCOL_NONE = 0,
+   EFX_TUNNEL_PROTOCOL_VXLAN,
+   EFX_TUNNEL_PROTOCOL_GENEVE,
+   EFX_TUNNEL_PROTOCOL_NVGRE,
+   EFX_TUNNEL_NPROTOS
+} efx_tunnel_protocol_t;
+
 typedef struct efx_nic_cfg_s {
uint32_tenc_board_type;
uint32_tenc_phy_type;
@@ -1182,6 +1190,7 @@ typedef struct efx_nic_cfg_s {
boolean_t   enc_init_evq_v2_supported;
boolean_t   enc_pm_and_rxdp_counters;
boolean_t   enc_mac_stats_40g_tx_size_bins;
+   uint32_tenc_tunnel_encapsulations_supported;
/* External port identifier */
uint8_t enc_external_port;
uint32_tenc_mcdi_max_payload_length;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342483 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 09:37:30 2018
New Revision: 342483
URL: https://svnweb.freebsd.org/changeset/base/342483

Log:
  MFC r340800
  
  sfxge(4): let caller know that queue is already flushed
  
  Tx/Rx queue may be already flushed due to Tx/Rx error on the queue or
  MC reboot. Caller needs to know that the queue is already flushed to
  avoid waiting for flush done event.
  
  Submitted by:   Andy Moreton 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18070

Modified:
  stable/10/sys/dev/sfxge/common/ef10_ev.c
  stable/10/sys/dev/sfxge/common/ef10_rx.c
  stable/10/sys/dev/sfxge/common/ef10_tx.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_ev.c
==
--- stable/10/sys/dev/sfxge/common/ef10_ev.cWed Dec 26 09:36:42 2018
(r342482)
+++ stable/10/sys/dev/sfxge/common/ef10_ev.cWed Dec 26 09:37:30 2018
(r342483)
@@ -434,7 +434,12 @@ efx_mcdi_fini_evq(
return (0);
 
 fail1:
-   EFSYS_PROBE1(fail1, efx_rc_t, rc);
+   /*
+* EALREADY is not an error, but indicates that the MC has rebooted and
+* that the EVQ has already been destroyed.
+*/
+   if (rc != EALREADY)
+   EFSYS_PROBE1(fail1, efx_rc_t, rc);
 
return (rc);
 }

Modified: stable/10/sys/dev/sfxge/common/ef10_rx.c
==
--- stable/10/sys/dev/sfxge/common/ef10_rx.cWed Dec 26 09:36:42 2018
(r342482)
+++ stable/10/sys/dev/sfxge/common/ef10_rx.cWed Dec 26 09:37:30 2018
(r342483)
@@ -130,7 +130,7 @@ efx_mcdi_fini_rxq(
 
efx_mcdi_execute_quiet(enp, &req);
 
-   if ((req.emr_rc != 0) && (req.emr_rc != EALREADY)) {
+   if (req.emr_rc != 0) {
rc = req.emr_rc;
goto fail1;
}
@@ -138,7 +138,12 @@ efx_mcdi_fini_rxq(
return (0);
 
 fail1:
-   EFSYS_PROBE1(fail1, efx_rc_t, rc);
+   /*
+* EALREADY is not an error, but indicates that the MC has rebooted and
+* that the RXQ has already been destroyed.
+*/
+   if (rc != EALREADY)
+   EFSYS_PROBE1(fail1, efx_rc_t, rc);
 
return (rc);
 }
@@ -720,7 +725,14 @@ ef10_rx_qflush(
return (0);
 
 fail1:
-   EFSYS_PROBE1(fail1, efx_rc_t, rc);
+   /*
+* EALREADY is not an error, but indicates that the MC has rebooted and
+* that the RXQ has already been destroyed. Callers need to know that
+* the RXQ flush has completed to avoid waiting until timeout for a
+* flush done event that will not be delivered.
+*/
+   if (rc != EALREADY)
+   EFSYS_PROBE1(fail1, efx_rc_t, rc);
 
return (rc);
 }

Modified: stable/10/sys/dev/sfxge/common/ef10_tx.c
==
--- stable/10/sys/dev/sfxge/common/ef10_tx.cWed Dec 26 09:36:42 2018
(r342482)
+++ stable/10/sys/dev/sfxge/common/ef10_tx.cWed Dec 26 09:37:30 2018
(r342483)
@@ -151,7 +151,7 @@ efx_mcdi_fini_txq(
 
efx_mcdi_execute_quiet(enp, &req);
 
-   if ((req.emr_rc != 0) && (req.emr_rc != EALREADY)) {
+   if (req.emr_rc != 0) {
rc = req.emr_rc;
goto fail1;
}
@@ -159,7 +159,12 @@ efx_mcdi_fini_txq(
return (0);
 
 fail1:
-   EFSYS_PROBE1(fail1, efx_rc_t, rc);
+   /*
+* EALREADY is not an error, but indicates that the MC has rebooted and
+* that the TXQ has already been destroyed.
+*/
+   if (rc != EALREADY)
+   EFSYS_PROBE1(fail1, efx_rc_t, rc);
 
return (rc);
 }
@@ -690,7 +695,14 @@ ef10_tx_qpace(
return (0);
 
 fail1:
-   EFSYS_PROBE1(fail1, efx_rc_t, rc);
+   /*
+* EALREADY is not an error, but indicates that the MC has rebooted and
+* that the TXQ has already been destroyed. Callers need to know that
+* the TXQ flush has completed to avoid waiting until timeout for a
+* flush done event that will not be delivered.
+*/
+   if (rc != EALREADY)
+   EFSYS_PROBE1(fail1, efx_rc_t, rc);
 
return (rc);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342482 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 09:36:42 2018
New Revision: 342482
URL: https://svnweb.freebsd.org/changeset/base/342482

Log:
  MFC r340799
  
  sfxge(4): fix error code usage
  
  MCDI results returned in req.emr_rc have already been translated
  from MC_CMD_ERR_* to errno names, so using an MC_CMD_ERR_* value
  is incorrect.
  
  Submitted by:   Andy Moreton 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18069

Modified:
  stable/10/sys/dev/sfxge/common/ef10_rx.c
  stable/10/sys/dev/sfxge/common/ef10_tx.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_rx.c
==
--- stable/10/sys/dev/sfxge/common/ef10_rx.cWed Dec 26 09:34:26 2018
(r342481)
+++ stable/10/sys/dev/sfxge/common/ef10_rx.cWed Dec 26 09:36:42 2018
(r342482)
@@ -130,7 +130,7 @@ efx_mcdi_fini_rxq(
 
efx_mcdi_execute_quiet(enp, &req);
 
-   if ((req.emr_rc != 0) && (req.emr_rc != MC_CMD_ERR_EALREADY)) {
+   if ((req.emr_rc != 0) && (req.emr_rc != EALREADY)) {
rc = req.emr_rc;
goto fail1;
}

Modified: stable/10/sys/dev/sfxge/common/ef10_tx.c
==
--- stable/10/sys/dev/sfxge/common/ef10_tx.cWed Dec 26 09:34:26 2018
(r342481)
+++ stable/10/sys/dev/sfxge/common/ef10_tx.cWed Dec 26 09:36:42 2018
(r342482)
@@ -151,7 +151,7 @@ efx_mcdi_fini_txq(
 
efx_mcdi_execute_quiet(enp, &req);
 
-   if ((req.emr_rc != 0) && (req.emr_rc != MC_CMD_ERR_EALREADY)) {
+   if ((req.emr_rc != 0) && (req.emr_rc != EALREADY)) {
rc = req.emr_rc;
goto fail1;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342481 - stable/10/sys/dev/sfxge/common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 09:34:26 2018
New Revision: 342481
URL: https://svnweb.freebsd.org/changeset/base/342481

Log:
  MFC r340798
  
  sfxge(4): fix out of bounds read in VIs allocation
  
  Submitted by:   Andy Moreton 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18068

Modified:
  stable/10/sys/dev/sfxge/common/ef10_nic.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_nic.c
==
--- stable/10/sys/dev/sfxge/common/ef10_nic.c   Wed Dec 26 09:33:26 2018
(r342480)
+++ stable/10/sys/dev/sfxge/common/ef10_nic.c   Wed Dec 26 09:34:26 2018
(r342481)
@@ -557,7 +557,7 @@ efx_mcdi_alloc_vis(
 {
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_ALLOC_VIS_IN_LEN,
-   MC_CMD_ALLOC_VIS_OUT_LEN)];
+   MC_CMD_ALLOC_VIS_EXT_OUT_LEN)];
efx_rc_t rc;
 
if (vi_countp == NULL) {
@@ -570,7 +570,7 @@ efx_mcdi_alloc_vis(
req.emr_in_buf = payload;
req.emr_in_length = MC_CMD_ALLOC_VIS_IN_LEN;
req.emr_out_buf = payload;
-   req.emr_out_length = MC_CMD_ALLOC_VIS_OUT_LEN;
+   req.emr_out_length = MC_CMD_ALLOC_VIS_EXT_OUT_LEN;
 
MCDI_IN_SET_DWORD(req, ALLOC_VIS_IN_MIN_VI_COUNT, min_vi_count);
MCDI_IN_SET_DWORD(req, ALLOC_VIS_IN_MAX_VI_COUNT, max_vi_count);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342480 - in stable/10/sys/dev/sfxge: . common

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 09:33:26 2018
New Revision: 342480
URL: https://svnweb.freebsd.org/changeset/base/342480

Log:
  MFC r340767
  
  sfxge(4): limit max TXQ size on Medford to 2048
  
  Queues with 4096 descriptors are not supported as the top bit is used
  for vfifo stuffing.
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D8948

Modified:
  stable/10/sys/dev/sfxge/common/ef10_tx.c   (contents, props changed)
  stable/10/sys/dev/sfxge/common/efx.h
  stable/10/sys/dev/sfxge/common/efx_tx.c
  stable/10/sys/dev/sfxge/common/hunt_nic.c
  stable/10/sys/dev/sfxge/common/medford_nic.c
  stable/10/sys/dev/sfxge/common/siena_nic.c
  stable/10/sys/dev/sfxge/sfxge.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_tx.c
==
--- stable/10/sys/dev/sfxge/common/ef10_tx.cWed Dec 26 09:32:30 2018
(r342479)
+++ stable/10/sys/dev/sfxge/common/ef10_tx.cWed Dec 26 09:33:26 2018
(r342480)
@@ -67,7 +67,7 @@ efx_mcdi_init_txq(
efx_rc_t rc;
 
EFSYS_ASSERT(EFX_TXQ_MAX_BUFS >=
-   EFX_TXQ_NBUFS(EFX_TXQ_MAXNDESCS(&enp->en_nic_cfg)));
+   EFX_TXQ_NBUFS(enp->en_nic_cfg.enc_txq_max_ndescs));
 
npages = EFX_TXQ_NBUFS(size);
if (npages > MC_CMD_INIT_TXQ_IN_DMA_ADDR_MAXNUM) {

Modified: stable/10/sys/dev/sfxge/common/efx.h
==
--- stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 09:32:30 2018
(r342479)
+++ stable/10/sys/dev/sfxge/common/efx.hWed Dec 26 09:33:26 2018
(r342480)
@@ -1105,6 +1105,7 @@ typedef struct efx_nic_cfg_s {
uint32_tenc_evq_limit;
uint32_tenc_txq_limit;
uint32_tenc_rxq_limit;
+   uint32_tenc_txq_max_ndescs;
uint32_tenc_buftbl_limit;
uint32_tenc_piobuf_limit;
uint32_tenc_piobuf_size;
@@ -1974,12 +1975,6 @@ efx_tx_init(
 extern void
 efx_tx_fini(
__inefx_nic_t *enp);
-
-#defineEFX_BUG35388_WORKAROUND(_encp)  
\
-   (((_encp) == NULL) ? 1 : ((_encp)->enc_bug35388_workaround != 0))
-
-#defineEFX_TXQ_MAXNDESCS(_encp)
\
-   ((EFX_BUG35388_WORKAROUND(_encp)) ? 2048 : 4096)
 
 #defineEFX_TXQ_MINNDESCS   512
 

Modified: stable/10/sys/dev/sfxge/common/efx_tx.c
==
--- stable/10/sys/dev/sfxge/common/efx_tx.c Wed Dec 26 09:32:30 2018
(r342479)
+++ stable/10/sys/dev/sfxge/common/efx_tx.c Wed Dec 26 09:33:26 2018
(r342480)
@@ -911,7 +911,7 @@ siena_tx_qcreate(
(1 << FRF_AZ_TX_DESCQ_LABEL_WIDTH));
EFSYS_ASSERT3U(label, <, EFX_EV_TX_NLABELS);
 
-   EFSYS_ASSERT(ISP2(EFX_TXQ_MAXNDESCS(encp)));
+   EFSYS_ASSERT(ISP2(encp->enc_txq_max_ndescs));
EFX_STATIC_ASSERT(ISP2(EFX_TXQ_MINNDESCS));
 
if (!ISP2(n) || (n < EFX_TXQ_MINNDESCS) || (n > EFX_EVQ_MAXNEVS)) {
@@ -923,7 +923,7 @@ siena_tx_qcreate(
goto fail2;
}
for (size = 0;
-   (1 << size) <= (EFX_TXQ_MAXNDESCS(encp) / EFX_TXQ_MINNDESCS);
+   (1 << size) <= (int)(encp->enc_txq_max_ndescs / EFX_TXQ_MINNDESCS);
size++)
if ((1 << size) == (int)(n / EFX_TXQ_MINNDESCS))
break;

Modified: stable/10/sys/dev/sfxge/common/hunt_nic.c
==
--- stable/10/sys/dev/sfxge/common/hunt_nic.c   Wed Dec 26 09:32:30 2018
(r342479)
+++ stable/10/sys/dev/sfxge/common/hunt_nic.c   Wed Dec 26 09:33:26 2018
(r342480)
@@ -318,6 +318,12 @@ hunt_board_cfg(
encp->enc_rxq_limit = EFX_RXQ_LIMIT_TARGET;
encp->enc_txq_limit = EFX_TXQ_LIMIT_TARGET;
 
+   /*
+* The workaround for bug35388 uses the top bit of transmit queue
+* descriptor writes, preventing the use of 4096 descriptor TXQs.
+*/
+   encp->enc_txq_max_ndescs = encp->enc_bug35388_workaround ? 2048 : 4096;
+
encp->enc_buftbl_limit = 0x;
 
encp->enc_piobuf_limit = HUNT_PIOBUF_NBUFS;

Modified: stable/10/sys/dev/sfxge/common/medford_nic.c
==
--- stable/10/sys/dev/sfxge/common/medford_nic.cWed Dec 26 09:32:30 
2018(r342479)
+++ stable/10/sys/dev/sfxge/common/medford_nic.cWed Dec 26 09:33:26 
2018(r342480)
@@ -315,6 +315,13 @@ medford_board_cfg(
encp->enc_rxq_limit = EFX_RXQ_LIMIT_TARGET;
encp->enc_txq_limit = EFX_TXQ_LIMIT_TARGET;
 
+   /*
+

svn commit: r342479 - stable/10/sys/dev/sfxge

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 09:32:30 2018
New Revision: 342479
URL: https://svnweb.freebsd.org/changeset/base/342479

Log:
  MFC r312885
  
  sfxge(4): compact the first hot part of RxQ control
  
  buf_base_id is used on RxQ control operations only and not used on
  datapath.
  
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/10/sys/dev/sfxge/sfxge_rx.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/sfxge_rx.h
==
--- stable/10/sys/dev/sfxge/sfxge_rx.h  Wed Dec 26 09:31:36 2018
(r342478)
+++ stable/10/sys/dev/sfxge/sfxge_rx.h  Wed Dec 26 09:32:30 2018
(r342479)
@@ -155,7 +155,6 @@ struct sfxge_rxq {
struct sfxge_softc  *sc __aligned(CACHE_LINE_SIZE);
unsigned intindex;
efsys_mem_t mem;
-   unsigned intbuf_base_id;
enum sfxge_rxq_stateinit_state;
unsigned intentries;
unsigned intptr_mask;
@@ -175,6 +174,7 @@ struct sfxge_rxq {
unsigned intrefill_delay;
 
volatile enum sfxge_flush_state flush_state __aligned(CACHE_LINE_SIZE);
+   unsigned intbuf_base_id;
 };
 
 /*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342478 - stable/10/sys/dev/sfxge

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 09:31:36 2018
New Revision: 342478
URL: https://svnweb.freebsd.org/changeset/base/342478

Log:
  MFC r312884
  
  sfxge(4): fix RxQ structure layout vs usage on datapath
  
  Recent changes in the pseudo header accessor prototypes start to
  use common code RxQ handle on datapath. The handle was located
  at the end of the structure with members not used on datapath.
  
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D9359

Modified:
  stable/10/sys/dev/sfxge/sfxge_rx.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/sfxge_rx.h
==
--- stable/10/sys/dev/sfxge/sfxge_rx.h  Wed Dec 26 09:30:53 2018
(r342477)
+++ stable/10/sys/dev/sfxge/sfxge_rx.h  Wed Dec 26 09:31:36 2018
(r342478)
@@ -159,6 +159,7 @@ struct sfxge_rxq {
enum sfxge_rxq_stateinit_state;
unsigned intentries;
unsigned intptr_mask;
+   efx_rxq_t   *common;
 
struct sfxge_rx_sw_desc *queue __aligned(CACHE_LINE_SIZE);
unsigned intadded;
@@ -173,8 +174,7 @@ struct sfxge_rxq {
struct callout  refill_callout;
unsigned intrefill_delay;
 
-   efx_rxq_t   *common __aligned(CACHE_LINE_SIZE);
-   volatile enum sfxge_flush_state flush_state;
+   volatile enum sfxge_flush_state flush_state __aligned(CACHE_LINE_SIZE);
 };
 
 /*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342477 - stable/10/sys/dev/sfxge

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 09:30:53 2018
New Revision: 342477
URL: https://svnweb.freebsd.org/changeset/base/342477

Log:
  MFC r312883
  
  sfxge(4): fix invalid VLAN tagging after stop/start
  
  TxQ is destroyed on stop and last used tag should be reset to default 0
  on the next start.
  
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D9358

Modified:
  stable/10/sys/dev/sfxge/sfxge_tx.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/sfxge_tx.c
==
--- stable/10/sys/dev/sfxge/sfxge_tx.c  Wed Dec 26 09:30:06 2018
(r342476)
+++ stable/10/sys/dev/sfxge/sfxge_tx.c  Wed Dec 26 09:30:53 2018
(r342477)
@@ -1604,6 +1604,8 @@ sfxge_tx_qstart(struct sfxge_softc *sc, unsigned int i
txq->max_pkt_desc = sfxge_tx_max_pkt_desc(sc, txq->type,
  tso_fw_assisted);
 
+   txq->hw_vlan_tci = 0;
+
SFXGE_TXQ_UNLOCK(txq);
 
return (0);
@@ -1820,7 +1822,6 @@ sfxge_tx_qinit(struct sfxge_softc *sc, unsigned int tx
txq->type = type;
txq->evq_index = evq_index;
txq->init_state = SFXGE_TXQ_INITIALIZED;
-   txq->hw_vlan_tci = 0;
 
return (0);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342476 - stable/10/sys/dev/sfxge

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 09:30:06 2018
New Revision: 342476
URL: https://svnweb.freebsd.org/changeset/base/342476

Log:
  MFC r312868
  
  sfxge(4): cleanup: remove unused soft context struct member rxq_cache
  
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/10/sys/dev/sfxge/sfxge.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/sfxge.h
==
--- stable/10/sys/dev/sfxge/sfxge.h Wed Dec 26 09:29:26 2018
(r342475)
+++ stable/10/sys/dev/sfxge/sfxge.h Wed Dec 26 09:30:06 2018
(r342476)
@@ -301,7 +301,6 @@ struct sfxge_softc {
 #endif
 
unsigned intmax_rss_channels;
-   uma_zone_t  rxq_cache;
struct sfxge_rxq*rxq[SFXGE_RX_SCALE_MAX];
unsigned intrx_indir_table[EFX_RSS_TBL_SIZE];
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342475 - stable/10/sys/dev/sfxge

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 09:29:26 2018
New Revision: 342475
URL: https://svnweb.freebsd.org/changeset/base/342475

Log:
  MFC r312867
  
  sfxge(4): cleanup: remvoe trailing tab
  
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/10/sys/dev/sfxge/sfxge_rx.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/sfxge_rx.c
==
--- stable/10/sys/dev/sfxge/sfxge_rx.c  Wed Dec 26 09:28:40 2018
(r342474)
+++ stable/10/sys/dev/sfxge/sfxge_rx.c  Wed Dec 26 09:29:26 2018
(r342475)
@@ -1096,7 +1096,7 @@ sfxge_rx_start(struct sfxge_softc *sc)
encp = efx_nic_cfg_get(sc->enp);
sc->rx_buffer_size = EFX_MAC_PDU(sc->ifnet->if_mtu);
 
-   /* Calculate the receive packet buffer size. */ 
+   /* Calculate the receive packet buffer size. */
sc->rx_prefix_size = encp->enc_rx_prefix_size;
 
/* Ensure IP headers are 32bit aligned */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342474 - stable/10/sys/dev/sfxge

2018-12-26 Thread Andrew Rybchenko
Author: arybchik
Date: Wed Dec 26 09:28:40 2018
New Revision: 342474
URL: https://svnweb.freebsd.org/changeset/base/342474

Log:
  MFC r312866
  
  sfxge(4): cleanup: remove unused txq_index TxQ control structure member
  
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/10/sys/dev/sfxge/sfxge_tx.c
  stable/10/sys/dev/sfxge/sfxge_tx.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/sfxge_tx.c
==
--- stable/10/sys/dev/sfxge/sfxge_tx.c  Wed Dec 26 09:23:13 2018
(r342473)
+++ stable/10/sys/dev/sfxge/sfxge_tx.c  Wed Dec 26 09:28:40 2018
(r342474)
@@ -1819,7 +1819,6 @@ sfxge_tx_qinit(struct sfxge_softc *sc, unsigned int tx
 
txq->type = type;
txq->evq_index = evq_index;
-   txq->txq_index = txq_index;
txq->init_state = SFXGE_TXQ_INITIALIZED;
txq->hw_vlan_tci = 0;
 

Modified: stable/10/sys/dev/sfxge/sfxge_tx.h
==
--- stable/10/sys/dev/sfxge/sfxge_tx.h  Wed Dec 26 09:23:13 2018
(r342473)
+++ stable/10/sys/dev/sfxge/sfxge_tx.h  Wed Dec 26 09:28:40 2018
(r342474)
@@ -172,7 +172,6 @@ struct sfxge_txq {
enum sfxge_flush_state  flush_state;
unsigned inttso_fw_assisted;
enum sfxge_txq_type type;
-   unsigned inttxq_index;
unsigned intevq_index;
efsys_mem_t mem;
unsigned intbuf_base_id;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342455 - stable/11/sys/dev/sfxge

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 07:39:34 2018
New Revision: 342455
URL: https://svnweb.freebsd.org/changeset/base/342455

Log:
  MFC r341785
  
  sfxge(4): use n Tx queues instead of n + 2 on EF10 HW
  
  On EF10 HW we can avoid sending packets without checksum offload
  or with IP-only checksum offload to dedicated queues. Instead, we
  can use option descriptors to change offload policy on any queue
  during runtime. Thus, we don't need to create two dedicated queues.
  
  Submitted by:   Ivan Malov 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18390

Modified:
  stable/11/sys/dev/sfxge/sfxge.c
  stable/11/sys/dev/sfxge/sfxge.h
  stable/11/sys/dev/sfxge/sfxge_ev.c
  stable/11/sys/dev/sfxge/sfxge_tx.c
  stable/11/sys/dev/sfxge/sfxge_tx.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/sfxge.c
==
--- stable/11/sys/dev/sfxge/sfxge.c Tue Dec 25 07:38:46 2018
(r342454)
+++ stable/11/sys/dev/sfxge/sfxge.c Tue Dec 25 07:39:34 2018
(r342455)
@@ -760,6 +760,11 @@ sfxge_create(struct sfxge_softc *sc)
}
sc->rxq_entries = sfxge_rx_ring_entries;
 
+   if (efx_nic_cfg_get(enp)->enc_features & EFX_FEATURE_TXQ_CKSUM_OP_DESC)
+   sc->txq_dynamic_cksum_toggle_supported = B_TRUE;
+   else
+   sc->txq_dynamic_cksum_toggle_supported = B_FALSE;
+
if (!ISP2(sfxge_tx_ring_entries) ||
(sfxge_tx_ring_entries < EFX_TXQ_MINNDESCS) ||
(sfxge_tx_ring_entries > efx_nic_cfg_get(enp)->enc_txq_max_ndescs)) 
{

Modified: stable/11/sys/dev/sfxge/sfxge.h
==
--- stable/11/sys/dev/sfxge/sfxge.h Tue Dec 25 07:38:46 2018
(r342454)
+++ stable/11/sys/dev/sfxge/sfxge.h Tue Dec 25 07:39:34 2018
(r342455)
@@ -290,6 +290,8 @@ struct sfxge_softc {
efx_nic_t   *enp;
efsys_lock_tenp_lock;
 
+   boolean_t   txq_dynamic_cksum_toggle_supported;
+
unsigned intrxq_entries;
unsigned inttxq_entries;
 

Modified: stable/11/sys/dev/sfxge/sfxge_ev.c
==
--- stable/11/sys/dev/sfxge/sfxge_ev.c  Tue Dec 25 07:38:46 2018
(r342454)
+++ stable/11/sys/dev/sfxge/sfxge_ev.c  Tue Dec 25 07:39:34 2018
(r342455)
@@ -267,8 +267,11 @@ sfxge_get_txq_by_label(struct sfxge_evq *evq, enum sfx
 {
unsigned int index;
 
-   KASSERT((evq->index == 0 && label < SFXGE_EVQ0_N_TXQ(evq->sc)) ||
-   (label == SFXGE_TXQ_IP_TCP_UDP_CKSUM), ("unexpected txq label"));
+   KASSERT((evq->sc->txq_dynamic_cksum_toggle_supported) ? (label == 0) :
+   ((evq->index == 0 && label < SFXGE_TXQ_NTYPES) ||
+(label == SFXGE_TXQ_IP_TCP_UDP_CKSUM)),
+   ("unexpected txq label"));
+
index = (evq->index == 0) ?
label : (evq->index - 1 + SFXGE_EVQ0_N_TXQ(evq->sc));
return (evq->sc->txq[index]);

Modified: stable/11/sys/dev/sfxge/sfxge_tx.c
==
--- stable/11/sys/dev/sfxge/sfxge_tx.c  Tue Dec 25 07:38:46 2018
(r342454)
+++ stable/11/sys/dev/sfxge/sfxge_tx.c  Tue Dec 25 07:39:34 2018
(r342455)
@@ -33,7 +33,7 @@
 
 /* Theory of operation:
  *
- * Tx queues allocation and mapping
+ * Tx queues allocation and mapping on Siena
  *
  * One Tx queue with enabled checksum offload is allocated per Rx channel
  * (event queue).  Also 2 Tx queues (one without checksum offload and one
@@ -44,6 +44,17 @@
  * if event queue index is 0, TxQ-index = TxQ-label * [0..SFXGE_TXQ_NTYPES)
  * else TxQ-index = SFXGE_TXQ_NTYPES + EvQ-index - 1
  * See sfxge_get_txq_by_label() sfxge_ev.c
+ *
+ * Tx queue allocation and mapping on EF10
+ *
+ * One Tx queue with enabled checksum offload is allocated per Rx
+ * channel (event queue). Checksum offload on all Tx queues is enabled or
+ * disabled dynamically by inserting option descriptors, so the additional
+ * queues used on Siena are not required.
+ *
+ * TxQ label is always set to zero on EF10 hardware.
+ * So, event queue to Tx queue mapping is simple:
+ * TxQ-index = EvQ-index
  */
 
 #include 
@@ -137,38 +148,75 @@ static void sfxge_tx_qlist_post(struct sfxge_txq *txq)
 static void sfxge_tx_qunblock(struct sfxge_txq *txq);
 static int sfxge_tx_queue_tso(struct sfxge_txq *txq, struct mbuf *mbuf,
  const bus_dma_segment_t *dma_seg, int n_dma_seg,
- int vlan_tagged);
+ int n_extra_descs);
 
+static inline void
+sfxge_next_stmp(struct sfxge_txq *txq, struct sfxge_tx_mapping **pstmp)
+{
+   KASSERT((*pstmp)->flags == 

svn commit: r342454 - stable/11/sys/dev/sfxge

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 07:38:46 2018
New Revision: 342454
URL: https://svnweb.freebsd.org/changeset/base/342454

Log:
  MFC r341784
  
  sfxge(4): prepare the number of Tx queues on event queue 0 to become
  variable
  
  The number of Tx queues on event queue 0 can depend on the NIC family
  type, and this property will be leveraged by future patches.
  This patch prepares the code for this change.
  
  Submitted by:   Ivan Malov 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18389

Modified:
  stable/11/sys/dev/sfxge/sfxge.c
  stable/11/sys/dev/sfxge/sfxge_ev.c
  stable/11/sys/dev/sfxge/sfxge_tx.c
  stable/11/sys/dev/sfxge/sfxge_tx.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/sfxge.c
==
--- stable/11/sys/dev/sfxge/sfxge.c Tue Dec 25 07:37:42 2018
(r342453)
+++ stable/11/sys/dev/sfxge/sfxge.c Tue Dec 25 07:38:46 2018
(r342454)
@@ -149,8 +149,8 @@ sfxge_estimate_rsrc_limits(struct sfxge_softc *sc)
 
limits.edl_min_evq_count = 1;
limits.edl_max_evq_count = evq_max;
-   limits.edl_min_txq_count = SFXGE_TXQ_NTYPES;
-   limits.edl_max_txq_count = evq_max + SFXGE_TXQ_NTYPES - 1;
+   limits.edl_min_txq_count = SFXGE_EVQ0_N_TXQ(sc);
+   limits.edl_max_txq_count = evq_max + SFXGE_EVQ0_N_TXQ(sc) - 1;
limits.edl_min_rxq_count = 1;
limits.edl_max_rxq_count = evq_max;
 
@@ -166,12 +166,12 @@ sfxge_estimate_rsrc_limits(struct sfxge_softc *sc)
return (rc);
}
 
-   KASSERT(txq_allocated >= SFXGE_TXQ_NTYPES,
-   ("txq_allocated < SFXGE_TXQ_NTYPES"));
+   KASSERT(txq_allocated >= SFXGE_EVQ0_N_TXQ(sc),
+   ("txq_allocated < %u", SFXGE_EVQ0_N_TXQ(sc)));
 
sc->evq_max = MIN(evq_allocated, evq_max);
sc->evq_max = MIN(rxq_allocated, sc->evq_max);
-   sc->evq_max = MIN(txq_allocated - (SFXGE_TXQ_NTYPES - 1),
+   sc->evq_max = MIN(txq_allocated - (SFXGE_EVQ0_N_TXQ(sc) - 1),
  sc->evq_max);
 
KASSERT(sc->evq_max <= evq_max,
@@ -203,7 +203,7 @@ sfxge_set_drv_limits(struct sfxge_softc *sc)
limits.edl_min_evq_count = limits.edl_max_evq_count =
sc->intr.n_alloc;
limits.edl_min_txq_count = limits.edl_max_txq_count =
-   sc->intr.n_alloc + SFXGE_TXQ_NTYPES - 1;
+   sc->intr.n_alloc + SFXGE_EVQ0_N_TXQ(sc) - 1;
limits.edl_min_rxq_count = limits.edl_max_rxq_count =
sc->intr.n_alloc;
 

Modified: stable/11/sys/dev/sfxge/sfxge_ev.c
==
--- stable/11/sys/dev/sfxge/sfxge_ev.c  Tue Dec 25 07:37:42 2018
(r342453)
+++ stable/11/sys/dev/sfxge/sfxge_ev.c  Tue Dec 25 07:38:46 2018
(r342454)
@@ -267,9 +267,10 @@ sfxge_get_txq_by_label(struct sfxge_evq *evq, enum sfx
 {
unsigned int index;
 
-   KASSERT((evq->index == 0 && label < SFXGE_TXQ_NTYPES) ||
+   KASSERT((evq->index == 0 && label < SFXGE_EVQ0_N_TXQ(evq->sc)) ||
(label == SFXGE_TXQ_IP_TCP_UDP_CKSUM), ("unexpected txq label"));
-   index = (evq->index == 0) ? label : (evq->index - 1 + SFXGE_TXQ_NTYPES);
+   index = (evq->index == 0) ?
+   label : (evq->index - 1 + SFXGE_EVQ0_N_TXQ(evq->sc));
return (evq->sc->txq[index]);
 }
 

Modified: stable/11/sys/dev/sfxge/sfxge_tx.c
==
--- stable/11/sys/dev/sfxge/sfxge_tx.c  Tue Dec 25 07:37:42 2018
(r342453)
+++ stable/11/sys/dev/sfxge/sfxge_tx.c  Tue Dec 25 07:38:46 2018
(r342454)
@@ -1970,7 +1970,7 @@ sfxge_tx_init(struct sfxge_softc *sc)
goto fail_tx_dpl_put_max;
}
 
-   sc->txq_count = SFXGE_TXQ_NTYPES - 1 + sc->intr.n_alloc;
+   sc->txq_count = SFXGE_EVQ0_N_TXQ(sc) - 1 + sc->intr.n_alloc;
 
sc->tso_fw_assisted = sfxge_tso_fw_assisted;
if ((~encp->enc_features & EFX_FEATURE_FW_ASSISTED_TSO) ||
@@ -1999,9 +1999,9 @@ sfxge_tx_init(struct sfxge_softc *sc)
goto fail2;
 
for (index = 0;
-index < sc->txq_count - SFXGE_TXQ_NTYPES + 1;
+index < sc->txq_count - SFXGE_EVQ0_N_TXQ(sc) + 1;
 index++) {
-   if ((rc = sfxge_tx_qinit(sc, SFXGE_TXQ_NTYPES - 1 + index,
+   if ((rc = sfxge_tx_qinit(sc, SFXGE_EVQ0_N_TXQ(sc) - 1 + index,
SFXGE_TXQ_IP_TCP_UDP_CKSUM, index)) != 0)
goto fail3;
}

Modified: stable/11/sys/dev/sfxge/sfxge_tx.h
==
--- stable/11/sys/dev/sfxge/sfxge_tx.h  Tue Dec 25 07:37:42 2018
(r342453)
+++ stable/11/sys/dev/sfxge/sfxge_tx.h  Tue Dec 25 07:38:46 2018
(r342454)
@@ -137,6 +137,8 @@ enum sfxge_txq_type {
   

svn commit: r342453 - stable/11/sys/dev/sfxge/common

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 07:37:42 2018
New Revision: 342453
URL: https://svnweb.freebsd.org/changeset/base/342453

Log:
  MFC r341783
  
  sfxge(4): report support for Tx checksum op descriptors
  
  FreeBSD driver needs a patch to provide a means for packets
  which do not need checksum offload but have flow ID set
  to avoid hitting only the first Tx queue (which has been used
  for packets not needing checksum offload).
  
  This should be possible on Huntington, Medford or Medford2 chips
  since these support toggling checksum offload on any given queue
  dynamically by means of pushing option descriptors.
  
  The patch for FreeBSD driver will then need a means to figure out
  whether the feature can be used, and testing adapter family might
  not be a good solution.
  
  This patch adds a feature bit specifically to indicate support
  for checksum option descriptors. The new feature bits may have
  more users in future, apart from the mentioned FreeBSD patch.
  
  Submitted by:   Ivan Malov 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18388

Modified:
  stable/11/sys/dev/sfxge/common/efx.h
  stable/11/sys/dev/sfxge/common/efx_nic.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx.h
==
--- stable/11/sys/dev/sfxge/common/efx.hTue Dec 25 07:34:44 2018
(r342452)
+++ stable/11/sys/dev/sfxge/common/efx.hTue Dec 25 07:37:42 2018
(r342453)
@@ -1084,6 +1084,7 @@ efx_bist_stop(
 #defineEFX_FEATURE_PIO_BUFFERS 0x0800
 #defineEFX_FEATURE_FW_ASSISTED_TSO 0x1000
 #defineEFX_FEATURE_FW_ASSISTED_TSO_V2  0x2000
+#defineEFX_FEATURE_TXQ_CKSUM_OP_DESC   0x8000
 
 typedef enum efx_tunnel_protocol_e {
EFX_TUNNEL_PROTOCOL_NONE = 0,

Modified: stable/11/sys/dev/sfxge/common/efx_nic.c
==
--- stable/11/sys/dev/sfxge/common/efx_nic.cTue Dec 25 07:34:44 2018
(r342452)
+++ stable/11/sys/dev/sfxge/common/efx_nic.cTue Dec 25 07:37:42 2018
(r342453)
@@ -215,7 +215,8 @@ efx_nic_create(
EFX_FEATURE_MCDI_DMA |
EFX_FEATURE_PIO_BUFFERS |
EFX_FEATURE_FW_ASSISTED_TSO |
-   EFX_FEATURE_FW_ASSISTED_TSO_V2;
+   EFX_FEATURE_FW_ASSISTED_TSO_V2 |
+   EFX_FEATURE_TXQ_CKSUM_OP_DESC;
break;
 #endif /* EFSYS_OPT_HUNTINGTON */
 
@@ -234,7 +235,8 @@ efx_nic_create(
EFX_FEATURE_MAC_HEADER_FILTERS |
EFX_FEATURE_MCDI_DMA |
EFX_FEATURE_PIO_BUFFERS |
-   EFX_FEATURE_FW_ASSISTED_TSO_V2;
+   EFX_FEATURE_FW_ASSISTED_TSO_V2 |
+   EFX_FEATURE_TXQ_CKSUM_OP_DESC;
break;
 #endif /* EFSYS_OPT_MEDFORD */
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342452 - stable/11/sys/dev/sfxge

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 07:34:44 2018
New Revision: 342452
URL: https://svnweb.freebsd.org/changeset/base/342452

Log:
  MFC r341782
  
  sfxge(4): populate per-event queue stats in sysctl
  
  In order to find out why the first event queue and corresponding
  interrupt is triggered more frequent, it is useful to know which
  events go to each event queue.
  
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18418

Modified:
  stable/11/sys/dev/sfxge/sfxge.h
  stable/11/sys/dev/sfxge/sfxge_ev.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/sfxge.h
==
--- stable/11/sys/dev/sfxge/sfxge.h Tue Dec 25 07:33:45 2018
(r342451)
+++ stable/11/sys/dev/sfxge/sfxge.h Tue Dec 25 07:34:44 2018
(r342452)
@@ -182,6 +182,10 @@ struct sfxge_evq {
unsigned intbuf_base_id;
unsigned intentries;
charlock_name[SFXGE_LOCK_NAME_MAX];
+#if EFSYS_OPT_QSTATS
+   clock_t stats_update_time;
+   uint64_tstats[EV_NQSTATS];
+#endif
 } __aligned(CACHE_LINE_SIZE);
 
 #defineSFXGE_NDESCS1024
@@ -273,6 +277,9 @@ struct sfxge_softc {
struct ifnet*ifnet;
unsigned intif_flags;
struct sysctl_oid   *stats_node;
+#if EFSYS_OPT_QSTATS
+   struct sysctl_oid   *evqs_stats_node;
+#endif
struct sysctl_oid   *txqs_node;
 
struct task task_reset;

Modified: stable/11/sys/dev/sfxge/sfxge_ev.c
==
--- stable/11/sys/dev/sfxge/sfxge_ev.c  Tue Dec 25 07:33:45 2018
(r342451)
+++ stable/11/sys/dev/sfxge/sfxge_ev.c  Tue Dec 25 07:34:44 2018
(r342452)
@@ -441,29 +441,94 @@ sfxge_ev_wake_up(void *arg, uint32_t index)
 #if EFSYS_OPT_QSTATS
 
 static void
+sfxge_evq_stat_update(struct sfxge_evq *evq)
+{
+   clock_t now;
+
+   SFXGE_EVQ_LOCK(evq);
+
+   if (__predict_false(evq->init_state != SFXGE_EVQ_STARTED))
+   goto out;
+
+   now = ticks;
+   if ((unsigned int)(now - evq->stats_update_time) < (unsigned int)hz)
+   goto out;
+
+   evq->stats_update_time = now;
+   efx_ev_qstats_update(evq->common, evq->stats);
+
+out:
+   SFXGE_EVQ_UNLOCK(evq);
+}
+
+static int
+sfxge_evq_stat_handler(SYSCTL_HANDLER_ARGS)
+{
+   struct sfxge_evq *evq = arg1;
+   struct sfxge_softc *sc = evq->sc;
+   unsigned int id = arg2;
+
+   SFXGE_ADAPTER_LOCK(sc);
+
+   sfxge_evq_stat_update(evq);
+
+   SFXGE_ADAPTER_UNLOCK(sc);
+
+   return (SYSCTL_OUT(req, &evq->stats[id], sizeof(evq->stats[id])));
+}
+
+static int
+sfxge_evq_stat_init(struct sfxge_evq *evq)
+{
+   struct sfxge_softc *sc = evq->sc;
+   struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(sc->dev);
+   char name[16];
+   struct sysctl_oid *evq_stats_node;
+   unsigned int id;
+
+   snprintf(name, sizeof(name), "%u", evq->index);
+   evq_stats_node = SYSCTL_ADD_NODE(ctx,
+SYSCTL_CHILDREN(sc->evqs_stats_node),
+OID_AUTO, name, CTLFLAG_RD, NULL, "");
+   if (evq_stats_node == NULL)
+   return (ENOMEM);
+
+   for (id = 0; id < EV_NQSTATS; id++) {
+   SYSCTL_ADD_PROC(
+   ctx, SYSCTL_CHILDREN(evq_stats_node),
+   OID_AUTO, efx_ev_qstat_name(sc->enp, id),
+   CTLTYPE_U64|CTLFLAG_RD,
+   evq, id, sfxge_evq_stat_handler, "Q",
+   "");
+   }
+
+   return (0);
+}
+
+static void
 sfxge_ev_stat_update(struct sfxge_softc *sc)
 {
struct sfxge_evq *evq;
unsigned int index;
clock_t now;
+   unsigned int id;
 
SFXGE_ADAPTER_LOCK(sc);
 
-   if (__predict_false(sc->evq[0]->init_state != SFXGE_EVQ_STARTED))
-   goto out;
-
now = ticks;
if ((unsigned int)(now - sc->ev_stats_update_time) < (unsigned int)hz)
goto out;
 
sc->ev_stats_update_time = now;
 
-   /* Add event counts from each event queue in turn */
+   memset(sc->ev_stats, 0, sizeof(sc->ev_stats));
+
+   /* Update and add event counts from each event queue in turn */
for (index = 0; index < sc->evq_count; index++) {
evq = sc->evq[index];
-   SFXGE_EVQ_LOCK(evq);
-   efx_ev_qstats_update(evq->common, sc->ev_stats);
-   SFXGE_EVQ_UNLOCK(evq);
+   sfxge_evq_stat_update(evq);
+   for (id = 0; id < EV_NQSTATS; id++)
+   sc->ev_stats[id] += evq->stats[id];
}
 out:
SFXGE_ADAPTER_UNLOCK(sc);
@@ -670,7 +

svn commit: r342451 - stable/11/sys/dev/sfxge

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 07:33:45 2018
New Revision: 342451
URL: https://svnweb.freebsd.org/changeset/base/342451

Log:
  MFC r341327
  
  sfxge(4): rollback last seen VLAN TCI if Tx packet is dropped
  
  Early processing of a packet on transmit may change last seen
  VLAN TCI in the queue context. If such a packet is eventually
  dropped, last seen VLAN TCI must be set to its previous value.
  
  Submitted by:   Ivan Malov 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18288

Modified:
  stable/11/sys/dev/sfxge/sfxge_tx.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/sfxge_tx.c
==
--- stable/11/sys/dev/sfxge/sfxge_tx.c  Tue Dec 25 07:33:02 2018
(r342450)
+++ stable/11/sys/dev/sfxge/sfxge_tx.c  Tue Dec 25 07:33:45 2018
(r342451)
@@ -359,6 +359,7 @@ static int sfxge_tx_queue_mbuf(struct sfxge_txq *txq, 
int rc;
int i;
int eop;
+   uint16_t hw_vlan_tci_prev;
int vlan_tagged;
 
KASSERT(!txq->blocked, ("txq->blocked"));
@@ -410,6 +411,8 @@ static int sfxge_tx_queue_mbuf(struct sfxge_txq *txq, 
 
used_map = &stmp->map;
 
+   hw_vlan_tci_prev = txq->hw_vlan_tci;
+
vlan_tagged = sfxge_tx_maybe_insert_tag(txq, mbuf);
if (vlan_tagged) {
sfxge_next_stmp(txq, &stmp);
@@ -461,6 +464,7 @@ static int sfxge_tx_queue_mbuf(struct sfxge_txq *txq, 
return (0);
 
 reject_mapped:
+   txq->hw_vlan_tci = hw_vlan_tci_prev;
bus_dmamap_unload(txq->packet_dma_tag, *used_map);
 reject:
/* Drop the packet on the floor. */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342450 - stable/11/sys/dev/sfxge/common

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 07:33:02 2018
New Revision: 342450
URL: https://svnweb.freebsd.org/changeset/base/342450

Log:
  MFC r341326
  
  sfxge(4): ensure EvQ poll stops when abort is requested
  
  If an event handler requested an abort, only the inner loop was
  guarenteed to be broken out of - the outer loop could continue
  if total == batch.
  
  Fix this by poisoning batch to ensure it is different to total.
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18287

Modified:
  stable/11/sys/dev/sfxge/common/efx_ev.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx_ev.c
==
--- stable/11/sys/dev/sfxge/common/efx_ev.c Tue Dec 25 07:32:18 2018
(r342449)
+++ stable/11/sys/dev/sfxge/common/efx_ev.c Tue Dec 25 07:33:02 2018
(r342450)
@@ -501,6 +501,14 @@ efx_ev_qpoll(
if (should_abort) {
/* Ignore subsequent events */
total = index + 1;
+
+   /*
+* Poison batch to ensure the outer
+* loop is broken out of.
+*/
+   EFSYS_ASSERT(batch <= EFX_EV_BATCH);
+   batch += (EFX_EV_BATCH << 1);
+   EFSYS_ASSERT(total != batch);
break;
}
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342448 - stable/11/sys/dev/sfxge/common

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 07:31:45 2018
New Revision: 342448
URL: https://svnweb.freebsd.org/changeset/base/342448

Log:
  MFC r341309
  
  sfxge(4): fix MAC Tx stats for less or equal to 64 bytes
  
  This statistic should include 64byte and smaller frames.
  Fix EF10 calculation to match Siena code.
  
  Submitted by:   Andy Moreton 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18271

Modified:
  stable/11/sys/dev/sfxge/common/ef10_mac.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/ef10_mac.c
==
--- stable/11/sys/dev/sfxge/common/ef10_mac.c   Tue Dec 25 07:30:53 2018
(r342447)
+++ stable/11/sys/dev/sfxge/common/ef10_mac.c   Tue Dec 25 07:31:45 2018
(r342448)
@@ -611,7 +611,7 @@ ef10_mac_stats_update(
EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_LT64_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_LE_64_PKTS]), &value);
EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_64_PKTS, &value);
-   EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_LE_64_PKTS]), &value);
+   EFSYS_STAT_INCR_QWORD(&(stat[EFX_MAC_TX_LE_64_PKTS]), &value);
 
EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_65_TO_127_PKTS, &value);
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_65_TO_127_PKTS]), &value);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342449 - stable/11/sys/dev/sfxge/common

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 07:32:18 2018
New Revision: 342449
URL: https://svnweb.freebsd.org/changeset/base/342449

Log:
  MFC r341311
  
  sfxge(4): make last byte of module information available
  
  Adjust bounds so the interface supports reading
  the last available byte of data.
  
  Submitted by:   Richard Houldsworth 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18273

Modified:
  stable/11/sys/dev/sfxge/common/efx_phy.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx_phy.c
==
--- stable/11/sys/dev/sfxge/common/efx_phy.cTue Dec 25 07:31:45 2018
(r342448)
+++ stable/11/sys/dev/sfxge/common/efx_phy.cTue Dec 25 07:32:18 2018
(r342449)
@@ -312,7 +312,7 @@ efx_phy_module_get_info(
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT(data != NULL);
 
-   if ((uint32_t)offset + len > 0xff) {
+   if ((uint32_t)offset + len > 0x100) {
rc = EINVAL;
goto fail1;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342447 - stable/11/sys/dev/sfxge/common

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 07:30:53 2018
New Revision: 342447
URL: https://svnweb.freebsd.org/changeset/base/342447

Log:
  MFC r341302
  
  sfxge(4): fix a typo in unicast filter insertion comment
  
  Submitted by:   Ivan Malov 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18264

Modified:
  stable/11/sys/dev/sfxge/common/ef10_filter.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/ef10_filter.c
==
--- stable/11/sys/dev/sfxge/common/ef10_filter.cTue Dec 25 07:30:17 
2018(r342446)
+++ stable/11/sys/dev/sfxge/common/ef10_filter.cTue Dec 25 07:30:53 
2018(r342447)
@@ -1488,7 +1488,7 @@ ef10_filter_reconfigure(
/*
 * Insert or renew unicast filters.
 *
-* Frimware does not perform chaining on unicast filters. As traffic is
+* Firmware does not perform chaining on unicast filters. As traffic is
 * therefore only delivered to the first matching filter, we should
 * always insert the specific filter for our MAC address, to try and
 * ensure we get that traffic.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342446 - stable/11/sys/dev/sfxge/common

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 07:30:17 2018
New Revision: 342446
URL: https://svnweb.freebsd.org/changeset/base/342446

Log:
  MFC r341301
  
  sfxge(4): prevent access to the NIC config before probe
  
  NIC config is initialized during NIC probe.
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18263

Modified:
  stable/11/sys/dev/sfxge/common/efx_nic.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx_nic.c
==
--- stable/11/sys/dev/sfxge/common/efx_nic.cTue Dec 25 07:27:45 2018
(r342445)
+++ stable/11/sys/dev/sfxge/common/efx_nic.cTue Dec 25 07:30:17 2018
(r342446)
@@ -541,6 +541,7 @@ efx_nic_cfg_get(
__inefx_nic_t *enp)
 {
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+   EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
 
return (&(enp->en_nic_cfg));
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342445 - stable/11/sys/dev/sfxge/common

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 07:27:45 2018
New Revision: 342445
URL: https://svnweb.freebsd.org/changeset/base/342445

Log:
  MFC r341297
  
  sfxge(4): fix out of bounds read when dereferencing sdup
  
  Introduce and use macro to make sure that MCDI buffers allocated
  on stack are rounded up properly.
  
  Submitted by:   Gautam Dawar 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18259

Modified:
  stable/11/sys/dev/sfxge/common/ef10_ev.c
  stable/11/sys/dev/sfxge/common/ef10_filter.c
  stable/11/sys/dev/sfxge/common/ef10_intr.c
  stable/11/sys/dev/sfxge/common/ef10_mac.c
  stable/11/sys/dev/sfxge/common/ef10_nic.c
  stable/11/sys/dev/sfxge/common/ef10_phy.c
  stable/11/sys/dev/sfxge/common/ef10_rx.c
  stable/11/sys/dev/sfxge/common/ef10_tx.c
  stable/11/sys/dev/sfxge/common/efx_lic.c
  stable/11/sys/dev/sfxge/common/efx_mcdi.c
  stable/11/sys/dev/sfxge/common/efx_mcdi.h
  stable/11/sys/dev/sfxge/common/efx_nic.c
  stable/11/sys/dev/sfxge/common/efx_nvram.c
  stable/11/sys/dev/sfxge/common/mcdi_mon.c
  stable/11/sys/dev/sfxge/common/medford_nic.c
  stable/11/sys/dev/sfxge/common/siena_mac.c
  stable/11/sys/dev/sfxge/common/siena_nic.c
  stable/11/sys/dev/sfxge/common/siena_nvram.c
  stable/11/sys/dev/sfxge/common/siena_phy.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/ef10_ev.c
==
--- stable/11/sys/dev/sfxge/common/ef10_ev.cTue Dec 25 07:23:33 2018
(r342444)
+++ stable/11/sys/dev/sfxge/common/ef10_ev.cTue Dec 25 07:27:45 2018
(r342445)
@@ -100,11 +100,10 @@ efx_mcdi_set_evq_tmr(
__inuint32_t timer_ns)
 {
efx_mcdi_req_t req;
-   uint8_t payload[MAX(MC_CMD_SET_EVQ_TMR_IN_LEN,
-   MC_CMD_SET_EVQ_TMR_OUT_LEN)];
+   EFX_MCDI_DECLARE_BUF(payload, MC_CMD_SET_EVQ_TMR_IN_LEN,
+   MC_CMD_SET_EVQ_TMR_OUT_LEN);
efx_rc_t rc;
 
-   (void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_SET_EVQ_TMR;
req.emr_in_buf = payload;
req.emr_in_length = MC_CMD_SET_EVQ_TMR_IN_LEN;
@@ -150,9 +149,9 @@ efx_mcdi_init_evq(
__inboolean_t low_latency)
 {
efx_mcdi_req_t req;
-   uint8_t payload[
-   MAX(MC_CMD_INIT_EVQ_IN_LEN(EFX_EVQ_NBUFS(EFX_EVQ_MAXNEVS)),
-   MC_CMD_INIT_EVQ_OUT_LEN)];
+   EFX_MCDI_DECLARE_BUF(payload,
+   MC_CMD_INIT_EVQ_IN_LEN(EFX_EVQ_NBUFS(EFX_EVQ_MAXNEVS)),
+   MC_CMD_INIT_EVQ_OUT_LEN);
efx_qword_t *dma_addr;
uint64_t addr;
int npages;
@@ -167,7 +166,6 @@ efx_mcdi_init_evq(
goto fail1;
}
 
-   (void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_INIT_EVQ;
req.emr_in_buf = payload;
req.emr_in_length = MC_CMD_INIT_EVQ_IN_LEN(npages);
@@ -287,9 +285,9 @@ efx_mcdi_init_evq_v2(
__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)];
+   EFX_MCDI_DECLARE_BUF(payload,
+   MC_CMD_INIT_EVQ_V2_IN_LEN(EFX_EVQ_NBUFS(EFX_EVQ_MAXNEVS)),
+   MC_CMD_INIT_EVQ_V2_OUT_LEN);
boolean_t interrupting;
unsigned int evq_type;
efx_qword_t *dma_addr;
@@ -304,7 +302,6 @@ efx_mcdi_init_evq_v2(
goto fail1;
}
 
-   (void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_INIT_EVQ;
req.emr_in_buf = payload;
req.emr_in_length = MC_CMD_INIT_EVQ_V2_IN_LEN(npages);
@@ -411,11 +408,10 @@ efx_mcdi_fini_evq(
__inuint32_t instance)
 {
efx_mcdi_req_t req;
-   uint8_t payload[MAX(MC_CMD_FINI_EVQ_IN_LEN,
-   MC_CMD_FINI_EVQ_OUT_LEN)];
+   EFX_MCDI_DECLARE_BUF(payload, MC_CMD_FINI_EVQ_IN_LEN,
+   MC_CMD_FINI_EVQ_OUT_LEN);
efx_rc_t rc;
 
-   (void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_FINI_EVQ;
req.emr_in_buf = payload;
req.emr_in_length = MC_CMD_FINI_EVQ_IN_LEN;
@@ -627,8 +623,8 @@ efx_mcdi_driver_event(
__inefx_qword_t data)
 {
efx_mcdi_req_t req;
-   uint8_t payload[MAX(MC_CMD_DRIVER_EVENT_IN_LEN,
-   MC_CMD_DRIVER_EVENT_OUT_LEN)];
+   EFX_MCDI_DECLARE_BUF(payload, MC_CMD_DRIVER_EVENT_IN_LEN,
+   MC_CMD_DRIVER_EVENT_OUT_LEN);
efx_rc_t rc;
 
req.emr_cmd = MC_CMD_DRIVER_EVENT;

Modified: stable/11/sys/dev/sfxge/common/ef10_filter.c
==
--- stable/11/sys/dev/sfxge/common/ef10_filter.cTue Dec 25 07:23:33 
2018(r342444)
+++ stable/11/sys/dev/sfxge/common/ef10_filter.cTue Dec 

svn commit: r342444 - stable/11/sys/dev/sfxge/common

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 07:23:33 2018
New Revision: 342444
URL: https://svnweb.freebsd.org/changeset/base/342444

Log:
  MFC r341295
  
  sfxge(4): avoid usage of too big arrays on stack
  
  Found by PreFAST static analysis.
  
  Submitted by:   Martin Harvey 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18257

Modified:
  stable/11/sys/dev/sfxge/common/ef10_phy.c
  stable/11/sys/dev/sfxge/common/efx_nvram.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/ef10_phy.c
==
--- stable/11/sys/dev/sfxge/common/ef10_phy.c   Tue Dec 25 07:23:04 2018
(r342443)
+++ stable/11/sys/dev/sfxge/common/ef10_phy.c   Tue Dec 25 07:23:33 2018
(r342444)
@@ -528,14 +528,26 @@ ef10_bist_poll(
unsigned long *valuesp,
__insize_t count)
 {
+   /*
+* MCDI_CTL_SDU_LEN_MAX_V1 is large enough cover all BIST results,
+* whilst not wasting stack.
+*/
+   uint8_t payload[MAX(MC_CMD_POLL_BIST_IN_LEN, MCDI_CTL_SDU_LEN_MAX_V1)];
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;
 
+   EFX_STATIC_ASSERT(MC_CMD_POLL_BIST_OUT_LEN <=
+   MCDI_CTL_SDU_LEN_MAX_V1);
+   EFX_STATIC_ASSERT(MC_CMD_POLL_BIST_OUT_SFT9001_LEN <=
+   MCDI_CTL_SDU_LEN_MAX_V1);
+   EFX_STATIC_ASSERT(MC_CMD_POLL_BIST_OUT_MRSFP_LEN <=
+   MCDI_CTL_SDU_LEN_MAX_V1);
+   EFX_STATIC_ASSERT(MC_CMD_POLL_BIST_OUT_MEM_LEN <=
+   MCDI_CTL_SDU_LEN_MAX_V1);
+
_NOTE(ARGUNUSED(type))
 
(void) memset(payload, 0, sizeof (payload));
@@ -543,7 +555,7 @@ ef10_bist_poll(
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;
+   req.emr_out_length = MCDI_CTL_SDU_LEN_MAX_V1;
 
efx_mcdi_execute(enp, &req);
 

Modified: stable/11/sys/dev/sfxge/common/efx_nvram.c
==
--- stable/11/sys/dev/sfxge/common/efx_nvram.c  Tue Dec 25 07:23:04 2018
(r342443)
+++ stable/11/sys/dev/sfxge/common/efx_nvram.c  Tue Dec 25 07:23:33 2018
(r342444)
@@ -862,23 +862,27 @@ efx_mcdi_nvram_write(
__insize_t size)
 {
efx_mcdi_req_t req;
-   uint8_t payload[MAX(MCDI_CTL_SDU_LEN_MAX_V1,
-   MCDI_CTL_SDU_LEN_MAX_V2)];
+   uint8_t *payload;
efx_rc_t rc;
size_t max_data_size;
+   size_t payload_len = enp->en_nic_cfg.enc_mcdi_max_payload_length;
 
-   max_data_size = enp->en_nic_cfg.enc_mcdi_max_payload_length
-   - MC_CMD_NVRAM_WRITE_IN_LEN(0);
-   EFSYS_ASSERT3U(enp->en_nic_cfg.enc_mcdi_max_payload_length, >, 0);
-   EFSYS_ASSERT3U(max_data_size, <,
-   enp->en_nic_cfg.enc_mcdi_max_payload_length);
+   max_data_size = payload_len - MC_CMD_NVRAM_WRITE_IN_LEN(0);
+   EFSYS_ASSERT3U(payload_len, >, 0);
+   EFSYS_ASSERT3U(max_data_size, <, payload_len);
 
if (size > max_data_size) {
rc = EINVAL;
goto fail1;
}
 
-   (void) memset(payload, 0, sizeof (payload));
+   EFSYS_KMEM_ALLOC(enp->en_esip, payload_len, payload);
+   if (payload == NULL) {
+   rc = ENOMEM;
+   goto fail2;
+   }
+
+   (void) memset(payload, 0, payload_len);
req.emr_cmd = MC_CMD_NVRAM_WRITE;
req.emr_in_buf = payload;
req.emr_in_length = MC_CMD_NVRAM_WRITE_IN_LEN(size);
@@ -896,11 +900,16 @@ efx_mcdi_nvram_write(
 
if (req.emr_rc != 0) {
rc = req.emr_rc;
-   goto fail2;
+   goto fail3;
}
 
+   EFSYS_KMEM_FREE(enp->en_esip, payload_len, payload);
+
return (0);
 
+fail3:
+   EFSYS_PROBE(fail3);
+   EFSYS_KMEM_FREE(enp->en_esip, payload_len, payload);
 fail2:
EFSYS_PROBE(fail2);
 fail1:
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342443 - stable/11/sys/dev/sfxge/common

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 07:23:04 2018
New Revision: 342443
URL: https://svnweb.freebsd.org/changeset/base/342443

Log:
  MFC r341290
  
  sfxge(4): check size of memory to read sensors data to
  
  Size of provided memory should be consistent with specified size.
  
  Submitted by:   Martin Harvey 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18252

Modified:
  stable/11/sys/dev/sfxge/common/mcdi_mon.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/mcdi_mon.c
==
--- stable/11/sys/dev/sfxge/common/mcdi_mon.c   Tue Dec 25 07:22:24 2018
(r342442)
+++ stable/11/sys/dev/sfxge/common/mcdi_mon.c   Tue Dec 25 07:23:04 2018
(r342443)
@@ -322,7 +322,13 @@ efx_mcdi_read_sensors(
uint8_t payload[MAX(MC_CMD_READ_SENSORS_EXT_IN_LEN,
MC_CMD_READ_SENSORS_EXT_OUT_LEN)];
uint32_t addr_lo, addr_hi;
+   efx_rc_t rc;
 
+   if (EFSYS_MEM_SIZE(esmp) < size) {
+   rc = EINVAL;
+   goto fail1;
+   }
+
req.emr_cmd = MC_CMD_READ_SENSORS;
req.emr_in_buf = payload;
req.emr_in_length = MC_CMD_READ_SENSORS_EXT_IN_LEN;
@@ -339,6 +345,11 @@ efx_mcdi_read_sensors(
efx_mcdi_execute(enp, &req);
 
return (req.emr_rc);
+
+fail1:
+   EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+   return (rc);
 }
 
 static __checkReturn   efx_rc_t
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342442 - stable/11/sys/dev/sfxge/common

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 07:22:24 2018
New Revision: 342442
URL: https://svnweb.freebsd.org/changeset/base/342442

Log:
  MFC r341215
  
  sfxge(4): fix build because of no declaration
  
  Functions declared in mcdi_mon.h are implemented in mcdi_mon.c.
  The build fails if compiler options require declaration before
  definition.
  
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18246

Modified:
  stable/11/sys/dev/sfxge/common/mcdi_mon.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/mcdi_mon.c
==
--- stable/11/sys/dev/sfxge/common/mcdi_mon.c   Tue Dec 25 07:21:35 2018
(r342441)
+++ stable/11/sys/dev/sfxge/common/mcdi_mon.c   Tue Dec 25 07:22:24 2018
(r342442)
@@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$");
 
 #include "efx.h"
 #include "efx_impl.h"
+#include "mcdi_mon.h"
 
 #if EFSYS_OPT_MON_MCDI
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342441 - stable/11/sys/dev/sfxge/common

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 07:21:35 2018
New Revision: 342441
URL: https://svnweb.freebsd.org/changeset/base/342441

Log:
  MFC r341214
  
  sfxge(4): fix SAL annotation for input buffers
  
  Submitted by:   Martin Harvey 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18245

Modified:
  stable/11/sys/dev/sfxge/common/ef10_impl.h
  stable/11/sys/dev/sfxge/common/ef10_nvram.c
  stable/11/sys/dev/sfxge/common/efx_impl.h
  stable/11/sys/dev/sfxge/common/efx_nvram.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/ef10_impl.h
==
--- stable/11/sys/dev/sfxge/common/ef10_impl.h  Tue Dec 25 07:20:41 2018
(r342440)
+++ stable/11/sys/dev/sfxge/common/ef10_impl.h  Tue Dec 25 07:21:35 2018
(r342441)
@@ -440,7 +440,7 @@ ef10_nvram_partn_read(
__inefx_nic_t *enp,
__inuint32_t partn,
__inunsigned int offset,
-   __out_bcount(size)  caddr_t data,
+   __in_bcount(size)   caddr_t data,
__insize_t size);
 
 extern __checkReturn   efx_rc_t

Modified: stable/11/sys/dev/sfxge/common/ef10_nvram.c
==
--- stable/11/sys/dev/sfxge/common/ef10_nvram.c Tue Dec 25 07:20:41 2018
(r342440)
+++ stable/11/sys/dev/sfxge/common/ef10_nvram.c Tue Dec 25 07:21:35 2018
(r342441)
@@ -2000,7 +2000,7 @@ ef10_nvram_partn_write(
__inefx_nic_t *enp,
__inuint32_t partn,
__inunsigned int offset,
-   __out_bcount(size)  caddr_t data,
+   __in_bcount(size)   caddr_t data,
__insize_t size)
 {
size_t chunk;

Modified: stable/11/sys/dev/sfxge/common/efx_impl.h
==
--- stable/11/sys/dev/sfxge/common/efx_impl.h   Tue Dec 25 07:20:41 2018
(r342440)
+++ stable/11/sys/dev/sfxge/common/efx_impl.h   Tue Dec 25 07:21:35 2018
(r342441)
@@ -538,7 +538,7 @@ efx_mcdi_nvram_write(
__inefx_nic_t *enp,
__inuint32_t partn,
__inuint32_t offset,
-   __out_bcount(size)  caddr_t data,
+   __in_bcount(size)   caddr_t data,
__insize_t size);
 
__checkReturn   efx_rc_t

Modified: stable/11/sys/dev/sfxge/common/efx_nvram.c
==
--- stable/11/sys/dev/sfxge/common/efx_nvram.c  Tue Dec 25 07:20:41 2018
(r342440)
+++ stable/11/sys/dev/sfxge/common/efx_nvram.c  Tue Dec 25 07:21:35 2018
(r342441)
@@ -858,7 +858,7 @@ efx_mcdi_nvram_write(
__inefx_nic_t *enp,
__inuint32_t partn,
__inuint32_t offset,
-   __out_bcount(size)  caddr_t data,
+   __in_bcount(size)   caddr_t data,
__insize_t size)
 {
efx_mcdi_req_t req;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342440 - stable/11/sys/dev/sfxge/common

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 07:20:41 2018
New Revision: 342440
URL: https://svnweb.freebsd.org/changeset/base/342440

Log:
  MFC r341213
  
  sfxge(4): fix PreFAST warnings because of unused return
  
  Submitted by:   Martin Harvey 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18244

Modified:
  stable/11/sys/dev/sfxge/common/ef10_filter.c
  stable/11/sys/dev/sfxge/common/ef10_mac.c
  stable/11/sys/dev/sfxge/common/ef10_nic.c
  stable/11/sys/dev/sfxge/common/ef10_nvram.c
  stable/11/sys/dev/sfxge/common/ef10_tx.c
  stable/11/sys/dev/sfxge/common/efx_port.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/ef10_filter.c
==
--- stable/11/sys/dev/sfxge/common/ef10_filter.cTue Dec 25 07:19:39 
2018(r342439)
+++ stable/11/sys/dev/sfxge/common/ef10_filter.cTue Dec 25 07:20:41 
2018(r342440)
@@ -1054,12 +1054,15 @@ ef10_filter_insert_unicast(
efx_filter_spec_init_rx(&spec, EFX_FILTER_PRI_AUTO,
filter_flags,
eftp->eft_default_rxq);
-   efx_filter_spec_set_eth_local(&spec, EFX_FILTER_SPEC_VID_UNSPEC, addr);
+   rc = efx_filter_spec_set_eth_local(&spec, EFX_FILTER_SPEC_VID_UNSPEC,
+   addr);
+   if (rc != 0)
+   goto fail1;
 
rc = ef10_filter_add_internal(enp, &spec, B_TRUE,
&eftp->eft_unicst_filter_indexes[eftp->eft_unicst_filter_count]);
if (rc != 0)
-   goto fail1;
+   goto fail2;
 
eftp->eft_unicst_filter_count++;
EFSYS_ASSERT(eftp->eft_unicst_filter_count <=
@@ -1067,6 +1070,8 @@ ef10_filter_insert_unicast(
 
return (0);
 
+fail2:
+   EFSYS_PROBE(fail2);
 fail1:
EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
@@ -1085,11 +1090,13 @@ ef10_filter_insert_all_unicast(
efx_filter_spec_init_rx(&spec, EFX_FILTER_PRI_AUTO,
filter_flags,
eftp->eft_default_rxq);
-   efx_filter_spec_set_uc_def(&spec);
+   rc = efx_filter_spec_set_uc_def(&spec);
+   if (rc != 0)
+   goto fail1;
rc = ef10_filter_add_internal(enp, &spec, B_TRUE,
&eftp->eft_unicst_filter_indexes[eftp->eft_unicst_filter_count]);
if (rc != 0)
-   goto fail1;
+   goto fail2;
 
eftp->eft_unicst_filter_count++;
EFSYS_ASSERT(eftp->eft_unicst_filter_count <=
@@ -1097,6 +1104,8 @@ ef10_filter_insert_all_unicast(
 
return (0);
 
+fail2:
+   EFSYS_PROBE(fail2);
 fail1:
EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
@@ -1138,9 +1147,21 @@ ef10_filter_insert_multicast_list(
filter_flags,
eftp->eft_default_rxq);
 
-   efx_filter_spec_set_eth_local(&spec,
+   rc = efx_filter_spec_set_eth_local(&spec,
EFX_FILTER_SPEC_VID_UNSPEC,
&addrs[i * EFX_MAC_ADDR_LEN]);
+   if (rc != 0) {
+   if (rollback == B_TRUE) {
+   /* Only stop upon failure if told to rollback */
+   goto rollback;
+   } else {
+   /*
+* Don't try to add a filter with a corrupt
+* specification.
+*/
+   continue;
+   }
+   }
 
rc = ef10_filter_add_internal(enp, &spec, B_TRUE,
&filter_index);
@@ -1163,8 +1184,12 @@ ef10_filter_insert_multicast_list(
eftp->eft_default_rxq);
 
EFX_MAC_BROADCAST_ADDR_SET(addr);
-   efx_filter_spec_set_eth_local(&spec, EFX_FILTER_SPEC_VID_UNSPEC,
-   addr);
+   rc = efx_filter_spec_set_eth_local(&spec,
+   EFX_FILTER_SPEC_VID_UNSPEC, addr);
+   if ((rc != 0) && (rollback == B_TRUE)) {
+   /* Only stop upon failure if told to rollback */
+   goto rollback;
+   }
 
rc = ef10_filter_add_internal(enp, &spec, B_TRUE,
&filter_index);
@@ -1212,12 +1237,14 @@ ef10_filter_insert_all_multicast(
efx_filter_spec_init_rx(&spec, EFX_FILTER_PRI_AUTO,
filter_flags,
eftp->eft_default_rxq);
-   efx_filter_spec_set_mc_def(&spec);
+   rc = efx_filter_spec_set_mc_def(&spec);
+   if (rc != 0)
+   goto fail1;
 
rc = ef10_filter_add_internal(enp, &spec, B_TRUE,
&eftp->eft_mulcst_filter_indexes[0]);
if (rc != 0)
-   goto fail1;
+   goto fail2;
 
eftp->eft_mulcst_filter_count = 1;
eftp->eft_using_all_mulc

svn commit: r342439 - stable/11/sys/dev/sfxge/common

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 07:19:39 2018
New Revision: 342439
URL: https://svnweb.freebsd.org/changeset/base/342439

Log:
  MFC r341197
  
  sfxge(4): fix comparison always true warning
  
  Loopback type used as bit index has efx_loopback_type_t type
  which is enum. clang complains that it is always true when it
  is compared with qword (64 bit) bits number boundary.
  
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18228

Modified:
  stable/11/sys/dev/sfxge/common/efx_port.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx_port.c
==
--- stable/11/sys/dev/sfxge/common/efx_port.c   Tue Dec 25 07:18:40 2018
(r342438)
+++ stable/11/sys/dev/sfxge/common/efx_port.c   Tue Dec 25 07:19:39 2018
(r342439)
@@ -147,7 +147,7 @@ efx_port_loopback_set(
EFSYS_ASSERT(link_mode < EFX_LINK_NMODES);
 
if (EFX_TEST_QWORD_BIT(encp->enc_loopback_types[link_mode],
-   loopback_type) == 0) {
+   (int)loopback_type) == 0) {
rc = ENOTSUP;
goto fail1;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342438 - stable/11/sys/dev/sfxge/common

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 07:18:40 2018
New Revision: 342438
URL: https://svnweb.freebsd.org/changeset/base/342438

Log:
  MFC r341038
  
  sfxge(4): add method to make checksum option descriptors
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18160

Modified:
  stable/11/sys/dev/sfxge/common/ef10_impl.h
  stable/11/sys/dev/sfxge/common/ef10_tx.c
  stable/11/sys/dev/sfxge/common/efx.h
  stable/11/sys/dev/sfxge/common/efx_impl.h
  stable/11/sys/dev/sfxge/common/efx_tx.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/ef10_impl.h
==
--- stable/11/sys/dev/sfxge/common/ef10_impl.h  Tue Dec 25 07:15:51 2018
(r342437)
+++ stable/11/sys/dev/sfxge/common/ef10_impl.h  Tue Dec 25 07:18:40 2018
(r342438)
@@ -759,6 +759,11 @@ ef10_tx_qdesc_vlantci_create(
__inuint16_t vlan_tci,
__out   efx_desc_t *edp);
 
+extern void
+ef10_tx_qdesc_checksum_create(
+   __inefx_txq_t *etp,
+   __inuint16_t flags,
+   __out   efx_desc_t *edp);
 
 #if EFSYS_OPT_QSTATS
 

Modified: stable/11/sys/dev/sfxge/common/ef10_tx.c
==
--- stable/11/sys/dev/sfxge/common/ef10_tx.cTue Dec 25 07:15:51 2018
(r342437)
+++ stable/11/sys/dev/sfxge/common/ef10_tx.cTue Dec 25 07:18:40 2018
(r342438)
@@ -203,7 +203,7 @@ ef10_tx_qcreate(
 {
efx_nic_cfg_t *encp = &enp->en_nic_cfg;
uint16_t inner_csum;
-   efx_qword_t desc;
+   efx_desc_t desc;
efx_rc_t rc;
 
_NOTE(ARGUNUSED(id))
@@ -228,19 +228,9 @@ ef10_tx_qcreate(
 * a no-op TX option descriptor. See bug29981 for details.
 */
*addedp = 1;
-   EFX_POPULATE_QWORD_6(desc,
-   ESF_DZ_TX_DESC_IS_OPT, 1,
-   ESF_DZ_TX_OPTION_TYPE, ESE_DZ_TX_OPTION_DESC_CRC_CSUM,
-   ESF_DZ_TX_OPTION_UDP_TCP_CSUM,
-   (flags & EFX_TXQ_CKSUM_TCPUDP) ? 1 : 0,
-   ESF_DZ_TX_OPTION_IP_CSUM,
-   (flags & EFX_TXQ_CKSUM_IPV4) ? 1 : 0,
-   ESF_DZ_TX_OPTION_INNER_UDP_TCP_CSUM,
-   (flags & EFX_TXQ_CKSUM_INNER_TCPUDP) ? 1 : 0,
-   ESF_DZ_TX_OPTION_INNER_IP_CSUM,
-   (flags & EFX_TXQ_CKSUM_INNER_IPV4) ? 1 : 0);
+   ef10_tx_qdesc_checksum_create(etp, flags, &desc);
 
-   EFSYS_MEM_WRITEQ(etp->et_esmp, 0, &desc);
+   EFSYS_MEM_WRITEQ(etp->et_esmp, 0, &desc.ed_eq);
ef10_tx_qpush(etp, *addedp, 0);
 
return (0);
@@ -700,6 +690,30 @@ ef10_tx_qdesc_vlantci_create(
ESE_DZ_TX_OPTION_DESC_VLAN,
ESF_DZ_TX_VLAN_OP, tci ? 1 : 0,
ESF_DZ_TX_VLAN_TAG1, tci);
+}
+
+   void
+ef10_tx_qdesc_checksum_create(
+   __inefx_txq_t *etp,
+   __inuint16_t flags,
+   __out   efx_desc_t *edp)
+{
+   _NOTE(ARGUNUSED(etp));
+
+   EFSYS_PROBE2(tx_desc_checksum_create, unsigned int, etp->et_index,
+   uint32_t, flags);
+
+   EFX_POPULATE_QWORD_6(edp->ed_eq,
+   ESF_DZ_TX_DESC_IS_OPT, 1,
+   ESF_DZ_TX_OPTION_TYPE, ESE_DZ_TX_OPTION_DESC_CRC_CSUM,
+   ESF_DZ_TX_OPTION_UDP_TCP_CSUM,
+   (flags & EFX_TXQ_CKSUM_TCPUDP) ? 1 : 0,
+   ESF_DZ_TX_OPTION_IP_CSUM,
+   (flags & EFX_TXQ_CKSUM_IPV4) ? 1 : 0,
+   ESF_DZ_TX_OPTION_INNER_UDP_TCP_CSUM,
+   (flags & EFX_TXQ_CKSUM_INNER_TCPUDP) ? 1 : 0,
+   ESF_DZ_TX_OPTION_INNER_IP_CSUM,
+   (flags & EFX_TXQ_CKSUM_INNER_IPV4) ? 1 : 0);
 }
 
 

Modified: stable/11/sys/dev/sfxge/common/efx.h
==
--- stable/11/sys/dev/sfxge/common/efx.hTue Dec 25 07:15:51 2018
(r342437)
+++ stable/11/sys/dev/sfxge/common/efx.hTue Dec 25 07:18:40 2018
(r342438)
@@ -2110,6 +2110,12 @@ efx_tx_qdesc_vlantci_create(
__inuint16_t tci,
__out   efx_desc_t *edp);
 
+extern void
+efx_tx_qdesc_checksum_create(
+   __inefx_txq_t *etp,
+   __inuint16_t flags,
+   __out   efx_desc_t *edp);
+
 #if EFSYS_OPT_QSTATS
 
 #if EFSYS_OPT_NAMES

Modified: stable/11/sys/dev/sfxge/common/efx_impl.h
==
--- stable/11/sys/dev/sfxge/common/efx_impl.h   Tue Dec 25 07:15:51 2018
(r342437)
+++ stable/11/sys/dev/sfxge/common/efx_impl.h   Tue Dec 25 07:18:40 2018
(r342438)
@@ -141,6 +141,8 @@ typedef struct efx_tx_ops_s {
efx_desc_t *, int);
void(*etxo_qdesc_vlantci_create)(efx_txq_t *, uint16_t,
efx_desc_t *);
+   void(*etxo_qdesc_checksum_create)(efx_txq_t *, uint16_t,
+  

svn commit: r342437 - stable/11/sys/dev/sfxge/common

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 07:15:51 2018
New Revision: 342437
URL: https://svnweb.freebsd.org/changeset/base/342437

Log:
  MFC r340896
  
  sfxge(4): remove Falcon-specific concurrency check
  
  Falcon support has been withdrawn from libefx, however, there is still
  an obsolete Falcon-specific assertion that efx_mac_stats_upload()
  and efx_port_poll() aren't concurrent. To be consistent with an overall
  Falcon support revocation it's desirable to remove it.
  
  Fix debug build invalid assertion failure.
  
  Submitted by:   Ivan Malov 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D1813

Modified:
  stable/11/sys/dev/sfxge/common/efx_impl.h
  stable/11/sys/dev/sfxge/common/efx_mac.c
  stable/11/sys/dev/sfxge/common/efx_port.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx_impl.h
==
--- stable/11/sys/dev/sfxge/common/efx_impl.h   Tue Dec 25 07:15:03 2018
(r342436)
+++ stable/11/sys/dev/sfxge/common/efx_impl.h   Tue Dec 25 07:15:51 2018
(r342437)
@@ -285,7 +285,6 @@ typedef struct efx_port_s {
uint32_tep_default_adv_cap_mask;
uint32_tep_phy_cap_mask;
boolean_t   ep_mac_drain;
-   boolean_t   ep_mac_stats_pending;
 #if EFSYS_OPT_BIST
efx_bist_type_t ep_current_bist;
 #endif

Modified: stable/11/sys/dev/sfxge/common/efx_mac.c
==
--- stable/11/sys/dev/sfxge/common/efx_mac.cTue Dec 25 07:15:03 2018
(r342436)
+++ stable/11/sys/dev/sfxge/common/efx_mac.cTue Dec 25 07:15:51 2018
(r342437)
@@ -729,16 +729,9 @@ efx_mac_stats_upload(
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);
EFSYS_ASSERT(emop != NULL);
 
-   /*
-* Don't assert !ep_mac_stats_pending, because the client might
-* have failed to finalise statistics when previously stopping
-* the port.
-*/
if ((rc = emop->emo_stats_upload(enp, esmp)) != 0)
goto fail1;
 
-   epp->ep_mac_stats_pending = B_TRUE;
-
return (0);
 
 fail1:
@@ -798,8 +791,6 @@ efx_mac_stats_update(
EFSYS_ASSERT(emop != NULL);
 
rc = emop->emo_stats_update(enp, esmp, essp, generationp);
-   if (rc == 0)
-   epp->ep_mac_stats_pending = B_FALSE;
 
return (rc);
 }

Modified: stable/11/sys/dev/sfxge/common/efx_port.c
==
--- stable/11/sys/dev/sfxge/common/efx_port.c   Tue Dec 25 07:15:03 2018
(r342436)
+++ stable/11/sys/dev/sfxge/common/efx_port.c   Tue Dec 25 07:15:51 2018
(r342437)
@@ -112,7 +112,6 @@ efx_port_poll(
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);
 
EFSYS_ASSERT(emop != NULL);
-   EFSYS_ASSERT(!epp->ep_mac_stats_pending);
 
if (link_modep == NULL)
link_modep = &ignore_link_mode;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342436 - stable/11/sys/dev/sfxge/common

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 07:15:03 2018
New Revision: 342436
URL: https://svnweb.freebsd.org/changeset/base/342436

Log:
  MFC r340895
  
  sfxge(4): move BIU test code into Siena-specific file
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18129

Modified:
  stable/11/sys/dev/sfxge/common/efx_impl.h
  stable/11/sys/dev/sfxge/common/efx_nic.c
  stable/11/sys/dev/sfxge/common/siena_nic.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx_impl.h
==
--- stable/11/sys/dev/sfxge/common/efx_impl.h   Tue Dec 25 07:14:01 2018
(r342435)
+++ stable/11/sys/dev/sfxge/common/efx_impl.h   Tue Dec 25 07:15:03 2018
(r342436)
@@ -1048,10 +1048,6 @@ struct efx_txq_s {
} while (B_FALSE)
 
 extern __checkReturn   efx_rc_t
-efx_nic_biu_test(
-   __inefx_nic_t *enp);
-
-extern __checkReturn   efx_rc_t
 efx_mac_select(
__inefx_nic_t *enp);
 

Modified: stable/11/sys/dev/sfxge/common/efx_nic.c
==
--- stable/11/sys/dev/sfxge/common/efx_nic.cTue Dec 25 07:14:01 2018
(r342435)
+++ stable/11/sys/dev/sfxge/common/efx_nic.cTue Dec 25 07:15:03 2018
(r342436)
@@ -105,78 +105,6 @@ efx_family(
return (ENOTSUP);
 }
 
-
-#defineEFX_BIU_MAGIC0  0x01234567
-#defineEFX_BIU_MAGIC1  0xfedcba98
-
-   __checkReturn   efx_rc_t
-efx_nic_biu_test(
-   __inefx_nic_t *enp)
-{
-   efx_oword_t oword;
-   efx_rc_t rc;
-
-   /*
-* Write magic values to scratch registers 0 and 1, then
-* verify that the values were written correctly.  Interleave
-* the accesses to ensure that the BIU is not just reading
-* back the cached value that was last written.
-*/
-   EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, EFX_BIU_MAGIC0);
-   EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE);
-
-   EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, EFX_BIU_MAGIC1);
-   EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE);
-
-   EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE);
-   if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != EFX_BIU_MAGIC0) {
-   rc = EIO;
-   goto fail1;
-   }
-
-   EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE);
-   if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != EFX_BIU_MAGIC1) {
-   rc = EIO;
-   goto fail2;
-   }
-
-   /*
-* Perform the same test, with the values swapped.  This
-* ensures that subsequent tests don't start with the correct
-* values already written into the scratch registers.
-*/
-   EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, EFX_BIU_MAGIC1);
-   EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE);
-
-   EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, EFX_BIU_MAGIC0);
-   EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE);
-
-   EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE);
-   if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != EFX_BIU_MAGIC1) {
-   rc = EIO;
-   goto fail3;
-   }
-
-   EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE);
-   if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != EFX_BIU_MAGIC0) {
-   rc = EIO;
-   goto fail4;
-   }
-
-   return (0);
-
-fail4:
-   EFSYS_PROBE(fail4);
-fail3:
-   EFSYS_PROBE(fail3);
-fail2:
-   EFSYS_PROBE(fail2);
-fail1:
-   EFSYS_PROBE1(fail1, efx_rc_t, rc);
-
-   return (rc);
-}
-
 #if EFSYS_OPT_SIENA
 
 static const efx_nic_ops_t __efx_nic_siena_ops = {

Modified: stable/11/sys/dev/sfxge/common/siena_nic.c
==
--- stable/11/sys/dev/sfxge/common/siena_nic.c  Tue Dec 25 07:14:01 2018
(r342435)
+++ stable/11/sys/dev/sfxge/common/siena_nic.c  Tue Dec 25 07:15:03 2018
(r342436)
@@ -211,6 +211,77 @@ fail1:
return (rc);
 }
 
+#defineSIENA_BIU_MAGIC00x01234567
+#defineSIENA_BIU_MAGIC10xfedcba98
+
+static __checkReturn   efx_rc_t
+siena_nic_biu_test(
+   __inefx_nic_t *enp)
+{
+   efx_oword_t oword;
+   efx_rc_t rc;
+
+   /*
+* Write magic values to scratch registers 0 and 1, then
+* verify that the values were written correctly.  Interleave
+* the accesses to ensure that the BIU is not just reading
+* back the cached value that was last written.
+*/
+   EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, SIENA_BIU_MAGIC0);
+   EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE);
+
+   EFX_POPULAT

svn commit: r342435 - stable/11/sys/dev/sfxge/common

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 07:14:01 2018
New Revision: 342435
URL: https://svnweb.freebsd.org/changeset/base/342435

Log:
  MFC r340894
  
  sfxge(4): fix PreFAST static analysis warning (C6001)
  
  Fix warning
  "C6001: Using uninitialized memory '*sensor_maskp'"
  which could occur when the npages argument to efx_mcdi_sensor_info()
  is less than or equal to zero.
  
  Submitted by:   Andrew Lee 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18128

Modified:
  stable/11/sys/dev/sfxge/common/mcdi_mon.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/mcdi_mon.c
==
--- stable/11/sys/dev/sfxge/common/mcdi_mon.c   Tue Dec 25 07:13:30 2018
(r342434)
+++ stable/11/sys/dev/sfxge/common/mcdi_mon.c   Tue Dec 25 07:14:01 2018
(r342435)
@@ -397,6 +397,11 @@ efx_mcdi_sensor_info(
 
EFSYS_ASSERT(sensor_maskp != NULL);
 
+   if (npages < 1) {
+   rc = EINVAL;
+   goto fail1;
+   }
+
for (page = 0; page < npages; page++) {
uint32_t mask;
 
@@ -413,7 +418,7 @@ efx_mcdi_sensor_info(
 
if (req.emr_rc != 0) {
rc = req.emr_rc;
-   goto fail1;
+   goto fail2;
}
 
mask = MCDI_OUT_DWORD(req, SENSOR_INFO_OUT_MASK);
@@ -421,18 +426,20 @@ efx_mcdi_sensor_info(
if ((page != (npages - 1)) &&
((mask & (1U << MC_CMD_SENSOR_PAGE0_NEXT)) == 0)) {
rc = EINVAL;
-   goto fail2;
+   goto fail3;
}
sensor_maskp[page] = mask;
}
 
if (sensor_maskp[npages - 1] & (1U << MC_CMD_SENSOR_PAGE0_NEXT)) {
rc = EINVAL;
-   goto fail3;
+   goto fail4;
}
 
return (0);
 
+fail4:
+   EFSYS_PROBE(fail4);
 fail3:
EFSYS_PROBE(fail3);
 fail2:
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342434 - stable/11/sys/dev/sfxge/common

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 07:13:30 2018
New Revision: 342434
URL: https://svnweb.freebsd.org/changeset/base/342434

Log:
  MFC r340892
  
  sfxge(4): remove obsolete check for pre-Siena hardware
  
  The fail4 label was used twice, so it doesn't need removing.
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18126

Modified:
  stable/11/sys/dev/sfxge/common/efx_rx.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx_rx.c
==
--- stable/11/sys/dev/sfxge/common/efx_rx.c Tue Dec 25 07:12:49 2018
(r342433)
+++ stable/11/sys/dev/sfxge/common/efx_rx.c Tue Dec 25 07:13:30 2018
(r342434)
@@ -1164,10 +1164,6 @@ siena_rx_qcreate(
 
 #if EFSYS_OPT_RX_SCATTER
case EFX_RXQ_TYPE_SCATTER:
-   if (enp->en_family < EFX_FAMILY_SIENA) {
-   rc = EINVAL;
-   goto fail4;
-   }
jumbo = B_TRUE;
break;
 #endif /* EFSYS_OPT_RX_SCATTER */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342432 - stable/11/sys/dev/sfxge/common

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 07:12:08 2018
New Revision: 342432
URL: https://svnweb.freebsd.org/changeset/base/342432

Log:
  MFC r340890
  
  sfxge(4): fix warnings from VS2015 C compiler (C4057)
  
  Fix two level 4 warnings
  "C4057: 'function': 'const uint8_t *' differs in indirection to
  slightly different base types from 'caddr_t'"; no functional changes.
  
  Submitted by:   Andrew Lee 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18124

Modified:
  stable/11/sys/dev/sfxge/common/efx.h
  stable/11/sys/dev/sfxge/common/efx_bootcfg.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx.h
==
--- stable/11/sys/dev/sfxge/common/efx.hTue Dec 25 07:11:08 2018
(r342431)
+++ stable/11/sys/dev/sfxge/common/efx.hTue Dec 25 07:12:08 2018
(r342432)
@@ -1464,13 +1464,13 @@ efx_bootcfg_copy_sector(
 extern efx_rc_t
 efx_bootcfg_read(
__inefx_nic_t *enp,
-   __out_bcount(size)  caddr_t data,
+   __out_bcount(size)  uint8_t *data,
__insize_t size);
 
 extern efx_rc_t
 efx_bootcfg_write(
__inefx_nic_t *enp,
-   __in_bcount(size)   caddr_t data,
+   __in_bcount(size)   uint8_t *data,
__insize_t size);
 
 #endif /* EFSYS_OPT_BOOTCFG */

Modified: stable/11/sys/dev/sfxge/common/efx_bootcfg.c
==
--- stable/11/sys/dev/sfxge/common/efx_bootcfg.cTue Dec 25 07:11:08 
2018(r342431)
+++ stable/11/sys/dev/sfxge/common/efx_bootcfg.cTue Dec 25 07:12:08 
2018(r342432)
@@ -293,7 +293,7 @@ fail1:
efx_rc_t
 efx_bootcfg_read(
__inefx_nic_t *enp,
-   __out_bcount(size)  caddr_t data,
+   __out_bcount(size)  uint8_t *data,
__insize_t size)
 {
uint8_t *payload = NULL;
@@ -356,7 +356,7 @@ efx_bootcfg_read(
goto fail7;
 
/* Verify that the area is correctly formatted and checksummed */
-   rc = efx_bootcfg_verify(enp, (caddr_t)payload, sector_length,
+   rc = efx_bootcfg_verify(enp, payload, sector_length,
&used_bytes);
if (rc != 0 || used_bytes == 0) {
payload[0] = (uint8_t)(~DHCP_END & 0xff);
@@ -433,7 +433,7 @@ fail1:
efx_rc_t
 efx_bootcfg_write(
__inefx_nic_t *enp,
-   __in_bcount(size)   caddr_t data,
+   __in_bcount(size)   uint8_t *data,
__insize_t size)
 {
uint8_t *partn_data;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342433 - stable/11/sys/dev/sfxge/common

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 07:12:49 2018
New Revision: 342433
URL: https://svnweb.freebsd.org/changeset/base/342433

Log:
  MFC r340891
  
  sfxge(4): fix warnings from VS2015 C compiler (C4214)
  
  Fix multiple level 4 warnings
  "C4214: nonstandard extension used: bit field types other than int";
  no functional changes.
  
  Submitted by:   Andrew Lee 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18125

Modified:
  stable/11/sys/dev/sfxge/common/efx.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx.h
==
--- stable/11/sys/dev/sfxge/common/efx.hTue Dec 25 07:12:08 2018
(r342432)
+++ stable/11/sys/dev/sfxge/common/efx.hTue Dec 25 07:12:49 2018
(r342433)
@@ -2159,7 +2159,7 @@ efx_tx_qdestroy(
 /* Filter is for TX */
 #defineEFX_FILTER_FLAG_TX  0x10
 
-typedef unsigned int efx_filter_flags_t;
+typedef uint8_t efx_filter_flags_t;
 
 /*
  * Flags which specify the fields to match on. The values are the same as in 
the
@@ -2216,22 +2216,22 @@ typedef enum efx_filter_priority_s {
  */
 
 typedef struct efx_filter_spec_s {
-   uint32_tefs_match_flags;
-   uint32_tefs_priority:2;
-   uint32_tefs_flags:6;
-   uint32_tefs_dmaq_id:12;
-   uint32_tefs_rss_context;
-   uint16_tefs_outer_vid;
-   uint16_tefs_inner_vid;
-   uint8_t efs_loc_mac[EFX_MAC_ADDR_LEN];
-   uint8_t efs_rem_mac[EFX_MAC_ADDR_LEN];
-   uint16_tefs_ether_type;
-   uint8_t efs_ip_proto;
-   efx_tunnel_protocol_t   efs_encap_type;
-   uint16_tefs_loc_port;
-   uint16_tefs_rem_port;
-   efx_oword_t efs_rem_host;
-   efx_oword_t efs_loc_host;
+   efx_filter_match_flags_tefs_match_flags;
+   uint8_t efs_priority;
+   efx_filter_flags_t  efs_flags;
+   uint16_tefs_dmaq_id;
+   uint32_tefs_rss_context;
+   uint16_tefs_outer_vid;
+   uint16_tefs_inner_vid;
+   uint8_t efs_loc_mac[EFX_MAC_ADDR_LEN];
+   uint8_t efs_rem_mac[EFX_MAC_ADDR_LEN];
+   uint16_tefs_ether_type;
+   uint8_t efs_ip_proto;
+   efx_tunnel_protocol_t   efs_encap_type;
+   uint16_tefs_loc_port;
+   uint16_tefs_rem_port;
+   efx_oword_t efs_rem_host;
+   efx_oword_t efs_loc_host;
 } efx_filter_spec_t;
 
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342431 - stable/11/sys/dev/sfxge/common

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 07:11:08 2018
New Revision: 342431
URL: https://svnweb.freebsd.org/changeset/base/342431

Log:
  MFC r340889
  
  sfxge(4): fix warnings from VS2015 C compiler (C4189)
  
  Fix multiple level 4 warnings
  "C4189: 'xxx': local variable is initialized but not referenced";
  no functional changes.
  
  Submitted by:   Andrew Lee 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18123

Modified:
  stable/11/sys/dev/sfxge/common/ef10_ev.c
  stable/11/sys/dev/sfxge/common/efx_ev.c
  stable/11/sys/dev/sfxge/common/efx_tx.c
  stable/11/sys/dev/sfxge/common/mcdi_mon.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/ef10_ev.c
==
--- stable/11/sys/dev/sfxge/common/ef10_ev.cTue Dec 25 07:07:34 2018
(r342430)
+++ stable/11/sys/dev/sfxge/common/ef10_ev.cTue Dec 25 07:11:08 2018
(r342431)
@@ -576,7 +576,7 @@ ef10_ev_qdestroy(
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
enp->en_family == EFX_FAMILY_MEDFORD);
 
-   (void) efx_mcdi_fini_evq(eep->ee_enp, eep->ee_index);
+   (void) efx_mcdi_fini_evq(enp, eep->ee_index);
 }
 
__checkReturn   efx_rc_t

Modified: stable/11/sys/dev/sfxge/common/efx_ev.c
==
--- stable/11/sys/dev/sfxge/common/efx_ev.c Tue Dec 25 07:07:34 2018
(r342430)
+++ stable/11/sys/dev/sfxge/common/efx_ev.c Tue Dec 25 07:11:08 2018
(r342431)
@@ -226,14 +226,14 @@ efx_ev_qcreate(
__deref_out efx_evq_t **eepp)
 {
const efx_ev_ops_t *eevop = enp->en_eevop;
-   efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
efx_evq_t *eep;
efx_rc_t rc;
 
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_EV);
 
-   EFSYS_ASSERT3U(enp->en_ev_qcount + 1, <, encp->enc_evq_limit);
+   EFSYS_ASSERT3U(enp->en_ev_qcount + 1, <,
+   enp->en_nic_cfg.enc_evq_limit);
 
switch (flags & EFX_EVQ_FLAGS_NOTIFY_MASK) {
case EFX_EVQ_FLAGS_NOTIFY_INTERRUPT:

Modified: stable/11/sys/dev/sfxge/common/efx_tx.c
==
--- stable/11/sys/dev/sfxge/common/efx_tx.c Tue Dec 25 07:07:34 2018
(r342430)
+++ stable/11/sys/dev/sfxge/common/efx_tx.c Tue Dec 25 07:11:08 2018
(r342431)
@@ -301,14 +301,14 @@ efx_tx_qcreate(
__out   unsigned int *addedp)
 {
const efx_tx_ops_t *etxop = enp->en_etxop;
-   efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
efx_txq_t *etp;
efx_rc_t rc;
 
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_TX);
 
-   EFSYS_ASSERT3U(enp->en_tx_qcount + 1, <, encp->enc_txq_limit);
+   EFSYS_ASSERT3U(enp->en_tx_qcount + 1, <,
+   enp->en_nic_cfg.enc_txq_limit);
 
/* Allocate an TXQ object */
EFSYS_KMEM_ALLOC(enp->en_esip, sizeof (efx_txq_t), etp);

Modified: stable/11/sys/dev/sfxge/common/mcdi_mon.c
==
--- stable/11/sys/dev/sfxge/common/mcdi_mon.c   Tue Dec 25 07:07:34 2018
(r342430)
+++ stable/11/sys/dev/sfxge/common/mcdi_mon.c   Tue Dec 25 07:11:08 2018
(r342431)
@@ -265,7 +265,6 @@ mcdi_mon_ev(
__out   efx_mon_stat_value_t *valuep)
 {
efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
-   efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
uint16_t port_mask;
uint16_t sensor;
uint16_t state;
@@ -281,11 +280,13 @@ mcdi_mon_ev(
value = (uint16_t)MCDI_EV_FIELD(eqp, SENSOREVT_VALUE);
 
/* Hardware must support this MCDI sensor */
-   EFSYS_ASSERT3U(sensor, <, (8 * encp->enc_mcdi_sensor_mask_size));
+   EFSYS_ASSERT3U(sensor, <,
+   (8 * enp->en_nic_cfg.enc_mcdi_sensor_mask_size));
EFSYS_ASSERT((sensor % MCDI_MON_PAGE_SIZE) != MC_CMD_SENSOR_PAGE0_NEXT);
-   EFSYS_ASSERT(encp->enc_mcdi_sensor_maskp != NULL);
-   EFSYS_ASSERT((encp->enc_mcdi_sensor_maskp[sensor / MCDI_MON_PAGE_SIZE] &
-   (1U << (sensor % MCDI_MON_PAGE_SIZE))) != 0);
+   EFSYS_ASSERT(enp->en_nic_cfg.enc_mcdi_sensor_maskp != NULL);
+   EFSYS_ASSERT(
+   (enp->en_nic_cfg.enc_mcdi_sensor_maskp[sensor/MCDI_MON_PAGE_SIZE] &
+   (1U << (sensor % MCDI_MON_PAGE_SIZE))) != 0);
 
/* But we don't have to understand it */
if (sensor >= EFX_ARRAY_SIZE(mcdi_sensor_map)) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342430 - stable/11/sys/dev/sfxge/common

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 07:07:34 2018
New Revision: 342430
URL: https://svnweb.freebsd.org/changeset/base/342430

Log:
  MFC r340888
  
  sfxge(4): fix warnings from VS2015 C compiler (C4100)
  
  Fix multiple level 4 warnings
  "C4100: 'xxx': unreferenced formal parameter"
  no functional changes.
  
  The _NOTE(ARGUNUSED(xxx)) annotations are being exposed to the Visual
  Studio 2015 C compiler with the following:
  
#define _NOTE_ARGUNUSED(...) UNREFERENCED_PARAMETER((__VA_ARGS__));
#define _NOTE(_annotation)   _NOTE_ ## _annotation
  
  Submitted by:   Andrew Lee 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18122

Modified:
  stable/11/sys/dev/sfxge/common/ef10_nvram.c
  stable/11/sys/dev/sfxge/common/ef10_rx.c
  stable/11/sys/dev/sfxge/common/ef10_tx.c
  stable/11/sys/dev/sfxge/common/efx_ev.c
  stable/11/sys/dev/sfxge/common/efx_lic.c
  stable/11/sys/dev/sfxge/common/efx_mcdi.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/ef10_nvram.c
==
--- stable/11/sys/dev/sfxge/common/ef10_nvram.c Tue Dec 25 07:03:52 2018
(r342429)
+++ stable/11/sys/dev/sfxge/common/ef10_nvram.c Tue Dec 25 07:07:34 2018
(r342430)
@@ -675,6 +675,7 @@ ef10_nvram_buffer_validate(
int pos;
efx_rc_t rc;
 
+   _NOTE(ARGUNUSED(enp, partn))
EFX_STATIC_ASSERT(sizeof (*header) <= EF10_NVRAM_CHUNK);
 
if ((partn_data == NULL) || (partn_size == 0)) {
@@ -1284,6 +1285,8 @@ ef10_nvram_buf_read_tlv(
size_t length;
caddr_t value;
efx_rc_t rc;
+
+   _NOTE(ARGUNUSED(enp))
 
if ((seg_data == NULL) || (max_seg_size == 0)) {
rc = EINVAL;

Modified: stable/11/sys/dev/sfxge/common/ef10_rx.c
==
--- stable/11/sys/dev/sfxge/common/ef10_rx.cTue Dec 25 07:03:52 2018
(r342429)
+++ stable/11/sys/dev/sfxge/common/ef10_rx.cTue Dec 25 07:07:34 2018
(r342430)
@@ -657,6 +657,8 @@ ef10_rx_qpost(
unsigned int offset;
unsigned int id;
 
+   _NOTE(ARGUNUSED(completed))
+
/* The client driver must not overfill the queue */
EFSYS_ASSERT3U(added - completed + n, <=,
EFX_RXQ_LIMIT(erp->er_mask + 1));

Modified: stable/11/sys/dev/sfxge/common/ef10_tx.c
==
--- stable/11/sys/dev/sfxge/common/ef10_tx.cTue Dec 25 07:03:52 2018
(r342429)
+++ stable/11/sys/dev/sfxge/common/ef10_tx.cTue Dec 25 07:07:34 2018
(r342430)
@@ -609,6 +609,8 @@ ef10_tx_qdesc_dma_create(
__inboolean_t eop,
__out   efx_desc_t *edp)
 {
+   _NOTE(ARGUNUSED(etp))
+
/* No limitations on boundary crossing */
EFSYS_ASSERT(size <= etp->et_enp->en_nic_cfg.enc_tx_dma_desc_size_max);
 
@@ -632,6 +634,8 @@ ef10_tx_qdesc_tso_create(
__inuint8_t  tcp_flags,
__out   efx_desc_t *edp)
 {
+   _NOTE(ARGUNUSED(etp))
+
EFSYS_PROBE4(tx_desc_tso_create, unsigned int, etp->et_index,
uint16_t, ipv4_id, uint32_t, tcp_seq,
uint8_t, tcp_flags);
@@ -654,6 +658,8 @@ ef10_tx_qdesc_tso2_create(
__out_ecount(count) efx_desc_t *edp,
__inint count)
 {
+   _NOTE(ARGUNUSED(etp, count))
+
EFSYS_PROBE4(tx_desc_tso2_create, unsigned int, etp->et_index,
uint16_t, ipv4_id, uint32_t, tcp_seq,
uint16_t, tcp_mss);
@@ -683,6 +689,8 @@ ef10_tx_qdesc_vlantci_create(
__inuint16_t  tci,
__out   efx_desc_t *edp)
 {
+   _NOTE(ARGUNUSED(etp))
+
EFSYS_PROBE2(tx_desc_vlantci_create, unsigned int, etp->et_index,
uint16_t, tci);
 

Modified: stable/11/sys/dev/sfxge/common/efx_ev.c
==
--- stable/11/sys/dev/sfxge/common/efx_ev.c Tue Dec 25 07:03:52 2018
(r342429)
+++ stable/11/sys/dev/sfxge/common/efx_ev.c Tue Dec 25 07:07:34 2018
(r342430)
@@ -1419,6 +1419,8 @@ efx_ev_qstat_name(
__inefx_nic_t *enp,
__inunsigned int id)
 {
+   _NOTE(ARGUNUSED(enp))
+
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(id, <, EV_NQSTATS);
 

Modified: stable/11/sys/dev/sfxge/common/efx_lic.c
==
--- stable/11/sys/dev/sfxge/common/efx_lic.cTue Dec 25 07:03:52 2018
(r342429)
+++ stable/11/sys/dev/sfxge/common/efx_lic.cTue Dec 25 07:07:34 2018
(r342430)
@@ -587,7 +587,7 @@ efx_lic_v1v2_read_key(
 {
efx_rc_t rc;
 
-   _NOTE(ARGUNUSED(enp))
+   _NOTE(ARGUNUSED(enp, buffer_size))
EFSYS_ASSERT(length <= (EFX_LICENS

svn commit: r342429 - stable/11/sys/dev/sfxge/common

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 07:03:52 2018
New Revision: 342429
URL: https://svnweb.freebsd.org/changeset/base/342429

Log:
  MFC r340887
  
  sfxge(4): fix warnings from VS2015 C compiler (C4245)
  
  Fix level 4 warning
  "C4245: 'initializing': conversion from 'int' to 'uint32_t',
  signed/unsigned mismatch" warning; no functional changes.
  
  Submitted by:   Andrew Lee 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18121

Modified:
  stable/11/sys/dev/sfxge/common/ef10_filter.c
  stable/11/sys/dev/sfxge/common/efx.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/ef10_filter.c
==
--- stable/11/sys/dev/sfxge/common/ef10_filter.cTue Dec 25 07:03:01 
2018(r342428)
+++ stable/11/sys/dev/sfxge/common/ef10_filter.cTue Dec 25 07:03:52 
2018(r342429)
@@ -992,7 +992,7 @@ ef10_filter_supported_filters(
size_t list_length;
uint32_t i;
efx_rc_t rc;
-   uint32_t all_filter_flags =
+   efx_filter_match_flags_t all_filter_flags =
(EFX_FILTER_MATCH_REM_HOST | EFX_FILTER_MATCH_LOC_HOST |
EFX_FILTER_MATCH_REM_MAC | EFX_FILTER_MATCH_REM_PORT |
EFX_FILTER_MATCH_LOC_MAC | EFX_FILTER_MATCH_LOC_PORT |

Modified: stable/11/sys/dev/sfxge/common/efx.h
==
--- stable/11/sys/dev/sfxge/common/efx.hTue Dec 25 07:03:01 2018
(r342428)
+++ stable/11/sys/dev/sfxge/common/efx.hTue Dec 25 07:03:52 2018
(r342429)
@@ -2165,29 +2165,37 @@ typedef unsigned int efx_filter_flags_t;
  * Flags which specify the fields to match on. The values are the same as in 
the
  * MC_CMD_FILTER_OP/MC_CMD_FILTER_OP_EXT commands.
  */
-typedef enum efx_filter_match_flags_e {
-   EFX_FILTER_MATCH_REM_HOST = 0x0001, /* Match by remote IP host
-* address */
-   EFX_FILTER_MATCH_LOC_HOST = 0x0002, /* Match by local IP host
-* address */
-   EFX_FILTER_MATCH_REM_MAC = 0x0004,  /* Match by remote MAC address 
*/
-   EFX_FILTER_MATCH_REM_PORT = 0x0008, /* Match by remote TCP/UDP port 
*/
-   EFX_FILTER_MATCH_LOC_MAC = 0x0010,  /* Match by remote TCP/UDP port 
*/
-   EFX_FILTER_MATCH_LOC_PORT = 0x0020, /* Match by local TCP/UDP port 
*/
-   EFX_FILTER_MATCH_ETHER_TYPE = 0x0040,   /* Match by Ether-type */
-   EFX_FILTER_MATCH_INNER_VID = 0x0080,/* Match by inner VLAN ID */
-   EFX_FILTER_MATCH_OUTER_VID = 0x0100,/* Match by outer VLAN ID */
-   EFX_FILTER_MATCH_IP_PROTO = 0x0200, /* Match by IP transport
-* protocol */
-   /* For encapsulated packets, match all multicast inner frames */
-   EFX_FILTER_MATCH_IFRM_UNKNOWN_MCAST_DST = 0x0100,
-   /* For encapsulated packets, match all unicast inner frames */
-   EFX_FILTER_MATCH_IFRM_UNKNOWN_UCAST_DST = 0x0200,
-   /* Match otherwise-unmatched multicast and broadcast packets */
-   EFX_FILTER_MATCH_UNKNOWN_MCAST_DST = 0x4000,
-   /* Match otherwise-unmatched unicast packets */
-   EFX_FILTER_MATCH_UNKNOWN_UCAST_DST = 0x8000,
-} efx_filter_match_flags_t;
+
+/* Match by remote IP host address */
+#defineEFX_FILTER_MATCH_REM_HOST   0x0001
+/* Match by local IP host address */
+#defineEFX_FILTER_MATCH_LOC_HOST   0x0002
+/* Match by remote MAC address */
+#defineEFX_FILTER_MATCH_REM_MAC0x0004
+/* Match by remote TCP/UDP port */
+#defineEFX_FILTER_MATCH_REM_PORT   0x0008
+/* Match by remote TCP/UDP port */
+#defineEFX_FILTER_MATCH_LOC_MAC0x0010
+/* Match by local TCP/UDP port */
+#defineEFX_FILTER_MATCH_LOC_PORT   0x0020
+/* Match by Ether-type */
+#defineEFX_FILTER_MATCH_ETHER_TYPE 0x0040
+/* Match by inner VLAN ID */
+#defineEFX_FILTER_MATCH_INNER_VID  0x0080
+/* Match by outer VLAN ID */
+#defineEFX_FILTER_MATCH_OUTER_VID  0x0100
+/* Match by IP transport protocol */
+#defineEFX_FILTER_MATCH_IP_PROTO   0x0200
+/* For encapsulated packets, match all multicast inner frames */
+#defineEFX_FILTER_MATCH_IFRM_UNKNOWN_MCAST_DST 0x0100
+/* For encapsulated packets, match all unicast inner frames */
+#defineEFX_FILTER_MATCH_IFRM_UNKNOWN_UCAST_DST 0x0200
+/* Match otherwise-unmatched multicast and broadcast packets */
+#defineEFX_FILTER_MATCH_UNKNOWN_MCAST_DST  0x4000
+/* Match otherwise-unmatched unicast packets */
+#defineEFX_FILTER_MATCH_UNKNOWN_UCAST_DST  0x8000
+
+typedef uint32_

svn commit: r342426 - stable/11/sys/dev/sfxge/common

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 07:02:08 2018
New Revision: 342426
URL: https://svnweb.freebsd.org/changeset/base/342426

Log:
  MFC r340884
  
  sfxge(4): fix probes in licensing support
  
  EFSYS_PROBE1 takes one typed value (in addition to the probe name),
  whereas EFSYS_PROBE has just the probe name.
  
  Which to use is determined by the probe name - "fail1" probes are
  expected to include the function result.
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18118

Modified:
  stable/11/sys/dev/sfxge/common/efx_lic.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx_lic.c
==
--- stable/11/sys/dev/sfxge/common/efx_lic.cTue Dec 25 07:01:25 2018
(r342425)
+++ stable/11/sys/dev/sfxge/common/efx_lic.cTue Dec 25 07:02:08 2018
(r342426)
@@ -522,7 +522,7 @@ efx_lic_v1v2_find_key(
return (found);
 
 fail1:
-   EFSYS_PROBE(fail1);
+   EFSYS_PROBE1(fail1, boolean_t, B_FALSE);
 
return (B_FALSE);
 }
@@ -565,7 +565,7 @@ fail3:
 fail2:
EFSYS_PROBE(fail2);
 fail1:
-   EFSYS_PROBE(fail1);
+   EFSYS_PROBE1(fail1, boolean_t, B_FALSE);
 
return (B_FALSE);
 }
@@ -1187,7 +1187,7 @@ fail3:
 fail2:
EFSYS_PROBE(fail2);
 fail1:
-   EFSYS_PROBE(fail1);
+   EFSYS_PROBE1(fail1, boolean_t, B_FALSE);
 
return (B_FALSE);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342425 - stable/11/sys/dev/sfxge/common

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 07:01:25 2018
New Revision: 342425
URL: https://svnweb.freebsd.org/changeset/base/342425

Log:
  MFC r340883
  
  sfxge(4): fix diagnostics support build without Siena
  
  The compilation failed because __efx_sram_pattern_fns was used in
  efx_nic.c, but defined in efx_sram.c which is only needed when
  supporting Siena.
  
  To fix it move all the code using __efx_sram_pattern_fns into
  Siena-specific files (except for the definition in efx_sram.c itself,
  as that file only needs to be included in Siena-supporting builds
  anyway).
  
  The functions to test registers and tables are unlikely to apply to any
  new hardware and so can be moved into Siena files. Since Huntington
  such tests have been implemented in firmware.
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18117

Modified:
  stable/11/sys/dev/sfxge/common/efx_impl.h
  stable/11/sys/dev/sfxge/common/efx_nic.c
  stable/11/sys/dev/sfxge/common/siena_impl.h
  stable/11/sys/dev/sfxge/common/siena_nic.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx_impl.h
==
--- stable/11/sys/dev/sfxge/common/efx_impl.h   Tue Dec 25 07:00:37 2018
(r342424)
+++ stable/11/sys/dev/sfxge/common/efx_impl.h   Tue Dec 25 07:01:25 2018
(r342425)
@@ -1119,32 +1119,6 @@ efx_vpd_hunk_set(
 
 #endif /* EFSYS_OPT_VPD */
 
-#if EFSYS_OPT_DIAG
-
-extern efx_sram_pattern_fn_t   __efx_sram_pattern_fns[];
-
-typedef struct efx_register_set_s {
-   unsigned intaddress;
-   unsigned intstep;
-   unsigned introws;
-   efx_oword_t mask;
-} efx_register_set_t;
-
-extern __checkReturn   efx_rc_t
-efx_nic_test_registers(
-   __inefx_nic_t *enp,
-   __inefx_register_set_t *rsp,
-   __insize_t count);
-
-extern __checkReturn   efx_rc_t
-efx_nic_test_tables(
-   __inefx_nic_t *enp,
-   __inefx_register_set_t *rsp,
-   __inefx_pattern_type_t pattern,
-   __insize_t count);
-
-#endif /* EFSYS_OPT_DIAG */
-
 #if EFSYS_OPT_MCDI
 
 extern __checkReturn   efx_rc_t

Modified: stable/11/sys/dev/sfxge/common/efx_nic.c
==
--- stable/11/sys/dev/sfxge/common/efx_nic.cTue Dec 25 07:00:37 2018
(r342424)
+++ stable/11/sys/dev/sfxge/common/efx_nic.cTue Dec 25 07:01:25 2018
(r342425)
@@ -641,139 +641,6 @@ fail1:
return (rc);
 }
 
-   __checkReturn   efx_rc_t
-efx_nic_test_registers(
-   __inefx_nic_t *enp,
-   __inefx_register_set_t *rsp,
-   __insize_t count)
-{
-   unsigned int bit;
-   efx_oword_t original;
-   efx_oword_t reg;
-   efx_oword_t buf;
-   efx_rc_t rc;
-
-   while (count > 0) {
-   /* This function is only suitable for registers */
-   EFSYS_ASSERT(rsp->rows == 1);
-
-   /* bit sweep on and off */
-   EFSYS_BAR_READO(enp->en_esbp, rsp->address, &original,
-   B_TRUE);
-   for (bit = 0; bit < 128; bit++) {
-   /* Is this bit in the mask? */
-   if (~(rsp->mask.eo_u32[bit >> 5]) & (1 << bit))
-   continue;
-
-   /* Test this bit can be set in isolation */
-   reg = original;
-   EFX_AND_OWORD(reg, rsp->mask);
-   EFX_SET_OWORD_BIT(reg, bit);
-
-   EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, ®,
-   B_TRUE);
-   EFSYS_BAR_READO(enp->en_esbp, rsp->address, &buf,
-   B_TRUE);
-
-   EFX_AND_OWORD(buf, rsp->mask);
-   if (memcmp(®, &buf, sizeof (reg))) {
-   rc = EIO;
-   goto fail1;
-   }
-
-   /* Test this bit can be cleared in isolation */
-   EFX_OR_OWORD(reg, rsp->mask);
-   EFX_CLEAR_OWORD_BIT(reg, bit);
-
-   EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, ®,
-   B_TRUE);
-   EFSYS_BAR_READO(enp->en_esbp, rsp->address, &buf,
-   B_TRUE);
-
-   EFX_AND_OWORD(buf, rsp->mask);
-   if (memcmp(®, &buf, sizeof (reg))) {
-   rc = EIO;
-   goto fail2;
-   }
-   }
-
-   /* Restore the old value */
-   EFSYS_BAR_WRITEO(enp

svn commit: r342428 - stable/11/sys/dev/sfxge/common

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 07:03:01 2018
New Revision: 342428
URL: https://svnweb.freebsd.org/changeset/base/342428

Log:
  MFC r340886
  
  sfxge(4): fix warnings from VS2015 C compiler (C4244)
  
  Fix level 4 warning
  "C4244: '+=': conversion from 'unsigned int' to 'uint16_t', possible
  loss
  of data"; no functional changes.
  
  Submitted by:   Andrew Lee 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18120

Modified:
  stable/11/sys/dev/sfxge/common/efx_vpd.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx_vpd.c
==
--- stable/11/sys/dev/sfxge/common/efx_vpd.cTue Dec 25 07:02:35 2018
(r342427)
+++ stable/11/sys/dev/sfxge/common/efx_vpd.cTue Dec 25 07:03:01 2018
(r342428)
@@ -931,7 +931,7 @@ efx_vpd_hunk_set(
}
 
/* Modify tag length (large resource type) */
-   taglen += (dest - source);
+   taglen += (uint16_t)(dest - source);
EFX_POPULATE_WORD_1(word, EFX_WORD_0, taglen);
data[offset - 2] = EFX_WORD_FIELD(word, EFX_BYTE_0);
data[offset - 1] = EFX_WORD_FIELD(word, EFX_BYTE_1);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342422 - stable/11/sys/dev/sfxge/common

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 06:58:47 2018
New Revision: 342422
URL: https://svnweb.freebsd.org/changeset/base/342422

Log:
  MFC r340831
  
  sfxge(4): make MAC naming consistent with other modules
  
  Submitted by:   Andy Moreton 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18101

Modified:
  stable/11/sys/dev/sfxge/common/efx_mac.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx_mac.c
==
--- stable/11/sys/dev/sfxge/common/efx_mac.cTue Dec 25 06:57:41 2018
(r342421)
+++ stable/11/sys/dev/sfxge/common/efx_mac.cTue Dec 25 06:58:47 2018
(r342422)
@@ -43,7 +43,7 @@ siena_mac_multicast_list_set(
 #endif /* EFSYS_OPT_SIENA */
 
 #if EFSYS_OPT_SIENA
-static const efx_mac_ops_t __efx_siena_mac_ops = {
+static const efx_mac_ops_t __efx_mac_siena_ops = {
siena_mac_poll, /* emo_poll */
siena_mac_up,   /* emo_up */
siena_mac_reconfigure,  /* emo_addr_set */
@@ -66,7 +66,7 @@ static const efx_mac_ops_t__efx_siena_mac_ops = {
 #endif /* EFSYS_OPT_SIENA */
 
 #if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD
-static const efx_mac_ops_t __efx_ef10_mac_ops = {
+static const efx_mac_ops_t __efx_mac_ef10_ops = {
ef10_mac_poll,  /* emo_poll */
ef10_mac_up,/* emo_up */
ef10_mac_addr_set,  /* emo_addr_set */
@@ -818,21 +818,21 @@ efx_mac_select(
switch (enp->en_family) {
 #if EFSYS_OPT_SIENA
case EFX_FAMILY_SIENA:
-   emop = &__efx_siena_mac_ops;
+   emop = &__efx_mac_siena_ops;
type = EFX_MAC_SIENA;
break;
 #endif /* EFSYS_OPT_SIENA */
 
 #if EFSYS_OPT_HUNTINGTON
case EFX_FAMILY_HUNTINGTON:
-   emop = &__efx_ef10_mac_ops;
+   emop = &__efx_mac_ef10_ops;
type = EFX_MAC_HUNTINGTON;
break;
 #endif /* EFSYS_OPT_HUNTINGTON */
 
 #if EFSYS_OPT_MEDFORD
case EFX_FAMILY_MEDFORD:
-   emop = &__efx_ef10_mac_ops;
+   emop = &__efx_mac_ef10_ops;
type = EFX_MAC_MEDFORD;
break;
 #endif /* EFSYS_OPT_MEDFORD */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342427 - stable/11/sys/dev/sfxge/common

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 07:02:35 2018
New Revision: 342427
URL: https://svnweb.freebsd.org/changeset/base/342427

Log:
  MFC r340885
  
  sfxge(4): fix warnings from VS2015 C compiler (C4310)
  
  Fix level 4 warning
  "C4310: cast truncates constant value";
  no functional changes.
  
  Submitted by:   Andrew Lee 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18119

Modified:
  stable/11/sys/dev/sfxge/common/efx_bootcfg.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx_bootcfg.c
==
--- stable/11/sys/dev/sfxge/common/efx_bootcfg.cTue Dec 25 07:02:08 
2018(r342426)
+++ stable/11/sys/dev/sfxge/common/efx_bootcfg.cTue Dec 25 07:02:35 
2018(r342427)
@@ -359,7 +359,7 @@ efx_bootcfg_read(
rc = efx_bootcfg_verify(enp, (caddr_t)payload, sector_length,
&used_bytes);
if (rc != 0 || used_bytes == 0) {
-   payload[0] = (uint8_t)~DHCP_END;
+   payload[0] = (uint8_t)(~DHCP_END & 0xff);
payload[1] = DHCP_END;
used_bytes = 2;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342424 - stable/11/sys/dev/sfxge/common

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 07:00:37 2018
New Revision: 342424
URL: https://svnweb.freebsd.org/changeset/base/342424

Log:
  MFC r340875
  
  sfxge(4): fix build issue with PHY LED control enabled
  
  Fixed build issue with the EFSYS_OPT_PHY_LED_CONTROL for Huntigton and
  Medford.
  
  Submitted by:   Vijay Srivastava 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18110

Modified:
  stable/11/sys/dev/sfxge/common/ef10_phy.c
  stable/11/sys/dev/sfxge/common/efx_check.h
  stable/11/sys/dev/sfxge/common/siena_nic.c
  stable/11/sys/dev/sfxge/common/siena_phy.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/ef10_phy.c
==
--- stable/11/sys/dev/sfxge/common/ef10_phy.c   Tue Dec 25 06:59:48 2018
(r342423)
+++ stable/11/sys/dev/sfxge/common/ef10_phy.c   Tue Dec 25 07:00:37 2018
(r342424)
@@ -283,7 +283,9 @@ ef10_phy_reconfigure(
uint8_t payload[MAX(MC_CMD_SET_LINK_IN_LEN,
MC_CMD_SET_LINK_OUT_LEN)];
uint32_t cap_mask;
+#if EFSYS_OPT_PHY_LED_CONTROL
unsigned int led_mode;
+#endif
unsigned int speed;
boolean_t supported;
efx_rc_t rc;

Modified: stable/11/sys/dev/sfxge/common/efx_check.h
==
--- stable/11/sys/dev/sfxge/common/efx_check.h  Tue Dec 25 06:59:48 2018
(r342423)
+++ stable/11/sys/dev/sfxge/common/efx_check.h  Tue Dec 25 07:00:37 2018
(r342424)
@@ -226,8 +226,8 @@
 
 /* Support for PHY LED control */
 #if EFSYS_OPT_PHY_LED_CONTROL
-# if !EFSYS_OPT_SIENA
-#  error "PHY_LED_CONTROL requires SIENA"
+# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
+#  error "PHY_LED_CONTROL requires SIENA or HUNTINGTON or MEDFORD"
 # endif
 #endif /* EFSYS_OPT_PHY_LED_CONTROL */
 

Modified: stable/11/sys/dev/sfxge/common/siena_nic.c
==
--- stable/11/sys/dev/sfxge/common/siena_nic.c  Tue Dec 25 06:59:48 2018
(r342423)
+++ stable/11/sys/dev/sfxge/common/siena_nic.c  Tue Dec 25 07:00:37 2018
(r342424)
@@ -188,7 +188,9 @@ static  __checkReturn   efx_rc_t
 siena_phy_cfg(
__inefx_nic_t *enp)
 {
+#if EFSYS_OPT_PHY_STATS
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
+#endif /* EFSYS_OPT_PHY_STATS */
efx_rc_t rc;
 
/* Fill out fields in enp->en_port and enp->en_nic_cfg from MCDI */

Modified: stable/11/sys/dev/sfxge/common/siena_phy.c
==
--- stable/11/sys/dev/sfxge/common/siena_phy.c  Tue Dec 25 06:59:48 2018
(r342423)
+++ stable/11/sys/dev/sfxge/common/siena_phy.c  Tue Dec 25 07:00:37 2018
(r342424)
@@ -276,7 +276,9 @@ siena_phy_reconfigure(
MAX(MC_CMD_SET_LINK_IN_LEN,
MC_CMD_SET_LINK_OUT_LEN))];
uint32_t cap_mask;
+#if EFSYS_OPT_PHY_LED_CONTROL
unsigned int led_mode;
+#endif
unsigned int speed;
efx_rc_t rc;
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342423 - stable/11/sys/dev/sfxge/common

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 06:59:48 2018
New Revision: 342423
URL: https://svnweb.freebsd.org/changeset/base/342423

Log:
  MFC r340833
  
  sfxge(4): support inner checksum offload on transmit
  
  Inner checksum offloads may be used only if firmware supports
  these tunnels.
  
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18102

Modified:
  stable/11/sys/dev/sfxge/common/ef10_tx.c
  stable/11/sys/dev/sfxge/common/efx.h
  stable/11/sys/dev/sfxge/common/efx_tx.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/ef10_tx.c
==
--- stable/11/sys/dev/sfxge/common/ef10_tx.cTue Dec 25 06:58:47 2018
(r342422)
+++ stable/11/sys/dev/sfxge/common/ef10_tx.cTue Dec 25 06:59:48 2018
(r342423)
@@ -87,12 +87,16 @@ efx_mcdi_init_txq(
MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_LABEL, label);
MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_INSTANCE, instance);
 
-   MCDI_IN_POPULATE_DWORD_7(req, INIT_TXQ_IN_FLAGS,
+   MCDI_IN_POPULATE_DWORD_9(req, INIT_TXQ_IN_FLAGS,
INIT_TXQ_IN_FLAG_BUFF_MODE, 0,
INIT_TXQ_IN_FLAG_IP_CSUM_DIS,
(flags & EFX_TXQ_CKSUM_IPV4) ? 0 : 1,
INIT_TXQ_IN_FLAG_TCP_CSUM_DIS,
(flags & EFX_TXQ_CKSUM_TCPUDP) ? 0 : 1,
+   INIT_TXQ_EXT_IN_FLAG_INNER_IP_CSUM_EN,
+   (flags & EFX_TXQ_CKSUM_INNER_IPV4) ? 1 : 0,
+   INIT_TXQ_EXT_IN_FLAG_INNER_TCP_CSUM_EN,
+   (flags & EFX_TXQ_CKSUM_INNER_TCPUDP) ? 1 : 0,
INIT_TXQ_EXT_IN_FLAG_TSOV2_EN, (flags & EFX_TXQ_FATSOV2) ? 1 : 0,
INIT_TXQ_IN_FLAG_TCP_UDP_ONLY, 0,
INIT_TXQ_IN_CRC_MODE, 0,
@@ -197,14 +201,23 @@ ef10_tx_qcreate(
__inefx_txq_t *etp,
__out   unsigned int *addedp)
 {
+   efx_nic_cfg_t *encp = &enp->en_nic_cfg;
+   uint16_t inner_csum;
efx_qword_t desc;
efx_rc_t rc;
 
_NOTE(ARGUNUSED(id))
 
+   inner_csum = EFX_TXQ_CKSUM_INNER_IPV4 | EFX_TXQ_CKSUM_INNER_TCPUDP;
+   if (((flags & inner_csum) != 0) &&
+   (encp->enc_tunnel_encapsulations_supported == 0)) {
+   rc = EINVAL;
+   goto fail1;
+   }
+
if ((rc = efx_mcdi_init_txq(enp, n, eep->ee_index, label, index, flags,
esmp)) != 0)
-   goto fail1;
+   goto fail2;
 
/*
 * A previous user of this TX queue may have written a descriptor to the
@@ -215,19 +228,25 @@ ef10_tx_qcreate(
 * a no-op TX option descriptor. See bug29981 for details.
 */
*addedp = 1;
-   EFX_POPULATE_QWORD_4(desc,
+   EFX_POPULATE_QWORD_6(desc,
ESF_DZ_TX_DESC_IS_OPT, 1,
ESF_DZ_TX_OPTION_TYPE, ESE_DZ_TX_OPTION_DESC_CRC_CSUM,
ESF_DZ_TX_OPTION_UDP_TCP_CSUM,
(flags & EFX_TXQ_CKSUM_TCPUDP) ? 1 : 0,
ESF_DZ_TX_OPTION_IP_CSUM,
-   (flags & EFX_TXQ_CKSUM_IPV4) ? 1 : 0);
+   (flags & EFX_TXQ_CKSUM_IPV4) ? 1 : 0,
+   ESF_DZ_TX_OPTION_INNER_UDP_TCP_CSUM,
+   (flags & EFX_TXQ_CKSUM_INNER_TCPUDP) ? 1 : 0,
+   ESF_DZ_TX_OPTION_INNER_IP_CSUM,
+   (flags & EFX_TXQ_CKSUM_INNER_IPV4) ? 1 : 0);
 
EFSYS_MEM_WRITEQ(etp->et_esmp, 0, &desc);
ef10_tx_qpush(etp, *addedp, 0);
 
return (0);
 
+fail2:
+   EFSYS_PROBE(fail2);
 fail1:
EFSYS_PROBE1(fail1, efx_rc_t, rc);
 

Modified: stable/11/sys/dev/sfxge/common/efx.h
==
--- stable/11/sys/dev/sfxge/common/efx.hTue Dec 25 06:58:47 2018
(r342422)
+++ stable/11/sys/dev/sfxge/common/efx.hTue Dec 25 06:59:48 2018
(r342423)
@@ -1997,9 +1997,11 @@ efx_tx_fini(
 
 #defineEFX_TXQ_MAX_BUFS 8 /* Maximum independent of 
EFX_BUG35388_WORKAROUND. */
 
-#defineEFX_TXQ_CKSUM_IPV4  0x0001
-#defineEFX_TXQ_CKSUM_TCPUDP0x0002
-#defineEFX_TXQ_FATSOV2 0x0004
+#defineEFX_TXQ_CKSUM_IPV4  0x0001
+#defineEFX_TXQ_CKSUM_TCPUDP0x0002
+#defineEFX_TXQ_FATSOV2 0x0004
+#defineEFX_TXQ_CKSUM_INNER_IPV40x0008
+#defineEFX_TXQ_CKSUM_INNER_TCPUDP  0x0010
 
 extern __checkReturn   efx_rc_t
 efx_tx_qcreate(

Modified: stable/11/sys/dev/sfxge/common/efx_tx.c
==
--- stable/11/sys/dev/sfxge/common/efx_tx.c Tue Dec 25 06:58:47 2018
(r342422)
+++ stable/11/sys/dev/sfxge/common/efx_tx.c Tue Dec 25 06:59:48 2018
(r342423)
@@ -903,6 +903,7 @@ siena_tx_qcreate(
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
efx_oword_t oword;
uint32_t size;
+   uint16_t inner_csum;
efx_rc_t rc;
 
_NOTE(ARGUNUSED(esmp))
@@ -932,6 +933,12 @@ 

svn commit: r342420 - stable/11/sys/dev/sfxge/common

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 06:56:48 2018
New Revision: 342420
URL: https://svnweb.freebsd.org/changeset/base/342420

Log:
  MFC r340822
  
  sfxge(4): fix check in NVRAM validate
  
  Submitted by:   Andy Moreton 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18092

Modified:
  stable/11/sys/dev/sfxge/common/efx_nvram.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx_nvram.c
==
--- stable/11/sys/dev/sfxge/common/efx_nvram.c  Tue Dec 25 06:56:04 2018
(r342419)
+++ stable/11/sys/dev/sfxge/common/efx_nvram.c  Tue Dec 25 06:56:48 2018
(r342420)
@@ -460,10 +460,11 @@ efx_nvram_validate(
if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0)
goto fail1;
 
-   if (envop->envo_type_to_partn != NULL &&
-   ((rc = envop->envo_buffer_validate(enp, partn,
-   partn_data, partn_size)) != 0))
-   goto fail2;
+   if (envop->envo_buffer_validate != NULL) {
+   if ((rc = envop->envo_buffer_validate(enp, partn,
+   partn_data, partn_size)) != 0)
+   goto fail2;
+   }
 
return (0);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342419 - stable/11/sys/dev/sfxge/common

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 06:56:04 2018
New Revision: 342419
URL: https://svnweb.freebsd.org/changeset/base/342419

Log:
  MFC r340814
  
  sfxge(4): fix result code in MCDI NVRAM update finish
  
  Submitted by:   Andy Moreton 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18084

Modified:
  stable/11/sys/dev/sfxge/common/efx_nvram.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx_nvram.c
==
--- stable/11/sys/dev/sfxge/common/efx_nvram.c  Tue Dec 25 06:55:13 2018
(r342418)
+++ stable/11/sys/dev/sfxge/common/efx_nvram.c  Tue Dec 25 06:56:04 2018
(r342419)
@@ -924,7 +924,7 @@ efx_mcdi_nvram_update_finish(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_NVRAM_UPDATE_FINISH_V2_IN_LEN,
MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT_LEN)];
-   uint32_t result = 0; /* FIXME: use MC_CMD_NVRAM_VERIFY_RC_UNKNOWN */
+   uint32_t result = MC_CMD_NVRAM_VERIFY_RC_UNKNOWN;
efx_rc_t rc;
 
(void) memset(payload, 0, sizeof (payload));
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342418 - stable/11/sys/dev/sfxge/common

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 06:55:13 2018
New Revision: 342418
URL: https://svnweb.freebsd.org/changeset/base/342418

Log:
  MFC r340806
  
  sfxge(4): fix default RSS context check on Siena
  
  Default RSS context check is carried out during filter
  insertion on Siena and it needs to be fixed
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18076

Modified:
  stable/11/sys/dev/sfxge/common/efx_filter.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx_filter.c
==
--- stable/11/sys/dev/sfxge/common/efx_filter.c Tue Dec 25 06:54:25 2018
(r342417)
+++ stable/11/sys/dev/sfxge/common/efx_filter.c Tue Dec 25 06:55:13 2018
(r342418)
@@ -525,9 +525,9 @@ siena_filter_spec_from_gen_spec(
else
EFSYS_ASSERT3U(gen_spec->efs_flags, &, EFX_FILTER_FLAG_RX);
 
-   /* Falconsiena only has one RSS context */
+   /* Siena only has one RSS context */
if ((gen_spec->efs_flags & EFX_FILTER_FLAG_RX_RSS) &&
-   gen_spec->efs_rss_context != 0) {
+   gen_spec->efs_rss_context != EFX_RSS_CONTEXT_DEFAULT) {
rc = EINVAL;
goto fail1;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r342421 - stable/11/sys/dev/sfxge/common

2018-12-24 Thread Andrew Rybchenko
Author: arybchik
Date: Tue Dec 25 06:57:41 2018
New Revision: 342421
URL: https://svnweb.freebsd.org/changeset/base/342421

Log:
  MFC r340826
  
  sfxge(4): fix ignoring function return value
  
  fix PreFAST issue, add missing annotation that function return value
  should not be ignored. Fix alignment.
  
  Submitted by:   Andy Moreton 
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18096

Modified:
  stable/11/sys/dev/sfxge/common/efx.h
  stable/11/sys/dev/sfxge/common/efx_phy.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx.h
==
--- stable/11/sys/dev/sfxge/common/efx.hTue Dec 25 06:56:48 2018
(r342420)
+++ stable/11/sys/dev/sfxge/common/efx.hTue Dec 25 06:57:41 2018
(r342421)
@@ -911,13 +911,13 @@ efx_phy_media_type_get(
__inefx_nic_t *enp,
__out   efx_phy_media_type_t *typep);
 
-extern efx_rc_t
+extern __checkReturn   efx_rc_t
 efx_phy_module_get_info(
-   __inefx_nic_t *enp,
-   __inuint8_t dev_addr,
-   __inuint8_t offset,
-   __inuint8_t len,
-   __out_bcount(len)   uint8_t *data);
+   __inefx_nic_t *enp,
+   __inuint8_t dev_addr,
+   __inuint8_t offset,
+   __inuint8_t len,
+   __out_bcount(len)   uint8_t *data);
 
 #if EFSYS_OPT_PHY_STATS
 

Modified: stable/11/sys/dev/sfxge/common/efx_phy.c
==
--- stable/11/sys/dev/sfxge/common/efx_phy.cTue Dec 25 06:56:48 2018
(r342420)
+++ stable/11/sys/dev/sfxge/common/efx_phy.cTue Dec 25 06:57:41 2018
(r342421)
@@ -299,7 +299,7 @@ efx_phy_media_type_get(
*typep = epp->ep_fixed_port_type;
 }
 
-   __checkReturn   efx_rc_t
+   __checkReturn   efx_rc_t
 efx_phy_module_get_info(
__inefx_nic_t *enp,
__inuint8_t dev_addr,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


  1   2   3   4   5   6   7   8   9   10   >