All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philp Prindeville <philipp@redfish-solutions.com>
To: Feng Gao <gfree.wind@gmail.com>
Cc: fgao@48lvckh6395k16k5.yundunddos.com,
	"David S. Miller" <davem@davemloft.net>,
	Stephen Hemminger <stephen@networkplumber.org>,
	Pravin B Shelar <pshelar@nicira.com>,
	Tom Herbert <tom@herbertland.com>,
	Alex Duyck <aduyck@mirantis.com>,
	Linux Kernel Network Developers <netdev@vger.kernel.org>
Subject: Re: [PATCH 1/1] rps: Inspect PPTP encapsulated by GRE to get flow hash
Date: Tue, 2 Aug 2016 11:33:27 -0600	[thread overview]
Message-ID: <29507597-6977-cbe1-3983-1e8e30c94f0b@redfish-solutions.com> (raw)
In-Reply-To: <CA+6hz4p2Z+Va2GNuRpcp3MRc5V_Yf0Bf7ut7QsAxTRBtFg9u9Q@mail.gmail.com>

Inline...


On 08/02/2016 12:10 AM, Feng Gao wrote:
> Thanks.
> Because the original GRE uses the literal number directly, so I follow
> this style.
>
> Then I have two questions.
> 1. pptp_gre_header is defined in "drivers/net/ppp/pptp.c"; If we want
> to use it, need to create one new header file, is it ok ?

Yes, I would move the relevant constants and packet structures into 
include/net/pptp.h ...

While you're at it, there are places like:

     islcp = ((data[0] << 8) + data[1]) == PPP_LCP && 1 <= data[2] && 
data[2] <= 7;

that should be written as:

     islcp = PPP_PROTOCOL(data-2) == PPP_LCP && CP_CONF_REQ <= data[2] 
&& data[2] <= CP_CODE_REJ;

Similarly for:

                 data[0] = PPP_ALLSTATIONS;
                 data[1] = PPP_UI;

that should be using:

         PPP_ADDRESS(data) = PPP_ALLSTATIONS;
         PPP_CONTROL(data) = PPP_UI;

etc. but this cleanup can go in a 2nd patch.  The definitions for 
CONFREQ and CONFACK and CP_CONF_REQ and CP_CONF_ACK and PPP_LCP_ECHOREQ 
and PPP_LCP_ECHOREP are redundant and probably should all go into 
ppp_defs.h as well (which would require refactoring 
drivers/net/ppp/ppp_async.c).


> 2. The GRE version 0 patch could use the sizeof pptp_gre_header.seq ?

Actually, since you're going to be doing the pptp.h header anyway, I'd 
add a v0 as well as a v1 struct just to be more clear/concise.

-Philip

> Best Regards
> Feng
>
>
[snip]

  reply	other threads:[~2016-08-02 18:23 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-28  7:14 [PATCH 1/1] rps: Inspect PPTP encapsulated by GRE to get flow hash fgao
2016-08-02  1:36 ` Philp Prindeville
2016-08-02  6:10   ` Feng Gao
2016-08-02 17:33     ` Philp Prindeville [this message]
2016-08-03  0:22       ` Feng Gao
2016-08-02 20:35 ` Tom Herbert
2016-08-03  0:28   ` Feng Gao
2016-08-03  1:11     ` Philip Prindeville
2016-08-03  1:59     ` Tom Herbert
2016-08-03  2:17       ` Feng Gao
2016-08-03  4:01         ` Tom Herbert
2016-08-03 15:02           ` Feng Gao
  -- strict thread matches above, loose matches on Subject: below --
2016-07-27 23:42 fgao
2016-07-28  0:04 ` Tom Herbert
2016-07-28  0:24   ` Feng Gao
2016-07-28  0:35     ` Feng Gao
2016-07-28  0:46   ` Philp Prindeville
2016-08-01  7:36     ` Feng Gao

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=29507597-6977-cbe1-3983-1e8e30c94f0b@redfish-solutions.com \
    --to=philipp@redfish-solutions.com \
    --cc=aduyck@mirantis.com \
    --cc=davem@davemloft.net \
    --cc=fgao@48lvckh6395k16k5.yundunddos.com \
    --cc=gfree.wind@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pshelar@nicira.com \
    --cc=stephen@networkplumber.org \
    --cc=tom@herbertland.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.