From nobody Tue Jun 06 04:15:37 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZxwj72pZz4bhfH for ; Tue, 6 Jun 2023 04:15:49 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZxwj4lwyz3N52 for ; Tue, 6 Jun 2023 04:15:49 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-3f6e68cc738so48580575e9.1 for ; Mon, 05 Jun 2023 21:15:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686024948; x=1688616948; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Q4GUGGH+zCp3wzi6W1jvMzxkwxoCrIf85Aeq3hIW7ew=; b=kvl87nE0bZ8bCMr0O8q99FISUTfe1TrHyGyBcHNyVATtq+8XRQa0vp7wzZGVVTcuAo 1dfjCCPgpOnAgOF0oPqVzWdDbFog1OC/fxO++giFH/e25UZdug26alfdyokXPTOjO+By qTlBKYywPg6MPy2lk6Q/kl4JVkD2FTi2pfnagAb9MxUPzDVF/UndYgi0RereZkQGCcUT oDTTD0QCYm5o1gxv78jHAlYi1Sqri50HpLElnSmXe0uPfHm9wEMGYh/oy5lQDfry/VKK dkOqX36wnZbsZRxb6sZ0BuLrWY4+jvS660hbcAoT9ZLQfJPxXrOBLZHgxC+guSkP7tO2 iVBg== X-Gm-Message-State: AC+VfDzAjy/wvYEpbLulWvFF7eEBcjmyxod8lcKUs7Hkjrn3iLaQsUWg caWPDSAc64sqscOIEY9wSx7GVQ== X-Google-Smtp-Source: ACHHUZ4v0RN1v5uyNQ6DEAdh0xaDsf/5pwkZR2fXBT/PX7o1BwR3AfB3tm6k6LBlyzHtFtGPWOE9CQ== X-Received: by 2002:a7b:c407:0:b0:3f6:f56:9ad with SMTP id k7-20020a7bc407000000b003f60f5609admr918105wmi.13.1686024948113; Mon, 05 Jun 2023 21:15:48 -0700 (PDT) Received: from smtpclient.apple ([131.111.5.246]) by smtp.gmail.com with ESMTPSA id n2-20020a05600c294200b003f727764b10sm12306610wmd.4.2023.06.05.21.15.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Jun 2023 21:15:47 -0700 (PDT) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\)) Subject: Re: git: 1bbdfb0b4386 - main - gve: Add PNP info to PCI attachment of gve(4) driver. From: Jessica Clarke In-Reply-To: <202306060406.35646hbA078041@gitrepo.freebsd.org> Date: Tue, 6 Jun 2023 05:15:37 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <6A5F859A-033A-43E1-81CB-B364662DE2F3@freebsd.org> References: <202306060406.35646hbA078041@gitrepo.freebsd.org> To: Xin LI X-Mailer: Apple Mail (2.3731.500.231) X-Rspamd-Queue-Id: 4QZxwj4lwyz3N52 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 6 Jun 2023, at 05:06, Xin LI wrote: >=20 > The branch main has been updated by delphij: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D1bbdfb0b438689a839e29094fcb582a1= 04cbabd9 >=20 > commit 1bbdfb0b438689a839e29094fcb582a104cbabd9 > Author: Xin LI > AuthorDate: 2023-06-06 00:58:43 +0000 > Commit: Xin LI > CommitDate: 2023-06-06 04:05:55 +0000 >=20 > gve: Add PNP info to PCI attachment of gve(4) driver. >=20 > Reviewed-by: imp > Differential Revision: https://reviews.freebsd.org/D40429 > --- > sys/dev/gve/gve_main.c | 28 ++++++++++++++++++++++++---- > 1 file changed, 24 insertions(+), 4 deletions(-) >=20 > diff --git a/sys/dev/gve/gve_main.c b/sys/dev/gve/gve_main.c > index ae45a0cfc24a..383fd326d33a 100644 > --- a/sys/dev/gve/gve_main.c > +++ b/sys/dev/gve/gve_main.c > @@ -38,6 +38,16 @@ >=20 > #define GVE_DEFAULT_RX_COPYBREAK 256 >=20 > +/* Devices supported by this driver. */ > +static struct gve_dev { > + uint16_t vendor_id; > + uint16_t device_id; > + const char *name; > +} gve_devs[] =3D { > + { PCI_VENDOR_ID_GOOGLE, PCI_DEV_ID_GVNIC, "gVNIC" } > +}; > +#define GVE_DEVS_COUNT nitems(gve_devs) IMO this obfuscates rather than helps given the loop iterates over gve_devs (and the macro references it). > + > struct sx gve_global_lock; >=20 > static int > @@ -701,10 +711,18 @@ gve_service_task(void *arg, int pending) > static int > gve_probe(device_t dev) > { > - if (pci_get_vendor(dev) =3D=3D PCI_VENDOR_ID_GOOGLE && > - pci_get_device(dev) =3D=3D PCI_DEV_ID_GVNIC) { > - device_set_desc(dev, "gVNIC"); > - return (BUS_PROBE_DEFAULT); > + uint16_t deviceid, vendorid; > + int i; > + > + vendorid =3D pci_get_vendor(dev); > + deviceid =3D pci_get_device(dev); > + > + for (i =3D 0; i < GVE_DEVS_COUNT; i++) { > + if (vendorid =3D=3D gve_devs[i].vendor_id && > + deviceid =3D=3D gve_devs[i].device_id) { > + device_set_desc(dev, gve_devs[i].name); > + return (BUS_PROBE_DEFAULT); > + } > } > return (ENXIO); > } > @@ -851,3 +869,5 @@ DRIVER_MODULE(gve, pci, gve_driver, gve_devclass, = 0, 0); > #else > DRIVER_MODULE(gve, pci, gve_driver, 0, 0); > #endif > +MODULE_PNP_INFO("U16:vendor;U16:device", pci, gve, gve_devs, This is missing ;D:# so it will break as soon as you have a second entry in the table. Jess > + GVE_DEVS_COUNT);