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] [day] [month] [year] [list]
Message-ID: <SJ2PR11MB845204F3E5CDBBF5CB34FE969B99A@SJ2PR11MB8452.namprd11.prod.outlook.com>
Date: Thu, 22 May 2025 16:42:40 +0000
From: "Kubalewski, Arkadiusz" <arkadiusz.kubalewski@...el.com>
To: Jiri Pirko <jiri@...nulli.us>
CC: "donald.hunter@...il.com" <donald.hunter@...il.com>, "kuba@...nel.org"
	<kuba@...nel.org>, "davem@...emloft.net" <davem@...emloft.net>,
	"edumazet@...gle.com" <edumazet@...gle.com>, "pabeni@...hat.com"
	<pabeni@...hat.com>, "horms@...nel.org" <horms@...nel.org>,
	"vadim.fedorenko@...ux.dev" <vadim.fedorenko@...ux.dev>, "Nguyen, Anthony L"
	<anthony.l.nguyen@...el.com>, "Kitszel, Przemyslaw"
	<przemyslaw.kitszel@...el.com>, "andrew+netdev@...n.ch"
	<andrew+netdev@...n.ch>, "Loktionov, Aleksandr"
	<aleksandr.loktionov@...el.com>, "netdev@...r.kernel.org"
	<netdev@...r.kernel.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, "intel-wired-lan@...ts.osuosl.org"
	<intel-wired-lan@...ts.osuosl.org>, "linux-rdma@...r.kernel.org"
	<linux-rdma@...r.kernel.org>, "Olech, Milena" <milena.olech@...el.com>
Subject: RE: [PATCH net-next v2 2/3] dpll: add Reference SYNC get/set

>From: Jiri Pirko <jiri@...nulli.us>
>Sent: Saturday, May 10, 2025 6:48 AM
>

[..]

>>
>>+static int
>>+dpll_pin_ref_sync_state_set(struct dpll_pin *pin, unsigned long
>>sync_pin_idx,
>>+			    const enum dpll_pin_state state,
>>+			    struct netlink_ext_ack *extack)
>>+
>>+{
>>+	struct dpll_pin_ref *ref, *failed;
>>+	const struct dpll_pin_ops *ops;
>>+	enum dpll_pin_state old_state;
>>+	struct dpll_pin *sync_pin;
>>+	struct dpll_device *dpll;
>>+	unsigned long i;
>>+	int ret;
>>+
>>+	if (state != DPLL_PIN_STATE_CONNECTED &&
>>+	    state != DPLL_PIN_STATE_DISCONNECTED)
>>+		return -EINVAL;
>>+	sync_pin = xa_find(&pin->ref_sync_pins, &sync_pin_idx, ULONG_MAX,
>>+			   XA_PRESENT);
>>+	if (!sync_pin) {
>>+		NL_SET_ERR_MSG(extack, "reference sync pin not found");
>>+		return -EINVAL;
>>+	}
>>+	if (!dpll_pin_available(sync_pin)) {
>>+		NL_SET_ERR_MSG(extack, "reference sync pin not available");
>>+		return -EINVAL;
>>+	}
>>+	ref = dpll_xa_ref_dpll_first(&pin->dpll_refs);
>>+	ASSERT_NOT_NULL(ref);
>>+	ops = dpll_pin_ops(ref);
>>+	if (!ops->ref_sync_set || !ops->ref_sync_get) {
>>+		NL_SET_ERR_MSG(extack, "reference sync not supported by this
>>pin");
>>+		return -EOPNOTSUPP;
>>+	}
>>+	dpll = ref->dpll;
>>+	ret = ops->ref_sync_get(pin, dpll_pin_on_dpll_priv(dpll, pin),
>sync_pin,
>>+				dpll_pin_on_dpll_priv(dpll, sync_pin),
>>+				&old_state, extack);
>>+	if (ret) {
>>+		NL_SET_ERR_MSG(extack, "unable to get old reference sync
>>state");
>>+		return -EINVAL;
>
>Propagate ret. Not sure why you ignored my comment about this.
>

Not ignored, this was on the other series, just missed it, fixed in v3.

>
>
>>+	}
>>+	if (state == old_state)
>>+		return 0;
>>+	xa_for_each(&pin->dpll_refs, i, ref) {
>>+		ops = dpll_pin_ops(ref);
>>+		dpll = ref->dpll;
>>+		ret = ops->ref_sync_set(pin, dpll_pin_on_dpll_priv(dpll, pin),
>>+					sync_pin,
>>+					dpll_pin_on_dpll_priv(dpll, sync_pin),
>>+					state, extack);
>>+		if (ret) {
>>+			failed = ref;
>>+			NL_SET_ERR_MSG_FMT(extack, "reference sync set failed for
>dpll_id:%u",
>>+					   dpll->id);
>
>Why you print id? User knows what he works on, don't he?
>

This is for easier debugging in case multiple parent dpll devices, that
pin can be connected with. If that fails on one it is better to know which
one caused failure.

Thank you!
Arkadiusz

[...]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ