• Shay Agroskin's avatar
    net: ena: use constant value for net_device allocation · ce74496a
    Shay Agroskin authored
    The patch changes the maximum number of RX/TX queues it advertises to
    the kernel (via alloc_etherdev_mq()) from a value received from the
    device to a constant value which is the minimum between 128 and the
    number of CPUs in the system.
    
    By allocating the net_device struct with a constant number of queues,
    the driver is able to allocate it at a much earlier stage, before
    calling any ena_com functions. This would allow to make all log prints
    in ena_com to use netdev_* log functions instead or current pr_* ones.
    
    Note:
    netdev_* prints in ena_com functions that are called before
    net_device registration in ena_probe() might print messages that are
    a bit ugly (with strings like "(unnamed net_device) (uninitialized)").
    However we decided to use netdev_* prints in these functions anyway,
    for the sake of getting better messages later, when ena_com functions
    are called after ena_probe() form other parts of the driver.
    See discussion about this decision in [1].
    
    [1] http://www.mail-archive.com/netdev@vger.kernel.org/msg353590.htmlSigned-off-by: default avatarShay Agroskin <shayagr@amazon.com>
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    ce74496a
ena_netdev.c 123 KB