From owner-svn-src-all@freebsd.org Fri Nov 23 09:15:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44E6B1140235; Fri, 23 Nov 2018 09:15:23 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE60F7DE3F; Fri, 23 Nov 2018 09:15:22 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 89B171C8AF; Fri, 23 Nov 2018 09:15:21 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN9FLc3000270; Fri, 23 Nov 2018 09:15:21 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN9FKtX000265; Fri, 23 Nov 2018 09:15:20 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811230915.wAN9FKtX000265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 23 Nov 2018 09:15:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340808 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 340808 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DE60F7DE3F X-Spamd-Result: default: False [1.55 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.42)[0.420,0]; NEURAL_SPAM_MEDIUM(0.74)[0.738,0]; NEURAL_SPAM_SHORT(0.40)[0.396,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 09:15:23 -0000 Author: arybchik Date: Fri Nov 23 09:15:20 2018 New Revision: 340808 URL: https://svnweb.freebsd.org/changeset/base/340808 Log: sfxge(4): rename API to check Rx scale and hash support Rename efx_rx_scale_support_get() to efx_rx_scale_default_support_get(), and efx_rx_hash_support_get() to efx_rx_hash_default_support_get(). All these really report is whether an exclusive RSS context was successfully acquired at efx_rx_init(). efx_rx_scale_support_get() sounds like it reports whether the device supports RSS, and whether exclusive or shared contexts are supported, but it doesn't do that. Renaming it to efx_rx_scale_default_support_get() helps to reflect that it reports what RSS support the client gets without trying to allocate RSS contexts itself. Also rename efx_rx_scale_support_t to efx_rx_scale_context_type_t, to make the enum more suitable for specifying the type of an RSS context to be allocated. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18078 Modified: head/sys/dev/sfxge/common/ef10_rx.c head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_rx.c Modified: head/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 09:15:08 2018 (r340807) +++ head/sys/dev/sfxge/common/ef10_rx.c Fri Nov 23 09:15:20 2018 (r340808) @@ -162,7 +162,7 @@ fail1: static __checkReturn efx_rc_t efx_mcdi_rss_context_alloc( __in efx_nic_t *enp, - __in efx_rx_scale_support_t scale_support, + __in efx_rx_scale_context_type_t type, __in uint32_t num_queues, __out uint32_t *rss_contextp) { @@ -178,7 +178,7 @@ efx_mcdi_rss_context_alloc( goto fail1; } - switch (scale_support) { + switch (type) { case EFX_RX_SCALE_EXCLUSIVE: context_type = MC_CMD_RSS_CONTEXT_ALLOC_IN_TYPE_EXCLUSIVE; break; @@ -464,7 +464,7 @@ ef10_rx_init( * Allocated an exclusive RSS context, which allows both the * indirection table and key to be modified. */ - enp->en_rss_support = EFX_RX_SCALE_EXCLUSIVE; + enp->en_rss_context_type = EFX_RX_SCALE_EXCLUSIVE; enp->en_hash_support = EFX_RX_HASH_AVAILABLE; } else { /* @@ -472,7 +472,7 @@ ef10_rx_init( * operation without support for RSS. The pseudo-header in * received packets will not contain a Toeplitz hash value. */ - enp->en_rss_support = EFX_RX_SCALE_UNAVAILABLE; + enp->en_rss_context_type = EFX_RX_SCALE_UNAVAILABLE; enp->en_hash_support = EFX_RX_HASH_UNAVAILABLE; } @@ -510,7 +510,7 @@ ef10_rx_scale_mode_set( goto fail1; } - if (enp->en_rss_support == EFX_RX_SCALE_UNAVAILABLE) { + if (enp->en_rss_context_type == EFX_RX_SCALE_UNAVAILABLE) { rc = ENOTSUP; goto fail2; } @@ -541,7 +541,7 @@ ef10_rx_scale_key_set( { efx_rc_t rc; - if (enp->en_rss_support == EFX_RX_SCALE_UNAVAILABLE) { + if (enp->en_rss_context_type == EFX_RX_SCALE_UNAVAILABLE) { rc = ENOTSUP; goto fail1; } @@ -570,7 +570,7 @@ ef10_rx_scale_tbl_set( { efx_rc_t rc; - if (enp->en_rss_support == EFX_RX_SCALE_UNAVAILABLE) { + if (enp->en_rss_context_type == EFX_RX_SCALE_UNAVAILABLE) { rc = ENOTSUP; goto fail1; } @@ -981,11 +981,10 @@ ef10_rx_fini( __in efx_nic_t *enp) { #if EFSYS_OPT_RX_SCALE - if (enp->en_rss_support != EFX_RX_SCALE_UNAVAILABLE) { + if (enp->en_rss_context_type != EFX_RX_SCALE_UNAVAILABLE) (void) efx_mcdi_rss_context_free(enp, enp->en_rss_context); - } enp->en_rss_context = 0; - enp->en_rss_support = EFX_RX_SCALE_UNAVAILABLE; + enp->en_rss_context_type = EFX_RX_SCALE_UNAVAILABLE; #else _NOTE(ARGUNUSED(enp)) #endif /* EFSYS_OPT_RX_SCALE */ Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:15:08 2018 (r340807) +++ head/sys/dev/sfxge/common/efx.h Fri Nov 23 09:15:20 2018 (r340808) @@ -1916,22 +1916,22 @@ typedef enum efx_rx_hash_support_e { #define EFX_MAXRSS 64 /* RX indirection entry range */ #define EFX_MAXRSS_LEGACY 16 /* See bug16611 and bug17213 */ -typedef enum efx_rx_scale_support_e { - EFX_RX_SCALE_UNAVAILABLE = 0, /* Not supported */ +typedef enum efx_rx_scale_context_type_e { + EFX_RX_SCALE_UNAVAILABLE = 0, /* No RX scale context */ EFX_RX_SCALE_EXCLUSIVE, /* Writable key/indirection table */ EFX_RX_SCALE_SHARED /* Read-only key/indirection table */ -} efx_rx_scale_support_t; +} efx_rx_scale_context_type_t; extern __checkReturn efx_rc_t -efx_rx_hash_support_get( +efx_rx_hash_default_support_get( __in efx_nic_t *enp, __out efx_rx_hash_support_t *supportp); extern __checkReturn efx_rc_t -efx_rx_scale_support_get( +efx_rx_scale_default_support_get( __in efx_nic_t *enp, - __out efx_rx_scale_support_t *supportp); + __out efx_rx_scale_context_type_t *typep); extern __checkReturn efx_rc_t efx_rx_scale_mode_set( Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Fri Nov 23 09:15:08 2018 (r340807) +++ head/sys/dev/sfxge/common/efx_impl.h Fri Nov 23 09:15:20 2018 (r340808) @@ -644,9 +644,9 @@ struct efx_nic_s { const efx_vpd_ops_t *en_evpdop; #endif /* EFSYS_OPT_VPD */ #if EFSYS_OPT_RX_SCALE - efx_rx_hash_support_t en_hash_support; - efx_rx_scale_support_t en_rss_support; - uint32_t en_rss_context; + efx_rx_hash_support_t en_hash_support; + efx_rx_scale_context_type_t en_rss_context_type; + uint32_t en_rss_context; #endif /* EFSYS_OPT_RX_SCALE */ uint32_t en_vport_id; #if EFSYS_OPT_LICENSING Modified: head/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_rx.c Fri Nov 23 09:15:08 2018 (r340807) +++ head/sys/dev/sfxge/common/efx_rx.c Fri Nov 23 09:15:20 2018 (r340808) @@ -309,7 +309,7 @@ fail1: #if EFSYS_OPT_RX_SCALE __checkReturn efx_rc_t -efx_rx_hash_support_get( +efx_rx_hash_default_support_get( __in efx_nic_t *enp, __out efx_rx_hash_support_t *supportp) { @@ -323,7 +323,10 @@ efx_rx_hash_support_get( goto fail1; } - /* Report if resources are available to insert RX hash value */ + /* + * Report the hashing support the client gets by default if it + * does not allocate an RSS context itself. + */ *supportp = enp->en_hash_support; return (0); @@ -335,22 +338,25 @@ fail1: } __checkReturn efx_rc_t -efx_rx_scale_support_get( +efx_rx_scale_default_support_get( __in efx_nic_t *enp, - __out efx_rx_scale_support_t *supportp) + __out efx_rx_scale_context_type_t *typep) { efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX); - if (supportp == NULL) { + if (typep == NULL) { rc = EINVAL; goto fail1; } - /* Report if resources are available to support RSS */ - *supportp = enp->en_rss_support; + /* + * Report the RSS support the client gets by default if it + * does not allocate an RSS context itself. + */ + *typep = enp->en_rss_context_type; return (0); @@ -659,7 +665,7 @@ siena_rx_init( #if EFSYS_OPT_RX_SCALE /* The RSS key and indirection table are writable. */ - enp->en_rss_support = EFX_RX_SCALE_EXCLUSIVE; + enp->en_rss_context_type = EFX_RX_SCALE_EXCLUSIVE; /* Hardware can insert RX hash with/without RSS */ enp->en_hash_support = EFX_RX_HASH_AVAILABLE;