Author: arybchik
Date: Thu Jan 14 15:26:58 2016
New Revision: 293962
URL: https://svnweb.freebsd.org/changeset/base/293962

Log:
  MFC r292050
  
  sfxge: [5/6] rework event completion error handling
  
  Required for MCDI proxy authorization support.
  
  Submitted by:   Andy Moreton <amoreton at solarflare.com>
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/10/sys/dev/sfxge/common/efx_mcdi.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_mcdi.c
==============================================================================
--- stable/10/sys/dev/sfxge/common/efx_mcdi.c   Thu Jan 14 15:26:06 2016        
(r293961)
+++ stable/10/sys/dev/sfxge/common/efx_mcdi.c   Thu Jan 14 15:26:58 2016        
(r293962)
@@ -540,6 +540,7 @@ efx_mcdi_ev_cpl(
        efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
        const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp;
        efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
+       efx_nic_cfg_t *encp = &enp->en_nic_cfg;
        efx_mcdi_req_t *emrp;
        int state;
 
@@ -564,20 +565,21 @@ efx_mcdi_ev_cpl(
        emip->emi_pending_req = NULL;
        EFSYS_UNLOCK(enp->en_eslp, state);
 
-       /*
-        * Fill out the remaining hdr fields, and copyout the payload
-        * if the user supplied an output buffer.
-        */
-       if (errcode != 0) {
-               if (!emrp->emr_quiet) {
-                       EFSYS_PROBE2(mcdi_err, int, emrp->emr_cmd,
-                           int, errcode);
-               }
-               emrp->emr_out_length_used = 0;
-               emrp->emr_rc = efx_mcdi_request_errcode(errcode);
+       if (encp->enc_mcdi_max_payload_length > MCDI_CTL_SDU_LEN_MAX_V1) {
+               /* MCDIv2 response details do not fit into an event. */
+               efx_mcdi_read_response_header(enp, emrp);
        } else {
-               emrp->emr_out_length_used = outlen;
-               emrp->emr_rc = 0;
+               if (errcode != 0) {
+                       if (!emrp->emr_quiet) {
+                               EFSYS_PROBE2(mcdi_err, int, emrp->emr_cmd,
+                                   int, errcode);
+                       }
+                       emrp->emr_out_length_used = 0;
+                       emrp->emr_rc = efx_mcdi_request_errcode(errcode);
+               } else {
+                       emrp->emr_out_length_used = outlen;
+                       emrp->emr_rc = 0;
+               }
        }
        emcop->emco_request_copyout(enp, emrp);
 
_______________________________________________
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"

Reply via email to