{"action":"created","issue":{"url":"https://api.github.com/repos/Azure/sonic-swss/issues/583","repository_url":"https://api.github.com/repos/Azure/sonic-swss","labels_url":"https://api.github.com/repos/Azure/sonic-swss/issues/583/labels{/name}","comments_url":"https://api.github.com/repos/Azure/sonic-swss/issues/583/comments","events_url":"https://api.github.com/repos/Azure/sonic-swss/issues/583/events","html_url":"https://github.com/Azure/sonic-swss/issues/583","id":351776034,"node_id":"MDU6SXNzdWUzNTE3NzYwMzQ=","number":583,"title":"SAI_POLICER_ATTR_METER_TYPE meta_generic_validation_set error","user":{"login":"jipanyang","id":29779499,"node_id":"MDQ6VXNlcjI5Nzc5NDk5","avatar_url":"https://avatars3.githubusercontent.com/u/29779499?v=4","gravatar_id":"","url":"https://api.github.com/users/jipanyang","html_url":"https://github.com/jipanyang","followers_url":"https://api.github.com/users/jipanyang/followers","following_url":"https://api.github.com/users/jipanyang/following{/other_user}","gists_url":"https://api.github.com/users/jipanyang/gists{/gist_id}","starred_url":"https://api.github.com/users/jipanyang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jipanyang/subscriptions","organizations_url":"https://api.github.com/users/jipanyang/orgs","repos_url":"https://api.github.com/users/jipanyang/repos","events_url":"https://api.github.com/users/jipanyang/events{/privacy}","received_events_url":"https://api.github.com/users/jipanyang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-18T00:53:10Z","updated_at":"2018-08-24T18:38:36Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Attribute SAI_POLICER_ATTR_METER_TYPE is create only, while CoppOrch::processCoppRule() provided set interface for it.\r\n\r\nhttps://github.com/Azure/sonic-swss/blob/136621b497d8a51577c7a33e67c7d0fb68a04f2d/orchagent/copporch.cpp#L379\r\n\r\n\r\n```\r\nAug 17 21:10:39.473234 sonic ERR swss/orchagent: :- meta_generic_validation_set: SAI_POLICER_ATTR_METER_TYPE:SAI_ATTR_VALUE_TYPE_INT32 attr is create only and cannot be modified\r\nAug 17 21:10:39.473345 sonic ERR swss/orchagent: :- processCoppRule: Failed to apply attribute[2].id=0 to policer for trap group:default, error:-5\r\nAug 17 21:10:39.473345 sonic ERR swss/orchagent: :- doTask: Processing copp task item failed, exiting. \r\n```\r\n\r\n```\r\n    /**\r\n     * @brief Policer Meter Type\r\n     *\r\n     * @type sai_meter_type_t\r\n     * @flags MANDATORY_ON_CREATE | CREATE_ONLY\r\n     */\r\n    SAI_POLICER_ATTR_METER_TYPE = SAI_POLICER_ATTR_START,\r\n```"},"comment":{"url":"https://api.github.com/repos/Azure/sonic-swss/issues/comments/415846527","html_url":"https://github.com/Azure/sonic-swss/issues/583#issuecomment-415846527","issue_url":"https://api.github.com/repos/Azure/sonic-swss/issues/583","id":415846527,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNTg0NjUyNw==","user":{"login":"jipanyang","id":29779499,"node_id":"MDQ6VXNlcjI5Nzc5NDk5","avatar_url":"https://avatars3.githubusercontent.com/u/29779499?v=4","gravatar_id":"","url":"https://api.github.com/users/jipanyang","html_url":"https://github.com/jipanyang","followers_url":"https://api.github.com/users/jipanyang/followers","following_url":"https://api.github.com/users/jipanyang/following{/other_user}","gists_url":"https://api.github.com/users/jipanyang/gists{/gist_id}","starred_url":"https://api.github.com/users/jipanyang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jipanyang/subscriptions","organizations_url":"https://api.github.com/users/jipanyang/orgs","repos_url":"https://api.github.com/users/jipanyang/repos","events_url":"https://api.github.com/users/jipanyang/events{/privacy}","received_events_url":"https://api.github.com/users/jipanyang/received_events","type":"User","site_admin":false},"created_at":"2018-08-24T18:38:36Z","updated_at":"2018-08-24T18:38:36Z","author_association":"CONTRIBUTOR","body":"It will be if possible.  Actually there are few other create only attributes in saipolicer.h\r\nWe either make them create and set, or update SONiC code logic to handle them properly.\r\n\r\n```\r\n    /**\r\n     * @brief Policer Meter Type\r\n     *\r\n     * @type sai_meter_type_t\r\n     * @flags MANDATORY_ON_CREATE | CREATE_ONLY\r\n     */\r\n    SAI_POLICER_ATTR_METER_TYPE = SAI_POLICER_ATTR_START,\r\n\r\n    /**\r\n     * @brief Policer mode\r\n     *\r\n     * @type sai_policer_mode_t\r\n     * @flags MANDATORY_ON_CREATE | CREATE_ONLY\r\n     */\r\n    SAI_POLICER_ATTR_MODE = 0x00000001,\r\n\r\n    /**\r\n     * @brief Policer Color Source\r\n     *\r\n     * @type sai_policer_color_source_t\r\n     * @flags CREATE_ONLY\r\n     * @default SAI_POLICER_COLOR_SOURCE_AWARE\r\n     */\r\n    SAI_POLICER_ATTR_COLOR_SOURCE = 0x00000002,\r\n```"}}
{"actor":{"display_login":"jipanyang"}}