Ethernet Products
Determine ramifications of Intel® Ethernet products and technologies
4808 Discussions

How to use barefoot runtime API (C++) to manipulate my tofino switch?

jinzhao
Novice
927 Views

I try with the following 

int main()
{
    std::shared_ptr<bfrt::BfRtSession> session;
    session = bfrt::BfRtSession::sessionCreate();
    if(session == nullptr)
        printf("fail to open session");
       
    std::vector<int> v;
    bf_rt_target_t dev_tgt;
    dev_tgt.dev_id = 0;
    dev_tgt.pipe_id = ALL_PIPES;
    const bfrt::BfRtInfo *bfrtInfo = nullptr;
    auto &devMgr = bfrt::BfRtDevMgr::getInstance();
    bf_status_t status = devMgr.bfRtInfoGet(dev_tgt.dev_id, "l2_program", &bfrtInfo);
    if(status != BF_SUCCESS)
    {
        printf("ERROR: Cannot get BfRt info: %s", bf_err_str(status));
    }
    return 0;
}
 
But when I run the program, it says 
ERROR: Cannot get BfRt info: Object not found
 
I have start my p4 program, why this error happens?
0 Kudos
3 Replies
ak6dn
Valued Contributor III
902 Views

Wrong forum. This forum is for FPGA devices. You want an Intel networking forum.

0 Kudos
BoonBengT_Intel
Moderator
892 Views

Hi @jinzhao,


Thank you for posting in Intel community forum and hope all is well.

As further understand the mention product which is eternet related instead of FPGA, hence will be moving the message to the correct community, and the relevant team will get back to you.


Best Wishes

BB


0 Kudos
Caguicla_Intel
Moderator
852 Views

Hello jinzhao,


Thank you for posting in Intel Ethernet Communities. 


We regret to inform you that your query is out of our scope and we have a specific team who handles this kind of request. Kindly click the link below to contact the concerned team for further assistance. 

https://www.barefootnetworks.com/about-us/#contact-us or info@barefootnetworks.com


Feel free to let us know if you have questions or clarifications. 


Please also be informed that we will now close this request. Just feel free to post a new question if you may have any other inquiry regarding Ethernet products in the future as this thread will no longer be monitored.


Thank you for choosing Intel and stay safe!


Best regards,

Crisselle C.

Intel Customer Support


0 Kudos
Reply