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 E26FE4614F; Thu, 30 Jan 2025 16:01:11 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CC2DE40A73; Thu, 30 Jan 2025 16:01:11 +0100 (CET) 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 7C58E406BB for ; Thu, 30 Jan 2025 16:01:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738249270; 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=Zxzwq5g9iGsDkq/OkCqoQUQTzZQlK6tVGNY+/2lobJQ=; b=XV6D/CKGdEAhqPn1GTdXPqL7M8UL/HMFdsxmA5uFxg9CWApmxM4XDuXnqABwOs83oYO+UC akSXG1IdM4vGaGdIJ4UoMTpvO3xyO2jQcZ7KWXrpQlZOXE5rR6rfyOna4u10ISbBTdK5Ta aQ/xyBwjiySMYIC/vjjqfcLY05Y4nUo= Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-647-Bbvey6W8O7WUwjdUIZo6LA-1; Thu, 30 Jan 2025 10:01:08 -0500 X-MC-Unique: Bbvey6W8O7WUwjdUIZo6LA-1 X-Mimecast-MFC-AGG-ID: Bbvey6W8O7WUwjdUIZo6LA Received: by mail-lj1-f199.google.com with SMTP id 38308e7fff4ca-30227bb16abso3814971fa.2 for ; Thu, 30 Jan 2025 07:01:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738249267; x=1738854067; 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=Zxzwq5g9iGsDkq/OkCqoQUQTzZQlK6tVGNY+/2lobJQ=; b=Md1WfIPcmjewm6UrF6A7BCJq1BaPFD+Y5mfDQsBURe0cPo3DeXyam9KIt9Amd1qSIh G7h+ZQ9r+CdbUqDTrCYL637vp3in0bZzsjN2QnDePNNmZTZkooLWcfice0p83ZArfRaP 2DETNGLQ/IBXnwe8LeZaogwOZnQjrmV6jYp+Ye1JgjnTpjmDM0P3vJrTwle7o2bKBm/v 1dwjaNfKpeDdRU6/2y3C4DeVyI0eWnOfIwmd7X0L5Cle/waoW0l0kMYRi1tCrIoCR92b 4VGTaTRhf5ZPA4X4XyIfYf4uGw9IewZy2KcFCmHkbah/wkPcz8nD2AT2hN/LVAETo83C zr1w== X-Forwarded-Encrypted: i=1; AJvYcCUp+CluOFjs9f0j4KTPRPnVHDRHGAeuAUqE1XADzdYIN2Rsl40FciE9ilXo1s//jUuemio=@dpdk.org X-Gm-Message-State: AOJu0YzKWTXx+2MmmIJFQEMa8XyT4UnYnq6PUx3KU9CXC2R9sQuG1ji8 WDwvNMR/K1yeKsDByZh6yy6ifghS2ZoAB0UZXa25O04mfo5UOceO8VzzZhAoEkQNV7K9nd/80T1 cd0VhgOUp0qiiW+0gXSlVgVRzL5IofIRh9tdQwHEK7NG4hHOf8fauqyfbuv9krVtdL1Zt1vN4cd xj+pu+3DimgJVYfT4= X-Gm-Gg: ASbGnctOxZL/7Tk+xUlhvoTom+6QXBdzpMYD+sw6B8vTUfSQVa7/6Xl+rOZAVO3t5DR W0JH2XPwggeOsUhudYW+WybIsS8WMv+66/gcYhvdBXCwJ/XgHeNvQsLv/w3ogWcvi X-Received: by 2002:a2e:a547:0:b0:302:2320:dc81 with SMTP id 38308e7fff4ca-307968c5c2fmr23638761fa.29.1738249265231; Thu, 30 Jan 2025 07:01:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IF0z3YXdk1OQIk3cz67aOy9rbFGQvr8C82kFkvKrCNFaGAm218CNqiYY3jQqg+j/k2wZ1G0G9IdBLcHAbMJ5O8= X-Received: by 2002:a2e:a547:0:b0:302:2320:dc81 with SMTP id 38308e7fff4ca-307968c5c2fmr23637771fa.29.1738249263511; Thu, 30 Jan 2025 07:01:03 -0800 (PST) MIME-Version: 1.0 References: <1733513273-25550-1-git-send-email-andremue@linux.microsoft.com> <1733513273-25550-2-git-send-email-andremue@linux.microsoft.com> In-Reply-To: From: David Marchand Date: Thu, 30 Jan 2025 16:00:51 +0100 X-Gm-Features: AWEUYZkp03bBwkqG-CfIQfExO3T0cGHxfL_3lC_LVI3tqhs8g0stTgpAoX7DiL4 Message-ID: Subject: Re: [EXTERNAL] Re: [PATCH 1/2] lib/dmadev: eliminate undefined behavior To: fengchengwen , Jerin Jacob , Andre Muezerie Cc: Bruce Richardson , Kevin Laatz , "dev@dpdk.org" X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 2mOy-DtfPEQvFj2yaAVVGkVLOo7uqUeVvaezbDd1aek_1738249267 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 Fri, Jan 24, 2025 at 12:13=E2=80=AFPM David Marchand wrote: > > On Tue, Dec 10, 2024 at 1:58=E2=80=AFAM fengchengwen wrote: > > > + @Chengwen Feng > > > > > > This kind of patten is not used other places like ethdev traces, Why = we need this kind of pattern in dmadev? > > > Looks like, it can be fixed by caller of this function by initializin= g struct rte_dma_info. So may not need a fixup patch to begin with > > > > It's strange that no other library doesn't have this problem. > > > > When I first add tracepoints support for dmadev, there is no such macro= (just like other library), > > but the CI report ASAN error. > > > > The rootcause is that register: > > RTE_TRACE_POINT_REGISTER(rte_dma_trace_info_get, > > lib.dmadev.info_get) > > it will invoke : > > __rte_trace_point_register(&__rte_dma_trace_info_get, __rte_dma= _trace_info_get_lib.dmadev.info_get, > > (void (*)(void)rte_dma_trace_info_get) = { > > rte_dma_trace_info_get(); > > } > > > > But rte_dma_trace_info_get() it was defined with parameters: int16_t de= v_id, struct rte_dma_info *dev_info > > If we force invoke rte_dma_trace_info_get() without pass any parameter,= it may lead to ASAN problem because > > the parameter's corresponding register was not set (and it's value unde= fine). > > I remember of an issue with tracepoint and *UB*SAN, but I fail to see > how ASAN is affected (plus I see that the CI runs the tracepoint > autotests with ASAN). > Can you clarify? > > In any case, this looks like something that should be handled at the > tracepoint framework level, and not silenced/wrapped around in the > dmadev library. Fengcheng, Jerin, Andr=C3=A9, could you please have a look at this patch: https://patchwork.dpdk.org/project/dpdk/patch/20250130145849.82003-3-david.= marchand@redhat.com/ Thanks! --=20 David Marchand