.. 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
.. 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[],
.. 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[],
.. 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);
.. 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
.. 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,
.. 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:
.. 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;
.. code-block:: c
static int
- kni_alloc(uint8_t port_id)
+ kni_alloc(uint16_t port_id)
{
uint8_t i;
struct rte_kni *kni;
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));
/* 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;
/* 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;
/* 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;
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];
/* 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;
.. 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;
.. 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)
{
// ...
.. 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);
}
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;
// ...
.. 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;
/* 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;
.. 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;
.. 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;
.. 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;
.. 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;
.. 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;
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