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: Tue, 1 Aug 2023 16:12:27 +0100
From: Vadim Fedorenko <vadim.fedorenko@...ux.dev>
To: Jiri Pirko <jiri@...nulli.us>, Jiri Pirko <jiri@...dia.com>
Cc: Milena Olech <milena.olech@...el.com>,
 Michal Michalik <michal.michalik@...el.com>,
 linux-arm-kernel@...ts.infradead.org, poros@...hat.com, mschmidt@...hat.com,
 netdev@...r.kernel.org, linux-clk@...r.kernel.org,
 Bart Van Assche <bvanassche@....org>, Jakub Kicinski <kuba@...nel.org>,
 Arkadiusz Kubalewski <arkadiusz.kubalewski@...el.com>,
 Paolo Abeni <pabeni@...hat.com>, Jonathan Lemon <jonathan.lemon@...il.com>
Subject: Re: [PATCH net-next 07/11] netdev: expose DPLL pin handle for
 netdevice

On 01/08/2023 14:23, Vadim Fedorenko wrote:
> On 20/07/2023 10:18, Vadim Fedorenko wrote:
>> From: Jiri Pirko <jiri@...dia.com>
>>
>> In case netdevice represents a SyncE port, the user needs to understand
>> the connection between netdevice and associated DPLL pin. There might me
>> multiple netdevices pointing to the same pin, in case of VF/SF
>> implementation.
>>
>> Add a IFLA Netlink attribute to nest the DPLL pin handle, similar to
>> how it is implemented for devlink port. Add a struct dpll_pin pointer
>> to netdev and protect access to it by RTNL. Expose netdev_dpll_pin_set()
>> and netdev_dpll_pin_clear() helpers to the drivers so they can set/clear
>> the DPLL pin relationship to netdev.
>>
>> Note that during the lifetime of struct dpll_pin the pin handle does not
>> change. Therefore it is save to access it lockless. It is drivers
>> responsibility to call netdev_dpll_pin_clear() before dpll_pin_put().
>>
>> Signed-off-by: Jiri Pirko <jiri@...dia.com>
>> Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@...el.com>
>> Signed-off-by: Vadim Fedorenko <vadim.fedorenko@...ux.dev>
>> ---
>> RFC v9->v0:
>> - rearrange function definition according to usage
>> v8->v9:
>> - net_device->dpll_pin is only valid if IS_ENABLED(CONFIG_DPLL) fix the
>>    code in net/core/rtnetlink.c to respect that.
>> - move dpll_msg_add_pin_handle to "dpll: netlink" patch + export the
>>    function with this patch
>>
>>   drivers/dpll/dpll_netlink.c  | 19 ++++++++++++++++---
>>   include/linux/dpll.h         | 20 ++++++++++++++++++++
>>   include/linux/netdevice.h    | 20 ++++++++++++++++++++
>>   include/uapi/linux/if_link.h |  2 ++
>>   net/core/dev.c               | 22 ++++++++++++++++++++++
>>   net/core/rtnetlink.c         | 35 +++++++++++++++++++++++++++++++++++
>>   6 files changed, 115 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/dpll/dpll_netlink.c b/drivers/dpll/dpll_netlink.c
>> index c44dda78737d..e4a9bd767b92 100644
>> --- a/drivers/dpll/dpll_netlink.c
>> +++ b/drivers/dpll/dpll_netlink.c
>> @@ -37,6 +37,18 @@ dpll_msg_add_dev_handle(struct sk_buff *msg, struct 
>> dpll_device *dpll)
>>       return 0;
>>   }
>> +/**
>> + * dpll_msg_pin_handle_size - get size of pin handle attribute for 
>> given pin
>> + * @pin: pin pointer
>> + *
>> + * Return: byte size of pin handle attribute for given pin.
>> + */
>> +size_t dpll_msg_pin_handle_size(struct dpll_pin *pin)
>> +{
>> +    return pin ? nla_total_size(4) : 0; /* DPLL_A_PIN_ID */
>> +}
>> +EXPORT_SYMBOL_GPL(dpll_msg_pin_handle_size);
>> +
>>   /**
>>    * dpll_msg_add_pin_handle - attach pin handle attribute to a given 
>> message
>>    * @msg: pointer to sk_buff message to attach a pin handle
>> @@ -54,6 +66,7 @@ int dpll_msg_add_pin_handle(struct sk_buff *msg, 
>> struct dpll_pin *pin)
>>           return -EMSGSIZE;
>>       return 0;
>>   }
>> +EXPORT_SYMBOL_GPL(dpll_msg_add_pin_handle);
> 
> Jiri, could you please remind me what is the reason to export this 
> function? Because I cannot
> any usage of this function in drivers.
> 

Ah, found it, sorry for the noise.

> 
> [....]


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ