lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b34b048e-1291-207d-b611-c66d591cbf1b@wanadoo.fr>
Date: Wed, 7 Jun 2023 19:08:46 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>,
 davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com
Cc: mhi@...ts.linux.dev, linux-arm-msm@...r.kernel.org,
 netdev@...r.kernel.org, linux-kernel@...r.kernel.org, loic.poulain@...aro.org
Subject: Re: [PATCH v2 1/2] net: Add MHI Endpoint network driver

Le 07/06/2023 à 17:24, Manivannan Sadhasivam a écrit :
> Add a network driver for the Modem Host Interface (MHI) endpoint devices
> that provides network interfaces to the PCIe based Qualcomm endpoint
> devices supporting MHI bus. This driver allows the MHI endpoint devices to
> establish IP communication with the host machines (x86, ARM64) over MHI
> bus.
> 
> The driver currently supports only IP_SW0 MHI channel that can be used
> to route IP traffic from the endpoint CPU to host machine.
> 
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
> ---

[...]

> +static int mhi_ep_net_newlink(struct mhi_ep_device *mhi_dev, struct net_device *ndev)
> +{
> +	struct mhi_ep_net_dev *mhi_ep_netdev;
> +	int ret;
> +
> +	mhi_ep_netdev = netdev_priv(ndev);
> +
> +	dev_set_drvdata(&mhi_dev->dev, mhi_ep_netdev);
> +	mhi_ep_netdev->ndev = ndev;
> +	mhi_ep_netdev->mdev = mhi_dev;
> +	mhi_ep_netdev->mru = mhi_dev->mhi_cntrl->mru;
> +
> +	skb_queue_head_init(&mhi_ep_netdev->tx_buffers);
> +	spin_lock_init(&mhi_ep_netdev->tx_lock);
> +
> +	u64_stats_init(&mhi_ep_netdev->stats.rx_syncp);
> +	u64_stats_init(&mhi_ep_netdev->stats.tx_syncp);
> +
> +	mhi_ep_netdev->xmit_wq = alloc_workqueue("mhi_ep_net_xmit_wq", 0, WQ_HIGHPRI);

if (!mhi_ep_netdev->xmit_wq)
	return -ENOMEM;

> +	INIT_WORK(&mhi_ep_netdev->xmit_work, mhi_ep_net_dev_process_queue_packets);
> +
> +	ret = register_netdev(ndev);
> +	if (ret) {
> +		destroy_workqueue(mhi_ep_netdev->xmit_wq);

I don't really think it is needed, but to be consistent with 
mhi_ep_net_dellink(), maybe:
	dev_set_drvdata(&mhi_dev->dev, NULL);

CJ

> +		return ret;
> +	}
> +
> +	return 0;
> +}

[...]


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ