[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ea08fe87-0a95-443f-bbd8-8db12895fd99@intel.com>
Date: Fri, 16 Feb 2024 11:11:45 -0800
From: Jesse Brandeburg <jesse.brandeburg@...el.com>
To: Jakub Kicinski <kuba@...nel.org>
CC: <intel-wired-lan@...ts.osuosl.org>, <netdev@...r.kernel.org>, Ariel Elior
<aelior@...vell.com>, Sudarsana Kalluru <skalluru@...vell.com>, Manish Chopra
<manishc@...vell.com>, "David S. Miller" <davem@...emloft.net>, Eric Dumazet
<edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>, Raju Rangoju
<rajur@...lsio.com>, Tony Nguyen <anthony.l.nguyen@...el.com>, Jay Vosburgh
<jay.vosburgh@...onical.com>, Kory Maincent <kory.maincent@...tlin.com>,
Subbaraya Sundeep <sbhatta@...vell.com>, Richard Cochran
<richardcochran@...il.com>, Maxim Georgiev <glipus@...il.com>, Emeel Hakim
<ehakim@...dia.com>, Vadim Fedorenko <vadim.fedorenko@...ux.dev>
Subject: Re: [PATCH RFC net-next v1] net: rework FCOE and RFS ops
On 2/13/2024 6:13 PM, Jakub Kicinski wrote:
> On Fri, 9 Feb 2024 18:09:57 -0800 Jesse Brandeburg wrote:
>> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
>> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
>> @@ -10416,14 +10416,11 @@ static const struct net_device_ops ixgbe_netdev_ops = {
>> .ndo_setup_tc = __ixgbe_setup_tc,
>> #ifdef IXGBE_FCOE
>> .ndo_select_queue = ixgbe_select_queue,
>> - .ndo_fcoe_ddp_setup = ixgbe_fcoe_ddp_get,
>> - .ndo_fcoe_ddp_target = ixgbe_fcoe_ddp_target,
>> - .ndo_fcoe_ddp_done = ixgbe_fcoe_ddp_put,
>> - .ndo_fcoe_enable = ixgbe_fcoe_enable,
>> - .ndo_fcoe_disable = ixgbe_fcoe_disable,
>> - .ndo_fcoe_get_wwn = ixgbe_fcoe_get_wwn,
>> - .ndo_fcoe_get_hbainfo = ixgbe_fcoe_get_hbainfo,
>> #endif /* IXGBE_FCOE */
>> + SET_FCOE_OPS(ixgbe_fcoe_enable, ixgbe_fcoe_disable,
>> + ixgbe_fcoe_ddp_target, ixgbe_fcoe_ddp_get,
>> + ixgbe_fcoe_ddp_put, ixgbe_fcoe_get_hbainfo)
>> + SET_FCOE_GET_WWN_OPS(ixgbe_fcoe_get_wwn)
>> .ndo_set_features = ixgbe_set_features,
>> .ndo_fix_features = ixgbe_fix_features,
>> .ndo_fdb_add = ixgbe_ndo_fdb_add,
>
> If we'd be having a vote - I personally find the #ifdef far more
> readable.
I hear you there, BUT, the gain in "no mistakes" in CONFIG_FOO={y|n|m}
compatibility is non-trivial in my mind, *and* it removes all the ifdefs
around functions and a bunch of code from the drivers with
__maybe_unused etc.
Would it be less ugly if I used something else like a macro per
function/line?
Also, I was trying to migrate this ops subsystem "to start" and then do
others, so there is a larger discussion here. The PM infra already has
this kind of mechanism (see SET_SYSTEM_SLEEP_PM_OPS(),
SIMPLE_DEV_PM_OPS(), etc.
It also allows the compiler to discard the unused functions at link time.
Powered by blists - more mailing lists