Search code examples
networkingdpdkdescriptor

Is there any limit to the setting of the number of RX descriptors in DPDK?


I noticed that in DPDK, the default value of the RX descriptors in the RX ring is generally 4096. But I can also make arbitrary changes to this value(multiples of 64).

I would like to know is there any limit for setting the number of RX descriptors?

eg,What is the maximum number of RX descriptors that can be set?Is this maximum value related to the type of network card? Does the number of RX descriptors have to be a multiple of 64?


Solution

  • Descriptor count limits are PMD-specific, but the application can get them via the generic interface.

    Available values are: MIN, MAX and ALIGN (multiplier). In example, for the Rx descriptor count:

    uint16_t                 port_id = 0;
    struct rte_eth_dev_info  info = {};
    int                      ret;
    
    ret = rte_eth_dev_info_get(port_id, &info);
    if (ret != 0) {
        /* handle the error */
    }
    
    /*
     * Use these variables to compute a valid descriptor
     * count for the use in rte_eth_rx_queue_setup():
     *
     * info.rx_desc_lim.nb_min
     * info.rx_desc_lim.nb_align
     * info.rx_desc_lim.nb_max
     */