=================================================================

this doc will explain the flow of adding one new driver and build flow for DPDK


=======================================================
How to add one new driver, taking r8168 as an example
=======================================================

1. modify make files

=======================================================
1.1. mk/rte.app.mk

 _LDLIBS-$(CONFIG_RTE_LIBRTE_HINIC_PMD)      += -lrte_pmd_hinic
+ _LDLIBS-$(CONFIG_RTE_LIBRTE_R8168_PMD)      += -lrte_pmd_r8168
 _LDLIBS-$(CONFIG_RTE_LIBRTE_HNS3_PMD)       += -lrte_pmd_hns3

=======================================================
1.2. drivers/net/Makefile

 DIRS-$(CONFIG_RTE_LIBRTE_HINIC_PMD) += hinic
+ DIRS-$(CONFIG_RTE_LIBRTE_R8168_PMD) += r8168
 DIRS-$(CONFIG_RTE_LIBRTE_HNS3_PMD) += hns3


=======================================================
1.3. drivers/net/meson.build

 'qede',
+ 'r8168',
 'ring',

=======================================================
2. add folder r8168 to /drivers/net, including src files, build.sh, Makefile, meson.build and rte_pmd_r8168_version.map


=======================================================
How to build and run basic tests
=======================================================

3. build

=======================================================
3.1. build package:

>cd <your dpdk fold path>/dpdk-19.11
>make install T=<your target>

(e.g. x86_64-native-linux-gcc:
make install T=x86_64-native-linux-gcc)

=======================================================
3.2. build examples:

(in <your dpdk fold path>/dpdk-19.11 path)
>export RTE_SDK=<your dpdk fold path>/dpdk-19.11
>export RTE_TARGET=x86_64-native-linux-gcc
>make -C examples


=======================================================
run basic test: testpmd tx_first mode
=======================================================


=======================================================
4. make sure your have too target RTL8111H NICs plugged in your mainboard, connect them with one cable


=======================================================
5. setup basic test environment:
(ref hugh_sh as example)

>cd <your dpdk fold path>/dpdk-19.11
>sudo bash huge_sh


=======================================================
6. run testpmd test:

>cd <your dpdk fold path>/dpdk-19.11
>sudo ./x86_64-native-linux-gcc/app/testpmd -- -i

at the interactive testpmd command line:

testpmd>start tx_first

after the test send and receive packets for a while do

testpmd>stop
