From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 93C102B8B for ; Fri, 6 Jan 2017 08:25:46 +0100 (CET) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP; 05 Jan 2017 23:25:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,323,1477983600"; d="scan'208";a="49917963" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga005.jf.intel.com with ESMTP; 05 Jan 2017 23:25:45 -0800 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 5 Jan 2017 23:25:45 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx116.amr.corp.intel.com (10.18.116.20) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 5 Jan 2017 23:25:45 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.88]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.132]) with mapi id 14.03.0248.002; Fri, 6 Jan 2017 15:25:43 +0800 From: "Lu, Wenzhuo" To: "Wu, Jingjing" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v7 19/27] app/testpmd: use unicast promiscuous mode on i40e Thread-Index: AQHSZ7tBe2YUJ0sXTUWxCfhLyFJJbaErDJyw Date: Fri, 6 Jan 2017 07:25:42 +0000 Message-ID: <6A0DE07E22DDAD4C9103DF62FEBC09093B556631@shsmsx102.ccr.corp.intel.com> References: <1480637533-37425-1-git-send-email-wenzhuo.lu@intel.com> <1483426488-117332-1-git-send-email-wenzhuo.lu@intel.com> <1483426488-117332-20-git-send-email-wenzhuo.lu@intel.com> <9BB6961774997848B5B42BEC655768F810CC3DFB@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <9BB6961774997848B5B42BEC655768F810CC3DFB@SHSMSX103.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v7 19/27] app/testpmd: use unicast promiscuous mode on i40e X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2017 07:25:47 -0000 Hi Jingjing, > -----Original Message----- > From: Wu, Jingjing > Sent: Friday, January 6, 2017 9:22 AM > To: Lu, Wenzhuo; dev@dpdk.org > Cc: Lu, Wenzhuo > Subject: RE: [dpdk-dev] [PATCH v7 19/27] app/testpmd: use unicast > promiscuous mode on i40e >=20 >=20 >=20 > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu > > Sent: Tuesday, January 3, 2017 2:55 PM > > To: dev@dpdk.org > > Cc: Lu, Wenzhuo > > Subject: [dpdk-dev] [PATCH v7 19/27] app/testpmd: use unicast > > promiscuous mode on i40e > > > > Add testpmd CLI to set VF unicast promiscuous mode on i40e. > > > > Signed-off-by: Wenzhuo Lu > > --- > > app/test-pmd/cmdline.c | 93 +++++++++++++++++++++= ++++++++ > > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 9 +++ > > 2 files changed, 102 insertions(+) > > > > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index > > 9a44b4f..affe9d1 100644 > > --- a/app/test-pmd/cmdline.c > > +++ b/app/test-pmd/cmdline.c > > @@ -400,6 +400,9 @@ static void cmd_help_long_parsed(void > *parsed_result, > > "set allmulti (port_id|all) (on|off)\n" > > " Set the allmulti mode on port_id, or all.\n\n" > > > > + "set vf promisc (port_id) (vf_id) (on|off)\n" > > + " Set unicast promiscuous mode for a VF from the > > PF.\n\n" > > + > > "set flow_ctrl rx (on|off) tx (on|off) (high_water)" > > " (low_water) (pause_time) (send_xon) > mac_ctrl_frame_fwd" > > " (on|off) autoneg (on|off) (port_id)\n" > > @@ -11559,6 +11562,95 @@ struct cmd_set_vf_mac_addr_result { > > }, > > }; > > > > +/* VF unicast promiscuous mode configuration */ > > + > > +/* Common result structure for VF unicast promiscuous mode */ struct > > +cmd_vf_promisc_result { > > + cmdline_fixed_string_t set; > > + cmdline_fixed_string_t vf; > > + cmdline_fixed_string_t promisc; > > + uint8_t port_id; > > + uint32_t vf_id; > > + cmdline_fixed_string_t on_off; > > +}; > > + > > +/* Common CLI fields for VF unicast promiscuous mode enable disable > > +*/ cmdline_parse_token_string_t cmd_vf_promisc_set =3D > > + TOKEN_STRING_INITIALIZER > > + (struct cmd_vf_promisc_result, > > + set, "set"); > > +cmdline_parse_token_string_t cmd_vf_promisc_vf =3D > > + TOKEN_STRING_INITIALIZER > > + (struct cmd_vf_promisc_result, > > + vf, "vf"); > > +cmdline_parse_token_string_t cmd_vf_promisc_promisc =3D > > + TOKEN_STRING_INITIALIZER > > + (struct cmd_vf_promisc_result, > > + promisc, "promisc"); > > +cmdline_parse_token_num_t cmd_vf_promisc_port_id =3D > > + TOKEN_NUM_INITIALIZER > > + (struct cmd_vf_promisc_result, > > + port_id, UINT8); > > +cmdline_parse_token_num_t cmd_vf_promisc_vf_id =3D > > + TOKEN_NUM_INITIALIZER > > + (struct cmd_vf_promisc_result, > > + vf_id, UINT32); > > +cmdline_parse_token_string_t cmd_vf_promisc_on_off =3D > > + TOKEN_STRING_INITIALIZER > > + (struct cmd_vf_promisc_result, > > + on_off, "on#off"); > > + > > +static void > > +cmd_set_vf_promisc_parsed( > > + void *parsed_result, > > + __attribute__((unused)) struct cmdline *cl, > > + __attribute__((unused)) void *data) > > +{ > > + struct cmd_vf_promisc_result *res =3D parsed_result; > > + int ret =3D -ENOTSUP; > > + > > + __rte_unused int is_on =3D (strcmp(res->on_off, "on") =3D=3D 0) ? 1 := 0; > > + > > + if (port_id_is_invalid(res->port_id, ENABLED_WARN)) > > + return; > > + > > +#ifdef RTE_LIBRTE_I40E_PMD > > + ret =3D rte_pmd_i40e_set_vf_unicast_promisc(res->port_id, > > + res->vf_id, is_on); > > +#endif > > + >=20 > It's better to wrap the command by +#ifdef RTE_LIBRTE_I40E_PMD #endif Or > at least, need to check if the port is handled i40e pmd. Yes, I'll add the check.