netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Antonio Quartulli <antonio@openvpn.net>
To: Sabrina Dubroca <sd@queasysnail.net>
Cc: netdev@vger.kernel.org, Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Donald Hunter <donald.hunter@gmail.com>,
	Shuah Khan <shuah@kernel.org>,
	ryazanov.s.a@gmail.com, Andrew Lunn <andrew+netdev@lunn.ch>,
	Simon Horman <horms@kernel.org>,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	Xiao Liang <shaw.leon@gmail.com>
Subject: Re: [PATCH net-next v23 18/23] ovpn: implement peer add/get/dump/delete via netlink
Date: Mon, 17 Mar 2025 14:13:23 +0100	[thread overview]
Message-ID: <729e6413-98fb-439b-ad33-830bb10d1016@openvpn.net> (raw)
In-Reply-To: <Z9gZ8l9mrF75M-Ih@krikkit>

On 17/03/2025 13:47, Sabrina Dubroca wrote:
> Hello,
> 
> A few comments since it seems you'll have to send one more version
> (otherwise they could be fixed later).
> 
> 2025-03-12, 21:54:27 +0100, Antonio Quartulli wrote:
>> diff --git a/drivers/net/ovpn/netlink.c b/drivers/net/ovpn/netlink.c
>> index 8d267d4c82283d9b5f989478102086ce385195d5..407b5b908be431625a3c258e7887211ef0f4b197 100644
>> --- a/drivers/net/ovpn/netlink.c
>> +++ b/drivers/net/ovpn/netlink.c
> [...]
>> +static int ovpn_nl_peer_modify(struct ovpn_peer *peer, struct genl_info *info,
>> +			       struct nlattr **attrs)
>> +{
>> +	struct sockaddr_storage ss = {};
>> +	void *local_ip = NULL;
>> +	u32 interv, timeout;
>> +	bool rehash = false;
>> +	int ret;
>> +
>> +	spin_lock_bh(&peer->lock);
>> +
>> +	if (ovpn_nl_attr_sockaddr_remote(attrs, &ss)) {
>> +		/* we carry the local IP in a generic container.
>> +		 * ovpn_peer_reset_sockaddr() will properly interpret it
>> +		 * based on ss.ss_family
>> +		 */
>> +		local_ip = ovpn_nl_attr_local_ip(attrs);
>> +
>> +		/* set peer sockaddr */
>> +		ret = ovpn_peer_reset_sockaddr(peer, &ss, local_ip);
>> +		if (ret < 0) {
>> +			NL_SET_ERR_MSG_FMT_MOD(info->extack,
>> +					       "cannot set peer sockaddr: %d",
>> +					       ret);
>> +			goto err_unlock;
>> +		}
> 
> Similar to the floating case, this should reset the peer dst_cache? In
> both cases we're updating the remote peer's address and our local
> address.
> 

makes sense.
Then I should probably move the call to dst_cache_reset() to 
ovpn_peer_reset_sockaddr() and slightly adjust 
ovpn_peer_endpoints_update() to avoid a double invocation.

> 
> ...
>> diff --git a/drivers/net/ovpn/peer.c b/drivers/net/ovpn/peer.c
>> index 0d8b12fd5de4cd6fe15455b435c7d6807203a825..aead1d75400a604a320c886aed5308fb20475da3 100644
>> --- a/drivers/net/ovpn/peer.c
>> +++ b/drivers/net/ovpn/peer.c
> ...
>> @@ -1335,8 +1356,11 @@ void ovpn_peer_keepalive_work(struct work_struct *work)
>>   		netdev_dbg(ovpn->dev,
>>   			   "scheduling keepalive work: now=%llu next_run=%llu delta=%llu\n",
>>   			   next_run, now, next_run - now);
>> +		/* due to the waiting above, the next_run deadline may have
>> +		 * passed: in this case we reschedule the worker immediately
>> +		 */
>>   		schedule_delayed_work(&ovpn->keepalive_work,
>> -				      (next_run - now) * HZ);
>> +				      (now - next_run) * HZ);
> 
> This whole hunk should be dropped, no? The comment is outdated, and
> the sign swap is confusing me.

ouch right. fix-during-rebase gone slightly wrong.

Thanks!

> 

-- 
Antonio Quartulli
OpenVPN Inc.


  reply	other threads:[~2025-03-17 13:13 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-12 20:54 [PATCH net-next v23 00/23] Introducing OpenVPN Data Channel Offload Antonio Quartulli
2025-03-12 20:54 ` [PATCH net-next v23 01/23] net: introduce OpenVPN Data Channel Offload (ovpn) Antonio Quartulli
2025-03-12 20:54 ` [PATCH net-next v23 02/23] ovpn: add basic netlink support Antonio Quartulli
2025-03-12 20:54 ` [PATCH net-next v23 03/23] ovpn: add basic interface creation/destruction/management routines Antonio Quartulli
2025-03-17  6:09   ` Qingfang Deng
2025-03-17  9:23     ` Antonio Quartulli
2025-03-17  9:41       ` Qingfang Deng
2025-03-17 10:00         ` Antonio Quartulli
2025-03-17 10:10           ` Qingfang Deng
2025-03-17 10:23             ` Antonio Quartulli
2025-03-12 20:54 ` [PATCH net-next v23 04/23] ovpn: keep carrier always on for MP interfaces Antonio Quartulli
2025-03-12 20:54 ` [PATCH net-next v23 05/23] ovpn: introduce the ovpn_peer object Antonio Quartulli
2025-03-12 20:54 ` [PATCH net-next v23 06/23] ovpn: introduce the ovpn_socket object Antonio Quartulli
2025-03-12 20:54 ` [PATCH net-next v23 07/23] ovpn: implement basic TX path (UDP) Antonio Quartulli
2025-03-12 20:54 ` [PATCH net-next v23 08/23] ovpn: implement basic RX " Antonio Quartulli
2025-03-12 20:54 ` [PATCH net-next v23 09/23] ovpn: implement packet processing Antonio Quartulli
2025-03-17  6:17   ` Qingfang Deng
2025-03-12 20:54 ` [PATCH net-next v23 10/23] ovpn: store tunnel and transport statistics Antonio Quartulli
2025-03-12 20:54 ` [PATCH net-next v23 11/23] ovpn: implement TCP transport Antonio Quartulli
2025-03-12 20:54 ` [PATCH net-next v23 12/23] skb: implement skb_send_sock_locked_with_flags() Antonio Quartulli
2025-03-12 20:54 ` [PATCH net-next v23 13/23] ovpn: add support for MSG_NOSIGNAL in tcp_sendmsg Antonio Quartulli
2025-03-12 20:54 ` [PATCH net-next v23 14/23] ovpn: implement multi-peer support Antonio Quartulli
2025-03-12 20:54 ` [PATCH net-next v23 15/23] ovpn: implement peer lookup logic Antonio Quartulli
2025-03-12 20:54 ` [PATCH net-next v23 16/23] ovpn: implement keepalive mechanism Antonio Quartulli
2025-03-12 20:54 ` [PATCH net-next v23 17/23] ovpn: add support for updating local or remote UDP endpoint Antonio Quartulli
2025-03-12 20:54 ` [PATCH net-next v23 18/23] ovpn: implement peer add/get/dump/delete via netlink Antonio Quartulli
2025-03-17 12:47   ` Sabrina Dubroca
2025-03-17 13:13     ` Antonio Quartulli [this message]
2025-03-12 20:54 ` [PATCH net-next v23 19/23] ovpn: implement key add/get/del/swap " Antonio Quartulli
2025-03-12 20:54 ` [PATCH net-next v23 20/23] ovpn: kill key and notify userspace in case of IV exhaustion Antonio Quartulli
2025-03-12 20:54 ` [PATCH net-next v23 21/23] ovpn: notify userspace when a peer is deleted Antonio Quartulli
2025-03-12 20:54 ` [PATCH net-next v23 22/23] ovpn: add basic ethtool support Antonio Quartulli
2025-03-12 20:54 ` [PATCH net-next v23 23/23] testing/selftests: add test tool and scripts for ovpn module Antonio Quartulli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=729e6413-98fb-439b-ad33-830bb10d1016@openvpn.net \
    --to=antonio@openvpn.net \
    --cc=andrew+netdev@lunn.ch \
    --cc=donald.hunter@gmail.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=ryazanov.s.a@gmail.com \
    --cc=sd@queasysnail.net \
    --cc=shaw.leon@gmail.com \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).