From: Jakub Sitnicki <jkbs@redhat.com>
To: Xin Long <lucien.xin@gmail.com>
Cc: network dev <netdev@vger.kernel.org>,
linux-sctp@vger.kernel.org,
Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>,
Vlad Yasevich <vyasevich@gmail.com>,
daniel@iogearbox.net, davem@davemloft.net,
eric.dumazet@gmail.com
Subject: Re: [PATCHv3 net-next 4/6] sctp: add the sctp_diag.c file
Date: Thu, 14 Apr 2016 12:41:59 +0000 [thread overview]
Message-ID: <87r3e8s6p4.fsf@beetle.home> (raw)
In-Reply-To: <c48759e983ae5f9cefdd1805025abb7f57299886.1460618169.git.lucien.xin@gmail.com>
Hi Xin,
On Thu, Apr 14, 2016 at 09:35 AM CEST, Xin Long <lucien.xin@gmail.com> wrote:
> This one will implement all the interface of inet_diag, inet_diag_handler.
> which includes sctp_diag_dump, sctp_diag_dump_one and sctp_diag_get_info.
>
> It will work as a module, and register inet_diag_handler when loading.
>
> v2->v3:
> - fix the mistake in inet_assoc_attr_size().
>
> - change inet_diag_msg_laddrs_fill() name to inet_diag_msg_sctpladdrs_fill.
>
> - change inet_diag_msg_paddrs_fill() name to inet_diag_msg_sctpaddrs_fill.
>
> - add inet_diag_msg_sctpinfo_fill() to make asoc/ep fill code clearer.
>
> - add inet_diag_msg_sctpasoc_fill() to make asoc fill code clearer.
>
> - merge inet_asoc_diag_fill() and inet_ep_diag_fill() to
> inet_sctp_diag_fill().
>
> - call sctp_diag_get_info() directly, instead by handler, cause the caller
> is in the same file with it.
>
> - call lock_sock in sctp_tsp_dump_one() to make sure we call get sctp info
> safely.
>
> - after lock_sock(sk), we should check sk != assoc->base.sk.
>
> - change mem[SK_MEMINFO_WMEM_ALLOC] to asoc->sndbuf_used for asoc dump when
> asoc->ep->sndbuf_policy is set. don't use INET_DIAG_MEMINFO attr any more.
>
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
> ---
[...]
> diff --git a/net/sctp/sctp_diag.c b/net/sctp/sctp_diag.c
> new file mode 100644
> index 0000000..98ecd16
> --- /dev/null
> +++ b/net/sctp/sctp_diag.c
> @@ -0,0 +1,497 @@
[...]
> +#define EXPIRES_IN_MS(tmo) DIV_ROUND_UP((tmo - jiffies) * 1000, HZ)
> + r->idiag_expires > + EXPIRES_IN_MS(asoc->timeouts[SCTP_EVENT_TIMEOUT_T3_RTX]);
> +#undef EXPIRES_IN_MS
How about using jiffies_to_msecs() here? It's already being used
elsewhere in net/sctp.
AFAICT EXPIRES_IN_MS macro comes from net/ipv4/inet_diag.c and dates
back to before jiffies_to_msecs() has been introduced. Perhaps that's
why it's still used in inet_diag.c. But this is new code.
Thanks,
Jakub
WARNING: multiple messages have this Message-ID (diff)
From: Jakub Sitnicki <jkbs@redhat.com>
To: Xin Long <lucien.xin@gmail.com>
Cc: network dev <netdev@vger.kernel.org>,
linux-sctp@vger.kernel.org,
Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>,
Vlad Yasevich <vyasevich@gmail.com>,
daniel@iogearbox.net, davem@davemloft.net,
eric.dumazet@gmail.com
Subject: Re: [PATCHv3 net-next 4/6] sctp: add the sctp_diag.c file
Date: Thu, 14 Apr 2016 14:41:59 +0200 [thread overview]
Message-ID: <87r3e8s6p4.fsf@beetle.home> (raw)
In-Reply-To: <c48759e983ae5f9cefdd1805025abb7f57299886.1460618169.git.lucien.xin@gmail.com>
Hi Xin,
On Thu, Apr 14, 2016 at 09:35 AM CEST, Xin Long <lucien.xin@gmail.com> wrote:
> This one will implement all the interface of inet_diag, inet_diag_handler.
> which includes sctp_diag_dump, sctp_diag_dump_one and sctp_diag_get_info.
>
> It will work as a module, and register inet_diag_handler when loading.
>
> v2->v3:
> - fix the mistake in inet_assoc_attr_size().
>
> - change inet_diag_msg_laddrs_fill() name to inet_diag_msg_sctpladdrs_fill.
>
> - change inet_diag_msg_paddrs_fill() name to inet_diag_msg_sctpaddrs_fill.
>
> - add inet_diag_msg_sctpinfo_fill() to make asoc/ep fill code clearer.
>
> - add inet_diag_msg_sctpasoc_fill() to make asoc fill code clearer.
>
> - merge inet_asoc_diag_fill() and inet_ep_diag_fill() to
> inet_sctp_diag_fill().
>
> - call sctp_diag_get_info() directly, instead by handler, cause the caller
> is in the same file with it.
>
> - call lock_sock in sctp_tsp_dump_one() to make sure we call get sctp info
> safely.
>
> - after lock_sock(sk), we should check sk != assoc->base.sk.
>
> - change mem[SK_MEMINFO_WMEM_ALLOC] to asoc->sndbuf_used for asoc dump when
> asoc->ep->sndbuf_policy is set. don't use INET_DIAG_MEMINFO attr any more.
>
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
> ---
[...]
> diff --git a/net/sctp/sctp_diag.c b/net/sctp/sctp_diag.c
> new file mode 100644
> index 0000000..98ecd16
> --- /dev/null
> +++ b/net/sctp/sctp_diag.c
> @@ -0,0 +1,497 @@
[...]
> +#define EXPIRES_IN_MS(tmo) DIV_ROUND_UP((tmo - jiffies) * 1000, HZ)
> + r->idiag_expires =
> + EXPIRES_IN_MS(asoc->timeouts[SCTP_EVENT_TIMEOUT_T3_RTX]);
> +#undef EXPIRES_IN_MS
How about using jiffies_to_msecs() here? It's already being used
elsewhere in net/sctp.
AFAICT EXPIRES_IN_MS macro comes from net/ipv4/inet_diag.c and dates
back to before jiffies_to_msecs() has been introduced. Perhaps that's
why it's still used in inet_diag.c. But this is new code.
Thanks,
Jakub
next prev parent reply other threads:[~2016-04-14 12:41 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-14 7:35 [PATCHv3 net-next 0/6] sctp: support sctp_diag in kernel Xin Long
2016-04-14 7:35 ` Xin Long
2016-04-14 7:35 ` [PATCHv3 net-next 1/6] sctp: add sctp_info dump api for sctp_diag Xin Long
2016-04-14 7:35 ` Xin Long
2016-04-14 7:35 ` [PATCHv3 net-next 2/6] sctp: export some apis or variables for sctp_diag and reuse some for proc Xin Long
2016-04-14 7:35 ` Xin Long
2016-04-14 7:35 ` [PATCHv3 net-next 3/6] sctp: export some functions for sctp_diag in inet_diag Xin Long
2016-04-14 7:35 ` Xin Long
2016-04-14 7:35 ` [PATCHv3 net-next 4/6] sctp: add the sctp_diag.c file Xin Long
2016-04-14 7:35 ` Xin Long
2016-04-14 7:35 ` [PATCHv3 net-next 5/6] sctp: merge the seq_start/next/exits in remaddrs and assocs Xin Long
2016-04-14 7:35 ` Xin Long
2016-04-14 7:35 ` [PATCHv3 net-next 6/6] sctp: fix some rhashtable functions using in sctp proc/diag Xin Long
2016-04-14 7:35 ` Xin Long
2016-04-14 12:41 ` Jakub Sitnicki [this message]
2016-04-14 12:41 ` [PATCHv3 net-next 4/6] sctp: add the sctp_diag.c file Jakub Sitnicki
2016-04-14 9:13 ` [PATCHv3 net-next 1/6] sctp: add sctp_info dump api for sctp_diag Phil Sutter
2016-04-14 9:13 ` Phil Sutter
2016-04-15 21:28 ` David Miller
2016-04-15 21:28 ` David Miller
2016-04-18 10:18 ` Phil Sutter
2016-04-18 10:18 ` Phil Sutter
2016-04-15 21:30 ` [PATCHv3 net-next 0/6] sctp: support sctp_diag in kernel David Miller
2016-04-15 21:30 ` David Miller
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=87r3e8s6p4.fsf@beetle.home \
--to=jkbs@redhat.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=linux-sctp@vger.kernel.org \
--cc=lucien.xin@gmail.com \
--cc=marcelo.leitner@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=vyasevich@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.