From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot0-f195.google.com (mail-ot0-f195.google.com [74.125.82.195]) by dpdk.org (Postfix) with ESMTP id 110D4101B for ; Tue, 21 Mar 2017 07:51:19 +0100 (CET) Received: by mail-ot0-f195.google.com with SMTP id x37so21538002ota.1 for ; Mon, 20 Mar 2017 23:51:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=n3ve1v/exttjIOjEWmGjzAWFbyGAOlGaqBu9sSBlbAs=; b=Z+tVAtUwkO3KDH3IRTHZ8yLlUj2+oFOLdGKjsHqPscgkhT3Vypi7hTyxNtLoMrk7fG Wq22AR/abGVtoOIwPaOkVCqqcpAqKwad+MHsbO5GnMddWjKfPvcaGboQc25/YocwenLk 7Hnv2dbCpuEl7czgU6Mr+4GXVk2FXb0uMREpj6AQEWCx83UzwQCWqglECivi+JXDiIVU 72WARSfG67XBsaiETcH0U99aYk4MKINbBHNcVRLtUXOHzob8GI575b3fHiwwUPV0lg5H Y2RHnIE+aveM2kQPM6YrGB6nDEGZ7cnc6YAw1Umyed8zB9N+5pxM/18zkKkza0NwhsOV pcJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=n3ve1v/exttjIOjEWmGjzAWFbyGAOlGaqBu9sSBlbAs=; b=Gl3+YDYp45PbvQMv/XB0AjewNhtMSXe+RjPWV2dRvmX/OuzJpzx5hr6jj8anAzJLNX vke4Jcm/HwD/QGMh5ZknYB2VKffo7ON7JLxDRKnXRXjbRRLlqaVO8ZV3B56vqh/S3rJH atwESebdxnrZDcyCMmiuTJeDDmFCMEcmu1tLomlrKyfFsgjcO+M8n0YtQM/MObR8NI3E ivT9yXEEvLxR/FAvkbxbm9jhRWpGovRnHMY1xrQkG7oAwRfXpNgGCDDqc242EnM/7mA4 qNnfx04vyKUXtQ0NVmt1uCogwfaRCg4uUpWj3KnYY0HTNvj0olNZMos2wuNMwbRa0NSX qwhA== X-Gm-Message-State: AFeK/H1aOYwoNb+ceUFUnRdjqI0O86zIG/s2LXy0qYTYESxO2dtB63gwyR8LhmCaKy+8xA== X-Received: by 10.157.38.247 with SMTP id i52mr16494771otd.64.1490079078207; Mon, 20 Mar 2017 23:51:18 -0700 (PDT) Received: from localhost.psychz.net ([104.217.249.138]) by smtp.gmail.com with ESMTPSA id c55sm8524543otd.31.2017.03.20.23.51.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Mar 2017 23:51:17 -0700 (PDT) From: Shyam Kumar Shrivastav To: cristian.dumitrescu@intel.com Cc: dev@dpdk.org, Shyam Kumar Shrivastav Date: Tue, 21 Mar 2017 11:49:47 -0400 Message-Id: <1490111387-1097-1-git-send-email-shrivastav.shyam@gmail.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH] ip_pipeline:pipeline_firewall: Fix for UDP/TCP port range filtering X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Mar 2017 06:51:19 -0000 Firewall ACL definition need to use same input index for source and destination ports as these are 16 bits and would fit in one ACL field of 32 bits. This is required as per librte_acl API. Without this UDP/TCP source and destination ports filtering (and for that matter ICMP type/code filtering) does not work. Signed-off-by: Shyam Kumar Shrivastav --- examples/ip_pipeline/pipeline/pipeline_firewall_be.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/ip_pipeline/pipeline/pipeline_firewall_be.c b/examples/ip_pipeline/pipeline/pipeline_firewall_be.c index b61f303..2980492 100644 --- a/examples/ip_pipeline/pipeline/pipeline_firewall_be.c +++ b/examples/ip_pipeline/pipeline/pipeline_firewall_be.c @@ -161,7 +161,7 @@ struct firewall_table_entry { .type = RTE_ACL_FIELD_TYPE_RANGE, .size = sizeof(uint16_t), .field_index = 4, - .input_index = 4, + .input_index = 3, .offset = sizeof(struct ether_hdr) + sizeof(struct ipv4_hdr) + offsetof(struct tcp_hdr, dst_port), @@ -221,7 +221,7 @@ struct firewall_table_entry { .type = RTE_ACL_FIELD_TYPE_RANGE, .size = sizeof(uint16_t), .field_index = 4, - .input_index = 4, + .input_index = 3, .offset = sizeof(struct ether_hdr) + SIZEOF_VLAN_HDR + sizeof(struct ipv4_hdr) + @@ -282,7 +282,7 @@ struct firewall_table_entry { .type = RTE_ACL_FIELD_TYPE_RANGE, .size = sizeof(uint16_t), .field_index = 4, - .input_index = 4, + .input_index = 3, .offset = sizeof(struct ether_hdr) + SIZEOF_QINQ_HEADER + sizeof(struct ipv4_hdr) + -- 1.8.3.1