Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable set_field with Metadata register #16

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

commandgjj
Copy link

WriteMetadata is write-action instruction which will be applied later
than apply-action. In some case, we need use resubmit to do pipeline in
the same table and set Metadata before resubmit at the same time.
WriteMetadata cannot do the job. We need enable set_field for Metadata
register.

Actually, WriteMetadata do the same thing with set_field Metadata
register in the OvS. From OpenFlow 1.5, Metadata register also can be
used with set_field to set, not stricted only using WriteMetadata instruction.

Signed-off-by: Jinjun Gao [email protected]

@commandgjj commandgjj force-pushed the Enable_SetField_Metadata_Register branch from 75dcf64 to 1d72301 Compare January 3, 2022 11:44
@commandgjj
Copy link
Author

Maintainers, can you please help review this patch? Thanks!

@commandgjj commandgjj force-pushed the Enable_SetField_Metadata_Register branch from 1d72301 to 9951b72 Compare March 16, 2022 13:34
@commandgjj
Copy link
Author

Maintainers, can you please help review this patch? Thanks!

@wenyingd Wenying, can you please help review this change? Thanks!

@commandgjj commandgjj force-pushed the Enable_SetField_Metadata_Register branch from 9951b72 to cc4335d Compare March 29, 2022 09:00
@commandgjj commandgjj force-pushed the Enable_SetField_Metadata_Register branch from cc4335d to 781cf31 Compare March 31, 2022 08:13
@@ -843,12 +843,13 @@ func (self *Flow) installFlowActions(flowMod *openflow13.FlowMod,

log.Debugf("flow install. Added setTunnelId Action: %+v", setTunnelAction)

case "setMetadata":
// Set Metadata instruction
case ActTypeSetMetadata:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I am a bit confused. I know you want to add support for applyAction set metadata, so you add a new OFAction with it, but here you keep the original write_metadata instruction.

With your current code, if using SetMetadataAction.GetActionMessage, an ApplyAction message is generated, and can be add into ApplyActionInstruction, but if call Flow.installFlowActions it uses write_metadata instruction.

My point is, please keep the behavior compatible, maybe you should rename the original action type as write_meteadata, and add a new type set_metadata, and add call in both SetMetadataAction.GetActionMessage, and Flow.installFlowActions.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I am a bit confused. I know you want to add support for applyAction set metadata, so you add a new OFAction with it, but here you keep the original write_metadata instruction.

With your current code, if using SetMetadataAction.GetActionMessage, an ApplyAction message is generated, and can be add into ApplyActionInstruction, but if call Flow.installFlowActions it uses write_metadata instruction.

My point is, please keep the behavior compatible, maybe you should rename the original action type as write_meteadata, and add a new type set_metadata, and add call in both SetMetadataAction.GetActionMessage, and Flow.installFlowActions.

OK. I know your point. I renamed the origianl action as "writeMetadata". Please help review it again, thanks @wenyingd .

ofctrl/fgraphFlow.go Outdated Show resolved Hide resolved
@commandgjj commandgjj force-pushed the Enable_SetField_Metadata_Register branch 2 times, most recently from 4371814 to 63c14da Compare April 24, 2022 04:01
WriteMetadata is write-action instruction which will be applied later
than apply-action. In some case, we need use resubmit to do pipeline in
the same table and set Metadata before resubmit at the same time.
WriteMetadata cannot do the job. We need enable set_field for Metadata
register.

Actually, WriteMetadata do the same thing with set_field Metadata
register in the OvS. From OpenFlow 1.5, Metadata register also can be
used with set_field to set, not stricted only using WriteMetadata instruction.

After this patch, ofnet can support WriteMetadata and set_field for
Metadata meanwhile. Caller can use SetMetadata() or WriteMetadata() API
to implement WriteMetadata action, and use SetMetadataAction() and
ApplyAction() to implement set_field for Metadata.

Signed-off-by: Jinjun Gao <[email protected]>
@commandgjj commandgjj force-pushed the Enable_SetField_Metadata_Register branch from 63c14da to 350e03f Compare April 24, 2022 04:05
Copy link

@wenyingd wenyingd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just one kind remind, set_metadata action is implemented in OFAction, that means we doesn't plan to support it in FlowAction, right?

@commandgjj
Copy link
Author

LGTM. Just one kind remind, set_metadata action is implemented in OFAction, that means we doesn't plan to support it in FlowAction, right?

Yes, we don't use FlowAction currently.

@wenyingd wenyingd requested review from tnqn and ashish-varma May 7, 2022 07:58
@wenyingd
Copy link

wenyingd commented May 7, 2022

@ashish-varma Would you give a review on this change? Will it introduce conflict if we switch to OF1.5?

@wenyingd wenyingd removed the request for review from tnqn May 7, 2022 09:56
@commandgjj
Copy link
Author

@ashish-varma Would you give a review on this change? Will it introduce conflict if we switch to OF1.5?

@ashish-varma Can you please take a look this change? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants