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 A37F243AE1; Thu, 8 Feb 2024 18:54:24 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8E92F42E2F; Thu, 8 Feb 2024 18:54:24 +0100 (CET) Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) by mails.dpdk.org (Postfix) with ESMTP id EFC1142E29 for ; Thu, 8 Feb 2024 18:54:22 +0100 (CET) Received: by mail-pg1-f180.google.com with SMTP id 41be03b00d2f7-53fbf2c42bfso1494935a12.3 for ; Thu, 08 Feb 2024 09:54:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1707414862; x=1708019662; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=FyS9ZyAdXSQuM2XnzPG2ktKKvtGEvLli4/7bkTUU640=; b=k3TAIt+7GikSVJgQyMsD+CfMWosYhSkgx9kW6QZLLvoKkGmT+sCFk0dfIkIVWb406U urbOA+sDkDKFLPx8R1kTmQFKg30gT76tWxr2/RLuJnAR5Dmla9BLcoF3C9wt2qo3MFO6 XxlUW9jjuXry3XimgyXD85CrOJmg2QFyJCwuXfghJxLbzWo3N6M/KJXr/rnxZ8ZajZWm LWtas8l/VMqhXhKfRCX6pQVRoT/AxDlejqBkeCCGNhsTyvU0DkHhsgqQmMGh0RkWGysq mD+jABY5a3pO9m9ivdoenHfyo25Tt1y28omeDxJIKdRxbKLXjf+ZXNnBpX5ZQpCT4j4x I1BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707414862; x=1708019662; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FyS9ZyAdXSQuM2XnzPG2ktKKvtGEvLli4/7bkTUU640=; b=b4L/IhtP3JMIlRHCAL/Rol6Ek8R6x1N86AvFY/Q6icwLBbAl9lsMwCoJmarGrX/08B Q2eWlTaRTf/Kv/otytK1T+c7A/Z6SFH0pftzcEv/ry7JaazIUnC1kI4vldefWTPVlz+Q m9EDH5rVAy/o1dOSMpwKh7BIuoNQvHDtkNpkGKa4MtGbcdGiSIsGR6YLOjR1m8/sI54Y IAi9LOEYNLNKWZ3bg6TKclah/wWhOcxQQZl6ZuEUfbMlrhotllJggoAeqNftQEmMwP8q lb6c/yYBjF2pmAJ4W4FLYuAAKvQg9DkvlwsopKoiXRj26kPulXaGRSh2NH4t8wrfmso1 BM7g== X-Gm-Message-State: AOJu0YzbOMwjOE4vA3341ins3QQEZtzyy6iSqQuwTkq8yZH4llFw8ZZ8 ohDCmHdaJ0XEoRbx/9KpHgmUBJJokl+Y11Au6Vw8DupDGeR5kFKzZOrGUvuFvHE= X-Google-Smtp-Source: AGHT+IEPC7vnnfsAeGQGEBizsICa1g8e1NUm6bmbcpoQHRGPXvfs7wX0fuxVYswCNQhabqqi7WA+5A== X-Received: by 2002:a05:6a20:3d22:b0:19e:98f9:cb95 with SMTP id y34-20020a056a203d2200b0019e98f9cb95mr338497pzi.55.1707414862066; Thu, 08 Feb 2024 09:54:22 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWsY6UbHf9M2L0WorkcNFh1zEglC8rPQENxWJu9bX0rreBsuLD4XW7VPT5RoFeiUxT+JhCu4ruqYFOgsT8= Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id le16-20020a056a004fd000b006e04ed1e330sm9407pfb.57.2024.02.08.09.54.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 09:54:21 -0800 (PST) Date: Thu, 8 Feb 2024 09:54:19 -0800 From: Stephen Hemminger To: Alan Elder Cc: Long Li , "dev@dpdk.org" Subject: Re: [PATCH v2] net/netvsc: fix parsing of VLAN metadata Message-ID: <20240208095419.3b5579eb@hermes.local> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Thu, 8 Feb 2024 14:42:44 +0000 Alan Elder wrote: > + struct ndis_pkt_vlan_info *vlan = (struct ndis_pkt_vlan_info *)pi_data; > + vlan->value = 0; > + vlan->vlanid = (m->vlan_tci & HN_VLAN_VID_MASK); > + vlan->cfi = (!!(m->vlan_tci & HN_VLAN_CFI_MASK)); > + vlan->pri = ((m->vlan_tci & HN_VLAN_PRIO_MASK) >> HN_VLAN_PRIO_SHIFT); Lots of extra parenthesis here, please remove them. > +struct ndis_pkt_vlan_info { > + union { > + struct { > + uint32_t pri:3; /* User Priority */ > + uint32_t cfi:1; /* Canonical Format ID / DEI */ > + uint32_t vlanid:12; /* VLAN ID */ > + uint32_t reserved:16; > + }; > + uint32_t value; > + }; > +}; Order of union elements is byte order sensitive, granted Hyper-V/Azure doesn't do big-endian. Most of this driver came from FreeBSD. Did you look there to make sure naming is the same. I.e would be good to be able to have same code in both places as much as possible.