New upstream version 18.08
[deb_dpdk.git] / drivers / net / qede / base / ecore_vf.c
index e0f2dd5..d2213f7 100644 (file)
@@ -1,9 +1,7 @@
-/*
- * Copyright (c) 2016 QLogic Corporation.
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2016 - 2018 Cavium Inc.
  * All rights reserved.
- * www.qlogic.com
- *
- * See LICENSE.qede_pmd for copyright and licensing details.
+ * www.cavium.com
  */
 
 #include "bcm_osal.h"
@@ -1275,8 +1273,7 @@ ecore_vf_pf_vport_update(struct ecore_hwfn *p_hwfn,
                resp_size += sizeof(struct pfvf_def_resp_tlv);
 
                OSAL_MEMCPY(p_mcast_tlv->bins, p_params->bins,
-                           sizeof(unsigned long) *
-                           ETH_MULTICAST_MAC_BINS_IN_REGS);
+                           sizeof(u32) * ETH_MULTICAST_MAC_BINS_IN_REGS);
        }
 
        update_rx = p_params->accept_flags.update_rx_mode_config;
@@ -1473,7 +1470,7 @@ void ecore_vf_pf_filter_mcast(struct ecore_hwfn *p_hwfn,
                        u32 bit;
 
                        bit = ecore_mcast_bin_from_mac(p_filter_cmd->mac[i]);
-                       OSAL_SET_BIT(bit, sp_params.bins);
+                       sp_params.bins[bit / 32] |= 1 << (bit % 32);
                }
        }
 
@@ -1629,6 +1626,39 @@ exit:
        return rc;
 }
 
+enum _ecore_status_t
+ecore_vf_pf_update_mtu(struct ecore_hwfn *p_hwfn, u16 mtu)
+{
+       struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;
+       struct vfpf_update_mtu_tlv *p_req;
+       struct pfvf_def_resp_tlv *p_resp;
+       enum _ecore_status_t rc;
+
+       if (!mtu)
+               return ECORE_INVAL;
+
+       /* clear mailbox and prep header tlv */
+       p_req = ecore_vf_pf_prep(p_hwfn, CHANNEL_TLV_UPDATE_MTU,
+                                sizeof(*p_req));
+       p_req->mtu = mtu;
+       DP_VERBOSE(p_hwfn, ECORE_MSG_IOV,
+                  "Requesting MTU update to %d\n", mtu);
+
+       /* add list termination tlv */
+       ecore_add_tlv(&p_iov->offset,
+                     CHANNEL_TLV_LIST_END,
+                     sizeof(struct channel_list_end_tlv));
+
+       p_resp = &p_iov->pf2vf_reply->default_resp;
+       rc = ecore_send_msg2pf(p_hwfn, &p_resp->hdr.status, sizeof(*p_resp));
+       if (p_resp->hdr.status == PFVF_STATUS_NOT_SUPPORTED)
+               rc = ECORE_INVAL;
+
+       ecore_vf_pf_req_end(p_hwfn, rc);
+
+       return rc;
+}
+
 u16 ecore_vf_get_igu_sb_id(struct ecore_hwfn *p_hwfn,
                           u16               sb_id)
 {