diff options
author | Mintz, Yuval <Yuval.Mintz@cavium.com> | 2017-06-04 13:31:02 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-06-04 23:08:30 -0400 |
commit | 3946497aff655b9bb1807ef7e2ecbe799e6d832a (patch) | |
tree | d6913a9c0ff53ea18f9d7081e7e39732dd754435 /drivers/net/ethernet/qlogic/qed/qed_l2.h | |
parent | f604b17d7fdef574792a7e0b39f1b926d6b43d9d (diff) |
qed: Pass vf_params when creating a queue-cid
We're going to need additional information for queue-cids
that a PF creates for its VFs, so start by refactoring existing
logic used for initializing said struct into receiving a structure
encapsulating the VF-specific information that needs to be provided.
This also introduces QED_QUEUE_CID_SELF - each queue-cid would hold
an indication to whether it belongs to the hw-function holding it
[whether that's a PF or a VF], or else what's the VF id it belongs
to.
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qlogic/qed/qed_l2.h')
-rw-r--r-- | drivers/net/ethernet/qlogic/qed/qed_l2.h | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/drivers/net/ethernet/qlogic/qed/qed_l2.h b/drivers/net/ethernet/qlogic/qed/qed_l2.h index 6ad36449dae9..43aeaa882828 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_l2.h +++ b/drivers/net/ethernet/qlogic/qed/qed_l2.h @@ -278,6 +278,7 @@ void qed_get_vport_stats(struct qed_dev *cdev, struct qed_eth_stats *stats); void qed_reset_vport_stats(struct qed_dev *cdev); #define MAX_QUEUES_PER_QZONE (sizeof(unsigned long) * 8) +#define QED_QUEUE_CID_SELF (0xff) /* Almost identical to the qed_queue_start_common_params, * but here we maintain the SB index in IGU CAM. @@ -288,6 +289,25 @@ struct qed_queue_cid_params { u8 stats_id; }; +/* Additional parameters required for initialization of the queue_cid + * and are relevant only for a PF initializing one for its VFs. + */ +struct qed_queue_cid_vf_params { + /* Should match the VF's relative index */ + u8 vfid; + + /* 0-based queue index. Should reflect the relative qzone the + * VF thinks is associated with it [in its range]. + */ + u8 vf_qid; + + /* Indicates a VF is legacy, making it differ in: + * - Producers would be placed in a different place. + */ + bool vf_legacy; + +}; + struct qed_queue_cid { /* For stats-id, the `rel' is actually absolute as well */ struct qed_queue_cid_params rel; @@ -305,7 +325,7 @@ struct qed_queue_cid { * Notice this is relevant on the *PF* queue-cid of its VF's queues, * and not on the VF itself. */ - bool is_vf; + u8 vfid; u8 vf_qid; /* Legacy VFs might have Rx producer located elsewhere */ @@ -321,12 +341,11 @@ void qed_l2_free(struct qed_hwfn *p_hwfn); void qed_eth_queue_cid_release(struct qed_hwfn *p_hwfn, struct qed_queue_cid *p_cid); -struct qed_queue_cid *_qed_eth_queue_to_cid(struct qed_hwfn *p_hwfn, - u16 opaque_fid, - u32 cid, - u8 vf_qid, - struct qed_queue_start_common_params - *p_params); +struct qed_queue_cid * +qed_eth_queue_to_cid(struct qed_hwfn *p_hwfn, + u16 opaque_fid, + struct qed_queue_start_common_params *p_params, + struct qed_queue_cid_vf_params *p_vf_params); int qed_sp_eth_vport_start(struct qed_hwfn *p_hwfn, |