From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerin Jacob Subject: Re: [PATCH] app/testpmd: support bitmask for RSS and FDIR Date: Fri, 10 Aug 2018 09:15:09 +0530 Message-ID: <20180810034507.GA3295@jerin> References: <1533534335-119817-1-git-send-email-beilei.xing@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: wenzhuo.lu@intel.com, jingjing.wu@intel.com, dev@dpdk.org To: Beilei Xing Return-path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0048.outbound.protection.outlook.com [104.47.32.48]) by dpdk.org (Postfix) with ESMTP id C01C725D9 for ; Fri, 10 Aug 2018 05:45:24 +0200 (CEST) Content-Disposition: inline In-Reply-To: <1533534335-119817-1-git-send-email-beilei.xing@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" -----Original Message----- > Date: Mon, 6 Aug 2018 13:45:35 +0800 > From: Beilei Xing > To: wenzhuo.lu@intel.com, jingjing.wu@intel.com > CC: dev@dpdk.org > Subject: [dpdk-dev] [PATCH] app/testpmd: support bitmask for RSS and FDIR > X-Mailer: git-send-email 2.5.5 > > > This patch adds bitmask support for RSS, FDIR > and FDIR flexible payload. > > Signed-off-by: Beilei Xing > --- > app/test-pmd/cmdline.c | 199 +++++++++++++++++++++++++--- > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 8 +- > 2 files changed, 187 insertions(+), 20 deletions(-) > > +#ifdef RTE_LIBRTE_I40E_PMD How about moving all driver specific tests to driver/net//? I think, it wont scale if everyone starts adding their own driver specific tests to testpmd. How about creating #A generic string parser in testpmd? something like, port config (port_id) .... # and do driver_name to port_id lookup # and introduce "test" or "self_test" ops in ethdev # and call "test" op on the selected port_id > + if (!strcmp(res->inset_type, "hash_inset")) > + inset_type = INSET_HASH; > + else if (!strcmp(res->inset_type, "fdir_inset")) > + inset_type = INSET_FDIR; > + else if (!strcmp(res->inset_type, "fdir_flx_inset")) > + inset_type = INSET_FDIR_FLX; > + ret = rte_pmd_i40e_inset_get(res->port_id, res->pctype_id, > + &inset, inset_type); > + if (ret) { > + printf("Failed to get input set.\n"); > + return; > + } > + > + if (!strcmp(res->opt, "get")) { > + ret = rte_pmd_i40e_inset_field_get(inset.inset, > + res->field_idx); > + if (ret) { > + printf("Field index %d is enabled.\n", res->field_idx); > + for (i = 0; i < 2; i++) { > + if (inset.mask[i].field_idx == res->field_idx) { > + printf("Mask is: 0x%x\n", > + inset.mask[i].mask); > + break; > + } > + } > + } else { > + printf("Field index %d is disabled.\n", res->field_idx); > + } > + return; > + } else if (!strcmp(res->opt, "clear")) { > + ret = rte_pmd_i40e_inset_field_clear(&inset.inset, > + res->field_idx); > + if (ret) { > + printf("Failed to clear input set field.\n"); > + return; > + } > + for (i = 0; i < 2; i++) { > + if (inset.mask[i].field_idx == res->field_idx) { > + inset.mask[i].mask = 0; > + break; > + } > + } > + } > + > + ret = rte_pmd_i40e_inset_set(res->port_id, res->pctype_id, > + &inset, inset_type); > + if (ret) { > + printf("Failed to configure input set.\n"); > + return; > + } > +#endif > + > + if (ret == -ENOTSUP) > + printf("Function not supported\n"); > +}