BNX2X: spatch ether->mtu -> ether->maxmtu
[akaros.git] / kern / drivers / net / bnx2x / bnx2x_vfpf.c
index ae3b1f4..84e4dd8 100644 (file)
@@ -298,22 +298,22 @@ int bnx2x_vfpf_acquire(struct bnx2x *bp, uint8_t tx_count, uint8_t rx_count)
 
                        /* humble our request */
                        req->resc_request.num_txqs =
-                               min(req->resc_request.num_txqs,
+                               MIN(req->resc_request.num_txqs,
                                    bp->acquire_resp.resc.num_txqs);
                        req->resc_request.num_rxqs =
-                               min(req->resc_request.num_rxqs,
+                               MIN(req->resc_request.num_rxqs,
                                    bp->acquire_resp.resc.num_rxqs);
                        req->resc_request.num_sbs =
-                               min(req->resc_request.num_sbs,
+                               MIN(req->resc_request.num_sbs,
                                    bp->acquire_resp.resc.num_sbs);
                        req->resc_request.num_mac_filters =
-                               min(req->resc_request.num_mac_filters,
+                               MIN(req->resc_request.num_mac_filters,
                                    bp->acquire_resp.resc.num_mac_filters);
                        req->resc_request.num_vlan_filters =
-                               min(req->resc_request.num_vlan_filters,
+                               MIN(req->resc_request.num_vlan_filters,
                                    bp->acquire_resp.resc.num_vlan_filters);
                        req->resc_request.num_mc_filters =
-                               min(req->resc_request.num_mc_filters,
+                               MIN(req->resc_request.num_mc_filters,
                                    bp->acquire_resp.resc.num_mc_filters);
 
                        /* Clear response buffer */
@@ -624,11 +624,11 @@ int bnx2x_vfpf_setup_q(struct bnx2x *bp, struct bnx2x_fastpath *fp,
        req->rxq.vf_sb = fp_idx;
        req->rxq.sb_index = HC_INDEX_ETH_RX_CQ_CONS;
        req->rxq.hc_rate = bp->rx_ticks ? 1000000/bp->rx_ticks : 0;
-       req->rxq.mtu = bp->dev->mtu;
+       req->rxq.mtu = bp->dev->maxmtu;
        req->rxq.buf_sz = fp->rx_buf_size;
        req->rxq.sge_buf_sz = BCM_PAGE_SIZE * PAGES_PER_SGE;
        req->rxq.tpa_agg_sz = tpa_agg_size;
-       req->rxq.max_sge_pkt = SGE_PAGE_ALIGN(bp->dev->mtu) >> SGE_PAGE_SHIFT;
+       req->rxq.max_sge_pkt = SGE_PAGE_ALIGN(bp->dev->maxmtu) >> SGE_PAGE_SHIFT;
        req->rxq.max_sge_pkt = ((req->rxq.max_sge_pkt + PAGES_PER_SGE - 1) &
                          (~(PAGES_PER_SGE-1))) >> PAGES_PER_SGE_SHIFT;
        req->rxq.flags = flags;
@@ -1350,7 +1350,7 @@ static void bnx2x_vf_mbx_acquire(struct bnx2x *bp, struct bnx2x_virtf *vf,
        if (bnx2x_vf_mbx_is_windows_vm(bp, &mbx->msg->req.acquire))
                vf->fp_hsi = acquire->vfdev_info.fp_hsi_ver;
        else
-               vf->fp_hsi = max_t(uint8_t, acquire->vfdev_info.fp_hsi_ver,
+               vf->fp_hsi = MAX_T(uint8_t, acquire->vfdev_info.fp_hsi_ver,
                                   ETH_FP_HSI_VER_2);
        if (vf->fp_hsi > ETH_FP_HSI_VERSION) {
                DP(BNX2X_MSG_IOV,
@@ -1573,7 +1573,7 @@ static int bnx2x_vf_mbx_macvlan_list(struct bnx2x *bp,
              sizeof(struct bnx2x_vf_mac_vlan_filter) +
              sizeof(struct bnx2x_vf_mac_vlan_filters);
 
-       fl = kzalloc(fsz, GFP_KERNEL);
+       fl = kzmalloc(fsz, KMALLOC_WAIT);
        if (!fl)
                return -ENOMEM;