wip: Add support for NXAST_LEARN#298
Open
shun159 wants to merge 2 commits intotrema:developfrom
shun159:feature/of13_nx_learn
Open
wip: Add support for NXAST_LEARN#298shun159 wants to merge 2 commits intotrema:developfrom shun159:feature/of13_nx_learn
shun159 wants to merge 2 commits intotrema:developfrom
shun159:feature/of13_nx_learn
Conversation
There was a problem hiding this comment.
Use delegate to define delegations.
There was a problem hiding this comment.
Place the . on the previous line, together with the method call receiver.
Member
Author
|
書きかけ NiciraLearnNiciraLearn.new(
idle_timeout: 0,
hard_timeout: 0,
table_id: 255, # 0xff が有効な値かどうかは未確認です。
# => 追記: 0xffは無効です。bad action/bad argumentが帰ってきてしまいます。なので、defaultは0が無難か
priority: 65535,
cookie: 0,
flags: [], # :send_flow_rem || :delete_learned
fin_hard_timeout: 0,
fin_idle_timeout: 0,
specs: [])specs# NXM_OF_VLAN_TCI[0..11]がマッチフィールドに追加される。vlan_tciフィールドの12bitをコピーする。
# 同じマッチフィールドへのコピーの場合は、単に #{ field名 }[ofs:nbits] となる。
# コピー先のマッチフィールドは、以下のようになる。
# vlan_tci=0x0000/0x0fff
# NXM_NX_VLAN_TCIは16bit長さであるが、vlan_idは0..11bitの範囲である。
# 上のようにマスクがかかり、vlan_idとマッチできる。
LearnMatch.new(
n_bits: 12, # デフォルトはdstに指定したoxm_fieldのビット数
src: :vlan_tci,
dst: :vlan_tci)
# NXM_NX_REG0[0..15]=0x1をマッチフィールドに追加する。dst_fieldのビット長 == ofs+nbitsなら、単に#{dst_field名}=#{value}
# となる。dst_fieldのビット長 > ofs+nbitsの場合には、#{dst_field名}[ofs:nbits]表記となる。コピー後にはmaskがかかる。
# コピー先のマッチフィールドは、以下のようになる。
# reg0=0x1/0xffff
# となる。LearnMatchと同様にマスクが可能。
WriteMatch.new(
n_bits: 16,
value: 1,
dst: :reg0)
# load:#{ source_field値 }[ofs:nbits]->#{dst_field}[ofs:nbits]をactionsに追加する。
# *Matchとはことなり、指定したdst_fieldにsrc_fieldの値がloadされる。
# コピー先のアクションは、以下のようになる。
# load:0->NXM_NX_REG1[0..11]
LearnLoad.new(
n_bits: 12, # デフォルトはdstに指定したoxm_fieldのビット数
src: :vlan_tci,
dst: :reg1)
# load:#{value}->#{dst_field}[ofs:nbits]をactionsに追加する。
# *Matchとはことなり、指定したdst_fieldにsrc_fieldの値がloadされる。
# コピー先のアクションは、以下のようになる。
# load:2->NXM_NX_REG2[]
WriteLoad.new(
n_bits: 32, # デフォルトはdstに指定したoxm_fieldのビット数
value: 2,
dst: :reg2)
SendOutReg.new(
n_bits: 32, # デフォルトはoutputに指定したoxm_fieldのビット数
output: :reg0,
offset: 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.