From nobody Mon Jul 28 17:45:57 2025 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 4brQrP3VSlz63K3y for ; Mon, 28 Jul 2025 17:46:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brQrP0NT7z3l67 for ; Mon, 28 Jul 2025 17:46:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pg1-x531.google.com with SMTP id 41be03b00d2f7-b34a78bb6e7so3951612a12.3 for ; Mon, 28 Jul 2025 10:46:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1753724770; x=1754329570; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=OCrbIcMVJtlOLHh6d4uw/FMu6e5uTzPrDrBuXAyGadc=; b=ceuhJe03/XhsIuTaFHvl6B9F7SvL3W+mU4pWaOBbAouhphdkUvqtDxSbYrvx5InUI4 TYd/dzryhYTHc4QcE+6CQP0Ip3jZszO+fM0Tg1JHIglc2bR/GUhXnJI4AJI3NfdCO1Xn 2SCfzdZ2DHp7FvA0kTOQ83L7g6nr818yPLn9WDp3k8GqaPFWkgVLCNZ3+p5VxoxqT1IQ kvtniQ9UU9rOrwtck7e6ymng6qbajlhLTzU3lSnL0YY2f26YgvkTGGrWRFk0nBzGs52o H5GeSG/nPY1nd0NkR7jhOoJWV0c4ZNDl9+2eFb7k1spyYhI8wLV9PzhCyUy1g0pyHhDR vDkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753724770; x=1754329570; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OCrbIcMVJtlOLHh6d4uw/FMu6e5uTzPrDrBuXAyGadc=; b=dVyS55t5d3ofjISHJdTr8kA/h6J9ExYAmp64+xD7XEt5BZfyVS/WNlaVYD6UdbaE1L tMPGr7JDQXcOXMhe40QPlxxtgcu51JbXj/r/JV3XMnvI3hf52KbTizC2GHhykrmVOyzZ N0dePYkb7qyDx9udECTVQWAkLPOLYoBLNbt2hK3+pZmDfmvYMVi0I4xXbkjAVownTw8S Apx5wBX+UA+2yApQf+F6bvb+B4JIjCc2X9ckG62EEeKe3EdNEDu/5QiW2dRyHY1E61Wj yYSWgg/6WGoQZOeVAez/kv/x149U8oSBGJ06gDM5wW0kRzwUSZ6M9FhjK9eDW/sglsPE uqWw== X-Forwarded-Encrypted: i=1; AJvYcCVom0/7gnHyA1IkXXxyhaAvHIdlERRmdXhrKw+2qPZ/IE7onBQTjALjJsg14ljP83hRFKj24joSCLjtoMHnyAAaLE21pQ==@freebsd.org X-Gm-Message-State: AOJu0YyUnX6bD3YE9bgsJpyKEZVgxnmfyoV6PJIvINQitYhLpG74V2/H HxUGfPuQ4Bo9gJjgPx9N9AWwD+eOhQxoaHJoid9jvLOHyugTrPnpubOPpLCA+A60iuyzUDqiOTJ zMyvnhspBJdnZBbRullGjoTGNHYOa7yASaOBWnIQVKQ== X-Gm-Gg: ASbGnctkCDbOHlOHIyg28Vc9T3BOMgmIwmA952WbaLSjwo85i++PE/Gkcdw9mUHZr0B dS+Dq54wiIn1Oa9hKrE1V3kTj77UHbHN149c1yw3bP+VJmpaIRb7Tb/MveHkLJzIlOJkh60n5Ld Q30BTGUgtp4b0UzzRtIyz64D/yinqTng7T1E3gWz0L2q6Q/3o4kDbMr2lU+7lFuclmzrRYu1V/V Sa30Q== X-Google-Smtp-Source: AGHT+IFRmyH3RTfAHdCMtPGOTcnwuxXWW8HJtnLNLuqytQ+v4z0H10NLGcfMx3qUngJIhMszStoWRUdVoEzSlVcRjAw= X-Received: by 2002:a17:90b:1350:b0:311:c939:c851 with SMTP id 98e67ed59e1d1-31e77735cbbmr17637059a91.4.1753724770066; Mon, 28 Jul 2025 10:46:10 -0700 (PDT) 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 References: <202507181916.56IJGLMK001122@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Mon, 28 Jul 2025 07:45:57 -1000 X-Gm-Features: Ac12FXzbs1FXlRPNWeXw5eCTNsF0FI00duolX2brTjc1gpfuhDwS3UZYYMVhgqM Message-ID: Subject: Re: git: 430f1acc451c - main - ice(4): Add MAC filter and VLAN resource limits to VFs To: Kristof Provost Cc: Warner Losh , Eric Joyner , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4brQrP0NT7z3l67 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] I think DES may have just fixed this. Can you confirm? Warner On Mon, Jul 28, 2025 at 3:23=E2=80=AFAM Kristof Provost wr= ote: > > I=E2=80=99m not sure if it=E2=80=99s this specific commit or another one = in the recent dev/ice updates, but the arm64 LINT-FDT, LINT-ACPI and LINT b= uilds all fail. > > This is from arm64-LINT: > > ld: error: undefined symbol: ice_iov_attach > >>> referenced by if_ice_iflib.c:859 (/usr/src/sys/dev/ice/if_ice= _iflib.c:859) > >>> if_ice_iflib.o:(ice_if_attach_post) > > ld: error: undefined symbol: ice_iov_detach > >>> referenced by if_ice_iflib.c:989 (/usr/src/sys/dev/ice/if_ice= _iflib.c:989) > >>> if_ice_iflib.o:(ice_if_detach) > >>> referenced by if_ice_iflib.c:2323 (/usr/src/sys/dev/ice/if_ic= e_iflib.c:2323) > >>> if_ice_iflib.o:(ice_if_update_admin_status) > >>> referenced by if_ice_iflib.c:2376 (/usr/src/sys/dev/ice/if_ic= e_iflib.c:2376) > >>> if_ice_iflib.o:(ice_transition_safe_mode) > > ld: error: undefined symbol: ice_iov_add_vf > >>> referenced by if_ice_iflib.c:3464 (/usr/src/sys/dev/ice/if_ic= e_iflib.c:3464) > >>> if_ice_iflib.o:(ice_if_iov_vf_add) > > ld: error: undefined symbol: ice_iov_init > >>> referenced by if_ice_iflib.c:3429 (/usr/src/sys/dev/ice/if_ic= e_iflib.c:3429) > >>> if_ice_iflib.o:(ice_if_iov_init) > > ld: error: undefined symbol: ice_iov_uninit > >>> referenced by if_ice_iflib.c:3445 (/usr/src/sys/dev/ice/if_ic= e_iflib.c:3445) > >>> if_ice_iflib.o:(ice_if_iov_uninit) > > ld: error: undefined symbol: ice_iov_handle_vflr > >>> referenced by if_ice_iflib.c:3480 (/usr/src/sys/dev/ice/if_ic= e_iflib.c:3480) > >>> if_ice_iflib.o:(ice_if_vflr_handle) > > ld: error: undefined symbol: ice_vc_notify_all_vfs_link_state > >>> referenced by if_ice_iflib.c:757 (/usr/src/sys/dev/ice/if_ice= _iflib.c:757) > >>> if_ice_iflib.o:(ice_update_link_status) > > ld: error: undefined symbol: ice_vc_handle_vf_msg > >>> referenced by ice_lib.c:2285 (/usr/src/sys/dev/ice/ice_lib.c:= 2285) > >>> ice_lib.o:(ice_process_ctrlq) > *** [kernel.full] Error code 1 > > =E2=80=94 > Kristof > > On 18 Jul 2025, at 21:16, Warner Losh wrote: > > The branch main has been updated by imp: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D430f1acc451c7084d1d5aa7d= f7e7ecccea1a8b51 > > > > commit 430f1acc451c7084d1d5aa7df7e7ecccea1a8b51 > > Author: Eric Joyner > > AuthorDate: 2024-10-17 22:19:09 +0000 > > Commit: Warner Losh > > CommitDate: 2025-07-18 19:16:17 +0000 > > > > ice(4): Add MAC filter and VLAN resource limits to VFs > > > > Adds two new parameters to iovctl config for VLAN filter limits and= MAC > > filter limits and gives them defaults of 64 and 16, respectively. > > > > These are intended to limit the number of resources that a VF can > > consume so that any one VF cannot starve an other VFs or the PF of > > filters. > > > > Signed-off-by: Eric Joyner > > Signed-off-by: Krzysztof Galazka > > Reviewed by: imp > > Pull Request: https://github.com/freebsd/freebsd-src/pull/1573 > > --- > > sys/dev/ice/ice_iov.c | 45 ++++++++++++++++++++++++++++++++++++++++++-= -- > > sys/dev/ice/ice_iov.h | 8 ++++++++ > > 2 files changed, 50 insertions(+), 3 deletions(-) > > > > diff --git a/sys/dev/ice/ice_iov.c b/sys/dev/ice/ice_iov.c > > index fc37a0e7679c..e06c7eb56f7a 100644 > > --- a/sys/dev/ice/ice_iov.c > > +++ b/sys/dev/ice/ice_iov.c > > @@ -117,6 +117,10 @@ ice_iov_attach(struct ice_softc *sc) > > IOV_SCHEMA_HASDEFAULT, ICE_DEFAULT_VF_QUEUES); > > pci_iov_schema_add_uint16(vf_schema, "mirror-src-vsi", > > IOV_SCHEMA_HASDEFAULT, ICE_INVALID_MIRROR_VSI); > > + pci_iov_schema_add_uint16(vf_schema, "max-vlan-allowed", > > + IOV_SCHEMA_HASDEFAULT, ICE_DEFAULT_VF_VLAN_LIMIT); > > + pci_iov_schema_add_uint16(vf_schema, "max-mac-filters", > > + IOV_SCHEMA_HASDEFAULT, ICE_DEFAULT_VF_FILTER_LIMIT); > > > > error =3D pci_iov_attach(dev, pf_schema, vf_schema); > > if (error !=3D 0) { > > @@ -360,6 +364,9 @@ ice_iov_add_vf(struct ice_softc *sc, uint16_t vfnum= , const nvlist_t *params) > > > > vsi->mirror_src_vsi =3D nvlist_get_number(params, "mirror-src-vsi= "); > > > > + vf->vlan_limit =3D nvlist_get_number(params, "max-vlan-allowed"); > > + vf->mac_filter_limit =3D nvlist_get_number(params, "max-mac-filte= rs"); > > + > > vf->vf_flags |=3D VF_FLAG_VLAN_CAP; > > > > /* Create and setup VSI in HW */ > > @@ -735,10 +742,17 @@ ice_vc_add_eth_addr_msg(struct ice_softc *sc, str= uct ice_vf *vf, u8 *msg_buf) > > enum virtchnl_status_code v_status =3D VIRTCHNL_STATUS_SUCCESS; > > struct virtchnl_ether_addr_list *addr_list; > > struct ice_hw *hw =3D &sc->hw; > > + u16 added_addr_cnt =3D 0; > > int error =3D 0; > > > > addr_list =3D (struct virtchnl_ether_addr_list *)msg_buf; > > > > + if (addr_list->num_elements > > > + (vf->mac_filter_limit - vf->mac_filter_cnt)) { > > + v_status =3D VIRTCHNL_STATUS_ERR_NO_MEMORY; > > + goto done; > > + } > > + > > for (int i =3D 0; i < addr_list->num_elements; i++) { > > u8 *addr =3D addr_list->list[i].addr; > > > > @@ -767,10 +781,15 @@ ice_vc_add_eth_addr_msg(struct ice_softc *sc, str= uct ice_vf *vf, u8 *msg_buf) > > "%s: VF-%d: Error adding MAC addr for VSI %d\= n", > > __func__, vf->vf_num, vf->vsi->idx); > > v_status =3D VIRTCHNL_STATUS_ERR_PARAM; > > - goto done; > > + continue; > > } > > + /* Don't count VF's MAC against its MAC filter limit */ > > + if (memcmp(addr, vf->mac, ETHER_ADDR_LEN)) > > + added_addr_cnt++; > > } > > > > + vf->mac_filter_cnt +=3D added_addr_cnt; > > + > > done: > > ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_ADD_ETH_ADDR, > > v_status, NULL, 0, NULL); > > @@ -791,6 +810,7 @@ ice_vc_del_eth_addr_msg(struct ice_softc *sc, struc= t ice_vf *vf, u8 *msg_buf) > > enum virtchnl_status_code v_status =3D VIRTCHNL_STATUS_SUCCESS; > > struct virtchnl_ether_addr_list *addr_list; > > struct ice_hw *hw =3D &sc->hw; > > + u16 deleted_addr_cnt =3D 0; > > int error =3D 0; > > > > addr_list =3D (struct virtchnl_ether_addr_list *)msg_buf; > > @@ -802,11 +822,18 @@ ice_vc_del_eth_addr_msg(struct ice_softc *sc, str= uct ice_vf *vf, u8 *msg_buf) > > "%s: VF-%d: Error removing MAC addr for VSI %= d\n", > > __func__, vf->vf_num, vf->vsi->idx); > > v_status =3D VIRTCHNL_STATUS_ERR_PARAM; > > - goto done; > > + continue; > > } > > + /* Don't count VF's MAC against its MAC filter limit */ > > + if (memcmp(addr_list->list[i].addr, vf->mac, ETHER_ADDR_L= EN)) > > + deleted_addr_cnt++; > > } > > > > -done: > > + if (deleted_addr_cnt >=3D vf->mac_filter_cnt) > > + vf->mac_filter_cnt =3D 0; > > + else > > + vf->mac_filter_cnt -=3D deleted_addr_cnt; > > + > > ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_DEL_ETH_ADDR, > > v_status, NULL, 0, NULL); > > } > > @@ -838,6 +865,11 @@ ice_vc_add_vlan_msg(struct ice_softc *sc, struct i= ce_vf *vf, u8 *msg_buf) > > goto done; > > } > > > > + if (vlan_list->num_elements > (vf->vlan_limit - vf->vlan_cnt)) { > > + v_status =3D VIRTCHNL_STATUS_ERR_NO_MEMORY; > > + goto done; > > + } > > + > > status =3D ice_add_vlan_hw_filters(vsi, vlan_list->vlan_id, > > vlan_list->num_elements); > > if (status) { > > @@ -849,6 +881,8 @@ ice_vc_add_vlan_msg(struct ice_softc *sc, struct ic= e_vf *vf, u8 *msg_buf) > > goto done; > > } > > > > + vf->vlan_cnt +=3D vlan_list->num_elements; > > + > > done: > > ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_ADD_VLAN, > > v_status, NULL, 0, NULL); > > @@ -892,6 +926,11 @@ ice_vc_del_vlan_msg(struct ice_softc *sc, struct i= ce_vf *vf, u8 *msg_buf) > > goto done; > > } > > > > + if (vlan_list->num_elements >=3D vf->vlan_cnt) > > + vf->vlan_cnt =3D 0; > > + else > > + vf->vlan_cnt -=3D vlan_list->num_elements; > > + > > done: > > ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_DEL_VLAN, > > v_status, NULL, 0, NULL); > > diff --git a/sys/dev/ice/ice_iov.h b/sys/dev/ice/ice_iov.h > > index c2ac5fcd5c94..c4fb3e932e3f 100644 > > --- a/sys/dev/ice/ice_iov.h > > +++ b/sys/dev/ice/ice_iov.h > > @@ -85,6 +85,11 @@ struct ice_vf { > > u16 vf_num; > > struct virtchnl_version_info version; > > > > + u16 mac_filter_limit; > > + u16 mac_filter_cnt; > > + u16 vlan_limit; > > + u16 vlan_cnt; > > + > > u16 num_irq_vectors; > > u16 *vf_imap; > > struct ice_irq_vector *tx_irqvs; > > @@ -101,6 +106,9 @@ struct ice_vf { > > #define ICE_VIRTCHNL_VALID_PROMISC_FLAGS (FLAG_VF_UNICAST_PROMISC = | \ > > FLAG_VF_MULTICAST_PROMIS= C) > > > > +#define ICE_DEFAULT_VF_VLAN_LIMIT 64 > > +#define ICE_DEFAULT_VF_FILTER_LIMIT 16 > > + > > int ice_iov_attach(struct ice_softc *sc); > > int ice_iov_detach(struct ice_softc *sc);