[dpdk-dev] raw pattern for rte_flow

Zhao1, Wei wei.zhao1 at intel.com
Mon Dec 17 08:17:59 CET 2018

More info for this problem:
Old type filter can get actual number from CLI because there is a function xdigit2val(unsigned char c)  for it.
Maybe flow CLI also need one.

From: Zhao1, Wei
Sent: Monday, December 17, 2018 3:06 PM
To: adrien.mazarguil at 6wind.com
Cc: Peng, Yuan <yuan.peng at intel.com>; dev at dpdk.org; Zhang, Qi Z <qi.z.zhang at intel.com>; Lu, Wenzhuo <wenzhuo.lu at intel.com>
Subject: raw pattern for rte_flow

By now, we need to enable flexible byte filter for ixgbe, but PMD can not work well.
Because in RTE_FLOW_ITEM_TYPE_RAW type pattern, the key parameters (const uint8_t *pattern)  in struct rte_flow_item_raw,
which we get rte_flow command line is ASIC number not the actual number.
For example, if we  type in the following command, PMD will get “0x6463” for “cd” not “11011100”, this make filter hard to search some specific parameters.
AND also, it is realted to all type of NIC, not only IXGBE .

Flow create 0 ingress pattern raw relative spec 0 relative mask 1 search spec 0 search mask 1 offset spec 54 offset mask 0xffffffff limit spec 0 limit mask 0xffff pattern is cd / end actions queue index 2 / end

struct rte_flow_item_raw {
                uint32_t relative:1; /**< Look for pattern after the previous item. */
                uint32_t search:1; /**< Search pattern from offset (see also limit). */
                uint32_t reserved:30; /**< Reserved, must be set to zero. */
                int32_t offset; /**< Absolute or relative offset for pattern. */
                uint16_t limit; /**< Search area limit for start of pattern. */
                uint16_t length; /**< Pattern length. */
                const uint8_t *pattern; /**< Byte string to look for. */

More information about the dev mailing list