Skip to content

Commit

Permalink
Change maximum number of buckets in OVS group add/insert_bucket message
Browse files Browse the repository at this point in the history
The current implementation limits the maximum number of buckets in an OVS group
add/insert_bucket message to 800. This constraint is based on the fact that each
bucket has 3 actions, such as `set_field:0xa0a0007->reg0`,
`set_field:0x50/0xffff->reg4`, and `resubmit(,EndpointDNAT)`. However, an update
in antrea-io#5205 introduced a new action, `set_field:0x4000000/0x4000000->reg4`, for
remote Endpoints, making it impossible to accommodate 800 buckets with 4 actions
in an OVS group add/insert_bucket message. Another case is that the message cannot
hold 800 buckets with 3 actions, such as `set_field:0xa0a0007->xxreg0`,
`set_field:0x50/0xffff->reg4` and `resubmit(,EndpointDNAT)`, for IPv6 Endpoints.

To address this limitation, we have the following changes in this patch:

- The action for loading `EpToLearnRegMark` or `EpSelectedRegMark` in table
  `ServiceLB` flows is moved back to OVS group bucket action. This original change
  was introduced in antrea-io#2101, which is a workaround to accommodate as many as more
  Endpoints in an OVS group add message in Openflow 1.3, where an OVS group can be
  only created by an add message and cannot be updated. Now we use Openflow 1.5,
  where an insert_bucket message can be used to append buckets to an existing OVS
  group. Moving the action for loading `EpToLearnRegMark` or `EpSelectedRegMark`
  back to OVS group bucket action is more logical as such action is loaded after
  Service Endpoint selection, rather than being set earlier before the selection
  in table ServiceLB.
- Set the maximum number of buckets to 400. is derived from the worst-case scenario,
  where each bucket includes 4 actions like: `set_field:0xa0a0007->xxreg0`,
  `set_field:0x50/0xffff->reg4`, `set_field:0x100000/0x100000->reg4`,
  `load:0x2->NXM_NX_REG4[16..18]` and `resubmit(,EndpointDNAT)`. We can use the
  following command to verify this:

  ```bash
  ovs-ofctl mod-group br-int group_id=100,type=select,$(for i in {0..400}; do echo -n "bucket=bucket_id:$i,weight:100,actions=set_field:0xa0a0007->xxreg0,set_field:0x50/0xffff->reg4,set_field:0/0x100000->reg4,load:0x2->NXM_NX_REG4[16..18],resubmit(,EndpointDNAT),"; done)
  ```

Signed-off-by: Hongliang Liu <[email protected]>
  • Loading branch information
hongliangl committed Jan 30, 2024
1 parent a2266ee commit 3fca101
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 38 deletions.
Loading

0 comments on commit 3fca101

Please sign in to comment.