From: Jiri Pirko <jiri@resnulli.us>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org, davem@davemloft.net,
netdev@vger.kernel.org, thomas.lendacky@amd.com,
f.fainelli@gmail.com, ariel.elior@cavium.com,
michael.chan@broadcom.com, santosh@chelsio.com,
madalin.bucur@nxp.com, yisen.zhuang@huawei.com,
salil.mehta@huawei.com, jeffrey.t.kirsher@intel.com,
tariqt@mellanox.com, saeedm@mellanox.com, jiri@mellanox.com,
idosch@mellanox.com, jakub.kicinski@netronome.com,
peppe.cavallaro@st.com, grygorii.strashko@ti.com, andrew@lunn.ch,
vivien.didelot@savoirfairelinux.com, alexandre.torgue@st.com,
joabreu@synopsys.com, linux-net-drivers@solarflare.com,
ganeshgr@chelsio.com, ogerlitz@mellanox.com,
Manish.Chopra@cavium.com, marcelo.leitner@gmail.com,
mkubecek@suse.cz, venkatkumar.duvvuru@broadcom.com,
julia.lawall@lip6.fr, john.fastabend@gmail.com
Subject: Re: [PATCH net-next,RFC 2/2] netfilter: nf_tables: add hardware offload support
Date: Tue, 14 May 2019 19:01:08 +0200 [thread overview]
Message-ID: <20190514170108.GC2584@nanopsycho> (raw)
In-Reply-To: <20190509163954.13703-3-pablo@netfilter.org>
Thu, May 09, 2019 at 06:39:51PM CEST, pablo@netfilter.org wrote:
>This patch adds hardware offload support for nftables through the
>existing netdev_ops->ndo_setup_tc() interface, the TC_SETUP_CLSFLOWER
>classifier and the flow rule API. This hardware offload support is
>available for the NFPROTO_NETDEV family and the ingress hook.
>
>Each nftables expression has a new ->offload interface, that is used to
>populate the flow rule object that is attached to the transaction
>object.
>
>There is a new per-table NFT_TABLE_F_HW flag, that is set on to offload
>an entire table, including all of its chains.
>
>This patch supports for basic metadata (layer 3 and 4 protocol numbers),
>5-tuple payload matching and the accept/drop actions; this also includes
>basechain hardware offload only.
>
>Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
[...]
>+static int nft_flow_offload_chain(struct nft_trans *trans,
>+ enum flow_block_command cmd)
>+{
>+ struct nft_chain *chain = trans->ctx.chain;
>+ struct netlink_ext_ack extack = {};
>+ struct flow_block_offload bo = {};
>+ struct nft_base_chain *basechain;
>+ struct net_device *dev;
>+ int err;
>+
>+ if (!nft_is_base_chain(chain))
>+ return -EOPNOTSUPP;
>+
>+ basechain = nft_base_chain(chain);
>+ dev = basechain->ops.dev;
>+ if (!dev)
>+ return -EOPNOTSUPP;
>+
>+ bo.command = cmd;
>+ bo.binder_type = TCF_BLOCK_BINDER_TYPE_CLSACT_INGRESS;
>+ bo.block_index = (u32)trans->ctx.chain->handle;
>+ bo.extack = &extack;
>+ INIT_LIST_HEAD(&bo.cb_list);
>+
>+ err = dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_BLOCK, &bo);
Okay, so you pretend to be clsact-ingress-flower. That looks fine.
But how do you ensure that the real one does not bind a block on the
same device too?
>+ if (err < 0)
>+ return err;
>+
>+ list_splice(&bo.cb_list, &basechain->cb_list);
>+ return 0;
>+}
>+
[...]
next prev parent reply other threads:[~2019-05-14 17:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-09 16:39 [PATCH net-next,RFC 0/2] netfilter: add hardware offload infrastructure Pablo Neira Ayuso
2019-05-09 16:39 ` [PATCH net-next,RFC 1/2] net: flow_offload: add flow_block_cb API Pablo Neira Ayuso
2019-05-14 14:57 ` Jiri Pirko
2019-05-14 23:07 ` Pablo Neira Ayuso
2019-05-09 16:39 ` [PATCH net-next,RFC 2/2] netfilter: nf_tables: add hardware offload support Pablo Neira Ayuso
2019-05-14 17:01 ` Jiri Pirko [this message]
2019-05-14 23:03 ` Pablo Neira Ayuso
2019-05-15 9:13 ` Pablo Neira Ayuso
2019-05-15 19:45 ` Jiri Pirko
2019-05-09 18:29 ` [PATCH net-next,RFC 0/2] netfilter: add hardware offload infrastructure Jakub Kicinski
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=20190514170108.GC2584@nanopsycho \
--to=jiri@resnulli.us \
--cc=Manish.Chopra@cavium.com \
--cc=alexandre.torgue@st.com \
--cc=andrew@lunn.ch \
--cc=ariel.elior@cavium.com \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=ganeshgr@chelsio.com \
--cc=grygorii.strashko@ti.com \
--cc=idosch@mellanox.com \
--cc=jakub.kicinski@netronome.com \
--cc=jeffrey.t.kirsher@intel.com \
--cc=jiri@mellanox.com \
--cc=joabreu@synopsys.com \
--cc=john.fastabend@gmail.com \
--cc=julia.lawall@lip6.fr \
--cc=linux-net-drivers@solarflare.com \
--cc=madalin.bucur@nxp.com \
--cc=marcelo.leitner@gmail.com \
--cc=michael.chan@broadcom.com \
--cc=mkubecek@suse.cz \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=ogerlitz@mellanox.com \
--cc=pablo@netfilter.org \
--cc=peppe.cavallaro@st.com \
--cc=saeedm@mellanox.com \
--cc=salil.mehta@huawei.com \
--cc=santosh@chelsio.com \
--cc=tariqt@mellanox.com \
--cc=thomas.lendacky@amd.com \
--cc=venkatkumar.duvvuru@broadcom.com \
--cc=vivien.didelot@savoirfairelinux.com \
--cc=yisen.zhuang@huawei.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).