DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: David Marchand <david.marchand@redhat.com>
Cc: dev <dev@dpdk.org>, "Xia, Chenbo" <chenbo.xia@intel.com>,
	Adrian Moreno Zapata <amorenoz@redhat.com>,
	Olivier Matz <olivier.matz@6wind.com>,
	bnemeth@redhat.com
Subject: Re: [dpdk-dev] [PATCH v2 2/4] net/virtio: improve queue init error path
Date: Mon, 15 Mar 2021 16:41:37 +0100	[thread overview]
Message-ID: <5ff6978e-5b46-5d36-2a3b-6415ce9b9ea2@redhat.com> (raw)
In-Reply-To: <CAJFAV8zkAsijby7zFDOxutVTHKuireaycXMmKGbUjf9H_-mAuw@mail.gmail.com>



On 3/15/21 4:38 PM, David Marchand wrote:
> On Mon, Mar 15, 2021 at 4:20 PM Maxime Coquelin
> <maxime.coquelin@redhat.com> wrote:
>> @@ -604,15 +604,22 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t queue_idx)
>>
>>         if (VIRTIO_OPS(hw)->setup_queue(hw, vq) < 0) {
>>                 PMD_INIT_LOG(ERR, "setup_queue failed");
>> -               return -EINVAL;
>> +               ret = -EINVAL;
>> +               goto clean_vq;
>>         }
>>
>>         return 0;
>>
>> -fail_q_alloc:
>> -       rte_free(sw_ring);
>> +clean_vq:
>> +       hw->cvq = NULL;
>> +
>> +       if (sw_ring)
>> +               rte_free(sw_ring);
> 
> Nit: rte_free handles NULL fine, you can remove the test, the same way
> it was done before.

The API doc indeed specifies the NULL case, I'll remove it in v3.

>> +free_hdr_mz:
>>         rte_memzone_free(hdr_mz);
>> +free_mz:
>>         rte_memzone_free(mz);
>> +free_vq:
>>         rte_free(vq);
>>
>>         return ret;
> 

Thanks,
Maxime


  reply	other threads:[~2021-03-15 15:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-15 15:19 [dpdk-dev] [PATCH v2 0/4] net/virtio: make virtqueue struct cache-friendly Maxime Coquelin
2021-03-15 15:19 ` [dpdk-dev] [PATCH v2 1/4] net/virtio: remove reference to virtqueue in vrings Maxime Coquelin
2021-03-15 15:19 ` [dpdk-dev] [PATCH v2 2/4] net/virtio: improve queue init error path Maxime Coquelin
2021-03-15 15:38   ` David Marchand
2021-03-15 15:41     ` Maxime Coquelin [this message]
2021-03-15 15:19 ` [dpdk-dev] [PATCH v2 3/4] net/virtio: allocate fake mbuf in Rx queue Maxime Coquelin
2021-03-15 15:50   ` David Marchand
2021-03-15 16:42     ` Maxime Coquelin
2021-03-15 15:19 ` [dpdk-dev] [PATCH v2 4/4] net/virtio: pack virtuqueue struct Maxime Coquelin
2021-03-15 15:51   ` David Marchand

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=5ff6978e-5b46-5d36-2a3b-6415ce9b9ea2@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=amorenoz@redhat.com \
    --cc=bnemeth@redhat.com \
    --cc=chenbo.xia@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=olivier.matz@6wind.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).