Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Apr 2013 20:01:23 +0400
From:      "Alexander V. Chernikov" <melifaro@FreeBSD.org>
To:        freebsd-ipfw@freebsd.org
Cc:        luigi@freebsd.org
Subject:   [patch] ipfw interface tracking and opcode rewriting
Message-ID:  <517801D3.5040502@FreeBSD.org>

Next in thread | Raw E-Mail | Index | Archive | Help
This is a multi-part message in MIME format.
--------------060008050505010104000604
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hello list!

Currently ipfw uses strncmp() function to do interface matching which is 
quite slow.
Additionally, ipfw_insn_if opcode is quite big and given that struct 
ip_fw occupy 48 bytes
(without first instruction) which gives us good chance that part of 
interface name will be on the second cache line on amd64.

Pure synthetic testing (ipfw with 1 and 2 'ipfw count ip from any to any 
recv ifaceX') shows about 3.8% performance loss (190kpps out of 5.1 
mpps) for each rule,
while indexed version shows about 2.0% and 1.2% for first and second rule.

Additionally, our production (8.3-based firewalls with old strncmp) 
shows about 40% kernel time spent in strncmp on 1-2mpps (each packet 
traverses 5-6 such rules).

Here is the patch which does the following:
1) adds interface tracking for ipfw. Every interface is tracked 
regardless of its usage in the ruleset. This simplifies locking and 
makes easier to port such functionality to userland.
2) adds general opcode rewriting system permitting kernel to 
algorithmically (stateless) or statefully (involving extrernal data) 
rewrite user-supplied opcodes with possible size change.
This can be used to deprecate opcodes which are now superseded by newer 
ones while keeping ABI (and we currently have such opcodes).
3) Store (and track) inderface index for non-wildcard interface inside 
opcode.

If there are no objections I would like to commit (possibly updated 
vesrion) in the middle of the next week.



--------------060008050505010104000604
Content-Type: text/plain; charset=UTF-8;
 name="ip_fw_rewrite3.diff"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="ip_fw_rewrite3.diff"

SW5kZXg6IHN5cy9uZXRpbmV0L2lwX2Z3LmgKPT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0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XRlID0gaXBmd19maW5kX3Jld3JpdGUoaW5zbi0+b3Bjb2RlKSkg
PT0gTlVMTCkKKwkJcmV0dXJuOworCisJaWYgKHJld3JpdGUtPnVwZGF0ZSA9PSBOVUxMKQor
CQlyZXR1cm47CisKKwlyZXdyaXRlLT51cGRhdGUoY2hhaW4sIGluc24sIHN0YXRlLCB2YWwp
OworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKgorICogCQkJCQkJCQkgICAgKgorICogICAgICAgICAg
T19SRUNWIHwgT19WSUEgfCBPX1hNSVQgcmV3cml0ZSBoYW5kbGluZy4gICAgICAgICAgICAg
ICAqCisgKiAJCQkJCQkJCSAgICAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qCisgKiBDb252ZXJ0
cyBpbnNuc19pZiB0byBtb3JlIGNvbXBhY3QgZm9ybS4gQ3VycmVudGx5IGluc3RydWN0aW9u
CisgKiBpcyB1c2VkIHRvIHNwZWNpZnkKKyAqIDEpIGludGVyZmFjZSBuYW1lICggLT5uYW1l
WzBdICE9ICgnXDAnIHwgJ1wxJykgQU5EIHAuZ2xvYiA9PSAwKQorICogMikgaW50ZXJmYWNl
IHBhdHRlcm4gKCAtPm5hbWVbMF0gIT0gKCdcMCcgfCAnXDEnKSBBTkQgcC5nbG9iICE9IDAp
CisgKiAzKSBlWHRlbmRlZCB0YWJsZSBudW1iZXIgKCAtPm5hbWVbMF0gPT0gJ1wxJykKKyAq
IDQpIGludGVyZmFjZSBhZGRyZXNzICggLT5uYW1lWzBdID09ICdcMCcpCisgKgorICogV2Ug
d2FudCB0byBzYXZlIGlmYWNlIGluZGV4IGluIGNhc2UgMSAoYW5kIHRvIGVsaW1pbmF0ZSBp
bnRlcmZhY2UgbmFtZSBhdCBhbGwpLgorICogR2l2ZW4gdGhhdCwgd2UgZG8gd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J1Y3QgaXBfZndfY2hhaW4gKmNoYWluLCBzdHJ1Y3QgaWZh
Y2VfbWFzayAqaWZtKTsKKworI2VuZGlmCisKCg==
--------------060008050505010104000604--



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?517801D3.5040502>