net/octeontx2: support SDP interface
[dpdk.git] / drivers / net / octeontx2 / otx2_ethdev.c
index dfa8cd2..aab34db 100644 (file)
@@ -144,7 +144,7 @@ otx2_cgx_rxtx_start(struct otx2_eth_dev *dev)
 {
        struct otx2_mbox *mbox = dev->mbox;
 
-       if (otx2_dev_is_vf(dev))
+       if (otx2_dev_is_vf_or_sdp(dev))
                return 0;
 
        otx2_mbox_alloc_msg_cgx_start_rxtx(mbox);
@@ -157,7 +157,7 @@ otx2_cgx_rxtx_stop(struct otx2_eth_dev *dev)
 {
        struct otx2_mbox *mbox = dev->mbox;
 
-       if (otx2_dev_is_vf(dev))
+       if (otx2_dev_is_vf_or_sdp(dev))
                return 0;
 
        otx2_mbox_alloc_msg_cgx_stop_rxtx(mbox);
@@ -190,7 +190,7 @@ nix_cgx_start_link_event(struct otx2_eth_dev *dev)
 {
        struct otx2_mbox *mbox = dev->mbox;
 
-       if (otx2_dev_is_vf(dev))
+       if (otx2_dev_is_vf_or_sdp(dev))
                return 0;
 
        otx2_mbox_alloc_msg_cgx_start_linkevents(mbox);
@@ -203,7 +203,7 @@ cgx_intlbk_enable(struct otx2_eth_dev *dev, bool en)
 {
        struct otx2_mbox *mbox = dev->mbox;
 
-       if (otx2_dev_is_vf(dev))
+       if (otx2_dev_is_vf_or_sdp(dev))
                return 0;
 
        if (en)
@@ -219,7 +219,7 @@ nix_cgx_stop_link_event(struct otx2_eth_dev *dev)
 {
        struct otx2_mbox *mbox = dev->mbox;
 
-       if (otx2_dev_is_vf(dev))
+       if (otx2_dev_is_vf_or_sdp(dev))
                return 0;
 
        otx2_mbox_alloc_msg_cgx_stop_linkevents(mbox);
@@ -2086,6 +2086,15 @@ otx2_eth_dev_lf_detach(struct otx2_mbox *mbox)
        return otx2_mbox_process(mbox);
 }
 
+static bool
+otx2_eth_dev_is_sdp(struct rte_pci_device *pci_dev)
+{
+       if (pci_dev->id.device_id == PCI_DEVID_OCTEONTX2_RVU_SDP_PF ||
+           pci_dev->id.device_id == PCI_DEVID_OCTEONTX2_RVU_SDP_VF)
+               return true;
+       return false;
+}
+
 static int
 otx2_eth_dev_init(struct rte_eth_dev *eth_dev)
 {
@@ -2129,6 +2138,10 @@ otx2_eth_dev_init(struct rte_eth_dev *eth_dev)
                        goto error;
                }
        }
+       if (otx2_eth_dev_is_sdp(pci_dev))
+               dev->sdp_link = true;
+       else
+               dev->sdp_link = false;
        /* Device generic callbacks */
        dev->ops = &otx2_dev_ops;
        dev->eth_dev = eth_dev;
@@ -2416,6 +2429,14 @@ static const struct rte_pci_id pci_nix_map[] = {
                RTE_PCI_DEVICE(PCI_VENDOR_ID_CAVIUM,
                               PCI_DEVID_OCTEONTX2_RVU_AF_VF)
        },
+       {
+               RTE_PCI_DEVICE(PCI_VENDOR_ID_CAVIUM,
+                              PCI_DEVID_OCTEONTX2_RVU_SDP_PF)
+       },
+       {
+               RTE_PCI_DEVICE(PCI_VENDOR_ID_CAVIUM,
+                              PCI_DEVID_OCTEONTX2_RVU_SDP_VF)
+       },
        {
                .vendor_id = 0,
        },