From: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Bodong Wang <wbd2905-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
bodong-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org,
moshel-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org
Subject: Re: [PATCH 1/3] IB/core: Add support of checksum capability reporting in ib verbs
Date: Thu, 17 Sep 2015 22:39:39 -0400 [thread overview]
Message-ID: <55FB796B.2080506@redhat.com> (raw)
In-Reply-To: <490a38ab04a96f24500d647392e931c38853ba45.1442413048.git.bodong-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 2547 bytes --]
On 09/16/2015 11:56 AM, Bodong Wang wrote:
> A new filed csum_cap is added to both ib_query_device. It contains two members:
> eth_csum_cap and ib_csum_cap, indicates checksum capability of Ethernet and
> Infiniband link layer respectively for different QP types.
>
> Current checksum caps use the following enum members:
> - IB_CSUM_SUPPORT_UD: device supports validation/calculation of csum for UD QP.
> - IB_CSUM_SUPPORT_RAW: device supports validation/calculation of csum for raw QP.
>
> Signed-off-by: Bodong Wang <bodong-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
> include/rdma/ib_verbs.h | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
> index b0f898e..94dbaee 100644
> --- a/include/rdma/ib_verbs.h
> +++ b/include/rdma/ib_verbs.h
> @@ -183,6 +183,11 @@ struct ib_cq_init_attr {
> u32 flags;
> };
>
> +struct ib_csum_cap_per_link {
> + uint32_t eth_csum_cap;
> + uint32_t ib_csum_cap;
> +};
> +
I generally don't like to waste this many bits on this little
information. 64 bits total for what only uses 4 bits right now, and
even on the high side would probably only ever use 8 or 12 bits, is
excessive.
That said, it's cleaner and easier to read than something like a double
shift where ib is lower 16 bits, eth is upper 16 bits, so I won't
request you change it, just register my eyebrow raise over the number of
bits used to record so little information. (In fairness, I thought
about make you shrink it down, but the area of the struct you are adding
this to is currently 64bit aligned and it is reasonably likely that the
next item will need 64bit alignment, so saving bits only to possibly
loose them to alignment is a exercise in futility)
> struct ib_device_attr {
> u64 fw_ver;
> __be64 sys_image_guid;
> @@ -229,6 +234,7 @@ struct ib_device_attr {
> struct ib_odp_caps odp_caps;
> uint64_t timestamp_mask;
> uint64_t hca_core_clock; /* in KHZ */
> + struct ib_csum_cap_per_link csum_cap;
> };
>
> enum ib_mtu {
> @@ -868,6 +874,10 @@ enum ib_qp_create_flags {
> IB_QP_CREATE_RESERVED_END = 1 << 31,
> };
>
> +enum ib_csum_cap_flags {
> + IB_CSUM_SUPPORT_UD = (1 << IB_QPT_UD),
> + IB_CSUM_SUPPORT_RAW = (1 << IB_QPT_RAW_PACKET),
> +};
>
> /*
> * Note: users may not call ib_close_qp or ib_destroy_qp from the event_handler
>
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
GPG KeyID: 0E572FDD
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]
next prev parent reply other threads:[~2015-09-18 2:39 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-16 15:56 [PATCH 0/3] Enable checksum offload capability reporting Bodong Wang
[not found] ` <cover.1442413048.git.bodong-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-09-16 15:56 ` [PATCH 1/3] IB/core: Add support of checksum capability reporting in ib verbs Bodong Wang
[not found] ` <490a38ab04a96f24500d647392e931c38853ba45.1442413048.git.bodong-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-09-16 17:07 ` Christoph Lameter
[not found] ` <alpine.DEB.2.11.1509161201100.22920-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2015-09-16 17:16 ` Bodong Wang
2015-09-18 2:39 ` Doug Ledford [this message]
2015-09-16 15:56 ` [PATCH 2/3] IB/uverbs: Add support for checksum capability reporting in user verbs Bodong Wang
2015-09-16 15:56 ` [PATCH 3/3] IB/mlx4: Report checksum offload cap when query device Bodong Wang
[not found] ` <68bea4df2c89e5457aaaccf914756bc309d742a7.1442413048.git.bodong-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-09-18 2:46 ` Doug Ledford
[not found] ` <55FB7AE8.2070304-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-09-21 21:41 ` Or Gerlitz
[not found] ` <CAJ3xEMg31JSPU2_gW0OGjC9rdTgDRcx=7LnuPncD6+gCE7nRMw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-09-21 21:59 ` Doug Ledford
[not found] ` <56007DDF.30502-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-09-22 4:45 ` Or Gerlitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55FB796B.2080506@redhat.com \
--to=dledford-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=bodong-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=moshel-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=wbd2905-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).