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 ADB51A0506; Tue, 29 Mar 2022 08:04:39 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 32BF642807; Tue, 29 Mar 2022 08:04:39 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id C212340691 for ; Tue, 29 Mar 2022 08:04:37 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id BBA7520DEDCF; Mon, 28 Mar 2022 23:04:36 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com BBA7520DEDCF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1648533876; bh=aPFWNkQm6pzJ6yhxBuVS/BDTSnADxBFstAROseEVQmc=; h=Date:From:To:Cc:Subject:From; b=eGNKHTsyAj23snBcjLLRM3FnjSUrWq9Y7vutIRA9b4pgWUdOwQmxh4tUnZA77PoPI glU/9Py7JPtkiwpJ5OLxaqyUtpeqgzzzAm4DZpJs9/ho6thR+sxew9TMGe8yOuUq8G 6EQTfffsnnggJjDRzAOn8XtFmFXTRKPCqSLCBRAY= Date: Mon, 28 Mar 2022 23:04:36 -0700 From: Tyler Retzlaff To: dev@dpdk.org Cc: anatoly.burakov@intel.com Subject: rte_memzone_reserve and invalid socket id Message-ID: <20220329060436.GA22196@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) 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 hi, there is a repeatable test failure in test_memzone when running dpdk-test.exe --no-huge for memzone_autotest it's clear why the test fails but what isn't clear if what rte_memzone_reserve is doing when provided an invalid socket id is sensible or not. as a matter of luck the system i'm using to test is a single socket system and as a result has only socket_id 0. the test however tries to use rte_memzone_reserve with a socket_id of 1 which is not a valid socket_id on the system. memzone3 = rte_memzone_reserve(TEST_MEMZONE_NAME("testzone3"), 1000, 1, 0); ^ socket_id (to repeat just make it invalid) the parameter documentation provided for reference. * @param socket_id * The socket identifier in the case of * NUMA. The value can be SOCKET_ID_ANY if there is no NUMA * constraint for the reserved zone. of interest is should rte_memzone_reserve fail when provided a completely invalid socket_id? when running with --no-huge it does not because when --no-huge the socket_id no matter the value is silently re-mapped to SOCKET_ID_ANY though without --no-huge if a completely garbage socket_id were provided it seems the allocation would fail. so you get different behavior for an invalid socket_id depending on --no-huge vs with. if (!rte_eal_has_hugepages() && socket_id < RTE_MAX_NUMA_NODES) socket_id = SOCKET_ID_ANY; the test later fails at this check. where it compares the memzone3 socket_id to what was used in the call to rte_memzone_reserve. if (memzone3 != NULL && memzone3->socket_id != 1) return -1; ^ SOCKET_ID_ANY if --no-huge if the allocation had failed, the test would pass instead of failing at this point. so what's wrong here? the test should be changed to expect different behavior with --no-huge vs huge or should rte_memzone_reserve be explicitly requiring SOCKET_ID_ANY instead of re-mapping invalid socket id? if it isn't the test that is wrong then a compatibility discussion is of interest but i'm avoiding that until someone confirms the intended design/behavior. thanks