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 3/5] mptcp: add mptcp reset option support
Date: Thu, 12 Nov 2020 10:45:06 +0100	[thread overview]
Message-ID: <20201112094506.GJ23619@breakpoint.cc> (raw)
In-Reply-To: e068a2a6-a55c-9948-b323-6413c2cf95f@linux.intel.com

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

Mat Martineau <mathew.j.martineau(a)linux.intel.com> wrote:
> > #ifdef CONFIG_TCP_MD5SIG
> > -		__be32 opt[(TCPOLEN_MD5SIG_ALIGNED >> 2)];
> > +			   + (TCPOLEN_MD5SIG_ALIGNED >> 2)
> > #endif
> > +			];
> > 	} rep;
> > 	struct ip_reply_arg arg;
> > #ifdef CONFIG_TCP_MD5SIG
> > @@ -770,6 +772,23 @@ static void tcp_v4_send_reset(const struct sock *sk, struct sk_buff *skb)
> > 				     ip_hdr(skb)->daddr, &rep.th);
> > 	}
> > #endif
> > +	/* Can't co-exist with TCPMD5, hence check rep.opt[0] */
> 
> If they can't coexist, do we need space for both? (And, yes, I know I'm
> asking this after saying the single 32-bit value was not a big deal above)

Mhhh, that comment and ..

> > +	if (sk && sk_fullsock(sk) && sk_is_mptcp(sk) && rep.opt[0] == 0) {

the rep.opt[0] test can be removed.  I do not see how we can have
sk_is_mptcp() evaluate to true while md5sig is enabled at same time.

Wrt. space -- right, we do not need both, so maybe add

#ifdef CONFIG_TCP_MD5SIG
# define TCP_RST_OPTLEN_WORDS (TCPOLEN_MD5SIG_ALIGNED >> 2)
#else
# define TCP_RST_OPTLEN_WORDS (TCPOLEN_MPTCP_RST >> 2)
#endif

and use that instead for opt[] size.

> > +static noinline void mptcp_established_options_rst(struct sock *sk, struct sk_buff *skb,
> 
> I'm assuming this is 'noinline' to keep mptcp_established_options() code
> size slightly smaller in the cache?

Yes, the idea was that this code path rarely deals with tcp reset
packets so that there is no need for inlining.

> I'm ok with that, of course, but curious
> if you think (or have data) that further code size reduction on that fast
> path would be worthwhile.

No, I do not have data for that (and I would not mind removing the
noinline).

As for making more size reductions, I do not think it makes sense to look into
such micro optimizations at this time.

             reply	other threads:[~2020-11-12  9:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-12  9:45 Florian Westphal [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-11-12  9:56 [MPTCP] Re: [PATCH MPTCP 3/5] mptcp: add mptcp reset option support Florian Westphal
2020-11-12  1:30 Mat Martineau
2020-11-09  4:55 Geliang Tang

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=20201112094506.GJ23619@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.