From: Chas Williams <3chas3@gmail.com>
To: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
"Lu, Wenzhuo" <wenzhuo.lu@intel.com>,
"Charles (Chas) Williams" <chas3@att.com>
Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: fix reconfiguration of rx queues
Date: Mon, 29 Jan 2018 11:49:23 -0500 [thread overview]
Message-ID: <CAG2-Gkkwoc1oJJ=Wegnsr-9_Z4KjZ4viwHQzyJNAXCDkNUO=jw@mail.gmail.com> (raw)
In-Reply-To: <2601191342CEEE43887BDE71AB977258905653D7@IRSMSX103.ger.corp.intel.com>
On Mon, Jan 29, 2018 at 11:25 AM, Ananyev, Konstantin <
konstantin.ananyev@intel.com> wrote:
>
> > -----Original Message-----
> > From: Chas Williams [mailto:3chas3@gmail.com]
> > Sent: Monday, January 29, 2018 3:21 PM
> > To: dev@dpdk.org
> > Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin <
> konstantin.ananyev@intel.com>; Charles (Chas) Williams
> > <chas3@att.com>
> > Subject: [PATCH] net/ixgbe: fix reconfiguration of rx queues
> >
> > From: "Charles (Chas) Williams" <chas3@att.com>
> >
> > .dev_configure() may be called again after RX queues have been setup.
> > This has the effect of clearing whatever setting the RX queues made for
> > rx_bulk_alloc_allowed or rx_vec_allowed. Only reset this configuration
> > is there aren't any currently allocated queues.
> >
> > Fixes: 01fa1d6215fa ("ixgbe: unify Rx setup")
> >
> > Signed-off-by: Chas Williams <chas3@att.com>
> > ---
> > drivers/net/ixgbe/ixgbe_ethdev.c | 18 ++++++++++++++++--
> > 1 file changed, 16 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_
> ethdev.c
> > index 37eb668..b39249a 100644
> > --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> > @@ -2348,6 +2348,7 @@ ixgbe_dev_configure(struct rte_eth_dev *dev)
> > struct ixgbe_adapter *adapter =
> > (struct ixgbe_adapter *)dev->data->dev_private;
> > int ret;
> > + uint16_t i;
> >
> > PMD_INIT_FUNC_TRACE();
> > /* multipe queue mode checking */
> > @@ -2363,11 +2364,17 @@ ixgbe_dev_configure(struct rte_eth_dev *dev)
> >
> > /*
> > * Initialize to TRUE. If any of Rx queues doesn't meet the bulk
> > - * allocation or vector Rx preconditions we will reset it.
> > + * allocation or vector Rx preconditions we will reset it. We
> > + * can only do this is there aren't any existing RX queues.
> > */
> > + for (i = 0; i < dev->data->nb_rx_queues; i++) {
> > + if (dev->data->rx_queues[i])
> > + goto out;
> > + }
>
> I don't see why this is needed.
> It surely should be possible to reconfigure device with different
> number of queues.
> Konstantin
>
Yes, you can add new queues but you shouldn't reset the bulk and vec
settings
that have already been chosen by the previously allocated queues. If those
queues
set rx_bulk_alloc_allowed to be false, then this is going to cause an issue
with queue
release later on. This breaks:
rte_eth_dev_configure(..., 1, 1, ...);
rx_queue_setup(1)
[rx_queue_setup decides that it can't support rx_bulk_alloc_allowed]
..
Later, you want to add some more queues, you call
eth_eth_dev_configure(..., 2, 2, ...);
rx_queue_setup(2)
[rx_queue_setup hopefully makes the same choice as rxqid = 1?]
...
Is one supposed to release all queues before calling
rte_eth_dev_configure()? If
that is true, it seems like the change_mtu examples I see are possibly
wrong. As
suggested in kenrel_nic_interface.rst:
ret = rte_eth_dev_configure(port_id, 1, 1, &conf);
if (ret < 0) {
RTE_LOG(ERR, APP, "Fail to reconfigure port %d\n", port_id);
return ret;
}
/* Restart specific port */
ret = rte_eth_dev_start(port_id);
if (ret < 0) {
RTE_LOG(ERR, APP, "Fail to restart port %d\n", port_id);
return ret;
}
This is will obviously reset the rx_bulk_alloc_allowed and not reallocated
the RX queues.
>
> > adapter->rx_bulk_alloc_allowed = true;
> > adapter->rx_vec_allowed = true;
> >
> > +out:
> > return 0;
> > }
> >
> > @@ -4959,6 +4966,7 @@ ixgbevf_dev_configure(struct rte_eth_dev *dev)
> > struct rte_eth_conf *conf = &dev->data->dev_conf;
> > struct ixgbe_adapter *adapter =
> > (struct ixgbe_adapter *)dev->data->dev_private;
> > + uint16_t i;
> >
> > PMD_INIT_LOG(DEBUG, "Configured Virtual Function port id: %d",
> > dev->data->port_id);
> > @@ -4981,11 +4989,17 @@ ixgbevf_dev_configure(struct rte_eth_dev *dev)
> >
> > /*
> > * Initialize to TRUE. If any of Rx queues doesn't meet the bulk
> > - * allocation or vector Rx preconditions we will reset it.
> > + * allocation or vector Rx preconditions we will reset it. We
> > + * can only do this is there aren't any existing RX queues.
> > */
> > + for (i = 0; i < dev->data->nb_rx_queues; i++) {
> > + if (dev->data->rx_queues[i])
> > + goto out;
> > + }
> > adapter->rx_bulk_alloc_allowed = true;
> > adapter->rx_vec_allowed = true;
> >
> > +out:
> > return 0;
> > }
> >
> > --
> > 2.9.5
>
>
next prev parent reply other threads:[~2018-01-29 16:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-29 15:21 Chas Williams
2018-01-29 16:25 ` Ananyev, Konstantin
2018-01-29 16:49 ` Chas Williams [this message]
[not found] ` <2601191342CEEE43887BDE71AB97725890565545@IRSMSX103.ger.corp.intel.com>
2018-01-29 18:05 ` Ananyev, Konstantin
2018-01-29 18:30 ` Chas Williams
[not found] ` <2601191342CEEE43887BDE71AB97725890565AC3@IRSMSX103.ger.corp.intel.com>
2018-01-30 13:14 ` Ananyev, Konstantin
2018-01-30 16:15 ` Chas Williams
[not found] ` <2601191342CEEE43887BDE71AB977258905662FE@IRSMSX103.ger.corp.intel.com>
2018-01-31 13:38 ` Ananyev, Konstantin
2018-03-29 5:14 ` Zhang, Helin
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='CAG2-Gkkwoc1oJJ=Wegnsr-9_Z4KjZ4viwHQzyJNAXCDkNUO=jw@mail.gmail.com' \
--to=3chas3@gmail.com \
--cc=chas3@att.com \
--cc=dev@dpdk.org \
--cc=konstantin.ananyev@intel.com \
--cc=wenzhuo.lu@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).