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 0D2A0A0A02; Tue, 18 May 2021 11:29:24 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EB58F4068E; Tue, 18 May 2021 11:29:23 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 2DF6940041 for ; Tue, 18 May 2021 11:29:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621330162; 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=sFb90Adjmj4zZ9AQAQKM0m5ZykhoQA8xEOwzEomfFXY=; b=AGujhPFgeEJZmWbmTdZEW8PK+QUCqZasDZvvSjvt8mpEJhHSw70c7HkfQ0cRRdTOigQT1T tnTJDpvCqZ9WxzpRjDvnjVOdKO8VOvDH8C6N429sWQEPic5JxYKdCRvQ2aKDcpVXSMKVRT RGW7knvyAl6Ib4JS9Ca1HChW8vOcPhI= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-486-J0ZecTTcNzqkPJ9k_Zu8Ug-1; Tue, 18 May 2021 05:29:21 -0400 X-MC-Unique: J0ZecTTcNzqkPJ9k_Zu8Ug-1 Received: by mail-wm1-f72.google.com with SMTP id r15-20020a05600c35cfb029017373d9f318so216358wmq.4 for ; Tue, 18 May 2021 02:29:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:subject:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=sFb90Adjmj4zZ9AQAQKM0m5ZykhoQA8xEOwzEomfFXY=; b=Ur41fTuNqSKxdTX0jO5GpXvQKclpVZ5GsVgv95af25gErl3+TmnF4dcxt+WzoXGaCo 1pBdFlCWAZdjTn01dzlbA2jpDDKFBcx9Evaa2pumO9kGHkRMM/NO82JnbiMS/df8vi4H J0/a5zFOSGf1tzWsSM2g834yCiZgOlH46OasYBYE5zmrCuJzBfml/9o8tNMmc5wYXzcP yareMFq7dMongIiH+mQAJSwn2eqblbxQBYuivAHKfu0pbk4F/A7moIUcm5ucHfOT2HAF ZYQvN5LPV40vV0YYELO/o+lcSv4cHFIYIsYctbiF5LERMsKqIIa5qULZWbrIs1Ns0Vt/ Sh5w== X-Gm-Message-State: AOAM530cL4MjMJJPzLDMW5pVXir34UlmwsH2VAgjFFpTswPobct8MwgO zhGjWZbVw1ivsGTOEA8yX20XNht7S0knByhNo4b5kr+LJgukYe0qTyZlfxALeOBJJKAUQxhA2AC 2Lmo= X-Received: by 2002:a05:600c:4f93:: with SMTP id n19mr3890676wmq.100.1621330159536; Tue, 18 May 2021 02:29:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKFjvLfxrP2GVmrCBf1gM555Axv7q32PbQee7hPqurf9BwCrp8K9YYaGF60IeqewpBzGvxSw== X-Received: by 2002:a05:600c:4f93:: with SMTP id n19mr3890647wmq.100.1621330159276; Tue, 18 May 2021 02:29:19 -0700 (PDT) Received: from [192.168.0.36] ([78.18.27.43]) by smtp.gmail.com with ESMTPSA id v10sm23783598wrq.0.2021.05.18.02.29.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 18 May 2021 02:29:18 -0700 (PDT) To: Thomas Monjalon , Ferruh Yigit Cc: Cristian Dumitrescu , Pablo de Lara Guarch , dev@dpdk.org, stable@dpdk.org References: <20210517155739.800371-1-ferruh.yigit@intel.com> <16891120.zO6uBrY9Ry@thomas> From: Kevin Traynor Message-ID: <635e6994-2234-f97e-9b42-3464374805de@redhat.com> Date: Tue, 18 May 2021 10:29:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <16891120.zO6uBrY9Ry@thomas> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH] test/table: fix build with GCC 11 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 Sender: "dev" On 18/05/2021 09:55, Thomas Monjalon wrote: > 17/05/2021 17:57, Ferruh Yigit: >> Build error: >> ../app/test/test_table_tables.c: In function ‘test_table_stub’: >> ../app/test/test_table_tables.c:31:9: >> warning: ‘memset’ offset [0, 31] is out of the bounds [0, 0] >> [-Warray-bounds] >> memset((uint8_t *)mbuf + sizeof(struct rte_mbuf) + 32, 0, 32); \ >> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> ../app/test/test_table_tables.c:151:25: >> note: in expansion of macro ‘PREPARE_PACKET’ >> 151 | PREPARE_PACKET(mbufs[i], 0xadadadad); >> | ^~~~~~~~~~~~~~ >> >> 'key' points to mbuf header + 32 bytes, and memset clears next 32 bytes >> of 'key', so overall there needs to be 64 bytes after mbuf header. >> Adding a mbuf size check before memset. >> >> The original code has an assumption that mbuf data buffer follows mbuf >> header, this patch accepts same assumption. >> >> Bugzilla ID: 677 >> Fixes: 5205954791cb ("app/test: packet framework unit tests") >> Cc: stable@dpdk.org >> >> Signed-off-by: Ferruh Yigit >> --- >> Cc: cristian.dumitrescu@intel.com >> Cc: Kevin Traynor >> >> Not exactly clear why compiler complains about, compiler can't know the >> bounds of the memory we try to memset here. >> But adding a size check seems logic thing to do also fixes the compiler >> warning. > > Applied, thanks > Was just testing this. fwiw, passing build on F34/gcc11 and LGTM. > >