[Intel-wired-lan] [PATCH v2] netdevice: use ifmap instead of plain fields

Jakub Kicinski kuba at kernel.org
Sat Mar 4 01:35:19 UTC 2023


On Fri,  3 Mar 2023 19:09:26 +0100 Vincenzo Palazzo wrote:
> diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
> index e1eb1de88bf9..059ff8bcdbbc 100644
> --- a/drivers/net/ethernet/intel/e1000e/netdev.c
> +++ b/drivers/net/ethernet/intel/e1000e/netdev.c
> @@ -7476,8 +7476,8 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>  	netif_napi_add(netdev, &adapter->napi, e1000e_poll);
>  	strscpy(netdev->name, pci_name(pdev), sizeof(netdev->name));
>  
> -	netdev->mem_start = mmio_start;
> -	netdev->mem_end = mmio_start + mmio_len;
> +	netdev->dev_mapping.mem_start = mmio_start;
> +	netdev->dev_mapping.mem_end = mmio_start + mmio_len;
>  
>  	adapter->bd_number = cards_found++;

That's not the only driver that'd need to be changed.
Try building the kernel with allmodconfig.

> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index 6a14b7b11766..c5987e90a078 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -2031,13 +2031,7 @@ struct net_device {
>  	char			name[IFNAMSIZ];
>  	struct netdev_name_node	*name_node;
>  	struct dev_ifalias	__rcu *ifalias;
> -	/*
> -	 *	I/O specific fields
> -	 *	FIXME: Merge these and struct ifmap into one
> -	 */
> -	unsigned long		mem_end;
> -	unsigned long		mem_start;
> -	unsigned long		base_addr;
> +	struct ifmap dev_mapping;

base_addr was unsigned long now its unsigned short.
IDK if that matters.

I'd rather we didn't mess with this code - it's only used by ancient
drivers. We can wait until those drivers are no longer used and delete
this instead.


More information about the Intel-wired-lan mailing list