From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F21BC2FDC20 for ; Thu, 25 Jun 2026 21:29:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=209.85.214.171 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782422942; cv=pass; b=ClWSiickMKh1Q9uoWiXJ7vZCsAaqPhZZZ78ClyjXYlizV1kRJtzrTWHW8SEQjIupimYKsWwfNdf/+/wS7+SlaxBLaHg0Wn9j78PBbq/v872TnkhkqnNgkmUDb6tnhEMUAf+9jgUePTDZ4HeJ5qE3hb9Dl0NYY6DWsresMYikRYY= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782422942; c=relaxed/simple; bh=1Xyx8W0Z+JIOWqgLlicHnvUh6a9r/45uuHSZaEVor34=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=iejNmymmZ1T17tYEXZH9IS0N9GdKRj3MDIVR8aEe4aNlkEMzc/16tJKzWaFzqNhr95B534OKlW42vjdDnA7Ea0Ro1jvt4u0ZHDMsMMzx0CXug9J1hM4YuSsYgQ4EC3NX8a6ZNGgxHqD/ih1+VAD96kHIYzeBCSiNeHO0RiwucbA= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=FTnxzVL6; arc=pass smtp.client-ip=209.85.214.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="FTnxzVL6" Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-2c6b7bd4e8dso19645ad.0 for ; Thu, 25 Jun 2026 14:29:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1782422940; cv=none; d=google.com; s=arc-20260327; b=dWBM3gQWVdXeBsOv9EWq7M9TQa5PGMaca/gVhf9V2PpgBTOEe9m7XScIAK7OLEDXFP OGMG+7aqa9Cu67Q198MoU2I5C6S8WuXmz1hSoU+QX3EPPDZ5FJjfEGsRRFVLX1CW663V uAQ56dAog3qhq67h9bI2rb+uczH6UHktJd6hzXGRcXM2FKjJMr7BUlMk4e+lwMh3PWju 6+9dU7gFvwFqIwrOCEeO2whrcdzk5FqsXyxlXnXaIqRiyH79m2LTYSdwad2AyG4uU+ck v27GgRhZfvkk9C2ZcuNExFU0aUhZjTNMFpvG8qb7mtV99O28WYkwcGKgWyA4d7WbrEgS t3Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=U/K6FS8OHtfPW4sc0GOPpS1fFZMsSDr7GHXpqE3znQA=; fh=z9obaSqYXsnpuP+G2r7SuoXzocY0pHM2jrC3IWsqhZU=; b=UZ3Z5bR33lgLGnlcHU5uB1+TwqffKm9o2ZD6TzWkNRmn0uf37lrtHM2bv/pCwokV0T QHGOKheZdajs7QQ656biH65wmRsCLpJZO1SlvX93E3f+O2hvbEyucELW3DodmEhxy676 YHFZssVkZ1XiS7FSt2Mb5s10gCLW1fAT0ea9C31JWGDnJFTRsCVbpCjGw56adHc4VDyt 6vzYd3jiiMGs4hM9zpKIXrzbJMmWDMXnJmsNMVUtzb/GNuUBIPxrxvRoyDgSr2hIZE5L y4Psdd9nNwMVJd83kLrY6XA5+b2M+PfEc4/FE3quDukIrXSIkE0qsullSCEcXOoZ8Wq5 h6/g==; darn=vger.kernel.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1782422940; x=1783027740; darn=vger.kernel.org; h=content-transfer-encoding:content-type:cc:to:subject:message-id :date:from:in-reply-to:references:mime-version:from:to:cc:subject :date:message-id:reply-to:content-type; bh=U/K6FS8OHtfPW4sc0GOPpS1fFZMsSDr7GHXpqE3znQA=; b=FTnxzVL6MVL4HmtwwFdLJXEF8DLL8C1z6E40nMHDJlU0IzpV7eFiqUBOwgBinKH4oj UxhoXKo0LqQ+/iPezR3kQ73gXVAELN/U5rEN7KaqWqdyugvPKtdRbcc1FzRpdfDRH2/l eRH4KSnKipvAyk0YEGT1+j8XQFuYCG/GiNIoWgoHiFRsHq4Fel/C1LHD3NYvDWhmoVnt EzSWCtxFwkcat+WjP0xKCjyxG/X9RVnwV+Mn/FaaacVUm0RIKc3jExlNp5yvoJTXZFBC 2h5I+X8VclFVkQ0lfi0ZbYBS2RMitqU9xvoepsUAX2GMpSJBoID7tuHINdspjO+qEGva omFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782422940; x=1783027740; h=content-transfer-encoding:content-type:cc:to:subject:message-id :date:from:in-reply-to:references:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=U/K6FS8OHtfPW4sc0GOPpS1fFZMsSDr7GHXpqE3znQA=; b=BzrT2Cp/Sc509G+26OWH74Kj5gAnasVNWTH5EyUYW/MHc7dpOYeJDXbLNE9utiUPUS GWDtYPQ73Fa4tJB02sG0uk9cbs1WU+oqeWK381BLVDtd08u1Xo+apZRsIW07JKsmf4Et 95aTD3NsLO4CdN5Uu524N2YXzg97dd7sYzCD6Qb9tOHVa26bcYWWExB1MZU4JhrrFQ49 ylsQZSWb/07/jGSHz8cJoh3nPMjHDZbZ2zd3Dzz8SRlBa2rfr3MS6Ut3rIKBgnNCxCJk QRWwFDsP18FknCwKEE0HH3sjNLkfxJ7EN0C07qVprAwoYh2wa0DUfYhLaqZqBwCLRLNA 4bGQ== X-Forwarded-Encrypted: i=1; AHgh+RpUg4e4DyC5CC9ewQPT/y7NFKifx1Bvwbq72mP3uITVpxZkWBpflyNSxJp1qScLK1hePN5rJj3Aw8tUosQ=@vger.kernel.org X-Gm-Message-State: AOJu0YznR9PYh/EZS2M8ZZ+0QTjk9USXl3xQQCgf2pMkbCtJBk/ZC7aW dNZXKb0MbzuDLxxcTzpU4NoNHyD+ZXhfGoRWub7685otEmR4ZbwqEIfDC3Yjp1+yH2Z+RXkYwWu tVErV+ZMwkLKQwJdEg4EkKxZaZknf+H/9w7PJ0RzZ X-Gm-Gg: AfdE7cmP/O3yeePt6+OXPQNynqILTDsDwWEi0rEq3Mj4Wjx2DZtFWonQVwK4BOHZVGl WX8Ir2xipm4lwdpHoAlxrzRHE/l93/HTF1JgODost+jgaMCAcHmH80s1V/lBpzh5RK/vh0e2TPM oGGZp60rsQY51f2j/co9JzdbUJHVyl9ec7t7WjSC8f/B2nPf/OyhNrcmDhFMxikXMApltFz4LPn PC88yCPMDwKESUFSwZaRZnH33OwiY//P2l6rJRyw43NzpoEfKtgowiAFtf5TDfVSQKa8GGeIOoe 0K802Q5nK2308JcES2e7KT6VX4GlfmqRTBR3Ziqei4wouYiQ3pKbJlWc9S3AhIhV07doPKc= X-Received: by 2002:a17:903:3c45:b0:2c0:c14c:bf37 with SMTP id d9443c01a7336-2c813c7686emr894545ad.16.1782422939567; Thu, 25 Jun 2026 14:28:59 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20260625172552.258631-1-nshettyj@marvell.com> In-Reply-To: <20260625172552.258631-1-nshettyj@marvell.com> From: Harshitha Ramamurthy Date: Thu, 25 Jun 2026 14:28:48 -0700 X-Gm-Features: AVVi8Cc1oHG5aBBKsCSvhPO2YVe5u8bV1RFsWlCAToR1pRVw4gxUugJl1duSTgs Message-ID: Subject: Re: [PATCH net] octeontx2-pf: check DMAC extraction support before filtering To: nshettyj@marvell.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, sgoutham@marvell.com, gakula@marvell.com, sbhatta@marvell.com, hkelam@marvell.com, bbhushan2@marvell.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, naveenm@marvell.com, tduszynski@marvell.com, sumang@marvell.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jun 25, 2026 at 10:30=E2=80=AFAM wrote: > > From: Suman Ghosh > > Currently, configuring a VF MAC address via the PF (e.g., 'ip link > set vf 0 mac ') blindly attempts to install a DMAC-based > hardware filter. However, the hardware parser profile might not > support DMAC extraction. > > Check if the hardware parsing profile supports DMAC extraction > before adding the filter. Additionally, emit a warning message > to inform the operator if the MAC filter installation fails due > to missing DMAC extraction support. > > Fixes: f0c2982aaf98 ("octeontx2-pf: Add support for SR-IOV management fun= ctions") > Signed-off-by: Suman Ghosh > Signed-off-by: Nitin Shetty J > --- > .../ethernet/marvell/octeontx2/nic/otx2_pf.c | 34 +++++++++++++++++++ > 1 file changed, 34 insertions(+) > > diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c b/drive= rs/net/ethernet/marvell/octeontx2/nic/otx2_pf.c > index b63df5737ff2..8e4435d9e520 100644 > --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c > +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c > @@ -2546,6 +2546,8 @@ static int otx2_do_set_vf_mac(struct otx2_nic *pf, = int vf, const u8 *mac) > static int otx2_set_vf_mac(struct net_device *netdev, int vf, u8 *mac) > { > struct otx2_nic *pf =3D netdev_priv(netdev); > + struct npc_get_field_status_req *req; > + struct npc_get_field_status_rsp *rsp; > struct pci_dev *pdev =3D pf->pdev; > struct otx2_vf_config *config; > int ret; > @@ -2559,6 +2561,38 @@ static int otx2_set_vf_mac(struct net_device *netd= ev, int vf, u8 *mac) > if (!is_valid_ether_addr(mac)) > return -EINVAL; > > + /* Skip installing the DMAC filter if the hardware parser profile > + * does not support DMAC extraction. > + */ > + mutex_lock(&pf->mbox.lock); > + req =3D otx2_mbox_alloc_msg_npc_get_field_status(&pf->mbox); > + if (!req) { > + mutex_unlock(&pf->mbox.lock); > + return -ENOMEM; > + } > + > + req->field =3D NPC_DMAC; > + if (otx2_sync_mbox_msg(&pf->mbox)) { > + mutex_unlock(&pf->mbox.lock); > + return -EINVAL; > + } > + > + rsp =3D (struct npc_get_field_status_rsp *)otx2_mbox_get_rsp > + (&pf->mbox.mbox, 0, &req->hdr); > + if (IS_ERR(rsp)) { > + mutex_unlock(&pf->mbox.lock); > + return PTR_ERR(rsp); > + } > + > + if (!rsp->enable) { > + mutex_unlock(&pf->mbox.lock); > + netdev_warn(netdev, "VF %d MAC filter not installed: DMAC= extraction not supported by parser profile\n", > + vf); > + return 0; Is the intent to return success here even though the MAC address was not programmed? > + } > + > + mutex_unlock(&pf->mbox.lock); > + Why not move all these checks into the otx2_do_set_vf_mac() since that anyway acquires the pf->mbox.lock? That way you could also fold all the mutex_unlock() calls introduced in the error paths in this patch into the existing goto-out in that function. > config =3D &pf->vf_configs[vf]; > ether_addr_copy(config->mac, mac); > > -- > 2.48.1 > >