From nobody Mon Dec 23 16:52:50 2024 X-Original-To: dev-commits-src-all@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 4YH3wz4csZz5WxWT; Mon, 23 Dec 2024 16:52:51 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YH3wz0smBz4xVh; Mon, 23 Dec 2024 16:52:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734972771; 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=14ge2paAWfgZR95MkAlvbxDAd93Q4HZ96YUq09/mZEU=; b=fN05N+a9NRMGJQ7qNORC6cuNVwdUZsJo3oCzJYpzh7nHWL8QLWkALCmS3lf+28D1XfcDzc b4mxDNJevQ2Wkso4PJkj3IljAlYrfhVu6xnSTnQ1rCsbrwJ+pfDU5PhjAvd039B4VMOZIA QyVIcZW6ca9uekgR0Qp9Ky5dePglji8bRYLY5Q40e8EagjAErDKzWIQ3rxrU0YfgLIp5uA /Kdsu/8uHzJfwdHPDnShFpRbpf9aQzY3ggSY8m0gxVoOr/uyFGFjfgAeXmeDJHL/hkCxIV fNyib8y4OzKopfFnOK9Vui5zVcX9GAejQbDPk7BMZZREdTvgTBWmXGW/zyCYmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734972771; 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=14ge2paAWfgZR95MkAlvbxDAd93Q4HZ96YUq09/mZEU=; b=miFNXr7rqWGGp/bbZHqVj9FfCKJmOQlEqSv2wa5au39gABLx7wfF6n+FYClVtYgHr4hGhJ R5bB+4VOfu1ZBupNy/Ig6P8kiWdKaIK1Gpj6yePJmpUqIyf2S62lxtLCaEinDl8BOgdrfR ReNEgnsYDb7U++MCs8AjjXcR5ibRqEou3qKc8LfvxK2EDCge1NwK0tquvAc2s08u3b8b0U YN+iZjNECYk30reav/TnOpoFVfFNQchGZr05kXOVTwiQQLhAv3T8yMr/JmiWSa14XLU1lK 9nMKZoRDKTboN/Jb7Tj67lnc/zmUra3RQ2OebSLHrfkeqxg6CuVz93jFJH/3Ug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734972771; a=rsa-sha256; cv=none; b=KAnmUescMnHVGmfkkk5hYp9JdcLhi77lR06Ufyf8UNwrYR+SjfGsZDtpHK8ISFNf1Gtvxo LISbS9bcIigpFL757/de6hvTVTHfD7LBz0NzWTYahXXvQ/G3eeYC1nM5r6Ulo2NRxn+95y U6/3ycTaLQ7C8HNGPke9rwcryhIu3QF/z+CHzkpVg5WaY7bR+g/PFMM2LeONX5IHibjC3O FI6IwZYYGE52nPF9osRRQBQNOuKgejwD6dHyO0HlhZv4227MxUSJ0O5azUCWNYZansGXhF tn8PRvdq76Gk/KrMpw6qinplPG0YPJNEwM90bBV4WfpnSd82u97LDLc1rj2k5w== 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 4YH3wz0TWPz124l; Mon, 23 Dec 2024 16:52:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BNGqomv040960; Mon, 23 Dec 2024 16:52:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BNGqo1m040957; Mon, 23 Dec 2024 16:52:50 GMT (envelope-from git) Date: Mon, 23 Dec 2024 16:52:50 GMT Message-Id: <202412231652.4BNGqo1m040957@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 5c15d499c23a - stable/14 - Revert "ixl: fix multicast filters handling" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5c15d499c23a09655931ea2ccf5b94dd39cdae76 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5c15d499c23a09655931ea2ccf5b94dd39cdae76 commit 5c15d499c23a09655931ea2ccf5b94dd39cdae76 Author: Franco Fichtner AuthorDate: 2024-12-11 14:08:40 +0000 Commit: Mark Johnston CommitDate: 2024-12-23 16:51:33 +0000 Revert "ixl: fix multicast filters handling" This reverts commit 89e73359424a338a7900a4854ad7439f5848ebb8. PR: 281125 Reviewed by: Krzysztof Galazka MFC after: 3 days Pull Request: https://github.com/freebsd/freebsd-src/pull/1545 (cherry picked from commit 38663adb61440bd659fb457909782b71ba8806fa) --- sys/dev/ixl/ixl_pf_main.c | 97 +++++------------------------------------------ 1 file changed, 10 insertions(+), 87 deletions(-) diff --git a/sys/dev/ixl/ixl_pf_main.c b/sys/dev/ixl/ixl_pf_main.c index af253faeac7a..4f384e7191af 100644 --- a/sys/dev/ixl/ixl_pf_main.c +++ b/sys/dev/ixl/ixl_pf_main.c @@ -592,15 +592,6 @@ ixl_add_maddr(void *arg, struct sockaddr_dl *sdl, u_int cnt) * Routines for multicast and vlan filter management. * *********************************************************************/ - -/** - * ixl_add_multi - Add multicast filters to the hardware - * @vsi: The VSI structure - * - * In case number of multicast filters in the IFP exceeds 127 entries, - * multicast promiscuous mode will be enabled and the filters will be removed - * from the hardware - */ void ixl_add_multi(struct ixl_vsi *vsi) { @@ -608,20 +599,14 @@ ixl_add_multi(struct ixl_vsi *vsi) struct i40e_hw *hw = vsi->hw; int mcnt = 0; struct ixl_add_maddr_arg cb_arg; - enum i40e_status_code status; IOCTL_DEBUGOUT("ixl_add_multi: begin"); mcnt = if_llmaddr_count(ifp); if (__predict_false(mcnt >= MAX_MULTICAST_ADDR)) { - status = i40e_aq_set_vsi_multicast_promiscuous(hw, vsi->seid, - TRUE, NULL); - if (status != I40E_SUCCESS) - if_printf(ifp, "Failed to enable multicast promiscuous " - "mode, status: %s\n", i40e_stat_str(hw, status)); - else - if_printf(ifp, "Enabled multicast promiscuous mode\n"); - /* Delete all existing MC filters */ + i40e_aq_set_vsi_multicast_promiscuous(hw, + vsi->seid, TRUE, NULL); + /* delete all existing MC filters */ ixl_del_multi(vsi, true); return; } @@ -647,92 +632,30 @@ ixl_match_maddr(void *arg, struct sockaddr_dl *sdl, u_int cnt) return (0); } -/** - * ixl_dis_multi_promisc - Disable multicast promiscuous mode - * @vsi: The VSI structure - * @vsi_mcnt: Number of multicast filters in the VSI - * - * Disable multicast promiscuous mode based on number of entries in the IFP - * and the VSI, then re-add multicast filters. - * - */ -static void -ixl_dis_multi_promisc(struct ixl_vsi *vsi, int vsi_mcnt) -{ - struct ifnet *ifp = vsi->ifp; - struct i40e_hw *hw = vsi->hw; - int ifp_mcnt = 0; - enum i40e_status_code status; - - ifp_mcnt = if_llmaddr_count(ifp); - /* - * Equal lists or empty ifp list mean the list has not been changed - * and in such case avoid disabling multicast promiscuous mode as it - * was not previously enabled. Case where multicast promiscuous mode has - * been enabled is when vsi_mcnt == 0 && ifp_mcnt > 0. - */ - if (ifp_mcnt == vsi_mcnt || ifp_mcnt == 0 || - ifp_mcnt >= MAX_MULTICAST_ADDR) - return; - - status = i40e_aq_set_vsi_multicast_promiscuous(hw, vsi->seid, - FALSE, NULL); - if (status != I40E_SUCCESS) { - if_printf(ifp, "Failed to disable multicast promiscuous " - "mode, status: %s\n", i40e_stat_str(hw, status)); - - return; - } - - if_printf(ifp, "Disabled multicast promiscuous mode\n"); - - ixl_add_multi(vsi); -} - -/** - * ixl_del_multi - Delete multicast filters from the hardware - * @vsi: The VSI structure - * @all: Bool to determine if all the multicast filters should be removed - * - * In case number of multicast filters in the IFP drops to 127 entries, - * multicast promiscuous mode will be disabled and the filters will be reapplied - * to the hardware. - */ void ixl_del_multi(struct ixl_vsi *vsi, bool all) { - int to_del_cnt = 0, vsi_mcnt = 0; + struct ixl_ftl_head to_del; if_t ifp = vsi->ifp; struct ixl_mac_filter *f, *fn; - struct ixl_ftl_head to_del; + int mcnt = 0; IOCTL_DEBUGOUT("ixl_del_multi: begin"); LIST_INIT(&to_del); /* Search for removed multicast addresses */ LIST_FOREACH_SAFE(f, &vsi->ftl, ftle, fn) { - if ((f->flags & IXL_FILTER_MC) == 0) - continue; - - /* Count all the multicast filters in the VSI for comparison */ - vsi_mcnt++; - - if (!all && if_foreach_llmaddr(ifp, ixl_match_maddr, f) != 0) + if ((f->flags & IXL_FILTER_MC) == 0 || + (!all && (if_foreach_llmaddr(ifp, ixl_match_maddr, f) == 0))) continue; LIST_REMOVE(f, ftle); LIST_INSERT_HEAD(&to_del, f, ftle); - to_del_cnt++; - } - - if (to_del_cnt > 0) { - ixl_del_hw_filters(vsi, &to_del, to_del_cnt); - return; + mcnt++; } - ixl_dis_multi_promisc(vsi, vsi_mcnt); - - IOCTL_DEBUGOUT("ixl_del_multi: end"); + if (mcnt > 0) + ixl_del_hw_filters(vsi, &to_del, mcnt); } void