DPDK patches and discussions
 help / color / mirror / Atom feed
From: Olivier Matz <olivier.matz@6wind.com>
To: Fan Zhang <roy.fan.zhang@intel.com>
Cc: dev@dpdk.org, akhil.goyal@nxp.com,
	pablo.de.lara.guarch@intel.com,
	Marko Kovacevic <marko.kovacevic@intel.com>
Subject: Re: [dpdk-dev] [PATCH v6 1/2] lib/ipsec: add support for header construction
Date: Mon, 1 Jul 2019 15:11:29 +0200	[thread overview]
Message-ID: <20190701131129.4mqvqzcq5hbzc6oh@platinum> (raw)
In-Reply-To: <20190701120124.70418-2-roy.fan.zhang@intel.com>

On Mon, Jul 01, 2019 at 01:01:23PM +0100, Fan Zhang wrote:
> Add support for RFC 4301(5.1.2) to update of
> Type of service field and Traffic class field
> bits inside ipv4/ipv6 packets for outbound cases
> and inbound cases which deals with the update of
> the DSCP/ENC bits inside each of the fields.
> 
> Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
> Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> Tested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> ---

[...]

> --- a/lib/librte_ipsec/esp_outb.c
> +++ b/lib/librte_ipsec/esp_outb.c
> @@ -152,8 +152,8 @@ outb_tun_pkt_prepare(struct rte_ipsec_sa *sa, rte_be64_t sqc,
>  	rte_memcpy(ph, sa->hdr, sa->hdr_len);
>  
>  	/* update original and new ip header fields */
> -	update_tun_l3hdr(sa, ph + sa->hdr_l3_off, mb->pkt_len - sqh_len,
> -			sa->hdr_l3_off, sqn_low16(sqc));
> +	update_tun_outb_l3hdr(sa, ph + sa->hdr_l3_off, ph + hlen,
> +			mb->pkt_len - sqh_len, sa->hdr_l3_off, sqn_low16(sqc));
>  
>  	/* update spi, seqn and iv */
>  	esph = (struct rte_esp_hdr *)(ph + sa->hdr_len);
> diff --git a/lib/librte_ipsec/iph.h b/lib/librte_ipsec/iph.h
> index 62d78b7b1..90faff6d5 100644
> --- a/lib/librte_ipsec/iph.h
> +++ b/lib/librte_ipsec/iph.h
> @@ -101,23 +101,183 @@ update_trs_l3hdr(const struct rte_ipsec_sa *sa, void *p, uint32_t plen,
>  	return rc;
>  }
>  
> +/*
> + * The masks for ipv6 header reconstruction (RFC4301)
> + */
> +#define IPV6_DSCP_MASK	(RTE_IP_DSCP_MASK << RTE_IPV6_HDR_TC_SHIFT)
> +#define IPV6_ECN_MASK	(RTE_IP_ECN_MASK << RTE_IPV6_HDR_TC_SHIFT)
> +#define IPV6_TOS_MASK	(IPV6_ECN_MASK | IPV6_DSCP_MASK)
> +#define IPV6_ECN_CE	IPV6_ECN_MASK

[...]

> --- a/lib/librte_net/rte_ip.h
> +++ b/lib/librte_net/rte_ip.h
> @@ -70,6 +70,18 @@ struct rte_ipv4_hdr {
>  
>  #define	RTE_IPV4_HDR_OFFSET_UNITS	8
>  
> +/**
> + * RFC 3168 Explicit Congestion Notification (ECN)
> + * * ECT(1) (ECN-Capable Transport(1))
> + * * ECT(0) (ECN-Capable Transport(0))
> + * * ECT(CE)(CE (Congestion Experienced))
> + */
> +#define RTE_IP_ECN_MASK		(0x03)
> +#define RTE_IP_ECN_CE		RTE_IP_ECN_MASK
> +
> +/** Packet Option Masks */
> +#define RTE_IP_DSCP_MASK		(0xFC)
> +
>  /*
>   * IPv4 address types
>   */

Just a quick comment: these flags are also being added in librte_net by
this patch:
https://mails.dpdk.org/archives/dev/2019-June/135444.html

Thanks,
Olivier

  reply	other threads:[~2019-07-01 13:11 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-17 16:03 [dpdk-dev] [PATCH v1] " Marko Kovacevic
2019-05-19 16:26 ` Ananyev, Konstantin
2019-06-20 12:27   ` Akhil Goyal
2019-06-25 13:43 ` [dpdk-dev] [PATCH v2 0/2] ipsec: ECN and DSCP header reconstruction Fan Zhang
2019-06-25 13:43   ` [dpdk-dev] [PATCH v2 1/2] lib/ipsec: add support for header construction Fan Zhang
2019-06-25 13:43   ` [dpdk-dev] [PATCH v2 2/2] examples/ipsec-secgw: support header reconstruction Fan Zhang
2019-06-26 15:05   ` [dpdk-dev] [PATCH v3 0/2] ipsec: ECN and DSCP " Fan Zhang
2019-06-26 15:05     ` [dpdk-dev] [PATCH v3 1/2] lib/ipsec: add support for header construction Fan Zhang
2019-06-26 22:15       ` Ananyev, Konstantin
2019-06-26 15:05     ` [dpdk-dev] [PATCH v3 2/2] examples/ipsec-secgw: support header reconstruction Fan Zhang
2019-06-28 12:39     ` [dpdk-dev] [PATCH v4 0/2] ipsec: ECN and DSCP " Fan Zhang
2019-06-28 12:39       ` [dpdk-dev] [PATCH v4 1/2] lib/ipsec: add support for header construction Fan Zhang
2019-06-28 12:39       ` [dpdk-dev] [PATCH v4 2/2] examples/ipsec-secgw: support header reconstruction Fan Zhang
2019-06-28 13:22       ` [dpdk-dev] [PATCH v5 0/2] ipsec: ECN and DSCP " Fan Zhang
2019-06-28 13:22         ` [dpdk-dev] [PATCH v5 1/2] lib/ipsec: add support for header construction Fan Zhang
2019-07-01 10:40           ` Ananyev, Konstantin
2019-06-28 13:22         ` [dpdk-dev] [PATCH v5 2/2] examples/ipsec-secgw: support header reconstruction Fan Zhang
2019-07-01 10:41           ` Ananyev, Konstantin
2019-07-01 12:01     ` [dpdk-dev] [PATCH v6 0/2] ipsec: ECN and DSCP " Fan Zhang
2019-07-01 12:01       ` [dpdk-dev] [PATCH v6 1/2] lib/ipsec: add support for header construction Fan Zhang
2019-07-01 13:11         ` Olivier Matz [this message]
2019-07-01 12:01       ` [dpdk-dev] [PATCH v6 2/2] examples/ipsec-secgw: support header reconstruction Fan Zhang
2019-07-03 10:11       ` [dpdk-dev] [PATCH v6 0/2] ipsec: ECN and DSCP " Akhil Goyal
2019-07-04 10:42       ` [dpdk-dev] [PATCH v7 " Fan Zhang
2019-07-04 10:42         ` [dpdk-dev] [PATCH v7 1/2] lib/ipsec: add support for header construction Fan Zhang
2019-07-04 10:42         ` [dpdk-dev] [PATCH v7 2/2] examples/ipsec-secgw: support header reconstruction Fan Zhang
2019-07-05 10:12         ` [dpdk-dev] [PATCH v7 0/2] ipsec: ECN and DSCP " Akhil Goyal

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=20190701131129.4mqvqzcq5hbzc6oh@platinum \
    --to=olivier.matz@6wind.com \
    --cc=akhil.goyal@nxp.com \
    --cc=dev@dpdk.org \
    --cc=marko.kovacevic@intel.com \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=roy.fan.zhang@intel.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).