{"action":"opened","issue":{"url":"https://api.github.com/repos/eunyoung14/mtcp/issues/77","repository_url":"https://api.github.com/repos/eunyoung14/mtcp","labels_url":"https://api.github.com/repos/eunyoung14/mtcp/issues/77/labels{/name}","comments_url":"https://api.github.com/repos/eunyoung14/mtcp/issues/77/comments","events_url":"https://api.github.com/repos/eunyoung14/mtcp/issues/77/events","html_url":"https://github.com/eunyoung14/mtcp/issues/77","id":160511563,"number":77,"title":"mTCP ixgbevf support ","user":{"login":"vincentmli","id":3729694,"avatar_url":"https://avatars.githubusercontent.com/u/3729694?v=3","gravatar_id":"","url":"https://api.github.com/users/vincentmli","html_url":"https://github.com/vincentmli","followers_url":"https://api.github.com/users/vincentmli/followers","following_url":"https://api.github.com/users/vincentmli/following{/other_user}","gists_url":"https://api.github.com/users/vincentmli/gists{/gist_id}","starred_url":"https://api.github.com/users/vincentmli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vincentmli/subscriptions","organizations_url":"https://api.github.com/users/vincentmli/orgs","repos_url":"https://api.github.com/users/vincentmli/repos","events_url":"https://api.github.com/users/vincentmli/events{/privacy}","received_events_url":"https://api.github.com/users/vincentmli/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-15T20:06:27Z","updated_at":"2016-06-15T20:06:27Z","closed_at":null,"body":"## There is relevant issue report https://github.com/eunyoung14/mtcp/issues/65, I have some questions while reading the existing code and how to implement the ixgbevf support.\r\n\r\n### 1,  retrieve_dev_specs in  lib/librte_eal/linuxapp/igb_uio/igb_uio.h\r\nit is  trivial to add IXGBE VF vendor id and device id so retrieve_dev_specs can return a dev_type IXGBEVF.\r\n\r\n### 2 igbuio_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) in lib/librte_eal/linuxapp/igb_uio/igb_uio.c\r\n```\r\n501         adapter->type = retrieve_dev_specs(id);\r\n502         /* recover device-specific mac address */\r\n503         switch (adapter->type) {\r\n504         case IXGBE:\r\n505                 hw_i = &adapter->hw._ixgbe_hw;\r\n506                 hw_i->back = adapter;\r\n507                 hw_i->hw_addr = ioremap(pci_resource_start(dev, 0),\r\n508                                        pci_resource_len(dev, 0));\r\n509                 if (!hw_i->hw_addr) {\r\n510                         err = -EIO;\r\n511                         goto fail_ioremap;\r\n512                 }\r\n513                 break;\r\n514         case IGB:\r\n515                 hw_e = &adapter->hw._e1000_hw;\r\n516                 hw_e->back = adapter;\r\n517                 hw_e->hw_addr = ioremap(pci_resource_start(dev, 0),\r\n518                                       pci_resource_len(dev, 0));\r\n519                 if (!hw_e->hw_addr) {\r\n520                         err = -EIO;\r\n521                         goto fail_ioremap;\r\n522                 }\r\n523                 break;\r\n524         }\r\n```\r\nquestion: \r\n**do I need to add similar IXGBEVF switch case like IXGBE ?** \r\n**does the ioremap apply to IXGBEVF ?**\r\n\r\n### 3 retrieve_dev_addr(struct net_device *netdev, struct net_adapter *adapter)\r\n\r\n```\r\n423         switch (adapter->type) {\r\n424         case IXGBE:\r\n425                 hw_i = &adapter->hw._ixgbe_hw;\r\n426                 rar_high = IXGBE_READ_REG(hw_i, IXGBE_RAH(0));\r\n427                 rar_low = IXGBE_READ_REG(hw_i, IXGBE_RAL(0));\r\n428\r\n429                 for (i = 0; i < 4; i++)\r\n430                         netdev->dev_addr[i] = (u8)(rar_low >> (i*8));\r\n431\r\n432                 for (i = 0; i < 2; i++)\r\n433                         netdev->dev_addr[i+4] = (u8)(rar_high >> (i*8));\r\n434                 break;\r\n435         case IGB:\r\n436                 hw_e = &adapter->hw._e1000_hw;\r\n437                 rar_high = E1000_READ_REG(hw_e, E1000_RAH(0));\r\n438                 rar_low = E1000_READ_REG(hw_e, E1000_RAL(0));\r\n439\r\n440                 for (i = 0; i < E1000_RAL_MAC_ADDR_LEN; i++)\r\n441                         netdev->dev_addr[i] = (u8)(rar_low >> (i*8));\r\n442\r\n443                 for (i = 0; i < E1000_RAH_MAC_ADDR_LEN; i++)\r\n444                         netdev->dev_addr[i+4] = (u8)(rar_high >> (i*8));\r\n445                 break;\r\n446         }\r\n```\r\n\r\nquestion:\r\n\r\n**do I need to add switch case for IXGBEVF ?**\r\n**can the IXGBE_READ_REG register read apply to IXGBEVF ? **\r\n\r\n### 4 s32 ixgbe_get_mac_addr_vf(struct ixgbe_hw *hw, u8 *mac_addr) in drivers/net/ixgbe/base/ixgbe_vf.c\r\n\r\n```\r\n476 s32 ixgbe_get_mac_addr_vf(struct ixgbe_hw *hw, u8 *mac_addr)\r\n477 {\r\n478         int i;\r\n479\r\n480         for (i = 0; i < IXGBE_ETH_LENGTH_OF_ADDRESS; i++)\r\n481                 mac_addr[i] = hw->mac.perm_addr[i];\r\n482\r\n483         return IXGBE_SUCCESS;\r\n484 }\r\n```\r\n\r\nquestion:\r\n\r\n**when IXGBE VF port is bound to igb_uio driver (dpdk<#> created), is the hw->mac.perm_addr[]  populated at same time? if so I could copy hw->mac.perm_addr[] to netdev-dev_addr[]. but I think hw->mac.perm_addr[] is populated when IXGBE VF PMD driver is initialized and loaded when  mTCP app start running, any idea?** \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"vincentmli"}}