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

Get SAI_OBJECT_TYPE_FDB_ENTRY failed by npu.process_commands #239

Open
xuyinhao opened this issue Aug 27, 2024 · 3 comments
Open

Get SAI_OBJECT_TYPE_FDB_ENTRY failed by npu.process_commands #239

xuyinhao opened this issue Aug 27, 2024 · 3 comments

Comments

@xuyinhao
Copy link

xuyinhao commented Aug 27, 2024

my simple code :

    idx=0
    mac = macs[0]
    cmds3 = [
       {
            "name": f"fdb_{idx}",
            "op": "get",
            "type": "SAI_OBJECT_TYPE_FDB_ENTRY",
            "key": {
                "bv_id": "$vlan_10",
                "mac_address": mac,
                "switch_id" : "$SWITCH_ID"
            },
            "attributes": [
                "SAI_FDB_ENTRY_ATTR_TYPE"
            ]
        }
    ]
    status = [*npu.process_commands(cmds3)]

error:

/usr/local/lib/python3.9/dist-packages/saichallenger/common/sai.py:210: in process_commands
    yield from map(self.command_processor.process_command, commands)
/usr/local/lib/python3.9/dist-packages/saichallenger/common/sai.py:155: in process_command
    obj_type = self.sai.vid_to_type(obj_id)
/usr/local/lib/python3.9/dist-packages/saichallenger/common/sai.py:290: in vid_to_type
    return self.sai_client.vid_to_type(vid)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

vid = 'SAI_OBJECT_TYPE_FDB_ENTRY:{"bv_id": "oid:0x260000000009b5", "mac_address": "00:11:11:11:11:11", "switch_id": "oid:0x21000000000000"}'

    @staticmethod
    def vid_to_type(vid):
>       obj_type = int(vid[4:], 16) >> 48
E       ValueError: invalid literal for int() with base 16: 'OBJECT_TYPE_FDB_ENTRY:{"bv_id": "oid:0x260000000009b5", "mac_address": "00:11:11:11:11:11", "switch_id": "oid:0x21000000000000"}'

/usr/local/lib/python3.9/dist-packages/saichallenger/common/sai_client/sai_redis_client/sai_redis_client.py:604: ValueError

sai.py not support fdb info (key) get , there obj_id is 'SAI_OBJECT_TYPE_FDB_ENTRY:{"bv_id": "oid:0x260000000009b5", "mac_address": "00:11:11:11:11:11", "switch_id": "oid:0x21000000000000"} '

 elif operation == "get":
            obj_type = self.sai.vid_to_type(obj_id)
            results = []
            for attr in attrs:
                attr_type = self.sai.get_obj_attr_type(obj_type, attr)
                status, data = self.sai.get_by_type(obj_id, attr, attr_type)
                assert status == "SAI_STATUS_SUCCESS", f"Failed to retrieve {attr}: {status}"
                results.append(data)
            return results
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

No branches or pull requests

4 participants
@xuyinhao and others