X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fenic%2Fenic_vf_representor.c;h=79dd6e5640dd50f978bedacb8bb752c1e159c6df;hb=e681eb0515ffa3f7ebfdc67d854f9e93c8d91f51;hp=5d34e1b4600ea1e893f98d7c7061227c36173a11;hpb=a93cf169267b5194260a129b2545c8c60b17f407;p=dpdk.git diff --git a/drivers/net/enic/enic_vf_representor.c b/drivers/net/enic/enic_vf_representor.c index 5d34e1b460..79dd6e5640 100644 --- a/drivers/net/enic/enic_vf_representor.c +++ b/drivers/net/enic/enic_vf_representor.c @@ -8,8 +8,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -242,7 +242,7 @@ static int enic_vf_dev_start(struct rte_eth_dev *eth_dev) return 0; } -static void enic_vf_dev_stop(struct rte_eth_dev *eth_dev) +static int enic_vf_dev_stop(struct rte_eth_dev *eth_dev) { struct enic_vf_representor *vf; struct vnic_rq *rq; @@ -250,7 +250,7 @@ static void enic_vf_dev_stop(struct rte_eth_dev *eth_dev) ENICPMD_FUNC_TRACE(); if (rte_eal_process_type() != RTE_PROC_PRIMARY) - return; + return 0; /* Undo dev_start. Disable/clean WQ */ vf = eth_dev->data->dev_private; pf = vf->pf; @@ -271,17 +271,20 @@ static void enic_vf_dev_stop(struct rte_eth_dev *eth_dev) eth_dev->data->rx_queue_state[0] = RTE_ETH_QUEUE_STATE_STOPPED; /* Clean up representor flowman */ enic_fm_destroy(&vf->enic); + + return 0; } /* * "close" is no-op for now and solely exists so that rte_eth_dev_close() * can finish its own cleanup without errors. */ -static void enic_vf_dev_close(struct rte_eth_dev *eth_dev __rte_unused) +static int enic_vf_dev_close(struct rte_eth_dev *eth_dev __rte_unused) { ENICPMD_FUNC_TRACE(); if (rte_eal_process_type() != RTE_PROC_PRIMARY) - return; + return 0; + return 0; } static int @@ -374,34 +377,21 @@ static const struct rte_flow_ops enic_vf_flow_ops = { }; static int -enic_vf_filter_ctrl(struct rte_eth_dev *eth_dev, - enum rte_filter_type filter_type, - enum rte_filter_op filter_op, - void *arg) +enic_vf_flow_ops_get(struct rte_eth_dev *eth_dev, + const struct rte_flow_ops **ops) { struct enic_vf_representor *vf; - int ret = 0; ENICPMD_FUNC_TRACE(); vf = eth_dev->data->dev_private; - switch (filter_type) { - case RTE_ETH_FILTER_GENERIC: - if (filter_op != RTE_ETH_FILTER_GET) - return -EINVAL; - if (vf->enic.flow_filter_mode == FILTER_FLOWMAN) { - *(const void **)arg = &enic_vf_flow_ops; - } else { - ENICPMD_LOG(WARNING, "VF representors require flowman support for rte_flow API"); - ret = -EINVAL; - } - break; - default: - ENICPMD_LOG(WARNING, "Filter type (%d) not supported", - filter_type); - ret = -EINVAL; - break; + if (vf->enic.flow_filter_mode != FILTER_FLOWMAN) { + ENICPMD_LOG(WARNING, + "VF representors require flowman support for rte_flow API"); + return -EINVAL; } - return ret; + + *ops = &enic_vf_flow_ops; + return 0; } static int enic_vf_link_update(struct rte_eth_dev *eth_dev, @@ -563,7 +553,7 @@ static const struct eth_dev_ops enic_vf_representor_dev_ops = { .dev_start = enic_vf_dev_start, .dev_stop = enic_vf_dev_stop, .dev_close = enic_vf_dev_close, - .filter_ctrl = enic_vf_filter_ctrl, + .flow_ops_get = enic_vf_flow_ops_get, .link_update = enic_vf_link_update, .promiscuous_enable = enic_vf_promiscuous_enable, .promiscuous_disable = enic_vf_promiscuous_disable, @@ -669,8 +659,8 @@ int enic_vf_representor_init(struct rte_eth_dev *eth_dev, void *init_params) eth_dev->device->driver = pf->rte_dev->device->driver; eth_dev->dev_ops = &enic_vf_representor_dev_ops; - eth_dev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR - | RTE_ETH_DEV_CLOSE_REMOVE; + eth_dev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR | + RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS; eth_dev->data->representor_id = vf->vf_id; eth_dev->data->mac_addrs = rte_zmalloc("enic_mac_addr_vf", sizeof(struct rte_ether_addr) *