From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 46E97459C6; Wed, 18 Sep 2024 09:29:14 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 232734029B; Wed, 18 Sep 2024 09:29:14 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 235054028F for ; Wed, 18 Sep 2024 09:29:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1726644551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MduVeWjAmuKdyNgWkcOeI1nj0e7bsUg0sdDgCmhFs0w=; b=BLhQXDlqa0qL+suEAT++56xgst6ivHgkT95zlsjiw42sICS+X0WaWOX8WqGwQwG4jSON33 cgThgt+x5KcG7dEvuOU/RWoBPYwOUfGdpyUjlSnbhQs+yBuCinRk3Usp+hcOxPLcpBRCdC ciPF/FI4a9DbzHo57m0QW8FyP069aMg= Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-141-Q3yG9OVZM-atMrrn-Pb_8g-1; Wed, 18 Sep 2024 03:29:10 -0400 X-MC-Unique: Q3yG9OVZM-atMrrn-Pb_8g-1 Received: by mail-lj1-f200.google.com with SMTP id 38308e7fff4ca-2f403189d83so33939201fa.2 for ; Wed, 18 Sep 2024 00:29:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726644549; x=1727249349; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MduVeWjAmuKdyNgWkcOeI1nj0e7bsUg0sdDgCmhFs0w=; b=A+huLbwPM2CWFhhEC/9SdDdfLZC5UeKkk4uYmG/pRI8UqotqHbLY04i8F+ymh1FRWf 9RrbCvKJe1kgcEO+89w4z3rNcmlWEA5UrDiec8VuMKurD4Xm/eiQ/OQRhtUSgQN3v+NV AIGmxMUA7cAE2ADDF8S9n2Lb34y7eoCX49vZNgD+c+RdCA+hu9gt25OUWKzrObym3B92 STK1jCHeWE51w5MdBY09HC5EWTJDv24X8vRYptoh/DuldVgfLvBipcg8dE2wP59CEr65 /ri5R1q6ImBVZ6KVE94MhxW6jhQXhP0X6bQa8x/PQi5LSSKEzOY8+tvpJahB3562YF0t DsAA== X-Gm-Message-State: AOJu0YzP1tQuEZK5GScVVxGXVFxyNjj8QY77otTkILe92n1lT0/mm58T coRNUrUvV/bQQ+nEneB01qvG3PSwxhmVP8904x1HKKnBYM2IaRTOeRAO/p0EuosZ9NiraTYFizF I40JcN7QrSqOog+RdHJ71SbEwq5fenX3DwqOGrydvjcdT0co010M60LyJedydYCXd0Xmr+PXAef nkoDxOaS6DbP/DjLg= X-Received: by 2002:a2e:a7ca:0:b0:2f7:5367:5c1b with SMTP id 38308e7fff4ca-2f7b977fb4dmr17780551fa.11.1726644548776; Wed, 18 Sep 2024 00:29:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFw2OxjxKGrRv0oh4TKMjbLCYcbHLyI/la7NLqHenrYa4UOc9ImbP1GM6Ra6aTs0BHqYmPuZPre2GtObMn1Y/o= X-Received: by 2002:a2e:a7ca:0:b0:2f7:5367:5c1b with SMTP id 38308e7fff4ca-2f7b977fb4dmr17780371fa.11.1726644548253; Wed, 18 Sep 2024 00:29:08 -0700 (PDT) MIME-Version: 1.0 References: <20240918060936.1231758-4-wanry@yunsilicon.com> In-Reply-To: <20240918060936.1231758-4-wanry@yunsilicon.com> From: David Marchand Date: Wed, 18 Sep 2024 09:28:56 +0200 Message-ID: Subject: Re: [PATCH v3 03/19] net/xsc: add PCI device probe and remove To: WanRenyong Cc: dev@dpdk.org, ferruh.yigit@amd.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Wed, Sep 18, 2024 at 8:10=E2=80=AFAM WanRenyong w= rote: > +static const struct rte_pci_id xsc_ethdev_pci_id_map[] =3D { > + { RTE_PCI_DEVICE(XSC_PCI_VENDOR_ID, XSC_PCI_DEV_ID_MS) }, You need to null terminate this array with something like: { .vendor_id =3D 0, /* sentinel */ }, Otherwise the bus pci code may read a next symbol or data present in the .data section. ASan caught this issue when running the unit tests: =3D=3D70261=3D=3DERROR: AddressSanitizer: global-buffer-overflow on address 0x7f8e46bf45f0 at pc 0x7f8e56be523b bp 0x7ffe2ef88ca0 sp 0x7ffe2ef88c98 READ of size 2 at 0x7f8e46bf45f0 thread T0 #0 0x7f8e56be523a in rte_pci_match /home/runner/work/dpdk/dpdk/build/../drivers/bus/pci/pci_common.c:178:47 #1 0x7f8e56be523a in rte_pci_probe_one_driver /home/runner/work/dpdk/dpdk/build/../drivers/bus/pci/pci_common.c:223:7 #2 0x7f8e56be523a in pci_probe_all_drivers /home/runner/work/dpdk/dpdk/build/../drivers/bus/pci/pci_common.c:391:8 #3 0x7f8e56be3297 in pci_probe /home/runner/work/dpdk/dpdk/build/../drivers/bus/pci/pci_common.c:418:9 #4 0x7f8e56fe9ea8 in rte_bus_probe /home/runner/work/dpdk/dpdk/build/../lib/eal/common/eal_common_bus.c:78:9 #5 0x7f8e570580d1 in rte_eal_init /home/runner/work/dpdk/dpdk/build/../lib/eal/linux/eal.c:1288:6 #6 0x5573a597d65d in main /home/runner/work/dpdk/dpdk/build/../app/test/test.c:145:9 #7 0x7f8e55829d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16 #8 0x7f8e55829e3f in __libc_start_main csu/../csu/libc-start.c:392:3 #9 0x5573a58bf114 in _start (/home/runner/work/dpdk/dpdk/build/app/dpdk-test+0x1e9114) (BuildId: 8d4741d712c15395a67005124e1f908d96acf7ff) 172 int 173 rte_pci_match(const struct rte_pci_driver *pci_drv, 174 const struct rte_pci_device *pci_dev) 175 { 176 const struct rte_pci_id *id_table; 177 178 for (id_table =3D pci_drv->id_table; id_table->vendor_id !=3D 0; 179 id_table++) { --=20 David Marchand