From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com [74.125.82.43]) by dpdk.org (Postfix) with ESMTP id 332A9803F for ; Mon, 1 Dec 2014 11:36:24 +0100 (CET) Received: by mail-wg0-f43.google.com with SMTP id l18so13800629wgh.16 for ; Mon, 01 Dec 2014 02:36:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=WKEWIDcJWSC7+pBbeX6bB2OGMmCvVBqR6V659GjJoIk=; b=X3fsKeeEQbzqEEePECCHZSPtRLE+JGZ3BKcGgfThVBRela2VKewmyeWNq7k/M9lfXs idZIfLmYmSWri3+yuNB2jwDkQ8GrcXeSfkandcLzPseOgSPgvjmjVWWi+yB9bTyQTKbZ WTvoAWt7l/qnK7maHiggn1gDILRR95WToL19m5Iqcto4FDWw09oM9TAIRoJGT5LsDUOp ZYU7EO5AyvJSibqmD/c3FzemEGuXX44rBBPPomVgnMoOm3IUB+BlR5Uoppmgsc9xJLSs 3c7UBN8DgvE0k2CLwf60A8yVfybtBNSO4K2vOPSwAfS65+AksZGME1IZvrM5jT/mvNHU FnKg== X-Gm-Message-State: ALoCoQlEFxQDpVvOMOjDZY5+y+XyNYjp2dxvyiErE4ks06gZwA+hxdiI3wxVuM+R13+eq18XqHZL X-Received: by 10.180.91.109 with SMTP id cd13mr81685848wib.46.1417430184009; Mon, 01 Dec 2014 02:36:24 -0800 (PST) Received: from glumotte.dev.6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by mx.google.com with ESMTPSA id rx8sm26996056wjb.30.2014.12.01.02.36.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Dec 2014 02:36:23 -0800 (PST) From: Olivier Matz To: dev@dpdk.org Date: Mon, 1 Dec 2014 11:36:13 +0100 Message-Id: <1417430173-24502-1-git-send-email-olivier.matz@6wind.com> X-Mailer: git-send-email 2.1.0 Subject: [dpdk-dev] [PATCH] ixgbe: change assignation of bitfields to fix clang compilation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 10:36:24 -0000 Commit 1224decaa44b3dba58e0a524fd0383969929c575 changed the way the bitfields are assigned in ixgbe, example: tx_offload_mask.l2_len = ~0; This result in a compilation error with clang: error: implicit truncation from 'int' to bitfield changes value from -1 to 127 [-Werror,-Wbitfield-constant-conversion] Replacing the '=' with a '|=' fixes the issue. Signed-off-by: Olivier Matz --- lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c index 8559ef6..5c36bff 100644 --- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c +++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c @@ -381,7 +381,7 @@ ixgbe_set_xmit_ctx(struct igb_tx_queue* txq, mss_l4len_idx |= (ctx_idx << IXGBE_ADVTXD_IDX_SHIFT); if (ol_flags & PKT_TX_VLAN_PKT) { - tx_offload_mask.vlan_tci = ~0; + tx_offload_mask.vlan_tci |= ~0; } /* check if TCP segmentation required for this packet */ @@ -391,17 +391,17 @@ ixgbe_set_xmit_ctx(struct igb_tx_queue* txq, IXGBE_ADVTXD_TUCMD_L4T_TCP | IXGBE_ADVTXD_DTYP_CTXT | IXGBE_ADVTXD_DCMD_DEXT; - tx_offload_mask.l2_len = ~0; - tx_offload_mask.l3_len = ~0; - tx_offload_mask.l4_len = ~0; - tx_offload_mask.tso_segsz = ~0; + tx_offload_mask.l2_len |= ~0; + tx_offload_mask.l3_len |= ~0; + tx_offload_mask.l4_len |= ~0; + tx_offload_mask.tso_segsz |= ~0; mss_l4len_idx |= tx_offload.tso_segsz << IXGBE_ADVTXD_MSS_SHIFT; mss_l4len_idx |= tx_offload.l4_len << IXGBE_ADVTXD_L4LEN_SHIFT; } else { /* no TSO, check if hardware checksum is needed */ if (ol_flags & PKT_TX_IP_CKSUM) { type_tucmd_mlhl = IXGBE_ADVTXD_TUCMD_IPV4; - tx_offload_mask.l2_len = ~0; - tx_offload_mask.l3_len = ~0; + tx_offload_mask.l2_len |= ~0; + tx_offload_mask.l3_len |= ~0; } switch (ol_flags & PKT_TX_L4_MASK) { @@ -409,23 +409,23 @@ ixgbe_set_xmit_ctx(struct igb_tx_queue* txq, type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_UDP | IXGBE_ADVTXD_DTYP_CTXT | IXGBE_ADVTXD_DCMD_DEXT; mss_l4len_idx |= sizeof(struct udp_hdr) << IXGBE_ADVTXD_L4LEN_SHIFT; - tx_offload_mask.l2_len = ~0; - tx_offload_mask.l3_len = ~0; + tx_offload_mask.l2_len |= ~0; + tx_offload_mask.l3_len |= ~0; break; case PKT_TX_TCP_CKSUM: type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_TCP | IXGBE_ADVTXD_DTYP_CTXT | IXGBE_ADVTXD_DCMD_DEXT; mss_l4len_idx |= sizeof(struct tcp_hdr) << IXGBE_ADVTXD_L4LEN_SHIFT; - tx_offload_mask.l2_len = ~0; - tx_offload_mask.l3_len = ~0; - tx_offload_mask.l4_len = ~0; + tx_offload_mask.l2_len |= ~0; + tx_offload_mask.l3_len |= ~0; + tx_offload_mask.l4_len |= ~0; break; case PKT_TX_SCTP_CKSUM: type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_SCTP | IXGBE_ADVTXD_DTYP_CTXT | IXGBE_ADVTXD_DCMD_DEXT; mss_l4len_idx |= sizeof(struct sctp_hdr) << IXGBE_ADVTXD_L4LEN_SHIFT; - tx_offload_mask.l2_len = ~0; - tx_offload_mask.l3_len = ~0; + tx_offload_mask.l2_len |= ~0; + tx_offload_mask.l3_len |= ~0; break; default: type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_RSV | -- 2.1.0