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 B75B9A034F; Thu, 25 Feb 2021 21:31:32 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 683501608D6; Thu, 25 Feb 2021 21:31:31 +0100 (CET) Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by mails.dpdk.org (Postfix) with ESMTP id B3C0716089A for ; Thu, 25 Feb 2021 21:31:29 +0100 (CET) Received: by mail-wm1-f50.google.com with SMTP id u187so3792940wmg.4 for ; Thu, 25 Feb 2021 12:31:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mayadata-io.20150623.gappssmtp.com; s=20150623; h=from:subject:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=PlsXCVfXEDp3FjhSWv5yJICk6e6UvpDzfdGaSu6qvsk=; b=cZkDM4reUiFm9Pi0i5nptu6DJc+ai/V4up/7cfqVDX054VJZspcNmeA9t6xthLDL5/ sQWhpp0fsLhiGBtzCk9nkW/HBqN9gfalKRepStqiLS8Gb5NHpq2CInmJQXAWm3SzomSn wVDBgPu/30WphBuXmyut7+MPg2YHana1tXpit5iLzjubYR+t8c3Tb5kHCApSd6Ty42sa xMD6TU982u578tBPi7yjiCgwb69wE67IjCUgKSwb4C8OxSJjBfVgYjDMOj+umoRPA8s/ 7DyblTWBKDKuYrU16wvQzq2Pb/7vGnfy0C62nNFK6iE3Cez8ZVwQHL+QVQAw59GlpuP/ MCoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=PlsXCVfXEDp3FjhSWv5yJICk6e6UvpDzfdGaSu6qvsk=; b=OSIfBYs4YXf+9gitLWA++5zFZ2wu96oAlM18wOILB5090kEoK4TiLAK52vuCviMyTm Ji/DBOR8QghEuPUwZUKX/j1K+tst0eK2464XSuxefHQJt/d4lqwru0pj2ITPXujcEgft q6gaRE+gan3cnARMTRDsyhr8Mk7cDrua2VDDi/Qs6ghYcWvCHnJYQLIMsjM/vNfp9csg syDDYNVyYIwgCINpvPxVzMKa3aU3NVIE0vLQfk7GOxZA1caDjh4DqPlTYHQvckei6hHo SdqhCu/nly5EDyEj/RoP8vIvuW2iGqnMaLpm0cQeRMBWV2WusLLu5tiUhEWrlcLqeI0w 0b6g== X-Gm-Message-State: AOAM5309I/BLir4S8t68WiaQKfjYDHC9RiFfFE+wkMmVwGh8Ykiqu9mR P7xwG1872C06diC+y++Iw5T00w== X-Google-Smtp-Source: ABdhPJyQz5nPH7s3eKq3F8aahh7qIaltzx7Z5u9yvmtyK6BA1WMj79NUkxSN/z+7og64lf8+pV571w== X-Received: by 2002:a7b:c1d6:: with SMTP id a22mr165890wmj.8.1614285089374; Thu, 25 Feb 2021 12:31:29 -0800 (PST) Received: from [192.168.0.33] (cpc98320-croy25-2-0-cust77.19-2.cable.virginm.net. [80.235.134.78]) by smtp.gmail.com with ESMTPSA id z13sm8756464wmi.45.2021.02.25.12.31.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 25 Feb 2021 12:31:28 -0800 (PST) From: Nick Connolly X-Google-Original-From: Nick Connolly To: Dmitry Kozlyuk , Ferruh Yigit Cc: dev@dpdk.org, Tyler Retzlaff , Mike Wells , Narcisa Ana Maria Vasile , Dmitry Malloy , Pallavi Kadam , Jie Zhou References: <20210214012013.23165-1-dmitry.kozliuk@gmail.com> <20210214021616.26970-1-dmitry.kozliuk@gmail.com> <20210214021616.26970-5-dmitry.kozliuk@gmail.com> <6c5e9d34-abfa-d808-eef0-165315baf3ce@intel.com> <20210225220440.2bda87c3@sovereign> Message-ID: Date: Thu, 25 Feb 2021 20:31:27 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210225220440.2bda87c3@sovereign> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB Subject: Re: [dpdk-dev] [PATCH v2 4/6] net/pcap: add libpcap wrappers 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" > Your comment made me revise Windows EAL networking shims. Surprisingly, if > changed to expose Windows networking headers (specifically, ) with > some additions (but no hacks), they create no issues to any existing code. > > The only workaround remaining is `#undef s_addr` in . > > So maybe this commit can be dropped, if Windows EAL networking headers be > reworked in the following way: > > #if defined min > #define USER_EXPLICITLY_WANTS_WINDOWS_H > #endif > > #include > > /* hide definitions that break portable code, > * e.g. it had to be done once already for i40e > */ > #ifndef USER_EXPLICITLY_WANTS_WINDOWS_H > #undef min, max, ... > #endif > > #define what's missing from Windows headers, e.g. IPPROTO_SCTP > > + Windows maintainers, Nick Connolly, and Jie Zhou to discuss. In my opinion, there are long term maintenance issues either way round. Wrapping the system headers hides the details and keeps the code 'clean', but has to work with multiple compiler environments and versions of the headers - not always straightforward.  Wrapping libpcap involves code changes that need to be maintained. For SPDK, changing the code wasn't really an option, so I had to go with wrapping the headers. It's worked out ok so far. To make it a bit cleaner I turned off as much as possible from Windows.h with #define NO*. Supporting both clang and MinGW caused a few issues (e.g. MinGW has mswsock.h), but they are solvable. ./inc/sys/socket.h and ./inc/wpdk/windows.h in https://github.com/wpdp/wpdk show an example of what might need wrapping in the general case. Regards, Nick