Skip to contentSkip to conversation

cleanup duplicate includes

PATCH In review Stephen Hemminger 5 participants 41 messages Jul 11, 2017 – Aug 3, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover cleanup duplicate includes

Using a simple script (in first patch), discovered that there was lots of #include file sloppiness in DPDK. This patch series fixes everything but base drivers and examples.

Stephen Hemminger (19):
devtools: add simple script to find duplicate includes
eal: remove duplicate includes
cmdline: remove duplicate include of errno.h
distributor: remove duplicate include of rte_compat.h
lpm: remove duplicate include of errno.h
cuckoo_hash: remove duplicate include of rte_log.h
timer: remove duplicate include of rte_per_lcore.h
bnxt: remove duplicate include of unistd.h
ixgbe: remove duplicate include of rte_atomic.h
i40e: remove duplicate include of rte_atomic.h
virtio: remove duplicated includes
cxgbe: remove duplicated includes
vmxnet3: remove duplicated include of rte_atomic.h
dpaa2: remove duplicated includes
fsmlc: remove duplicated includes
app/proc-info: remove duplicate include
app/test-pmd: remove duplicate includes test/test-pipeline: remove duplicate include of rte_per_lcore.h test/test: remove duplicate includes

 app/proc_info/main.c                             |  1 -
 app/test-pmd/cmdline.c                           |  1 -
 app/test-pmd/config.c                            |  1 -
 app/test-pmd/csumonly.c                          |  2 -
 app/test-pmd/flowgen.c                           |  1 -
 app/test-pmd/iofwd.c                             |  1 -
 app/test-pmd/macfwd.c                            |  1 -
 app/test-pmd/macswap.c                           |  1 -
 app/test-pmd/parameters.c                        |  1 -
 app/test-pmd/rxonly.c                            |  1 -
 app/test-pmd/txonly.c                            |  2 -
 devtools/dup_include.pl                          | 64 ++++++++++++++++++++++++
 drivers/bus/fslmc/fslmc_vfio.c                   |  2 -
 drivers/bus/fslmc/portal/dpaa2_hw_dpio.c         |  1 -
 drivers/event/dpaa2/dpaa2_eventdev.c             |  1 -
 drivers/mempool/dpaa2/dpaa2_hw_mempool.c         |  1 -
 drivers/net/bnxt/bnxt_hwrm.c                     |  2 -
 drivers/net/cxgbe/cxgbe_ethdev.c                 |  1 -
 drivers/net/cxgbe/cxgbe_main.c                   |  1 -
 drivers/net/cxgbe/sge.c                          |  1 -
 drivers/net/dpaa2/dpaa2_ethdev.c                 |  1 -
 drivers/net/dpaa2/dpaa2_rxtx.c                   |  1 -
 drivers/net/i40e/i40e_ethdev_vf.c                |  1 -
 drivers/net/ixgbe/ixgbe_ethdev.c                 |  1 -
 drivers/net/ixgbe/ixgbe_flow.c                   |  1 -
 drivers/net/virtio/virtio_user/virtio_user_dev.c |  1 -
 drivers/net/virtio/virtio_user_ethdev.c          |  1 -
 drivers/net/vmxnet3/vmxnet3_ethdev.c             |  1 -
 lib/librte_cmdline/cmdline_parse_etheraddr.c     |  1 -
 lib/librte_distributor/rte_distributor.c         |  1 -
 lib/librte_eal/bsdapp/eal/eal.c                  |  2 -
 lib/librte_eal/bsdapp/eal/eal_pci.c              |  2 -
 lib/librte_eal/bsdapp/eal/eal_thread.c           |  1 -
 lib/librte_eal/common/eal_common_dev.c           |  1 -
 lib/librte_eal/common/eal_common_tailqs.c        |  1 -
 lib/librte_eal/common/rte_keepalive.c            |  1 -
 lib/librte_eal/linuxapp/eal/eal.c                |  2 -
 lib/librte_eal/linuxapp/eal/eal_memory.c         |  2 -
 lib/librte_eal/linuxapp/eal/eal_thread.c         |  1 -
 lib/librte_eal/linuxapp/eal/eal_xen_memory.c     |  2 -
 lib/librte_hash/rte_cuckoo_hash.c                |  1 -
 lib/librte_lpm/rte_lpm.c                         |  1 -
 lib/librte_lpm/rte_lpm6.c                        |  1 -
 lib/librte_timer/rte_timer.c                     |  1 -
 test/test-pipeline/config.c                      |  1 -
 test/test-pipeline/init.c                        |  1 -
 test/test-pipeline/main.c                        |  1 -
 test/test-pipeline/runtime.c                     |  2 -
 test/test/test_alarm.c                           |  1 -
 test/test/test_atomic.c                          |  1 -
 test/test/test_eal_flags.c                       |  1 -
 test/test/test_malloc.c                          |  1 -
 test/test/test_mbuf.c                            |  1 -
 test/test/test_mp_secondary.c                    |  4 --
 test/test/test_per_lcore.c                       |  1 -
 test/test/test_ring.c                            |  1 -
 test/test/test_rwlock.c                          |  1 -
 test/test/test_spinlock.c                        |  1 -
 58 files changed, 64 insertions(+), 70 deletions(-)
 create mode 100755 devtools/dup_include.pl
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/19 devtools: add simple script to find duplicate includes

This is just a simple check script to find obvious duplications.

---
 devtools/dup_include.pl | 64 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)
 create mode 100755 devtools/dup_include.pl
devtools/dup_include.pl new file +64 -0
new file mode 100755
index 000000000000..2946b6cc2ff3
@@ -0,0 +1,64 @@
+#! /usr/bin/env perl
+
+# BSD LICENSE
+#
+# Copyright 2016 Stephen Hemminger <[email protected]>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+#   * Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+#   * Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in
+#     the documentation and/or other materials provided with the
+#     distribution.
+#   * Neither the name of 6WIND S.A. nor the names of its
+#     contributors may be used to endorse or promote products derived
+#     from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# Examine files looking for duplicate references to the
+# same include file.
+#
+# Usage: dup_include.pl foo.c bar.c
+#
+
+use strict;
+use warnings;
+
+die "no input files'n"
+    if ($#ARGV < 0);
+
+foreach my $filename (@ARGV) {
+    open my $f, '<', $filename
+	or die "$filename: $!\n";
+
+    my %included;
+    my $lineno = 0;
+    
+    while (<$f>) {
+	++$lineno;
+	next unless /^#include\s+<(.+)>$/;
+	
+	my $h = $1; 
+	warn "$filename:$lineno duplicate include $h\n"
+	    if $included{$h};
+
+	$included{$h} = 1;
+    }
+    
+    close $f;
+}
Signature · 1 line
2.11.0
#2 lore raw

Re: [PATCH 01/19] devtools: add simple script to find duplicate includes

Hi Stephen,

11/07/2017 20:55, Stephen Hemminger:

Quoted 7 lines

This is just a simple check script to find obvious duplications.

---
 devtools/dup_include.pl | 64 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)
 create mode 100755 devtools/dup_include.pl

Thank you for this script, but... it is written in Perl! I don't think it is a good idea to add yet another language to DPDK. We already have shell and python scripts.
And I am not sure a lot of (young) people are able to parse it ;)

I would like to propose this shell script:

dirs='app buildtools drivers examples lib test' pattern='^[[:space:]]*#include[[:space:]]*[<"](.*)[>"].*'

for file in $(git ls $dirs) ; do

    dups=$(sed -rn "s,$pattern,\1,p" $file | sort | uniq -d)
    [ -n "$dups" ] || continue
    echo "$file"
    echo "$dups" | sed 's,^,\t,'

done

#3 lore raw

Re: [PATCH 01/19] devtools: add simple script to find duplicate includes

Quoted 21 lines · On Tue, 11 Jul 2017 22:33:55 +0200 Thomas Monjalon <[email protected]> wrote:

Hi Stephen,

11/07/2017 20:55, Stephen Hemminger:

Quoted 7 lines

This is just a simple check script to find obvious duplications.

---
 devtools/dup_include.pl | 64 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)
 create mode 100755 devtools/dup_include.pl  

Thank you for this script, but... it is written in Perl! I don't think it is a good idea to add yet another language to DPDK. We already have shell and python scripts.
And I am not sure a lot of (young) people are able to parse it ;)

I would like to propose this shell script:

dirs='app buildtools drivers examples lib test' pattern='^[[:space:]]*#include[[:space:]]*[<"](.*)[>"].*'

Quoted 6 lines

for file in $(git ls $dirs) ; do

    dups=$(sed -rn "s,$pattern,\1,p" $file | sort | uniq -d)
    [ -n "$dups" ] || continue
    echo "$file"
    echo "$dups" | sed 's,^,\t,'

done

Sorry, it is quick and easy. After all it is optional, just like coccinelle and not part of the build. Plus checkpatch is in Perl.

#4 lore raw

Re: [PATCH 01/19] devtools: add simple script to find duplicate includes

12/07/2017 01:05, Stephen Hemminger:

Quoted 31 lines
Quoted 21 lines · On Tue, 11 Jul 2017 22:33:55 +0200 Thomas Monjalon <[email protected]> wrote:

Hi Stephen,

11/07/2017 20:55, Stephen Hemminger:

Quoted 7 lines

This is just a simple check script to find obvious duplications.

---
 devtools/dup_include.pl | 64 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)
 create mode 100755 devtools/dup_include.pl  

Thank you for this script, but... it is written in Perl! I don't think it is a good idea to add yet another language to DPDK. We already have shell and python scripts.
And I am not sure a lot of (young) people are able to parse it ;)

I would like to propose this shell script:

dirs='app buildtools drivers examples lib test' pattern='^[[:space:]]*#include[[:space:]]*[<"](.*)[>"].*'

Quoted 6 lines

for file in $(git ls $dirs) ; do

    dups=$(sed -rn "s,$pattern,\1,p" $file | sort | uniq -d)
    [ -n "$dups" ] || continue
    echo "$file"
    echo "$dups" | sed 's,^,\t,'

done

Quoted 2 lines

Sorry, it is quick and easy. After all it is optional, just like coccinelle and not part of the build. Plus checkpatch is in Perl.

checkpatch is not in the repository ;)

I prefer my shell script because
- I am able to maintain it
- the regexp is more tolerant with #include line
- it checks the whole repository

#5 lore raw

Re: [PATCH 01/19] devtools: add simple script to find duplicate includes

In reply to Thomas Monjalon
Quoted 10 lines · On Tue, 11 Jul 2017 22:33:55 +0200 Thomas Monjalon <[email protected]> wrote:

Thank you for this script, but... it is written in Perl! I don't think it is a good idea to add yet another language to DPDK. We already have shell and python scripts.
And I am not sure a lot of (young) people are able to parse it ;)

I would like to propose this shell script:

dirs='app buildtools drivers examples lib test' pattern='^[[:space:]]*#include[[:space:]]*[<"](.*)[>"].*'

Quoted 6 lines

for file in $(git ls $dirs) ; do

    dups=$(sed -rn "s,$pattern,\1,p" $file | sort | uniq -d)
    [ -n "$dups" ] || continue
    echo "$file"
    echo "$dups" | sed 's,^,\t,'

done

There is no "git ls" command in current version,

Using find instead works.

plus shell is 7x slower.

$ time bash -c "find . -name '*.c' | xargs /tmp/dupinc.sh"
real	0m0.765s
user	0m1.220s
sys	0m0.155s
$time bash -c "find . -name '*.c' | xargs ~/bin/dup_inc.pl"
real	0m0.131s
user	0m0.118s
sys	0m0.014s

How about some python code.

#6 lore raw

Re: [PATCH 01/19] devtools: add simple script to find duplicate includes

12/07/2017 23:59, Stephen Hemminger:

Quoted 20 lines
Quoted 10 lines · On Tue, 11 Jul 2017 22:33:55 +0200 Thomas Monjalon <[email protected]> wrote:

Thank you for this script, but... it is written in Perl! I don't think it is a good idea to add yet another language to DPDK. We already have shell and python scripts.
And I am not sure a lot of (young) people are able to parse it ;)

I would like to propose this shell script:

dirs='app buildtools drivers examples lib test' pattern='^[[:space:]]*#include[[:space:]]*[<"](.*)[>"].*'

Quoted 6 lines

for file in $(git ls $dirs) ; do

    dups=$(sed -rn "s,$pattern,\1,p" $file | sort | uniq -d)
    [ -n "$dups" ] || continue
    echo "$file"
    echo "$dups" | sed 's,^,\t,'

done

Quoted 3 lines

There is no "git ls" command in current version,

Using find instead works.

Yes, both work if specifying source code directories as above.

Quoted 10 lines

plus shell is 7x slower.

$ time bash -c "find . -name '*.c' | xargs /tmp/dupinc.sh"
real	0m0.765s
user	0m1.220s
sys	0m0.155s
$time bash -c "find . -name '*.c' | xargs ~/bin/dup_inc.pl"
real	0m0.131s
user	0m0.118s
sys	0m0.014s

I don't think speed is really relevant here :)

Quoted 1 line

How about some python code.

I don't really care between shell or python.
I thought a shell script would be really concise
and without Python 2/3 compat issues.

#7 lore raw

Re: [PATCH 01/19] devtools: add simple script to find duplicate includes

Quoted 24 lines · Thomas Monjalon

12/07/2017 23:59, Stephen Hemminger:

Quoted 20 lines
Quoted 16 lines · On Tue, 11 Jul 2017 22:33:55 +0200 Thomas Monjalon <[email protected]> wrote:

Thank you for this script, but... it is written in Perl! I don't think it is a good idea to add yet another language to DPDK. We already have shell and python scripts.
And I am not sure a lot of (young) people are able to parse it ;)

I would like to propose this shell script:

dirs='app buildtools drivers examples lib test' pattern='^[[:space:]]*#include[[:space:]]*[<"](.*)[>"].*'

for file in $(git ls $dirs) ; do
dups=$(sed -rn "s,$pattern,\1,p" $file | sort | uniq -d) [ -n "$dups" ] || continue
echo "$file"
echo "$dups" | sed 's,^,\t,'
done

Quoted 5 lines
Quoted 3 lines

There is no "git ls" command in current version,

Using find instead works.

Yes, both work if specifying source code directories as above.

‘git ls’ I had to change it to ‘git ls-files’ to make it work. I think you have a git alias setup for ls-files.

Can this be added to the patch testing?

Quoted 12 lines
Quoted 11 lines

plus shell is 7x slower.

$ time bash -c "find . -name '*.c' | xargs /tmp/dupinc.sh"
real	0m0.765s
user	0m1.220s
sys	0m0.155s
$time bash -c "find . -name '*.c' | xargs ~/bin/dup_inc.pl"
real	0m0.131s
user	0m0.118s
sys	0m0.014s
Quoted 7 lines

I don't think speed is really relevant here :)

Quoted 1 line

How about some python code.

I don't really care between shell or python.
I thought a shell script would be really concise
and without Python 2/3 compat issues.

Regards,
Keith

#8 lore raw

Re: [PATCH 01/19] devtools: add simple script to find duplicate includes

13/07/2017 14:19, Wiles, Keith:

Quoted 24 lines
Quoted 24 lines · Thomas Monjalon

12/07/2017 23:59, Stephen Hemminger:

Quoted 20 lines
Quoted 16 lines · On Tue, 11 Jul 2017 22:33:55 +0200 Thomas Monjalon <[email protected]> wrote:

Thank you for this script, but... it is written in Perl! I don't think it is a good idea to add yet another language to DPDK. We already have shell and python scripts.
And I am not sure a lot of (young) people are able to parse it ;)

I would like to propose this shell script:

dirs='app buildtools drivers examples lib test' pattern='^[[:space:]]*#include[[:space:]]*[<"](.*)[>"].*'

for file in $(git ls $dirs) ; do
dups=$(sed -rn "s,$pattern,\1,p" $file | sort | uniq -d) [ -n "$dups" ] || continue
echo "$file"
echo "$dups" | sed 's,^,\t,'
done

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

There is no "git ls" command in current version,

Using find instead works.

Yes, both work if specifying source code directories as above.

‘git ls’ I had to change it to ‘git ls-files’ to make it work. I think you have a git alias setup for ls-files.

Ah yes, you're right!
Thanks, I has not well understood the original comment :)

Quoted 1 line

Can this be added to the patch testing?

Yes sure, I will do.

#9 lore raw

Re: [PATCH 01/19] devtools: add simple script to find duplicate includes

In reply to Thomas Monjalon

13/07/2017 08:56, Thomas Monjalon:

Quoted 10 lines

12/07/2017 23:59, Stephen Hemminger:

Quoted 9 lines
Quoted 6 lines · On Tue, 11 Jul 2017 22:33:55 +0200 Thomas Monjalon <[email protected]> wrote:

Thank you for this script, but... it is written in Perl! I don't think it is a good idea to add yet another language to DPDK. We already have shell and python scripts.
And I am not sure a lot of (young) people are able to parse it ;)

I would like to propose this shell script:

[...]

Quoted 12 lines
Quoted 11 lines

plus shell is 7x slower.

$ time bash -c "find . -name '*.c' | xargs /tmp/dupinc.sh"
real	0m0.765s
user	0m1.220s
sys	0m0.155s
$time bash -c "find . -name '*.c' | xargs ~/bin/dup_inc.pl"
real	0m0.131s
user	0m0.118s
sys	0m0.014s
Quoted 1 line

I don't think speed is really relevant here :)

I did my own benchmark (recreation time):

# time sh -c 'for file in $(git ls-files app buildtools drivers examples lib test) ; do devtools/dup_include.pl $file ; done'
4,41s user 1,32s system 101% cpu 5,667 total
# time devtools/check-duplicate-includes.sh
5,48s user 1,00s system 153% cpu 4,222 total

The shell version is reported as faster on my computer!

It is faster when filtering only .c and .h files:

for file in $(git ls-files '*.[ch]') ; do

    dups=$(sed -rn "s,$pattern,\1,p" $file | sort | uniq -d)
    [ -z "$dups" ] || echo "$dups" | sed "s,^,$file: duplicated include: ,"

done

# time sh -c 'for file in $(git ls-files "*.[ch]") ; do devtools/dup_include.pl $file ; done'
3,65s user 1,05s system 100% cpu 4,668 total
# time devtools/check-duplicate-includes.sh
4,72s user 0,80s system 153% cpu 3,603 total

I prefer this version using only pipes, which is well parallelized:

for file in $(git ls-files '*.[ch]') ; do
sed -rn "s,$pattern,\1,p" $file | sort | uniq -d | sed "s,^,$file: duplicated include: ,"
done

7,40s user 1,49s system 231% cpu 3,847 total

#10 lore raw

Re: [PATCH 01/19] devtools: add simple script to find duplicate includes

14/07/2017 17:39, Thomas Monjalon:

Quoted 47 lines

13/07/2017 08:56, Thomas Monjalon:

Quoted 10 lines

12/07/2017 23:59, Stephen Hemminger:

Quoted 9 lines
Quoted 6 lines · On Tue, 11 Jul 2017 22:33:55 +0200 Thomas Monjalon <[email protected]> wrote:

Thank you for this script, but... it is written in Perl! I don't think it is a good idea to add yet another language to DPDK. We already have shell and python scripts.
And I am not sure a lot of (young) people are able to parse it ;)

I would like to propose this shell script:

[...]

Quoted 12 lines
Quoted 11 lines

plus shell is 7x slower.

$ time bash -c "find . -name '*.c' | xargs /tmp/dupinc.sh"
real	0m0.765s
user	0m1.220s
sys	0m0.155s
$time bash -c "find . -name '*.c' | xargs ~/bin/dup_inc.pl"
real	0m0.131s
user	0m0.118s
sys	0m0.014s
Quoted 1 line

I don't think speed is really relevant here :)

I did my own benchmark (recreation time):

# time sh -c 'for file in $(git ls-files app buildtools drivers examples lib test) ; do devtools/dup_include.pl $file ; done'
4,41s user 1,32s system 101% cpu 5,667 total
# time devtools/check-duplicate-includes.sh
5,48s user 1,00s system 153% cpu 4,222 total

The shell version is reported as faster on my computer!

It is faster when filtering only .c and .h files:

for file in $(git ls-files '*.[ch]') ; do

    dups=$(sed -rn "s,$pattern,\1,p" $file | sort | uniq -d)
    [ -z "$dups" ] || echo "$dups" | sed "s,^,$file: duplicated include: ,"

done

# time sh -c 'for file in $(git ls-files "*.[ch]") ; do devtools/dup_include.pl $file ; done'
3,65s user 1,05s system 100% cpu 4,668 total
# time devtools/check-duplicate-includes.sh
4,72s user 0,80s system 153% cpu 3,603 total
Quoted 8 lines

I prefer this version using only pipes, which is well parallelized:

for file in $(git ls-files '*.[ch]') ; do
sed -rn "s,$pattern,\1,p" $file | sort | uniq -d | sed "s,^,$file: duplicated include: ,"
done

7,40s user 1,49s system 231% cpu 3,847 total

And now, the big shell optimization:
export LC_ALL=C
Result is impressive:

	2,99s user 0,72s system 258% cpu 1,436 total

I'm sure you will agree to integrate my version now :)

#11 lore raw

Re: [PATCH 01/19] devtools: add simple script to find duplicate includes

Quoted 58 lines · Thomas Monjalon

14/07/2017 17:39, Thomas Monjalon:

Quoted 54 lines

13/07/2017 08:56, Thomas Monjalon:

Quoted 10 lines

12/07/2017 23:59, Stephen Hemminger:

Quoted 9 lines
Quoted 6 lines · On Tue, 11 Jul 2017 22:33:55 +0200 Thomas Monjalon <[email protected]> wrote:

Thank you for this script, but... it is written in Perl! I don't think it is a good idea to add yet another language to DPDK. We already have shell and python scripts.
And I am not sure a lot of (young) people are able to parse it ;)

I would like to propose this shell script:

[...]

Quoted 12 lines
Quoted 11 lines

plus shell is 7x slower.

$ time bash -c "find . -name '*.c' | xargs /tmp/dupinc.sh"
real	0m0.765s
user	0m1.220s
sys	0m0.155s
$time bash -c "find . -name '*.c' | xargs ~/bin/dup_inc.pl"
real	0m0.131s
user	0m0.118s
sys	0m0.014s
Quoted 1 line

I don't think speed is really relevant here :)

I did my own benchmark (recreation time):

# time sh -c 'for file in $(git ls-files app buildtools drivers examples lib test) ; do devtools/dup_include.pl $file ; done'
4,41s user 1,32s system 101% cpu 5,667 total
# time devtools/check-duplicate-includes.sh
5,48s user 1,00s system 153% cpu 4,222 total

The shell version is reported as faster on my computer!

It is faster when filtering only .c and .h files:

for file in $(git ls-files '*.[ch]') ; do
dups=$(sed -rn "s,$pattern,\1,p" $file | sort | uniq -d)
[ -z "$dups" ] || echo "$dups" | sed "s,^,$file: duplicated include: ,"
done

# time sh -c 'for file in $(git ls-files "*.[ch]") ; do devtools/dup_include.pl $file ; done'
3,65s user 1,05s system 100% cpu 4,668 total
# time devtools/check-duplicate-includes.sh
4,72s user 0,80s system 153% cpu 3,603 total

I prefer this version using only pipes, which is well parallelized:

for file in $(git ls-files '*.[ch]') ; do
sed -rn "s,$pattern,\1,p" $file | sort | uniq -d | sed "s,^,$file: duplicated include: ,"
done

Quoted 9 lines
Quoted 1 line

7,40s user 1,49s system 231% cpu 3,847 total

And now, the big shell optimization:
export LC_ALL=C
Result is impressive:

	2,99s user 0,72s system 258% cpu 1,436 total

I'm sure you will agree to integrate my version now :)

hands down winner, where is the patch? :-)

Quoted 1 line

Regards,
Keith

#12 lore raw

PATCH 1/1 devtools: add script to find duplicated includes

In reply to Stephen Hemminger

Based on Stephen's idea (originally implemented in a Perl script), this is a shell script to find duplicated includes in a file. It looks for all the .c and .h files of the git repository.

It is fast enough because automatically well parallelized.

---
 devtools/check-dup-includes.sh | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100755 devtools/check-dup-includes.sh
devtools/check-dup-includes.sh new file +35 -0
new file mode 100755
index 000000000..ba9871255
@@ -0,0 +1,35 @@
+#! /bin/sh -e
+
+# Copyright 2017 Mellanox Technologies, Ltd. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+#   * Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+#   * Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in
+#     the documentation and/or other materials provided with the
+#     distribution.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE  SOFTWARE.
+
+# Check C files in the git repository for duplicated includes.
+
+cd $(dirname $(readlink -m $0))/..
+
+# speed up by ignoring Unicode details
+export LC_ALL=C
+
+for file in $(git ls-files '*.[ch]') ; do
+	sed -rn 's,^[[:space:]]*#include[[:space:]]*[<"](.*)[>"].*,\1,p' $file |
+	sort | uniq -d |
+	sed "s,^,$file: duplicated include: ,"
+done
Signature · 1 line
2.13.2
#13 lore raw

Re: [PATCH] devtools: add script to find duplicated includes

Quoted 38 lines · Thomas Monjalon

Based on Stephen's idea (originally implemented in a Perl script), this is a shell script to find duplicated includes in a file. It looks for all the .c and .h files of the git repository.

It is fast enough because automatically well parallelized.

---
devtools/check-dup-includes.sh | 35 +++++++++++++++++++++++++++++++++++

1 file changed, 35 insertions(+)

create mode 100755 devtools/check-dup-includes.sh

devtools/check-dup-includes.sh new file +16 -0
new file mode 100755
index 000000000..ba9871255
@@ -0,0 +1,35 @@
+#! /bin/sh -e
+
+# Copyright 2017 Mellanox Technologies, Ltd. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+#   * Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+#   * Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in
+#     the documentation and/or other materials provided with the
+#     distribution.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,

devtools/check-dup-includes.sh line 26

Quoted 10 lines
devtools/check-dup-includes.sh new file +10 -0
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE  SOFTWARE.
+
+# Check C files in the git repository for duplicated includes.
+
+cd $(dirname $(readlink -m $0))/..

I tried the script it works, but I am concerned about the ‘cd’ above as it does all of the the repo. I would like to see it do just the directory and sub-directories if a path is given. If I am testing a specific PMD or library then I would not want to do all of the repo.

Quoted 12 lines
devtools/check-dup-includes.sh new file +9 -0
+
+# speed up by ignoring Unicode details
+export LC_ALL=C
+
+for file in $(git ls-files '*.[ch]') ; do
+	sed -rn 's,^[[:space:]]*#include[[:space:]]*[<"](.*)[>"].*,\1,p' $file |
+	sort | uniq -d |
+	sed "s,^,$file: duplicated include: ,"
+done
Signature · 1 line
2.13.2

Regards,
Keith

#14 lore raw

Re: [PATCH] devtools: add script to find duplicated includes

Quoted 45 lines · Keith
Quoted 43 lines · Thomas Monjalon

Based on Stephen's idea (originally implemented in a Perl script), this is a shell script to find duplicated includes in a file. It looks for all the .c and .h files of the git repository.

It is fast enough because automatically well parallelized.

---
devtools/check-dup-includes.sh | 35 +++++++++++++++++++++++++++++++++++

1 file changed, 35 insertions(+)

create mode 100755 devtools/check-dup-includes.sh

devtools/check-dup-includes.sh new file +20 -0
new file mode 100755
index 000000000..ba9871255
@@ -0,0 +1,35 @@
+#! /bin/sh -e
+
+# Copyright 2017 Mellanox Technologies, Ltd. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+#   * Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+#   * Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in
+#     the documentation and/or other materials provided with the
+#     distribution.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
Quoted 9 lines

devtools/check-dup-includes.sh line 26

Quoted 6 lines
devtools/check-dup-includes.sh new file +6 -0
+# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE  SOFTWARE.
+
+# Check C files in the git repository for duplicated includes.
+
+cd $(dirname $(readlink -m $0))/..

I tried the script it works, but I am concerned about the ‘cd’ above as it does all of the the repo. I would like to see it do just the directory and sub-directories if a path is given. If I am testing a specific PMD or library then I would not want to do all of the repo.

I was thinking about something like the following:

if [ "$1x" = "x" ]; then

    cd $(dirname $(readlink -m $0))/..

fi

Quoted 7 lines
Quoted 7 lines
devtools/check-dup-includes.sh new file +7 -0
+
+# speed up by ignoring Unicode details
+export LC_ALL=C
+
+for file in $(git ls-files '*.[ch]') ; do
+	sed -rn 's,^[[:space:]]*#include[[:space:]]*[<"](.*)[>"].*,\1,p' $file |
+	sort | uniq -d |
Quoted 9 lines
Quoted 5 lines
devtools/check-dup-includes.sh new file +2 -0
+	sed "s,^,$file: duplicated include: ,"
+done
Signature · 1 line
2.13.2

Regards,
Keith

Regards,
Keith

#15 lore raw

Re: [PATCH] devtools: add script to find duplicated includes

14/07/2017 20:43, Wiles, Keith:

Quoted 4 lines
Quoted 4 lines · Keith
Quoted 2 lines · Thomas Monjalon

+cd $(dirname $(readlink -m $0))/..

Quoted 8 lines
Quoted 2 lines

I tried the script it works, but I am concerned about the ‘cd’ above as it does all of the the repo. I would like to see it do just the directory and sub-directories if a path is given. If I am testing a specific PMD or library then I would not want to do all of the repo.

I was thinking about something like the following:

if [ "$1x" = "x" ]; then

    cd $(dirname $(readlink -m $0))/..

fi

Yes we can add a parameter to the script.
The parameter would be the path to check, and the default value is the whole repo.
So the script could be used also for another repo - like pktgen ;)

I'll send a v2

#16 lore raw

PATCH v2 1/1 devtools: add script to find duplicated includes

In reply to Thomas Monjalon

Based on Stephen's idea (originally implemented in a Perl script), this is a shell script to find duplicated includes in a file. It looks for all the .c and .h files of the git repository.

It is fast enough because automatically well parallelized.

---
v2: add optional parameter for directory as suggested by Keith

---
 devtools/check-dup-includes.sh | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100755 devtools/check-dup-includes.sh
devtools/check-dup-includes.sh new file +37 -0
new file mode 100755
index 000000000..10365e4a1
@@ -0,0 +1,37 @@
+#! /bin/sh -e
+
+# Copyright 2017 Mellanox Technologies, Ltd. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+#   * Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+#   * Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in
+#     the documentation and/or other materials provided with the
+#     distribution.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE  SOFTWARE.
+
+# Check C files in git repository for duplicated includes.
+# Usage: devtools/check-dup-includes.sh [directory]
+
+dir=${1:-$(dirname $(readlink -m $0))/..}
+cd $dir
+
+# speed up by ignoring Unicode details
+export LC_ALL=C
+
+for file in $(git ls-files '*.[ch]') ; do
+	sed -rn 's,^[[:space:]]*#include[[:space:]]*[<"](.*)[>"].*,\1,p' $file |
+	sort | uniq -d |
+	sed "s,^,$file: duplicated include: ,"
+done
Signature · 1 line
2.13.2
#17 lore raw

Re: [PATCH v2] devtools: add script to find duplicated includes

15/07/2017 12:00, Thomas Monjalon:

Quoted 4 lines

Based on Stephen's idea (originally implemented in a Perl script), this is a shell script to find duplicated includes in a file. It looks for all the .c and .h files of the git repository.

Quoted 8 lines

It is fast enough because automatically well parallelized.

---
v2: add optional parameter for directory as suggested by Keith
---

Applied

#18 lore raw

Re: [PATCH] devtools: add script to find duplicated includes

In reply to Thomas Monjalon
Quoted 4 lines · Thomas Monjalon

Based on Stephen's idea (originally implemented in a Perl script), this is a shell script to find duplicated includes in a file. It looks for all the .c and .h files of the git repository.

Quoted 9 lines

It is fast enough because automatically well parallelized.

---
 devtools/check-dup-includes.sh | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100755 devtools/check-dup-includes.sh

How many times has this been a problem? Find the same file included twice in any single file seems like a pretty rudimentary thing to catch by visual inspection during development. At the very least I recall coverity having a header file analyer which would indicate that a header file was unused, and I think that offered detection of duplicate includes.

Neil

#19 lore raw

Re: [PATCH] devtools: add script to find duplicated includes

17/07/2017 14:50, Neil Horman:

Quoted 7 lines · Thomas Monjalon
Quoted 6 lines

Based on Stephen's idea (originally implemented in a Perl script), this is a shell script to find duplicated includes in a file. It looks for all the .c and .h files of the git repository.

It is fast enough because automatically well parallelized.

Quoted 8 lines
Quoted 7 lines
---
 devtools/check-dup-includes.sh | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100755 devtools/check-dup-includes.sh

How many times has this been a problem?

It is not a problem, just a trivial clean-up.

Quoted 5 lines

Find the same file included twice in
any single file seems like a pretty rudimentary thing to catch by visual inspection during development. At the very least I recall coverity having a header file analyer which would indicate that a header file was unused, and I think that offered detection of duplicate includes.

Good for Coverity. This simple script is Open Source ;)

#20 lore raw

PATCH 2/19 eal: remove duplicate includes

In reply to Stephen Hemminger

Include files only need to be refrenced once per file.

---
 lib/librte_eal/bsdapp/eal/eal.c              | 2 --
 lib/librte_eal/bsdapp/eal/eal_pci.c          | 2 --
 lib/librte_eal/bsdapp/eal/eal_thread.c       | 1 -
 lib/librte_eal/common/eal_common_dev.c       | 1 -
 lib/librte_eal/common/eal_common_tailqs.c    | 1 -
 lib/librte_eal/common/rte_keepalive.c        | 1 -
 lib/librte_eal/linuxapp/eal/eal.c            | 2 --
 lib/librte_eal/linuxapp/eal/eal_memory.c     | 2 --
 lib/librte_eal/linuxapp/eal/eal_thread.c     | 1 -
 lib/librte_eal/linuxapp/eal/eal_xen_memory.c | 2 --
 10 files changed, 15 deletions(-)
lib/librte_eal/bsdapp/eal/eal.c +0 -2
index 05f0c1f90d62..83801d5ba940 100644
@@ -45,7 +45,6 @@
 #include <stddef.h>
 #include <errno.h>
 #include <limits.h>
-#include <errno.h>
 #include <sys/mman.h>
 #include <sys/queue.h>
 
@@ -69,7 +68,6 @@
 #include <rte_pci.h>
 #include <rte_dev.h>
 #include <rte_devargs.h>
-#include <rte_common.h>
 #include <rte_version.h>
 #include <rte_atomic.h>
 #include <malloc_heap.h>
lib/librte_eal/bsdapp/eal/eal_pci.c +0 -2
index e321461d82e6..dcb3b51ad035 100644
@@ -41,7 +41,6 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <stdarg.h>
 #include <errno.h>
 #include <dirent.h>
 #include <limits.h>
@@ -52,7 +51,6 @@
 #include <dev/pci/pcireg.h>
 
 #if defined(RTE_ARCH_X86)
-#include <sys/types.h>
 #include <machine/cpufunc.h>
 #endif
 
lib/librte_eal/bsdapp/eal/eal_thread.c +0 -1
index 1b8cd8a65794..783d68c5c622 100644
@@ -49,7 +49,6 @@
 #include <rte_memzone.h>
 #include <rte_per_lcore.h>
 #include <rte_eal.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 
 #include "eal_private.h"
lib/librte_eal/common/eal_common_dev.c +0 -1
index 32e12b5b9f3f..78b6fc058351 100644
@@ -41,7 +41,6 @@
 #include <rte_dev.h>
 #include <rte_devargs.h>
 #include <rte_debug.h>
-#include <rte_devargs.h>
 #include <rte_log.h>
 
 #include "eal_private.h"
lib/librte_eal/common/eal_common_tailqs.c +0 -1
index 4f6982883ce7..55955f9eb5c9 100644
@@ -46,7 +46,6 @@
 #include <rte_eal_memconfig.h>
 #include <rte_per_lcore.h>
 #include <rte_lcore.h>
-#include <rte_memory.h>
 #include <rte_atomic.h>
 #include <rte_branch_prediction.h>
 #include <rte_log.h>
lib/librte_eal/common/rte_keepalive.c +0 -1
index 9765d1bd91a1..cdd6956054d0 100644
@@ -38,7 +38,6 @@
 #include <rte_log.h>
 #include <rte_keepalive.h>
 #include <rte_malloc.h>
-#include <rte_cycles.h>
 
 struct rte_keepalive {
 	/** Core Liveness. */
lib/librte_eal/linuxapp/eal/eal.c +0 -2
index 7c78f2dc248e..d03d8e3fa19e 100644
@@ -46,7 +46,6 @@
 #include <stddef.h>
 #include <errno.h>
 #include <limits.h>
-#include <errno.h>
 #include <sys/mman.h>
 #include <sys/queue.h>
 #include <sys/stat.h>
@@ -74,7 +73,6 @@
 #include <rte_pci.h>
 #include <rte_dev.h>
 #include <rte_devargs.h>
-#include <rte_common.h>
 #include <rte_version.h>
 #include <rte_atomic.h>
 #include <malloc_heap.h>
lib/librte_eal/linuxapp/eal/eal_memory.c +0 -2
index 040f24a43ca0..daead31c27d2 100644
@@ -41,7 +41,6 @@
 #include <stdint.h>
 #include <inttypes.h>
 #include <string.h>
-#include <stdarg.h>
 #include <sys/mman.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -49,7 +48,6 @@
 #include <sys/file.h>
 #include <unistd.h>
 #include <limits.h>
-#include <errno.h>
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include <signal.h>
lib/librte_eal/linuxapp/eal/eal_thread.c +0 -1
index 9f88530ea131..fba1a0070e6f 100644
@@ -49,7 +49,6 @@
 #include <rte_memzone.h>
 #include <rte_per_lcore.h>
 #include <rte_eal.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 
 #include "eal_private.h"
lib/librte_eal/linuxapp/eal/eal_xen_memory.c +0 -2
index bddbdb072c19..19db1cb5fde5 100644
@@ -38,7 +38,6 @@
 #include <stdint.h>
 #include <inttypes.h>
 #include <string.h>
-#include <stdarg.h>
 #include <sys/mman.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -46,7 +45,6 @@
 #include <sys/file.h>
 #include <unistd.h>
 #include <limits.h>
-#include <errno.h>
 #include <sys/ioctl.h>
 #include <sys/time.h>
 
Signature · 1 line
2.11.0
#21 lore raw

PATCH 3/19 cmdline: remove duplicate include of errno.h

In reply to Stephen Hemminger
---
 lib/librte_cmdline/cmdline_parse_etheraddr.c | 1 -
 1 file changed, 1 deletion(-)
lib/librte_cmdline/cmdline_parse_etheraddr.c +0 -1
index dbfe4a613413..da02d2c9f8cb 100644
@@ -65,7 +65,6 @@
 #include <inttypes.h>
 #include <ctype.h>
 #include <string.h>
-#include <errno.h>
 #include <sys/types.h>
 #include <net/ethernet.h>
 
Signature · 1 line
2.11.0
#22 lore raw

PATCH 4/19 distributor: remove duplicate include of rte_compat.h

In reply to Stephen Hemminger
---
 lib/librte_distributor/rte_distributor.c | 1 -
 1 file changed, 1 deletion(-)
lib/librte_distributor/rte_distributor.c +0 -1
index c4e31b8c4245..20ba9ffbc84c 100644
@@ -41,7 +41,6 @@
 #include <rte_errno.h>
 #include <rte_string_fns.h>
 #include <rte_eal_memconfig.h>
-#include <rte_compat.h>
 #include <rte_pause.h>
 
 #include "rte_distributor_private.h"
Signature · 1 line
2.11.0
#23 lore raw

PATCH 5/19 lpm: remove duplicate include of errno.h

In reply to Stephen Hemminger
---
 lib/librte_lpm/rte_lpm.c  | 1 -
 lib/librte_lpm/rte_lpm6.c | 1 -
 2 files changed, 2 deletions(-)
lib/librte_lpm/rte_lpm.c +0 -1
index 978ac6013ecf..64c074e987e9 100644
@@ -36,7 +36,6 @@
 #include <errno.h>
 #include <stdarg.h>
 #include <stdio.h>
-#include <errno.h>
 #include <sys/queue.h>
 
 #include <rte_log.h>
lib/librte_lpm/rte_lpm6.c +0 -1
index 9cc7be77dd78..b4a7df348806 100644
@@ -35,7 +35,6 @@
 #include <errno.h>
 #include <stdarg.h>
 #include <stdio.h>
-#include <errno.h>
 #include <sys/queue.h>
 
 #include <rte_log.h>
Signature · 1 line
2.11.0
#24 lore raw

PATCH 6/19 cuckoo_hash: remove duplicate include of rte_log.h

In reply to Stephen Hemminger
---
 lib/librte_hash/rte_cuckoo_hash.c | 1 -
 1 file changed, 1 deletion(-)
lib/librte_hash/rte_cuckoo_hash.c +0 -1
index 5b2b8ddeb098..87b25c016a71 100644
@@ -52,7 +52,6 @@
 #include <rte_errno.h>
 #include <rte_string_fns.h>
 #include <rte_cpuflags.h>
-#include <rte_log.h>
 #include <rte_rwlock.h>
 #include <rte_spinlock.h>
 #include <rte_ring.h>
Signature · 1 line
2.11.0
#25 lore raw

PATCH 7/19 timer: remove duplicate include of rte_per_lcore.h

In reply to Stephen Hemminger
---
 lib/librte_timer/rte_timer.c | 1 -
 1 file changed, 1 deletion(-)
lib/librte_timer/rte_timer.c +0 -1
index dda9baf5506d..5ee084080060 100644
@@ -46,7 +46,6 @@
 #include <rte_memzone.h>
 #include <rte_launch.h>
 #include <rte_eal.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_branch_prediction.h>
 #include <rte_spinlock.h>
Signature · 1 line
2.11.0
#26 lore raw

PATCH 8/19 bnxt: remove duplicate include of unistd.h

In reply to Stephen Hemminger
---
 drivers/net/bnxt/bnxt_hwrm.c | 2 --
 1 file changed, 2 deletions(-)
drivers/net/bnxt/bnxt_hwrm.c +0 -2
index da078f9edfa8..3583ec732ded 100644
@@ -33,8 +33,6 @@
 
 #include <unistd.h>
 
-#include <unistd.h>
-
 #include <rte_byteorder.h>
 #include <rte_common.h>
 #include <rte_cycles.h>
Signature · 1 line
2.11.0
#27 lore raw

PATCH 9/19 ixgbe: remove duplicate include of rte_atomic.h

In reply to Stephen Hemminger
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 1 -
 drivers/net/ixgbe/ixgbe_flow.c   | 1 -
 2 files changed, 2 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +0 -1
index a0ae089c5118..6bc9146d8f4d 100644
@@ -57,7 +57,6 @@
 #include <rte_ether.h>
 #include <rte_ethdev.h>
 #include <rte_ethdev_pci.h>
-#include <rte_atomic.h>
 #include <rte_malloc.h>
 #include <rte_random.h>
 #include <rte_dev.h>
drivers/net/ixgbe/ixgbe_flow.c +0 -1
index 6885abd3517d..f70bdb0c9f4d 100644
@@ -56,7 +56,6 @@
 #include <rte_alarm.h>
 #include <rte_ether.h>
 #include <rte_ethdev.h>
-#include <rte_atomic.h>
 #include <rte_malloc.h>
 #include <rte_random.h>
 #include <rte_dev.h>
Signature · 1 line
2.11.0
#28 lore raw

PATCH 10/19 i40e: remove duplicate include of rte_atomic.h

In reply to Stephen Hemminger
---
 drivers/net/i40e/i40e_ethdev_vf.c | 1 -
 1 file changed, 1 deletion(-)
drivers/net/i40e/i40e_ethdev_vf.c +0 -1
index bab09f814215..dc6c79449d14 100644
@@ -56,7 +56,6 @@
 #include <rte_ether.h>
 #include <rte_ethdev.h>
 #include <rte_ethdev_pci.h>
-#include <rte_atomic.h>
 #include <rte_malloc.h>
 #include <rte_dev.h>
 
Signature · 1 line
2.11.0
#29 lore raw

PATCH 11/19 virtio: remove duplicated includes

In reply to Stephen Hemminger
---
 drivers/net/virtio/virtio_user/virtio_user_dev.c | 1 -
 drivers/net/virtio/virtio_user_ethdev.c          | 1 -
 2 files changed, 2 deletions(-)
drivers/net/virtio/virtio_user/virtio_user_dev.c +0 -1
index 450404ba6975..79412714a30c 100644
@@ -41,7 +41,6 @@
 #include <sys/eventfd.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <unistd.h>
 
 #include "vhost.h"
 #include "virtio_user_dev.h"
drivers/net/virtio/virtio_user_ethdev.c +0 -1
index b56a6d4657f8..c96144434adf 100644
@@ -35,7 +35,6 @@
 #include <sys/types.h>
 #include <unistd.h>
 #include <fcntl.h>
-#include <sys/types.h>
 #include <sys/socket.h>
 
 #include <rte_malloc.h>
Signature · 1 line
2.11.0
#30 lore raw

PATCH 12/19 cxgbe: remove duplicated includes

In reply to Stephen Hemminger
---
 drivers/net/cxgbe/cxgbe_ethdev.c | 1 -
 drivers/net/cxgbe/cxgbe_main.c   | 1 -
 drivers/net/cxgbe/sge.c          | 1 -
 3 files changed, 3 deletions(-)
drivers/net/cxgbe/cxgbe_ethdev.c +0 -1
index 981dd478e5a8..7bca45614b02 100644
@@ -58,7 +58,6 @@
 #include <rte_ether.h>
 #include <rte_ethdev.h>
 #include <rte_ethdev_pci.h>
-#include <rte_atomic.h>
 #include <rte_malloc.h>
 #include <rte_random.h>
 #include <rte_dev.h>
drivers/net/cxgbe/cxgbe_main.c +0 -1
index 0edac2b189b2..b709fe2b8210 100644
@@ -58,7 +58,6 @@
 #include <rte_ether.h>
 #include <rte_ethdev.h>
 #include <rte_ethdev_pci.h>
-#include <rte_atomic.h>
 #include <rte_malloc.h>
 #include <rte_random.h>
 #include <rte_dev.h>
drivers/net/cxgbe/sge.c +0 -1
index e281020017dd..5376fc50078c 100644
@@ -57,7 +57,6 @@
 #include <rte_alarm.h>
 #include <rte_ether.h>
 #include <rte_ethdev.h>
-#include <rte_atomic.h>
 #include <rte_malloc.h>
 #include <rte_random.h>
 #include <rte_dev.h>
Signature · 1 line
2.11.0
#31 lore raw

PATCH 13/19 vmxnet3: remove duplicated include of rte_atomic.h

In reply to Stephen Hemminger
---
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 1 -
 1 file changed, 1 deletion(-)
drivers/net/vmxnet3/vmxnet3_ethdev.c +0 -1
index 72ec67c01cdd..ab5a824c8b91 100644
@@ -57,7 +57,6 @@
 #include <rte_ether.h>
 #include <rte_ethdev.h>
 #include <rte_ethdev_pci.h>
-#include <rte_atomic.h>
 #include <rte_string_fns.h>
 #include <rte_malloc.h>
 #include <rte_dev.h>
Signature · 1 line
2.11.0
#32 lore raw

PATCH 14/19 dpaa2: remove duplicated includes

In reply to Stephen Hemminger
---
 drivers/event/dpaa2/dpaa2_eventdev.c     | 1 -
 drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 1 -
 drivers/net/dpaa2/dpaa2_ethdev.c         | 1 -
 drivers/net/dpaa2/dpaa2_rxtx.c           | 1 -
 4 files changed, 4 deletions(-)
drivers/event/dpaa2/dpaa2_eventdev.c +0 -1
index 412cee11a95b..5c272705e064 100644
@@ -36,7 +36,6 @@
 #include <errno.h>
 #include <stdint.h>
 #include <string.h>
-#include <stdint.h>
 #include <sys/epoll.h>
 
 #include <rte_atomic.h>
drivers/mempool/dpaa2/dpaa2_hw_mempool.c +0 -1
index d578c2f8444a..4253e897eb9a 100644
@@ -47,7 +47,6 @@
 #include <rte_cycles.h>
 #include <rte_kvargs.h>
 #include <rte_dev.h>
-#include <rte_ethdev.h>
 
 #include <fslmc_logs.h>
 #include <mc/fsl_dpbp.h>
drivers/net/dpaa2/dpaa2_ethdev.c +0 -1
index c19f7261d2b0..26c2a079709d 100644
@@ -42,7 +42,6 @@
 #include <rte_cycles.h>
 #include <rte_kvargs.h>
 #include <rte_dev.h>
-#include <rte_ethdev.h>
 #include <rte_fslmc.h>
 
 #include <fslmc_logs.h>
drivers/net/dpaa2/dpaa2_rxtx.c +0 -1
index 9e7de441b1ac..3db91d8b1522 100644
@@ -40,7 +40,6 @@
 #include <rte_memcpy.h>
 #include <rte_string_fns.h>
 #include <rte_dev.h>
-#include <rte_ethdev.h>
 
 #include <fslmc_logs.h>
 #include <fslmc_vfio.h>
Signature · 1 line
2.11.0
Acked-by on v1 14/19
#33 lore raw

Re: [PATCH 14/19] dpaa2: remove duplicated includes

Quoted 50 lines · Stephen Hemminger
---
 drivers/event/dpaa2/dpaa2_eventdev.c     | 1 -
 drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 1 -
 drivers/net/dpaa2/dpaa2_ethdev.c         | 1 -
 drivers/net/dpaa2/dpaa2_rxtx.c           | 1 -
 4 files changed, 4 deletions(-)
drivers/event/dpaa2/dpaa2_eventdev.c +0 -1
index 412cee11a95b..5c272705e064 100644
@@ -36,7 +36,6 @@
 #include <errno.h>
 #include <stdint.h>
 #include <string.h>
-#include <stdint.h>
 #include <sys/epoll.h>
 
 #include <rte_atomic.h>
drivers/mempool/dpaa2/dpaa2_hw_mempool.c +0 -1
index d578c2f8444a..4253e897eb9a 100644
@@ -47,7 +47,6 @@
 #include <rte_cycles.h>
 #include <rte_kvargs.h>
 #include <rte_dev.h>
-#include <rte_ethdev.h>
 
 #include <fslmc_logs.h>
 #include <mc/fsl_dpbp.h>
drivers/net/dpaa2/dpaa2_ethdev.c +0 -1
index c19f7261d2b0..26c2a079709d 100644
@@ -42,7 +42,6 @@
 #include <rte_cycles.h>
 #include <rte_kvargs.h>
 #include <rte_dev.h>
-#include <rte_ethdev.h>
 #include <rte_fslmc.h>
 
 #include <fslmc_logs.h>
drivers/net/dpaa2/dpaa2_rxtx.c +0 -0
index 9e7de441b1ac..3db91d8b1522 100644

drivers/net/dpaa2/dpaa2_rxtx.c line 45

Quoted 7 lines
drivers/net/dpaa2/dpaa2_rxtx.c +0 -1
@@ -40,7 +40,6 @@
 #include <rte_memcpy.h>
 #include <rte_string_fns.h>
 #include <rte_dev.h>
-#include <rte_ethdev.h>
 
 #include <fslmc_logs.h>
 #include <fslmc_vfio.h>
#34 lore raw

PATCH 15/19 fsmlc: remove duplicated includes

In reply to Stephen Hemminger
---
 drivers/bus/fslmc/fslmc_vfio.c           | 2 --
 drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 1 -
 2 files changed, 3 deletions(-)
drivers/bus/fslmc/fslmc_vfio.c +0 -2
index 725faabab312..e10443c5bc05 100644
@@ -40,7 +40,6 @@
 #include <errno.h>
 #include <sys/ioctl.h>
 #include <sys/stat.h>
-#include <sys/types.h>
 #include <sys/mman.h>
 #include <sys/vfs.h>
 #include <libgen.h>
@@ -55,7 +54,6 @@
 #include <rte_cycles.h>
 #include <rte_kvargs.h>
 #include <rte_dev.h>
-#include <rte_ethdev.h>
 #include <rte_bus.h>
 
 #include "rte_fslmc.h"
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +0 -1
index 88dd2e901916..c195f9f23b01 100644
@@ -57,7 +57,6 @@
 #include <rte_cycles.h>
 #include <rte_kvargs.h>
 #include <rte_dev.h>
-#include <rte_ethdev.h>
 
 #include <fslmc_logs.h>
 #include <fslmc_vfio.h>
Signature · 1 line
2.11.0
Acked-by on v1 15/19
#35 lore raw

Re: [PATCH 15/19] fsmlc: remove duplicated includes

Quoted 32 lines · Stephen Hemminger
---
 drivers/bus/fslmc/fslmc_vfio.c           | 2 --
 drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 1 -
 2 files changed, 3 deletions(-)
drivers/bus/fslmc/fslmc_vfio.c +0 -2
index 725faabab312..e10443c5bc05 100644
@@ -40,7 +40,6 @@
 #include <errno.h>
 #include <sys/ioctl.h>
 #include <sys/stat.h>
-#include <sys/types.h>
 #include <sys/mman.h>
 #include <sys/vfs.h>
 #include <libgen.h>
@@ -55,7 +54,6 @@
 #include <rte_cycles.h>
 #include <rte_kvargs.h>
 #include <rte_dev.h>
-#include <rte_ethdev.h>
 #include <rte_bus.h>
 
 #include "rte_fslmc.h"
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +0 -0
index 88dd2e901916..c195f9f23b01 100644

drivers/bus/fslmc/portal/dpaa2_hw_dpio.c line 62

Quoted 7 lines
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +0 -1
@@ -57,7 +57,6 @@
 #include <rte_cycles.h>
 #include <rte_kvargs.h>
 #include <rte_dev.h>
-#include <rte_ethdev.h>
 
 #include <fslmc_logs.h>
 #include <fslmc_vfio.h>

minor typo in patch header %s/fsmlc/fslmc/g

#36 lore raw

PATCH 16/19 app/proc-info: remove duplicate include

In reply to Stephen Hemminger
---
 app/proc_info/main.c | 1 -
 1 file changed, 1 deletion(-)
app/proc_info/main.c +0 -1
index d4f6a8236e3f..8b753a2ee01b 100644
@@ -53,7 +53,6 @@
 #include <rte_tailq.h>
 #include <rte_per_lcore.h>
 #include <rte_lcore.h>
-#include <rte_debug.h>
 #include <rte_log.h>
 #include <rte_atomic.h>
 #include <rte_branch_prediction.h>
Signature · 1 line
2.11.0
#37 lore raw

PATCH 17/19 app/test-pmd: remove duplicate includes

In reply to Stephen Hemminger
---
 app/test-pmd/cmdline.c    | 1 -
 app/test-pmd/config.c     | 1 -
 app/test-pmd/csumonly.c   | 2 --
 app/test-pmd/flowgen.c    | 1 -
 app/test-pmd/iofwd.c      | 1 -
 app/test-pmd/macfwd.c     | 1 -
 app/test-pmd/macswap.c    | 1 -
 app/test-pmd/parameters.c | 1 -
 app/test-pmd/rxonly.c     | 1 -
 app/test-pmd/txonly.c     | 2 --
 10 files changed, 12 deletions(-)
app/test-pmd/cmdline.c +0 -1
index d4ff6089ad01..7decb96c8f1c 100644
@@ -36,7 +36,6 @@
 #include <errno.h>
 #include <stdio.h>
 #include <stdint.h>
-#include <stdarg.h>
 #include <string.h>
 #include <termios.h>
 #include <unistd.h>
app/test-pmd/config.c +0 -1
index e0f08257f97d..ee6644d106ed 100644
@@ -36,7 +36,6 @@
 #include <errno.h>
 #include <stdio.h>
 #include <string.h>
-#include <stdarg.h>
 #include <stdint.h>
 #include <inttypes.h>
 
app/test-pmd/csumonly.c +0 -2
index 178ad7581b8a..90c811983cf7 100644
@@ -56,10 +56,8 @@
 #include <rte_lcore.h>
 #include <rte_atomic.h>
 #include <rte_branch_prediction.h>
-#include <rte_memory.h>
 #include <rte_mempool.h>
 #include <rte_mbuf.h>
-#include <rte_memcpy.h>
 #include <rte_interrupts.h>
 #include <rte_pci.h>
 #include <rte_ether.h>
app/test-pmd/flowgen.c +0 -1
index 13b4f900fb59..54e56f60ee79 100644
@@ -57,7 +57,6 @@
 #include <rte_lcore.h>
 #include <rte_atomic.h>
 #include <rte_branch_prediction.h>
-#include <rte_memory.h>
 #include <rte_mempool.h>
 #include <rte_mbuf.h>
 #include <rte_interrupts.h>
app/test-pmd/iofwd.c +0 -1
index 15cb4a209fd2..9b54f6549b39 100644
@@ -55,7 +55,6 @@
 #include <rte_lcore.h>
 #include <rte_atomic.h>
 #include <rte_branch_prediction.h>
-#include <rte_memory.h>
 #include <rte_memcpy.h>
 #include <rte_mempool.h>
 #include <rte_mbuf.h>
app/test-pmd/macfwd.c +0 -1
index cf7eab12eafb..06dbc73a3623 100644
@@ -56,7 +56,6 @@
 #include <rte_lcore.h>
 #include <rte_atomic.h>
 #include <rte_branch_prediction.h>
-#include <rte_memory.h>
 #include <rte_mempool.h>
 #include <rte_mbuf.h>
 #include <rte_interrupts.h>
app/test-pmd/macswap.c +0 -1
index 3a09351245ca..19cda0eac474 100644
@@ -56,7 +56,6 @@
 #include <rte_lcore.h>
 #include <rte_atomic.h>
 #include <rte_branch_prediction.h>
-#include <rte_memory.h>
 #include <rte_mempool.h>
 #include <rte_mbuf.h>
 #include <rte_interrupts.h>
app/test-pmd/parameters.c +0 -1
index 958b3d048509..e8e58ceaf519 100644
@@ -41,7 +41,6 @@
 #include <time.h>
 #include <fcntl.h>
 #include <sys/types.h>
-#include <errno.h>
 
 #include <sys/queue.h>
 #include <sys/stat.h>
app/test-pmd/rxonly.c +0 -1
index dcd1d85c992f..5ef021905ce2 100644
@@ -56,7 +56,6 @@
 #include <rte_lcore.h>
 #include <rte_atomic.h>
 #include <rte_branch_prediction.h>
-#include <rte_memory.h>
 #include <rte_mempool.h>
 #include <rte_mbuf.h>
 #include <rte_interrupts.h>
app/test-pmd/txonly.c +0 -2
index 8b1a2afcd9d5..7070ddc3b085 100644
@@ -56,10 +56,8 @@
 #include <rte_lcore.h>
 #include <rte_atomic.h>
 #include <rte_branch_prediction.h>
-#include <rte_memory.h>
 #include <rte_mempool.h>
 #include <rte_mbuf.h>
-#include <rte_memcpy.h>
 #include <rte_interrupts.h>
 #include <rte_pci.h>
 #include <rte_ether.h>
Signature · 1 line
2.11.0
#38 lore raw

PATCH 18/19 test/test-pipeline: remove duplicate include of rte_per_lcore.h

In reply to Stephen Hemminger
---
 test/test-pipeline/config.c  | 1 -
 test/test-pipeline/init.c    | 1 -
 test/test-pipeline/main.c    | 1 -
 test/test-pipeline/runtime.c | 2 --
 4 files changed, 5 deletions(-)
test/test-pipeline/config.c +0 -1
index 1b397c039132..eebb8102406d 100644
@@ -55,7 +55,6 @@
 #include <rte_cycles.h>
 #include <rte_prefetch.h>
 #include <rte_lcore.h>
-#include <rte_per_lcore.h>
 #include <rte_branch_prediction.h>
 #include <rte_interrupts.h>
 #include <rte_pci.h>
test/test-pipeline/init.c +0 -1
index 00dbc2795656..1457c7890b10 100644
@@ -55,7 +55,6 @@
 #include <rte_cycles.h>
 #include <rte_prefetch.h>
 #include <rte_lcore.h>
-#include <rte_per_lcore.h>
 #include <rte_branch_prediction.h>
 #include <rte_interrupts.h>
 #include <rte_pci.h>
test/test-pipeline/main.c +0 -1
index 71ab6ad98580..795b1aeb6ae9 100644
@@ -56,7 +56,6 @@
 #include <rte_cycles.h>
 #include <rte_prefetch.h>
 #include <rte_lcore.h>
-#include <rte_per_lcore.h>
 #include <rte_branch_prediction.h>
 #include <rte_interrupts.h>
 #include <rte_pci.h>
test/test-pipeline/runtime.c +0 -2
index 8970e1c30a15..cb02fff0f84b 100644
@@ -54,8 +54,6 @@
 #include <rte_atomic.h>
 #include <rte_cycles.h>
 #include <rte_prefetch.h>
-#include <rte_lcore.h>
-#include <rte_per_lcore.h>
 #include <rte_branch_prediction.h>
 #include <rte_interrupts.h>
 #include <rte_pci.h>
Signature · 1 line
2.11.0
#39 lore raw

PATCH 19/19 test/test: remove duplicate includes

In reply to Stephen Hemminger
---
 test/test/test_alarm.c        | 1 -
 test/test/test_atomic.c       | 1 -
 test/test/test_eal_flags.c    | 1 -
 test/test/test_malloc.c       | 1 -
 test/test/test_mbuf.c         | 1 -
 test/test/test_mp_secondary.c | 4 ----
 test/test/test_per_lcore.c    | 1 -
 test/test/test_ring.c         | 1 -
 test/test/test_rwlock.c       | 1 -
 test/test/test_spinlock.c     | 1 -
 10 files changed, 13 deletions(-)
test/test/test_alarm.c +0 -1
index ecb2f6d45770..7da0efa395d9 100644
@@ -37,7 +37,6 @@
 #include <rte_common.h>
 #include <rte_cycles.h>
 #include <rte_interrupts.h>
-#include <rte_common.h>
 #include <rte_atomic.h>
 #include <rte_alarm.h>
 
test/test/test_atomic.c +0 -1
index b5e7e1b78f53..c68723ae0d87 100644
@@ -42,7 +42,6 @@
 #include <rte_launch.h>
 #include <rte_atomic.h>
 #include <rte_eal.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 
 #include "test.h"
test/test/test_eal_flags.c +0 -1
index 4afb36432cb3..594d79d7e870 100644
@@ -38,7 +38,6 @@
 #include <string.h>
 #include <stdarg.h>
 #include <libgen.h>
-#include <stdio.h>
 #include <stdlib.h>
 #include <errno.h>
 #include <unistd.h>
test/test/test_malloc.c +0 -1
index fcd8b8639086..013fd4407954 100644
@@ -45,7 +45,6 @@
 #include <rte_per_lcore.h>
 #include <rte_launch.h>
 #include <rte_eal.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_malloc.h>
 #include <rte_cycles.h>
test/test/test_mbuf.c +0 -1
index 2057a518205a..3396b4a93211 100644
@@ -43,7 +43,6 @@
 #include <rte_common.h>
 #include <rte_debug.h>
 #include <rte_log.h>
-#include <rte_common.h>
 #include <rte_memory.h>
 #include <rte_memcpy.h>
 #include <rte_memzone.h>
test/test/test_mp_secondary.c +0 -4
index 94042e57c0b4..0b93a2de1556 100644
@@ -41,11 +41,7 @@
 #include <inttypes.h>
 #include <sys/queue.h>
 #include <errno.h>
-#include <stdarg.h>
-#include <inttypes.h>
 #include <string.h>
-#include <stdlib.h>
-#include <stdarg.h>
 #include <unistd.h>
 #include <sys/wait.h>
 #include <libgen.h>
test/test/test_per_lcore.c +0 -1
index 747513d47ba0..247e171439c8 100644
@@ -41,7 +41,6 @@
 #include <rte_per_lcore.h>
 #include <rte_launch.h>
 #include <rte_eal.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_cycles.h>
 
test/test/test_ring.c +0 -1
index d68654eb802a..d664b04b714a 100644
@@ -54,7 +54,6 @@
 #include <rte_malloc.h>
 #include <rte_ring.h>
 #include <rte_random.h>
-#include <rte_common.h>
 #include <rte_errno.h>
 #include <rte_hexdump.h>
 
test/test/test_rwlock.c +0 -1
index 50f58adec284..3dd2ed4c4dd6 100644
@@ -44,7 +44,6 @@
 #include <rte_atomic.h>
 #include <rte_rwlock.h>
 #include <rte_eal.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_cycles.h>
 
test/test/test_spinlock.c +0 -1
index b86cd887c74b..a93f1baa8add 100644
@@ -44,7 +44,6 @@
 #include <rte_per_lcore.h>
 #include <rte_launch.h>
 #include <rte_eal.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_cycles.h>
 #include <rte_spinlock.h>
Signature · 1 line
2.11.0
#40 lore raw
In reply to Stephen Hemminger

11/07/2017 20:55, Stephen Hemminger:

Quoted 16 lines

Using a simple script (in first patch), discovered that there was lots of #include file sloppiness in DPDK. This patch series fixes everything but base drivers and examples.

Stephen Hemminger (19):
devtools: add simple script to find duplicate includes
eal: remove duplicate includes
cmdline: remove duplicate include of errno.h
distributor: remove duplicate include of rte_compat.h
lpm: remove duplicate include of errno.h
cuckoo_hash: remove duplicate include of rte_log.h
timer: remove duplicate include of rte_per_lcore.h
bnxt: remove duplicate include of unistd.h
ixgbe: remove duplicate include of rte_atomic.h
i40e: remove duplicate include of rte_atomic.h
virtio: remove duplicated includes

Quoted 8 lines

cxgbe: remove duplicated includes
vmxnet3: remove duplicated include of rte_atomic.h
dpaa2: remove duplicated includes
fsmlc: remove duplicated includes
app/proc-info: remove duplicate include
app/test-pmd: remove duplicate includes test/test-pipeline: remove duplicate include of rte_per_lcore.h test/test: remove duplicate includes

Squashed a bit and applied with an additional patch for examples, some more duplicates in .h files removed, and without the perl script.

Note: my shell script is pending for approval :)

Thanks