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]
Date:	Thu, 8 Mar 2012 20:41:06 +0100
From:	Francois Romieu <romieu@...zoreil.com>
To:	Parav.Pandit@...lex.Com
Cc:	netdev@...r.kernel.org
Subject: Re: [RFC 2/2] be2net: Added functionality to support RoCE driver

Parav.Pandit@...lex.Com <Parav.Pandit@...lex.Com> :
> From: Francois Romieu [romieu@...zoreil.com]
[...]
> You can init the adequate operations set at dev_add / registration time so
> that the remaining be_roce_dev_xyz methods turn into noop for NIC without
> ROCE.
> [Parav] What do we gain by executing NO_OP function, where there is no need to do that?

We do not execute anything for NIC without ROCE.

For the ROCE case, it costs a new set of net_device_ops where the .open() and
.close() callbacks are different from the ones in be_netdev_ops. The former
.open() and .close() call into the latter. The current code does the opposite.

> What is the problem in performing this check and not executing those function? I find it more simpler and clean.

It is not a big problem. ROCE depends on NIC. The implementation exhibits a
dependency in the opposite order.

> Also, add(), remove() etc operations are at driver level and not at device level. So with proposed implementation there is no need to store those 3 fn_pointers to device structure.

The functions pointers are already there. The driver .remove() handler can
not be replaced but it can exchange the be_roce_supported() test for a
!ocrdma_dev test. It should allow to remove if_type from be_adapter as
it won't be used beyond .probe() (I only did a quick check).

It is up to you to weigh the net_device_ops cost. If more methods need to be
modified for ROCE, the extra layer could be worth it. Your call.

Off for jogging.

-- 
Ueimor
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ