File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change 15
15
#include <linux/pci_regs.h>
16
16
#include <linux/vdpa.h>
17
17
#include <uapi/linux/virtio_net.h>
18
+ #include <uapi/linux/virtio_blk.h>
18
19
#include <uapi/linux/virtio_config.h>
19
20
#include <uapi/linux/virtio_pci.h>
20
21
28
29
#define C5000X_PL_SUBSYS_VENDOR_ID 0x8086
29
30
#define C5000X_PL_SUBSYS_DEVICE_ID 0x0001
30
31
31
- #define IFCVF_SUPPORTED_FEATURES \
32
+ #define C5000X_PL_BLK_VENDOR_ID 0x1AF4
33
+ #define C5000X_PL_BLK_DEVICE_ID 0x1001
34
+ #define C5000X_PL_BLK_SUBSYS_VENDOR_ID 0x8086
35
+ #define C5000X_PL_BLK_SUBSYS_DEVICE_ID 0x0002
36
+
37
+ #define IFCVF_NET_SUPPORTED_FEATURES \
32
38
((1ULL << VIRTIO_NET_F_MAC) | \
33
39
(1ULL << VIRTIO_F_ANY_LAYOUT) | \
34
40
(1ULL << VIRTIO_F_VERSION_1) | \
Original file line number Diff line number Diff line change @@ -168,10 +168,23 @@ static struct ifcvf_hw *vdpa_to_vf(struct vdpa_device *vdpa_dev)
168
168
169
169
static u64 ifcvf_vdpa_get_features (struct vdpa_device * vdpa_dev )
170
170
{
171
+ struct ifcvf_adapter * adapter = vdpa_to_adapter (vdpa_dev );
171
172
struct ifcvf_hw * vf = vdpa_to_vf (vdpa_dev );
173
+ struct pci_dev * pdev = adapter -> pdev ;
174
+
172
175
u64 features ;
173
176
174
- features = ifcvf_get_features (vf ) & IFCVF_SUPPORTED_FEATURES ;
177
+ switch (vf -> dev_type ) {
178
+ case VIRTIO_ID_NET :
179
+ features = ifcvf_get_features (vf ) & IFCVF_NET_SUPPORTED_FEATURES ;
180
+ break ;
181
+ case VIRTIO_ID_BLOCK :
182
+ features = ifcvf_get_features (vf );
183
+ break ;
184
+ default :
185
+ features = 0 ;
186
+ IFCVF_ERR (pdev , "VIRTIO ID %u not supported\n" , vf -> dev_type );
187
+ }
175
188
176
189
return features ;
177
190
}
@@ -514,6 +527,10 @@ static struct pci_device_id ifcvf_pci_ids[] = {
514
527
C5000X_PL_DEVICE_ID ,
515
528
C5000X_PL_SUBSYS_VENDOR_ID ,
516
529
C5000X_PL_SUBSYS_DEVICE_ID ) },
530
+ { PCI_DEVICE_SUB (C5000X_PL_BLK_VENDOR_ID ,
531
+ C5000X_PL_BLK_DEVICE_ID ,
532
+ C5000X_PL_BLK_SUBSYS_VENDOR_ID ,
533
+ C5000X_PL_BLK_SUBSYS_DEVICE_ID ) },
517
534
518
535
{ 0 },
519
536
};
You can’t perform that action at this time.
0 commit comments