Skip to contentSkip to conversation

net/e1000: Support mtu set for igbvf.

PATCH In review Ian Stokes 2 participants 3 messages Jun 29, 2018 – Jul 11, 2018 Network drivers

lore
Share & tools
lore

Ian Stokes

author
#0 lore raw

PATCH v2 1/1 net/e1000: Support mtu set for igbvf.

This patch enables setting the MTU of an igbvf device by re-using the eth_igb_mtu_set() in igbvf_eth_dev_ops.

---
 drivers/net/e1000/igb_ethdev.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/e1000/igb_ethdev.c +1 -0
index edc7be3..650e831 100644
@@ -442,6 +442,7 @@ static const struct eth_dev_ops igbvf_eth_dev_ops = {
 	.txq_info_get         = igb_txq_info_get,
 	.mac_addr_set         = igbvf_default_mac_addr_set,
 	.get_reg              = igbvf_get_regs,
+	.mtu_set              = eth_igb_mtu_set,
 };
 
 /* store statistics names and its offset in stats structure */
Signature · 1 line
2.7.5
#1 lore raw

Hi Ian,

Quoted 22 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Ian Stokes
Sent: Friday, June 29, 2018 9:51 PM
To: [email protected]
Cc: Stokes, Ian <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH v2] net/e1000: Support mtu set for igbvf.

This patch enables setting the MTU of an igbvf device by re-using the eth_igb_mtu_set() in igbvf_eth_dev_ops.

---
 drivers/net/e1000/igb_ethdev.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/e1000/igb_ethdev.c +0 -0
index edc7be3..650e831 100644

drivers/net/e1000/igb_ethdev.c static const struct eth_dev_ops igbvf_eth_dev_ops = · line 446

Quoted 5 lines
drivers/net/e1000/igb_ethdev.c +1 -0
@@ -442,6 +442,7 @@ static const struct eth_dev_ops igbvf_eth_dev_ops =
 {
 	.txq_info_get         = igb_txq_info_get,
 	.mac_addr_set         = igbvf_default_mac_addr_set,
 	.get_reg              = igbvf_get_regs,
+	.mtu_set              = eth_igb_mtu_set,

I think "eth_igb_mtu_set" is PF specific function that cannot be used on VF. As it touches PF specific registers. Looks like MTU setting even not supported by igb VF.

author
#2 lore raw
Quoted 20 lines · Wenzhuo

Hi Ian,

Quoted 17 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Ian Stokes
Sent: Friday, June 29, 2018 9:51 PM
To: [email protected]
Cc: Stokes, Ian <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH v2] net/e1000: Support mtu set for igbvf.

This patch enables setting the MTU of an igbvf device by re-using the eth_igb_mtu_set() in igbvf_eth_dev_ops.

---
  drivers/net/e1000/igb_ethdev.c | 1 +
  1 file changed, 1 insertion(+)
Quoted 13 lines

drivers/net/e1000/igb_ethdev.c static const struct eth_dev_ops igbvf_eth_dev_ops = · line 446

Quoted 10 lines
drivers/net/e1000/igb_ethdev.c +1 -0
index edc7be3..650e831 100644
@@ -442,6 +442,7 @@ static const struct eth_dev_ops igbvf_eth_dev_ops =
 {
  	.txq_info_get         = igb_txq_info_get,
  	.mac_addr_set         = igbvf_default_mac_addr_set,
  	.get_reg              = igbvf_get_regs,
+	.mtu_set              = eth_igb_mtu_set,

I think "eth_igb_mtu_set" is PF specific function that cannot be used on VF. As it touches PF specific registers. Looks like MTU setting even not supported by igb VF.

Thanks for the feedback,

I'm surprised it's not supported, is there documentation somewhere for this?

I have tested this patch for an IGB SRIOV device and it worked without issue as far as I could tell, I was able to set the MTU for the igb vf, packets less than or equal to the mtu were passed, packets above the mtu were dropped as expected. Packets that were passed were not corrupted. I've tested this with OVS DPDK.

I've spotted that a few of the class functions for the igbvf eth ops use eth_igb functions, is it the case that some features are supported for both devices? (I had assumed this albeit maybe incorrectly).

Ian