From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1D648A04C2; Mon, 25 Nov 2019 19:10:53 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A3BCC2952; Mon, 25 Nov 2019 19:10:51 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id 7E68C28EE for ; Mon, 25 Nov 2019 19:10:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574705449; 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=H6CDDRP+ktvwz4a8iLUp57hjkFVXEzs++Oyn8A4yChE=; b=OSl0TIwrZXrbFz84pNYkfxP+2RV4pC1RORo0FmuQ4QZt4Re1BYSMe6YvnVP6Ps0XrE/sBy OEKnXSG8ZO6Lilvp1dcwS4DkeKj71nyBT75ndqDDrn1Rc7uJWwx0naN1/DffC3c1JtbzRS DEaAatWPi8u+iR58wbfxiqikwwDkfsw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-192-EGqHj07YMHCLDahuyElQig-1; Mon, 25 Nov 2019 13:10:44 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0E77D10A66CB; Mon, 25 Nov 2019 18:10:43 +0000 (UTC) Received: from dhcp-25.97.bos.redhat.com (unknown [10.18.25.127]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EE6C65D6AE; Mon, 25 Nov 2019 18:10:41 +0000 (UTC) From: Aaron Conole To: Thomas Monjalon Cc: "Van Haaren\, Harry" , "Amber\, Kumar" , "dev\@dpdk.org" , "Wang\, Yipeng1" , "Yigit\, Ferruh" , "Thakur\, Sham Singh" , David Marchand References: <20191122182100.15631-1-kumar.amber@intel.com> <2900799.QLPOietlla@xps> Date: Mon, 25 Nov 2019 13:10:41 -0500 In-Reply-To: <2900799.QLPOietlla@xps> (Thomas Monjalon's message of "Mon, 25 Nov 2019 18:54:02 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: EGqHj07YMHCLDahuyElQig-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [PATCH v3] hash: added a new API to hash to query key id X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" Thomas Monjalon writes: >> From: Aaron Conole >> > -=09if (!service_valid(id)) >> > +=09if (id >=3D RTE_SERVICE_NUM_MAX || !service_valid(id)) > > Why not adding this check in service_valid()? I think the best fix is to use SERVICE_VALID_GET_OR_ERR_RET() in these places. For this, I at least want to try and show that there aren't any further errors. And my test loop has been running for a while now without any more errors or segfaults, so I guess it's okay to build a proper patch.