]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/spdk/dpdk/drivers/net/cxgbe/cxgbevf_main.c
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / spdk / dpdk / drivers / net / cxgbe / cxgbevf_main.c
index 0ac2d98ebdd7136b467c844eb9eb9f45dfab4546..66fb923756df857b7599edf296670782d185cf46 100644 (file)
@@ -11,6 +11,7 @@
 #include "base/t4_regs.h"
 #include "base/t4_msg.h"
 #include "cxgbe.h"
+#include "cxgbe_pfvf.h"
 #include "mps_tcam.h"
 
 /*
@@ -122,11 +123,18 @@ static int adap_init0vf(struct adapter *adapter)
         * firmware won't understand this and we'll just get
         * unencapsulated messages ...
         */
-       param = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_PFVF) |
-               V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_PFVF_CPLFW4MSG_ENCAP);
+       param = CXGBE_FW_PARAM_PFVF(CPLFW4MSG_ENCAP);
        val = 1;
        t4vf_set_params(adapter, 1, &param, &val);
 
+       /* Query for max number of packets that can be coalesced for Tx */
+       param = CXGBE_FW_PARAM_PFVF(MAX_PKTS_PER_ETH_TX_PKTS_WR);
+       err = t4vf_query_params(adapter, 1, &param, &val);
+       if (!err && val > 0)
+               adapter->params.max_tx_coalesce_num = val;
+       else
+               adapter->params.max_tx_coalesce_num = ETH_COALESCE_VF_PKT_NUM;
+
        /*
         * Grab our Virtual Interface resource allocation, extract the
         * features that we're interested in and do a bit of sanity testing on
@@ -230,7 +238,7 @@ int cxgbevf_probe(struct adapter *adapter)
                        goto out_free;
 
 allocate_mac:
-               pi = (struct port_info *)eth_dev->data->dev_private;
+               pi = eth_dev->data->dev_private;
                adapter->port[i] = pi;
                pi->eth_dev = eth_dev;
                pi->adapter = adapter;
@@ -245,7 +253,7 @@ allocate_mac:
 
                rte_eth_copy_pci_info(pi->eth_dev, adapter->pdev);
                pi->eth_dev->data->mac_addrs = rte_zmalloc(name,
-                                                          ETHER_ADDR_LEN, 0);
+                                                       RTE_ETHER_ADDR_LEN, 0);
                if (!pi->eth_dev->data->mac_addrs) {
                        dev_err(adapter, "%s: Mem allocation failed for storing mac addr, aborting\n",
                                __func__);