DPDK patches and discussions
 help / color / mirror / Atom feed
From: "John Daley (johndale)" <johndale@cisco.com>
To: Aaron Conole <aconole@redhat.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [RFC 2/4] enic: fix assignment
Date: Tue, 10 Oct 2017 17:31:16 +0000	[thread overview]
Message-ID: <da72267b3d10424c8e69cae9325735f4@XCH-RCD-007.cisco.com> (raw)
In-Reply-To: <20170926185329.2776-3-aconole@redhat.com>

Aaron,

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Aaron Conole
> Sent: Tuesday, September 26, 2017 11:53 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [RFC 2/4] enic: fix assignment
> 
> As it stands, the existing assingment to mbuf has no effect outside of the
> function.  Prior to this change, the mbuf argument would contain an invalid
> address, but it would not be null.  After this change, the caller gets a null
> mbuf back.
> 
> Signed-off-by: Aaron Conole <aconole@redhat.com>
> ---
>  drivers/net/enic/enic_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
> index 40dbec7..ff8e4c5 100644
> --- a/drivers/net/enic/enic_main.c
> +++ b/drivers/net/enic/enic_main.c
> @@ -224,7 +224,7 @@ enic_free_rq_buf(struct rte_mbuf **mbuf)
>  		return;
> 
>  	rte_pktmbuf_free(*mbuf);
> -	mbuf = NULL;
> +	*mbuf = NULL;
>  }
> 
>  void enic_init_vnic_resources(struct enic *enic)

As it turns out, this function is only called when the device is stopped and restarting the device overwrites the mbuf pointers with newly allocated ones, so there is currently no bad behavior. The intent was to NULL out the pointer though and it's certainly better form so I agree with the change.

Reviewed-by: John Daley <johndale@cisco.com>

Thanks,
Johnd
> --
> 2.9.5

  reply	other threads:[~2017-10-10 17:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-26 18:53 [dpdk-dev] [RFC 0/4] misc enic fixes Aaron Conole
2017-09-26 18:53 ` [dpdk-dev] [RFC 1/4] enic: update format string to match arg types Aaron Conole
2017-10-10 17:30   ` John Daley (johndale)
2017-09-26 18:53 ` [dpdk-dev] [RFC 2/4] enic: fix assignment Aaron Conole
2017-10-10 17:31   ` John Daley (johndale) [this message]
2017-09-26 18:53 ` [dpdk-dev] [RFC 3/4] enic: remove unused code Aaron Conole
2017-10-10 17:31   ` John Daley (johndale)
2017-09-26 18:53 ` [dpdk-dev] [RFC 4/4] enic: remove anscillary assignment Aaron Conole
2017-10-10 17:32   ` John Daley (johndale)
2017-10-03 16:16 ` [dpdk-dev] [RFC 0/4] misc enic fixes Ferruh Yigit
2017-10-09 14:00   ` Aaron Conole
2017-10-10 23:06 ` Ferruh Yigit

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=da72267b3d10424c8e69cae9325735f4@XCH-RCD-007.cisco.com \
    --to=johndale@cisco.com \
    --cc=aconole@redhat.com \
    --cc=dev@dpdk.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).