DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] flow director - perfect match filter
@ 2014-10-30 15:18 Newman Poborsky
  2014-10-31  0:48 ` Wu, Jingjing
  0 siblings, 1 reply; 3+ messages in thread
From: Newman Poborsky @ 2014-10-30 15:18 UTC (permalink / raw)
  To: dev

Hi,

I'm not sure this is the right place to post a question like this, but I've
been stuck with the same problem for days now.

I'm trying to use flow director perfect match filters and so far I haven't
been able to get it working. I have tried writing my own simple app (based
on given examples) and I tried adding filter using something as simple as:

//setting the mask to watch for src IP
memset(&fdir_masks, 0x00, sizeof(struct rte_fdir_masks));
fdir_masks.src_ipv4_mask = 0xFFFFFFFF;
ret = rte_eth_dev_fdir_set_masks(portid, &fdir_masks);
//adding filter
memset(&filter, 0, sizeof(struct rte_fdir_filter));
filter.ip_src.ipv4_addr = htonl(ipv4_src);
filter.l4type = RTE_FDIR_L4TYPE_NONE;
filter.iptype = RTE_FDIR_IPTYPE_IPV4;
ret = rte_eth_dev_fdir_add_perfect_filter(portid,&filter,3,queue,0);
...


After running this code and using using tcpreplay to push traffic to
interface, I get all the misses in the stats and no matches.  As far as I
understand, to match only on src IP, all rte_fdir_filter elements should be
set to 0, and only src_ip should be masked (with 1's).

After this I tried running testpmd application but also no luck. The
commands I used are:
set_masks_filter 0 only_ip_flow 0 src_mask 0xFFFFFFFF 0x0000 dst_mask
0x00000000 0x0000 flexbytes 0 vlan_id 0 vlan_prio 0
add_perfect_filter 0 ip src 10.10.10.10 0 dst 0.0.0.0 0 flexbytes 0 vlan 0
queue 1 soft 3

Filter is added but after sending packets to this interface, I only see
misses in stats.

What I am doing wrong?  I've read the docs and looked at API reference but
didn't find anything that could help me.

Configuring flow director filter using ethtool and sending same packets
results in matches, so packets I'm sending should be matched.

Thank you for any help!

Newman P.

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

* Re: [dpdk-dev] flow director - perfect match filter
  2014-10-30 15:18 [dpdk-dev] flow director - perfect match filter Newman Poborsky
@ 2014-10-31  0:48 ` Wu, Jingjing
  2014-10-31  7:59   ` Newman Poborsky
  0 siblings, 1 reply; 3+ messages in thread
From: Wu, Jingjing @ 2014-10-31  0:48 UTC (permalink / raw)
  To: Newman Poborsky, dev

Hi, Poborsky

Please try sending an IP packet (not UDP, TCP or SCTP).

Or you can try to set filter.l4type = RTE_FDIR_L4TYPE_TCP when adding a filter.

I guess it is because the NIC already classify you packet as TCP one.

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Newman Poborsky
> Sent: Thursday, October 30, 2014 11:18 PM
> To: dev@dpdk.org
> Subject: [dpdk-dev] flow director - perfect match filter
> 
> Hi,
> 
> I'm not sure this is the right place to post a question like this, but I've been
> stuck with the same problem for days now.
> 
> I'm trying to use flow director perfect match filters and so far I haven't been
> able to get it working. I have tried writing my own simple app (based on given
> examples) and I tried adding filter using something as simple as:
> 
> //setting the mask to watch for src IP
> memset(&fdir_masks, 0x00, sizeof(struct rte_fdir_masks));
> fdir_masks.src_ipv4_mask = 0xFFFFFFFF; ret =
> rte_eth_dev_fdir_set_masks(portid, &fdir_masks); //adding filter
> memset(&filter, 0, sizeof(struct rte_fdir_filter)); filter.ip_src.ipv4_addr =
> htonl(ipv4_src); filter.l4type = RTE_FDIR_L4TYPE_NONE; filter.iptype =
> RTE_FDIR_IPTYPE_IPV4; ret =
> rte_eth_dev_fdir_add_perfect_filter(portid,&filter,3,queue,0);
> ...
> 
> 
> After running this code and using using tcpreplay to push traffic to interface, I
> get all the misses in the stats and no matches.  As far as I understand, to
> match only on src IP, all rte_fdir_filter elements should be set to 0, and only
> src_ip should be masked (with 1's).
> 
> After this I tried running testpmd application but also no luck. The commands
> I used are:
> set_masks_filter 0 only_ip_flow 0 src_mask 0xFFFFFFFF 0x0000 dst_mask
> 0x00000000 0x0000 flexbytes 0 vlan_id 0 vlan_prio 0 add_perfect_filter 0 ip
> src 10.10.10.10 0 dst 0.0.0.0 0 flexbytes 0 vlan 0 queue 1 soft 3
> 
> Filter is added but after sending packets to this interface, I only see misses in
> stats.
> 
> What I am doing wrong?  I've read the docs and looked at API reference but
> didn't find anything that could help me.
> 
> Configuring flow director filter using ethtool and sending same packets
> results in matches, so packets I'm sending should be matched.
> 
> Thank you for any help!
> 
> Newman P.

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

* Re: [dpdk-dev] flow director - perfect match filter
  2014-10-31  0:48 ` Wu, Jingjing
@ 2014-10-31  7:59   ` Newman Poborsky
  0 siblings, 0 replies; 3+ messages in thread
From: Newman Poborsky @ 2014-10-31  7:59 UTC (permalink / raw)
  To: Wu, Jingjing; +Cc: dev

Hi,

after setting filter.l4type to RTE_FDIR_L4TYPE_UDP, packets that were
supposed to be matched were (finally!) matched, so I am more than grateful!
Thank you!!!

What do you mean by 'sending an IP packet'? Is ICMP an IP packet (has no
layer 4), or?

Once again, thank you!

BR,
Newman P.

On Fri, Oct 31, 2014 at 1:48 AM, Wu, Jingjing <jingjing.wu@intel.com> wrote:

> Hi, Poborsky
>
> Please try sending an IP packet (not UDP, TCP or SCTP).
>
> Or you can try to set filter.l4type = RTE_FDIR_L4TYPE_TCP when adding a
> filter.
>
> I guess it is because the NIC already classify you packet as TCP one.
>
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Newman Poborsky
> > Sent: Thursday, October 30, 2014 11:18 PM
> > To: dev@dpdk.org
> > Subject: [dpdk-dev] flow director - perfect match filter
> >
> > Hi,
> >
> > I'm not sure this is the right place to post a question like this, but
> I've been
> > stuck with the same problem for days now.
> >
> > I'm trying to use flow director perfect match filters and so far I
> haven't been
> > able to get it working. I have tried writing my own simple app (based on
> given
> > examples) and I tried adding filter using something as simple as:
> >
> > //setting the mask to watch for src IP
> > memset(&fdir_masks, 0x00, sizeof(struct rte_fdir_masks));
> > fdir_masks.src_ipv4_mask = 0xFFFFFFFF; ret =
> > rte_eth_dev_fdir_set_masks(portid, &fdir_masks); //adding filter
> > memset(&filter, 0, sizeof(struct rte_fdir_filter));
> filter.ip_src.ipv4_addr =
> > htonl(ipv4_src); filter.l4type = RTE_FDIR_L4TYPE_NONE; filter.iptype =
> > RTE_FDIR_IPTYPE_IPV4; ret =
> > rte_eth_dev_fdir_add_perfect_filter(portid,&filter,3,queue,0);
> > ...
> >
> >
> > After running this code and using using tcpreplay to push traffic to
> interface, I
> > get all the misses in the stats and no matches.  As far as I understand,
> to
> > match only on src IP, all rte_fdir_filter elements should be set to 0,
> and only
> > src_ip should be masked (with 1's).
> >
> > After this I tried running testpmd application but also no luck. The
> commands
> > I used are:
> > set_masks_filter 0 only_ip_flow 0 src_mask 0xFFFFFFFF 0x0000 dst_mask
> > 0x00000000 0x0000 flexbytes 0 vlan_id 0 vlan_prio 0 add_perfect_filter 0
> ip
> > src 10.10.10.10 0 dst 0.0.0.0 0 flexbytes 0 vlan 0 queue 1 soft 3
> >
> > Filter is added but after sending packets to this interface, I only see
> misses in
> > stats.
> >
> > What I am doing wrong?  I've read the docs and looked at API reference
> but
> > didn't find anything that could help me.
> >
> > Configuring flow director filter using ethtool and sending same packets
> > results in matches, so packets I'm sending should be matched.
> >
> > Thank you for any help!
> >
> > Newman P.
>

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

end of thread, other threads:[~2014-10-31  7:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-30 15:18 [dpdk-dev] flow director - perfect match filter Newman Poborsky
2014-10-31  0:48 ` Wu, Jingjing
2014-10-31  7:59   ` Newman Poborsky

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git