Re: [PATCH v4] IB/hfi1: allocate dummy net_device dynamically

From: Leon Romanovsky
Date: Mon Apr 01 2024 - 07:53:45 EST


On Tue, Mar 19, 2024 at 02:09:43AM -0700, Breno Leitao wrote:
> Embedding net_device into structures prohibits the usage of flexible
> arrays in the net_device structure. For more details, see the discussion
> at [1].
>
> Un-embed the net_device from struct hfi1_netdev_rx by converting it
> into a pointer. Then use the leverage alloc_netdev() to allocate the
> net_device object at hfi1_alloc_rx().
>
> [1] https://lore.kernel.org/all/20240229225910.79e224cf@xxxxxxxxxx/
>
> Signed-off-by: Breno Leitao <leitao@xxxxxxxxxx>
> Acked-by: Dennis Dalessandro <dennis.dalessandro@xxxxxxxxxxxxxxxxxxxx>

Jakub,

I create shared branch for you, please pull it from:
https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/log/?h=remove-dummy-netdev

Thanks