netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Fan Du <fan.du@windriver.com>, davem@davemloft.net
Cc: steffen.klassert@secunet.com, hadi@cyberus.ca, netdev@vger.kernel.org
Subject: Re: [PATCHv3 net-next 6/7] {pktgen, xfrm} Introduce xfrm_state_lookup_byspi for pktgen
Date: Sun, 15 Dec 2013 23:42:38 +0300	[thread overview]
Message-ID: <52AE143E.3020807@cogentembedded.com> (raw)
In-Reply-To: <1387094284-2901-7-git-send-email-fan.du@windriver.com>

Hello.

On 12/15/2013 10:58 AM, Fan Du wrote:

> Introduce xfrm_state_lookup_byspi to find user specified by custom
> from "pgset spi xxx". Using this scheme, any flow regardless its
> saddr/daddr could be transform by SA specified with configurable
> spi.

> Signed-off-by: Fan Du <fan.du@windriver.com>
[...]

> diff --git a/net/core/pktgen.c b/net/core/pktgen.c
> index eb70c23..ae268ff 100644
> --- a/net/core/pktgen.c
> +++ b/net/core/pktgen.c
> @@ -2247,13 +2247,21 @@ static void get_ipsec_sa(struct pktgen_dev *pkt_dev, int flow)
>   	struct xfrm_state *x = pkt_dev->flows[flow].x;
>   	struct pktgen_net *pn = net_generic(dev_net(pkt_dev->odev), pg_net_id);
>   	if (!x) {
> -		/*slow path: we dont already have xfrm_state*/
> -		x = xfrm_stateonly_find(pn->net, DUMMY_MARK,
> -					(xfrm_address_t *)&pkt_dev->cur_daddr,
> -					(xfrm_address_t *)&pkt_dev->cur_saddr,
> -					AF_INET,
> -					pkt_dev->ipsmode,
> -					pkt_dev->ipsproto, 0);
> +
> +		if (pkt_dev->spi) {
> +			/* We need as quick as possible to find the right SA
> +		 	 * Searching with minimum criteria to archieve this.
> +		 	 */
> +			x = xfrm_state_lookup_byspi(pn->net, htonl(pkt_dev->spi), AF_INET);
> +		} else {
> +			/*slow path: we dont already have xfrm_state*/

    Could you insert spaces after /* and before */, while at it?

WBR, Sergei

  reply	other threads:[~2013-12-15 19:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-15  7:57 [PATCHv3 net-next 0/7] pktgen IPsec support Fan Du
2013-12-15  7:57 ` [PATCHv3 net-next 1/7] {pktgen, xfrm} Correct xfrm state lock usage when transforming Fan Du
2013-12-15  7:57 ` [PATCHv3 net-next 2/7] {pktgen, xfrm} Add statistics counting " Fan Du
2013-12-15  7:58 ` [PATCHv3 net-next 3/7] {pktgen, xfrm} Correct xfrm_state_lock usage in xfrm_stateonly_find Fan Du
2013-12-15  7:58 ` [PATCHv3 net-next 4/7] {pktgen, xfrm} Using "pgset spi xxx" to spedifiy SA for a given flow Fan Du
2013-12-15  7:58 ` [PATCHv3 net-next 5/7] {pktgen, xfrm} Construct skb dst for tunnel mode transformation Fan Du
2013-12-15  7:58 ` [PATCHv3 net-next 6/7] {pktgen, xfrm} Introduce xfrm_state_lookup_byspi for pktgen Fan Du
2013-12-15 20:42   ` Sergei Shtylyov [this message]
2013-12-16 11:38     ` Fan Du
2013-12-15  7:58 ` [PATCHv3 net-next 7/7] {pktgen, xfrm} Show spi value properly when ipsec turned on Fan Du
2013-12-16 12:41 ` [PATCHv3 net-next 0/7] pktgen IPsec support Jamal Hadi Salim
2013-12-17  2:22   ` Fan Du
2013-12-17 13:41     ` jamal
2013-12-18  1:48       ` Fan Du
2013-12-18 13:41         ` Jamal Hadi Salim

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=52AE143E.3020807@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=davem@davemloft.net \
    --cc=fan.du@windriver.com \
    --cc=hadi@cyberus.ca \
    --cc=netdev@vger.kernel.org \
    --cc=steffen.klassert@secunet.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;
as well as URLs for NNTP newsgroup(s).