public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* reg: PCD To Control MNP Buffer Recycle Support
@ 2020-11-24 14:30 Sivaraman Nainar
  2020-11-26 15:39 ` [edk2-devel] " Maciej Rabeda
  0 siblings, 1 reply; 4+ messages in thread
From: Sivaraman Nainar @ 2020-11-24 14:30 UTC (permalink / raw)
  To: devel@edk2.groups.io; +Cc: Rabeda, Maciej

[-- Attachment #1: Type: text/plain, Size: 545 bytes --]

Hello all:

MNPDxe supported with the Recycle buffer support from the below git commit,

https://github.com/tianocore/edk2/commit/0507449955c5c629cec196b62986afbb91203ed9#diff-fb5b97ad38efea22f5ddd745f6e43ebdb509dc4a5aef81997ba53af5f918a47b

But many network controllers does not support the Recycling Tx Buffers which will cause the PXE Download failure or HTTP Boot failure.

Can this feature can be controlled by a Dynamic PCD so that the same code can work for controller which does not support Tx Buffer Recycling.

Thanks
Siva

[-- Attachment #2: Type: text/html, Size: 2795 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [edk2-devel] reg: PCD To Control MNP Buffer Recycle Support
  2020-11-24 14:30 reg: PCD To Control MNP Buffer Recycle Support Sivaraman Nainar
@ 2020-11-26 15:39 ` Maciej Rabeda
  2020-11-26 16:20   ` Sivaraman Nainar
  0 siblings, 1 reply; 4+ messages in thread
From: Maciej Rabeda @ 2020-11-26 15:39 UTC (permalink / raw)
  To: devel, sivaramann

[-- Attachment #1: Type: text/plain, Size: 1874 bytes --]

Hi Nainar,

What do you mean by "controllers do not support recycling of Tx buffers"?
MNP provides a transmit buffer to SNP (and with EDK2's SNP also to UNDI) 
and at this point it is considered owned by SNP/UNDI.
After UNDI/SNP successfully transmits the packet, it is expected to give 
it back via UNDI->GetStatus().

Adding network controller (NIC) and UNDI into the picture.

1. UNDI->Transmit() gets a single Tx buffer to put on the wire.
2. If a NIC has a pre-allocated region for Tx buffers and cannot 
dynamically swap them out, UNDI->Transmit() should copy the Tx buffer 
into appropriate region. UNDI driver should also store that Tx buffer 
somewhere within the driver, where it will be accessible by 
UNDI->GetStatus() function.
3. After successful transmit of Tx buffer, on next UNDI->GetStatus() 
with PXE_OPFLAGS_GET_TRANSMITTED_BUFFERS OpFlag, driver should put that 
Tx buffer address in PXE_CDB.DBAddr provided to UNDI->GetStatus() as a 
parameter.

Summing the above - Tx buffer recycling is purely a SW feature. I do not 
understand your request nor find it valid.

Thanks,
Maciej

On 24-Nov-20 15:30, Sivaraman Nainar wrote:
>
> Hello all:
>
> MNPDxe supported with the Recycle buffer support from the below git 
> commit,
>
> https://github.com/tianocore/edk2/commit/0507449955c5c629cec196b62986afbb91203ed9#diff-fb5b97ad38efea22f5ddd745f6e43ebdb509dc4a5aef81997ba53af5f918a47b 
> <https://github.com/tianocore/edk2/commit/0507449955c5c629cec196b62986afbb91203ed9#diff-fb5b97ad38efea22f5ddd745f6e43ebdb509dc4a5aef81997ba53af5f918a47b>
>
> But many network controllers does not support the Recycling Tx Buffers 
> which will cause the PXE Download failure or HTTP Boot failure.
>
> Can this feature can be controlled by a Dynamic PCD so that the same 
> code can work for controller which does not support Tx Buffer Recycling.
>
> Thanks
>
> Siva
>
> 


[-- Attachment #2: Type: text/html, Size: 4264 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [edk2-devel] reg: PCD To Control MNP Buffer Recycle Support
  2020-11-26 15:39 ` [edk2-devel] " Maciej Rabeda
@ 2020-11-26 16:20   ` Sivaraman Nainar
  2020-12-03 13:18     ` Maciej Rabeda
  0 siblings, 1 reply; 4+ messages in thread
From: Sivaraman Nainar @ 2020-11-26 16:20 UTC (permalink / raw)
  To: Rabeda, Maciej, devel@edk2.groups.io

[-- Attachment #1: Type: text/plain, Size: 3117 bytes --]

Hello Maciej:

As per the PXE Specification:
The protocol driver calls UNDI repeatedly with the FuncFlag equal to PXENV_UNDI_ISR_IN_GET_NEXT to get all the buffers in a frame and also all the received
frames in the queue. On this call, UNDI must remember the previous buffer given to the protoco,l remove it from the receive queue and recycle it. In case of a multi-buffered frame, if the previous
buffer is not the last buffer in the frame it must return the next buffer in the frame in the parameter block. Otherwise it must return the first buffer in the next frame.

Assume the UNDI Driver does not properly Store that TxAddress in the GetStatus then the possibility of MNP Layer having issues when it treats the recycling based on the GetStatus.
2. If a NIC has a pre-allocated region for Tx buffers and cannot dynamically swap them out, UNDI->Transmit() should copy the Tx buffer into appropriate region. UNDI driver should also store that Tx buffer somewhere within the driver, where it will be accessible by UNDI->GetStatus() function.

When this point 2 fails the Recycle support done in the SW Layer shall also fail.

Pleases correct my understanding if any .

-Siva
From: Rabeda, Maciej [mailto:maciej.rabeda@linux.intel.com]
Sent: Thursday, November 26, 2020 9:10 PM
To: devel@edk2.groups.io; Sivaraman Nainar
Subject: Re: [edk2-devel] reg: PCD To Control MNP Buffer Recycle Support

Hi Nainar,

What do you mean by "controllers do not support recycling of Tx buffers"?
MNP provides a transmit buffer to SNP (and with EDK2's SNP also to UNDI) and at this point it is considered owned by SNP/UNDI.
After UNDI/SNP successfully transmits the packet, it is expected to give it back via UNDI->GetStatus().

Adding network controller (NIC) and UNDI into the picture.

1. UNDI->Transmit() gets a single Tx buffer to put on the wire.
2. If a NIC has a pre-allocated region for Tx buffers and cannot dynamically swap them out, UNDI->Transmit() should copy the Tx buffer into appropriate region. UNDI driver should also store that Tx buffer somewhere within the driver, where it will be accessible by UNDI->GetStatus() function.
3. After successful transmit of Tx buffer, on next UNDI->GetStatus() with PXE_OPFLAGS_GET_TRANSMITTED_BUFFERS OpFlag, driver should put that Tx buffer address in PXE_CDB.DBAddr provided to UNDI->GetStatus() as a parameter.

Summing the above - Tx buffer recycling is purely a SW feature. I do not understand your request nor find it valid.

Thanks,
Maciej
On 24-Nov-20 15:30, Sivaraman Nainar wrote:
Hello all:

MNPDxe supported with the Recycle buffer support from the below git commit,

https://github.com/tianocore/edk2/commit/0507449955c5c629cec196b62986afbb91203ed9#diff-fb5b97ad38efea22f5ddd745f6e43ebdb509dc4a5aef81997ba53af5f918a47b

But many network controllers does not support the Recycling Tx Buffers which will cause the PXE Download failure or HTTP Boot failure.

Can this feature can be controlled by a Dynamic PCD so that the same code can work for controller which does not support Tx Buffer Recycling.

Thanks
Siva



[-- Attachment #2: Type: text/html, Size: 7609 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [edk2-devel] reg: PCD To Control MNP Buffer Recycle Support
  2020-11-26 16:20   ` Sivaraman Nainar
@ 2020-12-03 13:18     ` Maciej Rabeda
  0 siblings, 0 replies; 4+ messages in thread
From: Maciej Rabeda @ 2020-12-03 13:18 UTC (permalink / raw)
  To: devel, sivaramann

[-- Attachment #1: Type: text/plain, Size: 3714 bytes --]

You are referring to the wrong document (PXE 2.1 spec for 16-bit 
UNDIs/legacy BIOS).
Appendix E of UEFI specification defines UNDI functions, behaviors and 
supported opcodes in UEFI.

Thanks,
Maciej

On 26-Nov-20 17:20, Sivaraman Nainar wrote:
>
> Hello Maciej:
>
> *As per the PXE Specification: *
>
> The protocol driver calls UNDI repeatedly with the FuncFlag equal to 
> PXENV_UNDI_ISR_IN_GET_NEXT to get all the buffers in a frame and also 
> all the received
>
> frames in the queue. On this call, UNDI must remember the previous 
> buffer given to the protoco,l remove it from the receive queue and 
> recycle it. In case of a multi-buffered frame, if the previous
>
> buffer is not the last buffer in the frame it must return the next 
> buffer in the frame in the parameter block. Otherwise it must return 
> the first buffer in the next frame.
>
> Assume the UNDI Driver does not properly Store that TxAddress in the 
> GetStatus then the possibility of MNP Layer having issues when it 
> treats the recycling based on the GetStatus.
>
> 2. If a NIC has a pre-allocated region for Tx buffers and cannot 
> dynamically swap them out, UNDI->Transmit() should copy the Tx buffer 
> into appropriate region. UNDI driver should also store that Tx buffer 
> somewhere within the driver, where it will be accessible by 
> UNDI->GetStatus() function.
>
> When this point 2 fails the Recycle support done in the SW Layer shall 
> also fail.
>
> Pleases correct my understanding if any .
>
> -Siva
>
> *From:* Rabeda, Maciej [mailto:maciej.rabeda@linux.intel.com]
> *Sent:* Thursday, November 26, 2020 9:10 PM
> *To:* devel@edk2.groups.io; Sivaraman Nainar
> *Subject:* Re: [edk2-devel] reg: PCD To Control MNP Buffer Recycle Support
>
> Hi Nainar,
>
> What do you mean by "controllers do not support recycling of Tx buffers"?
> MNP provides a transmit buffer to SNP (and with EDK2's SNP also to 
> UNDI) and at this point it is considered owned by SNP/UNDI.
> After UNDI/SNP successfully transmits the packet, it is expected to 
> give it back via UNDI->GetStatus().
>
> Adding network controller (NIC) and UNDI into the picture.
>
> 1. UNDI->Transmit() gets a single Tx buffer to put on the wire.
> 2. If a NIC has a pre-allocated region for Tx buffers and cannot 
> dynamically swap them out, UNDI->Transmit() should copy the Tx buffer 
> into appropriate region. UNDI driver should also store that Tx buffer 
> somewhere within the driver, where it will be accessible by 
> UNDI->GetStatus() function.
> 3. After successful transmit of Tx buffer, on next UNDI->GetStatus() 
> with PXE_OPFLAGS_GET_TRANSMITTED_BUFFERS OpFlag, driver should put 
> that Tx buffer address in PXE_CDB.DBAddr provided to UNDI->GetStatus() 
> as a parameter.
>
> Summing the above - Tx buffer recycling is purely a SW feature. I do 
> not understand your request nor find it valid.
>
> Thanks,
> Maciej
>
> On 24-Nov-20 15:30, Sivaraman Nainar wrote:
>
>     Hello all:
>
>     MNPDxe supported with the Recycle buffer support from the below
>     git commit,
>
>     https://github.com/tianocore/edk2/commit/0507449955c5c629cec196b62986afbb91203ed9#diff-fb5b97ad38efea22f5ddd745f6e43ebdb509dc4a5aef81997ba53af5f918a47b
>     <https://github.com/tianocore/edk2/commit/0507449955c5c629cec196b62986afbb91203ed9#diff-fb5b97ad38efea22f5ddd745f6e43ebdb509dc4a5aef81997ba53af5f918a47b>
>
>     But many network controllers does not support the Recycling Tx
>     Buffers which will cause the PXE Download failure or HTTP Boot
>     failure.
>
>     Can this feature can be controlled by a Dynamic PCD so that the
>     same code can work for controller which does not support Tx Buffer
>     Recycling.
>
>     Thanks
>
>     Siva
>
> 


[-- Attachment #2: Type: text/html, Size: 9074 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-12-03 13:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-24 14:30 reg: PCD To Control MNP Buffer Recycle Support Sivaraman Nainar
2020-11-26 15:39 ` [edk2-devel] " Maciej Rabeda
2020-11-26 16:20   ` Sivaraman Nainar
2020-12-03 13:18     ` Maciej Rabeda

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