enable VLAN offload in DCF
PATCH 1/2 net/ice: add dcf port representor infrastructure
In reply to Qiming YangDefines data structures and code to init/uninit VF representors during pci_probe and pci_remove respectively.
Most of the dev_ops for the VF representor are just stubs for now and will be will be filled out in next patch
--- drivers/net/ice/Makefile | 1 + drivers/net/ice/ice_dcf_ethdev.c | 66 +++++- drivers/net/ice/ice_dcf_ethdev.h | 11 + drivers/net/ice/ice_dcf_vf_representor.c | 245 +++++++++++++++++++++++ 4 files changed, 321 insertions(+), 2 deletions(-) create mode 100644 drivers/net/ice/ice_dcf_vf_representor.c
drivers/net/ice/Makefile +1 -0
@@ -88,6 +88,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_generic_flow.c SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_dcf.c SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_dcf_ethdev.c +SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_dcf_vf_representor.c SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_dcf_parent.c # install this header file
drivers/net/ice/ice_dcf_ethdev.c +64 -2
81 lines not on this page · raw message
drivers/net/ice/ice_dcf_ethdev.h +11 -0
@@ -22,9 +22,20 @@ struct ice_dcf_adapter { struct ice_dcf_hw real_hw; }; +/** +* Struct to store private data for each VF representor instance +*/ +struct ice_dcf_vf_representor { +struct ice_dcf_adapter *adapter; +uint16_t switch_domain_id; +uint16_t vf_id; +}; +void ice_dcf_handle_pf_event_msg (struct ice_dcf_hw *dcf_hw,uint8_t *msg,uint16_t msglen);int ice_dcf_init_parent_adapter (struct rte_eth_dev *eth_dev);void ice_dcf_uninit_parent_adapter (struct rte_eth_dev *eth_dev); +int ice_dcf_vf_representor_init (struct rte_eth_dev *ethdev,void *init_params); +int ice_dcf_vf_representor_uninit (struct rte_eth_dev *ethdev);#endif /* _ICE_DCF_ETHDEV_H_ */
drivers/net/ice/ice_dcf_vf_representor.c new file +245 -0
245 lines not on this page · raw message
Signature · 1 line
2.17.1
cover enable VLAN offload in DCF
This patch set enabled port representor and vlan offload base on DCF port representor.
Qiming Yang (2):
net/ice: add dcf port representor infrastructure net/ice: add VLAN config for DCF
drivers/net/ice/Makefile | 1 + drivers/net/ice/ice_dcf.h | 1 + drivers/net/ice/ice_dcf_ethdev.c | 66 +++- drivers/net/ice/ice_dcf_ethdev.h | 11 + drivers/net/ice/ice_dcf_vf_representor.c | 365 +++++++++++++++++++++++ 5 files changed, 442 insertions(+), 2 deletions(-) create mode 100644 drivers/net/ice/ice_dcf_vf_representor.c
Signature · 1 line
2.17.1
PATCH 2/2 net/ice: add VLAN config for DCF
This patch add support for VF VLAN offload, port VLAN id set and VLAN ethertype set in DCF.
This patch depend on base code update.
--- drivers/net/ice/ice_dcf.h | 1 + drivers/net/ice/ice_dcf_vf_representor.c | 120 +++++++++++++++++++++++ 2 files changed, 121 insertions(+)
drivers/net/ice/ice_dcf.h +1 -0
@@ -59,6 +59,7 @@ struct ice_dcf_hw {uint16_t nb_msix;uint16_t rxq_map[16 ];struct virtchnl_eth_stats eth_stats_offset; +struct virtchnl_dcf_vlan_offload vlan_config; }; int ice_dcf_execute_virtchnl_cmd(struct ice_dcf_hw *hw,
drivers/net/ice/ice_dcf_vf_representor.c +120 -0
132 lines not on this page · raw message
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH 1/2] net/ice: add dcf port representor infrastructure
In reply to Qiming YangQuoted 37 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Qiming Yang
Sent: Wednesday, September 2, 2020 2:38 PM
To: [email protected]
Cc: Zhang, Qi Z <[email protected]>; Yang, Qiming <[email protected]>
Subject: [dpdk-dev] [PATCH 1/2] net/ice: add dcf port representor infrastructureDefines data structures and code to init/uninit VF representors during
pci_probeandpci_removerespectively.
Most of thedev_opsfor the VF representor are just stubs for now and will be will be filled out in next patchSigned-off-by Qiming Yang <[email protected]>--- drivers/net/ice/Makefile | 1 + drivers/net/ice/ice_dcf_ethdev.c | 66 +++++- drivers/net/ice/ice_dcf_ethdev.h | 11 + drivers/net/ice/ice_dcf_vf_representor.c | 245 +++++++++++++++++++++++ 4 files changed, 321 insertions(+), 2 deletions(-) create mode 100644
drivers/net/ice/ice_dcf_vf_representor.cdrivers/net/ice/Makefile index renamed from drivers/net/ice/Makefile +0
-0
34cd4024b..f9eb34a87100644drivers/net/ice/Makefile +0
-0@@ -88,6 +88,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) +=
ice_generic_flow.cSRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) +=
ice_dcf.cSRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) +=ice_dcf_ethdev.c
+SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) +=ice_dcf_vf_representor.c
SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) +=ice_dcf_parent.c
<...>
drivers/net/ice/Makefile
Quoted 4 lines
drivers/net/ice/Makefile +4
-0+ +static int +ice_dcf_representor_tx_queue_setup(__rte_unused struct rte_eth_dev *dev, + __rte_unused uint16_t rx_queue_id,
Should be tx_queue_id which is more readable?
drivers/net/ice/Makefile
Quoted 1 line
drivers/net/ice/Makefile +1
-0+ __rte_unused uint16_t nb_rx_desc,
Should be nb_tx_desc?
Quoted 5 lines
drivers/net/ice/Makefile +5
-0+ __rte_unused unsigned int socket_id, + __rte_unused const struct rte_eth_txconf *tx_conf) { + return 0; +} +
<...>
drivers/net/ice/Makefile
Quoted 11 lines
drivers/net/ice/Makefile +11
-0+ + /* No data-path, but need stub Rx/Tx functions to avoid crash + * when testing with the likes of testpmd. + */ + ethdev->rx_pkt_burst = ice_dcf_representor_rx_burst; + ethdev->tx_pkt_burst = ice_dcf_representor_tx_burst; + + ethdev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR; + ethdev->data->representor_id = representor->vf_id; + + struct rte_ether_addr mac_addr;
Why not move this to the beginning of the function?
Quoted 16 lines
drivers/net/ice/Makefile +14
-1+ + memset(&mac_addr, 0, sizeof(mac_addr)); + ethdev->data->mac_addrs = &mac_addr; + + return 0; +} + +int +ice_dcf_vf_representor_uninit(struct rte_eth_dev *ethdev) { + ethdev->data->mac_addrs = NULL; + + return 0; +} + --2.17.1
Re: [dpdk-dev] [PATCH 1/2] net/ice: add dcf port representor infrastructure
All the format issue will be rechecked in the next version
Quoted 54 lines
-----Original Message-----
From: Xing, Beilei <[email protected]>
Sent: Tuesday, September 8, 2020 19:35
To: Yang, Qiming <[email protected]>; [email protected]
Cc: Zhang, Qi Z <[email protected]>; Yang, Qiming <[email protected]>
Subject: RE: [dpdk-dev] [PATCH 1/2] net/ice: add dcf port representor infrastructureQuoted 36 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Qiming Yang
Sent: Wednesday, September 2, 2020 2:38 PM
To: [email protected]
Cc: Zhang, Qi Z <[email protected]>; Yang, Qiming <[email protected]>
Subject: [dpdk-dev] [PATCH 1/2] net/ice: add dcf port representor infrastructureDefines data structures and code to init/uninit VF representors during
pci_probeandpci_removerespectively.
Most of thedev_opsfor the VF representor are just stubs for now and will be will be filled out in next patchSigned-off-by Qiming Yang <[email protected]>--- drivers/net/ice/Makefile | 1 + drivers/net/ice/ice_dcf_ethdev.c | 66 +++++- drivers/net/ice/ice_dcf_ethdev.h | 11 + drivers/net/ice/ice_dcf_vf_representor.c | 245 +++++++++++++++++++++++ 4 files changed, 321 insertions(+), 2 deletions(-) create mode100644
drivers/net/ice/ice_dcf_vf_representor.cdrivers/net/ice/Makefile index renamed from drivers/net/ice/Makefile +0
-0
34cd4024b..f9eb34a87100644drivers/net/ice/Makefile +0
-0@@ -88,6 +88,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) +=
ice_generic_flow.cSRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) +=
ice_dcf.cSRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) +=ice_dcf_ethdev.c
+SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) +=ice_dcf_vf_representor.c
SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) +=ice_dcf_parent.c<...>
drivers/net/ice/Makefile
Quoted 3 lines
drivers/net/ice/Makefile +3
-0+ +static int +ice_dcf_representor_tx_queue_setup(__rte_unused struct rte_eth_dev*dev,
Quoted 5 lines
drivers/net/ice/Makefile
Quoted 1 line
drivers/net/ice/Makefile +1
-0+ __rte_unused uint16_t rx_queue_id,Should be
tx_queue_idwhich is more readable?drivers/net/ice/Makefile
Quoted 1 line
drivers/net/ice/Makefile +1
-0+ __rte_unused uint16_t nb_rx_desc,Should be
nb_tx_desc?
typo
Quoted 10 lines
drivers/net/ice/Makefile
Quoted 3 lines
drivers/net/ice/Makefile +2
-0+ __rte_unused unsigned int socket_id, + __rte_unused const struct rte_eth_txconf *tx_conf){
Quoted 3 lines
drivers/net/ice/Makefile +3
-0+ return 0; +} +<...>
Quoted 12 lines
drivers/net/ice/Makefile
Quoted 11 lines
drivers/net/ice/Makefile +11
-0+ + /* No data-path, but need stub Rx/Tx functions to avoid crash + * when testing with the likes of testpmd. + */ + ethdev->rx_pkt_burst = ice_dcf_representor_rx_burst; + ethdev->tx_pkt_burst = ice_dcf_representor_tx_burst; + + ethdev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR; + ethdev->data->representor_id = representor->vf_id; + + struct rte_ether_addr mac_addr;Why not move this to the beginning of the function?
Format error
Quoted 17 lines
Quoted 17 lines
drivers/net/ice/Makefile +14
-1+ + memset(&mac_addr, 0, sizeof(mac_addr)); + ethdev->data->mac_addrs = &mac_addr; + + return 0; +} + +int +ice_dcf_vf_representor_uninit(struct rte_eth_dev *ethdev) { + ethdev->data->mac_addrs = NULL; + + return 0; +} + --2.17.1
Re: [dpdk-dev] [PATCH 1/2] net/ice: add dcf port representor infrastructure
In reply to Qiming YangQuoted 32 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Qiming Yang
Sent: Wednesday, September 2, 2020 2:38 PM
To: [email protected]
Cc: Zhang, Qi Z <[email protected]>; Yang, Qiming <[email protected]>
Subject: [dpdk-dev] [PATCH 1/2] net/ice: add dcf port representor infrastructureDefines data structures and code to init/uninit VF representors during
pci_probeandpci_removerespectively.
Most of thedev_opsfor the VF representor are just stubs for now and will be will be filled out in next patchSigned-off-by Qiming Yang <[email protected]>--- drivers/net/ice/Makefile | 1 + drivers/net/ice/ice_dcf_ethdev.c | 66 +++++- drivers/net/ice/ice_dcf_ethdev.h | 11 + drivers/net/ice/ice_dcf_vf_representor.c | 245 +++++++++++++++++++++++ 4 files changed, 321 insertions(+), 2 deletions(-) create mode 100644
drivers/net/ice/ice_dcf_vf_representor.cdrivers/net/ice/Makefile index renamed from drivers/net/ice/Makefile +0
-0
34cd4024b..f9eb34a87100644drivers/net/ice/Makefile +0
-0@@ -88,6 +88,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) +=
ice_generic_flow.c
Quoted 4 lines
SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) +=
ice_dcf.cSRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) +=ice_dcf_ethdev.c
+SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) +=ice_dcf_vf_representor.c
SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) +=ice_dcf_parent.c
Need to change in meson.build.
Quoted 9 lines
# install this header filedrivers/net/ice/ice_dcf_ethdev.c +0
-0@@ -973,17 +973,79 @@ ice_dcf_cap_selected(struct rte_devargs *devargs) static int eth_ice_dcf_pci_probe(__rte_unused struct rte_pci_driver *pci_drv,struct rte_pci_device *pci_dev) {
<snip>
drivers/net/ice/ice_dcf_ethdev.c ice_dcf_cap_selected(struct rte_devargs *devargs) · line 1045
Quoted 12 lines
static int
eth_ice_dcf_pci_remove(struct rte_pci_device *pci_dev){drivers/net/ice/ice_dcf_ethdev.c +9
-1-return rte_eth_dev_pci_generic_remove (pci_dev, ice_dcf_dev_uninit); +struct rte_eth_dev *ethdev; + + ethdev =rte_eth_dev_allocated (pci_dev->device.name); +if (!ethdev) +return 0 ; + +if (ethdev->data->dev_flags &RTE_ETH_DEV_REPRESENTOR ) +return rte_eth_dev_pci_generic_remove (pci_dev, + ice_dcf_dev_uninit);
Should be ice_dcf_vf_representor_uninit here andice_dcf_dev_uninit below ?
Quoted 6 lines
drivers/net/ice/ice_dcf_ethdev.c +3
-0+else + return rte_eth_dev_pci_generic_remove(pci_dev, +ice_dcf_vf_representor_uninit);}
<snip>