From owner-dev-commits-src-all@freebsd.org Thu Apr 15 20:49:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C8EB25D6FA6 for ; Thu, 15 Apr 2021 20:49:39 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) (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 "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FLs0M4t5Wz4qS5 for ; Thu, 15 Apr 2021 20:49:39 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qk1-x729.google.com with SMTP id b139so21310833qkc.10 for ; Thu, 15 Apr 2021 13:49:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=pQzmoYNcNdmutBOITd2TsckSJcuXgDgSTvMpAAf0U3A=; b=iNfqr0XALDOw/xyPB69RlFqhyS8H6I6BbwiBKlLORRqg0Z0AvvDhYCXomYTdmEVu0M 6aTcM8UoBfrN3P9PuQncrJqLiEth3R2hGLdToFCCxOkFpa8kkqYAmJCq3FcvSIrVitnK /OJoJzRhdtXxTNSNwyGpJmj3j/eq3gm+XGPl2kDffTK/3V0uhE+qJdU5Y9LDL2TpxwVS Zk7LLreKSy7nBxEGScZVIdWHIiCST5hDhJGQ9frXw15LHdEDQyxbcrivVgkmRsCFwSXb J4DXApk/9YUN5sobgKU8lhiodAw6Hx/1hBx/V7Vcs5qb8LWwwBHU/0/bDS+79JUwt23N EdkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=pQzmoYNcNdmutBOITd2TsckSJcuXgDgSTvMpAAf0U3A=; b=Iyzq8z/eknaC9kjJ5ZhXx4zjcxmd+NO3A0JWfwlIcwuiII3Mka+blooCjLciewT6we wu4oz/hImd4ihsj5blTYYjExT/C6E/wVc33TVQWqhvEtmBcXsKkAaolxuLM+rDEVU+sy LsNwuMW/a7/RNCmUgj+XBa4HYgTc1IVrYBOs7CzitWKb29a7SkQTZNAdTAs5+BqEN75g Rj7aoZOBiFLEVFYj7m2n6Qf5hZGBYoQb8/IOqmKQuZCxL72BDIr6Yx++zWZgkX8D19B8 j/118bbT1WiTRlgtlgyr0b+o5RgxydjF5+fOugGYrr2Xp0+WhEccVW78rBC9c2uUO+M0 7dNw== X-Gm-Message-State: AOAM533ejVikyTv+ZF+++omHMnZt0RW9a+kL8jWFs/3G2ZFhoGYMrOHR ma2L1/zDdTFirDWcx7yIgYeT5w== X-Google-Smtp-Source: ABdhPJzTGzxbdvxR35HtsOxMVecWAPZGWdM5/NhkSTipCfIJoTGB66BodCFrlZ+qo4ZFYbJ2cPTU/w== X-Received: by 2002:a37:6182:: with SMTP id v124mr5313052qkb.289.1618519778648; Thu, 15 Apr 2021 13:49:38 -0700 (PDT) Received: from mutt-hbsd (pool-100-16-222-53.bltmmd.fios.verizon.net. [100.16.222.53]) by smtp.gmail.com with ESMTPSA id s20sm2532886qtq.80.2021.04.15.13.49.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Apr 2021 13:49:38 -0700 (PDT) Date: Thu, 15 Apr 2021 16:49:37 -0400 From: Shawn Webb To: Kyle Evans Cc: Kevin Bowling , Ronald Klop , Kevin Bowling , src-committers , "" , dev-commits-src-main@freebsd.org Subject: Re: git: 68a46f11eada - main - e1000: Restore VF interface random MAC Message-ID: <20210415204937.teix2vfqtocehm5b@mutt-hbsd> X-Operating-System: FreeBSD mutt-hbsd 14.0-CURRENT-HBSD FreeBSD 14.0-CURRENT-HBSD X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: <202104151848.13FImMA5091035@gitrepo.freebsd.org> <5b50b23a-71cd-5221-c905-ccffe841bc98@klop.ws> <20210415202023.oms4sih6eina57xu@mutt-hbsd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="kidiwxwjwjyyewfd" Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4FLs0M4t5Wz4qS5 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2021 20:49:39 -0000 --kidiwxwjwjyyewfd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Ah. I think I misinterpreted your email. Sorry about that! On Thu, Apr 15, 2021 at 03:22:41PM -0500, Kyle Evans wrote: > Yes, sorry, this is precisely what I meant. >=20 > On Thu, Apr 15, 2021 at 3:20 PM Shawn Webb w= rote: > > > > Could ether_gen_addr be updated to take into account the zero'd > > hostuuid and handle appropriately like you mentioned below? > > > > On Thu, Apr 15, 2021 at 03:12:14PM -0500, Kyle Evans wrote: > > > I think it'd be the right choice, but it needs a little work first. > > > e.g., it's not a good fit right now for VMs that don't use loader, for > > > instance, because it relies on the hostuuid actually being somewhat > > > unique or else it generates the same MAC address across different VMs > > > and you end up with conflicts in the broadcast domain. I think there's > > > a good argument to make for having it check if the hostuuid is the > > > default all-0 hostuuid and just generating a random address as this > > > does right now. I might go ahead and prepare such a change and > > > document the KPI in the process. > > > > > > On Thu, Apr 15, 2021 at 3:06 PM Kevin Bowling wrote: > > > > > > > > I would like to discuss this further, it crossed my mind, but none = of > > > > the intel drivers currently use it. If this is the right KPI I thi= nk > > > > a review should be prepared that updates e1000, ixgbe (ixv), ixl > > > > (iavf) in one go. > > > > > > > > Regards, > > > > Kevin > > > > > > > > On Thu, Apr 15, 2021 at 12:36 PM Kyle Evans wr= ote: > > > > > > > > > > On Thu, Apr 15, 2021 at 2:32 PM Ronald Klop wrote: > > > > > > > > > > > > On 4/15/21 8:48 PM, Kevin Bowling wrote: > > > > > > > The branch main has been updated by kbowling (ports committer= ): > > > > > > > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D68a46f11eadab4= 8a1da9e3d3900569a6a1ce142e > > > > > > > > > > > > > > commit 68a46f11eadab48a1da9e3d3900569a6a1ce142e > > > > > > > Author: Kevin Bowling > > > > > > > AuthorDate: 2021-04-15 18:45:02 +0000 > > > > > > > Commit: Kevin Bowling > > > > > > > CommitDate: 2021-04-15 18:45:02 +0000 > > > > > > > > > > > > > > e1000: Restore VF interface random MAC > > > > > > > > > > > > > > Restore 525e07418c77 after the iflib conversion of igb(4= ). This > > > > > > > reenables random MAC address generation when attaching t= o a VF with a > > > > > > > zeroed MAC. > > > > > > > > > > > > > > PR: 253535 > > > > > > > Reported by: Balaev PA > > > > > > > Reviewed by: markj > > > > > > > MFC after: 2 weeks > > > > > > > Differential Revision: https://reviews.freebsd.org/D297= 85 > > > > > > > --- > > > > > > > sys/dev/e1000/if_em.c | 21 ++++++++++++++++++--- > > > > > > > 1 file changed, 18 insertions(+), 3 deletions(-) > > > > > > > > > > > > > > diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c > > > > > > > index 6f022c80c01c..79a617b3342f 100644 > > > > > > > --- a/sys/dev/e1000/if_em.c > > > > > > > +++ b/sys/dev/e1000/if_em.c > > > > > > > @@ -1061,9 +1061,17 @@ em_if_attach_pre(if_ctx_t ctx) > > > > > > > } > > > > > > > > > > > > > > if (!em_is_valid_ether_addr(hw->mac.addr)) { > > > > > > > - device_printf(dev, "Invalid MAC address\n"); > > > > > > > - error =3D EIO; > > > > > > > - goto err_late; > > > > > > > + if (adapter->vf_ifp) { > > > > > > > + u8 addr[ETHER_ADDR_LEN]; > > > > > > > + arc4rand(&addr, sizeof(addr), 0); > > > > > > > + addr[0] &=3D 0xFE; > > > > > > > + addr[0] |=3D 0x02; > > > > > > > + bcopy(addr, hw->mac.addr, sizeof(addr)); > > > > > > > + } else { > > > > > > > + device_printf(dev, "Invalid MAC address= \n"); > > > > > > > + error =3D EIO; > > > > > > > + goto err_late; > > > > > > > + } > > > > > > > > > > > > > > > > > > Just curious. Would ether_gen_addr() be useful here? > > > > > > It is implemented in net/if_ethersubr.c. > > > > > > > > > > > > > > > > I had asked myself the same question, but I suspect these machine= s may > > > > > not necessarily have a hostuuid preloaded to avoid collisions fro= m the > > > > > generated addresses. > > > > > > > > > > Thanks, > > > > > > > > > > Kyle Evans > > > _______________________________________________ > > > dev-commits-src-all@freebsd.org mailing list > > > https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all > > > To unsubscribe, send any mail to "dev-commits-src-all-unsubscribe@fre= ebsd.org" > > > > -- > > Shawn Webb > > Cofounder / Security Engineer > > HardenedBSD > > > > https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb= /03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --kidiwxwjwjyyewfd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmB4pt8ACgkQ/y5nonf4 4fqf0w/7BonD+TteToMB58iTqRc5yRD5Pfl/DF0j40yeHwaPm/yATBUPr9JqgE4e HuOo4NYo3xcz4lR/MYAPizPi8Dcy3REuG5EzP5Y6bgXLgGHzkD1QRANBfsqBaIgI gSwBMwiBN60xFf+8KViQqzZ4KSeFvXnkjVHRs+L/R3rKIqc2I6NWwiAUcqVLVB3m kfrx6HoBp3ZIUsbMdx40VwkNmthcL+gAXiUHD4xjx2IGk3uIUMqU3QUnosysvDb4 Z7lpDobuRNiumHkqCTghW4BGC9mYwZv259gqgD7Wy8fbuBerZh/wq5jVpd7pvf78 Akq9RUh5PrnmONzNiq1J+WG3oMdTA2SF1fFZz8Plx8eOK+oIvHJq/sJGY/G+C25a yqirO9dZCauN5S9zSCwYyqoztfYRz3p1wGZN+XiG/I+WI4TTOnUJto+ZnbFAvsrI IAg3JZ3G6JeZbMsj2tHjlNJ6ArCYEJIQJFq3n6ebQsl82+m557aSK3J+Q+jp5hwj 3SbFYLuvrLvuAqVeVvEuw37yobXCF0TfrEmrR+ws3Rbt+HfYzYCopqFJGvIuc5WJ Z03L3ZeETo8kIv3onJrZRHnyGXzi33J7KyNHhedUEq2v59UibCO3EjzEZ/08qKes FGkVf+l08RMMsdWQAWrwnY0wlMM+a/xPwEjSc8yFo0w8PhxgmGQ= =8Lt+ -----END PGP SIGNATURE----- --kidiwxwjwjyyewfd--