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 835E246F4D for ; Mon, 22 Sep 2025 14:33:47 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 558324025A; Mon, 22 Sep 2025 14:33:47 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 150A34025A for ; Mon, 22 Sep 2025 14:33:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1758544425; 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: in-reply-to:in-reply-to:references:references; bh=NwFfNXuEYC5w2CRyqR8EU2ag6WrGBHgUh5XAyf5EiU4=; b=irQ9TNbJsML7/jxgnSVENeGGNJ1XPnB0KWOzsoZoZccInNzO6Iot76NoMcfr62kLhhSOai WxKwtwqithHQZscZv2WPyYwMLeLalVaPE4vt2aGdP6xm9n8dxuZoqaJ6jo3ntaxNN2Bc6x NUARqY/dGtd/0JiJv74BoE0vfqJd+NE= Received: from mail-lf1-f72.google.com (mail-lf1-f72.google.com [209.85.167.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-597-263xrYh9OnWoI7NXtzL2Gg-1; Mon, 22 Sep 2025 08:33:44 -0400 X-MC-Unique: 263xrYh9OnWoI7NXtzL2Gg-1 X-Mimecast-MFC-AGG-ID: 263xrYh9OnWoI7NXtzL2Gg_1758544423 Received: by mail-lf1-f72.google.com with SMTP id 2adb3069b0e04-57a01f7f623so2063001e87.2 for ; Mon, 22 Sep 2025 05:33:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758544422; x=1759149222; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=NwFfNXuEYC5w2CRyqR8EU2ag6WrGBHgUh5XAyf5EiU4=; b=KsD3ajJ214jCKB/HLgo4r0/B+ytfxGhEIgVyfnersO0Us2Sx1raUMCpEamQm3LLzgJ KHgMRFC6uc2rgRLGinkBMCa/JIB8S37AnwsNZP6pRgfT4cy+r+PteNkHA0Bjp6hNIncs wsylHFr6rlSXWnBO7s7vuVMEHjRof5N57thsI5KlnHUim4/AB8k8ccvRK0js4Iu8g/GT JFojSt5SQ7LBLtxz1Ctde1jHCKPstC82rTU10JKvoHWZ4+DcBqlzP9bKjze/WykqhLBC BuqcLOxqhNKgMWUpzRGpCCnJ7MB0IStEQ0xvDVS1z2xRIcwzTSLD3kqRxMNd2FRvHLwI KPPQ== X-Forwarded-Encrypted: i=1; AJvYcCVrnvhe8k55nuiAH5lq0auwB0RWWKqfbFkR/RyF73EnSmjJ6JG7twwvqE6vki9kKfu9F9QeNLM=@dpdk.org X-Gm-Message-State: AOJu0YxjXHx25ZeoVdOwK5NPFxOgD7w+p2zUC9kGyEBUxWx+Ew9rSP6Q yIOxH7CQhCxMGpNeVCtHVeOnhBuNAcS9Rk/+lgLmHqDVnMvRLlVWqaL3WCzVXdkUSAOJutb/Dpv 8MiXjCxY3Ro322AS3x21tofs2GLYjX5D3yw0gzrKsUh8chv9yfNjrk+OaT2jkGqdS4NiaMNVdvv b1YAss3dyQA+QxxAtJ3M5YC8g= X-Gm-Gg: ASbGncvl6tMmk7tI3JlGZgcw2cxsEAoCc2vUnh2whge6eeWtN+m/cvd3UI6dkV/ctn4 xK3Yz/7Hy3HvGu/tq1z8BG06wA7/MIdaDm9MfOez6mAMYOL28JEausH291uqQHFbnXsG+Q1AQfc gkuzlzGCfgAS6JI706ORiVNuE= X-Received: by 2002:a05:6512:6716:b0:577:184a:460a with SMTP id 2adb3069b0e04-579e3d2aff7mr4051111e87.38.1758544422581; Mon, 22 Sep 2025 05:33:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG/0ISwc8EebvbZJJxicKfzanuCQb6Jtttze8If3QDMN0vBTJnKjiNGSm7012dJYJcJ5GZTXMJMvmiFPjSH19E= X-Received: by 2002:a05:6512:6716:b0:577:184a:460a with SMTP id 2adb3069b0e04-579e3d2aff7mr4051100e87.38.1758544422182; Mon, 22 Sep 2025 05:33:42 -0700 (PDT) MIME-Version: 1.0 References: <20250407052532.1913-1-ming.1.yang@nokia-sbell.com> <20250719153227.1980-1-mosesyyoung@gmail.com> <20250719153227.1980-2-mosesyyoung@gmail.com> <82eea0d0-81c4-4623-984e-02ad11bdde59@intel.com> In-Reply-To: <82eea0d0-81c4-4623-984e-02ad11bdde59@intel.com> From: David Marchand Date: Mon, 22 Sep 2025 14:33:30 +0200 X-Gm-Features: AS18NWAeb3j-1HCQuSmovTb9VDsvtnUkdtC8lo-_nciVZRi7c4oBCyFdecVrtBE Message-ID: Subject: Re: [PATCH v3 2/2] crypto/ipsec_mb: fix QP release in secondary To: Yang Ming Cc: dev@dpdk.org, kai.ji@intel.com, stable@dpdk.org, "Burakov, Anatoly" X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: aZgH2WIPDETrnO-en_FKwJHu4scYjA2G0PHKGWBydnc_1758544423 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On Wed, 3 Sept 2025 at 11:27, Burakov, Anatoly wrote: > > On 7/19/2025 5:32 PM, Yang Ming wrote: > > When a secondary process tries to release a queue pair (QP) that > > does not belong to it, error logs occur: > > CRYPTODEV: ipsec_mb_ipc_request() line 373: Unable to release > > qp_id=0 > > EAL: Message data is too long > > EAL: Fail to handle message: ipsec_mb_mp_msg > > EAL: Fail to recv reply for request /tmp/dpdk/l2hi/mp_socket: > > ipsec_mb_mp_msg > > > > From the code path, cryptodev->data is allocated in the primary > > via rte_cryptodev_data_alloc() (inside > > ipsec_mb_create-->rte_cryptodev_pmd_create > > -->rte_cryptodev_pmd_allocate-->rte_cryptodev_data_alloc). > > This memory is placed in a shared memzone > > (rte_cryptodev_data_%u), so both primary and secondary processes > > reference the same cryptodev->data, including nb_queue_pairs and > > queue_pairs[]. > > > > As a result, when the secondary process exits, ipsec_mb_remove() > > is called (inside > > rte_eal_cleanup-->eal_bus_cleanup-->vdev_cleanup > > -->rte_vdev_driver-->ipsec_mb_remove-->ipsec_mb_qp_release > > -->ipsec_mb_secondary_qp_op) and it loops through all queue > > pairs using: > > for (qp_id = 0; qp_id < cryptodev->data->nb_queue_pairs; qp_id++) > > ipsec_mb_qp_release(cryptodev, qp_id); > > > > This causes the secondary to attempt releasing queue pairs it > > doesn't own, triggering the error logs mentioned above. > > > > This patch ensures that a secondary process only frees a QP if > > it actually owns it, preventing conflicts and resolving the > > issue. > > > > Fixes: b35848bc01f6 ("crypto/ipsec_mb: add multi-process IPC request handler") > > Cc: kai.ji@intel.com > > Cc: stable@dpdk.org > > > > Signed-off-by: Yang Ming > Acked-by: Anatoly Burakov Series applied, thanks. -- David Marchand