Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Aug 2023 21:51:42 +0200
From:      Vincenzo Maffione <v.maffione@gmail.com>
To:        PAVEL POPA <pavel.popa@edu.unife.it>
Cc:        freebsd-net@freebsd.org
Subject:   Re: About IFLIB compliant network device driver development
Message-ID:  <CA%2B_eA9iOHas3yJFobkKn4DY4eoqf%2BTXmfmcAz6Uf4eJ52sBhVA@mail.gmail.com>
In-Reply-To: <CAMeLQE%2B7E1g1Yi58qv=_of1bbABosFa_ZzOMdmA_A5uBGiG%2Bjg@mail.gmail.com>
References:  <CAMeLQE%2B7E1g1Yi58qv=_of1bbABosFa_ZzOMdmA_A5uBGiG%2Bjg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--0000000000002fa14106043d60aa
Content-Type: text/plain; charset="UTF-8"

Hi,
  I think it's pretty common nowadays to have NICs with completion
rings/queues. It is definitely appropriate to implement such drivers with
iflib, and indeed iflib provides separate callbacks for updating the TX/RX
"submission" and "completion" queues:

   - ift_txd_encap: submit a packet to a TX ring (or submission queue)
   - ift_txd_flush: flush submitted TX descriptors to the hardware.
   - ift_txd_credits_update: check the completion queue (or reclaim
   completed descriptor from the TX ring).
   - ift_rxd_refill: submit RX descriptors to a RX ring (or submission
   queue)
   - ift_rxd_flush: flush submitted RX descriptors to the NIC hardware.
   - ift_rxd_pkt_get: get a received packet from the completion queue (or
   reclaim completed descriptor from the RX ring)
   - ...

If you want to look at an example of iflib driver using completion queues,
you can check out sys/dev/vmware/vmxnet3/.

It's actually a pretty complex example because vmxnet3 is a complex
paravirtualized device with multiple versions etc..
However, the complexity does not come from the completion rings...

Cheers,
  Vincenzo



Il giorno mer 30 ago 2023 alle ore 15:58 PAVEL POPA <pavel.popa@edu.unife.it>
ha scritto:

> I have a NIC (a SmartNIC actually) for which I have to implement a
> driver, which in addition to RX and TX rings exposes also completion
> CMPT rings. Due to this additional complication (the CMPT rings), I'm
> not sure how appropriate it is to implement such a driver via the
> IFLIB framework. Does anyone have any similar experience that can
> share? Any suggestions at all, ideas, feedbacks?
>
> Thanks in advance,
> Pavel
>
>

-- 
Vincenzo

--0000000000002fa14106043d60aa
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi,</div><div>=C2=A0 I think it&#39;s pretty common n=
owadays to have NICs with completion rings/queues. It is definitely appropr=
iate to implement such drivers with iflib, and indeed iflib provides separa=
te callbacks for updating the TX/RX &quot;submission&quot; and &quot;comple=
tion&quot; queues:</div><div><ul><li>ift_txd_encap: submit a packet to a TX=
 ring (or submission queue)<br></li><li>ift_txd_flush: flush submitted TX d=
escriptors to the hardware.</li><li>ift_txd_credits_update: check the compl=
etion queue (or reclaim completed descriptor from the TX ring).</li><li>ift=
_rxd_refill: submit RX descriptors to a RX ring (or submission queue)</li><=
li>ift_rxd_flush: flush submitted RX descriptors to the NIC hardware.<br></=
li><li>ift_rxd_pkt_get: get a received packet from the completion queue (or=
 reclaim completed descriptor from the RX ring)</li><li>...</li></ul><div>I=
f you want to look at an example of iflib driver using completion queues, y=
ou can check out sys/dev/vmware/vmxnet3/.</div><div><br></div><div>It&#39;s=
 actually a pretty complex example because vmxnet3 is a complex paravirtual=
ized device with multiple versions etc..</div><div>However, the complexity =
does not come from the completion rings...</div><div><br></div><div>Cheers,=
</div><div>=C2=A0 Vincenzo<br></div><div><br></div></div><div><br></div></d=
iv><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">Il =
giorno mer 30 ago 2023 alle ore 15:58 PAVEL POPA &lt;<a href=3D"mailto:pave=
l.popa@edu.unife.it">pavel.popa@edu.unife.it</a>&gt; ha scritto:<br></div><=
blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l=
eft:1px solid rgb(204,204,204);padding-left:1ex">I have a NIC (a SmartNIC a=
ctually) for which I have to implement a<br>
driver, which in addition to RX and TX rings exposes also completion<br>
CMPT rings. Due to this additional complication (the CMPT rings), I&#39;m<b=
r>
not sure how appropriate it is to implement such a driver via the<br>
IFLIB framework. Does anyone have any similar experience that can<br>
share? Any suggestions at all, ideas, feedbacks?<br>
<br>
Thanks in advance,<br>
Pavel<br>
<br>
</blockquote></div><br clear=3D"all"><br><span class=3D"gmail_signature_pre=
fix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signature"><div dir=3D"l=
tr"><div>Vincenzo<br></div></div></div>

--0000000000002fa14106043d60aa--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2B_eA9iOHas3yJFobkKn4DY4eoqf%2BTXmfmcAz6Uf4eJ52sBhVA>