Commit 007bc371 authored by Mintz, Yuval's avatar Mintz, Yuval Committed by David S. Miller

qed: IOV db support multiple queues per qzone

Allow the infrastructure a PF maintains for each one of its VFs
to support multiple queue-cids on a single queue-zone.
Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3b19f478
...@@ -218,6 +218,7 @@ _qed_eth_queue_to_cid(struct qed_hwfn *p_hwfn, ...@@ -218,6 +218,7 @@ _qed_eth_queue_to_cid(struct qed_hwfn *p_hwfn,
u16 opaque_fid, u16 opaque_fid,
u32 cid, u32 cid,
struct qed_queue_start_common_params *p_params, struct qed_queue_start_common_params *p_params,
bool b_is_rx,
struct qed_queue_cid_vf_params *p_vf_params) struct qed_queue_cid_vf_params *p_vf_params)
{ {
struct qed_queue_cid *p_cid; struct qed_queue_cid *p_cid;
...@@ -237,6 +238,7 @@ _qed_eth_queue_to_cid(struct qed_hwfn *p_hwfn, ...@@ -237,6 +238,7 @@ _qed_eth_queue_to_cid(struct qed_hwfn *p_hwfn,
p_cid->rel.queue_id = p_params->queue_id; p_cid->rel.queue_id = p_params->queue_id;
p_cid->rel.stats_id = p_params->stats_id; p_cid->rel.stats_id = p_params->stats_id;
p_cid->sb_igu_id = p_params->p_sb->igu_sb_id; p_cid->sb_igu_id = p_params->p_sb->igu_sb_id;
p_cid->b_is_rx = b_is_rx;
p_cid->sb_idx = p_params->sb_idx; p_cid->sb_idx = p_params->sb_idx;
/* Fill-in bits related to VFs' queues if information was provided */ /* Fill-in bits related to VFs' queues if information was provided */
...@@ -313,6 +315,7 @@ struct qed_queue_cid * ...@@ -313,6 +315,7 @@ struct qed_queue_cid *
qed_eth_queue_to_cid(struct qed_hwfn *p_hwfn, qed_eth_queue_to_cid(struct qed_hwfn *p_hwfn,
u16 opaque_fid, u16 opaque_fid,
struct qed_queue_start_common_params *p_params, struct qed_queue_start_common_params *p_params,
bool b_is_rx,
struct qed_queue_cid_vf_params *p_vf_params) struct qed_queue_cid_vf_params *p_vf_params)
{ {
struct qed_queue_cid *p_cid; struct qed_queue_cid *p_cid;
...@@ -334,7 +337,7 @@ qed_eth_queue_to_cid(struct qed_hwfn *p_hwfn, ...@@ -334,7 +337,7 @@ qed_eth_queue_to_cid(struct qed_hwfn *p_hwfn,
} }
p_cid = _qed_eth_queue_to_cid(p_hwfn, opaque_fid, cid, p_cid = _qed_eth_queue_to_cid(p_hwfn, opaque_fid, cid,
p_params, p_vf_params); p_params, b_is_rx, p_vf_params);
if (!p_cid && IS_PF(p_hwfn->cdev) && !b_legacy_vf) if (!p_cid && IS_PF(p_hwfn->cdev) && !b_legacy_vf)
qed_cxt_release_cid(p_hwfn, cid); qed_cxt_release_cid(p_hwfn, cid);
...@@ -344,9 +347,10 @@ qed_eth_queue_to_cid(struct qed_hwfn *p_hwfn, ...@@ -344,9 +347,10 @@ qed_eth_queue_to_cid(struct qed_hwfn *p_hwfn,
static struct qed_queue_cid * static struct qed_queue_cid *
qed_eth_queue_to_cid_pf(struct qed_hwfn *p_hwfn, qed_eth_queue_to_cid_pf(struct qed_hwfn *p_hwfn,
u16 opaque_fid, u16 opaque_fid,
bool b_is_rx,
struct qed_queue_start_common_params *p_params) struct qed_queue_start_common_params *p_params)
{ {
return qed_eth_queue_to_cid(p_hwfn, opaque_fid, p_params, return qed_eth_queue_to_cid(p_hwfn, opaque_fid, p_params, b_is_rx,
NULL); NULL);
} }
...@@ -929,7 +933,7 @@ qed_eth_rx_queue_start(struct qed_hwfn *p_hwfn, ...@@ -929,7 +933,7 @@ qed_eth_rx_queue_start(struct qed_hwfn *p_hwfn,
int rc; int rc;
/* Allocate a CID for the queue */ /* Allocate a CID for the queue */
p_cid = qed_eth_queue_to_cid_pf(p_hwfn, opaque_fid, p_params); p_cid = qed_eth_queue_to_cid_pf(p_hwfn, opaque_fid, true, p_params);
if (!p_cid) if (!p_cid)
return -ENOMEM; return -ENOMEM;
...@@ -1134,7 +1138,7 @@ qed_eth_tx_queue_start(struct qed_hwfn *p_hwfn, ...@@ -1134,7 +1138,7 @@ qed_eth_tx_queue_start(struct qed_hwfn *p_hwfn,
struct qed_queue_cid *p_cid; struct qed_queue_cid *p_cid;
int rc; int rc;
p_cid = qed_eth_queue_to_cid_pf(p_hwfn, opaque_fid, p_params); p_cid = qed_eth_queue_to_cid_pf(p_hwfn, opaque_fid, false, p_params);
if (!p_cid) if (!p_cid)
return -EINVAL; return -EINVAL;
......
...@@ -322,6 +322,8 @@ struct qed_queue_cid { ...@@ -322,6 +322,8 @@ struct qed_queue_cid {
u32 cid; u32 cid;
u16 opaque_fid; u16 opaque_fid;
bool b_is_rx;
/* VFs queues are mapped differently, so we need to know the /* VFs queues are mapped differently, so we need to know the
* relative queue associated with them [0-based]. * relative queue associated with them [0-based].
* Notice this is relevant on the *PF* queue-cid of its VF's queues, * Notice this is relevant on the *PF* queue-cid of its VF's queues,
...@@ -354,6 +356,7 @@ struct qed_queue_cid * ...@@ -354,6 +356,7 @@ struct qed_queue_cid *
qed_eth_queue_to_cid(struct qed_hwfn *p_hwfn, qed_eth_queue_to_cid(struct qed_hwfn *p_hwfn,
u16 opaque_fid, u16 opaque_fid,
struct qed_queue_start_common_params *p_params, struct qed_queue_start_common_params *p_params,
bool b_is_rx,
struct qed_queue_cid_vf_params *p_vf_params); struct qed_queue_cid_vf_params *p_vf_params);
int int
......
This diff is collapsed.
...@@ -152,12 +152,17 @@ struct qed_iov_vf_mbx { ...@@ -152,12 +152,17 @@ struct qed_iov_vf_mbx {
#define QED_IOV_LEGACY_QID_RX (0) #define QED_IOV_LEGACY_QID_RX (0)
#define QED_IOV_LEGACY_QID_TX (1) #define QED_IOV_LEGACY_QID_TX (1)
struct qed_vf_q_info { struct qed_vf_queue_cid {
bool b_is_tx;
struct qed_queue_cid *p_cid;
};
/* Describes a qzone associated with the VF */
struct qed_vf_queue {
u16 fw_rx_qid; u16 fw_rx_qid;
struct qed_queue_cid *p_rx_cid;
u16 fw_tx_qid; u16 fw_tx_qid;
struct qed_queue_cid *p_tx_cid;
u8 fw_cid; struct qed_vf_queue_cid cids[MAX_QUEUES_PER_QZONE];
}; };
enum vf_state { enum vf_state {
...@@ -215,7 +220,8 @@ struct qed_vf_info { ...@@ -215,7 +220,8 @@ struct qed_vf_info {
u8 num_mac_filters; u8 num_mac_filters;
u8 num_vlan_filters; u8 num_vlan_filters;
struct qed_vf_q_info vf_queues[QED_MAX_VF_CHAINS_PER_PF];
struct qed_vf_queue vf_queues[QED_MAX_VF_CHAINS_PER_PF];
u16 igu_sbs[QED_MAX_VF_CHAINS_PER_PF]; u16 igu_sbs[QED_MAX_VF_CHAINS_PER_PF];
u8 num_active_rxqs; u8 num_active_rxqs;
struct qed_public_vf_info p_vf_info; struct qed_public_vf_info p_vf_info;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment