From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1A7A2A0A0F; Mon, 5 Jul 2021 09:08:39 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C826240141; Mon, 5 Jul 2021 09:08:38 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id DBD024003C for ; Mon, 5 Jul 2021 09:08:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625468916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=KXi81SH0nDkv9OmCLfQtdZnpzKXc6gTisvyG2q1xaPo=; b=Ax4sjreBVl9FPqFxMK4U7cPzLSwxxdHoa9VDuhW072mjNzzTWd8N6HtcPx7ZbXPWJKuY2L pDvyUAj/dkEmaKcLRRKx+QlzrWJNDwVoJ8cr6GQi0rG96fq6VcpEnn3+VzZyBNxDvBuGRA PiFH5mX9njuTb9y0do450YPaVR7G0XA= Received: from mail-ua1-f70.google.com (mail-ua1-f70.google.com [209.85.222.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-2-L6bE1psdOqaRmp9072ePog-1; Mon, 05 Jul 2021 03:08:33 -0400 X-MC-Unique: L6bE1psdOqaRmp9072ePog-1 Received: by mail-ua1-f70.google.com with SMTP id w11-20020ab035eb0000b029029467c865a1so5907127uau.14 for ; Mon, 05 Jul 2021 00:08:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KXi81SH0nDkv9OmCLfQtdZnpzKXc6gTisvyG2q1xaPo=; b=Aemzu3THj/xCjidij9g8a7e75HAlrUkKh9VKweWWLa2NrIF8MmTFHt8axtiazC2k27 Di9JOLuJe8pGQzwSPUme2NrnZvY7YMcUqF4tirGWBHsMy03/xkhGm5N8+ebGy3lPaHTR TWh0UA1UCFV8BoZcDEK86Xr4NZsb5u/rJErWbWd+h8OXgpgoRWF5KsuMygGar94wLL63 NB/j/DCBFBhihMHf4Oe/C5THsXdE7ekyBOMY26aCFleVzOdLMHkPaOdqEyPX20yCJrjg i6mJ0It0aheclEx03hO37BA2ErHhFAt6eTnc60zukOAk0W8HPgx92VYgDsYwfYJDvwDb bn5w== X-Gm-Message-State: AOAM532wm16yOLAMPbKmH6tbO7Q0112F0jCg2PHx7f9SWR8hhD32HXFj LTY8xEq2ZYFut2oi+27fX2LUEvKoJlIauKr+H8lsvyaLkTMHIcl7ccb8TAZ4WEBT6w68fAUF9ja ivr3bUB8Xcy3+DBnIPNM= X-Received: by 2002:a67:df85:: with SMTP id x5mr8135209vsk.17.1625468912747; Mon, 05 Jul 2021 00:08:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTkzEb1cohnpU6cNzbJ8S/TyrZvILEP/D/3aS21hOV+a9wHBKXKami2waYHIdwSqriYNwknGTqO5d1+8egYz8= X-Received: by 2002:a67:df85:: with SMTP id x5mr8135200vsk.17.1625468912604; Mon, 05 Jul 2021 00:08:32 -0700 (PDT) MIME-Version: 1.0 References: <20210602095836.24901-1-david.marchand@redhat.com> <20210629080632.30964-1-david.marchand@redhat.com> <20210629080632.30964-2-david.marchand@redhat.com> In-Reply-To: From: David Marchand Date: Mon, 5 Jul 2021 09:08:21 +0200 Message-ID: To: "Wang, Haiyue" Cc: "dev@dpdk.org" , "Yang, Qiming" , "Zhang, Qi Z" Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v3 1/2] net/ice: factorize firmware loading X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, Jul 5, 2021 at 3:43 AM Wang, Haiyue wrote: > > Hi David, > > > -----Original Message----- > > From: dev On Behalf Of David Marchand > > Sent: Tuesday, June 29, 2021 16:07 > > To: dev@dpdk.org > > Cc: Yang, Qiming ; Zhang, Qi Z > > Subject: [dpdk-dev] [PATCH v3 1/2] net/ice: factorize firmware loading > > > > Both "normal" and "dcf" inits have their copy of some firmware loading > > code. > > > > The DSN query is moved in specific parts for the "normal" and "dcf" init. > > > > A common helper ice_load_pkg is then introduced and takes an adapter > > pointer as its main input. > > > > This helper takes care of finding the right firmware file and loading > > it. > > The adapter active_pkg_type field is set by this helper. > > > > The ice_access macro is removed from the osdep.h header: osdep.h should > > only hosts wrappers for base driver code. > > > > Signed-off-by: David Marchand > > --- > > drivers/net/ice/base/ice_osdep.h | 6 -- > > drivers/net/ice/ice_dcf_parent.c | 97 ++----------------- > > drivers/net/ice/ice_ethdev.c | 161 +++++++++++++++---------------- > > drivers/net/ice/ice_ethdev.h | 3 +- > > 4 files changed, 88 insertions(+), 179 deletions(-) > > > > > > + if (!use_dsn) > > + goto no_dsn; > > + > > + memset(opt_ddp_filename, 0, ICE_MAX_PKG_FILENAME_SIZE); > > + snprintf(opt_ddp_filename, ICE_MAX_PKG_FILENAME_SIZE, > > + "ice-%016" PRIx64 ".pkg", dsn); > > + strncpy(pkg_file, ICE_PKG_FILE_SEARCH_PATH_UPDATES, > > + ICE_MAX_PKG_FILENAME_SIZE); > > + if (!ice_access(strcat(pkg_file, opt_ddp_filename), 0)) > > + goto load_fw; > > + > > + strncpy(pkg_file, ICE_PKG_FILE_SEARCH_PATH_DEFAULT, > > + ICE_MAX_PKG_FILENAME_SIZE); > > + if (!ice_access(strcat(pkg_file, opt_ddp_filename), 0)) > > + goto load_fw; > > + > > +no_dsn: > > + strncpy(pkg_file, ICE_PKG_FILE_UPDATES, ICE_MAX_PKG_FILENAME_SIZE); > > + if (!ice_access(pkg_file, 0)) > > + goto load_fw; > > + strncpy(pkg_file, ICE_PKG_FILE_DEFAULT, ICE_MAX_PKG_FILENAME_SIZE); > > + if (ice_access(pkg_file, 0)) { > > PMD_INIT_LOG(ERR, "failed to search file path\n"); > > - return err; > > + return -1; > > } > > > > +load_fw: > > file = fopen(pkg_file, "rb"); > > if (!file) { > > PMD_INIT_LOG(ERR, "failed to open file: %s\n", pkg_file); > > return -1; > > } > > > > I'm wondering what's full name for ice firmware in F34, has any *.xz > postfix ? If so, the search method will also needs to be updated, since > we will check each file can be accessed: > > #define ICE_PKG_FILE_DEFAULT "/lib/firmware/intel/ice/ddp/ice.pkg" > #define ICE_PKG_FILE_UPDATES "/lib/firmware/updates/intel/ice/ddp/ice.pkg" This first patch is a preparation to have a single helper to select/open the firmware. I don't get what you mean. Is there a change in behavior with this patch? -- David Marchand