From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by dpdk.org (Postfix) with ESMTP id 43D224CAD for ; Fri, 23 Feb 2018 12:59:33 +0100 (CET) Received: by mail-wr0-f195.google.com with SMTP id z12so13843256wrg.4 for ; Fri, 23 Feb 2018 03:59:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=nF4m/doHZAXDveHrj9rwX1BVVqR3LRFO4WBUOncW+WY=; b=IYab6xC00RMBXfnYqUwHld++LrBF9wmVmuV6P3VkFwvF+yMNz+PyEiiKRp02z/misb hBZDark8L+0+gnDoQZswaRAgiCu0IKhqWbUK6W/EGFc+MSuX9a1KQXLRhvs9/sbj3YCM tMj0NeB7auNSoewuCZsd+/y8TAMzu0nC2obDJHDCiwAZCgD0yBRzjjV3Havn1AHRZCTv 058CfrG4SVeeGlsC5Kpv5fIRKTpi3SnUNX3P45irjkciAl9vIYden4FIJSyt3J5CEoTE ZLjHQ1mosx/q7VTFlF4EZTIKnKB9etW2Y2m2zkxC9shELbuthvSRDNLAfKrwoQwGhzm6 IOQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=nF4m/doHZAXDveHrj9rwX1BVVqR3LRFO4WBUOncW+WY=; b=eyby0aR4Av+hCT9GvehASj6A8jqkcCTArLK4ABjHBC38otMlt+QGBLZR7lFH+TTan6 SadKl4p27PoYYaUILWC6hRWV5h+aEq7GXzfTzyhrUqy5/wC/bcKF5Va65TjCK3soK4f7 amQshq+ho8Wx6c9EzSQcYpgvDG/WVdUi/ZTlsS6emv9lBHWJXzHSrnsRQqLxeoQwqlD9 xwn1MpKqd5PcvMGvNkI/tJjGERQvKbItP/oozD/Ti/V93KbL+ftIA9bPCHKtIXoRRiDE bc6iTnxay0pQJ1jeXbS5Nf8WrMYa4C8asqE3tl8pCfqtvrBqtR2SmIST4bQRkepZThtG JqbA== X-Gm-Message-State: APf1xPA0AxvS/u474YPWKhw0TI/yv3B94hZtx/9Lu72Xvg/jR7ax/L9m fsMaK2zquiFsDwxBQYMUKUgRuA== X-Google-Smtp-Source: AH8x227y5Xp9nUCFDyQ7Kl+0TTydY0/s4AgmE4wz2hZ2n2F4nKEnZL6opDtdAct6a/vkUY7BEtjv5Q== X-Received: by 10.223.162.152 with SMTP id s24mr1385324wra.148.1519387172791; Fri, 23 Feb 2018 03:59:32 -0800 (PST) Received: from schoudah-dev.vyatta.net ([137.221.143.78]) by smtp.gmail.com with ESMTPSA id g7sm2351224wrb.78.2018.02.23.03.59.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Feb 2018 03:59:32 -0800 (PST) From: Shweta Choudaha To: dev@dpdk.org Cc: shweta.choudaha@att.com Date: Fri, 23 Feb 2018 11:59:13 +0000 Message-Id: <20180223115913.19266-2-shweta.choudaha@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180223115913.19266-1-shweta.choudaha@gmail.com> References: <20180223115913.19266-1-shweta.choudaha@gmail.com> Subject: [dpdk-dev] [PATCH 1/1] net/ixgbe: Add API to update SBP bit 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, 23 Feb 2018 11:59:33 -0000 From: Shweta Choudaha Add ixgbe API to enable SBP bit in FCTRL register to allow receiving packets that may otherwise be considered length errors by ixgbe and dropped Signed-off-by: Shweta Choudaha Reviewed-by: Chas Williams Reviewed-by: Luca Boccassi --- drivers/net/ixgbe/rte_pmd_ixgbe.c | 28 ++++++++++++++++++++++++++++ drivers/net/ixgbe/rte_pmd_ixgbe.h | 13 +++++++++++++ drivers/net/ixgbe/rte_pmd_ixgbe_version.map | 6 ++++++ 3 files changed, 47 insertions(+) diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.c b/drivers/net/ixgbe/rte_pmd_ixgbe.c index d8ca8ca31..3b6f68f9e 100644 --- a/drivers/net/ixgbe/rte_pmd_ixgbe.c +++ b/drivers/net/ixgbe/rte_pmd_ixgbe.c @@ -880,6 +880,34 @@ rte_pmd_ixgbe_set_tc_bw_alloc(uint16_t port, return 0; } +int __rte_experimental +rte_pmd_ixgbe_upd_fctrl_sbp(uint16_t port, int enable) +{ + struct ixgbe_hw *hw; + struct rte_eth_dev *dev; + uint32_t fctrl; + + RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV); + dev = &rte_eth_devices[port]; + if (!is_ixgbe_supported(dev)) + return -ENOTSUP; + + hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); + if (!hw) + return -ENOTSUP; + + fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL); + + /* If 'enable' set the SBP bit else clear it */ + if (enable) + fctrl |= IXGBE_FCTRL_SBP; + else + fctrl &= ~(IXGBE_FCTRL_SBP); + + IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl); + return 0; +} + #ifdef RTE_LIBRTE_IXGBE_BYPASS int rte_pmd_ixgbe_bypass_init(uint16_t port_id) diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.h b/drivers/net/ixgbe/rte_pmd_ixgbe.h index 11a9f334b..a3026bd98 100644 --- a/drivers/net/ixgbe/rte_pmd_ixgbe.h +++ b/drivers/net/ixgbe/rte_pmd_ixgbe.h @@ -637,4 +637,17 @@ enum { ((x) > RTE_PMD_IXGBE_BYPASS_TMT_OFF && \ (x) < RTE_PMD_IXGBE_BYPASS_TMT_NUM)) +/** + * @param port + * The port identifier of the Ethernet device. + * @param enable + * 0 to disable and nonzero to enable 'SBP' bit in FCTRL register + * to receive all packets + * @return + * - (0) if successful. + * - (-ENODEV) if *port* invalid. + * - (-ENOTSUP) if hardware doesn't support this feature. + */ +int __rte_experimental +rte_pmd_ixgbe_upd_fctrl_sbp(uint16_t port, int enable); #endif /* _PMD_IXGBE_H_ */ diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe_version.map b/drivers/net/ixgbe/rte_pmd_ixgbe_version.map index bf776742c..a360d383b 100644 --- a/drivers/net/ixgbe/rte_pmd_ixgbe_version.map +++ b/drivers/net/ixgbe/rte_pmd_ixgbe_version.map @@ -52,3 +52,9 @@ DPDK_17.08 { rte_pmd_ixgbe_bypass_wd_timeout_show; rte_pmd_ixgbe_bypass_wd_timeout_store; } DPDK_17.05; + +EXPERIMENTAL { + global: + + rte_pmd_ixgbe_upd_fctrl_sbp; +} DPDK_17.08; -- 2.11.0