]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
qed: Correct VF mac number
authorMintz, Yuval <Yuval.Mintz@cavium.com>
Mon, 31 Oct 2016 20:26:54 +0000 (22:26 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 1 Nov 2016 15:00:24 +0000 (11:00 -0400)
When relaxing the limitation on the number of unicast MAC filters
an interface can configure, qed started passing the MAC quota to
qede. However, the value is initialized only for PFs, causing VFs
to always try and configure themselves as promiscuous
[as they believe they lack the resources to configure the rx-mode].

Fixes: 7b7e70f979e3 ("qed*: Allow unicast filtering")
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qed/qed_l2.c
drivers/net/ethernet/qlogic/qed/qed_vf.c
drivers/net/ethernet/qlogic/qed/qed_vf.h

index 1e3a16edd16d51754e314c5c5a104417c1740e76..900b253be31762be75af15f81373b4fa2c219991 100644 (file)
@@ -1692,6 +1692,8 @@ static int qed_fill_eth_dev_info(struct qed_dev *cdev,
 
                qed_vf_get_num_vlan_filters(&cdev->hwfns[0],
                                            (u8 *)&info->num_vlan_filters);
+               qed_vf_get_num_mac_filters(&cdev->hwfns[0],
+                                          (u8 *)&info->num_mac_filters);
                qed_vf_get_port_mac(&cdev->hwfns[0], info->port_mac);
 
                info->is_legacy = !!cdev->hwfns[0].vf_iov_info->b_pre_fp_hsi;
index f580bf4c97f0950b53c1b960f2a4cb3223723e79..3c0633642f4c468b4c3350314bfdb4dcd97bbae9 100644 (file)
@@ -1171,6 +1171,13 @@ void qed_vf_get_num_vlan_filters(struct qed_hwfn *p_hwfn, u8 *num_vlan_filters)
        *num_vlan_filters = p_vf->acquire_resp.resc.num_vlan_filters;
 }
 
+void qed_vf_get_num_mac_filters(struct qed_hwfn *p_hwfn, u8 *num_mac_filters)
+{
+       struct qed_vf_iov *p_vf = p_hwfn->vf_iov_info;
+
+       *num_mac_filters = p_vf->acquire_resp.resc.num_mac_filters;
+}
+
 bool qed_vf_check_mac(struct qed_hwfn *p_hwfn, u8 *mac)
 {
        struct qed_bulletin_content *bulletin;
index 944745b7c4c0f107d8aea0c618421af1668a2728..325c250d4ee5daf32cf4cbf063d15cfdcaac9fc2 100644 (file)
@@ -622,6 +622,14 @@ void qed_vf_get_port_mac(struct qed_hwfn *p_hwfn, u8 *port_mac);
 void qed_vf_get_num_vlan_filters(struct qed_hwfn *p_hwfn,
                                 u8 *num_vlan_filters);
 
+/**
+ * @brief Get number of MAC filters allocated for VF by qed
+ *
+ *  @param p_hwfn
+ *  @param num_rxqs - allocated MAC filters
+ */
+void qed_vf_get_num_mac_filters(struct qed_hwfn *p_hwfn, u8 *num_mac_filters);
+
 /**
  * @brief Check if VF can set a MAC address
  *
@@ -872,6 +880,11 @@ static inline void qed_vf_get_num_vlan_filters(struct qed_hwfn *p_hwfn,
 {
 }
 
+static inline void qed_vf_get_num_mac_filters(struct qed_hwfn *p_hwfn,
+                                             u8 *num_mac_filters)
+{
+}
+
 static inline bool qed_vf_check_mac(struct qed_hwfn *p_hwfn, u8 *mac)
 {
        return false;