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 3FD8DA0544; Wed, 8 Jun 2022 18:23:10 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 21CEE4069C; Wed, 8 Jun 2022 18:23:10 +0200 (CEST) Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) by mails.dpdk.org (Postfix) with ESMTP id CE8E340687 for ; Wed, 8 Jun 2022 18:23:08 +0200 (CEST) Received: by mail-pg1-f179.google.com with SMTP id 129so19374520pgc.2 for ; Wed, 08 Jun 2022 09:23:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Fm+FrD0y8e7FLMrRVT/KH056dHQ+yZG0GaS6lsq8Awc=; b=5FehjDFSFvlUV+S2KnGykwXeO1E5uq8VUnvc+Ruy4EiYe2fM+/fmS0wxQbCP3ddW1z BNEC+A83j51Zx8sGCEMaFBvcGp2AcHmlnnwux3D6tV3TgYdVXB2Lo9afHoZo1u3SOjWe Fq3JvOjjaUrWvtJanwFMLtHok6440G+ZivUjyATEPxpZEckb9qU/Me3ITSJ8mVTnzWoq HDwnbGz+RcwHrNDY/hHnOClnSji9SXicSh3tTIRHeEYm7e5qLAUXnJtFdwjlSwbm/5mr 1N2ejM8WxuvNi2IqbRgBsuovEqGGSG3IFqNGQ//dAGj5n5G4k3Lf4pjDJG9Riyq/xmYg BUfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Fm+FrD0y8e7FLMrRVT/KH056dHQ+yZG0GaS6lsq8Awc=; b=hm0sjSElO7JDFjFHyE57h1dYR3VzgQQo2gm/INVvsq8+zmpaSTGetmBYPzJFa5MC2I L98x25YvBvvdKAWn51wRT7H926E9vLj6+UBbLReQ5uauO3SvAFgjPre1SNw+q9J2Fybk aLfBS9fQvzHB7BOYk1EGA8mzMDG6hNh1T9dr9Z2oAMVDTDwCVVcZbXBOt6xyVFoNlUQ/ C5TGudk7zXe9Cevx+IK3Qh1UMFapKnZFwwpwip9Lqm1nlHfgRFEA0vCD+EeJppcKvgxx cNYFHMaQ7i2HIcts35+4cEaVb7e3iGIsnZ0AE+29/Fq9fbQToNuRuU01TNCo4Ib5vF6g Hv/w== X-Gm-Message-State: AOAM530c3mWH0iWD5LDOKpbW0lIVgc1vVKHdoi3B6BUPH7MRusftoXJ7 iv0SbZELtfGHuiKe9eQ5mipavQ== X-Google-Smtp-Source: ABdhPJxr0AeuVGm2MGUcEB9pdKEPk/yiSz+08Hd5odaCA5rdMyPQKoKa3iBU4w+Mxn1LJP+Tzg+Unw== X-Received: by 2002:a65:668b:0:b0:3f6:4026:97cd with SMTP id b11-20020a65668b000000b003f6402697cdmr30501177pgw.420.1654705387821; Wed, 08 Jun 2022 09:23:07 -0700 (PDT) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id q8-20020a170902eb8800b00167804a044fsm6229826plg.56.2022.06.08.09.23.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 09:23:07 -0700 (PDT) Date: Wed, 8 Jun 2022 09:23:04 -0700 From: Stephen Hemminger To: Ido Goshen Cc: ferruh.yigit@xilinx.com, dev@dpdk.org Subject: Re: [PATCH v6] pcap: support MTU set for linux interafces Message-ID: <20220608092304.08c093e2@hermes.local> In-Reply-To: <20220608160419.94063-1-ido@cgstowernetworks.com> References: <20220607062728.9439-1-ido@cgstowernetworks.com> <20220608160419.94063-1-ido@cgstowernetworks.com> 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 Wed, 8 Jun 2022 19:04:19 +0300 Ido Goshen wrote: > +int > +osdep_iface_mtu_set(const char *if_name, uint16_t mtu) > +{ > + struct ifreq ifr; > + int if_fd = socket(AF_INET, SOCK_DGRAM, 0); > + > + if (if_fd == -1) > + return -1; > + > + rte_strscpy(ifr.ifr_name, if_name, sizeof(ifr.ifr_name)); > + ifr.ifr_mtu = mtu; > + if (ioctl(if_fd, SIOCSIFMTU, &ifr)) { > + PMD_LOG(ERR, "%s mtu set to %d failed\n", if_name, mtu); > + close(if_fd); > + return -1; > + } > + > + close(if_fd); > + return 0; > +} This should work on FreeBSD as well. FreeBSD has the same ioctl()