[vpp-dev] ip-rewrite bug?

2019-03-05 Thread Kingwel Xie
Hi vpp-dev,

I’m looking at the ip-rewrite node, and I think it might be a bug at:

vnet_rewrite_one_header (adj0[0], ip0, sizeof (ethernet_header_t));

The adj-> rewrite_header.data_bytes might be 0 when it comes to tunnel 
interface, f.g., gtpu, ipsec. Thus, at least 8 bytes garbage are written to 
buffer unexpectedly. I came across to this because I’m doing handoff for tunnel 
interface, and in this case, 8 bytes memcpy leads to some performance loss, 
cache trashing…

Temporarily I created a patch for more discussion. Please take a look. There 
should be a better way to fix it…

https://gerrit.fd.io/r/18014

Regards,
Kingwel
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#12431): https://lists.fd.io/g/vpp-dev/message/12431
Mute This Topic: https://lists.fd.io/mt/30224541/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [vpp-dev] ip-rewrite bug?

2019-03-05 Thread Dave Barach via Lists.Fd.Io
Let’s try to fix the underlying code in vnet_rewrite_one_header, and friends. 
The code already checks for the magic rewrite length 14. Anyhow, the 
header-rewrite scheme hasn’t had a serious performance tuning pass in a long 
time. Since it’s used everywhere, shaving a couple of clock cycles from it 
would be a Good Thing...

D.

From: vpp-dev@lists.fd.io  On Behalf Of Kingwel Xie
Sent: Tuesday, March 5, 2019 4:40 AM
To: vpp-dev@lists.fd.io
Subject: [vpp-dev] ip-rewrite bug?

Hi vpp-dev,

I’m looking at the ip-rewrite node, and I think it might be a bug at:

vnet_rewrite_one_header (adj0[0], ip0, sizeof (ethernet_header_t));

The adj-> rewrite_header.data_bytes might be 0 when it comes to tunnel 
interface, f.g., gtpu, ipsec. Thus, at least 8 bytes garbage are written to 
buffer unexpectedly. I came across to this because I’m doing handoff for tunnel 
interface, and in this case, 8 bytes memcpy leads to some performance loss, 
cache trashing…

Temporarily I created a patch for more discussion. Please take a look. There 
should be a better way to fix it…

https://gerrit.fd.io/r/18014

Regards,
Kingwel
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#12432): https://lists.fd.io/g/vpp-dev/message/12432
Mute This Topic: https://lists.fd.io/mt/30224541/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[vpp-dev] NAT New Node Registration

2019-03-05 Thread emma sdi
Hi Dear VPP

I need to perform out2in nat operation before input-acl, so I'm trying to
register new node as below:
-
plugins/nat/nat.c:
VNET_FEATURE_INIT (ip4_snat_out2in_input, static) = {
.arc_name = "ip4-unicast",
.node_name = "nat44-out2in-input",
.runs_before = VNET_FEATURES ("acl-plugin-in-ip4-fa"),
};
-
and the related node registration:
-
plugins/nat/out2in.c:
VLIB_REGISTER_NODE (snat_out2in_input_node) = {
.function = snat_out2in_input_node_fn,
.name = "nat44-out2in-input",
.vector_size = sizeof (u32),
.format_trace = format_snat_out2in_trace,
.type = VLIB_NODE_TYPE_INTERNAL,

.n_errors = ARRAY_LEN(snat_out2in_error_strings),
.error_strings = snat_out2in_error_strings,

.runtime_data_bytes = sizeof (snat_runtime_t),

.n_next_nodes = SNAT_OUT2IN_N_NEXT,

/* edit / add dispositions here */
.next_nodes = {
[SNAT_OUT2IN_NEXT_DROP] = "error-drop",
[SNAT_OUT2IN_NEXT_LOOKUP] = "acl-plugin-in-ip4-fa",
[SNAT_OUT2IN_NEXT_ICMP_ERROR] = "ip4-icmp-error",
[SNAT_OUT2IN_NEXT_REASS] = "nat44-out2in-reass",
},
};
(comment: snat_out2in_input_node_fn and snat_out2in_node_fn are the same
except in counters)
-
then i want to  enable this feature on
snat_interface_add_del_output_feature function call and just for one worker
so I changed this function as below:
-
plugins/nat/nat.c |  snat_interface_add_del_output_feature function:
   // vnet_feature_enable_disable ("ip4-unicast", "nat44-out2in",
// sw_if_index, !is_del, 0, 0);
   vnet_feature_enable_disable ("ip4-unicast", "nat44-out2in-input",
 sw_if_index, !is_del, 0, 0);
   vnet_feature_enable_disable ("ip4-output", "nat44-in2out-output",
 sw_if_index, !is_del, 0, 0);
-
the problem is that in some cases vnet_feature_next function in input-acl
returns next0=5 and then packets are dropped because of  node->n_next_nodes
is 3:
next0 = next0 < node->n_next_nodes ? next0 : 0;
in plugins/acl/dataplane_node.c.
Am I missing something? what's wrong with my code?
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#12433): https://lists.fd.io/g/vpp-dev/message/12433
Mute This Topic: https://lists.fd.io/mt/30225687/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [vpp-dev] Build failure question

2019-03-05 Thread Thomas F Herbert



On 03/05/2019 02:37 AM, Damjan Marion wrote:



On 4 Mar 2019, at 22:52, Thomas F Herbert > wrote:


Damjan et. al.

I get build failures when builging from a tarball  outside of git 
tree on 19.01


I documented this in https://jira.fd.io/browse/VPP-1577

This is not reproduceable when building in git tree.

Could you please take a look at the cmake output and give me some 
suggestions.


—Tom



It is likely fixed in master, please try with master.

Yes, I believe it is fixed in master. Do you know which commit fixed it?

--
*Thomas F Herbert*
NFV and Fast Data Planes
Networking Group Office of the CTO
*Red Hat*
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#12434): https://lists.fd.io/g/vpp-dev/message/12434
Mute This Topic: https://lists.fd.io/mt/30219549/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [vpp-dev] Build failure question

2019-03-05 Thread Damjan Marion via Lists.Fd.Io


> On 5 Mar 2019, at 15:14, Thomas F Herbert  wrote:
> 
> 
> 
> 
> On 03/05/2019 02:37 AM, Damjan Marion wrote:
>> 
>> 
>>> On 4 Mar 2019, at 22:52, Thomas F Herbert >> > wrote:
>>> 
>>> Damjan et. al.
>>> 
>>> I get build failures when builging from a tarball  outside of git tree on 
>>> 19.01
>>> 
>>> I documented this in https://jira.fd.io/browse/VPP-1577 
>>> 
>>> This is not reproduceable when building in git tree.
>>> 
>>> Could you please take a look at the cmake output and give me some 
>>> suggestions.
>>> 
>>> —Tom
>>> 
>> 
>> It is likely fixed in master, please try with master.
> Yes, I believe it is fixed in master. Do you know which commit fixed it?

May be:

Author: Damjan Marion 
AuthorDate: Mon Jan 28 17:55:59 2019 +0100
Commit: Marco Varlese 
CommitDate: Tue Jan 29 07:47:01 2019 +

cmake: fix out-of-git-tree build

Change-Id: Ib94637ec09799c23f3179599b54a2be6e2768425
Signed-off-by: Damjan Marion 


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#12435): https://lists.fd.io/g/vpp-dev/message/12435
Mute This Topic: https://lists.fd.io/mt/30219549/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [vpp-dev] Build failure question

2019-03-05 Thread Thomas F Herbert



On 03/05/2019 09:40 AM, Damjan Marion wrote:



On 5 Mar 2019, at 15:14, Thomas F Herbert > wrote:




On 03/05/2019 02:37 AM, Damjan Marion wrote:



On 4 Mar 2019, at 22:52, Thomas F Herbert > wrote:


Damjan et. al.

I get build failures when builging from a tarball  outside of git 
tree on 19.01


I documented this in https://jira.fd.io/browse/VPP-1577

This is not reproduceable when building in git tree.

Could you please take a look at the cmake output and give me some 
suggestions.


—Tom



It is likely fixed in master, please try with master.

Yes, I believe it is fixed in master. Do you know which commit fixed it?


May be:

Yes, Thanks!
 I found it and backported the patch and am testing it. I had already 
found the problem with pack.cmake but missed the

version include changes.
I will update JIRA 1577 with results in case we decide to backport it.


Author:     Damjan Marion mailto:damar...@cisco.com>>
AuthorDate: Mon Jan 28 17:55:59 2019 +0100
Commit:     Marco Varlese >

CommitDate: Tue Jan 29 07:47:01 2019 +

    cmake: fix out-of-git-tree build

    Change-Id: Ib94637ec09799c23f3179599b54a2be6e2768425
    Signed-off-by: Damjan Marion >





--
*Thomas F Herbert*
NFV and Fast Data Planes
Networking Group Office of the CTO
*Red Hat*
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#12436): https://lists.fd.io/g/vpp-dev/message/12436
Mute This Topic: https://lists.fd.io/mt/30219549/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [vpp-dev] ip-rewrite bug?

2019-03-05 Thread Kingwel Xie
Thanks. Look forward to the fix…

From: Dave Barach (dbarach) 
Sent: Tuesday, March 05, 2019 8:25 PM
To: Kingwel Xie ; vpp-dev@lists.fd.io
Subject: RE: ip-rewrite bug?

Let’s try to fix the underlying code in vnet_rewrite_one_header, and friends. 
The code already checks for the magic rewrite length 14. Anyhow, the 
header-rewrite scheme hasn’t had a serious performance tuning pass in a long 
time. Since it’s used everywhere, shaving a couple of clock cycles from it 
would be a Good Thing...

D.

From: vpp-dev@lists.fd.io 
mailto:vpp-dev@lists.fd.io>> On Behalf Of Kingwel Xie
Sent: Tuesday, March 5, 2019 4:40 AM
To: vpp-dev@lists.fd.io
Subject: [vpp-dev] ip-rewrite bug?

Hi vpp-dev,

I’m looking at the ip-rewrite node, and I think it might be a bug at:

vnet_rewrite_one_header (adj0[0], ip0, sizeof (ethernet_header_t));

The adj-> rewrite_header.data_bytes might be 0 when it comes to tunnel 
interface, f.g., gtpu, ipsec. Thus, at least 8 bytes garbage are written to 
buffer unexpectedly. I came across to this because I’m doing handoff for tunnel 
interface, and in this case, 8 bytes memcpy leads to some performance loss, 
cache trashing…

Temporarily I created a patch for more discussion. Please take a look. There 
should be a better way to fix it…

https://gerrit.fd.io/r/18014

Regards,
Kingwel
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#12437): https://lists.fd.io/g/vpp-dev/message/12437
Mute This Topic: https://lists.fd.io/mt/30224541/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-