From nobody Thu Dec 19 17:08:26 2024 X-Original-To: dev-commits-src-main@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 4YDcSv2r8Bz5hT2S; Thu, 19 Dec 2024 17:08:31 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YDcSv14mlz41WW; Thu, 19 Dec 2024 17:08:31 +0000 (UTC) (envelope-from rpokala@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734628111; 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: in-reply-to:in-reply-to:references:references; bh=Wmj3XDVdLHoiu2r5Ekxn+mm+QRVQ4YXHLhioJ102rRs=; b=IUEAnZhN3uUaaJ4FDVKlj90oGv13cn7GDrSUnWVcohUmgVZ8q6paT2BWT1CvqIhD1+0UUm cweGeDW6H4Bm6qHJ9hEARAKw171/o6CIM7nvhaiaKQ/2jxhAfSfzy5Gn/3hbQMYMoafuk2 18iGCo1oEVCbsWoRHicjNPg1dtbiPXGLD2z+Ko/oirFMnVPwDkZn3SHhUUU+H0X6n3fNRJ hnJc9U2wn6Un6O4nOd8xWMXeCoQnkW4n+3TX2pK6cV1gWpO9rmIUN51Lj7Fbe3JpDtY91e 5OCK+Mvi2KcLxpihDicENSHhA4WrTHovC6zt72/VrvyORxtxvyWnA0cgNakngA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734628111; 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: in-reply-to:in-reply-to:references:references; bh=Wmj3XDVdLHoiu2r5Ekxn+mm+QRVQ4YXHLhioJ102rRs=; b=XkZgS2gr0x+X4g7IVItY9RQ2P3Xd9+ecwvMbx5b4Bdl+UuOvQBb46PkRBh2LWuQTi/jYo6 OhlyPkpD1L2PyN1HAGym4H0qR8Xn8ZookBiBsNHqk/HFJ+yo9JndoCX0xzQt1QDzCbhcdp AJccJ/UpxCbjeVBeluxNvAbuuzyw/479zm1Tpso9ixiZnIqPW5GaqK+oGXociKQB6MMVsJ CKaAxqjUftiBjgQSCACCDgy9bf3gx8leWC5tC7n5accEqOOEx9oIi8mUzgvm6UlIAT/9tv 52bQiPEYUjt7WwEOtOBJCQbSm5NhQLD2W1CvdSGVWXLvkZE39jS8K6wUqQSTHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734628111; a=rsa-sha256; cv=none; b=sOdoZXk2WVDffuP0hnD9C74Sj4shoSYSVGnmwqKtBZZVFB1fHHtVnzjYy87emL0oR7Mcy6 w6G/6Z//jUY5Y54jhLFm+fSS9/KREzjZQZb6ie1dlHBxvOJgJYtOJxnJo3ewt91OOX9YZh OlmQg7lrT47pBWjaTd+ig1ZnBQ/EDL/thU0guiMlyM1SiQ2v/h6Tk76pqNuLpmL1Hk7XTk XkT5s7+le7BTD8Lj4wW5SqAvZpeL78uLrUGz5liWv1bP1H3t43awb3lBhIQ2vHaGXxZpbx xXmdoHCx1Q//QRgx9Mwh21hbIRavdW72EGOxsLVE/TdSKztcqjIosAwhXTKmrA== Received: from [192.168.1.54] (c-73-231-46-254.hsd1.ca.comcast.net [73.231.46.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id 4YDcSt2rb0zY5X; Thu, 19 Dec 2024 17:08:30 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/16.92.24120731 Date: Thu, 19 Dec 2024 09:08:26 -0800 Subject: Re: 38663adb6144 - main - Revert "ixl: fix multicast filters handling" From: Ravi Pokala To: Mark Johnston , , , Message-ID: Thread-Topic: 38663adb6144 - main - Revert "ixl: fix multicast filters handling" References: <202412191349.4BJDnnV4010675@gitrepo.freebsd.org> In-Reply-To: <202412191349.4BJDnnV4010675@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable > Revert "ixl: fix multicast filters handling" Yes, but *why*? -Ravi (rpokala@) =EF=BB=BF-----Original Message----- From: > on behalf of Mark Johnston > Date: Thursday, December 19, 2024 at 05:49 To: >, >, > Subject: git: 38663adb6144 - main - Revert "ixl: fix multicast filters hand= ling" The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3D38663adb61440bd659fb457909782b= 71ba8806fa commit 38663adb61440bd659fb457909782b71ba8806fa Author: Franco Fichtner > AuthorDate: 2024-12-11 14:08:40 +0000 Commit: Mark Johnston > CommitDate: 2024-12-19 13:49:30 +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 --- 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 9755136df848..1752efc02fff 100644 --- a/sys/dev/ixl/ixl_pf_main.c +++ b/sys/dev/ixl/ixl_pf_main.c @@ -593,15 +593,6 @@ ixl_add_maddr(void *arg, struct sockaddr_dl *sdl, u_in= t 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 remo= ved - * from the hardware - */ void ixl_add_multi(struct ixl_vsi *vsi) { @@ -609,20 +600,14 @@ ixl_add_multi(struct ixl_vsi *vsi) struct i40e_hw *hw =3D vsi->hw; int mcnt =3D 0; struct ixl_add_maddr_arg cb_arg; - enum i40e_status_code status; IOCTL_DEBUGOUT("ixl_add_multi: begin"); mcnt =3D if_llmaddr_count(ifp); if (__predict_false(mcnt >=3D MAX_MULTICAST_ADDR)) { - status =3D i40e_aq_set_vsi_multicast_promiscuous(hw, vsi->seid, - TRUE, NULL); - if (status !=3D 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; } @@ -648,92 +633,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 IF= P - * and the VSI, then re-add multicast filters. - * - */ -static void -ixl_dis_multi_promisc(struct ixl_vsi *vsi, int vsi_mcnt) -{ - struct ifnet *ifp =3D vsi->ifp; - struct i40e_hw *hw =3D vsi->hw; - int ifp_mcnt =3D 0; - enum i40e_status_code status; - - ifp_mcnt =3D 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 =3D=3D 0 && ifp_mcnt > 0. - */ - if (ifp_mcnt =3D=3D vsi_mcnt || ifp_mcnt =3D=3D 0 || - ifp_mcnt >=3D MAX_MULTICAST_ADDR) - return; - - status =3D i40e_aq_set_vsi_multicast_promiscuous(hw, vsi->seid, - FALSE, NULL); - if (status !=3D 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 rea= pplied - * to the hardware. - */ void ixl_del_multi(struct ixl_vsi *vsi, bool all) { - int to_del_cnt =3D 0, vsi_mcnt =3D 0; + struct ixl_ftl_head to_del; if_t ifp =3D vsi->ifp; struct ixl_mac_filter *f, *fn; - struct ixl_ftl_head to_del; + int mcnt =3D 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) =3D=3D 0) - continue; - - /* Count all the multicast filters in the VSI for comparison */ - vsi_mcnt++; - - if (!all && if_foreach_llmaddr(ifp, ixl_match_maddr, f) !=3D 0) + if ((f->flags & IXL_FILTER_MC) =3D=3D 0 || + (!all && (if_foreach_llmaddr(ifp, ixl_match_maddr, f) =3D=3D 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