Go to file
Qi Zhang 485584826f common/iavf: add virtual channel protocol header
To support advanced AVF's FDIR and RSS feature, we need to figure out
what kind of data structure should be passed from VF to PF to describe
an FDIR rule or RSS config rule. The common part of the requirement is
we need a data structure to represent the input set selection of a rule's
hash key.

An input set selection is a group of fields be selected from one or more
network protocol layers that could be identified as a specific flow.
For example, select dst IP address from an IPv4 header combined with
dst port from the TCP header as the input set for an IPv4/TCP flow.

The patch adds a new data structure virtchnl_proto_hdrs to abstract
a network protocol headers group which is composed of layers of network
protocol header(virtchnl_proto_hdr).

A protocol header contains a 32 bits mask (field_selector) to describe
which fields are selected as input sets, as well as a header type
(enum virtchnl_proto_hdr_type). Each bit is mapped to a field in
enum virtchnl_proto_hdr_field guided by its header type.

+------------+-----------+------------------------------+
|            | Proto Hdr | Header Type A                |
|            |           +------------------------------+
|            |           | BIT 31 | ... | BIT 1 | BIT 0 |
|            |-----------+------------------------------+
|Proto Hdrs  | Proto Hdr | Header Type B                |
|            |           +------------------------------+
|            |           | BIT 31 | ... | BIT 1 | BIT 0 |
|            |-----------+------------------------------+
|            | Proto Hdr | Header Type C                |
|            |           +------------------------------+
|            |           | BIT 31 | ... | BIT 1 | BIT 0 |
|            |-----------+------------------------------+
|            |    ....                                  |
+-------------------------------------------------------+

All fields in enum virtchnl_proto_hdr_fields are grouped with header type
and the value of the first field of a header type is always 32 aligned.

enum proto_hdr_type {
	header_type_A = 0;
	header_type_B = 1;
	....
}

enum proto_hdr_field {
	/* header type A */
	header_A_field_0 = 0,
	header_A_field_1 = 1,
	header_A_field_2 = 2,
	header_A_field_3 = 3,

	/* header type B */
	header_B_field_0 = 32, // = header_type_B << 5
	header_B_field_0 = 33,
	header_B_field_0 = 34
	header_B_field_0 = 35,
	....
};

So we have:
proto_hdr_type = proto_hdr_field / 32
bit offset = proto_hdr_field % 32

To simply the protocol header's operations, couple help macros are added.
For example, to select src IP and dst port as input set for an IPv4/UDP
flow.

we have:
struct virtchnl_proto_hdr hdr[2];

VIRTCHNL_SET_PROTO_HDR_TYPE(&hdr[0], IPV4)
VIRTCHNL_ADD_PROTO_HDR_FIELD(&hdr[0], IPV4, SRC)

VIRTCHNL_SET_PROTO_HDR_TYPE(&hdr[1], UDP)
VIRTCHNL_ADD_PROTO_HDR_FIELD(&hdr[1], UDP, DST)

A protocol header also contains a byte array, this field should only
be used by an FDIR rule and should be ignored by RSS. For an FDIR rule,
the byte array is used to store the protocol header of a training
package. The byte array must be network order.

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-04-21 13:57:07 +02:00
.ci ci: reduce examples in static builds 2020-04-17 23:34:08 +02:00
app app/testpmd: fix PPPoE flow command 2020-04-21 13:57:07 +02:00
buildtools eal: move common header files 2020-03-31 13:08:55 +02:00
config trace: introduce new subsystem 2020-04-23 15:39:06 +02:00
devtools ring: introduce RTS ring mode 2020-04-21 12:52:55 +02:00
doc net/vhost: add options for linear and external buffer 2020-04-21 13:57:07 +02:00
drivers common/iavf: add virtual channel protocol header 2020-04-21 13:57:07 +02:00
examples vhost: prefix vDPA enum value for PCI address type 2020-04-21 13:57:07 +02:00
kernel eal: move OS-specific sub-directories 2020-03-31 13:08:55 +02:00
lib vhost: prefix vDPA enum value for PCI address type 2020-04-21 13:57:07 +02:00
license eal: move OS-specific sub-directories 2020-03-31 13:08:55 +02:00
mk net/ice: add DCF hardware initialization 2020-04-21 13:57:05 +02:00
usertools usertools: fix telemetry client with python 3 2020-02-16 22:23:20 +01:00
.editorconfig devtools: add EditorConfig file 2020-02-22 21:05:22 +01:00
.gitattributes improve git diff 2016-11-13 15:25:12 +01:00
.gitignore doc: add feature matrix table for bbdev 2020-04-19 22:34:26 +02:00
.travis.yml ci: fix telemetry dependency in Travis 2020-04-10 10:03:22 +02:00
ABI_VERSION version: 20.05-rc0 2020-02-27 12:02:19 +01:00
GNUmakefile test: move to app directory 2019-02-26 15:29:27 +01:00
MAINTAINERS doc: add user guide for VMDq example 2020-04-21 13:57:06 +02:00
Makefile remove blank lines at end of file 2019-11-26 00:12:08 +01:00
meson_options.txt trace: introduce new subsystem 2020-04-23 15:39:06 +02:00
meson.build eal: move OS-specific sub-directories 2020-03-31 13:08:55 +02:00
README license: introduce SPDX identifiers 2018-01-04 22:41:38 +01:00
VERSION version: 20.05-rc0 2020-02-27 12:02:19 +01:00

DPDK is a set of libraries and drivers for fast packet processing.
It supports many processor architectures and both FreeBSD and Linux.

The DPDK uses the Open Source BSD-3-Clause license for the core libraries
and drivers. The kernel components are GPL-2.0 licensed.

Please check the doc directory for release notes,
API documentation, and sample application information.

For questions and usage discussions, subscribe to: users@dpdk.org
Report bugs and issues to the development mailing list: dev@dpdk.org