promiscuous mode enable on VF
cover promiscuous mode enable on VF
There is need to enable promiscuous mode enable on VF, pf host should also enable to support that.
Zhao Wei (3):
net/ixgbe: promiscuous mode enable on VF
net/ixgbe: enable promiscous mode on PF host
net/ixgbe: update API version
drivers/net/ixgbe/ixgbe_ethdev.c | 21 +++++++++++ drivers/net/ixgbe/ixgbe_ethdev.h | 1 + drivers/net/ixgbe/ixgbe_pf.c | 79 +++++++++++++++++++++++++++++----------- 3 files changed, 79 insertions(+), 22 deletions(-)
Signature · 1 line
2.7.5
PATCH 1/3 net/ixgbe: promiscuous mode enable on VF
There is need to enable two ops of promiscuous_enable and promiscuous_disable on VF.
--- drivers/net/ixgbe/ixgbe_ethdev.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
drivers/net/ixgbe/ixgbe_ethdev.c +20 -0
@@ -260,6 +260,8 @@ static int ixgbevf_dev_rx_queue_intr_disable(struct rte_eth_dev *dev,static void ixgbevf_set_ivar_map (struct ixgbe_hw *hw,int8_t direction,uint8_t queue,uint8_t msix_vector);static void ixgbevf_configure_msix (struct rte_eth_dev *dev); +static void ixgbevf_dev_promiscuous_enable (struct rte_eth_dev *dev); +static void ixgbevf_dev_promiscuous_disable (struct rte_eth_dev *dev);static void ixgbevf_dev_allmulticast_enable (struct rte_eth_dev *dev);static void ixgbevf_dev_allmulticast_disable (struct rte_eth_dev *dev);
@@ -596,6 +598,8 @@ static const struct eth_dev_ops ixgbevf_eth_dev_ops = { .xstats_get_names = ixgbevf_dev_xstats_get_names, .dev_close = ixgbevf_dev_close, .dev_reset = ixgbevf_dev_reset, + .promiscuous_enable = ixgbevf_dev_promiscuous_enable, + .promiscuous_disable = ixgbevf_dev_promiscuous_disable, .allmulticast_enable = ixgbevf_dev_allmulticast_enable, .allmulticast_disable = ixgbevf_dev_allmulticast_disable, .dev_infos_get = ixgbevf_dev_info_get,
@@ -8290,6 +8294,22 @@ ixgbe_dev_udp_tunnel_port_del(struct rte_eth_dev *dev, }static void +ixgbevf_dev_promiscuous_enable (struct rte_eth_dev *dev) +{ +struct ixgbe_hw *hw =IXGBE_DEV_PRIVATE_TO_HW (dev->data->dev_private); + + hw->mac.ops.update_xcast_mode (hw,IXGBEVF_XCAST_MODE_PROMISC ); +} + +static void +ixgbevf_dev_promiscuous_disable (struct rte_eth_dev *dev) +{ +struct ixgbe_hw *hw =IXGBE_DEV_PRIVATE_TO_HW (dev->data->dev_private); + + hw->mac.ops.update_xcast_mode (hw,IXGBEVF_XCAST_MODE_NONE ); +} + +static void ixgbevf_dev_allmulticast_enable (struct rte_eth_dev *dev) {struct ixgbe_hw *hw =IXGBE_DEV_PRIVATE_TO_HW (dev->data->dev_private);
Signature · 1 line
2.7.5
PATCH 2/3 net/ixgbe: enable promiscous mode on PF host
In reply to Wei ZhaoThere is need to PF host promiscous mode enable. For ixgbe, in order to support VF vlan promiscuous or unicast promiscuous, we need to set PF host register PFVML2FLT of bit UPE and VPE. It also align to ixgbe kernel code version 5.5.3.
--- drivers/net/ixgbe/ixgbe_ethdev.h | 1 + drivers/net/ixgbe/ixgbe_pf.c | 78 ++++++++++++++++++++++++++++------------ 2 files changed, 57 insertions(+), 22 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.h +1 -0
@@ -265,6 +265,7 @@ struct ixgbe_vf_info {uint8_t spoofchk_enabled;uint8_t api_version;uint16_t switch_domain_id; +uint16_t xcast_mode; };/*
drivers/net/ixgbe/ixgbe_pf.c +56 -22
98 lines not on this page · raw message
Signature · 1 line
2.7.5
PATCH 3/3 net/ixgbe: update API version
In reply to Wei ZhaoThere is need to update to latest API version in order for negotiation between pf and vf, then new API message can be supported.
--- drivers/net/ixgbe/ixgbe_ethdev.c | 1 + drivers/net/ixgbe/ixgbe_pf.c | 1 + 2 files changed, 2 insertions(+)
drivers/net/ixgbe/ixgbe_ethdev.c +1 -0
@@ -1512,6 +1512,7 @@ ixgbevf_negotiate_api(struct ixgbe_hw *hw)/* start with highest supported, proceed down */ static const enum ixgbe_pfvf_api_rev sup_ver[] = { + ixgbe_mbox_api_13, ixgbe_mbox_api_12, ixgbe_mbox_api_11, ixgbe_mbox_api_10,
drivers/net/ixgbe/ixgbe_pf.c +1 -0
@@ -569,6 +569,7 @@ ixgbe_negotiate_vf_api(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf)case ixgbe_mbox_api_10:case ixgbe_mbox_api_11:case ixgbe_mbox_api_12: +case ixgbe_mbox_api_13: vfinfo[vf].api_version = (uint8_t )api_version;return 0 ;default :
Signature · 1 line
2.7.5
v2 cover net/ixgbe: promiscuous mode enable on VF
In reply to Wei ZhaoThere is need to enable promiscuous mode enable on VF, pf host should also enable to support that.
v2:
--fix typo in commit log.
Zhao Wei (3):
net/ixgbe: promiscuous mode enable on VF
net/ixgbe: enable promiscuous mode on PF host
net/ixgbe: update API version
drivers/net/ixgbe/ixgbe_ethdev.c | 21 +++++++++++ drivers/net/ixgbe/ixgbe_ethdev.h | 1 + drivers/net/ixgbe/ixgbe_pf.c | 79 +++++++++++++++++++++++++++++----------- 3 files changed, 79 insertions(+), 22 deletions(-)
Signature · 1 line
2.7.5
PATCH v2 1/3 net/ixgbe: promiscuous mode enable on VF
There is need to enable two ops of promiscuous_enable and promiscuous_disable on VF.
--- drivers/net/ixgbe/ixgbe_ethdev.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
drivers/net/ixgbe/ixgbe_ethdev.c +20 -0
@@ -260,6 +260,8 @@ static int ixgbevf_dev_rx_queue_intr_disable(struct rte_eth_dev *dev,static void ixgbevf_set_ivar_map (struct ixgbe_hw *hw,int8_t direction,uint8_t queue,uint8_t msix_vector);static void ixgbevf_configure_msix (struct rte_eth_dev *dev); +static void ixgbevf_dev_promiscuous_enable (struct rte_eth_dev *dev); +static void ixgbevf_dev_promiscuous_disable (struct rte_eth_dev *dev);static void ixgbevf_dev_allmulticast_enable (struct rte_eth_dev *dev);static void ixgbevf_dev_allmulticast_disable (struct rte_eth_dev *dev);
@@ -596,6 +598,8 @@ static const struct eth_dev_ops ixgbevf_eth_dev_ops = { .xstats_get_names = ixgbevf_dev_xstats_get_names, .dev_close = ixgbevf_dev_close, .dev_reset = ixgbevf_dev_reset, + .promiscuous_enable = ixgbevf_dev_promiscuous_enable, + .promiscuous_disable = ixgbevf_dev_promiscuous_disable, .allmulticast_enable = ixgbevf_dev_allmulticast_enable, .allmulticast_disable = ixgbevf_dev_allmulticast_disable, .dev_infos_get = ixgbevf_dev_info_get,
@@ -8290,6 +8294,22 @@ ixgbe_dev_udp_tunnel_port_del(struct rte_eth_dev *dev, }static void +ixgbevf_dev_promiscuous_enable (struct rte_eth_dev *dev) +{ +struct ixgbe_hw *hw =IXGBE_DEV_PRIVATE_TO_HW (dev->data->dev_private); + + hw->mac.ops.update_xcast_mode (hw,IXGBEVF_XCAST_MODE_PROMISC ); +} + +static void +ixgbevf_dev_promiscuous_disable (struct rte_eth_dev *dev) +{ +struct ixgbe_hw *hw =IXGBE_DEV_PRIVATE_TO_HW (dev->data->dev_private); + + hw->mac.ops.update_xcast_mode (hw,IXGBEVF_XCAST_MODE_NONE ); +} + +static void ixgbevf_dev_allmulticast_enable (struct rte_eth_dev *dev) {struct ixgbe_hw *hw =IXGBE_DEV_PRIVATE_TO_HW (dev->data->dev_private);
Signature · 1 line
2.7.5
Re: [PATCH v2 1/3] net/ixgbe: promiscuous mode enable on VF
Quoted 10 lines
-----Original Message-----
From: Zhao1, Wei
Sent: Wednesday, January 16, 2019 1:02 PM
To: [email protected]
Cc: [email protected]; Lu, Wenzhuo <[email protected]>; Zhang, Qi Z <[email protected]>; Zhao1, Wei <[email protected]>
Subject: [PATCH v2 1/3] net/ixgbe: promiscuous mode enable on VF
Quoted 4 lines
There is need to enable two ops of
promiscuous_enableandpromiscuous_disableon VF.Fixes af75078fece3 ("first public release")
I think this is not a fix, we just add some feature not be implemented.
Btw, you need to update doc/guides/nics/features/ixgbe_vf.ini
Quoted 54 lines
Signed-off-by Wei Zhao <[email protected]>--- drivers/net/ixgbe/ixgbe_ethdev.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)drivers/net/ixgbe/ixgbe_ethdev.c +16
-0@@ -260,6 +260,8 @@ static int ixgbevf_dev_rx_queue_intr_disable(struct rte_eth_dev *dev, static void ixgbevf_set_ivar_map(struct ixgbe_hw *hw,int8_t direction,uint8_t queue,uint8_t msix_vector);static void ixgbevf_configure_msix (struct rte_eth_dev *dev); +static void ixgbevf_dev_promiscuous_enable (struct rte_eth_dev *dev); +static void ixgbevf_dev_promiscuous_disable (struct rte_eth_dev *dev);static void ixgbevf_dev_allmulticast_enable (struct rte_eth_dev *dev);static void ixgbevf_dev_allmulticast_disable (struct rte_eth_dev *dev);@@ -596,6 +598,8 @@ static const struct eth_dev_ops ixgbevf_eth_dev_ops = { .xstats_get_names = ixgbevf_dev_xstats_get_names, .dev_close = ixgbevf_dev_close, .dev_reset = ixgbevf_dev_reset, + .promiscuous_enable = ixgbevf_dev_promiscuous_enable, + .promiscuous_disable = ixgbevf_dev_promiscuous_disable, .allmulticast_enable = ixgbevf_dev_allmulticast_enable, .allmulticast_disable = ixgbevf_dev_allmulticast_disable, .dev_infos_get = ixgbevf_dev_info_get,@@ -8290,6 +8294,22 @@ ixgbe_dev_udp_tunnel_port_del(struct rte_eth_dev *dev, }static void +ixgbevf_dev_promiscuous_enable (struct rte_eth_dev *dev) { +struct ixgbe_hw *hw =IXGBE_DEV_PRIVATE_TO_HW (dev->data->dev_private); + + hw->mac.ops.update_xcast_mode (hw,IXGBEVF_XCAST_MODE_PROMISC ); } + +static void +ixgbevf_dev_promiscuous_disable (struct rte_eth_dev *dev) { +struct ixgbe_hw *hw =IXGBE_DEV_PRIVATE_TO_HW (dev->data->dev_private); + + hw->mac.ops.update_xcast_mode (hw,IXGBEVF_XCAST_MODE_NONE ); } + +static void ixgbevf_dev_allmulticast_enable (struct rte_eth_dev *dev) { struct ixgbe_hw *hw =
IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
--
2.7.5
Re: [PATCH v2 1/3] net/ixgbe: promiscuous mode enable on VF
Quoted 19 lines
-----Original Message-----
From: Zhang, Qi Z
Sent: Wednesday, February 13, 2019 11:35 AM
To: Zhao1, Wei <[email protected]>; [email protected]
Cc: [email protected]; Lu, Wenzhuo <[email protected]>
Subject: RE: [PATCH v2 1/3] net/ixgbe: promiscuous mode enable on VFQuoted 8 lines
-----Original Message-----
From: Zhao1, Wei
Sent: Wednesday, January 16, 2019 1:02 PM
To: [email protected]
Cc: [email protected]; Lu, Wenzhuo <[email protected]>; Zhang, Qi Z <[email protected]>; Zhao1, Wei <[email protected]>
Subject: [PATCH v2 1/3] net/ixgbe: promiscuous mode enable on VF
Quoted 8 lines
Quoted 4 lines
There is need to enable two ops of
promiscuous_enableandpromiscuous_disableon VF.Fixes af75078fece3 ("first public release")I think this is not a fix, we just add some feature not be implemented.
Btw, you need to update doc/guides/nics/features/ixgbe_vf.ini
Ok, I will update in v3
Quoted 59 lines
Quoted 13 lines
Signed-off-by Wei Zhao <[email protected]>--- drivers/net/ixgbe/ixgbe_ethdev.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)drivers/net/ixgbe/ixgbe_ethdev.c +0
-0@@ -260,6 +260,8 @@ static intQuoted 4 lines
ixgbevf_dev_rx_queue_intr_disable(struct
rte_eth_dev*dev, static void ixgbevf_set_ivar_map(structixgbe_hw*hw,int8_tdirection,
uint8_tqueue,uint8_tmsix_vector); staticvoid
drivers/net/ixgbe/ixgbe_ethdev.c static const struct eth_dev_ops
Quoted 7 lines
ixgbevf_configure_msix(struct rte_eth_dev *dev);drivers/net/ixgbe/ixgbe_ethdev.c +2
-0+static void ixgbevf_dev_promiscuous_enable (struct rte_eth_dev *dev); +static void ixgbevf_dev_promiscuous_disable (struct rte_eth_dev *dev);static void ixgbevf_dev_allmulticast_enable (struct rte_eth_dev *dev);static void
ixgbevf_dev_allmulticast_disable(struct rte_eth_dev *dev);drivers/net/ixgbe/ixgbe_ethdev.c +0
-0@@ -596,6 +598,8 @@ static const struct eth_dev_ops
ixgbevf_eth_dev_ops= {Quoted 15 lines
drivers/net/ixgbe/ixgbe_ethdev.c +4
-0.xstats_get_names = ixgbevf_dev_xstats_get_names, .dev_close = ixgbevf_dev_close, .dev_reset = ixgbevf_dev_reset, + .promiscuous_enable = ixgbevf_dev_promiscuous_enable, + .promiscuous_disable = ixgbevf_dev_promiscuous_disable, .allmulticast_enable = ixgbevf_dev_allmulticast_enable, .allmulticast_disable = ixgbevf_dev_allmulticast_disable, .dev_infos_get = ixgbevf_dev_info_get,@@ -8290,6 +8294,22 @@ ixgbe_dev_udp_tunnel_port_del(struct rte_eth_dev *dev, }static void +ixgbevf_dev_promiscuous_enable (struct rte_eth_dev *dev) { +struct ixgbe_hw *hw =IXGBE_DEV_PRIVATE_TO_HW (dev->data->dev_private);drivers/net/ixgbe/ixgbe_ethdev.c ixgbe_dev_udp_tunnel_port_del(struct · line 8309
Quoted 10 lines
drivers/net/ixgbe/ixgbe_ethdev.c +8
-0+ + hw->mac.ops.update_xcast_mode (hw,IXGBEVF_XCAST_MODE_PROMISC ); } + +static void +ixgbevf_dev_promiscuous_disable (struct rte_eth_dev *dev) { +struct ixgbe_hw *hw =IXGBE_DEV_PRIVATE_TO_HW (dev->data->dev_private); + + hw->mac.ops.update_xcast_mode(hw,
IXGBEVF_XCAST_MODE_NONE); }Quoted 7 lines
drivers/net/ixgbe/ixgbe_ethdev.c +2
-0+ +static void ixgbevf_dev_allmulticast_enable (struct rte_eth_dev *dev) { struct ixgbe_hw *hw =
IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
--
2.7.5
PATCH v2 2/3 net/ixgbe: enable promiscuous mode on PF host
In reply to Wei ZhaoThere is need to PF host promiscuous mode enable. For ixgbe, in order to support VF vlan promiscuous or unicast promiscuous, we need to set PF host register PFVML2FLT of bit UPE and VPE. It also align to ixgbe kernel code version 5.5.3.
--- drivers/net/ixgbe/ixgbe_ethdev.h | 1 + drivers/net/ixgbe/ixgbe_pf.c | 78 ++++++++++++++++++++++++++++------------ 2 files changed, 57 insertions(+), 22 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.h +1 -0
@@ -265,6 +265,7 @@ struct ixgbe_vf_info {uint8_t spoofchk_enabled;uint8_t api_version;uint16_t switch_domain_id; +uint16_t xcast_mode; };/*
drivers/net/ixgbe/ixgbe_pf.c +56 -22
98 lines not on this page · raw message
Signature · 1 line
2.7.5
Re: [PATCH v2 2/3] net/ixgbe: enable promiscuous mode on PF host
Quoted 10 lines
-----Original Message-----
From: Zhao1, Wei
Sent: Wednesday, January 16, 2019 1:02 PM
To: [email protected]
Cc: [email protected]; Lu, Wenzhuo <[email protected]>; Zhang, Qi Z <[email protected]>; Zhao1, Wei <[email protected]>
Subject: [PATCH v2 2/3] net/ixgbe: enable promiscuous mode on PF host
The title is misleading, we are going to support VF's promiscuous mode but not PF.
How about "Add VF promiscuous mode support when PF as host"
Quoted 6 lines
There is need to PF host promiscuous mode enable. For ixgbe, in order to support VF vlan promiscuous or unicast promiscuous, we need to set PF host register PFVML2FLT of bit UPE and VPE.
It also align to ixgbe kernel code version 5.5.3.Fixes 72dec9e37a84 ("ixgbe: support multicast promiscuous mode on VF")
Same to previous patch, not a fix.
Quoted 132 lines
Signed-off-by Wei Zhao <[email protected]>--- drivers/net/ixgbe/ixgbe_ethdev.h | 1 + drivers/net/ixgbe/ixgbe_pf.c | 78 ++++++++++++++++++++++++++++------------ 2 files changed, 57 insertions(+), 22 deletions(-)drivers/net/ixgbe/ixgbe_ethdev.h +1
-0@@ -265,6 +265,7 @@ struct ixgbe_vf_info {uint8_t spoofchk_enabled;uint8_t api_version;uint16_t switch_domain_id; +uint16_t xcast_mode; };/* drivers/net/ixgbe/ixgbe_pf.c index renamed from drivers/net/ixgbe/ixgbe_pf.c +0
-04b833ff..c9d1a1c 100644
drivers/net/ixgbe/ixgbe_pf.c +0
-16@@ -408,23 +408,6 @@ ixgbe_vf_reset_msg(struct rte_eth_dev *dev, uint16_t vf) }static int -ixgbe_enable_vf_mc_promisc(struct rte_eth_dev *dev, uint32_t vf) -{ -struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); -uint32_t vmolr; - - vmolr =IXGBE_READ_REG (hw,IXGBE_VMOLR (vf)); - -RTE_LOG (INFO ,PMD ,"VF %u: enabling multicast promiscuous\n" , vf); - - vmolr |=IXGBE_VMOLR_MPE ; - -IXGBE_WRITE_REG (hw,IXGBE_VMOLR (vf), vmolr); - -return 0 ; -} - -static int ixgbe_disable_vf_mc_promisc(struct rte_eth_dev *dev, uint32_t vf) { struct ixgbe_hw *hw =
IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);drivers/net/ixgbe/ixgbe_pf.c +25
-5@@ -688,19 +671,70 @@ ixgbe_set_vf_mc_promisc(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf) { struct ixgbe_vf_info *vfinfo = *(IXGBE_DEV_PRIVATE_TO_P_VFDATA (dev->data->dev_private)); -bool enable = !!msgbuf[1 ];/* msgbuf contains the flag to enable */ +struct ixgbe_hw *hw =IXGBE_DEV_PRIVATE_TO_HW (dev->data->dev_private); +int xcast_mode = msgbuf[1 ];/* msgbuf contains the flag to enable */ +u32 vmolr, fctrl, disable, enable;switch (vfinfo[vf].api_version) {case ixgbe_mbox_api_12: +/* promisc introduced in 1.3 version */ +if (xcast_mode ==IXGBEVF_XCAST_MODE_PROMISC ) +return -EOPNOTSUPP ; +break ; +/* Fall threw */ +case ixgbe_mbox_api_13:break ;default :return -1 ; } -if (enable) -return ixgbe_enable_vf_mc_promisc (dev, vf); -else -return ixgbe_disable_vf_mc_promisc (dev, vf); +if (vfinfo[vf].xcast_mode == xcast_mode) + goto out; + +switch (xcast_mode) { +case IXGBEVF_XCAST_MODE_NONE : + disable =IXGBE_VMOLR_BAM |IXGBE_VMOLR_ROMPE | +IXGBE_VMOLR_MPE |IXGBE_VMOLR_UPE |IXGBE_VMOLR_VPE ; + enable =0 ; +break ; +case IXGBEVF_XCAST_MODE_MULTI : + disable =IXGBE_VMOLR_MPE |IXGBE_VMOLR_UPE |IXGBE_VMOLR_VPE ; + enable =IXGBE_VMOLR_BAM |IXGBE_VMOLR_ROMPE ; +break ; +case IXGBEVF_XCAST_MODE_ALLMULTI : + disable =IXGBE_VMOLR_UPE |IXGBE_VMOLR_VPE ; + enable = IXGBE_VMOLR_BAM | IXGBE_VMOLR_ROMPE |
IXGBE_VMOLR_MPE;drivers/net/ixgbe/ixgbe_pf.c +16
-0+break ; +case IXGBEVF_XCAST_MODE_PROMISC : +if (hw->mac.type <= ixgbe_mac_82599EB) +return -1 ; + + fctrl =IXGBE_READ_REG (hw,IXGBE_FCTRL ); +if (!(fctrl &IXGBE_FCTRL_UPE )) { +/* VF promisc requires PF in promisc */ +RTE_LOG (ERR ,PMD , +"Enabling VF promisc requires PF in promisc\n" ); +return -1 ; + } + + disable =0 ; + enable =IXGBE_VMOLR_BAM |IXGBE_VMOLR_ROMPE | + IXGBE_VMOLR_MPE | IXGBE_VMOLR_UPE |
IXGBE_VMOLR_VPE;drivers/net/ixgbe/ixgbe_pf.c +15
-1+break ; +default : +return -1 ; + } + + vmolr =IXGBE_READ_REG (hw,IXGBE_VMOLR (vf)); + vmolr &= ~disable; + vmolr |= enable; +IXGBE_WRITE_REG (hw,IXGBE_VMOLR (vf), vmolr); + vfinfo[vf].xcast_mode = xcast_mode; + +out: + msgbuf[1 ] = xcast_mode; + +return 0 ; } static int --2.7.5
Re: [PATCH v2 2/3] net/ixgbe: enable promiscuous mode on PF host
Quoted 20 lines
-----Original Message-----
From: Zhang, Qi Z
Sent: Wednesday, February 13, 2019 11:42 AM
To: Zhao1, Wei <[email protected]>; [email protected]
Cc: [email protected]; Lu, Wenzhuo <[email protected]>
Subject: RE: [PATCH v2 2/3] net/ixgbe: enable promiscuous mode on PF hostQuoted 8 lines
-----Original Message-----
From: Zhao1, Wei
Sent: Wednesday, January 16, 2019 1:02 PM
To: [email protected]
Cc: [email protected]; Lu, Wenzhuo <[email protected]>; Zhang, Qi Z <[email protected]>; Zhao1, Wei <[email protected]>
Subject: [PATCH v2 2/3] net/ixgbe: enable promiscuous mode on PF host
Quoted 4 lines
The title is misleading, we are going to support VF's promiscuous mode but not PF.
How about "Add VF promiscuous mode support when PF as host"
Get, update in v3
Quoted 147 lines
Quoted 8 lines
There is need to PF host promiscuous mode enable. For ixgbe, in order to support VF vlan promiscuous or unicast promiscuous, we need to set PF host register PFVML2FLT of bit UPE and VPE.
It also align to ixgbe kernel code version 5.5.3.Fixes 72dec9e37a84 ("ixgbe: support multicast promiscuous mode onVF")
Same to previous patch, not a fix.
drivers/net/ixgbe/ixgbe_pf.c ixgbe_set_vf_mc_promisc(struct rte_eth_dev
Quoted 51 lines
Signed-off-by Wei Zhao <[email protected]>--- drivers/net/ixgbe/ixgbe_ethdev.h | 1 + drivers/net/ixgbe/ixgbe_pf.c | 78 ++++++++++++++++++++++++++++------------ 2 files changed, 57 insertions(+), 22 deletions(-)drivers/net/ixgbe/ixgbe_ethdev.h +1
-0@@ -265,6 +265,7 @@ struct ixgbe_vf_info {uint8_t spoofchk_enabled;uint8_t api_version;uint16_t switch_domain_id; +uint16_t xcast_mode; };/* (quoted diff) +0
-0
b/drivers/net/ixgbe/ixgbe_pf.cindex 4b833ff..c9d1a1c 100644drivers/net/ixgbe/ixgbe_pf.c +0
-0@@ -408,23 +408,6 @@ ixgbe_vf_reset_msg(struct rte_eth_dev *dev,
uint16_t
vf) }static int
drivers/net/ixgbe/ixgbe_pf.c +0
-2-ixgbe_enable_vf_mc_promisc(struct rte_eth_dev *dev, uint32_t vf) -{ - struct ixgbe_hw *hw =
IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);drivers/net/ixgbe/ixgbe_pf.c +0
-14-uint32_t vmolr; - - vmolr =IXGBE_READ_REG (hw,IXGBE_VMOLR (vf)); - -RTE_LOG (INFO ,PMD ,"VF %u: enabling multicast promiscuous\n" , vf); - - vmolr |=IXGBE_VMOLR_MPE ; - -IXGBE_WRITE_REG (hw,IXGBE_VMOLR (vf), vmolr); - -return 0 ; -} - -static int ixgbe_disable_vf_mc_promisc(struct rte_eth_dev *dev, uint32_t vf) { struct ixgbe_hw *hw =
IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);drivers/net/ixgbe/ixgbe_pf.c +0
-0@@ -688,19 +671,70 @@ ixgbe_set_vf_mc_promisc(struct rte_eth_dev*dev,
drivers/net/ixgbe/ixgbe_pf.c ixgbe_set_vf_mc_promisc(struct rte_eth_dev · line 692
Quoted 5 lines
drivers/net/ixgbe/ixgbe_pf.c +0
-1uint32_t vf, uint32_t *msgbuf) { struct ixgbe_vf_info *vfinfo = *(IXGBE_DEV_PRIVATE_TO_P_VFDATA (dev->data- dev_private)); -bool enable = !!msgbuf[1 ];/* msgbuf contains the flag to enable */
drivers/net/ixgbe/ixgbe_pf.c ixgbe_set_vf_mc_promisc(struct rte_eth_dev · line 677
Quoted 3 lines
drivers/net/ixgbe/ixgbe_pf.c +2
-0+struct ixgbe_hw *hw =IXGBE_DEV_PRIVATE_TO_HW (dev->data->dev_private); +int xcast_mode = msgbuf[1 ];/* msgbuf contains the flag to enable */
Quoted 75 lines
drivers/net/ixgbe/ixgbe_pf.c +18
-4+u32 vmolr, fctrl, disable, enable;switch (vfinfo[vf].api_version) {case ixgbe_mbox_api_12: +/* promisc introduced in 1.3 version */ +if (xcast_mode ==IXGBEVF_XCAST_MODE_PROMISC ) +return -EOPNOTSUPP ; +break ; +/* Fall threw */ +case ixgbe_mbox_api_13:break ;default :return -1 ; } -if (enable) -return ixgbe_enable_vf_mc_promisc (dev, vf); -else -return ixgbe_disable_vf_mc_promisc (dev, vf); +if (vfinfo[vf].xcast_mode == xcast_mode) + goto out; + +switch (xcast_mode) { +case IXGBEVF_XCAST_MODE_NONE : + disable =IXGBE_VMOLR_BAM |IXGBE_VMOLR_ROMPE | +IXGBE_VMOLR_MPE |IXGBE_VMOLR_UPE |IXGBE_VMOLR_VPE ; + enable =0 ; +break ; +case IXGBEVF_XCAST_MODE_MULTI : + disable = IXGBE_VMOLR_MPE | IXGBE_VMOLR_UPE |
IXGBE_VMOLR_VPE;drivers/net/ixgbe/ixgbe_pf.c +5
-0+ enable =IXGBE_VMOLR_BAM |IXGBE_VMOLR_ROMPE ; +break ; +case IXGBEVF_XCAST_MODE_ALLMULTI : + disable =IXGBE_VMOLR_UPE |IXGBE_VMOLR_VPE ; + enable = IXGBE_VMOLR_BAM | IXGBE_VMOLR_ROMPE |
IXGBE_VMOLR_MPE;drivers/net/ixgbe/ixgbe_pf.c +16
-0+break ; +case IXGBEVF_XCAST_MODE_PROMISC : +if (hw->mac.type <= ixgbe_mac_82599EB) +return -1 ; + + fctrl =IXGBE_READ_REG (hw,IXGBE_FCTRL ); +if (!(fctrl &IXGBE_FCTRL_UPE )) { +/* VF promisc requires PF in promisc */ +RTE_LOG (ERR ,PMD , +"Enabling VF promisc requires PF in promisc\n" ); +return -1 ; + } + + disable =0 ; + enable =IXGBE_VMOLR_BAM |IXGBE_VMOLR_ROMPE | + IXGBE_VMOLR_MPE | IXGBE_VMOLR_UPE |
IXGBE_VMOLR_VPE;drivers/net/ixgbe/ixgbe_pf.c +15
-1+break ; +default : +return -1 ; + } + + vmolr =IXGBE_READ_REG (hw,IXGBE_VMOLR (vf)); + vmolr &= ~disable; + vmolr |= enable; +IXGBE_WRITE_REG (hw,IXGBE_VMOLR (vf), vmolr); + vfinfo[vf].xcast_mode = xcast_mode; + +out: + msgbuf[1 ] = xcast_mode; + +return 0 ; } static int --2.7.5
PATCH v2 3/3 net/ixgbe: update API version
In reply to Wei ZhaoThere is need to update to latest API version in order for negotiation between pf and vf, then new API message can be supported.
--- drivers/net/ixgbe/ixgbe_ethdev.c | 1 + drivers/net/ixgbe/ixgbe_pf.c | 1 + 2 files changed, 2 insertions(+)
drivers/net/ixgbe/ixgbe_ethdev.c +1 -0
@@ -1512,6 +1512,7 @@ ixgbevf_negotiate_api(struct ixgbe_hw *hw)/* start with highest supported, proceed down */ static const enum ixgbe_pfvf_api_rev sup_ver[] = { + ixgbe_mbox_api_13, ixgbe_mbox_api_12, ixgbe_mbox_api_11, ixgbe_mbox_api_10,
drivers/net/ixgbe/ixgbe_pf.c +1 -0
@@ -569,6 +569,7 @@ ixgbe_negotiate_vf_api(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf)case ixgbe_mbox_api_10:case ixgbe_mbox_api_11:case ixgbe_mbox_api_12: +case ixgbe_mbox_api_13: vfinfo[vf].api_version = (uint8_t )api_version;return 0 ;default :
Signature · 1 line
2.7.5
Re: [PATCH v2 3/3] net/ixgbe: update API version
I think this patch should be merged with PATCH 2/3, since "ixgbe_mbox_api_13" is already be referenced on that patch.
Quoted 47 lines
-----Original Message-----
From: Zhao1, Wei
Sent: Wednesday, January 16, 2019 1:02 PM
To: [email protected]
Cc: [email protected]; Lu, Wenzhuo <[email protected]>; Zhang, Qi Z <[email protected]>; Zhao1, Wei <[email protected]>
Subject: [PATCH v2 3/3] net/ixgbe: update API versionThere is need to update to latest API version in order for negotiation between pf and vf, then new API message can be supported.
Fixes 88fccb7a05c6 ("ixgbevf: fix jumbo frame")Signed-off-by Wei Zhao <[email protected]>--- drivers/net/ixgbe/ixgbe_ethdev.c | 1 + drivers/net/ixgbe/ixgbe_pf.c | 1 + 2 files changed, 2 insertions(+)drivers/net/ixgbe/ixgbe_ethdev.c +1
-0@@ -1512,6 +1512,7 @@ ixgbevf_negotiate_api(struct ixgbe_hw *hw)/* start with highest supported, proceed down */ static const enum ixgbe_pfvf_api_rev sup_ver[] = { + ixgbe_mbox_api_13, ixgbe_mbox_api_12, ixgbe_mbox_api_11, ixgbe_mbox_api_10,drivers/net/ixgbe/ixgbe_pf.c index renamed from drivers/net/ixgbe/ixgbe_pf.c +0
-0c9d1a1c..a6d8501 100644
drivers/net/ixgbe/ixgbe_pf.c +1
-0@@ -569,6 +569,7 @@ ixgbe_negotiate_vf_api(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf) case ixgbe_mbox_api_10: case ixgbe_mbox_api_11: case ixgbe_mbox_api_12: + case ixgbe_mbox_api_13: vfinfo[vf].api_version = (uint8_t)api_version;return 0 ;default:
--
2.7.5
Re: [PATCH v2 3/3] net/ixgbe: update API version
Hi, qi
New v3 has been commit as your request, thanks.
Quoted 58 lines
-----Original Message-----
From: Zhang, Qi Z
Sent: Wednesday, February 13, 2019 11:44 AM
To: Zhao1, Wei <[email protected]>; [email protected]
Cc: [email protected]; Lu, Wenzhuo <[email protected]>
Subject: RE: [PATCH v2 3/3] net/ixgbe: update API versionI think this patch should be merged with PATCH 2/3, since "
ixgbe_mbox_api_13" is already be referenced on that patch.Quoted 48 lines
-----Original Message-----
From: Zhao1, Wei
Sent: Wednesday, January 16, 2019 1:02 PM
To: [email protected]
Cc: [email protected]; Lu, Wenzhuo <[email protected]>; Zhang, Qi Z <[email protected]>; Zhao1, Wei <[email protected]>
Subject: [PATCH v2 3/3] net/ixgbe: update API versionThere is need to update to latest API version in order for negotiation between pf and vf, then new API message can be supported.
Fixes 88fccb7a05c6 ("ixgbevf: fix jumbo frame")Signed-off-by Wei Zhao <[email protected]>--- drivers/net/ixgbe/ixgbe_ethdev.c | 1 + drivers/net/ixgbe/ixgbe_pf.c | 1 + 2 files changed, 2 insertions(+)drivers/net/ixgbe/ixgbe_ethdev.c +1
-0@@ -1512,6 +1512,7 @@ ixgbevf_negotiate_api(struct ixgbe_hw *hw)/* start with highest supported, proceed down */ static const enum ixgbe_pfvf_api_rev sup_ver[] = { + ixgbe_mbox_api_13, ixgbe_mbox_api_12, ixgbe_mbox_api_11, ixgbe_mbox_api_10,(quoted diff) +0
-0
b/drivers/net/ixgbe/ixgbe_pf.cindex
c9d1a1c..a6d8501 100644drivers/net/ixgbe/ixgbe_pf.c +1
-0@@ -569,6 +569,7 @@ ixgbe_negotiate_vf_api(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf) case ixgbe_mbox_api_10: case ixgbe_mbox_api_11: case ixgbe_mbox_api_12: + case ixgbe_mbox_api_13: vfinfo[vf].api_version = (uint8_t)api_version;return 0 ;default:
--
2.7.5
v3 cover net/ixgbe: promiscuous mode enable on VF
In reply to Wei ZhaoThere is need to enable promiscuous mode enable on VF, pf host should also enable to support that.
v2:
--fix typo in commit log.
v3:
--delete unnecessary commit log infomation --merge 2 patch into 1
--change patch headline name
--add promiscuous enable support infomation into doc
Zhao Wei (2):
net/ixgbe: promiscuous mode enable on VF net/ixgbe: add VF promiscuous mode support when PF as host
doc/guides/nics/features/ixgbe_vf.ini | 1 + drivers/net/ixgbe/ixgbe_ethdev.c | 21 ++++++++++ drivers/net/ixgbe/ixgbe_ethdev.h | 1 + drivers/net/ixgbe/ixgbe_pf.c | 79 +++++++++++++++++++++++++---------- 4 files changed, 80 insertions(+), 22 deletions(-)
Signature · 1 line
2.7.5
PATCH v3 1/2 net/ixgbe: promiscuous mode enable on VF
There is need to enable two ops of promiscuous_enable and promiscuous_disable on VF.
--- doc/guides/nics/features/ixgbe_vf.ini | 1 + drivers/net/ixgbe/ixgbe_ethdev.c | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+)
doc/guides/nics/features/ixgbe_vf.ini +1 -0
@@ -11,6 +11,7 @@ Jumbo frame = Y Scattered Rx = Y LRO = Y TSO = Y +Promiscuous mode = Y Allmulticast mode = Y Unicast MAC filter = Y RSS hash = Y
drivers/net/ixgbe/ixgbe_ethdev.c +20 -0
@@ -260,6 +260,8 @@ static int ixgbevf_dev_rx_queue_intr_disable(struct rte_eth_dev *dev,static void ixgbevf_set_ivar_map (struct ixgbe_hw *hw,int8_t direction,uint8_t queue,uint8_t msix_vector);static void ixgbevf_configure_msix (struct rte_eth_dev *dev); +static void ixgbevf_dev_promiscuous_enable (struct rte_eth_dev *dev); +static void ixgbevf_dev_promiscuous_disable (struct rte_eth_dev *dev);static void ixgbevf_dev_allmulticast_enable (struct rte_eth_dev *dev);static void ixgbevf_dev_allmulticast_disable (struct rte_eth_dev *dev);
@@ -596,6 +598,8 @@ static const struct eth_dev_ops ixgbevf_eth_dev_ops = { .xstats_get_names = ixgbevf_dev_xstats_get_names, .dev_close = ixgbevf_dev_close, .dev_reset = ixgbevf_dev_reset, + .promiscuous_enable = ixgbevf_dev_promiscuous_enable, + .promiscuous_disable = ixgbevf_dev_promiscuous_disable, .allmulticast_enable = ixgbevf_dev_allmulticast_enable, .allmulticast_disable = ixgbevf_dev_allmulticast_disable, .dev_infos_get = ixgbevf_dev_info_get,
@@ -8301,6 +8305,22 @@ ixgbe_dev_udp_tunnel_port_del(struct rte_eth_dev *dev, }static void +ixgbevf_dev_promiscuous_enable (struct rte_eth_dev *dev) +{ +struct ixgbe_hw *hw =IXGBE_DEV_PRIVATE_TO_HW (dev->data->dev_private); + + hw->mac.ops.update_xcast_mode (hw,IXGBEVF_XCAST_MODE_PROMISC ); +} + +static void +ixgbevf_dev_promiscuous_disable (struct rte_eth_dev *dev) +{ +struct ixgbe_hw *hw =IXGBE_DEV_PRIVATE_TO_HW (dev->data->dev_private); + + hw->mac.ops.update_xcast_mode (hw,IXGBEVF_XCAST_MODE_NONE ); +} + +static void ixgbevf_dev_allmulticast_enable (struct rte_eth_dev *dev) {struct ixgbe_hw *hw =IXGBE_DEV_PRIVATE_TO_HW (dev->data->dev_private);
Signature · 1 line
2.7.5
Re: [PATCH v3 1/2] net/ixgbe: promiscuous mode enable on VF
HI
Quoted 10 lines
-----Original Message-----
From: Zhao1, Wei
Sent: Wednesday, February 13, 2019 3:19 PM
To: [email protected]
Cc: [email protected]; Zhang, Qi Z <[email protected]>; Zhao1, Wei <[email protected]>
Subject: [PATCH v3 1/2] net/ixgbe: promiscuous mode enable on VFThere is need to enable two ops of
promiscuous_enableandpromiscuous_disableon VF.
Should we add something to the release note? This looks like a common feature enabling for a wildly used device, users may need to be notified for this features.
Thanks
Qi
Quoted 68 lines
Signed-off-by Wei Zhao <[email protected]>--- doc/guides/nics/features/ixgbe_vf.ini | 1 + drivers/net/ixgbe/ixgbe_ethdev.c | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+)doc/guides/nics/features/ixgbe_vf.ini +1
-0@@ -11,6 +11,7 @@ Jumbo frame = Y Scattered Rx = Y LRO = Y TSO = Y +Promiscuous mode = Y Allmulticast mode = Y Unicast MAC filter = Y RSS hash = Ydrivers/net/ixgbe/ixgbe_ethdev.c +16
-0@@ -260,6 +260,8 @@ static int ixgbevf_dev_rx_queue_intr_disable(struct rte_eth_dev *dev, static void ixgbevf_set_ivar_map(struct ixgbe_hw *hw,int8_t direction,uint8_t queue,uint8_t msix_vector);static void ixgbevf_configure_msix (struct rte_eth_dev *dev); +static void ixgbevf_dev_promiscuous_enable (struct rte_eth_dev *dev); +static void ixgbevf_dev_promiscuous_disable (struct rte_eth_dev *dev);static void ixgbevf_dev_allmulticast_enable (struct rte_eth_dev *dev);static void ixgbevf_dev_allmulticast_disable (struct rte_eth_dev *dev);@@ -596,6 +598,8 @@ static const struct eth_dev_ops ixgbevf_eth_dev_ops = { .xstats_get_names = ixgbevf_dev_xstats_get_names, .dev_close = ixgbevf_dev_close, .dev_reset = ixgbevf_dev_reset, + .promiscuous_enable = ixgbevf_dev_promiscuous_enable, + .promiscuous_disable = ixgbevf_dev_promiscuous_disable, .allmulticast_enable = ixgbevf_dev_allmulticast_enable, .allmulticast_disable = ixgbevf_dev_allmulticast_disable, .dev_infos_get = ixgbevf_dev_info_get,@@ -8301,6 +8305,22 @@ ixgbe_dev_udp_tunnel_port_del(struct rte_eth_dev *dev, }static void +ixgbevf_dev_promiscuous_enable (struct rte_eth_dev *dev) { +struct ixgbe_hw *hw =IXGBE_DEV_PRIVATE_TO_HW (dev->data->dev_private); + + hw->mac.ops.update_xcast_mode (hw,IXGBEVF_XCAST_MODE_PROMISC ); } + +static void +ixgbevf_dev_promiscuous_disable (struct rte_eth_dev *dev) { +struct ixgbe_hw *hw =IXGBE_DEV_PRIVATE_TO_HW (dev->data->dev_private); + + hw->mac.ops.update_xcast_mode (hw,IXGBEVF_XCAST_MODE_NONE ); } + +static void ixgbevf_dev_allmulticast_enable (struct rte_eth_dev *dev) { struct ixgbe_hw *hw =
IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
--
2.7.5
Re: [PATCH v3 1/2] net/ixgbe: promiscuous mode enable on VF
Hi ,qi
New v4 has been commit, thanks.
Quoted 99 lines
-----Original Message-----
From: Zhang, Qi Z
Sent: Friday, March 1, 2019 3:53 PM
To: Zhao1, Wei <[email protected]>; [email protected]
Cc: [email protected]
Subject: RE: [PATCH v3 1/2] net/ixgbe: promiscuous mode enable on VFHI
Quoted 10 lines
-----Original Message-----
From: Zhao1, Wei
Sent: Wednesday, February 13, 2019 3:19 PM
To: [email protected]
Cc: [email protected]; Zhang, Qi Z <[email protected]>; Zhao1, Wei <[email protected]>
Subject: [PATCH v3 1/2] net/ixgbe: promiscuous mode enable on VFThere is need to enable two ops of
promiscuous_enableandpromiscuous_disableon VF.Should we add something to the release note? This looks like a common feature enabling for a wildly used device, users may need to be notified for this features.
Thanks
QiQuoted 26 lines
Signed-off-by Wei Zhao <[email protected]>--- doc/guides/nics/features/ixgbe_vf.ini | 1 + drivers/net/ixgbe/ixgbe_ethdev.c | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+)doc/guides/nics/features/ixgbe_vf.ini +1
-0@@ -11,6 +11,7 @@ Jumbo frame = Y Scattered Rx = Y LRO = Y TSO = Y +Promiscuous mode = Y Allmulticast mode = Y Unicast MAC filter = Y RSS hash = Ydrivers/net/ixgbe/ixgbe_ethdev.c +0
-0@@ -260,6 +260,8 @@ static intQuoted 4 lines
ixgbevf_dev_rx_queue_intr_disable(struct
rte_eth_dev*dev, static void ixgbevf_set_ivar_map(structixgbe_hw*hw,int8_tdirection,
uint8_tqueue,uint8_tmsix_vector); staticvoid
drivers/net/ixgbe/ixgbe_ethdev.c static const struct eth_dev_ops
Quoted 7 lines
ixgbevf_configure_msix(struct rte_eth_dev *dev);drivers/net/ixgbe/ixgbe_ethdev.c +2
-0+static void ixgbevf_dev_promiscuous_enable (struct rte_eth_dev *dev); +static void ixgbevf_dev_promiscuous_disable (struct rte_eth_dev *dev);static void ixgbevf_dev_allmulticast_enable (struct rte_eth_dev *dev);static void
ixgbevf_dev_allmulticast_disable(struct rte_eth_dev *dev);drivers/net/ixgbe/ixgbe_ethdev.c +0
-0@@ -596,6 +598,8 @@ static const struct eth_dev_ops
ixgbevf_eth_dev_ops= {Quoted 15 lines
drivers/net/ixgbe/ixgbe_ethdev.c +4
-0.xstats_get_names = ixgbevf_dev_xstats_get_names, .dev_close = ixgbevf_dev_close, .dev_reset = ixgbevf_dev_reset, + .promiscuous_enable = ixgbevf_dev_promiscuous_enable, + .promiscuous_disable = ixgbevf_dev_promiscuous_disable, .allmulticast_enable = ixgbevf_dev_allmulticast_enable, .allmulticast_disable = ixgbevf_dev_allmulticast_disable, .dev_infos_get = ixgbevf_dev_info_get,@@ -8301,6 +8305,22 @@ ixgbe_dev_udp_tunnel_port_del(struct rte_eth_dev *dev, }static void +ixgbevf_dev_promiscuous_enable (struct rte_eth_dev *dev) { +struct ixgbe_hw *hw =IXGBE_DEV_PRIVATE_TO_HW (dev->data->dev_private);drivers/net/ixgbe/ixgbe_ethdev.c ixgbe_dev_udp_tunnel_port_del(struct · line 8320
Quoted 10 lines
drivers/net/ixgbe/ixgbe_ethdev.c +8
-0+ + hw->mac.ops.update_xcast_mode (hw,IXGBEVF_XCAST_MODE_PROMISC ); } + +static void +ixgbevf_dev_promiscuous_disable (struct rte_eth_dev *dev) { +struct ixgbe_hw *hw =IXGBE_DEV_PRIVATE_TO_HW (dev->data->dev_private); + + hw->mac.ops.update_xcast_mode(hw,
IXGBEVF_XCAST_MODE_NONE); }Quoted 7 lines
drivers/net/ixgbe/ixgbe_ethdev.c +2
-0+ +static void ixgbevf_dev_allmulticast_enable (struct rte_eth_dev *dev) { struct ixgbe_hw *hw =
IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
--
2.7.5
PATCH v3 2/2 net/ixgbe: add VF promiscuous mode support when PF as host
In reply to Wei ZhaoThere is need to PF host promiscuous mode enable. For ixgbe, in order to support VF vlan promiscuous or unicast promiscuous, we need to set PF host register PFVML2FLT of bit UPE and VPE. It also align to ixgbe kernel code version 5.5.3. And also it need to update to the latest API version in order for negotiation between pf and vf, then new API message can be supported.
--- drivers/net/ixgbe/ixgbe_ethdev.c | 1 + drivers/net/ixgbe/ixgbe_ethdev.h | 1 + drivers/net/ixgbe/ixgbe_pf.c | 79 +++++++++++++++++++++++++++++----------- 3 files changed, 59 insertions(+), 22 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +1 -0
@@ -1512,6 +1512,7 @@ ixgbevf_negotiate_api(struct ixgbe_hw *hw)/* start with highest supported, proceed down */ static const enum ixgbe_pfvf_api_rev sup_ver[] = { + ixgbe_mbox_api_13, ixgbe_mbox_api_12, ixgbe_mbox_api_11, ixgbe_mbox_api_10,
drivers/net/ixgbe/ixgbe_ethdev.h +1 -0
@@ -265,6 +265,7 @@ struct ixgbe_vf_info {uint8_t spoofchk_enabled;uint8_t api_version;uint16_t switch_domain_id; +uint16_t xcast_mode; };/*
drivers/net/ixgbe/ixgbe_pf.c +57 -22
105 lines not on this page · raw message
Signature · 1 line
2.7.5
v4 cover net/ixgbe: promiscuous mode enable on VF
In reply to Wei ZhaoThere is need to enable promiscuous mode enable on VF, pf host should also enable to support that.
v2:
--fix typo in commit log.
v3:
--delete unnecessary commit log infomation --merge 2 patch into 1
--change patch headline name
--add promiscuous enable support infomation into doc
v4:
--add information to release note
Wei Zhao (2):
net/ixgbe: promiscuous mode enable on VF net/ixgbe: add VF promiscuous mode support when PF as host
doc/guides/nics/features/ixgbe_vf.ini | 1 + doc/guides/rel_notes/release_19_05.rst | 5 +++ drivers/net/ixgbe/ixgbe_ethdev.c | 21 +++++++++ drivers/net/ixgbe/ixgbe_ethdev.h | 1 + drivers/net/ixgbe/ixgbe_pf.c | 79 ++++++++++++++++++++++++---------- 5 files changed, 85 insertions(+), 22 deletions(-)
Signature · 1 line
2.7.5
PATCH v4 1/2 net/ixgbe: promiscuous mode enable on VF
There is need to enable two ops of promiscuous_enable and promiscuous_disable on VF.
--- doc/guides/nics/features/ixgbe_vf.ini | 1 + doc/guides/rel_notes/release_19_05.rst | 5 +++++ drivers/net/ixgbe/ixgbe_ethdev.c | 20 ++++++++++++++++++++ 3 files changed, 26 insertions(+)
doc/guides/nics/features/ixgbe_vf.ini +1 -0
@@ -11,6 +11,7 @@ Jumbo frame = Y Scattered Rx = Y LRO = Y TSO = Y +Promiscuous mode = Y Allmulticast mode = Y Unicast MAC filter = Y RSS hash = Y
doc/guides/rel_notes/release_19_05.rst +5 -0
@@ -85,6 +85,11 @@ New Features * Added limited support for RSS. * Added limited support for PASSTHRU. +* **Enable promiscuous mode on ixgbe VF.** + + Enable promiscuous mode enable ixgbe on VF, + pf host also be enabled to support that. + Removed Items -------------
drivers/net/ixgbe/ixgbe_ethdev.c +20 -0
@@ -260,6 +260,8 @@ static int ixgbevf_dev_rx_queue_intr_disable(struct rte_eth_dev *dev,static void ixgbevf_set_ivar_map (struct ixgbe_hw *hw,int8_t direction,uint8_t queue,uint8_t msix_vector);static void ixgbevf_configure_msix (struct rte_eth_dev *dev); +static void ixgbevf_dev_promiscuous_enable (struct rte_eth_dev *dev); +static void ixgbevf_dev_promiscuous_disable (struct rte_eth_dev *dev);static void ixgbevf_dev_allmulticast_enable (struct rte_eth_dev *dev);static void ixgbevf_dev_allmulticast_disable (struct rte_eth_dev *dev);
@@ -596,6 +598,8 @@ static const struct eth_dev_ops ixgbevf_eth_dev_ops = { .xstats_get_names = ixgbevf_dev_xstats_get_names, .dev_close = ixgbevf_dev_close, .dev_reset = ixgbevf_dev_reset, + .promiscuous_enable = ixgbevf_dev_promiscuous_enable, + .promiscuous_disable = ixgbevf_dev_promiscuous_disable, .allmulticast_enable = ixgbevf_dev_allmulticast_enable, .allmulticast_disable = ixgbevf_dev_allmulticast_disable, .dev_infos_get = ixgbevf_dev_info_get,
@@ -8310,6 +8314,22 @@ ixgbe_dev_udp_tunnel_port_del(struct rte_eth_dev *dev, }static void +ixgbevf_dev_promiscuous_enable (struct rte_eth_dev *dev) +{ +struct ixgbe_hw *hw =IXGBE_DEV_PRIVATE_TO_HW (dev->data->dev_private); + + hw->mac.ops.update_xcast_mode (hw,IXGBEVF_XCAST_MODE_PROMISC ); +} + +static void +ixgbevf_dev_promiscuous_disable (struct rte_eth_dev *dev) +{ +struct ixgbe_hw *hw =IXGBE_DEV_PRIVATE_TO_HW (dev->data->dev_private); + + hw->mac.ops.update_xcast_mode (hw,IXGBEVF_XCAST_MODE_NONE ); +} + +static void ixgbevf_dev_allmulticast_enable (struct rte_eth_dev *dev) {struct ixgbe_hw *hw =IXGBE_DEV_PRIVATE_TO_HW (dev->data->dev_private);
Signature · 1 line
2.7.5
PATCH v4 2/2 net/ixgbe: add VF promiscuous mode support when PF as host
In reply to Wei ZhaoThere is need to PF host promiscuous mode enable. For ixgbe, in order to support VF vlan promiscuous or unicast promiscuous, we need to set PF host register PFVML2FLT of bit UPE and VPE. It also align to ixgbe kernel code version 5.5.3. And also it need to update to the latest API version in order for negotiation between pf and vf, then new API message can be supported.
--- drivers/net/ixgbe/ixgbe_ethdev.c | 1 + drivers/net/ixgbe/ixgbe_ethdev.h | 1 + drivers/net/ixgbe/ixgbe_pf.c | 79 +++++++++++++++++++++++++++++----------- 3 files changed, 59 insertions(+), 22 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +1 -0
@@ -1515,6 +1515,7 @@ ixgbevf_negotiate_api(struct ixgbe_hw *hw)/* start with highest supported, proceed down */ static const enum ixgbe_pfvf_api_rev sup_ver[] = { + ixgbe_mbox_api_13, ixgbe_mbox_api_12, ixgbe_mbox_api_11, ixgbe_mbox_api_10,
drivers/net/ixgbe/ixgbe_ethdev.h +1 -0
@@ -266,6 +266,7 @@ struct ixgbe_vf_info {uint8_t spoofchk_enabled;uint8_t api_version;uint16_t switch_domain_id; +uint16_t xcast_mode; };/*
drivers/net/ixgbe/ixgbe_pf.c +57 -22
105 lines not on this page · raw message
Signature · 1 line
2.7.5
Re: [PATCH v4 0/2] net/ixgbe: promiscuous mode enable on VF
In reply to Wei ZhaoQuoted 34 lines
-----Original Message-----
From: Zhao1, Wei
Sent: Friday, March 8, 2019 10:46 AM
To: [email protected]
Cc: [email protected]; Zhang, Qi Z <[email protected]>
Subject: [PATCH v4 0/2] net/ixgbe: promiscuous mode enable on VFThere is need to enable promiscuous mode enable on VF, pf host should also enable to support that.
v2:
--fix typo in commit log.v3:
--delete unnecessary commit log infomation --merge 2 patch into 1 --change patch headline name --add promiscuous enable support infomation into docv4:
--add information to release noteWei Zhao (2):
net/ixgbe: promiscuous mode enable on VF net/ixgbe: add VF promiscuous mode support when PF as hostdoc/guides/nics/features/ixgbe_vf.ini | 1 + doc/guides/rel_notes/release_19_05.rst | 5 +++ drivers/net/ixgbe/ixgbe_ethdev.c | 21 +++++++++ drivers/net/ixgbe/ixgbe_ethdev.h | 1 + drivers/net/ixgbe/ixgbe_pf.c | 79 ++++++++++++++++++++++++---------- 5 files changed, 85 insertions(+), 22 deletions(-)
Quoted 2 lines
--
2.7.5
Applied to dpdk-next-net-intel with minor reword on commit log and release notes.
Thanks
Qi
Quoted 8 lines · Wei Zhao
There is need to enable promiscuous mode enable on VF, pf host should also enable to support that.
Zhao Wei (3):
net/ixgbe: promiscuous mode enable on VF
net/ixgbe: enable promiscous mode on PF host
net/ixgbe: update API version
Quoted 9 lines
drivers/net/ixgbe/ixgbe_ethdev.c | 21 +++++++++++ drivers/net/ixgbe/ixgbe_ethdev.h | 1 + drivers/net/ixgbe/ixgbe_pf.c | 79 +++++++++++++++++++++++++++++----------- 3 files changed, 79 insertions(+), 22 deletions(-)--
2.7.5
This series looks more about a missing feature than a proper fix. We have a new pf/vf api supported in this series and a new behaviour for promiscuous.
This is not stable material to me unless you expose a clear problem that this series wants to address.
Signature · 1 line
David Marchand
From: David Marchand [mailto:[email protected]]
Sent: Wednesday, January 16, 2019 4:29 PM
To: Zhao1, Wei <[email protected]>
Cc: [email protected]; dpdk stable <[email protected]>; Lu, Wenzhuo <[email protected]>; Zhang, Qi Z <[email protected]>
Subject: Re: [dpdk-dev] [PATCH 0/3] promiscuous mode enable on VF
On Wed, Jan 16, 2019 at 6:08 AM Wei Zhao <[email protected]<mailto:[email protected]>> wrote:
There is need to enable promiscuous mode enable on VF,
pf host should also enable to support that.
Zhao Wei (3):
net/ixgbe: promiscuous mode enable on VF
net/ixgbe: enable promiscous mode on PF host
net/ixgbe: update API version
drivers/net/ixgbe/ixgbe_ethdev.c | 21 +++++++++++ drivers/net/ixgbe/ixgbe_ethdev.h | 1 + drivers/net/ixgbe/ixgbe_pf.c | 79 +++++++++++++++++++++++++++++----------- 3 files changed, 79 insertions(+), 22 deletions(-)
--
2.7.5
This series looks more about a missing feature than a proper fix.
We have a new pf/vf api supported in this series and a new behaviour for promiscuous. This is not stable material to me unless you expose a clear problem that this series wants to address.
Yes, this a new feature enable related, but this patch set will not introduce problem, because vf promiscuous mode is close by default, this set is just send out for request from users that want to use vf promiscuous. They will open it in their APP. NOT only ixgbe, but also other NIC vf HAS SUPPORT this feature.
--
David Marchand
Quoted 8 lines · On Wed, 16 Jan 2019 12:42:52 +0800 Wei Zhao <[email protected]> wrote:
There is need to enable promiscuous mode enable on VF, pf host should also enable to support that.
Zhao Wei (3):
net/ixgbe: promiscuous mode enable on VF
net/ixgbe: enable promiscous mode on PF host
net/ixgbe: update API version
Quoted 5 lines
drivers/net/ixgbe/ixgbe_ethdev.c | 21 +++++++++++ drivers/net/ixgbe/ixgbe_ethdev.h | 1 + drivers/net/ixgbe/ixgbe_pf.c | 79 +++++++++++++++++++++++++++++----------- 3 files changed, 79 insertions(+), 22 deletions(-)
Is there someway to check if PF on host allows promiscious mode (and fail the attempt to set it on VF if not allowed).
Quoted 24 lines
-----Original Message-----
From: Stephen Hemminger [mailto:[email protected]]
Sent: Thursday, January 17, 2019 2:59 AM
To: Zhao1, Wei <[email protected]>
Cc: [email protected]; [email protected]; Lu, Wenzhuo <[email protected]>; Zhang, Qi Z <[email protected]>
Subject: Re: [dpdk-dev] [PATCH 0/3] promiscuous mode enable on VFQuoted 11 lines · On Wed, 16 Jan 2019 12:42:52 +0800 Wei Zhao <[email protected]> wrote:
There is need to enable promiscuous mode enable on VF, pf host should also enable to support that.
Zhao Wei (3):
net/ixgbe: promiscuous mode enable on VF
net/ixgbe: enable promiscous mode on PF host
net/ixgbe: update API versiondrivers/net/ixgbe/ixgbe_ethdev.c | 21 +++++++++++ drivers/net/ixgbe/ixgbe_ethdev.h | 1 + drivers/net/ixgbe/ixgbe_pf.c | 79
Quoted 6 lines
+++++++++++++++++++++++++++++-----------
Quoted 2 lines
3 files changed, 79 insertions(+), 22 deletions(-)Is there someway to check if PF on host allows promiscious mode (and fail the attempt to set it on VF if not allowed).
Yes,
Pf host has check vfinfo[vf].api_version, that is key for that check. If fail, it will return -1.
switch (vfinfo[vf].api_version) { case ixgbe_mbox_api_12:
+ /* promisc introduced in 1.3 version */
+ if (xcast_mode == IXGBEVF_XCAST_MODE_PROMISC)
+ return -EOPNOTSUPP;
+ break;
+ /* Fall threw */
+ case ixgbe_mbox_api_13:
break;
default:
return -1;
}