DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] SEGMENTATION FAULT in kni example : kni_free_kni() call
@ 2014-10-29  2:07 Ariel Rodriguez
  2014-10-29  8:35 ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Ariel Rodriguez @ 2014-10-29  2:07 UTC (permalink / raw)
  To: dev

Hi, im trying the kni example. When i hit ctrl-c in the terminal  stopping
the example, the os signals  with a segmentation fault.

The issue is in this block of code:

static int kni_free_kni(uint8_t port_id) {
uint8_t i;
struct kni_port_params **p = kni_port_params_array;

if (port_id >= RTE_MAX_ETHPORTS || !p[port_id])
return -1;

-- for (i = 0; i < p[i]->nb_kni; i++) {
-- rte_kni_release(p[i]->kni[i]);
-- p[i]->kni[i] = NULL;
}
rte_eth_dev_stop(port_id);

return 0;
}


The following change fix that issue:

static int kni_free_kni(uint8_t port_id) {
uint8_t i;
struct kni_port_params **p = kni_port_params_array;

if (port_id >= RTE_MAX_ETHPORTS || !p[port_id])
return -1;

++ for (i = 0; i < p[port_id]->nb_kni; i++) {
++ rte_kni_release(p[port_id]->kni[i]);
++ p[port_id]->kni[i] = NULL;
}
rte_eth_dev_stop(port_id);

return 0;
}

Sorry for the basic of my fix ... i dont know  the correct style to report
this kind of issues... im just a user of the dpdk library ... but i meet
this bug ...


Regards.

Ariel Horacio Rodriguez.

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

* Re: [dpdk-dev] SEGMENTATION FAULT in kni example : kni_free_kni() call
  2014-10-29  2:07 [dpdk-dev] SEGMENTATION FAULT in kni example : kni_free_kni() call Ariel Rodriguez
@ 2014-10-29  8:35 ` Thomas Monjalon
  2014-10-29  8:42   ` Zhang, Helin
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Monjalon @ 2014-10-29  8:35 UTC (permalink / raw)
  To: Ariel Rodriguez; +Cc: dev

Hi,

2014-10-28 23:07, Ariel Rodriguez:
> Hi, im trying the kni example. When i hit ctrl-c in the terminal  stopping
> the example, the os signals  with a segmentation fault.
[...]
> The following change fix that issue:
> 
> static int kni_free_kni(uint8_t port_id) {
> uint8_t i;
> struct kni_port_params **p = kni_port_params_array;
> 
> if (port_id >= RTE_MAX_ETHPORTS || !p[port_id])
> return -1;
> 
> ++ for (i = 0; i < p[port_id]->nb_kni; i++) {
> ++ rte_kni_release(p[port_id]->kni[i]);
> ++ p[port_id]->kni[i] = NULL;
> }
> rte_eth_dev_stop(port_id);
> 
> return 0;
> }
> 
> Sorry for the basic of my fix ... i dont know  the correct style to report
> this kind of issues... im just a user of the dpdk library ... but i meet
> this bug ...

Thank you for reporting it.
If you want to send an applicable patch, the procedure is described here:
	http://dpdk.org/dev#send

-- 
Thomas

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

* Re: [dpdk-dev] SEGMENTATION FAULT in kni example : kni_free_kni() call
  2014-10-29  8:35 ` Thomas Monjalon
@ 2014-10-29  8:42   ` Zhang, Helin
  0 siblings, 0 replies; 3+ messages in thread
From: Zhang, Helin @ 2014-10-29  8:42 UTC (permalink / raw)
  To: Thomas Monjalon, Ariel Rodriguez; +Cc: dev


> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon
> Sent: Wednesday, October 29, 2014 4:35 PM
> To: Ariel Rodriguez
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] SEGMENTATION FAULT in kni example : kni_free_kni()
> call
> 
> Hi,
> 
> 2014-10-28 23:07, Ariel Rodriguez:
> > Hi, im trying the kni example. When i hit ctrl-c in the terminal
> > stopping the example, the os signals  with a segmentation fault.
> [...]
> > The following change fix that issue:
> >
> > static int kni_free_kni(uint8_t port_id) { uint8_t i; struct
> > kni_port_params **p = kni_port_params_array;
> >
> > if (port_id >= RTE_MAX_ETHPORTS || !p[port_id]) return -1;
> >
> > ++ for (i = 0; i < p[port_id]->nb_kni; i++) {
> > ++ rte_kni_release(p[port_id]->kni[i]);
> > ++ p[port_id]->kni[i] = NULL;
Great to see it! That would be a perfect fix for it.

> > }
> > rte_eth_dev_stop(port_id);
> >
> > return 0;
> > }
> >
> > Sorry for the basic of my fix ... i dont know  the correct style to
> > report this kind of issues... im just a user of the dpdk library ...
> > but i meet this bug ...
> 
> Thank you for reporting it.
> If you want to send an applicable patch, the procedure is described here:
> 	http://dpdk.org/dev#send
> 
> --
> Thomas

Regards,
Helin

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

end of thread, other threads:[~2014-10-29  8:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-29  2:07 [dpdk-dev] SEGMENTATION FAULT in kni example : kni_free_kni() call Ariel Rodriguez
2014-10-29  8:35 ` Thomas Monjalon
2014-10-29  8:42   ` Zhang, Helin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).