[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACKFLik=7nTXHGUiTQH=aAsY=3sxd39ouZLEYkN2hj8rRHetsw@mail.gmail.com>
Date: Tue, 8 Apr 2025 11:25:44 -0700
From: Michael Chan <michael.chan@...adcom.com>
To: Ido Schimmel <idosch@...sch.org>
Cc: Damodharam Ammepalli <damodharam.ammepalli@...adcom.com>, davem@...emloft.net,
netdev@...r.kernel.org, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, andrew@...n.ch, horms@...nel.org, danieller@...dia.com,
andrew.gospodarek@...adcom.com, petrm@...dia.com
Subject: Re: [PATCH net 2/2] ethtool: cmis: use u16 for calculated read_write_len_ext
On Mon, Apr 7, 2025 at 9:23 AM Ido Schimmel <idosch@...sch.org> wrote:
>
> To be clear, this is what I'm suggesting [1] and it doesn't involve
> setting args->req.epl_len to zero, so I'm not sure what was tested.
>
> Basically, setting maximum length of read or write to 128 bytes as the
> kernel does not currently support auto paging (even if the transceiver
> module does) and will not try to perform cross-page reads or writes.
Ido, do you want to post your patch formally? Damodharam has tested
it and he is providing his:
Tested-by: Damodharam Ammepalli <damodharam.ammepalli@...adcom.com>
I'll drop this patch and repost patch #1 only. Thanks.
>
> [1]
> diff --git a/net/ethtool/cmis.h b/net/ethtool/cmis.h
> index 1e790413db0e..4a9a946cabf0 100644
> --- a/net/ethtool/cmis.h
> +++ b/net/ethtool/cmis.h
> @@ -101,7 +101,6 @@ struct ethtool_cmis_cdb_rpl {
> };
>
> u32 ethtool_cmis_get_max_lpl_size(u8 num_of_byte_octs);
> -u32 ethtool_cmis_get_max_epl_size(u8 num_of_byte_octs);
>
> void ethtool_cmis_cdb_compose_args(struct ethtool_cmis_cdb_cmd_args *args,
> enum ethtool_cmis_cdb_cmd_id cmd, u8 *lpl,
> diff --git a/net/ethtool/cmis_cdb.c b/net/ethtool/cmis_cdb.c
> index d159dc121bde..0e2691ccb0df 100644
> --- a/net/ethtool/cmis_cdb.c
> +++ b/net/ethtool/cmis_cdb.c
> @@ -16,15 +16,6 @@ u32 ethtool_cmis_get_max_lpl_size(u8 num_of_byte_octs)
> return 8 * (1 + min_t(u8, num_of_byte_octs, 15));
> }
>
> -/* For accessing the EPL field on page 9Fh, the allowable length extension is
> - * min(i, 255) byte octets where i specifies the allowable additional number of
> - * byte octets in a READ or a WRITE.
> - */
> -u32 ethtool_cmis_get_max_epl_size(u8 num_of_byte_octs)
> -{
> - return 8 * (1 + min_t(u8, num_of_byte_octs, 255));
> -}
> -
> void ethtool_cmis_cdb_compose_args(struct ethtool_cmis_cdb_cmd_args *args,
> enum ethtool_cmis_cdb_cmd_id cmd, u8 *lpl,
> u8 lpl_len, u8 *epl, u16 epl_len,
> @@ -33,19 +24,16 @@ void ethtool_cmis_cdb_compose_args(struct ethtool_cmis_cdb_cmd_args *args,
> {
> args->req.id = cpu_to_be16(cmd);
> args->req.lpl_len = lpl_len;
> - if (lpl) {
> + if (lpl)
> memcpy(args->req.payload, lpl, args->req.lpl_len);
> - args->read_write_len_ext =
> - ethtool_cmis_get_max_lpl_size(read_write_len_ext);
> - }
> if (epl) {
> args->req.epl_len = cpu_to_be16(epl_len);
> args->req.epl = epl;
> - args->read_write_len_ext =
> - ethtool_cmis_get_max_epl_size(read_write_len_ext);
> }
>
> args->max_duration = max_duration;
> + args->read_write_len_ext =
> + ethtool_cmis_get_max_lpl_size(read_write_len_ext);
> args->msleep_pre_rpl = msleep_pre_rpl;
> args->rpl_exp_len = rpl_exp_len;
> args->flags = flags;
Download attachment "smime.p7s" of type "application/pkcs7-signature" (4196 bytes)
Powered by blists - more mailing lists