[dpdk-dev] [PATCH 8/8] doc: update port id type

Zhiyong Yang zhiyong.yang at intel.com
Fri Oct 13 15:17:01 CEST 2017


Since port id has changed from uint8_t to uint16_t in dpdk code,
So update the change in related doc.

Fixes: f8244c6399d9 ("ethdev: increase port id range")
Signed-off-by: Zhiyong Yang <zhiyong.yang at intel.com>
---
 doc/guides/prog_guide/poll_mode_drv.rst              |  2 +-
 doc/guides/prog_guide/rte_flow.rst                   | 12 ++++++------
 doc/guides/sample_app_ug/ipv4_multicast.rst          |  2 +-
 doc/guides/sample_app_ug/kernel_nic_interface.rst    |  8 ++++----
 doc/guides/sample_app_ug/l2_forward_job_stats.rst    |  4 ++--
 doc/guides/sample_app_ug/l2_forward_real_virtual.rst |  2 +-
 doc/guides/sample_app_ug/l3_forward.rst              | 10 +++++-----
 doc/guides/sample_app_ug/l3_forward_power_man.rst    |  4 ++--
 doc/guides/sample_app_ug/link_status_intr.rst        |  4 ++--
 doc/guides/sample_app_ug/ptpclient.rst               |  2 +-
 doc/guides/sample_app_ug/rxtx_callbacks.rst          |  6 +++---
 doc/guides/sample_app_ug/skeleton.rst                |  6 +++---
 12 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/doc/guides/prog_guide/poll_mode_drv.rst b/doc/guides/prog_guide/poll_mode_drv.rst
index 423170997..6a0c9f992 100644
--- a/doc/guides/prog_guide/poll_mode_drv.rst
+++ b/doc/guides/prog_guide/poll_mode_drv.rst
@@ -562,7 +562,7 @@ NIC Reset API
 
 .. code-block:: c
 
-    int rte_eth_dev_reset(uint8_t port_id);
+    int rte_eth_dev_reset(uint16_t port_id);
 
 Sometimes a port has to be reset passively. For example when a PF is
 reset, all its VFs should also be reset by the application to make them
diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
index 31138819b..13e3dbe0d 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -1418,7 +1418,7 @@ supported and can be created.
 .. code-block:: c
 
    int
-   rte_flow_validate(uint8_t port_id,
+   rte_flow_validate(uint16_t port_id,
                      const struct rte_flow_attr *attr,
                      const struct rte_flow_item pattern[],
                      const struct rte_flow_action actions[],
@@ -1473,7 +1473,7 @@ actually created and a handle returned.
 .. code-block:: c
 
    struct rte_flow *
-   rte_flow_create(uint8_t port_id,
+   rte_flow_create(uint16_t port_id,
                    const struct rte_flow_attr *attr,
                    const struct rte_flow_item pattern[],
                    const struct rte_flow_action *actions[],
@@ -1505,7 +1505,7 @@ performing this step before releasing resources.
 .. code-block:: c
 
    int
-   rte_flow_destroy(uint8_t port_id,
+   rte_flow_destroy(uint16_t port_id,
                     struct rte_flow *flow,
                     struct rte_flow_error *error);
 
@@ -1536,7 +1536,7 @@ port. They are released as with successive calls to ``rte_flow_destroy()``.
 .. code-block:: c
 
    int
-   rte_flow_flush(uint8_t port_id,
+   rte_flow_flush(uint16_t port_id,
                   struct rte_flow_error *error);
 
 In the unlikely event of failure, handles are still considered destroyed and
@@ -1564,7 +1564,7 @@ definition.
 .. code-block:: c
 
    int
-   rte_flow_query(uint8_t port_id,
+   rte_flow_query(uint16_t port_id,
                   struct rte_flow *flow,
                   enum rte_flow_action_type action,
                   void *data,
@@ -1637,7 +1637,7 @@ port and may return errors such as ``ENOTSUP`` ("not supported"):
 .. code-block:: c
 
    int
-   rte_flow_isolate(uint8_t port_id, int set, struct rte_flow_error *error);
+   rte_flow_isolate(uint16_t port_id, int set, struct rte_flow_error *error);
 
 Arguments:
 
diff --git a/doc/guides/sample_app_ug/ipv4_multicast.rst b/doc/guides/sample_app_ug/ipv4_multicast.rst
index 49712a0fe..60bca859e 100644
--- a/doc/guides/sample_app_ug/ipv4_multicast.rst
+++ b/doc/guides/sample_app_ug/ipv4_multicast.rst
@@ -268,7 +268,7 @@ The actual packet transmission is done in the mcast_send_pkt() function:
 
 .. code-block:: c
 
-    static inline void mcast_send_pkt(struct rte_mbuf *pkt, struct ether_addr *dest_addr, struct lcore_queue_conf *qconf, uint8_t port)
+    static inline void mcast_send_pkt(struct rte_mbuf *pkt, struct ether_addr *dest_addr, struct lcore_queue_conf *qconf, uint16_t port)
     {
         struct ether_hdr *ethdr;
         uint16_t len;
diff --git a/doc/guides/sample_app_ug/kernel_nic_interface.rst b/doc/guides/sample_app_ug/kernel_nic_interface.rst
index 619a7b527..e050e8bf7 100644
--- a/doc/guides/sample_app_ug/kernel_nic_interface.rst
+++ b/doc/guides/sample_app_ug/kernel_nic_interface.rst
@@ -246,7 +246,7 @@ The code for allocating the kernel NIC interfaces for a specific port is as foll
 .. code-block:: c
 
     static int
-    kni_alloc(uint8_t port_id)
+    kni_alloc(uint16_t port_id)
     {
         uint8_t i;
         struct rte_kni *kni;
@@ -335,7 +335,7 @@ The code is as follows:
         int i, j, nb_token;
         char *str_fld[_NUM_FLD];
         unsigned long int_fld[_NUM_FLD];
-        uint8_t port_id, nb_kni_port_params = 0;
+        uint16_t port_id, nb_kni_port_params = 0;
 
         memset(&kni_port_params_array, 0, sizeof(kni_port_params_array));
 
@@ -532,7 +532,7 @@ Currently, setting a new MTU and configuring the network interface (up/ down) ar
     /* Callback for request of changing MTU */
 
     static int
-    kni_change_mtu(uint8_t port_id, unsigned new_mtu)
+    kni_change_mtu(uint16_t port_id, unsigned new_mtu)
     {
         int ret;
         struct rte_eth_conf conf;
@@ -581,7 +581,7 @@ Currently, setting a new MTU and configuring the network interface (up/ down) ar
     /* Callback for request of configuring network interface up/down */
 
     static int
-    kni_config_network_interface(uint8_t port_id, uint8_t if_up)
+    kni_config_network_interface(uint16_t port_id, uint8_t if_up)
     {
         int ret = 0;
 
diff --git a/doc/guides/sample_app_ug/l2_forward_job_stats.rst b/doc/guides/sample_app_ug/l2_forward_job_stats.rst
index 1029cc8ff..1d45896f5 100644
--- a/doc/guides/sample_app_ug/l2_forward_job_stats.rst
+++ b/doc/guides/sample_app_ug/l2_forward_job_stats.rst
@@ -558,7 +558,7 @@ If the table is full, the whole packets table is transmitted using the l2fwd_sen
     /* Send the packet on an output interface */
 
     static int
-    l2fwd_send_packet(struct rte_mbuf *m, uint8_t port)
+    l2fwd_send_packet(struct rte_mbuf *m, uint16_t port)
     {
         unsigned lcore_id, len;
         struct lcore_queue_conf *qconf;
@@ -593,7 +593,7 @@ however it improves performance:
         unsigned lcore_id;
         struct lcore_queue_conf *qconf;
         struct mbuf_table *m_table;
-        uint8_t portid;
+        uint16_t portid;
 
         lcore_id = rte_lcore_id();
         qconf = &lcore_queue_conf[lcore_id];
diff --git a/doc/guides/sample_app_ug/l2_forward_real_virtual.rst b/doc/guides/sample_app_ug/l2_forward_real_virtual.rst
index f579c8fe9..6f496f730 100644
--- a/doc/guides/sample_app_ug/l2_forward_real_virtual.rst
+++ b/doc/guides/sample_app_ug/l2_forward_real_virtual.rst
@@ -474,7 +474,7 @@ If the table is full, the whole packets table is transmitted using the l2fwd_sen
     /* Send the packet on an output interface */
 
     static int
-    l2fwd_send_packet(struct rte_mbuf *m, uint8_t port)
+    l2fwd_send_packet(struct rte_mbuf *m, uint16_t port)
     {
         unsigned lcore_id, len;
         struct lcore_queue_conf *qconf;
diff --git a/doc/guides/sample_app_ug/l3_forward.rst b/doc/guides/sample_app_ug/l3_forward.rst
index 6a6b8fbe8..2635f403b 100644
--- a/doc/guides/sample_app_ug/l3_forward.rst
+++ b/doc/guides/sample_app_ug/l3_forward.rst
@@ -283,7 +283,7 @@ The get_ipv4_dst_port() function is shown below:
 .. code-block:: c
 
     static inline uint8_t
-    get_ipv4_dst_port(void *ipv4_hdr, uint8_t portid, lookup_struct_t *ipv4_l3fwd_lookup_struct)
+    get_ipv4_dst_port(void *ipv4_hdr, uint16_t portid, lookup_struct_t *ipv4_l3fwd_lookup_struct)
     {
         int ret = 0;
         union ipv4_5tuple_host key;
@@ -312,7 +312,7 @@ The key code snippet of simple_ipv4_fwd_4pkts() is shown below:
 .. code-block:: c
 
     static inline void
-    simple_ipv4_fwd_4pkts(struct rte_mbuf* m[4], uint8_t portid, struct lcore_conf *qconf)
+    simple_ipv4_fwd_4pkts(struct rte_mbuf* m[4], uint16_t portid, struct lcore_conf *qconf)
     {
         // ...
 
@@ -351,10 +351,10 @@ for LPM-based lookups is done by the get_ipv4_dst_port() function below:
 
 .. code-block:: c
 
-    static inline uint8_t
-    get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint8_t portid, lookup_struct_t *ipv4_l3fwd_lookup_struct)
+    static inline uint16_t
+    get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid, lookup_struct_t *ipv4_l3fwd_lookup_struct)
     {
         uint8_t next_hop;
 
-        return (uint8_t) ((rte_lpm_lookup(ipv4_l3fwd_lookup_struct, rte_be_to_cpu_32(ipv4_hdr->dst_addr), &next_hop) == 0)? next_hop : portid);
+        return ((rte_lpm_lookup(ipv4_l3fwd_lookup_struct, rte_be_to_cpu_32(ipv4_hdr->dst_addr), &next_hop) == 0)? next_hop : portid);
     }
diff --git a/doc/guides/sample_app_ug/l3_forward_power_man.rst b/doc/guides/sample_app_ug/l3_forward_power_man.rst
index ea9c404d8..18fe63b5a 100644
--- a/doc/guides/sample_app_ug/l3_forward_power_man.rst
+++ b/doc/guides/sample_app_ug/l3_forward_power_man.rst
@@ -181,11 +181,11 @@ responsible for checking if it needs to scale down frequency at run time by chec
         struct lcore_conf *qconf;
         int ret;
         unsigned nb_ports;
-        uint16_t queueid;
+        uint16_t queueid, portid;
         unsigned lcore_id;
         uint64_t hz;
         uint32_t n_tx_queue, nb_lcores;
-        uint8_t portid, nb_rx_queue, queue, socketid;
+        uint8_t nb_rx_queue, queue, socketid;
 
         // ...
 
diff --git a/doc/guides/sample_app_ug/link_status_intr.rst b/doc/guides/sample_app_ug/link_status_intr.rst
index f9af47492..abc1d8f0d 100644
--- a/doc/guides/sample_app_ug/link_status_intr.rst
+++ b/doc/guides/sample_app_ug/link_status_intr.rst
@@ -219,7 +219,7 @@ An example callback function that has been written as indicated below.
 .. code-block:: c
 
     static void
-    lsi_event_callback(uint8_t port_id, enum rte_eth_event_type type, void *param)
+    lsi_event_callback(uint16_t port_id, enum rte_eth_event_type type, void *param)
     {
         struct rte_eth_link link;
 
@@ -405,7 +405,7 @@ If the table is full, the whole packets table is transmitted using the lsi_send_
     /* Send the packet on an output interface */
 
     static int
-    lsi_send_packet(struct rte_mbuf *m, uint8_t port)
+    lsi_send_packet(struct rte_mbuf *m, uint16_t port)
     {
         unsigned lcore_id, len;
         struct lcore_queue_conf *qconf;
diff --git a/doc/guides/sample_app_ug/ptpclient.rst b/doc/guides/sample_app_ug/ptpclient.rst
index d3ef1d119..d643cf1ea 100644
--- a/doc/guides/sample_app_ug/ptpclient.rst
+++ b/doc/guides/sample_app_ug/ptpclient.rst
@@ -257,7 +257,7 @@ PTP IEEE1588 L2 functionality.
 .. code-block:: c
 
     void
-    parse_ptp_frames(uint8_t portid, struct rte_mbuf *m) {
+    parse_ptp_frames(uint16_t portid, struct rte_mbuf *m) {
         struct ptp_header *ptp_hdr;
         struct ether_hdr *eth_hdr;
         uint16_t eth_type;
diff --git a/doc/guides/sample_app_ug/rxtx_callbacks.rst b/doc/guides/sample_app_ug/rxtx_callbacks.rst
index 8d1bb86f7..32619e0c1 100644
--- a/doc/guides/sample_app_ug/rxtx_callbacks.rst
+++ b/doc/guides/sample_app_ug/rxtx_callbacks.rst
@@ -124,7 +124,7 @@ comments:
 .. code-block:: c
 
     static inline int
-    port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+    port_init(uint16_t port, struct rte_mempool *mbuf_pool)
     {
         struct rte_eth_conf port_conf = port_conf_default;
         const uint16_t rx_rings = 1, tx_rings = 1;
@@ -196,7 +196,7 @@ all packets received:
 .. code-block:: c
 
     static uint16_t
-    add_timestamps(uint8_t port __rte_unused, uint16_t qidx __rte_unused,
+    add_timestamps(uint16_t port __rte_unused, uint16_t qidx __rte_unused,
             struct rte_mbuf **pkts, uint16_t nb_pkts, void *_ __rte_unused)
     {
         unsigned i;
@@ -222,7 +222,7 @@ packets prior to transmission:
 .. code-block:: c
 
     static uint16_t
-    calc_latency(uint8_t port __rte_unused, uint16_t qidx __rte_unused,
+    calc_latency(uint16_t port __rte_unused, uint16_t qidx __rte_unused,
             struct rte_mbuf **pkts, uint16_t nb_pkts, void *_ __rte_unused)
     {
         uint64_t cycles = 0;
diff --git a/doc/guides/sample_app_ug/skeleton.rst b/doc/guides/sample_app_ug/skeleton.rst
index c39b03322..17714455c 100644
--- a/doc/guides/sample_app_ug/skeleton.rst
+++ b/doc/guides/sample_app_ug/skeleton.rst
@@ -160,7 +160,7 @@ Forwarding application is shown below:
 .. code-block:: c
 
     static inline int
-    port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+    port_init(uint16_t port, struct rte_mempool *mbuf_pool)
     {
         struct rte_eth_conf port_conf = port_conf_default;
         const uint16_t rx_rings = 1, tx_rings = 1;
@@ -241,8 +241,8 @@ looks like the following:
     static __attribute__((noreturn)) void
     lcore_main(void)
     {
-        const uint8_t nb_ports = rte_eth_dev_count();
-        uint8_t port;
+        const uint16_t nb_ports = rte_eth_dev_count();
+        uint16_t port;
 
         /*
          * Check that the port is on the same NUMA node as the polling thread
-- 
2.13.3



More information about the dev mailing list