From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id A6012200 for ; Wed, 20 Dec 2017 09:10:08 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Dec 2017 00:10:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,430,1508828400"; d="scan'208";a="4299945" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga006.jf.intel.com with ESMTP; 20 Dec 2017 00:10:06 -0800 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 20 Dec 2017 00:10:06 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx124.amr.corp.intel.com (10.18.125.39) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 20 Dec 2017 00:10:06 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.152]) with mapi id 14.03.0319.002; Wed, 20 Dec 2017 16:09:50 +0800 From: "Zhang, Helin" To: "Wu, Yanglong" , "dev@dpdk.org" CC: "Xing, Beilei" , "Peng, Yuan" Thread-Topic: [PATCH v2] net/i40e: support mac loopback Thread-Index: AQHTeWRklt/Va60dakmzSEPURVdQlaNL4OaQ Date: Wed, 20 Dec 2017 08:09:50 +0000 Message-ID: References: <20171120040531.152695-1-yanglong.wu@intel.com> <20171220072915.118907-1-yanglong.wu@intel.com> In-Reply-To: <20171220072915.118907-1-yanglong.wu@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 v2] net/i40e: support mac loopback 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: Wed, 20 Dec 2017 08:10:09 -0000 Doc update is needed. /Helin > -----Original Message----- > From: Wu, Yanglong > Sent: Wednesday, December 20, 2017 3:29 PM > To: dev@dpdk.org > Cc: Xing, Beilei; Zhang, Helin; Peng, Yuan; Wu, Yanglong > Subject: [PATCH v2] net/i40e: support mac loopback >=20 > According to loopback mode, setup loopback link or not. > If loopback link is setted, packets in tx will be sent to rx directly. > Loopback mode can be used to support testing task >=20 > Signed-off-by: Yanglong Wu > --- > v2: > fix coding style issue > --- > drivers/net/i40e/i40e_ethdev.c | 10 ++++++++++ > drivers/net/i40e/i40e_ethdev.h | 3 ++- > 2 files changed, 12 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethde= v.c > index 0739f65a8..e8bdb335a 100644 > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -2047,6 +2047,16 @@ i40e_dev_start(struct rte_eth_dev *dev) > true, NULL); > } > } > + > + /* Enable mac loopback mode */ > + if (dev->data->dev_conf.lpbk_mode =3D=3D I40E_AQ_LB_MODE_NONE || > + dev->data->dev_conf.lpbk_mode =3D=3D I40E_AQ_LB_PHY_LOCAL) { > + ret =3D i40e_aq_set_lb_modes(hw, dev->data- > >dev_conf.lpbk_mode, NULL); > + if (ret !=3D I40E_SUCCESS) { > + PMD_DRV_LOG(ERR, "fail to set loopback link"); > + goto err_up; > + } > + } >=20 > /* Apply link configure */ > if (dev->data->dev_conf.link_speeds & ~(ETH_LINK_SPEED_100M | > diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethde= v.h > index cd67453d1..2ad9858e4 100644 > --- a/drivers/net/i40e/i40e_ethdev.h > +++ b/drivers/net/i40e/i40e_ethdev.h > @@ -61,7 +61,8 @@ > #define I40E_NUM_MACADDR_MAX 64 > /* Maximum number of VFs */ > #define I40E_MAX_VF 128 > - > +/*flag of no loopback*/ > +#define I40E_AQ_LB_MODE_NONE 0x0 > /* > * vlan_id is a 12 bit number. > * The VFTA array is actually a 4096 bit array, 128 of 32bit elements. > -- > 2.11.0