DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v2] doc: introduce PVP reference benchmark
From: Maxime Coquelin @ 2016-12-09  6:29 UTC (permalink / raw)
  To: Mcnamara, John, yuanhan.liu@linux.intel.com,
	thomas.monjalon@6wind.com, Yang, Zhiyong, ktraynor@redhat.com,
	dev@dpdk.org
In-Reply-To: <B27915DBBA3421428155699D51E4CFE202670D72@IRSMSX103.ger.corp.intel.com>



On 12/07/2016 10:07 PM, Mcnamara, John wrote:
>> -----Original Message-----
>> From: Maxime Coquelin [mailto:maxime.coquelin@redhat.com]
>> Sent: Tuesday, December 6, 2016 12:25 PM
>> To: yuanhan.liu@linux.intel.com; thomas.monjalon@6wind.com; Mcnamara, John
>> <john.mcnamara@intel.com>; Yang, Zhiyong <zhiyong.yang@intel.com>;
>> ktraynor@redhat.com; dev@dpdk.org
>> Cc: Maxime Coquelin <maxime.coquelin@redhat.com>
>> Subject: [PATCH v2] doc: introduce PVP reference benchmark
>>
>> Having reference benchmarks is important in order to obtain reproducible
>> performance figures.
>>
>> This patch describes required steps to configure a PVP setup using testpmd
>> in both host and guest.
>>
>> Not relying on external vSwitch ease integration in a CI loop by not being
>> impacted by DPDK API changes.
>>
>> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
>
> There is one trailing whitespace warning but apart from that:
>
> Acked-by: John McNamara <john.mcnamara@intel.com>

Thanks John,

Do you want me to send a v3, fixing the trailing whitespace &
collecting the acks?

  -- Maxime

>
>
>
>> ---
>>
>> Thanks to all the reviewers, this v2 should take all remarks into account.
>>
>>  -- Maxime
>>
>>  doc/guides/howto/img/pvp_2nics.svg           | 556
>> +++++++++++++++++++++++++++
>>  doc/guides/howto/index.rst                   |   1 +
>>  doc/guides/howto/pvp_reference_benchmark.rst | 395 +++++++++++++++++++
>>  3 files changed, 952 insertions(+)
>>  create mode 100644 doc/guides/howto/img/pvp_2nics.svg
>>  create mode 100644 doc/guides/howto/pvp_reference_benchmark.rst
>>
>> diff --git a/doc/guides/howto/img/pvp_2nics.svg
>> b/doc/guides/howto/img/pvp_2nics.svg
>> new file mode 100644
>> index 0000000..517a800
>> --- /dev/null
>> +++ b/doc/guides/howto/img/pvp_2nics.svg
>> @@ -0,0 +1,556 @@
>> +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
>> +<!-- Created with Inkscape (http://www.inkscape.org/) -->
>> +
>> +<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:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
>> +   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
>> +   width="127.46428mm"
>> +   height="139.41411mm"
>> +   viewBox="0 0 451.64508 493.987"
>> +   id="svg2"
>> +   version="1.1"
>> +   inkscape:version="0.92pre2 r"
>> +   sodipodi:docname="pvp_2nics.svg"
>> +   inkscape:export-filename="/home/max/Pictures/dpdk/pvp/pvp.png"
>> +   inkscape:export-xdpi="90"
>> +   inkscape:export-ydpi="90">
>> +  <defs
>> +     id="defs4">
>> +    <marker
>> +       inkscape:stockid="Arrow1Lend"
>> +       orient="auto"
>> +       refY="0"
>> +       refX="0"
>> +       id="marker4760"
>> +       style="overflow:visible"
>> +       inkscape:isstock="true">
>> +      <path
>> +         inkscape:connector-curvature="0"
>> +         id="path4762"
>> +         d="M 0,0 5,-5 -12.5,0 5,5 Z"
>> +         style="fill:#ff0000;fill-opacity:1;fill-
>> rule:evenodd;stroke:#ff0000;stroke-width:1.00000003pt;stroke-opacity:1"
>> +         transform="matrix(-0.8,0,0,-0.8,-10,0)" />
>> +    </marker>
>> +    <marker
>> +       inkscape:stockid="Arrow1Lend"
>> +       orient="auto"
>> +       refY="0"
>> +       refX="0"
>> +       id="marker4642"
>> +       style="overflow:visible"
>> +       inkscape:isstock="true">
>> +      <path
>> +         inkscape:connector-curvature="0"
>> +         id="path4644"
>> +         d="M 0,0 5,-5 -12.5,0 5,5 Z"
>> +         style="fill:#ff0000;fill-opacity:1;fill-
>> rule:evenodd;stroke:#ff0000;stroke-width:1.00000003pt;stroke-opacity:1"
>> +         transform="matrix(-0.8,0,0,-0.8,-10,0)" />
>> +    </marker>
>> +    <marker
>> +       inkscape:stockid="Arrow1Lstart"
>> +       orient="auto"
>> +       refY="0"
>> +       refX="0"
>> +       id="marker10370"
>> +       style="overflow:visible"
>> +       inkscape:isstock="true">
>> +      <path
>> +         id="path10372"
>> +         d="M 0,0 5,-5 -12.5,0 5,5 Z"
>> +         style="fill:#ff0000;fill-opacity:1;fill-
>> rule:evenodd;stroke:#ff0000;stroke-width:1.00000003pt;stroke-opacity:1"
>> +         transform="matrix(0.8,0,0,0.8,10,0)"
>> +         inkscape:connector-curvature="0" />
>> +    </marker>
>> +    <marker
>> +       inkscape:isstock="true"
>> +       style="overflow:visible"
>> +       id="marker10306"
>> +       refX="0"
>> +       refY="0"
>> +       orient="auto"
>> +       inkscape:stockid="Arrow1Lend">
>> +      <path
>> +         transform="matrix(-0.8,0,0,-0.8,-10,0)"
>> +         style="fill:#ff0000;fill-opacity:1;fill-
>> rule:evenodd;stroke:#ff0000;stroke-width:1.00000003pt;stroke-opacity:1"
>> +         d="M 0,0 5,-5 -12.5,0 5,5 Z"
>> +         id="path10308"
>> +         inkscape:connector-curvature="0" />
>> +    </marker>
>> +    <marker
>> +       inkscape:isstock="true"
>> +       style="overflow:visible"
>> +       id="marker9757"
>> +       refX="0"
>> +       refY="0"
>> +       orient="auto"
>> +       inkscape:stockid="Arrow1Lend"
>> +       inkscape:collect="always">
>> +      <path
>> +         transform="matrix(-0.8,0,0,-0.8,-10,0)"
>> +         style="fill:#ff0000;fill-opacity:1;fill-
>> rule:evenodd;stroke:#ff0000;stroke-width:1.00000003pt;stroke-opacity:1"
>> +         d="M 0,0 5,-5 -12.5,0 5,5 Z"
>> +         id="path9759"
>> +         inkscape:connector-curvature="0" />
>> +    </marker>
>> +    <marker
>> +       inkscape:stockid="Arrow1Lstart"
>> +       orient="auto"
>> +       refY="0"
>> +       refX="0"
>> +       id="Arrow1Lstart"
>> +       style="overflow:visible"
>> +       inkscape:isstock="true">
>> +      <path
>> +         id="path4224"
>> +         d="M 0,0 5,-5 -12.5,0 5,5 Z"
>> +         style="fill:#000000;fill-opacity:1;fill-
>> rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
>> +         transform="matrix(0.8,0,0,0.8,10,0)"
>> +         inkscape:connector-curvature="0" />
>> +    </marker>
>> +    <marker
>> +       inkscape:stockid="Arrow1Lend"
>> +       orient="auto"
>> +       refY="0"
>> +       refX="0"
>> +       id="Arrow1Lend"
>> +       style="overflow:visible"
>> +       inkscape:isstock="true">
>> +      <path
>> +         id="path4227"
>> +         d="M 0,0 5,-5 -12.5,0 5,5 Z"
>> +         style="fill:#000000;fill-opacity:1;fill-
>> rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
>> +         transform="matrix(-0.8,0,0,-0.8,-10,0)"
>> +         inkscape:connector-curvature="0" />
>> +    </marker>
>> +    <marker
>> +       inkscape:stockid="Arrow1Lend"
>> +       orient="auto"
>> +       refY="0"
>> +       refX="0"
>> +       id="Arrow1Lend-1"
>> +       style="overflow:visible"
>> +       inkscape:isstock="true">
>> +      <path
>> +         inkscape:connector-curvature="0"
>> +         id="path4227-27"
>> +         d="M 0,0 5,-5 -12.5,0 5,5 Z"
>> +         style="fill:#000000;fill-opacity:1;fill-
>> rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
>> +         transform="matrix(-0.8,0,0,-0.8,-10,0)" />
>> +    </marker>
>> +    <marker
>> +       inkscape:stockid="Arrow1Lstart"
>> +       orient="auto"
>> +       refY="0"
>> +       refX="0"
>> +       id="Arrow1Lstart-9"
>> +       style="overflow:visible"
>> +       inkscape:isstock="true">
>> +      <path
>> +         inkscape:connector-curvature="0"
>> +         id="path4224-3"
>> +         d="M 0,0 5,-5 -12.5,0 5,5 Z"
>> +         style="fill:#000000;fill-opacity:1;fill-
>> rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
>> +         transform="matrix(0.8,0,0,0.8,10,0)" />
>> +    </marker>
>> +    <marker
>> +       inkscape:isstock="true"
>> +       style="overflow:visible"
>> +       id="marker9757-0"
>> +       refX="0"
>> +       refY="0"
>> +       orient="auto"
>> +       inkscape:stockid="Arrow1Lend">
>> +      <path
>> +         transform="matrix(-0.8,0,0,-0.8,-10,0)"
>> +         style="fill:#ff0000;fill-opacity:1;fill-
>> rule:evenodd;stroke:#ff0000;stroke-width:1.00000003pt;stroke-opacity:1"
>> +         d="M 0,0 5,-5 -12.5,0 5,5 Z"
>> +         id="path9759-6"
>> +         inkscape:connector-curvature="0" />
>> +    </marker>
>> +    <marker
>> +       inkscape:stockid="Arrow1Lstart"
>> +       orient="auto"
>> +       refY="0"
>> +       refX="0"
>> +       id="Arrow1Lstart-6"
>> +       style="overflow:visible"
>> +       inkscape:isstock="true">
>> +      <path
>> +         inkscape:connector-curvature="0"
>> +         id="path4224-0"
>> +         d="M 0,0 5,-5 -12.5,0 5,5 Z"
>> +         style="fill:#000000;fill-opacity:1;fill-
>> rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
>> +         transform="matrix(0.8,0,0,0.8,10,0)" />
>> +    </marker>
>> +    <marker
>> +       inkscape:stockid="Arrow1Lend"
>> +       orient="auto"
>> +       refY="0"
>> +       refX="0"
>> +       id="Arrow1Lend-62"
>> +       style="overflow:visible"
>> +       inkscape:isstock="true">
>> +      <path
>> +         inkscape:connector-curvature="0"
>> +         id="path4227-6"
>> +         d="M 0,0 5,-5 -12.5,0 5,5 Z"
>> +         style="fill:#000000;fill-opacity:1;fill-
>> rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
>> +         transform="matrix(-0.8,0,0,-0.8,-10,0)" />
>> +    </marker>
>> +    <marker
>> +       inkscape:stockid="Arrow1Lstart"
>> +       orient="auto"
>> +       refY="0"
>> +       refX="0"
>> +       id="marker10370-7"
>> +       style="overflow:visible"
>> +       inkscape:isstock="true">
>> +      <path
>> +         inkscape:connector-curvature="0"
>> +         id="path10372-9"
>> +         d="M 0,0 5,-5 -12.5,0 5,5 Z"
>> +         style="fill:#ff0000;fill-opacity:1;fill-
>> rule:evenodd;stroke:#ff0000;stroke-width:1.00000003pt;stroke-opacity:1"
>> +         transform="matrix(0.8,0,0,0.8,10,0)" />
>> +    </marker>
>> +    <marker
>> +       inkscape:isstock="true"
>> +       style="overflow:visible"
>> +       id="marker9757-2"
>> +       refX="0"
>> +       refY="0"
>> +       orient="auto"
>> +       inkscape:stockid="Arrow1Lend">
>> +      <path
>> +         transform="matrix(-0.8,0,0,-0.8,-10,0)"
>> +         style="fill:#ff0000;fill-opacity:1;fill-
>> rule:evenodd;stroke:#ff0000;stroke-width:1.00000003pt;stroke-opacity:1"
>> +         d="M 0,0 5,-5 -12.5,0 5,5 Z"
>> +         id="path9759-0"
>> +         inkscape:connector-curvature="0" />
>> +    </marker>
>> +    <marker
>> +       inkscape:stockid="Arrow1Lstart"
>> +       orient="auto"
>> +       refY="0"
>> +       refX="0"
>> +       id="Arrow1Lstart-9-2"
>> +       style="overflow:visible"
>> +       inkscape:isstock="true">
>> +      <path
>> +         inkscape:connector-curvature="0"
>> +         id="path4224-3-3"
>> +         d="M 0,0 5,-5 -12.5,0 5,5 Z"
>> +         style="fill:#000000;fill-opacity:1;fill-
>> rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
>> +         transform="matrix(0.8,0,0,0.8,10,0)" />
>> +    </marker>
>> +    <marker
>> +       inkscape:stockid="Arrow1Lend"
>> +       orient="auto"
>> +       refY="0"
>> +       refX="0"
>> +       id="Arrow1Lend-1-7"
>> +       style="overflow:visible"
>> +       inkscape:isstock="true">
>> +      <path
>> +         inkscape:connector-curvature="0"
>> +         id="path4227-27-5"
>> +         d="M 0,0 5,-5 -12.5,0 5,5 Z"
>> +         style="fill:#000000;fill-opacity:1;fill-
>> rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
>> +         transform="matrix(-0.8,0,0,-0.8,-10,0)" />
>> +    </marker>
>> +  </defs>
>> +  <sodipodi:namedview
>> +     id="base"
>> +     pagecolor="#ffffff"
>> +     bordercolor="#666666"
>> +     borderopacity="1.0"
>> +     inkscape:pageopacity="0.0"
>> +     inkscape:pageshadow="2"
>> +     inkscape:zoom="0.49497475"
>> +     inkscape:cx="206.7485"
>> +     inkscape:cy="227.93958"
>> +     inkscape:document-units="px"
>> +     inkscape:current-layer="layer1"
>> +     showgrid="false"
>> +     inkscape:object-nodes="true"
>> +     inkscape:window-width="1916"
>> +     inkscape:window-height="1040"
>> +     inkscape:window-x="0"
>> +     inkscape:window-y="38"
>> +     inkscape:window-maximized="0"
>> +     inkscape:snap-grids="true"
>> +     inkscape:snap-to-guides="true"
>> +     inkscape:snap-others="false"
>> +     inkscape:snap-nodes="false"
>> +     inkscape:snap-global="false" />
>> +  <metadata
>> +     id="metadata7">
>> +    <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></dc:title>
>> +      </cc:Work>
>> +    </rdf:RDF>
>> +  </metadata>
>> +  <g
>> +     inkscape:label="Layer 1"
>> +     inkscape:groupmode="layer"
>> +     id="layer1"
>> +     transform="translate(-5.3301459,-7.348317)">
>> +    <rect
>> +       style="fill:none;fill-opacity:1;stroke:#000000;stroke-
>> width:1.78969002;stroke-miterlimit:4;stroke-dasharray:none;stroke-
>> dashoffset:0;stroke-opacity:1"
>> +       id="rect4140"
>> +       width="434.38919"
>> +       height="75.295639"
>> +       x="21.691195"
>> +       y="404.59354" />
>> +    <text
>> +       xml:space="preserve"
>> +       style="font-style:normal;font-weight:normal;font-size:40px;line-
>> height:125%;font-family:sans-serif;letter-spacing:0px;word-
>> spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-
>> width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
>> +       x="421.47873"
>> +       y="501.3353"
>> +       id="text4142"><tspan
>> +         sodipodi:role="line"
>> +         id="tspan4144"
>> +         x="421.47873"
>> +         y="501.3353"
>> +         style="font-size:25px;line-height:125%">TE</tspan></text>
>> +    <rect
>> +       style="fill:none;fill-opacity:1;stroke:#000000;stroke-
>> width:1.46599996;stroke-miterlimit:4;stroke-dasharray:none;stroke-
>> dashoffset:0;stroke-opacity:1"
>> +       id="rect4146"
>> +       width="92.934036"
>> +       height="32.324883"
>> +       x="182.57764"
>> +       y="372.03574" />
>> +    <text
>> +       xml:space="preserve"
>> +       style="font-style:normal;font-weight:normal;font-size:40px;line-
>> height:125%;font-family:sans-serif;letter-spacing:0px;word-
>> spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-
>> width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
>> +       x="183.5878"
>> +       y="397.28958"
>> +       id="text4148"><tspan
>> +         sodipodi:role="line"
>> +         id="tspan4150"
>> +         x="183.5878"
>> +         y="397.28958"
>> +         style="font-size:25px">10G NIC</tspan></text>
>> +    <text
>> +       xml:space="preserve"
>> +       style="font-style:normal;font-weight:normal;font-size:40px;line-
>> height:125%;font-family:sans-serif;letter-spacing:0px;word-
>> spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-
>> width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
>> +       x="166.92024"
>> +       y="451.33276"
>> +       id="text4152"><tspan
>> +         sodipodi:role="line"
>> +         id="tspan4154"
>> +         x="166.92024"
>> +         y="451.33276">Moongen</tspan></text>
>> +    <rect
>> +       style="fill:none;fill-opacity:1;stroke:#000000;stroke-
>> width:1.39882457;stroke-miterlimit:4;stroke-dasharray:none;stroke-
>> dashoffset:0;stroke-opacity:1"
>> +       id="rect4156"
>> +       width="449.73071"
>> +       height="244.32167"
>> +       x="6.0295582"
>> +       y="29.046324" />
>> +    <text
>> +       xml:space="preserve"
>> +       style="font-style:normal;font-weight:normal;font-size:40px;line-
>> height:125%;font-family:sans-serif;letter-spacing:0px;word-
>> spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-
>> width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
>> +       x="405.31628"
>> +       y="25.048317"
>> +       id="text4158"><tspan
>> +         sodipodi:role="line"
>> +         id="tspan4160"
>> +         x="405.31628"
>> +         y="25.048317"
>> +         style="font-size:25px">DUT</tspan></text>
>> +    <rect
>> +       style="fill:none;fill-opacity:1;stroke:#000000;stroke-
>> width:1.14168489;stroke-miterlimit:4;stroke-dasharray:none;stroke-
>> dashoffset:0;stroke-opacity:1"
>> +       id="rect4162"
>> +       width="418.69415"
>> +       height="107.50462"
>> +       x="19.038134"
>> +       y="41.044758" />
>> +    <text
>> +       xml:space="preserve"
>> +       style="font-style:normal;font-weight:normal;font-size:40px;line-
>> height:125%;font-family:sans-serif;letter-spacing:0px;word-
>> spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-
>> width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
>> +       x="395.38812"
>> +       y="66.496857"
>> +       id="text4164"><tspan
>> +         sodipodi:role="line"
>> +         id="tspan4166"
>> +         x="395.38812"
>> +         y="66.496857"
>> +         style="font-size:25px">VM</tspan></text>
>> +    <rect
>> +       style="fill:none;fill-opacity:1;stroke:#000000;stroke-
>> width:1.46599996;stroke-miterlimit:4;stroke-dasharray:none;stroke-
>> dashoffset:0;stroke-opacity:1"
>> +       id="rect4146-3"
>> +       width="92.934036"
>> +       height="32.324883"
>> +       x="183.0827"
>> +       y="274.05093" />
>> +    <text
>> +       xml:space="preserve"
>> +       style="font-style:normal;font-weight:normal;font-size:40px;line-
>> height:125%;font-family:sans-serif;letter-spacing:0px;word-
>> spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-
>> width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
>> +       x="184.09286"
>> +       y="299.30475"
>> +       id="text4148-6"><tspan
>> +         sodipodi:role="line"
>> +         id="tspan4150-7"
>> +         x="184.09286"
>> +         y="299.30475"
>> +         style="font-size:25px">10G NIC</tspan></text>
>> +    <rect
>> +       style="fill:none;fill-opacity:1;stroke:#000000;stroke-
>> width:2.4804399;stroke-miterlimit:4;stroke-dasharray:none;stroke-
>> dashoffset:0;stroke-opacity:1"
>> +       id="rect4189"
>> +       width="398.00476"
>> +       height="65.451302"
>> +       x="26.901583"
>> +       y="82.647781" />
>> +    <text
>> +       xml:space="preserve"
>> +       style="font-style:normal;font-weight:normal;font-size:25px;line-
>> height:125%;font-family:sans-serif;letter-spacing:0px;word-
>> spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-
>> width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
>> +       x="30.683046"
>> +       y="108.31288"
>> +       id="text4191"><tspan
>> +         sodipodi:role="line"
>> +         id="tspan4193"
>> +         x="30.683046"
>> +         y="108.31288">TestPMD</tspan><tspan
>> +         sodipodi:role="line"
>> +         x="30.683046"
>> +         y="139.56288"
>> +         id="tspan10476">(macswap)</tspan></text>
>> +    <rect
>> +       style="fill:none;fill-opacity:1;stroke:#000000;stroke-
>> width:2.49124122;stroke-miterlimit:4;stroke-dasharray:none;stroke-
>> dashoffset:0;stroke-opacity:1"
>> +       id="rect4189-5"
>> +       width="397.22263"
>> +       height="66.152573"
>> +       x="29.743357"
>> +       y="207.6543" />
>> +    <text
>> +       xml:space="preserve"
>> +       style="font-style:normal;font-weight:normal;font-size:25px;line-
>> height:125%;font-family:sans-serif;letter-spacing:0px;word-
>> spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-
>> width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
>> +       x="42.720772"
>> +       y="231.14902"
>> +       id="text4191-3"><tspan
>> +         sodipodi:role="line"
>> +         id="tspan4193-5"
>> +         x="42.720772"
>> +         y="231.14902">TestPMD </tspan><tspan
>> +         sodipodi:role="line"
>> +         x="42.720772"
>> +         y="262.39902"
>> +         id="tspan9747">(io)</tspan></text>
>> +    <path
>> +       style="fill:#000000;fill-opacity:1;fill-
>> rule:evenodd;stroke:#000000;stroke-width:0.97838062px;stroke-
>> linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-
>> end:url(#Arrow1Lend)"
>> +       d="M 202.56669,371.44487 V 308.37034"
>> +       id="path4218"
>> +       inkscape:connector-curvature="0" />
>> +    <path
>> +       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-
>> width:0.97297633px;stroke-linecap:butt;stroke-linejoin:miter;stroke-
>> opacity:1;marker-start:url(#Arrow1Lstart)"
>> +       d="M 252.03098,369.63533 V 307.25568"
>> +       id="path4218-9"
>> +       inkscape:connector-curvature="0" />
>> +    <path
>> +       style="fill:#000000;fill-opacity:1;fill-
>> rule:evenodd;stroke:#000000;stroke-width:0.92982113px;stroke-
>> linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-
>> end:url(#Arrow1Lend-1)"
>> +       d="M 198.63811,207.44389 V 150.47507"
>> +       id="path4218-0"
>> +       inkscape:connector-curvature="0" />
>> +    <path
>> +       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-
>> width:0.95360273px;stroke-linecap:butt;stroke-linejoin:miter;stroke-
>> opacity:1;marker-start:url(#Arrow1Lstart-9)"
>> +       d="M 255.56859,206.9303 V 147.01008"
>> +       id="path4218-9-6"
>> +       inkscape:connector-curvature="0" />
>> +    <path
>> +       style="fill:none;fill-rule:evenodd;stroke:#ff0000;stroke-
>> width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-
>> miterlimit:4;stroke-dasharray:3, 1;stroke-dashoffset:0;stroke-
>> opacity:1;marker-end:url(#marker9757)"
>> +       d="M 199.50513,271.00921 V 207.3696"
>> +       id="path9749"
>> +       inkscape:connector-curvature="0" />
>> +    <path
>> +       style="fill:none;fill-rule:evenodd;stroke:#ff0000;stroke-
>> width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-
>> miterlimit:4;stroke-dasharray:3, 1;stroke-dashoffset:0;stroke-
>> opacity:1;marker-start:url(#marker10370)"
>> +       d="M 255.56859,270.56991 V 206.9303"
>> +       id="path9749-2"
>> +       inkscape:connector-curvature="0" />
>> +    <rect
>> +       style="fill:none;fill-opacity:1;stroke:#000000;stroke-
>> width:1.46599996;stroke-miterlimit:4;stroke-dasharray:none;stroke-
>> dashoffset:0;stroke-opacity:1"
>> +       id="rect4146-36"
>> +       width="92.934036"
>> +       height="32.324883"
>> +       x="304.05591"
>> +       y="372.52954" />
>> +    <text
>> +       xml:space="preserve"
>> +       style="font-style:normal;font-weight:normal;font-size:40px;line-
>> height:125%;font-family:sans-serif;letter-spacing:0px;word-
>> spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-
>> width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
>> +       x="305.06607"
>> +       y="397.78339"
>> +       id="text4148-7"><tspan
>> +         sodipodi:role="line"
>> +         id="tspan4150-5"
>> +         x="305.06607"
>> +         y="397.78339"
>> +         style="font-size:25px">10G NIC</tspan></text>
>> +    <rect
>> +       style="fill:none;fill-opacity:1;stroke:#000000;stroke-
>> width:1.46599996;stroke-miterlimit:4;stroke-dasharray:none;stroke-
>> dashoffset:0;stroke-opacity:1"
>> +       id="rect4146-3-3"
>> +       width="92.934036"
>> +       height="32.324883"
>> +       x="306.07623"
>> +       y="273.53461" />
>> +    <text
>> +       xml:space="preserve"
>> +       style="font-style:normal;font-weight:normal;font-size:40px;line-
>> height:125%;font-family:sans-serif;letter-spacing:0px;word-
>> spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-
>> width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
>> +       x="307.0864"
>> +       y="298.78842"
>> +       id="text4148-6-5"><tspan
>> +         sodipodi:role="line"
>> +         id="tspan4150-7-6"
>> +         x="307.0864"
>> +         y="298.78842"
>> +         style="font-size:25px">10G NIC</tspan></text>
>> +    <path
>> +       style="fill:#000000;fill-opacity:1;fill-
>> rule:evenodd;stroke:#000000;stroke-width:0.97838062px;stroke-
>> linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-
>> end:url(#Arrow1Lend-62)"
>> +       d="M 323.7504,370.24835 V 307.17382"
>> +       id="path4218-1"
>> +       inkscape:connector-curvature="0" />
>> +    <path
>> +       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-
>> width:0.97297633px;stroke-linecap:butt;stroke-linejoin:miter;stroke-
>> opacity:1;marker-start:url(#Arrow1Lstart-6)"
>> +       d="M 373.21469,368.43881 V 306.05916"
>> +       id="path4218-9-8"
>> +       inkscape:connector-curvature="0" />
>> +    <path
>> +       style="fill:#000000;fill-opacity:1;fill-
>> rule:evenodd;stroke:#000000;stroke-width:0.92982113px;stroke-
>> linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-
>> end:url(#Arrow1Lend-1-7)"
>> +       d="M 324.93036,207.24894 V 150.28012"
>> +       id="path4218-0-9"
>> +       inkscape:connector-curvature="0" />
>> +    <path
>> +       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-
>> width:0.95360273px;stroke-linecap:butt;stroke-linejoin:miter;stroke-
>> opacity:1;marker-start:url(#Arrow1Lstart-9-2)"
>> +       d="M 381.86084,206.73535 V 146.81513"
>> +       id="path4218-9-6-2"
>> +       inkscape:connector-curvature="0" />
>> +    <path
>> +       style="fill:none;fill-rule:evenodd;stroke:#ff0000;stroke-
>> width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-
>> miterlimit:4;stroke-dasharray:3, 1;stroke-dashoffset:0;stroke-
>> opacity:1;marker-end:url(#marker9757-2)"
>> +       d="M 325.79738,270.81426 V 207.17465"
>> +       id="path9749-28"
>> +       inkscape:connector-curvature="0" />
>> +    <path
>> +       style="fill:none;fill-rule:evenodd;stroke:#ff0000;stroke-
>> width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-
>> miterlimit:4;stroke-dasharray:3, 1;stroke-dashoffset:0;stroke-
>> opacity:1;marker-start:url(#marker10370-7)"
>> +       d="M 381.86084,270.37496 V 206.73535"
>> +       id="path9749-2-9"
>> +       inkscape:connector-curvature="0" />
>> +    <path
>> +       style="fill:none;fill-rule:evenodd;stroke:#ff0000;stroke-
>> width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-
>> miterlimit:4;stroke-dasharray:2, 1;stroke-dashoffset:0;stroke-
>> opacity:1;marker-end:url(#marker4642)"
>> +       d="M 198.57143,148.79077 V 95.93363 h 182.85714 v 50"
>> +       id="path3748"
>> +       inkscape:connector-curvature="0" />
>> +    <path
>> +       style="fill:none;fill-rule:evenodd;stroke:#ff0000;stroke-
>> width:1.01005316;stroke-linecap:butt;stroke-linejoin:miter;stroke-
>> miterlimit:4;stroke-dasharray:2.02010632, 1.01005316;stroke-
>> dashoffset:0;stroke-opacity:1;marker-end:url(#marker4760)"
>> +       d="m 325.70774,148.78714 v -32.84999 h -70.7012 v 30.70761"
>> +       id="path4634"
>> +       inkscape:connector-curvature="0" />
>> +  </g>
>> +</svg>
>> diff --git a/doc/guides/howto/index.rst b/doc/guides/howto/index.rst index
>> 5575b27..712a9f3 100644
>> --- a/doc/guides/howto/index.rst
>> +++ b/doc/guides/howto/index.rst
>> @@ -38,3 +38,4 @@ HowTo Guides
>>      lm_bond_virtio_sriov
>>      lm_virtio_vhost_user
>>      flow_bifurcation
>> +    pvp_reference_benchmark
>> diff --git a/doc/guides/howto/pvp_reference_benchmark.rst
>> b/doc/guides/howto/pvp_reference_benchmark.rst
>> new file mode 100644
>> index 0000000..c5bbd32
>> --- /dev/null
>> +++ b/doc/guides/howto/pvp_reference_benchmark.rst
>> @@ -0,0 +1,395 @@
>> +..  BSD LICENSE
>> +    Copyright(c) 2016 Red Hat, Inc. 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.
>> +
>> +
>> +PVP reference benchmark setup using testpmd
>> +===========================================
>> +
>> +This guide lists the steps required to setup a PVP benchmark using
>> +testpmd as a simple forwarder between NICs and Vhost interfaces. The
>> +goal of this setup is to have a reference PVP benchmark without using
>> +external vSwitches (OVS, VPP, ...) to make it easier to obtain
>> +reproducible results and to facilitate continuous integration testing.
>> +
>> +The guide covers two ways of launching the VM, either by directly
>> +calling the QEMU command line, or by relying on libvirt. It has been
>> +tested with DPDK
>> +v16.11 using RHEL7 for both host and guest.
>> +
>> +
>> +Setup overview
>> +--------------
>> +
>> +.. _figure_pvp_2nics:
>> +
>> +.. figure:: img/pvp_2nics.*
>> +
>> +   PVP setup using 2 NICs
>> +
>> +In this diagram, each red arrow represents one logical core. This
>> +use-case requires 6 dedicated logical cores. A forwarding configuration
>> +with a single NIC is also possible, requiring 3 logical cores.
>> +
>> +
>> +Host setup
>> +----------
>> +
>> +In this setup, we isolate 6 cores (from CPU2 to CPU7) on the same NUMA
>> +node. Two cores are assigned to the VM vCPUs running testpmd and four
>> +are assigned to testpmd on the host.
>> +
>> +
>> +Host tuning
>> +~~~~~~~~~~~
>> +
>> +#. On BIOS, disable turbo-boost and hyper-threads.
>> +
>> +#. Append these options to Kernel command line:
>> +
>> +   .. code-block:: console
>> +
>> +      intel_pstate=disable mce=ignore_ce default_hugepagesz=1G
>> + hugepagesz=1G hugepages=6 isolcpus=2-7 rcu_nocbs=2-7 nohz_full=2-7
>> + iommu=pt intel_iommu=on
>> +
>> +#. Disable hyper-threads at runtime if necessary or if BIOS is not
>> accessible:
>> +
>> +   .. code-block:: console
>> +
>> +      cat /sys/devices/system/cpu/cpu*[0-9]/topology/thread_siblings_list
>> \
>> +          | sort | uniq \
>> +          | awk -F, '{system("echo 0 >
>> /sys/devices/system/cpu/cpu"$2"/online")}'
>> +
>> +#. Disable NMIs:
>> +
>> +   .. code-block:: console
>> +
>> +      echo 0 > /proc/sys/kernel/nmi_watchdog
>> +
>> +#. Exclude isolated CPUs from the writeback cpumask:
>> +
>> +   .. code-block:: console
>> +
>> +      echo ffffff03 > /sys/bus/workqueue/devices/writeback/cpumask
>> +
>> +#. Isolate CPUs from IRQs:
>> +
>> +   .. code-block:: console
>> +
>> +      clear_mask=0xfc #Isolate CPU2 to CPU7 from IRQs
>> +      for i in /proc/irq/*/smp_affinity
>> +      do
>> +        echo "obase=16;$(( 0x$(cat $i) & ~$clear_mask ))" | bc > $i
>> +      done
>> +
>> +
>> +Qemu build
>> +~~~~~~~~~~
>> +
>> +Build Qemu:
>> +
>> +    .. code-block:: console
>> +
>> +       git clone git://git.qemu.org/qemu.git
>> +       cd qemu
>> +       mkdir bin
>> +       cd bin
>> +       ../configure --target-list=x86_64-softmmu
>> +
>> +
>> +DPDK build
>> +~~~~~~~~~~
>> +
>> +Build DPDK:
>> +
>> +   .. code-block:: console
>> +
>> +      git clone git://dpdk.org/dpdk
>> +      cd dpdk
>> +      export RTE_SDK=$PWD
>> +      make install T=x86_64-native-linuxapp-gcc DESTDIR=install
>> +
>> +
>> +Testpmd launch
>> +~~~~~~~~~~~~~~
>> +
>> +#. Assign NICs to DPDK:
>> +
>> +   .. code-block:: console
>> +
>> +      modprobe vfio-pci
>> +      $RTE_SDK/install/sbin/dpdk-devbind -b vfio-pci 0000:11:00.0
>> + 0000:11:00.1
>> +
>> +   .. Note::
>> +
>> +      The Sandy Bridge family seems to have some IOMMU limitations giving
>> poor
>> +      performance results. To achieve good performance on these machines
>> +      consider using UIO instead.
>> +
>> +#. Launch the testpmd application:
>> +
>> +   .. code-block:: console
>> +
>> +      $RTE_SDK/install/bin/testpmd -l 0,2,3,4,5 --socket-mem=1024 -n 4 \
>> +          --vdev 'net_vhost0,iface=/tmp/vhost-user1' \
>> +          --vdev 'net_vhost1,iface=/tmp/vhost-user2' -- \
>> +          --portmask=f --disable-hw-vlan -i --rxq=1 --txq=1
>> +          --nb-cores=4 --forward-mode=io
>> +
>> +With this command, isolated CPUs 2 to 5 will be used as lcores for PMD
>> threads.
>> +
>> +#. In testpmd interactive mode, set the portlist to obtain the correct
>> port
>> +   chaining:
>> +
>> +   .. code-block:: console
>> +
>> +      set portlist 0,2,1,3
>> +      start
>> +
>> +
>> +VM launch
>> +~~~~~~~~~
>> +
>> +The VM may be launched either by calling QEMU directly, or by using
>> libvirt.
>> +
>> +#. Qemu way:
>> +
>> +Launch QEMU with two Virtio-net devices paired to the vhost-user
>> +sockets created by testpmd. Below example uses default Virtio-net
>> +options, but options may be specified, for example to disable mergeable
>> +buffers or indirect descriptors.
>> +
>> +   .. code-block:: console
>> +
>> +      <QEMU path>/bin/x86_64-softmmu/qemu-system-x86_64 \
>> +          -enable-kvm -cpu host -m 3072 -smp 3 \
>> +          -chardev socket,id=char0,path=/tmp/vhost-user1 \
>> +          -netdev type=vhost-user,id=mynet1,chardev=char0,vhostforce \
>> +          -device virtio-net-
>> pci,netdev=mynet1,mac=52:54:00:02:d9:01,addr=0x10 \
>> +          -chardev socket,id=char1,path=/tmp/vhost-user2 \
>> +          -netdev type=vhost-user,id=mynet2,chardev=char1,vhostforce \
>> +          -device virtio-net-
>> pci,netdev=mynet2,mac=52:54:00:02:d9:02,addr=0x11 \
>> +          -object memory-backend-file,id=mem,size=3072M,mem-
>> path=/dev/hugepages,share=on \
>> +          -numa node,memdev=mem -mem-prealloc \
>> +          -net user,hostfwd=tcp::1002$1-:22 -net nic \
>> +          -qmp unix:/tmp/qmp.socket,server,nowait \
>> +          -monitor stdio <vm_image>.qcow2
>> +
>> +You can use this `qmp-vcpu-pin
>> +<https://patchwork.kernel.org/patch/9361617/>`_
>> +script to pin vCPUs.
>> +
>> +It can be used as follows, for example to pin 3 vCPUs to CPUs 1, 6 and
>> +7, where isolated CPUs 6 and 7 will be used as lcores for Virtio PMDs:
>> +
>> +   .. code-block:: console
>> +
>> +      export PYTHONPATH=$PYTHONPATH:<QEMU path>/scripts/qmp
>> +      ./qmp-vcpu-pin -s /tmp/qmp.socket 1 6 7
>> +
>> +#. Libvirt way:
>> +
>> +Some initial steps are required for libvirt to be able to connect to
>> +testpmd's sockets.
>> +
>> +First, SELinux policy needs to be set to permissive, since testpmd is
>> +generally run as root (note, as reboot is required):
>> +
>> +   .. code-block:: console
>> +
>> +      cat /etc/selinux/config
>> +
>> +      # This file controls the state of SELinux on the system.
>> +      # SELINUX= can take one of these three values:
>> +      #     enforcing  - SELinux security policy is enforced.
>> +      #     permissive - SELinux prints warnings instead of enforcing.
>> +      #     disabled   - No SELinux policy is loaded.
>> +      SELINUX=permissive
>> +
>> +      # SELINUXTYPE= can take one of three two values:
>> +      #     targeted - Targeted processes are protected,
>> +      #     minimum  - Modification of targeted policy.
>> +      #                Only selected processes are protected.
>> +      #     mls      - Multi Level Security protection.
>> +      SELINUXTYPE=targeted
>> +
>> +
>> +Also, Qemu needs to be run as root, which has to be specified in
>> +``/etc/libvirt/qemu.conf``:
>> +
>> +   .. code-block:: console
>> +
>> +      user = "root"
>> +
>> +Once the domain created, the following snippet is an extract of he most
>> +important information (hugepages, vCPU pinning, Virtio PCI devices):
>> +
>> +   .. code-block:: xml
>> +
>> +      <domain type='kvm'>
>> +        <memory unit='KiB'>3145728</memory>
>> +        <currentMemory unit='KiB'>3145728</currentMemory>
>> +        <memoryBacking>
>> +          <hugepages>
>> +            <page size='1048576' unit='KiB' nodeset='0'/>
>> +          </hugepages>
>> +          <locked/>
>> +        </memoryBacking>
>> +        <vcpu placement='static'>3</vcpu>
>> +        <cputune>
>> +          <vcpupin vcpu='0' cpuset='1'/>
>> +          <vcpupin vcpu='1' cpuset='6'/>
>> +          <vcpupin vcpu='2' cpuset='7'/>
>> +          <emulatorpin cpuset='0'/>
>> +        </cputune>
>> +        <numatune>
>> +          <memory mode='strict' nodeset='0'/>
>> +        </numatune>
>> +        <os>
>> +          <type arch='x86_64' machine='pc-i440fx-rhel7.0.0'>hvm</type>
>> +          <boot dev='hd'/>
>> +        </os>
>> +        <cpu mode='host-passthrough'>
>> +          <topology sockets='1' cores='3' threads='1'/>
>> +          <numa>
>> +            <cell id='0' cpus='0-2' memory='3145728' unit='KiB'
>> memAccess='shared'/>
>> +          </numa>
>> +        </cpu>
>> +        <devices>
>> +          <interface type='vhostuser'>
>> +            <mac address='56:48:4f:53:54:01'/>
>> +            <source type='unix' path='/tmp/vhost-user1' mode='client'/>
>> +            <model type='virtio'/>
>> +            <driver name='vhost' rx_queue_size='256' />
>> +            <address type='pci' domain='0x0000' bus='0x00' slot='0x10'
>> function='0x0'/>
>> +          </interface>
>> +          <interface type='vhostuser'>
>> +            <mac address='56:48:4f:53:54:02'/>
>> +            <source type='unix' path='/tmp/vhost-user2' mode='client'/>
>> +            <model type='virtio'/>
>> +            <driver name='vhost' rx_queue_size='256' />
>> +            <address type='pci' domain='0x0000' bus='0x00' slot='0x11'
>> function='0x0'/>
>> +          </interface>
>> +        </devices>
>> +      </domain>
>> +
>> +
>> +Guest setup
>> +-----------
>> +
>> +
>> +Guest tuning
>> +~~~~~~~~~~~~
>> +
>> +#. Append these options to the Kernel command line:
>> +
>> +   .. code-block:: console
>> +
>> +      default_hugepagesz=1G hugepagesz=1G hugepages=1 intel_iommu=on
>> + iommu=pt isolcpus=1,2 rcu_nocbs=1,2 nohz_full=1,2
>> +
>> +#. Disable NMIs:
>> +
>> +   .. code-block:: console
>> +
>> +      echo 0 > /proc/sys/kernel/nmi_watchdog
>> +
>> +#. Exclude isolated CPU1 and CPU2 from the writeback cpumask:
>> +
>> +   .. code-block:: console
>> +
>> +      echo 1 > /sys/bus/workqueue/devices/writeback/cpumask
>> +
>> +#. Isolate CPUs from IRQs:
>> +
>> +   .. code-block:: console
>> +
>> +      clear_mask=0x6 #Isolate CPU1 and CPU2 from IRQs
>> +      for i in /proc/irq/*/smp_affinity
>> +      do
>> +        echo "obase=16;$(( 0x$(cat $i) & ~$clear_mask ))" | bc > $i
>> +      done
>> +
>> +
>> +DPDK build
>> +~~~~~~~~~~
>> +
>> +Build DPDK:
>> +
>> +   .. code-block:: console
>> +
>> +      git clone git://dpdk.org/dpdk
>> +      cd dpdk
>> +      export RTE_SDK=$PWD
>> +      make install T=x86_64-native-linuxapp-gcc DESTDIR=install
>> +
>> +
>> +Testpmd launch
>> +~~~~~~~~~~~~~~
>> +
>> +Probe vfio module without iommu:
>> +
>> +   .. code-block:: console
>> +
>> +      modprobe -r vfio_iommu_type1
>> +      modprobe -r vfio
>> +      modprobe  vfio enable_unsafe_noiommu_mode=1
>> +      cat /sys/module/vfio/parameters/enable_unsafe_noiommu_mode
>> +      modprobe vfio-pci
>> +
>> +Bind the virtio-net devices to DPDK:
>> +
>> +   .. code-block:: console
>> +
>> +      $RTE_SDK/tools/dpdk-devbind.py -b vfio-pci 0000:00:10.0
>> + 0000:00:11.0
>> +
>> +Start testpmd:
>> +
>> +   .. code-block:: console
>> +
>> +      $RTE_SDK/install/bin/testpmd -l 0,1,2 --socket-mem 1024 -n 4 \
>> +          --proc-type auto --file-prefix pg -- \
>> +          --portmask=3 --forward-mode=macswap --port-topology=chained \
>> +          --disable-hw-vlan --disable-rss -i --rxq=1 --txq=1 \
>> +          --rxd=256 --txd=256 --nb-cores=2 --auto-start
>> +
>> +Results template
>> +----------------
>> +
>> +Below template should be used when sharing results:
>> +
>> +   .. code-block:: none
>> +
>> +      Traffic Generator: <Test equipment (e.g. IXIA, Moongen, ...)>
>> +      Acceptable Loss: <n>%
>> +      Validation run time: <n>min
>> +      Host DPDK version/commit: <version, SHA-1>
>> +      Guest DPDK version/commit: <version, SHA-1>
>> +      Patches applied: <link to patchwork>
>> +      QEMU version/commit: <version>
>> +      Virtio features: <features (e.g. mrg_rxbuf='off', leave empty if
>> default)>
>> +      CPU: <CPU model>, <CPU frequency>
>> +      NIC: <NIC model>
>> +      Result: <n> Mpps
>> --
>> 2.9.3
>

^ permalink raw reply

* Re: [PATCH v2 1/8] eal: define container_of macro
From: Shreyansh Jain @ 2016-12-09  7:36 UTC (permalink / raw)
  To: Jan Blunck; +Cc: dev, david.marchand, Jan Viktorin
In-Reply-To: <df2a131d-dae7-abc9-bbf4-0ae36caafe5e@nxp.com>

On Thursday 08 December 2016 12:31 PM, Shreyansh Jain wrote:
> Hello Jan,
>
> Need your help in resolving the checkpatch issue for this patch.
> I have used this in EAL Bus series [1].
>
> [1] http://dpdk.org/ml/archives/dev/2016-December/051350.html
>
> On Monday 21 November 2016 10:25 PM, Jan Blunck wrote:
>> This macro is based on Jan Viktorin's original patch but also checks the
>> type of the passed pointer against the type of the member.
>>
>> Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
>> Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
>> [jblunck@infradead.org: add type checking and __extension__]
>> Signed-off-by: Jan Blunck <jblunck@infradead.org>
>> ---
>>  lib/librte_eal/common/include/rte_common.h | 20 ++++++++++++++++++++
>>  1 file changed, 20 insertions(+)
>>
>> diff --git a/lib/librte_eal/common/include/rte_common.h
>> b/lib/librte_eal/common/include/rte_common.h
>> index db5ac91..8dda3e2 100644
>> --- a/lib/librte_eal/common/include/rte_common.h
>> +++ b/lib/librte_eal/common/include/rte_common.h
>> @@ -331,6 +331,26 @@ rte_bsf32(uint32_t v)
>>  #define offsetof(TYPE, MEMBER)  __builtin_offsetof (TYPE, MEMBER)
>>  #endif
>>
>> +/**
>> + * Return pointer to the wrapping struct instance.
>> + *
>> + * Example:
>> + *
>> + *  struct wrapper {
>> + *      ...
>> + *      struct child c;
>> + *      ...
>> + *  };
>> + *
>> + *  struct child *x = obtain(...);
>> + *  struct wrapper *w = container_of(x, struct wrapper, c);
>> + */
>> +#ifndef container_of
>> +#define container_of(ptr, type, member)    __extension__ ({        \
>> +            typeof(((type *)0)->member) *_ptr = (ptr);    \
>> +            (type *)(((char *)_ptr) - offsetof(type, member)); })
>> +#endif
>
> (I think there was discussion in ML about this but where, I couldn't
> find it).
>
> Above code snippet doesn't go down well with the checkpatch script. It
> reports:
>
> ---->8----
> ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in
> parentheses
> #40: FILE: lib/librte_eal/common/include/rte_common.h:349:
> +#define container_of(ptr, type, member)        __extension__ ({        \
> +                       typeof(((type *)0)->member) *_ptr = (ptr);      \
> +                       (type *)(((char *)_ptr) - offsetof(type,
> member)); })
>
> ERROR:SPACING: need consistent spacing around '*' (ctx:WxV)
> #41: FILE: lib/librte_eal/common/include/rte_common.h:350:
> +                       typeof(((type *)0)->member) *_ptr = (ptr);      \
> ---->8----
>
> Second error is primarily because of '*<space>_ptr' rather than '*_ptr'.
>
> Is do{ ... }while(0) the fix for the first one?
>
> This:
>
> ---->8----
> #ifndef container_of
> #define container_of(ptr, type, member) do {                 \
>            __extension__                                     \
>            typeof(((type *)0)->member) * _ptr = (ptr);       \
>            (type *)(((char *)_ptr) - offsetof(type, member));\
>            } while (0)
> #endif
> ---->8----
>
> Seems to be ok with checkpatch. Do you see any technical/compiler issue
> with this?

My bad.
obviously a 'do{ .. } while(0)' will not work in case of assignment.

Any other hints as to how to remove this checkpatch issue?

>
>> +
>>  #define _RTE_STR(x) #x
>>  /** Take a macro value and get a string version of it */
>>  #define RTE_STR(x) _RTE_STR(x)
>>
>
> -
> Shreyansh
>
>
>

^ permalink raw reply

* IGB_UIO: PCI Resources Management
From: Gregory Etelson @ 2016-12-09  8:54 UTC (permalink / raw)
  To: dev, users

Hello,

IGB_UIO driver does not close port PCI activities after DPDK process exits.
DPDK API provides rte_eth_dev_close() to manage port PCI,
but it can be skipped if process receives SIGKILL signal
The patches below provide IGB_UIO release callback and IXGBEVF release function
With the patches, each time DPDK process terminates,
UIO release callback will trigger port PCI close.
On the down side, patched IGB_UIO can be bound to a single adapter type

Regards,
Gregory



diff --git a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
index df41e45..97b8501 100644
--- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
+++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
@@ -170,6 +170,16 @@ igbuio_pci_irqhandler(int irq, struct uio_info *info)
        return IRQ_HANDLED;
 }
 
+static int
+igbuio_pci_release(struct uio_info *info, struct inode *inode)
+{
+       extern int ixgbevf_uio_release(struct pci_dev *pdev, u8 __iomem *hw_addr);
+       int ret;
+       struct rte_uio_pci_dev *udev = info->priv;
+       ret = ixgbevf_uio_release(udev->pdev, info->mem[0].internal_addr);
+       return 0;
+}
+
 #ifdef CONFIG_XEN_DOM0
 static int
 igbuio_dom0_mmap_phys(struct uio_info *info, struct vm_area_struct *vma)
@@ -368,6 +378,7 @@ igbuio_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
        udev->info.version = "0.1";
        udev->info.handler = igbuio_pci_irqhandler;
        udev->info.irqcontrol = igbuio_pci_irqcontrol;
+       udev->info.release = igbuio_pci_release;
 #ifdef CONFIG_XEN_DOM0
        /* check if the driver run on Xen Dom0 */
        if (xen_initial_domain())





diff --git a/src/ixgbevf_main.c b/src/ixgbevf_main.c
index c5a922f..b96d9f0 100644
--- a/src/ixgbevf_main.c
+++ b/src/ixgbevf_main.c
@@ -3002,6 +3002,39 @@ static void ixgbevf_clear_interrupt_scheme(struct ixgbevf_adapter *adapter)
        ixgbevf_reset_interrupt_capability(adapter);
 }
 
+int ixgbevf_uio_release(struct pci_dev *pdev, u8 __iomem *hw_addr)
+{
+       int err;
+       struct ixgbe_hw __hw;
+       struct ixgbe_hw *hw = &__hw;
+
+       if (!hw_addr) {
+               dev_warn(&pdev->dev, "ixgbevf_uio_release: no HW addr. Bailing out\n");
+       }
+
+       memset(hw, 0, sizeof(*hw));
+       hw->hw_addr = hw_addr;
+
+       /* PCI config space info */
+       hw->vendor_id = pdev->vendor;
+       hw->device_id = pdev->device;
+       pci_read_config_byte(pdev, PCI_REVISION_ID, &hw->revision_id);
+       hw->subsystem_vendor_id = pdev->subsystem_vendor;
+       hw->subsystem_device_id = pdev->subsystem_device;
+
+       ixgbe_init_ops_vf(hw);
+       hw->mbx.ops.init_params(hw);
+
+       /* assume legacy case in which PF would only give VF 2 queues */
+       hw->mac.max_tx_queues = 2;
+       hw->mac.max_rx_queues = 2;
+
+       err = hw->mac.ops.stop_adapter(hw);
+       dev_info(&pdev->dev, "ixgbevf_uio_release: UIO adapter stopped\n");
+       return err;
+}
+EXPORT_SYMBOL(ixgbevf_uio_release);
+
 /**
  * ixgbevf_sw_init - Initialize general software structures
  * (struct ixgbevf_adapter)

^ permalink raw reply related

* Re: [RFC] ethdev: abstraction layer for QoS hierarchical scheduler
From: Alan Robertson @ 2016-12-09  9:28 UTC (permalink / raw)
  To: Dumitrescu, Cristian; +Cc: dev@dpdk.org, Thomas Monjalon
In-Reply-To: <3EB4FA525960D640B5BDFFD6A3D8912652711C93@IRSMSX108.ger.corp.intel.com>

Hi Cristian,

No, it'll be done as a completely separate scheduling mechanism.  We'd allocate a much smaller
footprint equivalent to a pipe, TCs and queues.   This structure would be completely independent.
It would be up to the calling code to allocate, track and free it so it could be associated with any
target.  The equivalent of the enqueue and dequeue functions would be called wherever it
was required in the data path.  So if we look at an encrypted tunnel:

Ip forward -> qos enq/qos deq -> encrypt -> port forward (possibly qos again at port)

So each structure would work independently with the assumption that it's called frequently
enough to keep the state machine ticking over.  Pretty much as we do for a PMD scheduler.

Note that if we run the features in the above order encrypted frames aren't dropped by the
Qos enqueue.  Since encryption is probably the most expensive processing done on a packet it
should give a big performance gain.

Thanks,
Alan.

-----Original Message-----
From: Dumitrescu, Cristian [mailto:cristian.dumitrescu@intel.com] 
Sent: Thursday, December 08, 2016 5:18 PM
To: Alan Robertson
Cc: dev@dpdk.org; Thomas Monjalon
Subject: RE: [dpdk-dev] [RFC] ethdev: abstraction layer for QoS hierarchical scheduler

> Hi Cristian,
> 
> The way qos works just now should be feasible for dynamic targets.   That is
> similar functions
> to rte_sched_port_enqueue() and rte_sched_port_dequeue() would be 
> called.  The first to enqueue the mbufs onto the queues the second to 
> dequeue.  The qos structures and scheduler don't need to be as 
> functionally rich though.  I would have thought a simple pipe with 
> child nodes should suffice for most.  That would allow each 
> tunnel/session to be shaped and the queueing and drop logic inherited 
> from what is there just now.
> 
> Thanks,
> Alan.

Hi Alan,

So just to make sure I get this right: you suggest that tunnels/sessions could simply be mapped as one of the layers under the port hierarchy?

Thanks,
Cristian

^ permalink raw reply

* Re: [PATCH] nfp: add doc about supported features
From: Alejandro Lucero @ 2016-12-09 10:00 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Mcnamara, John, dev@dpdk.org
In-Reply-To: <03ef24cd-9ef6-066c-ea9c-6ee10a480d70@intel.com>

That's fine.

Thank you

On Tue, Dec 6, 2016 at 4:01 PM, Ferruh Yigit <ferruh.yigit@intel.com> wrote:

> On 12/6/2016 2:51 PM, Alejandro Lucero wrote:
> > Then I guess I should send another version of this patch.
>
> I can also update the patch while applying, if you agree with following
> content (simply just all =N removed):
>
>  [Features]
> +SR-IOV               = Y
> +Link status          = Y
> +Link status event    = Y
> +Queue start/stop     = Y
> +MTU update           = Y
> +Jumbo frame          = Y
> +RSS hash             = Y
> +RSS key update       = Y
> +RSS reta update      = Y
> +Flow control         = Y
> +VLAN offload         = Y
> +L3 checksum offload  = Y
> +L4 checksum offload  = Y
> +Promiscuous mode     = Y
> +Basic stats          = Y
> +Stats per queue      = Y
> +Linux UIO            = Y
> +Linux VFIO           = Y
> +x86-64               = Y
> +Usage doc            = Y
>
>
>

^ permalink raw reply

* Re: [PATCH v3] nfp: report link speed using hardware info
From: Alejandro Lucero @ 2016-12-09 10:08 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dev
In-Reply-To: <b20b9ca4-7cc0-cff7-a5eb-709c86cfd889@intel.com>

On Tue, Dec 6, 2016 at 11:57 AM, Ferruh Yigit <ferruh.yigit@intel.com>
wrote:

> On 12/2/2016 9:05 AM, Alejandro Lucero wrote:
> > Previous reported speed was hardcoded.
> >
> > v3: remove unsed macro
> > v2: using RTE_DIM instead of own macro
> >
> > Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
> > ---
> >  drivers/net/nfp/nfp_net.c | 28 ++++++++++++++++++++++++++--
> >  1 file changed, 26 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
> > index c6b1587..24f3164 100644
> > --- a/drivers/net/nfp/nfp_net.c
> > +++ b/drivers/net/nfp/nfp_net.c
> > @@ -816,6 +816,17 @@ static void nfp_net_read_mac(struct nfp_net_hw *hw)
> >       struct rte_eth_link link, old;
> >       uint32_t nn_link_status;
> >
> > +     static const uint32_t ls_to_ethtool[] = {
> > +             [NFP_NET_CFG_STS_LINK_RATE_UNSUPPORTED] =
> ETH_SPEED_NUM_NONE,
> > +             [NFP_NET_CFG_STS_LINK_RATE_UNKNOWN]     =
> ETH_SPEED_NUM_NONE,
> > +             [NFP_NET_CFG_STS_LINK_RATE_1G]          = ETH_SPEED_NUM_1G,
> > +             [NFP_NET_CFG_STS_LINK_RATE_10G]         =
> ETH_SPEED_NUM_10G,
> > +             [NFP_NET_CFG_STS_LINK_RATE_25G]         =
> ETH_SPEED_NUM_25G,
> > +             [NFP_NET_CFG_STS_LINK_RATE_40G]         =
> ETH_SPEED_NUM_40G,
> > +             [NFP_NET_CFG_STS_LINK_RATE_50G]         =
> ETH_SPEED_NUM_50G,
> > +             [NFP_NET_CFG_STS_LINK_RATE_100G]        =
> ETH_SPEED_NUM_100G,
> > +     };
> > +
> >       PMD_DRV_LOG(DEBUG, "Link update\n");
> >
> >       hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> > @@ -831,8 +842,21 @@ static void nfp_net_read_mac(struct nfp_net_hw *hw)
> >               link.link_status = ETH_LINK_UP;
> >
> >       link.link_duplex = ETH_LINK_FULL_DUPLEX;
> > -     /* Other cards can limit the tx and rx rate per VF */
> > -     link.link_speed = ETH_SPEED_NUM_40G;
> > +
> > +     nn_link_status = (nn_link_status >> NFP_NET_CFG_STS_LINK_RATE_SHIFT)
> &
> > +                      NFP_NET_CFG_STS_LINK_RATE_MASK;
> > +
> > +     if ((NFD_CFG_MAJOR_VERSION_of(hw->ver) < 4) ||
> > +         ((NFD_CFG_MINOR_VERSION_of(hw->ver) == 4) &&
> > +         (NFD_CFG_MINOR_VERSION_of(hw->ver) == 0)))
> > +             link.link_speed = ETH_SPEED_NUM_40G;
>
> Same comment from previous review:
>
> For specific firmware version, speed is still hardcoded to 40G, can you
> please mention from this and if possible its reason in commit log?
>
>
Well, we have old firmware still around and we need to avoid reading this
info from hardware if not supported.
But I guess I could be a more chatty about this in the commit log. I will
send another version.


> > +     else {
> > +             if (nn_link_status == NFP_NET_CFG_STS_LINK_RATE_UNKNOWN ||
>
> Again from previous review:
>
> > This is for checking any wrong value from firmware/hardware.
>
> I see, but removing this check will not change the logic, else branch is
> taken and again same value set.
>
>
OK. I think I can remove the first part of the if clause, because it is
implicit in the second part.
I guess this is what you really meant, and not just to leave the else
statement (without the else, of course). am I right?


> Still if you deliberately prefer to keep it, that is OK.
>
> > +                 nn_link_status >= RTE_DIM(ls_to_ethtool))
> > +                     link.link_speed = ETH_SPEED_NUM_NONE;
> > +             else
> > +                     link.link_speed = ls_to_ethtool[nn_link_status];
> > +     }
> >
> >       if (old.link_status != link.link_status) {
> >               nfp_net_dev_atomic_write_link_status(dev, &link);
> >
>
>

^ permalink raw reply

* Re: [PATCH v3] nfp: report link speed using hardware info
From: Ferruh Yigit @ 2016-12-09 10:11 UTC (permalink / raw)
  To: Alejandro Lucero; +Cc: dev
In-Reply-To: <CAD+H991QzxZHu282eZG9khd6DXo90ZbpfsALarJyzUr-1V=7ag@mail.gmail.com>

On 12/9/2016 10:08 AM, Alejandro Lucero wrote:
> 
> 
> On Tue, Dec 6, 2016 at 11:57 AM, Ferruh Yigit <ferruh.yigit@intel.com
> <mailto:ferruh.yigit@intel.com>> wrote:
> 
>     On 12/2/2016 9:05 AM, Alejandro Lucero wrote:
>     > Previous reported speed was hardcoded.
>     >
>     > v3: remove unsed macro
>     > v2: using RTE_DIM instead of own macro
>     >
>     > Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com
>     <mailto:alejandro.lucero@netronome.com>>
>     > ---
>     >  drivers/net/nfp/nfp_net.c | 28 ++++++++++++++++++++++++++--
>     >  1 file changed, 26 insertions(+), 2 deletions(-)
>     >
>     > diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
>     > index c6b1587..24f3164 100644
>     > --- a/drivers/net/nfp/nfp_net.c
>     > +++ b/drivers/net/nfp/nfp_net.c
>     > @@ -816,6 +816,17 @@ static void nfp_net_read_mac(struct
>     nfp_net_hw *hw)
>     >       struct rte_eth_link link, old;
>     >       uint32_t nn_link_status;
>     >
>     > +     static const uint32_t ls_to_ethtool[] = {
>     > +             [NFP_NET_CFG_STS_LINK_RATE_UNSUPPORTED] =
>     ETH_SPEED_NUM_NONE,
>     > +             [NFP_NET_CFG_STS_LINK_RATE_UNKNOWN]     =
>     ETH_SPEED_NUM_NONE,
>     > +             [NFP_NET_CFG_STS_LINK_RATE_1G]          =
>     ETH_SPEED_NUM_1G,
>     > +             [NFP_NET_CFG_STS_LINK_RATE_10G]         =
>     ETH_SPEED_NUM_10G,
>     > +             [NFP_NET_CFG_STS_LINK_RATE_25G]         =
>     ETH_SPEED_NUM_25G,
>     > +             [NFP_NET_CFG_STS_LINK_RATE_40G]         =
>     ETH_SPEED_NUM_40G,
>     > +             [NFP_NET_CFG_STS_LINK_RATE_50G]         =
>     ETH_SPEED_NUM_50G,
>     > +             [NFP_NET_CFG_STS_LINK_RATE_100G]        =
>     ETH_SPEED_NUM_100G,
>     > +     };
>     > +
>     >       PMD_DRV_LOG(DEBUG, "Link update\n");
>     >
>     >       hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private);
>     > @@ -831,8 +842,21 @@ static void nfp_net_read_mac(struct
>     nfp_net_hw *hw)
>     >               link.link_status = ETH_LINK_UP;
>     >
>     >       link.link_duplex = ETH_LINK_FULL_DUPLEX;
>     > -     /* Other cards can limit the tx and rx rate per VF */
>     > -     link.link_speed = ETH_SPEED_NUM_40G;
>     > +
>     > +     nn_link_status = (nn_link_status >>
>     NFP_NET_CFG_STS_LINK_RATE_SHIFT) &
>     > +                      NFP_NET_CFG_STS_LINK_RATE_MASK;
>     > +
>     > +     if ((NFD_CFG_MAJOR_VERSION_of(hw->ver) < 4) ||
>     > +         ((NFD_CFG_MINOR_VERSION_of(hw->ver) == 4) &&
>     > +         (NFD_CFG_MINOR_VERSION_of(hw->ver) == 0)))
>     > +             link.link_speed = ETH_SPEED_NUM_40G;
> 
>     Same comment from previous review:
> 
>     For specific firmware version, speed is still hardcoded to 40G, can you
>     please mention from this and if possible its reason in commit log?
> 
> 
> Well, we have old firmware still around and we need to avoid reading
> this info from hardware if not supported.
> But I guess I could be a more chatty about this in the commit log. I
> will send another version.
>  
> 
>     > +     else {
>     > +             if (nn_link_status == NFP_NET_CFG_STS_LINK_RATE_UNKNOWN ||
> 
>     Again from previous review:
> 
>     > This is for checking any wrong value from firmware/hardware.
> 
>     I see, but removing this check will not change the logic, else branch is
>     taken and again same value set.
> 
> 
> OK. I think I can remove the first part of the if clause, because it is
> implicit in the second part.

Yes this is what I mean. Thanks.

> I guess this is what you really meant, and not just to leave the else
> statement (without the else, of course). am I right?
>  
> 
>     Still if you deliberately prefer to keep it, that is OK.
> 
>     > +                 nn_link_status >= RTE_DIM(ls_to_ethtool))
>     > +                     link.link_speed = ETH_SPEED_NUM_NONE;
>     > +             else
>     > +                     link.link_speed = ls_to_ethtool[nn_link_status];
>     > +     }
>     >
>     >       if (old.link_status != link.link_status) {
>     >               nfp_net_dev_atomic_write_link_status(dev, &link);
>     >
> 
> 

^ permalink raw reply

* Re: [PATCH v2] doc: introduce PVP reference benchmark
From: Mcnamara, John @ 2016-12-09 10:26 UTC (permalink / raw)
  To: Maxime Coquelin, yuanhan.liu@linux.intel.com,
	thomas.monjalon@6wind.com, Yang, Zhiyong, ktraynor@redhat.com,
	dev@dpdk.org
In-Reply-To: <ba28794d-8f2f-21a9-f568-9d9b123a1be8@redhat.com>



> -----Original Message-----
> From: Maxime Coquelin [mailto:maxime.coquelin@redhat.com]
> Sent: Friday, December 9, 2016 6:30 AM
> To: Mcnamara, John <john.mcnamara@intel.com>; yuanhan.liu@linux.intel.com;
> thomas.monjalon@6wind.com; Yang, Zhiyong <zhiyong.yang@intel.com>;
> ktraynor@redhat.com; dev@dpdk.org
> Subject: Re: [PATCH v2] doc: introduce PVP reference benchmark
> 
> 
> 
> On 12/07/2016 10:07 PM, Mcnamara, John wrote:
> >> -----Original Message-----
> >> From: Maxime Coquelin [mailto:maxime.coquelin@redhat.com]
> >> Sent: Tuesday, December 6, 2016 12:25 PM
> >> To: yuanhan.liu@linux.intel.com; thomas.monjalon@6wind.com; Mcnamara,
> >> John <john.mcnamara@intel.com>; Yang, Zhiyong
> >> <zhiyong.yang@intel.com>; ktraynor@redhat.com; dev@dpdk.org
> >> Cc: Maxime Coquelin <maxime.coquelin@redhat.com>
> >> Subject: [PATCH v2] doc: introduce PVP reference benchmark
> >>
> >> Having reference benchmarks is important in order to obtain
> >> reproducible performance figures.
> >>
> >> This patch describes required steps to configure a PVP setup using
> >> testpmd in both host and guest.
> >>
> >> Not relying on external vSwitch ease integration in a CI loop by not
> >> being impacted by DPDK API changes.
> >>
> >> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> >
> > There is one trailing whitespace warning but apart from that:
> >
> > Acked-by: John McNamara <john.mcnamara@intel.com>
> 
> Thanks John,
> 
> Do you want me to send a v3, fixing the trailing whitespace & collecting
> the acks?
> 
>   -- Maxime


No need (unless the tree maintainer says otherwise). It was one trailing whitespace. Just something to look out for in future. 


P.S., We both should have truncated the text in this mail before replying. :-/

  http://dpdk.org/dev/patchwork/patch/17704/

^ permalink raw reply

* [PATCH v2] doc: fix mistakes in contribution guide
From: Yong Wang @ 2016-12-09 11:52 UTC (permalink / raw)
  To: john.mcnamara; +Cc: dev, Yong Wang

Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
---
v2:
* modify some redundant descriptions.
---
 doc/guides/contributing/documentation.rst | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/doc/guides/contributing/documentation.rst b/doc/guides/contributing/documentation.rst
index 5ec0675..f90a3dd 100644
--- a/doc/guides/contributing/documentation.rst
+++ b/doc/guides/contributing/documentation.rst
@@ -380,12 +380,11 @@ Lists
 
      #. Item one.
 
-     #. Item two is a long line that is wrapped and then indented
-        to match the start of the e first line.
-
      #. Item two is a long line that is wrapped and then indented to match
         the start of the previous line.
 
+     #. Item three.
+
 * Definition lists can be written with or without a bullet::
 
      * Item one.
@@ -477,7 +476,7 @@ Images
 
 * `Inkscape <http://inkscape.org>`_ is the recommended graphics editor for creating the images.
   Use some of the older images in ``doc/guides/prog_guide/img/`` as a template, for example ``mbuf1.svg``
-  or ``ring-enqueue.svg``.
+  or ``ring-enqueue1.svg``.
 
 * The SVG images should include a copyright notice, as an XML comment.
 
-- 
1.8.3.1

^ permalink raw reply related

* [PATCH v1 0/5] net/ixgbe: move set VF functions.
From: Bernard Iremonger @ 2016-12-09 11:17 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

This patchset implements the following deprecation notice:
[PATCH v1] doc: announce API and ABI change for librte_ether

The following functions from eth_dev_ops have been moved to the ixgbe PMD
and renamed:

ixgbe_set_pool_rx_mode
ixgbe_set_pool_rx
ixgbe_set_pool_tx
ixgbe_set_pool_vlan_filter
ixgbe_set_vf_rate_limit

Renamed the functions to the following:

rte_pmd_ixgbe_set_vf_rxmode
rte_pmd_ixgbe_set_vf_rx
rte_pmd_ixgbe_set_vf_tx
rte_pmd_ixgbe_set_vf_vlan_filter
rte_pmd_ixgbe_set_vf_rate_limit

Testpmd has been modified to use the following functions:
rte_pmd_ixgbe_set_vf_rxmode
rte_pmd_ixgbe_set_vf_rate_limit

New testpmd commands have been added to test the following functions:
rte_pmd_ixgbe_set_vf_rx
rte_pmd_ixgbe_set_vf_tx
rte_pmd_ixgbe_set_vf_vlan_filter

The testpmd user guide has been updated for the new commands.

Bernard Iremonger (5):
  net/ixgbe: move set VF functions from the ethdev
  app/testpmd: use ixgbe public functions
  app/testpmd: add command for set VF VLAN filter
  app/testpmd: add command for set VF receive
  app/testpmd: add command for set VF transmit

 app/test-pmd/cmdline.c                      | 270 +++++++++++++++++++++++++++-
 app/test-pmd/config.c                       |  31 ++--
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  21 +++
 drivers/net/ixgbe/ixgbe_ethdev.c            | 263 +++++++++++++++++++++++++++
 drivers/net/ixgbe/rte_pmd_ixgbe.h           | 104 +++++++++++
 drivers/net/ixgbe/rte_pmd_ixgbe_version.map |  10 ++
 6 files changed, 678 insertions(+), 21 deletions(-)

-- 
2.10.1

^ permalink raw reply

* [PATCH v1 1/5] net/ixgbe: move set VF functions from the ethdev
From: Bernard Iremonger @ 2016-12-09 11:17 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger
In-Reply-To: <1481282269-22626-1-git-send-email-bernard.iremonger@intel.com>

Move the following functions from eth_dev_ops to the ixgbe PMD and rename:

ixgbe_set_pool_rx_mode
ixgbe_set_pool_rx
ixgbe_set_pool_tx
ixgbe_set_pool_vlan_filter
ixgbe_set_vf_rate_limit

Rename the functions to the following:

rte_pmd_ixgbe_set_vf_rxmode
rte_pmd_ixgbe_set_vf_rx
rte_pmd_ixgbe_set_vf_tx
rte_pmd_ixgbe_set_vf_vlan_filter
rte_pmd_ixgbe_set_vf_rate_limit

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c            | 263 ++++++++++++++++++++++++++++
 drivers/net/ixgbe/rte_pmd_ixgbe.h           | 104 +++++++++++
 drivers/net/ixgbe/rte_pmd_ixgbe_version.map |  10 ++
 3 files changed, 377 insertions(+)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index edc9b22..f863cf4 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -4883,6 +4883,269 @@ rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on)
 	return 0;
 }
 
+int
+rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, uint16_t rx_mask, uint8_t on)
+{
+	int val = 0;
+	struct rte_eth_dev *dev;
+	struct rte_eth_dev_info dev_info;
+	struct ixgbe_hw *hw;
+	uint32_t vmolr;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+	rte_eth_dev_info_get(port, &dev_info);
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
+	if (vf >= dev_info.max_vfs)
+		return -EINVAL;
+
+	if (on > 1)
+		return -EINVAL;
+
+	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	vmolr = IXGBE_READ_REG(hw, IXGBE_VMOLR(vf));
+
+	if (hw->mac.type == ixgbe_mac_82598EB) {
+		PMD_INIT_LOG(ERR, "setting VF receive mode set should be done"
+			     " on 82599 hardware and newer");
+		return -ENOTSUP;
+	}
+	if (ixgbe_vmdq_mode_check(hw) < 0)
+		return -ENOTSUP;
+
+	val = ixgbe_convert_vm_rx_mask_to_val(rx_mask, val);
+
+	if (on)
+		vmolr |= val;
+	else
+		vmolr &= ~val;
+
+	IXGBE_WRITE_REG(hw, IXGBE_VMOLR(vf), vmolr);
+
+	return 0;
+}
+
+int
+rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on)
+{
+	struct rte_eth_dev *dev;
+	struct rte_eth_dev_info dev_info;
+	uint32_t reg, addr;
+	uint32_t val;
+	const uint8_t bit1 = 0x1;
+	struct ixgbe_hw *hw;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+	rte_eth_dev_info_get(port, &dev_info);
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
+	if (vf >= dev_info.max_vfs)
+		return -EINVAL;
+
+	if (on > 1)
+		return -EINVAL;
+
+	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+
+	if (ixgbe_vmdq_mode_check(hw) < 0)
+		return -ENOTSUP;
+
+	/* for vf >= 32, set bit in PFVFRE[1], otherwise PFVFRE[0] */
+	if (vf >= 32) {
+		addr = IXGBE_VFRE(1);
+		val = bit1 << (vf - 32);
+	} else {
+		addr = IXGBE_VFRE(0);
+		val = bit1 << vf;
+	}
+
+	reg = IXGBE_READ_REG(hw, addr);
+
+	if (on)
+		reg |= val;
+	else
+		reg &= ~val;
+
+	IXGBE_WRITE_REG(hw, addr, reg);
+
+	return 0;
+}
+
+int
+rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on)
+{
+	struct rte_eth_dev *dev;
+	struct rte_eth_dev_info dev_info;
+	uint32_t reg, addr;
+	uint32_t val;
+	const uint8_t bit1 = 0x1;
+
+	struct ixgbe_hw *hw;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+	rte_eth_dev_info_get(port, &dev_info);
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
+	if (vf >= dev_info.max_vfs)
+		return -EINVAL;
+
+	if (on > 1)
+		return -EINVAL;
+
+	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	if (ixgbe_vmdq_mode_check(hw) < 0)
+		return -ENOTSUP;
+
+	/* for vf >= 32, set bit in PFVFTE[1], otherwise PFVFTE[0] */
+	if (vf >= 32) {
+		addr = IXGBE_VFTE(1);
+		val = bit1 << (vf - 32);
+	} else {
+		addr = IXGBE_VFTE(0);
+		val = bit1 << vf;
+	}
+
+	reg = IXGBE_READ_REG(hw, addr);
+
+	if (on)
+		reg |= val;
+	else
+		reg &= ~val;
+
+	IXGBE_WRITE_REG(hw, addr, reg);
+
+	return 0;
+}
+
+int
+rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan,
+			uint64_t vf_mask, uint8_t vlan_on)
+{
+	struct rte_eth_dev *dev;
+	struct rte_eth_dev_info dev_info;
+	int ret = 0;
+	uint16_t vf_idx;
+	struct ixgbe_hw *hw;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+	rte_eth_dev_info_get(port, &dev_info);
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
+	if ((vlan > ETHER_MAX_VLAN_ID) || (vf_mask == 0))
+		return -EINVAL;
+
+	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	if (ixgbe_vmdq_mode_check(hw) < 0)
+		return -ENOTSUP;
+
+	for (vf_idx = 0; vf_idx < 64; vf_idx++) {
+		if (vf_mask & ((uint64_t)(1ULL << vf_idx))) {
+			ret = hw->mac.ops.set_vfta(hw, vlan, vf_idx,
+						   vlan_on, false);
+			if (ret < 0)
+				return ret;
+		}
+	}
+
+	return ret;
+}
+
+int rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf,
+	uint16_t tx_rate, uint64_t q_msk)
+{
+	struct rte_eth_dev *dev;
+	struct rte_eth_dev_info dev_info;
+	struct ixgbe_hw *hw;
+	struct ixgbe_vf_info *vfinfo;
+	struct rte_eth_link link;
+	uint8_t  nb_q_per_pool;
+	uint32_t queue_stride;
+	uint32_t queue_idx, idx = 0, vf_idx;
+	uint32_t queue_end;
+	uint16_t total_rate = 0;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+	rte_eth_dev_info_get(port, &dev_info);
+	rte_eth_link_get_nowait(port, &link);
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
+	if (vf >= dev_info.max_vfs)
+		return -EINVAL;
+
+	if (tx_rate > link.link_speed)
+		return -EINVAL;
+
+	if (q_msk == 0)
+		return 0;
+
+	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	vfinfo = *(IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private));
+	nb_q_per_pool = RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool;
+	queue_stride = IXGBE_MAX_RX_QUEUE_NUM / RTE_ETH_DEV_SRIOV(dev).active;
+	queue_idx = vf * queue_stride;
+	queue_end = queue_idx + nb_q_per_pool - 1;
+	if (queue_end >= hw->mac.max_tx_queues)
+		return -EINVAL;
+
+	if (vfinfo) {
+		for (vf_idx = 0; vf_idx < dev->pci_dev->max_vfs; vf_idx++) {
+			if (vf_idx == vf)
+				continue;
+			for (idx = 0; idx < RTE_DIM(vfinfo[vf_idx].tx_rate);
+				idx++)
+				total_rate += vfinfo[vf_idx].tx_rate[idx];
+		}
+	} else {
+		return -EINVAL;
+	}
+
+	/* Store tx_rate for this vf. */
+	for (idx = 0; idx < nb_q_per_pool; idx++) {
+		if (((uint64_t)0x1 << idx) & q_msk) {
+			if (vfinfo[vf].tx_rate[idx] != tx_rate)
+				vfinfo[vf].tx_rate[idx] = tx_rate;
+			total_rate += tx_rate;
+		}
+	}
+
+	if (total_rate > dev->data->dev_link.link_speed) {
+		/* Reset stored TX rate of the VF if it causes exceed
+		 * link speed.
+		 */
+		memset(vfinfo[vf].tx_rate, 0, sizeof(vfinfo[vf].tx_rate));
+		return -EINVAL;
+	}
+
+	/* Set RTTBCNRC of each queue/pool for vf X  */
+	for (; queue_idx <= queue_end; queue_idx++) {
+		if (0x1 & q_msk)
+			ixgbe_set_queue_rate_limit(dev, queue_idx, tx_rate);
+		q_msk = q_msk >> 1;
+	}
+
+	return 0;
+}
+
 #define IXGBE_MRCTL_VPME  0x01 /* Virtual Pool Mirroring. */
 #define IXGBE_MRCTL_UPME  0x02 /* Uplink Port Mirroring. */
 #define IXGBE_MRCTL_DPME  0x04 /* Downlink Port Mirroring. */
diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.h b/drivers/net/ixgbe/rte_pmd_ixgbe.h
index c2fb826..4eb0c9a 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe.h
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe.h
@@ -183,6 +183,110 @@ int
 rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on);
 
 /**
+* Set RX L2 Filtering mode of a VF of an Ethernet device.
+*
+* @param port
+*   The port identifier of the Ethernet device.
+* @param vf
+*   VF id.
+* @param rx_mode
+*    The RX mode mask, which is one or more of accepting Untagged Packets,
+*    packets that match the PFUTA table, Broadcast and Multicast Promiscuous.
+*    ETH_VMDQ_ACCEPT_UNTAG,ETH_VMDQ_ACCEPT_HASH_UC,
+*    ETH_VMDQ_ACCEPT_BROADCAST and ETH_VMDQ_ACCEPT_MULTICAST will be used
+*    in rx_mode.
+* @param on
+*    1 - Enable a VF RX mode.
+*    0 - Disable a VF RX mode.
+* @return
+*   - (0) if successful.
+*   - (-ENOTSUP) if hardware doesn't support.
+*   - (-ENODEV) if *port_id* invalid.
+*   - (-EINVAL) if bad parameter.
+*/
+int
+rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, uint16_t rx_mask, uint8_t on);
+
+/**
+* Enable or disable a VF traffic receive of an Ethernet device.
+*
+* @param port
+*   The port identifier of the Ethernet device.
+* @param vf
+*   VF id.
+* @param on
+*    1 - Enable a VF traffic receive.
+*    0 - Disable a VF traffic receive.
+* @return
+*   - (0) if successful.
+*   - (-ENOTSUP) if hardware doesn't support.
+*   - (-ENODEV) if *port_id* invalid.
+*   - (-EINVAL) if bad parameter.
+*/
+int
+rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on);
+
+/**
+* Enable or disable a VF traffic transmit of the Ethernet device.
+*
+* @param port
+*   The port identifier of the Ethernet device.
+* @param vf
+*   VF id.
+* @param on
+*    1 - Enable a VF traffic transmit.
+*    0 - Disable a VF traffic transmit.
+* @return
+*   - (0) if successful.
+*   - (-ENODEV) if *port_id* invalid.
+*   - (-ENOTSUP) if hardware doesn't support.
+*   - (-EINVAL) if bad parameter.
+*/
+int
+rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on);
+
+/**
+* Enable/Disable hardware VF VLAN filtering by an Ethernet device of
+* received VLAN packets tagged with a given VLAN Tag Identifier.
+*
+* @param port id
+*   The port identifier of the Ethernet device.
+* @param vlan_id
+*   The VLAN Tag Identifier whose filtering must be enabled or disabled.
+* @param vf_mask
+*    Bitmap listing which VFs participate in the VLAN filtering.
+* @param vlan_on
+*    1 - Enable VFs VLAN filtering.
+*    0 - Disable VFs VLAN filtering.
+* @return
+*   - (0) if successful.
+*   - (-ENOTSUP) if hardware doesn't support.
+*   - (-ENODEV) if *port_id* invalid.
+*   - (-EINVAL) if bad parameter.
+*/
+int
+rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan, uint64_t vf_mask, uint8_t vlan_on);
+
+/**
+ * Set the rate limitation for a vf on an Ethernet device.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param vf
+ *   VF id.
+ * @param tx_rate
+ *   The tx rate allocated from the total link speed for this VF id.
+ * @param q_msk
+ *   The queue mask which need to set the rate.
+ * @return
+ *   - (0) if successful.
+ *   - (-ENOTSUP) if hardware doesn't support this feature.
+ *   - (-ENODEV) if *port_id* invalid.
+ *   - (-EINVAL) if bad parameter.
+ */
+int rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf, uint16_t tx_rate, uint64_t q_msk);
+
+/**
  * Response sent back to ixgbe driver from user app after callback
  */
 enum rte_pmd_ixgbe_mb_event_rsp {
diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe_version.map b/drivers/net/ixgbe/rte_pmd_ixgbe_version.map
index 92434f3..5252bc2 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe_version.map
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe_version.map
@@ -15,3 +15,13 @@ DPDK_16.11 {
 	rte_pmd_ixgbe_set_vf_vlan_insert;
 	rte_pmd_ixgbe_set_vf_vlan_stripq;
 } DPDK_2.0;
+
+DPDK_17.02 {
+	global:
+
+	rte_pmd_ixgbe_set_vf_rate_limit;
+	rte_pmd_ixgbe_set_vf_rx;
+	rte_pmd_ixgbe_set_vf_rxmode;
+	rte_pmd_ixgbe_set_vf_tx;
+	rte_pmd_ixgbe_set_vf_vlan_filter;
+} DPDK_16.11;
\ No newline at end of file
-- 
2.10.1

^ permalink raw reply related

* [PATCH v1 2/5] app/testpmd: use ixgbe public functions
From: Bernard Iremonger @ 2016-12-09 11:17 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger
In-Reply-To: <1481282269-22626-1-git-send-email-bernard.iremonger@intel.com>

Use the the following ixgbe public functions:

rte_pmd_ixgbe_set_vf_rate_limit
rte_pmd_ixgbe_set_vf_rx
rte_pmd_ixgbe_set_vf_rxmode
rte_pmd_ixgbe_set_vf_tx
rte_pmd_ixgbe_set_vf_vlan_filter

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/cmdline.c |  2 +-
 app/test-pmd/config.c  | 31 +++++++++++--------------------
 2 files changed, 12 insertions(+), 21 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index d03a592..12f799b 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -6708,7 +6708,7 @@ cmd_set_vf_rxmode_parsed(void *parsed_result,
 			rx_mode |= ETH_VMDQ_ACCEPT_MULTICAST;
 	}
 
-	ret = rte_eth_dev_set_vf_rxmode(res->port_id,res->vf_id,rx_mode,(uint8_t)is_on);
+	ret = rte_pmd_ixgbe_set_vf_rxmode(res->port_id, res->vf_id, rx_mode, (uint8_t)is_on);
 	if (ret < 0)
 		printf("bad VF receive mode parameter, return code = %d \n",
 		ret);
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 8cf537d..ea129db 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -92,6 +92,9 @@
 #include <rte_ethdev.h>
 #include <rte_string_fns.h>
 #include <rte_cycles.h>
+#ifdef RTE_LIBRTE_IXGBE_PMD
+#include <rte_pmd_ixgbe.h>
+#endif
 
 #include "testpmd.h"
 
@@ -2332,16 +2335,16 @@ set_vf_traffic(portid_t port_id, uint8_t is_rx, uint16_t vf, uint8_t on)
 	if (port_id_is_invalid(port_id, ENABLED_WARN))
 		return;
 	if (is_rx)
-		diag = rte_eth_dev_set_vf_rx(port_id,vf,on);
+		diag = rte_pmd_ixgbe_set_vf_rx(port_id, vf, on);
 	else
-		diag = rte_eth_dev_set_vf_tx(port_id,vf,on);
+		diag = rte_pmd_ixgbe_set_vf_tx(port_id, vf, on);
 	if (diag == 0)
 		return;
 	if(is_rx)
-		printf("rte_eth_dev_set_vf_rx for port_id=%d failed "
+		printf("rte_pmd_ixgbe_set_vf_rx for port_id=%d failed "
 	       		"diag=%d\n", port_id, diag);
 	else
-		printf("rte_eth_dev_set_vf_tx for port_id=%d failed "
+		printf("rte_pmd_ixgbe_set_vf_tx for port_id=%d failed "
 	       		"diag=%d\n", port_id, diag);
 
 }
@@ -2355,10 +2358,10 @@ set_vf_rx_vlan(portid_t port_id, uint16_t vlan_id, uint64_t vf_mask, uint8_t on)
 		return;
 	if (vlan_id_is_invalid(vlan_id))
 		return;
-	diag = rte_eth_dev_set_vf_vlan_filter(port_id, vlan_id, vf_mask, on);
+	diag = rte_pmd_ixgbe_set_vf_vlan_filter(port_id, vlan_id, vf_mask, on);
 	if (diag == 0)
 		return;
-	printf("rte_eth_dev_set_vf_vlan_filter for port_id=%d failed "
+	printf("rte_pmd_ixgbe_set_vf_vlan_filter for port_id=%d failed "
 	       "diag=%d\n", port_id, diag);
 }
 
@@ -2388,23 +2391,11 @@ int
 set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate, uint64_t q_msk)
 {
 	int diag;
-	struct rte_eth_link link;
-
-	if (q_msk == 0)
-		return 0;
 
-	if (port_id_is_invalid(port_id, ENABLED_WARN))
-		return 1;
-	rte_eth_link_get_nowait(port_id, &link);
-	if (rate > link.link_speed) {
-		printf("Invalid rate value:%u bigger than link speed: %u\n",
-			rate, link.link_speed);
-		return 1;
-	}
-	diag = rte_eth_set_vf_rate_limit(port_id, vf, rate, q_msk);
+	diag = rte_pmd_ixgbe_set_vf_rate_limit(port_id, vf, rate, q_msk);
 	if (diag == 0)
 		return diag;
-	printf("rte_eth_set_vf_rate_limit for port_id=%d failed diag=%d\n",
+	printf("rte_pmd_ixgbe_set_vf_rate_limit for port_id=%d failed diag=%d\n",
 		port_id, diag);
 	return diag;
 }
-- 
2.10.1

^ permalink raw reply related

* [PATCH v1 4/5] app/testpmd: add command for set VF receive
From: Bernard Iremonger @ 2016-12-09 11:17 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger
In-Reply-To: <1481282269-22626-1-git-send-email-bernard.iremonger@intel.com>

add the following command to testpmd:

set vf rx <port_id> <vf_id> <on|off>

add command to the testpmd user guide.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/cmdline.c                      | 85 +++++++++++++++++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 +++
 2 files changed, 92 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 3603526..4605ee2 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -274,6 +274,9 @@ static void cmd_help_long_parsed(void *parsed_result,
 
 			"set vf mac antispoof (port_id) (vf_id) (on|off).\n"
 			"    Set MAC antispoof for a VF from the PF.\n\n"
+
+			"set vf rx (port_id) (vf_id) (on|off).\n"
+			"    Enable or disable RX for a VF from the PF.\n\n"
 #endif
 
 			"vlan set strip (on|off) (port_id)\n"
@@ -11236,6 +11239,87 @@ cmdline_parse_inst_t cmd_set_vf_vlan_filter = {
 	},
 };
 
+/* vf rx configuration */
+
+/* Common result structure for vf rx */
+struct cmd_vf_rx_result {
+	cmdline_fixed_string_t set;
+	cmdline_fixed_string_t vf;
+	cmdline_fixed_string_t rx;
+	uint8_t port_id;
+	uint16_t vf_id;
+	cmdline_fixed_string_t on_off;
+};
+
+/* Common CLI fields for vf rx enable disable */
+cmdline_parse_token_string_t cmd_vf_rx_set =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_rx_result,
+		 set, "set");
+cmdline_parse_token_string_t cmd_vf_rx_vf =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_rx_result,
+		 vf, "vf");
+cmdline_parse_token_string_t cmd_vf_rx_rx =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_rx_result,
+		 rx, "rx");
+cmdline_parse_token_num_t cmd_vf_rx_port_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_rx_result,
+		 port_id, UINT8);
+cmdline_parse_token_num_t cmd_vf_rx_vf_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_rx_result,
+		 vf_id, UINT16);
+cmdline_parse_token_string_t cmd_vf_rx_on_off =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_rx_result,
+		 on_off, "on#off");
+
+static void
+cmd_set_vf_rx_parsed(
+	void *parsed_result,
+	__attribute__((unused)) struct cmdline *cl,
+	__attribute__((unused)) void *data)
+{
+	struct cmd_vf_rx_result *res = parsed_result;
+	int ret = 0;
+	int is_on = (strcmp(res->on_off, "on") == 0) ? 1 : 0;
+
+	ret = rte_pmd_ixgbe_set_vf_rx(res->port_id, res->vf_id, is_on);
+	switch (ret) {
+	case 0:
+		break;
+	case -EINVAL:
+		printf("invalid vf_id %d or is_on %d\n", res->vf_id, is_on);
+		break;
+	case -ENODEV:
+		printf("invalid port_id %d\n", res->port_id);
+		break;
+	case -ENOTSUP:
+		printf("not supported on vf port %d\n", res->port_id);
+		break;
+	default:
+		printf("programming error: (%s)\n", strerror(-ret));
+	}
+}
+
+cmdline_parse_inst_t cmd_set_vf_rx = {
+	.f = cmd_set_vf_rx_parsed,
+	.data = NULL,
+	.help_str = "set vf rx <port_id> <vf_id> <on|off>",
+	.tokens = {
+		(void *)&cmd_vf_rx_set,
+		(void *)&cmd_vf_rx_vf,
+		(void *)&cmd_vf_rx_rx,
+		(void *)&cmd_vf_rx_port_id,
+		(void *)&cmd_vf_rx_vf_id,
+		(void *)&cmd_vf_rx_on_off,
+		NULL,
+	},
+};
+
 /* tx loopback configuration */
 
 /* Common result structure for tx loopback */
@@ -11722,6 +11806,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_set_all_queues_drop_en,
 	(cmdline_parse_inst_t *)&cmd_set_vf_split_drop_en,
 	(cmdline_parse_inst_t *)&cmd_set_vf_mac_addr,
+	(cmdline_parse_inst_t *)&cmd_set_vf_rx,
 #endif
 	NULL,
 };
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 60dcd91..6a058e9 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -507,6 +507,13 @@ Set mac antispoof for a VF from the PF::
 
    testpmd> set vf mac antispoof  (port_id) (vf_id) (on|off)
 
+set rx (for VF)
+~~~~~~~~~~~~~~~
+
+Enable/disable rx for a VF from the PF::
+
+   testpmd> set vf rx (port_id) (vf_id) (on|off)
+
 vlan set strip
 ~~~~~~~~~~~~~~
 
-- 
2.10.1

^ permalink raw reply related

* [PATCH v1 3/5] app/testpmd: add command for set VF VLAN filter
From: Bernard Iremonger @ 2016-12-09 11:17 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger
In-Reply-To: <1481282269-22626-1-git-send-email-bernard.iremonger@intel.com>

Add the following command to testpmd:
set vf vlan filter <port_id> <vlan_id> <vf_mask> <on|off>

Add command to the testpmd user guide.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/cmdline.c                      | 98 +++++++++++++++++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 +++
 2 files changed, 105 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 12f799b..3603526 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -291,6 +291,9 @@ static void cmd_help_long_parsed(void *parsed_result,
 
 			"set vf vlan antispoof (port_id) (vf_id) (on|off)\n"
 			"    Set VLAN antispoof for a VF from the PF.\n\n"
+
+			"set vf vlan filter (port_id) (vlan_id) (vf_mask) (on|off)\n"
+			"    Set VLAN filter for a VF pool from the PF.\n\n"
 #endif
 
 			"vlan set filter (on|off) (port_id)\n"
@@ -11139,6 +11142,100 @@ cmdline_parse_inst_t cmd_set_vf_vlan_insert = {
 	},
 };
 
+
+/* vf vlan filter configuration */
+
+/* Common result structure for vf vlan filter */
+struct cmd_vf_vlan_filter_result {
+	cmdline_fixed_string_t set;
+	cmdline_fixed_string_t vf;
+	cmdline_fixed_string_t vlan;
+	cmdline_fixed_string_t filter;
+	uint8_t port_id;
+	uint16_t vlan_id;
+	uint16_t vf_mask;
+	cmdline_fixed_string_t on_off;
+};
+
+/* Common CLI fields for vf vlan filter enable disable */
+cmdline_parse_token_string_t cmd_vf_vlan_filter_set =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 set, "set");
+cmdline_parse_token_string_t cmd_vf_vlan_filter_vf =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 vf, "vf");
+cmdline_parse_token_string_t cmd_vf_vlan_filter_vlan =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 vlan, "vlan");
+cmdline_parse_token_string_t cmd_vf_vlan_filter_filter =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 filter, "filter");
+cmdline_parse_token_num_t cmd_vf_vlan_filter_port_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 port_id, UINT8);
+cmdline_parse_token_num_t cmd_vf_vlan_filter_vlan_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 vlan_id, UINT16);
+cmdline_parse_token_num_t cmd_vf_vlan_filter_vf_mask =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 vf_mask, UINT16);
+cmdline_parse_token_string_t cmd_vf_vlan_filter_on_off =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 on_off, "on#off");
+
+static void
+cmd_set_vf_vlan_filter_parsed(
+	void *parsed_result,
+	__attribute__((unused)) struct cmdline *cl,
+	__attribute__((unused)) void *data)
+{
+	struct cmd_vf_vlan_filter_result *res = parsed_result;
+	int ret;
+	int is_on = (strcmp(res->on_off, "on") == 0) ? 1 : 0;
+
+	ret = rte_pmd_ixgbe_set_vf_vlan_filter(res->port_id, res->vlan_id, res->vf_mask, is_on);
+	switch (ret) {
+	case 0:
+		break;
+	case -EINVAL:
+		printf("invalid vf_mask %d or vlan_id %d\n", res->vf_mask, res->vlan_id);
+		break;
+	case -ENODEV:
+		printf("invalid port_id %d\n", res->port_id);
+		break;
+	case -ENOTSUP:
+		printf("not supported on vf port %d\n", res->port_id);
+		break;
+	default:
+		printf("programming error: (%s)\n", strerror(-ret));
+	}
+}
+
+cmdline_parse_inst_t cmd_set_vf_vlan_filter = {
+	.f = cmd_set_vf_vlan_filter_parsed,
+	.data = NULL,
+	.help_str = "set vf vlan filter <port_id> <vlan_id> <vf_mask> <on_off>",
+	.tokens = {
+		(void *)&cmd_vf_vlan_filter_set,
+		(void *)&cmd_vf_vlan_filter_vf,
+		(void *)&cmd_vf_vlan_filter_vlan,
+		(void *)&cmd_vf_vlan_filter_filter,
+		(void *)&cmd_vf_vlan_filter_port_id,
+		(void *)&cmd_vf_vlan_filter_vlan_id,
+		(void *)&cmd_vf_vlan_filter_vf_mask,
+		(void *)&cmd_vf_vlan_filter_on_off,
+		NULL,
+	},
+};
+
 /* tx loopback configuration */
 
 /* Common result structure for tx loopback */
@@ -11620,6 +11717,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_set_vf_mac_anti_spoof,
 	(cmdline_parse_inst_t *)&cmd_set_vf_vlan_stripq,
 	(cmdline_parse_inst_t *)&cmd_set_vf_vlan_insert,
+	(cmdline_parse_inst_t *)&cmd_set_vf_vlan_filter,
 	(cmdline_parse_inst_t *)&cmd_set_tx_loopback,
 	(cmdline_parse_inst_t *)&cmd_set_all_queues_drop_en,
 	(cmdline_parse_inst_t *)&cmd_set_vf_split_drop_en,
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index f1c269a..60dcd91 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -535,6 +535,13 @@ Set VLAN insert for a VF from the PF::
 
    testpmd> set vf vlan insert (port_id) (vf_id) (vlan_id)
 
+vlan set filter (for VF pool)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set VLAN filter for a VF pool from the PF::
+
+   testpmd> set vf vlan filter (port_id) (vlan_id) (vf_mask) (on|off)
+
 vlan set antispoof (for VF)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-- 
2.10.1

^ permalink raw reply related

* [PATCH v1 5/5] app/testpmd: add command for set VF transmit
From: Bernard Iremonger @ 2016-12-09 11:17 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger
In-Reply-To: <1481282269-22626-1-git-send-email-bernard.iremonger@intel.com>

add the following command to testpmd:

set vf tx <port_id> <vf_id> <on|off>

add command to the testpmd user guide.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/cmdline.c                      | 85 +++++++++++++++++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 +++
 2 files changed, 92 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 4605ee2..e813b24 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -277,6 +277,9 @@ static void cmd_help_long_parsed(void *parsed_result,
 
 			"set vf rx (port_id) (vf_id) (on|off).\n"
 			"    Enable or disable RX for a VF from the PF.\n\n"
+
+			"set vf tx (port_id) (vf_id) (on|off).\n"
+			"    Enable or disable TX for a VF from the PF.\n\n"
 #endif
 
 			"vlan set strip (on|off) (port_id)\n"
@@ -11320,6 +11323,87 @@ cmdline_parse_inst_t cmd_set_vf_rx = {
 	},
 };
 
+/* vf tx configuration */
+
+/* Common result structure for vf tx */
+struct cmd_vf_tx_result {
+	cmdline_fixed_string_t set;
+	cmdline_fixed_string_t vf;
+	cmdline_fixed_string_t tx;
+	uint8_t port_id;
+	uint16_t vf_id;
+	cmdline_fixed_string_t on_off;
+};
+
+/* Common CLI fields for vf tx enable disable */
+cmdline_parse_token_string_t cmd_vf_tx_set =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_tx_result,
+		 set, "set");
+cmdline_parse_token_string_t cmd_vf_tx_vf =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_tx_result,
+		 vf, "vf");
+cmdline_parse_token_string_t cmd_vf_tx_tx =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_tx_result,
+		 tx, "tx");
+cmdline_parse_token_num_t cmd_vf_tx_port_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_tx_result,
+		 port_id, UINT8);
+cmdline_parse_token_num_t cmd_vf_tx_vf_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_tx_result,
+		 vf_id, UINT16);
+cmdline_parse_token_string_t cmd_vf_tx_on_off =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_tx_result,
+		 on_off, "on#off");
+
+static void
+cmd_set_vf_tx_parsed(
+	void *parsed_result,
+	__attribute__((unused)) struct cmdline *cl,
+	__attribute__((unused)) void *data)
+{
+	struct cmd_vf_tx_result *res = parsed_result;
+	int ret = 0;
+	int is_on = (strcmp(res->on_off, "on") == 0) ? 1 : 0;
+
+	ret = rte_pmd_ixgbe_set_vf_tx(res->port_id, res->vf_id, is_on);
+	switch (ret) {
+	case 0:
+		break;
+	case -EINVAL:
+		printf("invalid vf_id %d or is_on %d\n", res->vf_id, is_on);
+		break;
+	case -ENODEV:
+		printf("invalid port_id %d\n", res->port_id);
+		break;
+	case -ENOTSUP:
+		printf("not supported on vf port %d\n", res->port_id);
+		break;
+	default:
+		printf("programming error: (%s)\n", strerror(-ret));
+	}
+}
+
+cmdline_parse_inst_t cmd_set_vf_tx = {
+	.f = cmd_set_vf_tx_parsed,
+	.data = NULL,
+	.help_str = "set vf tx <port_id> <vf_id> <on|off>",
+	.tokens = {
+		(void *)&cmd_vf_tx_set,
+		(void *)&cmd_vf_tx_vf,
+		(void *)&cmd_vf_tx_tx,
+		(void *)&cmd_vf_tx_port_id,
+		(void *)&cmd_vf_tx_vf_id,
+		(void *)&cmd_vf_tx_on_off,
+		NULL,
+	},
+};
+
 /* tx loopback configuration */
 
 /* Common result structure for tx loopback */
@@ -11807,6 +11891,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_set_vf_split_drop_en,
 	(cmdline_parse_inst_t *)&cmd_set_vf_mac_addr,
 	(cmdline_parse_inst_t *)&cmd_set_vf_rx,
+	(cmdline_parse_inst_t *)&cmd_set_vf_tx,
 #endif
 	NULL,
 };
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 6a058e9..1de4c5f 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -514,6 +514,13 @@ Enable/disable rx for a VF from the PF::
 
    testpmd> set vf rx (port_id) (vf_id) (on|off)
 
+set tx (for VF)
+~~~~~~~~~~~~~~~
+
+Enable/disable tx for a VF from the PF::
+
+   testpmd> set vf tx (port_id) (vf_id) (on|off)
+
 vlan set strip
 ~~~~~~~~~~~~~~
 
-- 
2.10.1

^ permalink raw reply related

* [PATCH v1 0/5] net/ixgbe: move set VF functions.
From: Bernard Iremonger @ 2016-12-09 11:27 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

This patchset implements the following deprecation notice:
[PATCH v1] doc: announce API and ABI change for librte_ether

The following functions from eth_dev_ops have been moved to the ixgbe PMD
and renamed:

ixgbe_set_pool_rx_mode
ixgbe_set_pool_rx
ixgbe_set_pool_tx
ixgbe_set_pool_vlan_filter
ixgbe_set_vf_rate_limit

Renamed the functions to the following:

rte_pmd_ixgbe_set_vf_rxmode
rte_pmd_ixgbe_set_vf_rx
rte_pmd_ixgbe_set_vf_tx
rte_pmd_ixgbe_set_vf_vlan_filter
rte_pmd_ixgbe_set_vf_rate_limit

Testpmd has been modified to use the following functions:
rte_pmd_ixgbe_set_vf_rxmode
rte_pmd_ixgbe_set_vf_rate_limit

New testpmd commands have been added to test the following functions:
rte_pmd_ixgbe_set_vf_rx
rte_pmd_ixgbe_set_vf_tx
rte_pmd_ixgbe_set_vf_vlan_filter

The testpmd user guide has been updated for the new commands.

Bernard Iremonger (5):
  net/ixgbe: move set VF functions from the ethdev
  app/testpmd: use ixgbe public functions
  app/testpmd: add command for set VF VLAN filter
  app/testpmd: add command for set VF receive
  app/testpmd: add command for set VF transmit

 app/test-pmd/cmdline.c                      | 270 +++++++++++++++++++++++++++-
 app/test-pmd/config.c                       |  31 ++--
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  21 +++
 drivers/net/ixgbe/ixgbe_ethdev.c            | 263 +++++++++++++++++++++++++++
 drivers/net/ixgbe/rte_pmd_ixgbe.h           | 104 +++++++++++
 drivers/net/ixgbe/rte_pmd_ixgbe_version.map |  10 ++
 6 files changed, 678 insertions(+), 21 deletions(-)

-- 
2.10.1

^ permalink raw reply

* [PATCH v1 1/5] net/ixgbe: move set VF functions from the ethdev
From: Bernard Iremonger @ 2016-12-09 11:27 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger
In-Reply-To: <1481282878-26176-1-git-send-email-bernard.iremonger@intel.com>

Move the following functions from eth_dev_ops to the ixgbe PMD and rename:

ixgbe_set_pool_rx_mode
ixgbe_set_pool_rx
ixgbe_set_pool_tx
ixgbe_set_pool_vlan_filter
ixgbe_set_vf_rate_limit

Rename the functions to the following:

rte_pmd_ixgbe_set_vf_rxmode
rte_pmd_ixgbe_set_vf_rx
rte_pmd_ixgbe_set_vf_tx
rte_pmd_ixgbe_set_vf_vlan_filter
rte_pmd_ixgbe_set_vf_rate_limit

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c            | 263 ++++++++++++++++++++++++++++
 drivers/net/ixgbe/rte_pmd_ixgbe.h           | 104 +++++++++++
 drivers/net/ixgbe/rte_pmd_ixgbe_version.map |  10 ++
 3 files changed, 377 insertions(+)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index edc9b22..f863cf4 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -4883,6 +4883,269 @@ rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on)
 	return 0;
 }
 
+int
+rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, uint16_t rx_mask, uint8_t on)
+{
+	int val = 0;
+	struct rte_eth_dev *dev;
+	struct rte_eth_dev_info dev_info;
+	struct ixgbe_hw *hw;
+	uint32_t vmolr;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+	rte_eth_dev_info_get(port, &dev_info);
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
+	if (vf >= dev_info.max_vfs)
+		return -EINVAL;
+
+	if (on > 1)
+		return -EINVAL;
+
+	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	vmolr = IXGBE_READ_REG(hw, IXGBE_VMOLR(vf));
+
+	if (hw->mac.type == ixgbe_mac_82598EB) {
+		PMD_INIT_LOG(ERR, "setting VF receive mode set should be done"
+			     " on 82599 hardware and newer");
+		return -ENOTSUP;
+	}
+	if (ixgbe_vmdq_mode_check(hw) < 0)
+		return -ENOTSUP;
+
+	val = ixgbe_convert_vm_rx_mask_to_val(rx_mask, val);
+
+	if (on)
+		vmolr |= val;
+	else
+		vmolr &= ~val;
+
+	IXGBE_WRITE_REG(hw, IXGBE_VMOLR(vf), vmolr);
+
+	return 0;
+}
+
+int
+rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on)
+{
+	struct rte_eth_dev *dev;
+	struct rte_eth_dev_info dev_info;
+	uint32_t reg, addr;
+	uint32_t val;
+	const uint8_t bit1 = 0x1;
+	struct ixgbe_hw *hw;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+	rte_eth_dev_info_get(port, &dev_info);
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
+	if (vf >= dev_info.max_vfs)
+		return -EINVAL;
+
+	if (on > 1)
+		return -EINVAL;
+
+	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+
+	if (ixgbe_vmdq_mode_check(hw) < 0)
+		return -ENOTSUP;
+
+	/* for vf >= 32, set bit in PFVFRE[1], otherwise PFVFRE[0] */
+	if (vf >= 32) {
+		addr = IXGBE_VFRE(1);
+		val = bit1 << (vf - 32);
+	} else {
+		addr = IXGBE_VFRE(0);
+		val = bit1 << vf;
+	}
+
+	reg = IXGBE_READ_REG(hw, addr);
+
+	if (on)
+		reg |= val;
+	else
+		reg &= ~val;
+
+	IXGBE_WRITE_REG(hw, addr, reg);
+
+	return 0;
+}
+
+int
+rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on)
+{
+	struct rte_eth_dev *dev;
+	struct rte_eth_dev_info dev_info;
+	uint32_t reg, addr;
+	uint32_t val;
+	const uint8_t bit1 = 0x1;
+
+	struct ixgbe_hw *hw;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+	rte_eth_dev_info_get(port, &dev_info);
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
+	if (vf >= dev_info.max_vfs)
+		return -EINVAL;
+
+	if (on > 1)
+		return -EINVAL;
+
+	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	if (ixgbe_vmdq_mode_check(hw) < 0)
+		return -ENOTSUP;
+
+	/* for vf >= 32, set bit in PFVFTE[1], otherwise PFVFTE[0] */
+	if (vf >= 32) {
+		addr = IXGBE_VFTE(1);
+		val = bit1 << (vf - 32);
+	} else {
+		addr = IXGBE_VFTE(0);
+		val = bit1 << vf;
+	}
+
+	reg = IXGBE_READ_REG(hw, addr);
+
+	if (on)
+		reg |= val;
+	else
+		reg &= ~val;
+
+	IXGBE_WRITE_REG(hw, addr, reg);
+
+	return 0;
+}
+
+int
+rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan,
+			uint64_t vf_mask, uint8_t vlan_on)
+{
+	struct rte_eth_dev *dev;
+	struct rte_eth_dev_info dev_info;
+	int ret = 0;
+	uint16_t vf_idx;
+	struct ixgbe_hw *hw;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+	rte_eth_dev_info_get(port, &dev_info);
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
+	if ((vlan > ETHER_MAX_VLAN_ID) || (vf_mask == 0))
+		return -EINVAL;
+
+	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	if (ixgbe_vmdq_mode_check(hw) < 0)
+		return -ENOTSUP;
+
+	for (vf_idx = 0; vf_idx < 64; vf_idx++) {
+		if (vf_mask & ((uint64_t)(1ULL << vf_idx))) {
+			ret = hw->mac.ops.set_vfta(hw, vlan, vf_idx,
+						   vlan_on, false);
+			if (ret < 0)
+				return ret;
+		}
+	}
+
+	return ret;
+}
+
+int rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf,
+	uint16_t tx_rate, uint64_t q_msk)
+{
+	struct rte_eth_dev *dev;
+	struct rte_eth_dev_info dev_info;
+	struct ixgbe_hw *hw;
+	struct ixgbe_vf_info *vfinfo;
+	struct rte_eth_link link;
+	uint8_t  nb_q_per_pool;
+	uint32_t queue_stride;
+	uint32_t queue_idx, idx = 0, vf_idx;
+	uint32_t queue_end;
+	uint16_t total_rate = 0;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+	rte_eth_dev_info_get(port, &dev_info);
+	rte_eth_link_get_nowait(port, &link);
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
+	if (vf >= dev_info.max_vfs)
+		return -EINVAL;
+
+	if (tx_rate > link.link_speed)
+		return -EINVAL;
+
+	if (q_msk == 0)
+		return 0;
+
+	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	vfinfo = *(IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private));
+	nb_q_per_pool = RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool;
+	queue_stride = IXGBE_MAX_RX_QUEUE_NUM / RTE_ETH_DEV_SRIOV(dev).active;
+	queue_idx = vf * queue_stride;
+	queue_end = queue_idx + nb_q_per_pool - 1;
+	if (queue_end >= hw->mac.max_tx_queues)
+		return -EINVAL;
+
+	if (vfinfo) {
+		for (vf_idx = 0; vf_idx < dev->pci_dev->max_vfs; vf_idx++) {
+			if (vf_idx == vf)
+				continue;
+			for (idx = 0; idx < RTE_DIM(vfinfo[vf_idx].tx_rate);
+				idx++)
+				total_rate += vfinfo[vf_idx].tx_rate[idx];
+		}
+	} else {
+		return -EINVAL;
+	}
+
+	/* Store tx_rate for this vf. */
+	for (idx = 0; idx < nb_q_per_pool; idx++) {
+		if (((uint64_t)0x1 << idx) & q_msk) {
+			if (vfinfo[vf].tx_rate[idx] != tx_rate)
+				vfinfo[vf].tx_rate[idx] = tx_rate;
+			total_rate += tx_rate;
+		}
+	}
+
+	if (total_rate > dev->data->dev_link.link_speed) {
+		/* Reset stored TX rate of the VF if it causes exceed
+		 * link speed.
+		 */
+		memset(vfinfo[vf].tx_rate, 0, sizeof(vfinfo[vf].tx_rate));
+		return -EINVAL;
+	}
+
+	/* Set RTTBCNRC of each queue/pool for vf X  */
+	for (; queue_idx <= queue_end; queue_idx++) {
+		if (0x1 & q_msk)
+			ixgbe_set_queue_rate_limit(dev, queue_idx, tx_rate);
+		q_msk = q_msk >> 1;
+	}
+
+	return 0;
+}
+
 #define IXGBE_MRCTL_VPME  0x01 /* Virtual Pool Mirroring. */
 #define IXGBE_MRCTL_UPME  0x02 /* Uplink Port Mirroring. */
 #define IXGBE_MRCTL_DPME  0x04 /* Downlink Port Mirroring. */
diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.h b/drivers/net/ixgbe/rte_pmd_ixgbe.h
index c2fb826..4eb0c9a 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe.h
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe.h
@@ -183,6 +183,110 @@ int
 rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on);
 
 /**
+* Set RX L2 Filtering mode of a VF of an Ethernet device.
+*
+* @param port
+*   The port identifier of the Ethernet device.
+* @param vf
+*   VF id.
+* @param rx_mode
+*    The RX mode mask, which is one or more of accepting Untagged Packets,
+*    packets that match the PFUTA table, Broadcast and Multicast Promiscuous.
+*    ETH_VMDQ_ACCEPT_UNTAG,ETH_VMDQ_ACCEPT_HASH_UC,
+*    ETH_VMDQ_ACCEPT_BROADCAST and ETH_VMDQ_ACCEPT_MULTICAST will be used
+*    in rx_mode.
+* @param on
+*    1 - Enable a VF RX mode.
+*    0 - Disable a VF RX mode.
+* @return
+*   - (0) if successful.
+*   - (-ENOTSUP) if hardware doesn't support.
+*   - (-ENODEV) if *port_id* invalid.
+*   - (-EINVAL) if bad parameter.
+*/
+int
+rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, uint16_t rx_mask, uint8_t on);
+
+/**
+* Enable or disable a VF traffic receive of an Ethernet device.
+*
+* @param port
+*   The port identifier of the Ethernet device.
+* @param vf
+*   VF id.
+* @param on
+*    1 - Enable a VF traffic receive.
+*    0 - Disable a VF traffic receive.
+* @return
+*   - (0) if successful.
+*   - (-ENOTSUP) if hardware doesn't support.
+*   - (-ENODEV) if *port_id* invalid.
+*   - (-EINVAL) if bad parameter.
+*/
+int
+rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on);
+
+/**
+* Enable or disable a VF traffic transmit of the Ethernet device.
+*
+* @param port
+*   The port identifier of the Ethernet device.
+* @param vf
+*   VF id.
+* @param on
+*    1 - Enable a VF traffic transmit.
+*    0 - Disable a VF traffic transmit.
+* @return
+*   - (0) if successful.
+*   - (-ENODEV) if *port_id* invalid.
+*   - (-ENOTSUP) if hardware doesn't support.
+*   - (-EINVAL) if bad parameter.
+*/
+int
+rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on);
+
+/**
+* Enable/Disable hardware VF VLAN filtering by an Ethernet device of
+* received VLAN packets tagged with a given VLAN Tag Identifier.
+*
+* @param port id
+*   The port identifier of the Ethernet device.
+* @param vlan_id
+*   The VLAN Tag Identifier whose filtering must be enabled or disabled.
+* @param vf_mask
+*    Bitmap listing which VFs participate in the VLAN filtering.
+* @param vlan_on
+*    1 - Enable VFs VLAN filtering.
+*    0 - Disable VFs VLAN filtering.
+* @return
+*   - (0) if successful.
+*   - (-ENOTSUP) if hardware doesn't support.
+*   - (-ENODEV) if *port_id* invalid.
+*   - (-EINVAL) if bad parameter.
+*/
+int
+rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan, uint64_t vf_mask, uint8_t vlan_on);
+
+/**
+ * Set the rate limitation for a vf on an Ethernet device.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param vf
+ *   VF id.
+ * @param tx_rate
+ *   The tx rate allocated from the total link speed for this VF id.
+ * @param q_msk
+ *   The queue mask which need to set the rate.
+ * @return
+ *   - (0) if successful.
+ *   - (-ENOTSUP) if hardware doesn't support this feature.
+ *   - (-ENODEV) if *port_id* invalid.
+ *   - (-EINVAL) if bad parameter.
+ */
+int rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf, uint16_t tx_rate, uint64_t q_msk);
+
+/**
  * Response sent back to ixgbe driver from user app after callback
  */
 enum rte_pmd_ixgbe_mb_event_rsp {
diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe_version.map b/drivers/net/ixgbe/rte_pmd_ixgbe_version.map
index 92434f3..5252bc2 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe_version.map
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe_version.map
@@ -15,3 +15,13 @@ DPDK_16.11 {
 	rte_pmd_ixgbe_set_vf_vlan_insert;
 	rte_pmd_ixgbe_set_vf_vlan_stripq;
 } DPDK_2.0;
+
+DPDK_17.02 {
+	global:
+
+	rte_pmd_ixgbe_set_vf_rate_limit;
+	rte_pmd_ixgbe_set_vf_rx;
+	rte_pmd_ixgbe_set_vf_rxmode;
+	rte_pmd_ixgbe_set_vf_tx;
+	rte_pmd_ixgbe_set_vf_vlan_filter;
+} DPDK_16.11;
\ No newline at end of file
-- 
2.10.1

^ permalink raw reply related

* [PATCH v1 2/5] app/testpmd: use ixgbe public functions
From: Bernard Iremonger @ 2016-12-09 11:27 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger
In-Reply-To: <1481282878-26176-1-git-send-email-bernard.iremonger@intel.com>

Use the the following ixgbe public functions:

rte_pmd_ixgbe_set_vf_rate_limit
rte_pmd_ixgbe_set_vf_rx
rte_pmd_ixgbe_set_vf_rxmode
rte_pmd_ixgbe_set_vf_tx
rte_pmd_ixgbe_set_vf_vlan_filter

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/cmdline.c |  2 +-
 app/test-pmd/config.c  | 31 +++++++++++--------------------
 2 files changed, 12 insertions(+), 21 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index d03a592..12f799b 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -6708,7 +6708,7 @@ cmd_set_vf_rxmode_parsed(void *parsed_result,
 			rx_mode |= ETH_VMDQ_ACCEPT_MULTICAST;
 	}
 
-	ret = rte_eth_dev_set_vf_rxmode(res->port_id,res->vf_id,rx_mode,(uint8_t)is_on);
+	ret = rte_pmd_ixgbe_set_vf_rxmode(res->port_id, res->vf_id, rx_mode, (uint8_t)is_on);
 	if (ret < 0)
 		printf("bad VF receive mode parameter, return code = %d \n",
 		ret);
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 8cf537d..ea129db 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -92,6 +92,9 @@
 #include <rte_ethdev.h>
 #include <rte_string_fns.h>
 #include <rte_cycles.h>
+#ifdef RTE_LIBRTE_IXGBE_PMD
+#include <rte_pmd_ixgbe.h>
+#endif
 
 #include "testpmd.h"
 
@@ -2332,16 +2335,16 @@ set_vf_traffic(portid_t port_id, uint8_t is_rx, uint16_t vf, uint8_t on)
 	if (port_id_is_invalid(port_id, ENABLED_WARN))
 		return;
 	if (is_rx)
-		diag = rte_eth_dev_set_vf_rx(port_id,vf,on);
+		diag = rte_pmd_ixgbe_set_vf_rx(port_id, vf, on);
 	else
-		diag = rte_eth_dev_set_vf_tx(port_id,vf,on);
+		diag = rte_pmd_ixgbe_set_vf_tx(port_id, vf, on);
 	if (diag == 0)
 		return;
 	if(is_rx)
-		printf("rte_eth_dev_set_vf_rx for port_id=%d failed "
+		printf("rte_pmd_ixgbe_set_vf_rx for port_id=%d failed "
 	       		"diag=%d\n", port_id, diag);
 	else
-		printf("rte_eth_dev_set_vf_tx for port_id=%d failed "
+		printf("rte_pmd_ixgbe_set_vf_tx for port_id=%d failed "
 	       		"diag=%d\n", port_id, diag);
 
 }
@@ -2355,10 +2358,10 @@ set_vf_rx_vlan(portid_t port_id, uint16_t vlan_id, uint64_t vf_mask, uint8_t on)
 		return;
 	if (vlan_id_is_invalid(vlan_id))
 		return;
-	diag = rte_eth_dev_set_vf_vlan_filter(port_id, vlan_id, vf_mask, on);
+	diag = rte_pmd_ixgbe_set_vf_vlan_filter(port_id, vlan_id, vf_mask, on);
 	if (diag == 0)
 		return;
-	printf("rte_eth_dev_set_vf_vlan_filter for port_id=%d failed "
+	printf("rte_pmd_ixgbe_set_vf_vlan_filter for port_id=%d failed "
 	       "diag=%d\n", port_id, diag);
 }
 
@@ -2388,23 +2391,11 @@ int
 set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate, uint64_t q_msk)
 {
 	int diag;
-	struct rte_eth_link link;
-
-	if (q_msk == 0)
-		return 0;
 
-	if (port_id_is_invalid(port_id, ENABLED_WARN))
-		return 1;
-	rte_eth_link_get_nowait(port_id, &link);
-	if (rate > link.link_speed) {
-		printf("Invalid rate value:%u bigger than link speed: %u\n",
-			rate, link.link_speed);
-		return 1;
-	}
-	diag = rte_eth_set_vf_rate_limit(port_id, vf, rate, q_msk);
+	diag = rte_pmd_ixgbe_set_vf_rate_limit(port_id, vf, rate, q_msk);
 	if (diag == 0)
 		return diag;
-	printf("rte_eth_set_vf_rate_limit for port_id=%d failed diag=%d\n",
+	printf("rte_pmd_ixgbe_set_vf_rate_limit for port_id=%d failed diag=%d\n",
 		port_id, diag);
 	return diag;
 }
-- 
2.10.1

^ permalink raw reply related

* [PATCH v1 3/5] app/testpmd: add command for set VF VLAN filter
From: Bernard Iremonger @ 2016-12-09 11:27 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger
In-Reply-To: <1481282878-26176-1-git-send-email-bernard.iremonger@intel.com>

Add the following command to testpmd:
set vf vlan filter <port_id> <vlan_id> <vf_mask> <on|off>

Add command to the testpmd user guide.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/cmdline.c                      | 98 +++++++++++++++++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 +++
 2 files changed, 105 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 12f799b..3603526 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -291,6 +291,9 @@ static void cmd_help_long_parsed(void *parsed_result,
 
 			"set vf vlan antispoof (port_id) (vf_id) (on|off)\n"
 			"    Set VLAN antispoof for a VF from the PF.\n\n"
+
+			"set vf vlan filter (port_id) (vlan_id) (vf_mask) (on|off)\n"
+			"    Set VLAN filter for a VF pool from the PF.\n\n"
 #endif
 
 			"vlan set filter (on|off) (port_id)\n"
@@ -11139,6 +11142,100 @@ cmdline_parse_inst_t cmd_set_vf_vlan_insert = {
 	},
 };
 
+
+/* vf vlan filter configuration */
+
+/* Common result structure for vf vlan filter */
+struct cmd_vf_vlan_filter_result {
+	cmdline_fixed_string_t set;
+	cmdline_fixed_string_t vf;
+	cmdline_fixed_string_t vlan;
+	cmdline_fixed_string_t filter;
+	uint8_t port_id;
+	uint16_t vlan_id;
+	uint16_t vf_mask;
+	cmdline_fixed_string_t on_off;
+};
+
+/* Common CLI fields for vf vlan filter enable disable */
+cmdline_parse_token_string_t cmd_vf_vlan_filter_set =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 set, "set");
+cmdline_parse_token_string_t cmd_vf_vlan_filter_vf =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 vf, "vf");
+cmdline_parse_token_string_t cmd_vf_vlan_filter_vlan =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 vlan, "vlan");
+cmdline_parse_token_string_t cmd_vf_vlan_filter_filter =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 filter, "filter");
+cmdline_parse_token_num_t cmd_vf_vlan_filter_port_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 port_id, UINT8);
+cmdline_parse_token_num_t cmd_vf_vlan_filter_vlan_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 vlan_id, UINT16);
+cmdline_parse_token_num_t cmd_vf_vlan_filter_vf_mask =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 vf_mask, UINT16);
+cmdline_parse_token_string_t cmd_vf_vlan_filter_on_off =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 on_off, "on#off");
+
+static void
+cmd_set_vf_vlan_filter_parsed(
+	void *parsed_result,
+	__attribute__((unused)) struct cmdline *cl,
+	__attribute__((unused)) void *data)
+{
+	struct cmd_vf_vlan_filter_result *res = parsed_result;
+	int ret;
+	int is_on = (strcmp(res->on_off, "on") == 0) ? 1 : 0;
+
+	ret = rte_pmd_ixgbe_set_vf_vlan_filter(res->port_id, res->vlan_id, res->vf_mask, is_on);
+	switch (ret) {
+	case 0:
+		break;
+	case -EINVAL:
+		printf("invalid vf_mask %d or vlan_id %d\n", res->vf_mask, res->vlan_id);
+		break;
+	case -ENODEV:
+		printf("invalid port_id %d\n", res->port_id);
+		break;
+	case -ENOTSUP:
+		printf("not supported on vf port %d\n", res->port_id);
+		break;
+	default:
+		printf("programming error: (%s)\n", strerror(-ret));
+	}
+}
+
+cmdline_parse_inst_t cmd_set_vf_vlan_filter = {
+	.f = cmd_set_vf_vlan_filter_parsed,
+	.data = NULL,
+	.help_str = "set vf vlan filter <port_id> <vlan_id> <vf_mask> <on_off>",
+	.tokens = {
+		(void *)&cmd_vf_vlan_filter_set,
+		(void *)&cmd_vf_vlan_filter_vf,
+		(void *)&cmd_vf_vlan_filter_vlan,
+		(void *)&cmd_vf_vlan_filter_filter,
+		(void *)&cmd_vf_vlan_filter_port_id,
+		(void *)&cmd_vf_vlan_filter_vlan_id,
+		(void *)&cmd_vf_vlan_filter_vf_mask,
+		(void *)&cmd_vf_vlan_filter_on_off,
+		NULL,
+	},
+};
+
 /* tx loopback configuration */
 
 /* Common result structure for tx loopback */
@@ -11620,6 +11717,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_set_vf_mac_anti_spoof,
 	(cmdline_parse_inst_t *)&cmd_set_vf_vlan_stripq,
 	(cmdline_parse_inst_t *)&cmd_set_vf_vlan_insert,
+	(cmdline_parse_inst_t *)&cmd_set_vf_vlan_filter,
 	(cmdline_parse_inst_t *)&cmd_set_tx_loopback,
 	(cmdline_parse_inst_t *)&cmd_set_all_queues_drop_en,
 	(cmdline_parse_inst_t *)&cmd_set_vf_split_drop_en,
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index f1c269a..60dcd91 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -535,6 +535,13 @@ Set VLAN insert for a VF from the PF::
 
    testpmd> set vf vlan insert (port_id) (vf_id) (vlan_id)
 
+vlan set filter (for VF pool)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set VLAN filter for a VF pool from the PF::
+
+   testpmd> set vf vlan filter (port_id) (vlan_id) (vf_mask) (on|off)
+
 vlan set antispoof (for VF)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-- 
2.10.1

^ permalink raw reply related

* [PATCH v1 4/5] app/testpmd: add command for set VF receive
From: Bernard Iremonger @ 2016-12-09 11:27 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger
In-Reply-To: <1481282878-26176-1-git-send-email-bernard.iremonger@intel.com>

add the following command to testpmd:

set vf rx <port_id> <vf_id> <on|off>

add command to the testpmd user guide.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/cmdline.c                      | 85 +++++++++++++++++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 +++
 2 files changed, 92 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 3603526..4605ee2 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -274,6 +274,9 @@ static void cmd_help_long_parsed(void *parsed_result,
 
 			"set vf mac antispoof (port_id) (vf_id) (on|off).\n"
 			"    Set MAC antispoof for a VF from the PF.\n\n"
+
+			"set vf rx (port_id) (vf_id) (on|off).\n"
+			"    Enable or disable RX for a VF from the PF.\n\n"
 #endif
 
 			"vlan set strip (on|off) (port_id)\n"
@@ -11236,6 +11239,87 @@ cmdline_parse_inst_t cmd_set_vf_vlan_filter = {
 	},
 };
 
+/* vf rx configuration */
+
+/* Common result structure for vf rx */
+struct cmd_vf_rx_result {
+	cmdline_fixed_string_t set;
+	cmdline_fixed_string_t vf;
+	cmdline_fixed_string_t rx;
+	uint8_t port_id;
+	uint16_t vf_id;
+	cmdline_fixed_string_t on_off;
+};
+
+/* Common CLI fields for vf rx enable disable */
+cmdline_parse_token_string_t cmd_vf_rx_set =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_rx_result,
+		 set, "set");
+cmdline_parse_token_string_t cmd_vf_rx_vf =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_rx_result,
+		 vf, "vf");
+cmdline_parse_token_string_t cmd_vf_rx_rx =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_rx_result,
+		 rx, "rx");
+cmdline_parse_token_num_t cmd_vf_rx_port_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_rx_result,
+		 port_id, UINT8);
+cmdline_parse_token_num_t cmd_vf_rx_vf_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_rx_result,
+		 vf_id, UINT16);
+cmdline_parse_token_string_t cmd_vf_rx_on_off =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_rx_result,
+		 on_off, "on#off");
+
+static void
+cmd_set_vf_rx_parsed(
+	void *parsed_result,
+	__attribute__((unused)) struct cmdline *cl,
+	__attribute__((unused)) void *data)
+{
+	struct cmd_vf_rx_result *res = parsed_result;
+	int ret = 0;
+	int is_on = (strcmp(res->on_off, "on") == 0) ? 1 : 0;
+
+	ret = rte_pmd_ixgbe_set_vf_rx(res->port_id, res->vf_id, is_on);
+	switch (ret) {
+	case 0:
+		break;
+	case -EINVAL:
+		printf("invalid vf_id %d or is_on %d\n", res->vf_id, is_on);
+		break;
+	case -ENODEV:
+		printf("invalid port_id %d\n", res->port_id);
+		break;
+	case -ENOTSUP:
+		printf("not supported on vf port %d\n", res->port_id);
+		break;
+	default:
+		printf("programming error: (%s)\n", strerror(-ret));
+	}
+}
+
+cmdline_parse_inst_t cmd_set_vf_rx = {
+	.f = cmd_set_vf_rx_parsed,
+	.data = NULL,
+	.help_str = "set vf rx <port_id> <vf_id> <on|off>",
+	.tokens = {
+		(void *)&cmd_vf_rx_set,
+		(void *)&cmd_vf_rx_vf,
+		(void *)&cmd_vf_rx_rx,
+		(void *)&cmd_vf_rx_port_id,
+		(void *)&cmd_vf_rx_vf_id,
+		(void *)&cmd_vf_rx_on_off,
+		NULL,
+	},
+};
+
 /* tx loopback configuration */
 
 /* Common result structure for tx loopback */
@@ -11722,6 +11806,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_set_all_queues_drop_en,
 	(cmdline_parse_inst_t *)&cmd_set_vf_split_drop_en,
 	(cmdline_parse_inst_t *)&cmd_set_vf_mac_addr,
+	(cmdline_parse_inst_t *)&cmd_set_vf_rx,
 #endif
 	NULL,
 };
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 60dcd91..6a058e9 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -507,6 +507,13 @@ Set mac antispoof for a VF from the PF::
 
    testpmd> set vf mac antispoof  (port_id) (vf_id) (on|off)
 
+set rx (for VF)
+~~~~~~~~~~~~~~~
+
+Enable/disable rx for a VF from the PF::
+
+   testpmd> set vf rx (port_id) (vf_id) (on|off)
+
 vlan set strip
 ~~~~~~~~~~~~~~
 
-- 
2.10.1

^ permalink raw reply related

* [PATCH v1 5/5] app/testpmd: add command for set VF transmit
From: Bernard Iremonger @ 2016-12-09 11:27 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger
In-Reply-To: <1481282878-26176-1-git-send-email-bernard.iremonger@intel.com>

add the following command to testpmd:

set vf tx <port_id> <vf_id> <on|off>

add command to the testpmd user guide.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/cmdline.c                      | 85 +++++++++++++++++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 +++
 2 files changed, 92 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 4605ee2..e813b24 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -277,6 +277,9 @@ static void cmd_help_long_parsed(void *parsed_result,
 
 			"set vf rx (port_id) (vf_id) (on|off).\n"
 			"    Enable or disable RX for a VF from the PF.\n\n"
+
+			"set vf tx (port_id) (vf_id) (on|off).\n"
+			"    Enable or disable TX for a VF from the PF.\n\n"
 #endif
 
 			"vlan set strip (on|off) (port_id)\n"
@@ -11320,6 +11323,87 @@ cmdline_parse_inst_t cmd_set_vf_rx = {
 	},
 };
 
+/* vf tx configuration */
+
+/* Common result structure for vf tx */
+struct cmd_vf_tx_result {
+	cmdline_fixed_string_t set;
+	cmdline_fixed_string_t vf;
+	cmdline_fixed_string_t tx;
+	uint8_t port_id;
+	uint16_t vf_id;
+	cmdline_fixed_string_t on_off;
+};
+
+/* Common CLI fields for vf tx enable disable */
+cmdline_parse_token_string_t cmd_vf_tx_set =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_tx_result,
+		 set, "set");
+cmdline_parse_token_string_t cmd_vf_tx_vf =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_tx_result,
+		 vf, "vf");
+cmdline_parse_token_string_t cmd_vf_tx_tx =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_tx_result,
+		 tx, "tx");
+cmdline_parse_token_num_t cmd_vf_tx_port_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_tx_result,
+		 port_id, UINT8);
+cmdline_parse_token_num_t cmd_vf_tx_vf_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_tx_result,
+		 vf_id, UINT16);
+cmdline_parse_token_string_t cmd_vf_tx_on_off =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_tx_result,
+		 on_off, "on#off");
+
+static void
+cmd_set_vf_tx_parsed(
+	void *parsed_result,
+	__attribute__((unused)) struct cmdline *cl,
+	__attribute__((unused)) void *data)
+{
+	struct cmd_vf_tx_result *res = parsed_result;
+	int ret = 0;
+	int is_on = (strcmp(res->on_off, "on") == 0) ? 1 : 0;
+
+	ret = rte_pmd_ixgbe_set_vf_tx(res->port_id, res->vf_id, is_on);
+	switch (ret) {
+	case 0:
+		break;
+	case -EINVAL:
+		printf("invalid vf_id %d or is_on %d\n", res->vf_id, is_on);
+		break;
+	case -ENODEV:
+		printf("invalid port_id %d\n", res->port_id);
+		break;
+	case -ENOTSUP:
+		printf("not supported on vf port %d\n", res->port_id);
+		break;
+	default:
+		printf("programming error: (%s)\n", strerror(-ret));
+	}
+}
+
+cmdline_parse_inst_t cmd_set_vf_tx = {
+	.f = cmd_set_vf_tx_parsed,
+	.data = NULL,
+	.help_str = "set vf tx <port_id> <vf_id> <on|off>",
+	.tokens = {
+		(void *)&cmd_vf_tx_set,
+		(void *)&cmd_vf_tx_vf,
+		(void *)&cmd_vf_tx_tx,
+		(void *)&cmd_vf_tx_port_id,
+		(void *)&cmd_vf_tx_vf_id,
+		(void *)&cmd_vf_tx_on_off,
+		NULL,
+	},
+};
+
 /* tx loopback configuration */
 
 /* Common result structure for tx loopback */
@@ -11807,6 +11891,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_set_vf_split_drop_en,
 	(cmdline_parse_inst_t *)&cmd_set_vf_mac_addr,
 	(cmdline_parse_inst_t *)&cmd_set_vf_rx,
+	(cmdline_parse_inst_t *)&cmd_set_vf_tx,
 #endif
 	NULL,
 };
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 6a058e9..1de4c5f 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -514,6 +514,13 @@ Enable/disable rx for a VF from the PF::
 
    testpmd> set vf rx (port_id) (vf_id) (on|off)
 
+set tx (for VF)
+~~~~~~~~~~~~~~~
+
+Enable/disable tx for a VF from the PF::
+
+   testpmd> set vf tx (port_id) (vf_id) (on|off)
+
 vlan set strip
 ~~~~~~~~~~~~~~
 
-- 
2.10.1

^ permalink raw reply related

* Re: [PATCH] nfp: add doc about supported features
From: Ferruh Yigit @ 2016-12-09 11:36 UTC (permalink / raw)
  To: Alejandro Lucero; +Cc: Mcnamara, John, dev@dpdk.org
In-Reply-To: <CAD+H991h-6rL7TBcP2hvuAWSvRanzSvqjOEp2rqw4SqPsww82Q@mail.gmail.com>

On 12/9/2016 10:00 AM, Alejandro Lucero wrote:
> That's fine.

Applied to dpdk-next-net/master, thanks.

> 
> Thank you
> 
> On Tue, Dec 6, 2016 at 4:01 PM, Ferruh Yigit <ferruh.yigit@intel.com
> <mailto:ferruh.yigit@intel.com>> wrote:
> 
>     On 12/6/2016 2:51 PM, Alejandro Lucero wrote:
>     > Then I guess I should send another version of this patch.
> 
>     I can also update the patch while applying, if you agree with following
>     content (simply just all =N removed):
> 
>      [Features]
>     +SR-IOV               = Y
>     +Link status          = Y
>     +Link status event    = Y
>     +Queue start/stop     = Y
>     +MTU update           = Y
>     +Jumbo frame          = Y
>     +RSS hash             = Y
>     +RSS key update       = Y
>     +RSS reta update      = Y
>     +Flow control         = Y
>     +VLAN offload         = Y
>     +L3 checksum offload  = Y
>     +L4 checksum offload  = Y
>     +Promiscuous mode     = Y
>     +Basic stats          = Y
>     +Stats per queue      = Y
>     +Linux UIO            = Y
>     +Linux VFIO           = Y
>     +x86-64               = Y
>     +Usage doc            = Y
> 
> 
> 

^ permalink raw reply

* Re: [PATCH v2] doc: fix mistakes in contribution guide
From: Mcnamara, John @ 2016-12-09 11:53 UTC (permalink / raw)
  To: Yong Wang; +Cc: dev@dpdk.org
In-Reply-To: <1481284349-12481-1-git-send-email-wang.yong19@zte.com.cn>



> -----Original Message-----
> From: Yong Wang [mailto:wang.yong19@zte.com.cn]
> Sent: Friday, December 9, 2016 11:52 AM
> To: Mcnamara, John <john.mcnamara@intel.com>
> Cc: dev@dpdk.org; Yong Wang <wang.yong19@zte.com.cn>
> Subject: [PATCH v2] doc: fix mistakes in contribution guide
> 
> Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
> ---
> v2:
> * modify some redundant descriptions.


Thanks,


Acked-by: John McNamara <john.mcnamara@intel.com>

^ permalink raw reply

* Re: [PATCH v1 0/5] net/ixgbe: move set VF functions.
From: Ferruh Yigit @ 2016-12-09 11:54 UTC (permalink / raw)
  To: Bernard Iremonger, thomas.monjalon, dev
In-Reply-To: <1481282878-26176-1-git-send-email-bernard.iremonger@intel.com>

On 12/9/2016 11:27 AM, Bernard Iremonger wrote:
> This patchset implements the following deprecation notice:
> [PATCH v1] doc: announce API and ABI change for librte_ether
> 
> The following functions from eth_dev_ops have been moved to the ixgbe PMD
> and renamed:
> 
> ixgbe_set_pool_rx_mode
> ixgbe_set_pool_rx
> ixgbe_set_pool_tx
> ixgbe_set_pool_vlan_filter
> ixgbe_set_vf_rate_limit
> 
> Renamed the functions to the following:
> 
> rte_pmd_ixgbe_set_vf_rxmode
> rte_pmd_ixgbe_set_vf_rx
> rte_pmd_ixgbe_set_vf_tx
> rte_pmd_ixgbe_set_vf_vlan_filter
> rte_pmd_ixgbe_set_vf_rate_limit
> 
> Testpmd has been modified to use the following functions:
> rte_pmd_ixgbe_set_vf_rxmode
> rte_pmd_ixgbe_set_vf_rate_limit
> 
> New testpmd commands have been added to test the following functions:
> rte_pmd_ixgbe_set_vf_rx
> rte_pmd_ixgbe_set_vf_tx
> rte_pmd_ixgbe_set_vf_vlan_filter
> 
> The testpmd user guide has been updated for the new commands.
> 
> Bernard Iremonger (5):
>   net/ixgbe: move set VF functions from the ethdev
>   app/testpmd: use ixgbe public functions
>   app/testpmd: add command for set VF VLAN filter
>   app/testpmd: add command for set VF receive
>   app/testpmd: add command for set VF transmit
> 
>  app/test-pmd/cmdline.c                      | 270 +++++++++++++++++++++++++++-
>  app/test-pmd/config.c                       |  31 ++--
>  doc/guides/testpmd_app_ug/testpmd_funcs.rst |  21 +++
>  drivers/net/ixgbe/ixgbe_ethdev.c            | 263 +++++++++++++++++++++++++++
>  drivers/net/ixgbe/rte_pmd_ixgbe.h           | 104 +++++++++++
>  drivers/net/ixgbe/rte_pmd_ixgbe_version.map |  10 ++
>  6 files changed, 678 insertions(+), 21 deletions(-)
> 

Why this patchset doesn't remove ethdev updates for these functions?

ixgbe is the only user for these eth-dev_ops, since code moved to ixgbe
driver, they and relevant rte_eth_xx functions (and deprecation notice)
can be removed in this patchset. Most probably after testpmd updated to
prevent compilation errors.

^ permalink raw reply

* Re: [PATCH v1 2/5] app/testpmd: use ixgbe public functions
From: Ferruh Yigit @ 2016-12-09 11:56 UTC (permalink / raw)
  To: Bernard Iremonger, thomas.monjalon, dev
In-Reply-To: <1481282878-26176-3-git-send-email-bernard.iremonger@intel.com>

On 12/9/2016 11:27 AM, Bernard Iremonger wrote:
> Use the the following ixgbe public functions:
> 
> rte_pmd_ixgbe_set_vf_rate_limit
> rte_pmd_ixgbe_set_vf_rx
> rte_pmd_ixgbe_set_vf_rxmode
> rte_pmd_ixgbe_set_vf_tx
> rte_pmd_ixgbe_set_vf_vlan_filter
> 
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>

<...>

> @@ -2388,23 +2391,11 @@ int
>  set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate, uint64_t q_msk)
>  {
>  	int diag;
> -	struct rte_eth_link link;
> -
> -	if (q_msk == 0)
> -		return 0;
>  
> -	if (port_id_is_invalid(port_id, ENABLED_WARN))
> -		return 1;
> -	rte_eth_link_get_nowait(port_id, &link);
> -	if (rate > link.link_speed) {
> -		printf("Invalid rate value:%u bigger than link speed: %u\n",
> -			rate, link.link_speed);
> -		return 1;
> -	}

Why these changes required? Isn't only change is location and naming of
the ...set_vf_rate_limit() ?

> -	diag = rte_eth_set_vf_rate_limit(port_id, vf, rate, q_msk);
> +	diag = rte_pmd_ixgbe_set_vf_rate_limit(port_id, vf, rate, q_msk);
>  	if (diag == 0)
>  		return diag;
> -	printf("rte_eth_set_vf_rate_limit for port_id=%d failed diag=%d\n",
> +	printf("rte_pmd_ixgbe_set_vf_rate_limit for port_id=%d failed diag=%d\n",
>  		port_id, diag);
>  	return diag;
>  }
> 

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox