Skip to content

Conversation

@sharady
Copy link
Contributor

@sharady sharady commented May 20, 2015

No description provided.

@robhoes
Copy link
Member

robhoes commented May 20, 2015

The code that checks whether fcoe is supported should be in the monitor loop of xcp-networkd (https://github.com/xapi-project/xcp-networkd/blob/master/networkd/network_monitor_thread.ml#L127), rather than in xapi's Monitor_master.

However, in either case, the command would be run every 5 seconds, while I'd expect the FCoE capabilities of a NIC to not change that often, or even never. That is, I assume that the field means that the field refers to the inherent capabilities of the NIC, rather than whether FCoE is currently "on" (it is not a status field).

Therefore, it would be sufficient to handle it is the same way as we handle the MAC address of a PIF: we set the field when the PIF is created, and update it each time xapi starts (in case the hardware was changed/replaced when xapi wasn't running). Code for the former can go around here: https://github.com/xapi-project/xen-api/blob/master/ocaml/xapi/xapi_pif.ml#L327; the latter here: https://github.com/xapi-project/xen-api/blob/master/ocaml/xapi/xapi_pif.ml#L69.

The above also implies that the field should be on the PIF class directly, rather than the PIF_metrics class.

@robhoes
Copy link
Member

robhoes commented May 20, 2015

Perhaps this deserves a more general PIF.capabilities field where we can put various (offload) capabilities of the NIC.

@robhoes
Copy link
Member

robhoes commented May 20, 2015

Note that half of this review was actually a design review rather than a code review... A design page on xapi-project.github.io would be the right place for such a design discussion.

@sharady
Copy link
Contributor Author

sharady commented May 21, 2015

Thanks Rob, I will update the xapi-project.github.io for toolstack design.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand this bit. I was expecting something like the following, at the end of the function:

maybe_update_database "capabilities"
        (Db.PIF.get_capabilities)
        (Db.PIF.set_capabilities)
        (fun () -> Net.Interface.get_capabilities dbg ~name:device)
        (String.concat "; ")

There is no need to do anything "fcoe" specific.

@robhoes
Copy link
Member

robhoes commented Jun 5, 2015

Also, please squash the patches.

Use fcoe_driver interface to identify fcoe capable NICs.

Capabilities field:
1) ["fcoe"] - represents NIC supports fcoe
2) [] - represents NIC doesn't support fcoe

Signed-off-by: sharad yadav <[email protected]>
@sharady sharady force-pushed the CP-12093_xen_api branch from 2a0efce to 0542726 Compare June 8, 2015 05:55
@sharady
Copy link
Contributor Author

sharady commented Jun 8, 2015

Thanks @robhoes , for the review.
I have squashed the commits.

robhoes added a commit that referenced this pull request Jun 10, 2015
CP-12093: Add fcoe_supported param to PIF_metrics
@robhoes robhoes merged commit c5c24bf into xapi-project:fcoe Jun 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants