DPDK patches and discussions
 help / color / mirror / Atom feed
From: Shreyansh Jain <shreyansh.jain@nxp.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: <viktorin@rehivetech.com>, <dev@dpdk.org>, <thomas.monjalon@6wind.com>
Subject: Re: [dpdk-dev] [PATCH 2/5] eal: extract function eal_parse_sysfs_valuef
Date: Thu, 1 Sep 2016 14:31:27 +0530	[thread overview]
Message-ID: <7511d94b-fae6-c9e8-d6ac-67e67956d8f1@nxp.com> (raw)
In-Reply-To: <20160831233010.5d78d262@xeon-e3>

Hi Stephen,

On Thursday 01 September 2016 12:00 PM, Stephen Hemminger wrote:
> On Thu, 1 Sep 2016 10:11:52 +0530
> Shreyansh Jain <shreyansh.jain@nxp.com> wrote:
>
>> From: Jan Viktorin <viktorin@rehivetech.com>
>>
>> From: Jan Viktorin <viktorin@rehivetech.com>
>>
>> The eal_parse_sysfs_value function accepts a filename however, such
>> interface introduces race-conditions to the code. Introduce the
>> variant of this function that accepts an already opened file instead of
>> a filename.
>>
>> Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
>> Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
>> ---
>
> You introduce new API, but don't use it in your other patches.

Indeed - I have not used this API anywhere in my patches. As highlighted 
in the covering letter, these are some proposed changes which *might* 
help in future (for e.g., introducing new SoC infra).
Patches don't depend on each other.

> I don't see where passing filename is racy. sysfs files only get created/destroyed
> when device is added/removed.
>

Agree that 'race-condition' is not the right word.

parse_sysfs_value reads a single integer from a given sysfs file and is 
a useful helper for EAL layer, specifically for non-PCI infra as and 
when it is introduced (reading through custom sysfs files).
At that time, it may be possible that caller keeps the context of the 
call rather than open the file every time - for reading more than an 
integer, for example.

-
Shreyansh

  reply	other threads:[~2016-09-01  9:01 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-01  4:41 [dpdk-dev] [PATCH 0/5] Generalize PCI specific EAL function/structures Shreyansh Jain
2016-09-01  4:41 ` [dpdk-dev] [PATCH 1/5] eal: make enum rte_kernel_driver non-PCI specific Shreyansh Jain
2016-09-11 12:15   ` Yuanhan Liu
2016-09-12  5:10     ` Shreyansh Jain
2016-09-01  4:41 ` [dpdk-dev] [PATCH 2/5] eal: extract function eal_parse_sysfs_valuef Shreyansh Jain
2016-09-01  6:30   ` Stephen Hemminger
2016-09-01  9:01     ` Shreyansh Jain [this message]
2016-09-01  4:41 ` [dpdk-dev] [PATCH 3/5] eal: Convert pci_(un)map_resource to rte_eal_(un)map_resource Shreyansh Jain
2016-09-01  4:41 ` [dpdk-dev] [PATCH 4/5] eal/linux: extract function rte_eal_unbind_kernel_driver Shreyansh Jain
2016-09-01  4:41 ` [dpdk-dev] [PATCH 5/5] eal/linux: extract function rte_eal_get_kernel_driver_by_path Shreyansh Jain
2016-09-27 14:12 ` [dpdk-dev] [PATCH v1 0/4] Generalize PCI specific EAL function/structures Shreyansh Jain
2016-09-27 14:12   ` [dpdk-dev] [PATCH v1 1/4] eal: generalize PCI kernel driver enum to EAL Shreyansh Jain
2016-09-27 14:12   ` [dpdk-dev] [PATCH v1 2/4] eal: generalize PCI map/unmap resource " Shreyansh Jain
2016-09-27 14:12   ` [dpdk-dev] [PATCH v1 3/4] eal/linux: generalize PCI kernel unbinding driver " Shreyansh Jain
2016-09-27 14:12   ` [dpdk-dev] [PATCH v1 4/4] eal/linux: generalize PCI kernel driver extraction " Shreyansh Jain
2016-09-30 15:31   ` [dpdk-dev] [PATCH v1 0/4] Generalize PCI specific EAL function/structures David Marchand
2016-10-03  5:37     ` Shreyansh Jain
2016-10-03 13:12       ` Jan Viktorin
2016-10-03 13:36       ` Thomas Monjalon
2016-10-06 11:43         ` Shreyansh Jain
2016-10-06 13:01           ` Thomas Monjalon
2016-10-13  6:47     ` Shreyansh Jain
2016-10-14 10:55   ` [dpdk-dev] [PATCH v2 " Shreyansh Jain
2016-10-14 10:55     ` [dpdk-dev] [PATCH v2 1/4] eal: generalize PCI kernel driver enum to EAL Shreyansh Jain
2016-10-14 10:55     ` [dpdk-dev] [PATCH v2 2/4] eal: generalize PCI map/unmap resource " Shreyansh Jain
2016-10-14 10:55     ` [dpdk-dev] [PATCH v2 3/4] eal/linux: generalize PCI kernel unbinding driver " Shreyansh Jain
2016-10-14 10:55     ` [dpdk-dev] [PATCH v2 4/4] eal/linux: generalize PCI kernel driver extraction " Shreyansh Jain

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=7511d94b-fae6-c9e8-d6ac-67e67956d8f1@nxp.com \
    --to=shreyansh.jain@nxp.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.org \
    --cc=thomas.monjalon@6wind.com \
    --cc=viktorin@rehivetech.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).