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-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"


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-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-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-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"


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-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-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 = >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, );
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: 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 = _link_mode;
___
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-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(, EFX_FILTER_PRI_AUTO,
filter_flags,
eftp->eft_default_rxq);
-   efx_filter_spec_set_eth_local(, EFX_FILTER_SPEC_VID_UNSPEC, addr);
+   rc = efx_filter_spec_set_eth_local(, EFX_FILTER_SPEC_VID_UNSPEC,
+   addr);
+   if (rc != 0)
+   goto fail1;
 
rc = ef10_filter_add_internal(enp, , B_TRUE,
>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(, EFX_FILTER_PRI_AUTO,
filter_flags,
eftp->eft_default_rxq);
-   efx_filter_spec_set_uc_def();
+   rc = efx_filter_spec_set_uc_def();
+   if (rc != 0)
+   goto fail1;
rc = ef10_filter_add_internal(enp, , B_TRUE,
>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(,
+   rc = efx_filter_spec_set_eth_local(,
EFX_FILTER_SPEC_VID_UNSPEC,
[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, , B_TRUE,
_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(, EFX_FILTER_SPEC_VID_UNSPEC,
-   addr);
+   rc = efx_filter_spec_set_eth_local(,
+   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, , B_TRUE,
_index);
@@ -1212,12 +1237,14 @@ ef10_filter_insert_all_multicast(
efx_filter_spec_init_rx(, EFX_FILTER_PRI_AUTO,
filter_flags,
eftp->eft_default_rxq);
-   efx_filter_spec_set_mc_def();
+   rc = efx_filter_spec_set_mc_def();
+   if (rc != 0)
+   goto fail1;
 
rc = ef10_filter_add_internal(enp, , B_TRUE,
>eft_mulcst_filter_indexes[0]);
if (rc != 0)
-   goto fail1;
+   goto fail2;
 
eftp->eft_mulcst_filter_count = 1;
eftp->eft_using_all_mulcst = B_TRUE;
@@ -1228,6 +1255,8 @@ ef10_filter_insert_all_multicast(
 
return (0);
 
+fail2:
+   

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-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-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-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-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-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-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 = >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, );
 
-   EFSYS_MEM_WRITEQ(etp->et_esmp, 0, );
+   EFSYS_MEM_WRITEQ(etp->et_esmp, 0, _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: 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-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-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, , B_TRUE);
-
-   EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, EFX_BIU_MAGIC1);
-   EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 1, , B_TRUE);
-
-   EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 0, , 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, , 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, , B_TRUE);
-
-   EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, EFX_BIU_MAGIC0);
-   EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 1, , B_TRUE);
-
-   EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 0, , 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, , 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, , B_TRUE);
+
+   EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, 

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, );
 

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-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"


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-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-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-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"


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-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-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, );
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_LE_64_PKTS]), );
EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_64_PKTS, );
-   EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_LE_64_PKTS]), );
+   EFSYS_STAT_INCR_QWORD(&(stat[EFX_MAC_TX_LE_64_PKTS]), );
 
EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_65_TO_127_PKTS, );
EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_65_TO_127_PKTS]), );
___
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-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 = >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, );
@@ -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-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"


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-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-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: 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-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-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-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-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-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"


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 

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-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"


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,
+   

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-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-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(>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: 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, ,
-   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, ,
-   B_TRUE);
-
-   EFX_AND_OWORD(buf, rsp->mask);
-   if (memcmp(, , 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, ,
-   B_TRUE);
-
-   EFX_AND_OWORD(buf, rsp->mask);
-   if (memcmp(, , sizeof (reg))) {
-   rc = EIO;
-   goto fail2;
-   }
-   }
-
-   /* Restore the old value */
-   EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, ,
- 

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-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-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-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-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-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-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-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-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-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-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 =
+   _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(, EFX_FILTER_PRI_AUTO,
+   filter_flags,
+   table->eft_default_rxq);
+   efx_filter_spec_set_ether_type(, encap_filter->ether_type);
+   rc = efx_filter_spec_set_encap_type(,
+   encap_filter->encap_type,
+ 

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),
>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, );
 
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 fields to 

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 <= 

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-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-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,
_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-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-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, );
 
-   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, );
 
-   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-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-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, )) != 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-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-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-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-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,
_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-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"