Mike Marciniszyn 780278c2c8 IB/hfi1: Rework AIP and VNIC dummy netdev usage
All other users of the dummy netdevice embed the netdev in other
structures:

init_dummy_netdev(&mal->dummy_dev);
init_dummy_netdev(&eth->dummy_dev);
init_dummy_netdev(&ar->napi_dev);
init_dummy_netdev(&irq_grp->napi_ndev);
init_dummy_netdev(&wil->napi_ndev);
init_dummy_netdev(&trans_pcie->napi_dev);
init_dummy_netdev(&dev->napi_dev);
init_dummy_netdev(&bus->mux_dev);

The AIP and VNIC implementation turns that model inside out and used a
kfree() to free what appears to be a netdev struct when in reality, it is
a struct that enbodies the rx state as well as the dummy netdev used to
support napi_poll across disparate receive contexts.  The relationship is
infered by the odd allocation:

	const int netdev_size = sizeof(*dd->dummy_netdev) +
		sizeof(struct hfi1_netdev_priv);
	<snip>
	dd->dummy_netdev = kcalloc_node(1, netdev_size, GFP_KERNEL, dd->node);

Correct the issue by:
- Correctly naming the alloc and free functions
- Renaming hfi1_netdev_priv to hfi1_netdev_rx
- Replacing dd dummy_netdev with a netdev_rx pointer
- Embedding the net_device in hfi1_netdev_rx
- Moving the init_dummy_netdev to the alloc routine
- Adjusting wrappers to fit the new model

Fixes: 6991abcb993c ("IB/hfi1: Add functions to receive accelerated ipoib packets")
Link: https://lore.kernel.org/r/1617026056-50483-11-git-send-email-dennis.dalessandro@cornelisnetworks.com
Reviewed-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@cornelisnetworks.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2021-04-13 13:54:56 -03:00
..
2019-06-28 22:34:26 -03:00
2019-06-28 22:34:26 -03:00
2021-03-26 12:05:28 -03:00
2020-05-21 11:23:56 -03:00
2021-03-26 09:31:21 -03:00
2021-03-26 09:31:21 -03:00
2020-05-21 11:23:56 -03:00
2019-04-24 11:31:49 -03:00
2020-07-24 16:59:55 -03:00
2021-01-07 13:53:41 -04:00
2021-04-07 20:19:01 -03:00
2021-03-26 09:31:21 -03:00
2019-03-28 11:03:49 -03:00
2019-11-27 07:44:25 +01:00
2021-01-28 15:42:29 -04:00
2021-03-26 09:31:21 -03:00
2021-03-26 09:31:21 -03:00
2019-07-30 14:21:32 -07:00
2021-03-26 09:31:21 -03:00