From: "Zhou, YidingX" <yidingx.zhou@intel.com>
To: Stephen Hemminger <stephen@networkplumber.org>,
"Zhang, Peng1X" <peng1x.zhang@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
"andrew.rybchenko@oktetlabs.ru" <andrew.rybchenko@oktetlabs.ru>,
"Singh, Aman Deep" <aman.deep.singh@intel.com>,
"Zhang, Yuying" <yuying.zhang@intel.com>,
"stable@dpdk.org" <stable@dpdk.org>
Subject: RE: [PATCH v3] app/testpmd: fix incorrect queues state of secondary process
Date: Fri, 14 Oct 2022 10:11:59 +0000 [thread overview]
Message-ID: <DM5PR1101MB2107A451D10BF72030B3CDEF85249@DM5PR1101MB2107.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20221012203331.60fa714a@hermes.local>
>
> > + 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).
>
'strean_init' is a function pointer, putting this logic in will produce a lot of similar redundant code in all forwarding modules, like 'iofwd' 'macfwd' and etc.
It's better to hide 'rte_eth_devices' from testpmd, but this requires an API at the EAL layer to access the queue state,
'rte_eth_rx/tx_queue_info_get()' can not get queue's state now.
prev parent reply other threads:[~2022-10-14 10:12 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-23 18:15 [PATCH] app/testpmd: fix secondary process cannot dump packet peng1x.zhang
2022-06-23 12:10 ` Andrew Rybchenko
2022-06-29 2:55 ` lihuisong (C)
2022-07-01 11:36 ` Zhang, Peng1X
2022-07-04 2:36 ` lihuisong (C)
2022-07-04 5:28 ` Dmitry Kozlyuk
2022-07-05 10:12 ` Zhang, Peng1X
2022-07-06 2:00 ` lihuisong (C)
2022-07-06 13:40 ` Andrew Rybchenko
2022-06-27 4:53 ` Zhang, Yuying
2022-07-01 9:21 ` Zhang, Yuying
2022-08-19 10:09 ` [PATCH v2] app/testpmd: fix incorrect queues state of secondary process peng1x.zhang
2022-08-24 18:21 ` Singh, Aman Deep
2022-08-26 7:47 ` Zhang, Peng1X
2022-09-06 14:53 ` [PATCH v3] " Peng Zhang
2022-09-07 1:53 ` lihuisong (C)
2022-10-13 3:33 ` Stephen Hemminger
2022-10-14 10:11 ` Zhou, YidingX [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DM5PR1101MB2107A451D10BF72030B3CDEF85249@DM5PR1101MB2107.namprd11.prod.outlook.com \
--to=yidingx.zhou@intel.com \
--cc=aman.deep.singh@intel.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=dev@dpdk.org \
--cc=peng1x.zhang@intel.com \
--cc=stable@dpdk.org \
--cc=stephen@networkplumber.org \
--cc=yuying.zhang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).