Skip to contentSkip to conversation

doc: update examples list for API

PATCH Superseded Ferruh Yigit 3 participants 9 messages Jan 27, 2017 – Feb 8, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 doc: update examples list for API

These files are linked to API documentation as usage samples, added missing examples files and sorted list alphabetically.

---
 doc/api/examples.dox | 23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)
doc/api/examples.dox +19 -4
index c13e574..2d6b65b 100644
@@ -12,6 +12,10 @@
 @example ethtool/ethtool-app/main.c
 @example ethtool/lib/rte_ethtool.c
 @example exception_path/main.c
+@example flow_distributor/distributor/args.c
+@example flow_distributor/distributor/init.c
+@example flow_distributor/distributor/main.c
+@example flow_distributor/node/node.c
 @example helloworld/main.c
 @example ip_fragmentation/main.c
 @example ip_pipeline/config_check.c
@@ -20,6 +24,7 @@
 @example ip_pipeline/cpu_core_map.c
 @example ip_pipeline/init.c
 @example ip_pipeline/main.c
+@example ip_pipeline/parser.c
 @example ip_pipeline/pipeline/pipeline_common_be.c
 @example ip_pipeline/pipeline/pipeline_common_fe.c
 @example ip_pipeline/pipeline/pipeline_firewall_be.c
@@ -37,13 +42,27 @@
 @example ip_pipeline/thread.c
 @example ip_pipeline/thread_fe.c
 @example ip_reassembly/main.c
+@example ipsec-secgw/esp.c
+@example ipsec-secgw/ipsec.c
+@example ipsec-secgw/ipsec-secgw.c
+@example ipsec-secgw/parser.c
+@example ipsec-secgw/rt.c
+@example ipsec-secgw/sa.c
+@example ipsec-secgw/sp4.c
+@example ipsec-secgw/sp6.c
 @example ipv4_multicast/main.c
 @example kni/main.c
+@example l2fwd-cat/cat.c
+@example l2fwd-cat/l2fwd-cat.c
 @example l2fwd-crypto/main.c
 @example l2fwd-jobstats/main.c
+@example l2fwd-keepalive/ka-agent/main.c
 @example l2fwd-keepalive/main.c
+@example l2fwd-keepalive/shm.c
 @example l2fwd/main.c
 @example l3fwd-acl/main.c
+@example l3fwd/l3fwd_em.c
+@example l3fwd/l3fwd_lpm.c
 @example l3fwd/main.c
 @example l3fwd-power/main.c
 @example l3fwd-vf/main.c
@@ -52,10 +71,6 @@
 @example load_balancer/init.c
 @example load_balancer/main.c
 @example load_balancer/runtime.c
-@example flow_distributor/distributor/args.c
-@example flow_distributor/distributor/init.c
-@example flow_distributor/distributor/main.c
-@example flow_distributor/node/node.c
 @example multi_process/client_server_mp/mp_client/client.c
 @example multi_process/client_server_mp/mp_server/args.c
 @example multi_process/client_server_mp/mp_server/init.c
Signature · 1 line
2.9.3
#1 lore raw

Hi Ferruh,

Quoted 20 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Ferruh Yigit
Sent: Friday, January 27, 2017 11:56 AM
To: Mcnamara, John
Cc: [email protected]; Yigit, Ferruh
Subject: [dpdk-dev] [PATCH] doc: update examples list for API

These files are linked to API documentation as usage samples, added missing examples files and sorted list alphabetically.

---
 doc/api/examples.dox | 23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)
doc/api/examples.dox +0 -0
index c13e574..2d6b65b 100644

doc/api/examples.dox line 18

Quoted 7 lines
doc/api/examples.dox +4 -0
@@ -12,6 +12,10 @@
 @example ethtool/ethtool-app/main.c
 @example ethtool/lib/rte_ethtool.c
 @example exception_path/main.c
+@example flow_distributor/distributor/args.c
+@example flow_distributor/distributor/init.c
+@example flow_distributor/distributor/main.c
+@example flow_distributor/node/node.c

I am renaming this sample app in this patch (http://dpdk.org/dev/patchwork/patch/19931/)
and I am moving the new sample files in the right order.

Thanks,
Pablo

#3 lore raw
Quoted 7 lines · Thomas Monjalon

2017-01-27 11:55, Ferruh Yigit:

Quoted 4 lines

These files are linked to API documentation as usage samples, added missing examples files and sorted list alphabetically.

Why not replacing this list with a "find examples -type f" in mk/rte.sdkdoc.mk?

Yes it is good idea, I will try.

#4 lore raw

PATCH v2 1/1 doc: automate examples file list for API doc

In reply to Thomas Monjalon

These files are linked to API documentation as usage samples, list of files created automatically during doc creation.

Remove manually updated old one.

---
 doc/api/doxy-api.conf |   1 -
 doc/api/examples.dox  | 115 --------------------------------------------------
 mk/rte.sdkdoc.mk      |  14 +++++-
 3 files changed, 13 insertions(+), 117 deletions(-)
 delete mode 100644 doc/api/examples.dox
doc/api/doxy-api.conf +0 -1
index 6892315..a92dd3c 100644
@@ -30,7 +30,6 @@
 
 PROJECT_NAME            = DPDK
 INPUT                   = doc/api/doxy-api-index.md \
-                          doc/api/examples.dox \
                           drivers/net/bonding \
                           lib/librte_eal/common/include \
                           lib/librte_eal/common/include/generic \
doc/api/examples.dox deleted +0 -115

115 lines not on this page · raw message

mk/rte.sdkdoc.mk +13 -1
index 21d9bdf..8156e86 100644
@@ -54,6 +54,8 @@ RTE_PDF_DPI ?= 300
 
 RTE_GUIDES := $(filter %/, $(wildcard $(RTE_SDK)/doc/guides/*/))
 
+API_EXAMPLES := $(RTE_OUTPUT)/doc/html/examples.dox
+
 .PHONY: help
 help:
 	@cat $(RTE_SDK)/doc/build-sdk-quick.txt
@@ -66,10 +68,11 @@ all: api-html guides-html guides-pdf
 clean: api-html-clean guides-html-clean guides-pdf-clean guides-man-clean
 
 .PHONY: api-html
-api-html: api-html-clean
+api-html: api-html-clean $(API_EXAMPLES)
 	@echo 'doxygen for API...'
 	$(Q)mkdir -p $(RTE_OUTPUT)/doc/html
 	$(Q)(cat $(RTE_SDK)/doc/api/doxy-api.conf     && \
+	    echo INPUT           += $(API_EXAMPLES)   && \
 	    printf 'PROJECT_NUMBER = '                && \
 	                      $(MAKE) -rR showversion && \
 	    echo OUTPUT_DIRECTORY = $(RTE_OUTPUT)/doc && \
@@ -83,8 +86,17 @@ api-html: api-html-clean
 .PHONY: api-html-clean
 api-html-clean:
 	$(Q)rm -f $(RTE_OUTPUT)/doc/html/api/*
+	$(Q)rm -f $(API_EXAMPLES)
 	$(Q)rmdir -p --ignore-fail-on-non-empty $(RTE_OUTPUT)/doc/html/api 2>&- || true
 
+$(API_EXAMPLES):
+	$(Q)mkdir -p $(RTE_OUTPUT)/doc/html
+	@echo "/**" > $(API_EXAMPLES)
+	@echo "@page examples DPDK Example Programs" >> $(API_EXAMPLES)
+	@echo "" >> $(API_EXAMPLES)
+	@find examples -type f -name "*.c" | awk '{ print "@example", $$0 }' >> $(API_EXAMPLES)
+	@echo "*/" >> $(API_EXAMPLES)
+
 guides-pdf-clean: guides-pdf-img-clean
 guides-pdf-img-clean:
 	$(Q)rm -f $(RTE_SDK)/doc/guides/*/img/*.pdf
Signature · 1 line
2.9.3
#5 lore raw

Re: [PATCH v2] doc: automate examples file list for API doc

2017-01-27 17:37, Ferruh Yigit:

Quoted 6 lines

These files are linked to API documentation as usage samples, list of files created automatically during doc creation.

Remove manually updated old one.

[...]

Quoted 1 line

+API_EXAMPLES := $(RTE_OUTPUT)/doc/html/examples.dox

I feel it should be in $(RTE_OUTPUT)/doc/ because the doc could be generated in another format (not HTML only).

[...]

mk/rte.sdkdoc.mk all: api-html guides-html guides-pdf · line 77

Quoted 6 lines
mk/rte.sdkdoc.mk +1 -0
 	@echo 'doxygen for API...'
 	$(Q)mkdir -p $(RTE_OUTPUT)/doc/html
 	$(Q)(cat $(RTE_SDK)/doc/api/doxy-api.conf     && \
+	    echo INPUT           += $(API_EXAMPLES)   && \
 	    printf 'PROJECT_NUMBER = '                && \
 	                      $(MAKE) -rR showversion && \

It would be nicer to see INPUT here.

Quoted 1 line

echo OUTPUT_DIRECTORY = $(RTE_OUTPUT)/doc && \

[...]

mk/rte.sdkdoc.mk api-html: api-html-clean · line 97

Quoted 6 lines

+$(API_EXAMPLES):

mk/rte.sdkdoc.mk +5 -0
+	$(Q)mkdir -p $(RTE_OUTPUT)/doc/html
+	@echo "/**" > $(API_EXAMPLES)
+	@echo "@page examples DPDK Example Programs" >> $(API_EXAMPLES)
+	@echo "" >> $(API_EXAMPLES)
+	@find examples -type f -name "*.c" | awk '{ print "@example", $$0 }' >> $(API_EXAMPLES)

May I suggest this simpler syntax?
find examples -type f -name '*.c' -printf '@example %p\n'

Please prefer simple quotes where possible.

#6 lore raw

Re: [PATCH v2] doc: automate examples file list for API doc

Quoted 4 lines · Thomas Monjalon

2017-01-27 17:37, Ferruh Yigit:

Quoted 3 lines

These files are linked to API documentation as usage samples, list of files created automatically during doc creation.

Quoted 8 lines
Quoted 3 lines

Remove manually updated old one.

[...]

Quoted 1 line

+API_EXAMPLES := $(RTE_OUTPUT)/doc/html/examples.dox

I feel it should be in $(RTE_OUTPUT)/doc/ because the doc could be generated in another format (not HTML only).

Not sure, the rules use this file creates hardcoded $(RTE_OUTPUT)/doc/html/ folder. Right now only user of this file is html api document.

Putting this file to the root build/doc folder will work as fine, but I think that file will look ugly there.

Quoted 11 lines

[...]

mk/rte.sdkdoc.mk all: api-html guides-html guides-pdf · line 77

Quoted 6 lines
mk/rte.sdkdoc.mk +1 -0
 	@echo 'doxygen for API...'
 	$(Q)mkdir -p $(RTE_OUTPUT)/doc/html
 	$(Q)(cat $(RTE_SDK)/doc/api/doxy-api.conf     && \
+	    echo INPUT           += $(API_EXAMPLES)   && \
 	    printf 'PROJECT_NUMBER = '                && \
 	                      $(MAKE) -rR showversion && \

It would be nicer to see INPUT here.

OK

Quoted 5 lines
Quoted 2 lines

echo OUTPUT_DIRECTORY = $(RTE_OUTPUT)/doc && \

[...]

Quoted 9 lines

mk/rte.sdkdoc.mk api-html: api-html-clean · line 97

Quoted 6 lines

+$(API_EXAMPLES):

mk/rte.sdkdoc.mk +5 -0
+	$(Q)mkdir -p $(RTE_OUTPUT)/doc/html
+	@echo "/**" > $(API_EXAMPLES)
+	@echo "@page examples DPDK Example Programs" >> $(API_EXAMPLES)
+	@echo "" >> $(API_EXAMPLES)
+	@find examples -type f -name "*.c" | awk '{ print "@example", $$0 }' >> $(API_EXAMPLES)

May I suggest this simpler syntax?
find examples -type f -name '*.c' -printf '@example %p\n'

Looks better, thanks.

I will send a new version soon.

Quoted 3 lines

Please prefer simple quotes where possible.

#7 lore raw

PATCH v3 1/1 doc: automate examples file list for API doc

In reply to Ferruh Yigit

These files are linked to API documentation as usage samples, list of files created automatically during doc creation.

Remove manually updated old one.

---

v3:
* use only find tool to create list of files, remove awk
* update line order of INPUT line.

---
 doc/api/doxy-api.conf |   1 -
 doc/api/examples.dox  | 115 --------------------------------------------------
 mk/rte.sdkdoc.mk      |  12 +++++-
 3 files changed, 11 insertions(+), 117 deletions(-)
 delete mode 100644 doc/api/examples.dox
doc/api/doxy-api.conf +0 -1
index b8a5fd8..fdcf13c 100644
@@ -30,7 +30,6 @@
 
 PROJECT_NAME            = DPDK
 INPUT                   = doc/api/doxy-api-index.md \
-                          doc/api/examples.dox \
                           drivers/net/bonding \
                           drivers/net/i40e \
                           drivers/net/ixgbe \
doc/api/examples.dox deleted +0 -115

115 lines not on this page · raw message

mk/rte.sdkdoc.mk +11 -1
index 21d9bdf..39c67a9 100644
@@ -54,6 +54,8 @@ RTE_PDF_DPI ?= 300
 
 RTE_GUIDES := $(filter %/, $(wildcard $(RTE_SDK)/doc/guides/*/))
 
+API_EXAMPLES := $(RTE_OUTPUT)/doc/html/examples.dox
+
 .PHONY: help
 help:
 	@cat $(RTE_SDK)/doc/build-sdk-quick.txt
@@ -66,12 +68,13 @@ all: api-html guides-html guides-pdf
 clean: api-html-clean guides-html-clean guides-pdf-clean guides-man-clean
 
 .PHONY: api-html
-api-html: api-html-clean
+api-html: api-html-clean $(API_EXAMPLES)
 	@echo 'doxygen for API...'
 	$(Q)mkdir -p $(RTE_OUTPUT)/doc/html
 	$(Q)(cat $(RTE_SDK)/doc/api/doxy-api.conf     && \
 	    printf 'PROJECT_NUMBER = '                && \
 	                      $(MAKE) -rR showversion && \
+	    echo INPUT           += $(API_EXAMPLES)   && \
 	    echo OUTPUT_DIRECTORY = $(RTE_OUTPUT)/doc && \
 	    echo HTML_OUTPUT      = html/api          && \
 	    echo GENERATE_HTML    = YES               && \
@@ -85,6 +88,13 @@ api-html-clean:
 	$(Q)rm -f $(RTE_OUTPUT)/doc/html/api/*
 	$(Q)rmdir -p --ignore-fail-on-non-empty $(RTE_OUTPUT)/doc/html/api 2>&- || true
 
+$(API_EXAMPLES):
+	$(Q)mkdir -p $(RTE_OUTPUT)/doc/html
+	@printf '/**\n' > $(API_EXAMPLES)
+	@printf '@page examples DPDK Example Programs\n\n' >> $(API_EXAMPLES)
+	@find examples -type f -name '*.c' -printf '@example %p\n' >> $(API_EXAMPLES)
+	@printf '*/\n' >> $(API_EXAMPLES)
+
 guides-pdf-clean: guides-pdf-img-clean
 guides-pdf-img-clean:
 	$(Q)rm -f $(RTE_SDK)/doc/guides/*/img/*.pdf
Signature · 1 line
2.9.3