cxgbe: Add flow director support
cover cxgbe: Add flow director support
This series of patches extend the flow director filter and add support for Chelsio T5 hardware filtering capabilities.
Chelsio T5 supports carrying out filtering in hardware which supports 3 actions to carry out on a packet which hit a filter viz.
1. Action Pass - Packets hitting a filter rule can be directed to a particular RXQ.
2. Action Drop - Packets hitting a filter rule are dropped in h/w.
3. Action Switch - Packets hitting a filter rule can be switched in h/w from one port to another, without involvement of host. Also, the action Switch also supports rewrite of src-mac/dst-mac headers as well as rewrite of vlan headers. It also supports rewrite of IP headers and thereby, supports NAT (Network Address Translation) in h/w.
Also, each filter rule can optionally support specifying a mask value i.e. it's possible to create a filter rule for an entire subnet of IP addresses or a range of tcp/udp ports, etc.
Patch 1 does the following:
- Adds a new flow RTE_ETH_FLOW_RAW_PKT to allow specifying a generic flow.
- Adds an additional generic array to rte_eth_fdir_flow to allow specifying generic flow input.
- Adds an additional mask for the flow input to allow range of values to be matched in the flow input.
- Adds a new behavior 'switch'.
- Adds a generic array to hold behavior arguments that can be passed when a particular behavior is taken. For ex: in case of action 'switch', pass additional 4-tuple to allow rewriting src/dst ip and port addresses to support NAT'ing.
RFC series of patches and discussion involving these enhancements to the flow director are available at [1].
Patch 2 adds command line example app to test cxgbe flow director. Also add documentation for the example app.
Patch 3 updates the cxgbe base to add support for packet filtering.
Patch 4 adds control txq for communicating filter info to the firmware.
Patches 5-7 add compressed local ip (CLIP) table, layer 2 table (L2T), and source mac table (SMT) definitions required for holding info for matching and executing various operations on matched filters.
Patch 8 adds the LE-TCAM (maskfull) filter support.
Patch 9 adds the HASH (maskless) filter support.
Patch 10 adds and implements the flow director filter operations. Also add the documentation.
[1] http://comments.gmane.org/gmane.comp.networking.dpdk.devel/29986
Rahul Lakkireddy (10):
ethdev: add a generic flow and new behavior switch to fdir examples/test-cxgbe-filters: add example to test cxgbe fdir support
cxgbe: add skeleton to add support for T5 hardware filtering
cxgbe: add control txq for communicating filtering info
cxgbe: add compressed local IP table for matching IPv6 addresses
cxgbe: add layer 2 table for switch action filter
cxgbe: add source mac table for switch action filter
cxgbe: add LE-TCAM filtering support
cxgbe: add HASH filtering support
cxgbe: add flow director support and update documentation
MAINTAINERS | 2 + doc/guides/nics/cxgbe.rst | 166 ++ doc/guides/rel_notes/release_2_3.rst | 10 + doc/guides/sample_app_ug/index.rst | 1 + doc/guides/sample_app_ug/test_cxgbe_filters.rst | 694 +++++++++ drivers/net/cxgbe/Makefile | 6 + drivers/net/cxgbe/base/adapter.h | 110 ++ drivers/net/cxgbe/base/common.h | 11 + drivers/net/cxgbe/base/t4_hw.c | 28 + drivers/net/cxgbe/base/t4_msg.h | 324 ++++ drivers/net/cxgbe/base/t4_regs.h | 9 + drivers/net/cxgbe/base/t4_regs_values.h | 25 + drivers/net/cxgbe/base/t4_tcb.h | 95 ++ drivers/net/cxgbe/base/t4fw_interface.h | 272 ++++ drivers/net/cxgbe/clip_tbl.c | 220 +++ drivers/net/cxgbe/clip_tbl.h | 59 + drivers/net/cxgbe/cxgbe.h | 4 + drivers/net/cxgbe/cxgbe_compat.h | 12 + drivers/net/cxgbe/cxgbe_ethdev.c | 21 + drivers/net/cxgbe/cxgbe_fdir.c | 715 +++++++++ drivers/net/cxgbe/cxgbe_fdir.h | 108 ++ drivers/net/cxgbe/cxgbe_filter.c | 1614 ++++++++++++++++++++ drivers/net/cxgbe/cxgbe_filter.h | 260 ++++ drivers/net/cxgbe/cxgbe_main.c | 395 ++++- drivers/net/cxgbe/cxgbe_ofld.h | 126 ++ drivers/net/cxgbe/l2t.c | 261 ++++ drivers/net/cxgbe/l2t.h | 87 ++ drivers/net/cxgbe/sge.c | 202 ++- drivers/net/cxgbe/smt.c | 275 ++++ drivers/net/cxgbe/smt.h | 76 + examples/Makefile | 1 + examples/test-cxgbe-filters/Makefile | 63 + examples/test-cxgbe-filters/commands.c | 429 ++++++ examples/test-cxgbe-filters/commands.h | 40 + examples/test-cxgbe-filters/config.c | 79 + examples/test-cxgbe-filters/cxgbe/cxgbe_commands.c | 554 +++++++ examples/test-cxgbe-filters/cxgbe/cxgbe_fdir.h | 79 + examples/test-cxgbe-filters/init.c | 201 +++ examples/test-cxgbe-filters/main.c | 79 + examples/test-cxgbe-filters/main.h | 77 + examples/test-cxgbe-filters/runtime.c | 74 + lib/librte_ether/rte_eth_ctrl.h | 15 +- 42 files changed, 7874 insertions(+), 5 deletions(-) create mode 100644 doc/guides/sample_app_ug/test_cxgbe_filters.rst create mode 100644 drivers/net/cxgbe/base/t4_tcb.h create mode 100644 drivers/net/cxgbe/clip_tbl.c create mode 100644 drivers/net/cxgbe/clip_tbl.h create mode 100644 drivers/net/cxgbe/cxgbe_fdir.c create mode 100644 drivers/net/cxgbe/cxgbe_fdir.h create mode 100644 drivers/net/cxgbe/cxgbe_filter.c create mode 100644 drivers/net/cxgbe/cxgbe_filter.h create mode 100644 drivers/net/cxgbe/cxgbe_ofld.h create mode 100644 drivers/net/cxgbe/l2t.c create mode 100644 drivers/net/cxgbe/l2t.h create mode 100644 drivers/net/cxgbe/smt.c create mode 100644 drivers/net/cxgbe/smt.h create mode 100644 examples/test-cxgbe-filters/Makefile create mode 100644 examples/test-cxgbe-filters/commands.c create mode 100644 examples/test-cxgbe-filters/commands.h create mode 100644 examples/test-cxgbe-filters/config.c create mode 100644 examples/test-cxgbe-filters/cxgbe/cxgbe_commands.c create mode 100644 examples/test-cxgbe-filters/cxgbe/cxgbe_fdir.h create mode 100644 examples/test-cxgbe-filters/init.c create mode 100644 examples/test-cxgbe-filters/main.c create mode 100644 examples/test-cxgbe-filters/main.h create mode 100644 examples/test-cxgbe-filters/runtime.c
Signature · 1 line
2.5.3
PATCH 1/10 ethdev: add a generic flow and new behavior switch to fdir
Add a new raw packet flow that allows specifying generic flow input.
Add the ability to provide masks for fields in flow to allow range of values.
Add a new behavior switch.
Add the ability to provide behavior arguments to allow rewriting matched fields with new values. Ex: allows to provide new ip and port addresses to rewrite the fields of packets matching a filter rule before NAT'ing.
--- doc/guides/rel_notes/release_2_3.rst | 3 +++ lib/librte_ether/rte_eth_ctrl.h | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-)
doc/guides/rel_notes/release_2_3.rst +3 -0
@@ -39,6 +39,9 @@ API Changes ABI Changes ----------- +* New flow type ``RTE_ETH_FLOW_RAW_PKT`` had been introduced and hence + ``RTE_ETH_FLOW_MAX`` had been increased to 19. + Shared Library Versions -----------------------
lib/librte_ether/rte_eth_ctrl.h +14 -1
@@ -74,7 +74,8 @@ extern "C" {#define RTE_ETH_FLOW_IPV6_EX 15#define RTE_ETH_FLOW_IPV6_TCP_EX 16#define RTE_ETH_FLOW_IPV6_UDP_EX 17 -#define RTE_ETH_FLOW_MAX 18 +#define RTE_ETH_FLOW_RAW_PKT 18 +#define RTE_ETH_FLOW_MAX 19/** * Feature filter types
@@ -499,6 +500,9 @@ struct rte_eth_tunnel_flow {struct ether_addr mac_addr;/**< Mac address to match. */ }; +/**< Max length of raw packet in bytes. */ +#define RTE_ETH_RAW_PKT_FLOW_MAX_LEN 256 +/** * An union contains the inputs for all types of flow */
@@ -514,6 +518,7 @@ union rte_eth_fdir_flow {struct rte_eth_ipv6_flow ipv6_flow;struct rte_eth_mac_vlan_flow mac_vlan_flow;struct rte_eth_tunnel_flow tunnel_flow; +uint8_t raw_pkt_flow[RTE_ETH_RAW_PKT_FLOW_MAX_LEN ]; };/**
@@ -534,6 +539,8 @@ struct rte_eth_fdir_input {uint16_t flow_type;union rte_eth_fdir_flow flow;/**< Flow fields to match, dependent on flow_type */ +union rte_eth_fdir_flow flow_mask; +/**< Mask for the fields matched, dependent on flow */ struct rte_eth_fdir_flow_ext flow_ext;/**< Additional fields to match */ };
@@ -545,6 +552,7 @@ enum rte_eth_fdir_behavior {RTE_ETH_FDIR_ACCEPT =0 ,RTE_ETH_FDIR_REJECT ,RTE_ETH_FDIR_PASSTHRU , + RTE_ETH_FDIR_SWITCH, };/**
@@ -558,6 +566,9 @@ enum rte_eth_fdir_status { RTE_ETH_FDIR_REPORT_FLEX_8, /**< Report 8 flex bytes. */ }; +/**< Max # of behavior arguments */ +#define RTE_ETH_BEHAVIOR_ARG_MAX_LEN 256 +/** * A structure used to define an action when match FDIR packet filter. */
@@ -569,6 +580,8 @@ struct rte_eth_fdir_action {/**< If report_status is RTE_ETH_FDIR_REPORT_ID_FLEX_4 or RTE_ETH_FDIR_REPORT_FLEX_8, flex_off specifies where the reported flex bytes start from in flexible payload. */ +uint8_t behavior_arg[RTE_ETH_BEHAVIOR_ARG_MAX_LEN ]; +/**< Extra arguments for behavior taken */ };/**
Signature · 1 line
2.5.3
PATCH 2/10 examples/test-cxgbe-filters: add example to test cxgbe fdir support
In reply to Rahul LakkireddyAdd a new test_cxgbe_filters command line example to test support for Chelsio T5 hardware filtering. Shows how to pass the Chelsio input flow and input masks. Also, shows how to pass extra behavior arguments to rewrite fields in matched filter rules.
Also add documentation and update MAINTAINERS.
--- MAINTAINERS | 2 + doc/guides/sample_app_ug/index.rst | 1 + doc/guides/sample_app_ug/test_cxgbe_filters.rst | 694 +++++++++++++++++++++ examples/Makefile | 1 + examples/test-cxgbe-filters/Makefile | 63 ++ examples/test-cxgbe-filters/commands.c | 429 +++++++++++++ examples/test-cxgbe-filters/commands.h | 40 ++ examples/test-cxgbe-filters/config.c | 79 +++ examples/test-cxgbe-filters/cxgbe/cxgbe_commands.c | 554 ++++++++++++++++ examples/test-cxgbe-filters/cxgbe/cxgbe_fdir.h | 79 +++ examples/test-cxgbe-filters/init.c | 201 ++++++ examples/test-cxgbe-filters/main.c | 79 +++ examples/test-cxgbe-filters/main.h | 77 +++ examples/test-cxgbe-filters/runtime.c | 74 +++ 14 files changed, 2373 insertions(+) create mode 100644 doc/guides/sample_app_ug/test_cxgbe_filters.rst create mode 100644 examples/test-cxgbe-filters/Makefile create mode 100644 examples/test-cxgbe-filters/commands.c create mode 100644 examples/test-cxgbe-filters/commands.h create mode 100644 examples/test-cxgbe-filters/config.c create mode 100644 examples/test-cxgbe-filters/cxgbe/cxgbe_commands.c create mode 100644 examples/test-cxgbe-filters/cxgbe/cxgbe_fdir.h create mode 100644 examples/test-cxgbe-filters/init.c create mode 100644 examples/test-cxgbe-filters/main.c create mode 100644 examples/test-cxgbe-filters/main.h create mode 100644 examples/test-cxgbe-filters/runtime.c
MAINTAINERS +2 -0
@@ -261,6 +261,8 @@ Chelsio cxgbe M: Rahul Lakkireddy <[email protected]> F: drivers/net/cxgbe/ F: doc/guides/nics/cxgbe.rst +F: examples/test-cxgbe-filters/ +F: doc/guides/sample_app_ug/test_cxgbe_filters.rst Cisco enic M: John Daley <[email protected]>
doc/guides/sample_app_ug/index.rst +1 -0
@@ -73,6 +73,7 @@ Sample Applications User Guide proc_info ptpclient performance_thread + test_cxgbe_filters **Figures**
doc/guides/sample_app_ug/test_cxgbe_filters.rst new file +694 -0
694 lines not on this page · raw message
examples/Makefile +1 -0
@@ -71,6 +71,7 @@ DIRS-y += quota_watermark DIRS-$(CONFIG_RTE_ETHDEV_RXTX_CALLBACKS) += rxtx_callbacks DIRS-y += skeleton DIRS-$(CONFIG_RTE_LIBRTE_VHOST) += tep_termination +DIRS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test-cxgbe-filters DIRS-$(CONFIG_RTE_LIBRTE_TIMER) += timer DIRS-$(CONFIG_RTE_LIBRTE_VHOST) += vhost DIRS-$(CONFIG_RTE_LIBRTE_XEN_DOM0) += vhost_xen
examples/test-cxgbe-filters/Makefile new file +63 -0
63 lines not on this page · raw message
examples/test-cxgbe-filters/commands.c new file +429 -0
429 lines not on this page · raw message
examples/test-cxgbe-filters/commands.h new file +40 -0
@@ -0,0 +1,40 @@ +/*- +* BSD LICENSE +* +* Copyright(c) 2015-2016 Chelsio Communications. +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: +* +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in +* the documentation and/or other materials provided with the +* distribution. +* * Neither the name of Chelsio Communications nor the names of its +* contributors may be used to endorse or promote products derived +* from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef _COMMANDS_H_ +#define _COMMANDS_H_ + +#include <cmdline_parse.h> + +extern cmdline_parse_inst_t cmd_add_del_cxgbe_flow_director; +#endif /* _COMMANDS_H_ */
examples/test-cxgbe-filters/config.c new file +79 -0
79 lines not on this page · raw message
examples/test-cxgbe-filters/cxgbe/cxgbe_commands.c new file +554 -0
554 lines not on this page · raw message
examples/test-cxgbe-filters/cxgbe/cxgbe_fdir.h new file +79 -0
79 lines not on this page · raw message
examples/test-cxgbe-filters/init.c new file +201 -0
201 lines not on this page · raw message
examples/test-cxgbe-filters/main.c new file +79 -0
79 lines not on this page · raw message
examples/test-cxgbe-filters/main.h new file +77 -0
77 lines not on this page · raw message
examples/test-cxgbe-filters/runtime.c new file +74 -0
74 lines not on this page · raw message
Signature · 1 line
2.5.3
PATCH 3/10 cxgbe: add skeleton to add support for T5 hardware filtering
In reply to Rahul LakkireddyUpdate base to get info about supported filtering features.
Add TID table that holds filter state and add filter specification that provide a skeleton to add LE-TCAM (Maskfull) and Hash (Maskless) T5 filtering capabilities.
--- drivers/net/cxgbe/Makefile | 1 + drivers/net/cxgbe/base/adapter.h | 7 + drivers/net/cxgbe/base/t4fw_interface.h | 10 ++ drivers/net/cxgbe/cxgbe_filter.h | 231 ++++++++++++++++++++++++++++++++ drivers/net/cxgbe/cxgbe_main.c | 138 +++++++++++++++++++ drivers/net/cxgbe/cxgbe_ofld.h | 86 ++++++++++++ 6 files changed, 473 insertions(+) create mode 100644 drivers/net/cxgbe/cxgbe_filter.h create mode 100644 drivers/net/cxgbe/cxgbe_ofld.h
drivers/net/cxgbe/Makefile +1 -0
@@ -83,5 +83,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += t4_hw.c DEPDIRS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += lib/librte_eal lib/librte_ether DEPDIRS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += lib/librte_mempool lib/librte_mbuf DEPDIRS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += lib/librte_net lib/librte_malloc +DEPDIRS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += lib/librte_sched include $(RTE_SDK)/mk/rte.lib.mk
drivers/net/cxgbe/base/adapter.h +7 -0
@@ -40,6 +40,7 @@#include "cxgbe_compat.h" #include "t4_regs_values.h" +#include "cxgbe_ofld.h" enum {MAX_ETH_QSETS =64 ,/* # of Ethernet Tx/Rx queue sets */
@@ -319,6 +320,12 @@ struct adapter {unsigned int pf;/* associated physical function id */ int use_unpacked_mode;/* unpacked rx mode state */ + +unsigned int clipt_start;/* CLIP table start */ +unsigned int clipt_end;/* CLIP table end */ +unsigned int l2t_start;/* Layer 2 table start */ +unsigned int l2t_end;/* Layer 2 table end */ +struct tid_info tids;/* Info used to access TID related tables */ };#define CXGBE_PCI_REG (reg) (*((volatile uint32_t *)(reg)))
drivers/net/cxgbe/base/t4fw_interface.h +10 -0
@@ -394,6 +394,10 @@ enum fw_params_mnem {enum fw_params_param_dev {FW_PARAMS_PARAM_DEV_CCLK =0x00 ,/* chip core clock in khz */ FW_PARAMS_PARAM_DEV_PORTVEC =0x01 ,/* the port vector */ +FW_PARAMS_PARAM_DEV_NTID =0x02 ,/* reads the number of TIDs +* allocated by the device's +* Lookup Engine +*/ FW_PARAMS_PARAM_DEV_ULPTX_MEMWRITE_DSGL =0x17 , };
@@ -401,6 +405,12 @@ enum fw_params_param_dev {* physical and virtual function parameters */ enum fw_params_param_pfvf { +FW_PARAMS_PARAM_PFVF_CLIP_START =0x03 , +FW_PARAMS_PARAM_PFVF_CLIP_END =0x04 , +FW_PARAMS_PARAM_PFVF_FILTER_START =0x05 , +FW_PARAMS_PARAM_PFVF_FILTER_END =0x06 , +FW_PARAMS_PARAM_PFVF_L2T_START =0x13 , +FW_PARAMS_PARAM_PFVF_L2T_END =0x14 ,FW_PARAMS_PARAM_PFVF_CPLFW4MSG_ENCAP =0x31 };
drivers/net/cxgbe/cxgbe_filter.h new file +231 -0
231 lines not on this page · raw message
drivers/net/cxgbe/cxgbe_main.c +138 -0
174 lines not on this page · raw message
drivers/net/cxgbe/cxgbe_ofld.h new file +86 -0
86 lines not on this page · raw message
Signature · 1 line
2.5.3
PATCH 4/10 cxgbe: add control txq for communicating filtering info
In reply to Rahul LakkireddyAdd a control txq with its own mempool to create control packets containing filtering information to be communicated with firmware.
--- drivers/net/cxgbe/base/adapter.h | 15 +++ drivers/net/cxgbe/base/common.h | 2 + drivers/net/cxgbe/base/t4_hw.c | 25 ++++ drivers/net/cxgbe/base/t4fw_interface.h | 64 ++++++++++ drivers/net/cxgbe/cxgbe.h | 1 + drivers/net/cxgbe/cxgbe_ethdev.c | 3 + drivers/net/cxgbe/cxgbe_main.c | 41 +++++++ drivers/net/cxgbe/sge.c | 199 +++++++++++++++++++++++++++++++- 8 files changed, 349 insertions(+), 1 deletion(-)
drivers/net/cxgbe/base/adapter.h +15 -0
@@ -44,6 +44,7 @@enum {MAX_ETH_QSETS =64 ,/* # of Ethernet Tx/Rx queue sets */ +MAX_CTRL_QUEUES =NCHAN ,/* # of control Tx queues */ };struct adapter ;
@@ -271,10 +272,20 @@ struct sge_eth_txq { /* state for an SGE Ethernet Tx queue */unsigned int flags;/* flags for state of the queue */ } __rte_cache_aligned; +struct sge_ctrl_txq {/* State for an SGE control Tx queue */ +struct sge_txq q;/* txq */ +struct adapter *adapter;/* adapter associated with this queue */ +rte_spinlock_t ctrlq_lock;/* control queue lock */ +u8 full;/* the Tx ring is full */ +u64 txp;/* number of transmits */ +struct rte_mempool *mb_pool;/* mempool to generate ctrl pkts */ +} __rte_cache_aligned; +struct sge {struct sge_eth_txq ethtxq[MAX_ETH_QSETS ];struct sge_eth_rxq ethrxq[MAX_ETH_QSETS ]; struct sge_rspq fw_evtq __rte_cache_aligned; +struct sge_ctrl_txq ctrlq[MAX_CTRL_QUEUES ];u16 max_ethqsets;/* # of available Ethernet queue sets */ u32 stat_len;/* length of status page at ring end */
@@ -556,12 +567,16 @@ void t4_free_sge_resources(struct adapter *adap);void t4_sge_tx_monitor_start (struct adapter *adap);void t4_sge_tx_monitor_stop (struct adapter *adap);int t4_eth_xmit (struct sge_eth_txq *txq,struct rte_mbuf *mbuf); +int t4_mgmt_tx (struct sge_ctrl_txq *txq,struct rte_mbuf *mbuf);int t4_ethrx_handler (struct sge_rspq *q,const __be64 *rsp,const struct pkt_gl *gl);int t4_sge_init (struct adapter *adap);int t4_sge_alloc_eth_txq (struct adapter *adap,struct sge_eth_txq *txq,struct rte_eth_dev *eth_dev,uint16_t queue_id,unsigned int iqid,int socket_id); +int t4_sge_alloc_ctrl_txq (struct adapter *adap,struct sge_ctrl_txq *txq, +struct rte_eth_dev *eth_dev,uint16_t queue_id, +unsigned int iqid,int socket_id); int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *rspq, bool fwevtq, struct rte_eth_dev *eth_dev, int intr_idx, struct sge_fl *fl, rspq_handler_t handler,
drivers/net/cxgbe/base/common.h +2 -0
@@ -311,6 +311,8 @@ int t4_iq_free(struct adapter *adap, unsigned int mbox, unsigned int pf, unsigned int fl0id, unsigned int fl1id);int t4_eth_eq_free (struct adapter *adap,unsigned int mbox,unsigned int pf,unsigned int vf,unsigned int eqid); +int t4_ctrl_eq_free (struct adapter *adap,unsigned int mbox,unsigned int pf, +unsigned int vf,unsigned int eqid);static inline unsigned int core_ticks_per_usec (const struct adapter *adap) {
drivers/net/cxgbe/base/t4_hw.c +25 -0
@@ -2124,6 +2124,31 @@ int t4_eth_eq_free(struct adapter *adap, unsigned int mbox, unsigned int pf, }/** +* t4_ctrl_eq_free - free a control egress queue +* @adap: the adapter +* @mbox: mailbox to use for the FW command +* @pf: the PF owning the queue +* @vf: the VF owning the queue +* @eqid: egress queue id +* +* Frees a control egress queue. +*/ +int t4_ctrl_eq_free (struct adapter *adap,unsigned int mbox,unsigned int pf, +unsigned int vf,unsigned int eqid) +{ +struct fw_eq_ctrl_cmd c; + +memset (&c,0 ,sizeof (c)); + c.op_to_vfn =cpu_to_be32 (V_FW_CMD_OP (FW_EQ_CTRL_CMD ) | +F_FW_CMD_REQUEST |F_FW_CMD_EXEC | +V_FW_EQ_CTRL_CMD_PFN (pf) | +V_FW_EQ_CTRL_CMD_VFN (vf)); + c.alloc_to_len16 =cpu_to_be32 (F_FW_EQ_CTRL_CMD_FREE |FW_LEN16 (c)); + c.cmpliqid_eqid =cpu_to_be32 (V_FW_EQ_CTRL_CMD_EQID (eqid)); +return t4_wr_mbox (adap, mbox, &c,sizeof (c),NULL ); +} + +/** * t4_handle_fw_rpl - process a FW reply message * @adap: the adapter * @rpl: start of the FW message
drivers/net/cxgbe/base/t4fw_interface.h +64 -0
76 lines not on this page · raw message
drivers/net/cxgbe/cxgbe.h +1 -0
@@ -56,6 +56,7 @@ int link_start(struct port_info *pi);void init_rspq (struct adapter *adap,struct sge_rspq *q,unsigned int us,unsigned int cnt,unsigned int size,unsigned int iqe_size);int setup_sge_fwevtq (struct adapter *adapter); +int setup_sge_ctrl_txq (struct adapter *adapter);void cfg_queues (struct rte_eth_dev *eth_dev);int cfg_queue_count (struct rte_eth_dev *eth_dev);int setup_rss (struct port_info *pi);
drivers/net/cxgbe/cxgbe_ethdev.c +3 -0
@@ -393,6 +393,9 @@ static int cxgbe_dev_configure(struct rte_eth_dev *eth_dev)if (err)return err; adapter->flags |=FW_QUEUE_BOUND ; + err =setup_sge_ctrl_txq (adapter); +if (err) +return err; } err =cfg_queue_count (eth_dev);
drivers/net/cxgbe/cxgbe_main.c +41 -0
47 lines not on this page · raw message
drivers/net/cxgbe/sge.c +198 -1
229 lines not on this page · raw message
Signature · 1 line
2.5.3
PATCH 5/10 cxgbe: add compressed local IP table for matching IPv6 addresses
In reply to Rahul LakkireddyAdd Compressed Local IP (CLIP) table that holds IPv6 addresses to be matched against packets.
--- drivers/net/cxgbe/Makefile | 1 + drivers/net/cxgbe/base/adapter.h | 52 ++++++++ drivers/net/cxgbe/base/t4fw_interface.h | 23 ++++ drivers/net/cxgbe/clip_tbl.c | 220 ++++++++++++++++++++++++++++++++ drivers/net/cxgbe/clip_tbl.h | 59 +++++++++ drivers/net/cxgbe/cxgbe_filter.h | 1 + drivers/net/cxgbe/cxgbe_main.c | 11 ++ 7 files changed, 367 insertions(+) create mode 100644 drivers/net/cxgbe/clip_tbl.c create mode 100644 drivers/net/cxgbe/clip_tbl.h
drivers/net/cxgbe/Makefile +1 -0
@@ -78,6 +78,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += cxgbe_ethdev.c SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += cxgbe_main.c SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += sge.c SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += t4_hw.c +SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += clip_tbl.c # this lib depends upon: DEPDIRS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += lib/librte_eal lib/librte_ether
drivers/net/cxgbe/base/adapter.h +52 -0
76 lines not on this page · raw message
drivers/net/cxgbe/base/t4fw_interface.h +23 -0
@@ -186,6 +186,7 @@ enum fw_cmd_opcodes {FW_PORT_CMD =0x1b ,FW_RSS_IND_TBL_CMD =0x20 ,FW_RSS_VI_CONFIG_CMD =0x23 , +FW_CLIP_CMD =0x28 , FW_DEBUG_CMD = 0x81, };
@@ -1666,6 +1667,28 @@ struct fw_rss_vi_config_cmd { (((x) >> S_FW_RSS_VI_CONFIG_CMD_UDPEN) & M_FW_RSS_VI_CONFIG_CMD_UDPEN)#define F_FW_RSS_VI_CONFIG_CMD_UDPEN V_FW_RSS_VI_CONFIG_CMD_UDPEN(1U) +struct fw_clip_cmd { +__be32 op_to_write; +__be32 alloc_to_len16; +__be64 ip_hi; +__be64 ip_lo; +__be32 r4[2 ]; +}; + +#define S_FW_CLIP_CMD_ALLOC 31 +#define M_FW_CLIP_CMD_ALLOC 0x1 +#define V_FW_CLIP_CMD_ALLOC (x) ((x) << S_FW_CLIP_CMD_ALLOC) +#define G_FW_CLIP_CMD_ALLOC (x) \ + (((x) >> S_FW_CLIP_CMD_ALLOC) & M_FW_CLIP_CMD_ALLOC) +#define F_FW_CLIP_CMD_ALLOC V_FW_CLIP_CMD_ALLOC(1U) + +#define S_FW_CLIP_CMD_FREE 30 +#define M_FW_CLIP_CMD_FREE 0x1 +#define V_FW_CLIP_CMD_FREE (x) ((x) << S_FW_CLIP_CMD_FREE) +#define G_FW_CLIP_CMD_FREE (x) \ + (((x) >> S_FW_CLIP_CMD_FREE) & M_FW_CLIP_CMD_FREE) +#define F_FW_CLIP_CMD_FREE V_FW_CLIP_CMD_FREE(1U) +/****************************************************************************** * D E B U G C O M M A N D s ******************************************************/
drivers/net/cxgbe/clip_tbl.c new file +220 -0
220 lines not on this page · raw message
drivers/net/cxgbe/clip_tbl.h new file +59 -0
59 lines not on this page · raw message
drivers/net/cxgbe/cxgbe_filter.h +1 -0
@@ -218,6 +218,7 @@ struct filter_entry { u32 locked:1; /* filter is administratively locked */ u32 pending:1; /* filter action is pending FW reply */struct filter_ctx *ctx;/* caller's completion hook */ +struct clip_entry *clipt;/* CLIP Table entry for IPv6 */ struct rte_eth_dev *dev;/* Port's rte eth device */ /* This will store the actual tid */
drivers/net/cxgbe/cxgbe_main.c +11 -0
@@ -66,6 +66,7 @@#include "t4_regs.h" #include "t4_msg.h" #include "cxgbe.h" +#include "clip_tbl.h" /** * Allocate a chunk of memory. The allocated memory is cleared.
@@ -1222,6 +1223,7 @@ void cxgbe_close(struct adapter *adapter)if (adapter->flags &FULL_INIT_DONE ) {tid_free (&adapter->tids); +t4_cleanup_clip_tbl (adapter);t4_intr_disable (adapter);t4_sge_tx_monitor_stop (adapter);t4_free_sge_resources (adapter);
@@ -1364,6 +1366,15 @@ allocate_mac:print_port_info (adapter); + adapter->clipt =t4_init_clip_tbl (adapter->clipt_start, + adapter->clipt_end); +if (!adapter->clipt) { +/* We tolerate a lack of clip_table, giving up some +* functionality +*/ +dev_warn (adapter,"could not allocate CLIP. Continuing\n" ); + } +if (tid_init (&adapter->tids) <0 ) {/* Disable filtering support */ dev_warn(adapter, "could not allocate TID table, "
Signature · 1 line
2.5.3
PATCH 6/10 cxgbe: add layer 2 table for switch action filter
In reply to Rahul LakkireddyAdd Layer 2 Table (L2T) that holds destination mac addresses and vlan ids to be modified on a packet that matches a corresponding set 'switch' action filter.
--- drivers/net/cxgbe/Makefile | 1 + drivers/net/cxgbe/base/adapter.h | 1 + drivers/net/cxgbe/base/t4_msg.h | 58 +++++++ drivers/net/cxgbe/base/t4fw_interface.h | 11 ++ drivers/net/cxgbe/cxgbe_filter.h | 1 + drivers/net/cxgbe/cxgbe_main.c | 12 ++ drivers/net/cxgbe/cxgbe_ofld.h | 9 ++ drivers/net/cxgbe/l2t.c | 261 ++++++++++++++++++++++++++++++++ drivers/net/cxgbe/l2t.h | 87 +++++++++++ 9 files changed, 441 insertions(+) create mode 100644 drivers/net/cxgbe/l2t.c create mode 100644 drivers/net/cxgbe/l2t.h
drivers/net/cxgbe/Makefile +1 -0
@@ -79,6 +79,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += cxgbe_main.c SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += sge.c SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += t4_hw.c SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += clip_tbl.c +SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += l2t.c # this lib depends upon: DEPDIRS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += lib/librte_eal lib/librte_ether
drivers/net/cxgbe/base/adapter.h +1 -0
@@ -339,6 +339,7 @@ struct adapter {struct clip_tbl *clipt;/* CLIP table */ unsigned int l2t_start;/* Layer 2 table start */ unsigned int l2t_end;/* Layer 2 table end */ +struct l2t_data *l2t;/* Layer 2 table */ struct tid_info tids;/* Info used to access TID related tables */ };
drivers/net/cxgbe/base/t4_msg.h +58 -0
82 lines not on this page · raw message
drivers/net/cxgbe/base/t4fw_interface.h +11 -0
@@ -82,6 +82,7 @@ enum fw_memtype {********************************/ enum fw_wr_opcodes { +FW_TP_WR =0x05 ,FW_ETH_TX_PKT_WR =0x08 ,FW_ETH_TX_PKTS_WR =0x09 , };
@@ -101,6 +102,11 @@ struct fw_wr_hdr {#define V_FW_WR_OP (x) ((x) << S_FW_WR_OP)#define G_FW_WR_OP (x) (((x) >> S_FW_WR_OP) & M_FW_WR_OP) +/* atomic flag (hi) - firmware encapsulates CPLs in CPL_BARRIER +*/ +#define S_FW_WR_ATOMIC 23 +#define V_FW_WR_ATOMIC (x) ((x) << S_FW_WR_ATOMIC) +/* work request immediate data length (hi) */ #define S_FW_WR_IMMDLEN 0
@@ -117,6 +123,11 @@ struct fw_wr_hdr {#define G_FW_WR_EQUEQ (x) (((x) >> S_FW_WR_EQUEQ) & M_FW_WR_EQUEQ)#define F_FW_WR_EQUEQ V_FW_WR_EQUEQ(1U) +/* flow context identifier (lo) +*/ +#define S_FW_WR_FLOWID 8 +#define V_FW_WR_FLOWID (x) ((x) << S_FW_WR_FLOWID) +/* length in units of 16-bytes (lo) */ #define S_FW_WR_LEN16 0
drivers/net/cxgbe/cxgbe_filter.h +1 -0
@@ -219,6 +219,7 @@ struct filter_entry { u32 pending:1; /* filter action is pending FW reply */struct filter_ctx *ctx;/* caller's completion hook */ struct clip_entry *clipt;/* CLIP Table entry for IPv6 */ +struct l2t_entry *l2t;/* Layer Two Table entry for dmac */ struct rte_eth_dev *dev;/* Port's rte eth device */ /* This will store the actual tid */
drivers/net/cxgbe/cxgbe_main.c +12 -0
@@ -67,6 +67,7 @@#include "t4_msg.h" #include "cxgbe.h" #include "clip_tbl.h" +#include "l2t.h" /** * Allocate a chunk of memory. The allocated memory is cleared.
@@ -116,6 +117,10 @@ static int fwevtq_handler(struct sge_rspq *q, const __be64 *rsp,const struct cpl_fw6_msg *msg = (const void *)rsp;t4_handle_fw_rpl (q->adapter, msg->data); + }else if (opcode ==CPL_L2T_WRITE_RPL ) { +const struct cpl_l2t_write_rpl *p = (const void *)rsp; + +do_l2t_write_rpl (q->adapter, p); }else {dev_err (adapter,"unexpected CPL %#x on FW event queue\n" , opcode);
@@ -1224,6 +1229,7 @@ void cxgbe_close(struct adapter *adapter)if (adapter->flags &FULL_INIT_DONE ) {tid_free (&adapter->tids);t4_cleanup_clip_tbl (adapter); +t4_cleanup_l2t (adapter);t4_intr_disable (adapter);t4_sge_tx_monitor_stop (adapter);t4_free_sge_resources (adapter);
@@ -1375,6 +1381,12 @@ allocate_mac:dev_warn (adapter,"could not allocate CLIP. Continuing\n" ); } + adapter->l2t =t4_init_l2t (adapter->l2t_start, adapter->l2t_end); +if (!adapter->l2t) { +/* We tolerate a lack of L2T, giving up some functionality */ +dev_warn (adapter,"could not allocate L2T. Continuing\n" ); + } +if (tid_init (&adapter->tids) <0 ) {/* Disable filtering support */ dev_warn(adapter, "could not allocate TID table, "
drivers/net/cxgbe/cxgbe_ofld.h +9 -0
@@ -38,6 +38,15 @@#include "cxgbe_filter.h" +#define INIT_TP_WR (w, tid) do { \ + (w)->wr.wr_hi = cpu_to_be32(V_FW_WR_OP(FW_TP_WR) | \ + V_FW_WR_IMMDLEN(sizeof(*w) - sizeof(w->wr))); \ + (w)->wr.wr_mid = cpu_to_be32( \ + V_FW_WR_LEN16(DIV_ROUND_UP(sizeof(*w), 16)) | \ + V_FW_WR_FLOWID(tid)); \ + (w)->wr.wr_lo = cpu_to_be64(0); \ +} while (0) +/* * Max # of ATIDs. The absolute HW max is 16K but we keep it lower. */
drivers/net/cxgbe/l2t.c new file +261 -0
261 lines not on this page · raw message
drivers/net/cxgbe/l2t.h new file +87 -0
87 lines not on this page · raw message
Signature · 1 line
2.5.3
PATCH 7/10 cxgbe: add source mac table for switch action filter
In reply to Rahul LakkireddyAdd Source MAC Table (SMT) that holds source mac addresses to be modified on a packet that matches a corresponding set 'switch' action filter.
--- drivers/net/cxgbe/Makefile | 1 + drivers/net/cxgbe/base/adapter.h | 1 + drivers/net/cxgbe/base/t4_msg.h | 29 +++++ drivers/net/cxgbe/cxgbe_filter.h | 2 + drivers/net/cxgbe/cxgbe_main.c | 12 ++ drivers/net/cxgbe/smt.c | 275 +++++++++++++++++++++++++++++++++++++++ drivers/net/cxgbe/smt.h | 76 +++++++++++ 7 files changed, 396 insertions(+) create mode 100644 drivers/net/cxgbe/smt.c create mode 100644 drivers/net/cxgbe/smt.h
drivers/net/cxgbe/Makefile +1 -0
@@ -80,6 +80,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += sge.c SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += t4_hw.c SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += clip_tbl.c SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += l2t.c +SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += smt.c # this lib depends upon: DEPDIRS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += lib/librte_eal lib/librte_ether
drivers/net/cxgbe/base/adapter.h +1 -0
@@ -340,6 +340,7 @@ struct adapter {unsigned int l2t_start;/* Layer 2 table start */ unsigned int l2t_end;/* Layer 2 table end */ struct l2t_data *l2t;/* Layer 2 table */ +struct smt_data *smt;/* Source MAC table */ struct tid_info tids;/* Info used to access TID related tables */ };
drivers/net/cxgbe/base/t4_msg.h +29 -0
@@ -36,7 +36,9 @@enum {CPL_L2T_WRITE_REQ =0x12 , +CPL_SMT_WRITE_REQ =0x14 ,CPL_L2T_WRITE_RPL =0x23 , +CPL_SMT_WRITE_RPL =0x2E ,CPL_SGE_EGR_UPDATE =0xA5 ,CPL_FW4_MSG =0xC0 ,CPL_FW6_MSG =0xE0 ,
@@ -320,6 +322,33 @@ struct cpl_l2t_write_rpl {#define V_RXF_IP6 (x) ((x) << S_RXF_IP6)#define F_RXF_IP6 V_RXF_IP6(1U) +struct cpl_smt_write_req { +WR_HDR ; +union opcode_tid ot; +__be32 params; +__be16 pfvf1; +__u8 src_mac1[6 ]; +__be16 pfvf0; +__u8 src_mac0[6 ]; +}; + +struct cpl_smt_write_rpl { +RSS_HDR + union opcode_tid ot; +__u8 status; +__u8 rsvd[3 ]; +}; + +/* cpl_smt_{read,write}_req.params fields */ +#define S_SMTW_OVLAN_IDX 16 +#define V_SMTW_OVLAN_IDX (x) ((x) << S_SMTW_OVLAN_IDX) + +#define S_SMTW_IDX 20 +#define V_SMTW_IDX (x) ((x) << S_SMTW_IDX) + +#define S_SMTW_NORPL 31 +#define V_SMTW_NORPL (x) ((x) << S_SMTW_NORPL) +/* cpl_fw*.type values */ enum {FW_TYPE_RSSCPL =4 ,
drivers/net/cxgbe/cxgbe_filter.h +2 -0
@@ -217,9 +217,11 @@ struct filter_entry { u32 valid:1; /* filter allocated and valid */ u32 locked:1; /* filter is administratively locked */ u32 pending:1; /* filter action is pending FW reply */ + u32 smtidx:8; /* Source MAC Table index for smac */struct filter_ctx *ctx;/* caller's completion hook */ struct clip_entry *clipt;/* CLIP Table entry for IPv6 */ struct l2t_entry *l2t;/* Layer Two Table entry for dmac */ +struct smt_entry *smt;/* Source Mac Table entry for smac */ struct rte_eth_dev *dev;/* Port's rte eth device */ /* This will store the actual tid */
drivers/net/cxgbe/cxgbe_main.c +12 -0
@@ -68,6 +68,7 @@#include "cxgbe.h" #include "clip_tbl.h" #include "l2t.h" +#include "smt.h" /** * Allocate a chunk of memory. The allocated memory is cleared.
@@ -117,6 +118,10 @@ static int fwevtq_handler(struct sge_rspq *q, const __be64 *rsp,const struct cpl_fw6_msg *msg = (const void *)rsp;t4_handle_fw_rpl (q->adapter, msg->data); + }else if (opcode ==CPL_SMT_WRITE_RPL ) { +const struct cpl_smt_write_rpl *p = (const void *)rsp; + +do_smt_write_rpl (q->adapter, p); }else if (opcode ==CPL_L2T_WRITE_RPL ) {const struct cpl_l2t_write_rpl *p = (const void *)rsp;
@@ -1230,6 +1235,7 @@ void cxgbe_close(struct adapter *adapter)tid_free (&adapter->tids);t4_cleanup_clip_tbl (adapter);t4_cleanup_l2t (adapter); +t4_cleanup_smt (adapter);t4_intr_disable (adapter);t4_sge_tx_monitor_stop (adapter);t4_free_sge_resources (adapter);
@@ -1387,6 +1393,12 @@ allocate_mac:dev_warn (adapter,"could not allocate L2T. Continuing\n" ); } + adapter->smt =t4_init_smt (); +if (!adapter->smt) { +/* We tolerate a lack of SMT, giving up some functionality */ +dev_warn (adapter,"could not allocate SMT. Continuing\n" ); + } +if (tid_init (&adapter->tids) <0 ) {/* Disable filtering support */ dev_warn(adapter, "could not allocate TID table, "
drivers/net/cxgbe/smt.c new file +275 -0
275 lines not on this page · raw message
drivers/net/cxgbe/smt.h new file +76 -0
76 lines not on this page · raw message
Signature · 1 line
2.5.3
PATCH 8/10 cxgbe: add LE-TCAM filtering support
In reply to Rahul LakkireddyAdd support for setting LE-TCAM (Maskfull) filters. IPv4 filters occupy one index per filter, but IPv6 filters occupy 4 indices per filter and must be on boundary aligned by 4. Filters with lower index have higher priority over filters with higher index. When a filter is hit, the rest of the filters with a higher index are ignored and the action is taken immediately.
--- drivers/net/cxgbe/Makefile | 1 + drivers/net/cxgbe/base/adapter.h | 21 + drivers/net/cxgbe/base/common.h | 2 + drivers/net/cxgbe/base/t4_hw.c | 3 + drivers/net/cxgbe/base/t4_msg.h | 39 ++ drivers/net/cxgbe/base/t4_tcb.h | 74 +++ drivers/net/cxgbe/base/t4fw_interface.h | 145 ++++++ drivers/net/cxgbe/cxgbe_filter.c | 802 ++++++++++++++++++++++++++++++++ drivers/net/cxgbe/cxgbe_filter.h | 18 + drivers/net/cxgbe/cxgbe_main.c | 6 + drivers/net/cxgbe/cxgbe_ofld.h | 5 + 11 files changed, 1116 insertions(+) create mode 100644 drivers/net/cxgbe/base/t4_tcb.h create mode 100644 drivers/net/cxgbe/cxgbe_filter.c
drivers/net/cxgbe/Makefile +1 -0
@@ -81,6 +81,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += t4_hw.c SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += clip_tbl.c SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += l2t.c SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += smt.c +SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += cxgbe_filter.c # this lib depends upon: DEPDIRS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += lib/librte_eal lib/librte_ether
drivers/net/cxgbe/base/adapter.h +21 -0
@@ -575,6 +575,27 @@ static inline void t4_os_write_unlock(rte_rwlock_t *lock) }/** +* t4_init_completion - initialize completion +* @c: the completion context +*/ +static inline void t4_init_completion (struct t4_completion *c) +{ + c->done =0 ; +t4_os_lock_init (&c->lock); +} + +/** +* t4_complete - set completion as done +* @c: the completion context +*/ +static inline void t4_complete (struct t4_completion *c) +{ +t4_os_lock (&c->lock); + c->done =1 ; +t4_os_unlock (&c->lock); +} + +/** * ethdev2pinfo - return the port_info structure associated with a rte_eth_dev * @dev: the rte_eth_dev *
drivers/net/cxgbe/base/common.h +2 -0
@@ -162,7 +162,9 @@ struct tp_params {int vlan_shift;int vnic_shift;int port_shift; +int tos_shift;int protocol_shift; +int ethertype_shift; };struct vpd_params {
drivers/net/cxgbe/base/t4_hw.c +3 -0
@@ -2574,8 +2574,11 @@ int t4_init_tp_params(struct adapter *adap) adap->params.tp.vlan_shift =t4_filter_field_shift (adap,F_VLAN ); adap->params.tp.vnic_shift =t4_filter_field_shift (adap,F_VNIC_ID ); adap->params.tp.port_shift =t4_filter_field_shift (adap,F_PORT ); + adap->params.tp.tos_shift =t4_filter_field_shift (adap,F_TOS ); adap->params.tp.protocol_shift =t4_filter_field_shift (adap,F_PROTOCOL ); + adap->params.tp.ethertype_shift =t4_filter_field_shift (adap, +F_ETHERTYPE );/* * If TP_INGRESS_CONFIG.VNID == 0, then TP_VLAN_PRI_MAP.VNIC_ID
drivers/net/cxgbe/base/t4_msg.h +39 -0
@@ -35,10 +35,12 @@#define T4_MSG_H enum { +CPL_SET_TCB_FIELD =0x5 ,CPL_L2T_WRITE_REQ =0x12 ,CPL_SMT_WRITE_REQ =0x14 ,CPL_L2T_WRITE_RPL =0x23 ,CPL_SMT_WRITE_RPL =0x2E , +CPL_SET_TCB_RPL =0x3A ,CPL_SGE_EGR_UPDATE =0xA5 ,CPL_FW4_MSG =0xC0 ,CPL_FW6_MSG =0xE0 ,
@@ -125,6 +127,43 @@ struct work_request_hdr {#define WR_HDR_SIZE 0#endif +/* cpl_get_tcb.reply_ctrl fields */ +#define S_QUEUENO 0 +#define V_QUEUENO (x) ((x) << S_QUEUENO) + +#define S_REPLY_CHAN 14 +#define V_REPLY_CHAN (x) ((x) << S_REPLY_CHAN) + +#define S_NO_REPLY 15 +#define V_NO_REPLY (x) ((x) << S_NO_REPLY) + +struct cpl_set_tcb_field { +WR_HDR ; +union opcode_tid ot; +__be16 reply_ctrl; +__be16 word_cookie; +__be64 mask; +__be64 val; +}; + +/* cpl_set_tcb_field.word_cookie fields */ +#define S_WORD 0 +#define V_WORD (x) ((x) << S_WORD) + +#define S_COOKIE 5 +#define M_COOKIE 0x7 +#define V_COOKIE (x) ((x) << S_COOKIE) +#define G_COOKIE (x) (((x) >> S_COOKIE) & M_COOKIE) + +struct cpl_set_tcb_rpl { +RSS_HDR + union opcode_tid ot; +__be16 rsvd; +__u8 cookie; +__u8 status; +__be64 oldval; +}; +struct cpl_tx_data {union opcode_tid ot;__be32 len;
drivers/net/cxgbe/base/t4_tcb.h new file +74 -0
74 lines not on this page · raw message
drivers/net/cxgbe/base/t4fw_interface.h +145 -0
157 lines not on this page · raw message
drivers/net/cxgbe/cxgbe_filter.c new file +802 -0
802 lines not on this page · raw message
drivers/net/cxgbe/cxgbe_filter.h +18 -0
@@ -34,6 +34,8 @@#ifndef _CXGBE_FILTER_H_#define _CXGBE_FILTER_H_ +#include "t4_msg.h" +/* * Defined bit width of user definable filter tuples */
@@ -232,4 +234,20 @@ struct filter_entry {*/ struct ch_filter_specification fs; }; + +struct adapter ; + +void filter_rpl (struct adapter *adap,const struct cpl_set_tcb_rpl *rpl); +void clear_filter (struct filter_entry *f); +int set_filter_wr (struct rte_eth_dev *dev,unsigned int fidx); +int delete_filter (struct rte_eth_dev *dev,unsigned int fidx); +int writable_filter (struct filter_entry *f); +int cxgbe_set_filter (struct rte_eth_dev *dev,unsigned int filter_id, +struct ch_filter_specification *fs, +struct filter_ctx *ctx); +int cxgbe_del_filter (struct rte_eth_dev *dev,unsigned int filter_id, +struct ch_filter_specification *fs, +struct filter_ctx *ctx); + +void cxgbe_clear_all_filters (struct adapter *adapter);#endif /* _CXGBE_FILTER_H_ */
drivers/net/cxgbe/cxgbe_main.c +6 -0
@@ -69,6 +69,7 @@#include "clip_tbl.h" #include "l2t.h" #include "smt.h" +#include "cxgbe_filter.h" /** * Allocate a chunk of memory. The allocated memory is cleared.
@@ -118,6 +119,10 @@ static int fwevtq_handler(struct sge_rspq *q, const __be64 *rsp,const struct cpl_fw6_msg *msg = (const void *)rsp;t4_handle_fw_rpl (q->adapter, msg->data); + }else if (opcode ==CPL_SET_TCB_RPL ) { +const struct cpl_set_tcb_rpl *p = (const void *)rsp; + +filter_rpl (q->adapter, p); }else if (opcode ==CPL_SMT_WRITE_RPL ) {const struct cpl_smt_write_rpl *p = (const void *)rsp;
@@ -1232,6 +1237,7 @@ void cxgbe_close(struct adapter *adapter)int i;if (adapter->flags &FULL_INIT_DONE ) { +cxgbe_clear_all_filters (adapter);tid_free (&adapter->tids);t4_cleanup_clip_tbl (adapter);t4_cleanup_l2t (adapter);
drivers/net/cxgbe/cxgbe_ofld.h +5 -0
@@ -47,6 +47,11 @@ (w)->wr.wr_lo =cpu_to_be64 (0 ); \ } while (0) +#define INIT_TP_WR_MIT_CPL (w, cpl, tid) do { \ + INIT_TP_WR(w, tid); \ + OPCODE_TID(w) = cpu_to_be32(MK_OPCODE_TID(cpl, tid)); \ +} while (0) +/* * Max # of ATIDs. The absolute HW max is 16K but we keep it lower. */
Signature · 1 line
2.5.3
PATCH 9/10 cxgbe: add HASH filtering support
In reply to Rahul LakkireddyAdd support for setting HASH (Maskless) filters. Both IPv4 and IPv6 occupy only one index per filter. Also, the index returned is a hash computed by the hardware based on value in the fields being matched. During matching, the hardware computes a hash of the relevant fields in the incoming packet and compares it against the hashed indices. If a match is found, then the filter's action is taken immediately.
HASH filters have higher priority over LE-TCAM filters if a packet matches rules in both the HASH filter region and the LE-TCAM filter region. This can be changed by setting the prio bit in the filter specification.
--- drivers/net/cxgbe/base/adapter.h | 11 + drivers/net/cxgbe/base/common.h | 7 + drivers/net/cxgbe/base/t4_msg.h | 198 ++++++++ drivers/net/cxgbe/base/t4_regs.h | 9 + drivers/net/cxgbe/base/t4_regs_values.h | 25 + drivers/net/cxgbe/base/t4_tcb.h | 21 + drivers/net/cxgbe/base/t4fw_interface.h | 19 + drivers/net/cxgbe/cxgbe_compat.h | 12 + drivers/net/cxgbe/cxgbe_filter.c | 812 ++++++++++++++++++++++++++++++++ drivers/net/cxgbe/cxgbe_filter.h | 7 + drivers/net/cxgbe/cxgbe_main.c | 135 +++++- drivers/net/cxgbe/cxgbe_ofld.h | 26 + 12 files changed, 1280 insertions(+), 2 deletions(-)
drivers/net/cxgbe/base/adapter.h +11 -0
@@ -629,6 +629,17 @@ static inline struct adapter *ethdev2adap(const struct rte_eth_dev *dev)return ethdev2pinfo (dev)->adapter; } +/** +* cxgbe_port_viid - get the VI id of a port +* @dev: the device for the port +* +* Return the VI id of the given port. +*/ +static inline unsigned int cxgbe_port_viid (const struct rte_eth_dev *dev) +{ +return ethdev2pinfo (dev)->viid; +} +void *t4_alloc_mem (size_t size);void t4_free_mem (void *addr);#define t4_os_alloc (_size) t4_alloc_mem((_size))
drivers/net/cxgbe/base/common.h +7 -0
@@ -220,6 +220,8 @@ struct adapter_params {unsigned char nports;/* # of ethernet ports */ unsigned char portvec; +unsigned char hash_filter; +enum chip_type chip;/* chip code */ struct arch_specific_params arch;/* chip specific params */
@@ -255,6 +257,11 @@ static inline int t4_wait_op_done(struct adapter *adapter, int reg, u32 mask,#define for_each_port (adapter, iter) \ for (iter = 0; iter < (adapter)->params.nports; ++iter) +static inline int is_hashfilter (const struct adapter *adap) +{ +return adap->params.hash_filter; +} +void t4_read_mtu_tbl (struct adapter *adap,u16 *mtus,u8 *mtu_log);void t4_tp_wr_bits_indirect (struct adapter *adap,unsigned int addr,unsigned int mask,unsigned int val);
drivers/net/cxgbe/base/t4_msg.h +198 -0
235 lines not on this page · raw message
drivers/net/cxgbe/base/t4_regs.h +9 -0
@@ -793,3 +793,12 @@#define M_REV 0xfU#define V_REV (x) ((x) << S_REV)#define G_REV (x) (((x) >> S_REV) & M_REV) + +/* registers for module LE */ +#define A_LE_DB_CONFIG 0x19c04 + +#define S_HASHEN 20 +#define V_HASHEN (x) ((x) << S_HASHEN) +#define F_HASHEN V_HASHEN(1U) + +#define A_LE_DB_TID_HASHBASE 0x19df8
drivers/net/cxgbe/base/t4_regs_values.h +25 -0
@@ -155,6 +155,9 @@* selects for a particular field being present. These fields, when present * in the Compressed Filter Tuple, have the following widths in bits. */ +#define S_FT_FIRST S_FCOE +#define S_FT_LAST S_FRAGMENTATION +#define W_FT_FCOE 1#define W_FT_PORT 3#define W_FT_VNIC_ID 17
@@ -166,4 +169,26 @@#define W_FT_MPSHITTYPE 3#define W_FT_FRAGMENTATION 1 +/* +* Some of the Compressed Filter Tuple fields have internal structure. These +* bit shifts/masks describe those structures. All shifts are relative to the +* base position of the fields within the Compressed Filter Tuple +*/ +#define S_FT_VLAN_VLD 16 +#define V_FT_VLAN_VLD (x) ((x) << S_FT_VLAN_VLD) +#define F_FT_VLAN_VLD V_FT_VLAN_VLD(1U) + +#define S_FT_VNID_ID_VF 0 +#define M_FT_VNID_ID_VF 0x7fU +#define V_FT_VNID_ID_VF (x) ((x) << S_FT_VNID_ID_VF) +#define G_FT_VNID_ID_VF (x) (((x) >> S_FT_VNID_ID_VF) & M_FT_VNID_ID_VF) + +#define S_FT_VNID_ID_PF 7 +#define M_FT_VNID_ID_PF 0x7U +#define V_FT_VNID_ID_PF (x) ((x) << S_FT_VNID_ID_PF) +#define G_FT_VNID_ID_PF (x) (((x) >> S_FT_VNID_ID_PF) & M_FT_VNID_ID_PF) + +#define S_FT_VNID_ID_VLD 16 +#define V_FT_VNID_ID_VLD (x) ((x) << S_FT_VNID_ID_VLD) +#define F_FT_VNID_ID_VLD (x) V_FT_VNID_ID_VLD(1U)#endif /* __T4_REGS_VALUES_H__ */
drivers/net/cxgbe/base/t4_tcb.h +21 -0
@@ -60,6 +60,27 @@#define M_TCB_T_RTT_TS_RECENT_AGE 0xffffffffULL#define V_TCB_T_RTT_TS_RECENT_AGE (x) ((x) << S_TCB_T_RTT_TS_RECENT_AGE) +/* 347:320 */ +#define W_TCB_SND_UNA_RAW 10 + +/* 553:522 */ +#define W_TCB_RCV_NXT 16 +#define S_TCB_RCV_NXT 10 +#define M_TCB_RCV_NXT 0xffffffffULL +#define V_TCB_RCV_NXT (x) ((__u64)(x) << S_TCB_RCV_NXT) + +/* 891:875 */ +#define W_TCB_RX_FRAG2_PTR_RAW 27 + +/* 964:937 */ +#define W_TCB_RX_FRAG3_LEN_RAW 29 + +/* 992:965 */ +#define W_TCB_RX_FRAG3_START_IDX_OFFSET_RAW 30 + +/* 1000:993 */ +#define W_TCB_PDU_HDR_LEN 31 +#define S_TF_MIGRATING 0#define V_TF_MIGRATING (x) ((x) << S_TF_MIGRATING)
drivers/net/cxgbe/base/t4fw_interface.h +19 -0
@@ -83,6 +83,7 @@ enum fw_memtype {enum fw_wr_opcodes {FW_FILTER_WR =0x02 , +FW_ULPTX_WR =0x04 ,FW_TP_WR =0x05 ,FW_ETH_TX_PKT_WR =0x08 ,FW_ETH_TX_PKTS_WR =0x09 ,
@@ -1009,6 +1010,24 @@ struct fw_eq_ctrl_cmd {#define S_FW_EQ_CTRL_CMD_EQSIZE 0#define V_FW_EQ_CTRL_CMD_EQSIZE (x) ((x) << S_FW_EQ_CTRL_CMD_EQSIZE) +/* Macros for VIID parsing: +* VIID - [10:8] PFN, [7] VI Valid, [6:0] VI number +*/ +#define S_FW_VIID_PFN 8 +#define M_FW_VIID_PFN 0x7 +#define V_FW_VIID_PFN (x) ((x) << S_FW_VIID_PFN) +#define G_FW_VIID_PFN (x) (((x) >> S_FW_VIID_PFN) & M_FW_VIID_PFN) + +#define S_FW_VIID_VIVLD 7 +#define M_FW_VIID_VIVLD 0x1 +#define V_FW_VIID_VIVLD (x) ((x) << S_FW_VIID_VIVLD) +#define G_FW_VIID_VIVLD (x) (((x) >> S_FW_VIID_VIVLD) & M_FW_VIID_VIVLD) + +#define S_FW_VIID_VIN 0 +#define M_FW_VIID_VIN 0x7F +#define V_FW_VIID_VIN (x) ((x) << S_FW_VIID_VIN) +#define G_FW_VIID_VIN (x) (((x) >> S_FW_VIID_VIN) & M_FW_VIID_VIN) +enum fw_vi_func {FW_VI_FUNC_ETH , };
drivers/net/cxgbe/cxgbe_compat.h +12 -0
@@ -263,4 +263,16 @@ static inline void writeq(u64 val, volatile void __iomem *addr) writel(val >> 32, (void *)((uintptr_t)addr + 4)); } +/* +* Multiplies an integer by a fraction, while avoiding unnecessary +* overflow or loss of precision. +*/ +#define mult_frac (x, numer, denom)( \ +{ \ + typeof(x) quot = (x) / (denom); \ + typeof(x) rem = (x) % (denom); \ + (quot * (numer)) + ((rem * (numer)) / (denom)); \ +} \ +) +#endif /* _CXGBE_COMPAT_H_ */
drivers/net/cxgbe/cxgbe_filter.c +812 -0
845 lines not on this page · raw message
drivers/net/cxgbe/cxgbe_filter.h +7 -0
@@ -235,6 +235,8 @@ struct filter_entry {struct ch_filter_specification fs; }; +#define WORD_MASK 0xffffffff +struct adapter ;void filter_rpl (struct adapter *adap,const struct cpl_set_tcb_rpl *rpl);
@@ -249,5 +251,10 @@ int cxgbe_del_filter(struct rte_eth_dev *dev, unsigned int filter_id,struct ch_filter_specification *fs, struct filter_ctx *ctx); +int init_hash_filter (struct adapter *adap); +void hash_filter_rpl (struct adapter *adap,const struct cpl_act_open_rpl *rpl); +void hash_del_filter_rpl (struct adapter *adap, +const struct cpl_abort_rpl_rss *rpl); +void cxgbe_clear_all_filters (struct adapter *adapter);#endif /* _CXGBE_FILTER_H_ */
drivers/net/cxgbe/cxgbe_main.c +133 -2
165 lines not on this page · raw message
drivers/net/cxgbe/cxgbe_ofld.h +26 -0
@@ -52,6 +52,14 @@OPCODE_TID (w) =cpu_to_be32 (MK_OPCODE_TID (cpl, tid)); \ } while (0) +#define INIT_ULPTX_WR (w, wrlen, atomic, tid) do { \ + (w)->wr.wr_hi = cpu_to_be32(V_FW_WR_OP(FW_ULPTX_WR) | \ + V_FW_WR_ATOMIC(atomic)); \ + (w)->wr.wr_mid = cpu_to_be32(V_FW_WR_LEN16(DIV_ROUND_UP(wrlen, 16)) | \ + V_FW_WR_FLOWID(tid)); \ + (w)->wr.wr_lo = cpu_to_be64(0); \ +} while (0) +/* * Max # of ATIDs. The absolute HW max is 16K but we keep it lower. */
@@ -97,4 +105,22 @@ struct tid_info {rte_atomic32_t conns_in_use;rte_spinlock_t ftid_lock; }; + +static inline void *lookup_tid (const struct tid_info *t,unsigned int tid) +{ +return tid < t->ntids ? t->tid_tab[tid] :NULL ; +} + +static inline void *lookup_atid (const struct tid_info *t,unsigned int atid) +{ +return atid < t->natids ? t->atid_tab[atid].data :NULL ; +} + +int cxgbe_alloc_atid (struct tid_info *t,void *data); +void cxgbe_free_atid (struct tid_info *t,unsigned int atid); + +void cxgbe_remove_tid (struct tid_info *t,unsigned int qid,unsigned int tid, +unsigned short family); +void cxgbe_insert_tid (struct tid_info *t,void *data,unsigned int tid, +unsigned short family);#endif /* _CXGBE_OFLD_H_ */
Signature · 1 line
2.5.3
PATCH 10/10 cxgbe: add flow director support and update documentation
In reply to Rahul LakkireddyAdd flow director support for setting/deleting LE-TCAM (maskfull) and HASH (maskless) filters.
Wait and poll firmware event queue for replies about the filter status. Also, the firware event queue doesn't have any freelists. So, there is no need to refill any.
Provide stats showing the number of remaining free entries, and number of successful and failed added/deleted filters.
Add documentation explaining the usage of CXGBE Flow Director support.
--- doc/guides/nics/cxgbe.rst | 166 ++++++++ doc/guides/rel_notes/release_2_3.rst | 7 + drivers/net/cxgbe/Makefile | 1 + drivers/net/cxgbe/base/adapter.h | 2 + drivers/net/cxgbe/cxgbe.h | 3 + drivers/net/cxgbe/cxgbe_ethdev.c | 18 + drivers/net/cxgbe/cxgbe_fdir.c | 715 +++++++++++++++++++++++++++++++++++ drivers/net/cxgbe/cxgbe_fdir.h | 108 ++++++ drivers/net/cxgbe/cxgbe_main.c | 40 ++ drivers/net/cxgbe/sge.c | 3 +- 10 files changed, 1062 insertions(+), 1 deletion(-) create mode 100644 drivers/net/cxgbe/cxgbe_fdir.c create mode 100644 drivers/net/cxgbe/cxgbe_fdir.h
doc/guides/nics/cxgbe.rst +166 -0
@@ -51,6 +51,7 @@ CXGBE PMD has support for: - All multicast mode - Port hardware statistics - Jumbo frames +- Packet classification and filtering Limitations -----------
@@ -187,6 +188,13 @@ Unified Wire package for Linux operating system are as follows: cxgbtool p1p1 loadcfg <path_to_uwire>/src/network/firmware/t5-config.txt + .. note:: + + To enable HASH filters, a special firmware configuration file is needed. + The file is located under the following directory: + + <path_to_uwire>/src/network/firmware/hash_filter_config/t5-config.txt + #. Use cxgbtool to load the firmware image onto the card: .. code-block:: console
@@ -541,6 +549,66 @@ devices managed by librte_pmd_cxgbe in FreeBSD operating system. Flow control pause TX/RX is disabled by default and can be enabled via testpmd. Refer section :ref:`flow-control` for more details. + +.. _filtering: + +Packet Classification and Filtering +----------------------------------- + +Chelsio T5 NICs support packet classification and filtering in hardware. +This feature can be used in the ingress path to: + +- Steer ingress packets that meet ACL (Access Control List) accept criteria + to a particular receive queue. + +- Switch (proxy) ingress packets that meet ACL accept criteria to an output + port, with optional header rewrite. + +- Drop ingress packets that fail ACL accept criteria. + +There are two types of filters that can be set, namely LE-TCAM (Maskfull) +filters and HASH (Maskless) filters. LE-TCAM filters allow specifying masks +to the accept criteria to allow specifying a match for a range of values; +whereas, HASH filters ignore masks and hence enforce a more strict accept +criteria. + +By default, only LE-TCAM filter rules can be created. Creating HASH filters +requires a special firmware configuration file. Instructions on how to +manually flash the firmware configuration file are given in section +:ref:`linux-installation`. + +The fields that can be specified for the accept criteria are based on the +filter selection combination set in the firmware configuration +(t5-config.txt) file flashed in section :ref:`linux-installation`. + +By default, the selection combination automatically includes source/ +destination IPV4/IPV6 address, and source/destination layer 4 port +addresses. In addition to the above, more combinations can be added by +modifying the t5-config.txt firmware configuration file. + +For example, consider the following combination that has been set in +t5-config.txt: + +.. code-block:: console + + filterMode = ethertype, protocol, tos, vlan, port + filterMask = ethertype, protocol, tos, vlan, port + +In the above example, in addition to source/destination IPV4/IPV6 +addresses and layer 4 source/destination port addresses, a packet can also +be matched against ethertype field set in the ethernet header, IP protocol +and tos field set in the IP header, inner VLAN tag, and physical ingress +port number, respectively. + +You can create 496 LE-TCAM filters and ~0.5 million HASH filter rules. +For more information, please visit `Chelsio Communications Official Website +<http://www.chelsio.com>`_. + +To test packet classification and filtering on a Chelsio NIC, an +example app is provided in **examples/test-cxgbe-filters/** directory. +Please see :doc:`Test CXGBE Filters Application Guide +</sample_app_ug/test_cxgbe_filters>` to compile and run the example app. + Sample Application Notes ------------------------
@@ -587,3 +655,101 @@ to configure the mtu of all the ports with a single command. testpmd> port stop all testpmd> port config all max-pkt-len 9000 + +Add/Delete Filters +~~~~~~~~~~~~~~~~~~ + +To test packet classification and filtering on a Chelsio NIC, an +example app is provided in **examples/test-cxgbe-filters/** directory. +Please see :doc:`Test CXGBE Filters Application Guide +</sample_app_ug/test_cxgbe_filters>` to compile and run the app. +The examples below have to be run on the **test_cxgbe_filters** app. + +The command line to add/delete filters is given below. Note that the +command is too long to fit on one line and hence is shown wrapped +at "\\" for display purposes. In real prompt, these commands should +be on a single line without the "\\". + + .. code-block:: console + + cxgbe> filter (port_id) (add|del) (ipv4|ipv6) \ + mode (maskfull|maskless) (no-prio|prio) \ + ingress-port (iport) (iport_mask) \ + ether (ether_type) (ether_type_mask) \ + vlan (inner_vlan) (inner_vlan_mask) \ + (outer_vlan) (outer_vlan_mask) \ + ip (tos) (tos_mask) (proto) (proto_mask) \ + (src_ip_address) (src_ip_mask) \ + (dst_ip_address) (dst_ip_mask) \ + (src_port) (src_port_mask) (dst_port) (dst_port_mask) \ + (drop|fwd|switch) queue (queue_id) \ + (port-none|port-redirect) (egress_port) \ + (ether-none|mac-rewrite|mac-swap) (src_mac) (dst_mac) \ + (vlan-none|vlan-rewrite|vlan-delete) (new_vlan) \ + (nat-none|nat-rewrite) (nat_src_ip) (nat_dst_ip) \ + (nat_src_port) (nat_dst_port) \ + fd_id (fd_id_value) + +LE-TCAM (Maskfull) Filters +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- To drop all traffic coming for 102.1.2.0/24 network, add a maskfull + filter as follows: + + .. code-block:: console + + cxgbe> filter 0 add ipv4 mode maskfull \ + no-prio ingress-port 0 0 ether 0 0 vlan 0 0 0 0 \ + ip 0 0 0 0 0.0.0.0 0.0.0.0 102.1.2.0 255.255.255.0 0 0 0 0 \ + drop queue 0 port-none 0 \ + ether-none 00:00:00:00:00:00 00:00:00:00:00:00 \ + vlan-none 0 nat-none 0.0.0.0 0.0.0.0 0 0 \ + fd_id 0 + +- To switch all traffic coming for 102.1.2.0/24 network out via port 1 + with source and destination mac addresses rewritten, add a maskfull + filter as follows: + + .. code-block:: console + + cxgbe> filter 0 add ipv4 mode maskfull \ + no-prio ingress-port 0 0 ether 0 0 vlan 0 0 0 0 \ + ip 0 0 0 0 0.0.0.0 0.0.0.0 102.1.2.0 255.255.255.0 0 0 0 0 \ + switch queue 0 port-redirect 1 \ + mac-rewrite 00:07:43:04:96:48 00:07:43:12:D4:88 \ + vlan-none 0 nat-none 0.0.0.0 0.0.0.0 0 0 \ + fd_id 0 + +HASH (Maskless) Filters +^^^^^^^^^^^^^^^^^^^^^^^ + +Maskless filters require a special firmware configuration file. Please see +section :ref:`filtering` for more information. + +- To steer all traffic coming for 102.1.2.2 with destination port 12865 + from 102.1.2.1 with source port 12000 to port 1's rx queue, add a + maskless filter as follows: + + .. code-block:: console + + cxgbe> filter 1 add ipv4 mode maskless \ + no-prio ingress-port 0 0 ether 0 0 vlan 0 0 0 0 \ + ip 0 0 0 0 102.1.2.1 0.0.0.0 102.1.2.2 0.0.0.0 12000 0 12865 0 \ + fwd queue 0 port-none 0 \ + ether-none 00:00:00:00:00:00 00:00:00:00:00:00 \ + vlan-none 0 nat-none 0.0.0.0 0.0.0.0 0 0 \ + fd_id 0 + +- To swap the source and destination mac addresses of all traffic coming + for 102.1.2.2 with destination port 12865 from 102.1.2.1 with source + port 12000, add a maskless filter as follows: + + .. code-block:: console + + cxgbe> filter 0 add ipv4 mode maskless \ + no-prio ingress-port 0 0 ether 0 0 vlan 0 0 0 0 \ + ip 0 0 0 0 102.1.2.1 0.0.0.0 102.1.2.2 0.0.0.0 12000 0 12865 0 \ + switch queue 0 port-redirect 1 \ + mac-swap 00:00:00:00:00:00 00:00:00:00:00:00 \ + vlan-none 0 nat-none 0.0.0.0 0.0.0.0 0 0 \ + fd_id 0
doc/guides/rel_notes/release_2_3.rst +7 -0
@@ -4,6 +4,13 @@ DPDK Release 2.3 New Features ------------ +* **Added flow director support for Chelsio CXGBE driver.** + + * Added flow director support to enable Chelsio T5 NIC hardware filtering + features. + * Added an example app under ``examples/test-cxgbe-filters`` directory + to test Chelsio T5 NIC hardware filtering features. + Resolved Issues ---------------
drivers/net/cxgbe/Makefile +1 -0
@@ -82,6 +82,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += clip_tbl.c SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += l2t.c SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += smt.c SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += cxgbe_filter.c +SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += cxgbe_fdir.c # this lib depends upon: DEPDIRS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += lib/librte_eal lib/librte_ether
drivers/net/cxgbe/base/adapter.h +2 -0
@@ -342,6 +342,8 @@ struct adapter {struct l2t_data *l2t;/* Layer 2 table */ struct smt_data *smt;/* Source MAC table */ struct tid_info tids;/* Info used to access TID related tables */ + +struct cxgbe_fdir_map *fdir;/* Flow Director */ };#define CXGBE_PCI_REG (reg) (*((volatile uint32_t *)(reg)))
drivers/net/cxgbe/cxgbe.h +3 -0
@@ -36,6 +36,7 @@#include "common.h" #include "t4_regs.h" +#include "cxgbe_fdir.h" #define CXGBE_MIN_RING_DESC_SIZE 128/* Min TX/RX descriptor ring size */ #define CXGBE_MAX_RING_DESC_SIZE 4096/* Max TX/RX descriptor ring size */
@@ -52,6 +53,8 @@ int cxgbe_down(struct port_info *pi);void cxgbe_close (struct adapter *adapter);void cxgbe_stats_get (struct port_info *pi,struct port_stats *stats);void cxgbe_stats_reset (struct port_info *pi); +int cxgbe_poll_for_completion (struct sge_rspq *q,unsigned int us, +unsigned int cnt,struct t4_completion *c);int link_start (struct port_info *pi);void init_rspq (struct adapter *adap,struct sge_rspq *q,unsigned int us,unsigned int cnt,unsigned int size,unsigned int iqe_size);
drivers/net/cxgbe/cxgbe_ethdev.c +18 -0
@@ -770,6 +770,23 @@ static int cxgbe_flow_ctrl_set(struct rte_eth_dev *eth_dev, &pi->link_cfg); } +static int cxgbe_dev_filter_ctrl (struct rte_eth_dev *dev, +enum rte_filter_type filter_type, +enum rte_filter_op filter_op,void *arg) +{ +int ret; + +switch (filter_type) { +case RTE_ETH_FILTER_FDIR : + ret =cxgbe_fdir_ctrl_func (dev, filter_op, arg); +break ; +default : + ret = -ENOTSUP ; +break ; + } +return ret; +} +static struct eth_dev_ops cxgbe_eth_dev_ops = { .dev_start = cxgbe_dev_start, .dev_stop = cxgbe_dev_stop,
@@ -794,6 +811,7 @@ static struct eth_dev_ops cxgbe_eth_dev_ops = { .stats_reset = cxgbe_dev_stats_reset, .flow_ctrl_get = cxgbe_flow_ctrl_get, .flow_ctrl_set = cxgbe_flow_ctrl_set, + .filter_ctrl = cxgbe_dev_filter_ctrl, };/*
drivers/net/cxgbe/cxgbe_fdir.c new file +715 -0
715 lines not on this page · raw message
drivers/net/cxgbe/cxgbe_fdir.h new file +108 -0
108 lines not on this page · raw message
drivers/net/cxgbe/cxgbe_main.c +40 -0
@@ -148,6 +148,38 @@ out: }/** +* cxgbe_poll_for_completion: Poll rxq for completion +* @q: rxq to poll +* @us: microseconds to delay +* @cnt: number of times to poll +* @c: completion to check for 'done' status +* +* Polls the rxq for reples until completion is done or the count +* expires. +*/ +int cxgbe_poll_for_completion (struct sge_rspq *q,unsigned int us, +unsigned int cnt,struct t4_completion *c) +{ +unsigned int i; +unsigned int work_done, budget =4 ; + +if (!c) +return -EINVAL ; + +for (i =0 ; i < cnt; i++) { +cxgbe_poll (q,NULL , budget, &work_done); +t4_os_lock (&c->lock); +if (c->done) { +t4_os_unlock (&c->lock); +return 0 ; + } +t4_os_unlock (&c->lock); +udelay (us); + } +return -ETIMEDOUT ; +} + +/** * Setup sge control queues to pass control information. */ int setup_sge_ctrl_txq (struct adapter *adapter)
@@ -1355,6 +1387,7 @@ void cxgbe_close(struct adapter *adapter)if (adapter->flags &FULL_INIT_DONE ) {cxgbe_clear_all_filters (adapter); +cxgbe_cleanup_fdir (adapter);tid_free (&adapter->tids);t4_cleanup_clip_tbl (adapter);t4_cleanup_l2t (adapter);
@@ -1542,6 +1575,13 @@ allocate_mac: "Maskless filter support disabled. Continuing\n"); } + adapter->fdir =cxgbe_init_fdir (adapter); +if (!adapter->fdir) { +/* Disable Flow Director */ +dev_warn (adapter,"could not allocate FDIR " +"flow director support disabled. Continuing\n" ); + } + err =init_rss (adapter);if (err) goto out_free;
drivers/net/cxgbe/sge.c +2 -1
@@ -1664,7 +1664,8 @@ static int process_responses(struct sge_rspq *q, int budget,unsigned int params;u32 val; -if (fl_cap (&rxq->fl) - rxq->fl.avail >=64 ) +if (q->offset >=0 && +fl_cap (&rxq->fl) - rxq->fl.avail >=64 )__refill_fl (q->adapter, &rxq->fl); params =V_QINTR_TIMER_IDX (X_TIMERREG_UPDATE_CIDX ); q->next_intr_params = params;
Signature · 1 line
2.5.3
Hi All,
Quoted 129 lines · Rahul Lakkireddy
This series of patches extend the flow director filter and add support for Chelsio T5 hardware filtering capabilities.
Chelsio T5 supports carrying out filtering in hardware which supports 3 actions to carry out on a packet which hit a filter viz.
1. Action Pass - Packets hitting a filter rule can be directed to a particular RXQ.
2. Action Drop - Packets hitting a filter rule are dropped in h/w.
3. Action Switch - Packets hitting a filter rule can be switched in h/w from one port to another, without involvement of host. Also, the action Switch also supports rewrite of src-mac/dst-mac headers as well as rewrite of vlan headers. It also supports rewrite of IP headers and thereby, supports NAT (Network Address Translation) in h/w.
Also, each filter rule can optionally support specifying a mask value i.e. it's possible to create a filter rule for an entire subnet of IP addresses or a range of tcp/udp ports, etc.
Patch 1 does the following:
- Adds a new flowRTE_ETH_FLOW_RAW_PKTto allow specifying a generic flow.
- Adds an additional generic array torte_eth_fdir_flowto allow specifying generic flow input.
- Adds an additional mask for the flow input to allow range of values to be matched in the flow input.
- Adds a new behavior 'switch'.
- Adds a generic array to hold behavior arguments that can be passed when a particular behavior is taken. For ex: in case of action 'switch', pass additional 4-tuple to allow rewriting src/dst ip and port addresses to support NAT'ing.RFC series of patches and discussion involving these enhancements to the flow director are available at [1].
Patch 2 adds command line example app to test cxgbe flow director. Also add documentation for the example app.
Patch 3 updates the cxgbe base to add support for packet filtering.
Patch 4 adds control txq for communicating filter info to the firmware.
Patches 5-7 add compressed local ip (CLIP) table, layer 2 table (L2T), and source mac table (SMT) definitions required for holding info for matching and executing various operations on matched filters.
Patch 8 adds the LE-TCAM (maskfull) filter support.
Patch 9 adds the HASH (maskless) filter support.
Patch 10 adds and implements the flow director filter operations. Also add the documentation.
[1] http://comments.gmane.org/gmane.comp.networking.dpdk.devel/29986
Rahul Lakkireddy (10):
ethdev: add a generic flow and new behavior switch to fdir examples/test-cxgbe-filters: add example to test cxgbe fdir support
cxgbe: add skeleton to add support for T5 hardware filtering
cxgbe: add control txq for communicating filtering info
cxgbe: add compressed local IP table for matching IPv6 addresses
cxgbe: add layer 2 table for switch action filter
cxgbe: add source mac table for switch action filter
cxgbe: add LE-TCAM filtering support
cxgbe: add HASH filtering support
cxgbe: add flow director support and update documentationMAINTAINERS | 2 + doc/guides/nics/cxgbe.rst | 166 ++ doc/guides/rel_notes/release_2_3.rst | 10 + doc/guides/sample_app_ug/index.rst | 1 + doc/guides/sample_app_ug/test_cxgbe_filters.rst | 694 +++++++++ drivers/net/cxgbe/Makefile | 6 + drivers/net/cxgbe/base/adapter.h | 110 ++ drivers/net/cxgbe/base/common.h | 11 + drivers/net/cxgbe/base/t4_hw.c | 28 + drivers/net/cxgbe/base/t4_msg.h | 324 ++++ drivers/net/cxgbe/base/t4_regs.h | 9 + drivers/net/cxgbe/base/t4_regs_values.h | 25 + drivers/net/cxgbe/base/t4_tcb.h | 95 ++ drivers/net/cxgbe/base/t4fw_interface.h | 272 ++++ drivers/net/cxgbe/clip_tbl.c | 220 +++ drivers/net/cxgbe/clip_tbl.h | 59 + drivers/net/cxgbe/cxgbe.h | 4 + drivers/net/cxgbe/cxgbe_compat.h | 12 + drivers/net/cxgbe/cxgbe_ethdev.c | 21 + drivers/net/cxgbe/cxgbe_fdir.c | 715 +++++++++ drivers/net/cxgbe/cxgbe_fdir.h | 108 ++ drivers/net/cxgbe/cxgbe_filter.c | 1614 ++++++++++++++++++++ drivers/net/cxgbe/cxgbe_filter.h | 260 ++++ drivers/net/cxgbe/cxgbe_main.c | 395 ++++- drivers/net/cxgbe/cxgbe_ofld.h | 126 ++ drivers/net/cxgbe/l2t.c | 261 ++++ drivers/net/cxgbe/l2t.h | 87 ++ drivers/net/cxgbe/sge.c | 202 ++- drivers/net/cxgbe/smt.c | 275 ++++ drivers/net/cxgbe/smt.h | 76 + examples/Makefile | 1 + examples/test-cxgbe-filters/Makefile | 63 + examples/test-cxgbe-filters/commands.c | 429 ++++++ examples/test-cxgbe-filters/commands.h | 40 + examples/test-cxgbe-filters/config.c | 79 + examples/test-cxgbe-filters/cxgbe/cxgbe_commands.c | 554 +++++++ examples/test-cxgbe-filters/cxgbe/cxgbe_fdir.h | 79 + examples/test-cxgbe-filters/init.c | 201 +++ examples/test-cxgbe-filters/main.c | 79 + examples/test-cxgbe-filters/main.h | 77 + examples/test-cxgbe-filters/runtime.c | 74 + lib/librte_ether/rte_eth_ctrl.h | 15 +- 42 files changed, 7874 insertions(+), 5 deletions(-) create mode 100644 doc/guides/sample_app_ug/test_cxgbe_filters.rst create mode 100644 drivers/net/cxgbe/base/t4_tcb.h create mode 100644 drivers/net/cxgbe/clip_tbl.c create mode 100644 drivers/net/cxgbe/clip_tbl.h create mode 100644 drivers/net/cxgbe/cxgbe_fdir.c create mode 100644 drivers/net/cxgbe/cxgbe_fdir.h create mode 100644 drivers/net/cxgbe/cxgbe_filter.c create mode 100644 drivers/net/cxgbe/cxgbe_filter.h create mode 100644 drivers/net/cxgbe/cxgbe_ofld.h create mode 100644 drivers/net/cxgbe/l2t.c create mode 100644 drivers/net/cxgbe/l2t.h create mode 100644 drivers/net/cxgbe/smt.c create mode 100644 drivers/net/cxgbe/smt.h create mode 100644 examples/test-cxgbe-filters/Makefile create mode 100644 examples/test-cxgbe-filters/commands.c
Quoted 12 lines
create mode 100644 examples/test-cxgbe-filters/commands.h create mode 100644 examples/test-cxgbe-filters/config.c create mode 100644 examples/test-cxgbe-filters/cxgbe/cxgbe_commands.c create mode 100644 examples/test-cxgbe-filters/cxgbe/cxgbe_fdir.h create mode 100644 examples/test-cxgbe-filters/init.c create mode 100644 examples/test-cxgbe-filters/main.c create mode 100644 examples/test-cxgbe-filters/main.h create mode 100644 examples/test-cxgbe-filters/runtime.cSignature · 1 line
2.5.3
Just a gentle reminder if there is any review comment on this series?
Thanks,
Rahul
Re: [PATCH 02/10] examples/test-cxgbe-filters: add example to test cxgbe fdir support
In reply to Rahul LakkireddyQuoted 9 lines · Rahul Lakkireddy
Add a new
test_cxgbe_filterscommand line example to test support for Chelsio T5 hardware filtering. Shows how to pass the Chelsio input flow and input masks. Also, shows how to pass extra behavior arguments to rewrite fields in matched filter rules.Also add documentation and update
MAINTAINERS.Signed-off-by Rahul Lakkireddy <[email protected]>Signed-off-by Kumar Sanghvi <[email protected]>
Hi,
for testing NIC functionality, the "testpmd" app is what is used, and it already contains support for existing flow director functionality. Should the testing functionality not be included there?
Note: that's not to say we don't need a simple example app as well, for demonstrating how to use flow director, but at minimum for nic features we generally need to have testpmd support.
Can this patchset perhaps be changed to include some testpmd support, and maybe have any example apps as a separate set?
Regards,
/Bruce
Re: [PATCH 01/10] ethdev: add a generic flow and new behavior switch to fdir
In reply to Rahul LakkireddyQuoted 11 lines · Rahul Lakkireddy
Add a new raw packet flow that allows specifying generic flow input.
Add the ability to provide masks for fields in flow to allow range of values.
Add a new behavior switch.
Add the ability to provide behavior arguments to allow rewriting matched fields with new values. Ex: allows to provide new ip and port addresses to rewrite the fields of packets matching a filter rule before NAT'ing.
Quoted 7 lines
Signed-off-by Rahul Lakkireddy <[email protected]>Signed-off-by Kumar Sanghvi <[email protected]>--- doc/guides/rel_notes/release_2_3.rst | 3 +++ lib/librte_ether/rte_eth_ctrl.h | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-)
Thomas, any comments as ethdev maintainer?
Jingjing, you have been doing some work on flow director for other NICs. Can you perhaps review this patch as well.
Regards,
/Bruce
Re: [PATCH 01/10] ethdev: add a generic flow and new behavior switch to fdir
2016-02-24 14:43, Bruce Richardson:
Quoted 6 lines · Rahul Lakkireddy
Quoted 5 lines
Add a new raw packet flow that allows specifying generic flow input.
Add the ability to provide masks for fields in flow to allow range of values.
Quoted 7 lines
Quoted 6 lines
Add a new behavior switch.
Add the ability to provide behavior arguments to allow rewriting matched fields with new values. Ex: allows to provide new ip and port addresses to rewrite the fields of packets matching a filter rule before NAT'ing.
Thomas, any comments as ethdev maintainer?
Yes, some comments.
First, there are several different changes in the same patch. It must be split. Then I don't understand at all the raw flow filter. What is a raw flow? How behavior_arg must be used?
Re: [PATCH 02/10] examples/test-cxgbe-filters: add example to test cxgbe fdir support
In reply to Bruce RichardsonHi Bruce,
Quoted 8 lines · Bruce Richardson
Quoted 7 lines · Rahul Lakkireddy
Add a new
test_cxgbe_filterscommand line example to test support for Chelsio T5 hardware filtering. Shows how to pass the Chelsio input flow and input masks. Also, shows how to pass extra behavior arguments to rewrite fields in matched filter rules.Also add documentation and update
MAINTAINERS.
Quoted 9 lines
Quoted 2 lines
Signed-off-by Rahul Lakkireddy <[email protected]>Signed-off-by Kumar Sanghvi <[email protected]>Hi,
for testing NIC functionality, the "testpmd" app is what is used, and it already contains support for existing flow director functionality. Should the testing functionality not be included there?
We initially thought of adding example by extending flow director in testpmd itself. However, based on discussion at [1], we then created a separate sample app for this considering each vendor would come up with their own sample app.
[1] http://permalink.gmane.org/gmane.comp.networking.dpdk.devel/31471
Quoted 7 lines
Note: that's not to say we don't need a simple example app as well, for demonstrating how to use flow director, but at minimum for nic features we generally need to have testpmd support.
Can this patchset perhaps be changed to include some testpmd support, and maybe have any example apps as a separate set?
If adding example in the existing testpmd sounds more appropriate then, I will re-submit by updating testpmd instead.
Thanks,
Rahul
Re: [PATCH 01/10] ethdev: add a generic flow and new behavior switch to fdir
In reply to Thomas MonjalonHi Thomas,
Quoted 9 lines · Thomas Monjalon
2016-02-24 14:43, Bruce Richardson:
Quoted 8 lines · Rahul Lakkireddy
Quoted 7 lines
Add a new raw packet flow that allows specifying generic flow input.
Add the ability to provide masks for fields in flow to allow range of values.
Add a new behavior switch.
Quoted 8 lines
Quoted 5 lines
Quoted 4 lines
Add the ability to provide behavior arguments to allow rewriting matched fields with new values. Ex: allows to provide new ip and port addresses to rewrite the fields of packets matching a filter rule before NAT'ing.
Thomas, any comments as ethdev maintainer?
Yes, some comments.
First, there are several different changes in the same patch. It must be split.
Should each structure change be split into a separate patch?
Quoted 3 lines
Then I don't understand at all the raw flow filter. What is a raw flow? How
behavior_argmust be used?
This was discussed with Jingjing at
http://permalink.gmane.org/gmane.comp.networking.dpdk.devel/31471
A raw flow provides a generic way for vendors to add their vendor specific input flow. In our case, it is possible to match several flows in a single rule. For example, it's possible to set an ethernet, vlan, ip and tcp/udp flows all in a single rule. We can specify all of these flows in a single raw input flow, which can then be passed to cxgbe flow director to set the corresponding filter.
On similar lines, behavior_arg provides a generic way to pass extra action arguments for matched flows. For example, in our case, to perform NAT, the new src/dst ip and src/dst port addresses to be re-written for a matched rule can be passed in behavior_arg.
Thanks,
Rahul
Re: [PATCH 01/10] ethdev: add a generic flow and new behavior switch to fdir
Caution: I truly respect the work done by Chelsio on DPDK. And I'm sure you can help to build a good filtering API, which was mainly designed with Intel needs in mind because it was difficult to have opinions of other vendors some time ago. That's why it's a chance to have new needs and it would be a shame to let it go through a vendor specific backdoor.
2016-02-25 00:10, Rahul Lakkireddy:
Quoted 16 lines
Hi Thomas,
Quoted 13 lines · Thomas Monjalon
2016-02-24 14:43, Bruce Richardson:
Quoted 12 lines · Rahul Lakkireddy
Quoted 11 lines
Add a new raw packet flow that allows specifying generic flow input.
Add the ability to provide masks for fields in flow to allow range of values.
Add a new behavior switch.
Add the ability to provide behavior arguments to allow rewriting matched fields with new values. Ex: allows to provide new ip and port addresses to rewrite the fields of packets matching a filter rule before NAT'ing.
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Thomas, any comments as ethdev maintainer?
Yes, some comments.
First, there are several different changes in the same patch. It must be split.Should each structure change be split into a separate patch?
A patch = a feature.
The switch action and the flow rule are different things.
Quoted 6 lines
Quoted 2 lines
Then I don't understand at all the raw flow filter. What is a raw flow? How
behavior_argmust be used?This was discussed with Jingjing at
http://permalink.gmane.org/gmane.comp.networking.dpdk.devel/31471
Thanks, I missed it.
Quoted 2 lines
A raw flow provides a generic way for vendors to add their vendor specific input flow.
Please, "generic" and "vendor specific" in the same sentence. It's obviously wrong.
Quoted 5 lines
In our case, it is possible to match several flows
in a single rule. For example, it's possible to set an ethernet, vlan, ip and tcp/udp flows all in a single rule. We can specify all of these flows in a single raw input flow, which can then be passed to cxgbe flow director to set the corresponding filter.
I feel we need to define what is an API.
If the application wants to call something specific to the NIC, why using the ethdev API? You just have to include cxgbe.h.
Quoted 4 lines
On similar lines,
behavior_argprovides a generic way to pass extra action arguments for matched flows. For example, in our case, to perform NAT, the new src/dst ip and src/dst port addresses to be re-written for a matched rule can be passed inbehavior_arg.
Yes a kind of void* to give what you want to the driver without the convenience of a documented function.
I know the support of filters among NICs is really heterogeneous. And the DPDK API are not yet generic enough. But please do not give up! If the filtering API can be improved to support your cases, please do it.
Re: [PATCH 01/10] ethdev: add a generic flow and new behavior switch to fdir
In reply to Rahul LakkireddyQuoted 39 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Rahul Lakkireddy
Sent: Wednesday, February 03, 2016 4:32 PM
To: [email protected]
Cc: Kumar Sanghvi; Nirranjan Kirubaharan
Subject: [dpdk-dev] [PATCH 01/10] ethdev: add a generic flow and new behavior switch to fdirAdd a new raw packet flow that allows specifying generic flow input.
Add the ability to provide masks for fields in flow to allow range of values.
Add a new behavior switch.
Add the ability to provide behavior arguments to allow rewriting matched fields with new values. Ex: allows to provide new ip and port addresses to rewrite the fields of packets matching a filter rule before NAT'ing.
Signed-off-by Rahul Lakkireddy <[email protected]>Signed-off-by Kumar Sanghvi <[email protected]>--- doc/guides/rel_notes/release_2_3.rst | 3 +++ lib/librte_ether/rte_eth_ctrl.h | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-)doc/guides/rel_notes/release_2_3.rst +1
-0@@ -39,6 +39,9 @@ API Changes ABI Changes ----------- +* New flow type ``RTE_ETH_FLOW_RAW_PKT`` had been introduced andhence
doc/guides/rel_notes/release_2_3.rst API Changes · line 44
Quoted 2 lines
doc/guides/rel_notes/release_2_3.rst +2
-0+ ``RTE_ETH_FLOW_MAX`` had been increased to 19. +
Great to see a raw_pkt_flow type.
And there is already a flow type "RTE_ETH_FLOW_RAW", it's not necessary to add a new one.
Quoted 73 lines
Shared Library Versions
-----------------------lib/librte_ether/rte_eth_ctrl.h +12
-1@@ -74,7 +74,8 @@ extern "C" {#define RTE_ETH_FLOW_IPV6_EX 15#define RTE_ETH_FLOW_IPV6_TCP_EX 16#define RTE_ETH_FLOW_IPV6_UDP_EX 17 -#define RTE_ETH_FLOW_MAX 18 +#define RTE_ETH_FLOW_RAW_PKT 18 +#define RTE_ETH_FLOW_MAX 19/** * Feature filter types @@ -499,6 +500,9 @@ struct rte_eth_tunnel_flow {struct ether_addr mac_addr;/**< Mac address to match. */ }; +/**< Max length of raw packet in bytes. */ #define +RTE_ETH_RAW_PKT_FLOW_MAX_LEN 256 +/** * An union contains the inputs for all types of flow */ @@ -514,6 +518,7 @@ union rte_eth_fdir_flow {struct rte_eth_ipv6_flow ipv6_flow;struct rte_eth_mac_vlan_flow mac_vlan_flow;struct rte_eth_tunnel_flow tunnel_flow; +uint8_t raw_pkt_flow[RTE_ETH_RAW_PKT_FLOW_MAX_LEN ]; };/** @@ -534,6 +539,8 @@ struct rte_eth_fdir_input {uint16_t flow_type;union rte_eth_fdir_flow flow;/**< Flow fields to match, dependent on flow_type */ +union rte_eth_fdir_flow flow_mask; +/**< Mask for the fields matched, dependent on flow */ struct rte_eth_fdir_flow_ext flow_ext;/**< Additional fields to match */ };@@ -545,6 +552,7 @@ enum rte_eth_fdir_behavior {RTE_ETH_FDIR_ACCEPT =0 ,RTE_ETH_FDIR_REJECT ,RTE_ETH_FDIR_PASSTHRU , + RTE_ETH_FDIR_SWITCH, };/** @@ -558,6 +566,9 @@ enum rte_eth_fdir_status { RTE_ETH_FDIR_REPORT_FLEX_8, /**< Report 8 flex bytes. */ }; +/**< Max # of behavior arguments */ +#define RTE_ETH_BEHAVIOR_ARG_MAX_LEN 256 +/** * A structure used to define an action when match FDIR packet filter. */ @@ -569,6 +580,8 @@ struct rte_eth_fdir_action {/**< If report_status is RTE_ETH_FDIR_REPORT_ID_FLEX_4 or RTE_ETH_FDIR_REPORT_FLEX_8, flex_off specifies where the reported
lib/librte_ether/rte_eth_ctrl.h +2
-1flex bytes start from in flexible payload. */ +uint8_t behavior_arg[RTE_ETH_BEHAVIOR_ARG_MAX_LEN ]; +/**< Extra arguments for behavior taken */ };/** -- 2.5.3
Re: [PATCH 01/10] ethdev: add a generic flow and new behavior switch to fdir
Hi Jingjing,
Quoted 36 lines · Jingjing
Quoted 36 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Rahul Lakkireddy
Sent: Wednesday, February 03, 2016 4:32 PM
To: [email protected]
Cc: Kumar Sanghvi; Nirranjan Kirubaharan
Subject: [dpdk-dev] [PATCH 01/10] ethdev: add a generic flow and new behavior switch to fdirAdd a new raw packet flow that allows specifying generic flow input.
Add the ability to provide masks for fields in flow to allow range of values.
Add a new behavior switch.
Add the ability to provide behavior arguments to allow rewriting matched fields with new values. Ex: allows to provide new ip and port addresses to rewrite the fields of packets matching a filter rule before NAT'ing.
Signed-off-by Rahul Lakkireddy <[email protected]>Signed-off-by Kumar Sanghvi <[email protected]>--- doc/guides/rel_notes/release_2_3.rst | 3 +++ lib/librte_ether/rte_eth_ctrl.h | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-)doc/guides/rel_notes/release_2_3.rst +0
-0@@ -39,6 +39,9 @@ API Changes ABI Changes -----------
Quoted 7 lines
doc/guides/rel_notes/release_2_3.rst API Changes · line 44
Quoted 5 lines
doc/guides/rel_notes/release_2_3.rst +1
-0+* New flow type ``RTE_ETH_FLOW_RAW_PKT`` had been introduced andhence
doc/guides/rel_notes/release_2_3.rst +2
-0+ ``RTE_ETH_FLOW_MAX`` had been increased to 19. +Great to see a
raw_pkt_flowtype.
And there is already a flow type "RTE_ETH_FLOW_RAW", it's not necessary to add a new one.
I added a new type based on your feedback only
http://permalink.gmane.org/gmane.comp.networking.dpdk.devel/31386
So, do you want me to revert this change and use RTE_ETH_FLOW_RAW instead ?
Thanks,
Rahul.
Re: [PATCH 01/10] ethdev: add a generic flow and new behavior switch to fdir
In reply to Thomas MonjalonHi Thomas,
Quoted 1 line · Thomas Monjalon
Caution: I truly respect the work done by Chelsio on DPDK.
Thank you. And Chelsio will continue to support DPDK community and will continue to contribute.
Quoted 5 lines
And I'm sure you can help to build a good filtering API, which was mainly designed with Intel needs in mind because it was difficult to have opinions of other vendors some time ago. That's why it's a chance to have new needs and it would be a shame to let it go through a vendor specific backdoor.
I agree that new needs should be raised.
RFC v1 was submitted at:
http://permalink.gmane.org/gmane.comp.networking.dpdk.devel/29986
RFC v2 was submitted at:
http://permalink.gmane.org/gmane.comp.networking.dpdk.devel/30732
I tried to accomodate as many fields as possible to make this as generic as possible. Also, I followed the review comments given by Jingjing. I also waited for more review comments before posting this series to see if there were any objections with the approach.
I have been trying to make this generic for all vendors and not favour any one over the other.
Quoted 20 lines
2016-02-25 00:10, Rahul Lakkireddy:
Quoted 18 lines
Hi Thomas,
Quoted 15 lines · Thomas Monjalon
2016-02-24 14:43, Bruce Richardson:
Quoted 13 lines · Rahul Lakkireddy
Quoted 11 lines
Add a new raw packet flow that allows specifying generic flow input.
Add the ability to provide masks for fields in flow to allow range of values.
Add a new behavior switch.
Add the ability to provide behavior arguments to allow rewriting matched fields with new values. Ex: allows to provide new ip and port addresses to rewrite the fields of packets matching a filter rule before NAT'ing.
Thomas, any comments as ethdev maintainer?
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Yes, some comments.
First, there are several different changes in the same patch. It must be split.Should each structure change be split into a separate patch?
A patch = a feature.
The switch action and the flow rule are different things.
Ok. I will split this into separate patches.
Quoted 8 lines
Quoted 7 lines
Quoted 3 lines
Then I don't understand at all the raw flow filter. What is a raw flow? How
behavior_argmust be used?This was discussed with Jingjing at
http://permalink.gmane.org/gmane.comp.networking.dpdk.devel/31471
Quoted 7 lines
Thanks, I missed it.
Quoted 2 lines
A raw flow provides a generic way for vendors to add their vendor specific input flow.
Please, "generic" and "vendor specific" in the same sentence. It's obviously wrong.
I think this sentence is being mis-interpreted.
What I intended to say is: the fields are generic so that any vendor can hook-in. The fields themselves are not vendor specific.
Quoted 10 lines
Quoted 6 lines
In our case, it is possible to match several flows
in a single rule. For example, it's possible to set an ethernet, vlan, ip and tcp/udp flows all in a single rule. We can specify all of these flows in a single raw input flow, which can then be passed to cxgbe flow director to set the corresponding filter.I feel we need to define what is an API.
If the application wants to call something specific to the NIC, why using the ethdev API? You just have to includecxgbe.h.
Well, in that sense, flow-director is also very intel specific, no ? What we are trying to do is make flow-director generic and, we have been following the review comments on this. If there are better ideas on how to achieve this, we are open to suggestions/comments and are ready to re-do the series and re-submit also.
Quoted 8 lines
Quoted 5 lines
On similar lines,
behavior_argprovides a generic way to pass extra action arguments for matched flows. For example, in our case, to perform NAT, the new src/dst ip and src/dst port addresses to be re-written for a matched rule can be passed inbehavior_arg.Yes a kind of void* to give what you want to the driver without the convenience of a documented function.
void* approach was taken based on review comments from Jingjing. And we didn't receive any further comments/objections on that thread.
Quoted 4 lines
I know the support of filters among NICs is really heterogeneous. And the DPDK API are not yet generic enough. But please do not give up! If the filtering API can be improved to support your cases, please do it.
I am not giving up. If there are better suggestions then, I am willing to re-do and re-submit the series.
If the approach taken in RFC v1 series looks more promising then, I can re-surrect that also. However, I will need some direction over here so that it becomes generic and doesn't remain intel specific as it is now.
Thanks,
Rahul.
Re: [PATCH 02/10] examples/test-cxgbe-filters: add example to test cxgbe fdir support
In reply to Rahul LakkireddyQuoted 21 lines · Rahul Lakkireddy
Hi Bruce,
Quoted 8 lines · Bruce Richardson
Quoted 7 lines · Rahul Lakkireddy
Add a new
test_cxgbe_filterscommand line example to test support for Chelsio T5 hardware filtering. Shows how to pass the Chelsio input flow and input masks. Also, shows how to pass extra behavior arguments to rewrite fields in matched filter rules.Also add documentation and update
MAINTAINERS.Quoted 9 lines
Quoted 2 lines
Signed-off-by Rahul Lakkireddy <[email protected]>Signed-off-by Kumar Sanghvi <[email protected]>Hi,
for testing NIC functionality, the "testpmd" app is what is used, and it already contains support for existing flow director functionality. Should the testing functionality not be included there?
Quoted 7 lines
We initially thought of adding example by extending flow director in testpmd itself. However, based on discussion at [1], we then created a separate sample app for this considering each vendor would come up with their own sample app.
[1] http://permalink.gmane.org/gmane.comp.networking.dpdk.devel/31471
Thanks for the old conversation link. I don't like the idea of having vendor specific sample apps, I think the samples should be as generic as possible. If there is a particular feature that you want to demonstrate in a sample app, then that is worthy of inclusion - assuming it's possible that in future more than one vendor's hardware will support the feature.
Within the documentation for the particular NIC or driver, feel free to call out what features the NIC supports and how those should be configured.
I hope this makes sense. We probably need a documented policy on how to go about adding new NIC feature support to ensure everyone is in agreement on how things should be done so as to allow vendors to expose the features of their hardware, while at the same time allowing users to write applications that can be generic across the various hardware platforms.
Regards,
/Bruce
Re: [PATCH 01/10] ethdev: add a generic flow and new behavior switch to fdir
In reply to Rahul Lakkireddy2016-02-25 15:03, Rahul Lakkireddy:
Quoted 10 lines · Thomas Monjalon
Quoted 5 lines
Quoted 2 lines
A raw flow provides a generic way for vendors to add their vendor specific input flow.
Please, "generic" and "vendor specific" in the same sentence. It's obviously wrong.
I think this sentence is being mis-interpreted.
What I intended to say is: the fields are generic so that any vendor can hook-in. The fields themselves are not vendor specific.
We are trying to push some features into fields of an API instead of thinking how to make it simple.
Quoted 11 lines
Quoted 9 lines
Quoted 5 lines
In our case, it is possible to match several flows
in a single rule. For example, it's possible to set an ethernet, vlan, ip and tcp/udp flows all in a single rule. We can specify all of these flows in a single raw input flow, which can then be passed to cxgbe flow director to set the corresponding filter.I feel we need to define what is an API.
If the application wants to call something specific to the NIC, why using the ethdev API? You just have to includecxgbe.h.Well, in that sense, flow-director is also very intel specific, no ?
Yes. I think the term "flow director" comes from Intel.
Quoted 1 line
What we are trying to do is make flow-director generic
So let's stop calling it flow director.
We are talking about filtering, right?
Quoted 4 lines
and, we have been
following the review comments on this. If there are better ideas on how to achieve this, we are open to suggestions/comments and are ready to re-do the series and re-submit also.
My first question: are you happy with the current API?
Do you understand the difference between RTE_ETH_FILTER_ETHERTYPE and RTE_ETH_FILTER_FDIR with RTE_ETH_FLOW_L2_PAYLOAD?
Do you understand this structure?
enum rte_eth_fdir_status {
RTE_ETH_FDIR_NO_REPORT_STATUS = 0, /**< Report nothing. */
RTE_ETH_FDIR_REPORT_ID, /**< Only report FD ID. */
RTE_ETH_FDIR_REPORT_ID_FLEX_4, /**< Report FD ID and 4 flex bytes. */
RTE_ETH_FDIR_REPORT_FLEX_8, /**< Report 8 flex bytes. */
};
These values?
enum rte_fdir_mode {
RTE_FDIR_MODE_NONE = 0, /**< Disable FDIR support. */
RTE_FDIR_MODE_SIGNATURE, /**< Enable FDIR signature filter mode. */
RTE_FDIR_MODE_PERFECT, /**< Enable FDIR perfect filter mode. */
RTE_FDIR_MODE_PERFECT_MAC_VLAN, /**< Enable FDIR filter mode - MAC VLAN. */
RTE_FDIR_MODE_PERFECT_TUNNEL, /**< Enable FDIR filter mode - tunnel. */
};
Quoted 1 line
From my point of view, it is insane.
We have put the hardware complexity in the API.
And now you want to put some vendor specific data in some fields like some black magic recipes.
Why is it so complex? We are talking about packet filtering, not rocket science!
Quoted 9 lines
Quoted 3 lines
I know the support of filters among NICs is really heterogeneous. And the DPDK API are not yet generic enough. But please do not give up! If the filtering API can be improved to support your cases, please do it.
I am not giving up. If there are better suggestions then, I am willing to re-do and re-submit the series.
If the approach taken in RFC v1 series looks more promising then, I can re-surrect that also. However, I will need some direction over here so that it becomes generic and doesn't remain intel specific as it is now.
Yes the approach in the RFC was better in the sense it was describing the fields. But honestly, I'd prefer thinking of filtering from scratch.
What is a hardware filter? (note there is no such doc yet) It matches a packet with some criterias and take an action on it. Simple.
Now details (it can take weeks or months to list every details).
A hardware implements a subset of the infinite capabilities. So the API must provide a flag to check a rule/action capability without really configuring it.
A matching rule must match every criterias or only some of them (AND/OR operators). An action is associated to a matching rule.
There can be several matching rules on the same port (Chelsio case?). Any packet field can be matched (we currently define some of them).
An action can be of different types:
- drop
- switch
- accept in any queue
- accept in a specific queue
Most of the rules give some values to match the fields. The hash filtering (RSS) specify only some fields and a key to direct packets in different queues.
Please, Intel, Chelsio and other vendors, tell what is wrong above and let's start a sane discussion on hardware filtering.
More background:
The current API was designed by Intel when they were the only NIC vendor. Now that there are 8 vendors with different capabilities and that FPGA should bring even more capabilities, we should be able to build something more generic while being usable.
Re: [PATCH 01/10] ethdev: add a generic flow and new behavior switch to fdir
Quoted 37 lines
-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Friday, February 26, 2016 2:25 AM
To: Rahul Lakkireddy <[email protected]>
Cc: Richardson, Bruce <[email protected]>; [email protected]; Kumar A S <[email protected]>; Nirranjan Kirubaharan <[email protected]>; Wu, Jingjing <[email protected]>
Subject: Re: [dpdk-dev] [PATCH 01/10] ethdev: add a generic flow and new behavior switch to fdir2016-02-25 15:03, Rahul Lakkireddy:
Quoted 10 lines · Thomas Monjalon
Quoted 5 lines
Quoted 2 lines
A raw flow provides a generic way for vendors to add their vendor specific input flow.
Please, "generic" and "vendor specific" in the same sentence. It's obviously wrong.
I think this sentence is being mis-interpreted.
What I intended to say is: the fields are generic so that any vendor can hook-in. The fields themselves are not vendor specific.We are trying to push some features into fields of an API instead of thinking how to make it simple.
Quoted 10 lines
Quoted 9 lines
Quoted 5 lines
In our case, it is possible to match several flows
in a single rule. For example, it's possible to set an ethernet, vlan, ip and tcp/udp flows all in a single rule. We can specify all of these flows in a single raw input flow, which can then be passed to cxgbe flow director to set the corresponding filter.I feel we need to define what is an API.
If the application wants to call something specific to the NIC, why using the ethdev API? You just have to includecxgbe.h.
Quoted 9 lines
Quoted 1 line
Well, in that sense, flow-director is also very intel specific, no ?
Yes. I think the term "flow director" comes from Intel.
Quoted 1 line
What we are trying to do is make flow-director generic
So let's stop calling it flow director.
We are talking about filtering, right?
Hi Thomas
Are you suggesting chelsio to define a new filter type?
Quoted 2 lines
Why is it so complex? We are talking about packet filtering, not rocket science!
The complex is due to different NICs different behavior :-)
As I know, it is a common way to use used-define data pass specific infor to driver.
Even flow director is concept from Intel's NIC, but I think it is the generic one comparing with other kinds of filters. So I think that's why Rahul choose it to add their kind of filters. As I know enic driver also uses flow director API to support their filters.
No matter chelsio NIC filter uses flow director API or define another new filter type. I vote the change happened in struct rte_eth_fdir_input, it provide a RAW Flow type, And there is also a mask field for that, by this way, user can have a flexible way to configure. And drivers can parse the raw input to define the filter fields.
But for the change happened in struct rte_eth_fdir_action, only SWITCH type is added, Where to switch? All things is in behavior_arg[RTE_ETH_BEHAVIOR_ARG_MAX_LEN] which is black to user. Maybe your previous define in RFC makes more sense. It's better to add user defined field but not for all args.
Any better suggestion?
Re: [PATCH 01/10] ethdev: add a generic flow and new behavior switch to fdir
I think what Thomas meant is that we should redesign Flow Director feature and call it something else , Mellanox is calling it "Flow Steering" . I agree that Filtering may be more generic name. We have implemented Flow Director API in Mellanox ConnectX-4 PMD (part of the DPDK 16.04 patches) but we did is in very awkward way that will fit the current API and some Mellanox features are missing with current Flow Director API. Therefore I disagree with Jingjing's statement that this API is generic.
Frankly, it is very hard to understand it , as Thomas mentioned ..., not sure how DPDK users understand what each function/field means ....
Best Regards,
Olga
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Wu, Jingjing
Sent: Friday, February 26, 2016 3:18 AM
To: Thomas Monjalon; Rahul Lakkireddy
Cc: [email protected]; Kumar A S; Nirranjan Kirubaharan
Subject: Re: [dpdk-dev] [PATCH 01/10] ethdev: add a generic flow and new behavior switch to fdir
Quoted 35 lines
-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Friday, February 26, 2016 2:25 AM
To: Rahul Lakkireddy <[email protected]>
Cc: Richardson, Bruce <[email protected]>; [email protected]; Kumar A S <[email protected]>; Nirranjan Kirubaharan <[email protected]>; Wu, Jingjing <[email protected]>
Subject: Re: [dpdk-dev] [PATCH 01/10] ethdev: add a generic flow and new behavior switch to fdir2016-02-25 15:03, Rahul Lakkireddy:
Quoted 10 lines · Thomas Monjalon
Quoted 5 lines
Quoted 2 lines
A raw flow provides a generic way for vendors to add their vendor specific input flow.
Please, "generic" and "vendor specific" in the same sentence. It's obviously wrong.
I think this sentence is being mis-interpreted.
What I intended to say is: the fields are generic so that any vendor can hook-in. The fields themselves are not vendor specific.We are trying to push some features into fields of an API instead of thinking how to make it simple.
Quoted 10 lines
Quoted 9 lines
Quoted 5 lines
In our case, it is possible to match several flows in a single rule. For example, it's possible to set an ethernet, vlan, ip and tcp/udp flows all in a single rule. We can specify all of these flows in a single raw input flow, which can then be passed to cxgbe flow director to set the corresponding filter.
I feel we need to define what is an API.
If the application wants to call something specific to the NIC, why using the ethdev API? You just have to includecxgbe.h.
Quoted 9 lines
Quoted 1 line
Well, in that sense, flow-director is also very intel specific, no ?
Yes. I think the term "flow director" comes from Intel.
Quoted 1 line
What we are trying to do is make flow-director generic
So let's stop calling it flow director.
We are talking about filtering, right?
Hi Thomas
Are you suggesting chelsio to define a new filter type?
Quoted 2 lines
Why is it so complex? We are talking about packet filtering, not rocket science!
The complex is due to different NICs different behavior :-) As I know, it is a common way to use used-define data pass specific infor to driver.
Even flow director is concept from Intel's NIC, but I think it is the generic one comparing with other kinds of filters. So I think that's why Rahul choose it to add their kind of filters. As I know enic driver also uses flow director API to support their filters.
No matter chelsio NIC filter uses flow director API or define another new filter type. I vote the change happened in struct rte_eth_fdir_input, it provide a RAW Flow type, And there is also a mask field for that, by this way, user can have a flexible way to configure. And drivers can parse the raw input to define the filter fields.
But for the change happened in struct rte_eth_fdir_action, only SWITCH type is added, Where to switch? All things is in behavior_arg[RTE_ETH_BEHAVIOR_ARG_MAX_LEN] which is black to user. Maybe your previous define in RFC makes more sense. It's better to add user defined field but not for all args.
Any better suggestion?
Quoted 22 lines · Rahul Lakkireddy
This series of patches extend the flow director filter and add support for Chelsio T5 hardware filtering capabilities.
Chelsio T5 supports carrying out filtering in hardware which supports 3 actions to carry out on a packet which hit a filter viz.
1. Action Pass - Packets hitting a filter rule can be directed to a particular RXQ.
2. Action Drop - Packets hitting a filter rule are dropped in h/w.
3. Action Switch - Packets hitting a filter rule can be switched in h/w from one port to another, without involvement of host. Also, the action Switch also supports rewrite of src-mac/dst-mac headers as well as rewrite of vlan headers. It also supports rewrite of IP headers and thereby, supports NAT (Network Address Translation) in h/w.
Also, each filter rule can optionally support specifying a mask value i.e. it's possible to create a filter rule for an entire subnet of IP addresses or a range of tcp/udp ports, etc.
Quoted 13 lines
Patch 1 does the following:
- Adds a new flowRTE_ETH_FLOW_RAW_PKTto allow specifying a generic flow.
- Adds an additional generic array torte_eth_fdir_flowto allow specifying generic flow input.
- Adds an additional mask for the flow input to allow range of values to be matched in the flow input.
- Adds a new behavior 'switch'.
- Adds a generic array to hold behavior arguments that can be passed when a particular behavior is taken. For ex: in case of action 'switch', pass additional 4-tuple to allow rewriting src/dst ip and port addresses to support NAT'ing.
Patch 1 of this set is not mergable for 16.04 because there is no agreement on the way forward for filtering APIs, and the fact that the changes proposed are not acceptable to the maintainers as-is.
Therefore the whole patchset must be deferred for a later release. I'm updating the status in patchwork to "Changes Requested".
Regards,
/Bruce
Re: [PATCH 01/10] ethdev: add a generic flow and new behavior switch to fdir
In reply to Wu, Jingjing2016-02-26 01:17, Wu, Jingjing:
Quoted 32 lines
From: Thomas Monjalon [mailto:[email protected]]
Quoted 12 lines
2016-02-25 15:03, Rahul Lakkireddy:
Quoted 11 lines · Thomas Monjalon
Quoted 9 lines
Quoted 5 lines
In our case, it is possible to match several flows
in a single rule. For example, it's possible to set an ethernet, vlan, ip and tcp/udp flows all in a single rule. We can specify all of these flows in a single raw input flow, which can then be passed to cxgbe flow director to set the corresponding filter.I feel we need to define what is an API.
If the application wants to call something specific to the NIC, why using the ethdev API? You just have to includecxgbe.h.Quoted 8 lines
Quoted 1 line
Well, in that sense, flow-director is also very intel specific, no ?
Yes. I think the term "flow director" comes from Intel.
Quoted 1 line
What we are trying to do is make flow-director generic
So let's stop calling it flow director.
We are talking about filtering, right?Are you suggesting chelsio to define a new filter type?
Quoted 2 lines
Why is it so complex? We are talking about packet filtering, not rocket science!
The complex is due to different NICs different behavior :-)
As I know, it is a common way to use used-define data pass specific infor to driver.Even flow director is concept from Intel's NIC, but I think it is the generic one comparing with other kinds of filters. So I think that's why Rahul choose it to add their kind of filters. As I know enic driver also uses flow director API to support their filters.
[...]
Quoted 1 line
Any better suggestion?
We have a more generic proposal now:
http://dpdk.org/ml/archives/dev/2016-July/043365.html
Rahul, does it fit your needs?