From: Ajit Khaparde Date: Fri, 9 Jun 2017 04:24:46 +0000 (-0500) Subject: net/bnxt: move PMD specific functions X-Git-Tag: spdx-start~3037 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=20c8f79d2267408d8f493812e1939e65824f24aa;p=dpdk.git net/bnxt: move PMD specific functions Move PMD specific functions in the appropriate rte_pmd_bnxt.c file Signed-off-by: Ajit Khaparde --- diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index 54428babc0..1538aa59a3 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -250,32 +250,6 @@ struct bnxt { uint8_t num_leds; }; -/* - * Response sent back to the caller after callback - */ -enum rte_pmd_bnxt_mb_event_rsp { - RTE_PMD_BNXT_MB_EVENT_NOOP_ACK, /**< skip mbox request and ACK */ - RTE_PMD_BNXT_MB_EVENT_NOOP_NACK, /**< skip mbox request and NACK */ - RTE_PMD_BNXT_MB_EVENT_PROCEED, /**< proceed with mbox request */ - RTE_PMD_BNXT_MB_EVENT_MAX /**< max value of this enum */ -}; - -/* mailbox message types */ -#define BNXT_VF_RESET 0x01 /* VF requests reset */ -#define BNXT_VF_SET_MAC_ADDR 0x02 /* VF requests PF to set MAC addr */ -#define BNXT_VF_SET_VLAN 0x03 /* VF requests PF to set VLAN */ -#define BNXT_VF_SET_MTU 0x04 /* VF requests PF to set MTU */ -#define BNXT_VF_SET_MRU 0x05 /* VF requests PF to set MRU */ - -/* - * Data sent to the caller when the callback is executed. - */ -struct rte_pmd_bnxt_mb_event_param { - uint16_t vf_id; /* Virtual Function number */ - int retval; /* return value */ - void *msg; /* pointer to message */ -}; - int bnxt_link_update_op(struct rte_eth_dev *eth_dev, int wait_to_complete); int bnxt_rcv_msg_from_vf(struct bnxt *bp, uint16_t vf_id, void *msg); diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index f9bedf7c89..79e800b307 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -1899,24 +1899,6 @@ bnxt_dev_uninit(struct rte_eth_dev *eth_dev) { return rc; } -int bnxt_rcv_msg_from_vf(struct bnxt *bp, uint16_t vf_id, void *msg) -{ - struct rte_pmd_bnxt_mb_event_param cb_param; - - cb_param.retval = RTE_PMD_BNXT_MB_EVENT_PROCEED; - cb_param.vf_id = vf_id; - cb_param.msg = msg; - - _rte_eth_dev_callback_process(bp->eth_dev, RTE_ETH_EVENT_VF_MBOX, - &cb_param); - - /* Default to approve */ - if (cb_param.retval == RTE_PMD_BNXT_MB_EVENT_PROCEED) - cb_param.retval = RTE_PMD_BNXT_MB_EVENT_NOOP_ACK; - - return cb_param.retval == RTE_PMD_BNXT_MB_EVENT_NOOP_ACK ? true : false; -} - static int bnxt_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, struct rte_pci_device *pci_dev) { diff --git a/drivers/net/bnxt/rte_pmd_bnxt.c b/drivers/net/bnxt/rte_pmd_bnxt.c index 0542034c3c..faeb6f4678 100644 --- a/drivers/net/bnxt/rte_pmd_bnxt.c +++ b/drivers/net/bnxt/rte_pmd_bnxt.c @@ -48,6 +48,24 @@ #include "rte_pmd_bnxt.h" #include "hsi_struct_def_dpdk.h" +int bnxt_rcv_msg_from_vf(struct bnxt *bp, uint16_t vf_id, void *msg) +{ + struct rte_pmd_bnxt_mb_event_param cb_param; + + cb_param.retval = RTE_PMD_BNXT_MB_EVENT_PROCEED; + cb_param.vf_id = vf_id; + cb_param.msg = msg; + + _rte_eth_dev_callback_process(bp->eth_dev, RTE_ETH_EVENT_VF_MBOX, + &cb_param); + + /* Default to approve */ + if (cb_param.retval == RTE_PMD_BNXT_MB_EVENT_PROCEED) + cb_param.retval = RTE_PMD_BNXT_MB_EVENT_NOOP_ACK; + + return cb_param.retval == RTE_PMD_BNXT_MB_EVENT_NOOP_ACK ? true : false; +} + int rte_pmd_bnxt_set_tx_loopback(uint8_t port, uint8_t on) { struct rte_eth_dev *eth_dev; diff --git a/drivers/net/bnxt/rte_pmd_bnxt.h b/drivers/net/bnxt/rte_pmd_bnxt.h index db9ce7792e..964aa974fe 100644 --- a/drivers/net/bnxt/rte_pmd_bnxt.h +++ b/drivers/net/bnxt/rte_pmd_bnxt.h @@ -36,6 +36,32 @@ #include +/* + * Response sent back to the caller after callback + */ +enum rte_pmd_bnxt_mb_event_rsp { + RTE_PMD_BNXT_MB_EVENT_NOOP_ACK, /**< skip mbox request and ACK */ + RTE_PMD_BNXT_MB_EVENT_NOOP_NACK, /**< skip mbox request and NACK */ + RTE_PMD_BNXT_MB_EVENT_PROCEED, /**< proceed with mbox request */ + RTE_PMD_BNXT_MB_EVENT_MAX /**< max value of this enum */ +}; + +/* mailbox message types */ +#define BNXT_VF_RESET 0x01 /* VF requests reset */ +#define BNXT_VF_SET_MAC_ADDR 0x02 /* VF requests PF to set MAC addr */ +#define BNXT_VF_SET_VLAN 0x03 /* VF requests PF to set VLAN */ +#define BNXT_VF_SET_MTU 0x04 /* VF requests PF to set MTU */ +#define BNXT_VF_SET_MRU 0x05 /* VF requests PF to set MRU */ + +/* + * Data sent to the caller when the callback is executed. + */ +struct rte_pmd_bnxt_mb_event_param { + uint16_t vf_id; /* Virtual Function number */ + int retval; /* return value */ + void *msg; /* pointer to message */ +}; + /** * Enable/Disable VF MAC anti spoof *