From nobody Tue Jun 29 21:19:16 2021 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 3D7FB11C8302 for ; Tue, 29 Jun 2021 21:19:30 +0000 (UTC) (envelope-from micchie.gml@gmail.com) Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GDy690tV0z4TM9 for ; Tue, 29 Jun 2021 21:19:29 +0000 (UTC) (envelope-from micchie.gml@gmail.com) Received: by mail-oi1-x22a.google.com with SMTP id a133so370527oib.13 for ; Tue, 29 Jun 2021 14:19:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=3nFGwxY12kTgAEb7ubX1p3VYwb5v5GCOtjh0xdPGPXk=; b=SzARAIlYtskQa6n3SMMdMOO4WhN1d8BNHQn86VlBoWKINkpoNaEFIfnELtrBr6m/Y3 wlWke+DkUdOwS5B897t6FyizmHsVZM46Vk6YTFDFql4scL+4iaJXPpIrpkeD7Ev61nAf qs0gCtPlspsYZ3P77Doa/9VBk+0X/wiuDhhhUgJniTPjGP39vv7Jpbr2DKt5/fHprNUJ XudJKbm2xlhlocEnXWSLVlZze8aqZAsgRJ5wf2zRqZRyJvDVwVfNvTgf1Jhg9GBLzzgQ gAnghulHriWhtS8wtZWphHlIxYpcGAZrDmzLhRROFJdHBSW3AhWuTxO+YePX75+dhpDw bAng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=3nFGwxY12kTgAEb7ubX1p3VYwb5v5GCOtjh0xdPGPXk=; b=WNGxrxmGV/xD/aj60tRJCceADF5PtaapXtpW6pLPlvPuIxfZyR9qIUAg04AVHB6rpS XR/W2n/VUrS3HnN6hAWzxFnpNJYmO8irO5cLX8WmbE/5HHSV4FIwBtk+wB4yLgfKvqtr dVqdei10ZC1thLVRxJTYglpbK+uHiK/TefCT6c0+NdeNPvhiW4Gg+okgqgEvMqyT79L3 7OCBKxb0Thj+jPGGEy52/DWG5zg3a76H1/HqNlZWDPwXvl0XuGICAxhJ3pDTFtzfSyY5 0e1cpkdo68hLIm6DhXy/Zf6nQydwzy5vbI4mCLiKVxzTaD3ORfAVGa2X7kA+vK6a8+ig UiwQ== X-Gm-Message-State: AOAM532W3sl4OJVhqoUgcoV6LZ9DECF3dgjqwb8Cq4K2FpF7HWqHOZMC qJ0R1MiE0SGBLL8IqBVcckZx3IeieXu/DuQEIupyEFd/ah4XeQ== X-Google-Smtp-Source: ABdhPJwO7b6ZBvOHOAOAGMzsj8B2R6/9AkCEJgrL7Lf8/04gDd8s3DAyF0Yiz6GzsIeaJ2IpnVLzqlbnNw4QZYeKads= X-Received: by 2002:aca:d481:: with SMTP id l123mr12457125oig.73.1625001567438; Tue, 29 Jun 2021 14:19:27 -0700 (PDT) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 From: Michio Honda Date: Tue, 29 Jun 2021 22:19:16 +0100 Message-ID: Subject: Incorrect credits in iflib_tx_credits_update() in sys/net/iflib.c To: freebsd-hackers@freebsd.org Content-Type: multipart/alternative; boundary="0000000000002fcb0205c5ee2962" X-Rspamd-Queue-Id: 4GDy690tV0z4TM9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=SzARAIlY; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of micchiegml@gmail.com designates 2607:f8b0:4864:20::22a as permitted sender) smtp.mailfrom=micchiegml@gmail.com X-Spamd-Result: default: False [-2.95 / 15.00]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_NONE(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::22a:from]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::22a:from:127.0.2.255]; NEURAL_SPAM_SHORT(0.05)[0.054]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::22a:from]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-hackers] X-ThisMailContainsUnwantedMimeParts: Y --0000000000002fcb0205c5ee2962 Content-Type: text/plain; charset="UTF-8" Hi, I noticed that that function assumes ctx->isc_txd_credits_update() returns at most twice of txq->ift_size (the number of ring buffers) - 1, but I noticed em_isc_txd_credits_update() can return a much larger value. As a result, too large txq->ift_cidx_processed is set and thus iflib_netmap_txsync sets incorrect nr_hwtail. I am not sure this should be fixed in the driver or iflib - could someone take a look at this? Cheers, - Michio --0000000000002fcb0205c5ee2962--