On Tue, Oct 24, 2017 at 10:55 PM, Yuval Mintz <yuv...@mellanox.com> wrote:
> ... > >> - if (!pci_find_ext_capability(bp->pdev, PCI_EXT_CAP_ID_SRIOV)) >> - return 0; >> - >> - if (bp->hwrm_spec_code < 0x10800) { >> + if ((!pci_find_ext_capability(bp->pdev, PCI_EXT_CAP_ID_SRIOV)) || >> + bp->hwrm_spec_code < 0x10800) { >> + /* eswitch switchdev mode not supported */ >> + bnxt_dl_ops.eswitch_mode_set = NULL; >> + bnxt_dl_ops.eswitch_mode_get = NULL; > > Why would you need to tie this interface to the presence of SRIOV in PCIe? > Also, Assuming the ability to disable sriov in #2 would cause this capability > not to be exposed after reboot, isn't this a one-way ticket? > No, he is modifying the existing devlink logic for the switchdev eswitch mode. That logic controls the SRIOV eswitch mode and depends on SRIOV. But I agree the patch makes it look cumbersome. It will be better to check for SRIOV and proper firmware support and then setup the eswitch_mode devlink methods.