diff mbox

[dpdk-dev,2/5] ixgbe: make register maps const

Message ID 1425695004-29605-3-git-send-email-stephen@networkplumber.org (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Stephen Hemminger March 7, 2015, 2:23 a.m. UTC
These are const data structures, just put them in txt segment
rather than having compiler emit code to set them up on the stack.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Bruce Richardson March 9, 2015, 1:33 p.m. UTC | #1
On Fri, Mar 06, 2015 at 06:23:21PM -0800, Stephen Hemminger wrote:
> These are const data structures, just put them in txt segment
> rather than having compiler emit code to set them up on the stack.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

> ---
>  lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
> index e6aec8f..8706c1e 100644
> --- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
> +++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
> @@ -860,14 +860,14 @@ rx_desc_hlen_type_rss_to_pkt_flags(uint32_t hl_tp_rs)
>  {
>  	uint64_t pkt_flags;
>  
> -	static uint64_t ip_pkt_types_map[16] = {
> +	static const uint64_t ip_pkt_types_map[16] = {
>  		0, PKT_RX_IPV4_HDR, PKT_RX_IPV4_HDR_EXT, PKT_RX_IPV4_HDR_EXT,
>  		PKT_RX_IPV6_HDR, 0, 0, 0,
>  		PKT_RX_IPV6_HDR_EXT, 0, 0, 0,
>  		PKT_RX_IPV6_HDR_EXT, 0, 0, 0,
>  	};
>  
> -	static uint64_t ip_rss_types_map[16] = {
> +	static const uint64_t ip_rss_types_map[16] = {
>  		0, PKT_RX_RSS_HASH, PKT_RX_RSS_HASH, PKT_RX_RSS_HASH,
>  		0, PKT_RX_RSS_HASH, 0, PKT_RX_RSS_HASH,
>  		PKT_RX_RSS_HASH, 0, 0, 0,
> -- 
> 2.1.4
>
Ouyang Changchun March 10, 2015, 4:47 a.m. UTC | #2
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Stephen
> Hemminger
> Sent: Saturday, March 7, 2015 10:23 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH 2/5] ixgbe: make register maps const
> 
> These are const data structures, just put them in txt segment rather than
> having compiler emit code to set them up on the stack.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
diff mbox

Patch

diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
index e6aec8f..8706c1e 100644
--- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
+++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
@@ -860,14 +860,14 @@  rx_desc_hlen_type_rss_to_pkt_flags(uint32_t hl_tp_rs)
 {
 	uint64_t pkt_flags;
 
-	static uint64_t ip_pkt_types_map[16] = {
+	static const uint64_t ip_pkt_types_map[16] = {
 		0, PKT_RX_IPV4_HDR, PKT_RX_IPV4_HDR_EXT, PKT_RX_IPV4_HDR_EXT,
 		PKT_RX_IPV6_HDR, 0, 0, 0,
 		PKT_RX_IPV6_HDR_EXT, 0, 0, 0,
 		PKT_RX_IPV6_HDR_EXT, 0, 0, 0,
 	};
 
-	static uint64_t ip_rss_types_map[16] = {
+	static const uint64_t ip_rss_types_map[16] = {
 		0, PKT_RX_RSS_HASH, PKT_RX_RSS_HASH, PKT_RX_RSS_HASH,
 		0, PKT_RX_RSS_HASH, 0, PKT_RX_RSS_HASH,
 		PKT_RX_RSS_HASH, 0, 0, 0,