From owner-dev-commits-src-all@freebsd.org Thu Apr 15 20:06:08 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 57F945D57F7 for ; Thu, 15 Apr 2021 20:06:08 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-yb1-xb30.google.com (mail-yb1-xb30.google.com [IPv6:2607:f8b0:4864:20::b30]) (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 4FLr281wt1z4nNc for ; Thu, 15 Apr 2021 20:06:08 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: by mail-yb1-xb30.google.com with SMTP id v3so25181304ybi.1 for ; Thu, 15 Apr 2021 13:06:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kev009.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Mv1ig0X1qaa3dOr32Zf5DRJ3I3ZpqYd2V7OsLjdKlhg=; b=CttXb7AvlGZGGRRTIZXRuRJo7euwgL3895oRSeSKt2cAhKB6P+TLLPWqb9wTERB9gG aqTPw+2K8EWCmGclKDTubUQodBIOBSojTJTpPF30SkziOkiD8Btoa+RaEenRbePBU3On JZ7XmWGfs+LsWg5GUc85tNJVRrk5KaIfNhSoU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Mv1ig0X1qaa3dOr32Zf5DRJ3I3ZpqYd2V7OsLjdKlhg=; b=cSDK/hvQPIYvd+Z7l3OdbNiojFkhKNilykQY0PXmC6GrPq4gto4Y9rnr9DOJKP2nDq iFQ7nsiKvlJN5dY0PcoIt1/7pz5rmkZCNmlVcsMJy2aecMs5ck2JSm5MDtuePxi+Ql8t knAA2JSJzFQeQW7oxBQ66yRcYK+IpvOn8NePj10tsrRpOoWOI0ucWjKXSy96mFceMeju lzSZJiQW1mEEX6XMshL0Aza82N1+A1df56c7plgE0NzbBIXqims07ukOCNDk9AE7kBQr rc5fk8F+6mwfedWStYIZYVct0FocspI5q26jhXYPsD1qZC56XKHERpVAE7gvi+4E5TH2 92FA== X-Gm-Message-State: AOAM530h1Sqx3Z2acHcwsciftqt20TiZkFlTtQ3k/q0R2A1D11hzmOXb CWHiBf4HgWiynQBuYc1hQXunJ9o/ZwMiR58v5MpCCA== X-Google-Smtp-Source: ABdhPJxmVLpV3nI3D1SfI5XmzH/oyrlOp8Ax3DxTnRJTmCv6XSNLP/z5RxKR2kffnCIR6NJdv+/rFriWY03Q9ykDeno= X-Received: by 2002:a25:7705:: with SMTP id s5mr6560361ybc.429.1618517166972; Thu, 15 Apr 2021 13:06:06 -0700 (PDT) MIME-Version: 1.0 References: <202104151848.13FImMA5091035@gitrepo.freebsd.org> <5b50b23a-71cd-5221-c905-ccffe841bc98@klop.ws> In-Reply-To: From: Kevin Bowling Date: Thu, 15 Apr 2021 13:05:54 -0700 Message-ID: Subject: Re: git: 68a46f11eada - main - e1000: Restore VF interface random MAC To: Kyle Evans Cc: Ronald Klop , Kevin Bowling , src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4FLr281wt1z4nNc 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:06:08 -0000 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 think 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 wrote: > > 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=68a46f11eadab48a1da9e3d3900569a6a1ce142e > > > > > > 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 to 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/D29785 > > > --- > > > 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 = EIO; > > > - goto err_late; > > > + if (adapter->vf_ifp) { > > > + u8 addr[ETHER_ADDR_LEN]; > > > + arc4rand(&addr, sizeof(addr), 0); > > > + addr[0] &= 0xFE; > > > + addr[0] |= 0x02; > > > + bcopy(addr, hw->mac.addr, sizeof(addr)); > > > + } else { > > > + device_printf(dev, "Invalid MAC address\n"); > > > + error = 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 machines may > not necessarily have a hostuuid preloaded to avoid collisions from the > generated addresses. > > Thanks, > > Kyle Evans