Message ID | 1459780177-5133-1-git-send-email-bill.fischofer@linaro.org |
---|---|
State | Superseded |
Headers | show |
On 04/04/16 17:29, Bill Fischofer wrote: > Resolve bug https://bugs.linaro.org/show_bug.cgi?id=2138 by adding an > explicit rc check for odp_pktio_capability(). > > Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> > --- > platform/linux-generic/odp_packet_io.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c > index 9192be2..2fe2cf3 100644 > --- a/platform/linux-generic/odp_packet_io.c > +++ b/platform/linux-generic/odp_packet_io.c > @@ -1027,6 +1027,7 @@ int odp_pktin_queue_config(odp_pktio_t pktio, > odp_pktio_capability_t capa; > unsigned num_queues; > unsigned i; > + int rc; > odp_queue_t queue; > odp_pktin_queue_param_t default_param; > > @@ -1059,9 +1060,9 @@ int odp_pktin_queue_config(odp_pktio_t pktio, > return -1; > } > > - odp_pktio_capability(pktio, &capa); > + rc = odp_pktio_capability(pktio, &capa); > > - if (num_queues > capa.max_input_queues) { > + if (rc != 0 || num_queues > capa.max_input_queues) { > ODP_DBG("pktio %s: too many input queues\n", entry->s.name); I'm sorry to be very annoying here... but I think it has to be 2 separate messages: 1) ODP_DBG("pktio: %s unable to read capabitities\n".... 2) ODP_DBG("pktio %s: too many input queues ... Maxim. > return -1; > } > @@ -1135,6 +1136,7 @@ int odp_pktout_queue_config(odp_pktio_t pktio, > odp_pktio_capability_t capa; > unsigned num_queues; > unsigned i; > + int rc; > odp_pktout_queue_param_t default_param; > > if (param == NULL) { > @@ -1172,9 +1174,9 @@ int odp_pktout_queue_config(odp_pktio_t pktio, > return -1; > } > > - odp_pktio_capability(pktio, &capa); > + rc = odp_pktio_capability(pktio, &capa); > > - if (num_queues > capa.max_output_queues) { > + if (rc != 0 || num_queues > capa.max_output_queues) { > ODP_DBG("pktio %s: too many output queues\n", entry->s.name); > return -1; > }
OK. I realized the commit message was wrong so ignore the just submitted v3 as well. v4 coming up. :) On Mon, Apr 4, 2016 at 9:36 AM, Maxim Uvarov <maxim.uvarov@linaro.org> wrote: > On 04/04/16 17:29, Bill Fischofer wrote: > >> Resolve bug https://bugs.linaro.org/show_bug.cgi?id=2138 by adding an >> explicit rc check for odp_pktio_capability(). >> >> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> >> --- >> platform/linux-generic/odp_packet_io.c | 10 ++++++---- >> 1 file changed, 6 insertions(+), 4 deletions(-) >> >> diff --git a/platform/linux-generic/odp_packet_io.c >> b/platform/linux-generic/odp_packet_io.c >> index 9192be2..2fe2cf3 100644 >> --- a/platform/linux-generic/odp_packet_io.c >> +++ b/platform/linux-generic/odp_packet_io.c >> @@ -1027,6 +1027,7 @@ int odp_pktin_queue_config(odp_pktio_t pktio, >> odp_pktio_capability_t capa; >> unsigned num_queues; >> unsigned i; >> + int rc; >> odp_queue_t queue; >> odp_pktin_queue_param_t default_param; >> @@ -1059,9 +1060,9 @@ int odp_pktin_queue_config(odp_pktio_t pktio, >> return -1; >> } >> - odp_pktio_capability(pktio, &capa); >> + rc = odp_pktio_capability(pktio, &capa); >> - if (num_queues > capa.max_input_queues) { >> + if (rc != 0 || num_queues > capa.max_input_queues) { >> ODP_DBG("pktio %s: too many input queues\n", entry-> >> s.name); >> > I'm sorry to be very annoying here... but I think it has to be 2 separate > messages: > 1) ODP_DBG("pktio: %s unable to read capabitities\n".... > 2) ODP_DBG("pktio %s: too many input queues ... > > Maxim. > >> return -1; >> } >> @@ -1135,6 +1136,7 @@ int odp_pktout_queue_config(odp_pktio_t pktio, >> odp_pktio_capability_t capa; >> unsigned num_queues; >> unsigned i; >> + int rc; >> odp_pktout_queue_param_t default_param; >> if (param == NULL) { >> @@ -1172,9 +1174,9 @@ int odp_pktout_queue_config(odp_pktio_t pktio, >> return -1; >> } >> - odp_pktio_capability(pktio, &capa); >> + rc = odp_pktio_capability(pktio, &capa); >> - if (num_queues > capa.max_output_queues) { >> + if (rc != 0 || num_queues > capa.max_output_queues) { >> ODP_DBG("pktio %s: too many output queues\n", entry-> >> s.name); >> return -1; >> } >> > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > https://lists.linaro.org/mailman/listinfo/lng-odp >
diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 9192be2..2fe2cf3 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -1027,6 +1027,7 @@ int odp_pktin_queue_config(odp_pktio_t pktio, odp_pktio_capability_t capa; unsigned num_queues; unsigned i; + int rc; odp_queue_t queue; odp_pktin_queue_param_t default_param; @@ -1059,9 +1060,9 @@ int odp_pktin_queue_config(odp_pktio_t pktio, return -1; } - odp_pktio_capability(pktio, &capa); + rc = odp_pktio_capability(pktio, &capa); - if (num_queues > capa.max_input_queues) { + if (rc != 0 || num_queues > capa.max_input_queues) { ODP_DBG("pktio %s: too many input queues\n", entry->s.name); return -1; } @@ -1135,6 +1136,7 @@ int odp_pktout_queue_config(odp_pktio_t pktio, odp_pktio_capability_t capa; unsigned num_queues; unsigned i; + int rc; odp_pktout_queue_param_t default_param; if (param == NULL) { @@ -1172,9 +1174,9 @@ int odp_pktout_queue_config(odp_pktio_t pktio, return -1; } - odp_pktio_capability(pktio, &capa); + rc = odp_pktio_capability(pktio, &capa); - if (num_queues > capa.max_output_queues) { + if (rc != 0 || num_queues > capa.max_output_queues) { ODP_DBG("pktio %s: too many output queues\n", entry->s.name); return -1; }
Resolve bug https://bugs.linaro.org/show_bug.cgi?id=2138 by adding an explicit rc check for odp_pktio_capability(). Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> --- platform/linux-generic/odp_packet_io.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)