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: <54D3EFDB.9060300@ti.com>
Date:	Thu, 5 Feb 2015 17:34:03 -0500
From:	Murali Karicheri <m-karicheri2@...com>
To:	Tony Lindgren <tony@...mide.com>
CC:	Arnd Bergmann <arnd@...db.de>, <w-kwok2@...com>,
	<davem@...emloft.net>, <mugunthanvnm@...com>,
	<prabhakar.csengg@...il.com>, <grygorii.strashko@...com>,
	<lokeshvutla@...com>, <mpa@...gutronix.de>,
	<lsorense@...lub.uwaterloo.ca>, <netdev@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next] drivers: net: cpsw: make cpsw_ale.c a module
 to allow re-use on Keystone

On 02/02/2015 11:40 AM, Tony Lindgren wrote:
> * Arnd Bergmann<arnd@...db.de>  [150129 15:51]:
>> On Thursday 29 January 2015 18:15:51 Murali Karicheri wrote:
>>> NetCP on Keystone has cpsw ale function similar to other TI SoCs
>>> and this driver is re-used. To allow both ti cpsw and keystone netcp
>>> to re-use the driver, convert the cpsw ale to a module and configure
>>> it through Kconfig option CONFIG_TI_CPSW_ALE. Currently it is statically
>>> linked to both TI CPSW and NetCP and this causes issues when the above
>>> drivers are built as dynamic modules. This patch addresses this issue
>>>
>>> While at it, fix the Makefile and code to build both netcp_core and
>>> netcp_ethss as dynamic modules. This is needed to support arm allmodconfig.
>>> This also requires exporting of API calls provided by netcp_core so that
>>> both the above can be dynamic modules.
>>>
>>> Signed-off-by: Murali Karicheri<m-karicheri2@...com>
>>> ---
>>>   drivers/net/ethernet/ti/Kconfig       |   19 +++++++++++++++++--
>>>   drivers/net/ethernet/ti/Makefile      |    8 +++++---
>>>   drivers/net/ethernet/ti/cpsw_ale.c    |   26 ++++++++++++++++++++++++--
>>>   drivers/net/ethernet/ti/netcp_core.c  |    8 ++++++++
>>>   drivers/net/ethernet/ti/netcp_ethss.c |    5 +++++
>>>   5 files changed, 59 insertions(+), 7 deletions(-)
>>
>> I was hoping there would be a way without exporting all those symbols, but
>> I also couldn't come up with a better solution. I'm putting this into the
>> randconfig build test for now, but I'm guessing it's fine.
>
> Probably the best way in the long run is to add a single exported
> function to cpsw-common.c I just added for the MAC address function.

If understand correctly, what you have done is moved the common mac 
function and exported the function in cpsw-common.c and called it from 
cpsw.c. How is this any different from exporting all common functions 
from cpsw_ale.c as is done today? Not sure what you meant by a single 
exported function. Are you talking about defining a ale_ops struct of 
function ptrs and exporting that instead of individual functions? So

cpsw_ale_common.c
   Move all of the common functions here and define them as static.
   Defined cpsw_ale_ops and export it.
   cpsw.c and netcp_ethss.c calls something like

   cpsw_ale_ops.foo();

Murali

>
> Then all the cpsw like drivers can register with that instead of
> having tons of custom exported functions.
>
> But before doing that, we should have a clear idea what all can
> be shared. Murali, maybe you can take a look at that?
>
> Regards,
>
> Tony


-- 
Murali Karicheri
Linux Kernel, Texas Instruments
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ