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

Rewrite LOCI wire type pushing #153

Merged
merged 6 commits into from
Dec 11, 2013
Merged

Conversation

rlane
Copy link
Contributor

@rlane rlane commented Dec 11, 2013

Reviewer: @andi-bigswitch

This removes part of the manual labor required when adding new OpenFlow classes.

The old code is disabled but not yet deleted.

The generated code looks like:

```
void
of_bsn_lacp_stats_reply_push_wire_types(of_object_t *obj)
{
    unsigned char *buf = loci_object_to_buffer(obj);
    switch (obj->version) {
    case OF_VERSION_1_3:
        *(uint8_t *)(buf + 0) = obj->version; /* version */
        *(uint8_t *)(buf + 1) = 19; /* type */
        *(uint16_t *)(buf + 8) = htobe16(65535); /* stats_type */
        *(uint32_t *)(buf + 16) = htobe32(6035143); /* experimenter */
        *(uint32_t *)(buf + 20) = htobe32(1); /* subtype */
        break;
    default:
        UNREACHABLE();
    }
}
```
The other backends don't rely on these lengths which is why this was never
noticed. The C backend relies on them, but used to set the length field for
OXMs itself.
@andi-bigswitch
Copy link
Contributor

Done review. One fully optional comment.

ACK

@bsn-abat
Copy link

ABAT: START_MERGE: Log file at http://sbs2/abat/2013.12.11.1939-m.loxigen.master/abat.log

bsn-abat pushed a commit to floodlight/loxigen-artifacts that referenced this pull request Dec 11, 2013
Loxigen Head commit floodlight/loxigen@026ff02
commit 026ff024585f1588a7f11fa4c1a9a48d44dc098d
Merge: 6277874 a62cb58
Author: abat <abat@bigswitch.com>
Date:   Wed Dec 11 11:39:26 2013 -0800

    Merge into master from pull request #153:
    Rewrite LOCI wire type pushing (floodlight/loxigen#153)

commit a62cb5814254b54c8b44b2942e93f4a074dbffbf
Author: Rich Lane <rlane@bigswitch.com>
Date:   Tue Dec 10 15:52:39 2013 -0800

    openflow_input: fix lengths in masked extension OXMs

    The other backends don't rely on these lengths which is why this was never
    noticed. The C backend relies on them, but used to set the length field for
    OXMs itself.

commit cf44ffebed56cb06c11dde8c2ef32e315ac1f24d
Author: Rich Lane <rlane@bigswitch.com>
Date:   Tue Dec 10 14:19:58 2013 -0800

    loci: remove dead code

commit 92feca84ef012a5a51428e3c0569f4ff36329350
Author: Rich Lane <rlane@bigswitch.com>
Date:   Tue Dec 10 15:57:13 2013 -0800

    loci: use new push_wire_types functions in list_append_bind

commit bdd8e29ad83bac4707e33123d0455bcaf181f9e7
Author: Rich Lane <rlane@bigswitch.com>
Date:   Fri Dec 6 17:37:39 2013 -0800

    loci: use IR to push wire types

    The old code is disabled but not yet deleted.

    The generated code looks like:

    ```
    void
    of_bsn_lacp_stats_reply_push_wire_types(of_object_t *obj)
    {
        unsigned char *buf = loci_object_to_buffer(obj);
        switch (obj->version) {
        case OF_VERSION_1_3:
            *(uint8_t *)(buf + 0) = obj->version; /* version */
            *(uint8_t *)(buf + 1) = 19; /* type */
            *(uint16_t *)(buf + 8) = htobe16(65535); /* stats_type */
            *(uint32_t *)(buf + 16) = htobe32(6035143); /* experimenter */
            *(uint32_t *)(buf + 20) = htobe32(1); /* subtype */
            break;
        default:
            UNREACHABLE();
        }
    }
    ```

commit 043a3d86dee9931a72084b710786323bf4a0213e
Author: Rich Lane <rlane@bigswitch.com>
Date:   Tue Dec 10 10:57:30 2013 -0800

    loci: use IR in class_is_virtual

commit 5fe7721717915bbb9ddd6d6127016164fdfd3ad2
Author: Rich Lane <rlane@bigswitch.com>
Date:   Tue Dec 10 10:56:47 2013 -0800

    loxi_ir: add convenience property OFClass.has_type_members
bsn-abat pushed a commit that referenced this pull request Dec 11, 2013
Rewrite LOCI wire type pushing (#153)
@bsn-abat bsn-abat merged commit a62cb58 into floodlight:master Dec 11, 2013
@bsn-abat
Copy link

ABAT: ACCEPT: Successfully merged

In case you want to see the build log, check out :
Log file at http://sbs2/abat/2013.12.11.1939-m.loxigen.master/abat.log
/cc

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.

None yet

3 participants