From nobody Tue Feb 21 23:57:17 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PLx6Q2Z5Wz3tfww; Tue, 21 Feb 2023 23:57:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PLx6Q1V0yz4ZdD; Tue, 21 Feb 2023 23:57:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677023838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CZjZ80HO4702kP0wFjDeQlnpErEHcudfvquItUDqspA=; b=Ki/7pwzt0Yz6/wtDwggyeDjfGAoTTgzwsLupMkqpqJYFkIn5+UUbRN5HC4+CSVhoXjFrpB YoidB5YG4iUWXQiGph8mdP/+jIa5BglwboLFanwI0De39OSJnLAFkv5dbvD6M/dRD/F2UP SvLLzHc59XgKKL8aGrVZJJRKP+wYiDCbIMATa1G6KxuSxHrh9j8+ehcVeK/Sr7jbZOGbjR PB0r7p9uo1ohSJfGcNi8H3FOd62srf5jPI7onaSVo/CUi67P63vDOkSXuggWzBcDyEZIDU QhpTTq8uC5AW7KZ+5mXXWd+BftbFVcBCsm/06t902CrRPyE3wzJafwlRohaBxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677023838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CZjZ80HO4702kP0wFjDeQlnpErEHcudfvquItUDqspA=; b=U2HBA2KS8hfWhWsd0HlFydKmNAEU4M0qEjweg2unZbGaULijk4LOk1poJ1HBybir52XSJJ gPgV94PrzZzUWBRlw0yi0Qh9RqsSRPsE89ilAz6sRa2WmIVBgALls4vTMGSO4iATJhyYRC p6UAch1acjC3+jHQclzknWtJMaBvgRLKaSO6slXuK0jDZHJo6F9CkuyktXkYQrrxH/Y4/e QYT2+uzGpN06Xm2cAXIBYbLaBUYRIhakh8JQEvmxmHgwPYxQ92FctQ4xSUc8v7aLX/xKn3 JKsVHQ0S0mfAZMRAxSQyCTMhwlU30Cydf1HbW06+id2Lsz5a4U/eVLmbpLnN5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677023838; a=rsa-sha256; cv=none; b=eJWnQQpMEJ6ZGszXHQMUp8Rq9kUh8gFAmvRcLjp1P5Dk1VPWbiHL3vn/SArg7Bf+PR9to/ C7399O5HuBqRFm3BUDs+sQDgCvtMf/fxKn4RwOyVjnI2StVHsTJItaGKkfeq4owJy6VwMj OzzYltlQGkSmuqbKyFNvfljy+UtiZdNVNDmGUpBFi9NMhMsYdrPTjXAUK0XYK1J7XGTR0P B9mSsuFrdD6TrD91t6GvI4W3JrJzQkNOcDP2T5gPWtSDapdwY2gBFEqYwK9CEXIrK4ctlU jbZ/92eX+skuT9/oHt54o+MrSfNLa/PtVh2P6fgO1dHscdUNaJgiOGWmuAzBQg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PLx6Q0HsCzfwS; Tue, 21 Feb 2023 23:57:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31LNvHpu068494; Tue, 21 Feb 2023 23:57:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31LNvHbH068493; Tue, 21 Feb 2023 23:57:17 GMT (envelope-from git) Date: Tue, 21 Feb 2023 23:57:17 GMT Message-Id: <202302212357.31LNvHbH068493@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: 0f59de6879b8 - releng/13.2 - ixl(4): Fix MAC/VLAN filters accounting List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 0f59de6879b8590177c050a1dd02a5383271f33b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=0f59de6879b8590177c050a1dd02a5383271f33b commit 0f59de6879b8590177c050a1dd02a5383271f33b Author: Krzysztof Galazka AuthorDate: 2023-02-15 22:28:01 +0000 Commit: Eric Joyner CommitDate: 2023-02-21 23:56:18 +0000 ixl(4): Fix MAC/VLAN filters accounting - Account for a filter required to enable reception of untagged frames while registering and unregistering VLANs to avoid trying to add more filters than HW supports - While adding MAC/VLAN filters, pre-set matching method field in the Admin Queue Command response buffer to expected error value to work around an issue with some FW versions, which do not update that field if operation fails, and be able correctly track which filters were configured in HW. - Remove unused IXL_MAX_FILTERS macro definition - Update number of available MAC/VLAN filters as in newer FW versions it was decreased by one. - Simplify i40e_dma_mem structure Signed-off-by: Krzysztof Galazka Signed-off-by: Eric Joyner Reviewed by: erj@ Tested by: Gowtham Kumar Ks Approved by: re (cperciva) Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D37457 (cherry picked from commit 1d02c6b1b859e9f611bc8fe27ca3d2c16ec128c1) (cherry picked from commit a6fa27eb5267bfaceb626d90ead84b4d9a4f5655) --- sys/dev/ixl/i40e_osdep.c | 1 - sys/dev/ixl/i40e_osdep.h | 3 --- sys/dev/ixl/if_ixl.c | 7 ++++--- sys/dev/ixl/ixl.h | 5 +---- sys/dev/ixl/ixl_pf_main.c | 5 +++++ 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/sys/dev/ixl/i40e_osdep.c b/sys/dev/ixl/i40e_osdep.c index 20eb02c85d67..b3fd53af9e23 100644 --- a/sys/dev/ixl/i40e_osdep.c +++ b/sys/dev/ixl/i40e_osdep.c @@ -109,7 +109,6 @@ i40e_allocate_dma_mem(struct i40e_hw *hw, struct i40e_dma_mem *mem, "error %u\n", err); goto fail_2; } - mem->nseg = 1; mem->size = size; bus_dmamap_sync(mem->tag, mem->map, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE); diff --git a/sys/dev/ixl/i40e_osdep.h b/sys/dev/ixl/i40e_osdep.h index e7a1c1226a0e..1146ece279b5 100644 --- a/sys/dev/ixl/i40e_osdep.h +++ b/sys/dev/ixl/i40e_osdep.h @@ -160,10 +160,7 @@ struct i40e_dma_mem { u64 pa; bus_dma_tag_t tag; bus_dmamap_t map; - bus_dma_segment_t seg; bus_size_t size; - int nseg; - int flags; }; struct i40e_virt_mem { diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c index cbf6f9444c18..985843d546fa 100644 --- a/sys/dev/ixl/if_ixl.c +++ b/sys/dev/ixl/if_ixl.c @@ -49,7 +49,7 @@ *********************************************************************/ #define IXL_DRIVER_VERSION_MAJOR 2 #define IXL_DRIVER_VERSION_MINOR 3 -#define IXL_DRIVER_VERSION_BUILD 2 +#define IXL_DRIVER_VERSION_BUILD 3 #define IXL_DRIVER_VERSION_STRING \ __XSTRING(IXL_DRIVER_VERSION_MAJOR) "." \ @@ -1722,9 +1722,10 @@ ixl_if_vlan_unregister(if_ctx_t ctx, u16 vtag) if ((if_getcapenable(ifp) & IFCAP_VLAN_HWFILTER) == 0) return; - if (vsi->num_vlans < IXL_MAX_VLAN_FILTERS) + /* One filter is used for untagged frames */ + if (vsi->num_vlans < IXL_MAX_VLAN_FILTERS - 1) ixl_del_filter(vsi, hw->mac.addr, vtag); - else if (vsi->num_vlans == IXL_MAX_VLAN_FILTERS) { + else if (vsi->num_vlans == IXL_MAX_VLAN_FILTERS - 1) { ixl_del_filter(vsi, hw->mac.addr, IXL_VLAN_ANY); ixl_add_vlan_filters(vsi, hw->mac.addr); } diff --git a/sys/dev/ixl/ixl.h b/sys/dev/ixl/ixl.h index 9828760e4ea6..9b49520a8851 100644 --- a/sys/dev/ixl/ixl.h +++ b/sys/dev/ixl/ixl.h @@ -164,9 +164,6 @@ #define IXL_VF_MAX_HDR_BUFFER 0x840 #define IXL_VF_MAX_FRAME 0x3FFF -/* ERJ: hardware can support ~2k (SW5+) filters between all functions */ -#define IXL_MAX_FILTERS 256 - #define IXL_NVM_VERSION_LO_SHIFT 0 #define IXL_NVM_VERSION_LO_MASK (0xff << IXL_NVM_VERSION_LO_SHIFT) #define IXL_NVM_VERSION_HI_SHIFT 12 @@ -195,7 +192,7 @@ #define IXL_VLAN_ANY -1 /* Maximum number of MAC/VLAN filters supported by HW */ -#define IXL_MAX_VLAN_FILTERS 256 +#define IXL_MAX_VLAN_FILTERS 255 #define CSUM_OFFLOAD_IPV4 (CSUM_IP|CSUM_TCP|CSUM_UDP|CSUM_SCTP) #define CSUM_OFFLOAD_IPV6 (CSUM_TCP_IPV6|CSUM_UDP_IPV6|CSUM_SCTP_IPV6) diff --git a/sys/dev/ixl/ixl_pf_main.c b/sys/dev/ixl/ixl_pf_main.c index f783ae5ed31a..0b4e69a5ce37 100644 --- a/sys/dev/ixl/ixl_pf_main.c +++ b/sys/dev/ixl/ixl_pf_main.c @@ -1396,6 +1396,11 @@ ixl_add_hw_filters(struct ixl_vsi *vsi, struct ixl_ftl_head *to_add, int cnt) b->flags = 0; } b->flags |= I40E_AQC_MACVLAN_ADD_PERFECT_MATCH; + /* Some FW versions do not set match method + * when adding filters fails. Initialize it with + * expected error value to allow detection which + * filters were not added */ + b->match_method = I40E_AQC_MM_ERR_NO_RES; ixl_dbg_filter(pf, "ADD: " MAC_FORMAT "\n", MAC_FORMAT_ARGS(f->macaddr));