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 9D57FA09E5; Wed, 19 Oct 2022 18:37:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 881E142BB3; Wed, 19 Oct 2022 18:37:38 +0200 (CEST) Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) by mails.dpdk.org (Postfix) with ESMTP id 5F4044280C for ; Wed, 19 Oct 2022 18:37:37 +0200 (CEST) Received: by mail-pf1-f175.google.com with SMTP id m6so17786273pfb.0 for ; Wed, 19 Oct 2022 09:37:37 -0700 (PDT) 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:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+NvpwCfEOs9MmI1PIbvk4O4B+/hhwRNp0Juro6wXpas=; b=bGmOJISkw1kKmhDyZzFquiGGeUEx0f/n2okFpz8JZh7+fWLkHK1divNsYMlQGlnJIS vG55E6GO9fSWTEqjwYLnBDn0xCod0p50nqe+JArlD5fzgoaSd1nwhlSx32QAP2ILSUIL HjsbCiZq6l4GdtiSQOAEKgR2pu8LfFZismp/iiWbj5WKhwEznV0F5z0iHau9CLFf3ud5 +zlrG9v31CsWomo8E9qxKxX0K/uYyGIptL+EwEEaAeBqeSPnuISzOMvS+Mvv1JeknTAc 8Z6m5mlLQPVYk5kbyPfc9zVi937x9zkhFbHLgdpXSkJIzORSBvoyrV1c+l+ClzQT/iYZ MrkA== 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:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+NvpwCfEOs9MmI1PIbvk4O4B+/hhwRNp0Juro6wXpas=; b=UFU+fcftQ889SaQMpwFaANLvUmmZKxMo6tiAM4b6UazrTTPeYWKcp6s6mOstha5imB uwG8OFMewCbetw041362L9uEBG1xslMUXWG2WDexc2i5gqDCCSE4EJy5Oe1mtb+bml69 DwUx6y2ScvKuv9EfJgONfiZsNWR19vWxhaa2ixqO48J5Yd3RskaNt9+RMwB0N3KsAAxc QnBdA/bDsVfDnWkybmSmuMKHY2dVjOSlTRwU/wNNCU5U+4LgO5GUqK9/sn25CQrBCxLP Nm2WHHTYdEP/SVICwW4nozMcw38TuVvNH1k+zftfBRLXHR1RQAQ1gQG0P1kNvn1Qi54o 3PFQ== X-Gm-Message-State: ACrzQf2f77J/owhvVoVeysweRUBCPj4IcA8ESbagjZIZdHjxsSY6K5XW j/a/x/qu5LiXYRgtTpQRCx1l3xD1JDk0PA== X-Google-Smtp-Source: AMsMyM45gCJTLhaV9B9wHbAm1rwyHQj7UGgyqGm2c3BXr0s3Z70Iscnq37i3HfN3K2PXVWGzD07IoQ== X-Received: by 2002:a63:6cc6:0:b0:457:5f5f:9dff with SMTP id h189-20020a636cc6000000b004575f5f9dffmr7792084pgc.493.1666197456361; Wed, 19 Oct 2022 09:37:36 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id y23-20020aa78f37000000b00562a5f29ac1sm11622869pfr.100.2022.10.19.09.37.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 09:37:36 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , =?UTF-8?q?Sylvia=20Grundw=C3=BCrmer?= , Reshma Pattan , Anatoly Burakov , Jianfeng Tan Subject: [PATCH] pdump: do not allow enable/disable in primary process Date: Wed, 19 Oct 2022 09:37:33 -0700 Message-Id: <20221019163733.68137-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <1f5f87b63b94410fb651546d1b4a0937@b-plus.com> References: <1f5f87b63b94410fb651546d1b4a0937@b-plus.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Attempts to enable or disable pdump in primary process will fail with core dump because it is not valid to call rte_mp_request_sync() unless in a secondary process. Trap the error in the common code used for both enable and disable requests. Reported-by: Sylvia Grundwürmer Fixes: 660098d61f57 ("pdump: use generic multi-process channel") Signed-off-by: Stephen Hemminger --- lib/pdump/rte_pdump.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/pdump/rte_pdump.c b/lib/pdump/rte_pdump.c index 98dcbc037bb8..a81544cb5772 100644 --- a/lib/pdump/rte_pdump.c +++ b/lib/pdump/rte_pdump.c @@ -537,6 +537,12 @@ pdump_prepare_client_request(const char *device, uint16_t queue, struct pdump_request *req = (struct pdump_request *)mp_req.param; struct pdump_response *resp; + if (rte_eal_process_type() == RTE_PROC_PRIMARY) { + PDUMP_LOG(ERR, + "pdump enable/disable not allowed in primary process\n"); + return -EINVAL; + } + memset(req, 0, sizeof(*req)); req->ver = (flags & RTE_PDUMP_FLAG_PCAPNG) ? V2 : V1; -- 2.35.1