All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw at strlen.de>
To: mptcp at lists.01.org
Subject: [MPTCP] Re: [PATCH] mptcp:diag: prefix exposed items
Date: Fri, 04 Oct 2019 19:35:29 +0200	[thread overview]
Message-ID: <20191004173529.GI13866@breakpoint.cc> (raw)
In-Reply-To: 2c9a6fc9af5a110fec21d20aaf4e7b35a6f3edb6.camel@redhat.com

[-- Attachment #1: Type: text/plain, Size: 1814 bytes --]

Davide Caratti <dcaratti(a)redhat.com> wrote:
> > > > +#define MPTCP_SUBFLOW_FLAGS_4THACK	BIT(6)
> > > > +#define MPTCP_SUBFLOW_FLAGS_CONNECTED	BIT(7)
> > > > +#define MPTCP_SUBFLOW_FLAGS_MAPVALID	BIT(8)
> > > 
> > > but then names may become too long and might hurt eyes that read misc/ss.c
> > > . Maybe the word 'FLAG' is pleonastic, since we are talking about BIT(x)
> > > of a netlink attribute whose name is MPTCP_SUBFLOW_FLAGS.
> > > 
> > > What about MPTCP_SUBFLOW_F_<...> ?
> > 
> > I can understand that names can be too long. For me, that's fine, at
> > least it is clear :-)
> 
> > Another idea could be to use "_SF_" instead of subflow. But still, I
> > think the best is to have something clear for everybody and only remove
> > the useless "S". But I am happy to short them more if it is needed!
> 
> just did a friday experiment with uAPI #defines:
> 
> $ while read -r a b _; do c=`echo $b | wc -c`; echo $c; done >data.txt <<-EOF
> `grep -r '#define' include/uapi/linux/*`
> EOF
> 
> roughly 95% of the values of $c are below 29 characters, which is the
> length of MPTCP_SUBFLOW_FLAGS_CONNECTED. So, if we remove the useless 'S',
> we can safely say that MPTCP is not a statistic anomaly.
>
> then, I'm ok with MPTCP_SUBFLOW_FLAG_<xxx>.

I'm fine with that as well.  Another alternative is to drop the _FLAG
and append _BIT, i.e.  MPTCP_SUBFLOW_CONNECTED_BIT, and so on.

> void mtcp_diag_subflow_init(truct tcp_ulp_ops * ops);
> 
> that does:
> 
> void mtcp_diag_subflow_init(truct tcp_ulp_ops * ops)
> {
> 	ops->get_info = subflow_get_info;
> 	ops->get_info_size = subflow_get_info_size;
> }
> 
> can be exported from diag,c, and called in mptcp_subflow_init(), before
> registering the ULP.
> 
> how does that sound?

Sounds good to me, thanks.

             reply	other threads:[~2019-10-04 17:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-04 17:35 Florian Westphal [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-10-05  8:46 [MPTCP] Re: [PATCH] mptcp:diag: prefix exposed items Matthieu Baerts
2019-10-05  8:41 Matthieu Baerts
2019-10-04 17:02 Davide Caratti
2019-10-03  9:41 Matthieu Baerts
2019-10-03  8:56 Davide Caratti

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=20191004173529.GI13866@breakpoint.cc \
    --to=unknown@example.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.