From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rcdn-iport-6.cisco.com (rcdn-iport-6.cisco.com [173.37.86.77]) by dpdk.org (Postfix) with ESMTP id A37EADE0 for ; Thu, 9 Feb 2017 01:31:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2327; q=dns/txt; s=iport; t=1486600310; x=1487809910; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=ZtBM2ZrAr+3VAh95azOG0ebyEMxGmqOsBwd6+HbFHGU=; b=OjWxV3hSrjY5bIlm7S75nK221R6X6IyE/Sp2tLVfMljXmuXA4Tdw4EGs /SZ+wlfJv5IzolnPnFOuDS13dMeFMeNU0V61j8P25RnsBIjgf7VRZXrjl GtrrJXN4Zc4h1FgHRkwux/BVu/MWwnp6jI71phHVB8/Ym1oCMK/wAdklL o=; X-IronPort-AV: E=Sophos;i="5.35,348,1484006400"; d="scan'208";a="206480676" Received: from alln-core-1.cisco.com ([173.36.13.131]) by rcdn-iport-6.cisco.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 09 Feb 2017 00:31:49 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by alln-core-1.cisco.com (8.14.5/8.14.5) with ESMTP id v190VnGt029073; Thu, 9 Feb 2017 00:31:49 GMT Received: by cisco.com (Postfix, from userid 392789) id 6B7943FAAECA; Wed, 8 Feb 2017 16:31:49 -0800 (PST) From: John Daley To: johnda888@gmail.com Cc: John Daley , stable@dpdk.org Date: Wed, 8 Feb 2017 16:31:30 -0800 Message-Id: <20170209003130.17245-2-johndale@cisco.com> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20170209003130.17245-1-johndale@cisco.com> References: <20170203095446.4614-1-johndale@cisco.com> <20170209003130.17245-1-johndale@cisco.com> Subject: [dpdk-stable] [PATCH v2] net/enic: fix hardcoding of some flow director masks X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2017 00:31:51 -0000 Hard coded mask values were being used for several of the IPv4 and IPv6 fields. Use the values in the rte_eth_fdir_masks structure provided by the caller. Fixes: dfbd6a9cb504 ("net/enic: extend flow director support for 1300 series") Cc: stable@dpdk.org Signed-off-by: John Daley --- v2: fix compile error drivers/net/enic/enic_clsf.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/enic/enic_clsf.c b/drivers/net/enic/enic_clsf.c index bcf479a..487f804 100644 --- a/drivers/net/enic/enic_clsf.c +++ b/drivers/net/enic/enic_clsf.c @@ -211,15 +211,15 @@ copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input, memset(&ip4_val, 0, sizeof(struct ipv4_hdr)); if (input->flow.ip4_flow.tos) { - ip4_mask.type_of_service = 0xff; + ip4_mask.type_of_service = masks->ipv4_mask.tos; ip4_val.type_of_service = input->flow.ip4_flow.tos; } if (input->flow.ip4_flow.ttl) { - ip4_mask.time_to_live = 0xff; + ip4_mask.time_to_live = masks->ipv4_mask.ttl; ip4_val.time_to_live = input->flow.ip4_flow.ttl; } if (input->flow.ip4_flow.proto) { - ip4_mask.next_proto_id = 0xff; + ip4_mask.next_proto_id = masks->ipv4_mask.proto; ip4_val.next_proto_id = input->flow.ip4_flow.proto; } if (input->flow.ip4_flow.src_ip) { @@ -299,7 +299,7 @@ copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input, memset(&ipv6_val, 0, sizeof(struct ipv6_hdr)); if (input->flow.ipv6_flow.proto) { - ipv6_mask.proto = 0xff; + ipv6_mask.proto = masks->ipv6_mask.proto; ipv6_val.proto = input->flow.ipv6_flow.proto; } for (i = 0; i < 4; i++) { @@ -315,11 +315,11 @@ copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input, input->flow.ipv6_flow.dst_ip[i]; } if (input->flow.ipv6_flow.tc) { - ipv6_mask.vtc_flow = 0x00ff0000; - ipv6_val.vtc_flow = input->flow.ipv6_flow.tc << 16; + ipv6_mask.vtc_flow = masks->ipv6_mask.tc << 12; + ipv6_val.vtc_flow = input->flow.ipv6_flow.tc << 12; } if (input->flow.ipv6_flow.hop_limits) { - ipv6_mask.hop_limits = 0xff; + ipv6_mask.hop_limits = masks->ipv6_mask.hop_limits; ipv6_val.hop_limits = input->flow.ipv6_flow.hop_limits; } -- 2.10.0