diff mbox series

[3/8] core/pci: Increase the max slot string size

Message ID 20190318061058.3753-3-oohall@gmail.com
State Accepted
Headers show
Series [1/8] hdata/iohub: Look for IOVPD on P9 | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (2ba5ce84a197ee61423355f443a3ff3eea185ff1)
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot fail Test snowpatch/job/snowpatch-skiboot on branch master
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot-dco success Signed-off-by present

Commit Message

Oliver O'Halloran March 18, 2019, 6:10 a.m. UTC
The maximum string length for the slot label / device location code in
the PCI summary is currently 32 characters. This results in some IBM
location codes being truncated due to their length, e.g.

PHB#0001:02:11.0 [SWDN]  SLOT=C11  x8
PHB#0001:13:00.0 [EP  ] *snip* LOC_CODE=U78D3.ND1.WZS004A-P1-C
PHB#0001:13:00.1 [EP  ] *snip* LOC_CODE=U78D3.ND1.WZS004A-P1-C
PHB#0001:13:00.2 [EP  ] *snip* LOC_CODE=U78D3.ND1.WZS004A-P1-C
PHB#0001:13:00.3 [EP  ] *snip* LOC_CODE=U78D3.ND1.WZS004A-P1-C

Which obscure the actual location of the card, and it looks bad. This
patch increases the maximum length of the label string to 80 characters
since that's the maximum length for a location code.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
 core/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Vasant Hegde March 19, 2019, 10:52 a.m. UTC | #1
On 03/18/2019 11:40 AM, Oliver O'Halloran wrote:
> The maximum string length for the slot label / device location code in
> the PCI summary is currently 32 characters. This results in some IBM
> location codes being truncated due to their length, e.g.
> 
> PHB#0001:02:11.0 [SWDN]  SLOT=C11  x8
> PHB#0001:13:00.0 [EP  ] *snip* LOC_CODE=U78D3.ND1.WZS004A-P1-C
> PHB#0001:13:00.1 [EP  ] *snip* LOC_CODE=U78D3.ND1.WZS004A-P1-C
> PHB#0001:13:00.2 [EP  ] *snip* LOC_CODE=U78D3.ND1.WZS004A-P1-C
> PHB#0001:13:00.3 [EP  ] *snip* LOC_CODE=U78D3.ND1.WZS004A-P1-C
> 
> Which obscure the actual location of the card, and it looks bad. This
> patch increases the maximum length of the label string to 80 characters
> since that's the maximum length for a location code. >
> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
> ---
>   core/pci.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/core/pci.c b/core/pci.c
> index 454b50102e59..7dbe6aace69e 100644
> --- a/core/pci.c
> +++ b/core/pci.c
> @@ -1471,7 +1471,7 @@ static void pci_print_summary_line(struct phb *phb, struct pci_device *pd,
>   {
>   	const char *label, *dtype, *s;
>   	u32 vdid;
> -#define MAX_SLOTSTR 32
> +#define MAX_SLOTSTR 80

May be we can replace this macro with `LOC_CODE_SIZE`

-Vasant
Oliver O'Halloran March 20, 2019, 5:19 a.m. UTC | #2
On Tue, Mar 19, 2019 at 9:52 PM Vasant Hegde
<hegdevasant@linux.vnet.ibm.com> wrote:
>
> On 03/18/2019 11:40 AM, Oliver O'Halloran wrote:
> > The maximum string length for the slot label / device location code in
> > the PCI summary is currently 32 characters. This results in some IBM
> > location codes being truncated due to their length, e.g.
> >
> > PHB#0001:02:11.0 [SWDN]  SLOT=C11  x8
> > PHB#0001:13:00.0 [EP  ] *snip* LOC_CODE=U78D3.ND1.WZS004A-P1-C
> > PHB#0001:13:00.1 [EP  ] *snip* LOC_CODE=U78D3.ND1.WZS004A-P1-C
> > PHB#0001:13:00.2 [EP  ] *snip* LOC_CODE=U78D3.ND1.WZS004A-P1-C
> > PHB#0001:13:00.3 [EP  ] *snip* LOC_CODE=U78D3.ND1.WZS004A-P1-C
> >
> > Which obscure the actual location of the card, and it looks bad. This
> > patch increases the maximum length of the label string to 80 characters
> > since that's the maximum length for a location code. >
> > Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
> > ---
> >   core/pci.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/core/pci.c b/core/pci.c
> > index 454b50102e59..7dbe6aace69e 100644
> > --- a/core/pci.c
> > +++ b/core/pci.c
> > @@ -1471,7 +1471,7 @@ static void pci_print_summary_line(struct phb *phb, struct pci_device *pd,
> >   {
> >       const char *label, *dtype, *s;
> >       u32 vdid;
> > -#define MAX_SLOTSTR 32
> > +#define MAX_SLOTSTR 80
>
> May be we can replace this macro with `LOC_CODE_SIZE`

Wouldn't hurt. I'll send a follow up patch after this gets merged if
there aren't any other comments.

>
> -Vasant
>
diff mbox series

Patch

diff --git a/core/pci.c b/core/pci.c
index 454b50102e59..7dbe6aace69e 100644
--- a/core/pci.c
+++ b/core/pci.c
@@ -1471,7 +1471,7 @@  static void pci_print_summary_line(struct phb *phb, struct pci_device *pd,
 {
 	const char *label, *dtype, *s;
 	u32 vdid;
-#define MAX_SLOTSTR 32
+#define MAX_SLOTSTR 80
 	char slotstr[MAX_SLOTSTR  + 1] = { 0, };
 
 	pci_cfg_read32(phb, pd->bdfn, 0, &vdid);