net: Add extack argument to ndo_fdb_add()
[linux-2.6-block.git] / drivers / net / ethernet / intel / ice / ice_main.c
index e36db981f047faa78c5d2833a3a1f76901ec80ad..48f033928aa207d715ce7f56fd10a8bca24201b1 100644 (file)
@@ -1389,7 +1389,6 @@ static int ice_req_irq_msix_misc(struct ice_pf *pf)
 {
        struct ice_hw *hw = &pf->hw;
        int oicr_idx, err = 0;
-       u8 itr_gran;
        u32 val;
 
        if (!pf->int_name[0])
@@ -1453,10 +1452,8 @@ skip_req_irq:
               PFINT_MBX_CTL_CAUSE_ENA_M);
        wr32(hw, PFINT_MBX_CTL, val);
 
-       itr_gran = hw->itr_gran;
-
        wr32(hw, GLINT_ITR(ICE_RX_ITR, pf->hw_oicr_idx),
-            ITR_TO_REG(ICE_ITR_8K, itr_gran));
+            ITR_REG_ALIGN(ICE_ITR_8K) >> ICE_ITR_GRAN_S);
 
        ice_flush(hw);
        ice_irq_dynamic_ena(hw, NULL, NULL);
@@ -1531,6 +1528,7 @@ static int ice_cfg_netdev(struct ice_vsi *vsi)
 
        csumo_features = NETIF_F_RXCSUM   |
                         NETIF_F_IP_CSUM  |
+                        NETIF_F_SCTP_CRC |
                         NETIF_F_IPV6_CSUM;
 
        vlano_features = NETIF_F_HW_VLAN_CTAG_FILTER |
@@ -1997,6 +1995,23 @@ static int ice_init_interrupt_scheme(struct ice_pf *pf)
        return 0;
 }
 
+/**
+ * ice_verify_itr_gran - verify driver's assumption of ITR granularity
+ * @pf: pointer to the PF structure
+ *
+ * There is no error returned here because the driver will be able to handle a
+ * different ITR granularity, but interrupt moderation will not be accurate if
+ * the driver's assumptions are not verified. This assumption is made so we can
+ * use constants in the hot path instead of accessing structure members.
+ */
+static void ice_verify_itr_gran(struct ice_pf *pf)
+{
+       if (pf->hw.itr_gran != (ICE_ITR_GRAN_S << 1))
+               dev_warn(&pf->pdev->dev,
+                        "%d ITR granularity assumption is invalid, actual ITR granularity is %d. Interrupt moderation will be inaccurate!\n",
+                        (ICE_ITR_GRAN_S << 1), pf->hw.itr_gran);
+}
+
 /**
  * ice_verify_cacheline_size - verify driver's assumption of 64 Byte cache lines
  * @pf: pointer to the PF structure
@@ -2163,6 +2178,7 @@ static int ice_probe(struct pci_dev *pdev,
        mod_timer(&pf->serv_tmr, round_jiffies(jiffies + pf->serv_tmr_period));
 
        ice_verify_cacheline_size(pf);
+       ice_verify_itr_gran(pf);
 
        return 0;
 
@@ -2422,7 +2438,8 @@ static void ice_set_rx_mode(struct net_device *netdev)
  */
 static int ice_fdb_add(struct ndmsg *ndm, struct nlattr __always_unused *tb[],
                       struct net_device *dev, const unsigned char *addr,
-                      u16 vid, u16 flags)
+                      u16 vid, u16 flags,
+                      struct netlink_ext_ack *extack)
 {
        int err;
 
@@ -2546,7 +2563,8 @@ static int ice_vsi_cfg(struct ice_vsi *vsi)
                if (err)
                        return err;
        }
-       err = ice_vsi_cfg_txqs(vsi);
+
+       err = ice_vsi_cfg_lan_txqs(vsi);
        if (!err)
                err = ice_vsi_cfg_rxqs(vsi);
 
@@ -3040,7 +3058,8 @@ int ice_down(struct ice_vsi *vsi)
        }
 
        ice_vsi_dis_irq(vsi);
-       tx_err = ice_vsi_stop_tx_rings(vsi, ICE_NO_RESET, 0);
+
+       tx_err = ice_vsi_stop_lan_tx_rings(vsi, ICE_NO_RESET, 0);
        if (tx_err)
                netdev_err(vsi->netdev,
                           "Failed stop Tx rings, VSI %d error %d\n",