diff mbox

linux-generic: only enable pktout when egress kind is pktio

Message ID 1480664552-5380-1-git-send-email-forrest.shi@linaro.org
State Accepted
Commit 0e2b3a3597d139df1ff5d3f0338aa5cf26e34a43
Headers show

Commit Message

Forrest Shi Dec. 2, 2016, 7:42 a.m. UTC
From: Xuelin Shi <forrest.shi@linaro.org>


Signed-off-by: Xuelin Shi <forrest.shi@linaro.org>

---
 platform/linux-generic/odp_traffic_mngr.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

-- 
1.8.3.1

Comments

Forrest Shi Dec. 8, 2016, 1:58 a.m. UTC | #1
ping.

This is a simple fix.
The original code skips the support of egress_kind as ODP_TM_EGRESS_FN

On 2 December 2016 at 15:42, <forrest.shi@linaro.org> wrote:

> From: Xuelin Shi <forrest.shi@linaro.org>

>

> Signed-off-by: Xuelin Shi <forrest.shi@linaro.org>

> ---

>  platform/linux-generic/odp_traffic_mngr.c | 5 ++---

>  1 file changed, 2 insertions(+), 3 deletions(-)

>

> diff --git a/platform/linux-generic/odp_traffic_mngr.c

> b/platform/linux-generic/odp_traffic_mngr.c

> index ffb149b..a1f990f 100644

> --- a/platform/linux-generic/odp_traffic_mngr.c

> +++ b/platform/linux-generic/odp_traffic_mngr.c

> @@ -2838,10 +2838,9 @@ odp_tm_t odp_tm_create(const char            *name,

>                 return ODP_TM_INVALID;

>         }

>

> -       if (odp_pktout_queue(egress->pktio, &pktout, 1) != 1)

> -               return ODP_TM_INVALID;

> +       if (egress->egress_kind == ODP_TM_EGRESS_PKT_IO)

> +               tm_system->pktout = pktout;

>

> -       tm_system->pktout = pktout;

>         tm_system->name_tbl_id = name_tbl_id;

>         max_tm_queues = requirements->max_tm_queues;

>         memcpy(&tm_system->egress, egress, sizeof(odp_tm_egress_t));

> --

> 1.8.3.1

>

>
Maxim Uvarov Dec. 9, 2016, 12:31 p.m. UTC | #2
Bala,

please review TM patch.

Thank you,
Maxim.

On 12/08/16 04:58, Forrest Shi wrote:
> ping.

> 

> This is a simple fix.

> The original code skips the support of egress_kind as ODP_TM_EGRESS_FN

> 

> On 2 December 2016 at 15:42, <forrest.shi@linaro.org> wrote:

> 

>> From: Xuelin Shi <forrest.shi@linaro.org>

>>

>> Signed-off-by: Xuelin Shi <forrest.shi@linaro.org>

>> ---

>>  platform/linux-generic/odp_traffic_mngr.c | 5 ++---

>>  1 file changed, 2 insertions(+), 3 deletions(-)

>>

>> diff --git a/platform/linux-generic/odp_traffic_mngr.c

>> b/platform/linux-generic/odp_traffic_mngr.c

>> index ffb149b..a1f990f 100644

>> --- a/platform/linux-generic/odp_traffic_mngr.c

>> +++ b/platform/linux-generic/odp_traffic_mngr.c

>> @@ -2838,10 +2838,9 @@ odp_tm_t odp_tm_create(const char            *name,

>>                 return ODP_TM_INVALID;

>>         }

>>

>> -       if (odp_pktout_queue(egress->pktio, &pktout, 1) != 1)

>> -               return ODP_TM_INVALID;

>> +       if (egress->egress_kind == ODP_TM_EGRESS_PKT_IO)

>> +               tm_system->pktout = pktout;

>>

>> -       tm_system->pktout = pktout;

>>         tm_system->name_tbl_id = name_tbl_id;

>>         max_tm_queues = requirements->max_tm_queues;

>>         memcpy(&tm_system->egress, egress, sizeof(odp_tm_egress_t));

>> --

>> 1.8.3.1

>>

>>
Forrest Shi Dec. 13, 2016, 9:42 a.m. UTC | #3
Hi Bala,

Would you please review this small fix?

thanks,
Forrest

On 9 December 2016 at 20:31, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:

> Bala,

>

> please review TM patch.

>

> Thank you,

> Maxim.

>

> On 12/08/16 04:58, Forrest Shi wrote:

> > ping.

> >

> > This is a simple fix.

> > The original code skips the support of egress_kind as ODP_TM_EGRESS_FN

> >

> > On 2 December 2016 at 15:42, <forrest.shi@linaro.org> wrote:

> >

> >> From: Xuelin Shi <forrest.shi@linaro.org>

> >>

> >> Signed-off-by: Xuelin Shi <forrest.shi@linaro.org>

> >> ---

> >>  platform/linux-generic/odp_traffic_mngr.c | 5 ++---

> >>  1 file changed, 2 insertions(+), 3 deletions(-)

> >>

> >> diff --git a/platform/linux-generic/odp_traffic_mngr.c

> >> b/platform/linux-generic/odp_traffic_mngr.c

> >> index ffb149b..a1f990f 100644

> >> --- a/platform/linux-generic/odp_traffic_mngr.c

> >> +++ b/platform/linux-generic/odp_traffic_mngr.c

> >> @@ -2838,10 +2838,9 @@ odp_tm_t odp_tm_create(const char

> *name,

> >>                 return ODP_TM_INVALID;

> >>         }

> >>

> >> -       if (odp_pktout_queue(egress->pktio, &pktout, 1) != 1)

> >> -               return ODP_TM_INVALID;

> >> +       if (egress->egress_kind == ODP_TM_EGRESS_PKT_IO)

> >> +               tm_system->pktout = pktout;

> >>

> >> -       tm_system->pktout = pktout;

> >>         tm_system->name_tbl_id = name_tbl_id;

> >>         max_tm_queues = requirements->max_tm_queues;

> >>         memcpy(&tm_system->egress, egress, sizeof(odp_tm_egress_t));

> >> --

> >> 1.8.3.1

> >>

> >>

>

>
Balasubramanian Manoharan Dec. 13, 2016, 11:29 a.m. UTC | #4
Reviewed-by: Balasubramanian Manoharan <bala.manoharan@linaro.org>


On 2 December 2016 at 13:12,  <forrest.shi@linaro.org> wrote:
> From: Xuelin Shi <forrest.shi@linaro.org>

>

> Signed-off-by: Xuelin Shi <forrest.shi@linaro.org>

> ---

>  platform/linux-generic/odp_traffic_mngr.c | 5 ++---

>  1 file changed, 2 insertions(+), 3 deletions(-)

>

> diff --git a/platform/linux-generic/odp_traffic_mngr.c b/platform/linux-generic/odp_traffic_mngr.c

> index ffb149b..a1f990f 100644

> --- a/platform/linux-generic/odp_traffic_mngr.c

> +++ b/platform/linux-generic/odp_traffic_mngr.c

> @@ -2838,10 +2838,9 @@ odp_tm_t odp_tm_create(const char            *name,

>                 return ODP_TM_INVALID;

>         }

>

> -       if (odp_pktout_queue(egress->pktio, &pktout, 1) != 1)

> -               return ODP_TM_INVALID;

> +       if (egress->egress_kind == ODP_TM_EGRESS_PKT_IO)

> +               tm_system->pktout = pktout;

>

> -       tm_system->pktout = pktout;

>         tm_system->name_tbl_id = name_tbl_id;

>         max_tm_queues = requirements->max_tm_queues;

>         memcpy(&tm_system->egress, egress, sizeof(odp_tm_egress_t));

> --

> 1.8.3.1

>
Maxim Uvarov Dec. 13, 2016, 1:46 p.m. UTC | #5
Merged,
Maxim.

On 12/13/16 14:29, Bala Manoharan wrote:
> Reviewed-by: Balasubramanian Manoharan <bala.manoharan@linaro.org>

> 

> On 2 December 2016 at 13:12,  <forrest.shi@linaro.org> wrote:

>> From: Xuelin Shi <forrest.shi@linaro.org>

>>

>> Signed-off-by: Xuelin Shi <forrest.shi@linaro.org>

>> ---

>>  platform/linux-generic/odp_traffic_mngr.c | 5 ++---

>>  1 file changed, 2 insertions(+), 3 deletions(-)

>>

>> diff --git a/platform/linux-generic/odp_traffic_mngr.c b/platform/linux-generic/odp_traffic_mngr.c

>> index ffb149b..a1f990f 100644

>> --- a/platform/linux-generic/odp_traffic_mngr.c

>> +++ b/platform/linux-generic/odp_traffic_mngr.c

>> @@ -2838,10 +2838,9 @@ odp_tm_t odp_tm_create(const char            *name,

>>                 return ODP_TM_INVALID;

>>         }

>>

>> -       if (odp_pktout_queue(egress->pktio, &pktout, 1) != 1)

>> -               return ODP_TM_INVALID;

>> +       if (egress->egress_kind == ODP_TM_EGRESS_PKT_IO)

>> +               tm_system->pktout = pktout;

>>

>> -       tm_system->pktout = pktout;

>>         tm_system->name_tbl_id = name_tbl_id;

>>         max_tm_queues = requirements->max_tm_queues;

>>         memcpy(&tm_system->egress, egress, sizeof(odp_tm_egress_t));

>> --

>> 1.8.3.1

>>
diff mbox

Patch

diff --git a/platform/linux-generic/odp_traffic_mngr.c b/platform/linux-generic/odp_traffic_mngr.c
index ffb149b..a1f990f 100644
--- a/platform/linux-generic/odp_traffic_mngr.c
+++ b/platform/linux-generic/odp_traffic_mngr.c
@@ -2838,10 +2838,9 @@  odp_tm_t odp_tm_create(const char            *name,
 		return ODP_TM_INVALID;
 	}
 
-	if (odp_pktout_queue(egress->pktio, &pktout, 1) != 1)
-		return ODP_TM_INVALID;
+	if (egress->egress_kind == ODP_TM_EGRESS_PKT_IO)
+		tm_system->pktout = pktout;
 
-	tm_system->pktout = pktout;
 	tm_system->name_tbl_id = name_tbl_id;
 	max_tm_queues = requirements->max_tm_queues;
 	memcpy(&tm_system->egress, egress, sizeof(odp_tm_egress_t));