[dpdk-dev] [PATCH v3 8/9] net/ionic: minor refactorings and helper variables

Ferruh Yigit ferruh.yigit at intel.com
Wed Dec 9 16:25:56 CET 2020


On 12/9/2020 2:39 PM, Andrew Boyer wrote:
> 
> 
>> On Dec 9, 2020, at 8:04 AM, Ferruh Yigit <ferruh.yigit at intel.com 
>> <mailto:ferruh.yigit at intel.com>> wrote:
>>
>> On 12/4/2020 8:16 PM, Andrew Boyer wrote:
>>> This makes the code clearer and conserves resources.
>>> Signed-off-by: Andrew Boyer <aboyer at pensando.io <mailto:aboyer at pensando.io>>
>>> ---
>>>  drivers/net/ionic/ionic_ethdev.c |  5 ++---
>>>  drivers/net/ionic/ionic_lif.c    | 15 ++++++++++-----
>>>  drivers/net/ionic/ionic_main.c   | 18 +++++++-----------
>>>  3 files changed, 19 insertions(+), 19 deletions(-)
>>> diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c
>>> index ce6ca9671..a1c35ace3 100644
>>> --- a/drivers/net/ionic/ionic_ethdev.c
>>> +++ b/drivers/net/ionic/ionic_ethdev.c
>>> @@ -901,7 +901,7 @@ ionic_dev_start(struct rte_eth_dev *eth_dev)
>>> struct ionic_lif *lif = IONIC_ETH_DEV_TO_LIF(eth_dev);
>>> struct ionic_adapter *adapter = lif->adapter;
>>> struct ionic_dev *idev = &adapter->idev;
>>> -uint32_t allowed_speeds;
>>> +uint32_t speed, allowed_speeds;
>>> int err;
>>> IONIC_PRINT_CALL();
>>> @@ -929,8 +929,7 @@ ionic_dev_start(struct rte_eth_dev *eth_dev)
>>> }
>>> if (eth_dev->data->dev_conf.link_speeds & ETH_LINK_SPEED_FIXED) {
>>> -uint32_t speed = ionic_parse_link_speeds(dev_conf->link_speeds);
>>> -
>>> +speed = ionic_parse_link_speeds(dev_conf->link_speeds);
>>> if (speed)
>>> ionic_dev_cmd_port_speed(idev, speed);
>>> }
>>
>> Same comment from previous version, what is the reason to increase the scope 
>> of the 'speed' variable?
>> Functionality is same and isn't it better to have reduced scope?
> 
> In a future patch I will be redesigning this code block and speed will have 
> function scope.
> 
> I have tried to break things up into digestible bits. Is this not acceptable?
> 

On its own this is not a good change, please do the update in the future patch.


More information about the dev mailing list