DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v2] net/af_packet: remove limitation on number of qpairs
Date: Mon, 2 Mar 2020 16:17:04 +0000	[thread overview]
Message-ID: <dbc3c6df-4087-13ff-8b50-a829272f0b57@intel.com> (raw)
In-Reply-To: <20200228165234.GG3353@tuxdriver.com>

On 2/28/2020 4:52 PM, John W. Linville wrote:
> On Fri, Feb 28, 2020 at 10:08:43AM +0000, Ferruh Yigit wrote:
>> On 2/27/2020 8:00 PM, Stephen Hemminger wrote:
>>> Since qpairs is part of the vdev arguments, there is no need to
>>> limit it to 16. The queue arrays can be dynamically sized based
>>> on the requested parameters.
>>>
>>> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
>>> ---
>>>  drivers/net/af_packet/rte_eth_af_packet.c | 23 +++++++++++++++++------
>>>  1 file changed, 17 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
>>> index f5806bf42c46..e5e0aa9277a8 100644
>>> --- a/drivers/net/af_packet/rte_eth_af_packet.c
>>> +++ b/drivers/net/af_packet/rte_eth_af_packet.c
>>> @@ -37,8 +37,6 @@
>>>  #define DFLT_FRAME_SIZE		(1 << 11)
>>>  #define DFLT_FRAME_COUNT	(1 << 9)
>>>  
>>> -#define RTE_PMD_AF_PACKET_MAX_RINGS 16
>>> -
>>>  struct pkt_rx_queue {
>>>  	int sockfd;
>>>  
>>> @@ -77,8 +75,8 @@ struct pmd_internals {
>>>  
>>>  	struct tpacket_req req;
>>>  
>>> -	struct pkt_rx_queue rx_queue[RTE_PMD_AF_PACKET_MAX_RINGS];
>>> -	struct pkt_tx_queue tx_queue[RTE_PMD_AF_PACKET_MAX_RINGS];
>>> +	struct pkt_rx_queue *rx_queue;
>>> +	struct pkt_tx_queue *tx_queue;
>>>  };
>>>  
>>>  static const char *valid_arguments[] = {
>>> @@ -601,6 +599,18 @@ rte_pmd_init_internals(struct rte_vdev_device *dev,
>>>  	if (*internals == NULL)
>>>  		return -1;
>>>  
>>> +
>>> +	(*internals)->rx_queue = rte_calloc_socket("af_packet_rx",
>>> +						nb_queues,
>>> +						sizeof(struct pkt_rx_queue),
>>> +						0, numa_node);
>>> +	(*internals)->tx_queue = rte_calloc_socket("af_packet_tx",
>>> +						nb_queues,
>>> +						sizeof(struct pkt_tx_queue),
>>> +						0, numa_node);
>>
>> Not for this patch but right now all queue initialization done during init based
>> on max queue PMD can support, we may move allocating and configuring queues in
>> 'eth_rx_queue_setup' & 'eth_tx_queue_setup' based on number of queue application
>> request, in the future...
>>
>>> +	if (!(*internals)->rx_queue || !(*internals)->tx_queue)
>>> +		return -1;
>>
>> If only one allocation fails, should we free the other?
> 
> Yeah, good catch.
> 

Will fix while merging.

      reply	other threads:[~2020-03-02 16:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-24 23:11 [dpdk-dev] [PATCH] af_packet: allow configuring number of rings Stephen Hemminger
2020-02-27 17:20 ` Ferruh Yigit
2020-02-27 17:51   ` Stephen Hemminger
2020-02-27 17:55     ` Ferruh Yigit
2020-02-27 20:00 ` [dpdk-dev] [PATCH v2] net/af_packet: remove limitation on number of qpairs Stephen Hemminger
2020-02-27 20:56   ` John W. Linville
2020-03-02 16:24     ` Ferruh Yigit
2020-03-02 16:43       ` Stephen Hemminger
2020-03-02 17:20         ` Ferruh Yigit
2020-02-28 10:08   ` Ferruh Yigit
2020-02-28 16:52     ` John W. Linville
2020-03-02 16:17       ` Ferruh Yigit [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=dbc3c6df-4087-13ff-8b50-a829272f0b57@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=linville@tuxdriver.com \
    --cc=stephen@networkplumber.org \
    /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).