VFd (the VF daemon) is a mechanism which can be used to configure features on a VF without direct access to the PF.
Signed-off-by: Wenzhuo Lu <wenzhuo...@intel.com> Acked-by: John McNamara <john.mcnam...@intel.com> --- V2: Some grammar and formatting fixes. doc/guides/howto/img/vf_daemon_overview.svg | 440 ++++++++++++++++++++++++++++ doc/guides/howto/index.rst | 1 + doc/guides/howto/vfd.rst | 407 +++++++++++++++++++++++++ 3 files changed, 848 insertions(+) create mode 100644 doc/guides/howto/img/vf_daemon_overview.svg create mode 100644 doc/guides/howto/vfd.rst diff --git a/doc/guides/howto/img/vf_daemon_overview.svg b/doc/guides/howto/img/vf_daemon_overview.svg new file mode 100644 index 0000000..2b3493c --- /dev/null +++ b/doc/guides/howto/img/vf_daemon_overview.svg @@ -0,0 +1,440 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- +# BSD LICENSE +# +# Copyright(c) 2017 Intel Corporation. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# - Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# - Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# +# - Neither the name of Intel Corporation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +# OF THE POSSIBILITY OF SUCH DAMAGE. +--> + +<!-- Generated by Microsoft Visio, SVG Export vf_daemon_overview.svg Page-1 --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="653.98083" + height="346.37814" + viewBox="0 0 523.18544 277.10257" + xml:space="preserve" + class="st16" + id="svg3406" + version="1.1" + inkscape:version="0.92.1 r15371" + sodipodi:docname="vf_daemon_overview.svg" + style="font-size:12px;overflow:visible;color-interpolation-filters:sRGB;fill:none;fill-rule:evenodd;stroke-linecap:square;stroke-miterlimit:3"><metadata + id="metadata3652"><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1920" + inkscape:window-height="1003" + id="namedview3650" + showgrid="false" + fit-margin-top="0" + fit-margin-left="0" + fit-margin-right="0" + fit-margin-bottom="0" + inkscape:zoom="1.683916" + inkscape:cx="370.95135" + inkscape:cy="160.84375" + inkscape:window-x="-9" + inkscape:window-y="-9" + inkscape:window-maximized="1" + inkscape:current-layer="svg3406" /><style + type="text/css" + id="style3408"> + .st1 {visibility:visible} + .st2 {fill:#5b9bd5;fill-opacity:0.25;filter:url(#filter_2);stroke:#5b9bd5;stroke-opacity:0.25} + .st3 {fill:#4f87bb;stroke:#40709c;stroke-width:0.75} + .st4 {fill:#feffff;font-family:Calibri;font-size:0.833336em} + .st5 {fill:url(#grad0-11);stroke:#4f87bb;stroke-width:0.75} + .st6 {fill:#4f87bb;font-family:Calibri;font-size:0.833336em} + .st7 {fill:#759fcc;fill-opacity:0.25;filter:url(#filter_2);stroke:#759fcc;stroke-opacity:0.25} + .st8 {fill:#668bb3;stroke:#547395;stroke-width:0.75} + .st9 {fill:#5b9bd5;fill-opacity:0.22;filter:url(#filter_2);stroke:#5b9bd5;stroke-opacity:0.22} + .st10 {fill:#5b9bd5;stroke:#c7c8c8;stroke-width:0.25} + .st11 {fill:#759fcc;fill-opacity:0.22;filter:url(#filter_2);stroke:#759fcc;stroke-opacity:0.22} + .st12 {fill:#759fcc;stroke:#c7c8c8;stroke-width:0.25} + .st13 {fill:url(#grad0-40);stroke:#a6b6cd;stroke-width:0.75} + .st14 {fill:#70ad47;fill-opacity:0.25;filter:url(#filter_2);stroke:#70ad47;stroke-opacity:0.25} + .st15 {fill:#61973d;stroke:#507e31;stroke-width:0.75} + .st16 {fill:none;fill-rule:evenodd;font-size:12px;overflow:visible;stroke-linecap:square;stroke-miterlimit:3} + </style><defs + id="Patterns_And_Gradients"><linearGradient + id="grad0-11" + x1="-0.24584444" + y1="740.83429" + x2="167.49742" + y2="740.83429" + gradientTransform="scale(1.5253548,0.65558519)" + gradientUnits="userSpaceOnUse"><stop + offset="0" + stop-color="#e9eff7" + stop-opacity="1" + id="stop3412" /><stop + offset="0.24" + stop-color="#f4f7fb" + stop-opacity="1" + id="stop3414" /><stop + offset="0.54" + stop-color="#feffff" + stop-opacity="1" + id="stop3416" /></linearGradient><linearGradient + id="grad0-40" + x1="0" + y1="0" + x2="1" + y2="0" + gradientTransform="rotate(60,0.5,0.5)"><stop + offset="0" + stop-color="#f3f6fa" + stop-opacity="1" + id="stop3419" /><stop + offset="0.24" + stop-color="#f9fafc" + stop-opacity="1" + id="stop3421" /><stop + offset="0.54" + stop-color="#feffff" + stop-opacity="1" + id="stop3423" /></linearGradient><linearGradient + id="grad0-40-2" + x1="0" + y1="0" + x2="1" + y2="0" + gradientTransform="rotate(60,0.5,0.5)"><stop + offset="0" + stop-color="#f3f6fa" + stop-opacity="1" + id="stop3419-2" /><stop + offset="0.24" + stop-color="#f9fafc" + stop-opacity="1" + id="stop3421-8" /><stop + offset="0.54" + stop-color="#feffff" + stop-opacity="1" + id="stop3423-0" /></linearGradient><filter + style="color-interpolation-filters:sRGB" + id="filter_2-6"><feGaussianBlur + stdDeviation="2" + id="feGaussianBlur3427-3" /></filter><filter + style="color-interpolation-filters:sRGB" + id="filter4802"><feGaussianBlur + stdDeviation="2" + id="feGaussianBlur4800" /></filter><filter + style="color-interpolation-filters:sRGB" + id="filter4810"><feGaussianBlur + stdDeviation="2" + id="feGaussianBlur4808" /></filter><filter + style="color-interpolation-filters:sRGB" + id="filter_2-1"><feGaussianBlur + stdDeviation="2" + id="feGaussianBlur3427-8" /></filter><linearGradient + inkscape:collect="always" + xlink:href="#grad0-11" + id="linearGradient5846" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.2751142,0,0,0.85239422,296.69995,-509.84788)" + x1="-0.24584444" + y1="740.83429" + x2="167.49742" + y2="740.83429" /><linearGradient + inkscape:collect="always" + xlink:href="#grad0-40" + id="linearGradient5848" + gradientUnits="userSpaceOnUse" + gradientTransform="scale(2.9084098,0.3438305)" + x1="-0.12893644" + y1="1717.1688" + x2="28.140806" + y2="1717.1688" /><linearGradient + inkscape:collect="always" + xlink:href="#grad0-40" + id="linearGradient5917" + gradientUnits="userSpaceOnUse" + gradientTransform="scale(2.9084098,0.3438305)" + x1="-0.12893644" + y1="1717.1688" + x2="28.140806" + y2="1717.1688" /><linearGradient + inkscape:collect="always" + xlink:href="#grad0-11" + id="linearGradient6028" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.2751142,0,0,0.85239422,14.0251,-510.3054)" + x1="-0.24584444" + y1="740.83429" + x2="167.49742" + y2="740.83429" /><linearGradient + inkscape:collect="always" + xlink:href="#grad0-40" + id="linearGradient6030" + gradientUnits="userSpaceOnUse" + gradientTransform="scale(2.9084098,0.3438305)" + x1="-0.12893644" + y1="1717.1688" + x2="28.140806" + y2="1717.1688" /></defs><defs + id="Filters"><filter + id="filter_2" + style="color-interpolation-filters:sRGB"><feGaussianBlur + stdDeviation="2" + id="feGaussianBlur3427" /></filter></defs><flowRoot + xml:space="preserve" + id="flowRoot5059" + style="font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none" + transform="translate(83.77187,-3.3273299)"><flowRegion + id="flowRegion5061"><rect + id="rect5063" + width="319.13776" + height="378.76611" + x="246.91183" + y="-24.140537" /></flowRegion><flowPara + id="flowPara5065" /></flowRoot><rect + x="310.9368" + y="41.112034" + width="185.48367" + height="52.464527" + class="st3" + id="rect3441-6" + style="font-size:medium;color-interpolation-filters:sRGB;fill:#4f87bb;fill-rule:evenodd;stroke:#40709c;stroke-width:0.59376031;stroke-linecap:square;stroke-miterlimit:3" /><rect + style="font-size:medium;color-interpolation-filters:sRGB;fill:url(#linearGradient5846);fill-rule:evenodd;stroke:#4f87bb;stroke-width:0.78190857;stroke-linecap:square;stroke-miterlimit:3" + id="rect3453-5" + class="st5" + height="142.00824" + width="213.26486" + y="122.12257" + x="296.69995" /><rect + style="font-size:medium;color-interpolation-filters:sRGB;fill:#668bb3;fill-rule:evenodd;stroke:#547395;stroke-width:0.81434548;stroke-linecap:square;stroke-miterlimit:3" + id="rect3465-8" + class="st8" + height="107.19906" + width="191.24162" + y="148.73914" + x="303.27353" /><rect + style="font-size:medium;color-interpolation-filters:sRGB;fill:#5b9bd5;fill-rule:evenodd;stroke:#c7c8c8;stroke-width:0.30626383;stroke-linecap:square;stroke-miterlimit:3" + id="rect3477-1" + class="st10" + height="37.991375" + width="99.433281" + y="201.63286" + x="345.86914" /><g + style="font-size:medium;color-interpolation-filters:sRGB;fill:none;fill-rule:evenodd;stroke-linecap:square;stroke-miterlimit:3" + transform="matrix(0.00129134,-1.4946882,0.98914737,0.00195132,-182.90697,199.1254)" + id="shape8-37-9"><title + id="title3506-4">Simple Double Arrow.14</title><path + style="fill:url(#linearGradient5848);stroke:#a6b6cd;stroke-width:0.75" + inkscape:connector-curvature="0" + id="path3508-6" + class="st13" + d="m 0,595.28 11.34,-4.49 v 2.24 h 58.8 v -2.24 l 11.33,4.49 -11.33,4.48 v -2.24 h -58.8 v 2.24 z" /></g><rect + style="font-size:medium;opacity:0.347;color-interpolation-filters:sRGB;fill:none;fill-opacity:0.91387556;fill-rule:evenodd;stroke:#0044ea;stroke-width:0.6845746;stroke-linecap:square;stroke-miterlimit:3;stroke-opacity:1" + id="rect4923-1" + width="228.54221" + height="267.54898" + x="288.59995" + y="5.0613203" /><text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:19.20002937px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;color-interpolation-filters:sRGB;fill:#0026e8;fill-opacity:0.83732054;fill-rule:evenodd;stroke:none;stroke-width:0.8000012;stroke-linecap:square;stroke-miterlimit:3" + x="478.50806" + y="25.851391" + id="text4927-7"><tspan + sodipodi:role="line" + id="tspan4925-3" + x="478.50806" + y="25.851391" + style="font-size:19.20002937px;fill:#0026e8;fill-opacity:0.83732054;stroke-width:0.8000012">VM</tspan></text> +<text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:17.06669235px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;color-interpolation-filters:sRGB;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.8000012;stroke-linecap:square;stroke-miterlimit:3" + x="343.81976" + y="68.998184" + id="text5156-5"><tspan + sodipodi:role="line" + id="tspan5154-8" + x="343.81976" + y="68.998184" + style="font-size:17.06669235px;fill:#ffffff;stroke-width:0.8000012">VF Application</tspan></text> +<text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:17.06669235px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;color-interpolation-filters:sRGB;fill:#008080;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.8000012;stroke-linecap:square;stroke-miterlimit:3" + x="457.61066" + y="138.71524" + id="text5715-9"><tspan + sodipodi:role="line" + id="tspan5713-1" + x="457.61066" + y="138.71524" + style="font-size:17.06669235px;fill:#008080;stroke-width:0.8000012">DPDK</tspan></text> +<text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:14.93335533px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;color-interpolation-filters:sRGB;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.8000012;stroke-linecap:square;stroke-miterlimit:3" + x="309.18256" + y="170.07077" + id="text5723-9"><tspan + sodipodi:role="line" + id="tspan5721-0" + x="309.18256" + y="170.07077" + style="font-size:14.93335533px;fill:#ffffff;stroke-width:0.8000012">Virtual ethdev</tspan></text> +<text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:12.80001926px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;color-interpolation-filters:sRGB;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.8000012;stroke-linecap:square;stroke-miterlimit:3" + x="367.12158" + y="223.89334" + id="text5735-1"><tspan + sodipodi:role="line" + id="tspan5733-1" + x="367.12158" + y="223.89334" + style="font-size:12.80001926px;fill:#ffffff;stroke-width:0.8000012">VF driver</tspan></text> +<g + style="font-size:medium;overflow:visible;color-interpolation-filters:sRGB;fill:none;fill-rule:evenodd;stroke-linecap:square;stroke-miterlimit:3" + transform="matrix(-1.1390578,0.0062451,-0.01163082,-1.009126,315.58916,668.0438)" + id="shape8-37-9-3"><title + id="title3506-4-4">Simple Double Arrow.14</title><path + style="fill:url(#linearGradient5917);stroke:#a6b6cd;stroke-width:0.75" + inkscape:connector-curvature="0" + id="path3508-6-2" + class="st13" + d="m 0,595.28 11.34,-4.49 v 2.24 h 58.8 v -2.24 l 11.33,4.49 -11.33,4.48 v -2.24 h -58.8 v 2.24 z" /></g><rect + x="28.261948" + y="40.65451" + width="185.48367" + height="52.464527" + class="st3" + id="rect3441-6-5" + style="font-size:medium;color-interpolation-filters:sRGB;fill:#4f87bb;fill-rule:evenodd;stroke:#40709c;stroke-width:0.59376031;stroke-linecap:square;stroke-miterlimit:3" /><rect + style="font-size:medium;color-interpolation-filters:sRGB;fill:url(#linearGradient6028);fill-rule:evenodd;stroke:#4f87bb;stroke-width:0.78190857;stroke-linecap:square;stroke-miterlimit:3" + id="rect3453-5-5" + class="st5" + height="142.00824" + width="213.26486" + y="121.66504" + x="14.025101" /><rect + style="font-size:medium;color-interpolation-filters:sRGB;fill:#668bb3;fill-rule:evenodd;stroke:#547395;stroke-width:0.81434548;stroke-linecap:square;stroke-miterlimit:3" + id="rect3465-8-0" + class="st8" + height="107.19906" + width="191.24162" + y="148.28162" + x="20.598679" /><rect + style="font-size:medium;color-interpolation-filters:sRGB;fill:#5b9bd5;fill-rule:evenodd;stroke:#c7c8c8;stroke-width:0.30626383;stroke-linecap:square;stroke-miterlimit:3" + id="rect3477-1-1" + class="st10" + height="37.991375" + width="99.433281" + y="201.17534" + x="63.19429" /><g + style="font-size:medium;color-interpolation-filters:sRGB;fill:none;fill-rule:evenodd;stroke-linecap:square;stroke-miterlimit:3" + transform="matrix(0.00129134,-1.4946882,0.98914737,0.00195132,-465.58182,198.66788)" + id="shape8-37-9-33"><title + id="title3506-4-3">Simple Double Arrow.14</title><path + style="fill:url(#linearGradient6030);stroke:#a6b6cd;stroke-width:0.75" + inkscape:connector-curvature="0" + id="path3508-6-1" + class="st13" + d="m 0,595.28 11.34,-4.49 v 2.24 h 58.8 v -2.24 l 11.33,4.49 -11.33,4.48 v -2.24 h -58.8 v 2.24 z" /></g><rect + style="font-size:medium;opacity:0.347;color-interpolation-filters:sRGB;fill:none;fill-opacity:0.91387556;fill-rule:evenodd;stroke:#0044ea;stroke-width:0.6845746;stroke-linecap:square;stroke-miterlimit:3;stroke-opacity:1" + id="rect4923-1-0" + width="228.54222" + height="267.54898" + x="5.9250998" + y="4.6037965" /><text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:19.20002937px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;color-interpolation-filters:sRGB;fill:#0026e8;fill-opacity:0.83732054;fill-rule:evenodd;stroke:none;stroke-width:0.8000012;stroke-linecap:square;stroke-miterlimit:3" + x="184.63316" + y="25.393867" + id="text4927-7-3"><tspan + sodipodi:role="line" + id="tspan4925-3-7" + x="184.63316" + y="25.393867" + style="font-size:19.20002937px;fill:#0026e8;fill-opacity:0.83732054;stroke-width:0.8000012">Host</tspan></text> +<text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:17.06669235px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;color-interpolation-filters:sRGB;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.8000012;stroke-linecap:square;stroke-miterlimit:3" + x="61.144913" + y="68.540657" + id="text5156-5-7"><tspan + sodipodi:role="line" + id="tspan5154-8-6" + x="61.144913" + y="68.540657" + style="font-size:17.06669235px;fill:#ffffff;stroke-width:0.8000012">PF Application</tspan></text> +<text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:17.06669235px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;color-interpolation-filters:sRGB;fill:#008080;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.8000012;stroke-linecap:square;stroke-miterlimit:3" + x="174.93581" + y="138.25772" + id="text5715-9-7"><tspan + sodipodi:role="line" + id="tspan5713-1-4" + x="174.93581" + y="138.25772" + style="font-size:17.06669235px;fill:#008080;stroke-width:0.8000012">DPDK</tspan></text> +<text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:14.93335533px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;color-interpolation-filters:sRGB;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.8000012;stroke-linecap:square;stroke-miterlimit:3" + x="26.507706" + y="169.61325" + id="text5723-9-4"><tspan + sodipodi:role="line" + id="tspan5721-0-5" + x="26.507706" + y="169.61325" + style="font-size:14.93335533px;fill:#ffffff;stroke-width:0.8000012">Ethdev</tspan></text> +<text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:12.80001926px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;color-interpolation-filters:sRGB;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.8000012;stroke-linecap:square;stroke-miterlimit:3" + x="84.446732" + y="223.43582" + id="text5735-1-0"><tspan + sodipodi:role="line" + id="tspan5733-1-1" + x="84.446732" + y="223.43582" + style="font-size:12.80001926px;fill:#ffffff;stroke-width:0.8000012">PF driver</tspan></text> +</svg> diff --git a/doc/guides/howto/index.rst b/doc/guides/howto/index.rst index 737d0f9..a483444 100644 --- a/doc/guides/howto/index.rst +++ b/doc/guides/howto/index.rst @@ -39,5 +39,6 @@ HowTo Guides lm_virtio_vhost_user flow_bifurcation pvp_reference_benchmark + vfd virtio_user_for_container_networking virtio_user_as_exceptional_path diff --git a/doc/guides/howto/vfd.rst b/doc/guides/howto/vfd.rst new file mode 100644 index 0000000..6f083b8 --- /dev/null +++ b/doc/guides/howto/vfd.rst @@ -0,0 +1,407 @@ +.. BSD LICENSE + Copyright(c) 2017 Intel Corporation. All rights reserved. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +VF daemon (VFd) +=============== + +VFd (the VF daemon) is a mechanism which can be used to configure features on +a VF (SR-IOV Virtual Function) without direct access to the PF (SR-IOV +Physical Function). VFd is an *EXPERIMENTAL* feature which can only be used in +the scenario of DPDK PF with a DPDK VF. If the PF port is driven by the Linux +kernel driver then the VFd feature will not work. Currently VFd is only +supported by the ixgbe and i40e drivers. + +In general VF features cannot be configured directly by an end user +application since they are under the control of the PF. The normal approach to +configuring a feature on a VF is that an application would call the APIs +provided by the VF driver. If the required feature cannot be configured by the +VF directly (the most common case) the VF sends a message to the PF through +the mailbox on ixgbe and i40e. This means that the availability of the feature +depends on whether the appropriate mailbox messages are defined. + +DPDK leverages the mailbox interface defined by the Linux kernel driver so +that compatibility with the kernel driver can be guaranteed. The downside of +this approach is that the availability of messages supported by the kernel +become a limitation when the user wants to configure features on the VF. + +VFd is a new method of controlling the features on a VF. The VF driver doesn't +talk directly to the PF driver when configuring a feature on the VF. When a VF +application (i.e., an application using the VF ports) wants to enable a VF +feature, it can send a message to the PF application (i.e., the application +using the PF port, which can be the same as the VF application). The PF +application will configure the feature for the VF. Obviously, the PF +application can also configure the VF features without a request from the VF +application. + +.. _VF_daemon_overview: + +.. figure:: img/vf_daemon_overview.* + + VF daemon (VFd) Overview + +Compared with the traditional approach the VFd moves the negotiation between +VF and PF from the driver level to application level. So the application +should define how the negotiation between the VF and PF works, or even if the +control should be limited to the PF. + +It is the application's responsibility to use VFd. Consider for example a KVM +migration, the VF application may transfer from one VM to another. It is +recommended in this case that the PF control the VF features without +participation from the VF. Then the VF application has no capability to +configure the features. So the user doesn't need to define the interface +between the VF application and the PF application. The service provider should +take the control of all the features. + +The following sections describe the VFd functionality. + +.. Note:: + + Although VFd is supported by both ixgbe and i40e, please be aware that + since the hardware capability is different, the functions supported by + ixgbe and i40e are not the same. + + +Preparing +--------- + +VFd only can be used in the scenario of DPDK PF + DPDK VF. Users should bind +the PF port to ``igb_uio``, then create the VFs based on the DPDK PF host. + +The typical procedure to achieve this is as follows: + +#. Boot the system without iommu, or with ``iommu=pt``. + +#. Bind the PF port to ``igb_uio``, for example:: + + dpdk-devbind.py -b igb_uio 01:00.0 + +#. Create a Virtual Function:: + + echo 1 > /sys/bus/pci/devices/0000:01:00.0/max_vfs + +#. Start a VM with the new VF port bypassed to it. + +#. Run a DPDK application on the PF in the host:: + + testpmd -l 0-7 -n 4 -- -i --txqflags=0 + +#. Bind the VF port to ``igb_uio`` in the VM:: + + dpdk-devbind.py -b igb_uio 03:00.0 + +#. Run a DPDK application on the VF in the VM:: + + testpmd -l 0-7 -n 4 -- -i --txqflags=0 + + +Common functions of IXGBE and I40E +---------------------------------- + +The following sections show how to enable PF/VF functionality based on the +above testpmd setup. + + +TX loopback +~~~~~~~~~~~ + +Run a testpmd runtime command on the PF to set TX loopback:: + + set tx loopback 0 on|off + +This sets whether the PF port and all the VF ports that belong to it are +allowed to send the packets to other virtual ports. + +Although it is a VFd function, it is the global setting for the whole +physical port. When using this function, the PF and all the VFs TX loopback +will be enabled/disabled. + + +VF MAC address setting +~~~~~~~~~~~~~~~~~~~~~~ + +Run a testpmd runtime command on the PF to set the MAC address for a VF port:: + + set vf mac addr 0 0 A0:36:9F:7B:C3:51 + +This testpmd runtime command will change the MAC address of the VF port to +this new address. If any other addresses are set before, they will be +overwritten. + + +VF MAC anti-spoofing +~~~~~~~~~~~~~~~~~~~~ + +Run a testpmd runtime command on the PF to enable/disable the MAC +anti-spoofing for a VF port:: + + set vf mac antispoof 0 0 on|off + +When enabling the MAC anti-spoofing, the port will not forward packets whose +source MAC address is not the same as the port. + + +VF VLAN anti-spoofing +~~~~~~~~~~~~~~~~~~~~~ + +Run a testpmd runtime command on the PF to enable/disable the VLAN +anti-spoofing for a VF port:: + + set vf vlan antispoof 0 0 on|off + +When enabling the VLAN anti-spoofing, the port will not send packets whose +VLAN ID does not belong to VLAN IDs that this port can receive. + + +VF VLAN insertion +~~~~~~~~~~~~~~~~~ + +Run a testpmd runtime command on the PF to set the VLAN insertion for a VF +port:: + + set vf vlan insert 0 0 1 + +When using this testpmd runtime command, an assigned VLAN ID can be inserted +to the transmitted packets by the hardware. + +The assigned VLAN ID can be 0. It means disabling the VLAN insertion. + + +VF VLAN stripping +~~~~~~~~~~~~~~~~~ + +Run a testpmd runtime command on the PF to enable/disable the VLAN stripping +for a VF port:: + + set vf vlan stripq 0 0 on|off + +This testpmd runtime command is used to enable/disable the RX VLAN stripping +for a specific VF port. + + +VF VLAN filtering +~~~~~~~~~~~~~~~~~ + +Run a testpmd runtime command on the PF to set the VLAN filtering for a VF +port:: + + rx_vlan add 1 port 0 vf 1 + rx_vlan rm 1 port 0 vf 1 + +These two testpmd runtime commands can be used to add or remove the VLAN +filter for several VF ports. When the VLAN filters are added only the packets +that have the assigned VLAN IDs can be received. Other packets will be dropped +by hardware. + + +The IXGBE specific VFd functions +-------------------------------- + +The functions in this section are specific to the ixgbe driver. + + +All queues drop +~~~~~~~~~~~~~~~ + +Run a testpmd runtime command on the PF to enable/disable the all queues +drop:: + + set all queues drop on|off + +This is a global setting for the PF and all the VF ports of the physical port. + +Enabling the ``all queues drop`` feature means that when there is no available +descriptor for the received packets they are dropped. The ``all queues drop`` +feature should be enabled in SR-IOV mode to avoid one queue blocking others. + + +VF packet drop +~~~~~~~~~~~~~~ + +Run a testpmd runtime command on the PF to enable/disable the packet drop for +a specific VF:: + + set vf split drop 0 0 on|off + +This is a similar function as ``all queues drop``. The difference is that this +function is per VF setting and the previous function is a global setting. + + +VF rate limit +~~~~~~~~~~~~~ + +Run a testpmd runtime command on the PF to all queues' rate limit for a +specific VF:: + + set port 0 vf 0 rate 10 queue_mask 1 + +This is a function to set the rate limit for all the queues in the +``queue_mask`` bitmap. It is not used to set the summary of the rate +limit. The rate limit of every queue will be set equally to the assigned rate +limit. + + +VF RX enabling +~~~~~~~~~~~~~~ + +Run a testpmd runtime command on the PF to enable/disable packet receiving for +a specific VF:: + + set port 0 vf 0 rx on|off + +This function can be used to stop/start packet receiving on a VF. + + +VF TX enabling +~~~~~~~~~~~~~~ + +Run a testpmd runtime command on the PF to enable/disable packet transmitting +for a specific VF:: + + set port 0 vf 0 tx on|off + +This function can be used to stop/start packet transmitting on a VF. + + +VF RX mode setting +~~~~~~~~~~~~~~~~~~ + +Run a testpmd runtime command on the PF to set the RX mode for a specific VF:: + + set port 0 vf 0 rxmode AUPE|ROPE|BAM|MPE on|off + +This function can be used to enable/disable some RX modes on the VF, including: + +* If it accept untagged packets. +* If it accepts packets matching the MAC filters. +* If it accept MAC broadcast packets, +* If it enables MAC multicast promiscuous mode. + + +The I40E specific VFd functions +------------------------------- + +The functions in this section are specific to the i40e driver. + + +VF statistics +~~~~~~~~~~~~~ + +This provides an API to get the a specific VF's statistic from PF. + + +VF statistics resetting +~~~~~~~~~~~~~~~~~~~~~~~ + +This provides an API to rest the a specific VF's statistic from PF. + + +VF link status change notification +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This provide an API to let a specific VF know if the physical link status +changed. + +Normally if a VF received this notification, the driver should notify the +application to reset the VF port. + + +VF MAC broadcast setting +~~~~~~~~~~~~~~~~~~~~~~~~ + +Run a testpmd runtime command on the PF to enable/disable MAC broadcast packet +receiving for a specific VF:: + + set vf broadcast 0 0 on|off + + +VF MAC multicast promiscuous mode +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Run a testpmd runtime command on the PF to enable/disable MAC multicast +promiscuous mode for a specific VF:: + + set vf allmulti 0 0 on|off + + +VF MAC unicast promiscuous mode +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Run a testpmd runtime command on the PF to enable/disable MAC unicast +promiscuous mode for a specific VF:: + + set vf promisc 0 0 on|off + + +VF max bandwidth +~~~~~~~~~~~~~~~~ + +Run a testpmd runtime command on the PF to set the TX maximum bandwidth for a +specific VF:: + + set vf tx max-bandwidth 0 0 2000 + +The maximum bandwidth is an absolute value in Mbps. + + +VF TC bandwidth allocation +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Run a testpmd runtime command on the PF to set the TCs (traffic class) TX +bandwidth allocation for a specific VF:: + + set vf tc tx min-bandwidth 0 0 (20,20,20,40) + +The allocated bandwidth should be set for all the TCs. The allocated bandwidth +is a relative value as a percentage. The sum of all the bandwidth should +be 100. + + +VF TC max bandwidth +~~~~~~~~~~~~~~~~~~~ + +Run a testpmd runtime command on the PF to set the TCs TX maximum bandwidth +for a specific VF:: + + set vf tc tx max-bandwidth 0 0 0 10000 + +The maximum bandwidth is an absolute value in Mbps. + + +TC strict priority scheduling +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Run a testpmd runtime command on the PF to enable/disable several TCs TX +strict priority scheduling:: + + set tx strict-link-priority 0 0x3 + +The 0 in the TC bitmap means disabling the strict priority scheduling for this +TC. To enable use a value of 1. -- 2.7.4