diff mbox

[PATCHv7,1/1] Need not push this patch to the upstream

Message ID 1405923752-3412-1-git-send-email-venkatesh.vivekanandan@linaro.org
State New
Headers show

Commit Message

Venkatesh Vivekanandan July 21, 2014, 6:22 a.m. UTC
From: Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org>

- Fix to give transmitted buffers back to buffer pool.
- If there are issues seen while sending traffic, ONLY then this patch
  has to be applied. Intention of this patch is to fix the traffic
  issue.

Signed-off-by: Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org>
---
 platform/linux-dpdk/odp_packet_io.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Maxim Uvarov July 21, 2014, 8:16 a.m. UTC | #1
I think this patch should be named differently.

Maxim.

On 07/21/2014 10:22 AM, venkatesh.vivekanandan@linaro.org wrote:
> From: Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org>
>
> - Fix to give transmitted buffers back to buffer pool.
> - If there are issues seen while sending traffic, ONLY then this patch
>    has to be applied. Intention of this patch is to fix the traffic
>    issue.
>
> Signed-off-by: Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org>
> ---
>   platform/linux-dpdk/odp_packet_io.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/platform/linux-dpdk/odp_packet_io.c b/platform/linux-dpdk/odp_packet_io.c
> index d8d127f..980a15c 100644
> --- a/platform/linux-dpdk/odp_packet_io.c
> +++ b/platform/linux-dpdk/odp_packet_io.c
> @@ -230,6 +230,9 @@ int odp_pktio_recv(odp_pktio_t id, odp_packet_t pkt_table[], unsigned len)
>   	if (pktio_entry == NULL)
>   		return -1;
>   
> +	if (pktio_entry->s.params.type == ODP_PKTIO_TYPE_DPDK)
> +		odp_pktio_send(id, pkt_table, 0);
> +
>   	lock_entry(pktio_entry);
>   	pkts = recv_pkt_dpdk(&pktio_entry->s.pkt_dpdk, pkt_table, len);
>   	unlock_entry(pktio_entry);
Venkatesh Vivekanandan July 23, 2014, 11:31 a.m. UTC | #2
As this is just a temporary fix, it is ok to leave it this way. Please let
me know if there is any specific information presence in the subject.

Venky


On 21 July 2014 13:46, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:

> I think this patch should be named differently.
>
> Maxim.
>
>
> On 07/21/2014 10:22 AM, venkatesh.vivekanandan@linaro.org wrote:
>
>> From: Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org>
>>
>> - Fix to give transmitted buffers back to buffer pool.
>> - If there are issues seen while sending traffic, ONLY then this patch
>>    has to be applied. Intention of this patch is to fix the traffic
>>    issue.
>>
>> Signed-off-by: Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org>
>> ---
>>   platform/linux-dpdk/odp_packet_io.c | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/platform/linux-dpdk/odp_packet_io.c
>> b/platform/linux-dpdk/odp_packet_io.c
>> index d8d127f..980a15c 100644
>> --- a/platform/linux-dpdk/odp_packet_io.c
>> +++ b/platform/linux-dpdk/odp_packet_io.c
>> @@ -230,6 +230,9 @@ int odp_pktio_recv(odp_pktio_t id, odp_packet_t
>> pkt_table[], unsigned len)
>>         if (pktio_entry == NULL)
>>                 return -1;
>>   +     if (pktio_entry->s.params.type == ODP_PKTIO_TYPE_DPDK)
>> +               odp_pktio_send(id, pkt_table, 0);
>> +
>>         lock_entry(pktio_entry);
>>         pkts = recv_pkt_dpdk(&pktio_entry->s.pkt_dpdk, pkt_table, len);
>>         unlock_entry(pktio_entry);
>>
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
Maxim Uvarov July 23, 2014, 1:42 p.m. UTC | #3
Looks like dpdk does the same hack:

examples/multi_process/client_server_mp/mp_client/client.c
         for (;;) {
                 uint16_t i, rx_pkts = PKT_READ_SIZE;
                 uint8_t port;

                 /* try dequeuing max possible packets first, if that 
fails, get the
                  * most we can. Loop body should only execute once, 
maximum */
                 while (rx_pkts > 0 &&
unlikely(rte_ring_dequeue_bulk(rx_ring, pkts, rx_pkts) != 0))
                         rx_pkts = 
(uint16_t)RTE_MIN(rte_ring_count(rx_ring), PKT_READ_SIZE);

                 if (unlikely(rx_pkts == 0)){
                         if (need_flush)
                                 for (port = 0; port < ports->num_ports; 
port++)
send_packets(ports->id[port]);
                         need_flush = 0;
                         continue;
                 }

                 for (i = 0; i < rx_pkts; i++)
                         handle_packet(pkts[i]);




On 07/23/2014 03:31 PM, Venkatesh Vivekanandan wrote:
> As this is just a temporary fix, it is ok to leave it this way. Please 
> let me know if there is any specific information presence in the subject.
>
> Venky
>
>
> On 21 July 2014 13:46, Maxim Uvarov <maxim.uvarov@linaro.org 
> <mailto:maxim.uvarov@linaro.org>> wrote:
>
>     I think this patch should be named differently.
>
>     Maxim.
>
>
>     On 07/21/2014 10:22 AM, venkatesh.vivekanandan@linaro.org
>     <mailto:venkatesh.vivekanandan@linaro.org> wrote:
>
>         From: Venkatesh Vivekanandan
>         <venkatesh.vivekanandan@linaro.org
>         <mailto:venkatesh.vivekanandan@linaro.org>>
>
>         - Fix to give transmitted buffers back to buffer pool.
>         - If there are issues seen while sending traffic, ONLY then
>         this patch
>            has to be applied. Intention of this patch is to fix the
>         traffic
>            issue.
>
>         Signed-off-by: Venkatesh Vivekanandan
>         <venkatesh.vivekanandan@linaro.org
>         <mailto:venkatesh.vivekanandan@linaro.org>>
>         ---
>           platform/linux-dpdk/odp_packet_io.c | 3 +++
>           1 file changed, 3 insertions(+)
>
>         diff --git a/platform/linux-dpdk/odp_packet_io.c
>         b/platform/linux-dpdk/odp_packet_io.c
>         index d8d127f..980a15c 100644
>         --- a/platform/linux-dpdk/odp_packet_io.c
>         +++ b/platform/linux-dpdk/odp_packet_io.c
>         @@ -230,6 +230,9 @@ int odp_pktio_recv(odp_pktio_t id,
>         odp_packet_t pkt_table[], unsigned len)
>                 if (pktio_entry == NULL)
>                         return -1;
>           +     if (pktio_entry->s.params.type == ODP_PKTIO_TYPE_DPDK)
>         +               odp_pktio_send(id, pkt_table, 0);
>         +
>                 lock_entry(pktio_entry);
>                 pkts = recv_pkt_dpdk(&pktio_entry->s.pkt_dpdk,
>         pkt_table, len);
>                 unlock_entry(pktio_entry);
>
>
>
>     _______________________________________________
>     lng-odp mailing list
>     lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>     http://lists.linaro.org/mailman/listinfo/lng-odp
>
>
diff mbox

Patch

diff --git a/platform/linux-dpdk/odp_packet_io.c b/platform/linux-dpdk/odp_packet_io.c
index d8d127f..980a15c 100644
--- a/platform/linux-dpdk/odp_packet_io.c
+++ b/platform/linux-dpdk/odp_packet_io.c
@@ -230,6 +230,9 @@  int odp_pktio_recv(odp_pktio_t id, odp_packet_t pkt_table[], unsigned len)
 	if (pktio_entry == NULL)
 		return -1;
 
+	if (pktio_entry->s.params.type == ODP_PKTIO_TYPE_DPDK)
+		odp_pktio_send(id, pkt_table, 0);
+
 	lock_entry(pktio_entry);
 	pkts = recv_pkt_dpdk(&pktio_entry->s.pkt_dpdk, pkt_table, len);
 	unlock_entry(pktio_entry);