DPDK patches and discussions
 help / color / Atom feed
* [dpdk-dev] [PATCH] net/ixgbe: enable jumbo frame for VF
@ 2019-12-02 20:03 Junyu Jiang
  2019-12-18  6:28 ` Zhao1, Wei
  2019-12-19  8:17 ` Ye Xiaolong
  0 siblings, 2 replies; 3+ messages in thread
From: Junyu Jiang @ 2019-12-02 20:03 UTC (permalink / raw)
  To: dev; +Cc: Wenzhuo Lu, Qiming Yang, Junyu Jiang

Enable jumbo frame for VF by configuring DPDK PF.

Signed-off-by: Junyu Jiang <junyux.jiang@intel.com>
---
 drivers/net/ixgbe/ixgbe_pf.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c
index d0d85e138..66b856e11 100644
--- a/drivers/net/ixgbe/ixgbe_pf.c
+++ b/drivers/net/ixgbe/ixgbe_pf.c
@@ -544,6 +544,7 @@ ixgbe_set_vf_lpe(struct rte_eth_dev *dev, __rte_unused uint32_t vf, uint32_t *ms
 	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	uint32_t new_mtu = msgbuf[1];
 	uint32_t max_frs;
+	uint32_t hlreg0;
 	int max_frame = new_mtu + RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN;
 
 	/* X540 and X550 support jumbo frames in IOV mode */
@@ -560,6 +561,18 @@ ixgbe_set_vf_lpe(struct rte_eth_dev *dev, __rte_unused uint32_t vf, uint32_t *ms
 	max_frs = (IXGBE_READ_REG(hw, IXGBE_MAXFRS) &
 		   IXGBE_MHADD_MFS_MASK) >> IXGBE_MHADD_MFS_SHIFT;
 	if (max_frs < new_mtu) {
+		hlreg0 = IXGBE_READ_REG(hw, IXGBE_HLREG0);
+		if (new_mtu > RTE_ETHER_MAX_LEN) {
+			dev->data->dev_conf.rxmode.offloads |=
+				DEV_RX_OFFLOAD_JUMBO_FRAME;
+			hlreg0 |= IXGBE_HLREG0_JUMBOEN;
+		} else {
+			dev->data->dev_conf.rxmode.offloads &=
+				~DEV_RX_OFFLOAD_JUMBO_FRAME;
+			hlreg0 &= ~IXGBE_HLREG0_JUMBOEN;
+		}
+		IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg0);
+
 		max_frs = new_mtu << IXGBE_MHADD_MFS_SHIFT;
 		IXGBE_WRITE_REG(hw, IXGBE_MAXFRS, max_frs);
 	}
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] net/ixgbe: enable jumbo frame for VF
  2019-12-02 20:03 [dpdk-dev] [PATCH] net/ixgbe: enable jumbo frame for VF Junyu Jiang
@ 2019-12-18  6:28 ` Zhao1, Wei
  2019-12-19  8:17 ` Ye Xiaolong
  1 sibling, 0 replies; 3+ messages in thread
From: Zhao1, Wei @ 2019-12-18  6:28 UTC (permalink / raw)
  To: Jiang, JunyuX, dev; +Cc: Lu, Wenzhuo, Yang, Qiming, Jiang, JunyuX

Acked-by: Wei Zhao <wei.zhao1@intel.com>

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Junyu Jiang
> Sent: Tuesday, December 3, 2019 4:03 AM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Yang, Qiming
> <qiming.yang@intel.com>; Jiang, JunyuX <junyux.jiang@intel.com>
> Subject: [dpdk-dev] [PATCH] net/ixgbe: enable jumbo frame for VF
> 
> Enable jumbo frame for VF by configuring DPDK PF.
> 
> Signed-off-by: Junyu Jiang <junyux.jiang@intel.com>
> ---
>  drivers/net/ixgbe/ixgbe_pf.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c index
> d0d85e138..66b856e11 100644
> --- a/drivers/net/ixgbe/ixgbe_pf.c
> +++ b/drivers/net/ixgbe/ixgbe_pf.c
> @@ -544,6 +544,7 @@ ixgbe_set_vf_lpe(struct rte_eth_dev *dev,
> __rte_unused uint32_t vf, uint32_t *ms
>  	struct ixgbe_hw *hw =
> IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
>  	uint32_t new_mtu = msgbuf[1];
>  	uint32_t max_frs;
> +	uint32_t hlreg0;
>  	int max_frame = new_mtu + RTE_ETHER_HDR_LEN +
> RTE_ETHER_CRC_LEN;
> 
>  	/* X540 and X550 support jumbo frames in IOV mode */ @@ -560,6
> +561,18 @@ ixgbe_set_vf_lpe(struct rte_eth_dev *dev, __rte_unused
> uint32_t vf, uint32_t *ms
>  	max_frs = (IXGBE_READ_REG(hw, IXGBE_MAXFRS) &
>  		   IXGBE_MHADD_MFS_MASK) >> IXGBE_MHADD_MFS_SHIFT;
>  	if (max_frs < new_mtu) {
> +		hlreg0 = IXGBE_READ_REG(hw, IXGBE_HLREG0);
> +		if (new_mtu > RTE_ETHER_MAX_LEN) {
> +			dev->data->dev_conf.rxmode.offloads |=
> +				DEV_RX_OFFLOAD_JUMBO_FRAME;
> +			hlreg0 |= IXGBE_HLREG0_JUMBOEN;
> +		} else {
> +			dev->data->dev_conf.rxmode.offloads &=
> +				~DEV_RX_OFFLOAD_JUMBO_FRAME;
> +			hlreg0 &= ~IXGBE_HLREG0_JUMBOEN;
> +		}
> +		IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg0);
> +
>  		max_frs = new_mtu << IXGBE_MHADD_MFS_SHIFT;
>  		IXGBE_WRITE_REG(hw, IXGBE_MAXFRS, max_frs);
>  	}
> --
> 2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] net/ixgbe: enable jumbo frame for VF
  2019-12-02 20:03 [dpdk-dev] [PATCH] net/ixgbe: enable jumbo frame for VF Junyu Jiang
  2019-12-18  6:28 ` Zhao1, Wei
@ 2019-12-19  8:17 ` Ye Xiaolong
  1 sibling, 0 replies; 3+ messages in thread
From: Ye Xiaolong @ 2019-12-19  8:17 UTC (permalink / raw)
  To: Junyu Jiang; +Cc: dev, Wenzhuo Lu, Qiming Yang

On 12/02, Junyu Jiang wrote:
>Enable jumbo frame for VF by configuring DPDK PF.
>
>Signed-off-by: Junyu Jiang <junyux.jiang@intel.com>
>---
> drivers/net/ixgbe/ixgbe_pf.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
>diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c
>index d0d85e138..66b856e11 100644
>--- a/drivers/net/ixgbe/ixgbe_pf.c
>+++ b/drivers/net/ixgbe/ixgbe_pf.c
>@@ -544,6 +544,7 @@ ixgbe_set_vf_lpe(struct rte_eth_dev *dev, __rte_unused uint32_t vf, uint32_t *ms
> 	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> 	uint32_t new_mtu = msgbuf[1];
> 	uint32_t max_frs;
>+	uint32_t hlreg0;
> 	int max_frame = new_mtu + RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN;
> 
> 	/* X540 and X550 support jumbo frames in IOV mode */
>@@ -560,6 +561,18 @@ ixgbe_set_vf_lpe(struct rte_eth_dev *dev, __rte_unused uint32_t vf, uint32_t *ms
> 	max_frs = (IXGBE_READ_REG(hw, IXGBE_MAXFRS) &
> 		   IXGBE_MHADD_MFS_MASK) >> IXGBE_MHADD_MFS_SHIFT;
> 	if (max_frs < new_mtu) {
>+		hlreg0 = IXGBE_READ_REG(hw, IXGBE_HLREG0);
>+		if (new_mtu > RTE_ETHER_MAX_LEN) {
>+			dev->data->dev_conf.rxmode.offloads |=
>+				DEV_RX_OFFLOAD_JUMBO_FRAME;
>+			hlreg0 |= IXGBE_HLREG0_JUMBOEN;
>+		} else {
>+			dev->data->dev_conf.rxmode.offloads &=
>+				~DEV_RX_OFFLOAD_JUMBO_FRAME;
>+			hlreg0 &= ~IXGBE_HLREG0_JUMBOEN;
>+		}
>+		IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg0);
>+
> 		max_frs = new_mtu << IXGBE_MHADD_MFS_SHIFT;
> 		IXGBE_WRITE_REG(hw, IXGBE_MAXFRS, max_frs);
> 	}
>-- 
>2.17.1
>


Applied to dpdk-next-net-intel with wei's ack, Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-02 20:03 [dpdk-dev] [PATCH] net/ixgbe: enable jumbo frame for VF Junyu Jiang
2019-12-18  6:28 ` Zhao1, Wei
2019-12-19  8:17 ` Ye Xiaolong

DPDK patches and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox