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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221114153955.703649-1-alexandr.lobakin@intel.com>
Date:   Mon, 14 Nov 2022 16:39:55 +0100
From:   Alexander Lobakin <alexandr.lobakin@...el.com>
To:     Mengyuan Lou <mengyuanlou@...-swift.com>
Cc:     Alexander Lobakin <alexandr.lobakin@...el.com>,
        netdev@...r.kernel.org, jiawenwu@...stnetic.com
Subject: Re: [PATCH net-next 2/5] net: txgbe: Initialize service task

From: Mengyuan Lou <mengyuanlou@...-swift.com>
Date: Tue,  8 Nov 2022 19:19:04 +0800

> From: Jiawen Wu <jiawenwu@...stnetic.com>
> 
> Setup work queue, and initialize service task to process the following
> tasks.
> 
> Signed-off-by: Jiawen Wu <jiawenwu@...stnetic.com>
> ---

[...]

> @@ -468,6 +524,7 @@ static int txgbe_probe(struct pci_dev *pdev,
>  	}
>  
>  	netdev->netdev_ops = &txgbe_netdev_ops;
> +	netdev->watchdog_timeo = 5 * HZ;

Default value is 5 sec already[0], why...

>  
>  	/* setup the private structure */
>  	err = txgbe_sw_init(adapter);
> @@ -518,6 +575,11 @@ static int txgbe_probe(struct pci_dev *pdev,
>  	eth_hw_addr_set(netdev, wxhw->mac.perm_addr);
>  	txgbe_mac_set_default_filter(adapter, wxhw->mac.perm_addr);

[...]

> +static int __init txgbe_init_module(void)
> +{
> +	int ret;
> +
> +	txgbe_wq = create_singlethread_workqueue(txgbe_driver_name);
> +	if (!txgbe_wq) {
> +		pr_err("%s: Failed to create workqueue\n", txgbe_driver_name);
> +		return -ENOMEM;
> +	}
> +
> +	ret = pci_register_driver(&txgbe_driver);
> +	return ret;
> +}
> +
> +module_init(txgbe_init_module);

I think no empty lines in between the function and module/initcall
init/exit declaration is preferred.

> +
> +/**
> + * txgbe_exit_module - Driver Exit Cleanup Routine
> + *
> + * txgbe_exit_module is called just before the driver is removed
> + * from memory.
> + **/
> +static void __exit txgbe_exit_module(void)
> +{
> +	pci_unregister_driver(&txgbe_driver);
> +	destroy_workqueue(txgbe_wq);
> +}
> +
> +module_exit(txgbe_exit_module);

^

>  
>  MODULE_DEVICE_TABLE(pci, txgbe_pci_tbl);
>  MODULE_AUTHOR("Beijing WangXun Technology Co., Ltd, <software@...stnetic.com>");
> -- 
> 2.38.1

[0] https://elixir.bootlin.com/linux/v6.1-rc5/source/net/sched/sch_generic.c#L547

Thanks,
Olek

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ