From: Cong Wang <xiyou.wangcong@gmail.com>
To: James Chapman <jchapman@katalix.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, dsahern@kernel.org,
tparkin@katalix.com, horms@kernel.org
Subject: Re: [PATCH v2 net-next 6/9] l2tp: use get_next APIs for management requests and procfs/debugfs
Date: Wed, 14 Aug 2024 11:05:05 -0700 [thread overview]
Message-ID: <Zrzx0RimFyQw063m@pop-os.localdomain> (raw)
In-Reply-To: <6730f50c-929d-aaed-0282-60eb321f8679@katalix.com>
On Mon, Aug 12, 2024 at 09:14:42AM +0100, James Chapman wrote:
> On 11/08/2024 19:36, Cong Wang wrote:
> > On Wed, Aug 07, 2024 at 07:54:49AM +0100, James Chapman wrote:
> > > diff --git a/net/l2tp/l2tp_core.h b/net/l2tp/l2tp_core.h
> > > index cc464982a7d9..0fabacffc3f3 100644
> > > --- a/net/l2tp/l2tp_core.h
> > > +++ b/net/l2tp/l2tp_core.h
> > > @@ -219,14 +219,12 @@ void l2tp_session_dec_refcount(struct l2tp_session *session);
> > > * the caller must ensure that the reference is dropped appropriately.
> > > */
> > > struct l2tp_tunnel *l2tp_tunnel_get(const struct net *net, u32 tunnel_id);
> > > -struct l2tp_tunnel *l2tp_tunnel_get_nth(const struct net *net, int nth);
> > > struct l2tp_tunnel *l2tp_tunnel_get_next(const struct net *net, unsigned long *key);
> > > struct l2tp_session *l2tp_v3_session_get(const struct net *net, struct sock *sk, u32 session_id);
> > > struct l2tp_session *l2tp_v2_session_get(const struct net *net, u16 tunnel_id, u16 session_id);
> > > struct l2tp_session *l2tp_session_get(const struct net *net, struct sock *sk, int pver,
> > > u32 tunnel_id, u32 session_id);
> > > -struct l2tp_session *l2tp_session_get_nth(struct l2tp_tunnel *tunnel, int nth);
> > > struct l2tp_session *l2tp_session_get_next(const struct net *net, struct sock *sk, int pver,
> > > u32 tunnel_id, unsigned long *key);
> > > struct l2tp_session *l2tp_session_get_by_ifname(const struct net *net,
> > > diff --git a/net/l2tp/l2tp_debugfs.c b/net/l2tp/l2tp_debugfs.c
> > > index 8755ae521154..b2134b57ed18 100644
> > > --- a/net/l2tp/l2tp_debugfs.c
> > > +++ b/net/l2tp/l2tp_debugfs.c
> > > @@ -34,8 +34,8 @@ static struct dentry *rootdir;
> > > struct l2tp_dfs_seq_data {
> > > struct net *net;
> > > netns_tracker ns_tracker;
> > > - int tunnel_idx; /* current tunnel */
> > > - int session_idx; /* index of session within current tunnel */
> > > + unsigned long tkey; /* lookup key of current tunnel */
> > > + unsigned long skey; /* lookup key of current session */
> >
> > Any reason to change the type from int to unsigned long?
> >
> > Asking because tunnel ID remains to be 32bit unsigned int as a part of
> > UAPI.
> >
> > Thanks.
>
> It's used as the key in and potentially modified by idr_get_next_ul calls.
idr_get_next() takes an `int` ID. So the reason is not this API, it must be
something else.
next prev parent reply other threads:[~2024-08-14 18:05 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-07 6:54 [PATCH v2 net-next 0/9] l2tp: misc improvements James Chapman
2024-08-07 6:54 ` [PATCH v2 net-next 1/9] documentation/networking: update l2tp docs James Chapman
2024-08-07 6:54 ` [PATCH v2 net-next 2/9] l2tp: remove inline from functions in c sources James Chapman
2024-08-07 6:54 ` [PATCH v2 net-next 3/9] l2tp: move l2tp_ip and l2tp_ip6 data to pernet James Chapman
2024-08-07 6:54 ` [PATCH v2 net-next 4/9] l2tp: handle hash key collisions in l2tp_v3_session_get James Chapman
2024-08-07 6:54 ` [PATCH v2 net-next 5/9] l2tp: add tunnel/session get_next helpers James Chapman
2024-08-07 6:54 ` [PATCH v2 net-next 6/9] l2tp: use get_next APIs for management requests and procfs/debugfs James Chapman
2024-08-11 18:36 ` Cong Wang
2024-08-12 8:14 ` James Chapman
2024-08-14 18:05 ` Cong Wang [this message]
2024-08-15 8:21 ` James Chapman
2024-08-07 6:54 ` [PATCH v2 net-next 7/9] l2tp: improve tunnel/session refcount helpers James Chapman
2024-08-07 6:54 ` [PATCH v2 net-next 8/9] l2tp: l2tp_eth: use per-cpu counters from dev->tstats James Chapman
2024-08-07 6:54 ` [PATCH v2 net-next 9/9] l2tp: flush workqueue before draining it James Chapman
2024-08-11 17:54 ` Cong Wang
2024-08-12 9:24 ` James Chapman
2024-08-14 18:01 ` Cong Wang
2024-08-11 3:52 ` [PATCH v2 net-next 0/9] l2tp: misc improvements patchwork-bot+netdevbpf
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=Zrzx0RimFyQw063m@pop-os.localdomain \
--to=xiyou.wangcong@gmail.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jchapman@katalix.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=tparkin@katalix.com \
/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