[ovs-dev] [PATCH v2 2/3] netdev-dpdk: Convert initialization from cmdline to db

Aaron Conole aconole at redhat.com
Wed Jan 13 19:26:54 UTC 2016


Aaron Conole <aconole at redhat.com> writes:
> "Traynor, Kevin" <kevin.traynor at intel.com> writes:
>>> -----Original Message-----
>>> From: Aaron Conole [mailto:aconole at redhat.com]
>>> Sent: Monday, January 4, 2016 9:47 PM
>>> To: dev at openvswitch.org; Flavio Leitner; Traynor, Kevin
>>> Subject: [PATCH v2 2/3] netdev-dpdk: Convert initialization from cmdline to
>>> db
>>> 
>>> Existing DPDK integration is provided by use of command line options which
>>> must be split out and passed to librte in a special manner. However, this
>>> forces any configuration to be passed by way of a special DPDK flag, and
>>> interferes with ovs+dpdk packaging solutions.
>>> 
>>> This commit delays dpdk initialization until the first DPDK netdev is added
>>> to the bridge, at which point ovs initializes librte. It pulls all of
>>> the config data from the OVS database, and assembles a new argv/argc
>>> pair to be passed along.
>>> 
>>> Signed-off-by: Aaron Conole <aconole at redhat.com>
>>> ---
>>> v2:
>>> * Removed trailing whitespace
>>> * Followed for() loop brace coding style
>>> * Automatically enable DPDK when adding a DPDK enabled port
>>> * Fixed an issue on startup when DPDK enabled ports are present
>>> * Updated the documentation (including vswitch.xml) and documented all
>>>   new parameters
>>> * Dropped the premature initialization test
>>
>> Hi, mostly very minor comments below,
<<snip>>
>>> 
>>> -static inline int
>>> -dpdk_init(int argc, char **argv)
>>> +static inline void
>>> +dpdk_config(const struct ovsrec_open_vswitch *ovs_cfg)
>>>  {
>>> -    if (argc >= 2 && !strcmp(argv[1], "--dpdk")) {
>>> -        ovs_fatal(0, "DPDK support not built into this copy of Open
>>> vSwitch.");
>>> +    static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER;
>>> +
>>> +    if (ovs_cfg && ovsthread_once_start(&once)) {
>>> +        if(smap_get_bool(&ovs_cfg->other_config, "dpdk", false)) {
>>> +            ovs_fatal(0, "DPDK not supported in this copy of Open
>>> vSwitch.");
>>
>> "dpdk" db entry is not in this version of the patchset. 
>
> Good catch... I should have tested it more thoroughly.
>
>> Might be best for this function to just do nothing now. A print doesn't
>> even seem to make sense as this will be called for OVS without DPDK.
>
> Okay.
>

I'm rethinking. We need the print in this case: user has dpdk-init=true
in the database, but this version of OVS doesn't support DPDK. The
netdevs in the database will be broken, and the user will be unaware of
why.

It's the same as the original behavior - if someone requests dpdk at
runtime, but the support wasn't there at compile time, we should abort
altogether and let the user clean things up. So that's what I'm
including in my patchset.

-Aaron



More information about the dev mailing list