From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (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 404C83563FA for ; Mon, 20 Jul 2026 14:02:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784556147; cv=none; b=Gwkd2QYBqulWZTlN+azrLZaOn4aYus9+YEDWsELIahwN71xSYWzlpq4T72JdfOf53/MswvGrFH1O0uXYVWOWZxZeysdjehucviTuDQnPz4Bx+WSY6p/AoSmbl6nB1FGFun15ZhVx0rkpAkOoqpfoVQeb9ZMi9flOWwLnH5b5+Ak= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784556147; c=relaxed/simple; bh=rzSDRNXg2hNBJYYiqAkMSddwIljDCmzWH3Th/zYE0UM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ewyblGYapgbUMx5RQ11POHuJoKDUW7IcfEYLbRRtDCy4CsDdMRw7snW5KzxDkjaF5en508k6tkntHL0tDBf1qjDsDIy5FekCkTw0BSx1VPvVQe13yanoRCfIMvvWNTysoDbuH4tHFHooKnizfGUirxybylpaMG4amaIM/RXr+Cc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dama.to; spf=none smtp.mailfrom=dama.to; dkim=pass (2048-bit key) header.d=dama-to.20251104.gappssmtp.com header.i=@dama-to.20251104.gappssmtp.com header.b=rAzFDGjY; arc=none smtp.client-ip=209.85.214.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dama.to Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=dama.to Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dama-to.20251104.gappssmtp.com header.i=@dama-to.20251104.gappssmtp.com header.b="rAzFDGjY" Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-2caea3f742bso121882765ad.0 for ; Mon, 20 Jul 2026 07:02:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dama-to.20251104.gappssmtp.com; s=20251104; t=1784556145; x=1785160945; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date:from :to:cc:subject:date:message-id:reply-to:content-type; bh=jjgcDbEk+UwGPrm8p3ddZGJiNEptTi23fs+y3mGJy60=; b=rAzFDGjYYX0iF7Hvx5u39nAwjX9ZfS+gM5m3EHb8gMYxg6bPCGzLUar6n0lt6uBAXy C7jaPk8svw9LpnbftP7sY+tsbrd6cAu4BNndVNrvTKus62KK7EY9/G9dTSAgy7J3CVke BtYv5UPyktl34d+sPR7RZFn0ee745XxB2KuFudI6oakA258vZq0xInNBiXYJaGL0KDH8 CGVNQ30Pk38ndeITE0/ee37hVln0+SXqXOoNIHwrYYNl1jPmiXxDlmw8VZ4t1C2gabYH cV4Sp/UF7E5xsS1LJdCm/bkBCBQJzZ60ezOlH9RYDmnkKg6mxMez5YWIC6OmqXeYMCi0 mw2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784556146; x=1785160946; h=in-reply-to:content-disposition:content-type:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=jjgcDbEk+UwGPrm8p3ddZGJiNEptTi23fs+y3mGJy60=; b=TGE4TLyh98Ul4mIVMiAuZuNC1Oyy85N9NxyfZsxkzVtKR+eus0OUh4z+w2iLSJ1rX7 HabnfNhTmR3UI6WEZS6h4tHwGjQAojKiW2iB+pKL7c5+CTX/3njXpnt8FHJzqpJ8imGP TWShccbCloRuxtPWAMwOCWsqiS1bGD4FMQSZ2iWeAlH4u1iQg0SuoF/glFA1Wz1ixwXz ZDsmRQNIqdeSiPURr6KLdIjgXWTQWpBOlJUrdLvK5pua871P5QlJzAj8/bS4DKHdM5te olzduhwt+V2S3knIycpcSvUsDuynzIFei037bxsw7hek0oBeF597abx1Fz8x5EVZJveL uY/w== X-Forwarded-Encrypted: i=1; AHgh+RrVKouBLpOUC4c5SPPWL6ariVWTxxel1ecviRohncxzWnNTII5/lTBwduZaiX/919Imyjf/05FtA+Sy/SA=@vger.kernel.org X-Gm-Message-State: AOJu0YyKJ9BXsLIzX0VQCg9Evui9FXwVxDmn48JNcjZM4M9NDYYUmVg4 ascb8Xwg/U2c8RLqgFd434tjH5PgJVYW2//9Fdk5wQAiuGRG5ti41KDe73AxQaWvYZ4= X-Gm-Gg: AR+sD11tFnMwHk6TckOaAGslcsTgy9W/2CyaEmDOHq1DSk6o8KHXWN3SSJSbA0QnZZl ZTaC9Ix92RCTY5awVtnYVE85YLA3CP/ccZESLs6zhCsCsQu50XVJTYNQIBRAVFZAJc8lMBl3PLk Mtybw+aBSgAEbCkVMC1am6Yr9kljDcgp4DEdZpwuKxkF93J6Vke1GI0lbO/5cblQ7dSk+rqDIe8 +rtmVZSkOH5h53LID0+r1xjOT7Y3wxJ11vykFQ0eik3Kc1oQW4fvP8+YD8vwQs9TjPZLfKi+y03 HRHUpIDplrPelV3oED+1CQHFehYjiIl1WsrhNZ94/9it/hOeVSHsPJYjXTuKlczKl7ubBwEAcle e81yCA0pPhK24glVfxIC5SKc4aHErxakNckzxcxN2sx5yw/33HX/7axnb5E9ZA6rlngjUsg== X-Received: by 2002:a17:902:f78c:b0:2cb:3f5b:6663 with SMTP id d9443c01a7336-2cf348bee75mr154491725ad.11.1784556145405; Mon, 20 Jul 2026 07:02:25 -0700 (PDT) Received: from localhost ([2a03:2880:2ff:43::]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cf346db113sm56870065ad.39.2026.07.20.07.02.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jul 2026 07:02:22 -0700 (PDT) Date: Mon, 20 Jul 2026 07:02:21 -0700 From: Joe Damato To: wei.fang@oss.nxp.com Cc: claudiu.manoil@nxp.com, vladimir.oltean@nxp.com, xiaoning.wang@nxp.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux@armlinux.org.uk, wei.fang@nxp.com, chleroy@kernel.org, maxime.chevallier@bootlin.com, imx@lists.linux.dev, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH RESEND v4 net-next 01/14] net: enetc: extract common helpers for MAC promiscuous mode setting Message-ID: Mail-Followup-To: Joe Damato , wei.fang@oss.nxp.com, claudiu.manoil@nxp.com, vladimir.oltean@nxp.com, xiaoning.wang@nxp.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux@armlinux.org.uk, wei.fang@nxp.com, chleroy@kernel.org, maxime.chevallier@bootlin.com, imx@lists.linux.dev, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org References: <20260720014317.1059359-1-wei.fang@oss.nxp.com> <20260720014317.1059359-2-wei.fang@oss.nxp.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260720014317.1059359-2-wei.fang@oss.nxp.com> On Mon, Jul 20, 2026 at 09:43:03AM +0800, wei.fang@oss.nxp.com wrote: > From: Wei Fang > > The PSIPMMR (Port Station Interface Promiscuous MAC Mode Register) in > ENETC v4 has the same bit layout as the PSIPMR register in ENETC v1: bit > n controls unicast promiscuous mode for SI n, and bit (n + 16) controls > multicast promiscuous mode for SI n. The only difference between the two > hardware generations is the register address offset. > > Since the register functionality is identical, the MAC promiscuous mode > setting code can be shared between ENETC v1 and v4 drivers. > > Rename ENETC_PSIPMR to ENETC_PSIPMMR in enetc_hw.h to match the actual > register name used in the reference manual, and extract two new common > helper functions, enetc_set_si_uc_promisc() and > enetc_set_si_mc_promisc(), into enetc_pf_common.c. These helpers select > the correct register offset based on the hardware revision via > is_enetc_rev1(). > > Remove the v4-specific enetc4_pf_set_si_mac_promisc() function from > enetc4_pf.c and the duplicate PSIPMMR_SI_MAC_UP/MP macro definitions > from enetc4_hw.h, as they are now superseded by the shared code. > > Signed-off-by: Wei Fang > --- > .../net/ethernet/freescale/enetc/enetc4_hw.h | 2 - > .../net/ethernet/freescale/enetc/enetc4_pf.c | 21 +-------- > .../ethernet/freescale/enetc/enetc_ethtool.c | 2 +- > .../net/ethernet/freescale/enetc/enetc_hw.h | 7 +-- > .../net/ethernet/freescale/enetc/enetc_pf.c | 11 ++--- > .../freescale/enetc/enetc_pf_common.c | 44 +++++++++++++++++++ > .../freescale/enetc/enetc_pf_common.h | 2 + > 7 files changed, 56 insertions(+), 33 deletions(-) > > diff --git a/drivers/net/ethernet/freescale/enetc/enetc4_hw.h b/drivers/net/ethernet/freescale/enetc/enetc4_hw.h > index f18437556a0e..6a8f2ed56017 100644 > --- a/drivers/net/ethernet/freescale/enetc/enetc4_hw.h > +++ b/drivers/net/ethernet/freescale/enetc/enetc4_hw.h > @@ -69,8 +69,6 @@ > > /* Port Station interface promiscuous MAC mode register */ > #define ENETC4_PSIPMMR 0x200 > -#define PSIPMMR_SI_MAC_UP(a) BIT(a) /* a = SI index */ > -#define PSIPMMR_SI_MAC_MP(a) BIT((a) + 16) [...] > diff --git a/drivers/net/ethernet/freescale/enetc/enetc_hw.h b/drivers/net/ethernet/freescale/enetc/enetc_hw.h > index bf99b65d7598..66bfda60da9c 100644 > --- a/drivers/net/ethernet/freescale/enetc/enetc_hw.h > +++ b/drivers/net/ethernet/freescale/enetc/enetc_hw.h > @@ -180,9 +180,10 @@ enum enetc_bdr_type {TX, RX}; > #define ENETC_PMR_PSPEED_1000M BIT(9) > #define ENETC_PMR_PSPEED_2500M BIT(10) > #define ENETC_PSR 0x0004 /* RO */ > -#define ENETC_PSIPMR 0x0018 > -#define ENETC_PSIPMR_SET_UP(n) BIT(n) /* n = SI index */ > -#define ENETC_PSIPMR_SET_MP(n) BIT((n) + 16) > +#define ENETC_PSIPMMR 0x0018 > +#define PSIPMMR_SI_MAC_UP(n) BIT(n) /* n = SI index */ > +#define PSIPMMR_SI_MAC_MP(n) BIT((n) + 16) I probably would have fixed the leading spaces when copying/pasting the macro, but that seems like a nit. I read the rest of the code a few times and it looks right to me. Reviewed-by: Joe Damato