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 16185A0547; Wed, 11 Aug 2021 14:54:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A565040C35; Wed, 11 Aug 2021 14:54:37 +0200 (CEST) Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) by mails.dpdk.org (Postfix) with ESMTP id 8582640042 for ; Wed, 11 Aug 2021 14:54:36 +0200 (CEST) Received: by mail-io1-f44.google.com with SMTP id b142so2136756iof.4 for ; Wed, 11 Aug 2021 05:54:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=5TYJxLz0eK1jXcEF0Y7ROLacd33vZ7eanJ1mPFrWM1Q=; b=BaX3JbukvSvBOfAxccZoSTiCgmD1pId03/xerAFIWvjBthFZFReqBj0RBPGiLe0DIh 0TPsywxyRUQKgpNFZ8k60GpzqzeESY5F44qMPfHhQa5ENe/4hbiZp56hvw+ZDMIyNSF8 6U18yuRVudorBM+lmOhMFHASupkppZK6T3cD5PNXjMvI+eElW/JA4BmgQmPD/uI07Xkj LVQ/E4JZeaGe73K0fFsBsT4HM4iI6kpzAs+2O1PISbLTHwtepQ3ShZuGlJR5dqlvL/oZ CkaxZ/MItJw3ofbOkwoxmF+UVlBxrOSWTNAGCrUjS8Dj22ELHzViWFCr4yIqYF1SNSQF 9ERQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=5TYJxLz0eK1jXcEF0Y7ROLacd33vZ7eanJ1mPFrWM1Q=; b=SjQrHRdnkyTzbwjjRdCAwbbIxIbua+OgygURVWpmISA5+P50KbY4nRmmDAARmFN2R1 wIfb22EhvC1T3ltk2tBj2CslW0xfkvg0q6Z3GtnqUPVYmLjto1VsJOI5/XSAH91R8Qf5 TDfR+203NFUSvammNc+55ztJjJhVtGqnb+1NtuxSgXp/LdxEMAX7lrPE6VuDZVu3yBQh ugVADYV0FZLzqUnZrU0dcltB4NjdhUNeXVW3rP71Kt13Dtt+mbGjTAXYLFDLRtH689Qe VsMi4i9NF5XnlFX2/7JE4mpNIFO28wptBBzU6ufLggBXsnez1B39o6HlKirSuA4nW09n x2gA== X-Gm-Message-State: AOAM531LFxQh0G2rDtSXakudvtBj581h6vhTeOOo0liyr8917lBm9p19 X0UU+TSNrc8gNSOKIwHMiqwsXRJIajQf3iFPcz3qjaWkKm0= X-Google-Smtp-Source: ABdhPJxXvBESs+6ldkJ1CMudOqcXC2aScsPh3KQyBQ9Li4K6ZWvEVYNzGFOidE0zW+2jWaYWFtRcY5kGT7JZoCpY7Lk= X-Received: by 2002:a5e:8f43:: with SMTP id x3mr435788iop.206.1628686475614; Wed, 11 Aug 2021 05:54:35 -0700 (PDT) MIME-Version: 1.0 From: kumaraparameshwaran rathinavel Date: Wed, 11 Aug 2021 18:24:24 +0530 Message-ID: To: dev@dpdk.org Cc: qi.z.zhang@intel.com Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [dpdk-dev] Failsafe Secondary Process 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 Sender: "dev" Hi All, In the commit ee27edbe0c10ec8337c4cc4d2935a751d0da605f I see that for the probe from the secondary process the below check was made, for vdev devices like tap, af_packet. + if (rte_eal_process_type() == RTE_PROC_SECONDARY && + strlen(rte_vdev_device_args(dev)) == 0) { + eth_dev = rte_eth_dev_attach_secondary(name); + if (!eth_dev) { + RTE_LOG(ERR, PMD, "Failed to probe %s\n", name); + return -1; + } + /* TODO: request info from primary to set up Rx and Tx */ + eth_dev->dev_ops = &ops; + return 0; + } After that in the commit 4852aa8f6e2125664698afc43b820bd787b02756 the strlen(rte_vdev_device_args(dev)) check for the secondary was removed so that the secondary process could attach to the devices created by the primary and work on it. - if (rte_eal_process_type() == RTE_PROC_SECONDARY && - strlen(rte_vdev_device_args(dev)) == 0) { + if (rte_eal_process_type() == RTE_PROC_SECONDARY) { But I see in the rte_pmd_failsafe_probe looks like the strlen check was not removed. Because of this when i try to use initialise the failsafe device from secondary which was created by primary, rather than attaching to the existing device, a new failsafe device is created. Looks like this is a miss for the failsafe driver or is it intentionally retained? commit ee27edbe0c10ec8337c4cc4d2935a751d0da605f Date: Tue Apr 24 05:51:24 2018 +0000 drivers/net: share vdev data to secondary process dpdk-procinfo, as a secondary process, cannot fetch stats for vdev. This patch enables that by attaching the port from the shared data. We also fill the eth dev ops, with only some ops works in secondary process, for example, stats_get(). commit 4852aa8f6e2125664698afc43b820bd787b02756 Date: Tue Oct 16 08:16:30 2018 +0800 drivers/net: enable hotplug on secondary process Attach port from secondary should ignore devargs since the private device is not necessary to support. Also previously, detach port on a secondary process will mess primary process and cause the same device can't be attached back again. A secondary process should use rte_eth_dev_release_port_secondary to release a port. Thanks, Param.