From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 931AFC369AB for ; Sat, 12 Apr 2025 18:51:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 37B88812AF; Sat, 12 Apr 2025 18:51:43 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id eBeYtXAe7oGy; Sat, 12 Apr 2025 18:51:42 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 9EA9780DA3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1744483902; bh=I2K5+74DxP8aE5nIFyeb6U3ff7ON870/pRfVI5lloEU=; h=Date:From:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=k2M8FlGJWqSkCa7nxSO3ePXqmw4GoGW7FsUsgToDCzPkN7TyVd+wCR27sC0WwSi0c bYCUzeI5irsdc48qnlcJ73X3wUe2W2QyGloKwh78puvN56netS/LQw7lMxuy37iACJ e7DykErixkcRfqyaXt6/2BsqMhZ1nezfkdvqwP9hVLcGSIpSQL8wNeqy52tt+F4BaF mSKZCvCLgwdDT4zmJgsk0A3YIBO1eX/rB6fuo1uSY0zV0An1yfjLP+87AwmiBXYg6C SxZbPIPlQTzsk5aG0yuJarsWVipFDe+g6he4XjIAeP9YVYJMIw/T9cTgDhF78wCOgE F2cZKsHrQBmGw== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp1.osuosl.org (Postfix) with ESMTP id 9EA9780DA3; Sat, 12 Apr 2025 18:51:42 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists1.osuosl.org (Postfix) with ESMTP id E9E53DE for ; Sat, 12 Apr 2025 18:51:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id DBD6F40540 for ; Sat, 12 Apr 2025 18:51:41 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id ScmSFGRCa9Sx for ; Sat, 12 Apr 2025 18:51:41 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2604:1380:45d1:ec00::3; helo=nyc.source.kernel.org; envelope-from=horms@kernel.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp4.osuosl.org 4A28D40530 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 4A28D40530 Received: from nyc.source.kernel.org (nyc.source.kernel.org [IPv6:2604:1380:45d1:ec00::3]) by smtp4.osuosl.org (Postfix) with ESMTPS id 4A28D40530 for ; Sat, 12 Apr 2025 18:51:41 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 57FDAA499BE; Sat, 12 Apr 2025 18:46:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46A1AC4CEE3; Sat, 12 Apr 2025 18:51:38 +0000 (UTC) Date: Sat, 12 Apr 2025 19:51:35 +0100 From: Simon Horman To: Jacob Keller Cc: Anthony Nguyen , Intel Wired LAN , netdev Message-ID: <20250412185135.GR395307@horms.kernel.org> References: <20250410-jk-fix-v-num-mac-count-v1-1-19b3bf8fe55a@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250410-jk-fix-v-num-mac-count-v1-1-19b3bf8fe55a@intel.com> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1744483899; bh=TJeAhN7UVWxKbz3b/oizNT6LyE4kHo/KOvKEu07vtLg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lAIyXFd6exOgyUDReZVkzxe/lcBoXJM4hyi8P6AultpmXSFeONVfHE5IysRUKZxmo S3FXR4r/QNIz305NOwAwNNr4jLoVCijU6OFLyXSZHBM2Z+ld5u8SHghYRyvfhFKkBl SwE8lmmcA4CWfa+cGy6UMAWIeaiR7zyyemyrt2CWHlMrUUUWkEL5rn94bxWWB3OlRw 56zCAlPdHdH1GnYhqx3v4fpPlfGqBRf95OfslL5eFb+YYTLVKINAOj+ywHpKAUOqSO sjkT148npoTtNC+4VPHYsI2WxjDue0kkbckZUODh1os/HmsPRfTdNGAnLoGydKw9li i2QvJh2Hzlkhw== X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=lAIyXFd6 Subject: Re: [Intel-wired-lan] [PATCH net] ice: fix vf->num_mac count with port representors X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" On Thu, Apr 10, 2025 at 11:13:52AM -0700, Jacob Keller wrote: > The ice_vc_repr_add_mac() function indicates that it does not store the MAC > address filters in the firmware. However, it still increments vf->num_mac. > This is incorrect, as vf->num_mac should represent the number of MAC > filters currently programmed to firmware. > > Indeed, we only perform this increment if the requested filter is a unicast > address that doesn't match the existing vf->hw_lan_addr. In addition, > ice_vc_repr_del_mac() does not decrement the vf->num_mac counter. This > results in the counter becoming out of sync with the actual count. > > As it turns out, vf->num_mac is currently only used in legacy made without > port representors. The single place where the value is checked is for > enforcing a filter limit on untrusted VFs. > > Upcoming patches to support VF Live Migration will use this value when > determining the size of the TLV for MAC address filters. Fix the > representor mode function to stop incrementing the counter incorrectly. > > Fixes: ac19e03ef780 ("ice: allow process VF opcodes in different ways") > Signed-off-by: Jacob Keller > --- > I am not certain if there is currently a way to trigger a bug from > userspace due to this incorrect count, but I think it still warrants a net > fix. Reviewed-by: Simon Horman