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 23B04A00C2; Thu, 13 Oct 2022 05:33:36 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B7A7042C94; Thu, 13 Oct 2022 05:33:35 +0200 (CEST) Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by mails.dpdk.org (Postfix) with ESMTP id 650CE42C27 for ; Thu, 13 Oct 2022 05:33:34 +0200 (CEST) Received: by mail-pl1-f182.google.com with SMTP id c24so677901pls.9 for ; Wed, 12 Oct 2022 20:33:34 -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:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=/Hq/Vy4KG31aoancdydIppn9pvS2JePkD1QoMPd9APc=; b=k7S0lfwlsjiXDrfAOZkil6P9FPTbwilnmeVqRVPg8zJD5c6Q9Oc+9gsZN5ERjnDMXv am6XZ0a9DcYmOGYI9dIIN3l3LB9cRJNIHYnjb1fQvM6eWDkLz2m1ZBwOKjqkkMcDbIOD EspXX/yMyP5p10SKeifFs9MwDa+Td325YHGUXMMU+GPmSiQSLWPRiYK4uRx3BHjbPBKw mhQ/5Yf8vQZ5i038PttBN8SY7ioiptEe6hNAk/G7qil3+Rv0XXvl3RYLRF1SIUJLxs/5 wNcOiGpihBs7ysk6aGyWjNeaDV5J8wGrGGVdJwLdUDiyaiWzvT2gzKt4kVeS1EoOo7FU J7RQ== 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=/Hq/Vy4KG31aoancdydIppn9pvS2JePkD1QoMPd9APc=; b=79e45xXW8jlrYoQxhXW1Ft920FQ2LUmFGd5WUmLsoP7wHXW8tmq2vKUZ4JkQ8TRsjC pnQ0Obbg9+y1b2h+1k3VwT6TTj2jGVnBeRDiVCIyyOJ/zrswlySklB31QYbBj8Gpz0U+ ZPt11jPhGONHLad3ozz2XCLC0VF7BN9t+s0Gte2LsoTYgF8+G51WtD7kBlFvhcIGrmMi YMNsXrsqottJ7AN1uq1cbeVZt0FW/HdDLdD8GCj2zxEluvacJbvQdTOweis7OWE9or0o CJ0SoOSY6Mqo2nqShyf+qPUjvuLShbSUfj6zMJQorJMHPgLVY7KTwzdRYs8VGadN+OCf 1YyQ== X-Gm-Message-State: ACrzQf2AS8o+HIVT9CFUOnkPtX2XO6oczKDRaPWYv9asxmJuqkW/Ov+h luJzd7uLjMFZbZY2sUQaUPWJww== X-Google-Smtp-Source: AMsMyM4w5eEQ0xvmx5qbgYFsRKwBfokwPwM/XjdS+ptPPjfUy+y97iGYhVRmItsGWw6EM7ZgJBVDDg== X-Received: by 2002:a17:903:230a:b0:17d:707a:360e with SMTP id d10-20020a170903230a00b0017d707a360emr33042740plh.118.1665632013444; Wed, 12 Oct 2022 20:33:33 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id a11-20020a170902900b00b00179c99eb815sm11373734plp.33.2022.10.12.20.33.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Oct 2022 20:33:33 -0700 (PDT) Date: Wed, 12 Oct 2022 20:33:31 -0700 From: Stephen Hemminger To: Peng Zhang Cc: dev@dpdk.org, andrew.rybchenko@oktetlabs.ru, aman.deep.singh@intel.com, yuying.zhang@intel.com, stable@dpdk.org Subject: Re: [PATCH v3] app/testpmd: fix incorrect queues state of secondary process Message-ID: <20221012203331.60fa714a@hermes.local> In-Reply-To: <20220906145310.8849-1-peng1x.zhang@intel.com> References: <20220819100940.657437-1-peng1x.zhang@intel.com> <20220906145310.8849-1-peng1x.zhang@intel.com> 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 Tue, 6 Sep 2022 22:53:10 +0800 Peng Zhang wrote: > + if (rte_eal_process_type() != RTE_PROC_PRIMARY) { > + struct fwd_stream *fs = fwd_streams[i]; > + struct rte_eth_dev_data *dev_rx_data, *dev_tx_data; > + > + dev_rx_data = (&rte_eth_devices[fs->rx_port])->data; > + dev_tx_data = (&rte_eth_devices[fs->tx_port])->data; > + > + uint8_t rx_state = dev_rx_data->rx_queue_state[fs->rx_queue]; > + ports[fs->rx_port].rxq[fs->rx_queue].state = rx_state; > + uint8_t tx_state = dev_tx_data->tx_queue_state[fs->tx_queue]; > + ports[fs->tx_port].txq[fs->tx_queue].state = tx_state; > + } Could the logic be put in stream_init() like this? It keeps with the function pointer model object style model in that code. Also, it makes testpmd more dependent on data structures that should be hidden and internal only (rte_eth_devices).