[dpdk-dev] some questions about rte_memcpy

2015-01-23 Thread Linhaifeng
On 2015/1/22 23:21, Bruce Richardson wrote: > This (size_c) is a run-time constant, not a compile-time constant. To trigger > the > memcpy optimizations inside the compiler, the size value must be constant at > compile time. Hi, Bruce You are right. When use compile-time constant memcpy is fa

[dpdk-dev] some questions about rte_memcpy

2015-01-22 Thread Linhaifeng
On 2015/1/22 19:34, Bruce Richardson wrote: > On Thu, Jan 22, 2015 at 07:23:49PM +0900, Tetsuya Mukawa wrote: >> On 2015/01/22 16:35, Matthew Hall wrote: >>> On Thu, Jan 22, 2015 at 01:32:04PM +0800, Linhaifeng wrote: Do you mean if call rte_memcpy before rte_eal_init() would crash?why? >>>

[dpdk-dev] some questions about rte_memcpy

2015-01-22 Thread Tetsuya Mukawa
On 2015/01/22 16:35, Matthew Hall wrote: > On Thu, Jan 22, 2015 at 01:32:04PM +0800, Linhaifeng wrote: >> Do you mean if call rte_memcpy before rte_eal_init() would crash?why? > No guarantee. But a theory. It might use some things from the EAL init to > figure out which version of the accelerated

[dpdk-dev] some questions about rte_memcpy

2015-01-22 Thread Bruce Richardson
On Thu, Jan 22, 2015 at 08:53:13PM +0800, Linhaifeng wrote: > > > On 2015/1/22 19:34, Bruce Richardson wrote: > > On Thu, Jan 22, 2015 at 07:23:49PM +0900, Tetsuya Mukawa wrote: > >> On 2015/01/22 16:35, Matthew Hall wrote: > >>> On Thu, Jan 22, 2015 at 01:32:04PM +0800, Linhaifeng wrote: >

[dpdk-dev] some questions about rte_memcpy

2015-01-22 Thread Linhaifeng
On 2015/1/22 12:45, Matthew Hall wrote: > One theory. Many DPDK functions crash if they are called before > rte_eal_init() > is called. So perhaps this could be a cause, since that won't have been > called > when working on a constant Hi, Matthew Thank you for your response. Do you mean if

[dpdk-dev] some questions about rte_memcpy

2015-01-22 Thread Linhaifeng
#define rte_memcpy(dst, src, n) \ ((__builtin_constant_p(n)) ? \ memcpy((dst), (src), (n)) : \ rte_memcpy_func((dst), (src), (n))) Why call memcpy when n is constant variable? Can i change them to the follow codes? #define rte_memcpy(dst, sr

[dpdk-dev] some questions about rte_memcpy

2015-01-22 Thread Bruce Richardson
On Thu, Jan 22, 2015 at 07:23:49PM +0900, Tetsuya Mukawa wrote: > On 2015/01/22 16:35, Matthew Hall wrote: > > On Thu, Jan 22, 2015 at 01:32:04PM +0800, Linhaifeng wrote: > >> Do you mean if call rte_memcpy before rte_eal_init() would crash?why? > > No guarantee. But a theory. It might use some thi

[dpdk-dev] some questions about rte_memcpy

2015-01-21 Thread Matthew Hall
On Thu, Jan 22, 2015 at 01:32:04PM +0800, Linhaifeng wrote: > Do you mean if call rte_memcpy before rte_eal_init() would crash?why? No guarantee. But a theory. It might use some things from the EAL init to figure out which version of the accelerated algorithm to use. Matthew.

[dpdk-dev] some questions about rte_memcpy

2015-01-21 Thread Matthew Hall
On Thu, Jan 22, 2015 at 11:39:11AM +0800, Linhaifeng wrote: > Why call memcpy when n is constant variable? One theory. Many DPDK functions crash if they are called before rte_eal_init() is called. So perhaps this could be a cause, since that won't have been called when working on a constant? Ma