From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 3549A595E for ; Wed, 20 Jan 2016 02:47:55 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 19 Jan 2016 17:47:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,319,1449561600"; d="scan'208";a="864325994" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga001.jf.intel.com with ESMTP; 19 Jan 2016 17:47:53 -0800 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id u0K1lpZA027563; Wed, 20 Jan 2016 09:47:51 +0800 Received: from shecgisg003.sh.intel.com (localhost [127.0.0.1]) by shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id u0K1lnje011486; Wed, 20 Jan 2016 09:47:51 +0800 Received: (from yliu84x@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id u0K1lnwA011482; Wed, 20 Jan 2016 09:47:49 +0800 From: Yong Liu To: dts@dpdk.org Date: Wed, 20 Jan 2016 09:47:43 +0800 Message-Id: <1453254463-11436-3-git-send-email-yong.liu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1453254463-11436-1-git-send-email-yong.liu@intel.com> References: <1453254463-11436-1-git-send-email-yong.liu@intel.com> Subject: [dts] [PATCH 3/3] nics fm10k: support optimize rule and vlan/jumbo setting X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 01:47:55 -0000 1) Add basic rule to enhance RRC performance. 2) Add basic rule to redirect PEP to assigned EPL. 3) Support RRC rx/tx vlan function. 4) Support RRC jumboframe setting. Signed-off-by: Marvin Liu diff --git a/nics/fm10k.py b/nics/fm10k.py index ab35981..7d42814 100644 --- a/nics/fm10k.py +++ b/nics/fm10k.py @@ -29,7 +29,6 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - from crb import Crb from config import PortConf, PORTCONF from exception import PortConfigParseException @@ -39,6 +38,44 @@ from net_device import NetDevice DEF_PASSWD = 's' TP_BINARY = 'TestPoint' +FUNC_RULES = [ + # disable cut through for jumbo frame case + 'set port config 20,22 tx_cut_through off', + # disable mac learning + 'set port config 0..22 learning off', + #redirect PEP0 to EPL0 + 'create acl 0', + 'create acl-rule 0 0', + 'add acl-rule condition 0 0 src-port 20', + 'add acl-rule action 0 0 redirect 1', + 'add acl-rule action 0 0 count', + #redirect PEP1 to EPL1 + 'create acl 1', + 'create acl-rule 1 0', + 'add acl-rule condition 1 0 src-port 22', + 'add acl-rule action 1 0 redirect 5', + 'add acl-rule action 1 0 count', + 'apply acl', + ] + +PERF_RULES = [ + 'set port config 0..11 parser_cfg L4', # frame parser up to L4 + # good for performance + 'set api attribute boolean api.paritySweeper.enable false', + 'reg dbg set 0 CM_SOFTDROP_WM 0x5f005f00 0 0', + 'reg dbg set 0 CM_SHARED_WM 0x5f00 0 0', + # rule for direct rx traffic + # mac filter will be useless, so only enable for perf + 'create acl-rule 0 1', + 'add acl-rule condition 0 1 src-port 1', + 'add acl-rule action 0 1 redirect 20', + 'add acl-rule action 0 1 count', + 'create acl-rule 1 1', + 'add acl-rule condition 1 1 src-port 5', + 'add acl-rule action 1 1 redirect 22', + 'add acl-rule action 1 1 count', + 'apply acl', + ] class CtrlCrb(Crb): """ @@ -113,13 +150,29 @@ class RedRockCanyou(NetDevice): # setup function should be called after bind to igb_uio self.start_testpoint() - def close(self): + def optimize_perf(self, peer0="", peer1=""): + # rule which can optimize performance + if self.sec_port is False: + # applied rules + for rule in PERF_RULES: + self.ctrl_crb.send_expect("%s" %rule, "<0>%") + # add default mac rule + self.ctrl_crb.send_expect("add mac %s 1 locked port 1" % peer0, "<0>%") + self.ctrl_crb.send_expect("add mac %s 1 locked port 5" % peer1, "<0>%") + + def stop(self): # second port do not need any operation if self.sec_port: return # stop testpoint self.stop_testpoint() + + def close(self): + # second port do not need any operation + if self.sec_port: + return + # close session if self.ctrl_crb.session: self.ctrl_crb.session.close() @@ -142,6 +195,8 @@ class RedRockCanyou(NetDevice): command = TP_BINARY self.ctrl_crb.send_expect("%s" % command, "<0>%", 120) + for rule in FUNC_RULES: + self.ctrl_crb.send_expect("%s" %rule, "<0>%") def stop_testpoint(self): """ @@ -152,13 +207,34 @@ class RedRockCanyou(NetDevice): def get_control(self): return self.ctrl_crb - def enable_vlan(self, vlan_id=0): + def add_vlan(self, vlan_id=0): self.ctrl_crb.send_expect("create vlan %d" % vlan_id, "<0>%") - self.ctrl_crb.send_expect("add vlan port %d 1,5,20,22" % vlan_id, "<0>%") + if self.sec_port: + self.ctrl_crb.send_expect("add vlan port %d 5,22" % vlan_id, "<0>%") + else: + self.ctrl_crb.send_expect("add vlan port %d 1,20" % vlan_id, "<0>%") - def disable_vlan(self, vlan_id=0): - self.ctrl_crb.send_expect("del vlan port %d 1,5,20,22" % vlan_id, "<0>%") + def delete_vlan(self, vlan_id=0): + if self.sec_port: + self.ctrl_crb.send_expect("del vlan port %d 5,22" % vlan_id, "<0>%") + else: + self.ctrl_crb.send_expect("del vlan port %d 1,20" % vlan_id, "<0>%") self.ctrl_crb.send_expect("del vlan %d" % vlan_id, "<0>%") - def enable_jumbo(self): - NotImplemented + def add_txvlan(self, vlan_id=0): + if self.sec_port: + self.ctrl_crb.send_expect("set vlan tagging %d 5 tag" % vlan_id, "<0>%") + else: + self.ctrl_crb.send_expect("set vlan tagging %d 1 tag" % vlan_id, "<0>%") + + def delete_txvlan(self, vlan_id=0): + if self.sec_port: + self.ctrl_crb.send_expect("set vlan tagging %d 5 untag" % vlan_id, "<0>%") + else: + self.ctrl_crb.send_expect("set vlan tagging %d 1 untag" % vlan_id, "<0>%") + + def enable_jumbo(self, framesize=0): + if self.sec_port: + self.ctrl_crb.send_expect("set port config 5 max_frame_size %d" % framesize, "<0>%") + else: + self.ctrl_crb.send_expect("set port config 1 max_frame_size %d" % framesize, "<0>%") -- 2.4.3