summaryrefslogtreecommitdiff
path: root/drivers/net/i40e/rte_pmd_i40e.c
diff options
context:
space:
mode:
authorKirill Rybalchenko <kirill.rybalchenko@intel.com>2017-10-24 15:08:13 +0100
committerFerruh Yigit <ferruh.yigit@intel.com>2017-10-26 02:33:01 +0200
commit66c78f4799ff5021b749534cc35da2ae20f92397 (patch)
treeb9684052596f459c0039419f43400aba195b7965 /drivers/net/i40e/rte_pmd_i40e.c
parent3ca63b88a8c9c79d3ca630e2ed6cdff110b382b0 (diff)
downloaddpdk-66c78f4799ff5021b749534cc35da2ae20f92397.zip
dpdk-66c78f4799ff5021b749534cc35da2ae20f92397.tar.gz
dpdk-66c78f4799ff5021b749534cc35da2ae20f92397.tar.xz
net/i40e: add support for packet template to flow director
For complex packets use raw flow type with pre-constructed packet buffer instead of creating a packet internally in PMD. Signed-off-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Diffstat (limited to 'drivers/net/i40e/rte_pmd_i40e.c')
-rw-r--r--drivers/net/i40e/rte_pmd_i40e.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c
index 4881ea0..a4c6761 100644
--- a/drivers/net/i40e/rte_pmd_i40e.c
+++ b/drivers/net/i40e/rte_pmd_i40e.c
@@ -2954,3 +2954,33 @@ int rte_pmd_i40e_rss_queue_region_conf(uint16_t port_id,
return ret;
}
+
+int rte_pmd_i40e_flow_add_del_packet_template(
+ uint16_t port,
+ const struct rte_pmd_i40e_pkt_template_conf *conf,
+ uint8_t add)
+{
+ struct rte_eth_dev *dev = &rte_eth_devices[port];
+ struct i40e_fdir_filter_conf filter_conf;
+
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+ if (!is_i40e_supported(dev))
+ return -ENOTSUP;
+
+ memset(&filter_conf, 0, sizeof(filter_conf));
+ filter_conf.soft_id = conf->soft_id;
+ filter_conf.input.flow.raw_flow.pctype = conf->input.pctype;
+ filter_conf.input.flow.raw_flow.packet = conf->input.packet;
+ filter_conf.input.flow.raw_flow.length = conf->input.length;
+ filter_conf.input.flow_ext.pkt_template = true;
+
+ filter_conf.action.rx_queue = conf->action.rx_queue;
+ filter_conf.action.behavior =
+ (enum i40e_fdir_behavior)conf->action.behavior;
+ filter_conf.action.report_status =
+ (enum i40e_fdir_status)conf->action.report_status;
+ filter_conf.action.flex_off = conf->action.flex_off;
+
+ return i40e_flow_add_del_fdir_filter(dev, &filter_conf, add);
+}