From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by dpdk.org (Postfix) with ESMTP id 7BCC847D2 for ; Mon, 23 Jun 2014 05:35:26 +0200 (CEST) Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 22 Jun 2014 20:35:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,527,1400050800"; d="scan'208";a="448650093" Received: from fmsmsx103.amr.corp.intel.com ([10.19.9.34]) by azsmga001.ch.intel.com with ESMTP; 22 Jun 2014 20:35:39 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX103.amr.corp.intel.com (10.19.9.34) with Microsoft SMTP Server (TLS) id 14.3.123.3; Sun, 22 Jun 2014 20:35:39 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.81]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.209]) with mapi id 14.03.0123.003; Mon, 23 Jun 2014 11:35:37 +0800 From: "Liu, Jijiang" To: David Marchand Thread-Topic: [dpdk-dev] [PATCH v3 2/7] ethdev: add autoneg parameter in flow ctrl accessors Thread-Index: AQHPildoriTdWkWSTUm2RNoYPH5jy5t+C4rg Date: Mon, 23 Jun 2014 03:35:36 +0000 Message-ID: <1ED644BD7E0A5F4091CF203DAFB8E4CC01D3B9A6@SHSMSX101.ccr.corp.intel.com> References: <1403028572-24794-1-git-send-email-david.marchand@6wind.com> <1403028572-24794-3-git-send-email-david.marchand@6wind.com> In-Reply-To: <1403028572-24794-3-git-send-email-david.marchand@6wind.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 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v3 2/7] ethdev: add autoneg parameter in flow ctrl accessors X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jun 2014 03:35:27 -0000 Hi David, There was an error when we used the following test command to test latest m= aster branch for 10G NIC flow control=20 test command:=20 ./x86_64-native-linuxapp-gcc/app/testpmd -c f -n 4-- -i --burst=3D1 --txpt= =3D32 --txht=3D8 --txwt=3D0 --txfreet=3D0 --rxfreet=3D64 --mbcache=3D250 --= portmask=3Df=20 testpmd> set flow_ctrl rx off tx off 300 50 10 1 mac_ctrl_frame_fwd on 0=20 bad flow contrl parameter, return code =3D -95 =20 And the reason is that autoneg check failed in ixgbe_flow_ctrl_set() functi= on.=20 if (fc_conf->autoneg !=3D !hw->fc.disable_fc_autoneg) return -ENOTSUP; =20 Thanks Jijiang Liu -----Original Message----- From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of David Marchand Sent: Wednesday, June 18, 2014 2:09 AM To: dev@dpdk.org Subject: [dpdk-dev] [PATCH v3 2/7] ethdev: add autoneg parameter in flow ct= rl accessors Add autoneg field in flow control parameters. This makes it easier to understand why changing some parameters does not al= ways have the expected result. Changing autoneg is not supported at the moment. Signed-off-by: David Marchand --- lib/librte_ether/rte_ethdev.h | 1 + lib/librte_pmd_e1000/em_ethdev.c | 3 +++ lib/librte_pmd_e1000/igb_ethdev.c | 3 +++ lib/librte_pmd_ixgbe/ixgbe_ethdev.c | 3 +++ 4 files changed, 10 insertions(+) diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h = index 1e0564d..a410afd 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -649,6 +649,7 @@ struct rte_eth_fc_conf { uint16_t send_xon; /**< Is XON frame need be sent */ enum rte_eth_fc_mode mode; /**< Link flow control mode */ uint8_t mac_ctrl_frame_fwd; /**< Forward MAC control frames */ + uint8_t autoneg; /**< Use Pause autoneg */ }; =20 /** diff --git a/lib/librte_pmd_e1000/em_ethdev.c b/lib/librte_pmd_e1000/em_eth= dev.c index 58efcdf..7913ff0 100644 --- a/lib/librte_pmd_e1000/em_ethdev.c +++ b/lib/librte_pmd_e1000/em_ethdev.c @@ -1378,6 +1378,7 @@ eth_em_flow_ctrl_get(struct rte_eth_dev *dev, struct = rte_eth_fc_conf *fc_conf) fc_conf->high_water =3D hw->fc.high_water; fc_conf->low_water =3D hw->fc.low_water; fc_conf->send_xon =3D hw->fc.send_xon; + fc_conf->autoneg =3D hw->mac.autoneg; =20 /* * Return rx_pause and tx_pause status according to actual setting of @@ = -1422,6 +1423,8 @@ eth_em_flow_ctrl_set(struct rte_eth_dev *dev, struct rte= _eth_fc_conf *fc_conf) uint32_t rctl; =20 hw =3D E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); + if (fc_conf->autoneg !=3D hw->mac.autoneg) + return -ENOTSUP; rx_buf_size =3D em_get_rx_buffer_size(hw); PMD_INIT_LOG(DEBUG, "Rx packet buffer size =3D 0x%x \n", rx_buf_size); =20 diff --git a/lib/librte_pmd_e1000/igb_ethdev.c b/lib/librte_pmd_e1000/igb_e= thdev.c index 92ac4a8..c92b737 100644 --- a/lib/librte_pmd_e1000/igb_ethdev.c +++ b/lib/librte_pmd_e1000/igb_ethdev.c @@ -1871,6 +1871,7 @@ eth_igb_flow_ctrl_get(struct rte_eth_dev *dev, struct= rte_eth_fc_conf *fc_conf) fc_conf->high_water =3D hw->fc.high_water; fc_conf->low_water =3D hw->fc.low_water; fc_conf->send_xon =3D hw->fc.send_xon; + fc_conf->autoneg =3D hw->mac.autoneg; =20 /* * Return rx_pause and tx_pause status according to actual setting of @@ = -1915,6 +1916,8 @@ eth_igb_flow_ctrl_set(struct rte_eth_dev *dev, struct rt= e_eth_fc_conf *fc_conf) uint32_t rctl; =20 hw =3D E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); + if (fc_conf->autoneg !=3D hw->mac.autoneg) + return -ENOTSUP; rx_buf_size =3D igb_get_rx_buffer_size(hw); PMD_INIT_LOG(DEBUG, "Rx packet buffer size =3D 0x%x \n", rx_buf_size); =20 diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c b/lib/librte_pmd_ixgbe/ixg= be_ethdev.c index f130080..559d246 100644 --- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c +++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c @@ -2309,6 +2309,7 @@ ixgbe_flow_ctrl_get(struct rte_eth_dev *dev, struct r= te_eth_fc_conf *fc_conf) fc_conf->high_water =3D hw->fc.high_water[0]; fc_conf->low_water =3D hw->fc.low_water[0]; fc_conf->send_xon =3D hw->fc.send_xon; + fc_conf->autoneg =3D !hw->fc.disable_fc_autoneg; =20 /* * Return rx_pause status according to actual setting of @@ -2360,6 +2361= ,8 @@ ixgbe_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *= fc_conf) PMD_INIT_FUNC_TRACE(); =20 hw =3D IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); + if (fc_conf->autoneg !=3D !hw->fc.disable_fc_autoneg) + return -ENOTSUP; rx_buf_size =3D IXGBE_READ_REG(hw, IXGBE_RXPBSIZE(0)); PMD_INIT_LOG(DEBUG, "Rx packet buffer size =3D 0x%x \n", rx_buf_size); =20 -- 1.7.10.4