diff options
| author | Harshitha Ramamurthy <harshitha.ramamurthy@intel.com> | 2018-01-23 11:51:04 -0500 |
|---|---|---|
| committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2018-02-14 12:43:22 -0500 |
| commit | 3872c8d44c2e489bcce0c743e808a4135e8da228 (patch) | |
| tree | 8f60040d32316e795a6420568a0bfb757a9b84ac /include/linux/avf | |
| parent | 0718e560a330599d15fddc37651d693c7a09e49e (diff) | |
virtchnl: Add filter data structures
This patch adds infrastructure to send virtchnl messages to the
PF to configure filters on the VF. The patch adds a struct
called virtchnl_filter which contains information about the fields
in the user-specified tc filter.
Signed-off-by: Harshitha Ramamurthy <harshitha.ramamurthy@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'include/linux/avf')
| -rw-r--r-- | include/linux/avf/virtchnl.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/include/linux/avf/virtchnl.h b/include/linux/avf/virtchnl.h index 6fe630ebbf23..b0a7f315bfbe 100644 --- a/include/linux/avf/virtchnl.h +++ b/include/linux/avf/virtchnl.h | |||
| @@ -138,6 +138,8 @@ enum virtchnl_ops { | |||
| 138 | VIRTCHNL_OP_REQUEST_QUEUES = 29, | 138 | VIRTCHNL_OP_REQUEST_QUEUES = 29, |
| 139 | VIRTCHNL_OP_ENABLE_CHANNELS = 30, | 139 | VIRTCHNL_OP_ENABLE_CHANNELS = 30, |
| 140 | VIRTCHNL_OP_DISABLE_CHANNELS = 31, | 140 | VIRTCHNL_OP_DISABLE_CHANNELS = 31, |
| 141 | VIRTCHNL_OP_ADD_CLOUD_FILTER = 32, | ||
| 142 | VIRTCHNL_OP_DEL_CLOUD_FILTER = 33, | ||
| 141 | }; | 143 | }; |
| 142 | 144 | ||
| 143 | /* These macros are used to generate compilation errors if a structure/union | 145 | /* These macros are used to generate compilation errors if a structure/union |
| @@ -525,6 +527,57 @@ struct virtchnl_tc_info { | |||
| 525 | 527 | ||
| 526 | VIRTCHNL_CHECK_STRUCT_LEN(24, virtchnl_tc_info); | 528 | VIRTCHNL_CHECK_STRUCT_LEN(24, virtchnl_tc_info); |
| 527 | 529 | ||
| 530 | /* VIRTCHNL_ADD_CLOUD_FILTER | ||
| 531 | * VIRTCHNL_DEL_CLOUD_FILTER | ||
| 532 | * VF sends these messages to add or delete a cloud filter based on the | ||
| 533 | * user specified match and action filters. These structures encompass | ||
| 534 | * all the information that the PF needs from the VF to add/delete a | ||
| 535 | * cloud filter. | ||
| 536 | */ | ||
| 537 | |||
| 538 | struct virtchnl_l4_spec { | ||
| 539 | u8 src_mac[ETH_ALEN]; | ||
| 540 | u8 dst_mac[ETH_ALEN]; | ||
| 541 | __be16 vlan_id; | ||
| 542 | __be16 pad; /* reserved for future use */ | ||
| 543 | __be32 src_ip[4]; | ||
| 544 | __be32 dst_ip[4]; | ||
| 545 | __be16 src_port; | ||
| 546 | __be16 dst_port; | ||
| 547 | }; | ||
| 548 | |||
| 549 | VIRTCHNL_CHECK_STRUCT_LEN(52, virtchnl_l4_spec); | ||
| 550 | |||
| 551 | union virtchnl_flow_spec { | ||
| 552 | struct virtchnl_l4_spec tcp_spec; | ||
| 553 | u8 buffer[128]; /* reserved for future use */ | ||
| 554 | }; | ||
| 555 | |||
| 556 | VIRTCHNL_CHECK_UNION_LEN(128, virtchnl_flow_spec); | ||
| 557 | |||
| 558 | enum virtchnl_action { | ||
| 559 | /* action types */ | ||
| 560 | VIRTCHNL_ACTION_DROP = 0, | ||
| 561 | VIRTCHNL_ACTION_TC_REDIRECT, | ||
| 562 | }; | ||
| 563 | |||
| 564 | enum virtchnl_flow_type { | ||
| 565 | /* flow types */ | ||
| 566 | VIRTCHNL_TCP_V4_FLOW = 0, | ||
| 567 | VIRTCHNL_TCP_V6_FLOW, | ||
| 568 | }; | ||
| 569 | |||
| 570 | struct virtchnl_filter { | ||
| 571 | union virtchnl_flow_spec data; | ||
| 572 | union virtchnl_flow_spec mask; | ||
| 573 | enum virtchnl_flow_type flow_type; | ||
| 574 | enum virtchnl_action action; | ||
| 575 | u32 action_meta; | ||
| 576 | __u8 field_flags; | ||
| 577 | }; | ||
| 578 | |||
| 579 | VIRTCHNL_CHECK_STRUCT_LEN(272, virtchnl_filter); | ||
| 580 | |||
| 528 | /* VIRTCHNL_OP_EVENT | 581 | /* VIRTCHNL_OP_EVENT |
| 529 | * PF sends this message to inform the VF driver of events that may affect it. | 582 | * PF sends this message to inform the VF driver of events that may affect it. |
| 530 | * No direct response is expected from the VF, though it may generate other | 583 | * No direct response is expected from the VF, though it may generate other |
| @@ -753,6 +806,12 @@ virtchnl_vc_validate_vf_msg(struct virtchnl_version_info *ver, u32 v_opcode, | |||
| 753 | break; | 806 | break; |
| 754 | case VIRTCHNL_OP_DISABLE_CHANNELS: | 807 | case VIRTCHNL_OP_DISABLE_CHANNELS: |
| 755 | break; | 808 | break; |
| 809 | case VIRTCHNL_OP_ADD_CLOUD_FILTER: | ||
| 810 | valid_len = sizeof(struct virtchnl_filter); | ||
| 811 | break; | ||
| 812 | case VIRTCHNL_OP_DEL_CLOUD_FILTER: | ||
| 813 | valid_len = sizeof(struct virtchnl_filter); | ||
| 814 | break; | ||
| 756 | /* These are always errors coming from the VF. */ | 815 | /* These are always errors coming from the VF. */ |
| 757 | case VIRTCHNL_OP_EVENT: | 816 | case VIRTCHNL_OP_EVENT: |
| 758 | case VIRTCHNL_OP_UNKNOWN: | 817 | case VIRTCHNL_OP_UNKNOWN: |
