From: Boris Sukholitko <boris.sukholitko@broadcom.com>
To: netfilter-devel@vger.kernel.org
Cc: Ilya Lifshits <ilya.lifshits@broadcom.com>,
Boris Sukholitko <boris.sukholitko@broadcom.com>
Subject: [PATCH nf-next 12/19] netfilter: nft: empty nft conntrack extension
Date: Wed, 3 May 2023 15:55:45 +0300 [thread overview]
Message-ID: <20230503125552.41113-13-boris.sukholitko@broadcom.com> (raw)
In-Reply-To: <20230503125552.41113-1-boris.sukholitko@broadcom.com>
[-- Attachment #1: Type: text/plain, Size: 2973 bytes --]
And do the related bookkeeping. The extension struct nf_conn_nft_ext
is empty for now.
Signed-off-by: Boris Sukholitko <boris.sukholitko@broadcom.com>
---
include/net/netfilter/nf_conntrack_extend.h | 3 +++
include/net/netfilter/nf_tables.h | 7 +++++++
net/netfilter/nf_conntrack_extend.c | 9 ++++++++-
3 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/include/net/netfilter/nf_conntrack_extend.h b/include/net/netfilter/nf_conntrack_extend.h
index 0b247248b032..fa7321d71d98 100644
--- a/include/net/netfilter/nf_conntrack_extend.h
+++ b/include/net/netfilter/nf_conntrack_extend.h
@@ -30,6 +30,9 @@ enum nf_ct_ext_id {
#endif
#if IS_ENABLED(CONFIG_NET_ACT_CT)
NF_CT_EXT_ACT_CT,
+#endif
+#if IS_ENABLED(CONFIG_NFT_CONNTRACK_EXT)
+ NF_CT_EXT_NFT_EXT,
#endif
NF_CT_EXT_NUM,
};
diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h
index cba06ea3fedd..7d433f8db2e7 100644
--- a/include/net/netfilter/nf_tables.h
+++ b/include/net/netfilter/nf_tables.h
@@ -10,6 +10,7 @@
#include <linux/netfilter/nf_tables.h>
#include <linux/u64_stats_sync.h>
#include <linux/rhashtable.h>
+#include <net/netfilter/nf_conntrack_extend.h>
#include <net/netfilter/nf_flow_table.h>
#include <net/netlink.h>
#include <net/flow_offload.h>
@@ -1732,4 +1733,10 @@ static inline bool nft_reg_track_cmp(struct nft_regs_track *track,
int nft_payload_mangle(const struct nft_payload_set *priv,
const struct nft_pktinfo *pkt,
const u32 *src);
+
+#if IS_ENABLED(CONFIG_NFT_CONNTRACK_EXT)
+struct nf_conn_nft_ext {
+};
+#endif
+
#endif /* _NET_NF_TABLES_H */
diff --git a/net/netfilter/nf_conntrack_extend.c b/net/netfilter/nf_conntrack_extend.c
index 0b513f7bf9f3..bb389042261e 100644
--- a/net/netfilter/nf_conntrack_extend.c
+++ b/net/netfilter/nf_conntrack_extend.c
@@ -23,6 +23,7 @@
#include <net/netfilter/nf_conntrack_labels.h>
#include <net/netfilter/nf_conntrack_synproxy.h>
#include <net/netfilter/nf_conntrack_act_ct.h>
+#include <net/netfilter/nf_tables.h>
#include <net/netfilter/nf_nat.h>
#define NF_CT_EXT_PREALLOC 128u /* conntrack events are on by default */
@@ -54,12 +55,15 @@ static const u8 nf_ct_ext_type_len[NF_CT_EXT_NUM] = {
#if IS_ENABLED(CONFIG_NET_ACT_CT)
[NF_CT_EXT_ACT_CT] = sizeof(struct nf_conn_act_ct_ext),
#endif
+#if IS_ENABLED(CONFIG_NFT_CONNTRACK_EXT)
+ [NF_CT_EXT_NFT_EXT] = sizeof(struct nf_conn_nft_ext),
+#endif
};
static __always_inline unsigned int total_extension_size(void)
{
/* remember to add new extensions below */
- BUILD_BUG_ON(NF_CT_EXT_NUM > 10);
+ BUILD_BUG_ON(NF_CT_EXT_NUM > 11);
return sizeof(struct nf_ct_ext) +
sizeof(struct nf_conn_help)
@@ -85,6 +89,9 @@ static __always_inline unsigned int total_extension_size(void)
#endif
#if IS_ENABLED(CONFIG_NET_ACT_CT)
+ sizeof(struct nf_conn_act_ct_ext)
+#endif
+#if IS_ENABLED(CONFIG_NFT_CONNTRACK_EXT)
+ + sizeof(struct nf_conn_nft_ext)
#endif
;
}
--
2.32.0
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4221 bytes --]
next prev parent reply other threads:[~2023-05-03 12:56 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-03 12:55 [PATCH nf-next 00/19] netfilter: nftables: dscp modification offload Boris Sukholitko
2023-05-03 12:55 ` [PATCH nf-next 01/19] selftest: netfilter: use /proc for pid checking Boris Sukholitko
2023-05-03 18:47 ` Florian Westphal
2023-05-04 8:53 ` Boris Sukholitko
2023-05-03 12:55 ` [PATCH nf-next 02/19] selftest: netfilter: no need for ps -x option Boris Sukholitko
2023-05-03 18:53 ` Florian Westphal
2023-05-03 12:55 ` [PATCH nf-next 03/19] selftest: netfilter: wait for specific nc pids Boris Sukholitko
2023-05-03 12:55 ` [PATCH nf-next 04/19] selftest: netfilter: monitor result file sizes Boris Sukholitko
2023-05-03 18:54 ` Florian Westphal
2023-05-03 12:55 ` [PATCH nf-next 05/19] netfilter: nft_payload: refactor mangle operation Boris Sukholitko
2023-05-03 12:55 ` [PATCH nf-next 06/19] netfilter: nft_payload: publish nft_payload_set Boris Sukholitko
2023-05-03 12:55 ` [PATCH nf-next 07/19] netfilter: nft_payload: export mangle Boris Sukholitko
2023-05-03 12:55 ` [PATCH nf-next 08/19] netfilter: nft_payload: use flag for checksum need Boris Sukholitko
2023-05-03 12:55 ` [PATCH nf-next 09/19] netfilter: nft_payload: add offload flag define Boris Sukholitko
2023-05-03 12:55 ` [PATCH nf-next 10/19] netfilter: nft_payload: allow offload in the netlink Boris Sukholitko
2023-05-03 12:55 ` [PATCH nf-next 11/19] netfilter: conntrack: nft extension Kconfig Boris Sukholitko
2023-05-03 12:55 ` Boris Sukholitko [this message]
2023-05-03 12:55 ` [PATCH nf-next 13/19] netfilter: conntrack: register nft extension Boris Sukholitko
2023-05-03 12:55 ` [PATCH nf-next 14/19] netfilter: nft: add payload context into extension Boris Sukholitko
2023-05-03 12:55 ` [PATCH nf-next 15/19] netfilter: nft: add payload application Boris Sukholitko
2023-05-03 23:32 ` kernel test robot
2023-05-04 0:44 ` kernel test robot
2023-05-03 12:55 ` [PATCH nf-next 16/19] netfilter: nftables: fast path payload mangle Boris Sukholitko
2023-05-03 15:41 ` kernel test robot
2023-05-03 12:55 ` [PATCH nf-next 17/19] netfilter: nftables: payload save mechanism Boris Sukholitko
2023-05-03 12:55 ` [PATCH nf-next 18/19] netfilter: nft_payload: save payload if needed Boris Sukholitko
2023-05-03 12:55 ` [PATCH nf-next 19/19] selftests: netfilter: dscp offload test Boris Sukholitko
2023-05-03 18:46 ` [PATCH nf-next 00/19] netfilter: nftables: dscp modification offload Florian Westphal
2023-05-07 15:22 ` Boris Sukholitko
2023-05-07 17:37 ` Florian Westphal
2023-05-08 13:38 ` Boris Sukholitko
2023-05-08 20:07 ` Pablo Neira Ayuso
2023-05-09 14:56 ` Boris Sukholitko
2023-05-09 9:48 ` Florian Westphal
2023-05-10 7:49 ` Boris Sukholitko
2023-05-10 12:55 ` Florian Westphal
2023-05-11 15:59 ` Boris Sukholitko
2023-05-11 16:36 ` Florian Westphal
2023-05-03 20:30 ` Pablo Neira Ayuso
2023-05-03 20:41 ` Pablo Neira Ayuso
2023-05-04 8:50 ` Boris Sukholitko
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=20230503125552.41113-13-boris.sukholitko@broadcom.com \
--to=boris.sukholitko@broadcom.com \
--cc=ilya.lifshits@broadcom.com \
--cc=netfilter-devel@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