summaryrefslogtreecommitdiffstats
path: root/common/VIL/acl/lib_acl.c
blob: 9adb5a2f2b831dc4b1a60ab48e3734db538e5193 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
.highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */
.highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */
.highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */
.highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */
.highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */
.highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */
.highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */
.highlight .vc { color: #336699 } /* Name.Variable.Class */
.highlight .vg { color: #dd7700 } /* Name.Variable.Global */
.highlight .vi { color: #3333bb } /* Name.Variable.Instance */
.highlight .vm { color: #336699 } /* Name.Variable.Magic */
.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
.. This work is licensed under a Creative Commons Attribution 4.0 International License.
.. http://creativecommons.org/licenses/by/4.0
.. (c) Open Platform for NFV Project, Inc. and its contributors

========
Abstract
========

This document compiles the release notes for the Euphrates release of
OPNFV when using Fuel as a deployment tool. This is an unified documentation
for both x86_64 and aarch64 architectures. All information is common for
both architectures except when explicitly stated.


===============
Important Notes
===============

These notes provides release information for the use of Fuel as deployment
tool for the Euphrates release of OPNFV.

The goal of the Euphrates release and this Fuel-based deployment process is
to establish a lab ready platform accelerating further development
of the OPNFV infrastructure.

Carefully follow the installation-instructions.

=======
Summary
=======

For Euphrates, the typical use of Fuel as an OpenStack installer is
supplemented with OPNFV unique components such as:

- `OpenDaylight <http://www.opendaylight.org/software>`_
- `Open vSwitch for NFV <https://wiki.opnfv.org/ovsnfv>`_

As well as OPNFV-unique configurations of the Hardware and Software stack.

This Euphrates artifact provides Fuel as the deployment stage tool in the
OPNFV CI pipeline including:

- Documentation built by Jenkins

  - overall OPNFV documentation

  - this document (release notes)

  - installation instructions

- Automated deployment of Euphrates with running on bare metal or a nested
  hypervisor environment (KVM)

- Automated validation of the Euphrates deployment

============
Release Data
============

+--------------------------------------+--------------------------------------+
| **Project**                          | fuel/armband                         |
|                                      |                                      |
+--------------------------------------+--------------------------------------+
| **Repo/tag**                         | opnfv-5.0.0                          |
|                                      |                                      |
+--------------------------------------+--------------------------------------+
| **Release designation**              | Euphrates 5.0                        |
|                                      |                                      |
+--------------------------------------+--------------------------------------+
| **Release date**                     | October 20 2017                      |
|                                      |                                      |
+--------------------------------------+--------------------------------------+
| **Purpose of the delivery**          | Euphrates alignment to Released      |
|                                      | MCP 1.0 baseline + features and      |
|                                      | bug-fixes for the following          |
|                                      | feaures:                             |
|                                      |                                      |
|                                      | - Open vSwitch for NFV               |
|                                      | - OpenDaylight                       |
+--------------------------------------+--------------------------------------+

Version Change
==============

Module Version Changes
----------------------
This is the Euphrates 5.0 release.
It is based on following upstream versions:

- MCP 1.0 Base Release

- OpenStack Ocata Release

- OpenDaylight

Document Changes
----------------
This is the Euphrates 5.0 release.
It comes with the following documentation:

- Installation instructions

- Release notes (This document)

Reason for Version
==================

Feature Additions
-----------------

**JIRA TICKETS:**
`Euphrates 5.0 new features  <https://jira.opnfv.org/issues/?filter=12029>`_

Bug Corrections
---------------

**JIRA TICKETS:**

`Euphrates 5.0 bug fixes  <https://jira.opnfv.org/issues/?filter=12027>`_

(Also See respective Integrated feature project's bug tracking)

Deliverables
============

Software Deliverables
---------------------

- `Fuel@x86_64 installer script files <https://git.opnfv.org/fuel>`_

- `Fuel@aarch64 installer script files <https://git.opnfv.org/armband>`_

Documentation Deliverables
--------------------------

- Installation instructions

- Release notes (This document)

=========================================
Known Limitations, Issues and Workarounds
=========================================

System Limitations
==================

- **Max number of blades:** 1 Jumpserver, 3 Controllers, 20 Compute blades

- **Min number of blades:** 1 Jumpserver

- **Storage:** Cinder is the only supported storage configuration

- **Max number of networks:** 65k


Known Issues
============

**JIRA TICKETS:**

`Known issues <https://jira.opnfv.org/issues/?filter=12028>`_

(Also See respective Integrated feature project's bug tracking)

Workarounds
===========

**JIRA TICKETS:**

-

(Also See respective Integrated feature project's bug tracking)

============
Test Results
============
The Euphrates 5.0 release with the Fuel deployment tool has undergone QA test
runs, see separate test results.

==========
References
==========
For more information on the OPNFV Euphrates 5.0 release, please see:

OPNFV
=====

1) `OPNFV Home Page <http://www.opnfv.org>`_
2) `OPNFV Documentation <http://docs.opnfv.org>`_
3) `OPNFV Software Downloads <https://www.opnfv.org/software/download>`_

OpenStack
=========

4) `OpenStack Ocata Release Artifacts <http://www.openstack.org/software/ocata>`_

5) `OpenStack Documentation <http://docs.openstack.org>`_

OpenDaylight
============

6) `OpenDaylight Artifacts <http://www.opendaylight.org/software/downloads>`_

Fuel
====

7) `Mirantis Cloud Platform Documentation <https://docs.mirantis.com/mcp/latest>`_
='n689' href='#n689'>689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835
/*
// Copyright (c) 2017 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
*/
#include "lib_acl.h"
#include "vnf_common.h"
#include <rte_port.h>
#define ACL_LIB_DEBUG 0
static struct rte_acl_field_def field_format_ipv4[] = {
	/* Protocol */
	[0] = {
				 .type = RTE_ACL_FIELD_TYPE_BITMASK,
				 .size = sizeof(uint8_t),
				 .field_index = 0,
				 .input_index = 0,
				 .offset = sizeof(struct ether_hdr) +
				 offsetof(struct ipv4_hdr, next_proto_id),
				 },

	/* Source IP address (IPv4) */
	[1] = {
				 .type = RTE_ACL_FIELD_TYPE_MASK,
				 .size = sizeof(uint32_t),
				 .field_index = 1,
				 .input_index = 1,
				 .offset = sizeof(struct ether_hdr) +
				 offsetof(struct ipv4_hdr, src_addr),
				 },

	/* Destination IP address (IPv4) */
	[2] = {
				 .type = RTE_ACL_FIELD_TYPE_MASK,
				 .size = sizeof(uint32_t),
				 .field_index = 2,
				 .input_index = 2,
				 .offset = sizeof(struct ether_hdr) +
				 offsetof(struct ipv4_hdr, dst_addr),
				 },

	/* Source Port */
	[3] = {
				 .type = RTE_ACL_FIELD_TYPE_RANGE,
				 .size = sizeof(uint16_t),
				 .field_index = 3,
				 .input_index = 3,
				 .offset = sizeof(struct ether_hdr) +
				 sizeof(struct ipv4_hdr) + offsetof(struct tcp_hdr, src_port),
				 },

	/* Destination Port */
	[4] = {
				 .type = RTE_ACL_FIELD_TYPE_RANGE,
				 .size = sizeof(uint16_t),
				 .field_index = 4,
				 .input_index = 3,
				 .offset = sizeof(struct ether_hdr) +
				 sizeof(struct ipv4_hdr) + offsetof(struct tcp_hdr, dst_port),
				 },
};

#define SIZEOF_VLAN_HDR                          4

static struct rte_acl_field_def field_format_vlan_ipv4[] = {
	/* Protocol */
	[0] = {
				 .type = RTE_ACL_FIELD_TYPE_BITMASK,
				 .size = sizeof(uint8_t),
				 .field_index = 0,
				 .input_index = 0,
				 .offset = sizeof(struct ether_hdr) +
				 SIZEOF_VLAN_HDR + offsetof(struct ipv4_hdr, next_proto_id),
				 },

	/* Source IP address (IPv4) */
	[1] = {
				 .type = RTE_ACL_FIELD_TYPE_MASK,
				 .size = sizeof(uint32_t),
				 .field_index = 1,
				 .input_index = 1,
				 .offset = sizeof(struct ether_hdr) +
				 SIZEOF_VLAN_HDR + offsetof(struct ipv4_hdr, src_addr),
				 },

	/* Destination IP address (IPv4) */
	[2] = {
				 .type = RTE_ACL_FIELD_TYPE_MASK,
				 .size = sizeof(uint32_t),
				 .field_index = 2,
				 .input_index = 2,
				 .offset = sizeof(struct ether_hdr) +
				 SIZEOF_VLAN_HDR + offsetof(struct ipv4_hdr, dst_addr),
				 },

	/* Source Port */
	[3] = {
				 .type = RTE_ACL_FIELD_TYPE_RANGE,
				 .size = sizeof(uint16_t),
				 .field_index = 3,
				 .input_index = 3,
				 .offset = sizeof(struct ether_hdr) +
				 SIZEOF_VLAN_HDR +
				 sizeof(struct ipv4_hdr) + offsetof(struct tcp_hdr, src_port),
				 },

	/* Destination Port */
	[4] = {
				 .type = RTE_ACL_FIELD_TYPE_RANGE,
				 .size = sizeof(uint16_t),
				 .field_index = 4,
				 .input_index = 4,
				 .offset = sizeof(struct ether_hdr) +
				 SIZEOF_VLAN_HDR +
				 sizeof(struct ipv4_hdr) + offsetof(struct tcp_hdr, dst_port),
				 },
};

#define SIZEOF_QINQ_HEADER                       8

static struct rte_acl_field_def field_format_qinq_ipv4[] = {
	/* Protocol */
	[0] = {
				 .type = RTE_ACL_FIELD_TYPE_BITMASK,
				 .size = sizeof(uint8_t),
				 .field_index = 0,
				 .input_index = 0,
				 .offset = sizeof(struct ether_hdr) +
				 SIZEOF_QINQ_HEADER + offsetof(struct ipv4_hdr, next_proto_id),
				 },

	/* Source IP address (IPv4) */
	[1] = {
				 .type = RTE_ACL_FIELD_TYPE_MASK,
				 .size = sizeof(uint32_t),
				 .field_index = 1,
				 .input_index = 1,
				 .offset = sizeof(struct ether_hdr) +
				 SIZEOF_QINQ_HEADER + offsetof(struct ipv4_hdr, src_addr),
				 },

	/* Destination IP address (IPv4) */
	[2] = {
				 .type = RTE_ACL_FIELD_TYPE_MASK,
				 .size = sizeof(uint32_t),
				 .field_index = 2,
				 .input_index = 2,
				 .offset = sizeof(struct ether_hdr) +
				 SIZEOF_QINQ_HEADER + offsetof(struct ipv4_hdr, dst_addr),
				 },

	/* Source Port */
	[3] = {
				 .type = RTE_ACL_FIELD_TYPE_RANGE,
				 .size = sizeof(uint16_t),
				 .field_index = 3,
				 .input_index = 3,
				 .offset = sizeof(struct ether_hdr) +
				 SIZEOF_QINQ_HEADER +
				 sizeof(struct ipv4_hdr) + offsetof(struct tcp_hdr, src_port),
				 },

	/* Destination Port */
	[4] = {
				 .type = RTE_ACL_FIELD_TYPE_RANGE,
				 .size = sizeof(uint16_t),
				 .field_index = 4,
				 .input_index = 4,
				 .offset = sizeof(struct ether_hdr) +
				 SIZEOF_QINQ_HEADER +
				 sizeof(struct ipv4_hdr) + offsetof(struct tcp_hdr, dst_port),
				 },
};

static struct rte_acl_field_def field_format_ipv6[] = {
	/* Protocol */
	[0] = {
				 .type = RTE_ACL_FIELD_TYPE_BITMASK,
				 .size = sizeof(uint8_t),
				 .field_index = 0,
				 .input_index = 0,
				 .offset = sizeof(struct ether_hdr) +
				 offsetof(struct ipv6_hdr, proto),
				 },

	/* Source IP address (IPv6) */
	[1] = {
				 .type = RTE_ACL_FIELD_TYPE_MASK,
				 .size = sizeof(uint32_t),
				 .field_index = 1,
				 .input_index = 1,
				 .offset = sizeof(struct ether_hdr) +
				 offsetof(struct ipv6_hdr, src_addr),
				 },

	[2] = {
				 .type = RTE_ACL_FIELD_TYPE_MASK,
				 .size = sizeof(uint32_t),
				 .field_index = 2,
				 .input_index = 2,
				 .offset = sizeof(struct ether_hdr) +
				 offsetof(struct ipv6_hdr, src_addr) + sizeof(uint32_t),
				 },

	[3] = {
				 .type = RTE_ACL_FIELD_TYPE_MASK,
				 .size = sizeof(uint32_t),
				 .field_index = 3,
				 .input_index = 3,
				 .offset = sizeof(struct ether_hdr) +
				 offsetof(struct ipv6_hdr, src_addr) + 2 * sizeof(uint32_t),
				 },

	[4] = {
				 .type = RTE_ACL_FIELD_TYPE_MASK,
				 .size = sizeof(uint32_t),
				 .field_index = 4,
				 .input_index = 4,
				 .offset = sizeof(struct ether_hdr) +
				 offsetof(struct ipv6_hdr, src_addr) + 3 * sizeof(uint32_t),
				 },

	/* Destination IP address (IPv6) */
	[5] = {
				 .type = RTE_ACL_FIELD_TYPE_MASK,
				 .size = sizeof(uint32_t),
				 .field_index = 5,
				 .input_index = 5,
				 .offset = sizeof(struct ether_hdr) +
				 offsetof(struct ipv6_hdr, dst_addr),
				 },

	[6] = {
				 .type = RTE_ACL_FIELD_TYPE_MASK,
				 .size = sizeof(uint32_t),
				 .field_index = 6,
				 .input_index = 6,
				 .offset = sizeof(struct ether_hdr) +
				 offsetof(struct ipv6_hdr, dst_addr) + sizeof(uint32_t),
				 },

	[7] = {
				 .type = RTE_ACL_FIELD_TYPE_MASK,
				 .size = sizeof(uint32_t),
				 .field_index = 7,
				 .input_index = 7,
				 .offset = sizeof(struct ether_hdr) +
				 offsetof(struct ipv6_hdr, dst_addr) + 2 * sizeof(uint32_t),
				 },

	[8] = {
				 .type = RTE_ACL_FIELD_TYPE_MASK,
				 .size = sizeof(uint32_t),
				 .field_index = 8,
				 .input_index = 8,
				 .offset = sizeof(struct ether_hdr) +
				 offsetof(struct ipv6_hdr, dst_addr) + 3 * sizeof(uint32_t),
				 },

	/* Source Port */
	[9] = {
				 .type = RTE_ACL_FIELD_TYPE_RANGE,
				 .size = sizeof(uint16_t),
				 .field_index = 9,
				 .input_index = 9,
				 .offset = sizeof(struct ether_hdr) +
				 sizeof(struct ipv6_hdr) + offsetof(struct tcp_hdr, src_port),
				 },

	/* Destination Port */
	[10] = {
		.type = RTE_ACL_FIELD_TYPE_RANGE,
		.size = sizeof(uint16_t),
		.field_index = 10,
		.input_index = 9,
		.offset = sizeof(struct ether_hdr) +
		sizeof(struct ipv6_hdr) + offsetof(struct tcp_hdr, dst_port),
		},
};

void *lib_acl_create_active_standby_table_ipv4(uint8_t table_num,
		uint32_t *libacl_n_rules)
{
	printf("Create LIBACL active IPV4 Tables rte_socket_id(): %i\n",
			rte_socket_id());

	/* Create IPV4 LIBACL Rule Tables */
	struct rte_table_acl_params common_ipv4_table_libacl_params = {
		.name = "LIBACLIPV4A",
		.n_rules = *libacl_n_rules,
		.n_rule_fields = RTE_DIM(field_format_ipv4),
	};

	memcpy(common_ipv4_table_libacl_params.field_format,
			field_format_ipv4, sizeof(field_format_ipv4));

	uint32_t ipv4_entry_size = sizeof(struct lib_acl_table_entry);
	/* Create second IPV4 Table */
	if (table_num == 2)
		common_ipv4_table_libacl_params.name = "LIBACLIPV4B";
	return	rte_table_acl_ops.f_create(&common_ipv4_table_libacl_params,
			rte_socket_id(),
			ipv4_entry_size);


}

void *lib_acl_create_active_standby_table_ipv6(uint8_t table_num,
		uint32_t *libacl_n_rules)
{
	printf("Create LIBACL active IPV6 Tables rte_socket_id(): %i\n",
			rte_socket_id());
	/* Create IPV6 LIBACL Rule Tables */
	struct rte_table_acl_params common_ipv6_table_libacl_params = {
		.name = "LIBACLIPV6A",
		.n_rules = *libacl_n_rules,
		.n_rule_fields = RTE_DIM(field_format_ipv6),
	};

	memcpy(common_ipv6_table_libacl_params.field_format,
			field_format_ipv6, sizeof(field_format_ipv6));

	uint32_t ipv6_entry_size = sizeof(struct lib_acl_table_entry);
	/* Create second IPV6 table */
	if (table_num == 2)
		common_ipv6_table_libacl_params.name = "LIBACLIPV6B";
	return	rte_table_acl_ops.f_create(&common_ipv6_table_libacl_params,
			rte_socket_id(),
			ipv6_entry_size);


}
int lib_acl_parse_config(struct lib_acl *plib_acl,
		char *arg_name, char *arg_value,
		uint32_t *libacl_n_rules)
{
	uint32_t n_rules_present = 0;
	uint32_t pkt_type_present = 0;
	/* defaults */
	plib_acl->n_rules = DEFULT_NUM_RULE;
	*libacl_n_rules = DEFULT_NUM_RULE;
	plib_acl->n_rule_fields = RTE_DIM(field_format_ipv4);
	plib_acl->field_format = field_format_ipv4;
	plib_acl->field_format_size = sizeof(field_format_ipv4);
	if (strcmp(arg_name, "n_rules") == 0) {
		if (n_rules_present) {
			printf("n_rules_present");
			return -1;
		}
		n_rules_present = 1;

		plib_acl->n_rules = atoi(arg_value);
		*libacl_n_rules = atoi(arg_value);
		return 0;
	}
	if (strcmp(arg_name, "pkt_type") == 0) {
		if (pkt_type_present) {
			printf("pkt_type");
			return -1;
		}
		pkt_type_present = 1;

		/* ipv4 */
		if (strcmp(arg_value, "ipv4") == 0) {
			plib_acl->n_rule_fields =
				RTE_DIM(field_format_ipv4);
			plib_acl->field_format = field_format_ipv4;
			plib_acl->field_format_size =
				sizeof(field_format_ipv4);
			return 0;
		}

		/* vlan_ipv4 */
		if (strcmp(arg_value, "vlan_ipv4") == 0) {
			plib_acl->n_rule_fields =
				RTE_DIM(field_format_vlan_ipv4);
			plib_acl->field_format =
				field_format_vlan_ipv4;
			plib_acl->field_format_size =
				sizeof(field_format_vlan_ipv4);
			return 0;
		}

		/* qinq_ipv4 */
		if (strcmp(arg_value, "qinq_ipv4") == 0) {
			plib_acl->n_rule_fields =
				RTE_DIM(field_format_qinq_ipv4);
			plib_acl->field_format =
				field_format_qinq_ipv4;
			plib_acl->field_format_size =
				sizeof(field_format_qinq_ipv4);
			return 0;
		}

		/* ipv6 */
		if (strcmp(arg_value, "ipv6") == 0) {
			plib_acl->n_rule_fields =
				RTE_DIM(field_format_ipv6);
			plib_acl->field_format = field_format_ipv6;
			plib_acl->field_format_size =
				sizeof(field_format_ipv6);
			return 0;
		}
		/* other */
		printf("other");
		return -1;
	}
	/* Parameter not processed in this parse function */
	return 1;
}


/**
 * Main packet processing function.
 * 64 packet bit mask are used to identify which packets to forward.
 * Performs the following:
 *  - Burst lookup packets in the IPv4 ACL Rule Table.
 *  - Lookup Action Table, perform actions.
 *  - Burst lookup Connection Tracking, if enabled.
 *  - Lookup MAC address.
 *  - Set bit mask.
 *  - Packets with bit mask set are forwarded
 *
 * @param p
 *  A pointer to the pipeline.
 * @param pkts
 *  A pointer to a burst of packets.
 * @param n_pkts
 *  Number of packets to process.
 * @param arg
 *  A pointer to pipeline specific data.
 *
 * @return
 *  0 on success, negative on error.
 */
	uint64_t
lib_acl_ipv4_pkt_work_key(struct lib_acl *plib_acl,
	struct rte_mbuf **pkts, uint64_t pkts_mask,
	uint64_t *pkts_drop_without_rule,
	void *plib_acl_rule_table_ipv4_active,
	struct pipeline_action_key *action_array_active,
	struct action_counter_block (*p_action_counter_table)[action_array_max],
	uint64_t *conntrack_mask,
	uint64_t *connexist_mask)
{

	uint64_t lookup_hit_mask_ipv4 = 0;
	uint64_t lookup_miss_mask_ipv4 = 0;
	int status;

	if (ACL_LIB_DEBUG)
		printf("ACL IPV4 Lookup Mask Before = 0x%"PRIx64"\n",
				pkts_mask);
	status = rte_table_acl_ops.f_lookup(
			plib_acl_rule_table_ipv4_active,
			pkts, pkts_mask, &lookup_hit_mask_ipv4,
			(void **) plib_acl->plib_acl_entries_ipv4);
	if (status < 0)
		printf("Lookup Failed\n");
	if (ACL_LIB_DEBUG)
		printf("ACL IPV4 Lookup Mask After = 0x%"PRIx64"\n",
				lookup_hit_mask_ipv4);
	if (ACL_LIB_DEBUG)
		printf("ACL Lookup Mask After = 0x%"PRIx64"\n",
				lookup_hit_mask_ipv4);

	lookup_miss_mask_ipv4 = pkts_mask & (~lookup_hit_mask_ipv4);
	pkts_mask = lookup_hit_mask_ipv4;
	*pkts_drop_without_rule += __builtin_popcountll(lookup_miss_mask_ipv4);
	if (ACL_LIB_DEBUG)
		printf("pkt_work_acl_key pkts_drop: %" PRIu64 " n_pkts: %u\n",
				*pkts_drop_without_rule,
				__builtin_popcountll(lookup_miss_mask_ipv4));
	/* bitmap of packets left to process for ARP */
	uint64_t pkts_to_process = lookup_hit_mask_ipv4;

	for (; pkts_to_process;) {
		uint8_t pos = (uint8_t)__builtin_ctzll(pkts_to_process);
		/* bitmask representing only this packet */
		uint64_t pkt_mask = 1LLU << pos;
		/* remove this packet from remaining list */
		pkts_to_process &= ~pkt_mask;
		struct rte_mbuf *pkt = pkts[pos];



		struct lib_acl_table_entry *entry =
			(struct lib_acl_table_entry *)
			plib_acl->plib_acl_entries_ipv4[pos];
		uint16_t phy_port = entry->head.port_id;
		uint32_t action_id = entry->action_id;

		if (ACL_LIB_DEBUG)
			printf("action_id = %u\n", action_id);

		uint32_t dscp_offset = IP_START + IP_HDR_DSCP_OFST;

		if (action_array_active[action_id].action_bitmap &
				lib_acl_action_count) {
			p_action_counter_table
				[plib_acl->action_counter_index]
				[action_id].packetCount++;
			p_action_counter_table
				[plib_acl->action_counter_index]
				[action_id].byteCount +=
				rte_pktmbuf_pkt_len(pkt);
			if (ACL_LIB_DEBUG)
				printf("Action Count   Packet Count: %"
						PRIu64 "  Byte Count: %"
						PRIu64 "\n"
						, p_action_counter_table
						[plib_acl->action_counter_index]
						[action_id].packetCount,
						p_action_counter_table
						[plib_acl->action_counter_index]
						[action_id].byteCount);
		}

		if (action_array_active[action_id].action_bitmap &
				lib_acl_action_packet_drop) {

			/* Drop packet by changing the mask */
			if (ACL_LIB_DEBUG)
				printf("ACL before drop pkt_mask %"
						PRIx64", pkt_num %d\n",
						pkts_mask, pos);
			pkts_mask &= ~(1LLU << pos);
			(*pkts_drop_without_rule)++;
			if (ACL_LIB_DEBUG)
				printf("ACL after drop pkt_mask %" PRIx64
					", pkt_num %d, action_packet_drop %"
					PRIu64 "\n", pkts_mask, pos,
					*pkts_drop_without_rule);
		}

		if (action_array_active[action_id].action_bitmap &
				lib_acl_action_fwd) {
			phy_port = action_array_active[action_id].
				fwd_port;
			entry->head.port_id = phy_port;
			if (ACL_LIB_DEBUG)
				printf("Action FWD  Port ID: %"
						PRIu16"\n", phy_port);
		}

		if (action_array_active[action_id].action_bitmap &
				lib_acl_action_nat) {
			phy_port = action_array_active[action_id].
				nat_port;
			entry->head.port_id = phy_port;
			if (ACL_LIB_DEBUG)
				printf("Action NAT  Port ID: %"
						PRIu16"\n", phy_port);
		}

		if (action_array_active[action_id].action_bitmap &
				lib_acl_action_dscp) {

			/* Set DSCP priority */
			uint8_t *dscp = RTE_MBUF_METADATA_UINT8_PTR(pkt,
					dscp_offset);
			*dscp = action_array_active[action_id].
				dscp_priority << 2;
			if (ACL_LIB_DEBUG)
				printf("Action DSCP   DSCP Priority: %"
						PRIu16 "\n", *dscp);
		}

		if (action_array_active[action_id].action_bitmap &
				lib_acl_action_packet_accept) {
			if (ACL_LIB_DEBUG)
				printf("Action Accept\n");

			if (action_array_active[action_id].action_bitmap
					& lib_acl_action_conntrack) {

				/* Set conntrack bit for this pkt */
				*conntrack_mask |= pkt_mask;
				if (ACL_LIB_DEBUG)
					printf("ACL CT enabled: 0x%"
							PRIx64"  pkt_mask: 0x%"
							PRIx64"\n",
							*conntrack_mask,
							pkt_mask);
			}

			if (action_array_active[action_id].action_bitmap
					& lib_acl_action_connexist) {

				/* Set conntrack bit for this pkt */
				*conntrack_mask |= pkt_mask;

				/* Set connexist bit for this pkt for
				 * public -> private */
				/* Private -> public packet will open
				 * the connection */
				if (action_array_active[action_id].
						private_public ==
						lib_acl_public_private)
					*connexist_mask |= pkt_mask;

				if (ACL_LIB_DEBUG)
					printf("ACL Connexist ENB CT:0x%"
							PRIx64"  connexist: 0x%"
							PRIx64"  pkt_mask: 0x%"
							PRIx64"\n",
							*conntrack_mask,
							*connexist_mask,
							pkt_mask);
			}
		}

	}
	return pkts_mask;
}
/**
 * Main packet processing function.
 * 64 packet bit mask are used to identify which packets to forward.
 * Performs the following:
 *  - Burst lookup packets in the IPv6 ACL Rule Table.
 *  - Lookup Action Table, perform actions.
 *  - Burst lookup Connection Tracking, if enabled.
 *  - Lookup MAC address.
 *  - Set bit mask.
 *  - Packets with bit mask set are forwarded
 *
 * @param p
 *  A pointer to the pipeline.
 * @param pkts
 *  A pointer to a burst of packets.
 * @param n_pkts
 *  Number of packets to process.
 * @param arg
 *  A pointer to pipeline specific data.
 *
 * @return
 *  0 on success, negative on error.
 */
	uint64_t
lib_acl_ipv6_pkt_work_key(struct lib_acl *plib_acl,
	struct rte_mbuf **pkts, uint64_t pkts_mask,
	uint64_t *pkts_drop_without_rule,
	void *plib_acl_rule_table_ipv6_active,
	struct pipeline_action_key *action_array_active,
	struct action_counter_block (*p_action_counter_table)[action_array_max],
	uint64_t *conntrack_mask,
	uint64_t *connexist_mask)
{

	uint64_t lookup_hit_mask_ipv6 = 0;
	uint64_t lookup_miss_mask_ipv6 = 0;
	int status;


	if (ACL_LIB_DEBUG)
		printf("ACL IPV6 Lookup Mask Before = 0x%"PRIx64"\n",
				pkts_mask);
	status = rte_table_acl_ops.f_lookup(
			plib_acl_rule_table_ipv6_active,
			pkts, pkts_mask, &lookup_hit_mask_ipv6,
			(void **) plib_acl->plib_acl_entries_ipv6);
	if (status < 0)
		printf("Lookup Failed\n");
	if (ACL_LIB_DEBUG)
		printf("ACL IPV6 Lookup Mask After = 0x%"PRIx64"\n",
				lookup_hit_mask_ipv6);

	if (ACL_LIB_DEBUG)
		printf("ACL Lookup Mask After = 0x%"PRIx64"\n",
				lookup_hit_mask_ipv6);

	lookup_miss_mask_ipv6 = pkts_mask & (~lookup_hit_mask_ipv6);
	pkts_mask = lookup_hit_mask_ipv6;
	*pkts_drop_without_rule += __builtin_popcountll(lookup_miss_mask_ipv6);
	if (ACL_LIB_DEBUG)
		printf("pkt_work_acl_key pkts_drop: %" PRIu64 " n_pkts: %u\n",
				*pkts_drop_without_rule,
				__builtin_popcountll(lookup_miss_mask_ipv6));
	/* bitmap of packets left to process for ARP */
	uint64_t pkts_to_process = lookup_hit_mask_ipv6;

	for (; pkts_to_process;) {
		uint8_t pos = (uint8_t)__builtin_ctzll(pkts_to_process);
		/* bitmask representing only this packet */
		uint64_t pkt_mask = 1LLU << pos;
		/* remove this packet from remaining list */
		pkts_to_process &= ~pkt_mask;
		struct rte_mbuf *pkt = pkts[pos];


		struct lib_acl_table_entry *entry =
			(struct lib_acl_table_entry *)
			plib_acl->plib_acl_entries_ipv6[pos];
		uint16_t phy_port = entry->head.port_id;
		uint32_t action_id = entry->action_id;

		if (ACL_LIB_DEBUG)
			printf("action_id = %u\n", action_id);

		if (action_array_active[action_id].action_bitmap &
				lib_acl_action_count) {
			p_action_counter_table
				[plib_acl->action_counter_index]
				[action_id].packetCount++;
			p_action_counter_table
				[plib_acl->action_counter_index]
				[action_id].byteCount +=
				rte_pktmbuf_pkt_len(pkt);
			if (ACL_LIB_DEBUG)
				printf("Action Count   Packet Count: %"
						PRIu64 "  Byte Count: %"
						PRIu64 "\n",
						p_action_counter_table
						[plib_acl->action_counter_index]
						[action_id].packetCount,
						p_action_counter_table
						[plib_acl->action_counter_index]
						[action_id].byteCount);
		}

		if (action_array_active[action_id].action_bitmap &
				lib_acl_action_packet_drop) {
			/* Drop packet by changing the mask */
			if (ACL_LIB_DEBUG)
				printf("ACL before drop pkt_mask %"
						PRIx64", pkt_num %d\n",
						pkts_mask, pos);
			pkts_mask &= ~(1LLU << pos);
			(*pkts_drop_without_rule)++;
			if (ACL_LIB_DEBUG)
				printf("ACL after drop pkt_mask %" PRIx64
					", pkt_num %d, action_packet_drop %"
					PRIu64 "\n", pkts_mask, pos,
					*pkts_drop_without_rule);

		}

		if (action_array_active[action_id].action_bitmap &
				lib_acl_action_fwd) {
			phy_port = action_array_active[action_id].
				fwd_port;
			entry->head.port_id = phy_port;
			if (ACL_LIB_DEBUG)
				printf("Action FWD  Port ID: %"
						PRIu16"\n", phy_port);
		}

		if (action_array_active[action_id].action_bitmap &
				lib_acl_action_nat) {
			phy_port = action_array_active[action_id].
				nat_port;
			entry->head.port_id = phy_port;
			if (ACL_LIB_DEBUG)
				printf("Action NAT  Port ID: %"
						PRIu16"\n", phy_port);
		}

		if (action_array_active[action_id].action_bitmap &
				lib_acl_action_dscp) {

			/* Set DSCP priority */
			uint32_t dscp_offset = IP_START +
				IP_HDR_DSCP_OFST_IPV6;
			uint16_t *dscp = RTE_MBUF_METADATA_UINT16_PTR(
					pkt, dscp_offset);
			uint16_t temp = *dscp;
			uint16_t dscp_value = (rte_bswap16(temp) &
					0XF00F);
			uint8_t dscp_store =
				action_array_active
				[action_id].dscp_priority << 2;
			uint16_t dscp_temp = dscp_store;

			dscp_temp = dscp_temp << 4;
			*dscp = rte_bswap16(dscp_temp | dscp_value);
			if (ACL_LIB_DEBUG)
				printf("Action DSCP   DSCP Priority: %"
						PRIu16"\n", *dscp);
		}

		if (action_array_active[action_id].action_bitmap
				& lib_acl_action_packet_accept) {
			if (ACL_LIB_DEBUG)
				printf("Action Accept\n");

			if (action_array_active[action_id].action_bitmap
					& lib_acl_action_conntrack) {

				/* Set conntrack bit for this pkt */
				*conntrack_mask |= pkt_mask;
				if (ACL_LIB_DEBUG)
					printf("ACL CT enabled: 0x%"
							PRIx64" pkt_mask: 0x%"
							PRIx64"\n",
							*conntrack_mask,
							pkt_mask);
			}

			if (action_array_active[action_id].action_bitmap
					& lib_acl_action_connexist) {

				/* Set conntrack bit for this pkt */
				*conntrack_mask |= pkt_mask;

				/* Set connexist bit for this pkt for
				 * public -> private */
				/* Private -> public packet will open
				 * the connection */
				if (action_array_active[action_id].
						private_public ==
						lib_acl_public_private)
					*connexist_mask |= pkt_mask;

				if (ACL_LIB_DEBUG)
					printf("ACL Connexist ENB CT:0x%"
							PRIx64"  connexist: 0x%"
							PRIx64"  pkt_mask: 0x%"
							PRIx64"\n",
							*conntrack_mask,
							*connexist_mask,
							pkt_mask);
			}
		}
	}
	return pkts_mask;
}