From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) by dpdk.org (Postfix) with ESMTP id 60990AFCD for ; Mon, 26 May 2014 13:31:34 +0200 (CEST) Received: by mail-wi0-f175.google.com with SMTP id f8so4068158wiw.14 for ; Mon, 26 May 2014 04:31:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=qPbelcHOXuUvqILq8n5xlIbLfIVCoI9s99+SLw7N3z8=; b=mq+xNbz3velEZBOSnbSl+eJKbtfn+RaL7RwHcnPgm2bVDF2xrsEW9Wd/0BwRjBCKOm gcqCQt66GKolzalgHc/I/04vR8AOlVf9F/erGsakFaq1NMnDEiynRFtume5LYDnD/YNg FE82/v5TS8vj//zpvhZzSgKXAv8eecmnZ5Wx6hVblHcNg47BPYVISCO6jrndpofZ3ldp 3ik9IZZ/4J8SB2Jl8ApAm1GXZjy8R/CAA5GGpim8ksSRRoOLTTVWfyzbV1AeGnv/y2oB 2BRo0QkOSK19rb6SCYdax6ZrSXBJVvbeljRpcY8vCRfq7xoCzswTPX0KcClsgxpnDAXh uPpQ== X-Gm-Message-State: ALoCoQkCyrwae0fce7ht4dleW40Bk+Fomso5HH45hjVoAhMKmhmoL08kexlwO4wZL/G+IAm/BnWc X-Received: by 10.180.11.178 with SMTP id r18mr27301676wib.41.1401103901755; Mon, 26 May 2014 04:31:41 -0700 (PDT) Received: from alcyon.dev.6wind.com (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id ed6sm26174059wib.20.2014.05.26.04.31.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 May 2014 04:31:40 -0700 (PDT) From: David Marchand To: dev@dpdk.org Date: Mon, 26 May 2014 13:31:29 +0200 Message-Id: <1401103892-17225-3-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1401103892-17225-1-git-send-email-david.marchand@6wind.com> References: <1401103892-17225-1-git-send-email-david.marchand@6wind.com> Subject: [dpdk-dev] [PATCH 2/5] 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, 26 May 2014 11:31:35 -0000 Add autoneg field in flow control parameters. This makes it easier to understand why changing some parameters does not always 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 04533e5..39351ea 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -550,6 +550,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 */ }; /** diff --git a/lib/librte_pmd_e1000/em_ethdev.c b/lib/librte_pmd_e1000/em_ethdev.c index 74dc7e5..c148cbc 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 = hw->fc.high_water; fc_conf->low_water = hw->fc.low_water; fc_conf->send_xon = hw->fc.send_xon; + fc_conf->autoneg = hw->mac.autoneg; /* * 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; hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); + if (fc_conf->autoneg != hw->mac.autoneg) + return -ENOTSUP; rx_buf_size = em_get_rx_buffer_size(hw); PMD_INIT_LOG(DEBUG, "Rx packet buffer size = 0x%x \n", rx_buf_size); diff --git a/lib/librte_pmd_e1000/igb_ethdev.c b/lib/librte_pmd_e1000/igb_ethdev.c index 6dc82c2..e15fe5a 100644 --- a/lib/librte_pmd_e1000/igb_ethdev.c +++ b/lib/librte_pmd_e1000/igb_ethdev.c @@ -1818,6 +1818,7 @@ eth_igb_flow_ctrl_get(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf) fc_conf->high_water = hw->fc.high_water; fc_conf->low_water = hw->fc.low_water; fc_conf->send_xon = hw->fc.send_xon; + fc_conf->autoneg = hw->mac.autoneg; /* * Return rx_pause and tx_pause status according to actual setting of @@ -1862,6 +1863,8 @@ eth_igb_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf) uint32_t rctl; hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); + if (fc_conf->autoneg != hw->mac.autoneg) + return -ENOTSUP; rx_buf_size = igb_get_rx_buffer_size(hw); PMD_INIT_LOG(DEBUG, "Rx packet buffer size = 0x%x \n", rx_buf_size); diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c index 4633654..c876c3e 100644 --- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c +++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c @@ -2193,6 +2193,7 @@ ixgbe_flow_ctrl_get(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf) fc_conf->high_water = hw->fc.high_water[0]; fc_conf->low_water = hw->fc.low_water[0]; fc_conf->send_xon = hw->fc.send_xon; + fc_conf->autoneg = !hw->fc.disable_fc_autoneg; /* * Return rx_pause status according to actual setting of @@ -2244,6 +2245,8 @@ ixgbe_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf) PMD_INIT_FUNC_TRACE(); hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); + if (fc_conf->autoneg != !hw->fc.disable_fc_autoneg) + return -ENOTSUP; rx_buf_size = IXGBE_READ_REG(hw, IXGBE_RXPBSIZE(0)); PMD_INIT_LOG(DEBUG, "Rx packet buffer size = 0x%x \n", rx_buf_size); -- 1.7.10.4