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 B12E3A056B; Wed, 16 Nov 2022 18:04:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A3D6040E03; Wed, 16 Nov 2022 18:04:50 +0100 (CET) Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by mails.dpdk.org (Postfix) with ESMTP id 87ABD40DFB for ; Wed, 16 Nov 2022 18:04:49 +0100 (CET) Received: by mail-pf1-f176.google.com with SMTP id q9so18047883pfg.5 for ; Wed, 16 Nov 2022 09:04:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=AHm6CovciL+EHYHVqfa4QStiqOpcL92P6yE+JnBXTl8=; b=AeBghOH9JIBKyaCc1YDdcHV8y+ubzwLz90xvYa88WWt06LaeS1y59MLRfEFwuepRoH mp4q6cU6zIP0/D9b9qvt0JEIUE7F01W5yiwm205isBDpjIozp8ukSwUKqgDBnVgGAYwr yayHahCVKZBndv9QBCjGAuUoX17wna+sEDPoycvCHn/MaZnAiecFWmGr4xOzE6fXd4YJ 9DdM3vFCRUkur07fYJreaN78hRAQzl0UhmUMhixeEFwn6kpLNy82iXVQlMPRcYCkJfl2 5iXeW8YrHbd/S7luxy+RD3MJNx/ykwwwjyblKdh3vt6AIVQCeK9NTqWDunkjp83Pr+vP ht4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AHm6CovciL+EHYHVqfa4QStiqOpcL92P6yE+JnBXTl8=; b=Uh0bHkRRoV8yvUa+zupzsga3vuab7HPtYq0ji6qyXmKLHWfHNSQ3b31K4vk42fngPt CX66OsUajmuvN627eukbOZyS3fcVpK2IvmcnjioOWGjzkTCO3en/YGwgw6mOhkWR1g0y 1fo4FM1ymBRRcNrY7YeQ09RDC/Wdg14mCy2HS5sZfNkSpOYp1yMHi6HUDAh2753Ztc8U AM16awFHKbTpUiLCyey/rk+1QKd2Zw17ywh72tzS2rrmipuqxTE2r7JzMpOHqHhjGQEY 9WFKbnyx2p1spAHdakruaBZr9ii0rFjBe6bc3/QVck/agop8u6ElLhP6grkE1Pv8pi8c oSfA== X-Gm-Message-State: ANoB5pkAoiPyuw3hxKEkRhEwNCkBdFiRdgYrP9nni3rTZXsoStZG3pPH hElVU1gRHDNevkWBV5Zu/19d65HGJGf8Gg== X-Google-Smtp-Source: AA0mqf5umCrhqkj7G9C3BWB8wwx+H1s0+PCnwSnBgXEwRelYXdipL6Hg051hennLAlVRgNtGxN8LXA== X-Received: by 2002:aa7:8813:0:b0:56b:f64b:b385 with SMTP id c19-20020aa78813000000b0056bf64bb385mr23798781pfo.68.1668618288656; Wed, 16 Nov 2022 09:04:48 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id z27-20020aa7991b000000b0056c2e497ad6sm11367531pff.93.2022.11.16.09.04.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 09:04:48 -0800 (PST) Date: Wed, 16 Nov 2022 09:04:46 -0800 From: Stephen Hemminger To: Junxiao Shi Cc: dev@dpdk.org Subject: Re: [RFC PATCH v2] net/memif: change socket listener owner uid/gid Message-ID: <20221116090446.1e2c67a9@hermes.local> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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, 16 Nov 2022 13:09:20 +0000 Junxiao Shi wrote: > +static int > +memif_set_owner(const char *key, const char *value, void *extra_args) > +{ > + static_assert(sizeof(uid_t) == sizeof(uint32_t), ""); > + static_assert(sizeof(gid_t) == sizeof(uint32_t), ""); Use RTE_ASSERT() for these > + uint32_t *id = (uint32_t *)extra_args; > + > + char *end = NULL; > + unsigned long val = strtoul(value, &end, 10); The DPDK style inherited from Linux kernel is to have blank line after declarations.