+/* Check there is pending cmd in execution. If none, set new command. */
+static inline int
+_atomic_set_async_response_cmd(struct iavf_info *vf, enum virtchnl_ops ops)
+{
+ enum virtchnl_ops op_unk = VIRTCHNL_OP_UNKNOWN;
+ int ret = __atomic_compare_exchange(&vf->pend_cmd, &op_unk, &ops,
+ 0, __ATOMIC_ACQUIRE, __ATOMIC_ACQUIRE);
+
+ if (!ret)
+ PMD_DRV_LOG(ERR, "There is incomplete cmd %d", vf->pend_cmd);
+
+ __atomic_store_n(&vf->pend_cmd_count, 2, __ATOMIC_RELAXED);
+
+ return !ret;
+}