From: Steffen Klassert <steffen.klassert@secunet.com>
To: David Miller <davem@davemloft.net>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
Steffen Klassert <steffen.klassert@secunet.com>,
<netdev@vger.kernel.org>
Subject: [PATCH 02/14] flow: Extend flow informations with xfrm interface id.
Date: Fri, 27 Jul 2018 09:24:37 +0200 [thread overview]
Message-ID: <20180727072449.11896-3-steffen.klassert@secunet.com> (raw)
In-Reply-To: <20180727072449.11896-1-steffen.klassert@secunet.com>
Add a new flowi_xfrm structure with informations needed to do
a xfrm lookup. At the moment it keeps the informations about
the new xfrm interface id needed to lookup xfrm interfaces
that are introduced with a followup patch. We need this new
lookup key as other possible keys, like the ifindex is
already part of the xfrm selector and used as a key to
enforce the output device after the transformation in the
policy/state lookup.
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Acked-by: Shannon Nelson <shannon.nelson@oracle.com>
Acked-by: Benedict Wong <benedictwong@google.com>
Tested-by: Benedict Wong <benedictwong@google.com>
Tested-by: Antony Antony <antony@phenome.org>
Reviewed-by: Eyal Birger <eyal.birger@gmail.com>
---
include/net/flow.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/include/net/flow.h b/include/net/flow.h
index 8ce21793094e..187c9bef672f 100644
--- a/include/net/flow.h
+++ b/include/net/flow.h
@@ -26,6 +26,10 @@ struct flowi_tunnel {
__be64 tun_id;
};
+struct flowi_xfrm {
+ __u32 if_id;
+};
+
struct flowi_common {
int flowic_oif;
int flowic_iif;
@@ -39,6 +43,7 @@ struct flowi_common {
#define FLOWI_FLAG_SKIP_NH_OIF 0x04
__u32 flowic_secid;
struct flowi_tunnel flowic_tun_key;
+ struct flowi_xfrm xfrm;
kuid_t flowic_uid;
};
@@ -78,6 +83,7 @@ struct flowi4 {
#define flowi4_secid __fl_common.flowic_secid
#define flowi4_tun_key __fl_common.flowic_tun_key
#define flowi4_uid __fl_common.flowic_uid
+#define flowi4_xfrm __fl_common.xfrm
/* (saddr,daddr) must be grouped, same order as in IP header */
__be32 saddr;
@@ -109,6 +115,7 @@ static inline void flowi4_init_output(struct flowi4 *fl4, int oif,
fl4->flowi4_flags = flags;
fl4->flowi4_secid = 0;
fl4->flowi4_tun_key.tun_id = 0;
+ fl4->flowi4_xfrm.if_id = 0;
fl4->flowi4_uid = uid;
fl4->daddr = daddr;
fl4->saddr = saddr;
@@ -138,6 +145,7 @@ struct flowi6 {
#define flowi6_secid __fl_common.flowic_secid
#define flowi6_tun_key __fl_common.flowic_tun_key
#define flowi6_uid __fl_common.flowic_uid
+#define flowi6_xfrm __fl_common.xfrm
struct in6_addr daddr;
struct in6_addr saddr;
/* Note: flowi6_tos is encoded in flowlabel, too. */
@@ -185,6 +193,7 @@ struct flowi {
#define flowi_secid u.__fl_common.flowic_secid
#define flowi_tun_key u.__fl_common.flowic_tun_key
#define flowi_uid u.__fl_common.flowic_uid
+#define flowi_xfrm u.__fl_common.xfrm
} __attribute__((__aligned__(BITS_PER_LONG/8)));
static inline struct flowi *flowi4_to_flowi(struct flowi4 *fl4)
--
2.14.1
next prev parent reply other threads:[~2018-07-27 8:45 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-27 7:24 pull request (net-next): ipsec-next 2018-07-27 Steffen Klassert
2018-07-27 7:24 ` [PATCH 01/14] xfrm: Extend the output_mark to support input direction and masking Steffen Klassert
2018-07-27 7:24 ` Steffen Klassert [this message]
2018-07-27 7:24 ` [PATCH 03/14] xfrm: Add a new lookup key to match xfrm interfaces Steffen Klassert
2018-07-27 7:24 ` [PATCH 04/14] xfrm: Add virtual " Steffen Klassert
2018-07-27 7:24 ` [PATCH 05/14] xfrm: policy: remove pcpu policy cache Steffen Klassert
2018-07-27 7:24 ` [PATCH 06/14] xfrm: Allow Set Mark to be Updated Using UPDSA Steffen Klassert
2018-07-27 7:24 ` [PATCH 07/14] xfrm: use time64_t for in-kernel timestamps Steffen Klassert
2018-07-27 7:24 ` [PATCH 08/14] ipv6: xfrm: use 64-bit timestamps Steffen Klassert
2018-07-27 7:24 ` [PATCH 09/14] xfrm: don't check offload_handle for nonzero Steffen Klassert
2018-07-27 7:24 ` [PATCH 10/14] xfrm: Remove xfrmi interface ID from flowi Steffen Klassert
2018-07-27 7:24 ` [PATCH 11/14] xfrm: Allow xfrmi if_id to be updated by UPDSA Steffen Klassert
2018-07-27 7:24 ` [PATCH 12/14] xfrm: fix 'passing zero to ERR_PTR()' warning Steffen Klassert
2018-07-27 7:24 ` [PATCH 13/14] xfrm: Return detailed errors from xfrmi_newlink Steffen Klassert
2018-07-27 7:24 ` [PATCH 14/14] xfrm: fix ptr_ret.cocci warnings Steffen Klassert
2018-07-27 16:37 ` pull request (net-next): ipsec-next 2018-07-27 David Miller
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=20180727072449.11896-3-steffen.klassert@secunet.com \
--to=steffen.klassert@secunet.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=netdev@vger.kernel.org \
/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