diff options
-rw-r--r-- | src/plugins/avf/README.md | 7 | ||||
-rw-r--r-- | src/plugins/avf/device.c | 2 | ||||
-rw-r--r-- | src/plugins/avf/virtchnl.h | 10 |
3 files changed, 18 insertions, 1 deletions
diff --git a/src/plugins/avf/README.md b/src/plugins/avf/README.md index d1a8416621a..0c7d555775e 100644 --- a/src/plugins/avf/README.md +++ b/src/plugins/avf/README.md @@ -75,6 +75,13 @@ setup 0000:3b:00.0 00:11:22:33:44:00 setup 0000:3b:00.1 00:11:22:33:44:01 ``` +### Promisc mode +In cases when interface is used in the L2 mode or promisc mode is needed for some other reason, +trust needs to be set to "on" using the linux "ip link" utility. +``` +ip link set dev <PF inteface name> vf <VF id> trust on +``` + ### Interface Creation Interfaces can be dynamically created by using following CLI: ``` diff --git a/src/plugins/avf/device.c b/src/plugins/avf/device.c index 7d01149a1a0..e4c49da8fa0 100644 --- a/src/plugins/avf/device.c +++ b/src/plugins/avf/device.c @@ -561,7 +561,7 @@ avf_config_promisc_mode (vlib_main_t * vm, avf_device_t * ad) virtchnl_promisc_info_t pi = { 0 }; pi.vsi_id = ad->vsi_id; - pi.flags = 1; + pi.flags = FLAG_VF_UNICAST_PROMISC | FLAG_VF_MULTICAST_PROMISC; return avf_send_to_pf (vm, ad, VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE, &pi, sizeof (virtchnl_promisc_info_t), 0, 0); } diff --git a/src/plugins/avf/virtchnl.h b/src/plugins/avf/virtchnl.h index 1bdecbcdc8f..493384cb1d7 100644 --- a/src/plugins/avf/virtchnl.h +++ b/src/plugins/avf/virtchnl.h @@ -21,6 +21,16 @@ #define VIRTCHNL_VERSION_MAJOR 1 #define VIRTCHNL_VERSION_MINOR 1 +#define foreach_avf_promisc_flags \ + _(0, UNICAST_PROMISC, "unicast") \ + _(1, MULTICAST_PROMISC, "multicast") + +enum +{ +#define _(a, b, c) FLAG_VF_ ##b = (1 << a), + foreach_avf_promisc_flags +#undef _ +}; #define AVFINT_DYN_CTLN(x) (0x00003800 + (0x4 * x)) #define AVFINT_ICR0 0x00004800 |