On 12/1/22 14:19, Ales Musil wrote:
> +
> +static enum ofperr
> +handle_nxt_ct_flush(struct ofconn *ofconn, const struct ofp_header *oh)
> +{
> + struct ofproto *ofproto = ofconn_get_ofproto(ofconn);
> + struct ofputil_ct_match match = {0};
> + uint16_t zone_id;
> +
> + ofputil_ct_match_decode(&match, &zone_id, oh);
> +
> + if (ofproto->ofproto_class->ct_flush) {
> + ofproto->ofproto_class->ct_flush(ofproto, &zone_id, &match);
>
>
> I've realized that v1 doesn't allow zone_id being NULL. However I'm not sure
> how to put that information into the extension struct.
> I'm open to any suggestion, I was thinking about flags field, which would
> grow the whole struct by 4 bytes.
IIUC, you're talking about OpenFlow interface that you created
requiring zone_id to be provided, right?
Optional arguments and multiple arguments with mixed order are
usually solved by using TLVs. You may shrink down the
'struct nx_ct_flush' structure to only mandatory elements and
make all the 'match' fields including zone_id as TLVs with the
help of include/openvswitch/ofp-prop.h.
One more thing: I don't think we should add dpctl interface for
the flushing. We don't have such interface for ct-flush-zone
so we should not have it for ct-flush. Instead, what is missing
in your implementation, is the native OpenFlow interface via
ovs-ofctl, i.e. 'ovs-ofctl ct-flush' command. And all the tests
should use it instead. This way we will also have test coverage
for the code that will actually be used by OVN/CMS.
Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev