DPDK usage discussions
 help / color / mirror / Atom feed
* [dpdk-users]  i40e: The same PCTYPE with different input sets
@ 2019-11-19  1:39 胡林帆
  0 siblings, 0 replies; 5+ messages in thread
From: 胡林帆 @ 2019-11-19  1:39 UTC (permalink / raw)
  To: users

Hi all,
    I'm using Intel XXV710, trying to set two flow director filter on the same flow type (RTE_ETH_FLOW_xxx).
First is based on TCP & dst IP: 


int tcp_dip_fdir_inset(void)
{
    int ret;
    struct rte_eth_fdir_filter_info info;


    memset(&info, 0, sizeof(info));


    /* TCP && dst IP matcher */
    info.info_type = RTE_ETH_FDIR_FILTER_INPUT_SET_SELECT;
    info.info.input_set_conf.op = RTE_ETH_INPUT_SET_SELECT;
    info.info.input_set_conf.flow_type = RTE_ETH_FLOW_NONFRAG_IPV4_TCP;
    info.info.input_set_conf.inset_size = 1;
    info.info.input_set_conf.field[0] = RTE_ETH_INPUT_SET_L3_DST_IP4;
    ret = rte_eth_dev_filter_ctrl(port_id, RTE_ETH_FILTER_FDIR, RTE_ETH_FILTER_SET, &info);
}


Second is TCP & dst IP & dst port:


int tcp_dip_dport_fdir_inset(void)
{
    int ret;
    struct rte_eth_fdir_filter_info info;


    memset(&info, 0, sizeof(info));


    /* TCP && dst IP && dst port matcher */
    info.info_type = RTE_ETH_FDIR_FILTER_INPUT_SET_SELECT;
    info.info.input_set_conf.op = RTE_ETH_INPUT_SET_SELECT;
    info.info.input_set_conf.flow_type = RTE_ETH_FLOW_NONFRAG_IPV4_TCP;
    info.info.input_set_conf.inset_size = 2;
    info.info.input_set_conf.field[0] = RTE_ETH_INPUT_SET_L3_DST_IP4;
    info.info.input_set_conf.field[1] = RTE_ETH_INPUT_SET_L4_TCP_DST_PORT;
    ret = rte_eth_dev_filter_ctrl(port_id, RTE_ETH_FILTER_FDIR, RTE_ETH_FILTER_SET, &info);
}


Then I set the flow director rules for the two input set.  I found that only the last one works!
So I went deep into the i40e PMD driver, and found that if I set two input set for a flow type (RTE_ETH_FLOW_xxx), 
then the second one will overide the first one. If I change op from RTE_ETH_INPUT_SET_SELECT to RTE_ETH_INPUT_SET_ADD, 
then I found that only tcp_dip_dport_fdir works:


int
i40e_fdir_filter_inset_select(struct i40e_pf *pf,
struct rte_eth_input_set_conf *conf)
{
if (conf->op == RTE_ETH_INPUT_SET_SELECT)
inset_reg &= I40E_REG_INSET_FLEX_PAYLOAD_WORDS;
else
input_set |= pf->fdir.input_set[pctype];
}


Intel® Ethernet Controller X710/ XXV710/XL710 Datasheet, part 7.1.9 describes the FD matching criteria:
Filter Match Criteria — A packet matches a filter entry if the following conditions are met:
a. The target VSI equals to the programmed DEST_VSI.
b. The identified PCTYPE equals to the programmed PCTYPE.
c. The received packet pattern matches the programmed one (the relevant fields for the PCTYPE
as defined by the FD input set listed in Table 7-5). 


My question is:
Can we use (TCP & dst IP) and (TCP & dst IP & dst port) flow director simultaneously?
Or to be more general, same PCTYPE with different input set?
| |
Linfan Hu
|
|
zhongdahulinfan@163.com
|
签名由网易邮箱大师定制

^ permalink raw reply	[flat|nested] 5+ messages in thread
* [dpdk-users]  i40e: The same PCTYPE with different input sets
@ 2019-11-18  9:48 胡林帆
  2019-11-20  7:43 ` 胡林帆
  0 siblings, 1 reply; 5+ messages in thread
From: 胡林帆 @ 2019-11-18  9:48 UTC (permalink / raw)
  To: users

Hi all,
    I'm using Intel XXV710, trying to set two flow director filter on the same flow type (RTE_ETH_FLOW_xxx).
First is based on TCP & dst IP: 


int tcp_dip_fdir_inset(void)
{
    int ret;
    struct rte_eth_fdir_filter_info info;


    memset(&info, 0, sizeof(info));


    /* TCP && dst IP matcher */
    info.info_type = RTE_ETH_FDIR_FILTER_INPUT_SET_SELECT;
    info.info.input_set_conf.op = RTE_ETH_INPUT_SET_SELECT;
    info.info.input_set_conf.flow_type = RTE_ETH_FLOW_NONFRAG_IPV4_TCP;
    info.info.input_set_conf.inset_size = 1;
    info.info.input_set_conf.field[0] = RTE_ETH_INPUT_SET_L3_DST_IP4;
    ret = rte_eth_dev_filter_ctrl(port_id, RTE_ETH_FILTER_FDIR, RTE_ETH_FILTER_SET, &info);
}


Second is TCP & dst IP & dst port:


int tcp_dip_dport_fdir_inset(void)
{
    int ret;
    struct rte_eth_fdir_filter_info info;


    memset(&info, 0, sizeof(info));


    /* TCP && dst IP && dst port matcher */
    info.info_type = RTE_ETH_FDIR_FILTER_INPUT_SET_SELECT;
    info.info.input_set_conf.op = RTE_ETH_INPUT_SET_SELECT;
    info.info.input_set_conf.flow_type = RTE_ETH_FLOW_NONFRAG_IPV4_TCP;
    info.info.input_set_conf.inset_size = 2;
    info.info.input_set_conf.field[0] = RTE_ETH_INPUT_SET_L3_DST_IP4;
    info.info.input_set_conf.field[1] = RTE_ETH_INPUT_SET_L4_TCP_DST_PORT;
    ret = rte_eth_dev_filter_ctrl(port_id, RTE_ETH_FILTER_FDIR, RTE_ETH_FILTER_SET, &info);
}


Then I set the flow director rules for the two input set.  I found that only the last one works!
So I went deep into the i40e PMD driver, and found that if I set two input set for a flow type (RTE_ETH_FLOW_xxx), 
then the second one will overide the first one. If I change op from RTE_ETH_INPUT_SET_SELECT to RTE_ETH_INPUT_SET_ADD, 
then I found that only tcp_dip_dport_fdir works:


int
i40e_fdir_filter_inset_select(struct i40e_pf *pf,
struct rte_eth_input_set_conf *conf)
{
if (conf->op == RTE_ETH_INPUT_SET_SELECT)
inset_reg &= I40E_REG_INSET_FLEX_PAYLOAD_WORDS;
else
input_set |= pf->fdir.input_set[pctype];
}


Intel® Ethernet Controller X710/ XXV710/XL710 Datasheet, part 7.1.9 describes the FD matching criteria:
Filter Match Criteria — A packet matches a filter entry if the following conditions are met:
a. The target VSI equals to the programmed DEST_VSI.
b. The identified PCTYPE equals to the programmed PCTYPE.
c. The received packet pattern matches the programmed one (the relevant fields for the PCTYPE
as defined by the FD input set listed in Table 7-5). 


My question is:
Can we use (TCP & dst IP) and (TCP & dst IP & dst port) flow director simultaneously?
Or to be more general, same PCTYPE with different input set?
| |
Linfan Hu
|
|
zhongdahulinfan@163.com
|
签名由网易邮箱大师定制

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-11-20  9:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-19  1:39 [dpdk-users] i40e: The same PCTYPE with different input sets 胡林帆
  -- strict thread matches above, loose matches on Subject: below --
2019-11-18  9:48 胡林帆
2019-11-20  7:43 ` 胡林帆
2019-11-20  8:02   ` Cao, Yahui
2019-11-20  9:05     ` 胡林帆

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).