[dpdk-dev] [PATCH v4 09/20] eal/dev: implement device iteration initialization

Gaëtan Rivet gaetan.rivet at 6wind.com
Sat Mar 31 17:33:07 CEST 2018


On Fri, Mar 30, 2018 at 04:22:15PM +0000, Wiles, Keith wrote:
> 
> 
> > On Mar 30, 2018, at 10:53 AM, Gaëtan Rivet <gaetan.rivet at 6wind.com> wrote:
> > 
> > Hello Keith,
> 
> Hello Gaëtan,
> 
> >>> +		layers[i].kvlist = rte_kvargs_parse(copy, NULL);
> >>> +		free(copy);
> >> 
> >> I am sorry this method of not adding blank lines is a bit silly and we need to rethink at least adding a few blank lines to help with grouping the code. This style will cause problems for new readers (old readers) to understand the code. This to me is a maintenance problem for the future and we need to fix this now.
> >> 
> >> Blank lines after if statements (with possible more comments) can help along with adding blank lines to group code is really the minimum amount of lines required. I have never seen someone state you have to many blanks lines in the code except two or more blank lines in a row. This is akin to having a single paragraph in a novel or letter and it makes it very hard to read. It is not hard to add some blank lines to the code for readability.
> >> 
> > 
> > I understand. What I dislike is having inconsistencies in the layout of
> > the code.
> > 
> > "Paragraphs", for lack of a better word, are high subjective and a
> > matter of taste.
> 
> I bet your teacher(s) would disagree with that statement with one single paragraph in your book reports :-)

The utility of using paragraph is not a matter of subjectivity.
How to use them and how to structure information is what I deemed
subjective.

> > 
> > Given that subjectivity is not helpful in review and taste is hard to
> > debate, I prefer to have a single terse rule, that is to avoid any
> > additional bytes beside the bare minimum to respect checkpatch.
> 
> Taste is hard to debate, but you have gone the extreme route with only the bare minimum blank lines and that is not good as well. A silly script does not read code or understand code we the humans have to make the code readable.
> > 
> > When I feel the need to have a new "conceptual group", then I am forced
> > to add a comment to explain what is happening. By not allowing blank
> > lines, I thus feel the pressure for space and explanation more acutely.
> 
> A blank can give somewhat convey the same information without a comment, but not in all cases. Even a blank before a group of lines can convey this is a new logic section. I do not buy the point for needing the same terse rule here as most of the coding style is free form and allows for reading between the lines a bit.
> 
> We can make a rule here, but no blank lines in a function this size and the patch of this size is making DPDK not as professional looking as it could be.
> 

I think one of the main issue anyway is that this function is simply too
large as it is.

As it turns out, I am working on the second side of this work, which is
revamping the device declaration path.

This function will be split in different parts, that will be shorter and
more palatable.

This is a big work, still in progress (the device declaration, not the
split of this function).

-- 
Gaëtan Rivet
6WIND


More information about the dev mailing list